@coolon/angular-ui-powerups 0.0.66 → 0.0.68

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 (121) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +2207 -1737
  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 +24 -22
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/coolon-angular-ui-powerups.js +24 -22
  8. package/esm2015/index.js +2 -2
  9. package/esm2015/lib/angular-ui-powerups.module.js +6 -3
  10. package/esm2015/lib/components/index.js +2 -1
  11. package/esm2015/lib/components/noop/noop.component.js +19 -0
  12. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +2 -2
  13. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +2 -2
  14. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +2 -2
  15. package/esm2015/lib/interaction/components/interaction-outlet/interaction-outlet.component.js +19 -0
  16. package/esm2015/lib/interaction/guards/interaction-guard.service.js +85 -0
  17. package/esm2015/lib/interaction/index.js +3 -2
  18. package/esm2015/lib/interaction/interaction.module.js +8 -3
  19. package/esm2015/lib/interaction/services/dialog-interaction.service.js +30 -5
  20. package/esm2015/lib/place/components/abstract-place-navigation.component.js +5 -5
  21. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js +2 -2
  22. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +60 -66
  23. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +2 -2
  24. package/esm2015/lib/place/index.js +9 -8
  25. package/esm2015/lib/place/navigation-session.js +147 -0
  26. package/esm2015/lib/place/place-component.js +18 -14
  27. package/esm2015/lib/place/place-definition.js +197 -5
  28. package/esm2015/lib/place/place-history.js +3 -2
  29. package/esm2015/lib/place/place-router.js +186 -89
  30. package/esm2015/lib/place/route/formatter.js +63 -0
  31. package/esm2015/lib/place/route/guards/leave-place.guard.js +193 -0
  32. package/esm2015/lib/place/route/guards/place-route.guard.js +243 -0
  33. package/esm2015/lib/place/route/parameter-decorators.js +35 -18
  34. package/esm2015/lib/place/route/parameter-definition.class.js +123 -67
  35. package/esm2015/lib/place/route/parameter-sanitiser.js +4 -3
  36. package/esm2015/lib/place/route/parameter-snapshot.js +11 -388
  37. package/esm2015/lib/place/route/visit-sanitiser.js +88 -0
  38. package/esm2015/lib/place/visit.js +107 -8
  39. package/esm2015/public_api.js +4 -4
  40. package/esm5/coolon-angular-ui-powerups.js +24 -22
  41. package/esm5/index.js +2 -2
  42. package/esm5/lib/angular-ui-powerups.module.js +6 -3
  43. package/esm5/lib/components/index.js +2 -1
  44. package/esm5/lib/components/noop/noop.component.js +21 -0
  45. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +2 -2
  46. package/esm5/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +2 -2
  47. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +2 -2
  48. package/esm5/lib/interaction/components/interaction-outlet/interaction-outlet.component.js +21 -0
  49. package/esm5/lib/interaction/guards/interaction-guard.service.js +94 -0
  50. package/esm5/lib/interaction/index.js +3 -2
  51. package/esm5/lib/interaction/interaction.module.js +8 -3
  52. package/esm5/lib/interaction/services/dialog-interaction.service.js +28 -5
  53. package/esm5/lib/place/components/abstract-place-navigation.component.js +5 -5
  54. package/esm5/lib/place/components/list-place-nav/list-place-nav.component.js +2 -2
  55. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +70 -82
  56. package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +2 -2
  57. package/esm5/lib/place/index.js +9 -8
  58. package/esm5/lib/place/navigation-session.js +193 -0
  59. package/esm5/lib/place/place-component.js +19 -15
  60. package/esm5/lib/place/place-definition.js +253 -5
  61. package/esm5/lib/place/place-history.js +7 -3
  62. package/esm5/lib/place/place-router.js +242 -107
  63. package/esm5/lib/place/route/formatter.js +96 -0
  64. package/esm5/lib/place/route/guards/leave-place.guard.js +152 -0
  65. package/esm5/lib/place/route/guards/place-route.guard.js +273 -0
  66. package/esm5/lib/place/route/parameter-decorators.js +35 -18
  67. package/esm5/lib/place/route/parameter-definition.class.js +179 -76
  68. package/esm5/lib/place/route/parameter-sanitiser.js +4 -3
  69. package/esm5/lib/place/route/parameter-snapshot.js +11 -480
  70. package/esm5/lib/place/route/visit-sanitiser.js +99 -0
  71. package/esm5/lib/place/visit.js +160 -8
  72. package/esm5/public_api.js +4 -4
  73. package/fesm2015/coolon-angular-ui-powerups.js +1493 -1124
  74. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  75. package/fesm5/coolon-angular-ui-powerups.js +2166 -1700
  76. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  77. package/lib/components/index.d.ts +1 -0
  78. package/lib/components/noop/noop.component.d.ts +3 -0
  79. package/lib/interaction/components/interaction-outlet/interaction-outlet.component.d.ts +3 -0
  80. package/lib/interaction/guards/interaction-guard.service.d.ts +13 -0
  81. package/lib/interaction/index.d.ts +2 -1
  82. package/lib/interaction/services/dialog-interaction.service.d.ts +5 -1
  83. package/lib/place/components/place-outlet/place-outlet.component.d.ts +12 -12
  84. package/lib/place/index.d.ts +5 -4
  85. package/lib/place/navigation-session.d.ts +26 -0
  86. package/lib/place/place-component.d.ts +3 -3
  87. package/lib/place/place-definition.d.ts +30 -3
  88. package/lib/place/place-history.d.ts +3 -3
  89. package/lib/place/place-router.d.ts +26 -19
  90. package/lib/place/route/{parameter-type.d.ts → formatter.d.ts} +5 -5
  91. package/lib/place/{guards → route/guards}/leave-place.guard.d.ts +4 -3
  92. package/lib/place/route/guards/place-route.guard.d.ts +27 -0
  93. package/lib/place/route/parameter-decorators.d.ts +14 -6
  94. package/lib/place/route/parameter-definition.class.d.ts +21 -17
  95. package/lib/place/route/parameter-sanitiser.d.ts +3 -2
  96. package/lib/place/route/parameter-snapshot.d.ts +4 -26
  97. package/lib/place/route/visit-sanitiser.d.ts +12 -0
  98. package/lib/place/visit.d.ts +24 -3
  99. package/package.json +1 -1
  100. package/schematics/place-routes/place-class-scanner.d.ts +2 -2
  101. package/schematics/place-routes/place-class-scanner.js +7 -7
  102. package/schematics/place-routes/place-class-scanner.js.map +1 -1
  103. package/schematics/place-routes/place-def.d.ts +3 -2
  104. package/schematics/place-routes/place-def.js +21 -12
  105. package/schematics/place-routes/place-def.js.map +1 -1
  106. package/schematics/place-routes/templates/place-destinations.ts.template +5 -3
  107. package/schematics/place-routes/templates/place-routes.ts.template +10 -1
  108. package/schematics/place-routes/templates/place-visits.ts.template +21 -0
  109. package/esm2015/lib/interaction/guards/close-interaction.guard.js +0 -62
  110. package/esm2015/lib/place/guards/leave-place.guard.js +0 -159
  111. package/esm2015/lib/place/guards/place-route.guard.js +0 -74
  112. package/esm2015/lib/place/route/parameter-type.js +0 -61
  113. package/esm2015/lib/place/route/route-parameter-value.js +0 -230
  114. package/esm5/lib/interaction/guards/close-interaction.guard.js +0 -66
  115. package/esm5/lib/place/guards/leave-place.guard.js +0 -117
  116. package/esm5/lib/place/guards/place-route.guard.js +0 -78
  117. package/esm5/lib/place/route/parameter-type.js +0 -94
  118. package/esm5/lib/place/route/route-parameter-value.js +0 -316
  119. package/lib/interaction/guards/close-interaction.guard.d.ts +0 -12
  120. package/lib/place/guards/place-route.guard.d.ts +0 -10
  121. package/lib/place/route/route-parameter-value.d.ts +0 -42
@@ -1,22 +1,22 @@
1
- import { DOCUMENT, CommonModule, Location } from '@angular/common';
1
+ import { DOCUMENT, Location, CommonModule } from '@angular/common';
2
2
  import { EventEmitter, Input, Output, HostListener, Component, Directive, ElementRef, Inject, NgZone, InjectionToken, Injector, ComponentFactoryResolver, ViewContainerRef, ViewChild, ViewChildren, Injectable, Optional, ɵɵdefineInjectable, ɵɵinject, NgModule, HostBinding, INJECTOR } from '@angular/core';
3
3
  import { FormsModule } from '@angular/forms';
4
4
  import { MatDialog, MatButtonModule, MatDialogModule, MatTabsModule, MatProgressSpinnerModule, MatInputModule, MatFormFieldModule, MatSelectModule } from '@angular/material';
5
5
  import { MatTabsModule as MatTabsModule$1 } from '@angular/material/tabs';
6
6
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
7
7
  import { __extends, __decorate, __metadata, __assign, __awaiter, __generator } from 'tslib';
8
- import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, assert, UnaryCommand, lang, Dsl, Logger, DelegatingValueModel, MutableStream, MutableListModel, DelegatingListModel, StoreInValueModel, Binding, MutableValueModel, Guard as Guard$1, OptionsHelper, ValueHolder } from '@coolon/pectin';
8
+ import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, assert, UnaryCommand, lang, Dsl, Logger, DelegatingValueModel, MutableStream, MutableListModel, DelegatingListModel, StoreInValueModel, Binding, MutableValueModel, Trace, Guard as Guard$1, OptionsHelper, ValueHolder } from '@coolon/pectin';
9
9
  import { PortalModule } from '@angular/cdk/portal';
