@everymatrix/loyalty-shop 0.1.9 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,316 @@
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";
3
+ if (typeof window < "u") {
4
+ let y = function(t) {
5
+ return function(...l) {
6
+ try {
7
+ return t.apply(this, l);
8
+ } catch (d) {
9
+ 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
+ return !1;
11
+ throw d;
12
+ }
13
+ };
14
+ };
15
+ customElements.define = y(customElements.define), import("./LoyaltyPointsCard-4xMK1Yj3.js").then((t) => t.a).then((t) => {
16
+ const l = t.default || t;
17
+ customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card", l.element || l);
18
+ }).catch((t) => {
19
+ console.error("BOOT ERROR:", t);
20
+ });
21
+ }
22
+ const Te = {
23
+ en: {
24
+ tokens: "Tokens",
25
+ buyNow: "Buy Now",
26
+ back: "Back"
27
+ },
28
+ tr: {
29
+ tokens: "Tokens",
30
+ buyNow: "Şimdi Satın Al",
31
+ back: "Geri"
32
+ },
33
+ da: {
34
+ tokens: "Tokens",
35
+ buyNow: "Køb nu",
36
+ back: "Tilbage"
37
+ },
38
+ de: {
39
+ tokens: "Token",
40
+ buyNow: "Jetzt kaufen",
41
+ back: "Zurück"
42
+ },
43
+ nl: {
44
+ tokens: "Tokens",
45
+ buyNow: "Nu kopen",
46
+ back: "Terug"
47
+ },
48
+ fr: {
49
+ tokens: "Jetons",
50
+ buyNow: "Acheter",
51
+ back: "Retour"
52
+ },
53
+ hu: {
54
+ tokens: "Tokenek",
55
+ buyNow: "Vásárlás",
56
+ back: "Vissza"
57
+ }
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 = {
61
+ hash: "svelte-ravnpu",
62
+ 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
+
64
+ @media (min-width: 768px) {.loyalty-shop-item__image.svelte-ravnpu {height:clamp(170px, 30vw, 400px);object-fit:cover;}
65
+ }`
66
+ };
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]) => {
71
+ Z(e, s);
72
+ });
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);
76
+ fetch(e.href).then((s) => s.json()).then((s) => {
77
+ Object.keys(s).forEach((_) => {
78
+ Z(_, s[_]);
79
+ });
80
+ }).catch((s) => {
81
+ console.log("loyalty shop item translation url err:", s);
82
+ });
83
+ };
84
+ he(() => {
85
+ E() && X();
86
+ }), J(() => {
87
+ if (r()) {
88
+ w(n, r(), !0);
89
+ return;
90
+ }
91
+ !u() || !g() || ye(
92
+ {
93
+ apiEndpoint: u(),
94
+ userSession: p(),
95
+ locale: c()
96
+ },
97
+ g()
98
+ ).then((e) => {
99
+ w(n, e, !0);
100
+ }).catch((e) => console.error("Failed to load shop item:", e));
101
+ });
102
+ const $ = () => {
103
+ a(R) || !a(B) || !a(n) || Ce(a(n).displayName || a(n).presentation.displayName, a(n).id);
104
+ }, ee = async () => {
105
+ if (!u() || !a(n))
106
+ return;
107
+ w(R, !0), w(z, "");
108
+ const e = a(n).id;
109
+ try {
110
+ await be({ apiEndpoint: u(), userSession: p() }, e), xe(e), Ee();
111
+ } catch (s) {
112
+ w(z, s?.message ?? "Redeem failed", !0), Re(e, s);
113
+ } finally {
114
+ w(R, !1);
115
+ }
116
+ };
117
+ J(() => {
118
+ const e = (s) => {
119
+ s.data?.type === ge.REDEEM_REWARD_CONFIRMED && s.data?.id === a(n)?.id && ee();
120
+ };
121
+ return window.addEventListener("message", e), () => window.removeEventListener("message", e);
122
+ });
123
+ var te = {
124
+ get apiEndpoint() {
125
+ return u();
126
+ },
127
+ set apiEndpoint(e = "") {
128
+ u(e), i();
129
+ },
130
+ get userSession() {
131
+ return p();
132
+ },
133
+ set userSession(e = "") {
134
+ p(e), i();
135
+ },
136
+ get locale() {
137
+ return c();
138
+ },
139
+ set locale(e = "") {
140
+ c(e), i();
141
+ },
142
+ get itemId() {
143
+ return g();
144
+ },
145
+ set itemId(e = "") {
146
+ g(e), i();
147
+ },
148
+ get elevateReward() {
149
+ return r();
150
+ },
151
+ set elevateReward(e) {
152
+ r(e), i();
153
+ },
154
+ get translationUrl() {
155
+ return E();
156
+ },
157
+ set translationUrl(e) {
158
+ E(e), i();
159
+ }
160
+ }, D = _e(), ae = we(D);
161
+ {
162
+ var se = (e) => {
163
+ var s = ze(), _ = f(s), F = f(_);
164
+ {
165
+ var ne = (m) => {
166
+ var v = Oe();
167
+ O(() => {
168
+ q(v, "src", a(j) || Ue), q(v, "alt", a(V));
169
+ }), S(m, v);
170
+ };
171
+ U(F, (m) => {
172
+ a(j) && m(ne);
173
+ });
174
+ }
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, {
183
+ get apiEndpoint() {
184
+ return u();
185
+ },
186
+ get userSession() {
187
+ return p();
188
+ },
189
+ get locale() {
190
+ return c();
191
+ }
192
+ });
193
+ var de = x(H, 2);
194
+ {
195
+ 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);
198
+ };
199
+ U(de, (m) => {
200
+ a(A) && m(ue);
201
+ });
202
+ }
203
+ h(s), O(
204
+ (m, v) => {
205
+ I(oe, a(V)), I(ie, `${a(n).points ?? ""}
206
+ ${m ?? ""}`), k.disabled = !a(B) || a(R), I(le, v);
207
+ },
208
+ [() => l()("tokens"), () => l()("buyNow")]
209
+ ), Se("click", k, $), S(e, s);
210
+ };
211
+ U(ae, (e) => {
212
+ a(n) && e(se);
213
+ });
214
+ }
215
+ S(y, D);
216
+ var re = W(te);
217
+ return b(), re;
218
+ }
219
+ ce(["click"]);
220
+ G(
221
+ Y,
222
+ {
223
+ apiEndpoint: {},
224
+ userSession: {},
225
+ locale: {},
226
+ itemId: {},
227
+ elevateReward: {},
228
+ translationUrl: {}
229
+ },
230
+ [],
231
+ [],
232
+ { mode: "open" }
233
+ );
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 = {
238
+ get apiEndpoint() {
239
+ return l();
240
+ },
241
+ set apiEndpoint(r = "") {
242
+ l(r), i();
243
+ },
244
+ get userSession() {
245
+ return d();
246
+ },
247
+ set userSession(r = "") {
248
+ d(r), i();
249
+ },
250
+ get locale() {
251
+ return b();
252
+ },
253
+ set locale(r = "") {
254
+ b(r), i();
255
+ },
256
+ get itemId() {
257
+ return u();
258
+ },
259
+ set itemId(r = "") {
260
+ u(r), i();
261
+ },
262
+ get elevateReward() {
263
+ return p();
264
+ },
265
+ set elevateReward(r) {
266
+ p(r), i();
267
+ },
268
+ get translationUrl() {
269
+ return c();
270
+ },
271
+ set translationUrl(r) {
272
+ c(r), i();
273
+ }
274
+ };
275
+ return Y(y, {
276
+ get apiEndpoint() {
277
+ return l();
278
+ },
279
+ get userSession() {
280
+ return d();
281
+ },
282
+ get locale() {
283
+ return b();
284
+ },
285
+ get itemId() {
286
+ return u();
287
+ },
288
+ get elevateReward() {
289
+ return p();
290
+ },
291
+ get translationUrl() {
292
+ return c();
293
+ }
294
+ }), W(g);
295
+ }
296
+ customElements.define("loyalty-shop-item", G(
297
+ Q,
298
+ {
299
+ apiEndpoint: {},
300
+ userSession: {},
301
+ locale: {},
302
+ itemId: {},
303
+ elevateReward: {},
304
+ translationUrl: {}
305
+ },
306
+ [],
307
+ []
308
+ ));
309
+ const Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
310
+ __proto__: null,
311
+ default: Q
312
+ }, Symbol.toStringTag, { value: "Module" }));
313
+ export {
314
+ Y as L,
315
+ Be as a
316
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";const e=require("./LoyaltyPagination-BqAUwwMS.cjs"),G=require("./LoyaltyPointsCard-Cqwkhg0M.cjs");if(typeof window<"u"){let m=function(r){return function(...o){try{return r.apply(this,o)}catch(i){if(i instanceof DOMException&&i.message.includes("has already been used with this registry")||i instanceof Error&&i.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw i}}};customElements.define=m(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPointsCard-Cqwkhg0M.cjs")).then(r=>r.LoyaltyPointsCard_ce).then(r=>{const o=r.default||r;customElements.get("loyalty-points-card")||customElements.define("loyalty-points-card",o.element||o)}).catch(r=>{console.error("BOOT ERROR:",r)})}const K={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"}},W="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 Y=e.from_html('<img class="loyalty-shop-item__image svelte-ravnpu"/>'),Q=e.from_html('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'),X=e.from_html('<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>');const $={hash:"svelte-ravnpu",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;}
2
+
3
+ @media (min-width: 768px) {.loyalty-shop-item__image.svelte-ravnpu {height:clamp(170px, 30vw, 400px);object-fit:cover;}
4
+ }`};function x(m,r){e.push(r,!0),e.append_styles(m,$);const o=()=>e.store_get(e.$format,"$_",i),[i,v]=e.setup_stores(),l=e.prop(r,"apiEndpoint",7,""),d=e.prop(r,"userSession",7,""),p=e.prop(r,"locale",7,""),h=e.prop(r,"itemId",7,""),n=e.prop(r,"elevateReward"),f=e.prop(r,"translationUrl");e.setupI18n({withLocale:p(),translations:{}}),Object.entries(K).forEach(([t,a])=>{e.addNewMessages(t,a)});let s=e.state(e.proxy(n())),g=e.state(!1),S=e.state("");const k=e.user_derived(()=>e.get(s)?.presentation?.assets?.[0]??""),E=e.user_derived(()=>e.get(s)?.presentation?.displayName??e.get(s)?.displayName??""),R=e.user_derived(()=>e.get(s)?.presentation?.description??""),I=e.user_derived(()=>e.get(s)?.available==="true"),O=()=>{let t=new URL(f(),window.location.href);fetch(t.href).then(a=>a.json()).then(a=>{Object.keys(a).forEach(y=>{e.addNewMessages(y,a[y])})}).catch(a=>{console.log("loyalty shop item translation url err:",a)})};e.user_pre_effect(()=>{f()&&O()}),e.user_effect(()=>{if(n()){e.set(s,n(),!0);return}!l()||!h()||e.fetchShopItem({apiEndpoint:l(),userSession:d(),locale:p()},h()).then(t=>{e.set(s,t,!0)}).catch(t=>console.error("Failed to load shop item:",t))});const M=()=>{e.get(g)||!e.get(I)||!e.get(s)||e.sendRedeemRewardRequested(e.get(s).displayName||e.get(s).presentation.displayName,e.get(s).id)},P=async()=>{if(!l()||!e.get(s))return;e.set(g,!0),e.set(S,"");const t=e.get(s).id;try{await e.redeemReward({apiEndpoint:l(),userSession:d()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton()}catch(a){e.set(S,a?.message??"Redeem failed",!0),e.sendRedeemRewardFailed(t,a)}finally{e.set(g,!1)}};e.user_effect(()=>{const t=a=>{a.data?.type===e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED&&a.data?.id===e.get(s)?.id&&P()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});var z={get apiEndpoint(){return l()},set apiEndpoint(t=""){l(t),e.flushSync()},get userSession(){return d()},set userSession(t=""){d(t),e.flushSync()},get locale(){return p()},set locale(t=""){p(t),e.flushSync()},get itemId(){return h()},set itemId(t=""){h(t),e.flushSync()},get elevateReward(){return n()},set elevateReward(t){n(t),e.flushSync()},get translationUrl(){return f()},set translationUrl(t){f(t),e.flushSync()}},N=e.comment(),V=e.first_child(N);{var j=t=>{var a=X(),y=e.child(a),C=e.child(y);{var B=c=>{var u=Y();e.template_effect(()=>{e.set_attribute(u,"src",e.get(k)||W),e.set_attribute(u,"alt",e.get(E))}),e.append(c,u)};e.if_block(C,c=>{e.get(k)&&c(B)})}var b=e.sibling(C,2),D=e.child(b,!0);e.reset(b);var w=e.sibling(b,2),q=e.child(w);e.reset(w);var _=e.sibling(w,2),Z=e.child(_,!0);e.reset(_),e.reset(y);var L=e.sibling(y,2);G.LoyaltyPointsCard(L,{get apiEndpoint(){return l()},get userSession(){return d()},get locale(){return p()}});var F=e.sibling(L,2);{var H=c=>{var u=Q(),T=e.child(u),J=e.child(T,!0);e.reset(T),e.reset(u),e.template_effect(()=>e.set_text(J,e.get(R))),e.append(c,u)};e.if_block(F,c=>{e.get(R)&&c(H)})}e.reset(a),e.template_effect((c,u)=>{e.set_text(D,e.get(E)),e.set_text(q,`${e.get(s).points??""}
5
+ ${c??""}`),_.disabled=!e.get(I)||e.get(g),e.set_text(Z,u)},[()=>o()("tokens"),()=>o()("buyNow")]),e.delegated("click",_,M),e.append(t,a)};e.if_block(V,t=>{e.get(s)&&t(j)})}e.append(m,N);var A=e.pop(z);return v(),A}e.delegate(["click"]);e.create_custom_element(x,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[],{mode:"open"});function U(m,r){e.push(r,!0);let o=e.prop(r,"apiEndpoint",7,""),i=e.prop(r,"userSession",7,""),v=e.prop(r,"locale",7,""),l=e.prop(r,"itemId",7,""),d=e.prop(r,"elevateReward"),p=e.prop(r,"translationUrl");var h={get apiEndpoint(){return o()},set apiEndpoint(n=""){o(n),e.flushSync()},get userSession(){return i()},set userSession(n=""){i(n),e.flushSync()},get locale(){return v()},set locale(n=""){v(n),e.flushSync()},get itemId(){return l()},set itemId(n=""){l(n),e.flushSync()},get elevateReward(){return d()},set elevateReward(n){d(n),e.flushSync()},get translationUrl(){return p()},set translationUrl(n){p(n),e.flushSync()}};return x(m,{get apiEndpoint(){return o()},get userSession(){return i()},get locale(){return v()},get itemId(){return l()},get elevateReward(){return d()},get translationUrl(){return p()}}),e.pop(h)}customElements.define("loyalty-shop-item",e.create_custom_element(U,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[]));const ee=Object.freeze(Object.defineProperty({__proto__:null,default:U},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShopItem=x;exports.LoyaltyShopItem_ce=ee;
@@ -0,0 +1 @@
1
+ "use strict";const s=require("../components/LoyaltyShop-DLj15-su.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-DLj15-su.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;
@@ -0,0 +1,23 @@
1
+ import { L as a } from "../components/LoyaltyShop-BolB3kh1.js";
2
+ if (typeof window < "u") {
3
+ let s = function(e) {
4
+ return function(...n) {
5
+ try {
6
+ return e.apply(this, n);
7
+ } catch (t) {
8
+ 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"))
9
+ return !1;
10
+ throw t;
11
+ }
12
+ };
13
+ };
14
+ customElements.define = s(customElements.define), import("../components/LoyaltyShop-BolB3kh1.js").then((e) => e.a).then((e) => {
15
+ const n = e.default || e;
16
+ customElements.get("loyalty-shop") || customElements.define("loyalty-shop", n.element || n);
17
+ }).catch((e) => {
18
+ console.error("BOOT ERROR:", e);
19
+ });
20
+ }
21
+ export {
22
+ a as default
23
+ };
package/package.json CHANGED
@@ -1,23 +1,21 @@
1
1
  {
2
2
  "name": "@everymatrix/loyalty-shop",
3
- "version": "0.1.9",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
- "main": "es2015/loyalty-shop.cjs",
6
- "module": "esnext/loyalty-shop.js",
5
+ "main": "./esnext/loyalty-shop.cjs",
6
+ "module": "./esnext/loyalty-shop.js",
7
7
  "exports": {
8
8
  ".": {
9
+ "types": "./dist/index.d.ts",
9
10
  "import": "./esnext/loyalty-shop.js",
10
- "require": "./es2015/loyalty-shop.cjs"
11
+ "require": "./esnext/loyalty-shop.cjs",
12
+ "default": "./esnext/loyalty-shop.js"
11
13
  },
12
- "./es2015/loyalty-shop.cjs": "./es2015/loyalty-shop.cjs",
13
- "./es2015/loyalty-shop.js": "./es2015/loyalty-shop.js"
14
+ "./esnext/loyalty-shop.cjs": "./esnext/loyalty-shop.cjs",
15
+ "./esnext/loyalty-shop.js": "./esnext/loyalty-shop.js"
14
16
  },
15
- "files": [
16
- "svelte/",
17
- "es2015",
18
- "components"
19
- ],
17
+ "files": ["esnext", "components"],
20
18
  "publishConfig": {
21
19
  "access": "public"
22
20
  }
23
- }
21
+ }
@@ -1 +0,0 @@
1
- "use strict";if(typeof window!="undefined"){let n=function(e){return function(...s){try{return e.apply(this,s)}catch(t){if(t instanceof DOMException&&t.message.includes("has already been used with this registry")||t.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw t}}};customElements.define=n(customElements.define),Promise.resolve().then(()=>require("../components/LoyaltyShop-CIrwO8kv.cjs")).then(e=>e.LoyaltyShop_ce).then(({default:e})=>{!customElements.get("loyalty-shop")&&customElements.define("loyalty-shop",e.element)})}
@@ -1,16 +0,0 @@
1
- if (typeof window != "undefined") {
2
- let n = function(e) {
3
- return function(...s) {
4
- try {
5
- return e.apply(this, s);
6
- } catch (t) {
7
- if (t instanceof DOMException && t.message.includes("has already been used with this registry") || t.message.includes("Cannot define multiple custom elements with the same tag name"))
8
- return !1;
9
- throw t;
10
- }
11
- };
12
- };
13
- customElements.define = n(customElements.define), import("../components/LoyaltyShop-B-D5synj.js").then((e) => e.L).then(({ default: e }) => {
14
- !customElements.get("loyalty-shop") && customElements.define("loyalty-shop", e.element);
15
- });
16
- }