@jetthai/cuora 1.1.74-1 → 1.1.74-ac

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.1.74-ac](https://github.com/jetthai/cuora-module/compare/v1.1.74-1...v1.1.74-ac) (2023-05-02)
6
+
7
+ ### [1.1.77](https://github.com/jetthai/cuora-module/compare/v1.1.76...v1.1.77) (2023-04-13)
8
+
9
+ ### [1.1.76](https://github.com/jetthai/cuora-module/compare/v1.1.75...v1.1.76) (2023-04-13)
10
+
11
+ ### [1.1.75](https://github.com/jetthai/cuora-module/compare/v1.1.74...v1.1.75) (2023-04-12)
12
+
5
13
  ### [1.1.74-1](https://github.com/jetthai/cuora-module/compare/v1.1.74...v1.1.74-1) (2023-04-29)
6
14
 
7
15
  ### [1.1.74](https://github.com/jetthai/cuora-module/compare/v1.1.73...v1.1.74) (2023-04-09)
package/dist/bundle.mjs CHANGED
@@ -52,6 +52,7 @@ var api = {
52
52
  exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
53
53
  collect: (data) => ({ url: 'activities/collect', method: 'post', params: data }),
54
54
  getVipTable: () => ({ url: 'activities/viptable', method: 'get' }),
55
+ getRankingList: () => ({ url: 'activities/ranking', method: 'get' }),
55
56
  };
56
57
 
57
58
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -3581,8 +3582,8 @@ var auth$1 = {
3581
3582
  },
3582
3583
  isPublic: true,
3583
3584
  }),
