@amazon-devices/react-navigation__routers 7.0.1759135970 → 8.0.9000000000-rn-83

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 (75) hide show
  1. package/SystemBundles/b6cc62e27d70be8722b0e7aef9fd04a870d49127e6c724fe934d1f8ca4ff8177.bundle +1298 -0
  2. package/SystemBundles/b6cc62e27d70be8722b0e7aef9fd04a870d49127e6c724fe934d1f8ca4ff8177.map +373 -0
  3. package/SystemModules/amzn__react-navigation__routers-8.modules.txt +9 -0
  4. package/SystemModules/amzn__react-navigation__routers-8.private.modules.txt +1 -0
  5. package/SystemModules/keplerscript-system-bundle-config.json +4 -4
  6. package/kepler-compatibility.json +2 -2
  7. package/lib/module/BaseRouter.js +6 -4
  8. package/lib/module/BaseRouter.js.map +1 -1
  9. package/lib/module/CommonActions.js +48 -7
  10. package/lib/module/CommonActions.js.map +1 -1
  11. package/lib/module/DrawerRouter.js +6 -6
  12. package/lib/module/DrawerRouter.js.map +1 -1
  13. package/lib/module/StackRouter.js +261 -80
  14. package/lib/module/StackRouter.js.map +1 -1
  15. package/lib/module/TabRouter.js +117 -34
  16. package/lib/module/TabRouter.js.map +1 -1
  17. package/lib/module/createParamsFromAction.js +16 -0
  18. package/lib/module/createParamsFromAction.js.map +1 -0
  19. package/lib/module/createRouteFromAction.js +21 -0
  20. package/lib/module/createRouteFromAction.js.map +1 -0
  21. package/lib/module/index.js +8 -6
  22. package/lib/module/index.js.map +1 -1
  23. package/lib/module/package.json +1 -0
  24. package/lib/module/types.js +2 -0
  25. package/lib/module/types.js.map +1 -1
  26. package/lib/typescript/package.json +1 -0
  27. package/lib/typescript/src/BaseRouter.d.ts +23 -20
  28. package/lib/typescript/src/BaseRouter.d.ts.map +1 -1
  29. package/lib/typescript/src/CommonActions.d.ts +66 -18
  30. package/lib/typescript/src/CommonActions.d.ts.map +1 -1
  31. package/lib/typescript/src/DrawerRouter.d.ts +18 -6
  32. package/lib/typescript/src/DrawerRouter.d.ts.map +1 -1
  33. package/lib/typescript/src/StackRouter.d.ts +73 -11
  34. package/lib/typescript/src/StackRouter.d.ts.map +1 -1
  35. package/lib/typescript/src/TabRouter.d.ts +24 -4
  36. package/lib/typescript/src/TabRouter.d.ts.map +1 -1
  37. package/lib/typescript/src/createParamsFromAction.d.ts +13 -0
  38. package/lib/typescript/src/createParamsFromAction.d.ts.map +1 -0
  39. package/lib/typescript/src/createRouteFromAction.d.ts +17 -0
  40. package/lib/typescript/src/createRouteFromAction.d.ts.map +1 -0
  41. package/lib/typescript/src/index.d.ts +4 -4
  42. package/lib/typescript/src/index.d.ts.map +1 -1
  43. package/lib/typescript/src/types.d.ts +1 -2
  44. package/lib/typescript/src/types.d.ts.map +1 -1
  45. package/oss-attribution/attribution.txt +0 -0
  46. package/oss-attribution/licenseInfos.json +1 -0
  47. package/package.json +80 -1
  48. package/src/BaseRouter.tsx +11 -6
  49. package/src/CommonActions.tsx +147 -56
  50. package/src/DrawerRouter.tsx +15 -13
  51. package/src/StackRouter.tsx +437 -199
  52. package/src/TabRouter.tsx +192 -53
  53. package/src/createParamsFromAction.tsx +22 -0
  54. package/src/createRouteFromAction.tsx +24 -0
  55. package/src/index.tsx +4 -4
  56. package/src/types.tsx +5 -5
  57. package/SystemBundles/2c2b2e72cf9d128296ac83ba53082313ac31f6e9fd98b8e87fe0af40e15fbec1.bundle +0 -3515
  58. package/SystemBundles/2c2b2e72cf9d128296ac83ba53082313ac31f6e9fd98b8e87fe0af40e15fbec1.map +0 -1
  59. package/SystemModules/amzn__react-navigation__routers-7.modules.txt +0 -21
  60. package/SystemModules/amzn__react-navigation__routers-7.private.modules.txt +0 -13
  61. package/THIRD_PARTY_NOTICES.txt +0 -24
  62. package/lib/commonjs/BaseRouter.js +0 -61
  63. package/lib/commonjs/BaseRouter.js.map +0 -1
  64. package/lib/commonjs/CommonActions.js +0 -53
  65. package/lib/commonjs/CommonActions.js.map +0 -1
  66. package/lib/commonjs/DrawerRouter.js +0 -154
  67. package/lib/commonjs/DrawerRouter.js.map +0 -1
  68. package/lib/commonjs/StackRouter.js +0 -310
  69. package/lib/commonjs/StackRouter.js.map +0 -1
  70. package/lib/commonjs/TabRouter.js +0 -253
  71. package/lib/commonjs/TabRouter.js.map +0 -1
  72. package/lib/commonjs/index.js +0 -80
  73. package/lib/commonjs/index.js.map +0 -1
  74. package/lib/commonjs/types.js +0 -6
  75. package/lib/commonjs/types.js.map +0 -1
