@everymatrix/bonus-elevate-levels 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-levels/bonus-elevate-levels.esm.js +1 -0
- package/dist/bonus-elevate-levels/index.esm.js +0 -0
- package/dist/bonus-elevate-levels/p-35063d92.entry.js +1 -0
- package/dist/bonus-elevate-levels/p-6e37b540.js +2 -0
- package/dist/bonus-elevate-levels/p-e1255160.js +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/bonus-elevate-levels.cjs.js +25 -0
- package/dist/cjs/bonus-elevate-levels_5.cjs.entry.js +429 -0
- package/dist/cjs/index-39b21e10.js +1626 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/collection/collection-manifest.json +22 -0
- package/dist/collection/components/bonus-elevate-levels/bonus-elevate-levels.css +18 -0
- package/dist/collection/components/bonus-elevate-levels/bonus-elevate-levels.js +243 -0
- package/dist/collection/components/bonus-elevate-levels/index.js +1 -0
- package/dist/collection/components/elevate-level-list/elevate-level-list.css +70 -0
- package/dist/collection/components/elevate-level-list/elevate-level-list.js +232 -0
- package/dist/collection/components/elevate-level-presentation/elevate-level-presentation.css +21 -0
- package/dist/collection/components/elevate-level-presentation/elevate-level-presentation.js +45 -0
- package/dist/collection/components/elevate-levels-data/elevate-levels-data.css +3 -0
- package/dist/collection/components/elevate-levels-data/elevate-levels-data.js +89 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/models/elevate-levels.js +1 -0
- package/dist/collection/utils/locale.utils.js +48 -0
- package/dist/collection/utils/prototype-collector.js +5 -0
- package/dist/collection/utils/utils.js +44 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/bonus-elevate-levels.js +20 -0
- package/dist/esm/bonus-elevate-levels_5.entry.js +421 -0
- package/dist/esm/index-ed3d1f59.js +1597 -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-levels/.stencil/packages/stencil/bonus-elevate-levels/stencil.config.d.ts +2 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/packages/stencil/bonus-elevate-levels/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/bonus-elevate-levels/bonus-elevate-levels.d.ts +49 -0
- package/dist/types/components/bonus-elevate-levels/index.d.ts +1 -0
- package/dist/types/components/elevate-level-list/elevate-level-list.d.ts +45 -0
- package/dist/types/components/elevate-level-presentation/elevate-level-presentation.d.ts +8 -0
- package/dist/types/components/elevate-levels-data/elevate-levels-data.d.ts +10 -0
- package/dist/types/components.d.ts +206 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/elevate-levels.d.ts +12 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/locale.utils.d.ts +10 -0
- package/dist/types/utils/prototype-collector.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +21 -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 +26 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,b as l}from"./p-6e37b540.js";export{s as setNonce}from"./p-6e37b540.js";import{g as t}from"./p-e1255160.js";(()=>{const l=import.meta.url,t={};return""!==l&&(t.resourcesUrl=new URL(".",l).href),e(t)})().then((async e=>(await t(),l([["p-35063d92",[[1,"bonus-elevate-levels",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],endpoint:[513],language:[513],translationUrl:[513,"translation-url"],selectedLevelId:[1537,"selected-level-id"],showDefault:[4,"show-default"],elevateLevelParamProxy:[32],elevateLevels:[32],currentLevel:[32],errorMessage:[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{selectedLevelId:["selectedLevelIdChangedHandler"],elevateLevels:["selectedLevelIdChangedHandler"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{levels:[16],language:[1],selectedLevelId:[1537,"selected-level-id"],isShowSliderButton:[32],touchPosStart:[32],touchPosEnd:[32],offset:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{selectedLevelId:["levelsChangedHandler"]}],[0,"elevate-level-presentation",{elevateLevel:[16]}],[0,"elevate-levels-data",{scopeParams:[1544,"scope-params"]}],[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,c as i,H as s,g as l}from"./p-6e37b540.js";const o=["ro","en","fr","hr","tr"],n={en:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},fr:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},hr:{level:"Razina",seeAll:"Vidi sve",privilegesFor:"Privilegije za",termsAndConditions:"Uvjeti i odredbe",noLevelsSet:"There is no level set",points:"Points"},ro:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},tr:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"}},a=(e,t)=>{const i=t;return n[void 0!==i&&(o.includes(i)||n[i])?i:"en"][e]},r=class{constructor(t){e(this,t),this.clientStyling="",this.clientStylingUrl="",this.endpoint=void 0,this.language="en",this.translationUrl="",this.selectedLevelId=void 0,this.showDefault=void 0,this.elevateLevelParamProxy=void 0,this.elevateLevels=[],this.currentLevel=void 0,this.errorMessage=void 0}selectedLevelChangedHandler(e){e.detail&&(this.currentLevel=Object.assign({},e.detail.level))}selectedLevelIdChangedHandler(){if(this.selectedLevelId&&this.elevateLevels){const e=this.elevateLevels.filter((e=>e.id==this.selectedLevelId))[0];this.currentLevel=Object.assign({},e)}}onSessionOrEndpointChange(){this.elevateLevelParamProxy=Object.assign(Object.assign({},this.elevateLevelParamProxy),{endpoint:this.endpoint,language:this.language})}elevateLevelsDataChangeHandler(e){e.detail&&(e.detail.currentLevel&&(this.currentLevel=Object.assign({},e.detail.currentLevel)),e.detail.elevateLevels&&(this.elevateLevels=[...e.detail.elevateLevels]),e.detail.clearError&&(this.errorMessage=null),e.detail.errorMessage&&e.detail.errorMessage.errorWhenLoadElevateLevels&&(this.errorMessage=a("loadElevateLevelErrorMessage",this.language)))}onTCClick(){window.postMessage({type:"termAndConditionClicked"},window.location.href)}componentWillLoad(){this.elevateLevelParamProxy={endpoint:this.endpoint,language:this.language,selectedLevelId:this.selectedLevelId,showDefault:this.showDefault}}render(){return t("div",{key:"327b5cd6a3bc756ce0696a0f2a4081f35bad7316",class:"ElevateLevelContent"},t("elevate-levels-data",{key:"cf1ab9a55cdaf9eba688bd524cb4a83d63563e77",scopeParams:this.elevateLevelParamProxy}),t("div",{key:"9c85b9a805712db07c7c99ac2db843062997f667",class:"LevelContent"},this.elevateLevels?t("elevate-level-list",{language:this.language,selectedLevelId:this.selectedLevelId,levels:this.elevateLevels}):a("noLevelsSet",this.language),this.currentLevel&&t("elevate-level-presentation",{key:"0fecb2a451caeef4512dc6f2af4fd3406610cc72",elevateLevel:this.currentLevel})),this.errorMessage&&t("div",{key:"ef746907148df80338fd2300322cd8eea9342f51"},this.errorMessage),t("general-styling-wrapper",{key:"e3d82ef1b7e5986354e18d875f9e3c547ff8adba",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:n,translationUrl:this.translationUrl}))}static get watchers(){return{selectedLevelId:["selectedLevelIdChangedHandler"],elevateLevels:["selectedLevelIdChangedHandler"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}}};var h;r.style=":host{display:block}.ElevateLevelContent{padding:20px;position:relative}.ElevateLevelContent .Privileges{padding-bottom:30px}.ElevateLevelContent .tc{position:absolute;right:10px;bottom:10px;text-align:right;display:none}",function(e){e[e.slideToRight=1]="slideToRight",e[e.slideToLeft=-1]="slideToLeft"}(h||(h={}));const d=class{constructor(t){var s;e(this,t),this.selectedLevelChanged=i(this,"selectedLevelChanged",7),this.minOffset=0,this.isMobile=!!((s=window.navigator.userAgent).toLowerCase().match(/android/i)||s.toLowerCase().match(/blackberry|bb/i)||s.toLowerCase().match(/iphone|ipad|ipod/i)||s.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),this.levels=void 0,this.language=void 0,this.selectedLevelId=void 0,this.isShowSliderButton=!1,this.touchPosStart=void 0,this.touchPosEnd=void 0,this.offset=0}onLevelClicked(e){this.selectedLevelChanged.emit({level:e}),this.selectedLevelId=e.id}levelsChangedHandler(){this.initOffsetOfLevelItems()}initOffsetOfLevelItems(){if(!this.levels||0==this.levels.length||!this.selectedLevelId)return;const e=this.levels.findIndex((e=>this.selectedLevelId==e.id));if(this.onLevelClicked(this.levels[-1==e?0:e]),this.levels.length<=this.moveCountForOneTouch)return;let t=Math.floor((-1==e?1:e+1)/this.moveCountForOneTouch)*this.moveCountForOneTouch*this.childElementWidth*-1;this.offset=t<=this.minOffset?this.minOffset:t>=0?0:t}onTouchStart(e){this.touchPosStart={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}}onTouchMove(e){this.touchPosEnd={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY};const t=this.touchPosEnd.clientX-this.touchPosStart.clientX,i=this.touchPosEnd.clientY-this.touchPosStart.clientY;Math.abs(t)>Math.abs(i)&&this.slideTo(t>0?h.slideToRight:h.slideToLeft)}slideTo(e){let t=this.levelsElement.offsetLeft+this.childElementWidth*this.moveCountForOneTouch*e;if(t%this.childElementWidth!=0){const i=Math.floor(t/this.childElementWidth)*this.childElementWidth,s=Math.ceil(t/this.childElementWidth)*this.childElementWidth;t=e==h.slideToRight?i:s}this.offset=t<this.minOffset?this.minOffset:t>=0?0:t}initLevelSlider(){var e;if(!(null===(e=this.levelsElement)||void 0===e?void 0:e.firstElementChild))return void console.log("Widget[elevate-level-list] DOM is not ready.");this.isShowSliderButton=!this.isMobile&&this.levelsElement.clientWidth>this.levelsElement.parentElement.clientWidth,this.minOffset=this.levelsElement.parentElement.clientWidth-this.levelsElement.clientWidth,this.childElementWidth=this.levelsElement.firstElementChild.clientWidth,this.moveCountForOneTouch=Math.ceil(this.levelsElement.parentElement.clientWidth/this.childElementWidth)-1;const t=this.levelsElement.childElementCount;this.childElementWidth+=(this.levelsElement.clientWidth-this.childElementWidth*t)/(t-1)}debounce(e,t){{let i;return()=>{clearTimeout(i),i=setTimeout((()=>{e()}),t)}}}handleResize(){this.debounce(this.initLevelSlider.bind(this),200)()}componentDidRender(){this.host.componentOnReady().then((()=>{this.initLevelSlider()}))}render(){return t(s,{key:"d88d3434af89a0f8fd20a97735121fdf297905ab"},this.levels&&[t("div",{key:"cff36ba584e2474a65a1b95545b00937ecd06c8c",class:`SliderButton LeftButton ${0==this.offset?"Disabled":""} ${this.isShowSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToRight)},t("svg",{key:"640b4dd9b26b4097d15623f3e9c6b14b9a60b37e",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"0a50ffc9319ad33ed61e4696c37a0bfe6090518c","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"}))),t("div",{key:"314c5b4c5bbc0d50041a66fdf474441ea418345a",class:"LevelItemsWrapper"},t("div",{key:"ff1fb084aeb20319c36a3420e9eb8693ea81b144",style:{left:`${this.offset}px`},class:"LevelItems "+(this.isMobile?"Mobile":""),id:"levelItems",ref:e=>{this.levelsElement=e}},this.levels.map(((e,i)=>t("div",{class:"Item "+(this.selectedLevelId==e.id?"Active":""),onClick:this.onLevelClicked.bind(this,e)},t("img",{alt:`Presentation Icon for ${e.presentation.displayName}`,class:"LevelImg",src:e.presentation.asset}),t("span",{class:"LevelName",title:e.presentation.displayName},e.presentation.displayName),t("span",{class:"LevelPoints"},0==i?"":">",e.firstEntryPoints," ",a("points",this.language))))))),t("div",{key:"8dae638ca436c7e747a0f737028588ee5d040edd",class:`SliderButton RightButton ${this.offset<=this.minOffset?"Disabled":""} ${this.isShowSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(h.slideToLeft)},t("svg",{key:"bba16b49668567aaa41beedd9ea461d256c6812d",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"36a0b6f3ffe8b50ebea9a4ec1c01e3341c440949","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})))])}get host(){return l(this)}static get watchers(){return{selectedLevelId:["levelsChangedHandler"]}}};d.style="elevate-level-list{display:flex;flex-direction:row}.LevelItemsWrapper{display:flex;flex:1;margin-top:10px;min-height:30px;transition-property:all;position:relative;height:138px;overflow-x:hidden}.Mobile.LevelItems{overflow-x:hidden}.LevelItems{overflow-x:auto;display:flex;flex-direction:row;gap:10px;left:0;position:absolute;transition:left 0.5s ease-in-out}.LevelItems .Item:hover,.LevelItems .Item.Active{background-color:var(--emfe-w-color-gray-50, rgb(244, 244, 244));box-shadow:0px 4px 13px 0px rgba(0, 0, 0, 0.25)}.LevelItems .Item{width:86px;height:125px;border-radius:15px;text-align:center;display:flex;flex-direction:column;cursor:pointer}.LevelItems .Item .LevelName{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.LevelItems .Item .LevelPoints{color:var(--emfe-w-color-gray-100, rgb(118, 113, 113));font-size:10px}.LevelItems .Item .LevelImg{width:65px;height:68px;margin:11px auto}.SliderButton{display:flex;width:29px;align-items:center;cursor:pointer}.SliderButton.Disabled svg{stroke:var(--emfe-w-color-gray-50, #cbc5c5)}.SliderButton.Hidden{display:none}";const c=class{constructor(t){e(this,t),this.elevateLevel=void 0}render(){return t(s,{key:"16d128717e716f7ca7d3bb77fc3a2e67209318b6"},t("div",{key:"658657abdfc64844bd2af40562efe40385e1735a",class:"Row Desc"},t("h3",{key:"ec5871c2f810c8c120bf99510717381175bc1ef4"},this.elevateLevel.presentation.displayName),t("p",{key:"865915c6eea90295238fb47eaa91c8f968199ca5"},t("span",{key:"2b90c6c5d6957b73fc4a0f53d53da0ca023a4f0a",class:"TxtDesc",innerHTML:this.elevateLevel.presentation.description}))))}};c.style=":host{display:block}.PriviliegeList{padding-inline-start:5px}.PriviliegeList li{display:flex}.PriviliegeList li .Img{width:80px}.PriviliegeList li .Img img{width:60px;margin:10px}.PriviliegeList li .Content h4{text-transform:capitalize;margin-block-start:10px}";var v,f,p,b={exports:{}};v=b,f=b.exports,p=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==p)return p;throw new Error("unable to locate global object")}(),v.exports=f=p.fetch,p.fetch&&(f.default=p.fetch.bind(p)),f.Headers=p.Headers,f.Request=p.Request,f.Response=p.Response;const g=b.exports,m=class{constructor(t){e(this,t),this.elevateLevelsDataChange=i(this,"elevateLevelsDataChange",7),this.scopeParams=void 0}async componentWillRender(){if(!this.scopeParams.endpoint)return;let e=new URL(`${this.scopeParams.endpoint}/v1/elevate/levels?language=${this.scopeParams.language}`);await g(e.href).then((e=>e.json())).then((e=>{const t=e.data.sort(((e,t)=>e.firstEntryPoints<t.firstEntryPoints?-1:1));let i=this.scopeParams.selectedLevelId;if(!i&&this.scopeParams.showDefault&&t.length>0&&(i=t[0].id),i){const e=t.filter((e=>e.id==i))[0];this.elevateLevelsDataChange.emit({currentLevel:e})}this.elevateLevelsDataChange.emit({clearError:!0}),this.elevateLevelsDataChange.emit({elevateLevels:t})})).catch((e=>{this.elevateLevelsDataChange.emit({errorMessage:{type:"errorWhenLoadElevateLevels",err:e}}),console.error(e)}))}};m.style=":host{display:block}";const u=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 l(this)}};u.style=":host{display:block}";export{r as bonus_elevate_levels,d as elevate_level_list,c as elevate_level_presentation,m as elevate_levels_data,u as general_styling_wrapper}
|
|
@@ -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=[],$=(e,t)=>n=>{e.push(n),p||(p=!0,t&&4&a.o?w(b):a.raf(b))},y=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},b=()=>{y(m),y(v),(p=m.length>0)&&a.raf(b)},w=e=>d().then(e),g=$(v,!0),S={},j=e=>"object"==(e=typeof e)||"function"===e;function k(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,R,x,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&&!j(o))&&(o+=""),i&&r?c[c.length-1].i+=o:c.push(i?H(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(" "))}}const u=H(e,null);return u.u=t,c.length>0&&(u.h=c),u.p=l,u.m=s,u},H=(e,t)=>({o:0,v:e,i:t,$:null,h:null,u:null,p:null,m:null}),N={},W=e=>n(e).$hostElement$,D=(e,t,n)=>{const o=W(e);return{emit:e=>L(o,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},L=(e,t,n)=>{const o=a.ce(t,n);return e.dispatchEvent(o),o},U=new WeakMap,F=e=>"sc-"+e.S,q=(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=I(n),s=I(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=j(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(V);t=t.replace(_,""),n&&a.rel(e,t,n,l),o&&a.ael(e,t,o,l)}}},G=/\s/,I=e=>e?e.split(G):[],V="Capture",_=RegExp(V+"$"),z=(e,t,n)=>{const o=11===t.$.nodeType&&t.$.host?t.$.host:t.$,l=e&&e.u||S,s=t.u||S;for(const e of B(Object.keys(l)))e in s||q(o,e,l[e],void 0,n,t.o);for(const e of B(Object.keys(s)))q(o,e,l[e],s[e],n,t.o)};function B(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var J=!1,K=!1,Q=!1,X=!1,Y=(e,t,n,o)=>{var l;const s=t.h[n];let i,r,c,f=0;if(J||(Q=!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(X||(X="svg"===s.v),i=s.$=u.createElementNS(X?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",!J&&2&s.o?"slot-fb":s.v),X&&"foreignObject"===s.v&&(X=!1),z(null,s,X),i.getRootNode().querySelector("body"),s.h)for(f=0;f<s.h.length;++f)r=Y(e,s,f,i),r&&i.appendChild(r);"svg"===s.v?X=!1:"foreignObject"===i.tagName&&(X=!0)}return i["s-hn"]=x,3&s.o&&(i["s-sr"]=!0,i["s-cr"]=R,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.$&&Z(e.$,!1)),i},Z=(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"]!==x&&o["s-ol"]&&(ae(le(o),o,oe(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,Q=!0),t&&Z(o,t)}a.o&=-2},ee=(e,t,n,o,l,s)=>{let i,r=e["s-cr"]&&e["s-cr"].parentNode||e;for(r.shadowRoot&&r.tagName===x&&(r=r.shadowRoot);l<=s;++l)o[l]&&(i=Y(null,n,l,e),i&&(o[l].$=i,ae(r,i,oe(t))))},te=(e,t,n)=>{for(let o=t;o<=n;++o){const t=e[o];if(t){const e=t.$;ue(t),e&&(K=!0,e["s-ol"]?e["s-ol"].remove():Z(e,!0),e.remove())}}},ne=(e,t,n=!1)=>!(e.v!==t.v||("slot"===e.v?"j"in e&&n&&8!==e.$.nodeType||e.m!==t.m:!n&&e.p!==t.p)),oe=e=>e&&e["s-ol"]||e,le=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,se=(e,t,n=!1)=>{const o=t.$=e.$,l=e.h,s=t.h,i=t.v,r=t.i;let c;null===r?(X="svg"===i||"foreignObject"!==i&&X,("slot"!==i||J)&&z(e,t,X),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(ne(d,m,l))se(d,m,l),d=t[++r],m=o[++c];else if(ne(h,v,l))se(h,v,l),h=t[--a],v=o[--p];else if(ne(d,v,l))"slot"!==d.v&&"slot"!==v.v||Z(d.$.parentNode,!1),se(d,v,l),ae(e,d.$,h.$.nextSibling),d=t[++r],v=o[--p];else if(ne(h,m,l))"slot"!==d.v&&"slot"!==v.v||Z(h.$.parentNode,!1),se(h,m,l),ae(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=Y(t&&t[c],n,f,e):(se(i,m,l),t[f]=void 0,s=i.$),m=o[++c]):(s=Y(t&&t[c],n,c,e),m=o[++c]),s&&ae(le(d.$),s,oe(d.$))}r>a?ee(e,null==o[p+1]?null:o[p+1].$,n,o,c,p):c>p&&te(t,r,a)})(o,l,t,s,n):null!==s?(null!==e.i&&(o.textContent=""),ee(o,null,t,s,0,s.length-1)):!n&&null!==l&&te(l,0,l.length-1),X&&"svg"===i&&(X=!1)):(c=o["s-cr"])?c.parentNode.textContent=r:e.i!==r&&(o.data=r)},ie=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}}ie(e)}},re=[],ce=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(fe(t,e)){let n=re.find((e=>e.k===t));K=!0,t["s-sn"]=t["s-sn"]||e,n?(n.k["s-sh"]=l["s-hn"],n.O=l):(t["s-sh"]=l["s-hn"],re.push({O:l,k:t})),t["s-sr"]&&re.map((e=>{fe(e.k,t["s-sn"])&&(n=re.find((e=>e.k===t)),n&&!e.O&&(e.O=n.O))}))}else re.some((e=>e.k===t))||re.push({k:t})}1===l.nodeType&&ce(l)}},fe=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,ue=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(ue)},ae=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),de=(e,t)=>{t&&!e.C&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.C=t)))},he=(e,t)=>{if(e.o|=16,!(4&e.o))return de(e,e.M),g((()=>pe(e,t)));e.o|=512},pe=(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&&(e.o|=256,e.R&&(e.R.map((([e,t])=>ge(n,e,t))),e.R=void 0),o=ge(n,"componentWillLoad")),o=me(o,(()=>ge(n,"componentWillRender"))),me(o,(()=>$e(e,n,t)))},me=(e,t)=>ve(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),ve=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,$e=async(e,t,n)=>{var o;const l=e.$hostElement$,s=l["s-rc"];n&&(e=>{const t=e.P,n=e.$hostElement$,o=t.o,l=((e,t)=>{var n;const o=F(t),l=r.get(o);if(e=11===e.nodeType?e:u,l)if("string"==typeof l){let s,i=U.get(e=e.head||e);if(i||U.set(e,i=new Set),!i.has(o)){{s=u.createElement("style"),s.innerHTML=l;const o=null!=(n=a.T)?n:k(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);ye(e,t,l,n),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=null!=(o=l["s-p"])?o:[],n=()=>be(e);0===t.length?n():(Promise.all(t).then(n),e.o|=4,t.length=0)}},ye=(e,t,n,o)=>{try{t=t.render&&t.render(),e.o&=-17,e.o|=2,((e,t,n=!1)=>{var o,l,s,i;const r=e.$hostElement$,c=e.P,f=e.A||H(null,null),d=(e=>e&&e.v===N)(t)?t:A(null,null,t);if(x=r.tagName,c.H&&(d.u=d.u||{},c.H.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.A=d,d.$=f.$=r.shadowRoot||r,M=r["s-sc"],J=!!(1&c.o),R=r["s-cr"],K=!1,se(f,d,n),a.o|=1,Q){ce(d.$);for(const e of re){const t=e.k;if(!t["s-ol"]){const e=u.createTextNode("");e["s-nr"]=t,ae(t.parentNode,t["s-ol"]=e,t)}}for(const e of re){const t=e.k,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),ae(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)}}K&&ie(d.$),a.o&=-2,re.length=0,R=void 0})(e,t,o)}catch(t){s(t,e.$hostElement$)}return null},be=e=>{const t=e.$hostElement$,n=e.M;ge(e.t,"componentDidRender"),64&e.o||(e.o|=64,Se(t),e.N(t),n||we()),e.C&&(e.C(),e.C=void 0),512&e.o&&w((()=>he(e,!1))),e.o&=-517},we=()=>{Se(u.documentElement),w((()=>L(f,"appload",{detail:{namespace:"bonus-elevate-levels"}})))},ge=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},Se=e=>e.classList.add("hydrated"),je=(e,t,o)=>{var l,i;const r=e.prototype;if(t.W||t.D||e.watchers){e.watchers&&!t.D&&(t.D=e.watchers);const c=Object.entries(null!=(l=t.W)?l:{});if(c.map((([e,[l]])=>{(31&l||2&o&&32&l)&&Object.defineProperty(r,e,{get(){return((e,t)=>n(this).L.get(t))(0,e)},set(o){((e,t,o,l)=>{const i=n(e);if(!i)throw Error(`Couldn't find host element for "${l.S}" 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 r=i.$hostElement$,c=i.L.get(t),f=i.o,u=i.t;if(o=((e,t)=>null==e||j(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(o,l.W[t][0]),(!(8&f)||void 0===c)&&o!==c&&(!Number.isNaN(c)||!Number.isNaN(o))&&(i.L.set(t,o),u)){if(l.D&&128&f){const e=l.D[t];e&&e.map((e=>{try{u[e](o,c,t)}catch(e){s(e,r)}}))}2==(18&f)&&he(i,!1)}})(this,e,o,t)},configurable:!0,enumerable:!0})})),1&o){const o=new Map;r.attributeChangedCallback=function(e,l,s){a.jmp((()=>{var i;const c=o.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(r.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const o=n(this),r=null==o?void 0:o.o;if(r&&!(8&r)&&128&r&&s!==l){const n=o.t,r=null==(i=t.D)?void 0:i[e];null==r||r.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!=(i=t.D)?i:{}),...c.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.H)||l.push([e,s])),s}))]))}}return e},ke=(e,o={})=>{var l;const d=[],p=o.exclude||[],m=f.customElements,v=u.head,$=v.querySelector("meta[charset]"),y=u.createElement("style"),b=[];let w,g=!0;Object.assign(a,o),a.l=new URL(o.resourcesUrl||"./",u.baseURI).href;let S=!1;if(e.map((e=>{e[1].map((o=>{var l;const c={o:o[0],S:o[1],W:o[2],U:o[3]};4&c.o&&(S=!0),c.W=o[2],c.U=o[3],c.H=[],c.D=null!=(l=o[4])?l:{};const f=c.S,v=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const o={o:0,$hostElement$:e,P:n,L:new Map};o.F=new Promise((e=>o.N=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,o)})(e=this,c),1&c.o)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.S}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){const e=n(this);this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,Oe(this,e,c.U)),w&&(clearTimeout(w),w=null),g?b.push(this):a.jmp((()=>(e=>{if(!(1&a.o)){const t=n(e),o=t.P,l=()=>{};if(1&t.o)Oe(e,t,o.U),(null==t?void 0:t.t)||(null==t?void 0:t.F)&&t.F.then((()=>{}));else{t.o|=1,12&o.o&&(e=>{const t=e["s-cr"]=u.createComment("");t["s-cn"]=!0,ae(e,t,e.firstChild)})(e);{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){de(t,t.M=n);break}}o.W&&Object.entries(o.W).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.q){const e=(e=>{const t=e.S.replace(/-/g,"_"),n=e.q;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.S}#${t.G}" was not found`);o.isProxied||(n.D=o.watchers,je(o,n,2),o.isProxied=!0);const l=()=>{};t.o|=8;try{new o(t)}catch(e){s(e)}t.o&=-9,t.o|=128,l()}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=F(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=()=>he(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);e.I&&(e.I.map((e=>e())),e.I=void 0),(null==e?void 0:e.t)||(null==e?void 0:e.F)&&e.F.then((()=>{}))}})()))}componentOnReady(){return n(this).F}};c.q=e[0],p.includes(f)||m.get(f)||(d.push(f),m.define(f,je(v,c,1)))}))})),d.length>0&&(S&&(y.textContent+=c),y.textContent+=d.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",y.innerHTML.length)){y.setAttribute("data-styles","");const e=null!=(l=a.T)?l:k(u);null!=e&&y.setAttribute("nonce",e),v.insertBefore(y,$?$.nextSibling:v.firstChild)}g=!1,b.length?b.map((e=>e.connectedCallback())):a.jmp((()=>w=setTimeout(we,30)))},Oe=(e,t,n)=>{n&&n.map((([n,o,l])=>{const s=Ce(e,n),i=Ee(t,l),r=Me(n);a.ael(s,o,i,r),(t.I=t.I||[]).push((()=>a.rel(s,o,i,r)))}))},Ee=(e,t)=>n=>{var o;try{256&e.o?null==(o=e.t)||o[t](n):(e.R=e.R||[]).push([t,n])}catch(e){s(e)}},Ce=(e,t)=>8&t?f:e,Me=e=>({passive:!!(1&e),capture:!!(2&e)}),Re=e=>a.T=e;export{N as H,ke as b,D as c,W as g,A as h,d as p,o as r,Re as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=()=>{};export{o as g}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-39b21e10.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-levels.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-levels_5.cjs",[[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"isShowSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[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;
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-39b21e10.js');
|
|
6
|
+
|
|
7
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
8
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'hr', 'tr'];
|
|
9
|
+
const TRANSLATIONS = {
|
|
10
|
+
en: {
|
|
11
|
+
level: 'level',
|
|
12
|
+
seeAll: 'See All',
|
|
13
|
+
termsAndConditions: 'Terms & Conditions',
|
|
14
|
+
loadElevateLevelErrorMessage: 'Error when load elevate levels',
|
|
15
|
+
noLevelsSet: 'There is no level set',
|
|
16
|
+
points: 'Points',
|
|
17
|
+
},
|
|
18
|
+
fr: {
|
|
19
|
+
level: 'level',
|
|
20
|
+
seeAll: 'See All',
|
|
21
|
+
termsAndConditions: 'Terms & Conditions',
|
|
22
|
+
loadElevateLevelErrorMessage: 'Error when load elevate levels',
|
|
23
|
+
noLevelsSet: 'There is no level set',
|
|
24
|
+
points: 'Points',
|
|
25
|
+
},
|
|
26
|
+
hr: {
|
|
27
|
+
level: 'Razina',
|
|
28
|
+
seeAll: 'Vidi sve',
|
|
29
|
+
privilegesFor: 'Privilegije za',
|
|
30
|
+
termsAndConditions: 'Uvjeti i odredbe',
|
|
31
|
+
noLevelsSet: 'There is no level set',
|
|
32
|
+
points: 'Points',
|
|
33
|
+
},
|
|
34
|
+
ro: {
|
|
35
|
+
level: 'level',
|
|
36
|
+
seeAll: 'See All',
|
|
37
|
+
termsAndConditions: 'Terms & Conditions',
|
|
38
|
+
loadElevateLevelErrorMessage: 'Error when load elevate levels',
|
|
39
|
+
noLevelsSet: 'There is no level set',
|
|
40
|
+
points: 'Points',
|
|
41
|
+
},
|
|
42
|
+
tr: {
|
|
43
|
+
level: 'level',
|
|
44
|
+
seeAll: 'See All',
|
|
45
|
+
termsAndConditions: 'Terms & Conditions',
|
|
46
|
+
loadElevateLevelErrorMessage: 'Error when load elevate levels',
|
|
47
|
+
noLevelsSet: 'There is no level set',
|
|
48
|
+
points: 'Points',
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const translate = (key, customLang) => {
|
|
52
|
+
const lang = customLang;
|
|
53
|
+
return TRANSLATIONS[lang !== undefined && (SUPPORTED_LANGUAGES.includes(lang) || TRANSLATIONS[lang]) ? lang : DEFAULT_LANGUAGE][key];
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const bonusElevateLevelsCss = ":host{display:block}.ElevateLevelContent{padding:20px;position:relative}.ElevateLevelContent .Privileges{padding-bottom:30px}.ElevateLevelContent .tc{position:absolute;right:10px;bottom:10px;text-align:right;display:none}";
|
|
57
|
+
const BonusElevateLevelsStyle0 = bonusElevateLevelsCss;
|
|
58
|
+
|
|
59
|
+
const BonusElevateLevels = class {
|
|
60
|
+
constructor(hostRef) {
|
|
61
|
+
index.registerInstance(this, hostRef);
|
|
62
|
+
this.clientStyling = '';
|
|
63
|
+
this.clientStylingUrl = '';
|
|
64
|
+
this.endpoint = undefined;
|
|
65
|
+
this.language = 'en';
|
|
66
|
+
this.translationUrl = '';
|
|
67
|
+
this.selectedLevelId = undefined;
|
|
68
|
+
this.showDefault = undefined;
|
|
69
|
+
this.elevateLevelParamProxy = undefined;
|
|
70
|
+
this.elevateLevels = [];
|
|
71
|
+
this.currentLevel = undefined;
|
|
72
|
+
this.errorMessage = undefined;
|
|
73
|
+
}
|
|
74
|
+
selectedLevelChangedHandler(event) {
|
|
75
|
+
if (event.detail) {
|
|
76
|
+
this.currentLevel = Object.assign({}, event.detail.level);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
selectedLevelIdChangedHandler() {
|
|
80
|
+
if (this.selectedLevelId && this.elevateLevels) {
|
|
81
|
+
const currentLevel = this.elevateLevels.filter((item) => {
|
|
82
|
+
return item.id == this.selectedLevelId;
|
|
83
|
+
})[0];
|
|
84
|
+
this.currentLevel = Object.assign({}, currentLevel);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
onSessionOrEndpointChange() {
|
|
88
|
+
this.elevateLevelParamProxy = Object.assign(Object.assign({}, this.elevateLevelParamProxy), { endpoint: this.endpoint, language: this.language });
|
|
89
|
+
}
|
|
90
|
+
elevateLevelsDataChangeHandler(event) {
|
|
91
|
+
if (!event.detail) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (event.detail.currentLevel) {
|
|
95
|
+
this.currentLevel = Object.assign({}, event.detail.currentLevel);
|
|
96
|
+
}
|
|
97
|
+
if (event.detail.elevateLevels) {
|
|
98
|
+
this.elevateLevels = [...event.detail.elevateLevels];
|
|
99
|
+
}
|
|
100
|
+
if (event.detail.clearError) {
|
|
101
|
+
this.errorMessage = null;
|
|
102
|
+
}
|
|
103
|
+
if (event.detail.errorMessage) {
|
|
104
|
+
if (event.detail.errorMessage['errorWhenLoadElevateLevels']) {
|
|
105
|
+
this.errorMessage = translate('loadElevateLevelErrorMessage', this.language);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
onTCClick() {
|
|
110
|
+
window.postMessage({ type: 'termAndConditionClicked' }, window.location.href);
|
|
111
|
+
}
|
|
112
|
+
componentWillLoad() {
|
|
113
|
+
this.elevateLevelParamProxy = {
|
|
114
|
+
endpoint: this.endpoint, language: this.language, selectedLevelId: this.selectedLevelId,
|
|
115
|
+
showDefault: this.showDefault
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
render() {
|
|
119
|
+
return (index.h("div", { key: '327b5cd6a3bc756ce0696a0f2a4081f35bad7316', class: "ElevateLevelContent" }, index.h("elevate-levels-data", { key: 'cf1ab9a55cdaf9eba688bd524cb4a83d63563e77', scopeParams: this.elevateLevelParamProxy }), index.h("div", { key: '9c85b9a805712db07c7c99ac2db843062997f667', class: "LevelContent" }, this.elevateLevels ?
|
|
120
|
+
index.h("elevate-level-list", { language: this.language, selectedLevelId: this.selectedLevelId, levels: this.elevateLevels }) : translate('noLevelsSet', this.language), this.currentLevel &&
|
|
121
|
+
index.h("elevate-level-presentation", { key: '0fecb2a451caeef4512dc6f2af4fd3406610cc72', elevateLevel: this.currentLevel })), this.errorMessage && index.h("div", { key: 'ef746907148df80338fd2300322cd8eea9342f51' }, this.errorMessage), index.h("general-styling-wrapper", { key: 'e3d82ef1b7e5986354e18d875f9e3c547ff8adba', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl })));
|
|
122
|
+
}
|
|
123
|
+
static get watchers() { return {
|
|
124
|
+
"selectedLevelId": ["selectedLevelIdChangedHandler"],
|
|
125
|
+
"elevateLevels": ["selectedLevelIdChangedHandler"],
|
|
126
|
+
"endpoint": ["onSessionOrEndpointChange"],
|
|
127
|
+
"language": ["onSessionOrEndpointChange"]
|
|
128
|
+
}; }
|
|
129
|
+
};
|
|
130
|
+
BonusElevateLevels.style = BonusElevateLevelsStyle0;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @name isMobile
|
|
134
|
+
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
135
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
136
|
+
* @returns {Boolean} true or false
|
|
137
|
+
*/
|
|
138
|
+
const isMobile = (userAgent) => {
|
|
139
|
+
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
140
|
+
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
141
|
+
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
142
|
+
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
143
|
+
};
|
|
144
|
+
var MOVE_TO;
|
|
145
|
+
(function (MOVE_TO) {
|
|
146
|
+
MOVE_TO[MOVE_TO["slideToRight"] = 1] = "slideToRight";
|
|
147
|
+
MOVE_TO[MOVE_TO["slideToLeft"] = -1] = "slideToLeft";
|
|
148
|
+
})(MOVE_TO || (MOVE_TO = {}));
|
|
149
|
+
|
|
150
|
+
const elevateLevelListCss = "elevate-level-list{display:flex;flex-direction:row}.LevelItemsWrapper{display:flex;flex:1;margin-top:10px;min-height:30px;transition-property:all;position:relative;height:138px;overflow-x:hidden}.Mobile.LevelItems{overflow-x:hidden}.LevelItems{overflow-x:auto;display:flex;flex-direction:row;gap:10px;left:0;position:absolute;transition:left 0.5s ease-in-out}.LevelItems .Item:hover,.LevelItems .Item.Active{background-color:var(--emfe-w-color-gray-50, rgb(244, 244, 244));box-shadow:0px 4px 13px 0px rgba(0, 0, 0, 0.25)}.LevelItems .Item{width:86px;height:125px;border-radius:15px;text-align:center;display:flex;flex-direction:column;cursor:pointer}.LevelItems .Item .LevelName{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.LevelItems .Item .LevelPoints{color:var(--emfe-w-color-gray-100, rgb(118, 113, 113));font-size:10px}.LevelItems .Item .LevelImg{width:65px;height:68px;margin:11px auto}.SliderButton{display:flex;width:29px;align-items:center;cursor:pointer}.SliderButton.Disabled svg{stroke:var(--emfe-w-color-gray-50, #cbc5c5)}.SliderButton.Hidden{display:none}";
|
|
151
|
+
const ElevateLevelListStyle0 = elevateLevelListCss;
|
|
152
|
+
|
|
153
|
+
const ElevateLevelList = class {
|
|
154
|
+
constructor(hostRef) {
|
|
155
|
+
index.registerInstance(this, hostRef);
|
|
156
|
+
this.selectedLevelChanged = index.createEvent(this, "selectedLevelChanged", 7);
|
|
157
|
+
this.minOffset = 0;
|
|
158
|
+
this.isMobile = isMobile(window.navigator.userAgent);
|
|
159
|
+
this.levels = undefined;
|
|
160
|
+
this.language = undefined;
|
|
161
|
+
this.selectedLevelId = undefined;
|
|
162
|
+
this.isShowSliderButton = false;
|
|
163
|
+
this.touchPosStart = undefined;
|
|
164
|
+
this.touchPosEnd = undefined;
|
|
165
|
+
this.offset = 0;
|
|
166
|
+
}
|
|
167
|
+
onLevelClicked(elevateLevel) {
|
|
168
|
+
this.selectedLevelChanged.emit({ level: elevateLevel });
|
|
169
|
+
this.selectedLevelId = elevateLevel.id;
|
|
170
|
+
}
|
|
171
|
+
levelsChangedHandler() {
|
|
172
|
+
this.initOffsetOfLevelItems();
|
|
173
|
+
}
|
|
174
|
+
initOffsetOfLevelItems() {
|
|
175
|
+
if (!this.levels || this.levels.length == 0 || !this.selectedLevelId) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const currentLevelIndex = this.levels.findIndex((item) => {
|
|
179
|
+
return this.selectedLevelId == item.id;
|
|
180
|
+
});
|
|
181
|
+
this.onLevelClicked(this.levels[currentLevelIndex == -1 ? 0 : currentLevelIndex]);
|
|
182
|
+
//do not need change the slider offset when level items less than moveCountForOneTouch
|
|
183
|
+
if (this.levels.length <= this.moveCountForOneTouch) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
//to avoid the slider do not move when currentLevelIndex = moveCountForOneTouch - 1
|
|
187
|
+
let newOffset = Math.floor((currentLevelIndex == -1 ? 1 : currentLevelIndex + 1) / this.moveCountForOneTouch)
|
|
188
|
+
* this.moveCountForOneTouch * this.childElementWidth * (-1);
|
|
189
|
+
this.offset = newOffset <= this.minOffset ? this.minOffset : (newOffset >= 0 ? 0 : newOffset);
|
|
190
|
+
}
|
|
191
|
+
onTouchStart(e) {
|
|
192
|
+
this.touchPosStart = { clientX: e.touches[0].clientX, clientY: e.touches[0].clientY };
|
|
193
|
+
}
|
|
194
|
+
onTouchMove(e) {
|
|
195
|
+
this.touchPosEnd = { clientX: e.touches[0].clientX, clientY: e.touches[0].clientY };
|
|
196
|
+
const diffX = this.touchPosEnd.clientX - this.touchPosStart.clientX;
|
|
197
|
+
const diffY = this.touchPosEnd.clientY - this.touchPosStart.clientY;
|
|
198
|
+
if (Math.abs(diffX) > Math.abs(diffY)) {
|
|
199
|
+
this.slideTo(diffX > 0 ? MOVE_TO.slideToRight : MOVE_TO.slideToLeft);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
slideTo(direction) {
|
|
203
|
+
let newOffset = this.levelsElement.offsetLeft +
|
|
204
|
+
(this.childElementWidth) * this.moveCountForOneTouch * direction;
|
|
205
|
+
if (newOffset % this.childElementWidth != 0) {
|
|
206
|
+
const leftOfPreNode = (Math.floor(newOffset / this.childElementWidth)) * this.childElementWidth;
|
|
207
|
+
const leftOfNextNode = (Math.ceil(newOffset / this.childElementWidth)) * this.childElementWidth;
|
|
208
|
+
//touchmove to right, get left of pre-node; touchmove to left, get left of next-node
|
|
209
|
+
newOffset = direction == MOVE_TO.slideToRight ? leftOfPreNode : leftOfNextNode;
|
|
210
|
+
}
|
|
211
|
+
this.offset = newOffset < this.minOffset ? this.minOffset : (newOffset >= 0 ? 0 : newOffset);
|
|
212
|
+
}
|
|
213
|
+
initLevelSlider() {
|
|
214
|
+
var _a;
|
|
215
|
+
if (!((_a = this.levelsElement) === null || _a === void 0 ? void 0 : _a.firstElementChild)) {
|
|
216
|
+
console.log('Widget[elevate-level-list] DOM is not ready.');
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
this.isShowSliderButton = !this.isMobile && (this.levelsElement.clientWidth > this.levelsElement.parentElement.clientWidth);
|
|
220
|
+
this.minOffset = this.levelsElement.parentElement.clientWidth - this.levelsElement.clientWidth;
|
|
221
|
+
this.childElementWidth = this.levelsElement.firstElementChild.clientWidth;
|
|
222
|
+
this.moveCountForOneTouch = Math.ceil(this.levelsElement.parentElement.clientWidth / this.childElementWidth) - 1;
|
|
223
|
+
const childElementCount = this.levelsElement.childElementCount;
|
|
224
|
+
this.childElementWidth += (this.levelsElement.clientWidth - this.childElementWidth * childElementCount) / (childElementCount - 1);
|
|
225
|
+
}
|
|
226
|
+
debounce(callback, delay) {
|
|
227
|
+
{
|
|
228
|
+
let timer;
|
|
229
|
+
return () => {
|
|
230
|
+
clearTimeout(timer);
|
|
231
|
+
timer = setTimeout(() => {
|
|
232
|
+
callback();
|
|
233
|
+
}, delay);
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
;
|
|
238
|
+
handleResize() {
|
|
239
|
+
this.debounce(this.initLevelSlider.bind(this), 200)();
|
|
240
|
+
}
|
|
241
|
+
componentDidRender() {
|
|
242
|
+
this.host.componentOnReady().then(() => {
|
|
243
|
+
this.initLevelSlider();
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
render() {
|
|
247
|
+
return (index.h(index.Host, { key: 'd88d3434af89a0f8fd20a97735121fdf297905ab' }, this.levels && [
|
|
248
|
+
index.h("div", { key: 'cff36ba584e2474a65a1b95545b00937ecd06c8c', class: `SliderButton LeftButton ${this.offset == 0 ? 'Disabled' : ''} ${this.isShowSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToRight) }, index.h("svg", { key: '640b4dd9b26b4097d15623f3e9c6b14b9a60b37e', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '0a50ffc9319ad33ed61e4696c37a0bfe6090518c', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))),
|
|
249
|
+
index.h("div", { key: '314c5b4c5bbc0d50041a66fdf474441ea418345a', class: 'LevelItemsWrapper' }, index.h("div", { key: 'ff1fb084aeb20319c36a3420e9eb8693ea81b144', style: { 'left': `${this.offset}px` }, class: `LevelItems ${this.isMobile ? 'Mobile' : ''}`, id: 'levelItems', ref: (el) => { this.levelsElement = el; } }, this.levels.map((level, idx) => {
|
|
250
|
+
return (index.h("div", { class: `Item ${this.selectedLevelId == level.id ? 'Active' : ''}`, onClick: this.onLevelClicked.bind(this, level) }, index.h("img", { alt: `Presentation Icon for ${level.presentation.displayName}`, class: "LevelImg", src: level.presentation.asset }), index.h("span", { class: "LevelName", title: level.presentation.displayName }, level.presentation.displayName), index.h("span", { class: "LevelPoints" }, idx == 0 ? '' : '>', level.firstEntryPoints, ' ', translate('points', this.language))));
|
|
251
|
+
}))),
|
|
252
|
+
index.h("div", { key: '8dae638ca436c7e747a0f737028588ee5d040edd', class: `SliderButton RightButton ${this.offset <= this.minOffset ? 'Disabled' : ''} ${this.isShowSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToLeft) }, index.h("svg", { key: 'bba16b49668567aaa41beedd9ea461d256c6812d', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '36a0b6f3ffe8b50ebea9a4ec1c01e3341c440949', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" })))
|
|
253
|
+
]));
|
|
254
|
+
}
|
|
255
|
+
get host() { return index.getElement(this); }
|
|
256
|
+
static get watchers() { return {
|
|
257
|
+
"selectedLevelId": ["levelsChangedHandler"]
|
|
258
|
+
}; }
|
|
259
|
+
};
|
|
260
|
+
ElevateLevelList.style = ElevateLevelListStyle0;
|
|
261
|
+
|
|
262
|
+
const elevateLevelPresentationCss = ":host{display:block}.PriviliegeList{padding-inline-start:5px}.PriviliegeList li{display:flex}.PriviliegeList li .Img{width:80px}.PriviliegeList li .Img img{width:60px;margin:10px}.PriviliegeList li .Content h4{text-transform:capitalize;margin-block-start:10px}";
|
|
263
|
+
const ElevateLevelPresentationStyle0 = elevateLevelPresentationCss;
|
|
264
|
+
|
|
265
|
+
const ElevateLevelPresentation = class {
|
|
266
|
+
constructor(hostRef) {
|
|
267
|
+
index.registerInstance(this, hostRef);
|
|
268
|
+
this.elevateLevel = undefined;
|
|
269
|
+
}
|
|
270
|
+
render() {
|
|
271
|
+
return index.h(index.Host, { key: '16d128717e716f7ca7d3bb77fc3a2e67209318b6' }, index.h("div", { key: '658657abdfc64844bd2af40562efe40385e1735a', class: "Row Desc" }, index.h("h3", { key: 'ec5871c2f810c8c120bf99510717381175bc1ef4' }, this.elevateLevel.presentation.displayName), index.h("p", { key: '865915c6eea90295238fb47eaa91c8f968199ca5' }, index.h("span", { key: '2b90c6c5d6957b73fc4a0f53d53da0ca023a4f0a', class: "TxtDesc", innerHTML: this.elevateLevel.presentation.description }))));
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
ElevateLevelPresentation.style = ElevateLevelPresentationStyle0;
|
|
275
|
+
|
|
276
|
+
var browser = {exports: {}};
|
|
277
|
+
|
|
278
|
+
(function (module, exports) {
|
|
279
|
+
|
|
280
|
+
// ref: https://github.com/tc39/proposal-global
|
|
281
|
+
var getGlobal = function () {
|
|
282
|
+
// the only reliable means to get the global object is
|
|
283
|
+
// `Function('return this')()`
|
|
284
|
+
// However, this causes CSP violations in Chrome apps.
|
|
285
|
+
if (typeof self !== 'undefined') { return self; }
|
|
286
|
+
if (typeof window !== 'undefined') { return window; }
|
|
287
|
+
if (typeof global !== 'undefined') { return global; }
|
|
288
|
+
throw new Error('unable to locate global object');
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
var global = getGlobal();
|
|
292
|
+
|
|
293
|
+
module.exports = exports = global.fetch;
|
|
294
|
+
|
|
295
|
+
// Needed for TypeScript and Webpack.
|
|
296
|
+
if (global.fetch) {
|
|
297
|
+
exports.default = global.fetch.bind(global);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
exports.Headers = global.Headers;
|
|
301
|
+
exports.Request = global.Request;
|
|
302
|
+
exports.Response = global.Response;
|
|
303
|
+
}(browser, browser.exports));
|
|
304
|
+
|
|
305
|
+
const fetch$1 = browser.exports;
|
|
306
|
+
|
|
307
|
+
const elevateLevelsDataCss = ":host{display:block}";
|
|
308
|
+
const ElevateLevelsDataStyle0 = elevateLevelsDataCss;
|
|
309
|
+
|
|
310
|
+
const ElevateLevelsData = class {
|
|
311
|
+
constructor(hostRef) {
|
|
312
|
+
index.registerInstance(this, hostRef);
|
|
313
|
+
this.elevateLevelsDataChange = index.createEvent(this, "elevateLevelsDataChange", 7);
|
|
314
|
+
this.scopeParams = undefined;
|
|
315
|
+
}
|
|
316
|
+
async componentWillRender() {
|
|
317
|
+
//load data
|
|
318
|
+
if (!this.scopeParams.endpoint) {
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
const endpoint = this.scopeParams.endpoint;
|
|
322
|
+
let url = new URL(`${endpoint}/v1/elevate/levels?language=${this.scopeParams.language}`);
|
|
323
|
+
await fetch$1(url.href)
|
|
324
|
+
.then((res) => res.json())
|
|
325
|
+
.then((res) => {
|
|
326
|
+
const elevateLevels = res.data.sort((a, b) => {
|
|
327
|
+
return a.firstEntryPoints < b.firstEntryPoints ? -1 : 1;
|
|
328
|
+
});
|
|
329
|
+
let selectedLevelId = this.scopeParams.selectedLevelId;
|
|
330
|
+
// if selected level is not set, set first(basic) as default
|
|
331
|
+
if (!selectedLevelId && this.scopeParams.showDefault && elevateLevels.length > 0) {
|
|
332
|
+
selectedLevelId = elevateLevels[0].id;
|
|
333
|
+
}
|
|
334
|
+
if (selectedLevelId) {
|
|
335
|
+
// get current level by name
|
|
336
|
+
const currentLevel = elevateLevels.filter((item) => {
|
|
337
|
+
return item.id == selectedLevelId;
|
|
338
|
+
})[0];
|
|
339
|
+
this.elevateLevelsDataChange.emit({ currentLevel: currentLevel });
|
|
340
|
+
}
|
|
341
|
+
this.elevateLevelsDataChange.emit({ 'clearError': true });
|
|
342
|
+
this.elevateLevelsDataChange.emit({ 'elevateLevels': elevateLevels });
|
|
343
|
+
}).catch((err) => {
|
|
344
|
+
this.elevateLevelsDataChange.emit({ errorMessage: { type: 'errorWhenLoadElevateLevels', err } });
|
|
345
|
+
console.error(err);
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
ElevateLevelsData.style = ElevateLevelsDataStyle0;
|
|
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_levels = BonusElevateLevels;
|
|
426
|
+
exports.elevate_level_list = ElevateLevelList;
|
|
427
|
+
exports.elevate_level_presentation = ElevateLevelPresentation;
|
|
428
|
+
exports.elevate_levels_data = ElevateLevelsData;
|
|
429
|
+
exports.general_styling_wrapper = GeneralStylingWrapper;
|