@everymatrix/bonus-elevate-shop-item 1.0.69
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/dist/bonus-elevate-shop-item/bonus-elevate-shop-item.esm.js +1 -0
- package/dist/bonus-elevate-shop-item/index.esm.js +0 -0
- package/dist/bonus-elevate-shop-item/p-d5e265dc.entry.js +1 -0
- package/dist/bonus-elevate-shop-item/p-e1255160.js +1 -0
- package/dist/bonus-elevate-shop-item/p-ec5f179f.js +2 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/bonus-elevate-shop-assets-slider_3.cjs.entry.js +427 -0
- package/dist/cjs/bonus-elevate-shop-item.cjs.js +25 -0
- package/dist/cjs/index-1035f878.js +1591 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/collection/collection-manifest.json +20 -0
- package/dist/collection/components/bonus-elevate-shop-item/bonus-elevate-shop-assets-slider.js +210 -0
- package/dist/collection/components/bonus-elevate-shop-item/bonus-elevate-shop-item.css +196 -0
- package/dist/collection/components/bonus-elevate-shop-item/bonus-elevate-shop-item.js +343 -0
- package/dist/collection/components/bonus-elevate-shop-item/index.js +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/models/bonus-elevate-shop-item.js +1 -0
- package/dist/collection/utils/locale.utils.js +63 -0
- package/dist/collection/utils/utils.js +39 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/bonus-elevate-shop-assets-slider_3.entry.js +421 -0
- package/dist/esm/bonus-elevate-shop-item.js +20 -0
- package/dist/esm/index-fa394550.js +1561 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +17 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/bonus-elevate-shop-item/.stencil/packages/stencil/bonus-elevate-shop-item/stencil.config.d.ts +2 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/bonus-elevate-shop-item/.stencil/packages/stencil/bonus-elevate-shop-item/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/bonus-elevate-shop-item/bonus-elevate-shop-assets-slider.d.ts +37 -0
- package/dist/types/components/bonus-elevate-shop-item/bonus-elevate-shop-item.d.ts +60 -0
- package/dist/types/components/bonus-elevate-shop-item/index.d.ts +1 -0
- package/dist/types/components.d.ts +168 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/bonus-elevate-shop-item.d.ts +16 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/locale.utils.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +9 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +29 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,b as t}from"./p-ec5f179f.js";export{s as setNonce}from"./p-ec5f179f.js";import{g as i}from"./p-e1255160.js";(()=>{const s=import.meta.url,t={};return""!==s&&(t.resourcesUrl=new URL(".",s).href),e(t)})().then((async e=>(await i(),t([["p-d5e265dc",[[1,"bonus-elevate-shop-item",{endpoint:[513],language:[513],itemId:[1537,"item-id"],elevateGift:[1040],session:[513],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],showSliderDots:[516,"show-slider-dots"],showSliderArrows:[516,"show-slider-arrows"],isGiftNotFound:[32],redeemErrorMsg:[32],isRedeeming:[32]}],[0,"bonus-elevate-shop-assets-slider",{showSliderDots:[516,"show-slider-dots"],showSliderArrows:[516,"show-slider-arrows"],itemsPerPage:[514,"items-per-page"],sliderItems:[16],activeIndex:[32]}],[4,"general-styling-wrapper",{clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],translationUrl:[1,"translation-url"],targetTranslations:[16]}]]]],e))));
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as t,g as i,c as s,F as a,H as r}from"./p-ec5f179f.js";const o=class{constructor(t){e(this,t),this.xDown=null,this.yDown=null,this.orientationChangeHandler=()=>{setTimeout((()=>{this.recalculateItemsPerPage()}),10)},this.resizeHandler=()=>{this.recalculateItemsPerPage()},this.showSliderDots=!1,this.showSliderArrows=!0,this.itemsPerPage=1,this.sliderItems=[],this.activeIndex=0}setActive(e){var t;const i=null===(t=this.sliderItems)||void 0===t?void 0:t.length;this.activeIndex=e>=0?e>=i-1?i-1:e:0}move(e){this.setActive(this.activeIndex+e)}goTo(e){let t=this.activeIndex-e;if(t>0)for(let e=0;e<t;e++)this.move(-1);else for(let e=0;e>t;e--)this.move(1)}handleTouchStart(e){const t=this.getTouches(e)[0];this.xDown=t.clientX,this.yDown=t.clientY}getTouches(e){return e.touches||e.originalEvent.touches}handleTouchMove(e){if(!this.xDown||!this.yDown)return;let t=this.xDown-e.touches[0].clientX,i=this.yDown-e.touches[0].clientY;Math.abs(t)>Math.abs(i)&&this.move(t>0?1:-1),this.xDown=null,this.yDown=null}recalculateItemsPerPage(){this.sliderItemsElement&&(this.itemElementWidth=this.sliderItemsElement.clientWidth,this.sliderItemsElementWidth=(this.sliderItems.length-1)*this.itemElementWidth)}renderDots(){var e;const i=[];for(let s=0;s<(null===(e=this.sliderItems)||void 0===e?void 0:e.length)/this.itemsPerPage;s++)i.push(t("li",{class:s==this.activeIndex?"active":"default",onClick:()=>{this.goTo(s),this.setActive(s)}}));return i}componentDidRender(){this.el.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),this.el.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!0}),this.recalculateItemsPerPage()}componentDidUpdate(){this.recalculateItemsPerPage()}connectedCallback(){window.screen.orientation.addEventListener("change",this.orientationChangeHandler)}disconnectedCallback(){this.el.removeEventListener("touchstart",this.handleTouchStart),this.el.removeEventListener("touchmove",this.handleTouchMove),window.screen.orientation.removeEventListener("change",this.orientationChangeHandler),window.removeEventListener("resize",this.resizeHandler)}render(){var e;const i={transform:`translate(${this.sliderItemsElementWidth/((null===(e=this.sliderItems)||void 0===e?void 0:e.length)-1)*this.activeIndex*-1}px, 0px)`},s={width:this.itemElementWidth/this.itemsPerPage+"px"};return t("div",{key:"210d648ae90dd04e350c0cddb2047061f5989bd8",class:"SliderWrapper"},t("div",{key:"240a214bc772890145b8317bfda32f6099150726",class:"MainContent "},this.showSliderArrows&&t("div",{key:"e8e144fbc2906ee0c5e77cc00c33fb1e89ced29f",class:`SliderNavButton LeftArrow ${0===this.activeIndex?"DisabledArrow ":""} ${1===this.sliderItems.length?"HiddenArrow ":""}`,onClick:()=>this.move(-1)},t("svg",{key:"068a669fa96d11532199f2f2eb44e3a4c3f31e10",fill:"none",stroke:"var(--emfe-w-color-secondary, #FD2839)",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"2789bb8d91ce4ec7f0fd7c3c6b9f3c7b7e682088","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"}))),t("div",{key:"034ef81e4d9a8dea56fd42791e8a08940dfa4af6",class:"ItemsWrapper",ref:e=>this.sliderItemsElement=e},t("div",{key:"f412b5f0978348e4d9e0af682d151a1880f6e86d",class:"Items AssetsItems",style:i},this.sliderItems.map((e=>t("img",{class:`img${this.itemsPerPage}`,alt:"Gift Thumbnails",style:s,src:e}))))),this.showSliderArrows&&t("div",{key:"0f8549f8a5bcf2f1cfcde601930610fe5cc98427",class:`SliderNavButton RightArrow ${1===this.sliderItems.length?"HiddenArrow ":""}\n ${this.activeIndex===this.sliderItems.length-1||this.itemsPerPage==this.sliderItems.length?"DisabledArrow":""}`,onClick:()=>this.move(1)},t("svg",{key:"5758a9a73af5f7fa4618ae1b4bb30d838b509d9f",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"720c5f0f496e8817fc9017ec4e8706cb9644e9ef","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})))),this.showSliderDots&&this.sliderItems.length>1&&t("div",{key:"9c1b9c57b1871d7463569ea9566b28e925870d59",class:"DotsWrapper"},t("ul",{key:"548d1d0f2c46170e07aa7ed4019dc3469e2e3950",class:"Dots"},this.renderDots())))}get el(){return i(this)}},d=["ro","en","fr","ar","hu"],n={en:{points:"Points",noGiftPresentation:"No description",redeem:"Redeem",noDataFound:"No data found",error4003:"Invalid Session",redeemFailed:"Failed to redeem"},ro:{points:"Points",noGiftPresentation:"No description",redeem:"Redeem",noDataFound:"No data found",error4003:"Invalid Session",redeemFailed:"Failed to redeem"},fr:{points:"Points",noGiftPresentation:"No description",redeem:"Redeem",noDataFound:"No data found",error4003:"Invalid Session",redeemFailed:"Failed to redeem"},ar:{points:"Points",noGiftPresentation:"No description",redeem:"Redeem",noDataFound:"No data found",error4003:"Invalid Session",redeemFailed:"Failed to redeem"},hu:{points:"Points",noGiftPresentation:"No description",redeem:"Redeem",noDataFound:"No data found",error4003:"Invalid Session",redeemFailed:"Failed to redeem"}},l=(e,t)=>{const i=t;return n[void 0!==i&&d.includes(i)?i:"en"][e]},c=class{constructor(t){e(this,t),this.redeemGiftButton=s(this,"redeemGiftButton",7),this.bindedHandler=this.handleMessage.bind(this),this.deviceType=(()=>{const e=(()=>{let e=window.navigator.userAgent;return e.toLowerCase().match(/android/i)?"Android":e.toLowerCase().match(/iphone/i)?"iPhone":e.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(e)return"PC"===e?"dk":"iPad"===e||"iPhone"===e?"ios":"mtWeb"})(),this.endpoint=void 0,this.language="en",this.itemId=void 0,this.elevateGift=void 0,this.session=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.showSliderDots=!1,this.showSliderArrows=!0,this.isGiftNotFound=!1,this.redeemErrorMsg="",this.isRedeeming=!1}redeemGiftConfirm(){window.postMessage({type:"BEERedeemConfirm",shopItem:this.elevateGift},window.location.href)}handleMessage(e){e.data&&"bee-redeem-confirmed"===e.data.type&&e.data.id==this.elevateGift.id&&this.redeemGift()}onBackClicked(){window.postMessage({type:"OnGiftDetailsBackButtonClicked"},window.location.href)}redeemGift(){if("false"===this.elevateGift.available.toLowerCase())return;let e=new URL(`${this.endpoint}/v1/elevate/redeem`),t={method:"PUT",headers:{"x-SessionId":this.session,"Content-Type":"application/json-patch+json"},body:JSON.stringify({giftId:this.elevateGift.id})};this.redeemErrorMsg="",this.isRedeeming=!0,fetch(e.toString(),t).then((e=>e.json())).then((e=>{if(e.success)this.redeemGiftButton.emit(),window.postMessage({type:"BEEGiftRedeem",itemId:this.elevateGift.id},window.location.href);else{let t=l(`error${e.errorCode}`,this.language);this.redeemErrorMsg=t||l("redeemFailed",this.language),window.postMessage({type:"BEEGiftRedeemFailed",itemId:this.elevateGift.id,res:e},window.location.href)}})).catch((e=>{window.postMessage({type:"BEEGiftClaimFailed",itemId:this.elevateGift.id,err:e},window.location.href)})).finally((()=>{this.isRedeeming=!1}))}async loadElevateGift(){let e=new URL(`${this.endpoint}/v1/elevate/shop?language=${this.language}&filter=id=${this.itemId}`),t={headers:{"Content-Type":"application/json","x-SessionId":this.session},method:"GET"};await new Promise((i=>{fetch(e.href,t).then((e=>e.json())).then((e=>{let t=e.data;t&&1==t.length?(this.elevateGift=t[0],this.isGiftNotFound=!1):this.isGiftNotFound=!0,i(!0)}))}))}disconnectedCallback(){window.removeEventListener("message",this.bindedHandler,!1)}componentDidLoad(){window.addEventListener("message",this.bindedHandler,!1)}async componentWillLoad(){var e;this.translationUrl.length>2&&await(e=this.translationUrl,new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{for(let i in e[t])n[t][i]=e[t][i]})),t(!0)}))}))),this.elevateGift?this.isGiftNotFound=!1:await this.loadElevateGift()}render(){return t(r,{key:"6f28f64d3413dd82bc81fc6fd975baa992d06289"},t("general-styling-wrapper",{key:"88dedbfb25562fbe95a69748649ed9c14a2c42f6",clientStylingUrl:this.clientStylingUrl,clientStyling:this.clientStyling}),t("div",{key:"9f2a66f9d48882220ab5d3850f343e995ffe9a6b",class:"ElevateDetails"},this.isGiftNotFound&&t(a,{key:"91f4079bf7af7e4d61b1681a9848c72c9a2249d5"},t("div",{key:"e0427680e0d7e94e51644f12a2430a6a42e3d340",class:"Row ThumbnailRow"},t("div",{key:"4fd78968b2fdf281b7c22596351b366058cfcec3",class:"BackButton",onClick:()=>{this.onBackClicked()}},"<")),t("div",{key:"eeb8cbc40429cf1ebf7a5f0de3d5b8226a40437b",class:"Thumnails GiftNotFound"},l("noDataFound",this.language),".")),this.elevateGift&&t(a,{key:"45380d051b279d9c7fcd580f06252911763073e0"},t("div",{key:"c440d72501fb91601106fbf74a866887bc02ee43",class:"ThumbnailRow"},t("div",{key:"005f436acbc51372d013e1931d54b71738f2e0fc",class:"Row"},t("div",{key:"a9ace30abf1c50d639c31bb047d7b7d7cb6b27b8",class:"BackButton",onClick:()=>{this.onBackClicked()}},"<"),t("bonus-elevate-shop-assets-slider",{key:"8c4121e66a3fae912e72fc10c6a81354a7b36e9f",class:"Thumbnails",itemsPerPage:1,sliderItems:this.elevateGift.presentation.assets,showSliderDots:this.showSliderDots})),t("div",{key:"c6a207dfe14402e4d1890e7b787bf4b5a2247160",class:"Col Details"},t("h3",{key:"c190b88ab4d1e13885593b9d6b9c62b161bdff23",class:"GiftName"},this.elevateGift.presentation.displayName||this.elevateGift.displayName),t("div",{key:"befddb7b8dff3bb73377da4bfb30ce003dcccb7b",class:"GiftPoints"},t("span",{key:"4e879d150709e670b2c7c90f0034c75c4ba30386",class:"Points"},this.elevateGift.points," "),t("span",{key:"a7d28d964b41126a76f9988d0f4fc05653787066",class:" PointsLabel"},l("coins",this.language))))),t("div",{key:"14d2374d40825ac91b275fda81ca22d40f21c0be",class:"ShopItemDetail Details"},t("div",{key:"197bb9c0089173f8c4f180e115068f6204a6f7ea",class:"GiftPresentation"},t("p",{key:"30be8dbec63f8f4d2bc3687d7e992d73c534a20f"},this.elevateGift.presentation.description?this.elevateGift.presentation.description:l("noGiftPresentation",this.language))),t("div",{key:"7e0a9e4d03f338137649c9477a44c7036aea1609",class:`RedeemButton ${"false"===this.elevateGift.available||this.isRedeeming?"Disabled":""}\n ${"dk"==this.deviceType?"DkButton":""}`,onClick:this.redeemGiftConfirm.bind(this)},l("redeem",this.language)),t("span",{key:"89b70f02565437ed28b175c65d0767354b6c9d6b",class:"RedeemError Error"}," ",this.redeemErrorMsg," ")))))}};c.style=":host{display:block}.ElevateDetails{display:flex;flex-direction:row;flex-wrap:wrap;padding:10px;width:calc(100% - 20px);}.ElevateDetails .RedeemError{display:none}.ElevateDetails .Error{color:var(--emfe-w-color-error, #FD2839)}.ElevateDetails .Row{flex-direction:row;display:flex}.ElevateDetails .Col{flex-direction:column;display:flex}.ElevateDetails .Details{padding:20px}.ElevateDetails .ThumbnailRow{display:flex;flex-direction:column;justify-content:space-between;min-width:268px;max-width:398px}.ElevateDetails .ThumbnailRow .BackButton{width:20px;height:20px;padding:5px;background:white;box-shadow:0px 4px 40px 0px rgba(138, 149, 158, 0.2);margin:10px 0 10px;cursor:pointer;animation-timing-function:ease-out;animation-duration:300ms;transition-property:all;border:1px solid #e4e6e8;border-radius:5px;text-align:center}.ElevateDetails .ThumbnailRow .BackButton:hover{background:rgb(227, 222, 222)}.ElevateDetails .ThumbnailRow .Thumbnails{display:flex;flex-direction:column;position:relative;width:calc(100% - 40px)}.ElevateDetails .ShopItemDetail{flex-grow:1;min-width:300px}.ElevateDetails .GiftPoints .Points{font-size:21px}.ElevateDetails .GiftPoints .PointsLabel{font-size:12px;color:var(--emfe-w-color-gray-300, rgb(78, 90, 55));font-weight:400;line-height:29px;letter-spacing:0.04em;text-align:left}.ElevateDetails .RedeemButton:hover{font-weight:800;border:2px solid var(--emfe-w-color-gray-300, rgb(229, 231, 213))}.ElevateDetails .RedeemButton.Disabled:hover{font-weight:normal;border:2px solid transparent}.ElevateDetails .RedeemButton{margin-top:50px;color:#f1f1f1;font-size:20px;padding:16px 25px 16px 25px;border-radius:18px;text-align:center;cursor:pointer;background:linear-gradient(0deg, #26CC37, #26CC37), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);border:2px solid;border-image-source:linear-gradient(283.85deg, rgba(190, 40, 40, 0.5) 0%, rgba(56, 64, 179, 0) 33.47%);box-shadow:0px 4px 4px 0px rgba(0, 0, 0, 0.25)}.ElevateDetails .RedeemButton.DkButton{width:80px;padding:8px;font-size:16px;border-radius:5px}.ElevateDetails .RedeemButton.Disabled{background:linear-gradient(0deg, #b8c4b9, #9eb0a0), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%)}.ElevateDetails .SliderWrapper{display:flex;flex-direction:column;position:relative;width:calc(100% - 40px)}.ElevateDetails .SliderWrapper .MainContent{display:flex;flex-direction:row;justify-content:space-around}.ElevateDetails .SliderWrapper .MainContent .LeftArrow,.ElevateDetails .SliderWrapper .MainContent .RightArrow{width:20px}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper{overflow:hidden;display:inline-flex;width:calc(100% - 40px);flex-direction:column}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper .Items{display:inline-flex;transition:transform 0.4s ease-in-out;transform:translateX(0px);margin:auto}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img2{width:50%}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img3{width:30%}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img,.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img1{max-width:100%;background:rgb(239, 239, 239);border:1px solid rgb(239, 239, 239);border-radius:18px;border:1px;margin:10px 0 10px}.ElevateDetails .SliderWrapper .DotsWrapper{width:100%;margin:0 auto;height:30px}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots{display:flex;justify-content:center;padding:0}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li{height:10px;width:10px;background:#ccc;border-radius:50%;margin-left:3px;margin-right:3px;list-style:none;cursor:pointer}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li:hover{background:#bbb}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li.active{border:solid 1px var(--emfe-w-color-secondary, #FD2839);background:var(--emfe-w-color-secondary, #FD2839)}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li.default{border:solid 1px var(--emfe-w-color-secondary, #FD2839);background-color:#FFF}.ElevateDetails .SliderNavButton{border:0px;width:25px;display:flex;align-items:center;justify-content:center;cursor:pointer}.ElevateDetails .SliderNavButton.HiddenArrow{visibility:hidden}.ElevateDetails .SliderNavButton svg{width:20px;stroke:var(--emfe-w-color-secondary, #FD2839)}.ElevateDetails .DisabledArrow svg{opacity:0.2;stroke:var(--emfe-w-color-secondary, #FD2839);pointer-events:none}";const h=class{constructor(t){e(this,t),this.stylingAppends=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.el.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.el.prepend(t)}),1)})).catch((e=>{console.log("error ",e)}))},this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.targetTranslations=void 0}componentDidRender(){this.stylingAppends||(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}async componentWillLoad(){const e=[];if(this.translationUrl){const s=(t=this.translationUrl,i=this.targetTranslations,new Promise((e=>{fetch(t).then((e=>e.json())).then((t=>{Object.keys(t).forEach((e=>{i[e]=i[e]?i[e]:{};for(let s in t[e])i[e][s]=t[e][s]})),e(!0)}))})));e.push(s)}var t,i;return await Promise.all(e)}render(){return t("div",{key:"4d3414408c7662f88331dbe655966237f74d6958",class:"StyleShell"},t("slot",{key:"1d004644d84602c4314bdf5dfc26b55b160f57df",name:"mainContent"}))}get el(){return i(this)}};h.style=":host{display:block}";export{o as bonus_elevate_shop_assets_slider,c as bonus_elevate_shop_item,h as general_styling_wrapper}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=()=>{};export{o as g}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),o=(e,n)=>t.set(n.t=e,n),l=(e,t)=>t in e,s=(e,t)=>(0,console.error)(e,t),i=new Map,r=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",f="undefined"!=typeof window?window:{},u=f.document||{head:{}},a={o:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,o)=>e.addEventListener(t,n,o),rel:(e,t,n,o)=>e.removeEventListener(t,n,o),ce:(e,t)=>new CustomEvent(e,t)},d=e=>Promise.resolve(e),h=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),p=!1,m=[],v=[],y=(e,t)=>n=>{e.push(n),p||(p=!0,t&&4&a.o?w(b):a.raf(b))},$=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},b=()=>{$(m),$(v),(p=m.length>0)&&a.raf(b)},w=e=>d().then(e),g=y(v,!0),k={},S=e=>"object"==(e=typeof e)||"function"===e;function j(e){var t,n,o;return null!=(o=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((t,n)=>{for(var o in n)e(t,o,{get:n[o],enumerable:!0})})({},{err:()=>E,map:()=>C,ok:()=>O,unwrap:()=>P,unwrapErr:()=>T});var O=e=>({isOk:!0,isErr:!1,value:e}),E=e=>({isOk:!1,isErr:!0,value:e});function C(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>O(e))):O(n)}if(e.isErr)return E(e.value);throw"should never get here"}var M,x,R,P=e=>{if(e.isOk)return e.value;throw e.value},T=e=>{if(e.isErr)return e.value;throw e.value},A=(e,t,...n)=>{let o=null,l=null,s=null,i=!1,r=!1;const c=[],f=t=>{for(let n=0;n<t.length;n++)o=t[n],Array.isArray(o)?f(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof e&&!S(o))&&(o+=""),i&&r?c[c.length-1].i+=o:c.push(i?D(null,o):o),r=i)};if(f(n),t){t.key&&(l=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,c,H);const u=D(e,null);return u.u=t,c.length>0&&(u.h=c),u.p=l,u.m=s,u},D=(e,t)=>({o:0,v:e,i:t,$:null,h:null,u:null,p:null,m:null}),F={},H={forEach:(e,t)=>e.map(L).forEach(t),map:(e,t)=>e.map(L).map(t).map(N)},L=e=>({vattrs:e.u,vchildren:e.h,vkey:e.p,vname:e.m,vtag:e.v,vtext:e.i}),N=e=>{if("function"==typeof e.vtag){const t={...e.vattrs};return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),A(e.vtag,t,...e.vchildren||[])}const t=D(e.vtag,e.vtext);return t.u=e.vattrs,t.h=e.vchildren,t.p=e.vkey,t.m=e.vname,t},U=e=>n(e).$hostElement$,W=(e,t,n)=>{const o=U(e);return{emit:e=>q(o,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},q=(e,t,n)=>{const o=a.ce(t,n);return e.dispatchEvent(o),o},G=new WeakMap,I=e=>"sc-"+e.k,V=(e,t,n,o,s,i)=>{if(n!==o){let r=l(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,l=z(n),s=z(o);t.remove(...l.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!l.includes(e))))}else if("style"===t){for(const t in n)o&&null!=o[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in o)n&&o[t]===n[t]||(t.includes("-")?e.style.setProperty(t,o[t]):e.style[t]=o[t])}else if("key"===t);else if("ref"===t)o&&o(e);else if(r||"o"!==t[0]||"n"!==t[1]){const l=S(o);if((r||l&&null!==o)&&!s)try{if(e.tagName.includes("-"))e[t]=o;else{const l=null==o?"":o;"list"===t?r=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==o||!1===o?!1===o&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&i||s)&&!l&&e.setAttribute(t,o=!0===o?"":o)}else if(t="-"===t[2]?t.slice(3):l(f,c)?c.slice(2):c[2]+t.slice(3),n||o){const l=t.endsWith(B);t=t.replace(J,""),n&&a.rel(e,t,n,l),o&&a.ael(e,t,o,l)}}},_=/\s/,z=e=>e?e.split(_):[],B="Capture",J=RegExp(B+"$"),K=(e,t,n)=>{const o=11===t.$.nodeType&&t.$.host?t.$.host:t.$,l=e&&e.u||k,s=t.u||k;for(const e of Q(Object.keys(l)))e in s||V(o,e,l[e],void 0,n,t.o);for(const e of Q(Object.keys(s)))V(o,e,l[e],s[e],n,t.o)};function Q(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var X=!1,Y=!1,Z=!1,ee=!1,te=(e,t,n,o)=>{var l;const s=t.h[n];let i,r,c,f=0;if(X||(Z=!0,"slot"===s.v&&(M&&o.classList.add(M+"-s"),s.o|=s.h?2:1)),null!==s.i)i=s.$=u.createTextNode(s.i);else if(1&s.o)i=s.$=u.createTextNode("");else{if(ee||(ee="svg"===s.v),i=s.$=u.createElementNS(ee?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",!X&&2&s.o?"slot-fb":s.v),ee&&"foreignObject"===s.v&&(ee=!1),K(null,s,ee),i.getRootNode().querySelector("body"),s.h)for(f=0;f<s.h.length;++f)r=te(e,s,f,i),r&&i.appendChild(r);"svg"===s.v?ee=!1:"foreignObject"===i.tagName&&(ee=!0)}return i["s-hn"]=R,3&s.o&&(i["s-sr"]=!0,i["s-cr"]=x,i["s-sn"]=s.m||"",i["s-rf"]=null==(l=s.u)?void 0:l.ref,c=e&&e.h&&e.h[n],c&&c.v===s.v&&e.$&&ne(e.$,!1)),i},ne=(e,t)=>{a.o|=1;const n=Array.from(e.childNodes);for(let e=n.length-1;e>=0;e--){const o=n[e];o["s-hn"]!==R&&o["s-ol"]&&(pe(re(o),o,ie(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,Z=!0),t&&ne(o,t)}a.o&=-2},oe=(e,t,n,o,l,s)=>{let i,r=e["s-cr"]&&e["s-cr"].parentNode||e;for(r.shadowRoot&&r.tagName===R&&(r=r.shadowRoot);l<=s;++l)o[l]&&(i=te(null,n,l,e),i&&(o[l].$=i,pe(r,i,ie(t))))},le=(e,t,n)=>{for(let o=t;o<=n;++o){const t=e[o];if(t){const e=t.$;he(t),e&&(Y=!0,e["s-ol"]?e["s-ol"].remove():ne(e,!0),e.remove())}}},se=(e,t,n=!1)=>!(e.v!==t.v||("slot"===e.v?"S"in e&&n&&8!==e.$.nodeType||e.m!==t.m:!n&&e.p!==t.p)),ie=e=>e&&e["s-ol"]||e,re=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,ce=(e,t,n=!1)=>{const o=t.$=e.$,l=e.h,s=t.h,i=t.v,r=t.i;let c;null===r?(ee="svg"===i||"foreignObject"!==i&&ee,("slot"!==i||X)&&K(e,t,ee),null!==l&&null!==s?((e,t,n,o,l=!1)=>{let s,i,r=0,c=0,f=0,u=0,a=t.length-1,d=t[0],h=t[a],p=o.length-1,m=o[0],v=o[p];for(;r<=a&&c<=p;)if(null==d)d=t[++r];else if(null==h)h=t[--a];else if(null==m)m=o[++c];else if(null==v)v=o[--p];else if(se(d,m,l))ce(d,m,l),d=t[++r],m=o[++c];else if(se(h,v,l))ce(h,v,l),h=t[--a],v=o[--p];else if(se(d,v,l))"slot"!==d.v&&"slot"!==v.v||ne(d.$.parentNode,!1),ce(d,v,l),pe(e,d.$,h.$.nextSibling),d=t[++r],v=o[--p];else if(se(h,m,l))"slot"!==d.v&&"slot"!==v.v||ne(h.$.parentNode,!1),ce(h,m,l),pe(e,h.$,d.$),h=t[--a],m=o[++c];else{for(f=-1,u=r;u<=a;++u)if(t[u]&&null!==t[u].p&&t[u].p===m.p){f=u;break}f>=0?(i=t[f],i.v!==m.v?s=te(t&&t[c],n,f,e):(ce(i,m,l),t[f]=void 0,s=i.$),m=o[++c]):(s=te(t&&t[c],n,c,e),m=o[++c]),s&&pe(re(d.$),s,ie(d.$))}r>a?oe(e,null==o[p+1]?null:o[p+1].$,n,o,c,p):c>p&&le(t,r,a)})(o,l,t,s,n):null!==s?(null!==e.i&&(o.textContent=""),oe(o,null,t,s,0,s.length-1)):!n&&null!==l&&le(l,0,l.length-1),ee&&"svg"===i&&(ee=!1)):(c=o["s-cr"])?c.parentNode.textContent=r:e.i!==r&&(o.data=r)},fe=e=>{const t=e.childNodes;for(const e of t)if(1===e.nodeType){if(e["s-sr"]){const n=e["s-sn"];e.hidden=!1;for(const o of t)if(o!==e)if(o["s-hn"]!==e["s-hn"]||""!==n){if(1===o.nodeType&&(n===o.getAttribute("slot")||n===o["s-sn"])||3===o.nodeType&&n===o["s-sn"]){e.hidden=!0;break}}else if(1===o.nodeType||3===o.nodeType&&""!==o.textContent.trim()){e.hidden=!0;break}}fe(e)}},ue=[],ae=e=>{let t,n,o;for(const l of e.childNodes){if(l["s-sr"]&&(t=l["s-cr"])&&t.parentNode){n=t.parentNode.childNodes;const e=l["s-sn"];for(o=n.length-1;o>=0;o--)if(t=n[o],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==l["s-hn"])if(de(t,e)){let n=ue.find((e=>e.j===t));Y=!0,t["s-sn"]=t["s-sn"]||e,n?(n.j["s-sh"]=l["s-hn"],n.O=l):(t["s-sh"]=l["s-hn"],ue.push({O:l,j:t})),t["s-sr"]&&ue.map((e=>{de(e.j,t["s-sn"])&&(n=ue.find((e=>e.j===t)),n&&!e.O&&(e.O=n.O))}))}else ue.some((e=>e.j===t))||ue.push({j:t})}1===l.nodeType&&ae(l)}},de=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,he=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(he)},pe=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),me=(e,t)=>{t&&!e.C&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.C=t)))},ve=(e,t)=>{if(e.o|=16,!(4&e.o))return me(e,e.M),g((()=>ye(e,t)));e.o|=512},ye=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return t&&(o=je(n,"componentWillLoad")),$e(o,(()=>we(e,n,t)))},$e=(e,t)=>be(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),be=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,we=async(e,t,n)=>{var o;const l=e.$hostElement$,s=l["s-rc"];n&&(e=>{const t=e.R,n=e.$hostElement$,o=t.o,l=((e,t)=>{var n;const o=I(t),l=r.get(o);if(e=11===e.nodeType?e:u,l)if("string"==typeof l){let s,i=G.get(e=e.head||e);if(i||G.set(e,i=new Set),!i.has(o)){{s=u.createElement("style"),s.innerHTML=l;const o=null!=(n=a.P)?n:j(u);null!=o&&s.setAttribute("nonce",o),(!(1&t.o)||1&t.o&&"HEAD"!==e.nodeName)&&e.insertBefore(s,e.querySelector("link"))}4&t.o&&(s.innerHTML+=c),i&&i.add(o)}}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return o})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&o&&2&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(e);ge(e,t,l,n),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=null!=(o=l["s-p"])?o:[],n=()=>ke(e);0===t.length?n():(Promise.all(t).then(n),e.o|=4,t.length=0)}},ge=(e,t,n,o)=>{try{t=t.render(),e.o&=-17,e.o|=2,((e,t,n=!1)=>{var o,l,s,i;const r=e.$hostElement$,c=e.R,f=e.T||D(null,null),d=(e=>e&&e.v===F)(t)?t:A(null,null,t);if(R=r.tagName,c.A&&(d.u=d.u||{},c.A.map((([e,t])=>d.u[t]=r[e]))),n&&d.u)for(const e of Object.keys(d.u))r.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(d.u[e]=r[e]);if(d.v=null,d.o|=4,e.T=d,d.$=f.$=r.shadowRoot||r,M=r["s-sc"],X=!!(1&c.o),x=r["s-cr"],Y=!1,ce(f,d,n),a.o|=1,Z){ae(d.$);for(const e of ue){const t=e.j;if(!t["s-ol"]){const e=u.createTextNode("");e["s-nr"]=t,pe(t.parentNode,t["s-ol"]=e,t)}}for(const e of ue){const t=e.j,r=e.O;if(r){const e=r.parentNode;let n=r.nextSibling;{let s=null==(o=t["s-ol"])?void 0:o.previousSibling;for(;s;){let o=null!=(l=s["s-nr"])?l:null;if(o&&o["s-sn"]===t["s-sn"]&&e===o.parentNode){for(o=o.nextSibling;o===t||(null==o?void 0:o["s-sr"]);)o=null==o?void 0:o.nextSibling;if(!o||!o["s-nr"]){n=o;break}}s=s.previousSibling}}(!n&&e!==t.parentNode||t.nextSibling!==n)&&t!==n&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),pe(e,t,n),1===t.nodeType&&(t.hidden=null!=(s=t["s-ih"])&&s)),t&&"function"==typeof r["s-rf"]&&r["s-rf"](t)}else 1===t.nodeType&&(n&&(t["s-ih"]=null!=(i=t.hidden)&&i),t.hidden=!0)}}Y&&fe(d.$),a.o&=-2,ue.length=0,x=void 0})(e,t,o)}catch(t){s(t,e.$hostElement$)}return null},ke=e=>{const t=e.$hostElement$,n=e.t,o=e.M;je(n,"componentDidRender"),64&e.o?je(n,"componentDidUpdate"):(e.o|=64,Oe(t),je(n,"componentDidLoad"),e.D(t),o||Se()),e.C&&(e.C(),e.C=void 0),512&e.o&&w((()=>ve(e,!1))),e.o&=-517},Se=()=>{Oe(u.documentElement),w((()=>q(f,"appload",{detail:{namespace:"bonus-elevate-shop-item"}})))},je=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},Oe=e=>e.classList.add("hydrated"),Ee=(e,t,o)=>{var l,s;const i=e.prototype;if(t.F){const r=Object.entries(null!=(l=t.F)?l:{});if(r.map((([e,[l]])=>{(31&l||2&o&&32&l)&&Object.defineProperty(i,e,{get(){return((e,t)=>n(this).H.get(t))(0,e)},set(o){((e,t,o,l)=>{const s=n(e);if(!s)throw Error(`Couldn't find host element for "${l.k}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=s.H.get(t),r=s.o,c=s.t;o=((e,t)=>null==e||S(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(o,l.F[t][0]),8&r&&void 0!==i||o===i||Number.isNaN(i)&&Number.isNaN(o)||(s.H.set(t,o),c&&2==(18&r)&&ve(s,!1))})(this,e,o,t)},configurable:!0,enumerable:!0})})),1&o){const o=new Map;i.attributeChangedCallback=function(e,l,s){a.jmp((()=>{var r;const c=o.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const o=n(this),i=null==o?void 0:o.o;if(i&&!(8&i)&&128&i&&s!==l){const n=o.t,i=null==(r=t.L)?void 0:r[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,s,l,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=t.L)?s:{}),...r.filter((([e,t])=>15&t[0])).map((([e,n])=>{var l;const s=n[1]||e;return o.set(s,e),512&n[0]&&(null==(l=t.A)||l.push([e,s])),s}))]))}}return e},Ce=e=>{je(e,"connectedCallback")},Me=e=>{je(e,"disconnectedCallback")},xe=(e,o={})=>{var l;const d=[],p=o.exclude||[],m=f.customElements,v=u.head,y=v.querySelector("meta[charset]"),$=u.createElement("style"),b=[];let w,g=!0;Object.assign(a,o),a.l=new URL(o.resourcesUrl||"./",u.baseURI).href;let k=!1;if(e.map((e=>{e[1].map((o=>{const l={o:o[0],k:o[1],F:o[2],N:o[3]};4&l.o&&(k=!0),l.F=o[2],l.A=[];const c=l.k,f=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const o={o:0,$hostElement$:e,R:n,H:new Map};o.U=new Promise((e=>o.D=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,o)})(e=this,l),1&l.o)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${l.k}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),w&&(clearTimeout(w),w=null),g?b.push(this):a.jmp((()=>(e=>{if(!(1&a.o)){const t=n(e),o=t.R,l=()=>{};if(1&t.o)(null==t?void 0:t.t)?Ce(t.t):(null==t?void 0:t.U)&&t.U.then((()=>Ce(t.t)));else{t.o|=1,12&o.o&&(e=>{const t=e["s-cr"]=u.createComment("");t["s-cn"]=!0,pe(e,t,e.firstChild)})(e);{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){me(t,t.M=n);break}}o.F&&Object.entries(o.F).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let o;if(!(32&t.o)){if(t.o|=32,n.W){const e=(e=>{const t=e.k.replace(/-/g,"_"),n=e.W;if(!n)return;const o=i.get(n);return o?o[t]:import(`./${n}.entry.js`).then((e=>(i.set(n,e),e[t])),s)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};o=await e,t()}else o=e;if(!o)throw Error(`Constructor for "${n.k}#${t.q}" was not found`);o.isProxied||(Ee(o,n,2),o.isProxied=!0);const l=()=>{};t.o|=8;try{new o(t)}catch(e){s(e)}t.o&=-9,l(),Ce(t.t)}else o=e.constructor,customElements.whenDefined(e.localName).then((()=>t.o|=128));if(o&&o.style){let e;"string"==typeof o.style&&(e=o.style);const t=I(n);if(!r.has(t)){const o=()=>{};((e,t,n)=>{let o=r.get(e);h&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=t:o.replaceSync(t)):o=t,r.set(e,o)})(t,e,!!(1&n.o)),o()}}}const l=t.M,c=()=>ve(t,!0);l&&l["s-rc"]?l["s-rc"].push(c):c()})(e,t,o)}l()}})(this)))}disconnectedCallback(){a.jmp((()=>(async()=>{if(!(1&a.o)){const e=n(this);(null==e?void 0:e.t)?Me(e.t):(null==e?void 0:e.U)&&e.U.then((()=>Me(e.t)))}})()))}componentOnReady(){return n(this).U}};l.W=e[0],p.includes(c)||m.get(c)||(d.push(c),m.define(c,Ee(f,l,1)))}))})),d.length>0&&(k&&($.textContent+=c),$.textContent+=d.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",$.innerHTML.length)){$.setAttribute("data-styles","");const e=null!=(l=a.P)?l:j(u);null!=e&&$.setAttribute("nonce",e),v.insertBefore($,y?y.nextSibling:v.firstChild)}g=!1,b.length?b.map((e=>e.connectedCallback())):a.jmp((()=>w=setTimeout(Se,30)))},Re=(e,t)=>t,Pe=e=>a.P=e;export{Re as F,F as H,xe as b,W as c,U as g,A as h,d as p,o as r,Pe as s}
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-1035f878.js');
|
|
6
|
+
|
|
7
|
+
const BonusElevateShopAssetsSlider = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.xDown = null;
|
|
11
|
+
this.yDown = null;
|
|
12
|
+
this.orientationChangeHandler = () => {
|
|
13
|
+
setTimeout(() => {
|
|
14
|
+
this.recalculateItemsPerPage();
|
|
15
|
+
}, 10);
|
|
16
|
+
};
|
|
17
|
+
this.resizeHandler = () => {
|
|
18
|
+
this.recalculateItemsPerPage();
|
|
19
|
+
};
|
|
20
|
+
this.showSliderDots = false;
|
|
21
|
+
this.showSliderArrows = true;
|
|
22
|
+
this.itemsPerPage = 1;
|
|
23
|
+
this.sliderItems = [];
|
|
24
|
+
this.activeIndex = 0;
|
|
25
|
+
}
|
|
26
|
+
setActive(index) {
|
|
27
|
+
var _a;
|
|
28
|
+
const maxLength = (_a = this.sliderItems) === null || _a === void 0 ? void 0 : _a.length;
|
|
29
|
+
if (index >= 0) {
|
|
30
|
+
if (index >= maxLength - 1) {
|
|
31
|
+
this.activeIndex = maxLength - 1;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.activeIndex = index;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.activeIndex = 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
move(direction) {
|
|
42
|
+
this.setActive(this.activeIndex + direction);
|
|
43
|
+
}
|
|
44
|
+
goTo(index) {
|
|
45
|
+
let diff = this.activeIndex - index;
|
|
46
|
+
if (diff > 0) {
|
|
47
|
+
for (let i = 0; i < diff; i++) {
|
|
48
|
+
this.move(-1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
for (let i = 0; i > diff; i--) {
|
|
53
|
+
this.move(1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
handleTouchStart(evt) {
|
|
58
|
+
const firstTouch = this.getTouches(evt)[0];
|
|
59
|
+
this.xDown = firstTouch.clientX;
|
|
60
|
+
this.yDown = firstTouch.clientY;
|
|
61
|
+
}
|
|
62
|
+
getTouches(evt) {
|
|
63
|
+
return evt.touches || evt.originalEvent.touches;
|
|
64
|
+
}
|
|
65
|
+
handleTouchMove(evt) {
|
|
66
|
+
if (!this.xDown || !this.yDown)
|
|
67
|
+
return;
|
|
68
|
+
let xUp = evt.touches[0].clientX;
|
|
69
|
+
let yUp = evt.touches[0].clientY;
|
|
70
|
+
let xDiff = this.xDown - xUp;
|
|
71
|
+
let yDiff = this.yDown - yUp;
|
|
72
|
+
if (Math.abs(xDiff) > Math.abs(yDiff)) {
|
|
73
|
+
if (xDiff > 0) {
|
|
74
|
+
this.move(1);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
this.move(-1);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
this.xDown = null;
|
|
81
|
+
this.yDown = null;
|
|
82
|
+
}
|
|
83
|
+
;
|
|
84
|
+
recalculateItemsPerPage() {
|
|
85
|
+
if (!this.sliderItemsElement)
|
|
86
|
+
return;
|
|
87
|
+
this.itemElementWidth = this.sliderItemsElement.clientWidth;
|
|
88
|
+
this.sliderItemsElementWidth = (this.sliderItems.length - 1) * this.itemElementWidth;
|
|
89
|
+
}
|
|
90
|
+
;
|
|
91
|
+
renderDots() {
|
|
92
|
+
var _a;
|
|
93
|
+
const dots = [];
|
|
94
|
+
for (let index$1 = 0; index$1 < ((_a = this.sliderItems) === null || _a === void 0 ? void 0 : _a.length) / this.itemsPerPage; index$1++) {
|
|
95
|
+
dots.push(index.h("li", { class: index$1 == this.activeIndex ? 'active' : 'default', onClick: () => { this.goTo(index$1); this.setActive(index$1); } }));
|
|
96
|
+
}
|
|
97
|
+
return dots;
|
|
98
|
+
}
|
|
99
|
+
componentDidRender() {
|
|
100
|
+
this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
|
|
101
|
+
this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
|
|
102
|
+
this.recalculateItemsPerPage();
|
|
103
|
+
}
|
|
104
|
+
componentDidUpdate() {
|
|
105
|
+
this.recalculateItemsPerPage();
|
|
106
|
+
}
|
|
107
|
+
connectedCallback() {
|
|
108
|
+
window.screen.orientation.addEventListener('change', this.orientationChangeHandler);
|
|
109
|
+
}
|
|
110
|
+
disconnectedCallback() {
|
|
111
|
+
this.el.removeEventListener('touchstart', this.handleTouchStart);
|
|
112
|
+
this.el.removeEventListener('touchmove', this.handleTouchMove);
|
|
113
|
+
window.screen.orientation.removeEventListener('change', this.orientationChangeHandler);
|
|
114
|
+
window.removeEventListener('resize', this.resizeHandler);
|
|
115
|
+
}
|
|
116
|
+
render() {
|
|
117
|
+
var _a;
|
|
118
|
+
const styles = {
|
|
119
|
+
transform: `translate(${(this.sliderItemsElementWidth / (((_a = this.sliderItems) === null || _a === void 0 ? void 0 : _a.length) - 1) * this.activeIndex) * -1}px, 0px)`
|
|
120
|
+
};
|
|
121
|
+
const itemStyle = {
|
|
122
|
+
width: `${this.itemElementWidth / this.itemsPerPage}px`
|
|
123
|
+
};
|
|
124
|
+
return index.h("div", { key: '210d648ae90dd04e350c0cddb2047061f5989bd8', class: "SliderWrapper" }, index.h("div", { key: '240a214bc772890145b8317bfda32f6099150726', class: 'MainContent ' }, this.showSliderArrows &&
|
|
125
|
+
index.h("div", { key: 'e8e144fbc2906ee0c5e77cc00c33fb1e89ced29f', class: `SliderNavButton LeftArrow ${this.activeIndex === 0 ? 'DisabledArrow ' : ''} ${this.sliderItems.length === 1 ? 'HiddenArrow ' : ''}`, onClick: () => this.move(-1) }, index.h("svg", { key: '068a669fa96d11532199f2f2eb44e3a4c3f31e10', fill: "none", stroke: "var(--emfe-w-color-secondary, #FD2839)", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '2789bb8d91ce4ec7f0fd7c3c6b9f3c7b7e682088', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))), index.h("div", { key: '034ef81e4d9a8dea56fd42791e8a08940dfa4af6', class: 'ItemsWrapper', ref: (el) => this.sliderItemsElement = el }, index.h("div", { key: 'f412b5f0978348e4d9e0af682d151a1880f6e86d', class: 'Items AssetsItems', style: styles }, this.sliderItems.map((assetUrl) => index.h("img", { class: `img${this.itemsPerPage}`, alt: 'Gift Thumbnails', style: itemStyle, src: assetUrl })))), this.showSliderArrows &&
|
|
126
|
+
index.h("div", { key: '0f8549f8a5bcf2f1cfcde601930610fe5cc98427', class: `SliderNavButton RightArrow ${this.sliderItems.length === 1 ? 'HiddenArrow ' : ''}
|
|
127
|
+
${(this.activeIndex === (this.sliderItems.length - 1) || this.itemsPerPage == this.sliderItems.length) ? 'DisabledArrow' : ''}`, onClick: () => this.move(1) }, index.h("svg", { key: '5758a9a73af5f7fa4618ae1b4bb30d838b509d9f', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '720c5f0f496e8817fc9017ec4e8706cb9644e9ef', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" })))), this.showSliderDots && this.sliderItems.length > 1 &&
|
|
128
|
+
index.h("div", { key: '9c1b9c57b1871d7463569ea9566b28e925870d59', class: "DotsWrapper" }, index.h("ul", { key: '548d1d0f2c46170e07aa7ed4019dc3469e2e3950', class: "Dots" }, this.renderDots())));
|
|
129
|
+
}
|
|
130
|
+
get el() { return index.getElement(this); }
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
134
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hu'];
|
|
135
|
+
const TRANSLATIONS = {
|
|
136
|
+
en: {
|
|
137
|
+
points: 'Points',
|
|
138
|
+
noGiftPresentation: 'No description',
|
|
139
|
+
redeem: 'Redeem',
|
|
140
|
+
noDataFound: 'No data found',
|
|
141
|
+
error4003: 'Invalid Session',
|
|
142
|
+
redeemFailed: 'Failed to redeem'
|
|
143
|
+
},
|
|
144
|
+
ro: {
|
|
145
|
+
points: 'Points',
|
|
146
|
+
noGiftPresentation: 'No description',
|
|
147
|
+
redeem: 'Redeem',
|
|
148
|
+
noDataFound: 'No data found',
|
|
149
|
+
error4003: 'Invalid Session',
|
|
150
|
+
redeemFailed: 'Failed to redeem'
|
|
151
|
+
},
|
|
152
|
+
fr: {
|
|
153
|
+
points: 'Points',
|
|
154
|
+
noGiftPresentation: 'No description',
|
|
155
|
+
redeem: 'Redeem',
|
|
156
|
+
noDataFound: 'No data found',
|
|
157
|
+
error4003: 'Invalid Session',
|
|
158
|
+
redeemFailed: 'Failed to redeem',
|
|
159
|
+
},
|
|
160
|
+
ar: {
|
|
161
|
+
points: 'Points',
|
|
162
|
+
noGiftPresentation: 'No description',
|
|
163
|
+
redeem: 'Redeem',
|
|
164
|
+
noDataFound: 'No data found',
|
|
165
|
+
error4003: 'Invalid Session',
|
|
166
|
+
redeemFailed: 'Failed to redeem',
|
|
167
|
+
},
|
|
168
|
+
hu: {
|
|
169
|
+
points: 'Points',
|
|
170
|
+
noGiftPresentation: 'No description',
|
|
171
|
+
redeem: 'Redeem',
|
|
172
|
+
noDataFound: 'No data found',
|
|
173
|
+
error4003: 'Invalid Session',
|
|
174
|
+
redeemFailed: 'Failed to redeem',
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const translate = (key, customLang) => {
|
|
178
|
+
const lang = customLang;
|
|
179
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
180
|
+
};
|
|
181
|
+
const getTranslations = (url) => {
|
|
182
|
+
// fetch url, get the data, replace the TRANSLATIONS content
|
|
183
|
+
return new Promise((resolve) => {
|
|
184
|
+
fetch(url)
|
|
185
|
+
.then((res) => res.json())
|
|
186
|
+
.then((data) => {
|
|
187
|
+
Object.keys(data).forEach((item) => {
|
|
188
|
+
for (let key in data[item]) {
|
|
189
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
resolve(true);
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @name isMobile
|
|
199
|
+
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
200
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
201
|
+
* @returns {Boolean} true or false
|
|
202
|
+
*/
|
|
203
|
+
const getDevice = () => {
|
|
204
|
+
let userAgent = window.navigator.userAgent;
|
|
205
|
+
if (userAgent.toLowerCase().match(/android/i)) {
|
|
206
|
+
return 'Android';
|
|
207
|
+
}
|
|
208
|
+
if (userAgent.toLowerCase().match(/iphone/i)) {
|
|
209
|
+
return 'iPhone';
|
|
210
|
+
}
|
|
211
|
+
if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
|
|
212
|
+
return 'iPad';
|
|
213
|
+
}
|
|
214
|
+
return 'PC';
|
|
215
|
+
};
|
|
216
|
+
const getDevicePlatform = () => {
|
|
217
|
+
const device = getDevice();
|
|
218
|
+
if (device) {
|
|
219
|
+
if (device === 'PC') {
|
|
220
|
+
return 'dk';
|
|
221
|
+
}
|
|
222
|
+
else if (device === 'iPad' || device === 'iPhone') {
|
|
223
|
+
return 'ios';
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
return 'mtWeb';
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
const bonusElevateShopItemCss = ":host{display:block}.ElevateDetails{display:flex;flex-direction:row;flex-wrap:wrap;padding:10px;width:calc(100% - 20px);}.ElevateDetails .RedeemError{display:none}.ElevateDetails .Error{color:var(--emfe-w-color-error, #FD2839)}.ElevateDetails .Row{flex-direction:row;display:flex}.ElevateDetails .Col{flex-direction:column;display:flex}.ElevateDetails .Details{padding:20px}.ElevateDetails .ThumbnailRow{display:flex;flex-direction:column;justify-content:space-between;min-width:268px;max-width:398px}.ElevateDetails .ThumbnailRow .BackButton{width:20px;height:20px;padding:5px;background:white;box-shadow:0px 4px 40px 0px rgba(138, 149, 158, 0.2);margin:10px 0 10px;cursor:pointer;animation-timing-function:ease-out;animation-duration:300ms;transition-property:all;border:1px solid #e4e6e8;border-radius:5px;text-align:center}.ElevateDetails .ThumbnailRow .BackButton:hover{background:rgb(227, 222, 222)}.ElevateDetails .ThumbnailRow .Thumbnails{display:flex;flex-direction:column;position:relative;width:calc(100% - 40px)}.ElevateDetails .ShopItemDetail{flex-grow:1;min-width:300px}.ElevateDetails .GiftPoints .Points{font-size:21px}.ElevateDetails .GiftPoints .PointsLabel{font-size:12px;color:var(--emfe-w-color-gray-300, rgb(78, 90, 55));font-weight:400;line-height:29px;letter-spacing:0.04em;text-align:left}.ElevateDetails .RedeemButton:hover{font-weight:800;border:2px solid var(--emfe-w-color-gray-300, rgb(229, 231, 213))}.ElevateDetails .RedeemButton.Disabled:hover{font-weight:normal;border:2px solid transparent}.ElevateDetails .RedeemButton{margin-top:50px;color:#f1f1f1;font-size:20px;padding:16px 25px 16px 25px;border-radius:18px;text-align:center;cursor:pointer;background:linear-gradient(0deg, #26CC37, #26CC37), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);border:2px solid;border-image-source:linear-gradient(283.85deg, rgba(190, 40, 40, 0.5) 0%, rgba(56, 64, 179, 0) 33.47%);box-shadow:0px 4px 4px 0px rgba(0, 0, 0, 0.25)}.ElevateDetails .RedeemButton.DkButton{width:80px;padding:8px;font-size:16px;border-radius:5px}.ElevateDetails .RedeemButton.Disabled{background:linear-gradient(0deg, #b8c4b9, #9eb0a0), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%)}.ElevateDetails .SliderWrapper{display:flex;flex-direction:column;position:relative;width:calc(100% - 40px)}.ElevateDetails .SliderWrapper .MainContent{display:flex;flex-direction:row;justify-content:space-around}.ElevateDetails .SliderWrapper .MainContent .LeftArrow,.ElevateDetails .SliderWrapper .MainContent .RightArrow{width:20px}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper{overflow:hidden;display:inline-flex;width:calc(100% - 40px);flex-direction:column}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper .Items{display:inline-flex;transition:transform 0.4s ease-in-out;transform:translateX(0px);margin:auto}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img2{width:50%}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img3{width:30%}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img,.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img1{max-width:100%;background:rgb(239, 239, 239);border:1px solid rgb(239, 239, 239);border-radius:18px;border:1px;margin:10px 0 10px}.ElevateDetails .SliderWrapper .DotsWrapper{width:100%;margin:0 auto;height:30px}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots{display:flex;justify-content:center;padding:0}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li{height:10px;width:10px;background:#ccc;border-radius:50%;margin-left:3px;margin-right:3px;list-style:none;cursor:pointer}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li:hover{background:#bbb}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li.active{border:solid 1px var(--emfe-w-color-secondary, #FD2839);background:var(--emfe-w-color-secondary, #FD2839)}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li.default{border:solid 1px var(--emfe-w-color-secondary, #FD2839);background-color:#FFF}.ElevateDetails .SliderNavButton{border:0px;width:25px;display:flex;align-items:center;justify-content:center;cursor:pointer}.ElevateDetails .SliderNavButton.HiddenArrow{visibility:hidden}.ElevateDetails .SliderNavButton svg{width:20px;stroke:var(--emfe-w-color-secondary, #FD2839)}.ElevateDetails .DisabledArrow svg{opacity:0.2;stroke:var(--emfe-w-color-secondary, #FD2839);pointer-events:none}";
|
|
232
|
+
const BonusElevateShopItemStyle0 = bonusElevateShopItemCss;
|
|
233
|
+
|
|
234
|
+
const BonusElevateShopItem = class {
|
|
235
|
+
constructor(hostRef) {
|
|
236
|
+
index.registerInstance(this, hostRef);
|
|
237
|
+
this.redeemGiftButton = index.createEvent(this, "redeemGiftButton", 7);
|
|
238
|
+
this.bindedHandler = this.handleMessage.bind(this);
|
|
239
|
+
this.deviceType = getDevicePlatform();
|
|
240
|
+
this.endpoint = undefined;
|
|
241
|
+
this.language = 'en';
|
|
242
|
+
this.itemId = undefined;
|
|
243
|
+
this.elevateGift = undefined;
|
|
244
|
+
this.session = undefined;
|
|
245
|
+
this.clientStyling = '';
|
|
246
|
+
this.clientStylingUrl = '';
|
|
247
|
+
this.translationUrl = '';
|
|
248
|
+
this.showSliderDots = false;
|
|
249
|
+
this.showSliderArrows = true;
|
|
250
|
+
this.isGiftNotFound = false;
|
|
251
|
+
this.redeemErrorMsg = '';
|
|
252
|
+
this.isRedeeming = false;
|
|
253
|
+
}
|
|
254
|
+
redeemGiftConfirm() {
|
|
255
|
+
window.postMessage({ type: 'BEERedeemConfirm', shopItem: this.elevateGift }, window.location.href);
|
|
256
|
+
}
|
|
257
|
+
handleMessage(message) {
|
|
258
|
+
if (message.data && message.data.type === "bee-redeem-confirmed" &&
|
|
259
|
+
message.data.id == this.elevateGift.id) {
|
|
260
|
+
this.redeemGift();
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
onBackClicked() {
|
|
264
|
+
window.postMessage({ type: 'OnGiftDetailsBackButtonClicked' }, window.location.href);
|
|
265
|
+
}
|
|
266
|
+
redeemGift() {
|
|
267
|
+
if (this.elevateGift.available.toLowerCase() === 'false') {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
let url = new URL(`${this.endpoint}/v1/elevate/redeem`);
|
|
271
|
+
let claimGiftOptions = {
|
|
272
|
+
method: 'PUT',
|
|
273
|
+
headers: {
|
|
274
|
+
'x-SessionId': this.session,
|
|
275
|
+
'Content-Type': 'application/json-patch+json',
|
|
276
|
+
},
|
|
277
|
+
body: JSON.stringify({ giftId: this.elevateGift.id }),
|
|
278
|
+
};
|
|
279
|
+
this.redeemErrorMsg = '';
|
|
280
|
+
this.isRedeeming = true;
|
|
281
|
+
fetch(url.toString(), claimGiftOptions)
|
|
282
|
+
.then((res) => res.json())
|
|
283
|
+
.then((res) => {
|
|
284
|
+
if (res.success) {
|
|
285
|
+
this.redeemGiftButton.emit();
|
|
286
|
+
window.postMessage({ type: 'BEEGiftRedeem', itemId: this.elevateGift.id }, window.location.href);
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
let translatedError = translate(`error${res.errorCode}`, this.language);
|
|
290
|
+
this.redeemErrorMsg = translatedError ? translatedError : translate('redeemFailed', this.language);
|
|
291
|
+
window.postMessage({ type: 'BEEGiftRedeemFailed', itemId: this.elevateGift.id, res }, window.location.href);
|
|
292
|
+
}
|
|
293
|
+
})
|
|
294
|
+
.catch((err) => {
|
|
295
|
+
window.postMessage({ type: 'BEEGiftClaimFailed', itemId: this.elevateGift.id, err }, window.location.href);
|
|
296
|
+
}).finally(() => {
|
|
297
|
+
this.isRedeeming = false;
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
async loadElevateGift() {
|
|
301
|
+
let url = new URL(`${this.endpoint}/v1/elevate/shop?language=${this.language}&filter=id=${this.itemId}`);
|
|
302
|
+
let options = {
|
|
303
|
+
headers: {
|
|
304
|
+
'Content-Type': 'application/json',
|
|
305
|
+
'x-SessionId': this.session,
|
|
306
|
+
},
|
|
307
|
+
method: 'GET',
|
|
308
|
+
};
|
|
309
|
+
await new Promise((resolve) => {
|
|
310
|
+
fetch(url.href, options)
|
|
311
|
+
.then((res) => res.json())
|
|
312
|
+
.then((data) => {
|
|
313
|
+
let filteredGifts = data.data;
|
|
314
|
+
if (filteredGifts && filteredGifts.length == 1) {
|
|
315
|
+
this.elevateGift = filteredGifts[0];
|
|
316
|
+
this.isGiftNotFound = false;
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
this.isGiftNotFound = true;
|
|
320
|
+
}
|
|
321
|
+
resolve(true);
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
disconnectedCallback() {
|
|
326
|
+
window.removeEventListener('message', this.bindedHandler, false);
|
|
327
|
+
}
|
|
328
|
+
componentDidLoad() {
|
|
329
|
+
window.addEventListener('message', this.bindedHandler, false);
|
|
330
|
+
}
|
|
331
|
+
async componentWillLoad() {
|
|
332
|
+
if (this.translationUrl.length > 2) {
|
|
333
|
+
await getTranslations(this.translationUrl);
|
|
334
|
+
}
|
|
335
|
+
if (this.elevateGift) {
|
|
336
|
+
this.isGiftNotFound = false;
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
await this.loadElevateGift();
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
render() {
|
|
343
|
+
return (index.h(index.Host, { key: '6f28f64d3413dd82bc81fc6fd975baa992d06289' }, index.h("general-styling-wrapper", { key: '88dedbfb25562fbe95a69748649ed9c14a2c42f6', clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling }), index.h("div", { key: '9f2a66f9d48882220ab5d3850f343e995ffe9a6b', class: 'ElevateDetails' }, this.isGiftNotFound && (index.h(index.Fragment, { key: '91f4079bf7af7e4d61b1681a9848c72c9a2249d5' }, index.h("div", { key: 'e0427680e0d7e94e51644f12a2430a6a42e3d340', class: "Row ThumbnailRow" }, index.h("div", { key: '4fd78968b2fdf281b7c22596351b366058cfcec3', class: "BackButton", onClick: () => {
|
|
344
|
+
this.onBackClicked();
|
|
345
|
+
} }, '<')), index.h("div", { key: 'eeb8cbc40429cf1ebf7a5f0de3d5b8226a40437b', class: "Thumnails GiftNotFound" }, translate('noDataFound', this.language), "."))), this.elevateGift && index.h(index.Fragment, { key: '45380d051b279d9c7fcd580f06252911763073e0' }, index.h("div", { key: 'c440d72501fb91601106fbf74a866887bc02ee43', class: "ThumbnailRow" }, index.h("div", { key: '005f436acbc51372d013e1931d54b71738f2e0fc', class: 'Row' }, index.h("div", { key: 'a9ace30abf1c50d639c31bb047d7b7d7cb6b27b8', class: "BackButton", onClick: () => { this.onBackClicked(); } }, '<'), index.h("bonus-elevate-shop-assets-slider", { key: '8c4121e66a3fae912e72fc10c6a81354a7b36e9f', class: 'Thumbnails', itemsPerPage: 1, sliderItems: this.elevateGift.presentation.assets, showSliderDots: this.showSliderDots })), index.h("div", { key: 'c6a207dfe14402e4d1890e7b787bf4b5a2247160', class: 'Col Details' }, index.h("h3", { key: 'c190b88ab4d1e13885593b9d6b9c62b161bdff23', class: "GiftName" }, this.elevateGift.presentation.displayName || this.elevateGift.displayName), index.h("div", { key: 'befddb7b8dff3bb73377da4bfb30ce003dcccb7b', class: "GiftPoints" }, index.h("span", { key: '4e879d150709e670b2c7c90f0034c75c4ba30386', class: "Points" }, this.elevateGift.points, " "), index.h("span", { key: 'a7d28d964b41126a76f9988d0f4fc05653787066', class: " PointsLabel" }, translate('coins', this.language))))), index.h("div", { key: '14d2374d40825ac91b275fda81ca22d40f21c0be', class: 'ShopItemDetail Details' }, index.h("div", { key: '197bb9c0089173f8c4f180e115068f6204a6f7ea', class: "GiftPresentation" }, index.h("p", { key: '30be8dbec63f8f4d2bc3687d7e992d73c534a20f' }, this.elevateGift.presentation.description ? this.elevateGift.presentation.description : translate('noGiftPresentation', this.language))), index.h("div", { key: '7e0a9e4d03f338137649c9477a44c7036aea1609', class: `RedeemButton ${this.elevateGift.available === 'false' || this.isRedeeming ? 'Disabled' : ''}
|
|
346
|
+
${this.deviceType == 'dk' ? 'DkButton' : ''}`, onClick: this.redeemGiftConfirm.bind(this) }, translate('redeem', this.language)), index.h("span", { key: '89b70f02565437ed28b175c65d0767354b6c9d6b', class: 'RedeemError Error' }, " ", this.redeemErrorMsg, " "))))));
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
BonusElevateShopItem.style = BonusElevateShopItemStyle0;
|
|
350
|
+
|
|
351
|
+
const mergeTranslations = (url, target) => {
|
|
352
|
+
return new Promise((resolve) => {
|
|
353
|
+
fetch(url)
|
|
354
|
+
.then((res) => res.json())
|
|
355
|
+
.then((data) => {
|
|
356
|
+
Object.keys(data).forEach((item) => {
|
|
357
|
+
target[item] = target[item] ? target[item] : {};
|
|
358
|
+
for (let key in data[item]) {
|
|
359
|
+
target[item][key] = data[item][key];
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
resolve(true);
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
const generalStylingWrapperCss = ":host{display:block}";
|
|
368
|
+
const GeneralStylingWrapperStyle0 = generalStylingWrapperCss;
|
|
369
|
+
|
|
370
|
+
const GeneralStylingWrapper = class {
|
|
371
|
+
constructor(hostRef) {
|
|
372
|
+
index.registerInstance(this, hostRef);
|
|
373
|
+
this.stylingAppends = false;
|
|
374
|
+
this.setClientStyling = () => {
|
|
375
|
+
let sheet = document.createElement('style');
|
|
376
|
+
sheet.innerHTML = this.clientStyling;
|
|
377
|
+
this.el.prepend(sheet);
|
|
378
|
+
};
|
|
379
|
+
this.setClientStylingURL = () => {
|
|
380
|
+
let url = new URL(this.clientStylingUrl);
|
|
381
|
+
let cssFile = document.createElement('style');
|
|
382
|
+
fetch(url.href)
|
|
383
|
+
.then((res) => res.text())
|
|
384
|
+
.then((data) => {
|
|
385
|
+
cssFile.innerHTML = data;
|
|
386
|
+
setTimeout(() => {
|
|
387
|
+
this.el.prepend(cssFile);
|
|
388
|
+
}, 1);
|
|
389
|
+
})
|
|
390
|
+
.catch((err) => {
|
|
391
|
+
console.log('error ', err);
|
|
392
|
+
});
|
|
393
|
+
};
|
|
394
|
+
this.clientStyling = '';
|
|
395
|
+
this.clientStylingUrl = '';
|
|
396
|
+
this.translationUrl = '';
|
|
397
|
+
this.targetTranslations = undefined;
|
|
398
|
+
}
|
|
399
|
+
componentDidRender() {
|
|
400
|
+
// start custom styling area
|
|
401
|
+
if (!this.stylingAppends) {
|
|
402
|
+
if (this.clientStyling)
|
|
403
|
+
this.setClientStyling();
|
|
404
|
+
if (this.clientStylingUrl)
|
|
405
|
+
this.setClientStylingURL();
|
|
406
|
+
this.stylingAppends = true;
|
|
407
|
+
}
|
|
408
|
+
// end custom styling area
|
|
409
|
+
}
|
|
410
|
+
async componentWillLoad() {
|
|
411
|
+
const promises = [];
|
|
412
|
+
if (this.translationUrl) {
|
|
413
|
+
const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
|
|
414
|
+
promises.push(translationPromise);
|
|
415
|
+
}
|
|
416
|
+
return await Promise.all(promises);
|
|
417
|
+
}
|
|
418
|
+
render() {
|
|
419
|
+
return (index.h("div", { key: '4d3414408c7662f88331dbe655966237f74d6958', class: "StyleShell" }, index.h("slot", { key: '1d004644d84602c4314bdf5dfc26b55b160f57df', name: "mainContent" })));
|
|
420
|
+
}
|
|
421
|
+
get el() { return index.getElement(this); }
|
|
422
|
+
};
|
|
423
|
+
GeneralStylingWrapper.style = GeneralStylingWrapperStyle0;
|
|
424
|
+
|
|
425
|
+
exports.bonus_elevate_shop_assets_slider = BonusElevateShopAssetsSlider;
|
|
426
|
+
exports.bonus_elevate_shop_item = BonusElevateShopItem;
|
|
427
|
+
exports.general_styling_wrapper = GeneralStylingWrapper;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-1035f878.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
|
|
10
|
+
*/
|
|
11
|
+
var patchBrowser = () => {
|
|
12
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('bonus-elevate-shop-item.cjs.js', document.baseURI).href));
|
|
13
|
+
const opts = {};
|
|
14
|
+
if (importMeta !== "") {
|
|
15
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
16
|
+
}
|
|
17
|
+
return index.promiseResolve(opts);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
patchBrowser().then(async (options) => {
|
|
21
|
+
await appGlobals.globalScripts();
|
|
22
|
+
return index.bootstrapLazy([["bonus-elevate-shop-assets-slider_3.cjs",[[1,"bonus-elevate-shop-item",{"endpoint":[513],"language":[513],"itemId":[1537,"item-id"],"elevateGift":[1040],"session":[513],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"showSliderDots":[516,"show-slider-dots"],"showSliderArrows":[516,"show-slider-arrows"],"isGiftNotFound":[32],"redeemErrorMsg":[32],"isRedeeming":[32]}],[0,"bonus-elevate-shop-assets-slider",{"showSliderDots":[516,"show-slider-dots"],"showSliderArrows":[516,"show-slider-arrows"],"itemsPerPage":[514,"items-per-page"],"sliderItems":[16],"activeIndex":[32]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]}]]]], options);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
exports.setNonce = index.setNonce;
|