@everymatrix/player-deposit 1.43.4 → 1.45.0

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/index.html DELETED
@@ -1,21 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset='utf-8'>
5
- <meta name='viewport' content='width=device-width,initial-scale=1'>
6
-
7
- <title>
8
- player-deposit
9
- </title>
10
- <link rel="stylesheet" href="public/reset.css">
11
- <script src='dist/player-deposit.js'></script>
12
- </head>
13
-
14
- <body>
15
-
16
- <div class="webcomponent">
17
- <player-deposit></player-deposit>
18
- </div>
19
-
20
- </body>
21
- </html>
package/index.js DELETED
@@ -1 +0,0 @@
1
- import './dist/player-deposit.js';
Binary file
package/public/reset.css DELETED
@@ -1,48 +0,0 @@
1
- /* http://meyerweb.com/eric/tools/css/reset/
2
- v2.0 | 20110126
3
- License: none (public domain)
4
- */
5
-
6
- html, body, div, span, applet, object, iframe,
7
- h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8
- a, abbr, acronym, address, big, cite, code,
9
- del, dfn, em, img, ins, kbd, q, s, samp,
10
- small, strike, strong, sub, sup, tt, var,
11
- b, u, i, center,
12
- dl, dt, dd, ol, ul, li,
13
- fieldset, form, label, legend,
14
- table, caption, tbody, tfoot, thead, tr, th, td,
15
- article, aside, canvas, details, embed,
16
- figure, figcaption, footer, header, hgroup,
17
- menu, nav, output, ruby, section, summary,
18
- time, mark, audio, video {
19
- margin: 0;
20
- padding: 0;
21
- border: 0;
22
- font-size: 100%;
23
- font: inherit;
24
- vertical-align: baseline;
25
- }
26
- /* HTML5 display-role reset for older browsers */
27
- article, aside, details, figcaption, figure,
28
- footer, header, hgroup, menu, nav, section {
29
- display: block;
30
- }
31
- body {
32
- line-height: 1;
33
- }
34
- ol, ul {
35
- list-style: none;
36
- }
37
- blockquote, q {
38
- quotes: none;
39
- }
40
- blockquote:before, blockquote:after,
41
- q:before, q:after {
42
- content: '';
43
- content: none;
44
- }
45
- table {
46
- border-collapse: collapse;
47
- border-spacing: 0;
48
- }
package/rollup.config.js DELETED
@@ -1,67 +0,0 @@
1
- import svelte from 'rollup-plugin-svelte';
2
- import commonjs from '@rollup/plugin-commonjs';
3
- import resolve from '@rollup/plugin-node-resolve';
4
- import serve from 'rollup-plugin-dev-server';
5
- import livereload from 'rollup-plugin-livereload';
6
- import { terser } from 'rollup-plugin-terser';
7
- import sveltePreprocess from 'svelte-preprocess';
8
- import typescript from '@rollup/plugin-typescript';
9
- import uglify from 'rollup-plugin-uglify';
10
- import image from '@rollup/plugin-image';
11
-
12
- const production = process.env.NODE_ENV == 'production';
13
- const dev = process.env.NODE_ENV == 'development';
14
-
15
- export default {
16
- input: 'src/index.ts',
17
- output: {
18
- sourcemap: true,
19
- format: 'umd',
20
- name: 'app',
21
- file: 'dist/player-deposit.js',
22
- },
23
- plugins: [
24
- svelte({
25
- preprocess: sveltePreprocess(),
26
- compilerOptions: {
27
- // @TODO check generate and hydratable
28
- // generate: 'ssr',
29
- // hydratable: true,
30
- // enable run-time checks when not in production
31
- customElement: true,
32
- dev: !production
33
- }
34
- }),
35
- image(),
36
- commonjs(),
37
- resolve({
38
- browser: true,
39
- dedupe: ['svelte']
40
- }),
41
- dev && serve({
42
- open: true,
43
- verbose: true,
44
- allowCrossOrigin: true,
45
- historyApiFallback: false,
46
- host: 'localhost',
47
- port: 5050,
48
- }),
49
- dev && livereload({ watch: ['', 'dist'] }),
50
- typescript({
51
- sourceMap: !production,
52
- inlineSources: !production,
53
- }),
54
- // If we're building for production (npm run build
55
- // instead of npm run dev), minify
56
- production &&
57
- terser({
58
- output: {
59
- comments: "all"
60
- },
61
- }),
62
- production && uglify.uglify()
63
- ],
64
- watch: {
65
- clearScreen: false
66
- }
67
- };
@@ -1,261 +0,0 @@
1
- <svelte:options tag={null} />
2
- <script lang="ts">
3
- import { onMount } from 'svelte';
4
- import { getDevice } from 'rvhelper';
5
- import { _, addNewMessages, setLocale } from './i18n';
6
- import { TRANSLATIONS } from './translations';
7
-
8
- export let endpoint:string = '';
9
- export let session:string = '';
10
- export let playerid:string = '';
11
- export let lang:string = 'en';
12
- export let hasdefaultamount:string = '';
13
- export let clientstyling:string = '';
14
- export let clientstylingurl:string = '';
15
- export let translationurl:string = '';
16
- export let playercurrency:string = '';
17
- export let shortcashierenabled:string = 'false';
18
-
19
- let customStylingContainer:HTMLElement;
20
- let userAgent:string = window.navigator.userAgent;
21
- let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
22
- let isLoading:boolean = true;
23
- let dynamicHeight: string;
24
-
25
- let amount:number = 0;
26
- let iframeUrl:string = '';
27
-
28
- const setTranslationUrl = ():void => {
29
- let url:string = translationurl;
30
-
31
- fetch(url).then((res:any) => res.json())
32
- .then((res) => {
33
- Object.keys(res).forEach((item:any):void => {
34
- addNewMessages(item, res[item]);
35
- });
36
- }).catch((err:any) => {
37
- console.log(err);
38
- });
39
- }
40
-
41
- Object.keys(TRANSLATIONS).forEach((item:any) => {
42
- addNewMessages(item, TRANSLATIONS[item]);
43
- });
44
-
45
- const goToPreviousRoute = ():void => {
46
- window.postMessage({type: 'GoToPreviousRoute', isMobile}, window.location.href);
47
- }
48
-
49
- const messageHandler = (e:any):void => {
50
- if (e.data) {
51
- switch(e.data.type) {
52
- case 'ProfileDetailsData':
53
- playercurrency = e.data.profileDetails.currency;
54
- break;
55
- }
56
-
57
- if (e.data["MMFE:setQuickDepositHeight"]) {
58
- dynamicHeight = e.data["MMFE:setQuickDepositHeight"].toString() + 'px';
59
- }
60
-
61
- if (e.data['MMFE:openFullCashier'] === 'true') {
62
- window.postMessage({ type: 'GoToDeposit' }, window.location.href);
63
- window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
64
- }
65
-
66
- switch(e.data.redirect) {
67
- case 'mm-hc-casino':
68
- window.postMessage({ type: 'GoToCasino' }, window.location.href);
69
- break;
70
-
71
- case 'mm-hc-sports':
72
- window.postMessage({ type: 'GoToSports' }, window.location.href);
73
- break;
74
-
75
- case 'mm-hc-contact':
76
- window.postMessage({ type: 'GoToCustomerSupport' }, window.location.href);
77
- window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
78
- break;
79
-
80
- case 'mm-hc-back-to-merchant':
81
- window.postMessage({ type: 'GoToHomepage' }, window.location.href);
82
- break;
83
-
84
- case 'mm-wm-hc-init-deposit':
85
- window.postMessage({ type: 'RedirectWithdrawDepositCloseModal'}, window.location.href);
86
- break;
87
-
88
- case 'mm-wm-hc-init-deposit-quick':
89
- window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
90
- break;
91
- }
92
- }
93
- }
94
-
95
- const getDepositIframe = ():void => {
96
- let url:URL = new URL(`${endpoint}/v1/player/${playerid}/hostedcashier/initializedeposit?showBonusSelectionInput=true`);
97
-
98
- url.searchParams.append('language', lang);
99
- if (isShortCashierEnabled) {
100
- url.searchParams.append('isShortCashier' , shortcashierenabled);
101
- }
102
-
103
- if(hasdefaultamount){
104
- switch(playercurrency){
105
- case 'USD':
106
- amount = 0.40;
107
- break;
108
-
109
- case 'CDF':
110
- amount = 1000;
111
- break;
112
- }
113
- }
114
-
115
- let options:any = {
116
- method: "POST",
117
- headers: {
118
- 'X-SessionId': session,
119
- currency: playercurrency || 'EUR',
120
- amount: amount,
121
- cashierMode: 'Default',
122
- IsShortCashier: shortcashierenabled,
123
- accept: 'application/json',
124
- },
125
- };
126
-
127
- fetch(url.href, options)
128
- .then((res:any) => res.json())
129
- .then((data:any) => {
130
-
131
- isLoading = false;
132
-
133
- iframeUrl = data.CashierUrl;
134
-
135
- }, (err:any) => {
136
- console.error(err);
137
- });
138
- }
139
-
140
- const setActiveLanguage = ():void => {
141
- setLocale(lang);
142
- }
143
-
144
- const setClientStyling = ():void => {
145
- let sheet:HTMLElement = document.createElement('style');
146
- sheet.innerHTML = clientstyling;
147
- customStylingContainer.appendChild(sheet);
148
- }
149
-
150
- const setClientStylingURL = ():void => {
151
- let url:URL = new URL(clientstylingurl);
152
- let cssFile:HTMLElement = document.createElement('style');
153
-
154
- fetch(url.href)
155
- .then((res:any) => res.text())
156
- .then((data:any) => {
157
- cssFile.innerHTML = data
158
-
159
- setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
160
- });
161
- }
162
-
163
- onMount(() => {
164
- window.addEventListener('message', messageHandler, false);
165
-
166
- return () => {
167
- window.removeEventListener('message', messageHandler);
168
- }
169
- });
170
-
171
- $: lang && setActiveLanguage();
172
- $: isShortCashierEnabled = shortcashierenabled.toLocaleLowerCase() === 'true';
173
- $: clientstylingurl && customStylingContainer && setClientStylingURL();
174
- $: clientstyling && customStylingContainer && setClientStyling();
175
- $: translationurl && setTranslationUrl();
176
- $: session && playerid && endpoint && playercurrency && lang && shortcashierenabled && getDepositIframe();
177
- </script>
178
-
179
- <div class="DepositWrapper {isMobile ? 'DepositWrapperMobile' : ''} " style="--dynamic-height: {dynamicHeight}" bind:this={customStylingContainer}>
180
- {#if isMobile}
181
- <div class="MenuReturnButton" on:click={() => goToPreviousRoute()}>
182
- <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><defs><style>.aaa{fill:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));}</style></defs><g transform="translate(-20 -158)">
183
- <g transform="translate(20 158)">
184
- <path class="aaa" d="M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z" transform="translate(15 15) rotate(180)"/>
185
- </g></g>
186
- </svg>
187
- <h2 class="DepositTitleMobile">{$_('titleDeposit')}</h2>
188
- </div>
189
- {/if}
190
- <h2 class="DepositTitle {isMobile ? 'DepositTitleNone' : ''}">{$_('titleDeposit')}</h2>
191
- {#if isLoading}
192
- <p>{$_('loading')}</p>
193
- {:else}
194
- <div class="DepositIframeWrapper">
195
- <iframe src={iframeUrl} title="Deposit Iframe"></iframe>
196
- </div>
197
- {/if}
198
- </div>
199
-
200
-
201
- <style lang="scss">
202
-
203
- button {
204
- font-family: var(--emw--button-typography);
205
- }
206
-
207
- input, select, option {
208
- font-family: inherit;
209
- }
210
-
211
-
212
- .DepositWrapper {
213
- background-color: var(--emw-color-pale, var(--emw--color-gray-50, #F1F1F1));
214
- border-radius: var(--emw--border-radius-large, 20px);
215
- color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));
216
- padding: 50px 50px 30px 50px;
217
- max-width: 100%;
218
- height: var(--dynamic-height);
219
-
220
- &.DepositWrapperMobile {
221
- padding: 20px 15px;
222
- max-width: unset;
223
- height: var(--dynamic-height);
224
- }
225
- }
226
-
227
- .MenuReturnButton{
228
- color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));
229
- display: inline-flex;
230
- align-items: center;
231
- column-gap: 10px;
232
- margin-bottom: 10px;
233
- & svg {
234
- fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));
235
- }
236
- }
237
-
238
- .DepositTitle {
239
- font-size: var(--emw--font-size-x-large, 26px);
240
- color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));
241
- font-weight: var(--emw--font-weigh-normal, 400);
242
- }
243
-
244
- .DepositTitleMobile {
245
- font-size: var(--emw--size-standard, 16px);
246
- }
247
-
248
- .DepositTitleNone {
249
- display: none;
250
- }
251
-
252
- .DepositIframeWrapper {
253
- iframe {
254
- border: none;
255
- width: 100%;
256
- height: 85vh;
257
- border-radius: var(--emw--border-radius-large, 20px);
258
- }
259
- }
260
-
261
- </style>
package/src/i18n.js DELETED
@@ -1,27 +0,0 @@
1
- import {
2
- dictionary,
3
- locale,
4
- addMessages,
5
- _
6
- } from 'svelte-i18n';
7
-
8
- function setupI18n({ withLocale: _locale, translations }) {
9
- locale.subscribe((data) => {
10
- if (data == null) {
11
- dictionary.set(translations);
12
- locale.set(_locale);
13
- }
14
- }); // maybe we will need this to make sure that the i18n is set up only once
15
- /*dictionary.set(translations);
16
- locale.set(_locale);*/
17
- }
18
-
19
- function addNewMessages(lang, dict) {
20
- addMessages(lang, dict);
21
- }
22
-
23
- function setLocale(_locale) {
24
- locale.set(_locale);
25
- }
26
-
27
- export { _, setupI18n, addNewMessages, setLocale };
package/src/index.ts DELETED
@@ -1,4 +0,0 @@
1
- import PlayerDeposit from './PlayerDeposit.svelte';
2
-
3
- !customElements.get('player-deposit') && customElements.define('player-deposit', PlayerDeposit);
4
- export default PlayerDeposit;
@@ -1,42 +0,0 @@
1
- export const TRANSLATIONS = {
2
- "en": {
3
- "titleDeposit": "Deposit",
4
- "loading": "Loading, please wait ..."
5
- },
6
- "zh-hk": {
7
- "titleDeposit": "訂金",
8
- "loading": "加載請稍候…"
9
- },
10
- "fr": {
11
- "titleDeposit": "Dépôt",
12
- "loading": "Chargement, veuillez patienter ..."
13
- },
14
- "tr": {
15
- "titleDeposit": "PARA YATIR",
16
- "loading": "Yükleniyor ...",
17
- },
18
- "ro": {
19
- "titleDeposit": "Depunere",
20
- "loading": "Se încarcă..."
21
- },
22
- "es": {
23
- "titleDeposit": "Deposita",
24
- "loading": "Cargando ..."
25
- },
26
- "pt": {
27
- "titleDeposit": "Depósito",
28
- "loading": "Carregando, por favor espere ..."
29
- },
30
- "hr": {
31
- "titleDeposit": "Uplata",
32
- "loading": "Učitavanje"
33
- },
34
- "pt-br": {
35
- "titleDeposit": "Depositar",
36
- "Loading": "Carregando, por favor espere..."
37
- },
38
- "es-mx": {
39
- "titleDeposit": "Depositar",
40
- "Loading": "Cargando, por favor espere..."
41
- }
42
- }
@@ -1,13 +0,0 @@
1
- import { html } from 'lit-element';
2
-
3
- import PlayerDeposit from '../src/PlayerDeposit';
4
-
5
- // This default export determines where your story goes in the story list
6
- export default {
7
- title: 'PlayerDeposit',
8
- };
9
-
10
- // 👇 We create a “template” of how args map to rendering
11
- const PlayerDeposit = ({ aProperty }) => html`<player-deposit></player-deposit>`;
12
-
13
- export const FirstStory = PlayerDeposit.bind({});
package/tsconfig.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "@tsconfig/svelte/tsconfig.json",
3
-
4
- "include": ["src/**/*"],
5
- "exclude": ["node_modules/*", "__sapper__/*", "public/*"]
6
- }