@everymatrix/loyalty-shop 0.1.14 → 0.1.18

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 (26) hide show
  1. package/components/{LoyaltyPagination-B-q5gKJj.js → LoyaltyPagination-Bdx-smp6.js} +2756 -2359
  2. package/components/LoyaltyPagination-ClX3N4HA.cjs +16 -0
  3. package/components/LoyaltyPagination-DdJI2Ptf.cjs +16 -0
  4. package/components/LoyaltyPagination-kvqB9vki.js +7157 -0
  5. package/components/{LoyaltyPointsCard-yCHI1R_t.js → LoyaltyPointsCard-CpUgbUoh.js} +4 -5
  6. package/components/{LoyaltyPointsCard-Dh-TnTTL.cjs → LoyaltyPointsCard-DAwt9_VW.cjs} +3 -3
  7. package/components/{LoyaltyPointsCard-DRKV1-dq.js → LoyaltyPointsCard-Dte4kVve.js} +4 -5
  8. package/components/{LoyaltyPointsCard-BhdXzF1P.cjs → LoyaltyPointsCard-a-ERcIbF.cjs} +3 -3
  9. package/components/{LoyaltyShop-DoIx97J9.js → LoyaltyShop-B5kW3Kng.js} +223 -256
  10. package/components/{LoyaltyShop-CtNpYAKa.js → LoyaltyShop-D4hhy3SS.js} +227 -260
  11. package/components/LoyaltyShop-Dvy8bKVO.cjs +27 -0
  12. package/components/LoyaltyShop-ICV4lgAz.cjs +27 -0
  13. package/components/{LoyaltyShopItem-C2xuJLoW.js → LoyaltyShopItem-B-9ignkf.js} +26 -29
  14. package/components/{LoyaltyShopItem-BRiUNphq.cjs → LoyaltyShopItem-DCnDun5S.cjs} +3 -3
  15. package/components/{LoyaltyShopItem-D_oViqJP.cjs → LoyaltyShopItem-DY4h5OAR.cjs} +3 -3
  16. package/components/{LoyaltyShopItem-bXQ_G5NK.js → LoyaltyShopItem-Dwm024JF.js} +27 -30
  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/LoyaltyPagination-Boz7CVJt.cjs +0 -16
  23. package/components/LoyaltyPagination-CEvN3M3n.cjs +0 -16
  24. package/components/LoyaltyPagination-Z_igiBkY.js +0 -6754
  25. package/components/LoyaltyShop-BsZThRDe.cjs +0 -27
  26. package/components/LoyaltyShop-Cx8CxsMn.cjs +0 -27
