@everymatrix/bonus-elevate-levels-jojogroup 1.80.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/bonus-elevate-levels-jojogroup/app-globals-0f993ce5.js +1 -0
  2. package/dist/bonus-elevate-levels-jojogroup/bonus-elevate-levels-jojogroup.esm.js +1 -0
  3. package/dist/bonus-elevate-levels-jojogroup/bonus-elevate-levels-jojogroup_4.entry.js +1 -0
  4. package/dist/bonus-elevate-levels-jojogroup/elevate-level-list.entry.js +1 -0
  5. package/dist/bonus-elevate-levels-jojogroup/index-88ecbb5b.js +2 -0
  6. package/dist/bonus-elevate-levels-jojogroup/index.esm.js +0 -0
  7. package/dist/bonus-elevate-levels-jojogroup/locale.utils-3a9c8e78.js +1 -0
  8. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  9. package/dist/cjs/bonus-elevate-levels-jojogroup.cjs.js +25 -0
  10. package/dist/cjs/bonus-elevate-levels-jojogroup_4.cjs.entry.js +322 -0
  11. package/dist/cjs/elevate-level-list.cjs.entry.js +147 -0
  12. package/dist/cjs/index-09a798bf.js +1612 -0
  13. package/dist/cjs/index.cjs.js +2 -0
  14. package/dist/cjs/loader.cjs.js +15 -0
  15. package/dist/cjs/locale.utils-942322b6.js +54 -0
  16. package/dist/collection/collection-manifest.json +22 -0
  17. package/dist/collection/components/bonus-elevate-levels-jojogroup/bonus-elevate-levels-jojogroup.css +18 -0
  18. package/dist/collection/components/bonus-elevate-levels-jojogroup/bonus-elevate-levels-jojogroup.js +231 -0
  19. package/dist/collection/components/bonus-elevate-levels-jojogroup/index.js +1 -0
  20. package/dist/collection/components/elevate-level-list/elevate-level-list.css +70 -0
  21. package/dist/collection/components/elevate-level-list/elevate-level-list.js +241 -0
  22. package/dist/collection/components/elevate-level-presentation/elevate-level-presentation.css +21 -0
  23. package/dist/collection/components/elevate-level-presentation/elevate-level-presentation.js +45 -0
  24. package/dist/collection/components/elevate-levels-data/elevate-levels-data.css +3 -0
  25. package/dist/collection/components/elevate-levels-data/elevate-levels-data.js +89 -0
  26. package/dist/collection/index.js +1 -0
  27. package/dist/collection/models/elevate-levels.js +1 -0
  28. package/dist/collection/utils/locale.utils.js +49 -0
  29. package/dist/collection/utils/prototype-collector.js +5 -0
  30. package/dist/collection/utils/utils.js +41 -0
  31. package/dist/esm/app-globals-0f993ce5.js +3 -0
  32. package/dist/esm/bonus-elevate-levels-jojogroup.js +20 -0
  33. package/dist/esm/bonus-elevate-levels-jojogroup_4.entry.js +315 -0
  34. package/dist/esm/elevate-level-list.entry.js +143 -0
  35. package/dist/esm/index-88ecbb5b.js +1583 -0
  36. package/dist/esm/index.js +1 -0
  37. package/dist/esm/loader.js +11 -0
  38. package/dist/esm/locale.utils-3a9c8e78.js +51 -0
  39. package/dist/index.cjs.js +1 -0
  40. package/dist/index.js +1 -0
  41. package/dist/stencil.config.dev.js +17 -0
  42. package/dist/stencil.config.js +19 -0
  43. package/dist/storybook/main.js +47 -0
  44. package/dist/storybook/preview.js +9 -0
  45. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-levels-jojogroup/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  46. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-levels-jojogroup/.stencil/packages/stencil/bonus-elevate-levels-jojogroup/stencil.config.d.ts +2 -0
  47. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-levels-jojogroup/.stencil/packages/stencil/bonus-elevate-levels-jojogroup/stencil.config.dev.d.ts +2 -0
  48. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-levels-jojogroup/.stencil/packages/stencil/bonus-elevate-levels-jojogroup/storybook/main.d.ts +3 -0
  49. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-levels-jojogroup/.stencil/packages/stencil/bonus-elevate-levels-jojogroup/storybook/preview.d.ts +70 -0
  50. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-levels-jojogroup/.stencil/tools/plugins/index.d.ts +4 -0
  51. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-levels-jojogroup/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  52. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-levels-jojogroup/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  53. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-levels-jojogroup/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  54. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-levels-jojogroup/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  55. package/dist/types/components/bonus-elevate-levels-jojogroup/bonus-elevate-levels-jojogroup.d.ts +19 -0
  56. package/dist/types/components/bonus-elevate-levels-jojogroup/index.d.ts +1 -0
  57. package/dist/types/components/elevate-level-list/elevate-level-list.d.ts +46 -0
  58. package/dist/types/components/elevate-level-presentation/elevate-level-presentation.d.ts +8 -0
  59. package/dist/types/components/elevate-levels-data/elevate-levels-data.d.ts +10 -0
  60. package/dist/types/components.d.ts +166 -0
  61. package/dist/types/index.d.ts +1 -0
  62. package/dist/types/models/elevate-levels.d.ts +12 -0
  63. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  64. package/dist/types/utils/locale.utils.d.ts +10 -0
  65. package/dist/types/utils/prototype-collector.d.ts +1 -0
  66. package/dist/types/utils/utils.d.ts +20 -0
  67. package/loader/cdn.js +1 -0
  68. package/loader/index.cjs.js +1 -0
  69. package/loader/index.d.ts +24 -0
  70. package/loader/index.es2017.js +1 -0
  71. package/loader/index.js +2 -0
  72. package/loader/package.json +11 -0
  73. package/package.json +26 -0
