@everymatrix/player-account-controller 1.37.3 → 1.37.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-account-controller",
3
- "version": "1.37.3",
3
+ "version": "1.37.4",
4
4
  "main": "dist/player-account-controller.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "df31cbe8e6b206c5aed27f8036ab50826359872e"
38
+ "gitHead": "863252ebf7c846696d9b388f0d288993dbd5065c"
39
39
  }
@@ -66,7 +66,6 @@
66
66
  export let biometricsenabled:string = 'false';
67
67
  export let activepage:string = '';
68
68
 
69
-
70
69
  setupI18n({ withLocale: 'en', translations: {}});
71
70
 
72
71
  let customStylingContainer:HTMLElement;
@@ -94,6 +93,7 @@
94
93
  let showErrorPasswordChanged:boolean = false;
95
94
  let selected:string;
96
95
  let ChangePasswordEvent: CustomEvent;
96
+ let activeMenuItem:string = '/profile-info';
97
97
 
98
98
  const widgetPath = ['/profile-info',
99
99
  '/change-password',
@@ -117,6 +117,16 @@
117
117
  '/transactions-history',
118
118
  '/biometrics'];
119
119
 
120
+ const initialLoad = ():void => {
121
+ setDevice();
122
+
123
+ userId = playerid;
124
+ sessionId = session;
125
+
126
+ getData(); //For now we will let it here until we move all the datas to other widgets
127
+ setActivePage();
128
+ }
129
+
120
130
  const setDevice = ():void => {
121
131
  let device = getDevice(userAgent);
122
132
 
@@ -131,6 +141,12 @@
131
141
  }
132
142
  }
133
143
 
144
+ const setActivePage = ():void => {
145
+ if(!activepage && !isMobile) { activepage = widgetPath[0]; }
146
+
147
+ activeMenuItem = activepage;
148
+ }
149
+
134
150
  const setTranslationUrl = ():void => {
135
151
  let url:string = translationurl;
136
152
 
@@ -482,13 +498,6 @@
482
498
  }
483
499
  }
484
500
 
485
- async function getAccountMenuDetails(url:URL) {
486
- url.searchParams.append('device', deviceSegregationValue)
487
- const response = await fetch(url.href);
488
- const dataMenuItems = await response.json();
489
- return dataMenuItems;
490
- }
491
-
492
501
  const getNotificationsDetails = (url:URL):void => {
493
502
 
494
503
  url.searchParams.append('userRoles', userroles);
@@ -692,22 +701,7 @@
692
701
  });
693
702
  }
694
703
 
695
- const findPageId = ():void => {
696
- menuData.forEach(element => {
697
- if (element.path.includes(activepage)) {
698
- selected = element.id;
699
- }
700
- })
701
- }
702
-
703
704
  const getData = ():void => {
704
- getAccountMenuDetails(new URL(`${cmsendpoint}/${lang}/profile-menu?env=${env}`))
705
- .then((data:any):void => {
706
- menuData = data;
707
- findPageId();
708
- window.postMessage({ type: 'AccountMenuDetails', accountMenuInfo: menuData }, window.location.href);
709
- });
710
-
711
705
  getNotificationsDetails(new URL(`${cmsendpoint}/${lang}/support-information?env=${env}`));
712
706
  getUserProfileInfo();
713
707
  getUserProfileConsent();
@@ -722,13 +716,6 @@
722
716
  getGamingLimits(new URL(`/v2/player/${userId}/limits`, endpoint));
723
717
  }
724
718
 
