ouisys-engine 4.6.2 → 4.7.0-alpha.1

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.
Files changed (222) hide show
  1. package/dist/RemoteDataState-CwHLI23e.js +75 -0
  2. package/dist/RemoteDataState-CwHLI23e.js.map +1 -0
  3. package/dist/bupperizeCountry-CCDIOHP6.js +4 -0
  4. package/dist/bupperizeCountry-CCDIOHP6.js.map +1 -0
  5. package/dist/checkSubscriptionByRockmanIdOnly-C89Ph9cV.js +27 -0
  6. package/dist/checkSubscriptionByRockmanIdOnly-C89Ph9cV.js.map +1 -0
  7. package/dist/checkSubscriptionHander.js +53 -0
  8. package/dist/checkSubscriptionHander.js.map +1 -0
  9. package/dist/click2smsFlow.js +246 -0
  10. package/dist/click2smsFlow.js.map +1 -0
  11. package/dist/creditCardFlow.js +248 -0
  12. package/dist/creditCardFlow.js.map +1 -0
  13. package/dist/getConfig.js +14 -0
  14. package/dist/getConfig.js.map +1 -0
  15. package/dist/handleClickChainFlow.js +32 -0
  16. package/dist/handleClickChainFlow.js.map +1 -0
  17. package/dist/handleSubmitNumber.js +65 -0
  18. package/dist/handleSubmitNumber.js.map +1 -0
  19. package/dist/helpers-J_h-ZgxH.js +29 -0
  20. package/dist/helpers-J_h-ZgxH.js.map +1 -0
  21. package/dist/loadScriptInnerHtml-DPcoY467.js +26 -0
  22. package/dist/loadScriptInnerHtml-DPcoY467.js.map +1 -0
  23. package/dist/moFlow.js +275 -0
  24. package/dist/moFlow.js.map +1 -0
  25. package/dist/moRedirFlow.js +225 -0
  26. package/dist/moRedirFlow.js.map +1 -0
  27. package/dist/oneClickFlow.js +464 -0
  28. package/dist/oneClickFlow.js.map +1 -0
  29. package/dist/pinFlow.js +697 -0
  30. package/dist/pinFlow.js.map +1 -0
  31. package/dist/searchToObject.js +19 -0
  32. package/dist/searchToObject.js.map +1 -0
  33. package/dist/storeMsisdn-ChiBh8mI.js +58 -0
  34. package/dist/storeMsisdn-ChiBh8mI.js.map +1 -0
  35. package/dist/strategy.js +50 -0
  36. package/dist/strategy.js.map +1 -0
  37. package/dist/strategySlice-bF74rxDK.js +842 -0
  38. package/dist/strategySlice-bF74rxDK.js.map +1 -0
  39. package/dist/tracker-B_zsMRN2.js +79 -0
  40. package/dist/tracker-B_zsMRN2.js.map +1 -0
  41. package/dist/tracker.js +5 -0
  42. package/dist/tracker.js.map +1 -0
  43. package/dist/tryGetIPRangeName-C69HEG5W.js +42 -0
  44. package/dist/tryGetIPRangeName-C69HEG5W.js.map +1 -0
  45. package/dist/types/CreditCardTypes-B-IT-l6I.d.ts +72 -0
  46. package/dist/types/IHash-0OgZ_1ij.d.ts +5 -0
  47. package/dist/types/MoRedirTypes-4tEJjT1g.d.ts +31 -0
  48. package/dist/types/MoTypes-D-UK92gs.d.ts +45 -0
  49. package/dist/types/OneClickTypes-DF0jodl-.d.ts +69 -0
  50. package/dist/types/PinTypes-BLJDBZe6.d.ts +128 -0
  51. package/dist/types/RemoteDataState-D1aFrz8W.d.ts +61 -0
  52. package/dist/types/StrategyTypes-BEIYqoJV.d.ts +325 -0
  53. package/dist/types/UssdTypes-C7QlIW11.d.ts +34 -0
  54. package/dist/types/checkSubscriptionHander.d.ts +8 -0
  55. package/dist/types/click2smsFlow.d.ts +37 -0
  56. package/dist/types/creditCardFlow.d.ts +37 -0
  57. package/dist/types/getConfig.d.ts +38 -0
  58. package/dist/types/handleClickChainFlow.d.ts +6 -0
  59. package/dist/types/handleSubmitNumber.d.ts +26 -0
  60. package/dist/types/moFlow.d.ts +70 -0
  61. package/dist/types/moRedirFlow.d.ts +82 -0
  62. package/dist/types/oneClickFlow.d.ts +56 -0
  63. package/dist/types/pinFlow.d.ts +179 -0
  64. package/dist/types/searchToObject.d.ts +3 -0
  65. package/dist/types/strategy.d.ts +86 -0
  66. package/dist/types/tracker.d.ts +5 -0
  67. package/dist/types/ussdFlow.d.ts +84 -0
  68. package/dist/ussdFlow.js +211 -0
  69. package/dist/ussdFlow.js.map +1 -0
  70. package/package.json +85 -9
  71. package/.babelrc +0 -30
  72. package/.browserslistrc +0 -6
  73. package/.eslintrc.js +0 -3
  74. package/.nvmrc +0 -1
  75. package/.prettierignore +0 -4
  76. package/dist/@types/react-tracker.d.js +0 -1
  77. package/dist/@types/redux-cli-logger.d.js +0 -1
  78. package/dist/@types/tiny-async-pool.d.js +0 -1
  79. package/dist/@types/window.d.js +0 -1
  80. package/dist/api/index.d.ts +0 -43
  81. package/dist/api/index.js +0 -1
  82. package/dist/common-types/AppThunk.d.ts +0 -13
  83. package/dist/common-types/AppThunk.js +0 -1
  84. package/dist/common-types/Either.d.ts +0 -8
  85. package/dist/common-types/Either.js +0 -1
  86. package/dist/common-types/IError.d.ts +0 -3
  87. package/dist/common-types/IError.js +0 -1
  88. package/dist/common-types/IOptInFlowName.d.ts +0 -1
  89. package/dist/common-types/IOptInFlowName.js +0 -1
  90. package/dist/common-types/ITracker.d.ts +0 -9
  91. package/dist/common-types/ITracker.js +0 -1
  92. package/dist/common-types/IVisitor.d.ts +0 -14
  93. package/dist/common-types/IVisitor.js +0 -1
  94. package/dist/common-types/RemoteDataState.d.ts +0 -38
  95. package/dist/common-types/RemoteDataState.js +0 -1
  96. package/dist/custom-hooks/useOneClickRedirectUrl.d.ts +0 -3
  97. package/dist/custom-hooks/useOneClickRedirectUrl.js +0 -1
  98. package/dist/custom-hooks/usePinEntryState.d.ts +0 -8
  99. package/dist/custom-hooks/usePinEntryState.js +0 -1
  100. package/dist/custom-hooks/useStrategyConfig.d.ts +0 -4
  101. package/dist/custom-hooks/useStrategyConfig.js +0 -1
  102. package/dist/flows/click2smsFlow.d.ts +0 -6
  103. package/dist/flows/click2smsFlow.js +0 -1
  104. package/dist/flows/creditCardFlow.d.ts +0 -6
  105. package/dist/flows/creditCardFlow.js +0 -1
  106. package/dist/flows/moFlow.d.ts +0 -6
  107. package/dist/flows/moFlow.js +0 -1
  108. package/dist/flows/moRedirFlow.d.ts +0 -6
  109. package/dist/flows/moRedirFlow.js +0 -1
  110. package/dist/flows/oneClickFlow.d.ts +0 -7
  111. package/dist/flows/oneClickFlow.js +0 -1
  112. package/dist/flows/pinFlow.d.ts +0 -7
  113. package/dist/flows/pinFlow.js +0 -1
  114. package/dist/flows/strategy.d.ts +0 -14
  115. package/dist/flows/strategy.js +0 -1
  116. package/dist/flows/ussdFlow.d.ts +0 -6
  117. package/dist/flows/ussdFlow.js +0 -1
  118. package/dist/index.d.ts +0 -0
  119. package/dist/index.js +0 -1
  120. package/dist/ips/tryGetIPRangeName.d.ts +0 -2
  121. package/dist/ips/tryGetIPRangeName.js +0 -1
  122. package/dist/jest.config.js +0 -194
  123. package/dist/pacman/index.d.ts +0 -6
  124. package/dist/pacman/index.js +0 -1
  125. package/dist/pacman/queryString.d.ts +0 -3
  126. package/dist/pacman/queryString.js +0 -1
  127. package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +0 -76
  128. package/dist/reducers/click2smsFlow/Click2smsTypes.js +0 -1
  129. package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +0 -2
  130. package/dist/reducers/click2smsFlow/IClick2smsConstants.js +0 -1
  131. package/dist/reducers/click2smsFlow/index.d.ts +0 -5
  132. package/dist/reducers/click2smsFlow/index.js +0 -1
  133. package/dist/reducers/click2smsFlow/utils.d.ts +0 -4
  134. package/dist/reducers/click2smsFlow/utils.js +0 -1
  135. package/dist/reducers/creditCardFlow/CreditCardTypes.d.ts +0 -79
  136. package/dist/reducers/creditCardFlow/CreditCardTypes.js +0 -1
  137. package/dist/reducers/creditCardFlow/ICreditCardConstants.d.ts +0 -2
  138. package/dist/reducers/creditCardFlow/ICreditCardConstants.js +0 -1
  139. package/dist/reducers/creditCardFlow/index.d.ts +0 -5
  140. package/dist/reducers/creditCardFlow/index.js +0 -1
  141. package/dist/reducers/creditCardFlow/utils.d.ts +0 -8
  142. package/dist/reducers/creditCardFlow/utils.js +0 -1
  143. package/dist/reducers/moFlow/IMoConstants.d.ts +0 -2
  144. package/dist/reducers/moFlow/IMoConstants.js +0 -1
  145. package/dist/reducers/moFlow/MoTypes.d.ts +0 -88
  146. package/dist/reducers/moFlow/MoTypes.js +0 -1
  147. package/dist/reducers/moFlow/index.d.ts +0 -16
  148. package/dist/reducers/moFlow/index.js +0 -1
  149. package/dist/reducers/moFlow/utils.d.ts +0 -12
  150. package/dist/reducers/moFlow/utils.js +0 -1
  151. package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +0 -2
  152. package/dist/reducers/moRedirFlow/IMoRedirConstants.js +0 -1
  153. package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +0 -64
  154. package/dist/reducers/moRedirFlow/MoRedirTypes.js +0 -1
  155. package/dist/reducers/moRedirFlow/index.d.ts +0 -14
  156. package/dist/reducers/moRedirFlow/index.js +0 -1
  157. package/dist/reducers/moRedirFlow/utils.d.ts +0 -10
  158. package/dist/reducers/moRedirFlow/utils.js +0 -1
  159. package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +0 -2
  160. package/dist/reducers/oneClickFlow/IOneClickConstants.js +0 -1
  161. package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +0 -85
  162. package/dist/reducers/oneClickFlow/OneClickTypes.js +0 -1
  163. package/dist/reducers/oneClickFlow/index.d.ts +0 -13
  164. package/dist/reducers/oneClickFlow/index.js +0 -1
  165. package/dist/reducers/oneClickFlow/utils.d.ts +0 -16
  166. package/dist/reducers/oneClickFlow/utils.js +0 -1
  167. package/dist/reducers/pinFlow/IPinConstants.d.ts +0 -2
  168. package/dist/reducers/pinFlow/IPinConstants.js +0 -1
  169. package/dist/reducers/pinFlow/PinTypes.d.ts +0 -156
  170. package/dist/reducers/pinFlow/PinTypes.js +0 -1
  171. package/dist/reducers/pinFlow/index.d.ts +0 -19
  172. package/dist/reducers/pinFlow/index.js +0 -1
  173. package/dist/reducers/pinFlow/utils.d.ts +0 -11
  174. package/dist/reducers/pinFlow/utils.js +0 -1
  175. package/dist/reducers/strategy/IStategyActionContants.d.ts +0 -2
  176. package/dist/reducers/strategy/IStategyActionContants.js +0 -1
  177. package/dist/reducers/strategy/StrategyTypes.d.ts +0 -248
  178. package/dist/reducers/strategy/StrategyTypes.js +0 -1
  179. package/dist/reducers/strategy/index.d.ts +0 -13
  180. package/dist/reducers/strategy/index.js +0 -1
  181. package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +0 -15
  182. package/dist/reducers/strategy/strategies/ask_mobile_number.js +0 -1
  183. package/dist/reducers/strategy/strategies/ask_operator.d.ts +0 -5
  184. package/dist/reducers/strategy/strategies/ask_operator.js +0 -1
  185. package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +0 -10
  186. package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +0 -1
  187. package/dist/reducers/strategy/strategies/header_enrichment.d.ts +0 -7
  188. package/dist/reducers/strategy/strategies/header_enrichment.js +0 -1
  189. package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.d.ts +0 -7
  190. package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.js +0 -1
  191. package/dist/reducers/strategy/utils.d.ts +0 -30
  192. package/dist/reducers/strategy/utils.js +0 -1
  193. package/dist/reducers/ussdFlow/IUssdConstants.d.ts +0 -2
  194. package/dist/reducers/ussdFlow/IUssdConstants.js +0 -1
  195. package/dist/reducers/ussdFlow/UssdTypes.d.ts +0 -77
  196. package/dist/reducers/ussdFlow/UssdTypes.js +0 -1
  197. package/dist/reducers/ussdFlow/index.d.ts +0 -14
  198. package/dist/reducers/ussdFlow/index.js +0 -1
  199. package/dist/reducers/ussdFlow/utils.d.ts +0 -11
  200. package/dist/reducers/ussdFlow/utils.js +0 -1
  201. package/dist/store/index.d.ts +0 -14
  202. package/dist/store/index.js +0 -1
  203. package/dist/store/reducers.d.ts +0 -20
  204. package/dist/store/reducers.js +0 -1
  205. package/dist/utilities/addEmpelloToken.d.ts +0 -4
  206. package/dist/utilities/addEmpelloToken.js +0 -1
  207. package/dist/utilities/handleSubmitNumber.d.ts +0 -21
  208. package/dist/utilities/handleSubmitNumber.js +0 -1
  209. package/dist/utilities/index.d.ts +0 -17
  210. package/dist/utilities/index.js +0 -1
  211. package/dist/utilities/loadScriptInnerHtml.d.ts +0 -2
  212. package/dist/utilities/loadScriptInnerHtml.js +0 -1
  213. package/dist/utilities/loadScriptSrc.d.ts +0 -8
  214. package/dist/utilities/loadScriptSrc.js +0 -1
  215. package/dist/utilities/replaceUrlParam.d.ts +0 -1
  216. package/dist/utilities/replaceUrlParam.js +0 -1
  217. package/dist/utilities/storeMsisdn.d.ts +0 -3
  218. package/dist/utilities/storeMsisdn.js +0 -1
  219. package/index.html +0 -49
  220. package/mockData/config.json +0 -28
  221. package/setupJest.js +0 -6
  222. package/tsconfig.json +0 -28
