@everymatrix/loyalty-level 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/LoyaltyLevel-B4lImGDu.cjs +26 -0
- package/components/LoyaltyLevel-BzJws8-G.js +535 -0
- package/components/LoyaltyLevel-C5IRTxL3.cjs +26 -0
- package/components/LoyaltyLevel-uSDbSl-J.js +549 -0
- package/components/{LoyaltyPagination-ColtUQI0.cjs → LoyaltyPagination-CxnhtBhF.cjs} +8 -8
- package/components/{LoyaltyPagination-D5jySBqc.cjs → LoyaltyPagination-D5WM82CZ.cjs} +8 -8
- package/components/{LoyaltyPagination-DOkAJClF.js → LoyaltyPagination-DwqIqlFP.js} +10 -10
- package/components/{LoyaltyPagination-BTfwQ1fb.js → LoyaltyPagination-fzOoPxDh.js} +10 -10
- package/es2015/loyalty-level.cjs +1 -1
- package/es2015/loyalty-level.js +2 -2
- package/esnext/loyalty-level.cjs +1 -1
- package/esnext/loyalty-level.js +2 -2
- package/package.json +1 -1
- package/components/LoyaltyLevel-C-3ooKZJ.cjs +0 -26
- package/components/LoyaltyLevel-CQKEb26Q.js +0 -549
- package/components/LoyaltyLevel-DUgl3Md0.js +0 -535
- package/components/LoyaltyLevel-D_n2xBTx.cjs +0 -26
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-D5WM82CZ.cjs");if(typeof window!="undefined"){let T=function(n){return function(...c){try{return n.apply(this,c)}catch(u){if(u instanceof DOMException&&u.message.includes("has already been used with this registry")||u instanceof Error&&u.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw u}}};customElements.define=T(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPagination-D5WM82CZ.cjs")).then(n=>n.LoyaltyPagination_ce).then(n=>{const c=n.default||n;customElements.get("loyalty-pagination")||customElements.define("loyalty-pagination",c.element||c)}).catch(n=>{console.error("BOOT ERROR:",n)})}const Ee={en:{startingLevel:"Starting Level: {points} points",seeMore:"See More",seeLess:"See Less",current:"Current",next:"Next"},tr:{startingLevel:"Başlangıç Seviyesi: {points} puan",seeMore:"Daha Fazla",seeLess:"Daha Az",current:"Mevcut",next:"Sonraki"},da:{startingLevel:"Startniveau: {points} point",seeMore:"Se mere",seeLess:"Se mindre",current:"Nuværende",next:"Næste"},de:{startingLevel:"Startlevel: {points} Punkte",seeMore:"Mehr anzeigen",seeLess:"Weniger anzeigen",current:"Aktuell",next:"Nächste"},nl:{startingLevel:"Startniveau: {points} punten",seeMore:"Meer tonen",seeLess:"Minder tonen",current:"Huidig",next:"Volgende"},fr:{startingLevel:"Niveau de départ : {points} points",seeMore:"Voir plus",seeLess:"Voir moins",current:"Actuel",next:"Suivant"},hu:{startingLevel:"Kezdő szint: {points} pont",seeMore:"Több megjelenítése",seeLess:"Kevesebb megjelenítése",current:"Jelenlegi",next:"Következő"}},ne="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 Ie=e.from_html('<article class="loyalty-level__card loyalty-level__card--skeleton" aria-busy="true"><header class="loyalty-level__head"><span class="loyalty-level__skeleton loyalty-level__skeleton--badge"></span> <div class="loyalty-level__headings"><span class="loyalty-level__skeleton loyalty-level__skeleton--name"></span> <span class="loyalty-level__skeleton loyalty-level__skeleton--starting"></span></div></header> <span class="loyalty-level__skeleton loyalty-level__skeleton--action"></span></article>'),ae=e.from_html('<span class="loyalty-level__tag"> </span>'),Te=e.from_html("<div></div>"),Oe=e.from_html('<button class="loyalty-level__action" type="button"> </button>'),Ce=e.from_html('<article><header class="loyalty-level__head"><img class="loyalty-level__badge"/> <div class="loyalty-level__headings"><span class="loyalty-level__name"> </span> <span class="loyalty-level__starting"> </span></div> <!></header> <!> <!></article>'),ze=e.from_html('<div class="loyalty-level__sentinel" aria-hidden="true"></div>'),De=e.from_html('<img class="loyalty-level__badge"/>'),Ue=e.from_html('<div class="loyalty-level__benefits"></div>'),Ae=e.from_html('<div class="loyalty-level__modal-overlay" role="presentation"><div class="loyalty-level__modal" role="dialog" aria-modal="true" tabindex="-1"><div class="loyalty-level__modal-close-wrapper"><button class="loyalty-level__modal-close" type="button" aria-label="close">×</button></div> <div class="loyalty-level__modal-content"><header class="loyalty-level__modal-head"><!> <div class="loyalty-level__headings"><span class="loyalty-level__name"> </span> <span class="loyalty-level__starting"> </span></div> <!></header> <!></div></div></div>'),Fe=e.from_html('<div class="loyalty-level"><div class="loyalty-level__grid"><!></div> <!> <!></div> <!>',1);const Ne={hash:"svelte-nbxilv",code:`
|
|
2
|
+
@layer loyalty-level-component {.loyalty-level {width:100%;box-sizing:border-box;}.loyalty-level__grid {display:grid;grid-template-columns:repeat(auto-fill, minmax(min(100%, 326px), 1fr));gap:12px;align-items:stretch;}.loyalty-level__card {display:flex;flex-direction:column;gap:16px;padding:16px;background-color:var(--app-container-bg-default, #022652);border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));border-radius:6px;box-sizing:border-box;max-height:242px;overflow:hidden;line-height:1.4;}.loyalty-level__card--expanded {max-height:none;overflow:visible;}.loyalty-level__head {display:flex;align-items:flex-start;gap:6px;}.loyalty-level__badge {width:40px;height:40px;flex-shrink:0;}.loyalty-level__headings {display:flex;flex-direction:column;gap:2px;flex:1;min-width:0;}.loyalty-level__name {color:var(--text-default, #ffffff);font-size:14px;font-weight:500;text-transform:uppercase;line-height:1.4;}.loyalty-level__tag {flex-shrink:0;align-self:flex-start;padding:10px;border-radius:100px;background:var(--badges-element-default, rgba(255, 204, 0, 0.05));color:var(--text-brand, #ffcc00);font-size:12px;font-weight:500;}.loyalty-level__starting {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-level__benefits {color:var(--text-subtle, #dfe3e8);font-size:13px;line-height:1.5;flex:1 1 auto;min-height:0;overflow:hidden;}.loyalty-level__card--expanded .loyalty-level__benefits {flex:none;overflow:visible;}.loyalty-level__benefits ul {margin:0;padding-left:18px;list-style:disc;}.loyalty-level__benefits li {margin-bottom:6px;}.loyalty-level__action {margin-top:auto;width:100%;padding:8px 16px;border:1px solid var(--button-secondary-border-default, rgba(251, 251, 251, 0.05));border-radius:6px;background:var(--button-secondary-bg-default, rgba(251, 251, 251, 0.1));color:var(--button-secondary-text-default, #ffffff);font-size:12px;font-weight:400;cursor:pointer;}.loyalty-level__modal-overlay {position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:24px;background-color:rgba(0, 0, 0, 0.7);backdrop-filter:blur(3px);}.loyalty-level__modal {position:relative;width:100%;max-width:40dvw;max-height:90dvh;padding:24px 16px;background-color:var(--app-container-bg-default, #022652);border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));border-radius:8px;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;}.loyalty-level__modal-content {padding:8px;display:flex;flex-direction:column;gap:16px;flex:1 1 auto;min-height:0;overflow:hidden;}.loyalty-level__modal-content .loyalty-level__benefits {flex:1 1 auto;min-height:0;overflow-y:auto;}.loyalty-level__modal-head {display:flex;align-items:flex-start;gap:12px;flex-shrink:0;}.loyalty-level__modal-close-wrapper {display:flex;justify-content:flex-end;flex-shrink:0;}.loyalty-level__modal-close {border:none;background:transparent;color:var(--icon-default, #b3becb);font-size:25px;line-height:1;cursor:pointer;}.loyalty-level__sentinel {width:100%;height:1px;}.loyalty-level__card--skeleton {pointer-events:none;justify-content:flex-start;height:180px;}.loyalty-level__skeleton {display:block;border-radius:4px;background:linear-gradient(
|
|
3
|
+
90deg,
|
|
4
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
|
|
5
|
+
color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
|
|
6
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
|
|
7
|
+
);background-size:400% 100%;
|
|
8
|
+
animation: loyalty-level-shimmer 1.4s ease infinite;}.loyalty-level__skeleton--badge {width:40px;height:40px;flex-shrink:0;border-radius:6px;}.loyalty-level__skeleton--name {width:60%;height:16px;}.loyalty-level__skeleton--starting {width:40%;height:14px;}.loyalty-level__skeleton--action {margin-top:auto;width:100%;height:33px;border-radius:6px;}
|
|
9
|
+
|
|
10
|
+
@keyframes loyalty-level-shimmer {
|
|
11
|
+
0% {
|
|
12
|
+
background-position: 100% 50%;
|
|
13
|
+
}
|
|
14
|
+
100% {
|
|
15
|
+
background-position: 0 50%;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (prefers-reduced-motion: reduce) {.loyalty-level__skeleton {
|
|
20
|
+
animation: none;}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@media (max-width: 767px) {.loyalty-level__benefits {overflow-wrap:anywhere;word-break:break-word;}.loyalty-level__benefits--collapsed {max-height:calc(1.5em * 2);overflow:hidden;}.loyalty-level__benefits p {margin:0;}.loyalty-level__benefits ul,
|
|
24
|
+
.loyalty-level__benefits ol {margin:0;padding-left:18px;}.loyalty-level__benefits li {margin-bottom:6px;}.loyalty-level__benefits li:last-child {margin-bottom:0;}.loyalty-level__card--expanded {max-height:none;overflow:visible;}.loyalty-level__card--expanded .loyalty-level__benefits {flex:none;max-height:none;overflow:visible;}
|
|
25
|
+
}
|
|
26
|
+
}`};function $(T,n){e.push(n,!0),e.append_styles(T,Ne);const c=()=>e.store_get(e.$format,"$_",u),[u,D]=e.setup_stores(),S=e.prop(n,"apiEndpoint",7,""),w=e.prop(n,"userSession",7,""),h=e.prop(n,"locale",7,""),k=e.prop(n,"onLevelLoaded",7,t=>{}),U=e.prop(n,"onSeeMore",7,t=>{}),i=e.prop(n,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),P=e.prop(n,"translationUrl");e.setupI18n({withLocale:h(),translations:{}});const re=()=>{let t=new URL(P(),window.location.href);fetch(t.href).then(l=>l.json()).then(l=>{Object.keys(l).forEach(a=>{e.addNewMessages(a,l[a])})}).catch(l=>{console.log("loyalty level translation url err:",l)})};Object.entries(Ee).forEach(([t,l])=>{e.addNewMessages(t,l)}),e.user_effect(()=>{var t;e.setLocale((t=h())!=null?t:"en")}),e.user_pre_effect(()=>{P()&&re()});const ie=t=>{k()(t)},H=e.createElevateData(()=>({apiEndpoint:S(),userSession:w(),locale:h(),loadLevels:!0,onLevelLoaded:ie})),B=e.user_derived(()=>{var t;return(t=H.playerElevateLevel)==null?void 0:t.id}),m=e.user_derived(()=>typeof i()=="number"?i():parseInt(i(),e.ITEMS_LIMIT_DEFAULT)||e.ITEMS_LIMIT_DEFAULT),M=e.user_derived(()=>{var t;return[...(t=H.levels)!=null?t:[]].sort((l,a)=>l.firstEntryPoints<a.firstEntryPoints?-1:1)}),O=t=>{var l,a,g;return(g=(a=(l=t.presentation)==null?void 0:l.displayName)!=null?a:t.displayName)!=null?g:String(t.id)};let C=e.state(0),v=e.state(!1),A=e.state(e.proxy(e.MOBILE_LOAD_ITEMS)),j=e.state(void 0),z=e.state(void 0),y=e.state(void 0),F=e.state(e.proxy({}));const se=e.user_derived(()=>Math.max(1,Math.ceil(e.get(M).length/e.get(m)))),de=e.user_derived(()=>e.get(v)?e.get(M).slice(0,e.get(A)):e.get(M).slice(e.get(C)*e.get(m),e.get(C)*e.get(m)+e.get(m))),ce=e.user_derived(()=>e.get(M).length>0&&!!H.playerElevateLevel),ee=e.user_derived(()=>H.loading&&!e.get(ce)),_e=e.user_derived(()=>e.get(v)?e.MOBILE_LOAD_ITEMS:e.get(m)),V=(t,l)=>{let a;const g=()=>{if(!e.get(v)){e.get(F)[l]=!1;return}const b=window.getComputedStyle(t),p=parseFloat(b.maxHeight);if(!Number.isFinite(p)||p<=0){e.get(F)[l]=!1;return}const E=12;e.get(F)[l]=t.scrollHeight>p+E},o=()=>{a!==void 0&&cancelAnimationFrame(a),a=requestAnimationFrame(g)};o();const f=new ResizeObserver(o);return f.observe(t),{destroy(){a!==void 0&&cancelAnimationFrame(a),f.disconnect(),delete e.get(F)[l]}}};e.user_effect(()=>{e.get(C)>e.get(se)-1&&e.set(C,0)}),e.user_effect(()=>{e.set(A,e.get(v)?e.MOBILE_LOAD_ITEMS:e.get(m),!0)}),e.user_effect(()=>{if(!e.get(v)||!e.get(j))return;const t=new IntersectionObserver(l=>{l.some(a=>a.isIntersecting)&&e.set(A,Math.min(e.get(M).length,e.get(A)+e.MOBILE_LOAD_ITEMS),!0)},{rootMargin:"200px"});return t.observe(e.get(j)),()=>t.disconnect()});const ge=t=>{e.set(C,Math.floor(t/e.get(m)),!0)};e.user_effect(()=>{const t=window.matchMedia("(max-width: 767px)"),l=a=>{e.set(v,a.matches,!0)};return e.set(v,t.matches,!0),t.addEventListener("change",l),()=>t.removeEventListener("change",l)});const ve=t=>{if(U()(t),!e.get(v)){e.sendLoyaltyLevelClicked(O(t)),e.set(y,t,!0);return}const l=e.get(z)!==t.id;l&&e.sendLoyaltyLevelClicked(O(t)),e.set(z,l?t.id:void 0,!0)},q=()=>{e.set(y,void 0)},ye=t=>{t.target===t.currentTarget&&q()},pe=t=>{t.key==="Escape"&&q()};e.user_effect(()=>{if(!e.get(y))return;const t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}});var ue={get apiEndpoint(){return S()},set apiEndpoint(t=""){S(t),e.flushSync()},get userSession(){return w()},set userSession(t=""){w(t),e.flushSync()},get locale(){return h()},set locale(t=""){h(t),e.flushSync()},get onLevelLoaded(){return k()},set onLevelLoaded(t=l=>{}){k(t),e.flushSync()},get onSeeMore(){return U()},set onSeeMore(t=l=>{}){U(t),e.flushSync()},get limitItem(){return i()},set limitItem(t=e.ITEMS_LIMIT_DEFAULT){i(t),e.flushSync()},get translationUrl(){return P()},set translationUrl(t){P(t),e.flushSync()}},te=Fe(),K=e.first_child(te),Z=e.child(K),fe=e.child(Z);{var he=t=>{var l=e.comment(),a=e.first_child(l);e.each(a,17,()=>({length:e.get(_e)}),e.index,(g,o,f,b)=>{var p=Ie();e.append(g,p)}),e.append(t,l)},me=t=>{var l=e.comment(),a=e.first_child(l);e.each(a,17,()=>e.get(de),g=>g.id,(g,o)=>{var f=Ce();let b;var p=e.child(f),E=e.child(p),I=e.sibling(E,2),N=e.child(I),W=e.only_child(N,!0),J=e.sibling(N,2),G=e.only_child(J,!0);e.reset(I);var Q=e.sibling(I,2);{var X=d=>{var s=ae(),x=e.only_child(s,!0);e.template_effect(L=>e.set_text(x,L),[()=>c()("current")]),e.append(d,s)};e.if_block(Q,d=>{e.get(o).id===e.get(B)&&d(X)})}e.reset(p);var R=e.sibling(p,2);{var Y=d=>{var s=Te();let x;e.html(s,()=>e.get(o).presentation.description,!0),e.reset(s),e.action(s,(L,Me)=>V==null?void 0:V(L,Me),()=>e.get(o).id),e.template_effect(()=>x=e.set_class(s,1,"loyalty-level__benefits",null,x,{"loyalty-level__benefits--collapsed":e.get(v)&&e.get(z)!==e.get(o).id})),e.append(d,s)};e.if_block(R,d=>{var s;(s=e.get(o).presentation)!=null&&s.description&&d(Y)})}var _=e.sibling(R,2);{var r=d=>{var s=Oe(),x=e.only_child(s,!0);e.template_effect(L=>e.set_text(x,L),[()=>e.get(z)===e.get(o).id?c()("seeLess"):c()("seeMore")]),e.delegated("click",s,()=>ve(e.get(o))),e.append(d,s)};e.if_block(_,d=>{(!e.get(v)||e.get(F)[e.get(o).id]||e.get(z)===e.get(o).id)&&d(r)})}e.reset(f),e.template_effect((d,s,x)=>{var L;b=e.set_class(f,1,"loyalty-level__card",null,b,{"loyalty-level__card--current":e.get(o).id===e.get(B),"loyalty-level__card--expanded":e.get(z)===e.get(o).id}),e.set_attribute(E,"src",((L=e.get(o).presentation)==null?void 0:L.asset)||ne),e.set_attribute(E,"alt",d),e.set_text(W,s),e.set_text(G,x)},[()=>O(e.get(o)),()=>O(e.get(o)),()=>c()("startingLevel",{values:{points:e.get(o).firstEntryPoints.toLocaleString()}})]),e.append(g,f)}),e.append(t,l)};e.if_block(fe,t=>{e.get(ee)?t(he):t(me,-1)})}e.reset(Z);var le=e.sibling(Z,2);{var be=t=>{{let l=e.user_derived(()=>e.get(C)*e.get(m));e.LoyaltyPagination(t,{get offset(){return e.get(l)},get limit(){return e.get(m)},get total(){return e.get(M).length},onPageChange:ge,get locale(){return h()}})}};e.if_block(le,t=>{!e.get(ee)&&!e.get(v)&&t(be)})}var xe=e.sibling(le,2);{var Le=t=>{var l=ze();e.bind_this(l,a=>e.set(j,a),()=>e.get(j)),e.append(t,l)};e.if_block(xe,t=>{e.get(v)&&e.get(A)<e.get(M).length&&t(Le)})}e.reset(K);var Se=e.sibling(K,2);{var we=t=>{var l=Ae(),a=e.child(l),g=e.child(a),o=e.only_child(g),f=e.sibling(g,2),b=e.child(f),p=e.child(b);{var E=_=>{var r=De();e.template_effect(d=>{e.set_attribute(r,"src",e.get(y).presentation.asset||ne),e.set_attribute(r,"alt",d)},[()=>O(e.get(y))]),e.append(_,r)};e.if_block(p,_=>{var r;(r=e.get(y).presentation)!=null&&r.asset&&_(E)})}var I=e.sibling(p,2),N=e.child(I),W=e.only_child(N,!0),J=e.sibling(N,2),G=e.only_child(J,!0);e.reset(I);var Q=e.sibling(I,2);{var X=_=>{var r=ae(),d=e.only_child(r,!0);e.template_effect(s=>e.set_text(d,s),[()=>c()("current")]),e.append(_,r)};e.if_block(Q,_=>{e.get(y).id===e.get(B)&&_(X)})}e.reset(b);var R=e.sibling(b,2);{var Y=_=>{var r=Ue();e.html(r,()=>e.get(y).presentation.description,!0),e.reset(r),e.append(_,r)};e.if_block(R,_=>{var r;(r=e.get(y).presentation)!=null&&r.description&&_(Y)})}e.reset(f),e.reset(a),e.reset(l),e.template_effect((_,r)=>{e.set_text(W,_),e.set_text(G,r)},[()=>O(e.get(y)),()=>c()("startingLevel",{values:{points:e.get(y).firstEntryPoints.toLocaleString()}})]),e.delegated("click",l,ye),e.delegated("keydown",l,pe),e.delegated("click",o,q),e.append(t,l)};e.if_block(Se,t=>{e.get(y)&&t(we)})}e.append(T,te);var ke=e.pop(ue);return D(),ke}e.delegate(["click","keydown"]);e.create_custom_element($,{apiEndpoint:{},userSession:{},locale:{},onLevelLoaded:{},onSeeMore:{},limitItem:{},translationUrl:{}},[],[],{mode:"open"});function oe(T,n){e.push(n,!0);let c=e.prop(n,"apiEndpoint",7,""),u=e.prop(n,"userSession",7,""),D=e.prop(n,"locale",7,""),S=e.prop(n,"onLevelLoaded"),w=e.prop(n,"onSeeMore"),h=e.prop(n,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),k=e.prop(n,"translationUrl");var U={get apiEndpoint(){return c()},set apiEndpoint(i=""){c(i),e.flushSync()},get userSession(){return u()},set userSession(i=""){u(i),e.flushSync()},get locale(){return D()},set locale(i=""){D(i),e.flushSync()},get onLevelLoaded(){return S()},set onLevelLoaded(i){S(i),e.flushSync()},get onSeeMore(){return w()},set onSeeMore(i){w(i),e.flushSync()},get limitItem(){return h()},set limitItem(i=e.ITEMS_LIMIT_DEFAULT){h(i),e.flushSync()},get translationUrl(){return k()},set translationUrl(i){k(i),e.flushSync()}};return $(T,{get apiEndpoint(){return c()},get userSession(){return u()},get locale(){return D()},get onLevelLoaded(){return S()},get onSeeMore(){return w()},get limitItem(){return h()},get translationUrl(){return k()}}),e.pop(U)}customElements.define("loyalty-level",e.create_custom_element(oe,{apiEndpoint:{},userSession:{},locale:{},onLevelLoaded:{},onSeeMore:{},limitItem:{},translationUrl:{}},[],[]));const Pe=Object.freeze(Object.defineProperty({__proto__:null,default:oe},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyLevel=$;exports.LoyaltyLevel_ce=Pe;
|
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
import { d as at, c as Ce, p as Oe, a as nt, b as y, s as ot, e as be, u as Z, f as rt, g as st, h as it, i as P, j as Le, M as ne, k as e, l as k, m as fe, n as S, o as u, q as Te, I as J, r as C, t as E, v as _, w as dt, x as M, y as h, z as p, A as we, B as ke, C as ct, L as vt, D as yt, E as T, F as R, G as F, H as oe, J as _t, $ as ut, K as Se, N as re, O as Me, P as pt, Q as Ee } from "./LoyaltyPagination-fzOoPxDh.js";
|
|
2
|
+
typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {
|
|
3
|
+
}, globalThis.customElements = { define() {
|
|
4
|
+
}, get() {
|
|
5
|
+
}, whenDefined() {
|
|
6
|
+
} });
|
|
7
|
+
if (typeof window < "u") {
|
|
8
|
+
let V = function(a) {
|
|
9
|
+
return function(...d) {
|
|
10
|
+
try {
|
|
11
|
+
return a.apply(this, d);
|
|
12
|
+
} catch (x) {
|
|
13
|
+
if (x instanceof DOMException && x.message.includes("has already been used with this registry") || x instanceof Error && x.message.includes("Cannot define multiple custom elements with the same tag name"))
|
|
14
|
+
return !1;
|
|
15
|
+
throw x;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
customElements.define = V(customElements.define), import("./LoyaltyPagination-fzOoPxDh.js").then((a) => a.R).then((a) => {
|
|
20
|
+
const d = a.default || a;
|
|
21
|
+
customElements.get("loyalty-pagination") || customElements.define("loyalty-pagination", d.element || d);
|
|
22
|
+
}).catch((a) => {
|
|
23
|
+
console.error("BOOT ERROR:", a);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const gt = {
|
|
27
|
+
en: {
|
|
28
|
+
startingLevel: "Starting Level: {points} points",
|
|
29
|
+
seeMore: "See More",
|
|
30
|
+
seeLess: "See Less",
|
|
31
|
+
current: "Current",
|
|
32
|
+
next: "Next"
|
|
33
|
+
},
|
|
34
|
+
tr: {
|
|
35
|
+
startingLevel: "Başlangıç Seviyesi: {points} puan",
|
|
36
|
+
seeMore: "Daha Fazla",
|
|
37
|
+
seeLess: "Daha Az",
|
|
38
|
+
current: "Mevcut",
|
|
39
|
+
next: "Sonraki"
|
|
40
|
+
},
|
|
41
|
+
da: {
|
|
42
|
+
startingLevel: "Startniveau: {points} point",
|
|
43
|
+
seeMore: "Se mere",
|
|
44
|
+
seeLess: "Se mindre",
|
|
45
|
+
current: "Nuværende",
|
|
46
|
+
next: "Næste"
|
|
47
|
+
},
|
|
48
|
+
de: {
|
|
49
|
+
startingLevel: "Startlevel: {points} Punkte",
|
|
50
|
+
seeMore: "Mehr anzeigen",
|
|
51
|
+
seeLess: "Weniger anzeigen",
|
|
52
|
+
current: "Aktuell",
|
|
53
|
+
next: "Nächste"
|
|
54
|
+
},
|
|
55
|
+
nl: {
|
|
56
|
+
startingLevel: "Startniveau: {points} punten",
|
|
57
|
+
seeMore: "Meer tonen",
|
|
58
|
+
seeLess: "Minder tonen",
|
|
59
|
+
current: "Huidig",
|
|
60
|
+
next: "Volgende"
|
|
61
|
+
},
|
|
62
|
+
fr: {
|
|
63
|
+
startingLevel: "Niveau de départ : {points} points",
|
|
64
|
+
seeMore: "Voir plus",
|
|
65
|
+
seeLess: "Voir moins",
|
|
66
|
+
current: "Actuel",
|
|
67
|
+
next: "Suivant"
|
|
68
|
+
},
|
|
69
|
+
hu: {
|
|
70
|
+
startingLevel: "Kezdő szint: {points} pont",
|
|
71
|
+
seeMore: "Több megjelenítése",
|
|
72
|
+
seeLess: "Kevesebb megjelenítése",
|
|
73
|
+
current: "Jelenlegi",
|
|
74
|
+
next: "Következő"
|
|
75
|
+
}
|
|
76
|
+
}, Ie = "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";
|
|
77
|
+
var ft = E('<article class="loyalty-level__card loyalty-level__card--skeleton" aria-busy="true"><header class="loyalty-level__head"><span class="loyalty-level__skeleton loyalty-level__skeleton--badge"></span> <div class="loyalty-level__headings"><span class="loyalty-level__skeleton loyalty-level__skeleton--name"></span> <span class="loyalty-level__skeleton loyalty-level__skeleton--starting"></span></div></header> <span class="loyalty-level__skeleton loyalty-level__skeleton--action"></span></article>'), ze = E('<span class="loyalty-level__tag"> </span>'), mt = E("<div></div>"), ht = E('<button class="loyalty-level__action" type="button"> </button>'), xt = E('<article><header class="loyalty-level__head"><img class="loyalty-level__badge"/> <div class="loyalty-level__headings"><span class="loyalty-level__name"> </span> <span class="loyalty-level__starting"> </span></div> <!></header> <!> <!></article>'), bt = E('<div class="loyalty-level__sentinel" aria-hidden="true"></div>'), Lt = E('<img class="loyalty-level__badge"/>'), wt = E('<div class="loyalty-level__benefits"></div>'), kt = E('<div class="loyalty-level__modal-overlay" role="presentation"><div class="loyalty-level__modal" role="dialog" aria-modal="true" tabindex="-1"><div class="loyalty-level__modal-close-wrapper"><button class="loyalty-level__modal-close" type="button" aria-label="close">×</button></div> <div class="loyalty-level__modal-content"><header class="loyalty-level__modal-head"><!> <div class="loyalty-level__headings"><span class="loyalty-level__name"> </span> <span class="loyalty-level__starting"> </span></div> <!></header> <!></div></div></div>'), St = E('<div class="loyalty-level"><div class="loyalty-level__grid"><!></div> <!> <!></div> <!>', 1);
|
|
78
|
+
const Mt = {
|
|
79
|
+
hash: "svelte-nbxilv",
|
|
80
|
+
code: `
|
|
81
|
+
@layer loyalty-level-component {.loyalty-level {width:100%;box-sizing:border-box;}.loyalty-level__grid {display:grid;grid-template-columns:repeat(auto-fill, minmax(min(100%, 326px), 1fr));gap:12px;align-items:stretch;}.loyalty-level__card {display:flex;flex-direction:column;gap:16px;padding:16px;background-color:var(--app-container-bg-default, #022652);border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));border-radius:6px;box-sizing:border-box;max-height:242px;overflow:hidden;line-height:1.4;}.loyalty-level__card--expanded {max-height:none;overflow:visible;}.loyalty-level__head {display:flex;align-items:flex-start;gap:6px;}.loyalty-level__badge {width:40px;height:40px;flex-shrink:0;}.loyalty-level__headings {display:flex;flex-direction:column;gap:2px;flex:1;min-width:0;}.loyalty-level__name {color:var(--text-default, #ffffff);font-size:14px;font-weight:500;text-transform:uppercase;line-height:1.4;}.loyalty-level__tag {flex-shrink:0;align-self:flex-start;padding:10px;border-radius:100px;background:var(--badges-element-default, rgba(255, 204, 0, 0.05));color:var(--text-brand, #ffcc00);font-size:12px;font-weight:500;}.loyalty-level__starting {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-level__benefits {color:var(--text-subtle, #dfe3e8);font-size:13px;line-height:1.5;flex:1 1 auto;min-height:0;overflow:hidden;}.loyalty-level__card--expanded .loyalty-level__benefits {flex:none;overflow:visible;}.loyalty-level__benefits ul {margin:0;padding-left:18px;list-style:disc;}.loyalty-level__benefits li {margin-bottom:6px;}.loyalty-level__action {margin-top:auto;width:100%;padding:8px 16px;border:1px solid var(--button-secondary-border-default, rgba(251, 251, 251, 0.05));border-radius:6px;background:var(--button-secondary-bg-default, rgba(251, 251, 251, 0.1));color:var(--button-secondary-text-default, #ffffff);font-size:12px;font-weight:400;cursor:pointer;}.loyalty-level__modal-overlay {position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:24px;background-color:rgba(0, 0, 0, 0.7);backdrop-filter:blur(3px);}.loyalty-level__modal {position:relative;width:100%;max-width:40dvw;max-height:90dvh;padding:24px 16px;background-color:var(--app-container-bg-default, #022652);border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));border-radius:8px;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;}.loyalty-level__modal-content {padding:8px;display:flex;flex-direction:column;gap:16px;flex:1 1 auto;min-height:0;overflow:hidden;}.loyalty-level__modal-content .loyalty-level__benefits {flex:1 1 auto;min-height:0;overflow-y:auto;}.loyalty-level__modal-head {display:flex;align-items:flex-start;gap:12px;flex-shrink:0;}.loyalty-level__modal-close-wrapper {display:flex;justify-content:flex-end;flex-shrink:0;}.loyalty-level__modal-close {border:none;background:transparent;color:var(--icon-default, #b3becb);font-size:25px;line-height:1;cursor:pointer;}.loyalty-level__sentinel {width:100%;height:1px;}.loyalty-level__card--skeleton {pointer-events:none;justify-content:flex-start;height:180px;}.loyalty-level__skeleton {display:block;border-radius:4px;background:linear-gradient(
|
|
82
|
+
90deg,
|
|
83
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
|
|
84
|
+
color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
|
|
85
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
|
|
86
|
+
);background-size:400% 100%;
|
|
87
|
+
animation: loyalty-level-shimmer 1.4s ease infinite;}.loyalty-level__skeleton--badge {width:40px;height:40px;flex-shrink:0;border-radius:6px;}.loyalty-level__skeleton--name {width:60%;height:16px;}.loyalty-level__skeleton--starting {width:40%;height:14px;}.loyalty-level__skeleton--action {margin-top:auto;width:100%;height:33px;border-radius:6px;}
|
|
88
|
+
|
|
89
|
+
@keyframes loyalty-level-shimmer {
|
|
90
|
+
0% {
|
|
91
|
+
background-position: 100% 50%;
|
|
92
|
+
}
|
|
93
|
+
100% {
|
|
94
|
+
background-position: 0 50%;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media (prefers-reduced-motion: reduce) {.loyalty-level__skeleton {
|
|
99
|
+
animation: none;}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@media (max-width: 767px) {.loyalty-level__benefits {overflow-wrap:anywhere;word-break:break-word;}.loyalty-level__benefits--collapsed {max-height:calc(1.5em * 2);overflow:hidden;}.loyalty-level__benefits p {margin:0;}.loyalty-level__benefits ul,
|
|
103
|
+
.loyalty-level__benefits ol {margin:0;padding-left:18px;}.loyalty-level__benefits li {margin-bottom:6px;}.loyalty-level__benefits li:last-child {margin-bottom:0;}.loyalty-level__card--expanded {max-height:none;overflow:visible;}.loyalty-level__card--expanded .loyalty-level__benefits {flex:none;max-height:none;overflow:visible;}
|
|
104
|
+
}
|
|
105
|
+
}`
|
|
106
|
+
};
|
|
107
|
+
function Ue(V, a) {
|
|
108
|
+
Oe(a, !0), nt(V, Mt);
|
|
109
|
+
const d = () => _t(ut, "$_", x), [x, W] = dt(), U = y(a, "apiEndpoint", 7, ""), N = y(a, "userSession", 7, ""), L = y(a, "locale", 7, ""), D = y(a, "onLevelLoaded", 7, (t) => {
|
|
110
|
+
}), G = y(a, "onSeeMore", 7, (t) => {
|
|
111
|
+
}), r = y(a, "limitItem", 7, J), ee = y(a, "translationUrl");
|
|
112
|
+
ot({ withLocale: L(), translations: {} });
|
|
113
|
+
const De = () => {
|
|
114
|
+
let t = new URL(ee(), window.location.href);
|
|
115
|
+
fetch(t.href).then((l) => l.json()).then((l) => {
|
|
116
|
+
Object.keys(l).forEach((n) => {
|
|
117
|
+
be(n, l[n]);
|
|
118
|
+
});
|
|
119
|
+
}).catch((l) => {
|
|
120
|
+
console.log("loyalty level translation url err:", l);
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
Object.entries(gt).forEach(([t, l]) => {
|
|
124
|
+
be(t, l);
|
|
125
|
+
}), Z(() => {
|
|
126
|
+
rt(L() ?? "en");
|
|
127
|
+
}), st(() => {
|
|
128
|
+
ee() && De();
|
|
129
|
+
});
|
|
130
|
+
const He = (t) => {
|
|
131
|
+
D()(t);
|
|
132
|
+
}, te = it(() => ({
|
|
133
|
+
apiEndpoint: U(),
|
|
134
|
+
userSession: N(),
|
|
135
|
+
locale: L(),
|
|
136
|
+
loadLevels: !0,
|
|
137
|
+
onLevelLoaded: He
|
|
138
|
+
})), se = C(() => te.playerElevateLevel?.id), I = C(() => typeof r() == "number" ? r() : parseInt(r(), J) || J), H = C(() => [...te.levels ?? []].sort((t, l) => t.firstEntryPoints < l.firstEntryPoints ? -1 : 1)), B = (t) => t.presentation?.displayName ?? t.displayName ?? String(t.id);
|
|
139
|
+
let K = P(0), g = P(!1), Q = P(Le(ne)), le = P(void 0), q = P(void 0), f = P(void 0), X = P(Le({}));
|
|
140
|
+
const je = C(() => Math.max(1, Math.ceil(e(H).length / e(I)))), Ae = C(() => e(g) ? e(H).slice(0, e(Q)) : e(H).slice(e(K) * e(I), e(K) * e(I) + e(I))), Pe = C(() => e(H).length > 0 && !!te.playerElevateLevel), me = C(() => te.loading && !e(Pe)), Re = C(() => e(g) ? ne : e(I)), Fe = (t, l) => {
|
|
141
|
+
let n;
|
|
142
|
+
const w = () => {
|
|
143
|
+
if (!e(g)) {
|
|
144
|
+
e(X)[l] = !1;
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const z = window.getComputedStyle(t), m = parseFloat(z.maxHeight);
|
|
148
|
+
if (!Number.isFinite(m) || m <= 0) {
|
|
149
|
+
e(X)[l] = !1;
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const j = 12;
|
|
153
|
+
e(X)[l] = t.scrollHeight > m + j;
|
|
154
|
+
}, o = () => {
|
|
155
|
+
n !== void 0 && cancelAnimationFrame(n), n = requestAnimationFrame(w);
|
|
156
|
+
};
|
|
157
|
+
o();
|
|
158
|
+
const b = new ResizeObserver(o);
|
|
159
|
+
return b.observe(t), {
|
|
160
|
+
destroy() {
|
|
161
|
+
n !== void 0 && cancelAnimationFrame(n), b.disconnect(), delete e(X)[l];
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
Z(() => {
|
|
166
|
+
e(K) > e(je) - 1 && k(K, 0);
|
|
167
|
+
}), Z(() => {
|
|
168
|
+
k(Q, e(g) ? ne : e(I), !0);
|
|
169
|
+
}), Z(() => {
|
|
170
|
+
if (!e(g) || !e(le))
|
|
171
|
+
return;
|
|
172
|
+
const t = new IntersectionObserver(
|
|
173
|
+
(l) => {
|
|
174
|
+
l.some((n) => n.isIntersecting) && k(Q, Math.min(e(H).length, e(Q) + ne), !0);
|
|
175
|
+
},
|
|
176
|
+
{ rootMargin: "200px" }
|
|
177
|
+
);
|
|
178
|
+
return t.observe(e(le)), () => t.disconnect();
|
|
179
|
+
});
|
|
180
|
+
const Ve = (t) => {
|
|
181
|
+
k(K, Math.floor(t / e(I)), !0);
|
|
182
|
+
};
|
|
183
|
+
Z(() => {
|
|
184
|
+
const t = window.matchMedia("(max-width: 767px)"), l = (n) => {
|
|
185
|
+
k(g, n.matches, !0);
|
|
186
|
+
};
|
|
187
|
+
return k(g, t.matches, !0), t.addEventListener("change", l), () => t.removeEventListener("change", l);
|
|
188
|
+
});
|
|
189
|
+
const Be = (t) => {
|
|
190
|
+
if (G()(t), !e(g)) {
|
|
191
|
+
Ee(B(t)), k(f, t, !0);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
const l = e(q) !== t.id;
|
|
195
|
+
l && Ee(B(t)), k(q, l ? t.id : void 0, !0);
|
|
196
|
+
}, ie = () => {
|
|
197
|
+
k(f, void 0);
|
|
198
|
+
}, Ke = (t) => {
|
|
199
|
+
t.target === t.currentTarget && ie();
|
|
200
|
+
}, qe = (t) => {
|
|
201
|
+
t.key === "Escape" && ie();
|
|
202
|
+
};
|
|
203
|
+
Z(() => {
|
|
204
|
+
if (!e(f))
|
|
205
|
+
return;
|
|
206
|
+
const t = document.body.style.overflow;
|
|
207
|
+
return document.body.style.overflow = "hidden", () => {
|
|
208
|
+
document.body.style.overflow = t;
|
|
209
|
+
};
|
|
210
|
+
});
|
|
211
|
+
var Ze = {
|
|
212
|
+
get apiEndpoint() {
|
|
213
|
+
return U();
|
|
214
|
+
},
|
|
215
|
+
set apiEndpoint(t = "") {
|
|
216
|
+
U(t), _();
|
|
217
|
+
},
|
|
218
|
+
get userSession() {
|
|
219
|
+
return N();
|
|
220
|
+
},
|
|
221
|
+
set userSession(t = "") {
|
|
222
|
+
N(t), _();
|
|
223
|
+
},
|
|
224
|
+
get locale() {
|
|
225
|
+
return L();
|
|
226
|
+
},
|
|
227
|
+
set locale(t = "") {
|
|
228
|
+
L(t), _();
|
|
229
|
+
},
|
|
230
|
+
get onLevelLoaded() {
|
|
231
|
+
return D();
|
|
232
|
+
},
|
|
233
|
+
set onLevelLoaded(t = (l) => {
|
|
234
|
+
}) {
|
|
235
|
+
D(t), _();
|
|
236
|
+
},
|
|
237
|
+
get onSeeMore() {
|
|
238
|
+
return G();
|
|
239
|
+
},
|
|
240
|
+
set onSeeMore(t = (l) => {
|
|
241
|
+
}) {
|
|
242
|
+
G(t), _();
|
|
243
|
+
},
|
|
244
|
+
get limitItem() {
|
|
245
|
+
return r();
|
|
246
|
+
},
|
|
247
|
+
set limitItem(t = J) {
|
|
248
|
+
r(t), _();
|
|
249
|
+
},
|
|
250
|
+
get translationUrl() {
|
|
251
|
+
return ee();
|
|
252
|
+
},
|
|
253
|
+
set translationUrl(t) {
|
|
254
|
+
ee(t), _();
|
|
255
|
+
}
|
|
256
|
+
}, he = St(), de = fe(he), ce = M(de), Je = M(ce);
|
|
257
|
+
{
|
|
258
|
+
var We = (t) => {
|
|
259
|
+
var l = we(), n = fe(l);
|
|
260
|
+
ke(n, 17, () => ({ length: e(Re) }), ct, (w, o, b, z) => {
|
|
261
|
+
var m = ft();
|
|
262
|
+
u(w, m);
|
|
263
|
+
}), u(t, l);
|
|
264
|
+
}, Ge = (t) => {
|
|
265
|
+
var l = we(), n = fe(l);
|
|
266
|
+
ke(n, 17, () => e(Ae), (w) => w.id, (w, o) => {
|
|
267
|
+
var b = xt();
|
|
268
|
+
let z;
|
|
269
|
+
var m = M(b), j = M(m), A = p(j, 2), Y = M(A), ve = T(Y, !0), ye = p(Y, 2), _e = T(ye, !0);
|
|
270
|
+
h(A);
|
|
271
|
+
var ue = p(A, 2);
|
|
272
|
+
{
|
|
273
|
+
var pe = (s) => {
|
|
274
|
+
var i = ze(), O = T(i, !0);
|
|
275
|
+
R(($) => F(O, $), [() => d()("current")]), u(s, i);
|
|
276
|
+
};
|
|
277
|
+
S(ue, (s) => {
|
|
278
|
+
e(o).id === e(se) && s(pe);
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
h(m);
|
|
282
|
+
var ae = p(m, 2);
|
|
283
|
+
{
|
|
284
|
+
var ge = (s) => {
|
|
285
|
+
var i = mt();
|
|
286
|
+
let O;
|
|
287
|
+
Me(i, () => e(o).presentation.description, !0), h(i), pt(i, ($, lt) => Fe?.($, lt), () => e(o).id), R(() => O = Se(i, 1, "loyalty-level__benefits", null, O, {
|
|
288
|
+
"loyalty-level__benefits--collapsed": e(g) && e(q) !== e(o).id
|
|
289
|
+
})), u(s, i);
|
|
290
|
+
};
|
|
291
|
+
S(ae, (s) => {
|
|
292
|
+
e(o).presentation?.description && s(ge);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
var c = p(ae, 2);
|
|
296
|
+
{
|
|
297
|
+
var v = (s) => {
|
|
298
|
+
var i = ht(), O = T(i, !0);
|
|
299
|
+
R(($) => F(O, $), [
|
|
300
|
+
() => e(q) === e(o).id ? d()("seeLess") : d()("seeMore")
|
|
301
|
+
]), oe("click", i, () => Be(e(o))), u(s, i);
|
|
302
|
+
};
|
|
303
|
+
S(c, (s) => {
|
|
304
|
+
(!e(g) || e(X)[e(o).id] || e(q) === e(o).id) && s(v);
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
h(b), R(
|
|
308
|
+
(s, i, O) => {
|
|
309
|
+
z = Se(b, 1, "loyalty-level__card", null, z, {
|
|
310
|
+
"loyalty-level__card--current": e(o).id === e(se),
|
|
311
|
+
"loyalty-level__card--expanded": e(q) === e(o).id
|
|
312
|
+
}), re(j, "src", e(o).presentation?.asset || Ie), re(j, "alt", s), F(ve, i), F(_e, O);
|
|
313
|
+
},
|
|
314
|
+
[
|
|
315
|
+
() => B(e(o)),
|
|
316
|
+
() => B(e(o)),
|
|
317
|
+
() => d()("startingLevel", {
|
|
318
|
+
values: { points: e(o).firstEntryPoints.toLocaleString() }
|
|
319
|
+
})
|
|
320
|
+
]
|
|
321
|
+
), u(w, b);
|
|
322
|
+
}), u(t, l);
|
|
323
|
+
};
|
|
324
|
+
S(Je, (t) => {
|
|
325
|
+
e(me) ? t(We) : t(Ge, -1);
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
h(ce);
|
|
329
|
+
var xe = p(ce, 2);
|
|
330
|
+
{
|
|
331
|
+
var Qe = (t) => {
|
|
332
|
+
{
|
|
333
|
+
let l = C(() => e(K) * e(I));
|
|
334
|
+
vt(t, {
|
|
335
|
+
get offset() {
|
|
336
|
+
return e(l);
|
|
337
|
+
},
|
|
338
|
+
get limit() {
|
|
339
|
+
return e(I);
|
|
340
|
+
},
|
|
341
|
+
get total() {
|
|
342
|
+
return e(H).length;
|
|
343
|
+
},
|
|
344
|
+
onPageChange: Ve,
|
|
345
|
+
get locale() {
|
|
346
|
+
return L();
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
S(xe, (t) => {
|
|
352
|
+
!e(me) && !e(g) && t(Qe);
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
var Xe = p(xe, 2);
|
|
356
|
+
{
|
|
357
|
+
var Ye = (t) => {
|
|
358
|
+
var l = bt();
|
|
359
|
+
yt(l, (n) => k(le, n), () => e(le)), u(t, l);
|
|
360
|
+
};
|
|
361
|
+
S(Xe, (t) => {
|
|
362
|
+
e(g) && e(Q) < e(H).length && t(Ye);
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
h(de);
|
|
366
|
+
var $e = p(de, 2);
|
|
367
|
+
{
|
|
368
|
+
var et = (t) => {
|
|
369
|
+
var l = kt(), n = M(l), w = M(n), o = T(w), b = p(w, 2), z = M(b), m = M(z);
|
|
370
|
+
{
|
|
371
|
+
var j = (c) => {
|
|
372
|
+
var v = Lt();
|
|
373
|
+
R(
|
|
374
|
+
(s) => {
|
|
375
|
+
re(v, "src", e(f).presentation.asset || Ie), re(v, "alt", s);
|
|
376
|
+
},
|
|
377
|
+
[() => B(e(f))]
|
|
378
|
+
), u(c, v);
|
|
379
|
+
};
|
|
380
|
+
S(m, (c) => {
|
|
381
|
+
e(f).presentation?.asset && c(j);
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
var A = p(m, 2), Y = M(A), ve = T(Y, !0), ye = p(Y, 2), _e = T(ye, !0);
|
|
385
|
+
h(A);
|
|
386
|
+
var ue = p(A, 2);
|
|
387
|
+
{
|
|
388
|
+
var pe = (c) => {
|
|
389
|
+
var v = ze(), s = T(v, !0);
|
|
390
|
+
R((i) => F(s, i), [() => d()("current")]), u(c, v);
|
|
391
|
+
};
|
|
392
|
+
S(ue, (c) => {
|
|
393
|
+
e(f).id === e(se) && c(pe);
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
h(z);
|
|
397
|
+
var ae = p(z, 2);
|
|
398
|
+
{
|
|
399
|
+
var ge = (c) => {
|
|
400
|
+
var v = wt();
|
|
401
|
+
Me(v, () => e(f).presentation.description, !0), h(v), u(c, v);
|
|
402
|
+
};
|
|
403
|
+
S(ae, (c) => {
|
|
404
|
+
e(f).presentation?.description && c(ge);
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
h(b), h(n), h(l), R(
|
|
408
|
+
(c, v) => {
|
|
409
|
+
F(ve, c), F(_e, v);
|
|
410
|
+
},
|
|
411
|
+
[
|
|
412
|
+
() => B(e(f)),
|
|
413
|
+
() => d()("startingLevel", {
|
|
414
|
+
values: { points: e(f).firstEntryPoints.toLocaleString() }
|
|
415
|
+
})
|
|
416
|
+
]
|
|
417
|
+
), oe("click", l, Ke), oe("keydown", l, qe), oe("click", o, ie), u(t, l);
|
|
418
|
+
};
|
|
419
|
+
S($e, (t) => {
|
|
420
|
+
e(f) && t(et);
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
u(V, he);
|
|
424
|
+
var tt = Te(Ze);
|
|
425
|
+
return W(), tt;
|
|
426
|
+
}
|
|
427
|
+
at(["click", "keydown"]);
|
|
428
|
+
Ce(
|
|
429
|
+
Ue,
|
|
430
|
+
{
|
|
431
|
+
apiEndpoint: {},
|
|
432
|
+
userSession: {},
|
|
433
|
+
locale: {},
|
|
434
|
+
onLevelLoaded: {},
|
|
435
|
+
onSeeMore: {},
|
|
436
|
+
limitItem: {},
|
|
437
|
+
translationUrl: {}
|
|
438
|
+
},
|
|
439
|
+
[],
|
|
440
|
+
[],
|
|
441
|
+
{ mode: "open" }
|
|
442
|
+
);
|
|
443
|
+
function Ne(V, a) {
|
|
444
|
+
Oe(a, !0);
|
|
445
|
+
let d = y(a, "apiEndpoint", 7, ""), x = y(a, "userSession", 7, ""), W = y(a, "locale", 7, ""), U = y(a, "onLevelLoaded"), N = y(a, "onSeeMore"), L = y(a, "limitItem", 7, J), D = y(a, "translationUrl");
|
|
446
|
+
var G = {
|
|
447
|
+
get apiEndpoint() {
|
|
448
|
+
return d();
|
|
449
|
+
},
|
|
450
|
+
set apiEndpoint(r = "") {
|
|
451
|
+
d(r), _();
|
|
452
|
+
},
|
|
453
|
+
get userSession() {
|
|
454
|
+
return x();
|
|
455
|
+
},
|
|
456
|
+
set userSession(r = "") {
|
|
457
|
+
x(r), _();
|
|
458
|
+
},
|
|
459
|
+
get locale() {
|
|
460
|
+
return W();
|
|
461
|
+
},
|
|
462
|
+
set locale(r = "") {
|
|
463
|
+
W(r), _();
|
|
464
|
+
},
|
|
465
|
+
get onLevelLoaded() {
|
|
466
|
+
return U();
|
|
467
|
+
},
|
|
468
|
+
set onLevelLoaded(r) {
|
|
469
|
+
U(r), _();
|
|
470
|
+
},
|
|
471
|
+
get onSeeMore() {
|
|
472
|
+
return N();
|
|
473
|
+
},
|
|
474
|
+
set onSeeMore(r) {
|
|
475
|
+
N(r), _();
|
|
476
|
+
},
|
|
477
|
+
get limitItem() {
|
|
478
|
+
return L();
|
|
479
|
+
},
|
|
480
|
+
set limitItem(r = J) {
|
|
481
|
+
L(r), _();
|
|
482
|
+
},
|
|
483
|
+
get translationUrl() {
|
|
484
|
+
return D();
|
|
485
|
+
},
|
|
486
|
+
set translationUrl(r) {
|
|
487
|
+
D(r), _();
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
return Ue(V, {
|
|
491
|
+
get apiEndpoint() {
|
|
492
|
+
return d();
|
|
493
|
+
},
|
|
494
|
+
get userSession() {
|
|
495
|
+
return x();
|
|
496
|
+
},
|
|
497
|
+
get locale() {
|
|
498
|
+
return W();
|
|
499
|
+
},
|
|
500
|
+
get onLevelLoaded() {
|
|
501
|
+
return U();
|
|
502
|
+
},
|
|
503
|
+
get onSeeMore() {
|
|
504
|
+
return N();
|
|
505
|
+
},
|
|
506
|
+
get limitItem() {
|
|
507
|
+
return L();
|
|
508
|
+
},
|
|
509
|
+
get translationUrl() {
|
|
510
|
+
return D();
|
|
511
|
+
}
|
|
512
|
+
}), Te(G);
|
|
513
|
+
}
|
|
514
|
+
customElements.define("loyalty-level", Ce(
|
|
515
|
+
Ne,
|
|
516
|
+
{
|
|
517
|
+
apiEndpoint: {},
|
|
518
|
+
userSession: {},
|
|
519
|
+
locale: {},
|
|
520
|
+
onLevelLoaded: {},
|
|
521
|
+
onSeeMore: {},
|
|
522
|
+
limitItem: {},
|
|
523
|
+
translationUrl: {}
|
|
524
|
+
},
|
|
525
|
+
[],
|
|
526
|
+
[]
|
|
527
|
+
));
|
|
528
|
+
const It = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
529
|
+
__proto__: null,
|
|
530
|
+
default: Ne
|
|
531
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
532
|
+
export {
|
|
533
|
+
Ue as L,
|
|
534
|
+
It as a
|
|
535
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-CxnhtBhF.cjs");if(typeof window<"u"){let I=function(n){return function(...d){try{return n.apply(this,d)}catch(p){if(p instanceof DOMException&&p.message.includes("has already been used with this registry")||p instanceof Error&&p.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw p}}};customElements.define=I(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPagination-CxnhtBhF.cjs")).then(n=>n.LoyaltyPagination_ce).then(n=>{const d=n.default||n;customElements.get("loyalty-pagination")||customElements.define("loyalty-pagination",d.element||d)}).catch(n=>{console.error("BOOT ERROR:",n)})}const Ee={en:{startingLevel:"Starting Level: {points} points",seeMore:"See More",seeLess:"See Less",current:"Current",next:"Next"},tr:{startingLevel:"Başlangıç Seviyesi: {points} puan",seeMore:"Daha Fazla",seeLess:"Daha Az",current:"Mevcut",next:"Sonraki"},da:{startingLevel:"Startniveau: {points} point",seeMore:"Se mere",seeLess:"Se mindre",current:"Nuværende",next:"Næste"},de:{startingLevel:"Startlevel: {points} Punkte",seeMore:"Mehr anzeigen",seeLess:"Weniger anzeigen",current:"Aktuell",next:"Nächste"},nl:{startingLevel:"Startniveau: {points} punten",seeMore:"Meer tonen",seeLess:"Minder tonen",current:"Huidig",next:"Volgende"},fr:{startingLevel:"Niveau de départ : {points} points",seeMore:"Voir plus",seeLess:"Voir moins",current:"Actuel",next:"Suivant"},hu:{startingLevel:"Kezdő szint: {points} pont",seeMore:"Több megjelenítése",seeLess:"Kevesebb megjelenítése",current:"Jelenlegi",next:"Következő"}},le="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 Ie=e.from_html('<article class="loyalty-level__card loyalty-level__card--skeleton" aria-busy="true"><header class="loyalty-level__head"><span class="loyalty-level__skeleton loyalty-level__skeleton--badge"></span> <div class="loyalty-level__headings"><span class="loyalty-level__skeleton loyalty-level__skeleton--name"></span> <span class="loyalty-level__skeleton loyalty-level__skeleton--starting"></span></div></header> <span class="loyalty-level__skeleton loyalty-level__skeleton--action"></span></article>'),ne=e.from_html('<span class="loyalty-level__tag"> </span>'),Te=e.from_html("<div></div>"),Oe=e.from_html('<button class="loyalty-level__action" type="button"> </button>'),Ce=e.from_html('<article><header class="loyalty-level__head"><img class="loyalty-level__badge"/> <div class="loyalty-level__headings"><span class="loyalty-level__name"> </span> <span class="loyalty-level__starting"> </span></div> <!></header> <!> <!></article>'),ze=e.from_html('<div class="loyalty-level__sentinel" aria-hidden="true"></div>'),De=e.from_html('<img class="loyalty-level__badge"/>'),Ue=e.from_html('<div class="loyalty-level__benefits"></div>'),Ae=e.from_html('<div class="loyalty-level__modal-overlay" role="presentation"><div class="loyalty-level__modal" role="dialog" aria-modal="true" tabindex="-1"><div class="loyalty-level__modal-close-wrapper"><button class="loyalty-level__modal-close" type="button" aria-label="close">×</button></div> <div class="loyalty-level__modal-content"><header class="loyalty-level__modal-head"><!> <div class="loyalty-level__headings"><span class="loyalty-level__name"> </span> <span class="loyalty-level__starting"> </span></div> <!></header> <!></div></div></div>'),Fe=e.from_html('<div class="loyalty-level"><div class="loyalty-level__grid"><!></div> <!> <!></div> <!>',1);const Ne={hash:"svelte-nbxilv",code:`
|
|
2
|
+
@layer loyalty-level-component {.loyalty-level {width:100%;box-sizing:border-box;}.loyalty-level__grid {display:grid;grid-template-columns:repeat(auto-fill, minmax(min(100%, 326px), 1fr));gap:12px;align-items:stretch;}.loyalty-level__card {display:flex;flex-direction:column;gap:16px;padding:16px;background-color:var(--app-container-bg-default, #022652);border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));border-radius:6px;box-sizing:border-box;max-height:242px;overflow:hidden;line-height:1.4;}.loyalty-level__card--expanded {max-height:none;overflow:visible;}.loyalty-level__head {display:flex;align-items:flex-start;gap:6px;}.loyalty-level__badge {width:40px;height:40px;flex-shrink:0;}.loyalty-level__headings {display:flex;flex-direction:column;gap:2px;flex:1;min-width:0;}.loyalty-level__name {color:var(--text-default, #ffffff);font-size:14px;font-weight:500;text-transform:uppercase;line-height:1.4;}.loyalty-level__tag {flex-shrink:0;align-self:flex-start;padding:10px;border-radius:100px;background:var(--badges-element-default, rgba(255, 204, 0, 0.05));color:var(--text-brand, #ffcc00);font-size:12px;font-weight:500;}.loyalty-level__starting {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-level__benefits {color:var(--text-subtle, #dfe3e8);font-size:13px;line-height:1.5;flex:1 1 auto;min-height:0;overflow:hidden;}.loyalty-level__card--expanded .loyalty-level__benefits {flex:none;overflow:visible;}.loyalty-level__benefits ul {margin:0;padding-left:18px;list-style:disc;}.loyalty-level__benefits li {margin-bottom:6px;}.loyalty-level__action {margin-top:auto;width:100%;padding:8px 16px;border:1px solid var(--button-secondary-border-default, rgba(251, 251, 251, 0.05));border-radius:6px;background:var(--button-secondary-bg-default, rgba(251, 251, 251, 0.1));color:var(--button-secondary-text-default, #ffffff);font-size:12px;font-weight:400;cursor:pointer;}.loyalty-level__modal-overlay {position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:24px;background-color:rgba(0, 0, 0, 0.7);backdrop-filter:blur(3px);}.loyalty-level__modal {position:relative;width:100%;max-width:40dvw;max-height:90dvh;padding:24px 16px;background-color:var(--app-container-bg-default, #022652);border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));border-radius:8px;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;}.loyalty-level__modal-content {padding:8px;display:flex;flex-direction:column;gap:16px;flex:1 1 auto;min-height:0;overflow:hidden;}.loyalty-level__modal-content .loyalty-level__benefits {flex:1 1 auto;min-height:0;overflow-y:auto;}.loyalty-level__modal-head {display:flex;align-items:flex-start;gap:12px;flex-shrink:0;}.loyalty-level__modal-close-wrapper {display:flex;justify-content:flex-end;flex-shrink:0;}.loyalty-level__modal-close {border:none;background:transparent;color:var(--icon-default, #b3becb);font-size:25px;line-height:1;cursor:pointer;}.loyalty-level__sentinel {width:100%;height:1px;}.loyalty-level__card--skeleton {pointer-events:none;justify-content:flex-start;height:180px;}.loyalty-level__skeleton {display:block;border-radius:4px;background:linear-gradient(
|
|
3
|
+
90deg,
|
|
4
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
|
|
5
|
+
color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
|
|
6
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
|
|
7
|
+
);background-size:400% 100%;
|
|
8
|
+
animation: loyalty-level-shimmer 1.4s ease infinite;}.loyalty-level__skeleton--badge {width:40px;height:40px;flex-shrink:0;border-radius:6px;}.loyalty-level__skeleton--name {width:60%;height:16px;}.loyalty-level__skeleton--starting {width:40%;height:14px;}.loyalty-level__skeleton--action {margin-top:auto;width:100%;height:33px;border-radius:6px;}
|
|
9
|
+
|
|
10
|
+
@keyframes loyalty-level-shimmer {
|
|
11
|
+
0% {
|
|
12
|
+
background-position: 100% 50%;
|
|
13
|
+
}
|
|
14
|
+
100% {
|
|
15
|
+
background-position: 0 50%;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (prefers-reduced-motion: reduce) {.loyalty-level__skeleton {
|
|
20
|
+
animation: none;}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@media (max-width: 767px) {.loyalty-level__benefits {overflow-wrap:anywhere;word-break:break-word;}.loyalty-level__benefits--collapsed {max-height:calc(1.5em * 2);overflow:hidden;}.loyalty-level__benefits p {margin:0;}.loyalty-level__benefits ul,
|
|
24
|
+
.loyalty-level__benefits ol {margin:0;padding-left:18px;}.loyalty-level__benefits li {margin-bottom:6px;}.loyalty-level__benefits li:last-child {margin-bottom:0;}.loyalty-level__card--expanded {max-height:none;overflow:visible;}.loyalty-level__card--expanded .loyalty-level__benefits {flex:none;max-height:none;overflow:visible;}
|
|
25
|
+
}
|
|
26
|
+
}`};function Y(I,n){e.push(n,!0),e.append_styles(I,Ne);const d=()=>e.store_get(e.$format,"$_",p),[p,z]=e.setup_stores(),L=e.prop(n,"apiEndpoint",7,""),w=e.prop(n,"userSession",7,""),f=e.prop(n,"locale",7,""),S=e.prop(n,"onLevelLoaded",7,t=>{}),D=e.prop(n,"onSeeMore",7,t=>{}),r=e.prop(n,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),P=e.prop(n,"translationUrl");e.setupI18n({withLocale:f(),translations:{}});const oe=()=>{let t=new URL(P(),window.location.href);fetch(t.href).then(l=>l.json()).then(l=>{Object.keys(l).forEach(a=>{e.addNewMessages(a,l[a])})}).catch(l=>{console.log("loyalty level translation url err:",l)})};Object.entries(Ee).forEach(([t,l])=>{e.addNewMessages(t,l)}),e.user_effect(()=>{e.setLocale(f()??"en")}),e.user_pre_effect(()=>{P()&&oe()});const re=t=>{S()(t)},H=e.createElevateData(()=>({apiEndpoint:L(),userSession:w(),locale:f(),loadLevels:!0,onLevelLoaded:re})),B=e.user_derived(()=>H.playerElevateLevel?.id),m=e.user_derived(()=>typeof r()=="number"?r():parseInt(r(),e.ITEMS_LIMIT_DEFAULT)||e.ITEMS_LIMIT_DEFAULT),k=e.user_derived(()=>[...H.levels??[]].sort((t,l)=>t.firstEntryPoints<l.firstEntryPoints?-1:1)),T=t=>t.presentation?.displayName??t.displayName??String(t.id);let O=e.state(0),g=e.state(!1),U=e.state(e.proxy(e.MOBILE_LOAD_ITEMS)),j=e.state(void 0),C=e.state(void 0),v=e.state(void 0),A=e.state(e.proxy({}));const ie=e.user_derived(()=>Math.max(1,Math.ceil(e.get(k).length/e.get(m)))),se=e.user_derived(()=>e.get(g)?e.get(k).slice(0,e.get(U)):e.get(k).slice(e.get(O)*e.get(m),e.get(O)*e.get(m)+e.get(m))),de=e.user_derived(()=>e.get(k).length>0&&!!H.playerElevateLevel),$=e.user_derived(()=>H.loading&&!e.get(de)),ce=e.user_derived(()=>e.get(g)?e.MOBILE_LOAD_ITEMS:e.get(m)),_e=(t,l)=>{let a;const h=()=>{if(!e.get(g)){e.get(A)[l]=!1;return}const b=window.getComputedStyle(t),y=parseFloat(b.maxHeight);if(!Number.isFinite(y)||y<=0){e.get(A)[l]=!1;return}const M=12;e.get(A)[l]=t.scrollHeight>y+M},o=()=>{a!==void 0&&cancelAnimationFrame(a),a=requestAnimationFrame(h)};o();const u=new ResizeObserver(o);return u.observe(t),{destroy(){a!==void 0&&cancelAnimationFrame(a),u.disconnect(),delete e.get(A)[l]}}};e.user_effect(()=>{e.get(O)>e.get(ie)-1&&e.set(O,0)}),e.user_effect(()=>{e.set(U,e.get(g)?e.MOBILE_LOAD_ITEMS:e.get(m),!0)}),e.user_effect(()=>{if(!e.get(g)||!e.get(j))return;const t=new IntersectionObserver(l=>{l.some(a=>a.isIntersecting)&&e.set(U,Math.min(e.get(k).length,e.get(U)+e.MOBILE_LOAD_ITEMS),!0)},{rootMargin:"200px"});return t.observe(e.get(j)),()=>t.disconnect()});const ge=t=>{e.set(O,Math.floor(t/e.get(m)),!0)};e.user_effect(()=>{const t=window.matchMedia("(max-width: 767px)"),l=a=>{e.set(g,a.matches,!0)};return e.set(g,t.matches,!0),t.addEventListener("change",l),()=>t.removeEventListener("change",l)});const ve=t=>{if(D()(t),!e.get(g)){e.sendLoyaltyLevelClicked(T(t)),e.set(v,t,!0);return}const l=e.get(C)!==t.id;l&&e.sendLoyaltyLevelClicked(T(t)),e.set(C,l?t.id:void 0,!0)},V=()=>{e.set(v,void 0)},ye=t=>{t.target===t.currentTarget&&V()},pe=t=>{t.key==="Escape"&&V()};e.user_effect(()=>{if(!e.get(v))return;const t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}});var ue={get apiEndpoint(){return L()},set apiEndpoint(t=""){L(t),e.flushSync()},get userSession(){return w()},set userSession(t=""){w(t),e.flushSync()},get locale(){return f()},set locale(t=""){f(t),e.flushSync()},get onLevelLoaded(){return S()},set onLevelLoaded(t=l=>{}){S(t),e.flushSync()},get onSeeMore(){return D()},set onSeeMore(t=l=>{}){D(t),e.flushSync()},get limitItem(){return r()},set limitItem(t=e.ITEMS_LIMIT_DEFAULT){r(t),e.flushSync()},get translationUrl(){return P()},set translationUrl(t){P(t),e.flushSync()}},ee=Fe(),q=e.first_child(ee),K=e.child(q),fe=e.child(K);{var he=t=>{var l=e.comment(),a=e.first_child(l);e.each(a,17,()=>({length:e.get(ce)}),e.index,(h,o,u,b)=>{var y=Ie();e.append(h,y)}),e.append(t,l)},me=t=>{var l=e.comment(),a=e.first_child(l);e.each(a,17,()=>e.get(se),h=>h.id,(h,o)=>{var u=Ce();let b;var y=e.child(u),M=e.child(y),E=e.sibling(M,2),F=e.child(E),Z=e.only_child(F,!0),W=e.sibling(F,2),J=e.only_child(W,!0);e.reset(E);var G=e.sibling(E,2);{var Q=i=>{var s=ne(),x=e.only_child(s,!0);e.template_effect(N=>e.set_text(x,N),[()=>d()("current")]),e.append(i,s)};e.if_block(G,i=>{e.get(o).id===e.get(B)&&i(Q)})}e.reset(y);var R=e.sibling(y,2);{var X=i=>{var s=Te();let x;e.html(s,()=>e.get(o).presentation.description,!0),e.reset(s),e.action(s,(N,Me)=>_e?.(N,Me),()=>e.get(o).id),e.template_effect(()=>x=e.set_class(s,1,"loyalty-level__benefits",null,x,{"loyalty-level__benefits--collapsed":e.get(g)&&e.get(C)!==e.get(o).id})),e.append(i,s)};e.if_block(R,i=>{e.get(o).presentation?.description&&i(X)})}var c=e.sibling(R,2);{var _=i=>{var s=Oe(),x=e.only_child(s,!0);e.template_effect(N=>e.set_text(x,N),[()=>e.get(C)===e.get(o).id?d()("seeLess"):d()("seeMore")]),e.delegated("click",s,()=>ve(e.get(o))),e.append(i,s)};e.if_block(c,i=>{(!e.get(g)||e.get(A)[e.get(o).id]||e.get(C)===e.get(o).id)&&i(_)})}e.reset(u),e.template_effect((i,s,x)=>{b=e.set_class(u,1,"loyalty-level__card",null,b,{"loyalty-level__card--current":e.get(o).id===e.get(B),"loyalty-level__card--expanded":e.get(C)===e.get(o).id}),e.set_attribute(M,"src",e.get(o).presentation?.asset||le),e.set_attribute(M,"alt",i),e.set_text(Z,s),e.set_text(J,x)},[()=>T(e.get(o)),()=>T(e.get(o)),()=>d()("startingLevel",{values:{points:e.get(o).firstEntryPoints.toLocaleString()}})]),e.append(h,u)}),e.append(t,l)};e.if_block(fe,t=>{e.get($)?t(he):t(me,-1)})}e.reset(K);var te=e.sibling(K,2);{var be=t=>{{let l=e.user_derived(()=>e.get(O)*e.get(m));e.LoyaltyPagination(t,{get offset(){return e.get(l)},get limit(){return e.get(m)},get total(){return e.get(k).length},onPageChange:ge,get locale(){return f()}})}};e.if_block(te,t=>{!e.get($)&&!e.get(g)&&t(be)})}var xe=e.sibling(te,2);{var Le=t=>{var l=ze();e.bind_this(l,a=>e.set(j,a),()=>e.get(j)),e.append(t,l)};e.if_block(xe,t=>{e.get(g)&&e.get(U)<e.get(k).length&&t(Le)})}e.reset(q);var we=e.sibling(q,2);{var Se=t=>{var l=Ae(),a=e.child(l),h=e.child(a),o=e.only_child(h),u=e.sibling(h,2),b=e.child(u),y=e.child(b);{var M=c=>{var _=De();e.template_effect(i=>{e.set_attribute(_,"src",e.get(v).presentation.asset||le),e.set_attribute(_,"alt",i)},[()=>T(e.get(v))]),e.append(c,_)};e.if_block(y,c=>{e.get(v).presentation?.asset&&c(M)})}var E=e.sibling(y,2),F=e.child(E),Z=e.only_child(F,!0),W=e.sibling(F,2),J=e.only_child(W,!0);e.reset(E);var G=e.sibling(E,2);{var Q=c=>{var _=ne(),i=e.only_child(_,!0);e.template_effect(s=>e.set_text(i,s),[()=>d()("current")]),e.append(c,_)};e.if_block(G,c=>{e.get(v).id===e.get(B)&&c(Q)})}e.reset(b);var R=e.sibling(b,2);{var X=c=>{var _=Ue();e.html(_,()=>e.get(v).presentation.description,!0),e.reset(_),e.append(c,_)};e.if_block(R,c=>{e.get(v).presentation?.description&&c(X)})}e.reset(u),e.reset(a),e.reset(l),e.template_effect((c,_)=>{e.set_text(Z,c),e.set_text(J,_)},[()=>T(e.get(v)),()=>d()("startingLevel",{values:{points:e.get(v).firstEntryPoints.toLocaleString()}})]),e.delegated("click",l,ye),e.delegated("keydown",l,pe),e.delegated("click",o,V),e.append(t,l)};e.if_block(we,t=>{e.get(v)&&t(Se)})}e.append(I,ee);var ke=e.pop(ue);return z(),ke}e.delegate(["click","keydown"]);e.create_custom_element(Y,{apiEndpoint:{},userSession:{},locale:{},onLevelLoaded:{},onSeeMore:{},limitItem:{},translationUrl:{}},[],[],{mode:"open"});function ae(I,n){e.push(n,!0);let d=e.prop(n,"apiEndpoint",7,""),p=e.prop(n,"userSession",7,""),z=e.prop(n,"locale",7,""),L=e.prop(n,"onLevelLoaded"),w=e.prop(n,"onSeeMore"),f=e.prop(n,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),S=e.prop(n,"translationUrl");var D={get apiEndpoint(){return d()},set apiEndpoint(r=""){d(r),e.flushSync()},get userSession(){return p()},set userSession(r=""){p(r),e.flushSync()},get locale(){return z()},set locale(r=""){z(r),e.flushSync()},get onLevelLoaded(){return L()},set onLevelLoaded(r){L(r),e.flushSync()},get onSeeMore(){return w()},set onSeeMore(r){w(r),e.flushSync()},get limitItem(){return f()},set limitItem(r=e.ITEMS_LIMIT_DEFAULT){f(r),e.flushSync()},get translationUrl(){return S()},set translationUrl(r){S(r),e.flushSync()}};return Y(I,{get apiEndpoint(){return d()},get userSession(){return p()},get locale(){return z()},get onLevelLoaded(){return L()},get onSeeMore(){return w()},get limitItem(){return f()},get translationUrl(){return S()}}),e.pop(D)}customElements.define("loyalty-level",e.create_custom_element(ae,{apiEndpoint:{},userSession:{},locale:{},onLevelLoaded:{},onSeeMore:{},limitItem:{},translationUrl:{}},[],[]));const Pe=Object.freeze(Object.defineProperty({__proto__:null,default:ae},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyLevel=Y;exports.LoyaltyLevel_ce=Pe;
|