725
- const initialLoad = ():void => {
726
- setDevice()
727
- userId = playerid;
728
- sessionId = session;
729
- getData();
730
- }
731
-
732
719
  const setClientStyling = ():void => {
733
720
  let sheet = document.createElement('style');
734
721
  sheet.innerHTML = clientstyling;
@@ -762,6 +749,7 @@
762
749
  $: clientstyling && customStylingContainer && setClientStyling();
763
750
  $: clientstylingurl && customStylingContainer && setClientStylingURL();
764
751
  $: translationurl && setTranslationUrl();
752
+ $: activepage && setActivePage();
765
753
  </script>
766
754
 
767
755
  <svelte:head>
@@ -777,102 +765,102 @@
777
765
  {:else}
778
766
  <section class="PlayerAccountPage {isMobile ? 'PlayerAccountMobilePage' : ''}">
779
767
  {#if isMobile}
780
- {#if !activepage}
768
+ {#if !activeMenuItem}
781
769
  <nav class="PlayerAccountMobile">
782
770
  <player-account-menu {endpoint} {session} {playerid} {lang} {translationurl} {userroles} {clientstyling} {clientstylingurl}></player-account-menu>
783
771
  <player-account-notifications customnotif={customnotifications} {translationurl} {clientstyling} {clientstylingurl}></player-account-notifications>
784
772
  </nav>
785
773
  {:else}
786
- {#if activepage === widgetPath[0]}
774
+ {#if activeMenuItem === widgetPath[0]}
787
775
  <player-profile-info {endpoint} {lang} {countrycode} {translationurl} {clientstyling} {clientstylingurl} {custominputtextswitch}></player-profile-info>
788
- {:else if activepage === widgetPath[1]}
776
+ {:else if activeMenuItem === widgetPath[1]}
789
777
  <player-change-password {simplepasswordvalidation} {translationurl} {lang} {clientstyling} {clientstylingurl}></player-change-password>
790
- {:else if activepage === widgetPath[2]}
778
+ {:else if activeMenuItem === widgetPath[2]}
791
779
  <player-reality-check realitycheck={realityCheckData} {endpoint} {translationurl} {playerid} {session} {lang} {clientstyling} {clientstylingurl}></player-reality-check>
792
- {:else if activepage === widgetPath[3]}
780
+ {:else if activeMenuItem === widgetPath[3]}
793
781
  <player-account-timeout {lang} {operator} {supportemail} {translationurl} {clientstyling} {clientstylingurl}></player-account-timeout>
794
- {:else if activepage === widgetPath[4]}
782
+ {:else if activeMenuItem === widgetPath[4]}
795
783
  <player-account-closure {lang} {clientstyling} {clientstylingurl} {translationurl}></player-account-closure>
796
- {:else if activepage === widgetPath[5]}
784
+ {:else if activeMenuItem === widgetPath[5]}
797
785
  <player-account-gaming-limits use:sendLimitsData {playercurrency} {separatelimits} {translationurl} {clientstyling} {clientstylingurl}></player-account-gaming-limits>
798
- {:else if activepage === widgetPath[6]}
786
+ {:else if activeMenuItem === widgetPath[6]}
799
787
  <player-account-self-exclusion {lang} {operator} {supportemail} {clientstyling} {clientstylingurl} {translationurl}></player-account-self-exclusion>
800
- {:else if activepage === widgetPath[7]}
788
+ {:else if activeMenuItem === widgetPath[7]}
801
789
  <player-active-bonuses {endpoint} {session} {playerid} {lang} {translationurl} {playercurrency} {clientstyling} {clientstylingurl}></player-active-bonuses>
802
- {:else if activepage === widgetPath[8]}
790
+ {:else if activeMenuItem === widgetPath[8]}
803
791
  <player-bonus-history {endpoint} {session} {playerid} {lang} {translationurl} {clientstyling} {clientstylingurl}></player-bonus-history>
804
- {:else if activepage === widgetPath[9]}
792
+ {:else if activeMenuItem === widgetPath[9]}
805
793
  <player-gaming-history {endpoint} {session} {playerid} {lang} {translationurl} {clientstyling} {clientstylingurl} {gmversion}></player-gaming-history>
806
- {:else if activepage === widgetPath[10]}
794
+ {:else if activeMenuItem === widgetPath[10]}
807
795
  <player-deposit {endpoint} {session} {playerid} {lang} {hasdefaultamount} {translationurl} {clientstyling} {clientstylingurl} {playercurrency}></player-deposit>
808
- {:else if activepage === widgetPath[11]}
796
+ {:else if activeMenuItem === widgetPath[11]}
809
797
  <player-withdrawal {endpoint} {session} {playerid} {lang} {hasdefaultamount} {translationurl} {clientstyling} {clientstylingurl} {playercurrency}></player-withdrawal>
810
- {:else if activepage === widgetPath[12]}
798
+ {:else if activeMenuItem === widgetPath[12]}
811
799
  <player-pending-withdrawals {endpoint} {session} {playerid} {lang} {translationurl} {clientstyling} {clientstylingurl}></player-pending-withdrawals>
812
- {:else if activepage === widgetPath[13]}
800
+ {:else if activeMenuItem === widgetPath[13]}
813
801
  <player-transaction-history {endpoint} {session} {playerid} {lang} {translationurl} {clientstyling} {clientstylingurl}></player-transaction-history>
814
- {:else if activepage === widgetPath[14]}
802
+ {:else if activeMenuItem === widgetPath[14]}
815
803
  <player-account-betting-history {endpoint} {session} {playerid} {lang} {translationurl} {clientstyling} {clientstylingurl}></player-account-betting-history>
816
- {:else if activepage === widgetPath[15]}
804
+ {:else if activeMenuItem === widgetPath[15]}
817
805
  <player-account-gaming-limits-wrapper-2 {endpoint} userid={playerid} {session} {lang} {tablabels} {historyenabled} {deletelimit} {limitsamount} {limitsperiods} {numberofentries} {customcurrencysymbols} {currency} {apiversion} {translationurl} {clientstyling} {clientstylingurl}></player-account-gaming-limits-wrapper-2>
818
- {:else if activepage === widgetPath[16]}
819
- <player-kyc-verification {endpoint} {session} user-id={playerid} language={lang} translation-url={translationurl} client-styling={clientstyling} client-styling-url={clientstylingurl}></player-kyc-verification>
820
- {:else if activepage === widgetPath[17] }
821
- <user-deposit-withdrawal {endpoint} type="deposit" channel="Mobile" language={lang} {translationurl} {currency} show-bonus-selection-input={showcashierbonus} product-type={producttype} user-id={playerid} {session} success-url={'https://' + window.location.hostname + '/' + lang + successurl} cancel-url={'https://' + window.location.hostname + '/' + lang + cancelurl} fail-url={'https://' + window.location.hostname + '/' + lang + failurl} sports-url={'https://' + window.location.hostname + '/' + lang + sportsurl} casino-url={'https://' + window.location.hostname + '/' + lang + casinourl} contact-url={'https://' + window.location.hostname + '/' + lang + contacturl} home-url={'https://' + window.location.hostname + '/' + lang + homeurl} deposit-url={'https://' + window.location.hostname + '/' + lang + depositurl} ></user-deposit-withdrawal>
822
- {:else if activepage === widgetPath[18] }
823
- <user-deposit-withdrawal {endpoint} type="withdraw" channel="Mobile" language={lang} {translationurl} {currency} show-bonus-selection-input={showcashierbonus} product-type={producttype} user-id={playerid} {session} success-url={'https://' + window.location.hostname + '/' + lang + successurl} cancel-url={'https://' + window.location.hostname + '/' + lang + cancelurl} fail-url={'https://' + window.location.hostname + '/' + lang + failurl} sports-url={'https://' + window.location.hostname + '/' + lang + sportsurl} casino-url={'https://' + window.location.hostname + '/' + lang + casinourl} contact-url={'https://' + window.location.hostname + '/' + lang + contacturl} home-url={'https://' + window.location.hostname + '/' + lang + homeurl} deposit-url={'https://' + window.location.hostname + '/' + lang + depositurl}></user-deposit-withdrawal>
824
- {:else if activepage === widgetPath[19] }
806
+ {:else if activeMenuItem === widgetPath[16]}
807
+ <player-kyc-verification {endpoint} {session} user-id={playerid} language={lang} kyc-title={kyctitle} description={kycdescription} translation-url={translationurl} client-styling={clientstyling} client-styling-url={clientstylingurl}></player-kyc-verification>
808
+ {:else if activeMenuItem === widgetPath[17] }
809
+ <user-deposit-withdrawal {endpoint} type="deposit" channel="Mobile" language={lang} {translationurl} {currency} show-bonus-selection-input={showcashierbonus} product-type={producttype} user-id={playerid} {session} success-url={'https://' + window.location.hostname + '/' + lang + successurl} cancel-url={'https://' + window.location.hostname + '/' + lang + cancelurl} fail-url={'https://' + window.location.hostname + '/' + lang + failurl} sports-url={'https://' + window.location.hostname + '/' + lang + sportsurl} casino-url={'https://' + window.location.hostname + '/' + lang + casinourl} contact-url={'https://' + window.location.hostname + '/' + lang + contacturl} home-url={'https://' + window.location.hostname + '/' + lang + homeurl} deposit-url={'https://' + window.location.hostname + '/' + lang + depositurl} client-styling={clientstyling} client-styling-url={clientstylingurl}></user-deposit-withdrawal>
810
+ {:else if activeMenuItem === widgetPath[18] }
811
+ <user-deposit-withdrawal {endpoint} type="withdraw" channel="Mobile" language={lang} {translationurl} {currency} show-bonus-selection-input={showcashierbonus} product-type={producttype} user-id={playerid} {session} success-url={'https://' + window.location.hostname + '/' + lang + successurl} cancel-url={'https://' + window.location.hostname + '/' + lang + cancelurl} fail-url={'https://' + window.location.hostname + '/' + lang + failurl} sports-url={'https://' + window.location.hostname + '/' + lang + sportsurl} casino-url={'https://' + window.location.hostname + '/' + lang + casinourl} contact-url={'https://' + window.location.hostname + '/' + lang + contacturl} home-url={'https://' + window.location.hostname + '/' + lang + homeurl} deposit-url={'https://' + window.location.hostname + '/' + lang + depositurl} client-styling={clientstyling} client-styling-url={clientstylingurl}></user-deposit-withdrawal>
812
+ {:else if activeMenuItem === widgetPath[19] }
825
813
  <user-transaction-history endpoint={endpoint} user-id={playerid} session={session} mobile={isMobile} translation-url={translationurl} language={lang}></user-transaction-history>
826
- {:else if activepage === widgetPath[20] }
814
+ {:else if activeMenuItem === widgetPath[20] }
827
815
  <player-account-biometrics {biometricsenabled} {lang} {clientstyling} {clientstylingurl} {translationurl}></player-account-biometrics>
828
- {/if}
816
+ {/if}
829
817
  {/if}
830
818
  {:else}
831
819
  <nav>
832
- <player-account-menu {endpoint} {session} {playerid} {lang} selecteditem={selected} {userroles} {clientstyling} {clientstylingurl}></player-account-menu>
820
+ <player-account-menu {endpoint} {session} {playerid} {lang} {env} activemenuitem={activeMenuItem} {cmsendpoint} selecteditem={selected} {userroles} {clientstyling} {clientstylingurl}></player-account-menu>
833
821
  </nav>
834
822
  <main>
835
- {#if activepage === widgetPath[0]}
823
+ {#if activeMenuItem === widgetPath[0]}
836
824
  <player-profile-info {endpoint} {lang} {countrycode} {translationurl} {clientstyling} {clientstylingurl} {custominputtextswitch}></player-profile-info>
837
- {:else if activepage === widgetPath[1]}
825
+ {:else if activeMenuItem === widgetPath[1]}
838
826
  <player-change-password {simplepasswordvalidation}{lang} {translationurl} {clientstyling} {clientstylingurl}></player-change-password>
839
- {:else if activepage === widgetPath[2]}
827
+ {:else if activeMenuItem === widgetPath[2]}
840
828
  <player-reality-check realitycheck={realityCheckData} {endpoint} {translationurl} {playerid} {session} {lang} {clientstyling} {clientstylingurl}></player-reality-check>
841
- {:else if activepage === widgetPath[3]}
829
+ {:else if activeMenuItem === widgetPath[3]}
842
830
  <player-account-timeout {lang} {operator} {supportemail} {translationurl} {clientstyling} {clientstylingurl}></player-account-timeout>
843
- {:else if activepage === widgetPath[4]}
831
+ {:else if activeMenuItem === widgetPath[4]}
844
832
  <player-account-closure {lang} {clientstyling} {translationurl} {clientstylingurl}></player-account-closure>
845
- {:else if activepage == widgetPath[5]}
833
+ {:else if activeMenuItem == widgetPath[5]}
846
834
  <player-account-gaming-limits use:sendLimitsData {playercurrency} {translationurl} {separatelimits} {clientstyling} {clientstylingurl}></player-account-gaming-limits>
847
- {:else if activepage === widgetPath[6]}
835
+ {:else if activeMenuItem === widgetPath[6]}
848
836
  <player-account-self-exclusion {lang} {operator} {supportemail} {translationurl} {clientstyling} {clientstylingurl}></player-account-self-exclusion>
849
- {:else if activepage === widgetPath[7]}
837
+ {:else if activeMenuItem === widgetPath[7]}
850
838
  <player-active-bonuses {endpoint} {session} {playerid} {lang} {translationurl} {playercurrency} {clientstyling} {clientstylingurl}></player-active-bonuses>
851
- {:else if activepage === widgetPath[8]}
839
+ {:else if activeMenuItem === widgetPath[8]}
852
840
  <player-bonus-history {endpoint} {session} {playerid} {lang} {translationurl} {clientstyling} {clientstylingurl}></player-bonus-history>
853
- {:else if activepage === widgetPath[9]}
841
+ {:else if activeMenuItem === widgetPath[9]}
854
842
  <player-gaming-history {endpoint} {session} {playerid} {lang} {translationurl} {clientstyling} {clientstylingurl} {gmversion}></player-gaming-history>
855
- {:else if activepage === widgetPath[10]}
843
+ {:else if activeMenuItem === widgetPath[10]}
856
844
  <player-deposit {endpoint} {session} {playerid} {lang} {hasdefaultamount} {translationurl} {clientstyling} {clientstylingurl} {playercurrency}></player-deposit>
857
- {:else if activepage === widgetPath[11]}
845
+ {:else if activeMenuItem === widgetPath[11]}
858
846
  <player-withdrawal {endpoint} {session} {playerid} {lang} {hasdefaultamount} {translationurl} {clientstyling} {clientstylingurl} {playercurrency}></player-withdrawal>
859
- {:else if activepage === widgetPath[12]}
847
+ {:else if activeMenuItem === widgetPath[12]}
860
848
  <player-pending-withdrawals {endpoint} {session} {playerid} {lang} {translationurl} {clientstyling} {clientstylingurl}></player-pending-withdrawals>
861
- {:else if activepage === widgetPath[13]}
849
+ {:else if activeMenuItem === widgetPath[13]}
862
850
  <player-transaction-history {endpoint} {session} {playerid} {lang} {translationurl} {clientstyling} {clientstylingurl}></player-transaction-history>
863
- {:else if activepage === widgetPath[14]}
851
+ {:else if activeMenuItem === widgetPath[14]}
864
852
  <player-account-betting-history {endpoint} {session} {playerid} {lang} {translationurl} {clientstyling} {clientstylingurl}></player-account-betting-history>
865
- {:else if activepage === widgetPath[15]}
853
+ {:else if activeMenuItem === widgetPath[15]}
866
854
  <player-account-gaming-limits-wrapper-2 {endpoint} userid={playerid} {session} {tablabels} {lang} {historyenabled} {deletelimit} {limitsamount} {limitsperiods} {numberofentries} {customcurrencysymbols} {currency} {apiversion} {translationurl} {clientstyling} {clientstylingurl}></player-account-gaming-limits-wrapper-2>
867
- {:else if activepage === widgetPath[16]}
868
- <player-kyc-verification {endpoint} {session} user-id={playerid} language={lang} translation-url={translationurl} client-styling={clientstyling} client-styling-url={clientstylingurl}></player-kyc-verification>
869
- {:else if activepage === widgetPath[17] }
870
- <user-deposit-withdrawal endpoint={endpoint} type="deposit" channel="Desktop" language={lang} {translationurl} {currency} show-bonus-selection-input={showcashierbonus} product-type={producttype} user-id={playerid} {session} success-url={'https://' + window.location.hostname + '/' + lang + successurl} cancel-url={'https://' + window.location.hostname + '/' + lang + cancelurl} fail-url={'https://' + window.location.hostname + '/' + lang + failurl} sports-url={'https://' + window.location.hostname + '/' + lang + sportsurl} casino-url={'https://' + window.location.hostname + '/' + lang + casinourl} contact-url={'https://' + window.location.hostname + '/' + lang + contacturl} home-url={'https://' + window.location.hostname + '/' + lang + homeurl} deposit-url={'https://' + window.location.hostname + '/' + lang + depositurl}></user-deposit-withdrawal>
871
- {:else if activepage === widgetPath[18] }
872
- <user-deposit-withdrawal endpoint={endpoint} type="withdraw" channel="Desktop" language={lang} {translationurl} {currency} show-bonus-selection-input={showcashierbonus} product-type={producttype} user-id={playerid} {session} success-url={'https://' + window.location.hostname + '/' + lang + successurl} cancel-url={'https://' + window.location.hostname + '/' + lang + cancelurl} fail-url={'https://' + window.location.hostname + '/' + lang + failurl} sports-url={'https://' + window.location.hostname + '/' + lang + sportsurl} casino-url={'https://' + window.location.hostname + '/' + lang + casinourl} contact-url={'https://' + window.location.hostname + '/' + lang + contacturl} home-url={'https://' + window.location.hostname + '/' + lang + homeurl} deposit-url={'https://' + window.location.hostname + '/' + lang + depositurl}></user-deposit-withdrawal>
873
- {:else if activepage === widgetPath[19] }
855
+ {:else if activeMenuItem === widgetPath[16]}
856
+ <player-kyc-verification {endpoint} {session} user-id={playerid} language={lang} translation-url={translationurl} kyc-title={kyctitle} description={kycdescription} client-styling={clientstyling} client-styling-url={clientstylingurl}></player-kyc-verification>
857
+ {:else if activeMenuItem === widgetPath[17] }
858
+ <user-deposit-withdrawal endpoint={endpoint} type="deposit" channel="Desktop" language={lang} {translationurl} {currency} show-bonus-selection-input={showcashierbonus} product-type={producttype} user-id={playerid} {session} success-url={'https://' + window.location.hostname + '/' + lang + successurl} cancel-url={'https://' + window.location.hostname + '/' + lang + cancelurl} fail-url={'https://' + window.location.hostname + '/' + lang + failurl} sports-url={'https://' + window.location.hostname + '/' + lang + sportsurl} casino-url={'https://' + window.location.hostname + '/' + lang + casinourl} contact-url={'https://' + window.location.hostname + '/' + lang + contacturl} home-url={'https://' + window.location.hostname + '/' + lang + homeurl} deposit-url={'https://' + window.location.hostname + '/' + lang + depositurl} client-styling={clientstyling} client-styling-url={clientstylingurl}></user-deposit-withdrawal>
859
+ {:else if activeMenuItem === widgetPath[18] }
860
+ <user-deposit-withdrawal endpoint={endpoint} type="withdraw" channel="Desktop" language={lang} {translationurl} {currency} show-bonus-selection-input={showcashierbonus} product-type={producttype} user-id={playerid} {session} success-url={'https://' + window.location.hostname + '/' + lang + successurl} cancel-url={'https://' + window.location.hostname + '/' + lang + cancelurl} fail-url={'https://' + window.location.hostname + '/' + lang + failurl} sports-url={'https://' + window.location.hostname + '/' + lang + sportsurl} casino-url={'https://' + window.location.hostname + '/' + lang + casinourl} contact-url={'https://' + window.location.hostname + '/' + lang + contacturl} home-url={'https://' + window.location.hostname + '/' + lang + homeurl} deposit-url={'https://' + window.location.hostname + '/' + lang + depositurl} client-styling={clientstyling} client-styling-url={clientstylingurl}></user-deposit-withdrawal>
861
+ {:else if activeMenuItem === widgetPath[19] }
874
862
  <user-transaction-history endpoint={endpoint} user-id={playerid} session={session} mobile={isMobile} translation-url={translationurl} language={lang}></user-transaction-history>
875
- {/if}
863
+ {/if}
876
864
  </main>
877
865
  <aside>
878
866
  <player-account-notifications customnotif={customnotifications} {translationurl} {clientstyling} {clientstylingurl}></player-account-notifications>