@opexa/portal-sdk 0.0.24 → 0.0.25

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,34 +1,35 @@
1
1
  var Te = Object.defineProperty;
2
- var Ce = (o, e, t) => e in o ? Te(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var c = (o, e, t) => Ce(o, typeof e != "symbol" ? e + "" : e, t);
4
- import { ObjectId as A } from "@opexa/object-id";
5
- import { ObjectId as Ot } from "@opexa/object-id";
2
+ var Ce = (n, e, t) => e in n ? Te(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var c = (n, e, t) => Ce(n, typeof e != "symbol" ? e + "" : e, t);
4
+ import { ObjectId as E } from "@opexa/object-id";
5
+ import { ObjectId as Ut } from "@opexa/object-id";
6
6
  const S = {
7
7
  Account: 8,
8
8
  Deposit: 9,
9
9
  Withdrawal: 14,
10
10
  Verification: 15,
11
11
  File: 16,
12
+ Game: 203,
12
13
  GameSession: 204,
13
14
  MayaSession: 230
14
15
  };
15
- function n(o, ...e) {
16
+ function o(n, ...e) {
16
17
  let t = "";
17
- for (const [a, r] of o.entries()) {
18
+ for (const [a, r] of n.entries()) {
18
19
  const s = e.at(a) ?? "";
19
20
  t = `${t}${r}${s}`;
20
21
  }
21
22
  return t.trim();
22
23
  }
23
- const Y = n`
24
+ const V = o`
24
25
  fragment FileFragment on File {
25
26
  id
26
27
  url
27
28
  status
28
29
  dateTimeCreated
29
30
  }
30
- `, Ie = n`
31
- ${Y}
31
+ `, Ne = o`
32
+ ${V}
32
33
 
33
34
  query File($id: ObjectId!) {
34
35
  node(id: $id) {
@@ -37,7 +38,7 @@ const Y = n`
37
38
  }
38
39
  }
39
40
  }
40
- `, Me = n`
41
+ `, ve = o`
41
42
  mutation UploadPrivateImageFile($input: UploadFileInput!) {
42
43
  uploadPrivateImageFile(input: $input) {
43
44
  ... on FileFormatNotSupportedError {
@@ -51,7 +52,7 @@ const Y = n`
51
52
  }
52
53
  }
53
54
  }
54
- `, Ne = n`
55
+ `, Ie = o`
55
56
  query Wallet {
56
57
  wallet {
57
58
  id
@@ -61,7 +62,7 @@ const Y = n`
61
62
  dateTimeLastUpdated
62
63
  }
63
64
  }
64
- `, De = n`
65
+ `, Me = o`
65
66
  query PointsWallet {
66
67
  pointsWallet {
67
68
  id
@@ -70,7 +71,7 @@ const Y = n`
70
71
  dateTimeCreated
71
72
  }
72
73
  }
73
- `, ve = n`
74
+ `, De = o`
74
75
  mutation PointsToCashConversion($input: PointsToCashConversionInput!) {
75
76
  pointsToCashConversion(input: $input) {
76
77
  ... on InsufficientPointsError {
@@ -78,14 +79,14 @@ const Y = n`
78
79
  }
79
80
  }
80
81
  }
81
- `, H = n`
82
+ `, H = o`
82
83
  fragment GameFragment on Game {
83
84
  id
84
85
  type
85
86
  name
86
87
  provider
87
88
  }
88
- `, ge = n`
89
+ `, ge = o`
89
90
  ${H}
90
91
 
91
92
  query Games($first: Int, $after: Cursor, $filter: GameFilterInput) {
@@ -105,7 +106,7 @@ const Y = n`
105
106
  }
106
107
  }
107
108
  }
108
- `, Ee = n`
109
+ `, Ee = o`
109
110
  ${H}
110
111
 
111
112
  query GamesByName($first: Int, $search: String!, $filter: GameFilterInput) {
@@ -113,7 +114,7 @@ const Y = n`
113
114
  id
114
115
  }
115
116
  }
116
- `, Re = n`
117
+ `, Re = o`
117
118
  query GameSession($id: ObjectId!) {
118
119
  node(id: $id) {
119
120
  ... on GameSession {
@@ -126,7 +127,7 @@ const Y = n`
126
127
  }
127
128
  }
128
129
  }
129
- `, Ae = n`
130
+ `, Se = o`
130
131
  mutation CreateGameSession($input: CreateGameSessionInput!) {
131
132
  createGameSession(input: $input) {
132
133
  ... on GameDoesNotExistError {
@@ -134,11 +135,11 @@ const Y = n`
134
135
  }
135
136
  }
136
137
  }
137
- `, Pe = n`
138
+ `, Pe = o`
138
139
  mutation EndGameSession($input: EndGameSessionInput!) {
139
140
  endGameSession(input: $input)
140
141
  }
141
- `, Ge = n`
142
+ `, xe = o`
142
143
  query GameSession($id: ObjectId!) {
143
144
  node(id: $id) {
144
145
  ... on GameSession {
@@ -153,7 +154,7 @@ const Y = n`
153
154
  }
154
155
  }
155
156
  }
156
- `, xe = n`
157
+ `, Ge = o`
157
158
  mutation EndGameSession($input: EndGameSessionInput!) {
158
159
  endGameSession(input: $input) {
159
160
  ... on GameSessionDoesNotExistError {
@@ -167,7 +168,7 @@ const Y = n`
167
168
  }
168
169
  }
169
170
  }
170
- `, Ue = n`
171
+ `, Oe = o`
171
172
  query Announcements($first: Int, $after: Cursor, $filter: AnnouncementFilterInput) {
172
173
  announcements(first: $first, after: $after, filter: $filter) {
173
174
  edges {
@@ -193,7 +194,7 @@ const Y = n`
193
194
  }
194
195
  }
195
196
  }
196
- `, Oe = n`
197
+ `, Ue = o`
197
198
  query WithdrawalRecords($first: Int, $after: Cursor, $filter: WithdrawalRecordFilterInput) {
198
199
  member {
199
200
  withdrawalRecords(first: $first, after: $after, filter: $filter) {
@@ -260,7 +261,7 @@ const Y = n`
260
261
  }
261
262
  }
262
263
  }
263
- `, $e = n`
264
+ `, $e = o`
264
265
  mutation CreateGCashWithdrawal($input: CreateGCashWithdrawalInput!) {
265
266
  createGCashWithdrawal(input: $input) {
266
267
  ... on AccountNotVerifiedError {
@@ -283,7 +284,7 @@ const Y = n`
283
284
  }
284
285
  }
285
286
  }
286
- `, qe = n`
287
+ `, Be = o`
287
288
  mutation CreateMayaWithdrawal($input: CreateMayaWithdrawalInput!) {
288
289
  createMayaWithdrawal(input: $input) {
289
290
  ... on AccountNotVerifiedError {
@@ -306,7 +307,7 @@ const Y = n`
306
307
  }
307
308
  }
308
309
  }
309
- `, Be = n`
310
+ `, qe = o`
310
311
  mutation CreateMayaAppWithdrawal($input: CreateMayaAppWithdrawalInput!) {
311
312
  createMayaAppWithdrawal(input: $input) {
312
313
  ... on AccountNotVerifiedError {
@@ -326,7 +327,7 @@ const Y = n`
326
327
  }
327
328
  }
328
329
  }
329
- `, We = n`
330
+ `, We = o`
330
331
  mutation CreateBankWithdrawal($input: CreateBankWithdrawalInput!) {
331
332
  createBankWithdrawal(input: $input) {
332
333
  ... on MobileNumberNotVerifiedError {
@@ -349,11 +350,11 @@ const Y = n`
349
350
  }
350
351
  }
351
352
  }
352
- `, Le = n`
353
+ `, Le = o`
353
354
  query RemainingDailyWithdrawalsCount {
354
355
  remainingDailyWithdrawalsCount
355
356
  }
356
- `, Fe = n`
357
+ `, Fe = o`
357
358
  query DepositRecords($after: Cursor, $first: Int, $filter: DepositRecordFilterInput) {
358
359
  member {
359
360
  depositRecords(after: $after, first: $first, filter: $filter) {
@@ -382,7 +383,7 @@ const Y = n`
382
383
  }
383
384
  }
384
385
  }
385
- `, Ve = n`
386
+ `, Ve = o`
386
387
  mutation CreateGCashDeposit($input: CreateGCashDepositInput!) {
387
388
  createGCashDeposit(input: $input) {
388
389
  ... on DepositPromoMaximumAmountExceededError {
@@ -411,7 +412,7 @@ const Y = n`
411
412
  }
412
413
  }
413
414
  }
414
- `, je = n`
415
+ `, He = o`
415
416
  mutation CreateMayaDeposit($input: CreateMayaDepositInput!) {
416
417
  createMayaDeposit(input: $input) {
417
418
  ... on DepositPromoMaximumAmountExceededError {
@@ -440,7 +441,7 @@ const Y = n`
440
441
  }
441
442
  }
442
443
  }
443
- `, Ye = n`
444
+ `, Ye = o`
444
445
  mutation CreateMayaAppDeposit($input: CreateMayaAppDepositInput!) {
445
446
  createMayaAppDeposit(input: $input) {
446
447
  ... on DepositPromoMaximumAmountExceededError {
@@ -469,7 +470,7 @@ const Y = n`
469
470
  }
470
471
  }
471
472
  }
472
- `, He = n`
473
+ `, je = o`
473
474
  query Deposit($id: ObjectId!) {
474
475
  node(id: $id) {
475
476
  ... on GCashDeposit {
@@ -501,13 +502,13 @@ const Y = n`
501
502
  }
502
503
  }
503
504
  }
504
- `, Qe = n`
505
+ `, Qe = o`
505
506
  query DepositsCount {
506
507
  member {
507
508
  depositsCount
508
509
  }
509
510
  }
510
- `, Ke = n`
511
+ `, Ke = o`
511
512
  ${H}
512
513
 
513
514
  query BetRecords($first: Int, $after: Cursor, $filter: BetRecordFilterInput) {
@@ -547,7 +548,7 @@ const Y = n`
547
548
  }
548
549
  }
549
550
  }
550
- `, ze = n`
551
+ `, ze = o`
551
552
  query LatestBetRecords {
552
553
  latestBetRecords {
553
554
  id
@@ -567,7 +568,7 @@ const Y = n`
567
568
  }
568
569
 
569
570
  ${H}
570
- `, Je = n`
571
+ `, Je = o`
571
572
  query TransactionRecords($first: Int, $after: Cursor, $filter: TransactionRecordFilter) {
572
573
  member {
573
574
  transactionRecords(first: $first, after: $after, filter: $filter) {
@@ -593,8 +594,8 @@ const Y = n`
593
594
  }
594
595
  }
595
596
  }
596
- `, z = n`
597
- ${Y}
597
+ `, Q = o`
598
+ ${V}
598
599
 
599
600
  fragment PromoFragment on Promo {
600
601
  id
@@ -612,24 +613,24 @@ const Y = n`
612
613
  dateTimeCreated
613
614
  dateTimeLastUpdated
614
615
  }
615
- `, Xe = n`
616
- ${z}
616
+ `, Xe = o`
617
+ ${Q}
617
618
 
618
619
  query Promos {
619
620
  promos {
620
621
  ...PromoFragment
621
622
  }
622
623
  }
623
- `, Ze = n`
624
- ${z}
624
+ `, Ze = o`
625
+ ${Q}
625
626
 
626
627
  query AvailablePromos($filter: PromoFilterInput) {
627
628
  availablePromos(filter: $filter) {
628
629
  ...PromoFragment
629
630
  }
630
631
  }
631
- `, Se = n`
632
- ${Y}
632
+ `, Ae = o`
633
+ ${V}
633
634
 
634
635
  fragment CashbackFragment on Cashback {
635
636
  id
@@ -644,16 +645,16 @@ const Y = n`
644
645
  dateTimeCreated
645
646
  dateTimeLastUpdated
646
647
  }
647
- `, et = n`
648
- ${Se}
648
+ `, et = o`
649
+ ${Ae}
649
650
 
650
651
  query Cashbacks {
651
652
  cashbacks {
652
653
  ...CashbackFragment
653
654
  }
654
655
  }
655
- `, tt = n`
656
- ${z}
656
+ `, tt = o`
657
+ ${Q}
657
658
 
658
659
  query Bonus {
659
660
  bonus {
@@ -681,8 +682,8 @@ const Y = n`
681
682
  dateTimeLastUpdated
682
683
  }
683
684
  }
684
- `, at = n`
685
- ${Se}
685
+ `, at = o`
686
+ ${Ae}
686
687
 
687
688
  query CashbackBonuses {
688
689
  cashbackBonuses {
@@ -695,7 +696,7 @@ const Y = n`
695
696
  dateTimeLastUpdated
696
697
  }
697
698
  }
698
- `, rt = n`
699
+ `, rt = o`
699
700
  mutation ClaimCashbackBonus($input: ClaimCashbackBonusInput!) {
700
701
  claimCashbackBonus(input: $input) {
701
702
  ... on CashbackBonusDoesNotExistError {
@@ -703,13 +704,13 @@ const Y = n`
703
704
  }
704
705
  }
705
706
  }
706
- `, ot = n`
707
+ `, nt = o`
707
708
  query Member {
708
709
  member {
709
710
  dateTimeLastActive
710
711
  }
711
712
  }
712
- `, nt = n`
713
+ `, ot = o`
713
714
  query MemberAccount {
714
715
  memberAccount: self {
715
716
  ... on MemberAccount {
@@ -733,8 +734,8 @@ const Y = n`
733
734
  }
734
735
  }
735
736
  }
736
- `, it = n`
737
- ${Y}
737
+ `, it = o`
738
+ ${V}
738
739
 
739
740
  query MemberVerification {
740
741
  memberAccount: self {
@@ -757,7 +758,7 @@ const Y = n`
757
758
  }
758
759
  }
759
760
  }
760
- `, st = n`
761
+ `, st = o`
761
762
  mutation RegisterMemberAccount(
762
763
  $input: RegisterMemberAccountInput!
763
764
  $referralCode: String
@@ -793,7 +794,7 @@ const Y = n`
793
794
  }
794
795
  }
795
796
  }
796
- `, mt = n`
797
+ `, mt = o`
797
798
  mutation UpdateMemberAccount($input: UpdateMemberAccountInput!) {
798
799
  updateMemberAccount(input: $input) {
799
800
  ... on AccountNameNotAvailableError {
@@ -819,7 +820,7 @@ const Y = n`
819
820
  }
820
821
  }
