@everymatrix/loyalty-shop 0.2.0 → 0.2.1

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-B2XwqERr.cjs +14 -0
  2. package/components/LoyaltyPagination-B8amLojn.cjs +14 -0
  3. package/components/{LoyaltyPagination-CvGlrsHL.js → LoyaltyPagination-BqHc2i2H.js} +2841 -2576
  4. package/components/LoyaltyPagination-DOu-qNFO.js +7260 -0
  5. package/components/LoyaltyPointsCard-BjF9SVWO.js +249 -0
  6. package/components/LoyaltyPointsCard-C2Xj_0zZ.cjs +18 -0
  7. package/components/{LoyaltyPointsCard-4xMK1Yj3.js → LoyaltyPointsCard-DKq6yH_i.js} +60 -59
  8. package/components/LoyaltyPointsCard-DO9GoE9Q.cjs +18 -0
  9. package/components/{LoyaltyShop-BolB3kh1.js → LoyaltyShop-CBH93UYT.js} +168 -169
  10. package/components/LoyaltyShop-CCeVtHJ7.cjs +27 -0
  11. package/components/LoyaltyShop-CnX4zXMd.cjs +27 -0
  12. package/components/LoyaltyShop-aSar2Vkc.js +478 -0
  13. package/components/LoyaltyShopItem-BvxV4bEm.cjs +5 -0
  14. package/components/LoyaltyShopItem-CYoPPSZj.cjs +5 -0
  15. package/components/{LoyaltyShopItem-BF51hsPa.js → LoyaltyShopItem-DL7R43c_.js} +115 -109
  16. package/components/LoyaltyShopItem-bzNnPlQa.js +353 -0
  17. package/es2015/loyalty-shop.cjs +1 -0
  18. package/es2015/loyalty-shop.js +28 -0
  19. package/esnext/loyalty-shop.cjs +1 -1
  20. package/esnext/loyalty-shop.js +7 -2
  21. package/package.json +10 -4
  22. package/components/LoyaltyPagination-BfDVbl1b.js +0 -138
  23. package/components/LoyaltyPagination-BqAUwwMS.cjs +0 -16
  24. package/components/LoyaltyPagination-Ct4i2m7L.cjs +0 -12
  25. package/components/LoyaltyPagination-UwvULUW0.js +0 -137
  26. package/components/LoyaltyPointsCard-Cqwkhg0M.cjs +0 -18
  27. package/components/LoyaltyShop-B-D5synj.js +0 -6724
  28. package/components/LoyaltyShop-CIrwO8kv.cjs +0 -31
  29. package/components/LoyaltyShop-ChhuDPwH.js +0 -6624
  30. package/components/LoyaltyShop-DLj15-su.cjs +0 -27
  31. package/components/LoyaltyShopItem-lB3kVETK.cjs +0 -5
