@coolon/angular-ui-powerups 0.0.98 → 0.0.101

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 (70) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +1351 -1109
  2. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  3. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  5. package/coolon-angular-ui-powerups.d.ts +19 -19
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/coolon-angular-ui-powerups.js +19 -19
  8. package/esm2015/index.js +2 -2
  9. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +19 -5
  10. package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +13 -3
  11. package/esm2015/lib/interaction/index.js +5 -4
  12. package/esm2015/lib/interaction/interaction-context.js +7 -53
  13. package/esm2015/lib/interaction/interaction.module.js +3 -3
  14. package/esm2015/lib/interaction/services/interaction.service.js +228 -0
  15. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +62 -0
  16. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js +145 -0
  17. package/esm2015/lib/interaction/services/modal-interaction-context.factory.js +17 -0
  18. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +3 -3
  19. package/esm2015/lib/place/guards/abstract-place.guard.js +13 -12
  20. package/esm2015/lib/place/guards/interaction.guard.js +27 -19
  21. package/esm2015/lib/place/guards/navigation-state.js +309 -246
  22. package/esm2015/lib/place/place-router.js +160 -115
  23. package/esm2015/lib/place/url-snapshot.js +91 -19
  24. package/esm2015/public_api.js +2 -2
  25. package/esm5/coolon-angular-ui-powerups.js +19 -19
  26. package/esm5/index.js +2 -2
  27. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +23 -14
  28. package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +10 -3
  29. package/esm5/lib/interaction/index.js +5 -4
  30. package/esm5/lib/interaction/interaction-context.js +8 -61
  31. package/esm5/lib/interaction/interaction.module.js +3 -3
  32. package/esm5/lib/interaction/services/interaction.service.js +271 -0
  33. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +65 -0
  34. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js +170 -0
  35. package/esm5/lib/interaction/services/modal-interaction-context.factory.js +27 -0
  36. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +3 -3
  37. package/esm5/lib/place/guards/abstract-place.guard.js +15 -14
  38. package/esm5/lib/place/guards/interaction.guard.js +25 -17
  39. package/esm5/lib/place/guards/navigation-state.js +422 -292
  40. package/esm5/lib/place/place-router.js +182 -133
  41. package/esm5/lib/place/url-snapshot.js +105 -21
  42. package/esm5/public_api.js +2 -2
  43. package/fesm2015/coolon-angular-ui-powerups.js +1112 -918
  44. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  45. package/fesm5/coolon-angular-ui-powerups.js +1302 -1060
  46. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  47. package/lib/interaction/components/activity-container/activity-container.component.d.ts +1 -0
  48. package/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.d.ts +3 -1
  49. package/lib/interaction/index.d.ts +4 -3
  50. package/lib/interaction/interaction-context.d.ts +2 -11
  51. package/lib/interaction/services/interaction.service.d.ts +46 -0
  52. package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.d.ts +15 -0
  53. package/lib/interaction/services/{dialog-interaction-context.d.ts → mat-dialog-interaction/dialog-interaction-context.d.ts} +2 -2
  54. package/lib/interaction/services/modal-interaction-context.factory.d.ts +4 -0
  55. package/lib/place/guards/abstract-place.guard.d.ts +1 -1
  56. package/lib/place/guards/interaction.guard.d.ts +3 -3
  57. package/lib/place/guards/navigation-state.d.ts +65 -37
  58. package/lib/place/place-router.d.ts +15 -22
  59. package/lib/place/url-snapshot.d.ts +18 -6
  60. package/package.json +1 -1
  61. package/schematics/place-routes/templates/place-routes.ts.template +3 -3
  62. package/styles/styles.scss +1 -1
  63. package/esm2015/lib/interaction/services/dialog-interaction-context.js +0 -163
  64. package/esm2015/lib/interaction/services/dialog-interaction.service.js +0 -151
  65. package/esm2015/lib/interaction/services/modal-interaction.service.js +0 -109
  66. package/esm5/lib/interaction/services/dialog-interaction-context.js +0 -188
  67. package/esm5/lib/interaction/services/dialog-interaction.service.js +0 -179
  68. package/esm5/lib/interaction/services/modal-interaction.service.js +0 -153
  69. package/lib/interaction/services/dialog-interaction.service.d.ts +0 -24
  70. package/lib/interaction/services/modal-interaction.service.d.ts +0 -15
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material'), require('@angular/material/tabs'), require('@angular/platform-browser/animations'), require('@coolon/pectin'), require('@angular/cdk/portal'), require('@angular/router'), require('lodash'), require('@coolon/typescript-utilities'), require('@angular/material/dialog'), require('@angular/material/icon'), require('@angular/material/list'), require('@angular/material/tooltip'), require('@typescript-plus/fast-memoize-decorator/dist/src'), require('@typescript-plus/fast-memoize-decorator'), require('reflect-metadata'), require('@angular/animations'), require('resize-observer-polyfill'), require('rxjs')) :
3
- typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material', '@angular/material/tabs', '@angular/platform-browser/animations', '@coolon/pectin', '@angular/cdk/portal', '@angular/router', 'lodash', '@coolon/typescript-utilities', '@angular/material/dialog', '@angular/material/icon', '@angular/material/list', '@angular/material/tooltip', '@typescript-plus/fast-memoize-decorator/dist/src', '@typescript-plus/fast-memoize-decorator', 'reflect-metadata', '@angular/animations', 'resize-observer-polyfill', 'rxjs'], factory) :
4
- (global = global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material, global.ng.material.tabs, global.ng.platformBrowser.animations, global.pectin, global.ng.cdk.portal, global.ng.router, global.___default, global.typescriptUtilities, global.ng.material.dialog, global.ng.material.icon, global.ng.material.list, global.ng.material.tooltip, global.src, global.fastMemoizeDecorator, null, global.ng.animations, global.ResizeObserver, global.rxjs));
5
- }(this, function (exports, common, core, forms, material, tabs, animations, pectin, portal, router, ___default, typescriptUtilities, dialog, icon, list, tooltip, src, fastMemoizeDecorator, reflectMetadata, animations$1, ResizeObserver, rxjs) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material'), require('@angular/material/tabs'), require('@angular/platform-browser/animations'), require('@coolon/pectin'), require('@angular/cdk/portal'), require('@angular/router'), require('lodash'), require('@coolon/typescript-utilities'), require('@angular/material/icon'), require('@angular/material/list'), require('@angular/material/tooltip'), require('@typescript-plus/fast-memoize-decorator/dist/src'), require('@typescript-plus/fast-memoize-decorator'), require('reflect-metadata'), require('@angular/animations'), require('resize-observer-polyfill'), require('@angular/material/dialog'), require('rxjs')) :
3
+ typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material', '@angular/material/tabs', '@angular/platform-browser/animations', '@coolon/pectin', '@angular/cdk/portal', '@angular/router', 'lodash', '@coolon/typescript-utilities', '@angular/material/icon', '@angular/material/list', '@angular/material/tooltip', '@typescript-plus/fast-memoize-decorator/dist/src', '@typescript-plus/fast-memoize-decorator', 'reflect-metadata', '@angular/animations', 'resize-observer-polyfill', '@angular/material/dialog', 'rxjs'], factory) :
4
+ (global = global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material, global.ng.material.tabs, global.ng.platformBrowser.animations, global.pectin, global.ng.cdk.portal, global.ng.router, global.___default, global.typescriptUtilities, global.ng.material.icon, global.ng.material.list, global.ng.material.tooltip, global.src, global.fastMemoizeDecorator, null, global.ng.animations, global.ResizeObserver, global.ng.material.dialog, global.rxjs));
5
+ }(this, function (exports, common, core, forms, material, tabs, animations, pectin, portal, router, ___default, typescriptUtilities, icon, list, tooltip, src, fastMemoizeDecorator, reflectMetadata, animations$1, ResizeObserver, dialog, rxjs) { 'use strict';
6
6
 
7
7
  var ___default__default = 'default' in ___default ? ___default['default'] : ___default;
8
8
  ResizeObserver = ResizeObserver && ResizeObserver.hasOwnProperty('default') ? ResizeObserver['default'] : ResizeObserver;
@@ -1105,7 +1105,7 @@
1105
1105
  * @abstract
1106
1106
  * @template D, R, E
1107
1107
  */
1108
- exports.ɵbh = /** @class */ (function (_super) {
1108
+ exports.ɵbi = /** @class */ (function (_super) {
1109
1109
  __extends(Activity, _super);
1110
1110
  function Activity() {
1111
1111
  var _this = _super !== null && _super.apply(this, arguments) || this;
@@ -1195,12 +1195,12 @@
1195
1195
  * @type {?}
1196
1196
  * @private
1197
1197
  */
1198
- exports.ɵbh.prototype._busyModel;
1198
+ exports.ɵbi.prototype._busyModel;
1199
1199
  /**
1200
1200
  * @type {?}
1201
1201
  * @private
1202
1202
  */
1203
- exports.ɵbh.prototype._activityContext;
1203
+ exports.ɵbi.prototype._activityContext;
1204
1204
  }
1205
1205
  (function (Activity) {
1206
1206
  /**
@@ -1215,7 +1215,7 @@
1215
1215
  /** @type {?} */
1216
1216
  Callbacks.prototype.onCancel;
1217
1217
  }
1218
- })(exports.ɵbh || (exports.ɵbh = {}));
1218
+ })(exports.ɵbi || (exports.ɵbi = {}));
1219
1219
 
1220
1220
  /**
1221
1221
  * @fileoverview added by tsickle
@@ -1237,7 +1237,7 @@
1237
1237
  return _super !== null && _super.apply(this, arguments) || this;
1238
1238
  }
1239
1239
  return AbstractActivity;
1240
- }(exports.ɵbh));
1240
+ }(exports.ɵbi));
1241
1241
 
1242
1242
  /**
1243
1243
  * @fileoverview added by tsickle
@@ -1283,15 +1283,13 @@
1283
1283
  /**
1284
1284
  * @abstract
1285
1285
  */
1286
- /**
1286
+ var /**
1287
1287
  * @abstract
1288
1288
  */
1289
- exports.ɵbc = /** @class */ (function (_super) {
1289
+ InteractionContext = /** @class */ (function (_super) {
1290
1290
  __extends(InteractionContext, _super);
1291
1291
  function InteractionContext() {
1292
- var _this = _super !== null && _super.apply(this, arguments) || this;
1293
- _this.activityListeners = new pectin.EventListenerList();
1294
- return _this;
1292
+ return _super !== null && _super.apply(this, arguments) || this;
1295
1293
  }
1296
1294
  /**
1297
1295
  * Returns true if an activity is currently running.
@@ -1308,65 +1306,31 @@
1308
1306
  return this.active.value;
1309
1307
  };
1310
1308
  /**
1311
- * @param {?} listener
1312
- * @return {?}
1313
- */
1314
- InteractionContext.prototype.addActivityListener = /**
1315
- * @param {?} listener
1316
- * @return {?}
1317
- */
1318
- function (listener) {
1319
- return this.activityListeners.add(listener);
1320
- };
1321
- /**
1322
- * @protected
1323
- * @return {?}
1324
- */
1325
- InteractionContext.prototype.notifyActivityStarted = /**
1326
- * @protected
1327
- * @return {?}
1328
- */
1329
- function () {
1330
- this.activityListeners.fire((/**
1331
- * @param {?} l
1332
- * @return {?}
1333
- */
1334
- function (l) { return l.onActivityStarted(); }));
1335
- };
1336
- /**
1337
- * @protected
1338
1309
  * @return {?}
1339
1310
  */
1340
- InteractionContext.prototype.notifyActivityFinished = /**
1341
- * @protected
1311
+ InteractionContext.prototype.dispose = /**
1342
1312
  * @return {?}
1343
1313
  */
1344
1314
  function () {
1345
- this.activityListeners.fire((/**
1346
- * @param {?} l
1347
- * @return {?}
1348
- */
1349
- function (l) { return l.onActivityFinished(); }));
1315
+ // TODO: think about auto cancelling any outstanding activity on dispose.
1316
+ // See NavigationState.Navigating for a use-case.
1317
+ pectin.assert.isFalsey(this.isActive());
1318
+ _super.prototype.dispose.call(this);
1350
1319
  };
1351
1320
  return InteractionContext;
1352
1321
  }(pectin.GarbageCollector));
1353
1322
  if (false) {
1354
- /**
1355
- * @type {?}
1356
- * @private
1357
- */
1358
- exports.ɵbc.prototype.activityListeners;
1359
1323
  /** @type {?} */
1360
- exports.ɵbc.prototype.activityList;
1324
+ InteractionContext.prototype.activityList;
1361
1325
  /** @type {?} */
1362
- exports.ɵbc.prototype.active;
1326
+ InteractionContext.prototype.active;
1363
1327
  /**
1364
1328
  * Returns the activity that is currently active.
1365
1329
  * This model is only updated in the next tick after the view has been updated.
1366
1330
  * @abstract
1367
1331
  * @return {?}
1368
1332
  */
1369
- exports.ɵbc.prototype.getCurrentActivity = function () { };
1333
+ InteractionContext.prototype.getCurrentActivity = function () { };
1370
1334
  /**
1371
1335
  * @abstract
1372
1336
  * @template D, R, E
@@ -1374,25 +1338,25 @@
1374
1338
  * @param {?=} data
1375
1339
  * @return {?}
1376
1340
  */
1377
- exports.ɵbc.prototype.startActivity = function (activityType, data) { };
1341
+ InteractionContext.prototype.startActivity = function (activityType, data) { };
1378
1342
  /**
1379
1343
  * @abstract
1380
1344
  * @param {?} alert
1381
1345
  * @return {?}
1382
1346
  */
1383
- exports.ɵbc.prototype.alert = function (alert) { };
1347
+ InteractionContext.prototype.alert = function (alert) { };
1384
1348
  /**
1385
1349
  * @abstract
1386
1350
  * @param {?} confirm
1387
1351
  * @return {?}
1388
1352
  */
1389
- exports.ɵbc.prototype.confirm = function (confirm) { };
1353
+ InteractionContext.prototype.confirm = function (confirm) { };
1390
1354
  /**
1391
1355
  * @abstract
1392
1356
  * @param {?} confirm
1393
1357
  * @return {?}
1394
1358
  */
1395
- exports.ɵbc.prototype.confirmOrReject = function (confirm) { };
1359
+ InteractionContext.prototype.confirmOrReject = function (confirm) { };
1396
1360
  /**
1397
1361
  * Presents the confirmation to the user and runs the activity only if the user confirms.
1398
1362
  * @abstract
@@ -1402,25 +1366,8 @@
1402
1366
  * @param {?=} data the activity data.
1403
1367
  * @return {?}
1404
1368
  */
1405
- exports.ɵbc.prototype.confirmThen = function (confirm, activityType, data) { };
1369
+ InteractionContext.prototype.confirmThen = function (confirm, activityType, data) { };
1406
1370
  }
1407
- (function (InteractionContext) {
1408
- /**
1409
- * @record
1410
- */
1411
- function Listener() { }
1412
- InteractionContext.Listener = Listener;
1413
- if (false) {
1414
- /**
1415
- * @return {?}
1416
- */
1417
- Listener.prototype.onActivityStarted = function () { };
1418
- /**
1419
- * @return {?}
1420
- */
1421
- Listener.prototype.onActivityFinished = function () { };
1422
- }
1423
- })(exports.ɵbc || (exports.ɵbc = {}));
1424
1371
 
1425
1372
  /**
1426
1373
  * @fileoverview added by tsickle
@@ -1429,7 +1376,7 @@
1429
1376
  /**
1430
1377
  * @template D, R, E
1431
1378
  */
1432
- exports.ɵbj = /** @class */ (function (_super) {
1379
+ exports.ɵbk = /** @class */ (function (_super) {
1433
1380
  __extends(ConfirmThenDialogComponent, _super);
1434
1381
  function ConfirmThenDialogComponent(config, interactionContext) {
1435
1382
  var _this = _super.call(this) || this;
@@ -1495,15 +1442,15 @@
1495
1442
  /** @nocollapse */
1496
1443
  ConfirmThenDialogComponent.ctorParameters = function () { return [
1497
1444
  { type: undefined, decorators: [{ type: core.Inject, args: [ACTIVITY_DATA,] }] },
1498
- { type: exports.ɵbc }
1445
+ { type: InteractionContext }
1499
1446
  ]; };
1500
1447
  return ConfirmThenDialogComponent;
1501
1448
  }(AbstractActivity));
1502
1449
  if (false) {
1503
1450
  /** @type {?} */
1504
- exports.ɵbj.prototype.config;
1451
+ exports.ɵbk.prototype.config;
1505
1452
  /** @type {?} */
1506
- exports.ɵbj.prototype.interactionContext;
1453
+ exports.ɵbk.prototype.interactionContext;
1507
1454
  }
1508
1455
  (function (ConfirmThenDialogComponent) {
1509
1456
  /**
@@ -1520,7 +1467,7 @@
1520
1467
  /** @type {?} */
1521
1468
  Data.prototype.data;
1522
1469
  }
1523
- })(exports.ɵbj || (exports.ɵbj = {}));
1470
+ })(exports.ɵbk || (exports.ɵbk = {}));
1524
1471
 
1525
1472
  /**
1526
1473
  * @fileoverview added by tsickle
@@ -1736,14 +1683,14 @@
1736
1683
  * @return {?}
1737
1684
  */
1738
1685
  function (confirm, activityType, data) {
1739
- return this._startActivity(exports.ɵbj, {
1686
+ return this._startActivity(exports.ɵbk, {
1740
1687
  confirm: confirm,
1741
1688
  activityType: activityType,
1742
1689
  data: data
1743
1690
  }, true);
1744
1691
  };
1745
1692
  return InteractionContextBase;
1746
- }(exports.ɵbc));
1693
+ }(InteractionContext));
1747
1694
  if (false) {
1748
1695
  /**
1749
1696
  * Returns the current list of activities that are in progress.
@@ -1828,7 +1775,7 @@
1828
1775
  var injector = core.Injector.create({
1829
1776
  providers: [
1830
1777
  {
1831
- provide: exports.ɵbc,
1778
+ provide: InteractionContext,
1832
1779
  useValue: this.interactionContext
1833
1780
  },
1834
1781
  { provide: ACTIVITY_DATA, useValue: activityContext.activityData }
@@ -2000,6 +1947,15 @@
2000
1947
  this._complete = true;
2001
1948
  this.activityCallbacks.onCancel(error);
2002
1949
  };
1950
+ /**
1951
+ * @return {?}
1952
+ */
1953
+ TabContext.prototype.dispose = /**
1954
+ * @return {?}
1955
+ */
1956
+ function () {
1957
+ this.component.dispose();
1958
+ };
2003
1959
  return TabContext;
2004
1960
  }());
2005
1961
  if (false) {
@@ -2089,20 +2045,10 @@
2089
2045
  enumerable: true,
2090
2046
  configurable: true
2091
2047
  });
2092
- // get isFinished() {
2093
- // return !this._initialActivityOutletContext;
2094
- // }
2095
- // get isFinished() {
2096
- // return !this._initialActivityOutletContext;
2097
- // }
2098
2048
  /**
2099
2049
  * @return {?}
2100
2050
  */
2101
- ActivityContainerComponent.prototype.ngOnInit =
2102
- // get isFinished() {
2103
- // return !this._initialActivityOutletContext;
2104
- // }
2105
- /**
2051
+ ActivityContainerComponent.prototype.ngOnInit = /**
2106
2052
  * @return {?}
2107
2053
  */
2108
2054
  function () {
@@ -2216,14 +2162,24 @@
2216
2162
  * @return {?}
2217
2163
  */
2218
2164
  function () {
2219
- var _this = this;
2220
2165
  if (this.tabs.selectedIndex < this.activityTabs.length - 1) {
2166
+ /** @type {?} */
2167
+ var tabs = this.activityTabs.value;
2168
+ /** @type {?} */
2169
+ var remainingActivities_1 = tabs.slice(0, 1 + this.tabs.selectedIndex);
2170
+ /** @type {?} */
2171
+ var finishedActivityTabs = tabs.slice(1 + this.tabs.selectedIndex);
2172
+ finishedActivityTabs.forEach((/**
2173
+ * @param {?} a
2174
+ * @return {?}
2175
+ */
2176
+ function (a) { return a.dispose(); }));
2221
2177
  this.activityTabs.runInTransaction((/**
2222
2178
  * @param {?} draft
2223
2179
  * @return {?}
2224
2180
  */
2225
2181
  function (draft) {
2226
- draft.value = draft.value.slice(0, 1 + _this.tabs.selectedIndex);
2182
+ draft.value = remainingActivities_1;
2227
2183
  }));
2228
2184
  }
2229
2185
  };
@@ -2350,6 +2306,292 @@
2350
2306
  ActivityContainerComponent.prototype._activityList;
2351
2307
  }
2352
2308
 
2309
+ /**
2310
+ * @fileoverview added by tsickle
2311
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2312
+ */
2313
+ /**
2314
+ * @abstract
2315
+ */
2316
+ var /**
2317
+ * @abstract
2318
+ */
2319
+ ModalInteractionContextFactory = /** @class */ (function () {
2320
+ function ModalInteractionContextFactory() {
2321
+ }
2322
+ return ModalInteractionContextFactory;
2323
+ }());
2324
+ if (false) {
2325
+ /**
2326
+ * @abstract
2327
+ * @return {?}
2328
+ */
2329
+ ModalInteractionContextFactory.prototype.createInteractionContext = function () { };
2330
+ }
2331
+
2332
+ /**
2333
+ * @fileoverview added by tsickle
2334
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2335
+ */
2336
+ /** @type {?} */
2337
+ var inplaceMonitorCount = 0;
2338
+ exports.ɵv = /** @class */ (function () {
2339
+ function InteractionService(modelInteractionContextFactory) {
2340
+ this.modelInteractionContextFactory = modelInteractionContextFactory;
2341
+ this.garbage = new pectin.GarbageCollector();
2342
+ this.exclusiveContext = new pectin.MutableValueModel();
2343
+ this._activeModalInteractionContextModel = new pectin.MutableValueModel();
2344
+ this._activeInlineInteractionContextModel = new pectin.MutableValueModel();
2345
+ var _a = pectin.Dsl.disposeWith(this.garbage), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2346
+ this._activeInteractionContext = chain(this._activeModalInteractionContextModel)
2347
+ .otherwise(this._activeInlineInteractionContextModel)
2348
+ .pluck('interactionContext');
2349
+ this.active = chain(this._activeInteractionContext).isNotNil();
2350
+ this.modelInteractionActive = chain(this._activeModalInteractionContextModel).isNotNil();
2351
+ this.inlineInteractionActive = chain(this._activeInlineInteractionContextModel).isNotNil();
2352
+ // TODO: chain.concat(listOrValueModels) would be nice.
2353
+ this.activeInteractionContextIds = chain(new pectin.MutableListModel())
2354
+ .append(this._activeInlineInteractionContextModel)
2355
+ .append(this._activeModalInteractionContextModel)
2356
+ .rejectNil()
2357
+ .pluck('id');
2358
+ }
2359
+ /**
2360
+ * @return {?}
2361
+ */
2362
+ InteractionService.prototype.isActive = /**
2363
+ * @return {?}
2364
+ */
2365
+ function () {
2366
+ return this.active.value;
2367
+ };
2368
+ /**
2369
+ * @param {?} disposable
2370
+ * @return {?}
2371
+ */
2372
+ InteractionService.prototype.createModalInteractionContextFor = /**
2373
+ * @param {?} disposable
2374
+ * @return {?}
2375
+ */
2376
+ function (disposable) {
2377
+ /** @type {?} */
2378
+ var context = this.modelInteractionContextFactory.createInteractionContext();
2379
+ disposable.registerDisposable(new InteractionService.Monitor('modal', context, this._activeModalInteractionContextModel, this.exclusiveContext));
2380
+ return context;
2381
+ };
2382
+ /**
2383
+ * @param {?} interactionContext
2384
+ * @return {?}
2385
+ */
2386
+ InteractionService.prototype._registerInplaceInteractionContext = /**
2387
+ * @param {?} interactionContext
2388
+ * @return {?}
2389
+ */
2390
+ function (interactionContext) {
2391
+ interactionContext.registerDisposable(new InteractionService.Monitor("ip" + ++inplaceMonitorCount, interactionContext, this._activeInlineInteractionContextModel, this.exclusiveContext));
2392
+ };
2393
+ /**
2394
+ * @return {?}
2395
+ */
2396
+ InteractionService.prototype.getCurrentActivity = /**
2397
+ * @return {?}
2398
+ */
2399
+ function () {
2400
+ return __awaiter(this, void 0, void 0, function () {
2401
+ return __generator(this, function (_a) {
2402
+ typescriptUtilities.assert.isTruthy(this.isActive());
2403
+ return [2 /*return*/, this._activeInteractionContext.value.getCurrentActivity()];
2404
+ });
2405
+ });
2406
+ };
2407
+ /**
2408
+ * Creates an interaction context that will prevent any other contexts from starting an
2409
+ * activity until it is disposed. This is intended for use by the router for passing
2410
+ * to PlaceComponent.canDeactivate(interactionContext). This ensures components don't
2411
+ * try and interact in a way that we can't track and synchronise with the browser back
2412
+ * button.
2413
+ */
2414
+ /**
2415
+ * Creates an interaction context that will prevent any other contexts from starting an
2416
+ * activity until it is disposed. This is intended for use by the router for passing
2417
+ * to PlaceComponent.canDeactivate(interactionContext). This ensures components don't
2418
+ * try and interact in a way that we can't track and synchronise with the browser back
2419
+ * button.
2420
+ * @return {?}
2421
+ */
2422
+ InteractionService.prototype._createExclusiveModalInteractionContext = /**
2423
+ * Creates an interaction context that will prevent any other contexts from starting an
2424
+ * activity until it is disposed. This is intended for use by the router for passing
2425
+ * to PlaceComponent.canDeactivate(interactionContext). This ensures components don't
2426
+ * try and interact in a way that we can't track and synchronise with the browser back
2427
+ * button.
2428
+ * @return {?}
2429
+ */
2430
+ function () {
2431
+ this.exclusiveContext.value = this.modelInteractionContextFactory.createInteractionContext();
2432
+ /** @type {?} */
2433
+ var self = this;
2434
+ this.exclusiveContext.value.registerDisposable({
2435
+ dispose: /**
2436
+ * @return {?}
2437
+ */
2438
+ function () {
2439
+ self.exclusiveContext.value = null;
2440
+ }
2441
+ });
2442
+ return this.exclusiveContext.value;
2443
+ };
2444
+ InteractionService.decorators = [
2445
+ { type: core.Injectable, args: [{
2446
+ providedIn: 'root'
2447
+ },] }
2448
+ ];
2449
+ /** @nocollapse */
2450
+ InteractionService.ctorParameters = function () { return [
2451
+ { type: ModalInteractionContextFactory }
2452
+ ]; };
2453
+ /** @nocollapse */ InteractionService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function InteractionService_Factory() { return new InteractionService(core.ɵɵinject(ModalInteractionContextFactory)); }, token: InteractionService, providedIn: "root" });
2454
+ return InteractionService;
2455
+ }());
2456
+ if (false) {
2457
+ /**
2458
+ * @type {?}
2459
+ * @private
2460
+ */
2461
+ exports.ɵv.prototype.garbage;
2462
+ /** @type {?} */
2463
+ exports.ɵv.prototype.active;
2464
+ /**
2465
+ * @type {?}
2466
+ * @private
2467
+ */
2468
+ exports.ɵv.prototype.exclusiveContext;
2469
+ /**
2470
+ * @type {?}
2471
+ * @private
2472
+ */
2473
+ exports.ɵv.prototype._activeModalInteractionContextModel;
2474
+ /**
2475
+ * @type {?}
2476
+ * @private
2477
+ */
2478
+ exports.ɵv.prototype._activeInlineInteractionContextModel;
2479
+ /**
2480
+ * @type {?}
2481
+ * @private
2482
+ */
2483
+ exports.ɵv.prototype._activeInteractionContext;
2484
+ /** @type {?} */
2485
+ exports.ɵv.prototype.activeInteractionContextIds;
2486
+ /** @type {?} */
2487
+ exports.ɵv.prototype.modelInteractionActive;
2488
+ /** @type {?} */
2489
+ exports.ɵv.prototype.inlineInteractionActive;
2490
+ /** @type {?} */
2491
+ exports.ɵv.prototype.modelInteractionContextFactory;
2492
+ }
2493
+ (function (InteractionService) {
2494
+ /**
2495
+ * @record
2496
+ */
2497
+ function Callback() { }
2498
+ InteractionService.Callback = Callback;
2499
+ if (false) {
2500
+ /**
2501
+ * @param {?} monitor
2502
+ * @return {?}
2503
+ */
2504
+ Callback.prototype.onStarted = function (monitor) { };
2505
+ /**
2506
+ * @param {?} monitor
2507
+ * @return {?}
2508
+ */
2509
+ Callback.prototype.onFinished = function (monitor) { };
2510
+ }
2511
+ var Monitor = /** @class */ (function (_super) {
2512
+ __extends(Monitor, _super);
2513
+ function Monitor(id, interactionContext, currentActiveMonitor, exclusiveContext) {
2514
+ var _this = _super.call(this) || this;
2515
+ _this.id = id;
2516
+ _this.interactionContext = interactionContext;
2517
+ _this.currentActiveMonitor = currentActiveMonitor;
2518
+ _this.exclusiveContext = exclusiveContext;
2519
+ var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2520
+ when.valueOf(interactionContext.active).becomesTruthy((/**
2521
+ * @return {?}
2522
+ */
2523
+ function () { return _this.onStarted(); }));
2524
+ when.valueOf(interactionContext.active).becomesFalsey((/**
2525
+ * @return {?}
2526
+ */
2527
+ function () { return _this.onFinished(); }));
2528
+ interactionContext.registerDisposable(_this);
2529
+ return _this;
2530
+ }
2531
+ /**
2532
+ * @protected
2533
+ * @return {?}
2534
+ */
2535
+ Monitor.prototype.onStarted = /**
2536
+ * @protected
2537
+ * @return {?}
2538
+ */
2539
+ function () {
2540
+ this.assertCanStart();
2541
+ this.currentActiveMonitor.value = this;
2542
+ };
2543
+ /**
2544
+ * @private
2545
+ * @return {?}
2546
+ */
2547
+ Monitor.prototype.assertCanStart = /**
2548
+ * @private
2549
+ * @return {?}
2550
+ */
2551
+ function () {
2552
+ typescriptUtilities.assert.isFalsey(this.currentActiveMonitor.value);
2553
+ if (this.exclusiveContext.value && this.interactionContext !== this.exclusiveContext.value) {
2554
+ pectin.lang.illegalState('Interaction started while exclusive lock active. This is usually because you using a different context during place.canDeactivate(interactionContext)');
2555
+ }
2556
+ };
2557
+ /**
2558
+ * @protected
2559
+ * @return {?}
2560
+ */
2561
+ Monitor.prototype.onFinished = /**
2562
+ * @protected
2563
+ * @return {?}
2564
+ */
2565
+ function () {
2566
+ this.assertCurrentlyActive();
2567
+ this.currentActiveMonitor.value = null;
2568
+ };
2569
+ /**
2570
+ * @private
2571
+ * @return {?}
2572
+ */
2573
+ Monitor.prototype.assertCurrentlyActive = /**
2574
+ * @private
2575
+ * @return {?}
2576
+ */
2577
+ function () {
2578
+ typescriptUtilities.assert.isTruthy(this.currentActiveMonitor.value === this);
2579
+ };
2580
+ return Monitor;
2581
+ }(pectin.GarbageCollector));
2582
+ InteractionService.Monitor = Monitor;
2583
+ if (false) {
2584
+ /** @type {?} */
2585
+ Monitor.prototype.id;
2586
+ /** @type {?} */
2587
+ Monitor.prototype.interactionContext;
2588
+ /** @type {?} */
2589
+ Monitor.prototype.currentActiveMonitor;
2590
+ /** @type {?} */
2591
+ Monitor.prototype.exclusiveContext;
2592
+ }
2593
+ })(exports.ɵv || (exports.ɵv = {}));
2594
+
2353
2595
  /**
2354
2596
  * @fileoverview added by tsickle
2355
2597
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -2359,9 +2601,11 @@
2359
2601
  */