821
822
  }
822
- `, ct = n`
823
+ `, ct = o`
823
824
  mutation ResetPassword($input: ResetPasswordInput!, $verificationCode: String) {
824
825
  resetPassword(input: $input, verificationCode: $verificationCode) {
825
826
  ... on AccountNotFoundError {
@@ -830,11 +831,11 @@ const Y = n`
830
831
  }
831
832
  }
832
833
  }
833
- `, dt = n`
834
+ `, dt = o`
834
835
  mutation DeleteMemberAccount($input: DeleteMemberAccountInput!) {
835
836
  deleteMemberAccount(input: $input)
836
837
  }
837
- `, ut = n`
838
+ `, ut = o`
838
839
  mutation VerifyMobileNumber($input: VerifyMobileNumberInput!) {
839
840
  verifyMobileNumber(input: $input) {
840
841
  ... on InvalidSMSVerificationCodeError {
@@ -845,7 +846,7 @@ const Y = n`
845
846
  }
846
847
  }
847
848
  }
848
- `, lt = n`
849
+ `, lt = o`
849
850
  mutation CreateMemberVerification($input: CreateMemberVerificationInput!) {
850
851
  createMemberVerification(input: $input) {
851
852
  ... on FileDoesNotExistError {
@@ -859,7 +860,7 @@ const Y = n`
859
860
  }
860
861
  }
861
862
  }
862
- `, pt = n`
863
+ `, pt = o`
863
864
  mutation UpdateMemberVerification($input: UpdateMemberVerificationInput!) {
864
865
  updateMemberVerification(input: $input) {
865
866
  ... on FileDoesNotExistError {
@@ -876,7 +877,7 @@ const Y = n`
876
877
  }
877
878
  }
878
879
  }
879
- `, ft = n`
880
+ `, ft = o`
880
881
  query ProfileCompletion {
881
882
  profileCompletion {
882
883
  completionPercentage
@@ -887,7 +888,7 @@ const Y = n`
887
888
  accountPassword
888
889
  }
889
890
  }
890
- `, ht = n`
891
+ `, ht = o`
891
892
  mutation SendVerificationCode($input: SendVerificationCodeInput!) {
892
893
  sendVerificationCode(input: $input) {
893
894
  ... on InvalidPlatformError {
@@ -898,7 +899,7 @@ const Y = n`
898
899
  }
899
900
  }
900
901
  }
901
- `, wt = n`
902
+ `, wt = o`
902
903
  fragment DepositGatewaySettingsCoreData on DepositGatewaySettings {
903
904
  minimumAmount
904
905
  maximumAmount
@@ -952,7 +953,7 @@ const Y = n`
952
953
  multiplier
953
954
  }
954
955
  }
955
- `, yt = n`
956
+ `, yt = o`
956
957
  query MayaSession($id: ObjectId!) {
957
958
  mayaSession(id: $id) {
958
959
  id
@@ -961,9 +962,9 @@ const Y = n`
961
962
  }
962
963
  }