@@ -0,0 +1,27 @@
1
+ typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-ClX3N4HA.cjs"),ve=require("./LoyaltyShopItem-DCnDun5S.cjs");if(typeof window<"u"){let m=function(n){return function(...l){try{return n.apply(this,l)}catch(r){if(r instanceof DOMException&&r.message.includes("has already been used with this registry")||r instanceof Error&&r.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw r}}};customElements.define=m(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPagination-ClX3N4HA.cjs")).then(n=>n.LoyaltyPagination_ce).then(n=>{const l=n.default||n;customElements.get("loyalty-pagination")||customElements.define("loyalty-pagination",l.element||l)}).catch(n=>{console.error("BOOT ERROR:",n)})}if(typeof window<"u"){let m=function(n){return function(...l){try{return n.apply(this,l)}catch(r){if(r instanceof DOMException&&r.message.includes("has already been used with this registry")||r instanceof Error&&r.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw r}}};customElements.define=m(customElements.define),Promise.resolve().then(()=>require("./LoyaltyShopItem-DCnDun5S.cjs")).then(n=>n.LoyaltyShopItem_ce).then(n=>{const l=n.default||n;customElements.get("loyalty-shop-item")||customElements.define("loyalty-shop-item",l.element||l)}).catch(n=>{console.error("BOOT ERROR:",n)})}const _e={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."}},be="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 ke=e.from_html('<div class="loyalty-shop__item loyalty-shop__item--skeleton svelte-1f1q033"><div class="loyalty-shop__item-image skeleton-box svelte-1f1q033"></div> <div class="loyalty-shop__item-title skeleton-line svelte-1f1q033"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short svelte-1f1q033"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box svelte-1f1q033"></div></div>'),we=e.from_html('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton svelte-1f1q033"></div>'),Ee=e.from_html('<div class="loyalty-shop__unavailable svelte-1f1q033"> </div>'),xe=e.from_html('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container svelte-1f1q033"><img class="loyalty-shop__item-image svelte-1f1q033"/></div> <span class="loyalty-shop__item-title svelte-1f1q033"> </span> <span class="loyalty-shop__item-points svelte-1f1q033"> </span> <button class="loyalty-shop__item-button svelte-1f1q033" type="button"> </button></div>'),Se=e.from_html('<div class="load-more-sentinel svelte-1f1q033" aria-hidden="true"></div>'),qe=e.from_html('<div class="loyalty-shop__grid svelte-1f1q033"></div> <!> <!>',1),Ie=e.from_html('<div class="loyalty-shop svelte-1f1q033"><!></div>');const Le={hash:"svelte-1f1q033",code:`.loyalty-shop.svelte-1f1q033 {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.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid.svelte-1f1q033 {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item.svelte-1f1q033 {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.svelte-1f1q033 {opacity:1;}.loyalty-shop__item-image.svelte-1f1q033 {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item-title.svelte-1f1q033 {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop__item-points.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop__item-button.svelte-1f1q033 {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-1f1q033:disabled {opacity:0.4;cursor:default;}.skeleton-box.svelte-1f1q033 {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: svelte-1f1q033-shimmer 3s linear infinite;border-radius:6px;}.skeleton-line.svelte-1f1q033 {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: svelte-1f1q033-shimmer 3s linear infinite;}.skeleton-line--short.svelte-1f1q033 {width:40%;}.loyalty-shop__item--skeleton.svelte-1f1q033 {display:flex;flex-direction:column;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-image:where(.svelte-1f1q033) {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-title:where(.svelte-1f1q033) {width:90%;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-points:where(.svelte-1f1q033) {width:40%;}.loyalty-shop__item-button-skeleton.svelte-1f1q033 {margin-top:auto;width:100%;height:40px;border-radius:6px;}.loyalty-shop__item-image-container.svelte-1f1q033 {cursor:pointer;}
14
+
15
+ @keyframes svelte-1f1q033-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.svelte-1f1q033 {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item.svelte-1f1q033 {width:100%;height:100%;box-sizing:border-box;}.loyalty-shop__item-image.svelte-1f1q033 {height:200px;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-image:where(.svelte-1f1q033) {height:200px;}
26
+ }`};function B(m,n){e.push(n,!0),e.append_styles(m,Le);const l=()=>e.store_get(e.$format,"$_",r),[r,k]=e.setup_stores(),p=e.prop(n,"apiEndpoint",7,""),c=e.prop(n,"userSession",7,""),f=e.prop(n,"locale",7,""),a=e.prop(n,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),S=e.prop(n,"translationUrl");e.setupI18n({withLocale:f(),translations:{}});const Y=async()=>{try{const t=new URL(S(),window.location.href),o=await fetch(t.href);if(!o.ok)throw new Error("Failed to fetch translations");const s=await o.json();Object.entries(s).forEach(([i,_])=>{e.addNewMessages(i,_)})}catch(t){console.error("loyalty shop translation url err:",t)}};Object.entries(_e).forEach(([t,o])=>{e.addNewMessages(t,o)});let u=e.state(e.proxy([])),w=e.state(void 0),q=e.state(0),h=e.state(0),v=e.state(e.proxy(e.MOBILE_LOAD_ITEMS)),C=e.state(!1),R=e.state(!1),E=e.state(void 0),y=e.state(!1),I=e.state(void 0),L=0;const Z=e.user_derived(()=>typeof a()=="number"?a():parseInt(a(),e.ITEMS_LIMIT_DEFAULT)||e.ITEMS_LIMIT_DEFAULT),j=()=>{if(!p()||!c())return;e.set(C,!0),e.set(R,!1);const t=++L,o=e.get(y)&&e.get(h)>0;e.fetchShopRewards({apiEndpoint:p(),userSession:c(),locale:f()},e.get(h),e.get(v)).then(s=>{if(t!==L)return;const i=s.data??[];e.set(q,s.total??0,!0),o?e.set(u,[...e.get(u),...i],!0):e.set(u,i,!0)}).catch(s=>{t===L&&(e.set(R,!0),console.error("Failed to load shop rewards:",s))}).finally(()=>{t===L&&e.set(C,!1)})};e.user_effect(()=>{p(),c(),f(),e.get(h),e.get(v),j()}),e.user_effect(()=>{const t=window.matchMedia("(max-width: 767px)"),o=s=>{e.set(y,s.matches,!0)};return e.set(y,t.matches,!0),t.addEventListener("change",o),()=>t.removeEventListener("change",o)}),e.user_effect(()=>{e.set(v,e.get(y)?e.MOBILE_LOAD_ITEMS:e.get(Z),!0)}),e.user_effect(()=>{if(!e.get(y)||!e.get(I))return;const t=new IntersectionObserver(o=>{o.some(s=>s.isIntersecting)&&e.get(u).length<e.get(q)&&e.set(h,e.get(h)+e.get(v))},{rootMargin:"200px"});return t.observe(e.get(I)),()=>t.disconnect()}),e.user_pre_effect(()=>{S()&&Y()});const J=t=>t.presentation?.assets?.[0]??be,N=t=>t.displayName??t.presentation?.displayName??"",O=t=>t.available==="true",W=t=>{e.get(E)||!O(t)||e.sendRedeemRewardRequested(N(t),t.id)},G=async t=>{if(!(!p()||e.get(E))){e.set(E,t,!0);try{await e.redeemReward({apiEndpoint:p(),userSession:c()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton(),j()}catch(o){e.sendRedeemRewardFailed(t,o)}finally{e.set(E,void 0)}}};e.user_effect(()=>{const t=o=>{const{type:s,id:i,source:_}=o.data??{};switch(s){case e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED:i&&e.get(u).some(T=>T.id===i)&&G(i);break;case e.EVENT_TYPES.BACK_BUTTON_CLICKED:_===e.SOURCE&&e.set(w,void 0);break}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const Q=()=>e.get(u).length?l()("generalError"):l()("noContent"),X=t=>{e.set(h,t,!0)},$=t=>{e.sendRewardItemClicked(t.displayName||t.presentation.displayName,t.id)},F=t=>{e.set(w,t,!0),$(t)},ee=t=>o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),F(t))};var te={get apiEndpoint(){return p()},set apiEndpoint(t=""){p(t),e.flushSync()},get userSession(){return c()},set userSession(t=""){c(t),e.flushSync()},get locale(){return f()},set locale(t=""){f(t),e.flushSync()},get limitItem(){return a()},set limitItem(t=e.ITEMS_LIMIT_DEFAULT){a(t),e.flushSync()},get translationUrl(){return S()},set translationUrl(t){S(t),e.flushSync()}},P=Ie(),ne=e.child(P);{var oe=t=>{ve.LoyaltyShopItem(t,{get itemId(){return e.get(w).id},get elevateReward(){return e.get(w)},get apiEndpoint(){return p()},get userSession(){return c()},get locale(){return f()}})},se=t=>{var o=we();e.each(o,21,()=>Array(e.get(v)),e.index,(s,i,_,T)=>{var U=ke();e.append(s,U)}),e.reset(o),e.append(t,o)},le=t=>{var o=Ee(),s=e.child(o,!0);e.reset(o),e.template_effect(i=>e.set_text(s,i),[()=>Q()]),e.append(t,o)},re=t=>{var o=qe(),s=e.first_child(o);e.each(s,21,()=>e.get(u),g=>g.id,(g,d)=>{var b=xe();let V;var x=e.child(b),ie=e.user_derived(()=>ee(e.get(d))),H=e.child(x);e.reset(x);var D=e.sibling(x,2),de=e.child(D,!0);e.reset(D);var A=e.sibling(D,2),pe=e.child(A);e.reset(A);var M=e.sibling(A,2),ce=e.child(M,!0);e.reset(M),e.reset(b),e.template_effect((z,ge,ue,fe,me,he,ye)=>{V=e.set_class(b,1,"loyalty-shop__item svelte-1f1q033",null,V,z),e.set_attribute(H,"src",ge),e.set_attribute(H,"alt",ue),e.set_text(de,fe),e.set_text(pe,`${e.get(d).points??""}
27
+ ${me??""}`),M.disabled=he,e.set_text(ce,ye)},[()=>({"loyalty-shop__item--unavailable":!O(e.get(d))}),()=>J(e.get(d)),()=>N(e.get(d)),()=>N(e.get(d)),()=>l()("tokens"),()=>!O(e.get(d))||e.get(E)===e.get(d).id,()=>l()("buyNow")]),e.delegated("click",x,()=>F(e.get(d))),e.delegated("keydown",x,function(...z){e.get(ie)?.apply(this,z)}),e.delegated("click",M,()=>W(e.get(d))),e.append(g,b)}),e.reset(s);var i=e.sibling(s,2);{var _=g=>{e.LoyaltyPagination(g,{get offset(){return e.get(h)},get limit(){return e.get(v)},get total(){return e.get(q)},onPageChange:X,get locale(){return f()}})};e.if_block(i,g=>{e.get(y)||g(_)})}var T=e.sibling(i,2);{var U=g=>{var d=Se();e.bind_this(d,b=>e.set(I,b),()=>e.get(I)),e.append(g,d)};e.if_block(T,g=>{e.get(y)&&e.get(u).length<e.get(q)&&g(U)})}e.append(t,o)};e.if_block(ne,t=>{e.get(w)?t(oe):e.get(C)&&e.get(u).length===0?t(se,1):!e.get(u).length||e.get(R)?t(le,2):t(re,-1)})}e.reset(P),e.append(m,P);var ae=e.pop(te);return k(),ae}e.delegate(["click","keydown"]);e.create_custom_element(B,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[],{mode:"open"});function K(m,n){e.push(n,!0);let l=e.prop(n,"apiEndpoint",7,""),r=e.prop(n,"userSession",7,""),k=e.prop(n,"locale",7,""),p=e.prop(n,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),c=e.prop(n,"translationUrl");var f={get apiEndpoint(){return l()},set apiEndpoint(a=""){l(a),e.flushSync()},get userSession(){return r()},set userSession(a=""){r(a),e.flushSync()},get locale(){return k()},set locale(a=""){k(a),e.flushSync()},get limitItem(){return p()},set limitItem(a=e.ITEMS_LIMIT_DEFAULT){p(a),e.flushSync()},get translationUrl(){return c()},set translationUrl(a){c(a),e.flushSync()}};return B(m,{get apiEndpoint(){return l()},get userSession(){return r()},get locale(){return k()},get limitItem(){return p()},get translationUrl(){return c()}}),e.pop(f)}customElements.define("loyalty-shop",e.create_custom_element(K,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[]));const Te=Object.freeze(Object.defineProperty({__proto__:null,default:K},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShop=B;exports.LoyaltyShop_ce=Te;
@@ -0,0 +1,27 @@
1
+ var F=(f,o,l)=>new Promise((i,y)=>{var d=r=>{try{c(l.next(r))}catch(v){y(v)}},p=r=>{try{c(l.throw(r))}catch(v){y(v)}},c=r=>r.done?i(r.value):Promise.resolve(r.value).then(d,p);c((l=l.apply(f,o)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-DdJI2Ptf.cjs"),be=require("./LoyaltyShopItem-DY4h5OAR.cjs");if(typeof window!="undefined"){let f=function(o){return function(...l){try{return o.apply(this,l)}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=f(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPagination-DdJI2Ptf.cjs")).then(o=>o.LoyaltyPagination_ce).then(o=>{const l=o.default||o;customElements.get("loyalty-pagination")||customElements.define("loyalty-pagination",l.element||l)}).catch(o=>{console.error("BOOT ERROR:",o)})}if(typeof window!="undefined"){let f=function(o){return function(...l){try{return o.apply(this,l)}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=f(customElements.define),Promise.resolve().then(()=>require("./LoyaltyShopItem-DY4h5OAR.cjs")).then(o=>o.LoyaltyShopItem_ce).then(o=>{const l=o.default||o;customElements.get("loyalty-shop-item")||customElements.define("loyalty-shop-item",l.element||l)}).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."}},we="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 Ee=e.from_html('<div class="loyalty-shop__item loyalty-shop__item--skeleton svelte-1f1q033"><div class="loyalty-shop__item-image skeleton-box svelte-1f1q033"></div> <div class="loyalty-shop__item-title skeleton-line svelte-1f1q033"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short svelte-1f1q033"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box svelte-1f1q033"></div></div>'),xe=e.from_html('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton svelte-1f1q033"></div>'),Se=e.from_html('<div class="loyalty-shop__unavailable svelte-1f1q033"> </div>'),qe=e.from_html('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container svelte-1f1q033"><img class="loyalty-shop__item-image svelte-1f1q033"/></div> <span class="loyalty-shop__item-title svelte-1f1q033"> </span> <span class="loyalty-shop__item-points svelte-1f1q033"> </span> <button class="loyalty-shop__item-button svelte-1f1q033" type="button"> </button></div>'),Ie=e.from_html('<div class="load-more-sentinel svelte-1f1q033" aria-hidden="true"></div>'),Le=e.from_html('<div class="loyalty-shop__grid svelte-1f1q033"></div> <!> <!>',1),Te=e.from_html('<div class="loyalty-shop svelte-1f1q033"><!></div>');const Me={hash:"svelte-1f1q033",code:`.loyalty-shop.svelte-1f1q033 {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.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid.svelte-1f1q033 {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item.svelte-1f1q033 {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.svelte-1f1q033 {opacity:1;}.loyalty-shop__item-image.svelte-1f1q033 {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item-title.svelte-1f1q033 {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop__item-points.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop__item-button.svelte-1f1q033 {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-1f1q033:disabled {opacity:0.4;cursor:default;}.skeleton-box.svelte-1f1q033 {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: svelte-1f1q033-shimmer 3s linear infinite;border-radius:6px;}.skeleton-line.svelte-1f1q033 {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: svelte-1f1q033-shimmer 3s linear infinite;}.skeleton-line--short.svelte-1f1q033 {width:40%;}.loyalty-shop__item--skeleton.svelte-1f1q033 {display:flex;flex-direction:column;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-image:where(.svelte-1f1q033) {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-title:where(.svelte-1f1q033) {width:90%;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-points:where(.svelte-1f1q033) {width:40%;}.loyalty-shop__item-button-skeleton.svelte-1f1q033 {margin-top:auto;width:100%;height:40px;border-radius:6px;}.loyalty-shop__item-image-container.svelte-1f1q033 {cursor:pointer;}
14
+
15
+ @keyframes svelte-1f1q033-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.svelte-1f1q033 {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item.svelte-1f1q033 {width:100%;height:100%;box-sizing:border-box;}.loyalty-shop__item-image.svelte-1f1q033 {height:200px;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-image:where(.svelte-1f1q033) {height:200px;}
26
+ }`};function V(f,o){e.push(o,!0),e.append_styles(f,Me);const l=()=>e.store_get(e.$format,"$_",i),[i,y]=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),v=e.prop(o,"translationUrl");e.setupI18n({withLocale:c(),translations:{}});const G=()=>F(this,null,function*(){try{const t=new URL(v(),window.location.href),n=yield fetch(t.href);if(!n.ok)throw new Error("Failed to fetch translations");const s=yield n.json();Object.entries(s).forEach(([a,h])=>{e.addNewMessages(a,h)})}catch(t){console.error("loyalty shop translation url err:",t)}});Object.entries(ke).forEach(([t,n])=>{e.addNewMessages(t,n)});let m=e.state(e.proxy([])),x=e.state(void 0),L=e.state(0),b=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),H=()=>{if(!d()||!p())return;e.set(N,!0),e.set(O,!1);const t=++M,n=e.get(k)&&e.get(b)>0;e.fetchShopRewards({apiEndpoint:d(),userSession:p(),locale:c()},e.get(b),e.get(w)).then(s=>{var h,_;if(t!==M)return;const a=(h=s.data)!=null?h:[];e.set(L,(_=s.total)!=null?_:0,!0),n?e.set(m,[...e.get(m),...a],!0):e.set(m,a,!0)}).catch(s=>{t===M&&(e.set(O,!0),console.error("Failed to load shop rewards:",s))}).finally(()=>{t===M&&e.set(N,!1)})};e.user_effect(()=>{d(),p(),c(),e.get(b),e.get(w),H()}),e.user_effect(()=>{const t=window.matchMedia("(max-width: 767px)"),n=s=>{e.set(k,s.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(s=>s.isIntersecting)&&e.get(m).length<e.get(L)&&e.set(b,e.get(b)+e.get(w))},{rootMargin:"200px"});return t.observe(e.get(T)),()=>t.disconnect()}),e.user_pre_effect(()=>{v()&&G()});const X=t=>{var n,s,a;return(a=(s=(n=t.presentation)==null?void 0:n.assets)==null?void 0:s[0])!=null?a:we},P=t=>{var n,s,a;return(a=(s=t.displayName)!=null?s:(n=t.presentation)==null?void 0:n.displayName)!=null?a:""},U=t=>t.available==="true",$=t=>{e.get(S)||!U(t)||e.sendRedeemRewardRequested(P(t),t.id)},ee=t=>F(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(),H()}catch(n){e.sendRedeemRewardFailed(t,n)}finally{e.set(S,void 0)}}});e.user_effect(()=>{const t=n=>{var _;const{type:s,id:a,source:h}=(_=n.data)!=null?_:{};switch(s){case e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED:a&&e.get(m).some(q=>q.id===a)&&ee(a);break;case e.EVENT_TYPES.BACK_BUTTON_CLICKED:h===e.SOURCE&&e.set(x,void 0);break}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const te=()=>e.get(m).length?l()("generalError"):l()("noContent"),ne=t=>{e.set(b,t,!0)},oe=t=>{e.sendRewardItemClicked(t.displayName||t.presentation.displayName,t.id)},K=t=>{e.set(x,t,!0),oe(t)},se=t=>n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),K(t))};var le={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 v()},set translationUrl(t){v(t),e.flushSync()}},D=Te(),re=e.child(D);{var ae=t=>{be.LoyaltyShopItem(t,{get itemId(){return e.get(x).id},get elevateReward(){return e.get(x)},get apiEndpoint(){return d()},get userSession(){return p()},get locale(){return c()}})},ie=t=>{var n=xe();e.each(n,21,()=>Array(e.get(w)),e.index,(s,a,h,_)=>{var q=Ee();e.append(s,q)}),e.reset(n),e.append(t,n)},de=t=>{var n=Se(),s=e.child(n,!0);e.reset(n),e.template_effect(a=>e.set_text(s,a),[()=>te()]),e.append(t,n)},pe=t=>{var n=Le(),s=e.first_child(n);e.each(s,21,()=>e.get(m),u=>u.id,(u,g)=>{var E=qe();let Y;var I=e.child(E),ge=e.user_derived(()=>se(e.get(g))),Z=e.child(I);e.reset(I);var A=e.sibling(I,2),ue=e.child(A,!0);e.reset(A);var z=e.sibling(A,2),fe=e.child(z);e.reset(z);var C=e.sibling(z,2),me=e.child(C,!0);e.reset(C),e.reset(E),e.template_effect((B,R,he,ye,j,ve,_e)=>{var J;Y=e.set_class(E,1,"loyalty-shop__item svelte-1f1q033",null,Y,B),e.set_attribute(Z,"src",R),e.set_attribute(Z,"alt",he),e.set_text(ue,ye),e.set_text(fe,`${(J=e.get(g).points)!=null?J:""}
27
+ ${j!=null?j:""}`),C.disabled=ve,e.set_text(me,_e)},[()=>({"loyalty-shop__item--unavailable":!U(e.get(g))}),()=>X(e.get(g)),()=>P(e.get(g)),()=>P(e.get(g)),()=>l()("tokens"),()=>!U(e.get(g))||e.get(S)===e.get(g).id,()=>l()("buyNow")]),e.delegated("click",I,()=>K(e.get(g))),e.delegated("keydown",I,function(...B){var R;(R=e.get(ge))==null||R.apply(this,B)}),e.delegated("click",C,()=>$(e.get(g))),e.append(u,E)}),e.reset(s);var a=e.sibling(s,2);{var h=u=>{e.LoyaltyPagination(u,{get offset(){return e.get(b)},get limit(){return e.get(w)},get total(){return e.get(L)},onPageChange:ne,get locale(){return c()}})};e.if_block(a,u=>{e.get(k)||u(h)})}var _=e.sibling(a,2);{var q=u=>{var g=Ie();e.bind_this(g,E=>e.set(T,E),()=>e.get(T)),e.append(u,g)};e.if_block(_,u=>{e.get(k)&&e.get(m).length<e.get(L)&&u(q)})}e.append(t,n)};e.if_block(re,t=>{e.get(x)?t(ae):e.get(N)&&e.get(m).length===0?t(ie,1):!e.get(m).length||e.get(O)?t(de,2):t(pe,-1)})}e.reset(D),e.append(f,D);var ce=e.pop(le);return y(),ce}e.delegate(["click","keydown"]);e.create_custom_element(V,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[],{mode:"open"});function W(f,o){e.push(o,!0);let l=e.prop(o,"apiEndpoint",7,""),i=e.prop(o,"userSession",7,""),y=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 l()},set apiEndpoint(r=""){l(r),e.flushSync()},get userSession(){return i()},set userSession(r=""){i(r),e.flushSync()},get locale(){return y()},set locale(r=""){y(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 V(f,{get apiEndpoint(){return l()},get userSession(){return i()},get locale(){return y()},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 Ce=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShop=V;exports.LoyaltyShop_ce=Ce;
@@ -1,5 +1,5 @@
1
- import { y as pe, c as G, p as K, a as me, b as o, s as ve, d as Z, z as C, 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 M, q as I, v as O, u as T, L as Se, w as Ie, $ as Te, M as q } from "./LoyaltyPagination-B-q5gKJj.js";
2
- import { L as Ne } from "./LoyaltyPointsCard-yCHI1R_t.js";
1
+ import { y as pe, c as G, p as K, a as me, b as o, s as ve, d as Z, z as C, 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 M, q as I, L as Se, v as O, u as N, w as Ie, $ as Ne, M as Te, N as q } from "./LoyaltyPagination-Bdx-smp6.js";
2
+ import { L as Le } from "./LoyaltyPointsCard-CpUgbUoh.js";
3
3
  typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {
4
4
  }, globalThis.customElements = { define() {
5
5
  }, get() {
@@ -17,14 +17,14 @@ if (typeof window < "u") {
17
17
  }
18
18
  };
19
19
  };
20
- customElements.define = y(customElements.define), import("./LoyaltyPointsCard-yCHI1R_t.js").then((t) => t.a).then((t) => {
20
+ customElements.define = y(customElements.define), import("./LoyaltyPointsCard-CpUgbUoh.js").then((t) => t.a).then((t) => {
21
21
  const l = t.default || t;
22
22
  customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card", l.element || l);
23
23
  }).catch((t) => {
24
24
  console.error("BOOT ERROR:", t);
25
25
  });
26
26
  }
27
- const Le = {
27
+ const Ce = {
28
28
  en: {
29
29
  tokens: "Tokens",
30
30
  buyNow: "Buy Now",
@@ -60,9 +60,9 @@ const Le = {
60
60
  buyNow: "Vásárlás",
61
61
  back: "Vissza"
62
62
  }
63
- }, Ce = "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 Ue = O('<img class="loyalty-shop-item__image svelte-ravnpu"/>'), Me = O('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'), Oe = O('<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 ze = {
63
+ }, 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";
64
+ var Me = O('<img class="loyalty-shop-item__image svelte-ravnpu"/>'), Oe = O('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'), ze = O('<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 je = {
66
66
  hash: "svelte-ravnpu",
67
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;}
68
68
 
@@ -70,13 +70,13 @@ const ze = {
70
70
  }`
71
71
  };
72
72
  function Y(y, t) {
73
- K(t, !0), me(y, ze);
74
- const l = () => Ie(Te, "$_", d), [d, b] = ke(), u = o(t, "apiEndpoint", 7, ""), c = o(t, "userSession", 7, ""), p = o(t, "locale", 7, ""), g = o(t, "itemId", 7, ""), n = o(t, "elevateReward"), E = o(t, "translationUrl");
75
- ve({ withLocale: p(), translations: {} }), Object.entries(Le).forEach(([e, s]) => {
73
+ K(t, !0), me(y, je);
74
+ const l = () => Ie(Ne, "$_", d), [d, b] = ke(), u = o(t, "apiEndpoint", 7, ""), c = o(t, "userSession", 7, ""), p = o(t, "locale", 7, ""), g = o(t, "itemId", 7, ""), n = o(t, "elevateReward"), E = o(t, "translationUrl");
75
+ ve({ withLocale: p(), translations: {} }), Object.entries(Ce).forEach(([e, s]) => {
76
76
  Z(e, s);
77
77
  });
78
78
  let r = C(fe(n())), R = C(!1), z = C("");
79
- const j = T(() => a(r)?.presentation?.assets?.[0] ?? ""), V = T(() => a(r)?.presentation?.displayName ?? a(r)?.displayName ?? ""), A = T(() => a(r)?.presentation?.description ?? ""), B = T(() => a(r)?.available === "true"), X = () => {
79
+ const j = N(() => a(r)?.presentation?.assets?.[0] ?? ""), V = N(() => a(r)?.presentation?.displayName ?? a(r)?.displayName ?? ""), A = N(() => a(r)?.presentation?.description ?? ""), B = N(() => a(r)?.available === "true"), X = () => {
80
80
  let e = new URL(E(), window.location.href);
81
81
  fetch(e.href).then((s) => s.json()).then((s) => {
82
82
  Object.keys(s).forEach((_) => {
@@ -105,7 +105,7 @@ function Y(y, t) {
105
105
  }).catch((e) => console.error("Failed to load shop item:", e));
106
106
  });
107
107
  const $ = () => {
108
- a(R) || !a(B) || !a(r) || Se(a(r).displayName || a(r).presentation.displayName, a(r).id);
108
+ a(R) || !a(B) || !a(r) || Te(a(r).displayName || a(r).presentation.displayName, a(r).id);
109
109
  }, ee = async () => {
110
110
  if (!u() || !a(r))
111
111
  return;
@@ -165,28 +165,26 @@ function Y(y, t) {
165
165
  }, D = _e(), ae = we(D);
166
166
  {
167
167
  var se = (e) => {
168
- var s = Oe(), _ = f(s), H = f(_);
168
+ var s = ze(), _ = f(s), H = f(_);
169
169
  {
170
170
  var re = (m) => {
171
- var v = Ue();
171
+ var v = Me();
172
172
  M(() => {
173
- q(v, "src", a(j) || Ce), q(v, "alt", a(V));
173
+ q(v, "src", a(j) || Ue), q(v, "alt", a(V));
174
174
  }), S(m, v);
175
175
  };
176
176
  U(H, (m) => {
177
177
  a(j) && m(re);
178
178
  });
179
179
  }
180
- var N = x(H, 2), oe = f(N, !0);
181
- h(N);
182
- var L = x(N, 2), ie = f(L);
180
+ var T = x(H, 2), oe = f(T, !0);
181
+ h(T);
182
+ var L = x(T, 2), ie = f(L);
183
183
  h(L);
184
- var k = x(L, 2);
185
- k.__click = $;
186
- var le = f(k, !0);
184
+ var k = x(L, 2), le = f(k, !0);
187
185
  h(k), h(_);
188
186
  var F = x(_, 2);
189
- Ne(F, {
187
+ Le(F, {
190
188
  get apiEndpoint() {
191
189
  return u();
192
190
  },
@@ -200,7 +198,7 @@ function Y(y, t) {
200
198
  var de = x(F, 2);
201
199
  {
202
200
  var ue = (m) => {
203
- var v = Me(), P = f(v), ce = f(P, !0);
201
+ var v = Oe(), P = f(v), ce = f(P, !0);
204
202
  h(P), h(v), M(() => I(ce, a(A))), S(m, v);
205
203
  };
206
204
  U(de, (m) => {
@@ -213,7 +211,7 @@ function Y(y, t) {
213
211
  ${m ?? ""}`), k.disabled = !a(B) || a(R), I(le, v);
214
212
  },
215
213
  [() => l()("tokens"), () => l()("buyNow")]
216
- ), S(e, s);
214
+ ), Se("click", k, $), S(e, s);
217
215
  };
218
216
  U(ae, (e) => {
219
217
  a(r) && e(se);
@@ -236,7 +234,7 @@ G(
236
234
  },
237
235
  [],
238
236
  [],
239
- !0
237
+ { mode: "open" }
240
238
  );
241
239
  function Q(y, t) {
242
240
  K(t, !0);
@@ -311,14 +309,13 @@ customElements.define("loyalty-shop-item", G(
311
309
  translationUrl: {}
312
310
  },
313
311
  [],
314
- [],
315
- !1
312
+ []
316
313
  ));
317
- const Ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
314
+ const Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
318
315
  __proto__: null,
319
316
  default: Q
320
317
  }, Symbol.toStringTag, { value: "Module" }));
321
318
  export {
322
319
  Y as L,
323
- Ae as a
320
+ Be as a
324
321
  };
@@ -1,5 +1,5 @@
1
- typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-Boz7CVJt.cjs"),G=require("./LoyaltyPointsCard-BhdXzF1P.cjs");if(typeof window<"u"){let m=function(r){return function(...o){try{return r.apply(this,o)}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("./LoyaltyPointsCard-BhdXzF1P.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;}
1
+ typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-ClX3N4HA.cjs"),G=require("./LoyaltyPointsCard-a-ERcIbF.cjs");if(typeof window<"u"){let m=function(n){return function(...o){try{return n.apply(this,o)}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("./LoyaltyPointsCard-a-ERcIbF.cjs")).then(n=>n.LoyaltyPointsCard_ce).then(n=>{const o=n.default||n;customElements.get("loyalty-points-card")||customElements.define("loyalty-points-card",o.element||o)}).catch(n=>{console.error("BOOT ERROR:",n)})}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
2
 
3
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,"$_",l),[l,y]=e.setup_stores(),i=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"),v=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 E=e.user_derived(()=>e.get(s)?.presentation?.assets?.[0]??""),k=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"),M=()=>{let t=new URL(v(),window.location.href);fetch(t.href).then(a=>a.json()).then(a=>{Object.keys(a).forEach(f=>{e.addNewMessages(f,a[f])})}).catch(a=>{console.log("loyalty shop item translation url err:",a)})};e.user_pre_effect(()=>{v()&&M()}),e.user_effect(()=>{if(n()){e.set(s,n(),!0);return}!i()||!h()||e.fetchShopItem({apiEndpoint:i(),userSession:d(),locale:p()},h()).then(t=>{e.set(s,t,!0)}).catch(t=>console.error("Failed to load shop item:",t))});const O=()=>{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(!i()||!e.get(s))return;e.set(g,!0),e.set(S,"");const t=e.get(s).id;try{await e.redeemReward({apiEndpoint:i(),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 i()},set apiEndpoint(t=""){i(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 v()},set translationUrl(t){v(t),e.flushSync()}},N=e.comment(),V=e.first_child(N);{var j=t=>{var a=X(),f=e.child(a),T=e.child(f);{var A=c=>{var u=Y();e.template_effect(()=>{e.set_attribute(u,"src",e.get(E)||W),e.set_attribute(u,"alt",e.get(k))}),e.append(c,u)};e.if_block(T,c=>{e.get(E)&&c(A)})}var b=e.sibling(T,2),B=e.child(b,!0);e.reset(b);var w=e.sibling(b,2),H=e.child(w);e.reset(w);var _=e.sibling(w,2);_.__click=O;var q=e.child(_,!0);e.reset(_),e.reset(f);var L=e.sibling(f,2);G.LoyaltyPointsCard(L,{get apiEndpoint(){return i()},get userSession(){return d()},get locale(){return p()}});var Z=e.sibling(L,2);{var F=c=>{var u=Q(),C=e.child(u),J=e.child(C,!0);e.reset(C),e.reset(u),e.template_effect(()=>e.set_text(J,e.get(R))),e.append(c,u)};e.if_block(Z,c=>{e.get(R)&&c(F)})}e.reset(a),e.template_effect((c,u)=>{e.set_text(B,e.get(k)),e.set_text(H,`${e.get(s).points??""}
5
- ${c??""}`),_.disabled=!e.get(I)||e.get(g),e.set_text(q,u)},[()=>o()("tokens"),()=>o()("buyNow")]),e.append(t,a)};e.if_block(V,t=>{e.get(s)&&t(j)})}e.append(m,N);var D=e.pop(z);return y(),D}e.delegate(["click"]);e.create_custom_element(x,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[],!0);function U(m,r){e.push(r,!0);let o=e.prop(r,"apiEndpoint",7,""),l=e.prop(r,"userSession",7,""),y=e.prop(r,"locale",7,""),i=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 l()},set userSession(n=""){l(n),e.flushSync()},get locale(){return y()},set locale(n=""){y(n),e.flushSync()},get itemId(){return i()},set itemId(n=""){i(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 l()},get locale(){return y()},get itemId(){return i()},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:{}},[],[],!1));const ee=Object.freeze(Object.defineProperty({__proto__:null,default:U},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShopItem=x;exports.LoyaltyShopItem_ce=ee;
4
+ }`};function x(m,n){e.push(n,!0),e.append_styles(m,$);const o=()=>e.store_get(e.$format,"$_",l),[l,y]=e.setup_stores(),i=e.prop(n,"apiEndpoint",7,""),d=e.prop(n,"userSession",7,""),p=e.prop(n,"locale",7,""),h=e.prop(n,"itemId",7,""),r=e.prop(n,"elevateReward"),g=e.prop(n,"translationUrl");e.setupI18n({withLocale:p(),translations:{}}),Object.entries(K).forEach(([t,a])=>{e.addNewMessages(t,a)});let s=e.state(e.proxy(r())),v=e.state(!1),S=e.state("");const E=e.user_derived(()=>e.get(s)?.presentation?.assets?.[0]??""),k=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"),M=()=>{let t=new URL(g(),window.location.href);fetch(t.href).then(a=>a.json()).then(a=>{Object.keys(a).forEach(f=>{e.addNewMessages(f,a[f])})}).catch(a=>{console.log("loyalty shop item translation url err:",a)})};e.user_pre_effect(()=>{g()&&M()}),e.user_effect(()=>{if(r()){e.set(s,r(),!0);return}!i()||!h()||e.fetchShopItem({apiEndpoint:i(),userSession:d(),locale:p()},h()).then(t=>{e.set(s,t,!0)}).catch(t=>console.error("Failed to load shop item:",t))});const O=()=>{e.get(v)||!e.get(I)||!e.get(s)||e.sendRedeemRewardRequested(e.get(s).displayName||e.get(s).presentation.displayName,e.get(s).id)},P=async()=>{if(!i()||!e.get(s))return;e.set(v,!0),e.set(S,"");const t=e.get(s).id;try{await e.redeemReward({apiEndpoint:i(),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(v,!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 i()},set apiEndpoint(t=""){i(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 r()},set elevateReward(t){r(t),e.flushSync()},get translationUrl(){return g()},set translationUrl(t){g(t),e.flushSync()}},N=e.comment(),V=e.first_child(N);{var j=t=>{var a=X(),f=e.child(a),T=e.child(f);{var A=c=>{var u=Y();e.template_effect(()=>{e.set_attribute(u,"src",e.get(E)||W),e.set_attribute(u,"alt",e.get(k))}),e.append(c,u)};e.if_block(T,c=>{e.get(E)&&c(A)})}var b=e.sibling(T,2),B=e.child(b,!0);e.reset(b);var w=e.sibling(b,2),H=e.child(w);e.reset(w);var _=e.sibling(w,2),q=e.child(_,!0);e.reset(_),e.reset(f);var L=e.sibling(f,2);G.LoyaltyPointsCard(L,{get apiEndpoint(){return i()},get userSession(){return d()},get locale(){return p()}});var Z=e.sibling(L,2);{var F=c=>{var u=Q(),C=e.child(u),J=e.child(C,!0);e.reset(C),e.reset(u),e.template_effect(()=>e.set_text(J,e.get(R))),e.append(c,u)};e.if_block(Z,c=>{e.get(R)&&c(F)})}e.reset(a),e.template_effect((c,u)=>{e.set_text(B,e.get(k)),e.set_text(H,`${e.get(s).points??""}
5
+ ${c??""}`),_.disabled=!e.get(I)||e.get(v),e.set_text(q,u)},[()=>o()("tokens"),()=>o()("buyNow")]),e.delegated("click",_,O),e.append(t,a)};e.if_block(V,t=>{e.get(s)&&t(j)})}e.append(m,N);var D=e.pop(z);return y(),D}e.delegate(["click"]);e.create_custom_element(x,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[],{mode:"open"});function U(m,n){e.push(n,!0);let o=e.prop(n,"apiEndpoint",7,""),l=e.prop(n,"userSession",7,""),y=e.prop(n,"locale",7,""),i=e.prop(n,"itemId",7,""),d=e.prop(n,"elevateReward"),p=e.prop(n,"translationUrl");var h={get apiEndpoint(){return o()},set apiEndpoint(r=""){o(r),e.flushSync()},get userSession(){return l()},set userSession(r=""){l(r),e.flushSync()},get locale(){return y()},set locale(r=""){y(r),e.flushSync()},get itemId(){return i()},set itemId(r=""){i(r),e.flushSync()},get elevateReward(){return d()},set elevateReward(r){d(r),e.flushSync()},get translationUrl(){return p()},set translationUrl(r){p(r),e.flushSync()}};return x(m,{get apiEndpoint(){return o()},get userSession(){return l()},get locale(){return y()},get itemId(){return i()},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;
@@ -1,5 +1,5 @@
1
- var M=(y,n,o)=>new Promise((d,v)=>{var p=i=>{try{c(o.next(i))}catch(r){v(r)}},u=i=>{try{c(o.throw(i))}catch(r){v(r)}},c=i=>i.done?d(i.value):Promise.resolve(i.value).then(p,u);c((o=o.apply(y,n)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-CEvN3M3n.cjs"),K=require("./LoyaltyPointsCard-Dh-TnTTL.cjs");if(typeof window!="undefined"){let y=function(n){return function(...o){try{return n.apply(this,o)}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-Dh-TnTTL.cjs")).then(n=>n.LoyaltyPointsCard_ce).then(n=>{const o=n.default||n;customElements.get("loyalty-points-card")||customElements.define("loyalty-points-card",o.element||o)}).catch(n=>{console.error("BOOT ERROR:",n)})}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 svelte-ravnpu"/>'),X=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>'),$=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 ee={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;}
1
+ var M=(y,a,o)=>new Promise((d,g)=>{var p=i=>{try{c(o.next(i))}catch(r){g(r)}},u=i=>{try{c(o.throw(i))}catch(r){g(r)}},c=i=>i.done?d(i.value):Promise.resolve(i.value).then(p,u);c((o=o.apply(y,a)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-DdJI2Ptf.cjs"),K=require("./LoyaltyPointsCard-DAwt9_VW.cjs");if(typeof window!="undefined"){let y=function(a){return function(...o){try{return a.apply(this,o)}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-DAwt9_VW.cjs")).then(a=>a.LoyaltyPointsCard_ce).then(a=>{const o=a.default||a;customElements.get("loyalty-points-card")||customElements.define("loyalty-points-card",o.element||o)}).catch(a=>{console.error("BOOT ERROR:",a)})}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 svelte-ravnpu"/>'),X=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>'),$=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 ee={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
2
 
3
3
  @media (min-width: 768px) {.loyalty-shop-item__image.svelte-ravnpu {height:clamp(170px, 30vw, 400px);object-fit:cover;}
4
- }`};function k(y,n){e.push(n,!0),e.append_styles(y,ee);const o=()=>e.store_get(e.$format,"$_",d),[d,v]=e.setup_stores(),p=e.prop(n,"apiEndpoint",7,""),u=e.prop(n,"userSession",7,""),c=e.prop(n,"locale",7,""),i=e.prop(n,"itemId",7,""),r=e.prop(n,"elevateReward"),b=e.prop(n,"translationUrl");e.setupI18n({withLocale:c(),translations:{}}),Object.entries(W).forEach(([t,a])=>{e.addNewMessages(t,a)});let l=e.state(e.proxy(r())),w=e.state(!1),R=e.state("");const I=e.user_derived(()=>{var t,a,s,m;return(m=(s=(a=(t=e.get(l))==null?void 0:t.presentation)==null?void 0:a.assets)==null?void 0:s[0])!=null?m:""}),N=e.user_derived(()=>{var t,a,s,m,g;return(g=(m=(a=(t=e.get(l))==null?void 0:t.presentation)==null?void 0:a.displayName)!=null?m:(s=e.get(l))==null?void 0:s.displayName)!=null?g:""}),T=e.user_derived(()=>{var t,a,s;return(s=(a=(t=e.get(l))==null?void 0:t.presentation)==null?void 0:a.description)!=null?s:""}),L=e.user_derived(()=>{var t;return((t=e.get(l))==null?void 0:t.available)==="true"}),P=()=>{let t=new URL(b(),window.location.href);fetch(t.href).then(a=>a.json()).then(a=>{Object.keys(a).forEach(s=>{e.addNewMessages(s,a[s])})}).catch(a=>{console.log("loyalty shop item translation url err:",a)})};e.user_pre_effect(()=>{b()&&P()}),e.user_effect(()=>{if(r()){e.set(l,r(),!0);return}!p()||!i()||e.fetchShopItem({apiEndpoint:p(),userSession:u(),locale:c()},i()).then(t=>{e.set(l,t,!0)}).catch(t=>console.error("Failed to load shop item:",t))});const z=()=>{e.get(w)||!e.get(L)||!e.get(l)||e.sendRedeemRewardRequested(e.get(l).displayName||e.get(l).presentation.displayName,e.get(l).id)},V=()=>M(this,null,function*(){var a;if(!p()||!e.get(l))return;e.set(w,!0),e.set(R,"");const t=e.get(l).id;try{yield e.redeemReward({apiEndpoint:p(),userSession:u()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton()}catch(s){e.set(R,(a=s==null?void 0:s.message)!=null?a:"Redeem failed",!0),e.sendRedeemRewardFailed(t,s)}finally{e.set(w,!1)}});e.user_effect(()=>{const t=a=>{var s,m,g;((s=a.data)==null?void 0:s.type)===e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED&&((m=a.data)==null?void 0:m.id)===((g=e.get(l))==null?void 0:g.id)&&V()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});var j={get apiEndpoint(){return p()},set apiEndpoint(t=""){p(t),e.flushSync()},get userSession(){return u()},set userSession(t=""){u(t),e.flushSync()},get locale(){return c()},set locale(t=""){c(t),e.flushSync()},get itemId(){return i()},set itemId(t=""){i(t),e.flushSync()},get elevateReward(){return r()},set elevateReward(t){r(t),e.flushSync()},get translationUrl(){return b()},set translationUrl(t){b(t),e.flushSync()}},C=e.comment(),D=e.first_child(C);{var A=t=>{var a=$(),s=e.child(a),m=e.child(s);{var g=h=>{var f=Q();e.template_effect(()=>{e.set_attribute(f,"src",e.get(I)||Y),e.set_attribute(f,"alt",e.get(N))}),e.append(h,f)};e.if_block(m,h=>{e.get(I)&&h(g)})}var S=e.sibling(m,2),H=e.child(S,!0);e.reset(S);var E=e.sibling(S,2),q=e.child(E);e.reset(E);var x=e.sibling(E,2);x.__click=z;var Z=e.child(x,!0);e.reset(x),e.reset(s);var U=e.sibling(s,2);K.LoyaltyPointsCard(U,{get apiEndpoint(){return p()},get userSession(){return u()},get locale(){return c()}});var F=e.sibling(U,2);{var J=h=>{var f=X(),_=e.child(f),G=e.child(_,!0);e.reset(_),e.reset(f),e.template_effect(()=>e.set_text(G,e.get(T))),e.append(h,f)};e.if_block(F,h=>{e.get(T)&&h(J)})}e.reset(a),e.template_effect((h,f)=>{var _;e.set_text(H,e.get(N)),e.set_text(q,`${(_=e.get(l).points)!=null?_:""}
5
- ${h!=null?h:""}`),x.disabled=!e.get(L)||e.get(w),e.set_text(Z,f)},[()=>o()("tokens"),()=>o()("buyNow")]),e.append(t,a)};e.if_block(D,t=>{e.get(l)&&t(A)})}e.append(y,C);var B=e.pop(j);return v(),B}e.delegate(["click"]);e.create_custom_element(k,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[],!0);function O(y,n){e.push(n,!0);let o=e.prop(n,"apiEndpoint",7,""),d=e.prop(n,"userSession",7,""),v=e.prop(n,"locale",7,""),p=e.prop(n,"itemId",7,""),u=e.prop(n,"elevateReward"),c=e.prop(n,"translationUrl");var i={get apiEndpoint(){return o()},set apiEndpoint(r=""){o(r),e.flushSync()},get userSession(){return d()},set userSession(r=""){d(r),e.flushSync()},get locale(){return v()},set locale(r=""){v(r),e.flushSync()},get itemId(){return p()},set itemId(r=""){p(r),e.flushSync()},get elevateReward(){return u()},set elevateReward(r){u(r),e.flushSync()},get translationUrl(){return c()},set translationUrl(r){c(r),e.flushSync()}};return k(y,{get apiEndpoint(){return o()},get userSession(){return d()},get locale(){return v()},get itemId(){return p()},get elevateReward(){return u()},get translationUrl(){return c()}}),e.pop(i)}customElements.define("loyalty-shop-item",e.create_custom_element(O,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[],!1));const te=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShopItem=k;exports.LoyaltyShopItem_ce=te;
4
+ }`};function k(y,a){e.push(a,!0),e.append_styles(y,ee);const o=()=>e.store_get(e.$format,"$_",d),[d,g]=e.setup_stores(),p=e.prop(a,"apiEndpoint",7,""),u=e.prop(a,"userSession",7,""),c=e.prop(a,"locale",7,""),i=e.prop(a,"itemId",7,""),r=e.prop(a,"elevateReward"),b=e.prop(a,"translationUrl");e.setupI18n({withLocale:c(),translations:{}}),Object.entries(W).forEach(([t,n])=>{e.addNewMessages(t,n)});let l=e.state(e.proxy(r())),w=e.state(!1),R=e.state("");const I=e.user_derived(()=>{var t,n,s,m;return(m=(s=(n=(t=e.get(l))==null?void 0:t.presentation)==null?void 0:n.assets)==null?void 0:s[0])!=null?m:""}),N=e.user_derived(()=>{var t,n,s,m,v;return(v=(m=(n=(t=e.get(l))==null?void 0:t.presentation)==null?void 0:n.displayName)!=null?m:(s=e.get(l))==null?void 0:s.displayName)!=null?v:""}),T=e.user_derived(()=>{var t,n,s;return(s=(n=(t=e.get(l))==null?void 0:t.presentation)==null?void 0:n.description)!=null?s:""}),L=e.user_derived(()=>{var t;return((t=e.get(l))==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(s=>{e.addNewMessages(s,n[s])})}).catch(n=>{console.log("loyalty shop item translation url err:",n)})};e.user_pre_effect(()=>{b()&&P()}),e.user_effect(()=>{if(r()){e.set(l,r(),!0);return}!p()||!i()||e.fetchShopItem({apiEndpoint:p(),userSession:u(),locale:c()},i()).then(t=>{e.set(l,t,!0)}).catch(t=>console.error("Failed to load shop item:",t))});const z=()=>{e.get(w)||!e.get(L)||!e.get(l)||e.sendRedeemRewardRequested(e.get(l).displayName||e.get(l).presentation.displayName,e.get(l).id)},V=()=>M(this,null,function*(){var n;if(!p()||!e.get(l))return;e.set(w,!0),e.set(R,"");const t=e.get(l).id;try{yield e.redeemReward({apiEndpoint:p(),userSession:u()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton()}catch(s){e.set(R,(n=s==null?void 0:s.message)!=null?n:"Redeem failed",!0),e.sendRedeemRewardFailed(t,s)}finally{e.set(w,!1)}});e.user_effect(()=>{const t=n=>{var s,m,v;((s=n.data)==null?void 0:s.type)===e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED&&((m=n.data)==null?void 0:m.id)===((v=e.get(l))==null?void 0:v.id)&&V()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});var j={get apiEndpoint(){return p()},set apiEndpoint(t=""){p(t),e.flushSync()},get userSession(){return u()},set userSession(t=""){u(t),e.flushSync()},get locale(){return c()},set locale(t=""){c(t),e.flushSync()},get itemId(){return i()},set itemId(t=""){i(t),e.flushSync()},get elevateReward(){return r()},set elevateReward(t){r(t),e.flushSync()},get translationUrl(){return b()},set translationUrl(t){b(t),e.flushSync()}},C=e.comment(),D=e.first_child(C);{var A=t=>{var n=$(),s=e.child(n),m=e.child(s);{var v=h=>{var f=Q();e.template_effect(()=>{e.set_attribute(f,"src",e.get(I)||Y),e.set_attribute(f,"alt",e.get(N))}),e.append(h,f)};e.if_block(m,h=>{e.get(I)&&h(v)})}var S=e.sibling(m,2),H=e.child(S,!0);e.reset(S);var E=e.sibling(S,2),q=e.child(E);e.reset(E);var x=e.sibling(E,2),Z=e.child(x,!0);e.reset(x),e.reset(s);var U=e.sibling(s,2);K.LoyaltyPointsCard(U,{get apiEndpoint(){return p()},get userSession(){return u()},get locale(){return c()}});var F=e.sibling(U,2);{var J=h=>{var f=X(),_=e.child(f),G=e.child(_,!0);e.reset(_),e.reset(f),e.template_effect(()=>e.set_text(G,e.get(T))),e.append(h,f)};e.if_block(F,h=>{e.get(T)&&h(J)})}e.reset(n),e.template_effect((h,f)=>{var _;e.set_text(H,e.get(N)),e.set_text(q,`${(_=e.get(l).points)!=null?_:""}
5
+ ${h!=null?h:""}`),x.disabled=!e.get(L)||e.get(w),e.set_text(Z,f)},[()=>o()("tokens"),()=>o()("buyNow")]),e.delegated("click",x,z),e.append(t,n)};e.if_block(D,t=>{e.get(l)&&t(A)})}e.append(y,C);var B=e.pop(j);return g(),B}e.delegate(["click"]);e.create_custom_element(k,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[],{mode:"open"});function O(y,a){e.push(a,!0);let o=e.prop(a,"apiEndpoint",7,""),d=e.prop(a,"userSession",7,""),g=e.prop(a,"locale",7,""),p=e.prop(a,"itemId",7,""),u=e.prop(a,"elevateReward"),c=e.prop(a,"translationUrl");var i={get apiEndpoint(){return o()},set apiEndpoint(r=""){o(r),e.flushSync()},get userSession(){return d()},set userSession(r=""){d(r),e.flushSync()},get locale(){return g()},set locale(r=""){g(r),e.flushSync()},get itemId(){return p()},set itemId(r=""){p(r),e.flushSync()},get elevateReward(){return u()},set elevateReward(r){u(r),e.flushSync()},get translationUrl(){return c()},set translationUrl(r){c(r),e.flushSync()}};return k(y,{get apiEndpoint(){return o()},get userSession(){return d()},get locale(){return g()},get itemId(){return p()},get elevateReward(){return u()},get translationUrl(){return c()}}),e.pop(i)}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=k;exports.LoyaltyShopItem_ce=te;
@@ -14,8 +14,8 @@ var J = (g, a, o) => new Promise((d, _) => {
14
14
  }, c = (l) => l.done ? d(l.value) : Promise.resolve(l.value).then(u, v);
15
15
  c((o = o.apply(g, a)).next());
16
16
  });
17
- import { y as me, c as W, p as Y, a as ve, b as p, s as fe, d as q, z as O, A as he, B as ye, C as G, E, F as ge, G as _e, m as s, f as we, g as be, i as z, h as N, j as Q, H as xe, I as Ee, J as Re, K as ke, k as m, l as Se, n as b, o as k, r as x, t as j, q as L, v as V, u as C, L as Ie, w as Te, $ as Ne, M as K } from "./LoyaltyPagination-Z_igiBkY.js";
18
- import { L as Le } from "./LoyaltyPointsCard-DRKV1-dq.js";
17
+ import { y as me, c as W, p as Y, a as ve, b as p, s as fe, d as q, z as O, A as he, B as ye, C as G, E, F as ge, G as _e, m as s, f as we, g as be, i as z, h as T, j as Q, H as xe, I as Ee, J as Re, K as ke, k as m, l as Se, n as b, o as k, r as x, t as j, q as L, L as Ie, v as V, u as C, w as Ne, $ as Te, M as Le, N as K } from "./LoyaltyPagination-kvqB9vki.js";
18
+ import { L as Ce } from "./LoyaltyPointsCard-Dte4kVve.js";
19
19
  typeof globalThis.HTMLElement == "undefined" && (globalThis.HTMLElement = class {
20
20
  }, globalThis.customElements = { define() {
21
21
  }, get() {
@@ -33,14 +33,14 @@ if (typeof window != "undefined") {
33
33
  }
34
34
  };
35
35
  };
36
- customElements.define = g(customElements.define), import("./LoyaltyPointsCard-DRKV1-dq.js").then((a) => a.a).then((a) => {
36
+ customElements.define = g(customElements.define), import("./LoyaltyPointsCard-Dte4kVve.js").then((a) => a.a).then((a) => {
37
37
  const o = a.default || a;
38
38
  customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card", o.element || o);
39
39
  }).catch((a) => {
40
40
  console.error("BOOT ERROR:", a);
41
41
  });
42
42
  }
43
- const Ce = {
43
+ const Ue = {
44
44
  en: {
45
45
  tokens: "Tokens",
46
46
  buyNow: "Buy Now",
@@ -76,9 +76,9 @@ const Ce = {
76
76
  buyNow: "Vásárlás",
77
77
  back: "Vissza"
78
78
  }
79
- }, 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";
80
- var Me = V('<img class="loyalty-shop-item__image svelte-ravnpu"/>'), Oe = V('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'), ze = V('<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>');
81
- const je = {
79
+ }, 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";
80
+ var Oe = V('<img class="loyalty-shop-item__image svelte-ravnpu"/>'), ze = V('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'), je = V('<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>');
81
+ const Ve = {
82
82
  hash: "svelte-ravnpu",
83
83
  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;}
84
84
 
@@ -86,9 +86,9 @@ const je = {
86
86
  }`
87
87
  };
88
88
  function X(g, a) {
89
- Y(a, !0), ve(g, je);
90
- const o = () => Te(Ne, "$_", d), [d, _] = Se(), u = p(a, "apiEndpoint", 7, ""), v = p(a, "userSession", 7, ""), c = p(a, "locale", 7, ""), l = p(a, "itemId", 7, ""), r = p(a, "elevateReward"), S = p(a, "translationUrl");
91
- fe({ withLocale: c(), translations: {} }), Object.entries(Ce).forEach(([e, t]) => {
89
+ Y(a, !0), ve(g, Ve);
90
+ const o = () => Ne(Te, "$_", d), [d, _] = Se(), u = p(a, "apiEndpoint", 7, ""), v = p(a, "userSession", 7, ""), c = p(a, "locale", 7, ""), l = p(a, "itemId", 7, ""), r = p(a, "elevateReward"), S = p(a, "translationUrl");
91
+ fe({ withLocale: c(), translations: {} }), Object.entries(Ue).forEach(([e, t]) => {
92
92
  q(e, t);
93
93
  });
94
94
  let i = O(he(r())), I = O(!1), A = O("");
@@ -133,7 +133,7 @@ function X(g, a) {
133
133
  }).catch((e) => console.error("Failed to load shop item:", e));
134
134
  });
135
135
  const te = () => {
136
- s(I) || !s(F) || !s(i) || Ie(s(i).displayName || s(i).presentation.displayName, s(i).id);
136
+ s(I) || !s(F) || !s(i) || Le(s(i).displayName || s(i).presentation.displayName, s(i).id);
137
137
  }, ae = () => J(this, null, function* () {
138
138
  var t;
139
139
  if (!u() || !s(i))
@@ -195,13 +195,13 @@ function X(g, a) {
195
195
  }, P = we(), ne = be(P);
196
196
  {
197
197
  var re = (e) => {
198
- var t = ze(), n = b(t), f = b(n);
198
+ var t = je(), n = b(t), f = b(n);
199
199
  {
200
200
  var w = (h) => {
201
- var y = Me();
201
+ var y = Oe();
202
202
  j(() => {
203
- K(y, "src", s(B) || Ue), K(y, "alt", s(D));
204
- }), N(h, y);
203
+ K(y, "src", s(B) || Me), K(y, "alt", s(D));
204
+ }), T(h, y);
205
205
  };
206
206
  z(f, (h) => {
207
207
  s(B) && h(w);
@@ -211,12 +211,10 @@ function X(g, a) {
211
211
  x(U);
212
212
  var M = k(U, 2), le = b(M);
213
213
  x(M);
214
- var T = k(M, 2);
215
- T.__click = te;
216
- var de = b(T, !0);
217
- x(T), x(n);
214
+ var N = k(M, 2), de = b(N, !0);
215
+ x(N), x(n);
218
216
  var Z = k(n, 2);
219
- Le(Z, {
217
+ Ce(Z, {
220
218
  get apiEndpoint() {
221
219
  return u();
222
220
  },
@@ -230,8 +228,8 @@ function X(g, a) {
230
228
  var ue = k(Z, 2);
231
229
  {
232
230
  var ce = (h) => {
233
- var y = Oe(), R = b(y), pe = b(R, !0);
234
- x(R), x(y), j(() => L(pe, s(H))), N(h, y);
231
+ var y = ze(), R = b(y), pe = b(R, !0);
232
+ x(R), x(y), j(() => L(pe, s(H))), T(h, y);
235
233
  };
236
234
  z(ue, (h) => {
237
235
  s(H) && h(ce);
@@ -241,16 +239,16 @@ function X(g, a) {
241
239
  (h, y) => {
242
240
  var R;
243
241
  L(ie, s(D)), L(le, `${(R = s(i).points) != null ? R : ""}
244
- ${h != null ? h : ""}`), T.disabled = !s(F) || s(I), L(de, y);
242
+ ${h != null ? h : ""}`), N.disabled = !s(F) || s(I), L(de, y);
245
243
  },
246
244
  [() => o()("tokens"), () => o()("buyNow")]
247
- ), N(e, t);
245
+ ), Ie("click", N, te), T(e, t);
248
246
  };
249
247
  z(ne, (e) => {
250
248
  s(i) && e(re);
251
249
  });
252
250
  }
253
- N(g, P);
251
+ T(g, P);
254
252
  var oe = Q(se);
255
253
  return _(), oe;
256
254
  }
@@ -267,7 +265,7 @@ W(
267
265
  },
268
266
  [],
269
267
  [],
270
- !0
268
+ { mode: "open" }
271
269
  );
272
270
  function $(g, a) {
273
271
  Y(a, !0);
@@ -342,14 +340,13 @@ customElements.define("loyalty-shop-item", W(
342
340
  translationUrl: {}
343
341
  },
344
342
  [],
345
- [],
346
- !1
343
+ []
347
344
  ));
348
- const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
345
+ const He = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
349
346
  __proto__: null,
350
347
  default: $
351
348
  }, Symbol.toStringTag, { value: "Module" }));
352
349
  export {
353
350
  X as L,
354
- De as a
351
+ He as a
355
352
  };
@@ -1 +1 @@
1
- typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-BsZThRDe.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-BsZThRDe.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;
1
+ typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-ICV4lgAz.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-ICV4lgAz.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;
@@ -1,4 +1,4 @@
1
- import { L as a } from "../components/LoyaltyShop-CtNpYAKa.js";
1
+ import { L as a } from "../components/LoyaltyShop-D4hhy3SS.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-CtNpYAKa.js").then((e) => e.a).then((e) => {
19
+ customElements.define = s(customElements.define), import("../components/LoyaltyShop-D4hhy3SS.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) => {
@@ -1 +1 @@
1
- typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-Cx8CxsMn.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-Cx8CxsMn.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;
1
+ typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-Dvy8bKVO.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-Dvy8bKVO.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;
@@ -1,4 +1,4 @@
1
- import { L as a } from "../components/LoyaltyShop-DoIx97J9.js";
1
+ import { L as a } from "../components/LoyaltyShop-B5kW3Kng.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-DoIx97J9.js").then((e) => e.a).then((e) => {
19
+ customElements.define = s(customElements.define), import("../components/LoyaltyShop-B5kW3Kng.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/loyalty-shop",
3
- "version": "0.1.14",
3
+ "version": "0.1.18",
4
4
  "type": "module",
5
5
  "main": "./esnext/loyalty-shop.cjs",
6
6
  "module": "./esnext/loyalty-shop.js",