@everymatrix/casino-categories 1.17.3 → 1.17.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.
|
@@ -582,7 +582,7 @@ function Br(e){let t,r,n,i,o,s,a,l,p,v,T,H,_,C,B,A,L,P=/*category*/e[24].name+""
|
|
|
582
582
|
return e[15](/*category*/e[24])}return{c(){t=g("div"),r=g("img"),o=d(),s=g("div"),a=g("p"),l=m(P),p=d(),v=g("p"),T=m(S),H=d(),_=m(O),C=d(),h(r.src,n=/*category*/e[24].icon)||b(r,"src",n),b(r,"alt",i=/*category*/e[24].name),b(r,"class","CategoryImage"),b(s,"class","CategoryTextContainer"),b(t,"class",B="Category "+(/*activecategory*/e[0]===/*category*/e[24].id?"Active":""))},m(e,n){u(e,t,n),c(t,r),c(t,o),c(t,s),c(s,a),c(a,l),c(s,p),c(s,v),c(v,T),c(v,H),c(v,_),c(t,C),A||(L=E(t,"click",w),A=!0)},p(o,s){e=o,/*otherCategories*/16&s&&!h(r.src,n=/*category*/e[24].icon)&&b(r,"src",n),/*otherCategories*/16&s&&i!==(i=/*category*/e[24].name)&&b(r,"alt",i),/*otherCategories*/16&s&&P!==(P=/*category*/e[24].name+"")&&y(l,P),/*otherCategories*/16&s&&S!==(S=/*category*/e[24].games.count+"")&&y(T,S),/*$_*/32&s&&O!==(O=/*$_*/e[5]("games")+"")&&y(_,O),/*activecategory, otherCategories*/17&s&&B!==(B="Category "+(/*activecategory*/e[0]===/*category*/e[24].id?"Active":""))&&b(t,"class",B)},d(e){e&&f(t),A=!1,L()}}}function Ar(t){let r;function n(e,t){/*isLoading*/
|
|
583
583
|
return e[2]?_r:Hr}let i=n(t),o=i(t);return{c(){r=g("div"),o.c(),this.c=e},m(e,n){u(e,r,n),o.m(r,null),
|
|
584
584
|
/*div_binding*/t[16](r)},p(e,[t]){i===(i=n(e))&&o?o.p(e,t):(o.d(1),o=i(e),o&&(o.c(),o.m(r,null)))},i:e,o:e,d(e){e&&f(r),o.d(),
|
|
585
|
-
/*div_binding*/t[16](null)}}}function Lr(e,t,r){let n;var i,o;i=Er,o=e=>r(5,n=e),e.$$.on_destroy.push(l(i,o));let s,{endpoint:a=""}=t,{datasource:h=""}=t,{lang:c="en"}=t,{activecategory:u=""}=t,{excludedflags:f=""}=t,{clientstyling:p=""}=t,{clientstylingurl:g=""}=t,{translationurl:m=""}=t,d=!1;const E=[];let b=[],y=[];Object.keys(yr).forEach((e=>{br(e,yr[e])}));const v=e=>{window.postMessage({type:"OpenGameCategory",categoryId:e},window.location.href)},T=()=>{var e;e=c,Qt.set(e)};return e.$$set=e=>{"endpoint"in e&&r(7,a=e.endpoint),"datasource"in e&&r(8,h=e.datasource),"lang"in e&&r(9,c=e.lang),"activecategory"in e&&r(0,u=e.activecategory),"excludedflags"in e&&r(10,f=e.excludedflags),"clientstyling"in e&&r(11,p=e.clientstyling),"clientstylingurl"in e&&r(12,g=e.clientstylingurl),"translationurl"in e&&r(13,m=e.translationurl)},e.$$.update=()=>{/*endpoint, datasource*/384&e.$$.dirty&&a&&h&&(()=>{r(2,d=!0);const e=new URL(`${a}/
|
|
585
|
+
/*div_binding*/t[16](null)}}}function Lr(e,t,r){let n;var i,o;i=Er,o=e=>r(5,n=e),e.$$.on_destroy.push(l(i,o));let s,{endpoint:a=""}=t,{datasource:h=""}=t,{lang:c="en"}=t,{activecategory:u=""}=t,{excludedflags:f=""}=t,{clientstyling:p=""}=t,{clientstylingurl:g=""}=t,{translationurl:m=""}=t,d=!1;const E=[];let b=[],y=[];Object.keys(yr).forEach((e=>{br(e,yr[e])}));const v=e=>{window.postMessage({type:"OpenGameCategory",categoryId:e},window.location.href)},T=()=>{var e;e=c,Qt.set(e)};return e.$$set=e=>{"endpoint"in e&&r(7,a=e.endpoint),"datasource"in e&&r(8,h=e.datasource),"lang"in e&&r(9,c=e.lang),"activecategory"in e&&r(0,u=e.activecategory),"excludedflags"in e&&r(10,f=e.excludedflags),"clientstyling"in e&&r(11,p=e.clientstyling),"clientstylingurl"in e&&r(12,g=e.clientstylingurl),"translationurl"in e&&r(13,m=e.translationurl)},e.$$.update=()=>{/*endpoint, datasource*/384&e.$$.dirty&&a&&h&&(()=>{r(2,d=!0);const e=new URL(`${a}/casino/groups/${h}`);e.searchParams.append("language",c),fetch(e).then((e=>e.json())).then((e=>{r(2,d=!1);const t=f.split(",").map((e=>e.trim()));E.push(...e.items);
|
|
586
586
|
// remove those items which have a flag matching the excluded flags
|
|
587
587
|
const n=E.filter((e=>!t.some((t=>{var r;return(null===(r=e.flags)||void 0===r?void 0:r.indexOf(t))>=0}))));r(3,b=n.filter((e=>!0===e.isTopCategory))),r(4,y=n.filter((e=>!1===e.isTopCategory)))}))})(),/*translationurl*/8192&e.$$.dirty&&m&&fetch(m).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{br(t,e[t])}))})).catch((e=>{console.log(e)})),/*lang*/512&e.$$.dirty&&c&&T(),/*clientstyling, customStylingContainer*/2050&e.$$.dirty&&p&&s&&(()=>{let e=document.createElement("style");e.innerHTML=p,s.appendChild(e)})(),/*clientstylingurl, customStylingContainer*/4098&e.$$.dirty&&g&&s&&(()=>{let e=new URL(g),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{s.appendChild(t)}),1),setTimeout((()=>{}),500)}))})()},[u,s,d,b,y,n,v,a,h,c,f,p,g,m,e=>v(e.id),e=>v(e.id),function(e){_[e?"unshift":"push"]((()=>{s=e,r(1,s)}))}]}class Pr extends G{constructor(e){super();const t=document.createElement("style");t.textContent="*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}.CasinoCategories{display:flex;flex-direction:column;gap:1rem;padding:10px 60px}.CategoryTitle{font-weight:500;position:relative;right:30px;margin:10px 0;font-size:18px;color:var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF))}.Category{border-radius:7px;display:flex;align-items:center;gap:16px;max-width:300px}.Category.Active{box-shadow:15px 15px 30px var(--emfe-w-color-gray-100, #E6E6E6)}.CategoryTextContainer{display:flex;flex-direction:column;justify-content:center;gap:10px;font-size:15px;color:var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF))}.CategoryTextContainer p:first-child{font-weight:600;color:var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF))}.CategoryTextContainer p:last-child{color:var(--emfe-w-color-gray-150, #828282);font-weight:300}.CategoryImage{border-radius:4px;object-fit:cover;height:64px;width:64px;font-weight:100}.Message{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);font-weight:600}",this.shadowRoot.appendChild(t),U(this,{target:this.shadowRoot,props:v(this.attributes),customElement:!0},Lr,Ar,o,{endpoint:7,datasource:8,lang:9,activecategory:0,excludedflags:10,clientstyling:11,clientstylingurl:12,translationurl:13},null),e&&(e.target&&u(e.target,this,e.anchor),e.props&&(this.$set(e.props),w()))}static get observedAttributes(){return["endpoint","datasource","lang","activecategory","excludedflags","clientstyling","clientstylingurl","translationurl"]}get endpoint(){return this.$$.ctx[7]}set endpoint(e){this.$$set({endpoint:e}),w()}get datasource(){return this.$$.ctx[8]}set datasource(e){this.$$set({datasource:e}),w()}get lang(){return this.$$.ctx[9]}set lang(e){this.$$set({lang:e}),w()}get activecategory(){return this.$$.ctx[0]}set activecategory(e){this.$$set({activecategory:e}),w()}get excludedflags(){return this.$$.ctx[10]}set excludedflags(e){this.$$set({excludedflags:e}),w()}get clientstyling(){return this.$$.ctx[11]}set clientstyling(e){this.$$set({clientstyling:e}),w()}get clientstylingurl(){return this.$$.ctx[12]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),w()}get translationurl(){return this.$$.ctx[13]}set translationurl(e){this.$$set({translationurl:e}),w()}}return!customElements.get("casino-categories")&&customElements.define("casino-categories",Pr),Pr}));
|
|
588
588
|
//# sourceMappingURL=casino-categories.js.map
|