@@ -0,0 +1,1298 @@
1
+ var __BUNDLE_START_TIME__=globalThis.nativePerformanceNow?nativePerformanceNow():Date.now(),__DEV__=false,process=globalThis.process||{},__METRO_GLOBAL_PREFIX__='';process.env=process.env||{};process.env.NODE_ENV=process.env.NODE_ENV||"production";
2
+ (function (global) {
3
+ global._majorVersionToNoVersionIdMap["38c132d4a4bb76eedc80"] = "6cc26ebe1139d52af4d3";
4
+ global._majorVersionToNoVersionIdMap["4aa609d49dd4d9fd69d8"] = "32fd789b2b4e67ba3679";
5
+ global._majorVersionToNoVersionIdMap["6664264a195fd5e23d1d"] = "0060dd931905de8947f2";
6
+ global._majorVersionToNoVersionIdMap["ab2268e7375692a18adc"] = "2b770725127b9776e940";
7
+ global._majorVersionToNoVersionIdMap["2beefa0726d547efb6db"] = "b4b91107e9e069bf6a04";
8
+ global._majorVersionToNoVersionIdMap["cdf36facce344b18753d"] = "dec21c689e6604dbbf6a";
9
+ global._majorVersionToNoVersionIdMap["f37671f481d3442f7534"] = "1156635305634f3a14c7";
10
+ global._majorVersionToNoVersionIdMap["c69c3cb84fab85c7ab0e"] = "0308dce3623ba6fd6f70";
11
+ global._majorVersionToNoVersionIdMap["c39b5e831a38e3449d62"] = "38a8cc556e14fd685890";
12
+ global._majorVersionToNoVersionIdMap["88041ddd5b5dffda940e"] = "1b0b28afa5b685260b1d";
13
+ global._majorVersionToNoVersionIdMap["42552d18e7ae0181bd39"] = "2bee182fbe6f2aca641e";
14
+ global._majorVersionToNoVersionIdMap["bb57842acdb83f2b3f2e"] = "eb7d4baa35301f5aed5f";
15
+ global._majorVersionToNoVersionIdMap["b323020ab42ad72c3c32"] = "4d722edf544c9fdf1c6e";
16
+ global._majorVersionToNoVersionIdMap["9f3bb7c66a6d54b4f31f"] = "6770b45f91f2db97b2e2";
17
+ global._majorVersionToNoVersionIdMap["6b91947bdfabfe9f3fcb"] = "46404a6d49463f9601d3";
18
+ global._majorVersionToNoVersionIdMap["cd82459845fcc006200c"] = "cbb4d666ebd7ab852aa3";
19
+ global._majorVersionToNoVersionIdMap["8ef843d324cbf8ceac15"] = "06a5a1d28ce3fd05c417";
20
+ global._majorVersionToNoVersionIdMap["278cdd8bb8970d40410d"] = "fb17719fd282a08dfde9";
21
+ global._majorVersionToNoVersionIdMap["9bc9fe221ec0ce458468"] = "8b1e20a6232a353c9981";
22
+ global._majorVersionToNoVersionIdMap["e793a2a0d8af55b1360e"] = "5077535faaf552d97157";
23
+ global._majorVersionToNoVersionIdMap["130dabfd918c0cb9f581"] = "04f3f6928f15baafd43b";
24
+ global._majorVersionToNoVersionIdMap["bdff2caa69d04b792045"] = "39eca4bd16c398373cc4";
25
+ global._majorVersionToNoVersionIdMap["b0bba4cced4da2c7d68d"] = "347ca45e3641dd48caa1";
26
+ })(typeof globalThis !== 'undefined' ? globalThis : typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this);
27
+ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
28
+ "use strict";
29
+
30
+ Object.defineProperty(exports, "__esModule", {
31
+ value: true
32
+ });
33
+ var _exportNames = {
34
+ CommonActions: true,
35
+ BaseRouter: true,
36
+ DrawerActions: true,
37
+ DrawerRouter: true,
38
+ StackActions: true,
39
+ StackRouter: true,
40
+ TabActions: true,
41
+ TabRouter: true
42
+ };
43
+ Object.defineProperty(exports, "BaseRouter", {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _$$_REQUIRE(_dependencyMap[0]).BaseRouter;
47
+ }
48
+ });
49
+ exports.CommonActions = undefined;
50
+ Object.defineProperty(exports, "DrawerActions", {
51
+ enumerable: true,
52
+ get: function () {
53
+ return _$$_REQUIRE(_dependencyMap[1]).DrawerActions;
54
+ }
55
+ });
56
+ Object.defineProperty(exports, "DrawerRouter", {
57
+ enumerable: true,
58
+ get: function () {
59
+ return _$$_REQUIRE(_dependencyMap[1]).DrawerRouter;
60
+ }
61
+ });
62
+ Object.defineProperty(exports, "StackActions", {
63
+ enumerable: true,
64
+ get: function () {
65
+ return _$$_REQUIRE(_dependencyMap[2]).StackActions;
66
+ }
67
+ });
68
+ Object.defineProperty(exports, "StackRouter", {
69
+ enumerable: true,
70
+ get: function () {
71
+ return _$$_REQUIRE(_dependencyMap[2]).StackRouter;
72
+ }
73
+ });
74
+ Object.defineProperty(exports, "TabActions", {
75
+ enumerable: true,
76
+ get: function () {
77
+ return _$$_REQUIRE(_dependencyMap[3]).TabActions;
78
+ }
79
+ });
80
+ Object.defineProperty(exports, "TabRouter", {
81
+ enumerable: true,
82
+ get: function () {
83
+ return _$$_REQUIRE(_dependencyMap[3]).TabRouter;
84
+ }
85
+ });
86
+ var CommonActions = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4]));
87
+ exports.CommonActions = CommonActions;
88
+ Object.keys(_$$_REQUIRE(_dependencyMap[5])).forEach(function (key) {
89
+ if (key === "default" || key === "__esModule") return;
90
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
91
+ if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[5])[key]) return;
92
+ Object.defineProperty(exports, key, {
93
+ enumerable: true,
94
+ get: function () {
95
+ return _$$_REQUIRE(_dependencyMap[5])[key];
96
+ }
97
+ });
98
+ });
99
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
100
+ },"c39b5e831a38e3449d62",["4aa609d49dd4d9fd69d8","ab2268e7375692a18adc","2beefa0726d547efb6db","cdf36facce344b18753d","6664264a195fd5e23d1d","42552d18e7ae0181bd39"]);
101
+ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
102
+ "use strict";
103
+
104
+ Object.defineProperty(exports, "__esModule", {
105
+ value: true
106
+ });
107
+ exports.BaseRouter = undefined;
108
+ /**
109
+ * Base router object that can be used when writing custom routers.
110
+ * This provides few helper methods to handle common actions such as `RESET`.
111
+ */
112
+ var BaseRouter = exports.BaseRouter = {
113
+ getStateForAction(state, action) {
114
+ switch (action.type) {
115
+ case 'SET_PARAMS':
116
+ case 'REPLACE_PARAMS':
117
+ {
118
+ var index = action.source ? state.routes.findIndex(r => r.key === action.source) : state.index;
119
+ if (index === -1) {
120
+ return null;
121
+ }
122
+ return {
123
+ ...state,
124
+ routes: state.routes.map((r, i) => i === index ? {
125
+ ...r,
126
+ params: action.type === 'REPLACE_PARAMS' ? action.payload.params : {
127
+ ...r.params,
128
+ ...action.payload.params
129
+ }
130
+ } : r)
131
+ };
132
+ }
133
+ case 'RESET':
134
+ {
135
+ var nextState = action.payload;
136
+ if (nextState.routes.length === 0 || nextState.routes.some(route => !state.routeNames.includes(route.name))) {
137
+ return null;
138
+ }
139
+ if (nextState.stale === false) {
140
+ if (state.routeNames.length !== nextState.routeNames.length || nextState.routeNames.some(name => !state.routeNames.includes(name))) {
141
+ return null;
142
+ }
143
+ return {
144
+ ...nextState,
145
+ routes: nextState.routes.map(route => route.key ? route : {
146
+ ...route,
147
+ key: `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[0]).nanoid)()}`
148
+ })
149
+ };
150
+ }
151
+ return nextState;
152
+ }
153
+ default:
154
+ return null;
155
+ }
156
+ },
157
+ shouldActionChangeFocus(action) {
158
+ return action.type === 'NAVIGATE' || action.type === 'NAVIGATE_DEPRECATED';
159
+ }
160
+ };
161
+ },"4aa609d49dd4d9fd69d8",["f9dacdfad56c8f57acc2"]);
162
+ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
163
+ Object.defineProperty(exports, "__esModule", {
164
+ value: true
165
+ });
166
+ exports.nanoid = exports.customAlphabet = undefined;
167
+ var urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
168
+ var customAlphabet = (alphabet, defaultSize = 21) => {
169
+ return (size = defaultSize) => {
170
+ var id = '';
171
+ var i = size | 0;
172
+ while (i--) {
173
+ id += alphabet[Math.random() * alphabet.length | 0];
174
+ }
175
+ return id;
176
+ };
177
+ };
178
+ exports.customAlphabet = customAlphabet;
179
+ var nanoid = (size = 21) => {
180
+ var id = '';
181
+ var i = size | 0;
182
+ while (i--) {
183
+ id += urlAlphabet[Math.random() * 64 | 0];
184
+ }
185
+ return id;
186
+ };
187
+ exports.nanoid = nanoid;
188
+ },"f9dacdfad56c8f57acc2",[]);
189
+ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
190
+ "use strict";
191
+
192
+ Object.defineProperty(exports, "__esModule", {
193
+ value: true
194
+ });
195
+ exports.DrawerActions = undefined;
196
+ exports.DrawerRouter = DrawerRouter;
197
+ var DrawerActions = exports.DrawerActions = {
198
+ ..._$$_REQUIRE(_dependencyMap[0]).TabActions,
199
+ openDrawer() {
200
+ return {
201
+ type: 'OPEN_DRAWER'
202
+ };
203
+ },
204
+ closeDrawer() {
205
+ return {
206
+ type: 'CLOSE_DRAWER'
207
+ };
208
+ },
209
+ toggleDrawer() {
210
+ return {
211
+ type: 'TOGGLE_DRAWER'
212
+ };
213
+ }
214
+ };
215
+ function DrawerRouter({
216
+ defaultStatus = 'closed',
217
+ ...rest
218
+ }) {
219
+ var router = (0, _$$_REQUIRE(_dependencyMap[0]).TabRouter)(rest);
220
+ var isDrawerInHistory = state => Boolean(state.history?.some(it => it.type === 'drawer'));
221
+ var addDrawerToHistory = state => {
222
+ if (isDrawerInHistory(state)) {
223
+ return state;
224
+ }
225
+ return {
226
+ ...state,
227
+ history: [...state.history, {
228
+ type: 'drawer',
229
+ status: defaultStatus === 'open' ? 'closed' : 'open'
230
+ }]
231
+ };
232
+ };
233
+ var removeDrawerFromHistory = state => {
234
+ if (!isDrawerInHistory(state)) {
235
+ return state;
236
+ }
237
+ return {
238
+ ...state,
239
+ history: state.history.filter(it => it.type !== 'drawer')
240
+ };
241
+ };
242
+ var openDrawer = state => {
243
+ if (defaultStatus === 'open') {
244
+ return removeDrawerFromHistory(state);
245
+ }
246
+ return addDrawerToHistory(state);
247
+ };
248
+ var closeDrawer = state => {
249
+ if (defaultStatus === 'open') {
250
+ return addDrawerToHistory(state);
251
+ }
252
+ return removeDrawerFromHistory(state);
253
+ };
254
+ return {
255
+ ...router,
256
+ type: 'drawer',
257
+ getInitialState({
258
+ routeNames,
259
+ routeParamList,
260
+ routeGetIdList
261
+ }) {
262
+ var state = router.getInitialState({
263
+ routeNames,
264
+ routeParamList,
265
+ routeGetIdList
266
+ });
267
+ return {
268
+ ...state,
269
+ default: defaultStatus,
270
+ stale: false,
271
+ type: 'drawer',
272
+ key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`
273
+ };
274
+ },
275
+ getRehydratedState(partialState, {
276
+ routeNames,
277
+ routeParamList,
278
+ routeGetIdList
279
+ }) {
280
+ if (partialState.stale === false) {
281
+ return partialState;
282
+ }
283
+ var state = router.getRehydratedState(partialState, {
284
+ routeNames,
285
+ routeParamList,
286
+ routeGetIdList
287
+ });
288
+ if (isDrawerInHistory(partialState)) {
289
+ // Re-sync the drawer entry in history to correct it if it was wrong
290
+ state = removeDrawerFromHistory(state);
291
+ state = addDrawerToHistory(state);
292
+ }
293
+ return {
294
+ ...state,
295
+ default: defaultStatus,
296
+ type: 'drawer',
297
+ key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`
298
+ };
299
+ },
300
+ getStateForRouteFocus(state, key) {
301
+ var result = router.getStateForRouteFocus(state, key);
302
+ return closeDrawer(result);
303
+ },
304
+ getStateForAction(state, action, options) {
305
+ switch (action.type) {
306
+ case 'OPEN_DRAWER':
307
+ return openDrawer(state);
308
+ case 'CLOSE_DRAWER':
309
+ return closeDrawer(state);
310
+ case 'TOGGLE_DRAWER':
311
+ if (isDrawerInHistory(state)) {
312
+ return removeDrawerFromHistory(state);
313
+ }
314
+ return addDrawerToHistory(state);
315
+ case 'JUMP_TO':
316
+ case 'NAVIGATE':
317
+ case 'NAVIGATE_DEPRECATED':
318
+ {
319
+ var result = router.getStateForAction(state, action, options);
320
+ if (result != null && result.index !== state.index) {
321
+ return closeDrawer(result);
322
+ }
323
+ return result;
324
+ }
325
+ case 'GO_BACK':
326
+ if (isDrawerInHistory(state)) {
327
+ return removeDrawerFromHistory(state);
328
+ }
329
+ return router.getStateForAction(state, action, options);
330
+ default:
331
+ return router.getStateForAction(state, action, options);
332
+ }
333
+ },
334
+ actionCreators: DrawerActions
335
+ };
336
+ }
337
+ },"ab2268e7375692a18adc",["cdf36facce344b18753d","f9dacdfad56c8f57acc2"]);
338
+ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
339
+ "use strict";
340
+
341
+ Object.defineProperty(exports, "__esModule", {
342
+ value: true
343
+ });
344
+ exports.TabActions = undefined;
345
+ exports.TabRouter = TabRouter;
346
+ var TYPE_ROUTE = 'route';
347
+ var TabActions = exports.TabActions = {
348
+ jumpTo(name, params) {
349
+ return {
350
+ type: 'JUMP_TO',
351
+ payload: {
352
+ name,
353
+ params
354
+ }
355
+ };
356
+ }
357
+ };
358
+ var getRouteHistory = (routes, index, backBehavior, initialRouteName) => {
359
+ var history = [{
360
+ type: TYPE_ROUTE,
361
+ key: routes[index].key
362
+ }];
363
+ var initialRouteIndex;
364
+ switch (backBehavior) {
365
+ case 'order':
366
+ for (var i = index; i > 0; i--) {
367
+ history.unshift({
368
+ type: TYPE_ROUTE,
369
+ key: routes[i - 1].key
370
+ });
371
+ }
372
+ break;
373
+ case 'firstRoute':
374
+ if (index !== 0) {
375
+ history.unshift({
376
+ type: TYPE_ROUTE,
377
+ key: routes[0].key
378
+ });
379
+ }
380
+ break;
381
+ case 'initialRoute':
382
+ initialRouteIndex = routes.findIndex(route => route.name === initialRouteName);
383
+ initialRouteIndex = initialRouteIndex === -1 ? 0 : initialRouteIndex;
384
+ if (index !== initialRouteIndex) {
385
+ history.unshift({
386
+ type: TYPE_ROUTE,
387
+ key: routes[initialRouteIndex].key
388
+ });
389
+ }
390
+ break;
391
+ case 'history':
392
+ case 'fullHistory':
393
+ // The history will fill up on navigation
394
+ break;
395
+ }
396
+ return history;
397
+ };
398
+ var changeIndex = (state, index, backBehavior, initialRouteName) => {
399
+ var history = state.history;
400
+ if (backBehavior === 'history' || backBehavior === 'fullHistory') {
401
+ var currentRoute = state.routes[index];
402
+ if (backBehavior === 'history') {
403
+ // Remove the existing key from the history to de-duplicate it
404
+ history = history.filter(it => it.type === 'route' ? it.key !== currentRoute.key : false);
405
+ } else if (backBehavior === 'fullHistory') {
406
+ var lastHistoryRouteItemIndex = history.findLastIndex(item => item.type === 'route');
407
+ if (currentRoute.key === history[lastHistoryRouteItemIndex]?.key) {
408
+ // For full-history, only remove if it matches the last route
409
+ // Useful for drawer, if current route was in history, then drawer state changed
410
+ // Then we only need to move the route to the front
411
+ history = [...history.slice(0, lastHistoryRouteItemIndex), ...history.slice(lastHistoryRouteItemIndex + 1)];
412
+ }
413
+ }
414
+ history = history.concat({
415
+ type: TYPE_ROUTE,
416
+ key: currentRoute.key,
417
+ params: backBehavior === 'fullHistory' ? currentRoute.params : undefined
418
+ });
419
+ } else {
420
+ history = getRouteHistory(state.routes, index, backBehavior, initialRouteName);
421
+ }
422
+ return {
423
+ ...state,
424
+ index,
425
+ history
426
+ };
427
+ };
428
+ function TabRouter({
429
+ initialRouteName,
430
+ backBehavior = 'firstRoute'
431
+ }) {
432
+ var router = {
433
+ ..._$$_REQUIRE(_dependencyMap[0]).BaseRouter,
434
+ type: 'tab',
435
+ getInitialState({
436
+ routeNames,
437
+ routeParamList
438
+ }) {
439
+ var index = initialRouteName !== undefined && routeNames.includes(initialRouteName) ? routeNames.indexOf(initialRouteName) : 0;
440
+ var routes = routeNames.map(name => ({
441
+ name,
442
+ key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
443
+ params: routeParamList[name]
444
+ }));
445
+ var history = getRouteHistory(routes, index, backBehavior, initialRouteName);
446
+ return {
447
+ stale: false,
448
+ type: 'tab',
449
+ key: `tab-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
450
+ index,
451
+ routeNames,
452
+ history,
453
+ routes,
454
+ preloadedRouteKeys: []
455
+ };
456
+ },
457
+ getRehydratedState(partialState, {
458
+ routeNames,
459
+ routeParamList
460
+ }) {
461
+ var state = partialState;
462
+ if (state.stale === false) {
463
+ return state;
464
+ }
465
+ var routes = routeNames.map(name => {
466
+ var route = state.routes.find(r => r.name === name);
467
+ return {
468
+ ...route,
469
+ name,
470
+ key: route && route.name === name && route.key ? route.key : `${name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
471
+ params: routeParamList[name] !== undefined ? {
472
+ ...routeParamList[name],
473
+ ...(route ? route.params : undefined)
474
+ } : route ? route.params : undefined
475
+ };
476
+ });
477
+ var index = Math.min(Math.max(routeNames.indexOf(state.routes[state?.index ?? 0]?.name), 0), routes.length - 1);
478
+ var routeKeys = routes.map(route => route.key);
479
+ var history = state.history?.filter(it => routeKeys.includes(it.key)) ?? [];
480
+ return changeIndex({
481
+ stale: false,
482
+ type: 'tab',
483
+ key: `tab-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
484
+ index,
485
+ routeNames,
486
+ history,
487
+ routes,
488
+ preloadedRouteKeys: state.preloadedRouteKeys?.filter(key => routeKeys.includes(key)) ?? []
489
+ }, index, backBehavior, initialRouteName);
490
+ },
491
+ getStateForRouteNamesChange(state, {
492
+ routeNames,
493
+ routeParamList,
494
+ routeKeyChanges
495
+ }) {
496
+ var routes = routeNames.map(name => state.routes.find(r => r.name === name && !routeKeyChanges.includes(r.name)) || {
497
+ name,
498
+ key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
499
+ params: routeParamList[name]
500
+ });
501
+ var index = Math.max(0, routeNames.indexOf(state.routes[state.index].name));
502
+ var history = state.history.filter(
503
+ // Type will always be 'route' for tabs, but could be different in a router extending this (e.g. drawer)
504
+ it => it.type !== 'route' || routes.find(r => r.key === it.key));
505
+ if (!history.length) {
506
+ history = getRouteHistory(routes, index, backBehavior, initialRouteName);
507
+ }
508
+ return {
509
+ ...state,
510
+ history,
511
+ routeNames,
512
+ routes,
513
+ index
514
+ };
515
+ },
516
+ getStateForRouteFocus(state, key) {
517
+ var index = state.routes.findIndex(r => r.key === key);
518
+ if (index === -1 || index === state.index) {
519
+ return state;
520
+ }
521
+ return changeIndex(state, index, backBehavior, initialRouteName);
522
+ },
523
+ getStateForAction(state, action, {
524
+ routeParamList,
525
+ routeGetIdList
526
+ }) {
527
+ switch (action.type) {
528
+ case 'JUMP_TO':
529
+ case 'NAVIGATE':
530
+ case 'NAVIGATE_DEPRECATED':
531
+ {
532
+ var index = state.routes.findIndex(route => route.name === action.payload.name);
533
+ if (index === -1) {
534
+ return null;
535
+ }
536
+ var updatedState = changeIndex({
537
+ ...state,
538
+ routes: state.routes.map(route => {
539
+ if (route.name !== action.payload.name) {
540
+ return route;
541
+ }
542
+ var getId = routeGetIdList[route.name];
543
+ var currentId = getId?.({
544
+ params: route.params
545
+ });
546
+ var nextId = getId?.({
547
+ params: action.payload.params
548
+ });
549
+ var key = currentId === nextId ? route.key : `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`;
550
+ var params;
551
+ if ((action.type === 'NAVIGATE' || action.type === 'NAVIGATE_DEPRECATED') && action.payload.merge && currentId === nextId) {
552
+ params = action.payload.params !== undefined || routeParamList[route.name] !== undefined ? {
553
+ ...routeParamList[route.name],
554
+ ...route.params,
555
+ ...action.payload.params
556
+ } : route.params;
557
+ } else {
558
+ params = (0, _$$_REQUIRE(_dependencyMap[2]).createParamsFromAction)({
559
+ action,
560
+ routeParamList
561
+ });
562
+ }
563
+ var path = action.type === 'NAVIGATE' && action.payload.path != null ? action.payload.path : route.path;
564
+ return params !== route.params || path !== route.path ? {
565
+ ...route,
566
+ key,
567
+ path,
568
+ params
569
+ } : route;
570
+ })
571
+ }, index, backBehavior, initialRouteName);
572
+ return {
573
+ ...updatedState,
574
+ preloadedRouteKeys: updatedState.preloadedRouteKeys.filter(key => key !== state.routes[updatedState.index].key)
575
+ };
576
+ }
577
+ case 'SET_PARAMS':
578
+ case 'REPLACE_PARAMS':
579
+ {
580
+ var nextState = _$$_REQUIRE(_dependencyMap[0]).BaseRouter.getStateForAction(state, action);
581
+ if (nextState !== null) {
582
+ var _index = nextState.index;
583
+ if (_index != null) {
584
+ var focusedRoute = nextState.routes[_index];
585
+ var historyItemIndex = state.history.findLastIndex(item => item.key === focusedRoute.key);
586
+ var updatedHistory = state.history;
587
+ if (historyItemIndex !== -1) {
588
+ updatedHistory = [...state.history];
589
+ updatedHistory[historyItemIndex] = {
590
+ ...updatedHistory[historyItemIndex],
591
+ params: focusedRoute.params
592
+ };
593
+ }
594
+ return {
595
+ ...nextState,
596
+ history: updatedHistory
597
+ };
598
+ }
599
+ }
600
+ return nextState;
601
+ }
602
+ case 'GO_BACK':
603
+ {
604
+ if (state.history.length === 1) {
605
+ return null;
606
+ }
607
+ var previousHistoryItem = state.history[state.history.length - 2];
608
+ var previousKey = previousHistoryItem?.key;
609
+ var _index2 = state.routes.findLastIndex(route => route.key === previousKey);
610
+ if (_index2 === -1) {
611
+ return null;
612
+ }
613
+ var routes = state.routes;
614
+ if (backBehavior === 'fullHistory' && routes[_index2].params !== previousHistoryItem.params) {
615
+ routes = [...state.routes];
616
+ routes[_index2] = {
617
+ ...routes[_index2],
618
+ params: previousHistoryItem.params
619
+ };
620
+ }
621
+ return {
622
+ ...state,
623
+ routes,
624
+ preloadedRouteKeys: state.preloadedRouteKeys.filter(key => key !== state.routes[_index2].key),
625
+ history: state.history.slice(0, -1),
626
+ index: _index2
627
+ };
628
+ }
629
+ case 'PRELOAD':
630
+ {
631
+ var routeIndex = state.routes.findIndex(route => route.name === action.payload.name);
632
+ if (routeIndex === -1) {
633
+ return null;
634
+ }
635
+ var route = state.routes[routeIndex];
636
+ var getId = routeGetIdList[route.name];
637
+ var currentId = getId?.({
638
+ params: route.params
639
+ });
640
+ var nextId = getId?.({
641
+ params: action.payload.params
642
+ });
643
+ var key = currentId === nextId ? route.key : `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`;
644
+ var params = (0, _$$_REQUIRE(_dependencyMap[2]).createParamsFromAction)({
645
+ action,
646
+ routeParamList
647
+ });
648
+ var newRoute = params !== route.params ? {
649
+ ...route,
650
+ key,
651
+ params
652
+ } : route;
653
+ return {
654
+ ...state,
655
+ preloadedRouteKeys: state.preloadedRouteKeys.filter(key => key !== route.key).concat(newRoute.key),
656
+ routes: state.routes.map((route, index) => index === routeIndex ? newRoute : route),
657
+ history: key === route.key ? state.history : state.history.filter(record => record.key !== route.key)
658
+ };
659
+ }
660
+ default:
661
+ return _$$_REQUIRE(_dependencyMap[0]).BaseRouter.getStateForAction(state, action);
662
+ }
663
+ },
664
+ actionCreators: TabActions
665
+ };
666
+ return router;
667
+ }
668
+ },"cdf36facce344b18753d",["4aa609d49dd4d9fd69d8","f9dacdfad56c8f57acc2","f37671f481d3442f7534"]);
669
+ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
670
+ "use strict";
671
+
672
+ Object.defineProperty(exports, "__esModule", {
673
+ value: true
674
+ });
675
+ exports.createParamsFromAction = createParamsFromAction;
676
+ function createParamsFromAction({
677
+ action,
678
+ routeParamList
679
+ }) {
680
+ var _action$payload = action.payload,
681
+ name = _action$payload.name,
682
+ params = _action$payload.params;
683
+ return routeParamList[name] !== undefined ? {
684
+ ...routeParamList[name],
685
+ ...params
686
+ } : params;
687
+ }
688
+ },"f37671f481d3442f7534",[]);
689
+ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
690
+ "use strict";
691
+
692
+ Object.defineProperty(exports, "__esModule", {
693
+ value: true
694
+ });
695
+ exports.StackActions = undefined;
696
+ exports.StackRouter = StackRouter;
697
+ var StackActions = exports.StackActions = {
698
+ replace(name, params) {
699
+ return {
700
+ type: 'REPLACE',
701
+ payload: {
702
+ name,
703
+ params
704
+ }
705
+ };
706
+ },
707
+ push(name, params) {
708
+ return {
709
+ type: 'PUSH',
710
+ payload: {
711
+ name,
712
+ params
713
+ }
714
+ };
715
+ },
716
+ pop(count = 1) {
717
+ return {
718
+ type: 'POP',
719
+ payload: {
720
+ count
721
+ }
722
+ };
723
+ },
724
+ popToTop() {
725
+ return {
726
+ type: 'POP_TO_TOP'
727
+ };
728
+ },
729
+ popTo(name, params, options) {
730
+ if (typeof options === 'boolean') {
731
+ console.warn(`Passing a boolean as the third argument to 'popTo' is deprecated. Pass '{ merge: true }' instead.`);
732
+ }
733
+ return {
734
+ type: 'POP_TO',
735
+ payload: {
736
+ name,
737
+ params,
738
+ merge: typeof options === 'boolean' ? options : options?.merge
739
+ }
740
+ };
741
+ }
742
+ };
743
+ function StackRouter(options) {
744
+ var router = {
745
+ ..._$$_REQUIRE(_dependencyMap[0]).BaseRouter,
746
+ type: 'stack',
747
+ getInitialState({
748
+ routeNames,
749
+ routeParamList
750
+ }) {
751
+ var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
752
+ return {
753
+ stale: false,
754
+ type: 'stack',
755
+ key: `stack-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
756
+ index: 0,
757
+ routeNames,
758
+ preloadedRoutes: [],
759
+ routes: [{
760
+ key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
761
+ name: initialRouteName,
762
+ params: routeParamList[initialRouteName]
763
+ }]
764
+ };
765
+ },
766
+ getRehydratedState(partialState, {
767
+ routeNames,
768
+ routeParamList
769
+ }) {
770
+ var state = partialState;
771
+ if (state.stale === false) {
772
+ return state;
773
+ }
774
+ var routes = state.routes.filter(route => routeNames.includes(route.name)).map(route => ({
775
+ ...route,
776
+ key: route.key || `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
777
+ params: routeParamList[route.name] !== undefined ? {
778
+ ...routeParamList[route.name],
779
+ ...route.params
780
+ } : route.params
781
+ }));
782
+ var preloadedRoutes = state.preloadedRoutes?.filter(route => routeNames.includes(route.name)).map(route => ({
783
+ ...route,
784
+ key: route.key || `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
785
+ params: routeParamList[route.name] !== undefined ? {
786
+ ...routeParamList[route.name],
787
+ ...route.params
788
+ } : route.params
789
+ })) ?? [];
790
+ if (routes.length === 0) {
791
+ var initialRouteName = options.initialRouteName !== undefined ? options.initialRouteName : routeNames[0];
792
+ routes.push({
793
+ key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
794
+ name: initialRouteName,
795
+ params: routeParamList[initialRouteName]
796
+ });
797
+ }
798
+ return {
799
+ stale: false,
800
+ type: 'stack',
801
+ key: `stack-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
802
+ index: routes.length - 1,
803
+ routeNames,
804
+ routes,
805
+ preloadedRoutes
806
+ };
807
+ },
808
+ getStateForRouteNamesChange(state, {
809
+ routeNames,
810
+ routeParamList,
811
+ routeKeyChanges
812
+ }) {
813
+ var routes = state.routes.filter(route => routeNames.includes(route.name) && !routeKeyChanges.includes(route.name));
814
+ if (routes.length === 0) {
815
+ var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
816
+ routes.push({
817
+ key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
818
+ name: initialRouteName,
819
+ params: routeParamList[initialRouteName]
820
+ });
821
+ }
822
+ return {
823
+ ...state,
824
+ routeNames,
825
+ routes,
826
+ index: Math.min(state.index, routes.length - 1)
827
+ };
828
+ },
829
+ getStateForRouteFocus(state, key) {
830
+ var index = state.routes.findIndex(r => r.key === key);
831
+ if (index === -1 || index === state.index) {
832
+ return state;
833
+ }
834
+ return {
835
+ ...state,
836
+ index,
837
+ routes: state.routes.slice(0, index + 1)
838
+ };
839
+ },
840
+ getStateForAction(state, action, options) {
841
+ var routeParamList = options.routeParamList;
842
+ switch (action.type) {
843
+ case 'REPLACE':
844
+ {
845
+ var currentIndex = action.target === state.key && action.source ? state.routes.findIndex(r => r.key === action.source) : state.index;
846
+ if (currentIndex === -1) {
847
+ return null;
848
+ }
849
+ if (!state.routeNames.includes(action.payload.name)) {
850
+ return null;
851
+ }
852
+ var getId = options.routeGetIdList[action.payload.name];
853
+ var id = getId?.({
854
+ params: action.payload.params
855
+ });
856
+
857
+ // Re-use preloaded route if available
858
+ var route = state.preloadedRoutes.find(route => route.name === action.payload.name && id === getId?.({
859
+ params: route.params
860
+ }));
861
+ if (!route) {
862
+ route = (0, _$$_REQUIRE(_dependencyMap[2]).createRouteFromAction)({
863
+ action,
864
+ routeParamList
865
+ });
866
+ }
867
+ return {
868
+ ...state,
869
+ routes: state.routes.map((r, i) => i === currentIndex ? route : r),
870
+ preloadedRoutes: state.preloadedRoutes.filter(r => r.key !== route.key)
871
+ };
872
+ }
873
+ case 'PUSH':
874
+ case 'NAVIGATE':
875
+ {
876
+ if (!state.routeNames.includes(action.payload.name)) {
877
+ return null;
878
+ }
879
+ var _getId = options.routeGetIdList[action.payload.name];
880
+ var _id = _getId?.({
881
+ params: action.payload.params
882
+ });
883
+ var _route;
884
+ if (_id !== undefined) {
885
+ _route = state.routes.findLast(route => route.name === action.payload.name && _id === _getId?.({
886
+ params: route.params
887
+ }));
888
+ } else if (action.type === 'NAVIGATE') {
889
+ var currentRoute = state.routes[state.index];
890
+
891
+ // If the route matches the current one, then navigate to it
892
+ if (action.payload.name === currentRoute.name) {
893
+ _route = currentRoute;
894
+ } else if (action.payload.pop) {
895
+ _route = state.routes.findLast(route => route.name === action.payload.name);
896
+ }
897
+ }
898
+ if (!_route) {
899
+ _route = state.preloadedRoutes.find(route => route.name === action.payload.name && _id === _getId?.({
900
+ params: route.params
901
+ }));
902
+ }
903
+ var params;
904
+ if (action.type === 'NAVIGATE' && action.payload.merge && _route) {
905
+ params = action.payload.params !== undefined || routeParamList[action.payload.name] !== undefined ? {
906
+ ...routeParamList[action.payload.name],
907
+ ..._route.params,
908
+ ...action.payload.params
909
+ } : _route.params;
910
+ } else {
911
+ params = (0, _$$_REQUIRE(_dependencyMap[3]).createParamsFromAction)({
912
+ action,
913
+ routeParamList
914
+ });
915
+ }
916
+ var routes;
917
+ if (_route) {
918
+ if (action.type === 'NAVIGATE' && action.payload.pop) {
919
+ routes = [];
920
+
921
+ // Get all routes until the matching one
922
+ for (var r of state.routes) {
923
+ if (r.key === _route.key) {
924
+ routes.push({
925
+ ..._route,
926
+ path: action.payload.path !== undefined ? action.payload.path : _route.path,
927
+ params
928
+ });
929
+ break;
930
+ }
931
+ routes.push(r);
932
+ }
933
+ } else {
934
+ routes = state.routes.filter(r => r.key !== _route.key);
935
+ routes.push({
936
+ ..._route,
937
+ path: action.type === 'NAVIGATE' && action.payload.path !== undefined ? action.payload.path : _route.path,
938
+ params
939
+ });
940
+ }
941
+ } else {
942
+ routes = [...state.routes, {
943
+ key: `${action.payload.name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
944
+ name: action.payload.name,
945
+ path: action.type === 'NAVIGATE' ? action.payload.path : undefined,
946
+ params
947
+ }];
948
+ }
949
+ return {
950
+ ...state,
951
+ index: routes.length - 1,
952
+ preloadedRoutes: state.preloadedRoutes.filter(route => routes[routes.length - 1].key !== route.key),
953
+ routes
954
+ };
955
+ }
956
+ case 'NAVIGATE_DEPRECATED':
957
+ {
958
+ if (!state.routeNames.includes(action.payload.name)) {
959
+ return null;
960
+ }
961
+ if (state.preloadedRoutes.find(route => route.name === action.payload.name && _id2 === _getId2?.({
962
+ params: route.params
963
+ }))) {
964
+ return null;
965
+ }
966
+
967
+ // If the route already exists, navigate to that
968
+ var index = -1;
969
+ var _getId2 = options.routeGetIdList[action.payload.name];
970
+ var _id2 = _getId2?.({
971
+ params: action.payload.params
972
+ });
973
+ if (_id2 !== undefined) {
974
+ index = state.routes.findIndex(route => route.name === action.payload.name && _id2 === _getId2?.({
975
+ params: route.params
976
+ }));
977
+ } else if (state.routes[state.index].name === action.payload.name) {
978
+ index = state.index;
979
+ } else {
980
+ index = state.routes.findLastIndex(route => route.name === action.payload.name);
981
+ }
982
+ if (index === -1) {
983
+ var _routes = [...state.routes, (0, _$$_REQUIRE(_dependencyMap[2]).createRouteFromAction)({
984
+ action,
985
+ routeParamList
986
+ })];
987
+ return {
988
+ ...state,
989
+ routes: _routes,
990
+ index: _routes.length - 1
991
+ };
992
+ }
993
+ var _route2 = state.routes[index];
994
+ var _params;
995
+ if (action.payload.merge) {
996
+ _params = action.payload.params !== undefined || routeParamList[_route2.name] !== undefined ? {
997
+ ...routeParamList[_route2.name],
998
+ ..._route2.params,
999
+ ...action.payload.params
1000
+ } : _route2.params;
1001
+ } else {
1002
+ _params = (0, _$$_REQUIRE(_dependencyMap[3]).createParamsFromAction)({
1003
+ action,
1004
+ routeParamList
1005
+ });
1006
+ }
1007
+ return {
1008
+ ...state,
1009
+ index,
1010
+ routes: [...state.routes.slice(0, index), _params !== _route2.params ? {
1011
+ ..._route2,
1012
+ params: _params
1013
+ } : state.routes[index]]
1014
+ };
1015
+ }
1016
+ case 'POP':
1017
+ {
1018
+ var _currentIndex = action.target === state.key && action.source ? state.routes.findIndex(r => r.key === action.source) : state.index;
1019
+ if (_currentIndex > 0) {
1020
+ var count = Math.max(_currentIndex - action.payload.count + 1, 1);
1021
+ var _routes2 = state.routes.slice(0, count).concat(state.routes.slice(_currentIndex + 1));
1022
+ return {
1023
+ ...state,
1024
+ index: _routes2.length - 1,
1025
+ routes: _routes2
1026
+ };
1027
+ }
1028
+ return null;
1029
+ }
1030
+ case 'POP_TO_TOP':
1031
+ return router.getStateForAction(state, {
1032
+ type: 'POP',
1033
+ payload: {
1034
+ count: state.routes.length - 1
1035
+ }
1036
+ }, options);
1037
+ case 'POP_TO':
1038
+ {
1039
+ var _currentIndex2 = action.target === state.key && action.source ? state.routes.findLastIndex(r => r.key === action.source) : state.index;
1040
+ if (_currentIndex2 === -1) {
1041
+ return null;
1042
+ }
1043
+ if (!state.routeNames.includes(action.payload.name)) {
1044
+ return null;
1045
+ }
1046
+
1047
+ // If the route already exists, navigate to it
1048
+ var _index = -1;
1049
+ var _getId3 = options.routeGetIdList[action.payload.name];
1050
+ var _id3 = _getId3?.({
1051
+ params: action.payload.params
1052
+ });
1053
+ if (_id3 !== undefined) {
1054
+ _index = state.routes.findIndex(route => route.name === action.payload.name && _id3 === _getId3?.({
1055
+ params: route.params
1056
+ }));
1057
+ } else if (state.routes[_currentIndex2].name === action.payload.name) {
1058
+ _index = _currentIndex2;
1059
+ } else {
1060
+ for (var i = _currentIndex2; i >= 0; i--) {
1061
+ if (state.routes[i].name === action.payload.name) {
1062
+ _index = i;
1063
+ break;
1064
+ }
1065
+ }
1066
+ }
1067
+
1068
+ // If the route doesn't exist, remove the current route and add the new one
1069
+ if (_index === -1) {
1070
+ // Re-use preloaded route if available
1071
+ var _route3 = state.preloadedRoutes.find(route => route.name === action.payload.name && _id3 === _getId3?.({
1072
+ params: route.params
1073
+ }));
1074
+ if (!_route3) {
1075
+ _route3 = (0, _$$_REQUIRE(_dependencyMap[2]).createRouteFromAction)({
1076
+ action,
1077
+ routeParamList
1078
+ });
1079
+ }
1080
+ var _routes3 = state.routes.slice(0, _currentIndex2).concat(_route3);
1081
+ return {
1082
+ ...state,
1083
+ index: _routes3.length - 1,
1084
+ routes: _routes3,
1085
+ preloadedRoutes: state.preloadedRoutes.filter(r => r.key !== _route3.key)
1086
+ };
1087
+ }
1088
+ var _route4 = state.routes[_index];
1089
+ var _params2;
1090
+ if (action.payload.merge) {
1091
+ _params2 = action.payload.params !== undefined || routeParamList[_route4.name] !== undefined ? {
1092
+ ...routeParamList[_route4.name],
1093
+ ..._route4.params,
1094
+ ...action.payload.params
1095
+ } : _route4.params;
1096
+ } else {
1097
+ _params2 = (0, _$$_REQUIRE(_dependencyMap[3]).createParamsFromAction)({
1098
+ action,
1099
+ routeParamList
1100
+ });
1101
+ }
1102
+ return {
1103
+ ...state,
1104
+ index: _index,
1105
+ routes: [...state.routes.slice(0, _index), _params2 !== _route4.params ? {
1106
+ ..._route4,
1107
+ params: _params2
1108
+ } : state.routes[_index]]
1109
+ };
1110
+ }
1111
+ case 'GO_BACK':
1112
+ if (state.index > 0) {
1113
+ return router.getStateForAction(state, {
1114
+ type: 'POP',
1115
+ payload: {
1116
+ count: 1
1117
+ },
1118
+ target: action.target,
1119
+ source: action.source
1120
+ }, options);
1121
+ }
1122
+ return null;
1123
+ case 'PRELOAD':
1124
+ {
1125
+ var _getId4 = options.routeGetIdList[action.payload.name];
1126
+ var _id4 = _getId4?.({
1127
+ params: action.payload.params
1128
+ });
1129
+ var _route5;
1130
+ if (_id4 !== undefined) {
1131
+ _route5 = state.routes.find(route => route.name === action.payload.name && _id4 === _getId4?.({
1132
+ params: route.params
1133
+ }));
1134
+ }
1135
+ if (_route5) {
1136
+ return {
1137
+ ...state,
1138
+ routes: state.routes.map(r => {
1139
+ if (r.key !== _route5?.key) {
1140
+ return r;
1141
+ }
1142
+ return {
1143
+ ...r,
1144
+ params: (0, _$$_REQUIRE(_dependencyMap[3]).createParamsFromAction)({
1145
+ action,
1146
+ routeParamList
1147
+ })
1148
+ };
1149
+ })
1150
+ };
1151
+ } else {
1152
+ return {
1153
+ ...state,
1154
+ preloadedRoutes: state.preloadedRoutes.filter(r => r.name !== action.payload.name || _id4 !== _getId4?.({
1155
+ params: r.params
1156
+ })).concat((0, _$$_REQUIRE(_dependencyMap[2]).createRouteFromAction)({
1157
+ action,
1158
+ routeParamList
1159
+ }))
1160
+ };
1161
+ }
1162
+ }
1163
+ default:
1164
+ return _$$_REQUIRE(_dependencyMap[0]).BaseRouter.getStateForAction(state, action);
1165
+ }
1166
+ },
1167
+ actionCreators: StackActions
1168
+ };
1169
+ return router;
1170
+ }
1171
+ },"2beefa0726d547efb6db",["4aa609d49dd4d9fd69d8","f9dacdfad56c8f57acc2","c69c3cb84fab85c7ab0e","f37671f481d3442f7534"]);
1172
+ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1173
+ "use strict";
1174
+
1175
+ Object.defineProperty(exports, "__esModule", {
1176
+ value: true
1177
+ });
1178
+ exports.createRouteFromAction = createRouteFromAction;
1179
+ function createRouteFromAction({
1180
+ action,
1181
+ routeParamList
1182
+ }) {
1183
+ var name = action.payload.name;
1184
+ return {
1185
+ key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[0]).nanoid)()}`,
1186
+ name,
1187
+ params: (0, _$$_REQUIRE(_dependencyMap[1]).createParamsFromAction)({
1188
+ action,
1189
+ routeParamList
1190
+ })
1191
+ };
1192
+ }
1193
+ },"c69c3cb84fab85c7ab0e",["f9dacdfad56c8f57acc2","f37671f481d3442f7534"]);
1194
+ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1195
+ "use strict";
1196
+
1197
+ Object.defineProperty(exports, "__esModule", {
1198
+ value: true
1199
+ });
1200
+ exports.goBack = goBack;
1201
+ exports.navigate = navigate;
1202
+ exports.navigateDeprecated = navigateDeprecated;
1203
+ exports.preload = preload;
1204
+ exports.replaceParams = replaceParams;
1205
+ exports.reset = reset;
1206
+ exports.setParams = setParams;
1207
+ function goBack() {
1208
+ return {
1209
+ type: 'GO_BACK'
1210
+ };
1211
+ }
1212
+ function navigate(...args) {
1213
+ if (typeof args[0] === 'string') {
1214
+ var name = args[0],
1215
+ params = args[1],
1216
+ options = args[2];
1217
+ if (typeof options === 'boolean') {
1218
+ console.warn(`Passing a boolean as the third argument to 'navigate' is deprecated. Pass '{ merge: true }' instead.`);
1219
+ }
1220
+ return {
1221
+ type: 'NAVIGATE',
1222
+ payload: {
1223
+ name,
1224
+ params,
1225
+ merge: typeof options === 'boolean' ? options : options?.merge,
1226
+ pop: options?.pop
1227
+ }
1228
+ };
1229
+ } else {
1230
+ var payload = args[0] || {};
1231
+ if (!('name' in payload)) {
1232
+ throw new Error('You need to specify a name when calling navigate with an object as the argument. See https://reactnavigation.org/docs/navigation-actions#navigate for usage.');
1233
+ }
1234
+ return {
1235
+ type: 'NAVIGATE',
1236
+ payload
1237
+ };
1238
+ }
1239
+ }
1240
+ function navigateDeprecated(...args) {
1241
+ if (typeof args[0] === 'string') {
1242
+ return {
1243
+ type: 'NAVIGATE_DEPRECATED',
1244
+ payload: {
1245
+ name: args[0],
1246
+ params: args[1]
1247
+ }
1248
+ };
1249
+ } else {
1250
+ var payload = args[0] || {};
1251
+ if (!('name' in payload)) {
1252
+ throw new Error('You need to specify a name when calling navigateDeprecated with an object as the argument. See https://reactnavigation.org/docs/navigation-actions#navigatelegacy for usage.');
1253
+ }
1254
+ return {
1255
+ type: 'NAVIGATE_DEPRECATED',
1256
+ payload
1257
+ };
1258
+ }
1259
+ }
1260
+ function reset(state) {
1261
+ return {
1262
+ type: 'RESET',
1263
+ payload: state
1264
+ };
1265
+ }
1266
+ function setParams(params) {
1267
+ return {
1268
+ type: 'SET_PARAMS',
1269
+ payload: {
1270
+ params
1271
+ }
1272
+ };
1273
+ }
1274
+ function replaceParams(params) {
1275
+ return {
1276
+ type: 'REPLACE_PARAMS',
1277
+ payload: {
1278
+ params
1279
+ }
1280
+ };
1281
+ }
1282
+ function preload(name, params) {
1283
+ return {
1284
+ type: 'PRELOAD',
1285
+ payload: {
1286
+ name,
1287
+ params
1288
+ }
1289
+ };
1290
+ }
1291
+ },"6664264a195fd5e23d1d",[]);
1292
+ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1293
+ "use strict";
1294
+
1295
+ Object.defineProperty(exports, "__esModule", {
1296
+ value: true
1297
+ });
1298
+ },"42552d18e7ae0181bd39",[]);