@@ -0,0 +1,842 @@
1
+ import { __awaiter, __generator, __assign } from 'tslib';
2
+ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
3
+ import { N as NothingYet, S as Success, L as Loading, F as Failure } from './RemoteDataState-CwHLI23e.js';
4
+ import { searchToObject } from './searchToObject.js';
5
+ import { getConfig } from './getConfig.js';
6
+ import 'awesome-phonenumber';
7
+ import { t as tryGetIPRangeName } from './tryGetIPRangeName-C69HEG5W.js';
8
+ import { t as tracker } from './tracker-B_zsMRN2.js';
9
+
10
+ var PossibleTypes;
11
+ (function (PossibleTypes) {
12
+ PossibleTypes["IDENTIFY_STRATEGY"] = "IDENTIFY_STRATEGY";
13
+ PossibleTypes["IDENTIFY_FLOW_BY_MSISDN"] = "IDENTIFY_FLOW_BY_MSISDN";
14
+ PossibleTypes["IDENTIFY_FLOW_BY_OPERATOR_SELECT"] = "IDENTIFY_FLOW_BY_OPERATOR_SELECT";
15
+ PossibleTypes["PIN"] = "PIN";
16
+ PossibleTypes["MO"] = "MO";
17
+ PossibleTypes["MO_REDIR"] = "MO_REDIR";
18
+ PossibleTypes["ONE_CLICK"] = "ONE_CLICK";
19
+ PossibleTypes["CLICK2SMS"] = "CLICK2SMS";
20
+ PossibleTypes["USSD"] = "USSD";
21
+ PossibleTypes["TPAY_HE"] = "TPAY_HE";
22
+ PossibleTypes["CREDIT_CARD"] = "CREDIT_CARD";
23
+ })(PossibleTypes || (PossibleTypes = {}));
24
+
25
+ var identify = function (_a) {
26
+ var window = _a.window, slug = _a.slug, country = _a.country, msisdn = _a.msisdn, device = _a.device, offer = _a.offer, rockmanId = _a.rockmanId;
27
+ return __awaiter(void 0, void 0, void 0, function () {
28
+ var languageCode, locationHref, host, params, urlParams, url, response;
29
+ return __generator(this, function (_b) {
30
+ switch (_b.label) {
31
+ case 0:
32
+ languageCode = window.languageCode ? "&language_code=".concat(window.languageCode) : '';
33
+ locationHref = encodeURIComponent(window.location.href);
34
+ host = window.DEV_BASE_URL || '';
35
+ params = {
36
+ action: 'identify',
37
+ slug: slug,
38
+ country: country,
39
+ msisdn: msisdn,
40
+ device: device,
41
+ offerId: offer,
42
+ rockman_id: rockmanId,
43
+ page: locationHref,
44
+ language_code: languageCode
45
+ };
46
+ urlParams = new URLSearchParams(params).toString();
47
+ url = "".concat(host, "/tallyman/v1/?").concat(urlParams);
48
+ return [4 /*yield*/, fetch(url)];
49
+ case 1:
50
+ response = _b.sent();
51
+ return [2 /*return*/, response.json()];
52
+ }
53
+ });
54
+ });
55
+ };
56
+
57
+ function determineFlowByMsidn(_a) {
58
+ var _b, _c, _d, _e;
59
+ var window = _a.window, internationalMSISDN = _a.internationalMSISDN, configs = _a.configs;
60
+ return __awaiter(this, void 0, void 0, function () {
61
+ var submissionError, msisdn, defaultFlowConfig, config, operatorsConfig, indentifyFlow, theResult, flow, cannotDetect, hlrError, submissionError, flowObj, flowObj, submissionError;
62
+ var _this = this;
63
+ return __generator(this, function (_f) {
64
+ switch (_f.label) {
65
+ case 0:
66
+ if (!internationalMSISDN) {
67
+ submissionError = new Error("Error in submitMSISDN() identify action");
68
+ submissionError.type = 'SEInvalidMSISDN';
69
+ throw submissionError;
70
+ }
71
+ msisdn = ((_b = internationalMSISDN.match(/\d+/gi)) === null || _b === void 0 ? void 0 : _b.join('')) || '';
72
+ defaultFlowConfig = (_c = configs === null || configs === void 0 ? void 0 : configs.strategyConfigs) === null || _c === void 0 ? void 0 : _c.default;
73
+ config = defaultFlowConfig.flowConfig;
74
+ operatorsConfig = (_d = configs === null || configs === void 0 ? void 0 : configs.strategyConfigs) === null || _d === void 0 ? void 0 : _d.operators;
75
+ indentifyFlow = function () { return __awaiter(_this, void 0, void 0, function () {
76
+ var slug, country, device, rockmanId, offer, flowOperatorResult;
77
+ return __generator(this, function (_a) {
78
+ switch (_a.label) {
79
+ case 0:
80
+ slug = config.slug, country = config.country, device = config.device;
81
+ rockmanId = window.pac_analytics.visitor.rockmanId;
82
+ offer = window.pac_analytics.visitor.offer;
83
+ return [4 /*yield*/, identify({
84
+ window: window,
85
+ slug: slug,
86
+ country: country,
87
+ msisdn: msisdn,
88
+ device: device,
89
+ offer: offer,
90
+ rockmanId: rockmanId
91
+ })];
92
+ case 1:
93
+ flowOperatorResult = _a.sent();
94
+ return [2 /*return*/, flowOperatorResult];
95
+ }
96
+ });
97
+ }); };
98
+ return [4 /*yield*/, indentifyFlow()];
99
+ case 1:
100
+ theResult = _f.sent();
101
+ flow = operatorsConfig[theResult.operator] ? operatorsConfig[theResult.operator] : null;
102
+ cannotDetect = theResult.success === false && theResult.message === 'Operator could not be found for the given MSISDN';
103
+ hlrError = theResult.success === false && ((_e = theResult.message) === null || _e === void 0 ? void 0 : _e.indexOf('HLR did not find the operator for given MSISDN')) !== -1;
104
+ if (cannotDetect || hlrError) {
105
+ submissionError = new Error("Error in submitMSISDN() identify action");
106
+ submissionError.type = 'FlowDetectFailed';
107
+ submissionError.msisdn = msisdn;
108
+ throw submissionError;
109
+ }
110
+ else if (flow !== null) {
111
+ flowObj = __assign({ operator: theResult.operator, default: defaultFlowConfig }, flow);
112
+ // @ts-ignore
113
+ return [2 /*return*/, flowObj];
114
+ }
115
+ else if (flow === null) {
116
+ flowObj = __assign({ operator: theResult.operator }, defaultFlowConfig);
117
+ // @ts-ignore
118
+ return [2 /*return*/, flowObj];
119
+ }
120
+ else {
121
+ submissionError = new Error("Error in submitMSISDN() identify action");
122
+ submissionError.type = 'SEInvalidMSISDN';
123
+ throw submissionError;
124
+ }
125
+ }
126
+ });
127
+ });
128
+ }
129
+ function determineFlowByOperator(_a) {
130
+ var _b, _c;
131
+ var configs = _a.configs, operator = _a.operator;
132
+ var defaultFlowConfig = (_b = configs === null || configs === void 0 ? void 0 : configs.strategyConfigs) === null || _b === void 0 ? void 0 : _b.default;
133
+ var operatorsConfig = (_c = configs === null || configs === void 0 ? void 0 : configs.strategyConfigs) === null || _c === void 0 ? void 0 : _c.operators;
134
+ var flowObj = __assign({ operator: operator === null || operator === void 0 ? void 0 : operator.toUpperCase(), default: defaultFlowConfig }, operatorsConfig[operator === null || operator === void 0 ? void 0 : operator.toUpperCase()]);
135
+ // @ts-ignore
136
+ return flowObj;
137
+ }
138
+ function determineFlowByOperatorFromIp(_a) {
139
+ var window = _a.window, configs = _a.configs;
140
+ return __awaiter(this, void 0, void 0, function () {
141
+ var operator, flowObj;
142
+ return __generator(this, function (_b) {
143
+ switch (_b.label) {
144
+ case 0: return [4 /*yield*/, tryGetIPRangeName(window.pac_analytics.visitor)];
145
+ case 1:
146
+ operator = _b.sent();
147
+ flowObj = determineFlowByOperator({
148
+ configs: configs,
149
+ operator: operator ? operator.toUpperCase() : ''
150
+ });
151
+ return [2 /*return*/, flowObj];
152
+ }
153
+ });
154
+ });
155
+ }
156
+ function getOperators(_a) {
157
+ var _b;
158
+ var configs = _a.configs;
159
+ var operatorsConfig = (_b = configs === null || configs === void 0 ? void 0 : configs.strategyConfigs) === null || _b === void 0 ? void 0 : _b.operators;
160
+ var operators = Object.keys(operatorsConfig);
161
+ return operators;
162
+ }
163
+ // export const mockedPinFlow: StrategyState = {
164
+ // currentState: {
165
+ // type: PossibleTypes.PIN,
166
+ // result: RDS.NothingYet(),
167
+ // data: {
168
+ // config: mockConfig('pin')
169
+ // }
170
+ // }
171
+ // };
172
+ // export const mockedMoFlow: StrategyState = {
173
+ // currentState: {
174
+ // type: PossibleTypes.MO,
175
+ // result: RDS.NothingYet(),
176
+ // data: {
177
+ // config: mockConfig('mo')
178
+ // }
179
+ // }
180
+ // };
181
+ // export const mockedUssdFlow: StrategyState = {
182
+ // currentState: {
183
+ // type: PossibleTypes.USSD,
184
+ // result: RDS.NothingYet(),
185
+ // data: {
186
+ // config: mockConfig('ussd')
187
+ // }
188
+ // }
189
+ // };
190
+ // export const mockedMoRdirFlow: StrategyState = {
191
+ // currentState: {
192
+ // type: PossibleTypes.MO_REDIR,
193
+ // result: RDS.NothingYet(),
194
+ // data: {
195
+ // config: mockConfig('moRedir')
196
+ // }
197
+ // }
198
+ // };
199
+ // export const mockedClick2smsFlow: StrategyState = {
200
+ // currentState: {
201
+ // type: PossibleTypes.CLICK2SMS,
202
+ // result: RDS.NothingYet(),
203
+ // data: {
204
+ // config: mockConfig('click2sms')
205
+ // }
206
+ // }
207
+ // };
208
+ // export const mockedOneClickFlow: StrategyState = {
209
+ // currentState: {
210
+ // type: PossibleTypes.ONE_CLICK,
211
+ // result: RDS.NothingYet(),
212
+ // data: {
213
+ // config: mockConfig('oneClick')
214
+ // }
215
+ // }
216
+ // };
217
+ // export const mockedCreditCardFlow: StrategyState = {
218
+ // currentState: {
219
+ // type: PossibleTypes.CREDIT_CARD,
220
+ // result: RDS.NothingYet(),
221
+ // data: {
222
+ // config: mockConfig('creditCard')
223
+ // }
224
+ // }
225
+ // };
226
+ // export const mockedMOFlow : State = { type: "MO", result:moFlow(mockTracker, mockConfig("mo"))}
227
+ // export const mockedOneClickFlow : State = { type: "ONECLICK", result:oneClickFlow(mockTracker, mockConfig("oneClick"), {"testextraparams":"1"})}
228
+ // export const mockedClick2smsFlow : State = { type: "CLICK2SMS", result:click2smsFlow(mockTracker, mockConfig("click2sms"))}
229
+ // export const mockedMORedirFlow : State = { type: "MOREDIR", result:moRedirFlow(mockTracker, mockConfig("moRedir"))}
230
+
231
+ var askMobileNumber = function () { return ({
232
+ type: PossibleTypes.IDENTIFY_FLOW_BY_MSISDN,
233
+ result: NothingYet()
234
+ }); };
235
+ var submitMSISDNAction = createAsyncThunk('strategy/submitMSISDNAction', function (_a, _b) {
236
+ var window = _a.window, msisdn = _a.msisdn;
237
+ var rejectWithValue = _b.rejectWithValue;
238
+ return __awaiter(void 0, void 0, void 0, function () {
239
+ var configs, strategy, flowObj, ex_1, errorType;
240
+ return __generator(this, function (_c) {
241
+ switch (_c.label) {
242
+ case 0:
243
+ _c.trys.push([0, 2, , 3]);
244
+ configs = getConfig();
245
+ strategy = configs.strategy;
246
+ return [4 /*yield*/, determineFlowByMsidn({ window: window, internationalMSISDN: msisdn, configs: configs })];
247
+ case 1:
248
+ flowObj = _c.sent();
249
+ switch (strategy) {
250
+ case 'pin-mo-redir-ask-mobile-number':
251
+ return [2 /*return*/, pinMoRedirAskMobileNumber(flowObj, msisdn)];
252
+ case 'pin-mo-ask-mobile-number':
253
+ return [2 /*return*/, pinMoAskMobileNumber(flowObj, msisdn)];
254
+ case 'pin-combo-ask-mobile-number':
255
+ return [2 /*return*/, pinComboAskMobileNumber(flowObj, msisdn)];
256
+ case 'mo-redir-mo-click2sms-one-click-detect-operator-by-ip-or-msisdn':
257
+ return [2 /*return*/, moRedirMoClick2smsOneClickDetectOperatorByIpOrMsisdn(flowObj, msisdn)];
258
+ case 'pin-mo-mo-redir-ask-mobile-number':
259
+ return [2 /*return*/, pinMoMoRedirAskMobileNumber(flowObj, msisdn)];
260
+ case 'pin-click2sms-ask-mobile-number':
261
+ return [2 /*return*/, pinClick2smsAskMobileNumber(flowObj, msisdn)];
262
+ default:
263
+ return [2 /*return*/, rejectWithValue('Unknown strategy')];
264
+ }
265
+ case 2:
266
+ ex_1 = _c.sent();
267
+ errorType = void 0;
268
+ switch (ex_1.type) {
269
+ case 'SEAlreadySubscribed':
270
+ errorType = 'AlreadySubscribed';
271
+ break;
272
+ case 'SEInvalidMSISDN':
273
+ errorType = 'InvalidMSISDN';
274
+ break;
275
+ default:
276
+ errorType = 'UnknownError';
277
+ }
278
+ return [2 /*return*/, rejectWithValue({
279
+ errorType: errorType,
280
+ error: ex_1,
281
+ productUrl: ex_1.productUrl
282
+ })];
283
+ case 3: return [2 /*return*/];
284
+ }
285
+ });
286
+ });
287
+ });
288
+ var pinMoAskMobileNumber = function (flowObj, msisdn) {
289
+ switch (flowObj.flow) {
290
+ case 'pin':
291
+ tracker.sendOptInFlowEvent('Pin');
292
+ return {
293
+ type: PossibleTypes.PIN,
294
+ result: NothingYet(),
295
+ data: __assign({ config: flowObj.flowConfig, msisdn: msisdn }, (flowObj.operator && { operator: flowObj.operator }))
296
+ };
297
+ case 'mo':
298
+ tracker.sendOptInFlowEvent('Msisdn to sms');
299
+ return {
300
+ type: PossibleTypes.MO,
301
+ result: NothingYet(),
302
+ data: __assign({ config: flowObj.flowConfig, msisdn: msisdn }, (flowObj.operator && { operator: flowObj.operator }))
303
+ };
304
+ default:
305
+ tracker.sendOptInFlowEvent('Pin');
306
+ return {
307
+ type: PossibleTypes.PIN,
308
+ result: NothingYet(),
309
+ data: __assign({ config: flowObj.flowConfig }, (flowObj.operator && { operator: flowObj.operator }))
310
+ };
311
+ }
312
+ };
313
+ var pinComboAskMobileNumber = function (flowObj, msisdn) {
314
+ switch (flowObj.flow) {
315
+ case 'pin':
316
+ tracker.sendOptInFlowEvent('Pin');
317
+ return {
318
+ type: PossibleTypes.PIN,
319
+ result: NothingYet(),
320
+ data: __assign({ config: flowObj.flowConfig, msisdn: msisdn }, (flowObj.operator && { operator: flowObj.operator }))
321
+ };
322
+ default:
323
+ tracker.sendOptInFlowEvent('Pin');
324
+ return {
325
+ type: PossibleTypes.PIN,
326
+ result: NothingYet(),
327
+ data: __assign({ config: flowObj.flowConfig }, (flowObj.operator && { operator: flowObj.operator }))
328
+ };
329
+ }
330
+ };
331
+ var pinMoRedirAskMobileNumber = function (flowObj, msisdn) {
332
+ switch (flowObj.flow) {
333
+ case 'pin':
334
+ tracker.sendOptInFlowEvent('Pin');
335
+ return {
336
+ type: PossibleTypes.PIN,
337
+ result: NothingYet(),
338
+ data: {
339
+ config: flowObj.flowConfig,
340
+ msisdn: msisdn
341
+ }
342
+ };
343
+ case 'moRedir':
344
+ tracker.sendOptInFlowEvent('Redirect');
345
+ return {
346
+ type: PossibleTypes.MO_REDIR,
347
+ result: NothingYet(),
348
+ data: {
349
+ config: flowObj.flowConfig
350
+ }
351
+ };
352
+ default:
353
+ tracker.sendOptInFlowEvent('Pin');
354
+ return {
355
+ type: PossibleTypes.PIN,
356
+ result: NothingYet(),
357
+ data: {
358
+ config: flowObj.flowConfig
359
+ }
360
+ };
361
+ }
362
+ };
363
+ var pinMoMoRedirAskMobileNumber = function (flowObj, msisdn) {
364
+ switch (flowObj.flow) {
365
+ case 'pin':
366
+ tracker.sendOptInFlowEvent('Pin');
367
+ return {
368
+ type: PossibleTypes.PIN,
369
+ result: NothingYet(),
370
+ data: {
371
+ config: flowObj.flowConfig,
372
+ msisdn: msisdn
373
+ }
374
+ };
375
+ case 'moRedir':
376
+ tracker.sendOptInFlowEvent('Redirect');
377
+ return {
378
+ type: PossibleTypes.MO_REDIR,
379
+ result: NothingYet(),
380
+ data: {
381
+ config: flowObj.flowConfig,
382
+ msisdn: msisdn
383
+ }
384
+ };
385
+ case 'mo':
386
+ tracker.sendOptInFlowEvent('Msisdn to sms');
387
+ return {
388
+ type: PossibleTypes.MO,
389
+ result: NothingYet(),
390
+ data: {
391
+ config: flowObj.flowConfig,
392
+ msisdn: msisdn
393
+ }
394
+ };
395
+ default:
396
+ tracker.sendOptInFlowEvent('Pin');
397
+ return {
398
+ type: PossibleTypes.PIN,
399
+ result: NothingYet(),
400
+ data: {
401
+ config: flowObj.flowConfig
402
+ }
403
+ };
404
+ }
405
+ };
406
+ var moRedirMoClick2smsOneClickDetectOperatorByIpOrMsisdn = function (flowObj, msisdn) {
407
+ switch (flowObj.flowOnWifi) {
408
+ case 'moRedir':
409
+ tracker.sendOptInFlowEvent('Redirect');
410
+ return {
411
+ type: PossibleTypes.MO_REDIR,
412
+ result: NothingYet(),
413
+ data: {
414
+ config: flowObj.flowConfig,
415
+ msisdn: msisdn
416
+ }
417
+ };
418
+ case 'mo':
419
+ tracker.sendOptInFlowEvent('Msisdn to sms');
420
+ return {
421
+ type: PossibleTypes.MO,
422
+ result: NothingYet(),
423
+ data: {
424
+ config: flowObj.flowConfig,
425
+ msisdn: msisdn
426
+ }
427
+ };
428
+ default:
429
+ tracker.sendOptInFlowEvent('Redirect');
430
+ return {
431
+ type: PossibleTypes.MO_REDIR,
432
+ result: NothingYet(),
433
+ data: {
434
+ config: flowObj.flowConfig,
435
+ rockman_id: flowObj.rockman_id
436
+ }
437
+ };
438
+ }
439
+ };
440
+ var pinClick2smsAskMobileNumber = function (flowObj, msisdn) {
441
+ switch (flowObj.flow) {
442
+ case 'pin':
443
+ tracker.sendOptInFlowEvent('Pin');
444
+ return {
445
+ type: PossibleTypes.PIN,
446
+ result: NothingYet(),
447
+ data: {
448
+ config: flowObj.flowConfig,
449
+ msisdn: msisdn
450
+ }
451
+ };
452
+ case 'click2sms':
453
+ tracker.sendOptInFlowEvent('Click to sms');
454
+ return {
455
+ type: PossibleTypes.CLICK2SMS,
456
+ result: NothingYet(),
457
+ data: {
458
+ config: flowObj.flowConfig,
459
+ msisdn: msisdn
460
+ }
461
+ };
462
+ default:
463
+ tracker.sendOptInFlowEvent('Pin');
464
+ return {
465
+ type: PossibleTypes.CLICK2SMS,
466
+ result: NothingYet(),
467
+ data: {
468
+ config: flowObj.flowConfig
469
+ }
470
+ };
471
+ }
472
+ };
473
+
474
+ var askOperator = function () {
475
+ var configs = getConfig();
476
+ var operators = getOperators({ configs: configs });
477
+ return {
478
+ type: PossibleTypes.IDENTIFY_FLOW_BY_OPERATOR_SELECT,
479
+ result: NothingYet(),
480
+ data: {
481
+ operators: operators
482
+ }
483
+ };
484
+ };
485
+ var selectOperatorAction = createAsyncThunk('strategy/selectOperatorAction', function (_a, _b) {
486
+ var operator = _a.operator;
487
+ var rejectWithValue = _b.rejectWithValue;
488
+ return __awaiter(void 0, void 0, void 0, function () {
489
+ var configs, flowObj, errorType;
490
+ return __generator(this, function (_c) {
491
+ try {
492
+ configs = getConfig();
493
+ flowObj = determineFlowByOperator({
494
+ configs: configs,
495
+ operator: operator
496
+ });
497
+ switch (flowObj.flow) {
498
+ case 'pin':
499
+ tracker.sendOptInFlowEvent('Pin');
500
+ return [2 /*return*/, {
501
+ type: PossibleTypes.PIN,
502
+ result: {
503
+ config: flowObj.flowConfig,
504
+ operator: operator
505
+ }
506
+ }];
507
+ case 'mo':
508
+ tracker.sendOptInFlowEvent('Msisdn to sms');
509
+ return [2 /*return*/, {
510
+ type: PossibleTypes.MO,
511
+ result: {
512
+ config: flowObj.flowConfig,
513
+ operator: operator
514
+ }
515
+ }];
516
+ case 'click2sms':
517
+ tracker.sendOptInFlowEvent('Click to sms');
518
+ return [2 /*return*/, {
519
+ type: PossibleTypes.CLICK2SMS,
520
+ result: {
521
+ config: __assign({ operators: [operator] }, flowObj.flowConfig),
522
+ operator: operator
523
+ }
524
+ }];
525
+ case 'oneClick':
526
+ tracker.sendOptInFlowEvent('3G click');
527
+ return [2 /*return*/, {
528
+ type: PossibleTypes.ONE_CLICK,
529
+ result: {
530
+ config: flowObj.flowConfig,
531
+ operator: operator,
532
+ autoRedirect: true
533
+ }
534
+ }];
535
+ default:
536
+ tracker.sendOptInFlowEvent('Pin');
537
+ return [2 /*return*/, {
538
+ type: PossibleTypes.PIN,
539
+ result: NothingYet()
540
+ }];
541
+ }
542
+ }
543
+ catch (ex) {
544
+ errorType = 'UnkownError';
545
+ return [2 /*return*/, rejectWithValue({
546
+ errorType: errorType,
547
+ error: ex.toString()
548
+ })];
549
+ }
550
+ return [2 /*return*/];
551
+ });
552
+ });
553
+ });
554
+
555
+ // @ts-ignore
556
+ var trackerEventMapping = {
557
+ mo: 'Msisdn to sms',
558
+ pin: 'Pin',
559
+ oneClick: '3G click',
560
+ moRedir: 'Redirect',
561
+ click2sms: 'Click to sms',
562
+ ussd: 'Msisdn to sms'
563
+ };
564
+ var flowMapping = {
565
+ mo: PossibleTypes.MO,
566
+ pin: PossibleTypes.PIN,
567
+ oneClick: PossibleTypes.ONE_CLICK,
568
+ moRedir: PossibleTypes.MO_REDIR,
569
+ click2sms: PossibleTypes.CLICK2SMS,
570
+ ussd: PossibleTypes.USSD,
571
+ creditCard: PossibleTypes.CREDIT_CARD
572
+ };
573
+ var detectOperatorByIp = function () { return __awaiter(void 0, void 0, void 0, function () {
574
+ var configs, flowObj, getTrackerEventName, flowType, event_1, ex_1;
575
+ return __generator(this, function (_a) {
576
+ switch (_a.label) {
577
+ case 0:
578
+ _a.trys.push([0, 2, , 3]);
579
+ configs = getConfig();
580
+ return [4 /*yield*/, determineFlowByOperatorFromIp({
581
+ window: window,
582
+ configs: configs
583
+ })];
584
+ case 1:
585
+ flowObj = _a.sent();
586
+ getTrackerEventName = function (flowType) { return trackerEventMapping[flowType]; };
587
+ flowType = flowObj.flow;
588
+ event_1 = getTrackerEventName(flowType);
589
+ tracker.sendOptInFlowEvent(event_1);
590
+ return [2 /*return*/, {
591
+ type: flowMapping[flowType],
592
+ result: NothingYet(),
593
+ data: {
594
+ config: flowObj.flowConfig,
595
+ operator: flowObj.operator
596
+ }
597
+ }];
598
+ case 2:
599
+ ex_1 = _a.sent();
600
+ console.error('SSSSS', ex_1);
601
+ return [3 /*break*/, 3];
602
+ case 3: return [2 /*return*/];
603
+ }
604
+ });
605
+ }); };
606
+
607
+ var initialState = {
608
+ currentState: {
609
+ type: PossibleTypes.IDENTIFY_STRATEGY,
610
+ result: NothingYet(),
611
+ data: undefined
612
+ }
613
+ };
614
+ var mockStrategyStateByUrlParam = function () {
615
+ var search = searchToObject(window);
616
+ if (search['mock-flow'] !== undefined) {
617
+ if (search.operator !== undefined) {
618
+ window.operator = search.operator;
619
+ }
620
+ switch (search['mock-flow']) {
621
+ case 'pin':
622
+ return {
623
+ type: PossibleTypes.PIN,
624
+ result: Success({})
625
+ };
626
+ case 'mo':
627
+ return {
628
+ type: PossibleTypes.MO,
629
+ result: Success({})
630
+ };
631
+ case 'moredir':
632
+ return {
633
+ type: PossibleTypes.MO_REDIR,
634
+ result: Success({})
635
+ };
636
+ case 'oneclick':
637
+ return {
638
+ type: PossibleTypes.ONE_CLICK,
639
+ result: Success({})
640
+ };
641
+ case 'click2sms':
642
+ return {
643
+ type: PossibleTypes.CLICK2SMS,
644
+ result: Success({})
645
+ };
646
+ case 'ussd':
647
+ return {
648
+ type: PossibleTypes.USSD,
649
+ result: Success({})
650
+ };
651
+ case 'creditcard':
652
+ return {
653
+ type: PossibleTypes.CREDIT_CARD,
654
+ result: Success({})
655
+ };
656
+ default:
657
+ throw new Error('(mockStrategyStateByUrlParam) Strategy Mock Flow not supported');
658
+ }
659
+ }
660
+ };
661
+ /**
662
+ * Identify Strategy
663
+ * @returns {type: 'strategy/identifyStrategy', payload: {type: PossibleTypes.MO, result: IdentifyFlowOptionsResult}}
664
+ * - Add type
665
+ * - Makes a decision on which strategy to use in order to identify the flow
666
+ * - Strategy could be asking user's phone number, selecting an operator etc
667
+ * - all with the intension of getting the flow and its configuration
668
+ * - Flows are usually tied to an operator in the pages config.json
669
+ * - But they could also be single flows
670
+ *
671
+ */
672
+ var identifyStrategy = createAsyncThunk('strategy/identifyStrategy', function () { return __awaiter(void 0, void 0, void 0, function () {
673
+ var configs, strategy, strategyConfigs, search, flowObj, strategyResult;
674
+ var _a, _b, _c, _d, _e, _f, _g, _h;
675
+ return __generator(this, function (_j) {
676
+ configs = getConfig();
677
+ strategy = configs.strategy, strategyConfigs = configs.strategyConfigs;
678
+ search = searchToObject(window);
679
+ if (search['mock-flow'] !== undefined) {
680
+ return [2 /*return*/, mockStrategyStateByUrlParam()];
681
+ }
682
+ if ((search['show-pin-entry'] && search['show-pin-entry'] === '1') ||
683
+ (search['show-thank-you'] && search['show-thank-you'] === '1')) {
684
+ flowObj = determineFlowByOperator({
685
+ configs: configs,
686
+ operator: search.operator
687
+ });
688
+ strategyResult = {
689
+ type: PossibleTypes.PIN,
690
+ result: Success({}),
691
+ data: {
692
+ config: (flowObj === null || flowObj === void 0 ? void 0 : flowObj.flowConfig) || ((_a = strategyConfigs === null || strategyConfigs === void 0 ? void 0 : strategyConfigs.default) === null || _a === void 0 ? void 0 : _a.flowConfig)
693
+ }
694
+ };
695
+ return [2 /*return*/, strategyResult];
696
+ }
697
+ if (strategy.includes('ask-operator')) {
698
+ return [2 /*return*/, askOperator()];
699
+ }
700
+ if (strategy.includes('detect-operator-by-ip')) {
701
+ return [2 /*return*/, detectOperatorByIp()];
702
+ }
703
+ if (strategy === null || strategy === void 0 ? void 0 : strategy.includes('ask-mobile-number')) {
704
+ return [2 /*return*/, askMobileNumber()];
705
+ }
706
+ switch (strategy) {
707
+ case 'pin': {
708
+ return [2 /*return*/, {
709
+ type: PossibleTypes.PIN,
710
+ result: Success({}),
711
+ data: {
712
+ config: (_b = strategyConfigs === null || strategyConfigs === void 0 ? void 0 : strategyConfigs.default) === null || _b === void 0 ? void 0 : _b.flowConfig
713
+ }
714
+ }];
715
+ }
716
+ case 'mo':
717
+ return [2 /*return*/, {
718
+ type: PossibleTypes.MO,
719
+ result: Success({}),
720
+ data: {
721
+ config: (_c = strategyConfigs === null || strategyConfigs === void 0 ? void 0 : strategyConfigs.default) === null || _c === void 0 ? void 0 : _c.flowConfig
722
+ }
723
+ }];
724
+ case 'mo-redir':
725
+ return [2 /*return*/, {
726
+ type: PossibleTypes.MO_REDIR,
727
+ result: Success({}),
728
+ data: {
729
+ config: (_d = strategyConfigs === null || strategyConfigs === void 0 ? void 0 : strategyConfigs.default) === null || _d === void 0 ? void 0 : _d.flowConfig
730
+ }
731
+ }];
732
+ case 'one-click':
733
+ return [2 /*return*/, {
734
+ type: PossibleTypes.ONE_CLICK,
735
+ result: Success({}),
736
+ data: {
737
+ config: (_e = strategyConfigs === null || strategyConfigs === void 0 ? void 0 : strategyConfigs.default) === null || _e === void 0 ? void 0 : _e.flowConfig
738
+ }
739
+ }];
740
+ case 'click2sms':
741
+ return [2 /*return*/, {
742
+ type: PossibleTypes.CLICK2SMS,
743
+ result: Success({}),
744
+ data: {
745
+ config: (_f = strategyConfigs === null || strategyConfigs === void 0 ? void 0 : strategyConfigs.default) === null || _f === void 0 ? void 0 : _f.flowConfig
746
+ }
747
+ }];
748
+ case 'ussd':
749
+ return [2 /*return*/, {
750
+ type: PossibleTypes.USSD,
751
+ result: Success({}),
752
+ data: {
753
+ config: (_g = strategyConfigs === null || strategyConfigs === void 0 ? void 0 : strategyConfigs.default) === null || _g === void 0 ? void 0 : _g.flowConfig
754
+ }
755
+ }];
756
+ case 'credit-card':
757
+ return [2 /*return*/, {
758
+ type: PossibleTypes.CREDIT_CARD,
759
+ result: Success({}),
760
+ data: {
761
+ config: (_h = strategyConfigs === null || strategyConfigs === void 0 ? void 0 : strategyConfigs.default) === null || _h === void 0 ? void 0 : _h.flowConfig
762
+ }
763
+ }];
764
+ default:
765
+ throw new Error('Strategy not supported');
766
+ }
767
+ });
768
+ }); });
769
+ var setStrategyExtraData = createAsyncThunk('strategy/setStrategyExtraData', function (_a) {
770
+ var type = _a.type, data = _a.data;
771
+ return __awaiter(void 0, void 0, void 0, function () {
772
+ return __generator(this, function (_b) {
773
+ return [2 /*return*/, ({
774
+ type: type,
775
+ result: NothingYet(),
776
+ data: data
777
+ })];
778
+ });
779
+ });
780
+ });
781
+ var strategySlice = createSlice({
782
+ name: 'strategy',
783
+ initialState: initialState,
784
+ reducers: {
785
+ // Define synchronous reducers as needed
786
+ },
787
+ extraReducers: function (builder) {
788
+ builder
789
+ .addCase(identifyStrategy.pending, function (state) {
790
+ state.currentState = {
791
+ type: PossibleTypes.IDENTIFY_STRATEGY,
792
+ result: Loading()
793
+ };
794
+ })
795
+ .addCase(identifyStrategy.fulfilled, function (state, action) {
796
+ state.currentState = action.payload;
797
+ })
798
+ .addCase(identifyStrategy.rejected, function (state, action) {
799
+ state.currentState = {
800
+ type: PossibleTypes.IDENTIFY_STRATEGY,
801
+ result: Failure(action.error.message)
802
+ };
803
+ })
804
+ .addCase(submitMSISDNAction.pending, function (state) {
805
+ state.currentState = {
806
+ type: PossibleTypes.IDENTIFY_FLOW_BY_MSISDN,
807
+ result: Loading()
808
+ };
809
+ })
810
+ .addCase(submitMSISDNAction.fulfilled, function (state, action) {
811
+ state.currentState = action.payload;
812
+ })
813
+ .addCase(submitMSISDNAction.rejected, function (state, action) {
814
+ state.currentState = {
815
+ type: PossibleTypes.IDENTIFY_FLOW_BY_MSISDN,
816
+ result: Failure(action.payload)
817
+ };
818
+ })
819
+ .addCase(setStrategyExtraData.fulfilled, function (state, action) {
820
+ state.currentState = action.payload;
821
+ })
822
+ .addCase(selectOperatorAction.pending, function (state) {
823
+ state.currentState = {
824
+ type: PossibleTypes.IDENTIFY_FLOW_BY_OPERATOR_SELECT,
825
+ result: Loading()
826
+ };
827
+ })
828
+ .addCase(selectOperatorAction.fulfilled, function (state, action) {
829
+ state.currentState = action.payload;
830
+ })
831
+ .addCase(selectOperatorAction.rejected, function (state, action) {
832
+ state.currentState = {
833
+ type: PossibleTypes.IDENTIFY_FLOW_BY_OPERATOR_SELECT,
834
+ result: Failure(action.payload)
835
+ };
836
+ });
837
+ }
838
+ });
839
+ var strategyReducer = strategySlice.reducer;
840
+
841
+ export { PossibleTypes as P, selectOperatorAction as a, strategyReducer as b, setStrategyExtraData as c, identifyStrategy as i, submitMSISDNAction as s };
842
+ //# sourceMappingURL=strategySlice-bF74rxDK.js.map