@@ -1,10 +1,15 @@
1
- import { y as ce, c as G, p as K, a as me, b as o, s as ve, d as Z, z as T, A as fe, B as he, C as J, E as w, F as ye, G as ge, m as a, f as _e, g as we, i as U, h as S, j as W, H as be, I as xe, J as Ee, K as Re, k as i, l as ke, n as f, o as x, r as h, t as O, q as I, L as Se, v as M, u as N, w as Ie, $ as Ne, M as Ce, N as q } from "./LoyaltyPagination-CvGlrsHL.js";
2
- import { L as Le } from "./LoyaltyPointsCard-4xMK1Yj3.js";
1
+ import { z as me, c as G, p as K, a as ve, b as o, s as fe, d as Z, A as N, B as he, C as ye, E as J, F as g, G as ge, H as _e, m as t, f as we, g as be, i as T, h as E, j as W, I as xe, J as Ee, K as Re, L as ke, k as i, l as Se, n as L, q as b, o as R, r as C, t as U, v as k, M as Ie, w as M, u as S, x as Ne, $ as Te, N as Le, O as q } from "./LoyaltyPagination-BqHc2i2H.js";
2
+ import { L as Ce } from "./LoyaltyPointsCard-DKq6yH_i.js";
3
+ typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {
4
+ }, globalThis.customElements = { define() {
5
+ }, get() {
6
+ }, whenDefined() {
7
+ } });
3
8
  if (typeof window < "u") {
4
- let y = function(t) {
9
+ let f = function(a) {
5
10
  return function(...l) {
6
11
  try {
7
- return t.apply(this, l);
12
+ return a.apply(this, l);
8
13
  } catch (d) {
9
14
  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"))
10
15
  return !1;
@@ -12,14 +17,14 @@ if (typeof window < "u") {
12
17
  }
13
18
  };
14
19
  };
15
- customElements.define = y(customElements.define), import("./LoyaltyPointsCard-4xMK1Yj3.js").then((t) => t.a).then((t) => {
16
- const l = t.default || t;
20
+ customElements.define = f(customElements.define), import("./LoyaltyPointsCard-DKq6yH_i.js").then((a) => a.a).then((a) => {
21
+ const l = a.default || a;
17
22
  customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card", l.element || l);
18
- }).catch((t) => {
19
- console.error("BOOT ERROR:", t);
23
+ }).catch((a) => {
24
+ console.error("BOOT ERROR:", a);
20
25
  });
21
26
  }
22
- const Te = {
27
+ const Ue = {
23
28
  en: {
24
29
  tokens: "Tokens",
25
30
  buyNow: "Buy Now",
@@ -55,68 +60,73 @@ const Te = {
55
60
  buyNow: "Vásárlás",
56
61
  back: "Vissza"
57
62
  }
58
- }, Ue = "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";
59
- var Oe = M('<img class="loyalty-shop-item__image svelte-ravnpu"/>'), Me = M('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'), ze = M('<div class="loyalty-shop-item svelte-ravnpu"><div class="loyalty-shop-item__card svelte-ravnpu"><!> <span class="loyalty-shop-item__title svelte-ravnpu"> </span> <span class="loyalty-shop-item__points svelte-ravnpu"> </span> <button class="loyalty-shop-item__button svelte-ravnpu" type="button"> </button></div> <!> <!></div>');
60
- const je = {
63
+ }, Me = "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";
64
+ var Oe = M('<img class="loyalty-shop-item__image svelte-ravnpu"/>'), ze = M('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'), je = M('<div class="loyalty-shop-item svelte-ravnpu"><div class="loyalty-shop-item__card svelte-ravnpu"><!> <span class="loyalty-shop-item__title svelte-ravnpu"> </span> <span class="loyalty-shop-item__points svelte-ravnpu"> </span> <button class="loyalty-shop-item__button svelte-ravnpu" type="button"> </button></div> <!> <!></div>');
65
+ const Ve = {
61
66
  hash: "svelte-ravnpu",
62
67
  code: `.loyalty-shop-item.svelte-ravnpu {display:flex;flex-direction:column;gap:12px;}.loyalty-shop-item__card.svelte-ravnpu {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.svelte-ravnpu {min-height:120px;}.loyalty-shop-item__image.svelte-ravnpu {width:100%;height:170px;border-radius:6px;}.loyalty-shop-item__title.svelte-ravnpu {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop-item__points.svelte-ravnpu {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop-item__button.svelte-ravnpu {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.svelte-ravnpu:disabled {opacity:0.4;cursor:default;}.loyalty-shop-item__description.svelte-ravnpu {color:var(--text-subtle, #dfe3e8);font-size:12px;line-height:1.4;margin:0;font-weight:500;min-height:120px;}
63
68
 
64
69
  @media (min-width: 768px) {.loyalty-shop-item__image.svelte-ravnpu {height:clamp(170px, 30vw, 400px);object-fit:cover;}
65
70
  }`
66
71
  };
67
- function Y(y, t) {
68
- K(t, !0), me(y, je);
69
- const l = () => Ie(Ne, "$_", d), [d, b] = ke(), u = o(t, "apiEndpoint", 7, ""), p = o(t, "userSession", 7, ""), c = o(t, "locale", 7, ""), g = o(t, "itemId", 7, ""), r = o(t, "elevateReward"), E = o(t, "translationUrl");
70
- ve({ withLocale: c(), translations: {} }), Object.entries(Te).forEach(([e, s]) => {
72
+ function Y(f, a) {
73
+ K(a, !0), ve(f, Ve);
74
+ const l = () => Ne(Te, "$_", d), [d, _] = Se(), u = o(a, "apiEndpoint", 7, ""), c = o(a, "userSession", 7, ""), p = o(a, "locale", 7, ""), h = o(a, "itemId", 7, ""), n = o(a, "elevateReward"), x = o(a, "translationUrl");
75
+ fe({ withLocale: p(), translations: {} }), Object.entries(Ue).forEach(([e, s]) => {
71
76
  Z(e, s);
72
77
  });
73
- let n = T(fe(r())), R = T(!1), z = T("");
74
- const j = N(() => a(n)?.presentation?.assets?.[0] ?? ""), V = N(() => a(n)?.presentation?.displayName ?? a(n)?.displayName ?? ""), A = N(() => a(n)?.presentation?.description ?? ""), B = N(() => a(n)?.available === "true"), X = () => {
75
- let e = new URL(E(), window.location.href);
78
+ let r = N(he(n())), w = N(!1), O = N("");
79
+ const z = S(() => t(r)?.presentation?.assets?.[0] ?? ""), j = S(() => t(r)?.presentation?.displayName ?? t(r)?.displayName ?? ""), V = S(() => t(r)?.presentation?.description ?? ""), A = S(() => t(r)?.available === "true"), X = () => {
80
+ let e = new URL(x(), window.location.href);
76
81
  fetch(e.href).then((s) => s.json()).then((s) => {
77
- Object.keys(s).forEach((_) => {
78
- Z(_, s[_]);
82
+ Object.keys(s).forEach((y) => {
83
+ Z(y, s[y]);
79
84
  });
80
85
  }).catch((s) => {
81
86
  console.log("loyalty shop item translation url err:", s);
82
87
  });
83
88
  };
84
- he(() => {
85
- E() && X();
89
+ ye(() => {
90
+ x() && X();
86
91
  }), J(() => {
87
- if (r()) {
88
- w(n, r(), !0);
92
+ if (n()) {
93
+ g(r, n(), !0);
89
94
  return;
90
95
  }
91
- !u() || !g() || ye(
96
+ if (!u() || !h())
97
+ return;
98
+ let e = !1;
99
+ return ge(
92
100
  {
93
101
  apiEndpoint: u(),
94
- userSession: p(),
95
- locale: c()
102
+ userSession: c(),
103
+ locale: p()
96
104
  },
97
- g()
98
- ).then((e) => {
99
- w(n, e, !0);
100
- }).catch((e) => console.error("Failed to load shop item:", e));
105
+ h()
106
+ ).then((s) => {
107
+ e || g(r, s, !0);
108
+ }).catch((s) => console.error("Failed to load shop item:", s)), () => {
109
+ e = !0;
110
+ };
101
111
  });
102
112
  const $ = () => {
103
- a(R) || !a(B) || !a(n) || Ce(a(n).displayName || a(n).presentation.displayName, a(n).id);
113
+ t(w) || !t(A) || !t(r) || Le(t(r).displayName || t(r).presentation.displayName, t(r).id);
104
114
  }, ee = async () => {
105
- if (!u() || !a(n))
115
+ if (!u() || !t(r) || t(w))
106
116
  return;
107
- w(R, !0), w(z, "");
108
- const e = a(n).id;
117
+ g(w, !0), g(O, "");
118
+ const e = t(r).id;
109
119
  try {
110
- await be({ apiEndpoint: u(), userSession: p() }, e), xe(e), Ee();
120
+ await xe({ apiEndpoint: u(), userSession: c() }, e), Ee(e), Re();
111
121
  } catch (s) {
112
- w(z, s?.message ?? "Redeem failed", !0), Re(e, s);
122
+ g(O, s?.message ?? "Redeem failed", !0), ke(e, s);
113
123
  } finally {
114
- w(R, !1);
124
+ g(w, !1);
115
125
  }
116
126
  };
117
127
  J(() => {
118
128
  const e = (s) => {
119
- s.data?.type === ge.REDEEM_REWARD_CONFIRMED && s.data?.id === a(n)?.id && ee();
129
+ s.data?.type === _e.REDEEM_REWARD_CONFIRMED && s.data?.id === t(r)?.id && ee();
120
130
  };
121
131
  return window.addEventListener("message", e), () => window.removeEventListener("message", e);
122
132
  });
@@ -128,95 +138,91 @@ function Y(y, t) {
128
138
  u(e), i();
129
139
  },
130
140
  get userSession() {
131
- return p();
141
+ return c();
132
142
  },
133
143
  set userSession(e = "") {
134
- p(e), i();
144
+ c(e), i();
135
145
  },
136
146
  get locale() {
137
- return c();
147
+ return p();
138
148
  },
139
149
  set locale(e = "") {
140
- c(e), i();
150
+ p(e), i();
141
151
  },
142
152
  get itemId() {
143
- return g();
153
+ return h();
144
154
  },
145
155
  set itemId(e = "") {
146
- g(e), i();
156
+ h(e), i();
147
157
  },
148
158
  get elevateReward() {
149
- return r();
159
+ return n();
150
160
  },
151
161
  set elevateReward(e) {
152
- r(e), i();
162
+ n(e), i();
153
163
  },
154
164
  get translationUrl() {
155
- return E();
165
+ return x();
156
166
  },
157
167
  set translationUrl(e) {
158
- E(e), i();
168
+ x(e), i();
159
169
  }
160
- }, D = _e(), ae = we(D);
170
+ }, B = we(), ae = be(B);
161
171
  {
162
172
  var se = (e) => {
163
- var s = ze(), _ = f(s), F = f(_);
173
+ var s = je(), y = L(s), D = L(y);
164
174
  {
165
- var ne = (m) => {
175
+ var re = (m) => {
166
176
  var v = Oe();
167
- O(() => {
168
- q(v, "src", a(j) || Ue), q(v, "alt", a(V));
169
- }), S(m, v);
177
+ U(() => {
178
+ q(v, "src", t(z) || Me), q(v, "alt", t(j));
179
+ }), E(m, v);
170
180
  };
171
- U(F, (m) => {
172
- a(j) && m(ne);
181
+ T(D, (m) => {
182
+ t(z) && m(re);
173
183
  });
174
184
  }
175
- var C = x(F, 2), oe = f(C, !0);
176
- h(C);
177
- var L = x(C, 2), ie = f(L);
178
- h(L);
179
- var k = x(L, 2), le = f(k, !0);
180
- h(k), h(_);
181
- var H = x(_, 2);
182
- Le(H, {
185
+ var H = b(D, 2), oe = R(H, !0), F = b(H, 2), ie = R(F), I = b(F, 2), le = R(I, !0);
186
+ C(y);
187
+ var P = b(y, 2);
188
+ Ce(P, {
183
189
  get apiEndpoint() {
184
190
  return u();
185
191
  },
186
192
  get userSession() {
187
- return p();
193
+ return c();
188
194
  },
189
195
  get locale() {
190
- return c();
196
+ return p();
191
197
  }
192
198
  });
193
- var de = x(H, 2);
199
+ var de = b(P, 2);
194
200
  {
195
201
  var ue = (m) => {
196
- var v = Me(), P = f(v), pe = f(P, !0);
197
- h(P), h(v), O(() => I(pe, a(A))), S(m, v);
202
+ var v = ze(), ce = L(v), pe = R(ce, !0);
203
+ C(v), U(() => k(pe, t(V))), E(m, v);
198
204
  };
199
- U(de, (m) => {
200
- a(A) && m(ue);
205
+ T(de, (m) => {
206
+ t(V) && m(ue);
201
207
  });
202
208
  }
203
- h(s), O(
209
+ C(s), U(
204
210
  (m, v) => {
205
- I(oe, a(V)), I(ie, `${a(n).points ?? ""}
206
- ${m ?? ""}`), k.disabled = !a(B) || a(R), I(le, v);
211
+ k(oe, t(j)), k(ie, `${t(r).points ?? ""}
212
+ ${m ?? ""}`), I.disabled = !t(A) || t(w), k(le, v);
207
213
  },
208
214
  [() => l()("tokens"), () => l()("buyNow")]
209
- ), Se("click", k, $), S(e, s);
215
+ ), Ie("click", I, $), E(e, s);
210
216
  };
211
- U(ae, (e) => {
212
- a(n) && e(se);
217
+ T(ae, (e) => {
218
+ t(r) && e(se);
213
219
  });
214
220
  }
215
- S(y, D);
216
- var re = W(te);
217
- return b(), re;
221
+ E(f, B);
222
+ var ne = W(te);
223
+ return _(), ne;
218
224
  }
219
- ce(["click"]);
225
+ me(["click"]);
220
226
  G(
221
227
  Y,
222
228
  {
@@ -231,48 +237,48 @@ G(
231
237
  [],
232
238
  { mode: "open" }
233
239
  );
234
- function Q(y, t) {
235
- K(t, !0);
236
- let l = o(t, "apiEndpoint", 7, ""), d = o(t, "userSession", 7, ""), b = o(t, "locale", 7, ""), u = o(t, "itemId", 7, ""), p = o(t, "elevateReward"), c = o(t, "translationUrl");
237
- var g = {
240
+ function Q(f, a) {
241
+ K(a, !0);
242
+ let l = o(a, "apiEndpoint", 7, ""), d = o(a, "userSession", 7, ""), _ = o(a, "locale", 7, ""), u = o(a, "itemId", 7, ""), c = o(a, "elevateReward"), p = o(a, "translationUrl");
243
+ var h = {
238
244
  get apiEndpoint() {
239
245
  return l();
240
246
  },
241
- set apiEndpoint(r = "") {
242
- l(r), i();
247
+ set apiEndpoint(n = "") {
248
+ l(n), i();
243
249
  },
244
250
  get userSession() {
245
251
  return d();
246
252
  },
247
- set userSession(r = "") {
248
- d(r), i();
253
+ set userSession(n = "") {
254
+ d(n), i();
249
255
  },
250
256
  get locale() {
251
- return b();
257
+ return _();
252
258
  },
253
- set locale(r = "") {
254
- b(r), i();
259
+ set locale(n = "") {
260
+ _(n), i();
255
261
  },
256
262
  get itemId() {
257
263
  return u();
258
264
  },
259
- set itemId(r = "") {
260
- u(r), i();
265
+ set itemId(n = "") {
266
+ u(n), i();
261
267
  },
262
268
  get elevateReward() {
263
- return p();
269
+ return c();
264
270
  },
265
- set elevateReward(r) {
266
- p(r), i();
271
+ set elevateReward(n) {
272
+ c(n), i();
267
273
  },
268
274
  get translationUrl() {
269
- return c();
275
+ return p();
270
276
  },
271
- set translationUrl(r) {
272
- c(r), i();
277
+ set translationUrl(n) {
278
+ p(n), i();
273
279
  }
274
280
  };
275
- return Y(y, {
281
+ return Y(f, {
276
282
  get apiEndpoint() {
277
283
  return l();
278
284
  },
@@ -280,18 +286,18 @@ function Q(y, t) {
280
286
  return d();
281
287
  },
282
288
  get locale() {
283
- return b();
289
+ return _();
284
290
  },
285
291
  get itemId() {
286
292
  return u();
287
293
  },
288
294
  get elevateReward() {
289
- return p();
295
+ return c();
290
296
  },
291
297
  get translationUrl() {
292
- return c();
298
+ return p();
293
299
  }
294
- }), W(g);
300
+ }), W(h);
295
301
  }
296
302
  customElements.define("loyalty-shop-item", G(
297
303
  Q,
@@ -306,11 +312,11 @@ customElements.define("loyalty-shop-item", G(
306
312
  [],
307
313
  []
308
314
  ));
309
- const Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
315
+ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
310
316
  __proto__: null,
311
317
  default: Q
312
318
  }, Symbol.toStringTag, { value: "Module" }));
313
319
  export {
314
320
  Y as L,
315
- Be as a
321
+ De as a
316
322
  };