@jetthai/cuora 1.1.67 → 1.1.68-cash
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/.husky/pre-commit +1 -1
- package/CHANGELOG.md +4 -0
- package/dist/bundle.mjs +109 -838
- package/package.json +1 -1
- package/src/machine/deposit/direct.js +9 -2
- package/src/machine/deposit/loadcard_vn.js +10 -3
- package/src/machine/deposit/qrcode_v2.js +10 -4
- package/src/machine/game_favorite_v2.js +6 -2
- package/src/machine/game_v2_1.js +36 -9
- package/src/machine/index.js +0 -6
- package/src/request/request.js +9 -5
- package/src/machine/game.js +0 -285
- package/src/machine/game_favorite.js +0 -123
- package/src/machine/game_v2.js +0 -381
package/dist/bundle.mjs
CHANGED
|
@@ -3613,7 +3613,7 @@ var common$1 = {
|
|
|
3613
3613
|
getAnnouncements: () => ({ url: 'getAnnouncements', method: 'get', isPublic: true }),
|
|
3614
3614
|
};
|
|
3615
3615
|
|
|
3616
|
-
var game
|
|
3616
|
+
var game = {
|
|
3617
3617
|
getGameSHA: () => ({ method: 'get', url: 'game/list/v2/sha' }),
|
|
3618
3618
|
getOptionMap: (code) => ({ method: 'get', url: 'game/list/v2/options', params: { code } }),
|
|
3619
3619
|
getGameStatus: () => ({ method: 'get', url: 'game/list/v2/status' }),
|
|
@@ -3928,7 +3928,7 @@ var form = {
|
|
|
3928
3928
|
upload: (formData) => ({ url: 'upload', method: 'post', params: formData, isFormData: true }),
|
|
3929
3929
|
};
|
|
3930
3930
|
|
|
3931
|
-
var index$2 = { activity: api, auth: auth$1, common: common$1, game
|
|
3931
|
+
var index$2 = { activity: api, auth: auth$1, common: common$1, game, mailbox, payment, user, form };
|
|
3932
3932
|
|
|
3933
3933
|
/*! *****************************************************************************
|
|
3934
3934
|
Copyright (c) Microsoft Corporation.
|
|
@@ -17053,672 +17053,13 @@ function error () {
|
|
|
17053
17053
|
)
|
|
17054
17054
|
}
|
|
17055
17055
|
|
|
17056
|
-
|
|
17057
|
-
|
|
17058
|
-
function game (request) {
|
|
17059
|
-
return createMachine(
|
|
17060
|
-
{
|
|
17061
|
-
id: 'game',
|
|
17062
|
-
type: 'parallel',
|
|
17063
|
-
context: {
|
|
17064
|
-
roomId: null,
|
|
17065
|
-
room: null,
|
|
17066
|
-
list: [],
|
|
17067
|
-
gameList: [],
|
|
17068
|
-
// play params
|
|
17069
|
-
game: {
|
|
17070
|
-
provider: null,
|
|
17071
|
-
game_id: null,
|
|
17072
|
-
game_type: null,
|
|
17073
|
-
mapping_id: null,
|
|
17074
|
-
portrait: null,
|
|
17075
|
-
},
|
|
17076
|
-
lang: 'en_US',
|
|
17077
|
-
isMobile: new UAParser().getResult().device.type,
|
|
17078
|
-
gameURL: null,
|
|
17079
|
-
// game database
|
|
17080
|
-
sha: {
|
|
17081
|
-
category: null,
|
|
17082
|
-
status: null,
|
|
17083
|
-
},
|
|
17084
|
-
isCategoryChanged: false,
|
|
17085
|
-
isStatusChanged: false,
|
|
17086
|
-
statusMap: {},
|
|
17087
|
-
optionMap: {},
|
|
17088
|
-
},
|
|
17089
|
-
states: {
|
|
17090
|
-
flow: {
|
|
17091
|
-
initial: 'idle',
|
|
17092
|
-
states: {
|
|
17093
|
-
idle: {
|
|
17094
|
-
enter: 'clearGameInfo',
|
|
17095
|
-
on: {
|
|
17096
|
-
SET_ROOM: {
|
|
17097
|
-
target: 'loading',
|
|
17098
|
-
actions: 'setRoom',
|
|
17099
|
-
cond: (context, event) => {
|
|
17100
|
-
return context.room?.id !== event.data?.id
|
|
17101
|
-
},
|
|
17102
|
-
},
|
|
17103
|
-
ENTER_GAME: {
|
|
17104
|
-
target: 'connecting',
|
|
17105
|
-
actions: ['setGameInfo', 'setLang'],
|
|
17106
|
-
},
|
|
17107
|
-
},
|
|
17108
|
-
},
|
|
17109
|
-
loading: {
|
|
17110
|
-
invoke: {
|
|
17111
|
-
src: 'getRoomItems',
|
|
17112
|
-
onDone: {
|
|
17113
|
-
target: 'idle',
|
|
17114
|
-
actions: 'setList',
|
|
17115
|
-
},
|
|
17116
|
-
onError: {
|
|
17117
|
-
target: 'idle',
|
|
17118
|
-
actions: assign({ list: [] }),
|
|
17119
|
-
},
|
|
17120
|
-
},
|
|
17121
|
-
},
|
|
17122
|
-
connecting: {
|
|
17123
|
-
invoke: {
|
|
17124
|
-
src: 'connectGame',
|
|
17125
|
-
onDone: {
|
|
17126
|
-
target: 'playing',
|
|
17127
|
-
actions: 'setGameURL',
|
|
17128
|
-
},
|
|
17129
|
-
onError: {
|
|
17130
|
-
target: 'idle',
|
|
17131
|
-
},
|
|
17132
|
-
},
|
|
17133
|
-
},
|
|
17134
|
-
playing: {
|
|
17135
|
-
on: {
|
|
17136
|
-
EXIT_GAME: {
|
|
17137
|
-
target: 'disconnect',
|
|
17138
|
-
},
|
|
17139
|
-
},
|
|
17140
|
-
},
|
|
17141
|
-
disconnect: {
|
|
17142
|
-
invoke: {
|
|
17143
|
-
src: 'disconnectGame',
|
|
17144
|
-
onDone: {
|
|
17145
|
-
target: 'idle',
|
|
17146
|
-
},
|
|
17147
|
-
onError: {
|
|
17148
|
-
target: 'idle',
|
|
17149
|
-
},
|
|
17150
|
-
},
|
|
17151
|
-
},
|
|
17152
|
-
},
|
|
17153
|
-
},
|
|
17154
|
-
timer: {
|
|
17155
|
-
initial: 'fetchingGameSHA',
|
|
17156
|
-
states: {
|
|
17157
|
-
fetchingGameSHA: {
|
|
17158
|
-
invoke: {
|
|
17159
|
-
src: 'fetchGameSHA',
|
|
17160
|
-
onDone: {
|
|
17161
|
-
target: 'checking',
|
|
17162
|
-
actions: 'setGameSHA',
|
|
17163
|
-
},
|
|
17164
|
-
onError: {
|
|
17165
|
-
target: 'pending',
|
|
17166
|
-
},
|
|
17167
|
-
},
|
|
17168
|
-
},
|
|
17169
|
-
checking: {
|
|
17170
|
-
always: [
|
|
17171
|
-
{ target: 'updatingStatus', cond: 'isStatusChanged' },
|
|
17172
|
-
{ target: 'updatingCategory', cond: 'isCategoryChanged' },
|
|
17173
|
-
{ target: 'pending' },
|
|
17174
|
-
],
|
|
17175
|
-
},
|
|
17176
|
-
updatingStatus: {
|
|
17177
|
-
invoke: {
|
|
17178
|
-
src: 'fetchStatus',
|
|
17179
|
-
onDone: {
|
|
17180
|
-
target: 'updatingOption',
|
|
17181
|
-
actions: ['setStatus'],
|
|
17182
|
-
},
|
|
17183
|
-
onError: {
|
|
17184
|
-
target: 'pending',
|
|
17185
|
-
},
|
|
17186
|
-
},
|
|
17187
|
-
},
|
|
17188
|
-
updatingOption: {
|
|
17189
|
-
invoke: {
|
|
17190
|
-
src: 'fetchOption',
|
|
17191
|
-
onDone: {
|
|
17192
|
-
target: 'updatingCategory',
|
|
17193
|
-
actions: 'mergeOption',
|
|
17194
|
-
},
|
|
17195
|
-
onError: {
|
|
17196
|
-
target: 'pending',
|
|
17197
|
-
},
|
|
17198
|
-
},
|
|
17199
|
-
},
|
|
17200
|
-
updatingCategory: {
|
|
17201
|
-
invoke: {
|
|
17202
|
-
src: 'getRoomItems',
|
|
17203
|
-
onDone: {
|
|
17204
|
-
target: 'pending',
|
|
17205
|
-
actions: 'setList',
|
|
17206
|
-
},
|
|
17207
|
-
onError: {
|
|
17208
|
-
target: 'pending',
|
|
17209
|
-
},
|
|
17210
|
-
},
|
|
17211
|
-
},
|
|
17212
|
-
pending: {
|
|
17213
|
-
after: {
|
|
17214
|
-
20000: {
|
|
17215
|
-
target: 'fetchingGameSHA',
|
|
17216
|
-
},
|
|
17217
|
-
},
|
|
17218
|
-
},
|
|
17219
|
-
},
|
|
17220
|
-
},
|
|
17221
|
-
},
|
|
17222
|
-
},
|
|
17223
|
-
{
|
|
17224
|
-
actions: {
|
|
17225
|
-
setRoomId: assign((context, event) => {
|
|
17226
|
-
return { roomId: event.roomId }
|
|
17227
|
-
}),
|
|
17228
|
-
setRoom: assign((context, event) => {
|
|
17229
|
-
return {
|
|
17230
|
-
room: event.data,
|
|
17231
|
-
roomId: event.data.id,
|
|
17232
|
-
}
|
|
17233
|
-
}),
|
|
17234
|
-
setList: assign((context, event) => {
|
|
17235
|
-
const { statusMap, optionMap } = context;
|
|
17236
|
-
const { list = [] } = event.data;
|
|
17237
|
-
const gameList = list
|
|
17238
|
-
.map((item) => {
|
|
17239
|
-
if (item.id) {
|
|
17240
|
-
item.room = true;
|
|
17241
|
-
return item
|
|
17242
|
-
}
|
|
17243
|
-
|
|
17244
|
-
const code = item.g;
|
|
17245
|
-
if (!code || !optionMap[code]) {
|
|
17246
|
-
return
|
|
17247
|
-
}
|
|
17248
|
-
|
|
17249
|
-
return {
|
|
17250
|
-
...optionMap[code],
|
|
17251
|
-
code,
|
|
17252
|
-
system_enable: statusMap[code][0],
|
|
17253
|
-
}
|
|
17254
|
-
})
|
|
17255
|
-
.filter((item) => item && !item.header)
|
|
17256
|
-
.sort((a, b) => a.system_enable - b.system_enable);
|
|
17257
|
-
return { list, gameList }
|
|
17258
|
-
}),
|
|
17259
|
-
setGameURL: assign({
|
|
17260
|
-
gameURL: (context, event) => {
|
|
17261
|
-
return event.data.gameURL
|
|
17262
|
-
},
|
|
17263
|
-
}),
|
|
17264
|
-
clearGameInfo: assign((context, event) => {
|
|
17265
|
-
return { game: { provider: null, game_id: null, game_type: null, mapping_id: null } }
|
|
17266
|
-
}),
|
|
17267
|
-
setGameInfo: assign((context, event) => {
|
|
17268
|
-
const { provider, game_id, game_type, mapping_id, portrait } = event.data.game;
|
|
17269
|
-
return { game: { provider, game_id, game_type, mapping_id, portrait } }
|
|
17270
|
-
}),
|
|
17271
|
-
setLang: assign((context, event) => {
|
|
17272
|
-
const lang = event.data.locale.replace('-', '_');
|
|
17273
|
-
return { lang }
|
|
17274
|
-
}),
|
|
17275
|
-
setGameSHA: assign((context, event) => {
|
|
17276
|
-
const { sha } = context;
|
|
17277
|
-
const newSha = event.data;
|
|
17278
|
-
return {
|
|
17279
|
-
sha: newSha,
|
|
17280
|
-
isCategoryChanged: !sha.category || sha.category !== newSha.category,
|
|
17281
|
-
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17282
|
-
}
|
|
17283
|
-
}),
|
|
17284
|
-
setStatus: assign((context, event) => {
|
|
17285
|
-
return {
|
|
17286
|
-
statusMap: event.data,
|
|
17287
|
-
}
|
|
17288
|
-
}),
|
|
17289
|
-
mergeOption: assign((context, event) => {
|
|
17290
|
-
const { optionMap } = context;
|
|
17291
|
-
return {
|
|
17292
|
-
optionMap: { ...optionMap, ...event.data },
|
|
17293
|
-
}
|
|
17294
|
-
}),
|
|
17295
|
-
},
|
|
17296
|
-
guards: {
|
|
17297
|
-
isCategoryChanged: (context, event) => context.isCategoryChanged,
|
|
17298
|
-
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17299
|
-
},
|
|
17300
|
-
services: {
|
|
17301
|
-
getRoomItems: async (context, event) => {
|
|
17302
|
-
return await request.send(game$1.getGameCategory({ id: context.roomId }))
|
|
17303
|
-
},
|
|
17304
|
-
connectGame: async (context, event) => {
|
|
17305
|
-
const { lang, isMobile } = context;
|
|
17306
|
-
const { provider, game_id, game_type, mapping_id } = context.game;
|
|
17307
|
-
const params = {
|
|
17308
|
-
provider_id: provider,
|
|
17309
|
-
game_id: game_id,
|
|
17310
|
-
gametype_id: game_type,
|
|
17311
|
-
mapping_id: mapping_id,
|
|
17312
|
-
is_demo: false,
|
|
17313
|
-
is_mobile: isMobile,
|
|
17314
|
-
lang,
|
|
17315
|
-
return_url: window.location.href,
|
|
17316
|
-
};
|
|
17317
|
-
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17318
|
-
return { gameURL: redirect_url }
|
|
17319
|
-
},
|
|
17320
|
-
disconnectGame: async (context, event) => {
|
|
17321
|
-
const uid_site = event.data;
|
|
17322
|
-
return await request.send(game$1.logoutGame({ uid_site, provider_id: context.game.provider }))
|
|
17323
|
-
},
|
|
17324
|
-
fetchOption: async (context, event) => {
|
|
17325
|
-
return await request.send(game$1.getOptionMap())
|
|
17326
|
-
},
|
|
17327
|
-
fetchGameSHA: async (context, event) => {
|
|
17328
|
-
return await request.send(game$1.getGameSHA())
|
|
17329
|
-
},
|
|
17330
|
-
fetchStatus: async (context, event) => {
|
|
17331
|
-
return await request.send(game$1.getGameStatus())
|
|
17332
|
-
},
|
|
17333
|
-
},
|
|
17334
|
-
}
|
|
17335
|
-
)
|
|
17336
|
-
}
|
|
17337
|
-
|
|
17338
|
-
const MY_FAVORITE = 'MyFavorite';
|
|
17339
|
-
const GAME_SEARCH = 'GameSearch';
|
|
17340
|
-
|
|
17341
|
-
var constant = /*#__PURE__*/Object.freeze({
|
|
17342
|
-
__proto__: null,
|
|
17343
|
-
MY_FAVORITE: MY_FAVORITE,
|
|
17344
|
-
GAME_SEARCH: GAME_SEARCH
|
|
17345
|
-
});
|
|
17346
|
-
|
|
17347
|
-
function game_v2 (request) {
|
|
17348
|
-
return createMachine(
|
|
17349
|
-
{
|
|
17350
|
-
id: 'game',
|
|
17351
|
-
type: 'parallel',
|
|
17352
|
-
context: {
|
|
17353
|
-
room: null,
|
|
17354
|
-
index: 0,
|
|
17355
|
-
content: {
|
|
17356
|
-
data: [],
|
|
17357
|
-
timestamp: null,
|
|
17358
|
-
parentCategoryId: null,
|
|
17359
|
-
totalPage: 1,
|
|
17360
|
-
},
|
|
17361
|
-
addition: {
|
|
17362
|
-
data: [],
|
|
17363
|
-
timestamp: null,
|
|
17364
|
-
totalPage: 1,
|
|
17365
|
-
},
|
|
17366
|
-
// play params
|
|
17367
|
-
game: {
|
|
17368
|
-
providerId: null,
|
|
17369
|
-
gameId: null,
|
|
17370
|
-
gameTypeId: null,
|
|
17371
|
-
mappingId: null,
|
|
17372
|
-
portrait: null,
|
|
17373
|
-
},
|
|
17374
|
-
lang: 'en_US',
|
|
17375
|
-
isMobile: new UAParser().getResult().device.type,
|
|
17376
|
-
gameURL: null,
|
|
17377
|
-
...oldContext$1,
|
|
17378
|
-
},
|
|
17379
|
-
states: {
|
|
17380
|
-
flow: {
|
|
17381
|
-
initial: 'idle',
|
|
17382
|
-
states: {
|
|
17383
|
-
idle: {
|
|
17384
|
-
enter: 'clearGameInfo',
|
|
17385
|
-
on: {
|
|
17386
|
-
ENTER_ROOM: {
|
|
17387
|
-
target: 'loading',
|
|
17388
|
-
cond: 'isDifferentRoom',
|
|
17389
|
-
actions: ['setRoom', 'resetContent'],
|
|
17390
|
-
},
|
|
17391
|
-
NEXT_PAGE: {
|
|
17392
|
-
target: 'loading',
|
|
17393
|
-
cond: 'hasNext',
|
|
17394
|
-
actions: 'increaseIndex',
|
|
17395
|
-
},
|
|
17396
|
-
ENTER_GAME: {
|
|
17397
|
-
target: 'connecting',
|
|
17398
|
-
actions: ['setGameInfo', 'setLang'],
|
|
17399
|
-
},
|
|
17400
|
-
},
|
|
17401
|
-
},
|
|
17402
|
-
loading: {
|
|
17403
|
-
invoke: {
|
|
17404
|
-
src: 'getPageContent',
|
|
17405
|
-
onDone: {
|
|
17406
|
-
target: 'idle',
|
|
17407
|
-
actions: 'appendContent',
|
|
17408
|
-
},
|
|
17409
|
-
onError: {
|
|
17410
|
-
target: 'idle',
|
|
17411
|
-
},
|
|
17412
|
-
},
|
|
17413
|
-
},
|
|
17414
|
-
connecting: {
|
|
17415
|
-
invoke: {
|
|
17416
|
-
src: 'connectGame',
|
|
17417
|
-
onDone: {
|
|
17418
|
-
target: 'playing',
|
|
17419
|
-
actions: 'setGameURL',
|
|
17420
|
-
},
|
|
17421
|
-
onError: {
|
|
17422
|
-
target: 'idle',
|
|
17423
|
-
},
|
|
17424
|
-
},
|
|
17425
|
-
},
|
|
17426
|
-
playing: {
|
|
17427
|
-
on: {
|
|
17428
|
-
EXIT_GAME: {
|
|
17429
|
-
target: 'disconnect',
|
|
17430
|
-
},
|
|
17431
|
-
},
|
|
17432
|
-
},
|
|
17433
|
-
disconnect: {
|
|
17434
|
-
invoke: {
|
|
17435
|
-
src: 'disconnectGame',
|
|
17436
|
-
onDone: {
|
|
17437
|
-
target: 'idle',
|
|
17438
|
-
},
|
|
17439
|
-
onError: {
|
|
17440
|
-
target: 'idle',
|
|
17441
|
-
},
|
|
17442
|
-
},
|
|
17443
|
-
},
|
|
17444
|
-
},
|
|
17445
|
-
},
|
|
17446
|
-
timer: {
|
|
17447
|
-
initial: 'pending',
|
|
17448
|
-
states: {
|
|
17449
|
-
pending: {
|
|
17450
|
-
after: {
|
|
17451
|
-
20000: [
|
|
17452
|
-
{
|
|
17453
|
-
target: 'updating',
|
|
17454
|
-
cond: 'hasRoom',
|
|
17455
|
-
},
|
|
17456
|
-
{
|
|
17457
|
-
target: 'pending',
|
|
17458
|
-
},
|
|
17459
|
-
],
|
|
17460
|
-
},
|
|
17461
|
-
},
|
|
17462
|
-
updating: {
|
|
17463
|
-
invoke: {
|
|
17464
|
-
src: 'updatePageContent',
|
|
17465
|
-
onDone: {
|
|
17466
|
-
target: 'pending',
|
|
17467
|
-
actions: 'swapContent',
|
|
17468
|
-
},
|
|
17469
|
-
onError: {
|
|
17470
|
-
target: 'pending',
|
|
17471
|
-
},
|
|
17472
|
-
},
|
|
17473
|
-
},
|
|
17474
|
-
},
|
|
17475
|
-
},
|
|
17476
|
-
oldTimer: {
|
|
17477
|
-
initial: 'fetchingGameSHA',
|
|
17478
|
-
states: {
|
|
17479
|
-
fetchingGameSHA: {
|
|
17480
|
-
invoke: {
|
|
17481
|
-
src: 'fetchGameSHA',
|
|
17482
|
-
onDone: {
|
|
17483
|
-
target: 'checking',
|
|
17484
|
-
actions: 'setGameSHA',
|
|
17485
|
-
},
|
|
17486
|
-
onError: {
|
|
17487
|
-
target: 'pending',
|
|
17488
|
-
},
|
|
17489
|
-
},
|
|
17490
|
-
},
|
|
17491
|
-
checking: {
|
|
17492
|
-
always: [{ target: 'updatingStatus', cond: 'isStatusChanged' }, { target: 'pending' }],
|
|
17493
|
-
},
|
|
17494
|
-
updatingStatus: {
|
|
17495
|
-
invoke: {
|
|
17496
|
-
src: 'fetchStatus',
|
|
17497
|
-
onDone: {
|
|
17498
|
-
target: 'updatingOption',
|
|
17499
|
-
actions: ['setStatus'],
|
|
17500
|
-
},
|
|
17501
|
-
onError: {
|
|
17502
|
-
target: 'pending',
|
|
17503
|
-
},
|
|
17504
|
-
},
|
|
17505
|
-
},
|
|
17506
|
-
updatingOption: {
|
|
17507
|
-
invoke: {
|
|
17508
|
-
src: 'fetchOption',
|
|
17509
|
-
onDone: {
|
|
17510
|
-
target: 'pending',
|
|
17511
|
-
actions: 'mergeOption',
|
|
17512
|
-
},
|
|
17513
|
-
onError: {
|
|
17514
|
-
target: 'pending',
|
|
17515
|
-
},
|
|
17516
|
-
},
|
|
17517
|
-
},
|
|
17518
|
-
pending: {
|
|
17519
|
-
after: {
|
|
17520
|
-
20000: {
|
|
17521
|
-
target: 'fetchingGameSHA',
|
|
17522
|
-
},
|
|
17523
|
-
},
|
|
17524
|
-
},
|
|
17525
|
-
},
|
|
17526
|
-
},
|
|
17527
|
-
},
|
|
17528
|
-
},
|
|
17529
|
-
{
|
|
17530
|
-
actions: {
|
|
17531
|
-
setFavoriteList: assign((context, event) => {
|
|
17532
|
-
return {
|
|
17533
|
-
favoriteList: event.data.data || [],
|
|
17534
|
-
}
|
|
17535
|
-
}),
|
|
17536
|
-
setRoom: assign((context, event) => {
|
|
17537
|
-
return {
|
|
17538
|
-
room: event.data,
|
|
17539
|
-
}
|
|
17540
|
-
}),
|
|
17541
|
-
resetContent: assign((context, event) => {
|
|
17542
|
-
return {
|
|
17543
|
-
index: 0,
|
|
17544
|
-
content: {
|
|
17545
|
-
data: [],
|
|
17546
|
-
timestamp: null,
|
|
17547
|
-
parentCategoryId: null,
|
|
17548
|
-
totalPage: 1,
|
|
17549
|
-
},
|
|
17550
|
-
addition: {
|
|
17551
|
-
data: [],
|
|
17552
|
-
timestamp: null,
|
|
17553
|
-
totalPage: 1,
|
|
17554
|
-
},
|
|
17555
|
-
}
|
|
17556
|
-
}),
|
|
17557
|
-
appendContent: assign((context, event) => {
|
|
17558
|
-
const { room, favoriteList } = context;
|
|
17559
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17560
|
-
return
|
|
17561
|
-
} else {
|
|
17562
|
-
const [content, addition] = event.data;
|
|
17563
|
-
return {
|
|
17564
|
-
content: {
|
|
17565
|
-
...context.content,
|
|
17566
|
-
...content,
|
|
17567
|
-
data: context.content.data.concat(content.data),
|
|
17568
|
-
},
|
|
17569
|
-
addition: {
|
|
17570
|
-
...context.addition,
|
|
17571
|
-
...addition,
|
|
17572
|
-
data: context.addition.data.concat(addition.data),
|
|
17573
|
-
},
|
|
17574
|
-
}
|
|
17575
|
-
}
|
|
17576
|
-
}),
|
|
17577
|
-
swapContent: assign((context, event) => {
|
|
17578
|
-
const [content, addition] = event.data;
|
|
17579
|
-
let result = {};
|
|
17580
|
-
if (content?.data?.length) {
|
|
17581
|
-
result.content = content;
|
|
17582
|
-
}
|
|
17583
|
-
if (addition?.data?.length) {
|
|
17584
|
-
result.addition = addition;
|
|
17585
|
-
}
|
|
17586
|
-
return result
|
|
17587
|
-
}),
|
|
17588
|
-
increaseIndex: assign((context, event) => {
|
|
17589
|
-
return {
|
|
17590
|
-
index: context.index + 1,
|
|
17591
|
-
}
|
|
17592
|
-
}),
|
|
17593
|
-
setGameURL: assign({
|
|
17594
|
-
gameURL: (context, event) => {
|
|
17595
|
-
return event.data.gameURL
|
|
17596
|
-
},
|
|
17597
|
-
}),
|
|
17598
|
-
clearGameInfo: assign((context, event) => {
|
|
17599
|
-
return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
|
|
17600
|
-
}),
|
|
17601
|
-
setGameInfo: assign((context, event) => {
|
|
17602
|
-
const { providerId, gameId, gameTypeId, mappingId, portrait } = event.data.game;
|
|
17603
|
-
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0 } }
|
|
17604
|
-
}),
|
|
17605
|
-
setLang: assign((context, event) => {
|
|
17606
|
-
const lang = event.data.locale.replace('-', '_');
|
|
17607
|
-
return { lang }
|
|
17608
|
-
}),
|
|
17609
|
-
...oldActions$1,
|
|
17610
|
-
},
|
|
17611
|
-
guards: {
|
|
17612
|
-
isDifferentRoom: (context, event) => context.room?.categoryId !== event.data?.categoryId,
|
|
17613
|
-
hasNext: (context, event) => context.index < context?.content?.totalPage - 1,
|
|
17614
|
-
hasRoom: (context, event) => context.room?.categoryId,
|
|
17615
|
-
...oldGuards$1,
|
|
17616
|
-
},
|
|
17617
|
-
services: {
|
|
17618
|
-
getPageContent: async (context, event) => {
|
|
17619
|
-
const { room, index } = context;
|
|
17620
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17621
|
-
return
|
|
17622
|
-
} else {
|
|
17623
|
-
const param = { categoryId: room.categoryId, index };
|
|
17624
|
-
return await Promise.all([request.send(game$1.getListCategory(param)), request.send(game$1.getListAddition(param))])
|
|
17625
|
-
}
|
|
17626
|
-
},
|
|
17627
|
-
updatePageContent: async (context, event) => {
|
|
17628
|
-
const { room, content, index } = context;
|
|
17629
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17630
|
-
return
|
|
17631
|
-
} else {
|
|
17632
|
-
return await Promise.all([
|
|
17633
|
-
request.send(
|
|
17634
|
-
game$1.getListCategoryByRange({
|
|
17635
|
-
categoryId: room.categoryId,
|
|
17636
|
-
end: index,
|
|
17637
|
-
timestamp: content.timestamp,
|
|
17638
|
-
})
|
|
17639
|
-
),
|
|
17640
|
-
request.send(
|
|
17641
|
-
game$1.getListAdditionByRange({
|
|
17642
|
-
categoryId: room.categoryId,
|
|
17643
|
-
end: index,
|
|
17644
|
-
timestamp: content.timestamp,
|
|
17645
|
-
})
|
|
17646
|
-
),
|
|
17647
|
-
])
|
|
17648
|
-
}
|
|
17649
|
-
},
|
|
17650
|
-
connectGame: async (context, event) => {
|
|
17651
|
-
const { lang, isMobile } = context;
|
|
17652
|
-
const { providerId, gameId, gameTypeId, mappingId } = context.game;
|
|
17653
|
-
const params = {
|
|
17654
|
-
provider_id: providerId,
|
|
17655
|
-
game_id: gameId,
|
|
17656
|
-
gametype_id: gameTypeId,
|
|
17657
|
-
mapping_id: mappingId,
|
|
17658
|
-
is_demo: false,
|
|
17659
|
-
is_mobile: isMobile,
|
|
17660
|
-
lang,
|
|
17661
|
-
return_url: window.location.href,
|
|
17662
|
-
};
|
|
17663
|
-
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17664
|
-
return { gameURL: redirect_url }
|
|
17665
|
-
},
|
|
17666
|
-
disconnectGame: async (context, event) => {
|
|
17667
|
-
const uid_site = event.data;
|
|
17668
|
-
const provider_id = context.game.providerId;
|
|
17669
|
-
return await request.send(game$1.logoutGame({ uid_site, provider_id }))
|
|
17670
|
-
},
|
|
17671
|
-
...oldServices$1(request),
|
|
17672
|
-
},
|
|
17673
|
-
}
|
|
17674
|
-
)
|
|
17675
|
-
}
|
|
17676
|
-
|
|
17677
|
-
const oldContext$1 = {
|
|
17678
|
-
sha: {
|
|
17679
|
-
status: null,
|
|
17680
|
-
},
|
|
17681
|
-
isStatusChanged: false,
|
|
17682
|
-
statusMap: {},
|
|
17683
|
-
optionMap: {},
|
|
17684
|
-
};
|
|
17685
|
-
|
|
17686
|
-
const oldActions$1 = {
|
|
17687
|
-
setGameSHA: assign((context, event) => {
|
|
17688
|
-
const { sha } = context;
|
|
17689
|
-
const newSha = event.data;
|
|
17690
|
-
return {
|
|
17691
|
-
sha: newSha,
|
|
17692
|
-
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17693
|
-
}
|
|
17694
|
-
}),
|
|
17695
|
-
setStatus: assign((context, event) => {
|
|
17696
|
-
return {
|
|
17697
|
-
statusMap: event.data,
|
|
17698
|
-
}
|
|
17699
|
-
}),
|
|
17700
|
-
mergeOption: assign((context, event) => {
|
|
17701
|
-
const { optionMap } = context;
|
|
17702
|
-
return {
|
|
17703
|
-
optionMap: { ...optionMap, ...event.data },
|
|
17704
|
-
}
|
|
17705
|
-
}),
|
|
17706
|
-
};
|
|
17707
|
-
|
|
17708
|
-
const oldGuards$1 = {
|
|
17709
|
-
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17710
|
-
};
|
|
17056
|
+
const MY_FAVORITE = 'MyFavorite';
|
|
17057
|
+
const GAME_SEARCH = 'GameSearch';
|
|
17711
17058
|
|
|
17712
|
-
|
|
17713
|
-
|
|
17714
|
-
|
|
17715
|
-
|
|
17716
|
-
fetchGameSHA: async (context, event) => {
|
|
17717
|
-
return await request.send(game$1.getGameSHA())
|
|
17718
|
-
},
|
|
17719
|
-
fetchStatus: async (context, event) => {
|
|
17720
|
-
return await request.send(game$1.getGameStatus())
|
|
17721
|
-
},
|
|
17059
|
+
var constant = /*#__PURE__*/Object.freeze({
|
|
17060
|
+
__proto__: null,
|
|
17061
|
+
MY_FAVORITE: MY_FAVORITE,
|
|
17062
|
+
GAME_SEARCH: GAME_SEARCH
|
|
17722
17063
|
});
|
|
17723
17064
|
|
|
17724
17065
|
// 對應 intersectionObserver 版本
|
|
@@ -17744,6 +17085,7 @@ function game_v2_1 (request) {
|
|
|
17744
17085
|
timestamp: null,
|
|
17745
17086
|
totalPage: 0,
|
|
17746
17087
|
},
|
|
17088
|
+
staticData: [],
|
|
17747
17089
|
// play params
|
|
17748
17090
|
game: {
|
|
17749
17091
|
providerId: null,
|
|
@@ -17764,6 +17106,9 @@ function game_v2_1 (request) {
|
|
|
17764
17106
|
idle: {
|
|
17765
17107
|
enter: 'clearGameInfo',
|
|
17766
17108
|
on: {
|
|
17109
|
+
SET_STATIC_DATA: {
|
|
17110
|
+
actions: 'setStaticData',
|
|
17111
|
+
},
|
|
17767
17112
|
SET_ADDITION_ENABLE: {
|
|
17768
17113
|
actions: 'setAdditionEnable',
|
|
17769
17114
|
},
|
|
@@ -17923,6 +17268,11 @@ function game_v2_1 (request) {
|
|
|
17923
17268
|
},
|
|
17924
17269
|
{
|
|
17925
17270
|
actions: {
|
|
17271
|
+
setStaticData: assign((context, event) => {
|
|
17272
|
+
return {
|
|
17273
|
+
staticData: event.data,
|
|
17274
|
+
}
|
|
17275
|
+
}),
|
|
17926
17276
|
setAdditionEnable: assign((context, event) => {
|
|
17927
17277
|
return {
|
|
17928
17278
|
additionEnable: event.data,
|
|
@@ -17940,17 +17290,13 @@ function game_v2_1 (request) {
|
|
|
17940
17290
|
isLastPage: index >= content?.totalPage - 1,
|
|
17941
17291
|
}
|
|
17942
17292
|
}),
|
|
17943
|
-
setFavoriteList: assign((context, event) => {
|
|
17944
|
-
return {
|
|
17945
|
-
favoriteList: event.data.data || [],
|
|
17946
|
-
}
|
|
17947
|
-
}),
|
|
17948
17293
|
setRoom: assign((context, event) => {
|
|
17949
17294
|
return {
|
|
17950
17295
|
room: event.data,
|
|
17951
17296
|
}
|
|
17952
17297
|
}),
|
|
17953
17298
|
resetContent: assign((context, event) => {
|
|
17299
|
+
console.log('resetContent');
|
|
17954
17300
|
return {
|
|
17955
17301
|
loadable: false,
|
|
17956
17302
|
isLastPage: false,
|
|
@@ -18042,32 +17388,44 @@ function game_v2_1 (request) {
|
|
|
18042
17388
|
},
|
|
18043
17389
|
services: {
|
|
18044
17390
|
getPageContent: async (context, event) => {
|
|
18045
|
-
const { room, index, additionEnable } = context;
|
|
17391
|
+
const { room, index, additionEnable, staticData } = context;
|
|
18046
17392
|
if (room.categoryId === GAME_SEARCH) {
|
|
18047
17393
|
return
|
|
17394
|
+
} else if (!request.getToken()) {
|
|
17395
|
+
const list = staticData.find((data) => data.category == room.categoryId)?.info || [];
|
|
17396
|
+
|
|
17397
|
+
return [
|
|
17398
|
+
{
|
|
17399
|
+
data: list.slice(index * 20, (index + 1) * 20),
|
|
17400
|
+
totalPage: Math.ceil(list.length / 20),
|
|
17401
|
+
timestamp: Math.floor(Date.now() / 1000),
|
|
17402
|
+
},
|
|
17403
|
+
]
|
|
18048
17404
|
} else if (additionEnable) {
|
|
18049
17405
|
const param = { categoryId: room.categoryId, index };
|
|
18050
|
-
return await Promise.all([request.send(game
|
|
17406
|
+
return await Promise.all([request.send(game.getListCategory(param)), request.send(game.getListAddition(param))])
|
|
18051
17407
|
} else {
|
|
18052
17408
|
const param = { categoryId: room.categoryId, index };
|
|
18053
|
-
return await Promise.all([request.send(game
|
|
17409
|
+
return await Promise.all([request.send(game.getListCategory(param))])
|
|
18054
17410
|
}
|
|
18055
17411
|
},
|
|
18056
17412
|
updatePageContent: async (context, event) => {
|
|
18057
17413
|
const { room, content, index, additionEnable } = context;
|
|
18058
17414
|
if (room.categoryId === GAME_SEARCH) {
|
|
18059
17415
|
return
|
|
17416
|
+
} else if (!request.getToken()) {
|
|
17417
|
+
return []
|
|
18060
17418
|
} else if (additionEnable) {
|
|
18061
17419
|
return await Promise.all([
|
|
18062
17420
|
request.send(
|
|
18063
|
-
game
|
|
17421
|
+
game.getListCategoryByRange({
|
|
18064
17422
|
categoryId: room.categoryId,
|
|
18065
17423
|
end: index,
|
|
18066
17424
|
timestamp: content.timestamp,
|
|
18067
17425
|
})
|
|
18068
17426
|
),
|
|
18069
17427
|
request.send(
|
|
18070
|
-
game
|
|
17428
|
+
game.getListAdditionByRange({
|
|
18071
17429
|
categoryId: room.categoryId,
|
|
18072
17430
|
end: index,
|
|
18073
17431
|
timestamp: content.timestamp,
|
|
@@ -18077,7 +17435,7 @@ function game_v2_1 (request) {
|
|
|
18077
17435
|
} else {
|
|
18078
17436
|
return await Promise.all([
|
|
18079
17437
|
request.send(
|
|
18080
|
-
game
|
|
17438
|
+
game.getListCategoryByRange({
|
|
18081
17439
|
categoryId: room.categoryId,
|
|
18082
17440
|
end: index,
|
|
18083
17441
|
timestamp: content.timestamp,
|
|
@@ -18099,13 +17457,13 @@ function game_v2_1 (request) {
|
|
|
18099
17457
|
lang,
|
|
18100
17458
|
return_url: window.location.href,
|
|
18101
17459
|
};
|
|
18102
|
-
const { redirect_url } = await request.send(game
|
|
17460
|
+
const { redirect_url } = await request.send(game.playGame(params));
|
|
18103
17461
|
return { gameURL: redirect_url }
|
|
18104
17462
|
},
|
|
18105
17463
|
disconnectGame: async (context, event) => {
|
|
18106
17464
|
const uid_site = event.data;
|
|
18107
17465
|
const provider_id = context.game.providerId;
|
|
18108
|
-
return await request.send(game
|
|
17466
|
+
return await request.send(game.logoutGame({ uid_site, provider_id }))
|
|
18109
17467
|
},
|
|
18110
17468
|
...oldServices(request),
|
|
18111
17469
|
},
|
|
@@ -18150,137 +17508,26 @@ const oldGuards = {
|
|
|
18150
17508
|
|
|
18151
17509
|
const oldServices = (request) => ({
|
|
18152
17510
|
fetchOption: async (context, event) => {
|
|
18153
|
-
|
|
17511
|
+
if (request.getToken()) {
|
|
17512
|
+
return await request.send(game.getOptionMap())
|
|
17513
|
+
}
|
|
18154
17514
|
},
|
|
18155
17515
|
fetchGameSHA: async (context, event) => {
|
|
18156
|
-
|
|
17516
|
+
if (request.getToken()) {
|
|
17517
|
+
return await request.send(game.getGameSHA())
|
|
17518
|
+
} else {
|
|
17519
|
+
return {
|
|
17520
|
+
status: null,
|
|
17521
|
+
}
|
|
17522
|
+
}
|
|
18157
17523
|
},
|
|
18158
17524
|
fetchStatus: async (context, event) => {
|
|
18159
|
-
|
|
17525
|
+
if (request.getToken()) {
|
|
17526
|
+
return await request.send(game.getGameStatus())
|
|
17527
|
+
}
|
|
18160
17528
|
},
|
|
18161
17529
|
});
|
|
18162
17530
|
|
|
18163
|
-
function game_favorite (request) {
|
|
18164
|
-
return createMachine(
|
|
18165
|
-
{
|
|
18166
|
-
id: 'favorite',
|
|
18167
|
-
type: 'parallel',
|
|
18168
|
-
context: {
|
|
18169
|
-
list: [],
|
|
18170
|
-
},
|
|
18171
|
-
states: {
|
|
18172
|
-
fetching: {
|
|
18173
|
-
initial: 'disable',
|
|
18174
|
-
states: {
|
|
18175
|
-
disable: {},
|
|
18176
|
-
enable: {
|
|
18177
|
-
invoke: {
|
|
18178
|
-
src: 'fetchList',
|
|
18179
|
-
onDone: {
|
|
18180
|
-
actions: 'setList',
|
|
18181
|
-
},
|
|
18182
|
-
onError: {
|
|
18183
|
-
actions: assign({ list: [] }),
|
|
18184
|
-
},
|
|
18185
|
-
},
|
|
18186
|
-
},
|
|
18187
|
-
},
|
|
18188
|
-
},
|
|
18189
|
-
adding: {
|
|
18190
|
-
initial: 'disable',
|
|
18191
|
-
states: {
|
|
18192
|
-
disable: {},
|
|
18193
|
-
enable: {
|
|
18194
|
-
invoke: {
|
|
18195
|
-
src: 'add',
|
|
18196
|
-
onDone: {},
|
|
18197
|
-
onError: {
|
|
18198
|
-
actions: 'removeFromList',
|
|
18199
|
-
},
|
|
18200
|
-
},
|
|
18201
|
-
},
|
|
18202
|
-
},
|
|
18203
|
-
},
|
|
18204
|
-
removing: {
|
|
18205
|
-
initial: 'disable',
|
|
18206
|
-
states: {
|
|
18207
|
-
disable: {},
|
|
18208
|
-
enable: {
|
|
18209
|
-
invoke: {
|
|
18210
|
-
src: 'remove',
|
|
18211
|
-
onDone: {},
|
|
18212
|
-
onError: {
|
|
18213
|
-
actions: 'addToList',
|
|
18214
|
-
},
|
|
18215
|
-
},
|
|
18216
|
-
},
|
|
18217
|
-
},
|
|
18218
|
-
},
|
|
18219
|
-
},
|
|
18220
|
-
on: {
|
|
18221
|
-
FETCH_LIST: {
|
|
18222
|
-
target: 'fetching.enable',
|
|
18223
|
-
},
|
|
18224
|
-
ADD: {
|
|
18225
|
-
target: 'adding.enable',
|
|
18226
|
-
actions: 'addToList',
|
|
18227
|
-
cond: 'isNotExist',
|
|
18228
|
-
},
|
|
18229
|
-
REMOVE: {
|
|
18230
|
-
target: 'removing.enable',
|
|
18231
|
-
actions: 'removeFromList',
|
|
18232
|
-
cond: 'isExist',
|
|
18233
|
-
},
|
|
18234
|
-
},
|
|
18235
|
-
},
|
|
18236
|
-
{
|
|
18237
|
-
actions: {
|
|
18238
|
-
setList: assign((context, event) => {
|
|
18239
|
-
return {
|
|
18240
|
-
list: event.data,
|
|
18241
|
-
}
|
|
18242
|
-
}),
|
|
18243
|
-
addToList: assign((context, event) => {
|
|
18244
|
-
return {
|
|
18245
|
-
list: [...context.list, event.data],
|
|
18246
|
-
}
|
|
18247
|
-
}),
|
|
18248
|
-
removeFromList: assign((context, event) => {
|
|
18249
|
-
return {
|
|
18250
|
-
list: context.list.filter((item) => item !== event.data),
|
|
18251
|
-
}
|
|
18252
|
-
}),
|
|
18253
|
-
},
|
|
18254
|
-
guards: {
|
|
18255
|
-
isExist: (context, event) => context.list.includes(event.data),
|
|
18256
|
-
isNotExist: (context, event) => !context.list.includes(event.data),
|
|
18257
|
-
},
|
|
18258
|
-
services: {
|
|
18259
|
-
add: async (context, event) => {
|
|
18260
|
-
try {
|
|
18261
|
-
return await request.send(game$1.addFavoriteGame(event.data))
|
|
18262
|
-
} catch (error) {
|
|
18263
|
-
throw event.data
|
|
18264
|
-
}
|
|
18265
|
-
},
|
|
18266
|
-
remove: async (context, event) => {
|
|
18267
|
-
try {
|
|
18268
|
-
return await request.send(game$1.removeFavoriteGame(event.data))
|
|
18269
|
-
} catch (error) {
|
|
18270
|
-
throw event.data
|
|
18271
|
-
}
|
|
18272
|
-
},
|
|
18273
|
-
fetchList: async (context, event) => {
|
|
18274
|
-
const main = await request.send(game$1.getGameCategory({}));
|
|
18275
|
-
const room = main.list.find((item) => item.category === 'SYSTEM_MY_FAVORITE');
|
|
18276
|
-
const favorite = await request.send(game$1.getGameCategory({ id: room.id }));
|
|
18277
|
-
return favorite.list.map((item) => item.g)
|
|
18278
|
-
},
|
|
18279
|
-
},
|
|
18280
|
-
}
|
|
18281
|
-
)
|
|
18282
|
-
}
|
|
18283
|
-
|
|
18284
17531
|
function game_favorite_v2 (request) {
|
|
18285
17532
|
return createMachine(
|
|
18286
17533
|
{
|
|
@@ -18375,7 +17622,7 @@ function game_favorite_v2 (request) {
|
|
|
18375
17622
|
services: {
|
|
18376
17623
|
add: async (context, event) => {
|
|
18377
17624
|
try {
|
|
18378
|
-
await request.send(game
|
|
17625
|
+
await request.send(game.addListFavorite(event.data.gameCode));
|
|
18379
17626
|
return event.data
|
|
18380
17627
|
} catch (error) {
|
|
18381
17628
|
throw event.data
|
|
@@ -18383,15 +17630,19 @@ function game_favorite_v2 (request) {
|
|
|
18383
17630
|
},
|
|
18384
17631
|
remove: async (context, event) => {
|
|
18385
17632
|
try {
|
|
18386
|
-
await request.send(game
|
|
17633
|
+
await request.send(game.removeListFavorite(event.data.gameCode));
|
|
18387
17634
|
return event.data
|
|
18388
17635
|
} catch (error) {
|
|
18389
17636
|
throw event.data
|
|
18390
17637
|
}
|
|
18391
17638
|
},
|
|
18392
17639
|
fetchList: async (context, event) => {
|
|
18393
|
-
|
|
18394
|
-
|
|
17640
|
+
if (request.getToken()) {
|
|
17641
|
+
const { data } = await request.send(game.getListMyFavorite());
|
|
17642
|
+
return data
|
|
17643
|
+
} else {
|
|
17644
|
+
return []
|
|
17645
|
+
}
|
|
18395
17646
|
},
|
|
18396
17647
|
},
|
|
18397
17648
|
}
|
|
@@ -18623,17 +17874,17 @@ function game_search (request) {
|
|
|
18623
17874
|
services: {
|
|
18624
17875
|
fetchTags: async (context, event) => {
|
|
18625
17876
|
const { keyword } = context;
|
|
18626
|
-
const { result } = await request.send(game
|
|
17877
|
+
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
18627
17878
|
return result
|
|
18628
17879
|
},
|
|
18629
17880
|
fetchGames: async (context, event) => {
|
|
18630
17881
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
18631
|
-
const { traceId, result } = await request.send(game
|
|
17882
|
+
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
18632
17883
|
return { traceId, result }
|
|
18633
17884
|
},
|
|
18634
17885
|
sendTrace: async (context, event) => {
|
|
18635
17886
|
const { traceId, tagId, tagIndex, gameCode, gameCodeIndex, keyword: query, click, clickDefault } = context;
|
|
18636
|
-
return await request.send(game
|
|
17887
|
+
return await request.send(game.setGameSearchTrace({ traceId, tagId, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault }))
|
|
18637
17888
|
},
|
|
18638
17889
|
},
|
|
18639
17890
|
}
|
|
@@ -18966,16 +18217,16 @@ function game_search_v2 (request) {
|
|
|
18966
18217
|
services: {
|
|
18967
18218
|
fetchTags: async (context, event) => {
|
|
18968
18219
|
const { keyword } = context;
|
|
18969
|
-
const { result } = await request.send(game
|
|
18220
|
+
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
18970
18221
|
return result
|
|
18971
18222
|
},
|
|
18972
18223
|
fetchInitialData: async (context, event) => {
|
|
18973
|
-
const data = await request.send(game
|
|
18224
|
+
const data = await request.send(game.getGameSearchHome());
|
|
18974
18225
|
return data
|
|
18975
18226
|
},
|
|
18976
18227
|
fetchGames: async (context, event) => {
|
|
18977
18228
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
18978
|
-
const { traceId, result } = await request.send(game
|
|
18229
|
+
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
18979
18230
|
return { traceId, result }
|
|
18980
18231
|
},
|
|
18981
18232
|
sendTrace: async (context, event) => {
|
|
@@ -18997,7 +18248,7 @@ function game_search_v2 (request) {
|
|
|
18997
18248
|
id = null;
|
|
18998
18249
|
}
|
|
18999
18250
|
return await request.send(
|
|
19000
|
-
game
|
|
18251
|
+
game.setGameSearchTrace({
|
|
19001
18252
|
traceId,
|
|
19002
18253
|
tagId: id,
|
|
19003
18254
|
tagIndex,
|
|
@@ -19078,12 +18329,12 @@ function game_hot_new (request) {
|
|
|
19078
18329
|
},
|
|
19079
18330
|
services: {
|
|
19080
18331
|
getRoomItems: async (context, event) => {
|
|
19081
|
-
return await request.send(game
|
|
18332
|
+
return await request.send(game.getGameCategory({ id: context.roomId }))
|
|
19082
18333
|
},
|
|
19083
18334
|
getGames: async (context, event) => {
|
|
19084
18335
|
const [resHot, resNew] = await Promise.all([
|
|
19085
|
-
request.send(game
|
|
19086
|
-
request.send(game
|
|
18336
|
+
request.send(game.getGameCategory({ id: context.hot.id })),
|
|
18337
|
+
request.send(game.getGameCategory({ id: context.new.id })),
|
|
19087
18338
|
]);
|
|
19088
18339
|
const hotGames = resHot?.list?.map?.((item) => item.g);
|
|
19089
18340
|
const newGames = resNew?.list?.map?.((item) => item.g);
|
|
@@ -19923,7 +19174,7 @@ function side (request) {
|
|
|
19923
19174
|
},
|
|
19924
19175
|
services: {
|
|
19925
19176
|
getRoomItems: async (context, event) => {
|
|
19926
|
-
return await request.send(game
|
|
19177
|
+
return await request.send(game.getGameCategory({ id: context.room?.id }))
|
|
19927
19178
|
},
|
|
19928
19179
|
},
|
|
19929
19180
|
}
|
|
@@ -20087,10 +19338,10 @@ function side_v2 (request) {
|
|
|
20087
19338
|
},
|
|
20088
19339
|
services: {
|
|
20089
19340
|
getMenu: async (context, event) => {
|
|
20090
|
-
return await request.send(game
|
|
19341
|
+
return await request.send(game.getListRoot())
|
|
20091
19342
|
},
|
|
20092
19343
|
fetchUpdateMenu: async (context, event) => {
|
|
20093
|
-
return await request.send(game
|
|
19344
|
+
return await request.send(game.getListRoot({ timestamp: context.menu.timestamp }))
|
|
20094
19345
|
},
|
|
20095
19346
|
},
|
|
20096
19347
|
}
|
|
@@ -23382,13 +22633,20 @@ function loadcard_vn (request) {
|
|
|
23382
22633
|
setInitData: assign((context, event) => {
|
|
23383
22634
|
const { siteConfig, paymentDetail } = event.data;
|
|
23384
22635
|
const cards = paymentDetail.filter((element) => element.category === context.currentCategory);
|
|
22636
|
+
let selectedCard = null;
|
|
22637
|
+
if (siteConfig.walletMode === '4') {
|
|
22638
|
+
selectedCard = cards.find((card) => parseFloat(`${card.charge || 0}`) === 0);
|
|
22639
|
+
} else {
|
|
22640
|
+
selectedCard = cards[0];
|
|
22641
|
+
}
|
|
22642
|
+
|
|
23385
22643
|
return {
|
|
23386
22644
|
siteConfig,
|
|
23387
22645
|
paymentDetail,
|
|
23388
22646
|
cards,
|
|
23389
|
-
selectedCard
|
|
23390
|
-
currentMethod:
|
|
23391
|
-
options:
|
|
22647
|
+
selectedCard,
|
|
22648
|
+
currentMethod: selectedCard?.method,
|
|
22649
|
+
options: selectedCard?.optional,
|
|
23392
22650
|
}
|
|
23393
22651
|
}),
|
|
23394
22652
|
setBonusPreview: assign((context, event) => {
|
|
@@ -23821,15 +23079,21 @@ function qrcode_v2 (request) {
|
|
|
23821
23079
|
setInitData: assign((context, event) => {
|
|
23822
23080
|
const { siteConfig, paymentDetail } = event.data;
|
|
23823
23081
|
const qrcodes = paymentDetail.filter((element) => element.category === context.currentCategory);
|
|
23082
|
+
let selectedQrcode = null;
|
|
23083
|
+
if (siteConfig.walletMode === '4') {
|
|
23084
|
+
selectedQrcode = qrcodes.find((qrcode) => parseFloat(`${qrcode.charge || 0}`) === 0);
|
|
23085
|
+
} else {
|
|
23086
|
+
selectedQrcode = qrcodes[0];
|
|
23087
|
+
}
|
|
23824
23088
|
|
|
23825
23089
|
return {
|
|
23826
23090
|
siteConfig,
|
|
23827
23091
|
paymentDetail,
|
|
23828
23092
|
qrcodes,
|
|
23829
|
-
selectedQrcode
|
|
23830
|
-
currentMethod:
|
|
23831
|
-
options:
|
|
23832
|
-
grandTotalEnable:
|
|
23093
|
+
selectedQrcode,
|
|
23094
|
+
currentMethod: selectedQrcode?.method,
|
|
23095
|
+
options: selectedQrcode?.optional,
|
|
23096
|
+
grandTotalEnable: selectedQrcode?.grandTotalEnable,
|
|
23833
23097
|
}
|
|
23834
23098
|
}),
|
|
23835
23099
|
setBonusPreview: assign((context, event) => {
|
|
@@ -25418,13 +24682,19 @@ function direct (request) {
|
|
|
25418
24682
|
setInitData: assign((context, event) => {
|
|
25419
24683
|
const { siteConfig, paymentDetail } = event.data;
|
|
25420
24684
|
const directs = paymentDetail.filter((element) => element.category === context.currentCategory);
|
|
24685
|
+
let currentDirect = null;
|
|
24686
|
+
if (siteConfig.walletMode === '4') {
|
|
24687
|
+
currentDirect = directs.find((direct) => parseFloat(`${direct.charge || 0}`) === 0);
|
|
24688
|
+
} else {
|
|
24689
|
+
currentDirect = directs[0];
|
|
24690
|
+
}
|
|
25421
24691
|
|
|
25422
24692
|
return {
|
|
25423
24693
|
siteConfig,
|
|
25424
24694
|
paymentDetail,
|
|
25425
24695
|
directs,
|
|
25426
|
-
currentDirect
|
|
25427
|
-
currentMethod:
|
|
24696
|
+
currentDirect,
|
|
24697
|
+
currentMethod: currentDirect?.method,
|
|
25428
24698
|
}
|
|
25429
24699
|
}),
|
|
25430
24700
|
setBanks: assign((context, event) => {
|
|
@@ -27601,9 +26871,6 @@ var index$1 = {
|
|
|
27601
26871
|
common,
|
|
27602
26872
|
deposit,
|
|
27603
26873
|
error,
|
|
27604
|
-
game,
|
|
27605
|
-
game_v2,
|
|
27606
|
-
game_favorite,
|
|
27607
26874
|
game_favorite_v2,
|
|
27608
26875
|
game_search,
|
|
27609
26876
|
game_search_v2,
|
|
@@ -27657,8 +26924,8 @@ class Request {
|
|
|
27657
26924
|
this.axios.interceptors.request.use((axiosConfig) => {
|
|
27658
26925
|
axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version;
|
|
27659
26926
|
axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform;
|
|
27660
|
-
if (
|
|
27661
|
-
axiosConfig.headers.Authorization =
|
|
26927
|
+
if (this.getToken()) {
|
|
26928
|
+
axiosConfig.headers.Authorization = this.getToken();
|
|
27662
26929
|
}
|
|
27663
26930
|
return axiosConfig
|
|
27664
26931
|
});
|
|
@@ -27686,7 +26953,7 @@ class Request {
|
|
|
27686
26953
|
async send(req, customToken) {
|
|
27687
26954
|
try {
|
|
27688
26955
|
const cancelToken = customToken || this.source.token;
|
|
27689
|
-
this._checkToken(req
|
|
26956
|
+
this._checkToken(req);
|
|
27690
26957
|
const requestConfig = this._createConfig(req, cancelToken);
|
|
27691
26958
|
const { data } = await this.axios.request(requestConfig);
|
|
27692
26959
|
return data
|
|
@@ -27732,12 +26999,16 @@ class Request {
|
|
|
27732
26999
|
}
|
|
27733
27000
|
}
|
|
27734
27001
|
|
|
27735
|
-
_checkToken(req
|
|
27736
|
-
if (!req.isPublic && !
|
|
27002
|
+
_checkToken(req) {
|
|
27003
|
+
if (!req.isPublic && !this.getToken()) {
|
|
27737
27004
|
console.error(req);
|
|
27738
27005
|
throw { code: 'ERR_A103', url: req.url }
|
|
27739
27006
|
}
|
|
27740
27007
|
}
|
|
27008
|
+
|
|
27009
|
+
getToken() {
|
|
27010
|
+
return storage.get(this.key)
|
|
27011
|
+
}
|
|
27741
27012
|
}
|
|
27742
27013
|
|
|
27743
27014
|
// const urljoin = require('url-join')
|