@everymatrix/user-deposit-withdrawal 1.37.4 → 1.37.6

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.
@@ -10,18 +10,26 @@ const TRANSLATIONS = {
10
10
  en: {
11
11
  Deposit: 'Deposit',
12
12
  Withdraw: 'Withdraw',
13
+ denyDeposit: 'Please be informed that currently you are not allowed to initiate depost transactions.',
14
+ denyWithdrawal: 'Please be informed that currently you are not allowed to initiate withdrawal transactions.'
13
15
  },
14
16
  ro: {
15
17
  Deposit: 'Depozit',
16
18
  Withdraw: 'Retragere',
19
+ denyDeposit: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.',
20
+ denyWithdrawal: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere.'
17
21
  },
18
22
  fr: {
19
23
  Deposit: 'Deposit',
20
24
  Withdraw: 'Withdraw',
25
+ denyDeposit: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de dépôt.',
26
+ denyWithdrawal: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de retrait.'
21
27
  },
22
28
  hr: {
23
29
  Deposit: 'Letét',
24
- Withdraw: 'Visszavonás'
30
+ Withdraw: 'Visszavonás',
31
+ denyDeposit: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija pologa.',
32
+ denyWithdrawal: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate.'
25
33
  }
26
34
  };
27
35
  const translate = (key, customLang) => {
@@ -128,7 +136,7 @@ const UserDepositWithdrawal = class {
128
136
  }
129
137
  render() {
130
138
  return (index.h(index.Host, null, index.h("div", { ref: el => this.stylingContainer = el }, index.h("div", { class: "DepositWithdrawalWrapper", style: { height: this.dynamicHeight, marginTop: this.isShortCashier ? '30px' : '0' } }, index.h("div", null, (this.isMobile && !this.isShortCashier &&
131
- index.h("div", { class: "MenuReturnButton", onClick: () => this.toggleScreen(this.isMobile) }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, index.h("defs", null), index.h("g", { transform: "translate(-20 -158)" }, index.h("g", { transform: "translate(20 158)" }, index.h("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)" })))), index.h("h2", { class: "CategoryTitleMobile" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language))))), index.h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl })))));
139
+ index.h("div", { class: "MenuReturnButton", onClick: () => this.toggleScreen(this.isMobile) }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, index.h("defs", null), index.h("g", { transform: "translate(-20 -158)" }, index.h("g", { transform: "translate(20 158)" }, index.h("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)" })))), index.h("h2", { class: "CategoryTitleMobile" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language))))), this.cashierInfoUrl ? index.h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl }) : index.h("h3", null, this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language))))));
132
140
  }
133
141
  async loadWidget() {
134
142
  const requestObject = {
@@ -158,7 +166,14 @@ const UserDepositWithdrawal = class {
158
166
  throw new Error(err);
159
167
  }
160
168
  const data = await response.json();
161
- this.cashierInfoUrl = data.CashierInfo.Url;
169
+ if (data.CashierInfo) {
170
+ this.cashierInfoUrl = data.CashierInfo.Url;
171
+ }
172
+ else {
173
+ let apiMessage = data.ResponseMessage || (this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language));
174
+ const messageOBj = { type: 'error', message: apiMessage };
175
+ window.postMessage({ type: 'DenyDepositOrWithdrawal', data: messageOBj }, window.location.href);
176
+ }
162
177
  }
163
178
  catch (ex) {
164
179
  console.error(ex);
@@ -94,7 +94,7 @@ export class UserDepositWithdrawal {
94
94
  h("g", { transform: "translate(20 158)" },
95
95
  h("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)" })))),
96
96
  h("h2", { class: "CategoryTitleMobile" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language))))),
97
- h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl })))));
97
+ this.cashierInfoUrl ? h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl }) : h("h3", null, this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language))))));
98
98
  }
99
99
  async loadWidget() {
100
100
  const requestObject = {
@@ -124,7 +124,14 @@ export class UserDepositWithdrawal {
124
124
  throw new Error(err);
125
125
  }
126
126
  const data = await response.json();
127
- this.cashierInfoUrl = data.CashierInfo.Url;
127
+ if (data.CashierInfo) {
128
+ this.cashierInfoUrl = data.CashierInfo.Url;
129
+ }
130
+ else {
131
+ let apiMessage = data.ResponseMessage || (this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language));
132
+ const messageOBj = { type: 'error', message: apiMessage };
133
+ window.postMessage({ type: 'DenyDepositOrWithdrawal', data: messageOBj }, window.location.href);
134
+ }
128
135
  }