@@ -0,0 +1,21 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .PriviliegeList {
6
+ padding-inline-start: 5px;
7
+ }
8
+ .PriviliegeList li {
9
+ display: flex;
10
+ }
11
+ .PriviliegeList li .Img {
12
+ width: 80px;
13
+ }
14
+ .PriviliegeList li .Img img {
15
+ width: 60px;
16
+ margin: 10px;
17
+ }
18
+ .PriviliegeList li .Content h4 {
19
+ text-transform: capitalize;
20
+ margin-block-start: 10px;
21
+ }
@@ -0,0 +1,45 @@
1
+ import { h, Host } from "@stencil/core";
2
+ export class ElevateLevelPresentation {
3
+ constructor() {
4
+ this.elevateLevel = undefined;
5
+ }
6
+ render() {
7
+ return h(Host, { key: 'c02f0c4ca19226058b810f279273affa7b3398cc' }, h("div", { key: 'da5e3ce17167447ee462b1318f7d407f48781062', class: "Row Desc" }, h("h3", { key: '6f811514d8f72b7484795e8a181c8e18446a52fe' }, this.elevateLevel.presentation.displayName), h("p", { key: 'fd0f78d172f027c79d542d630467e0f24099328f' }, h("span", { key: '5eec8c85f146739d7e01b7112e1b1cf886c83310', class: "TxtDesc", innerHTML: this.elevateLevel.presentation.description }))));
8
+ }
9
+ static get is() { return "elevate-level-presentation"; }
10
+ static get originalStyleUrls() {
11
+ return {
12
+ "$": ["elevate-level-presentation.scss"]
13
+ };
14
+ }
15
+ static get styleUrls() {
16
+ return {
17
+ "$": ["elevate-level-presentation.css"]
18
+ };
19
+ }
20
+ static get properties() {
21
+ return {
22
+ "elevateLevel": {
23
+ "type": "unknown",
24
+ "mutable": false,
25
+ "complexType": {
26
+ "original": "ElevateLevel",
27
+ "resolved": "ElevateLevel",
28
+ "references": {
29
+ "ElevateLevel": {
30
+ "location": "import",
31
+ "path": "../../models/elevate-levels",
32
+ "id": "../../../../packages/stencil/bonus-elevate-levels-jojogroup/src/models/elevate-levels.ts::ElevateLevel"
33
+ }
34
+ }
35
+ },
36
+ "required": true,
37
+ "optional": false,
38
+ "docs": {
39
+ "tags": [],
40
+ "text": "Elevate level"
41
+ }
42
+ }
43
+ };
44
+ }
45
+ }
@@ -0,0 +1,3 @@
1
+ :host {
2
+ display: block;
3
+ }
@@ -0,0 +1,89 @@
1
+ import "../../../../../general-styling-wrapper/dist/types/index";
2
+ import fetch from "node-fetch";
3
+ export class ElevateLevelsData {
4
+ constructor() {
5
+ this.scopeParams = undefined;
6
+ }
7
+ async componentWillRender() {
8
+ //load data
9
+ if (!this.scopeParams.endpoint) {
10
+ return;
11
+ }
12
+ const endpoint = this.scopeParams.endpoint;
13
+ let url = new URL(`${endpoint}/v1/elevate/levels?language=${this.scopeParams.language}`);
14
+ await fetch(url.href)
15
+ .then((res) => res.json())
16
+ .then((res) => {
17
+ const elevateLevels = res.data.sort((a, b) => {
18
+ return a.firstEntryPoints < b.firstEntryPoints ? -1 : 1;
19
+ });
20
+ let selectedLevelId = this.scopeParams.selectedLevelId;
21
+ // if selected level is not set, set first(basic) as default
22
+ if (!selectedLevelId && this.scopeParams.showDefault && elevateLevels.length > 0) {
23
+ selectedLevelId = elevateLevels[0].id;
24
+ }
25
+ if (selectedLevelId) {
26
+ // get current level by name
27
+ const currentLevel = elevateLevels.filter((item) => {
28
+ return item.id == selectedLevelId;
29
+ })[0];
30
+ this.elevateLevelsDataChange.emit({ currentLevel: currentLevel });
31
+ }
32
+ this.elevateLevelsDataChange.emit({ 'clearError': true });
33
+ this.elevateLevelsDataChange.emit({ 'elevateLevels': elevateLevels });
34
+ }).catch((err) => {
35
+ this.elevateLevelsDataChange.emit({ errorMessage: { type: 'errorWhenLoadElevateLevels', err } });
36
+ console.error(err);
37
+ });
38
+ }
39
+ static get is() { return "elevate-levels-data"; }
40
+ static get originalStyleUrls() {
41
+ return {
42
+ "$": ["elevate-levels-data.scss"]
43
+ };
44
+ }
45
+ static get styleUrls() {
46
+ return {
47
+ "$": ["elevate-levels-data.css"]
48
+ };
49
+ }
50
+ static get properties() {
51
+ return {
52
+ "scopeParams": {
53
+ "type": "any",
54
+ "mutable": true,
55
+ "complexType": {
56
+ "original": "any",
57
+ "resolved": "any",
58
+ "references": {}
59
+ },
60
+ "required": true,
61
+ "optional": false,
62
+ "docs": {
63
+ "tags": [],
64
+ "text": "Params from parent"
65
+ },
66
+ "attribute": "scope-params",
67
+ "reflect": true
68
+ }
69
+ };
70
+ }
71
+ static get events() {
72
+ return [{
73
+ "method": "elevateLevelsDataChange",
74
+ "name": "elevateLevelsDataChange",
75
+ "bubbles": true,
76
+ "cancelable": true,
77
+ "composed": true,
78
+ "docs": {
79
+ "tags": [],
80
+ "text": ""
81
+ },
82
+ "complexType": {
83
+ "original": "any",
84
+ "resolved": "any",
85
+ "references": {}
86
+ }
87
+ }];
88
+ }
89
+ }
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,49 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ export const TRANSLATIONS = {
3
+ en: {
4
+ level: 'level',
5
+ seeAll: 'See All',
6
+ termsAndConditions: 'Terms & Conditions',
7
+ loadElevateLevelErrorMessage: 'Error when load elevate levels',
8
+ noLevelsSet: 'There is no level set',
9
+ points: 'Points',
10
+ },
11
+ fr: {
12
+ level: 'level',
13
+ seeAll: 'See All',
14
+ termsAndConditions: 'Terms & Conditions',
15
+ loadElevateLevelErrorMessage: 'Error when load elevate levels',
16
+ noLevelsSet: 'There is no level set',
17
+ points: 'Points',
18
+ },
19
+ hr: {
20
+ level: 'Razina',
21
+ seeAll: 'Vidi sve',
22
+ privilegesFor: 'Privilegije za',
23
+ termsAndConditions: 'Uvjeti i odredbe',
24
+ noLevelsSet: 'There is no level set',
25
+ points: 'Points',
26
+ },
27
+ ro: {
28
+ level: 'level',
29
+ seeAll: 'See All',
30
+ termsAndConditions: 'Terms & Conditions',
31
+ loadElevateLevelErrorMessage: 'Error when load elevate levels',
32
+ noLevelsSet: 'There is no level set',
33
+ points: 'Points',
34
+ },
35
+ tr: {
36
+ level: 'level',
37
+ seeAll: 'See All',
38
+ termsAndConditions: 'Terms & Conditions',
39
+ loadElevateLevelErrorMessage: 'Error when load elevate levels',
40
+ noLevelsSet: 'There is no level set',
41
+ points: 'Points',
42
+ }
43
+ };
44
+ export const translate = (key, customLang) => {
45
+ var _a;
46
+ const lang = customLang || DEFAULT_LANGUAGE;
47
+ TRANSLATIONS[lang] = TRANSLATIONS[lang] || {};
48
+ return (_a = TRANSLATIONS[lang][key]) !== null && _a !== void 0 ? _a : '';
49
+ };
@@ -0,0 +1,5 @@
1
+ export const PrototypeDecorator = (target) => {
2
+ target.prototype.getProps = () => {
3
+ console.log(target);
4
+ };
5
+ };
@@ -0,0 +1,41 @@
1
+ export function getValueByLangFromPresentation(presentation, keyName, lang) {
2
+ if (!presentation || !presentation[keyName]) {
3
+ return '';
4
+ }
5
+ return presentation[keyName][lang] ? presentation[keyName][lang] : presentation[keyName]['*'];
6
+ }
7
+ /**
8
+ * @name isMobile
9
+ * @description A method that returns if the browser used to access the app is from a mobile device or not
10
+ * @param {String} userAgent window.navigator.userAgent
11
+ * @returns {Boolean} true or false
12
+ */
13
+ export const isMobile = (userAgent) => {
14
+ return !!(userAgent.toLowerCase().match(/android/i) ||
15
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
16
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
17
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
18
+ };
19
+ /**
20
+ * @name getDevice
21
+ * @description A method that returns the type of the device
22
+ * @param {String} userAgent window.navigator.userAgent
23
+ * @returns {String} Android/iPhone/iPad/PC
24
+ */
25
+ export const getDevice = (userAgent) => {
26
+ if (userAgent.toLowerCase().match(/android/i)) {
27
+ return 'Android';
28
+ }
29
+ if (userAgent.toLowerCase().match(/iphone/i)) {
30
+ return 'iPhone';
31
+ }
32
+ if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
33
+ return 'iPad';
34
+ }
35
+ return 'PC';
36
+ };
37
+ export var MOVE_TO;
38
+ (function (MOVE_TO) {
39
+ MOVE_TO[MOVE_TO["slideToRight"] = 1] = "slideToRight";
40
+ MOVE_TO[MOVE_TO["slideToLeft"] = -1] = "slideToLeft";
41
+ })(MOVE_TO || (MOVE_TO = {}));
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };
@@ -0,0 +1,20 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-88ecbb5b.js';
2
+ export { s as setNonce } from './index-88ecbb5b.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
7
+ */
8
+ var patchBrowser = () => {
9
+ const importMeta = import.meta.url;
10
+ const opts = {};
11
+ if (importMeta !== "") {
12
+ opts.resourcesUrl = new URL(".", importMeta).href;
13
+ }
14
+ return promiseResolve(opts);
15
+ };
16
+
17
+ patchBrowser().then(async (options) => {
18
+ await globalScripts();
19
+ return bootstrapLazy([["elevate-level-list",[[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}]]],["bonus-elevate-levels-jojogroup_4",[[1,"bonus-elevate-levels-jojogroup",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"errorMessage":[32]},[[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[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"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
20
+ });
@@ -0,0 +1,315 @@
1
+ import { r as registerInstance, h, H as Host, c as createEvent, g as getElement } from './index-88ecbb5b.js';
2
+ import { t as translate, T as TRANSLATIONS } from './locale.utils-3a9c8e78.js';
3
+
4
+ const bonusElevateLevelsJojogroupCss = ":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}";
5
+ const BonusElevateLevelsJojogroupStyle0 = bonusElevateLevelsJojogroupCss;
6
+
7
+ const BonusElevateLevelsJojogroup = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.clientStyling = '';
11
+ this.clientStylingUrl = '';
12
+ this.mbSource = undefined;
13
+ this.endpoint = undefined;
14
+ this.language = 'en';
15
+ this.translationUrl = '';
16
+ this.selectedLevelId = undefined;
17
+ this.showDefault = undefined;
18
+ this.elevateLevelParamProxy = undefined;
19
+ this.elevateLevels = [];
20
+ this.errorMessage = undefined;
21
+ }
22
+ elevateLevelsDataChangeHandler(event) {
23
+ if (!event.detail)
24
+ return;
25
+ if (event.detail.elevateLevels) {
26
+ this.elevateLevels = [...event.detail.elevateLevels];
27
+ }
28
+ if (event.detail.clearError) {
29
+ this.errorMessage = null;
30
+ }
31
+ if (event.detail.errorMessage) {
32
+ if (event.detail.errorMessage['errorWhenLoadElevateLevels']) {
33
+ this.errorMessage = translate('loadElevateLevelErrorMessage', this.language);
34
+ }
35
+ }
36
+ }
37
+ onSessionOrEndpointChange() {
38
+ this.elevateLevelParamProxy = Object.assign(Object.assign({}, this.elevateLevelParamProxy), { endpoint: this.endpoint, language: this.language });
39
+ }
40
+ onTCClick() {
41
+ window.postMessage({ type: 'termAndConditionClicked' }, window.location.href);
42
+ }
43
+ componentWillLoad() {
44
+ this.elevateLevelParamProxy = {
45
+ endpoint: this.endpoint,
46
+ language: this.language,
47
+ selectedLevelId: this.selectedLevelId,
48
+ showDefault: this.showDefault,
49
+ };
50
+ }
51
+ render() {
52
+ var _a;
53
+ return (h("div", { key: '3cdca540038915c73a99cca214d1d8091a928cb8', class: "ElevateLevelContent" }, h("elevate-levels-data", { key: '1e1a73074ceb36ce5554b7796ca07c2efb4f73ce', scopeParams: this.elevateLevelParamProxy }), h("div", { key: 'a1c66508053cac8549d23fabb291ff273079786c', class: "LevelContent" }, ((_a = this.elevateLevels) === null || _a === void 0 ? void 0 : _a.length) ? (this.elevateLevels.map((level) => (h("elevate-level-presentation", { elevateLevel: level })))) : (h("div", null, translate('noLevelsSet', this.language)))), this.errorMessage && h("div", { key: 'ed47949b39a95528d1a7f5acb9fe5ea1b596d6aa', class: "ErrorMessage" }, this.errorMessage), h("general-styling-wrapper", { key: 'c033776c424e2bc697f23a5a7abe34746fd6af7f', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl, mbSource: this.mbSource })));
54
+ }
55
+ static get watchers() { return {
56
+ "endpoint": ["onSessionOrEndpointChange"],
57
+ "language": ["onSessionOrEndpointChange"]
58
+ }; }
59
+ };
60
+ BonusElevateLevelsJojogroup.style = BonusElevateLevelsJojogroupStyle0;
61
+
62
+ 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}";
63
+ const ElevateLevelPresentationStyle0 = elevateLevelPresentationCss;
64
+
65
+ const ElevateLevelPresentation = class {
66
+ constructor(hostRef) {
67
+ registerInstance(this, hostRef);
68
+ this.elevateLevel = undefined;
69
+ }
70
+ render() {
71
+ return h(Host, { key: 'c02f0c4ca19226058b810f279273affa7b3398cc' }, h("div", { key: 'da5e3ce17167447ee462b1318f7d407f48781062', class: "Row Desc" }, h("h3", { key: '6f811514d8f72b7484795e8a181c8e18446a52fe' }, this.elevateLevel.presentation.displayName), h("p", { key: 'fd0f78d172f027c79d542d630467e0f24099328f' }, h("span", { key: '5eec8c85f146739d7e01b7112e1b1cf886c83310', class: "TxtDesc", innerHTML: this.elevateLevel.presentation.description }))));
72
+ }
73
+ };
74
+ ElevateLevelPresentation.style = ElevateLevelPresentationStyle0;
75
+
76
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
77
+
78
+ var browser = {exports: {}};
79
+
80
+ (function (module, exports) {
81
+
82
+ // ref: https://github.com/tc39/proposal-global
83
+ var getGlobal = function () {
84
+ // the only reliable means to get the global object is
85
+ // `Function('return this')()`
86
+ // However, this causes CSP violations in Chrome apps.
87
+ if (typeof self !== 'undefined') { return self; }
88
+ if (typeof window !== 'undefined') { return window; }
89
+ if (typeof commonjsGlobal !== 'undefined') { return commonjsGlobal; }
90
+ throw new Error('unable to locate global object');
91
+ };
92
+
93
+ var globalObject = getGlobal();
94
+
95
+ module.exports = exports = globalObject.fetch;
96
+
97
+ // Needed for TypeScript and Webpack.
98
+ if (globalObject.fetch) {
99
+ exports.default = globalObject.fetch.bind(globalObject);
100
+ }
101
+
102
+ exports.Headers = globalObject.Headers;
103
+ exports.Request = globalObject.Request;
104
+ exports.Response = globalObject.Response;
105
+ }(browser, browser.exports));
106
+
107
+ const fetch$1 = browser.exports;
108
+
109
+ const elevateLevelsDataCss = ":host{display:block}";
110
+ const ElevateLevelsDataStyle0 = elevateLevelsDataCss;
111
+
112
+ const ElevateLevelsData = class {
113
+ constructor(hostRef) {
114
+ registerInstance(this, hostRef);
115
+ this.elevateLevelsDataChange = createEvent(this, "elevateLevelsDataChange", 7);
116
+ this.scopeParams = undefined;
117
+ }
118
+ async componentWillRender() {
119
+ //load data
120
+ if (!this.scopeParams.endpoint) {
121
+ return;
122
+ }
123
+ const endpoint = this.scopeParams.endpoint;
124
+ let url = new URL(`${endpoint}/v1/elevate/levels?language=${this.scopeParams.language}`);
125
+ await fetch$1(url.href)
126
+ .then((res) => res.json())
127
+ .then((res) => {
128
+ const elevateLevels = res.data.sort((a, b) => {
129
+ return a.firstEntryPoints < b.firstEntryPoints ? -1 : 1;
130
+ });
131
+ let selectedLevelId = this.scopeParams.selectedLevelId;
132
+ // if selected level is not set, set first(basic) as default
133
+ if (!selectedLevelId && this.scopeParams.showDefault && elevateLevels.length > 0) {
134
+ selectedLevelId = elevateLevels[0].id;
135
+ }
136
+ if (selectedLevelId) {
137
+ // get current level by name
138
+ const currentLevel = elevateLevels.filter((item) => {
139
+ return item.id == selectedLevelId;
140
+ })[0];
141
+ this.elevateLevelsDataChange.emit({ currentLevel: currentLevel });
142
+ }
143
+ this.elevateLevelsDataChange.emit({ 'clearError': true });
144
+ this.elevateLevelsDataChange.emit({ 'elevateLevels': elevateLevels });
145
+ }).catch((err) => {
146
+ this.elevateLevelsDataChange.emit({ errorMessage: { type: 'errorWhenLoadElevateLevels', err } });
147
+ console.error(err);
148
+ });
149
+ }
150
+ };
151
+ ElevateLevelsData.style = ElevateLevelsDataStyle0;
152
+
153
+ const mergeTranslations = (url, target) => {
154
+ return new Promise((resolve) => {
155
+ fetch(url)
156
+ .then((res) => res.json())
157
+ .then((data) => {
158
+ Object.keys(data).forEach((item) => {
159
+ target[item] = target[item] || {};
160
+ Object.keys(data[item]).forEach((key) => {
161
+ //if there is no key in target, do nothing
162
+ if (!target['en'][key]) {
163
+ return;
164
+ }
165
+ const defaultTranslation = target['en'][key];
166
+ if (typeof data[item][key] === 'object') {
167
+ // if the key is not in target, then take from en
168
+ target[item][key] = target[item][key] || Object.assign({}, defaultTranslation);
169
+ Object.keys(data[item][key]).forEach((subKey) => {
170
+ target[item][key][subKey] = data[item][key][subKey];
171
+ });
172
+ }
173
+ else {
174
+ target[item][key] = data[item][key] || Object.assign({}, defaultTranslation);
175
+ }
176
+ });
177
+ });
178
+ resolve(true);
179
+ })
180
+ .catch(err => {
181
+ console.error("Failed to load translations:", err);
182
+ resolve(false);
183
+ });
184
+ });
185
+ };
186
+
187
+ /**
188
+ * @name setClientStyling
189
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
190
+ * @param {HTMLElement} stylingContainer The reference element of the widget
191
+ * @param {string} clientStyling The style content
192
+ */
193
+ function setClientStyling(stylingContainer, clientStyling) {
194
+ if (stylingContainer) {
195
+ const sheet = document.createElement('style');
196
+ sheet.innerHTML = clientStyling;
197
+ stylingContainer.appendChild(sheet);
198
+ }
199
+ }
200
+
201
+ /**
202
+ * @name setClientStylingURL
203
+ * @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
204
+ * @param {HTMLElement} stylingContainer The reference element of the widget
205
+ * @param {string} clientStylingUrl The URL of the style content
206
+ */
207
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
208
+ const url = new URL(clientStylingUrl);
209
+
210
+ fetch(url.href)
211
+ .then((res) => res.text())
212
+ .then((data) => {
213
+ const cssFile = document.createElement('style');
214
+ cssFile.innerHTML = data;
215
+ if (stylingContainer) {
216
+ stylingContainer.appendChild(cssFile);
217
+ }
218
+ })
219
+ .catch((err) => {
220
+ console.error('There was an error while trying to load client styling from URL', err);
221
+ });
222
+ }
223
+
224
+ /**
225
+ * @name setStreamLibrary
226
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
227
+ * @param {HTMLElement} stylingContainer The highest element of the widget
228
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
229
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
230
+ */
231
+ function setStreamStyling(stylingContainer, domain, subscription) {
232
+ if (window.emMessageBus) {
233
+ const sheet = document.createElement('style');
234
+
235
+ window.emMessageBus.subscribe(domain, (data) => {
236
+ sheet.innerHTML = data;
237
+ if (stylingContainer) {
238
+ stylingContainer.appendChild(sheet);
239
+ }
240
+ });
241
+ }
242
+ }
243
+
244
+ const generalStylingWrapperCss = ":host{display:block}";
245
+ const GeneralStylingWrapperStyle0 = generalStylingWrapperCss;
246
+
247
+ const GeneralStylingWrapper = class {
248
+ constructor(hostRef) {
249
+ registerInstance(this, hostRef);
250
+ this.stylingAppends = false;
251
+ this.clientStyling = '';
252
+ this.clientStylingUrl = '';
253
+ this.mbSource = undefined;
254
+ this.translationUrl = '';
255
+ this.targetTranslations = undefined;
256
+ }
257
+ componentDidLoad() {
258
+ if (this.el) {
259
+ if (window.emMessageBus != undefined) {
260
+ setStreamStyling(this.el, `${this.mbSource}.Style`);
261
+ }
262
+ else {
263
+ if (this.clientStyling)
264
+ setClientStyling(this.el, this.clientStyling);
265
+ if (this.clientStylingUrl)
266
+ setClientStylingURL(this.el, this.clientStylingUrl);
267
+ this.stylingAppends = true;
268
+ }
269
+ }
270
+ }
271
+ disconnectedCallback() {
272
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
273
+ }
274
+ handleClientStylingChange(newValue, oldValue) {
275
+ if (newValue != oldValue) {
276
+ setClientStyling(this.el, this.clientStyling);
277
+ }
278
+ }
279
+ handleClientStylingUrlChange(newValue, oldValue) {
280
+ if (newValue != oldValue) {
281
+ if (this.clientStylingUrl)
282
+ setClientStylingURL(this.el, this.clientStylingUrl);
283
+ }
284
+ }
285
+ componentDidRender() {
286
+ // start custom styling area
287
+ if (!this.stylingAppends) {
288
+ if (this.clientStyling)
289
+ setClientStyling(this.el, this.clientStyling);
290
+ if (this.clientStylingUrl)
291
+ setClientStylingURL(this.el, this.clientStylingUrl);
292
+ this.stylingAppends = true;
293
+ }
294
+ // end custom styling area
295
+ }
296
+ async componentWillLoad() {
297
+ const promises = [];
298
+ if (this.translationUrl) {
299
+ const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
300
+ promises.push(translationPromise);
301
+ }
302
+ return await Promise.all(promises);
303
+ }
304
+ render() {
305
+ return (h("div", { key: '09ad83748bbad518743c8671b986c541c52bf3f0', class: "StyleShell" }, h("slot", { key: '3b28b776d3944410c717b002b70946d274a4e8e7', name: "mainContent" })));
306
+ }
307
+ get el() { return getElement(this); }
308
+ static get watchers() { return {
309
+ "clientStyling": ["handleClientStylingChange"],
310
+ "clientStylingUrl": ["handleClientStylingUrlChange"]
311
+ }; }
312
+ };
313
+ GeneralStylingWrapper.style = GeneralStylingWrapperStyle0;
314
+
315
+ export { BonusElevateLevelsJojogroup as bonus_elevate_levels_jojogroup, ElevateLevelPresentation as elevate_level_presentation, ElevateLevelsData as elevate_levels_data, GeneralStylingWrapper as general_styling_wrapper };