ouisys-engine 3.0.22 → 3.0.23
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/.babelrc +9 -1
- package/dist/@types/window.d.js +1 -5
- package/dist/api/index.js +1 -760
- package/dist/common-types/AppThunk.js +1 -5
- package/dist/common-types/Either.js +1 -5
- package/dist/common-types/IError.js +1 -5
- package/dist/common-types/ITracker.js +1 -5
- package/dist/common-types/IVisitor.js +1 -5
- package/dist/common-types/RemoteDataState.js +1 -138
- package/dist/custom-hooks/useStrategyConfig.js +1 -24
- package/dist/flows/click2smsFlow.js +1 -23
- package/dist/flows/moFlow.js +1 -23
- package/dist/flows/moRedirFlow.js +1 -23
- package/dist/flows/oneClickFlow.js +1 -29
- package/dist/flows/pinFlow.js +1 -25
- package/dist/flows/strategy.js +1 -49
- package/dist/flows/ussdFlow.js +1 -22
- package/dist/index.js +0 -2
- package/dist/ips/tryGetIPRangeName.js +1 -111
- package/dist/pacman/index.js +1 -111
- package/dist/pacman/queryString.js +1 -50
- package/dist/reducers/click2smsFlow/Click2smsTypes.js +1 -5
- package/dist/reducers/click2smsFlow/IClick2smsConstants.js +1 -5
- package/dist/reducers/click2smsFlow/index.js +1 -199
- package/dist/reducers/click2smsFlow/utils.js +1 -372
- package/dist/reducers/moFlow/IMoConstants.js +1 -5
- package/dist/reducers/moFlow/MoTypes.js +1 -5
- package/dist/reducers/moFlow/index.js +1 -257
- package/dist/reducers/moFlow/utils.js +1 -340
- package/dist/reducers/moRedirFlow/IMoRedirConstants.js +1 -5
- package/dist/reducers/moRedirFlow/MoRedirTypes.js +1 -5
- package/dist/reducers/moRedirFlow/index.js +1 -243
- package/dist/reducers/moRedirFlow/utils.js +1 -240
- package/dist/reducers/oneClickFlow/IOneClickConstants.js +1 -5
- package/dist/reducers/oneClickFlow/OneClickTypes.js +1 -5
- package/dist/reducers/oneClickFlow/index.js +1 -458
- package/dist/reducers/oneClickFlow/utils.js +1 -410
- package/dist/reducers/pinFlow/IPinConstants.js +1 -5
- package/dist/reducers/pinFlow/PinTypes.js +1 -5
- package/dist/reducers/pinFlow/index.js +1 -543
- package/dist/reducers/pinFlow/utils.js +1 -554
- package/dist/reducers/strategy/IStategyActionContants.js +1 -5
- package/dist/reducers/strategy/StrategyTypes.js +1 -5
- package/dist/reducers/strategy/index.js +1 -419
- package/dist/reducers/strategy/strategies/ask_mobile_number.js +1 -581
- package/dist/reducers/strategy/strategies/ask_operator.js +1 -317
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +1 -692
- package/dist/reducers/strategy/strategies/header_enrichment.js +1 -804
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.js +1 -118
- package/dist/reducers/strategy/utils.js +1 -710
- package/dist/reducers/ussdFlow/IUssdConstants.js +1 -5
- package/dist/reducers/ussdFlow/UssdTypes.js +1 -5
- package/dist/reducers/ussdFlow/index.js +1 -267
- package/dist/reducers/ussdFlow/utils.js +1 -247
- package/dist/store/index.js +1 -177
- package/dist/store/reducers.js +1 -38
- package/dist/utilities/handleSubmitNumber.js +1 -76
- package/dist/utilities/index.js +1 -68
- package/dist/utilities/loadScriptInnerHtml.js +1 -22
- package/dist/utilities/loadScriptSrc.js +1 -32
- package/package.json +3 -2
|
@@ -1,138 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.string.match.js");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.WhenSuccess = exports.WhenLoading = exports.WhenFailure = exports.Success = exports.NothingYet = exports.MatchSuccess = exports.MatchFailure = exports.Loading = exports.IsSuccess = exports.IsNothingYet = exports.IsLoading = exports.IsFailure = exports.Failure = void 0;
|
|
11
|
-
exports.match = match;
|
|
12
|
-
|
|
13
|
-
function match(_ref) {
|
|
14
|
-
var nothingYet = _ref.nothingYet,
|
|
15
|
-
loading = _ref.loading,
|
|
16
|
-
failure = _ref.failure,
|
|
17
|
-
success = _ref.success;
|
|
18
|
-
return function (model) {
|
|
19
|
-
switch (model.type) {
|
|
20
|
-
case 'NothingYet':
|
|
21
|
-
return nothingYet();
|
|
22
|
-
|
|
23
|
-
case 'Loading':
|
|
24
|
-
return loading();
|
|
25
|
-
|
|
26
|
-
case 'Failure':
|
|
27
|
-
return failure(model.error);
|
|
28
|
-
|
|
29
|
-
case 'Success':
|
|
30
|
-
return success(model.data);
|
|
31
|
-
|
|
32
|
-
default:
|
|
33
|
-
return nothingYet();
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
var NothingYet = function NothingYet() {
|
|
39
|
-
return {
|
|
40
|
-
type: 'NothingYet'
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
exports.NothingYet = NothingYet;
|
|
45
|
-
|
|
46
|
-
var Loading = function Loading() {
|
|
47
|
-
return {
|
|
48
|
-
type: 'Loading'
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
exports.Loading = Loading;
|
|
53
|
-
|
|
54
|
-
var Failure = function Failure(error) {
|
|
55
|
-
return {
|
|
56
|
-
type: 'Failure',
|
|
57
|
-
error: error
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
exports.Failure = Failure;
|
|
62
|
-
|
|
63
|
-
var Success = function Success(data) {
|
|
64
|
-
return {
|
|
65
|
-
type: 'Success',
|
|
66
|
-
data: data
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
exports.Success = Success;
|
|
71
|
-
|
|
72
|
-
var IsNothingYet = function IsNothingYet(s) {
|
|
73
|
-
return s.type === 'NothingYet';
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
exports.IsNothingYet = IsNothingYet;
|
|
77
|
-
|
|
78
|
-
var IsLoading = function IsLoading(s) {
|
|
79
|
-
return s.type === 'Loading';
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
exports.IsLoading = IsLoading;
|
|
83
|
-
|
|
84
|
-
var IsFailure = function IsFailure(s) {
|
|
85
|
-
return s.type === 'Failure';
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
exports.IsFailure = IsFailure;
|
|
89
|
-
|
|
90
|
-
var IsSuccess = function IsSuccess(s) {
|
|
91
|
-
return s.type === 'Success';
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
exports.IsSuccess = IsSuccess;
|
|
95
|
-
|
|
96
|
-
var WhenFailure = function WhenFailure(d, r) {
|
|
97
|
-
return function (s) {
|
|
98
|
-
return s.type === 'Failure' ? r(s.error) : d;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
exports.WhenFailure = WhenFailure;
|
|
103
|
-
|
|
104
|
-
var WhenLoading = function WhenLoading(d, r) {
|
|
105
|
-
return function (s) {
|
|
106
|
-
return s.type === 'Loading' ? r() : d;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
exports.WhenLoading = WhenLoading;
|
|
111
|
-
|
|
112
|
-
var WhenSuccess = function WhenSuccess(d, r) {
|
|
113
|
-
return function (s) {
|
|
114
|
-
return s.type === 'Success' ? r(s.data) : d;
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
exports.WhenSuccess = WhenSuccess;
|
|
119
|
-
|
|
120
|
-
var MatchFailure = function MatchFailure(_ref2) {
|
|
121
|
-
var failure = _ref2.failure,
|
|
122
|
-
otherwise = _ref2.otherwise;
|
|
123
|
-
return function (s) {
|
|
124
|
-
return s.type === 'Failure' ? failure(s.error) : otherwise();
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
exports.MatchFailure = MatchFailure;
|
|
129
|
-
|
|
130
|
-
var MatchSuccess = function MatchSuccess(_ref3) {
|
|
131
|
-
var success = _ref3.success,
|
|
132
|
-
otherwise = _ref3.otherwise;
|
|
133
|
-
return function (s) {
|
|
134
|
-
return s.type === 'Success' ? success(s.data) : otherwise(s);
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
exports.MatchSuccess = MatchSuccess;
|
|
1
|
+
"use strict";require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.match.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.WhenSuccess=exports.WhenLoading=exports.WhenFailure=exports.Success=exports.NothingYet=exports.MatchSuccess=exports.MatchFailure=exports.Loading=exports.IsSuccess=exports.IsNothingYet=exports.IsLoading=exports.IsFailure=exports.Failure=void 0,exports.match=match;function match(_ref){var nothingYet=_ref.nothingYet,loading=_ref.loading,failure=_ref.failure,success=_ref.success;return function(model){switch(model.type){case"NothingYet":return nothingYet();case"Loading":return loading();case"Failure":return failure(model.error);case"Success":return success(model.data);default:return nothingYet();}}}var NothingYet=function(){return{type:"NothingYet"}};exports.NothingYet=NothingYet;var Loading=function(){return{type:"Loading"}};exports.Loading=Loading;var Failure=function(error){return{type:"Failure",error:error}};exports.Failure=Failure;var Success=function(data){return{type:"Success",data:data}};exports.Success=Success;var IsNothingYet=function(s){return"NothingYet"===s.type};exports.IsNothingYet=IsNothingYet;var IsLoading=function(s){return"Loading"===s.type};exports.IsLoading=IsLoading;var IsFailure=function(s){return"Failure"===s.type};exports.IsFailure=IsFailure;var IsSuccess=function(s){return"Success"===s.type};exports.IsSuccess=IsSuccess;var WhenFailure=function(d,r){return function(s){return"Failure"===s.type?r(s.error):d}};exports.WhenFailure=WhenFailure;var WhenLoading=function(d,r){return function(s){return"Loading"===s.type?r():d}};exports.WhenLoading=WhenLoading;var WhenSuccess=function(d,r){return function(s){return"Success"===s.type?r(s.data):d}};exports.WhenSuccess=WhenSuccess;var MatchFailure=function(_ref2){var failure=_ref2.failure,otherwise=_ref2.otherwise;return function(s){return"Failure"===s.type?failure(s.error):otherwise()}};exports.MatchFailure=MatchFailure;var MatchSuccess=function(_ref3){var success=_ref3.success,otherwise=_ref3.otherwise;return function(s){return"Success"===s.type?success(s.data):otherwise(s)}};exports.MatchSuccess=MatchSuccess;
|
|
@@ -1,24 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useStrategyConfig = void 0;
|
|
7
|
-
|
|
8
|
-
var useStrategyConfig = function useStrategyConfig(useSelector) {
|
|
9
|
-
var _config$default, _config$default2;
|
|
10
|
-
|
|
11
|
-
var _useSelector = useSelector(function (state) {
|
|
12
|
-
return state.strategy;
|
|
13
|
-
}),
|
|
14
|
-
strategyCurrentState = _useSelector.currentState; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _strategyCurrentState = strategyCurrentState === null || strategyCurrentState === void 0 ? void 0 : strategyCurrentState.result,
|
|
19
|
-
config = _strategyCurrentState.config;
|
|
20
|
-
|
|
21
|
-
return config !== null && config !== void 0 && (_config$default = config.default) !== null && _config$default !== void 0 && _config$default.flowConfig ? config === null || config === void 0 ? void 0 : (_config$default2 = config.default) === null || _config$default2 === void 0 ? void 0 : _config$default2.flowConfig : config;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
exports.useStrategyConfig = useStrategyConfig;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useStrategyConfig=void 0;var useStrategyConfig=function(useSelector){var _config$default,_config$default2,_useSelector=useSelector(function(state){return state.strategy}),strategyCurrentState=_useSelector.currentState,_strategyCurrentState=null===strategyCurrentState||void 0===strategyCurrentState?void 0:strategyCurrentState.result,config=_strategyCurrentState.config;return null!==config&&void 0!==config&&null!==(_config$default=config.default)&&void 0!==_config$default&&_config$default.flowConfig?null===config||void 0===config||null===(_config$default2=config.default)||void 0===_config$default2?void 0:_config$default2.flowConfig:config};exports.useStrategyConfig=useStrategyConfig;
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function click2smsFlowMatch(_ref) {
|
|
9
|
-
var load = _ref.load;
|
|
10
|
-
return function (state) {
|
|
11
|
-
switch (state.type) {
|
|
12
|
-
case 'LOAD_OC2SMS':
|
|
13
|
-
return load(state.result);
|
|
14
|
-
|
|
15
|
-
default:
|
|
16
|
-
// TODO - this should be an error or something
|
|
17
|
-
return load(state.result);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
var _default = click2smsFlowMatch;
|
|
23
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function click2smsFlowMatch(_ref){var load=_ref.load;return function(state){switch(state.type){case"LOAD_OC2SMS":return load(state.result);default:return load(state.result);}}}var _default=click2smsFlowMatch;exports.default=_default;
|
package/dist/flows/moFlow.js
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function moFlowMatch(_ref) {
|
|
9
|
-
var msisdnEntry = _ref.msisdnEntry;
|
|
10
|
-
return function (state) {
|
|
11
|
-
switch (state.type) {
|
|
12
|
-
case 'MSISDNEntry':
|
|
13
|
-
return msisdnEntry(state.result);
|
|
14
|
-
|
|
15
|
-
default:
|
|
16
|
-
// TODO - this should be an error or something
|
|
17
|
-
return msisdnEntry(state.result);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
var _default = moFlowMatch;
|
|
23
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function moFlowMatch(_ref){var msisdnEntry=_ref.msisdnEntry;return function(state){switch(state.type){case"MSISDNEntry":return msisdnEntry(state.result);default:return msisdnEntry(state.result);}}}var _default=moFlowMatch;exports.default=_default;
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function moRedirFlowMatch(_ref) {
|
|
9
|
-
var msisdnEntry = _ref.msisdnEntry;
|
|
10
|
-
return function (state) {
|
|
11
|
-
switch (state.type) {
|
|
12
|
-
case 'MSISDNEntry':
|
|
13
|
-
return msisdnEntry(state.result);
|
|
14
|
-
|
|
15
|
-
default:
|
|
16
|
-
// TODO - this should be an error or something
|
|
17
|
-
return msisdnEntry(state.result);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
var _default = moRedirFlowMatch;
|
|
23
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function moRedirFlowMatch(_ref){var msisdnEntry=_ref.msisdnEntry;return function(state){switch(state.type){case"MSISDNEntry":return msisdnEntry(state.result);default:return msisdnEntry(state.result);}}}var _default=moRedirFlowMatch;exports.default=_default;
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function oneClickFlowMatch(_ref) {
|
|
9
|
-
var getRedirectUrl = _ref.getRedirectUrl,
|
|
10
|
-
subscribe = _ref.subscribe;
|
|
11
|
-
return function (state) {
|
|
12
|
-
switch (state.type) {
|
|
13
|
-
case 'GET_REDIRECT_URL':
|
|
14
|
-
return getRedirectUrl(state.result);
|
|
15
|
-
|
|
16
|
-
case 'SUBCRIBE_AJAX':
|
|
17
|
-
return subscribe(state.result);
|
|
18
|
-
|
|
19
|
-
default:
|
|
20
|
-
// TODO - this should be an error or something
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
return getRedirectUrl(state.result);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
var _default = oneClickFlowMatch;
|
|
29
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function oneClickFlowMatch(_ref){var getRedirectUrl=_ref.getRedirectUrl,subscribe=_ref.subscribe;return function(state){switch(state.type){case"GET_REDIRECT_URL":return getRedirectUrl(state.result);case"SUBCRIBE_AJAX":return subscribe(state.result);default:return getRedirectUrl(state.result);}}}var _default=oneClickFlowMatch;exports.default=_default;
|
package/dist/flows/pinFlow.js
CHANGED
|
@@ -1,25 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function pinFlowMatch(_ref) {
|
|
9
|
-
var msisdnEntry = _ref.msisdnEntry,
|
|
10
|
-
pinEntry = _ref.pinEntry;
|
|
11
|
-
// eslint-disable-next-line consistent-return
|
|
12
|
-
return function (state) {
|
|
13
|
-
// eslint-disable-next-line default-case
|
|
14
|
-
switch (state.type) {
|
|
15
|
-
case 'MSISDNEntry':
|
|
16
|
-
return msisdnEntry(state.result);
|
|
17
|
-
|
|
18
|
-
case 'PINEntry':
|
|
19
|
-
return pinEntry(state.result, state.data);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
var _default = pinFlowMatch;
|
|
25
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function pinFlowMatch(_ref){var msisdnEntry=_ref.msisdnEntry,pinEntry=_ref.pinEntry;return function(state){switch(state.type){case"MSISDNEntry":return msisdnEntry(state.result);case"PINEntry":return pinEntry(state.result,state.data);}}}var _default=pinFlowMatch;exports.default=_default;
|
package/dist/flows/strategy.js
CHANGED
|
@@ -1,49 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function strategy(_ref) {
|
|
9
|
-
var identifyFlowByOperatorSelect = _ref.identifyFlowByOperatorSelect,
|
|
10
|
-
identifyFlowByMsisdn = _ref.identifyFlowByMsisdn,
|
|
11
|
-
pinFlow = _ref.pinFlow,
|
|
12
|
-
moFlow = _ref.moFlow,
|
|
13
|
-
moRedirFlow = _ref.moRedirFlow,
|
|
14
|
-
oneClickFlow = _ref.oneClickFlow,
|
|
15
|
-
click2smsFlow = _ref.click2smsFlow,
|
|
16
|
-
ussdFlow = _ref.ussdFlow;
|
|
17
|
-
// eslint-disable-next-line consistent-return
|
|
18
|
-
return function (state) {
|
|
19
|
-
// eslint-disable-next-line default-case
|
|
20
|
-
switch (state.type) {
|
|
21
|
-
case 'IDENTIFY_FLOW_BY_OPERATOR_SELECT':
|
|
22
|
-
return identifyFlowByOperatorSelect(state.result);
|
|
23
|
-
|
|
24
|
-
case 'IDENTIFY_FLOW_BY_MSISDN':
|
|
25
|
-
return identifyFlowByMsisdn(state.result, state.nextData);
|
|
26
|
-
|
|
27
|
-
case 'PIN':
|
|
28
|
-
return pinFlow(state.result);
|
|
29
|
-
|
|
30
|
-
case 'MO':
|
|
31
|
-
return moFlow(state.result);
|
|
32
|
-
|
|
33
|
-
case 'MO_REDIR':
|
|
34
|
-
return moRedirFlow(state.result);
|
|
35
|
-
|
|
36
|
-
case 'ONE_CLICK':
|
|
37
|
-
return oneClickFlow(state.result);
|
|
38
|
-
|
|
39
|
-
case 'CLICK2SMS':
|
|
40
|
-
return click2smsFlow(state.result);
|
|
41
|
-
|
|
42
|
-
case 'USSD':
|
|
43
|
-
return ussdFlow(state.result);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
var _default = strategy;
|
|
49
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function strategy(_ref){var identifyFlowByOperatorSelect=_ref.identifyFlowByOperatorSelect,identifyFlowByMsisdn=_ref.identifyFlowByMsisdn,pinFlow=_ref.pinFlow,moFlow=_ref.moFlow,moRedirFlow=_ref.moRedirFlow,oneClickFlow=_ref.oneClickFlow,click2smsFlow=_ref.click2smsFlow,ussdFlow=_ref.ussdFlow;return function(state){switch(state.type){case"IDENTIFY_FLOW_BY_OPERATOR_SELECT":return identifyFlowByOperatorSelect(state.result);case"IDENTIFY_FLOW_BY_MSISDN":return identifyFlowByMsisdn(state.result,state.nextData);case"PIN":return pinFlow(state.result);case"MO":return moFlow(state.result);case"MO_REDIR":return moRedirFlow(state.result);case"ONE_CLICK":return oneClickFlow(state.result);case"CLICK2SMS":return click2smsFlow(state.result);case"USSD":return ussdFlow(state.result);}}}var _default=strategy;exports.default=_default;
|
package/dist/flows/ussdFlow.js
CHANGED
|
@@ -1,22 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function ussdFlowMatch(_ref) {
|
|
9
|
-
var msisdnEntry = _ref.msisdnEntry;
|
|
10
|
-
return function (state) {
|
|
11
|
-
switch (state.type) {
|
|
12
|
-
case 'MSISDNEntry':
|
|
13
|
-
return msisdnEntry(state.result);
|
|
14
|
-
|
|
15
|
-
default:
|
|
16
|
-
return msisdnEntry(state.result);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
var _default = ussdFlowMatch;
|
|
22
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function ussdFlowMatch(_ref){var msisdnEntry=_ref.msisdnEntry;return function(state){switch(state.type){case"MSISDNEntry":return msisdnEntry(state.result);default:return msisdnEntry(state.result);}}}var _default=ussdFlowMatch;exports.default=_default;
|
package/dist/index.js
CHANGED
|
@@ -1,111 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.symbol.js");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol.description.js");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.symbol.iterator.js");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.iterator.js");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.string.iterator.js");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.symbol.async-iterator.js");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.symbol.to-string-tag.js");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/es.json.to-string-tag.js");
|
|
22
|
-
|
|
23
|
-
require("core-js/modules/es.math.to-string-tag.js");
|
|
24
|
-
|
|
25
|
-
require("core-js/modules/es.object.get-prototype-of.js");
|
|
26
|
-
|
|
27
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
28
|
-
|
|
29
|
-
require("core-js/modules/es.function.name.js");
|
|
30
|
-
|
|
31
|
-
require("core-js/modules/es.object.set-prototype-of.js");
|
|
32
|
-
|
|
33
|
-
require("core-js/modules/es.array.slice.js");
|
|
34
|
-
|
|
35
|
-
Object.defineProperty(exports, "__esModule", {
|
|
36
|
-
value: true
|
|
37
|
-
});
|
|
38
|
-
exports.default = tryGetIPRangeName;
|
|
39
|
-
|
|
40
|
-
require("core-js/modules/es.object.to-string.js");
|
|
41
|
-
|
|
42
|
-
require("core-js/modules/es.promise.js");
|
|
43
|
-
|
|
44
|
-
require("core-js/modules/es.array.concat.js");
|
|
45
|
-
|
|
46
|
-
var _queryString = _interopRequireDefault(require("../pacman/queryString"));
|
|
47
|
-
|
|
48
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
49
|
-
|
|
50
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
51
|
-
|
|
52
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
53
|
-
|
|
54
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
55
|
-
|
|
56
|
-
// eslint-disable-next-line consistent-return
|
|
57
|
-
function tryGetIPRangeName(_x) {
|
|
58
|
-
return _tryGetIPRangeName.apply(this, arguments);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function _tryGetIPRangeName() {
|
|
62
|
-
_tryGetIPRangeName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(visitor) {
|
|
63
|
-
var mockip, host, res;
|
|
64
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
65
|
-
while (1) {
|
|
66
|
-
switch (_context.prev = _context.next) {
|
|
67
|
-
case 0:
|
|
68
|
-
mockip = (0, _queryString.default)(window.location.href, 'mock-ip') || process.env.mock_ip; // eslint-disable-next-line no-console
|
|
69
|
-
|
|
70
|
-
console.log('mockip', mockip);
|
|
71
|
-
|
|
72
|
-
if (!(!visitor.ip && typeof window !== 'undefined')) {
|
|
73
|
-
_context.next = 18;
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
_context.prev = 3;
|
|
78
|
-
host = window.location.host;
|
|
79
|
-
_context.next = 7;
|
|
80
|
-
return fetch("https://".concat(host, "/api/v1/ip").concat(mockip ? "?mock-ip=".concat(mockip) : '')).then(function (x) {
|
|
81
|
-
return x.json();
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
case 7:
|
|
85
|
-
res = _context.sent;
|
|
86
|
-
// return isIPInRange('37.200.146.28')
|
|
87
|
-
visitor.ip = res.ip;
|
|
88
|
-
visitor.ip_range_name = res.ip_range_name;
|
|
89
|
-
return _context.abrupt("return", res.ip_range_name);
|
|
90
|
-
|
|
91
|
-
case 13:
|
|
92
|
-
_context.prev = 13;
|
|
93
|
-
_context.t0 = _context["catch"](3);
|
|
94
|
-
console.warn('IP Lookup failed', _context.t0);
|
|
95
|
-
|
|
96
|
-
case 16:
|
|
97
|
-
_context.next = 19;
|
|
98
|
-
break;
|
|
99
|
-
|
|
100
|
-
case 18:
|
|
101
|
-
return _context.abrupt("return", visitor.ip_range_name);
|
|
102
|
-
|
|
103
|
-
case 19:
|
|
104
|
-
case "end":
|
|
105
|
-
return _context.stop();
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}, _callee, null, [[3, 13]]);
|
|
109
|
-
}));
|
|
110
|
-
return _tryGetIPRangeName.apply(this, arguments);
|
|
111
|
-
}
|
|
1
|
+
"use strict";var _queryString=_interopRequireDefault(require("../pacman/queryString"));function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}require("core-js/modules/es.symbol.js"),require("core-js/modules/es.symbol.description.js"),require("core-js/modules/es.symbol.iterator.js"),require("core-js/modules/es.array.iterator.js"),require("core-js/modules/es.string.iterator.js"),require("core-js/modules/web.dom-collections.iterator.js"),require("core-js/modules/es.symbol.async-iterator.js"),require("core-js/modules/es.symbol.to-string-tag.js"),require("core-js/modules/es.json.to-string-tag.js"),require("core-js/modules/es.math.to-string-tag.js"),require("core-js/modules/es.object.get-prototype-of.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=tryGetIPRangeName,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.array.concat.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _regeneratorRuntime(){"use strict";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key]}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return generator._invoke=function(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"===state)throw new Error("Generator is already running");if("completed"===state){if("throw"===method)throw arg;return doneResult()}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"===state)throw state="completed",context.arg;context.dispatchException(context.arg)}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done}}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg)}}}(innerFn,self,context),generator}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg)})})}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==_typeof(value)&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject)},function(err){invoke("throw",err,resolve,reject)}):PromiseImpl.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result)},function(error){return invoke("throw",error,resolve,reject)})}reject(record.arg)}var previousPromise;this._invoke=function(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl(function(resolve,reject){invoke(method,arg,resolve,reject)})}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(delegate,context){var method=delegate.iterator[context.method];if(void 0===method){if(context.delegate=null,"throw"===context.method){if(delegate.iterator.return&&(context.method="return",context.arg=void 0,maybeInvokeDelegate(delegate,context),"throw"===context.method))return ContinueSentinel;context.method="throw",context.arg=new TypeError("The iterator does not provide a 'throw' method")}return ContinueSentinel}var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=void 0),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel)}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry)}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0)}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i<iterable.length;)if(hasOwn.call(iterable,i))return next.value=iterable[i],next.done=!1,next;return next.value=void 0,next.done=!0,next};return next.next=next}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return exports};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";try{define({},"")}catch(err){define=function(obj,key,value){return obj[key]=value}}exports.wrap=wrap;var ContinueSentinel={},IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,function(){return this});var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(Gp,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,toStringTagSymbol,"GeneratorFunction"),exports.isGeneratorFunction=function(genFun){var ctor="function"==typeof genFun&&genFun.constructor;return!!ctor&&(ctor===GeneratorFunction||"GeneratorFunction"===(ctor.displayName||ctor.name))},exports.mark=function(genFun){return Object.setPrototypeOf?Object.setPrototypeOf(genFun,GeneratorFunctionPrototype):(genFun.__proto__=GeneratorFunctionPrototype,define(genFun,toStringTagSymbol,"GeneratorFunction")),genFun.prototype=Object.create(Gp),genFun},exports.awrap=function(arg){return{__await:arg}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,asyncIteratorSymbol,function(){return this}),exports.AsyncIterator=AsyncIterator,exports.async=function(innerFn,outerFn,self,tryLocsList,PromiseImpl){void 0===PromiseImpl&&(PromiseImpl=Promise);var iter=new AsyncIterator(wrap(innerFn,outerFn,self,tryLocsList),PromiseImpl);return exports.isGeneratorFunction(outerFn)?iter:iter.next().then(function(result){return result.done?result.value:iter.next()})},defineIteratorMethods(Gp),define(Gp,toStringTagSymbol,"Generator"),define(Gp,iteratorSymbol,function(){return this}),define(Gp,"toString",function(){return"[object Generator]"}),exports.keys=function(object){var keys=[];for(var key in object)keys.push(key);return keys.reverse(),function next(){for(;keys.length;){var key=keys.pop();if(key in object)return next.value=key,next.done=!1,next}return next.done=!0,next}},exports.values=values,Context.prototype={constructor:Context,reset:function reset(skipTempReset){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this)"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=void 0)},stop:function stop(){this.done=!0;var rootRecord=this.tryEntries[0].completion;if("throw"===rootRecord.type)throw rootRecord.arg;return this.rval},dispatchException:function dispatchException(exception){function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=void 0),!!caught}if(this.done)throw exception;for(var context=this,i=this.tryEntries.length-1;0<=i;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(!hasCatch){if(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0)}}},abrupt:function abrupt(type,arg){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev<entry.finallyLoc){var finallyEntry=entry;break}finallyEntry&&("break"===type||"continue"===type)&&finallyEntry.tryLoc<=arg&&arg<=finallyEntry.finallyLoc&&(finallyEntry=null);var record=finallyEntry?finallyEntry.completion:{};return record.type=type,record.arg=arg,finallyEntry?(this.method="next",this.next=finallyEntry.finallyLoc,ContinueSentinel):this.complete(record)},complete:function complete(record,afterLoc){if("throw"===record.type)throw record.arg;return"break"===record.type||"continue"===record.type?this.next=record.arg:"return"===record.type?(this.rval=this.arg=record.arg,this.method="return",this.next="end"):"normal"===record.type&&afterLoc&&(this.next=afterLoc),ContinueSentinel},finish:function finish(finallyLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel},catch:function _catch(tryLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry)}return thrown}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=void 0),ContinueSentinel}},exports}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}function tryGetIPRangeName(){return _tryGetIPRangeName.apply(this,arguments)}function _tryGetIPRangeName(){return _tryGetIPRangeName=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(visitor){var mockip,host,res;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if(mockip=(0,_queryString.default)(window.location.href,"mock-ip")||process.env.mock_ip,console.log("mockip",mockip),visitor.ip||"undefined"==typeof window){_context.next=18;break}return _context.prev=3,host=window.location.host,_context.next=7,fetch("https://".concat(host,"/api/v1/ip").concat(mockip?"?mock-ip=".concat(mockip):"")).then(function(x){return x.json()});case 7:return res=_context.sent,visitor.ip=res.ip,visitor.ip_range_name=res.ip_range_name,_context.abrupt("return",res.ip_range_name);case 13:_context.prev=13,_context.t0=_context["catch"](3),console.warn("IP Lookup failed",_context.t0);case 16:_context.next=19;break;case 18:return _context.abrupt("return",visitor.ip_range_name);case 19:case"end":return _context.stop();}},_callee,null,[[3,13]])})),_tryGetIPRangeName.apply(this,arguments)}
|