129
136
  catch (ex) {
130
137
  console.error(ex);
@@ -4,18 +4,26 @@ const TRANSLATIONS = {
4
4
  en: {
5
5
  Deposit: 'Deposit',
6
6
  Withdraw: 'Withdraw',
7
+ denyDeposit: 'Please be informed that currently you are not allowed to initiate depost transactions.',
8
+ denyWithdrawal: 'Please be informed that currently you are not allowed to initiate withdrawal transactions.'
7
9
  },
8
10
  ro: {
9
11
  Deposit: 'Depozit',
10
12
  Withdraw: 'Retragere',
13
+ denyDeposit: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.',
14
+ denyWithdrawal: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere.'
11
15
  },
12
16
  fr: {
13
17
  Deposit: 'Deposit',
14
18
  Withdraw: 'Withdraw',
19
+ denyDeposit: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de dépôt.',
20
+ denyWithdrawal: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de retrait.'
15
21
  },
16
22
  hr: {
17
23
  Deposit: 'Letét',
18
- Withdraw: 'Visszavonás'
24
+ Withdraw: 'Visszavonás',
25
+ denyDeposit: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija pologa.',
26
+ denyWithdrawal: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate.'
19
27
  }
20
28
  };
21
29
  export const translate = (key, customLang) => {
@@ -6,18 +6,26 @@ const TRANSLATIONS = {
6
6
  en: {
7
7
  Deposit: 'Deposit',
8
8
  Withdraw: 'Withdraw',
9
+ denyDeposit: 'Please be informed that currently you are not allowed to initiate depost transactions.',
10
+ denyWithdrawal: 'Please be informed that currently you are not allowed to initiate withdrawal transactions.'
9
11
  },
10
12
  ro: {
11
13
  Deposit: 'Depozit',
12
14
  Withdraw: 'Retragere',
15
+ denyDeposit: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.',
16
+ denyWithdrawal: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere.'
13
17
  },
14
18
  fr: {
15
19
  Deposit: 'Deposit',
16
20
  Withdraw: 'Withdraw',
21
+ denyDeposit: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de dépôt.',
22
+ denyWithdrawal: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de retrait.'
17
23
  },
18
24
  hr: {
19
25
  Deposit: 'Letét',
20
- Withdraw: 'Visszavonás'
26
+ Withdraw: 'Visszavonás',
27
+ denyDeposit: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija pologa.',
28
+ denyWithdrawal: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate.'
21
29
  }
22
30
  };
23
31
  const translate = (key, customLang) => {
@@ -126,7 +134,7 @@ const UserDepositWithdrawal$1 = /*@__PURE__*/ proxyCustomElement(class extends H
126
134
  }
127
135
  render() {
128
136
  return (h(Host, null, h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "DepositWithdrawalWrapper", style: { height: this.dynamicHeight, marginTop: this.isShortCashier ? '30px' : '0' } }, h("div", null, (this.isMobile && !this.isShortCashier &&
129
- h("div", { class: "MenuReturnButton", onClick: () => this.toggleScreen(this.isMobile) }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, h("defs", null), h("g", { transform: "translate(-20 -158)" }, h("g", { transform: "translate(20 158)" }, h("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)" })))), h("h2", { class: "CategoryTitleMobile" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language))))), h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl })))));
137
+ h("div", { class: "MenuReturnButton", onClick: () => this.toggleScreen(this.isMobile) }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, h("defs", null), h("g", { transform: "translate(-20 -158)" }, h("g", { transform: "translate(20 158)" }, h("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)" })))), h("h2", { class: "CategoryTitleMobile" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language))))), this.cashierInfoUrl ? h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl }) : h("h3", null, this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language))))));
130
138
  }
131
139
  async loadWidget() {
132
140
  const requestObject = {
@@ -156,7 +164,14 @@ const UserDepositWithdrawal$1 = /*@__PURE__*/ proxyCustomElement(class extends H
156
164
  throw new Error(err);
157
165
  }
158
166
  const data = await response.json();
159
- this.cashierInfoUrl = data.CashierInfo.Url;
167
+ if (data.CashierInfo) {
168
+ this.cashierInfoUrl = data.CashierInfo.Url;
169
+ }
170
+ else {
171
+ let apiMessage = data.ResponseMessage || (this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language));
172
+ const messageOBj = { type: 'error', message: apiMessage };
173
+ window.postMessage({ type: 'DenyDepositOrWithdrawal', data: messageOBj }, window.location.href);
174
+ }
160
175
  }
