@everymatrix/player-withdrawal 0.0.363 → 0.0.367
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/README.md +30 -30
- package/dist/player-withdrawal.js.map +1 -1
- package/index.html +21 -21
- package/index.js +1 -1
- package/package.json +2 -2
- package/public/reset.css +47 -47
- package/rollup.config.js +67 -67
- package/src/PlayerWithdrawal.svelte +176 -176
- package/src/i18n.js +27 -27
- package/src/index.ts +4 -4
- package/src/translations.js +38 -38
- package/stories/PlayerWithdrawal.stories.js +13 -13
- package/tsconfig.json +6 -6
package/index.html
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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-withdrawal
|
|
9
|
-
</title>
|
|
10
|
-
<link rel="stylesheet" href="public/reset.css">
|
|
11
|
-
<script src='dist/player-withdrawal.js'></script>
|
|
12
|
-
</head>
|
|
13
|
-
|
|
14
|
-
<body>
|
|
15
|
-
|
|
16
|
-
<div class="webcomponent">
|
|
17
|
-
<player-withdrawal></player-withdrawal>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
</body>
|
|
21
|
-
</html>
|
|
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-withdrawal
|
|
9
|
+
</title>
|
|
10
|
+
<link rel="stylesheet" href="public/reset.css">
|
|
11
|
+
<script src='dist/player-withdrawal.js'></script>
|
|
12
|
+
</head>
|
|
13
|
+
|
|
14
|
+
<body>
|
|
15
|
+
|
|
16
|
+
<div class="webcomponent">
|
|
17
|
+
<player-withdrawal></player-withdrawal>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import './dist/player-withdrawal.js';
|
|
1
|
+
import './dist/player-withdrawal.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/player-withdrawal",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.367",
|
|
4
4
|
"main": "dist/player-withdrawal",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "2862d37a634bee597aaac02d75aead918718617d"
|
|
40
40
|
}
|
package/public/reset.css
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
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;
|
|
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
48
|
}
|
package/rollup.config.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
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-withdrawal.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
|
+
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-withdrawal.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,176 +1,176 @@
|
|
|
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 { PlayerWithdrawalTranslations } 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
|
-
|
|
13
|
-
let userAgent:string = window.navigator.userAgent;
|
|
14
|
-
let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
|
|
15
|
-
let isLoading:boolean = true;
|
|
16
|
-
|
|
17
|
-
let currency:string = '';
|
|
18
|
-
let amount:number = 0;
|
|
19
|
-
let iframeUrl:string = '';
|
|
20
|
-
|
|
21
|
-
Object.keys(PlayerWithdrawalTranslations).forEach((item:any) => {
|
|
22
|
-
addNewMessages(item, PlayerWithdrawalTranslations[item]);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const toggleScreen = ():void => {
|
|
26
|
-
window.postMessage({type: 'PlayerAccountMenuActive', isMobile}, window.location.href);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const messageHandler = (e:any):void => {
|
|
30
|
-
if (e.data) {
|
|
31
|
-
switch(e.data.type) {
|
|
32
|
-
case 'ProfileDetailsData':
|
|
33
|
-
currency = e.data.profileDetails.currency;
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
switch(e.data.redirect) {
|
|
38
|
-
case 'mm-hc-casino':
|
|
39
|
-
window.postMessage({ type: 'GoToCasino' }, window.location.href);
|
|
40
|
-
break;
|
|
41
|
-
|
|
42
|
-
case 'mm-hc-sports':
|
|
43
|
-
window.postMessage({ type: 'GoToSports' }, window.location.href);
|
|
44
|
-
break;
|
|
45
|
-
|
|
46
|
-
case 'mm-hc-contact':
|
|
47
|
-
window.postMessage({ type: 'GoToCustomerSupport' }, window.location.href);
|
|
48
|
-
break;
|
|
49
|
-
|
|
50
|
-
case 'mm-hc-back-to-merchant':
|
|
51
|
-
window.postMessage({ type: 'GoToHomepage' }, window.location.href);
|
|
52
|
-
break;
|
|
53
|
-
|
|
54
|
-
case 'mm-wm-hc-init-deposit':
|
|
55
|
-
window.postMessage({ type: 'ChangeAccountPage', page: {path: "/deposit", id: 469}}, window.location.href);
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const getWithdrawalIframe = ():void => {
|
|
62
|
-
let url:URL = new URL(`${endpoint}/player/${playerid}/hostedcashier/initializewithdraw`);
|
|
63
|
-
|
|
64
|
-
let options = {
|
|
65
|
-
method: "POST",
|
|
66
|
-
headers: {
|
|
67
|
-
'X-SessionId': session,
|
|
68
|
-
currency,
|
|
69
|
-
amount,
|
|
70
|
-
cashierMode: 'Default',
|
|
71
|
-
IsShortCashier: false,
|
|
72
|
-
accept: 'application/json'
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
fetch(url.href, options)
|
|
77
|
-
.then((res:any) => res.json())
|
|
78
|
-
.then((data:any) => {
|
|
79
|
-
|
|
80
|
-
isLoading = false;
|
|
81
|
-
|
|
82
|
-
iframeUrl = data.CashierUrl;
|
|
83
|
-
|
|
84
|
-
}, (err:any) => {
|
|
85
|
-
console.error(err);
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const setActiveLanguage = ():void => {
|
|
90
|
-
setLocale(lang);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
onMount(() => {
|
|
94
|
-
window.addEventListener('message', messageHandler, false);
|
|
95
|
-
|
|
96
|
-
return () => {
|
|
97
|
-
window.removeEventListener('message', messageHandler);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
$: lang && setActiveLanguage();
|
|
102
|
-
$: session && playerid && endpoint && getWithdrawalIframe();
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
<div class="WithdrawalWrapper {isMobile ? 'WithdrawalWrapperMobile' : ''}" part="WithdrawalWrapper {isMobile ? 'WithdrawalWrapperMobile' : ''}">
|
|
106
|
-
{#if isMobile}
|
|
107
|
-
<div class="MenuReturnButton" part="MenuReturnButton" on:click={() => toggleScreen()}>
|
|
108
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><defs><style>.aaa{fill:var(--emfe-w-color-primary, #D0046C);}</style></defs><g transform="translate(-20 -158)">
|
|
109
|
-
<g transform="translate(20 158)">
|
|
110
|
-
<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)"/>
|
|
111
|
-
</g></g>
|
|
112
|
-
</svg>
|
|
113
|
-
<h2 class="WithdrawalTitleMobile" part="WithdrawalTitleMobile">{$_('withdrawal.title')}</h2>
|
|
114
|
-
</div>
|
|
115
|
-
{/if}
|
|
116
|
-
<h2 class="WithdrawalTitle {isMobile ? 'WithdrawalTitleNone' : ''}" part="WithdrawalTitle {isMobile ? 'WithdrawalTitleNone' : ''}">{$_('withdrawal.title')}</h2>
|
|
117
|
-
{#if isLoading}
|
|
118
|
-
<p>{$_('withdrawal.loading')}</p>
|
|
119
|
-
{:else}
|
|
120
|
-
<div class="WithdrawalIframeWrapper" part="WithdrawalIframeWrapper">
|
|
121
|
-
<iframe src={iframeUrl} title="Withdrawal Iframe"></iframe>
|
|
122
|
-
</div>
|
|
123
|
-
{/if}
|
|
124
|
-
</div>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
<style lang="scss">
|
|
128
|
-
|
|
129
|
-
:host {
|
|
130
|
-
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.WithdrawalWrapper {
|
|
134
|
-
color: var(--emfe-w-color-contrast, #07072A);
|
|
135
|
-
padding: 50px 50px 30px 50px;
|
|
136
|
-
max-width: 100%;
|
|
137
|
-
|
|
138
|
-
&.WithdrawalWrapperMobile {
|
|
139
|
-
padding: 20px 15px;
|
|
140
|
-
max-width: unset;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.MenuReturnButton{
|
|
145
|
-
color: var(--emfe-w-color-primary, #D0046C);
|
|
146
|
-
display: inline-flex;
|
|
147
|
-
align-items: center;
|
|
148
|
-
column-gap: 10px;
|
|
149
|
-
margin-bottom: 10px;
|
|
150
|
-
& svg {
|
|
151
|
-
fill: var(--emfe-w-color-primary, #D0046C);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.WithdrawalTitle {
|
|
156
|
-
font-size: 26px;
|
|
157
|
-
color: var(--emfe-w-color-primary, #D0046C);
|
|
158
|
-
font-weight: 400;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.WithdrawalTitleMobile {
|
|
162
|
-
font-size: 16px;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.WithdrawalTitleNone {
|
|
166
|
-
display: none;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.WithdrawalIframeWrapper {
|
|
170
|
-
iframe {
|
|
171
|
-
border: none;
|
|
172
|
-
width: 100%;
|
|
173
|
-
height: 85vh;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
</style>
|
|
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 { PlayerWithdrawalTranslations } 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
|
+
|
|
13
|
+
let userAgent:string = window.navigator.userAgent;
|
|
14
|
+
let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
|
|
15
|
+
let isLoading:boolean = true;
|
|
16
|
+
|
|
17
|
+
let currency:string = '';
|
|
18
|
+
let amount:number = 0;
|
|
19
|
+
let iframeUrl:string = '';
|
|
20
|
+
|
|
21
|
+
Object.keys(PlayerWithdrawalTranslations).forEach((item:any) => {
|
|
22
|
+
addNewMessages(item, PlayerWithdrawalTranslations[item]);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const toggleScreen = ():void => {
|
|
26
|
+
window.postMessage({type: 'PlayerAccountMenuActive', isMobile}, window.location.href);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const messageHandler = (e:any):void => {
|
|
30
|
+
if (e.data) {
|
|
31
|
+
switch(e.data.type) {
|
|
32
|
+
case 'ProfileDetailsData':
|
|
33
|
+
currency = e.data.profileDetails.currency;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
switch(e.data.redirect) {
|
|
38
|
+
case 'mm-hc-casino':
|
|
39
|
+
window.postMessage({ type: 'GoToCasino' }, window.location.href);
|
|
40
|
+
break;
|
|
41
|
+
|
|
42
|
+
case 'mm-hc-sports':
|
|
43
|
+
window.postMessage({ type: 'GoToSports' }, window.location.href);
|
|
44
|
+
break;
|
|
45
|
+
|
|
46
|
+
case 'mm-hc-contact':
|
|
47
|
+
window.postMessage({ type: 'GoToCustomerSupport' }, window.location.href);
|
|
48
|
+
break;
|
|
49
|
+
|
|
50
|
+
case 'mm-hc-back-to-merchant':
|
|
51
|
+
window.postMessage({ type: 'GoToHomepage' }, window.location.href);
|
|
52
|
+
break;
|
|
53
|
+
|
|
54
|
+
case 'mm-wm-hc-init-deposit':
|
|
55
|
+
window.postMessage({ type: 'ChangeAccountPage', page: {path: "/deposit", id: 469}}, window.location.href);
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const getWithdrawalIframe = ():void => {
|
|
62
|
+
let url:URL = new URL(`${endpoint}/player/${playerid}/hostedcashier/initializewithdraw`);
|
|
63
|
+
|
|
64
|
+
let options = {
|
|
65
|
+
method: "POST",
|
|
66
|
+
headers: {
|
|
67
|
+
'X-SessionId': session,
|
|
68
|
+
currency,
|
|
69
|
+
amount,
|
|
70
|
+
cashierMode: 'Default',
|
|
71
|
+
IsShortCashier: false,
|
|
72
|
+
accept: 'application/json'
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
fetch(url.href, options)
|
|
77
|
+
.then((res:any) => res.json())
|
|
78
|
+
.then((data:any) => {
|
|
79
|
+
|
|
80
|
+
isLoading = false;
|
|
81
|
+
|
|
82
|
+
iframeUrl = data.CashierUrl;
|
|
83
|
+
|
|
84
|
+
}, (err:any) => {
|
|
85
|
+
console.error(err);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const setActiveLanguage = ():void => {
|
|
90
|
+
setLocale(lang);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
onMount(() => {
|
|
94
|
+
window.addEventListener('message', messageHandler, false);
|
|
95
|
+
|
|
96
|
+
return () => {
|
|
97
|
+
window.removeEventListener('message', messageHandler);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
$: lang && setActiveLanguage();
|
|
102
|
+
$: session && playerid && endpoint && getWithdrawalIframe();
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<div class="WithdrawalWrapper {isMobile ? 'WithdrawalWrapperMobile' : ''}" part="WithdrawalWrapper {isMobile ? 'WithdrawalWrapperMobile' : ''}">
|
|
106
|
+
{#if isMobile}
|
|
107
|
+
<div class="MenuReturnButton" part="MenuReturnButton" on:click={() => toggleScreen()}>
|
|
108
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><defs><style>.aaa{fill:var(--emfe-w-color-primary, #D0046C);}</style></defs><g transform="translate(-20 -158)">
|
|
109
|
+
<g transform="translate(20 158)">
|
|
110
|
+
<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)"/>
|
|
111
|
+
</g></g>
|
|
112
|
+
</svg>
|
|
113
|
+
<h2 class="WithdrawalTitleMobile" part="WithdrawalTitleMobile">{$_('withdrawal.title')}</h2>
|
|
114
|
+
</div>
|
|
115
|
+
{/if}
|
|
116
|
+
<h2 class="WithdrawalTitle {isMobile ? 'WithdrawalTitleNone' : ''}" part="WithdrawalTitle {isMobile ? 'WithdrawalTitleNone' : ''}">{$_('withdrawal.title')}</h2>
|
|
117
|
+
{#if isLoading}
|
|
118
|
+
<p>{$_('withdrawal.loading')}</p>
|
|
119
|
+
{:else}
|
|
120
|
+
<div class="WithdrawalIframeWrapper" part="WithdrawalIframeWrapper">
|
|
121
|
+
<iframe src={iframeUrl} title="Withdrawal Iframe"></iframe>
|
|
122
|
+
</div>
|
|
123
|
+
{/if}
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
<style lang="scss">
|
|
128
|
+
|
|
129
|
+
:host {
|
|
130
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.WithdrawalWrapper {
|
|
134
|
+
color: var(--emfe-w-color-contrast, #07072A);
|
|
135
|
+
padding: 50px 50px 30px 50px;
|
|
136
|
+
max-width: 100%;
|
|
137
|
+
|
|
138
|
+
&.WithdrawalWrapperMobile {
|
|
139
|
+
padding: 20px 15px;
|
|
140
|
+
max-width: unset;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.MenuReturnButton{
|
|
145
|
+
color: var(--emfe-w-color-primary, #D0046C);
|
|
146
|
+
display: inline-flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
column-gap: 10px;
|
|
149
|
+
margin-bottom: 10px;
|
|
150
|
+
& svg {
|
|
151
|
+
fill: var(--emfe-w-color-primary, #D0046C);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.WithdrawalTitle {
|
|
156
|
+
font-size: 26px;
|
|
157
|
+
color: var(--emfe-w-color-primary, #D0046C);
|
|
158
|
+
font-weight: 400;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.WithdrawalTitleMobile {
|
|
162
|
+
font-size: 16px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.WithdrawalTitleNone {
|
|
166
|
+
display: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.WithdrawalIframeWrapper {
|
|
170
|
+
iframe {
|
|
171
|
+
border: none;
|
|
172
|
+
width: 100%;
|
|
173
|
+
height: 85vh;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
</style>
|