10
- import ___default, { last, isNil } from 'lodash';
11
- import { assert as assert$1, Klass, Opts } from '@coolon/typescript-utilities';
10
+ import { Router, RouterModule, NavigationStart, NavigationEnd, NavigationError, ActivatedRoute, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
11
+ import ___default, { last, isNil, isEqual } from 'lodash';
12
+ import { assert as assert$1, Opts, Klass } from '@coolon/typescript-utilities';
12
13
  import { MatDialogConfig, MAT_DIALOG_DEFAULT_OPTIONS, MatDialog as MatDialog$1 } from '@angular/material/dialog';
13
14
  import { v1 } from 'uuid';
14
15
  import { MatIconModule } from '@angular/material/icon';
15
16
  import { MatListModule } from '@angular/material/list';
16
17
  import { MatTooltipModule } from '@angular/material/tooltip';
17
- import { Router, NavigationStart, NavigationEnd, NavigationError, RouterModule } from '@angular/router';
18
- import { Memoize as Memoize$1 } from '@typescript-plus/fast-memoize-decorator/dist/src';
19
- import { Memoize } from '@typescript-plus/fast-memoize-decorator';
18
+ import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
19
+ import { Memoize as Memoize$1 } from '@typescript-plus/fast-memoize-decorator';
20
20
  import 'reflect-metadata';
21
21
  import { style, query, group, animate, trigger, transition } from '@angular/animations';
22
22
  import ResizeObserver from 'resize-observer-polyfill';
@@ -417,6 +417,25 @@ var StringInputComponent = /** @class */ (function (_super) {
417
417
  return StringInputComponent;
418
418
  }(AbstractInputComponent));
419
419
 
420
+ /**
421
+ * @fileoverview added by tsickle
422
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
423
+ */
424
+ var NoopComponent = /** @class */ (function () {
425
+ function NoopComponent() {
426
+ }
427
+ NoopComponent.decorators = [
428
+ { type: Component, args: [{
429
+ selector: 'angular-ui-powerups-noop',
430
+ template: "",
431
+ styles: [":host{display:block}"]
432
+ }] }
433
+ ];
434
+ /** @nocollapse */
435
+ NoopComponent.ctorParameters = function () { return []; };
436
+ return NoopComponent;
437
+ }());
438
+
420
439
  /**
421
440
  * @fileoverview added by tsickle
422
441
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -1176,7 +1195,7 @@ var AlertDialogComponent = /** @class */ (function (_super) {
1176
1195
  AlertDialogComponent.decorators = [
1177
1196
  { type: Component, args: [{
1178
1197
  selector: 'angular-ui-powerups-alert-dialog',
1179
- template: "<h3 matDialogTitle *ngIf=\"alert.title\">{{alert.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of alert.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-raised-button color=\"primary\" (click)=\"done()\">{{alert.ok()}}</button>\n</p>\n",
1198
+ template: "<h3 matDialogTitle *ngIf=\"alert.title\">{{alert.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of alert.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-raised-button color=\"primary\" (click)=\"done()\" data-cy=\"close-button\">{{alert.ok()}}</button>\n</p>\n",
1180
1199
  styles: [":host{display:block;padding:var(--angular-ui-powerups-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1181
1200
  }] }
1182
1201
  ];
@@ -1257,7 +1276,7 @@ var ConfirmThenDialogComponent = /** @class */ (function (_super) {
1257
1276
  ConfirmThenDialogComponent.decorators = [
1258
1277
  { type: Component, args: [{
1259
1278
  selector: 'angular-ui-powerups-confirmation-dialog',
1260
- template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-button (click)=\"cancel()\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"onConfirm()\">{{confirm.ok()}}</button>\n</p>\n\n",
1279
+ template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"onConfirm()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</p>\n\n",
1261
1280
  styles: [":host{display:block;padding:var(--angular-ui-powerups-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1262
1281
  }] }
1263
1282
  ];
@@ -1323,7 +1342,7 @@ var ConfirmationDialogComponent = /** @class */ (function (_super) {
1323
1342
  ConfirmationDialogComponent.decorators = [
1324
1343
  { type: Component, args: [{
1325
1344
  selector: 'angular-ui-powerups-confirmation-dialog',
1326
- template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-button (click)=\"cancel()\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"done()\">{{confirm.ok()}}</button>\n</p>\n\n",
1345
+ template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"done()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</p>\n\n",
1327
1346
  styles: [":host{display:block;padding:var(--angular-ui-powerups-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
1328
1347
  }] }
1329
1348
  ];
@@ -1811,6 +1830,25 @@ if (false) {
1811
1830
  ActivityContainerComponent.prototype._activityList;
1812
1831
  }
1813
1832
 
1833
+ /**
1834
+ * @fileoverview added by tsickle
1835
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1836
+ */
1837
+ var InteractionOutletComponent = /** @class */ (function () {
1838
+ function InteractionOutletComponent() {
1839
+ }
1840
+ InteractionOutletComponent.decorators = [
1841
+ { type: Component, args: [{
1842
+ selector: 'angular-ui-powerups-interaction-outlet',
1843
+ template: "<router-outlet name=\"interaction-context\"></router-outlet>\n",
1844
+ styles: [":host{display:block}"]
1845
+ }] }
1846
+ ];
1847
+ /** @nocollapse */
1848
+ InteractionOutletComponent.ctorParameters = function () { return []; };
1849
+ return InteractionOutletComponent;
1850
+ }());
1851
+
1814
1852
  /**
1815
1853
  * @fileoverview added by tsickle
1816
1854
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -1871,9 +1909,11 @@ var Guard = /** @class */ (function (_super) {
1871
1909
  }(ValueModel));
1872
1910
  var DialogInteractionService = /** @class */ (function (_super) {
1873
1911
  __extends(DialogInteractionService, _super);
1874
- function DialogInteractionService(dialogService, dialogServiceDefaults, matDialogDefaultConfig) {
1912
+ function DialogInteractionService(dialogService, location, router, dialogServiceDefaults, matDialogDefaultConfig) {
1875
1913
  var _this = _super.call(this) || this;
1876
1914
  _this.dialogService = dialogService;
1915
+ _this.location = location;
1916
+ _this.router = router;
1877
1917
  _this.dialogServiceDefaults = dialogServiceDefaults;
1878
1918
  _this.matDialogDefaultConfig = matDialogDefaultConfig;
1879
1919
  _this._activityList = new DelegatingListModel();
@@ -1955,6 +1995,7 @@ var DialogInteractionService = /** @class */ (function (_super) {
1955
1995
  */
1956
1996
  function () {
1957
1997
  _this.currentActivityId = v1();
1998
+ // this.location.go(this.router.routerState.snapshot.url, "aup");
1958
1999
  /** @type {?} */
1959
2000
  var self = _this;
1960
2001
  /** @type {?} */
@@ -1984,7 +2025,7 @@ var DialogInteractionService = /** @class */ (function (_super) {
1984
2025
  */
1985
2026
  function (result) {
1986
2027
  resolve(result);
1987
- matDialogRef.close(result);
2028
+ matDialogRef.close(true); // return true to let the after close listener know we've already handled it.
1988
2029
  },
1989
2030
  onCancel: /**
1990
2031
  * @param {?} error
@@ -1992,9 +2033,18 @@ var DialogInteractionService = /** @class */ (function (_super) {
1992
2033
  */
1993
2034
  function (error) {
1994
2035
  reject(error);
1995
- matDialogRef.close(error);
2036
+ matDialogRef.close(true); // return true to let the after close listener know we've already handled it.
1996
2037
  }
1997
2038
  };
2039
+ matDialogRef.afterClosed().subscribe((/**
2040
+ * @param {?} promiseAlreadyFinished
2041
+ * @return {?}
2042
+ */
2043
+ function (promiseAlreadyFinished) {
2044
+ if (!promiseAlreadyFinished) {
2045
+ reject("auto-closed");
2046
+ }
2047
+ }));
1998
2048
  matDialogRef.updateSize();
1999
2049
  })).finally((/**
2000
2050
  * @return {?}
@@ -2035,6 +2085,7 @@ var DialogInteractionService = /** @class */ (function (_super) {
2035
2085
  * @return {?}
2036
2086
  */
2037
2087
  function (alert) {
2088
+ // TODO: Test disableClose === false
2038
2089
  return this._startActivity(AlertDialogComponent, alert, false);
2039
2090
  };
2040
2091
  /**
@@ -2077,10 +2128,12 @@ var DialogInteractionService = /** @class */ (function (_super) {
2077
2128
  /** @nocollapse */
2078
2129
  DialogInteractionService.ctorParameters = function () { return [
2079
2130
  { type: MatDialog },
2131
+ { type: Location },
2132
+ { type: Router },
2080
2133
  { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [DIALOG_INTERACTION_SERVICE_DEFAULTS,] }] },
2081
2134
  { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DIALOG_DEFAULT_OPTIONS,] }] }
2082
2135
  ]; };
2083
- /** @nocollapse */ DialogInteractionService.ngInjectableDef = ɵɵdefineInjectable({ factory: function DialogInteractionService_Factory() { return new DialogInteractionService(ɵɵinject(MatDialog$1), ɵɵinject(DIALOG_INTERACTION_SERVICE_DEFAULTS, 8), ɵɵinject(MAT_DIALOG_DEFAULT_OPTIONS, 8)); }, token: DialogInteractionService, providedIn: "root" });
2136
+ /** @nocollapse */ DialogInteractionService.ngInjectableDef = ɵɵdefineInjectable({ factory: function DialogInteractionService_Factory() { return new DialogInteractionService(ɵɵinject(MatDialog$1), ɵɵinject(Location), ɵɵinject(Router), ɵɵinject(DIALOG_INTERACTION_SERVICE_DEFAULTS, 8), ɵɵinject(MAT_DIALOG_DEFAULT_OPTIONS, 8)); }, token: DialogInteractionService, providedIn: "root" });
2084
2137
  return DialogInteractionService;
2085
2138
  }(InteractionContext));
2086
2139
  if (false) {
@@ -2105,6 +2158,10 @@ if (false) {
2105
2158
  */
2106
2159
  DialogInteractionService.prototype.dialogService;
2107
2160
  /** @type {?} */
2161
+ DialogInteractionService.prototype.location;
2162
+ /** @type {?} */
2163
+ DialogInteractionService.prototype.router;
2164
+ /** @type {?} */
2108
2165
  DialogInteractionService.prototype.dialogServiceDefaults;
2109
2166
  /** @type {?} */
2110
2167
  DialogInteractionService.prototype.matDialogDefaultConfig;
@@ -2124,18 +2181,21 @@ var InteractionModule = /** @class */ (function () {
2124
2181
  MatButtonModule,
2125
2182
  MatDialogModule,
2126
2183
  MatTabsModule,
2127
- PortalModule
2184
+ PortalModule,
2185
+ RouterModule
2128
2186
  ],
2129
2187
  declarations: [
2130
2188
  ActivityContainerComponent,
2131
2189
  ConfirmationDialogComponent,
2132
2190
  ConfirmThenDialogComponent,
2133
2191
  AlertDialogComponent,
2134
- ActivityOutletComponent
2192
+ ActivityOutletComponent,
2193
+ InteractionOutletComponent
2135
2194
  ],
2136
2195
  exports: [
2137
2196
  ActivityContainerComponent,
2138
2197
  ActivityOutletComponent,
2198
+ InteractionOutletComponent
2139
2199
  ],
2140
2200
  entryComponents: [
2141
2201
  ActivityContainerComponent,
@@ -2227,859 +2287,1020 @@ var EmptyStateComponent = /** @class */ (function () {
2227
2287
  * @fileoverview added by tsickle
2228
2288
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2229
2289
  */
2230
- var PlaceDefinition = /** @class */ (function () {
2231
- function PlaceDefinition(component, path, authenticate, order, data, routeParameters, children) {
2232
- this.component = component;
2233
- this.path = path;
2234
- this.authenticate = authenticate;
2235
- this.order = order;
2236
- this.data = data;
2237
- this.routeParameters = routeParameters;
2238
- this.children = children;
2239
- }
2240
- /**
2241
- * @return {?}
2242
- */
2243
- PlaceDefinition.prototype.getRouteParameters = /**
2244
- * @return {?}
2245
- */
2246
- function () {
2247
- return this.routeParameters;
2248
- };
2249
- /**
2250
- * @template T
2251
- * @param {?} key
2252
- * @param {?=} defaultValue
2253
- * @return {?}
2254
- */
2255
- PlaceDefinition.prototype.getData = /**
2256
- * @template T
2257
- * @param {?} key
2258
- * @param {?=} defaultValue
2259
- * @return {?}
2260
- */
2261
- function (key, defaultValue) {
2262
- return this.data ?
2263
- ___default.isNil(this.data[key]) ? defaultValue : this.data[key] :
2264
- defaultValue;
2265
- };
2266
- /**
2267
- * @template T
2268
- * @param {?} keys
2269
- * @param {?=} defaultValue
2270
- * @return {?}
2271
- */
2272
- PlaceDefinition.prototype.searchData = /**
2273
- * @template T
2274
- * @param {?} keys
2275
- * @param {?=} defaultValue
2276
- * @return {?}
2277
- */
2278
- function (keys, defaultValue) {
2279
- var _this = this;
2280
- if (this.data) {
2281
- /** @type {?} */
2282
- var found = keys.find((/**
2283
- * @param {?} key
2284
- * @return {?}
2285
- */
2286
- function (key) { return !___default.isNil(_this.data[key]); }));
2287
- return found ? this.data[found] : defaultValue;
2288
- }
2289
- else {
2290
- return defaultValue;
2291
- }
2292
- };
2293
- return PlaceDefinition;
2294
- }());
2295
- if (false) {
2296
- /** @type {?} */
2297
- PlaceDefinition.prototype.component;
2298
- /** @type {?} */
2299
- PlaceDefinition.prototype.path;
2300
- /** @type {?} */
2301
- PlaceDefinition.prototype.authenticate;
2302
- /** @type {?} */
2303
- PlaceDefinition.prototype.order;
2304
- /** @type {?} */
2305
- PlaceDefinition.prototype.data;
2306
- /** @type {?} */
2307
- PlaceDefinition.prototype.routeParameters;
2308
- /** @type {?} */
2309
- PlaceDefinition.prototype.children;
2310
- }
2311
-
2312
2290
  /**
2313
- * @fileoverview added by tsickle
2314
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2291
+ * @abstract
2292
+ * @template T, E
2315
2293
  */
2316
- // RAKE: making this Symbol(...) broke things.
2317
- /** @type {?} */
2318
- var DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
2319
- // this one seems ok.
2320
- /** @type {?} */
2321
- var ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
2322
- var PlaceComponent = /** @class */ (function (_super) {
2323
- __extends(PlaceComponent, _super);
2324
- function PlaceComponent() {
2325
- return _super.call(this) || this;
2294
+ var /**
2295
+ * @abstract
2296
+ * @template T, E
2297
+ */
2298
+ ParameterDefinition = /** @class */ (function () {
2299
+ function ParameterDefinition(propertyName, options, urlFormat) {
2300
+ this.propertyName = propertyName;
2301
+ this.urlFormat = urlFormat;
2302
+ this.options = Opts.get(options);
2303
+ this.remember = this.options.getOptional('remember', false);
2304
+ this.defaultValue = this.options.getOptional('defaultValue', null);
2326
2305
  }
2327
- /**
2328
- * @param {?} resolvedParameters
2329
- * @return {?}
2330
- */
2331
- PlaceComponent.prototype.initialiseBindings = /**
2332
- * @param {?} resolvedParameters
2333
- * @return {?}
2334
- */
2335
- function (resolvedParameters) {
2336
- var _this = this;
2337
- assert.isNil(this.resolvedParameters);
2338
- this.resolvedParameters = resolvedParameters;
2339
- this.placeDefinition.getRouteParameters().forEach((/**
2340
- * @param {?} parameterDef
2341
- * @return {?}
2342
- */
2343
- function (parameterDef) {
2344
- _this.installBinding(parameterDef);
2345
- }));
2346
- };
2347
- /**
2348
- * @private
2349
- * @template T, S
2350
- * @param {?} parameterDef
2351
- * @return {?}
2352
- */
2353
- PlaceComponent.prototype.installBinding = /**
2354
- * @private
2355
- * @template T, S
2356
- * @param {?} parameterDef
2357
- * @return {?}
2358
- */
2359
- function (parameterDef) {
2360
- /** @type {?} */
2361
- var model = (/** @type {?} */ (this[parameterDef.propertyName]));
2362
- // this.txo.observe(parameterDef.propertyName, model);
2363
- this.registerDisposable(new Binding(this.resolvedParameters, model, {
2364
- toRight: /**
2365
- * @param {?} parameters
2366
- * @return {?}
2367
- */
2368
- function (parameters) {
2369
- return parameters.getValueOf(parameterDef);
2370
- },
2371
- toLeft: /**
2372
- * @param {?} value
2373
- * @param {?=} currentParameters
2374
- * @return {?}
2375
- */
2376
- function (value, currentParameters) {
2377
- return currentParameters.replace(parameterDef, value);
2378
- }
2379
- }));
2380
- };
2381
- Object.defineProperty(PlaceComponent.prototype, "placeDefinition", {
2306
+ Object.defineProperty(ParameterDefinition.prototype, "name", {
2382
2307
  get: /**
2383
2308
  * @return {?}
2384
2309
  */
2385
2310
  function () {
2386
- return PlaceComponent.getDefinition((/** @type {?} */ ((/** @type {?} */ (this.constructor)))));
2311
+ return this.options.getOptional('as', this.propertyName);
2387
2312
  },
2388
2313
  enumerable: true,
2389
2314
  configurable: true
2390
2315
  });
2391
- Object.defineProperty(PlaceComponent.prototype, "childPlaces", {
2392
- get: /**
2316
+ Object.defineProperty(ParameterDefinition.prototype, "isRouteParameter", {
2317
+ // @Trace()
2318
+ get:
2319
+ // @Trace()
2320
+ /**
2393
2321
  * @return {?}
2394
2322
  */
2395
2323
  function () {
2396
- return this.placeDefinition.children.map((/**
2397
- * @param {?} d
2398
- * @return {?}
2399
- */
2400
- function (d) { return d.component; }));
2324
+ return !!this.urlFormat;
2401
2325
  },
2402
2326
  enumerable: true,
2403
2327
  configurable: true
2404
2328
  });
2405
2329
  /**
2330
+ * @protected
2331
+ * @template K
2332
+ * @param {?} key
2406
2333
  * @return {?}
2407
2334
  */
2408
- PlaceComponent.prototype.canDeactivate = /**
2335
+ ParameterDefinition.prototype.getOptionValue = /**
2336
+ * @protected
2337
+ * @template K
2338
+ * @param {?} key
2409
2339
  * @return {?}
2410
2340
  */
2411
- function () {
2412
- return true;
2341
+ function (key) {
2342
+ return this.options.getOptional(key, null);
2413
2343
  };
2344
+ // @Trace()
2345
+ // @Trace()
2414
2346
  /**
2347
+ * @param {?} value
2348
+ * @param {?} visit
2349
+ * @param {?} placeHistory
2350
+ * @param {?} injector
2415
2351
  * @return {?}
2416
2352
  */
2417
- PlaceComponent.prototype.onPlaceReady = /**
2353
+ ParameterDefinition.prototype.sanitise =
2354
+ // @Trace()
2355
+ /**
2356
+ * @param {?} value
2357
+ * @param {?} visit
2358
+ * @param {?} placeHistory
2359
+ * @param {?} injector
2418
2360
  * @return {?}
2419
2361
  */
2420
- function () {
2362
+ function (value, visit, placeHistory, injector) {
2363
+ return __awaiter(this, void 0, void 0, function () {
2364
+ var previousVisit;
2365
+ return __generator(this, function (_a) {
2366
+ if (this.isMissingFrom(visit)) {
2367
+ previousVisit = ___default.first(placeHistory.getHistory(visit.placeDefinition));
2368
+ if (this.remember && previousVisit) {
2369
+ value = previousVisit.getParameter(this.name);
2370
+ }
2371
+ return [2 /*return*/, this.isEmptyValue(value) ? this.defaultValue : value];
2372
+ }
2373
+ else {
2374
+ // todo: add custom sanitiser
2375
+ return [2 /*return*/, value];
2376
+ }
2377
+ return [2 /*return*/];
2378
+ });
2379
+ });
2421
2380
  };
2422
- __decorate([
2423
- Memoize(),
2424
- __metadata("design:type", PlaceDefinition),
2425
- __metadata("design:paramtypes", [])
2426
- ], PlaceComponent.prototype, "placeDefinition", null);
2427
- return PlaceComponent;
2428
- }(DisposableComponent));
2381
+ /**
2382
+ * @private
2383
+ * @param {?} visit
2384
+ * @return {?}
2385
+ */
2386
+ ParameterDefinition.prototype.isMissingFrom = /**
2387
+ * @private
2388
+ * @param {?} visit
2389
+ * @return {?}
2390
+ */
2391
+ function (visit) {
2392
+ return !visit.hasParameter(this.name) || (this.isRouteId && !visit.hasRouteId());
2393
+ };
2394
+ return ParameterDefinition;
2395
+ }());
2429
2396
  if (false) {
2397
+ /** @type {?} */
2398
+ ParameterDefinition.prototype.isRouteId;
2399
+ /** @type {?} */
2400
+ ParameterDefinition.prototype.isArray;
2401
+ /** @type {?} */
2402
+ ParameterDefinition.prototype.remember;
2403
+ /** @type {?} */
2404
+ ParameterDefinition.prototype.defaultValue;
2430
2405
  /**
2431
2406
  * @type {?}
2432
2407
  * @private
2433
2408
  */
2434
- PlaceComponent.prototype.resolvedParameters;
2435
- }
2436
- (function (PlaceComponent) {
2409
+ ParameterDefinition.prototype.options;
2410
+ /** @type {?} */
2411
+ ParameterDefinition.prototype.propertyName;
2412
+ /** @type {?} */
2413
+ ParameterDefinition.prototype.urlFormat;
2437
2414
  /**
2438
- * @param {?} target
2415
+ * @abstract
2416
+ * @param {?} value
2439
2417
  * @return {?}
2440
2418
  */
2441
- function isPlaceComponentConstructor(target) {
2442
- return lang.constructorChain((/** @type {?} */ (target))).includes(PlaceComponent);
2443
- }
2444
- PlaceComponent.isPlaceComponentConstructor = isPlaceComponentConstructor;
2419
+ ParameterDefinition.prototype.isEmptyValue = function (value) { };
2445
2420
  /**
2446
- * @param {?} klass
2421
+ * @abstract
2422
+ * @param {?} a
2423
+ * @param {?} b
2447
2424
  * @return {?}
2448
2425
  */
2449
- function getRouteParameters(klass) {
2450
- return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
2451
- }
2452
- PlaceComponent.getRouteParameters = getRouteParameters;
2426
+ ParameterDefinition.prototype.hasChanged = function (a, b) { };
2427
+ }
2428
+ (function (ParameterDefinition) {
2453
2429
  /**
2454
- * @param {?} klass
2455
- * @return {?}
2430
+ * @record
2431
+ * @template T
2456
2432
  */
2457
- function getDefinition(klass) {
2458
- return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
2433
+ function Options() { }
2434
+ ParameterDefinition.Options = Options;
2435
+ if (false) {
2436
+ /** @type {?|undefined} */
2437
+ Options.prototype.as;
2438
+ /** @type {?|undefined} */
2439
+ Options.prototype.optional;
2440
+ /** @type {?|undefined} */
2441
+ Options.prototype.remember;
2442
+ /** @type {?|undefined} */
2443
+ Options.prototype.defaultValue;
2459
2444
  }
2460
- PlaceComponent.getDefinition = getDefinition;
2461
2445
  /**
2462
- * @param {?} klass
2463
- * @param {?} definition
2464
- * @return {?}
2446
+ * @template T
2465
2447
  */
2466
- function injectDefinition(klass, definition) {
2467
- Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);
2468
- }
2469
- PlaceComponent.injectDefinition = injectDefinition;
2470
- })(PlaceComponent || (PlaceComponent = {}));
2471
-
2472
- /**
2473
- * @fileoverview added by tsickle
2474
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2475
- */
2476
- var AbstractPlaceNavigationComponent = /** @class */ (function (_super) {
2477
- __extends(AbstractPlaceNavigationComponent, _super);
2478
- function AbstractPlaceNavigationComponent() {
2479
- var _this = _super.call(this) || this;
2480
- var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2481
- _this.placeDefinitions = chain(_this.placesModel).map((/**
2482
- * @param {?} c
2448
+ var /**
2449
+ * @template T
2450
+ */
2451
+ RouteId = /** @class */ (function (_super) {
2452
+ __extends(RouteId, _super);
2453
+ function RouteId() {
2454
+ var _this = _super !== null && _super.apply(this, arguments) || this;
2455
+ _this.isRouteId = true;
2456
+ _this.isArray = false;
2457
+ return _this;
2458
+ }
2459
+ /**
2460
+ * @param {?} value
2483
2461
  * @return {?}
2484
2462
  */
2485
- function (c) { return PlaceComponent.getDefinition(c); }));
2486
- return _this;
2463
+ RouteId.prototype.isEmptyValue = /**
2464
+ * @param {?} value
2465
+ * @return {?}
2466
+ */
2467
+ function (value) {
2468
+ return ___default.isNil(value);
2469
+ };
2470
+ /**
2471
+ * @param {?} a
2472
+ * @param {?} b
2473
+ * @return {?}
2474
+ */
2475
+ RouteId.prototype.hasChanged = /**
2476
+ * @param {?} a
2477
+ * @param {?} b
2478
+ * @return {?}
2479
+ */
2480
+ function (a, b) {
2481
+ return a !== b;
2482
+ };
2483
+ return RouteId;
2484
+ }(ParameterDefinition));
2485
+ ParameterDefinition.RouteId = RouteId;
2486
+ if (false) {
2487
+ /** @type {?} */
2488
+ RouteId.prototype.isRouteId;
2489
+ /** @type {?} */
2490
+ RouteId.prototype.isArray;
2487
2491
  }
2488
2492
  /**
2489
- * @param {?} placeDef
2490
- * @return {?}
2493
+ * @template T
2491
2494
  */
2492
- AbstractPlaceNavigationComponent.prototype.getNav = /**
2493
- * @param {?} placeDef
2494
- * @return {?}
2495
+ var /**
2496
+ * @template T
2495
2497
  */
2496
- function (placeDef) {
2497
- /** @type {?} */
2498
- var navItem = (/** @type {?} */ (placeDef.getData('nav')));
2499
- return {
2500
- title: (/**
2501
- * @return {?}
2502
- */
2503
- function () { return navItem ? navItem.title() : placeDef.searchData(['navTitle', 'title']); }),
2504
- tooltip: (/**
2505
- * @return {?}
2506
- */
2507
- function () { return navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getData('navTooltip', null); }),
2508
- icon: (/**
2509
- * @return {?}
2510
- */
2511
- function () { return navItem && navItem.icon ? navItem.icon() : placeDef.getData('navIcon', null); })
2498
+ ValueParameter = /** @class */ (function (_super) {
2499
+ __extends(ValueParameter, _super);
2500
+ function ValueParameter() {
2501
+ var _this = _super !== null && _super.apply(this, arguments) || this;
2502
+ _this.isRouteId = false;
2503
+ _this.isArray = false;
2504
+ return _this;
2505
+ }
2506
+ /**
2507
+ * @param {?} value
2508
+ * @return {?}
2509
+ */
2510
+ ValueParameter.prototype.isEmptyValue = /**
2511
+ * @param {?} value
2512
+ * @return {?}
2513
+ */
2514
+ function (value) {
2515
+ return ___default.isNil(value);
2512
2516
  };
2513
- };
2517
+ /**
2518
+ * @param {?} a
2519
+ * @param {?} b
2520
+ * @return {?}
2521
+ */
2522
+ ValueParameter.prototype.hasChanged = /**
2523
+ * @param {?} a
2524
+ * @param {?} b
2525
+ * @return {?}
2526
+ */
2527
+ function (a, b) {
2528
+ return a !== b;
2529
+ };
2530
+ return ValueParameter;
2531
+ }(ParameterDefinition));
2532
+ ParameterDefinition.ValueParameter = ValueParameter;
2533
+ if (false) {
2534
+ /** @type {?} */
2535
+ ValueParameter.prototype.isRouteId;
2536
+ /** @type {?} */
2537
+ ValueParameter.prototype.isArray;
2538
+ }
2514
2539
  /**
2515
- * @return {?}
2540
+ * @template T
2516
2541
  */
2517
- AbstractPlaceNavigationComponent.prototype.ngOnInit = /**
2518
- * @return {?}
2542
+ var /**
2543
+ * @template T
2519
2544
  */
2520
- function () {
2521
- };
2522
- AbstractPlaceNavigationComponent.propDecorators = {
2523
- places: [{ type: Input }],
2524
- placesModel: [{ type: Input }]
2525
- };
2526
- __decorate([
2527
- StoreInListModel('placesModel'),
2528
- __metadata("design:type", Array)
2529
- ], AbstractPlaceNavigationComponent.prototype, "places", void 0);
2530
- __decorate([
2531
- UseDelegate(),
2532
- __metadata("design:type", ListModel)
2533
- ], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
2534
- __decorate([
2535
- Memoize$1(),
2536
- __metadata("design:type", Function),
2537
- __metadata("design:paramtypes", [PlaceDefinition]),
2538
- __metadata("design:returntype", Object)
2539
- ], AbstractPlaceNavigationComponent.prototype, "getNav", null);
2540
- return AbstractPlaceNavigationComponent;
2541
- }(DisposableComponent));
2542
- if (false) {
2543
- /** @type {?} */
2544
- AbstractPlaceNavigationComponent.prototype.places;
2545
- /** @type {?} */
2546
- AbstractPlaceNavigationComponent.prototype.placesModel;
2547
- /** @type {?} */
2548
- AbstractPlaceNavigationComponent.prototype.placeDefinitions;
2549
- }
2545
+ ArrayParameter = /** @class */ (function (_super) {
2546
+ __extends(ArrayParameter, _super);
2547
+ function ArrayParameter(parameterName, options, urlFormat) {
2548
+ var _this = _super.call(this, parameterName, options, urlFormat) || this;
2549
+ _this.isRouteId = false;
2550
+ _this.isArray = true;
2551
+ return _this;
2552
+ }
2553
+ /**
2554
+ * @param {?} value
2555
+ * @return {?}
2556
+ */
2557
+ ArrayParameter.prototype.isEmptyValue = /**
2558
+ * @param {?} value
2559
+ * @return {?}
2560
+ */
2561
+ function (value) {
2562
+ return ___default.isNil(value) || value.length < 1;
2563
+ };
2564
+ /**
2565
+ * @param {?} a
2566
+ * @param {?} b
2567
+ * @return {?}
2568
+ */
2569
+ ArrayParameter.prototype.hasChanged = /**
2570
+ * @param {?} a
2571
+ * @param {?} b
2572
+ * @return {?}
2573
+ */
2574
+ function (a, b) {
2575
+ return !___default.isEqual(a, b);
2576
+ };
2577
+ return ArrayParameter;
2578
+ }(ParameterDefinition));
2579
+ ParameterDefinition.ArrayParameter = ArrayParameter;
2580
+ if (false) {
2581
+ /** @type {?} */
2582
+ ArrayParameter.prototype.isRouteId;
2583
+ /** @type {?} */
2584
+ ArrayParameter.prototype.isArray;
2585
+ }
2586
+ })(ParameterDefinition || (ParameterDefinition = {}));
2550
2587
 
2551
2588
  /**
2552
2589
  * @fileoverview added by tsickle
2553
2590
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2554
2591
  */
2555
- var ListPlaceNavComponent = /** @class */ (function (_super) {
2556
- __extends(ListPlaceNavComponent, _super);
2557
- function ListPlaceNavComponent() {
2558
- var _this = _super.call(this) || this;
2559
- _this.expanded = true;
2560
- return _this;
2592
+ var PlaceDefinition = /** @class */ (function () {
2593
+ function PlaceDefinition(component, path, authenticate, order, data, routeParameters, children) {
2594
+ this.component = component;
2595
+ this.path = path;
2596
+ this.authenticate = authenticate;
2597
+ this.order = order;
2598
+ this.data = data;
2599
+ this.routeParameters = routeParameters;
2600
+ this.children = children;
2561
2601
  }
2562
2602
  /**
2563
2603
  * @return {?}
2564
2604
  */
2565
- ListPlaceNavComponent.prototype.expandMenu = /**
2605
+ PlaceDefinition.prototype.hasRouteId = /**
2566
2606
  * @return {?}
2567
2607
  */
2568
2608
  function () {
2569
- this.expanded = true;
2609
+ return !!this.getRouteIdParameterDef();
2570
2610
  };
2571
2611
  /**
2572
2612
  * @return {?}
2573
2613
  */
2574
- ListPlaceNavComponent.prototype.collapseMenu = /**
2614
+ PlaceDefinition.prototype.getRouteIdParameterDef = /**
2575
2615
  * @return {?}
2576
2616
  */
2577
2617
  function () {
2578
- this.expanded = false;
2618
+ return this.routeParameters.find((/**
2619
+ * @param {?} p
2620
+ * @return {?}
2621
+ */
2622
+ function (p) { return p.isRouteId; }));
2579
2623
  };
2580
2624
  /**
2625
+ * @param {?=} includeRouteId
2581
2626
  * @return {?}
2582
2627
  */
2583
- ListPlaceNavComponent.prototype.toggleMenu = /**
2628
+ PlaceDefinition.prototype.getRouteParameterDefs = /**
2629
+ * @param {?=} includeRouteId
2584
2630
  * @return {?}
2585
2631
  */
2586
- function () {
2587
- this.expanded = !this.expanded;
2588
- };
2589
- ListPlaceNavComponent.decorators = [
2590
- { type: Component, args: [{
2591
- selector: 'angular-ui-powerups-list-place-nav',
2592
- template: "<mat-nav-list class=\"app-menu\">\n <a mat-list-item *ngFor=\"let place of placeDefinitions.value\"\n [routerLink]='place.path'\n routerLinkActive #rla=\"routerLinkActive\"\n [matTooltip]=\"getNav(place).tooltip()\">\n <mat-icon *ngIf=\"getNav(place).icon()\">{{getNav(place).icon()}}</mat-icon>\n <span class=\"expanded-only\">{{getNav(place).title()}}</span>\n </a>\n</mat-nav-list>\n",
2593
- styles: [":host{display:flex;flex-direction:column;--expanded-width:235px;--nav-item-width:var(--nav-bar-height);width:var(--nav-item-width);transition:width 125ms linear}:host.expanded{width:var(--expanded-width);max-width:var(--expanded-width)}.expanded-only{max-width:0;overflow:hidden}.collapsed-only{max-width:100%;overflow:hidden}.header{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;height:var(--nav-bar-height);border-bottom:var(--pinstripe-border);cursor:pointer}.header .menu{flex:1}.header button{color:inherit;width:var(--nav-item-width);height:var(--nav-bar-height)}mat-nav-list{flex:1;display:flex;flex-direction:column}.mat-list-item{width:var(--nav-item-width);height:var(--nav-bar-height);color:inherit}mat-icon{color:inherit}mat-icon.flip-horizontal{transform:scaleX(-1)}:host-context(.expanded) .expanded-only{max-width:100%}:host-context(.expanded) .collapsed-only{max-width:0}:host-context(.expanded) .mat-list-item mat-icon{margin-right:12px}:host-context(.expanded) .mat-list-item span{text-wrap:none;white-space:nowrap}a[ng-reflect-router-link=manage-instruments] mat-icon{transform:rotate(90deg)}.app-menu{padding-top:0}"]
2594
- }] }
2595
- ];
2596
- /** @nocollapse */
2597
- ListPlaceNavComponent.ctorParameters = function () { return []; };
2598
- ListPlaceNavComponent.propDecorators = {
2599
- expanded: [{ type: HostBinding, args: ['class.expanded',] }]
2632
+ function (includeRouteId) {
2633
+ if (includeRouteId === void 0) { includeRouteId = false; }
2634
+ return this.getVisitParameterDefs({ includeRouteId: includeRouteId, includeRouteParameters: true });
2600
2635
  };
2601
- return ListPlaceNavComponent;
2602
- }(AbstractPlaceNavigationComponent));
2603
- if (false) {
2604
- /** @type {?} */
2605
- ListPlaceNavComponent.prototype.expanded;
2606
- }
2607
-
2608
- /**
2609
- * @fileoverview added by tsickle
2610
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2611
- */
2612
- var PlaceHistory = /** @class */ (function () {
2613
- function PlaceHistory(router) {
2614
- this.router = router;
2615
- this._history = new Map();
2616
- }
2617
2636
  /**
2618
- * @param {?} state
2637
+ * @param {?=} include
2619
2638
  * @return {?}
2620
2639
  */
2621
- PlaceHistory.prototype.add = /**
2622
- * @param {?} state
2640
+ PlaceDefinition.prototype.getVisitParameterDefs = /**
2641
+ * @param {?=} include
2623
2642
  * @return {?}
2624
2643
  */
2625
- function (state) {
2644
+ function (include) {
2626
2645
  /** @type {?} */
2627
- var history = this.getHistory(state.placeDefinition);
2646
+ var opts = Opts.get(include);
2647
+ // includes
2628
2648
  /** @type {?} */
2629
- var previousState = ___default.last(history);
2630
- if (!previousState || state.hasChanged(previousState)) {
2631
- history.unshift(state); // LIFO
2632
- this.setHistory(state.placeDefinition, history.slice(0, 3)); // limit our history to 4 visits
2633
- }
2634
- };
2635
- /**
2636
- * @param {?} placeDef
2637
- * @return {?}
2638
- */
2639
- PlaceHistory.prototype.getHistory = /**
2640
- * @param {?} placeDef
2641
- * @return {?}
2642
- */
2643
- function (placeDef) {
2649
+ var includeRouteId = !include || opts.getOptional('includeRouteId', false);
2644
2650
  /** @type {?} */
2645
- var history = this._history.get(placeDef);
2646
- if (!history) {
2647
- history = [];
2648
- this.setHistory(placeDef, history);
2649
- }
2650
- return history;
2651
+ var includeRouteParameters = !include || opts.getOptional('includeRouteParameters', false);
2652
+ /** @type {?} */
2653
+ var includeNonRouteParameters = !include || opts.getOptional('includeNonRouteParameters', false);
2654
+ return this.routeParameters.filter((/**
2655
+ * @param {?} p
2656
+ * @return {?}
2657
+ */
2658
+ function (p) {
2659
+ return (includeRouteId && p.isRouteId)
2660
+ || (includeRouteParameters && p.isRouteParameter && !p.isRouteId) // route id is included in the line above
2661
+ || (includeNonRouteParameters && !p.isRouteParameter);
2662
+ }));
2651
2663
  };
2652
2664
  /**
2653
- * @private
2654
- * @param {?} placeDef
2655
- * @param {?} history
2665
+ * @template T
2666
+ * @param {?} key
2667
+ * @param {?=} defaultValue
2656
2668
  * @return {?}
2657
2669
  */
2658
- PlaceHistory.prototype.setHistory = /**
2659
- * @private
2660
- * @param {?} placeDef
2661
- * @param {?} history
2670
+ PlaceDefinition.prototype.getPlaceData = /**
2671
+ * @template T
2672
+ * @param {?} key
2673
+ * @param {?=} defaultValue
2662
2674
  * @return {?}
2663
2675
  */
2664
- function (placeDef, history) {
2665
- this._history.set(placeDef, history);
2676
+ function (key, defaultValue) {
2677
+ return this.data ?
2678
+ ___default.isNil(this.data[key]) ? defaultValue : this.data[key] :
2679
+ defaultValue;
2666
2680
  };
2667
- PlaceHistory.decorators = [
2668
- { type: Injectable, args: [{
2669
- providedIn: 'root'
2670
- },] }
2671
- ];
2672
- /** @nocollapse */
2673
- PlaceHistory.ctorParameters = function () { return [
2674
- { type: Router }
2675
- ]; };
2676
- /** @nocollapse */ PlaceHistory.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceHistory_Factory() { return new PlaceHistory(ɵɵinject(Router)); }, token: PlaceHistory, providedIn: "root" });
2677
- return PlaceHistory;
2678
- }());
2679
- if (false) {
2680
- /**
2681
- * @type {?}
2682
- * @private
2683
- */
2684
- PlaceHistory.prototype._history;
2685
- /**
2686
- * @type {?}
2687
- * @private
2688
- */
2689
- PlaceHistory.prototype.router;
2690
- }
2691
-
2692
- /**
2693
- * @fileoverview added by tsickle
2694
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2695
- */
2696
- var NavigationSession = /** @class */ (function () {
2697
- function NavigationSession(isPopState, initialUrl) {
2698
- this.isPopState = isPopState;
2699
- this.initialUrl = initialUrl;
2700
- this._alreadyAccepted = [];
2701
- console.log('NavigationSession', { isPopState: isPopState, initialUrl: initialUrl });
2702
- }
2703
2681
  /**
2704
- * @param {?} placeComponent
2682
+ * @template T
2683
+ * @param {?} keys
2684
+ * @param {?=} defaultValue
2705
2685
  * @return {?}
2706
2686
  */
2707
- NavigationSession.prototype.alreadyAccepted = /**
2708
- * @param {?} placeComponent
2687
+ PlaceDefinition.prototype.searchPlaceData = /**
2688
+ * @template T
2689
+ * @param {?} keys
2690
+ * @param {?=} defaultValue
2709
2691
  * @return {?}
2710
2692
  */
2711
- function (placeComponent) {
2712
- return this._alreadyAccepted.includes(placeComponent);
2693
+ function (keys, defaultValue) {
2694
+ var _this = this;
2695
+ if (this.data) {
2696
+ /** @type {?} */
2697
+ var found = keys.find((/**
2698
+ * @param {?} key
2699
+ * @return {?}
2700
+ */
2701
+ function (key) { return !___default.isNil(_this.data[key]); }));
2702
+ return found ? this.data[found] : defaultValue;
2703
+ }
2704
+ else {
2705
+ return defaultValue;
2706
+ }
2713
2707
  };
2714
2708
  /**
2715
- * @param {?} component
2709
+ * @param {?} visit
2716
2710
  * @return {?}
2717
2711
  */
2718
- NavigationSession.prototype.rememberAcceptanceOf = /**
2719
- * @param {?} component
2712
+ PlaceDefinition.prototype.getRouteIdFrom = /**
2713
+ * @param {?} visit
2720
2714
  * @return {?}
2721
2715
  */
2722
- function (component) {
2723
- this._alreadyAccepted.push(component);
2716
+ function (visit) {
2717
+ /** @type {?} */
2718
+ var routeIdParameterDef = this.getRouteIdParameterDef();
2719
+ return routeIdParameterDef ? visit.getParameter(routeIdParameterDef.name) : null;
2724
2720
  };
2725
- return NavigationSession;
2726
- }());
2727
- if (false) {
2728
2721
  /**
2729
- * @type {?}
2730
- * @private
2722
+ * Returns angular router commands that specify the route id and any route parameters. The result does
2723
+ * not include any path information.
2731
2724
  */
2732
- NavigationSession.prototype._alreadyAccepted;
2733
- /** @type {?} */
2734
- NavigationSession.prototype.isPopState;
2735
- /** @type {?} */
2736
- NavigationSession.prototype.initialUrl;
2737
- }
2738
- var PlaceRouter = /** @class */ (function () {
2739
- function PlaceRouter(router, angularLocation) {
2740
- var _this = this;
2741
- this.router = router;
2742
- this._navigationSession = new MutableValueModel();
2743
- angularLocation.onUrlChange((/**
2744
- * @param {?} url
2745
- * @return {?}
2746
- */
2747
- function (url) {
2748
- console.log("### " + url);
2749
- }));
2750
- this.router.events.subscribe((/**
2751
- * @param {?} event
2752
- * @return {?}
2753
- */
2754
- function (event) {
2755
- // console.log(`${event.constructor.name}`, location.pathname, angularLocation.getState());
2756
- // NavigationStart -> .... -> NavigationCancel === redirect (so don't ask again)
2757
- // NavigationStart -> .... -> NavigationEnd === navigated (so ask next time)
2758
- // NavigationStart -> .... -> NavigationError === canceled (guard cancelled so ask next time)
2759
- if (event instanceof NavigationStart && !_this.navigationSession) {
2760
- _this._navigationSession.value = new NavigationSession(event.navigationTrigger === 'popstate', _this.router.routerState.snapshot.url);
2761
- }
2762
- if (event instanceof NavigationEnd) {
2763
- console.log('navigation ended');
2764
- _this._navigationSession.value = null;
2765
- }
2766
- if (event instanceof NavigationError) {
2767
- console.log('navigation errored');
2768
- _this._navigationSession.value = null;
2769
- }
2770
- }));
2771
- }
2772
- Object.defineProperty(PlaceRouter.prototype, "navigationSession", {
2773
- get: /**
2774
- * @return {?}
2775
- */
2776
- function () {
2777
- return this._navigationSession.value;
2778
- },
2779
- enumerable: true,
2780
- configurable: true
2781
- });
2725
+ // getFormattedRouterCommands(visit: Visit): any[] {
2726
+ // return this.hasRouteId() ?
2727
+ // [this.getFormattedRouteId(visit), this.getFormattedRouteParameters(visit)] :
2728
+ // [this.getFormattedRouteParameters(visit)];
2729
+ // }
2782
2730
  /**
2783
- * @param {?} activatedRoute
2784
- * @param {?} previous
2785
- * @param {?} next
2731
+ * Returns angular router commands that specify the route id and any route parameters. The result does
2732
+ * not include any path information.
2733
+ * @param {?} visit
2786
2734
  * @return {?}
2787
2735
  */
2788
- PlaceRouter.prototype.pushParameterChangesToRoute = /**
2789
- * @param {?} activatedRoute
2790
- * @param {?} previous
2791
- * @param {?} next
2736
+ // getFormattedRouterCommands(visit: Visit): any[] {
2737
+ // return this.hasRouteId() ?
2738
+ // [this.getFormattedRouteId(visit), this.getFormattedRouteParameters(visit)] :
2739
+ // [this.getFormattedRouteParameters(visit)];
2740
+ // }
2741
+ PlaceDefinition.prototype.getFormattedRouteId = /**
2742
+ * Returns angular router commands that specify the route id and any route parameters. The result does
2743
+ * not include any path information.
2744
+ * @param {?} visit
2792
2745
  * @return {?}
2793
2746
  */
2794
- function (activatedRoute, previous, next) {
2795
- /** @type {?} */
2796
- var relativePath = !!previous.hasRouteId() ? '..' : '.';
2797
- this.router.navigate([relativePath].concat(this.createRouteParameters(next), this.getChildPath(activatedRoute.snapshot)), {
2798
- relativeTo: activatedRoute
2799
- });
2747
+ // getFormattedRouterCommands(visit: Visit): any[] {
2748
+ // return this.hasRouteId() ?
2749
+ // [this.getFormattedRouteId(visit), this.getFormattedRouteParameters(visit)] :
2750
+ // [this.getFormattedRouteParameters(visit)];
2751
+ // }
2752
+ function (visit) {
2753
+ return visit.hasRouteId() ? this.getRouteIdParameterDef().urlFormat.format(visit.getRouteId()) : null;
2800
2754
  };
2801
2755
  // @Trace()
2802
2756
  // @Trace()
2803
2757
  /**
2804
- * @param {?} activatedRoute
2805
- * @param {?} sanitised
2758
+ * @param {?} visit
2759
+ * @param {?=} includeRouteId
2806
2760
  * @return {?}
2807
2761
  */
2808
- PlaceRouter.prototype.getRedirectUrlTree =
2762
+ PlaceDefinition.prototype.getFormattedRouteParameters =
2809
2763
  // @Trace()
2810
2764
  /**
2811
- * @param {?} activatedRoute
2812
- * @param {?} sanitised
2765
+ * @param {?} visit
2766
+ * @param {?=} includeRouteId
2813
2767
  * @return {?}
2814
2768
  */
2815
- function (activatedRoute, sanitised) {
2816
- /** @type {?} */
2817
- var urlSegments = activatedRoute.url;
2818
- /** @type {?} */
2819
- var weHaveARouteId = sanitised.hasRouteId() && sanitised.getFormattedRouteId();
2769
+ function (visit, includeRouteId) {
2770
+ if (includeRouteId === void 0) { includeRouteId = false; }
2820
2771
  /** @type {?} */
2821
- var commands = (weHaveARouteId) ?
2822
- [urlSegments[0].path, sanitised.getFormattedRouteId(), sanitised.getFormattedParameters()] :
2823
- [urlSegments[0].path, sanitised.getFormattedParameters()];
2824
- return this.router.createUrlTree(commands);
2772
+ var result = {};
2773
+ this.getVisitParameterDefs({
2774
+ includeRouteId: includeRouteId, includeRouteParameters: true
2775
+ }).forEach((/**
2776
+ * @param {?} def
2777
+ * @return {?}
2778
+ */
2779
+ function (def) {
2780
+ /** @type {?} */
2781
+ var value = visit.getParameter(def.name);
2782
+ if (!def.isEmptyValue(value)) {
2783
+ if (def.isArray) {
2784
+ assert.isArray(value);
2785
+ result[def.name] = value.map((/**
2786
+ * @param {?} v
2787
+ * @return {?}
2788
+ */
2789
+ function (v) { return def.urlFormat.format(v); }));
2790
+ }
2791
+ else {
2792
+ assert.isFalsey(Array.isArray(value));
2793
+ result[def.name] = def.urlFormat.format(value);
2794
+ }
2795
+ }
2796
+ }));
2797
+ return result;
2825
2798
  };
2826
2799
  /**
2827
- * @protected
2828
- * @param {?} activatedRoute
2800
+ * @param {?} visit
2829
2801
  * @return {?}
2830
2802
  */
2831
- PlaceRouter.prototype.getChildPath = /**
2832
- * @protected
2833
- * @param {?} activatedRoute
2803
+ PlaceDefinition.prototype.getNonRouteParameters = /**
2804
+ * @param {?} visit
2834
2805
  * @return {?}
2835
2806
  */
2836
- function (activatedRoute) {
2837
- return ___default.flatten(activatedRoute.children.map((/**
2838
- * @param {?} child
2807
+ function (visit) {
2808
+ /** @type {?} */
2809
+ var result = {};
2810
+ this.getVisitParameterDefs({ includeNonRouteParameters: true }).forEach((/**
2811
+ * @param {?} def
2839
2812
  * @return {?}
2840
2813
  */
2841
- function (child) { return child.url; })));
2814
+ function (def) {
2815
+ /** @type {?} */
2816
+ var value = visit.getParameter(def.name);
2817
+ if (!def.isEmptyValue(value)) {
2818
+ result[def.name] = value;
2819
+ }
2820
+ }));
2821
+ return result;
2842
2822
  };
2823
+ // @Trace()
2824
+ // @Trace()
2843
2825
  /**
2844
- * @protected
2845
- * @param {?} parameters
2826
+ * @param {?} params
2846
2827
  * @return {?}
2847
2828
  */
2848
- PlaceRouter.prototype.createRouteParameters = /**
2849
- * @protected
2850
- * @param {?} parameters
2829
+ PlaceDefinition.prototype.parseRouteParams =
2830
+ // @Trace()
2831
+ /**
2832
+ * @param {?} params
2851
2833
  * @return {?}
2852
2834
  */
2853
- function (parameters) {
2835
+ function (params) {
2854
2836
  /** @type {?} */
2855
- var routeId = parameters.getFormattedRouteId();
2856
- return routeId ?
2857
- [routeId, parameters.getFormattedParameters()] :
2858
- [parameters.getFormattedParameters()];
2837
+ var result = {};
2838
+ this.getVisitParameterDefs({
2839
+ includeRouteId: true,
2840
+ includeRouteParameters: true,
2841
+ includeNonRouteParameters: false
2842
+ }).forEach((/**
2843
+ * @param {?} def
2844
+ * @return {?}
2845
+ */
2846
+ function (def) {
2847
+ // params will return null for non existent names
2848
+ if (params.has(def.name)) {
2849
+ if (def.isArray) {
2850
+ /** @type {?} */
2851
+ var values = params.getAll(def.name);
2852
+ result[def.name] = values.map((/**
2853
+ * @param {?} v
2854
+ * @return {?}
2855
+ */
2856
+ function (v) { return def.urlFormat.parse(v); }));
2857
+ }
2858
+ else {
2859
+ result[def.name] = def.urlFormat.parse(params.get(def.name));
2860
+ }
2861
+ }
2862
+ }));
2863
+ return result;
2859
2864
  };
2860
- PlaceRouter.decorators = [
2861
- { type: Injectable, args: [{
2862
- providedIn: 'root'
2863
- },] }
2864
- ];
2865
- /** @nocollapse */
2866
- PlaceRouter.ctorParameters = function () { return [
2867
- { type: Router },
2868
- { type: Location }
2869
- ]; };
2870
- /** @nocollapse */ PlaceRouter.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(ɵɵinject(Router), ɵɵinject(Location)); }, token: PlaceRouter, providedIn: "root" });
2871
- return PlaceRouter;
2865
+ __decorate([
2866
+ Memoize(),
2867
+ __metadata("design:type", Function),
2868
+ __metadata("design:paramtypes", []),
2869
+ __metadata("design:returntype", ParameterDefinition)
2870
+ ], PlaceDefinition.prototype, "getRouteIdParameterDef", null);
2871
+ __decorate([
2872
+ Memoize(),
2873
+ __metadata("design:type", Function),
2874
+ __metadata("design:paramtypes", [Object]),
2875
+ __metadata("design:returntype", Array)
2876
+ ], PlaceDefinition.prototype, "getRouteParameterDefs", null);
2877
+ __decorate([
2878
+ Memoize(),
2879
+ __metadata("design:type", Function),
2880
+ __metadata("design:paramtypes", [Object]),
2881
+ __metadata("design:returntype", Array)
2882
+ ], PlaceDefinition.prototype, "getVisitParameterDefs", null);
2883
+ return PlaceDefinition;
2872
2884
  }());
2873
2885
  if (false) {
2886
+ /** @type {?} */
2887
+ PlaceDefinition.prototype.component;
2888
+ /** @type {?} */
2889
+ PlaceDefinition.prototype.path;
2890
+ /** @type {?} */
2891
+ PlaceDefinition.prototype.authenticate;
2892
+ /** @type {?} */
2893
+ PlaceDefinition.prototype.order;
2894
+ /** @type {?} */
2895
+ PlaceDefinition.prototype.data;
2896
+ /** @type {?} */
2897
+ PlaceDefinition.prototype.routeParameters;
2898
+ /** @type {?} */
2899
+ PlaceDefinition.prototype.children;
2900
+ }
2901
+ (function (PlaceDefinition) {
2874
2902
  /**
2875
- * @type {?}
2876
- * @private
2877
- */
2878
- PlaceRouter.prototype._navigationSession;
2879
- /**
2880
- * @type {?}
2881
- * @private
2903
+ * @record
2882
2904
  */
2883
- PlaceRouter.prototype.router;
2884
- }
2905
+ function ParameterOptions() { }
2906
+ PlaceDefinition.ParameterOptions = ParameterOptions;
2907
+ if (false) {
2908
+ /** @type {?|undefined} */
2909
+ ParameterOptions.prototype.includeRouteId;
2910
+ /** @type {?|undefined} */
2911
+ ParameterOptions.prototype.includeRouteParameters;
2912
+ /** @type {?|undefined} */
2913
+ ParameterOptions.prototype.includeNonRouteParameters;
2914
+ }
2915
+ })(PlaceDefinition || (PlaceDefinition = {}));
2885
2916
 
2886
2917
  /**
2887
2918
  * @fileoverview added by tsickle
2888
2919
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2889
2920
  */
2890
- /**
2891
- * @abstract
2892
- * @template T, S
2893
- */
2894
- var /**
2895
- * @abstract
2896
- * @template T, S
2897
- */
2898
- ParameterDefinition = /** @class */ (function () {
2899
- function ParameterDefinition(propertyName, type, options) {
2900
- this.propertyName = propertyName;
2901
- this.type = type;
2902
- /** @type {?} */
2903
- var opts = Opts.get(options);
2904
- this.name = opts.getOptional('as', propertyName);
2905
- this.remember = opts.getOptional('remember', false);
2906
- this.defaultValue = opts.getOptional('defaultValue', null);
2921
+ // RAKE: making this Symbol(...) broke things.
2922
+ /** @type {?} */
2923
+ var DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
2924
+ // this one seems ok.
2925
+ /** @type {?} */
2926
+ var ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
2927
+ var PlaceComponent = /** @class */ (function (_super) {
2928
+ __extends(PlaceComponent, _super);
2929
+ function PlaceComponent() {
2930
+ return _super.call(this) || this;
2907
2931
  }
2908
2932
  /**
2909
- * @param {?} injector
2933
+ * @param {?} visit
2910
2934
  * @return {?}
2911
2935
  */
2912
- ParameterDefinition.prototype.getSanitiser = /**
2913
- * @param {?} injector
2936
+ PlaceComponent.prototype.initialiseBindings = /**
2937
+ * @param {?} visit
2914
2938
  * @return {?}
2915
2939
  */
2916
- function (injector) {
2917
- if (this.remember || !___default.isNil(this.defaultValue)) {
2918
- return new ParameterDefinition.DefaultParameterSanitiser(this.remember, this.defaultValue, injector.get(PlaceHistory));
2919
- }
2920
- else {
2921
- return null;
2922
- }
2940
+ function (visit) {
2941
+ var _this = this;
2942
+ assert.isNil(this.visit);
2943
+ this.visit = visit;
2944
+ this.placeDefinition.getVisitParameterDefs().forEach((/**
2945
+ * @param {?} parameterDef
2946
+ * @return {?}
2947
+ */
2948
+ function (parameterDef) {
2949
+ _this.installBinding(parameterDef);
2950
+ }));
2923
2951
  };
2924
- return ParameterDefinition;
2925
- }());
2926
- if (false) {
2927
- /** @type {?} */
2928
- ParameterDefinition.prototype.isRouteId;
2929
- /** @type {?} */
2930
- ParameterDefinition.prototype.isArray;
2931
- /** @type {?} */
2932
- ParameterDefinition.prototype.name;
2933
2952
  /**
2934
- * @type {?}
2935
2953
  * @private
2954
+ * @template T, S
2955
+ * @param {?} parameterDef
2956
+ * @return {?}
2957
+ */
2958
+ PlaceComponent.prototype.installBinding = /**
2959
+ * @private
2960
+ * @template T, S
2961
+ * @param {?} parameterDef
2962
+ * @return {?}
2936
2963
  */
2937
- ParameterDefinition.prototype.remember;
2964
+ function (parameterDef) {
2965
+ /** @type {?} */
2966
+ var model = (/** @type {?} */ (this[parameterDef.propertyName]));
2967
+ // this.txo.observe(parameterDef.propertyName, model);
2968
+ this.registerDisposable(new Binding(this.visit, model, {
2969
+ toRight: /**
2970
+ * @param {?} visit
2971
+ * @return {?}
2972
+ */
2973
+ function (visit) {
2974
+ /** @type {?} */
2975
+ var value = visit.getParameter(parameterDef.name);
2976
+ // console.log('push to component', {name:parameterDef.name, value, visit});
2977
+ return value;
2978
+ },
2979
+ toLeft: /**
2980
+ * @param {?} value
2981
+ * @param {?=} currentVisit
2982
+ * @return {?}
2983
+ */
2984
+ function (value, currentVisit) {
2985
+ console.log('push to route', { name: parameterDef.name, value: value, currentVisit: currentVisit });
2986
+ return currentVisit.replace(parameterDef, value);
2987
+ }
2988
+ }));
2989
+ };
2990
+ Object.defineProperty(PlaceComponent.prototype, "placeDefinition", {
2991
+ get: /**
2992
+ * @return {?}
2993
+ */
2994
+ function () {
2995
+ return PlaceComponent.getDefinition((/** @type {?} */ ((/** @type {?} */ (this.constructor)))));
2996
+ },
2997
+ enumerable: true,
2998
+ configurable: true
2999
+ });
3000
+ Object.defineProperty(PlaceComponent.prototype, "childPlaces", {
3001
+ get: /**
3002
+ * @return {?}
3003
+ */
3004
+ function () {
3005
+ return this.placeDefinition.children.map((/**
3006
+ * @param {?} d
3007
+ * @return {?}
3008
+ */
3009
+ function (d) { return d.component; }));
3010
+ },
3011
+ enumerable: true,
3012
+ configurable: true
3013
+ });
3014
+ /**
3015
+ * @return {?}
3016
+ */
3017
+ PlaceComponent.prototype.canDeactivate = /**
3018
+ * @return {?}
3019
+ */
3020
+ function () {
3021
+ return true;
3022
+ };
3023
+ /**
3024
+ * @return {?}
3025
+ */
3026
+ PlaceComponent.prototype.onPlaceReady = /**
3027
+ * @return {?}
3028
+ */
3029
+ function () {
3030
+ };
3031
+ __decorate([
3032
+ Memoize$1(),
3033
+ __metadata("design:type", PlaceDefinition),
3034
+ __metadata("design:paramtypes", [])
3035
+ ], PlaceComponent.prototype, "placeDefinition", null);
3036
+ return PlaceComponent;
3037
+ }(DisposableComponent));
3038
+ if (false) {
2938
3039
  /**
2939
3040
  * @type {?}
2940
3041
  * @private
2941
3042
  */
2942
- ParameterDefinition.prototype.defaultValue;
2943
- /** @type {?} */
2944
- ParameterDefinition.prototype.propertyName;
2945
- /** @type {?} */
2946
- ParameterDefinition.prototype.type;
3043
+ PlaceComponent.prototype.visit;
2947
3044
  }
2948
- (function (ParameterDefinition) {
3045
+ (function (PlaceComponent) {
2949
3046
  /**
2950
- * @record
2951
- * @template T
3047
+ * @param {?} target
3048
+ * @return {?}
2952
3049
  */
2953
- function Options() { }
2954
- ParameterDefinition.Options = Options;
2955
- if (false) {
2956
- /** @type {?|undefined} */
2957
- Options.prototype.as;
2958
- /** @type {?|undefined} */
2959
- Options.prototype.optional;
2960
- /** @type {?|undefined} */
2961
- Options.prototype.remember;
2962
- /** @type {?|undefined} */
2963
- Options.prototype.defaultValue;
3050
+ function isPlaceComponentConstructor(target) {
3051
+ return lang.constructorChain((/** @type {?} */ (target))).includes(PlaceComponent);
2964
3052
  }
3053
+ PlaceComponent.isPlaceComponentConstructor = isPlaceComponentConstructor;
2965
3054
  /**
2966
- * @template T
3055
+ * @param {?} klass
3056
+ * @return {?}
2967
3057
  */
2968
- var /**
2969
- * @template T
3058
+ function getRouteParameters(klass) {
3059
+ return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
3060
+ }
3061
+ PlaceComponent.getRouteParameters = getRouteParameters;
3062
+ /**
3063
+ * @param {?} klass
3064
+ * @return {?}
2970
3065
  */
2971
- RouteId = /** @class */ (function (_super) {
2972
- __extends(RouteId, _super);
2973
- function RouteId() {
2974
- var _this = _super !== null && _super.apply(this, arguments) || this;
2975
- _this.isRouteId = true;
2976
- _this.isArray = false;
2977
- return _this;
2978
- }
2979
- return RouteId;
2980
- }(ParameterDefinition));
2981
- ParameterDefinition.RouteId = RouteId;
2982
- if (false) {
2983
- /** @type {?} */
2984
- RouteId.prototype.isRouteId;
2985
- /** @type {?} */
2986
- RouteId.prototype.isArray;
3066
+ function getDefinition(klass) {
3067
+ return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
2987
3068
  }
3069
+ PlaceComponent.getDefinition = getDefinition;
2988
3070
  /**
2989
- * @template T
3071
+ * @param {?} klass
3072
+ * @param {?} definition
3073
+ * @return {?}
2990
3074
  */
2991
- var /**
2992
- * @template T
3075
+ function injectDefinition(klass, definition) {
3076
+ Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);
3077
+ }
3078
+ PlaceComponent.injectDefinition = injectDefinition;
3079
+ })(PlaceComponent || (PlaceComponent = {}));
3080
+
3081
+ /**
3082
+ * @fileoverview added by tsickle
3083
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3084
+ */
3085
+ var AbstractPlaceNavigationComponent = /** @class */ (function (_super) {
3086
+ __extends(AbstractPlaceNavigationComponent, _super);
3087
+ function AbstractPlaceNavigationComponent() {
3088
+ var _this = _super.call(this) || this;
3089
+ var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
3090
+ _this.placeDefinitions = chain(_this.placesModel).map((/**
3091
+ * @param {?} c
3092
+ * @return {?}
3093
+ */
3094
+ function (c) { return PlaceComponent.getDefinition(c); }));
3095
+ return _this;
3096
+ }
3097
+ /**
3098
+ * @param {?} placeDef
3099
+ * @return {?}
2993
3100
  */
2994
- ValueParameter = /** @class */ (function (_super) {
2995
- __extends(ValueParameter, _super);
2996
- function ValueParameter() {
2997
- var _this = _super !== null && _super.apply(this, arguments) || this;
2998
- _this.isRouteId = false;
2999
- _this.isArray = false;
3000
- return _this;
3001
- }
3002
- return ValueParameter;
3003
- }(ParameterDefinition));
3004
- ParameterDefinition.ValueParameter = ValueParameter;
3005
- if (false) {
3006
- /** @type {?} */
3007
- ValueParameter.prototype.isRouteId;
3101
+ AbstractPlaceNavigationComponent.prototype.getNav = /**
3102
+ * @param {?} placeDef
3103
+ * @return {?}
3104
+ */
3105
+ function (placeDef) {
3008
3106
  /** @type {?} */
3009
- ValueParameter.prototype.isArray;
3107
+ var navItem = (/** @type {?} */ (placeDef.getPlaceData('nav')));
3108
+ return {
3109
+ title: (/**
3110
+ * @return {?}
3111
+ */
3112
+ function () { return navItem ? navItem.title() : placeDef.searchPlaceData(['navTitle', 'title']); }),
3113
+ tooltip: (/**
3114
+ * @return {?}
3115
+ */
3116
+ function () { return navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getPlaceData('navTooltip', null); }),
3117
+ icon: (/**
3118
+ * @return {?}
3119
+ */
3120
+ function () { return navItem && navItem.icon ? navItem.icon() : placeDef.getPlaceData('navIcon', null); })
3121
+ };
3122
+ };
3123
+ /**
3124
+ * @return {?}
3125
+ */
3126
+ AbstractPlaceNavigationComponent.prototype.ngOnInit = /**
3127
+ * @return {?}
3128
+ */
3129
+ function () {
3130
+ };
3131
+ AbstractPlaceNavigationComponent.propDecorators = {
3132
+ places: [{ type: Input }],
3133
+ placesModel: [{ type: Input }]
3134
+ };
3135
+ __decorate([
3136
+ StoreInListModel('placesModel'),
3137
+ __metadata("design:type", Array)
3138
+ ], AbstractPlaceNavigationComponent.prototype, "places", void 0);
3139
+ __decorate([
3140
+ UseDelegate(),
3141
+ __metadata("design:type", ListModel)
3142
+ ], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
3143
+ __decorate([
3144
+ Memoize(),
3145
+ __metadata("design:type", Function),
3146
+ __metadata("design:paramtypes", [PlaceDefinition]),
3147
+ __metadata("design:returntype", Object)
3148
+ ], AbstractPlaceNavigationComponent.prototype, "getNav", null);
3149
+ return AbstractPlaceNavigationComponent;
3150
+ }(DisposableComponent));
3151
+ if (false) {
3152
+ /** @type {?} */
3153
+ AbstractPlaceNavigationComponent.prototype.places;
3154
+ /** @type {?} */
3155
+ AbstractPlaceNavigationComponent.prototype.placesModel;
3156
+ /** @type {?} */
3157
+ AbstractPlaceNavigationComponent.prototype.placeDefinitions;
3158
+ }
3159
+
3160
+ /**
3161
+ * @fileoverview added by tsickle
3162
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3163
+ */
3164
+ var ListPlaceNavComponent = /** @class */ (function (_super) {
3165
+ __extends(ListPlaceNavComponent, _super);
3166
+ function ListPlaceNavComponent() {
3167
+ var _this = _super.call(this) || this;
3168
+ _this.expanded = true;
3169
+ return _this;
3010
3170
  }
3011
3171
  /**
3012
- * @template T
3172
+ * @return {?}
3013
3173
  */
3014
- var /**
3015
- * @template T
3174
+ ListPlaceNavComponent.prototype.expandMenu = /**
3175
+ * @return {?}
3016
3176
  */
3017
- ArrayParameter = /** @class */ (function (_super) {
3018
- __extends(ArrayParameter, _super);
3019
- function ArrayParameter() {
3020
- var _this = _super !== null && _super.apply(this, arguments) || this;
3021
- _this.isRouteId = false;
3022
- _this.isArray = true;
3023
- return _this;
3024
- }
3025
- return ArrayParameter;
3026
- }(ParameterDefinition));
3027
- ParameterDefinition.ArrayParameter = ArrayParameter;
3028
- if (false) {
3029
- /** @type {?} */
3030
- ArrayParameter.prototype.isRouteId;
3031
- /** @type {?} */
3032
- ArrayParameter.prototype.isArray;
3177
+ function () {
3178
+ this.expanded = true;
3179
+ };
3180
+ /**
3181
+ * @return {?}
3182
+ */
3183
+ ListPlaceNavComponent.prototype.collapseMenu = /**
3184
+ * @return {?}
3185
+ */
3186
+ function () {
3187
+ this.expanded = false;
3188
+ };
3189
+ /**
3190
+ * @return {?}
3191
+ */
3192
+ ListPlaceNavComponent.prototype.toggleMenu = /**
3193
+ * @return {?}
3194
+ */
3195
+ function () {
3196
+ this.expanded = !this.expanded;
3197
+ };
3198
+ ListPlaceNavComponent.decorators = [
3199
+ { type: Component, args: [{
3200
+ selector: 'angular-ui-powerups-list-place-nav',
3201
+ template: "<mat-nav-list class=\"app-menu\">\n <a mat-list-item *ngFor=\"let place of placeDefinitions.value\"\n [routerLink]='place.path'\n [replaceUrl]=\"true\"\n routerLinkActive #rla=\"routerLinkActive\"\n [matTooltip]=\"getNav(place).tooltip()\">\n <mat-icon *ngIf=\"getNav(place).icon()\">{{getNav(place).icon()}}</mat-icon>\n <span class=\"expanded-only\">{{getNav(place).title()}}</span>\n </a>\n</mat-nav-list>\n",
3202
+ styles: [":host{display:flex;flex-direction:column;--expanded-width:235px;--nav-item-width:var(--nav-bar-height);width:var(--nav-item-width);transition:width 125ms linear}:host.expanded{width:var(--expanded-width);max-width:var(--expanded-width)}.expanded-only{max-width:0;overflow:hidden}.collapsed-only{max-width:100%;overflow:hidden}.header{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;height:var(--nav-bar-height);border-bottom:var(--pinstripe-border);cursor:pointer}.header .menu{flex:1}.header button{color:inherit;width:var(--nav-item-width);height:var(--nav-bar-height)}mat-nav-list{flex:1;display:flex;flex-direction:column}.mat-list-item{width:var(--nav-item-width);height:var(--nav-bar-height);color:inherit}mat-icon{color:inherit}mat-icon.flip-horizontal{transform:scaleX(-1)}:host-context(.expanded) .expanded-only{max-width:100%}:host-context(.expanded) .collapsed-only{max-width:0}:host-context(.expanded) .mat-list-item mat-icon{margin-right:12px}:host-context(.expanded) .mat-list-item span{text-wrap:none;white-space:nowrap}a[ng-reflect-router-link=manage-instruments] mat-icon{transform:rotate(90deg)}.app-menu{padding-top:0}"]
3203
+ }] }
3204
+ ];
3205
+ /** @nocollapse */
3206
+ ListPlaceNavComponent.ctorParameters = function () { return []; };
3207
+ ListPlaceNavComponent.propDecorators = {
3208
+ expanded: [{ type: HostBinding, args: ['class.expanded',] }]
3209
+ };
3210
+ return ListPlaceNavComponent;
3211
+ }(AbstractPlaceNavigationComponent));
3212
+ if (false) {
3213
+ /** @type {?} */
3214
+ ListPlaceNavComponent.prototype.expanded;
3215
+ }
3216
+
3217
+ /**
3218
+ * @fileoverview added by tsickle
3219
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3220
+ */
3221
+ var PlaceHistory = /** @class */ (function () {
3222
+ function PlaceHistory(router) {
3223
+ this.router = router;
3224
+ this._history = new Map();
3033
3225
  }
3226
+ // @Trace()
3227
+ // @Trace()
3034
3228
  /**
3035
- * @template T, S
3229
+ * @param {?} state
3230
+ * @return {?}
3036
3231
  */
3037
- var /**
3038
- * @template T, S
3232
+ PlaceHistory.prototype.add =
3233
+ // @Trace()
3234
+ /**
3235
+ * @param {?} state
3236
+ * @return {?}
3039
3237
  */
3040
- DefaultParameterSanitiser = /** @class */ (function () {
3041
- function DefaultParameterSanitiser(remember, defaultValue, placeHistory) {
3042
- this.remember = remember;
3043
- this.defaultValue = defaultValue;
3044
- this.placeHistory = placeHistory;
3045
- }
3046
- /**
3047
- * @param {?} parameter
3048
- * @param {?=} visit
3049
- * @return {?}
3050
- */
3051
- DefaultParameterSanitiser.prototype.sanitise = /**
3052
- * @param {?} parameter
3053
- * @param {?=} visit
3054
- * @return {?}
3055
- */
3056
- function (parameter, visit) {
3057
- /** @type {?} */
3058
- var value = parameter.value;
3059
- if (parameter.isMissing()) {
3060
- /** @type {?} */
3061
- var previousVisit = ___default.first(this.placeHistory.getHistory(visit.placeDefinition));
3062
- if (this.remember && previousVisit) {
3063
- value = previousVisit.getValueOf(parameter.definition);
3064
- }
3065
- return parameter.isEmptyValue(value) ? this.defaultValue : value;
3066
- }
3067
- else {
3068
- return value;
3069
- }
3070
- };
3071
- return DefaultParameterSanitiser;
3072
- }());
3073
- ParameterDefinition.DefaultParameterSanitiser = DefaultParameterSanitiser;
3074
- if (false) {
3238
+ function (state) {
3075
3239
  /** @type {?} */
3076
- DefaultParameterSanitiser.prototype.remember;
3240
+ var history = this.getHistory(state.placeDefinition);
3077
3241
  /** @type {?} */
3078
- DefaultParameterSanitiser.prototype.defaultValue;
3242
+ var previousState = ___default.last(history);
3243
+ if (!previousState || state.hasChangedFrom(previousState)) {
3244
+ history.unshift(state); // LIFO
3245
+ this.setHistory(state.placeDefinition, history.slice(0, 3)); // limit our history to 4 visits
3246
+ }
3247
+ };
3248
+ /**
3249
+ * @param {?} placeDef
3250
+ * @return {?}
3251
+ */
3252
+ PlaceHistory.prototype.getHistory = /**
3253
+ * @param {?} placeDef
3254
+ * @return {?}
3255
+ */
3256
+ function (placeDef) {
3079
3257
  /** @type {?} */
3080
- DefaultParameterSanitiser.prototype.placeHistory;
3081
- }
3082
- })(ParameterDefinition || (ParameterDefinition = {}));
3258
+ var history = this._history.get(placeDef);
3259
+ if (!history) {
3260
+ history = [];
3261
+ this.setHistory(placeDef, history);
3262
+ }
3263
+ return history;
3264
+ };
3265
+ /**
3266
+ * @private
3267
+ * @param {?} placeDef
3268
+ * @param {?} history
3269
+ * @return {?}
3270
+ */
3271
+ PlaceHistory.prototype.setHistory = /**
3272
+ * @private
3273
+ * @param {?} placeDef
3274
+ * @param {?} history
3275
+ * @return {?}
3276
+ */
3277
+ function (placeDef, history) {
3278
+ this._history.set(placeDef, history);
3279
+ };
3280
+ PlaceHistory.decorators = [
3281
+ { type: Injectable, args: [{
3282
+ providedIn: 'root'
3283
+ },] }
3284
+ ];
3285
+ /** @nocollapse */
3286
+ PlaceHistory.ctorParameters = function () { return [
3287
+ { type: Router }
3288
+ ]; };
3289
+ /** @nocollapse */ PlaceHistory.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceHistory_Factory() { return new PlaceHistory(ɵɵinject(Router)); }, token: PlaceHistory, providedIn: "root" });
3290
+ return PlaceHistory;
3291
+ }());
3292
+ if (false) {
3293
+ /**
3294
+ * @type {?}
3295
+ * @private
3296
+ */
3297
+ PlaceHistory.prototype._history;
3298
+ /**
3299
+ * @type {?}
3300
+ * @private
3301
+ */
3302
+ PlaceHistory.prototype.router;
3303
+ }
3083
3304
 
3084
3305
  /**
3085
3306
  * @fileoverview added by tsickle
@@ -3087,791 +3308,682 @@ if (false) {
3087
3308
  */
3088
3309
  /**
3089
3310
  * @abstract
3090
- * @template S, T, R
3091
3311
  */
3092
3312
  var /**
3093
3313
  * @abstract
3094
- * @template S, T, R
3095
3314
  */
3096
- RouteParameterValue = /** @class */ (function () {
3097
- function RouteParameterValue(definition, rawValue) {
3098
- this.definition = definition;
3099
- this.rawValue = rawValue;
3315
+ NavigationSession = /** @class */ (function () {
3316
+ function NavigationSession(firstNavigation) {
3317
+ this.firstNavigation = firstNavigation;
3318
+ this._alreadyAccepted = [];
3319
+ this._visits = new Map();
3100
3320
  }
3101
3321
  /**
3322
+ * @param {?} visit
3102
3323
  * @return {?}
3103
3324
  */
3104
- RouteParameterValue.prototype.isRouteId = /**
3325
+ NavigationSession.prototype.storeVisit = /**
3326
+ * @param {?} visit
3105
3327
  * @return {?}
3106
3328
  */
3107
- function () {
3108
- return this.definition.isRouteId;
3329
+ function (visit) {
3330
+ this._visits.set(visit.placeDefinition, visit);
3109
3331
  };
3110
3332
  /**
3111
- * @param {?} otherValue
3333
+ * @param {?} placeDef
3112
3334
  * @return {?}
3113
3335
  */
3114
- RouteParameterValue.prototype.hasChanged = /**
3115
- * @param {?} otherValue
3336
+ NavigationSession.prototype.getVisitFor = /**
3337
+ * @param {?} placeDef
3116
3338
  * @return {?}
3117
3339
  */
3118
- function (otherValue) {
3119
- return this.isEmpty() ?
3120
- !this.isEmptyValue(otherValue) :
3121
- this.isEmptyValue(otherValue) || !this.isSameValue(otherValue);
3340
+ function (placeDef) {
3341
+ return this._visits.get(placeDef);
3122
3342
  };
3123
3343
  /**
3124
- * Return's true if the current value is empty.
3344
+ * @param {?} params
3345
+ * @return {?}
3346
+ */
3347
+ NavigationSession.prototype.mergePrivatePlaceParameters = /**
3348
+ * @param {?} params
3349
+ * @return {?}
3125
3350
  */
3351
+ function (params) {
3352
+ return null;
3353
+ };
3354
+ // @Trace()
3355
+ // @Trace()
3126
3356
  /**
3127
- * Return's true if the current value is empty.
3357
+ * @param {?} placeComponent
3128
3358
  * @return {?}
3129
3359
  */
3130
- RouteParameterValue.prototype.isEmpty = /**
3131
- * Return's true if the current value is empty.
3360
+ NavigationSession.prototype.alreadyAccepted =
3361
+ // @Trace()
3362
+ /**
3363
+ * @param {?} placeComponent
3132
3364
  * @return {?}
3133
3365
  */
3134
- function () {
3135
- return this.isEmptyValue(this.value);
3366
+ function (placeComponent) {
3367
+ return this._alreadyAccepted.includes(placeComponent);
3136
3368
  };
3369
+ // @Trace()
3370
+ // @Trace()
3371
+ /**
3372
+ * @param {?} component
3373
+ * @return {?}
3374
+ */
3375
+ NavigationSession.prototype.rememberAcceptanceOf =
3376
+ // @Trace()
3137
3377
  /**
3138
- * Returns true if the rawValue is undefined. This
3378
+ * @param {?} component
3379
+ * @return {?}
3139
3380
  */
3381
+ function (component) {
3382
+ this._alreadyAccepted.push(component);
3383
+ };
3140
3384
  /**
3141
- * Returns true if the rawValue is undefined. This
3385
+ * @param {?} url
3142
3386
  * @return {?}
3143
3387
  */
3144
- RouteParameterValue.prototype.isMissing = /**
3145
- * Returns true if the rawValue is undefined. This
3388
+ NavigationSession.prototype.setPopstateReturn = /**
3389
+ * @param {?} url
3146
3390
  * @return {?}
3147
3391
  */
3148
- function () {
3149
- return ___default.isUndefined(this.rawValue);
3392
+ function (url) {
3393
+ this._popStateReturnUrl = url;
3150
3394
  };
3395
+ Object.defineProperty(NavigationSession.prototype, "isPopState", {
3396
+ get: /**
3397
+ * @return {?}
3398
+ */
3399
+ function () {
3400
+ return !!this._popStateReturnUrl;
3401
+ },
3402
+ enumerable: true,
3403
+ configurable: true
3404
+ });
3405
+ Object.defineProperty(NavigationSession.prototype, "popStateReturnUrl", {
3406
+ get: /**
3407
+ * @return {?}
3408
+ */
3409
+ function () {
3410
+ return this._popStateReturnUrl;
3411
+ },
3412
+ enumerable: true,
3413
+ configurable: true
3414
+ });
3151
3415
  /**
3152
- * @param {?} visit
3153
- * @param {?} injector
3154
3416
  * @return {?}
3155
3417
  */
3156
- RouteParameterValue.prototype.sanitise = /**
3157
- * @param {?} visit
3158
- * @param {?} injector
3418
+ NavigationSession.prototype.getVisits = /**
3159
3419
  * @return {?}
3160
3420
  */
3161
- function (visit, injector) {
3162
- return __awaiter(this, void 0, void 0, function () {
3163
- var sanitiser;
3164
- return __generator(this, function (_a) {
3165
- sanitiser = this.definition.getSanitiser(injector);
3166
- if (sanitiser) {
3167
- return [2 /*return*/, sanitiser.sanitise(this, visit)];
3168
- }
3169
- else {
3170
- return [2 /*return*/, this.value];
3171
- }
3172
- return [2 /*return*/];
3173
- });
3174
- });
3421
+ function () {
3422
+ return Array.from(this._visits.values());
3175
3423
  };
3176
- return RouteParameterValue;
3424
+ return NavigationSession;
3177
3425
  }());
3178
3426
  if (false) {
3179
- /** @type {?} */
3180
- RouteParameterValue.prototype.value;
3181
- /** @type {?} */
3182
- RouteParameterValue.prototype.definition;
3183
3427
  /**
3184
3428
  * @type {?}
3185
- * @protected
3186
- */
3187
- RouteParameterValue.prototype.rawValue;
3188
- /**
3189
- * @abstract
3190
- * @param {?} otherValue
3191
- * @return {?}
3192
- */
3193
- RouteParameterValue.prototype.isSameValue = function (otherValue) { };
3194
- /**
3195
- * @abstract
3196
- * @return {?}
3429
+ * @private
3197
3430
  */
3198
- RouteParameterValue.prototype.formattedValue = function () { };
3431
+ NavigationSession.prototype._alreadyAccepted;
3199
3432
  /**
3200
- * @abstract
3201
- * @param {?} value
3202
- * @return {?}
3433
+ * @type {?}
3434
+ * @private
3203
3435
  */
3204
- RouteParameterValue.prototype.replace = function (value) { };
3436
+ NavigationSession.prototype._visits;
3205
3437
  /**
3206
- * @abstract
3207
- * @param {?} value
3208
- * @return {?}
3438
+ * @type {?}
3439
+ * @private
3209
3440
  */
3210
- RouteParameterValue.prototype.isEmptyValue = function (value) { };
3441
+ NavigationSession.prototype._popStateReturnUrl;
3442
+ /** @type {?} */
3443
+ NavigationSession.prototype.isExternal;
3444
+ /** @type {?} */
3445
+ NavigationSession.prototype.firstNavigation;
3211
3446
  }
3212
- (function (RouteParameterValue) {
3213
- /**
3214
- * @template T
3215
- * @param {?} def
3216
- * @param {?} paramMap
3217
- * @return {?}
3218
- */
3219
- function create(def, paramMap) {
3220
- // NOTE: Using undefined is important as it triggers the isMissing flag which is used by defaultValue and remember flags
3221
- if (def.isArray) {
3222
- return new RouteParameterValue.Array(def, paramMap.has(def.name) ? paramMap.getAll(def.name) : undefined);
3447
+ (function (NavigationSession) {
3448
+ var External = /** @class */ (function (_super) {
3449
+ __extends(External, _super);
3450
+ function External(isFirstTime) {
3451
+ var _this = _super.call(this, isFirstTime) || this;
3452
+ _this.isExternal = true;
3453
+ return _this;
3223
3454
  }
3224
- else {
3225
- /** @type {?} */
3226
- var rawValue = paramMap.has(def.name) ? paramMap.get(def.name) : undefined;
3227
- // route ids are always present so we have to check if it's empty to flag it as missing..
3228
- rawValue = def.isRouteId && ___default.isEmpty(rawValue) ? undefined : rawValue;
3229
- return new RouteParameterValue.Scalar(def, rawValue);
3455
+ return External;
3456
+ }(NavigationSession));
3457
+ if (false) {
3458
+ /** @type {?} */
3459
+ External.prototype.isExternal;
3460
+ }
3461
+ var Internal = /** @class */ (function (_super) {
3462
+ __extends(Internal, _super);
3463
+ function Internal(visit) {
3464
+ var _this = _super.call(this, false) || this;
3465
+ _this.isExternal = false;
3466
+ _this.storeVisit(visit);
3467
+ return _this;
3230
3468
  }
3469
+ return Internal;
3470
+ }(NavigationSession));
3471
+ if (false) {
3472
+ /** @type {?} */
3473
+ Internal.prototype.isExternal;
3231
3474
  }
3232
- RouteParameterValue.create = create;
3233
3475
  /**
3234
- * @template T
3476
+ * @param {?} visit
3477
+ * @return {?}
3235
3478
  */
3236
- var Scalar = /** @class */ (function (_super) {
3237
- __extends(Scalar, _super);
3238
- function Scalar() {
3239
- return _super !== null && _super.apply(this, arguments) || this;
3240
- }
3241
- Object.defineProperty(Scalar.prototype, "value", {
3242
- get: /**
3243
- * @return {?}
3244
- */
3245
- function () {
3246
- return this.definition.type.parse(this.rawValue);
3247
- },
3248
- enumerable: true,
3249
- configurable: true
3250
- });
3251
- /**
3252
- * @param {?} otherValue
3253
- * @return {?}
3254
- */
3255
- Scalar.prototype.isSameValue = /**
3256
- * @param {?} otherValue
3257
- * @return {?}
3258
- */
3259
- function (otherValue) {
3260
- return this.value === otherValue;
3261
- };
3262
- /**
3263
- * @param {?} value
3264
- * @return {?}
3265
- */
3266
- Scalar.prototype.replace = /**
3267
- * @param {?} value
3268
- * @return {?}
3269
- */
3270
- function (value) {
3271
- return new RouteParameterValue.Scalar(this.definition, this.isEmptyValue(value) ? undefined : this.definition.type.format(value));
3272
- };
3273
- /**
3274
- * @return {?}
3275
- */
3276
- Scalar.prototype.formattedValue = /**
3277
- * @return {?}
3278
- */
3279
- function () {
3280
- return this.isEmpty() ? undefined : this.definition.type.format(this.value);
3281
- };
3282
- /**
3283
- * @param {?} value
3284
- * @return {?}
3285
- */
3286
- Scalar.prototype.isEmptyValue = /**
3287
- * @param {?} value
3288
- * @return {?}
3289
- */
3290
- function (value) {
3291
- return ___default.isNil(value);
3292
- };
3293
- __decorate([
3294
- Memoize$1(),
3295
- __metadata("design:type", Object),
3296
- __metadata("design:paramtypes", [])
3297
- ], Scalar.prototype, "value", null);
3298
- return Scalar;
3299
- }(RouteParameterValue));
3300
- RouteParameterValue.Scalar = Scalar;
3479
+ function createInternal(visit) {
3480
+ return new Internal(visit);
3481
+ }
3482
+ NavigationSession.createInternal = createInternal;
3301
3483
  /**
3302
- * @template T
3484
+ * @param {?} firstTimeRoute
3485
+ * @return {?}
3303
3486
  */
3304
- var Array = /** @class */ (function (_super) {
3305
- __extends(Array, _super);
3306
- function Array() {
3307
- return _super !== null && _super.apply(this, arguments) || this;
3308
- }
3309
- Object.defineProperty(Array.prototype, "value", {
3310
- get: /**
3311
- * @return {?}
3312
- */
3313
- function () {
3314
- var _this = this;
3315
- return (this.rawValue || [])
3316
- .filter((/**
3317
- * @param {?} s
3318
- * @return {?}
3319
- */
3320
- function (s) { return !___default.isEmpty(s); }))
3321
- .map((/**
3322
- * @param {?} raw
3323
- * @return {?}
3324
- */
3325
- function (raw) { return _this.definition.type.parse(raw); }));
3326
- },
3327
- enumerable: true,
3328
- configurable: true
3329
- });
3330
- /**
3331
- * @param {?} otherValue
3332
- * @return {?}
3333
- */
3334
- Array.prototype.isSameValue = /**
3335
- * @param {?} otherValue
3336
- * @return {?}
3337
- */
3338
- function (otherValue) {
3339
- return ___default.isEqual(this.value, otherValue);
3340
- };
3341
- /**
3342
- * @param {?} value
3343
- * @return {?}
3344
- */
3345
- Array.prototype.replace = /**
3346
- * @param {?} value
3347
- * @return {?}
3348
- */
3349
- function (value) {
3350
- var _this = this;
3351
- return new RouteParameterValue.Array(this.definition, this.isEmptyValue(value) ? undefined : value.map((/**
3352
- * @param {?} v
3353
- * @return {?}
3354
- */
3355
- function (v) { return _this.definition.type.format(v); })));
3356
- };
3357
- /**
3358
- * @return {?}
3359
- */
3360
- Array.prototype.formattedValue = /**
3361
- * @return {?}
3362
- */
3363
- function () {
3364
- var _this = this;
3365
- return this.isEmpty() ? [] : this.value.map((/**
3366
- * @param {?} v
3367
- * @return {?}
3368
- */
3369
- function (v) { return _this.definition.type.format(v); }));
3370
- };
3371
- /**
3372
- * @param {?} value
3373
- * @return {?}
3374
- */
3375
- Array.prototype.isEmptyValue = /**
3376
- * @param {?} value
3377
- * @return {?}
3378
- */
3379
- function (value) {
3380
- return ___default.isNil(value) || value.length < 1;
3381
- };
3382
- __decorate([
3383
- Memoize$1(),
3384
- __metadata("design:type", Array),
3385
- __metadata("design:paramtypes", [])
3386
- ], Array.prototype, "value", null);
3387
- return Array;
3388
- }(RouteParameterValue));
3389
- RouteParameterValue.Array = Array;
3390
- })(RouteParameterValue || (RouteParameterValue = {}));
3487
+ function createExternal(firstTimeRoute) {
3488
+ return new External(firstTimeRoute);
3489
+ }
3490
+ NavigationSession.createExternal = createExternal;
3491
+ })(NavigationSession || (NavigationSession = {}));
3391
3492
 
3392
3493
  /**
3393
3494
  * @fileoverview added by tsickle
3394
3495
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3395
3496
  */
3396
- var ParameterSnapshot = /** @class */ (function () {
3397
- function ParameterSnapshot(placeDefinition, parameters) {
3497
+ /**
3498
+ * @record
3499
+ */
3500
+ function Params() { }
3501
+ var Visit = /** @class */ (function () {
3502
+ function Visit(placeDefinition, visitParameters) {
3503
+ if (visitParameters === void 0) { visitParameters = {}; }
3398
3504
  this.placeDefinition = placeDefinition;
3399
- this.parameters = parameters;
3505
+ this.visitParameters = visitParameters;
3400
3506
  }
3507
+ // @Trace()
3508
+ // @Trace()
3401
3509
  /**
3402
- * @param {?} other
3403
- * @param {?=} debug
3404
3510
  * @return {?}
3405
3511
  */
3406
- ParameterSnapshot.prototype.hasChanged = /**
3407
- * @param {?} other
3408
- * @param {?=} debug
3512
+ Visit.prototype.getRouteId =
3513
+ // @Trace()
3514
+ /**
3409
3515
  * @return {?}
3410
3516
  */
3411
- function (other, debug) {
3412
- if (debug === void 0) { debug = false; }
3413
- /** @type {?} */
3414
- var changed = this.parameters.find((/**
3415
- * @param {?} r
3416
- * @return {?}
3417
- */
3418
- function (r) {
3419
- return r.hasChanged(other.getValueOf(r.definition));
3420
- }));
3421
- if (changed && debug) {
3422
- console.log({
3423
- name: changed.definition.name,
3424
- mine: changed.value,
3425
- theirs: other.getValueOf(changed.definition)
3426
- });
3427
- }
3428
- return !!changed;
3517
+ function () {
3518
+ return this.placeDefinition.getRouteIdFrom(this);
3519
+ };
3520
+ // @Trace()
3521
+ // @Trace()
3522
+ /**
3523
+ * @return {?}
3524
+ */
3525
+ Visit.prototype.hasRouteId =
3526
+ // @Trace()
3527
+ /**
3528
+ * @return {?}
3529
+ */
3530
+ function () {
3531
+ return !isNil(this.getRouteId());
3429
3532
  };
3430
3533
  /**
3431
- * @template T, S
3432
- * @param {?} parameterDef
3534
+ * Returns the value of the place parameter with the specified name. The parameter
3535
+ * name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
3536
+ * same as the the ValueModel property name.
3537
+ * @param parameterName the field name of the property model or the `as` option if specified.
3538
+ */
3539
+ /**
3540
+ * Returns the value of the place parameter with the specified name. The parameter
3541
+ * name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
3542
+ * same as the the ValueModel property name.
3543
+ * @param {?} parameterName the field name of the property model or the `as` option if specified.
3433
3544
  * @return {?}
3434
3545
  */
3435
- ParameterSnapshot.prototype.getParameter = /**
3436
- * @template T, S
3437
- * @param {?} parameterDef
3546
+ Visit.prototype.getParameter = /**
3547
+ * Returns the value of the place parameter with the specified name. The parameter
3548
+ * name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
3549
+ * same as the the ValueModel property name.
3550
+ * @param {?} parameterName the field name of the property model or the `as` option if specified.
3438
3551
  * @return {?}
3439
3552
  */
3440
- function (parameterDef) {
3441
- return this.parameters.find((/**
3442
- * @param {?} r
3443
- * @return {?}
3444
- */
3445
- function (r) { return r.definition === parameterDef; }));
3553
+ function (parameterName) {
3554
+ return this.visitParameters[parameterName];
3446
3555
  };
3556
+ // @Trace()
3557
+ // @Trace()
3447
3558
  /**
3448
- * @template T, S
3449
- * @param {?} parameterDef
3559
+ * @param {?} parameterName
3450
3560
  * @return {?}
3451
3561
  */
3452
- ParameterSnapshot.prototype.getValueOf = /**
3453
- * @template T, S
3454
- * @param {?} parameterDef
3562
+ Visit.prototype.hasParameter =
3563
+ // @Trace()
3564
+ /**
3565
+ * @param {?} parameterName
3455
3566
  * @return {?}
3456
3567
  */
3457
- function (parameterDef) {
3458
- /** @type {?} */
3459
- var resolvedParameter = this.getParameter(parameterDef);
3460
- return resolvedParameter ? resolvedParameter.value : null;
3568
+ function (parameterName) {
3569
+ return Object.keys(this.visitParameters).includes(parameterName);
3461
3570
  };
3462
3571
  /**
3572
+ * @template S
3573
+ * @param {?} parameter
3574
+ * @param {?} value
3463
3575
  * @return {?}
3464
3576
  */
3465
- ParameterSnapshot.prototype.getRouteIdValue = /**
3577
+ Visit.prototype.replace = /**
3578
+ * @template S
3579
+ * @param {?} parameter
3580
+ * @param {?} value
3466
3581
  * @return {?}
3467
3582
  */
3468
- function () {
3469
- return this.getRouteIdParameter() ? this.getRouteIdParameter().value : null;
3583
+ function (parameter, value) {
3584
+ var _a;
3585
+ return new Visit(this.placeDefinition, __assign({}, this.visitParameters, (_a = {}, _a[parameter.name] = value, _a)));
3470
3586
  };
3471
3587
  /**
3472
- * @param {?} name
3588
+ * @template S
3589
+ * @param {?} routeParams
3473
3590
  * @return {?}
3474
3591
  */
3475
- ParameterSnapshot.prototype.getParameterValue = /**
3476
- * @param {?} name
3592
+ Visit.prototype.mergeRouteParameters = /**
3593
+ * @template S
3594
+ * @param {?} routeParams
3477
3595
  * @return {?}
3478
3596
  */
3479
- function (name) {
3597
+ function (routeParams) {
3598
+ var _this = this;
3599
+ // todo: whitelist parameters.
3480
3600
  /** @type {?} */
3481
- var resolvedParameter = this.parameters.find((/**
3482
- * @param {?} r
3601
+ var routeParameterKeys = Object.keys(routeParams);
3602
+ /** @type {?} */
3603
+ var params = {};
3604
+ this.placeDefinition.getVisitParameterDefs().forEach((/**
3605
+ * @param {?} def
3483
3606
  * @return {?}
3484
3607
  */
3485
- function (r) { return r.definition.name === name; }));
3486
- return resolvedParameter ? resolvedParameter.value : null;
3608
+ function (def) {
3609
+ if (def.isRouteId || def.isRouteParameter) {
3610
+ if (routeParameterKeys.includes(def.name)) {
3611
+ params[def.name] = routeParams[def.name];
3612
+ }
3613
+ }
3614
+ else {
3615
+ // copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
3616
+ // defaults and remember sanitisation process.
3617
+ if (_this.hasParameter(def.name)) {
3618
+ params[def.name] = _this.getParameter(def.name);
3619
+ }
3620
+ }
3621
+ }));
3622
+ return new Visit(this.placeDefinition, params);
3487
3623
  };
3488
3624
  /**
3489
- * @private
3625
+ * @param {?} other
3490
3626
  * @return {?}
3491
3627
  */
3492
- ParameterSnapshot.prototype.getRouteIdParameter = /**
3493
- * @private
3628
+ Visit.prototype.hasRoutingChangedFrom = /**
3629
+ * @param {?} other
3494
3630
  * @return {?}
3495
3631
  */
3496
- function () {
3497
- // RouteId's are never arrays: see parameter-decorators.ts createDefinition methods. It would be nice to
3498
- // capture this in the type system though
3499
- return (/** @type {?} */ (this.parameters.find((/**
3500
- * @param {?} p
3501
- * @return {?}
3502
- */
3503
- function (p) { return p.definition.isRouteId; }))));
3632
+ function (other) {
3633
+ /** @type {?} */
3634
+ var samePlace = other.placeDefinition === this.placeDefinition;
3635
+ /** @type {?} */
3636
+ var sameRouteParameters = isEqual(this.placeDefinition.getFormattedRouteParameters(this, true), this.placeDefinition.getFormattedRouteParameters(other, true));
3637
+ return !samePlace || !sameRouteParameters;
3504
3638
  };
3505
3639
  /**
3506
- * @private
3640
+ * @param {?} other
3507
3641
  * @return {?}
3508
3642
  */
3509
- ParameterSnapshot.prototype.getRouteParameters = /**
3510
- * @private
3643
+ Visit.prototype.hasChangedFrom = /**
3644
+ * @param {?} other
3511
3645
  * @return {?}
3512
3646
  */
3513
- function () {
3514
- return this.parameters.filter((/**
3515
- * @param {?} r
3647
+ function (other) {
3648
+ /** @type {?} */
3649
+ var sameNonRouteParameters = isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
3650
+ return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
3651
+ };
3652
+ return Visit;
3653
+ }());
3654
+ if (false) {
3655
+ /** @type {?} */
3656
+ Visit.prototype.placeDefinition;
3657
+ /**
3658
+ * @type {?}
3659
+ * @private
3660
+ */
3661
+ Visit.prototype.visitParameters;
3662
+ }
3663
+
3664
+ /**
3665
+ * @fileoverview added by tsickle
3666
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3667
+ */
3668
+ var PlaceRouter = /** @class */ (function (_super) {
3669
+ __extends(PlaceRouter, _super);
3670
+ function PlaceRouter(router, angularLocation, placeHistory) {
3671
+ var _this = _super.call(this) || this;
3672
+ _this.router = router;
3673
+ _this.angularLocation = angularLocation;
3674
+ _this.placeHistory = placeHistory;
3675
+ _this.firstRoute = true;
3676
+ _this._navigationSessionModel = new MutableValueModel();
3677
+ _this._activeVisits = new MutableListModel();
3678
+ var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
3679
+ _this.activeVisitIndex = chain(_this._activeVisits).indexBy('placeDefinition');
3680
+ angularLocation.onUrlChange((/**
3681
+ * @param {?} url
3516
3682
  * @return {?}
3517
3683
  */
3518
- function (r) { return !r.definition.isRouteId; }));
3519
- };
3684
+ function (url) {
3685
+ console.log("location.onUrlChange -> " + url);
3686
+ }));
3687
+ // TODO: make setup the callbacks in during module initiation to make this testable.
3688
+ _this.router.events.subscribe((/**
3689
+ * @param {?} event
3690
+ * @return {?}
3691
+ */
3692
+ function (event) {
3693
+ // Routing event sequence
3694
+ // ======================
3695
+ // NavigationStart -> .... -> NavigationCancel --> redirect, go around again in the same session
3696
+ // NavigationStart -> .... -> NavigationEnd --> navigation complete, end session.
3697
+ // NavigationStart -> .... -> NavigationError --> navigation canceled, end session.
3698
+ // =======================
3699
+ if (event instanceof NavigationStart) {
3700
+ _this.onAngularRouterStarted(event);
3701
+ }
3702
+ if (event instanceof NavigationEnd || event instanceof NavigationError) {
3703
+ _this.onAngularRouterFinished();
3704
+ }
3705
+ }));
3706
+ _this.navigationSessionActive = chain(_this.navigationSessionModel).isNotNil();
3707
+ _this.navigationSessionActive.subscribe((/**
3708
+ * @param {?} active
3709
+ * @return {?}
3710
+ */
3711
+ function (active) {
3712
+ console.log('navigationSessionActive', active);
3713
+ }));
3714
+ return _this;
3715
+ // const txo = new TransactionObserver().onEvent(e => console.log(e.toString()));
3716
+ // txo.observe('this.navigationSessionModel', this.navigationSessionModel);
3717
+ }
3718
+ Object.defineProperty(PlaceRouter.prototype, "navigationSession", {
3719
+ get: /**
3720
+ * @return {?}
3721
+ */
3722
+ function () {
3723
+ return this._navigationSessionModel.value;
3724
+ },
3725
+ enumerable: true,
3726
+ configurable: true
3727
+ });
3728
+ Object.defineProperty(PlaceRouter.prototype, "navigationSessionModel", {
3729
+ get: /**
3730
+ * @return {?}
3731
+ */
3732
+ function () {
3733
+ return this._navigationSessionModel.readonly;
3734
+ },
3735
+ enumerable: true,
3736
+ configurable: true
3737
+ });
3738
+ Object.defineProperty(PlaceRouter.prototype, "activeVisits", {
3739
+ get: /**
3740
+ * @return {?}
3741
+ */
3742
+ function () {
3743
+ return this._activeVisits.readonly;
3744
+ },
3745
+ enumerable: true,
3746
+ configurable: true
3747
+ });
3748
+ /**
3749
+ * placeRouter.navigate(placeDestinations.somePlace.createVisit(routeId, ...visitParams));
3750
+ * @param visit
3751
+ */
3752
+ // @Trace()
3520
3753
  /**
3754
+ * placeRouter.navigate(placeDestinations.somePlace.createVisit(routeId, ...visitParams));
3755
+ * @param {?} visit
3521
3756
  * @return {?}
3522
3757
  */
3523
- ParameterSnapshot.prototype.hasRouteId = /**
3758
+ // @Trace()
3759
+ PlaceRouter.prototype.navigate = /**
3760
+ * placeRouter.navigate(placeDestinations.somePlace.createVisit(routeId, ...visitParams));
3761
+ * @param {?} visit
3524
3762
  * @return {?}
3525
3763
  */
3526
- function () {
3527
- return !!this.getRouteIdParameter();
3764
+ // @Trace()
3765
+ function (visit) {
3766
+ return __awaiter(this, void 0, void 0, function () {
3767
+ return __generator(this, function (_a) {
3768
+ this.doNavigation(visit);
3769
+ return [2 /*return*/];
3770
+ });
3771
+ });
3528
3772
  };
3529
3773
  /**
3774
+ * @param {?} activatedRoute
3775
+ * @param {?} previous
3776
+ * @param {?} next
3530
3777
  * @return {?}
3531
3778
  */
3532
- ParameterSnapshot.prototype.getFormattedRouteId = /**
3779
+ PlaceRouter.prototype.pushVisitChangesToRoute = /**
3780
+ * @param {?} activatedRoute
3781
+ * @param {?} previous
3782
+ * @param {?} next
3533
3783
  * @return {?}
3534
3784
  */
3535
- function () {
3536
- /** @type {?} */
3537
- var routeIdParam = this.getRouteIdParameter();
3538
- return routeIdParam ? routeIdParam.formattedValue() : null;
3785
+ function (activatedRoute, previous, next) {
3786
+ return __awaiter(this, void 0, void 0, function () {
3787
+ var _this = this;
3788
+ return __generator(this, function (_a) {
3789
+ // FIXME: no route id -> route id duplicates route parameters
3790
+ if (next.hasRoutingChangedFrom(previous)) {
3791
+ return [2 /*return*/, this.doNavigation(next, (/**
3792
+ * @param {?} router
3793
+ * @return {?}
3794
+ */
3795
+ function (router) {
3796
+ /** @type {?} */
3797
+ var relativePath = !!previous.placeDefinition.hasRouteId() ? '..' : '.';
3798
+ /** @type {?} */
3799
+ var def = next.placeDefinition;
3800
+ /** @type {?} */
3801
+ var params = next.hasRouteId() ?
3802
+ [def.getFormattedRouteId(next), def.getFormattedRouteParameters(next)] :
3803
+ [def.getFormattedRouteParameters(next)];
3804
+ /** @type {?} */
3805
+ var commands = [relativePath].concat(params, _this.getChildPath(activatedRoute.snapshot));
3806
+ console.log('### Redirect', commands);
3807
+ return router.navigate(commands, {
3808
+ relativeTo: activatedRoute
3809
+ });
3810
+ }))];
3811
+ }
3812
+ else {
3813
+ this.placeHistory.add(next);
3814
+ }
3815
+ return [2 /*return*/];
3816
+ });
3817
+ });
3539
3818
  };
3540
3819
  /**
3820
+ * @param {?} visit
3821
+ * @param {?=} customNavigation
3541
3822
  * @return {?}
3542
3823
  */
3543
- ParameterSnapshot.prototype.getNonEmptyParameters = /**
3824
+ PlaceRouter.prototype.doNavigation = /**
3825
+ * @param {?} visit
3826
+ * @param {?=} customNavigation
3544
3827
  * @return {?}
3545
3828
  */
3546
- function () {
3547
- return this.parameters.filter((/**
3548
- * @param {?} p
3549
- * @return {?}
3550
- */
3551
- function (p) { return !p.isEmpty(); }));
3829
+ function (visit, customNavigation) {
3830
+ return __awaiter(this, void 0, void 0, function () {
3831
+ var def, parameterCommands, commands;
3832
+ return __generator(this, function (_a) {
3833
+ switch (_a.label) {
3834
+ case 0:
3835
+ this._navigationSessionModel.value = NavigationSession.createInternal(visit);
3836
+ _a.label = 1;
3837
+ case 1:
3838
+ _a.trys.push([1, , 6, 7]);
3839
+ if (!customNavigation) return [3 /*break*/, 3];
3840
+ return [4 /*yield*/, customNavigation(this.router)];
3841
+ case 2:
3842
+ _a.sent();
3843
+ return [3 /*break*/, 5];
3844
+ case 3:
3845
+ def = visit.placeDefinition;
3846
+ parameterCommands = visit.hasRouteId() ?
3847
+ [def.getFormattedRouteId(visit), def.getFormattedRouteParameters(visit)] :
3848
+ [def.getFormattedRouteParameters(visit)];
3849
+ commands = [def.path].concat(parameterCommands);
3850
+ console.log('_doNavigation', visit, commands);
3851
+ return [4 /*yield*/, this.router.navigate(commands)];
3852
+ case 4:
3853
+ _a.sent();
3854
+ _a.label = 5;
3855
+ case 5: return [3 /*break*/, 7];
3856
+ case 6:
3857
+ if (this.navigationSession && !this.router.getCurrentNavigation()) {
3858
+ this.onAngularRouterFinished();
3859
+ }
3860
+ return [7 /*endfinally*/];
3861
+ case 7: return [2 /*return*/];
3862
+ }
3863
+ });
3864
+ });
3552
3865
  };
3866
+ // @Trace()
3867
+ // @Trace()
3553
3868
  /**
3869
+ * @private
3870
+ * @param {?} event
3554
3871
  * @return {?}
3555
3872
  */
3556
- ParameterSnapshot.prototype.getFormattedParameters = /**
3873
+ PlaceRouter.prototype.onAngularRouterStarted =
3874
+ // @Trace()
3875
+ /**
3876
+ * @private
3877
+ * @param {?} event
3557
3878
  * @return {?}
3558
3879
  */
3559
- function () {
3560
- /** @type {?} */
3561
- var params = {};
3562
- /** @type {?} */
3563
- var routeIdParam = this.getNonEmptyParameters()
3564
- .filter((/**
3565
- * @param {?} p
3566
- * @return {?}
3567
- */
3568
- function (p) { return !p.definition.isRouteId; }))
3569
- .forEach((/**
3570
- * @param {?} p
3571
- * @return {?}
3572
- */
3573
- function (p) { return params[p.definition.name] = p.formattedValue(); }));
3574
- return params;
3880
+ function (event) {
3881
+ if (!this.navigationSession) { // We been activated by an external route rather than placeRouter.go(visit)
3882
+ console.log('navigation started', { firstTime: this.firstRoute });
3883
+ /** @type {?} */
3884
+ var session = NavigationSession.createExternal(this.firstRoute);
3885
+ if (event.navigationTrigger === 'popstate') {
3886
+ session.setPopstateReturn(this.router.routerState.snapshot.url);
3887
+ }
3888
+ this._navigationSessionModel.value = session;
3889
+ }
3890
+ this.firstRoute = false;
3575
3891
  };
3892
+ // @Trace()
3893
+ // @Trace()
3576
3894
  /**
3895
+ * @private
3577
3896
  * @return {?}
3578
3897
  */
3579
- ParameterSnapshot.prototype.getAllParameters = /**
3898
+ PlaceRouter.prototype.onAngularRouterFinished =
3899
+ // @Trace()
3900
+ /**
3901
+ * @private
3580
3902
  * @return {?}
3581
3903
  */
3582
3904
  function () {
3905
+ var _this = this;
3583
3906
  /** @type {?} */
3584
- var params = {};
3907
+ var session = this._navigationSessionModel.value;
3908
+ // Update visits before we end the navigation session. This allows the place out let to
3909
+ // gate ignore changes that occur while the visit is active
3585
3910
  /** @type {?} */
3586
- var routeIdParam = this.parameters.forEach((/**
3587
- * @param {?} p
3911
+ var visits = session.getVisits();
3912
+ visits.forEach((/**
3913
+ * @param {?} v
3588
3914
  * @return {?}
3589
3915
  */
3590
- function (p) {
3591
- params[p.definition.name] = p.value;
3916
+ function (v) {
3917
+ _this.placeHistory.add(v);
3592
3918
  }));
3593
- return params;
3919
+ this._activeVisits.value = visits;
3920
+ this._navigationSessionModel.value = null;
3594
3921
  };
3595
3922
  /**
3596
- * @template T, S
3597
- * @param {?} parameter
3598
- * @param {?} value
3923
+ * @param {?} activatedRoute
3599
3924
  * @return {?}
3600
3925
  */
3601
- ParameterSnapshot.prototype.replace = /**
3602
- * @template T, S
3603
- * @param {?} parameter
3604
- * @param {?} value
3926
+ PlaceRouter.prototype.getChildPath = /**
3927
+ * @param {?} activatedRoute
3605
3928
  * @return {?}
3606
3929
  */
3607
- function (parameter, value) {
3608
- return new ParameterSnapshot(this.placeDefinition, this.parameters.map((/**
3609
- * @param {?} p
3930
+ function (activatedRoute) {
3931
+ return ___default.flatten(activatedRoute.children.map((/**
3932
+ * @param {?} child
3610
3933
  * @return {?}
3611
3934
  */
3612
- function (p) {
3613
- return p.definition === parameter ? p.replace(value) : p;
3614
- })));
3615
- };
3616
- /**
3617
- * @param {?} injector
3618
- * @return {?}
3619
- */
3620
- ParameterSnapshot.prototype.sanitise = /**
3621
- * @param {?} injector
3622
- * @return {?}
3623
- */
3624
- function (injector) {
3625
- return __awaiter(this, void 0, void 0, function () {
3626
- var routeId, sanitisedValue, result, routeParameters, i, routeParameter, sanitisedValue;
3627
- return __generator(this, function (_a) {
3628
- switch (_a.label) {
3629
- case 0:
3630
- if (!this.hasRouteId()) return [3 /*break*/, 2];
3631
- routeId = this.getRouteIdParameter();
3632
- return [4 /*yield*/, routeId.sanitise(this, injector)];
3633
- case 1:
3634
- sanitisedValue = _a.sent();
3635
- if (routeId.hasChanged(sanitisedValue)) {
3636
- // if the route id has changed we redirect immediately as other
3637
- // parameter sanitisers might use it.
3638
- return [2 /*return*/, this.replace(routeId.definition, sanitisedValue)];
3639
- }
3640
- _a.label = 2;
3641
- case 2:
3642
- result = this;
3643
- routeParameters = this.getRouteParameters();
3644
- i = 0;
3645
- _a.label = 3;
3646
- case 3:
3647
- if (!(i < routeParameters.length)) return [3 /*break*/, 6];
3648
- routeParameter = routeParameters[i];
3649
- return [4 /*yield*/, routeParameter.sanitise(this, injector)];
3650
- case 4:
3651
- sanitisedValue = _a.sent();
3652
- if (routeParameter.hasChanged(sanitisedValue)) {
3653
- result = result.replace(routeParameter.definition, sanitisedValue);
3654
- }
3655
- _a.label = 5;
3656
- case 5:
3657
- i++;
3658
- return [3 /*break*/, 3];
3659
- case 6: return [2 /*return*/, result];
3660
- }
3661
- });
3662
- });
3935
+ function (child) { return child.url; })));
3663
3936
  };
3664
- var _a;
3665
- __decorate([
3666
- Memoize$1(),
3667
- __metadata("design:type", Function),
3668
- __metadata("design:paramtypes", [ParameterDefinition]),
3669
- __metadata("design:returntype", RouteParameterValue)
3670
- ], ParameterSnapshot.prototype, "getParameter", null);
3671
- __decorate([
3672
- Memoize$1(),
3673
- __metadata("design:type", Function),
3674
- __metadata("design:paramtypes", [ParameterDefinition]),
3675
- __metadata("design:returntype", typeof (_a = typeof S !== "undefined" && S) === "function" ? _a : Object)
3676
- ], ParameterSnapshot.prototype, "getValueOf", null);
3677
- __decorate([
3678
- Memoize$1(),
3679
- __metadata("design:type", Function),
3680
- __metadata("design:paramtypes", [String]),
3681
- __metadata("design:returntype", Object)
3682
- ], ParameterSnapshot.prototype, "getParameterValue", null);
3683
- __decorate([
3684
- Memoize$1(),
3685
- __metadata("design:type", Function),
3686
- __metadata("design:paramtypes", []),
3687
- __metadata("design:returntype", RouteParameterValue.Scalar)
3688
- ], ParameterSnapshot.prototype, "getRouteIdParameter", null);
3937
+ PlaceRouter.decorators = [
3938
+ { type: Injectable, args: [{
3939
+ providedIn: 'root'
3940
+ },] }
3941
+ ];
3942
+ /** @nocollapse */
3943
+ PlaceRouter.ctorParameters = function () { return [
3944
+ { type: Router },
3945
+ { type: Location },
3946
+ { type: PlaceHistory }
3947
+ ]; };
3948
+ /** @nocollapse */ PlaceRouter.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouter_Factory() { return new PlaceRouter(ɵɵinject(Router), ɵɵinject(Location), ɵɵinject(PlaceHistory)); }, token: PlaceRouter, providedIn: "root" });
3689
3949
  __decorate([
3690
- Memoize$1(),
3950
+ Trace(),
3691
3951
  __metadata("design:type", Function),
3692
- __metadata("design:paramtypes", []),
3693
- __metadata("design:returntype", Array)
3694
- ], ParameterSnapshot.prototype, "getRouteParameters", null);
3695
- return ParameterSnapshot;
3696
- }());
3952
+ __metadata("design:paramtypes", [ActivatedRoute, Visit, Visit]),
3953
+ __metadata("design:returntype", Promise)
3954
+ ], PlaceRouter.prototype, "pushVisitChangesToRoute", null);
3955
+ return PlaceRouter;
3956
+ }(GarbageCollector));
3697
3957
  if (false) {
3698
- /** @type {?} */
3699
- ParameterSnapshot.prototype.placeDefinition;
3700
3958
  /**
3701
3959
  * @type {?}
3702
3960
  * @private
3703
3961
  */
3704
- ParameterSnapshot.prototype.parameters;
3705
- }
3706
- (function (ParameterSnapshot) {
3962
+ PlaceRouter.prototype.firstRoute;
3707
3963
  /**
3708
- * @param {?} placeDef
3709
- * @param {?} params
3710
- * @param {?} urlSegments
3711
- * @return {?}
3964
+ * @type {?}
3965
+ * @private
3712
3966
  */
3713
- function create(placeDef, params, urlSegments) {
3714
- /** @type {?} */
3715
- var paramMap = new ConsolidatedParameterMap(params, urlSegments);
3716
- /** @type {?} */
3717
- var resolvedParameters = placeDef.getRouteParameters().map((/**
3718
- * @param {?} def
3719
- * @return {?}
3720
- */
3721
- function (def) { return RouteParameterValue.create(def, paramMap); }));
3722
- return new ParameterSnapshot(placeDef, resolvedParameters);
3723
- }
3724
- ParameterSnapshot.create = create;
3967
+ PlaceRouter.prototype._navigationSessionModel;
3725
3968
  /**
3726
- * This a work around for the fact that an activated route with multiple segments doesn't
3727
- * include the segment params in the paramMap as well as each segment returns an empty
3728
- * param map even when `parameter`s has content.
3969
+ * @type {?}
3970
+ * @private
3729
3971
  */
3730
- var ConsolidatedParameterMap = /** @class */ (function () {
3731
- function ConsolidatedParameterMap(paramMap, urlSegments) {
3732
- this.paramMaps = [paramMap].concat((urlSegments || []).map((/**
3733
- * @param {?} s
3734
- * @return {?}
3735
- */
3736
- function (s) { return new ParamMapAdapter(s.parameters); }))).filter((/**
3737
- * @param {?} m
3738
- * @return {?}
3739
- */
3740
- function (m) { return !!m; })); // the activated route param map can be null
3741
- }
3742
- /**
3743
- * @param {?} name
3744
- * @return {?}
3745
- */
3746
- ConsolidatedParameterMap.prototype.get = /**
3747
- * @param {?} name
3748
- * @return {?}
3749
- */
3750
- function (name) {
3751
- return this.paramMaps.find((/**
3752
- * @param {?} m
3753
- * @return {?}
3754
- */
3755
- function (m) { return m.has(name); })).get(name);
3756
- };
3757
- /**
3758
- * @param {?} name
3759
- * @return {?}
3760
- */
3761
- ConsolidatedParameterMap.prototype.getAll = /**
3762
- * @param {?} name
3763
- * @return {?}
3764
- */
3765
- function (name) {
3766
- return this.paramMaps.find((/**
3767
- * @param {?} m
3768
- * @return {?}
3769
- */
3770
- function (m) { return m.has(name); })).getAll(name);
3771
- };
3772
- /**
3773
- * @param {?} name
3774
- * @return {?}
3775
- */
3776
- ConsolidatedParameterMap.prototype.has = /**
3777
- * @param {?} name
3778
- * @return {?}
3779
- */
3780
- function (name) {
3781
- return !!this.paramMaps.find((/**
3782
- * @param {?} m
3783
- * @return {?}
3784
- */
3785
- function (m) { return m.has(name); }));
3786
- };
3787
- Object.defineProperty(ConsolidatedParameterMap.prototype, "keys", {
3788
- get: /**
3789
- * @return {?}
3790
- */
3791
- function () {
3792
- return this.paramMaps.reduce((/**
3793
- * @param {?} result
3794
- * @param {?} params
3795
- * @return {?}
3796
- */
3797
- function (result, params) { return result.concat(params.keys); }), []);
3798
- },
3799
- enumerable: true,
3800
- configurable: true
3801
- });
3802
- __decorate([
3803
- Memoize$1(),
3804
- __metadata("design:type", Array),
3805
- __metadata("design:paramtypes", [])
3806
- ], ConsolidatedParameterMap.prototype, "keys", null);
3807
- return ConsolidatedParameterMap;
3808
- }());
3809
- if (false) {
3810
- /**
3811
- * @type {?}
3812
- * @private
3813
- */
3814
- ConsolidatedParameterMap.prototype.paramMaps;
3815
- }
3816
- var ParamMapAdapter = /** @class */ (function () {
3817
- function ParamMapAdapter(params) {
3818
- this.params = params;
3819
- }
3820
- /**
3821
- * @param {?} name
3822
- * @return {?}
3823
- */
3824
- ParamMapAdapter.prototype.get = /**
3825
- * @param {?} name
3826
- * @return {?}
3827
- */
3828
- function (name) {
3829
- return this.params[name];
3830
- };
3831
- /**
3832
- * @param {?} name
3833
- * @return {?}
3834
- */
3835
- ParamMapAdapter.prototype.getAll = /**
3836
- * @param {?} name
3837
- * @return {?}
3838
- */
3839
- function (name) {
3840
- /** @type {?} */
3841
- var value = this.get(name);
3842
- return Array.isArray(value) ? value : [value];
3843
- };
3844
- /**
3845
- * @param {?} name
3846
- * @return {?}
3847
- */
3848
- ParamMapAdapter.prototype.has = /**
3849
- * @param {?} name
3850
- * @return {?}
3851
- */
3852
- function (name) {
3853
- return this.keys.includes(name);
3854
- };
3855
- Object.defineProperty(ParamMapAdapter.prototype, "keys", {
3856
- get: /**
3857
- * @return {?}
3858
- */
3859
- function () {
3860
- return Object.keys(this.params);
3861
- },
3862
- enumerable: true,
3863
- configurable: true
3864
- });
3865
- return ParamMapAdapter;
3866
- }());
3867
- if (false) {
3868
- /**
3869
- * @type {?}
3870
- * @private
3871
- */
3872
- ParamMapAdapter.prototype.params;
3873
- }
3874
- })(ParameterSnapshot || (ParameterSnapshot = {}));
3972
+ PlaceRouter.prototype._activeVisits;
3973
+ /** @type {?} */
3974
+ PlaceRouter.prototype.navigationSessionActive;
3975
+ /** @type {?} */
3976
+ PlaceRouter.prototype.activeVisitIndex;
3977
+ /**
3978
+ * @type {?}
3979
+ * @private
3980
+ */
3981
+ PlaceRouter.prototype.router;
3982
+ /** @type {?} */
3983
+ PlaceRouter.prototype.angularLocation;
3984
+ /** @type {?} */
3985
+ PlaceRouter.prototype.placeHistory;
3986
+ }
3875
3987
 
3876
3988
  /**
3877
3989
  * @fileoverview added by tsickle
@@ -3949,63 +4061,62 @@ if (false) {
3949
4061
  }
3950
4062
  var PlaceOutletComponent = /** @class */ (function (_super) {
3951
4063
  __extends(PlaceOutletComponent, _super);
3952
- function PlaceOutletComponent(router, placeHistory) {
4064
+ function PlaceOutletComponent(router, placeRouter, placeHistory) {
3953
4065
  var _this = _super.call(this) || this;
3954
4066
  _this.router = router;
4067
+ _this.placeRouter = placeRouter;
3955
4068
  _this.placeHistory = placeHistory;
3956
4069
  _this.animate = true;
4070
+ _this.placeChanged = new EventEmitter();
3957
4071
  _this._activePlace = new MutableValueModel();
3958
- _this._incomingRouteChange = new Guard$1();
3959
4072
  _this._inOutletUpdate = new Guard$1();
3960
4073
  _this._activatedRouteModel = new MutableValueModel();
3961
4074
  _this._placeDefinition = new MutableValueModel();
3962
- _this._resolvedParameters = new MutableValueModel();
4075
+ /**
4076
+ * TODO: This is now really a visit
4077
+ */
4078
+ _this._placeVisit = new MutableValueModel();
3963
4079
  var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
4080
+ // Handle incoming route changes.
3964
4081
  /** @type {?} */
3965
- var paramMap = chain(_this._activatedRouteModel).pullObservableValue((/**
3966
- * @param {?} ar
3967
- * @return {?}
3968
- */
3969
- function (ar) { return ar.paramMap; }));
4082
+ var inRouteVisitUpdate = new Guard$1();
3970
4083
  /** @type {?} */
3971
- var urls = chain(_this._activatedRouteModel).pullObservableValue((/**
3972
- * @param {?} ar
3973
- * @return {?}
3974
- */
3975
- function (ar) { return ar.url; }));
3976
- _this.placeConfigured = valueOf.all(chain(_this._inOutletUpdate).isFalsey(), _this._placeDefinition, paramMap, urls).areTruthy();
3977
- when.anyOf(paramMap, urls).changes((/**
4084
+ var routeVisit = chain(_this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
4085
+ when.valueOf(routeVisit).changes((/**
4086
+ * @param {?} visit
3978
4087
  * @return {?}
3979
4088
  */
3980
- function () {
3981
- /** @type {?} */
3982
- var snapshot = ParameterSnapshot.create(_this._placeDefinition.value, paramMap.value, urls.value);
3983
- _this._incomingRouteChange.whileTrue((/**
3984
- * @return {?}
3985
- */
3986
- function () {
3987
- _this._resolvedParameters.value = snapshot;
3988
- _this.placeHistory.add(snapshot);
3989
- }));
3990
- }), {
3991
- postponeUntil: _this.placeConfigured
3992
- });
3993
- when.valueOf(_this._resolvedParameters).changes((/**
4089
+ function (visit) {
4090
+ if (visit) {
4091
+ inRouteVisitUpdate.whileTrue((/**
4092
+ * @return {?}
4093
+ */
4094
+ function () {
4095
+ _this._placeVisit.value = visit;
4096
+ }));
4097
+ }
4098
+ }));
4099
+ // Handle component based changes
4100
+ when.valueOf(_this._placeVisit).changes((/**
3994
4101
  * @param {?} next
3995
4102
  * @param {?} previous
3996
4103
  * @return {?}
3997
4104
  */
3998
4105
  function (next, previous) {
3999
- _this.placeHistory.add(next); // the above route change doesn't seem to propagate back in, so I'm add the state to the history manually for now.
4000
- _this.pushChangesToRoute(next, previous);
4106
+ _this.pushVisitChangesToRoute(next, previous);
4001
4107
  }), {
4002
- unless: _this.incomingRouteChange
4108
+ unless: inRouteVisitUpdate
4003
4109
  });
4110
+ chain(_this._activePlace)
4111
+ .postponeWhile(placeRouter.navigationSessionActive)
4112
+ .subscribe((/**
4113
+ * @param {?} place
4114
+ * @return {?}
4115
+ */
4116
+ function (place) { return _this.placeChanged.emit(place); }));
4004
4117
  return _this;
4005
4118
  // const txo = new TransactionObserver().onEvent(e => console.log(e.toString()));
4006
- // txo.observe('paramMap', paramMap);
4007
- // txo.observe('urls', urls);
4008
- // txo.observe('this._resolvedParameters', this._resolvedParameters);
4119
+ // txo.observe('inRouteVisitUpdate', inRouteVisitUpdate);
4009
4120
  }
4010
4121
  /**
4011
4122
  * @return {?}
@@ -4015,17 +4126,22 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4015
4126
  */
4016
4127
  function () {
4017
4128
  };
4018
- Object.defineProperty(PlaceOutletComponent.prototype, "incomingRouteChange", {
4019
- get: /**
4020
- * @return {?}
4021
- */
4022
- function () {
4023
- return this._incomingRouteChange;
4024
- },
4025
- enumerable: true,
4026
- configurable: true
4027
- });
4028
- Object.defineProperty(PlaceOutletComponent.prototype, "activePlace", {
4129
+ /**
4130
+ * @param {?} next
4131
+ * @param {?} previous
4132
+ * @return {?}
4133
+ */
4134
+ PlaceOutletComponent.prototype.pushVisitChangesToRoute = /**
4135
+ * @param {?} next
4136
+ * @param {?} previous
4137
+ * @return {?}
4138
+ */
4139
+ function (next, previous) {
4140
+ /** @type {?} */
4141
+ var activatedRoute = this._activatedRouteModel.value;
4142
+ this.placeRouter.pushVisitChangesToRoute(activatedRoute, previous, next);
4143
+ };
4144
+ Object.defineProperty(PlaceOutletComponent.prototype, "activePlaceModel", {
4029
4145
  get: /**
4030
4146
  * @return {?}
4031
4147
  */
@@ -4055,7 +4171,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4055
4171
  _this._activePlace.value = place;
4056
4172
  _this._activatedRouteModel.value = routerOutlet.activatedRoute;
4057
4173
  _this._placeDefinition.value = place.placeDefinition;
4058
- place.initialiseBindings(_this._resolvedParameters);
4174
+ place.initialiseBindings(_this._placeVisit);
4059
4175
  }
4060
4176
  catch (error) {
4061
4177
  console.error(error);
@@ -4110,32 +4226,15 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4110
4226
  }
4111
4227
  };
4112
4228
  /**
4113
- * @param {?} next
4114
- * @param {?} previous
4115
- * @return {?}
4116
- */
4117
- PlaceOutletComponent.prototype.pushChangesToRoute = /**
4118
- * @param {?} next
4119
- * @param {?} previous
4120
- * @return {?}
4121
- */
4122
- function (next, previous) {
4123
- /** @type {?} */
4124
- var activatedRoute = this._activatedRouteModel.value;
4125
- this.router.pushParameterChangesToRoute(activatedRoute, previous, next);
4126
- };
4127
- /**
4128
- * @param {?} snapshot
4129
- * @param {?} callback
4229
+ * @param {?} placeDestination
4130
4230
  * @return {?}
4131
4231
  */
4132
- PlaceOutletComponent.prototype.sanitise = /**
4133
- * @param {?} snapshot
4134
- * @param {?} callback
4232
+ PlaceOutletComponent.prototype.activate = /**
4233
+ * @param {?} placeDestination
4135
4234
  * @return {?}
4136
4235
  */
4137
- function (snapshot, callback) {
4138
- return snapshot;
4236
+ function (placeDestination) {
4237
+ // this.router.
4139
4238
  };
4140
4239
  PlaceOutletComponent.decorators = [
4141
4240
  { type: Component, args: [{
@@ -4147,11 +4246,13 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4147
4246
  ];
4148
4247
  /** @nocollapse */
4149
4248
  PlaceOutletComponent.ctorParameters = function () { return [
4249
+ { type: Router },
4150
4250
  { type: PlaceRouter },
4151
4251
  { type: PlaceHistory }
4152
4252
  ]; };
4153
4253
  PlaceOutletComponent.propDecorators = {
4154
4254
  animate: [{ type: Input }],
4255
+ placeChanged: [{ type: Output }],
4155
4256
  routerOut: [{ type: ViewChild, args: ['routeOutlet', { static: true },] }]
4156
4257
  };
4157
4258
  return PlaceOutletComponent;
@@ -4160,17 +4261,14 @@ if (false) {
4160
4261
  /** @type {?} */
4161
4262
  PlaceOutletComponent.prototype.animate;
4162
4263
  /** @type {?} */
4264
+ PlaceOutletComponent.prototype.placeChanged;
4265
+ /** @type {?} */
4163
4266
  PlaceOutletComponent.prototype.routerOut;
4164
4267
  /**
4165
4268
  * @type {?}
4166
4269
  * @private
4167
4270
  */
4168
4271
  PlaceOutletComponent.prototype._activePlace;
4169
- /**
4170
- * @type {?}
4171
- * @private
4172
- */
4173
- PlaceOutletComponent.prototype._incomingRouteChange;
4174
4272
  /**
4175
4273
  * @type {?}
4176
4274
  * @private
@@ -4186,18 +4284,21 @@ if (false) {
4186
4284
  * @private
4187
4285
  */
4188
4286
  PlaceOutletComponent.prototype._placeDefinition;
4189
- /** @type {?} */
4190
- PlaceOutletComponent.prototype._resolvedParameters;
4191
4287
  /**
4288
+ * TODO: This is now really a visit
4192
4289
  * @type {?}
4193
- * @private
4194
4290
  */
4195
- PlaceOutletComponent.prototype.placeConfigured;
4291
+ PlaceOutletComponent.prototype._placeVisit;
4196
4292
  /**
4197
4293
  * @type {?}
4198
4294
  * @private
4199
4295
  */
4200
4296
  PlaceOutletComponent.prototype.router;
4297
+ /**
4298
+ * @type {?}
4299
+ * @private
4300
+ */
4301
+ PlaceOutletComponent.prototype.placeRouter;
4201
4302
  /**
4202
4303
  * @type {?}
4203
4304
  * @private
@@ -4217,7 +4318,7 @@ var TabbedPlaceNavigationComponent = /** @class */ (function (_super) {
4217
4318
  TabbedPlaceNavigationComponent.decorators = [
4218
4319
  { type: Component, args: [{
4219
4320
  selector: 'angular-ui-powerups-tabbed-place-navigation',
4220
- template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let place of placeDefinitions.value\"\n [routerLink]='place.path'\n routerLinkActive #rla=\"routerLinkActive\"\n [active]=\"rla.isActive\"\n [matTooltip]=\"getNav(place).tooltip()\">\n <mat-icon *ngIf=\"getNav(place).icon()\">{{getNav(place).icon()}}</mat-icon>\n <span>{{getNav(place).title()}}</span>\n </a>\n</nav>\n",
4321
+ template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let place of placeDefinitions.value\"\n [routerLink]='place.path'\n [replaceUrl]=\"true\"\n routerLinkActive #rla=\"routerLinkActive\"\n [active]=\"rla.isActive\"\n [matTooltip]=\"getNav(place).tooltip()\">\n <mat-icon *ngIf=\"getNav(place).icon()\">{{getNav(place).icon()}}</mat-icon>\n <span>{{getNav(place).title()}}</span>\n </a>\n</nav>\n",
4221
4322
  styles: [""]
4222
4323
  }] }
4223
4324
  ];
@@ -4281,7 +4382,8 @@ var AngularUiPowerupsModule = /** @class */ (function () {
4281
4382
  NumberInputComponent,
4282
4383
  StringInputComponent,
4283
4384
  PasswordInputComponent,
4284
- SelectInputComponent
4385
+ SelectInputComponent,
4386
+ NoopComponent
4285
4387
  ],
4286
4388
  imports: [
4287
4389
  CommonModule,
@@ -4302,7 +4404,8 @@ var AngularUiPowerupsModule = /** @class */ (function () {
4302
4404
  PasswordInputComponent,
4303
4405
  SelectInputComponent,
4304
4406
  InteractionModule,
4305
- PlaceModule
4407
+ PlaceModule,
4408
+ NoopComponent
4306
4409
  ]
4307
4410
  },] }
4308
4411
  ];
@@ -4674,12 +4777,25 @@ if (false) {
4674
4777
  * @fileoverview added by tsickle
4675
4778
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4676
4779
  */
4677
- var CloseInteractionGuard = /** @class */ (function () {
4678
- function CloseInteractionGuard(router, injector, interactionContext) {
4780
+ var InteractionGuard = /** @class */ (function () {
4781
+ function InteractionGuard(router, injector, interactionContext) {
4679
4782
  this.router = router;
4680
4783
  this.injector = injector;
4681
4784
  this.interactionContext = interactionContext;
4682
4785
  }
4786
+ /**
4787
+ * @param {?} route
4788
+ * @param {?} state
4789
+ * @return {?}
4790
+ */
4791
+ InteractionGuard.prototype.canActivate = /**
4792
+ * @param {?} route
4793
+ * @param {?} state
4794
+ * @return {?}
4795
+ */
4796
+ function (route, state) {
4797
+ return true;
4798
+ };
4683
4799
  /**
4684
4800
  * @param {?} component
4685
4801
  * @param {?} currentRoute
@@ -4687,7 +4803,7 @@ var CloseInteractionGuard = /** @class */ (function () {
4687
4803
  * @param {?=} nextState
4688
4804
  * @return {?}
4689
4805
  */
4690
- CloseInteractionGuard.prototype.canDeactivate = /**
4806
+ InteractionGuard.prototype.canDeactivate = /**
4691
4807
  * @param {?} component
4692
4808
  * @param {?} currentRoute
4693
4809
  * @param {?} currentState
@@ -4697,36 +4813,48 @@ var CloseInteractionGuard = /** @class */ (function () {
4697
4813
  function (component, currentRoute, currentState, nextState) {
4698
4814
  return !this.interactionContext.isActive();
4699
4815
  };
4700
- CloseInteractionGuard.decorators = [
4816
+ InteractionGuard.decorators = [
4701
4817
  { type: Injectable, args: [{
4702
4818
  providedIn: 'root'
4703
4819
  },] }
4704
4820
  ];
4705
4821
  /** @nocollapse */
4706
- CloseInteractionGuard.ctorParameters = function () { return [
4822
+ InteractionGuard.ctorParameters = function () { return [
4707
4823
  { type: Router },
4708
4824
  { type: Injector },
4709
4825
  { type: InteractionContext }
4710
4826
  ]; };
4711
- /** @nocollapse */ CloseInteractionGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function CloseInteractionGuard_Factory() { return new CloseInteractionGuard(ɵɵinject(Router), ɵɵinject(INJECTOR), ɵɵinject(InteractionContext)); }, token: CloseInteractionGuard, providedIn: "root" });
4712
- return CloseInteractionGuard;
4827
+ /** @nocollapse */ InteractionGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function InteractionGuard_Factory() { return new InteractionGuard(ɵɵinject(Router), ɵɵinject(INJECTOR), ɵɵinject(InteractionContext)); }, token: InteractionGuard, providedIn: "root" });
4828
+ __decorate([
4829
+ Trace(),
4830
+ __metadata("design:type", Function),
4831
+ __metadata("design:paramtypes", [ActivatedRouteSnapshot, RouterStateSnapshot]),
4832
+ __metadata("design:returntype", Object)
4833
+ ], InteractionGuard.prototype, "canActivate", null);
4834
+ __decorate([
4835
+ Trace(),
4836
+ __metadata("design:type", Function),
4837
+ __metadata("design:paramtypes", [NoopComponent, ActivatedRouteSnapshot, RouterStateSnapshot, RouterStateSnapshot]),
4838
+ __metadata("design:returntype", Object)
4839
+ ], InteractionGuard.prototype, "canDeactivate", null);
4840
+ return InteractionGuard;
4713
4841
  }());
4714
4842
  if (false) {
4715
4843
  /**
4716
4844
  * @type {?}
4717
4845
  * @private
4718
4846
  */
4719
- CloseInteractionGuard.prototype.router;
4847
+ InteractionGuard.prototype.router;
4720
4848
  /**
4721
4849
  * @type {?}
4722
4850
  * @private
4723
4851
  */
4724
- CloseInteractionGuard.prototype.injector;
4852
+ InteractionGuard.prototype.injector;
4725
4853
  /**
4726
4854
  * @type {?}
4727
4855
  * @private
4728
4856
  */
4729
- CloseInteractionGuard.prototype.interactionContext;
4857
+ InteractionGuard.prototype.interactionContext;
4730
4858
  }
4731
4859
 
4732
4860
  /**
@@ -4754,7 +4882,289 @@ if (false) {
4754
4882
  /**
4755
4883
  * @return {?}
4756
4884
  */
4757
- NavItem.prototype.tooltip = function () { };
4885
+ NavItem.prototype.tooltip = function () { };
4886
+ }
4887
+
4888
+ /**
4889
+ * @fileoverview added by tsickle
4890
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4891
+ */
4892
+ /**
4893
+ * @param {?} options
4894
+ * @return {?}
4895
+ */
4896
+ function Place(options) {
4897
+ return (/**
4898
+ * @param {?} target
4899
+ * @return {?}
4900
+ */
4901
+ function (target) {
4902
+ if (PlaceComponent.isPlaceComponentConstructor(target)) {
4903
+ PlaceComponent.injectDefinition(target, new PlaceDefinition(target, options.path, isNil(options.authenticate) ? false : options.authenticate, options.order, options.data, PlaceComponent.getRouteParameters(target), (options.children || []).map((/**
4904
+ * @param {?} c
4905
+ * @return {?}
4906
+ */
4907
+ function (c) { return PlaceComponent.getDefinition(c); }))));
4908
+ }
4909
+ else {
4910
+ lang.illegalState(target + " must extend PlaceComponent to use the @Place decorator");
4911
+ }
4912
+ });
4913
+ }
4914
+ (function (Place) {
4915
+ /**
4916
+ * @record
4917
+ */
4918
+ function Options() { }
4919
+ Place.Options = Options;
4920
+ if (false) {
4921
+ /** @type {?} */
4922
+ Options.prototype.path;
4923
+ /** @type {?} */
4924
+ Options.prototype.order;
4925
+ /** @type {?|undefined} */
4926
+ Options.prototype.data;
4927
+ /** @type {?|undefined} */
4928
+ Options.prototype.authenticate;
4929
+ /** @type {?|undefined} */
4930
+ Options.prototype.children;
4931
+ }
4932
+ })(Place || (Place = {}));
4933
+
4934
+ /**
4935
+ * @fileoverview added by tsickle
4936
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4937
+ */
4938
+ // WARNING: interface has both a type and a value, skipping emit
4939
+ var Formatter;
4940
+ (function (Formatter) {
4941
+ var StringType = /** @class */ (function () {
4942
+ function StringType() {
4943
+ }
4944
+ /**
4945
+ * @param {?} value
4946
+ * @return {?}
4947
+ */
4948
+ StringType.prototype.format = /**
4949
+ * @param {?} value
4950
+ * @return {?}
4951
+ */
4952
+ function (value) {
4953
+ return value;
4954
+ };
4955
+ /**
4956
+ * @param {?} value
4957
+ * @return {?}
4958
+ */
4959
+ StringType.prototype.parse = /**
4960
+ * @param {?} value
4961
+ * @return {?}
4962
+ */
4963
+ function (value) {
4964
+ return value;
4965
+ };
4966
+ return StringType;
4967
+ }());
4968
+ var NumberType = /** @class */ (function () {
4969
+ function NumberType() {
4970
+ }
4971
+ /**
4972
+ * @param {?} value
4973
+ * @return {?}
4974
+ */
4975
+ NumberType.prototype.format = /**
4976
+ * @param {?} value
4977
+ * @return {?}
4978
+ */
4979
+ function (value) {
4980
+ return ___default.isNumber(value) && !___default.isNaN(value) ? "" + value : null;
4981
+ };
4982
+ /**
4983
+ * @param {?} value
4984
+ * @return {?}
4985
+ */
4986
+ NumberType.prototype.parse = /**
4987
+ * @param {?} value
4988
+ * @return {?}
4989
+ */
4990
+ function (value) {
4991
+ /** @type {?} */
4992
+ var parsed = Number.parseFloat(value);
4993
+ return ___default.isNaN(parsed) ? null : parsed;
4994
+ };
4995
+ return NumberType;
4996
+ }());
4997
+ var BooleanType = /** @class */ (function () {
4998
+ function BooleanType() {
4999
+ }
5000
+ /**
5001
+ * @param {?} value
5002
+ * @return {?}
5003
+ */
5004
+ BooleanType.prototype.format = /**
5005
+ * @param {?} value
5006
+ * @return {?}
5007
+ */
5008
+ function (value) {
5009
+ return value ? 'true' : 'false';
5010
+ };
5011
+ /**
5012
+ * @param {?} value
5013
+ * @return {?}
5014
+ */
5015
+ BooleanType.prototype.parse = /**
5016
+ * @param {?} value
5017
+ * @return {?}
5018
+ */
5019
+ function (value) {
5020
+ return value === 'true';
5021
+ };
5022
+ return BooleanType;
5023
+ }());
5024
+ Formatter.STRING = new StringType();
5025
+ Formatter.NUMBER = new NumberType();
5026
+ Formatter.BOOLEAN = new BooleanType();
5027
+ })(Formatter || (Formatter = {}));
5028
+
5029
+ /**
5030
+ * @fileoverview added by tsickle
5031
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5032
+ */
5033
+ /**
5034
+ * @record
5035
+ */
5036
+ function JsonArray() { }
5037
+ /**
5038
+ * @record
5039
+ */
5040
+ function JsonMap() { }
5041
+
5042
+ /**
5043
+ * @fileoverview added by tsickle
5044
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5045
+ */
5046
+ /**
5047
+ * @record
5048
+ * @template T
5049
+ */
5050
+ function RouteIdOptions() { }
5051
+ if (false) {
5052
+ /** @type {?|undefined} */
5053
+ RouteIdOptions.prototype.as;
5054
+ /** @type {?|undefined} */
5055
+ RouteIdOptions.prototype.optional;
5056
+ /** @type {?|undefined} */
5057
+ RouteIdOptions.prototype.remember;
5058
+ /** @type {?|undefined} */
5059
+ RouteIdOptions.prototype.defaultValue;
5060
+ }
5061
+ /**
5062
+ * @record
5063
+ * @template T
5064
+ */
5065
+ function RouteParameterOptions() { }
5066
+ if (false) {
5067
+ /** @type {?|undefined} */
5068
+ RouteParameterOptions.prototype.as;
5069
+ /** @type {?|undefined} */
5070
+ RouteParameterOptions.prototype.optional;
5071
+ /** @type {?|undefined} */
5072
+ RouteParameterOptions.prototype.remember;
5073
+ /** @type {?|undefined} */
5074
+ RouteParameterOptions.prototype.defaultValue;
5075
+ /** @type {?|undefined} */
5076
+ RouteParameterOptions.prototype.storeInUrl;
5077
+ }
5078
+ /**
5079
+ * @record
5080
+ * @template T
5081
+ */
5082
+ function RouteListParameterOptions() { }
5083
+ if (false) {
5084
+ /** @type {?|undefined} */
5085
+ RouteListParameterOptions.prototype.as;
5086
+ /** @type {?|undefined} */
5087
+ RouteListParameterOptions.prototype.optional;
5088
+ /** @type {?|undefined} */
5089
+ RouteListParameterOptions.prototype.remember;
5090
+ /** @type {?|undefined} */
5091
+ RouteListParameterOptions.prototype.defaultValue;
5092
+ /** @type {?|undefined} */
5093
+ RouteListParameterOptions.prototype.storeInUrl;
5094
+ }
5095
+ /**
5096
+ * @template T
5097
+ * @param {?} type
5098
+ * @param {?=} options
5099
+ * @return {?}
5100
+ */
5101
+ function RouteId(type, options) {
5102
+ return (/**
5103
+ * @param {?} prototype
5104
+ * @param {?} propertyKey
5105
+ * @return {?}
5106
+ */
5107
+ function (prototype, propertyKey) {
5108
+ /** @type {?} */
5109
+ var param = new ParameterDefinition.RouteId(propertyKey.toString(), options, type);
5110
+ Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
5111
+ UseDelegate()(prototype, propertyKey);
5112
+ });
5113
+ }
5114
+ /**
5115
+ * @template T
5116
+ * @param {?=} options
5117
+ * @return {?}
5118
+ */
5119
+ function VisitParameter(options) {
5120
+ return (/**
5121
+ * @param {?} prototype
5122
+ * @param {?} propertyKey
5123
+ * @return {?}
5124
+ */
5125
+ function (prototype, propertyKey) {
5126
+ /** @type {?} */
5127
+ var param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options, options.storeInUrl);
5128
+ Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
5129
+ UseDelegate()(prototype, propertyKey);
5130
+ });
5131
+ }
5132
+ /**
5133
+ * @template E
5134
+ * @param {?=} options
5135
+ * @return {?}
5136
+ */
5137
+ function VisitParameterList(options) {
5138
+ return (/**
5139
+ * @param {?} prototype
5140
+ * @param {?} propertyKey
5141
+ * @return {?}
5142
+ */
5143
+ function (prototype, propertyKey) {
5144
+ /** @type {?} */
5145
+ var param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options, options.storeInUrl);
5146
+ Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
5147
+ UseDelegate()(prototype, propertyKey);
5148
+ });
5149
+ }
5150
+
5151
+ /**
5152
+ * @fileoverview added by tsickle
5153
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5154
+ */
5155
+ /**
5156
+ * @record
5157
+ * @template S
5158
+ */
5159
+ function ParameterSanitiser() { }
5160
+ if (false) {
5161
+ /**
5162
+ * @param {?} parameterValue
5163
+ * @param {?=} visit
5164
+ * @param {?=} injector
5165
+ * @return {?}
5166
+ */
5167
+ ParameterSanitiser.prototype.sanitise = function (parameterValue, visit, injector) { };
4758
5168
  }
4759
5169
 
4760
5170
  /**
@@ -4762,67 +5172,116 @@ if (false) {
4762
5172
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4763
5173
  */
4764
5174
  /**
4765
- * @param {?} options
4766
- * @return {?}
5175
+ * @record
5176
+ * @template T
4767
5177
  */
4768
- function Place(options) {
4769
- return (/**
4770
- * @param {?} target
5178
+ function ParameterSnapshot() { }
5179
+ if (false) {
5180
+ /** @type {?} */
5181
+ ParameterSnapshot.prototype.definition;
5182
+ /** @type {?} */
5183
+ ParameterSnapshot.prototype.value;
5184
+ /**
4771
5185
  * @return {?}
4772
5186
  */
4773
- function (target) {
4774
- if (PlaceComponent.isPlaceComponentConstructor(target)) {
4775
- PlaceComponent.injectDefinition(target, new PlaceDefinition(target, options.path, isNil(options.authenticate) ? false : options.authenticate, options.order, options.data, PlaceComponent.getRouteParameters(target), (options.children || []).map((/**
4776
- * @param {?} c
4777
- * @return {?}
4778
- */
4779
- function (c) { return PlaceComponent.getDefinition(c); }))));
4780
- }
4781
- else {
4782
- lang.illegalState(target + " must extend PlaceComponent to use the @Place decorator");
4783
- }
4784
- });
5187
+ ParameterSnapshot.prototype.isMissing = function () { };
4785
5188
  }
4786
- (function (Place) {
4787
- /**
4788
- * @record
4789
- */
4790
- function Options() { }
4791
- Place.Options = Options;
4792
- if (false) {
4793
- /** @type {?} */
4794
- Options.prototype.path;
4795
- /** @type {?} */
4796
- Options.prototype.order;
4797
- /** @type {?|undefined} */
4798
- Options.prototype.data;
4799
- /** @type {?|undefined} */
4800
- Options.prototype.authenticate;
4801
- /** @type {?|undefined} */
4802
- Options.prototype.children;
4803
- }
4804
- })(Place || (Place = {}));
4805
5189
 
4806
5190
  /**
4807
5191
  * @fileoverview added by tsickle
4808
5192
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4809
5193
  */
4810
- /**
4811
- * @record
4812
- */
4813
- function Visit() { }
4814
- if (false) {
4815
- /** @type {?} */
4816
- Visit.prototype.placeDefinition;
5194
+ var VisitSanitiser = /** @class */ (function () {
5195
+ function VisitSanitiser(activatedRoute, router, placeHistory, injector) {
5196
+ this.activatedRoute = activatedRoute;
5197
+ this.router = router;
5198
+ this.placeHistory = placeHistory;
5199
+ this.injector = injector;
5200
+ }
5201
+ // @Trace()
5202
+ // @Trace()
4817
5203
  /**
5204
+ * @param {?} visit
4818
5205
  * @return {?}
4819
5206
  */
4820
- Visit.prototype.getRouteIdValue = function () { };
5207
+ VisitSanitiser.prototype.sanitise =
5208
+ // @Trace()
4821
5209
  /**
4822
- * @param {?} name
5210
+ * @param {?} visit
4823
5211
  * @return {?}
4824
5212
  */
4825
- Visit.prototype.getParameterValue = function (name) { };
5213
+ function (visit) {
5214
+ return __awaiter(this, void 0, void 0, function () {
5215
+ var placeDef, routeIdDef, routeId, sanitisedValue, parameterDefs, sanitisedVisit, i, def, value, sanitisedValue;
5216
+ return __generator(this, function (_a) {
5217
+ switch (_a.label) {
5218
+ case 0:
5219
+ placeDef = visit.placeDefinition;
5220
+ if (!placeDef.hasRouteId()) return [3 /*break*/, 2];
5221
+ routeIdDef = placeDef.getRouteIdParameterDef();
5222
+ routeId = visit.getRouteId();
5223
+ return [4 /*yield*/, routeIdDef.sanitise(routeId, visit, this.placeHistory, this.injector)];
5224
+ case 1:
5225
+ sanitisedValue = _a.sent();
5226
+ console.log({ routeId: routeId, sanitisedValue: sanitisedValue });
5227
+ // ###------- EARLY EXIT --------###
5228
+ if (routeIdDef.hasChanged(routeId, sanitisedValue)) {
5229
+ // if the route id has changed we redirect immediately as other
5230
+ // parameter sanitisers might use it.
5231
+ return [2 /*return*/, visit.replace(routeIdDef, sanitisedValue)];
5232
+ }
5233
+ _a.label = 2;
5234
+ case 2:
5235
+ // if we didn't replace the routeId we continue the url present parameters.
5236
+ parameterDefs = placeDef.getVisitParameterDefs({
5237
+ includeRouteParameters: true,
5238
+ includeNonRouteParameters: true
5239
+ });
5240
+ sanitisedVisit = visit;
5241
+ i = 0;
5242
+ _a.label = 3;
5243
+ case 3:
5244
+ if (!(i < parameterDefs.length)) return [3 /*break*/, 6];
5245
+ def = parameterDefs[i];
5246
+ value = visit.getParameter(def.name);
5247
+ return [4 /*yield*/, def.sanitise(value, sanitisedVisit, this.placeHistory, this.injector)];
5248
+ case 4:
5249
+ sanitisedValue = _a.sent();
5250
+ if (def.hasChanged(value, sanitisedValue)) {
5251
+ sanitisedVisit = sanitisedVisit.replace(def, sanitisedValue);
5252
+ }
5253
+ _a.label = 5;
5254
+ case 5:
5255
+ i++;
5256
+ return [3 /*break*/, 3];
5257
+ case 6: return [2 /*return*/, sanitisedVisit.hasChangedFrom(visit) ? sanitisedVisit : visit];
5258
+ }
5259
+ });
5260
+ });
5261
+ };
5262
+ return VisitSanitiser;
5263
+ }());
5264
+ if (false) {
5265
+ /**
5266
+ * @type {?}
5267
+ * @private
5268
+ */
5269
+ VisitSanitiser.prototype.activatedRoute;
5270
+ /**
5271
+ * @type {?}
5272
+ * @private
5273
+ */
5274
+ VisitSanitiser.prototype.router;
5275
+ /**
5276
+ * @type {?}
5277
+ * @private
5278
+ */
5279
+ VisitSanitiser.prototype.placeHistory;
5280
+ /**
5281
+ * @type {?}
5282
+ * @private
5283
+ */
5284
+ VisitSanitiser.prototype.injector;
4826
5285
  }
4827
5286
 
4828
5287
  /**
@@ -4837,6 +5296,22 @@ var LeavePlaceGuard = /** @class */ (function () {
4837
5296
  this.interactionContext = interactionContext;
4838
5297
  this.angularLocation = angularLocation;
4839
5298
  }
5299
+ /**
5300
+ * @private
5301
+ * @param {?} nextState
5302
+ * @param {?} placeDefinitionPath
5303
+ * @return {?}
5304
+ */
5305
+ LeavePlaceGuard.prototype.isLeavingTheCurrentPlace = /**
5306
+ * @private
5307
+ * @param {?} nextState
5308
+ * @param {?} placeDefinitionPath
5309
+ * @return {?}
5310
+ */
5311
+ function (nextState, placeDefinitionPath) {
5312
+ // TODO: this will break with child routes... need to examine the router states properly.
5313
+ return !nextState.url.startsWith(placeDefinitionPath);
5314
+ };
4840
5315
  /**
4841
5316
  * @param {?} component
4842
5317
  * @param {?} currentRoute
@@ -4859,23 +5334,43 @@ var LeavePlaceGuard = /** @class */ (function () {
4859
5334
  case 0:
4860
5335
  placeDefinitionPath = "/" + component.placeDefinition.path;
4861
5336
  if (!this.placeRouter.navigationSession.alreadyAccepted(component)) return [3 /*break*/, 1];
5337
+ // We'll get called multiple times if there's any parameter sanitisation so
5338
+ // we always return true if we accepted on a previous cycle of the current
5339
+ // navigation session.
4862
5340
  return [2 /*return*/, true];
4863
5341
  case 1:
4864
- if (!!nextState.url.startsWith(placeDefinitionPath)) return [3 /*break*/, 3];
4865
5342
  self_1 = this;
5343
+ canLeave = true;
5344
+ if (!this.isLeavingTheCurrentPlace(nextState, placeDefinitionPath)) return [3 /*break*/, 4];
5345
+ // we check the interaction first, so that components that don't need to check if they're in an
5346
+ // interaction during the canDeactivate cycle.
5347
+ // TODO: Add tests: show dialog -> hit back -> same route
5348
+ if (this.interactionContext.isActive()) {
5349
+ canLeave = false;
5350
+ console.log('cancelling', { activity: this.interactionContext.currentActivity });
5351
+ this.interactionContext.currentActivity.cancel(null);
5352
+ }
5353
+ if (!canLeave) return [3 /*break*/, 3];
4866
5354
  return [4 /*yield*/, component.canDeactivate()];
4867
5355
  case 2:
5356
+ // TODO: Add tests: hit back -> confirm leave dialog -> hit back -> close dialog -> hit back -> confirm leave dialog.
4868
5357
  canLeave = _a.sent();
4869
- // component is happy to leave but we need to check if it's left an interaction
4870
- // open. If so we close and stay where we are.
4871
- if (canLeave && this.interactionContext.isActive()) {
4872
- canLeave = false;
4873
- console.log("cancelling", { activity: this.interactionContext.currentActivity });
5358
+ _a.label = 3;
5359
+ case 3: return [3 /*break*/, 5];
5360
+ case 4:
5361
+ if (this.interactionContext.isActive()) {
5362
+ console.log('cancelling', { activity: this.interactionContext.currentActivity });
4874
5363
  this.interactionContext.currentActivity.cancel(null);
5364
+ canLeave = false;
4875
5365
  }
4876
- // If we're still leaving then remember it since angular will call this method multiple
4877
- // times if any route parameters are changed along the way.
5366
+ else {
5367
+ canLeave = true;
5368
+ }
5369
+ _a.label = 5;
5370
+ case 5:
4878
5371
  if (canLeave) {
5372
+ // We'll get called multiple times if there's any parameter sanitisation so
5373
+ // we remember the acceptance for the duration of the current navigation session.
4879
5374
  self_1.placeRouter.navigationSession.rememberAcceptanceOf(component);
4880
5375
  }
4881
5376
  else {
@@ -4883,11 +5378,10 @@ var LeavePlaceGuard = /** @class */ (function () {
4883
5378
  // See https://github.com/angular/angular/issues/13586#issuecomment-432795720
4884
5379
  if (this.placeRouter.navigationSession.isPopState) {
4885
5380
  console.log('cancelled during popstate');
4886
- this.angularLocation.go(this.placeRouter.navigationSession.initialUrl);
5381
+ this.angularLocation.go(this.placeRouter.navigationSession.popStateReturnUrl);
4887
5382
  }
4888
5383
  }
4889
5384
  return [2 /*return*/, canLeave];
4890
- case 3: return [2 /*return*/, true];
4891
5385
  }
4892
5386
  });
4893
5387
  });
@@ -4915,306 +5409,278 @@ if (false) {
4915
5409
  */
4916
5410
  LeavePlaceGuard.prototype.router;
4917
5411
  /**
4918
- * @type {?}
4919
- * @private
4920
- */
4921
- LeavePlaceGuard.prototype.injector;
4922
- /**
4923
- * @type {?}
4924
- * @private
4925
- */
4926
- LeavePlaceGuard.prototype.placeRouter;
4927
- /** @type {?} */
4928
- LeavePlaceGuard.prototype.interactionContext;
4929
- /** @type {?} */
4930
- LeavePlaceGuard.prototype.angularLocation;
4931
- }
4932
-
4933
- /**
4934
- * @fileoverview added by tsickle
4935
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4936
- */
4937
- var PlaceRouteGuard = /** @class */ (function () {
4938
- function PlaceRouteGuard(placeRouter, injector) {
4939
- this.placeRouter = placeRouter;
4940
- this.injector = injector;
4941
- }
4942
- /**
4943
- * @param {?} activatedRoute
4944
- * @param {?} state
4945
- * @return {?}
4946
- */
4947
- PlaceRouteGuard.prototype.canActivate = /**
4948
- * @param {?} activatedRoute
4949
- * @param {?} state
4950
- * @return {?}
4951
- */
4952
- function (activatedRoute, state) {
4953
- var _this = this;
4954
- if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {
4955
- /** @type {?} */
4956
- var placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);
4957
- /** @type {?} */
4958
- var snapshot_1 = ParameterSnapshot.create(placeDefinition, activatedRoute.paramMap, activatedRoute.url);
4959
- return snapshot_1.sanitise(this.injector).then((/**
4960
- * @param {?} sanitised
4961
- * @return {?}
4962
- */
4963
- function (sanitised) {
4964
- Logger.get(_this).info("ParameterSnapshot.sanitise ->", sanitised.getAllParameters());
4965
- if (sanitised.hasChanged(snapshot_1, true)) {
4966
- return _this.placeRouter.getRedirectUrlTree(activatedRoute, sanitised);
4967
- }
4968
- else {
4969
- return true;
4970
- }
4971
- }));
4972
- }
4973
- else {
4974
- return lang.illegalState("expected component to be an instance of PlaceComponent, got " + activatedRoute.component);
4975
- }
4976
- };
4977
- PlaceRouteGuard.decorators = [
4978
- { type: Injectable, args: [{
4979
- providedIn: 'root'
4980
- },] }
4981
- ];
4982
- /** @nocollapse */
4983
- PlaceRouteGuard.ctorParameters = function () { return [
4984
- { type: PlaceRouter },
4985
- { type: Injector }
4986
- ]; };
4987
- /** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(PlaceRouter), ɵɵinject(INJECTOR)); }, token: PlaceRouteGuard, providedIn: "root" });
4988
- return PlaceRouteGuard;
4989
- }());
4990
- if (false) {
4991
- /**
4992
- * @type {?}
4993
- * @private
4994
- */
4995
- PlaceRouteGuard.prototype.placeRouter;
4996
- /**
4997
- * @type {?}
4998
- * @private
4999
- */
5000
- PlaceRouteGuard.prototype.injector;
5001
- }
5002
-
5003
- /**
5004
- * @fileoverview added by tsickle
5005
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5006
- */
5007
- /**
5008
- * @record
5009
- */
5010
- function JsonArray() { }
5011
- /**
5012
- * @record
5013
- */
5014
- function JsonMap() { }
5015
-
5016
- /**
5017
- * @fileoverview added by tsickle
5018
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5019
- */
5020
- /**
5021
- * @record
5022
- * @template T
5023
- */
5024
- function ParameterOptions() { }
5025
- if (false) {
5026
- /** @type {?|undefined} */
5027
- ParameterOptions.prototype.as;
5028
- /** @type {?|undefined} */
5029
- ParameterOptions.prototype.optional;
5030
- /** @type {?|undefined} */
5031
- ParameterOptions.prototype.remember;
5032
- /** @type {?|undefined} */
5033
- ParameterOptions.prototype.defaultValue;
5034
- }
5035
- /**
5036
- * @record
5037
- * @template T
5038
- */
5039
- function ListParameterOptions() { }
5040
- if (false) {
5041
- /** @type {?|undefined} */
5042
- ListParameterOptions.prototype.as;
5043
- /** @type {?|undefined} */
5044
- ListParameterOptions.prototype.optional;
5045
- /** @type {?|undefined} */
5046
- ListParameterOptions.prototype.remember;
5047
- /** @type {?|undefined} */
5048
- ListParameterOptions.prototype.defaultValue;
5049
- }
5050
- /**
5051
- * @template T
5052
- * @param {?} type
5053
- * @param {?=} options
5054
- * @return {?}
5055
- */
5056
- function RouteId(type, options) {
5057
- return (/**
5058
- * @param {?} prototype
5059
- * @param {?} propertyKey
5060
- * @return {?}
5061
- */
5062
- function (prototype, propertyKey) {
5063
- /** @type {?} */
5064
- var param = new ParameterDefinition.RouteId(propertyKey.toString(), type, options);
5065
- Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
5066
- UseDelegate()(prototype, propertyKey);
5067
- });
5068
- }
5069
- /**
5070
- * @template T
5071
- * @param {?} type
5072
- * @param {?=} options
5073
- * @return {?}
5074
- */
5075
- function RouteParameter(type, options) {
5076
- return (/**
5077
- * @param {?} prototype
5078
- * @param {?} propertyKey
5079
- * @return {?}
5412
+ * @type {?}
5413
+ * @private
5080
5414
  */
5081
- function (prototype, propertyKey) {
5082
- /** @type {?} */
5083
- var param = new ParameterDefinition.ValueParameter(propertyKey.toString(), type, options);
5084
- Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
5085
- UseDelegate()(prototype, propertyKey);
5086
- });
5087
- }
5088
- /**
5089
- * @template E
5090
- * @param {?} elementType
5091
- * @param {?=} options
5092
- * @return {?}
5093
- */
5094
- function RouteParameterList(elementType, options) {
5095
- return (/**
5096
- * @param {?} prototype
5097
- * @param {?} propertyKey
5098
- * @return {?}
5415
+ LeavePlaceGuard.prototype.injector;
5416
+ /**
5417
+ * @type {?}
5418
+ * @private
5099
5419
  */
5100
- function (prototype, propertyKey) {
5101
- /** @type {?} */
5102
- var param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), elementType, options);
5103
- Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
5104
- UseDelegate()(prototype, propertyKey);
5105
- });
5420
+ LeavePlaceGuard.prototype.placeRouter;
5421
+ /** @type {?} */
5422
+ LeavePlaceGuard.prototype.interactionContext;
5423
+ /** @type {?} */
5424
+ LeavePlaceGuard.prototype.angularLocation;
5106
5425
  }
5107
5426
 
5108
5427
  /**
5109
5428
  * @fileoverview added by tsickle
5110
5429
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5111
5430
  */
5112
- /**
5113
- * @record
5114
- * @template S
5115
- */
5116
- function ParameterSanitiser() { }
5117
- if (false) {
5431
+ var PlaceRouteGuard = /** @class */ (function () {
5432
+ function PlaceRouteGuard(router, placeRouter, placeHistory, injector) {
5433
+ this.router = router;
5434
+ this.placeRouter = placeRouter;
5435
+ this.placeHistory = placeHistory;
5436
+ this.injector = injector;
5437
+ }
5438
+ // @Trace()
5439
+ // @Trace()
5118
5440
  /**
5119
- * @param {?} paramter
5120
- * @param {?=} visit
5441
+ * @param {?} activatedRoute
5442
+ * @param {?} state
5443
+ * @return {?}
5444
+ */
5445
+ PlaceRouteGuard.prototype.canActivate =
5446
+ // @Trace()
5447
+ /**
5448
+ * @param {?} activatedRoute
5449
+ * @param {?} state
5121
5450
  * @return {?}
5122
5451
  */
5123
- ParameterSanitiser.prototype.sanitise = function (paramter, visit) { };
5452
+ function (activatedRoute, state) {
5453
+ return __awaiter(this, void 0, void 0, function () {
5454
+ var placeDefinition, params, parsedParams, initialVisit, sanitiser, updatedVisit, parameterCommands, commands;
5455
+ return __generator(this, function (_a) {
5456
+ switch (_a.label) {
5457
+ case 0:
5458
+ if (!PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) return [3 /*break*/, 2];
5459
+ placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);
5460
+ // Parse our route params.
5461
+ params = new PlaceRouteGuard.ConsolidatedParameterMap(activatedRoute.paramMap, activatedRoute.url);
5462
+ parsedParams = placeDefinition.parseRouteParams(params);
5463
+ initialVisit = this.placeRouter.navigationSession.getVisitFor(placeDefinition) || new Visit(placeDefinition, parsedParams);
5464
+ sanitiser = new VisitSanitiser(activatedRoute, this.router, this.placeHistory, this.injector);
5465
+ return [4 /*yield*/, sanitiser.sanitise(initialVisit.mergeRouteParameters(parsedParams))];
5466
+ case 1:
5467
+ updatedVisit = _a.sent();
5468
+ // Save the visit with any updated parameters. We need to save it so we remember any non route parameters
5469
+ this.placeRouter.navigationSession.storeVisit(updatedVisit);
5470
+ if (initialVisit.hasRoutingChangedFrom(updatedVisit)) {
5471
+ parameterCommands = updatedVisit.hasRouteId() ?
5472
+ [placeDefinition.getFormattedRouteId(updatedVisit), placeDefinition.getFormattedRouteParameters(updatedVisit)] :
5473
+ [placeDefinition.getFormattedRouteParameters(updatedVisit)];
5474
+ commands = [(activatedRoute.url[0].path)].concat(parameterCommands, this.placeRouter.getChildPath(activatedRoute));
5475
+ console.log('##### Redirect', commands);
5476
+ return [2 /*return*/, this.router.createUrlTree(commands, {
5477
+ replaceUrl: true,
5478
+ skipLocationChange: false
5479
+ })];
5480
+ }
5481
+ else {
5482
+ return [2 /*return*/, true];
5483
+ }
5484
+ return [3 /*break*/, 3];
5485
+ case 2: return [2 /*return*/, lang.illegalState("expected component to be an instance of PlaceComponent, got " + activatedRoute.component)];
5486
+ case 3: return [2 /*return*/];
5487
+ }
5488
+ });
5489
+ });
5490
+ };
5491
+ PlaceRouteGuard.decorators = [
5492
+ { type: Injectable, args: [{
5493
+ providedIn: 'root'
5494
+ },] }
5495
+ ];
5496
+ /** @nocollapse */
5497
+ PlaceRouteGuard.ctorParameters = function () { return [
5498
+ { type: Router },
5499
+ { type: PlaceRouter },
5500
+ { type: PlaceHistory },
5501
+ { type: Injector }
5502
+ ]; };
5503
+ /** @nocollapse */ PlaceRouteGuard.ngInjectableDef = ɵɵdefineInjectable({ factory: function PlaceRouteGuard_Factory() { return new PlaceRouteGuard(ɵɵinject(Router), ɵɵinject(PlaceRouter), ɵɵinject(PlaceHistory), ɵɵinject(INJECTOR)); }, token: PlaceRouteGuard, providedIn: "root" });
5504
+ return PlaceRouteGuard;
5505
+ }());
5506
+ if (false) {
5507
+ /**
5508
+ * @type {?}
5509
+ * @private
5510
+ */
5511
+ PlaceRouteGuard.prototype.router;
5512
+ /**
5513
+ * @type {?}
5514
+ * @private
5515
+ */
5516
+ PlaceRouteGuard.prototype.placeRouter;
5517
+ /**
5518
+ * @type {?}
5519
+ * @private
5520
+ */
5521
+ PlaceRouteGuard.prototype.placeHistory;
5522
+ /**
5523
+ * @type {?}
5524
+ * @private
5525
+ */
5526
+ PlaceRouteGuard.prototype.injector;
5124
5527
  }
5125
-
5126
- /**
5127
- * @fileoverview added by tsickle
5128
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5129
- */
5130
- // WARNING: interface has both a type and a value, skipping emit
5131
- var ParameterType;
5132
- (function (ParameterType) {
5133
- var StringType = /** @class */ (function () {
5134
- function StringType() {
5528
+ (function (PlaceRouteGuard) {
5529
+ /**
5530
+ * This a work around for the fact that an activated route with multiple segments doesn't
5531
+ * include the segment params in the paramMap as well as each segment returns an empty
5532
+ * param map even when `parameter`s has content.
5533
+ */
5534
+ var ConsolidatedParameterMap = /** @class */ (function () {
5535
+ function ConsolidatedParameterMap(paramMap, urlSegments) {
5536
+ this.paramMaps = [paramMap].concat((urlSegments || []).map((/**
5537
+ * @param {?} s
5538
+ * @return {?}
5539
+ */
5540
+ function (s) { return new ParamMapAdapter(s.parameters); }))).filter((/**
5541
+ * @param {?} m
5542
+ * @return {?}
5543
+ */
5544
+ function (m) { return !!m; })); // the activated route param map can be null
5135
5545
  }
5136
5546
  /**
5137
- * @param {?} value
5547
+ * @param {?} name
5138
5548
  * @return {?}
5139
5549
  */
5140
- StringType.prototype.format = /**
5141
- * @param {?} value
5550
+ ConsolidatedParameterMap.prototype.get = /**
5551
+ * @param {?} name
5142
5552
  * @return {?}
5143
5553
  */
5144
- function (value) {
5145
- return value;
5554
+ function (name) {
5555
+ /** @type {?} */
5556
+ var paramMap = this.paramMaps.find((/**
5557
+ * @param {?} m
5558
+ * @return {?}
5559
+ */
5560
+ function (m) { return m.has(name); }));
5561
+ return paramMap.get(name);
5146
5562
  };
5147
5563
  /**
5148
- * @param {?} value
5564
+ * @param {?} name
5149
5565
  * @return {?}
5150
5566
  */
5151
- StringType.prototype.parse = /**
5152
- * @param {?} value
5567
+ ConsolidatedParameterMap.prototype.getAll = /**
5568
+ * @param {?} name
5153
5569
  * @return {?}
5154
5570
  */
5155
- function (value) {
5156
- return value;
5571
+ function (name) {
5572
+ /** @type {?} */
5573
+ var paramMap = this.paramMaps.find((/**
5574
+ * @param {?} m
5575
+ * @return {?}
5576
+ */
5577
+ function (m) { return m.has(name); }));
5578
+ return paramMap.getAll(name);
5157
5579
  };
5158
- return StringType;
5159
- }());
5160
- var NumberType = /** @class */ (function () {
5161
- function NumberType() {
5162
- }
5163
5580
  /**
5164
- * @param {?} value
5581
+ * @param {?} name
5165
5582
  * @return {?}
5166
5583
  */
5167
- NumberType.prototype.format = /**
5168
- * @param {?} value
5584
+ ConsolidatedParameterMap.prototype.has = /**
5585
+ * @param {?} name
5169
5586
  * @return {?}
5170
5587
  */
5171
- function (value) {
5172
- return "" + value;
5588
+ function (name) {
5589
+ return !!this.paramMaps.find((/**
5590
+ * @param {?} m
5591
+ * @return {?}
5592
+ */
5593
+ function (m) { return m.has(name); }));
5173
5594
  };
5595
+ Object.defineProperty(ConsolidatedParameterMap.prototype, "keys", {
5596
+ get: /**
5597
+ * @return {?}
5598
+ */
5599
+ function () {
5600
+ return this.paramMaps.reduce((/**
5601
+ * @param {?} result
5602
+ * @param {?} params
5603
+ * @return {?}
5604
+ */
5605
+ function (result, params) { return result.concat(params.keys); }), []);
5606
+ },
5607
+ enumerable: true,
5608
+ configurable: true
5609
+ });
5610
+ __decorate([
5611
+ Memoize(),
5612
+ __metadata("design:type", Array),
5613
+ __metadata("design:paramtypes", [])
5614
+ ], ConsolidatedParameterMap.prototype, "keys", null);
5615
+ return ConsolidatedParameterMap;
5616
+ }());
5617
+ PlaceRouteGuard.ConsolidatedParameterMap = ConsolidatedParameterMap;
5618
+ if (false) {
5174
5619
  /**
5175
- * @param {?} value
5620
+ * @type {?}
5621
+ * @private
5622
+ */
5623
+ ConsolidatedParameterMap.prototype.paramMaps;
5624
+ }
5625
+ var ParamMapAdapter = /** @class */ (function () {
5626
+ function ParamMapAdapter(params) {
5627
+ this.params = params;
5628
+ }
5629
+ /**
5630
+ * @param {?} name
5176
5631
  * @return {?}
5177
5632
  */
5178
- NumberType.prototype.parse = /**
5179
- * @param {?} value
5633
+ ParamMapAdapter.prototype.get = /**
5634
+ * @param {?} name
5180
5635
  * @return {?}
5181
5636
  */
5182
- function (value) {
5183
- return ___default.isNil(value) || ___default.isEmpty(value) ? null : +value;
5637
+ function (name) {
5638
+ return this.params[name];
5184
5639
  };
5185
- return NumberType;
5186
- }());
5187
- var BooleanType = /** @class */ (function () {
5188
- function BooleanType() {
5189
- }
5190
5640
  /**
5191
- * @param {?} value
5641
+ * @param {?} name
5192
5642
  * @return {?}
5193
5643
  */
5194
- BooleanType.prototype.format = /**
5195
- * @param {?} value
5644
+ ParamMapAdapter.prototype.getAll = /**
5645
+ * @param {?} name
5196
5646
  * @return {?}
5197
5647
  */
5198
- function (value) {
5199
- return value ? 'true' : 'false';
5648
+ function (name) {
5649
+ /** @type {?} */
5650
+ var value = this.get(name);
5651
+ return Array.isArray(value) ? value : [value];
5200
5652
  };
5201
5653
  /**
5202
- * @param {?} value
5654
+ * @param {?} name
5203
5655
  * @return {?}
5204
5656
  */
5205
- BooleanType.prototype.parse = /**
5206
- * @param {?} value
5657
+ ParamMapAdapter.prototype.has = /**
5658
+ * @param {?} name
5207
5659
  * @return {?}
5208
5660
  */
5209
- function (value) {
5210
- return value === 'true';
5661
+ function (name) {
5662
+ return this.keys.includes(name);
5211
5663
  };
5212
- return BooleanType;
5664
+ Object.defineProperty(ParamMapAdapter.prototype, "keys", {
5665
+ get: /**
5666
+ * @return {?}
5667
+ */
5668
+ function () {
5669
+ return Object.keys(this.params);
5670
+ },
5671
+ enumerable: true,
5672
+ configurable: true
5673
+ });
5674
+ return ParamMapAdapter;
5213
5675
  }());
5214
- ParameterType.STRING = new StringType();
5215
- ParameterType.NUMBER = new NumberType();
5216
- ParameterType.BOOLEAN = new BooleanType();
5217
- })(ParameterType || (ParameterType = {}));
5676
+ if (false) {
5677
+ /**
5678
+ * @type {?}
5679
+ * @private
5680
+ */
5681
+ ParamMapAdapter.prototype.params;
5682
+ }
5683
+ })(PlaceRouteGuard || (PlaceRouteGuard = {}));
5218
5684
 
5219
5685
  /**
5220
5686
  * @fileoverview added by tsickle
@@ -5236,5 +5702,5 @@ var ParameterType;
5236
5702
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5237
5703
  */
5238
5704
 
5239
- export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, Activity, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CloseInteractionGuard, CommandDirective, ConfirmThenDialogComponent, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DialogInteractionService, Dimension, DisposableComponent, EmptyStateComponent, FocusBindingDirective, InteractionContext, InteractionModule, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, ListPlaceNavComponent, NumberInputComponent, ParameterDefinition, ParameterSnapshot, ParameterType, PasswordInputComponent, Place, PlaceComponent, PlaceDefinition, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceRouter, Point, ROUTE_PARAMETER_LIST_KEY, ResizeAwareComponent, RouteId, RouteParameter, RouteParameterList, RouteParameterValue, SelectInputComponent, StringInputComponent, TabbedPlaceNavigationComponent, leftRightPlaceAnimation, slideDownAndUpAnimation, CommandDirective as ɵa, FocusBindingDirective as ɵb, Activity as ɵba, ConfirmThenDialogComponent as ɵbc, AlertDialogComponent as ɵbd, DIALOG_INTERACTION_SERVICE_DEFAULTS as ɵbf, DialogInteractionService as ɵbg, DisposableComponent as ɵc, NumberInputComponent as ɵd, AbstractInputComponent as ɵe, StringInputComponent as ɵf, PasswordInputComponent as ɵg, SelectInputComponent as ɵh, PlaceModule as ɵi, EmptyStateComponent as ɵj, BusyOverlayComponent as ɵk, PlaceOutletComponent as ɵl, leftRightPlaceAnimation as ɵm, LEFT_RIGHT_PLACE_ANIMATION as ɵn, PlaceRouter as ɵo, PlaceHistory as ɵp, TabbedPlaceNavigationComponent as ɵq, AbstractPlaceNavigationComponent as ɵr, ListPlaceNavComponent as ɵs, InteractionModule as ɵt, ActivityContainerComponent as ɵu, InteractionContext as ɵv, ActivityOutletComponent as ɵw, ConfirmationDialogComponent as ɵx, AbstractActivity as ɵy, ACTIVITY_DATA as ɵz };
5705
+ export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, Activity, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmThenDialogComponent, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DialogInteractionService, Dimension, DisposableComponent, EmptyStateComponent, FocusBindingDirective, Formatter, InteractionContext, InteractionGuard, InteractionModule, InteractionOutletComponent, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, ListPlaceNavComponent, NavigationSession, NoopComponent, NumberInputComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceDefinition, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceRouter, Point, ROUTE_PARAMETER_LIST_KEY, ResizeAwareComponent, RouteId, SelectInputComponent, StringInputComponent, TabbedPlaceNavigationComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, leftRightPlaceAnimation, slideDownAndUpAnimation, CommandDirective as ɵa, FocusBindingDirective as ɵb, ACTIVITY_DATA as ɵba, Activity as ɵbb, ConfirmThenDialogComponent as ɵbd, AlertDialogComponent as ɵbe, InteractionOutletComponent as ɵbg, DIALOG_INTERACTION_SERVICE_DEFAULTS as ɵbh, DialogInteractionService as ɵbi, DisposableComponent as ɵc, NumberInputComponent as ɵd, AbstractInputComponent as ɵe, StringInputComponent as ɵf, PasswordInputComponent as ɵg, SelectInputComponent as ɵh, NoopComponent as ɵi, PlaceModule as ɵj, EmptyStateComponent as ɵk, BusyOverlayComponent as ɵl, PlaceOutletComponent as ɵm, leftRightPlaceAnimation as ɵn, LEFT_RIGHT_PLACE_ANIMATION as ɵo, PlaceRouter as ɵp, PlaceHistory as ɵq, TabbedPlaceNavigationComponent as ɵr, AbstractPlaceNavigationComponent as ɵs, ListPlaceNavComponent as ɵt, InteractionModule as ɵu, ActivityContainerComponent as ɵv, InteractionContext as ɵw, ActivityOutletComponent as ɵx, ConfirmationDialogComponent as ɵy, AbstractActivity as ɵz };
5240
5706
  //# sourceMappingURL=coolon-angular-ui-powerups.js.map