3584
- register: ({ channel, subchannel, referralCode, affiliate = null, reCaptchaToken, dt, ...rest }) => {
3585
- const params = pickBy_1({ channel, subchannel, referralCode, affiliate }, (value) => {
3585
+ register: ({ channel, subchannel, ac, fc = null, reCaptchaToken, dt, ...rest }) => {
3586
+ const params = pickBy_1({ channel, subchannel, ac, fc }, (value) => {
3586
3587
  return value !== undefined && value !== null
3587
3588
  });
3588
3589
  const qs = Object.keys(params)
@@ -3884,6 +3885,11 @@ var user = {
3884
3885
  getAffiliateDashboard: () => ({ url: 'affiliate/dashboard', method: 'get' }),
3885
3886
  getAffiliateDashboardList: ({ level, page, row }) => ({ url: 'affiliate/dashboard/list', method: 'post', params: { level, page, row } }),
3886
3887
  postAffiliate: ({ affiliateCode }) => ({ url: 'affiliate', method: 'post', params: { affiliateCode } }),
3888
+ getFriends: () => ({ url: 'friends', method: 'get' }),
3889
+ getFriendsHome: () => ({ url: 'friends/home', method: 'get' }),
3890
+ getFriendsDashboard: () => ({ url: 'friends/dashboard', method: 'get' }),
3891
+ getFriendsDashboardList: ({ level, page, row }) => ({ url: 'friends/dashboard/list', method: 'post', params: { level, page, row } }),
3892
+ postFriends: ({ friendCode }) => ({ url: 'friends', method: 'post', params: { friendCode } }),
3887
3893
  passwordRecovery: (recoveryData) => ({ url: 'recovery', method: 'post', params: recoveryData, isPublic: true }),
3888
3894
  passwordAbandon: ({ number }) => ({ url: 'recovery/abandon', method: 'post', params: { number }, isPublic: true }),
3889
3895
  passwordAcknowledge: (acknowledgeData) => ({ url: 'recovery/acknowledge', method: 'post', params: acknowledgeData, isPublic: true }),
@@ -7890,17 +7896,17 @@ function invite_friends_activity (request) {
7890
7896
  bindingCode: null,
7891
7897
  uidSite: null,
7892
7898
  receiveNo: null,
7893
- affiliateCode: null,
7899
+ friendCode: null,
7894
7900
  downlineCount: 0,
7895
7901
  },
7896
7902
  initial: 'idle',
7897
7903
  states: {
7898
7904
  idle: {
7899
7905
  on: {
7900
- FETCH_AFFILIATE_CODE: {
7906
+ FETCH_FRIEND_CODE: {
7901
7907
  target: 'fetching',
7902
7908
  },
7903
- BIND_AFFILIATE_CODE: {
7909
+ BIND_FRIEND_CODE: {
7904
7910
  target: 'binding',
7905
7911
  actions: ['setActivityNo', 'setBindingCode', 'setUidSite'],
7906
7912
  },
@@ -7952,9 +7958,9 @@ function invite_friends_activity (request) {
7952
7958
  {
7953
7959
  actions: {
7954
7960
  setAffiliateCode: assign((context, event) => {
7955
- const { affiliateCode, downlineCount } = event.data;
7961
+ const { friendCode, downlineCount } = event.data;
7956
7962
  return {
7957
- affiliateCode,
7963
+ friendCode,
7958
7964
  downlineCount,
7959
7965
  }
7960
7966
  }),
@@ -7976,7 +7982,7 @@ function invite_friends_activity (request) {
7976
7982
  },
7977
7983
  services: {
7978
7984
  postAffiliate: async (context, event) => {
7979
- return await request.send(user.postAffiliate({ affiliateCode: context.bindingCode }))
7985
+ return await request.send(user.postAffiliate({ friendCode: context.bindingCode }))
7980
7986
  },
7981
7987
  fetchAffiliate: async (context, event) => {
7982
7988
  return await request.send(user.getAffiliate())
@@ -7991,18 +7997,18 @@ function invite_friends_activity (request) {
7991
7997
  )
7992
7998
  }
7993
7999
 
7994
- function affiliate_invite_friends_activity (request) {
8000
+ function friend_invite_friends_activity (request) {
7995
8001
  const { appSecret } = request.config;
7996
8002
  return createMachine(
7997
8003
  {
7998
- id: 'affiliate_invite_friends_activity',
8004
+ id: 'friend_invite_friends_activity',
7999
8005
  context: {
8000
- affiliateEnable: false,
8006
+ friendsEnable: false,
8001
8007
  activityNo: null,
8002
8008
  bindingCode: null,
8003
8009
  uidSite: null,
8004
8010
  receiveNo: null,
8005
- affiliateCode: '',
8011
+ friendCode: '',
8006
8012
  commission: 0,
8007
8013
  downLine: 0,
8008
8014
  activeDownLine: 0,
@@ -8016,10 +8022,10 @@ function affiliate_invite_friends_activity (request) {
8016
8022
  states: {
8017
8023
  fetching1: {
8018
8024
  invoke: {
8019
- src: 'fetchAffiliateCode',
8025
+ src: 'fetchFriendsCode',
8020
8026
  onDone: {
8021
8027
  target: 'checking',
8022
- actions: 'setAffiliateCode',
8028
+ actions: 'setFriendsCode',
8023
8029
  },
8024
8030
  onError: {
8025
8031
  target: 'fetching2',
@@ -8027,11 +8033,11 @@ function affiliate_invite_friends_activity (request) {
8027
8033
  },
8028
8034
  },
8029
8035
  checking: {
8030
- always: [{ target: 'fetching2', cond: 'isAffiliateEnable' }, { target: 'idle' }],
8036
+ always: [{ target: 'fetching2', cond: 'isFriendsEnable' }, { target: 'idle' }],
8031
8037
  },
8032
8038
  fetching2: {
8033
8039
  invoke: {
8034
- src: 'fetchAffiliateData',
8040
+ src: 'fetchFriendsData',
8035
8041
  onDone: {
8036
8042
  target: 'idle',
8037
8043
  actions: 'setInitialData',
@@ -8043,7 +8049,7 @@ function affiliate_invite_friends_activity (request) {
8043
8049
  },
8044
8050
  idle: {
8045
8051
  on: {
8046
- BIND_AFFILIATE_CODE: {
8052
+ BIND_FRIEND_CODE: {
8047
8053
  target: 'binding',
8048
8054
  actions: ['setBindingCode', 'setUidSite', 'setActivityNo'],
8049
8055
  },
@@ -8060,7 +8066,7 @@ function affiliate_invite_friends_activity (request) {
8060
8066
  },
8061
8067
  binding: {
8062
8068
  invoke: {
8063
- src: 'postAffiliate',
8069
+ src: 'postFriends',
8064
8070
  onDone: {
8065
8071
  target: 'awarding',
8066
8072
  },
@@ -8104,10 +8110,10 @@ function affiliate_invite_friends_activity (request) {
8104
8110
  },
8105
8111
  {
8106
8112
  actions: {
8107
- setAffiliateCode: assign((context, event) => {
8108
- const { affiliateCode = '' } = event.data || {};
8113
+ setFriendsCode: assign((context, event) => {
8114
+ const { friendCode = '' } = event.data || {};
8109
8115
  return {
8110
- affiliateCode,
8116
+ friendCode,
8111
8117
  }
8112
8118
  }),
8113
8119
  setInitialData: assign((context, event) => {
@@ -8164,20 +8170,20 @@ function affiliate_invite_friends_activity (request) {
8164
8170
  const { page } = context.levelDownLine;
8165
8171
  return page.current < page.total
8166
8172
  },
8167
- isAffiliateEnable: (context, event) => context.affiliateEnable,
8173
+ isFriendsEnable: (context, event) => context.friendsEnable,
8168
8174
  },
8169
8175
  services: {
8170
- fetchAffiliateCode: async () => {
8171
- return await request.send(user.getAffiliate())
8176
+ fetchFriendsCode: async () => {
8177
+ return await request.send(user.getFriends())
8172
8178
  },
8173
- fetchAffiliateData: async (context, event) => {
8174
- const affiliateHomeAPI = request.send(user.getAffiliateHome());
8175
- const affiliateDashboard = request.send(user.getAffiliateDashboard());
8176
- const [affiliateHomeData, affiliateDashboardData] = await Promise.all([affiliateHomeAPI, affiliateDashboard]);
8177
- return [affiliateHomeData, affiliateDashboardData]
8179
+ fetchFriendsData: async (context, event) => {
8180
+ const friendsHomeAPI = request.send(user.getFriendsHome());
8181
+ const friendsDashboard = request.send(user.getFriendsDashboard());
8182
+ const [friendsHomeData, friendsDashboardData] = await Promise.all([friendsHomeAPI, friendsDashboard]);
8183
+ return [friendsHomeData, friendsDashboardData]
8178
8184
  },
8179
- postAffiliate: async (context, event) => {
8180
- return await request.send(user.postAffiliate({ affiliateCode: context.bindingCode }))
8185
+ postFriends: async (context, event) => {
8186
+ return await request.send(user.postFriends({ friendCode: context.bindingCode }))
8181
8187
  },
8182
8188
  awardPrize: async (context, event) => {
8183
8189
  const { activityNo, uidSite, bindingCode } = context;
@@ -8188,7 +8194,7 @@ function affiliate_invite_friends_activity (request) {
8188
8194
  const { currentLevel, page, levelDownLine } = context;
8189
8195
  const copiedObj = JSON.parse(JSON.stringify(levelDownLine));
8190
8196
  const copiedList = copiedObj.data;
8191
- const resopnseData = await request.send(user.getAffiliateDashboardList({ level: currentLevel, page, row: 10 }));
8197
+ const resopnseData = await request.send(user.getFriendsDashboardList({ level: currentLevel, page, row: 10 }));
8192
8198
  if (!!copiedList && !!resopnseData?.data) {
8193
8199
  const combindData = {
8194
8200
  ...resopnseData,
@@ -9197,7 +9203,7 @@ var activity = {
9197
9203
  diamond_shop_activity_vn,
9198
9204
  fafafa_activity,
9199
9205
  invite_friends_activity,
9200
- affiliate_invite_friends_activity,
9206
+ friend_invite_friends_activity,
9201
9207
  ranking_activity,
9202
9208
  return_bonus_activity,
9203
9209
  specify_bets_activity,
@@ -15389,7 +15395,7 @@ function auth (request) {
15389
15395
  userInfo: {},
15390
15396
  redirectURL: null,
15391
15397
  reCaptchaToken: null,
15392
- affiliate: null,
15398
+ fc: null,
15393
15399
  },
15394
15400
  states: {
15395
15401
  idle: {
@@ -15674,7 +15680,7 @@ function auth (request) {
15674
15680
  return { token }
15675
15681
  }),
15676
15682
  redirectTo3Party: async (context, event) => {
15677
- const { provider, channel, subchannel, affiliate } = event.data;
15683
+ const { provider, channel, subchannel, fc } = event.data;
15678
15684
 
15679
15685
  const dt = await getDeviceToken({
15680
15686
  fpToken,
@@ -15683,7 +15689,7 @@ function auth (request) {
15683
15689
  });
15684
15690
  sentry.setTag('dt', dt);
15685
15691
 
15686
- const referralCode = storage.get('referralCode');
15692
+ const affiliateCode = storage.get('ac');
15687
15693
  const messages = {
15688
15694
  url: window.location.href,
15689
15695
  channelOrders: [
@@ -15691,13 +15697,13 @@ function auth (request) {
15691
15697
  { channel: defaultChannel, subchannel: defaultSubchannel },
15692
15698
  { channel: channel, subchannel: subchannel },
15693
15699
  ],
15694
- referralCode,
15700
+ affiliateCode,
15695
15701
  };
15696
15702
  sentry.captureMessage(JSON.stringify(messages));
15697
15703
 
15698
15704
  const referralObj = {};
15699
15705
  if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
15700
- referralObj.referralCode = referralCode;
15706
+ referralObj.ac = affiliateCode;
15701
15707
  }
15702
15708
 
15703
15709
  referralObj.channel = storage.get('channel') || defaultChannel || channel;
@@ -15712,7 +15718,7 @@ function auth (request) {
15712
15718
  ...referralObj,
15713
15719
  // dt,
15714
15720
  platform: 'pwa',
15715
- affiliate,
15721
+ fc,
15716
15722
  }).toString()
15717
15723
  );
15718
15724
 
@@ -16824,7 +16830,7 @@ function common (request) {
16824
16830
  sentNormalBroadcastList: [],
16825
16831
  channel: null,
16826
16832
  subchannel: null,
16827
- referralCode: null,
16833
+ affiliateCode: null,
16828
16834
  },
16829
16835
  states: {
16830
16836
  config: {
@@ -16940,7 +16946,7 @@ function common (request) {
16940
16946
  let urlParams = new URLSearchParams(window.location.search);
16941
16947
  const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official';
16942
16948
  const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa';
16943
- const referralCode = urlParams.get('referralCode') || storage.get('referralCode');
16949
+ const affiliateCode = urlParams.get('ac') || urlParams.get('referralCode') || storage.get('ac') || storage.get('referralCode');
16944
16950
 
16945
16951
  storage.set('channel', channel, {
16946
16952
  path: '/',
@@ -16950,7 +16956,7 @@ function common (request) {
16950
16956
  path: '/',
16951
16957
  maxAge: 60 * 60 * 24 * 7,
16952
16958
  });
16953
- storage.set('referralCode', referralCode, {
16959
+ storage.set('ac', affiliateCode, {
16954
16960
  path: '/',
16955
16961
  maxAge: 60 * 60 * 24 * 7,
16956
16962
  });
@@ -16958,7 +16964,7 @@ function common (request) {
16958
16964
  return {
16959
16965
  channel,
16960
16966
  subchannel,
16961
- referralCode,
16967
+ affiliateCode,
16962
16968
  }
16963
16969
  }
16964
16970
  }),
@@ -17758,6 +17764,7 @@ function game_v2_1 (request) {
17758
17764
  id: 'game',
17759
17765
  type: 'parallel',
17760
17766
  context: {
17767
+ base: '',
17761
17768
  loadable: false,
17762
17769
  isLastPage: false,
17763
17770
  room: null,
@@ -18117,6 +18124,7 @@ function game_v2_1 (request) {
18117
18124
  }
18118
18125
  },
18119
18126
  connectGame: async (context, event) => {
18127
+ const returnProviders = ['RSG', 'KP', 'EPICWIN', 'KA', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG'];
18120
18128
  const { lang, isMobile } = context;
18121
18129
  const { providerId, gameId, gameTypeId, mappingId } = context.game;
18122
18130
  const params = {
@@ -18127,7 +18135,7 @@ function game_v2_1 (request) {
18127
18135
  is_demo: false,
18128
18136
  is_mobile: isMobile,
18129
18137
  lang,
18130
- return_url: window.location.href,
18138
+ return_url: returnProviders.includes(providerId) ? `${window.location.origin}${context.base}return` : window.location.href, // For providers to return.
18131
18139
  };
18132
18140
  const { redirect_url } = await request.send(game$1.playGame(params));
18133
18141
  return { gameURL: redirect_url }
@@ -20237,7 +20245,7 @@ function user_sign_up (request) {
20237
20245
  channel: null,
20238
20246
  subchannel: null,
20239
20247
  signUpData: {},
20240
- affiliate: null,
20248
+ fc: null,
20241
20249
  reCaptchaToken: null,
20242
20250
  registrationData: {
20243
20251
  account: null,
@@ -20284,9 +20292,9 @@ function user_sign_up (request) {
20284
20292
  }
20285
20293
  }),
20286
20294
  setAffiliate: assign((context, event) => {
20287
- const { affiliate } = event.data;
20295
+ const { fc } = event.data;
20288
20296
  return {
20289
- affiliate,
20297
+ fc,
20290
20298
  }
20291
20299
  }),
20292
20300
  setSignUpPhone: assign((context, event) => {
@@ -20335,7 +20343,7 @@ function user_sign_up (request) {
20335
20343
  const dt = await getDeviceToken({ fpToken, sentry, hosts: request.hosts });
20336
20344
  sentry.setTag('dt', dt);
20337
20345
 
20338
- const referralCode = storage.get('referralCode');
20346
+ const affiliateCode = storage.get('ac');
20339
20347
  const messages = {
20340
20348
  url: window.location.href,
20341
20349
  channelOrders: [
@@ -20343,13 +20351,13 @@ function user_sign_up (request) {
20343
20351
  { channel: defaultChannel, subchannel: defaultSubchannel },
20344
20352
  { channel: channel, subchannel: subchannel },
20345
20353
  ],
20346
- referralCode,
20354
+ affiliateCode,
20347
20355
  };
20348
20356
  sentry.captureMessage(JSON.stringify(messages));
20349
20357
 
20350
20358
  const referralObj = {};
20351
20359
  if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
20352
- referralObj.referralCode = referralCode;
20360
+ referralObj.ac = affiliateCode;
20353
20361
  }
20354
20362
 
20355
20363
  referralObj.channel = storage.get('channel') || defaultChannel || channel;
@@ -20361,7 +20369,7 @@ function user_sign_up (request) {
20361
20369
  ...referralObj,
20362
20370
  dt,
20363
20371
  reCaptchaToken: context.reCaptchaToken,
20364
- affiliate: context.affiliate,
20372
+ fc: context.fc,
20365
20373
  })
20366
20374
  )
20367
20375
  },
@@ -23276,7 +23284,7 @@ function loadcard_vn (request) {
23276
23284
  actions: 'setAmount',
23277
23285
  },
23278
23286
  CONFIRM: {
23279
- target: 'calculating',
23287
+ target: 'debouncing',
23280
23288
  },
23281
23289
  BACK: {
23282
23290
  target: 'loaded',
@@ -23302,10 +23310,25 @@ function loadcard_vn (request) {
23302
23310
  calculating: {
23303
23311
  invoke: {
23304
23312
  src: 'fetchCalculation',
23305
- onDone: {
23306
- target: 'calculated',
23307
- actions: 'setCalculation',
23308
- },
23313
+ onDone: [
23314
+ {
23315
+ target: 'submitting',
23316
+ actions: 'setCalculation',
23317
+ cond: (context, event) => {
23318
+ const { siteConfig = {}, selectedCard = {} } = context;
23319
+ return siteConfig.walletMode === '2' && selectedCard.jumpLinkEnable === 1
23320
+ },
23321
+ },
23322
+ {
23323
+ target: 'cardInfo',
23324
+ actions: 'setCalculation',
23325
+ cond: 'isFreeWalletMode',
23326
+ },
23327
+ {
23328
+ target: 'calculated',
23329
+ actions: 'setCalculation',
23330
+ },
23331
+ ],
23309
23332
  onError: {
23310
23333
  target: 'calculable',
23311
23334
  },
@@ -23314,10 +23337,17 @@ function loadcard_vn (request) {
23314
23337
  calculable: {
23315
23338
  entry: 'clearCalculation',
23316
23339
  on: {
23317
- SELECT_AMOUNT: {
23318
- target: 'debouncing',
23319
- actions: 'setAmount',
23320
- },
23340
+ SELECT_AMOUNT: [
23341
+ {
23342
+ target: 'pending',
23343
+ actions: 'setAmount',
23344
+ cond: 'isFreeWalletMode',
23345
+ },
23346
+ {
23347
+ target: 'debouncing',
23348
+ actions: 'setAmount',
23349
+ },
23350
+ ],
23321
23351
  BACK: {
23322
23352
  target: 'loaded',
23323
23353
  },
@@ -23482,6 +23512,9 @@ function loadcard_vn (request) {
23482
23512
  isFreeWalletMode: (context, event) => {
23483
23513
  return context.siteConfig?.walletMode === '2'
23484
23514
  },
23515
+ isDoubleWalletMode: (context, event) => {
23516
+ return context.siteConfig?.walletMode === '4'
23517
+ },
23485
23518
  isSubmittable: (context, event) => {
23486
23519
  const { cardNumber, serialNumber } = context;
23487
23520
  return cardNumber && serialNumber
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.74-1",
3
+ "version": "1.1.74-ac",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -50,4 +50,5 @@ export default {
50
50
  exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
51
51
  collect: (data) => ({ url: 'activities/collect', method: 'post', params: data }),
52
52
  getVipTable: () => ({ url: 'activities/viptable', method: 'get' }),
53
+ getRankingList: () => ({ url: 'activities/ranking', method: 'get' }),
53
54
  }
package/src/api/auth.js CHANGED
@@ -31,8 +31,8 @@ export default {
31
31
  },
32
32
  isPublic: true,
33
33
  }),
34
- register: ({ channel, subchannel, referralCode, affiliate = null, reCaptchaToken, dt, ...rest }) => {
35
- const params = pickBy({ channel, subchannel, referralCode, affiliate }, (value) => {
34
+ register: ({ channel, subchannel, ac, fc = null, reCaptchaToken, dt, ...rest }) => {
35
+ const params = pickBy({ channel, subchannel, ac, fc }, (value) => {
36
36
  return value !== undefined && value !== null
37
37
  })
38
38
  const qs = Object.keys(params)
package/src/api/user.js CHANGED
@@ -14,6 +14,11 @@ export default {
14
14
  getAffiliateDashboard: () => ({ url: 'affiliate/dashboard', method: 'get' }),
15
15
  getAffiliateDashboardList: ({ level, page, row }) => ({ url: 'affiliate/dashboard/list', method: 'post', params: { level, page, row } }),
16
16
  postAffiliate: ({ affiliateCode }) => ({ url: 'affiliate', method: 'post', params: { affiliateCode } }),
17
+ getFriends: () => ({ url: 'friends', method: 'get' }),
18
+ getFriendsHome: () => ({ url: 'friends/home', method: 'get' }),
19
+ getFriendsDashboard: () => ({ url: 'friends/dashboard', method: 'get' }),
20
+ getFriendsDashboardList: ({ level, page, row }) => ({ url: 'friends/dashboard/list', method: 'post', params: { level, page, row } }),
21
+ postFriends: ({ friendCode }) => ({ url: 'friends', method: 'post', params: { friendCode } }),
17
22
  passwordRecovery: (recoveryData) => ({ url: 'recovery', method: 'post', params: recoveryData, isPublic: true }),
18
23
  passwordAbandon: ({ number }) => ({ url: 'recovery/abandon', method: 'post', params: { number }, isPublic: true }),
19
24
  passwordAcknowledge: (acknowledgeData) => ({ url: 'recovery/acknowledge', method: 'post', params: acknowledgeData, isPublic: true }),
@@ -6,14 +6,14 @@ export default function (request) {
6
6
  const { appSecret } = request.config
7
7
  return createMachine(
8
8
  {
9
- id: 'affiliate_invite_friends_activity',
9
+ id: 'friend_invite_friends_activity',
10
10
  context: {
11
- affiliateEnable: false,
11
+ friendsEnable: false,
12
12
  activityNo: null,
13
13
  bindingCode: null,
14
14
  uidSite: null,
15
15
  receiveNo: null,
16
- affiliateCode: '',
16
+ friendCode: '',
17
17
  commission: 0,
18
18
  downLine: 0,
19
19
  activeDownLine: 0,
@@ -27,10 +27,10 @@ export default function (request) {
27
27
  states: {
28
28
  fetching1: {
29
29
  invoke: {
30
- src: 'fetchAffiliateCode',
30
+ src: 'fetchFriendsCode',
31
31
  onDone: {
32
32
  target: 'checking',
33
- actions: 'setAffiliateCode',
33
+ actions: 'setFriendsCode',
34
34
  },
35
35
  onError: {
36
36
  target: 'fetching2',
@@ -38,11 +38,11 @@ export default function (request) {
38
38
  },
39
39
  },
40
40
  checking: {
41
- always: [{ target: 'fetching2', cond: 'isAffiliateEnable' }, { target: 'idle' }],
41
+ always: [{ target: 'fetching2', cond: 'isFriendsEnable' }, { target: 'idle' }],
42
42
  },
43
43
  fetching2: {
44
44
  invoke: {
45
- src: 'fetchAffiliateData',
45
+ src: 'fetchFriendsData',
46
46
  onDone: {
47
47
  target: 'idle',
48
48
  actions: 'setInitialData',
@@ -54,7 +54,7 @@ export default function (request) {
54
54
  },
55
55
  idle: {
56
56
  on: {
57
- BIND_AFFILIATE_CODE: {
57
+ BIND_FRIEND_CODE: {
58
58
  target: 'binding',
59
59
  actions: ['setBindingCode', 'setUidSite', 'setActivityNo'],
60
60
  },
@@ -71,7 +71,7 @@ export default function (request) {
71
71
  },
72
72
  binding: {
73
73
  invoke: {
74
- src: 'postAffiliate',
74
+ src: 'postFriends',
75
75
  onDone: {
76
76
  target: 'awarding',
77
77
  },
@@ -115,10 +115,10 @@ export default function (request) {
115
115
  },
116
116
  {
117
117
  actions: {
118
- setAffiliateCode: assign((context, event) => {
119
- const { affiliateCode = '' } = event.data || {}
118
+ setFriendsCode: assign((context, event) => {
119
+ const { friendCode = '' } = event.data || {}
120
120
  return {
121
- affiliateCode,
121
+ friendCode,
122
122
  }
123
123
  }),
124
124
  setInitialData: assign((context, event) => {
@@ -175,20 +175,20 @@ export default function (request) {
175
175
  const { page } = context.levelDownLine
176
176
  return page.current < page.total
177
177
  },
178
- isAffiliateEnable: (context, event) => context.affiliateEnable,
178
+ isFriendsEnable: (context, event) => context.friendsEnable,
179
179
  },
180
180
  services: {
181
- fetchAffiliateCode: async () => {
182
- return await request.send(user.getAffiliate())
181
+ fetchFriendsCode: async () => {
182
+ return await request.send(user.getFriends())
183
183
  },
184
- fetchAffiliateData: async (context, event) => {
185
- const affiliateHomeAPI = request.send(user.getAffiliateHome())
186
- const affiliateDashboard = request.send(user.getAffiliateDashboard())
187
- const [affiliateHomeData, affiliateDashboardData] = await Promise.all([affiliateHomeAPI, affiliateDashboard])
188
- return [affiliateHomeData, affiliateDashboardData]
184
+ fetchFriendsData: async (context, event) => {
185
+ const friendsHomeAPI = request.send(user.getFriendsHome())
186
+ const friendsDashboard = request.send(user.getFriendsDashboard())
187
+ const [friendsHomeData, friendsDashboardData] = await Promise.all([friendsHomeAPI, friendsDashboard])
188
+ return [friendsHomeData, friendsDashboardData]
189
189
  },
190
- postAffiliate: async (context, event) => {
191
- return await request.send(user.postAffiliate({ affiliateCode: context.bindingCode }))
190
+ postFriends: async (context, event) => {
191
+ return await request.send(user.postFriends({ friendCode: context.bindingCode }))
192
192
  },
193
193
  awardPrize: async (context, event) => {
194
194
  const { activityNo, uidSite, bindingCode } = context
@@ -199,7 +199,7 @@ export default function (request) {
199
199
  const { currentLevel, page, levelDownLine } = context
200
200
  const copiedObj = JSON.parse(JSON.stringify(levelDownLine))
201
201
  const copiedList = copiedObj.data
202
- const resopnseData = await request.send(user.getAffiliateDashboardList({ level: currentLevel, page, row: 10 }))
202
+ const resopnseData = await request.send(user.getFriendsDashboardList({ level: currentLevel, page, row: 10 }))
203
203
  if (!!copiedList && !!resopnseData?.data) {
204
204
  const combindData = {
205
205
  ...resopnseData,
@@ -4,7 +4,7 @@ import diamond_shop_activity_fc from './diamond_shop_activity_fc.js'
4
4
  import diamond_shop_activity_vn from './diamond_shop_activity_vn.js'
5
5
  import fafafa_activity from './fafafa_activity.js'
6
6
  import invite_friends_activity from './invite_friends_activity.js'
7
- import affiliate_invite_friends_activity from './affiliate_invite_friends_activity.js'
7
+ import friend_invite_friends_activity from './friend_invite_friends_activity.js'
8
8
  import ranking_activity from './ranking_activity.js'
9
9
  import return_bonus_activity from './return_bonus_activity.js'
10
10
  import specify_bets_activity from './specify_bets_activity.js'
@@ -22,7 +22,7 @@ export default {
22
22
  diamond_shop_activity_vn,
23
23
  fafafa_activity,
24
24
  invite_friends_activity,
25
- affiliate_invite_friends_activity,
25
+ friend_invite_friends_activity,
26
26
  ranking_activity,
27
27
  return_bonus_activity,
28
28
  specify_bets_activity,
@@ -12,17 +12,17 @@ export default function (request) {
12
12
  bindingCode: null,
13
13
  uidSite: null,
14
14
  receiveNo: null,
15
- affiliateCode: null,
15
+ friendCode: null,
16
16
  downlineCount: 0,
17
17
  },
18
18
  initial: 'idle',
19
19
  states: {
20
20
  idle: {
21
21
  on: {
22
- FETCH_AFFILIATE_CODE: {
22
+ FETCH_FRIEND_CODE: {
23
23
  target: 'fetching',
24
24
  },
25
- BIND_AFFILIATE_CODE: {
25
+ BIND_FRIEND_CODE: {
26
26
  target: 'binding',
27
27
  actions: ['setActivityNo', 'setBindingCode', 'setUidSite'],
28
28
  },
@@ -74,9 +74,9 @@ export default function (request) {
74
74
  {
75
75
  actions: {
76
76
  setAffiliateCode: assign((context, event) => {
77
- const { affiliateCode, downlineCount } = event.data
77
+ const { friendCode, downlineCount } = event.data
78
78
  return {
79
- affiliateCode,
79
+ friendCode,
80
80
  downlineCount,
81
81
  }
82
82
  }),
@@ -98,7 +98,7 @@ export default function (request) {
98
98
  },
99
99
  services: {
100
100
  postAffiliate: async (context, event) => {
101
- return await request.send(user.postAffiliate({ affiliateCode: context.bindingCode }))
101
+ return await request.send(user.postAffiliate({ friendCode: context.bindingCode }))
102
102
  },
103
103
  fetchAffiliate: async (context, event) => {
104
104
  return await request.send(user.getAffiliate())
@@ -36,7 +36,7 @@ export default function (request) {
36
36
  userInfo: {},
37
37
  redirectURL: null,
38
38
  reCaptchaToken: null,
39
- affiliate: null,
39
+ fc: null,
40
40
  },
41
41
  states: {
42
42
  idle: {
@@ -321,7 +321,7 @@ export default function (request) {
321
321
  return { token }
322
322
  }),
323
323
  redirectTo3Party: async (context, event) => {
324
- const { provider, channel, subchannel, affiliate } = event.data
324
+ const { provider, channel, subchannel, fc } = event.data
325
325
 
326
326
  const dt = await getDeviceToken({
327
327
  fpToken,
@@ -330,7 +330,7 @@ export default function (request) {
330
330
  })
331
331
  sentry.setTag('dt', dt)
332
332
 
333
- const referralCode = storage.get('referralCode')
333
+ const affiliateCode = storage.get('ac')
334
334
  const messages = {
335
335
  url: window.location.href,
336
336
  channelOrders: [
@@ -338,13 +338,13 @@ export default function (request) {
338
338
  { channel: defaultChannel, subchannel: defaultSubchannel },
339
339
  { channel: channel, subchannel: subchannel },
340
340
  ],
341
- referralCode,
341
+ affiliateCode,
342
342
  }
343
343
  sentry.captureMessage(JSON.stringify(messages))
344
344
 
345
345
  const referralObj = {}
346
346
  if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
347
- referralObj.referralCode = referralCode
347
+ referralObj.ac = affiliateCode
348
348
  }
349
349
 
350
350
  referralObj.channel = storage.get('channel') || defaultChannel || channel
@@ -359,7 +359,7 @@ export default function (request) {
359
359
  ...referralObj,
360
360
  // dt,
361
361
  platform: 'pwa',
362
- affiliate,
362
+ fc,
363
363
  }).toString()
364
364
  )
365
365
 
@@ -41,7 +41,7 @@ export default function (request) {
41
41
  sentNormalBroadcastList: [],
42
42
  channel: null,
43
43
  subchannel: null,
44
- referralCode: null,
44
+ affiliateCode: null,
45
45
  },
46
46
  states: {
47
47
  config: {
@@ -157,7 +157,7 @@ export default function (request) {
157
157
  let urlParams = new URLSearchParams(window.location.search)
158
158
  const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official'
159
159
  const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa'
160
- const referralCode = urlParams.get('referralCode') || storage.get('referralCode')
160
+ const affiliateCode = urlParams.get('ac') || urlParams.get('referralCode') || storage.get('ac') || storage.get('referralCode')
161
161
 
162
162
  storage.set('channel', channel, {
163
163
  path: '/',
@@ -167,7 +167,7 @@ export default function (request) {
167
167
  path: '/',
168
168
  maxAge: 60 * 60 * 24 * 7,
169
169
  })
170
- storage.set('referralCode', referralCode, {
170
+ storage.set('ac', affiliateCode, {
171
171
  path: '/',
172
172
  maxAge: 60 * 60 * 24 * 7,
173
173
  })
@@ -175,7 +175,7 @@ export default function (request) {
175
175
  return {
176
176
  channel,
177
177
  subchannel,
178
- referralCode,
178
+ affiliateCode,
179
179
  }
180
180
  }
181
181
  }),
@@ -105,7 +105,7 @@ export default function (request) {
105
105
  actions: 'setAmount',
106
106
  },
107
107
  CONFIRM: {
108
- target: 'calculating',
108
+ target: 'debouncing',
109
109
  },
110
110
  BACK: {
111
111
  target: 'loaded',
@@ -131,10 +131,25 @@ export default function (request) {
131
131
  calculating: {
132
132
  invoke: {
133
133
  src: 'fetchCalculation',
134
- onDone: {
135
- target: 'calculated',
136
- actions: 'setCalculation',
137
- },
134
+ onDone: [
135
+ {
136
+ target: 'submitting',
137
+ actions: 'setCalculation',
138
+ cond: (context, event) => {
139
+ const { siteConfig = {}, selectedCard = {} } = context
140
+ return siteConfig.walletMode === '2' && selectedCard.jumpLinkEnable === 1
141
+ },
142
+ },
143
+ {
144
+ target: 'cardInfo',
145
+ actions: 'setCalculation',
146
+ cond: 'isFreeWalletMode',
147
+ },
148
+ {
149
+ target: 'calculated',
150
+ actions: 'setCalculation',
151
+ },
152
+ ],
138
153
  onError: {
139
154
  target: 'calculable',
140
155
  },
@@ -143,10 +158,17 @@ export default function (request) {
143
158
  calculable: {
144
159
  entry: 'clearCalculation',
145
160
  on: {
146
- SELECT_AMOUNT: {
147
- target: 'debouncing',
148
- actions: 'setAmount',
149
- },
161
+ SELECT_AMOUNT: [
162
+ {
163
+ target: 'pending',
164
+ actions: 'setAmount',
165
+ cond: 'isFreeWalletMode',
166
+ },
167
+ {
168
+ target: 'debouncing',
169
+ actions: 'setAmount',
170
+ },
171
+ ],
150
172
  BACK: {
151
173
  target: 'loaded',
152
174
  },
@@ -311,6 +333,9 @@ export default function (request) {
311
333
  isFreeWalletMode: (context, event) => {
312
334
  return context.siteConfig?.walletMode === '2'
313
335
  },
336
+ isDoubleWalletMode: (context, event) => {
337
+ return context.siteConfig?.walletMode === '4'
338
+ },
314
339
  isSubmittable: (context, event) => {
315
340
  const { cardNumber, serialNumber } = context
316
341
  return cardNumber && serialNumber
@@ -10,6 +10,7 @@ export default function (request) {
10
10
  id: 'game',
11
11
  type: 'parallel',
12
12
  context: {
13
+ base: '',
13
14
  loadable: false,
14
15
  isLastPage: false,
15
16
  room: null,
@@ -369,6 +370,7 @@ export default function (request) {
369
370
  }
370
371
  },
371
372
  connectGame: async (context, event) => {
373
+ const returnProviders = ['RSG', 'KP', 'EPICWIN', 'KA', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG']
372
374
  const { lang, isMobile } = context
373
375
  const { providerId, gameId, gameTypeId, mappingId } = context.game
374
376
  const params = {
@@ -379,7 +381,7 @@ export default function (request) {
379
381
  is_demo: false,
380
382
  is_mobile: isMobile,
381
383
  lang,
382
- return_url: window.location.href,
384
+ return_url: returnProviders.includes(providerId) ? `${window.location.origin}${context.base}return` : window.location.href, // For providers to return.
383
385
  }
384
386
  const { redirect_url } = await request.send(api.playGame(params))
385
387
  return { gameURL: redirect_url }
@@ -14,7 +14,7 @@ export default function (request) {
14
14
  channel: null,
15
15
  subchannel: null,
16
16
  signUpData: {},
17
- affiliate: null,
17
+ fc: null,
18
18
  reCaptchaToken: null,
19
19
  registrationData: {
20
20
  account: null,
@@ -61,9 +61,9 @@ export default function (request) {
61
61
  }
62
62
  }),
63
63
  setAffiliate: assign((context, event) => {
64
- const { affiliate } = event.data
64
+ const { fc } = event.data
65
65
  return {
66
- affiliate,
66
+ fc,
67
67
  }
68
68
  }),
69
69
  setSignUpPhone: assign((context, event) => {
@@ -112,7 +112,7 @@ export default function (request) {
112
112
  const dt = await getDeviceToken({ fpToken, sentry, hosts: request.hosts })
113
113
  sentry.setTag('dt', dt)
114
114
 
115
- const referralCode = storage.get('referralCode')
115
+ const affiliateCode = storage.get('ac')
116
116
  const messages = {
117
117
  url: window.location.href,
118
118
  channelOrders: [
@@ -120,13 +120,13 @@ export default function (request) {
120
120
  { channel: defaultChannel, subchannel: defaultSubchannel },
121
121
  { channel: channel, subchannel: subchannel },
122
122
  ],
123
- referralCode,
123
+ affiliateCode,
124
124
  }
125
125
  sentry.captureMessage(JSON.stringify(messages))
126
126
 
127
127
  const referralObj = {}
128
128
  if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
129
- referralObj.referralCode = referralCode
129
+ referralObj.ac = affiliateCode
130
130
  }
131
131
 
132
132
  referralObj.channel = storage.get('channel') || defaultChannel || channel
@@ -138,7 +138,7 @@ export default function (request) {
138
138
  ...referralObj,
139
139
  dt,
140
140
  reCaptchaToken: context.reCaptchaToken,
141
- affiliate: context.affiliate,
141
+ fc: context.fc,
142
142
  })
143
143
  )
144
144
  },