161
176
  catch (ex) {
162
177
  console.error(ex);
@@ -6,18 +6,26 @@ const TRANSLATIONS = {
6
6
  en: {
7
7
  Deposit: 'Deposit',
8
8
  Withdraw: 'Withdraw',
9
+ denyDeposit: 'Please be informed that currently you are not allowed to initiate depost transactions.',
10
+ denyWithdrawal: 'Please be informed that currently you are not allowed to initiate withdrawal transactions.'
9
11
  },
10
12
  ro: {
11
13
  Deposit: 'Depozit',
12
14
  Withdraw: 'Retragere',
15
+ denyDeposit: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.',
16
+ denyWithdrawal: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere.'
13
17
  },
14
18
  fr: {
15
19
  Deposit: 'Deposit',
16
20
  Withdraw: 'Withdraw',
21
+ denyDeposit: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de dépôt.',
22
+ denyWithdrawal: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de retrait.'
17
23
  },
18
24
  hr: {
19
25
  Deposit: 'Letét',
20
- Withdraw: 'Visszavonás'
26
+ Withdraw: 'Visszavonás',
27
+ denyDeposit: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija pologa.',
28
+ denyWithdrawal: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate.'
21
29
  }
22
30
  };
23
31
  const translate = (key, customLang) => {
@@ -124,7 +132,7 @@ const UserDepositWithdrawal = class {
124
132
  }
125
133
  render() {
126
134
  return (h(Host, null, h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "DepositWithdrawalWrapper", style: { height: this.dynamicHeight, marginTop: this.isShortCashier ? '30px' : '0' } }, h("div", null, (this.isMobile && !this.isShortCashier &&
127
- h("div", { class: "MenuReturnButton", onClick: () => this.toggleScreen(this.isMobile) }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, h("defs", null), h("g", { transform: "translate(-20 -158)" }, h("g", { transform: "translate(20 158)" }, h("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)" })))), h("h2", { class: "CategoryTitleMobile" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language))))), h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl })))));
135
+ h("div", { class: "MenuReturnButton", onClick: () => this.toggleScreen(this.isMobile) }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, h("defs", null), h("g", { transform: "translate(-20 -158)" }, h("g", { transform: "translate(20 158)" }, h("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)" })))), h("h2", { class: "CategoryTitleMobile" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language))))), this.cashierInfoUrl ? h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl }) : h("h3", null, this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language))))));
128
136
  }
129
137
  async loadWidget() {
130
138
  const requestObject = {
@@ -154,7 +162,14 @@ const UserDepositWithdrawal = class {
154
162
  throw new Error(err);
155
163
  }
156
164
  const data = await response.json();
157
- this.cashierInfoUrl = data.CashierInfo.Url;
165
+ if (data.CashierInfo) {
166
+ this.cashierInfoUrl = data.CashierInfo.Url;
167
+ }
168
+ else {
169
+ let apiMessage = data.ResponseMessage || (this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language));
170
+ const messageOBj = { type: 'error', message: apiMessage };
171
+ window.postMessage({ type: 'DenyDepositOrWithdrawal', data: messageOBj }, window.location.href);
172
+ }
158
173
  }
