@everymatrix/bonus-elevate-shop 1.31.2
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/assets/avaliable.false.svg +47 -0
- package/dist/assets/avaliable.true.svg +47 -0
- package/dist/bonus-elevate-shop/bonus-elevate-shop.esm.js +1 -0
- package/dist/bonus-elevate-shop/index.esm.js +0 -0
- package/dist/bonus-elevate-shop/p-6410647b.entry.js +1 -0
- package/dist/bonus-elevate-shop/p-75b51599.js +1 -0
- package/dist/bonus-elevate-shop/p-a76542bd.entry.js +1 -0
- package/dist/bonus-elevate-shop/p-d4f6c446.entry.js +1 -0
- package/dist/bonus-elevate-shop/p-e2f63c46.js +1 -0
- package/dist/cjs/bonus-elevate-shop.cjs.js +19 -0
- package/dist/cjs/bonus-elevate-shop_4.cjs.entry.js +787 -0
- package/dist/cjs/index-ec3ffb89.js +1680 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/player-elevate-card-items-8154b78f.js +2477 -0
- package/dist/cjs/player-elevate-card.cjs.entry.js +77 -0
- package/dist/cjs/player-elevate-loyaltycard.cjs.entry.js +84 -0
- package/dist/collection/collection-manifest.json +28 -0
- package/dist/collection/components/bonus-elevate-shop/bonus-elevate-shop.css +84 -0
- package/dist/collection/components/bonus-elevate-shop/bonus-elevate-shop.js +186 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/renders/renderGifts.js +41 -0
- package/dist/collection/static/avaliable.false.svg +47 -0
- package/dist/collection/static/avaliable.true.svg +47 -0
- package/dist/collection/utils/fetch.js +29 -0
- package/dist/collection/utils/translation.js +6 -0
- package/dist/collection/utils/types.js +1 -0
- package/dist/components/bonus-elevate-shop.d.ts +11 -0
- package/dist/components/bonus-elevate-shop.js +279 -0
- package/dist/components/general-styling-wrapper.js +6 -0
- package/dist/components/general-styling-wrapper2.js +103 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/components/player-elevate-card-data.js +6 -0
- package/dist/components/player-elevate-card-data2.js +624 -0
- package/dist/components/player-elevate-card-items.js +2250 -0
- package/dist/components/player-elevate-card.js +118 -0
- package/dist/components/player-elevate-loyaltycard.js +124 -0
- package/dist/components/player-elevate-pointcard.js +6 -0
- package/dist/components/player-elevate-pointcard2.js +124 -0
- package/dist/esm/bonus-elevate-shop.js +17 -0
- package/dist/esm/bonus-elevate-shop_4.entry.js +780 -0
- package/dist/esm/index-2b126a46.js +1651 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/player-elevate-card-items-88f5a140.js +2464 -0
- package/dist/esm/player-elevate-card.entry.js +73 -0
- package/dist/esm/player-elevate-loyaltycard.entry.js +80 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/static/button-default.svg +42 -0
- package/dist/static/button-disabled.svg +4 -0
- package/dist/static/button-hover.svg +4 -0
- package/dist/static/button-level.svg +27 -0
- package/dist/static/button-pressed.svg +18 -0
- package/dist/static/button-redeem.svg +36 -0
- package/dist/static/card-ground-over.png +0 -0
- package/dist/static/card-ground-over.svg +903 -0
- package/dist/static/card-ground.png +0 -0
- package/dist/static/card-ground.svg +34 -0
- package/dist/static/info.svg +4 -0
- package/dist/static/level-badge.png +0 -0
- package/dist/static/level-percent.svg +80 -0
- package/dist/static/tips-info.svg +21 -0
- package/dist/static/user.svg +3 -0
- package/dist/stencil.config.js +34 -0
- package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/emfe-widgets/widgets-stencil/packages/bonus-elevate-shop/.stencil/packages/bonus-elevate-shop/stencil.config.d.ts +2 -0
- package/dist/types/components/bonus-elevate-shop/bonus-elevate-shop.d.ts +36 -0
- package/dist/types/components.d.ts +85 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/renders/renderGifts.d.ts +3 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/fetch.d.ts +3 -0
- package/dist/types/utils/translation.d.ts +7 -0
- package/dist/types/utils/types.d.ts +12 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +27 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { h, proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$4 } from './general-styling-wrapper2.js';
|
|
3
|
+
import { d as defineCustomElement$3 } from './player-elevate-card-data2.js';
|
|
4
|
+
import { d as defineCustomElement$2 } from './player-elevate-pointcard2.js';
|
|
5
|
+
|
|
6
|
+
const getUrl = (path, params = {}) => {
|
|
7
|
+
return path + '?' + Object.keys(params).map(key => `${key}=${params[key]}`).join('&');
|
|
8
|
+
};
|
|
9
|
+
const fetcher = async (input, init = {}) => {
|
|
10
|
+
let res;
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
res = await fetch(input, init);
|
|
13
|
+
res = await res.text();
|
|
14
|
+
try {
|
|
15
|
+
res = JSON.parse(res);
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
console.error(e);
|
|
19
|
+
}
|
|
20
|
+
return res;
|
|
21
|
+
};
|
|
22
|
+
async function fetchNorwayApi(path, params = {}, init = {}) {
|
|
23
|
+
const { endpoint, language, session } = this;
|
|
24
|
+
const fetchParams = params;
|
|
25
|
+
if (!init.method || init.method === 'GET') {
|
|
26
|
+
fetchParams.language = language;
|
|
27
|
+
}
|
|
28
|
+
const url = getUrl(`${endpoint}${path}`, fetchParams);
|
|
29
|
+
if (!init.headers)
|
|
30
|
+
init.headers = {};
|
|
31
|
+
init.headers['x-SessionId'] = session;
|
|
32
|
+
const res = await fetcher(url, init);
|
|
33
|
+
return res;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const translation = {
|
|
37
|
+
en: {
|
|
38
|
+
Points: 'Points',
|
|
39
|
+
Point: 'Point',
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const avaliableTrueSvg = `<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
44
|
+
<g filter="url(#filter0_bd_179_6145)">
|
|
45
|
+
<circle cx="23" cy="19" r="19" style="fill: var(--emfe-w-elevate-avaliable-button-enabled-color, #53B65C);" />
|
|
46
|
+
<circle cx="23" cy="19" r="18" stroke="url(#paint0_linear_179_6145)" stroke-opacity="0.6" stroke-width="2"/>
|
|
47
|
+
<circle cx="23" cy="19" r="18" stroke="url(#paint1_linear_179_6145)" stroke-width="2"/>
|
|
48
|
+
<circle cx="23" cy="19" r="18" stroke="url(#paint2_linear_179_6145)" stroke-width="2"/>
|
|
49
|
+
</g>
|
|
50
|
+
<g filter="url(#filter1_d_179_6145)">
|
|
51
|
+
<path d="M31.1977 11C31.7015 11 32.1279 11.1777 32.4767 11.5332C32.8256 11.8887 33 12.3203 33 12.8281V18.9102C33 20.2852 32.7364 21.5977 32.2093 22.8477C31.6822 24.0977 30.9748 25.1719 30.0872 26.0703C29.1996 26.9688 28.1376 27.6816 26.9012 28.209C25.6647 28.7363 24.3682 29 23.0116 29C21.6473 29 20.3469 28.7363 19.1105 28.209C17.874 27.6816 16.8101 26.9688 15.9186 26.0703C15.0271 25.1719 14.3178 24.0977 13.7907 22.8477C13.2636 21.5977 13 20.2852 13 18.9102V12.8281C13 12.3281 13.1783 11.8984 13.5349 11.5391C13.8915 11.1797 14.3178 11 14.814 11H31.1977ZM23.0116 23.4688C23.376 23.4688 23.6938 23.3398 23.9651 23.082L28.6628 18.5352C28.9496 18.2617 29.093 17.9297 29.093 17.5391C29.093 17.1562 28.9593 16.8301 28.6919 16.5605C28.4244 16.291 28.1008 16.1562 27.7209 16.1562C27.3566 16.1562 27.0388 16.2852 26.7674 16.543L23.0116 20.1758L19.2558 16.543C18.9845 16.2852 18.6705 16.1562 18.314 16.1562C17.9341 16.1562 17.6105 16.291 17.343 16.5605C17.0756 16.8301 16.9419 17.1562 16.9419 17.5391C16.9419 17.9375 17.0814 18.2695 17.3605 18.5352L22.0698 23.082C22.3256 23.3398 22.6395 23.4688 23.0116 23.4688Z" fill="white"/>
|
|
52
|
+
</g>
|
|
53
|
+
<defs>
|
|
54
|
+
<filter id="filter0_bd_179_6145" x="-36" y="-40" width="118" height="118" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
55
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
56
|
+
<feGaussianBlur in="BackgroundImageFix" stdDeviation="20"/>
|
|
57
|
+
<feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_179_6145"/>
|
|
58
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
59
|
+
<feOffset dy="4"/>
|
|
60
|
+
<feGaussianBlur stdDeviation="2"/>
|
|
61
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
62
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
|
63
|
+
<feBlend mode="normal" in2="effect1_backgroundBlur_179_6145" result="effect2_dropShadow_179_6145"/>
|
|
64
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_179_6145" result="shape"/>
|
|
65
|
+
</filter>
|
|
66
|
+
<filter id="filter1_d_179_6145" x="11" y="10" width="24" height="22" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
67
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
68
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
69
|
+
<feOffset dy="1"/>
|
|
70
|
+
<feGaussianBlur stdDeviation="1"/>
|
|
71
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
72
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
|
73
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_179_6145"/>
|
|
74
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_179_6145" result="shape"/>
|
|
75
|
+
</filter>
|
|
76
|
+
<linearGradient id="paint0_linear_179_6145" x1="49.2869" y1="15.1911" x2="36.3103" y2="15.603" gradientUnits="userSpaceOnUse">
|
|
77
|
+
<stop stop-color="white"/>
|
|
78
|
+
<stop offset="1" stop-color="#EFEFEF" stop-opacity="0"/>
|
|
79
|
+
</linearGradient>
|
|
80
|
+
<linearGradient id="paint1_linear_179_6145" x1="4" y1="0" x2="19.3776" y2="8.17396" gradientUnits="userSpaceOnUse">
|
|
81
|
+
<stop stop-color="white" stop-opacity="0.5"/>
|
|
82
|
+
<stop offset="1" stop-color="white" stop-opacity="0"/>
|
|
83
|
+
</linearGradient>
|
|
84
|
+
<linearGradient id="paint2_linear_179_6145" x1="42" y1="38" x2="27.0558" y2="34.3156" gradientUnits="userSpaceOnUse">
|
|
85
|
+
<stop stop-color="white" stop-opacity="0.5"/>
|
|
86
|
+
<stop offset="1" stop-color="white" stop-opacity="0"/>
|
|
87
|
+
</linearGradient>
|
|
88
|
+
</defs>
|
|
89
|
+
</svg>
|
|
90
|
+
`;
|
|
91
|
+
|
|
92
|
+
const avaliableFalseSvg = `<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
93
|
+
<g filter="url(#filter0_bd_183_6497)">
|
|
94
|
+
<circle cx="23" cy="19" r="19" style="fill: var(--emfe-w-elevate-avaliable-button-disabled-color, #B7B7B7);" />
|
|
95
|
+
<circle cx="23" cy="19" r="18" stroke="url(#paint0_linear_183_6497)" stroke-opacity="0.6" stroke-width="2"/>
|
|
96
|
+
<circle cx="23" cy="19" r="18" stroke="url(#paint1_linear_183_6497)" stroke-width="2"/>
|
|
97
|
+
<circle cx="23" cy="19" r="18" stroke="url(#paint2_linear_183_6497)" stroke-width="2"/>
|
|
98
|
+
</g>
|
|
99
|
+
<g filter="url(#filter1_d_183_6497)">
|
|
100
|
+
<path d="M31.1977 11C31.7015 11 32.1279 11.1777 32.4767 11.5332C32.8256 11.8887 33 12.3203 33 12.8281V18.9102C33 20.2852 32.7364 21.5977 32.2093 22.8477C31.6822 24.0977 30.9748 25.1719 30.0872 26.0703C29.1996 26.9688 28.1376 27.6816 26.9012 28.209C25.6647 28.7363 24.3682 29 23.0116 29C21.6473 29 20.3469 28.7363 19.1105 28.209C17.874 27.6816 16.8101 26.9688 15.9186 26.0703C15.0271 25.1719 14.3178 24.0977 13.7907 22.8477C13.2636 21.5977 13 20.2852 13 18.9102V12.8281C13 12.3281 13.1783 11.8984 13.5349 11.5391C13.8915 11.1797 14.3178 11 14.814 11H31.1977ZM23.0116 23.4688C23.376 23.4688 23.6938 23.3398 23.9651 23.082L28.6628 18.5352C28.9496 18.2617 29.093 17.9297 29.093 17.5391C29.093 17.1562 28.9593 16.8301 28.6919 16.5605C28.4244 16.291 28.1008 16.1562 27.7209 16.1562C27.3566 16.1562 27.0388 16.2852 26.7674 16.543L23.0116 20.1758L19.2558 16.543C18.9845 16.2852 18.6705 16.1562 18.314 16.1562C17.9341 16.1562 17.6105 16.291 17.343 16.5605C17.0756 16.8301 16.9419 17.1562 16.9419 17.5391C16.9419 17.9375 17.0814 18.2695 17.3605 18.5352L22.0698 23.082C22.3256 23.3398 22.6395 23.4688 23.0116 23.4688Z" fill="#F0F0F0"/>
|
|
101
|
+
</g>
|
|
102
|
+
<defs>
|
|
103
|
+
<filter id="filter0_bd_183_6497" x="-36" y="-40" width="118" height="118" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
104
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
105
|
+
<feGaussianBlur in="BackgroundImageFix" stdDeviation="20"/>
|
|
106
|
+
<feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_183_6497"/>
|
|
107
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
108
|
+
<feOffset dy="4"/>
|
|
109
|
+
<feGaussianBlur stdDeviation="2"/>
|
|
110
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
111
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
|
112
|
+
<feBlend mode="normal" in2="effect1_backgroundBlur_183_6497" result="effect2_dropShadow_183_6497"/>
|
|
113
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_183_6497" result="shape"/>
|
|
114
|
+
</filter>
|
|
115
|
+
<filter id="filter1_d_183_6497" x="11" y="10" width="24" height="22" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
116
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
117
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
118
|
+
<feOffset dy="1"/>
|
|
119
|
+
<feGaussianBlur stdDeviation="1"/>
|
|
120
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
121
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
|
122
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_183_6497"/>
|
|
123
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_183_6497" result="shape"/>
|
|
124
|
+
</filter>
|
|
125
|
+
<linearGradient id="paint0_linear_183_6497" x1="49.2869" y1="15.1911" x2="36.3103" y2="15.603" gradientUnits="userSpaceOnUse">
|
|
126
|
+
<stop stop-color="white"/>
|
|
127
|
+
<stop offset="1" stop-color="#EFEFEF" stop-opacity="0"/>
|
|
128
|
+
</linearGradient>
|
|
129
|
+
<linearGradient id="paint1_linear_183_6497" x1="4" y1="0" x2="19.3776" y2="8.17396" gradientUnits="userSpaceOnUse">
|
|
130
|
+
<stop stop-color="white" stop-opacity="0.5"/>
|
|
131
|
+
<stop offset="1" stop-color="white" stop-opacity="0"/>
|
|
132
|
+
</linearGradient>
|
|
133
|
+
<linearGradient id="paint2_linear_183_6497" x1="42" y1="38" x2="27.0558" y2="34.3156" gradientUnits="userSpaceOnUse">
|
|
134
|
+
<stop stop-color="white" stop-opacity="0.5"/>
|
|
135
|
+
<stop offset="1" stop-color="white" stop-opacity="0"/>
|
|
136
|
+
</linearGradient>
|
|
137
|
+
</defs>
|
|
138
|
+
</svg>
|
|
139
|
+
`;
|
|
140
|
+
|
|
141
|
+
const getStatusData = (gift, redeem) => {
|
|
142
|
+
switch (gift.available) {
|
|
143
|
+
case "true":
|
|
144
|
+
return {
|
|
145
|
+
extraClass: ' active',
|
|
146
|
+
onClick: () => redeem(gift.id),
|
|
147
|
+
icon: avaliableTrueSvg
|
|
148
|
+
};
|
|
149
|
+
case "false":
|
|
150
|
+
return {
|
|
151
|
+
extraClass: ' deactive',
|
|
152
|
+
onClick: () => { },
|
|
153
|
+
icon: avaliableFalseSvg
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
const renderGifts = (gifts, locale, redeem) => {
|
|
158
|
+
return (h("div", { class: "Gifts FlexLayout" }, gifts.map(gift => {
|
|
159
|
+
var _a;
|
|
160
|
+
const statusData = getStatusData(gift, redeem);
|
|
161
|
+
const presentation = gift.presentation;
|
|
162
|
+
const getPropForBackgroundImage = (asset) => asset ?
|
|
163
|
+
{ backgroundImage: `url('${asset}')` } :
|
|
164
|
+
{};
|
|
165
|
+
return (h("div", { class: "Gift" },
|
|
166
|
+
h("div", { class: "ImgContainer", onClick: () => window.postMessage({ type: 'BEEShopImgClicked', itemId: gift.id }, window.location.href), style: Object.assign({}, getPropForBackgroundImage(((_a = presentation.assets) === null || _a === void 0 ? void 0 : _a.length) > 0 ? presentation.assets[0] : '')) }),
|
|
167
|
+
h("div", { class: "InfoContainer" },
|
|
168
|
+
h("div", null,
|
|
169
|
+
h("div", { class: "Point" },
|
|
170
|
+
gift.points,
|
|
171
|
+
" ",
|
|
172
|
+
gift.points === 1 ? locale.Point : locale.Points),
|
|
173
|
+
h("div", { class: "Title" }, (presentation === null || presentation === void 0 ? void 0 : presentation.displayName) || gift.displayName),
|
|
174
|
+
h("div", { class: "Description" }, (presentation === null || presentation === void 0 ? void 0 : presentation.description) || '')),
|
|
175
|
+
h("div", { class: "AvaliableWrap" + statusData.extraClass, onClick: () => statusData.onClick() },
|
|
176
|
+
h("span", { innerHTML: statusData.icon })))));
|
|
177
|
+
})));
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const bonusElevateShopCss = ":host{display:block}svg circle{shape-rendering:crispEdges}.MainContainer{max-width:420px}.MainContainer player-elevate-pointcard{width:100%;height:220px}.Gifts{display:flex;justify-content:space-between;padding:15px;padding-left:-8px;padding-right:-8px;flex:0 0 45.1282051282%;flex-wrap:wrap;justify-content:flex-start;background:var(--emfe-w-color-white, #FFFFFF);color:var(--emfe-w-color-black-150, #000000);font-weight:500;gap:10px;margin-top:-100px;position:relative;min-height:200px}.InfoContainer{display:flex;margin-top:17px;justify-content:space-between}.Gift{display:block;margin-bottom:10px;padding:8px;box-shadow:0px 18px 45px 0px var(--emfe-w-color-black-150, #A7A7A733);border-radius:11px;background:var(--emfe-w-color-white, #FFFFFF)}.Gift .ImgContainer{width:160px;height:107px;border-radius:11px;box-shadow:0px 2px 6px 0px var(--emfe-w-color-black-200, #00000040);cursor:pointer;background-size:cover;background-position:center center;background-repeat:no-repeat}.Gift .Point{font-size:20px}.Gift .Title,.Gift .Description{padding-left:3px}.Gift .Title{font-size:14px;margin-top:10px}.Gift .Description{font-size:12px;color:var(--emfe-w-color-black-100, #767171)}.Gift .AvaliableWrap{align-self:self-end}.Gift .AvaliableWrap.active{cursor:pointer}.Gift .AvaliableWrap.deactive{cursor:not-allowed}.Gift .AvaliableWrap span svg{width:var(--emfe-w-elevate-avaliable-button-size, 46px)}";
|
|
181
|
+
|
|
182
|
+
const BonusElevateShop$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
183
|
+
constructor() {
|
|
184
|
+
super();
|
|
185
|
+
this.__registerHost();
|
|
186
|
+
this.__attachShadow();
|
|
187
|
+
/**
|
|
188
|
+
* Language of the widget
|
|
189
|
+
*/
|
|
190
|
+
this.language = 'en';
|
|
191
|
+
/**
|
|
192
|
+
* Client custom styling via string
|
|
193
|
+
*/
|
|
194
|
+
this.clientStyling = '';
|
|
195
|
+
/**
|
|
196
|
+
* Client custom styling via url
|
|
197
|
+
*/
|
|
198
|
+
this.clientStylingUrl = '';
|
|
199
|
+
/**
|
|
200
|
+
* translation via url
|
|
201
|
+
*/
|
|
202
|
+
this.translationUrl = '';
|
|
203
|
+
this.locale = translation['en'];
|
|
204
|
+
this.gifts = [];
|
|
205
|
+
}
|
|
206
|
+
async updateGifts() {
|
|
207
|
+
const res = await fetchNorwayApi.bind(this, '/v1/elevate/shop', {}).call();
|
|
208
|
+
this.gifts = res.data || [];
|
|
209
|
+
}
|
|
210
|
+
async redeemGift(id) {
|
|
211
|
+
if (!confirm('Are you sure to redeem this gift?'))
|
|
212
|
+
return;
|
|
213
|
+
const res = await fetchNorwayApi.bind(this, '/v1/elevate/redeem', {}, {
|
|
214
|
+
method: 'PUT',
|
|
215
|
+
body: JSON.stringify({ giftID: id }),
|
|
216
|
+
headers: {
|
|
217
|
+
'Content-Type': 'application/json-patch+json',
|
|
218
|
+
}
|
|
219
|
+
}).call();
|
|
220
|
+
if (res.success) {
|
|
221
|
+
window.postMessage({ type: 'BEEGiftRedeem', itemId: id }, window.location.href);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
render() {
|
|
225
|
+
return (h("main", { class: "MainContainer" }, h("general-styling-wrapper", { clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: translation, translationUrl: this.translationUrl }), h("player-elevate-pointcard", { endpoint: this.endpoint, session: this.session, language: this.language, clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling, translationUrl: this.translationUrl }), renderGifts(this.gifts, this.locale, this.redeemGift.bind(this))));
|
|
226
|
+
}
|
|
227
|
+
async componentDidLoad() {
|
|
228
|
+
this.updateGifts();
|
|
229
|
+
}
|
|
230
|
+
static get assetsDirs() { return ["static"]; }
|
|
231
|
+
static get watchers() { return {
|
|
232
|
+
"endpoint": ["updateGifts"],
|
|
233
|
+
"language": ["updateGifts"],
|
|
234
|
+
"session": ["updateGifts"]
|
|
235
|
+
}; }
|
|
236
|
+
static get style() { return bonusElevateShopCss; }
|
|
237
|
+
}, [1, "bonus-elevate-shop", {
|
|
238
|
+
"session": [513],
|
|
239
|
+
"endpoint": [513],
|
|
240
|
+
"language": [513],
|
|
241
|
+
"clientStyling": [513, "client-styling"],
|
|
242
|
+
"clientStylingUrl": [513, "client-styling-url"],
|
|
243
|
+
"translationUrl": [513, "translation-url"],
|
|
244
|
+
"locale": [32],
|
|
245
|
+
"gifts": [32]
|
|
246
|
+
}]);
|
|
247
|
+
function defineCustomElement$1() {
|
|
248
|
+
if (typeof customElements === "undefined") {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
const components = ["bonus-elevate-shop", "general-styling-wrapper", "player-elevate-card-data", "player-elevate-pointcard"];
|
|
252
|
+
components.forEach(tagName => { switch (tagName) {
|
|
253
|
+
case "bonus-elevate-shop":
|
|
254
|
+
if (!customElements.get(tagName)) {
|
|
255
|
+
customElements.define(tagName, BonusElevateShop$1);
|
|
256
|
+
}
|
|
257
|
+
break;
|
|
258
|
+
case "general-styling-wrapper":
|
|
259
|
+
if (!customElements.get(tagName)) {
|
|
260
|
+
defineCustomElement$4();
|
|
261
|
+
}
|
|
262
|
+
break;
|
|
263
|
+
case "player-elevate-card-data":
|
|
264
|
+
if (!customElements.get(tagName)) {
|
|
265
|
+
defineCustomElement$3();
|
|
266
|
+
}
|
|
267
|
+
break;
|
|
268
|
+
case "player-elevate-pointcard":
|
|
269
|
+
if (!customElements.get(tagName)) {
|
|
270
|
+
defineCustomElement$2();
|
|
271
|
+
}
|
|
272
|
+
break;
|
|
273
|
+
} });
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const BonusElevateShop = BonusElevateShop$1;
|
|
277
|
+
const defineCustomElement = defineCustomElement$1;
|
|
278
|
+
|
|
279
|
+
export { BonusElevateShop, defineCustomElement };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { G as GeneralStylingWrapper$1, d as defineCustomElement$1 } from './general-styling-wrapper2.js';
|
|
2
|
+
|
|
3
|
+
const GeneralStylingWrapper = GeneralStylingWrapper$1;
|
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
|
5
|
+
|
|
6
|
+
export { GeneralStylingWrapper, defineCustomElement };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const mergeTranslations = (url, target) => {
|
|
4
|
+
return new Promise((resolve) => {
|
|
5
|
+
fetch(url)
|
|
6
|
+
.then((res) => res.json())
|
|
7
|
+
.then((data) => {
|
|
8
|
+
Object.keys(data).forEach((item) => {
|
|
9
|
+
target[item] = target[item] ? target[item] : {};
|
|
10
|
+
for (let key in data[item]) {
|
|
11
|
+
target[item][key] = data[item][key];
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
resolve(true);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const generalStylingWrapperCss = ":host{display:block}";
|
|
20
|
+
|
|
21
|
+
const GeneralStylingWrapper = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
this.__registerHost();
|
|
25
|
+
/**
|
|
26
|
+
* Client custom styling via inline styles
|
|
27
|
+
*/
|
|
28
|
+
this.clientStyling = '';
|
|
29
|
+
/**
|
|
30
|
+
* Client custom styling via url
|
|
31
|
+
*/
|
|
32
|
+
this.clientStylingUrl = '';
|
|
33
|
+
/**
|
|
34
|
+
* Translation via url
|
|
35
|
+
*/
|
|
36
|
+
this.translationUrl = '';
|
|
37
|
+
this.stylingAppends = false;
|
|
38
|
+
this.setClientStyling = () => {
|
|
39
|
+
let sheet = document.createElement('style');
|
|
40
|
+
sheet.innerHTML = this.clientStyling;
|
|
41
|
+
this.el.prepend(sheet);
|
|
42
|
+
};
|
|
43
|
+
this.setClientStylingURL = () => {
|
|
44
|
+
let url = new URL(this.clientStylingUrl);
|
|
45
|
+
let cssFile = document.createElement('style');
|
|
46
|
+
fetch(url.href)
|
|
47
|
+
.then((res) => res.text())
|
|
48
|
+
.then((data) => {
|
|
49
|
+
cssFile.innerHTML = data;
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
this.el.prepend(cssFile);
|
|
52
|
+
}, 1);
|
|
53
|
+
})
|
|
54
|
+
.catch((err) => {
|
|
55
|
+
console.log('error ', err);
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
componentDidRender() {
|
|
60
|
+
// start custom styling area
|
|
61
|
+
if (!this.stylingAppends) {
|
|
62
|
+
if (this.clientStyling)
|
|
63
|
+
this.setClientStyling();
|
|
64
|
+
if (this.clientStylingUrl)
|
|
65
|
+
this.setClientStylingURL();
|
|
66
|
+
this.stylingAppends = true;
|
|
67
|
+
}
|
|
68
|
+
// end custom styling area
|
|
69
|
+
}
|
|
70
|
+
async componentWillLoad() {
|
|
71
|
+
const promises = [];
|
|
72
|
+
if (this.translationUrl) {
|
|
73
|
+
const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
|
|
74
|
+
promises.push(translationPromise);
|
|
75
|
+
}
|
|
76
|
+
return await Promise.all(promises);
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
return (h("div", { class: "StyleShell" }, h("slot", { name: "mainContent" })));
|
|
80
|
+
}
|
|
81
|
+
get el() { return this; }
|
|
82
|
+
static get style() { return generalStylingWrapperCss; }
|
|
83
|
+
}, [4, "general-styling-wrapper", {
|
|
84
|
+
"clientStyling": [1, "client-styling"],
|
|
85
|
+
"clientStylingUrl": [1, "client-styling-url"],
|
|
86
|
+
"translationUrl": [1, "translation-url"],
|
|
87
|
+
"targetTranslations": [16]
|
|
88
|
+
}]);
|
|
89
|
+
function defineCustomElement() {
|
|
90
|
+
if (typeof customElements === "undefined") {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const components = ["general-styling-wrapper"];
|
|
94
|
+
components.forEach(tagName => { switch (tagName) {
|
|
95
|
+
case "general-styling-wrapper":
|
|
96
|
+
if (!customElements.get(tagName)) {
|
|
97
|
+
customElements.define(tagName, GeneralStylingWrapper);
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
} });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export { GeneralStylingWrapper as G, defineCustomElement as d };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* BonusElevateShop custom elements */
|
|
2
|
+
|
|
3
|
+
import type { Components, JSX } from "../types/components";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Used to manually set the base path where assets can be found.
|
|
7
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
8
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
9
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
10
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
11
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
12
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
13
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
14
|
+
*/
|
|
15
|
+
export declare const setAssetPath: (path: string) => void;
|
|
16
|
+
|
|
17
|
+
export interface SetPlatformOptions {
|
|
18
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
19
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
+
|
|
24
|
+
export type { Components, JSX };
|
|
25
|
+
|
|
26
|
+
export * from '../types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { P as PlayerElevateCardData$1, d as defineCustomElement$1 } from './player-elevate-card-data2.js';
|
|
2
|
+
|
|
3
|
+
const PlayerElevateCardData = PlayerElevateCardData$1;
|
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
|
5
|
+
|
|
6
|
+
export { PlayerElevateCardData, defineCustomElement };
|