@opexa/portal-sdk 0.0.5 → 0.0.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.
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- var we = Object.defineProperty;
2
- var ge = (i, e, t) => e in i ? we(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var c = (i, e, t) => ge(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { ObjectId as w } from "@opexa/object-id";
1
+ var ge = Object.defineProperty;
2
+ var ye = (i, e, t) => e in i ? ge(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
+ var d = (i, e, t) => ye(i, typeof e != "symbol" ? e + "" : e, t);
4
+ import { ObjectId as f } from "@opexa/object-id";
5
5
  import { ObjectId as Ct } from "@opexa/object-id";
6
- const g = {
6
+ const w = {
7
7
  Account: 8,
8
8
  Deposit: 9,
9
9
  Withdrawal: 14,
@@ -12,9 +12,9 @@ const g = {
12
12
  GameSession: 204,
13
13
  MayaSession: 230
14
14
  };
15
- class pe {
15
+ class he {
16
16
  constructor(e) {
17
- c(this, "enabled");
17
+ d(this, "enabled");
18
18
  this.enabled = (e == null ? void 0 : e.enabled) ?? !0;
19
19
  }
20
20
  info(e) {
@@ -32,13 +32,13 @@ class pe {
32
32
  }
33
33
  function n(i, ...e) {
34
34
  let t = "";
35
- for (const [a, o] of i.entries()) {
36
- const d = e.at(a) ?? "";
37
- t = `${t}${o}${d}`;
35
+ for (const [a, r] of i.entries()) {
36
+ const s = e.at(a) ?? "";
37
+ t = `${t}${r}${s}`;
38
38
  }
39
39
  return t.trim();
40
40
  }
41
- const ye = n`
41
+ const be = n`
42
42
  query Announcements($first: Int, $after: Cursor, $filter: AnnouncementFilterInput) {
43
43
  announcements(first: $first, after: $after, filter: $filter) {
44
44
  edges {
@@ -64,15 +64,15 @@ const ye = n`
64
64
  }
65
65
  }
66
66
  }
67
- `, b = n`
67
+ `, y = n`
68
68
  fragment GameFragment on Game {
69
69
  id
70
70
  type
71
71
  name
72
72
  provider
73
73
  }
74
- `, be = n`
75
- ${b}
74
+ `, Ae = n`
75
+ ${y}
76
76
 
77
77
  query Game($id: ObjectId!) {
78
78
  node(id: $id) {
@@ -81,8 +81,8 @@ const ye = n`
81
81
  }
82
82
  }
83
83
  }
84
- `, Ae = n`
85
- ${b}
84
+ `, Se = n`
85
+ ${y}
86
86
 
87
87
  query Games($after: Cursor, $first: Int, $filter: GameFilterInput) {
88
88
  games(after: $after, first: $first, filter: $filter) {
@@ -101,16 +101,16 @@ const ye = n`
101
101
  }
102
102
  }
103
103
  }
104
- `, Se = n`
105
- ${b}
104
+ `, Ee = n`
105
+ ${y}
106
106
 
107
107
  query GamesByName($search: String!, $filter: GameFilterInput, $first: Int) {
108
108
  gamesByName(search: $search, filter: $filter, first: $first) {
109
109
  ...GameFragment
110
110
  }
111
111
  }
112
- `, Ee = n`
113
- ${b}
112
+ `, ke = n`
113
+ ${y}
114
114
 
115
115
  query GameSession($id: ObjectId!) {
116
116
  node(id: $id) {
@@ -126,7 +126,7 @@ const ye = n`
126
126
  }
127
127
  }
128
128
  }
129
- `, ke = n`
129
+ `, Ce = n`
130
130
  mutation CreateGameSession($input: CreateGameSessionInput!) {
131
131
  createGameSession(input: $input) {
132
132
  ... on GameDoesNotExistError {
@@ -135,12 +135,12 @@ const ye = n`
135
135
  }
136
136
  }
137
137
  }
138
- `, Ce = n`
138
+ `, Te = n`
139
139
  mutation EndGameSession($input: EndGameSessionInput!) {
140
140
  endGameSession(input: $input)
141
141
  }
142
- `, Te = n`
143
- ${b}
142
+ `, _e = n`
143
+ ${y}
144
144
 
145
145
  query BetRecords($first: Int, $after: Cursor, $filter: BetRecordFilterInput) {
146
146
  member {
@@ -179,7 +179,7 @@ const ye = n`
179
179
  }
180
180
  }
181
181
  }
182
- `, _e = n`
182
+ `, ve = n`
183
183
  query LatestBetRecords {
184
184
  latestBetRecords {
185
185
  id
@@ -198,7 +198,7 @@ const ye = n`
198
198
  }
199
199
  }
200
200
 
201
- ${b}
201
+ ${y}
202
202
  `, A = n`
203
203
  fragment FileFragment on File {
204
204
  id
@@ -206,7 +206,7 @@ const ye = n`
206
206
  status
207
207
  dateTimeCreated
208
208
  }
209
- `, de = n`
209
+ `, me = n`
210
210
  ${A}
211
211
 
212
212
  query File($id: ObjectId!) {
@@ -251,7 +251,7 @@ const fe = n`
251
251
  dateTimeCreated
252
252
  dateTimeLastUpdated
253
253
  }
254
- `, ve = n`
254
+ `, De = n`
255
255
  ${fe}
256
256
 
257
257
  query Cashbacks {
@@ -259,7 +259,7 @@ const fe = n`
259
259
  ...CashbackFragment
260
260
  }
261
261
  }
262
- `, S = n`
262
+ `, E = n`
263
263
  ${A}
264
264
 
265
265
  fragment PromoFragment on Promo {
@@ -278,16 +278,16 @@ const fe = n`
278
278
  dateTimeCreated
279
279
  dateTimeLastUpdated
280
280
  }
281
- `, De = n`
282
- ${S}
281
+ `, Me = n`
282
+ ${E}
283
283
 
284
284
  query Promos {
285
285
  promos {
286
286
  ...PromoFragment
287
287
  }
288
288
  }
289
- `, Me = n`
290
- ${S}
289
+ `, Ne = n`
290
+ ${E}
291
291
 
292
292
  query AvailablePromos($filter: PromoFilterInput) {
293
293
  availablePromos(filter: $filter) {
@@ -295,7 +295,7 @@ const fe = n`
295
295
  }
296
296
  }
297
297
  `, Re = n`
298
- ${S}
298
+ ${E}
299
299
 
300
300
  query Bonus {
301
301
  bonus {
@@ -323,7 +323,7 @@ const fe = n`
323
323
  dateTimeLastUpdated
324
324
  }
325
325
  }
326
- `, Ne = n`
326
+ `, Ie = n`
327
327
  ${fe}
328
328
 
329
329
  query CashbackBonuses {
@@ -337,7 +337,7 @@ const fe = n`
337
337
  dateTimeLastUpdated
338
338
  }
339
339
  }
340
- `, Ie = n`
340
+ `, Ge = n`
341
341
  mutation ClaimCashbackBonus($input: ClaimCashbackBonusInput!) {
342
342
  claimCashbackBonus(input: $input) {
343
343
  ... on CashbackBonusDoesNotExistError {
@@ -346,7 +346,7 @@ const fe = n`
346
346
  }
347
347
  }
348
348
  }
349
- `, Ge = n`
349
+ `, $e = n`
350
350
  query DepositRecords($after: Cursor, $first: Int, $filter: DepositRecordFilterInput) {
351
351
  member {
352
352
  depositRecords(after: $after, first: $first, filter: $filter) {
@@ -375,7 +375,7 @@ const fe = n`
375
375
  }
376
376
  }
377
377
  }
378
- `, $e = n`
378
+ `, Pe = n`
379
379
  mutation CreateGCashDeposit($input: CreateGCashDepositInput!) {
380
380
  createGCashDeposit(input: $input) {
381
381
  ... on DepositPromoMaximumAmountExceededError {
@@ -412,7 +412,7 @@ const fe = n`
412
412
  }
413
413
  }
414
414
  }
415
- `, Pe = n`
415
+ `, We = n`
416
416
  mutation CreateMayaDeposit($input: CreateMayaDepositInput!) {
417
417
  createMayaDeposit(input: $input) {
418
418
  ... on DepositPromoMaximumAmountExceededError {
@@ -449,7 +449,7 @@ const fe = n`
449
449
  }
450
450
  }
451
451
  }
452
- `, Ue = n`
452
+ `, Be = n`
453
453
  mutation CreateMayaAppDeposit($input: CreateMayaAppDepositInput!) {
454
454
  createMayaAppDeposit(input: $input) {
455
455
  ... on DepositPromoMaximumAmountExceededError {
@@ -486,7 +486,7 @@ const fe = n`
486
486
  }
487
487
  }
488
488
  }
489
- `, We = n`
489
+ `, Ue = n`
490
490
  query Deposit($id: ObjectId!) {
491
491
  node(id: $id) {
492
492
  ... on GCashDeposit {
@@ -527,13 +527,13 @@ const fe = n`
527
527
  }
528
528
  }
529
529
  }
530
- `, Be = n`
530
+ `, xe = n`
531
531
  query DepositsCount {
532
532
  member {
533
533
  depositsCount
534
534
  }
535
535
  }
536
- `, xe = n`
536
+ `, qe = n`
537
537
  query Member {
538
538
  member {
539
539
  dateTimeLastActive
@@ -562,7 +562,7 @@ const fe = n`
562
562
  }
563
563
  }
564
564
  }
565
- `, qe = n`
565
+ `, Fe = n`
566
566
  ${A}
567
567
 
568
568
  query MemberVerification {
@@ -586,7 +586,7 @@ const fe = n`
586
586
  }
587
587
  }
588
588
  }
589
- `, Fe = n`
589
+ `, Le = n`
590
590
  mutation RegisterMemberAccount(
591
591
  $input: RegisterMemberAccountInput!
592
592
  $referralCode: String
@@ -629,7 +629,7 @@ const fe = n`
629
629
  }
630
630
  }
631
631
  }
632
- `, Le = n`
632
+ `, Ve = n`
633
633
  mutation UpdateMemberAccount($input: UpdateMemberAccountInput!) {
634
634
  updateMemberAccount(input: $input) {
635
635
  ... on AccountNameNotAvailableError {
@@ -662,7 +662,7 @@ const fe = n`
662
662
  }
663
663
  }
664
664
  }
665
- `, Ve = n`
665
+ `, He = n`
666
666
  mutation ResetPassword($input: ResetPasswordInput!, $verificationCode: String) {
667
667
  resetPassword(input: $input, verificationCode: $verificationCode) {
668
668
  ... on AccountNotFoundError {
@@ -675,11 +675,11 @@ const fe = n`
675
675
  }
676
676
  }
677
677
  }
678
- `, He = n`
678
+ `, Ye = n`
679
679
  mutation DeleteMemberAccount($input: DeleteMemberAccountInput!) {
680
680
  deleteMemberAccount(input: $input)
681
681
  }
682
- `, Ye = n`
682
+ `, je = n`
683
683
  mutation SendVerificationCode($input: SendVerificationCodeInput!) {
684
684
  sendVerificationCode(input: $input) {
685
685
  ... on InvalidPlatformError {
@@ -692,7 +692,7 @@ const fe = n`
692
692
  }
693
693
  }
694
694
  }
695
- `, je = n`
695
+ `, Qe = n`
696
696
  mutation VerifyMobileNumber($input: VerifyMobileNumberInput!) {
697
697
  verifyMobileNumber(input: $input) {
698
698
  ... on InvalidSMSVerificationCodeError {
@@ -705,7 +705,7 @@ const fe = n`
705
705
  }
706
706
  }
707
707
  }
708
- `, Qe = n`
708
+ `, Ke = n`
709
709
  mutation CreateMemberVerification($input: CreateMemberVerificationInput!) {
710
710
  createMemberVerification(input: $input) {
711
711
  ... on FileDoesNotExistError {
@@ -722,7 +722,7 @@ const fe = n`
722
722
  }
723
723
  }
724
724
  }
725
- `, Ke = n`
725
+ `, ze = n`
726
726
  mutation UpdateMemberVerification($input: UpdateMemberVerificationInput!) {
727
727
  updateMemberVerification(input: $input) {
728
728
  ... on FileDoesNotExistError {
@@ -743,7 +743,7 @@ const fe = n`
743
743
  }
744
744
  }
745
745
  }
746
- `, ze = n`
746
+ `, Je = n`
747
747
  query ProfileCompletion {
748
748
  profileCompletion {
749
749
  completionPercentage
@@ -754,7 +754,7 @@ const fe = n`
754
754
  accountPassword
755
755
  }
756
756
  }
757
- `, Je = n`
757
+ `, Ze = n`
758
758
  fragment DepositGatewaySettingsCoreData on DepositGatewaySettings {
759
759
  minimumAmount
760
760
  maximumAmount
@@ -808,7 +808,7 @@ const fe = n`
808
808
  multiplier
809
809
  }
810
810
  }
811
- `, Ze = n`
811
+ `, Xe = n`
812
812
  query PointsWallet {
813
813
  pointsWallet {
814
814
  id
@@ -817,7 +817,7 @@ const fe = n`
817
817
  dateTimeCreated
818
818
  }
819
819
  }
820
- `, Xe = n`
820
+ `, et = n`
821
821
  mutation PointsToCashConversion($input: PointsToCashConversionInput!) {
822
822
  pointsToCashConversion(input: $input) {
823
823
  ... on InsufficientPointsError {
@@ -826,7 +826,7 @@ const fe = n`
826
826
  }
827
827
  }
828
828
  }
829
- `, et = n`
829
+ `, tt = n`
830
830
  query TransactionRecords($first: Int, $after: Cursor, $filter: TransactionRecordFilter) {
831
831
  member {
832
832
  transactionRecords(first: $first, after: $after, filter: $filter) {
@@ -852,7 +852,7 @@ const fe = n`
852
852
  }
853
853
  }
854
854
  }
855
- `, tt = n`
855
+ `, at = n`
856
856
  query Wallet {
857
857
  wallet {
858
858
  id
@@ -862,7 +862,7 @@ const fe = n`
862
862
  dateTimeLastUpdated
863
863
  }
864
864
  }
865
- `, at = n`
865
+ `, rt = n`
866
866
  query WithdrawalRecords($first: Int, $after: Cursor, $filter: WithdrawalRecordFilterInput) {
867
867
  member {
868
868
  withdrawalRecords(first: $first, after: $after, filter: $filter) {
@@ -929,7 +929,7 @@ const fe = n`
929
929
  }
930
930
  }
931
931
  }
932
- `, rt = n`
932
+ `, ot = n`
933
933
  mutation CreateGCashWithdrawal($input: CreateGCashWithdrawalInput!) {
934
934
  createGCashWithdrawal(input: $input) {
935
935
  ... on AccountNotVerifiedError {
@@ -958,7 +958,7 @@ const fe = n`
958
958
  }
959
959
  }
960
960
  }
961
- `, ot = n`
961
+ `, nt = n`
962
962
  mutation CreateMayaWithdrawal($input: CreateMayaWithdrawalInput!) {
963
963
  createMayaWithdrawal(input: $input) {
964
964
  ... on AccountNotVerifiedError {
@@ -987,7 +987,7 @@ const fe = n`
987
987
  }
988
988
  }
989
989
  }
990
- `, nt = n`
990
+ `, it = n`
991
991
  mutation CreateMayaAppWithdrawal($input: CreateMayaAppWithdrawalInput!) {
992
992
  createMayaAppWithdrawal(input: $input) {
993
993
  ... on AccountNotVerifiedError {
@@ -1012,7 +1012,7 @@ const fe = n`
1012
1012
  }
1013
1013
  }
1014
1014
  }
1015
- `, it = n`
1015
+ `, st = n`
1016
1016
  mutation CreateBankWithdrawal($input: CreateBankWithdrawalInput!) {
1017
1017
  createBankWithdrawal(input: $input) {
1018
1018
  ... on MobileNumberNotVerifiedError {
@@ -1041,14 +1041,14 @@ const fe = n`
1041
1041
  }
1042
1042
  }
1043
1043
  }
1044
- `, st = n`
1044
+ `, dt = n`
1045
1045
  query RemainingDailyWithdrawalsCount {
1046
1046
  remainingDailyWithdrawalsCount
1047
1047
  }
1048
1048
  `;
1049
- class dt {
1049
+ class mt {
1050
1050
  constructor(e) {
1051
- c(this, "client");
1051
+ d(this, "client");
1052
1052
  this.client = e;
1053
1053
  }
1054
1054
  /** aka `Query.self` */
@@ -1061,7 +1061,7 @@ class dt {
1061
1061
  }
1062
1062
  async registerMemberAccount(e) {
1063
1063
  const t = await this.client.request(
1064
- Fe,
1064
+ Le,
1065
1065
  e
1066
1066
  );
1067
1067
  return t.ok ? t.data.registerMemberAccount ? {
@@ -1073,7 +1073,7 @@ class dt {
1073
1073
  }
1074
1074
  async updateMemberAccount(e) {
1075
1075
  const t = await this.client.request(
1076
- Le,
1076
+ Ve,
1077
1077
  e
1078
1078
  );
1079
1079
  return t.ok ? t.data.updateMemberAccount ? {
@@ -1085,7 +1085,7 @@ class dt {
1085
1085
  }
1086
1086
  async deleteMemberAccount(e) {
1087
1087
  const t = await this.client.request(
1088
- He,
1088
+ Ye,
1089
1089
  e
1090
1090
  );
1091
1091
  return t.ok ? t.data.deleteMemberAccount ? {
@@ -1100,7 +1100,7 @@ class dt {
1100
1100
  }
1101
1101
  async resetPassword(e) {
1102
1102
  const t = await this.client.request(
1103
- Ve,
1103
+ He,
1104
1104
  e
1105
1105
  );
1106
1106
  return t.ok ? t.data.resetPassword ? {
@@ -1111,15 +1111,15 @@ class dt {
1111
1111
  } : t;
1112
1112
  }
1113
1113
  async profileCompletion() {
1114
- const e = await this.client.request(ze);
1114
+ const e = await this.client.request(Je);
1115
1115
  return e.ok ? { ok: !0, data: e.data.profileCompletion } : e;
1116
1116
  }
1117
1117
  async platform() {
1118
- return await this.client.request(Je);
1118
+ return await this.client.request(Ze);
1119
1119
  }
1120
1120
  async sendVerificationCode(e) {
1121
1121
  const t = await this.client.request(
1122
- Ye,
1122
+ je,
1123
1123
  e
1124
1124
  );
1125
1125
  return t.ok ? t.data.sendVerificationCode ? {
@@ -1131,7 +1131,7 @@ class dt {
1131
1131
  }
1132
1132
  async verifyMobileNumber(e) {
1133
1133
  const t = await this.client.request(
1134
- je,
1134
+ Qe,
1135
1135
  e
1136
1136
  );
1137
1137
  return t.ok ? t.data.verifyMobileNumber ? {
@@ -1143,7 +1143,7 @@ class dt {
1143
1143
  }
1144
1144
  async createMemberVerification(e) {
1145
1145
  const t = await this.client.request(
1146
- Qe,
1146
+ Ke,
1147
1147
  e
1148
1148
  );
1149
1149
  return t.ok ? t.data.createMemberVerification ? {
@@ -1155,7 +1155,7 @@ class dt {
1155
1155
  }
1156
1156
  async updateMemberVerification(e) {
1157
1157
  const t = await this.client.request(
1158
- Ke,
1158
+ ze,
1159
1159
  e
1160
1160
  );
1161
1161
  return t.ok ? t.data.updateMemberVerification ? {
@@ -1166,28 +1166,28 @@ class dt {
1166
1166
  } : t;
1167
1167
  }
1168
1168
  async memberVerification() {
1169
- const e = await this.client.request(qe);
1169
+ const e = await this.client.request(Fe);
1170
1170
  return e.ok ? {
1171
1171
  ok: !0,
1172
1172
  data: e.data.memberAccount.verification
1173
1173
  } : e;
1174
1174
  }
1175
1175
  async announcements(e) {
1176
- const t = await this.client.request(ye, e);
1176
+ const t = await this.client.request(be, e);
1177
1177
  return t.ok ? {
1178
1178
  ok: !0,
1179
1179
  data: t.data.announcements
1180
1180
  } : t;
1181
1181
  }
1182
1182
  }
1183
- function l(i, e) {
1184
- const t = ct[i];
1183
+ function h(i, e) {
1184
+ const t = S[i] ? S[i] : S[500];
1185
1185
  return {
1186
1186
  code: t.code,
1187
1187
  message: e ?? t.message
1188
1188
  };
1189
1189
  }
1190
- const ct = {
1190
+ const S = {
1191
1191
  400: {
1192
1192
  code: "HttpBadRequest",
1193
1193
  message: "Bad Request"
@@ -1216,37 +1216,45 @@ const ct = {
1216
1216
  code: "HttpInternalServerError",
1217
1217
  message: "Internal Server Error"
1218
1218
  },
1219
+ 502: {
1220
+ code: "HttpBadGateway",
1221
+ message: "Bad Gateway"
1222
+ },
1219
1223
  503: {
1220
1224
  code: "HttpServiceUnavailable",
1221
1225
  message: "Service Unavailable"
1226
+ },
1227
+ 504: {
1228
+ code: "HttpGatewayTimeout",
1229
+ message: "Gateway Timeout"
1222
1230
  }
1223
1231
  };
1224
- async function f(i) {
1232
+ async function p(i) {
1225
1233
  const e = new TextEncoder().encode(i), t = await crypto.subtle.digest("SHA-256", e);
1226
- return Array.from(new Uint8Array(t)).map((d) => d.toString(16).padStart(2, "0")).join("");
1234
+ return Array.from(new Uint8Array(t)).map((s) => s.toString(16).padStart(2, "0")).join("");
1227
1235
  }
1228
- class mt {
1236
+ class ct {
1229
1237
  constructor(e) {
1230
- c(this, "url");
1231
- c(this, "platform");
1238
+ d(this, "url");
1239
+ d(this, "platform");
1232
1240
  this.url = e.url, this.platform = e.platform;
1233
1241
  }
1234
1242
  async createSession(e) {
1235
1243
  const t = new Headers();
1236
1244
  if (t.set("Content-Type", "application/json"), t.set("Platform-Code", this.platform), t.set("Role", "MEMBER"), "name" in e) {
1237
- const a = `${e.name}:${await f(e.password)}`, o = Buffer.from(a).toString("base64");
1238
- t.set("Authorization", `Basic ${o}`);
1245
+ const a = `${e.name}:${await p(e.password)}`, r = Buffer.from(a).toString("base64");
1246
+ t.set("Authorization", `Basic ${r}`);
1239
1247
  }
1240
1248
  if ("mobileNumber" in e) {
1241
- const a = `${e.mobileNumber}:${e.verificationCode}`, o = Buffer.from(a).toString("base64");
1242
- t.set("Authorization", `Basic ${o}`);
1249
+ const a = `${e.mobileNumber}:${e.verificationCode}`, r = Buffer.from(a).toString("base64");
1250
+ t.set("Authorization", `Basic ${r}`);
1243
1251
  }
1244
1252
  try {
1245
1253
  const a = await fetch(`${this.url}/sessions`, {
1246
1254
  method: "POST",
1247
1255
  headers: t
1248
- }), o = await a.json();
1249
- return a.status === 401 || a.status === 403 ? o.code === "ACCOUNT_BLACKLISTED" ? {
1256
+ }), r = await a.json();
1257
+ return a.status === 401 || a.status === 403 ? r.code === "ACCOUNT_BLACKLISTED" ? {
1250
1258
  ok: !1,
1251
1259
  error: {
1252
1260
  code: "AccountBlacklisted",
@@ -1260,10 +1268,10 @@ class mt {
1260
1268
  }
1261
1269
  } : a.ok ? {
1262
1270
  ok: !0,
1263
- data: o
1271
+ data: r
1264
1272
  } : {
1265
1273
  ok: !1,
1266
- error: l(a.status)
1274
+ error: h(a.status)
1267
1275
  };
1268
1276
  } catch {
1269
1277
  return {
@@ -1303,7 +1311,7 @@ class mt {
1303
1311
  data: a
1304
1312
  } : {
1305
1313
  ok: !1,
1306
- error: l(t.status)
1314
+ error: h(t.status)
1307
1315
  };
1308
1316
  } catch {
1309
1317
  return {
@@ -1328,7 +1336,7 @@ class mt {
1328
1336
  });
1329
1337
  return t.ok ? { ok: !0 } : {
1330
1338
  ok: !1,
1331
- error: l(t.status)
1339
+ error: h(t.status)
1332
1340
  };
1333
1341
  } catch {
1334
1342
  return {
@@ -1359,18 +1367,18 @@ class mt {
1359
1367
  }
1360
1368
  class ut {
1361
1369
  constructor(e) {
1362
- c(this, "client");
1370
+ d(this, "client");
1363
1371
  this.client = e;
1364
1372
  }
1365
1373
  async file(e) {
1366
- const t = await this.client.request(de, e);
1374
+ const t = await this.client.request(me, e);
1367
1375
  return t.ok ? {
1368
1376
  ok: !0,
1369
1377
  data: t.data.node
1370
1378
  } : t;
1371
1379
  }
1372
1380
  async uploadPrivateImageFile(e) {
1373
- const t = await this.client.upload(de, e);
1381
+ const t = await this.client.upload(me, e);
1374
1382
  return t.ok ? t.data.uploadPrivateImageFile ? {
1375
1383
  ok: !1,
1376
1384
  error: t.data.uploadPrivateImageFile
@@ -1379,30 +1387,30 @@ class ut {
1379
1387
  } : t;
1380
1388
  }
1381
1389
  }
1382
- class he {
1390
+ class we {
1383
1391
  constructor(e) {
1384
- c(this, "client");
1392
+ d(this, "client");
1385
1393
  this.client = e;
1386
1394
  }
1387
1395
  async game(e) {
1388
- const t = await this.client.request(be, e);
1396
+ const t = await this.client.request(Ae, e);
1389
1397
  return t.ok ? { ok: !0, data: t.data.node } : t;
1390
1398
  }
1391
1399
  async games(e) {
1392
- const t = await this.client.request(Ae, e);
1400
+ const t = await this.client.request(Se, e);
1393
1401
  return t.ok ? { ok: !0, data: t.data.games } : t;
1394
1402
  }
1395
1403
  async gamesByName(e) {
1396
- const t = await this.client.request(Se, e);
1404
+ const t = await this.client.request(Ee, e);
1397
1405
  return t.ok ? { ok: !0, data: t.data.gamesByName } : t;
1398
1406
  }
1399
1407
  async gameSession(e) {
1400
- const t = await this.client.request(Ee, e);
1408
+ const t = await this.client.request(ke, e);
1401
1409
  return t.ok ? { ok: !0, data: t.data.node } : t;
1402
1410
  }
1403
1411
  async createGameSession(e) {
1404
1412
  const t = await this.client.request(
1405
- ke,
1413
+ Ce,
1406
1414
  e
1407
1415
  );
1408
1416
  return t.ok ? t.data.createGameSession ? {
@@ -1414,7 +1422,7 @@ class he {
1414
1422
  }
1415
1423
  async endGameSession(e) {
1416
1424
  const t = await this.client.request(
1417
- Ce,
1425
+ Te,
1418
1426
  e
1419
1427
  );
1420
1428
  return t.ok ? t.data.endGameSession ? {
@@ -1430,43 +1438,43 @@ class he {
1430
1438
  }
1431
1439
  class lt {
1432
1440
  constructor(e) {
1433
- c(this, "client");
1441
+ d(this, "client");
1434
1442
  this.client = e;
1435
1443
  }
1436
1444
  async betRecords(e) {
1437
- const t = await this.client.request(Te, e);
1445
+ const t = await this.client.request(_e, e);
1438
1446
  return t.ok ? { ok: t.ok, data: t.data.member.betRecords } : t;
1439
1447
  }
1440
1448
  async transactionRecords(e) {
1441
1449
  const t = await this.client.request(
1442
- et,
1450
+ tt,
1443
1451
  e
1444
1452
  );
1445
1453
  return t.ok ? { ok: t.ok, data: t.data.member.transactionRecords } : t;
1446
1454
  }
1447
1455
  async withdrawalRecords(e) {
1448
1456
  const t = await this.client.request(
1449
- at,
1457
+ rt,
1450
1458
  e
1451
1459
  );
1452
1460
  return t.ok ? { ok: t.ok, data: t.data.member.withdrawalRecords } : t;
1453
1461
  }
1454
1462
  async depositRecords(e) {
1455
- const t = await this.client.request(Ge, e);
1463
+ const t = await this.client.request($e, e);
1456
1464
  return t.ok ? { ok: t.ok, data: t.data.member.depositRecords } : t;
1457
1465
  }
1458
1466
  async depositsCount() {
1459
- const e = await this.client.request(Be);
1467
+ const e = await this.client.request(xe);
1460
1468
  return e.ok ? { ok: e.ok, data: e.data.member.depositsCount } : e;
1461
1469
  }
1462
1470
  async member() {
1463
- const e = await this.client.request(xe);
1471
+ const e = await this.client.request(qe);
1464
1472
  return e.ok ? { ok: e.ok, data: e.data.member } : e;
1465
1473
  }
1466
1474
  }
1467
1475
  class pt {
1468
1476
  constructor(e) {
1469
- c(this, "url");
1477
+ d(this, "url");
1470
1478
  this.url = e.url;
1471
1479
  }
1472
1480
  gameThumbnails(e) {
@@ -1476,26 +1484,26 @@ class pt {
1476
1484
  ];
1477
1485
  }
1478
1486
  }
1479
- class ft extends he {
1487
+ class ht extends we {
1480
1488
  async promos() {
1481
- const e = await this.client.request(De);
1489
+ const e = await this.client.request(Me);
1482
1490
  return e.ok ? { ok: e.ok, data: e.data.promos } : e;
1483
1491
  }
1484
1492
  async cashbacks() {
1485
- const e = await this.client.request(ve);
1493
+ const e = await this.client.request(De);
1486
1494
  return e.ok ? { ok: e.ok, data: e.data.cashbacks } : e;
1487
1495
  }
1488
1496
  async availablePromos(e) {
1489
- const t = await this.client.request(Me, e);
1497
+ const t = await this.client.request(Ne, e);
1490
1498
  return t.ok ? { ok: t.ok, data: t.data.availablePromos } : t;
1491
1499
  }
1492
1500
  async cashbackBonuses() {
1493
- const e = await this.client.request(Ne);
1501
+ const e = await this.client.request(Ie);
1494
1502
  return e.ok ? { ok: e.ok, data: e.data.cashbackBonuses } : e;
1495
1503
  }
1496
1504
  async claimCashbackBonus(e) {
1497
1505
  const t = await this.client.request(
1498
- Ie,
1506
+ Ge,
1499
1507
  e
1500
1508
  );
1501
1509
  return t.ok ? t.data.claimCashbackBonus ? {
@@ -1513,16 +1521,16 @@ class ft extends he {
1513
1521
  return e.ok ? { ok: e.ok, data: e.data.bonus } : e;
1514
1522
  }
1515
1523
  async wallet() {
1516
- const e = await this.client.request(tt);
1524
+ const e = await this.client.request(at);
1517
1525
  return e.ok ? { ok: e.ok, data: e.data.wallet } : e;
1518
1526
  }
1519
1527
  async deposit(e) {
1520
- const t = await this.client.request(We, e);
1528
+ const t = await this.client.request(Ue, e);
1521
1529
  return t.ok ? { ok: t.ok, data: t.data.node } : t;
1522
1530
  }
1523
1531
  async createGCashDeposit(e) {
1524
1532
  const t = await this.client.request(
1525
- $e,
1533
+ Pe,
1526
1534
  e
1527
1535
  );
1528
1536
  return t.ok ? t.data.createGCashDeposit ? {
@@ -1534,7 +1542,7 @@ class ft extends he {
1534
1542
  }
1535
1543
  async createMayaDeposit(e) {
1536
1544
  const t = await this.client.request(
1537
- Pe,
1545
+ We,
1538
1546
  e
1539
1547
  );
1540
1548
  return t.ok ? t.data.createMayaDeposit ? {
@@ -1546,7 +1554,7 @@ class ft extends he {
1546
1554
  }
1547
1555
  async createMayaAppDeposit(e) {
1548
1556
  const t = await this.client.request(
1549
- Ue,
1557
+ Be,
1550
1558
  e
1551
1559
  );
1552
1560
  return t.ok ? t.data.createMayaAppDeposit ? {
@@ -1558,7 +1566,7 @@ class ft extends he {
1558
1566
  }
1559
1567
  async createGCashWithdrawal(e) {
1560
1568
  const t = await this.client.request(
1561
- rt,
1569
+ ot,
1562
1570
  e
1563
1571
  );
1564
1572
  return t.ok ? t.data.createGCashWithdrawal ? {
@@ -1570,7 +1578,7 @@ class ft extends he {
1570
1578
  }
1571
1579
  async createMayaWithdrawal(e) {
1572
1580
  const t = await this.client.request(
1573
- ot,
1581
+ nt,
1574
1582
  e
1575
1583
  );
1576
1584
  return t.ok ? t.data.createMayaWithdrawal ? {
@@ -1582,7 +1590,7 @@ class ft extends he {
1582
1590
  }
1583
1591
  async createMayaAppWithdrawal(e) {
1584
1592
  const t = await this.client.request(
1585
- nt,
1593
+ it,
1586
1594
  e
1587
1595
  );
1588
1596
  return t.ok ? t.data.createMayaAppWithdrawal ? {
@@ -1594,7 +1602,7 @@ class ft extends he {
1594
1602
  }
1595
1603
  async createBankWithdrawal(e) {
1596
1604
  const t = await this.client.request(
1597
- it,
1605
+ st,
1598
1606
  e
1599
1607
  );
1600
1608
  return t.ok ? t.data.createBankWithdrawal ? {
@@ -1606,17 +1614,17 @@ class ft extends he {
1606
1614
  }
1607
1615
  async remainingDailyWithdrawalsCount() {
1608
1616
  const e = await this.client.request(
1609
- st
1617
+ dt
1610
1618
  );
1611
1619
  return e.ok ? { ok: e.ok, data: e.data.remainingDailyWithdrawalsCount } : e;
1612
1620
  }
1613
1621
  async pointsWallet() {
1614
- const e = await this.client.request(Ze);
1622
+ const e = await this.client.request(Xe);
1615
1623
  return e.ok ? { ok: e.ok, data: e.data.pointsWallet } : e;
1616
1624
  }
1617
1625
  async pointsToCashConversion(e) {
1618
1626
  const t = await this.client.request(
1619
- Xe,
1627
+ et,
1620
1628
  e
1621
1629
  );
1622
1630
  return t.ok ? t.data.pointsToCashConversion ? {
@@ -1627,31 +1635,31 @@ class ft extends he {
1627
1635
  } : t;
1628
1636
  }
1629
1637
  }
1630
- class ht {
1638
+ class ft {
1631
1639
  constructor(e) {
1632
- c(this, "client");
1640
+ d(this, "client");
1633
1641
  this.client = e;
1634
1642
  }
1635
1643
  async latestBetRecords() {
1636
- const e = await this.client.request(_e);
1644
+ const e = await this.client.request(ve);
1637
1645
  return e.ok ? {
1638
1646
  ok: !0,
1639
1647
  data: e.data.latestBetRecords
1640
1648
  } : e;
1641
1649
  }
1642
1650
  }
1643
- function E(i) {
1651
+ function k(i) {
1644
1652
  return new Date(i.getTime());
1645
1653
  }
1646
1654
  function ce(i, e) {
1647
- const t = E(i);
1655
+ const t = k(i);
1648
1656
  return t.setDate(t.getDate() + e), t;
1649
1657
  }
1650
- function me(i, e) {
1651
- const t = E(i);
1658
+ function ue(i, e) {
1659
+ const t = k(i);
1652
1660
  return t.setMinutes(t.getMinutes() + e), t;
1653
1661
  }
1654
- function ue(i, e) {
1662
+ function le(i, e) {
1655
1663
  return i.getTime() > e.getTime();
1656
1664
  }
1657
1665
  function wt(i) {
@@ -1659,17 +1667,19 @@ function wt(i) {
1659
1667
  setTimeout(e, i);
1660
1668
  });
1661
1669
  }
1662
- function le(i, e) {
1663
- const t = E(i);
1670
+ function pe(i, e) {
1671
+ const t = k(i);
1664
1672
  return t.setMinutes(t.getMinutes() - e), t;
1665
1673
  }
1666
1674
  class gt {
1667
1675
  constructor(e) {
1668
- c(this, "logger");
1669
- c(this, "storageKey", "session");
1670
- c(this, "authService");
1671
- c(this, "_refreshing", !1);
1672
- this.logger = new pe(), this.authService = new mt(e);
1676
+ d(this, "logger");
1677
+ d(this, "storageKey", "session");
1678
+ d(this, "authService");
1679
+ d(this, "_refreshing", !1);
1680
+ this.authService = new ct(e), this.logger = new he({
1681
+ enabled: e.log ?? !1
1682
+ });
1673
1683
  }
1674
1684
  get refreshing() {
1675
1685
  return this._refreshing;
@@ -1685,8 +1695,8 @@ class gt {
1685
1695
  this.storageKey,
1686
1696
  JSON.stringify({
1687
1697
  ...t.data,
1688
- accessTokenExpiresAt: me(a, 8).getTime(),
1689
- refreshTokenExpiresAt: le(ce(a, 30), 2).getTime()
1698
+ accessTokenExpiresAt: ue(a, 8).getTime(),
1699
+ refreshTokenExpiresAt: pe(ce(a, 30), 2).getTime()
1690
1700
  })
1691
1701
  ), { ok: !0 };
1692
1702
  } else
@@ -1708,8 +1718,8 @@ class gt {
1708
1718
  };
1709
1719
  try {
1710
1720
  let t = JSON.parse(e), a = /* @__PURE__ */ new Date();
1711
- const o = new Date(t.accessTokenExpiresAt), d = new Date(t.refreshTokenExpiresAt);
1712
- if (ue(a, d))
1721
+ const r = new Date(t.accessTokenExpiresAt), s = new Date(t.refreshTokenExpiresAt);
1722
+ if (le(a, s))
1713
1723
  return this.logger.warn("Session expired. Logging out.."), window.localStorage.removeItem(this.storageKey), {
1714
1724
  ok: !1,
1715
1725
  error: {
@@ -1717,7 +1727,7 @@ class gt {
1717
1727
  message: "Session expired."
1718
1728
  }
1719
1729
  };
1720
- if (ue(a, o)) {
1730
+ if (le(a, r)) {
1721
1731
  this.logger.info("Refreshing session..."), this.refreshing = !0;
1722
1732
  const m = await this.authService.refreshSession(t.refreshToken);
1723
1733
  if (this.refreshing = !1, !m.ok)
@@ -1731,8 +1741,8 @@ class gt {
1731
1741
  this.logger.success("Session refreshed!"), a = /* @__PURE__ */ new Date(), t = {
1732
1742
  ...t,
1733
1743
  ...m.data,
1734
- accessTokenExpiresAt: me(a, 8).getTime(),
1735
- refreshTokenExpiresAt: le(ce(a, 30), 2).getTime()
1744
+ accessTokenExpiresAt: ue(a, 8).getTime(),
1745
+ refreshTokenExpiresAt: pe(ce(a, 30), 2).getTime()
1736
1746
  }, window.localStorage.setItem(this.storageKey, JSON.stringify(t));
1737
1747
  }
1738
1748
  return {
@@ -1759,11 +1769,11 @@ class gt {
1759
1769
  (t = e.data) != null && t.accessToken && await this.authService.destroySession(e.data.accessToken), window.localStorage.removeItem(this.storageKey);
1760
1770
  }
1761
1771
  async verify() {
1762
- var a, o, d;
1772
+ var a, r, s;
1763
1773
  if (this.isServer)
1764
1774
  return this.logger.warn("'localStorage' is not available on the server."), !0;
1765
1775
  const e = await this.get();
1766
- if (((a = e.error) == null ? void 0 : a.code) === "InvalidToken" || ((o = e.error) == null ? void 0 : o.code) === "SessionExpired" || ((d = e.error) == null ? void 0 : d.code) === "AccountBlacklisted") return !1;
1776
+ if (((a = e.error) == null ? void 0 : a.code) === "InvalidToken" || ((r = e.error) == null ? void 0 : r.code) === "SessionExpired" || ((s = e.error) == null ? void 0 : s.code) === "AccountBlacklisted") return !1;
1767
1777
  if (!e.data) return !0;
1768
1778
  const t = await this.authService.verifySession(e.data.accessToken);
1769
1779
  return t || window.localStorage.removeItem(this.storageKey), t;
@@ -1772,7 +1782,7 @@ class gt {
1772
1782
  return typeof window > "u";
1773
1783
  }
1774
1784
  }
1775
- function r(i, e) {
1785
+ function o(i, e) {
1776
1786
  if (typeof i == "number" && !Number.isNaN(i))
1777
1787
  return i;
1778
1788
  if (typeof i == "string") {
@@ -1784,7 +1794,7 @@ function r(i, e) {
1784
1794
  }
1785
1795
  class yt {
1786
1796
  constructor(e) {
1787
- c(this, "staticService");
1797
+ d(this, "staticService");
1788
1798
  const t = (e == null ? void 0 : e.environment) === "development";
1789
1799
  this.staticService = new pt({
1790
1800
  url: t ? "https://static.development.opexa.io/graphql" : "https://static.opexa.io/graphql"
@@ -1815,88 +1825,88 @@ class yt {
1815
1825
  };
1816
1826
  }
1817
1827
  platform(e) {
1818
- var t, a, o, d, m, u, p, y, s, k, C, T, _, v, D, M, R, N, I, G, $, P, U, W, B, x, O, q, F, L, V, H, Y, j, Q, K, z, J, Z, X, ee, te, ae, re, oe, ne, ie, se;
1828
+ var t, a, r, s, m, c, l, b, u, C, T, _, v, D, M, N, R, I, G, $, P, W, B, U, x, q, O, F, L, V, H, Y, j, Q, K, z, J, Z, X, ee, te, ae, re, oe, ne, ie, se, de;
1819
1829
  return {
1820
1830
  paymentSettings: {
1821
- minimumFirstDepositAmount: r(e.minimumFirstDepositAmount),
1831
+ minimumFirstDepositAmount: o(e.minimumFirstDepositAmount),
1822
1832
  restrictWithdrawalsToVerifiedMembers: e.restrictWithdrawalsToVerifiedMembers,
1823
1833
  depositGateway: {
1824
1834
  bank: {
1825
1835
  androidEnabled: ((t = e.bankDepositGatewaySettings) == null ? void 0 : t.androidEnabled) ?? !1,
1826
1836
  iosEnabled: ((a = e.bankDepositGatewaySettings) == null ? void 0 : a.iosEnabled) ?? !1,
1827
- webEnabled: ((o = e.bankDepositGatewaySettings) == null ? void 0 : o.webEnabled) ?? !1,
1828
- mobileWebEnabled: ((d = e.bankDepositGatewaySettings) == null ? void 0 : d.mobileWebEnabled) ?? !1,
1829
- minimumAmount: r((m = e.bankDepositGatewaySettings) == null ? void 0 : m.minimumAmount),
1830
- maximumAmount: r((u = e.bankDepositGatewaySettings) == null ? void 0 : u.maximumAmount)
1837
+ webEnabled: ((r = e.bankDepositGatewaySettings) == null ? void 0 : r.webEnabled) ?? !1,
1838
+ mobileWebEnabled: ((s = e.bankDepositGatewaySettings) == null ? void 0 : s.mobileWebEnabled) ?? !1,
1839
+ minimumAmount: o((m = e.bankDepositGatewaySettings) == null ? void 0 : m.minimumAmount),
1840
+ maximumAmount: o((c = e.bankDepositGatewaySettings) == null ? void 0 : c.maximumAmount)
1831
1841
  },
1832
1842
  gcash: {
1833
- androidEnabled: ((p = e.gcashDepositGatewaySettings) == null ? void 0 : p.androidEnabled) ?? !1,
1834
- iosEnabled: ((y = e.gcashDepositGatewaySettings) == null ? void 0 : y.iosEnabled) ?? !1,
1835
- webEnabled: ((s = e.gcashDepositGatewaySettings) == null ? void 0 : s.webEnabled) ?? !1,
1836
- mobileWebEnabled: ((k = e.gcashDepositGatewaySettings) == null ? void 0 : k.mobileWebEnabled) ?? !1,
1837
- minimumAmount: r((C = e.gcashDepositGatewaySettings) == null ? void 0 : C.minimumAmount),
1838
- maximumAmount: r((T = e.gcashDepositGatewaySettings) == null ? void 0 : T.maximumAmount)
1843
+ androidEnabled: ((l = e.gcashDepositGatewaySettings) == null ? void 0 : l.androidEnabled) ?? !1,
1844
+ iosEnabled: ((b = e.gcashDepositGatewaySettings) == null ? void 0 : b.iosEnabled) ?? !1,
1845
+ webEnabled: ((u = e.gcashDepositGatewaySettings) == null ? void 0 : u.webEnabled) ?? !1,
1846
+ mobileWebEnabled: ((C = e.gcashDepositGatewaySettings) == null ? void 0 : C.mobileWebEnabled) ?? !1,
1847
+ minimumAmount: o((T = e.gcashDepositGatewaySettings) == null ? void 0 : T.minimumAmount),
1848
+ maximumAmount: o((_ = e.gcashDepositGatewaySettings) == null ? void 0 : _.maximumAmount)
1839
1849
  },
1840
1850
  maya: {
1841
- androidEnabled: ((_ = e.mayaDepositGatewaySettings) == null ? void 0 : _.androidEnabled) ?? !1,
1842
- iosEnabled: ((v = e.mayaDepositGatewaySettings) == null ? void 0 : v.iosEnabled) ?? !1,
1843
- webEnabled: ((D = e.mayaDepositGatewaySettings) == null ? void 0 : D.webEnabled) ?? !1,
1844
- mobileWebEnabled: ((M = e.mayaDepositGatewaySettings) == null ? void 0 : M.mobileWebEnabled) ?? !1,
1845
- minimumAmount: r((R = e.mayaDepositGatewaySettings) == null ? void 0 : R.minimumAmount),
1846
- maximumAmount: r((N = e.mayaDepositGatewaySettings) == null ? void 0 : N.maximumAmount)
1851
+ androidEnabled: ((v = e.mayaDepositGatewaySettings) == null ? void 0 : v.androidEnabled) ?? !1,
1852
+ iosEnabled: ((D = e.mayaDepositGatewaySettings) == null ? void 0 : D.iosEnabled) ?? !1,
1853
+ webEnabled: ((M = e.mayaDepositGatewaySettings) == null ? void 0 : M.webEnabled) ?? !1,
1854
+ mobileWebEnabled: ((N = e.mayaDepositGatewaySettings) == null ? void 0 : N.mobileWebEnabled) ?? !1,
1855
+ minimumAmount: o((R = e.mayaDepositGatewaySettings) == null ? void 0 : R.minimumAmount),
1856
+ maximumAmount: o((I = e.mayaDepositGatewaySettings) == null ? void 0 : I.maximumAmount)
1847
1857
  },
1848
1858
  mayaApp: {
1849
- androidEnabled: ((I = e.mayaAppDepositGatewaySettings) == null ? void 0 : I.androidEnabled) ?? !1,
1850
- iosEnabled: ((G = e.mayaAppDepositGatewaySettings) == null ? void 0 : G.iosEnabled) ?? !1,
1851
- webEnabled: (($ = e.mayaAppDepositGatewaySettings) == null ? void 0 : $.webEnabled) ?? !1,
1852
- mobileWebEnabled: ((P = e.mayaAppDepositGatewaySettings) == null ? void 0 : P.mobileWebEnabled) ?? !1,
1853
- minimumAmount: r((U = e.mayaAppDepositGatewaySettings) == null ? void 0 : U.minimumAmount),
1854
- maximumAmount: r((W = e.mayaAppDepositGatewaySettings) == null ? void 0 : W.maximumAmount)
1859
+ androidEnabled: ((G = e.mayaAppDepositGatewaySettings) == null ? void 0 : G.androidEnabled) ?? !1,
1860
+ iosEnabled: (($ = e.mayaAppDepositGatewaySettings) == null ? void 0 : $.iosEnabled) ?? !1,
1861
+ webEnabled: ((P = e.mayaAppDepositGatewaySettings) == null ? void 0 : P.webEnabled) ?? !1,
1862
+ mobileWebEnabled: ((W = e.mayaAppDepositGatewaySettings) == null ? void 0 : W.mobileWebEnabled) ?? !1,
1863
+ minimumAmount: o((B = e.mayaAppDepositGatewaySettings) == null ? void 0 : B.minimumAmount),
1864
+ maximumAmount: o((U = e.mayaAppDepositGatewaySettings) == null ? void 0 : U.maximumAmount)
1855
1865
  }
1856
1866
  },
1857
1867
  withdrawalGateway: {
1858
1868
  bank: {
1859
- androidEnabled: ((B = e.bankWithdrawalGatewaySettings) == null ? void 0 : B.androidEnabled) ?? !1,
1860
- iosEnabled: ((x = e.bankWithdrawalGatewaySettings) == null ? void 0 : x.iosEnabled) ?? !1,
1869
+ androidEnabled: ((x = e.bankWithdrawalGatewaySettings) == null ? void 0 : x.androidEnabled) ?? !1,
1870
+ iosEnabled: ((q = e.bankWithdrawalGatewaySettings) == null ? void 0 : q.iosEnabled) ?? !1,
1861
1871
  webEnabled: ((O = e.bankWithdrawalGatewaySettings) == null ? void 0 : O.webEnabled) ?? !1,
1862
- mobileWebEnabled: ((q = e.bankWithdrawalGatewaySettings) == null ? void 0 : q.mobileWebEnabled) ?? !1,
1863
- minimumAmount: r((F = e.bankWithdrawalGatewaySettings) == null ? void 0 : F.minimumAmount),
1864
- maximumAmount: r((L = e.bankWithdrawalGatewaySettings) == null ? void 0 : L.maximumAmount)
1872
+ mobileWebEnabled: ((F = e.bankWithdrawalGatewaySettings) == null ? void 0 : F.mobileWebEnabled) ?? !1,
1873
+ minimumAmount: o((L = e.bankWithdrawalGatewaySettings) == null ? void 0 : L.minimumAmount),
1874
+ maximumAmount: o((V = e.bankWithdrawalGatewaySettings) == null ? void 0 : V.maximumAmount)
1865
1875
  },
1866
1876
  gcash: {
1867
- androidEnabled: ((V = e.gcashWithdrawalGatewaySettings) == null ? void 0 : V.androidEnabled) ?? !1,
1868
- iosEnabled: ((H = e.gcashWithdrawalGatewaySettings) == null ? void 0 : H.iosEnabled) ?? !1,
1869
- webEnabled: ((Y = e.gcashWithdrawalGatewaySettings) == null ? void 0 : Y.webEnabled) ?? !1,
1870
- mobileWebEnabled: ((j = e.gcashWithdrawalGatewaySettings) == null ? void 0 : j.mobileWebEnabled) ?? !1,
1871
- minimumAmount: r((Q = e.gcashWithdrawalGatewaySettings) == null ? void 0 : Q.minimumAmount),
1872
- maximumAmount: r(
1873
- (K = e.gcashWithdrawalGatewaySettings) == null ? void 0 : K.maximumAmount,
1877
+ androidEnabled: ((H = e.gcashWithdrawalGatewaySettings) == null ? void 0 : H.androidEnabled) ?? !1,
1878
+ iosEnabled: ((Y = e.gcashWithdrawalGatewaySettings) == null ? void 0 : Y.iosEnabled) ?? !1,
1879
+ webEnabled: ((j = e.gcashWithdrawalGatewaySettings) == null ? void 0 : j.webEnabled) ?? !1,
1880
+ mobileWebEnabled: ((Q = e.gcashWithdrawalGatewaySettings) == null ? void 0 : Q.mobileWebEnabled) ?? !1,
1881
+ minimumAmount: o((K = e.gcashWithdrawalGatewaySettings) == null ? void 0 : K.minimumAmount),
1882
+ maximumAmount: o(
1883
+ (z = e.gcashWithdrawalGatewaySettings) == null ? void 0 : z.maximumAmount,
1874
1884
  1e6
1875
1885
  )
1876
1886
  },
1877
1887
  maya: {
1878
- androidEnabled: ((z = e.mayaWithdrawalGatewaySettings) == null ? void 0 : z.androidEnabled) ?? !1,
1879
- iosEnabled: ((J = e.mayaWithdrawalGatewaySettings) == null ? void 0 : J.iosEnabled) ?? !1,
1880
- webEnabled: ((Z = e.mayaWithdrawalGatewaySettings) == null ? void 0 : Z.webEnabled) ?? !1,
1881
- mobileWebEnabled: ((X = e.mayaWithdrawalGatewaySettings) == null ? void 0 : X.mobileWebEnabled) ?? !1,
1882
- minimumAmount: r((ee = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ee.minimumAmount),
1883
- maximumAmount: r((te = e.mayaWithdrawalGatewaySettings) == null ? void 0 : te.maximumAmount)
1888
+ androidEnabled: ((J = e.mayaWithdrawalGatewaySettings) == null ? void 0 : J.androidEnabled) ?? !1,
1889
+ iosEnabled: ((Z = e.mayaWithdrawalGatewaySettings) == null ? void 0 : Z.iosEnabled) ?? !1,
1890
+ webEnabled: ((X = e.mayaWithdrawalGatewaySettings) == null ? void 0 : X.webEnabled) ?? !1,
1891
+ mobileWebEnabled: ((ee = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ee.mobileWebEnabled) ?? !1,
1892
+ minimumAmount: o((te = e.mayaWithdrawalGatewaySettings) == null ? void 0 : te.minimumAmount),
1893
+ maximumAmount: o((ae = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ae.maximumAmount)
1884
1894
  },
1885
1895
  mayaApp: {
1886
- androidEnabled: ((ae = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ae.androidEnabled) ?? !1,
1887
- iosEnabled: ((re = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : re.iosEnabled) ?? !1,
1888
- webEnabled: ((oe = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : oe.webEnabled) ?? !1,
1889
- mobileWebEnabled: ((ne = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ne.mobileWebEnabled) ?? !1,
1890
- minimumAmount: r((ie = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ie.minimumAmount),
1891
- maximumAmount: r(
1892
- (se = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : se.maximumAmount,
1896
+ androidEnabled: ((re = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : re.androidEnabled) ?? !1,
1897
+ iosEnabled: ((oe = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : oe.iosEnabled) ?? !1,
1898
+ webEnabled: ((ne = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ne.webEnabled) ?? !1,
1899
+ mobileWebEnabled: ((ie = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ie.mobileWebEnabled) ?? !1,
1900
+ minimumAmount: o((se = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : se.minimumAmount),
1901
+ maximumAmount: o(
1902
+ (de = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : de.maximumAmount,
1893
1903
  1e6
1894
1904
  )
1895
1905
  }
1896
1906
  }
1897
1907
  },
1898
1908
  pointsClubSettings: {
1899
- multiplier: r(e.pointsClubSettings.multiplier, 0)
1909
+ multiplier: o(e.pointsClubSettings.multiplier, 0)
1900
1910
  }
1901
1911
  };
1902
1912
  }
@@ -1924,7 +1934,7 @@ class yt {
1924
1934
  wallet(e) {
1925
1935
  return {
1926
1936
  ...e,
1927
- balance: r(e.balance, 0),
1937
+ balance: o(e.balance, 0),
1928
1938
  dateTimeCreated: new Date(e.dateTimeCreated),
1929
1939
  dateTimeLastUpdated: new Date(e.dateTimeLastUpdated)
1930
1940
  };
@@ -1947,7 +1957,7 @@ class yt {
1947
1957
  profileCompletion(e) {
1948
1958
  return {
1949
1959
  ...e,
1950
- completionPercentage: r(e, 0)
1960
+ completionPercentage: o(e, 0)
1951
1961
  };
1952
1962
  }
1953
1963
  announcement(e) {
@@ -1962,9 +1972,9 @@ class yt {
1962
1972
  withdrawalRecord(e) {
1963
1973
  return {
1964
1974
  ...e,
1965
- amount: r(e.amount, 0),
1966
- netAmount: r(e.netAmount, 0),
1967
- fee: r(e.fee, 0),
1975
+ amount: o(e.amount, 0),
1976
+ netAmount: o(e.netAmount, 0),
1977
+ fee: o(e.fee, 0),
1968
1978
  reference: e.reference ?? void 0,
1969
1979
  bank: e.bank ?? void 0,
1970
1980
  recipientMobileNumber: e.recipientMobileNumber ?? void 0,
@@ -1976,9 +1986,9 @@ class yt {
1976
1986
  deposit(e) {
1977
1987
  return {
1978
1988
  ...e,
1979
- fee: r(e.fee, 0),
1980
- amount: r(e.amount, 0),
1981
- netAmount: r(e.netAmount, 0),
1989
+ fee: o(e.fee, 0),
1990
+ amount: o(e.amount, 0),
1991
+ netAmount: o(e.netAmount, 0),
1982
1992
  reference: e.reference ?? void 0,
1983
1993
  checkoutUrl: e.checkoutUrl ?? void 0,
1984
1994
  dateTimeCreated: new Date(e.dateTimeCreated),
@@ -1988,9 +1998,9 @@ class yt {
1988
1998
  depositRecord(e) {
1989
1999
  return {
1990
2000
  ...e,
1991
- amount: r(e.amount, 0),
1992
- fee: r(e.fee, 0),
1993
- netAmount: r(e.netAmount, 0),
2001
+ amount: o(e.amount, 0),
2002
+ fee: o(e.fee, 0),
2003
+ netAmount: o(e.netAmount, 0),
1994
2004
  reference: e.reference ?? void 0,
1995
2005
  dateTimeCreated: new Date(e.dateTimeCreated),
1996
2006
  dateTimeLastUpdated: new Date(e.dateTimeLastUpdated)
@@ -2000,12 +2010,12 @@ class yt {
2000
2010
  var t, a;
2001
2011
  return {
2002
2012
  ...e,
2003
- bet: r(e.bet, 0),
2004
- payout: r(e.payout, 0),
2005
- jackpotContribution: r(e.jackpotContribution, 0),
2006
- jackpotPayout: r(e.jackpotPayout, 0),
2007
- winloss: r(e.winloss),
2008
- validBet: r(e.validBet, 0),
2013
+ bet: o(e.bet, 0),
2014
+ payout: o(e.payout, 0),
2015
+ jackpotContribution: o(e.jackpotContribution, 0),
2016
+ jackpotPayout: o(e.jackpotPayout, 0),
2017
+ winloss: o(e.winloss),
2018
+ validBet: o(e.validBet, 0),
2009
2019
  vendorRoundId: e.vendorRoundId ?? void 0,
2010
2020
  game: this.game(e.game),
2011
2021
  dateTimeSettled: e.dateTimeSettled ? new Date(e.dateTimeSettled) : void 0,
@@ -2016,7 +2026,7 @@ class yt {
2016
2026
  externalCategory: e.externalCategory ?? void 0,
2017
2027
  metadata: {
2018
2028
  odds: ((t = e.metadata) == null ? void 0 : t.odds) ?? void 0,
2019
- validBet: r((a = e.metadata) == null ? void 0 : a.validBet)
2029
+ validBet: o((a = e.metadata) == null ? void 0 : a.validBet)
2020
2030
  }
2021
2031
  };
2022
2032
  }
@@ -2024,9 +2034,9 @@ class yt {
2024
2034
  return {
2025
2035
  ...e,
2026
2036
  game: this.game(e.game),
2027
- bet: r(e.bet, 0),
2028
- payout: r(e.payout, 0),
2029
- validBet: r(e.validBet, 0),
2037
+ bet: o(e.bet, 0),
2038
+ payout: o(e.payout, 0),
2039
+ validBet: o(e.validBet, 0),
2030
2040
  dateTimeSettled: new Date(e.dateTimeSettled),
2031
2041
  dateTimeCreated: new Date(e.dateTimeCreated)
2032
2042
  };
@@ -2034,11 +2044,10 @@ class yt {
2034
2044
  transactionRecord(e) {
2035
2045
  return {
2036
2046
  ...e,
2037
- amount: r(e.amount, 0),
2047
+ amount: o(e.amount, 0),
2038
2048
  content: e.content ?? void 0,
2039
- currentBalance: r(e.currentBalance, 0),
2040
- dateTimeCreated: new Date(e.dateTimeCreated),
2041
- dateTimeLastUpdated: new Date(e.dateTimeLastUpdated)
2049
+ currentBalance: o(e.currentBalance, 0),
2050
+ dateTimeCreated: new Date(e.dateTimeCreated)
2042
2051
  };
2043
2052
  }
2044
2053
  game(e) {
@@ -2063,8 +2072,8 @@ class yt {
2063
2072
  ...e.banner,
2064
2073
  dateTimeCreated: new Date(e.banner.dateTimeCreated)
2065
2074
  },
2066
- maximumBonusAmount: r(e.maximumBonusAmount),
2067
- minimumBonusAmount: r(e.minimumBonusAmount),
2075
+ maximumBonusAmount: o(e.maximumBonusAmount),
2076
+ minimumBonusAmount: o(e.minimumBonusAmount),
2068
2077
  activationEndDateTime: new Date(e.activationEndDateTime),
2069
2078
  activationStartDateTime: new Date(e.activationStartDateTime),
2070
2079
  dateTimeCreated: new Date(e.dateTimeCreated),
@@ -2091,22 +2100,22 @@ class yt {
2091
2100
  /* deposit here does not have an id and depositNumber field */
2092
2101
  deposit: e.deposit ? {
2093
2102
  ...e.deposit,
2094
- fee: r(e.deposit.fee, 0),
2095
- amount: r(e.deposit.amount, 0),
2096
- netAmount: r(e.deposit.netAmount, 0),
2103
+ fee: o(e.deposit.fee, 0),
2104
+ amount: o(e.deposit.amount, 0),
2105
+ netAmount: o(e.deposit.netAmount, 0),
2097
2106
  reference: e.deposit.reference ?? void 0,
2098
2107
  dateTimeCreated: new Date(e.deposit.dateTimeCreated),
2099
2108
  dateTimeLastUpdated: new Date(e.deposit.dateTimeLastUpdated)
2100
2109
  } : void 0,
2101
- balance: r(e.balance, 0),
2102
- amount: r(e.amount, 0),
2110
+ balance: o(e.balance, 0),
2111
+ amount: o(e.amount, 0),
2103
2112
  expiration: new Date(e.expiration),
2104
- turnoverRequirement: r(e.turnoverRequirement, 0),
2105
- currentTurnoverRequirementContribution: r(
2113
+ turnoverRequirement: o(e.turnoverRequirement, 0),
2114
+ currentTurnoverRequirementContribution: o(
2106
2115
  e.currentTurnoverRequirementContribution,
2107
2116
  0
2108
2117
  ),
2109
- currentTurnoverRequirementContributionPercentage: r(
2118
+ currentTurnoverRequirementContributionPercentage: o(
2110
2119
  e.currentTurnoverRequirementContributionPercentage,
2111
2120
  0
2112
2121
  ),
@@ -2117,7 +2126,7 @@ class yt {
2117
2126
  cashbackBonus(e) {
2118
2127
  return {
2119
2128
  id: e.id,
2120
- balance: r(e.balance, 0),
2129
+ balance: o(e.balance, 0),
2121
2130
  cashback: this.cashback(e.cashback),
2122
2131
  dateTimeCreated: new Date(e.dateTimeCreated),
2123
2132
  dateTimeLastUpdated: new Date(e.dateTimeLastUpdated)
@@ -2133,75 +2142,66 @@ class yt {
2133
2142
  pointsWallet(e) {
2134
2143
  return {
2135
2144
  id: e.id,
2136
- points: r(e.points, 0),
2145
+ points: o(e.points, 0),
2137
2146
  account: e.account,
2138
2147
  dateTimeCreated: new Date(e.dateTimeCreated)
2139
2148
  };
2140
2149
  }
2141
2150
  }
2142
- class h {
2151
+ class g {
2143
2152
  constructor(e, t) {
2144
- c(this, "url");
2145
- c(this, "options");
2146
- c(this, "middlewares");
2147
- var o;
2148
- const a = new Headers((o = t == null ? void 0 : t.fetchOptions) == null ? void 0 : o.headers);
2153
+ d(this, "url");
2154
+ d(this, "options");
2155
+ d(this, "middlewares");
2156
+ var r;
2157
+ const a = new Headers((r = t == null ? void 0 : t.fetchOptions) == null ? void 0 : r.headers);
2149
2158
  this.url = e, this.options = { ...t == null ? void 0 : t.fetchOptions, headers: a }, this.middlewares = (t == null ? void 0 : t.middlewares) ?? [];
2150
2159
  }
2151
2160
  async request(e, t) {
2152
- var m;
2153
- const a = JSON.stringify({ query: e, variables: t }), o = new Headers(this.options.headers);
2154
- o.set("Content-Type", "application/json"), o.set("Accept", "application/json");
2155
- const d = await this.runMiddlewares(
2161
+ const a = JSON.stringify({ query: e, variables: t }), r = new Headers(this.options.headers);
2162
+ r.set("Content-Type", "application/json"), r.set("Accept", "application/json");
2163
+ const s = await this.runMiddlewares(
2156
2164
  new Request(this.url, {
2157
2165
  ...this.options,
2158
2166
  body: a,
2159
- headers: o,
2167
+ headers: r,
2160
2168
  method: "POST"
2161
2169
  })
2162
2170
  );
2163
- try {
2164
- const u = await fetch(d);
2165
- if (!u.ok)
2166
- return { ok: !1, error: l(u.status) };
2167
- const p = await u.json(), y = p.data, s = (m = p.errors) == null ? void 0 : m.at(0);
2168
- return (s == null ? void 0 : s.extensions.code) === "FORBIDDEN" ? { ok: !1, error: l(403, s.message) } : (s == null ? void 0 : s.extensions.code) === "UNAUTHORIZED" ? { ok: !1, error: l(401, s.message) } : (s == null ? void 0 : s.extensions.code) === "BAD_USER_INPUT" ? { ok: !1, error: l(400, s.message) } : (s == null ? void 0 : s.extensions.code) === "INTERNAL_SERVER_ERROR" ? { ok: !1, error: l(500, s.message) } : {
2169
- ok: !0,
2170
- data: y
2171
- };
2172
- } catch {
2173
- return {
2174
- ok: !1,
2175
- error: l(500)
2176
- };
2177
- }
2171
+ return await this.exec(s);
2178
2172
  }
2179
2173
  /** Single file upload */
2180
2174
  async upload(e, t) {
2181
- var m;
2182
- const a = h.createUploadBody(e, t), o = new Headers(this.options.headers);
2183
- o.set("Accept", "application/json"), o.delete("Content-Type");
2184
- const d = await this.runMiddlewares(
2175
+ const a = this.createUploadBody(e, t), r = new Headers(this.options.headers);
2176
+ r.set("Accept", "application/json"), r.delete("Content-Type");
2177
+ const s = await this.runMiddlewares(
2185
2178
  new Request(this.url, {
2186
2179
  ...this.options,
2187
2180
  body: a,
2188
- headers: o,
2181
+ headers: r,
2189
2182
  method: "POST"
2190
2183
  })
2191
2184
  );
2185
+ return await this.exec(s);
2186
+ }
2187
+ async exec(e) {
2188
+ var t, a, r, s, m;
2192
2189
  try {
2193
- const u = await fetch(d);
2194
- if (!u.ok)
2195
- return { ok: !1, error: l(u.status) };
2196
- const p = await u.json(), y = p.data, s = (m = p.errors) == null ? void 0 : m.at(0);
2197
- return (s == null ? void 0 : s.extensions.code) === "FORBIDDEN" ? { ok: !1, error: l(403) } : (s == null ? void 0 : s.extensions.code) === "UNAUTHORIZED" ? { ok: !1, error: l(401) } : (s == null ? void 0 : s.extensions.code) === "BAD_USER_INPUT" ? { ok: !1, error: l(400) } : (s == null ? void 0 : s.extensions.code) === "INTERNAL_SERVER_ERROR" ? { ok: !1, error: l(500, s.message) } : {
2190
+ const c = await fetch(e);
2191
+ if (!c.ok)
2192
+ return { ok: !1, error: h(c.status) };
2193
+ const l = await c.json(), b = l.data, u = (t = l.errors) == null ? void 0 : t.at(0);
2194
+ return u ? ((a = u.extensions) == null ? void 0 : a.code) === "FORBIDDEN" ? { ok: !1, error: h(403, u.message) } : ((r = u.extensions) == null ? void 0 : r.code) === "UNAUTHORIZED" ? { ok: !1, error: h(401, u.message) } : ((s = u.extensions) == null ? void 0 : s.code) === "BAD_USER_INPUT" || ((m = u.extensions) == null ? void 0 : m.code) === "BAD_REQUEST" ? { ok: !1, error: h(400, u.message) } : {
2195
+ ok: !1,
2196
+ error: h(500, u.message)
2197
+ } : {
2198
2198
  ok: !0,
2199
- data: y
2199
+ data: b
2200
2200
  };
2201
2201
  } catch {
2202
2202
  return {
2203
2203
  ok: !1,
2204
- error: l(500)
2204
+ error: h(500)
2205
2205
  };
2206
2206
  }
2207
2207
  }
@@ -2211,28 +2211,28 @@ class h {
2211
2211
  t = await a(t);
2212
2212
  return t;
2213
2213
  }
2214
- static createUploadBody(e, t) {
2215
- const { files: a, others: o } = h.extractFiles(t), d = new FormData();
2216
- d.append(
2214
+ createUploadBody(e, t) {
2215
+ const { files: a, others: r } = this.extractFiles(t), s = new FormData();
2216
+ s.append(
2217
2217
  "operations",
2218
2218
  JSON.stringify({
2219
2219
  query: e,
2220
2220
  variables: t
2221
2221
  })
2222
- ), Object.entries(o).forEach(([u, p]) => {
2223
- d.append(u, JSON.stringify(p));
2222
+ ), Object.entries(r).forEach(([c, l]) => {
2223
+ s.append(c, JSON.stringify(l));
2224
2224
  });
2225
2225
  const m = {};
2226
- return Object.keys(a).forEach((u, p) => {
2227
- m[p.toString()] = `variables.${u}`;
2228
- }), d.append("map", JSON.stringify(m)), Object.values(a).forEach((u, p) => {
2229
- d.append(p.toString(), u);
2230
- }), d;
2226
+ return Object.keys(a).forEach((c, l) => {
2227
+ m[l.toString()] = `variables.${c}`;
2228
+ }), s.append("map", JSON.stringify(m)), Object.values(a).forEach((c, l) => {
2229
+ s.append(l.toString(), c);
2230
+ }), s;
2231
2231
  }
2232
- static extractFiles(e) {
2232
+ extractFiles(e) {
2233
2233
  const t = {}, a = {};
2234
- return Object.entries(e).forEach(([o, d]) => {
2235
- d instanceof File || d instanceof Blob ? t[o] = d : a[o] = d;
2234
+ return Object.entries(e).forEach(([r, s]) => {
2235
+ s instanceof File || s instanceof Blob ? t[r] = s : a[r] = s;
2236
2236
  }), {
2237
2237
  files: t,
2238
2238
  others: a
@@ -2241,19 +2241,19 @@ class h {
2241
2241
  }
2242
2242
  class St {
2243
2243
  constructor(e) {
2244
- c(this, "gameService");
2245
- c(this, "fileService");
2246
- c(this, "walletService");
2247
- c(this, "reportService");
2248
- c(this, "portalService");
2249
- c(this, "accountService");
2250
- c(this, "sessionManager");
2251
- c(this, "transformer");
2252
- c(this, "logger");
2244
+ d(this, "gameService");
2245
+ d(this, "fileService");
2246
+ d(this, "walletService");
2247
+ d(this, "reportService");
2248
+ d(this, "portalService");
2249
+ d(this, "accountService");
2250
+ d(this, "sessionManager");
2251
+ d(this, "transformer");
2252
+ d(this, "logger");
2253
2253
  const t = e.environment === "development";
2254
2254
  this.sessionManager = new gt({
2255
- url: t ? "https://auth.development.opexa.io" : "https://auth.opexa.io",
2256
- platform: e.platform
2255
+ ...e,
2256
+ url: t ? "https://auth.development.opexa.io" : "https://auth.opexa.io"
2257
2257
  });
2258
2258
  const a = {
2259
2259
  middlewares: [this.authMiddleware],
@@ -2264,37 +2264,37 @@ class St {
2264
2264
  }
2265
2265
  }
2266
2266
  };
2267
- this.gameService = new he(
2268
- new h(
2267
+ this.gameService = new we(
2268
+ new g(
2269
2269
  t ? "https://game.development.opexa.io/graphql" : "https://game.opexa.io/graphql",
2270
2270
  a
2271
2271
  )
2272
2272
  ), this.fileService = new ut(
2273
- new h(
2273
+ new g(
2274
2274
  t ? "https://file.development.opexa.io/graphql" : "https://file.opexa.io/graphql",
2275
2275
  a
2276
2276
  )
2277
- ), this.walletService = new ft(
2278
- new h(
2277
+ ), this.walletService = new ht(
2278
+ new g(
2279
2279
  t ? "https://wallet.development.opexa.io/graphql" : "https://wallet.opexa.io/graphql",
2280
2280
  a
2281
2281
  )
2282
2282
  ), this.reportService = new lt(
2283
- new h(
2283
+ new g(
2284
2284
  t ? "https://report.development.opexa.io/graphql" : "https://report.opexa.io/graphql",
2285
2285
  a
2286
2286
  )
2287
- ), this.accountService = new dt(
2288
- new h(
2287
+ ), this.accountService = new mt(
2288
+ new g(
2289
2289
  t ? "https://account.development.opexa.io/graphql" : "https://account.opexa.io/graphql",
2290
2290
  a
2291
2291
  )
2292
- ), this.portalService = new ht(
2293
- new h(
2292
+ ), this.portalService = new ft(
2293
+ new g(
2294
2294
  t ? "https://portal.development.opexa.io/graphql" : "https://portal.opexa.io/graphql",
2295
2295
  a
2296
2296
  )
2297
- ), this.transformer = new yt(e), this.logger = new pe({
2297
+ ), this.transformer = new yt(e), this.logger = new he({
2298
2298
  enabled: e.log ?? !1
2299
2299
  });
2300
2300
  }
@@ -2313,16 +2313,37 @@ class St {
2313
2313
  await this.sessionManager.destroy();
2314
2314
  }
2315
2315
  /**
2316
+ * @description Watches the session if it is still valid whenever signed in.
2316
2317
  * @returns Unsubscribe function
2318
+ * @example
2319
+ * ```tsx
2320
+ * import * as React from 'react';
2321
+ * import { useAuthenticated } from '@lib/stores';
2322
+ *
2323
+ * function WatchSession() {
2324
+ * const { setAuthenticated } = useAuthenticated();
2325
+ *
2326
+ * React.useEffect(() => {
2327
+ * const unsubscribe = sdk.watchSession({
2328
+ * interval: 30000,
2329
+ * onInvalid() {
2330
+ * setAuthenticated(false);
2331
+ * },
2332
+ * });
2333
+ *
2334
+ * return unsubscribe;
2335
+ * }, []);
2336
+ * }
2337
+ * ```
2317
2338
  */
2318
2339
  watchSession(e) {
2319
2340
  const t = e.interval ?? 3e4, a = e.onInvalid;
2320
- let o = null;
2321
- const d = () => setTimeout(async () => {
2322
- await this.sessionManager.verify() || await a(), o = d();
2341
+ let r = null;
2342
+ const s = () => setTimeout(async () => {
2343
+ await this.sessionManager.verify() || await a(), r = s();
2323
2344
  }, t);
2324
- return o = d(), function() {
2325
- o && clearTimeout(o);
2345
+ return r = s(), function() {
2346
+ r && clearTimeout(r);
2326
2347
  };
2327
2348
  }
2328
2349
  async session() {
@@ -2387,12 +2408,12 @@ class St {
2387
2408
  * ```
2388
2409
  */
2389
2410
  async createAccount(e) {
2390
- const t = e.id ?? w.generate(g.Account).toString(), a = await this.accountService.registerMemberAccount({
2411
+ const t = e.id ?? f.generate(w.Account).toString(), a = await this.accountService.registerMemberAccount({
2391
2412
  input: {
2392
2413
  id: t,
2393
2414
  name: e.name,
2394
2415
  birthDay: typeof e.dateOfBirth == "string" ? e.dateOfBirth : e.dateOfBirth.toISOString(),
2395
- password: await f(e.password),
2416
+ password: await p(e.password),
2396
2417
  mobileNumber: this.addAreaCode(e.mobileNumber),
2397
2418
  domain: e.domain
2398
2419
  },
@@ -2422,8 +2443,8 @@ class St {
2422
2443
  id: e,
2423
2444
  data: {
2424
2445
  ...t,
2425
- password: t.password ? await f(t.password) : void 0,
2426
- transactionPassword: t.transactionPassword ? await f(t.transactionPassword) : void 0,
2446
+ password: t.password ? await p(t.password) : void 0,
2447
+ transactionPassword: t.transactionPassword ? await p(t.transactionPassword) : void 0,
2427
2448
  ...t.mobileNumber && {
2428
2449
  mobileNumber: this.addAreaCode(t.mobileNumber)
2429
2450
  }
@@ -2467,7 +2488,7 @@ class St {
2467
2488
  * ```
2468
2489
  */
2469
2490
  async submitVerificationDetails(e) {
2470
- const t = e.id ?? w.generate(g.Verification).toString(), a = await this.accountService.createMemberVerification({
2491
+ const t = e.id ?? f.generate(w.Verification).toString(), a = await this.accountService.createMemberVerification({
2471
2492
  input: {
2472
2493
  id: t,
2473
2494
  ...e
@@ -2504,7 +2525,7 @@ class St {
2504
2525
  return await this.accountService.resetPassword({
2505
2526
  input: {
2506
2527
  mobileNumber: this.addAreaCode(e.mobileNumber),
2507
- newPassword: await f(e.newPassword)
2528
+ newPassword: await p(e.newPassword)
2508
2529
  },
2509
2530
  verificationCode: e.verificationCode
2510
2531
  });
@@ -2558,8 +2579,8 @@ class St {
2558
2579
  return t.ok ? {
2559
2580
  ok: !0,
2560
2581
  data: {
2561
- announcements: t.data.edges.map(({ cursor: a, node: o }) => ({
2562
- ...this.transformer.transform.announcement(o),
2582
+ announcements: t.data.edges.map(({ cursor: a, node: r }) => ({
2583
+ ...this.transformer.transform.announcement(r),
2563
2584
  cursor: a
2564
2585
  })),
2565
2586
  totalCount: t.data.totalCount,
@@ -2591,13 +2612,13 @@ class St {
2591
2612
  * ```
2592
2613
  */
2593
2614
  async createWithdrawal(e) {
2594
- const t = e.id ?? w.generate(g.Withdrawal).toString();
2615
+ const t = e.id ?? f.generate(w.Withdrawal).toString();
2595
2616
  if (e.type === "BANK") {
2596
2617
  const a = await this.walletService.createBankWithdrawal({
2597
2618
  input: {
2598
2619
  id: t,
2599
2620
  amount: e.amount.toString(),
2600
- transactionPassword: await f(e.transactionPassword)
2621
+ transactionPassword: await p(e.transactionPassword)
2601
2622
  }
2602
2623
  });
2603
2624
  if (!a.ok) return a;
@@ -2607,7 +2628,7 @@ class St {
2607
2628
  input: {
2608
2629
  id: t,
2609
2630
  amount: e.amount.toString(),
2610
- transactionPassword: await f(e.transactionPassword),
2631
+ transactionPassword: await p(e.transactionPassword),
2611
2632
  recipientMobileNumber: this.addAreaCode(e.recipientMobileNumber)
2612
2633
  }
2613
2634
  });
@@ -2618,7 +2639,7 @@ class St {
2618
2639
  input: {
2619
2640
  id: t,
2620
2641
  amount: e.amount.toString(),
2621
- transactionPassword: await f(e.transactionPassword),
2642
+ transactionPassword: await p(e.transactionPassword),
2622
2643
  recipientMobileNumber: this.addAreaCode(e.recipientMobileNumber)
2623
2644
  }
2624
2645
  });
@@ -2629,7 +2650,7 @@ class St {
2629
2650
  input: {
2630
2651
  id: t,
2631
2652
  amount: e.amount.toString(),
2632
- transactionPassword: await f(e.transactionPassword)
2653
+ transactionPassword: await p(e.transactionPassword)
2633
2654
  }
2634
2655
  });
2635
2656
  if (!a.ok) return a;
@@ -2641,8 +2662,8 @@ class St {
2641
2662
  return t.ok ? {
2642
2663
  ok: !0,
2643
2664
  data: {
2644
- withdrawalRecords: t.data.edges.map(({ cursor: a, node: o }) => ({
2645
- ...this.transformer.transform.withdrawalRecord(o),
2665
+ withdrawalRecords: t.data.edges.map(({ cursor: a, node: r }) => ({
2666
+ ...this.transformer.transform.withdrawalRecord(r),
2646
2667
  cursor: a
2647
2668
  })),
2648
2669
  totalCount: t.data.totalCount,
@@ -2677,7 +2698,7 @@ class St {
2677
2698
  * ```
2678
2699
  */
2679
2700
  async createDeposit(e) {
2680
- const t = e.id ?? w.generate(g.Deposit).toString();
2701
+ const t = e.id ?? f.generate(w.Deposit).toString();
2681
2702
  if (e.type === "MAYA") {
2682
2703
  const a = await this.walletService.createMayaDeposit({
2683
2704
  input: {
@@ -2722,8 +2743,8 @@ class St {
2722
2743
  return t.ok ? {
2723
2744
  ok: !0,
2724
2745
  data: {
2725
- depositRecords: t.data.edges.map(({ cursor: a, node: o }) => ({
2726
- ...this.transformer.transform.depositRecord(o),
2746
+ depositRecords: t.data.edges.map(({ cursor: a, node: r }) => ({
2747
+ ...this.transformer.transform.depositRecord(r),
2727
2748
  cursor: a
2728
2749
  })),
2729
2750
  totalCount: t.data.totalCount,
@@ -2745,8 +2766,8 @@ class St {
2745
2766
  return t.ok ? {
2746
2767
  ok: !0,
2747
2768
  data: {
2748
- betRecords: t.data.edges.map(({ cursor: a, node: o }) => ({
2749
- ...this.transformer.transform.betRecord(o),
2769
+ betRecords: t.data.edges.map(({ cursor: a, node: r }) => ({
2770
+ ...this.transformer.transform.betRecord(r),
2750
2771
  cursor: a
2751
2772
  })),
2752
2773
  totalCount: t.data.totalCount,
@@ -2772,8 +2793,8 @@ class St {
2772
2793
  return t.ok ? {
2773
2794
  ok: !0,
2774
2795
  data: {
2775
- transactionRecords: t.data.edges.map(({ cursor: a, node: o }) => ({
2776
- ...this.transformer.transform.transactionRecord(o),
2796
+ transactionRecords: t.data.edges.map(({ cursor: a, node: r }) => ({
2797
+ ...this.transformer.transform.transactionRecord(r),
2777
2798
  cursor: a
2778
2799
  })),
2779
2800
  totalCount: t.data.totalCount,
@@ -2835,8 +2856,8 @@ class St {
2835
2856
  return t.ok ? {
2836
2857
  ok: !0,
2837
2858
  data: {
2838
- games: t.data.edges.map(({ cursor: a, node: o }) => ({
2839
- ...this.transformer.transform.game(o),
2859
+ games: t.data.edges.map(({ cursor: a, node: r }) => ({
2860
+ ...this.transformer.transform.game(r),
2840
2861
  cursor: a
2841
2862
  })),
2842
2863
  totalCount: t.data.totalCount,
@@ -2864,8 +2885,8 @@ class St {
2864
2885
  return t.ok ? {
2865
2886
  ok: !0,
2866
2887
  data: {
2867
- games: t.data.edges.map(({ cursor: a, node: o }) => ({
2868
- ...this.transformer.transform.game(o),
2888
+ games: t.data.edges.map(({ cursor: a, node: r }) => ({
2889
+ ...this.transformer.transform.game(r),
2869
2890
  cursor: a
2870
2891
  })),
2871
2892
  totalCount: t.data.totalCount,
@@ -2890,7 +2911,7 @@ class St {
2890
2911
  * ```
2891
2912
  */
2892
2913
  async createGameSession(e) {
2893
- const t = e.id ?? w.generate(g.GameSession).toString(), a = await this.gameService.createGameSession({
2914
+ const t = e.id ?? f.generate(w.GameSession).toString(), a = await this.gameService.createGameSession({
2894
2915
  input: {
2895
2916
  id: t,
2896
2917
  game: e.game
@@ -2914,7 +2935,7 @@ class St {
2914
2935
  * ```
2915
2936
  */
2916
2937
  async createGameSession__next(e) {
2917
- const t = e.id ?? w.generate(g.GameSession).toString(), a = await this.walletService.createGameSession({
2938
+ const t = e.id ?? f.generate(w.GameSession).toString(), a = await this.walletService.createGameSession({
2918
2939
  input: {
2919
2940
  id: t,
2920
2941
  game: e.game
@@ -2970,7 +2991,7 @@ class St {
2970
2991
  * ```
2971
2992
  */
2972
2993
  async uploadImageFile(e) {
2973
- const t = e.id ?? w.generate(g.File).toString(), a = await this.fileService.uploadPrivateImageFile({
2994
+ const t = e.id ?? f.generate(w.File).toString(), a = await this.fileService.uploadPrivateImageFile({
2974
2995
  input: {
2975
2996
  id: t,
2976
2997
  file: e.file
@@ -3003,7 +3024,7 @@ class St {
3003
3024
  }
3004
3025
  export {
3005
3026
  Ct as ObjectId,
3006
- g as ObjectType,
3027
+ w as ObjectType,
3007
3028
  St as Sdk
3008
3029
  };
3009
3030
  //# sourceMappingURL=index.mjs.map