2360
2602
  var InplaceInteractionContextComponent = /** @class */ (function (_super) {
2361
2603
  __extends(InplaceInteractionContextComponent, _super);
2362
- function InplaceInteractionContextComponent() {
2604
+ function InplaceInteractionContextComponent(interactionService) {
2363
2605
  var _this = _super.call(this) || this;
2606
+ _this.interactionService = interactionService;
2364
2607
  _this._active = new pectin.MutableValueModel(false);
2608
+ _this.interactionService._registerInplaceInteractionContext(_this);
2365
2609
  return _this;
2366
2610
  }
2367
2611
  /**
@@ -2438,7 +2682,9 @@
2438
2682
  }] }
2439
2683
  ];
2440
2684
  /** @nocollapse */
2441
- InplaceInteractionContextComponent.ctorParameters = function () { return []; };
2685
+ InplaceInteractionContextComponent.ctorParameters = function () { return [
2686
+ { type: exports.ɵv }
2687
+ ]; };
2442
2688
  InplaceInteractionContextComponent.propDecorators = {
2443
2689
  interactionContext: [{ type: core.ViewChild, args: ['activityContainer', { static: true },] }]
2444
2690
  };
@@ -2454,6 +2700,8 @@
2454
2700
  * @private
2455
2701
  */
2456
2702
  InplaceInteractionContextComponent.prototype._active;
2703
+ /** @type {?} */
2704
+ InplaceInteractionContextComponent.prototype.interactionService;
2457
2705
  }
2458
2706
 
2459
2707
  /**
@@ -2479,500 +2727,8 @@
2479
2727
  * @fileoverview added by tsickle
2480
2728
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2481
2729
  */
2482
- var DialogInteractionContext = /** @class */ (function (_super) {
2483
- __extends(DialogInteractionContext, _super);
2484
- function DialogInteractionContext(dialogService, config) {
2485
- var _this = _super.call(this) || this;
2486
- _this.dialogService = dialogService;
2487
- _this.config = config;
2488
- _this._activeModel = new pectin.MutableValueModel(false);
2489
- typescriptUtilities.assert.notNil(dialogService);
2490
- _this.onDispose((/**
2491
- * @return {?}
2492
- */
2493
- function () {
2494
- if (_this.isActive()) {
2495
- pectin.lang.illegalState('Dispose called while active.');
2496
- }
2497
- }));
2498
- return _this;
2499
- }
2500
- Object.defineProperty(DialogInteractionContext.prototype, "active", {
2501
- get: /**
2502
- * @return {?}
2503
- */
2504
- function () {
2505
- return this._activeModel.readonly;
2506
- },
2507
- enumerable: true,
2508
- configurable: true
2509
- });
2510
- /**
2511
- * @protected
2512
- * @template D, R, E
2513
- * @param {?} activityType
2514
- * @param {?} data
2515
- * @param {?=} disableClose
2516
- * @return {?}
2517
- */
2518
- DialogInteractionContext.prototype._startActivity = /**
2519
- * @protected
2520
- * @template D, R, E
2521
- * @param {?} activityType
2522
- * @param {?} data
2523
- * @param {?=} disableClose
2524
- * @return {?}
2525
- */
2526
- function (activityType, data, disableClose) {
2527
- var _this = this;
2528
- if (disableClose === void 0) { disableClose = true; }
2529
- if (this.isActive()) {
2530
- pectin.lang.illegalState("Activity already in progress: " + this.activityList.value.map((/**
2531
- * @param {?} a
2532
- * @return {?}
2533
- */
2534
- function (a) { return a.constructor.name; })).join(', '));
2535
- }
2536
- this._activeModel.value = true;
2537
- this.notifyActivityStarted();
2538
- /** @type {?} */
2539
- var config = __assign({}, this.config, {
2540
- data: data,
2541
- disableClose: disableClose,
2542
- panelClass: 'dialog-interaction-service'
2543
- });
2544
- /** @type {?} */
2545
- var self = this;
2546
- /** @type {?} */
2547
- var matDialogRef = (/** @type {?} */ (this.dialogService.open(ActivityContainerComponent, config)));
2548
- return new Promise((/**
2549
- * @param {?} resolve
2550
- * @param {?} reject
2551
- * @return {?}
2552
- */
2553
- function (resolve, reject) {
2554
- /** @type {?} */
2555
- var activityContainer = matDialogRef.componentInstance;
2556
- self.safelyUpdateActivityListDelegate(activityContainer.activityList);
2557
- activityContainer.initialActivityOutletContext = {
2558
- activityClass: activityType,
2559
- activityData: data,
2560
- onDone: /**
2561
- * @param {?} result
2562
- * @return {?}
2563
- */
2564
- function (result) {
2565
- resolve(result);
2566
- matDialogRef.close(true); // return true to let the after close listener know we've already handled it.
2567
- },
2568
- onCancel: /**
2569
- * @param {?} error
2570
- * @return {?}
2571
- */
2572
- function (error) {
2573
- reject(error);
2574
- matDialogRef.close(true); // return true to let the after close listener know we've already handled it.
2575
- }
2576
- };
2577
- // we need to check if our onDone/onCancel methods above we called or if we were
2578
- // closed by the user clicking the backdrop. If the later then we need to reject
2579
- // our promise.
2580
- matDialogRef.afterClosed().subscribe((/**
2581
- * @param {?} promiseAlreadyFinished
2582
- * @return {?}
2583
- */
2584
- function (promiseAlreadyFinished) {
2585
- if (!promiseAlreadyFinished) {
2586
- reject('auto-closed');
2587
- }
2588
- }));
2589
- matDialogRef.updateSize();
2590
- matDialogRef.afterOpened().subscribe((/**
2591
- * @param {?} promiseAlreadyFinished
2592
- * @return {?}
2593
- */
2594
- function (promiseAlreadyFinished) {
2595
- matDialogRef.updateSize();
2596
- }));
2597
- })).finally((/**
2598
- * @return {?}
2599
- */
2600
- function () {
2601
- _this._activeModel.value = false;
2602
- _this.notifyActivityFinished();
2603
- self.safelyUpdateActivityListDelegate(null);
2604
- }));
2605
- };
2606
- /**
2607
- * Updates teh delegate on the next tick to avoid modifying state during the current change detection cycle.
2608
- * @param delegate
2609
- */
2610
- /**
2611
- * Updates teh delegate on the next tick to avoid modifying state during the current change detection cycle.
2612
- * @param {?} delegate
2613
- * @return {?}
2614
- */
2615
- DialogInteractionContext.prototype.safelyUpdateActivityListDelegate = /**
2616
- * Updates teh delegate on the next tick to avoid modifying state during the current change detection cycle.
2617
- * @param {?} delegate
2618
- * @return {?}
2619
- */
2620
- function (delegate) {
2621
- var _this = this;
2622
- setTimeout((/**
2623
- * @return {?}
2624
- */
2625
- function () { return _this.setActivityList(delegate); }));
2626
- };
2627
- DialogInteractionContext.decorators = [
2628
- { type: core.Injectable, args: [{
2629
- providedIn: 'root'
2630
- },] }
2631
- ];
2632
- /** @nocollapse */
2633
- DialogInteractionContext.ctorParameters = function () { return [
2634
- { type: material.MatDialog },
2635
- { type: dialog.MatDialogConfig }
2636
- ]; };
2637
- /** @nocollapse */ DialogInteractionContext.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function DialogInteractionContext_Factory() { return new DialogInteractionContext(core.ɵɵinject(dialog.MatDialog), core.ɵɵinject(dialog.MatDialogConfig)); }, token: DialogInteractionContext, providedIn: "root" });
2638
- return DialogInteractionContext;
2639
- }(InteractionContextBase));
2640
- if (false) {
2641
- /**
2642
- * @type {?}
2643
- * @private
2644
- */
2645
- DialogInteractionContext.prototype._activeModel;
2646
- /**
2647
- * @type {?}
2648
- * @private
2649
- */
2650
- DialogInteractionContext.prototype.dialogService;
2651
- /** @type {?} */
2652
- DialogInteractionContext.prototype.config;
2653
- }
2654
-
2655
- /**
2656
- * @fileoverview added by tsickle
2657
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2658
- */
2659
- var Guard = /** @class */ (function (_super) {
2660
- __extends(Guard, _super);
2661
- function Guard() {
2662
- return _super.call(this, { initialValue: false }) || this;
2663
- }
2664
- Object.defineProperty(Guard.prototype, "value", {
2665
- get: /**
2666
- * @return {?}
2667
- */
2668
- function () {
2669
- return this.store.read();
2670
- },
2671
- enumerable: true,
2672
- configurable: true
2673
- });
2674
- /**
2675
- * @template R
2676
- * @param {?} fun
2677
- * @return {?}
2678
- */
2679
- Guard.prototype.whileTrue = /**
2680
- * @template R
2681
- * @param {?} fun
2682
- * @return {?}
2683
- */
2684
- function (fun) {
2685
- this.startTransaction().commit(true);
2686
- try {
2687
- return fun();
2688
- }
2689
- finally {
2690
- this.startTransaction().commit(false);
2691
- }
2692
- };
2693
- /**
2694
- * @template R
2695
- * @param {?} fun
2696
- * @param {?=} defaultValue
2697
- * @return {?}
2698
- */
2699
- Guard.prototype.runIfFalse = /**
2700
- * @template R
2701
- * @param {?} fun
2702
- * @param {?=} defaultValue
2703
- * @return {?}
2704
- */
2705
- function (fun, defaultValue) {
2706
- if (defaultValue === void 0) { defaultValue = null; }
2707
- return !this.value ? fun() : defaultValue;
2708
- };
2709
- return Guard;
2710
- }(pectin.ValueModel));
2711
- /**
2712
- * @abstract
2713
- */
2714
- var /**
2715
- * @abstract
2716
- */
2717
- ModalInteractionService = /** @class */ (function (_super) {
2718
- __extends(ModalInteractionService, _super);
2719
- function ModalInteractionService() {
2720
- var _this = _super.call(this) || this;
2721
- _this._activityListeners = new pectin.EventListenerList();
2722
- return _this;
2723
- }
2724
- /**
2725
- * @return {?}
2726
- */
2727
- ModalInteractionService.prototype.isActive = /**
2728
- * @return {?}
2729
- */
2730
- function () {
2731
- return this.active.value;
2732
- };
2733
- /**
2734
- * @param {?} listener
2735
- * @return {?}
2736
- */
2737
- ModalInteractionService.prototype.addActivityListener = /**
2738
- * @param {?} listener
2739
- * @return {?}
2740
- */
2741
- function (listener) {
2742
- return this._activityListeners.add(listener);
2743
- };
2744
- /**
2745
- * @protected
2746
- * @return {?}
2747
- */
2748
- ModalInteractionService.prototype.notifyActivityStarted = /**
2749
- * @protected
2750
- * @return {?}
2751
- */
2752
- function () {
2753
- this._activityListeners.fire((/**
2754
- * @param {?} l
2755
- * @return {?}
2756
- */
2757
- function (l) { return l.onActivityStarted(); }));
2758
- };
2759
- /**
2760
- * @protected
2761
- * @return {?}
2762
- */
2763
- ModalInteractionService.prototype.notifyActivityFinished = /**
2764
- * @protected
2765
- * @return {?}
2766
- */
2767
- function () {
2768
- this._activityListeners.fire((/**
2769
- * @param {?} l
2770
- * @return {?}
2771
- */
2772
- function (l) { return l.onActivityFinished(); }));
2773
- };
2774
- return ModalInteractionService;
2775
- }(pectin.GarbageCollector));
2776
- if (false) {
2777
- /**
2778
- * @type {?}
2779
- * @private
2780
- */
2781
- ModalInteractionService.prototype._activityListeners;
2782
- /** @type {?} */
2783
- ModalInteractionService.prototype.active;
2784
- /**
2785
- * @abstract
2786
- * @param {?} disposable
2787
- * @return {?}
2788
- */
2789
- ModalInteractionService.prototype.createInteractionContextFor = function (disposable) { };
2790
- /**
2791
- * @abstract
2792
- * @return {?}
2793
- */
2794
- ModalInteractionService.prototype.createExclusiveInteractionContext = function () { };
2795
- /**
2796
- * @abstract
2797
- * @return {?}
2798
- */
2799
- ModalInteractionService.prototype.getCurrentActivity = function () { };
2800
- }
2801
-
2802
- /**
2803
- * @fileoverview added by tsickle
2804
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2805
- */
2806
- /** @type {?} */
2807
- var DIALOG_INTERACTION_SERVICE_DEFAULTS = new core.InjectionToken('DIALOG_INTERACTION_SERVICE_DEFAULTS');
2808
- var DialogInteractionService = /** @class */ (function (_super) {
2809
- __extends(DialogInteractionService, _super);
2810
- function DialogInteractionService(dialogService, dialogServiceDefaults, matDialogDefaultConfig) {
2811
- var _this = _super.call(this) || this;
2812
- _this.dialogService = dialogService;
2813
- _this.dialogServiceDefaults = dialogServiceDefaults;
2814
- _this.matDialogDefaultConfig = matDialogDefaultConfig;
2815
- _this._activeInteractionContextModel = new pectin.MutableValueModel();
2816
- typescriptUtilities.assert.notNil(dialogService);
2817
- var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2818
- _this.active = chain(_this._activeInteractionContextModel).isNotNil();
2819
- return _this;
2820
- }
2821
- /**
2822
- * @param {?} disposable
2823
- * @return {?}
2824
- */
2825
- DialogInteractionService.prototype.createInteractionContextFor = /**
2826
- * @param {?} disposable
2827
- * @return {?}
2828
- */
2829
- function (disposable) {
2830
- return disposable.registerDisposable(this._createInteractionContext());
2831
- };
2832
- /**
2833
- * @return {?}
2834
- */
2835
- DialogInteractionService.prototype._createInteractionContext = /**
2836
- * @return {?}
2837
- */
2838
- function () {
2839
- /** @type {?} */
2840
- var config = __assign({ autoFocus: false, hasBackdrop: true, closeOnNavigation: false }, this.matDialogDefaultConfig, this.dialogServiceDefaults);
2841
- /** @type {?} */
2842
- var self = this;
2843
- /** @type {?} */
2844
- var dialogInteractionContext = new DialogInteractionContext(this.dialogService, config);
2845
- dialogInteractionContext.registerDisposable(dialogInteractionContext.addActivityListener({
2846
- onActivityStarted: /**
2847
- * @return {?}
2848
- */
2849
- function () {
2850
- self.onActivityStarted(dialogInteractionContext);
2851
- },
2852
- onActivityFinished: /**
2853
- * @return {?}
2854
- */
2855
- function () {
2856
- self.onActivityFinished(dialogInteractionContext);
2857
- }
2858
- }));
2859
- return dialogInteractionContext;
2860
- };
2861
- /**
2862
- * @return {?}
2863
- */
2864
- DialogInteractionService.prototype.createExclusiveInteractionContext = /**
2865
- * @return {?}
2866
- */
2867
- function () {
2868
- this.exclusiveContext = this._createInteractionContext();
2869
- /** @type {?} */
2870
- var self = this;
2871
- this.exclusiveContext.registerDisposable({
2872
- dispose: /**
2873
- * @return {?}
2874
- */
2875
- function () {
2876
- self.exclusiveContext = null;
2877
- }
2878
- });
2879
- return this.exclusiveContext;
2880
- };
2881
- // @Trace()
2882
- // @Trace()
2883
- /**
2884
- * @param {?} dialogInteractionContext
2885
- * @return {?}
2886
- */
2887
- DialogInteractionService.prototype.onActivityStarted =
2888
- // @Trace()
2889
- /**
2890
- * @param {?} dialogInteractionContext
2891
- * @return {?}
2892
- */
2893
- function (dialogInteractionContext) {
2894
- typescriptUtilities.assert.isFalsey(this.isActive());
2895
- if (this.exclusiveContext && dialogInteractionContext !== this.exclusiveContext) {
2896
- pectin.lang.illegalState("Interaction started while exclusive lock active. This is usually because you using a different context during place.canDeactivate(interactionContext)");
2897
- }
2898
- this._activeInteractionContextModel.value = dialogInteractionContext;
2899
- this.notifyActivityStarted();
2900
- };
2901
- // @Trace()
2902
- // @Trace()
2903
- /**
2904
- * @param {?} dialogInteractionContext
2905
- * @return {?}
2906
- */
2907
- DialogInteractionService.prototype.onActivityFinished =
2908
- // @Trace()
2909
- /**
2910
- * @param {?} dialogInteractionContext
2911
- * @return {?}
2912
- */
2913
- function (dialogInteractionContext) {
2914
- typescriptUtilities.assert.isTruthy(this._activeInteractionContextModel.value === dialogInteractionContext);
2915
- this._activeInteractionContextModel.value = null;
2916
- this.notifyActivityFinished();
2917
- };
2918
- /**
2919
- * @return {?}
2920
- */
2921
- DialogInteractionService.prototype.getCurrentActivity = /**
2922
- * @return {?}
2923
- */
2924
- function () {
2925
- return __awaiter(this, void 0, void 0, function () {
2926
- return __generator(this, function (_a) {
2927
- typescriptUtilities.assert.isTruthy(this.isActive());
2928
- return [2 /*return*/, this._activeInteractionContextModel.value.getCurrentActivity()];
2929
- });
2930
- });
2931
- };
2932
- DialogInteractionService.decorators = [
2933
- { type: core.Injectable, args: [{
2934
- providedIn: 'root'
2935
- },] }
2936
- ];
2937
- /** @nocollapse */
2938
- DialogInteractionService.ctorParameters = function () { return [
2939
- { type: material.MatDialog },
2940
- { type: dialog.MatDialogConfig, decorators: [{ type: core.Optional }, { type: core.Inject, args: [DIALOG_INTERACTION_SERVICE_DEFAULTS,] }] },
2941
- { type: dialog.MatDialogConfig, decorators: [{ type: core.Optional }, { type: core.Inject, args: [dialog.MAT_DIALOG_DEFAULT_OPTIONS,] }] }
2942
- ]; };
2943
- /** @nocollapse */ DialogInteractionService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function DialogInteractionService_Factory() { return new DialogInteractionService(core.ɵɵinject(dialog.MatDialog), core.ɵɵinject(DIALOG_INTERACTION_SERVICE_DEFAULTS, 8), core.ɵɵinject(dialog.MAT_DIALOG_DEFAULT_OPTIONS, 8)); }, token: DialogInteractionService, providedIn: "root" });
2944
- return DialogInteractionService;
2945
- }(ModalInteractionService));
2946
- if (false) {
2947
- /**
2948
- * @type {?}
2949
- * @private
2950
- */
2951
- DialogInteractionService.prototype._activeInteractionContextModel;
2952
- /** @type {?} */
2953
- DialogInteractionService.prototype.active;
2954
- /**
2955
- * @type {?}
2956
- * @private
2957
- */
2958
- DialogInteractionService.prototype.exclusiveContext;
2959
- /**
2960
- * @type {?}
2961
- * @private
2962
- */
2963
- DialogInteractionService.prototype.dialogService;
2964
- /** @type {?} */
2965
- DialogInteractionService.prototype.dialogServiceDefaults;
2966
- /** @type {?} */
2967
- DialogInteractionService.prototype.matDialogDefaultConfig;
2968
- }
2969
-
2970
- /**
2971
- * @fileoverview added by tsickle
2972
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2973
- */
2974
- var InteractionModule = /** @class */ (function () {
2975
- function InteractionModule() {
2730
+ var InteractionModule = /** @class */ (function () {
2731
+ function InteractionModule() {
2976
2732
  }
2977
2733
  InteractionModule.decorators = [
2978
2734
  { type: core.NgModule, args: [{
@@ -2987,7 +2743,7 @@
2987
2743
  declarations: [
2988
2744
  ActivityContainerComponent,
2989
2745
  ConfirmationDialogComponent,
2990
- exports.ɵbj,
2746
+ exports.ɵbk,
2991
2747
  AlertDialogComponent,
2992
2748
  ActivityOutletComponent,
2993
2749
  InteractionOutletComponent,
@@ -3002,11 +2758,11 @@
3002
2758
  entryComponents: [
3003
2759
  ActivityContainerComponent,
3004
2760
  ConfirmationDialogComponent,
3005
- exports.ɵbj,
2761
+ exports.ɵbk,
3006
2762
  AlertDialogComponent
3007
2763
  ],
3008
2764
  providers: [
3009
- DialogInteractionService,
2765
+ exports.ɵv,
3010
2766
  ]
3011
2767
  },] }
3012
2768
  ];
@@ -4082,6 +3838,9 @@
4082
3838
  */
4083
3839
  /**
4084
3840
  * @abstract
3841
+ */
3842
+ /**
3843
+ * @abstract
4085
3844
  */
4086
3845
  exports.NavigationState = /** @class */ (function (_super) {
4087
3846
  __extends(NavigationState, _super);
@@ -4091,6 +3850,36 @@
4091
3850
  _this._visits = new Map();
4092
3851
  return _this;
4093
3852
  }
3853
+ Object.defineProperty(NavigationState.prototype, "idle", {
3854
+ get: /**
3855
+ * @return {?}
3856
+ */
3857
+ function () {
3858
+ return !this.isTransitional;
3859
+ },
3860
+ enumerable: true,
3861
+ configurable: true
3862
+ });
3863
+ Object.defineProperty(NavigationState.prototype, "placeRouter", {
3864
+ get: /**
3865
+ * @return {?}
3866
+ */
3867
+ function () {
3868
+ return this.context.placeRouter;
3869
+ },
3870
+ enumerable: true,
3871
+ configurable: true
3872
+ });
3873
+ Object.defineProperty(NavigationState.prototype, "interactionService", {
3874
+ get: /**
3875
+ * @return {?}
3876
+ */
3877
+ function () {
3878
+ return this.context.interactionService;
3879
+ },
3880
+ enumerable: true,
3881
+ configurable: true
3882
+ });
4094
3883
  Object.defineProperty(NavigationState.prototype, "interactionContext", {
4095
3884
  get: /**
4096
3885
  * @return {?}
@@ -4123,6 +3912,61 @@
4123
3912
  function (placeDef) {
4124
3913
  return this._visits.get(placeDef);
4125
3914
  };
3915
+ /**
3916
+ * @param {?} event
3917
+ * @return {?}
3918
+ */
3919
+ NavigationState.prototype.onPopState = /**
3920
+ * @param {?} event
3921
+ * @return {?}
3922
+ */
3923
+ function (event) {
3924
+ return this.illegalTransition(event);
3925
+ };
3926
+ /**
3927
+ * @param {?} event
3928
+ * @return {?}
3929
+ */
3930
+ NavigationState.prototype.onStart = /**
3931
+ * @param {?} event
3932
+ * @return {?}
3933
+ */
3934
+ function (event) {
3935
+ return this.illegalTransition(event);
3936
+ };
3937
+ /**
3938
+ * @param {?} event
3939
+ * @return {?}
3940
+ */
3941
+ NavigationState.prototype.onCancel = /**
3942
+ * @param {?} event
3943
+ * @return {?}
3944
+ */
3945
+ function (event) {
3946
+ return this.illegalTransition(event);
3947
+ };
3948
+ /**
3949
+ * @param {?} event
3950
+ * @return {?}
3951
+ */
3952
+ NavigationState.prototype.onError = /**
3953
+ * @param {?} event
3954
+ * @return {?}
3955
+ */
3956
+ function (event) {
3957
+ return this.illegalTransition(event);
3958
+ };
3959
+ /**
3960
+ * @param {?} event
3961
+ * @return {?}
3962
+ */
3963
+ NavigationState.prototype.onEnd = /**
3964
+ * @param {?} event
3965
+ * @return {?}
3966
+ */
3967
+ function (event) {
3968
+ return this.illegalTransition(event);
3969
+ };
4126
3970
  /**
4127
3971
  * @param {?} newUrl
4128
3972
  * @return {?}
@@ -4134,6 +3978,23 @@
4134
3978
  function (newUrl) {
4135
3979
  return this.illegalTransition('onBackClickedDuringNavigationInteraction');
4136
3980
  };
3981
+ /**
3982
+ * @param {?} component
3983
+ * @param {?} nextState
3984
+ * @return {?}
3985
+ */
3986
+ NavigationState.prototype.canDeactivatePlace = /**
3987
+ * @param {?} component
3988
+ * @param {?} nextState
3989
+ * @return {?}
3990
+ */
3991
+ function (component, nextState) {
3992
+ return __awaiter(this, void 0, void 0, function () {
3993
+ return __generator(this, function (_a) {
3994
+ return [2 /*return*/, this.illegalTransition('canDeactivatePlace')];
3995
+ });
3996
+ });
3997
+ };
4137
3998
  /**
4138
3999
  * @return {?}
4139
4000
  */
@@ -4167,34 +4028,41 @@
4167
4028
  * @return {?}
4168
4029
  */
4169
4030
  function () {
4170
- return this.context.router.routerState ? this.context.router.routerState.snapshot.url : null;
4031
+ return this.placeRouter.getCurrentRouterUrl();
4171
4032
  };
4172
4033
  /**
4173
4034
  * @protected
4174
4035
  * @param {?} event
4175
4036
  * @return {?}
4176
4037
  */
4177
- NavigationState.prototype.createActiveSession = /**
4038
+ NavigationState.prototype.createTransitionStateFor = /**
4178
4039
  * @protected
4179
4040
  * @param {?} event
4180
4041
  * @return {?}
4181
4042
  */
4182
4043
  function (event) {
4183
4044
  // TODO: check if the event is purely for interaction context changes.
4184
- return new NavigationState.Active(this.context, event.navigationTrigger === 'popstate', this.currentRouterUrl());
4045
+ /** @type {?} */
4046
+ var popstate = event.navigationTrigger === 'popstate';
4047
+ return popstate ?
4048
+ new NavigationState.NavigationBackTransition(this.context, popstate, this.currentRouterUrl()) :
4049
+ new NavigationState.NavigationTransition(this.context, popstate, this.currentRouterUrl());
4185
4050
  };
4186
4051
  /**
4187
- * @protected
4188
4052
  * @param {?} url
4189
4053
  * @return {?}
4190
4054
  */
4191
- NavigationState.prototype.updateLocation = /**
4192
- * @protected
4055
+ NavigationState.prototype.resetBrowserLocation = /**
4193
4056
  * @param {?} url
4194
4057
  * @return {?}
4195
4058
  */
4196
4059
  function (url) {
4197
- this.context.angularLocation.go(url);
4060
+ var _this = this;
4061
+ // TODO: Should this be a navigate operation to avoid confusing the router...??
4062
+ setTimeout((/**
4063
+ * @return {?}
4064
+ */
4065
+ function () { return _this.placeRouter.resetBrowserLocation(url); }));
4198
4066
  };
4199
4067
  /**
4200
4068
  * @return {?}
@@ -4205,12 +4073,6 @@
4205
4073
  function () {
4206
4074
  return this.constructor.name;
4207
4075
  };
4208
- __decorate([
4209
- pectin.Trace(),
4210
- __metadata("design:type", Function),
4211
- __metadata("design:paramtypes", [Object]),
4212
- __metadata("design:returntype", void 0)
4213
- ], NavigationState.prototype, "updateLocation", null);
4214
4076
  return NavigationState;
4215
4077
  }(pectin.GarbageCollector));
4216
4078
  if (false) {
@@ -4220,54 +4082,22 @@
4220
4082
  */
4221
4083
  exports.NavigationState.prototype._visits;
4222
4084
  /** @type {?} */
4223
- exports.NavigationState.prototype.isPopState;
4224
- /** @type {?} */
4225
- exports.NavigationState.prototype.active;
4085
+ exports.NavigationState.prototype.isTransitional;
4226
4086
  /** @type {?} */
4227
4087
  exports.NavigationState.prototype.startingUrl;
4088
+ /** @type {?} */
4089
+ exports.NavigationState.prototype.isPopState;
4228
4090
  /**
4229
4091
  * @type {?}
4230
4092
  * @protected
4231
4093
  */
4232
4094
  exports.NavigationState.prototype.context;
4233
- /**
4234
- * @abstract
4235
- * @param {?} event
4236
- * @return {?}
4237
- */
4238
- exports.NavigationState.prototype.onStart = function (event) { };
4239
- /**
4240
- * @abstract
4241
- * @param {?} event
4242
- * @return {?}
4243
- */
4244
- exports.NavigationState.prototype.onCancel = function (event) { };
4245
- /**
4246
- * @abstract
4247
- * @param {?} event
4248
- * @return {?}
4249
- */
4250
- exports.NavigationState.prototype.onError = function (event) { };
4251
- /**
4252
- * @abstract
4253
- * @param {?} event
4254
- * @return {?}
4255
- */
4256
- exports.NavigationState.prototype.onEnd = function (event) { };
4257
- /**
4258
- * @abstract
4259
- * @param {?} component
4260
- * @param {?} nextState
4261
- * @return {?}
4262
- */
4263
- exports.NavigationState.prototype.canDeactivatePlace = function (component, nextState) { };
4264
4095
  }
4265
4096
  (function (NavigationState) {
4266
4097
  var Context = /** @class */ (function () {
4267
- function Context(router, modalInteractionService, angularLocation, notifySuccess) {
4268
- this.router = router;
4269
- this.modalInteractionService = modalInteractionService;
4270
- this.angularLocation = angularLocation;
4098
+ function Context(placeRouter, interactionService, notifySuccess) {
4099
+ this.placeRouter = placeRouter;
4100
+ this.interactionService = interactionService;
4271
4101
  this.notifySuccess = notifySuccess;
4272
4102
  }
4273
4103
  return Context;
@@ -4275,11 +4105,9 @@
4275
4105
  NavigationState.Context = Context;
4276
4106
  if (false) {
4277
4107
  /** @type {?} */
4278
- Context.prototype.router;
4108
+ Context.prototype.placeRouter;
4279
4109
  /** @type {?} */
4280
- Context.prototype.modalInteractionService;
4281
- /** @type {?} */
4282
- Context.prototype.angularLocation;
4110
+ Context.prototype.interactionService;
4283
4111
  /** @type {?} */
4284
4112
  Context.prototype.notifySuccess;
4285
4113
  }
@@ -4287,27 +4115,11 @@
4287
4115
  __extends(Idle, _super);
4288
4116
  function Idle(context) {
4289
4117
  var _this = _super.call(this, context) || this;
4290
- _this.active = false;
4118
+ _this.isTransitional = false;
4291
4119
  _this.startingUrl = null;
4120
+ _this.isPopState = false;
4292
4121
  return _this;
4293
4122
  }
4294
- /**
4295
- * @param {?} component
4296
- * @param {?} nextState
4297
- * @return {?}
4298
- */
4299
- Idle.prototype.canDeactivatePlace = /**
4300
- * @param {?} component
4301
- * @param {?} nextState
4302
- * @return {?}
4303
- */
4304
- function (component, nextState) {
4305
- return __awaiter(this, void 0, void 0, function () {
4306
- return __generator(this, function (_a) {
4307
- return [2 /*return*/, this.illegalTransition('canDeactivatePlace')];
4308
- });
4309
- });
4310
- };
4311
4123
  /**
4312
4124
  * @param {?} event
4313
4125
  * @return {?}
@@ -4322,65 +4134,51 @@
4322
4134
  pectin.Logger.get(this).info("navigation started to same url -> " + event.url);
4323
4135
  return this;
4324
4136
  }
4325
- if (event.url === (this.currentRouterUrl() + "(aup-interaction:modal)")) {
4137
+ if (this.placeRouter.hasActiveInteractionIds(event.url)) {
4326
4138
  pectin.Logger.get(this).info("navigation started with interaction outlet -> " + event.url);
4327
- return new ModalInteractionSession(this.context, event.url);
4139
+ return new InteractionTransition(this.context, event.url);
4140
+ }
4141
+ else {
4142
+ return this.createTransitionStateFor(event);
4328
4143
  }
4329
- return this.createActiveSession(event);
4330
- };
4331
- /**
4332
- * @param {?} event
4333
- * @return {?}
4334
- */
4335
- Idle.prototype.onCancel = /**
4336
- * @param {?} event
4337
- * @return {?}
4338
- */
4339
- function (event) {
4340
- return this.illegalTransition(event);
4341
- };
4342
- /**
4343
- * @param {?} event
4344
- * @return {?}
4345
- */
4346
- Idle.prototype.onEnd = /**
4347
- * @param {?} event
4348
- * @return {?}
4349
- */
4350
- function (event) {
4351
- return this.illegalTransition(event);
4352
4144
  };
4353
4145
  /**
4354
4146
  * @param {?} event
4355
4147
  * @return {?}
4356
4148
  */
4357
- Idle.prototype.onError = /**
4149
+ Idle.prototype.onPopState = /**
4358
4150
  * @param {?} event
4359
4151
  * @return {?}
4360
4152
  */
4361
4153
  function (event) {
4362
- return this.illegalTransition(event);
4154
+ return this.createTransitionStateFor(event);
4363
4155
  };
4364
4156
  return Idle;
4365
4157
  }(NavigationState));
4366
4158
  NavigationState.Idle = Idle;
4367
4159
  if (false) {
4368
4160
  /** @type {?} */
4369
- Idle.prototype.isPopState;
4370
- /** @type {?} */
4371
- Idle.prototype.active;
4161
+ Idle.prototype.isTransitional;
4372
4162
  /** @type {?} */
4373
4163
  Idle.prototype.startingUrl;
4164
+ /** @type {?} */
4165
+ Idle.prototype.isPopState;
4374
4166
  }
4375
- var Active = /** @class */ (function (_super) {
4376
- __extends(Active, _super);
4377
- function Active(context, isPopState, startingUrl) {
4167
+ /**
4168
+ * @abstract
4169
+ */
4170
+ var /**
4171
+ * @abstract
4172
+ */
4173
+ AbstractNavigationTransition = /** @class */ (function (_super) {
4174
+ __extends(AbstractNavigationTransition, _super);
4175
+ function AbstractNavigationTransition(context, isPopState, startingUrl) {
4378
4176
  var _this = _super.call(this, context) || this;
4379
4177
  _this.isPopState = isPopState;
4380
4178
  _this.startingUrl = startingUrl;
4381
- _this.active = true;
4179
+ _this.isTransitional = true;
4382
4180
  _this.componentDeactivationHandlers = new Map();
4383
- _this._interactionContext = _this.context.modalInteractionService.createExclusiveInteractionContext();
4181
+ _this._interactionContext = _this.interactionService._createExclusiveModalInteractionContext();
4384
4182
  _this.onDispose((/**
4385
4183
  * @return {?}
4386
4184
  */
@@ -4388,14 +4186,14 @@
4388
4186
  // the interaction context can be detached during the back button cancellation state transition
4389
4187
  // as the transition is synchronous and activityCancellation isn't. Otherwise dispose will be
4390
4188
  // called before the context has been cancelled. It might be work having the interaction context
4391
- // automatically cancel if the context is disposed.
4189
+ // automatically cancel if the context is disposed so we don't have worry about detaching etc.
4392
4190
  if (_this._interactionContext) {
4393
- _this._interactionContext.dispose();
4191
+ _this._interactionContext.dispose(); // or do something like cancelAndDispose?
4394
4192
  }
4395
4193
  }));
4396
4194
  return _this;
4397
4195
  }
4398
- Object.defineProperty(Active.prototype, "interactionContext", {
4196
+ Object.defineProperty(AbstractNavigationTransition.prototype, "interactionContext", {
4399
4197
  get: /**
4400
4198
  * @return {?}
4401
4199
  */
@@ -4409,19 +4207,20 @@
4409
4207
  * @param {?} event
4410
4208
  * @return {?}
4411
4209
  */
4412
- Active.prototype.onStart = /**
4210
+ AbstractNavigationTransition.prototype.onStart = /**
4413
4211
  * @param {?} event
4414
4212
  * @return {?}
4415
4213
  */
4416
4214
  function (event) {
4417
- // active sessions can have many cancel start cycles.
4215
+ // active sessions can have many cancel start cycles due
4216
+ // to place guard redirects
4418
4217
  return this;
4419
4218
  };
4420
4219
  /**
4421
4220
  * @param {?} event
4422
4221
  * @return {?}
4423
4222
  */
4424
- Active.prototype.onEnd = /**
4223
+ AbstractNavigationTransition.prototype.onEnd = /**
4425
4224
  * @param {?} event
4426
4225
  * @return {?}
4427
4226
  */
@@ -4430,70 +4229,31 @@
4430
4229
  this.context.notifySuccess(this);
4431
4230
  return new Idle(this.context);
4432
4231
  };
4433
- /**
4434
- * @param {?} event
4435
- * @return {?}
4436
- */
4437
- Active.prototype.onCancel = /**
4438
- * @param {?} event
4439
- * @return {?}
4440
- */
4441
- function (event) {
4442
- if (this.isPopState) { // back button clicked and a guard cancelled
4443
- // Angular doesn't preserve the url when a guard cancels the back button.
4444
- // See https://github.com/angular/angular/issues/13586#issuecomment-432795720
4445
- pectin.Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');
4446
- this.updateLocation(this.startingUrl);
4447
- }
4448
- return this.isPopState ? new Idle(this.context) : this;
4449
- };
4450
- /**
4451
- * @param {?} event
4452
- * @return {?}
4453
- */
4454
- Active.prototype.onError = /**
4455
- * @param {?} event
4456
- * @return {?}
4457
- */
4458
- function (event) {
4459
- // navigation was aborted.
4460
- if (this.isPopState && this.currentRouterUrl() !== this.startingUrl) {
4461
- // Angular doesn't preserve the url when a guard cancels the back button.
4462
- // See https://github.com/angular/angular/issues/13586#issuecomment-432795720
4463
- pectin.Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');
4464
- this.updateLocation(this.startingUrl);
4465
- }
4466
- return new Idle(this.context);
4467
- };
4468
4232
  /**
4469
4233
  * @param {?} locationTriggerUrl
4470
4234
  * @return {?}
4471
4235
  */
4472
- Active.prototype.onBackClickedDuringNavigationInteraction = /**
4236
+ AbstractNavigationTransition.prototype.onBackClickedDuringNavigationInteraction = /**
4473
4237
  * @param {?} locationTriggerUrl
4474
4238
  * @return {?}
4475
4239
  */
4476
4240
  function (locationTriggerUrl) {
4241
+ // detach the interactoin from the session so it doesn't get disposed until the activity
4242
+ // has completed.
4477
4243
  /** @type {?} */
4478
4244
  var context = this.detachInteractionContext();
4245
+ var when = pectin.Dsl.disposeWith(context).when;
4246
+ // TODO: I need to make the exclusive interaction context disallow nested activities or
4247
+ // that would mess things up entirely.
4479
4248
  context.getCurrentActivity().then((/**
4480
4249
  * @param {?} activity
4481
4250
  * @return {?}
4482
4251
  */
4483
4252
  function (activity) {
4484
- context.addActivityListener({
4485
- onActivityFinished: /**
4486
- * @return {?}
4487
- */
4488
- function () {
4489
- context.dispose();
4490
- },
4491
- onActivityStarted: /**
4492
- * @return {?}
4493
- */
4494
- function () {
4495
- }
4496
- });
4253
+ when.valueOf(context.active).becomesFalsey((/**
4254
+ * @return {?}
4255
+ */
4256
+ function () { return context.dispose(); }), { once: true });
4497
4257
  activity.cancel(null);
4498
4258
  }));
4499
4259
  return new CancelledDuringNavigationInteraction(this.context, this.startingUrl, locationTriggerUrl);
@@ -4503,7 +4263,7 @@
4503
4263
  * @param {?} nextState
4504
4264
  * @return {?}
4505
4265
  */
4506
- Active.prototype.canDeactivatePlace = /**
4266
+ AbstractNavigationTransition.prototype.canDeactivatePlace = /**
4507
4267
  * @param {?} component
4508
4268
  * @param {?} nextState
4509
4269
  * @return {?}
@@ -4527,7 +4287,7 @@
4527
4287
  * @private
4528
4288
  * @return {?}
4529
4289
  */
4530
- Active.prototype.detachInteractionContext = /**
4290
+ AbstractNavigationTransition.prototype.detachInteractionContext = /**
4531
4291
  * @private
4532
4292
  * @return {?}
4533
4293
  */
@@ -4537,180 +4297,304 @@
4537
4297
  this._interactionContext = null;
4538
4298
  return context;
4539
4299
  };
4300
+ return AbstractNavigationTransition;
4301
+ }(NavigationState));
4302
+ NavigationState.AbstractNavigationTransition = AbstractNavigationTransition;
4303
+ if (false) {
4304
+ /** @type {?} */
4305
+ AbstractNavigationTransition.prototype.isTransitional;
4306
+ /**
4307
+ * @type {?}
4308
+ * @private
4309
+ */
4310
+ AbstractNavigationTransition.prototype.componentDeactivationHandlers;
4311
+ /**
4312
+ * @type {?}
4313
+ * @private
4314
+ */
4315
+ AbstractNavigationTransition.prototype._interactionContext;
4316
+ /** @type {?} */
4317
+ AbstractNavigationTransition.prototype.isPopState;
4318
+ /** @type {?} */
4319
+ AbstractNavigationTransition.prototype.startingUrl;
4320
+ }
4321
+ var NavigationTransition = /** @class */ (function (_super) {
4322
+ __extends(NavigationTransition, _super);
4323
+ function NavigationTransition() {
4324
+ var _this = _super !== null && _super.apply(this, arguments) || this;
4325
+ _this.isPopState = false;
4326
+ return _this;
4327
+ }
4328
+ /**
4329
+ * @param {?} event
4330
+ * @return {?}
4331
+ */
4332
+ NavigationTransition.prototype.onStart = /**
4333
+ * @param {?} event
4334
+ * @return {?}
4335
+ */
4336
+ function (event) {
4337
+ // active sessions can have many cancel start cycles due
4338
+ // to place guard redirects
4339
+ return this;
4340
+ };
4341
+ /**
4342
+ * @param {?} event
4343
+ * @return {?}
4344
+ */
4345
+ NavigationTransition.prototype.onEnd = /**
4346
+ * @param {?} event
4347
+ * @return {?}
4348
+ */
4349
+ function (event) {
4350
+ // navigation succeeded
4351
+ this.context.notifySuccess(this);
4352
+ return new Idle(this.context);
4353
+ };
4354
+ /**
4355
+ * @param {?} event
4356
+ * @return {?}
4357
+ */
4358
+ NavigationTransition.prototype.onCancel = /**
4359
+ * @param {?} event
4360
+ * @return {?}
4361
+ */
4362
+ function (event) {
4363
+ return new Idle(this.context);
4364
+ };
4365
+ /**
4366
+ * @param {?} event
4367
+ * @return {?}
4368
+ */
4369
+ NavigationTransition.prototype.onError = /**
4370
+ * @param {?} event
4371
+ * @return {?}
4372
+ */
4373
+ function (event) {
4374
+ // navigation was aborted.
4375
+ return new Idle(this.context);
4376
+ };
4540
4377
  /**
4541
4378
  * @return {?}
4542
4379
  */
4543
- Active.prototype.toString = /**
4380
+ NavigationTransition.prototype.toString = /**
4544
4381
  * @return {?}
4545
4382
  */
4546
4383
  function () {
4547
- return this.constructor.name + "(startingUrl: " + this.startingUrl + ", isPopState:" + this.isPopState + ")";
4384
+ return this.constructor.name + "(startingUrl: " + this.startingUrl + ")";
4548
4385
  };
4549
- __decorate([
4550
- pectin.Trace(),
4551
- __metadata("design:type", Function),
4552
- __metadata("design:paramtypes", [router.NavigationStart]),
4553
- __metadata("design:returntype", NavigationState)
4554
- ], Active.prototype, "onStart", null);
4555
- __decorate([
4556
- pectin.Trace(),
4557
- __metadata("design:type", Function),
4558
- __metadata("design:paramtypes", [router.NavigationCancel]),
4559
- __metadata("design:returntype", NavigationState)
4560
- ], Active.prototype, "onCancel", null);
4561
- __decorate([
4562
- pectin.Trace(),
4563
- __metadata("design:type", Function),
4564
- __metadata("design:paramtypes", [router.NavigationError]),
4565
- __metadata("design:returntype", NavigationState)
4566
- ], Active.prototype, "onError", null);
4567
- return Active;
4568
- }(NavigationState));
4569
- NavigationState.Active = Active;
4386
+ return NavigationTransition;
4387
+ }(AbstractNavigationTransition));
4388
+ NavigationState.NavigationTransition = NavigationTransition;
4570
4389
  if (false) {
4571
4390
  /** @type {?} */
4572
- Active.prototype.active;
4391
+ NavigationTransition.prototype.isPopState;
4392
+ }
4393
+ var NavigationBackTransition = /** @class */ (function (_super) {
4394
+ __extends(NavigationBackTransition, _super);
4395
+ function NavigationBackTransition() {
4396
+ var _this = _super !== null && _super.apply(this, arguments) || this;
4397
+ _this.isPopState = true;
4398
+ return _this;
4399
+ }
4573
4400
  /**
4574
- * @type {?}
4575
- * @private
4401
+ * @param {?} event
4402
+ * @return {?}
4403
+ */
4404
+ NavigationBackTransition.prototype.onCancel = /**
4405
+ * @param {?} event
4406
+ * @return {?}
4576
4407
  */
4577
- Active.prototype.componentDeactivationHandlers;
4408
+ function (event) {
4409
+ // Angular doesn't preserve the url when a guard cancels the back button.
4410
+ // See https://github.com/angular/angular/issues/13586#issuecomment-432795720
4411
+ pectin.Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');
4412
+ this.resetBrowserLocation(this.startingUrl);
4413
+ return new Idle(this.context);
4414
+ };
4578
4415
  /**
4579
- * @type {?}
4580
- * @private
4416
+ * @param {?} event
4417
+ * @return {?}
4418
+ */
4419
+ NavigationBackTransition.prototype.onError = /**
4420
+ * @param {?} event
4421
+ * @return {?}
4581
4422
  */
4582
- Active.prototype._interactionContext;
4423
+ function (event) {
4424
+ // navigation was aborted.
4425
+ if (this.currentRouterUrl() !== this.startingUrl) {
4426
+ // Angular doesn't preserve the url when a guard cancels the back button.
4427
+ // See https://github.com/angular/angular/issues/13586#issuecomment-432795720
4428
+ pectin.Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');
4429
+ this.resetBrowserLocation(this.startingUrl);
4430
+ }
4431
+ return new Idle(this.context);
4432
+ };
4433
+ return NavigationBackTransition;
4434
+ }(AbstractNavigationTransition));
4435
+ NavigationState.NavigationBackTransition = NavigationBackTransition;
4436
+ if (false) {
4437
+ /** @type {?} */
4438
+ NavigationBackTransition.prototype.isPopState;
4439
+ }
4440
+ /**
4441
+ * @abstract
4442
+ */
4443
+ var /**
4444
+ * @abstract
4445
+ */
4446
+ AbstractInteractionTransition = /** @class */ (function (_super) {
4447
+ __extends(AbstractInteractionTransition, _super);
4448
+ function AbstractInteractionTransition(context, startingUrl) {
4449
+ var _this = _super.call(this, context) || this;
4450
+ _this.startingUrl = startingUrl;
4451
+ _this.isTransitional = true;
4452
+ return _this;
4453
+ }
4454
+ /**
4455
+ * @protected
4456
+ * @return {?}
4457
+ */
4458
+ AbstractInteractionTransition.prototype.reinstateInteractionRoute = /**
4459
+ * @protected
4460
+ * @return {?}
4461
+ */
4462
+ function () {
4463
+ var _this = this;
4464
+ console.log(this.startingUrl);
4465
+ setTimeout((/**
4466
+ * @return {?}
4467
+ */
4468
+ function () { return _this.placeRouter.syncInteractionIdsWithRouter(); }));
4469
+ };
4470
+ return AbstractInteractionTransition;
4471
+ }(NavigationState));
4472
+ NavigationState.AbstractInteractionTransition = AbstractInteractionTransition;
4473
+ if (false) {
4583
4474
  /** @type {?} */
4584
- Active.prototype.isPopState;
4475
+ AbstractInteractionTransition.prototype.isTransitional;
4585
4476
  /** @type {?} */
4586
- Active.prototype.startingUrl;
4477
+ AbstractInteractionTransition.prototype.startingUrl;
4587
4478
  }
4588
- var ModalInteractionSession = /** @class */ (function (_super) {
4589
- __extends(ModalInteractionSession, _super);
4590
- function ModalInteractionSession(context, startingUrl) {
4591
- var _this = _super.call(this, context) || this;
4592
- _this.startingUrl = startingUrl;
4593
- _this.active = false;
4479
+ /**
4480
+ * This state exists to handle all events while any kind of navigation is in progress. That way all other states can
4481
+ * happily ignore interaction contexts.
4482
+ */
4483
+ var /**
4484
+ * This state exists to handle all events while any kind of navigation is in progress. That way all other states can
4485
+ * happily ignore interaction contexts.
4486
+ */
4487
+ InteractionTransition = /** @class */ (function (_super) {
4488
+ __extends(InteractionTransition, _super);
4489
+ function InteractionTransition() {
4490
+ var _this = _super !== null && _super.apply(this, arguments) || this;
4594
4491
  _this.isPopState = false;
4595
4492
  return _this;
4596
4493
  }
4597
- /**
4598
- * @param {?} url
4599
- * @return {?}
4600
- */
4601
- ModalInteractionSession.hasInteraction = /**
4602
- * @param {?} url
4603
- * @return {?}
4604
- */
4605
- function (url) {
4606
- return url.endsWith('(aup-interaction:modal)');
4607
- };
4608
4494
  /**
4609
4495
  * @param {?} event
4610
4496
  * @return {?}
4611
4497
  */
4612
- ModalInteractionSession.prototype.onStart = /**
4498
+ InteractionTransition.prototype.onEnd = /**
4613
4499
  * @param {?} event
4614
4500
  * @return {?}
4615
4501
  */
4616
4502
  function (event) {
4617
- // VERY VERY IMPORTANT BACK BUTTON NOTE:
4618
- // When the back button is clicked we'll enter here first, and push the url
4619
- // back to the browser. Angular seems to ignore it from a routing perspective
4620
- // and then the InteractionGuard will cancel the navigation. This process seems
4621
- // to keep the brower history in a sane state.
4622
- if (this.context.modalInteractionService.isActive()) {
4623
- if (!ModalInteractionSession.hasInteraction(event.url)) {
4624
- // this capture the case where
4625
- this.updateLocation(this.startingUrl);
4626
- }
4503
+ if (this.context.interactionService.isActive()) {
4504
+ this.reinstateInteractionRoute();
4505
+ return new IdleDuringInteraction(this.context, this.startingUrl);
4506
+ }
4507
+ else {
4508
+ return new Idle(this.context);
4627
4509
  }
4628
- return this;
4629
- };
4630
- /**
4631
- * @param {?} event
4632
- * @return {?}
4633
- */
4634
- ModalInteractionSession.prototype.onCancel = /**
4635
- * @param {?} event
4636
- * @return {?}
4637
- */
4638
- function (event) {
4639
- // this.updateLocation(this.startingUrl);
4640
- return this;
4641
4510
  };
4511
+ return InteractionTransition;
4512
+ }(AbstractInteractionTransition));
4513
+ NavigationState.InteractionTransition = InteractionTransition;
4514
+ if (false) {
4515
+ /** @type {?} */
4516
+ InteractionTransition.prototype.isPopState;
4517
+ }
4518
+ /**
4519
+ * This state exists to handle all events while any kind of navigation is in progress. That way all other states can
4520
+ * happily ignore interaction contexts.
4521
+ */
4522
+ var /**
4523
+ * This state exists to handle all events while any kind of navigation is in progress. That way all other states can
4524
+ * happily ignore interaction contexts.
4525
+ */
4526
+ InteractionBackTransition = /** @class */ (function (_super) {
4527
+ __extends(InteractionBackTransition, _super);
4528
+ function InteractionBackTransition() {
4529
+ var _this = _super !== null && _super.apply(this, arguments) || this;
4530
+ _this.isPopState = true;
4531
+ return _this;
4532
+ }
4642
4533
  /**
4643
4534
  * @param {?} event
4644
4535
  * @return {?}
4645
4536
  */
4646
- ModalInteractionSession.prototype.onEnd = /**
4537
+ InteractionBackTransition.prototype.onEnd = /**
4647
4538
  * @param {?} event
4648
4539
  * @return {?}
4649
4540
  */
4650
4541
  function (event) {
4651
- if (this.context.modalInteractionService.isActive()) {
4652
- return this;
4542
+ if (this.interactionService.isActive()) {
4543
+ this.reinstateInteractionRoute();
4544
+ return new IdleDuringInteraction(this.context, this.startingUrl);
4653
4545
  }
4654
4546
  else {
4655
4547
  return new Idle(this.context);
4656
4548
  }
4657
4549
  };
4550
+ return InteractionBackTransition;
4551
+ }(AbstractInteractionTransition));
4552
+ NavigationState.InteractionBackTransition = InteractionBackTransition;
4553
+ if (false) {
4554
+ /** @type {?} */
4555
+ InteractionBackTransition.prototype.isPopState;
4556
+ }
4557
+ var IdleDuringInteraction = /** @class */ (function (_super) {
4558
+ __extends(IdleDuringInteraction, _super);
4559
+ function IdleDuringInteraction(context, startingUrl) {
4560
+ var _this = _super.call(this, context) || this;
4561
+ _this.startingUrl = startingUrl;
4562
+ _this.isTransitional = false;
4563
+ _this.isPopState = false;
4564
+ return _this;
4565
+ }
4658
4566
  /**
4659
4567
  * @param {?} event
4660
4568
  * @return {?}
4661
4569
  */
4662
- ModalInteractionSession.prototype.onError = /**
4570
+ IdleDuringInteraction.prototype.onStart = /**
4663
4571
  * @param {?} event
4664
4572
  * @return {?}
4665
4573
  */
4666
4574
  function (event) {
4667
- return this.illegalTransition(event);
4575
+ return new InteractionTransition(this.context, event.url);
4668
4576
  };
4669
4577
  /**
4670
- * @param {?} component
4671
- * @param {?} nextState
4578
+ * @param {?} event
4672
4579
  * @return {?}
4673
4580
  */
4674
- ModalInteractionSession.prototype.canDeactivatePlace = /**
4675
- * @param {?} component
4676
- * @param {?} nextState
4581
+ IdleDuringInteraction.prototype.onPopState = /**
4582
+ * @param {?} event
4677
4583
  * @return {?}
4678
4584
  */
4679
- function (component, nextState) {
4680
- return __awaiter(this, void 0, void 0, function () {
4681
- return __generator(this, function (_a) {
4682
- return [2 /*return*/, true];
4683
- });
4684
- });
4585
+ function (event) {
4586
+ return new InteractionBackTransition(this.context, event.url);
4685
4587
  };
4686
- __decorate([
4687
- pectin.Trace(),
4688
- __metadata("design:type", Function),
4689
- __metadata("design:paramtypes", [router.NavigationStart]),
4690
- __metadata("design:returntype", NavigationState)
4691
- ], ModalInteractionSession.prototype, "onStart", null);
4692
- __decorate([
4693
- pectin.Trace(),
4694
- __metadata("design:type", Function),
4695
- __metadata("design:paramtypes", [router.NavigationCancel]),
4696
- __metadata("design:returntype", NavigationState)
4697
- ], ModalInteractionSession.prototype, "onCancel", null);
4698
- __decorate([
4699
- pectin.Trace(),
4700
- __metadata("design:type", Function),
4701
- __metadata("design:paramtypes", [router.NavigationEnd]),
4702
- __metadata("design:returntype", NavigationState)
4703
- ], ModalInteractionSession.prototype, "onEnd", null);
4704
- return ModalInteractionSession;
4588
+ return IdleDuringInteraction;
4705
4589
  }(NavigationState));
4706
- NavigationState.ModalInteractionSession = ModalInteractionSession;
4590
+ NavigationState.IdleDuringInteraction = IdleDuringInteraction;
4707
4591
  if (false) {
4708
4592
  /** @type {?} */
4709
- ModalInteractionSession.prototype.active;
4593
+ IdleDuringInteraction.prototype.isTransitional;
4710
4594
  /** @type {?} */
4711
- ModalInteractionSession.prototype.isPopState;
4595
+ IdleDuringInteraction.prototype.isPopState;
4712
4596
  /** @type {?} */
4713
- ModalInteractionSession.prototype.startingUrl;
4597
+ IdleDuringInteraction.prototype.startingUrl;
4714
4598
  }
4715
4599
  var CancelledDuringNavigationInteraction = /** @class */ (function (_super) {
4716
4600
  __extends(CancelledDuringNavigationInteraction, _super);
@@ -4718,28 +4602,36 @@
4718
4602
  var _this = _super.call(this, context) || this;
4719
4603
  _this.startingUrl = startingUrl;
4720
4604
  _this.locationChangeTriggerUrl = locationChangeTriggerUrl;
4721
- _this.active = false;
4605
+ _this.isPopState = false;
4722
4606
  _this.capturedFauxRouterStart = false;
4723
4607
  return _this;
4724
- // This will trigger a return to the route we originally started with.
4725
- // this.angularLocation.go(this.startingUrl);
4726
4608
  }
4609
+ Object.defineProperty(CancelledDuringNavigationInteraction.prototype, "isTransitional", {
4610
+ get: /**
4611
+ * @return {?}
4612
+ */
4613
+ function () {
4614
+ return !this.capturedFauxRouterStart;
4615
+ },
4616
+ enumerable: true,
4617
+ configurable: true
4618
+ });
4727
4619
  /**
4728
- * @param {?} component
4729
- * @param {?} nextState
4620
+ * @param {?} event
4730
4621
  * @return {?}
4731
4622
  */
4732
- CancelledDuringNavigationInteraction.prototype.canDeactivatePlace = /**
4733
- * @param {?} component
4734
- * @param {?} nextState
4623
+ CancelledDuringNavigationInteraction.prototype.onStart = /**
4624
+ * @param {?} event
4735
4625
  * @return {?}
4736
4626
  */
4737
- function (component, nextState) {
4738
- return __awaiter(this, void 0, void 0, function () {
4739
- return __generator(this, function (_a) {
4740
- return [2 /*return*/, false];
4741
- });
4742
- });
4627
+ function (event) {
4628
+ if (event.url === this.locationChangeTriggerUrl && !this.capturedFauxRouterStart) {
4629
+ this.capturedFauxRouterStart = true;
4630
+ return this.ignore(event, 'url matched back button location change');
4631
+ }
4632
+ else {
4633
+ return this.createTransitionStateFor(event);
4634
+ }
4743
4635
  };
4744
4636
  /**
4745
4637
  * @param {?} event
@@ -4778,18 +4670,12 @@
4778
4670
  * @param {?} event
4779
4671
  * @return {?}
4780
4672
  */
4781
- CancelledDuringNavigationInteraction.prototype.onStart = /**
4673
+ CancelledDuringNavigationInteraction.prototype.onPopState = /**
4782
4674
  * @param {?} event
4783
4675
  * @return {?}
4784
4676
  */
4785
4677
  function (event) {
4786
- if (event.url === this.locationChangeTriggerUrl && !this.capturedFauxRouterStart) {
4787
- this.capturedFauxRouterStart = true;
4788
- return this.ignore(event, 'url matched back button location change');
4789
- }
4790
- else {
4791
- return this.createActiveSession(event);
4792
- }
4678
+ return this.createTransitionStateFor(event);
4793
4679
  };
4794
4680
  /**
4795
4681
  * @param {?} event
@@ -4819,8 +4705,6 @@
4819
4705
  }(NavigationState));
4820
4706
  NavigationState.CancelledDuringNavigationInteraction = CancelledDuringNavigationInteraction;
4821
4707
  if (false) {
4822
- /** @type {?} */
4823
- CancelledDuringNavigationInteraction.prototype.active;
4824
4708
  /** @type {?} */
4825
4709
  CancelledDuringNavigationInteraction.prototype.isPopState;
4826
4710
  /**
@@ -4919,34 +4803,29 @@
4919
4803
  * @fileoverview added by tsickle
4920
4804
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4921
4805
  */
4922
- var UrlSnapshot = /** @class */ (function () {
4923
- function UrlSnapshot(urlTree) {
4924
- this.urlTree = urlTree;
4925
- // console.log({ segments: this.urlTree.root.children.primary.segments });
4806
+ exports.UrlSnapshot = /** @class */ (function () {
4807
+ // TODO: Update this accept a url Parser so it can be immutable and generate new trees on mutation using toString() are parseUrl.
4808
+ function UrlSnapshot(urlSerializer, url) {
4809
+ this.urlSerializer = urlSerializer;
4810
+ this.url = url;
4811
+ this.urlTree = urlSerializer.parse(url);
4926
4812
  }
4927
4813
  /**
4928
- * @return {?}
4929
- */
4930
- UrlSnapshot.prototype.cloneUrlSegmentList = /**
4931
- * @return {?}
4932
- */
4933
- function () {
4934
- return __spread(this.urlTree.root.children.primary.segments);
4935
- };
4936
- /**
4814
+ * @protected
4937
4815
  * @param {?} visit
4938
4816
  * @return {?}
4939
4817
  */
4940
- UrlSnapshot.prototype.updateVisitSegments = /**
4818
+ UrlSnapshot.prototype.replaceExistingVisitSegmentsWith = /**
4819
+ * @protected
4941
4820
  * @param {?} visit
4942
4821
  * @return {?}
4943
4822
  */
4944
4823
  function (visit) {
4945
4824
  // Ugly, but it works for now.
4946
4825
  /** @type {?} */
4947
- var segments = this.cloneUrlSegmentList();
4826
+ var segments = __spread(this.getPrimarySegments());
4948
4827
  /** @type {?} */
4949
- var visitSegments = this.convertToUrlSegments(visit);
4828
+ var visitSegments = this.getSegmentsFor(visit);
4950
4829
  /** @type {?} */
4951
4830
  var replaceAt = segments.findIndex((/**
4952
4831
  * @param {?} segment
@@ -4957,17 +4836,30 @@
4957
4836
  segments.splice.apply(segments, __spread([replaceAt, visitSegments.length], visitSegments));
4958
4837
  return segments;
4959
4838
  };
4839
+ /**
4840
+ * @private
4841
+ * @return {?}
4842
+ */
4843
+ UrlSnapshot.prototype.getPrimarySegments = /**
4844
+ * @private
4845
+ * @return {?}
4846
+ */
4847
+ function () {
4848
+ return this.urlTree.root.children.primary.segments;
4849
+ };
4960
4850
  /**
4961
4851
  * Converts the visit into segments. Please not that these segments are not e
4962
4852
  * @param visit
4963
4853
  */
4964
4854
  /**
4965
4855
  * Converts the visit into segments. Please not that these segments are not e
4856
+ * @protected
4966
4857
  * @param {?} visit
4967
4858
  * @return {?}
4968
4859
  */
4969
- UrlSnapshot.prototype.convertToUrlSegments = /**
4860
+ UrlSnapshot.prototype.getSegmentsFor = /**
4970
4861
  * Converts the visit into segments. Please not that these segments are not e
4862
+ * @protected
4971
4863
  * @param {?} visit
4972
4864
  * @return {?}
4973
4865
  */
@@ -4995,7 +4887,7 @@
4995
4887
  */
4996
4888
  function (visit) {
4997
4889
  /** @type {?} */
4998
- var segments = this.updateVisitSegments(visit);
4890
+ var segments = this.replaceExistingVisitSegmentsWith(visit);
4999
4891
  /** @type {?} */
5000
4892
  var commands = [];
5001
4893
  segments.forEach((/**
@@ -5019,46 +4911,125 @@
5019
4911
  * @return {?}
5020
4912
  */
5021
4913
  function (placeDef) {
5022
- return this.cloneUrlSegmentList().find((/**
4914
+ return this.getPrimarySegments().find((/**
5023
4915
  * @param {?} s
5024
4916
  * @return {?}
5025
4917
  */
5026
4918
  function (s) { return s.path === placeDef.path; }));
5027
4919
  };
4920
+ /**
4921
+ * @return {?}
4922
+ */
4923
+ UrlSnapshot.prototype.getInteractionIds = /**
4924
+ * @return {?}
4925
+ */
4926
+ function () {
4927
+ /** @type {?} */
4928
+ var interactionOutlet = this.urlTree.root.children[UrlSnapshot.INTERACTION_ROUTER_OUTLET];
4929
+ if (interactionOutlet) {
4930
+ pectin.assert.isTruthy(interactionOutlet.segments.length === 2);
4931
+ pectin.assert.isTruthy(interactionOutlet.segments[0].path === UrlSnapshot.INTERACTION_ROUTER_PATH);
4932
+ return UrlSnapshot.parseInteractionIds(interactionOutlet.segments[1].path);
4933
+ }
4934
+ else {
4935
+ return [];
4936
+ }
4937
+ };
4938
+ // @Trace()
4939
+ // @Trace()
4940
+ /**
4941
+ * @param {?} ids
4942
+ * @return {?}
4943
+ */
4944
+ UrlSnapshot.prototype.addOrReplaceInteractionIds =
4945
+ // @Trace()
4946
+ /**
4947
+ * @param {?} ids
4948
+ * @return {?}
4949
+ */
4950
+ function (ids) {
4951
+ /** @type {?} */
4952
+ var urlTree = this.urlSerializer.parse(this.url);
4953
+ urlTree.root.children[UrlSnapshot.INTERACTION_ROUTER_OUTLET] = new router.UrlSegmentGroup([
4954
+ new router.UrlSegment(UrlSnapshot.INTERACTION_ROUTER_PATH, {}),
4955
+ new router.UrlSegment(UrlSnapshot.createPathIdFor(ids), {})
4956
+ ], {});
4957
+ return new UrlSnapshot(this.urlSerializer, urlTree.toString());
4958
+ };
5028
4959
  return UrlSnapshot;
5029
4960
  }());
5030
4961
  if (false) {
4962
+ /**
4963
+ * @type {?}
4964
+ * @private
4965
+ */
4966
+ exports.UrlSnapshot.prototype.urlTree;
4967
+ /** @type {?} */
4968
+ exports.UrlSnapshot.prototype.urlSerializer;
5031
4969
  /** @type {?} */
5032
- UrlSnapshot.prototype.urlTree;
4970
+ exports.UrlSnapshot.prototype.url;
5033
4971
  }
4972
+ (function (UrlSnapshot) {
4973
+ UrlSnapshot.INTERACTION_ROUTER_OUTLET = 'aup-interactions';
4974
+ UrlSnapshot.INTERACTION_ROUTER_PATH = 'active';
4975
+ UrlSnapshot.INTERACTION_ID_SEPARATOR = '--';
4976
+ /**
4977
+ * @param {?} path
4978
+ * @return {?}
4979
+ */
4980
+ function parseInteractionIds(path) {
4981
+ return path.split(UrlSnapshot.INTERACTION_ID_SEPARATOR);
4982
+ }
4983
+ UrlSnapshot.parseInteractionIds = parseInteractionIds;
4984
+ /**
4985
+ * @param {?} interactionIds
4986
+ * @return {?}
4987
+ */
4988
+ function createPathIdFor(interactionIds) {
4989
+ return interactionIds.join(UrlSnapshot.INTERACTION_ID_SEPARATOR);
4990
+ }
4991
+ UrlSnapshot.createPathIdFor = createPathIdFor;
4992
+ /**
4993
+ * @param {?} interactionIds
4994
+ * @return {?}
4995
+ */
4996
+ function createInteractionOutletRouterCommands(interactionIds) {
4997
+ return [UrlSnapshot.INTERACTION_ROUTER_PATH, createPathIdFor(interactionIds)];
4998
+ }
4999
+ UrlSnapshot.createInteractionOutletRouterCommands = createInteractionOutletRouterCommands;
5000
+ })(exports.UrlSnapshot || (exports.UrlSnapshot = {}));
5034
5001
 
5035
5002
  /**
5036
5003
  * @fileoverview added by tsickle
5037
5004
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5038
5005
  */
5039
- exports.ɵt = /** @class */ (function (_super) {
5006
+ var PlaceRouter = /** @class */ (function (_super) {
5040
5007
  __extends(PlaceRouter, _super);
5041
- function PlaceRouter(router$1, urlSerializer, angularLocation, placeHistory, modalInteractionService) {
5008
+ function PlaceRouter(router$1, urlSerializer, angularLocation, placeHistory, interactionService) {
5042
5009
  var _this = _super.call(this) || this;
5043
5010
  _this.router = router$1;
5044
5011
  _this.urlSerializer = urlSerializer;
5045
5012
  _this.angularLocation = angularLocation;
5046
5013
  _this.placeHistory = placeHistory;
5047
- _this.modalInteractionService = modalInteractionService;
5048
- _this.firstRoute = true;
5049
- _this._navigationSessionModel = new pectin.MutableValueModel();
5014
+ _this.interactionService = interactionService;
5015
+ _this._navigationStateModel = new pectin.MutableValueModel();
5050
5016
  _this._activeVisits = new pectin.MutableListModel();
5051
5017
  var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
5052
5018
  _this.activeVisitIndex = chain(_this._activeVisits).indexBy('placeDefinition');
5053
- _this.navigationSessionActive = chain(_this.navigationSessionModel).pluck('active');
5054
- _this._navigationSessionContext = new exports.NavigationState.Context(_this.router, _this.modalInteractionService, _this.angularLocation, (/**
5019
+ _this.navigationInProgress = chain(_this.navigationStateModel).pluck('isTransitional');
5020
+ _this._navigationSessionContext = new exports.NavigationState.Context(_this, _this.interactionService, (/**
5055
5021
  * @param {?} session
5056
5022
  * @return {?}
5057
5023
  */
5058
5024
  function (session) {
5059
5025
  _this.processNavigationSuccess(session);
5060
5026
  }));
5061
- _this._navigationSessionModel.value = new exports.NavigationState.Idle(_this._navigationSessionContext);
5027
+ _this._navigationStateModel.value = new exports.NavigationState.Idle(_this._navigationSessionContext);
5028
+ _this._navigationStateTypeModel = chain(_this._navigationStateModel).map((/**
5029
+ * @param {?} state
5030
+ * @return {?}
5031
+ */
5032
+ function (state) { return (/** @type {?} */ (state.constructor)); }));
5062
5033
  // TODO: make setup the callbacks in during module initiation to make this testable.
5063
5034
  _this.router.events.subscribe((/**
5064
5035
  * @param {?} event
@@ -5072,53 +5043,85 @@
5072
5043
  // NavigationStart -> .... -> NavigationError --> navigation aborted, end session.
5073
5044
  // =======================
5074
5045
  if (event instanceof router.NavigationStart) {
5075
- _this.runStateTransition((/**
5076
- * @param {?} session
5077
- * @return {?}
5078
- */
5079
- function (session) { return session.onStart(event); }));
5046
+ console.log(event);
5047
+ if (event.navigationTrigger === 'popstate') {
5048
+ _this.runStateTransition((/**
5049
+ * @param {?} state
5050
+ * @return {?}
5051
+ */
5052
+ function (state) { return state.onPopState(event); }));
5053
+ }
5054
+ else {
5055
+ _this.runStateTransition((/**
5056
+ * @param {?} state
5057
+ * @return {?}
5058
+ */
5059
+ function (state) { return state.onStart(event); }));
5060
+ }
5080
5061
  }
5081
5062
  if (event instanceof router.NavigationEnd) {
5063
+ console.log(event);
5082
5064
  _this.runStateTransition((/**
5083
- * @param {?} session
5065
+ * @param {?} state
5084
5066
  * @return {?}
5085
5067
  */
5086
- function (session) { return session.onEnd(event); }));
5068
+ function (state) { return state.onEnd(event); }));
5087
5069
  }
5088
5070
  if (event instanceof router.NavigationError) {
5071
+ console.log(event);
5089
5072
  _this.runStateTransition((/**
5090
- * @param {?} session
5073
+ * @param {?} state
5091
5074
  * @return {?}
5092
5075
  */
5093
- function (session) { return session.onError(event); }));
5076
+ function (state) { return state.onError(event); }));
5094
5077
  }
5095
5078
  if (event instanceof router.NavigationCancel) {
5079
+ console.log(event);
5096
5080
  _this.runStateTransition((/**
5097
- * @param {?} session
5081
+ * @param {?} state
5098
5082
  * @return {?}
5099
5083
  */
5100
- function (session) { return session.onCancel(event); }));
5084
+ function (state) { return state.onCancel(event); }));
5101
5085
  }
5102
5086
  }));
5103
5087
  // Push dialog state to the url so we can capture the back button.
5104
- _this.modalInteractionService.addActivityListener(new PlaceRouter.InteractionRouteMediator(_this.navigationSessionActive, _this.router));
5088
+ when.listOf(_this.interactionService.activeInteractionContextIds).changes((/**
5089
+ * @param {?} ids
5090
+ * @param {?} previous
5091
+ * @return {?}
5092
+ */
5093
+ function (ids, previous) {
5094
+ _this.syncInteractionIdsWithRouter();
5095
+ }), { unless: _this.navigationInProgress }); // TODO: I think the exclusive interaction prevents interactions starting while it's active so we might not need this.
5096
+ // TODO: I think the exclusive interaction prevents interactions starting while it's active so we might not need this.
5097
+ /** @type {?} */
5098
+ var urlChanges = new pectin.MutableStream();
5105
5099
  // The angular router doesn't always fire router events when the back button is pushed while a navigation
5106
5100
  // session is in progress. Sometimes we only know about it from the url change.
5101
+ // IMPORTANT ORDER DEPENDENCY
5102
+ // This only works because we're notified of the change after the router has started reacting to it. This
5103
+ // we can can use our navigationState to determine things.
5107
5104
  angularLocation.onUrlChange((/**
5108
5105
  * @param {?} url
5109
5106
  * @return {?}
5110
5107
  */
5111
5108
  function (url) {
5112
- console.log("#### url changed ->", { url: url, navIsActive: _this.navigationSessionActive.value });
5113
5109
  /** @type {?} */
5114
- var interactionContext = _this.navigationSessionActive.value && _this.navigationSession.interactionContext;
5115
- if (interactionContext && interactionContext.isActive()) {
5116
- pectin.Logger.get(_this).info("back button pressed during navigation session interaction");
5117
- _this.runStateTransition((/**
5118
- * @param {?} navigationSession
5119
- * @return {?}
5120
- */
5121
- function (navigationSession) { return navigationSession.onBackClickedDuringNavigationInteraction(url); }));
5110
+ var navigationState = _this._navigationStateModel.value;
5111
+ console.log("URLChange -> " + url, { state: navigationState });
5112
+ urlChanges.publish({ url: url, state: navigationState });
5113
+ // We've entered a navigation transition
5114
+ if (navigationState instanceof exports.NavigationState.NavigationTransition) {
5115
+ /** @type {?} */
5116
+ var navigationInteraction = _this.navigationState.interactionContext;
5117
+ if (navigationInteraction && navigationInteraction.isActive()) {
5118
+ pectin.Logger.get(_this).info("back button pressed during navigation session interaction promise");
5119
+ _this.runStateTransition((/**
5120
+ * @param {?} state
5121
+ * @return {?}
5122
+ */
5123
+ function (state) { return state.onBackClickedDuringNavigationInteraction(url); }));
5124
+ }
5122
5125
  }
5123
5126
  }));
5124
5127
  return _this;
@@ -5137,7 +5140,7 @@
5137
5140
  var _this = this;
5138
5141
  // We need to update the visits before the session finishes. This allows the placeOutets to ignore visit
5139
5142
  // changes that occur while routerNavigationActive is true.
5140
- pectin.assert.isTruthy(this.navigationSessionActive.value);
5143
+ pectin.assert.isTruthy(this.navigationInProgress.value);
5141
5144
  /** @type {?} */
5142
5145
  var visits = session.getVisits();
5143
5146
  visits.forEach((/**
@@ -5147,22 +5150,22 @@
5147
5150
  function (v) { return _this.placeHistory.add(v); }));
5148
5151
  this._activeVisits.value = visits;
5149
5152
  };
5150
- Object.defineProperty(PlaceRouter.prototype, "navigationSession", {
5153
+ Object.defineProperty(PlaceRouter.prototype, "navigationState", {
5151
5154
  get: /**
5152
5155
  * @return {?}
5153
5156
  */
5154
5157
  function () {
5155
- return this._navigationSessionModel.value;
5158
+ return this._navigationStateModel.value;
5156
5159
  },
5157
5160
  enumerable: true,
5158
5161
  configurable: true
5159
5162
  });
5160
- Object.defineProperty(PlaceRouter.prototype, "navigationSessionModel", {
5163
+ Object.defineProperty(PlaceRouter.prototype, "navigationStateModel", {
5161
5164
  get: /**
5162
5165
  * @return {?}
5163
5166
  */
5164
5167
  function () {
5165
- return this._navigationSessionModel.readonly;
5168
+ return this._navigationStateModel.readonly;
5166
5169
  },
5167
5170
  enumerable: true,
5168
5171
  configurable: true
@@ -5253,7 +5256,7 @@
5253
5256
  */
5254
5257
  function (router) {
5255
5258
  /** @type {?} */
5256
- var commands = _this.parseUrl(_this.router.routerState.snapshot).createRedirectCommandsFor(next);
5259
+ var commands = _this.parseUrl(_this.router.routerState.snapshot.url).createRedirectCommandsFor(next);
5257
5260
  console.log('### Push Changes to route Redirect', { commands: commands });
5258
5261
  return router.navigate(commands);
5259
5262
  }))];
@@ -5278,7 +5281,7 @@
5278
5281
  return __generator(this, function (_a) {
5279
5282
  switch (_a.label) {
5280
5283
  case 0:
5281
- if (this.navigationSessionActive.value) {
5284
+ if (this.navigationInProgress.value) {
5282
5285
  pectin.lang.illegalState('Navigation already in progress');
5283
5286
  }
5284
5287
  this.runStateTransition((/**
@@ -5287,7 +5290,7 @@
5287
5290
  */
5288
5291
  function (current) {
5289
5292
  /** @type {?} */
5290
- var session = new exports.NavigationState.Active(_this._navigationSessionContext, false, _this.router.routerState.snapshot.url);
5293
+ var session = new exports.NavigationState.NavigationTransition(_this._navigationSessionContext, false, _this.router.routerState.snapshot.url);
5291
5294
  session.storeVisit(visit);
5292
5295
  return session;
5293
5296
  }));
@@ -5301,7 +5304,7 @@
5301
5304
  case 3:
5302
5305
  // Router has finished (since there was no router change required) so we
5303
5306
  // need to end the navigation session.
5304
- if (this.navigationSession.active && !this.router.getCurrentNavigation()) {
5307
+ if (this.navigationState.isTransitional && !this.router.getCurrentNavigation()) {
5305
5308
  this.runStateTransition((/**
5306
5309
  * @param {?} session
5307
5310
  * @return {?}
@@ -5326,10 +5329,10 @@
5326
5329
  */
5327
5330
  function (transition) {
5328
5331
  /** @type {?} */
5329
- var previous = this._navigationSessionModel.value;
5332
+ var previous = this._navigationStateModel.value;
5330
5333
  /** @type {?} */
5331
- var next = transition(this.navigationSession);
5332
- this._navigationSessionModel.value = next;
5334
+ var next = transition(this.navigationState);
5335
+ this._navigationStateModel.value = next;
5333
5336
  if (next !== previous) {
5334
5337
  previous.dispose();
5335
5338
  pectin.Logger.get(this).info("Router State Transition: " + previous.toString() + " -> " + next.toString());
@@ -5368,15 +5371,97 @@
5368
5371
  function (child) { return child.url; })));
5369
5372
  };
5370
5373
  /**
5371
- * @param {?} snapshot
5374
+ * @param {?} url
5372
5375
  * @return {?}
5373
5376
  */
5374
5377
  PlaceRouter.prototype.parseUrl = /**
5375
- * @param {?} snapshot
5378
+ * @param {?} url
5379
+ * @return {?}
5380
+ */
5381
+ function (url) {
5382
+ return new exports.UrlSnapshot(this.urlSerializer, url);
5383
+ };
5384
+ /**
5385
+ * @param {?} url
5386
+ * @return {?}
5387
+ */
5388
+ PlaceRouter.prototype.resetBrowserLocation = /**
5389
+ * @param {?} url
5390
+ * @return {?}
5391
+ */
5392
+ function (url) {
5393
+ this.angularLocation.go(url);
5394
+ };
5395
+ /**
5396
+ * @return {?}
5397
+ */
5398
+ PlaceRouter.prototype.getCurrentRouterUrl = /**
5399
+ * @return {?}
5400
+ */
5401
+ function () {
5402
+ return this.router.routerState ? this.router.routerState.snapshot.url : null;
5403
+ };
5404
+ /**
5405
+ * @param {?} url
5406
+ * @return {?}
5407
+ */
5408
+ PlaceRouter.prototype.getActiveInteractionIdsFromUrl = /**
5409
+ * @param {?} url
5410
+ * @return {?}
5411
+ */
5412
+ function (url) {
5413
+ return this.parseUrl(url).getInteractionIds();
5414
+ };
5415
+ // @Trace()
5416
+ // @Trace()
5417
+ /**
5418
+ * @param {?} url
5419
+ * @return {?}
5420
+ */
5421
+ PlaceRouter.prototype.hasActiveInteractionIds =
5422
+ // @Trace()
5423
+ /**
5424
+ * @param {?} url
5425
+ * @return {?}
5426
+ */
5427
+ function (url) {
5428
+ return this.getActiveInteractionIdsFromUrl(url).length > 0;
5429
+ };
5430
+ /**
5376
5431
  * @return {?}
5377
5432
  */
5378
- function (snapshot) {
5379
- return new UrlSnapshot(this.urlSerializer.parse(snapshot.url));
5433
+ PlaceRouter.prototype.syncInteractionIdsWithRouter = /**
5434
+ * @return {?}
5435
+ */
5436
+ function () {
5437
+ var _a, _b;
5438
+ pectin.assert.isFalsey(this.navigationInProgress.value); // Updating interaction routes during an existing navigation breaks all the things.
5439
+ // Updating interaction routes during an existing navigation breaks all the things.
5440
+ /** @type {?} */
5441
+ var currentIds = this.interactionService.activeInteractionContextIds.value;
5442
+ if (___default__default.isEqual(currentIds, this.getActiveInteractionIdsFromUrl(this.getCurrentRouterUrl()))) {
5443
+ console.log('activity ids were the same, skipping');
5444
+ }
5445
+ else {
5446
+ if (currentIds.length < 1) {
5447
+ this.router.navigate(['.', {
5448
+ outlets: (_a = {},
5449
+ _a[exports.UrlSnapshot.INTERACTION_ROUTER_OUTLET] = null,
5450
+ _a)
5451
+ }], {
5452
+ replaceUrl: true // remove the interaction from the history.
5453
+ });
5454
+ }
5455
+ else {
5456
+ /** @type {?} */
5457
+ var urlSnapshot = this.parseUrl(this.getCurrentRouterUrl());
5458
+ this.router.navigate(['.', {
5459
+ outlets: (_b = {},
5460
+ _b[exports.UrlSnapshot.INTERACTION_ROUTER_OUTLET] = exports.UrlSnapshot.createInteractionOutletRouterCommands(currentIds),
5461
+ _b)
5462
+ }]);
5463
+ }
5464
+ }
5380
5465
  };
5381
5466
  PlaceRouter.decorators = [
5382
5467
  { type: core.Injectable, args: [{
@@ -5389,9 +5474,15 @@
5389
5474
  { type: router.UrlSerializer },
5390
5475
  { type: common.Location },
5391
5476
  { type: PlaceHistory },
5392
- { type: ModalInteractionService }
5477
+ { type: exports.ɵv }
5393
5478
  ]; };
5394
- /** @nocollapse */ PlaceRouter.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(core.ɵɵinject(router.Router), core.ɵɵinject(router.UrlSerializer), core.ɵɵinject(common.Location), core.ɵɵinject(PlaceHistory), core.ɵɵinject(ModalInteractionService)); }, token: PlaceRouter, providedIn: "root" });
5479
+ /** @nocollapse */ PlaceRouter.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(core.ɵɵinject(router.Router), core.ɵɵinject(router.UrlSerializer), core.ɵɵinject(common.Location), core.ɵɵinject(PlaceHistory), core.ɵɵinject(exports.ɵv)); }, token: PlaceRouter, providedIn: "root" });
5480
+ __decorate([
5481
+ pectin.Trace(),
5482
+ __metadata("design:type", Function),
5483
+ __metadata("design:paramtypes", []),
5484
+ __metadata("design:returntype", void 0)
5485
+ ], PlaceRouter.prototype, "syncInteractionIdsWithRouter", null);
5395
5486
  return PlaceRouter;
5396
5487
  }(pectin.GarbageCollector));
5397
5488
  if (false) {
@@ -5399,127 +5490,52 @@
5399
5490
  * @type {?}
5400
5491
  * @private
5401
5492
  */
5402
- exports.ɵt.prototype.firstRoute;
5493
+ PlaceRouter.prototype._navigationStateModel;
5403
5494
  /**
5404
5495
  * @type {?}
5405
5496
  * @private
5406
5497
  */
5407
- exports.ɵt.prototype._navigationSessionModel;
5498
+ PlaceRouter.prototype._activeVisits;
5499
+ /** @type {?} */
5500
+ PlaceRouter.prototype.navigationInProgress;
5501
+ /** @type {?} */
5502
+ PlaceRouter.prototype.activeVisitIndex;
5408
5503
  /**
5409
5504
  * @type {?}
5410
5505
  * @private
5411
- */
5412
- exports.ɵt.prototype._activeVisits;
5413
- /** @type {?} */
5414
- exports.ɵt.prototype.navigationSessionActive;
5415
- /** @type {?} */
5416
- exports.ɵt.prototype.activeVisitIndex;
5506
+ */
5507
+ PlaceRouter.prototype._navigationSessionContext;
5417
5508
  /**
5418
5509
  * @type {?}
5419
5510
  * @private
5420
5511
  */
5421
- exports.ɵt.prototype._navigationSessionContext;
5512
+ PlaceRouter.prototype._navigationStateTypeModel;
5422
5513
  /**
5423
5514
  * @type {?}
5424
5515
  * @private
5425
5516
  */
5426
- exports.ɵt.prototype.router;
5517
+ PlaceRouter.prototype.router;
5427
5518
  /**
5428
5519
  * @type {?}
5429
5520
  * @private
5430
5521
  */
5431
- exports.ɵt.prototype.urlSerializer;
5522
+ PlaceRouter.prototype.urlSerializer;
5432
5523
  /**
5433
5524
  * @type {?}
5434
5525
  * @private
5435
5526
  */
5436
- exports.ɵt.prototype.angularLocation;
5527
+ PlaceRouter.prototype.angularLocation;
5437
5528
  /**
5438
5529
  * @type {?}
5439
5530
  * @private
5440
5531
  */
5441
- exports.ɵt.prototype.placeHistory;
5532
+ PlaceRouter.prototype.placeHistory;
5442
5533
  /**
5443
5534
  * @type {?}
5444
5535
  * @private
5445
5536
  */
5446
- exports.ɵt.prototype.modalInteractionService;
5537
+ PlaceRouter.prototype.interactionService;
5447
5538
  }
5448
- (function (PlaceRouter) {
5449
- PlaceRouter.INTERACTION_ROUTER_OUTLET = 'aup-interaction';
5450
- var InteractionRouteMediator = /** @class */ (function () {
5451
- function InteractionRouteMediator(navigationSessionModelActive, router) {
5452
- this.navigationSessionModelActive = navigationSessionModelActive;
5453
- this.router = router;
5454
- }
5455
- Object.defineProperty(InteractionRouteMediator.prototype, "isNavigating", {
5456
- get: /**
5457
- * @return {?}
5458
- */
5459
- function () {
5460
- return this.navigationSessionModelActive.value;
5461
- },
5462
- enumerable: true,
5463
- configurable: true
5464
- });
5465
- // If we're not in a navigation we push
5466
- // @Trace()
5467
- // If we're not in a navigation we push
5468
- // @Trace()
5469
- /**
5470
- * @return {?}
5471
- */
5472
- InteractionRouteMediator.prototype.onActivityStarted =
5473
- // If we're not in a navigation we push
5474
- // @Trace()
5475
- /**
5476
- * @return {?}
5477
- */
5478
- function () {
5479
- var _a;
5480
- if (!this.isNavigating) {
5481
- this.router.navigate(['.', {
5482
- outlets: (_a = {},
5483
- _a[PlaceRouter.INTERACTION_ROUTER_OUTLET] = ['modal'] // "open" must be a valid route for this outlet.
5484
- ,
5485
- _a)
5486
- }], {
5487
- replaceUrl: false
5488
- });
5489
- }
5490
- };
5491
- // @Trace()
5492
- // @Trace()
5493
- /**
5494
- * @return {?}
5495
- */
5496
- InteractionRouteMediator.prototype.onActivityFinished =
5497
- // @Trace()
5498
- /**
5499
- * @return {?}
5500
- */
5501
- function () {
5502
- var _a;
5503
- if (!this.isNavigating) {
5504
- this.router.navigate(['.', {
5505
- outlets: (_a = {},
5506
- _a[PlaceRouter.INTERACTION_ROUTER_OUTLET] = null,
5507
- _a)
5508
- }], {
5509
- replaceUrl: true // remove the interaction from the history.
5510
- });
5511
- }
5512
- };
5513
- return InteractionRouteMediator;
5514
- }());
5515
- PlaceRouter.InteractionRouteMediator = InteractionRouteMediator;
5516
- if (false) {
5517
- /** @type {?} */
5518
- InteractionRouteMediator.prototype.navigationSessionModelActive;
5519
- /** @type {?} */
5520
- InteractionRouteMediator.prototype.router;
5521
- }
5522
- })(exports.ɵt || (exports.ɵt = {}));
5523
5539
 
5524
5540
  /**
5525
5541
  * @fileoverview added by tsickle
@@ -5670,10 +5686,10 @@
5670
5686
  function (next, previous) {
5671
5687
  _this.pushVisitChangesToRoute(next, previous);
5672
5688
  }), {
5673
- unless: _this.placeRouter.navigationSessionActive
5689
+ unless: _this.placeRouter.navigationInProgress
5674
5690
  });
5675
5691
  chain(_this._activePlace)
5676
- .postponeWhile(placeRouter.navigationSessionActive)
5692
+ .postponeWhile(placeRouter.navigationInProgress)
5677
5693
  .subscribe((/**
5678
5694
  * @param {?} place
5679
5695
  * @return {?}
@@ -5903,7 +5919,7 @@
5903
5919
  /** @nocollapse */
5904
5920
  PlaceOutletComponent.ctorParameters = function () { return [
5905
5921
  { type: router.Router },
5906
- { type: exports.ɵt },
5922
+ { type: PlaceRouter },
5907
5923
  { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [AUP_PLACE_CONFIG,] }] },
5908
5924
  { type: PlaceOutletComponent, decorators: [{ type: core.SkipSelf }, { type: core.Optional }] }
5909
5925
  ]; };
@@ -6735,6 +6751,225 @@
6735
6751
  ActivityOutletContext.prototype.componentReady = function (component) { };
6736
6752
  }
6737
6753
 
6754
+ /**
6755
+ * @fileoverview added by tsickle
6756
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6757
+ */
6758
+ var DialogInteractionContext = /** @class */ (function (_super) {
6759
+ __extends(DialogInteractionContext, _super);
6760
+ function DialogInteractionContext(dialogService, config) {
6761
+ var _this = _super.call(this) || this;
6762
+ _this.dialogService = dialogService;
6763
+ _this.config = config;
6764
+ _this._activeModel = new pectin.MutableValueModel(false);
6765
+ typescriptUtilities.assert.notNil(dialogService);
6766
+ _this.onDispose((/**
6767
+ * @return {?}
6768
+ */
6769
+ function () {
6770
+ if (_this.isActive()) {
6771
+ pectin.lang.illegalState('Dispose called while active.');
6772
+ }
6773
+ }));
6774
+ return _this;
6775
+ }
6776
+ Object.defineProperty(DialogInteractionContext.prototype, "active", {
6777
+ get: /**
6778
+ * @return {?}
6779
+ */
6780
+ function () {
6781
+ return this._activeModel.readonly;
6782
+ },
6783
+ enumerable: true,
6784
+ configurable: true
6785
+ });
6786
+ /**
6787
+ * @protected
6788
+ * @template D, R, E
6789
+ * @param {?} activityType
6790
+ * @param {?} data
6791
+ * @param {?=} disableClose
6792
+ * @return {?}
6793
+ */
6794
+ DialogInteractionContext.prototype._startActivity = /**
6795
+ * @protected
6796
+ * @template D, R, E
6797
+ * @param {?} activityType
6798
+ * @param {?} data
6799
+ * @param {?=} disableClose
6800
+ * @return {?}
6801
+ */
6802
+ function (activityType, data, disableClose) {
6803
+ var _this = this;
6804
+ if (disableClose === void 0) { disableClose = true; }
6805
+ if (this.isActive()) {
6806
+ pectin.lang.illegalState("Activity already in progress: " + this.activityList.value.map((/**
6807
+ * @param {?} a
6808
+ * @return {?}
6809
+ */
6810
+ function (a) { return a.constructor.name; })).join(', '));
6811
+ }
6812
+ this._activeModel.value = true;
6813
+ /** @type {?} */
6814
+ var config = __assign({}, this.config, {
6815
+ data: data,
6816
+ disableClose: disableClose,
6817
+ panelClass: 'dialog-interaction-context'
6818
+ });
6819
+ /** @type {?} */
6820
+ var self = this;
6821
+ /** @type {?} */
6822
+ var matDialogRef = (/** @type {?} */ (this.dialogService.open(ActivityContainerComponent, config)));
6823
+ return new Promise((/**
6824
+ * @param {?} resolve
6825
+ * @param {?} reject
6826
+ * @return {?}
6827
+ */
6828
+ function (resolve, reject) {
6829
+ /** @type {?} */
6830
+ var activityContainer = matDialogRef.componentInstance;
6831
+ self.safelyUpdateActivityListDelegate(activityContainer.activityList);
6832
+ activityContainer.initialActivityOutletContext = {
6833
+ activityClass: activityType,
6834
+ activityData: data,
6835
+ onDone: /**
6836
+ * @param {?} result
6837
+ * @return {?}
6838
+ */
6839
+ function (result) {
6840
+ resolve(result);
6841
+ matDialogRef.close(true); // return true to let the after close listener know we've already handled it.
6842
+ },
6843
+ onCancel: /**
6844
+ * @param {?} error
6845
+ * @return {?}
6846
+ */
6847
+ function (error) {
6848
+ reject(error);
6849
+ matDialogRef.close(true); // return true to let the after close listener know we've already handled it.
6850
+ }
6851
+ };
6852
+ // we need to check if our onDone/onCancel methods above we called or if we were
6853
+ // closed by the user clicking the backdrop. If the later then we need to reject
6854
+ // our promise.
6855
+ matDialogRef.afterClosed().subscribe((/**
6856
+ * @param {?} promiseAlreadyFinished
6857
+ * @return {?}
6858
+ */
6859
+ function (promiseAlreadyFinished) {
6860
+ if (!promiseAlreadyFinished) {
6861
+ reject('auto-closed');
6862
+ }
6863
+ }));
6864
+ matDialogRef.updateSize();
6865
+ matDialogRef.afterOpened().subscribe((/**
6866
+ * @param {?} promiseAlreadyFinished
6867
+ * @return {?}
6868
+ */
6869
+ function (promiseAlreadyFinished) {
6870
+ matDialogRef.updateSize();
6871
+ }));
6872
+ })).finally((/**
6873
+ * @return {?}
6874
+ */
6875
+ function () {
6876
+ self.safelyUpdateActivityListDelegate(null);
6877
+ _this._activeModel.value = false;
6878
+ }));
6879
+ };
6880
+ /**
6881
+ * Updates teh delegate on the next tick to avoid modifying state during the current change detection cycle.
6882
+ * @param delegate
6883
+ */
6884
+ /**
6885
+ * Updates teh delegate on the next tick to avoid modifying state during the current change detection cycle.
6886
+ * @param {?} delegate
6887
+ * @return {?}
6888
+ */
6889
+ DialogInteractionContext.prototype.safelyUpdateActivityListDelegate = /**
6890
+ * Updates teh delegate on the next tick to avoid modifying state during the current change detection cycle.
6891
+ * @param {?} delegate
6892
+ * @return {?}
6893
+ */
6894
+ function (delegate) {
6895
+ var _this = this;
6896
+ setTimeout((/**
6897
+ * @return {?}
6898
+ */
6899
+ function () { return _this.setActivityList(delegate); }));
6900
+ };
6901
+ return DialogInteractionContext;
6902
+ }(InteractionContextBase));
6903
+ if (false) {
6904
+ /**
6905
+ * @type {?}
6906
+ * @private
6907
+ */
6908
+ DialogInteractionContext.prototype._activeModel;
6909
+ /**
6910
+ * @type {?}
6911
+ * @private
6912
+ */
6913
+ DialogInteractionContext.prototype.dialogService;
6914
+ /** @type {?} */
6915
+ DialogInteractionContext.prototype.config;
6916
+ }
6917
+
6918
+ /**
6919
+ * @fileoverview added by tsickle
6920
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6921
+ */
6922
+ /** @type {?} */
6923
+ var DIALOG_INTERACTION_SERVICE_DEFAULTS = new core.InjectionToken('DIALOG_INTERACTION_SERVICE_DEFAULTS');
6924
+ var DialogInteractionContextFactory = /** @class */ (function (_super) {
6925
+ __extends(DialogInteractionContextFactory, _super);
6926
+ function DialogInteractionContextFactory(dialogService, dialogServiceDefaults, matDialogDefaultConfig) {
6927
+ var _this = _super.call(this) || this;
6928
+ _this.dialogService = dialogService;
6929
+ _this.dialogServiceDefaults = dialogServiceDefaults;
6930
+ _this.matDialogDefaultConfig = matDialogDefaultConfig;
6931
+ typescriptUtilities.assert.notNil(dialogService);
6932
+ return _this;
6933
+ }
6934
+ /**
6935
+ * @return {?}
6936
+ */
6937
+ DialogInteractionContextFactory.prototype.createInteractionContext = /**
6938
+ * @return {?}
6939
+ */
6940
+ function () {
6941
+ /** @type {?} */
6942
+ var config = __assign({ autoFocus: false, hasBackdrop: true, closeOnNavigation: false }, this.matDialogDefaultConfig, this.dialogServiceDefaults);
6943
+ return new DialogInteractionContext(this.dialogService, config);
6944
+ };
6945
+ DialogInteractionContextFactory.decorators = [
6946
+ { type: core.Injectable, args: [{
6947
+ providedIn: 'root'
6948
+ },] }
6949
+ ];
6950
+ /** @nocollapse */
6951
+ DialogInteractionContextFactory.ctorParameters = function () { return [
6952
+ { type: material.MatDialog },
6953
+ { type: dialog.MatDialogConfig, decorators: [{ type: core.Optional }, { type: core.Inject, args: [DIALOG_INTERACTION_SERVICE_DEFAULTS,] }] },
6954
+ { type: dialog.MatDialogConfig, decorators: [{ type: core.Optional }, { type: core.Inject, args: [dialog.MAT_DIALOG_DEFAULT_OPTIONS,] }] }
6955
+ ]; };
6956
+ /** @nocollapse */ DialogInteractionContextFactory.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function DialogInteractionContextFactory_Factory() { return new DialogInteractionContextFactory(core.ɵɵinject(dialog.MatDialog), core.ɵɵinject(DIALOG_INTERACTION_SERVICE_DEFAULTS, 8), core.ɵɵinject(dialog.MAT_DIALOG_DEFAULT_OPTIONS, 8)); }, token: DialogInteractionContextFactory, providedIn: "root" });
6957
+ return DialogInteractionContextFactory;
6958
+ }(ModalInteractionContextFactory));
6959
+ if (false) {
6960
+ /** @type {?} */
6961
+ DialogInteractionContextFactory.prototype.active;
6962
+ /**
6963
+ * @type {?}
6964
+ * @private
6965
+ */
6966
+ DialogInteractionContextFactory.prototype.dialogService;
6967
+ /** @type {?} */
6968
+ DialogInteractionContextFactory.prototype.dialogServiceDefaults;
6969
+ /** @type {?} */
6970
+ DialogInteractionContextFactory.prototype.matDialogDefaultConfig;
6971
+ }
6972
+
6738
6973
  /**
6739
6974
  * @fileoverview added by tsickle
6740
6975
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -7109,16 +7344,16 @@
7109
7344
  // Parse our route params.
7110
7345
  params = new ConsolidatedParameterMap(activatedRoute.paramMap, activatedRoute.url);
7111
7346
  parsedParams = placeDefinition.parseRouteParams(params);
7112
- initialVisit = this.placeRouter.navigationSession.getVisitFor(placeDefinition) || new Visit(placeDefinition, parsedParams);
7347
+ initialVisit = this.placeRouter.navigationState.getVisitFor(placeDefinition) || new Visit(placeDefinition, parsedParams);
7113
7348
  sanitiser = new VisitSanitiser(activatedRoute, this.router, this.placeHistory, this.injector);
7114
7349
  return [4 /*yield*/, sanitiser.sanitise(initialVisit.mergeRouteParameters(parsedParams))];
7115
7350
  case 1:
7116
7351
  sanitisedVisit = _a.sent();
7117
7352
  // Save the visit with any updated parameters. We need to save it so we remember any non route parameters
7118
- this.placeRouter.navigationSession.storeVisit(sanitisedVisit);
7353
+ this.placeRouter.navigationState.storeVisit(sanitisedVisit);
7119
7354
  if (initialVisit.hasRoutingChangedFrom(sanitisedVisit)) {
7120
7355
  // Regenerate the url
7121
- commands = this.placeRouter.parseUrl(state).createRedirectCommandsFor(sanitisedVisit);
7356
+ commands = this.placeRouter.parseUrl(state.url).createRedirectCommandsFor(sanitisedVisit);
7122
7357
  console.log('##### Place Guard Redirect', commands);
7123
7358
  return [2 /*return*/, this.router.createUrlTree(commands, {
7124
7359
  replaceUrl: true,
@@ -7152,7 +7387,7 @@
7152
7387
  function (component, currentRoute, currentState, nextState) {
7153
7388
  return __awaiter(this, void 0, void 0, function () {
7154
7389
  return __generator(this, function (_a) {
7155
- return [2 /*return*/, this.placeRouter.navigationSession.canDeactivatePlace(component, this.placeRouter.parseUrl(nextState))];
7390
+ return [2 /*return*/, this.placeRouter.navigationState.canDeactivatePlace(component, this.placeRouter.parseUrl(nextState.url))];
7156
7391
  });
7157
7392
  });
7158
7393
  };
@@ -7162,7 +7397,7 @@
7162
7397
  * @protected
7163
7398
  * @param {?} activatedRoute
7164
7399
  * @param {?} state
7165
- * @param {?} canActivate
7400
+ * @param {?} runPlaceGuards
7166
7401
  * @return {?}
7167
7402
  */
7168
7403
  AbstractPlaceGuard.prototype.authorisePlaceThen =
@@ -7171,12 +7406,12 @@
7171
7406
  * @protected
7172
7407
  * @param {?} activatedRoute
7173
7408
  * @param {?} state
7174
- * @param {?} canActivate
7409
+ * @param {?} runPlaceGuards
7175
7410
  * @return {?}
7176
7411
  */
7177
- function (activatedRoute, state, canActivate) {
7412
+ function (activatedRoute, state, runPlaceGuards) {
7178
7413
  return __awaiter(this, void 0, void 0, function () {
7179
- var placeDefinition, authorised, _a;
7414
+ var placeDefinition, authoriseResult, _a;
7180
7415
  return __generator(this, function (_b) {
7181
7416
  switch (_b.label) {
7182
7417
  case 0:
@@ -7191,13 +7426,14 @@
7191
7426
  _a = true;
7192
7427
  _b.label = 3;
7193
7428
  case 3:
7194
- authorised = _a;
7195
- if (authorised === true) {
7196
- return [2 /*return*/, canActivate(placeDefinition)];
7429
+ authoriseResult = _a;
7430
+ if (authoriseResult === true) {
7431
+ // we're authorised, now run the place guards.
7432
+ return [2 /*return*/, runPlaceGuards(placeDefinition)];
7197
7433
  }
7198
7434
  else {
7199
- console.log('not authorised result', authorised);
7200
- return [2 /*return*/, authorised];
7435
+ console.log('not authorised result', authoriseResult);
7436
+ return [2 /*return*/, authoriseResult];
7201
7437
  }
7202
7438
  return [3 /*break*/, 5];
7203
7439
  case 4: return [2 /*return*/, pectin.lang.illegalState("expected component to be an instance of PlaceComponent, got " + activatedRoute.component)];
@@ -7272,12 +7508,12 @@
7272
7508
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7273
7509
  */
7274
7510
  var InteractionGuard = /** @class */ (function () {
7275
- function InteractionGuard(router, injector, placeRouter, angularLocation, modalInteractionService) {
7511
+ function InteractionGuard(router, injector, placeRouter, angularLocation, interactionService) {
7276
7512
  this.router = router;
7277
7513
  this.injector = injector;
7278
7514
  this.placeRouter = placeRouter;
7279
7515
  this.angularLocation = angularLocation;
7280
- this.modalInteractionService = modalInteractionService;
7516
+ this.interactionService = interactionService;
7281
7517
  }
7282
7518
  /**
7283
7519
  * @param {?} route
@@ -7292,10 +7528,10 @@
7292
7528
  function (route, state) {
7293
7529
  /** @type {?} */
7294
7530
  var url = this.router.parseUrl(state.url);
7295
- if (!this.modalInteractionService.isActive() && url.root.children[exports.ɵt.INTERACTION_ROUTER_OUTLET]) {
7531
+ if (!this.interactionService.isActive() && url.root.children[exports.UrlSnapshot.INTERACTION_ROUTER_OUTLET]) {
7296
7532
  // This happens if we reload the page or the url was pasted as the route should only be activated
7297
7533
  // after the interaction context has become active.
7298
- delete url.root.children[exports.ɵt.INTERACTION_ROUTER_OUTLET];
7534
+ delete url.root.children[exports.UrlSnapshot.INTERACTION_ROUTER_OUTLET];
7299
7535
  return url;
7300
7536
  }
7301
7537
  else {
@@ -7318,20 +7554,26 @@
7318
7554
  */
7319
7555
  function (component, currentRoute, currentState, nextState) {
7320
7556
  return __awaiter(this, void 0, void 0, function () {
7321
- var popstateReturnUrl, activity;
7557
+ var currentIds, routeIds, activity;
7322
7558
  return __generator(this, function (_a) {
7323
7559
  switch (_a.label) {
7324
7560
  case 0:
7325
- popstateReturnUrl = this.placeRouter.navigationSession.startingUrl;
7326
- if (!this.modalInteractionService.isActive()) return [3 /*break*/, 2];
7561
+ if (!this.interactionService.isActive()) return [3 /*break*/, 2];
7562
+ currentIds = this.interactionService.activeInteractionContextIds.value;
7563
+ routeIds = this.placeRouter.getActiveInteractionIdsFromUrl(nextState.url);
7564
+ if (!!___default.isEqual(currentIds, routeIds)) return [3 /*break*/, 2];
7327
7565
  // The activity is still active so the route change was triggered by the back button.
7328
- return [4 /*yield*/, this.modalInteractionService.getCurrentActivity()];
7566
+ return [4 /*yield*/, this.interactionService.getCurrentActivity()];
7329
7567
  case 1:
7330
7568
  activity = _a.sent();
7331
7569
  activity.cancel();
7332
- // See ModalInteractionSession#onStart() for the url updating.
7333
- return [2 /*return*/, false];
7334
- case 2: return [2 /*return*/, true];
7570
+ _a.label = 2;
7571
+ case 2:
7572
+ // IMPORTANT:
7573
+ // We always return true, the router state engine will redirect as required. Return false
7574
+ // during the guard causes all kinds of grief. It might be worth trying a redirect here
7575
+ // again now that our state engine is more thorough.
7576
+ return [2 /*return*/, true];
7335
7577
  }
7336
7578
  });
7337
7579
  });
@@ -7345,11 +7587,11 @@
7345
7587
  InteractionGuard.ctorParameters = function () { return [
7346
7588
  { type: router.Router },
7347
7589
  { type: core.Injector },
7348
- { type: exports.ɵt },
7590
+ { type: PlaceRouter },
7349
7591
  { type: common.Location },
7350
- { type: ModalInteractionService }
7592
+ { type: exports.ɵv }
7351
7593
  ]; };
7352
- /** @nocollapse */ InteractionGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function InteractionGuard_Factory() { return new InteractionGuard(core.ɵɵinject(router.Router), core.ɵɵinject(core.INJECTOR), core.ɵɵinject(exports.ɵt), core.ɵɵinject(common.Location), core.ɵɵinject(ModalInteractionService)); }, token: InteractionGuard, providedIn: "root" });
7594
+ /** @nocollapse */ InteractionGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function InteractionGuard_Factory() { return new InteractionGuard(core.ɵɵinject(router.Router), core.ɵɵinject(core.INJECTOR), core.ɵɵinject(PlaceRouter), core.ɵɵinject(common.Location), core.ɵɵinject(exports.ɵv)); }, token: InteractionGuard, providedIn: "root" });
7353
7595
  return InteractionGuard;
7354
7596
  }());
7355
7597
  if (false) {
@@ -7377,7 +7619,7 @@
7377
7619
  * @type {?}
7378
7620
  * @private
7379
7621
  */
7380
- InteractionGuard.prototype.modalInteractionService;
7622
+ InteractionGuard.prototype.interactionService;
7381
7623
  }
7382
7624
 
7383
7625
  /**
@@ -7681,7 +7923,7 @@
7681
7923
  exports.AbstractInputComponent = AbstractInputComponent;
7682
7924
  exports.AbstractPlaceGuard = AbstractPlaceGuard;
7683
7925
  exports.AbstractPlaceNavigationComponent = AbstractPlaceNavigationComponent;
7684
- exports.Activity = exports.ɵbh;
7926
+ exports.Activity = exports.ɵbi;
7685
7927
  exports.ActivityContainerComponent = ActivityContainerComponent;
7686
7928
  exports.ActivityOutletComponent = ActivityOutletComponent;
7687
7929
  exports.AlertDialogComponent = AlertDialogComponent;
@@ -7689,27 +7931,28 @@
7689
7931
  exports.BusyOverlayComponent = BusyOverlayComponent;
7690
7932
  exports.CommandDirective = CommandDirective;
7691
7933
  exports.ComponentsModule = ComponentsModule;
7692
- exports.ConfirmThenDialogComponent = exports.ɵbj;
7934
+ exports.ConfirmThenDialogComponent = exports.ɵbk;
7693
7935
  exports.ConfirmationDialogComponent = ConfirmationDialogComponent;
7694
7936
  exports.ConsolidatedParameterMap = ConsolidatedParameterMap;
7695
7937
  exports.DEFINITION_META_DATA_KEY = DEFINITION_META_DATA_KEY;
7696
7938
  exports.DIALOG_INTERACTION_SERVICE_DEFAULTS = DIALOG_INTERACTION_SERVICE_DEFAULTS;
7697
7939
  exports.DialogInteractionContext = DialogInteractionContext;
7698
- exports.DialogInteractionService = DialogInteractionService;
7940
+ exports.DialogInteractionContextFactory = DialogInteractionContextFactory;
7699
7941
  exports.Dimension = Dimension;
7700
7942
  exports.DirectivesModule = DirectivesModule;
7701
7943
  exports.DisposableComponent = DisposableComponent;
7702
7944
  exports.EmptyStateComponent = EmptyStateComponent;
7703
7945
  exports.FocusBindingDirective = FocusBindingDirective;
7704
7946
  exports.InplaceInteractionContextComponent = InplaceInteractionContextComponent;
7705
- exports.InteractionContext = exports.ɵbc;
7947
+ exports.InteractionContext = InteractionContext;
7706
7948
  exports.InteractionContextBase = InteractionContextBase;
7707
7949
  exports.InteractionGuard = InteractionGuard;
7708
7950
  exports.InteractionModule = InteractionModule;
7709
7951
  exports.InteractionOutletComponent = InteractionOutletComponent;
7952
+ exports.InteractionService = exports.ɵv;
7710
7953
  exports.LEFT_RIGHT_PLACE_ANIMATION = LEFT_RIGHT_PLACE_ANIMATION;
7711
7954
  exports.ListPlaceNavComponent = ListPlaceNavComponent;
7712
- exports.ModalInteractionService = ModalInteractionService;
7955
+ exports.ModalInteractionContextFactory = ModalInteractionContextFactory;
7713
7956
  exports.NoopAuthGuard = NoopAuthGuard;
7714
7957
  exports.NoopComponent = NoopComponent;
7715
7958
  exports.NumberInputComponent = NumberInputComponent;
@@ -7719,7 +7962,7 @@
7719
7962
  exports.PlaceHistory = PlaceHistory;
7720
7963
  exports.PlaceModule = PlaceModule;
7721
7964
  exports.PlaceOutletComponent = PlaceOutletComponent;
7722
- exports.PlaceRouter = exports.ɵt;
7965
+ exports.PlaceRouter = PlaceRouter;
7723
7966
  exports.Point = Point;
7724
7967
  exports.ROUTE_PARAMETER_LIST_KEY = ROUTE_PARAMETER_LIST_KEY;
7725
7968
  exports.ResizeAwareComponent = ResizeAwareComponent;
@@ -7727,7 +7970,6 @@
7727
7970
  exports.SelectInputComponent = SelectInputComponent;
7728
7971
  exports.StringInputComponent = StringInputComponent;
7729
7972
  exports.TabbedPlaceNavigationComponent = TabbedPlaceNavigationComponent;
7730
- exports.UrlSnapshot = UrlSnapshot;
7731
7973
  exports.Visit = Visit;
7732
7974
  exports.VisitParameter = VisitParameter;
7733
7975
  exports.VisitParameterList = VisitParameterList;
@@ -7736,17 +7978,17 @@
7736
7978
  exports.slideDownAndUpAnimation = slideDownAndUpAnimation;
7737
7979
  exports.ɵa = DirectivesModule;
7738
7980
  exports.ɵb = CommandDirective;
7739
- exports.ɵba = ActivityContainerComponent;
7740
- exports.ɵbb = InteractionContextBase;
7741
- exports.ɵbd = ActivityOutletComponent;
7742
- exports.ɵbe = ConfirmationDialogComponent;
7743
- exports.ɵbf = AbstractActivity;
7744
- exports.ɵbg = ACTIVITY_DATA;
7745
- exports.ɵbk = AlertDialogComponent;
7746
- exports.ɵbm = InteractionOutletComponent;
7747
- exports.ɵbn = InplaceInteractionContextComponent;
7748
- exports.ɵbo = DIALOG_INTERACTION_SERVICE_DEFAULTS;
7749
- exports.ɵbp = DialogInteractionService;
7981
+ exports.ɵba = InteractionModule;
7982
+ exports.ɵbb = ActivityContainerComponent;
7983
+ exports.ɵbc = InteractionContextBase;
7984
+ exports.ɵbd = InteractionContext;
7985
+ exports.ɵbe = ActivityOutletComponent;
7986
+ exports.ɵbf = ConfirmationDialogComponent;
7987
+ exports.ɵbg = AbstractActivity;
7988
+ exports.ɵbh = ACTIVITY_DATA;
7989
+ exports.ɵbl = AlertDialogComponent;
7990
+ exports.ɵbn = InteractionOutletComponent;
7991
+ exports.ɵbo = InplaceInteractionContextComponent;
7750
7992
  exports.ɵc = FocusBindingDirective;
7751
7993
  exports.ɵd = DisposableComponent;
7752
7994
  exports.ɵe = ComponentsModule;
@@ -7763,12 +8005,12 @@
7763
8005
  exports.ɵp = leftRightPlaceAnimation;
7764
8006
  exports.ɵq = LEFT_RIGHT_PLACE_ANIMATION;
7765
8007
  exports.ɵr = AUP_PLACE_CONFIG;
8008
+ exports.ɵt = PlaceRouter;
7766
8009
  exports.ɵu = PlaceHistory;
7767
- exports.ɵv = ModalInteractionService;
7768
- exports.ɵw = TabbedPlaceNavigationComponent;
7769
- exports.ɵx = AbstractPlaceNavigationComponent;
7770
- exports.ɵy = ListPlaceNavComponent;
7771
- exports.ɵz = InteractionModule;
8010
+ exports.ɵw = ModalInteractionContextFactory;
8011
+ exports.ɵx = TabbedPlaceNavigationComponent;
8012
+ exports.ɵy = AbstractPlaceNavigationComponent;
8013
+ exports.ɵz = ListPlaceNavComponent;
7772
8014
 
7773
8015
  Object.defineProperty(exports, '__esModule', { value: true });
7774
8016