963
964
  `;
964
- function d(o) {
965
+ function d(n) {
965
966
  return {
966
- name: o,
967
+ name: n,
967
968
  message: {
968
969
  AccountNameNotAvailableError: "Username is no longer available",
969
970
  AccountNotFoundError: "Account does not exist",
@@ -1012,7 +1013,7 @@ function d(o) {
1012
1013
  InvalidToken: "Invalid token",
1013
1014
  InvalidTokenOrSecretAnswer: "Invalid token or secret answer",
1014
1015
  SessionExpired: "Session expired"
1015
- }[o]
1016
+ }[n]
1016
1017
  };
1017
1018
  }
1018
1019
  class gt {
@@ -1022,7 +1023,7 @@ class gt {
1022
1023
  }
1023
1024
  /** aka `Query.self` */
1024
1025
  async memberAccount() {
1025
- const e = await this.client.request(nt);
1026
+ const e = await this.client.request(ot);
1026
1027
  return e.ok ? {
1027
1028
  ok: !0,
1028
1029
  data: e.data.memberAccount
@@ -1122,7 +1123,7 @@ class gt {
1122
1123
  }
1123
1124
  async announcements(e) {
1124
1125
  const t = await this.client.request(
1125
- Ue,
1126
+ Oe,
1126
1127
  e
1127
1128
  );
1128
1129
  return t.ok ? {
@@ -1131,14 +1132,14 @@ class gt {
1131
1132
  } : t;
1132
1133
  }
1133
1134
  }
1134
- function u(o, e) {
1135
- const t = Q[o] ? Q[o] : Q[500];
1135
+ function h(n, e) {
1136
+ const t = Y[n] ? Y[n] : Y[500];
1136
1137
  return {
1137
1138
  name: t.name,
1138
1139
  message: e ?? t.message
1139
1140
  };
1140
1141
  }
1141
- const Q = {
1142
+ const Y = {
1142
1143
  400: { name: "HttpBadRequest", message: "Bad Request" },
1143
1144
  401: { name: "HttpUnauthorized", message: "Unauthorized" },
1144
1145
  403: { name: "HttpForbidden", message: "Forbidden" },
@@ -1181,12 +1182,12 @@ class Et {
1181
1182
  error: d("AccountBlacklisted")
1182
1183
  } : {
1183
1184
  ok: !1,
1184
- error: u(a.status)
1185
+ error: h(a.status)
1185
1186
  };
1186
1187
  } catch {
1187
1188
  return {
1188
1189
  ok: !1,
1189
- error: u(500)
1190
+ error: h(500)
1190
1191
  };
1191
1192
  }
1192
1193
  }
@@ -1214,12 +1215,12 @@ class Et {
1214
1215
  error: d("InvalidTokenOrSecretAnswer")
1215
1216
  } : {
1216
1217
  ok: !1,
1217
- error: u(a.status)
1218
+ error: h(a.status)
1218
1219
  };
1219
1220
  } catch {
1220
1221
  return {
1221
1222
  ok: !1,
1222
- error: u(500)
1223
+ error: h(500)
1223
1224
  };
1224
1225
  }
1225
1226
  }
@@ -1247,12 +1248,12 @@ class Et {
1247
1248
  error: d("InvalidToken")
1248
1249
  } : {
1249
1250
  ok: !1,
1250
- error: u(t.status)
1251
+ error: h(t.status)
1251
1252
  };
1252
1253
  } catch {
1253
1254
  return {
1254
1255
  ok: !1,
1255
- error: u(500)
1256
+ error: h(500)
1256
1257
  };
1257
1258
  }
1258
1259
  }
@@ -1267,9 +1268,9 @@ class Et {
1267
1268
  Authorization: `Bearer ${e}`
1268
1269
  }
1269
1270
  });
1270
- return t.ok ? { ok: !0 } : { ok: !1, error: u(t.status) };
1271
+ return t.ok ? { ok: !0 } : { ok: !1, error: h(t.status) };
1271
1272
  } catch {
1272
- return { ok: !1, error: u(500) };
1273
+ return { ok: !1, error: h(500) };
1273
1274
  }
1274
1275
  }
1275
1276
  async verifySession(e) {
@@ -1288,20 +1289,20 @@ class Et {
1288
1289
  }
1289
1290
  }
1290
1291
  }
1291
- class At {
1292
+ class St {
1292
1293
  constructor(e) {
1293
1294
  c(this, "client");
1294
1295
  this.client = e;
1295
1296
  }
1296
1297
  async file(e) {
1297
- const t = await this.client.request(Ie, e);
1298
+ const t = await this.client.request(Ne, e);
1298
1299
  return t.ok ? {
1299
1300
  ok: !0,
1300
1301
  data: t.data.node
1301
1302
  } : t;
1302
1303
  }
1303
1304
  async uploadPrivateImageFile(e) {
1304
- const t = await this.client.upload(Me, e);
1305
+ const t = await this.client.upload(ve, e);
1305
1306
  return t.ok ? t.data.uploadPrivateImageFile ? {
1306
1307
  ok: !1,
1307
1308
  error: d(t.data.uploadPrivateImageFile.__typename)
@@ -1310,7 +1311,7 @@ class At {
1310
1311
  } : t;
1311
1312
  }
1312
1313
  }
1313
- class St {
1314
+ class At {
1314
1315
  constructor(e) {
1315
1316
  c(this, "client");
1316
1317
  this.client = e;
@@ -1328,7 +1329,7 @@ class St {
1328
1329
  }
1329
1330
  async withdrawalRecords(e) {
1330
1331
  const t = await this.client.request(
1331
- Oe,
1332
+ Ue,
1332
1333
  e
1333
1334
  );
1334
1335
  return t.ok ? { ok: t.ok, data: t.data.member.withdrawalRecords } : t;
@@ -1345,7 +1346,7 @@ class St {
1345
1346
  return e.ok ? { ok: e.ok, data: e.data.member.depositsCount } : e;
1346
1347
  }
1347
1348
  async member() {
1348
- const e = await this.client.request(ot);
1349
+ const e = await this.client.request(nt);
1349
1350
  return e.ok ? { ok: e.ok, data: e.data.member } : e;
1350
1351
  }
1351
1352
  }
@@ -1402,12 +1403,12 @@ class be {
1402
1403
  return e.ok ? { ok: e.ok, data: e.data.bonus } : e;
1403
1404
  }
1404
1405
  async wallet() {
1405
- const e = await this.client.request(Ne);
1406
+ const e = await this.client.request(Ie);
1406
1407
  return e.ok ? { ok: e.ok, data: e.data.wallet } : e;
1407
1408
  }
1408
1409
  async deposit(e) {
1409
1410
  const t = await this.client.request(
1410
- He,
1411
+ je,
1411
1412
  e
1412
1413
  );
1413
1414
  return t.ok ? { ok: t.ok, data: t.data.node } : t;
@@ -1422,7 +1423,7 @@ class be {
1422
1423
  } : t;
1423
1424
  }
1424
1425
  async createMayaDeposit(e) {
1425
- const t = await this.client.request(je, e);
1426
+ const t = await this.client.request(He, e);
1426
1427
  return t.ok ? t.data.createMayaDeposit ? {
1427
1428
  ok: !1,
1428
1429
  error: d(t.data.createMayaDeposit.__typename)
@@ -1449,7 +1450,7 @@ class be {
1449
1450
  } : t;
1450
1451
  }
1451
1452
  async createMayaWithdrawal(e) {
1452
- const t = await this.client.request(qe, e);
1453
+ const t = await this.client.request(Be, e);
1453
1454
  return t.ok ? t.data.createMayaWithdrawal ? {
1454
1455
  ok: !1,
1455
1456
  error: d(t.data.createMayaWithdrawal.__typename)
@@ -1458,7 +1459,7 @@ class be {
1458
1459
  } : t;
1459
1460
  }
1460
1461
  async createMayaAppWithdrawal(e) {
1461
- const t = await this.client.request(Be, e);
1462
+ const t = await this.client.request(qe, e);
1462
1463
  return t.ok ? t.data.createMayaAppWithdrawal ? {
1463
1464
  ok: !1,
1464
1465
  error: d(t.data.createMayaAppWithdrawal.__typename)
@@ -1482,11 +1483,11 @@ class be {
1482
1483
  return e.ok ? { ok: e.ok, data: e.data.remainingDailyWithdrawalsCount } : e;
1483
1484
  }
1484
1485
  async pointsWallet() {
1485
- const e = await this.client.request(De);
1486
+ const e = await this.client.request(Me);
1486
1487
  return e.ok ? { ok: e.ok, data: e.data.pointsWallet } : e;
1487
1488
  }
1488
1489
  async pointsToCashConversion(e) {
1489
- const t = await this.client.request(ve, e);
1490
+ const t = await this.client.request(De, e);
1490
1491
  return t.ok ? t.data.pointsToCashConversion ? {
1491
1492
  ok: !1,
1492
1493
  error: d(t.data.pointsToCashConversion.__typename)
@@ -1501,10 +1502,12 @@ class be {
1501
1502
  );
1502
1503
  return t.ok ? { ok: t.ok, data: t.data.mayaSession } : t;
1503
1504
  }
1505
+ /** @deprecated */
1504
1506
  async games(e) {
1505
1507
  const t = await this.client.request(ge, e);
1506
1508
  return t.ok ? { ok: t.ok, data: t.data.games } : t;
1507
1509
  }
1510
+ /** @deprecated */
1508
1511
  async gamesByName(e) {
1509
1512
  const t = await this.client.request(
1510
1513
  Ee,
@@ -1520,7 +1523,7 @@ class be {
1520
1523
  return t.ok ? { ok: !0, data: t.data.node } : t;
1521
1524
  }
1522
1525
  async createGameSession(e) {
1523
- const t = await this.client.request(Ae, e);
1526
+ const t = await this.client.request(Se, e);
1524
1527
  return t.ok ? t.data.createGameSession ? {
1525
1528
  ok: !1,
1526
1529
  error: d(t.data.createGameSession.__typename)
@@ -1544,77 +1547,53 @@ class be {
1544
1547
  } : t;
1545
1548
  }
1546
1549
  }
1547
- class kt {
1550
+ class _t {
1548
1551
  constructor(e) {
1549
1552
  c(this, "url");
1550
1553
  c(this, "siteId");
1551
1554
  c(this, "platformId");
1552
1555
  this.url = e.url, this.siteId = e.site, this.platformId = e.platform;
1553
1556
  }
1554
- async siteInfo() {
1555
- const e = new Request(`${this.url}/sites/${this.siteId}`, {
1556
- method: "GET",
1557
- headers: {
1558
- Accept: "application/json",
1559
- "Content-Type": "application/json",
1560
- "Platform-ID": this.platformId
1561
- }
1562
- });
1563
- try {
1564
- const t = await fetch(e);
1565
- if (!t.ok) return { ok: !1, error: u(t.status) };
1566
- const { data: a } = await t.json();
1567
- return {
1568
- ok: !0,
1569
- data: a
1570
- };
1571
- } catch {
1572
- return {
1573
- ok: !1,
1574
- error: u(500)
1575
- };
1576
- }
1557
+ async self() {
1558
+ const e = await this.getJson(`/sites/${this.siteId}`);
1559
+ return e.ok ? {
1560
+ ok: !0,
1561
+ data: e.data.data
1562
+ } : e;
1577
1563
  }
1578
1564
  async games(e) {
1579
- var r, s, m, l, f, p, y, h, _, T, C, I, M, N, D, v, R, P, G, x, U, O, $, q, B, W;
1565
+ var r, s, m, u, l, p, y, f, b, _, k, T, C, N, v, I, M, D, R, P, x, G, O, U, $, B;
1580
1566
  const t = new URLSearchParams();
1581
- e != null && e.first && t.set("first", e.first.toString()), e != null && e.after && t.set("after", e.after), (s = (r = e == null ? void 0 : e.filter) == null ? void 0 : r.name) != null && s.equal && t.set("filter[name][eq]", e.filter.name.equal), (l = (m = e == null ? void 0 : e.filter) == null ? void 0 : m.name) != null && l.notEqual && t.set("filter[name][neq]", e.filter.name.notEqual), (p = (f = e == null ? void 0 : e.filter) == null ? void 0 : f.name) != null && p.in && t.set("filter[name][in]", e.filter.name.in.join(",")), (h = (y = e == null ? void 0 : e.filter) == null ? void 0 : y.name) != null && h.notIn && t.set("filter[name][nin]", e.filter.name.notIn.join(",")), (T = (_ = e == null ? void 0 : e.filter) == null ? void 0 : _.name) != null && T.contains && t.set("filter[name][contains]", e.filter.name.contains), (I = (C = e == null ? void 0 : e.filter) == null ? void 0 : C.type) != null && I.equal && t.set("filter[type][eq]", e.filter.type.equal), (N = (M = e == null ? void 0 : e.filter) == null ? void 0 : M.type) != null && N.notEqual && t.set("filter[type][neq]", e.filter.type.notEqual), (v = (D = e == null ? void 0 : e.filter) == null ? void 0 : D.type) != null && v.in && t.set("filter[type][in]", e.filter.type.in.join(",")), (P = (R = e == null ? void 0 : e.filter) == null ? void 0 : R.type) != null && P.notIn && t.set("filter[type][nin]", e.filter.type.notIn.join(",")), (x = (G = e == null ? void 0 : e.filter) == null ? void 0 : G.provider) != null && x.equal && t.set("filter[provider][eq]", e.filter.provider.equal), (O = (U = e == null ? void 0 : e.filter) == null ? void 0 : U.provider) != null && O.notEqual && t.set("filter[provider][neq]", e.filter.provider.notEqual), (q = ($ = e == null ? void 0 : e.filter) == null ? void 0 : $.provider) != null && q.in && t.set("filter[provider][in]", e.filter.provider.in.join(",")), (W = (B = e == null ? void 0 : e.filter) == null ? void 0 : B.provider) != null && W.notIn && t.set("filter[provider][nin]", e.filter.provider.notIn.join(","));
1582
- const a = new Request(`${this.url}/games?${t.toString()}`, {
1583
- method: "GET",
1584
- headers: {
1585
- Accept: "application/json",
1586
- "Content-Type": "application/json",
1587
- "Site-ID": this.siteId,
1588
- "Platform-ID": this.platformId
1589
- }
1590
- });
1591
- try {
1592
- const k = await fetch(a);
1593
- if (!k.ok) return { ok: !1, error: u(k.status) };
1594
- const E = await k.json();
1595
- return {
1596
- ok: !0,
1597
- data: {
1598
- edges: E.data.map((L) => ({
1599
- node: L,
1600
- cursor: L.cursor
1601
- })),
1602
- pageInfo: {
1603
- hasNextPage: !!E.next,
1604
- endCursor: E.next
1605
- },
1606
- totalCount: E.totalCount
1567
+ e != null && e.first && t.set("first", e.first.toString()), e != null && e.after && t.set("after", e.after), (s = (r = e == null ? void 0 : e.filter) == null ? void 0 : r.name) != null && s.equal && t.set("filter[name][eq]", e.filter.name.equal), (u = (m = e == null ? void 0 : e.filter) == null ? void 0 : m.name) != null && u.notEqual && t.set("filter[name][neq]", e.filter.name.notEqual), (p = (l = e == null ? void 0 : e.filter) == null ? void 0 : l.name) != null && p.in && t.set("filter[name][in]", e.filter.name.in.join(",")), (f = (y = e == null ? void 0 : e.filter) == null ? void 0 : y.name) != null && f.notIn && t.set("filter[name][nin]", e.filter.name.notIn.join(",")), (_ = (b = e == null ? void 0 : e.filter) == null ? void 0 : b.name) != null && _.contains && t.set("filter[name][contains]", e.filter.name.contains), (T = (k = e == null ? void 0 : e.filter) == null ? void 0 : k.type) != null && T.equal && t.set("filter[type][eq]", e.filter.type.equal), (N = (C = e == null ? void 0 : e.filter) == null ? void 0 : C.type) != null && N.notEqual && t.set("filter[type][neq]", e.filter.type.notEqual), (I = (v = e == null ? void 0 : e.filter) == null ? void 0 : v.type) != null && I.in && t.set("filter[type][in]", e.filter.type.in.join(",")), (D = (M = e == null ? void 0 : e.filter) == null ? void 0 : M.type) != null && D.notIn && t.set("filter[type][nin]", e.filter.type.notIn.join(",")), (P = (R = e == null ? void 0 : e.filter) == null ? void 0 : R.provider) != null && P.equal && t.set("filter[provider][eq]", e.filter.provider.equal), (G = (x = e == null ? void 0 : e.filter) == null ? void 0 : x.provider) != null && G.notEqual && t.set("filter[provider][neq]", e.filter.provider.notEqual), (U = (O = e == null ? void 0 : e.filter) == null ? void 0 : O.provider) != null && U.in && t.set("filter[provider][in]", e.filter.provider.in.join(",")), (B = ($ = e == null ? void 0 : e.filter) == null ? void 0 : $.provider) != null && B.notIn && t.set("filter[provider][nin]", e.filter.provider.notIn.join(","));
1568
+ const a = await this.getJson("/games", t);
1569
+ return a.ok ? {
1570
+ ok: !0,
1571
+ data: {
1572
+ edges: a.data.data.map((q) => ({
1573
+ node: q,
1574
+ cursor: q.cursor
1575
+ })),
1576
+ totalCount: a.data.totalCount,
1577
+ pageInfo: {
1578
+ hasNextPage: !!a.data.next,
1579
+ endCursor: a.data.next
1607
1580
  }
1608
- };
1609
- } catch {
1610
- return {
1611
- ok: !1,
1612
- error: u(500)
1613
- };
1614
- }
1581
+ }
1582
+ } : a;
1615
1583
  }
1616
1584
  async game(e) {
1617
- const t = new Request(`${this.url}/games/${e}`, {
1585
+ var a;
1586
+ const t = await this.getJson(`/games/${e}`);
1587
+ return ((a = t.error) == null ? void 0 : a.name) === "HttpNotFound" ? {
1588
+ ok: !0,
1589
+ data: null
1590
+ } : t.ok ? {
1591
+ ok: !0,
1592
+ data: t.data.data
1593
+ } : t;
1594
+ }
1595
+ async getJson(e, t) {
1596
+ const a = new Request(`${this.url}${e}?${(t == null ? void 0 : t.toString()) ?? ""}`, {
1618
1597
  method: "GET",
1619
1598
  headers: {
1620
1599
  Accept: "application/json",
@@ -1624,35 +1603,33 @@ class kt {
1624
1603
  }
1625
1604
  });
1626
1605
  try {
1627
- const a = await fetch(t);
1628
- if (a.status === 404)
1629
- return {
1630
- ok: !0,
1631
- data: null
1632
- };
1633
- if (!a.ok) return { ok: !1, error: u(a.status) };
1634
- const { data: r } = await a.json();
1635
- return {
1606
+ const r = await fetch(a);
1607
+ return r.ok ? {
1636
1608
  ok: !0,
1637
- data: r
1609
+ data: await r.json()
1610
+ } : {
1611
+ ok: !1,
1612
+ error: h(r.status)
1638
1613
  };
1639
1614
  } catch {
1640
1615
  return {
1641
1616
  ok: !1,
1642
- error: u(500)
1617
+ error: h(500)
1643
1618
  };
1644
1619
  }
1645
1620
  }
1646
1621
  }
1647
- class _t {
1622
+ class kt {
1648
1623
  constructor(e) {
1649
1624
  c(this, "client");
1650
1625
  this.client = e;
1651
1626
  }
1627
+ /** @deprecated */
1652
1628
  async games(e) {
1653
1629
  const t = await this.client.request(ge, e);
1654
1630
  return t.ok ? { ok: t.ok, data: t.data.games } : t;
1655
1631
  }
1632
+ /** @deprecated */
1656
1633
  async gamesByName(e) {
1657
1634
  const t = await this.client.request(
1658
1635
  Ee,
@@ -1662,13 +1639,13 @@ class _t {
1662
1639
  }
1663
1640
  async gameSession(e) {
1664
1641
  const t = await this.client.request(
1665
- Ge,
1642
+ xe,
1666
1643
  e
1667
1644
  );
1668
1645
  return t.ok ? { ok: !0, data: t.data.node } : t;
1669
1646
  }
1670
1647
  async createGameSession(e) {
1671
- const t = await this.client.request(Ae, e);
1648
+ const t = await this.client.request(Se, e);
1672
1649
  return t.ok ? t.data.createGameSession ? {
1673
1650
  ok: !1,
1674
1651
  error: d(t.data.createGameSession.__typename)
@@ -1677,7 +1654,7 @@ class _t {
1677
1654
  } : t;
1678
1655
  }
1679
1656
  async endGameSession(e) {
1680
- const t = await this.client.request(xe, e);
1657
+ const t = await this.client.request(Ge, e);
1681
1658
  return t.ok ? t.data.endGameSession ? {
1682
1659
  ok: !1,
1683
1660
  error: d(t.data.endGameSession.__typename)
@@ -1699,29 +1676,29 @@ class Tt {
1699
1676
  } : e;
1700
1677
  }
1701
1678
  }
1702
- function Ct(o, e, t) {
1703
- return o < e ? e : o > t ? t : o;
1679
+ function Ct(n, e, t) {
1680
+ return n < e ? e : n > t ? t : n;
1704
1681
  }
1705
- function K(o) {
1706
- return Object.prototype.toString.call(o) === "[object Object]" && Object(o) === o;
1682
+ function j(n) {
1683
+ return Object.prototype.toString.call(n) === "[object Object]" && Object(n) === n;
1707
1684
  }
1708
- function It(o) {
1685
+ function Nt(n) {
1709
1686
  const e = [];
1710
1687
  function t(a, r = []) {
1711
1688
  for (const s in a) {
1712
1689
  const m = a[s];
1713
- K(m) ? t(m, [...r, s]) : Array.isArray(m) ? t(Mt(m), [...r, s]) : e.push({
1690
+ j(m) ? t(m, [...r, s]) : Array.isArray(m) ? t(vt(m), [...r, s]) : e.push({
1714
1691
  key: [...r, s],
1715
1692
  value: m
1716
1693
  });
1717
1694
  }
1718
1695
  }
1719
- return t(o), e;
1696
+ return t(n), e;
1720
1697
  }
1721
- function Mt(o) {
1722
- return o.reduce((e, t, a) => (e[a] = t, e), {});
1698
+ function vt(n) {
1699
+ return n.reduce((e, t, a) => (e[a] = t, e), {});
1723
1700
  }
1724
- class b {
1701
+ class A {
1725
1702
  constructor(e, t) {
1726
1703
  c(this, "url");
1727
1704
  c(this, "options");
@@ -1758,15 +1735,15 @@ class b {
1758
1735
  return await this.exec(s);
1759
1736
  }
1760
1737
  async exec(e) {
1761
- var t, a, r, s, m, l;
1738
+ var t, a, r, s, m, u;
1762
1739
  try {
1763
- const f = await fetch(e);
1764
- if (!f.ok)
1765
- return { ok: !1, error: u(f.status) };
1766
- const p = await f.json(), y = p.data, h = (t = p.errors) == null ? void 0 : t.at(0);
1767
- return h ? ((a = h.extensions) == null ? void 0 : a.code) === "FORBIDDEN" || ((r = h.extensions) == null ? void 0 : r.code) === "ACCESS_TOKEN_EXPIRED" ? { ok: !1, error: u(403, h.message) } : ((s = h.extensions) == null ? void 0 : s.code) === "UNAUTHORIZED" ? { ok: !1, error: u(401, h.message) } : ((m = h.extensions) == null ? void 0 : m.code) === "BAD_USER_INPUT" || ((l = h.extensions) == null ? void 0 : l.code) === "BAD_REQUEST" ? { ok: !1, error: u(400, h.message) } : {
1740
+ const l = await fetch(e);
1741
+ if (!l.ok)
1742
+ return { ok: !1, error: h(l.status) };
1743
+ const p = await l.json(), y = p.data, f = (t = p.errors) == null ? void 0 : t.at(0);
1744
+ return f ? ((a = f.extensions) == null ? void 0 : a.code) === "FORBIDDEN" || ((r = f.extensions) == null ? void 0 : r.code) === "ACCESS_TOKEN_EXPIRED" ? { ok: !1, error: h(403, f.message) } : ((s = f.extensions) == null ? void 0 : s.code) === "UNAUTHORIZED" ? { ok: !1, error: h(401, f.message) } : ((m = f.extensions) == null ? void 0 : m.code) === "BAD_USER_INPUT" || ((u = f.extensions) == null ? void 0 : u.code) === "BAD_REQUEST" ? { ok: !1, error: h(400, f.message) } : {
1768
1745
  ok: !1,
1769
- error: u(500, h.message)
1746
+ error: h(500, f.message)
1770
1747
  } : {
1771
1748
  ok: !0,
1772
1749
  data: y
@@ -1774,7 +1751,7 @@ class b {
1774
1751
  } catch {
1775
1752
  return {
1776
1753
  ok: !1,
1777
- error: u(500)
1754
+ error: h(500)
1778
1755
  };
1779
1756
  }
1780
1757
  }
@@ -1785,7 +1762,7 @@ class b {
1785
1762
  return t;
1786
1763
  }
1787
1764
  createUploadBody(e, t) {
1788
- const a = It(t).filter(
1765
+ const a = Nt(t).filter(
1789
1766
  (m) => m.value instanceof File || m.value instanceof Blob
1790
1767
  ), r = new FormData();
1791
1768
  r.append(
@@ -1796,18 +1773,18 @@ class b {
1796
1773
  })
1797
1774
  );
1798
1775
  const s = {};
1799
- return a.forEach((m, l) => {
1800
- s[l.toString()] = [`variables.${m.key.join(".")}`];
1801
- }), r.append("map", JSON.stringify(s)), a.forEach((m, l) => {
1802
- r.append(l.toString(), m.value);
1776
+ return a.forEach((m, u) => {
1777
+ s[u.toString()] = [`variables.${m.key.join(".")}`];
1778
+ }), r.append("map", JSON.stringify(s)), a.forEach((m, u) => {
1779
+ r.append(u.toString(), m.value);
1803
1780
  }), r;
1804
1781
  }
1805
1782
  }
1806
- async function g(o) {
1807
- const e = new TextEncoder().encode(o), t = await crypto.subtle.digest("SHA-256", e);
1783
+ async function g(n) {
1784
+ const e = new TextEncoder().encode(n), t = await crypto.subtle.digest("SHA-256", e);
1808
1785
  return Array.from(new Uint8Array(t)).map((s) => s.toString(16).padStart(2, "0")).join("");
1809
1786
  }
1810
- class ke {
1787
+ class _e {
1811
1788
  constructor(e) {
1812
1789
  c(this, "enabled");
1813
1790
  this.enabled = (e == null ? void 0 : e.enabled) ?? !0;
@@ -1825,43 +1802,43 @@ class ke {
1825
1802
  this.enabled && console.log(`\x1B[32m[success] ${e}`);
1826
1803
  }
1827
1804
  }
1828
- function J(o) {
1829
- return new Date(o.getTime());
1805
+ function K(n) {
1806
+ return new Date(n.getTime());
1830
1807
  }
1831
- function F(o, e) {
1832
- const t = J(o);
1808
+ function W(n, e) {
1809
+ const t = K(n);
1833
1810
  return t.setDate(t.getDate() + e), t;
1834
1811
  }
1835
- function V(o, e) {
1836
- const t = J(o);
1812
+ function L(n, e) {
1813
+ const t = K(n);
1837
1814
  return t.setMinutes(t.getMinutes() + e), t;
1838
1815
  }
1839
- function we(o, e) {
1840
- return o.getTime() > e.getTime();
1816
+ function we(n, e) {
1817
+ return n.getTime() > e.getTime();
1841
1818
  }
1842
- function _e(o) {
1819
+ function ke(n) {
1843
1820
  return new Promise((e) => {
1844
- setTimeout(e, o);
1821
+ setTimeout(e, n);
1845
1822
  });
1846
1823
  }
1847
- function ye(o, e) {
1824
+ function ye(n, e) {
1848
1825
  const {
1849
1826
  until: t,
1850
1827
  interval: a = 1e3,
1851
1828
  maxAttempt: r = 3
1852
1829
  /**/
1853
1830
  } = e;
1854
- async function s(m, l) {
1855
- const f = l ?? r, p = await o(...m);
1856
- return t(p) ? p : f > 1 ? (await _e(a * ((r - f) / 2)), s(m, f - 1)) : p;
1831
+ async function s(m, u) {
1832
+ const l = u ?? r, p = await n(...m);
1833
+ return t(p) ? p : l > 1 ? (await ke(a * ((r - l) / 2)), s(m, l - 1)) : p;
1857
1834
  }
1858
1835
  return async (...m) => await s(m);
1859
1836
  }
1860
- function j(o, e) {
1861
- const t = J(o);
1837
+ function F(n, e) {
1838
+ const t = K(n);
1862
1839
  return t.setMinutes(t.getMinutes() - e), t;
1863
1840
  }
1864
- class Nt {
1841
+ class It {
1865
1842
  constructor(e) {
1866
1843
  c(this, "logger");
1867
1844
  c(this, "storageKey", "session");
@@ -1872,12 +1849,12 @@ class Nt {
1872
1849
  url: e.authUrl,
1873
1850
  platform: e.platform
1874
1851
  }), this.walletService = new be(
1875
- new b(e.walletUrl, {
1852
+ new A(e.walletUrl, {
1876
1853
  middlewares: [
1877
1854
  (t) => (t.headers.set("Platform", e.platform), t.headers.set("Role", "MEMBER"), t)
1878
1855
  ]
1879
1856
  })
1880
- ), this.logger = new ke({
1857
+ ), this.logger = new _e({
1881
1858
  enabled: e.log ?? !1
1882
1859
  });
1883
1860
  }
@@ -1906,19 +1883,19 @@ class Nt {
1906
1883
  maxAttempt: 5
1907
1884
  })();
1908
1885
  if (!s.ok) return s;
1909
- const l = await ye(() => this.authService.createSession(e), {
1886
+ const u = await ye(() => this.authService.createSession(e), {
1910
1887
  until: (p) => p.ok,
1911
1888
  interval: 1e3,
1912
1889
  maxAttempt: 5
1913
1890
  })();
1914
- if (!l.ok) return l;
1915
- const f = /* @__PURE__ */ new Date();
1891
+ if (!u.ok) return u;
1892
+ const l = /* @__PURE__ */ new Date();
1916
1893
  return window.localStorage.setItem(
1917
1894
  this.storageKey,
1918
1895
  JSON.stringify({
1919
- ...l.data,
1920
- accessTokenExpiresAt: V(f, 8).getTime(),
1921
- refreshTokenExpiresAt: j(F(f, 30), 2).getTime()
1896
+ ...u.data,
1897
+ accessTokenExpiresAt: L(l, 8).getTime(),
1898
+ refreshTokenExpiresAt: F(W(l, 30), 2).getTime()
1922
1899
  })
1923
1900
  ), {
1924
1901
  ok: !0,
@@ -1933,8 +1910,8 @@ class Nt {
1933
1910
  this.storageKey,
1934
1911
  JSON.stringify({
1935
1912
  ...r.data,
1936
- accessTokenExpiresAt: V(s, 8).getTime(),
1937
- refreshTokenExpiresAt: j(F(s, 30), 2).getTime()
1913
+ accessTokenExpiresAt: L(s, 8).getTime(),
1914
+ refreshTokenExpiresAt: F(W(s, 30), 2).getTime()
1938
1915
  })
1939
1916
  ), {
1940
1917
  ok: !0,
@@ -1957,8 +1934,8 @@ class Nt {
1957
1934
  this.storageKey,
1958
1935
  JSON.stringify({
1959
1936
  ...t.data,
1960
- accessTokenExpiresAt: V(a, 8).getTime(),
1961
- refreshTokenExpiresAt: j(F(a, 30), 2).getTime()
1937
+ accessTokenExpiresAt: L(a, 8).getTime(),
1938
+ refreshTokenExpiresAt: F(W(a, 30), 2).getTime()
1962
1939
  })
1963
1940
  ), {
1964
1941
  ok: !0,
@@ -1973,8 +1950,8 @@ class Nt {
1973
1950
  this.storageKey,
1974
1951
  JSON.stringify({
1975
1952
  ...t.data,
1976
- accessTokenExpiresAt: V(a, 8).getTime(),
1977
- refreshTokenExpiresAt: j(F(a, 30), 2).getTime()
1953
+ accessTokenExpiresAt: L(a, 8).getTime(),
1954
+ refreshTokenExpiresAt: F(W(a, 30), 2).getTime()
1978
1955
  })
1979
1956
  ), { ok: !0 };
1980
1957
  } else
@@ -1987,7 +1964,7 @@ class Nt {
1987
1964
  data: null
1988
1965
  };
1989
1966
  if (this.refreshing)
1990
- return await _e(1e3), await this.get();
1967
+ return await ke(1e3), await this.get();
1991
1968
  const e = window.localStorage.getItem(this.storageKey);
1992
1969
  if (!e)
1993
1970
  return {
@@ -2019,8 +1996,8 @@ class Nt {
2019
1996
  this.logger.success("Session refreshed!"), a = /* @__PURE__ */ new Date(), t = {
2020
1997
  ...t,
2021
1998
  ...m.data,
2022
- accessTokenExpiresAt: V(a, 8).getTime(),
2023
- refreshTokenExpiresAt: j(F(a, 30), 2).getTime()
1999
+ accessTokenExpiresAt: L(a, 8).getTime(),
2000
+ refreshTokenExpiresAt: F(W(a, 30), 2).getTime()
2024
2001
  }, window.localStorage.setItem(this.storageKey, JSON.stringify(t));
2025
2002
  }
2026
2003
  return {
@@ -2060,17 +2037,17 @@ class Nt {
2060
2037
  return typeof window > "u";
2061
2038
  }
2062
2039
  }
2063
- function w(o) {
2040
+ function w(n) {
2064
2041
  const e = {};
2065
- for (const t in o) {
2066
- const a = o[t];
2042
+ for (const t in n) {
2043
+ const a = n[t];
2067
2044
  if (a !== null && a !== void 0) {
2068
- if (K(a)) {
2045
+ if (j(a)) {
2069
2046
  e[t] = w(a);
2070
2047
  continue;
2071
2048
  }
2072
2049
  if (Array.isArray(a)) {
2073
- e[t] = a.map((r) => K(r) ? w(r) : r);
2050
+ e[t] = a.map((r) => j(r) ? w(r) : r);
2074
2051
  continue;
2075
2052
  }
2076
2053
  e[t] = a;
@@ -2078,17 +2055,17 @@ function w(o) {
2078
2055
  }
2079
2056
  return e;
2080
2057
  }
2081
- function i(o, e) {
2082
- if (typeof o == "number" && !Number.isNaN(o))
2083
- return o;
2084
- if (typeof o == "string") {
2085
- const t = Number.parseFloat(o);
2058
+ function i(n, e) {
2059
+ if (typeof n == "number" && !Number.isNaN(n))
2060
+ return n;
2061
+ if (typeof n == "string") {
2062
+ const t = Number.parseFloat(n);
2086
2063
  if (!Number.isNaN(t))
2087
2064
  return t;
2088
2065
  }
2089
2066
  return e;
2090
2067
  }
2091
- class Dt {
2068
+ class Mt {
2092
2069
  constructor(e) {
2093
2070
  c(this, "staticService");
2094
2071
  const t = (e == null ? void 0 : e.environment) === "development";
@@ -2111,7 +2088,9 @@ class Dt {
2111
2088
  betRecord: this.betRecord.bind(this),
2112
2089
  latestBetRecord: this.latestBetRecord.bind(this),
2113
2090
  transactionRecord: this.transactionRecord.bind(this),
2091
+ /** @deprecated */
2114
2092
  game: this.game.bind(this),
2093
+ game__next: this.game__next.bind(this),
2115
2094
  gameSession: this.gameSession.bind(this),
2116
2095
  promo: this.promo.bind(this),
2117
2096
  cashback: this.cashback.bind(this),
@@ -2130,7 +2109,7 @@ class Dt {
2130
2109
  return w(t);
2131
2110
  }
2132
2111
  platform(e) {
2133
- var t, a, r, s, m, l, f, p, y, h, _, T, C, I, M, N, D, v, R, P, G, x, U, O, $, q, B, W, k, E, L, X, Z, ee, te, ae, re, oe, ne, ie, se, me, ce, de, ue, le, pe, fe, he;
2112
+ var t, a, r, s, m, u, l, p, y, f, b, _, k, T, C, N, v, I, M, D, R, P, x, G, O, U, $, B, q, z, J, X, Z, ee, te, ae, re, ne, oe, ie, se, me, ce, de, ue, le, pe, fe, he;
2134
2113
  return {
2135
2114
  paymentSettings: {
2136
2115
  minimumFirstDepositAmount: i(e.minimumFirstDepositAmount),
@@ -2142,44 +2121,44 @@ class Dt {
2142
2121
  webEnabled: ((r = e.bankDepositGatewaySettings) == null ? void 0 : r.webEnabled) ?? !1,
2143
2122
  mobileWebEnabled: ((s = e.bankDepositGatewaySettings) == null ? void 0 : s.mobileWebEnabled) ?? !1,
2144
2123
  minimumAmount: i((m = e.bankDepositGatewaySettings) == null ? void 0 : m.minimumAmount),
2145
- maximumAmount: i((l = e.bankDepositGatewaySettings) == null ? void 0 : l.maximumAmount)
2124
+ maximumAmount: i((u = e.bankDepositGatewaySettings) == null ? void 0 : u.maximumAmount)
2146
2125
  },
2147
2126
  gcash: {
2148
- androidEnabled: ((f = e.gcashDepositGatewaySettings) == null ? void 0 : f.androidEnabled) ?? !1,
2127
+ androidEnabled: ((l = e.gcashDepositGatewaySettings) == null ? void 0 : l.androidEnabled) ?? !1,
2149
2128
  iosEnabled: ((p = e.gcashDepositGatewaySettings) == null ? void 0 : p.iosEnabled) ?? !1,
2150
2129
  webEnabled: ((y = e.gcashDepositGatewaySettings) == null ? void 0 : y.webEnabled) ?? !1,
2151
- mobileWebEnabled: ((h = e.gcashDepositGatewaySettings) == null ? void 0 : h.mobileWebEnabled) ?? !1,
2152
- minimumAmount: i((_ = e.gcashDepositGatewaySettings) == null ? void 0 : _.minimumAmount),
2153
- maximumAmount: i((T = e.gcashDepositGatewaySettings) == null ? void 0 : T.maximumAmount)
2130
+ mobileWebEnabled: ((f = e.gcashDepositGatewaySettings) == null ? void 0 : f.mobileWebEnabled) ?? !1,
2131
+ minimumAmount: i((b = e.gcashDepositGatewaySettings) == null ? void 0 : b.minimumAmount),
2132
+ maximumAmount: i((_ = e.gcashDepositGatewaySettings) == null ? void 0 : _.maximumAmount)
2154
2133
  },
2155
2134
  maya: {
2156
- androidEnabled: ((C = e.mayaDepositGatewaySettings) == null ? void 0 : C.androidEnabled) ?? !1,
2157
- iosEnabled: ((I = e.mayaDepositGatewaySettings) == null ? void 0 : I.iosEnabled) ?? !1,
2158
- webEnabled: ((M = e.mayaDepositGatewaySettings) == null ? void 0 : M.webEnabled) ?? !1,
2135
+ androidEnabled: ((k = e.mayaDepositGatewaySettings) == null ? void 0 : k.androidEnabled) ?? !1,
2136
+ iosEnabled: ((T = e.mayaDepositGatewaySettings) == null ? void 0 : T.iosEnabled) ?? !1,
2137
+ webEnabled: ((C = e.mayaDepositGatewaySettings) == null ? void 0 : C.webEnabled) ?? !1,
2159
2138
  mobileWebEnabled: ((N = e.mayaDepositGatewaySettings) == null ? void 0 : N.mobileWebEnabled) ?? !1,
2160
- minimumAmount: i((D = e.mayaDepositGatewaySettings) == null ? void 0 : D.minimumAmount),
2161
- maximumAmount: i((v = e.mayaDepositGatewaySettings) == null ? void 0 : v.maximumAmount)
2139
+ minimumAmount: i((v = e.mayaDepositGatewaySettings) == null ? void 0 : v.minimumAmount),
2140
+ maximumAmount: i((I = e.mayaDepositGatewaySettings) == null ? void 0 : I.maximumAmount)
2162
2141
  },
2163
2142
  mayaApp: {
2164
- androidEnabled: ((R = e.mayaAppDepositGatewaySettings) == null ? void 0 : R.androidEnabled) ?? !1,
2165
- iosEnabled: ((P = e.mayaAppDepositGatewaySettings) == null ? void 0 : P.iosEnabled) ?? !1,
2166
- webEnabled: ((G = e.mayaAppDepositGatewaySettings) == null ? void 0 : G.webEnabled) ?? !1,
2167
- mobileWebEnabled: ((x = e.mayaAppDepositGatewaySettings) == null ? void 0 : x.mobileWebEnabled) ?? !1,
2168
- minimumAmount: i((U = e.mayaAppDepositGatewaySettings) == null ? void 0 : U.minimumAmount),
2169
- maximumAmount: i((O = e.mayaAppDepositGatewaySettings) == null ? void 0 : O.maximumAmount)
2143
+ androidEnabled: ((M = e.mayaAppDepositGatewaySettings) == null ? void 0 : M.androidEnabled) ?? !1,
2144
+ iosEnabled: ((D = e.mayaAppDepositGatewaySettings) == null ? void 0 : D.iosEnabled) ?? !1,
2145
+ webEnabled: ((R = e.mayaAppDepositGatewaySettings) == null ? void 0 : R.webEnabled) ?? !1,
2146
+ mobileWebEnabled: ((P = e.mayaAppDepositGatewaySettings) == null ? void 0 : P.mobileWebEnabled) ?? !1,
2147
+ minimumAmount: i((x = e.mayaAppDepositGatewaySettings) == null ? void 0 : x.minimumAmount),
2148
+ maximumAmount: i((G = e.mayaAppDepositGatewaySettings) == null ? void 0 : G.maximumAmount)
2170
2149
  }
2171
2150
  },
2172
2151
  withdrawalGateway: {
2173
2152
  bank: {
2174
- androidEnabled: (($ = e.bankWithdrawalGatewaySettings) == null ? void 0 : $.androidEnabled) ?? !1,
2175
- iosEnabled: ((q = e.bankWithdrawalGatewaySettings) == null ? void 0 : q.iosEnabled) ?? !1,
2176
- webEnabled: ((B = e.bankWithdrawalGatewaySettings) == null ? void 0 : B.webEnabled) ?? !1,
2177
- mobileWebEnabled: ((W = e.bankWithdrawalGatewaySettings) == null ? void 0 : W.mobileWebEnabled) ?? !1,
2178
- minimumAmount: i((k = e.bankWithdrawalGatewaySettings) == null ? void 0 : k.minimumAmount),
2179
- maximumAmount: i((E = e.bankWithdrawalGatewaySettings) == null ? void 0 : E.maximumAmount)
2153
+ androidEnabled: ((O = e.bankWithdrawalGatewaySettings) == null ? void 0 : O.androidEnabled) ?? !1,
2154
+ iosEnabled: ((U = e.bankWithdrawalGatewaySettings) == null ? void 0 : U.iosEnabled) ?? !1,
2155
+ webEnabled: (($ = e.bankWithdrawalGatewaySettings) == null ? void 0 : $.webEnabled) ?? !1,
2156
+ mobileWebEnabled: ((B = e.bankWithdrawalGatewaySettings) == null ? void 0 : B.mobileWebEnabled) ?? !1,
2157
+ minimumAmount: i((q = e.bankWithdrawalGatewaySettings) == null ? void 0 : q.minimumAmount),
2158
+ maximumAmount: i((z = e.bankWithdrawalGatewaySettings) == null ? void 0 : z.maximumAmount)
2180
2159
  },
2181
2160
  gcash: {
2182
- androidEnabled: ((L = e.gcashWithdrawalGatewaySettings) == null ? void 0 : L.androidEnabled) ?? !1,
2161
+ androidEnabled: ((J = e.gcashWithdrawalGatewaySettings) == null ? void 0 : J.androidEnabled) ?? !1,
2183
2162
  iosEnabled: ((X = e.gcashWithdrawalGatewaySettings) == null ? void 0 : X.iosEnabled) ?? !1,
2184
2163
  webEnabled: ((Z = e.gcashWithdrawalGatewaySettings) == null ? void 0 : Z.webEnabled) ?? !1,
2185
2164
  mobileWebEnabled: ((ee = e.gcashWithdrawalGatewaySettings) == null ? void 0 : ee.mobileWebEnabled) ?? !1,
@@ -2191,8 +2170,8 @@ class Dt {
2191
2170
  },
2192
2171
  maya: {
2193
2172
  androidEnabled: ((re = e.mayaWithdrawalGatewaySettings) == null ? void 0 : re.androidEnabled) ?? !1,
2194
- iosEnabled: ((oe = e.mayaWithdrawalGatewaySettings) == null ? void 0 : oe.iosEnabled) ?? !1,
2195
- webEnabled: ((ne = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ne.webEnabled) ?? !1,
2173
+ iosEnabled: ((ne = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ne.iosEnabled) ?? !1,
2174
+ webEnabled: ((oe = e.mayaWithdrawalGatewaySettings) == null ? void 0 : oe.webEnabled) ?? !1,
2196
2175
  mobileWebEnabled: ((ie = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ie.mobileWebEnabled) ?? !1,
2197
2176
  minimumAmount: i((se = e.mayaWithdrawalGatewaySettings) == null ? void 0 : se.minimumAmount),
2198
2177
  maximumAmount: i((me = e.mayaWithdrawalGatewaySettings) == null ? void 0 : me.maximumAmount)
@@ -2228,7 +2207,7 @@ class Dt {
2228
2207
  mobileNumber: e.mobileNumber ?? void 0,
2229
2208
  mobileNumberVerified: e.mobileNumberVerified ?? !1,
2230
2209
  mobileNumberVerificationRequired: e.mobileNumberVerificationRequired ?? !1,
2231
- validId: e.validId ?? void 0,
2210
+ validId: e.validId || void 0,
2232
2211
  verificationStatus: e.verificationStatus,
2233
2212
  transactionPassword: e.transactionPassword,
2234
2213
  secretAnswerSubmitted: e.secretAnswerSubmitted ?? !1,
@@ -2384,6 +2363,16 @@ class Dt {
2384
2363
  provider: e.provider
2385
2364
  };
2386
2365
  }
2366
+ game__next(e) {
2367
+ return {
2368
+ id: e.id,
2369
+ type: e.type,
2370
+ name: e.name,
2371
+ images: this.staticService.gameThumbnails(e),
2372
+ provider: e.provider,
2373
+ externalId: e.externalId
2374
+ };
2375
+ }
2387
2376
  gameSession(e) {
2388
2377
  const t = {
2389
2378
  id: e.id,
@@ -2481,8 +2470,8 @@ class Dt {
2481
2470
  };
2482
2471
  }
2483
2472
  }
2484
- var vt = { VITE_AUTH_DEVELOPMENT_URL: "https://auth.development.opexa.io", VITE_AUTH_PRODUCTION_URL: "https://auth.opexa.io", VITE_GAME_DEVELOPMENT_URL: "https://game.development.opexa.io/graphql", VITE_GAME_PRODUCTION_URL: "https://game.opexa.io/graphql", VITE_FILE_DEVELOPMENT_URL: "https://file.development.opexa.io/graphql", VITE_FILE_PRODUCTION_URL: "https://file.opexa.io/graphql", VITE_REPORT_DEVELOPMENT_URL: "https://report.development.opexa.io/graphql", VITE_REPORT_PRODUCTION_URL: "https://report.opexa.io/graphql", VITE_WALLET_DEVELOPMENT_URL: "https://wallet.development.opexa.io/graphql", VITE_WALLET_PRODUCTION_URL: "https://wallet.opexa.io/graphql", VITE_ACCOUNT_DEVELOPMENT_URL: "https://account.development.opexa.io/graphql", VITE_ACCOUNT_PRODUCTION_URL: "https://account.opexa.io/graphql", VITE_PORTAL_DEVELOPMENT_URL: "https://portal.development.opexa.io/graphql", VITE_PORTAL_PRODUCTION_URL: "https://portal.opexa.io/graphql", VITE_STATIC_DEVELOPMENT_URL: "https://static.development.opexa.io", VITE_STATIC_PRODUCTION_URL: "https://static.opexa.io", VITE_CMS_PORTAL_DEVELOPMENT_URL: "https://portal-api.opexacms.io/v1", BASE_URL: "/", MODE: "library", DEV: !1, PROD: !0, SSR: !1 };
2485
- class Gt {
2473
+ var Dt = { VITE_AUTH_DEVELOPMENT_URL: "https://auth.development.opexa.io", VITE_AUTH_PRODUCTION_URL: "https://auth.opexa.io", VITE_GAME_DEVELOPMENT_URL: "https://game.development.opexa.io/graphql", VITE_GAME_PRODUCTION_URL: "https://game.opexa.io/graphql", VITE_FILE_DEVELOPMENT_URL: "https://file.development.opexa.io/graphql", VITE_FILE_PRODUCTION_URL: "https://file.opexa.io/graphql", VITE_REPORT_DEVELOPMENT_URL: "https://report.development.opexa.io/graphql", VITE_REPORT_PRODUCTION_URL: "https://report.opexa.io/graphql", VITE_WALLET_DEVELOPMENT_URL: "https://wallet.development.opexa.io/graphql", VITE_WALLET_PRODUCTION_URL: "https://wallet.opexa.io/graphql", VITE_ACCOUNT_DEVELOPMENT_URL: "https://account.development.opexa.io/graphql", VITE_ACCOUNT_PRODUCTION_URL: "https://account.opexa.io/graphql", VITE_PORTAL_DEVELOPMENT_URL: "https://portal.development.opexa.io/graphql", VITE_PORTAL_PRODUCTION_URL: "https://portal.opexa.io/graphql", VITE_STATIC_DEVELOPMENT_URL: "https://static.development.opexa.io", VITE_STATIC_PRODUCTION_URL: "https://static.opexa.io", VITE_CMS_PORTAL_DEVELOPMENT_URL: "https://portal-api.opexacms.io/v1", BASE_URL: "/", MODE: "library", DEV: !1, PROD: !0, SSR: !1 };
2474
+ class xt {
2486
2475
  constructor(e) {
2487
2476
  c(this, "gameService");
2488
2477
  c(this, "fileService");
@@ -2495,13 +2484,13 @@ class Gt {
2495
2484
  c(this, "transformer");
2496
2485
  c(this, "logger");
2497
2486
  const t = e.environment === "development";
2498
- this.sessionManager = new Nt({
2487
+ this.sessionManager = new It({
2499
2488
  authUrl: t ? "https://auth.development.opexa.io" : "https://auth.opexa.io",
2500
2489
  walletUrl: t ? "https://wallet.development.opexa.io/graphql" : "https://wallet.opexa.io/graphql",
2501
2490
  platform: e.platform,
2502
2491
  log: e.log
2503
- }), this.cmsPortalService = new kt({
2504
- url: t ? "https://portal-api.opexacms.io/v1" : vt.VITE_CMS_PORTAL_PRODUCTION_URL,
2492
+ }), this.cmsPortalService = new _t({
2493
+ url: t ? "https://portal-api.opexacms.io/v1" : Dt.VITE_CMS_PORTAL_PRODUCTION_URL,
2505
2494
  site: e.site,
2506
2495
  platform: e.sitePlatform
2507
2496
  });
@@ -2514,37 +2503,37 @@ class Gt {
2514
2503
  }
2515
2504
  }
2516
2505
  };
2517
- this.gameService = new _t(
2518
- new b(
2506
+ this.gameService = new kt(
2507
+ new A(
2519
2508
  t ? "https://game.development.opexa.io/graphql" : "https://game.opexa.io/graphql",
2520
2509
  a
2521
2510
  )
2522
- ), this.fileService = new At(
2523
- new b(
2511
+ ), this.fileService = new St(
2512
+ new A(
2524
2513
  t ? "https://file.development.opexa.io/graphql" : "https://file.opexa.io/graphql",
2525
2514
  a
2526
2515
  )
2527
2516
  ), this.walletService = new be(
2528
- new b(
2517
+ new A(
2529
2518
  t ? "https://wallet.development.opexa.io/graphql" : "https://wallet.opexa.io/graphql",
2530
2519
  a
2531
2520
  )
2532
- ), this.reportService = new St(
2533
- new b(
2521
+ ), this.reportService = new At(
2522
+ new A(
2534
2523
  t ? "https://report.development.opexa.io/graphql" : "https://report.opexa.io/graphql",
2535
2524
  a
2536
2525
  )
2537
2526
  ), this.accountService = new gt(
2538
- new b(
2527
+ new A(
2539
2528
  t ? "https://account.development.opexa.io/graphql" : "https://account.opexa.io/graphql",
2540
2529
  a
2541
2530
  )
2542
2531
  ), this.portalService = new Tt(
2543
- new b(
2532
+ new A(
2544
2533
  t ? "https://portal.development.opexa.io/graphql" : "https://portal.opexa.io/graphql",
2545
2534
  a
2546
2535
  )
2547
- ), this.transformer = new Dt(e), this.logger = new ke({
2536
+ ), this.transformer = new Mt(e), this.logger = new _e({
2548
2537
  enabled: e.log ?? !1
2549
2538
  });
2550
2539
  }
@@ -2685,7 +2674,7 @@ class Gt {
2685
2674
  /*+----------------------------------------+*/
2686
2675
  /**/
2687
2676
  async site() {
2688
- const e = await this.cmsPortalService.siteInfo();
2677
+ const e = await this.cmsPortalService.self();
2689
2678
  return e.ok ? {
2690
2679
  ok: !0,
2691
2680
  data: this.transformer.transform.site(e.data)
@@ -2743,7 +2732,7 @@ class Gt {
2743
2732
  * ```
2744
2733
  */
2745
2734
  async createAccount(e) {
2746
- const t = e.id ?? A.generate(S.Account).toString(), a = await this.accountService.registerMemberAccount({
2735
+ const t = e.id ?? E.generate(S.Account).toString(), a = await this.accountService.registerMemberAccount({
2747
2736
  input: {
2748
2737
  id: t,
2749
2738
  name: e.name,
@@ -2825,7 +2814,7 @@ class Gt {
2825
2814
  * ```
2826
2815
  */
2827
2816
  async submitVerificationDetails(e) {
2828
- const t = e.id ?? A.generate(S.Verification).toString(), a = await this.accountService.createMemberVerification({
2817
+ const t = e.id ?? E.generate(S.Verification).toString(), a = await this.accountService.createMemberVerification({
2829
2818
  input: {
2830
2819
  id: t,
2831
2820
  ...e
@@ -2949,7 +2938,7 @@ class Gt {
2949
2938
  * ```
2950
2939
  */
2951
2940
  async createWithdrawal(e) {
2952
- const t = e.id ?? A.generate(S.Withdrawal).toString();
2941
+ const t = e.id ?? E.generate(S.Withdrawal).toString();
2953
2942
  if (e.type === "BANK") {
2954
2943
  const a = await this.walletService.createBankWithdrawal({
2955
2944
  input: {
@@ -3035,7 +3024,7 @@ class Gt {
3035
3024
  * ```
3036
3025
  */
3037
3026
  async createDeposit(e) {
3038
- const t = e.id ?? A.generate(S.Deposit).toString();
3027
+ const t = e.id ?? E.generate(S.Deposit).toString();
3039
3028
  if (e.type === "MAYA") {
3040
3029
  const a = await this.walletService.createMayaDeposit({
3041
3030
  input: {
@@ -3188,13 +3177,18 @@ class Gt {
3188
3177
  /*+ GAME +*/
3189
3178
  /*+----------------------------------------+*/
3190
3179
  /**/
3180
+ /** @deprecated use `game__next` */
3191
3181
  async game(e) {
3182
+ return this.game__next(e);
3183
+ }
3184
+ async game__next(e) {
3192
3185
  const t = await this.cmsPortalService.game(e);
3193
3186
  return t.ok ? {
3194
3187
  ok: !0,
3195
- data: t.data ? this.transformer.transform.game(t.data) : null
3188
+ data: t.data ? this.transformer.transform.game__next(t.data) : null
3196
3189
  } : t;
3197
3190
  }
3191
+ /** @deprecated use `games__next` */
3198
3192
  async games(e) {
3199
3193
  const t = await this.walletService.games(e);
3200
3194
  return t.ok ? {
@@ -3216,7 +3210,7 @@ class Gt {
3216
3210
  ok: !0,
3217
3211
  data: {
3218
3212
  games: t.data.edges.map(({ cursor: a, node: r }) => ({
3219
- ...this.transformer.transform.game(r),
3213
+ ...this.transformer.transform.game__next(r),
3220
3214
  cursor: a
3221
3215
  })),
3222
3216
  totalCount: t.data.totalCount,
@@ -3225,6 +3219,7 @@ class Gt {
3225
3219
  }
3226
3220
  } : t;
3227
3221
  }
3222
+ /** @deprecated use `games__next` */
3228
3223
  async games__legacy(e) {
3229
3224
  const t = await this.gameService.games(e);
3230
3225
  return t.ok ? {
@@ -3240,6 +3235,7 @@ class Gt {
3240
3235
  }
3241
3236
  } : t;
3242
3237
  }
3238
+ /** @deprecated use `games__next` */
3243
3239
  async gamesByName(e) {
3244
3240
  const t = await this.walletService.gamesByName(e);
3245
3241
  return t.ok ? {
@@ -3247,6 +3243,7 @@ class Gt {
3247
3243
  data: t.data.map(this.transformer.transform.game)
3248
3244
  } : t;
3249
3245
  }
3246
+ /** @deprecated use `games__next` */
3250
3247
  async gamesByName__legacy(e) {
3251
3248
  const t = await this.gameService.gamesByName(e);
3252
3249
  return t.ok ? {
@@ -3254,6 +3251,7 @@ class Gt {
3254
3251
  data: t.data.map(this.transformer.transform.game)
3255
3252
  } : t;
3256
3253
  }
3254
+ /** @deprecated use `gameSession__next` */
3257
3255
  async gameSession(e) {
3258
3256
  const t = await this.walletService.gameSession({ id: e });
3259
3257
  return t.ok ? {
@@ -3261,6 +3259,7 @@ class Gt {
3261
3259
  data: t.data ? this.transformer.transform.gameSession(t.data) : null
3262
3260
  } : t;
3263
3261
  }
3262
+ /** @deprecated use `gameSession__next` */
3264
3263
  async gameSession__legacy(e) {
3265
3264
  const t = await this.gameService.gameSession({ id: e });
3266
3265
  return t.ok ? {
@@ -3271,7 +3270,22 @@ class Gt {
3271
3270
  }) : null
3272
3271
  } : t;
3273
3272
  }
3273
+ async gameSession__next(e) {
3274
+ const t = await this.walletService.gameSession({ id: e });
3275
+ if (!t.ok) return t;
3276
+ if (t.data)
3277
+ return {
3278
+ ok: !0,
3279
+ data: this.transformer.transform.gameSession(t.data)
3280
+ };
3281
+ const a = await this.walletService.gameSession({ id: e });
3282
+ return a.ok ? {
3283
+ ok: !0,
3284
+ data: a.data ? this.transformer.transform.gameSession(a.data) : null
3285
+ } : a;
3286
+ }
3274
3287
  /**
3288
+ * @deprecated use `createGameSession__next`
3275
3289
  * @example
3276
3290
  * ```ts
3277
3291
  * const res = await sdk.createGameSession({
@@ -3287,29 +3301,53 @@ class Gt {
3287
3301
  * ```
3288
3302
  */
3289
3303
  async createGameSession(e) {
3290
- const t = e.id ?? A.generate(S.GameSession).toString(), a = await this.walletService.createGameSession({
3291
- input: {
3292
- id: t,
3293
- game: e.game
3294
- }
3295
- });
3304
+ const t = e.id ?? E.generate(S.GameSession).toString(), a = await this.walletService.createGameSession({ input: { id: t, game: e.game } });
3296
3305
  return a.ok ? { ok: !0, data: { id: t } } : a;
3297
3306
  }
3307
+ /** @deprecated use `createGameSession__next` */
3298
3308
  async createGameSession__legacy(e) {
3299
- const t = e.id ?? A.generate(S.GameSession).toString(), a = await this.gameService.createGameSession({
3300
- input: {
3301
- id: t,
3302
- game: e.game
3303
- }
3304
- });
3309
+ const t = e.id ?? E.generate(S.GameSession).toString(), a = await this.gameService.createGameSession({ input: { id: t, game: e.game } });
3305
3310
  return a.ok ? { ok: !0, data: { id: t } } : a;
3306
3311
  }
3312
+ async createGameSession__next(e) {
3313
+ const t = await this.game__next(e.game);
3314
+ if (!t.data)
3315
+ return {
3316
+ ok: !1,
3317
+ error: {
3318
+ name: "GameDoesNotExistError",
3319
+ message: "Game does not exist"
3320
+ }
3321
+ };
3322
+ const {
3323
+ /**/
3324
+ type: a,
3325
+ provider: r,
3326
+ externalId: s
3327
+ } = t.data, m = a === "SPORTS" ? e.id ?? (await E.generateFromKey(S.Game, `SPORTS:${r}`)).toString() : e.id ?? E.generate(S.GameSession).toString(), l = [
3328
+ /**/
3329
+ "RTG",
3330
+ "DARWIN",
3331
+ "DRBINGO",
3332
+ "MEGABALL",
3333
+ "EVOLUTION",
3334
+ "EVOLUTION_NETENT",
3335
+ "EVOLUTION_REDTIGER"
3336
+ ].includes(r) ? await this.walletService.createGameSession({ input: { id: m, game: s } }) : await this.gameService.createGameSession({ input: { id: m, game: s } });
3337
+ return l.ok ? { ok: !0, data: { id: m } } : l;
3338
+ }
3339
+ /** @deprecated use `endGameSession__next` */
3307
3340
  async endGameSession(e) {
3308
3341
  return await this.walletService.endGameSession({ input: { id: e } });
3309
3342
  }
3343
+ /** @deprecated use `endGameSession__next` */
3310
3344
  async endGameSession__legacy(e) {
3311
3345
  return await this.gameService.endGameSession({ input: { id: e } });
3312
3346
  }
3347
+ async endGameSession__next(e) {
3348
+ const t = await this.walletService.endGameSession({ input: { id: e } });
3349
+ return t.ok ? t : await this.gameService.endGameSession({ input: { id: e } });
3350
+ }
3313
3351
  /**/
3314
3352
  /*+----------------------------------------+*/
3315
3353
  /*+ FILE +*/
@@ -3338,7 +3376,7 @@ class Gt {
3338
3376
  * ```
3339
3377
  */
3340
3378
  async uploadImageFile(e) {
3341
- const t = e.id ?? A.generate(S.File).toString(), a = await this.fileService.uploadPrivateImageFile({
3379
+ const t = e.id ?? E.generate(S.File).toString(), a = await this.fileService.uploadPrivateImageFile({
3342
3380
  input: {
3343
3381
  id: t,
3344
3382
  file: e.file
@@ -3370,8 +3408,8 @@ class Gt {
3370
3408
  }
3371
3409
  }
3372
3410
  export {
3373
- Ot as ObjectId,
3411
+ Ut as ObjectId,
3374
3412
  S as ObjectType,
3375
- Gt as Sdk
3413
+ xt as Sdk
3376
3414
  };
3377
3415
  //# sourceMappingURL=index.mjs.map