@jetthai/cuora 1.1.90 → 1.1.92-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 +12 -0
- package/dist/bundle.mjs +583 -1334
- package/package.json +1 -1
- package/src/api/activity.js +13 -1
- package/src/api/auth.js +2 -2
- package/src/api/user.js +5 -0
- package/src/machine/activity/deposit_activity.js +2 -2
- package/src/machine/activity/diamond_shop_activity_cash.js +214 -0
- package/src/machine/activity/fafafa_activity.js +35 -11
- package/src/machine/activity/{affiliate_invite_friends_activity.js → friend_invite_friends_activity.js} +23 -23
- package/src/machine/activity/index.js +4 -2
- package/src/machine/activity/invite_friends_activity.js +13 -13
- package/src/machine/activity/ranking_activity.js +31 -2
- package/src/machine/activity/specify_bets_activity.js +44 -3
- package/src/machine/activity/specify_turnover_activity.js +44 -3
- package/src/machine/auth.js +7 -7
- package/src/machine/common.js +4 -4
- package/src/machine/deposit/index.js +4 -0
- package/src/machine/deposit/manual_cash.js +321 -0
- package/src/machine/deposit/qrcode_cash.js +258 -0
- package/src/machine/game_favorite_v2.js +6 -2
- package/src/machine/game_v2_1.js +35 -9
- package/src/machine/index.js +4 -6
- package/src/machine/reward_cash.js +220 -0
- package/src/machine/side_cash.js +198 -0
- package/src/machine/user_info.js +8 -2
- package/src/machine/user_sign_up.js +8 -8
- package/src/machine/withdraw/withdraw_activity.js +383 -0
- package/src/request/request.js +9 -5
- package/src/util/index.js +2 -1
- package/src/util/math.js +4 -0
- 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
|
@@ -3582,8 +3582,8 @@ var auth$1 = {
|
|
|
3582
3582
|
},
|
|
3583
3583
|
isPublic: true,
|
|
3584
3584
|
}),
|
|
3585
|
-
register: ({ channel, subchannel,
|
|
3586
|
-
const params = pickBy_1({ channel, subchannel,
|
|
3585
|
+
register: ({ channel, subchannel, ac, fc = null, reCaptchaToken, dt, ...rest }) => {
|
|
3586
|
+
const params = pickBy_1({ channel, subchannel, ac, fc }, (value) => {
|
|
3587
3587
|
return value !== undefined && value !== null
|
|
3588
3588
|
});
|
|
3589
3589
|
const qs = Object.keys(params)
|
|
@@ -3614,7 +3614,7 @@ var common$1 = {
|
|
|
3614
3614
|
getAnnouncements: () => ({ url: 'getAnnouncements', method: 'get', isPublic: true }),
|
|
3615
3615
|
};
|
|
3616
3616
|
|
|
3617
|
-
var game
|
|
3617
|
+
var game = {
|
|
3618
3618
|
getGameSHA: () => ({ method: 'get', url: 'game/list/v2/sha' }),
|
|
3619
3619
|
getOptionMap: (code) => ({ method: 'get', url: 'game/list/v2/options', params: { code } }),
|
|
3620
3620
|
getGameStatus: () => ({ method: 'get', url: 'game/list/v2/status' }),
|
|
@@ -3885,6 +3885,11 @@ var user = {
|
|
|
3885
3885
|
getAffiliateDashboard: () => ({ url: 'affiliate/dashboard', method: 'get' }),
|
|
3886
3886
|
getAffiliateDashboardList: ({ level, page, row }) => ({ url: 'affiliate/dashboard/list', method: 'post', params: { level, page, row } }),
|
|
3887
3887
|
postAffiliate: ({ affiliateCode }) => ({ url: 'affiliate', method: 'post', params: { affiliateCode } }),
|
|
3888
|
+
getFriends: () => ({ url: 'friends', method: 'get' }),
|
|
3889
|
+
getFriendsHome: () => ({ url: 'friends/home', method: 'get' }),
|
|
3890
|
+
getFriendsDashboard: () => ({ url: 'friends/dashboard', method: 'get' }),
|
|
3891
|
+
getFriendsDashboardList: ({ level, page, row }) => ({ url: 'friends/dashboard/list', method: 'post', params: { level, page, row } }),
|
|
3892
|
+
postFriends: ({ friendCode }) => ({ url: 'friends', method: 'post', params: { friendCode } }),
|
|
3888
3893
|
passwordRecovery: (recoveryData) => ({ url: 'recovery', method: 'post', params: recoveryData, isPublic: true }),
|
|
3889
3894
|
passwordAbandon: ({ number }) => ({ url: 'recovery/abandon', method: 'post', params: { number }, isPublic: true }),
|
|
3890
3895
|
passwordAcknowledge: (acknowledgeData) => ({ url: 'recovery/acknowledge', method: 'post', params: acknowledgeData, isPublic: true }),
|
|
@@ -3929,79 +3934,79 @@ var form = {
|
|
|
3929
3934
|
upload: (formData) => ({ url: 'upload', method: 'post', params: formData, isFormData: true }),
|
|
3930
3935
|
};
|
|
3931
3936
|
|
|
3932
|
-
var index$2 = { activity: api, auth: auth$1, common: common$1, game
|
|
3933
|
-
|
|
3934
|
-
/*! *****************************************************************************
|
|
3935
|
-
Copyright (c) Microsoft Corporation.
|
|
3936
|
-
|
|
3937
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
3938
|
-
purpose with or without fee is hereby granted.
|
|
3939
|
-
|
|
3940
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
3941
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
3942
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
3943
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
3944
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
3945
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3946
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
3947
|
-
***************************************************************************** */
|
|
3948
|
-
|
|
3949
|
-
var __assign = function() {
|
|
3950
|
-
__assign = Object.assign || function __assign(t) {
|
|
3951
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3952
|
-
s = arguments[i];
|
|
3953
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
3954
|
-
}
|
|
3955
|
-
return t;
|
|
3956
|
-
};
|
|
3957
|
-
return __assign.apply(this, arguments);
|
|
3958
|
-
};
|
|
3959
|
-
|
|
3960
|
-
function __rest(s, e) {
|
|
3961
|
-
var t = {};
|
|
3962
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3963
|
-
t[p] = s[p];
|
|
3964
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
3965
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3966
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
3967
|
-
t[p[i]] = s[p[i]];
|
|
3968
|
-
}
|
|
3969
|
-
return t;
|
|
3970
|
-
}
|
|
3971
|
-
|
|
3972
|
-
function __values(o) {
|
|
3973
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3974
|
-
if (m) return m.call(o);
|
|
3975
|
-
if (o && typeof o.length === "number") return {
|
|
3976
|
-
next: function () {
|
|
3977
|
-
if (o && i >= o.length) o = void 0;
|
|
3978
|
-
return { value: o && o[i++], done: !o };
|
|
3979
|
-
}
|
|
3980
|
-
};
|
|
3981
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
3982
|
-
}
|
|
3983
|
-
|
|
3984
|
-
function __read(o, n) {
|
|
3985
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3986
|
-
if (!m) return o;
|
|
3987
|
-
var i = m.call(o), r, ar = [], e;
|
|
3988
|
-
try {
|
|
3989
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
3990
|
-
}
|
|
3991
|
-
catch (error) { e = { error: error }; }
|
|
3992
|
-
finally {
|
|
3993
|
-
try {
|
|
3994
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
3995
|
-
}
|
|
3996
|
-
finally { if (e) throw e.error; }
|
|
3997
|
-
}
|
|
3998
|
-
return ar;
|
|
3999
|
-
}
|
|
4000
|
-
|
|
4001
|
-
function __spreadArray(to, from) {
|
|
4002
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
4003
|
-
to[j] = from[i];
|
|
4004
|
-
return to;
|
|
3937
|
+
var index$2 = { activity: api, auth: auth$1, common: common$1, game, mailbox, payment, user, form };
|
|
3938
|
+
|
|
3939
|
+
/*! *****************************************************************************
|
|
3940
|
+
Copyright (c) Microsoft Corporation.
|
|
3941
|
+
|
|
3942
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
3943
|
+
purpose with or without fee is hereby granted.
|
|
3944
|
+
|
|
3945
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
3946
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
3947
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
3948
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
3949
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
3950
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3951
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
3952
|
+
***************************************************************************** */
|
|
3953
|
+
|
|
3954
|
+
var __assign = function() {
|
|
3955
|
+
__assign = Object.assign || function __assign(t) {
|
|
3956
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3957
|
+
s = arguments[i];
|
|
3958
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
3959
|
+
}
|
|
3960
|
+
return t;
|
|
3961
|
+
};
|
|
3962
|
+
return __assign.apply(this, arguments);
|
|
3963
|
+
};
|
|
3964
|
+
|
|
3965
|
+
function __rest(s, e) {
|
|
3966
|
+
var t = {};
|
|
3967
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3968
|
+
t[p] = s[p];
|
|
3969
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
3970
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3971
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
3972
|
+
t[p[i]] = s[p[i]];
|
|
3973
|
+
}
|
|
3974
|
+
return t;
|
|
3975
|
+
}
|
|
3976
|
+
|
|
3977
|
+
function __values(o) {
|
|
3978
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3979
|
+
if (m) return m.call(o);
|
|
3980
|
+
if (o && typeof o.length === "number") return {
|
|
3981
|
+
next: function () {
|
|
3982
|
+
if (o && i >= o.length) o = void 0;
|
|
3983
|
+
return { value: o && o[i++], done: !o };
|
|
3984
|
+
}
|
|
3985
|
+
};
|
|
3986
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
3987
|
+
}
|
|
3988
|
+
|
|
3989
|
+
function __read(o, n) {
|
|
3990
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3991
|
+
if (!m) return o;
|
|
3992
|
+
var i = m.call(o), r, ar = [], e;
|
|
3993
|
+
try {
|
|
3994
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
3995
|
+
}
|
|
3996
|
+
catch (error) { e = { error: error }; }
|
|
3997
|
+
finally {
|
|
3998
|
+
try {
|
|
3999
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
4000
|
+
}
|
|
4001
|
+
finally { if (e) throw e.error; }
|
|
4002
|
+
}
|
|
4003
|
+
return ar;
|
|
4004
|
+
}
|
|
4005
|
+
|
|
4006
|
+
function __spreadArray(to, from) {
|
|
4007
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
4008
|
+
to[j] = from[i];
|
|
4009
|
+
return to;
|
|
4005
4010
|
}
|
|
4006
4011
|
|
|
4007
4012
|
var STATE_DELIMITER = '.';
|
|
@@ -4138,9 +4143,9 @@ function mapFilterValues(collection, iteratee, predicate) {
|
|
|
4138
4143
|
|
|
4139
4144
|
return result;
|
|
4140
4145
|
}
|
|
4141
|
-
/**
|
|
4142
|
-
* Retrieves a value at the given path.
|
|
4143
|
-
* @param props The deep path to the prop of the desired value
|
|
4146
|
+
/**
|
|
4147
|
+
* Retrieves a value at the given path.
|
|
4148
|
+
* @param props The deep path to the prop of the desired value
|
|
4144
4149
|
*/
|
|
4145
4150
|
|
|
4146
4151
|
var path = function (props) {
|
|
@@ -4169,9 +4174,9 @@ var path = function (props) {
|
|
|
4169
4174
|
return result;
|
|
4170
4175
|
};
|
|
4171
4176
|
};
|
|
4172
|
-
/**
|
|
4173
|
-
* Retrieves a value at the given path via the nested accessor prop.
|
|
4174
|
-
* @param props The deep path to the prop of the desired value
|
|
4177
|
+
/**
|
|
4178
|
+
* Retrieves a value at the given path via the nested accessor prop.
|
|
4179
|
+
* @param props The deep path to the prop of the desired value
|
|
4175
4180
|
*/
|
|
4176
4181
|
|
|
4177
4182
|
function nestedPath(props, accessorProp) {
|
|
@@ -4619,11 +4624,11 @@ function toActivityDefinition(action) {
|
|
|
4619
4624
|
type: actionObject.type
|
|
4620
4625
|
});
|
|
4621
4626
|
}
|
|
4622
|
-
/**
|
|
4623
|
-
* Raises an event. This places the event in the internal event queue, so that
|
|
4624
|
-
* the event is immediately consumed by the machine in the current step.
|
|
4625
|
-
*
|
|
4626
|
-
* @param eventType The event to raise.
|
|
4627
|
+
/**
|
|
4628
|
+
* Raises an event. This places the event in the internal event queue, so that
|
|
4629
|
+
* the event is immediately consumed by the machine in the current step.
|
|
4630
|
+
*
|
|
4631
|
+
* @param eventType The event to raise.
|
|
4627
4632
|
*/
|
|
4628
4633
|
|
|
4629
4634
|
function raise(event) {
|
|
@@ -4644,15 +4649,15 @@ function resolveRaise(action) {
|
|
|
4644
4649
|
_event: toSCXMLEvent(action.event)
|
|
4645
4650
|
};
|
|
4646
4651
|
}
|
|
4647
|
-
/**
|
|
4648
|
-
* Sends an event. This returns an action that will be read by an interpreter to
|
|
4649
|
-
* send the event in the next step, after the current step is finished executing.
|
|
4650
|
-
*
|
|
4651
|
-
* @param event The event to send.
|
|
4652
|
-
* @param options Options to pass into the send event:
|
|
4653
|
-
* - `id` - The unique send event identifier (used with `cancel()`).
|
|
4654
|
-
* - `delay` - The number of milliseconds to delay the sending of the event.
|
|
4655
|
-
* - `to` - The target of this event (by default, the machine the event was sent from).
|
|
4652
|
+
/**
|
|
4653
|
+
* Sends an event. This returns an action that will be read by an interpreter to
|
|
4654
|
+
* send the event in the next step, after the current step is finished executing.
|
|
4655
|
+
*
|
|
4656
|
+
* @param event The event to send.
|
|
4657
|
+
* @param options Options to pass into the send event:
|
|
4658
|
+
* - `id` - The unique send event identifier (used with `cancel()`).
|
|
4659
|
+
* - `delay` - The number of milliseconds to delay the sending of the event.
|
|
4660
|
+
* - `to` - The target of this event (by default, the machine the event was sent from).
|
|
4656
4661
|
*/
|
|
4657
4662
|
|
|
4658
4663
|
function send(event, options) {
|
|
@@ -4694,12 +4699,12 @@ var resolveLog = function (action, ctx, _event) {
|
|
|
4694
4699
|
})
|
|
4695
4700
|
});
|
|
4696
4701
|
};
|
|
4697
|
-
/**
|
|
4698
|
-
* Cancels an in-flight `send(...)` action. A canceled sent action will not
|
|
4699
|
-
* be executed, nor will its event be sent, unless it has already been sent
|
|
4700
|
-
* (e.g., if `cancel(...)` is called after the `send(...)` action's `delay`).
|
|
4701
|
-
*
|
|
4702
|
-
* @param sendId The `id` of the `send(...)` action to cancel.
|
|
4702
|
+
/**
|
|
4703
|
+
* Cancels an in-flight `send(...)` action. A canceled sent action will not
|
|
4704
|
+
* be executed, nor will its event be sent, unless it has already been sent
|
|
4705
|
+
* (e.g., if `cancel(...)` is called after the `send(...)` action's `delay`).
|
|
4706
|
+
*
|
|
4707
|
+
* @param sendId The `id` of the `send(...)` action to cancel.
|
|
4703
4708
|
*/
|
|
4704
4709
|
|
|
4705
4710
|
var cancel = function (sendId) {
|
|
@@ -4708,10 +4713,10 @@ var cancel = function (sendId) {
|
|
|
4708
4713
|
sendId: sendId
|
|
4709
4714
|
};
|
|
4710
4715
|
};
|
|
4711
|
-
/**
|
|
4712
|
-
* Starts an activity.
|
|
4713
|
-
*
|
|
4714
|
-
* @param activity The activity to start.
|
|
4716
|
+
/**
|
|
4717
|
+
* Starts an activity.
|
|
4718
|
+
*
|
|
4719
|
+
* @param activity The activity to start.
|
|
4715
4720
|
*/
|
|
4716
4721
|
|
|
4717
4722
|
function start(activity) {
|
|
@@ -4722,10 +4727,10 @@ function start(activity) {
|
|
|
4722
4727
|
exec: undefined
|
|
4723
4728
|
};
|
|
4724
4729
|
}
|
|
4725
|
-
/**
|
|
4726
|
-
* Stops an activity.
|
|
4727
|
-
*
|
|
4728
|
-
* @param actorRef The activity to stop.
|
|
4730
|
+
/**
|
|
4731
|
+
* Stops an activity.
|
|
4732
|
+
*
|
|
4733
|
+
* @param actorRef The activity to stop.
|
|
4729
4734
|
*/
|
|
4730
4735
|
|
|
4731
4736
|
function stop(actorRef) {
|
|
@@ -4747,10 +4752,10 @@ function resolveStop(action, context, _event) {
|
|
|
4747
4752
|
};
|
|
4748
4753
|
return actionObject;
|
|
4749
4754
|
}
|
|
4750
|
-
/**
|
|
4751
|
-
* Updates the current context of the machine.
|
|
4752
|
-
*
|
|
4753
|
-
* @param assignment An object that represents the partial context to update.
|
|
4755
|
+
/**
|
|
4756
|
+
* Updates the current context of the machine.
|
|
4757
|
+
*
|
|
4758
|
+
* @param assignment An object that represents the partial context to update.
|
|
4754
4759
|
*/
|
|
4755
4760
|
|
|
4756
4761
|
var assign = function (assignment) {
|
|
@@ -4759,24 +4764,24 @@ var assign = function (assignment) {
|
|
|
4759
4764
|
assignment: assignment
|
|
4760
4765
|
};
|
|
4761
4766
|
};
|
|
4762
|
-
/**
|
|
4763
|
-
* Returns an event type that represents an implicit event that
|
|
4764
|
-
* is sent after the specified `delay`.
|
|
4765
|
-
*
|
|
4766
|
-
* @param delayRef The delay in milliseconds
|
|
4767
|
-
* @param id The state node ID where this event is handled
|
|
4767
|
+
/**
|
|
4768
|
+
* Returns an event type that represents an implicit event that
|
|
4769
|
+
* is sent after the specified `delay`.
|
|
4770
|
+
*
|
|
4771
|
+
* @param delayRef The delay in milliseconds
|
|
4772
|
+
* @param id The state node ID where this event is handled
|
|
4768
4773
|
*/
|
|
4769
4774
|
|
|
4770
4775
|
function after(delayRef, id) {
|
|
4771
4776
|
var idSuffix = id ? "#" + id : '';
|
|
4772
4777
|
return ActionTypes.After + "(" + delayRef + ")" + idSuffix;
|
|
4773
4778
|
}
|
|
4774
|
-
/**
|
|
4775
|
-
* Returns an event that represents that a final state node
|
|
4776
|
-
* has been reached in the parent state node.
|
|
4777
|
-
*
|
|
4778
|
-
* @param id The final state node's parent state node `id`
|
|
4779
|
-
* @param data The data to pass into the event
|
|
4779
|
+
/**
|
|
4780
|
+
* Returns an event that represents that a final state node
|
|
4781
|
+
* has been reached in the parent state node.
|
|
4782
|
+
*
|
|
4783
|
+
* @param id The final state node's parent state node `id`
|
|
4784
|
+
* @param data The data to pass into the event
|
|
4780
4785
|
*/
|
|
4781
4786
|
|
|
4782
4787
|
function done(id, data) {
|
|
@@ -4792,14 +4797,14 @@ function done(id, data) {
|
|
|
4792
4797
|
|
|
4793
4798
|
return eventObject;
|
|
4794
4799
|
}
|
|
4795
|
-
/**
|
|
4796
|
-
* Returns an event that represents that an invoked service has terminated.
|
|
4797
|
-
*
|
|
4798
|
-
* An invoked service is terminated when it has reached a top-level final state node,
|
|
4799
|
-
* but not when it is canceled.
|
|
4800
|
-
*
|
|
4801
|
-
* @param id The final state node ID
|
|
4802
|
-
* @param data The data to pass into the event
|
|
4800
|
+
/**
|
|
4801
|
+
* Returns an event that represents that an invoked service has terminated.
|
|
4802
|
+
*
|
|
4803
|
+
* An invoked service is terminated when it has reached a top-level final state node,
|
|
4804
|
+
* but not when it is canceled.
|
|
4805
|
+
*
|
|
4806
|
+
* @param id The final state node ID
|
|
4807
|
+
* @param data The data to pass into the event
|
|
4803
4808
|
*/
|
|
4804
4809
|
|
|
4805
4810
|
function doneInvoke(id, data) {
|
|
@@ -5210,17 +5215,17 @@ var State =
|
|
|
5210
5215
|
|
|
5211
5216
|
/** @class */
|
|
5212
5217
|
function () {
|
|
5213
|
-
/**
|
|
5214
|
-
* Creates a new State instance.
|
|
5215
|
-
* @param value The state value
|
|
5216
|
-
* @param context The extended state
|
|
5217
|
-
* @param historyValue The tree representing historical values of the state nodes
|
|
5218
|
-
* @param history The previous state
|
|
5219
|
-
* @param actions An array of action objects to execute as side-effects
|
|
5220
|
-
* @param activities A mapping of activities and whether they are started (`true`) or stopped (`false`).
|
|
5221
|
-
* @param meta
|
|
5222
|
-
* @param events Internal event queue. Should be empty with run-to-completion semantics.
|
|
5223
|
-
* @param configuration
|
|
5218
|
+
/**
|
|
5219
|
+
* Creates a new State instance.
|
|
5220
|
+
* @param value The state value
|
|
5221
|
+
* @param context The extended state
|
|
5222
|
+
* @param historyValue The tree representing historical values of the state nodes
|
|
5223
|
+
* @param history The previous state
|
|
5224
|
+
* @param actions An array of action objects to execute as side-effects
|
|
5225
|
+
* @param activities A mapping of activities and whether they are started (`true`) or stopped (`false`).
|
|
5226
|
+
* @param meta
|
|
5227
|
+
* @param events Internal event queue. Should be empty with run-to-completion semantics.
|
|
5228
|
+
* @param configuration
|
|
5224
5229
|
*/
|
|
5225
5230
|
function State(config) {
|
|
5226
5231
|
var _this = this;
|
|
@@ -5256,10 +5261,10 @@ function () {
|
|
|
5256
5261
|
}
|
|
5257
5262
|
});
|
|
5258
5263
|
}
|
|
5259
|
-
/**
|
|
5260
|
-
* Creates a new State instance for the given `stateValue` and `context`.
|
|
5261
|
-
* @param stateValue
|
|
5262
|
-
* @param context
|
|
5264
|
+
/**
|
|
5265
|
+
* Creates a new State instance for the given `stateValue` and `context`.
|
|
5266
|
+
* @param stateValue
|
|
5267
|
+
* @param context
|
|
5263
5268
|
*/
|
|
5264
5269
|
|
|
5265
5270
|
|
|
@@ -5303,19 +5308,19 @@ function () {
|
|
|
5303
5308
|
children: {}
|
|
5304
5309
|
});
|
|
5305
5310
|
};
|
|
5306
|
-
/**
|
|
5307
|
-
* Creates a new State instance for the given `config`.
|
|
5308
|
-
* @param config The state config
|
|
5311
|
+
/**
|
|
5312
|
+
* Creates a new State instance for the given `config`.
|
|
5313
|
+
* @param config The state config
|
|
5309
5314
|
*/
|
|
5310
5315
|
|
|
5311
5316
|
|
|
5312
5317
|
State.create = function (config) {
|
|
5313
5318
|
return new State(config);
|
|
5314
5319
|
};
|
|
5315
|
-
/**
|
|
5316
|
-
* Creates a new `State` instance for the given `stateValue` and `context` with no actions (side-effects).
|
|
5317
|
-
* @param stateValue
|
|
5318
|
-
* @param context
|
|
5320
|
+
/**
|
|
5321
|
+
* Creates a new `State` instance for the given `stateValue` and `context` with no actions (side-effects).
|
|
5322
|
+
* @param stateValue
|
|
5323
|
+
* @param context
|
|
5319
5324
|
*/
|
|
5320
5325
|
|
|
5321
5326
|
|
|
@@ -5342,10 +5347,10 @@ function () {
|
|
|
5342
5347
|
|
|
5343
5348
|
return State.from(stateValue, context);
|
|
5344
5349
|
};
|
|
5345
|
-
/**
|
|
5346
|
-
* Returns an array of all the string leaf state node paths.
|
|
5347
|
-
* @param stateValue
|
|
5348
|
-
* @param delimiter The character(s) that separate each subpath in the string state node path.
|
|
5350
|
+
/**
|
|
5351
|
+
* Returns an array of all the string leaf state node paths.
|
|
5352
|
+
* @param stateValue
|
|
5353
|
+
* @param delimiter The character(s) that separate each subpath in the string state node path.
|
|
5349
5354
|
*/
|
|
5350
5355
|
|
|
5351
5356
|
|
|
@@ -5384,28 +5389,28 @@ function () {
|
|
|
5384
5389
|
tags: Array.from(tags)
|
|
5385
5390
|
});
|
|
5386
5391
|
};
|
|
5387
|
-
/**
|
|
5388
|
-
* Whether the current state value is a subset of the given parent state value.
|
|
5389
|
-
* @param parentStateValue
|
|
5392
|
+
/**
|
|
5393
|
+
* Whether the current state value is a subset of the given parent state value.
|
|
5394
|
+
* @param parentStateValue
|
|
5390
5395
|
*/
|
|
5391
5396
|
|
|
5392
5397
|
|
|
5393
5398
|
State.prototype.matches = function (parentStateValue) {
|
|
5394
5399
|
return matchesState(parentStateValue, this.value);
|
|
5395
5400
|
};
|
|
5396
|
-
/**
|
|
5397
|
-
* Whether the current state configuration has a state node with the specified `tag`.
|
|
5398
|
-
* @param tag
|
|
5401
|
+
/**
|
|
5402
|
+
* Whether the current state configuration has a state node with the specified `tag`.
|
|
5403
|
+
* @param tag
|
|
5399
5404
|
*/
|
|
5400
5405
|
|
|
5401
5406
|
|
|
5402
5407
|
State.prototype.hasTag = function (tag) {
|
|
5403
5408
|
return this.tags.has(tag);
|
|
5404
5409
|
};
|
|
5405
|
-
/**
|
|
5406
|
-
* Determines whether sending the `event` will cause a transition.
|
|
5407
|
-
* @param event The event to test
|
|
5408
|
-
* @returns Whether the event will cause a transition
|
|
5410
|
+
/**
|
|
5411
|
+
* Determines whether sending the `event` will cause a transition.
|
|
5412
|
+
* @param event The event to test
|
|
5413
|
+
* @returns Whether the event will cause a transition
|
|
5409
5414
|
*/
|
|
5410
5415
|
|
|
5411
5416
|
|
|
@@ -5422,9 +5427,9 @@ function () {
|
|
|
5422
5427
|
return State;
|
|
5423
5428
|
}();
|
|
5424
5429
|
|
|
5425
|
-
/**
|
|
5426
|
-
* Maintains a stack of the current service in scope.
|
|
5427
|
-
* This is used to provide the correct service to spawn().
|
|
5430
|
+
/**
|
|
5431
|
+
* Maintains a stack of the current service in scope.
|
|
5432
|
+
* This is used to provide the correct service to spawn().
|
|
5428
5433
|
*/
|
|
5429
5434
|
var provide = function (service, fn) {
|
|
5430
5435
|
var result = fn(service);
|
|
@@ -5454,11 +5459,11 @@ function createNullActor(id) {
|
|
|
5454
5459
|
}
|
|
5455
5460
|
};
|
|
5456
5461
|
}
|
|
5457
|
-
/**
|
|
5458
|
-
* Creates a deferred actor that is able to be invoked given the provided
|
|
5459
|
-
* invocation information in its `.meta` value.
|
|
5460
|
-
*
|
|
5461
|
-
* @param invokeDefinition The meta information needed to invoke the actor.
|
|
5462
|
+
/**
|
|
5463
|
+
* Creates a deferred actor that is able to be invoked given the provided
|
|
5464
|
+
* invocation information in its `.meta` value.
|
|
5465
|
+
*
|
|
5466
|
+
* @param invokeDefinition The meta information needed to invoke the actor.
|
|
5462
5467
|
*/
|
|
5463
5468
|
|
|
5464
5469
|
function createInvocableActor(invokeDefinition, machine, context, _event) {
|
|
@@ -5549,12 +5554,12 @@ var StateNode =
|
|
|
5549
5554
|
/** @class */
|
|
5550
5555
|
function () {
|
|
5551
5556
|
function StateNode(
|
|
5552
|
-
/**
|
|
5553
|
-
* The raw config used to create the machine.
|
|
5557
|
+
/**
|
|
5558
|
+
* The raw config used to create the machine.
|
|
5554
5559
|
*/
|
|
5555
5560
|
config, options,
|
|
5556
|
-
/**
|
|
5557
|
-
* The initial extended state
|
|
5561
|
+
/**
|
|
5562
|
+
* The initial extended state
|
|
5558
5563
|
*/
|
|
5559
5564
|
_context // TODO: this is unsafe, but we're removing it in v5 anyway
|
|
5560
5565
|
) {
|
|
@@ -5568,8 +5573,8 @@ function () {
|
|
|
5568
5573
|
|
|
5569
5574
|
this.config = config;
|
|
5570
5575
|
this._context = _context;
|
|
5571
|
-
/**
|
|
5572
|
-
* The order this state node appears. Corresponds to the implicit SCXML document order.
|
|
5576
|
+
/**
|
|
5577
|
+
* The order this state node appears. Corresponds to the implicit SCXML document order.
|
|
5573
5578
|
*/
|
|
5574
5579
|
|
|
5575
5580
|
this.order = -1;
|
|
@@ -5704,11 +5709,11 @@ function () {
|
|
|
5704
5709
|
return stateNode.on;
|
|
5705
5710
|
});
|
|
5706
5711
|
};
|
|
5707
|
-
/**
|
|
5708
|
-
* Clones this state machine with custom options and context.
|
|
5709
|
-
*
|
|
5710
|
-
* @param options Options (actions, guards, activities, services) to recursively merge with the existing options.
|
|
5711
|
-
* @param context Custom context (will override predefined context)
|
|
5712
|
+
/**
|
|
5713
|
+
* Clones this state machine with custom options and context.
|
|
5714
|
+
*
|
|
5715
|
+
* @param options Options (actions, guards, activities, services) to recursively merge with the existing options.
|
|
5716
|
+
* @param context Custom context (will override predefined context)
|
|
5712
5717
|
*/
|
|
5713
5718
|
|
|
5714
5719
|
|
|
@@ -5727,10 +5732,10 @@ function () {
|
|
|
5727
5732
|
delays: __assign(__assign({}, delays), options.delays)
|
|
5728
5733
|
}, context !== null && context !== void 0 ? context : this.context);
|
|
5729
5734
|
};
|
|
5730
|
-
/**
|
|
5731
|
-
* Clones this state machine with custom context.
|
|
5732
|
-
*
|
|
5733
|
-
* @param context Custom context (will override predefined context, not recursive)
|
|
5735
|
+
/**
|
|
5736
|
+
* Clones this state machine with custom context.
|
|
5737
|
+
*
|
|
5738
|
+
* @param context Custom context (will override predefined context, not recursive)
|
|
5734
5739
|
*/
|
|
5735
5740
|
|
|
5736
5741
|
|
|
@@ -5746,8 +5751,8 @@ function () {
|
|
|
5746
5751
|
configurable: true
|
|
5747
5752
|
});
|
|
5748
5753
|
Object.defineProperty(StateNode.prototype, "definition", {
|
|
5749
|
-
/**
|
|
5750
|
-
* The well-structured state node definition.
|
|
5754
|
+
/**
|
|
5755
|
+
* The well-structured state node definition.
|
|
5751
5756
|
*/
|
|
5752
5757
|
get: function () {
|
|
5753
5758
|
return {
|
|
@@ -5781,8 +5786,8 @@ function () {
|
|
|
5781
5786
|
};
|
|
5782
5787
|
|
|
5783
5788
|
Object.defineProperty(StateNode.prototype, "on", {
|
|
5784
|
-
/**
|
|
5785
|
-
* The mapping of events to transitions.
|
|
5789
|
+
/**
|
|
5790
|
+
* The mapping of events to transitions.
|
|
5786
5791
|
*/
|
|
5787
5792
|
get: function () {
|
|
5788
5793
|
if (this.__cache.on) {
|
|
@@ -5807,8 +5812,8 @@ function () {
|
|
|
5807
5812
|
configurable: true
|
|
5808
5813
|
});
|
|
5809
5814
|
Object.defineProperty(StateNode.prototype, "transitions", {
|
|
5810
|
-
/**
|
|
5811
|
-
* All the transitions that can be taken from this state node.
|
|
5815
|
+
/**
|
|
5816
|
+
* All the transitions that can be taken from this state node.
|
|
5812
5817
|
*/
|
|
5813
5818
|
get: function () {
|
|
5814
5819
|
return this.__cache.transitions || (this.__cache.transitions = this.formatTransitions(), this.__cache.transitions);
|
|
@@ -5831,8 +5836,8 @@ function () {
|
|
|
5831
5836
|
this.__cache.candidates[eventName] = candidates;
|
|
5832
5837
|
return candidates;
|
|
5833
5838
|
};
|
|
5834
|
-
/**
|
|
5835
|
-
* All delayed transitions from the config.
|
|
5839
|
+
/**
|
|
5840
|
+
* All delayed transitions from the config.
|
|
5836
5841
|
*/
|
|
5837
5842
|
|
|
5838
5843
|
|
|
@@ -5884,10 +5889,10 @@ function () {
|
|
|
5884
5889
|
});
|
|
5885
5890
|
});
|
|
5886
5891
|
};
|
|
5887
|
-
/**
|
|
5888
|
-
* Returns the state nodes represented by the current state value.
|
|
5889
|
-
*
|
|
5890
|
-
* @param state The state value or State instance
|
|
5892
|
+
/**
|
|
5893
|
+
* Returns the state nodes represented by the current state value.
|
|
5894
|
+
*
|
|
5895
|
+
* @param state The state value or State instance
|
|
5891
5896
|
*/
|
|
5892
5897
|
|
|
5893
5898
|
|
|
@@ -5918,10 +5923,10 @@ function () {
|
|
|
5918
5923
|
return allSubStateNodes.concat(subStateNode);
|
|
5919
5924
|
}, []));
|
|
5920
5925
|
};
|
|
5921
|
-
/**
|
|
5922
|
-
* Returns `true` if this state node explicitly handles the given event.
|
|
5923
|
-
*
|
|
5924
|
-
* @param event The event in question
|
|
5926
|
+
/**
|
|
5927
|
+
* Returns `true` if this state node explicitly handles the given event.
|
|
5928
|
+
*
|
|
5929
|
+
* @param event The event in question
|
|
5925
5930
|
*/
|
|
5926
5931
|
|
|
5927
5932
|
|
|
@@ -5929,12 +5934,12 @@ function () {
|
|
|
5929
5934
|
var eventType = getEventType(event);
|
|
5930
5935
|
return this.events.includes(eventType);
|
|
5931
5936
|
};
|
|
5932
|
-
/**
|
|
5933
|
-
* Resolves the given `state` to a new `State` instance relative to this machine.
|
|
5934
|
-
*
|
|
5935
|
-
* This ensures that `.events` and `.nextEvents` represent the correct values.
|
|
5936
|
-
*
|
|
5937
|
-
* @param state The state to resolve
|
|
5937
|
+
/**
|
|
5938
|
+
* Resolves the given `state` to a new `State` instance relative to this machine.
|
|
5939
|
+
*
|
|
5940
|
+
* This ensures that `.events` and `.nextEvents` represent the correct values.
|
|
5941
|
+
*
|
|
5942
|
+
* @param state The state to resolve
|
|
5938
5943
|
*/
|
|
5939
5944
|
|
|
5940
5945
|
|
|
@@ -6152,9 +6157,9 @@ function () {
|
|
|
6152
6157
|
|
|
6153
6158
|
return nodes;
|
|
6154
6159
|
};
|
|
6155
|
-
/**
|
|
6156
|
-
* Whether the given state node "escapes" this state node. If the `stateNode` is equal to or the parent of
|
|
6157
|
-
* this state node, it does not escape.
|
|
6160
|
+
/**
|
|
6161
|
+
* Whether the given state node "escapes" this state node. If the `stateNode` is equal to or the parent of
|
|
6162
|
+
* this state node, it does not escape.
|
|
6158
6163
|
*/
|
|
6159
6164
|
|
|
6160
6165
|
|
|
@@ -6279,12 +6284,12 @@ function () {
|
|
|
6279
6284
|
var actions = toActionObjects(exitActions.concat(transition.actions).concat(entryActions), this.machine.options.actions);
|
|
6280
6285
|
return actions;
|
|
6281
6286
|
};
|
|
6282
|
-
/**
|
|
6283
|
-
* Determines the next state given the current `state` and sent `event`.
|
|
6284
|
-
*
|
|
6285
|
-
* @param state The current State instance or state value
|
|
6286
|
-
* @param event The event that was sent at the current state
|
|
6287
|
-
* @param context The current context (extended state) of the current state
|
|
6287
|
+
/**
|
|
6288
|
+
* Determines the next state given the current `state` and sent `event`.
|
|
6289
|
+
*
|
|
6290
|
+
* @param state The current State instance or state value
|
|
6291
|
+
* @param event The event that was sent at the current state
|
|
6292
|
+
* @param context The current context (extended state) of the current state
|
|
6288
6293
|
*/
|
|
6289
6294
|
|
|
6290
6295
|
|
|
@@ -6477,8 +6482,8 @@ function () {
|
|
|
6477
6482
|
})));
|
|
6478
6483
|
return maybeNextState;
|
|
6479
6484
|
};
|
|
6480
|
-
/**
|
|
6481
|
-
* Returns the child state node from its relative `stateKey`, or throws.
|
|
6485
|
+
/**
|
|
6486
|
+
* Returns the child state node from its relative `stateKey`, or throws.
|
|
6482
6487
|
*/
|
|
6483
6488
|
|
|
6484
6489
|
|
|
@@ -6499,10 +6504,10 @@ function () {
|
|
|
6499
6504
|
|
|
6500
6505
|
return result;
|
|
6501
6506
|
};
|
|
6502
|
-
/**
|
|
6503
|
-
* Returns the state node with the given `stateId`, or throws.
|
|
6504
|
-
*
|
|
6505
|
-
* @param stateId The state ID. The prefix "#" is removed.
|
|
6507
|
+
/**
|
|
6508
|
+
* Returns the state node with the given `stateId`, or throws.
|
|
6509
|
+
*
|
|
6510
|
+
* @param stateId The state ID. The prefix "#" is removed.
|
|
6506
6511
|
*/
|
|
6507
6512
|
|
|
6508
6513
|
|
|
@@ -6521,10 +6526,10 @@ function () {
|
|
|
6521
6526
|
|
|
6522
6527
|
return stateNode;
|
|
6523
6528
|
};
|
|
6524
|
-
/**
|
|
6525
|
-
* Returns the relative state node from the given `statePath`, or throws.
|
|
6526
|
-
*
|
|
6527
|
-
* @param statePath The string or string array relative path to the state node.
|
|
6529
|
+
/**
|
|
6530
|
+
* Returns the relative state node from the given `statePath`, or throws.
|
|
6531
|
+
*
|
|
6532
|
+
* @param statePath The string or string array relative path to the state node.
|
|
6528
6533
|
*/
|
|
6529
6534
|
|
|
6530
6535
|
|
|
@@ -6552,10 +6557,10 @@ function () {
|
|
|
6552
6557
|
|
|
6553
6558
|
return currentStateNode;
|
|
6554
6559
|
};
|
|
6555
|
-
/**
|
|
6556
|
-
* Resolves a partial state value with its full representation in this machine.
|
|
6557
|
-
*
|
|
6558
|
-
* @param stateValue The partial state value to resolve.
|
|
6560
|
+
/**
|
|
6561
|
+
* Resolves a partial state value with its full representation in this machine.
|
|
6562
|
+
*
|
|
6563
|
+
* @param stateValue The partial state value to resolve.
|
|
6559
6564
|
*/
|
|
6560
6565
|
|
|
6561
6566
|
|
|
@@ -6659,9 +6664,9 @@ function () {
|
|
|
6659
6664
|
};
|
|
6660
6665
|
|
|
6661
6666
|
Object.defineProperty(StateNode.prototype, "initialState", {
|
|
6662
|
-
/**
|
|
6663
|
-
* The initial State instance, which includes all actions to be executed from
|
|
6664
|
-
* entering the initial state.
|
|
6667
|
+
/**
|
|
6668
|
+
* The initial State instance, which includes all actions to be executed from
|
|
6669
|
+
* entering the initial state.
|
|
6665
6670
|
*/
|
|
6666
6671
|
get: function () {
|
|
6667
6672
|
this._init(); // TODO: this should be in the constructor (see note in constructor)
|
|
@@ -6679,9 +6684,9 @@ function () {
|
|
|
6679
6684
|
configurable: true
|
|
6680
6685
|
});
|
|
6681
6686
|
Object.defineProperty(StateNode.prototype, "target", {
|
|
6682
|
-
/**
|
|
6683
|
-
* The target state value of the history state node, if it exists. This represents the
|
|
6684
|
-
* default state value to transition to if no history value exists yet.
|
|
6687
|
+
/**
|
|
6688
|
+
* The target state value of the history state node, if it exists. This represents the
|
|
6689
|
+
* default state value to transition to if no history value exists yet.
|
|
6685
6690
|
*/
|
|
6686
6691
|
get: function () {
|
|
6687
6692
|
var target;
|
|
@@ -6701,12 +6706,12 @@ function () {
|
|
|
6701
6706
|
enumerable: false,
|
|
6702
6707
|
configurable: true
|
|
6703
6708
|
});
|
|
6704
|
-
/**
|
|
6705
|
-
* Returns the leaf nodes from a state path relative to this state node.
|
|
6706
|
-
*
|
|
6707
|
-
* @param relativeStateId The relative state path to retrieve the state nodes
|
|
6708
|
-
* @param history The previous state to retrieve history
|
|
6709
|
-
* @param resolve Whether state nodes should resolve to initial child state nodes
|
|
6709
|
+
/**
|
|
6710
|
+
* Returns the leaf nodes from a state path relative to this state node.
|
|
6711
|
+
*
|
|
6712
|
+
* @param relativeStateId The relative state path to retrieve the state nodes
|
|
6713
|
+
* @param history The previous state to retrieve history
|
|
6714
|
+
* @param resolve Whether state nodes should resolve to initial child state nodes
|
|
6710
6715
|
*/
|
|
6711
6716
|
|
|
6712
6717
|
StateNode.prototype.getRelativeStateNodes = function (relativeStateId, historyValue, resolve) {
|
|
@@ -6739,11 +6744,11 @@ function () {
|
|
|
6739
6744
|
enumerable: false,
|
|
6740
6745
|
configurable: true
|
|
6741
6746
|
});
|
|
6742
|
-
/**
|
|
6743
|
-
* Retrieves state nodes from a relative path to this state node.
|
|
6744
|
-
*
|
|
6745
|
-
* @param relativePath The relative path from this state node
|
|
6746
|
-
* @param historyValue
|
|
6747
|
+
/**
|
|
6748
|
+
* Retrieves state nodes from a relative path to this state node.
|
|
6749
|
+
*
|
|
6750
|
+
* @param relativePath The relative path from this state node
|
|
6751
|
+
* @param historyValue
|
|
6747
6752
|
*/
|
|
6748
6753
|
|
|
6749
6754
|
StateNode.prototype.getFromRelativePath = function (relativePath) {
|
|
@@ -6791,11 +6796,11 @@ function () {
|
|
|
6791
6796
|
})
|
|
6792
6797
|
};
|
|
6793
6798
|
};
|
|
6794
|
-
/**
|
|
6795
|
-
* Resolves to the historical value(s) of the parent state node,
|
|
6796
|
-
* represented by state nodes.
|
|
6797
|
-
*
|
|
6798
|
-
* @param historyValue
|
|
6799
|
+
/**
|
|
6800
|
+
* Resolves to the historical value(s) of the parent state node,
|
|
6801
|
+
* represented by state nodes.
|
|
6802
|
+
*
|
|
6803
|
+
* @param historyValue
|
|
6799
6804
|
*/
|
|
6800
6805
|
|
|
6801
6806
|
|
|
@@ -6827,8 +6832,8 @@ function () {
|
|
|
6827
6832
|
};
|
|
6828
6833
|
|
|
6829
6834
|
Object.defineProperty(StateNode.prototype, "stateIds", {
|
|
6830
|
-
/**
|
|
6831
|
-
* All the state node IDs of this state node and its descendant state nodes.
|
|
6835
|
+
/**
|
|
6836
|
+
* All the state node IDs of this state node and its descendant state nodes.
|
|
6832
6837
|
*/
|
|
6833
6838
|
get: function () {
|
|
6834
6839
|
var _this = this;
|
|
@@ -6842,8 +6847,8 @@ function () {
|
|
|
6842
6847
|
configurable: true
|
|
6843
6848
|
});
|
|
6844
6849
|
Object.defineProperty(StateNode.prototype, "events", {
|
|
6845
|
-
/**
|
|
6846
|
-
* All the event types accepted by this state node and its descendants.
|
|
6850
|
+
/**
|
|
6851
|
+
* All the event types accepted by this state node and its descendants.
|
|
6847
6852
|
*/
|
|
6848
6853
|
get: function () {
|
|
6849
6854
|
var e_7, _a, e_8, _b;
|
|
@@ -6899,10 +6904,10 @@ function () {
|
|
|
6899
6904
|
configurable: true
|
|
6900
6905
|
});
|
|
6901
6906
|
Object.defineProperty(StateNode.prototype, "ownEvents", {
|
|
6902
|
-
/**
|
|
6903
|
-
* All the events that have transitions directly from this state node.
|
|
6904
|
-
*
|
|
6905
|
-
* Excludes any inert events.
|
|
6907
|
+
/**
|
|
6908
|
+
* All the events that have transitions directly from this state node.
|
|
6909
|
+
*
|
|
6910
|
+
* Excludes any inert events.
|
|
6906
6911
|
*/
|
|
6907
6912
|
get: function () {
|
|
6908
6913
|
var events = new Set(this.transitions.filter(function (transition) {
|
|
@@ -7891,17 +7896,17 @@ function invite_friends_activity (request) {
|
|
|
7891
7896
|
bindingCode: null,
|
|
7892
7897
|
uidSite: null,
|
|
7893
7898
|
receiveNo: null,
|
|
7894
|
-
|
|
7899
|
+
friendCode: null,
|
|
7895
7900
|
downlineCount: 0,
|
|
7896
7901
|
},
|
|
7897
7902
|
initial: 'idle',
|
|
7898
7903
|
states: {
|
|
7899
7904
|
idle: {
|
|
7900
7905
|
on: {
|
|
7901
|
-
|
|
7906
|
+
FETCH_FRIEND_CODE: {
|
|
7902
7907
|
target: 'fetching',
|
|
7903
7908
|
},
|
|
7904
|
-
|
|
7909
|
+
BIND_FRIEND_CODE: {
|
|
7905
7910
|
target: 'binding',
|
|
7906
7911
|
actions: ['setActivityNo', 'setBindingCode', 'setUidSite'],
|
|
7907
7912
|
},
|
|
@@ -7909,10 +7914,10 @@ function invite_friends_activity (request) {
|
|
|
7909
7914
|
},
|
|
7910
7915
|
fetching: {
|
|
7911
7916
|
invoke: {
|
|
7912
|
-
src: '
|
|
7917
|
+
src: 'fetchFriends',
|
|
7913
7918
|
onDone: {
|
|
7914
7919
|
target: 'idle',
|
|
7915
|
-
actions: '
|
|
7920
|
+
actions: 'setFriendCode',
|
|
7916
7921
|
},
|
|
7917
7922
|
onError: {
|
|
7918
7923
|
target: 'idle',
|
|
@@ -7921,7 +7926,7 @@ function invite_friends_activity (request) {
|
|
|
7921
7926
|
},
|
|
7922
7927
|
binding: {
|
|
7923
7928
|
invoke: {
|
|
7924
|
-
src: '
|
|
7929
|
+
src: 'postFriends',
|
|
7925
7930
|
onDone: {
|
|
7926
7931
|
target: 'awarding',
|
|
7927
7932
|
},
|
|
@@ -7952,10 +7957,10 @@ function invite_friends_activity (request) {
|
|
|
7952
7957
|
},
|
|
7953
7958
|
{
|
|
7954
7959
|
actions: {
|
|
7955
|
-
|
|
7956
|
-
const {
|
|
7960
|
+
setFriendCode: assign((context, event) => {
|
|
7961
|
+
const { friendCode, downlineCount } = event.data;
|
|
7957
7962
|
return {
|
|
7958
|
-
|
|
7963
|
+
friendCode,
|
|
7959
7964
|
downlineCount,
|
|
7960
7965
|
}
|
|
7961
7966
|
}),
|
|
@@ -7976,11 +7981,11 @@ function invite_friends_activity (request) {
|
|
|
7976
7981
|
}),
|
|
7977
7982
|
},
|
|
7978
7983
|
services: {
|
|
7979
|
-
|
|
7980
|
-
return await request.send(user.
|
|
7984
|
+
postFriends: async (context, event) => {
|
|
7985
|
+
return await request.send(user.postFriends({ friendCode: context.bindingCode }))
|
|
7981
7986
|
},
|
|
7982
|
-
|
|
7983
|
-
return await request.send(user.
|
|
7987
|
+
fetchFriends: async (context, event) => {
|
|
7988
|
+
return await request.send(user.getFriends())
|
|
7984
7989
|
},
|
|
7985
7990
|
awardPrize: async (context, event) => {
|
|
7986
7991
|
const { activityNo, uidSite, bindingCode } = context;
|
|
@@ -7992,18 +7997,18 @@ function invite_friends_activity (request) {
|
|
|
7992
7997
|
)
|
|
7993
7998
|
}
|
|
7994
7999
|
|
|
7995
|
-
function
|
|
8000
|
+
function friend_invite_friends_activity (request) {
|
|
7996
8001
|
const { appSecret } = request.config;
|
|
7997
8002
|
return createMachine(
|
|
7998
8003
|
{
|
|
7999
|
-
id: '
|
|
8004
|
+
id: 'friend_invite_friends_activity',
|
|
8000
8005
|
context: {
|
|
8001
|
-
|
|
8006
|
+
friendsEnable: false,
|
|
8002
8007
|
activityNo: null,
|
|
8003
8008
|
bindingCode: null,
|
|
8004
8009
|
uidSite: null,
|
|
8005
8010
|
receiveNo: null,
|
|
8006
|
-
|
|
8011
|
+
friendCode: '',
|
|
8007
8012
|
commission: 0,
|
|
8008
8013
|
downLine: 0,
|
|
8009
8014
|
activeDownLine: 0,
|
|
@@ -8017,10 +8022,10 @@ function affiliate_invite_friends_activity (request) {
|
|
|
8017
8022
|
states: {
|
|
8018
8023
|
fetching1: {
|
|
8019
8024
|
invoke: {
|
|
8020
|
-
src: '
|
|
8025
|
+
src: 'fetchFriendCode',
|
|
8021
8026
|
onDone: {
|
|
8022
8027
|
target: 'checking',
|
|
8023
|
-
actions: '
|
|
8028
|
+
actions: 'setFriendsCode',
|
|
8024
8029
|
},
|
|
8025
8030
|
onError: {
|
|
8026
8031
|
target: 'fetching2',
|
|
@@ -8028,11 +8033,11 @@ function affiliate_invite_friends_activity (request) {
|
|
|
8028
8033
|
},
|
|
8029
8034
|
},
|
|
8030
8035
|
checking: {
|
|
8031
|
-
always: [{ target: 'fetching2', cond: '
|
|
8036
|
+
always: [{ target: 'fetching2', cond: 'isFriendsEnable' }, { target: 'idle' }],
|
|
8032
8037
|
},
|
|
8033
8038
|
fetching2: {
|
|
8034
8039
|
invoke: {
|
|
8035
|
-
src: '
|
|
8040
|
+
src: 'fetchFriendsData',
|
|
8036
8041
|
onDone: {
|
|
8037
8042
|
target: 'idle',
|
|
8038
8043
|
actions: 'setInitialData',
|
|
@@ -8044,7 +8049,7 @@ function affiliate_invite_friends_activity (request) {
|
|
|
8044
8049
|
},
|
|
8045
8050
|
idle: {
|
|
8046
8051
|
on: {
|
|
8047
|
-
|
|
8052
|
+
BIND_FRIEND_CODE: {
|
|
8048
8053
|
target: 'binding',
|
|
8049
8054
|
actions: ['setBindingCode', 'setUidSite', 'setActivityNo'],
|
|
8050
8055
|
},
|
|
@@ -8061,7 +8066,7 @@ function affiliate_invite_friends_activity (request) {
|
|
|
8061
8066
|
},
|
|
8062
8067
|
binding: {
|
|
8063
8068
|
invoke: {
|
|
8064
|
-
src: '
|
|
8069
|
+
src: 'postFriends',
|
|
8065
8070
|
onDone: {
|
|
8066
8071
|
target: 'awarding',
|
|
8067
8072
|
},
|
|
@@ -8105,10 +8110,10 @@ function affiliate_invite_friends_activity (request) {
|
|
|
8105
8110
|
},
|
|
8106
8111
|
{
|
|
8107
8112
|
actions: {
|
|
8108
|
-
|
|
8109
|
-
const {
|
|
8113
|
+
setFriendsCode: assign((context, event) => {
|
|
8114
|
+
const { friendCode = '' } = event.data || {};
|
|
8110
8115
|
return {
|
|
8111
|
-
|
|
8116
|
+
friendCode,
|
|
8112
8117
|
}
|
|
8113
8118
|
}),
|
|
8114
8119
|
setInitialData: assign((context, event) => {
|
|
@@ -8165,20 +8170,20 @@ function affiliate_invite_friends_activity (request) {
|
|
|
8165
8170
|
const { page } = context.levelDownLine;
|
|
8166
8171
|
return page.current < page.total
|
|
8167
8172
|
},
|
|
8168
|
-
|
|
8173
|
+
isFriendsEnable: (context, event) => context.friendsEnable,
|
|
8169
8174
|
},
|
|
8170
8175
|
services: {
|
|
8171
|
-
|
|
8172
|
-
return await request.send(user.
|
|
8176
|
+
fetchFriendCode: async () => {
|
|
8177
|
+
return await request.send(user.getFriends())
|
|
8173
8178
|
},
|
|
8174
|
-
|
|
8175
|
-
const
|
|
8176
|
-
const
|
|
8177
|
-
const [
|
|
8178
|
-
return [
|
|
8179
|
+
fetchFriendsData: async (context, event) => {
|
|
8180
|
+
const friendsHomeAPI = request.send(user.getFriendsHome());
|
|
8181
|
+
const friendsDashboard = request.send(user.getFriendsDashboard());
|
|
8182
|
+
const [friendsHomeData, friendsDashboardData] = await Promise.all([friendsHomeAPI, friendsDashboard]);
|
|
8183
|
+
return [friendsHomeData, friendsDashboardData]
|
|
8179
8184
|
},
|
|
8180
|
-
|
|
8181
|
-
return await request.send(user.
|
|
8185
|
+
postFriends: async (context, event) => {
|
|
8186
|
+
return await request.send(user.postFriends({ friendCode: context.bindingCode }))
|
|
8182
8187
|
},
|
|
8183
8188
|
awardPrize: async (context, event) => {
|
|
8184
8189
|
const { activityNo, uidSite, bindingCode } = context;
|
|
@@ -8189,7 +8194,7 @@ function affiliate_invite_friends_activity (request) {
|
|
|
8189
8194
|
const { currentLevel, page, levelDownLine } = context;
|
|
8190
8195
|
const copiedObj = JSON.parse(JSON.stringify(levelDownLine));
|
|
8191
8196
|
const copiedList = copiedObj.data;
|
|
8192
|
-
const resopnseData = await request.send(user.
|
|
8197
|
+
const resopnseData = await request.send(user.getFriendsDashboardList({ level: currentLevel, page, row: 10 }));
|
|
8193
8198
|
if (!!copiedList && !!resopnseData?.data) {
|
|
8194
8199
|
const combindData = {
|
|
8195
8200
|
...resopnseData,
|
|
@@ -9270,7 +9275,7 @@ var activity = {
|
|
|
9270
9275
|
diamond_shop_activity_vn,
|
|
9271
9276
|
fafafa_activity,
|
|
9272
9277
|
invite_friends_activity,
|
|
9273
|
-
|
|
9278
|
+
friend_invite_friends_activity,
|
|
9274
9279
|
ranking_activity,
|
|
9275
9280
|
return_bonus_activity,
|
|
9276
9281
|
specify_bets_activity,
|
|
@@ -15463,7 +15468,7 @@ function auth (request) {
|
|
|
15463
15468
|
userInfo: {},
|
|
15464
15469
|
redirectURL: null,
|
|
15465
15470
|
reCaptchaToken: null,
|
|
15466
|
-
|
|
15471
|
+
fc: null,
|
|
15467
15472
|
},
|
|
15468
15473
|
states: {
|
|
15469
15474
|
idle: {
|
|
@@ -15748,7 +15753,7 @@ function auth (request) {
|
|
|
15748
15753
|
return { token }
|
|
15749
15754
|
}),
|
|
15750
15755
|
redirectTo3Party: async (context, event) => {
|
|
15751
|
-
const { provider, channel, subchannel,
|
|
15756
|
+
const { provider, channel, subchannel, fc } = event.data;
|
|
15752
15757
|
|
|
15753
15758
|
const dt = await getDeviceToken({
|
|
15754
15759
|
fpToken,
|
|
@@ -15757,7 +15762,7 @@ function auth (request) {
|
|
|
15757
15762
|
});
|
|
15758
15763
|
sentry.setTag('dt', dt);
|
|
15759
15764
|
|
|
15760
|
-
const
|
|
15765
|
+
const affiliateCode = storage.get('ac');
|
|
15761
15766
|
const messages = {
|
|
15762
15767
|
url: window.location.href,
|
|
15763
15768
|
channelOrders: [
|
|
@@ -15765,13 +15770,13 @@ function auth (request) {
|
|
|
15765
15770
|
{ channel: defaultChannel, subchannel: defaultSubchannel },
|
|
15766
15771
|
{ channel: channel, subchannel: subchannel },
|
|
15767
15772
|
],
|
|
15768
|
-
|
|
15773
|
+
affiliateCode,
|
|
15769
15774
|
};
|
|
15770
15775
|
sentry.captureMessage(JSON.stringify(messages));
|
|
15771
15776
|
|
|
15772
15777
|
const referralObj = {};
|
|
15773
|
-
if (![undefined, 'undefined', null, 'null'].includes(
|
|
15774
|
-
referralObj.
|
|
15778
|
+
if (![undefined, 'undefined', null, 'null'].includes(affiliateCode)) {
|
|
15779
|
+
referralObj.ac = affiliateCode;
|
|
15775
15780
|
}
|
|
15776
15781
|
|
|
15777
15782
|
referralObj.channel = storage.get('channel') || defaultChannel || channel;
|
|
@@ -15786,7 +15791,7 @@ function auth (request) {
|
|
|
15786
15791
|
...referralObj,
|
|
15787
15792
|
// dt,
|
|
15788
15793
|
platform: 'pwa',
|
|
15789
|
-
|
|
15794
|
+
fc,
|
|
15790
15795
|
}).toString()
|
|
15791
15796
|
);
|
|
15792
15797
|
|
|
@@ -15939,7 +15944,7 @@ var uaParser = {exports: {}};
|
|
|
15939
15944
|
|
|
15940
15945
|
(function (module, exports) {
|
|
15941
15946
|
/////////////////////////////////////////////////////////////////////////////////
|
|
15942
|
-
/* UAParser.js v0.7.
|
|
15947
|
+
/* UAParser.js v0.7.34
|
|
15943
15948
|
Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
|
|
15944
15949
|
MIT License *//*
|
|
15945
15950
|
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
|
|
@@ -15955,7 +15960,7 @@ var uaParser = {exports: {}};
|
|
|
15955
15960
|
/////////////
|
|
15956
15961
|
|
|
15957
15962
|
|
|
15958
|
-
var LIBVERSION = '0.7.
|
|
15963
|
+
var LIBVERSION = '0.7.34',
|
|
15959
15964
|
EMPTY = '',
|
|
15960
15965
|
UNKNOWN = '?',
|
|
15961
15966
|
FUNC_TYPE = 'function',
|
|
@@ -16173,9 +16178,8 @@ var uaParser = {exports: {}};
|
|
|
16173
16178
|
/(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer
|
|
16174
16179
|
|
|
16175
16180
|
// Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
|
|
16176
|
-
/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,
|
|
16181
|
+
/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,
|
|
16177
16182
|
// Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ
|
|
16178
|
-
/(heytap|ovi)browser\/([\d\.]+)/i, // Heytap/Ovi
|
|
16179
16183
|
/(weibo)__([\d\.]+)/i // Weibo
|
|
16180
16184
|
], [NAME, VERSION], [
|
|
16181
16185
|
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser
|
|
@@ -16189,7 +16193,7 @@ var uaParser = {exports: {}};
|
|
|
16189
16193
|
], [VERSION, [NAME, 'Konqueror']], [
|
|
16190
16194
|
/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i // IE11
|
|
16191
16195
|
], [VERSION, [NAME, 'IE']], [
|
|
16192
|
-
/
|
|
16196
|
+
/yabrowser\/([\w\.]+)/i // Yandex
|
|
16193
16197
|
], [VERSION, [NAME, 'Yandex']], [
|
|
16194
16198
|
/(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser
|
|
16195
16199
|
], [[NAME, /(.+)/, '$1 Secure '+BROWSER], VERSION], [
|
|
@@ -16233,8 +16237,6 @@ var uaParser = {exports: {}};
|
|
|
16233
16237
|
], [NAME, VERSION], [
|
|
16234
16238
|
/\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS
|
|
16235
16239
|
], [VERSION, [NAME, 'GSA']], [
|
|
16236
|
-
/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i // TikTok
|
|
16237
|
-
], [VERSION, [NAME, 'TikTok']], [
|
|
16238
16240
|
|
|
16239
16241
|
/headlesschrome(?:\/([\w\.]+)| )/i // Chrome Headless
|
|
16240
16242
|
], [VERSION, [NAME, CHROME+' Headless']], [
|
|
@@ -16330,7 +16332,7 @@ var uaParser = {exports: {}};
|
|
|
16330
16332
|
], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [
|
|
16331
16333
|
|
|
16332
16334
|
// Apple
|
|
16333
|
-
|
|
16335
|
+
/\((ip(?:hone|od)[\w ]*);/i // iPod/iPhone
|
|
16334
16336
|
], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [
|
|
16335
16337
|
/\((ipad);[-\w\),; ]+apple/i, // iPad
|
|
16336
16338
|
/applecoremedia\/[\w\.]+ \((ipad)/i,
|
|
@@ -16420,7 +16422,7 @@ var uaParser = {exports: {}};
|
|
|
16420
16422
|
|
|
16421
16423
|
// Amazon
|
|
16422
16424
|
/(alexa)webm/i,
|
|
16423
|
-
/(kf[a-z]{2}wi
|
|
16425
|
+
/(kf[a-z]{2}wi)( bui|\))/i, // Kindle Fire without Silk
|
|
16424
16426
|
/(kf[a-z]+)( bui|\)).+silk\//i // Kindle Fire HD
|
|
16425
16427
|
], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [
|
|
16426
16428
|
/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i // Fire Phone
|
|
@@ -16605,8 +16607,6 @@ var uaParser = {exports: {}};
|
|
|
16605
16607
|
|
|
16606
16608
|
/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i // Tesla
|
|
16607
16609
|
], [VENDOR, [TYPE, EMBEDDED]], [
|
|
16608
|
-
/(aeobc)\b/i // Echo Dot
|
|
16609
|
-
], [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], [
|
|
16610
16610
|
|
|
16611
16611
|
////////////////////
|
|
16612
16612
|
// MIXED (GENERIC)
|
|
@@ -16636,8 +16636,7 @@ var uaParser = {exports: {}};
|
|
|
16636
16636
|
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
|
|
16637
16637
|
/ekioh(flow)\/([\w\.]+)/i, // Flow
|
|
16638
16638
|
/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links
|
|
16639
|
-
/(icab)[\/ ]([23]\.[\d\.]+)/i
|
|
16640
|
-
/\b(libweb)/i
|
|
16639
|
+
/(icab)[\/ ]([23]\.[\d\.]+)/i // iCab
|
|
16641
16640
|
], [NAME, VERSION], [
|
|
16642
16641
|
|
|
16643
16642
|
/rv\:([\w\.]{1,9})\b.+(gecko)/i // Gecko
|
|
@@ -16658,7 +16657,6 @@ var uaParser = {exports: {}};
|
|
|
16658
16657
|
|
|
16659
16658
|
// iOS/macOS
|
|
16660
16659
|
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS
|
|
16661
|
-
/ios;fbsv\/([\d\.]+)/i,
|
|
16662
16660
|
/cfnetwork\/.+darwin/i
|
|
16663
16661
|
], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [
|
|
16664
16662
|
/(mac os x) ?([\w\. ]*)/i,
|
|
@@ -16715,7 +16713,7 @@ var uaParser = {exports: {}};
|
|
|
16715
16713
|
], [[NAME, 'Solaris'], VERSION], [
|
|
16716
16714
|
/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, // Solaris
|
|
16717
16715
|
/(aix) ((\d)(?=\.|\)| )[\w\.])*/i, // AIX
|
|
16718
|
-
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux
|
|
16716
|
+
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX
|
|
16719
16717
|
/(unix) ?([\w\.]*)/i // UNIX
|
|
16720
16718
|
], [NAME, VERSION]
|
|
16721
16719
|
]
|
|
@@ -16740,7 +16738,6 @@ var uaParser = {exports: {}};
|
|
|
16740
16738
|
var _ua = ua || ((_navigator && _navigator.userAgent) ? _navigator.userAgent : EMPTY);
|
|
16741
16739
|
var _uach = (_navigator && _navigator.userAgentData) ? _navigator.userAgentData : undefined$1;
|
|
16742
16740
|
var _rgxmap = extensions ? extend(regexes, extensions) : regexes;
|
|
16743
|
-
var _isSelfNav = _navigator && _navigator.userAgent == _ua;
|
|
16744
16741
|
|
|
16745
16742
|
this.getBrowser = function () {
|
|
16746
16743
|
var _browser = {};
|
|
@@ -16749,7 +16746,7 @@ var uaParser = {exports: {}};
|
|
|
16749
16746
|
rgxMapper.call(_browser, _ua, _rgxmap.browser);
|
|
16750
16747
|
_browser[MAJOR] = majorize(_browser[VERSION]);
|
|
16751
16748
|
// Brave-specific detection
|
|
16752
|
-
if (
|
|
16749
|
+
if (_navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) {
|
|
16753
16750
|
_browser[NAME] = 'Brave';
|
|
16754
16751
|
}
|
|
16755
16752
|
return _browser;
|
|
@@ -16766,11 +16763,11 @@ var uaParser = {exports: {}};
|
|
|
16766
16763
|
_device[MODEL] = undefined$1;
|
|
16767
16764
|
_device[TYPE] = undefined$1;
|
|
16768
16765
|
rgxMapper.call(_device, _ua, _rgxmap.device);
|
|
16769
|
-
if (
|
|
16766
|
+
if (!_device[TYPE] && _uach && _uach.mobile) {
|
|
16770
16767
|
_device[TYPE] = MOBILE;
|
|
16771
16768
|
}
|
|
16772
16769
|
// iPadOS-specific detection: identified as Mac, but has some iOS-only properties
|
|
16773
|
-
if (
|
|
16770
|
+
if (_device[MODEL] == 'Macintosh' && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) {
|
|
16774
16771
|
_device[MODEL] = 'iPad';
|
|
16775
16772
|
_device[TYPE] = TABLET;
|
|
16776
16773
|
}
|
|
@@ -16788,7 +16785,7 @@ var uaParser = {exports: {}};
|
|
|
16788
16785
|
_os[NAME] = undefined$1;
|
|
16789
16786
|
_os[VERSION] = undefined$1;
|
|
16790
16787
|
rgxMapper.call(_os, _ua, _rgxmap.os);
|
|
16791
|
-
if (
|
|
16788
|
+
if (!_os[NAME] && _uach && _uach.platform != 'Unknown') {
|
|
16792
16789
|
_os[NAME] = _uach.platform
|
|
16793
16790
|
.replace(/chrome os/i, CHROMIUM_OS)
|
|
16794
16791
|
.replace(/macos/i, MAC_OS); // backward compatibility
|
|
@@ -16898,7 +16895,7 @@ function common (request) {
|
|
|
16898
16895
|
sentNormalBroadcastList: [],
|
|
16899
16896
|
channel: null,
|
|
16900
16897
|
subchannel: null,
|
|
16901
|
-
|
|
16898
|
+
affiliateCode: null,
|
|
16902
16899
|
},
|
|
16903
16900
|
states: {
|
|
16904
16901
|
config: {
|
|
@@ -17014,7 +17011,7 @@ function common (request) {
|
|
|
17014
17011
|
let urlParams = new URLSearchParams(window.location.search);
|
|
17015
17012
|
const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official';
|
|
17016
17013
|
const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa';
|
|
17017
|
-
const
|
|
17014
|
+
const affiliateCode = urlParams.get('ac') || urlParams.get('referralCode') || storage.get('ac') || storage.get('referralCode');
|
|
17018
17015
|
|
|
17019
17016
|
storage.set('channel', channel, {
|
|
17020
17017
|
path: '/',
|
|
@@ -17024,7 +17021,7 @@ function common (request) {
|
|
|
17024
17021
|
path: '/',
|
|
17025
17022
|
maxAge: 60 * 60 * 24 * 7,
|
|
17026
17023
|
});
|
|
17027
|
-
storage.set('
|
|
17024
|
+
storage.set('ac', affiliateCode, {
|
|
17028
17025
|
path: '/',
|
|
17029
17026
|
maxAge: 60 * 60 * 24 * 7,
|
|
17030
17027
|
});
|
|
@@ -17032,7 +17029,7 @@ function common (request) {
|
|
|
17032
17029
|
return {
|
|
17033
17030
|
channel,
|
|
17034
17031
|
subchannel,
|
|
17035
|
-
|
|
17032
|
+
affiliateCode,
|
|
17036
17033
|
}
|
|
17037
17034
|
}
|
|
17038
17035
|
}),
|
|
@@ -17157,38 +17154,52 @@ function error () {
|
|
|
17157
17154
|
)
|
|
17158
17155
|
}
|
|
17159
17156
|
|
|
17160
|
-
|
|
17157
|
+
const MY_FAVORITE = 'MyFavorite';
|
|
17158
|
+
const GAME_SEARCH = 'GameSearch';
|
|
17159
|
+
|
|
17160
|
+
var constant = /*#__PURE__*/Object.freeze({
|
|
17161
|
+
__proto__: null,
|
|
17162
|
+
MY_FAVORITE: MY_FAVORITE,
|
|
17163
|
+
GAME_SEARCH: GAME_SEARCH
|
|
17164
|
+
});
|
|
17161
17165
|
|
|
17162
|
-
|
|
17166
|
+
// 對應 intersectionObserver 版本
|
|
17167
|
+
function game_v2_1 (request) {
|
|
17163
17168
|
return createMachine(
|
|
17164
17169
|
{
|
|
17165
17170
|
id: 'game',
|
|
17166
17171
|
type: 'parallel',
|
|
17167
17172
|
context: {
|
|
17168
|
-
|
|
17173
|
+
base: '/',
|
|
17174
|
+
loadable: false,
|
|
17175
|
+
isLastPage: false,
|
|
17169
17176
|
room: null,
|
|
17170
|
-
|
|
17171
|
-
|
|
17177
|
+
index: -1,
|
|
17178
|
+
content: {
|
|
17179
|
+
data: [],
|
|
17180
|
+
timestamp: null,
|
|
17181
|
+
parentCategoryId: null,
|
|
17182
|
+
totalPage: 0,
|
|
17183
|
+
},
|
|
17184
|
+
additionEnable: false,
|
|
17185
|
+
addition: {
|
|
17186
|
+
data: [],
|
|
17187
|
+
timestamp: null,
|
|
17188
|
+
totalPage: 0,
|
|
17189
|
+
},
|
|
17190
|
+
staticData: [],
|
|
17172
17191
|
// play params
|
|
17173
17192
|
game: {
|
|
17174
|
-
|
|
17175
|
-
|
|
17176
|
-
|
|
17177
|
-
|
|
17193
|
+
providerId: null,
|
|
17194
|
+
gameId: null,
|
|
17195
|
+
gameTypeId: null,
|
|
17196
|
+
mappingId: null,
|
|
17178
17197
|
portrait: null,
|
|
17179
17198
|
},
|
|
17180
17199
|
lang: 'en_US',
|
|
17181
17200
|
isMobile: new UAParser().getResult().device.type,
|
|
17182
17201
|
gameURL: null,
|
|
17183
|
-
|
|
17184
|
-
sha: {
|
|
17185
|
-
category: null,
|
|
17186
|
-
status: null,
|
|
17187
|
-
},
|
|
17188
|
-
isCategoryChanged: false,
|
|
17189
|
-
isStatusChanged: false,
|
|
17190
|
-
statusMap: {},
|
|
17191
|
-
optionMap: {},
|
|
17202
|
+
...oldContext,
|
|
17192
17203
|
},
|
|
17193
17204
|
states: {
|
|
17194
17205
|
flow: {
|
|
@@ -17197,12 +17208,19 @@ function game (request) {
|
|
|
17197
17208
|
idle: {
|
|
17198
17209
|
enter: 'clearGameInfo',
|
|
17199
17210
|
on: {
|
|
17211
|
+
SET_STATIC_DATA: {
|
|
17212
|
+
actions: 'setStaticData',
|
|
17213
|
+
},
|
|
17214
|
+
SET_ADDITION_ENABLE: {
|
|
17215
|
+
actions: 'setAdditionEnable',
|
|
17216
|
+
},
|
|
17217
|
+
LOAD: {
|
|
17218
|
+
target: 'routing',
|
|
17219
|
+
actions: 'setLoadable',
|
|
17220
|
+
},
|
|
17200
17221
|
SET_ROOM: {
|
|
17201
|
-
|
|
17202
|
-
actions: 'setRoom',
|
|
17203
|
-
cond: (context, event) => {
|
|
17204
|
-
return context.room?.id !== event.data?.id
|
|
17205
|
-
},
|
|
17222
|
+
cond: 'isDifferentRoom',
|
|
17223
|
+
actions: ['setRoom', 'resetContent'],
|
|
17206
17224
|
},
|
|
17207
17225
|
ENTER_GAME: {
|
|
17208
17226
|
target: 'connecting',
|
|
@@ -17211,17 +17229,29 @@ function game (request) {
|
|
|
17211
17229
|
},
|
|
17212
17230
|
},
|
|
17213
17231
|
loading: {
|
|
17232
|
+
entry: 'increaseIndex',
|
|
17214
17233
|
invoke: {
|
|
17215
|
-
src: '
|
|
17234
|
+
src: 'getPageContent',
|
|
17216
17235
|
onDone: {
|
|
17217
|
-
target: '
|
|
17218
|
-
actions: '
|
|
17236
|
+
target: 'routing',
|
|
17237
|
+
actions: ['appendContent', 'setLastPage'],
|
|
17219
17238
|
},
|
|
17220
17239
|
onError: {
|
|
17221
17240
|
target: 'idle',
|
|
17222
|
-
actions: assign({ list: [] }),
|
|
17223
17241
|
},
|
|
17224
17242
|
},
|
|
17243
|
+
on: {
|
|
17244
|
+
LOAD: { actions: 'setLoadable' },
|
|
17245
|
+
},
|
|
17246
|
+
},
|
|
17247
|
+
routing: {
|
|
17248
|
+
always: [
|
|
17249
|
+
{
|
|
17250
|
+
target: 'loading',
|
|
17251
|
+
cond: 'hasNext',
|
|
17252
|
+
},
|
|
17253
|
+
{ target: 'idle' },
|
|
17254
|
+
],
|
|
17225
17255
|
},
|
|
17226
17256
|
connecting: {
|
|
17227
17257
|
invoke: {
|
|
@@ -17256,6 +17286,36 @@ function game (request) {
|
|
|
17256
17286
|
},
|
|
17257
17287
|
},
|
|
17258
17288
|
timer: {
|
|
17289
|
+
initial: 'pending',
|
|
17290
|
+
states: {
|
|
17291
|
+
pending: {
|
|
17292
|
+
after: {
|
|
17293
|
+
20000: [
|
|
17294
|
+
{
|
|
17295
|
+
target: 'updating',
|
|
17296
|
+
cond: 'hasRoom',
|
|
17297
|
+
},
|
|
17298
|
+
{
|
|
17299
|
+
target: 'pending',
|
|
17300
|
+
},
|
|
17301
|
+
],
|
|
17302
|
+
},
|
|
17303
|
+
},
|
|
17304
|
+
updating: {
|
|
17305
|
+
invoke: {
|
|
17306
|
+
src: 'updatePageContent',
|
|
17307
|
+
onDone: {
|
|
17308
|
+
target: 'pending',
|
|
17309
|
+
actions: 'swapContent',
|
|
17310
|
+
},
|
|
17311
|
+
onError: {
|
|
17312
|
+
target: 'pending',
|
|
17313
|
+
},
|
|
17314
|
+
},
|
|
17315
|
+
},
|
|
17316
|
+
},
|
|
17317
|
+
},
|
|
17318
|
+
oldTimer: {
|
|
17259
17319
|
initial: 'fetchingGameSHA',
|
|
17260
17320
|
states: {
|
|
17261
17321
|
fetchingGameSHA: {
|
|
@@ -17271,11 +17331,7 @@ function game (request) {
|
|
|
17271
17331
|
},
|
|
17272
17332
|
},
|
|
17273
17333
|
checking: {
|
|
17274
|
-
always: [
|
|
17275
|
-
{ target: 'updatingStatus', cond: 'isStatusChanged' },
|
|
17276
|
-
{ target: 'updatingCategory', cond: 'isCategoryChanged' },
|
|
17277
|
-
{ target: 'pending' },
|
|
17278
|
-
],
|
|
17334
|
+
always: [{ target: 'updatingStatus', cond: 'isStatusChanged' }, { target: 'pending' }],
|
|
17279
17335
|
},
|
|
17280
17336
|
updatingStatus: {
|
|
17281
17337
|
invoke: {
|
|
@@ -17292,21 +17348,9 @@ function game (request) {
|
|
|
17292
17348
|
updatingOption: {
|
|
17293
17349
|
invoke: {
|
|
17294
17350
|
src: 'fetchOption',
|
|
17295
|
-
onDone: {
|
|
17296
|
-
target: 'updatingCategory',
|
|
17297
|
-
actions: 'mergeOption',
|
|
17298
|
-
},
|
|
17299
|
-
onError: {
|
|
17300
|
-
target: 'pending',
|
|
17301
|
-
},
|
|
17302
|
-
},
|
|
17303
|
-
},
|
|
17304
|
-
updatingCategory: {
|
|
17305
|
-
invoke: {
|
|
17306
|
-
src: 'getRoomItems',
|
|
17307
17351
|
onDone: {
|
|
17308
17352
|
target: 'pending',
|
|
17309
|
-
actions: '
|
|
17353
|
+
actions: 'mergeOption',
|
|
17310
17354
|
},
|
|
17311
17355
|
onError: {
|
|
17312
17356
|
target: 'pending',
|
|
@@ -17326,39 +17370,95 @@ function game (request) {
|
|
|
17326
17370
|
},
|
|
17327
17371
|
{
|
|
17328
17372
|
actions: {
|
|
17329
|
-
|
|
17330
|
-
return {
|
|
17373
|
+
setStaticData: assign((context, event) => {
|
|
17374
|
+
return {
|
|
17375
|
+
staticData: event.data,
|
|
17376
|
+
}
|
|
17377
|
+
}),
|
|
17378
|
+
setAdditionEnable: assign((context, event) => {
|
|
17379
|
+
return {
|
|
17380
|
+
additionEnable: event.data,
|
|
17381
|
+
}
|
|
17382
|
+
}),
|
|
17383
|
+
setLoadable: assign((context, event) => {
|
|
17384
|
+
return {
|
|
17385
|
+
loadable: event.data,
|
|
17386
|
+
}
|
|
17387
|
+
}),
|
|
17388
|
+
setLastPage: assign((context, event) => {
|
|
17389
|
+
const { index, content } = context;
|
|
17390
|
+
return {
|
|
17391
|
+
isLastPage: index >= content?.totalPage - 1,
|
|
17392
|
+
}
|
|
17331
17393
|
}),
|
|
17332
17394
|
setRoom: assign((context, event) => {
|
|
17333
17395
|
return {
|
|
17334
17396
|
room: event.data,
|
|
17335
|
-
roomId: event.data.id,
|
|
17336
17397
|
}
|
|
17337
17398
|
}),
|
|
17338
|
-
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17344
|
-
|
|
17345
|
-
|
|
17346
|
-
|
|
17347
|
-
|
|
17348
|
-
|
|
17349
|
-
|
|
17350
|
-
|
|
17351
|
-
|
|
17352
|
-
|
|
17353
|
-
|
|
17354
|
-
|
|
17355
|
-
|
|
17356
|
-
|
|
17357
|
-
|
|
17358
|
-
|
|
17359
|
-
|
|
17360
|
-
|
|
17361
|
-
|
|
17399
|
+
resetContent: assign((context, event) => {
|
|
17400
|
+
console.log('resetContent');
|
|
17401
|
+
return {
|
|
17402
|
+
loadable: false,
|
|
17403
|
+
isLastPage: false,
|
|
17404
|
+
index: -1,
|
|
17405
|
+
content: {
|
|
17406
|
+
data: [],
|
|
17407
|
+
timestamp: null,
|
|
17408
|
+
parentCategoryId: null,
|
|
17409
|
+
totalPage: 0,
|
|
17410
|
+
},
|
|
17411
|
+
addition: {
|
|
17412
|
+
data: [],
|
|
17413
|
+
timestamp: null,
|
|
17414
|
+
totalPage: 0,
|
|
17415
|
+
},
|
|
17416
|
+
}
|
|
17417
|
+
}),
|
|
17418
|
+
appendContent: assign((context, event) => {
|
|
17419
|
+
const { room, additionEnable } = context;
|
|
17420
|
+
if (room.categoryId === GAME_SEARCH) {
|
|
17421
|
+
return
|
|
17422
|
+
} else if (additionEnable) {
|
|
17423
|
+
const [content, addition] = event.data;
|
|
17424
|
+
return {
|
|
17425
|
+
content: {
|
|
17426
|
+
...context.content,
|
|
17427
|
+
...content,
|
|
17428
|
+
data: context.content.data.concat(content.data),
|
|
17429
|
+
},
|
|
17430
|
+
addition: {
|
|
17431
|
+
...context.addition,
|
|
17432
|
+
...addition,
|
|
17433
|
+
data: context.addition.data.concat(addition.data),
|
|
17434
|
+
},
|
|
17435
|
+
}
|
|
17436
|
+
} else {
|
|
17437
|
+
const [content] = event.data;
|
|
17438
|
+
return {
|
|
17439
|
+
content: {
|
|
17440
|
+
...context.content,
|
|
17441
|
+
...content,
|
|
17442
|
+
data: context.content.data.concat(content.data),
|
|
17443
|
+
},
|
|
17444
|
+
}
|
|
17445
|
+
}
|
|
17446
|
+
}),
|
|
17447
|
+
swapContent: assign((context, event) => {
|
|
17448
|
+
const [content, addition] = event.data;
|
|
17449
|
+
let result = {};
|
|
17450
|
+
if (content?.data?.length) {
|
|
17451
|
+
result.content = content;
|
|
17452
|
+
}
|
|
17453
|
+
if (addition?.data?.length) {
|
|
17454
|
+
result.addition = addition;
|
|
17455
|
+
}
|
|
17456
|
+
return result
|
|
17457
|
+
}),
|
|
17458
|
+
increaseIndex: assign((context, event) => {
|
|
17459
|
+
return {
|
|
17460
|
+
index: context.index + 1,
|
|
17461
|
+
}
|
|
17362
17462
|
}),
|
|
17363
17463
|
setGameURL: assign({
|
|
17364
17464
|
gameURL: (context, event) => {
|
|
@@ -17366,768 +17466,11 @@ function game (request) {
|
|
|
17366
17466
|
},
|
|
17367
17467
|
}),
|
|
17368
17468
|
clearGameInfo: assign((context, event) => {
|
|
17369
|
-
return { game: {
|
|
17469
|
+
return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
|
|
17370
17470
|
}),
|
|
17371
17471
|
setGameInfo: assign((context, event) => {
|
|
17372
|
-
const {
|
|
17373
|
-
return { game: {
|
|
17374
|
-
}),
|
|
17375
|
-
setLang: assign((context, event) => {
|
|
17376
|
-
const lang = event.data.locale.replace('-', '_');
|
|
17377
|
-
return { lang }
|
|
17378
|
-
}),
|
|
17379
|
-
setGameSHA: assign((context, event) => {
|
|
17380
|
-
const { sha } = context;
|
|
17381
|
-
const newSha = event.data;
|
|
17382
|
-
return {
|
|
17383
|
-
sha: newSha,
|
|
17384
|
-
isCategoryChanged: !sha.category || sha.category !== newSha.category,
|
|
17385
|
-
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17386
|
-
}
|
|
17387
|
-
}),
|
|
17388
|
-
setStatus: assign((context, event) => {
|
|
17389
|
-
return {
|
|
17390
|
-
statusMap: event.data,
|
|
17391
|
-
}
|
|
17392
|
-
}),
|
|
17393
|
-
mergeOption: assign((context, event) => {
|
|
17394
|
-
const { optionMap } = context;
|
|
17395
|
-
return {
|
|
17396
|
-
optionMap: { ...optionMap, ...event.data },
|
|
17397
|
-
}
|
|
17398
|
-
}),
|
|
17399
|
-
},
|
|
17400
|
-
guards: {
|
|
17401
|
-
isCategoryChanged: (context, event) => context.isCategoryChanged,
|
|
17402
|
-
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17403
|
-
},
|
|
17404
|
-
services: {
|
|
17405
|
-
getRoomItems: async (context, event) => {
|
|
17406
|
-
return await request.send(game$1.getGameCategory({ id: context.roomId }))
|
|
17407
|
-
},
|
|
17408
|
-
connectGame: async (context, event) => {
|
|
17409
|
-
const { lang, isMobile } = context;
|
|
17410
|
-
const { provider, game_id, game_type, mapping_id } = context.game;
|
|
17411
|
-
const params = {
|
|
17412
|
-
provider_id: provider,
|
|
17413
|
-
game_id: game_id,
|
|
17414
|
-
gametype_id: game_type,
|
|
17415
|
-
mapping_id: mapping_id,
|
|
17416
|
-
is_demo: false,
|
|
17417
|
-
is_mobile: isMobile,
|
|
17418
|
-
lang,
|
|
17419
|
-
return_url: window.location.href,
|
|
17420
|
-
};
|
|
17421
|
-
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17422
|
-
return { gameURL: redirect_url }
|
|
17423
|
-
},
|
|
17424
|
-
disconnectGame: async (context, event) => {
|
|
17425
|
-
const uid_site = event.data;
|
|
17426
|
-
return await request.send(game$1.logoutGame({ uid_site, provider_id: context.game.provider }))
|
|
17427
|
-
},
|
|
17428
|
-
fetchOption: async (context, event) => {
|
|
17429
|
-
return await request.send(game$1.getOptionMap())
|
|
17430
|
-
},
|
|
17431
|
-
fetchGameSHA: async (context, event) => {
|
|
17432
|
-
return await request.send(game$1.getGameSHA())
|
|
17433
|
-
},
|
|
17434
|
-
fetchStatus: async (context, event) => {
|
|
17435
|
-
return await request.send(game$1.getGameStatus())
|
|
17436
|
-
},
|
|
17437
|
-
},
|
|
17438
|
-
}
|
|
17439
|
-
)
|
|
17440
|
-
}
|
|
17441
|
-
|
|
17442
|
-
const MY_FAVORITE = 'MyFavorite';
|
|
17443
|
-
const GAME_SEARCH = 'GameSearch';
|
|
17444
|
-
|
|
17445
|
-
var constant = /*#__PURE__*/Object.freeze({
|
|
17446
|
-
__proto__: null,
|
|
17447
|
-
MY_FAVORITE: MY_FAVORITE,
|
|
17448
|
-
GAME_SEARCH: GAME_SEARCH
|
|
17449
|
-
});
|
|
17450
|
-
|
|
17451
|
-
function game_v2 (request) {
|
|
17452
|
-
return createMachine(
|
|
17453
|
-
{
|
|
17454
|
-
id: 'game',
|
|
17455
|
-
type: 'parallel',
|
|
17456
|
-
context: {
|
|
17457
|
-
room: null,
|
|
17458
|
-
index: 0,
|
|
17459
|
-
content: {
|
|
17460
|
-
data: [],
|
|
17461
|
-
timestamp: null,
|
|
17462
|
-
parentCategoryId: null,
|
|
17463
|
-
totalPage: 1,
|
|
17464
|
-
},
|
|
17465
|
-
addition: {
|
|
17466
|
-
data: [],
|
|
17467
|
-
timestamp: null,
|
|
17468
|
-
totalPage: 1,
|
|
17469
|
-
},
|
|
17470
|
-
// play params
|
|
17471
|
-
game: {
|
|
17472
|
-
providerId: null,
|
|
17473
|
-
gameId: null,
|
|
17474
|
-
gameTypeId: null,
|
|
17475
|
-
mappingId: null,
|
|
17476
|
-
portrait: null,
|
|
17477
|
-
},
|
|
17478
|
-
lang: 'en_US',
|
|
17479
|
-
isMobile: new UAParser().getResult().device.type,
|
|
17480
|
-
gameURL: null,
|
|
17481
|
-
...oldContext$1,
|
|
17482
|
-
},
|
|
17483
|
-
states: {
|
|
17484
|
-
flow: {
|
|
17485
|
-
initial: 'idle',
|
|
17486
|
-
states: {
|
|
17487
|
-
idle: {
|
|
17488
|
-
enter: 'clearGameInfo',
|
|
17489
|
-
on: {
|
|
17490
|
-
ENTER_ROOM: {
|
|
17491
|
-
target: 'loading',
|
|
17492
|
-
cond: 'isDifferentRoom',
|
|
17493
|
-
actions: ['setRoom', 'resetContent'],
|
|
17494
|
-
},
|
|
17495
|
-
NEXT_PAGE: {
|
|
17496
|
-
target: 'loading',
|
|
17497
|
-
cond: 'hasNext',
|
|
17498
|
-
actions: 'increaseIndex',
|
|
17499
|
-
},
|
|
17500
|
-
ENTER_GAME: {
|
|
17501
|
-
target: 'connecting',
|
|
17502
|
-
actions: ['setGameInfo', 'setLang'],
|
|
17503
|
-
},
|
|
17504
|
-
},
|
|
17505
|
-
},
|
|
17506
|
-
loading: {
|
|
17507
|
-
invoke: {
|
|
17508
|
-
src: 'getPageContent',
|
|
17509
|
-
onDone: {
|
|
17510
|
-
target: 'idle',
|
|
17511
|
-
actions: 'appendContent',
|
|
17512
|
-
},
|
|
17513
|
-
onError: {
|
|
17514
|
-
target: 'idle',
|
|
17515
|
-
},
|
|
17516
|
-
},
|
|
17517
|
-
},
|
|
17518
|
-
connecting: {
|
|
17519
|
-
invoke: {
|
|
17520
|
-
src: 'connectGame',
|
|
17521
|
-
onDone: {
|
|
17522
|
-
target: 'playing',
|
|
17523
|
-
actions: 'setGameURL',
|
|
17524
|
-
},
|
|
17525
|
-
onError: {
|
|
17526
|
-
target: 'idle',
|
|
17527
|
-
},
|
|
17528
|
-
},
|
|
17529
|
-
},
|
|
17530
|
-
playing: {
|
|
17531
|
-
on: {
|
|
17532
|
-
EXIT_GAME: {
|
|
17533
|
-
target: 'disconnect',
|
|
17534
|
-
},
|
|
17535
|
-
},
|
|
17536
|
-
},
|
|
17537
|
-
disconnect: {
|
|
17538
|
-
invoke: {
|
|
17539
|
-
src: 'disconnectGame',
|
|
17540
|
-
onDone: {
|
|
17541
|
-
target: 'idle',
|
|
17542
|
-
},
|
|
17543
|
-
onError: {
|
|
17544
|
-
target: 'idle',
|
|
17545
|
-
},
|
|
17546
|
-
},
|
|
17547
|
-
},
|
|
17548
|
-
},
|
|
17549
|
-
},
|
|
17550
|
-
timer: {
|
|
17551
|
-
initial: 'pending',
|
|
17552
|
-
states: {
|
|
17553
|
-
pending: {
|
|
17554
|
-
after: {
|
|
17555
|
-
20000: [
|
|
17556
|
-
{
|
|
17557
|
-
target: 'updating',
|
|
17558
|
-
cond: 'hasRoom',
|
|
17559
|
-
},
|
|
17560
|
-
{
|
|
17561
|
-
target: 'pending',
|
|
17562
|
-
},
|
|
17563
|
-
],
|
|
17564
|
-
},
|
|
17565
|
-
},
|
|
17566
|
-
updating: {
|
|
17567
|
-
invoke: {
|
|
17568
|
-
src: 'updatePageContent',
|
|
17569
|
-
onDone: {
|
|
17570
|
-
target: 'pending',
|
|
17571
|
-
actions: 'swapContent',
|
|
17572
|
-
},
|
|
17573
|
-
onError: {
|
|
17574
|
-
target: 'pending',
|
|
17575
|
-
},
|
|
17576
|
-
},
|
|
17577
|
-
},
|
|
17578
|
-
},
|
|
17579
|
-
},
|
|
17580
|
-
oldTimer: {
|
|
17581
|
-
initial: 'fetchingGameSHA',
|
|
17582
|
-
states: {
|
|
17583
|
-
fetchingGameSHA: {
|
|
17584
|
-
invoke: {
|
|
17585
|
-
src: 'fetchGameSHA',
|
|
17586
|
-
onDone: {
|
|
17587
|
-
target: 'checking',
|
|
17588
|
-
actions: 'setGameSHA',
|
|
17589
|
-
},
|
|
17590
|
-
onError: {
|
|
17591
|
-
target: 'pending',
|
|
17592
|
-
},
|
|
17593
|
-
},
|
|
17594
|
-
},
|
|
17595
|
-
checking: {
|
|
17596
|
-
always: [{ target: 'updatingStatus', cond: 'isStatusChanged' }, { target: 'pending' }],
|
|
17597
|
-
},
|
|
17598
|
-
updatingStatus: {
|
|
17599
|
-
invoke: {
|
|
17600
|
-
src: 'fetchStatus',
|
|
17601
|
-
onDone: {
|
|
17602
|
-
target: 'updatingOption',
|
|
17603
|
-
actions: ['setStatus'],
|
|
17604
|
-
},
|
|
17605
|
-
onError: {
|
|
17606
|
-
target: 'pending',
|
|
17607
|
-
},
|
|
17608
|
-
},
|
|
17609
|
-
},
|
|
17610
|
-
updatingOption: {
|
|
17611
|
-
invoke: {
|
|
17612
|
-
src: 'fetchOption',
|
|
17613
|
-
onDone: {
|
|
17614
|
-
target: 'pending',
|
|
17615
|
-
actions: 'mergeOption',
|
|
17616
|
-
},
|
|
17617
|
-
onError: {
|
|
17618
|
-
target: 'pending',
|
|
17619
|
-
},
|
|
17620
|
-
},
|
|
17621
|
-
},
|
|
17622
|
-
pending: {
|
|
17623
|
-
after: {
|
|
17624
|
-
20000: {
|
|
17625
|
-
target: 'fetchingGameSHA',
|
|
17626
|
-
},
|
|
17627
|
-
},
|
|
17628
|
-
},
|
|
17629
|
-
},
|
|
17630
|
-
},
|
|
17631
|
-
},
|
|
17632
|
-
},
|
|
17633
|
-
{
|
|
17634
|
-
actions: {
|
|
17635
|
-
setFavoriteList: assign((context, event) => {
|
|
17636
|
-
return {
|
|
17637
|
-
favoriteList: event.data.data || [],
|
|
17638
|
-
}
|
|
17639
|
-
}),
|
|
17640
|
-
setRoom: assign((context, event) => {
|
|
17641
|
-
return {
|
|
17642
|
-
room: event.data,
|
|
17643
|
-
}
|
|
17644
|
-
}),
|
|
17645
|
-
resetContent: assign((context, event) => {
|
|
17646
|
-
return {
|
|
17647
|
-
index: 0,
|
|
17648
|
-
content: {
|
|
17649
|
-
data: [],
|
|
17650
|
-
timestamp: null,
|
|
17651
|
-
parentCategoryId: null,
|
|
17652
|
-
totalPage: 1,
|
|
17653
|
-
},
|
|
17654
|
-
addition: {
|
|
17655
|
-
data: [],
|
|
17656
|
-
timestamp: null,
|
|
17657
|
-
totalPage: 1,
|
|
17658
|
-
},
|
|
17659
|
-
}
|
|
17660
|
-
}),
|
|
17661
|
-
appendContent: assign((context, event) => {
|
|
17662
|
-
const { room, favoriteList } = context;
|
|
17663
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17664
|
-
return
|
|
17665
|
-
} else {
|
|
17666
|
-
const [content, addition] = event.data;
|
|
17667
|
-
return {
|
|
17668
|
-
content: {
|
|
17669
|
-
...context.content,
|
|
17670
|
-
...content,
|
|
17671
|
-
data: context.content.data.concat(content.data),
|
|
17672
|
-
},
|
|
17673
|
-
addition: {
|
|
17674
|
-
...context.addition,
|
|
17675
|
-
...addition,
|
|
17676
|
-
data: context.addition.data.concat(addition.data),
|
|
17677
|
-
},
|
|
17678
|
-
}
|
|
17679
|
-
}
|
|
17680
|
-
}),
|
|
17681
|
-
swapContent: assign((context, event) => {
|
|
17682
|
-
const [content, addition] = event.data;
|
|
17683
|
-
let result = {};
|
|
17684
|
-
if (content?.data?.length) {
|
|
17685
|
-
result.content = content;
|
|
17686
|
-
}
|
|
17687
|
-
if (addition?.data?.length) {
|
|
17688
|
-
result.addition = addition;
|
|
17689
|
-
}
|
|
17690
|
-
return result
|
|
17691
|
-
}),
|
|
17692
|
-
increaseIndex: assign((context, event) => {
|
|
17693
|
-
return {
|
|
17694
|
-
index: context.index + 1,
|
|
17695
|
-
}
|
|
17696
|
-
}),
|
|
17697
|
-
setGameURL: assign({
|
|
17698
|
-
gameURL: (context, event) => {
|
|
17699
|
-
return event.data.gameURL
|
|
17700
|
-
},
|
|
17701
|
-
}),
|
|
17702
|
-
clearGameInfo: assign((context, event) => {
|
|
17703
|
-
return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
|
|
17704
|
-
}),
|
|
17705
|
-
setGameInfo: assign((context, event) => {
|
|
17706
|
-
const { providerId, gameId, gameTypeId, mappingId, portrait } = event.data.game;
|
|
17707
|
-
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0 } }
|
|
17708
|
-
}),
|
|
17709
|
-
setLang: assign((context, event) => {
|
|
17710
|
-
const lang = event.data.locale.replace('-', '_');
|
|
17711
|
-
return { lang }
|
|
17712
|
-
}),
|
|
17713
|
-
...oldActions$1,
|
|
17714
|
-
},
|
|
17715
|
-
guards: {
|
|
17716
|
-
isDifferentRoom: (context, event) => context.room?.categoryId !== event.data?.categoryId,
|
|
17717
|
-
hasNext: (context, event) => context.index < context?.content?.totalPage - 1,
|
|
17718
|
-
hasRoom: (context, event) => context.room?.categoryId,
|
|
17719
|
-
...oldGuards$1,
|
|
17720
|
-
},
|
|
17721
|
-
services: {
|
|
17722
|
-
getPageContent: async (context, event) => {
|
|
17723
|
-
const { room, index } = context;
|
|
17724
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17725
|
-
return
|
|
17726
|
-
} else {
|
|
17727
|
-
const param = { categoryId: room.categoryId, index };
|
|
17728
|
-
return await Promise.all([request.send(game$1.getListCategory(param)), request.send(game$1.getListAddition(param))])
|
|
17729
|
-
}
|
|
17730
|
-
},
|
|
17731
|
-
updatePageContent: async (context, event) => {
|
|
17732
|
-
const { room, content, index } = context;
|
|
17733
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17734
|
-
return
|
|
17735
|
-
} else {
|
|
17736
|
-
return await Promise.all([
|
|
17737
|
-
request.send(
|
|
17738
|
-
game$1.getListCategoryByRange({
|
|
17739
|
-
categoryId: room.categoryId,
|
|
17740
|
-
end: index,
|
|
17741
|
-
timestamp: content.timestamp,
|
|
17742
|
-
})
|
|
17743
|
-
),
|
|
17744
|
-
request.send(
|
|
17745
|
-
game$1.getListAdditionByRange({
|
|
17746
|
-
categoryId: room.categoryId,
|
|
17747
|
-
end: index,
|
|
17748
|
-
timestamp: content.timestamp,
|
|
17749
|
-
})
|
|
17750
|
-
),
|
|
17751
|
-
])
|
|
17752
|
-
}
|
|
17753
|
-
},
|
|
17754
|
-
connectGame: async (context, event) => {
|
|
17755
|
-
const { lang, isMobile } = context;
|
|
17756
|
-
const { providerId, gameId, gameTypeId, mappingId } = context.game;
|
|
17757
|
-
const params = {
|
|
17758
|
-
provider_id: providerId,
|
|
17759
|
-
game_id: gameId,
|
|
17760
|
-
gametype_id: gameTypeId,
|
|
17761
|
-
mapping_id: mappingId,
|
|
17762
|
-
is_demo: false,
|
|
17763
|
-
is_mobile: isMobile,
|
|
17764
|
-
lang,
|
|
17765
|
-
return_url: window.location.href,
|
|
17766
|
-
};
|
|
17767
|
-
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17768
|
-
return { gameURL: redirect_url }
|
|
17769
|
-
},
|
|
17770
|
-
disconnectGame: async (context, event) => {
|
|
17771
|
-
const uid_site = event.data;
|
|
17772
|
-
const provider_id = context.game.providerId;
|
|
17773
|
-
return await request.send(game$1.logoutGame({ uid_site, provider_id }))
|
|
17774
|
-
},
|
|
17775
|
-
...oldServices$1(request),
|
|
17776
|
-
},
|
|
17777
|
-
}
|
|
17778
|
-
)
|
|
17779
|
-
}
|
|
17780
|
-
|
|
17781
|
-
const oldContext$1 = {
|
|
17782
|
-
sha: {
|
|
17783
|
-
status: null,
|
|
17784
|
-
},
|
|
17785
|
-
isStatusChanged: false,
|
|
17786
|
-
statusMap: {},
|
|
17787
|
-
optionMap: {},
|
|
17788
|
-
};
|
|
17789
|
-
|
|
17790
|
-
const oldActions$1 = {
|
|
17791
|
-
setGameSHA: assign((context, event) => {
|
|
17792
|
-
const { sha } = context;
|
|
17793
|
-
const newSha = event.data;
|
|
17794
|
-
return {
|
|
17795
|
-
sha: newSha,
|
|
17796
|
-
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17797
|
-
}
|
|
17798
|
-
}),
|
|
17799
|
-
setStatus: assign((context, event) => {
|
|
17800
|
-
return {
|
|
17801
|
-
statusMap: event.data,
|
|
17802
|
-
}
|
|
17803
|
-
}),
|
|
17804
|
-
mergeOption: assign((context, event) => {
|
|
17805
|
-
const { optionMap } = context;
|
|
17806
|
-
return {
|
|
17807
|
-
optionMap: { ...optionMap, ...event.data },
|
|
17808
|
-
}
|
|
17809
|
-
}),
|
|
17810
|
-
};
|
|
17811
|
-
|
|
17812
|
-
const oldGuards$1 = {
|
|
17813
|
-
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17814
|
-
};
|
|
17815
|
-
|
|
17816
|
-
const oldServices$1 = (request) => ({
|
|
17817
|
-
fetchOption: async (context, event) => {
|
|
17818
|
-
return await request.send(game$1.getOptionMap())
|
|
17819
|
-
},
|
|
17820
|
-
fetchGameSHA: async (context, event) => {
|
|
17821
|
-
return await request.send(game$1.getGameSHA())
|
|
17822
|
-
},
|
|
17823
|
-
fetchStatus: async (context, event) => {
|
|
17824
|
-
return await request.send(game$1.getGameStatus())
|
|
17825
|
-
},
|
|
17826
|
-
});
|
|
17827
|
-
|
|
17828
|
-
// 對應 intersectionObserver 版本
|
|
17829
|
-
function game_v2_1 (request) {
|
|
17830
|
-
return createMachine(
|
|
17831
|
-
{
|
|
17832
|
-
id: 'game',
|
|
17833
|
-
type: 'parallel',
|
|
17834
|
-
context: {
|
|
17835
|
-
base: '/',
|
|
17836
|
-
loadable: false,
|
|
17837
|
-
isLastPage: false,
|
|
17838
|
-
room: null,
|
|
17839
|
-
index: -1,
|
|
17840
|
-
content: {
|
|
17841
|
-
data: [],
|
|
17842
|
-
timestamp: null,
|
|
17843
|
-
parentCategoryId: null,
|
|
17844
|
-
totalPage: 0,
|
|
17845
|
-
},
|
|
17846
|
-
additionEnable: false,
|
|
17847
|
-
addition: {
|
|
17848
|
-
data: [],
|
|
17849
|
-
timestamp: null,
|
|
17850
|
-
totalPage: 0,
|
|
17851
|
-
},
|
|
17852
|
-
// play params
|
|
17853
|
-
game: {
|
|
17854
|
-
providerId: null,
|
|
17855
|
-
gameId: null,
|
|
17856
|
-
gameTypeId: null,
|
|
17857
|
-
mappingId: null,
|
|
17858
|
-
portrait: null,
|
|
17859
|
-
},
|
|
17860
|
-
lang: 'en_US',
|
|
17861
|
-
isMobile: new UAParser().getResult().device.type,
|
|
17862
|
-
gameURL: null,
|
|
17863
|
-
...oldContext,
|
|
17864
|
-
},
|
|
17865
|
-
states: {
|
|
17866
|
-
flow: {
|
|
17867
|
-
initial: 'idle',
|
|
17868
|
-
states: {
|
|
17869
|
-
idle: {
|
|
17870
|
-
enter: 'clearGameInfo',
|
|
17871
|
-
on: {
|
|
17872
|
-
SET_ADDITION_ENABLE: {
|
|
17873
|
-
actions: 'setAdditionEnable',
|
|
17874
|
-
},
|
|
17875
|
-
LOAD: {
|
|
17876
|
-
target: 'routing',
|
|
17877
|
-
actions: 'setLoadable',
|
|
17878
|
-
},
|
|
17879
|
-
SET_ROOM: {
|
|
17880
|
-
cond: 'isDifferentRoom',
|
|
17881
|
-
actions: ['setRoom', 'resetContent'],
|
|
17882
|
-
},
|
|
17883
|
-
ENTER_GAME: {
|
|
17884
|
-
target: 'connecting',
|
|
17885
|
-
actions: ['setGameInfo', 'setLang'],
|
|
17886
|
-
},
|
|
17887
|
-
},
|
|
17888
|
-
},
|
|
17889
|
-
loading: {
|
|
17890
|
-
entry: 'increaseIndex',
|
|
17891
|
-
invoke: {
|
|
17892
|
-
src: 'getPageContent',
|
|
17893
|
-
onDone: {
|
|
17894
|
-
target: 'routing',
|
|
17895
|
-
actions: ['appendContent', 'setLastPage'],
|
|
17896
|
-
},
|
|
17897
|
-
onError: {
|
|
17898
|
-
target: 'idle',
|
|
17899
|
-
},
|
|
17900
|
-
},
|
|
17901
|
-
on: {
|
|
17902
|
-
LOAD: { actions: 'setLoadable' },
|
|
17903
|
-
},
|
|
17904
|
-
},
|
|
17905
|
-
routing: {
|
|
17906
|
-
always: [
|
|
17907
|
-
{
|
|
17908
|
-
target: 'loading',
|
|
17909
|
-
cond: 'hasNext',
|
|
17910
|
-
},
|
|
17911
|
-
{ target: 'idle' },
|
|
17912
|
-
],
|
|
17913
|
-
},
|
|
17914
|
-
connecting: {
|
|
17915
|
-
invoke: {
|
|
17916
|
-
src: 'connectGame',
|
|
17917
|
-
onDone: {
|
|
17918
|
-
target: 'playing',
|
|
17919
|
-
actions: 'setGameURL',
|
|
17920
|
-
},
|
|
17921
|
-
onError: {
|
|
17922
|
-
target: 'idle',
|
|
17923
|
-
},
|
|
17924
|
-
},
|
|
17925
|
-
},
|
|
17926
|
-
playing: {
|
|
17927
|
-
on: {
|
|
17928
|
-
EXIT_GAME: {
|
|
17929
|
-
target: 'disconnect',
|
|
17930
|
-
},
|
|
17931
|
-
},
|
|
17932
|
-
},
|
|
17933
|
-
disconnect: {
|
|
17934
|
-
invoke: {
|
|
17935
|
-
src: 'disconnectGame',
|
|
17936
|
-
onDone: {
|
|
17937
|
-
target: 'idle',
|
|
17938
|
-
},
|
|
17939
|
-
onError: {
|
|
17940
|
-
target: 'idle',
|
|
17941
|
-
},
|
|
17942
|
-
},
|
|
17943
|
-
},
|
|
17944
|
-
},
|
|
17945
|
-
},
|
|
17946
|
-
timer: {
|
|
17947
|
-
initial: 'pending',
|
|
17948
|
-
states: {
|
|
17949
|
-
pending: {
|
|
17950
|
-
after: {
|
|
17951
|
-
20000: [
|
|
17952
|
-
{
|
|
17953
|
-
target: 'updating',
|
|
17954
|
-
cond: 'hasRoom',
|
|
17955
|
-
},
|
|
17956
|
-
{
|
|
17957
|
-
target: 'pending',
|
|
17958
|
-
},
|
|
17959
|
-
],
|
|
17960
|
-
},
|
|
17961
|
-
},
|
|
17962
|
-
updating: {
|
|
17963
|
-
invoke: {
|
|
17964
|
-
src: 'updatePageContent',
|
|
17965
|
-
onDone: {
|
|
17966
|
-
target: 'pending',
|
|
17967
|
-
actions: 'swapContent',
|
|
17968
|
-
},
|
|
17969
|
-
onError: {
|
|
17970
|
-
target: 'pending',
|
|
17971
|
-
},
|
|
17972
|
-
},
|
|
17973
|
-
},
|
|
17974
|
-
},
|
|
17975
|
-
},
|
|
17976
|
-
oldTimer: {
|
|
17977
|
-
initial: 'fetchingGameSHA',
|
|
17978
|
-
states: {
|
|
17979
|
-
fetchingGameSHA: {
|
|
17980
|
-
invoke: {
|
|
17981
|
-
src: 'fetchGameSHA',
|
|
17982
|
-
onDone: {
|
|
17983
|
-
target: 'checking',
|
|
17984
|
-
actions: 'setGameSHA',
|
|
17985
|
-
},
|
|
17986
|
-
onError: {
|
|
17987
|
-
target: 'pending',
|
|
17988
|
-
},
|
|
17989
|
-
},
|
|
17990
|
-
},
|
|
17991
|
-
checking: {
|
|
17992
|
-
always: [{ target: 'updatingStatus', cond: 'isStatusChanged' }, { target: 'pending' }],
|
|
17993
|
-
},
|
|
17994
|
-
updatingStatus: {
|
|
17995
|
-
invoke: {
|
|
17996
|
-
src: 'fetchStatus',
|
|
17997
|
-
onDone: {
|
|
17998
|
-
target: 'updatingOption',
|
|
17999
|
-
actions: ['setStatus'],
|
|
18000
|
-
},
|
|
18001
|
-
onError: {
|
|
18002
|
-
target: 'pending',
|
|
18003
|
-
},
|
|
18004
|
-
},
|
|
18005
|
-
},
|
|
18006
|
-
updatingOption: {
|
|
18007
|
-
invoke: {
|
|
18008
|
-
src: 'fetchOption',
|
|
18009
|
-
onDone: {
|
|
18010
|
-
target: 'pending',
|
|
18011
|
-
actions: 'mergeOption',
|
|
18012
|
-
},
|
|
18013
|
-
onError: {
|
|
18014
|
-
target: 'pending',
|
|
18015
|
-
},
|
|
18016
|
-
},
|
|
18017
|
-
},
|
|
18018
|
-
pending: {
|
|
18019
|
-
after: {
|
|
18020
|
-
20000: {
|
|
18021
|
-
target: 'fetchingGameSHA',
|
|
18022
|
-
},
|
|
18023
|
-
},
|
|
18024
|
-
},
|
|
18025
|
-
},
|
|
18026
|
-
},
|
|
18027
|
-
},
|
|
18028
|
-
},
|
|
18029
|
-
{
|
|
18030
|
-
actions: {
|
|
18031
|
-
setAdditionEnable: assign((context, event) => {
|
|
18032
|
-
return {
|
|
18033
|
-
additionEnable: event.data,
|
|
18034
|
-
}
|
|
18035
|
-
}),
|
|
18036
|
-
setLoadable: assign((context, event) => {
|
|
18037
|
-
return {
|
|
18038
|
-
loadable: event.data,
|
|
18039
|
-
}
|
|
18040
|
-
}),
|
|
18041
|
-
setLastPage: assign((context, event) => {
|
|
18042
|
-
const { index, content } = context;
|
|
18043
|
-
return {
|
|
18044
|
-
isLastPage: index >= content?.totalPage - 1,
|
|
18045
|
-
}
|
|
18046
|
-
}),
|
|
18047
|
-
setFavoriteList: assign((context, event) => {
|
|
18048
|
-
return {
|
|
18049
|
-
favoriteList: event.data.data || [],
|
|
18050
|
-
}
|
|
18051
|
-
}),
|
|
18052
|
-
setRoom: assign((context, event) => {
|
|
18053
|
-
return {
|
|
18054
|
-
room: event.data,
|
|
18055
|
-
}
|
|
18056
|
-
}),
|
|
18057
|
-
resetContent: assign((context, event) => {
|
|
18058
|
-
return {
|
|
18059
|
-
loadable: false,
|
|
18060
|
-
isLastPage: false,
|
|
18061
|
-
index: -1,
|
|
18062
|
-
content: {
|
|
18063
|
-
data: [],
|
|
18064
|
-
timestamp: null,
|
|
18065
|
-
parentCategoryId: null,
|
|
18066
|
-
totalPage: 0,
|
|
18067
|
-
},
|
|
18068
|
-
addition: {
|
|
18069
|
-
data: [],
|
|
18070
|
-
timestamp: null,
|
|
18071
|
-
totalPage: 0,
|
|
18072
|
-
},
|
|
18073
|
-
}
|
|
18074
|
-
}),
|
|
18075
|
-
appendContent: assign((context, event) => {
|
|
18076
|
-
const { room, additionEnable } = context;
|
|
18077
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
18078
|
-
return
|
|
18079
|
-
} else if (additionEnable) {
|
|
18080
|
-
const [content, addition] = event.data;
|
|
18081
|
-
return {
|
|
18082
|
-
content: {
|
|
18083
|
-
...context.content,
|
|
18084
|
-
...content,
|
|
18085
|
-
data: context.content.data.concat(content.data),
|
|
18086
|
-
},
|
|
18087
|
-
addition: {
|
|
18088
|
-
...context.addition,
|
|
18089
|
-
...addition,
|
|
18090
|
-
data: context.addition.data.concat(addition.data),
|
|
18091
|
-
},
|
|
18092
|
-
}
|
|
18093
|
-
} else {
|
|
18094
|
-
const [content] = event.data;
|
|
18095
|
-
return {
|
|
18096
|
-
content: {
|
|
18097
|
-
...context.content,
|
|
18098
|
-
...content,
|
|
18099
|
-
data: context.content.data.concat(content.data),
|
|
18100
|
-
},
|
|
18101
|
-
}
|
|
18102
|
-
}
|
|
18103
|
-
}),
|
|
18104
|
-
swapContent: assign((context, event) => {
|
|
18105
|
-
const [content, addition] = event.data;
|
|
18106
|
-
let result = {};
|
|
18107
|
-
if (content?.data?.length) {
|
|
18108
|
-
result.content = content;
|
|
18109
|
-
}
|
|
18110
|
-
if (addition?.data?.length) {
|
|
18111
|
-
result.addition = addition;
|
|
18112
|
-
}
|
|
18113
|
-
return result
|
|
18114
|
-
}),
|
|
18115
|
-
increaseIndex: assign((context, event) => {
|
|
18116
|
-
return {
|
|
18117
|
-
index: context.index + 1,
|
|
18118
|
-
}
|
|
18119
|
-
}),
|
|
18120
|
-
setGameURL: assign({
|
|
18121
|
-
gameURL: (context, event) => {
|
|
18122
|
-
return event.data.gameURL
|
|
18123
|
-
},
|
|
18124
|
-
}),
|
|
18125
|
-
clearGameInfo: assign((context, event) => {
|
|
18126
|
-
return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
|
|
18127
|
-
}),
|
|
18128
|
-
setGameInfo: assign((context, event) => {
|
|
18129
|
-
const { providerId, gameId, gameTypeId, mappingId, portrait } = event.data.game;
|
|
18130
|
-
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0 } }
|
|
17472
|
+
const { providerId, gameId, gameTypeId, mappingId, portrait } = event.data.game;
|
|
17473
|
+
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0 } }
|
|
18131
17474
|
}),
|
|
18132
17475
|
setLang: assign((context, event) => {
|
|
18133
17476
|
const lang = event.data.locale.replace('-', '_');
|
|
@@ -18146,32 +17489,44 @@ function game_v2_1 (request) {
|
|
|
18146
17489
|
},
|
|
18147
17490
|
services: {
|
|
18148
17491
|
getPageContent: async (context, event) => {
|
|
18149
|
-
const { room, index, additionEnable } = context;
|
|
17492
|
+
const { room, index, additionEnable, staticData } = context;
|
|
18150
17493
|
if (room.categoryId === GAME_SEARCH) {
|
|
18151
17494
|
return
|
|
17495
|
+
} else if (!request.getToken()) {
|
|
17496
|
+
const list = staticData.find((data) => data.category == room.categoryId)?.info || [];
|
|
17497
|
+
|
|
17498
|
+
return [
|
|
17499
|
+
{
|
|
17500
|
+
data: list.slice(index * 20, (index + 1) * 20),
|
|
17501
|
+
totalPage: Math.ceil(list.length / 20),
|
|
17502
|
+
timestamp: Math.floor(Date.now() / 1000),
|
|
17503
|
+
},
|
|
17504
|
+
]
|
|
18152
17505
|
} else if (additionEnable) {
|
|
18153
17506
|
const param = { categoryId: room.categoryId, index };
|
|
18154
|
-
return await Promise.all([request.send(game
|
|
17507
|
+
return await Promise.all([request.send(game.getListCategory(param)), request.send(game.getListAddition(param))])
|
|
18155
17508
|
} else {
|
|
18156
17509
|
const param = { categoryId: room.categoryId, index };
|
|
18157
|
-
return await Promise.all([request.send(game
|
|
17510
|
+
return await Promise.all([request.send(game.getListCategory(param))])
|
|
18158
17511
|
}
|
|
18159
17512
|
},
|
|
18160
17513
|
updatePageContent: async (context, event) => {
|
|
18161
17514
|
const { room, content, index, additionEnable } = context;
|
|
18162
17515
|
if (room.categoryId === GAME_SEARCH) {
|
|
18163
17516
|
return
|
|
17517
|
+
} else if (!request.getToken()) {
|
|
17518
|
+
return []
|
|
18164
17519
|
} else if (additionEnable) {
|
|
18165
17520
|
return await Promise.all([
|
|
18166
17521
|
request.send(
|
|
18167
|
-
game
|
|
17522
|
+
game.getListCategoryByRange({
|
|
18168
17523
|
categoryId: room.categoryId,
|
|
18169
17524
|
end: index,
|
|
18170
17525
|
timestamp: content.timestamp,
|
|
18171
17526
|
})
|
|
18172
17527
|
),
|
|
18173
17528
|
request.send(
|
|
18174
|
-
game
|
|
17529
|
+
game.getListAdditionByRange({
|
|
18175
17530
|
categoryId: room.categoryId,
|
|
18176
17531
|
end: index,
|
|
18177
17532
|
timestamp: content.timestamp,
|
|
@@ -18181,7 +17536,7 @@ function game_v2_1 (request) {
|
|
|
18181
17536
|
} else {
|
|
18182
17537
|
return await Promise.all([
|
|
18183
17538
|
request.send(
|
|
18184
|
-
game
|
|
17539
|
+
game.getListCategoryByRange({
|
|
18185
17540
|
categoryId: room.categoryId,
|
|
18186
17541
|
end: index,
|
|
18187
17542
|
timestamp: content.timestamp,
|
|
@@ -18204,13 +17559,13 @@ function game_v2_1 (request) {
|
|
|
18204
17559
|
lang,
|
|
18205
17560
|
return_url: returnProviders.includes(providerId) ? `${window.location.origin}${context.base}return` : window.location.href, // For providers to return.
|
|
18206
17561
|
};
|
|
18207
|
-
const { redirect_url } = await request.send(game
|
|
17562
|
+
const { redirect_url } = await request.send(game.playGame(params));
|
|
18208
17563
|
return { gameURL: redirect_url }
|
|
18209
17564
|
},
|
|
18210
17565
|
disconnectGame: async (context, event) => {
|
|
18211
17566
|
const uid_site = event.data;
|
|
18212
17567
|
const provider_id = context.game.providerId;
|
|
18213
|
-
return await request.send(game
|
|
17568
|
+
return await request.send(game.logoutGame({ uid_site, provider_id }))
|
|
18214
17569
|
},
|
|
18215
17570
|
...oldServices(request),
|
|
18216
17571
|
},
|
|
@@ -18255,137 +17610,26 @@ const oldGuards = {
|
|
|
18255
17610
|
|
|
18256
17611
|
const oldServices = (request) => ({
|
|
18257
17612
|
fetchOption: async (context, event) => {
|
|
18258
|
-
|
|
17613
|
+
if (request.getToken()) {
|
|
17614
|
+
return await request.send(game.getOptionMap())
|
|
17615
|
+
}
|
|
18259
17616
|
},
|
|
18260
17617
|
fetchGameSHA: async (context, event) => {
|
|
18261
|
-
|
|
17618
|
+
if (request.getToken()) {
|
|
17619
|
+
return await request.send(game.getGameSHA())
|
|
17620
|
+
} else {
|
|
17621
|
+
return {
|
|
17622
|
+
status: null,
|
|
17623
|
+
}
|
|
17624
|
+
}
|
|
18262
17625
|
},
|
|
18263
17626
|
fetchStatus: async (context, event) => {
|
|
18264
|
-
|
|
17627
|
+
if (request.getToken()) {
|
|
17628
|
+
return await request.send(game.getGameStatus())
|
|
17629
|
+
}
|
|
18265
17630
|
},
|
|
18266
17631
|
});
|
|
18267
17632
|
|
|
18268
|
-
function game_favorite (request) {
|
|
18269
|
-
return createMachine(
|
|
18270
|
-
{
|
|
18271
|
-
id: 'favorite',
|
|
18272
|
-
type: 'parallel',
|
|
18273
|
-
context: {
|
|
18274
|
-
list: [],
|
|
18275
|
-
},
|
|
18276
|
-
states: {
|
|
18277
|
-
fetching: {
|
|
18278
|
-
initial: 'disable',
|
|
18279
|
-
states: {
|
|
18280
|
-
disable: {},
|
|
18281
|
-
enable: {
|
|
18282
|
-
invoke: {
|
|
18283
|
-
src: 'fetchList',
|
|
18284
|
-
onDone: {
|
|
18285
|
-
actions: 'setList',
|
|
18286
|
-
},
|
|
18287
|
-
onError: {
|
|
18288
|
-
actions: assign({ list: [] }),
|
|
18289
|
-
},
|
|
18290
|
-
},
|
|
18291
|
-
},
|
|
18292
|
-
},
|
|
18293
|
-
},
|
|
18294
|
-
adding: {
|
|
18295
|
-
initial: 'disable',
|
|
18296
|
-
states: {
|
|
18297
|
-
disable: {},
|
|
18298
|
-
enable: {
|
|
18299
|
-
invoke: {
|
|
18300
|
-
src: 'add',
|
|
18301
|
-
onDone: {},
|
|
18302
|
-
onError: {
|
|
18303
|
-
actions: 'removeFromList',
|
|
18304
|
-
},
|
|
18305
|
-
},
|
|
18306
|
-
},
|
|
18307
|
-
},
|
|
18308
|
-
},
|
|
18309
|
-
removing: {
|
|
18310
|
-
initial: 'disable',
|
|
18311
|
-
states: {
|
|
18312
|
-
disable: {},
|
|
18313
|
-
enable: {
|
|
18314
|
-
invoke: {
|
|
18315
|
-
src: 'remove',
|
|
18316
|
-
onDone: {},
|
|
18317
|
-
onError: {
|
|
18318
|
-
actions: 'addToList',
|
|
18319
|
-
},
|
|
18320
|
-
},
|
|
18321
|
-
},
|
|
18322
|
-
},
|
|
18323
|
-
},
|
|
18324
|
-
},
|
|
18325
|
-
on: {
|
|
18326
|
-
FETCH_LIST: {
|
|
18327
|
-
target: 'fetching.enable',
|
|
18328
|
-
},
|
|
18329
|
-
ADD: {
|
|
18330
|
-
target: 'adding.enable',
|
|
18331
|
-
actions: 'addToList',
|
|
18332
|
-
cond: 'isNotExist',
|
|
18333
|
-
},
|
|
18334
|
-
REMOVE: {
|
|
18335
|
-
target: 'removing.enable',
|
|
18336
|
-
actions: 'removeFromList',
|
|
18337
|
-
cond: 'isExist',
|
|
18338
|
-
},
|
|
18339
|
-
},
|
|
18340
|
-
},
|
|
18341
|
-
{
|
|
18342
|
-
actions: {
|
|
18343
|
-
setList: assign((context, event) => {
|
|
18344
|
-
return {
|
|
18345
|
-
list: event.data,
|
|
18346
|
-
}
|
|
18347
|
-
}),
|
|
18348
|
-
addToList: assign((context, event) => {
|
|
18349
|
-
return {
|
|
18350
|
-
list: [...context.list, event.data],
|
|
18351
|
-
}
|
|
18352
|
-
}),
|
|
18353
|
-
removeFromList: assign((context, event) => {
|
|
18354
|
-
return {
|
|
18355
|
-
list: context.list.filter((item) => item !== event.data),
|
|
18356
|
-
}
|
|
18357
|
-
}),
|
|
18358
|
-
},
|
|
18359
|
-
guards: {
|
|
18360
|
-
isExist: (context, event) => context.list.includes(event.data),
|
|
18361
|
-
isNotExist: (context, event) => !context.list.includes(event.data),
|
|
18362
|
-
},
|
|
18363
|
-
services: {
|
|
18364
|
-
add: async (context, event) => {
|
|
18365
|
-
try {
|
|
18366
|
-
return await request.send(game$1.addFavoriteGame(event.data))
|
|
18367
|
-
} catch (error) {
|
|
18368
|
-
throw event.data
|
|
18369
|
-
}
|
|
18370
|
-
},
|
|
18371
|
-
remove: async (context, event) => {
|
|
18372
|
-
try {
|
|
18373
|
-
return await request.send(game$1.removeFavoriteGame(event.data))
|
|
18374
|
-
} catch (error) {
|
|
18375
|
-
throw event.data
|
|
18376
|
-
}
|
|
18377
|
-
},
|
|
18378
|
-
fetchList: async (context, event) => {
|
|
18379
|
-
const main = await request.send(game$1.getGameCategory({}));
|
|
18380
|
-
const room = main.list.find((item) => item.category === 'SYSTEM_MY_FAVORITE');
|
|
18381
|
-
const favorite = await request.send(game$1.getGameCategory({ id: room.id }));
|
|
18382
|
-
return favorite.list.map((item) => item.g)
|
|
18383
|
-
},
|
|
18384
|
-
},
|
|
18385
|
-
}
|
|
18386
|
-
)
|
|
18387
|
-
}
|
|
18388
|
-
|
|
18389
17633
|
function game_favorite_v2 (request) {
|
|
18390
17634
|
return createMachine(
|
|
18391
17635
|
{
|
|
@@ -18480,7 +17724,7 @@ function game_favorite_v2 (request) {
|
|
|
18480
17724
|
services: {
|
|
18481
17725
|
add: async (context, event) => {
|
|
18482
17726
|
try {
|
|
18483
|
-
await request.send(game
|
|
17727
|
+
await request.send(game.addListFavorite(event.data.gameCode));
|
|
18484
17728
|
return event.data
|
|
18485
17729
|
} catch (error) {
|
|
18486
17730
|
throw event.data
|
|
@@ -18488,15 +17732,19 @@ function game_favorite_v2 (request) {
|
|
|
18488
17732
|
},
|
|
18489
17733
|
remove: async (context, event) => {
|
|
18490
17734
|
try {
|
|
18491
|
-
await request.send(game
|
|
17735
|
+
await request.send(game.removeListFavorite(event.data.gameCode));
|
|
18492
17736
|
return event.data
|
|
18493
17737
|
} catch (error) {
|
|
18494
17738
|
throw event.data
|
|
18495
17739
|
}
|
|
18496
17740
|
},
|
|
18497
17741
|
fetchList: async (context, event) => {
|
|
18498
|
-
|
|
18499
|
-
|
|
17742
|
+
if (request.getToken()) {
|
|
17743
|
+
const { data } = await request.send(game.getListMyFavorite());
|
|
17744
|
+
return data
|
|
17745
|
+
} else {
|
|
17746
|
+
return []
|
|
17747
|
+
}
|
|
18500
17748
|
},
|
|
18501
17749
|
},
|
|
18502
17750
|
}
|
|
@@ -18728,17 +17976,17 @@ function game_search (request) {
|
|
|
18728
17976
|
services: {
|
|
18729
17977
|
fetchTags: async (context, event) => {
|
|
18730
17978
|
const { keyword } = context;
|
|
18731
|
-
const { result } = await request.send(game
|
|
17979
|
+
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
18732
17980
|
return result
|
|
18733
17981
|
},
|
|
18734
17982
|
fetchGames: async (context, event) => {
|
|
18735
17983
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
18736
|
-
const { traceId, result } = await request.send(game
|
|
17984
|
+
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
18737
17985
|
return { traceId, result }
|
|
18738
17986
|
},
|
|
18739
17987
|
sendTrace: async (context, event) => {
|
|
18740
17988
|
const { traceId, tagId, tagIndex, gameCode, gameCodeIndex, keyword: query, click, clickDefault } = context;
|
|
18741
|
-
return await request.send(game
|
|
17989
|
+
return await request.send(game.setGameSearchTrace({ traceId, tagId, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault }))
|
|
18742
17990
|
},
|
|
18743
17991
|
},
|
|
18744
17992
|
}
|
|
@@ -19071,16 +18319,16 @@ function game_search_v2 (request) {
|
|
|
19071
18319
|
services: {
|
|
19072
18320
|
fetchTags: async (context, event) => {
|
|
19073
18321
|
const { keyword } = context;
|
|
19074
|
-
const { result } = await request.send(game
|
|
18322
|
+
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
19075
18323
|
return result
|
|
19076
18324
|
},
|
|
19077
18325
|
fetchInitialData: async (context, event) => {
|
|
19078
|
-
const data = await request.send(game
|
|
18326
|
+
const data = await request.send(game.getGameSearchHome());
|
|
19079
18327
|
return data
|
|
19080
18328
|
},
|
|
19081
18329
|
fetchGames: async (context, event) => {
|
|
19082
18330
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
19083
|
-
const { traceId, result } = await request.send(game
|
|
18331
|
+
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
19084
18332
|
return { traceId, result }
|
|
19085
18333
|
},
|
|
19086
18334
|
sendTrace: async (context, event) => {
|
|
@@ -19102,7 +18350,7 @@ function game_search_v2 (request) {
|
|
|
19102
18350
|
id = null;
|
|
19103
18351
|
}
|
|
19104
18352
|
return await request.send(
|
|
19105
|
-
game
|
|
18353
|
+
game.setGameSearchTrace({
|
|
19106
18354
|
traceId,
|
|
19107
18355
|
tagId: id,
|
|
19108
18356
|
tagIndex,
|
|
@@ -19183,12 +18431,12 @@ function game_hot_new (request) {
|
|
|
19183
18431
|
},
|
|
19184
18432
|
services: {
|
|
19185
18433
|
getRoomItems: async (context, event) => {
|
|
19186
|
-
return await request.send(game
|
|
18434
|
+
return await request.send(game.getGameCategory({ id: context.roomId }))
|
|
19187
18435
|
},
|
|
19188
18436
|
getGames: async (context, event) => {
|
|
19189
18437
|
const [resHot, resNew] = await Promise.all([
|
|
19190
|
-
request.send(game
|
|
19191
|
-
request.send(game
|
|
18438
|
+
request.send(game.getGameCategory({ id: context.hot.id })),
|
|
18439
|
+
request.send(game.getGameCategory({ id: context.new.id })),
|
|
19192
18440
|
]);
|
|
19193
18441
|
const hotGames = resHot?.list?.map?.((item) => item.g);
|
|
19194
18442
|
const newGames = resNew?.list?.map?.((item) => item.g);
|
|
@@ -20028,7 +19276,7 @@ function side (request) {
|
|
|
20028
19276
|
},
|
|
20029
19277
|
services: {
|
|
20030
19278
|
getRoomItems: async (context, event) => {
|
|
20031
|
-
return await request.send(game
|
|
19279
|
+
return await request.send(game.getGameCategory({ id: context.room?.id }))
|
|
20032
19280
|
},
|
|
20033
19281
|
},
|
|
20034
19282
|
}
|
|
@@ -20192,10 +19440,10 @@ function side_v2 (request) {
|
|
|
20192
19440
|
},
|
|
20193
19441
|
services: {
|
|
20194
19442
|
getMenu: async (context, event) => {
|
|
20195
|
-
return await request.send(game
|
|
19443
|
+
return await request.send(game.getListRoot())
|
|
20196
19444
|
},
|
|
20197
19445
|
fetchUpdateMenu: async (context, event) => {
|
|
20198
|
-
return await request.send(game
|
|
19446
|
+
return await request.send(game.getListRoot({ timestamp: context.menu.timestamp }))
|
|
20199
19447
|
},
|
|
20200
19448
|
},
|
|
20201
19449
|
}
|
|
@@ -20312,7 +19560,7 @@ function user_sign_up (request) {
|
|
|
20312
19560
|
channel: null,
|
|
20313
19561
|
subchannel: null,
|
|
20314
19562
|
signUpData: {},
|
|
20315
|
-
|
|
19563
|
+
fc: null,
|
|
20316
19564
|
reCaptchaToken: null,
|
|
20317
19565
|
registrationData: {
|
|
20318
19566
|
account: null,
|
|
@@ -20359,9 +19607,9 @@ function user_sign_up (request) {
|
|
|
20359
19607
|
}
|
|
20360
19608
|
}),
|
|
20361
19609
|
setAffiliate: assign((context, event) => {
|
|
20362
|
-
const {
|
|
19610
|
+
const { fc } = event.data;
|
|
20363
19611
|
return {
|
|
20364
|
-
|
|
19612
|
+
fc,
|
|
20365
19613
|
}
|
|
20366
19614
|
}),
|
|
20367
19615
|
setSignUpPhone: assign((context, event) => {
|
|
@@ -20410,7 +19658,7 @@ function user_sign_up (request) {
|
|
|
20410
19658
|
const dt = await getDeviceToken({ fpToken, sentry, hosts: request.hosts });
|
|
20411
19659
|
sentry.setTag('dt', dt);
|
|
20412
19660
|
|
|
20413
|
-
const
|
|
19661
|
+
const affiliateCode = storage.get('ac');
|
|
20414
19662
|
const messages = {
|
|
20415
19663
|
url: window.location.href,
|
|
20416
19664
|
channelOrders: [
|
|
@@ -20418,13 +19666,13 @@ function user_sign_up (request) {
|
|
|
20418
19666
|
{ channel: defaultChannel, subchannel: defaultSubchannel },
|
|
20419
19667
|
{ channel: channel, subchannel: subchannel },
|
|
20420
19668
|
],
|
|
20421
|
-
|
|
19669
|
+
affiliateCode,
|
|
20422
19670
|
};
|
|
20423
19671
|
sentry.captureMessage(JSON.stringify(messages));
|
|
20424
19672
|
|
|
20425
19673
|
const referralObj = {};
|
|
20426
|
-
if (![undefined, 'undefined', null, 'null'].includes(
|
|
20427
|
-
referralObj.
|
|
19674
|
+
if (![undefined, 'undefined', null, 'null'].includes(affiliateCode)) {
|
|
19675
|
+
referralObj.ac = affiliateCode;
|
|
20428
19676
|
}
|
|
20429
19677
|
|
|
20430
19678
|
referralObj.channel = storage.get('channel') || defaultChannel || channel;
|
|
@@ -20436,7 +19684,7 @@ function user_sign_up (request) {
|
|
|
20436
19684
|
...referralObj,
|
|
20437
19685
|
dt,
|
|
20438
19686
|
reCaptchaToken: context.reCaptchaToken,
|
|
20439
|
-
|
|
19687
|
+
fc: context.fc,
|
|
20440
19688
|
})
|
|
20441
19689
|
)
|
|
20442
19690
|
},
|
|
@@ -28266,9 +27514,6 @@ var index$1 = {
|
|
|
28266
27514
|
common,
|
|
28267
27515
|
deposit,
|
|
28268
27516
|
error,
|
|
28269
|
-
game,
|
|
28270
|
-
game_v2,
|
|
28271
|
-
game_favorite,
|
|
28272
27517
|
game_favorite_v2,
|
|
28273
27518
|
game_search,
|
|
28274
27519
|
game_search_v2,
|
|
@@ -28323,8 +27568,8 @@ class Request {
|
|
|
28323
27568
|
this.axios.interceptors.request.use((axiosConfig) => {
|
|
28324
27569
|
axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version;
|
|
28325
27570
|
axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform;
|
|
28326
|
-
if (
|
|
28327
|
-
axiosConfig.headers.Authorization =
|
|
27571
|
+
if (this.getToken()) {
|
|
27572
|
+
axiosConfig.headers.Authorization = this.getToken();
|
|
28328
27573
|
}
|
|
28329
27574
|
return axiosConfig
|
|
28330
27575
|
});
|
|
@@ -28352,7 +27597,7 @@ class Request {
|
|
|
28352
27597
|
async send(req, customToken) {
|
|
28353
27598
|
try {
|
|
28354
27599
|
const cancelToken = customToken || this.source.token;
|
|
28355
|
-
this._checkToken(req
|
|
27600
|
+
this._checkToken(req);
|
|
28356
27601
|
const requestConfig = this._createConfig(req, cancelToken);
|
|
28357
27602
|
const { data } = await this.axios.request(requestConfig);
|
|
28358
27603
|
return data
|
|
@@ -28398,12 +27643,16 @@ class Request {
|
|
|
28398
27643
|
}
|
|
28399
27644
|
}
|
|
28400
27645
|
|
|
28401
|
-
_checkToken(req
|
|
28402
|
-
if (!req.isPublic && !
|
|
27646
|
+
_checkToken(req) {
|
|
27647
|
+
if (!req.isPublic && !this.getToken()) {
|
|
28403
27648
|
console.error(req);
|
|
28404
27649
|
throw { code: 'ERR_A103', url: req.url }
|
|
28405
27650
|
}
|
|
28406
27651
|
}
|
|
27652
|
+
|
|
27653
|
+
getToken() {
|
|
27654
|
+
return storage.get(this.key)
|
|
27655
|
+
}
|
|
28407
27656
|
}
|
|
28408
27657
|
|
|
28409
27658
|
// const urljoin = require('url-join')
|