159
174
  catch (ex) {
160
175
  console.error(ex);
@@ -0,0 +1 @@
1
+ import{r as t,h as i,H as e}from"./p-086a6b5a.js";const n=["ro","en","fr","hr"],s={en:{Deposit:"Deposit",Withdraw:"Withdraw",denyDeposit:"Please be informed that currently you are not allowed to initiate depost transactions.",denyWithdrawal:"Please be informed that currently you are not allowed to initiate withdrawal transactions."},ro:{Deposit:"Depozit",Withdraw:"Retragere",denyDeposit:"Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.",denyWithdrawal:"Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere."},fr:{Deposit:"Deposit",Withdraw:"Withdraw",denyDeposit:"Veuillez être informé que vous n'êtes actuellement pas autorisé à initier des transactions de dépôt.",denyWithdrawal:"Veuillez être informé que vous n'êtes actuellement pas autorisé à initier des transactions de retrait."},hr:{Deposit:"Letét",Withdraw:"Visszavonás",denyDeposit:"Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija pologa.",denyWithdrawal:"Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate."}},a=(t,i)=>{const e=i;return s[void 0!==e&&n.includes(e)?e:"en"][t]},o=()=>{},r=class{constructor(i){var e;t(this,i),this.clientStyling="",this.clientStylingUrl="",this.currency="",this.showBonusSelectionInput="true",this.isShortCashier="false",this.beforeRedirect=o,this.limitStylingAppends=!1,this.bindedHandler=this.handleMessage.bind(this),this.userAgent=window.navigator.userAgent,this.isMobile=!!((e=this.userAgent).toLowerCase().match(/android/i)||e.toLowerCase().match(/blackberry|bb/i)||e.toLowerCase().match(/iphone|ipad|ipod/i)||e.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{i.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(i)}),1)})).catch((t=>{console.log("error ",t)}))}}get typeParameter(){return"deposit"===this.type?"Deposit":"withdraw"===this.type?"Withdraw":void 0}watchLoadWidget(){this.loadWidget()}async componentWillLoad(){await this.loadWidget()}toggleScreen(t){window.postMessage({type:"PlayerAccountMenuActive",isMobile:t},window.location.href)}componentDidLoad(){window.addEventListener("message",this.bindedHandler,!1)}disconnectedCallback(){window.removeEventListener("message",this.bindedHandler,!1)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return i(e,null,i("div",{ref:t=>this.stylingContainer=t},i("div",{class:"DepositWithdrawalWrapper",style:{height:this.dynamicHeight,marginTop:this.isShortCashier?"30px":"0"}},i("div",null,this.isMobile&&!this.isShortCashier&&i("div",{class:"MenuReturnButton",onClick:()=>this.toggleScreen(this.isMobile)},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 15 15"},i("defs",null),i("g",{transform:"translate(-20 -158)"},i("g",{transform:"translate(20 158)"},i("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)"})))),i("h2",{class:"CategoryTitleMobile"},a("Withdraw"===this.typeParameter?"Withdraw":"Deposit",this.language)))),this.cashierInfoUrl?i("iframe",{width:"100%",height:"100%",src:this.cashierInfoUrl}):i("h3",null,a("deposit"===this.type?"denyDeposit":"denyWithdrawal",this.language)))))}async loadWidget(){const t={Channel:this.channel,Type:this.typeParameter,SuccessUrl:this.successUrl,CancelUrl:this.cancelUrl,FailUrl:this.failUrl,Language:this.language,productType:this.productType,isShortCashier:this.isShortCashier,currency:this.currency,showBonusSelectionInput:this.showBonusSelectionInput};try{const i=`${this.endpoint}/v1/player/${this.userId}/payment/GetPaymentSession`,e=await fetch(i,{method:"POST",headers:{"X-Sessionid":this.session,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const t=await e.text();throw new Error(t)}const n=await e.json();if(n.CashierInfo)this.cashierInfoUrl=n.CashierInfo.Url;else{let t=n.ResponseMessage||a("deposit"===this.type?"denyDeposit":"denyWithdrawal",this.language);window.postMessage({type:"DenyDepositOrWithdrawal",data:{type:"error",message:t}},window.location.href)}}catch(t){console.error(t)}}handleMessage(t){var i,e,n,s,a,o,r;t.data["MMFE:setIFrameHeight"]&&"true"===this.isShortCashier&&(this.dynamicHeight=t.data["MMFE:setIFrameHeight"].toString()+"px"),"mm-hcback-to-merchant"===(null===(i=t.data)||void 0===i?void 0:i.type)&&this.doRedirect(t.data.type,this.homeUrl),"mm-hc-back-tomerchant"===(null===(e=t.data)||void 0===e?void 0:e.redirect)&&this.doRedirect(t.data.redirect,this.homeUrl),"mm-hc-sports"===(null===(n=t.data)||void 0===n?void 0:n.redirect)&&this.doRedirect(null===(s=t.data)||void 0===s?void 0:s.redirect,this.sportsUrl),"mm-hc-casino"===(null===(a=t.data)||void 0===a?void 0:a.redirect)&&this.doRedirect(window.location.href,this.casinoUrl),"mm-hc-contact"===(null===(o=t.data)||void 0===o?void 0:o.redirect)&&(window.postMessage({type:"CloseShortCashier"},window.location.href),this.doRedirect(window.location.href,this.contactUrl)),"mm-wm-hc-init-deposit"===(null===(r=t.data)||void 0===r?void 0:r.redirect)&&(window.postMessage({type:"CloseShortCashier"},window.location.href),this.doRedirect(window.location.href,this.depositUrl))}doRedirect(t,i){const e={reason:t,url:i,cancel:!1};this.beforeRedirect(e),e.cancel||(window.location.href=e.url?e.url:"/")}static get watchers(){return{session:["watchLoadWidget"],userId:["watchLoadWidget"],isShortCashier:["watchLoadWidget"],currency:["watchLoadWidget"],showBonusSelectionInput:["watchLoadWidget"]}}};r.style=":host {\n font: inherit;\n display: block;\n height: 100%;\n overflow: hidden;\n}\n\n.MenuReturnButton {\n font: inherit;\n color: var(--emfe-w-color-gray-300, #58586B);\n display: inline-flex;\n align-items: center;\n column-gap: 10px;\n margin-bottom: 10px;\n}\n.MenuReturnButton svg {\n fill: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));\n}\n.MenuReturnButton h2.CategoryTitleMobile {\n font-size: 16px;\n color: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));\n}\n\n.DepositWithdrawalWrapper {\n width: 100%;\n padding: 0;\n margin: 0;\n height: 100vh;\n}\n\n@container (max-width: 475px) {\n .DepositWithdrawalWrapper {\n height: 100vh;\n }\n}";export{r as user_deposit_withdrawal}
@@ -1 +1 @@
1
- import{p as r,b as e}from"./p-086a6b5a.js";(()=>{const e=import.meta.url,s={};return""!==e&&(s.resourcesUrl=new URL(".",e).href),r(s)})().then((r=>e([["p-88818baa",[[1,"user-deposit-withdrawal",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],endpoint:[513],type:[513],channel:[513],language:[513],productType:[513,"product-type"],userId:[513,"user-id"],session:[513],successUrl:[513,"success-url"],cancelUrl:[513,"cancel-url"],failUrl:[513,"fail-url"],sportsUrl:[513,"sports-url"],casinoUrl:[513,"casino-url"],contactUrl:[513,"contact-url"],depositUrl:[513,"deposit-url"],currency:[513],showBonusSelectionInput:[513,"show-bonus-selection-input"],isShortCashier:[513,"is-short-cashier"],homeUrl:[513,"home-url"],beforeRedirect:[16],limitStylingAppends:[32],dynamicHeight:[32],cashierInfoUrl:[32]}]]]],r)));
1
+ import{p as r,b as e}from"./p-086a6b5a.js";(()=>{const e=import.meta.url,s={};return""!==e&&(s.resourcesUrl=new URL(".",e).href),r(s)})().then((r=>e([["p-28779e70",[[1,"user-deposit-withdrawal",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],endpoint:[513],type:[513],channel:[513],language:[513],productType:[513,"product-type"],userId:[513,"user-id"],session:[513],successUrl:[513,"success-url"],cancelUrl:[513,"cancel-url"],failUrl:[513,"fail-url"],sportsUrl:[513,"sports-url"],casinoUrl:[513,"casino-url"],contactUrl:[513,"contact-url"],depositUrl:[513,"deposit-url"],currency:[513],showBonusSelectionInput:[513,"show-bonus-selection-input"],isShortCashier:[513,"is-short-cashier"],homeUrl:[513,"home-url"],beforeRedirect:[16],limitStylingAppends:[32],dynamicHeight:[32],cashierInfoUrl:[32]}]]]],r)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/user-deposit-withdrawal",
3
- "version": "1.37.4",
3
+ "version": "1.37.6",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as t,h as i,H as e}from"./p-086a6b5a.js";const s=["ro","en","fr","hr"],o={en:{Deposit:"Deposit",Withdraw:"Withdraw"},ro:{Deposit:"Depozit",Withdraw:"Retragere"},fr:{Deposit:"Deposit",Withdraw:"Withdraw"},hr:{Deposit:"Letét",Withdraw:"Visszavonás"}},n=()=>{},h=class{constructor(i){var e;t(this,i),this.clientStyling="",this.clientStylingUrl="",this.currency="",this.showBonusSelectionInput="true",this.isShortCashier="false",this.beforeRedirect=n,this.limitStylingAppends=!1,this.bindedHandler=this.handleMessage.bind(this),this.userAgent=window.navigator.userAgent,this.isMobile=!!((e=this.userAgent).toLowerCase().match(/android/i)||e.toLowerCase().match(/blackberry|bb/i)||e.toLowerCase().match(/iphone|ipad|ipod/i)||e.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{i.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(i)}),1)})).catch((t=>{console.log("error ",t)}))}}get typeParameter(){return"deposit"===this.type?"Deposit":"withdraw"===this.type?"Withdraw":void 0}watchLoadWidget(){this.loadWidget()}async componentWillLoad(){await this.loadWidget()}toggleScreen(t){window.postMessage({type:"PlayerAccountMenuActive",isMobile:t},window.location.href)}componentDidLoad(){window.addEventListener("message",this.bindedHandler,!1)}disconnectedCallback(){window.removeEventListener("message",this.bindedHandler,!1)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return i(e,null,i("div",{ref:t=>this.stylingContainer=t},i("div",{class:"DepositWithdrawalWrapper",style:{height:this.dynamicHeight,marginTop:this.isShortCashier?"30px":"0"}},i("div",null,this.isMobile&&!this.isShortCashier&&i("div",{class:"MenuReturnButton",onClick:()=>this.toggleScreen(this.isMobile)},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 15 15"},i("defs",null),i("g",{transform:"translate(-20 -158)"},i("g",{transform:"translate(20 158)"},i("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)"})))),i("h2",{class:"CategoryTitleMobile"},(t=>{const i=this.language;return o[void 0!==i&&s.includes(i)?i:"en"][t]})("Withdraw"===this.typeParameter?"Withdraw":"Deposit")))),i("iframe",{width:"100%",height:"100%",src:this.cashierInfoUrl}))))}async loadWidget(){const t={Channel:this.channel,Type:this.typeParameter,SuccessUrl:this.successUrl,CancelUrl:this.cancelUrl,FailUrl:this.failUrl,Language:this.language,productType:this.productType,isShortCashier:this.isShortCashier,currency:this.currency,showBonusSelectionInput:this.showBonusSelectionInput};try{const i=`${this.endpoint}/v1/player/${this.userId}/payment/GetPaymentSession`,e=await fetch(i,{method:"POST",headers:{"X-Sessionid":this.session,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const t=await e.text();throw new Error(t)}const s=await e.json();this.cashierInfoUrl=s.CashierInfo.Url}catch(t){console.error(t)}}handleMessage(t){var i,e,s,o,n,h,r;t.data["MMFE:setIFrameHeight"]&&"true"===this.isShortCashier&&(this.dynamicHeight=t.data["MMFE:setIFrameHeight"].toString()+"px"),"mm-hcback-to-merchant"===(null===(i=t.data)||void 0===i?void 0:i.type)&&this.doRedirect(t.data.type,this.homeUrl),"mm-hc-back-tomerchant"===(null===(e=t.data)||void 0===e?void 0:e.redirect)&&this.doRedirect(t.data.redirect,this.homeUrl),"mm-hc-sports"===(null===(s=t.data)||void 0===s?void 0:s.redirect)&&this.doRedirect(null===(o=t.data)||void 0===o?void 0:o.redirect,this.sportsUrl),"mm-hc-casino"===(null===(n=t.data)||void 0===n?void 0:n.redirect)&&this.doRedirect(window.location.href,this.casinoUrl),"mm-hc-contact"===(null===(h=t.data)||void 0===h?void 0:h.redirect)&&(window.postMessage({type:"CloseShortCashier"},window.location.href),this.doRedirect(window.location.href,this.contactUrl)),"mm-wm-hc-init-deposit"===(null===(r=t.data)||void 0===r?void 0:r.redirect)&&(window.postMessage({type:"CloseShortCashier"},window.location.href),this.doRedirect(window.location.href,this.depositUrl))}doRedirect(t,i){const e={reason:t,url:i,cancel:!1};this.beforeRedirect(e),e.cancel||(window.location.href=e.url?e.url:"/")}static get watchers(){return{session:["watchLoadWidget"],userId:["watchLoadWidget"],isShortCashier:["watchLoadWidget"],currency:["watchLoadWidget"],showBonusSelectionInput:["watchLoadWidget"]}}};h.style=":host {\n font: inherit;\n display: block;\n height: 100%;\n overflow: hidden;\n}\n\n.MenuReturnButton {\n font: inherit;\n color: var(--emfe-w-color-gray-300, #58586B);\n display: inline-flex;\n align-items: center;\n column-gap: 10px;\n margin-bottom: 10px;\n}\n.MenuReturnButton svg {\n fill: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));\n}\n.MenuReturnButton h2.CategoryTitleMobile {\n font-size: 16px;\n color: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));\n}\n\n.DepositWithdrawalWrapper {\n width: 100%;\n padding: 0;\n margin: 0;\n height: 100vh;\n}\n\n@container (max-width: 475px) {\n .DepositWithdrawalWrapper {\n height: 100vh;\n }\n}";export{h as user_deposit_withdrawal}