diff --git a/.browserslistrc b/.browserslistrc deleted file mode 100644 index 427441d..0000000 --- a/.browserslistrc +++ /dev/null @@ -1,17 +0,0 @@ -# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. -# For additional information regarding the format and rule options, please see: -# https://github.com/browserslist/browserslist#queries - -# For the full list of supported browsers by the Angular framework, please see: -# https://angular.io/guide/browser-support - -# You can see what browsers were selected by your queries by running: -# npx browserslist - -last 1 Chrome version -last 1 Firefox version -last 2 Edge major versions -last 2 Safari major versions -last 2 iOS major versions -Firefox ESR -not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. diff --git a/docs/main.js b/docs/main.js index 4efff86..def5f91 100644 --- a/docs/main.js +++ b/docs/main.js @@ -15,45 +15,56 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ 124); -class AppComponent { -} -AppComponent.ɵfac = function AppComponent_Factory(t) { return new (t || AppComponent)(); }; -AppComponent.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: AppComponent, selectors: [["app-root"]], decls: 26, vars: 0, consts: [[2, "text-align", "center", "margin-bottom", "0.25rem"], ["href", "https://github.com/changhuixu/angular-maze", "title", "git repo"], [2, "text-align", "center"], ["routerLink", "maze", "routerLinkActive", "active"], [2, "width", "1rem", "display", "inline-block"], ["routerLink", "candy", "routerLinkActive", "active"], ["routerLink", "math1", "routerLinkActive", "active"], ["routerLink", "math2", "routerLinkActive", "active"], ["routerLink", "math3", "routerLinkActive", "active"], ["routerLink", "8-puzzle", "routerLinkActive", "active"], ["routerLink", "square", "routerLinkActive", "active"], [2, "margin", "0 auto"]], template: function AppComponent_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0)(1, "a", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](2, " GitHub Repo "); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "nav", 2)(4, "a", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](5, "Maze Puzzle"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](6, "div", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](7, "a", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](8, "Candy Text"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](9, "div", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](10, "a", 6); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](11, "Math"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](12, "div", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](13, "a", 7); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](14, "Fractions"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](15, "div", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](16, "a", 8); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](17, "4 Operations"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](18, "div", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](19, "a", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](20, "8 Puzzle"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](21, "div", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](22, "a", 10); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](23, "Squares"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](24, "div", 11); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](25, "router-outlet"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - } }, dependencies: [_angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterOutlet, _angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterLinkWithHref, _angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterLinkActive], styles: ["nav[_ngcontent-%COMP%] a[_ngcontent-%COMP%] {\r\n display: inline-block;\r\n color: #000;\r\n background: #dbeccd;\r\n padding: 0.5rem 1rem;\r\n width: 5rem;\r\n text-decoration: none;\r\n white-space: nowrap;\r\n}\r\n\r\nnav[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%] {\r\n background-color: #4caf50;\r\n color: white;\r\n font-weight: 500;\r\n}\r\n\r\nnav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover:not(.active) {\r\n background-color: #8cad70;\r\n color: white;\r\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC5jb21wb25lbnQuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0UscUJBQXFCO0VBQ3JCLFdBQVc7RUFDWCxtQkFBbUI7RUFDbkIsb0JBQW9CO0VBQ3BCLFdBQVc7RUFDWCxxQkFBcUI7RUFDckIsbUJBQW1CO0FBQ3JCOztBQUVBO0VBQ0UseUJBQXlCO0VBQ3pCLFlBQVk7RUFDWixnQkFBZ0I7QUFDbEI7O0FBRUE7RUFDRSx5QkFBeUI7RUFDekIsWUFBWTtBQUNkIiwiZmlsZSI6ImFwcC5jb21wb25lbnQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsibmF2IGEge1xyXG4gIGRpc3BsYXk6IGlubGluZS1ibG9jaztcclxuICBjb2xvcjogIzAwMDtcclxuICBiYWNrZ3JvdW5kOiAjZGJlY2NkO1xyXG4gIHBhZGRpbmc6IDAuNXJlbSAxcmVtO1xyXG4gIHdpZHRoOiA1cmVtO1xyXG4gIHRleHQtZGVjb3JhdGlvbjogbm9uZTtcclxuICB3aGl0ZS1zcGFjZTogbm93cmFwO1xyXG59XHJcblxyXG5uYXYgYS5hY3RpdmUge1xyXG4gIGJhY2tncm91bmQtY29sb3I6ICM0Y2FmNTA7XHJcbiAgY29sb3I6IHdoaXRlO1xyXG4gIGZvbnQtd2VpZ2h0OiA1MDA7XHJcbn1cclxuXHJcbm5hdiBhOmhvdmVyOm5vdCguYWN0aXZlKSB7XHJcbiAgYmFja2dyb3VuZC1jb2xvcjogIzhjYWQ3MDtcclxuICBjb2xvcjogd2hpdGU7XHJcbn1cclxuIl19 */"] }); - +class AppComponent {} +AppComponent.ɵfac = function AppComponent_Factory(t) { + return new (t || AppComponent)(); +}; +AppComponent.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ + type: AppComponent, + selectors: [["app-root"]], + decls: 26, + vars: 0, + consts: [[2, "text-align", "center", "margin-bottom", "0.25rem"], ["href", "https://github.com/changhuixu/angular-maze", "title", "git repo"], [2, "text-align", "center"], ["routerLink", "maze", "routerLinkActive", "active"], [2, "width", "1rem", "display", "inline-block"], ["routerLink", "candy", "routerLinkActive", "active"], ["routerLink", "math1", "routerLinkActive", "active"], ["routerLink", "math2", "routerLinkActive", "active"], ["routerLink", "math3", "routerLinkActive", "active"], ["routerLink", "8-puzzle", "routerLinkActive", "active"], ["routerLink", "square", "routerLinkActive", "active"], [2, "margin", "0 auto"]], + template: function AppComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0)(1, "a", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](2, " GitHub Repo "); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "nav", 2)(4, "a", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](5, "Maze Puzzle"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](6, "div", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](7, "a", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](8, "Candy Text"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](9, "div", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](10, "a", 6); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](11, "Math"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](12, "div", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](13, "a", 7); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](14, "Fractions"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](15, "div", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](16, "a", 8); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](17, "4 Operations"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](18, "div", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](19, "a", 9); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](20, "8 Puzzle"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](21, "div", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](22, "a", 10); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](23, "Squares"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](24, "div", 11); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](25, "router-outlet"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + } + }, + dependencies: [_angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterOutlet, _angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterLink, _angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterLinkActive], + styles: ["nav[_ngcontent-%COMP%] a[_ngcontent-%COMP%] {\r\n display: inline-block;\r\n color: #000;\r\n background: #dbeccd;\r\n padding: 0.5rem 1rem;\r\n width: 5rem;\r\n text-decoration: none;\r\n white-space: nowrap;\r\n}\r\n\r\nnav[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%] {\r\n background-color: #4caf50;\r\n color: white;\r\n font-weight: 500;\r\n}\r\n\r\nnav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover:not(.active) {\r\n background-color: #8cad70;\r\n color: white;\r\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy9hcHAvYXBwLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxxQkFBcUI7RUFDckIsV0FBVztFQUNYLG1CQUFtQjtFQUNuQixvQkFBb0I7RUFDcEIsV0FBVztFQUNYLHFCQUFxQjtFQUNyQixtQkFBbUI7QUFDckI7O0FBRUE7RUFDRSx5QkFBeUI7RUFDekIsWUFBWTtFQUNaLGdCQUFnQjtBQUNsQjs7QUFFQTtFQUNFLHlCQUF5QjtFQUN6QixZQUFZO0FBQ2QiLCJzb3VyY2VzQ29udGVudCI6WyJuYXYgYSB7XHJcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xyXG4gIGNvbG9yOiAjMDAwO1xyXG4gIGJhY2tncm91bmQ6ICNkYmVjY2Q7XHJcbiAgcGFkZGluZzogMC41cmVtIDFyZW07XHJcbiAgd2lkdGg6IDVyZW07XHJcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xyXG4gIHdoaXRlLXNwYWNlOiBub3dyYXA7XHJcbn1cclxuXHJcbm5hdiBhLmFjdGl2ZSB7XHJcbiAgYmFja2dyb3VuZC1jb2xvcjogIzRjYWY1MDtcclxuICBjb2xvcjogd2hpdGU7XHJcbiAgZm9udC13ZWlnaHQ6IDUwMDtcclxufVxyXG5cclxubmF2IGE6aG92ZXI6bm90KC5hY3RpdmUpIHtcclxuICBiYWNrZ3JvdW5kLWNvbG9yOiAjOGNhZDcwO1xyXG4gIGNvbG9yOiB3aGl0ZTtcclxufVxyXG4iXSwic291cmNlUm9vdCI6IiJ9 */"] +}); /***/ }), @@ -104,41 +115,51 @@ __webpack_require__.r(__webpack_exports__); -class AppModule { -} -AppModule.ɵfac = function AppModule_Factory(t) { return new (t || AppModule)(); }; -AppModule.ɵmod = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵdefineNgModule"]({ type: AppModule, bootstrap: [_app_component__WEBPACK_IMPORTED_MODULE_0__.AppComponent] }); -AppModule.ɵinj = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵdefineInjector"]({ imports: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_14__.BrowserModule, - _angular_forms__WEBPACK_IMPORTED_MODULE_15__.FormsModule, - _angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_16__.DragDropModule, - _math_math_module__WEBPACK_IMPORTED_MODULE_11__.MathModule, - _angular_router__WEBPACK_IMPORTED_MODULE_17__.RouterModule.forRoot([ - { path: '', redirectTo: 'maze', pathMatch: 'full' }, - { path: 'maze', component: _maze_maze_component__WEBPACK_IMPORTED_MODULE_1__.MazeComponent }, - { path: 'candy', component: _candy_candy_component__WEBPACK_IMPORTED_MODULE_2__.CandyComponent }, - { path: 'math1', component: _math1_math1_component__WEBPACK_IMPORTED_MODULE_7__.Math1Component }, - { path: 'math2', component: _math2_math2_component__WEBPACK_IMPORTED_MODULE_10__.Math2Component }, - { path: 'math3', component: _math3_math3_component__WEBPACK_IMPORTED_MODULE_12__.Math3Component }, - { path: '8-puzzle', component: _eight_puzzle_eight_puzzle_component__WEBPACK_IMPORTED_MODULE_8__.EightPuzzleComponent }, - { path: 'square', component: _squares_squares_component__WEBPACK_IMPORTED_MODULE_5__.SquaresComponent }, - { path: '**', redirectTo: '' }, - ])] }); -(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵsetNgModuleScope"](AppModule, { declarations: [_app_component__WEBPACK_IMPORTED_MODULE_0__.AppComponent, - _maze_maze_component__WEBPACK_IMPORTED_MODULE_1__.MazeComponent, - _candy_candy_component__WEBPACK_IMPORTED_MODULE_2__.CandyComponent, - _candy_canvas_canvas_component__WEBPACK_IMPORTED_MODULE_3__.CanvasComponent, - _squares_scramble_squares_scramble_squares_component__WEBPACK_IMPORTED_MODULE_4__.ScrambleSquaresComponent, - _squares_squares_component__WEBPACK_IMPORTED_MODULE_5__.SquaresComponent, - _squares_image_tiles_image_tiles_component__WEBPACK_IMPORTED_MODULE_6__.ImageTilesComponent, - _math1_math1_component__WEBPACK_IMPORTED_MODULE_7__.Math1Component, - _eight_puzzle_eight_puzzle_component__WEBPACK_IMPORTED_MODULE_8__.EightPuzzleComponent, - _eight_puzzle_eight_puzzle_tile_eight_puzzle_tile_component__WEBPACK_IMPORTED_MODULE_9__.EightPuzzleTileComponent, - _math2_math2_component__WEBPACK_IMPORTED_MODULE_10__.Math2Component, - _math3_math3_component__WEBPACK_IMPORTED_MODULE_12__.Math3Component], imports: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_14__.BrowserModule, - _angular_forms__WEBPACK_IMPORTED_MODULE_15__.FormsModule, - _angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_16__.DragDropModule, - _math_math_module__WEBPACK_IMPORTED_MODULE_11__.MathModule, _angular_router__WEBPACK_IMPORTED_MODULE_17__.RouterModule] }); })(); - +class AppModule {} +AppModule.ɵfac = function AppModule_Factory(t) { + return new (t || AppModule)(); +}; +AppModule.ɵmod = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵdefineNgModule"]({ + type: AppModule, + bootstrap: [_app_component__WEBPACK_IMPORTED_MODULE_0__.AppComponent] +}); +AppModule.ɵinj = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵdefineInjector"]({ + imports: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_14__.BrowserModule, _angular_forms__WEBPACK_IMPORTED_MODULE_15__.FormsModule, _angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_16__.DragDropModule, _math_math_module__WEBPACK_IMPORTED_MODULE_11__.MathModule, _angular_router__WEBPACK_IMPORTED_MODULE_17__.RouterModule.forRoot([{ + path: '', + redirectTo: 'maze', + pathMatch: 'full' + }, { + path: 'maze', + component: _maze_maze_component__WEBPACK_IMPORTED_MODULE_1__.MazeComponent + }, { + path: 'candy', + component: _candy_candy_component__WEBPACK_IMPORTED_MODULE_2__.CandyComponent + }, { + path: 'math1', + component: _math1_math1_component__WEBPACK_IMPORTED_MODULE_7__.Math1Component + }, { + path: 'math2', + component: _math2_math2_component__WEBPACK_IMPORTED_MODULE_10__.Math2Component + }, { + path: 'math3', + component: _math3_math3_component__WEBPACK_IMPORTED_MODULE_12__.Math3Component + }, { + path: '8-puzzle', + component: _eight_puzzle_eight_puzzle_component__WEBPACK_IMPORTED_MODULE_8__.EightPuzzleComponent + }, { + path: 'square', + component: _squares_squares_component__WEBPACK_IMPORTED_MODULE_5__.SquaresComponent + }, { + path: '**', + redirectTo: '' + }])] +}); +(function () { + (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_13__["ɵɵsetNgModuleScope"](AppModule, { + declarations: [_app_component__WEBPACK_IMPORTED_MODULE_0__.AppComponent, _maze_maze_component__WEBPACK_IMPORTED_MODULE_1__.MazeComponent, _candy_candy_component__WEBPACK_IMPORTED_MODULE_2__.CandyComponent, _candy_canvas_canvas_component__WEBPACK_IMPORTED_MODULE_3__.CanvasComponent, _squares_scramble_squares_scramble_squares_component__WEBPACK_IMPORTED_MODULE_4__.ScrambleSquaresComponent, _squares_squares_component__WEBPACK_IMPORTED_MODULE_5__.SquaresComponent, _squares_image_tiles_image_tiles_component__WEBPACK_IMPORTED_MODULE_6__.ImageTilesComponent, _math1_math1_component__WEBPACK_IMPORTED_MODULE_7__.Math1Component, _eight_puzzle_eight_puzzle_component__WEBPACK_IMPORTED_MODULE_8__.EightPuzzleComponent, _eight_puzzle_eight_puzzle_tile_eight_puzzle_tile_component__WEBPACK_IMPORTED_MODULE_9__.EightPuzzleTileComponent, _math2_math2_component__WEBPACK_IMPORTED_MODULE_10__.Math2Component, _math3_math3_component__WEBPACK_IMPORTED_MODULE_12__.Math3Component], + imports: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_14__.BrowserModule, _angular_forms__WEBPACK_IMPORTED_MODULE_15__.FormsModule, _angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_16__.DragDropModule, _math_math_module__WEBPACK_IMPORTED_MODULE_11__.MathModule, _angular_router__WEBPACK_IMPORTED_MODULE_17__.RouterModule] + }); +})(); /***/ }), @@ -160,39 +181,60 @@ __webpack_require__.r(__webpack_exports__); class CandyComponent { - constructor() { - this.name = 'Candy'; - } - ngOnInit() { } - draw() { - this.c.draw(this.name); - } + constructor() { + this.name = 'Candy'; + } + ngOnInit() {} + draw() { + this.c.draw(this.name); + } } -CandyComponent.ɵfac = function CandyComponent_Factory(t) { return new (t || CandyComponent)(); }; -CandyComponent.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ type: CandyComponent, selectors: [["app-candy"]], viewQuery: function CandyComponent_Query(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵviewQuery"](_canvas_canvas_component__WEBPACK_IMPORTED_MODULE_0__.CanvasComponent, 5); - } if (rf & 2) { - let _t; - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵloadQuery"]()) && (ctx.c = _t.first); - } }, decls: 9, vars: 1, consts: [[2, "text-align", "center"], [1, "my-form"], ["for", "name"], ["type", "text", 3, "ngModel", "ngModelChange"], ["type", "button", 3, "click"]], template: function CandyComponent_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "div", 0)(1, "div", 1)(2, "label", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](3, "Enter your name: "); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](4, "input", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("ngModelChange", function CandyComponent_Template_input_ngModelChange_4_listener($event) { return ctx.name = $event; }); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](5, "button", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function CandyComponent_Template_button_click_5_listener() { return ctx.draw(); }); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](6, "Draw"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](7, "section"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](8, "app-canvas"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); - } if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngModel", ctx.name); - } }, dependencies: [_angular_forms__WEBPACK_IMPORTED_MODULE_2__.DefaultValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_2__.NgControlStatus, _angular_forms__WEBPACK_IMPORTED_MODULE_2__.NgModel, _canvas_canvas_component__WEBPACK_IMPORTED_MODULE_0__.CanvasComponent], styles: [".my-form[_ngcontent-%COMP%] {\r\n margin: 1rem 0;\r\n}\r\n\r\n.my-form[_ngcontent-%COMP%] input[_ngcontent-%COMP%] {\r\n max-width: 10rem;\r\n padding: 0.25rem;\r\n margin: 0 0.5rem;\r\n}\r\n\r\n.my-form[_ngcontent-%COMP%] button[_ngcontent-%COMP%] {\r\n padding: 0.25rem;\r\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNhbmR5LmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxjQUFjO0FBQ2hCOztBQUVBO0VBQ0UsZ0JBQWdCO0VBQ2hCLGdCQUFnQjtFQUNoQixnQkFBZ0I7QUFDbEI7O0FBRUE7RUFDRSxnQkFBZ0I7QUFDbEIiLCJmaWxlIjoiY2FuZHkuY29tcG9uZW50LmNzcyIsInNvdXJjZXNDb250ZW50IjpbIi5teS1mb3JtIHtcclxuICBtYXJnaW46IDFyZW0gMDtcclxufVxyXG5cclxuLm15LWZvcm0gaW5wdXQge1xyXG4gIG1heC13aWR0aDogMTByZW07XHJcbiAgcGFkZGluZzogMC4yNXJlbTtcclxuICBtYXJnaW46IDAgMC41cmVtO1xyXG59XHJcblxyXG4ubXktZm9ybSBidXR0b24ge1xyXG4gIHBhZGRpbmc6IDAuMjVyZW07XHJcbn1cclxuIl19 */"] }); - +CandyComponent.ɵfac = function CandyComponent_Factory(t) { + return new (t || CandyComponent)(); +}; +CandyComponent.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ + type: CandyComponent, + selectors: [["app-candy"]], + viewQuery: function CandyComponent_Query(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵviewQuery"](_canvas_canvas_component__WEBPACK_IMPORTED_MODULE_0__.CanvasComponent, 5); + } + if (rf & 2) { + let _t; + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵloadQuery"]()) && (ctx.c = _t.first); + } + }, + decls: 9, + vars: 1, + consts: [[2, "text-align", "center"], [1, "my-form"], ["for", "name"], ["type", "text", 3, "ngModel", "ngModelChange"], ["type", "button", 3, "click"]], + template: function CandyComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "div", 0)(1, "div", 1)(2, "label", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](3, "Enter your name: "); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](4, "input", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("ngModelChange", function CandyComponent_Template_input_ngModelChange_4_listener($event) { + return ctx.name = $event; + }); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](5, "button", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function CandyComponent_Template_button_click_5_listener() { + return ctx.draw(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](6, "Draw"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](7, "section"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](8, "app-canvas"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](4); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngModel", ctx.name); + } + }, + dependencies: [_angular_forms__WEBPACK_IMPORTED_MODULE_2__.DefaultValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_2__.NgControlStatus, _angular_forms__WEBPACK_IMPORTED_MODULE_2__.NgModel, _canvas_canvas_component__WEBPACK_IMPORTED_MODULE_0__.CanvasComponent], + styles: [".my-form[_ngcontent-%COMP%] {\r\n margin: 1rem 0;\r\n}\r\n\r\n.my-form[_ngcontent-%COMP%] input[_ngcontent-%COMP%] {\r\n max-width: 10rem;\r\n padding: 0.25rem;\r\n margin: 0 0.5rem;\r\n}\r\n\r\n.my-form[_ngcontent-%COMP%] button[_ngcontent-%COMP%] {\r\n padding: 0.25rem;\r\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy9hcHAvY2FuZHkvY2FuZHkuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGNBQWM7QUFDaEI7O0FBRUE7RUFDRSxnQkFBZ0I7RUFDaEIsZ0JBQWdCO0VBQ2hCLGdCQUFnQjtBQUNsQjs7QUFFQTtFQUNFLGdCQUFnQjtBQUNsQiIsInNvdXJjZXNDb250ZW50IjpbIi5teS1mb3JtIHtcclxuICBtYXJnaW46IDFyZW0gMDtcclxufVxyXG5cclxuLm15LWZvcm0gaW5wdXQge1xyXG4gIG1heC13aWR0aDogMTByZW07XHJcbiAgcGFkZGluZzogMC4yNXJlbTtcclxuICBtYXJnaW46IDAgMC41cmVtO1xyXG59XHJcblxyXG4ubXktZm9ybSBidXR0b24ge1xyXG4gIHBhZGRpbmc6IDAuMjVyZW07XHJcbn1cclxuIl0sInNvdXJjZVJvb3QiOiIifQ== */"] +}); /***/ }), @@ -211,76 +253,90 @@ __webpack_require__.r(__webpack_exports__); class CanvasComponent { - constructor() { - this.particles = []; - this.mousePosition = new _models__WEBPACK_IMPORTED_MODULE_0__.Position(-100, -100); - this.continueAnimating = true; - } - ngOnInit() { } - ngAfterViewInit() { - this.canvas = document.getElementById('candy-text'); - this.ctx = this.canvas.getContext('2d'); - this.canvas.style.width = '100%'; - this.canvas.style.height = '100%'; - this.canvas.width = this.canvas.offsetWidth; - this.canvas.height = this.canvas.offsetHeight; - this.candy = new _models__WEBPACK_IMPORTED_MODULE_0__.CandyText(this.canvas); - this.draw('Candy'); - } - draw(name) { - this.particles.length = 0; - this.particles = this.candy.getParticles(name); - this.drawBackground(); - this.particles.forEach(p => { - p.draw(this.ctx); - }); - } - calculateMouseRelativePositionInCanvas(e) { - // Note: I have handled scroll effect - this.mousePosition.x = - e.clientX + - (document.documentElement.scrollLeft || document.body.scrollLeft) - - this.canvas.offsetLeft; - this.mousePosition.y = - e.clientY + - (document.documentElement.scrollTop || document.body.scrollTop) - - this.canvas.offsetTop; - } - startAnimation(e) { - this.raf = window.requestAnimationFrame(() => this.animate()); - this.continueAnimating = true; - } - // @HostListener('mouseout', ['$event']) - // stopAnimation(e: MouseEvent) { - // window.cancelAnimationFrame(this.raf); - // this.continueAnimating = false; // stop animation when mouse out. - // } - animate() { - if (!this.particles.length || !this.continueAnimating) { - return; // return when nothing needs to animate - } - this.drawBackground(); - // clean particles are not in canvas to reduce computation - this.particles = this.particles.filter(p => p.isInCanvas(this.canvas.width, this.canvas.height)); - this.particles.forEach(p => { - p.flyAwayWhenMouseOver(this.mousePosition); - p.draw(this.ctx); - }); - window.requestAnimationFrame(() => this.animate()); - } - drawBackground(bgColor = '#333') { - this.ctx.fillStyle = bgColor; - this.ctx.rect(0, 0, this.canvas.width, this.canvas.height); - this.ctx.fill(); - } + constructor() { + this.particles = []; + this.mousePosition = new _models__WEBPACK_IMPORTED_MODULE_0__.Position(-100, -100); + this.continueAnimating = true; + } + ngOnInit() {} + ngAfterViewInit() { + this.canvas = document.getElementById('candy-text'); + this.ctx = this.canvas.getContext('2d'); + this.canvas.style.width = '100%'; + this.canvas.style.height = '100%'; + this.canvas.width = this.canvas.offsetWidth; + this.canvas.height = this.canvas.offsetHeight; + this.candy = new _models__WEBPACK_IMPORTED_MODULE_0__.CandyText(this.canvas); + this.draw('Candy'); + } + draw(name) { + this.particles.length = 0; + this.particles = this.candy.getParticles(name); + this.drawBackground(); + this.particles.forEach(p => { + p.draw(this.ctx); + }); + } + calculateMouseRelativePositionInCanvas(e) { + // Note: I have handled scroll effect + this.mousePosition.x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - this.canvas.offsetLeft; + this.mousePosition.y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - this.canvas.offsetTop; + } + startAnimation(e) { + this.raf = window.requestAnimationFrame(() => this.animate()); + this.continueAnimating = true; + } + // @HostListener('mouseout', ['$event']) + // stopAnimation(e: MouseEvent) { + // window.cancelAnimationFrame(this.raf); + // this.continueAnimating = false; // stop animation when mouse out. + // } + animate() { + if (!this.particles.length || !this.continueAnimating) { + return; // return when nothing needs to animate + } + + this.drawBackground(); + // clean particles are not in canvas to reduce computation + this.particles = this.particles.filter(p => p.isInCanvas(this.canvas.width, this.canvas.height)); + this.particles.forEach(p => { + p.flyAwayWhenMouseOver(this.mousePosition); + p.draw(this.ctx); + }); + window.requestAnimationFrame(() => this.animate()); + } + drawBackground(bgColor = '#333') { + this.ctx.fillStyle = bgColor; + this.ctx.rect(0, 0, this.canvas.width, this.canvas.height); + this.ctx.fill(); + } } -CanvasComponent.ɵfac = function CanvasComponent_Factory(t) { return new (t || CanvasComponent)(); }; -CanvasComponent.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ type: CanvasComponent, selectors: [["app-canvas"]], hostBindings: function CanvasComponent_HostBindings(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("mousemove", function CanvasComponent_mousemove_HostBindingHandler($event) { return ctx.calculateMouseRelativePositionInCanvas($event); })("mouseenter", function CanvasComponent_mouseenter_HostBindingHandler($event) { return ctx.startAnimation($event); }); - } }, decls: 1, vars: 0, consts: [["id", "candy-text", "height", "300"]], template: function CanvasComponent_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](0, "canvas", 0); - } }, styles: ["[_nghost-%COMP%] {\r\n height: 100%;\r\n width: 100%;\r\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNhbnZhcy5jb21wb25lbnQuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0UsWUFBWTtFQUNaLFdBQVc7QUFDYiIsImZpbGUiOiJjYW52YXMuY29tcG9uZW50LmNzcyIsInNvdXJjZXNDb250ZW50IjpbIjpob3N0IHtcclxuICBoZWlnaHQ6IDEwMCU7XHJcbiAgd2lkdGg6IDEwMCU7XHJcbn1cclxuIl19 */"], changeDetection: 0 }); - +CanvasComponent.ɵfac = function CanvasComponent_Factory(t) { + return new (t || CanvasComponent)(); +}; +CanvasComponent.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ + type: CanvasComponent, + selectors: [["app-canvas"]], + hostBindings: function CanvasComponent_HostBindings(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("mousemove", function CanvasComponent_mousemove_HostBindingHandler($event) { + return ctx.calculateMouseRelativePositionInCanvas($event); + })("mouseenter", function CanvasComponent_mouseenter_HostBindingHandler($event) { + return ctx.startAnimation($event); + }); + } + }, + decls: 1, + vars: 0, + consts: [["id", "candy-text", "height", "300"]], + template: function CanvasComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](0, "canvas", 0); + } + }, + styles: ["[_nghost-%COMP%] {\r\n height: 100%;\r\n width: 100%;\r\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy9hcHAvY2FuZHkvY2FudmFzL2NhbnZhcy5jb21wb25lbnQuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0UsWUFBWTtFQUNaLFdBQVc7QUFDYiIsInNvdXJjZXNDb250ZW50IjpbIjpob3N0IHtcclxuICBoZWlnaHQ6IDEwMCU7XHJcbiAgd2lkdGg6IDEwMCU7XHJcbn1cclxuIl0sInNvdXJjZVJvb3QiOiIifQ== */"], + changeDetection: 0 +}); /***/ }), @@ -297,38 +353,37 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _particle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./particle */ 1861); class CandyText { - constructor(canvas) { - this.canvas = canvas; - this.denseness = 10; - this.textFont = '200px impact'; - this.ctx = this.canvas.getContext('2d'); - this.canvasWidth = this.canvas.width; - this.canvasHeight = this.canvas.height; - } - getParticles(word) { - this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); - this.ctx.font = this.textFont; - this.ctx.fillStyle = '#000000'; - const starting = this.canvasWidth / 2 - 50 * word.length; - this.ctx.fillText(word, starting, 220); - const imageData = this.ctx.getImageData(0, 0, this.canvas.width, this.canvas.height); - // iterate over all pixels - leaving density gaps - const particles = []; - for (let py = 0; py < this.canvas.height; py += this.denseness) { - for (let px = 0; px < this.canvas.width; px += this.denseness) { - const pixel = imageData.data[(px + py * this.canvas.width) * 4 - 1]; - //Pixel is black from being drawn on. - if (pixel == 255) { - const p = new _particle__WEBPACK_IMPORTED_MODULE_0__.Particle(px, py); - particles.push(p); - } - } - } - return particles; - } + constructor(canvas) { + this.canvas = canvas; + this.denseness = 10; + this.textFont = '200px impact'; + this.ctx = this.canvas.getContext('2d'); + this.canvasWidth = this.canvas.width; + this.canvasHeight = this.canvas.height; + } + getParticles(word) { + this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); + this.ctx.font = this.textFont; + this.ctx.fillStyle = '#000000'; + const starting = this.canvasWidth / 2 - 50 * word.length; + this.ctx.fillText(word, starting, 220); + const imageData = this.ctx.getImageData(0, 0, this.canvas.width, this.canvas.height); + // iterate over all pixels - leaving density gaps + const particles = []; + for (let py = 0; py < this.canvas.height; py += this.denseness) { + for (let px = 0; px < this.canvas.width; px += this.denseness) { + const pixel = imageData.data[(px + py * this.canvas.width) * 4 - 1]; + //Pixel is black from being drawn on. + if (pixel == 255) { + const p = new _particle__WEBPACK_IMPORTED_MODULE_0__.Particle(px, py); + particles.push(p); + } + } + } + return particles; + } } - /***/ }), /***/ 6322: @@ -350,7 +405,6 @@ __webpack_require__.r(__webpack_exports__); - /***/ }), /***/ 1861: @@ -364,45 +418,41 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "Particle": () => (/* binding */ Particle) /* harmony export */ }); class Particle { - constructor(x, y, radius = 4) { - this.x = x; - this.y = y; - this.radius = radius; - this.flying = false; - this.vx = 0; - this.vy = 0; - this.color = '#' + ((Math.random() * 0x949494 + 0xaaaaaa) | 0).toString(16); - } - draw(ctx) { - if (this.flying) { - this.x += this.vx; - this.y += this.vy; - } - ctx.fillStyle = this.color; - ctx.beginPath(); - ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2, true); - ctx.closePath(); - ctx.fill(); - } - flyAwayWhenMouseOver(mousePosition, mouseAffectRange = 20) { - const dx = this.x - mousePosition.x; - const dy = this.y - mousePosition.y; - const isInRange = dx * dx + dy * dy < mouseAffectRange * mouseAffectRange; - if (isInRange && !this.flying) { - this.flying = true; - this.vx = (Math.random() - 0.5) * mouseAffectRange * 2; - this.vy = (Math.random() - 0.5) * mouseAffectRange * 2; - } - } - isInCanvas(canvasWidth, canvasHeight) { - return !(this.x < -this.radius || - this.y < -this.radius || - this.x > canvasWidth + this.radius || - this.y > canvasHeight + this.radius); + constructor(x, y, radius = 4) { + this.x = x; + this.y = y; + this.radius = radius; + this.flying = false; + this.vx = 0; + this.vy = 0; + this.color = '#' + (Math.random() * 0x949494 + 0xaaaaaa | 0).toString(16); + } + draw(ctx) { + if (this.flying) { + this.x += this.vx; + this.y += this.vy; + } + ctx.fillStyle = this.color; + ctx.beginPath(); + ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2, true); + ctx.closePath(); + ctx.fill(); + } + flyAwayWhenMouseOver(mousePosition, mouseAffectRange = 20) { + const dx = this.x - mousePosition.x; + const dy = this.y - mousePosition.y; + const isInRange = dx * dx + dy * dy < mouseAffectRange * mouseAffectRange; + if (isInRange && !this.flying) { + this.flying = true; + this.vx = (Math.random() - 0.5) * mouseAffectRange * 2; + this.vy = (Math.random() - 0.5) * mouseAffectRange * 2; } + } + isInCanvas(canvasWidth, canvasHeight) { + return !(this.x < -this.radius || this.y < -this.radius || this.x > canvasWidth + this.radius || this.y > canvasHeight + this.radius); + } } - /***/ }), /***/ 5922: @@ -416,13 +466,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "Position": () => (/* binding */ Position) /* harmony export */ }); class Position { - constructor(x, y) { - this.x = x; - this.y = y; - } + constructor(x, y) { + this.x = x; + this.y = y; + } } - /***/ }), /***/ 5059: @@ -441,34 +490,60 @@ __webpack_require__.r(__webpack_exports__); -const _c0 = function (a0) { return { empty: a0 }; }; +const _c0 = function (a0) { + return { + empty: a0 + }; +}; class EightPuzzleTileComponent { - constructor(svc) { - this.svc = svc; - this.id = 0; - this.letter = ''; - } - ngOnInit() { } - move() { - this.svc.move(this.id); - if (this.svc.isWinning()) { - alert('Success'); - } + constructor(svc) { + this.svc = svc; + this.id = 0; + this.letter = ''; + } + ngOnInit() {} + move() { + this.svc.move(this.id); + if (this.svc.isWinning()) { + alert('Success'); } + } } -EightPuzzleTileComponent.ɵfac = function EightPuzzleTileComponent_Factory(t) { return new (t || EightPuzzleTileComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_services_eight_puzzle_services__WEBPACK_IMPORTED_MODULE_0__.EightPuzzleService)); }; -EightPuzzleTileComponent.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ type: EightPuzzleTileComponent, selectors: [["app-eight-puzzle-tile"]], hostBindings: function EightPuzzleTileComponent_HostBindings(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function EightPuzzleTileComponent_click_HostBindingHandler($event) { return ctx.move($event); }); - } }, inputs: { id: "id", letter: "letter" }, decls: 2, vars: 4, consts: [[1, "tile", 3, "ngClass"]], template: function EightPuzzleTileComponent_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "div", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - } if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngClass", _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpureFunction1"](2, _c0, !(ctx.letter == null ? null : ctx.letter.trim()))); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate1"](" ", ctx.letter, "\n"); - } }, dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_2__.NgClass], styles: ["[_nghost-%COMP%] {\r\n display: flex;\r\n height: 100%;\r\n width: 100%;\r\n}\r\n\r\n.tile[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-grow: 1;\r\n align-items: center;\r\n justify-content: center;\r\n font-size: 4rem;\r\n font-family: sans-serif;\r\n font-weight: bold;\r\n -webkit-user-select: none;\r\n user-select: none;\r\n color: #dad4ef;\r\n background: #456990;\r\n border: 1px solid #028090;\r\n cursor: pointer;\r\n}\r\n\r\n.empty[_ngcontent-%COMP%] {\r\n background: #dad4ef;\r\n border: 2px solid #114b5f;\r\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVpZ2h0LXB1enpsZS10aWxlLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxhQUFhO0VBQ2IsWUFBWTtFQUNaLFdBQVc7QUFDYjs7QUFFQTtFQUNFLGFBQWE7RUFDYixZQUFZO0VBQ1osbUJBQW1CO0VBQ25CLHVCQUF1QjtFQUN2QixlQUFlO0VBQ2YsdUJBQXVCO0VBQ3ZCLGlCQUFpQjtFQUNqQix5QkFBaUI7VUFBakIsaUJBQWlCO0VBQ2pCLGNBQWM7RUFDZCxtQkFBbUI7RUFDbkIseUJBQXlCO0VBQ3pCLGVBQWU7QUFDakI7O0FBRUE7RUFDRSxtQkFBbUI7RUFDbkIseUJBQXlCO0FBQzNCIiwiZmlsZSI6ImVpZ2h0LXB1enpsZS10aWxlLmNvbXBvbmVudC5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyI6aG9zdCB7XHJcbiAgZGlzcGxheTogZmxleDtcclxuICBoZWlnaHQ6IDEwMCU7XHJcbiAgd2lkdGg6IDEwMCU7XHJcbn1cclxuXHJcbi50aWxlIHtcclxuICBkaXNwbGF5OiBmbGV4O1xyXG4gIGZsZXgtZ3JvdzogMTtcclxuICBhbGlnbi1pdGVtczogY2VudGVyO1xyXG4gIGp1c3RpZnktY29udGVudDogY2VudGVyO1xyXG4gIGZvbnQtc2l6ZTogNHJlbTtcclxuICBmb250LWZhbWlseTogc2Fucy1zZXJpZjtcclxuICBmb250LXdlaWdodDogYm9sZDtcclxuICB1c2VyLXNlbGVjdDogbm9uZTtcclxuICBjb2xvcjogI2RhZDRlZjtcclxuICBiYWNrZ3JvdW5kOiAjNDU2OTkwO1xyXG4gIGJvcmRlcjogMXB4IHNvbGlkICMwMjgwOTA7XHJcbiAgY3Vyc29yOiBwb2ludGVyO1xyXG59XHJcblxyXG4uZW1wdHkge1xyXG4gIGJhY2tncm91bmQ6ICNkYWQ0ZWY7XHJcbiAgYm9yZGVyOiAycHggc29saWQgIzExNGI1ZjtcclxufVxyXG4iXX0= */"] }); - +EightPuzzleTileComponent.ɵfac = function EightPuzzleTileComponent_Factory(t) { + return new (t || EightPuzzleTileComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_services_eight_puzzle_services__WEBPACK_IMPORTED_MODULE_0__.EightPuzzleService)); +}; +EightPuzzleTileComponent.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ + type: EightPuzzleTileComponent, + selectors: [["app-eight-puzzle-tile"]], + hostBindings: function EightPuzzleTileComponent_HostBindings(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function EightPuzzleTileComponent_click_HostBindingHandler($event) { + return ctx.move($event); + }); + } + }, + inputs: { + id: "id", + letter: "letter" + }, + decls: 2, + vars: 4, + consts: [[1, "tile", 3, "ngClass"]], + template: function EightPuzzleTileComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "div", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngClass", _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpureFunction1"](2, _c0, !(ctx.letter == null ? null : ctx.letter.trim()))); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate1"](" ", ctx.letter, "\n"); + } + }, + dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_2__.NgClass], + styles: ["[_nghost-%COMP%] {\r\n display: flex;\r\n height: 100%;\r\n width: 100%;\r\n}\r\n\r\n.tile[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-grow: 1;\r\n align-items: center;\r\n justify-content: center;\r\n font-size: 4rem;\r\n font-family: sans-serif;\r\n font-weight: bold;\r\n -webkit-user-select: none;\r\n user-select: none;\r\n color: #dad4ef;\r\n background: #456990;\r\n border: 1px solid #028090;\r\n cursor: pointer;\r\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Q1Njk5MDtcclxuICBib3JkZXI6IDFweCBzb2xpZCAjMDI4MDkwO1xyXG4gIGN1cnNvcjogcG9pbnRlcjtcclxufVxyXG5cclxuLmVtcHR5IHtcclxuICBiYWNrZ3JvdW5kOiAjZGFkNGVmO1xyXG4gIGJvcmRlcjogMnB4IHNvbGlkICMxMTRiNWY7XHJcbn1cclxuIl0sInNvdXJjZVJvb3QiOiIifQ== */"] +}); /***/ }), @@ -489,56 +564,76 @@ __webpack_require__.r(__webpack_exports__); class EightPuzzleComponent { - constructor(svc) { - this.svc = svc; - this.tileSize = 0; - this.letters = []; - } - ngOnInit() { - this.tileSize = Math.min(window.innerWidth, window.innerHeight) * 0.9; - this.letters = this.svc.randomize(); - } - onResize(event) { - this.ngOnInit(); - } + constructor(svc) { + this.svc = svc; + this.tileSize = 0; + this.letters = []; + } + ngOnInit() { + this.tileSize = Math.min(window.innerWidth, window.innerHeight) * 0.9; + this.letters = this.svc.randomize(); + } + onResize(event) { + this.ngOnInit(); + } } -EightPuzzleComponent.ɵfac = function EightPuzzleComponent_Factory(t) { return new (t || EightPuzzleComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_services_eight_puzzle_services__WEBPACK_IMPORTED_MODULE_0__.EightPuzzleService)); }; -EightPuzzleComponent.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ type: EightPuzzleComponent, selectors: [["app-eight-puzzle"]], hostBindings: function EightPuzzleComponent_HostBindings(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("resize", function EightPuzzleComponent_resize_HostBindingHandler($event) { return ctx.onResize($event); }, false, _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresolveWindow"]); - } }, decls: 13, vars: 22, consts: [[2, "display", "flex", "flex-direction", "column", 3, "resize"], [2, "display", "flex", "flex-direction", "row", "flex-grow", "1"], [3, "id", "letter"]], template: function EightPuzzleComponent_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "div", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("resize", function EightPuzzleComponent_Template_div_resize_0_listener($event) { return ctx.onResize($event); }, false, _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresolveWindow"]); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](1, "div", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](2, "app-eight-puzzle-tile", 2)(3, "app-eight-puzzle-tile", 2)(4, "app-eight-puzzle-tile", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](5, "div", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](6, "app-eight-puzzle-tile", 2)(7, "app-eight-puzzle-tile", 2)(8, "app-eight-puzzle-tile", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](9, "div", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](10, "app-eight-puzzle-tile", 2)(11, "app-eight-puzzle-tile", 2)(12, "app-eight-puzzle-tile", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); - } if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵstyleProp"]("height", ctx.tileSize, "px")("width", ctx.tileSize, "px"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 0)("letter", ctx.letters[0]); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 1)("letter", ctx.letters[1]); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 2)("letter", ctx.letters[2]); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 3)("letter", ctx.letters[3]); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 4)("letter", ctx.letters[4]); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 5)("letter", ctx.letters[5]); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 6)("letter", ctx.letters[6]); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 7)("letter", ctx.letters[7]); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 8)("letter", ctx.letters[8]); - } }, dependencies: [_eight_puzzle_tile_eight_puzzle_tile_component__WEBPACK_IMPORTED_MODULE_1__.EightPuzzleTileComponent], styles: ["[_nghost-%COMP%] {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n margin: 1rem;\r\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVpZ2h0LXB1enpsZS5jb21wb25lbnQuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0UsYUFBYTtFQUNiLHNCQUFzQjtFQUN0QixtQkFBbUI7RUFDbkIsdUJBQXVCO0VBQ3ZCLFlBQVk7QUFDZCIsImZpbGUiOiJlaWdodC1wdXp6bGUuY29tcG9uZW50LmNzcyIsInNvdXJjZXNDb250ZW50IjpbIjpob3N0IHtcclxuICBkaXNwbGF5OiBmbGV4O1xyXG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XHJcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcclxuICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcclxuICBtYXJnaW46IDFyZW07XHJcbn1cclxuIl19 */"] }); - +EightPuzzleComponent.ɵfac = function EightPuzzleComponent_Factory(t) { + return new (t || EightPuzzleComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_services_eight_puzzle_services__WEBPACK_IMPORTED_MODULE_0__.EightPuzzleService)); +}; +EightPuzzleComponent.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ + type: EightPuzzleComponent, + selectors: [["app-eight-puzzle"]], + hostBindings: function EightPuzzleComponent_HostBindings(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("resize", function EightPuzzleComponent_resize_HostBindingHandler($event) { + return ctx.onResize($event); + }, false, _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresolveWindow"]); + } + }, + decls: 13, + vars: 22, + consts: [[2, "display", "flex", "flex-direction", "column", 3, "resize"], [2, "display", "flex", "flex-direction", "row", "flex-grow", "1"], [3, "id", "letter"]], + template: function EightPuzzleComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "div", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("resize", function EightPuzzleComponent_Template_div_resize_0_listener($event) { + return ctx.onResize($event); + }, false, _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresolveWindow"]); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](1, "div", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](2, "app-eight-puzzle-tile", 2)(3, "app-eight-puzzle-tile", 2)(4, "app-eight-puzzle-tile", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](5, "div", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](6, "app-eight-puzzle-tile", 2)(7, "app-eight-puzzle-tile", 2)(8, "app-eight-puzzle-tile", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](9, "div", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](10, "app-eight-puzzle-tile", 2)(11, "app-eight-puzzle-tile", 2)(12, "app-eight-puzzle-tile", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵstyleProp"]("height", ctx.tileSize, "px")("width", ctx.tileSize, "px"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 0)("letter", ctx.letters[0]); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 1)("letter", ctx.letters[1]); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 2)("letter", ctx.letters[2]); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 3)("letter", ctx.letters[3]); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 4)("letter", ctx.letters[4]); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 5)("letter", ctx.letters[5]); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 6)("letter", ctx.letters[6]); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 7)("letter", ctx.letters[7]); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("id", 8)("letter", ctx.letters[8]); + } + }, + dependencies: [_eight_puzzle_tile_eight_puzzle_tile_component__WEBPACK_IMPORTED_MODULE_1__.EightPuzzleTileComponent], + styles: ["[_nghost-%COMP%] {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n margin: 1rem;\r\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy9hcHAvZWlnaHQtcHV6emxlL2VpZ2h0LXB1enpsZS5jb21wb25lbnQuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0UsYUFBYTtFQUNiLHNCQUFzQjtFQUN0QixtQkFBbUI7RUFDbkIsdUJBQXVCO0VBQ3ZCLFlBQVk7QUFDZCIsInNvdXJjZXNDb250ZW50IjpbIjpob3N0IHtcclxuICBkaXNwbGF5OiBmbGV4O1xyXG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XHJcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcclxuICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcclxuICBtYXJnaW46IDFyZW07XHJcbn1cclxuIl0sInNvdXJjZVJvb3QiOiIifQ== */"] +}); /***/ }), @@ -555,95 +650,85 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2560); class EightPuzzleService { - constructor() { - this._letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', '']; - this._win = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', '']; - this.n = this._letters.length; - this.rows = Math.sqrt(this.n); - } - getLetter(i) { - return i < this.n ? this._letters[i] : ''; - } - getCoordinate(i) { - const x = Math.floor(i / this.rows); - const y = i - this.rows * x; - return [x, y]; - } - randomize() { - let currentIndex = this.n; - while (currentIndex != 0) { - const i = Math.floor(Math.random() * currentIndex); - currentIndex--; - [this._letters[currentIndex], this._letters[i]] = [ - this._letters[i], - this._letters[currentIndex], - ]; - } - return this._letters; + constructor() { + this._letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', '']; + this._win = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', '']; + this.n = this._letters.length; + this.rows = Math.sqrt(this.n); + } + getLetter(i) { + return i < this.n ? this._letters[i] : ''; + } + getCoordinate(i) { + const x = Math.floor(i / this.rows); + const y = i - this.rows * x; + return [x, y]; + } + randomize() { + let currentIndex = this.n; + while (currentIndex != 0) { + const i = Math.floor(Math.random() * currentIndex); + currentIndex--; + [this._letters[currentIndex], this._letters[i]] = [this._letters[i], this._letters[currentIndex]]; + } + return this._letters; + } + canMove(i) { + const [x, y] = this.getCoordinate(i); + if (x >= this.rows || y >= this.rows || !this._letters[i]?.trim()) { + return false; + } + // down + if (x < this.rows - 1 && !this._letters[(x + 1) * this.rows + y]?.trim()) { + return true; + } + // up + if (x > 0 && !this._letters[(x - 1) * this.rows + y]?.trim()) { + return true; + } + // left + if (y > 0 && !this._letters[x * this.rows + y - 1]?.trim()) { + return true; + } // right + if (y < this.rows - 1 && !this._letters[x * this.rows + y + 1]?.trim()) { + return true; + } + return false; + } + move(i) { + if (this.isWinning()) { + return; } - canMove(i) { - const [x, y] = this.getCoordinate(i); - if (x >= this.rows || y >= this.rows || !this._letters[i]?.trim()) { - return false; - } - // down - if (x < this.rows - 1 && !this._letters[(x + 1) * this.rows + y]?.trim()) { - return true; - } - // up - if (x > 0 && !this._letters[(x - 1) * this.rows + y]?.trim()) { - return true; - } - // left - if (y > 0 && !this._letters[x * this.rows + y - 1]?.trim()) { - return true; - } // right - if (y < this.rows - 1 && !this._letters[x * this.rows + y + 1]?.trim()) { - return true; - } - return false; + const [x, y] = this.getCoordinate(i); + // down + if (x < this.rows - 1 && !this._letters[(x + 1) * this.rows + y]?.trim()) { + [this._letters[i], this._letters[(x + 1) * this.rows + y]] = [this._letters[(x + 1) * this.rows + y], this._letters[i]]; } - move(i) { - if (this.isWinning()) { - return; - } - const [x, y] = this.getCoordinate(i); - // down - if (x < this.rows - 1 && !this._letters[(x + 1) * this.rows + y]?.trim()) { - [this._letters[i], this._letters[(x + 1) * this.rows + y]] = [ - this._letters[(x + 1) * this.rows + y], - this._letters[i], - ]; - } - // up - if (x > 0 && !this._letters[(x - 1) * this.rows + y]?.trim()) { - [this._letters[i], this._letters[(x - 1) * this.rows + y]] = [ - this._letters[(x - 1) * this.rows + y], - this._letters[i], - ]; - } - // left - if (y > 0 && !this._letters[x * this.rows + y - 1]?.trim()) { - [this._letters[i], this._letters[x * this.rows + y - 1]] = [ - this._letters[x * this.rows + y - 1], - this._letters[i], - ]; - } - // right - if (y < this.rows - 1 && !this._letters[x * this.rows + y + 1]?.trim()) { - [this._letters[i], this._letters[x * this.rows + y + 1]] = [ - this._letters[x * this.rows + y + 1], - this._letters[i], - ]; - } + // up + if (x > 0 && !this._letters[(x - 1) * this.rows + y]?.trim()) { + [this._letters[i], this._letters[(x - 1) * this.rows + y]] = [this._letters[(x - 1) * this.rows + y], this._letters[i]]; + } + // left + if (y > 0 && !this._letters[x * this.rows + y - 1]?.trim()) { + [this._letters[i], this._letters[x * this.rows + y - 1]] = [this._letters[x * this.rows + y - 1], this._letters[i]]; } - isWinning() { - return this._letters.every((e, i) => e === this._win[i]); + // right + if (y < this.rows - 1 && !this._letters[x * this.rows + y + 1]?.trim()) { + [this._letters[i], this._letters[x * this.rows + y + 1]] = [this._letters[x * this.rows + y + 1], this._letters[i]]; } + } + isWinning() { + return this._letters.every((e, i) => e === this._win[i]); + } } -EightPuzzleService.ɵfac = function EightPuzzleService_Factory(t) { return new (t || EightPuzzleService)(); }; -EightPuzzleService.ɵprov = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: EightPuzzleService, factory: EightPuzzleService.ɵfac, providedIn: 'root' }); - +EightPuzzleService.ɵfac = function EightPuzzleService_Factory(t) { + return new (t || EightPuzzleService)(); +}; +EightPuzzleService.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ + token: EightPuzzleService, + factory: EightPuzzleService.ɵfac, + providedIn: 'root' +}); /***/ }), @@ -661,120 +746,145 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common */ 4666); -function Math1Component_p_4_Template(rf, ctx) { if (rf & 1) { +function Math1Component_p_4_Template(rf, ctx) { + if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "p"); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); -} if (rf & 2) { + } + if (rf & 2) { const item_r4 = ctx.$implicit; _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](item_r4); -} } -function Math1Component_p_6_Template(rf, ctx) { if (rf & 1) { + } +} +function Math1Component_p_6_Template(rf, ctx) { + if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "p"); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); -} if (rf & 2) { + } + if (rf & 2) { const item_r5 = ctx.$implicit; _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](item_r5); -} } -function Math1Component_p_8_Template(rf, ctx) { if (rf & 1) { + } +} +function Math1Component_p_8_Template(rf, ctx) { + if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "p", 5); -} if (rf & 2) { + } + if (rf & 2) { const item_r6 = ctx.$implicit; _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("innerHTML", item_r6, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeHtml"]); -} } -function Math1Component_p_10_Template(rf, ctx) { if (rf & 1) { + } +} +function Math1Component_p_10_Template(rf, ctx) { + if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "p", 5); -} if (rf & 2) { + } + if (rf & 2) { const item_r7 = ctx.$implicit; _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("innerHTML", item_r7, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeHtml"]); -} } + } +} class Math1Component { - constructor() { - this.nAdd = 10; - this.nSub = 10; - this.additions = []; - this.subtractions = []; - this.multiplications = []; - this.divisions = []; - } - ngOnInit() { - this.getAdditions(); - this.getSubtractions(); - this.getMultiplications(); - this.getDivisions(); - } - getAdditions() { - const max = 1000; - const min = 10; - for (let i = 0; i < this.nAdd; i++) { - let a = this.randomIntBetween(min, max); - let b = this.randomIntBetween(min, max); - this.additions.push(`${a} + ${b}`); - } - } - getSubtractions() { - const max = 1000; - const min = 10; - for (let i = 0; i < this.nAdd; i++) { - let a = this.randomIntBetween(min, max); - let b = this.randomIntBetween(min, max); - let s = a > b ? `${a} - ${b}` : `${b} - ${a}`; - this.subtractions.push(s); - } + constructor() { + this.nAdd = 10; + this.nSub = 10; + this.additions = []; + this.subtractions = []; + this.multiplications = []; + this.divisions = []; + } + ngOnInit() { + this.getAdditions(); + this.getSubtractions(); + this.getMultiplications(); + this.getDivisions(); + } + getAdditions() { + const max = 1000; + const min = 10; + for (let i = 0; i < this.nAdd; i++) { + let a = this.randomIntBetween(min, max); + let b = this.randomIntBetween(min, max); + this.additions.push(`${a} + ${b}`); } - getMultiplications() { - const max = 200; - const min = 1; - for (let i = 0; i < this.nAdd; i++) { - let a = this.randomIntBetween(min, max); - let b = this.randomIntBetween(min, max); - this.multiplications.push(`${a} × ${b}`); - } + } + getSubtractions() { + const max = 1000; + const min = 10; + for (let i = 0; i < this.nAdd; i++) { + let a = this.randomIntBetween(min, max); + let b = this.randomIntBetween(min, max); + let s = a > b ? `${a} - ${b}` : `${b} - ${a}`; + this.subtractions.push(s); } - getDivisions() { - const max = 100; - const min = 1; - for (let i = 0; i < this.nAdd; i++) { - let a = this.randomIntBetween(min, max); - let b = this.randomIntBetween(min, max); - this.divisions.push(`${a * b} ÷ ${b}`); - } + } + getMultiplications() { + const max = 200; + const min = 1; + for (let i = 0; i < this.nAdd; i++) { + let a = this.randomIntBetween(min, max); + let b = this.randomIntBetween(min, max); + this.multiplications.push(`${a} × ${b}`); } - randomIntBetween(min, max) { - return ~~(Math.random() * (max - min + 1) + min); + } + getDivisions() { + const max = 100; + const min = 1; + for (let i = 0; i < this.nAdd; i++) { + let a = this.randomIntBetween(min, max); + let b = this.randomIntBetween(min, max); + this.divisions.push(`${a * b} ÷ ${b}`); } + } + randomIntBetween(min, max) { + return ~~(Math.random() * (max - min + 1) + min); + } } -Math1Component.ɵfac = function Math1Component_Factory(t) { return new (t || Math1Component)(); }; -Math1Component.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: Math1Component, selectors: [["app-math"]], decls: 11, vars: 4, consts: [[2, "text-align", "center"], [1, "card-row"], [1, "card"], [4, "ngFor", "ngForOf"], [3, "innerHTML", 4, "ngFor", "ngForOf"], [3, "innerHTML"]], template: function Math1Component_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "h2", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1, "Basic Arithmetics - 2"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "div", 1)(3, "div", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](4, Math1Component_p_4_Template, 2, 1, "p", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](5, "div", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](6, Math1Component_p_6_Template, 2, 1, "p", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](7, "div", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](8, Math1Component_p_8_Template, 1, 1, "p", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](9, "div", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](10, Math1Component_p_10_Template, 1, 1, "p", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); - } if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.additions); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.subtractions); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.multiplications); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.divisions); - } }, dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_1__.NgForOf], styles: [".card-row[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-flow: row;\r\n justify-content: space-around;\r\n flex-wrap: wrap;\r\n gap: 1rem;\r\n}\r\n\r\n.card[_ngcontent-%COMP%] {\r\n box-shadow: 0 0.25rem 0.5rem 0 rgba(0, 0, 0, 0.2);\r\n transition: 0.3s;\r\n min-width: 5rem;\r\n max-width: 20rem;\r\n padding: 1rem 2rem;\r\n display: flex;\r\n flex-direction: column;\r\n flex-grow: 1;\r\n}\r\n\r\n.card[_ngcontent-%COMP%]:hover {\r\n box-shadow: 0 0.5rem 1rem 0 rgba(0, 0, 0, 0.2);\r\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1hdGgxLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxhQUFhO0VBQ2IsY0FBYztFQUNkLDZCQUE2QjtFQUM3QixlQUFlO0VBQ2YsU0FBUztBQUNYOztBQUVBO0VBQ0UsaURBQWlEO0VBQ2pELGdCQUFnQjtFQUNoQixlQUFlO0VBQ2YsZ0JBQWdCO0VBQ2hCLGtCQUFrQjtFQUNsQixhQUFhO0VBQ2Isc0JBQXNCO0VBQ3RCLFlBQVk7QUFDZDs7QUFFQTtFQUNFLDhDQUE4QztBQUNoRCIsImZpbGUiOiJtYXRoMS5jb21wb25lbnQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmNhcmQtcm93IHtcclxuICBkaXNwbGF5OiBmbGV4O1xyXG4gIGZsZXgtZmxvdzogcm93O1xyXG4gIGp1c3RpZnktY29udGVudDogc3BhY2UtYXJvdW5kO1xyXG4gIGZsZXgtd3JhcDogd3JhcDtcclxuICBnYXA6IDFyZW07XHJcbn1cclxuXHJcbi5jYXJkIHtcclxuICBib3gtc2hhZG93OiAwIDAuMjVyZW0gMC41cmVtIDAgcmdiYSgwLCAwLCAwLCAwLjIpO1xyXG4gIHRyYW5zaXRpb246IDAuM3M7XHJcbiAgbWluLXdpZHRoOiA1cmVtO1xyXG4gIG1heC13aWR0aDogMjByZW07XHJcbiAgcGFkZGluZzogMXJlbSAycmVtO1xyXG4gIGRpc3BsYXk6IGZsZXg7XHJcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcclxuICBmbGV4LWdyb3c6IDE7XHJcbn1cclxuXHJcbi5jYXJkOmhvdmVyIHtcclxuICBib3gtc2hhZG93OiAwIDAuNXJlbSAxcmVtIDAgcmdiYSgwLCAwLCAwLCAwLjIpO1xyXG59XHJcbiJdfQ== */"] }); - +Math1Component.ɵfac = function Math1Component_Factory(t) { + return new (t || Math1Component)(); +}; +Math1Component.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ + type: Math1Component, + selectors: [["app-math"]], + decls: 11, + vars: 4, + consts: [[2, "text-align", "center"], [1, "card-row"], [1, "card"], [4, "ngFor", "ngForOf"], [3, "innerHTML", 4, "ngFor", "ngForOf"], [3, "innerHTML"]], + template: function Math1Component_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "h2", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1, "Basic Arithmetics - 2"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "div", 1)(3, "div", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](4, Math1Component_p_4_Template, 2, 1, "p", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](5, "div", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](6, Math1Component_p_6_Template, 2, 1, "p", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](7, "div", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](8, Math1Component_p_8_Template, 1, 1, "p", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](9, "div", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](10, Math1Component_p_10_Template, 1, 1, "p", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.additions); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.subtractions); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.multiplications); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.divisions); + } + }, + dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_1__.NgForOf], + styles: [".card-row[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-flow: row;\r\n justify-content: space-around;\r\n flex-wrap: wrap;\r\n gap: 1rem;\r\n}\r\n\r\n.card[_ngcontent-%COMP%] {\r\n box-shadow: 0 0.25rem 0.5rem 0 rgba(0, 0, 0, 0.2);\r\n transition: 0.3s;\r\n min-width: 5rem;\r\n max-width: 20rem;\r\n padding: 1rem 2rem;\r\n display: flex;\r\n flex-direction: column;\r\n flex-grow: 1;\r\n}\r\n\r\n.card[_ngcontent-%COMP%]:hover {\r\n box-shadow: 0 0.5rem 1rem 0 rgba(0, 0, 0, 0.2);\r\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy9hcHAvbWF0aDEvbWF0aDEuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGFBQWE7RUFDYixjQUFjO0VBQ2QsNkJBQTZCO0VBQzdCLGVBQWU7RUFDZixTQUFTO0FBQ1g7O0FBRUE7RUFDRSxpREFBaUQ7RUFDakQsZ0JBQWdCO0VBQ2hCLGVBQWU7RUFDZixnQkFBZ0I7RUFDaEIsa0JBQWtCO0VBQ2xCLGFBQWE7RUFDYixzQkFBc0I7RUFDdEIsWUFBWTtBQUNkOztBQUVBO0VBQ0UsOENBQThDO0FBQ2hEIiwic291cmNlc0NvbnRlbnQiOlsiLmNhcmQtcm93IHtcclxuICBkaXNwbGF5OiBmbGV4O1xyXG4gIGZsZXgtZmxvdzogcm93O1xyXG4gIGp1c3RpZnktY29udGVudDogc3BhY2UtYXJvdW5kO1xyXG4gIGZsZXgtd3JhcDogd3JhcDtcclxuICBnYXA6IDFyZW07XHJcbn1cclxuXHJcbi5jYXJkIHtcclxuICBib3gtc2hhZG93OiAwIDAuMjVyZW0gMC41cmVtIDAgcmdiYSgwLCAwLCAwLCAwLjIpO1xyXG4gIHRyYW5zaXRpb246IDAuM3M7XHJcbiAgbWluLXdpZHRoOiA1cmVtO1xyXG4gIG1heC13aWR0aDogMjByZW07XHJcbiAgcGFkZGluZzogMXJlbSAycmVtO1xyXG4gIGRpc3BsYXk6IGZsZXg7XHJcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcclxuICBmbGV4LWdyb3c6IDE7XHJcbn1cclxuXHJcbi5jYXJkOmhvdmVyIHtcclxuICBib3gtc2hhZG93OiAwIDAuNXJlbSAxcmVtIDAgcmdiYSgwLCAwLCAwLCAwLjIpO1xyXG59XHJcbiJdLCJzb3VyY2VSb290IjoiIn0= */"] +}); /***/ }), @@ -793,8 +903,8 @@ __webpack_require__.r(__webpack_exports__); class Math2Component { - constructor() { - this.frac = ` + constructor() { + this.frac = ` numerator1 denominator1 @@ -803,7 +913,7 @@ class Math2Component { ? `; - this.mathml = ` + this.mathml = ` numerator1 denominator1 @@ -817,26 +927,26 @@ class Math2Component { ? `; - this.nAdd = 10; - this.nSub = 10; - this.fracSimp = ''; - this.additions1 = ''; - this.additions2 = ''; - this.multiplications = ''; - } - ngOnInit() { - this.getSimplifications(); - this.getAdditions1(); - this.getAdditions2(); - } - getSimplifications() { - const max = 20; - const min = 1; - for (let i = 0; i < this.nAdd; i++) { - let a = this.randomIntBetween(min, max); - let b = this.randomIntBetween(min, max); - let c = this.randomIntBetween(min, max); - this.fracSimp = this.fracSimp.concat(` + this.nAdd = 10; + this.nSub = 10; + this.fracSimp = ''; + this.additions1 = ''; + this.additions2 = ''; + this.multiplications = ''; + } + ngOnInit() { + this.getSimplifications(); + this.getAdditions1(); + this.getAdditions2(); + } + getSimplifications() { + const max = 20; + const min = 1; + for (let i = 0; i < this.nAdd; i++) { + let a = this.randomIntBetween(min, max); + let b = this.randomIntBetween(min, max); + let c = this.randomIntBetween(min, max); + this.fracSimp = this.fracSimp.concat(` ${a * c} ${b * c} @@ -844,18 +954,18 @@ class Math2Component { = ? `); - } - this.fracSimp = this.fracSimp.concat(''); - } - getAdditions1() { - const max = 10; - const min = 1; - for (let i = 0; i < this.nAdd; i++) { - let a = this.randomIntBetween(min, max); - let b = this.randomIntBetween(min, max); - let c = this.randomIntBetween(min, max); - let d = this.randomIntBetween(min, max); - this.additions1 = this.additions1.concat(` + } + this.fracSimp = this.fracSimp.concat(''); + } + getAdditions1() { + const max = 10; + const min = 1; + for (let i = 0; i < this.nAdd; i++) { + let a = this.randomIntBetween(min, max); + let b = this.randomIntBetween(min, max); + let c = this.randomIntBetween(min, max); + let d = this.randomIntBetween(min, max); + this.additions1 = this.additions1.concat(` ${a} ${b} @@ -868,8 +978,7 @@ class Math2Component { = ? `); - this.multiplications = this.multiplications - .concat(` + this.multiplications = this.multiplications.concat(` ${a} ${b} @@ -882,19 +991,19 @@ class Math2Component { = ? `); - } - this.additions1 = this.additions1.concat(''); - this.multiplications = this.multiplications.concat(''); - } - getAdditions2() { - const max = 25; - const min = 1; - for (let i = 0; i < this.nAdd; i++) { - let a = this.randomIntBetween(min, max); - let b = this.randomIntBetween(min, max); - let c = this.randomIntBetween(min, max); - let d = this.randomIntBetween(min, max); - this.additions2 = this.additions2.concat(` + } + this.additions1 = this.additions1.concat(''); + this.multiplications = this.multiplications.concat(''); + } + getAdditions2() { + const max = 25; + const min = 1; + for (let i = 0; i < this.nAdd; i++) { + let a = this.randomIntBetween(min, max); + let b = this.randomIntBetween(min, max); + let c = this.randomIntBetween(min, max); + let d = this.randomIntBetween(min, max); + this.additions2 = this.additions2.concat(` ${a} ${b} @@ -907,41 +1016,54 @@ class Math2Component { = ? `); - } - this.additions2 = this.additions2.concat(''); - } - randomIntBetween(min, max) { - return ~~(Math.random() * (max - min + 1) + min); } + this.additions2 = this.additions2.concat(''); + } + randomIntBetween(min, max) { + return ~~(Math.random() * (max - min + 1) + min); + } } -Math2Component.ɵfac = function Math2Component_Factory(t) { return new (t || Math2Component)(); }; -Math2Component.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ type: Math2Component, selectors: [["app-math2"]], decls: 11, vars: 4, consts: [[2, "text-align", "center"], [1, "card-row"], [1, "card"], [3, "appMath"]], template: function Math2Component_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "h2", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](1, "Fractions"); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](2, "div", 1)(3, "div", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](4, "div", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](5, "div", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](6, "div", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](7, "div", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](8, "div", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](9, "div", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](10, "div", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); - } if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("appMath", ctx.fracSimp); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("appMath", ctx.additions1); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("appMath", ctx.additions2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("appMath", ctx.multiplications); - } }, dependencies: [_math_math_directive__WEBPACK_IMPORTED_MODULE_0__.MathDirective], styles: [".equation {\r\n display: block !important;\r\n font-size: xx-large !important;\r\n margin: 1.5rem 0 !important;\r\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1hdGgyLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSx5QkFBeUI7RUFDekIsOEJBQThCO0VBQzlCLDJCQUEyQjtBQUM3QiIsImZpbGUiOiJtYXRoMi5jb21wb25lbnQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiOjpuZy1kZWVwIC5lcXVhdGlvbiB7XHJcbiAgZGlzcGxheTogYmxvY2sgIWltcG9ydGFudDtcclxuICBmb250LXNpemU6IHh4LWxhcmdlICFpbXBvcnRhbnQ7XHJcbiAgbWFyZ2luOiAxLjVyZW0gMCAhaW1wb3J0YW50O1xyXG59XHJcbiJdfQ== */", ".card-row[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-flow: row;\r\n justify-content: space-around;\r\n flex-wrap: wrap;\r\n gap: 1rem;\r\n}\r\n\r\n.card[_ngcontent-%COMP%] {\r\n box-shadow: 0 0.25rem 0.5rem 0 rgba(0, 0, 0, 0.2);\r\n transition: 0.3s;\r\n min-width: 5rem;\r\n max-width: 20rem;\r\n padding: 1rem 2rem;\r\n display: flex;\r\n flex-direction: column;\r\n flex-grow: 1;\r\n}\r\n\r\n.card[_ngcontent-%COMP%]:hover {\r\n box-shadow: 0 0.5rem 1rem 0 rgba(0, 0, 0, 0.2);\r\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1hdGgxLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxhQUFhO0VBQ2IsY0FBYztFQUNkLDZCQUE2QjtFQUM3QixlQUFlO0VBQ2YsU0FBUztBQUNYOztBQUVBO0VBQ0UsaURBQWlEO0VBQ2pELGdCQUFnQjtFQUNoQixlQUFlO0VBQ2YsZ0JBQWdCO0VBQ2hCLGtCQUFrQjtFQUNsQixhQUFhO0VBQ2Isc0JBQXNCO0VBQ3RCLFlBQVk7QUFDZDs7QUFFQTtFQUNFLDhDQUE4QztBQUNoRCIsImZpbGUiOiJtYXRoMS5jb21wb25lbnQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmNhcmQtcm93IHtcclxuICBkaXNwbGF5OiBmbGV4O1xyXG4gIGZsZXgtZmxvdzogcm93O1xyXG4gIGp1c3RpZnktY29udGVudDogc3BhY2UtYXJvdW5kO1xyXG4gIGZsZXgtd3JhcDogd3JhcDtcclxuICBnYXA6IDFyZW07XHJcbn1cclxuXHJcbi5jYXJkIHtcclxuICBib3gtc2hhZG93OiAwIDAuMjVyZW0gMC41cmVtIDAgcmdiYSgwLCAwLCAwLCAwLjIpO1xyXG4gIHRyYW5zaXRpb246IDAuM3M7XHJcbiAgbWluLXdpZHRoOiA1cmVtO1xyXG4gIG1heC13aWR0aDogMjByZW07XHJcbiAgcGFkZGluZzogMXJlbSAycmVtO1xyXG4gIGRpc3BsYXk6IGZsZXg7XHJcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcclxuICBmbGV4LWdyb3c6IDE7XHJcbn1cclxuXHJcbi5jYXJkOmhvdmVyIHtcclxuICBib3gtc2hhZG93OiAwIDAuNXJlbSAxcmVtIDAgcmdiYSgwLCAwLCAwLCAwLjIpO1xyXG59XHJcbiJdfQ== */"] }); - +Math2Component.ɵfac = function Math2Component_Factory(t) { + return new (t || Math2Component)(); +}; +Math2Component.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ + type: Math2Component, + selectors: [["app-math2"]], + decls: 11, + vars: 4, + consts: [[2, "text-align", "center"], [1, "card-row"], [1, "card"], [3, "appMath"]], + template: function Math2Component_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "h2", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](1, "Fractions"); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](2, "div", 1)(3, "div", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](4, "div", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](5, "div", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](6, "div", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](7, "div", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](8, "div", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](9, "div", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](10, "div", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](4); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("appMath", ctx.fracSimp); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("appMath", ctx.additions1); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("appMath", ctx.additions2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("appMath", ctx.multiplications); + } + }, + dependencies: [_math_math_directive__WEBPACK_IMPORTED_MODULE_0__.MathDirective], + styles: [".equation {\r\n display: block !important;\r\n font-size: xx-large !important;\r\n margin: 1.5rem 0 !important;\r\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy9hcHAvbWF0aDIvbWF0aDIuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLHlCQUF5QjtFQUN6Qiw4QkFBOEI7RUFDOUIsMkJBQTJCO0FBQzdCIiwic291cmNlc0NvbnRlbnQiOlsiOjpuZy1kZWVwIC5lcXVhdGlvbiB7XHJcbiAgZGlzcGxheTogYmxvY2sgIWltcG9ydGFudDtcclxuICBmb250LXNpemU6IHh4LWxhcmdlICFpbXBvcnRhbnQ7XHJcbiAgbWFyZ2luOiAxLjVyZW0gMCAhaW1wb3J0YW50O1xyXG59XHJcbiJdLCJzb3VyY2VSb290IjoiIn0= */", ".card-row[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-flow: row;\r\n justify-content: space-around;\r\n flex-wrap: wrap;\r\n gap: 1rem;\r\n}\r\n\r\n.card[_ngcontent-%COMP%] {\r\n box-shadow: 0 0.25rem 0.5rem 0 rgba(0, 0, 0, 0.2);\r\n transition: 0.3s;\r\n min-width: 5rem;\r\n max-width: 20rem;\r\n padding: 1rem 2rem;\r\n display: flex;\r\n flex-direction: column;\r\n flex-grow: 1;\r\n}\r\n\r\n.card[_ngcontent-%COMP%]:hover {\r\n box-shadow: 0 0.5rem 1rem 0 rgba(0, 0, 0, 0.2);\r\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy9hcHAvbWF0aDEvbWF0aDEuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGFBQWE7RUFDYixjQUFjO0VBQ2QsNkJBQTZCO0VBQzdCLGVBQWU7RUFDZixTQUFTO0FBQ1g7O0FBRUE7RUFDRSxpREFBaUQ7RUFDakQsZ0JBQWdCO0VBQ2hCLGVBQWU7RUFDZixnQkFBZ0I7RUFDaEIsa0JBQWtCO0VBQ2xCLGFBQWE7RUFDYixzQkFBc0I7RUFDdEIsWUFBWTtBQUNkOztBQUVBO0VBQ0UsOENBQThDO0FBQ2hEIiwic291cmNlc0NvbnRlbnQiOlsiLmNhcmQtcm93IHtcclxuICBkaXNwbGF5OiBmbGV4O1xyXG4gIGZsZXgtZmxvdzogcm93O1xyXG4gIGp1c3RpZnktY29udGVudDogc3BhY2UtYXJvdW5kO1xyXG4gIGZsZXgtd3JhcDogd3JhcDtcclxuICBnYXA6IDFyZW07XHJcbn1cclxuXHJcbi5jYXJkIHtcclxuICBib3gtc2hhZG93OiAwIDAuMjVyZW0gMC41cmVtIDAgcmdiYSgwLCAwLCAwLCAwLjIpO1xyXG4gIHRyYW5zaXRpb246IDAuM3M7XHJcbiAgbWluLXdpZHRoOiA1cmVtO1xyXG4gIG1heC13aWR0aDogMjByZW07XHJcbiAgcGFkZGluZzogMXJlbSAycmVtO1xyXG4gIGRpc3BsYXk6IGZsZXg7XHJcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcclxuICBmbGV4LWdyb3c6IDE7XHJcbn1cclxuXHJcbi5jYXJkOmhvdmVyIHtcclxuICBib3gtc2hhZG93OiAwIDAuNXJlbSAxcmVtIDAgcmdiYSgwLCAwLCAwLCAwLjIpO1xyXG59XHJcbiJdLCJzb3VyY2VSb290IjoiIn0= */"] +}); /***/ }), @@ -959,70 +1081,89 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common */ 4666); -function Math3Component_p_4_Template(rf, ctx) { if (rf & 1) { +function Math3Component_p_4_Template(rf, ctx) { + if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "p", 4); -} if (rf & 2) { + } + if (rf & 2) { const item_r2 = ctx.$implicit; _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("innerHTML", item_r2, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeHtml"]); -} } -function Math3Component_p_6_Template(rf, ctx) { if (rf & 1) { + } +} +function Math3Component_p_6_Template(rf, ctx) { + if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "p", 4); -} if (rf & 2) { + } + if (rf & 2) { const item_r3 = ctx.$implicit; _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("innerHTML", item_r3, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeHtml"]); -} } + } +} class Math3Component { - constructor() { - this.nAdd = 10; - this.nSub = 10; - this.list1 = []; - this.list2 = []; - this.operators = ['+', '-', '×', '÷']; - } - ngOnInit() { - this.getLists(); - } - getLists() { - const max = 200; - const min = 1; - for (let i = 0; i < this.nAdd; i++) { - const a = this.randomIntBetween(min, max); - const op1 = this.randomOperator(); - const b = this.randomIntBetween(min, max); - const op2 = this.randomOperator(); - const f = this.randomIntBetween(1, 10); - const c = this.randomIntBetween(min, max); - const op3 = this.randomOperator(); - const d = this.randomIntBetween(min, max); - this.list1.push(`(${a} ${op1} ${b}) ${op2} (${c} ${op3} ${d})`); - this.list2.push(`(${d} ${op1} ${b}) ${op2} ${f} × (${a} ${op3} ${c})`); - } - } - randomIntBetween(min, max) { - return ~~(Math.random() * (max - min + 1) + min); - } - randomOperator() { - return this.operators[~~(Math.random() * 4)]; + constructor() { + this.nAdd = 10; + this.nSub = 10; + this.list1 = []; + this.list2 = []; + this.operators = ['+', '-', '×', '÷']; + } + ngOnInit() { + this.getLists(); + } + getLists() { + const max = 200; + const min = 1; + for (let i = 0; i < this.nAdd; i++) { + const a = this.randomIntBetween(min, max); + const op1 = this.randomOperator(); + const b = this.randomIntBetween(min, max); + const op2 = this.randomOperator(); + const f = this.randomIntBetween(1, 10); + const c = this.randomIntBetween(min, max); + const op3 = this.randomOperator(); + const d = this.randomIntBetween(min, max); + this.list1.push(`(${a} ${op1} ${b}) ${op2} (${c} ${op3} ${d})`); + this.list2.push(`(${d} ${op1} ${b}) ${op2} ${f} × (${a} ${op3} ${c})`); } + } + randomIntBetween(min, max) { + return ~~(Math.random() * (max - min + 1) + min); + } + randomOperator() { + return this.operators[~~(Math.random() * 4)]; + } } -Math3Component.ɵfac = function Math3Component_Factory(t) { return new (t || Math3Component)(); }; -Math3Component.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: Math3Component, selectors: [["app-math3"]], decls: 7, vars: 2, consts: [[2, "text-align", "center"], [1, "card-row", 2, "font-size", "larger"], [1, "card"], [3, "innerHTML", 4, "ngFor", "ngForOf"], [3, "innerHTML"]], template: function Math3Component_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "h2", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1, "Four Operations"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "div", 1)(3, "div", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](4, Math3Component_p_4_Template, 1, 1, "p", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](5, "div", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](6, Math3Component_p_6_Template, 1, 1, "p", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); - } if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.list1); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.list2); - } }, dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_1__.NgForOf], styles: ["\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJtYXRoMy5jb21wb25lbnQuY3NzIn0= */", ".card-row[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-flow: row;\r\n justify-content: space-around;\r\n flex-wrap: wrap;\r\n gap: 1rem;\r\n}\r\n\r\n.card[_ngcontent-%COMP%] {\r\n box-shadow: 0 0.25rem 0.5rem 0 rgba(0, 0, 0, 0.2);\r\n transition: 0.3s;\r\n min-width: 5rem;\r\n max-width: 20rem;\r\n padding: 1rem 2rem;\r\n display: flex;\r\n flex-direction: column;\r\n flex-grow: 1;\r\n}\r\n\r\n.card[_ngcontent-%COMP%]:hover {\r\n box-shadow: 0 0.5rem 1rem 0 rgba(0, 0, 0, 0.2);\r\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1hdGgxLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxhQUFhO0VBQ2IsY0FBYztFQUNkLDZCQUE2QjtFQUM3QixlQUFlO0VBQ2YsU0FBUztBQUNYOztBQUVBO0VBQ0UsaURBQWlEO0VBQ2pELGdCQUFnQjtFQUNoQixlQUFlO0VBQ2YsZ0JBQWdCO0VBQ2hCLGtCQUFrQjtFQUNsQixhQUFhO0VBQ2Isc0JBQXNCO0VBQ3RCLFlBQVk7QUFDZDs7QUFFQTtFQUNFLDhDQUE4QztBQUNoRCIsImZpbGUiOiJtYXRoMS5jb21wb25lbnQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmNhcmQtcm93IHtcclxuICBkaXNwbGF5OiBmbGV4O1xyXG4gIGZsZXgtZmxvdzogcm93O1xyXG4gIGp1c3RpZnktY29udGVudDogc3BhY2UtYXJvdW5kO1xyXG4gIGZsZXgtd3JhcDogd3JhcDtcclxuICBnYXA6IDFyZW07XHJcbn1cclxuXHJcbi5jYXJkIHtcclxuICBib3gtc2hhZG93OiAwIDAuMjVyZW0gMC41cmVtIDAgcmdiYSgwLCAwLCAwLCAwLjIpO1xyXG4gIHRyYW5zaXRpb246IDAuM3M7XHJcbiAgbWluLXdpZHRoOiA1cmVtO1xyXG4gIG1heC13aWR0aDogMjByZW07XHJcbiAgcGFkZGluZzogMXJlbSAycmVtO1xyXG4gIGRpc3BsYXk6IGZsZXg7XHJcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcclxuICBmbGV4LWdyb3c6IDE7XHJcbn1cclxuXHJcbi5jYXJkOmhvdmVyIHtcclxuICBib3gtc2hhZG93OiAwIDAuNXJlbSAxcmVtIDAgcmdiYSgwLCAwLCAwLCAwLjIpO1xyXG59XHJcbiJdfQ== */"] }); - +Math3Component.ɵfac = function Math3Component_Factory(t) { + return new (t || Math3Component)(); +}; +Math3Component.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ + type: Math3Component, + selectors: [["app-math3"]], + decls: 7, + vars: 2, + consts: [[2, "text-align", "center"], [1, "card-row", 2, "font-size", "larger"], [1, "card"], [3, "innerHTML", 4, "ngFor", "ngForOf"], [3, "innerHTML"]], + template: function Math3Component_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "h2", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1, "Four Operations"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "div", 1)(3, "div", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](4, Math3Component_p_4_Template, 1, 1, "p", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](5, "div", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](6, Math3Component_p_6_Template, 1, 1, "p", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.list1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.list2); + } + }, + dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_1__.NgForOf], + styles: ["\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZVJvb3QiOiIifQ== */", ".card-row[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-flow: row;\r\n justify-content: space-around;\r\n flex-wrap: wrap;\r\n gap: 1rem;\r\n}\r\n\r\n.card[_ngcontent-%COMP%] {\r\n box-shadow: 0 0.25rem 0.5rem 0 rgba(0, 0, 0, 0.2);\r\n transition: 0.3s;\r\n min-width: 5rem;\r\n max-width: 20rem;\r\n padding: 1rem 2rem;\r\n display: flex;\r\n flex-direction: column;\r\n flex-grow: 1;\r\n}\r\n\r\n.card[_ngcontent-%COMP%]:hover {\r\n box-shadow: 0 0.5rem 1rem 0 rgba(0, 0, 0, 0.2);\r\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy9hcHAvbWF0aDEvbWF0aDEuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGFBQWE7RUFDYixjQUFjO0VBQ2QsNkJBQTZCO0VBQzdCLGVBQWU7RUFDZixTQUFTO0FBQ1g7O0FBRUE7RUFDRSxpREFBaUQ7RUFDakQsZ0JBQWdCO0VBQ2hCLGVBQWU7RUFDZixnQkFBZ0I7RUFDaEIsa0JBQWtCO0VBQ2xCLGFBQWE7RUFDYixzQkFBc0I7RUFDdEIsWUFBWTtBQUNkOztBQUVBO0VBQ0UsOENBQThDO0FBQ2hEIiwic291cmNlc0NvbnRlbnQiOlsiLmNhcmQtcm93IHtcclxuICBkaXNwbGF5OiBmbGV4O1xyXG4gIGZsZXgtZmxvdzogcm93O1xyXG4gIGp1c3RpZnktY29udGVudDogc3BhY2UtYXJvdW5kO1xyXG4gIGZsZXgtd3JhcDogd3JhcDtcclxuICBnYXA6IDFyZW07XHJcbn1cclxuXHJcbi5jYXJkIHtcclxuICBib3gtc2hhZG93OiAwIDAuMjVyZW0gMC41cmVtIDAgcmdiYSgwLCAwLCAwLCAwLjIpO1xyXG4gIHRyYW5zaXRpb246IDAuM3M7XHJcbiAgbWluLXdpZHRoOiA1cmVtO1xyXG4gIG1heC13aWR0aDogMjByZW07XHJcbiAgcGFkZGluZzogMXJlbSAycmVtO1xyXG4gIGRpc3BsYXk6IGZsZXg7XHJcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcclxuICBmbGV4LWdyb3c6IDE7XHJcbn1cclxuXHJcbi5jYXJkOmhvdmVyIHtcclxuICBib3gtc2hhZG93OiAwIDAuNXJlbSAxcmVtIDAgcmdiYSgwLCAwLCAwLCAwLjIpO1xyXG59XHJcbiJdLCJzb3VyY2VSb290IjoiIn0= */"] +}); /***/ }), @@ -1041,31 +1182,37 @@ __webpack_require__.r(__webpack_exports__); class MathDirective { - constructor(svc, elementRef, ngZone) { - this.svc = svc; - this.ngZone = ngZone; - this.appMath = ''; - this.el = elementRef.nativeElement; - } - ngOnInit() { - this.render(); - } - ngOnChanges(changes) { - if (changes && changes['appMath'] && changes['appMath'].currentValue) { - this.render(); - } - } - render() { - this.ngZone.runOutsideAngular(() => { - this.svc - .registerMathJax() - .subscribe(() => this.svc.render(this.el, this.appMath)); - }); + constructor(svc, elementRef, ngZone) { + this.svc = svc; + this.ngZone = ngZone; + this.appMath = ''; + this.el = elementRef.nativeElement; + } + ngOnInit() { + this.render(); + } + ngOnChanges(changes) { + if (changes && changes['appMath'] && changes['appMath'].currentValue) { + this.render(); } + } + render() { + this.ngZone.runOutsideAngular(() => { + this.svc.registerMathJax().subscribe(() => this.svc.render(this.el, this.appMath)); + }); + } } -MathDirective.ɵfac = function MathDirective_Factory(t) { return new (t || MathDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_math_service__WEBPACK_IMPORTED_MODULE_0__.MathService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone)); }; -MathDirective.ɵdir = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: MathDirective, selectors: [["", "appMath", ""]], inputs: { appMath: "appMath" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵNgOnChangesFeature"]] }); - +MathDirective.ɵfac = function MathDirective_Factory(t) { + return new (t || MathDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_math_service__WEBPACK_IMPORTED_MODULE_0__.MathService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone)); +}; +MathDirective.ɵdir = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ + type: MathDirective, + selectors: [["", "appMath", ""]], + inputs: { + appMath: "appMath" + }, + features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵNgOnChangesFeature"]] +}); /***/ }), @@ -1085,13 +1232,22 @@ __webpack_require__.r(__webpack_exports__); -class MathModule { -} -MathModule.ɵfac = function MathModule_Factory(t) { return new (t || MathModule)(); }; -MathModule.ɵmod = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({ type: MathModule }); -MathModule.ɵinj = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjector"]({ providers: [_math_service__WEBPACK_IMPORTED_MODULE_1__.MathService] }); -(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵsetNgModuleScope"](MathModule, { declarations: [_math_directive__WEBPACK_IMPORTED_MODULE_0__.MathDirective], exports: [_math_directive__WEBPACK_IMPORTED_MODULE_0__.MathDirective] }); })(); - +class MathModule {} +MathModule.ɵfac = function MathModule_Factory(t) { + return new (t || MathModule)(); +}; +MathModule.ɵmod = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({ + type: MathModule +}); +MathModule.ɵinj = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjector"]({ + providers: [_math_service__WEBPACK_IMPORTED_MODULE_1__.MathService] +}); +(function () { + (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵsetNgModuleScope"](MathModule, { + declarations: [_math_directive__WEBPACK_IMPORTED_MODULE_0__.MathDirective], + exports: [_math_directive__WEBPACK_IMPORTED_MODULE_0__.MathDirective] + }); +})(); /***/ }), @@ -1117,12 +1273,10 @@ class MathService { this.source = 'https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/mml-chtml.js'; this.integrity = 'sha256-CnzfCXjFj1REmPHgWvm/OQv8gFaxwbLKUi41yCU7N2s='; } - registerMathJax() { if (this.loaded$) { return this.loaded$.asObservable(); } - this.loaded$ = new rxjs__WEBPACK_IMPORTED_MODULE_0__.ReplaySubject(); const script = this.document.createElement('script'); script.type = 'text/javascript'; @@ -1130,16 +1284,13 @@ class MathService { script.integrity = this.integrity; script.async = true; script.crossOrigin = 'anonymous'; - script.onload = () => { this.loaded$.next(true); this.loaded$.complete(); }; - this.document.head.appendChild(script); return this.loaded$.asObservable(); } - render(element, math) { // Take initial typesetting which MathJax performs into account window.MathJax.startup.promise.then(() => { @@ -1147,13 +1298,10 @@ class MathService { window.MathJax.typesetPromise(); }); } - } - MathService.ɵfac = function MathService_Factory(t) { return new (t || MathService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT)); }; - MathService.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: MathService, factory: MathService.ɵfac, @@ -1182,287 +1330,323 @@ __webpack_require__.r(__webpack_exports__); -function MazeComponent_button_12_Template(rf, ctx) { if (rf & 1) { +function MazeComponent_button_12_Template(rf, ctx) { + if (rf & 1) { const _r2 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetCurrentView"](); _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "button", 6); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_button_12_Template_button_click_0_listener() { _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵrestoreView"](_r2); const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵnextContext"](); return _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresetView"](ctx_r1.test()); }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_button_12_Template_button_click_0_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵrestoreView"](_r2); + const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresetView"](ctx_r1.test()); + }); _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](1, " Test "); _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); -} if (rf & 2) { + } + if (rf & 2) { const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵnextContext"](); _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("disabled", ctx_r0.busy); -} } + } +} class MazeComponent { - constructor() { - this.row = 15; - this.col = 15; - this.cellSize = 20; // length of cell edge - this.cellEdgeThickness = 2; // thickness of cell edge - this.cellBackground = '#FFFFFF'; - this.solutionPathColor = '#FF7575'; - this.myPathColor = '#4080FF'; - this.myPathThickness = 10; - this.solutionPathThickness = 3; - this.gameOver = false; - this.myPath = []; - this.showTestButton = false; - this.busy = false; - if (!src_environments_environment__WEBPACK_IMPORTED_MODULE_1__.environment.production) { - this.showTestButton = true; - } + constructor() { + this.row = 15; + this.col = 15; + this.cellSize = 20; // length of cell edge + this.cellEdgeThickness = 2; // thickness of cell edge + this.cellBackground = '#FFFFFF'; + this.solutionPathColor = '#FF7575'; + this.myPathColor = '#4080FF'; + this.myPathThickness = 10; + this.solutionPathThickness = 3; + this.gameOver = false; + this.myPath = []; + this.showTestButton = false; + this.busy = false; + if (!src_environments_environment__WEBPACK_IMPORTED_MODULE_1__.environment.production) { + this.showTestButton = true; } - ngOnInit() { } - ngAfterViewInit() { - this.canvas = document.getElementById('maze'); - this.ctx = this.canvas.getContext('2d'); - this.drawMaze(); - } - drawMaze() { - this.busy = true; - this.validateInputs(); - this.maze = new _models__WEBPACK_IMPORTED_MODULE_0__.Maze(this.row, this.col); - this.canvas.width = this.col * this.cellSize; - this.canvas.height = this.row * this.cellSize; - // open the first and last cells to show the entrance and exit - this.maze.firstCell.westEdge = false; - this.maze.lastCell.eastEdge = false; - // draw the cells - this.ctx.lineWidth = this.cellEdgeThickness; - this.ctx.fillStyle = this.cellBackground; - this.maze.cells.forEach(x => x.forEach(c => this.draw(c))); - this.initPlay(); - this.busy = false; - } - initPlay() { - this.gameOver = false; - this.myPath.length = 0; - this.currentCell = this.maze.firstCell; // reset myPath position - this.myPath.push(this.currentCell); - // draw the initial step of myPath in the first Cell as entrance - this.ctx.lineWidth = this.myPathThickness; - this.ctx.strokeStyle = this.myPathColor; - this.ctx.beginPath(); - this.ctx.moveTo(0, this.cellSize / 2); - this.ctx.lineTo(this.cellSize / 2, this.cellSize / 2); - this.ctx.stroke(); - } - handleKeyDown(event) { - if (this.gameOver) - return; - const direction = _models__WEBPACK_IMPORTED_MODULE_0__.keyboardMap[event.key]; - if (direction) { - this.move(direction); - event.preventDefault(); - } - } - move(direction) { - let nextCell; - if (direction === 'Left') { - if (this.currentCell.col < 1) - return; - nextCell = this.maze.cells[this.currentCell.row][this.currentCell.col - 1]; - } - if (direction === 'Right') { - if (this.currentCell.col + 1 >= this.col) - return; - nextCell = this.maze.cells[this.currentCell.row][this.currentCell.col + 1]; - } - if (direction === 'Up') { - if (this.currentCell.row < 1) - return; - nextCell = this.maze.cells[this.currentCell.row - 1][this.currentCell.col]; - } - if (direction === 'Down') { - if (this.currentCell.row + 1 >= this.row) - return; - nextCell = this.maze.cells[this.currentCell.row + 1][this.currentCell.col]; - } - if (this.currentCell.isConnectedTo(nextCell)) { - if (this.myPath.length > 1 && - this.myPath[this.myPath.length - 2].equals(nextCell)) { - // this is a step back; reverse the step by erasing the original path - this.drawPath(this.myPath, this.cellBackground); - this.myPath.pop(); - } - else { - this.myPath.push(nextCell); - if (nextCell.equals(this.maze.lastCell)) { - this.hooray(); - this.drawSolution(this.myPathColor, this.myPathThickness); - return; - } - } - this.drawPath(this.myPath); - this.currentCell = nextCell; - } + } + ngOnInit() {} + ngAfterViewInit() { + this.canvas = document.getElementById('maze'); + this.ctx = this.canvas.getContext('2d'); + this.drawMaze(); + } + drawMaze() { + this.busy = true; + this.validateInputs(); + this.maze = new _models__WEBPACK_IMPORTED_MODULE_0__.Maze(this.row, this.col); + this.canvas.width = this.col * this.cellSize; + this.canvas.height = this.row * this.cellSize; + // open the first and last cells to show the entrance and exit + this.maze.firstCell.westEdge = false; + this.maze.lastCell.eastEdge = false; + // draw the cells + this.ctx.lineWidth = this.cellEdgeThickness; + this.ctx.fillStyle = this.cellBackground; + this.maze.cells.forEach(x => x.forEach(c => this.draw(c))); + this.initPlay(); + this.busy = false; + } + initPlay() { + this.gameOver = false; + this.myPath.length = 0; + this.currentCell = this.maze.firstCell; // reset myPath position + this.myPath.push(this.currentCell); + // draw the initial step of myPath in the first Cell as entrance + this.ctx.lineWidth = this.myPathThickness; + this.ctx.strokeStyle = this.myPathColor; + this.ctx.beginPath(); + this.ctx.moveTo(0, this.cellSize / 2); + this.ctx.lineTo(this.cellSize / 2, this.cellSize / 2); + this.ctx.stroke(); + } + handleKeyDown(event) { + if (this.gameOver) return; + const direction = _models__WEBPACK_IMPORTED_MODULE_0__.keyboardMap[event.key]; + if (direction) { + this.move(direction); + event.preventDefault(); } - undo(nSteps = 5) { - if (!this.gameOver && this.myPath.length > nSteps) { - this.drawPath(this.myPath, this.cellBackground); - this.myPath.splice(-nSteps); - this.drawPath(this.myPath); - this.currentCell = this.myPath[this.myPath.length - 1]; - } + } + move(direction) { + let nextCell; + if (direction === 'Left') { + if (this.currentCell.col < 1) return; + nextCell = this.maze.cells[this.currentCell.row][this.currentCell.col - 1]; + } + if (direction === 'Right') { + if (this.currentCell.col + 1 >= this.col) return; + nextCell = this.maze.cells[this.currentCell.row][this.currentCell.col + 1]; + } + if (direction === 'Up') { + if (this.currentCell.row < 1) return; + nextCell = this.maze.cells[this.currentCell.row - 1][this.currentCell.col]; + } + if (direction === 'Down') { + if (this.currentCell.row + 1 >= this.row) return; + nextCell = this.maze.cells[this.currentCell.row + 1][this.currentCell.col]; + } + if (this.currentCell.isConnectedTo(nextCell)) { + if (this.myPath.length > 1 && this.myPath[this.myPath.length - 2].equals(nextCell)) { + // this is a step back; reverse the step by erasing the original path + this.drawPath(this.myPath, this.cellBackground); + this.myPath.pop(); + } else { + this.myPath.push(nextCell); + if (nextCell.equals(this.maze.lastCell)) { + this.hooray(); + this.drawSolution(this.myPathColor, this.myPathThickness); + return; + } + } + this.drawPath(this.myPath); + this.currentCell = nextCell; } - drawSolution(color = this.solutionPathColor, lineThickness = this.solutionPathThickness) { - this.gameOver = true; - this.drawPath(this.maze.findPath(), color, lineThickness, true); - } - drawPath(path, color = this.myPathColor, lineThickness = this.myPathThickness, drawSolution = false) { - this.ctx.lineWidth = lineThickness; - this.ctx.strokeStyle = color; - this.ctx.beginPath(); - this.ctx.moveTo(0, this.cellSize / 2); - path.forEach(x => this.ctx.lineTo((x.col + 0.5) * this.cellSize, (x.row + 0.5) * this.cellSize)); - if (drawSolution) { - this.ctx.lineTo(this.col * this.cellSize, (this.row - 0.5) * this.cellSize); - } - this.ctx.stroke(); - } - draw(cell) { - this.ctx.fillRect(cell.col * this.cellSize, cell.row * this.cellSize, (cell.col + 1) * this.cellSize, (cell.row + 1) * this.cellSize); - if (cell.northEdge) { - this.ctx.beginPath(); - this.ctx.moveTo(cell.col * this.cellSize, cell.row * this.cellSize); - this.ctx.lineTo((cell.col + 1) * this.cellSize, cell.row * this.cellSize); - this.ctx.stroke(); - } - if (cell.eastEdge) { - this.ctx.beginPath(); - this.ctx.moveTo((cell.col + 1) * this.cellSize, cell.row * this.cellSize); - this.ctx.lineTo((cell.col + 1) * this.cellSize, (cell.row + 1) * this.cellSize); - this.ctx.stroke(); - } - if (cell.southEdge) { - this.ctx.beginPath(); - this.ctx.moveTo((cell.col + 1) * this.cellSize, (cell.row + 1) * this.cellSize); - this.ctx.lineTo(cell.col * this.cellSize, (cell.row + 1) * this.cellSize); - this.ctx.stroke(); - } - if (cell.westEdge) { - this.ctx.beginPath(); - this.ctx.moveTo(cell.col * this.cellSize, (cell.row + 1) * this.cellSize); - this.ctx.lineTo(cell.col * this.cellSize, cell.row * this.cellSize); - this.ctx.stroke(); - } + } + undo(nSteps = 5) { + if (!this.gameOver && this.myPath.length > nSteps) { + this.drawPath(this.myPath, this.cellBackground); + this.myPath.splice(-nSteps); + this.drawPath(this.myPath); + this.currentCell = this.myPath[this.myPath.length - 1]; } - hooray() { - var audio = new Audio('assets/KidsCheering.mp3'); - audio.play(); + } + drawSolution(color = this.solutionPathColor, lineThickness = this.solutionPathThickness) { + this.gameOver = true; + this.drawPath(this.maze.findPath(), color, lineThickness, true); + } + drawPath(path, color = this.myPathColor, lineThickness = this.myPathThickness, drawSolution = false) { + this.ctx.lineWidth = lineThickness; + this.ctx.strokeStyle = color; + this.ctx.beginPath(); + this.ctx.moveTo(0, this.cellSize / 2); + path.forEach(x => this.ctx.lineTo((x.col + 0.5) * this.cellSize, (x.row + 0.5) * this.cellSize)); + if (drawSolution) { + this.ctx.lineTo(this.col * this.cellSize, (this.row - 0.5) * this.cellSize); + } + this.ctx.stroke(); + } + draw(cell) { + this.ctx.fillRect(cell.col * this.cellSize, cell.row * this.cellSize, (cell.col + 1) * this.cellSize, (cell.row + 1) * this.cellSize); + if (cell.northEdge) { + this.ctx.beginPath(); + this.ctx.moveTo(cell.col * this.cellSize, cell.row * this.cellSize); + this.ctx.lineTo((cell.col + 1) * this.cellSize, cell.row * this.cellSize); + this.ctx.stroke(); + } + if (cell.eastEdge) { + this.ctx.beginPath(); + this.ctx.moveTo((cell.col + 1) * this.cellSize, cell.row * this.cellSize); + this.ctx.lineTo((cell.col + 1) * this.cellSize, (cell.row + 1) * this.cellSize); + this.ctx.stroke(); + } + if (cell.southEdge) { + this.ctx.beginPath(); + this.ctx.moveTo((cell.col + 1) * this.cellSize, (cell.row + 1) * this.cellSize); + this.ctx.lineTo(cell.col * this.cellSize, (cell.row + 1) * this.cellSize); + this.ctx.stroke(); + } + if (cell.westEdge) { + this.ctx.beginPath(); + this.ctx.moveTo(cell.col * this.cellSize, (cell.row + 1) * this.cellSize); + this.ctx.lineTo(cell.col * this.cellSize, cell.row * this.cellSize); + this.ctx.stroke(); } - validateInputs() { - if (isNaN(this.row) || this.row < 1) { - alert('Please enter a positive number for #Rows.'); - this.row = 15; - } - if (isNaN(this.col) || this.col < 1) { - alert('Please enter a positive number for #Columns.'); - this.col = 15; - } - if (this.row > 500 || this.col > 500) { - alert('Size too large. You may crash the browser...'); - this.row = 15; - this.col = 15; - } - this.row = ~~this.row; - this.col = ~~this.col; - } - test() { - this.busy = true; - const cellsHaveFourEdges = []; - let hasLoop = false; - const size = 50; - for (let i = 0; i < 100; i++) { - const maze = new _models__WEBPACK_IMPORTED_MODULE_0__.Maze(size, size); - maze.cells.forEach(row => row.forEach(c => { - if (c.nEdges === 4) { - cellsHaveFourEdges.push(c); - } - if (c.col < size - 1 && c.row < size - 1) { - if (!c.eastEdge && !c.southEdge) { - const cellOnTheRight = maze.cells[c.row][c.col + 1]; - if (!cellOnTheRight.southEdge) { - const cellBelow = maze.cells[c.row + 1][c.col]; - if (!cellBelow.eastEdge) { - hasLoop = true; - } - } - } - } - })); - if (cellsHaveFourEdges.length) { - alert('dead loop'); - break; - } - if (hasLoop) { - alert('open loop'); - break; + } + hooray() { + var audio = new Audio('assets/KidsCheering.mp3'); + audio.play(); + } + validateInputs() { + if (isNaN(this.row) || this.row < 1) { + alert('Please enter a positive number for #Rows.'); + this.row = 15; + } + if (isNaN(this.col) || this.col < 1) { + alert('Please enter a positive number for #Columns.'); + this.col = 15; + } + if (this.row > 500 || this.col > 500) { + alert('Size too large. You may crash the browser...'); + this.row = 15; + this.col = 15; + } + this.row = ~~this.row; + this.col = ~~this.col; + } + test() { + this.busy = true; + const cellsHaveFourEdges = []; + let hasLoop = false; + const size = 50; + for (let i = 0; i < 100; i++) { + const maze = new _models__WEBPACK_IMPORTED_MODULE_0__.Maze(size, size); + maze.cells.forEach(row => row.forEach(c => { + if (c.nEdges === 4) { + cellsHaveFourEdges.push(c); + } + if (c.col < size - 1 && c.row < size - 1) { + if (!c.eastEdge && !c.southEdge) { + const cellOnTheRight = maze.cells[c.row][c.col + 1]; + if (!cellOnTheRight.southEdge) { + const cellBelow = maze.cells[c.row + 1][c.col]; + if (!cellBelow.eastEdge) { + hasLoop = true; + } } - } - console.log(`testing has finished`); - this.busy = false; - } + } + } + })); + if (cellsHaveFourEdges.length) { + alert('dead loop'); + break; + } + if (hasLoop) { + alert('open loop'); + break; + } + } + console.log(`testing has finished`); + this.busy = false; + } } -MazeComponent.ɵfac = function MazeComponent_Factory(t) { return new (t || MazeComponent)(); }; -MazeComponent.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ type: MazeComponent, selectors: [["app-maze"]], hostBindings: function MazeComponent_HostBindings(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("keydown", function MazeComponent_keydown_HostBindingHandler($event) { return ctx.handleKeyDown($event); }, false, _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresolveDocument"]); - } }, decls: 30, vars: 4, consts: [[2, "text-align", "center"], [1, "maze-form"], ["for", "nRow"], ["id", "nRow", "type", "number", "min", "1", "max", "500", 3, "ngModel", "ngModelChange"], ["for", "nCol"], ["id", "nCol", "type", "number", "min", "1", "max", "500", 3, "ngModel", "ngModelChange"], ["type", "button", 3, "disabled", "click"], ["type", "button", 3, "click"], ["type", "button", 3, "disabled", "click", 4, "ngIf"], ["id", "maze"], [1, "arrows"], ["title", "move up", 3, "click"], ["title", "move left", 3, "click"], ["title", "undo 5 steps", 3, "click"], ["title", "move right", 3, "click"], ["title", "move down", 3, "click"]], template: function MazeComponent_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "div", 0)(1, "div", 1)(2, "label", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](3, "# Rows"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](4, "input", 3); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("ngModelChange", function MazeComponent_Template_input_ngModelChange_4_listener($event) { return ctx.row = $event; }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](5, "label", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](6, "# Columns"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](7, "input", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("ngModelChange", function MazeComponent_Template_input_ngModelChange_7_listener($event) { return ctx.col = $event; }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](8, "button", 6); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_button_click_8_listener() { return ctx.drawMaze(); }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](9, " New Maze "); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](10, "button", 7); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_button_click_10_listener() { return ctx.drawSolution(); }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](11, "Solution"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtemplate"](12, MazeComponent_button_12_Template, 2, 1, "button", 8); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](13, "section"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](14, "canvas", 9); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](15, "section")(16, "div", 10)(17, "div")(18, "span", 11); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_span_click_18_listener() { return ctx.move("Up"); }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](19, "\u2B06\uFE0F"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](20, "div")(21, "span", 12); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_span_click_21_listener() { return ctx.move("Left"); }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](22, "\u2B05\uFE0F"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](23, "span", 13); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_span_click_23_listener() { return ctx.undo(); }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](24, "\u23EA"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](25, "span", 14); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_span_click_25_listener() { return ctx.move("Right"); }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](26, "\u27A1\uFE0F"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](27, "div")(28, "span", 15); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_span_click_28_listener() { return ctx.move("Down"); }); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](29, "\u2B07\uFE0F"); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()()()()(); - } if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("ngModel", ctx.row); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](3); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("ngModel", ctx.col); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("disabled", ctx.busy); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](4); - _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("ngIf", ctx.showTestButton); - } }, dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_3__.NgIf, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.DefaultValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NumberValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NgControlStatus, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.MinValidator, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.MaxValidator, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NgModel], styles: [".maze-form[_ngcontent-%COMP%] {\r\n margin: 1rem 0;\r\n}\r\n\r\n.maze-form[_ngcontent-%COMP%] input[_ngcontent-%COMP%] {\r\n max-width: 3rem;\r\n padding: 0.25rem;\r\n margin: 0 0.5rem;\r\n}\r\n\r\n.maze-form[_ngcontent-%COMP%] button[_ngcontent-%COMP%] {\r\n padding: 0.25rem;\r\n margin: 0 0.5rem;\r\n}\r\n\r\n.arrows[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\r\n font-size: xx-large;\r\n -webkit-user-select: none;\r\n user-select: none;\r\n cursor: pointer;\r\n margin: auto 0.25rem;\r\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1hemUuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGNBQWM7QUFDaEI7O0FBRUE7RUFDRSxlQUFlO0VBQ2YsZ0JBQWdCO0VBQ2hCLGdCQUFnQjtBQUNsQjs7QUFFQTtFQUNFLGdCQUFnQjtFQUNoQixnQkFBZ0I7QUFDbEI7O0FBRUE7RUFDRSxtQkFBbUI7RUFDbkIseUJBQWlCO1VBQWpCLGlCQUFpQjtFQUNqQixlQUFlO0VBQ2Ysb0JBQW9CO0FBQ3RCIiwiZmlsZSI6Im1hemUuY29tcG9uZW50LmNzcyIsInNvdXJjZXNDb250ZW50IjpbIi5tYXplLWZvcm0ge1xyXG4gIG1hcmdpbjogMXJlbSAwO1xyXG59XHJcblxyXG4ubWF6ZS1mb3JtIGlucHV0IHtcclxuICBtYXgtd2lkdGg6IDNyZW07XHJcbiAgcGFkZGluZzogMC4yNXJlbTtcclxuICBtYXJnaW46IDAgMC41cmVtO1xyXG59XHJcblxyXG4ubWF6ZS1mb3JtIGJ1dHRvbiB7XHJcbiAgcGFkZGluZzogMC4yNXJlbTtcclxuICBtYXJnaW46IDAgMC41cmVtO1xyXG59XHJcblxyXG4uYXJyb3dzIHNwYW4ge1xyXG4gIGZvbnQtc2l6ZTogeHgtbGFyZ2U7XHJcbiAgdXNlci1zZWxlY3Q6IG5vbmU7XHJcbiAgY3Vyc29yOiBwb2ludGVyO1xyXG4gIG1hcmdpbjogYXV0byAwLjI1cmVtO1xyXG59XHJcbiJdfQ== */"] }); - +MazeComponent.ɵfac = function MazeComponent_Factory(t) { + return new (t || MazeComponent)(); +}; +MazeComponent.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ + type: MazeComponent, + selectors: [["app-maze"]], + hostBindings: function MazeComponent_HostBindings(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("keydown", function MazeComponent_keydown_HostBindingHandler($event) { + return ctx.handleKeyDown($event); + }, false, _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresolveDocument"]); + } + }, + decls: 30, + vars: 4, + consts: [[2, "text-align", "center"], [1, "maze-form"], ["for", "nRow"], ["id", "nRow", "type", "number", "min", "1", "max", "500", 3, "ngModel", "ngModelChange"], ["for", "nCol"], ["id", "nCol", "type", "number", "min", "1", "max", "500", 3, "ngModel", "ngModelChange"], ["type", "button", 3, "disabled", "click"], ["type", "button", 3, "click"], ["type", "button", 3, "disabled", "click", 4, "ngIf"], ["id", "maze"], [1, "arrows"], ["title", "move up", 3, "click"], ["title", "move left", 3, "click"], ["title", "undo 5 steps", 3, "click"], ["title", "move right", 3, "click"], ["title", "move down", 3, "click"]], + template: function MazeComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "div", 0)(1, "div", 1)(2, "label", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](3, "# Rows"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](4, "input", 3); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("ngModelChange", function MazeComponent_Template_input_ngModelChange_4_listener($event) { + return ctx.row = $event; + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](5, "label", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](6, "# Columns"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](7, "input", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("ngModelChange", function MazeComponent_Template_input_ngModelChange_7_listener($event) { + return ctx.col = $event; + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](8, "button", 6); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_button_click_8_listener() { + return ctx.drawMaze(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](9, " New Maze "); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](10, "button", 7); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_button_click_10_listener() { + return ctx.drawSolution(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](11, "Solution"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtemplate"](12, MazeComponent_button_12_Template, 2, 1, "button", 8); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](13, "section"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](14, "canvas", 9); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](15, "section")(16, "div", 10)(17, "div")(18, "span", 11); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_span_click_18_listener() { + return ctx.move("Up"); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](19, "\u2B06\uFE0F"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](20, "div")(21, "span", 12); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_span_click_21_listener() { + return ctx.move("Left"); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](22, "\u2B05\uFE0F"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](23, "span", 13); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_span_click_23_listener() { + return ctx.undo(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](24, "\u23EA"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](25, "span", 14); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_span_click_25_listener() { + return ctx.move("Right"); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](26, "\u27A1\uFE0F"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()(); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](27, "div")(28, "span", 15); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function MazeComponent_Template_span_click_28_listener() { + return ctx.move("Down"); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](29, "\u2B07\uFE0F"); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()()()()(); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](4); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("ngModel", ctx.row); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](3); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("ngModel", ctx.col); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("disabled", ctx.busy); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](4); + _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("ngIf", ctx.showTestButton); + } + }, + dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_3__.NgIf, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.DefaultValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NumberValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NgControlStatus, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.MinValidator, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.MaxValidator, _angular_forms__WEBPACK_IMPORTED_MODULE_4__.NgModel], + styles: [".maze-form[_ngcontent-%COMP%] {\r\n margin: 1rem 0;\r\n}\r\n\r\n.maze-form[_ngcontent-%COMP%] input[_ngcontent-%COMP%] {\r\n max-width: 3rem;\r\n padding: 0.25rem;\r\n margin: 0 0.5rem;\r\n}\r\n\r\n.maze-form[_ngcontent-%COMP%] button[_ngcontent-%COMP%] {\r\n padding: 0.25rem;\r\n margin: 0 0.5rem;\r\n}\r\n\r\n.arrows[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\r\n font-size: xx-large;\r\n -webkit-user-select: none;\r\n user-select: none;\r\n cursor: pointer;\r\n margin: auto 0.25rem;\r\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy9hcHAvbWF6ZS9tYXplLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxjQUFjO0FBQ2hCOztBQUVBO0VBQ0UsZUFBZTtFQUNmLGdCQUFnQjtFQUNoQixnQkFBZ0I7QUFDbEI7O0FBRUE7RUFDRSxnQkFBZ0I7RUFDaEIsZ0JBQWdCO0FBQ2xCOztBQUVBO0VBQ0UsbUJBQW1CO0VBQ25CLHlCQUFpQjtVQUFqQixpQkFBaUI7RUFDakIsZUFBZTtFQUNmLG9CQUFvQjtBQUN0QiIsInNvdXJjZXNDb250ZW50IjpbIi5tYXplLWZvcm0ge1xyXG4gIG1hcmdpbjogMXJlbSAwO1xyXG59XHJcblxyXG4ubWF6ZS1mb3JtIGlucHV0IHtcclxuICBtYXgtd2lkdGg6IDNyZW07XHJcbiAgcGFkZGluZzogMC4yNXJlbTtcclxuICBtYXJnaW46IDAgMC41cmVtO1xyXG59XHJcblxyXG4ubWF6ZS1mb3JtIGJ1dHRvbiB7XHJcbiAgcGFkZGluZzogMC4yNXJlbTtcclxuICBtYXJnaW46IDAgMC41cmVtO1xyXG59XHJcblxyXG4uYXJyb3dzIHNwYW4ge1xyXG4gIGZvbnQtc2l6ZTogeHgtbGFyZ2U7XHJcbiAgdXNlci1zZWxlY3Q6IG5vbmU7XHJcbiAgY3Vyc29yOiBwb2ludGVyO1xyXG4gIG1hcmdpbjogYXV0byAwLjI1cmVtO1xyXG59XHJcbiJdLCJzb3VyY2VSb290IjoiIn0= */"] +}); /***/ }), @@ -1480,106 +1664,95 @@ __webpack_require__.r(__webpack_exports__); * */ class Cell { + /** + * The number of Edges in this cell. + * The nEdges counts all four edges. If an edge is false, then 0. + */ + get nEdges() { + return (this.northEdge ? 1 : 0) + (this.southEdge ? 1 : 0) + (this.westEdge ? 1 : 0) + (this.eastEdge ? 1 : 0); + } + /** + * Create a cell in a maze. + * @param row rowID of the cell in a maze. integer, row>=0 + * @param col colID of the cell in a maze. integer, col>=0 + */ + constructor(row = 0, col = 0) { + this.row = row; + this.col = col; + this.northEdge = true; + this.eastEdge = true; + this.westEdge = true; + this.southEdge = true; + this.neighbors = []; /** - * Create a cell in a maze. - * @param row rowID of the cell in a maze. integer, row>=0 - * @param col colID of the cell in a maze. integer, col>=0 + * a flag used to indicate if the cell has been traversed or not when finding a maze path */ - constructor(row = 0, col = 0) { - this.row = row; - this.col = col; - this.northEdge = true; - this.eastEdge = true; - this.westEdge = true; - this.southEdge = true; - this.neighbors = []; - /** - * a flag used to indicate if the cell has been traversed or not when finding a maze path - */ - this.traversed = false; - /** - * a flag used to indicate if the cell has been visited or not when hunt-and-kill - */ - this.visited = false; - } + this.traversed = false; /** - * The number of Edges in this cell. - * The nEdges counts all four edges. If an edge is false, then 0. + * a flag used to indicate if the cell has been visited or not when hunt-and-kill */ - get nEdges() { - return ((this.northEdge ? 1 : 0) + - (this.southEdge ? 1 : 0) + - (this.westEdge ? 1 : 0) + - (this.eastEdge ? 1 : 0)); - } - connectTo(another) { - if (!another) - return; - if (this.row === another.row) { - if (this.col - 1 === another.col) { - this.westEdge = false; - another.eastEdge = false; - } - else if (this.col + 1 === another.col) { - this.eastEdge = false; - another.westEdge = false; - } - else { - return; - } - } - else if (this.col === another.col) { - if (this.row - 1 === another.row) { - this.northEdge = false; - another.southEdge = false; - } - else if (this.row + 1 === another.row) { - this.southEdge = false; - another.northEdge = false; - } - else { - return; - } + this.visited = false; + } + connectTo(another) { + if (!another) return; + if (this.row === another.row) { + if (this.col - 1 === another.col) { + this.westEdge = false; + another.eastEdge = false; + } else if (this.col + 1 === another.col) { + this.eastEdge = false; + another.westEdge = false; + } else { + return; + } + } else if (this.col === another.col) { + if (this.row - 1 === another.row) { + this.northEdge = false; + another.southEdge = false; + } else if (this.row + 1 === another.row) { + this.southEdge = false; + another.northEdge = false; + } else { + return; + } + } else { + return; + } + this.visited = true; + another.visited = true; + } + equals(another) { + return this.row === another.row && this.col === another.col; + } + isConnectedTo(another) { + if (this.row === another.row) { + if (this.col - 1 === another.col) { + if (this.westEdge === false && another.eastEdge === false) { + return true; } - else { - return; + } + if (this.col + 1 === another.col) { + if (this.eastEdge === false && another.westEdge === false) { + return true; } - this.visited = true; - another.visited = true; - } - equals(another) { - return this.row === another.row && this.col === another.col; - } - isConnectedTo(another) { - if (this.row === another.row) { - if (this.col - 1 === another.col) { - if (this.westEdge === false && another.eastEdge === false) { - return true; - } - } - if (this.col + 1 === another.col) { - if (this.eastEdge === false && another.westEdge === false) { - return true; - } - } + } + } + if (this.col === another.col) { + if (this.row - 1 === another.row) { + if (this.northEdge === false && another.southEdge === false) { + return true; } - if (this.col === another.col) { - if (this.row - 1 === another.row) { - if (this.northEdge === false && another.southEdge === false) { - return true; - } - } - if (this.row + 1 === another.row) { - if (this.southEdge === false && another.northEdge === false) { - return true; - } - } + } + if (this.row + 1 === another.row) { + if (this.southEdge === false && another.northEdge === false) { + return true; } - return false; + } } + return false; + } } - /***/ }), /***/ 4915: @@ -1601,7 +1774,6 @@ __webpack_require__.r(__webpack_exports__); - /***/ }), /***/ 9481: @@ -1615,21 +1787,20 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "keyboardMap": () => (/* binding */ keyboardMap) /* harmony export */ }); const keyboardMap = { - ArrowLeft: 'Left', - A: 'Left', - a: 'Left', - ArrowRight: 'Right', - D: 'Right', - d: 'Right', - ArrowUp: 'Up', - W: 'Up', - w: 'Up', - ArrowDown: 'Down', - S: 'Down', - s: 'Down', + ArrowLeft: 'Left', + A: 'Left', + a: 'Left', + ArrowRight: 'Right', + D: 'Right', + d: 'Right', + ArrowUp: 'Up', + W: 'Up', + w: 'Up', + ArrowDown: 'Down', + S: 'Down', + s: 'Down' }; - /***/ }), /***/ 6999: @@ -1648,129 +1819,125 @@ __webpack_require__.r(__webpack_exports__); * A rectangle maze generated based on "hunt-and-kill" algorithm. */ class Maze { - /** - * Create a maze with × cells. - * @param nRow number of rows - * @param nCol number of columns - */ - constructor(nRow, nCol) { - this.nRow = nRow; - this.nCol = nCol; - this.cells = []; - // initialize cells - for (let i = 0; i < nRow; i++) { - this.cells[i] = []; - for (let j = 0; j < nCol; j++) { - this.cells[i][j] = new _cell__WEBPACK_IMPORTED_MODULE_0__.Cell(i, j); - } - } - // populate cell neighbors (an optimization) - this.cells.forEach(row => row.forEach(c => this.mapNeighbors(c))); - // generate maze - this.randomRowNumbers = Utils.shuffleArray([...Array(this.nRow).keys()]); - this.randomColNumbers = Utils.shuffleArray([...Array(this.nCol).keys()]); - this.huntAndKill(); - } - get firstCell() { - return this.cells[0][0]; - } - get lastCell() { - return this.cells[this.nRow - 1][this.nCol - 1]; + /** + * Create a maze with × cells. + * @param nRow number of rows + * @param nCol number of columns + */ + constructor(nRow, nCol) { + this.nRow = nRow; + this.nCol = nCol; + this.cells = []; + // initialize cells + for (let i = 0; i < nRow; i++) { + this.cells[i] = []; + for (let j = 0; j < nCol; j++) { + this.cells[i][j] = new _cell__WEBPACK_IMPORTED_MODULE_0__.Cell(i, j); + } + } + // populate cell neighbors (an optimization) + this.cells.forEach(row => row.forEach(c => this.mapNeighbors(c))); + // generate maze + this.randomRowNumbers = Utils.shuffleArray([...Array(this.nRow).keys()]); + this.randomColNumbers = Utils.shuffleArray([...Array(this.nCol).keys()]); + this.huntAndKill(); + } + get firstCell() { + return this.cells[0][0]; + } + get lastCell() { + return this.cells[this.nRow - 1][this.nCol - 1]; + } + get randomCell() { + return this.cells[Utils.random(this.nRow)][Utils.random(this.nCol)]; + } + /** + * traverse the maze using depth-first algorithm + */ + findPath() { + this.cells.forEach(x => x.forEach(c => c.traversed = false)); + const path = [this.firstCell]; + while (1) { + let current = path[0]; + current.traversed = true; + if (current.equals(this.lastCell)) { + break; + } + const traversableNeighbors = current.neighbors.filter(c => c.isConnectedTo(current)).filter(c => !c.traversed); + if (traversableNeighbors.length) { + path.unshift(traversableNeighbors[0]); + } else { + path.splice(0, 1); + } + } + return path.reverse(); + } + huntAndKill() { + let current = this.randomCell; // hunt-and-kill starts from a random Cell + while (current) { + this.kill(current); + current = this.hunt(); } - get randomCell() { - return this.cells[Utils.random(this.nRow)][Utils.random(this.nCol)]; + } + kill(current) { + while (current) { + const next = current.neighbors.find(c => !c.visited); + if (next) { + current.connectTo(next); + } + current = next; } - /** - * traverse the maze using depth-first algorithm - */ - findPath() { - this.cells.forEach(x => x.forEach(c => (c.traversed = false))); - const path = [this.firstCell]; - while (1) { - let current = path[0]; - current.traversed = true; - if (current.equals(this.lastCell)) { - break; - } - const traversableNeighbors = current.neighbors - .filter(c => c.isConnectedTo(current)) - .filter(c => !c.traversed); - if (traversableNeighbors.length) { - path.unshift(traversableNeighbors[0]); - } - else { - path.splice(0, 1); - } + } + hunt() { + for (let huntRow of this.randomRowNumbers) { + for (let huntColumn of this.randomColNumbers) { + const cell = this.cells[huntRow][huntColumn]; + if (cell.visited) { + continue; } - return path.reverse(); - } - huntAndKill() { - let current = this.randomCell; // hunt-and-kill starts from a random Cell - while (current) { - this.kill(current); - current = this.hunt(); + const next = cell.neighbors.find(c => c.visited); + if (next) { + cell.connectTo(next); + return cell; } + } } - kill(current) { - while (current) { - const next = current.neighbors.find(c => !c.visited); - if (next) { - current.connectTo(next); - } - current = next; - } + } + mapNeighbors(cell) { + if (cell.row - 1 >= 0) { + cell.neighbors.push(this.cells[cell.row - 1][cell.col]); } - hunt() { - for (let huntRow of this.randomRowNumbers) { - for (let huntColumn of this.randomColNumbers) { - const cell = this.cells[huntRow][huntColumn]; - if (cell.visited) { - continue; - } - const next = cell.neighbors.find(c => c.visited); - if (next) { - cell.connectTo(next); - return cell; - } - } - } + if (cell.row + 1 < this.nRow) { + cell.neighbors.push(this.cells[cell.row + 1][cell.col]); } - mapNeighbors(cell) { - if (cell.row - 1 >= 0) { - cell.neighbors.push(this.cells[cell.row - 1][cell.col]); - } - if (cell.row + 1 < this.nRow) { - cell.neighbors.push(this.cells[cell.row + 1][cell.col]); - } - if (cell.col - 1 >= 0) { - cell.neighbors.push(this.cells[cell.row][cell.col - 1]); - } - if (cell.col + 1 < this.nCol) { - cell.neighbors.push(this.cells[cell.row][cell.col + 1]); - } - cell.neighbors = Utils.shuffleArray(cell.neighbors); + if (cell.col - 1 >= 0) { + cell.neighbors.push(this.cells[cell.row][cell.col - 1]); + } + if (cell.col + 1 < this.nCol) { + cell.neighbors.push(this.cells[cell.row][cell.col + 1]); } + cell.neighbors = Utils.shuffleArray(cell.neighbors); + } } class Utils { - /** - * The de-facto unbiased shuffle algorithm is the Fisher-Yates (aka Knuth) Shuffle. - */ - static shuffleArray(array) { - for (let i = array.length - 1; i > 0; i--) { - const temp = ~~(Math.random() * (i + 1)); - [array[i], array[temp]] = [array[temp], array[i]]; - } - return array; - } - /** - * Generate a random index within a number `n` - */ - static random(n) { - return ~~(Math.random() * n); - } + /** + * The de-facto unbiased shuffle algorithm is the Fisher-Yates (aka Knuth) Shuffle. + */ + static shuffleArray(array) { + for (let i = array.length - 1; i > 0; i--) { + const temp = ~~(Math.random() * (i + 1)); + [array[i], array[temp]] = [array[temp], array[i]]; + } + return array; + } + /** + * Generate a random index within a number `n` + */ + static random(n) { + return ~~(Math.random() * n); + } } - /***/ }), /***/ 1442: @@ -1786,120 +1953,134 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2560); class ImageTilesComponent { - constructor() { - this.tileCountX = 3; - } - ngOnInit() { - this.canvasSize = 540; - } - ngAfterViewInit() { - this.canvas = document.getElementById('canvas'); - this.ctx = this.canvas.getContext('2d'); - this.canvas.style.width = `${this.canvasSize}px`; - this.canvas.style.height = `${this.canvasSize}px`; - this.canvas.width = this.canvas.offsetWidth; - this.canvas.height = this.canvas.offsetHeight; - } - upload(files) { - if (files.length === 0) { - return; - } - const reader = new FileReader(); - reader.readAsDataURL(files[0]); - reader.onload = () => { - const img = new Image(); - img.src = reader.result.toString(); - img.onload = () => { - //start - const tiles = this.getTiles(img); - this.drawTiles(tiles); - }; - }; - } - getTiles(img) { - if (img.width < this.canvasSize || img.height < this.canvasSize) { - throw new Error('Image Size too small.'); - } - const imgData = this.resizeImage(img, this.canvasSize, this.canvasSize); - const imgSize = imgData.width > imgData.height ? imgData.height : imgData.width; - const pixelRows = []; - const data = Array.from(imgData.data); - while (data.length > 0) { - pixelRows.push(data.splice(0, imgData.width * 4)); - } - const tiles = []; - const tileSize = ~~(imgSize / this.tileCountX); - for (let i = 0; i < this.tileCountX * this.tileCountX; i++) { - const x = i % this.tileCountX; - const y = ~~(i / this.tileCountX); - let tileDataRows = []; - for (let row = y * tileSize; row < tileSize * (y + 1); row++) { - tileDataRows = tileDataRows.concat(pixelRows[row].slice(tileSize * x * 4, tileSize * (x + 1) * 4)); - } - tiles.push({ - id: i, - x: i % this.tileCountX, - y: ~~(i / this.tileCountX), - data: new Uint8ClampedArray(tileDataRows) - }); - } - return tiles; - } - drawTiles(tiles) { - const offset = 1; - for (const tile of tiles) { - this.ctx.putImageData(new ImageData(tile.data, this.canvasSize / this.tileCountX, this.canvasSize / this.tileCountX), tile.x * 180 * offset, tile.y * 180 * offset); - } - } - resizeImage(img, width = 1080, height = 1080) { - if (img.height < img.width) { - width = Math.floor(height * (img.width / img.height)); - } - else { - height = Math.floor(width * (img.height / img.width)); - } - let resizingCanvas = (document.createElement('canvas')); - let resizingCanvasContext = resizingCanvas.getContext('2d'); - resizingCanvas.width = img.width; - resizingCanvas.height = img.height; - resizingCanvasContext.drawImage(img, 0, 0, resizingCanvas.width, resizingCanvas.height); - let curImageDimensions = { - width: Math.floor(img.width), - height: Math.floor(img.height) - }; - let halfImageDimensions = { - width: null, - height: null - }; - while (curImageDimensions.width * 0.5 > width) { - // Reduce the resizing canvas by half and refresh the image - halfImageDimensions.width = Math.floor(curImageDimensions.width * 0.5); - halfImageDimensions.height = Math.floor(curImageDimensions.height * 0.5); - resizingCanvasContext.drawImage(resizingCanvas, 0, 0, curImageDimensions.width, curImageDimensions.height, 0, 0, halfImageDimensions.width, halfImageDimensions.height); - curImageDimensions.width = halfImageDimensions.width; - curImageDimensions.height = halfImageDimensions.height; - } - let outputCanvas = (document.createElement('canvas')); - let outputCanvasContext = outputCanvas.getContext('2d'); - outputCanvas.width = width; - outputCanvas.height = height; - outputCanvasContext.drawImage(resizingCanvas, 0, 0, curImageDimensions.width, curImageDimensions.height, 0, 0, width, height); - const imageData = outputCanvasContext.getImageData(0, 0, width, height); - // outputCanvasContext.clearRect(0, 0, outputCanvas.width, outputCanvas.height); - return imageData; + constructor() { + this.tileCountX = 3; + } + ngOnInit() { + this.canvasSize = 540; + } + ngAfterViewInit() { + this.canvas = document.getElementById('canvas'); + this.ctx = this.canvas.getContext('2d'); + this.canvas.style.width = `${this.canvasSize}px`; + this.canvas.style.height = `${this.canvasSize}px`; + this.canvas.width = this.canvas.offsetWidth; + this.canvas.height = this.canvas.offsetHeight; + } + upload(files) { + if (files.length === 0) { + return; + } + const reader = new FileReader(); + reader.readAsDataURL(files[0]); + reader.onload = () => { + const img = new Image(); + img.src = reader.result.toString(); + img.onload = () => { + //start + const tiles = this.getTiles(img); + this.drawTiles(tiles); + }; + }; + } + getTiles(img) { + if (img.width < this.canvasSize || img.height < this.canvasSize) { + throw new Error('Image Size too small.'); + } + const imgData = this.resizeImage(img, this.canvasSize, this.canvasSize); + const imgSize = imgData.width > imgData.height ? imgData.height : imgData.width; + const pixelRows = []; + const data = Array.from(imgData.data); + while (data.length > 0) { + pixelRows.push(data.splice(0, imgData.width * 4)); + } + const tiles = []; + const tileSize = ~~(imgSize / this.tileCountX); + for (let i = 0; i < this.tileCountX * this.tileCountX; i++) { + const x = i % this.tileCountX; + const y = ~~(i / this.tileCountX); + let tileDataRows = []; + for (let row = y * tileSize; row < tileSize * (y + 1); row++) { + tileDataRows = tileDataRows.concat(pixelRows[row].slice(tileSize * x * 4, tileSize * (x + 1) * 4)); + } + tiles.push({ + id: i, + x: i % this.tileCountX, + y: ~~(i / this.tileCountX), + data: new Uint8ClampedArray(tileDataRows) + }); + } + return tiles; + } + drawTiles(tiles) { + const offset = 1; + for (const tile of tiles) { + this.ctx.putImageData(new ImageData(tile.data, this.canvasSize / this.tileCountX, this.canvasSize / this.tileCountX), tile.x * 180 * offset, tile.y * 180 * offset); } + } + resizeImage(img, width = 1080, height = 1080) { + if (img.height < img.width) { + width = Math.floor(height * (img.width / img.height)); + } else { + height = Math.floor(width * (img.height / img.width)); + } + let resizingCanvas = document.createElement('canvas'); + let resizingCanvasContext = resizingCanvas.getContext('2d'); + resizingCanvas.width = img.width; + resizingCanvas.height = img.height; + resizingCanvasContext.drawImage(img, 0, 0, resizingCanvas.width, resizingCanvas.height); + let curImageDimensions = { + width: Math.floor(img.width), + height: Math.floor(img.height) + }; + let halfImageDimensions = { + width: null, + height: null + }; + while (curImageDimensions.width * 0.5 > width) { + // Reduce the resizing canvas by half and refresh the image + halfImageDimensions.width = Math.floor(curImageDimensions.width * 0.5); + halfImageDimensions.height = Math.floor(curImageDimensions.height * 0.5); + resizingCanvasContext.drawImage(resizingCanvas, 0, 0, curImageDimensions.width, curImageDimensions.height, 0, 0, halfImageDimensions.width, halfImageDimensions.height); + curImageDimensions.width = halfImageDimensions.width; + curImageDimensions.height = halfImageDimensions.height; + } + let outputCanvas = document.createElement('canvas'); + let outputCanvasContext = outputCanvas.getContext('2d'); + outputCanvas.width = width; + outputCanvas.height = height; + outputCanvasContext.drawImage(resizingCanvas, 0, 0, curImageDimensions.width, curImageDimensions.height, 0, 0, width, height); + const imageData = outputCanvasContext.getImageData(0, 0, width, height); + // outputCanvasContext.clearRect(0, 0, outputCanvas.width, outputCanvas.height); + return imageData; + } } -ImageTilesComponent.ɵfac = function ImageTilesComponent_Factory(t) { return new (t || ImageTilesComponent)(); }; -ImageTilesComponent.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: ImageTilesComponent, selectors: [["app-image-tiles"]], decls: 4, vars: 0, consts: [["type", "file", 3, "change"], ["file", ""], ["id", "canvas"]], template: function ImageTilesComponent_Template(rf, ctx) { if (rf & 1) { - const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "input", 0, 1); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("change", function ImageTilesComponent_Template_input_change_0_listener() { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r1); const _r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](1); return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx.upload(_r0.files)); }); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "div"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](3, "canvas", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - } }, styles: ["\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJpbWFnZS10aWxlcy5jb21wb25lbnQuY3NzIn0= */"] }); - +ImageTilesComponent.ɵfac = function ImageTilesComponent_Factory(t) { + return new (t || ImageTilesComponent)(); +}; +ImageTilesComponent.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ + type: ImageTilesComponent, + selectors: [["app-image-tiles"]], + decls: 4, + vars: 0, + consts: [["type", "file", 3, "change"], ["file", ""], ["id", "canvas"]], + template: function ImageTilesComponent_Template(rf, ctx) { + if (rf & 1) { + const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "input", 0, 1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("change", function ImageTilesComponent_Template_input_change_0_listener() { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r1); + const _r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](1); + return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx.upload(_r0.files)); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "div"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](3, "canvas", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + } + }, + styles: ["\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZVJvb3QiOiIifQ== */"] +}); /***/ }), @@ -1922,163 +2103,199 @@ __webpack_require__.r(__webpack_exports__); -function ScrambleSquaresComponent_li_8_Template(rf, ctx) { if (rf & 1) { +function ScrambleSquaresComponent_li_8_Template(rf, ctx) { + if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "li"); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); -} if (rf & 2) { + } + if (rf & 2) { const item_r2 = ctx.$implicit; _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](item_r2); -} } -function ScrambleSquaresComponent_div_11_Template(rf, ctx) { if (rf & 1) { + } +} +function ScrambleSquaresComponent_div_11_Template(rf, ctx) { + if (rf & 1) { const _r5 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"](); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("cdkDropListDropped", function ScrambleSquaresComponent_div_11_Template_div_cdkDropListDropped_0_listener($event) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r5); const ctx_r4 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r4.dropListDropped($event)); }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("cdkDropListDropped", function ScrambleSquaresComponent_div_11_Template_div_cdkDropListDropped_0_listener($event) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r5); + const ctx_r4 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r4.dropListDropped($event)); + }); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "div", 6); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("cdkDragMoved", function ScrambleSquaresComponent_div_11_Template_div_cdkDragMoved_1_listener($event) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r5); const ctx_r6 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r6.dragMoved($event)); }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("cdkDragMoved", function ScrambleSquaresComponent_div_11_Template_div_cdkDragMoved_1_listener($event) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r5); + const ctx_r6 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); + return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r6.dragMoved($event)); + }); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](2); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()(); -} if (rf & 2) { + } + if (rf & 2) { const item_r3 = ctx.$implicit; const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("cdkDropListEnterPredicate", ctx_r1.dropListEnterPredicate); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", item_r3, " "); -} } + } +} class ScrambleSquaresComponent { - constructor(viewportRuler) { - this.viewportRuler = viewportRuler; - this.items = [1, 2, 3, 4, 5, 6, 7, 8, 9]; - this.dropListEnterPredicate = (drag, drop) => { - if (drop == this.placeholder) - return true; - if (drop != this.activeContainer) - return false; - let phElement = this.placeholder.element.nativeElement; - let sourceElement = drag.dropContainer.element.nativeElement; - let dropElement = drop.element.nativeElement; - let dragIndex = __indexOf(dropElement.parentElement.children, this.source ? phElement : sourceElement); - let dropIndex = __indexOf(dropElement.parentElement.children, dropElement); - if (!this.source) { - this.sourceIndex = dragIndex; - this.source = drag.dropContainer; - phElement.style.width = sourceElement.clientWidth + 'px'; - phElement.style.height = sourceElement.clientHeight + 'px'; - sourceElement.parentElement.removeChild(sourceElement); - } - this.targetIndex = dropIndex; - this.target = drop; - phElement.style.display = ''; - dropElement.parentElement.insertBefore(phElement, dropIndex > dragIndex ? dropElement.nextSibling : dropElement); - // this.placeholder.enter( - // drag, - // drag.element.nativeElement.offsetLeft, - // drag.element.nativeElement.offsetTop - // ); - return false; - }; - this.target = null; - this.source = null; - } - ngOnInit() { } - ngAfterViewInit() { - let phElement = this.placeholder.element.nativeElement; - phElement.style.display = 'none'; - phElement.parentElement.removeChild(phElement); - } - add() { - this.items.push(this.items.length + 1); - } - shuffle() { - this.items.sort(() => 0.5 - Math.random()); - } - dragMoved(e) { - let point = this.getPointerPositionOnPage(e.event); - this.listGroup._items.forEach(dropList => { - if (__isInsideDropListClientRect(dropList, point.x, point.y)) { - this.activeContainer = dropList; - return; - } - }); - } - dropListDropped(event) { - if (!this.target) - return; - let phElement = this.placeholder.element.nativeElement; - let parent = phElement.parentElement; - phElement.style.display = 'none'; - parent.removeChild(phElement); - parent.appendChild(phElement); - parent.insertBefore(this.source.element.nativeElement, parent.children[this.sourceIndex]); - this.target = null; - this.source = null; - if (this.sourceIndex != this.targetIndex) - (0,_angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_1__.moveItemInArray)(this.items, this.sourceIndex, this.targetIndex); - } - /** Determines the point of the page that was touched by the user. */ - getPointerPositionOnPage(event) { - // `touches` will be empty for start/end events so we have to fall back to `changedTouches`. - const point = __isTouchEvent(event) - ? event.touches[0] || event.changedTouches[0] - : event; - const scrollPosition = this.viewportRuler.getViewportScrollPosition(); - return { - x: point.pageX - scrollPosition.left, - y: point.pageY - scrollPosition.top - }; - } + constructor(viewportRuler) { + this.viewportRuler = viewportRuler; + this.items = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + this.dropListEnterPredicate = (drag, drop) => { + if (drop == this.placeholder) return true; + if (drop != this.activeContainer) return false; + let phElement = this.placeholder.element.nativeElement; + let sourceElement = drag.dropContainer.element.nativeElement; + let dropElement = drop.element.nativeElement; + let dragIndex = __indexOf(dropElement.parentElement.children, this.source ? phElement : sourceElement); + let dropIndex = __indexOf(dropElement.parentElement.children, dropElement); + if (!this.source) { + this.sourceIndex = dragIndex; + this.source = drag.dropContainer; + phElement.style.width = sourceElement.clientWidth + 'px'; + phElement.style.height = sourceElement.clientHeight + 'px'; + sourceElement.parentElement.removeChild(sourceElement); + } + this.targetIndex = dropIndex; + this.target = drop; + phElement.style.display = ''; + dropElement.parentElement.insertBefore(phElement, dropIndex > dragIndex ? dropElement.nextSibling : dropElement); + // this.placeholder.enter( + // drag, + // drag.element.nativeElement.offsetLeft, + // drag.element.nativeElement.offsetTop + // ); + return false; + }; + this.target = null; + this.source = null; + } + ngOnInit() {} + ngAfterViewInit() { + let phElement = this.placeholder.element.nativeElement; + phElement.style.display = 'none'; + phElement.parentElement.removeChild(phElement); + } + add() { + this.items.push(this.items.length + 1); + } + shuffle() { + this.items.sort(() => 0.5 - Math.random()); + } + dragMoved(e) { + let point = this.getPointerPositionOnPage(e.event); + this.listGroup._items.forEach(dropList => { + if (__isInsideDropListClientRect(dropList, point.x, point.y)) { + this.activeContainer = dropList; + return; + } + }); + } + dropListDropped(event) { + if (!this.target) return; + let phElement = this.placeholder.element.nativeElement; + let parent = phElement.parentElement; + phElement.style.display = 'none'; + parent.removeChild(phElement); + parent.appendChild(phElement); + parent.insertBefore(this.source.element.nativeElement, parent.children[this.sourceIndex]); + this.target = null; + this.source = null; + if (this.sourceIndex != this.targetIndex) (0,_angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_1__.moveItemInArray)(this.items, this.sourceIndex, this.targetIndex); + } + /** Determines the point of the page that was touched by the user. */ + getPointerPositionOnPage(event) { + // `touches` will be empty for start/end events so we have to fall back to `changedTouches`. + const point = __isTouchEvent(event) ? event.touches[0] || event.changedTouches[0] : event; + const scrollPosition = this.viewportRuler.getViewportScrollPosition(); + return { + x: point.pageX - scrollPosition.left, + y: point.pageY - scrollPosition.top + }; + } } -ScrambleSquaresComponent.ɵfac = function ScrambleSquaresComponent_Factory(t) { return new (t || ScrambleSquaresComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_2__.ViewportRuler)); }; -ScrambleSquaresComponent.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: ScrambleSquaresComponent, selectors: [["app-scramble-squares"]], viewQuery: function ScrambleSquaresComponent_Query(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_1__.CdkDropListGroup, 5); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_1__.CdkDropList, 5); - } if (rf & 2) { - let _t; - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.listGroup = _t.first); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.placeholder = _t.first); - } }, decls: 12, vars: 3, consts: [[3, "click"], [1, "example-list"], [4, "ngFor", "ngForOf"], ["cdkDropListGroup", "", 1, "example-container"], ["cdkDropList", "", 3, "cdkDropListEnterPredicate", "cdkDropListDropped"], ["cdkDropList", "", 3, "cdkDropListEnterPredicate", "cdkDropListDropped", 4, "ngFor", "ngForOf"], ["cdkDrag", "", 1, "example-box", 3, "cdkDragMoved"]], template: function ScrambleSquaresComponent_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "h1"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1, "Drag&Drop with a flex-wrap"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "button", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function ScrambleSquaresComponent_Template_button_click_2_listener() { return ctx.add(); }); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](3, "Add"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](4, "button", 0); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function ScrambleSquaresComponent_Template_button_click_4_listener() { return ctx.shuffle(); }); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](5, "Shuffle"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](6, "br"); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](7, "ul", 1); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](8, ScrambleSquaresComponent_li_8_Template, 2, 1, "li", 2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](9, "div", 3)(10, "div", 4); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("cdkDropListDropped", function ScrambleSquaresComponent_Template_div_cdkDropListDropped_10_listener($event) { return ctx.dropListDropped($event); }); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](11, ScrambleSquaresComponent_div_11_Template, 3, 2, "div", 5); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); - } if (rf & 2) { - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](8); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.items); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("cdkDropListEnterPredicate", ctx.dropListEnterPredicate); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1); - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.items); - } }, dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_3__.NgForOf, _angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_1__.CdkDropList, _angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_1__.CdkDropListGroup, _angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_1__.CdkDrag], styles: [".example-list[_ngcontent-%COMP%] {\r\n list-style-type: none;\r\n padding: 0;\r\n}\r\n\r\n.example-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%] {\r\n display: table-cell;\r\n padding: 4px;\r\n}\r\n\r\n.example-container[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-wrap: wrap;\r\n min-width: 600px;\r\n max-width: 900px;\r\n}\r\n\r\n.example-box[_ngcontent-%COMP%] {\r\n width: 200px;\r\n height: 200px;\r\n border: solid 1px #ccc;\r\n font-size: 30pt;\r\n font-weight: bold;\r\n color: rgba(0, 0, 0, 0.87);\r\n cursor: move;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n text-align: center;\r\n background: #fff;\r\n border-radius: 4px;\r\n position: relative;\r\n z-index: 1;\r\n \r\n box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14),\r\n 0 1px 5px 0 rgba(0, 0, 0, 0.12);\r\n}\r\n\r\n.example-box[_ngcontent-%COMP%]:active {\r\n box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),\r\n 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);\r\n opacity: 0.6;\r\n}\r\n\r\n.cdk-drop-list[_ngcontent-%COMP%] {\r\n display: flex;\r\n \r\n}\r\n\r\n.cdk-drag-preview[_ngcontent-%COMP%] {\r\n box-sizing: border-box;\r\n border-radius: 4px;\r\n box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),\r\n 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);\r\n}\r\n\r\n.cdk-drag-placeholder[_ngcontent-%COMP%] {\r\n opacity: 0.3;\r\n}\r\n\r\n.cdk-drag-animating[_ngcontent-%COMP%] {\r\n transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);\r\n}\r\n\r\nbutton[_ngcontent-%COMP%] {\r\n margin-right: 4px;\r\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmFtYmxlLXNxdWFyZXMuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLHFCQUFxQjtFQUNyQixVQUFVO0FBQ1o7O0FBRUE7RUFDRSxtQkFBbUI7RUFDbkIsWUFBWTtBQUNkOztBQUVBO0VBQ0UsYUFBYTtFQUNiLGVBQWU7RUFDZixnQkFBZ0I7RUFDaEIsZ0JBQWdCO0FBQ2xCOztBQUVBO0VBQ0UsWUFBWTtFQUNaLGFBQWE7RUFDYixzQkFBc0I7RUFDdEIsZUFBZTtFQUNmLGlCQUFpQjtFQUNqQiwwQkFBMEI7RUFDMUIsWUFBWTtFQUNaLGFBQWE7RUFDYix1QkFBdUI7RUFDdkIsbUJBQW1CO0VBQ25CLGtCQUFrQjtFQUNsQixnQkFBZ0I7RUFDaEIsa0JBQWtCO0VBQ2xCLGtCQUFrQjtFQUNsQixVQUFVO0VBQ1YsNkRBQTZEO0VBQzdEO21DQUNpQztBQUNuQzs7QUFFQTtFQUNFOzBFQUN3RTtFQUN4RSxZQUFZO0FBQ2Q7O0FBRUE7RUFDRSxhQUFhO0VBQ2I7eUJBQ3VCO0FBQ3pCOztBQUVBO0VBQ0Usc0JBQXNCO0VBQ3RCLGtCQUFrQjtFQUNsQjswRUFDd0U7QUFDMUU7O0FBRUE7RUFDRSxZQUFZO0FBQ2Q7O0FBRUE7RUFDRSxzREFBc0Q7QUFDeEQ7O0FBRUE7RUFDRSxpQkFBaUI7QUFDbkIiLCJmaWxlIjoic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diYSgwLCAwLCAwLCAwLjE0KSxcclxuICAgIDAgMXB4IDVweCAwIHJnYmEoMCwgMCwgMCwgMC4xMik7XHJcbn1cclxuXHJcbi5leGFtcGxlLWJveDphY3RpdmUge1xyXG4gIGJveC1zaGFkb3c6IDAgNXB4IDVweCAtM3B4IHJnYmEoMCwgMCwgMCwgMC4yKSxcclxuICAgIDAgOHB4IDEwcHggMXB4IHJnYmEoMCwgMCwgMCwgMC4xNCksIDAgM3B4IDE0cHggMnB4IHJnYmEoMCwgMCwgMCwgMC4xMik7XHJcbiAgb3BhY2l0eTogMC42O1xyXG59XHJcblxyXG4uY2RrLWRyb3AtbGlzdCB7XHJcbiAgZGlzcGxheTogZmxleDtcclxuICAvKiBwYWRkaW5nLXJpZ2h0OiAxMHB4O1xyXG4gIHBhZGRpbmctYm90dG9tOiAxMHB4OyAqL1xyXG59XHJcblxyXG4uY2RrLWRyYWctcHJldmlldyB7XHJcbiAgYm94LXNpemluZzogYm9yZGVyLWJveDtcclxuICBib3JkZXItcmFkaXVzOiA0cHg7XHJcbiAgYm94LXNoYWRvdzogMCA1cHggNXB4IC0zcHggcmdiYSgwLCAwLCAwLCAwLjIpLFxyXG4gICAgMCA4cHggMTBweCAxcHggcmdiYSgwLCAwLCAwLCAwLjE0KSwgMCAzcHggMTRweCAycHggcmdiYSgwLCAwLCAwLCAwLjEyKTtcclxufVxyXG5cclxuLmNkay1kcmFnLXBsYWNlaG9sZGVyIHtcclxuICBvcGFjaXR5OiAwLjM7XHJcbn1cclxuXHJcbi5jZGstZHJhZy1hbmltYXRpbmcge1xyXG4gIHRyYW5zaXRpb246IHRyYW5zZm9ybSAyNTBtcyBjdWJpYy1iZXppZXIoMCwgMCwgMC4yLCAxKTtcclxufVxyXG5cclxuYnV0dG9uIHtcclxuICBtYXJnaW4tcmlnaHQ6IDRweDtcclxufVxyXG4iXX0= */"] }); +ScrambleSquaresComponent.ɵfac = function ScrambleSquaresComponent_Factory(t) { + return new (t || ScrambleSquaresComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_2__.ViewportRuler)); +}; +ScrambleSquaresComponent.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ + type: ScrambleSquaresComponent, + selectors: [["app-scramble-squares"]], + viewQuery: function ScrambleSquaresComponent_Query(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_1__.CdkDropListGroup, 5); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_1__.CdkDropList, 5); + } + if (rf & 2) { + let _t; + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.listGroup = _t.first); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.placeholder = _t.first); + } + }, + decls: 12, + vars: 3, + consts: [[3, "click"], [1, "example-list"], [4, "ngFor", "ngForOf"], ["cdkDropListGroup", "", 1, "example-container"], ["cdkDropList", "", 3, "cdkDropListEnterPredicate", "cdkDropListDropped"], ["cdkDropList", "", 3, "cdkDropListEnterPredicate", "cdkDropListDropped", 4, "ngFor", "ngForOf"], ["cdkDrag", "", 1, "example-box", 3, "cdkDragMoved"]], + template: function ScrambleSquaresComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "h1"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1, "Drag&Drop with a flex-wrap"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "button", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function ScrambleSquaresComponent_Template_button_click_2_listener() { + return ctx.add(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](3, "Add"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](4, "button", 0); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function ScrambleSquaresComponent_Template_button_click_4_listener() { + return ctx.shuffle(); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](5, "Shuffle"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](6, "br"); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](7, "ul", 1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](8, ScrambleSquaresComponent_li_8_Template, 2, 1, "li", 2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](9, "div", 3)(10, "div", 4); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("cdkDropListDropped", function ScrambleSquaresComponent_Template_div_cdkDropListDropped_10_listener($event) { + return ctx.dropListDropped($event); + }); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](11, ScrambleSquaresComponent_div_11_Template, 3, 2, "div", 5); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); + } + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](8); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.items); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("cdkDropListEnterPredicate", ctx.dropListEnterPredicate); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1); + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.items); + } + }, + dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_3__.NgForOf, _angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_1__.CdkDropList, _angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_1__.CdkDropListGroup, _angular_cdk_drag_drop__WEBPACK_IMPORTED_MODULE_1__.CdkDrag], + styles: [".example-list[_ngcontent-%COMP%] {\r\n list-style-type: none;\r\n padding: 0;\r\n}\r\n\r\n.example-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%] {\r\n display: table-cell;\r\n padding: 4px;\r\n}\r\n\r\n.example-container[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-wrap: wrap;\r\n min-width: 600px;\r\n max-width: 900px;\r\n}\r\n\r\n.example-box[_ngcontent-%COMP%] {\r\n width: 200px;\r\n height: 200px;\r\n border: solid 1px #ccc;\r\n font-size: 30pt;\r\n font-weight: bold;\r\n color: rgba(0, 0, 0, 0.87);\r\n cursor: move;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n text-align: center;\r\n background: #fff;\r\n border-radius: 4px;\r\n position: relative;\r\n z-index: 1;\r\n \r\n box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14),\r\n 0 1px 5px 0 rgba(0, 0, 0, 0.12);\r\n}\r\n\r\n.example-box[_ngcontent-%COMP%]:active {\r\n box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),\r\n 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);\r\n opacity: 0.6;\r\n}\r\n\r\n.cdk-drop-list[_ngcontent-%COMP%] {\r\n display: flex;\r\n \r\n}\r\n\r\n.cdk-drag-preview[_ngcontent-%COMP%] {\r\n box-sizing: border-box;\r\n border-radius: 4px;\r\n box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),\r\n 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);\r\n}\r\n\r\n.cdk-drag-placeholder[_ngcontent-%COMP%] {\r\n opacity: 0.3;\r\n}\r\n\r\n.cdk-drag-animating[_ngcontent-%COMP%] {\r\n transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);\r\n}\r\n\r\nbutton[_ngcontent-%COMP%] {\r\n margin-right: 4px;\r\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy9hcHAvc3F1YXJlcy9zY3JhbWJsZS1zcXVhcmVzL3NjcmFtYmxlLXNxdWFyZXMuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLHFCQUFxQjtFQUNyQixVQUFVO0FBQ1o7O0FBRUE7RUFDRSxtQkFBbUI7RUFDbkIsWUFBWTtBQUNkOztBQUVBO0VBQ0UsYUFBYTtFQUNiLGVBQWU7RUFDZixnQkFBZ0I7RUFDaEIsZ0JBQWdCO0FBQ2xCOztBQUVBO0VBQ0UsWUFBWTtFQUNaLGFBQWE7RUFDYixzQkFBc0I7RUFDdEIsZUFBZTtFQUNmLGlCQUFpQjtFQUNqQiwwQkFBMEI7RUFDMUIsWUFBWTtFQUNaLGFBQWE7RUFDYix1QkFBdUI7RUFDdkIsbUJBQW1CO0VBQ25CLGtCQUFrQjtFQUNsQixnQkFBZ0I7RUFDaEIs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cblxyXG4uY2RrLWRyYWctcGxhY2Vob2xkZXIge1xyXG4gIG9wYWNpdHk6IDAuMztcclxufVxyXG5cclxuLmNkay1kcmFnLWFuaW1hdGluZyB7XHJcbiAgdHJhbnNpdGlvbjogdHJhbnNmb3JtIDI1MG1zIGN1YmljLWJlemllcigwLCAwLCAwLjIsIDEpO1xyXG59XHJcblxyXG5idXR0b24ge1xyXG4gIG1hcmdpbi1yaWdodDogNHB4O1xyXG59XHJcbiJdLCJzb3VyY2VSb290IjoiIn0= */"] +}); function __indexOf(collection, node) { - return Array.prototype.indexOf.call(collection, node); + return Array.prototype.indexOf.call(collection, node); } /** Determines whether an event is a touch event. */ function __isTouchEvent(event) { - return event.type.startsWith('touch'); + return event.type.startsWith('touch'); } function __isInsideDropListClientRect(dropList, x, y) { - const { top, bottom, left, right } = dropList.element.nativeElement.getBoundingClientRect(); - return y >= top && y <= bottom && x >= left && x <= right; + const { + top, + bottom, + left, + right + } = dropList.element.nativeElement.getBoundingClientRect(); + return y >= top && y <= bottom && x >= left && x <= right; } - /***/ }), /***/ 2457: @@ -2096,15 +2313,25 @@ __webpack_require__.r(__webpack_exports__); class SquaresComponent { - constructor() { } - ngOnInit() { - } + constructor() {} + ngOnInit() {} } -SquaresComponent.ɵfac = function SquaresComponent_Factory(t) { return new (t || SquaresComponent)(); }; -SquaresComponent.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ type: SquaresComponent, selectors: [["app-squares"]], decls: 1, vars: 0, template: function SquaresComponent_Template(rf, ctx) { if (rf & 1) { - _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](0, "app-image-tiles"); - } }, dependencies: [_image_tiles_image_tiles_component__WEBPACK_IMPORTED_MODULE_0__.ImageTilesComponent], styles: ["\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcXVhcmVzLmNvbXBvbmVudC5jc3MifQ== */"] }); - +SquaresComponent.ɵfac = function SquaresComponent_Factory(t) { + return new (t || SquaresComponent)(); +}; +SquaresComponent.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ + type: SquaresComponent, + selectors: [["app-squares"]], + decls: 1, + vars: 0, + template: function SquaresComponent_Template(rf, ctx) { + if (rf & 1) { + _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](0, "app-image-tiles"); + } + }, + dependencies: [_image_tiles_image_tiles_component__WEBPACK_IMPORTED_MODULE_0__.ImageTilesComponent], + styles: ["\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZVJvb3QiOiIifQ== */"] +}); /***/ }), @@ -2122,7 +2349,7 @@ __webpack_require__.r(__webpack_exports__); // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. // The list of file replacements can be found in `angular.json`. const environment = { - production: false + production: false }; /* * For easier debugging in development mode, you can import the following file @@ -2133,7 +2360,6 @@ const environment = { */ // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. - /***/ }), /***/ 4431: @@ -2152,11 +2378,9 @@ __webpack_require__.r(__webpack_exports__); if (_environments_environment__WEBPACK_IMPORTED_MODULE_1__.environment.production) { - (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.enableProdMode)(); + (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.enableProdMode)(); } -_angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__.platformBrowser().bootstrapModule(_app_app_module__WEBPACK_IMPORTED_MODULE_0__.AppModule) - .catch(err => console.error(err)); - +_angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__.platformBrowser().bootstrapModule(_app_app_module__WEBPACK_IMPORTED_MODULE_0__.AppModule).catch(err => console.error(err)); /***/ }) diff --git a/docs/main.js.map b/docs/main.js.map index 4391450..b5bfe57 100644 --- a/docs/main.js.map +++ b/docs/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","mappings":";;;;;;;;;;;;;;;;;AAOO,MAAM,YAAY;;wEAAZ,YAAY;0GAAZ,YAAY;QCPzB,yEAAwD;QAEpD,wEACF;QAAA,4DAAI;QAEN,yEAAgC;QACiB,sEAAW;QAAA,4DAAI;QAC9D,oEAAsD;QACtD,uEAAgD;QAAA,qEAAU;QAAA,4DAAI;QAC9D,oEAAsD;QACtD,wEAAgD;QAAA,gEAAI;QAAA,4DAAI;QACxD,qEAAsD;QACtD,wEAAgD;QAAA,qEAAS;QAAA,4DAAI;QAC7D,qEAAsD;QACtD,wEAAgD;QAAA,wEAAY;QAAA,4DAAI;QAChE,qEAAsD;QACtD,wEAAmD;QAAA,oEAAQ;QAAA,4DAAI;QAC/D,qEAAsD;QACtD,yEAAiD;QAAA,mEAAO;QAAA,4DAAI;QAE9D,2EAA4B;QAC1B,4EAA+B;QACjC,4DAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtBoD;AAEb;AACW;AACT;AAEA;AACO;AACG;AACS;AAC+B;AAClC;AACmB;AACzB;AACoB;AAC2B;AAC/C;AACT;AACS;;;AAoClD,MAAM,SAAS;;kEAAT,SAAS;uGAAT,SAAS,cAFR,wDAAY;2GAhBtB,qEAAa;QACb,wDAAW;QACX,mEAAc;QACd,0DAAU;QACV,kEAAoB,CAAC;YACnB,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE;YACnD,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,+DAAa,EAAE;YAC1C,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kEAAc,EAAE;YAC5C,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kEAAc,EAAE;YAC5C,EAAE,IAAI,EAAE,OAAO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AAC;AACxD,CAAC;AAED,oDAAoD;AACpD,SAAS,cAAc,CAAC,KAA8B;IACpD,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,4BAA4B,CACnC,QAAqB,EACrB,CAAS,EACT,CAAS;IAET,MAAM,EACJ,GAAG,EACH,MAAM,EACN,IAAI,EACJ,KAAK,EACN,GAAG,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;IAC3D,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC;AAC5D,CAAC;;;;;;;;;;;;;;;;;;;AE7JM,MAAM,gBAAgB;IAE3B,gBAAgB,CAAC;IAEjB,QAAQ;IACR,CAAC;;gFALU,gBAAgB;8GAAhB,gBAAgB;QCP7B,6EAAmC;;;;;;;;;;;;;;;;ACAnC,gFAAgF;AAChF,0EAA0E;AAC1E,gEAAgE;AAEzD,MAAM,WAAW,GAAG;IACzB,UAAU,EAAE,KAAK;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,sEAAsE;;;;;;;;;;;;;;;;;ACfvB;AAGF;AACY;AAEzD,IAAI,6EAAsB,EAAE;IAC1B,6DAAc,EAAE,CAAC;CAClB;AAED,wEAAwB,CAAC,eAAe,CAAC,sDAAS,CAAC;KAChD,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC","sources":["./src/app/app.component.ts","./src/app/app.component.html","./src/app/app.module.ts","./src/app/candy/candy.component.ts","./src/app/candy/candy.component.html","./src/app/candy/canvas/canvas.component.ts","./src/app/candy/canvas/canvas.component.html","./src/app/candy/models/candy-text.ts","./src/app/candy/models/index.ts","./src/app/candy/models/particle.ts","./src/app/candy/models/position.ts","./src/app/eight-puzzle/eight-puzzle-tile/eight-puzzle-tile.component.ts","./src/app/eight-puzzle/eight-puzzle-tile/eight-puzzle-tile.component.html","./src/app/eight-puzzle/eight-puzzle.component.ts","./src/app/eight-puzzle/eight-puzzle.component.html","./src/app/eight-puzzle/services/eight-puzzle.services.ts","./src/app/math1/math1.component.ts","./src/app/math1/math1.component.html","./src/app/math2/math2.component.ts","./src/app/math2/math2.component.html","./src/app/math3/math3.component.ts","./src/app/math3/math3.component.html","./src/app/math/math.directive.ts","./src/app/math/math.module.ts","./src/app/math/math.service.ts","./src/app/maze/maze.component.ts","./src/app/maze/maze.component.html","./src/app/maze/models/cell.ts","./src/app/maze/models/index.ts","./src/app/maze/models/keyboard-map.ts","./src/app/maze/models/maze.ts","./src/app/squares/image-tiles/image-tiles.component.ts","./src/app/squares/image-tiles/image-tiles.component.html","./src/app/squares/scramble-squares/scramble-squares.component.ts","./src/app/squares/scramble-squares/scramble-squares.component.html","./src/app/squares/squares.component.ts","./src/app/squares/squares.component.html","./src/environments/environment.ts","./src/main.ts"],"sourcesContent":["import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-root',\r\n templateUrl: './app.component.html',\r\n styleUrls: ['./app.component.css']\r\n})\r\nexport class AppComponent {}\r\n","
\r\n \r\n GitHub Repo\r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n","import { BrowserModule } from '@angular/platform-browser';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { DragDropModule } from '@angular/cdk/drag-drop';\r\nimport { RouterModule } from '@angular/router';\r\n\r\nimport { AppComponent } from './app.component';\r\nimport { MazeComponent } from './maze/maze.component';\r\nimport { CandyComponent } from './candy/candy.component';\r\nimport { CanvasComponent } from './candy/canvas/canvas.component';\r\nimport { ScrambleSquaresComponent } from './squares/scramble-squares/scramble-squares.component';\r\nimport { SquaresComponent } from './squares/squares.component';\r\nimport { ImageTilesComponent } from './squares/image-tiles/image-tiles.component';\r\nimport { Math1Component } from './math1/math1.component';\r\nimport { EightPuzzleComponent } from './eight-puzzle/eight-puzzle.component';\r\nimport { EightPuzzleTileComponent } from './eight-puzzle/eight-puzzle-tile/eight-puzzle-tile.component';\r\nimport { Math2Component } from './math2/math2.component';\r\nimport { MathModule } from './math/math.module';\r\nimport { Math3Component } from './math3/math3.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n AppComponent,\r\n MazeComponent,\r\n CandyComponent,\r\n CanvasComponent,\r\n ScrambleSquaresComponent,\r\n SquaresComponent,\r\n ImageTilesComponent,\r\n Math1Component,\r\n EightPuzzleComponent,\r\n EightPuzzleTileComponent,\r\n Math2Component,\r\n Math3Component,\r\n ],\r\n imports: [\r\n BrowserModule,\r\n FormsModule,\r\n DragDropModule,\r\n MathModule,\r\n RouterModule.forRoot([\r\n { path: '', redirectTo: 'maze', pathMatch: 'full' },\r\n { path: 'maze', component: MazeComponent },\r\n { path: 'candy', component: CandyComponent },\r\n { path: 'math1', component: Math1Component },\r\n { path: 'math2', component: Math2Component },\r\n { path: 'math3', component: Math3Component },\r\n { path: '8-puzzle', component: EightPuzzleComponent },\r\n { path: 'square', component: SquaresComponent },\r\n { path: '**', redirectTo: '' },\r\n ]),\r\n ],\r\n bootstrap: [AppComponent],\r\n})\r\nexport class AppModule {}\r\n","import { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { CanvasComponent } from './canvas/canvas.component';\r\n\r\n@Component({\r\n selector: 'app-candy',\r\n templateUrl: './candy.component.html',\r\n styleUrls: ['./candy.component.css']\r\n})\r\nexport class CandyComponent implements OnInit {\r\n name = 'Candy';\r\n @ViewChild(CanvasComponent) c: CanvasComponent;\r\n constructor() {}\r\n\r\n ngOnInit(): void {}\r\n\r\n draw() {\r\n this.c.draw(this.name);\r\n }\r\n}\r\n","
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n","import {\r\n Component,\r\n OnInit,\r\n AfterViewInit,\r\n HostListener,\r\n ChangeDetectionStrategy\r\n} from '@angular/core';\r\nimport { Position, Particle, CandyText } from '../models';\r\n\r\n@Component({\r\n selector: 'app-canvas',\r\n templateUrl: './canvas.component.html',\r\n styleUrls: ['./canvas.component.css'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class CanvasComponent implements OnInit, AfterViewInit {\r\n private canvas: HTMLCanvasElement;\r\n private ctx: CanvasRenderingContext2D;\r\n private candy: CandyText;\r\n private particles: Particle[] = [];\r\n private mousePosition = new Position(-100, -100);\r\n private raf: number;\r\n private continueAnimating = true;\r\n constructor() {}\r\n\r\n ngOnInit(): void {}\r\n\r\n ngAfterViewInit(): void {\r\n this.canvas = document.getElementById('candy-text');\r\n this.ctx = this.canvas.getContext('2d');\r\n this.canvas.style.width = '100%';\r\n this.canvas.style.height = '100%';\r\n this.canvas.width = this.canvas.offsetWidth;\r\n this.canvas.height = this.canvas.offsetHeight;\r\n this.candy = new CandyText(this.canvas);\r\n this.draw('Candy');\r\n }\r\n\r\n draw(name: string) {\r\n this.particles.length = 0;\r\n this.particles = this.candy.getParticles(name);\r\n this.drawBackground();\r\n this.particles.forEach(p => {\r\n p.draw(this.ctx);\r\n });\r\n }\r\n\r\n @HostListener('mousemove', ['$event'])\r\n calculateMouseRelativePositionInCanvas(e: MouseEvent) {\r\n // Note: I have handled scroll effect\r\n this.mousePosition.x =\r\n e.clientX +\r\n (document.documentElement.scrollLeft || document.body.scrollLeft) -\r\n this.canvas.offsetLeft;\r\n this.mousePosition.y =\r\n e.clientY +\r\n (document.documentElement.scrollTop || document.body.scrollTop) -\r\n this.canvas.offsetTop;\r\n }\r\n\r\n @HostListener('mouseenter', ['$event'])\r\n startAnimation(e: MouseEvent) {\r\n this.raf = window.requestAnimationFrame(() => this.animate());\r\n this.continueAnimating = true;\r\n }\r\n\r\n // @HostListener('mouseout', ['$event'])\r\n // stopAnimation(e: MouseEvent) {\r\n // window.cancelAnimationFrame(this.raf);\r\n // this.continueAnimating = false; // stop animation when mouse out.\r\n // }\r\n\r\n animate() {\r\n if (!this.particles.length || !this.continueAnimating) {\r\n return; // return when nothing needs to animate\r\n }\r\n\r\n this.drawBackground();\r\n // clean particles are not in canvas to reduce computation\r\n this.particles = this.particles.filter(p =>\r\n p.isInCanvas(this.canvas.width, this.canvas.height)\r\n );\r\n this.particles.forEach(p => {\r\n p.flyAwayWhenMouseOver(this.mousePosition);\r\n p.draw(this.ctx);\r\n });\r\n\r\n window.requestAnimationFrame(() => this.animate());\r\n }\r\n\r\n private drawBackground(bgColor = '#333') {\r\n this.ctx.fillStyle = bgColor;\r\n this.ctx.rect(0, 0, this.canvas.width, this.canvas.height);\r\n this.ctx.fill();\r\n }\r\n}\r\n","\r\n","import { Particle } from './particle';\r\n\r\nexport class CandyText {\r\n private readonly ctx: CanvasRenderingContext2D;\r\n\r\n private readonly denseness = 10;\r\n private readonly textFont = '200px impact';\r\n private readonly canvasWidth: number;\r\n private readonly canvasHeight: number;\r\n\r\n constructor(private readonly canvas: HTMLCanvasElement) {\r\n this.ctx = this.canvas.getContext('2d');\r\n this.canvasWidth = this.canvas.width;\r\n this.canvasHeight = this.canvas.height;\r\n }\r\n\r\n getParticles(word: string): Particle[] {\r\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n this.ctx.font = this.textFont;\r\n this.ctx.fillStyle = '#000000';\r\n const starting = this.canvasWidth / 2 - 50 * word.length;\r\n this.ctx.fillText(word, starting, 220);\r\n const imageData = this.ctx.getImageData(\r\n 0,\r\n 0,\r\n this.canvas.width,\r\n this.canvas.height\r\n );\r\n\r\n // iterate over all pixels - leaving density gaps\r\n const particles: Particle[] = [];\r\n for (let py = 0; py < this.canvas.height; py += this.denseness) {\r\n for (let px = 0; px < this.canvas.width; px += this.denseness) {\r\n const pixel = imageData.data[(px + py * this.canvas.width) * 4 - 1];\r\n //Pixel is black from being drawn on.\r\n if (pixel == 255) {\r\n const p = new Particle(px, py);\r\n particles.push(p);\r\n }\r\n }\r\n }\r\n return particles;\r\n }\r\n}\r\n","export { Position } from './position';\r\nexport { Particle } from './particle';\r\nexport { CandyText } from './candy-text';\r\n","import { Position } from './position';\r\n\r\nexport class Particle {\r\n public readonly color: string;\r\n private flying = false;\r\n public vx = 0;\r\n public vy = 0;\r\n\r\n constructor(public x: number, public y: number, public readonly radius = 4) {\r\n this.color = '#' + ((Math.random() * 0x949494 + 0xaaaaaa) | 0).toString(16);\r\n }\r\n\r\n draw(ctx: CanvasRenderingContext2D) {\r\n if (this.flying) {\r\n this.x += this.vx;\r\n this.y += this.vy;\r\n }\r\n ctx.fillStyle = this.color;\r\n ctx.beginPath();\r\n ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2, true);\r\n ctx.closePath();\r\n ctx.fill();\r\n }\r\n\r\n flyAwayWhenMouseOver(mousePosition: Position, mouseAffectRange = 20) {\r\n const dx = this.x - mousePosition.x;\r\n const dy = this.y - mousePosition.y;\r\n const isInRange = dx * dx + dy * dy < mouseAffectRange * mouseAffectRange;\r\n if (isInRange && !this.flying) {\r\n this.flying = true;\r\n this.vx = (Math.random() - 0.5) * mouseAffectRange * 2;\r\n this.vy = (Math.random() - 0.5) * mouseAffectRange * 2;\r\n }\r\n }\r\n\r\n isInCanvas(canvasWidth: number, canvasHeight: number) {\r\n return !(\r\n this.x < -this.radius ||\r\n this.y < -this.radius ||\r\n this.x > canvasWidth + this.radius ||\r\n this.y > canvasHeight + this.radius\r\n );\r\n }\r\n}\r\n","export class Position {\r\n constructor(public x: number, public y: number) {}\r\n}\r\n","import { Component, HostListener, Input, OnInit } from '@angular/core';\r\nimport { EightPuzzleService } from '../services/eight-puzzle.services';\r\n\r\n@Component({\r\n selector: 'app-eight-puzzle-tile',\r\n templateUrl: './eight-puzzle-tile.component.html',\r\n styleUrls: ['./eight-puzzle-tile.component.css'],\r\n})\r\nexport class EightPuzzleTileComponent implements OnInit {\r\n @Input() id = 0;\r\n @Input() letter = '';\r\n\r\n constructor(private svc: EightPuzzleService) {}\r\n\r\n ngOnInit(): void {}\r\n\r\n @HostListener('click', ['$event'])\r\n move() {\r\n this.svc.move(this.id);\r\n\r\n if (this.svc.isWinning()) {\r\n alert('Success');\r\n }\r\n }\r\n}\r\n","
\r\n {{ letter }}\r\n
\r\n","import { Component, HostListener, OnInit } from '@angular/core';\r\nimport { EightPuzzleService } from './services/eight-puzzle.services';\r\n\r\n@Component({\r\n selector: 'app-eight-puzzle',\r\n templateUrl: './eight-puzzle.component.html',\r\n styleUrls: ['./eight-puzzle.component.css'],\r\n})\r\nexport class EightPuzzleComponent implements OnInit {\r\n tileSize = 0;\r\n letters = [];\r\n constructor(private svc: EightPuzzleService) {}\r\n\r\n ngOnInit(): void {\r\n this.tileSize = Math.min(window.innerWidth, window.innerHeight) * 0.9;\r\n this.letters = this.svc.randomize();\r\n }\r\n\r\n @HostListener('window:resize', ['$event'])\r\n onResize(event: Event) {\r\n this.ngOnInit();\r\n }\r\n}\r\n","\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n","import { Injectable } from '@angular/core';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class EightPuzzleService {\r\n private readonly _letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', ''];\r\n private readonly _win = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', ''];\r\n private readonly n = this._letters.length;\r\n private readonly rows = Math.sqrt(this.n);\r\n constructor() {}\r\n\r\n getLetter(i: number) {\r\n return i < this.n ? this._letters[i] : '';\r\n }\r\n\r\n getCoordinate(i: number): [x: number, y: number] {\r\n const x = Math.floor(i / this.rows);\r\n const y = i - this.rows * x;\r\n return [x, y];\r\n }\r\n\r\n randomize(): string[] {\r\n let currentIndex = this.n;\r\n while (currentIndex != 0) {\r\n const i = Math.floor(Math.random() * currentIndex);\r\n currentIndex--;\r\n\r\n [this._letters[currentIndex], this._letters[i]] = [\r\n this._letters[i],\r\n this._letters[currentIndex],\r\n ];\r\n }\r\n return this._letters;\r\n }\r\n canMove(i: number): boolean {\r\n const [x, y] = this.getCoordinate(i);\r\n if (x >= this.rows || y >= this.rows || !this._letters[i]?.trim()) {\r\n return false;\r\n }\r\n // down\r\n if (x < this.rows - 1 && !this._letters[(x + 1) * this.rows + y]?.trim()) {\r\n return true;\r\n }\r\n // up\r\n if (x > 0 && !this._letters[(x - 1) * this.rows + y]?.trim()) {\r\n return true;\r\n }\r\n // left\r\n if (y > 0 && !this._letters[x * this.rows + y - 1]?.trim()) {\r\n return true;\r\n } // right\r\n if (y < this.rows - 1 && !this._letters[x * this.rows + y + 1]?.trim()) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n move(i: number) {\r\n if (this.isWinning()) {\r\n return;\r\n }\r\n\r\n const [x, y] = this.getCoordinate(i);\r\n\r\n // down\r\n if (x < this.rows - 1 && !this._letters[(x + 1) * this.rows + y]?.trim()) {\r\n [this._letters[i], this._letters[(x + 1) * this.rows + y]] = [\r\n this._letters[(x + 1) * this.rows + y],\r\n this._letters[i],\r\n ];\r\n }\r\n // up\r\n if (x > 0 && !this._letters[(x - 1) * this.rows + y]?.trim()) {\r\n [this._letters[i], this._letters[(x - 1) * this.rows + y]] = [\r\n this._letters[(x - 1) * this.rows + y],\r\n this._letters[i],\r\n ];\r\n }\r\n // left\r\n if (y > 0 && !this._letters[x * this.rows + y - 1]?.trim()) {\r\n [this._letters[i], this._letters[x * this.rows + y - 1]] = [\r\n this._letters[x * this.rows + y - 1],\r\n this._letters[i],\r\n ];\r\n }\r\n // right\r\n if (y < this.rows - 1 && !this._letters[x * this.rows + y + 1]?.trim()) {\r\n [this._letters[i], this._letters[x * this.rows + y + 1]] = [\r\n this._letters[x * this.rows + y + 1],\r\n this._letters[i],\r\n ];\r\n }\r\n }\r\n\r\n isWinning(): boolean {\r\n return this._letters.every((e, i) => e === this._win[i]);\r\n }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-math',\r\n templateUrl: './math1.component.html',\r\n styleUrls: ['./math1.component.css'],\r\n})\r\nexport class Math1Component implements OnInit {\r\n nAdd = 10;\r\n nSub = 10;\r\n additions: string[] = [];\r\n subtractions: string[] = [];\r\n multiplications: string[] = [];\r\n divisions: string[] = [];\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {\r\n this.getAdditions();\r\n this.getSubtractions();\r\n this.getMultiplications();\r\n this.getDivisions();\r\n }\r\n\r\n getAdditions() {\r\n const max = 1000;\r\n const min = 10;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n this.additions.push(`${a} + ${b}`);\r\n }\r\n }\r\n\r\n getSubtractions() {\r\n const max = 1000;\r\n const min = 10;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n let s = a > b ? `${a} - ${b}` : `${b} - ${a}`;\r\n this.subtractions.push(s);\r\n }\r\n }\r\n\r\n getMultiplications() {\r\n const max = 200;\r\n const min = 1;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n this.multiplications.push(`${a} × ${b}`);\r\n }\r\n }\r\n\r\n getDivisions() {\r\n const max = 100;\r\n const min = 1;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n this.divisions.push(`${a * b} ÷ ${b}`);\r\n }\r\n }\r\n\r\n private randomIntBetween(min: number, max: number): number {\r\n return ~~(Math.random() * (max - min + 1) + min);\r\n }\r\n}\r\n","

Basic Arithmetics - 2

\r\n\r\n
\r\n
\r\n

{{ item }}

\r\n
\r\n
\r\n

{{ item }}

\r\n
\r\n
\r\n

\r\n
\r\n
\r\n

\r\n
\r\n
\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-math2',\r\n templateUrl: './math2.component.html',\r\n styleUrls: ['./math2.component.css', '../math1/math1.component.css'],\r\n})\r\nexport class Math2Component implements OnInit {\r\n frac = `\r\n\r\n numerator1\r\n denominator1\r\n\r\n=\r\n?\r\n\r\n `;\r\n mathml = `\r\n\r\n numerator1\r\n denominator1\r\n\r\noperator\r\n\r\n numerator2\r\n denominator2\r\n\r\n=\r\n?\r\n\r\n `;\r\n nAdd = 10;\r\n nSub = 10;\r\n fracSimp = '';\r\n additions1 = '';\r\n additions2 = '';\r\n multiplications = '';\r\n constructor() {}\r\n\r\n ngOnInit(): void {\r\n this.getSimplifications();\r\n this.getAdditions1();\r\n this.getAdditions2();\r\n }\r\n getSimplifications() {\r\n const max = 20;\r\n const min = 1;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n let c = this.randomIntBetween(min, max);\r\n\r\n this.fracSimp = this.fracSimp.concat(`\r\n\r\n ${a * c}\r\n ${b * c}\r\n\r\n=\r\n?\r\n`);\r\n }\r\n this.fracSimp = this.fracSimp.concat('');\r\n }\r\n getAdditions1() {\r\n const max = 10;\r\n const min = 1;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n let c = this.randomIntBetween(min, max);\r\n let d = this.randomIntBetween(min, max);\r\n this.additions1 = this.additions1.concat(`\r\n\r\n ${a}\r\n ${b}\r\n\r\n+\r\n\r\n ${c}\r\n ${d}\r\n\r\n=\r\n?\r\n`);\r\n this.multiplications = this.multiplications\r\n .concat(`\r\n\r\n ${a}\r\n ${b}\r\n\r\n×\r\n\r\n ${c}\r\n ${d}\r\n\r\n=\r\n?\r\n`);\r\n }\r\n this.additions1 = this.additions1.concat('');\r\n this.multiplications = this.multiplications.concat('');\r\n }\r\n getAdditions2() {\r\n const max = 25;\r\n const min = 1;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n let c = this.randomIntBetween(min, max);\r\n let d = this.randomIntBetween(min, max);\r\n this.additions2 = this.additions2.concat(`\r\n\r\n ${a}\r\n ${b}\r\n\r\n+\r\n\r\n ${c}\r\n ${d}\r\n\r\n=\r\n?\r\n`);\r\n }\r\n this.additions2 = this.additions2.concat('');\r\n }\r\n\r\n private randomIntBetween(min: number, max: number): number {\r\n return ~~(Math.random() * (max - min + 1) + min);\r\n }\r\n}\r\n","

Fractions

\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-math3',\r\n templateUrl: './math3.component.html',\r\n styleUrls: ['./math3.component.css', '../math1/math1.component.css'],\r\n})\r\nexport class Math3Component implements OnInit {\r\n nAdd = 10;\r\n nSub = 10;\r\n list1: string[] = [];\r\n list2: string[] = [];\r\n operators = ['+', '-', '×', '÷'];\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {\r\n this.getLists();\r\n }\r\n\r\n getLists() {\r\n const max = 200;\r\n const min = 1;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n const a = this.randomIntBetween(min, max);\r\n const op1 = this.randomOperator();\r\n const b = this.randomIntBetween(min, max);\r\n const op2 = this.randomOperator();\r\n const f = this.randomIntBetween(1, 10);\r\n const c = this.randomIntBetween(min, max);\r\n const op3 = this.randomOperator();\r\n const d = this.randomIntBetween(min, max);\r\n this.list1.push(`(${a} ${op1} ${b}) ${op2} (${c} ${op3} ${d})`);\r\n this.list2.push(\r\n `(${d} ${op1} ${b}) ${op2} ${f} × (${a} ${op3} ${c})`\r\n );\r\n }\r\n }\r\n\r\n private randomIntBetween(min: number, max: number): number {\r\n return ~~(Math.random() * (max - min + 1) + min);\r\n }\r\n private randomOperator(): string {\r\n return this.operators[~~(Math.random() * 4)];\r\n }\r\n}\r\n","

Four Operations

\r\n\r\n
\r\n
\r\n

\r\n
\r\n
\r\n

\r\n
\r\n
\r\n","import {\r\n Directive,\r\n OnChanges,\r\n OnInit,\r\n Input,\r\n ElementRef,\r\n SimpleChanges,\r\n NgZone,\r\n} from '@angular/core';\r\nimport { MathService } from './math.service';\r\n\r\n@Directive({\r\n selector: '[appMath]',\r\n})\r\nexport class MathDirective implements OnInit, OnChanges {\r\n @Input() appMath = '';\r\n private readonly el: HTMLElement;\r\n\r\n constructor(\r\n private svc: MathService,\r\n elementRef: ElementRef,\r\n private ngZone: NgZone\r\n ) {\r\n this.el = elementRef.nativeElement;\r\n }\r\n\r\n ngOnInit() {\r\n this.render();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes && changes['appMath'] && changes['appMath'].currentValue) {\r\n this.render();\r\n }\r\n }\r\n\r\n private render() {\r\n this.ngZone.runOutsideAngular(() => {\r\n this.svc\r\n .registerMathJax()\r\n .subscribe(() => this.svc.render(this.el, this.appMath));\r\n });\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { MathDirective } from './math.directive';\r\nimport { MathService } from './math.service';\r\n\r\n@NgModule({\r\n declarations: [MathDirective],\r\n exports: [MathDirective],\r\n providers: [MathService],\r\n})\r\nexport class MathModule {}\r\n","import { DOCUMENT } from '@angular/common';\r\nimport { Inject, Injectable } from '@angular/core';\r\nimport { ReplaySubject, Observable } from 'rxjs';\r\n\r\ndeclare global {\r\n interface Window {\r\n MathJax: {\r\n typesetPromise: () => void;\r\n startup: {\r\n promise: Promise;\r\n };\r\n };\r\n }\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class MathService {\r\n private loaded$: ReplaySubject;\r\n private readonly source =\r\n 'https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/mml-chtml.js';\r\n private readonly integrity =\r\n 'sha256-CnzfCXjFj1REmPHgWvm/OQv8gFaxwbLKUi41yCU7N2s=';\r\n\r\n constructor(@Inject(DOCUMENT) private readonly document: Document) {}\r\n\r\n registerMathJax(): Observable {\r\n if (this.loaded$) {\r\n return this.loaded$.asObservable();\r\n }\r\n\r\n this.loaded$ = new ReplaySubject();\r\n\r\n const script = this.document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = this.source;\r\n script.integrity = this.integrity;\r\n script.async = true;\r\n script.crossOrigin = 'anonymous';\r\n script.onload = () => {\r\n this.loaded$.next(true);\r\n this.loaded$.complete();\r\n };\r\n\r\n this.document.head.appendChild(script);\r\n\r\n return this.loaded$.asObservable();\r\n }\r\n\r\n render(element: HTMLElement, math: string) {\r\n // Take initial typesetting which MathJax performs into account\r\n window.MathJax.startup.promise.then(() => {\r\n element.innerHTML = math;\r\n window.MathJax.typesetPromise();\r\n });\r\n }\r\n}\r\n","import { Component, OnInit, AfterViewInit, HostListener } from '@angular/core';\r\nimport { Cell, Maze, keyboardMap } from './models';\r\nimport { environment } from 'src/environments/environment';\r\n\r\n@Component({\r\n selector: 'app-maze',\r\n templateUrl: './maze.component.html',\r\n styleUrls: ['./maze.component.css']\r\n})\r\nexport class MazeComponent implements OnInit, AfterViewInit {\r\n row = 15;\r\n col = 15;\r\n private maze: Maze;\r\n private canvas: HTMLCanvasElement;\r\n private ctx: CanvasRenderingContext2D;\r\n private readonly cellSize = 20; // length of cell edge\r\n private readonly cellEdgeThickness = 2; // thickness of cell edge\r\n private readonly cellBackground = '#FFFFFF';\r\n private readonly solutionPathColor = '#FF7575';\r\n private readonly myPathColor = '#4080FF';\r\n private readonly myPathThickness = 10;\r\n private readonly solutionPathThickness = 3;\r\n private gameOver = false;\r\n private myPath: Cell[] = [];\r\n private currentCell: Cell;\r\n showTestButton = false;\r\n busy = false;\r\n\r\n constructor() {\r\n if (!environment.production) {\r\n this.showTestButton = true;\r\n }\r\n }\r\n\r\n ngOnInit() {}\r\n\r\n ngAfterViewInit() {\r\n this.canvas = document.getElementById('maze');\r\n this.ctx = this.canvas.getContext('2d');\r\n this.drawMaze();\r\n }\r\n\r\n drawMaze() {\r\n this.busy = true;\r\n this.validateInputs();\r\n\r\n this.maze = new Maze(this.row, this.col);\r\n this.canvas.width = this.col * this.cellSize;\r\n this.canvas.height = this.row * this.cellSize;\r\n\r\n // open the first and last cells to show the entrance and exit\r\n this.maze.firstCell.westEdge = false;\r\n this.maze.lastCell.eastEdge = false;\r\n\r\n // draw the cells\r\n this.ctx.lineWidth = this.cellEdgeThickness;\r\n this.ctx.fillStyle = this.cellBackground;\r\n this.maze.cells.forEach(x => x.forEach(c => this.draw(c)));\r\n\r\n this.initPlay();\r\n this.busy = false;\r\n }\r\n\r\n initPlay() {\r\n this.gameOver = false;\r\n this.myPath.length = 0;\r\n this.currentCell = this.maze.firstCell; // reset myPath position\r\n this.myPath.push(this.currentCell);\r\n\r\n // draw the initial step of myPath in the first Cell as entrance\r\n this.ctx.lineWidth = this.myPathThickness;\r\n this.ctx.strokeStyle = this.myPathColor;\r\n this.ctx.beginPath();\r\n this.ctx.moveTo(0, this.cellSize / 2);\r\n this.ctx.lineTo(this.cellSize / 2, this.cellSize / 2);\r\n this.ctx.stroke();\r\n }\r\n\r\n @HostListener('document:keydown', ['$event'])\r\n handleKeyDown(event: KeyboardEvent) {\r\n if (this.gameOver) return;\r\n const direction = keyboardMap[event.key];\r\n if (direction) {\r\n this.move(direction);\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n move(direction: 'Left' | 'Right' | 'Up' | 'Down') {\r\n let nextCell: Cell;\r\n if (direction === 'Left') {\r\n if (this.currentCell.col < 1) return;\r\n nextCell = this.maze.cells[this.currentCell.row][\r\n this.currentCell.col - 1\r\n ];\r\n }\r\n if (direction === 'Right') {\r\n if (this.currentCell.col + 1 >= this.col) return;\r\n nextCell = this.maze.cells[this.currentCell.row][\r\n this.currentCell.col + 1\r\n ];\r\n }\r\n if (direction === 'Up') {\r\n if (this.currentCell.row < 1) return;\r\n nextCell = this.maze.cells[this.currentCell.row - 1][\r\n this.currentCell.col\r\n ];\r\n }\r\n if (direction === 'Down') {\r\n if (this.currentCell.row + 1 >= this.row) return;\r\n nextCell = this.maze.cells[this.currentCell.row + 1][\r\n this.currentCell.col\r\n ];\r\n }\r\n\r\n if (this.currentCell.isConnectedTo(nextCell)) {\r\n if (\r\n this.myPath.length > 1 &&\r\n this.myPath[this.myPath.length - 2].equals(nextCell)\r\n ) {\r\n // this is a step back; reverse the step by erasing the original path\r\n this.drawPath(this.myPath, this.cellBackground);\r\n this.myPath.pop();\r\n } else {\r\n this.myPath.push(nextCell);\r\n if (nextCell.equals(this.maze.lastCell)) {\r\n this.hooray();\r\n this.drawSolution(this.myPathColor, this.myPathThickness);\r\n return;\r\n }\r\n }\r\n\r\n this.drawPath(this.myPath);\r\n this.currentCell = nextCell;\r\n }\r\n }\r\n\r\n undo(nSteps = 5) {\r\n if (!this.gameOver && this.myPath.length > nSteps) {\r\n this.drawPath(this.myPath, this.cellBackground);\r\n this.myPath.splice(-nSteps);\r\n this.drawPath(this.myPath);\r\n this.currentCell = this.myPath[this.myPath.length - 1];\r\n }\r\n }\r\n\r\n drawSolution(\r\n color = this.solutionPathColor,\r\n lineThickness = this.solutionPathThickness\r\n ) {\r\n this.gameOver = true;\r\n this.drawPath(this.maze.findPath(), color, lineThickness, true);\r\n }\r\n\r\n private drawPath(\r\n path: Cell[],\r\n color = this.myPathColor,\r\n lineThickness = this.myPathThickness,\r\n drawSolution = false\r\n ) {\r\n this.ctx.lineWidth = lineThickness;\r\n this.ctx.strokeStyle = color;\r\n this.ctx.beginPath();\r\n this.ctx.moveTo(0, this.cellSize / 2);\r\n\r\n path.forEach(x =>\r\n this.ctx.lineTo(\r\n (x.col + 0.5) * this.cellSize,\r\n (x.row + 0.5) * this.cellSize\r\n )\r\n );\r\n if (drawSolution) {\r\n this.ctx.lineTo(\r\n this.col * this.cellSize,\r\n (this.row - 0.5) * this.cellSize\r\n );\r\n }\r\n this.ctx.stroke();\r\n }\r\n\r\n private draw(cell: Cell) {\r\n this.ctx.fillRect(\r\n cell.col * this.cellSize,\r\n cell.row * this.cellSize,\r\n (cell.col + 1) * this.cellSize,\r\n (cell.row + 1) * this.cellSize\r\n );\r\n if (cell.northEdge) {\r\n this.ctx.beginPath();\r\n this.ctx.moveTo(cell.col * this.cellSize, cell.row * this.cellSize);\r\n this.ctx.lineTo((cell.col + 1) * this.cellSize, cell.row * this.cellSize);\r\n this.ctx.stroke();\r\n }\r\n if (cell.eastEdge) {\r\n this.ctx.beginPath();\r\n this.ctx.moveTo((cell.col + 1) * this.cellSize, cell.row * this.cellSize);\r\n this.ctx.lineTo(\r\n (cell.col + 1) * this.cellSize,\r\n (cell.row + 1) * this.cellSize\r\n );\r\n this.ctx.stroke();\r\n }\r\n if (cell.southEdge) {\r\n this.ctx.beginPath();\r\n this.ctx.moveTo(\r\n (cell.col + 1) * this.cellSize,\r\n (cell.row + 1) * this.cellSize\r\n );\r\n this.ctx.lineTo(cell.col * this.cellSize, (cell.row + 1) * this.cellSize);\r\n this.ctx.stroke();\r\n }\r\n if (cell.westEdge) {\r\n this.ctx.beginPath();\r\n this.ctx.moveTo(cell.col * this.cellSize, (cell.row + 1) * this.cellSize);\r\n this.ctx.lineTo(cell.col * this.cellSize, cell.row * this.cellSize);\r\n this.ctx.stroke();\r\n }\r\n }\r\n\r\n private hooray() {\r\n var audio = new Audio('assets/KidsCheering.mp3');\r\n audio.play();\r\n }\r\n\r\n private validateInputs() {\r\n if (isNaN(this.row) || this.row < 1) {\r\n alert('Please enter a positive number for #Rows.');\r\n this.row = 15;\r\n }\r\n if (isNaN(this.col) || this.col < 1) {\r\n alert('Please enter a positive number for #Columns.');\r\n this.col = 15;\r\n }\r\n if (this.row > 500 || this.col > 500) {\r\n alert('Size too large. You may crash the browser...');\r\n this.row = 15;\r\n this.col = 15;\r\n }\r\n this.row = ~~this.row;\r\n this.col = ~~this.col;\r\n }\r\n\r\n test() {\r\n this.busy = true;\r\n const cellsHaveFourEdges: Cell[] = [];\r\n let hasLoop = false;\r\n const size = 50;\r\n for (let i = 0; i < 100; i++) {\r\n const maze = new Maze(size, size);\r\n maze.cells.forEach(row =>\r\n row.forEach(c => {\r\n if (c.nEdges === 4) {\r\n cellsHaveFourEdges.push(c);\r\n }\r\n if (c.col < size - 1 && c.row < size - 1) {\r\n if (!c.eastEdge && !c.southEdge) {\r\n const cellOnTheRight = maze.cells[c.row][c.col + 1];\r\n if (!cellOnTheRight.southEdge) {\r\n const cellBelow = maze.cells[c.row + 1][c.col];\r\n if (!cellBelow.eastEdge) {\r\n hasLoop = true;\r\n }\r\n }\r\n }\r\n }\r\n })\r\n );\r\n if (cellsHaveFourEdges.length) {\r\n alert('dead loop');\r\n break;\r\n }\r\n if (hasLoop) {\r\n alert('open loop');\r\n break;\r\n }\r\n }\r\n\r\n console.log(`testing has finished`);\r\n this.busy = false;\r\n }\r\n}\r\n","
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Test\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
⬆️
\r\n
\r\n ⬅️\r\n \r\n ➡️\r\n
\r\n
⬇️
\r\n
\r\n
\r\n
\r\n","/**\r\n *\r\n */\r\nexport class Cell {\r\n northEdge: boolean = true;\r\n eastEdge: boolean = true;\r\n westEdge: boolean = true;\r\n southEdge: boolean = true;\r\n neighbors: Cell[] = [];\r\n\r\n /**\r\n * a flag used to indicate if the cell has been traversed or not when finding a maze path\r\n */\r\n traversed: boolean = false;\r\n\r\n /**\r\n * a flag used to indicate if the cell has been visited or not when hunt-and-kill\r\n */\r\n visited: boolean = false;\r\n\r\n /**\r\n * The number of Edges in this cell.\r\n * The nEdges counts all four edges. If an edge is false, then 0.\r\n */\r\n get nEdges(): number {\r\n return (\r\n (this.northEdge ? 1 : 0) +\r\n (this.southEdge ? 1 : 0) +\r\n (this.westEdge ? 1 : 0) +\r\n (this.eastEdge ? 1 : 0)\r\n );\r\n }\r\n\r\n /**\r\n * Create a cell in a maze.\r\n * @param row rowID of the cell in a maze. integer, row>=0\r\n * @param col colID of the cell in a maze. integer, col>=0\r\n */\r\n constructor(\r\n public readonly row: number = 0,\r\n public readonly col: number = 0\r\n ) {}\r\n\r\n connectTo(another: Cell) {\r\n if (!another) return;\r\n if (this.row === another.row) {\r\n if (this.col - 1 === another.col) {\r\n this.westEdge = false;\r\n another.eastEdge = false;\r\n } else if (this.col + 1 === another.col) {\r\n this.eastEdge = false;\r\n another.westEdge = false;\r\n } else {\r\n return;\r\n }\r\n } else if (this.col === another.col) {\r\n if (this.row - 1 === another.row) {\r\n this.northEdge = false;\r\n another.southEdge = false;\r\n } else if (this.row + 1 === another.row) {\r\n this.southEdge = false;\r\n another.northEdge = false;\r\n } else {\r\n return;\r\n }\r\n } else {\r\n return;\r\n }\r\n this.visited = true;\r\n another.visited = true;\r\n }\r\n\r\n equals(another: Cell): boolean {\r\n return this.row === another.row && this.col === another.col;\r\n }\r\n\r\n isConnectedTo(another: Cell): boolean {\r\n if (this.row === another.row) {\r\n if (this.col - 1 === another.col) {\r\n if (this.westEdge === false && another.eastEdge === false) {\r\n return true;\r\n }\r\n }\r\n if (this.col + 1 === another.col) {\r\n if (this.eastEdge === false && another.westEdge === false) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (this.col === another.col) {\r\n if (this.row - 1 === another.row) {\r\n if (this.northEdge === false && another.southEdge === false) {\r\n return true;\r\n }\r\n }\r\n if (this.row + 1 === another.row) {\r\n if (this.southEdge === false && another.northEdge === false) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\n","export { Cell } from './cell';\r\nexport { Maze } from './maze';\r\nexport { keyboardMap } from './keyboard-map';\r\n","export const keyboardMap = {\r\n ArrowLeft: 'Left',\r\n A: 'Left',\r\n a: 'Left',\r\n ArrowRight: 'Right',\r\n D: 'Right',\r\n d: 'Right',\r\n ArrowUp: 'Up',\r\n W: 'Up',\r\n w: 'Up',\r\n ArrowDown: 'Down',\r\n S: 'Down',\r\n s: 'Down',\r\n};\r\n","import { Cell } from './cell';\r\n\r\n/**\r\n * A rectangle maze generated based on \"hunt-and-kill\" algorithm.\r\n */\r\nexport class Maze {\r\n public readonly cells: Cell[][] = [];\r\n private readonly randomRowNumbers: number[];\r\n private readonly randomColNumbers: number[];\r\n\r\n /**\r\n * Create a maze with × cells.\r\n * @param nRow number of rows\r\n * @param nCol number of columns\r\n */\r\n constructor(public nRow: number, public nCol: number) {\r\n // initialize cells\r\n for (let i = 0; i < nRow; i++) {\r\n this.cells[i] = [];\r\n for (let j = 0; j < nCol; j++) {\r\n this.cells[i][j] = new Cell(i, j);\r\n }\r\n }\r\n // populate cell neighbors (an optimization)\r\n this.cells.forEach(row => row.forEach(c => this.mapNeighbors(c)));\r\n\r\n // generate maze\r\n this.randomRowNumbers = Utils.shuffleArray([...Array(this.nRow).keys()]);\r\n this.randomColNumbers = Utils.shuffleArray([...Array(this.nCol).keys()]);\r\n this.huntAndKill();\r\n }\r\n\r\n get firstCell(): Cell {\r\n return this.cells[0][0];\r\n }\r\n\r\n get lastCell(): Cell {\r\n return this.cells[this.nRow - 1][this.nCol - 1];\r\n }\r\n\r\n get randomCell(): Cell {\r\n return this.cells[Utils.random(this.nRow)][Utils.random(this.nCol)];\r\n }\r\n\r\n /**\r\n * traverse the maze using depth-first algorithm\r\n */\r\n findPath(): Cell[] {\r\n this.cells.forEach(x => x.forEach(c => (c.traversed = false)));\r\n const path: Cell[] = [this.firstCell];\r\n\r\n while (1) {\r\n let current = path[0];\r\n current.traversed = true;\r\n\r\n if (current.equals(this.lastCell)) {\r\n break;\r\n }\r\n\r\n const traversableNeighbors = current.neighbors\r\n .filter(c => c.isConnectedTo(current))\r\n .filter(c => !c.traversed);\r\n if (traversableNeighbors.length) {\r\n path.unshift(traversableNeighbors[0]);\r\n } else {\r\n path.splice(0, 1);\r\n }\r\n }\r\n\r\n return path.reverse();\r\n }\r\n\r\n private huntAndKill() {\r\n let current = this.randomCell; // hunt-and-kill starts from a random Cell\r\n while (current) {\r\n this.kill(current);\r\n current = this.hunt();\r\n }\r\n }\r\n private kill(current: Cell) {\r\n while (current) {\r\n const next = current.neighbors.find(c => !c.visited);\r\n if (next) {\r\n current.connectTo(next);\r\n }\r\n current = next;\r\n }\r\n }\r\n private hunt(): Cell {\r\n for (let huntRow of this.randomRowNumbers) {\r\n for (let huntColumn of this.randomColNumbers) {\r\n const cell = this.cells[huntRow][huntColumn];\r\n if (cell.visited) {\r\n continue;\r\n }\r\n const next = cell.neighbors.find(c => c.visited);\r\n if (next) {\r\n cell.connectTo(next);\r\n return cell;\r\n }\r\n }\r\n }\r\n }\r\n\r\n private mapNeighbors(cell: Cell): void {\r\n if (cell.row - 1 >= 0) {\r\n cell.neighbors.push(this.cells[cell.row - 1][cell.col]);\r\n }\r\n if (cell.row + 1 < this.nRow) {\r\n cell.neighbors.push(this.cells[cell.row + 1][cell.col]);\r\n }\r\n if (cell.col - 1 >= 0) {\r\n cell.neighbors.push(this.cells[cell.row][cell.col - 1]);\r\n }\r\n if (cell.col + 1 < this.nCol) {\r\n cell.neighbors.push(this.cells[cell.row][cell.col + 1]);\r\n }\r\n cell.neighbors = Utils.shuffleArray(cell.neighbors);\r\n }\r\n}\r\n\r\nclass Utils {\r\n /**\r\n * The de-facto unbiased shuffle algorithm is the Fisher-Yates (aka Knuth) Shuffle.\r\n */\r\n static shuffleArray(array: any[]): any[] {\r\n for (let i = array.length - 1; i > 0; i--) {\r\n const temp = ~~(Math.random() * (i + 1));\r\n [array[i], array[temp]] = [array[temp], array[i]];\r\n }\r\n return array;\r\n }\r\n\r\n /**\r\n * Generate a random index within a number `n`\r\n */\r\n static random(n: number): number {\r\n return ~~(Math.random() * n);\r\n }\r\n}\r\n","import { Component, OnInit, AfterViewInit, Inject } from '@angular/core';\r\nimport { ImageTile } from '../models';\r\n\r\n@Component({\r\n selector: 'app-image-tiles',\r\n templateUrl: './image-tiles.component.html',\r\n styleUrls: ['./image-tiles.component.css']\r\n})\r\nexport class ImageTilesComponent implements OnInit, AfterViewInit {\r\n private canvas: HTMLCanvasElement;\r\n private ctx: CanvasRenderingContext2D;\r\n private tileCountX = 3;\r\n private canvasSize: number;\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {\r\n this.canvasSize = 540;\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.canvas = document.getElementById('canvas');\r\n this.ctx = this.canvas.getContext('2d');\r\n this.canvas.style.width = `${this.canvasSize}px`;\r\n this.canvas.style.height = `${this.canvasSize}px`;\r\n this.canvas.width = this.canvas.offsetWidth;\r\n this.canvas.height = this.canvas.offsetHeight;\r\n }\r\n\r\n upload(files: FileList): void {\r\n if (files.length === 0) {\r\n return;\r\n }\r\n const reader = new FileReader();\r\n reader.readAsDataURL(files[0]);\r\n reader.onload = () => {\r\n const img = new Image();\r\n img.src = reader.result.toString();\r\n img.onload = () => {\r\n //start\r\n const tiles = this.getTiles(img);\r\n this.drawTiles(tiles);\r\n };\r\n };\r\n }\r\n getTiles(img: HTMLImageElement): ImageTile[] {\r\n if (img.width < this.canvasSize || img.height < this.canvasSize) {\r\n throw new Error('Image Size too small.');\r\n }\r\n\r\n const imgData = this.resizeImage(img, this.canvasSize, this.canvasSize);\r\n const imgSize =\r\n imgData.width > imgData.height ? imgData.height : imgData.width;\r\n const pixelRows = [];\r\n const data = Array.from(imgData.data);\r\n while (data.length > 0) {\r\n pixelRows.push(data.splice(0, imgData.width * 4));\r\n }\r\n const tiles: ImageTile[] = [];\r\n const tileSize = ~~(imgSize / this.tileCountX);\r\n for (let i = 0; i < this.tileCountX * this.tileCountX; i++) {\r\n const x = i % this.tileCountX;\r\n const y = ~~(i / this.tileCountX);\r\n let tileDataRows: any[] = [];\r\n for (let row = y * tileSize; row < tileSize * (y + 1); row++) {\r\n tileDataRows = tileDataRows.concat(\r\n pixelRows[row].slice(tileSize * x * 4, tileSize * (x + 1) * 4)\r\n );\r\n }\r\n tiles.push({\r\n id: i,\r\n x: i % this.tileCountX,\r\n y: ~~(i / this.tileCountX),\r\n data: new Uint8ClampedArray(tileDataRows)\r\n });\r\n }\r\n\r\n return tiles;\r\n }\r\n drawTiles(tiles: ImageTile[]) {\r\n const offset = 1;\r\n for (const tile of tiles) {\r\n this.ctx.putImageData(\r\n new ImageData(\r\n tile.data,\r\n this.canvasSize / this.tileCountX,\r\n this.canvasSize / this.tileCountX\r\n ),\r\n tile.x * 180 * offset,\r\n tile.y * 180 * offset\r\n );\r\n }\r\n }\r\n\r\n resizeImage(\r\n img: HTMLImageElement,\r\n width: number = 1080,\r\n height: number = 1080\r\n ): ImageData {\r\n if (img.height < img.width) {\r\n width = Math.floor(height * (img.width / img.height));\r\n } else {\r\n height = Math.floor(width * (img.height / img.width));\r\n }\r\n let resizingCanvas: HTMLCanvasElement = (\r\n document.createElement('canvas')\r\n );\r\n let resizingCanvasContext = resizingCanvas.getContext('2d');\r\n resizingCanvas.width = img.width;\r\n resizingCanvas.height = img.height;\r\n resizingCanvasContext.drawImage(\r\n img,\r\n 0,\r\n 0,\r\n resizingCanvas.width,\r\n resizingCanvas.height\r\n );\r\n let curImageDimensions = {\r\n width: Math.floor(img.width),\r\n height: Math.floor(img.height)\r\n };\r\n\r\n let halfImageDimensions = {\r\n width: null,\r\n height: null\r\n };\r\n while (curImageDimensions.width * 0.5 > width) {\r\n // Reduce the resizing canvas by half and refresh the image\r\n halfImageDimensions.width = Math.floor(curImageDimensions.width * 0.5);\r\n halfImageDimensions.height = Math.floor(curImageDimensions.height * 0.5);\r\n\r\n resizingCanvasContext.drawImage(\r\n resizingCanvas,\r\n 0,\r\n 0,\r\n curImageDimensions.width,\r\n curImageDimensions.height,\r\n 0,\r\n 0,\r\n halfImageDimensions.width,\r\n halfImageDimensions.height\r\n );\r\n\r\n curImageDimensions.width = halfImageDimensions.width;\r\n curImageDimensions.height = halfImageDimensions.height;\r\n }\r\n let outputCanvas: HTMLCanvasElement = (\r\n document.createElement('canvas')\r\n );\r\n let outputCanvasContext = outputCanvas.getContext('2d');\r\n\r\n outputCanvas.width = width;\r\n outputCanvas.height = height;\r\n\r\n outputCanvasContext.drawImage(\r\n resizingCanvas,\r\n 0,\r\n 0,\r\n curImageDimensions.width,\r\n curImageDimensions.height,\r\n 0,\r\n 0,\r\n width,\r\n height\r\n );\r\n const imageData = outputCanvasContext.getImageData(0, 0, width, height);\r\n // outputCanvasContext.clearRect(0, 0, outputCanvas.width, outputCanvas.height);\r\n return imageData;\r\n }\r\n}\r\n","\r\n
\r\n \r\n
\r\n","import { Component, OnInit, NgModule, ViewChild } from '@angular/core';\r\nimport {\r\n CdkDrag,\r\n CdkDragStart,\r\n CdkDropList,\r\n CdkDropListGroup,\r\n CdkDragMove,\r\n CdkDragEnter,\r\n CdkDragDrop,\r\n moveItemInArray\r\n} from '@angular/cdk/drag-drop';\r\nimport { ViewportRuler } from '@angular/cdk/overlay';\r\n\r\n@Component({\r\n selector: 'app-scramble-squares',\r\n templateUrl: './scramble-squares.component.html',\r\n styleUrls: ['./scramble-squares.component.css']\r\n})\r\nexport class ScrambleSquaresComponent implements OnInit {\r\n @ViewChild(CdkDropListGroup) listGroup: CdkDropListGroup;\r\n @ViewChild(CdkDropList) placeholder: CdkDropList;\r\n\r\n items: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9];\r\n\r\n target: CdkDropList;\r\n targetIndex: number;\r\n source: CdkDropList;\r\n sourceIndex: number;\r\n dragIndex: number;\r\n activeContainer;\r\n\r\n constructor(private viewportRuler: ViewportRuler) {\r\n this.target = null;\r\n this.source = null;\r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n ngAfterViewInit() {\r\n let phElement = this.placeholder.element.nativeElement;\r\n\r\n phElement.style.display = 'none';\r\n phElement.parentElement.removeChild(phElement);\r\n }\r\n\r\n add() {\r\n this.items.push(this.items.length + 1);\r\n }\r\n\r\n shuffle() {\r\n this.items.sort(() => 0.5 - Math.random());\r\n }\r\n\r\n dragMoved(e: CdkDragMove) {\r\n let point = this.getPointerPositionOnPage(e.event);\r\n\r\n this.listGroup._items.forEach(dropList => {\r\n if (__isInsideDropListClientRect(dropList, point.x, point.y)) {\r\n this.activeContainer = dropList;\r\n return;\r\n }\r\n });\r\n }\r\n\r\n dropListDropped(event: CdkDragDrop) {\r\n if (!this.target) return;\r\n\r\n let phElement = this.placeholder.element.nativeElement;\r\n let parent = phElement.parentElement;\r\n\r\n phElement.style.display = 'none';\r\n\r\n parent.removeChild(phElement);\r\n parent.appendChild(phElement);\r\n parent.insertBefore(\r\n this.source.element.nativeElement,\r\n parent.children[this.sourceIndex]\r\n );\r\n\r\n this.target = null;\r\n this.source = null;\r\n\r\n if (this.sourceIndex != this.targetIndex)\r\n moveItemInArray(this.items, this.sourceIndex, this.targetIndex);\r\n }\r\n\r\n dropListEnterPredicate = (drag: CdkDrag, drop: CdkDropList) => {\r\n if (drop == this.placeholder) return true;\r\n\r\n if (drop != this.activeContainer) return false;\r\n\r\n let phElement = this.placeholder.element.nativeElement;\r\n let sourceElement = drag.dropContainer.element.nativeElement;\r\n let dropElement = drop.element.nativeElement;\r\n\r\n let dragIndex = __indexOf(\r\n dropElement.parentElement.children,\r\n this.source ? phElement : sourceElement\r\n );\r\n let dropIndex = __indexOf(dropElement.parentElement.children, dropElement);\r\n\r\n if (!this.source) {\r\n this.sourceIndex = dragIndex;\r\n this.source = drag.dropContainer;\r\n\r\n phElement.style.width = sourceElement.clientWidth + 'px';\r\n phElement.style.height = sourceElement.clientHeight + 'px';\r\n\r\n sourceElement.parentElement.removeChild(sourceElement);\r\n }\r\n\r\n this.targetIndex = dropIndex;\r\n this.target = drop;\r\n\r\n phElement.style.display = '';\r\n dropElement.parentElement.insertBefore(\r\n phElement,\r\n dropIndex > dragIndex ? dropElement.nextSibling : dropElement\r\n );\r\n\r\n // this.placeholder.enter(\r\n // drag,\r\n // drag.element.nativeElement.offsetLeft,\r\n // drag.element.nativeElement.offsetTop\r\n // );\r\n return false;\r\n };\r\n\r\n /** Determines the point of the page that was touched by the user. */\r\n getPointerPositionOnPage(event: MouseEvent | TouchEvent) {\r\n // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.\r\n const point = __isTouchEvent(event)\r\n ? event.touches[0] || event.changedTouches[0]\r\n : event;\r\n const scrollPosition = this.viewportRuler.getViewportScrollPosition();\r\n\r\n return {\r\n x: point.pageX - scrollPosition.left,\r\n y: point.pageY - scrollPosition.top\r\n };\r\n }\r\n}\r\n\r\nfunction __indexOf(collection, node) {\r\n return Array.prototype.indexOf.call(collection, node);\r\n}\r\n\r\n/** Determines whether an event is a touch event. */\r\nfunction __isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent {\r\n return event.type.startsWith('touch');\r\n}\r\n\r\nfunction __isInsideDropListClientRect(\r\n dropList: CdkDropList,\r\n x: number,\r\n y: number\r\n) {\r\n const {\r\n top,\r\n bottom,\r\n left,\r\n right\r\n } = dropList.element.nativeElement.getBoundingClientRect();\r\n return y >= top && y <= bottom && x >= left && x <= right;\r\n}\r\n","

Drag&Drop with a flex-wrap

\r\n\r\n\r\n
\r\n
    \r\n
  • {{ item }}
  • \r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n {{item}}\r\n
\r\n \r\n\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-squares',\r\n templateUrl: './squares.component.html',\r\n styleUrls: ['./squares.component.css']\r\n})\r\nexport class SquaresComponent implements OnInit {\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n}\r\n","\r\n","// This file can be replaced during build by using the `fileReplacements` array.\r\n// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.\r\n// The list of file replacements can be found in `angular.json`.\r\n\r\nexport const environment = {\r\n production: false\r\n};\r\n\r\n/*\r\n * For easier debugging in development mode, you can import the following file\r\n * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.\r\n *\r\n * This import should be commented out in production mode because it will have a negative impact\r\n * on performance if an error is thrown.\r\n */\r\n// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.\r\n","import { enableProdMode } from '@angular/core';\r\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\n\r\nimport { AppModule } from './app/app.module';\r\nimport { environment } from './environments/environment';\r\n\r\nif (environment.production) {\r\n enableProdMode();\r\n}\r\n\r\nplatformBrowserDynamic().bootstrapModule(AppModule)\r\n .catch(err => console.error(err));\r\n"],"names":["DOCUMENT","ReplaySubject","MathService","constructor","document","registerMathJax","loaded$","asObservable","script","createElement","type","src","source","integrity","async","crossOrigin","onload","next","complete","head","appendChild","render","element","math","window","MathJax","startup","promise","then","innerHTML","typesetPromise","i0","factory","providedIn"],"sourceRoot":"webpack:///"} \ No newline at end of file +{"version":3,"file":"main.js","mappings":";;;;;;;;;;;;;;;;;AAOM,MAAOA,YAAY;AAAZA,YAAY;mBAAZA,YAAY;AAAA;AAAZA,YAAY;QAAZA,YAAY;EAAAC;EAAAC;EAAAC;EAAAC;EAAAC;IAAA;MCPzBC,4DAAAA,aAAwD;MAEpDA,oDAAAA,oBACF;MAAAA,0DAAAA,EAAI;MAENA,4DAAAA,aAAgC;MACiBA,oDAAAA,kBAAW;MAAAA,0DAAAA,EAAI;MAC9DA,uDAAAA,aAAsD;MACtDA,4DAAAA,WAAgD;MAAAA,oDAAAA,iBAAU;MAAAA,0DAAAA,EAAI;MAC9DA,uDAAAA,aAAsD;MACtDA,4DAAAA,YAAgD;MAAAA,oDAAAA,YAAI;MAAAA,0DAAAA,EAAI;MACxDA,uDAAAA,cAAsD;MACtDA,4DAAAA,YAAgD;MAAAA,oDAAAA,iBAAS;MAAAA,0DAAAA,EAAI;MAC7DA,uDAAAA,cAAsD;MACtDA,4DAAAA,YAAgD;MAAAA,oDAAAA,oBAAY;MAAAA,0DAAAA,EAAI;MAChEA,uDAAAA,cAAsD;MACtDA,4DAAAA,YAAmD;MAAAA,oDAAAA,gBAAQ;MAAAA,0DAAAA,EAAI;MAC/DA,uDAAAA,cAAsD;MACtDA,4DAAAA,aAAiD;MAAAA,oDAAAA,eAAO;MAAAA,0DAAAA,EAAI;MAE9DA,4DAAAA,eAA4B;MAC1BA,uDAAAA,qBAA+B;MACjCA,0DAAAA,EAAM;;;;;;;;;;;;;;;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gBAAgB;EAAAd;EAAAC;EAAAC;EAAAE;IAAA;MCP7BC,uDAAAA,sBAAmC;;;;;;;;;;;;;;;;;;;ACAnC;AACA;AACA;AAEO,MAAMwN,WAAW,GAAG;EACzBC,UAAU,EAAE;CACb;AAED;;;;;;;AAOA;;;;;;;;;;;;;;;;ACf+C;AAGF;AACY;AAEzD,IAAID,6EAAsB,EAAE;EAC1B+L,6DAAc,EAAE;;AAGlBC,sEAAAA,EAAwB,CAACC,eAAe,CAACxY,sDAAS,CAAC,CAChDyY,KAAK,CAACC,GAAG,IAAItI,OAAO,CAACuI,KAAK,CAACD,GAAG,CAAC,CAAC","sources":["./src/app/app.component.ts","./src/app/app.component.html","./src/app/app.module.ts","./src/app/candy/candy.component.ts","./src/app/candy/candy.component.html","./src/app/candy/canvas/canvas.component.ts","./src/app/candy/canvas/canvas.component.html","./src/app/candy/models/candy-text.ts","./src/app/candy/models/index.ts","./src/app/candy/models/particle.ts","./src/app/candy/models/position.ts","./src/app/eight-puzzle/eight-puzzle-tile/eight-puzzle-tile.component.ts","./src/app/eight-puzzle/eight-puzzle-tile/eight-puzzle-tile.component.html","./src/app/eight-puzzle/eight-puzzle.component.ts","./src/app/eight-puzzle/eight-puzzle.component.html","./src/app/eight-puzzle/services/eight-puzzle.services.ts","./src/app/math1/math1.component.html","./src/app/math1/math1.component.ts","./src/app/math2/math2.component.ts","./src/app/math2/math2.component.html","./src/app/math3/math3.component.html","./src/app/math3/math3.component.ts","./src/app/math/math.directive.ts","./src/app/math/math.module.ts","./src/app/math/math.service.ts","./src/app/maze/maze.component.ts","./src/app/maze/maze.component.html","./src/app/maze/models/cell.ts","./src/app/maze/models/index.ts","./src/app/maze/models/keyboard-map.ts","./src/app/maze/models/maze.ts","./src/app/squares/image-tiles/image-tiles.component.ts","./src/app/squares/image-tiles/image-tiles.component.html","./src/app/squares/scramble-squares/scramble-squares.component.ts","./src/app/squares/scramble-squares/scramble-squares.component.html","./src/app/squares/squares.component.ts","./src/app/squares/squares.component.html","./src/environments/environment.ts","./src/main.ts"],"sourcesContent":["import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-root',\r\n templateUrl: './app.component.html',\r\n styleUrls: ['./app.component.css']\r\n})\r\nexport class AppComponent {}\r\n","\r\n\r\n
\r\n \r\n
\r\n","import { BrowserModule } from '@angular/platform-browser';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { DragDropModule } from '@angular/cdk/drag-drop';\r\nimport { RouterModule } from '@angular/router';\r\n\r\nimport { AppComponent } from './app.component';\r\nimport { MazeComponent } from './maze/maze.component';\r\nimport { CandyComponent } from './candy/candy.component';\r\nimport { CanvasComponent } from './candy/canvas/canvas.component';\r\nimport { ScrambleSquaresComponent } from './squares/scramble-squares/scramble-squares.component';\r\nimport { SquaresComponent } from './squares/squares.component';\r\nimport { ImageTilesComponent } from './squares/image-tiles/image-tiles.component';\r\nimport { Math1Component } from './math1/math1.component';\r\nimport { EightPuzzleComponent } from './eight-puzzle/eight-puzzle.component';\r\nimport { EightPuzzleTileComponent } from './eight-puzzle/eight-puzzle-tile/eight-puzzle-tile.component';\r\nimport { Math2Component } from './math2/math2.component';\r\nimport { MathModule } from './math/math.module';\r\nimport { Math3Component } from './math3/math3.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n AppComponent,\r\n MazeComponent,\r\n CandyComponent,\r\n CanvasComponent,\r\n ScrambleSquaresComponent,\r\n SquaresComponent,\r\n ImageTilesComponent,\r\n Math1Component,\r\n EightPuzzleComponent,\r\n EightPuzzleTileComponent,\r\n Math2Component,\r\n Math3Component,\r\n ],\r\n imports: [\r\n BrowserModule,\r\n FormsModule,\r\n DragDropModule,\r\n MathModule,\r\n RouterModule.forRoot([\r\n { path: '', redirectTo: 'maze', pathMatch: 'full' },\r\n { path: 'maze', component: MazeComponent },\r\n { path: 'candy', component: CandyComponent },\r\n { path: 'math1', component: Math1Component },\r\n { path: 'math2', component: Math2Component },\r\n { path: 'math3', component: Math3Component },\r\n { path: '8-puzzle', component: EightPuzzleComponent },\r\n { path: 'square', component: SquaresComponent },\r\n { path: '**', redirectTo: '' },\r\n ]),\r\n ],\r\n bootstrap: [AppComponent],\r\n})\r\nexport class AppModule {}\r\n","import { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { CanvasComponent } from './canvas/canvas.component';\r\n\r\n@Component({\r\n selector: 'app-candy',\r\n templateUrl: './candy.component.html',\r\n styleUrls: ['./candy.component.css']\r\n})\r\nexport class CandyComponent implements OnInit {\r\n name = 'Candy';\r\n @ViewChild(CanvasComponent) c: CanvasComponent;\r\n constructor() {}\r\n\r\n ngOnInit(): void {}\r\n\r\n draw() {\r\n this.c.draw(this.name);\r\n }\r\n}\r\n","
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n","import {\r\n Component,\r\n OnInit,\r\n AfterViewInit,\r\n HostListener,\r\n ChangeDetectionStrategy\r\n} from '@angular/core';\r\nimport { Position, Particle, CandyText } from '../models';\r\n\r\n@Component({\r\n selector: 'app-canvas',\r\n templateUrl: './canvas.component.html',\r\n styleUrls: ['./canvas.component.css'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class CanvasComponent implements OnInit, AfterViewInit {\r\n private canvas: HTMLCanvasElement;\r\n private ctx: CanvasRenderingContext2D;\r\n private candy: CandyText;\r\n private particles: Particle[] = [];\r\n private mousePosition = new Position(-100, -100);\r\n private raf: number;\r\n private continueAnimating = true;\r\n constructor() {}\r\n\r\n ngOnInit(): void {}\r\n\r\n ngAfterViewInit(): void {\r\n this.canvas = document.getElementById('candy-text');\r\n this.ctx = this.canvas.getContext('2d');\r\n this.canvas.style.width = '100%';\r\n this.canvas.style.height = '100%';\r\n this.canvas.width = this.canvas.offsetWidth;\r\n this.canvas.height = this.canvas.offsetHeight;\r\n this.candy = new CandyText(this.canvas);\r\n this.draw('Candy');\r\n }\r\n\r\n draw(name: string) {\r\n this.particles.length = 0;\r\n this.particles = this.candy.getParticles(name);\r\n this.drawBackground();\r\n this.particles.forEach(p => {\r\n p.draw(this.ctx);\r\n });\r\n }\r\n\r\n @HostListener('mousemove', ['$event'])\r\n calculateMouseRelativePositionInCanvas(e: MouseEvent) {\r\n // Note: I have handled scroll effect\r\n this.mousePosition.x =\r\n e.clientX +\r\n (document.documentElement.scrollLeft || document.body.scrollLeft) -\r\n this.canvas.offsetLeft;\r\n this.mousePosition.y =\r\n e.clientY +\r\n (document.documentElement.scrollTop || document.body.scrollTop) -\r\n this.canvas.offsetTop;\r\n }\r\n\r\n @HostListener('mouseenter', ['$event'])\r\n startAnimation(e: MouseEvent) {\r\n this.raf = window.requestAnimationFrame(() => this.animate());\r\n this.continueAnimating = true;\r\n }\r\n\r\n // @HostListener('mouseout', ['$event'])\r\n // stopAnimation(e: MouseEvent) {\r\n // window.cancelAnimationFrame(this.raf);\r\n // this.continueAnimating = false; // stop animation when mouse out.\r\n // }\r\n\r\n animate() {\r\n if (!this.particles.length || !this.continueAnimating) {\r\n return; // return when nothing needs to animate\r\n }\r\n\r\n this.drawBackground();\r\n // clean particles are not in canvas to reduce computation\r\n this.particles = this.particles.filter(p =>\r\n p.isInCanvas(this.canvas.width, this.canvas.height)\r\n );\r\n this.particles.forEach(p => {\r\n p.flyAwayWhenMouseOver(this.mousePosition);\r\n p.draw(this.ctx);\r\n });\r\n\r\n window.requestAnimationFrame(() => this.animate());\r\n }\r\n\r\n private drawBackground(bgColor = '#333') {\r\n this.ctx.fillStyle = bgColor;\r\n this.ctx.rect(0, 0, this.canvas.width, this.canvas.height);\r\n this.ctx.fill();\r\n }\r\n}\r\n","\r\n","import { Particle } from './particle';\r\n\r\nexport class CandyText {\r\n private readonly ctx: CanvasRenderingContext2D;\r\n\r\n private readonly denseness = 10;\r\n private readonly textFont = '200px impact';\r\n private readonly canvasWidth: number;\r\n private readonly canvasHeight: number;\r\n\r\n constructor(private readonly canvas: HTMLCanvasElement) {\r\n this.ctx = this.canvas.getContext('2d');\r\n this.canvasWidth = this.canvas.width;\r\n this.canvasHeight = this.canvas.height;\r\n }\r\n\r\n getParticles(word: string): Particle[] {\r\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n this.ctx.font = this.textFont;\r\n this.ctx.fillStyle = '#000000';\r\n const starting = this.canvasWidth / 2 - 50 * word.length;\r\n this.ctx.fillText(word, starting, 220);\r\n const imageData = this.ctx.getImageData(\r\n 0,\r\n 0,\r\n this.canvas.width,\r\n this.canvas.height\r\n );\r\n\r\n // iterate over all pixels - leaving density gaps\r\n const particles: Particle[] = [];\r\n for (let py = 0; py < this.canvas.height; py += this.denseness) {\r\n for (let px = 0; px < this.canvas.width; px += this.denseness) {\r\n const pixel = imageData.data[(px + py * this.canvas.width) * 4 - 1];\r\n //Pixel is black from being drawn on.\r\n if (pixel == 255) {\r\n const p = new Particle(px, py);\r\n particles.push(p);\r\n }\r\n }\r\n }\r\n return particles;\r\n }\r\n}\r\n","export { Position } from './position';\r\nexport { Particle } from './particle';\r\nexport { CandyText } from './candy-text';\r\n","import { Position } from './position';\r\n\r\nexport class Particle {\r\n public readonly color: string;\r\n private flying = false;\r\n public vx = 0;\r\n public vy = 0;\r\n\r\n constructor(public x: number, public y: number, public readonly radius = 4) {\r\n this.color = '#' + ((Math.random() * 0x949494 + 0xaaaaaa) | 0).toString(16);\r\n }\r\n\r\n draw(ctx: CanvasRenderingContext2D) {\r\n if (this.flying) {\r\n this.x += this.vx;\r\n this.y += this.vy;\r\n }\r\n ctx.fillStyle = this.color;\r\n ctx.beginPath();\r\n ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2, true);\r\n ctx.closePath();\r\n ctx.fill();\r\n }\r\n\r\n flyAwayWhenMouseOver(mousePosition: Position, mouseAffectRange = 20) {\r\n const dx = this.x - mousePosition.x;\r\n const dy = this.y - mousePosition.y;\r\n const isInRange = dx * dx + dy * dy < mouseAffectRange * mouseAffectRange;\r\n if (isInRange && !this.flying) {\r\n this.flying = true;\r\n this.vx = (Math.random() - 0.5) * mouseAffectRange * 2;\r\n this.vy = (Math.random() - 0.5) * mouseAffectRange * 2;\r\n }\r\n }\r\n\r\n isInCanvas(canvasWidth: number, canvasHeight: number) {\r\n return !(\r\n this.x < -this.radius ||\r\n this.y < -this.radius ||\r\n this.x > canvasWidth + this.radius ||\r\n this.y > canvasHeight + this.radius\r\n );\r\n }\r\n}\r\n","export class Position {\r\n constructor(public x: number, public y: number) {}\r\n}\r\n","import { Component, HostListener, Input, OnInit } from '@angular/core';\nimport { EightPuzzleService } from '../services/eight-puzzle.services';\n\n@Component({\n selector: 'app-eight-puzzle-tile',\n templateUrl: './eight-puzzle-tile.component.html',\n styleUrls: ['./eight-puzzle-tile.component.css'],\n})\nexport class EightPuzzleTileComponent implements OnInit {\n @Input() id = 0;\n @Input() letter = '';\n\n constructor(private svc: EightPuzzleService) {}\n\n ngOnInit(): void {}\n\n @HostListener('click', ['$event'])\n move() {\n this.svc.move(this.id);\n\n if (this.svc.isWinning()) {\n alert('Success');\n }\n }\n}\n","
\n {{ letter }}\n
\n","import { Component, HostListener, OnInit } from '@angular/core';\nimport { EightPuzzleService } from './services/eight-puzzle.services';\n\n@Component({\n selector: 'app-eight-puzzle',\n templateUrl: './eight-puzzle.component.html',\n styleUrls: ['./eight-puzzle.component.css'],\n})\nexport class EightPuzzleComponent implements OnInit {\n tileSize = 0;\n letters = [];\n constructor(private svc: EightPuzzleService) {}\n\n ngOnInit(): void {\n this.tileSize = Math.min(window.innerWidth, window.innerHeight) * 0.9;\n this.letters = this.svc.randomize();\n }\n\n @HostListener('window:resize', ['$event'])\n onResize(event: Event) {\n this.ngOnInit();\n }\n}\n","\n
\n \n \n \n
\n
\n \n \n \n
\n
\n \n \n \n
\n\n","import { Injectable } from '@angular/core';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class EightPuzzleService {\r\n private readonly _letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', ''];\r\n private readonly _win = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', ''];\r\n private readonly n = this._letters.length;\r\n private readonly rows = Math.sqrt(this.n);\r\n constructor() {}\r\n\r\n getLetter(i: number) {\r\n return i < this.n ? this._letters[i] : '';\r\n }\r\n\r\n getCoordinate(i: number): [x: number, y: number] {\r\n const x = Math.floor(i / this.rows);\r\n const y = i - this.rows * x;\r\n return [x, y];\r\n }\r\n\r\n randomize(): string[] {\r\n let currentIndex = this.n;\r\n while (currentIndex != 0) {\r\n const i = Math.floor(Math.random() * currentIndex);\r\n currentIndex--;\r\n\r\n [this._letters[currentIndex], this._letters[i]] = [\r\n this._letters[i],\r\n this._letters[currentIndex],\r\n ];\r\n }\r\n return this._letters;\r\n }\r\n canMove(i: number): boolean {\r\n const [x, y] = this.getCoordinate(i);\r\n if (x >= this.rows || y >= this.rows || !this._letters[i]?.trim()) {\r\n return false;\r\n }\r\n // down\r\n if (x < this.rows - 1 && !this._letters[(x + 1) * this.rows + y]?.trim()) {\r\n return true;\r\n }\r\n // up\r\n if (x > 0 && !this._letters[(x - 1) * this.rows + y]?.trim()) {\r\n return true;\r\n }\r\n // left\r\n if (y > 0 && !this._letters[x * this.rows + y - 1]?.trim()) {\r\n return true;\r\n } // right\r\n if (y < this.rows - 1 && !this._letters[x * this.rows + y + 1]?.trim()) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n move(i: number) {\r\n if (this.isWinning()) {\r\n return;\r\n }\r\n\r\n const [x, y] = this.getCoordinate(i);\r\n\r\n // down\r\n if (x < this.rows - 1 && !this._letters[(x + 1) * this.rows + y]?.trim()) {\r\n [this._letters[i], this._letters[(x + 1) * this.rows + y]] = [\r\n this._letters[(x + 1) * this.rows + y],\r\n this._letters[i],\r\n ];\r\n }\r\n // up\r\n if (x > 0 && !this._letters[(x - 1) * this.rows + y]?.trim()) {\r\n [this._letters[i], this._letters[(x - 1) * this.rows + y]] = [\r\n this._letters[(x - 1) * this.rows + y],\r\n this._letters[i],\r\n ];\r\n }\r\n // left\r\n if (y > 0 && !this._letters[x * this.rows + y - 1]?.trim()) {\r\n [this._letters[i], this._letters[x * this.rows + y - 1]] = [\r\n this._letters[x * this.rows + y - 1],\r\n this._letters[i],\r\n ];\r\n }\r\n // right\r\n if (y < this.rows - 1 && !this._letters[x * this.rows + y + 1]?.trim()) {\r\n [this._letters[i], this._letters[x * this.rows + y + 1]] = [\r\n this._letters[x * this.rows + y + 1],\r\n this._letters[i],\r\n ];\r\n }\r\n }\r\n\r\n isWinning(): boolean {\r\n return this._letters.every((e, i) => e === this._win[i]);\r\n }\r\n}\r\n","

Basic Arithmetics - 2

\r\n\r\n
\r\n
\r\n

{{ item }}

\r\n
\r\n
\r\n

{{ item }}

\r\n
\r\n
\r\n

\r\n
\r\n
\r\n

\r\n
\r\n
\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-math',\r\n templateUrl: './math1.component.html',\r\n styleUrls: ['./math1.component.css'],\r\n})\r\nexport class Math1Component implements OnInit {\r\n nAdd = 10;\r\n nSub = 10;\r\n additions: string[] = [];\r\n subtractions: string[] = [];\r\n multiplications: string[] = [];\r\n divisions: string[] = [];\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {\r\n this.getAdditions();\r\n this.getSubtractions();\r\n this.getMultiplications();\r\n this.getDivisions();\r\n }\r\n\r\n getAdditions() {\r\n const max = 1000;\r\n const min = 10;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n this.additions.push(`${a} + ${b}`);\r\n }\r\n }\r\n\r\n getSubtractions() {\r\n const max = 1000;\r\n const min = 10;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n let s = a > b ? `${a} - ${b}` : `${b} - ${a}`;\r\n this.subtractions.push(s);\r\n }\r\n }\r\n\r\n getMultiplications() {\r\n const max = 200;\r\n const min = 1;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n this.multiplications.push(`${a} × ${b}`);\r\n }\r\n }\r\n\r\n getDivisions() {\r\n const max = 100;\r\n const min = 1;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n this.divisions.push(`${a * b} ÷ ${b}`);\r\n }\r\n }\r\n\r\n private randomIntBetween(min: number, max: number): number {\r\n return ~~(Math.random() * (max - min + 1) + min);\r\n }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-math2',\r\n templateUrl: './math2.component.html',\r\n styleUrls: ['./math2.component.css', '../math1/math1.component.css'],\r\n})\r\nexport class Math2Component implements OnInit {\r\n frac = `\r\n\r\n numerator1\r\n denominator1\r\n\r\n=\r\n?\r\n\r\n `;\r\n mathml = `\r\n\r\n numerator1\r\n denominator1\r\n\r\noperator\r\n\r\n numerator2\r\n denominator2\r\n\r\n=\r\n?\r\n\r\n `;\r\n nAdd = 10;\r\n nSub = 10;\r\n fracSimp = '';\r\n additions1 = '';\r\n additions2 = '';\r\n multiplications = '';\r\n constructor() {}\r\n\r\n ngOnInit(): void {\r\n this.getSimplifications();\r\n this.getAdditions1();\r\n this.getAdditions2();\r\n }\r\n getSimplifications() {\r\n const max = 20;\r\n const min = 1;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n let c = this.randomIntBetween(min, max);\r\n\r\n this.fracSimp = this.fracSimp.concat(`\r\n\r\n ${a * c}\r\n ${b * c}\r\n\r\n=\r\n?\r\n`);\r\n }\r\n this.fracSimp = this.fracSimp.concat('');\r\n }\r\n getAdditions1() {\r\n const max = 10;\r\n const min = 1;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n let c = this.randomIntBetween(min, max);\r\n let d = this.randomIntBetween(min, max);\r\n this.additions1 = this.additions1.concat(`\r\n\r\n ${a}\r\n ${b}\r\n\r\n+\r\n\r\n ${c}\r\n ${d}\r\n\r\n=\r\n?\r\n`);\r\n this.multiplications = this.multiplications\r\n .concat(`\r\n\r\n ${a}\r\n ${b}\r\n\r\n×\r\n\r\n ${c}\r\n ${d}\r\n\r\n=\r\n?\r\n`);\r\n }\r\n this.additions1 = this.additions1.concat('');\r\n this.multiplications = this.multiplications.concat('');\r\n }\r\n getAdditions2() {\r\n const max = 25;\r\n const min = 1;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n let a = this.randomIntBetween(min, max);\r\n let b = this.randomIntBetween(min, max);\r\n let c = this.randomIntBetween(min, max);\r\n let d = this.randomIntBetween(min, max);\r\n this.additions2 = this.additions2.concat(`\r\n\r\n ${a}\r\n ${b}\r\n\r\n+\r\n\r\n ${c}\r\n ${d}\r\n\r\n=\r\n?\r\n`);\r\n }\r\n this.additions2 = this.additions2.concat('');\r\n }\r\n\r\n private randomIntBetween(min: number, max: number): number {\r\n return ~~(Math.random() * (max - min + 1) + min);\r\n }\r\n}\r\n","

Fractions

\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n","

Four Operations

\r\n\r\n
\r\n
\r\n

\r\n
\r\n
\r\n

\r\n
\r\n
\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-math3',\r\n templateUrl: './math3.component.html',\r\n styleUrls: ['./math3.component.css', '../math1/math1.component.css'],\r\n})\r\nexport class Math3Component implements OnInit {\r\n nAdd = 10;\r\n nSub = 10;\r\n list1: string[] = [];\r\n list2: string[] = [];\r\n operators = ['+', '-', '×', '÷'];\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {\r\n this.getLists();\r\n }\r\n\r\n getLists() {\r\n const max = 200;\r\n const min = 1;\r\n for (let i = 0; i < this.nAdd; i++) {\r\n const a = this.randomIntBetween(min, max);\r\n const op1 = this.randomOperator();\r\n const b = this.randomIntBetween(min, max);\r\n const op2 = this.randomOperator();\r\n const f = this.randomIntBetween(1, 10);\r\n const c = this.randomIntBetween(min, max);\r\n const op3 = this.randomOperator();\r\n const d = this.randomIntBetween(min, max);\r\n this.list1.push(`(${a} ${op1} ${b}) ${op2} (${c} ${op3} ${d})`);\r\n this.list2.push(\r\n `(${d} ${op1} ${b}) ${op2} ${f} × (${a} ${op3} ${c})`\r\n );\r\n }\r\n }\r\n\r\n private randomIntBetween(min: number, max: number): number {\r\n return ~~(Math.random() * (max - min + 1) + min);\r\n }\r\n private randomOperator(): string {\r\n return this.operators[~~(Math.random() * 4)];\r\n }\r\n}\r\n","import {\r\n Directive,\r\n OnChanges,\r\n OnInit,\r\n Input,\r\n ElementRef,\r\n SimpleChanges,\r\n NgZone,\r\n} from '@angular/core';\r\nimport { MathService } from './math.service';\r\n\r\n@Directive({\r\n selector: '[appMath]',\r\n})\r\nexport class MathDirective implements OnInit, OnChanges {\r\n @Input() appMath = '';\r\n private readonly el: HTMLElement;\r\n\r\n constructor(\r\n private svc: MathService,\r\n elementRef: ElementRef,\r\n private ngZone: NgZone\r\n ) {\r\n this.el = elementRef.nativeElement;\r\n }\r\n\r\n ngOnInit() {\r\n this.render();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes && changes['appMath'] && changes['appMath'].currentValue) {\r\n this.render();\r\n }\r\n }\r\n\r\n private render() {\r\n this.ngZone.runOutsideAngular(() => {\r\n this.svc\r\n .registerMathJax()\r\n .subscribe(() => this.svc.render(this.el, this.appMath));\r\n });\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { MathDirective } from './math.directive';\r\nimport { MathService } from './math.service';\r\n\r\n@NgModule({\r\n declarations: [MathDirective],\r\n exports: [MathDirective],\r\n providers: [MathService],\r\n})\r\nexport class MathModule {}\r\n","import { DOCUMENT } from '@angular/common';\r\nimport { Inject, Injectable } from '@angular/core';\r\nimport { ReplaySubject, Observable } from 'rxjs';\r\n\r\ndeclare global {\r\n interface Window {\r\n MathJax: {\r\n typesetPromise: () => void;\r\n startup: {\r\n promise: Promise;\r\n };\r\n };\r\n }\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class MathService {\r\n private loaded$: ReplaySubject;\r\n private readonly source =\r\n 'https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/mml-chtml.js';\r\n private readonly integrity =\r\n 'sha256-CnzfCXjFj1REmPHgWvm/OQv8gFaxwbLKUi41yCU7N2s=';\r\n\r\n constructor(@Inject(DOCUMENT) private readonly document: Document) {}\r\n\r\n registerMathJax(): Observable {\r\n if (this.loaded$) {\r\n return this.loaded$.asObservable();\r\n }\r\n\r\n this.loaded$ = new ReplaySubject();\r\n\r\n const script = this.document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = this.source;\r\n script.integrity = this.integrity;\r\n script.async = true;\r\n script.crossOrigin = 'anonymous';\r\n script.onload = () => {\r\n this.loaded$.next(true);\r\n this.loaded$.complete();\r\n };\r\n\r\n this.document.head.appendChild(script);\r\n\r\n return this.loaded$.asObservable();\r\n }\r\n\r\n render(element: HTMLElement, math: string) {\r\n // Take initial typesetting which MathJax performs into account\r\n window.MathJax.startup.promise.then(() => {\r\n element.innerHTML = math;\r\n window.MathJax.typesetPromise();\r\n });\r\n }\r\n}\r\n","import { Component, OnInit, AfterViewInit, HostListener } from '@angular/core';\r\nimport { Cell, Maze, keyboardMap } from './models';\r\nimport { environment } from 'src/environments/environment';\r\n\r\n@Component({\r\n selector: 'app-maze',\r\n templateUrl: './maze.component.html',\r\n styleUrls: ['./maze.component.css']\r\n})\r\nexport class MazeComponent implements OnInit, AfterViewInit {\r\n row = 15;\r\n col = 15;\r\n private maze: Maze;\r\n private canvas: HTMLCanvasElement;\r\n private ctx: CanvasRenderingContext2D;\r\n private readonly cellSize = 20; // length of cell edge\r\n private readonly cellEdgeThickness = 2; // thickness of cell edge\r\n private readonly cellBackground = '#FFFFFF';\r\n private readonly solutionPathColor = '#FF7575';\r\n private readonly myPathColor = '#4080FF';\r\n private readonly myPathThickness = 10;\r\n private readonly solutionPathThickness = 3;\r\n private gameOver = false;\r\n private myPath: Cell[] = [];\r\n private currentCell: Cell;\r\n showTestButton = false;\r\n busy = false;\r\n\r\n constructor() {\r\n if (!environment.production) {\r\n this.showTestButton = true;\r\n }\r\n }\r\n\r\n ngOnInit() {}\r\n\r\n ngAfterViewInit() {\r\n this.canvas = document.getElementById('maze');\r\n this.ctx = this.canvas.getContext('2d');\r\n this.drawMaze();\r\n }\r\n\r\n drawMaze() {\r\n this.busy = true;\r\n this.validateInputs();\r\n\r\n this.maze = new Maze(this.row, this.col);\r\n this.canvas.width = this.col * this.cellSize;\r\n this.canvas.height = this.row * this.cellSize;\r\n\r\n // open the first and last cells to show the entrance and exit\r\n this.maze.firstCell.westEdge = false;\r\n this.maze.lastCell.eastEdge = false;\r\n\r\n // draw the cells\r\n this.ctx.lineWidth = this.cellEdgeThickness;\r\n this.ctx.fillStyle = this.cellBackground;\r\n this.maze.cells.forEach(x => x.forEach(c => this.draw(c)));\r\n\r\n this.initPlay();\r\n this.busy = false;\r\n }\r\n\r\n initPlay() {\r\n this.gameOver = false;\r\n this.myPath.length = 0;\r\n this.currentCell = this.maze.firstCell; // reset myPath position\r\n this.myPath.push(this.currentCell);\r\n\r\n // draw the initial step of myPath in the first Cell as entrance\r\n this.ctx.lineWidth = this.myPathThickness;\r\n this.ctx.strokeStyle = this.myPathColor;\r\n this.ctx.beginPath();\r\n this.ctx.moveTo(0, this.cellSize / 2);\r\n this.ctx.lineTo(this.cellSize / 2, this.cellSize / 2);\r\n this.ctx.stroke();\r\n }\r\n\r\n @HostListener('document:keydown', ['$event'])\r\n handleKeyDown(event: KeyboardEvent) {\r\n if (this.gameOver) return;\r\n const direction = keyboardMap[event.key];\r\n if (direction) {\r\n this.move(direction);\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n move(direction: 'Left' | 'Right' | 'Up' | 'Down') {\r\n let nextCell: Cell;\r\n if (direction === 'Left') {\r\n if (this.currentCell.col < 1) return;\r\n nextCell = this.maze.cells[this.currentCell.row][\r\n this.currentCell.col - 1\r\n ];\r\n }\r\n if (direction === 'Right') {\r\n if (this.currentCell.col + 1 >= this.col) return;\r\n nextCell = this.maze.cells[this.currentCell.row][\r\n this.currentCell.col + 1\r\n ];\r\n }\r\n if (direction === 'Up') {\r\n if (this.currentCell.row < 1) return;\r\n nextCell = this.maze.cells[this.currentCell.row - 1][\r\n this.currentCell.col\r\n ];\r\n }\r\n if (direction === 'Down') {\r\n if (this.currentCell.row + 1 >= this.row) return;\r\n nextCell = this.maze.cells[this.currentCell.row + 1][\r\n this.currentCell.col\r\n ];\r\n }\r\n\r\n if (this.currentCell.isConnectedTo(nextCell)) {\r\n if (\r\n this.myPath.length > 1 &&\r\n this.myPath[this.myPath.length - 2].equals(nextCell)\r\n ) {\r\n // this is a step back; reverse the step by erasing the original path\r\n this.drawPath(this.myPath, this.cellBackground);\r\n this.myPath.pop();\r\n } else {\r\n this.myPath.push(nextCell);\r\n if (nextCell.equals(this.maze.lastCell)) {\r\n this.hooray();\r\n this.drawSolution(this.myPathColor, this.myPathThickness);\r\n return;\r\n }\r\n }\r\n\r\n this.drawPath(this.myPath);\r\n this.currentCell = nextCell;\r\n }\r\n }\r\n\r\n undo(nSteps = 5) {\r\n if (!this.gameOver && this.myPath.length > nSteps) {\r\n this.drawPath(this.myPath, this.cellBackground);\r\n this.myPath.splice(-nSteps);\r\n this.drawPath(this.myPath);\r\n this.currentCell = this.myPath[this.myPath.length - 1];\r\n }\r\n }\r\n\r\n drawSolution(\r\n color = this.solutionPathColor,\r\n lineThickness = this.solutionPathThickness\r\n ) {\r\n this.gameOver = true;\r\n this.drawPath(this.maze.findPath(), color, lineThickness, true);\r\n }\r\n\r\n private drawPath(\r\n path: Cell[],\r\n color = this.myPathColor,\r\n lineThickness = this.myPathThickness,\r\n drawSolution = false\r\n ) {\r\n this.ctx.lineWidth = lineThickness;\r\n this.ctx.strokeStyle = color;\r\n this.ctx.beginPath();\r\n this.ctx.moveTo(0, this.cellSize / 2);\r\n\r\n path.forEach(x =>\r\n this.ctx.lineTo(\r\n (x.col + 0.5) * this.cellSize,\r\n (x.row + 0.5) * this.cellSize\r\n )\r\n );\r\n if (drawSolution) {\r\n this.ctx.lineTo(\r\n this.col * this.cellSize,\r\n (this.row - 0.5) * this.cellSize\r\n );\r\n }\r\n this.ctx.stroke();\r\n }\r\n\r\n private draw(cell: Cell) {\r\n this.ctx.fillRect(\r\n cell.col * this.cellSize,\r\n cell.row * this.cellSize,\r\n (cell.col + 1) * this.cellSize,\r\n (cell.row + 1) * this.cellSize\r\n );\r\n if (cell.northEdge) {\r\n this.ctx.beginPath();\r\n this.ctx.moveTo(cell.col * this.cellSize, cell.row * this.cellSize);\r\n this.ctx.lineTo((cell.col + 1) * this.cellSize, cell.row * this.cellSize);\r\n this.ctx.stroke();\r\n }\r\n if (cell.eastEdge) {\r\n this.ctx.beginPath();\r\n this.ctx.moveTo((cell.col + 1) * this.cellSize, cell.row * this.cellSize);\r\n this.ctx.lineTo(\r\n (cell.col + 1) * this.cellSize,\r\n (cell.row + 1) * this.cellSize\r\n );\r\n this.ctx.stroke();\r\n }\r\n if (cell.southEdge) {\r\n this.ctx.beginPath();\r\n this.ctx.moveTo(\r\n (cell.col + 1) * this.cellSize,\r\n (cell.row + 1) * this.cellSize\r\n );\r\n this.ctx.lineTo(cell.col * this.cellSize, (cell.row + 1) * this.cellSize);\r\n this.ctx.stroke();\r\n }\r\n if (cell.westEdge) {\r\n this.ctx.beginPath();\r\n this.ctx.moveTo(cell.col * this.cellSize, (cell.row + 1) * this.cellSize);\r\n this.ctx.lineTo(cell.col * this.cellSize, cell.row * this.cellSize);\r\n this.ctx.stroke();\r\n }\r\n }\r\n\r\n private hooray() {\r\n var audio = new Audio('assets/KidsCheering.mp3');\r\n audio.play();\r\n }\r\n\r\n private validateInputs() {\r\n if (isNaN(this.row) || this.row < 1) {\r\n alert('Please enter a positive number for #Rows.');\r\n this.row = 15;\r\n }\r\n if (isNaN(this.col) || this.col < 1) {\r\n alert('Please enter a positive number for #Columns.');\r\n this.col = 15;\r\n }\r\n if (this.row > 500 || this.col > 500) {\r\n alert('Size too large. You may crash the browser...');\r\n this.row = 15;\r\n this.col = 15;\r\n }\r\n this.row = ~~this.row;\r\n this.col = ~~this.col;\r\n }\r\n\r\n test() {\r\n this.busy = true;\r\n const cellsHaveFourEdges: Cell[] = [];\r\n let hasLoop = false;\r\n const size = 50;\r\n for (let i = 0; i < 100; i++) {\r\n const maze = new Maze(size, size);\r\n maze.cells.forEach(row =>\r\n row.forEach(c => {\r\n if (c.nEdges === 4) {\r\n cellsHaveFourEdges.push(c);\r\n }\r\n if (c.col < size - 1 && c.row < size - 1) {\r\n if (!c.eastEdge && !c.southEdge) {\r\n const cellOnTheRight = maze.cells[c.row][c.col + 1];\r\n if (!cellOnTheRight.southEdge) {\r\n const cellBelow = maze.cells[c.row + 1][c.col];\r\n if (!cellBelow.eastEdge) {\r\n hasLoop = true;\r\n }\r\n }\r\n }\r\n }\r\n })\r\n );\r\n if (cellsHaveFourEdges.length) {\r\n alert('dead loop');\r\n break;\r\n }\r\n if (hasLoop) {\r\n alert('open loop');\r\n break;\r\n }\r\n }\r\n\r\n console.log(`testing has finished`);\r\n this.busy = false;\r\n }\r\n}\r\n","
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Test\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
⬆️
\r\n
\r\n ⬅️\r\n \r\n ➡️\r\n
\r\n
⬇️
\r\n
\r\n
\r\n
\r\n","/**\r\n *\r\n */\r\nexport class Cell {\r\n northEdge: boolean = true;\r\n eastEdge: boolean = true;\r\n westEdge: boolean = true;\r\n southEdge: boolean = true;\r\n neighbors: Cell[] = [];\r\n\r\n /**\r\n * a flag used to indicate if the cell has been traversed or not when finding a maze path\r\n */\r\n traversed: boolean = false;\r\n\r\n /**\r\n * a flag used to indicate if the cell has been visited or not when hunt-and-kill\r\n */\r\n visited: boolean = false;\r\n\r\n /**\r\n * The number of Edges in this cell.\r\n * The nEdges counts all four edges. If an edge is false, then 0.\r\n */\r\n get nEdges(): number {\r\n return (\r\n (this.northEdge ? 1 : 0) +\r\n (this.southEdge ? 1 : 0) +\r\n (this.westEdge ? 1 : 0) +\r\n (this.eastEdge ? 1 : 0)\r\n );\r\n }\r\n\r\n /**\r\n * Create a cell in a maze.\r\n * @param row rowID of the cell in a maze. integer, row>=0\r\n * @param col colID of the cell in a maze. integer, col>=0\r\n */\r\n constructor(\r\n public readonly row: number = 0,\r\n public readonly col: number = 0\r\n ) {}\r\n\r\n connectTo(another: Cell) {\r\n if (!another) return;\r\n if (this.row === another.row) {\r\n if (this.col - 1 === another.col) {\r\n this.westEdge = false;\r\n another.eastEdge = false;\r\n } else if (this.col + 1 === another.col) {\r\n this.eastEdge = false;\r\n another.westEdge = false;\r\n } else {\r\n return;\r\n }\r\n } else if (this.col === another.col) {\r\n if (this.row - 1 === another.row) {\r\n this.northEdge = false;\r\n another.southEdge = false;\r\n } else if (this.row + 1 === another.row) {\r\n this.southEdge = false;\r\n another.northEdge = false;\r\n } else {\r\n return;\r\n }\r\n } else {\r\n return;\r\n }\r\n this.visited = true;\r\n another.visited = true;\r\n }\r\n\r\n equals(another: Cell): boolean {\r\n return this.row === another.row && this.col === another.col;\r\n }\r\n\r\n isConnectedTo(another: Cell): boolean {\r\n if (this.row === another.row) {\r\n if (this.col - 1 === another.col) {\r\n if (this.westEdge === false && another.eastEdge === false) {\r\n return true;\r\n }\r\n }\r\n if (this.col + 1 === another.col) {\r\n if (this.eastEdge === false && another.westEdge === false) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (this.col === another.col) {\r\n if (this.row - 1 === another.row) {\r\n if (this.northEdge === false && another.southEdge === false) {\r\n return true;\r\n }\r\n }\r\n if (this.row + 1 === another.row) {\r\n if (this.southEdge === false && another.northEdge === false) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\n","export { Cell } from './cell';\r\nexport { Maze } from './maze';\r\nexport { keyboardMap } from './keyboard-map';\r\n","export const keyboardMap = {\r\n ArrowLeft: 'Left',\r\n A: 'Left',\r\n a: 'Left',\r\n ArrowRight: 'Right',\r\n D: 'Right',\r\n d: 'Right',\r\n ArrowUp: 'Up',\r\n W: 'Up',\r\n w: 'Up',\r\n ArrowDown: 'Down',\r\n S: 'Down',\r\n s: 'Down',\r\n};\r\n","import { Cell } from './cell';\r\n\r\n/**\r\n * A rectangle maze generated based on \"hunt-and-kill\" algorithm.\r\n */\r\nexport class Maze {\r\n public readonly cells: Cell[][] = [];\r\n private readonly randomRowNumbers: number[];\r\n private readonly randomColNumbers: number[];\r\n\r\n /**\r\n * Create a maze with × cells.\r\n * @param nRow number of rows\r\n * @param nCol number of columns\r\n */\r\n constructor(public nRow: number, public nCol: number) {\r\n // initialize cells\r\n for (let i = 0; i < nRow; i++) {\r\n this.cells[i] = [];\r\n for (let j = 0; j < nCol; j++) {\r\n this.cells[i][j] = new Cell(i, j);\r\n }\r\n }\r\n // populate cell neighbors (an optimization)\r\n this.cells.forEach(row => row.forEach(c => this.mapNeighbors(c)));\r\n\r\n // generate maze\r\n this.randomRowNumbers = Utils.shuffleArray([...Array(this.nRow).keys()]);\r\n this.randomColNumbers = Utils.shuffleArray([...Array(this.nCol).keys()]);\r\n this.huntAndKill();\r\n }\r\n\r\n get firstCell(): Cell {\r\n return this.cells[0][0];\r\n }\r\n\r\n get lastCell(): Cell {\r\n return this.cells[this.nRow - 1][this.nCol - 1];\r\n }\r\n\r\n get randomCell(): Cell {\r\n return this.cells[Utils.random(this.nRow)][Utils.random(this.nCol)];\r\n }\r\n\r\n /**\r\n * traverse the maze using depth-first algorithm\r\n */\r\n findPath(): Cell[] {\r\n this.cells.forEach(x => x.forEach(c => (c.traversed = false)));\r\n const path: Cell[] = [this.firstCell];\r\n\r\n while (1) {\r\n let current = path[0];\r\n current.traversed = true;\r\n\r\n if (current.equals(this.lastCell)) {\r\n break;\r\n }\r\n\r\n const traversableNeighbors = current.neighbors\r\n .filter(c => c.isConnectedTo(current))\r\n .filter(c => !c.traversed);\r\n if (traversableNeighbors.length) {\r\n path.unshift(traversableNeighbors[0]);\r\n } else {\r\n path.splice(0, 1);\r\n }\r\n }\r\n\r\n return path.reverse();\r\n }\r\n\r\n private huntAndKill() {\r\n let current = this.randomCell; // hunt-and-kill starts from a random Cell\r\n while (current) {\r\n this.kill(current);\r\n current = this.hunt();\r\n }\r\n }\r\n private kill(current: Cell) {\r\n while (current) {\r\n const next = current.neighbors.find(c => !c.visited);\r\n if (next) {\r\n current.connectTo(next);\r\n }\r\n current = next;\r\n }\r\n }\r\n private hunt(): Cell {\r\n for (let huntRow of this.randomRowNumbers) {\r\n for (let huntColumn of this.randomColNumbers) {\r\n const cell = this.cells[huntRow][huntColumn];\r\n if (cell.visited) {\r\n continue;\r\n }\r\n const next = cell.neighbors.find(c => c.visited);\r\n if (next) {\r\n cell.connectTo(next);\r\n return cell;\r\n }\r\n }\r\n }\r\n }\r\n\r\n private mapNeighbors(cell: Cell): void {\r\n if (cell.row - 1 >= 0) {\r\n cell.neighbors.push(this.cells[cell.row - 1][cell.col]);\r\n }\r\n if (cell.row + 1 < this.nRow) {\r\n cell.neighbors.push(this.cells[cell.row + 1][cell.col]);\r\n }\r\n if (cell.col - 1 >= 0) {\r\n cell.neighbors.push(this.cells[cell.row][cell.col - 1]);\r\n }\r\n if (cell.col + 1 < this.nCol) {\r\n cell.neighbors.push(this.cells[cell.row][cell.col + 1]);\r\n }\r\n cell.neighbors = Utils.shuffleArray(cell.neighbors);\r\n }\r\n}\r\n\r\nclass Utils {\r\n /**\r\n * The de-facto unbiased shuffle algorithm is the Fisher-Yates (aka Knuth) Shuffle.\r\n */\r\n static shuffleArray(array: any[]): any[] {\r\n for (let i = array.length - 1; i > 0; i--) {\r\n const temp = ~~(Math.random() * (i + 1));\r\n [array[i], array[temp]] = [array[temp], array[i]];\r\n }\r\n return array;\r\n }\r\n\r\n /**\r\n * Generate a random index within a number `n`\r\n */\r\n static random(n: number): number {\r\n return ~~(Math.random() * n);\r\n }\r\n}\r\n","import { Component, OnInit, AfterViewInit, Inject } from '@angular/core';\r\nimport { ImageTile } from '../models';\r\n\r\n@Component({\r\n selector: 'app-image-tiles',\r\n templateUrl: './image-tiles.component.html',\r\n styleUrls: ['./image-tiles.component.css']\r\n})\r\nexport class ImageTilesComponent implements OnInit, AfterViewInit {\r\n private canvas: HTMLCanvasElement;\r\n private ctx: CanvasRenderingContext2D;\r\n private tileCountX = 3;\r\n private canvasSize: number;\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {\r\n this.canvasSize = 540;\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.canvas = document.getElementById('canvas');\r\n this.ctx = this.canvas.getContext('2d');\r\n this.canvas.style.width = `${this.canvasSize}px`;\r\n this.canvas.style.height = `${this.canvasSize}px`;\r\n this.canvas.width = this.canvas.offsetWidth;\r\n this.canvas.height = this.canvas.offsetHeight;\r\n }\r\n\r\n upload(files: FileList): void {\r\n if (files.length === 0) {\r\n return;\r\n }\r\n const reader = new FileReader();\r\n reader.readAsDataURL(files[0]);\r\n reader.onload = () => {\r\n const img = new Image();\r\n img.src = reader.result.toString();\r\n img.onload = () => {\r\n //start\r\n const tiles = this.getTiles(img);\r\n this.drawTiles(tiles);\r\n };\r\n };\r\n }\r\n getTiles(img: HTMLImageElement): ImageTile[] {\r\n if (img.width < this.canvasSize || img.height < this.canvasSize) {\r\n throw new Error('Image Size too small.');\r\n }\r\n\r\n const imgData = this.resizeImage(img, this.canvasSize, this.canvasSize);\r\n const imgSize =\r\n imgData.width > imgData.height ? imgData.height : imgData.width;\r\n const pixelRows = [];\r\n const data = Array.from(imgData.data);\r\n while (data.length > 0) {\r\n pixelRows.push(data.splice(0, imgData.width * 4));\r\n }\r\n const tiles: ImageTile[] = [];\r\n const tileSize = ~~(imgSize / this.tileCountX);\r\n for (let i = 0; i < this.tileCountX * this.tileCountX; i++) {\r\n const x = i % this.tileCountX;\r\n const y = ~~(i / this.tileCountX);\r\n let tileDataRows: any[] = [];\r\n for (let row = y * tileSize; row < tileSize * (y + 1); row++) {\r\n tileDataRows = tileDataRows.concat(\r\n pixelRows[row].slice(tileSize * x * 4, tileSize * (x + 1) * 4)\r\n );\r\n }\r\n tiles.push({\r\n id: i,\r\n x: i % this.tileCountX,\r\n y: ~~(i / this.tileCountX),\r\n data: new Uint8ClampedArray(tileDataRows)\r\n });\r\n }\r\n\r\n return tiles;\r\n }\r\n drawTiles(tiles: ImageTile[]) {\r\n const offset = 1;\r\n for (const tile of tiles) {\r\n this.ctx.putImageData(\r\n new ImageData(\r\n tile.data,\r\n this.canvasSize / this.tileCountX,\r\n this.canvasSize / this.tileCountX\r\n ),\r\n tile.x * 180 * offset,\r\n tile.y * 180 * offset\r\n );\r\n }\r\n }\r\n\r\n resizeImage(\r\n img: HTMLImageElement,\r\n width: number = 1080,\r\n height: number = 1080\r\n ): ImageData {\r\n if (img.height < img.width) {\r\n width = Math.floor(height * (img.width / img.height));\r\n } else {\r\n height = Math.floor(width * (img.height / img.width));\r\n }\r\n let resizingCanvas: HTMLCanvasElement = (\r\n document.createElement('canvas')\r\n );\r\n let resizingCanvasContext = resizingCanvas.getContext('2d');\r\n resizingCanvas.width = img.width;\r\n resizingCanvas.height = img.height;\r\n resizingCanvasContext.drawImage(\r\n img,\r\n 0,\r\n 0,\r\n resizingCanvas.width,\r\n resizingCanvas.height\r\n );\r\n let curImageDimensions = {\r\n width: Math.floor(img.width),\r\n height: Math.floor(img.height)\r\n };\r\n\r\n let halfImageDimensions = {\r\n width: null,\r\n height: null\r\n };\r\n while (curImageDimensions.width * 0.5 > width) {\r\n // Reduce the resizing canvas by half and refresh the image\r\n halfImageDimensions.width = Math.floor(curImageDimensions.width * 0.5);\r\n halfImageDimensions.height = Math.floor(curImageDimensions.height * 0.5);\r\n\r\n resizingCanvasContext.drawImage(\r\n resizingCanvas,\r\n 0,\r\n 0,\r\n curImageDimensions.width,\r\n curImageDimensions.height,\r\n 0,\r\n 0,\r\n halfImageDimensions.width,\r\n halfImageDimensions.height\r\n );\r\n\r\n curImageDimensions.width = halfImageDimensions.width;\r\n curImageDimensions.height = halfImageDimensions.height;\r\n }\r\n let outputCanvas: HTMLCanvasElement = (\r\n document.createElement('canvas')\r\n );\r\n let outputCanvasContext = outputCanvas.getContext('2d');\r\n\r\n outputCanvas.width = width;\r\n outputCanvas.height = height;\r\n\r\n outputCanvasContext.drawImage(\r\n resizingCanvas,\r\n 0,\r\n 0,\r\n curImageDimensions.width,\r\n curImageDimensions.height,\r\n 0,\r\n 0,\r\n width,\r\n height\r\n );\r\n const imageData = outputCanvasContext.getImageData(0, 0, width, height);\r\n // outputCanvasContext.clearRect(0, 0, outputCanvas.width, outputCanvas.height);\r\n return imageData;\r\n }\r\n}\r\n","\r\n
\r\n \r\n
\r\n","import { Component, OnInit, NgModule, ViewChild } from '@angular/core';\r\nimport {\r\n CdkDrag,\r\n CdkDragStart,\r\n CdkDropList,\r\n CdkDropListGroup,\r\n CdkDragMove,\r\n CdkDragEnter,\r\n CdkDragDrop,\r\n moveItemInArray\r\n} from '@angular/cdk/drag-drop';\r\nimport { ViewportRuler } from '@angular/cdk/overlay';\r\n\r\n@Component({\r\n selector: 'app-scramble-squares',\r\n templateUrl: './scramble-squares.component.html',\r\n styleUrls: ['./scramble-squares.component.css']\r\n})\r\nexport class ScrambleSquaresComponent implements OnInit {\r\n @ViewChild(CdkDropListGroup) listGroup: CdkDropListGroup;\r\n @ViewChild(CdkDropList) placeholder: CdkDropList;\r\n\r\n items: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9];\r\n\r\n target: CdkDropList;\r\n targetIndex: number;\r\n source: CdkDropList;\r\n sourceIndex: number;\r\n dragIndex: number;\r\n activeContainer;\r\n\r\n constructor(private viewportRuler: ViewportRuler) {\r\n this.target = null;\r\n this.source = null;\r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n ngAfterViewInit() {\r\n let phElement = this.placeholder.element.nativeElement;\r\n\r\n phElement.style.display = 'none';\r\n phElement.parentElement.removeChild(phElement);\r\n }\r\n\r\n add() {\r\n this.items.push(this.items.length + 1);\r\n }\r\n\r\n shuffle() {\r\n this.items.sort(() => 0.5 - Math.random());\r\n }\r\n\r\n dragMoved(e: CdkDragMove) {\r\n let point = this.getPointerPositionOnPage(e.event);\r\n\r\n this.listGroup._items.forEach(dropList => {\r\n if (__isInsideDropListClientRect(dropList, point.x, point.y)) {\r\n this.activeContainer = dropList;\r\n return;\r\n }\r\n });\r\n }\r\n\r\n dropListDropped(event: CdkDragDrop) {\r\n if (!this.target) return;\r\n\r\n let phElement = this.placeholder.element.nativeElement;\r\n let parent = phElement.parentElement;\r\n\r\n phElement.style.display = 'none';\r\n\r\n parent.removeChild(phElement);\r\n parent.appendChild(phElement);\r\n parent.insertBefore(\r\n this.source.element.nativeElement,\r\n parent.children[this.sourceIndex]\r\n );\r\n\r\n this.target = null;\r\n this.source = null;\r\n\r\n if (this.sourceIndex != this.targetIndex)\r\n moveItemInArray(this.items, this.sourceIndex, this.targetIndex);\r\n }\r\n\r\n dropListEnterPredicate = (drag: CdkDrag, drop: CdkDropList) => {\r\n if (drop == this.placeholder) return true;\r\n\r\n if (drop != this.activeContainer) return false;\r\n\r\n let phElement = this.placeholder.element.nativeElement;\r\n let sourceElement = drag.dropContainer.element.nativeElement;\r\n let dropElement = drop.element.nativeElement;\r\n\r\n let dragIndex = __indexOf(\r\n dropElement.parentElement.children,\r\n this.source ? phElement : sourceElement\r\n );\r\n let dropIndex = __indexOf(dropElement.parentElement.children, dropElement);\r\n\r\n if (!this.source) {\r\n this.sourceIndex = dragIndex;\r\n this.source = drag.dropContainer;\r\n\r\n phElement.style.width = sourceElement.clientWidth + 'px';\r\n phElement.style.height = sourceElement.clientHeight + 'px';\r\n\r\n sourceElement.parentElement.removeChild(sourceElement);\r\n }\r\n\r\n this.targetIndex = dropIndex;\r\n this.target = drop;\r\n\r\n phElement.style.display = '';\r\n dropElement.parentElement.insertBefore(\r\n phElement,\r\n dropIndex > dragIndex ? dropElement.nextSibling : dropElement\r\n );\r\n\r\n // this.placeholder.enter(\r\n // drag,\r\n // drag.element.nativeElement.offsetLeft,\r\n // drag.element.nativeElement.offsetTop\r\n // );\r\n return false;\r\n };\r\n\r\n /** Determines the point of the page that was touched by the user. */\r\n getPointerPositionOnPage(event: MouseEvent | TouchEvent) {\r\n // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.\r\n const point = __isTouchEvent(event)\r\n ? event.touches[0] || event.changedTouches[0]\r\n : event;\r\n const scrollPosition = this.viewportRuler.getViewportScrollPosition();\r\n\r\n return {\r\n x: point.pageX - scrollPosition.left,\r\n y: point.pageY - scrollPosition.top\r\n };\r\n }\r\n}\r\n\r\nfunction __indexOf(collection, node) {\r\n return Array.prototype.indexOf.call(collection, node);\r\n}\r\n\r\n/** Determines whether an event is a touch event. */\r\nfunction __isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent {\r\n return event.type.startsWith('touch');\r\n}\r\n\r\nfunction __isInsideDropListClientRect(\r\n dropList: CdkDropList,\r\n x: number,\r\n y: number\r\n) {\r\n const {\r\n top,\r\n bottom,\r\n left,\r\n right\r\n } = dropList.element.nativeElement.getBoundingClientRect();\r\n return y >= top && y <= bottom && x >= left && x <= right;\r\n}\r\n","

Drag&Drop with a flex-wrap

\r\n\r\n\r\n
\r\n
    \r\n
  • {{ item }}
  • \r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n {{item}}\r\n
\r\n \r\n\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-squares',\r\n templateUrl: './squares.component.html',\r\n styleUrls: ['./squares.component.css']\r\n})\r\nexport class SquaresComponent implements OnInit {\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n}\r\n","\r\n","// This file can be replaced during build by using the `fileReplacements` array.\r\n// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.\r\n// The list of file replacements can be found in `angular.json`.\r\n\r\nexport const environment = {\r\n production: false\r\n};\r\n\r\n/*\r\n * For easier debugging in development mode, you can import the following file\r\n * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.\r\n *\r\n * This import should be commented out in production mode because it will have a negative impact\r\n * on performance if an error is thrown.\r\n */\r\n// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.\r\n","import { enableProdMode } from '@angular/core';\r\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\n\r\nimport { AppModule } from './app/app.module';\r\nimport { environment } from './environments/environment';\r\n\r\nif (environment.production) {\r\n enableProdMode();\r\n}\r\n\r\nplatformBrowserDynamic().bootstrapModule(AppModule)\r\n .catch(err => console.error(err));\r\n"],"names":["AppComponent","selectors","decls","vars","consts","template","i0","BrowserModule","FormsModule","DragDropModule","RouterModule","MazeComponent","CandyComponent","CanvasComponent","ScrambleSquaresComponent","SquaresComponent","ImageTilesComponent","Math1Component","EightPuzzleComponent","EightPuzzleTileComponent","Math2Component","MathModule","Math3Component","AppModule","bootstrap","forRoot","path","redirectTo","pathMatch","component","declarations","imports","constructor","ngOnInit","draw","c","name","viewQuery","ctx","Position","CandyText","ngAfterViewInit","canvas","document","getElementById","getContext","style","width","height","offsetWidth","offsetHeight","candy","particles","length","getParticles","drawBackground","forEach","p","calculateMouseRelativePositionInCanvas","e","mousePosition","x","clientX","documentElement","scrollLeft","body","offsetLeft","y","clientY","scrollTop","offsetTop","startAnimation","raf","window","requestAnimationFrame","animate","continueAnimating","filter","isInCanvas","flyAwayWhenMouseOver","bgColor","fillStyle","rect","fill","hostBindings","Particle","canvasWidth","canvasHeight","word","clearRect","font","textFont","starting","fillText","imageData","getImageData","py","denseness","px","pixel","data","push","radius","color","Math","random","toString","flying","vx","vy","beginPath","arc","PI","closePath","mouseAffectRange","dx","dy","isInRange","svc","move","id","isWinning","alert","tileSize","min","innerWidth","innerHeight","letters","randomize","onResize","event","EightPuzzleService","_letters","sqrt","n","getLetter","i","getCoordinate","floor","rows","currentIndex","canMove","trim","every","_win","factory","providedIn","getAdditions","getSubtractions","getMultiplications","getDivisions","max","nAdd","a","randomIntBetween","b","additions","s","subtractions","multiplications","divisions","getSimplifications","getAdditions1","getAdditions2","fracSimp","concat","d","additions1","additions2","getLists","op1","randomOperator","op2","f","op3","list1","list2","operators","MathDirective","elementRef","ngZone","el","nativeElement","render","ngOnChanges","changes","currentValue","runOutsideAngular","registerMathJax","subscribe","appMath","inputs","features","MathService","exports","DOCUMENT","ReplaySubject","loaded$","asObservable","script","createElement","type","src","source","integrity","async","crossOrigin","onload","next","complete","head","appendChild","element","math","MathJax","startup","promise","then","innerHTML","typesetPromise","Maze","keyboardMap","environment","production","showTestButton","drawMaze","busy","validateInputs","maze","row","col","cellSize","firstCell","westEdge","lastCell","eastEdge","lineWidth","cellEdgeThickness","cellBackground","cells","initPlay","gameOver","myPath","currentCell","myPathThickness","strokeStyle","myPathColor","moveTo","lineTo","stroke","handleKeyDown","direction","key","preventDefault","nextCell","isConnectedTo","equals","drawPath","pop","hooray","drawSolution","undo","nSteps","splice","solutionPathColor","lineThickness","solutionPathThickness","findPath","cell","fillRect","northEdge","southEdge","audio","Audio","play","isNaN","test","cellsHaveFourEdges","hasLoop","size","nEdges","cellOnTheRight","cellBelow","console","log","Cell","connectTo","another","visited","ArrowLeft","A","ArrowRight","D","ArrowUp","W","w","ArrowDown","S","nRow","nCol","j","mapNeighbors","randomRowNumbers","Utils","shuffleArray","Array","keys","randomColNumbers","huntAndKill","randomCell","traversed","current","traversableNeighbors","neighbors","unshift","reverse","kill","hunt","find","huntRow","huntColumn","array","temp","canvasSize","upload","files","reader","FileReader","readAsDataURL","img","Image","result","tiles","getTiles","drawTiles","Error","imgData","resizeImage","imgSize","pixelRows","from","tileCountX","tileDataRows","slice","Uint8ClampedArray","offset","tile","putImageData","ImageData","resizingCanvas","resizingCanvasContext","drawImage","curImageDimensions","halfImageDimensions","outputCanvas","outputCanvasContext","CdkDropList","CdkDropListGroup","moveItemInArray","viewportRuler","drag","drop","placeholder","activeContainer","phElement","sourceElement","dropContainer","dropElement","dragIndex","__indexOf","parentElement","children","dropIndex","sourceIndex","clientWidth","clientHeight","removeChild","targetIndex","target","display","insertBefore","nextSibling","add","items","shuffle","sort","dragMoved","point","getPointerPositionOnPage","listGroup","_items","dropList","__isInsideDropListClientRect","dropListDropped","parent","__isTouchEvent","touches","changedTouches","scrollPosition","getViewportScrollPosition","pageX","left","pageY","top","collection","node","prototype","indexOf","call","startsWith","bottom","right","getBoundingClientRect","enableProdMode","__NgCli_bootstrap_1","bootstrapModule","catch","err","error"],"sourceRoot":"webpack:///","x_google_ignoreList":[]} \ No newline at end of file diff --git a/docs/polyfills.js b/docs/polyfills.js index 7b800b6..18adbf4 100644 --- a/docs/polyfills.js +++ b/docs/polyfills.js @@ -59,7 +59,6 @@ __webpack_require__.r(__webpack_exports__); * APPLICATION IMPORTS */ - /***/ }), /***/ 4946: @@ -69,12 +68,12 @@ __webpack_require__.r(__webpack_exports__); /***/ (() => { + /** - * @license Angular v12.0.0-next.0 - * (c) 2010-2020 Google LLC. https://angular.io/ + * @license Angular v15.1.0-next.0 + * (c) 2010-2022 Google LLC. https://angular.io/ * License: MIT */ - /** * @license * Copyright Google LLC All Rights Reserved. @@ -82,30 +81,23 @@ __webpack_require__.r(__webpack_exports__); * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - -const Zone$1 = function (global) { +(function (global) { const performance = global['performance']; - function mark(name) { performance && performance['mark'] && performance['mark'](name); } - function performanceMeasure(name, label) { performance && performance['measure'] && performance['measure'](name, label); } - - mark('Zone'); // Initialize before it's accessed below. + mark('Zone'); + // Initialize before it's accessed below. // __Zone_symbol_prefix global can be used to override the default zone // symbol prefix with a custom one if needed. - const symbolPrefix = global['__Zone_symbol_prefix'] || '__zone_symbol__'; - function __symbol__(name) { return symbolPrefix + name; } - const checkDuplicate = global[__symbol__('forceDuplicateZoneCheck')] === true; - if (global['Zone']) { // if global['Zone'] already exists (maybe zone.js was already loaded or // some other lib also registered a global object named Zone), we may need @@ -122,40 +114,32 @@ const Zone$1 = function (global) { return global['Zone']; } } - class Zone { constructor(parent, zoneSpec) { this._parent = parent; this._name = zoneSpec ? zoneSpec.name || 'unnamed' : ''; this._properties = zoneSpec && zoneSpec.properties || {}; - this._zoneDelegate = new ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec); + this._zoneDelegate = new _ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec); } - static assertZonePatched() { if (global['Promise'] !== patches['ZoneAwarePromise']) { throw new Error('Zone.js has detected that ZoneAwarePromise `(window|global).Promise` ' + 'has been overwritten.\n' + 'Most likely cause is that a Promise polyfill has been loaded ' + 'after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. ' + 'If you must load one, do so before loading zone.js.)'); } } - static get root() { let zone = Zone.current; - while (zone.parent) { zone = zone.parent; } - return zone; } - static get current() { return _currentZoneFrame.zone; } - static get currentTask() { return _currentTask; - } // tslint:disable-next-line:require-internal-with-underscore - - + } + // tslint:disable-next-line:require-internal-with-underscore static __load_patch(name, fn, ignoreDuplicate = false) { if (patches.hasOwnProperty(name)) { // `checkDuplicate` option is defined from global variable @@ -171,71 +155,56 @@ const Zone$1 = function (global) { performanceMeasure(perfName, perfName); } } - get parent() { return this._parent; } - get name() { return this._name; } - get(key) { const zone = this.getZoneWith(key); if (zone) return zone._properties[key]; } - getZoneWith(key) { let current = this; - while (current) { if (current._properties.hasOwnProperty(key)) { return current; } - current = current._parent; } - return null; } - fork(zoneSpec) { if (!zoneSpec) throw new Error('ZoneSpec required!'); return this._zoneDelegate.fork(this, zoneSpec); } - wrap(callback, source) { if (typeof callback !== 'function') { throw new Error('Expecting function got: ' + callback); } - const _callback = this._zoneDelegate.intercept(this, callback, source); - const zone = this; return function () { return zone.runGuarded(_callback, this, arguments, source); }; } - run(callback, applyThis, applyArgs, source) { _currentZoneFrame = { parent: _currentZoneFrame, zone: this }; - try { return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source); } finally { _currentZoneFrame = _currentZoneFrame.parent; } } - runGuarded(callback, applyThis = null, applyArgs, source) { _currentZoneFrame = { parent: _currentZoneFrame, zone: this }; - try { try { return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source); @@ -248,19 +217,16 @@ const Zone$1 = function (global) { _currentZoneFrame = _currentZoneFrame.parent; } } - runTask(task, applyThis, applyArgs) { if (task.zone != this) { throw new Error('A task can only be run in the zone of creation! (Creation: ' + (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')'); - } // https://github.com/angular/zone.js/issues/778, sometimes eventTask + } + // https://github.com/angular/zone.js/issues/778, sometimes eventTask // will run in notScheduled(canceled) state, we should not try to // run such kind of task but just return - - if (task.state === notScheduled && (task.type === eventTask || task.type === macroTask)) { return; } - const reEntryGuard = task.state != running; reEntryGuard && task._transitionTo(running, scheduled); task.runCount++; @@ -270,12 +236,10 @@ const Zone$1 = function (global) { parent: _currentZoneFrame, zone: this }; - try { if (task.type == macroTask && task.data && !task.data.isPeriodic) { task.cancelFn = undefined; } - try { return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs); } catch (error) { @@ -291,115 +255,88 @@ const Zone$1 = function (global) { reEntryGuard && task._transitionTo(scheduled, running); } else { task.runCount = 0; - this._updateTaskCount(task, -1); - reEntryGuard && task._transitionTo(notScheduled, running, notScheduled); } } - _currentZoneFrame = _currentZoneFrame.parent; _currentTask = previousTask; } } - scheduleTask(task) { if (task.zone && task.zone !== this) { // check if the task was rescheduled, the newZone // should not be the children of the original zone let newZone = this; - while (newZone) { if (newZone === task.zone) { throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${task.zone.name}`); } - newZone = newZone.parent; } } - task._transitionTo(scheduling, notScheduled); - const zoneDelegates = []; task._zoneDelegates = zoneDelegates; task._zone = this; - try { task = this._zoneDelegate.scheduleTask(this, task); } catch (err) { // should set task's state to unknown when scheduleTask throw error // because the err may from reschedule, so the fromState maybe notScheduled - task._transitionTo(unknown, scheduling, notScheduled); // TODO: @JiaLiPassion, should we check the result from handleError? - - + task._transitionTo(unknown, scheduling, notScheduled); + // TODO: @JiaLiPassion, should we check the result from handleError? this._zoneDelegate.handleError(this, err); - throw err; } - if (task._zoneDelegates === zoneDelegates) { // we have to check because internally the delegate can reschedule the task. this._updateTaskCount(task, 1); } - if (task.state == scheduling) { task._transitionTo(scheduled, scheduling); } - return task; } - scheduleMicroTask(source, callback, data, customSchedule) { return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, undefined)); } - scheduleMacroTask(source, callback, data, customSchedule, customCancel) { return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel)); } - scheduleEventTask(source, callback, data, customSchedule, customCancel) { return this.scheduleTask(new ZoneTask(eventTask, source, callback, data, customSchedule, customCancel)); } - cancelTask(task) { if (task.zone != this) throw new Error('A task can only be cancelled in the zone of creation! (Creation: ' + (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')'); - + if (task.state !== scheduled && task.state !== running) { + return; + } task._transitionTo(canceling, scheduled, running); - try { this._zoneDelegate.cancelTask(this, task); } catch (err) { // if error occurs when cancelTask, transit the state to unknown task._transitionTo(unknown, canceling); - this._zoneDelegate.handleError(this, err); - throw err; } - this._updateTaskCount(task, -1); - task._transitionTo(notScheduled, canceling); - task.runCount = 0; return task; } - _updateTaskCount(task, count) { const zoneDelegates = task._zoneDelegates; - if (count == -1) { task._zoneDelegates = null; } - for (let i = 0; i < zoneDelegates.length; i++) { zoneDelegates[i]._updateTaskCount(task.type, count); } } - - } // tslint:disable-next-line:require-internal-with-underscore - - + } + // tslint:disable-next-line:require-internal-with-underscore Zone.__symbol__ = __symbol__; const DELEGATE_ZS = { name: '', @@ -408,8 +345,7 @@ const Zone$1 = function (global) { onInvokeTask: (delegate, _, target, task, applyThis, applyArgs) => delegate.invokeTask(target, task, applyThis, applyArgs), onCancelTask: (delegate, _, target, task) => delegate.cancelTask(target, task) }; - - class ZoneDelegate { + class _ZoneDelegate { constructor(zone, parentDelegate, zoneSpec) { this._taskCounts = { 'microTask': 0, @@ -445,7 +381,6 @@ const Zone$1 = function (global) { this._hasTaskCurrZone = null; const zoneSpecHasTask = zoneSpec && zoneSpec.onHasTask; const parentHasTask = parentDelegate && parentDelegate._hasTaskZS; - if (zoneSpecHasTask || parentHasTask) { // If we need to report hasTask, than this ZS needs to do ref counting on tasks. In such // a case all task related interceptors must go through this ZD. We can't short circuit it. @@ -453,19 +388,16 @@ const Zone$1 = function (global) { this._hasTaskDlgt = parentDelegate; this._hasTaskDlgtOwner = this; this._hasTaskCurrZone = zone; - if (!zoneSpec.onScheduleTask) { this._scheduleTaskZS = DELEGATE_ZS; this._scheduleTaskDlgt = parentDelegate; this._scheduleTaskCurrZone = this.zone; } - if (!zoneSpec.onInvokeTask) { this._invokeTaskZS = DELEGATE_ZS; this._invokeTaskDlgt = parentDelegate; this._invokeTaskCurrZone = this.zone; } - if (!zoneSpec.onCancelTask) { this._cancelTaskZS = DELEGATE_ZS; this._cancelTaskDlgt = parentDelegate; @@ -473,34 +405,27 @@ const Zone$1 = function (global) { } } } - fork(targetZone, zoneSpec) { return this._forkZS ? this._forkZS.onFork(this._forkDlgt, this.zone, targetZone, zoneSpec) : new Zone(targetZone, zoneSpec); } - intercept(targetZone, callback, source) { return this._interceptZS ? this._interceptZS.onIntercept(this._interceptDlgt, this._interceptCurrZone, targetZone, callback, source) : callback; } - invoke(targetZone, callback, applyThis, applyArgs, source) { return this._invokeZS ? this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) : callback.apply(applyThis, applyArgs); } - handleError(targetZone, error) { return this._handleErrorZS ? this._handleErrorZS.onHandleError(this._handleErrorDlgt, this._handleErrorCurrZone, targetZone, error) : true; } - scheduleTask(targetZone, task) { let returnTask = task; - if (this._scheduleTaskZS) { if (this._hasTaskZS) { returnTask._zoneDelegates.push(this._hasTaskDlgtOwner); - } // clang-format off - - - returnTask = this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this._scheduleTaskCurrZone, targetZone, task); // clang-format on - + } + // clang-format off + returnTask = this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this._scheduleTaskCurrZone, targetZone, task); + // clang-format on if (!returnTask) returnTask = task; } else { if (task.scheduleFn) { @@ -511,30 +436,23 @@ const Zone$1 = function (global) { throw new Error('Task is missing scheduleFn.'); } } - return returnTask; } - invokeTask(targetZone, task, applyThis, applyArgs) { return this._invokeTaskZS ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) : task.callback.apply(applyThis, applyArgs); } - cancelTask(targetZone, task) { let value; - if (this._cancelTaskZS) { value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this._cancelTaskCurrZone, targetZone, task); } else { if (!task.cancelFn) { throw Error('Task is not cancelable'); } - value = task.cancelFn(task); } - return value; } - hasTask(targetZone, isEmpty) { // hasTask should not throw error so other ZoneDelegate // can still trigger hasTask callback @@ -543,18 +461,15 @@ const Zone$1 = function (global) { } catch (err) { this.handleError(targetZone, err); } - } // tslint:disable-next-line:require-internal-with-underscore - - + } + // tslint:disable-next-line:require-internal-with-underscore _updateTaskCount(type, count) { const counts = this._taskCounts; const prev = counts[type]; const next = counts[type] = prev + count; - if (next < 0) { throw new Error('More tasks executed then were scheduled.'); } - if (prev == 0 || next == 0) { const isEmpty = { microTask: counts['microTask'] > 0, @@ -565,31 +480,27 @@ const Zone$1 = function (global) { this.hasTask(this.zone, isEmpty); } } - } - class ZoneTask { constructor(type, source, callback, options, scheduleFn, cancelFn) { // tslint:disable-next-line:require-internal-with-underscore this._zone = null; - this.runCount = 0; // tslint:disable-next-line:require-internal-with-underscore - - this._zoneDelegates = null; // tslint:disable-next-line:require-internal-with-underscore - + this.runCount = 0; + // tslint:disable-next-line:require-internal-with-underscore + this._zoneDelegates = null; + // tslint:disable-next-line:require-internal-with-underscore this._state = 'notScheduled'; this.type = type; this.source = source; this.data = options; this.scheduleFn = scheduleFn; this.cancelFn = cancelFn; - if (!callback) { throw new Error('callback is not defined'); } - this.callback = callback; - const self = this; // TODO: @JiaLiPassion options should have interface - + const self = this; + // TODO: @JiaLiPassion options should have interface if (type === eventTask && options && options.useG) { this.invoke = ZoneTask.invokeTask; } else { @@ -598,14 +509,11 @@ const Zone$1 = function (global) { }; } } - static invokeTask(task, target, args) { if (!task) { task = this; } - _numberOfNestedTaskFrames++; - try { task.runCount++; return task.zone.runTask(task, target, args); @@ -613,28 +521,22 @@ const Zone$1 = function (global) { if (_numberOfNestedTaskFrames == 1) { drainMicroTaskQueue(); } - _numberOfNestedTaskFrames--; } } - get zone() { return this._zone; } - get state() { return this._state; } - cancelScheduleRequest() { this._transitionTo(notScheduled, scheduling); - } // tslint:disable-next-line:require-internal-with-underscore - - + } + // tslint:disable-next-line:require-internal-with-underscore _transitionTo(toState, fromState1, fromState2) { if (this._state === fromState1 || this._state === fromState2) { this._state = toState; - if (toState == notScheduled) { this._zoneDelegates = null; } @@ -642,17 +544,15 @@ const Zone$1 = function (global) { throw new Error(`${this.type} '${this.source}': can not transition to '${toState}', expecting state '${fromState1}'${fromState2 ? ' or \'' + fromState2 + '\'' : ''}, was '${this._state}'.`); } } - toString() { if (this.data && typeof this.data.handleId !== 'undefined') { return this.data.handleId.toString(); } else { return Object.prototype.toString.call(this); } - } // add toJSON method to prevent cyclic error when + } + // add toJSON method to prevent cyclic error when // call JSON.stringify(zoneTask) - - toJSON() { return { type: this.type, @@ -662,64 +562,53 @@ const Zone$1 = function (global) { runCount: this.runCount }; } - - } ////////////////////////////////////////////////////// + } + ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// /// MICROTASK QUEUE ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// - - const symbolSetTimeout = __symbol__('setTimeout'); - const symbolPromise = __symbol__('Promise'); - const symbolThen = __symbol__('then'); - let _microTaskQueue = []; let _isDrainingMicrotaskQueue = false; let nativeMicroTaskQueuePromise; - + function nativeScheduleMicroTask(func) { + if (!nativeMicroTaskQueuePromise) { + if (global[symbolPromise]) { + nativeMicroTaskQueuePromise = global[symbolPromise].resolve(0); + } + } + if (nativeMicroTaskQueuePromise) { + let nativeThen = nativeMicroTaskQueuePromise[symbolThen]; + if (!nativeThen) { + // native Promise is not patchable, we need to use `then` directly + // issue 1078 + nativeThen = nativeMicroTaskQueuePromise['then']; + } + nativeThen.call(nativeMicroTaskQueuePromise, func); + } else { + global[symbolSetTimeout](func, 0); + } + } function scheduleMicroTask(task) { // if we are not running in any task, and there has not been anything scheduled // we must bootstrap the initial task creation by manually scheduling the drain if (_numberOfNestedTaskFrames === 0 && _microTaskQueue.length === 0) { // We are not running in Task, so we need to kickstart the microtask queue. - if (!nativeMicroTaskQueuePromise) { - if (global[symbolPromise]) { - nativeMicroTaskQueuePromise = global[symbolPromise].resolve(0); - } - } - - if (nativeMicroTaskQueuePromise) { - let nativeThen = nativeMicroTaskQueuePromise[symbolThen]; - - if (!nativeThen) { - // native Promise is not patchable, we need to use `then` directly - // issue 1078 - nativeThen = nativeMicroTaskQueuePromise['then']; - } - - nativeThen.call(nativeMicroTaskQueuePromise, drainMicroTaskQueue); - } else { - global[symbolSetTimeout](drainMicroTaskQueue, 0); - } + nativeScheduleMicroTask(drainMicroTaskQueue); } - task && _microTaskQueue.push(task); } - function drainMicroTaskQueue() { if (!_isDrainingMicrotaskQueue) { _isDrainingMicrotaskQueue = true; - while (_microTaskQueue.length) { const queue = _microTaskQueue; _microTaskQueue = []; - for (let i = 0; i < queue.length; i++) { const task = queue[i]; - try { task.zone.runTask(task, null, null); } catch (error) { @@ -727,30 +616,27 @@ const Zone$1 = function (global) { } } } - _api.microtaskDrainDone(); - _isDrainingMicrotaskQueue = false; } - } ////////////////////////////////////////////////////// + } + ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// /// BOOTSTRAP ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// - - const NO_ZONE = { name: 'NO ZONE' }; const notScheduled = 'notScheduled', - scheduling = 'scheduling', - scheduled = 'scheduled', - running = 'running', - canceling = 'canceling', - unknown = 'unknown'; + scheduling = 'scheduling', + scheduled = 'scheduled', + running = 'running', + canceling = 'canceling', + unknown = 'unknown'; const microTask = 'microTask', - macroTask = 'macroTask', - eventTask = 'eventTask'; + macroTask = 'macroTask', + eventTask = 'eventTask'; const patches = {}; const _api = { symbol: __symbol__, @@ -777,7 +663,8 @@ const Zone$1 = function (global) { filterProperties: () => [], attachOriginToPatched: () => noop, _redefineProperty: () => noop, - patchCallbacks: () => noop + patchCallbacks: () => noop, + nativeScheduleMicroTask: nativeScheduleMicroTask }; let _currentZoneFrame = { parent: null, @@ -785,12 +672,11 @@ const Zone$1 = function (global) { }; let _currentTask = null; let _numberOfNestedTaskFrames = 0; - function noop() {} - performanceMeasure('Zone', 'Zone'); return global['Zone'] = Zone; -}(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global); +})(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -798,7 +684,6 @@ const Zone$1 = function (global) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Suppress closure compiler errors about unknown 'Zone' variable * @fileoverview @@ -806,257 +691,190 @@ const Zone$1 = function (global) { */ /// // issue #989, to reduce bundle size, use short name - /** Object.getOwnPropertyDescriptor */ - - const ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; /** Object.defineProperty */ - const ObjectDefineProperty = Object.defineProperty; /** Object.getPrototypeOf */ - const ObjectGetPrototypeOf = Object.getPrototypeOf; /** Object.create */ - const ObjectCreate = Object.create; /** Array.prototype.slice */ - const ArraySlice = Array.prototype.slice; /** addEventListener string const */ - const ADD_EVENT_LISTENER_STR = 'addEventListener'; /** removeEventListener string const */ - const REMOVE_EVENT_LISTENER_STR = 'removeEventListener'; /** zoneSymbol addEventListener */ - const ZONE_SYMBOL_ADD_EVENT_LISTENER = Zone.__symbol__(ADD_EVENT_LISTENER_STR); /** zoneSymbol removeEventListener */ - - const ZONE_SYMBOL_REMOVE_EVENT_LISTENER = Zone.__symbol__(REMOVE_EVENT_LISTENER_STR); /** true string const */ - - const TRUE_STR = 'true'; /** false string const */ - const FALSE_STR = 'false'; /** Zone symbol prefix string const. */ - const ZONE_SYMBOL_PREFIX = Zone.__symbol__(''); - function wrapWithCurrentZone(callback, source) { return Zone.current.wrap(callback, source); } - function scheduleMacroTaskWithCurrentZone(source, callback, data, customSchedule, customCancel) { return Zone.current.scheduleMacroTask(source, callback, data, customSchedule, customCancel); } - const zoneSymbol = Zone.__symbol__; const isWindowExists = typeof window !== 'undefined'; const internalWindow = isWindowExists ? window : undefined; - const _global = isWindowExists && internalWindow || typeof self === 'object' && self || global; - const REMOVE_ATTRIBUTE = 'removeAttribute'; -const NULL_ON_PROP_VALUE = [null]; - function bindArguments(args, source) { for (let i = args.length - 1; i >= 0; i--) { if (typeof args[i] === 'function') { args[i] = wrapWithCurrentZone(args[i], source + '_' + i); } } - return args; } - function patchPrototype(prototype, fnNames) { const source = prototype.constructor['name']; - for (let i = 0; i < fnNames.length; i++) { const name = fnNames[i]; const delegate = prototype[name]; - if (delegate) { const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, name); - if (!isPropertyWritable(prototypeDesc)) { continue; } - prototype[name] = (delegate => { const patched = function () { return delegate.apply(this, bindArguments(arguments, source + '.' + name)); }; - attachOriginToPatched(patched, delegate); return patched; })(delegate); } } } - function isPropertyWritable(propertyDesc) { if (!propertyDesc) { return true; } - if (propertyDesc.writable === false) { return false; } - return !(typeof propertyDesc.get === 'function' && typeof propertyDesc.set === 'undefined'); } - -const isWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope; // Make sure to access `process` through `_global` so that WebPack does not accidentally browserify +const isWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope; +// Make sure to access `process` through `_global` so that WebPack does not accidentally browserify // this code. - const isNode = !('nw' in _global) && typeof _global.process !== 'undefined' && {}.toString.call(_global.process) === '[object process]'; -const isBrowser = !isNode && !isWebWorker && !!(isWindowExists && internalWindow['HTMLElement']); // we are in electron of nw, so we are both browser and nodejs +const isBrowser = !isNode && !isWebWorker && !!(isWindowExists && internalWindow['HTMLElement']); +// we are in electron of nw, so we are both browser and nodejs // Make sure to access `process` through `_global` so that WebPack does not accidentally browserify // this code. - const isMix = typeof _global.process !== 'undefined' && {}.toString.call(_global.process) === '[object process]' && !isWebWorker && !!(isWindowExists && internalWindow['HTMLElement']); -const zoneSymbolEventNames = {}; - +const zoneSymbolEventNames$1 = {}; const wrapFn = function (event) { // https://github.com/angular/zone.js/issues/911, in IE, sometimes // event will be undefined, so we need to use window.event event = event || _global.event; - if (!event) { return; } - - let eventNameSymbol = zoneSymbolEventNames[event.type]; - + let eventNameSymbol = zoneSymbolEventNames$1[event.type]; if (!eventNameSymbol) { - eventNameSymbol = zoneSymbolEventNames[event.type] = zoneSymbol('ON_PROPERTY' + event.type); + eventNameSymbol = zoneSymbolEventNames$1[event.type] = zoneSymbol('ON_PROPERTY' + event.type); } - const target = this || event.target || _global; const listener = target[eventNameSymbol]; let result; - if (isBrowser && target === internalWindow && event.type === 'error') { - // window.onerror have different signiture + // window.onerror have different signature // https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror#window.onerror // and onerror callback will prevent default when callback return true const errorEvent = event; result = listener && listener.call(this, errorEvent.message, errorEvent.filename, errorEvent.lineno, errorEvent.colno, errorEvent.error); - if (result === true) { event.preventDefault(); } } else { result = listener && listener.apply(this, arguments); - if (result != undefined && !result) { event.preventDefault(); } } - return result; }; - function patchProperty(obj, prop, prototype) { let desc = ObjectGetOwnPropertyDescriptor(obj, prop); - if (!desc && prototype) { // when patch window object, use prototype to check prop exist or not const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, prop); - if (prototypeDesc) { desc = { enumerable: true, configurable: true }; } - } // if the descriptor not exists or is not configurable + } + // if the descriptor not exists or is not configurable // just return - - if (!desc || !desc.configurable) { return; } - const onPropPatchedSymbol = zoneSymbol('on' + prop + 'patched'); - if (obj.hasOwnProperty(onPropPatchedSymbol) && obj[onPropPatchedSymbol]) { return; - } // A property descriptor cannot have getter/setter and be writable + } + // A property descriptor cannot have getter/setter and be writable // deleting the writable and value properties avoids this error: // // TypeError: property descriptors must not specify a value or be writable when a // getter or setter has been specified - - delete desc.writable; delete desc.value; const originalDescGet = desc.get; - const originalDescSet = desc.set; // substr(2) cuz 'onclick' -> 'click', etc - - const eventName = prop.substr(2); - let eventNameSymbol = zoneSymbolEventNames[eventName]; - + const originalDescSet = desc.set; + // slice(2) cuz 'onclick' -> 'click', etc + const eventName = prop.slice(2); + let eventNameSymbol = zoneSymbolEventNames$1[eventName]; if (!eventNameSymbol) { - eventNameSymbol = zoneSymbolEventNames[eventName] = zoneSymbol('ON_PROPERTY' + eventName); + eventNameSymbol = zoneSymbolEventNames$1[eventName] = zoneSymbol('ON_PROPERTY' + eventName); } - desc.set = function (newValue) { // in some of windows's onproperty callback, this is undefined // so we need to check it let target = this; - if (!target && obj === _global) { target = _global; } - if (!target) { return; } - - let previousValue = target[eventNameSymbol]; - - if (previousValue) { + const previousValue = target[eventNameSymbol]; + if (typeof previousValue === 'function') { target.removeEventListener(eventName, wrapFn); - } // issue #978, when onload handler was added before loading zone.js - // we should remove it with originalDescSet - - - if (originalDescSet) { - originalDescSet.apply(target, NULL_ON_PROP_VALUE); } - + // issue #978, when onload handler was added before loading zone.js + // we should remove it with originalDescSet + originalDescSet && originalDescSet.call(target, null); + target[eventNameSymbol] = newValue; if (typeof newValue === 'function') { - target[eventNameSymbol] = newValue; target.addEventListener(eventName, wrapFn, false); - } else { - target[eventNameSymbol] = null; } - }; // The getter would return undefined for unassigned properties but the default value of an + }; + // The getter would return undefined for unassigned properties but the default value of an // unassigned property is null - - desc.get = function () { // in some of windows's onproperty callback, this is undefined // so we need to check it let target = this; - if (!target && obj === _global) { target = _global; } - if (!target) { return null; } - const listener = target[eventNameSymbol]; - if (listener) { return listener; } else if (originalDescGet) { @@ -1066,26 +884,20 @@ function patchProperty(obj, prop, prototype) { // the onclick will be evaluated when first time event was triggered or // the property is accessed, https://github.com/angular/zone.js/issues/525 // so we should use original native get to retrieve the handler - let value = originalDescGet && originalDescGet.call(this); - + let value = originalDescGet.call(this); if (value) { desc.set.call(this, value); - if (typeof target[REMOVE_ATTRIBUTE] === 'function') { target.removeAttribute(prop); } - return value; } } - return null; }; - ObjectDefineProperty(obj, prop, desc); obj[onPropPatchedSymbol] = true; } - function patchOnProperties(obj, properties, prototype) { if (properties) { for (let i = 0; i < properties.length; i++) { @@ -1093,65 +905,52 @@ function patchOnProperties(obj, properties, prototype) { } } else { const onProperties = []; - for (const prop in obj) { - if (prop.substr(0, 2) == 'on') { + if (prop.slice(0, 2) == 'on') { onProperties.push(prop); } } - for (let j = 0; j < onProperties.length; j++) { patchProperty(obj, onProperties[j], prototype); } } } - -const originalInstanceKey = zoneSymbol('originalInstance'); // wrap some native API on `window` - +const originalInstanceKey = zoneSymbol('originalInstance'); +// wrap some native API on `window` function patchClass(className) { const OriginalClass = _global[className]; - if (!OriginalClass) return; // keep original class in global - + if (!OriginalClass) return; + // keep original class in global _global[zoneSymbol(className)] = OriginalClass; - _global[className] = function () { const a = bindArguments(arguments, className); - switch (a.length) { case 0: this[originalInstanceKey] = new OriginalClass(); break; - case 1: this[originalInstanceKey] = new OriginalClass(a[0]); break; - case 2: this[originalInstanceKey] = new OriginalClass(a[0], a[1]); break; - case 3: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]); break; - case 4: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]); break; - default: throw new Error('Arg list too long.'); } - }; // attach original delegate to patched function - - + }; + // attach original delegate to patched function attachOriginToPatched(_global[className], OriginalClass); const instance = new OriginalClass(function () {}); let prop; - for (prop in instance) { // https://bugs.webkit.org/show_bug.cgi?id=44721 if (className === 'XMLHttpRequest' && prop === 'responseBlob') continue; - (function (prop) { if (typeof instance[prop] === 'function') { _global[className].prototype[prop] = function () { @@ -1161,10 +960,10 @@ function patchClass(className) { ObjectDefineProperty(_global[className].prototype, prop, { set: function (fn) { if (typeof fn === 'function') { - this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop); // keep callback in wrapped function so we can + this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop); + // keep callback in wrapped function so we can // use it in Function.prototype.toString to return // the native one. - attachOriginToPatched(this[originalInstanceKey][prop], fn); } else { this[originalInstanceKey][prop] = fn; @@ -1177,67 +976,51 @@ function patchClass(className) { } })(prop); } - for (prop in OriginalClass) { if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) { _global[className][prop] = OriginalClass[prop]; } } } - function patchMethod(target, name, patchFn) { let proto = target; - while (proto && !proto.hasOwnProperty(name)) { proto = ObjectGetPrototypeOf(proto); } - if (!proto && target[name]) { // somehow we did not find it, but we can see it. This happens on IE for Window properties. proto = target; } - const delegateName = zoneSymbol(name); let delegate = null; - if (proto && (!(delegate = proto[delegateName]) || !proto.hasOwnProperty(delegateName))) { - delegate = proto[delegateName] = proto[name]; // check whether proto[name] is writable + delegate = proto[delegateName] = proto[name]; + // check whether proto[name] is writable // some property is readonly in safari, such as HtmlCanvasElement.prototype.toBlob - const desc = proto && ObjectGetOwnPropertyDescriptor(proto, name); - if (isPropertyWritable(desc)) { const patchDelegate = patchFn(delegate, delegateName, name); - proto[name] = function () { return patchDelegate(this, arguments); }; - attachOriginToPatched(proto[name], delegate); } } - return delegate; -} // TODO: @JiaLiPassion, support cancel task later if necessary - - +} +// TODO: @JiaLiPassion, support cancel task later if necessary function patchMacroTask(obj, funcName, metaCreator) { let setNative = null; - function scheduleTask(task) { const data = task.data; - data.args[data.cbIdx] = function () { task.invoke.apply(this, arguments); }; - setNative.apply(data.target, data.args); return task; } - setNative = patchMethod(obj, funcName, delegate => function (self, args) { const meta = metaCreator(self, args); - if (meta.cbIdx >= 0 && typeof args[meta.cbIdx] === 'function') { return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask); } else { @@ -1246,43 +1029,34 @@ function patchMacroTask(obj, funcName, metaCreator) { } }); } - function attachOriginToPatched(patched, original) { patched[zoneSymbol('OriginalDelegate')] = original; } - let isDetectedIEOrEdge = false; let ieOrEdge = false; - function isIE() { try { const ua = internalWindow.navigator.userAgent; - if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1) { return true; } } catch (error) {} - return false; } - function isIEOrEdge() { if (isDetectedIEOrEdge) { return ieOrEdge; } - isDetectedIEOrEdge = true; - try { const ua = internalWindow.navigator.userAgent; - if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1 || ua.indexOf('Edge/') !== -1) { ieOrEdge = true; } } catch (error) {} - return ieOrEdge; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -1290,35 +1064,25 @@ function isIEOrEdge() { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { const ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; const ObjectDefineProperty = Object.defineProperty; - function readableObjectToString(obj) { if (obj && obj.toString === Object.prototype.toString) { const className = obj.constructor && obj.constructor.name; return (className ? className : '') + ': ' + JSON.stringify(obj); } - return obj ? obj.toString() : Object.prototype.toString.call(obj); } - const __symbol__ = api.symbol; const _uncaughtPromiseErrors = []; const isDisableWrappingUncaughtPromiseRejection = global[__symbol__('DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION')] === true; - const symbolPromise = __symbol__('Promise'); - const symbolThen = __symbol__('then'); - const creationTrace = '__creationTrace__'; - api.onUnhandledError = e => { if (api.showUncaughtError()) { const rejection = e && e.rejection; - if (rejection) { console.error('Unhandled Promise rejection:', rejection instanceof Error ? rejection.message : rejection, '; Zone:', e.zone.name, '; Task:', e.task && e.task.source, '; Value:', rejection, rejection instanceof Error ? rejection.stack : undefined); } else { @@ -1326,17 +1090,14 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { } } }; - api.microtaskDrainDone = () => { while (_uncaughtPromiseErrors.length) { const uncaughtPromiseError = _uncaughtPromiseErrors.shift(); - try { uncaughtPromiseError.zone.runGuarded(() => { if (uncaughtPromiseError.throwOriginal) { throw uncaughtPromiseError.rejection; } - throw uncaughtPromiseError; }); } catch (error) { @@ -1344,57 +1105,43 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { } } }; - const UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL = __symbol__('unhandledPromiseRejectionHandler'); - function handleUnhandledRejection(e) { api.onUnhandledError(e); - try { const handler = Zone[UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL]; - if (typeof handler === 'function') { handler.call(this, e); } } catch (err) {} } - function isThenable(value) { return value && value.then; } - function forwardResolution(value) { return value; } - function forwardRejection(rejection) { return ZoneAwarePromise.reject(rejection); } - const symbolState = __symbol__('state'); - const symbolValue = __symbol__('value'); - const symbolFinally = __symbol__('finally'); - const symbolParentPromiseValue = __symbol__('parentPromiseValue'); - const symbolParentPromiseState = __symbol__('parentPromiseState'); - const source = 'Promise.then'; const UNRESOLVED = null; const RESOLVED = true; const REJECTED = false; const REJECTED_NO_CATCH = 0; - function makeResolver(promise, state) { return v => { try { resolvePromise(promise, state, v); } catch (err) { resolvePromise(promise, false, err); - } // Do not return value or you will break the Promise spec. - + } + // Do not return value or you will break the Promise spec. }; } @@ -1405,29 +1152,22 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { if (wasCalled) { return; } - wasCalled = true; wrappedFunction.apply(null, arguments); }; }; }; - const TYPE_ERROR = 'Promise resolved with itself'; - - const CURRENT_TASK_TRACE_SYMBOL = __symbol__('currentTaskTrace'); // Promise Resolution - - + const CURRENT_TASK_TRACE_SYMBOL = __symbol__('currentTaskTrace'); + // Promise Resolution function resolvePromise(promise, state, value) { const onceWrapper = once(); - if (promise === value) { throw new TypeError(TYPE_ERROR); } - if (promise[symbolState] === UNRESOLVED) { // should only get value.then once based on promise spec. let then = null; - try { if (typeof value === 'object' || typeof value === 'function') { then = value && value.then; @@ -1437,9 +1177,8 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { resolvePromise(promise, false, err); })(); return promise; - } // if (value instanceof ZoneAwarePromise) { - - + } + // if (value instanceof ZoneAwarePromise) { if (state !== REJECTED && value instanceof ZoneAwarePromise && value.hasOwnProperty(symbolState) && value.hasOwnProperty(symbolValue) && value[symbolState] !== UNRESOLVED) { clearRejectedNoCatch(value); resolvePromise(promise, value[symbolState], value[symbolValue]); @@ -1455,7 +1194,6 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { promise[symbolState] = state; const queue = promise[symbolValue]; promise[symbolValue] = value; - if (promise[symbolFinally] === symbolFinally) { // the promise is generated by Promise.prototype.finally if (state === RESOLVED) { @@ -1464,14 +1202,12 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { promise[symbolState] = promise[symbolParentPromiseState]; promise[symbolValue] = promise[symbolParentPromiseValue]; } - } // record task information in value when error occurs, so we can + } + // record task information in value when error occurs, so we can // do some additional work such as render longStackTrace - - if (state === REJECTED && value instanceof Error) { // check if longStackTraceZone is here const trace = Zone.currentTask && Zone.currentTask.data && Zone.currentTask.data[creationTrace]; - if (trace) { // only keep the long stack trace into error when in longStackTraceZone ObjectDefineProperty(value, CURRENT_TASK_TRACE_SYMBOL, { @@ -1482,15 +1218,12 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { }); } } - for (let i = 0; i < queue.length;) { scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]); } - if (queue.length == 0 && state == REJECTED) { promise[symbolState] = REJECTED_NO_CATCH; let uncaughtPromiseError = value; - try { // Here we throws a new Error to print more readable error log // and if the value is not an error, zone.js builds an `Error` @@ -1499,31 +1232,24 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { } catch (err) { uncaughtPromiseError = err; } - if (isDisableWrappingUncaughtPromiseRejection) { // If disable wrapping uncaught promise reject // use the value instead of wrapping it. uncaughtPromiseError.throwOriginal = true; } - uncaughtPromiseError.rejection = value; uncaughtPromiseError.promise = promise; uncaughtPromiseError.zone = Zone.current; uncaughtPromiseError.task = Zone.currentTask; - _uncaughtPromiseErrors.push(uncaughtPromiseError); - api.scheduleMicroTask(); // to make sure that it is running } } - } // Resolving an already resolved promise is a noop. - - + } + // Resolving an already resolved promise is a noop. return promise; } - const REJECTION_HANDLED_HANDLER = __symbol__('rejectionHandledHandler'); - function clearRejectedNoCatch(promise) { if (promise[symbolState] === REJECTED_NO_CATCH) { // if the promise is rejected no catch status @@ -1533,7 +1259,6 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { // eventHandler try { const handler = Zone[REJECTION_HANDLED_HANDLER]; - if (handler && typeof handler === 'function') { handler.call(this, { rejection: promise[symbolValue], @@ -1541,9 +1266,7 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { }); } } catch (err) {} - promise[symbolState] = REJECTED; - for (let i = 0; i < _uncaughtPromiseErrors.length; i++) { if (promise === _uncaughtPromiseErrors[i].promise) { _uncaughtPromiseErrors.splice(i, 1); @@ -1551,7 +1274,6 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { } } } - function scheduleResolveOrReject(promise, zone, chainPromise, onFulfilled, onRejected) { clearRejectedNoCatch(promise); const promiseState = promise[symbolState]; @@ -1560,14 +1282,12 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { try { const parentPromiseValue = promise[symbolValue]; const isFinallyPromise = !!chainPromise && symbolFinally === chainPromise[symbolFinally]; - if (isFinallyPromise) { // if the promise is generated from finally call, keep parent promise's state and value chainPromise[symbolParentPromiseValue] = parentPromiseValue; chainPromise[symbolParentPromiseState] = promiseState; - } // should not pass value to finally callback - - + } + // should not pass value to finally callback const value = zone.run(delegate, undefined, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution ? [] : [parentPromiseValue]); resolvePromise(chainPromise, true, value); } catch (error) { @@ -1576,24 +1296,57 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { } }, chainPromise); } - const ZONE_AWARE_PROMISE_TO_STRING = 'function ZoneAwarePromise() { [native code] }'; - const noop = function () {}; - + const AggregateError = global.AggregateError; class ZoneAwarePromise { static toString() { return ZONE_AWARE_PROMISE_TO_STRING; } - static resolve(value) { return resolvePromise(new this(null), RESOLVED, value); } - static reject(error) { return resolvePromise(new this(null), REJECTED, error); } - + static any(values) { + if (!values || typeof values[Symbol.iterator] !== 'function') { + return Promise.reject(new AggregateError([], 'All promises were rejected')); + } + const promises = []; + let count = 0; + try { + for (let v of values) { + count++; + promises.push(ZoneAwarePromise.resolve(v)); + } + } catch (err) { + return Promise.reject(new AggregateError([], 'All promises were rejected')); + } + if (count === 0) { + return Promise.reject(new AggregateError([], 'All promises were rejected')); + } + let finished = false; + const errors = []; + return new ZoneAwarePromise((resolve, reject) => { + for (let i = 0; i < promises.length; i++) { + promises[i].then(v => { + if (finished) { + return; + } + finished = true; + resolve(v); + }, err => { + errors.push(err); + count--; + if (count === 0) { + finished = true; + reject(new AggregateError(errors, 'All promises were rejected')); + } + }); + } + }); + } static race(values) { let resolve; let reject; @@ -1601,30 +1354,23 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { resolve = res; reject = rej; }); - function onResolve(value) { resolve(value); } - function onReject(error) { reject(error); } - for (let value of values) { if (!isThenable(value)) { value = this.resolve(value); } - value.then(onResolve, onReject); } - return promise; } - static all(values) { return ZoneAwarePromise.allWithCallback(values); } - static allSettled(values) { const P = this && this.prototype instanceof ZoneAwarePromise ? this : ZoneAwarePromise; return P.allWithCallback(values, { @@ -1638,31 +1384,26 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { }) }); } - static allWithCallback(values, callback) { let resolve; let reject; let promise = new this((res, rej) => { resolve = res; reject = rej; - }); // Start at 2 to prevent prematurely resolving if .then is called immediately. - + }); + // Start at 2 to prevent prematurely resolving if .then is called immediately. let unresolvedCount = 2; let valueIndex = 0; const resolvedValues = []; - for (let value of values) { if (!isThenable(value)) { value = this.resolve(value); } - const curValueIndex = valueIndex; - try { value.then(value => { resolvedValues[curValueIndex] = callback ? callback.thenCallback(value) : value; unresolvedCount--; - if (unresolvedCount === 0) { resolve(resolvedValues); } @@ -1672,7 +1413,6 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { } else { resolvedValues[curValueIndex] = callback.errorCallback(err); unresolvedCount--; - if (unresolvedCount === 0) { resolve(resolvedValues); } @@ -1681,155 +1421,131 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { } catch (thenErr) { reject(thenErr); } - unresolvedCount++; valueIndex++; - } // Make the unresolvedCount zero-based again. - - + } + // Make the unresolvedCount zero-based again. unresolvedCount -= 2; - if (unresolvedCount === 0) { resolve(resolvedValues); } - return promise; } - constructor(executor) { const promise = this; - if (!(promise instanceof ZoneAwarePromise)) { throw new Error('Must be an instanceof Promise.'); } - promise[symbolState] = UNRESOLVED; promise[symbolValue] = []; // queue; - try { - executor && executor(makeResolver(promise, RESOLVED), makeResolver(promise, REJECTED)); + const onceWrapper = once(); + executor && executor(onceWrapper(makeResolver(promise, RESOLVED)), onceWrapper(makeResolver(promise, REJECTED))); } catch (error) { resolvePromise(promise, false, error); } } - get [Symbol.toStringTag]() { return 'Promise'; } - get [Symbol.species]() { return ZoneAwarePromise; } - then(onFulfilled, onRejected) { - let C = this.constructor[Symbol.species]; - + var _a; + // We must read `Symbol.species` safely because `this` may be anything. For instance, `this` + // may be an object without a prototype (created through `Object.create(null)`); thus + // `this.constructor` will be undefined. One of the use cases is SystemJS creating + // prototype-less objects (modules) via `Object.create(null)`. The SystemJS creates an empty + // object and copies promise properties into that object (within the `getOrCreateLoad` + // function). The zone.js then checks if the resolved value has the `then` method and invokes + // it with the `value` context. Otherwise, this will throw an error: `TypeError: Cannot read + // properties of undefined (reading 'Symbol(Symbol.species)')`. + let C = (_a = this.constructor) === null || _a === void 0 ? void 0 : _a[Symbol.species]; if (!C || typeof C !== 'function') { C = this.constructor || ZoneAwarePromise; } - const chainPromise = new C(noop); const zone = Zone.current; - if (this[symbolState] == UNRESOLVED) { this[symbolValue].push(zone, chainPromise, onFulfilled, onRejected); } else { scheduleResolveOrReject(this, zone, chainPromise, onFulfilled, onRejected); } - return chainPromise; } - catch(onRejected) { return this.then(null, onRejected); } - finally(onFinally) { - let C = this.constructor[Symbol.species]; - + var _a; + // See comment on the call to `then` about why thee `Symbol.species` is safely accessed. + let C = (_a = this.constructor) === null || _a === void 0 ? void 0 : _a[Symbol.species]; if (!C || typeof C !== 'function') { C = ZoneAwarePromise; } - const chainPromise = new C(noop); chainPromise[symbolFinally] = symbolFinally; const zone = Zone.current; - if (this[symbolState] == UNRESOLVED) { this[symbolValue].push(zone, chainPromise, onFinally, onFinally); } else { scheduleResolveOrReject(this, zone, chainPromise, onFinally, onFinally); } - return chainPromise; } - - } // Protect against aggressive optimizers dropping seemingly unused properties. + } + // Protect against aggressive optimizers dropping seemingly unused properties. // E.g. Closure Compiler in advanced mode. - - ZoneAwarePromise['resolve'] = ZoneAwarePromise.resolve; ZoneAwarePromise['reject'] = ZoneAwarePromise.reject; ZoneAwarePromise['race'] = ZoneAwarePromise.race; ZoneAwarePromise['all'] = ZoneAwarePromise.all; const NativePromise = global[symbolPromise] = global['Promise']; global['Promise'] = ZoneAwarePromise; - const symbolThenPatched = __symbol__('thenPatched'); - function patchThen(Ctor) { const proto = Ctor.prototype; const prop = ObjectGetOwnPropertyDescriptor(proto, 'then'); - if (prop && (prop.writable === false || !prop.configurable)) { // check Ctor.prototype.then propertyDescriptor is writable or not // in meteor env, writable is false, we should ignore such case return; } - - const originalThen = proto.then; // Keep a reference to the original method. - + const originalThen = proto.then; + // Keep a reference to the original method. proto[symbolThen] = originalThen; - Ctor.prototype.then = function (onResolve, onReject) { const wrapped = new ZoneAwarePromise((resolve, reject) => { originalThen.call(this, resolve, reject); }); return wrapped.then(onResolve, onReject); }; - Ctor[symbolThenPatched] = true; } - api.patchThen = patchThen; - function zoneify(fn) { return function (self, args) { let resultPromise = fn.apply(self, args); - if (resultPromise instanceof ZoneAwarePromise) { return resultPromise; } - let ctor = resultPromise.constructor; - if (!ctor[symbolThenPatched]) { patchThen(ctor); } - return resultPromise; }; } - if (NativePromise) { patchThen(NativePromise); patchMethod(global, 'fetch', delegate => zoneify(delegate)); - } // This is not part of public API, but it is useful for tests, so we expose it. - - + } + // This is not part of public API, but it is useful for tests, so we expose it. Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors; return ZoneAwarePromise; }); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -1839,19 +1555,15 @@ Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => { */ // override Function.prototype.toString to make zone.js patched function // look like native function - - Zone.__load_patch('toString', global => { // patch Func.prototype.toString to let them look like native const originalFunctionToString = Function.prototype.toString; const ORIGINAL_DELEGATE_SYMBOL = zoneSymbol('OriginalDelegate'); const PROMISE_SYMBOL = zoneSymbol('Promise'); const ERROR_SYMBOL = zoneSymbol('Error'); - const newFunctionToString = function toString() { if (typeof this === 'function') { const originalDelegate = this[ORIGINAL_DELEGATE_SYMBOL]; - if (originalDelegate) { if (typeof originalDelegate === 'function') { return originalFunctionToString.call(originalDelegate); @@ -1859,41 +1571,34 @@ Zone.__load_patch('toString', global => { return Object.prototype.toString.call(originalDelegate); } } - if (this === Promise) { const nativePromise = global[PROMISE_SYMBOL]; - if (nativePromise) { return originalFunctionToString.call(nativePromise); } } - if (this === Error) { const nativeError = global[ERROR_SYMBOL]; - if (nativeError) { return originalFunctionToString.call(nativeError); } } } - return originalFunctionToString.call(this); }; - newFunctionToString[ORIGINAL_DELEGATE_SYMBOL] = originalFunctionToString; - Function.prototype.toString = newFunctionToString; // patch Object.prototype.toString to let them look like native - + Function.prototype.toString = newFunctionToString; + // patch Object.prototype.toString to let them look like native const originalObjectToString = Object.prototype.toString; const PROMISE_OBJECT_TO_STRING = '[object Promise]'; - Object.prototype.toString = function () { if (typeof Promise === 'function' && this instanceof Promise) { return PROMISE_OBJECT_TO_STRING; } - return originalObjectToString.call(this); }; }); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -1901,10 +1606,7 @@ Zone.__load_patch('toString', global => { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - let passiveSupported = false; - if (typeof window !== 'undefined') { try { const options = Object.defineProperty({}, 'passive', { @@ -1912,33 +1614,33 @@ if (typeof window !== 'undefined') { passiveSupported = true; } }); + // Note: We pass the `options` object as the event handler too. This is not compatible with the + // signature of `addEventListener` or `removeEventListener` but enables us to remove the handler + // without an actual handler. window.addEventListener('test', options, options); window.removeEventListener('test', options, options); } catch (err) { passiveSupported = false; } -} // an identifier to tell ZoneTask do not create a new invoke closure - - +} +// an identifier to tell ZoneTask do not create a new invoke closure const OPTIMIZED_ZONE_EVENT_TASK_DATA = { useG: true }; -const zoneSymbolEventNames$1 = {}; +const zoneSymbolEventNames = {}; const globalSources = {}; const EVENT_NAME_SYMBOL_REGX = new RegExp('^' + ZONE_SYMBOL_PREFIX + '(\\w+)(true|false)$'); const IMMEDIATE_PROPAGATION_SYMBOL = zoneSymbol('propagationStopped'); - function prepareEventNames(eventName, eventNameToString) { const falseEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + FALSE_STR; const trueEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + TRUE_STR; const symbol = ZONE_SYMBOL_PREFIX + falseEventName; const symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName; - zoneSymbolEventNames$1[eventName] = {}; - zoneSymbolEventNames$1[eventName][FALSE_STR] = symbol; - zoneSymbolEventNames$1[eventName][TRUE_STR] = symbolCapture; + zoneSymbolEventNames[eventName] = {}; + zoneSymbolEventNames[eventName][FALSE_STR] = symbol; + zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture; } - -function patchEventTarget(_global, apis, patchOptions) { +function patchEventTarget(_global, api, apis, patchOptions) { const ADD_EVENT_LISTENER = patchOptions && patchOptions.add || ADD_EVENT_LISTENER_STR; const REMOVE_EVENT_LISTENER = patchOptions && patchOptions.rm || REMOVE_EVENT_LISTENER_STR; const LISTENERS_EVENT_LISTENER = patchOptions && patchOptions.listeners || 'eventListeners'; @@ -1947,27 +1649,29 @@ function patchEventTarget(_global, apis, patchOptions) { const ADD_EVENT_LISTENER_SOURCE = '.' + ADD_EVENT_LISTENER + ':'; const PREPEND_EVENT_LISTENER = 'prependListener'; const PREPEND_EVENT_LISTENER_SOURCE = '.' + PREPEND_EVENT_LISTENER + ':'; - const invokeTask = function (task, target, event) { // for better performance, check isRemoved which is set // by removeEventListener if (task.isRemoved) { return; } - const delegate = task.callback; - if (typeof delegate === 'object' && delegate.handleEvent) { // create the bind version of handleEvent when invoke task.callback = event => delegate.handleEvent(event); - task.originalDelegate = delegate; - } // invoke static task.invoke - - - task.invoke(task, target, [event]); + } + // invoke static task.invoke + // need to try/catch error here, otherwise, the error in one event listener + // will break the executions of the other event listeners. Also error will + // not remove the event listener when `once` options is true. + let error; + try { + task.invoke(task, target, [event]); + } catch (err) { + error = err; + } const options = task.options; - if (options && typeof options === 'object' && options.once) { // if options.once is true, after invoke once remove listener here // only browser need to do this, nodejs eventEmitter will cal removeListener @@ -1975,135 +1679,101 @@ function patchEventTarget(_global, apis, patchOptions) { const delegate = task.originalDelegate ? task.originalDelegate : task.callback; target[REMOVE_EVENT_LISTENER].call(target, event.type, delegate, options); } - }; // global shared zoneAwareCallback to handle all event callback with capture = false - - - const globalZoneAwareCallback = function (event) { + return error; + }; + function globalCallback(context, event, isCapture) { // https://github.com/angular/zone.js/issues/911, in IE, sometimes // event will be undefined, so we need to use window.event event = event || _global.event; - if (!event) { return; - } // event.target is needed for Samsung TV and SourceBuffer + } + // event.target is needed for Samsung TV and SourceBuffer // || global is needed https://github.com/angular/zone.js/issues/190 - - - const target = this || event.target || _global; - const tasks = target[zoneSymbolEventNames$1[event.type][FALSE_STR]]; - + const target = context || event.target || _global; + const tasks = target[zoneSymbolEventNames[event.type][isCapture ? TRUE_STR : FALSE_STR]]; if (tasks) { + const errors = []; // invoke all tasks which attached to current target with given event.type and capture = false // for performance concern, if task.length === 1, just invoke if (tasks.length === 1) { - invokeTask(tasks[0], target, event); + const err = invokeTask(tasks[0], target, event); + err && errors.push(err); } else { // https://github.com/angular/zone.js/issues/836 // copy the tasks array before invoke, to avoid // the callback will remove itself or other listener const copyTasks = tasks.slice(); - for (let i = 0; i < copyTasks.length; i++) { if (event && event[IMMEDIATE_PROPAGATION_SYMBOL] === true) { break; } - - invokeTask(copyTasks[i], target, event); + const err = invokeTask(copyTasks[i], target, event); + err && errors.push(err); } } - } - }; // global shared zoneAwareCallback to handle all event callback with capture = true - - - const globalZoneAwareCaptureCallback = function (event) { - // https://github.com/angular/zone.js/issues/911, in IE, sometimes - // event will be undefined, so we need to use window.event - event = event || _global.event; - - if (!event) { - return; - } // event.target is needed for Samsung TV and SourceBuffer - // || global is needed https://github.com/angular/zone.js/issues/190 - - - const target = this || event.target || _global; - const tasks = target[zoneSymbolEventNames$1[event.type][TRUE_STR]]; - - if (tasks) { - // invoke all tasks which attached to current target with given event.type and capture = false - // for performance concern, if task.length === 1, just invoke - if (tasks.length === 1) { - invokeTask(tasks[0], target, event); + // Since there is only one error, we don't need to schedule microTask + // to throw the error. + if (errors.length === 1) { + throw errors[0]; } else { - // https://github.com/angular/zone.js/issues/836 - // copy the tasks array before invoke, to avoid - // the callback will remove itself or other listener - const copyTasks = tasks.slice(); - - for (let i = 0; i < copyTasks.length; i++) { - if (event && event[IMMEDIATE_PROPAGATION_SYMBOL] === true) { - break; - } - - invokeTask(copyTasks[i], target, event); + for (let i = 0; i < errors.length; i++) { + const err = errors[i]; + api.nativeScheduleMicroTask(() => { + throw err; + }); } } } + } + // global shared zoneAwareCallback to handle all event callback with capture = false + const globalZoneAwareCallback = function (event) { + return globalCallback(this, event, false); + }; + // global shared zoneAwareCallback to handle all event callback with capture = true + const globalZoneAwareCaptureCallback = function (event) { + return globalCallback(this, event, true); }; - function patchEventTargetMethods(obj, patchOptions) { if (!obj) { return false; } - let useGlobalCallback = true; - if (patchOptions && patchOptions.useG !== undefined) { useGlobalCallback = patchOptions.useG; } - const validateHandler = patchOptions && patchOptions.vh; let checkDuplicate = true; - if (patchOptions && patchOptions.chkDup !== undefined) { checkDuplicate = patchOptions.chkDup; } - let returnTarget = false; - if (patchOptions && patchOptions.rt !== undefined) { returnTarget = patchOptions.rt; } - let proto = obj; - while (proto && !proto.hasOwnProperty(ADD_EVENT_LISTENER)) { proto = ObjectGetPrototypeOf(proto); } - if (!proto && obj[ADD_EVENT_LISTENER]) { // somehow we did not find it, but we can see it. This happens on IE for Window properties. proto = obj; } - if (!proto) { return false; } - if (proto[zoneSymbolAddEventListener]) { return false; } - - const eventNameToString = patchOptions && patchOptions.eventNameToString; // a shared global taskData to pass data for scheduleEventTask + const eventNameToString = patchOptions && patchOptions.eventNameToString; + // a shared global taskData to pass data for scheduleEventTask // so we do not need to create a new object just for pass some data - const taskData = {}; const nativeAddEventListener = proto[zoneSymbolAddEventListener] = proto[ADD_EVENT_LISTENER]; const nativeRemoveEventListener = proto[zoneSymbol(REMOVE_EVENT_LISTENER)] = proto[REMOVE_EVENT_LISTENER]; const nativeListeners = proto[zoneSymbol(LISTENERS_EVENT_LISTENER)] = proto[LISTENERS_EVENT_LISTENER]; const nativeRemoveAllListeners = proto[zoneSymbol(REMOVE_ALL_LISTENERS_EVENT_LISTENER)] = proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER]; let nativePrependEventListener; - if (patchOptions && patchOptions.prepend) { nativePrependEventListener = proto[zoneSymbol(patchOptions.prepend)] = proto[patchOptions.prepend]; } @@ -2111,8 +1781,6 @@ function patchEventTarget(_global, apis, patchOptions) { * This util function will build an option object with passive option * to handle all possible input from the user. */ - - function buildEventListenerOptions(options, passive) { if (!passiveSupported && typeof options === 'object' && options) { // doesn't support passive but user want to pass an object as options. @@ -2120,156 +1788,122 @@ function patchEventTarget(_global, apis, patchOptions) { // as useCapture parameter return !!options.capture; } - if (!passiveSupported || !passive) { return options; } - if (typeof options === 'boolean') { return { capture: options, passive: true }; } - if (!options) { return { passive: true }; } - if (typeof options === 'object' && options.passive !== false) { return Object.assign(Object.assign({}, options), { passive: true }); } - return options; } - const customScheduleGlobal = function (task) { // if there is already a task for the eventName + capture, // just return, because we use the shared globalZoneAwareCallback here. if (taskData.isExisting) { return; } - return nativeAddEventListener.call(taskData.target, taskData.eventName, taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, taskData.options); }; - const customCancelGlobal = function (task) { // if task is not marked as isRemoved, this call is directly // from Zone.prototype.cancelTask, we should remove the task // from tasksList of target first if (!task.isRemoved) { - const symbolEventNames = zoneSymbolEventNames$1[task.eventName]; + const symbolEventNames = zoneSymbolEventNames[task.eventName]; let symbolEventName; - if (symbolEventNames) { symbolEventName = symbolEventNames[task.capture ? TRUE_STR : FALSE_STR]; } - const existingTasks = symbolEventName && task.target[symbolEventName]; - if (existingTasks) { for (let i = 0; i < existingTasks.length; i++) { const existingTask = existingTasks[i]; - if (existingTask === task) { - existingTasks.splice(i, 1); // set isRemoved to data for faster invokeTask check - + existingTasks.splice(i, 1); + // set isRemoved to data for faster invokeTask check task.isRemoved = true; - if (existingTasks.length === 0) { // all tasks for the eventName + capture have gone, // remove globalZoneAwareCallback and remove the task cache from target task.allRemoved = true; task.target[symbolEventName] = null; } - break; } } } - } // if all tasks for the eventName + capture have gone, + } + // if all tasks for the eventName + capture have gone, // we will really remove the global event callback, // if not, return - - if (!task.allRemoved) { return; } - return nativeRemoveEventListener.call(task.target, task.eventName, task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, task.options); }; - const customScheduleNonGlobal = function (task) { return nativeAddEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options); }; - const customSchedulePrepend = function (task) { return nativePrependEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options); }; - const customCancelNonGlobal = function (task) { return nativeRemoveEventListener.call(task.target, task.eventName, task.invoke, task.options); }; - const customSchedule = useGlobalCallback ? customScheduleGlobal : customScheduleNonGlobal; const customCancel = useGlobalCallback ? customCancelGlobal : customCancelNonGlobal; - const compareTaskCallbackVsDelegate = function (task, delegate) { const typeOfDelegate = typeof delegate; return typeOfDelegate === 'function' && task.callback === delegate || typeOfDelegate === 'object' && task.originalDelegate === delegate; }; - const compare = patchOptions && patchOptions.diff ? patchOptions.diff : compareTaskCallbackVsDelegate; const unpatchedEvents = Zone[zoneSymbol('UNPATCHED_EVENTS')]; - const passiveEvents = _global[zoneSymbol('PASSIVE_EVENTS')]; - const makeAddListener = function (nativeListener, addSource, customScheduleFn, customCancelFn, returnTarget = false, prepend = false) { return function () { const target = this || _global; let eventName = arguments[0]; - if (patchOptions && patchOptions.transferEventName) { eventName = patchOptions.transferEventName(eventName); } - let delegate = arguments[1]; - if (!delegate) { return nativeListener.apply(this, arguments); } - if (isNode && eventName === 'uncaughtException') { // don't patch uncaughtException of nodejs to prevent endless loop return nativeListener.apply(this, arguments); - } // don't create the bind delegate function for handleEvent + } + // don't create the bind delegate function for handleEvent // case here to improve addEventListener performance // we will create the bind delegate when invoke - - let isHandleEvent = false; - if (typeof delegate !== 'function') { if (!delegate.handleEvent) { return nativeListener.apply(this, arguments); } - isHandleEvent = true; } - if (validateHandler && !validateHandler(nativeListener, delegate, target, arguments)) { return; } - const passive = passiveSupported && !!passiveEvents && passiveEvents.indexOf(eventName) !== -1; const options = buildEventListenerOptions(arguments[2], passive); - if (unpatchedEvents) { - // check upatched list + // check unpatched list for (let i = 0; i < unpatchedEvents.length; i++) { if (eventName === unpatchedEvents[i]) { if (passive) { @@ -2280,25 +1914,20 @@ function patchEventTarget(_global, apis, patchOptions) { } } } - const capture = !options ? false : typeof options === 'boolean' ? true : options.capture; const once = options && typeof options === 'object' ? options.once : false; const zone = Zone.current; - let symbolEventNames = zoneSymbolEventNames$1[eventName]; - + let symbolEventNames = zoneSymbolEventNames[eventName]; if (!symbolEventNames) { prepareEventNames(eventName, eventNameToString); - symbolEventNames = zoneSymbolEventNames$1[eventName]; + symbolEventNames = zoneSymbolEventNames[eventName]; } - const symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR]; let existingTasks = target[symbolEventName]; let isExisting = false; - if (existingTasks) { // already have task registered isExisting = true; - if (checkDuplicate) { for (let i = 0; i < existingTasks.length; i++) { if (compare(existingTasks[i], delegate)) { @@ -2310,226 +1939,181 @@ function patchEventTarget(_global, apis, patchOptions) { } else { existingTasks = target[symbolEventName] = []; } - let source; const constructorName = target.constructor['name']; const targetSource = globalSources[constructorName]; - if (targetSource) { source = targetSource[eventName]; } - if (!source) { source = constructorName + addSource + (eventNameToString ? eventNameToString(eventName) : eventName); - } // do not create a new object as task.data to pass those things + } + // do not create a new object as task.data to pass those things // just use the global shared one - - taskData.options = options; - if (once) { // if addEventListener with once options, we don't pass it to // native addEventListener, instead we keep the once setting // and handle ourselves. taskData.options.once = false; } - taskData.target = target; taskData.capture = capture; taskData.eventName = eventName; taskData.isExisting = isExisting; - const data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : undefined; // keep taskData into data to allow onScheduleEventTask to access the task information - + const data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : undefined; + // keep taskData into data to allow onScheduleEventTask to access the task information if (data) { data.taskData = taskData; } - - const task = zone.scheduleEventTask(source, delegate, data, customScheduleFn, customCancelFn); // should clear taskData.target to avoid memory leak + const task = zone.scheduleEventTask(source, delegate, data, customScheduleFn, customCancelFn); + // should clear taskData.target to avoid memory leak // issue, https://github.com/angular/angular/issues/20442 - - taskData.target = null; // need to clear up taskData because it is a global object - + taskData.target = null; + // need to clear up taskData because it is a global object if (data) { data.taskData = null; - } // have to save those information to task in case + } + // have to save those information to task in case // application may call task.zone.cancelTask() directly - - if (once) { options.once = true; } - if (!(!passiveSupported && typeof task.options === 'boolean')) { // if not support passive, and we pass an option object // to addEventListener, we should save the options to task task.options = options; } - task.target = target; task.capture = capture; task.eventName = eventName; - if (isHandleEvent) { // save original delegate for compare to check duplicate task.originalDelegate = delegate; } - if (!prepend) { existingTasks.push(task); } else { existingTasks.unshift(task); } - if (returnTarget) { return target; } }; }; - proto[ADD_EVENT_LISTENER] = makeAddListener(nativeAddEventListener, ADD_EVENT_LISTENER_SOURCE, customSchedule, customCancel, returnTarget); - if (nativePrependEventListener) { proto[PREPEND_EVENT_LISTENER] = makeAddListener(nativePrependEventListener, PREPEND_EVENT_LISTENER_SOURCE, customSchedulePrepend, customCancel, returnTarget, true); } - proto[REMOVE_EVENT_LISTENER] = function () { const target = this || _global; let eventName = arguments[0]; - if (patchOptions && patchOptions.transferEventName) { eventName = patchOptions.transferEventName(eventName); } - const options = arguments[2]; const capture = !options ? false : typeof options === 'boolean' ? true : options.capture; const delegate = arguments[1]; - if (!delegate) { return nativeRemoveEventListener.apply(this, arguments); } - if (validateHandler && !validateHandler(nativeRemoveEventListener, delegate, target, arguments)) { return; } - - const symbolEventNames = zoneSymbolEventNames$1[eventName]; + const symbolEventNames = zoneSymbolEventNames[eventName]; let symbolEventName; - if (symbolEventNames) { symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR]; } - const existingTasks = symbolEventName && target[symbolEventName]; - if (existingTasks) { for (let i = 0; i < existingTasks.length; i++) { const existingTask = existingTasks[i]; - if (compare(existingTask, delegate)) { - existingTasks.splice(i, 1); // set isRemoved to data for faster invokeTask check - + existingTasks.splice(i, 1); + // set isRemoved to data for faster invokeTask check existingTask.isRemoved = true; - if (existingTasks.length === 0) { // all tasks for the eventName + capture have gone, // remove globalZoneAwareCallback and remove the task cache from target existingTask.allRemoved = true; - target[symbolEventName] = null; // in the target, we have an event listener which is added by on_property + target[symbolEventName] = null; + // in the target, we have an event listener which is added by on_property // such as target.onclick = function() {}, so we need to clear this internal // property too if all delegates all removed - if (typeof eventName === 'string') { const onPropertySymbol = ZONE_SYMBOL_PREFIX + 'ON_PROPERTY' + eventName; target[onPropertySymbol] = null; } } - existingTask.zone.cancelTask(existingTask); - if (returnTarget) { return target; } - return; } } - } // issue 930, didn't find the event name or callback + } + // issue 930, didn't find the event name or callback // from zone kept existingTasks, the callback maybe // added outside of zone, we need to call native removeEventListener // to try to remove it. - - return nativeRemoveEventListener.apply(this, arguments); }; - proto[LISTENERS_EVENT_LISTENER] = function () { const target = this || _global; let eventName = arguments[0]; - if (patchOptions && patchOptions.transferEventName) { eventName = patchOptions.transferEventName(eventName); } - const listeners = []; const tasks = findEventTasks(target, eventNameToString ? eventNameToString(eventName) : eventName); - for (let i = 0; i < tasks.length; i++) { const task = tasks[i]; let delegate = task.originalDelegate ? task.originalDelegate : task.callback; listeners.push(delegate); } - return listeners; }; - proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER] = function () { const target = this || _global; let eventName = arguments[0]; - if (!eventName) { const keys = Object.keys(target); - for (let i = 0; i < keys.length; i++) { const prop = keys[i]; const match = EVENT_NAME_SYMBOL_REGX.exec(prop); - let evtName = match && match[1]; // in nodejs EventEmitter, removeListener event is + let evtName = match && match[1]; + // in nodejs EventEmitter, removeListener event is // used for monitoring the removeListener call, // so just keep removeListener eventListener until // all other eventListeners are removed - if (evtName && evtName !== 'removeListener') { this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, evtName); } - } // remove removeListener listener finally - - + } + // remove removeListener listener finally this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, 'removeListener'); } else { if (patchOptions && patchOptions.transferEventName) { eventName = patchOptions.transferEventName(eventName); } - - const symbolEventNames = zoneSymbolEventNames$1[eventName]; - + const symbolEventNames = zoneSymbolEventNames[eventName]; if (symbolEventNames) { const symbolEventName = symbolEventNames[FALSE_STR]; const symbolCaptureEventName = symbolEventNames[TRUE_STR]; const tasks = target[symbolEventName]; const captureTasks = target[symbolCaptureEventName]; - if (tasks) { const removeTasks = tasks.slice(); - for (let i = 0; i < removeTasks.length; i++) { const task = removeTasks[i]; let delegate = task.originalDelegate ? task.originalDelegate : task.callback; this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options); } } - if (captureTasks) { const removeTasks = captureTasks.slice(); - for (let i = 0; i < removeTasks.length; i++) { const task = removeTasks[i]; let delegate = task.originalDelegate ? task.originalDelegate : task.callback; @@ -2538,47 +2122,35 @@ function patchEventTarget(_global, apis, patchOptions) { } } } - if (returnTarget) { return this; } - }; // for native toString patch - - + }; + // for native toString patch attachOriginToPatched(proto[ADD_EVENT_LISTENER], nativeAddEventListener); attachOriginToPatched(proto[REMOVE_EVENT_LISTENER], nativeRemoveEventListener); - if (nativeRemoveAllListeners) { attachOriginToPatched(proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER], nativeRemoveAllListeners); } - if (nativeListeners) { attachOriginToPatched(proto[LISTENERS_EVENT_LISTENER], nativeListeners); } - return true; } - let results = []; - for (let i = 0; i < apis.length; i++) { results[i] = patchEventTargetMethods(apis[i], patchOptions); } - return results; } - function findEventTasks(target, eventName) { if (!eventName) { const foundTasks = []; - for (let prop in target) { const match = EVENT_NAME_SYMBOL_REGX.exec(prop); let evtName = match && match[1]; - if (evtName && (!eventName || evtName === eventName)) { const tasks = target[prop]; - if (tasks) { for (let i = 0; i < tasks.length; i++) { foundTasks.push(tasks[i]); @@ -2586,40 +2158,34 @@ function findEventTasks(target, eventName) { } } } - return foundTasks; } - - let symbolEventName = zoneSymbolEventNames$1[eventName]; - + let symbolEventName = zoneSymbolEventNames[eventName]; if (!symbolEventName) { prepareEventNames(eventName); - symbolEventName = zoneSymbolEventNames$1[eventName]; + symbolEventName = zoneSymbolEventNames[eventName]; } - const captureFalseTasks = target[symbolEventName[FALSE_STR]]; const captureTrueTasks = target[symbolEventName[TRUE_STR]]; - if (!captureFalseTasks) { return captureTrueTasks ? captureTrueTasks.slice() : []; } else { return captureTrueTasks ? captureFalseTasks.concat(captureTrueTasks) : captureFalseTasks.slice(); } } - function patchEventPrototype(global, api) { const Event = global['Event']; - if (Event && Event.prototype) { api.patchMethod(Event.prototype, 'stopImmediatePropagation', delegate => function (self, args) { - self[IMMEDIATE_PROPAGATION_SYMBOL] = true; // we need to call the native stopImmediatePropagation + self[IMMEDIATE_PROPAGATION_SYMBOL] = true; + // we need to call the native stopImmediatePropagation // in case in some hybrid application, some part of // application will be controlled by zone, some are not - delegate && delegate.apply(self, args); }); } } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -2627,44 +2193,48 @@ function patchEventPrototype(global, api) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - function patchCallbacks(api, target, targetName, method, callbacks) { const symbol = Zone.__symbol__(method); - if (target[symbol]) { return; } - const nativeDelegate = target[symbol] = target[method]; - target[method] = function (name, opts, options) { if (opts && opts.prototype) { callbacks.forEach(function (callback) { const source = `${targetName}.${method}::` + callback; const prototype = opts.prototype; - - if (prototype.hasOwnProperty(callback)) { - const descriptor = api.ObjectGetOwnPropertyDescriptor(prototype, callback); - - if (descriptor && descriptor.value) { - descriptor.value = api.wrapWithCurrentZone(descriptor.value, source); - - api._redefineProperty(opts.prototype, callback, descriptor); + // Note: the `patchCallbacks` is used for patching the `document.registerElement` and + // `customElements.define`. We explicitly wrap the patching code into try-catch since + // callbacks may be already patched by other web components frameworks (e.g. LWC), and they + // make those properties non-writable. This means that patching callback will throw an error + // `cannot assign to read-only property`. See this code as an example: + // https://github.com/salesforce/lwc/blob/master/packages/@lwc/engine-core/src/framework/base-bridge-element.ts#L180-L186 + // We don't want to stop the application rendering if we couldn't patch some + // callback, e.g. `attributeChangedCallback`. + try { + if (prototype.hasOwnProperty(callback)) { + const descriptor = api.ObjectGetOwnPropertyDescriptor(prototype, callback); + if (descriptor && descriptor.value) { + descriptor.value = api.wrapWithCurrentZone(descriptor.value, source); + api._redefineProperty(opts.prototype, callback, descriptor); + } else if (prototype[callback]) { + prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source); + } } else if (prototype[callback]) { prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source); } - } else if (prototype[callback]) { - prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source); + } catch (_a) { + // Note: we leave the catch block empty since there's no way to handle the error related + // to non-writable property. } }); } - return nativeDelegate.call(target, name, opts, options); }; - api.attachOriginToPatched(target[method], nativeDelegate); } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -2672,126 +2242,62 @@ function patchCallbacks(api, target, targetName, method, callbacks) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - -const globalEventHandlersEventNames = ['abort', 'animationcancel', 'animationend', 'animationiteration', 'auxclick', 'beforeinput', 'blur', 'cancel', 'canplay', 'canplaythrough', 'change', 'compositionstart', 'compositionupdate', 'compositionend', 'cuechange', 'click', 'close', 'contextmenu', 'curechange', 'dblclick', 'drag', 'dragend', 'dragenter', 'dragexit', 'dragleave', 'dragover', 'drop', 'durationchange', 'emptied', 'ended', 'error', 'focus', 'focusin', 'focusout', 'gotpointercapture', 'input', 'invalid', 'keydown', 'keypress', 'keyup', 'load', 'loadstart', 'loadeddata', 'loadedmetadata', 'lostpointercapture', 'mousedown', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover', 'mouseup', 'mousewheel', 'orientationchange', 'pause', 'play', 'playing', 'pointercancel', 'pointerdown', 'pointerenter', 'pointerleave', 'pointerlockchange', 'mozpointerlockchange', 'webkitpointerlockerchange', 'pointerlockerror', 'mozpointerlockerror', 'webkitpointerlockerror', 'pointermove', 'pointout', 'pointerover', 'pointerup', 'progress', 'ratechange', 'reset', 'resize', 'scroll', 'seeked', 'seeking', 'select', 'selectionchange', 'selectstart', 'show', 'sort', 'stalled', 'submit', 'suspend', 'timeupdate', 'volumechange', 'touchcancel', 'touchmove', 'touchstart', 'touchend', 'transitioncancel', 'transitionend', 'waiting', 'wheel']; -const documentEventNames = ['afterscriptexecute', 'beforescriptexecute', 'DOMContentLoaded', 'freeze', 'fullscreenchange', 'mozfullscreenchange', 'webkitfullscreenchange', 'msfullscreenchange', 'fullscreenerror', 'mozfullscreenerror', 'webkitfullscreenerror', 'msfullscreenerror', 'readystatechange', 'visibilitychange', 'resume']; -const windowEventNames = ['absolutedeviceorientation', 'afterinput', 'afterprint', 'appinstalled', 'beforeinstallprompt', 'beforeprint', 'beforeunload', 'devicelight', 'devicemotion', 'deviceorientation', 'deviceorientationabsolute', 'deviceproximity', 'hashchange', 'languagechange', 'message', 'mozbeforepaint', 'offline', 'online', 'paint', 'pageshow', 'pagehide', 'popstate', 'rejectionhandled', 'storage', 'unhandledrejection', 'unload', 'userproximity', 'vrdisplayconnected', 'vrdisplaydisconnected', 'vrdisplaypresentchange']; -const htmlElementEventNames = ['beforecopy', 'beforecut', 'beforepaste', 'copy', 'cut', 'paste', 'dragstart', 'loadend', 'animationstart', 'search', 'transitionrun', 'transitionstart', 'webkitanimationend', 'webkitanimationiteration', 'webkitanimationstart', 'webkittransitionend']; -const mediaElementEventNames = ['encrypted', 'waitingforkey', 'msneedkey', 'mozinterruptbegin', 'mozinterruptend']; -const ieElementEventNames = ['activate', 'afterupdate', 'ariarequest', 'beforeactivate', 'beforedeactivate', 'beforeeditfocus', 'beforeupdate', 'cellchange', 'controlselect', 'dataavailable', 'datasetchanged', 'datasetcomplete', 'errorupdate', 'filterchange', 'layoutcomplete', 'losecapture', 'move', 'moveend', 'movestart', 'propertychange', 'resizeend', 'resizestart', 'rowenter', 'rowexit', 'rowsdelete', 'rowsinserted', 'command', 'compassneedscalibration', 'deactivate', 'help', 'mscontentzoom', 'msmanipulationstatechanged', 'msgesturechange', 'msgesturedoubletap', 'msgestureend', 'msgesturehold', 'msgesturestart', 'msgesturetap', 'msgotpointercapture', 'msinertiastart', 'mslostpointercapture', 'mspointercancel', 'mspointerdown', 'mspointerenter', 'mspointerhover', 'mspointerleave', 'mspointermove', 'mspointerout', 'mspointerover', 'mspointerup', 'pointerout', 'mssitemodejumplistitemremoved', 'msthumbnailclick', 'stop', 'storagecommit']; -const webglEventNames = ['webglcontextrestored', 'webglcontextlost', 'webglcontextcreationerror']; -const formEventNames = ['autocomplete', 'autocompleteerror']; -const detailEventNames = ['toggle']; -const frameEventNames = ['load']; -const frameSetEventNames = ['blur', 'error', 'focus', 'load', 'resize', 'scroll', 'messageerror']; -const marqueeEventNames = ['bounce', 'finish', 'start']; -const XMLHttpRequestEventNames = ['loadstart', 'progress', 'abort', 'error', 'load', 'progress', 'timeout', 'loadend', 'readystatechange']; -const IDBIndexEventNames = ['upgradeneeded', 'complete', 'abort', 'success', 'error', 'blocked', 'versionchange', 'close']; -const websocketEventNames = ['close', 'error', 'open', 'message']; -const workerEventNames = ['error', 'message']; -const eventNames = globalEventHandlersEventNames.concat(webglEventNames, formEventNames, detailEventNames, documentEventNames, windowEventNames, htmlElementEventNames, ieElementEventNames); - function filterProperties(target, onProperties, ignoreProperties) { if (!ignoreProperties || ignoreProperties.length === 0) { return onProperties; } - const tip = ignoreProperties.filter(ip => ip.target === target); - if (!tip || tip.length === 0) { return onProperties; } - const targetIgnoreProperties = tip[0].ignoreProperties; return onProperties.filter(op => targetIgnoreProperties.indexOf(op) === -1); } - function patchFilteredProperties(target, onProperties, ignoreProperties, prototype) { // check whether target is available, sometimes target will be undefined // because different browser or some 3rd party plugin. if (!target) { return; } - const filteredProperties = filterProperties(target, onProperties, ignoreProperties); patchOnProperties(target, filteredProperties, prototype); } - +/** + * Get all event name properties which the event name startsWith `on` + * from the target object itself, inherited properties are not considered. + */ +function getOnEventNames(target) { + return Object.getOwnPropertyNames(target).filter(name => name.startsWith('on') && name.length > 2).map(name => name.substring(2)); +} function propertyDescriptorPatch(api, _global) { if (isNode && !isMix) { return; } - if (Zone[api.symbol('patchEvents')]) { // events are already been patched by legacy patch. return; } - - const supportsWebSocket = typeof WebSocket !== 'undefined'; - const ignoreProperties = _global['__Zone_ignore_on_properties']; // for browsers that we can patch the descriptor: Chrome & Firefox - + const ignoreProperties = _global['__Zone_ignore_on_properties']; + // for browsers that we can patch the descriptor: Chrome & Firefox + let patchTargets = []; if (isBrowser) { const internalWindow = window; + patchTargets = patchTargets.concat(['Document', 'SVGElement', 'Element', 'HTMLElement', 'HTMLBodyElement', 'HTMLMediaElement', 'HTMLFrameSetElement', 'HTMLFrameElement', 'HTMLIFrameElement', 'HTMLMarqueeElement', 'Worker']); const ignoreErrorProperties = isIE() ? [{ target: internalWindow, ignoreProperties: ['error'] - }] : []; // in IE/Edge, onProp not exist in window object, but in WindowPrototype + }] : []; + // in IE/Edge, onProp not exist in window object, but in WindowPrototype // so we need to pass WindowPrototype to check onProp exist or not - - patchFilteredProperties(internalWindow, eventNames.concat(['messageerror']), ignoreProperties ? ignoreProperties.concat(ignoreErrorProperties) : ignoreProperties, ObjectGetPrototypeOf(internalWindow)); - patchFilteredProperties(Document.prototype, eventNames, ignoreProperties); - - if (typeof internalWindow['SVGElement'] !== 'undefined') { - patchFilteredProperties(internalWindow['SVGElement'].prototype, eventNames, ignoreProperties); - } - - patchFilteredProperties(Element.prototype, eventNames, ignoreProperties); - patchFilteredProperties(HTMLElement.prototype, eventNames, ignoreProperties); - patchFilteredProperties(HTMLMediaElement.prototype, mediaElementEventNames, ignoreProperties); - patchFilteredProperties(HTMLFrameSetElement.prototype, windowEventNames.concat(frameSetEventNames), ignoreProperties); - patchFilteredProperties(HTMLBodyElement.prototype, windowEventNames.concat(frameSetEventNames), ignoreProperties); - patchFilteredProperties(HTMLFrameElement.prototype, frameEventNames, ignoreProperties); - patchFilteredProperties(HTMLIFrameElement.prototype, frameEventNames, ignoreProperties); - const HTMLMarqueeElement = internalWindow['HTMLMarqueeElement']; - - if (HTMLMarqueeElement) { - patchFilteredProperties(HTMLMarqueeElement.prototype, marqueeEventNames, ignoreProperties); - } - - const Worker = internalWindow['Worker']; - - if (Worker) { - patchFilteredProperties(Worker.prototype, workerEventNames, ignoreProperties); - } - } - - const XMLHttpRequest = _global['XMLHttpRequest']; - - if (XMLHttpRequest) { - // XMLHttpRequest is not available in ServiceWorker, so we need to check here - patchFilteredProperties(XMLHttpRequest.prototype, XMLHttpRequestEventNames, ignoreProperties); - } - - const XMLHttpRequestEventTarget = _global['XMLHttpRequestEventTarget']; - - if (XMLHttpRequestEventTarget) { - patchFilteredProperties(XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype, XMLHttpRequestEventNames, ignoreProperties); + patchFilteredProperties(internalWindow, getOnEventNames(internalWindow), ignoreProperties ? ignoreProperties.concat(ignoreErrorProperties) : ignoreProperties, ObjectGetPrototypeOf(internalWindow)); } - - if (typeof IDBIndex !== 'undefined') { - patchFilteredProperties(IDBIndex.prototype, IDBIndexEventNames, ignoreProperties); - patchFilteredProperties(IDBRequest.prototype, IDBIndexEventNames, ignoreProperties); - patchFilteredProperties(IDBOpenDBRequest.prototype, IDBIndexEventNames, ignoreProperties); - patchFilteredProperties(IDBDatabase.prototype, IDBIndexEventNames, ignoreProperties); - patchFilteredProperties(IDBTransaction.prototype, IDBIndexEventNames, ignoreProperties); - patchFilteredProperties(IDBCursor.prototype, IDBIndexEventNames, ignoreProperties); - } - - if (supportsWebSocket) { - patchFilteredProperties(WebSocket.prototype, websocketEventNames, ignoreProperties); + patchTargets = patchTargets.concat(['XMLHttpRequest', 'XMLHttpRequestEventTarget', 'IDBIndex', 'IDBRequest', 'IDBOpenDBRequest', 'IDBDatabase', 'IDBTransaction', 'IDBCursor', 'WebSocket']); + for (let i = 0; i < patchTargets.length; i++) { + const target = _global[patchTargets[i]]; + target && target.prototype && patchFilteredProperties(target.prototype, getOnEventNames(target.prototype), ignoreProperties); } } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -2799,31 +2305,28 @@ function propertyDescriptorPatch(api, _global) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - Zone.__load_patch('util', (global, Zone, api) => { + // Collect native event names by looking at properties + // on the global namespace, e.g. 'onclick'. + const eventNames = getOnEventNames(global); api.patchOnProperties = patchOnProperties; api.patchMethod = patchMethod; api.bindArguments = bindArguments; - api.patchMacroTask = patchMacroTask; // In earlier version of zone.js (<0.9.0), we use env name `__zone_symbol__BLACK_LISTED_EVENTS` to + api.patchMacroTask = patchMacroTask; + // In earlier version of zone.js (<0.9.0), we use env name `__zone_symbol__BLACK_LISTED_EVENTS` to // define which events will not be patched by `Zone.js`. // In newer version (>=0.9.0), we change the env name to `__zone_symbol__UNPATCHED_EVENTS` to keep // the name consistent with angular repo. // The `__zone_symbol__BLACK_LISTED_EVENTS` is deprecated, but it is still be supported for // backwards compatibility. - const SYMBOL_BLACK_LISTED_EVENTS = Zone.__symbol__('BLACK_LISTED_EVENTS'); - const SYMBOL_UNPATCHED_EVENTS = Zone.__symbol__('UNPATCHED_EVENTS'); - if (global[SYMBOL_UNPATCHED_EVENTS]) { global[SYMBOL_BLACK_LISTED_EVENTS] = global[SYMBOL_UNPATCHED_EVENTS]; } - if (global[SYMBOL_BLACK_LISTED_EVENTS]) { Zone[SYMBOL_BLACK_LISTED_EVENTS] = Zone[SYMBOL_UNPATCHED_EVENTS] = global[SYMBOL_BLACK_LISTED_EVENTS]; } - api.patchEventPrototype = patchEventPrototype; api.patchEventTarget = patchEventTarget; api.isIEOrEdge = isIEOrEdge; @@ -2837,10 +2340,9 @@ Zone.__load_patch('util', (global, Zone, api) => { api.attachOriginToPatched = attachOriginToPatched; api._redefineProperty = Object.defineProperty; api.patchCallbacks = patchCallbacks; - api.getGlobalObjects = () => ({ globalSources, - zoneSymbolEventNames: zoneSymbolEventNames$1, + zoneSymbolEventNames, eventNames, isBrowser, isMix, @@ -2852,6 +2354,7 @@ Zone.__load_patch('util', (global, Zone, api) => { REMOVE_EVENT_LISTENER_STR }); }); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -2859,32 +2362,24 @@ Zone.__load_patch('util', (global, Zone, api) => { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - const taskSymbol = zoneSymbol('zoneTask'); - function patchTimer(window, setName, cancelName, nameSuffix) { let setNative = null; let clearNative = null; setName += nameSuffix; cancelName += nameSuffix; const tasksByHandleId = {}; - function scheduleTask(task) { const data = task.data; - data.args[0] = function () { return task.invoke.apply(this, arguments); }; - data.handleId = setNative.apply(window, data.args); return task; } - function clearTask(task) { return clearNative.call(window, task.data.handleId); } - setNative = patchMethod(window, setName, delegate => function (self, args) { if (typeof args[0] === 'function') { const options = { @@ -2893,7 +2388,6 @@ function patchTimer(window, setName, cancelName, nameSuffix) { args: args }; const callback = args[0]; - args[0] = function timer() { try { return callback.apply(this, arguments); @@ -2918,16 +2412,12 @@ function patchTimer(window, setName, cancelName, nameSuffix) { } } }; - const task = scheduleMacroTaskWithCurrentZone(setName, args[0], options, scheduleTask, clearTask); - if (!task) { return task; - } // Node.js must additionally support the ref and unref functions. - - + } + // Node.js must additionally support the ref and unref functions. const handle = task.data.handleId; - if (typeof handle === 'number') { // for non nodejs env, we save handleId: task // mapping in local cache for clearTimeout @@ -2936,19 +2426,16 @@ function patchTimer(window, setName, cancelName, nameSuffix) { // for nodejs env, we save task // reference in timerId Object for clearTimeout handle[taskSymbol] = task; - } // check whether handle is null, because some polyfill or browser + } + // check whether handle is null, because some polyfill or browser // may return undefined from setTimeout/setInterval/setImmediate/requestAnimationFrame - - if (handle && handle.ref && handle.unref && typeof handle.ref === 'function' && typeof handle.unref === 'function') { task.ref = handle.ref.bind(handle); task.unref = handle.unref.bind(handle); } - if (typeof handle === 'number' || handle) { return handle; } - return task; } else { // cause an error by calling it directly. @@ -2958,28 +2445,25 @@ function patchTimer(window, setName, cancelName, nameSuffix) { clearNative = patchMethod(window, cancelName, delegate => function (self, args) { const id = args[0]; let task; - if (typeof id === 'number') { // non nodejs env. task = tasksByHandleId[id]; } else { // nodejs env. - task = id && id[taskSymbol]; // other environments. - + task = id && id[taskSymbol]; + // other environments. if (!task) { task = id; } } - if (task && typeof task.type === 'string') { if (task.state !== 'notScheduled' && (task.cancelFn && task.data.isPeriodic || task.runCount === 0)) { if (typeof id === 'number') { delete tasksByHandleId[id]; } else if (id) { id[taskSymbol] = null; - } // Do not cancel already canceled functions - - + } + // Do not cancel already canceled functions task.zone.cancelTask(task); } } else { @@ -2988,6 +2472,7 @@ function patchTimer(window, setName, cancelName, nameSuffix) { } }); } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -2995,21 +2480,18 @@ function patchTimer(window, setName, cancelName, nameSuffix) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - function patchCustomElements(_global, api) { const { isBrowser, isMix } = api.getGlobalObjects(); - if (!isBrowser && !isMix || !_global['customElements'] || !('customElements' in _global)) { return; } - const callbacks = ['connectedCallback', 'disconnectedCallback', 'adoptedCallback', 'attributeChangedCallback']; api.patchCallbacks(api, _global.customElements, 'customElements', 'define', callbacks); } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -3017,22 +2499,19 @@ function patchCustomElements(_global, api) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - function eventTargetPatch(_global, api) { if (Zone[api.symbol('patchEventTarget')]) { // EventTarget is already patched. return; } - const { eventNames, zoneSymbolEventNames, TRUE_STR, FALSE_STR, ZONE_SYMBOL_PREFIX - } = api.getGlobalObjects(); // predefine all __zone_symbol__ + eventName + true/false string - + } = api.getGlobalObjects(); + // predefine all __zone_symbol__ + eventName + true/false string for (let i = 0; i < eventNames.length; i++) { const eventName = eventNames[i]; const falseEventName = eventName + FALSE_STR; @@ -3043,20 +2522,17 @@ function eventTargetPatch(_global, api) { zoneSymbolEventNames[eventName][FALSE_STR] = symbol; zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture; } - const EVENT_TARGET = _global['EventTarget']; - if (!EVENT_TARGET || !EVENT_TARGET.prototype) { return; } - - api.patchEventTarget(_global, [EVENT_TARGET && EVENT_TARGET.prototype]); + api.patchEventTarget(_global, api, [EVENT_TARGET && EVENT_TARGET.prototype]); return true; } - function patchEvent(global, api) { api.patchEventPrototype(global, api); } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -3064,16 +2540,12 @@ function patchEvent(global, api) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - Zone.__load_patch('legacy', global => { const legacyPatch = global[Zone.__symbol__('legacyPatch')]; - if (legacyPatch) { legacyPatch(); } }); - Zone.__load_patch('queueMicrotask', (global, Zone, api) => { api.patchMethod(global, 'queueMicrotask', delegate => { return function (self, args) { @@ -3081,7 +2553,6 @@ Zone.__load_patch('queueMicrotask', (global, Zone, api) => { }; }); }); - Zone.__load_patch('timers', global => { const set = 'set'; const clear = 'clear'; @@ -3089,16 +2560,13 @@ Zone.__load_patch('timers', global => { patchTimer(global, set, clear, 'Interval'); patchTimer(global, set, clear, 'Immediate'); }); - Zone.__load_patch('requestAnimationFrame', global => { patchTimer(global, 'request', 'cancel', 'AnimationFrame'); patchTimer(global, 'mozRequest', 'mozCancel', 'AnimationFrame'); patchTimer(global, 'webkitRequest', 'webkitCancel', 'AnimationFrame'); }); - Zone.__load_patch('blocking', (global, Zone) => { const blockingMethods = ['alert', 'prompt', 'confirm']; - for (let i = 0; i < blockingMethods.length; i++) { const name = blockingMethods[i]; patchMethod(global, name, (delegate, symbol, name) => { @@ -3108,39 +2576,31 @@ Zone.__load_patch('blocking', (global, Zone) => { }); } }); - Zone.__load_patch('EventTarget', (global, Zone, api) => { patchEvent(global, api); - eventTargetPatch(global, api); // patch XMLHttpRequestEventTarget's addEventListener/removeEventListener - + eventTargetPatch(global, api); + // patch XMLHttpRequestEventTarget's addEventListener/removeEventListener const XMLHttpRequestEventTarget = global['XMLHttpRequestEventTarget']; - if (XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype) { - api.patchEventTarget(global, [XMLHttpRequestEventTarget.prototype]); + api.patchEventTarget(global, api, [XMLHttpRequestEventTarget.prototype]); } }); - Zone.__load_patch('MutationObserver', (global, Zone, api) => { patchClass('MutationObserver'); patchClass('WebKitMutationObserver'); }); - Zone.__load_patch('IntersectionObserver', (global, Zone, api) => { patchClass('IntersectionObserver'); }); - Zone.__load_patch('FileReader', (global, Zone, api) => { patchClass('FileReader'); }); - Zone.__load_patch('on_property', (global, Zone, api) => { propertyDescriptorPatch(api, global); }); - Zone.__load_patch('customElements', (global, Zone, api) => { patchCustomElements(global, api); }); - Zone.__load_patch('XHR', (global, Zone) => { // Treat XMLHttpRequest as a macrotask. patchXHR(global); @@ -3150,54 +2610,42 @@ Zone.__load_patch('XHR', (global, Zone) => { const XHR_SCHEDULED = zoneSymbol('xhrScheduled'); const XHR_URL = zoneSymbol('xhrURL'); const XHR_ERROR_BEFORE_SCHEDULED = zoneSymbol('xhrErrorBeforeScheduled'); - function patchXHR(window) { const XMLHttpRequest = window['XMLHttpRequest']; - if (!XMLHttpRequest) { // XMLHttpRequest is not available in service worker return; } - const XMLHttpRequestPrototype = XMLHttpRequest.prototype; - function findPendingTask(target) { return target[XHR_TASK]; } - let oriAddListener = XMLHttpRequestPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER]; let oriRemoveListener = XMLHttpRequestPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER]; - if (!oriAddListener) { const XMLHttpRequestEventTarget = window['XMLHttpRequestEventTarget']; - if (XMLHttpRequestEventTarget) { const XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget.prototype; oriAddListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER]; oriRemoveListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER]; } } - const READY_STATE_CHANGE = 'readystatechange'; const SCHEDULED = 'scheduled'; - function scheduleTask(task) { const data = task.data; const target = data.target; target[XHR_SCHEDULED] = false; - target[XHR_ERROR_BEFORE_SCHEDULED] = false; // remove existing event listener - + target[XHR_ERROR_BEFORE_SCHEDULED] = false; + // remove existing event listener const listener = target[XHR_LISTENER]; - if (!oriAddListener) { oriAddListener = target[ZONE_SYMBOL_ADD_EVENT_LISTENER]; oriRemoveListener = target[ZONE_SYMBOL_REMOVE_EVENT_LISTENER]; } - if (listener) { oriRemoveListener.call(target, READY_STATE_CHANGE, listener); } - const newListener = target[XHR_LISTENER] = () => { if (target.readyState === target.DONE) { // sometimes on some browsers XMLHttpRequest will fire onreadystatechange with @@ -3211,26 +2659,21 @@ Zone.__load_patch('XHR', (global, Zone) => { // to close the XMLHttpRequest::send macroTask. // https://github.com/angular/angular/issues/38795 const loadTasks = target[Zone.__symbol__('loadfalse')]; - if (target.status !== 0 && loadTasks && loadTasks.length > 0) { const oriInvoke = task.invoke; - task.invoke = function () { // need to load the tasks again, because in other // load listener, they may remove themselves const loadTasks = target[Zone.__symbol__('loadfalse')]; - for (let i = 0; i < loadTasks.length; i++) { if (loadTasks[i] === task) { loadTasks.splice(i, 1); } } - if (!data.aborted && task.state === SCHEDULED) { oriInvoke.call(task); } }; - loadTasks.push(task); } else { task.invoke(); @@ -3241,29 +2684,23 @@ Zone.__load_patch('XHR', (global, Zone) => { } } }; - oriAddListener.call(target, READY_STATE_CHANGE, newListener); const storedTask = target[XHR_TASK]; - if (!storedTask) { target[XHR_TASK] = task; } - sendNative.apply(target, data.args); target[XHR_SCHEDULED] = true; return task; } - function placeholderCallback() {} - function clearTask(task) { - const data = task.data; // Note - ideally, we would call data.target.removeEventListener here, but it's too late + const data = task.data; + // Note - ideally, we would call data.target.removeEventListener here, but it's too late // to prevent it from firing. So instead, we store info for the event listener. - data.aborted = true; return abortNative.apply(data.target, data.args); } - const openNative = patchMethod(XMLHttpRequestPrototype, 'open', () => function (self, args) { self[XHR_SYNC] = args[2] == false; self[XHR_URL] = args[1]; @@ -3279,7 +2716,6 @@ Zone.__load_patch('XHR', (global, Zone) => { // not schedule a macroTask for xhr again return sendNative.apply(self, args); } - if (self[XHR_SYNC]) { // if the XHR is sync there is no task to schedule, just execute the code. return sendNative.apply(self, args); @@ -3292,7 +2728,6 @@ Zone.__load_patch('XHR', (global, Zone) => { aborted: false }; const task = scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask); - if (self && self[XHR_ERROR_BEFORE_SCHEDULED] === true && !options.aborted && task.state === SCHEDULED) { // xhr request throw error when send // we should invoke task instead of leaving a scheduled @@ -3303,7 +2738,6 @@ Zone.__load_patch('XHR', (global, Zone) => { }); const abortNative = patchMethod(XMLHttpRequestPrototype, 'abort', () => function (self, args) { const task = findPendingTask(self); - if (task && typeof task.type == 'string') { // If the XHR has already completed, do nothing. // If the XHR has already been aborted, do nothing. @@ -3312,15 +2746,14 @@ Zone.__load_patch('XHR', (global, Zone) => { if (task.cancelFn == null || task.data && task.data.aborted) { return; } - task.zone.cancelTask(task); } else if (Zone.current[fetchTaskAborting] === true) { // the abort is called from fetch polyfill, we need to call native abort of XHR. return abortNative.apply(self, args); - } // Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no + } + // Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no // task // to cancel. Do nothing. - }); } }); @@ -3331,7 +2764,6 @@ Zone.__load_patch('geolocation', global => { patchPrototype(global['navigator'].geolocation, ['getCurrentPosition', 'watchPosition']); } }); - Zone.__load_patch('PromiseRejectionEvent', (global, Zone) => { // handle unhandled promise rejection function findPromiseRejectionHandler(evtName) { @@ -3341,7 +2773,6 @@ Zone.__load_patch('PromiseRejectionEvent', (global, Zone) => { // windows has added unhandledrejection event listener // trigger the event listener const PromiseRejectionEvent = global['PromiseRejectionEvent']; - if (PromiseRejectionEvent) { const evt = new PromiseRejectionEvent(evtName, { promise: e.promise, @@ -3352,7 +2783,6 @@ Zone.__load_patch('PromiseRejectionEvent', (global, Zone) => { }); }; } - if (global['PromiseRejectionEvent']) { Zone[zoneSymbol('unhandledPromiseRejectionHandler')] = findPromiseRejectionHandler('unhandledrejection'); Zone[zoneSymbol('rejectionHandledHandler')] = findPromiseRejectionHandler('rejectionhandled'); diff --git a/docs/polyfills.js.map b/docs/polyfills.js.map index a09f18d..51262c6 100644 --- a/docs/polyfills.js.map +++ b/docs/polyfills.js.map @@ -1 +1 @@ -{"version":3,"file":"polyfills.js","mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;GAEG;AACc,CAAC,6BAA6B;AAE/C;;GAEG;;;;;;;;;;;ACnDU;AACb;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMA,MAAM,GAAI,UAAUC,MAAV,EAAkB;EAC9B,MAAMC,WAAW,GAAGD,MAAM,CAAC,aAAD,CAA1B;;EACA,SAASE,IAAT,CAAcC,IAAd,EAAoB;IAChBF,WAAW,IAAIA,WAAW,CAAC,MAAD,CAA1B,IAAsCA,WAAW,CAAC,MAAD,CAAX,CAAoBE,IAApB,CAAtC;EACH;;EACD,SAASC,kBAAT,CAA4BD,IAA5B,EAAkCE,KAAlC,EAAyC;IACrCJ,WAAW,IAAIA,WAAW,CAAC,SAAD,CAA1B,IAAyCA,WAAW,CAAC,SAAD,CAAX,CAAuBE,IAAvB,EAA6BE,KAA7B,CAAzC;EACH;;EACDH,IAAI,CAAC,MAAD,CAAJ,CAR8B,CAS9B;EACA;EACA;;EACA,MAAMI,YAAY,GAAGN,MAAM,CAAC,sBAAD,CAAN,IAAkC,iBAAvD;;EACA,SAASO,UAAT,CAAoBJ,IAApB,EAA0B;IACtB,OAAOG,YAAY,GAAGH,IAAtB;EACH;;EACD,MAAMK,cAAc,GAAGR,MAAM,CAACO,UAAU,CAAC,yBAAD,CAAX,CAAN,KAAkD,IAAzE;;EACA,IAAIP,MAAM,CAAC,MAAD,CAAV,EAAo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AA0B1H,OAA1B,EAAmC;YAAExJ,OAAO,EAAE1B,CAAC,CAAC0B,OAAb;YAAsBoC,MAAM,EAAE9D,CAAC,CAACC;UAAhC,CAAnC,CAAZ;UACA5O,SAAS,CAACT,MAAV,CAAiBiiB,GAAjB;QACH;MACJ,CARD;IASH,CAXD;EAYH;;EACD,IAAIjlB,MAAM,CAAC,uBAAD,CAAV,EAAqC;IACjCU,IAAI,CAAC2M,UAAU,CAAC,kCAAD,CAAX,CAAJ,GACIyX,2BAA2B,CAAC,oBAAD,CAD/B;IAEApkB,IAAI,CAAC2M,UAAU,CAAC,yBAAD,CAAX,CAAJ,GACIyX,2BAA2B,CAAC,kBAAD,CAD/B;EAEH;AACJ,CAtBD","sources":["./src/polyfills.ts","./node_modules/zone.js/fesm2015/zone.js"],"sourcesContent":["/**\r\n * This file includes polyfills needed by Angular and is loaded before the app.\r\n * You can add your own extra polyfills to this file.\r\n *\r\n * This file is divided into 2 sections:\r\n * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.\r\n * 2. Application imports. Files imported after ZoneJS that should be loaded before your main\r\n * file.\r\n *\r\n * The current setup is for so-called \"evergreen\" browsers; the last versions of browsers that\r\n * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),\r\n * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.\r\n *\r\n * Learn more in https://angular.io/guide/browser-support\r\n */\r\n\r\n/***************************************************************************************************\r\n * BROWSER POLYFILLS\r\n */\r\n\r\n/**\r\n * By default, zone.js will patch all possible macroTask and DomEvents\r\n * user can disable parts of macroTask/DomEvents patch by setting following flags\r\n * because those flags need to be set before `zone.js` being loaded, and webpack\r\n * will put import in the top of bundle, so user need to create a separate file\r\n * in this directory (for example: zone-flags.ts), and put the following flags\r\n * into that file, and then add the following code before importing zone.js.\r\n * import './zone-flags.ts';\r\n *\r\n * The flags allowed in zone-flags.ts are listed here.\r\n *\r\n * The following flags will work for all browsers.\r\n *\r\n * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame\r\n * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick\r\n * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames\r\n *\r\n * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js\r\n * with the following flag, it will bypass `zone.js` patch for IE/Edge\r\n *\r\n * (window as any).__Zone_enable_cross_context_check = true;\r\n *\r\n */\r\n\r\n/***************************************************************************************************\r\n * Zone JS is required by default for Angular itself.\r\n */\r\nimport 'zone.js'; // Included with Angular CLI.\r\n\r\n/***************************************************************************************************\r\n * APPLICATION IMPORTS\r\n */\r\n","'use strict';\n/**\n * @license Angular v12.0.0-next.0\n * (c) 2010-2020 Google LLC. https://angular.io/\n * License: MIT\n */\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nconst Zone$1 = (function (global) {\n const performance = global['performance'];\n function mark(name) {\n performance && performance['mark'] && performance['mark'](name);\n }\n function performanceMeasure(name, label) {\n performance && performance['measure'] && performance['measure'](name, label);\n }\n mark('Zone');\n // Initialize before it's accessed below.\n // __Zone_symbol_prefix global can be used to override the default zone\n // symbol prefix with a custom one if needed.\n const symbolPrefix = global['__Zone_symbol_prefix'] || '__zone_symbol__';\n function __symbol__(name) {\n return symbolPrefix + name;\n }\n const checkDuplicate = global[__symbol__('forceDuplicateZoneCheck')] === true;\n if (global['Zone']) {\n // if global['Zone'] already exists (maybe zone.js was already loaded or\n // some other lib also registered a global object named Zone), we may need\n // to throw an error, but sometimes user may not want this error.\n // For example,\n // we have two web pages, page1 includes zone.js, page2 doesn't.\n // and the 1st time user load page1 and page2, everything work fine,\n // but when user load page2 again, error occurs because global['Zone'] already exists.\n // so we add a flag to let user choose whether to throw this error or not.\n // By default, if existing Zone is from zone.js, we will not throw the error.\n if (checkDuplicate || typeof global['Zone'].__symbol__ !== 'function') {\n throw new Error('Zone already loaded.');\n }\n else {\n return global['Zone'];\n }\n }\n class Zone {\n constructor(parent, zoneSpec) {\n this._parent = parent;\n this._name = zoneSpec ? zoneSpec.name || 'unnamed' : '';\n this._properties = zoneSpec && zoneSpec.properties || {};\n this._zoneDelegate =\n new ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec);\n }\n static assertZonePatched() {\n if (global['Promise'] !== patches['ZoneAwarePromise']) {\n throw new Error('Zone.js has detected that ZoneAwarePromise `(window|global).Promise` ' +\n 'has been overwritten.\\n' +\n 'Most likely cause is that a Promise polyfill has been loaded ' +\n 'after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. ' +\n 'If you must load one, do so before loading zone.js.)');\n }\n }\n static get root() {\n let zone = Zone.current;\n while (zone.parent) {\n zone = zone.parent;\n }\n return zone;\n }\n static get current() {\n return _currentZoneFrame.zone;\n }\n static get currentTask() {\n return _currentTask;\n }\n // tslint:disable-next-line:require-internal-with-underscore\n static __load_patch(name, fn, ignoreDuplicate = false) {\n if (patches.hasOwnProperty(name)) {\n // `checkDuplicate` option is defined from global variable\n // so it works for all modules.\n // `ignoreDuplicate` can work for the specified module\n if (!ignoreDuplicate && checkDuplicate) {\n throw Error('Already loaded patch: ' + name);\n }\n }\n else if (!global['__Zone_disable_' + name]) {\n const perfName = 'Zone:' + name;\n mark(perfName);\n patches[name] = fn(global, Zone, _api);\n performanceMeasure(perfName, perfName);\n }\n }\n get parent() {\n return this._parent;\n }\n get name() {\n return this._name;\n }\n get(key) {\n const zone = this.getZoneWith(key);\n if (zone)\n return zone._properties[key];\n }\n getZoneWith(key) {\n let current = this;\n while (current) {\n if (current._properties.hasOwnProperty(key)) {\n return current;\n }\n current = current._parent;\n }\n return null;\n }\n fork(zoneSpec) {\n if (!zoneSpec)\n throw new Error('ZoneSpec required!');\n return this._zoneDelegate.fork(this, zoneSpec);\n }\n wrap(callback, source) {\n if (typeof callback !== 'function') {\n throw new Error('Expecting function got: ' + callback);\n }\n const _callback = this._zoneDelegate.intercept(this, callback, source);\n const zone = this;\n return function () {\n return zone.runGuarded(_callback, this, arguments, source);\n };\n }\n run(callback, applyThis, applyArgs, source) {\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n }\n finally {\n _currentZoneFrame = _currentZoneFrame.parent;\n }\n }\n runGuarded(callback, applyThis = null, applyArgs, source) {\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n try {\n return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n }\n catch (error) {\n if (this._zoneDelegate.handleError(this, error)) {\n throw error;\n }\n }\n }\n finally {\n _currentZoneFrame = _currentZoneFrame.parent;\n }\n }\n runTask(task, applyThis, applyArgs) {\n if (task.zone != this) {\n throw new Error('A task can only be run in the zone of creation! (Creation: ' +\n (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')');\n }\n // https://github.com/angular/zone.js/issues/778, sometimes eventTask\n // will run in notScheduled(canceled) state, we should not try to\n // run such kind of task but just return\n if (task.state === notScheduled && (task.type === eventTask || task.type === macroTask)) {\n return;\n }\n const reEntryGuard = task.state != running;\n reEntryGuard && task._transitionTo(running, scheduled);\n task.runCount++;\n const previousTask = _currentTask;\n _currentTask = task;\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n if (task.type == macroTask && task.data && !task.data.isPeriodic) {\n task.cancelFn = undefined;\n }\n try {\n return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs);\n }\n catch (error) {\n if (this._zoneDelegate.handleError(this, error)) {\n throw error;\n }\n }\n }\n finally {\n // if the task's state is notScheduled or unknown, then it has already been cancelled\n // we should not reset the state to scheduled\n if (task.state !== notScheduled && task.state !== unknown) {\n if (task.type == eventTask || (task.data && task.data.isPeriodic)) {\n reEntryGuard && task._transitionTo(scheduled, running);\n }\n else {\n task.runCount = 0;\n this._updateTaskCount(task, -1);\n reEntryGuard &&\n task._transitionTo(notScheduled, running, notScheduled);\n }\n }\n _currentZoneFrame = _currentZoneFrame.parent;\n _currentTask = previousTask;\n }\n }\n scheduleTask(task) {\n if (task.zone && task.zone !== this) {\n // check if the task was rescheduled, the newZone\n // should not be the children of the original zone\n let newZone = this;\n while (newZone) {\n if (newZone === task.zone) {\n throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${task.zone.name}`);\n }\n newZone = newZone.parent;\n }\n }\n task._transitionTo(scheduling, notScheduled);\n const zoneDelegates = [];\n task._zoneDelegates = zoneDelegates;\n task._zone = this;\n try {\n task = this._zoneDelegate.scheduleTask(this, task);\n }\n catch (err) {\n // should set task's state to unknown when scheduleTask throw error\n // because the err may from reschedule, so the fromState maybe notScheduled\n task._transitionTo(unknown, scheduling, notScheduled);\n // TODO: @JiaLiPassion, should we check the result from handleError?\n this._zoneDelegate.handleError(this, err);\n throw err;\n }\n if (task._zoneDelegates === zoneDelegates) {\n // we have to check because internally the delegate can reschedule the task.\n this._updateTaskCount(task, 1);\n }\n if (task.state == scheduling) {\n task._transitionTo(scheduled, scheduling);\n }\n return task;\n }\n scheduleMicroTask(source, callback, data, customSchedule) {\n return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, undefined));\n }\n scheduleMacroTask(source, callback, data, customSchedule, customCancel) {\n return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel));\n }\n scheduleEventTask(source, callback, data, customSchedule, customCancel) {\n return this.scheduleTask(new ZoneTask(eventTask, source, callback, data, customSchedule, customCancel));\n }\n cancelTask(task) {\n if (task.zone != this)\n throw new Error('A task can only be cancelled in the zone of creation! (Creation: ' +\n (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')');\n task._transitionTo(canceling, scheduled, running);\n try {\n this._zoneDelegate.cancelTask(this, task);\n }\n catch (err) {\n // if error occurs when cancelTask, transit the state to unknown\n task._transitionTo(unknown, canceling);\n this._zoneDelegate.handleError(this, err);\n throw err;\n }\n this._updateTaskCount(task, -1);\n task._transitionTo(notScheduled, canceling);\n task.runCount = 0;\n return task;\n }\n _updateTaskCount(task, count) {\n const zoneDelegates = task._zoneDelegates;\n if (count == -1) {\n task._zoneDelegates = null;\n }\n for (let i = 0; i < zoneDelegates.length; i++) {\n zoneDelegates[i]._updateTaskCount(task.type, count);\n }\n }\n }\n // tslint:disable-next-line:require-internal-with-underscore\n Zone.__symbol__ = __symbol__;\n const DELEGATE_ZS = {\n name: '',\n onHasTask: (delegate, _, target, hasTaskState) => delegate.hasTask(target, hasTaskState),\n onScheduleTask: (delegate, _, target, task) => delegate.scheduleTask(target, task),\n onInvokeTask: (delegate, _, target, task, applyThis, applyArgs) => delegate.invokeTask(target, task, applyThis, applyArgs),\n onCancelTask: (delegate, _, target, task) => delegate.cancelTask(target, task)\n };\n class ZoneDelegate {\n constructor(zone, parentDelegate, zoneSpec) {\n this._taskCounts = { 'microTask': 0, 'macroTask': 0, 'eventTask': 0 };\n this.zone = zone;\n this._parentDelegate = parentDelegate;\n this._forkZS = zoneSpec && (zoneSpec && zoneSpec.onFork ? zoneSpec : parentDelegate._forkZS);\n this._forkDlgt = zoneSpec && (zoneSpec.onFork ? parentDelegate : parentDelegate._forkDlgt);\n this._forkCurrZone =\n zoneSpec && (zoneSpec.onFork ? this.zone : parentDelegate._forkCurrZone);\n this._interceptZS =\n zoneSpec && (zoneSpec.onIntercept ? zoneSpec : parentDelegate._interceptZS);\n this._interceptDlgt =\n zoneSpec && (zoneSpec.onIntercept ? parentDelegate : parentDelegate._interceptDlgt);\n this._interceptCurrZone =\n zoneSpec && (zoneSpec.onIntercept ? this.zone : parentDelegate._interceptCurrZone);\n this._invokeZS = zoneSpec && (zoneSpec.onInvoke ? zoneSpec : parentDelegate._invokeZS);\n this._invokeDlgt =\n zoneSpec && (zoneSpec.onInvoke ? parentDelegate : parentDelegate._invokeDlgt);\n this._invokeCurrZone =\n zoneSpec && (zoneSpec.onInvoke ? this.zone : parentDelegate._invokeCurrZone);\n this._handleErrorZS =\n zoneSpec && (zoneSpec.onHandleError ? zoneSpec : parentDelegate._handleErrorZS);\n this._handleErrorDlgt =\n zoneSpec && (zoneSpec.onHandleError ? parentDelegate : parentDelegate._handleErrorDlgt);\n this._handleErrorCurrZone =\n zoneSpec && (zoneSpec.onHandleError ? this.zone : parentDelegate._handleErrorCurrZone);\n this._scheduleTaskZS =\n zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS);\n this._scheduleTaskDlgt = zoneSpec &&\n (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);\n this._scheduleTaskCurrZone =\n zoneSpec && (zoneSpec.onScheduleTask ? this.zone : parentDelegate._scheduleTaskCurrZone);\n this._invokeTaskZS =\n zoneSpec && (zoneSpec.onInvokeTask ? zoneSpec : parentDelegate._invokeTaskZS);\n this._invokeTaskDlgt =\n zoneSpec && (zoneSpec.onInvokeTask ? parentDelegate : parentDelegate._invokeTaskDlgt);\n this._invokeTaskCurrZone =\n zoneSpec && (zoneSpec.onInvokeTask ? this.zone : parentDelegate._invokeTaskCurrZone);\n this._cancelTaskZS =\n zoneSpec && (zoneSpec.onCancelTask ? zoneSpec : parentDelegate._cancelTaskZS);\n this._cancelTaskDlgt =\n zoneSpec && (zoneSpec.onCancelTask ? parentDelegate : parentDelegate._cancelTaskDlgt);\n this._cancelTaskCurrZone =\n zoneSpec && (zoneSpec.onCancelTask ? this.zone : parentDelegate._cancelTaskCurrZone);\n this._hasTaskZS = null;\n this._hasTaskDlgt = null;\n this._hasTaskDlgtOwner = null;\n this._hasTaskCurrZone = null;\n const zoneSpecHasTask = zoneSpec && zoneSpec.onHasTask;\n const parentHasTask = parentDelegate && parentDelegate._hasTaskZS;\n if (zoneSpecHasTask || parentHasTask) {\n // If we need to report hasTask, than this ZS needs to do ref counting on tasks. In such\n // a case all task related interceptors must go through this ZD. We can't short circuit it.\n this._hasTaskZS = zoneSpecHasTask ? zoneSpec : DELEGATE_ZS;\n this._hasTaskDlgt = parentDelegate;\n this._hasTaskDlgtOwner = this;\n this._hasTaskCurrZone = zone;\n if (!zoneSpec.onScheduleTask) {\n this._scheduleTaskZS = DELEGATE_ZS;\n this._scheduleTaskDlgt = parentDelegate;\n this._scheduleTaskCurrZone = this.zone;\n }\n if (!zoneSpec.onInvokeTask) {\n this._invokeTaskZS = DELEGATE_ZS;\n this._invokeTaskDlgt = parentDelegate;\n this._invokeTaskCurrZone = this.zone;\n }\n if (!zoneSpec.onCancelTask) {\n this._cancelTaskZS = DELEGATE_ZS;\n this._cancelTaskDlgt = parentDelegate;\n this._cancelTaskCurrZone = this.zone;\n }\n }\n }\n fork(targetZone, zoneSpec) {\n return this._forkZS ? this._forkZS.onFork(this._forkDlgt, this.zone, targetZone, zoneSpec) :\n new Zone(targetZone, zoneSpec);\n }\n intercept(targetZone, callback, source) {\n return this._interceptZS ?\n this._interceptZS.onIntercept(this._interceptDlgt, this._interceptCurrZone, targetZone, callback, source) :\n callback;\n }\n invoke(targetZone, callback, applyThis, applyArgs, source) {\n return this._invokeZS ? this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) :\n callback.apply(applyThis, applyArgs);\n }\n handleError(targetZone, error) {\n return this._handleErrorZS ?\n this._handleErrorZS.onHandleError(this._handleErrorDlgt, this._handleErrorCurrZone, targetZone, error) :\n true;\n }\n scheduleTask(targetZone, task) {\n let returnTask = task;\n if (this._scheduleTaskZS) {\n if (this._hasTaskZS) {\n returnTask._zoneDelegates.push(this._hasTaskDlgtOwner);\n }\n // clang-format off\n returnTask = this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this._scheduleTaskCurrZone, targetZone, task);\n // clang-format on\n if (!returnTask)\n returnTask = task;\n }\n else {\n if (task.scheduleFn) {\n task.scheduleFn(task);\n }\n else if (task.type == microTask) {\n scheduleMicroTask(task);\n }\n else {\n throw new Error('Task is missing scheduleFn.');\n }\n }\n return returnTask;\n }\n invokeTask(targetZone, task, applyThis, applyArgs) {\n return this._invokeTaskZS ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) :\n task.callback.apply(applyThis, applyArgs);\n }\n cancelTask(targetZone, task) {\n let value;\n if (this._cancelTaskZS) {\n value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this._cancelTaskCurrZone, targetZone, task);\n }\n else {\n if (!task.cancelFn) {\n throw Error('Task is not cancelable');\n }\n value = task.cancelFn(task);\n }\n return value;\n }\n hasTask(targetZone, isEmpty) {\n // hasTask should not throw error so other ZoneDelegate\n // can still trigger hasTask callback\n try {\n this._hasTaskZS &&\n this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, targetZone, isEmpty);\n }\n catch (err) {\n this.handleError(targetZone, err);\n }\n }\n // tslint:disable-next-line:require-internal-with-underscore\n _updateTaskCount(type, count) {\n const counts = this._taskCounts;\n const prev = counts[type];\n const next = counts[type] = prev + count;\n if (next < 0) {\n throw new Error('More tasks executed then were scheduled.');\n }\n if (prev == 0 || next == 0) {\n const isEmpty = {\n microTask: counts['microTask'] > 0,\n macroTask: counts['macroTask'] > 0,\n eventTask: counts['eventTask'] > 0,\n change: type\n };\n this.hasTask(this.zone, isEmpty);\n }\n }\n }\n class ZoneTask {\n constructor(type, source, callback, options, scheduleFn, cancelFn) {\n // tslint:disable-next-line:require-internal-with-underscore\n this._zone = null;\n this.runCount = 0;\n // tslint:disable-next-line:require-internal-with-underscore\n this._zoneDelegates = null;\n // tslint:disable-next-line:require-internal-with-underscore\n this._state = 'notScheduled';\n this.type = type;\n this.source = source;\n this.data = options;\n this.scheduleFn = scheduleFn;\n this.cancelFn = cancelFn;\n if (!callback) {\n throw new Error('callback is not defined');\n }\n this.callback = callback;\n const self = this;\n // TODO: @JiaLiPassion options should have interface\n if (type === eventTask && options && options.useG) {\n this.invoke = ZoneTask.invokeTask;\n }\n else {\n this.invoke = function () {\n return ZoneTask.invokeTask.call(global, self, this, arguments);\n };\n }\n }\n static invokeTask(task, target, args) {\n if (!task) {\n task = this;\n }\n _numberOfNestedTaskFrames++;\n try {\n task.runCount++;\n return task.zone.runTask(task, target, args);\n }\n finally {\n if (_numberOfNestedTaskFrames == 1) {\n drainMicroTaskQueue();\n }\n _numberOfNestedTaskFrames--;\n }\n }\n get zone() {\n return this._zone;\n }\n get state() {\n return this._state;\n }\n cancelScheduleRequest() {\n this._transitionTo(notScheduled, scheduling);\n }\n // tslint:disable-next-line:require-internal-with-underscore\n _transitionTo(toState, fromState1, fromState2) {\n if (this._state === fromState1 || this._state === fromState2) {\n this._state = toState;\n if (toState == notScheduled) {\n this._zoneDelegates = null;\n }\n }\n else {\n throw new Error(`${this.type} '${this.source}': can not transition to '${toState}', expecting state '${fromState1}'${fromState2 ? ' or \\'' + fromState2 + '\\'' : ''}, was '${this._state}'.`);\n }\n }\n toString() {\n if (this.data && typeof this.data.handleId !== 'undefined') {\n return this.data.handleId.toString();\n }\n else {\n return Object.prototype.toString.call(this);\n }\n }\n // add toJSON method to prevent cyclic error when\n // call JSON.stringify(zoneTask)\n toJSON() {\n return {\n type: this.type,\n state: this.state,\n source: this.source,\n zone: this.zone.name,\n runCount: this.runCount\n };\n }\n }\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n /// MICROTASK QUEUE\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n const symbolSetTimeout = __symbol__('setTimeout');\n const symbolPromise = __symbol__('Promise');\n const symbolThen = __symbol__('then');\n let _microTaskQueue = [];\n let _isDrainingMicrotaskQueue = false;\n let nativeMicroTaskQueuePromise;\n function scheduleMicroTask(task) {\n // if we are not running in any task, and there has not been anything scheduled\n // we must bootstrap the initial task creation by manually scheduling the drain\n if (_numberOfNestedTaskFrames === 0 && _microTaskQueue.length === 0) {\n // We are not running in Task, so we need to kickstart the microtask queue.\n if (!nativeMicroTaskQueuePromise) {\n if (global[symbolPromise]) {\n nativeMicroTaskQueuePromise = global[symbolPromise].resolve(0);\n }\n }\n if (nativeMicroTaskQueuePromise) {\n let nativeThen = nativeMicroTaskQueuePromise[symbolThen];\n if (!nativeThen) {\n // native Promise is not patchable, we need to use `then` directly\n // issue 1078\n nativeThen = nativeMicroTaskQueuePromise['then'];\n }\n nativeThen.call(nativeMicroTaskQueuePromise, drainMicroTaskQueue);\n }\n else {\n global[symbolSetTimeout](drainMicroTaskQueue, 0);\n }\n }\n task && _microTaskQueue.push(task);\n }\n function drainMicroTaskQueue() {\n if (!_isDrainingMicrotaskQueue) {\n _isDrainingMicrotaskQueue = true;\n while (_microTaskQueue.length) {\n const queue = _microTaskQueue;\n _microTaskQueue = [];\n for (let i = 0; i < queue.length; i++) {\n const task = queue[i];\n try {\n task.zone.runTask(task, null, null);\n }\n catch (error) {\n _api.onUnhandledError(error);\n }\n }\n }\n _api.microtaskDrainDone();\n _isDrainingMicrotaskQueue = false;\n }\n }\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n /// BOOTSTRAP\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n const NO_ZONE = { name: 'NO ZONE' };\n const notScheduled = 'notScheduled', scheduling = 'scheduling', scheduled = 'scheduled', running = 'running', canceling = 'canceling', unknown = 'unknown';\n const microTask = 'microTask', macroTask = 'macroTask', eventTask = 'eventTask';\n const patches = {};\n const _api = {\n symbol: __symbol__,\n currentZoneFrame: () => _currentZoneFrame,\n onUnhandledError: noop,\n microtaskDrainDone: noop,\n scheduleMicroTask: scheduleMicroTask,\n showUncaughtError: () => !Zone[__symbol__('ignoreConsoleErrorUncaughtError')],\n patchEventTarget: () => [],\n patchOnProperties: noop,\n patchMethod: () => noop,\n bindArguments: () => [],\n patchThen: () => noop,\n patchMacroTask: () => noop,\n patchEventPrototype: () => noop,\n isIEOrEdge: () => false,\n getGlobalObjects: () => undefined,\n ObjectDefineProperty: () => noop,\n ObjectGetOwnPropertyDescriptor: () => undefined,\n ObjectCreate: () => undefined,\n ArraySlice: () => [],\n patchClass: () => noop,\n wrapWithCurrentZone: () => noop,\n filterProperties: () => [],\n attachOriginToPatched: () => noop,\n _redefineProperty: () => noop,\n patchCallbacks: () => noop\n };\n let _currentZoneFrame = { parent: null, zone: new Zone(null, null) };\n let _currentTask = null;\n let _numberOfNestedTaskFrames = 0;\n function noop() { }\n performanceMeasure('Zone', 'Zone');\n return global['Zone'] = Zone;\n})(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Suppress closure compiler errors about unknown 'Zone' variable\n * @fileoverview\n * @suppress {undefinedVars,globalThis,missingRequire}\n */\n/// \n// issue #989, to reduce bundle size, use short name\n/** Object.getOwnPropertyDescriptor */\nconst ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n/** Object.defineProperty */\nconst ObjectDefineProperty = Object.defineProperty;\n/** Object.getPrototypeOf */\nconst ObjectGetPrototypeOf = Object.getPrototypeOf;\n/** Object.create */\nconst ObjectCreate = Object.create;\n/** Array.prototype.slice */\nconst ArraySlice = Array.prototype.slice;\n/** addEventListener string const */\nconst ADD_EVENT_LISTENER_STR = 'addEventListener';\n/** removeEventListener string const */\nconst REMOVE_EVENT_LISTENER_STR = 'removeEventListener';\n/** zoneSymbol addEventListener */\nconst ZONE_SYMBOL_ADD_EVENT_LISTENER = Zone.__symbol__(ADD_EVENT_LISTENER_STR);\n/** zoneSymbol removeEventListener */\nconst ZONE_SYMBOL_REMOVE_EVENT_LISTENER = Zone.__symbol__(REMOVE_EVENT_LISTENER_STR);\n/** true string const */\nconst TRUE_STR = 'true';\n/** false string const */\nconst FALSE_STR = 'false';\n/** Zone symbol prefix string const. */\nconst ZONE_SYMBOL_PREFIX = Zone.__symbol__('');\nfunction wrapWithCurrentZone(callback, source) {\n return Zone.current.wrap(callback, source);\n}\nfunction scheduleMacroTaskWithCurrentZone(source, callback, data, customSchedule, customCancel) {\n return Zone.current.scheduleMacroTask(source, callback, data, customSchedule, customCancel);\n}\nconst zoneSymbol = Zone.__symbol__;\nconst isWindowExists = typeof window !== 'undefined';\nconst internalWindow = isWindowExists ? window : undefined;\nconst _global = isWindowExists && internalWindow || typeof self === 'object' && self || global;\nconst REMOVE_ATTRIBUTE = 'removeAttribute';\nconst NULL_ON_PROP_VALUE = [null];\nfunction bindArguments(args, source) {\n for (let i = args.length - 1; i >= 0; i--) {\n if (typeof args[i] === 'function') {\n args[i] = wrapWithCurrentZone(args[i], source + '_' + i);\n }\n }\n return args;\n}\nfunction patchPrototype(prototype, fnNames) {\n const source = prototype.constructor['name'];\n for (let i = 0; i < fnNames.length; i++) {\n const name = fnNames[i];\n const delegate = prototype[name];\n if (delegate) {\n const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, name);\n if (!isPropertyWritable(prototypeDesc)) {\n continue;\n }\n prototype[name] = ((delegate) => {\n const patched = function () {\n return delegate.apply(this, bindArguments(arguments, source + '.' + name));\n };\n attachOriginToPatched(patched, delegate);\n return patched;\n })(delegate);\n }\n }\n}\nfunction isPropertyWritable(propertyDesc) {\n if (!propertyDesc) {\n return true;\n }\n if (propertyDesc.writable === false) {\n return false;\n }\n return !(typeof propertyDesc.get === 'function' && typeof propertyDesc.set === 'undefined');\n}\nconst isWebWorker = (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope);\n// Make sure to access `process` through `_global` so that WebPack does not accidentally browserify\n// this code.\nconst isNode = (!('nw' in _global) && typeof _global.process !== 'undefined' &&\n {}.toString.call(_global.process) === '[object process]');\nconst isBrowser = !isNode && !isWebWorker && !!(isWindowExists && internalWindow['HTMLElement']);\n// we are in electron of nw, so we are both browser and nodejs\n// Make sure to access `process` through `_global` so that WebPack does not accidentally browserify\n// this code.\nconst isMix = typeof _global.process !== 'undefined' &&\n {}.toString.call(_global.process) === '[object process]' && !isWebWorker &&\n !!(isWindowExists && internalWindow['HTMLElement']);\nconst zoneSymbolEventNames = {};\nconst wrapFn = function (event) {\n // https://github.com/angular/zone.js/issues/911, in IE, sometimes\n // event will be undefined, so we need to use window.event\n event = event || _global.event;\n if (!event) {\n return;\n }\n let eventNameSymbol = zoneSymbolEventNames[event.type];\n if (!eventNameSymbol) {\n eventNameSymbol = zoneSymbolEventNames[event.type] = zoneSymbol('ON_PROPERTY' + event.type);\n }\n const target = this || event.target || _global;\n const listener = target[eventNameSymbol];\n let result;\n if (isBrowser && target === internalWindow && event.type === 'error') {\n // window.onerror have different signiture\n // https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror#window.onerror\n // and onerror callback will prevent default when callback return true\n const errorEvent = event;\n result = listener &&\n listener.call(this, errorEvent.message, errorEvent.filename, errorEvent.lineno, errorEvent.colno, errorEvent.error);\n if (result === true) {\n event.preventDefault();\n }\n }\n else {\n result = listener && listener.apply(this, arguments);\n if (result != undefined && !result) {\n event.preventDefault();\n }\n }\n return result;\n};\nfunction patchProperty(obj, prop, prototype) {\n let desc = ObjectGetOwnPropertyDescriptor(obj, prop);\n if (!desc && prototype) {\n // when patch window object, use prototype to check prop exist or not\n const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, prop);\n if (prototypeDesc) {\n desc = { enumerable: true, configurable: true };\n }\n }\n // if the descriptor not exists or is not configurable\n // just return\n if (!desc || !desc.configurable) {\n return;\n }\n const onPropPatchedSymbol = zoneSymbol('on' + prop + 'patched');\n if (obj.hasOwnProperty(onPropPatchedSymbol) && obj[onPropPatchedSymbol]) {\n return;\n }\n // A property descriptor cannot have getter/setter and be writable\n // deleting the writable and value properties avoids this error:\n //\n // TypeError: property descriptors must not specify a value or be writable when a\n // getter or setter has been specified\n delete desc.writable;\n delete desc.value;\n const originalDescGet = desc.get;\n const originalDescSet = desc.set;\n // substr(2) cuz 'onclick' -> 'click', etc\n const eventName = prop.substr(2);\n let eventNameSymbol = zoneSymbolEventNames[eventName];\n if (!eventNameSymbol) {\n eventNameSymbol = zoneSymbolEventNames[eventName] = zoneSymbol('ON_PROPERTY' + eventName);\n }\n desc.set = function (newValue) {\n // in some of windows's onproperty callback, this is undefined\n // so we need to check it\n let target = this;\n if (!target && obj === _global) {\n target = _global;\n }\n if (!target) {\n return;\n }\n let previousValue = target[eventNameSymbol];\n if (previousValue) {\n target.removeEventListener(eventName, wrapFn);\n }\n // issue #978, when onload handler was added before loading zone.js\n // we should remove it with originalDescSet\n if (originalDescSet) {\n originalDescSet.apply(target, NULL_ON_PROP_VALUE);\n }\n if (typeof newValue === 'function') {\n target[eventNameSymbol] = newValue;\n target.addEventListener(eventName, wrapFn, false);\n }\n else {\n target[eventNameSymbol] = null;\n }\n };\n // The getter would return undefined for unassigned properties but the default value of an\n // unassigned property is null\n desc.get = function () {\n // in some of windows's onproperty callback, this is undefined\n // so we need to check it\n let target = this;\n if (!target && obj === _global) {\n target = _global;\n }\n if (!target) {\n return null;\n }\n const listener = target[eventNameSymbol];\n if (listener) {\n return listener;\n }\n else if (originalDescGet) {\n // result will be null when use inline event attribute,\n // such as \n // because the onclick function is internal raw uncompiled handler\n // the onclick will be evaluated when first time event was triggered or\n // the property is accessed, https://github.com/angular/zone.js/issues/525\n // so we should use original native get to retrieve the handler\n let value = originalDescGet && originalDescGet.call(this);\n if (value) {\n desc.set.call(this, value);\n if (typeof target[REMOVE_ATTRIBUTE] === 'function') {\n target.removeAttribute(prop);\n }\n return value;\n }\n }\n return null;\n };\n ObjectDefineProperty(obj, prop, desc);\n obj[onPropPatchedSymbol] = true;\n}\nfunction patchOnProperties(obj, properties, prototype) {\n if (properties) {\n for (let i = 0; i < properties.length; i++) {\n patchProperty(obj, 'on' + properties[i], prototype);\n }\n }\n else {\n const onProperties = [];\n for (const prop in obj) {\n if (prop.substr(0, 2) == 'on') {\n onProperties.push(prop);\n }\n }\n for (let j = 0; j < onProperties.length; j++) {\n patchProperty(obj, onProperties[j], prototype);\n }\n }\n}\nconst originalInstanceKey = zoneSymbol('originalInstance');\n// wrap some native API on `window`\nfunction patchClass(className) {\n const OriginalClass = _global[className];\n if (!OriginalClass)\n return;\n // keep original class in global\n _global[zoneSymbol(className)] = OriginalClass;\n _global[className] = function () {\n const a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error('Arg list too long.');\n }\n };\n // attach original delegate to patched function\n attachOriginToPatched(_global[className], OriginalClass);\n const instance = new OriginalClass(function () { });\n let prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n ObjectDefineProperty(_global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop);\n // keep callback in wrapped function so we can\n // use it in Function.prototype.toString to return\n // the native one.\n attachOriginToPatched(this[originalInstanceKey][prop], fn);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n }\n });\n }\n }(prop));\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global[className][prop] = OriginalClass[prop];\n }\n }\n}\nfunction patchMethod(target, name, patchFn) {\n let proto = target;\n while (proto && !proto.hasOwnProperty(name)) {\n proto = ObjectGetPrototypeOf(proto);\n }\n if (!proto && target[name]) {\n // somehow we did not find it, but we can see it. This happens on IE for Window properties.\n proto = target;\n }\n const delegateName = zoneSymbol(name);\n let delegate = null;\n if (proto && (!(delegate = proto[delegateName]) || !proto.hasOwnProperty(delegateName))) {\n delegate = proto[delegateName] = proto[name];\n // check whether proto[name] is writable\n // some property is readonly in safari, such as HtmlCanvasElement.prototype.toBlob\n const desc = proto && ObjectGetOwnPropertyDescriptor(proto, name);\n if (isPropertyWritable(desc)) {\n const patchDelegate = patchFn(delegate, delegateName, name);\n proto[name] = function () {\n return patchDelegate(this, arguments);\n };\n attachOriginToPatched(proto[name], delegate);\n }\n }\n return delegate;\n}\n// TODO: @JiaLiPassion, support cancel task later if necessary\nfunction patchMacroTask(obj, funcName, metaCreator) {\n let setNative = null;\n function scheduleTask(task) {\n const data = task.data;\n data.args[data.cbIdx] = function () {\n task.invoke.apply(this, arguments);\n };\n setNative.apply(data.target, data.args);\n return task;\n }\n setNative = patchMethod(obj, funcName, (delegate) => function (self, args) {\n const meta = metaCreator(self, args);\n if (meta.cbIdx >= 0 && typeof args[meta.cbIdx] === 'function') {\n return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask);\n }\n else {\n // cause an error by calling it directly.\n return delegate.apply(self, args);\n }\n });\n}\nfunction attachOriginToPatched(patched, original) {\n patched[zoneSymbol('OriginalDelegate')] = original;\n}\nlet isDetectedIEOrEdge = false;\nlet ieOrEdge = false;\nfunction isIE() {\n try {\n const ua = internalWindow.navigator.userAgent;\n if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1) {\n return true;\n }\n }\n catch (error) {\n }\n return false;\n}\nfunction isIEOrEdge() {\n if (isDetectedIEOrEdge) {\n return ieOrEdge;\n }\n isDetectedIEOrEdge = true;\n try {\n const ua = internalWindow.navigator.userAgent;\n if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1 || ua.indexOf('Edge/') !== -1) {\n ieOrEdge = true;\n }\n }\n catch (error) {\n }\n return ieOrEdge;\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nZone.__load_patch('ZoneAwarePromise', (global, Zone, api) => {\n const ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n const ObjectDefineProperty = Object.defineProperty;\n function readableObjectToString(obj) {\n if (obj && obj.toString === Object.prototype.toString) {\n const className = obj.constructor && obj.constructor.name;\n return (className ? className : '') + ': ' + JSON.stringify(obj);\n }\n return obj ? obj.toString() : Object.prototype.toString.call(obj);\n }\n const __symbol__ = api.symbol;\n const _uncaughtPromiseErrors = [];\n const isDisableWrappingUncaughtPromiseRejection = global[__symbol__('DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION')] === true;\n const symbolPromise = __symbol__('Promise');\n const symbolThen = __symbol__('then');\n const creationTrace = '__creationTrace__';\n api.onUnhandledError = (e) => {\n if (api.showUncaughtError()) {\n const rejection = e && e.rejection;\n if (rejection) {\n console.error('Unhandled Promise rejection:', rejection instanceof Error ? rejection.message : rejection, '; Zone:', e.zone.name, '; Task:', e.task && e.task.source, '; Value:', rejection, rejection instanceof Error ? rejection.stack : undefined);\n }\n else {\n console.error(e);\n }\n }\n };\n api.microtaskDrainDone = () => {\n while (_uncaughtPromiseErrors.length) {\n const uncaughtPromiseError = _uncaughtPromiseErrors.shift();\n try {\n uncaughtPromiseError.zone.runGuarded(() => {\n if (uncaughtPromiseError.throwOriginal) {\n throw uncaughtPromiseError.rejection;\n }\n throw uncaughtPromiseError;\n });\n }\n catch (error) {\n handleUnhandledRejection(error);\n }\n }\n };\n const UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL = __symbol__('unhandledPromiseRejectionHandler');\n function handleUnhandledRejection(e) {\n api.onUnhandledError(e);\n try {\n const handler = Zone[UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL];\n if (typeof handler === 'function') {\n handler.call(this, e);\n }\n }\n catch (err) {\n }\n }\n function isThenable(value) {\n return value && value.then;\n }\n function forwardResolution(value) {\n return value;\n }\n function forwardRejection(rejection) {\n return ZoneAwarePromise.reject(rejection);\n }\n const symbolState = __symbol__('state');\n const symbolValue = __symbol__('value');\n const symbolFinally = __symbol__('finally');\n const symbolParentPromiseValue = __symbol__('parentPromiseValue');\n const symbolParentPromiseState = __symbol__('parentPromiseState');\n const source = 'Promise.then';\n const UNRESOLVED = null;\n const RESOLVED = true;\n const REJECTED = false;\n const REJECTED_NO_CATCH = 0;\n function makeResolver(promise, state) {\n return (v) => {\n try {\n resolvePromise(promise, state, v);\n }\n catch (err) {\n resolvePromise(promise, false, err);\n }\n // Do not return value or you will break the Promise spec.\n };\n }\n const once = function () {\n let wasCalled = false;\n return function wrapper(wrappedFunction) {\n return function () {\n if (wasCalled) {\n return;\n }\n wasCalled = true;\n wrappedFunction.apply(null, arguments);\n };\n };\n };\n const TYPE_ERROR = 'Promise resolved with itself';\n const CURRENT_TASK_TRACE_SYMBOL = __symbol__('currentTaskTrace');\n // Promise Resolution\n function resolvePromise(promise, state, value) {\n const onceWrapper = once();\n if (promise === value) {\n throw new TypeError(TYPE_ERROR);\n }\n if (promise[symbolState] === UNRESOLVED) {\n // should only get value.then once based on promise spec.\n let then = null;\n try {\n if (typeof value === 'object' || typeof value === 'function') {\n then = value && value.then;\n }\n }\n catch (err) {\n onceWrapper(() => {\n resolvePromise(promise, false, err);\n })();\n return promise;\n }\n // if (value instanceof ZoneAwarePromise) {\n if (state !== REJECTED && value instanceof ZoneAwarePromise &&\n value.hasOwnProperty(symbolState) && value.hasOwnProperty(symbolValue) &&\n value[symbolState] !== UNRESOLVED) {\n clearRejectedNoCatch(value);\n resolvePromise(promise, value[symbolState], value[symbolValue]);\n }\n else if (state !== REJECTED && typeof then === 'function') {\n try {\n then.call(value, onceWrapper(makeResolver(promise, state)), onceWrapper(makeResolver(promise, false)));\n }\n catch (err) {\n onceWrapper(() => {\n resolvePromise(promise, false, err);\n })();\n }\n }\n else {\n promise[symbolState] = state;\n const queue = promise[symbolValue];\n promise[symbolValue] = value;\n if (promise[symbolFinally] === symbolFinally) {\n // the promise is generated by Promise.prototype.finally\n if (state === RESOLVED) {\n // the state is resolved, should ignore the value\n // and use parent promise value\n promise[symbolState] = promise[symbolParentPromiseState];\n promise[symbolValue] = promise[symbolParentPromiseValue];\n }\n }\n // record task information in value when error occurs, so we can\n // do some additional work such as render longStackTrace\n if (state === REJECTED && value instanceof Error) {\n // check if longStackTraceZone is here\n const trace = Zone.currentTask && Zone.currentTask.data &&\n Zone.currentTask.data[creationTrace];\n if (trace) {\n // only keep the long stack trace into error when in longStackTraceZone\n ObjectDefineProperty(value, CURRENT_TASK_TRACE_SYMBOL, { configurable: true, enumerable: false, writable: true, value: trace });\n }\n }\n for (let i = 0; i < queue.length;) {\n scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]);\n }\n if (queue.length == 0 && state == REJECTED) {\n promise[symbolState] = REJECTED_NO_CATCH;\n let uncaughtPromiseError = value;\n try {\n // Here we throws a new Error to print more readable error log\n // and if the value is not an error, zone.js builds an `Error`\n // Object here to attach the stack information.\n throw new Error('Uncaught (in promise): ' + readableObjectToString(value) +\n (value && value.stack ? '\\n' + value.stack : ''));\n }\n catch (err) {\n uncaughtPromiseError = err;\n }\n if (isDisableWrappingUncaughtPromiseRejection) {\n // If disable wrapping uncaught promise reject\n // use the value instead of wrapping it.\n uncaughtPromiseError.throwOriginal = true;\n }\n uncaughtPromiseError.rejection = value;\n uncaughtPromiseError.promise = promise;\n uncaughtPromiseError.zone = Zone.current;\n uncaughtPromiseError.task = Zone.currentTask;\n _uncaughtPromiseErrors.push(uncaughtPromiseError);\n api.scheduleMicroTask(); // to make sure that it is running\n }\n }\n }\n // Resolving an already resolved promise is a noop.\n return promise;\n }\n const REJECTION_HANDLED_HANDLER = __symbol__('rejectionHandledHandler');\n function clearRejectedNoCatch(promise) {\n if (promise[symbolState] === REJECTED_NO_CATCH) {\n // if the promise is rejected no catch status\n // and queue.length > 0, means there is a error handler\n // here to handle the rejected promise, we should trigger\n // windows.rejectionhandled eventHandler or nodejs rejectionHandled\n // eventHandler\n try {\n const handler = Zone[REJECTION_HANDLED_HANDLER];\n if (handler && typeof handler === 'function') {\n handler.call(this, { rejection: promise[symbolValue], promise: promise });\n }\n }\n catch (err) {\n }\n promise[symbolState] = REJECTED;\n for (let i = 0; i < _uncaughtPromiseErrors.length; i++) {\n if (promise === _uncaughtPromiseErrors[i].promise) {\n _uncaughtPromiseErrors.splice(i, 1);\n }\n }\n }\n }\n function scheduleResolveOrReject(promise, zone, chainPromise, onFulfilled, onRejected) {\n clearRejectedNoCatch(promise);\n const promiseState = promise[symbolState];\n const delegate = promiseState ?\n (typeof onFulfilled === 'function') ? onFulfilled : forwardResolution :\n (typeof onRejected === 'function') ? onRejected : forwardRejection;\n zone.scheduleMicroTask(source, () => {\n try {\n const parentPromiseValue = promise[symbolValue];\n const isFinallyPromise = !!chainPromise && symbolFinally === chainPromise[symbolFinally];\n if (isFinallyPromise) {\n // if the promise is generated from finally call, keep parent promise's state and value\n chainPromise[symbolParentPromiseValue] = parentPromiseValue;\n chainPromise[symbolParentPromiseState] = promiseState;\n }\n // should not pass value to finally callback\n const value = zone.run(delegate, undefined, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution ?\n [] :\n [parentPromiseValue]);\n resolvePromise(chainPromise, true, value);\n }\n catch (error) {\n // if error occurs, should always return this error\n resolvePromise(chainPromise, false, error);\n }\n }, chainPromise);\n }\n const ZONE_AWARE_PROMISE_TO_STRING = 'function ZoneAwarePromise() { [native code] }';\n const noop = function () { };\n class ZoneAwarePromise {\n static toString() {\n return ZONE_AWARE_PROMISE_TO_STRING;\n }\n static resolve(value) {\n return resolvePromise(new this(null), RESOLVED, value);\n }\n static reject(error) {\n return resolvePromise(new this(null), REJECTED, error);\n }\n static race(values) {\n let resolve;\n let reject;\n let promise = new this((res, rej) => {\n resolve = res;\n reject = rej;\n });\n function onResolve(value) {\n resolve(value);\n }\n function onReject(error) {\n reject(error);\n }\n for (let value of values) {\n if (!isThenable(value)) {\n value = this.resolve(value);\n }\n value.then(onResolve, onReject);\n }\n return promise;\n }\n static all(values) {\n return ZoneAwarePromise.allWithCallback(values);\n }\n static allSettled(values) {\n const P = this && this.prototype instanceof ZoneAwarePromise ? this : ZoneAwarePromise;\n return P.allWithCallback(values, {\n thenCallback: (value) => ({ status: 'fulfilled', value }),\n errorCallback: (err) => ({ status: 'rejected', reason: err })\n });\n }\n static allWithCallback(values, callback) {\n let resolve;\n let reject;\n let promise = new this((res, rej) => {\n resolve = res;\n reject = rej;\n });\n // Start at 2 to prevent prematurely resolving if .then is called immediately.\n let unresolvedCount = 2;\n let valueIndex = 0;\n const resolvedValues = [];\n for (let value of values) {\n if (!isThenable(value)) {\n value = this.resolve(value);\n }\n const curValueIndex = valueIndex;\n try {\n value.then((value) => {\n resolvedValues[curValueIndex] = callback ? callback.thenCallback(value) : value;\n unresolvedCount--;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n }, (err) => {\n if (!callback) {\n reject(err);\n }\n else {\n resolvedValues[curValueIndex] = callback.errorCallback(err);\n unresolvedCount--;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n }\n });\n }\n catch (thenErr) {\n reject(thenErr);\n }\n unresolvedCount++;\n valueIndex++;\n }\n // Make the unresolvedCount zero-based again.\n unresolvedCount -= 2;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n return promise;\n }\n constructor(executor) {\n const promise = this;\n if (!(promise instanceof ZoneAwarePromise)) {\n throw new Error('Must be an instanceof Promise.');\n }\n promise[symbolState] = UNRESOLVED;\n promise[symbolValue] = []; // queue;\n try {\n executor && executor(makeResolver(promise, RESOLVED), makeResolver(promise, REJECTED));\n }\n catch (error) {\n resolvePromise(promise, false, error);\n }\n }\n get [Symbol.toStringTag]() {\n return 'Promise';\n }\n get [Symbol.species]() {\n return ZoneAwarePromise;\n }\n then(onFulfilled, onRejected) {\n let C = this.constructor[Symbol.species];\n if (!C || typeof C !== 'function') {\n C = this.constructor || ZoneAwarePromise;\n }\n const chainPromise = new C(noop);\n const zone = Zone.current;\n if (this[symbolState] == UNRESOLVED) {\n this[symbolValue].push(zone, chainPromise, onFulfilled, onRejected);\n }\n else {\n scheduleResolveOrReject(this, zone, chainPromise, onFulfilled, onRejected);\n }\n return chainPromise;\n }\n catch(onRejected) {\n return this.then(null, onRejected);\n }\n finally(onFinally) {\n let C = this.constructor[Symbol.species];\n if (!C || typeof C !== 'function') {\n C = ZoneAwarePromise;\n }\n const chainPromise = new C(noop);\n chainPromise[symbolFinally] = symbolFinally;\n const zone = Zone.current;\n if (this[symbolState] == UNRESOLVED) {\n this[symbolValue].push(zone, chainPromise, onFinally, onFinally);\n }\n else {\n scheduleResolveOrReject(this, zone, chainPromise, onFinally, onFinally);\n }\n return chainPromise;\n }\n }\n // Protect against aggressive optimizers dropping seemingly unused properties.\n // E.g. Closure Compiler in advanced mode.\n ZoneAwarePromise['resolve'] = ZoneAwarePromise.resolve;\n ZoneAwarePromise['reject'] = ZoneAwarePromise.reject;\n ZoneAwarePromise['race'] = ZoneAwarePromise.race;\n ZoneAwarePromise['all'] = ZoneAwarePromise.all;\n const NativePromise = global[symbolPromise] = global['Promise'];\n global['Promise'] = ZoneAwarePromise;\n const symbolThenPatched = __symbol__('thenPatched');\n function patchThen(Ctor) {\n const proto = Ctor.prototype;\n const prop = ObjectGetOwnPropertyDescriptor(proto, 'then');\n if (prop && (prop.writable === false || !prop.configurable)) {\n // check Ctor.prototype.then propertyDescriptor is writable or not\n // in meteor env, writable is false, we should ignore such case\n return;\n }\n const originalThen = proto.then;\n // Keep a reference to the original method.\n proto[symbolThen] = originalThen;\n Ctor.prototype.then = function (onResolve, onReject) {\n const wrapped = new ZoneAwarePromise((resolve, reject) => {\n originalThen.call(this, resolve, reject);\n });\n return wrapped.then(onResolve, onReject);\n };\n Ctor[symbolThenPatched] = true;\n }\n api.patchThen = patchThen;\n function zoneify(fn) {\n return function (self, args) {\n let resultPromise = fn.apply(self, args);\n if (resultPromise instanceof ZoneAwarePromise) {\n return resultPromise;\n }\n let ctor = resultPromise.constructor;\n if (!ctor[symbolThenPatched]) {\n patchThen(ctor);\n }\n return resultPromise;\n };\n }\n if (NativePromise) {\n patchThen(NativePromise);\n patchMethod(global, 'fetch', delegate => zoneify(delegate));\n }\n // This is not part of public API, but it is useful for tests, so we expose it.\n Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;\n return ZoneAwarePromise;\n});\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// override Function.prototype.toString to make zone.js patched function\n// look like native function\nZone.__load_patch('toString', (global) => {\n // patch Func.prototype.toString to let them look like native\n const originalFunctionToString = Function.prototype.toString;\n const ORIGINAL_DELEGATE_SYMBOL = zoneSymbol('OriginalDelegate');\n const PROMISE_SYMBOL = zoneSymbol('Promise');\n const ERROR_SYMBOL = zoneSymbol('Error');\n const newFunctionToString = function toString() {\n if (typeof this === 'function') {\n const originalDelegate = this[ORIGINAL_DELEGATE_SYMBOL];\n if (originalDelegate) {\n if (typeof originalDelegate === 'function') {\n return originalFunctionToString.call(originalDelegate);\n }\n else {\n return Object.prototype.toString.call(originalDelegate);\n }\n }\n if (this === Promise) {\n const nativePromise = global[PROMISE_SYMBOL];\n if (nativePromise) {\n return originalFunctionToString.call(nativePromise);\n }\n }\n if (this === Error) {\n const nativeError = global[ERROR_SYMBOL];\n if (nativeError) {\n return originalFunctionToString.call(nativeError);\n }\n }\n }\n return originalFunctionToString.call(this);\n };\n newFunctionToString[ORIGINAL_DELEGATE_SYMBOL] = originalFunctionToString;\n Function.prototype.toString = newFunctionToString;\n // patch Object.prototype.toString to let them look like native\n const originalObjectToString = Object.prototype.toString;\n const PROMISE_OBJECT_TO_STRING = '[object Promise]';\n Object.prototype.toString = function () {\n if (typeof Promise === 'function' && this instanceof Promise) {\n return PROMISE_OBJECT_TO_STRING;\n }\n return originalObjectToString.call(this);\n };\n});\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nlet passiveSupported = false;\nif (typeof window !== 'undefined') {\n try {\n const options = Object.defineProperty({}, 'passive', {\n get: function () {\n passiveSupported = true;\n }\n });\n window.addEventListener('test', options, options);\n window.removeEventListener('test', options, options);\n }\n catch (err) {\n passiveSupported = false;\n }\n}\n// an identifier to tell ZoneTask do not create a new invoke closure\nconst OPTIMIZED_ZONE_EVENT_TASK_DATA = {\n useG: true\n};\nconst zoneSymbolEventNames$1 = {};\nconst globalSources = {};\nconst EVENT_NAME_SYMBOL_REGX = new RegExp('^' + ZONE_SYMBOL_PREFIX + '(\\\\w+)(true|false)$');\nconst IMMEDIATE_PROPAGATION_SYMBOL = zoneSymbol('propagationStopped');\nfunction prepareEventNames(eventName, eventNameToString) {\n const falseEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + FALSE_STR;\n const trueEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + TRUE_STR;\n const symbol = ZONE_SYMBOL_PREFIX + falseEventName;\n const symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;\n zoneSymbolEventNames$1[eventName] = {};\n zoneSymbolEventNames$1[eventName][FALSE_STR] = symbol;\n zoneSymbolEventNames$1[eventName][TRUE_STR] = symbolCapture;\n}\nfunction patchEventTarget(_global, apis, patchOptions) {\n const ADD_EVENT_LISTENER = (patchOptions && patchOptions.add) || ADD_EVENT_LISTENER_STR;\n const REMOVE_EVENT_LISTENER = (patchOptions && patchOptions.rm) || REMOVE_EVENT_LISTENER_STR;\n const LISTENERS_EVENT_LISTENER = (patchOptions && patchOptions.listeners) || 'eventListeners';\n const REMOVE_ALL_LISTENERS_EVENT_LISTENER = (patchOptions && patchOptions.rmAll) || 'removeAllListeners';\n const zoneSymbolAddEventListener = zoneSymbol(ADD_EVENT_LISTENER);\n const ADD_EVENT_LISTENER_SOURCE = '.' + ADD_EVENT_LISTENER + ':';\n const PREPEND_EVENT_LISTENER = 'prependListener';\n const PREPEND_EVENT_LISTENER_SOURCE = '.' + PREPEND_EVENT_LISTENER + ':';\n const invokeTask = function (task, target, event) {\n // for better performance, check isRemoved which is set\n // by removeEventListener\n if (task.isRemoved) {\n return;\n }\n const delegate = task.callback;\n if (typeof delegate === 'object' && delegate.handleEvent) {\n // create the bind version of handleEvent when invoke\n task.callback = (event) => delegate.handleEvent(event);\n task.originalDelegate = delegate;\n }\n // invoke static task.invoke\n task.invoke(task, target, [event]);\n const options = task.options;\n if (options && typeof options === 'object' && options.once) {\n // if options.once is true, after invoke once remove listener here\n // only browser need to do this, nodejs eventEmitter will cal removeListener\n // inside EventEmitter.once\n const delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n target[REMOVE_EVENT_LISTENER].call(target, event.type, delegate, options);\n }\n };\n // global shared zoneAwareCallback to handle all event callback with capture = false\n const globalZoneAwareCallback = function (event) {\n // https://github.com/angular/zone.js/issues/911, in IE, sometimes\n // event will be undefined, so we need to use window.event\n event = event || _global.event;\n if (!event) {\n return;\n }\n // event.target is needed for Samsung TV and SourceBuffer\n // || global is needed https://github.com/angular/zone.js/issues/190\n const target = this || event.target || _global;\n const tasks = target[zoneSymbolEventNames$1[event.type][FALSE_STR]];\n if (tasks) {\n // invoke all tasks which attached to current target with given event.type and capture = false\n // for performance concern, if task.length === 1, just invoke\n if (tasks.length === 1) {\n invokeTask(tasks[0], target, event);\n }\n else {\n // https://github.com/angular/zone.js/issues/836\n // copy the tasks array before invoke, to avoid\n // the callback will remove itself or other listener\n const copyTasks = tasks.slice();\n for (let i = 0; i < copyTasks.length; i++) {\n if (event && event[IMMEDIATE_PROPAGATION_SYMBOL] === true) {\n break;\n }\n invokeTask(copyTasks[i], target, event);\n }\n }\n }\n };\n // global shared zoneAwareCallback to handle all event callback with capture = true\n const globalZoneAwareCaptureCallback = function (event) {\n // https://github.com/angular/zone.js/issues/911, in IE, sometimes\n // event will be undefined, so we need to use window.event\n event = event || _global.event;\n if (!event) {\n return;\n }\n // event.target is needed for Samsung TV and SourceBuffer\n // || global is needed https://github.com/angular/zone.js/issues/190\n const target = this || event.target || _global;\n const tasks = target[zoneSymbolEventNames$1[event.type][TRUE_STR]];\n if (tasks) {\n // invoke all tasks which attached to current target with given event.type and capture = false\n // for performance concern, if task.length === 1, just invoke\n if (tasks.length === 1) {\n invokeTask(tasks[0], target, event);\n }\n else {\n // https://github.com/angular/zone.js/issues/836\n // copy the tasks array before invoke, to avoid\n // the callback will remove itself or other listener\n const copyTasks = tasks.slice();\n for (let i = 0; i < copyTasks.length; i++) {\n if (event && event[IMMEDIATE_PROPAGATION_SYMBOL] === true) {\n break;\n }\n invokeTask(copyTasks[i], target, event);\n }\n }\n }\n };\n function patchEventTargetMethods(obj, patchOptions) {\n if (!obj) {\n return false;\n }\n let useGlobalCallback = true;\n if (patchOptions && patchOptions.useG !== undefined) {\n useGlobalCallback = patchOptions.useG;\n }\n const validateHandler = patchOptions && patchOptions.vh;\n let checkDuplicate = true;\n if (patchOptions && patchOptions.chkDup !== undefined) {\n checkDuplicate = patchOptions.chkDup;\n }\n let returnTarget = false;\n if (patchOptions && patchOptions.rt !== undefined) {\n returnTarget = patchOptions.rt;\n }\n let proto = obj;\n while (proto && !proto.hasOwnProperty(ADD_EVENT_LISTENER)) {\n proto = ObjectGetPrototypeOf(proto);\n }\n if (!proto && obj[ADD_EVENT_LISTENER]) {\n // somehow we did not find it, but we can see it. This happens on IE for Window properties.\n proto = obj;\n }\n if (!proto) {\n return false;\n }\n if (proto[zoneSymbolAddEventListener]) {\n return false;\n }\n const eventNameToString = patchOptions && patchOptions.eventNameToString;\n // a shared global taskData to pass data for scheduleEventTask\n // so we do not need to create a new object just for pass some data\n const taskData = {};\n const nativeAddEventListener = proto[zoneSymbolAddEventListener] = proto[ADD_EVENT_LISTENER];\n const nativeRemoveEventListener = proto[zoneSymbol(REMOVE_EVENT_LISTENER)] =\n proto[REMOVE_EVENT_LISTENER];\n const nativeListeners = proto[zoneSymbol(LISTENERS_EVENT_LISTENER)] =\n proto[LISTENERS_EVENT_LISTENER];\n const nativeRemoveAllListeners = proto[zoneSymbol(REMOVE_ALL_LISTENERS_EVENT_LISTENER)] =\n proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER];\n let nativePrependEventListener;\n if (patchOptions && patchOptions.prepend) {\n nativePrependEventListener = proto[zoneSymbol(patchOptions.prepend)] =\n proto[patchOptions.prepend];\n }\n /**\n * This util function will build an option object with passive option\n * to handle all possible input from the user.\n */\n function buildEventListenerOptions(options, passive) {\n if (!passiveSupported && typeof options === 'object' && options) {\n // doesn't support passive but user want to pass an object as options.\n // this will not work on some old browser, so we just pass a boolean\n // as useCapture parameter\n return !!options.capture;\n }\n if (!passiveSupported || !passive) {\n return options;\n }\n if (typeof options === 'boolean') {\n return { capture: options, passive: true };\n }\n if (!options) {\n return { passive: true };\n }\n if (typeof options === 'object' && options.passive !== false) {\n return Object.assign(Object.assign({}, options), { passive: true });\n }\n return options;\n }\n const customScheduleGlobal = function (task) {\n // if there is already a task for the eventName + capture,\n // just return, because we use the shared globalZoneAwareCallback here.\n if (taskData.isExisting) {\n return;\n }\n return nativeAddEventListener.call(taskData.target, taskData.eventName, taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, taskData.options);\n };\n const customCancelGlobal = function (task) {\n // if task is not marked as isRemoved, this call is directly\n // from Zone.prototype.cancelTask, we should remove the task\n // from tasksList of target first\n if (!task.isRemoved) {\n const symbolEventNames = zoneSymbolEventNames$1[task.eventName];\n let symbolEventName;\n if (symbolEventNames) {\n symbolEventName = symbolEventNames[task.capture ? TRUE_STR : FALSE_STR];\n }\n const existingTasks = symbolEventName && task.target[symbolEventName];\n if (existingTasks) {\n for (let i = 0; i < existingTasks.length; i++) {\n const existingTask = existingTasks[i];\n if (existingTask === task) {\n existingTasks.splice(i, 1);\n // set isRemoved to data for faster invokeTask check\n task.isRemoved = true;\n if (existingTasks.length === 0) {\n // all tasks for the eventName + capture have gone,\n // remove globalZoneAwareCallback and remove the task cache from target\n task.allRemoved = true;\n task.target[symbolEventName] = null;\n }\n break;\n }\n }\n }\n }\n // if all tasks for the eventName + capture have gone,\n // we will really remove the global event callback,\n // if not, return\n if (!task.allRemoved) {\n return;\n }\n return nativeRemoveEventListener.call(task.target, task.eventName, task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, task.options);\n };\n const customScheduleNonGlobal = function (task) {\n return nativeAddEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n };\n const customSchedulePrepend = function (task) {\n return nativePrependEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n };\n const customCancelNonGlobal = function (task) {\n return nativeRemoveEventListener.call(task.target, task.eventName, task.invoke, task.options);\n };\n const customSchedule = useGlobalCallback ? customScheduleGlobal : customScheduleNonGlobal;\n const customCancel = useGlobalCallback ? customCancelGlobal : customCancelNonGlobal;\n const compareTaskCallbackVsDelegate = function (task, delegate) {\n const typeOfDelegate = typeof delegate;\n return (typeOfDelegate === 'function' && task.callback === delegate) ||\n (typeOfDelegate === 'object' && task.originalDelegate === delegate);\n };\n const compare = (patchOptions && patchOptions.diff) ? patchOptions.diff : compareTaskCallbackVsDelegate;\n const unpatchedEvents = Zone[zoneSymbol('UNPATCHED_EVENTS')];\n const passiveEvents = _global[zoneSymbol('PASSIVE_EVENTS')];\n const makeAddListener = function (nativeListener, addSource, customScheduleFn, customCancelFn, returnTarget = false, prepend = false) {\n return function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n let delegate = arguments[1];\n if (!delegate) {\n return nativeListener.apply(this, arguments);\n }\n if (isNode && eventName === 'uncaughtException') {\n // don't patch uncaughtException of nodejs to prevent endless loop\n return nativeListener.apply(this, arguments);\n }\n // don't create the bind delegate function for handleEvent\n // case here to improve addEventListener performance\n // we will create the bind delegate when invoke\n let isHandleEvent = false;\n if (typeof delegate !== 'function') {\n if (!delegate.handleEvent) {\n return nativeListener.apply(this, arguments);\n }\n isHandleEvent = true;\n }\n if (validateHandler && !validateHandler(nativeListener, delegate, target, arguments)) {\n return;\n }\n const passive = passiveSupported && !!passiveEvents && passiveEvents.indexOf(eventName) !== -1;\n const options = buildEventListenerOptions(arguments[2], passive);\n if (unpatchedEvents) {\n // check upatched list\n for (let i = 0; i < unpatchedEvents.length; i++) {\n if (eventName === unpatchedEvents[i]) {\n if (passive) {\n return nativeListener.call(target, eventName, delegate, options);\n }\n else {\n return nativeListener.apply(this, arguments);\n }\n }\n }\n }\n const capture = !options ? false : typeof options === 'boolean' ? true : options.capture;\n const once = options && typeof options === 'object' ? options.once : false;\n const zone = Zone.current;\n let symbolEventNames = zoneSymbolEventNames$1[eventName];\n if (!symbolEventNames) {\n prepareEventNames(eventName, eventNameToString);\n symbolEventNames = zoneSymbolEventNames$1[eventName];\n }\n const symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n let existingTasks = target[symbolEventName];\n let isExisting = false;\n if (existingTasks) {\n // already have task registered\n isExisting = true;\n if (checkDuplicate) {\n for (let i = 0; i < existingTasks.length; i++) {\n if (compare(existingTasks[i], delegate)) {\n // same callback, same capture, same event name, just return\n return;\n }\n }\n }\n }\n else {\n existingTasks = target[symbolEventName] = [];\n }\n let source;\n const constructorName = target.constructor['name'];\n const targetSource = globalSources[constructorName];\n if (targetSource) {\n source = targetSource[eventName];\n }\n if (!source) {\n source = constructorName + addSource +\n (eventNameToString ? eventNameToString(eventName) : eventName);\n }\n // do not create a new object as task.data to pass those things\n // just use the global shared one\n taskData.options = options;\n if (once) {\n // if addEventListener with once options, we don't pass it to\n // native addEventListener, instead we keep the once setting\n // and handle ourselves.\n taskData.options.once = false;\n }\n taskData.target = target;\n taskData.capture = capture;\n taskData.eventName = eventName;\n taskData.isExisting = isExisting;\n const data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : undefined;\n // keep taskData into data to allow onScheduleEventTask to access the task information\n if (data) {\n data.taskData = taskData;\n }\n const task = zone.scheduleEventTask(source, delegate, data, customScheduleFn, customCancelFn);\n // should clear taskData.target to avoid memory leak\n // issue, https://github.com/angular/angular/issues/20442\n taskData.target = null;\n // need to clear up taskData because it is a global object\n if (data) {\n data.taskData = null;\n }\n // have to save those information to task in case\n // application may call task.zone.cancelTask() directly\n if (once) {\n options.once = true;\n }\n if (!(!passiveSupported && typeof task.options === 'boolean')) {\n // if not support passive, and we pass an option object\n // to addEventListener, we should save the options to task\n task.options = options;\n }\n task.target = target;\n task.capture = capture;\n task.eventName = eventName;\n if (isHandleEvent) {\n // save original delegate for compare to check duplicate\n task.originalDelegate = delegate;\n }\n if (!prepend) {\n existingTasks.push(task);\n }\n else {\n existingTasks.unshift(task);\n }\n if (returnTarget) {\n return target;\n }\n };\n };\n proto[ADD_EVENT_LISTENER] = makeAddListener(nativeAddEventListener, ADD_EVENT_LISTENER_SOURCE, customSchedule, customCancel, returnTarget);\n if (nativePrependEventListener) {\n proto[PREPEND_EVENT_LISTENER] = makeAddListener(nativePrependEventListener, PREPEND_EVENT_LISTENER_SOURCE, customSchedulePrepend, customCancel, returnTarget, true);\n }\n proto[REMOVE_EVENT_LISTENER] = function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n const options = arguments[2];\n const capture = !options ? false : typeof options === 'boolean' ? true : options.capture;\n const delegate = arguments[1];\n if (!delegate) {\n return nativeRemoveEventListener.apply(this, arguments);\n }\n if (validateHandler &&\n !validateHandler(nativeRemoveEventListener, delegate, target, arguments)) {\n return;\n }\n const symbolEventNames = zoneSymbolEventNames$1[eventName];\n let symbolEventName;\n if (symbolEventNames) {\n symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n }\n const existingTasks = symbolEventName && target[symbolEventName];\n if (existingTasks) {\n for (let i = 0; i < existingTasks.length; i++) {\n const existingTask = existingTasks[i];\n if (compare(existingTask, delegate)) {\n existingTasks.splice(i, 1);\n // set isRemoved to data for faster invokeTask check\n existingTask.isRemoved = true;\n if (existingTasks.length === 0) {\n // all tasks for the eventName + capture have gone,\n // remove globalZoneAwareCallback and remove the task cache from target\n existingTask.allRemoved = true;\n target[symbolEventName] = null;\n // in the target, we have an event listener which is added by on_property\n // such as target.onclick = function() {}, so we need to clear this internal\n // property too if all delegates all removed\n if (typeof eventName === 'string') {\n const onPropertySymbol = ZONE_SYMBOL_PREFIX + 'ON_PROPERTY' + eventName;\n target[onPropertySymbol] = null;\n }\n }\n existingTask.zone.cancelTask(existingTask);\n if (returnTarget) {\n return target;\n }\n return;\n }\n }\n }\n // issue 930, didn't find the event name or callback\n // from zone kept existingTasks, the callback maybe\n // added outside of zone, we need to call native removeEventListener\n // to try to remove it.\n return nativeRemoveEventListener.apply(this, arguments);\n };\n proto[LISTENERS_EVENT_LISTENER] = function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n const listeners = [];\n const tasks = findEventTasks(target, eventNameToString ? eventNameToString(eventName) : eventName);\n for (let i = 0; i < tasks.length; i++) {\n const task = tasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n listeners.push(delegate);\n }\n return listeners;\n };\n proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER] = function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (!eventName) {\n const keys = Object.keys(target);\n for (let i = 0; i < keys.length; i++) {\n const prop = keys[i];\n const match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n let evtName = match && match[1];\n // in nodejs EventEmitter, removeListener event is\n // used for monitoring the removeListener call,\n // so just keep removeListener eventListener until\n // all other eventListeners are removed\n if (evtName && evtName !== 'removeListener') {\n this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, evtName);\n }\n }\n // remove removeListener listener finally\n this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, 'removeListener');\n }\n else {\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n const symbolEventNames = zoneSymbolEventNames$1[eventName];\n if (symbolEventNames) {\n const symbolEventName = symbolEventNames[FALSE_STR];\n const symbolCaptureEventName = symbolEventNames[TRUE_STR];\n const tasks = target[symbolEventName];\n const captureTasks = target[symbolCaptureEventName];\n if (tasks) {\n const removeTasks = tasks.slice();\n for (let i = 0; i < removeTasks.length; i++) {\n const task = removeTasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n }\n }\n if (captureTasks) {\n const removeTasks = captureTasks.slice();\n for (let i = 0; i < removeTasks.length; i++) {\n const task = removeTasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n }\n }\n }\n }\n if (returnTarget) {\n return this;\n }\n };\n // for native toString patch\n attachOriginToPatched(proto[ADD_EVENT_LISTENER], nativeAddEventListener);\n attachOriginToPatched(proto[REMOVE_EVENT_LISTENER], nativeRemoveEventListener);\n if (nativeRemoveAllListeners) {\n attachOriginToPatched(proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER], nativeRemoveAllListeners);\n }\n if (nativeListeners) {\n attachOriginToPatched(proto[LISTENERS_EVENT_LISTENER], nativeListeners);\n }\n return true;\n }\n let results = [];\n for (let i = 0; i < apis.length; i++) {\n results[i] = patchEventTargetMethods(apis[i], patchOptions);\n }\n return results;\n}\nfunction findEventTasks(target, eventName) {\n if (!eventName) {\n const foundTasks = [];\n for (let prop in target) {\n const match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n let evtName = match && match[1];\n if (evtName && (!eventName || evtName === eventName)) {\n const tasks = target[prop];\n if (tasks) {\n for (let i = 0; i < tasks.length; i++) {\n foundTasks.push(tasks[i]);\n }\n }\n }\n }\n return foundTasks;\n }\n let symbolEventName = zoneSymbolEventNames$1[eventName];\n if (!symbolEventName) {\n prepareEventNames(eventName);\n symbolEventName = zoneSymbolEventNames$1[eventName];\n }\n const captureFalseTasks = target[symbolEventName[FALSE_STR]];\n const captureTrueTasks = target[symbolEventName[TRUE_STR]];\n if (!captureFalseTasks) {\n return captureTrueTasks ? captureTrueTasks.slice() : [];\n }\n else {\n return captureTrueTasks ? captureFalseTasks.concat(captureTrueTasks) :\n captureFalseTasks.slice();\n }\n}\nfunction patchEventPrototype(global, api) {\n const Event = global['Event'];\n if (Event && Event.prototype) {\n api.patchMethod(Event.prototype, 'stopImmediatePropagation', (delegate) => function (self, args) {\n self[IMMEDIATE_PROPAGATION_SYMBOL] = true;\n // we need to call the native stopImmediatePropagation\n // in case in some hybrid application, some part of\n // application will be controlled by zone, some are not\n delegate && delegate.apply(self, args);\n });\n }\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction patchCallbacks(api, target, targetName, method, callbacks) {\n const symbol = Zone.__symbol__(method);\n if (target[symbol]) {\n return;\n }\n const nativeDelegate = target[symbol] = target[method];\n target[method] = function (name, opts, options) {\n if (opts && opts.prototype) {\n callbacks.forEach(function (callback) {\n const source = `${targetName}.${method}::` + callback;\n const prototype = opts.prototype;\n if (prototype.hasOwnProperty(callback)) {\n const descriptor = api.ObjectGetOwnPropertyDescriptor(prototype, callback);\n if (descriptor && descriptor.value) {\n descriptor.value = api.wrapWithCurrentZone(descriptor.value, source);\n api._redefineProperty(opts.prototype, callback, descriptor);\n }\n else if (prototype[callback]) {\n prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n }\n }\n else if (prototype[callback]) {\n prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n }\n });\n }\n return nativeDelegate.call(target, name, opts, options);\n };\n api.attachOriginToPatched(target[method], nativeDelegate);\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nconst globalEventHandlersEventNames = [\n 'abort',\n 'animationcancel',\n 'animationend',\n 'animationiteration',\n 'auxclick',\n 'beforeinput',\n 'blur',\n 'cancel',\n 'canplay',\n 'canplaythrough',\n 'change',\n 'compositionstart',\n 'compositionupdate',\n 'compositionend',\n 'cuechange',\n 'click',\n 'close',\n 'contextmenu',\n 'curechange',\n 'dblclick',\n 'drag',\n 'dragend',\n 'dragenter',\n 'dragexit',\n 'dragleave',\n 'dragover',\n 'drop',\n 'durationchange',\n 'emptied',\n 'ended',\n 'error',\n 'focus',\n 'focusin',\n 'focusout',\n 'gotpointercapture',\n 'input',\n 'invalid',\n 'keydown',\n 'keypress',\n 'keyup',\n 'load',\n 'loadstart',\n 'loadeddata',\n 'loadedmetadata',\n 'lostpointercapture',\n 'mousedown',\n 'mouseenter',\n 'mouseleave',\n 'mousemove',\n 'mouseout',\n 'mouseover',\n 'mouseup',\n 'mousewheel',\n 'orientationchange',\n 'pause',\n 'play',\n 'playing',\n 'pointercancel',\n 'pointerdown',\n 'pointerenter',\n 'pointerleave',\n 'pointerlockchange',\n 'mozpointerlockchange',\n 'webkitpointerlockerchange',\n 'pointerlockerror',\n 'mozpointerlockerror',\n 'webkitpointerlockerror',\n 'pointermove',\n 'pointout',\n 'pointerover',\n 'pointerup',\n 'progress',\n 'ratechange',\n 'reset',\n 'resize',\n 'scroll',\n 'seeked',\n 'seeking',\n 'select',\n 'selectionchange',\n 'selectstart',\n 'show',\n 'sort',\n 'stalled',\n 'submit',\n 'suspend',\n 'timeupdate',\n 'volumechange',\n 'touchcancel',\n 'touchmove',\n 'touchstart',\n 'touchend',\n 'transitioncancel',\n 'transitionend',\n 'waiting',\n 'wheel'\n];\nconst documentEventNames = [\n 'afterscriptexecute', 'beforescriptexecute', 'DOMContentLoaded', 'freeze', 'fullscreenchange',\n 'mozfullscreenchange', 'webkitfullscreenchange', 'msfullscreenchange', 'fullscreenerror',\n 'mozfullscreenerror', 'webkitfullscreenerror', 'msfullscreenerror', 'readystatechange',\n 'visibilitychange', 'resume'\n];\nconst windowEventNames = [\n 'absolutedeviceorientation',\n 'afterinput',\n 'afterprint',\n 'appinstalled',\n 'beforeinstallprompt',\n 'beforeprint',\n 'beforeunload',\n 'devicelight',\n 'devicemotion',\n 'deviceorientation',\n 'deviceorientationabsolute',\n 'deviceproximity',\n 'hashchange',\n 'languagechange',\n 'message',\n 'mozbeforepaint',\n 'offline',\n 'online',\n 'paint',\n 'pageshow',\n 'pagehide',\n 'popstate',\n 'rejectionhandled',\n 'storage',\n 'unhandledrejection',\n 'unload',\n 'userproximity',\n 'vrdisplayconnected',\n 'vrdisplaydisconnected',\n 'vrdisplaypresentchange'\n];\nconst htmlElementEventNames = [\n 'beforecopy', 'beforecut', 'beforepaste', 'copy', 'cut', 'paste', 'dragstart', 'loadend',\n 'animationstart', 'search', 'transitionrun', 'transitionstart', 'webkitanimationend',\n 'webkitanimationiteration', 'webkitanimationstart', 'webkittransitionend'\n];\nconst mediaElementEventNames = ['encrypted', 'waitingforkey', 'msneedkey', 'mozinterruptbegin', 'mozinterruptend'];\nconst ieElementEventNames = [\n 'activate',\n 'afterupdate',\n 'ariarequest',\n 'beforeactivate',\n 'beforedeactivate',\n 'beforeeditfocus',\n 'beforeupdate',\n 'cellchange',\n 'controlselect',\n 'dataavailable',\n 'datasetchanged',\n 'datasetcomplete',\n 'errorupdate',\n 'filterchange',\n 'layoutcomplete',\n 'losecapture',\n 'move',\n 'moveend',\n 'movestart',\n 'propertychange',\n 'resizeend',\n 'resizestart',\n 'rowenter',\n 'rowexit',\n 'rowsdelete',\n 'rowsinserted',\n 'command',\n 'compassneedscalibration',\n 'deactivate',\n 'help',\n 'mscontentzoom',\n 'msmanipulationstatechanged',\n 'msgesturechange',\n 'msgesturedoubletap',\n 'msgestureend',\n 'msgesturehold',\n 'msgesturestart',\n 'msgesturetap',\n 'msgotpointercapture',\n 'msinertiastart',\n 'mslostpointercapture',\n 'mspointercancel',\n 'mspointerdown',\n 'mspointerenter',\n 'mspointerhover',\n 'mspointerleave',\n 'mspointermove',\n 'mspointerout',\n 'mspointerover',\n 'mspointerup',\n 'pointerout',\n 'mssitemodejumplistitemremoved',\n 'msthumbnailclick',\n 'stop',\n 'storagecommit'\n];\nconst webglEventNames = ['webglcontextrestored', 'webglcontextlost', 'webglcontextcreationerror'];\nconst formEventNames = ['autocomplete', 'autocompleteerror'];\nconst detailEventNames = ['toggle'];\nconst frameEventNames = ['load'];\nconst frameSetEventNames = ['blur', 'error', 'focus', 'load', 'resize', 'scroll', 'messageerror'];\nconst marqueeEventNames = ['bounce', 'finish', 'start'];\nconst XMLHttpRequestEventNames = [\n 'loadstart', 'progress', 'abort', 'error', 'load', 'progress', 'timeout', 'loadend',\n 'readystatechange'\n];\nconst IDBIndexEventNames = ['upgradeneeded', 'complete', 'abort', 'success', 'error', 'blocked', 'versionchange', 'close'];\nconst websocketEventNames = ['close', 'error', 'open', 'message'];\nconst workerEventNames = ['error', 'message'];\nconst eventNames = globalEventHandlersEventNames.concat(webglEventNames, formEventNames, detailEventNames, documentEventNames, windowEventNames, htmlElementEventNames, ieElementEventNames);\nfunction filterProperties(target, onProperties, ignoreProperties) {\n if (!ignoreProperties || ignoreProperties.length === 0) {\n return onProperties;\n }\n const tip = ignoreProperties.filter(ip => ip.target === target);\n if (!tip || tip.length === 0) {\n return onProperties;\n }\n const targetIgnoreProperties = tip[0].ignoreProperties;\n return onProperties.filter(op => targetIgnoreProperties.indexOf(op) === -1);\n}\nfunction patchFilteredProperties(target, onProperties, ignoreProperties, prototype) {\n // check whether target is available, sometimes target will be undefined\n // because different browser or some 3rd party plugin.\n if (!target) {\n return;\n }\n const filteredProperties = filterProperties(target, onProperties, ignoreProperties);\n patchOnProperties(target, filteredProperties, prototype);\n}\nfunction propertyDescriptorPatch(api, _global) {\n if (isNode && !isMix) {\n return;\n }\n if (Zone[api.symbol('patchEvents')]) {\n // events are already been patched by legacy patch.\n return;\n }\n const supportsWebSocket = typeof WebSocket !== 'undefined';\n const ignoreProperties = _global['__Zone_ignore_on_properties'];\n // for browsers that we can patch the descriptor: Chrome & Firefox\n if (isBrowser) {\n const internalWindow = window;\n const ignoreErrorProperties = isIE() ? [{ target: internalWindow, ignoreProperties: ['error'] }] : [];\n // in IE/Edge, onProp not exist in window object, but in WindowPrototype\n // so we need to pass WindowPrototype to check onProp exist or not\n patchFilteredProperties(internalWindow, eventNames.concat(['messageerror']), ignoreProperties ? ignoreProperties.concat(ignoreErrorProperties) : ignoreProperties, ObjectGetPrototypeOf(internalWindow));\n patchFilteredProperties(Document.prototype, eventNames, ignoreProperties);\n if (typeof internalWindow['SVGElement'] !== 'undefined') {\n patchFilteredProperties(internalWindow['SVGElement'].prototype, eventNames, ignoreProperties);\n }\n patchFilteredProperties(Element.prototype, eventNames, ignoreProperties);\n patchFilteredProperties(HTMLElement.prototype, eventNames, ignoreProperties);\n patchFilteredProperties(HTMLMediaElement.prototype, mediaElementEventNames, ignoreProperties);\n patchFilteredProperties(HTMLFrameSetElement.prototype, windowEventNames.concat(frameSetEventNames), ignoreProperties);\n patchFilteredProperties(HTMLBodyElement.prototype, windowEventNames.concat(frameSetEventNames), ignoreProperties);\n patchFilteredProperties(HTMLFrameElement.prototype, frameEventNames, ignoreProperties);\n patchFilteredProperties(HTMLIFrameElement.prototype, frameEventNames, ignoreProperties);\n const HTMLMarqueeElement = internalWindow['HTMLMarqueeElement'];\n if (HTMLMarqueeElement) {\n patchFilteredProperties(HTMLMarqueeElement.prototype, marqueeEventNames, ignoreProperties);\n }\n const Worker = internalWindow['Worker'];\n if (Worker) {\n patchFilteredProperties(Worker.prototype, workerEventNames, ignoreProperties);\n }\n }\n const XMLHttpRequest = _global['XMLHttpRequest'];\n if (XMLHttpRequest) {\n // XMLHttpRequest is not available in ServiceWorker, so we need to check here\n patchFilteredProperties(XMLHttpRequest.prototype, XMLHttpRequestEventNames, ignoreProperties);\n }\n const XMLHttpRequestEventTarget = _global['XMLHttpRequestEventTarget'];\n if (XMLHttpRequestEventTarget) {\n patchFilteredProperties(XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype, XMLHttpRequestEventNames, ignoreProperties);\n }\n if (typeof IDBIndex !== 'undefined') {\n patchFilteredProperties(IDBIndex.prototype, IDBIndexEventNames, ignoreProperties);\n patchFilteredProperties(IDBRequest.prototype, IDBIndexEventNames, ignoreProperties);\n patchFilteredProperties(IDBOpenDBRequest.prototype, IDBIndexEventNames, ignoreProperties);\n patchFilteredProperties(IDBDatabase.prototype, IDBIndexEventNames, ignoreProperties);\n patchFilteredProperties(IDBTransaction.prototype, IDBIndexEventNames, ignoreProperties);\n patchFilteredProperties(IDBCursor.prototype, IDBIndexEventNames, ignoreProperties);\n }\n if (supportsWebSocket) {\n patchFilteredProperties(WebSocket.prototype, websocketEventNames, ignoreProperties);\n }\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nZone.__load_patch('util', (global, Zone, api) => {\n api.patchOnProperties = patchOnProperties;\n api.patchMethod = patchMethod;\n api.bindArguments = bindArguments;\n api.patchMacroTask = patchMacroTask;\n // In earlier version of zone.js (<0.9.0), we use env name `__zone_symbol__BLACK_LISTED_EVENTS` to\n // define which events will not be patched by `Zone.js`.\n // In newer version (>=0.9.0), we change the env name to `__zone_symbol__UNPATCHED_EVENTS` to keep\n // the name consistent with angular repo.\n // The `__zone_symbol__BLACK_LISTED_EVENTS` is deprecated, but it is still be supported for\n // backwards compatibility.\n const SYMBOL_BLACK_LISTED_EVENTS = Zone.__symbol__('BLACK_LISTED_EVENTS');\n const SYMBOL_UNPATCHED_EVENTS = Zone.__symbol__('UNPATCHED_EVENTS');\n if (global[SYMBOL_UNPATCHED_EVENTS]) {\n global[SYMBOL_BLACK_LISTED_EVENTS] = global[SYMBOL_UNPATCHED_EVENTS];\n }\n if (global[SYMBOL_BLACK_LISTED_EVENTS]) {\n Zone[SYMBOL_BLACK_LISTED_EVENTS] = Zone[SYMBOL_UNPATCHED_EVENTS] =\n global[SYMBOL_BLACK_LISTED_EVENTS];\n }\n api.patchEventPrototype = patchEventPrototype;\n api.patchEventTarget = patchEventTarget;\n api.isIEOrEdge = isIEOrEdge;\n api.ObjectDefineProperty = ObjectDefineProperty;\n api.ObjectGetOwnPropertyDescriptor = ObjectGetOwnPropertyDescriptor;\n api.ObjectCreate = ObjectCreate;\n api.ArraySlice = ArraySlice;\n api.patchClass = patchClass;\n api.wrapWithCurrentZone = wrapWithCurrentZone;\n api.filterProperties = filterProperties;\n api.attachOriginToPatched = attachOriginToPatched;\n api._redefineProperty = Object.defineProperty;\n api.patchCallbacks = patchCallbacks;\n api.getGlobalObjects = () => ({\n globalSources,\n zoneSymbolEventNames: zoneSymbolEventNames$1,\n eventNames,\n isBrowser,\n isMix,\n isNode,\n TRUE_STR,\n FALSE_STR,\n ZONE_SYMBOL_PREFIX,\n ADD_EVENT_LISTENER_STR,\n REMOVE_EVENT_LISTENER_STR\n });\n});\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nconst taskSymbol = zoneSymbol('zoneTask');\nfunction patchTimer(window, setName, cancelName, nameSuffix) {\n let setNative = null;\n let clearNative = null;\n setName += nameSuffix;\n cancelName += nameSuffix;\n const tasksByHandleId = {};\n function scheduleTask(task) {\n const data = task.data;\n data.args[0] = function () {\n return task.invoke.apply(this, arguments);\n };\n data.handleId = setNative.apply(window, data.args);\n return task;\n }\n function clearTask(task) {\n return clearNative.call(window, task.data.handleId);\n }\n setNative =\n patchMethod(window, setName, (delegate) => function (self, args) {\n if (typeof args[0] === 'function') {\n const options = {\n isPeriodic: nameSuffix === 'Interval',\n delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 :\n undefined,\n args: args\n };\n const callback = args[0];\n args[0] = function timer() {\n try {\n return callback.apply(this, arguments);\n }\n finally {\n // issue-934, task will be cancelled\n // even it is a periodic task such as\n // setInterval\n // https://github.com/angular/angular/issues/40387\n // Cleanup tasksByHandleId should be handled before scheduleTask\n // Since some zoneSpec may intercept and doesn't trigger\n // scheduleFn(scheduleTask) provided here.\n if (!(options.isPeriodic)) {\n if (typeof options.handleId === 'number') {\n // in non-nodejs env, we remove timerId\n // from local cache\n delete tasksByHandleId[options.handleId];\n }\n else if (options.handleId) {\n // Node returns complex objects as handleIds\n // we remove task reference from timer object\n options.handleId[taskSymbol] = null;\n }\n }\n }\n };\n const task = scheduleMacroTaskWithCurrentZone(setName, args[0], options, scheduleTask, clearTask);\n if (!task) {\n return task;\n }\n // Node.js must additionally support the ref and unref functions.\n const handle = task.data.handleId;\n if (typeof handle === 'number') {\n // for non nodejs env, we save handleId: task\n // mapping in local cache for clearTimeout\n tasksByHandleId[handle] = task;\n }\n else if (handle) {\n // for nodejs env, we save task\n // reference in timerId Object for clearTimeout\n handle[taskSymbol] = task;\n }\n // check whether handle is null, because some polyfill or browser\n // may return undefined from setTimeout/setInterval/setImmediate/requestAnimationFrame\n if (handle && handle.ref && handle.unref && typeof handle.ref === 'function' &&\n typeof handle.unref === 'function') {\n task.ref = handle.ref.bind(handle);\n task.unref = handle.unref.bind(handle);\n }\n if (typeof handle === 'number' || handle) {\n return handle;\n }\n return task;\n }\n else {\n // cause an error by calling it directly.\n return delegate.apply(window, args);\n }\n });\n clearNative =\n patchMethod(window, cancelName, (delegate) => function (self, args) {\n const id = args[0];\n let task;\n if (typeof id === 'number') {\n // non nodejs env.\n task = tasksByHandleId[id];\n }\n else {\n // nodejs env.\n task = id && id[taskSymbol];\n // other environments.\n if (!task) {\n task = id;\n }\n }\n if (task && typeof task.type === 'string') {\n if (task.state !== 'notScheduled' &&\n (task.cancelFn && task.data.isPeriodic || task.runCount === 0)) {\n if (typeof id === 'number') {\n delete tasksByHandleId[id];\n }\n else if (id) {\n id[taskSymbol] = null;\n }\n // Do not cancel already canceled functions\n task.zone.cancelTask(task);\n }\n }\n else {\n // cause an error by calling it directly.\n delegate.apply(window, args);\n }\n });\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction patchCustomElements(_global, api) {\n const { isBrowser, isMix } = api.getGlobalObjects();\n if ((!isBrowser && !isMix) || !_global['customElements'] || !('customElements' in _global)) {\n return;\n }\n const callbacks = ['connectedCallback', 'disconnectedCallback', 'adoptedCallback', 'attributeChangedCallback'];\n api.patchCallbacks(api, _global.customElements, 'customElements', 'define', callbacks);\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction eventTargetPatch(_global, api) {\n if (Zone[api.symbol('patchEventTarget')]) {\n // EventTarget is already patched.\n return;\n }\n const { eventNames, zoneSymbolEventNames, TRUE_STR, FALSE_STR, ZONE_SYMBOL_PREFIX } = api.getGlobalObjects();\n // predefine all __zone_symbol__ + eventName + true/false string\n for (let i = 0; i < eventNames.length; i++) {\n const eventName = eventNames[i];\n const falseEventName = eventName + FALSE_STR;\n const trueEventName = eventName + TRUE_STR;\n const symbol = ZONE_SYMBOL_PREFIX + falseEventName;\n const symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;\n zoneSymbolEventNames[eventName] = {};\n zoneSymbolEventNames[eventName][FALSE_STR] = symbol;\n zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture;\n }\n const EVENT_TARGET = _global['EventTarget'];\n if (!EVENT_TARGET || !EVENT_TARGET.prototype) {\n return;\n }\n api.patchEventTarget(_global, [EVENT_TARGET && EVENT_TARGET.prototype]);\n return true;\n}\nfunction patchEvent(global, api) {\n api.patchEventPrototype(global, api);\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nZone.__load_patch('legacy', (global) => {\n const legacyPatch = global[Zone.__symbol__('legacyPatch')];\n if (legacyPatch) {\n legacyPatch();\n }\n});\nZone.__load_patch('queueMicrotask', (global, Zone, api) => {\n api.patchMethod(global, 'queueMicrotask', delegate => {\n return function (self, args) {\n Zone.current.scheduleMicroTask('queueMicrotask', args[0]);\n };\n });\n});\nZone.__load_patch('timers', (global) => {\n const set = 'set';\n const clear = 'clear';\n patchTimer(global, set, clear, 'Timeout');\n patchTimer(global, set, clear, 'Interval');\n patchTimer(global, set, clear, 'Immediate');\n});\nZone.__load_patch('requestAnimationFrame', (global) => {\n patchTimer(global, 'request', 'cancel', 'AnimationFrame');\n patchTimer(global, 'mozRequest', 'mozCancel', 'AnimationFrame');\n patchTimer(global, 'webkitRequest', 'webkitCancel', 'AnimationFrame');\n});\nZone.__load_patch('blocking', (global, Zone) => {\n const blockingMethods = ['alert', 'prompt', 'confirm'];\n for (let i = 0; i < blockingMethods.length; i++) {\n const name = blockingMethods[i];\n patchMethod(global, name, (delegate, symbol, name) => {\n return function (s, args) {\n return Zone.current.run(delegate, global, args, name);\n };\n });\n }\n});\nZone.__load_patch('EventTarget', (global, Zone, api) => {\n patchEvent(global, api);\n eventTargetPatch(global, api);\n // patch XMLHttpRequestEventTarget's addEventListener/removeEventListener\n const XMLHttpRequestEventTarget = global['XMLHttpRequestEventTarget'];\n if (XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype) {\n api.patchEventTarget(global, [XMLHttpRequestEventTarget.prototype]);\n }\n});\nZone.__load_patch('MutationObserver', (global, Zone, api) => {\n patchClass('MutationObserver');\n patchClass('WebKitMutationObserver');\n});\nZone.__load_patch('IntersectionObserver', (global, Zone, api) => {\n patchClass('IntersectionObserver');\n});\nZone.__load_patch('FileReader', (global, Zone, api) => {\n patchClass('FileReader');\n});\nZone.__load_patch('on_property', (global, Zone, api) => {\n propertyDescriptorPatch(api, global);\n});\nZone.__load_patch('customElements', (global, Zone, api) => {\n patchCustomElements(global, api);\n});\nZone.__load_patch('XHR', (global, Zone) => {\n // Treat XMLHttpRequest as a macrotask.\n patchXHR(global);\n const XHR_TASK = zoneSymbol('xhrTask');\n const XHR_SYNC = zoneSymbol('xhrSync');\n const XHR_LISTENER = zoneSymbol('xhrListener');\n const XHR_SCHEDULED = zoneSymbol('xhrScheduled');\n const XHR_URL = zoneSymbol('xhrURL');\n const XHR_ERROR_BEFORE_SCHEDULED = zoneSymbol('xhrErrorBeforeScheduled');\n function patchXHR(window) {\n const XMLHttpRequest = window['XMLHttpRequest'];\n if (!XMLHttpRequest) {\n // XMLHttpRequest is not available in service worker\n return;\n }\n const XMLHttpRequestPrototype = XMLHttpRequest.prototype;\n function findPendingTask(target) {\n return target[XHR_TASK];\n }\n let oriAddListener = XMLHttpRequestPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n let oriRemoveListener = XMLHttpRequestPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n if (!oriAddListener) {\n const XMLHttpRequestEventTarget = window['XMLHttpRequestEventTarget'];\n if (XMLHttpRequestEventTarget) {\n const XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget.prototype;\n oriAddListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n oriRemoveListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n }\n }\n const READY_STATE_CHANGE = 'readystatechange';\n const SCHEDULED = 'scheduled';\n function scheduleTask(task) {\n const data = task.data;\n const target = data.target;\n target[XHR_SCHEDULED] = false;\n target[XHR_ERROR_BEFORE_SCHEDULED] = false;\n // remove existing event listener\n const listener = target[XHR_LISTENER];\n if (!oriAddListener) {\n oriAddListener = target[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n oriRemoveListener = target[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n }\n if (listener) {\n oriRemoveListener.call(target, READY_STATE_CHANGE, listener);\n }\n const newListener = target[XHR_LISTENER] = () => {\n if (target.readyState === target.DONE) {\n // sometimes on some browsers XMLHttpRequest will fire onreadystatechange with\n // readyState=4 multiple times, so we need to check task state here\n if (!data.aborted && target[XHR_SCHEDULED] && task.state === SCHEDULED) {\n // check whether the xhr has registered onload listener\n // if that is the case, the task should invoke after all\n // onload listeners finish.\n // Also if the request failed without response (status = 0), the load event handler\n // will not be triggered, in that case, we should also invoke the placeholder callback\n // to close the XMLHttpRequest::send macroTask.\n // https://github.com/angular/angular/issues/38795\n const loadTasks = target[Zone.__symbol__('loadfalse')];\n if (target.status !== 0 && loadTasks && loadTasks.length > 0) {\n const oriInvoke = task.invoke;\n task.invoke = function () {\n // need to load the tasks again, because in other\n // load listener, they may remove themselves\n const loadTasks = target[Zone.__symbol__('loadfalse')];\n for (let i = 0; i < loadTasks.length; i++) {\n if (loadTasks[i] === task) {\n loadTasks.splice(i, 1);\n }\n }\n if (!data.aborted && task.state === SCHEDULED) {\n oriInvoke.call(task);\n }\n };\n loadTasks.push(task);\n }\n else {\n task.invoke();\n }\n }\n else if (!data.aborted && target[XHR_SCHEDULED] === false) {\n // error occurs when xhr.send()\n target[XHR_ERROR_BEFORE_SCHEDULED] = true;\n }\n }\n };\n oriAddListener.call(target, READY_STATE_CHANGE, newListener);\n const storedTask = target[XHR_TASK];\n if (!storedTask) {\n target[XHR_TASK] = task;\n }\n sendNative.apply(target, data.args);\n target[XHR_SCHEDULED] = true;\n return task;\n }\n function placeholderCallback() { }\n function clearTask(task) {\n const data = task.data;\n // Note - ideally, we would call data.target.removeEventListener here, but it's too late\n // to prevent it from firing. So instead, we store info for the event listener.\n data.aborted = true;\n return abortNative.apply(data.target, data.args);\n }\n const openNative = patchMethod(XMLHttpRequestPrototype, 'open', () => function (self, args) {\n self[XHR_SYNC] = args[2] == false;\n self[XHR_URL] = args[1];\n return openNative.apply(self, args);\n });\n const XMLHTTPREQUEST_SOURCE = 'XMLHttpRequest.send';\n const fetchTaskAborting = zoneSymbol('fetchTaskAborting');\n const fetchTaskScheduling = zoneSymbol('fetchTaskScheduling');\n const sendNative = patchMethod(XMLHttpRequestPrototype, 'send', () => function (self, args) {\n if (Zone.current[fetchTaskScheduling] === true) {\n // a fetch is scheduling, so we are using xhr to polyfill fetch\n // and because we already schedule macroTask for fetch, we should\n // not schedule a macroTask for xhr again\n return sendNative.apply(self, args);\n }\n if (self[XHR_SYNC]) {\n // if the XHR is sync there is no task to schedule, just execute the code.\n return sendNative.apply(self, args);\n }\n else {\n const options = { target: self, url: self[XHR_URL], isPeriodic: false, args: args, aborted: false };\n const task = scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);\n if (self && self[XHR_ERROR_BEFORE_SCHEDULED] === true && !options.aborted &&\n task.state === SCHEDULED) {\n // xhr request throw error when send\n // we should invoke task instead of leaving a scheduled\n // pending macroTask\n task.invoke();\n }\n }\n });\n const abortNative = patchMethod(XMLHttpRequestPrototype, 'abort', () => function (self, args) {\n const task = findPendingTask(self);\n if (task && typeof task.type == 'string') {\n // If the XHR has already completed, do nothing.\n // If the XHR has already been aborted, do nothing.\n // Fix #569, call abort multiple times before done will cause\n // macroTask task count be negative number\n if (task.cancelFn == null || (task.data && task.data.aborted)) {\n return;\n }\n task.zone.cancelTask(task);\n }\n else if (Zone.current[fetchTaskAborting] === true) {\n // the abort is called from fetch polyfill, we need to call native abort of XHR.\n return abortNative.apply(self, args);\n }\n // Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no\n // task\n // to cancel. Do nothing.\n });\n }\n});\nZone.__load_patch('geolocation', (global) => {\n /// GEO_LOCATION\n if (global['navigator'] && global['navigator'].geolocation) {\n patchPrototype(global['navigator'].geolocation, ['getCurrentPosition', 'watchPosition']);\n }\n});\nZone.__load_patch('PromiseRejectionEvent', (global, Zone) => {\n // handle unhandled promise rejection\n function findPromiseRejectionHandler(evtName) {\n return function (e) {\n const eventTasks = findEventTasks(global, evtName);\n eventTasks.forEach(eventTask => {\n // windows has added unhandledrejection event listener\n // trigger the event listener\n const PromiseRejectionEvent = global['PromiseRejectionEvent'];\n if (PromiseRejectionEvent) {\n const evt = new PromiseRejectionEvent(evtName, { promise: e.promise, reason: e.rejection });\n eventTask.invoke(evt);\n }\n });\n };\n }\n if (global['PromiseRejectionEvent']) {\n Zone[zoneSymbol('unhandledPromiseRejectionHandler')] =\n findPromiseRejectionHandler('unhandledrejection');\n Zone[zoneSymbol('rejectionHandledHandler')] =\n findPromiseRejectionHandler('rejectionhandled');\n }\n});\n"],"names":["Zone$1","global","performance","mark","name","performanceMeasure","label","symbolPrefix","__symbol__","checkDuplicate","Error","Zone","constructor","parent","zoneSpec","_parent","_name","_properties","properties","_zoneDelegate","ZoneDelegate","assertZonePatched","patches","root","zone","current","_currentZoneFrame","currentTask","_currentTask","__load_patch","fn","ignoreDuplicate","hasOwnProperty","perfName","_api","get","key","getZoneWith","fork","wrap","callback","source","_callback","intercept","runGuarded","arguments","run","applyThis","applyArgs","invoke","error","handleError","runTask","task","NO_ZONE","state","notScheduled","type","eventTask","macroTask","reEntryGuard","running","_transitionTo","scheduled","runCount","previousTask","data","isPeriodic","cancelFn","undefined","invokeTask","unknown","_updateTaskCount","scheduleTask","newZone","scheduling","zoneDelegates","_zoneDelegates","_zone","err","scheduleMicroTask","customSchedule","ZoneTask","microTask","scheduleMacroTask","customCancel","scheduleEventTask","cancelTask","canceling","count","i","length","DELEGATE_ZS","onHasTask","delegate","_","target","hasTaskState","hasTask","onScheduleTask","onInvokeTask","onCancelTask","parentDelegate","_taskCounts","_parentDelegate","_forkZS","onFork","_forkDlgt","_forkCurrZone","_interceptZS","onIntercept","_interceptDlgt","_interceptCurrZone","_invokeZS","onInvoke","_invokeDlgt","_invokeCurrZone","_handleErrorZS","onHandleError","_handleErrorDlgt","_handleErrorCurrZone","_scheduleTaskZS","_scheduleTaskDlgt","_scheduleTaskCurrZone","_invokeTaskZS","_invokeTaskDlgt","_invokeTaskCurrZone","_cancelTaskZS","_cancelTaskDlgt","_cancelTaskCurrZone","_hasTaskZS","_hasTaskDlgt","_hasTaskDlgtOwner","_hasTaskCurrZone","zoneSpecHasTask","parentHasTask","targetZone","apply","returnTask","push","scheduleFn","value","isEmpty","counts","prev","next","change","options","_state","self","useG","call","args","_numberOfNestedTaskFrames","drainMicroTaskQueue","cancelScheduleRequest","toState","fromState1","fromState2","toString","handleId","Object","prototype","toJSON","symbolSetTimeout","symbolPromise","symbolThen","_microTaskQueue","_isDrainingMicrotaskQueue","nativeMicroTaskQueuePromise","resolve","nativeThen","queue","onUnhandledError","microtaskDrainDone","symbol","currentZoneFrame","noop","showUncaughtError","patchEventTarget","patchOnProperties","patchMethod","bindArguments","patchThen","patchMacroTask","patchEventPrototype","isIEOrEdge","getGlobalObjects","ObjectDefineProperty","ObjectGetOwnPropertyDescriptor","ObjectCreate","ArraySlice","patchClass","wrapWithCurrentZone","filterProperties","attachOriginToPatched","_redefineProperty","patchCallbacks","window","getOwnPropertyDescriptor","defineProperty","ObjectGetPrototypeOf","getPrototypeOf","create","Array","slice","ADD_EVENT_LISTENER_STR","REMOVE_EVENT_LISTENER_STR","ZONE_SYMBOL_ADD_EVENT_LISTENER","ZONE_SYMBOL_REMOVE_EVENT_LISTENER","TRUE_STR","FALSE_STR","ZONE_SYMBOL_PREFIX","scheduleMacroTaskWithCurrentZone","zoneSymbol","isWindowExists","internalWindow","_global","REMOVE_ATTRIBUTE","NULL_ON_PROP_VALUE","patchPrototype","fnNames","prototypeDesc","isPropertyWritable","patched","propertyDesc","writable","set","isWebWorker","WorkerGlobalScope","isNode","process","isBrowser","isMix","zoneSymbolEventNames","wrapFn","event","eventNameSymbol","listener","result","errorEvent","message","filename","lineno","colno","preventDefault","patchProperty","obj","prop","desc","enumerable","configurable","onPropPatchedSymbol","originalDescGet","originalDescSet","eventName","substr","newValue","previousValue","removeEventListener","addEventListener","removeAttribute","onProperties","j","originalInstanceKey","className","OriginalClass","a","instance","patchFn","proto","delegateName","patchDelegate","funcName","metaCreator","setNative","cbIdx","meta","original","isDetectedIEOrEdge","ieOrEdge","isIE","ua","navigator","userAgent","indexOf","api","readableObjectToString","JSON","stringify","_uncaughtPromiseErrors","isDisableWrappingUncaughtPromiseRejection","creationTrace","e","rejection","console","stack","uncaughtPromiseError","shift","throwOriginal","handleUnhandledRejection","UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL","handler","isThenable","then","forwardResolution","forwardRejection","ZoneAwarePromise","reject","symbolState","symbolValue","symbolFinally","symbolParentPromiseValue","symbolParentPromiseState","UNRESOLVED","RESOLVED","REJECTED","REJECTED_NO_CATCH","makeResolver","promise","v","resolvePromise","once","wasCalled","wrapper","wrappedFunction","TYPE_ERROR","CURRENT_TASK_TRACE_SYMBOL","onceWrapper","TypeError","clearRejectedNoCatch","trace","scheduleResolveOrReject","REJECTION_HANDLED_HANDLER","splice","chainPromise","onFulfilled","onRejected","promiseState","parentPromiseValue","isFinallyPromise","ZONE_AWARE_PROMISE_TO_STRING","race","values","res","rej","onResolve","onReject","all","allWithCallback","allSettled","P","thenCallback","status","errorCallback","reason","unresolvedCount","valueIndex","resolvedValues","curValueIndex","thenErr","executor","Symbol","toStringTag","species","C","catch","finally","onFinally","NativePromise","symbolThenPatched","Ctor","originalThen","wrapped","zoneify","resultPromise","ctor","Promise","originalFunctionToString","Function","ORIGINAL_DELEGATE_SYMBOL","PROMISE_SYMBOL","ERROR_SYMBOL","newFunctionToString","originalDelegate","nativePromise","nativeError","originalObjectToString","PROMISE_OBJECT_TO_STRING","passiveSupported","OPTIMIZED_ZONE_EVENT_TASK_DATA","zoneSymbolEventNames$1","globalSources","EVENT_NAME_SYMBOL_REGX","RegExp","IMMEDIATE_PROPAGATION_SYMBOL","prepareEventNames","eventNameToString","falseEventName","trueEventName","symbolCapture","apis","patchOptions","ADD_EVENT_LISTENER","add","REMOVE_EVENT_LISTENER","rm","LISTENERS_EVENT_LISTENER","listeners","REMOVE_ALL_LISTENERS_EVENT_LISTENER","rmAll","zoneSymbolAddEventListener","ADD_EVENT_LISTENER_SOURCE","PREPEND_EVENT_LISTENER","PREPEND_EVENT_LISTENER_SOURCE","isRemoved","handleEvent","globalZoneAwareCallback","tasks","copyTasks","globalZoneAwareCaptureCallback","patchEventTargetMethods","useGlobalCallback","validateHandler","vh","chkDup","returnTarget","rt","taskData","nativeAddEventListener","nativeRemoveEventListener","nativeListeners","nativeRemoveAllListeners","nativePrependEventListener","prepend","buildEventListenerOptions","passive","capture","assign","customScheduleGlobal","isExisting","customCancelGlobal","symbolEventNames","symbolEventName","existingTasks","existingTask","allRemoved","customScheduleNonGlobal","customSchedulePrepend","customCancelNonGlobal","compareTaskCallbackVsDelegate","typeOfDelegate","compare","diff","unpatchedEvents","passiveEvents","makeAddListener","nativeListener","addSource","customScheduleFn","customCancelFn","transferEventName","isHandleEvent","constructorName","targetSource","unshift","onPropertySymbol","findEventTasks","keys","match","exec","evtName","symbolCaptureEventName","captureTasks","removeTasks","results","foundTasks","captureFalseTasks","captureTrueTasks","concat","Event","targetName","method","callbacks","nativeDelegate","opts","forEach","descriptor","globalEventHandlersEventNames","documentEventNames","windowEventNames","htmlElementEventNames","mediaElementEventNames","ieElementEventNames","webglEventNames","formEventNames","detailEventNames","frameEventNames","frameSetEventNames","marqueeEventNames","XMLHttpRequestEventNames","IDBIndexEventNames","websocketEventNames","workerEventNames","eventNames","ignoreProperties","tip","filter","ip","targetIgnoreProperties","op","patchFilteredProperties","filteredProperties","propertyDescriptorPatch","supportsWebSocket","WebSocket","ignoreErrorProperties","Document","Element","HTMLElement","HTMLMediaElement","HTMLFrameSetElement","HTMLBodyElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","SYMBOL_BLACK_LISTED_EVENTS","SYMBOL_UNPATCHED_EVENTS","taskSymbol","patchTimer","setName","cancelName","nameSuffix","clearNative","tasksByHandleId","clearTask","delay","timer","handle","ref","unref","bind","id","patchCustomElements","customElements","eventTargetPatch","EVENT_TARGET","patchEvent","legacyPatch","clear","blockingMethods","s","patchXHR","XHR_TASK","XHR_SYNC","XHR_LISTENER","XHR_SCHEDULED","XHR_URL","XHR_ERROR_BEFORE_SCHEDULED","XMLHttpRequestPrototype","findPendingTask","oriAddListener","oriRemoveListener","XMLHttpRequestEventTargetPrototype","READY_STATE_CHANGE","SCHEDULED","newListener","readyState","DONE","aborted","loadTasks","oriInvoke","storedTask","sendNative","placeholderCallback","abortNative","openNative","XMLHTTPREQUEST_SOURCE","fetchTaskAborting","fetchTaskScheduling","url","geolocation","findPromiseRejectionHandler","eventTasks","PromiseRejectionEvent","evt"],"sourceRoot":"webpack:///"} \ No newline at end of file +{"version":3,"file":"polyfills.js","mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAgBA;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;AAwBA;;;AAGiB,CAAC;AAElB;;;;;;;;;;;;ACjDa;;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAE,UAAUA,MAAM,EAAE;EAChB,MAAMC,WAAW,GAAGD,MAAM,CAAC,aAAa,CAAC;EACzC,SAASE,IAAI,CAACC,IAAI,EAAE;IAChBF,WAAW,IAAIA,WAAW,CAAC,MAAM,CAAC,IAAIA,WAAW,CAAC,MAAM,CAAC,CAACE,IAAI,CAAC;EACnE;EACA,SAASC,kBAAkB,CAACD,IAAI,EAAEE,KAAK,EAAE;IACrCJ,WAAW,IAAIA,WAAW,CAAC,SAAS,CAAC,IAAIA,WAAW,CAAC,SAAS,CAAC,CAACE,IAAI,EAAEE,KAAK,CAAC;EAChF;EACAH,IAAI,CAAC,MAAM,CAAC;EACZ;EACA;EACA;EACA,MAAMI,YAAY,GAAGN,MAAM,CAAC,sBAAsB,CAAC,IAAI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,yBAAyB,CAAC,CAAC,GACvCqW,2BAA2B,CAAC,kBAAkB,CAAC;EACvD;AACJ,CAAC,CAAC","sources":["./src/polyfills.ts","./node_modules/zone.js/fesm2015/zone.js"],"sourcesContent":["/**\r\n * This file includes polyfills needed by Angular and is loaded before the app.\r\n * You can add your own extra polyfills to this file.\r\n *\r\n * This file is divided into 2 sections:\r\n * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.\r\n * 2. Application imports. Files imported after ZoneJS that should be loaded before your main\r\n * file.\r\n *\r\n * The current setup is for so-called \"evergreen\" browsers; the last versions of browsers that\r\n * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),\r\n * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.\r\n *\r\n * Learn more in https://angular.io/guide/browser-support\r\n */\r\n\r\n/***************************************************************************************************\r\n * BROWSER POLYFILLS\r\n */\r\n\r\n/**\r\n * By default, zone.js will patch all possible macroTask and DomEvents\r\n * user can disable parts of macroTask/DomEvents patch by setting following flags\r\n * because those flags need to be set before `zone.js` being loaded, and webpack\r\n * will put import in the top of bundle, so user need to create a separate file\r\n * in this directory (for example: zone-flags.ts), and put the following flags\r\n * into that file, and then add the following code before importing zone.js.\r\n * import './zone-flags.ts';\r\n *\r\n * The flags allowed in zone-flags.ts are listed here.\r\n *\r\n * The following flags will work for all browsers.\r\n *\r\n * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame\r\n * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick\r\n * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames\r\n *\r\n * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js\r\n * with the following flag, it will bypass `zone.js` patch for IE/Edge\r\n *\r\n * (window as any).__Zone_enable_cross_context_check = true;\r\n *\r\n */\r\n\r\n/***************************************************************************************************\r\n * Zone JS is required by default for Angular itself.\r\n */\r\nimport 'zone.js'; // Included with Angular CLI.\r\n\r\n/***************************************************************************************************\r\n * APPLICATION IMPORTS\r\n */\r\n","'use strict';\n/**\n * @license Angular v15.1.0-next.0\n * (c) 2010-2022 Google LLC. https://angular.io/\n * License: MIT\n */\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n((function (global) {\n const performance = global['performance'];\n function mark(name) {\n performance && performance['mark'] && performance['mark'](name);\n }\n function performanceMeasure(name, label) {\n performance && performance['measure'] && performance['measure'](name, label);\n }\n mark('Zone');\n // Initialize before it's accessed below.\n // __Zone_symbol_prefix global can be used to override the default zone\n // symbol prefix with a custom one if needed.\n const symbolPrefix = global['__Zone_symbol_prefix'] || '__zone_symbol__';\n function __symbol__(name) {\n return symbolPrefix + name;\n }\n const checkDuplicate = global[__symbol__('forceDuplicateZoneCheck')] === true;\n if (global['Zone']) {\n // if global['Zone'] already exists (maybe zone.js was already loaded or\n // some other lib also registered a global object named Zone), we may need\n // to throw an error, but sometimes user may not want this error.\n // For example,\n // we have two web pages, page1 includes zone.js, page2 doesn't.\n // and the 1st time user load page1 and page2, everything work fine,\n // but when user load page2 again, error occurs because global['Zone'] already exists.\n // so we add a flag to let user choose whether to throw this error or not.\n // By default, if existing Zone is from zone.js, we will not throw the error.\n if (checkDuplicate || typeof global['Zone'].__symbol__ !== 'function') {\n throw new Error('Zone already loaded.');\n }\n else {\n return global['Zone'];\n }\n }\n class Zone {\n constructor(parent, zoneSpec) {\n this._parent = parent;\n this._name = zoneSpec ? zoneSpec.name || 'unnamed' : '';\n this._properties = zoneSpec && zoneSpec.properties || {};\n this._zoneDelegate =\n new _ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec);\n }\n static assertZonePatched() {\n if (global['Promise'] !== patches['ZoneAwarePromise']) {\n throw new Error('Zone.js has detected that ZoneAwarePromise `(window|global).Promise` ' +\n 'has been overwritten.\\n' +\n 'Most likely cause is that a Promise polyfill has been loaded ' +\n 'after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. ' +\n 'If you must load one, do so before loading zone.js.)');\n }\n }\n static get root() {\n let zone = Zone.current;\n while (zone.parent) {\n zone = zone.parent;\n }\n return zone;\n }\n static get current() {\n return _currentZoneFrame.zone;\n }\n static get currentTask() {\n return _currentTask;\n }\n // tslint:disable-next-line:require-internal-with-underscore\n static __load_patch(name, fn, ignoreDuplicate = false) {\n if (patches.hasOwnProperty(name)) {\n // `checkDuplicate` option is defined from global variable\n // so it works for all modules.\n // `ignoreDuplicate` can work for the specified module\n if (!ignoreDuplicate && checkDuplicate) {\n throw Error('Already loaded patch: ' + name);\n }\n }\n else if (!global['__Zone_disable_' + name]) {\n const perfName = 'Zone:' + name;\n mark(perfName);\n patches[name] = fn(global, Zone, _api);\n performanceMeasure(perfName, perfName);\n }\n }\n get parent() {\n return this._parent;\n }\n get name() {\n return this._name;\n }\n get(key) {\n const zone = this.getZoneWith(key);\n if (zone)\n return zone._properties[key];\n }\n getZoneWith(key) {\n let current = this;\n while (current) {\n if (current._properties.hasOwnProperty(key)) {\n return current;\n }\n current = current._parent;\n }\n return null;\n }\n fork(zoneSpec) {\n if (!zoneSpec)\n throw new Error('ZoneSpec required!');\n return this._zoneDelegate.fork(this, zoneSpec);\n }\n wrap(callback, source) {\n if (typeof callback !== 'function') {\n throw new Error('Expecting function got: ' + callback);\n }\n const _callback = this._zoneDelegate.intercept(this, callback, source);\n const zone = this;\n return function () {\n return zone.runGuarded(_callback, this, arguments, source);\n };\n }\n run(callback, applyThis, applyArgs, source) {\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n }\n finally {\n _currentZoneFrame = _currentZoneFrame.parent;\n }\n }\n runGuarded(callback, applyThis = null, applyArgs, source) {\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n try {\n return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n }\n catch (error) {\n if (this._zoneDelegate.handleError(this, error)) {\n throw error;\n }\n }\n }\n finally {\n _currentZoneFrame = _currentZoneFrame.parent;\n }\n }\n runTask(task, applyThis, applyArgs) {\n if (task.zone != this) {\n throw new Error('A task can only be run in the zone of creation! (Creation: ' +\n (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')');\n }\n // https://github.com/angular/zone.js/issues/778, sometimes eventTask\n // will run in notScheduled(canceled) state, we should not try to\n // run such kind of task but just return\n if (task.state === notScheduled && (task.type === eventTask || task.type === macroTask)) {\n return;\n }\n const reEntryGuard = task.state != running;\n reEntryGuard && task._transitionTo(running, scheduled);\n task.runCount++;\n const previousTask = _currentTask;\n _currentTask = task;\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n if (task.type == macroTask && task.data && !task.data.isPeriodic) {\n task.cancelFn = undefined;\n }\n try {\n return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs);\n }\n catch (error) {\n if (this._zoneDelegate.handleError(this, error)) {\n throw error;\n }\n }\n }\n finally {\n // if the task's state is notScheduled or unknown, then it has already been cancelled\n // we should not reset the state to scheduled\n if (task.state !== notScheduled && task.state !== unknown) {\n if (task.type == eventTask || (task.data && task.data.isPeriodic)) {\n reEntryGuard && task._transitionTo(scheduled, running);\n }\n else {\n task.runCount = 0;\n this._updateTaskCount(task, -1);\n reEntryGuard &&\n task._transitionTo(notScheduled, running, notScheduled);\n }\n }\n _currentZoneFrame = _currentZoneFrame.parent;\n _currentTask = previousTask;\n }\n }\n scheduleTask(task) {\n if (task.zone && task.zone !== this) {\n // check if the task was rescheduled, the newZone\n // should not be the children of the original zone\n let newZone = this;\n while (newZone) {\n if (newZone === task.zone) {\n throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${task.zone.name}`);\n }\n newZone = newZone.parent;\n }\n }\n task._transitionTo(scheduling, notScheduled);\n const zoneDelegates = [];\n task._zoneDelegates = zoneDelegates;\n task._zone = this;\n try {\n task = this._zoneDelegate.scheduleTask(this, task);\n }\n catch (err) {\n // should set task's state to unknown when scheduleTask throw error\n // because the err may from reschedule, so the fromState maybe notScheduled\n task._transitionTo(unknown, scheduling, notScheduled);\n // TODO: @JiaLiPassion, should we check the result from handleError?\n this._zoneDelegate.handleError(this, err);\n throw err;\n }\n if (task._zoneDelegates === zoneDelegates) {\n // we have to check because internally the delegate can reschedule the task.\n this._updateTaskCount(task, 1);\n }\n if (task.state == scheduling) {\n task._transitionTo(scheduled, scheduling);\n }\n return task;\n }\n scheduleMicroTask(source, callback, data, customSchedule) {\n return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, undefined));\n }\n scheduleMacroTask(source, callback, data, customSchedule, customCancel) {\n return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel));\n }\n scheduleEventTask(source, callback, data, customSchedule, customCancel) {\n return this.scheduleTask(new ZoneTask(eventTask, source, callback, data, customSchedule, customCancel));\n }\n cancelTask(task) {\n if (task.zone != this)\n throw new Error('A task can only be cancelled in the zone of creation! (Creation: ' +\n (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')');\n if (task.state !== scheduled && task.state !== running) {\n return;\n }\n task._transitionTo(canceling, scheduled, running);\n try {\n this._zoneDelegate.cancelTask(this, task);\n }\n catch (err) {\n // if error occurs when cancelTask, transit the state to unknown\n task._transitionTo(unknown, canceling);\n this._zoneDelegate.handleError(this, err);\n throw err;\n }\n this._updateTaskCount(task, -1);\n task._transitionTo(notScheduled, canceling);\n task.runCount = 0;\n return task;\n }\n _updateTaskCount(task, count) {\n const zoneDelegates = task._zoneDelegates;\n if (count == -1) {\n task._zoneDelegates = null;\n }\n for (let i = 0; i < zoneDelegates.length; i++) {\n zoneDelegates[i]._updateTaskCount(task.type, count);\n }\n }\n }\n // tslint:disable-next-line:require-internal-with-underscore\n Zone.__symbol__ = __symbol__;\n const DELEGATE_ZS = {\n name: '',\n onHasTask: (delegate, _, target, hasTaskState) => delegate.hasTask(target, hasTaskState),\n onScheduleTask: (delegate, _, target, task) => delegate.scheduleTask(target, task),\n onInvokeTask: (delegate, _, target, task, applyThis, applyArgs) => delegate.invokeTask(target, task, applyThis, applyArgs),\n onCancelTask: (delegate, _, target, task) => delegate.cancelTask(target, task)\n };\n class _ZoneDelegate {\n constructor(zone, parentDelegate, zoneSpec) {\n this._taskCounts = { 'microTask': 0, 'macroTask': 0, 'eventTask': 0 };\n this.zone = zone;\n this._parentDelegate = parentDelegate;\n this._forkZS = zoneSpec && (zoneSpec && zoneSpec.onFork ? zoneSpec : parentDelegate._forkZS);\n this._forkDlgt = zoneSpec && (zoneSpec.onFork ? parentDelegate : parentDelegate._forkDlgt);\n this._forkCurrZone =\n zoneSpec && (zoneSpec.onFork ? this.zone : parentDelegate._forkCurrZone);\n this._interceptZS =\n zoneSpec && (zoneSpec.onIntercept ? zoneSpec : parentDelegate._interceptZS);\n this._interceptDlgt =\n zoneSpec && (zoneSpec.onIntercept ? parentDelegate : parentDelegate._interceptDlgt);\n this._interceptCurrZone =\n zoneSpec && (zoneSpec.onIntercept ? this.zone : parentDelegate._interceptCurrZone);\n this._invokeZS = zoneSpec && (zoneSpec.onInvoke ? zoneSpec : parentDelegate._invokeZS);\n this._invokeDlgt =\n zoneSpec && (zoneSpec.onInvoke ? parentDelegate : parentDelegate._invokeDlgt);\n this._invokeCurrZone =\n zoneSpec && (zoneSpec.onInvoke ? this.zone : parentDelegate._invokeCurrZone);\n this._handleErrorZS =\n zoneSpec && (zoneSpec.onHandleError ? zoneSpec : parentDelegate._handleErrorZS);\n this._handleErrorDlgt =\n zoneSpec && (zoneSpec.onHandleError ? parentDelegate : parentDelegate._handleErrorDlgt);\n this._handleErrorCurrZone =\n zoneSpec && (zoneSpec.onHandleError ? this.zone : parentDelegate._handleErrorCurrZone);\n this._scheduleTaskZS =\n zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS);\n this._scheduleTaskDlgt = zoneSpec &&\n (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);\n this._scheduleTaskCurrZone =\n zoneSpec && (zoneSpec.onScheduleTask ? this.zone : parentDelegate._scheduleTaskCurrZone);\n this._invokeTaskZS =\n zoneSpec && (zoneSpec.onInvokeTask ? zoneSpec : parentDelegate._invokeTaskZS);\n this._invokeTaskDlgt =\n zoneSpec && (zoneSpec.onInvokeTask ? parentDelegate : parentDelegate._invokeTaskDlgt);\n this._invokeTaskCurrZone =\n zoneSpec && (zoneSpec.onInvokeTask ? this.zone : parentDelegate._invokeTaskCurrZone);\n this._cancelTaskZS =\n zoneSpec && (zoneSpec.onCancelTask ? zoneSpec : parentDelegate._cancelTaskZS);\n this._cancelTaskDlgt =\n zoneSpec && (zoneSpec.onCancelTask ? parentDelegate : parentDelegate._cancelTaskDlgt);\n this._cancelTaskCurrZone =\n zoneSpec && (zoneSpec.onCancelTask ? this.zone : parentDelegate._cancelTaskCurrZone);\n this._hasTaskZS = null;\n this._hasTaskDlgt = null;\n this._hasTaskDlgtOwner = null;\n this._hasTaskCurrZone = null;\n const zoneSpecHasTask = zoneSpec && zoneSpec.onHasTask;\n const parentHasTask = parentDelegate && parentDelegate._hasTaskZS;\n if (zoneSpecHasTask || parentHasTask) {\n // If we need to report hasTask, than this ZS needs to do ref counting on tasks. In such\n // a case all task related interceptors must go through this ZD. We can't short circuit it.\n this._hasTaskZS = zoneSpecHasTask ? zoneSpec : DELEGATE_ZS;\n this._hasTaskDlgt = parentDelegate;\n this._hasTaskDlgtOwner = this;\n this._hasTaskCurrZone = zone;\n if (!zoneSpec.onScheduleTask) {\n this._scheduleTaskZS = DELEGATE_ZS;\n this._scheduleTaskDlgt = parentDelegate;\n this._scheduleTaskCurrZone = this.zone;\n }\n if (!zoneSpec.onInvokeTask) {\n this._invokeTaskZS = DELEGATE_ZS;\n this._invokeTaskDlgt = parentDelegate;\n this._invokeTaskCurrZone = this.zone;\n }\n if (!zoneSpec.onCancelTask) {\n this._cancelTaskZS = DELEGATE_ZS;\n this._cancelTaskDlgt = parentDelegate;\n this._cancelTaskCurrZone = this.zone;\n }\n }\n }\n fork(targetZone, zoneSpec) {\n return this._forkZS ? this._forkZS.onFork(this._forkDlgt, this.zone, targetZone, zoneSpec) :\n new Zone(targetZone, zoneSpec);\n }\n intercept(targetZone, callback, source) {\n return this._interceptZS ?\n this._interceptZS.onIntercept(this._interceptDlgt, this._interceptCurrZone, targetZone, callback, source) :\n callback;\n }\n invoke(targetZone, callback, applyThis, applyArgs, source) {\n return this._invokeZS ? this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) :\n callback.apply(applyThis, applyArgs);\n }\n handleError(targetZone, error) {\n return this._handleErrorZS ?\n this._handleErrorZS.onHandleError(this._handleErrorDlgt, this._handleErrorCurrZone, targetZone, error) :\n true;\n }\n scheduleTask(targetZone, task) {\n let returnTask = task;\n if (this._scheduleTaskZS) {\n if (this._hasTaskZS) {\n returnTask._zoneDelegates.push(this._hasTaskDlgtOwner);\n }\n // clang-format off\n returnTask = this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this._scheduleTaskCurrZone, targetZone, task);\n // clang-format on\n if (!returnTask)\n returnTask = task;\n }\n else {\n if (task.scheduleFn) {\n task.scheduleFn(task);\n }\n else if (task.type == microTask) {\n scheduleMicroTask(task);\n }\n else {\n throw new Error('Task is missing scheduleFn.');\n }\n }\n return returnTask;\n }\n invokeTask(targetZone, task, applyThis, applyArgs) {\n return this._invokeTaskZS ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) :\n task.callback.apply(applyThis, applyArgs);\n }\n cancelTask(targetZone, task) {\n let value;\n if (this._cancelTaskZS) {\n value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this._cancelTaskCurrZone, targetZone, task);\n }\n else {\n if (!task.cancelFn) {\n throw Error('Task is not cancelable');\n }\n value = task.cancelFn(task);\n }\n return value;\n }\n hasTask(targetZone, isEmpty) {\n // hasTask should not throw error so other ZoneDelegate\n // can still trigger hasTask callback\n try {\n this._hasTaskZS &&\n this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, targetZone, isEmpty);\n }\n catch (err) {\n this.handleError(targetZone, err);\n }\n }\n // tslint:disable-next-line:require-internal-with-underscore\n _updateTaskCount(type, count) {\n const counts = this._taskCounts;\n const prev = counts[type];\n const next = counts[type] = prev + count;\n if (next < 0) {\n throw new Error('More tasks executed then were scheduled.');\n }\n if (prev == 0 || next == 0) {\n const isEmpty = {\n microTask: counts['microTask'] > 0,\n macroTask: counts['macroTask'] > 0,\n eventTask: counts['eventTask'] > 0,\n change: type\n };\n this.hasTask(this.zone, isEmpty);\n }\n }\n }\n class ZoneTask {\n constructor(type, source, callback, options, scheduleFn, cancelFn) {\n // tslint:disable-next-line:require-internal-with-underscore\n this._zone = null;\n this.runCount = 0;\n // tslint:disable-next-line:require-internal-with-underscore\n this._zoneDelegates = null;\n // tslint:disable-next-line:require-internal-with-underscore\n this._state = 'notScheduled';\n this.type = type;\n this.source = source;\n this.data = options;\n this.scheduleFn = scheduleFn;\n this.cancelFn = cancelFn;\n if (!callback) {\n throw new Error('callback is not defined');\n }\n this.callback = callback;\n const self = this;\n // TODO: @JiaLiPassion options should have interface\n if (type === eventTask && options && options.useG) {\n this.invoke = ZoneTask.invokeTask;\n }\n else {\n this.invoke = function () {\n return ZoneTask.invokeTask.call(global, self, this, arguments);\n };\n }\n }\n static invokeTask(task, target, args) {\n if (!task) {\n task = this;\n }\n _numberOfNestedTaskFrames++;\n try {\n task.runCount++;\n return task.zone.runTask(task, target, args);\n }\n finally {\n if (_numberOfNestedTaskFrames == 1) {\n drainMicroTaskQueue();\n }\n _numberOfNestedTaskFrames--;\n }\n }\n get zone() {\n return this._zone;\n }\n get state() {\n return this._state;\n }\n cancelScheduleRequest() {\n this._transitionTo(notScheduled, scheduling);\n }\n // tslint:disable-next-line:require-internal-with-underscore\n _transitionTo(toState, fromState1, fromState2) {\n if (this._state === fromState1 || this._state === fromState2) {\n this._state = toState;\n if (toState == notScheduled) {\n this._zoneDelegates = null;\n }\n }\n else {\n throw new Error(`${this.type} '${this.source}': can not transition to '${toState}', expecting state '${fromState1}'${fromState2 ? ' or \\'' + fromState2 + '\\'' : ''}, was '${this._state}'.`);\n }\n }\n toString() {\n if (this.data && typeof this.data.handleId !== 'undefined') {\n return this.data.handleId.toString();\n }\n else {\n return Object.prototype.toString.call(this);\n }\n }\n // add toJSON method to prevent cyclic error when\n // call JSON.stringify(zoneTask)\n toJSON() {\n return {\n type: this.type,\n state: this.state,\n source: this.source,\n zone: this.zone.name,\n runCount: this.runCount\n };\n }\n }\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n /// MICROTASK QUEUE\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n const symbolSetTimeout = __symbol__('setTimeout');\n const symbolPromise = __symbol__('Promise');\n const symbolThen = __symbol__('then');\n let _microTaskQueue = [];\n let _isDrainingMicrotaskQueue = false;\n let nativeMicroTaskQueuePromise;\n function nativeScheduleMicroTask(func) {\n if (!nativeMicroTaskQueuePromise) {\n if (global[symbolPromise]) {\n nativeMicroTaskQueuePromise = global[symbolPromise].resolve(0);\n }\n }\n if (nativeMicroTaskQueuePromise) {\n let nativeThen = nativeMicroTaskQueuePromise[symbolThen];\n if (!nativeThen) {\n // native Promise is not patchable, we need to use `then` directly\n // issue 1078\n nativeThen = nativeMicroTaskQueuePromise['then'];\n }\n nativeThen.call(nativeMicroTaskQueuePromise, func);\n }\n else {\n global[symbolSetTimeout](func, 0);\n }\n }\n function scheduleMicroTask(task) {\n // if we are not running in any task, and there has not been anything scheduled\n // we must bootstrap the initial task creation by manually scheduling the drain\n if (_numberOfNestedTaskFrames === 0 && _microTaskQueue.length === 0) {\n // We are not running in Task, so we need to kickstart the microtask queue.\n nativeScheduleMicroTask(drainMicroTaskQueue);\n }\n task && _microTaskQueue.push(task);\n }\n function drainMicroTaskQueue() {\n if (!_isDrainingMicrotaskQueue) {\n _isDrainingMicrotaskQueue = true;\n while (_microTaskQueue.length) {\n const queue = _microTaskQueue;\n _microTaskQueue = [];\n for (let i = 0; i < queue.length; i++) {\n const task = queue[i];\n try {\n task.zone.runTask(task, null, null);\n }\n catch (error) {\n _api.onUnhandledError(error);\n }\n }\n }\n _api.microtaskDrainDone();\n _isDrainingMicrotaskQueue = false;\n }\n }\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n /// BOOTSTRAP\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n const NO_ZONE = { name: 'NO ZONE' };\n const notScheduled = 'notScheduled', scheduling = 'scheduling', scheduled = 'scheduled', running = 'running', canceling = 'canceling', unknown = 'unknown';\n const microTask = 'microTask', macroTask = 'macroTask', eventTask = 'eventTask';\n const patches = {};\n const _api = {\n symbol: __symbol__,\n currentZoneFrame: () => _currentZoneFrame,\n onUnhandledError: noop,\n microtaskDrainDone: noop,\n scheduleMicroTask: scheduleMicroTask,\n showUncaughtError: () => !Zone[__symbol__('ignoreConsoleErrorUncaughtError')],\n patchEventTarget: () => [],\n patchOnProperties: noop,\n patchMethod: () => noop,\n bindArguments: () => [],\n patchThen: () => noop,\n patchMacroTask: () => noop,\n patchEventPrototype: () => noop,\n isIEOrEdge: () => false,\n getGlobalObjects: () => undefined,\n ObjectDefineProperty: () => noop,\n ObjectGetOwnPropertyDescriptor: () => undefined,\n ObjectCreate: () => undefined,\n ArraySlice: () => [],\n patchClass: () => noop,\n wrapWithCurrentZone: () => noop,\n filterProperties: () => [],\n attachOriginToPatched: () => noop,\n _redefineProperty: () => noop,\n patchCallbacks: () => noop,\n nativeScheduleMicroTask: nativeScheduleMicroTask\n };\n let _currentZoneFrame = { parent: null, zone: new Zone(null, null) };\n let _currentTask = null;\n let _numberOfNestedTaskFrames = 0;\n function noop() { }\n performanceMeasure('Zone', 'Zone');\n return global['Zone'] = Zone;\n}))(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Suppress closure compiler errors about unknown 'Zone' variable\n * @fileoverview\n * @suppress {undefinedVars,globalThis,missingRequire}\n */\n/// \n// issue #989, to reduce bundle size, use short name\n/** Object.getOwnPropertyDescriptor */\nconst ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n/** Object.defineProperty */\nconst ObjectDefineProperty = Object.defineProperty;\n/** Object.getPrototypeOf */\nconst ObjectGetPrototypeOf = Object.getPrototypeOf;\n/** Object.create */\nconst ObjectCreate = Object.create;\n/** Array.prototype.slice */\nconst ArraySlice = Array.prototype.slice;\n/** addEventListener string const */\nconst ADD_EVENT_LISTENER_STR = 'addEventListener';\n/** removeEventListener string const */\nconst REMOVE_EVENT_LISTENER_STR = 'removeEventListener';\n/** zoneSymbol addEventListener */\nconst ZONE_SYMBOL_ADD_EVENT_LISTENER = Zone.__symbol__(ADD_EVENT_LISTENER_STR);\n/** zoneSymbol removeEventListener */\nconst ZONE_SYMBOL_REMOVE_EVENT_LISTENER = Zone.__symbol__(REMOVE_EVENT_LISTENER_STR);\n/** true string const */\nconst TRUE_STR = 'true';\n/** false string const */\nconst FALSE_STR = 'false';\n/** Zone symbol prefix string const. */\nconst ZONE_SYMBOL_PREFIX = Zone.__symbol__('');\nfunction wrapWithCurrentZone(callback, source) {\n return Zone.current.wrap(callback, source);\n}\nfunction scheduleMacroTaskWithCurrentZone(source, callback, data, customSchedule, customCancel) {\n return Zone.current.scheduleMacroTask(source, callback, data, customSchedule, customCancel);\n}\nconst zoneSymbol = Zone.__symbol__;\nconst isWindowExists = typeof window !== 'undefined';\nconst internalWindow = isWindowExists ? window : undefined;\nconst _global = isWindowExists && internalWindow || typeof self === 'object' && self || global;\nconst REMOVE_ATTRIBUTE = 'removeAttribute';\nfunction bindArguments(args, source) {\n for (let i = args.length - 1; i >= 0; i--) {\n if (typeof args[i] === 'function') {\n args[i] = wrapWithCurrentZone(args[i], source + '_' + i);\n }\n }\n return args;\n}\nfunction patchPrototype(prototype, fnNames) {\n const source = prototype.constructor['name'];\n for (let i = 0; i < fnNames.length; i++) {\n const name = fnNames[i];\n const delegate = prototype[name];\n if (delegate) {\n const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, name);\n if (!isPropertyWritable(prototypeDesc)) {\n continue;\n }\n prototype[name] = ((delegate) => {\n const patched = function () {\n return delegate.apply(this, bindArguments(arguments, source + '.' + name));\n };\n attachOriginToPatched(patched, delegate);\n return patched;\n })(delegate);\n }\n }\n}\nfunction isPropertyWritable(propertyDesc) {\n if (!propertyDesc) {\n return true;\n }\n if (propertyDesc.writable === false) {\n return false;\n }\n return !(typeof propertyDesc.get === 'function' && typeof propertyDesc.set === 'undefined');\n}\nconst isWebWorker = (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope);\n// Make sure to access `process` through `_global` so that WebPack does not accidentally browserify\n// this code.\nconst isNode = (!('nw' in _global) && typeof _global.process !== 'undefined' &&\n {}.toString.call(_global.process) === '[object process]');\nconst isBrowser = !isNode && !isWebWorker && !!(isWindowExists && internalWindow['HTMLElement']);\n// we are in electron of nw, so we are both browser and nodejs\n// Make sure to access `process` through `_global` so that WebPack does not accidentally browserify\n// this code.\nconst isMix = typeof _global.process !== 'undefined' &&\n {}.toString.call(_global.process) === '[object process]' && !isWebWorker &&\n !!(isWindowExists && internalWindow['HTMLElement']);\nconst zoneSymbolEventNames$1 = {};\nconst wrapFn = function (event) {\n // https://github.com/angular/zone.js/issues/911, in IE, sometimes\n // event will be undefined, so we need to use window.event\n event = event || _global.event;\n if (!event) {\n return;\n }\n let eventNameSymbol = zoneSymbolEventNames$1[event.type];\n if (!eventNameSymbol) {\n eventNameSymbol = zoneSymbolEventNames$1[event.type] = zoneSymbol('ON_PROPERTY' + event.type);\n }\n const target = this || event.target || _global;\n const listener = target[eventNameSymbol];\n let result;\n if (isBrowser && target === internalWindow && event.type === 'error') {\n // window.onerror have different signature\n // https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror#window.onerror\n // and onerror callback will prevent default when callback return true\n const errorEvent = event;\n result = listener &&\n listener.call(this, errorEvent.message, errorEvent.filename, errorEvent.lineno, errorEvent.colno, errorEvent.error);\n if (result === true) {\n event.preventDefault();\n }\n }\n else {\n result = listener && listener.apply(this, arguments);\n if (result != undefined && !result) {\n event.preventDefault();\n }\n }\n return result;\n};\nfunction patchProperty(obj, prop, prototype) {\n let desc = ObjectGetOwnPropertyDescriptor(obj, prop);\n if (!desc && prototype) {\n // when patch window object, use prototype to check prop exist or not\n const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, prop);\n if (prototypeDesc) {\n desc = { enumerable: true, configurable: true };\n }\n }\n // if the descriptor not exists or is not configurable\n // just return\n if (!desc || !desc.configurable) {\n return;\n }\n const onPropPatchedSymbol = zoneSymbol('on' + prop + 'patched');\n if (obj.hasOwnProperty(onPropPatchedSymbol) && obj[onPropPatchedSymbol]) {\n return;\n }\n // A property descriptor cannot have getter/setter and be writable\n // deleting the writable and value properties avoids this error:\n //\n // TypeError: property descriptors must not specify a value or be writable when a\n // getter or setter has been specified\n delete desc.writable;\n delete desc.value;\n const originalDescGet = desc.get;\n const originalDescSet = desc.set;\n // slice(2) cuz 'onclick' -> 'click', etc\n const eventName = prop.slice(2);\n let eventNameSymbol = zoneSymbolEventNames$1[eventName];\n if (!eventNameSymbol) {\n eventNameSymbol = zoneSymbolEventNames$1[eventName] = zoneSymbol('ON_PROPERTY' + eventName);\n }\n desc.set = function (newValue) {\n // in some of windows's onproperty callback, this is undefined\n // so we need to check it\n let target = this;\n if (!target && obj === _global) {\n target = _global;\n }\n if (!target) {\n return;\n }\n const previousValue = target[eventNameSymbol];\n if (typeof previousValue === 'function') {\n target.removeEventListener(eventName, wrapFn);\n }\n // issue #978, when onload handler was added before loading zone.js\n // we should remove it with originalDescSet\n originalDescSet && originalDescSet.call(target, null);\n target[eventNameSymbol] = newValue;\n if (typeof newValue === 'function') {\n target.addEventListener(eventName, wrapFn, false);\n }\n };\n // The getter would return undefined for unassigned properties but the default value of an\n // unassigned property is null\n desc.get = function () {\n // in some of windows's onproperty callback, this is undefined\n // so we need to check it\n let target = this;\n if (!target && obj === _global) {\n target = _global;\n }\n if (!target) {\n return null;\n }\n const listener = target[eventNameSymbol];\n if (listener) {\n return listener;\n }\n else if (originalDescGet) {\n // result will be null when use inline event attribute,\n // such as \n // because the onclick function is internal raw uncompiled handler\n // the onclick will be evaluated when first time event was triggered or\n // the property is accessed, https://github.com/angular/zone.js/issues/525\n // so we should use original native get to retrieve the handler\n let value = originalDescGet.call(this);\n if (value) {\n desc.set.call(this, value);\n if (typeof target[REMOVE_ATTRIBUTE] === 'function') {\n target.removeAttribute(prop);\n }\n return value;\n }\n }\n return null;\n };\n ObjectDefineProperty(obj, prop, desc);\n obj[onPropPatchedSymbol] = true;\n}\nfunction patchOnProperties(obj, properties, prototype) {\n if (properties) {\n for (let i = 0; i < properties.length; i++) {\n patchProperty(obj, 'on' + properties[i], prototype);\n }\n }\n else {\n const onProperties = [];\n for (const prop in obj) {\n if (prop.slice(0, 2) == 'on') {\n onProperties.push(prop);\n }\n }\n for (let j = 0; j < onProperties.length; j++) {\n patchProperty(obj, onProperties[j], prototype);\n }\n }\n}\nconst originalInstanceKey = zoneSymbol('originalInstance');\n// wrap some native API on `window`\nfunction patchClass(className) {\n const OriginalClass = _global[className];\n if (!OriginalClass)\n return;\n // keep original class in global\n _global[zoneSymbol(className)] = OriginalClass;\n _global[className] = function () {\n const a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error('Arg list too long.');\n }\n };\n // attach original delegate to patched function\n attachOriginToPatched(_global[className], OriginalClass);\n const instance = new OriginalClass(function () { });\n let prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n ObjectDefineProperty(_global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop);\n // keep callback in wrapped function so we can\n // use it in Function.prototype.toString to return\n // the native one.\n attachOriginToPatched(this[originalInstanceKey][prop], fn);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n }\n });\n }\n }(prop));\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global[className][prop] = OriginalClass[prop];\n }\n }\n}\nfunction patchMethod(target, name, patchFn) {\n let proto = target;\n while (proto && !proto.hasOwnProperty(name)) {\n proto = ObjectGetPrototypeOf(proto);\n }\n if (!proto && target[name]) {\n // somehow we did not find it, but we can see it. This happens on IE for Window properties.\n proto = target;\n }\n const delegateName = zoneSymbol(name);\n let delegate = null;\n if (proto && (!(delegate = proto[delegateName]) || !proto.hasOwnProperty(delegateName))) {\n delegate = proto[delegateName] = proto[name];\n // check whether proto[name] is writable\n // some property is readonly in safari, such as HtmlCanvasElement.prototype.toBlob\n const desc = proto && ObjectGetOwnPropertyDescriptor(proto, name);\n if (isPropertyWritable(desc)) {\n const patchDelegate = patchFn(delegate, delegateName, name);\n proto[name] = function () {\n return patchDelegate(this, arguments);\n };\n attachOriginToPatched(proto[name], delegate);\n }\n }\n return delegate;\n}\n// TODO: @JiaLiPassion, support cancel task later if necessary\nfunction patchMacroTask(obj, funcName, metaCreator) {\n let setNative = null;\n function scheduleTask(task) {\n const data = task.data;\n data.args[data.cbIdx] = function () {\n task.invoke.apply(this, arguments);\n };\n setNative.apply(data.target, data.args);\n return task;\n }\n setNative = patchMethod(obj, funcName, (delegate) => function (self, args) {\n const meta = metaCreator(self, args);\n if (meta.cbIdx >= 0 && typeof args[meta.cbIdx] === 'function') {\n return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask);\n }\n else {\n // cause an error by calling it directly.\n return delegate.apply(self, args);\n }\n });\n}\nfunction attachOriginToPatched(patched, original) {\n patched[zoneSymbol('OriginalDelegate')] = original;\n}\nlet isDetectedIEOrEdge = false;\nlet ieOrEdge = false;\nfunction isIE() {\n try {\n const ua = internalWindow.navigator.userAgent;\n if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1) {\n return true;\n }\n }\n catch (error) {\n }\n return false;\n}\nfunction isIEOrEdge() {\n if (isDetectedIEOrEdge) {\n return ieOrEdge;\n }\n isDetectedIEOrEdge = true;\n try {\n const ua = internalWindow.navigator.userAgent;\n if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1 || ua.indexOf('Edge/') !== -1) {\n ieOrEdge = true;\n }\n }\n catch (error) {\n }\n return ieOrEdge;\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nZone.__load_patch('ZoneAwarePromise', (global, Zone, api) => {\n const ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n const ObjectDefineProperty = Object.defineProperty;\n function readableObjectToString(obj) {\n if (obj && obj.toString === Object.prototype.toString) {\n const className = obj.constructor && obj.constructor.name;\n return (className ? className : '') + ': ' + JSON.stringify(obj);\n }\n return obj ? obj.toString() : Object.prototype.toString.call(obj);\n }\n const __symbol__ = api.symbol;\n const _uncaughtPromiseErrors = [];\n const isDisableWrappingUncaughtPromiseRejection = global[__symbol__('DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION')] === true;\n const symbolPromise = __symbol__('Promise');\n const symbolThen = __symbol__('then');\n const creationTrace = '__creationTrace__';\n api.onUnhandledError = (e) => {\n if (api.showUncaughtError()) {\n const rejection = e && e.rejection;\n if (rejection) {\n console.error('Unhandled Promise rejection:', rejection instanceof Error ? rejection.message : rejection, '; Zone:', e.zone.name, '; Task:', e.task && e.task.source, '; Value:', rejection, rejection instanceof Error ? rejection.stack : undefined);\n }\n else {\n console.error(e);\n }\n }\n };\n api.microtaskDrainDone = () => {\n while (_uncaughtPromiseErrors.length) {\n const uncaughtPromiseError = _uncaughtPromiseErrors.shift();\n try {\n uncaughtPromiseError.zone.runGuarded(() => {\n if (uncaughtPromiseError.throwOriginal) {\n throw uncaughtPromiseError.rejection;\n }\n throw uncaughtPromiseError;\n });\n }\n catch (error) {\n handleUnhandledRejection(error);\n }\n }\n };\n const UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL = __symbol__('unhandledPromiseRejectionHandler');\n function handleUnhandledRejection(e) {\n api.onUnhandledError(e);\n try {\n const handler = Zone[UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL];\n if (typeof handler === 'function') {\n handler.call(this, e);\n }\n }\n catch (err) {\n }\n }\n function isThenable(value) {\n return value && value.then;\n }\n function forwardResolution(value) {\n return value;\n }\n function forwardRejection(rejection) {\n return ZoneAwarePromise.reject(rejection);\n }\n const symbolState = __symbol__('state');\n const symbolValue = __symbol__('value');\n const symbolFinally = __symbol__('finally');\n const symbolParentPromiseValue = __symbol__('parentPromiseValue');\n const symbolParentPromiseState = __symbol__('parentPromiseState');\n const source = 'Promise.then';\n const UNRESOLVED = null;\n const RESOLVED = true;\n const REJECTED = false;\n const REJECTED_NO_CATCH = 0;\n function makeResolver(promise, state) {\n return (v) => {\n try {\n resolvePromise(promise, state, v);\n }\n catch (err) {\n resolvePromise(promise, false, err);\n }\n // Do not return value or you will break the Promise spec.\n };\n }\n const once = function () {\n let wasCalled = false;\n return function wrapper(wrappedFunction) {\n return function () {\n if (wasCalled) {\n return;\n }\n wasCalled = true;\n wrappedFunction.apply(null, arguments);\n };\n };\n };\n const TYPE_ERROR = 'Promise resolved with itself';\n const CURRENT_TASK_TRACE_SYMBOL = __symbol__('currentTaskTrace');\n // Promise Resolution\n function resolvePromise(promise, state, value) {\n const onceWrapper = once();\n if (promise === value) {\n throw new TypeError(TYPE_ERROR);\n }\n if (promise[symbolState] === UNRESOLVED) {\n // should only get value.then once based on promise spec.\n let then = null;\n try {\n if (typeof value === 'object' || typeof value === 'function') {\n then = value && value.then;\n }\n }\n catch (err) {\n onceWrapper(() => {\n resolvePromise(promise, false, err);\n })();\n return promise;\n }\n // if (value instanceof ZoneAwarePromise) {\n if (state !== REJECTED && value instanceof ZoneAwarePromise &&\n value.hasOwnProperty(symbolState) && value.hasOwnProperty(symbolValue) &&\n value[symbolState] !== UNRESOLVED) {\n clearRejectedNoCatch(value);\n resolvePromise(promise, value[symbolState], value[symbolValue]);\n }\n else if (state !== REJECTED && typeof then === 'function') {\n try {\n then.call(value, onceWrapper(makeResolver(promise, state)), onceWrapper(makeResolver(promise, false)));\n }\n catch (err) {\n onceWrapper(() => {\n resolvePromise(promise, false, err);\n })();\n }\n }\n else {\n promise[symbolState] = state;\n const queue = promise[symbolValue];\n promise[symbolValue] = value;\n if (promise[symbolFinally] === symbolFinally) {\n // the promise is generated by Promise.prototype.finally\n if (state === RESOLVED) {\n // the state is resolved, should ignore the value\n // and use parent promise value\n promise[symbolState] = promise[symbolParentPromiseState];\n promise[symbolValue] = promise[symbolParentPromiseValue];\n }\n }\n // record task information in value when error occurs, so we can\n // do some additional work such as render longStackTrace\n if (state === REJECTED && value instanceof Error) {\n // check if longStackTraceZone is here\n const trace = Zone.currentTask && Zone.currentTask.data &&\n Zone.currentTask.data[creationTrace];\n if (trace) {\n // only keep the long stack trace into error when in longStackTraceZone\n ObjectDefineProperty(value, CURRENT_TASK_TRACE_SYMBOL, { configurable: true, enumerable: false, writable: true, value: trace });\n }\n }\n for (let i = 0; i < queue.length;) {\n scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]);\n }\n if (queue.length == 0 && state == REJECTED) {\n promise[symbolState] = REJECTED_NO_CATCH;\n let uncaughtPromiseError = value;\n try {\n // Here we throws a new Error to print more readable error log\n // and if the value is not an error, zone.js builds an `Error`\n // Object here to attach the stack information.\n throw new Error('Uncaught (in promise): ' + readableObjectToString(value) +\n (value && value.stack ? '\\n' + value.stack : ''));\n }\n catch (err) {\n uncaughtPromiseError = err;\n }\n if (isDisableWrappingUncaughtPromiseRejection) {\n // If disable wrapping uncaught promise reject\n // use the value instead of wrapping it.\n uncaughtPromiseError.throwOriginal = true;\n }\n uncaughtPromiseError.rejection = value;\n uncaughtPromiseError.promise = promise;\n uncaughtPromiseError.zone = Zone.current;\n uncaughtPromiseError.task = Zone.currentTask;\n _uncaughtPromiseErrors.push(uncaughtPromiseError);\n api.scheduleMicroTask(); // to make sure that it is running\n }\n }\n }\n // Resolving an already resolved promise is a noop.\n return promise;\n }\n const REJECTION_HANDLED_HANDLER = __symbol__('rejectionHandledHandler');\n function clearRejectedNoCatch(promise) {\n if (promise[symbolState] === REJECTED_NO_CATCH) {\n // if the promise is rejected no catch status\n // and queue.length > 0, means there is a error handler\n // here to handle the rejected promise, we should trigger\n // windows.rejectionhandled eventHandler or nodejs rejectionHandled\n // eventHandler\n try {\n const handler = Zone[REJECTION_HANDLED_HANDLER];\n if (handler && typeof handler === 'function') {\n handler.call(this, { rejection: promise[symbolValue], promise: promise });\n }\n }\n catch (err) {\n }\n promise[symbolState] = REJECTED;\n for (let i = 0; i < _uncaughtPromiseErrors.length; i++) {\n if (promise === _uncaughtPromiseErrors[i].promise) {\n _uncaughtPromiseErrors.splice(i, 1);\n }\n }\n }\n }\n function scheduleResolveOrReject(promise, zone, chainPromise, onFulfilled, onRejected) {\n clearRejectedNoCatch(promise);\n const promiseState = promise[symbolState];\n const delegate = promiseState ?\n (typeof onFulfilled === 'function') ? onFulfilled : forwardResolution :\n (typeof onRejected === 'function') ? onRejected :\n forwardRejection;\n zone.scheduleMicroTask(source, () => {\n try {\n const parentPromiseValue = promise[symbolValue];\n const isFinallyPromise = !!chainPromise && symbolFinally === chainPromise[symbolFinally];\n if (isFinallyPromise) {\n // if the promise is generated from finally call, keep parent promise's state and value\n chainPromise[symbolParentPromiseValue] = parentPromiseValue;\n chainPromise[symbolParentPromiseState] = promiseState;\n }\n // should not pass value to finally callback\n const value = zone.run(delegate, undefined, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution ?\n [] :\n [parentPromiseValue]);\n resolvePromise(chainPromise, true, value);\n }\n catch (error) {\n // if error occurs, should always return this error\n resolvePromise(chainPromise, false, error);\n }\n }, chainPromise);\n }\n const ZONE_AWARE_PROMISE_TO_STRING = 'function ZoneAwarePromise() { [native code] }';\n const noop = function () { };\n const AggregateError = global.AggregateError;\n class ZoneAwarePromise {\n static toString() {\n return ZONE_AWARE_PROMISE_TO_STRING;\n }\n static resolve(value) {\n return resolvePromise(new this(null), RESOLVED, value);\n }\n static reject(error) {\n return resolvePromise(new this(null), REJECTED, error);\n }\n static any(values) {\n if (!values || typeof values[Symbol.iterator] !== 'function') {\n return Promise.reject(new AggregateError([], 'All promises were rejected'));\n }\n const promises = [];\n let count = 0;\n try {\n for (let v of values) {\n count++;\n promises.push(ZoneAwarePromise.resolve(v));\n }\n }\n catch (err) {\n return Promise.reject(new AggregateError([], 'All promises were rejected'));\n }\n if (count === 0) {\n return Promise.reject(new AggregateError([], 'All promises were rejected'));\n }\n let finished = false;\n const errors = [];\n return new ZoneAwarePromise((resolve, reject) => {\n for (let i = 0; i < promises.length; i++) {\n promises[i].then(v => {\n if (finished) {\n return;\n }\n finished = true;\n resolve(v);\n }, err => {\n errors.push(err);\n count--;\n if (count === 0) {\n finished = true;\n reject(new AggregateError(errors, 'All promises were rejected'));\n }\n });\n }\n });\n }\n ;\n static race(values) {\n let resolve;\n let reject;\n let promise = new this((res, rej) => {\n resolve = res;\n reject = rej;\n });\n function onResolve(value) {\n resolve(value);\n }\n function onReject(error) {\n reject(error);\n }\n for (let value of values) {\n if (!isThenable(value)) {\n value = this.resolve(value);\n }\n value.then(onResolve, onReject);\n }\n return promise;\n }\n static all(values) {\n return ZoneAwarePromise.allWithCallback(values);\n }\n static allSettled(values) {\n const P = this && this.prototype instanceof ZoneAwarePromise ? this : ZoneAwarePromise;\n return P.allWithCallback(values, {\n thenCallback: (value) => ({ status: 'fulfilled', value }),\n errorCallback: (err) => ({ status: 'rejected', reason: err })\n });\n }\n static allWithCallback(values, callback) {\n let resolve;\n let reject;\n let promise = new this((res, rej) => {\n resolve = res;\n reject = rej;\n });\n // Start at 2 to prevent prematurely resolving if .then is called immediately.\n let unresolvedCount = 2;\n let valueIndex = 0;\n const resolvedValues = [];\n for (let value of values) {\n if (!isThenable(value)) {\n value = this.resolve(value);\n }\n const curValueIndex = valueIndex;\n try {\n value.then((value) => {\n resolvedValues[curValueIndex] = callback ? callback.thenCallback(value) : value;\n unresolvedCount--;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n }, (err) => {\n if (!callback) {\n reject(err);\n }\n else {\n resolvedValues[curValueIndex] = callback.errorCallback(err);\n unresolvedCount--;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n }\n });\n }\n catch (thenErr) {\n reject(thenErr);\n }\n unresolvedCount++;\n valueIndex++;\n }\n // Make the unresolvedCount zero-based again.\n unresolvedCount -= 2;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n return promise;\n }\n constructor(executor) {\n const promise = this;\n if (!(promise instanceof ZoneAwarePromise)) {\n throw new Error('Must be an instanceof Promise.');\n }\n promise[symbolState] = UNRESOLVED;\n promise[symbolValue] = []; // queue;\n try {\n const onceWrapper = once();\n executor &&\n executor(onceWrapper(makeResolver(promise, RESOLVED)), onceWrapper(makeResolver(promise, REJECTED)));\n }\n catch (error) {\n resolvePromise(promise, false, error);\n }\n }\n get [Symbol.toStringTag]() {\n return 'Promise';\n }\n get [Symbol.species]() {\n return ZoneAwarePromise;\n }\n then(onFulfilled, onRejected) {\n var _a;\n // We must read `Symbol.species` safely because `this` may be anything. For instance, `this`\n // may be an object without a prototype (created through `Object.create(null)`); thus\n // `this.constructor` will be undefined. One of the use cases is SystemJS creating\n // prototype-less objects (modules) via `Object.create(null)`. The SystemJS creates an empty\n // object and copies promise properties into that object (within the `getOrCreateLoad`\n // function). The zone.js then checks if the resolved value has the `then` method and invokes\n // it with the `value` context. Otherwise, this will throw an error: `TypeError: Cannot read\n // properties of undefined (reading 'Symbol(Symbol.species)')`.\n let C = (_a = this.constructor) === null || _a === void 0 ? void 0 : _a[Symbol.species];\n if (!C || typeof C !== 'function') {\n C = this.constructor || ZoneAwarePromise;\n }\n const chainPromise = new C(noop);\n const zone = Zone.current;\n if (this[symbolState] == UNRESOLVED) {\n this[symbolValue].push(zone, chainPromise, onFulfilled, onRejected);\n }\n else {\n scheduleResolveOrReject(this, zone, chainPromise, onFulfilled, onRejected);\n }\n return chainPromise;\n }\n catch(onRejected) {\n return this.then(null, onRejected);\n }\n finally(onFinally) {\n var _a;\n // See comment on the call to `then` about why thee `Symbol.species` is safely accessed.\n let C = (_a = this.constructor) === null || _a === void 0 ? void 0 : _a[Symbol.species];\n if (!C || typeof C !== 'function') {\n C = ZoneAwarePromise;\n }\n const chainPromise = new C(noop);\n chainPromise[symbolFinally] = symbolFinally;\n const zone = Zone.current;\n if (this[symbolState] == UNRESOLVED) {\n this[symbolValue].push(zone, chainPromise, onFinally, onFinally);\n }\n else {\n scheduleResolveOrReject(this, zone, chainPromise, onFinally, onFinally);\n }\n return chainPromise;\n }\n }\n // Protect against aggressive optimizers dropping seemingly unused properties.\n // E.g. Closure Compiler in advanced mode.\n ZoneAwarePromise['resolve'] = ZoneAwarePromise.resolve;\n ZoneAwarePromise['reject'] = ZoneAwarePromise.reject;\n ZoneAwarePromise['race'] = ZoneAwarePromise.race;\n ZoneAwarePromise['all'] = ZoneAwarePromise.all;\n const NativePromise = global[symbolPromise] = global['Promise'];\n global['Promise'] = ZoneAwarePromise;\n const symbolThenPatched = __symbol__('thenPatched');\n function patchThen(Ctor) {\n const proto = Ctor.prototype;\n const prop = ObjectGetOwnPropertyDescriptor(proto, 'then');\n if (prop && (prop.writable === false || !prop.configurable)) {\n // check Ctor.prototype.then propertyDescriptor is writable or not\n // in meteor env, writable is false, we should ignore such case\n return;\n }\n const originalThen = proto.then;\n // Keep a reference to the original method.\n proto[symbolThen] = originalThen;\n Ctor.prototype.then = function (onResolve, onReject) {\n const wrapped = new ZoneAwarePromise((resolve, reject) => {\n originalThen.call(this, resolve, reject);\n });\n return wrapped.then(onResolve, onReject);\n };\n Ctor[symbolThenPatched] = true;\n }\n api.patchThen = patchThen;\n function zoneify(fn) {\n return function (self, args) {\n let resultPromise = fn.apply(self, args);\n if (resultPromise instanceof ZoneAwarePromise) {\n return resultPromise;\n }\n let ctor = resultPromise.constructor;\n if (!ctor[symbolThenPatched]) {\n patchThen(ctor);\n }\n return resultPromise;\n };\n }\n if (NativePromise) {\n patchThen(NativePromise);\n patchMethod(global, 'fetch', delegate => zoneify(delegate));\n }\n // This is not part of public API, but it is useful for tests, so we expose it.\n Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;\n return ZoneAwarePromise;\n});\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// override Function.prototype.toString to make zone.js patched function\n// look like native function\nZone.__load_patch('toString', (global) => {\n // patch Func.prototype.toString to let them look like native\n const originalFunctionToString = Function.prototype.toString;\n const ORIGINAL_DELEGATE_SYMBOL = zoneSymbol('OriginalDelegate');\n const PROMISE_SYMBOL = zoneSymbol('Promise');\n const ERROR_SYMBOL = zoneSymbol('Error');\n const newFunctionToString = function toString() {\n if (typeof this === 'function') {\n const originalDelegate = this[ORIGINAL_DELEGATE_SYMBOL];\n if (originalDelegate) {\n if (typeof originalDelegate === 'function') {\n return originalFunctionToString.call(originalDelegate);\n }\n else {\n return Object.prototype.toString.call(originalDelegate);\n }\n }\n if (this === Promise) {\n const nativePromise = global[PROMISE_SYMBOL];\n if (nativePromise) {\n return originalFunctionToString.call(nativePromise);\n }\n }\n if (this === Error) {\n const nativeError = global[ERROR_SYMBOL];\n if (nativeError) {\n return originalFunctionToString.call(nativeError);\n }\n }\n }\n return originalFunctionToString.call(this);\n };\n newFunctionToString[ORIGINAL_DELEGATE_SYMBOL] = originalFunctionToString;\n Function.prototype.toString = newFunctionToString;\n // patch Object.prototype.toString to let them look like native\n const originalObjectToString = Object.prototype.toString;\n const PROMISE_OBJECT_TO_STRING = '[object Promise]';\n Object.prototype.toString = function () {\n if (typeof Promise === 'function' && this instanceof Promise) {\n return PROMISE_OBJECT_TO_STRING;\n }\n return originalObjectToString.call(this);\n };\n});\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nlet passiveSupported = false;\nif (typeof window !== 'undefined') {\n try {\n const options = Object.defineProperty({}, 'passive', {\n get: function () {\n passiveSupported = true;\n }\n });\n // Note: We pass the `options` object as the event handler too. This is not compatible with the\n // signature of `addEventListener` or `removeEventListener` but enables us to remove the handler\n // without an actual handler.\n window.addEventListener('test', options, options);\n window.removeEventListener('test', options, options);\n }\n catch (err) {\n passiveSupported = false;\n }\n}\n// an identifier to tell ZoneTask do not create a new invoke closure\nconst OPTIMIZED_ZONE_EVENT_TASK_DATA = {\n useG: true\n};\nconst zoneSymbolEventNames = {};\nconst globalSources = {};\nconst EVENT_NAME_SYMBOL_REGX = new RegExp('^' + ZONE_SYMBOL_PREFIX + '(\\\\w+)(true|false)$');\nconst IMMEDIATE_PROPAGATION_SYMBOL = zoneSymbol('propagationStopped');\nfunction prepareEventNames(eventName, eventNameToString) {\n const falseEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + FALSE_STR;\n const trueEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + TRUE_STR;\n const symbol = ZONE_SYMBOL_PREFIX + falseEventName;\n const symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;\n zoneSymbolEventNames[eventName] = {};\n zoneSymbolEventNames[eventName][FALSE_STR] = symbol;\n zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture;\n}\nfunction patchEventTarget(_global, api, apis, patchOptions) {\n const ADD_EVENT_LISTENER = (patchOptions && patchOptions.add) || ADD_EVENT_LISTENER_STR;\n const REMOVE_EVENT_LISTENER = (patchOptions && patchOptions.rm) || REMOVE_EVENT_LISTENER_STR;\n const LISTENERS_EVENT_LISTENER = (patchOptions && patchOptions.listeners) || 'eventListeners';\n const REMOVE_ALL_LISTENERS_EVENT_LISTENER = (patchOptions && patchOptions.rmAll) || 'removeAllListeners';\n const zoneSymbolAddEventListener = zoneSymbol(ADD_EVENT_LISTENER);\n const ADD_EVENT_LISTENER_SOURCE = '.' + ADD_EVENT_LISTENER + ':';\n const PREPEND_EVENT_LISTENER = 'prependListener';\n const PREPEND_EVENT_LISTENER_SOURCE = '.' + PREPEND_EVENT_LISTENER + ':';\n const invokeTask = function (task, target, event) {\n // for better performance, check isRemoved which is set\n // by removeEventListener\n if (task.isRemoved) {\n return;\n }\n const delegate = task.callback;\n if (typeof delegate === 'object' && delegate.handleEvent) {\n // create the bind version of handleEvent when invoke\n task.callback = (event) => delegate.handleEvent(event);\n task.originalDelegate = delegate;\n }\n // invoke static task.invoke\n // need to try/catch error here, otherwise, the error in one event listener\n // will break the executions of the other event listeners. Also error will\n // not remove the event listener when `once` options is true.\n let error;\n try {\n task.invoke(task, target, [event]);\n }\n catch (err) {\n error = err;\n }\n const options = task.options;\n if (options && typeof options === 'object' && options.once) {\n // if options.once is true, after invoke once remove listener here\n // only browser need to do this, nodejs eventEmitter will cal removeListener\n // inside EventEmitter.once\n const delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n target[REMOVE_EVENT_LISTENER].call(target, event.type, delegate, options);\n }\n return error;\n };\n function globalCallback(context, event, isCapture) {\n // https://github.com/angular/zone.js/issues/911, in IE, sometimes\n // event will be undefined, so we need to use window.event\n event = event || _global.event;\n if (!event) {\n return;\n }\n // event.target is needed for Samsung TV and SourceBuffer\n // || global is needed https://github.com/angular/zone.js/issues/190\n const target = context || event.target || _global;\n const tasks = target[zoneSymbolEventNames[event.type][isCapture ? TRUE_STR : FALSE_STR]];\n if (tasks) {\n const errors = [];\n // invoke all tasks which attached to current target with given event.type and capture = false\n // for performance concern, if task.length === 1, just invoke\n if (tasks.length === 1) {\n const err = invokeTask(tasks[0], target, event);\n err && errors.push(err);\n }\n else {\n // https://github.com/angular/zone.js/issues/836\n // copy the tasks array before invoke, to avoid\n // the callback will remove itself or other listener\n const copyTasks = tasks.slice();\n for (let i = 0; i < copyTasks.length; i++) {\n if (event && event[IMMEDIATE_PROPAGATION_SYMBOL] === true) {\n break;\n }\n const err = invokeTask(copyTasks[i], target, event);\n err && errors.push(err);\n }\n }\n // Since there is only one error, we don't need to schedule microTask\n // to throw the error.\n if (errors.length === 1) {\n throw errors[0];\n }\n else {\n for (let i = 0; i < errors.length; i++) {\n const err = errors[i];\n api.nativeScheduleMicroTask(() => {\n throw err;\n });\n }\n }\n }\n }\n // global shared zoneAwareCallback to handle all event callback with capture = false\n const globalZoneAwareCallback = function (event) {\n return globalCallback(this, event, false);\n };\n // global shared zoneAwareCallback to handle all event callback with capture = true\n const globalZoneAwareCaptureCallback = function (event) {\n return globalCallback(this, event, true);\n };\n function patchEventTargetMethods(obj, patchOptions) {\n if (!obj) {\n return false;\n }\n let useGlobalCallback = true;\n if (patchOptions && patchOptions.useG !== undefined) {\n useGlobalCallback = patchOptions.useG;\n }\n const validateHandler = patchOptions && patchOptions.vh;\n let checkDuplicate = true;\n if (patchOptions && patchOptions.chkDup !== undefined) {\n checkDuplicate = patchOptions.chkDup;\n }\n let returnTarget = false;\n if (patchOptions && patchOptions.rt !== undefined) {\n returnTarget = patchOptions.rt;\n }\n let proto = obj;\n while (proto && !proto.hasOwnProperty(ADD_EVENT_LISTENER)) {\n proto = ObjectGetPrototypeOf(proto);\n }\n if (!proto && obj[ADD_EVENT_LISTENER]) {\n // somehow we did not find it, but we can see it. This happens on IE for Window properties.\n proto = obj;\n }\n if (!proto) {\n return false;\n }\n if (proto[zoneSymbolAddEventListener]) {\n return false;\n }\n const eventNameToString = patchOptions && patchOptions.eventNameToString;\n // a shared global taskData to pass data for scheduleEventTask\n // so we do not need to create a new object just for pass some data\n const taskData = {};\n const nativeAddEventListener = proto[zoneSymbolAddEventListener] = proto[ADD_EVENT_LISTENER];\n const nativeRemoveEventListener = proto[zoneSymbol(REMOVE_EVENT_LISTENER)] =\n proto[REMOVE_EVENT_LISTENER];\n const nativeListeners = proto[zoneSymbol(LISTENERS_EVENT_LISTENER)] =\n proto[LISTENERS_EVENT_LISTENER];\n const nativeRemoveAllListeners = proto[zoneSymbol(REMOVE_ALL_LISTENERS_EVENT_LISTENER)] =\n proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER];\n let nativePrependEventListener;\n if (patchOptions && patchOptions.prepend) {\n nativePrependEventListener = proto[zoneSymbol(patchOptions.prepend)] =\n proto[patchOptions.prepend];\n }\n /**\n * This util function will build an option object with passive option\n * to handle all possible input from the user.\n */\n function buildEventListenerOptions(options, passive) {\n if (!passiveSupported && typeof options === 'object' && options) {\n // doesn't support passive but user want to pass an object as options.\n // this will not work on some old browser, so we just pass a boolean\n // as useCapture parameter\n return !!options.capture;\n }\n if (!passiveSupported || !passive) {\n return options;\n }\n if (typeof options === 'boolean') {\n return { capture: options, passive: true };\n }\n if (!options) {\n return { passive: true };\n }\n if (typeof options === 'object' && options.passive !== false) {\n return Object.assign(Object.assign({}, options), { passive: true });\n }\n return options;\n }\n const customScheduleGlobal = function (task) {\n // if there is already a task for the eventName + capture,\n // just return, because we use the shared globalZoneAwareCallback here.\n if (taskData.isExisting) {\n return;\n }\n return nativeAddEventListener.call(taskData.target, taskData.eventName, taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, taskData.options);\n };\n const customCancelGlobal = function (task) {\n // if task is not marked as isRemoved, this call is directly\n // from Zone.prototype.cancelTask, we should remove the task\n // from tasksList of target first\n if (!task.isRemoved) {\n const symbolEventNames = zoneSymbolEventNames[task.eventName];\n let symbolEventName;\n if (symbolEventNames) {\n symbolEventName = symbolEventNames[task.capture ? TRUE_STR : FALSE_STR];\n }\n const existingTasks = symbolEventName && task.target[symbolEventName];\n if (existingTasks) {\n for (let i = 0; i < existingTasks.length; i++) {\n const existingTask = existingTasks[i];\n if (existingTask === task) {\n existingTasks.splice(i, 1);\n // set isRemoved to data for faster invokeTask check\n task.isRemoved = true;\n if (existingTasks.length === 0) {\n // all tasks for the eventName + capture have gone,\n // remove globalZoneAwareCallback and remove the task cache from target\n task.allRemoved = true;\n task.target[symbolEventName] = null;\n }\n break;\n }\n }\n }\n }\n // if all tasks for the eventName + capture have gone,\n // we will really remove the global event callback,\n // if not, return\n if (!task.allRemoved) {\n return;\n }\n return nativeRemoveEventListener.call(task.target, task.eventName, task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, task.options);\n };\n const customScheduleNonGlobal = function (task) {\n return nativeAddEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n };\n const customSchedulePrepend = function (task) {\n return nativePrependEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n };\n const customCancelNonGlobal = function (task) {\n return nativeRemoveEventListener.call(task.target, task.eventName, task.invoke, task.options);\n };\n const customSchedule = useGlobalCallback ? customScheduleGlobal : customScheduleNonGlobal;\n const customCancel = useGlobalCallback ? customCancelGlobal : customCancelNonGlobal;\n const compareTaskCallbackVsDelegate = function (task, delegate) {\n const typeOfDelegate = typeof delegate;\n return (typeOfDelegate === 'function' && task.callback === delegate) ||\n (typeOfDelegate === 'object' && task.originalDelegate === delegate);\n };\n const compare = (patchOptions && patchOptions.diff) ? patchOptions.diff : compareTaskCallbackVsDelegate;\n const unpatchedEvents = Zone[zoneSymbol('UNPATCHED_EVENTS')];\n const passiveEvents = _global[zoneSymbol('PASSIVE_EVENTS')];\n const makeAddListener = function (nativeListener, addSource, customScheduleFn, customCancelFn, returnTarget = false, prepend = false) {\n return function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n let delegate = arguments[1];\n if (!delegate) {\n return nativeListener.apply(this, arguments);\n }\n if (isNode && eventName === 'uncaughtException') {\n // don't patch uncaughtException of nodejs to prevent endless loop\n return nativeListener.apply(this, arguments);\n }\n // don't create the bind delegate function for handleEvent\n // case here to improve addEventListener performance\n // we will create the bind delegate when invoke\n let isHandleEvent = false;\n if (typeof delegate !== 'function') {\n if (!delegate.handleEvent) {\n return nativeListener.apply(this, arguments);\n }\n isHandleEvent = true;\n }\n if (validateHandler && !validateHandler(nativeListener, delegate, target, arguments)) {\n return;\n }\n const passive = passiveSupported && !!passiveEvents && passiveEvents.indexOf(eventName) !== -1;\n const options = buildEventListenerOptions(arguments[2], passive);\n if (unpatchedEvents) {\n // check unpatched list\n for (let i = 0; i < unpatchedEvents.length; i++) {\n if (eventName === unpatchedEvents[i]) {\n if (passive) {\n return nativeListener.call(target, eventName, delegate, options);\n }\n else {\n return nativeListener.apply(this, arguments);\n }\n }\n }\n }\n const capture = !options ? false : typeof options === 'boolean' ? true : options.capture;\n const once = options && typeof options === 'object' ? options.once : false;\n const zone = Zone.current;\n let symbolEventNames = zoneSymbolEventNames[eventName];\n if (!symbolEventNames) {\n prepareEventNames(eventName, eventNameToString);\n symbolEventNames = zoneSymbolEventNames[eventName];\n }\n const symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n let existingTasks = target[symbolEventName];\n let isExisting = false;\n if (existingTasks) {\n // already have task registered\n isExisting = true;\n if (checkDuplicate) {\n for (let i = 0; i < existingTasks.length; i++) {\n if (compare(existingTasks[i], delegate)) {\n // same callback, same capture, same event name, just return\n return;\n }\n }\n }\n }\n else {\n existingTasks = target[symbolEventName] = [];\n }\n let source;\n const constructorName = target.constructor['name'];\n const targetSource = globalSources[constructorName];\n if (targetSource) {\n source = targetSource[eventName];\n }\n if (!source) {\n source = constructorName + addSource +\n (eventNameToString ? eventNameToString(eventName) : eventName);\n }\n // do not create a new object as task.data to pass those things\n // just use the global shared one\n taskData.options = options;\n if (once) {\n // if addEventListener with once options, we don't pass it to\n // native addEventListener, instead we keep the once setting\n // and handle ourselves.\n taskData.options.once = false;\n }\n taskData.target = target;\n taskData.capture = capture;\n taskData.eventName = eventName;\n taskData.isExisting = isExisting;\n const data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : undefined;\n // keep taskData into data to allow onScheduleEventTask to access the task information\n if (data) {\n data.taskData = taskData;\n }\n const task = zone.scheduleEventTask(source, delegate, data, customScheduleFn, customCancelFn);\n // should clear taskData.target to avoid memory leak\n // issue, https://github.com/angular/angular/issues/20442\n taskData.target = null;\n // need to clear up taskData because it is a global object\n if (data) {\n data.taskData = null;\n }\n // have to save those information to task in case\n // application may call task.zone.cancelTask() directly\n if (once) {\n options.once = true;\n }\n if (!(!passiveSupported && typeof task.options === 'boolean')) {\n // if not support passive, and we pass an option object\n // to addEventListener, we should save the options to task\n task.options = options;\n }\n task.target = target;\n task.capture = capture;\n task.eventName = eventName;\n if (isHandleEvent) {\n // save original delegate for compare to check duplicate\n task.originalDelegate = delegate;\n }\n if (!prepend) {\n existingTasks.push(task);\n }\n else {\n existingTasks.unshift(task);\n }\n if (returnTarget) {\n return target;\n }\n };\n };\n proto[ADD_EVENT_LISTENER] = makeAddListener(nativeAddEventListener, ADD_EVENT_LISTENER_SOURCE, customSchedule, customCancel, returnTarget);\n if (nativePrependEventListener) {\n proto[PREPEND_EVENT_LISTENER] = makeAddListener(nativePrependEventListener, PREPEND_EVENT_LISTENER_SOURCE, customSchedulePrepend, customCancel, returnTarget, true);\n }\n proto[REMOVE_EVENT_LISTENER] = function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n const options = arguments[2];\n const capture = !options ? false : typeof options === 'boolean' ? true : options.capture;\n const delegate = arguments[1];\n if (!delegate) {\n return nativeRemoveEventListener.apply(this, arguments);\n }\n if (validateHandler &&\n !validateHandler(nativeRemoveEventListener, delegate, target, arguments)) {\n return;\n }\n const symbolEventNames = zoneSymbolEventNames[eventName];\n let symbolEventName;\n if (symbolEventNames) {\n symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n }\n const existingTasks = symbolEventName && target[symbolEventName];\n if (existingTasks) {\n for (let i = 0; i < existingTasks.length; i++) {\n const existingTask = existingTasks[i];\n if (compare(existingTask, delegate)) {\n existingTasks.splice(i, 1);\n // set isRemoved to data for faster invokeTask check\n existingTask.isRemoved = true;\n if (existingTasks.length === 0) {\n // all tasks for the eventName + capture have gone,\n // remove globalZoneAwareCallback and remove the task cache from target\n existingTask.allRemoved = true;\n target[symbolEventName] = null;\n // in the target, we have an event listener which is added by on_property\n // such as target.onclick = function() {}, so we need to clear this internal\n // property too if all delegates all removed\n if (typeof eventName === 'string') {\n const onPropertySymbol = ZONE_SYMBOL_PREFIX + 'ON_PROPERTY' + eventName;\n target[onPropertySymbol] = null;\n }\n }\n existingTask.zone.cancelTask(existingTask);\n if (returnTarget) {\n return target;\n }\n return;\n }\n }\n }\n // issue 930, didn't find the event name or callback\n // from zone kept existingTasks, the callback maybe\n // added outside of zone, we need to call native removeEventListener\n // to try to remove it.\n return nativeRemoveEventListener.apply(this, arguments);\n };\n proto[LISTENERS_EVENT_LISTENER] = function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n const listeners = [];\n const tasks = findEventTasks(target, eventNameToString ? eventNameToString(eventName) : eventName);\n for (let i = 0; i < tasks.length; i++) {\n const task = tasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n listeners.push(delegate);\n }\n return listeners;\n };\n proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER] = function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (!eventName) {\n const keys = Object.keys(target);\n for (let i = 0; i < keys.length; i++) {\n const prop = keys[i];\n const match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n let evtName = match && match[1];\n // in nodejs EventEmitter, removeListener event is\n // used for monitoring the removeListener call,\n // so just keep removeListener eventListener until\n // all other eventListeners are removed\n if (evtName && evtName !== 'removeListener') {\n this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, evtName);\n }\n }\n // remove removeListener listener finally\n this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, 'removeListener');\n }\n else {\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n const symbolEventNames = zoneSymbolEventNames[eventName];\n if (symbolEventNames) {\n const symbolEventName = symbolEventNames[FALSE_STR];\n const symbolCaptureEventName = symbolEventNames[TRUE_STR];\n const tasks = target[symbolEventName];\n const captureTasks = target[symbolCaptureEventName];\n if (tasks) {\n const removeTasks = tasks.slice();\n for (let i = 0; i < removeTasks.length; i++) {\n const task = removeTasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n }\n }\n if (captureTasks) {\n const removeTasks = captureTasks.slice();\n for (let i = 0; i < removeTasks.length; i++) {\n const task = removeTasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n }\n }\n }\n }\n if (returnTarget) {\n return this;\n }\n };\n // for native toString patch\n attachOriginToPatched(proto[ADD_EVENT_LISTENER], nativeAddEventListener);\n attachOriginToPatched(proto[REMOVE_EVENT_LISTENER], nativeRemoveEventListener);\n if (nativeRemoveAllListeners) {\n attachOriginToPatched(proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER], nativeRemoveAllListeners);\n }\n if (nativeListeners) {\n attachOriginToPatched(proto[LISTENERS_EVENT_LISTENER], nativeListeners);\n }\n return true;\n }\n let results = [];\n for (let i = 0; i < apis.length; i++) {\n results[i] = patchEventTargetMethods(apis[i], patchOptions);\n }\n return results;\n}\nfunction findEventTasks(target, eventName) {\n if (!eventName) {\n const foundTasks = [];\n for (let prop in target) {\n const match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n let evtName = match && match[1];\n if (evtName && (!eventName || evtName === eventName)) {\n const tasks = target[prop];\n if (tasks) {\n for (let i = 0; i < tasks.length; i++) {\n foundTasks.push(tasks[i]);\n }\n }\n }\n }\n return foundTasks;\n }\n let symbolEventName = zoneSymbolEventNames[eventName];\n if (!symbolEventName) {\n prepareEventNames(eventName);\n symbolEventName = zoneSymbolEventNames[eventName];\n }\n const captureFalseTasks = target[symbolEventName[FALSE_STR]];\n const captureTrueTasks = target[symbolEventName[TRUE_STR]];\n if (!captureFalseTasks) {\n return captureTrueTasks ? captureTrueTasks.slice() : [];\n }\n else {\n return captureTrueTasks ? captureFalseTasks.concat(captureTrueTasks) :\n captureFalseTasks.slice();\n }\n}\nfunction patchEventPrototype(global, api) {\n const Event = global['Event'];\n if (Event && Event.prototype) {\n api.patchMethod(Event.prototype, 'stopImmediatePropagation', (delegate) => function (self, args) {\n self[IMMEDIATE_PROPAGATION_SYMBOL] = true;\n // we need to call the native stopImmediatePropagation\n // in case in some hybrid application, some part of\n // application will be controlled by zone, some are not\n delegate && delegate.apply(self, args);\n });\n }\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction patchCallbacks(api, target, targetName, method, callbacks) {\n const symbol = Zone.__symbol__(method);\n if (target[symbol]) {\n return;\n }\n const nativeDelegate = target[symbol] = target[method];\n target[method] = function (name, opts, options) {\n if (opts && opts.prototype) {\n callbacks.forEach(function (callback) {\n const source = `${targetName}.${method}::` + callback;\n const prototype = opts.prototype;\n // Note: the `patchCallbacks` is used for patching the `document.registerElement` and\n // `customElements.define`. We explicitly wrap the patching code into try-catch since\n // callbacks may be already patched by other web components frameworks (e.g. LWC), and they\n // make those properties non-writable. This means that patching callback will throw an error\n // `cannot assign to read-only property`. See this code as an example:\n // https://github.com/salesforce/lwc/blob/master/packages/@lwc/engine-core/src/framework/base-bridge-element.ts#L180-L186\n // We don't want to stop the application rendering if we couldn't patch some\n // callback, e.g. `attributeChangedCallback`.\n try {\n if (prototype.hasOwnProperty(callback)) {\n const descriptor = api.ObjectGetOwnPropertyDescriptor(prototype, callback);\n if (descriptor && descriptor.value) {\n descriptor.value = api.wrapWithCurrentZone(descriptor.value, source);\n api._redefineProperty(opts.prototype, callback, descriptor);\n }\n else if (prototype[callback]) {\n prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n }\n }\n else if (prototype[callback]) {\n prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n }\n }\n catch (_a) {\n // Note: we leave the catch block empty since there's no way to handle the error related\n // to non-writable property.\n }\n });\n }\n return nativeDelegate.call(target, name, opts, options);\n };\n api.attachOriginToPatched(target[method], nativeDelegate);\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction filterProperties(target, onProperties, ignoreProperties) {\n if (!ignoreProperties || ignoreProperties.length === 0) {\n return onProperties;\n }\n const tip = ignoreProperties.filter(ip => ip.target === target);\n if (!tip || tip.length === 0) {\n return onProperties;\n }\n const targetIgnoreProperties = tip[0].ignoreProperties;\n return onProperties.filter(op => targetIgnoreProperties.indexOf(op) === -1);\n}\nfunction patchFilteredProperties(target, onProperties, ignoreProperties, prototype) {\n // check whether target is available, sometimes target will be undefined\n // because different browser or some 3rd party plugin.\n if (!target) {\n return;\n }\n const filteredProperties = filterProperties(target, onProperties, ignoreProperties);\n patchOnProperties(target, filteredProperties, prototype);\n}\n/**\n * Get all event name properties which the event name startsWith `on`\n * from the target object itself, inherited properties are not considered.\n */\nfunction getOnEventNames(target) {\n return Object.getOwnPropertyNames(target)\n .filter(name => name.startsWith('on') && name.length > 2)\n .map(name => name.substring(2));\n}\nfunction propertyDescriptorPatch(api, _global) {\n if (isNode && !isMix) {\n return;\n }\n if (Zone[api.symbol('patchEvents')]) {\n // events are already been patched by legacy patch.\n return;\n }\n const ignoreProperties = _global['__Zone_ignore_on_properties'];\n // for browsers that we can patch the descriptor: Chrome & Firefox\n let patchTargets = [];\n if (isBrowser) {\n const internalWindow = window;\n patchTargets = patchTargets.concat([\n 'Document', 'SVGElement', 'Element', 'HTMLElement', 'HTMLBodyElement', 'HTMLMediaElement',\n 'HTMLFrameSetElement', 'HTMLFrameElement', 'HTMLIFrameElement', 'HTMLMarqueeElement', 'Worker'\n ]);\n const ignoreErrorProperties = isIE() ? [{ target: internalWindow, ignoreProperties: ['error'] }] : [];\n // in IE/Edge, onProp not exist in window object, but in WindowPrototype\n // so we need to pass WindowPrototype to check onProp exist or not\n patchFilteredProperties(internalWindow, getOnEventNames(internalWindow), ignoreProperties ? ignoreProperties.concat(ignoreErrorProperties) : ignoreProperties, ObjectGetPrototypeOf(internalWindow));\n }\n patchTargets = patchTargets.concat([\n 'XMLHttpRequest', 'XMLHttpRequestEventTarget', 'IDBIndex', 'IDBRequest', 'IDBOpenDBRequest',\n 'IDBDatabase', 'IDBTransaction', 'IDBCursor', 'WebSocket'\n ]);\n for (let i = 0; i < patchTargets.length; i++) {\n const target = _global[patchTargets[i]];\n target && target.prototype &&\n patchFilteredProperties(target.prototype, getOnEventNames(target.prototype), ignoreProperties);\n }\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nZone.__load_patch('util', (global, Zone, api) => {\n // Collect native event names by looking at properties\n // on the global namespace, e.g. 'onclick'.\n const eventNames = getOnEventNames(global);\n api.patchOnProperties = patchOnProperties;\n api.patchMethod = patchMethod;\n api.bindArguments = bindArguments;\n api.patchMacroTask = patchMacroTask;\n // In earlier version of zone.js (<0.9.0), we use env name `__zone_symbol__BLACK_LISTED_EVENTS` to\n // define which events will not be patched by `Zone.js`.\n // In newer version (>=0.9.0), we change the env name to `__zone_symbol__UNPATCHED_EVENTS` to keep\n // the name consistent with angular repo.\n // The `__zone_symbol__BLACK_LISTED_EVENTS` is deprecated, but it is still be supported for\n // backwards compatibility.\n const SYMBOL_BLACK_LISTED_EVENTS = Zone.__symbol__('BLACK_LISTED_EVENTS');\n const SYMBOL_UNPATCHED_EVENTS = Zone.__symbol__('UNPATCHED_EVENTS');\n if (global[SYMBOL_UNPATCHED_EVENTS]) {\n global[SYMBOL_BLACK_LISTED_EVENTS] = global[SYMBOL_UNPATCHED_EVENTS];\n }\n if (global[SYMBOL_BLACK_LISTED_EVENTS]) {\n Zone[SYMBOL_BLACK_LISTED_EVENTS] = Zone[SYMBOL_UNPATCHED_EVENTS] =\n global[SYMBOL_BLACK_LISTED_EVENTS];\n }\n api.patchEventPrototype = patchEventPrototype;\n api.patchEventTarget = patchEventTarget;\n api.isIEOrEdge = isIEOrEdge;\n api.ObjectDefineProperty = ObjectDefineProperty;\n api.ObjectGetOwnPropertyDescriptor = ObjectGetOwnPropertyDescriptor;\n api.ObjectCreate = ObjectCreate;\n api.ArraySlice = ArraySlice;\n api.patchClass = patchClass;\n api.wrapWithCurrentZone = wrapWithCurrentZone;\n api.filterProperties = filterProperties;\n api.attachOriginToPatched = attachOriginToPatched;\n api._redefineProperty = Object.defineProperty;\n api.patchCallbacks = patchCallbacks;\n api.getGlobalObjects = () => ({\n globalSources,\n zoneSymbolEventNames,\n eventNames,\n isBrowser,\n isMix,\n isNode,\n TRUE_STR,\n FALSE_STR,\n ZONE_SYMBOL_PREFIX,\n ADD_EVENT_LISTENER_STR,\n REMOVE_EVENT_LISTENER_STR\n });\n});\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nconst taskSymbol = zoneSymbol('zoneTask');\nfunction patchTimer(window, setName, cancelName, nameSuffix) {\n let setNative = null;\n let clearNative = null;\n setName += nameSuffix;\n cancelName += nameSuffix;\n const tasksByHandleId = {};\n function scheduleTask(task) {\n const data = task.data;\n data.args[0] = function () {\n return task.invoke.apply(this, arguments);\n };\n data.handleId = setNative.apply(window, data.args);\n return task;\n }\n function clearTask(task) {\n return clearNative.call(window, task.data.handleId);\n }\n setNative =\n patchMethod(window, setName, (delegate) => function (self, args) {\n if (typeof args[0] === 'function') {\n const options = {\n isPeriodic: nameSuffix === 'Interval',\n delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 :\n undefined,\n args: args\n };\n const callback = args[0];\n args[0] = function timer() {\n try {\n return callback.apply(this, arguments);\n }\n finally {\n // issue-934, task will be cancelled\n // even it is a periodic task such as\n // setInterval\n // https://github.com/angular/angular/issues/40387\n // Cleanup tasksByHandleId should be handled before scheduleTask\n // Since some zoneSpec may intercept and doesn't trigger\n // scheduleFn(scheduleTask) provided here.\n if (!(options.isPeriodic)) {\n if (typeof options.handleId === 'number') {\n // in non-nodejs env, we remove timerId\n // from local cache\n delete tasksByHandleId[options.handleId];\n }\n else if (options.handleId) {\n // Node returns complex objects as handleIds\n // we remove task reference from timer object\n options.handleId[taskSymbol] = null;\n }\n }\n }\n };\n const task = scheduleMacroTaskWithCurrentZone(setName, args[0], options, scheduleTask, clearTask);\n if (!task) {\n return task;\n }\n // Node.js must additionally support the ref and unref functions.\n const handle = task.data.handleId;\n if (typeof handle === 'number') {\n // for non nodejs env, we save handleId: task\n // mapping in local cache for clearTimeout\n tasksByHandleId[handle] = task;\n }\n else if (handle) {\n // for nodejs env, we save task\n // reference in timerId Object for clearTimeout\n handle[taskSymbol] = task;\n }\n // check whether handle is null, because some polyfill or browser\n // may return undefined from setTimeout/setInterval/setImmediate/requestAnimationFrame\n if (handle && handle.ref && handle.unref && typeof handle.ref === 'function' &&\n typeof handle.unref === 'function') {\n task.ref = handle.ref.bind(handle);\n task.unref = handle.unref.bind(handle);\n }\n if (typeof handle === 'number' || handle) {\n return handle;\n }\n return task;\n }\n else {\n // cause an error by calling it directly.\n return delegate.apply(window, args);\n }\n });\n clearNative =\n patchMethod(window, cancelName, (delegate) => function (self, args) {\n const id = args[0];\n let task;\n if (typeof id === 'number') {\n // non nodejs env.\n task = tasksByHandleId[id];\n }\n else {\n // nodejs env.\n task = id && id[taskSymbol];\n // other environments.\n if (!task) {\n task = id;\n }\n }\n if (task && typeof task.type === 'string') {\n if (task.state !== 'notScheduled' &&\n (task.cancelFn && task.data.isPeriodic || task.runCount === 0)) {\n if (typeof id === 'number') {\n delete tasksByHandleId[id];\n }\n else if (id) {\n id[taskSymbol] = null;\n }\n // Do not cancel already canceled functions\n task.zone.cancelTask(task);\n }\n }\n else {\n // cause an error by calling it directly.\n delegate.apply(window, args);\n }\n });\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction patchCustomElements(_global, api) {\n const { isBrowser, isMix } = api.getGlobalObjects();\n if ((!isBrowser && !isMix) || !_global['customElements'] || !('customElements' in _global)) {\n return;\n }\n const callbacks = ['connectedCallback', 'disconnectedCallback', 'adoptedCallback', 'attributeChangedCallback'];\n api.patchCallbacks(api, _global.customElements, 'customElements', 'define', callbacks);\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nfunction eventTargetPatch(_global, api) {\n if (Zone[api.symbol('patchEventTarget')]) {\n // EventTarget is already patched.\n return;\n }\n const { eventNames, zoneSymbolEventNames, TRUE_STR, FALSE_STR, ZONE_SYMBOL_PREFIX } = api.getGlobalObjects();\n // predefine all __zone_symbol__ + eventName + true/false string\n for (let i = 0; i < eventNames.length; i++) {\n const eventName = eventNames[i];\n const falseEventName = eventName + FALSE_STR;\n const trueEventName = eventName + TRUE_STR;\n const symbol = ZONE_SYMBOL_PREFIX + falseEventName;\n const symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;\n zoneSymbolEventNames[eventName] = {};\n zoneSymbolEventNames[eventName][FALSE_STR] = symbol;\n zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture;\n }\n const EVENT_TARGET = _global['EventTarget'];\n if (!EVENT_TARGET || !EVENT_TARGET.prototype) {\n return;\n }\n api.patchEventTarget(_global, api, [EVENT_TARGET && EVENT_TARGET.prototype]);\n return true;\n}\nfunction patchEvent(global, api) {\n api.patchEventPrototype(global, api);\n}\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nZone.__load_patch('legacy', (global) => {\n const legacyPatch = global[Zone.__symbol__('legacyPatch')];\n if (legacyPatch) {\n legacyPatch();\n }\n});\nZone.__load_patch('queueMicrotask', (global, Zone, api) => {\n api.patchMethod(global, 'queueMicrotask', delegate => {\n return function (self, args) {\n Zone.current.scheduleMicroTask('queueMicrotask', args[0]);\n };\n });\n});\nZone.__load_patch('timers', (global) => {\n const set = 'set';\n const clear = 'clear';\n patchTimer(global, set, clear, 'Timeout');\n patchTimer(global, set, clear, 'Interval');\n patchTimer(global, set, clear, 'Immediate');\n});\nZone.__load_patch('requestAnimationFrame', (global) => {\n patchTimer(global, 'request', 'cancel', 'AnimationFrame');\n patchTimer(global, 'mozRequest', 'mozCancel', 'AnimationFrame');\n patchTimer(global, 'webkitRequest', 'webkitCancel', 'AnimationFrame');\n});\nZone.__load_patch('blocking', (global, Zone) => {\n const blockingMethods = ['alert', 'prompt', 'confirm'];\n for (let i = 0; i < blockingMethods.length; i++) {\n const name = blockingMethods[i];\n patchMethod(global, name, (delegate, symbol, name) => {\n return function (s, args) {\n return Zone.current.run(delegate, global, args, name);\n };\n });\n }\n});\nZone.__load_patch('EventTarget', (global, Zone, api) => {\n patchEvent(global, api);\n eventTargetPatch(global, api);\n // patch XMLHttpRequestEventTarget's addEventListener/removeEventListener\n const XMLHttpRequestEventTarget = global['XMLHttpRequestEventTarget'];\n if (XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype) {\n api.patchEventTarget(global, api, [XMLHttpRequestEventTarget.prototype]);\n }\n});\nZone.__load_patch('MutationObserver', (global, Zone, api) => {\n patchClass('MutationObserver');\n patchClass('WebKitMutationObserver');\n});\nZone.__load_patch('IntersectionObserver', (global, Zone, api) => {\n patchClass('IntersectionObserver');\n});\nZone.__load_patch('FileReader', (global, Zone, api) => {\n patchClass('FileReader');\n});\nZone.__load_patch('on_property', (global, Zone, api) => {\n propertyDescriptorPatch(api, global);\n});\nZone.__load_patch('customElements', (global, Zone, api) => {\n patchCustomElements(global, api);\n});\nZone.__load_patch('XHR', (global, Zone) => {\n // Treat XMLHttpRequest as a macrotask.\n patchXHR(global);\n const XHR_TASK = zoneSymbol('xhrTask');\n const XHR_SYNC = zoneSymbol('xhrSync');\n const XHR_LISTENER = zoneSymbol('xhrListener');\n const XHR_SCHEDULED = zoneSymbol('xhrScheduled');\n const XHR_URL = zoneSymbol('xhrURL');\n const XHR_ERROR_BEFORE_SCHEDULED = zoneSymbol('xhrErrorBeforeScheduled');\n function patchXHR(window) {\n const XMLHttpRequest = window['XMLHttpRequest'];\n if (!XMLHttpRequest) {\n // XMLHttpRequest is not available in service worker\n return;\n }\n const XMLHttpRequestPrototype = XMLHttpRequest.prototype;\n function findPendingTask(target) {\n return target[XHR_TASK];\n }\n let oriAddListener = XMLHttpRequestPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n let oriRemoveListener = XMLHttpRequestPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n if (!oriAddListener) {\n const XMLHttpRequestEventTarget = window['XMLHttpRequestEventTarget'];\n if (XMLHttpRequestEventTarget) {\n const XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget.prototype;\n oriAddListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n oriRemoveListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n }\n }\n const READY_STATE_CHANGE = 'readystatechange';\n const SCHEDULED = 'scheduled';\n function scheduleTask(task) {\n const data = task.data;\n const target = data.target;\n target[XHR_SCHEDULED] = false;\n target[XHR_ERROR_BEFORE_SCHEDULED] = false;\n // remove existing event listener\n const listener = target[XHR_LISTENER];\n if (!oriAddListener) {\n oriAddListener = target[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n oriRemoveListener = target[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n }\n if (listener) {\n oriRemoveListener.call(target, READY_STATE_CHANGE, listener);\n }\n const newListener = target[XHR_LISTENER] = () => {\n if (target.readyState === target.DONE) {\n // sometimes on some browsers XMLHttpRequest will fire onreadystatechange with\n // readyState=4 multiple times, so we need to check task state here\n if (!data.aborted && target[XHR_SCHEDULED] && task.state === SCHEDULED) {\n // check whether the xhr has registered onload listener\n // if that is the case, the task should invoke after all\n // onload listeners finish.\n // Also if the request failed without response (status = 0), the load event handler\n // will not be triggered, in that case, we should also invoke the placeholder callback\n // to close the XMLHttpRequest::send macroTask.\n // https://github.com/angular/angular/issues/38795\n const loadTasks = target[Zone.__symbol__('loadfalse')];\n if (target.status !== 0 && loadTasks && loadTasks.length > 0) {\n const oriInvoke = task.invoke;\n task.invoke = function () {\n // need to load the tasks again, because in other\n // load listener, they may remove themselves\n const loadTasks = target[Zone.__symbol__('loadfalse')];\n for (let i = 0; i < loadTasks.length; i++) {\n if (loadTasks[i] === task) {\n loadTasks.splice(i, 1);\n }\n }\n if (!data.aborted && task.state === SCHEDULED) {\n oriInvoke.call(task);\n }\n };\n loadTasks.push(task);\n }\n else {\n task.invoke();\n }\n }\n else if (!data.aborted && target[XHR_SCHEDULED] === false) {\n // error occurs when xhr.send()\n target[XHR_ERROR_BEFORE_SCHEDULED] = true;\n }\n }\n };\n oriAddListener.call(target, READY_STATE_CHANGE, newListener);\n const storedTask = target[XHR_TASK];\n if (!storedTask) {\n target[XHR_TASK] = task;\n }\n sendNative.apply(target, data.args);\n target[XHR_SCHEDULED] = true;\n return task;\n }\n function placeholderCallback() { }\n function clearTask(task) {\n const data = task.data;\n // Note - ideally, we would call data.target.removeEventListener here, but it's too late\n // to prevent it from firing. So instead, we store info for the event listener.\n data.aborted = true;\n return abortNative.apply(data.target, data.args);\n }\n const openNative = patchMethod(XMLHttpRequestPrototype, 'open', () => function (self, args) {\n self[XHR_SYNC] = args[2] == false;\n self[XHR_URL] = args[1];\n return openNative.apply(self, args);\n });\n const XMLHTTPREQUEST_SOURCE = 'XMLHttpRequest.send';\n const fetchTaskAborting = zoneSymbol('fetchTaskAborting');\n const fetchTaskScheduling = zoneSymbol('fetchTaskScheduling');\n const sendNative = patchMethod(XMLHttpRequestPrototype, 'send', () => function (self, args) {\n if (Zone.current[fetchTaskScheduling] === true) {\n // a fetch is scheduling, so we are using xhr to polyfill fetch\n // and because we already schedule macroTask for fetch, we should\n // not schedule a macroTask for xhr again\n return sendNative.apply(self, args);\n }\n if (self[XHR_SYNC]) {\n // if the XHR is sync there is no task to schedule, just execute the code.\n return sendNative.apply(self, args);\n }\n else {\n const options = { target: self, url: self[XHR_URL], isPeriodic: false, args: args, aborted: false };\n const task = scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);\n if (self && self[XHR_ERROR_BEFORE_SCHEDULED] === true && !options.aborted &&\n task.state === SCHEDULED) {\n // xhr request throw error when send\n // we should invoke task instead of leaving a scheduled\n // pending macroTask\n task.invoke();\n }\n }\n });\n const abortNative = patchMethod(XMLHttpRequestPrototype, 'abort', () => function (self, args) {\n const task = findPendingTask(self);\n if (task && typeof task.type == 'string') {\n // If the XHR has already completed, do nothing.\n // If the XHR has already been aborted, do nothing.\n // Fix #569, call abort multiple times before done will cause\n // macroTask task count be negative number\n if (task.cancelFn == null || (task.data && task.data.aborted)) {\n return;\n }\n task.zone.cancelTask(task);\n }\n else if (Zone.current[fetchTaskAborting] === true) {\n // the abort is called from fetch polyfill, we need to call native abort of XHR.\n return abortNative.apply(self, args);\n }\n // Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no\n // task\n // to cancel. Do nothing.\n });\n }\n});\nZone.__load_patch('geolocation', (global) => {\n /// GEO_LOCATION\n if (global['navigator'] && global['navigator'].geolocation) {\n patchPrototype(global['navigator'].geolocation, ['getCurrentPosition', 'watchPosition']);\n }\n});\nZone.__load_patch('PromiseRejectionEvent', (global, Zone) => {\n // handle unhandled promise rejection\n function findPromiseRejectionHandler(evtName) {\n return function (e) {\n const eventTasks = findEventTasks(global, evtName);\n eventTasks.forEach(eventTask => {\n // windows has added unhandledrejection event listener\n // trigger the event listener\n const PromiseRejectionEvent = global['PromiseRejectionEvent'];\n if (PromiseRejectionEvent) {\n const evt = new PromiseRejectionEvent(evtName, { promise: e.promise, reason: e.rejection });\n eventTask.invoke(evt);\n }\n });\n };\n }\n if (global['PromiseRejectionEvent']) {\n Zone[zoneSymbol('unhandledPromiseRejectionHandler')] =\n findPromiseRejectionHandler('unhandledrejection');\n Zone[zoneSymbol('rejectionHandledHandler')] =\n findPromiseRejectionHandler('rejectionhandled');\n }\n});\n"],"names":["global","performance","mark","name","performanceMeasure","label","symbolPrefix","__symbol__","checkDuplicate","Error","Zone","constructor","parent","zoneSpec","_parent","_name","_properties","properties","_zoneDelegate","_ZoneDelegate","assertZonePatched","patches","root","zone","current","_currentZoneFrame","currentTask","_currentTask","__load_patch","fn","ignoreDuplicate","hasOwnProperty","perfName","_api","get","key","getZoneWith","fork","wrap","callback","source","_callback","intercept","runGuarded","arguments","run","applyThis","applyArgs","invoke","error","handleError","runTask","task","NO_ZONE","state","notScheduled","type","eventTask","macroTask","reEntryGuard","running","_transitionTo","scheduled","runCount","previousTask","data","isPeriodic","cancelFn","undefined","invokeTask","unknown","_updateTaskCount","scheduleTask","newZone","scheduling","zoneDelegates","_zoneDelegates","_zone","err","scheduleMicroTask","customSchedule","ZoneTask","microTask","scheduleMacroTask","customCancel","scheduleEventTask","cancelTask","canceling","count","i","length","DELEGATE_ZS","onHasTask","delegate","_","target","hasTaskState","hasTask","onScheduleTask","onInvokeTask","onCancelTask","parentDelegate","_taskCounts","_parentDelegate","_forkZS","onFork","_forkDlgt","_forkCurrZone","_interceptZS","onIntercept","_interceptDlgt","_interceptCurrZone","_invokeZS","onInvoke","_invokeDlgt","_invokeCurrZone","_handleErrorZS","onHandleError","_handleErrorDlgt","_handleErrorCurrZone","_scheduleTaskZS","_scheduleTaskDlgt","_scheduleTaskCurrZone","_invokeTaskZS","_invokeTaskDlgt","_invokeTaskCurrZone","_cancelTaskZS","_cancelTaskDlgt","_cancelTaskCurrZone","_hasTaskZS","_hasTaskDlgt","_hasTaskDlgtOwner","_hasTaskCurrZone","zoneSpecHasTask","parentHasTask","targetZone","apply","returnTask","push","scheduleFn","value","isEmpty","counts","prev","next","change","options","_state","self","useG","call","args","_numberOfNestedTaskFrames","drainMicroTaskQueue","cancelScheduleRequest","toState","fromState1","fromState2","toString","handleId","Object","prototype","toJSON","symbolSetTimeout","symbolPromise","symbolThen","_microTaskQueue","_isDrainingMicrotaskQueue","nativeMicroTaskQueuePromise","nativeScheduleMicroTask","func","resolve","nativeThen","queue","onUnhandledError","microtaskDrainDone","symbol","currentZoneFrame","noop","showUncaughtError","patchEventTarget","patchOnProperties","patchMethod","bindArguments","patchThen","patchMacroTask","patchEventPrototype","isIEOrEdge","getGlobalObjects","ObjectDefineProperty","ObjectGetOwnPropertyDescriptor","ObjectCreate","ArraySlice","patchClass","wrapWithCurrentZone","filterProperties","attachOriginToPatched","_redefineProperty","patchCallbacks","window","getOwnPropertyDescriptor","defineProperty","ObjectGetPrototypeOf","getPrototypeOf","create","Array","slice","ADD_EVENT_LISTENER_STR","REMOVE_EVENT_LISTENER_STR","ZONE_SYMBOL_ADD_EVENT_LISTENER","ZONE_SYMBOL_REMOVE_EVENT_LISTENER","TRUE_STR","FALSE_STR","ZONE_SYMBOL_PREFIX","scheduleMacroTaskWithCurrentZone","zoneSymbol","isWindowExists","internalWindow","_global","REMOVE_ATTRIBUTE","patchPrototype","fnNames","prototypeDesc","isPropertyWritable","patched","propertyDesc","writable","set","isWebWorker","WorkerGlobalScope","isNode","process","isBrowser","isMix","zoneSymbolEventNames$1","wrapFn","event","eventNameSymbol","listener","result","errorEvent","message","filename","lineno","colno","preventDefault","patchProperty","obj","prop","desc","enumerable","configurable","onPropPatchedSymbol","originalDescGet","originalDescSet","eventName","newValue","previousValue","removeEventListener","addEventListener","removeAttribute","onProperties","j","originalInstanceKey","className","OriginalClass","a","instance","patchFn","proto","delegateName","patchDelegate","funcName","metaCreator","setNative","cbIdx","meta","original","isDetectedIEOrEdge","ieOrEdge","isIE","ua","navigator","userAgent","indexOf","api","readableObjectToString","JSON","stringify","_uncaughtPromiseErrors","isDisableWrappingUncaughtPromiseRejection","creationTrace","e","rejection","console","stack","uncaughtPromiseError","shift","throwOriginal","handleUnhandledRejection","UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL","handler","isThenable","then","forwardResolution","forwardRejection","ZoneAwarePromise","reject","symbolState","symbolValue","symbolFinally","symbolParentPromiseValue","symbolParentPromiseState","UNRESOLVED","RESOLVED","REJECTED","REJECTED_NO_CATCH","makeResolver","promise","v","resolvePromise","once","wasCalled","wrapper","wrappedFunction","TYPE_ERROR","CURRENT_TASK_TRACE_SYMBOL","onceWrapper","TypeError","clearRejectedNoCatch","trace","scheduleResolveOrReject","REJECTION_HANDLED_HANDLER","splice","chainPromise","onFulfilled","onRejected","promiseState","parentPromiseValue","isFinallyPromise","ZONE_AWARE_PROMISE_TO_STRING","AggregateError","any","values","Symbol","iterator","Promise","promises","finished","errors","race","res","rej","onResolve","onReject","all","allWithCallback","allSettled","P","thenCallback","status","errorCallback","reason","unresolvedCount","valueIndex","resolvedValues","curValueIndex","thenErr","executor","toStringTag","species","_a","C","catch","finally","onFinally","NativePromise","symbolThenPatched","Ctor","originalThen","wrapped","zoneify","resultPromise","ctor","originalFunctionToString","Function","ORIGINAL_DELEGATE_SYMBOL","PROMISE_SYMBOL","ERROR_SYMBOL","newFunctionToString","originalDelegate","nativePromise","nativeError","originalObjectToString","PROMISE_OBJECT_TO_STRING","passiveSupported","OPTIMIZED_ZONE_EVENT_TASK_DATA","zoneSymbolEventNames","globalSources","EVENT_NAME_SYMBOL_REGX","RegExp","IMMEDIATE_PROPAGATION_SYMBOL","prepareEventNames","eventNameToString","falseEventName","trueEventName","symbolCapture","apis","patchOptions","ADD_EVENT_LISTENER","add","REMOVE_EVENT_LISTENER","rm","LISTENERS_EVENT_LISTENER","listeners","REMOVE_ALL_LISTENERS_EVENT_LISTENER","rmAll","zoneSymbolAddEventListener","ADD_EVENT_LISTENER_SOURCE","PREPEND_EVENT_LISTENER","PREPEND_EVENT_LISTENER_SOURCE","isRemoved","handleEvent","globalCallback","context","isCapture","tasks","copyTasks","globalZoneAwareCallback","globalZoneAwareCaptureCallback","patchEventTargetMethods","useGlobalCallback","validateHandler","vh","chkDup","returnTarget","rt","taskData","nativeAddEventListener","nativeRemoveEventListener","nativeListeners","nativeRemoveAllListeners","nativePrependEventListener","prepend","buildEventListenerOptions","passive","capture","assign","customScheduleGlobal","isExisting","customCancelGlobal","symbolEventNames","symbolEventName","existingTasks","existingTask","allRemoved","customScheduleNonGlobal","customSchedulePrepend","customCancelNonGlobal","compareTaskCallbackVsDelegate","typeOfDelegate","compare","diff","unpatchedEvents","passiveEvents","makeAddListener","nativeListener","addSource","customScheduleFn","customCancelFn","transferEventName","isHandleEvent","constructorName","targetSource","unshift","onPropertySymbol","findEventTasks","keys","match","exec","evtName","symbolCaptureEventName","captureTasks","removeTasks","results","foundTasks","captureFalseTasks","captureTrueTasks","concat","Event","targetName","method","callbacks","nativeDelegate","opts","forEach","descriptor","ignoreProperties","tip","filter","ip","targetIgnoreProperties","op","patchFilteredProperties","filteredProperties","getOnEventNames","getOwnPropertyNames","startsWith","map","substring","propertyDescriptorPatch","patchTargets","ignoreErrorProperties","eventNames","SYMBOL_BLACK_LISTED_EVENTS","SYMBOL_UNPATCHED_EVENTS","taskSymbol","patchTimer","setName","cancelName","nameSuffix","clearNative","tasksByHandleId","clearTask","delay","timer","handle","ref","unref","bind","id","patchCustomElements","customElements","eventTargetPatch","EVENT_TARGET","patchEvent","legacyPatch","clear","blockingMethods","s","XMLHttpRequestEventTarget","patchXHR","XHR_TASK","XHR_SYNC","XHR_LISTENER","XHR_SCHEDULED","XHR_URL","XHR_ERROR_BEFORE_SCHEDULED","XMLHttpRequest","XMLHttpRequestPrototype","findPendingTask","oriAddListener","oriRemoveListener","XMLHttpRequestEventTargetPrototype","READY_STATE_CHANGE","SCHEDULED","newListener","readyState","DONE","aborted","loadTasks","oriInvoke","storedTask","sendNative","placeholderCallback","abortNative","openNative","XMLHTTPREQUEST_SOURCE","fetchTaskAborting","fetchTaskScheduling","url","geolocation","findPromiseRejectionHandler","eventTasks","PromiseRejectionEvent","evt"],"sourceRoot":"webpack:///","x_google_ignoreList":[1]} \ No newline at end of file diff --git a/docs/runtime.js.map b/docs/runtime.js.map index 5dd6a28..36749ca 100644 --- a/docs/runtime.js.map +++ b/docs/runtime.js.map @@ -1 +1 @@ -{"version":3,"file":"runtime.js","mappings":";;;;UAAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA","sources":["webpack/bootstrap","webpack/runtime/chunk loaded","webpack/runtime/compat get default export","webpack/runtime/define property getters","webpack/runtime/hasOwnProperty shorthand","webpack/runtime/make namespace object","webpack/runtime/jsonp chunk loading","webpack/before-startup","webpack/startup","webpack/after-startup"],"sourcesContent":["// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"runtime\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkangular_maze\"] = self[\"webpackChunkangular_maze\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","",""],"names":[],"sourceRoot":"webpack:///"} \ No newline at end of file +{"version":3,"file":"runtime.js","mappings":";;;;UAAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA","sources":["webpack/bootstrap","webpack/runtime/chunk loaded","webpack/runtime/compat get default export","webpack/runtime/define property getters","webpack/runtime/hasOwnProperty shorthand","webpack/runtime/make namespace object","webpack/runtime/jsonp chunk loading","webpack/before-startup","webpack/startup","webpack/after-startup"],"sourcesContent":["// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"runtime\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkangular_maze\"] = self[\"webpackChunkangular_maze\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","",""],"names":[],"sourceRoot":"webpack:///","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]} \ No newline at end of file diff --git a/docs/styles.css b/docs/styles.css index 8c89725..cc70f2a 100644 --- a/docs/styles.css +++ b/docs/styles.css @@ -1,6 +1,6 @@ -/*!********************************************************************************************************************************************************************************************************!*\ - !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].rules[0].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].rules[0].oneOf[0].use[2]!./src/styles.css ***! - \********************************************************************************************************************************************************************************************************/ +/*!**********************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].rules[0].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].rules[0].oneOf[0].use[2]!./src/styles.css?ngGlobalStyle ***! + \**********************************************************************************************************************************************************************************************************************/ /* You can add global styles to this file, and also import other style files */ diff --git a/docs/styles.css.map b/docs/styles.css.map index 7e7be0c..60b9f8f 100644 --- a/docs/styles.css.map +++ b/docs/styles.css.map @@ -1 +1 @@ -{"version":3,"file":"styles.css","mappings":";;;AAAA,8EAA8E","sources":["./src/styles.css"],"sourcesContent":["/* You can add global styles to this file, and also import other style files */\r\n"],"names":[],"sourceRoot":"webpack:///"} \ No newline at end of file +{"version":3,"file":"styles.css","mappings":";;;AAAA,8EAA8E","sources":["./src/styles.css"],"sourcesContent":["/* You can add global styles to this file, and also import other style files */\r\n"],"names":[],"sourceRoot":"webpack:///","x_google_ignoreList":[]} \ No newline at end of file diff --git a/docs/vendor.js b/docs/vendor.js index 9a0bf10..c3510fa 100644 --- a/docs/vendor.js +++ b/docs/vendor.js @@ -18,38 +18,29 @@ class BehaviorSubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__.Subject { super(); this._value = _value; } - get value() { return this.getValue(); } - _subscribe(subscriber) { const subscription = super._subscribe(subscriber); - !subscription.closed && subscriber.next(this._value); return subscription; } - getValue() { const { hasError, thrownError, _value } = this; - if (hasError) { throw thrownError; } - this._throwIfClosed(); - return _value; } - next(value) { super.next(this._value = value); } - } /***/ }), @@ -114,14 +105,12 @@ class Observable { this._subscribe = subscribe; } } - lift(operator) { const observable = new Observable(); observable.source = this; observable.operator = operator; return observable; } - subscribe(observerOrNext, error, complete) { const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new _Subscriber__WEBPACK_IMPORTED_MODULE_0__.SafeSubscriber(observerOrNext, error, complete); (0,_util_errorContext__WEBPACK_IMPORTED_MODULE_1__.errorContext)(() => { @@ -133,7 +122,6 @@ class Observable { }); return subscriber; } - _trySubscribe(sink) { try { return this._subscribe(sink); @@ -141,7 +129,6 @@ class Observable { sink.error(err); } } - forEach(next, promiseCtor) { promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor((resolve, reject) => { @@ -160,21 +147,16 @@ class Observable { this.subscribe(subscriber); }); } - _subscribe(subscriber) { var _a; - return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber); } - [_symbol_observable__WEBPACK_IMPORTED_MODULE_2__.observable]() { return this; } - pipe(...operations) { return (0,_util_pipe__WEBPACK_IMPORTED_MODULE_3__.pipeFromArray)(operations)(this); } - toPromise(promiseCtor) { promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor((resolve, reject) => { @@ -182,23 +164,17 @@ class Observable { this.subscribe(x => value = x, err => reject(err), () => resolve(value)); }); } - } - Observable.create = subscribe => { return new Observable(subscribe); }; - function getPromiseCtor(promiseCtor) { var _a; - return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : _config__WEBPACK_IMPORTED_MODULE_4__.config.Promise) !== null && _a !== void 0 ? _a : Promise; } - function isObserver(value) { return value && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_5__.isFunction)(value.next) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_5__.isFunction)(value.error) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_5__.isFunction)(value.complete); } - function isSubscriber(value) { return value && value instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber || isObserver(value) && (0,_Subscription__WEBPACK_IMPORTED_MODULE_6__.isSubscription)(value); } @@ -231,7 +207,6 @@ class ReplaySubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__.Subject { this._bufferSize = Math.max(1, _bufferSize); this._windowTime = Math.max(1, _windowTime); } - next(value) { const { isStopped, @@ -240,41 +215,28 @@ class ReplaySubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__.Subject { _timestampProvider, _windowTime } = this; - if (!isStopped) { _buffer.push(value); - !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime); } - this._trimBuffer(); - super.next(value); } - _subscribe(subscriber) { this._throwIfClosed(); - this._trimBuffer(); - const subscription = this._innerSubscribe(subscriber); - const { _infiniteTimeWindow, _buffer } = this; - const copy = _buffer.slice(); - for (let i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) { subscriber.next(copy[i]); } - this._checkFinalizedStatuses(subscriber); - return subscription; } - _trimBuffer() { const { _bufferSize, @@ -284,20 +246,15 @@ class ReplaySubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__.Subject { } = this; const adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize; _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize); - if (!_infiniteTimeWindow) { const now = _timestampProvider.now(); - let last = 0; - for (let i = 1; i < _buffer.length && _buffer[i] <= now; i += 2) { last = i; } - last && _buffer.splice(0, last + 1); } } - } /***/ }), @@ -319,11 +276,9 @@ class Scheduler { this.schedulerActionCtor = schedulerActionCtor; this.now = now; } - schedule(work, delay = 0, state) { return new this.schedulerActionCtor(this, work).schedule(state, delay); } - } Scheduler.now = _scheduler_dateTimestampProvider__WEBPACK_IMPORTED_MODULE_0__.dateTimestampProvider.now; @@ -360,106 +315,84 @@ class Subject extends _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable { this.hasError = false; this.thrownError = null; } - lift(operator) { const subject = new AnonymousSubject(this, this); subject.operator = operator; return subject; } - _throwIfClosed() { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_1__.ObjectUnsubscribedError(); } } - next(value) { (0,_util_errorContext__WEBPACK_IMPORTED_MODULE_2__.errorContext)(() => { this._throwIfClosed(); - if (!this.isStopped) { if (!this.currentObservers) { this.currentObservers = Array.from(this.observers); } - for (const observer of this.currentObservers) { observer.next(value); } } }); } - error(err) { (0,_util_errorContext__WEBPACK_IMPORTED_MODULE_2__.errorContext)(() => { this._throwIfClosed(); - if (!this.isStopped) { this.hasError = this.isStopped = true; this.thrownError = err; const { observers } = this; - while (observers.length) { observers.shift().error(err); } } }); } - complete() { (0,_util_errorContext__WEBPACK_IMPORTED_MODULE_2__.errorContext)(() => { this._throwIfClosed(); - if (!this.isStopped) { this.isStopped = true; const { observers } = this; - while (observers.length) { observers.shift().complete(); } } }); } - unsubscribe() { this.isStopped = this.closed = true; this.observers = this.currentObservers = null; } - get observed() { var _a; - return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0; } - _trySubscribe(subscriber) { this._throwIfClosed(); - return super._trySubscribe(subscriber); } - _subscribe(subscriber) { this._throwIfClosed(); - this._checkFinalizedStatuses(subscriber); - return this._innerSubscribe(subscriber); } - _innerSubscribe(subscriber) { const { hasError, isStopped, observers } = this; - if (hasError || isStopped) { return _Subscription__WEBPACK_IMPORTED_MODULE_3__.EMPTY_SUBSCRIPTION; } - this.currentObservers = null; observers.push(subscriber); return new _Subscription__WEBPACK_IMPORTED_MODULE_3__.Subscription(() => { @@ -467,64 +400,49 @@ class Subject extends _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable { (0,_util_arrRemove__WEBPACK_IMPORTED_MODULE_4__.arrRemove)(observers, subscriber); }); } - _checkFinalizedStatuses(subscriber) { const { hasError, thrownError, isStopped } = this; - if (hasError) { subscriber.error(thrownError); } else if (isStopped) { subscriber.complete(); } } - asObservable() { const observable = new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(); observable.source = this; return observable; } - } - Subject.create = (destination, source) => { return new AnonymousSubject(destination, source); }; - class AnonymousSubject extends Subject { constructor(destination, source) { super(); this.destination = destination; this.source = source; } - next(value) { var _a, _b; - (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value); } - error(err) { var _a, _b; - (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err); } - complete() { var _a, _b; - (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a); } - _subscribe(subscriber) { var _a, _b; - return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : _Subscription__WEBPACK_IMPORTED_MODULE_3__.EMPTY_SUBSCRIPTION; } - } /***/ }), @@ -561,10 +479,8 @@ class Subscriber extends _Subscription__WEBPACK_IMPORTED_MODULE_0__.Subscription constructor(destination) { super(); this.isStopped = false; - if (destination) { this.destination = destination; - if ((0,_Subscription__WEBPACK_IMPORTED_MODULE_0__.isSubscription)(destination)) { destination.add(this); } @@ -572,11 +488,9 @@ class Subscriber extends _Subscription__WEBPACK_IMPORTED_MODULE_0__.Subscription this.destination = EMPTY_OBSERVER; } } - static create(next, error, complete) { return new SafeSubscriber(next, error, complete); } - next(value) { if (this.isStopped) { handleStoppedNotification((0,_NotificationFactories__WEBPACK_IMPORTED_MODULE_1__.nextNotification)(value), this); @@ -584,27 +498,22 @@ class Subscriber extends _Subscription__WEBPACK_IMPORTED_MODULE_0__.Subscription this._next(value); } } - error(err) { if (this.isStopped) { handleStoppedNotification((0,_NotificationFactories__WEBPACK_IMPORTED_MODULE_1__.errorNotification)(err), this); } else { this.isStopped = true; - this._error(err); } } - complete() { if (this.isStopped) { handleStoppedNotification(_NotificationFactories__WEBPACK_IMPORTED_MODULE_1__.COMPLETE_NOTIFICATION, this); } else { this.isStopped = true; - this._complete(); } } - unsubscribe() { if (!this.closed) { this.isStopped = true; @@ -612,11 +521,9 @@ class Subscriber extends _Subscription__WEBPACK_IMPORTED_MODULE_0__.Subscription this.destination = null; } } - _next(value) { this.destination.next(value); } - _error(err) { try { this.destination.error(err); @@ -624,7 +531,6 @@ class Subscriber extends _Subscription__WEBPACK_IMPORTED_MODULE_0__.Subscription this.unsubscribe(); } } - _complete() { try { this.destination.complete(); @@ -632,24 +538,19 @@ class Subscriber extends _Subscription__WEBPACK_IMPORTED_MODULE_0__.Subscription this.unsubscribe(); } } - } const _bind = Function.prototype.bind; - function bind(fn, thisArg) { return _bind.call(fn, thisArg); } - class ConsumerObserver { constructor(partialObserver) { this.partialObserver = partialObserver; } - next(value) { const { partialObserver } = this; - if (partialObserver.next) { try { partialObserver.next(value); @@ -658,12 +559,10 @@ class ConsumerObserver { } } } - error(err) { const { partialObserver } = this; - if (partialObserver.error) { try { partialObserver.error(err); @@ -674,12 +573,10 @@ class ConsumerObserver { handleUnhandledError(err); } } - complete() { const { partialObserver } = this; - if (partialObserver.complete) { try { partialObserver.complete(); @@ -688,14 +585,11 @@ class ConsumerObserver { } } } - } - class SafeSubscriber extends Subscriber { constructor(observerOrNext, error, complete) { super(); let partialObserver; - if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_2__.isFunction)(observerOrNext) || !observerOrNext) { partialObserver = { next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined, @@ -704,12 +598,9 @@ class SafeSubscriber extends Subscriber { }; } else { let context; - if (this && _config__WEBPACK_IMPORTED_MODULE_3__.config.useDeprecatedNextContext) { context = Object.create(observerOrNext); - context.unsubscribe = () => this.unsubscribe(); - partialObserver = { next: observerOrNext.next && bind(observerOrNext.next, context), error: observerOrNext.error && bind(observerOrNext.error, context), @@ -719,12 +610,9 @@ class SafeSubscriber extends Subscriber { partialObserver = observerOrNext; } } - this.destination = new ConsumerObserver(partialObserver); } - } - function handleUnhandledError(error) { if (_config__WEBPACK_IMPORTED_MODULE_3__.config.useDeprecatedSynchronousErrorHandling) { (0,_util_errorContext__WEBPACK_IMPORTED_MODULE_4__.captureError)(error); @@ -732,18 +620,15 @@ function handleUnhandledError(error) { (0,_util_reportUnhandledError__WEBPACK_IMPORTED_MODULE_5__.reportUnhandledError)(error); } } - function defaultErrorHandler(err) { throw err; } - function handleStoppedNotification(notification, subscriber) { const { onStoppedNotification } = _config__WEBPACK_IMPORTED_MODULE_3__.config; onStoppedNotification && _scheduler_timeoutProvider__WEBPACK_IMPORTED_MODULE_6__.timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber)); } - const EMPTY_OBSERVER = { closed: true, next: _util_noop__WEBPACK_IMPORTED_MODULE_7__.noop, @@ -778,19 +663,15 @@ class Subscription { this._parentage = null; this._finalizers = null; } - unsubscribe() { let errors; - if (!this.closed) { this.closed = true; const { _parentage } = this; - if (_parentage) { this._parentage = null; - if (Array.isArray(_parentage)) { for (const parent of _parentage) { parent.remove(this); @@ -799,11 +680,9 @@ class Subscription { _parentage.remove(this); } } - const { initialTeardown: initialFinalizer } = this; - if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(initialFinalizer)) { try { initialFinalizer(); @@ -811,20 +690,16 @@ class Subscription { errors = e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError ? e.errors : [e]; } } - const { _finalizers } = this; - if (_finalizers) { this._finalizers = null; - for (const finalizer of _finalizers) { try { execFinalizer(finalizer); } catch (err) { errors = errors !== null && errors !== void 0 ? errors : []; - if (err instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError) { errors = [...errors, ...err.errors]; } else { @@ -833,16 +708,13 @@ class Subscription { } } } - if (errors) { throw new _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError(errors); } } } - add(teardown) { var _a; - if (teardown && teardown !== this) { if (this.closed) { execFinalizer(teardown); @@ -851,65 +723,53 @@ class Subscription { if (teardown.closed || teardown._hasParent(this)) { return; } - teardown._addParent(this); } - (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown); } } } - _hasParent(parent) { const { _parentage } = this; return _parentage === parent || Array.isArray(_parentage) && _parentage.includes(parent); } - _addParent(parent) { const { _parentage } = this; this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent; } - _removeParent(parent) { const { _parentage } = this; - if (_parentage === parent) { this._parentage = null; } else if (Array.isArray(_parentage)) { (0,_util_arrRemove__WEBPACK_IMPORTED_MODULE_2__.arrRemove)(_parentage, parent); } } - remove(teardown) { const { _finalizers } = this; _finalizers && (0,_util_arrRemove__WEBPACK_IMPORTED_MODULE_2__.arrRemove)(_finalizers, teardown); - if (teardown instanceof Subscription) { teardown._removeParent(this); } } - } - Subscription.EMPTY = (() => { const empty = new Subscription(); empty.closed = true; return empty; })(); - const EMPTY_SUBSCRIPTION = Subscription.EMPTY; function isSubscription(value) { return value instanceof Subscription || value && 'closed' in value && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(value.remove) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(value.add) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(value.unsubscribe); } - function execFinalizer(finalizer) { if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(finalizer)) { finalizer(); @@ -968,26 +828,20 @@ class ConnectableObservable extends _Observable__WEBPACK_IMPORTED_MODULE_0__.Obs this._subject = null; this._refCount = 0; this._connection = null; - if ((0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.hasLift)(source)) { this.lift = source.lift; } } - _subscribe(subscriber) { return this.getSubject().subscribe(subscriber); } - getSubject() { const subject = this._subject; - if (!subject || subject.isStopped) { this._subject = this.subjectFactory(); } - return this._subject; } - _teardown() { this._refCount = 0; const { @@ -996,36 +850,28 @@ class ConnectableObservable extends _Observable__WEBPACK_IMPORTED_MODULE_0__.Obs this._subject = this._connection = null; _connection === null || _connection === void 0 ? void 0 : _connection.unsubscribe(); } - connect() { let connection = this._connection; - if (!connection) { connection = this._connection = new _Subscription__WEBPACK_IMPORTED_MODULE_2__.Subscription(); const subject = this.getSubject(); connection.add(this.source.subscribe((0,_operators_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_3__.createOperatorSubscriber)(subject, undefined, () => { this._teardown(); - subject.complete(); }, err => { this._teardown(); - subject.error(err); }, () => this._teardown()))); - if (connection.closed) { this._connection = null; connection = _Subscription__WEBPACK_IMPORTED_MODULE_2__.Subscription.EMPTY; } } - return connection; } - refCount() { return (0,_operators_refCount__WEBPACK_IMPORTED_MODULE_4__.refCount)()(this); } - } /***/ }), @@ -1066,11 +912,9 @@ function combineLatest(...args) { args: observables, keys } = (0,_util_argsArgArrayOrObject__WEBPACK_IMPORTED_MODULE_1__.argsArgArrayOrObject)(args); - if (observables.length === 0) { return (0,_from__WEBPACK_IMPORTED_MODULE_2__.from)([], scheduler); } - const result = new _Observable__WEBPACK_IMPORTED_MODULE_3__.Observable(combineLatestInit(observables, scheduler, keys ? values => (0,_util_createObject__WEBPACK_IMPORTED_MODULE_4__.createObject)(keys, values) : _util_identity__WEBPACK_IMPORTED_MODULE_5__.identity)); return resultSelector ? result.pipe((0,_util_mapOneOrManyArgs__WEBPACK_IMPORTED_MODULE_6__.mapOneOrManyArgs)(resultSelector)) : result; } @@ -1083,19 +927,16 @@ function combineLatestInit(observables, scheduler, valueTransform = _util_identi const values = new Array(length); let active = length; let remainingFirstValues = length; - for (let i = 0; i < length; i++) { maybeSchedule(scheduler, () => { const source = (0,_from__WEBPACK_IMPORTED_MODULE_2__.from)(observables[i], scheduler); let hasFirstValue = false; source.subscribe((0,_operators_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_7__.createOperatorSubscriber)(subscriber, value => { values[i] = value; - if (!hasFirstValue) { hasFirstValue = true; remainingFirstValues--; } - if (!remainingFirstValues) { subscriber.next(valueTransform(values.slice())); } @@ -1109,7 +950,6 @@ function combineLatestInit(observables, scheduler, valueTransform = _util_identi }, subscriber); }; } - function maybeSchedule(scheduler, execute, subscription) { if (scheduler) { (0,_util_executeSchedule__WEBPACK_IMPORTED_MODULE_8__.executeSchedule)(subscription, scheduler, execute); @@ -1181,7 +1021,6 @@ const EMPTY = new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber function empty(scheduler) { return scheduler ? emptyScheduled(scheduler) : EMPTY; } - function emptyScheduled(scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => scheduler.schedule(() => subscriber.complete())); } @@ -1222,16 +1061,13 @@ function forkJoin(...args) { const { length } = sources; - if (!length) { subscriber.complete(); return; } - const values = new Array(length); let remainingCompletions = length; let remainingEmissions = length; - for (let sourceIndex = 0; sourceIndex < length; sourceIndex++) { let hasValue = false; (0,_innerFrom__WEBPACK_IMPORTED_MODULE_3__.innerFrom)(sources[sourceIndex]).subscribe((0,_operators_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_4__.createOperatorSubscriber)(subscriber, value => { @@ -1239,14 +1075,12 @@ function forkJoin(...args) { hasValue = true; remainingEmissions--; } - values[sourceIndex] = value; }, () => remainingCompletions--, undefined, () => { if (!remainingCompletions || !hasValue) { if (!remainingEmissions) { subscriber.next(keys ? (0,_util_createObject__WEBPACK_IMPORTED_MODULE_5__.createObject)(keys, values) : values); } - subscriber.complete(); } })); @@ -1307,43 +1141,33 @@ function fromEvent(target, eventName, options, resultSelector) { resultSelector = options; options = undefined; } - if (resultSelector) { return fromEvent(target, eventName, options).pipe((0,_util_mapOneOrManyArgs__WEBPACK_IMPORTED_MODULE_1__.mapOneOrManyArgs)(resultSelector)); } - const [add, remove] = isEventTarget(target) ? eventTargetMethods.map(methodName => handler => target[methodName](eventName, handler, options)) : isNodeStyleEventEmitter(target) ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName)) : isJQueryStyleEventEmitter(target) ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName)) : []; - if (!add) { if ((0,_util_isArrayLike__WEBPACK_IMPORTED_MODULE_2__.isArrayLike)(target)) { return (0,_operators_mergeMap__WEBPACK_IMPORTED_MODULE_3__.mergeMap)(subTarget => fromEvent(subTarget, eventName, options))((0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_4__.innerFrom)(target)); } } - if (!add) { throw new TypeError('Invalid event target'); } - return new _Observable__WEBPACK_IMPORTED_MODULE_5__.Observable(subscriber => { const handler = (...args) => subscriber.next(1 < args.length ? args : args[0]); - add(handler); return () => remove(handler); }); } - function toCommonHandlerRegistry(target, eventName) { return methodName => handler => target[methodName](eventName, handler); } - function isNodeStyleEventEmitter(target) { return (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(target.addListener) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(target.removeListener); } - function isJQueryStyleEventEmitter(target) { return (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(target.on) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(target.off); } - function isEventTarget(target) { return (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(target.addEventListener) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(target.removeEventListener); } @@ -1394,43 +1218,34 @@ function innerFrom(input) { if (input instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable) { return input; } - if (input != null) { if ((0,_util_isInteropObservable__WEBPACK_IMPORTED_MODULE_1__.isInteropObservable)(input)) { return fromInteropObservable(input); } - if ((0,_util_isArrayLike__WEBPACK_IMPORTED_MODULE_2__.isArrayLike)(input)) { return fromArrayLike(input); } - if ((0,_util_isPromise__WEBPACK_IMPORTED_MODULE_3__.isPromise)(input)) { return fromPromise(input); } - if ((0,_util_isAsyncIterable__WEBPACK_IMPORTED_MODULE_4__.isAsyncIterable)(input)) { return fromAsyncIterable(input); } - if ((0,_util_isIterable__WEBPACK_IMPORTED_MODULE_5__.isIterable)(input)) { return fromIterable(input); } - if ((0,_util_isReadableStreamLike__WEBPACK_IMPORTED_MODULE_6__.isReadableStreamLike)(input)) { return fromReadableStreamLike(input); } } - throw (0,_util_throwUnobservableError__WEBPACK_IMPORTED_MODULE_7__.createInvalidObservableTypeError)(input); } function fromInteropObservable(obj) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { const obs = obj[_symbol_observable__WEBPACK_IMPORTED_MODULE_8__.observable](); - if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_9__.isFunction)(obs.subscribe)) { return obs.subscribe(subscriber); } - throw new TypeError('Provided object does not correctly implement Symbol.observable'); }); } @@ -1439,7 +1254,6 @@ function fromArrayLike(array) { for (let i = 0; i < array.length && !subscriber.closed; i++) { subscriber.next(array[i]); } - subscriber.complete(); }); } @@ -1457,12 +1271,10 @@ function fromIterable(iterable) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { for (const value of iterable) { subscriber.next(value); - if (subscriber.closed) { return; } } - subscriber.complete(); }); } @@ -1474,18 +1286,14 @@ function fromAsyncIterable(asyncIterable) { function fromReadableStreamLike(readableStream) { return fromAsyncIterable((0,_util_isReadableStreamLike__WEBPACK_IMPORTED_MODULE_6__.readableStreamLikeToAsyncGenerator)(readableStream)); } - function process(asyncIterable, subscriber) { var asyncIterable_1, asyncIterable_1_1; - var e_1, _a; - return (0,tslib__WEBPACK_IMPORTED_MODULE_11__.__awaiter)(this, void 0, void 0, function* () { try { for (asyncIterable_1 = (0,tslib__WEBPACK_IMPORTED_MODULE_11__.__asyncValues)(asyncIterable); asyncIterable_1_1 = yield asyncIterable_1.next(), !asyncIterable_1_1.done;) { const value = asyncIterable_1_1.value; subscriber.next(value); - if (subscriber.closed) { return; } @@ -1501,7 +1309,6 @@ function process(asyncIterable, subscriber) { if (e_1) throw e_1.error; } } - subscriber.complete(); }); } @@ -1526,7 +1333,6 @@ function interval(period = 0, scheduler = _scheduler_async__WEBPACK_IMPORTED_MOD if (period < 0) { period = 0; } - return (0,_timer__WEBPACK_IMPORTED_MODULE_1__.timer)(period, period, scheduler); } @@ -1598,9 +1404,7 @@ __webpack_require__.r(__webpack_exports__); function throwError(errorOrErrorFactory, scheduler) { const errorFactory = (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(errorOrErrorFactory) ? errorOrErrorFactory : () => errorOrErrorFactory; - const init = subscriber => subscriber.error(errorFactory()); - return new _Observable__WEBPACK_IMPORTED_MODULE_1__.Observable(scheduler ? subscriber => scheduler.schedule(init, 0, subscriber) : init); } @@ -1626,7 +1430,6 @@ __webpack_require__.r(__webpack_exports__); function timer(dueTime = 0, intervalOrScheduler, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__.async) { let intervalDuration = -1; - if (intervalOrScheduler != null) { if ((0,_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__.isScheduler)(intervalOrScheduler)) { scheduler = intervalOrScheduler; @@ -1634,19 +1437,15 @@ function timer(dueTime = 0, intervalOrScheduler, scheduler = _scheduler_async__W intervalDuration = intervalOrScheduler; } } - return new _Observable__WEBPACK_IMPORTED_MODULE_2__.Observable(subscriber => { let due = (0,_util_isDate__WEBPACK_IMPORTED_MODULE_3__.isValidDate)(dueTime) ? +dueTime - scheduler.now() : dueTime; - if (due < 0) { due = 0; } - let n = 0; return scheduler.schedule(function () { if (!subscriber.closed) { subscriber.next(n++); - if (0 <= intervalDuration) { this.schedule(undefined, intervalDuration); } else { @@ -1706,10 +1505,8 @@ class OperatorSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscr } } : super._complete; } - unsubscribe() { var _a; - if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) { const { closed @@ -1718,7 +1515,6 @@ class OperatorSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscr !closed && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this)); } } - } /***/ }), @@ -1745,30 +1541,24 @@ function audit(durationSelector) { let lastValue = null; let durationSubscriber = null; let isComplete = false; - const endDuration = () => { durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe(); durationSubscriber = null; - if (hasValue) { hasValue = false; const value = lastValue; lastValue = null; subscriber.next(value); } - isComplete && subscriber.complete(); }; - const cleanupDuration = () => { durationSubscriber = null; isComplete && subscriber.complete(); }; - source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, value => { hasValue = true; lastValue = value; - if (!durationSubscriber) { (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_2__.innerFrom)(durationSelector(value)).subscribe(durationSubscriber = (0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, endDuration, cleanupDuration)); } @@ -1826,7 +1616,6 @@ function catchError(selector) { let handledResult; innerSub = source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, undefined, undefined, err => { handledResult = (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_2__.innerFrom)(selector(err, catchError(selector)(source))); - if (innerSub) { innerSub.unsubscribe(); innerSub = null; @@ -1835,7 +1624,6 @@ function catchError(selector) { syncUnsub = true; } })); - if (syncUnsub) { innerSub.unsubscribe(); innerSub = null; @@ -1905,7 +1693,6 @@ function debounceTime(dueTime, scheduler = _scheduler_async__WEBPACK_IMPORTED_MO let activeTask = null; let lastValue = null; let lastTime = null; - const emit = () => { if (activeTask) { activeTask.unsubscribe(); @@ -1915,24 +1702,19 @@ function debounceTime(dueTime, scheduler = _scheduler_async__WEBPACK_IMPORTED_MO subscriber.next(value); } }; - function emitWhenIdle() { const targetTime = lastTime + dueTime; const now = scheduler.now(); - if (now < targetTime) { activeTask = this.schedule(undefined, targetTime - now); subscriber.add(activeTask); return; } - emit(); } - source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, value => { lastValue = value; lastTime = scheduler.now(); - if (!activeTask) { activeTask = scheduler.schedule(emitWhenIdle, dueTime); subscriber.add(activeTask); @@ -1972,7 +1754,6 @@ function defaultIfEmpty(defaultValue) { if (!hasValue) { subscriber.next(defaultValue); } - subscriber.complete(); })); }); @@ -2003,7 +1784,6 @@ function distinctUntilChanged(comparator, keySelector = _util_identity__WEBPACK_ let first = true; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, value => { const currentKey = keySelector(value); - if (first || !comparator(previousKey, currentKey)) { first = false; previousKey = currentKey; @@ -2012,7 +1792,6 @@ function distinctUntilChanged(comparator, keySelector = _util_identity__WEBPACK_ })); }); } - function defaultCompare(a, b) { return a === b; } @@ -2208,22 +1987,18 @@ function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, e let active = 0; let index = 0; let isComplete = false; - const checkComplete = () => { if (isComplete && !buffer.length && !active) { subscriber.complete(); } }; - const outerNext = value => active < concurrent ? doInnerSub(value) : buffer.push(value); - const doInnerSub = value => { expand && subscriber.next(value); active++; let innerComplete = false; (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__.innerFrom)(project(value, index++)).subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, innerValue => { onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue); - if (expand) { outerNext(innerValue); } else { @@ -2235,17 +2010,14 @@ function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, e if (innerComplete) { try { active--; - while (buffer.length && active < concurrent) { const bufferedValue = buffer.shift(); - if (innerSubScheduler) { (0,_util_executeSchedule__WEBPACK_IMPORTED_MODULE_2__.executeSchedule)(subscriber, innerSubScheduler, () => doInnerSub(bufferedValue)); } else { doInnerSub(bufferedValue); } } - checkComplete(); } catch (err) { subscriber.error(err); @@ -2253,7 +2025,6 @@ function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, e } })); }; - source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, outerNext, () => { isComplete = true; checkComplete(); @@ -2291,7 +2062,6 @@ function mergeMap(project, resultSelector, concurrent = Infinity) { } else if (typeof resultSelector === 'number') { concurrent = resultSelector; } - return (0,_util_lift__WEBPACK_IMPORTED_MODULE_3__.operate)((source, subscriber) => (0,_mergeInternals__WEBPACK_IMPORTED_MODULE_4__.mergeInternals)(source, subscriber, project, concurrent)); } @@ -2373,19 +2143,15 @@ function refCount() { connection = null; return; } - const sharedConnection = source._connection; const conn = connection; connection = null; - if (sharedConnection && (!conn || sharedConnection === conn)) { sharedConnection.unsubscribe(); } - subscriber.unsubscribe(); }); source.subscribe(refCounter); - if (!refCounter.closed) { connection = source.connect(); } @@ -2454,8 +2220,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "share": () => (/* binding */ share) /* harmony export */ }); -/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../observable/from */ 9346); -/* harmony import */ var _operators_take__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../operators/take */ 9295); +/* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../observable/innerFrom */ 4987); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ 228); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscriber */ 9904); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/lift */ 1944); @@ -2463,7 +2228,6 @@ __webpack_require__.r(__webpack_exports__); - function share(options = {}) { const { connector = () => new _Subject__WEBPACK_IMPORTED_MODULE_0__.Subject(), @@ -2472,48 +2236,40 @@ function share(options = {}) { resetOnRefCountZero = true } = options; return wrapperSource => { - let connection = null; - let resetConnection = null; - let subject = null; + let connection; + let resetConnection; + let subject; let refCount = 0; let hasCompleted = false; let hasErrored = false; - const cancelReset = () => { resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe(); - resetConnection = null; + resetConnection = undefined; }; - const reset = () => { cancelReset(); - connection = subject = null; + connection = subject = undefined; hasCompleted = hasErrored = false; }; - const resetAndUnsubscribe = () => { const conn = connection; reset(); conn === null || conn === void 0 ? void 0 : conn.unsubscribe(); }; - return (0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.operate)((source, subscriber) => { refCount++; - if (!hasErrored && !hasCompleted) { cancelReset(); } - const dest = subject = subject !== null && subject !== void 0 ? subject : connector(); subscriber.add(() => { refCount--; - if (refCount === 0 && !hasErrored && !hasCompleted) { resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero); } }); dest.subscribe(subscriber); - - if (!connection) { + if (!connection && refCount > 0) { connection = new _Subscriber__WEBPACK_IMPORTED_MODULE_2__.SafeSubscriber({ next: value => dest.next(value), error: err => { @@ -2529,23 +2285,26 @@ function share(options = {}) { dest.complete(); } }); - (0,_observable_from__WEBPACK_IMPORTED_MODULE_3__.from)(source).subscribe(connection); + (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_3__.innerFrom)(source).subscribe(connection); } })(wrapperSource); }; } - function handleReset(reset, on, ...args) { if (on === true) { reset(); - return null; + return; } - if (on === false) { - return null; + return; } - - return on(...args).pipe((0,_operators_take__WEBPACK_IMPORTED_MODULE_4__.take)(1)).subscribe(() => reset()); + const onSubscriber = new _Subscriber__WEBPACK_IMPORTED_MODULE_2__.SafeSubscriber({ + next: () => { + onSubscriber.unsubscribe(); + reset(); + } + }); + return (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_3__.innerFrom)(on(...args)).subscribe(onSubscriber); } /***/ }), @@ -2567,7 +2326,6 @@ __webpack_require__.r(__webpack_exports__); function shareReplay(configOrBufferSize, windowTime, scheduler) { let bufferSize; let refCount = false; - if (configOrBufferSize && typeof configOrBufferSize === 'object') { ({ bufferSize = Infinity, @@ -2578,7 +2336,6 @@ function shareReplay(configOrBufferSize, windowTime, scheduler) { } else { bufferSize = configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity; } - return (0,_share__WEBPACK_IMPORTED_MODULE_0__.share)({ connector: () => new _ReplaySubject__WEBPACK_IMPORTED_MODULE_1__.ReplaySubject(bufferSize, windowTime, scheduler), resetOnError: true, @@ -2673,9 +2430,7 @@ function switchMap(project, resultSelector) { let innerSubscriber = null; let index = 0; let isComplete = false; - const checkComplete = () => isComplete && !innerSubscriber && subscriber.complete(); - source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, value => { innerSubscriber === null || innerSubscriber === void 0 ? void 0 : innerSubscriber.unsubscribe(); let innerIndex = 0; @@ -2715,7 +2470,6 @@ function take(count) { source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, value => { if (++seen <= count) { subscriber.next(value); - if (count <= seen) { subscriber.complete(); } @@ -2752,7 +2506,6 @@ function takeLast(count) { for (const value of buffer) { subscriber.next(value); } - subscriber.complete(); }, undefined, () => { buffer = null; @@ -2789,6 +2542,33 @@ function takeUntil(notifier) { /***/ }), +/***/ 2566: +/*!********************************************************************!*\ + !*** ./node_modules/rxjs/dist/esm/internal/operators/takeWhile.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "takeWhile": () => (/* binding */ takeWhile) +/* harmony export */ }); +/* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 1944); +/* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OperatorSubscriber */ 3945); + + +function takeWhile(predicate, inclusive = false) { + return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { + let index = 0; + source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, value => { + const result = predicate(value, index++); + (result || inclusive) && subscriber.next(value); + !result && subscriber.complete(); + })); + }); +} + +/***/ }), + /***/ 9337: /*!**************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/tap.js ***! @@ -2815,33 +2595,27 @@ function tap(observerOrNext, error, complete) { } : observerOrNext; return tapObserver ? (0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.operate)((source, subscriber) => { var _a; - (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver); let isUnsub = true; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, value => { var _a; - (_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value); subscriber.next(value); }, () => { var _a; - isUnsub = false; (_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver); subscriber.complete(); }, err => { var _a; - isUnsub = false; (_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err); subscriber.error(err); }, () => { var _a, _b; - if (isUnsub) { (_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver); } - (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver); })); }) : _util_identity__WEBPACK_IMPORTED_MODULE_3__.identity; @@ -2874,7 +2648,6 @@ function throwIfEmpty(errorFactory = defaultErrorFactory) { }, () => hasValue ? subscriber.complete() : subscriber.error(errorFactory()))); }); } - function defaultErrorFactory() { return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_2__.EmptyError(); } @@ -2901,7 +2674,6 @@ function scheduleArray(input, scheduler) { subscriber.complete(); } else { subscriber.next(input[i++]); - if (!subscriber.closed) { this.schedule(); } @@ -2930,7 +2702,6 @@ function scheduleAsyncIterable(input, scheduler) { if (!input) { throw new Error('Iterable cannot be null'); } - return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { (0,_util_executeSchedule__WEBPACK_IMPORTED_MODULE_1__.executeSchedule)(subscriber, scheduler, () => { const iterator = input[Symbol.asyncIterator](); @@ -2975,7 +2746,6 @@ function scheduleIterable(input, scheduler) { (0,_util_executeSchedule__WEBPACK_IMPORTED_MODULE_1__.executeSchedule)(subscriber, scheduler, () => { let value; let done; - try { ({ value, @@ -2985,7 +2755,6 @@ function scheduleIterable(input, scheduler) { subscriber.error(err); return; } - if (done) { subscriber.complete(); } else { @@ -3104,28 +2873,22 @@ function scheduled(input, scheduler) { if ((0,_util_isInteropObservable__WEBPACK_IMPORTED_MODULE_0__.isInteropObservable)(input)) { return (0,_scheduleObservable__WEBPACK_IMPORTED_MODULE_1__.scheduleObservable)(input, scheduler); } - if ((0,_util_isArrayLike__WEBPACK_IMPORTED_MODULE_2__.isArrayLike)(input)) { return (0,_scheduleArray__WEBPACK_IMPORTED_MODULE_3__.scheduleArray)(input, scheduler); } - if ((0,_util_isPromise__WEBPACK_IMPORTED_MODULE_4__.isPromise)(input)) { return (0,_schedulePromise__WEBPACK_IMPORTED_MODULE_5__.schedulePromise)(input, scheduler); } - if ((0,_util_isAsyncIterable__WEBPACK_IMPORTED_MODULE_6__.isAsyncIterable)(input)) { return (0,_scheduleAsyncIterable__WEBPACK_IMPORTED_MODULE_7__.scheduleAsyncIterable)(input, scheduler); } - if ((0,_util_isIterable__WEBPACK_IMPORTED_MODULE_8__.isIterable)(input)) { return (0,_scheduleIterable__WEBPACK_IMPORTED_MODULE_9__.scheduleIterable)(input, scheduler); } - if ((0,_util_isReadableStreamLike__WEBPACK_IMPORTED_MODULE_10__.isReadableStreamLike)(input)) { return (0,_scheduleReadableStreamLike__WEBPACK_IMPORTED_MODULE_11__.scheduleReadableStreamLike)(input, scheduler); } } - throw (0,_util_throwUnobservableError__WEBPACK_IMPORTED_MODULE_12__.createInvalidObservableTypeError)(input); } @@ -3147,11 +2910,9 @@ class Action extends _Subscription__WEBPACK_IMPORTED_MODULE_0__.Subscription { constructor(scheduler, work) { super(); } - schedule(state, delay = 0) { return this; } - } /***/ }), @@ -3176,29 +2937,27 @@ class AnimationFrameAction extends _AsyncAction__WEBPACK_IMPORTED_MODULE_0__.Asy this.scheduler = scheduler; this.work = work; } - requestAsyncId(scheduler, id, delay = 0) { if (delay !== null && delay > 0) { return super.requestAsyncId(scheduler, id, delay); } - scheduler.actions.push(this); return scheduler._scheduled || (scheduler._scheduled = _animationFrameProvider__WEBPACK_IMPORTED_MODULE_1__.animationFrameProvider.requestAnimationFrame(() => scheduler.flush(undefined))); } - recycleAsyncId(scheduler, id, delay = 0) { - if (delay != null && delay > 0 || delay == null && this.delay > 0) { + var _a; + if (delay != null ? delay > 0 : this.delay > 0) { return super.recycleAsyncId(scheduler, id, delay); } - - if (!scheduler.actions.some(action => action.id === id)) { + const { + actions + } = scheduler; + if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) { _animationFrameProvider__WEBPACK_IMPORTED_MODULE_1__.animationFrameProvider.cancelAnimationFrame(id); scheduler._scheduled = undefined; } - return undefined; } - } /***/ }), @@ -3225,24 +2984,19 @@ class AnimationFrameScheduler extends _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0 } = this; let error; action = action || actions.shift(); - do { if (error = action.execute(action.state, action.delay)) { break; } } while ((action = actions[0]) && action.id === flushId && actions.shift()); - this._active = false; - if (error) { while ((action = actions[0]) && action.id === flushId && actions.shift()) { action.unsubscribe(); } - throw error; } } - } /***/ }), @@ -3267,29 +3021,27 @@ class AsapAction extends _AsyncAction__WEBPACK_IMPORTED_MODULE_0__.AsyncAction { this.scheduler = scheduler; this.work = work; } - requestAsyncId(scheduler, id, delay = 0) { if (delay !== null && delay > 0) { return super.requestAsyncId(scheduler, id, delay); } - scheduler.actions.push(this); return scheduler._scheduled || (scheduler._scheduled = _immediateProvider__WEBPACK_IMPORTED_MODULE_1__.immediateProvider.setImmediate(scheduler.flush.bind(scheduler, undefined))); } - recycleAsyncId(scheduler, id, delay = 0) { - if (delay != null && delay > 0 || delay == null && this.delay > 0) { + var _a; + if (delay != null ? delay > 0 : this.delay > 0) { return super.recycleAsyncId(scheduler, id, delay); } - - if (!scheduler.actions.some(action => action.id === id)) { + const { + actions + } = scheduler; + if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) { _immediateProvider__WEBPACK_IMPORTED_MODULE_1__.immediateProvider.clearImmediate(id); scheduler._scheduled = undefined; } - return undefined; } - } /***/ }), @@ -3316,24 +3068,19 @@ class AsapScheduler extends _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__.AsyncSc } = this; let error; action = action || actions.shift(); - do { if (error = action.execute(action.state, action.delay)) { break; } } while ((action = actions[0]) && action.id === flushId && actions.shift()); - this._active = false; - if (error) { while ((action = actions[0]) && action.id === flushId && actions.shift()) { action.unsubscribe(); } - throw error; } } - } /***/ }), @@ -3361,72 +3108,60 @@ class AsyncAction extends _Action__WEBPACK_IMPORTED_MODULE_0__.Action { this.work = work; this.pending = false; } - schedule(state, delay = 0) { + var _a; if (this.closed) { return this; } - this.state = state; const id = this.id; const scheduler = this.scheduler; - if (id != null) { this.id = this.recycleAsyncId(scheduler, id, delay); } - this.pending = true; this.delay = delay; - this.id = this.id || this.requestAsyncId(scheduler, this.id, delay); + this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay); return this; } - requestAsyncId(scheduler, _id, delay = 0) { return _intervalProvider__WEBPACK_IMPORTED_MODULE_1__.intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay); } - recycleAsyncId(_scheduler, id, delay = 0) { if (delay != null && this.delay === delay && this.pending === false) { return id; } - - _intervalProvider__WEBPACK_IMPORTED_MODULE_1__.intervalProvider.clearInterval(id); + if (id != null) { + _intervalProvider__WEBPACK_IMPORTED_MODULE_1__.intervalProvider.clearInterval(id); + } return undefined; } - execute(state, delay) { if (this.closed) { return new Error('executing a cancelled action'); } - this.pending = false; - const error = this._execute(state, delay); - if (error) { return error; } else if (this.pending === false && this.id != null) { this.id = this.recycleAsyncId(this.scheduler, this.id, null); } } - _execute(state, _delay) { let errored = false; let errorValue; - try { this.work(state); } catch (e) { errored = true; errorValue = e ? e : new Error('Scheduled action threw falsy error'); } - if (errored) { this.unsubscribe(); return errorValue; } } - unsubscribe() { if (!this.closed) { const { @@ -3439,16 +3174,13 @@ class AsyncAction extends _Action__WEBPACK_IMPORTED_MODULE_0__.Action { this.work = this.state = this.scheduler = null; this.pending = false; (0,_util_arrRemove__WEBPACK_IMPORTED_MODULE_2__.arrRemove)(actions, this); - if (id != null) { this.id = this.recycleAsyncId(scheduler, id, null); } - this.delay = null; super.unsubscribe(); } } - } /***/ }), @@ -3470,39 +3202,30 @@ class AsyncScheduler extends _Scheduler__WEBPACK_IMPORTED_MODULE_0__.Scheduler { super(SchedulerAction, now); this.actions = []; this._active = false; - this._scheduled = undefined; } - flush(action) { const { actions } = this; - if (this._active) { actions.push(action); return; } - let error; this._active = true; - do { if (error = action.execute(action.state, action.delay)) { break; } } while (action = actions.shift()); - this._active = false; - if (error) { while (action = actions.shift()) { action.unsubscribe(); } - throw error; } } - } /***/ }), @@ -3546,33 +3269,28 @@ const animationFrameProvider = { const { delegate } = animationFrameProvider; - if (delegate) { request = delegate.requestAnimationFrame; cancel = delegate.cancelAnimationFrame; } - const handle = request(timestamp => { cancel = undefined; callback(timestamp); }); return new _Subscription__WEBPACK_IMPORTED_MODULE_0__.Subscription(() => cancel === null || cancel === void 0 ? void 0 : cancel(handle)); }, - requestAnimationFrame(...args) { const { delegate } = animationFrameProvider; return ((delegate === null || delegate === void 0 ? void 0 : delegate.requestAnimationFrame) || requestAnimationFrame)(...args); }, - cancelAnimationFrame(...args) { const { delegate } = animationFrameProvider; return ((delegate === null || delegate === void 0 ? void 0 : delegate.cancelAnimationFrame) || cancelAnimationFrame)(...args); }, - delegate: undefined }; @@ -3632,7 +3350,6 @@ const dateTimestampProvider = { now() { return (dateTimestampProvider.delegate || Date).now(); }, - delegate: undefined }; @@ -3661,14 +3378,12 @@ const immediateProvider = { } = immediateProvider; return ((delegate === null || delegate === void 0 ? void 0 : delegate.setImmediate) || setImmediate)(...args); }, - clearImmediate(handle) { const { delegate } = immediateProvider; return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearImmediate) || clearImmediate)(handle); }, - delegate: undefined }; @@ -3689,21 +3404,17 @@ const intervalProvider = { const { delegate } = intervalProvider; - if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) { return delegate.setInterval(handler, timeout, ...args); } - return setInterval(handler, timeout, ...args); }, - clearInterval(handle) { const { delegate } = intervalProvider; return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle); }, - delegate: undefined }; @@ -3724,21 +3435,17 @@ const timeoutProvider = { const { delegate } = timeoutProvider; - if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) { return delegate.setTimeout(handler, timeout, ...args); } - return setTimeout(handler, timeout, ...args); }, - clearTimeout(handle) { const { delegate } = timeoutProvider; return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle); }, - delegate: undefined }; @@ -3759,7 +3466,6 @@ function getSymbolIterator() { if (typeof Symbol !== 'function' || !Symbol.iterator) { return '@@iterator'; } - return Symbol.iterator; } const iterator = getSymbolIterator(); @@ -3794,7 +3500,6 @@ __webpack_require__.r(__webpack_exports__); const EmptyError = (0,_createErrorClass__WEBPACK_IMPORTED_MODULE_0__.createErrorClass)(_super => function EmptyErrorImpl() { _super(this); - this.name = 'EmptyError'; this.message = 'no elements in sequence'; }); @@ -3815,39 +3520,31 @@ __webpack_require__.r(__webpack_exports__); let nextHandle = 1; let resolved; const activeHandles = {}; - function findAndClearHandle(handle) { if (handle in activeHandles) { delete activeHandles[handle]; return true; } - return false; } - const Immediate = { setImmediate(cb) { const handle = nextHandle++; activeHandles[handle] = true; - if (!resolved) { resolved = Promise.resolve(); } - resolved.then(() => findAndClearHandle(handle) && cb()); return handle; }, - clearImmediate(handle) { findAndClearHandle(handle); } - }; const TestTools = { pending() { return Object.keys(activeHandles).length; } - }; /***/ }), @@ -3866,7 +3563,6 @@ __webpack_require__.r(__webpack_exports__); const ObjectUnsubscribedError = (0,_createErrorClass__WEBPACK_IMPORTED_MODULE_0__.createErrorClass)(_super => function ObjectUnsubscribedErrorImpl() { _super(this); - this.name = 'ObjectUnsubscribedError'; this.message = 'object unsubscribed'; }); @@ -3887,7 +3583,6 @@ __webpack_require__.r(__webpack_exports__); const UnsubscriptionError = (0,_createErrorClass__WEBPACK_IMPORTED_MODULE_0__.createErrorClass)(_super => function UnsubscriptionErrorImpl(errors) { _super(this); - this.message = errors ? `${errors.length} errors occurred during unsubscription: ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : ''; this.name = 'UnsubscriptionError'; @@ -3912,11 +3607,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isScheduler */ 9867); - function last(arr) { return arr[arr.length - 1]; } - function popResultSelector(args) { return (0,_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(last(args)) ? args.pop() : undefined; } @@ -3950,14 +3643,12 @@ const { function argsArgArrayOrObject(args) { if (args.length === 1) { const first = args[0]; - if (isArray(first)) { return { args: first, keys: null }; } - if (isPOJO(first)) { const keys = getKeys(first); return { @@ -3966,13 +3657,11 @@ function argsArgArrayOrObject(args) { }; } } - return { args: args, keys: null }; } - function isPOJO(obj) { return obj && typeof obj === 'object' && getPrototypeOf(obj) === objectProto; } @@ -4013,7 +3702,6 @@ function createErrorClass(createImpl) { Error.call(instance); instance.stack = new Error().stack; }; - const ctorFunc = createImpl(_super); ctorFunc.prototype = Object.create(Error.prototype); ctorFunc.prototype.constructor = ctorFunc; @@ -4055,23 +3743,19 @@ let context = null; function errorContext(cb) { if (_config__WEBPACK_IMPORTED_MODULE_0__.config.useDeprecatedSynchronousErrorHandling) { const isRoot = !context; - if (isRoot) { context = { errorThrown: false, error: null }; } - cb(); - if (isRoot) { const { errorThrown, error } = context; context = null; - if (errorThrown) { throw error; } @@ -4102,7 +3786,6 @@ __webpack_require__.r(__webpack_exports__); function executeSchedule(parentSubscription, scheduler, work, delay = 0, repeat = false) { const scheduleSubscription = scheduler.schedule(function () { work(); - if (repeat) { parentSubscription.add(this.schedule(null, delay)); } else { @@ -4110,7 +3793,6 @@ function executeSchedule(parentSubscription, scheduler, work, delay = 0, repeat } }, delay); parentSubscription.add(scheduleSubscription); - if (!repeat) { return scheduleSubscription; } @@ -4294,18 +3976,15 @@ __webpack_require__.r(__webpack_exports__); function readableStreamLikeToAsyncGenerator(readableStream) { return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__asyncGenerator)(this, arguments, function* readableStreamLikeToAsyncGenerator_1() { const reader = readableStream.getReader(); - try { while (true) { const { value, done } = yield (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__await)(reader.read()); - if (done) { return yield (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__await)(void 0); } - yield yield (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__await)(value); } } finally { @@ -4364,7 +4043,6 @@ function operate(init) { } }); } - throw new TypeError('Unable to lift unknown Observable type'); }; } @@ -4386,11 +4064,9 @@ __webpack_require__.r(__webpack_exports__); const { isArray } = Array; - function callOrApply(fn, args) { return isArray(args) ? fn(...args) : fn(args); } - function mapOneOrManyArgs(fn) { return (0,_operators_map__WEBPACK_IMPORTED_MODULE_0__.map)(args => callOrApply(fn, args)); } @@ -4431,11 +4107,9 @@ function pipeFromArray(fns) { if (fns.length === 0) { return _identity__WEBPACK_IMPORTED_MODULE_0__.identity; } - if (fns.length === 1) { return fns[0]; } - return function piped(input) { return fns.reduce((prev, fn) => fn(prev), input); }; @@ -4462,7 +4136,6 @@ function reportUnhandledError(err) { const { onUnhandledError } = _config__WEBPACK_IMPORTED_MODULE_1__.config; - if (onUnhandledError) { onUnhandledError(err); } else { @@ -4608,7 +4281,7 @@ function __generator(thisArg, body) { function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); - while (_) try { + while (g && (g = 0, op[0] && (_ = 0)), _) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { @@ -4833,6 +4506,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs/operators */ 8951); /* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/cdk/coercion */ 8971); /* harmony import */ var _angular_cdk_observers__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @angular/cdk/observers */ 3773); +/* harmony import */ var _angular_cdk_layout__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @angular/cdk/layout */ 3278); + + @@ -4851,22 +4527,17 @@ __webpack_require__.r(__webpack_exports__); * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** IDs are delimited by an empty space, as per the spec. */ - const ID_DELIMITER = ' '; /** * Adds the given ID to the specified ARIA attribute on an element. * Used for attributes such as aria-labelledby, aria-owns, etc. */ - function addAriaReferencedId(el, attr, id) { const ids = getAriaReferenceIds(el, attr); - if (ids.some(existingId => existingId.trim() == id.trim())) { return; } - ids.push(id.trim()); el.setAttribute(attr, ids.join(ID_DELIMITER)); } @@ -4874,12 +4545,9 @@ function addAriaReferencedId(el, attr, id) { * Removes the given ID from the specified ARIA attribute on an element. * Used for attributes such as aria-labelledby, aria-owns, etc. */ - - function removeAriaReferencedId(el, attr, id) { const ids = getAriaReferenceIds(el, attr); const filteredIds = ids.filter(val => val != id.trim()); - if (filteredIds.length) { el.setAttribute(attr, filteredIds.join(ID_DELIMITER)); } else { @@ -4890,12 +4558,11 @@ function removeAriaReferencedId(el, attr, id) { * Gets the list of IDs referenced by the given ARIA attribute on an element. * Used for attributes such as aria-labelledby, aria-owns, etc. */ - - function getAriaReferenceIds(el, attr) { // Get string array of all individual ids (whitespace delimited) in the attribute value return (el.getAttribute(attr) || '').match(/\S+/g) || []; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -4903,38 +4570,31 @@ function getAriaReferenceIds(el, attr) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * ID used for the body container where all messages are appended. * @deprecated No longer being used. To be removed. * @breaking-change 14.0.0 */ - - const MESSAGES_CONTAINER_ID = 'cdk-describedby-message-container'; /** * ID prefix used for each created message element. * @deprecated To be turned into a private variable. * @breaking-change 14.0.0 */ - const CDK_DESCRIBEDBY_ID_PREFIX = 'cdk-describedby-message'; /** * Attribute given to each host element that is described by a message element. * @deprecated To be turned into a private variable. * @breaking-change 14.0.0 */ - const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = 'cdk-describedby-host'; /** Global incremental identifier for each registered message element. */ - let nextId = 0; /** * Utility that creates visually hidden elements with a message content. Useful for elements that * want to use aria-describedby to further describe themselves without adding additional visual * content. */ - class AriaDescriber { constructor(_document, /** @@ -4944,29 +4604,22 @@ class AriaDescriber { _platform) { this._platform = _platform; /** Map of all registered message elements that have been placed into the document. */ - this._messageRegistry = new Map(); /** Container for all registered messages. */ - this._messagesContainer = null; /** Unique ID for the service. */ - this._id = `${nextId++}`; this._document = _document; this._id = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.APP_ID) + '-' + nextId++; } - describe(hostElement, message, role) { if (!this._canBeDescribed(hostElement, message)) { return; } - const key = getKey(message, role); - if (typeof message !== 'string') { // We need to ensure that the element has an ID. setMessageId(message, this._id); - this._messageRegistry.set(key, { messageElement: message, referenceCount: 0 @@ -4974,101 +4627,72 @@ class AriaDescriber { } else if (!this._messageRegistry.has(key)) { this._createMessageElement(message, role); } - if (!this._isElementDescribedByMessage(hostElement, key)) { this._addMessageReference(hostElement, key); } } - removeDescription(hostElement, message, role) { if (!message || !this._isElementNode(hostElement)) { return; } - const key = getKey(message, role); - if (this._isElementDescribedByMessage(hostElement, key)) { this._removeMessageReference(hostElement, key); - } // If the message is a string, it means that it's one that we created for the + } + // If the message is a string, it means that it's one that we created for the // consumer so we can remove it safely, otherwise we should leave it in place. - - if (typeof message === 'string') { const registeredMessage = this._messageRegistry.get(key); - if (registeredMessage && registeredMessage.referenceCount === 0) { this._deleteMessageElement(key); } } - if (this._messagesContainer?.childNodes.length === 0) { this._messagesContainer.remove(); - this._messagesContainer = null; } } /** Unregisters all created message elements and removes the message container. */ - - ngOnDestroy() { const describedElements = this._document.querySelectorAll(`[${CDK_DESCRIBEDBY_HOST_ATTRIBUTE}="${this._id}"]`); - for (let i = 0; i < describedElements.length; i++) { this._removeCdkDescribedByReferenceIds(describedElements[i]); - describedElements[i].removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE); } - this._messagesContainer?.remove(); this._messagesContainer = null; - this._messageRegistry.clear(); } /** * Creates a new element in the visually hidden message container element with the message * as its content and adds it to the message registry. */ - - _createMessageElement(message, role) { const messageElement = this._document.createElement('div'); - setMessageId(messageElement, this._id); messageElement.textContent = message; - if (role) { messageElement.setAttribute('role', role); } - this._createMessagesContainer(); - this._messagesContainer.appendChild(messageElement); - this._messageRegistry.set(getKey(message, role), { messageElement, referenceCount: 0 }); } /** Deletes the message element from the global messages container. */ - - _deleteMessageElement(key) { this._messageRegistry.get(key)?.messageElement?.remove(); - this._messageRegistry.delete(key); } /** Creates the global container for all aria-describedby messages. */ - - _createMessagesContainer() { if (this._messagesContainer) { return; } - const containerClassName = 'cdk-describedby-message-container'; - const serverContainers = this._document.querySelectorAll(`.${containerClassName}[platform="server"]`); - for (let i = 0; i < serverContainers.length; i++) { // When going from the server to the client, we may end up in a situation where there's // already a container on the page, but we don't have a reference to it. Clear the @@ -5076,30 +4700,24 @@ class AriaDescriber { // container, should be slightly faster. serverContainers[i].remove(); } - - const messagesContainer = this._document.createElement('div'); // We add `visibility: hidden` in order to prevent text in this container from + const messagesContainer = this._document.createElement('div'); + // We add `visibility: hidden` in order to prevent text in this container from // being searchable by the browser's Ctrl + F functionality. // Screen-readers will still read the description for elements with aria-describedby even // when the description element is not visible. - - - messagesContainer.style.visibility = 'hidden'; // Even though we use `visibility: hidden`, we still apply `cdk-visually-hidden` so that + messagesContainer.style.visibility = 'hidden'; + // Even though we use `visibility: hidden`, we still apply `cdk-visually-hidden` so that // the description element doesn't impact page layout. - messagesContainer.classList.add(containerClassName); - messagesContainer.classList.add('cdk-visually-hidden'); // @breaking-change 14.0.0 Remove null check for `_platform`. - + messagesContainer.classList.add('cdk-visually-hidden'); + // @breaking-change 14.0.0 Remove null check for `_platform`. if (this._platform && !this._platform.isBrowser) { messagesContainer.setAttribute('platform', 'server'); } - this._document.body.appendChild(messagesContainer); - this._messagesContainer = messagesContainer; } /** Removes all cdk-describedby messages that are hosted through the element. */ - - _removeCdkDescribedByReferenceIds(element) { // Remove all aria-describedby reference IDs that are prefixed by CDK_DESCRIBEDBY_ID_PREFIX const originalReferenceIds = getAriaReferenceIds(element, 'aria-describedby').filter(id => id.indexOf(CDK_DESCRIBEDBY_ID_PREFIX) != 0); @@ -5109,13 +4727,10 @@ class AriaDescriber { * Adds a message reference to the element using aria-describedby and increments the registered * message's reference count. */ - - _addMessageReference(element, key) { - const registeredMessage = this._messageRegistry.get(key); // Add the aria-describedby reference and set the + const registeredMessage = this._messageRegistry.get(key); + // Add the aria-describedby reference and set the // describedby_host attribute to mark the element. - - addAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id); element.setAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE, this._id); registeredMessage.referenceCount++; @@ -5124,66 +4739,49 @@ class AriaDescriber { * Removes a message reference from the element using aria-describedby * and decrements the registered message's reference count. */ - - _removeMessageReference(element, key) { const registeredMessage = this._messageRegistry.get(key); - registeredMessage.referenceCount--; removeAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id); element.removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE); } /** Returns true if the element has been described by the provided message ID. */ - - _isElementDescribedByMessage(element, key) { const referenceIds = getAriaReferenceIds(element, 'aria-describedby'); - const registeredMessage = this._messageRegistry.get(key); - const messageId = registeredMessage && registeredMessage.messageElement.id; return !!messageId && referenceIds.indexOf(messageId) != -1; } /** Determines whether a message can be described on a particular element. */ - - _canBeDescribed(element, message) { if (!this._isElementNode(element)) { return false; } - if (message && typeof message === 'object') { // We'd have to make some assumptions about the description element's text, if the consumer // passed in an element. Assume that if an element is passed in, the consumer has verified // that it can be used as a description. return true; } - const trimmedMessage = message == null ? '' : `${message}`.trim(); - const ariaLabel = element.getAttribute('aria-label'); // We shouldn't set descriptions if they're exactly the same as the `aria-label` of the + const ariaLabel = element.getAttribute('aria-label'); + // We shouldn't set descriptions if they're exactly the same as the `aria-label` of the // element, because screen readers will end up reading out the same text twice in a row. - return trimmedMessage ? !ariaLabel || ariaLabel.trim() !== trimmedMessage : false; } /** Checks whether a node is an Element node. */ - - _isElementNode(element) { return element.nodeType === this._document.ELEMENT_NODE; } - } - AriaDescriber.ɵfac = function AriaDescriber_Factory(t) { return new (t || AriaDescriber)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__.Platform)); }; - AriaDescriber.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: AriaDescriber, factory: AriaDescriber.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AriaDescriber, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -5203,19 +4801,16 @@ AriaDescriber.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__ }, null); })(); /** Gets a key that can be used to look messages up in the registry. */ - - function getKey(message, role) { return typeof message === 'string' ? `${role || ''}/${message}` : message; } /** Assigns a unique ID to an element, if it doesn't have one already. */ - - function setMessageId(element, serviceId) { if (!element.id) { element.id = `${CDK_DESCRIBEDBY_ID_PREFIX}-${serviceId}-${nextId++}`; } } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -5223,13 +4818,10 @@ function setMessageId(element, serviceId) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * This class manages keyboard events for selectable lists. If you pass it a query list * of items, it will set the active item correctly when arrow events occur. */ - - class ListKeyManager { constructor(_items) { this._items = _items; @@ -5241,33 +4833,32 @@ class ListKeyManager { this._vertical = true; this._allowedModifierKeys = []; this._homeAndEnd = false; + this._pageUpAndDown = { + enabled: false, + delta: 10 + }; /** * Predicate function that can be used to check whether an item should be skipped * by the key manager. By default, disabled items are skipped. */ - - this._skipPredicateFn = item => item.disabled; // Buffer for the letters that the user has pressed when the typeahead option is turned on. - - + this._skipPredicateFn = item => item.disabled; + // Buffer for the letters that the user has pressed when the typeahead option is turned on. this._pressedLetters = []; /** * Stream that emits any time the TAB key is pressed, so components can react * when focus is shifted off of the list. */ - this.tabOut = new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject(); /** Stream that emits whenever the active item of the list manager changes. */ - - this.change = new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject(); // We allow for the items to be an array because, in some cases, the consumer may + this.change = new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject(); + // We allow for the items to be an array because, in some cases, the consumer may // not have access to a QueryList of the items they want to manage (e.g. when the // items aren't being collected via `ViewChildren` or `ContentChildren`). - if (_items instanceof _angular_core__WEBPACK_IMPORTED_MODULE_0__.QueryList) { - _items.changes.subscribe(newItems => { + this._itemChangesSubscription = _items.changes.subscribe(newItems => { if (this._activeItem) { const itemArray = newItems.toArray(); const newIndex = itemArray.indexOf(this._activeItem); - if (newIndex > -1 && newIndex !== this._activeItemIndex) { this._activeItemIndex = newIndex; } @@ -5280,8 +4871,6 @@ class ListKeyManager { * list key manager. * @param predicate Function that determines whether the given item should be skipped. */ - - skipPredicate(predicate) { this._skipPredicateFn = predicate; return this; @@ -5291,8 +4880,6 @@ class ListKeyManager { * the other end of list when there are no more items in the given direction. * @param shouldWrap Whether the list should wrap when reaching the end. */ - - withWrap(shouldWrap = true) { this._wrap = shouldWrap; return this; @@ -5301,8 +4888,6 @@ class ListKeyManager { * Configures whether the key manager should be able to move the selection vertically. * @param enabled Whether vertical selection should be enabled. */ - - withVerticalOrientation(enabled = true) { this._vertical = enabled; return this; @@ -5312,8 +4897,6 @@ class ListKeyManager { * Passing in `null` will disable horizontal movement. * @param direction Direction in which the selection can be moved. */ - - withHorizontalOrientation(direction) { this._horizontal = direction; return this; @@ -5322,8 +4905,6 @@ class ListKeyManager { * Modifier keys which are allowed to be held down and whose default actions will be prevented * as the user is pressing the arrow keys. Defaults to not allowing any modifier keys. */ - - withAllowedModifierKeys(keys) { this._allowedModifierKeys = keys; return this; @@ -5332,53 +4913,60 @@ class ListKeyManager { * Turns on typeahead mode which allows users to set the active item by typing. * @param debounceInterval Time to wait after the last keystroke before setting the active item. */ - - withTypeAhead(debounceInterval = 200) { if ((typeof ngDevMode === 'undefined' || ngDevMode) && this._items.length && this._items.some(item => typeof item.getLabel !== 'function')) { throw Error('ListKeyManager items in typeahead mode must implement the `getLabel` method.'); } - - this._typeaheadSubscription.unsubscribe(); // Debounce the presses of non-navigational keys, collect the ones that correspond to letters + this._typeaheadSubscription.unsubscribe(); + // Debounce the presses of non-navigational keys, collect the ones that correspond to letters // and convert those letters back into a string. Afterwards find the first item that starts // with that string and select it. - - this._typeaheadSubscription = this._letterKeyStream.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.tap)(letter => this._pressedLetters.push(letter)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.debounceTime)(debounceInterval), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.filter)(() => this._pressedLetters.length > 0), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_8__.map)(() => this._pressedLetters.join(''))).subscribe(inputString => { - const items = this._getItemsArray(); // Start at 1 because we want to start searching at the item immediately + const items = this._getItemsArray(); + // Start at 1 because we want to start searching at the item immediately // following the current active item. - - for (let i = 1; i < items.length + 1; i++) { const index = (this._activeItemIndex + i) % items.length; const item = items[index]; - if (!this._skipPredicateFn(item) && item.getLabel().toUpperCase().trim().indexOf(inputString) === 0) { this.setActiveItem(index); break; } } - this._pressedLetters = []; }); return this; } + /** Cancels the current typeahead sequence. */ + cancelTypeahead() { + this._pressedLetters = []; + return this; + } /** * Configures the key manager to activate the first and last items * respectively when the Home or End key is pressed. * @param enabled Whether pressing the Home or End key activates the first/last item. */ - - withHomeAndEnd(enabled = true) { this._homeAndEnd = enabled; return this; } - + /** + * Configures the key manager to activate every 10th, configured or first/last element in up/down direction + * respectively when the Page-Up or Page-Down key is pressed. + * @param enabled Whether pressing the Page-Up or Page-Down key activates the first/last item. + * @param delta Whether pressing the Home or End key activates the first/last item. + */ + withPageUpDown(enabled = true, delta = 10) { + this._pageUpAndDown = { + enabled, + delta + }; + return this; + } setActiveItem(item) { const previousActiveItem = this._activeItem; this.updateActiveItem(item); - if (this._activeItem !== previousActiveItem) { this.change.next(this._activeItemIndex); } @@ -5387,20 +4975,16 @@ class ListKeyManager { * Sets the active item depending on the key event passed in. * @param event Keyboard event to be used for determining which element should be active. */ - - onKeydown(event) { const keyCode = event.keyCode; const modifiers = ['altKey', 'ctrlKey', 'metaKey', 'shiftKey']; const isModifierAllowed = modifiers.every(modifier => { return !event[modifier] || this._allowedModifierKeys.indexOf(modifier) > -1; }); - switch (keyCode) { case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.TAB: this.tabOut.next(); return; - case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.DOWN_ARROW: if (this._vertical && isModifierAllowed) { this.setNextItemActive(); @@ -5408,7 +4992,6 @@ class ListKeyManager { } else { return; } - case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.UP_ARROW: if (this._vertical && isModifierAllowed) { this.setPreviousItemActive(); @@ -5416,7 +4999,6 @@ class ListKeyManager { } else { return; } - case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.RIGHT_ARROW: if (this._horizontal && isModifierAllowed) { this._horizontal === 'rtl' ? this.setPreviousItemActive() : this.setNextItemActive(); @@ -5424,7 +5006,6 @@ class ListKeyManager { } else { return; } - case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.LEFT_ARROW: if (this._horizontal && isModifierAllowed) { this._horizontal === 'rtl' ? this.setNextItemActive() : this.setPreviousItemActive(); @@ -5432,7 +5013,6 @@ class ListKeyManager { } else { return; } - case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.HOME: if (this._homeAndEnd && isModifierAllowed) { this.setFirstItemActive(); @@ -5440,7 +5020,6 @@ class ListKeyManager { } else { return; } - case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.END: if (this._homeAndEnd && isModifierAllowed) { this.setLastItemActive(); @@ -5448,7 +5027,23 @@ class ListKeyManager { } else { return; } - + case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.PAGE_UP: + if (this._pageUpAndDown.enabled && isModifierAllowed) { + const targetIndex = this._activeItemIndex - this._pageUpAndDown.delta; + this._setActiveItemByIndex(targetIndex > 0 ? targetIndex : 0, 1); + break; + } else { + return; + } + case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.PAGE_DOWN: + if (this._pageUpAndDown.enabled && isModifierAllowed) { + const targetIndex = this._activeItemIndex + this._pageUpAndDown.delta; + const itemsLength = this._getItemsArray().length; + this._setActiveItemByIndex(targetIndex < itemsLength ? targetIndex : itemsLength - 1, -1); + break; + } else { + return; + } default: if (isModifierAllowed || (0,_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.hasModifierKey)(event, 'shiftKey')) { // Attempt to use the `event.key` which also maps it to the user's keyboard language, @@ -5458,75 +5053,64 @@ class ListKeyManager { } else if (keyCode >= _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.A && keyCode <= _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.Z || keyCode >= _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.ZERO && keyCode <= _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.NINE) { this._letterKeyStream.next(String.fromCharCode(keyCode)); } - } // Note that we return here, in order to avoid preventing + } + // Note that we return here, in order to avoid preventing // the default action of non-navigational keys. - - return; } - this._pressedLetters = []; event.preventDefault(); } /** Index of the currently active item. */ - - get activeItemIndex() { return this._activeItemIndex; } /** The active item. */ - - get activeItem() { return this._activeItem; } /** Gets whether the user is currently typing into the manager using the typeahead feature. */ - - isTyping() { return this._pressedLetters.length > 0; } /** Sets the active item to the first enabled item in the list. */ - - setFirstItemActive() { this._setActiveItemByIndex(0, 1); } /** Sets the active item to the last enabled item in the list. */ - - setLastItemActive() { this._setActiveItemByIndex(this._items.length - 1, -1); } /** Sets the active item to the next enabled item in the list. */ - - setNextItemActive() { this._activeItemIndex < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1); } /** Sets the active item to a previous enabled item in the list. */ - - setPreviousItemActive() { this._activeItemIndex < 0 && this._wrap ? this.setLastItemActive() : this._setActiveItemByDelta(-1); } - updateActiveItem(item) { const itemArray = this._getItemsArray(); - const index = typeof item === 'number' ? item : itemArray.indexOf(item); - const activeItem = itemArray[index]; // Explicitly check for `null` and `undefined` because other falsy values are valid. - + const activeItem = itemArray[index]; + // Explicitly check for `null` and `undefined` because other falsy values are valid. this._activeItem = activeItem == null ? null : activeItem; this._activeItemIndex = index; } + /** Cleans up the key manager. */ + destroy() { + this._typeaheadSubscription.unsubscribe(); + this._itemChangesSubscription?.unsubscribe(); + this._letterKeyStream.complete(); + this.tabOut.complete(); + this.change.complete(); + this._pressedLetters = []; + } /** * This method sets the active item, given a list of items and the delta between the * currently active item and the new active item. It will calculate differently * depending on whether wrap mode is turned on. */ - - _setActiveItemByDelta(delta) { this._wrap ? this._setActiveInWrapMode(delta) : this._setActiveInDefaultMode(delta); } @@ -5535,15 +5119,11 @@ class ListKeyManager { * down the list until it finds an item that is not disabled, and it will wrap if it * encounters either end of the list. */ - - _setActiveInWrapMode(delta) { const items = this._getItemsArray(); - for (let i = 1; i <= items.length; i++) { const index = (this._activeItemIndex + delta * i + items.length) % items.length; const item = items[index]; - if (!this._skipPredicateFn(item)) { this.setActiveItem(index); return; @@ -5555,8 +5135,6 @@ class ListKeyManager { * continue to move down the list until it finds an item that is not disabled. If * it encounters either end of the list, it will stop and not wrap. */ - - _setActiveInDefaultMode(delta) { this._setActiveItemByIndex(this._activeItemIndex + delta, delta); } @@ -5565,33 +5143,25 @@ class ListKeyManager { * item is disabled, it will move in the fallbackDelta direction until it either * finds an enabled item or encounters the end of the list. */ - - _setActiveItemByIndex(index, fallbackDelta) { const items = this._getItemsArray(); - if (!items[index]) { return; } - while (this._skipPredicateFn(items[index])) { index += fallbackDelta; - if (!items[index]) { return; } } - this.setActiveItem(index); } /** Returns the items as an array. */ - - _getItemsArray() { return this._items instanceof _angular_core__WEBPACK_IMPORTED_MODULE_0__.QueryList ? this._items.toArray() : this._items; } - } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -5599,22 +5169,18 @@ class ListKeyManager { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - class ActiveDescendantKeyManager extends ListKeyManager { setActiveItem(index) { if (this.activeItem) { this.activeItem.setInactiveStyles(); } - super.setActiveItem(index); - if (this.activeItem) { this.activeItem.setActiveStyles(); } } - } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -5622,8 +5188,6 @@ class ActiveDescendantKeyManager extends ListKeyManager { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - class FocusKeyManager extends ListKeyManager { constructor() { super(...arguments); @@ -5633,22 +5197,18 @@ class FocusKeyManager extends ListKeyManager { * Sets the focus origin that will be passed in to the items for any subsequent `focus` calls. * @param origin Focus origin to be used when focusing items. */ - - setFocusOrigin(origin) { this._origin = origin; return this; } - setActiveItem(item) { super.setActiveItem(item); - if (this.activeItem) { this.activeItem.focus(this._origin); } } - } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -5656,12 +5216,9 @@ class FocusKeyManager extends ListKeyManager { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Configuration for the isFocusable method. */ - - class IsFocusableConfig { constructor() { /** @@ -5669,17 +5226,14 @@ class IsFocusableConfig { */ this.ignoreVisibility = false; } - -} // The InteractivityChecker leans heavily on the ally.js accessibility utilities. +} +// The InteractivityChecker leans heavily on the ally.js accessibility utilities. // Methods like `isTabbable` are only covering specific edge-cases for the browsers which are // supported. - /** * Utility for checking the interactivity of an element, such as whether is is focusable or * tabbable. */ - - class InteractivityChecker { constructor(_platform) { this._platform = _platform; @@ -5690,8 +5244,6 @@ class InteractivityChecker { * @param element Element to be checked. * @returns Whether the element is disabled. */ - - isDisabled(element) { // This does not capture some cases, such as a non-form control with a disabled attribute or // a form control inside of a disabled form, but should capture the most common cases. @@ -5705,8 +5257,6 @@ class InteractivityChecker { * * @returns Whether the element is visible. */ - - isVisible(element) { return hasGeometry(element) && getComputedStyle(element).visibility === 'visible'; } @@ -5717,59 +5267,47 @@ class InteractivityChecker { * @param element Element to be checked. * @returns Whether the element is tabbable. */ - - isTabbable(element) { // Nothing is tabbable on the server 😎 if (!this._platform.isBrowser) { return false; } - const frameElement = getFrameElement(getWindow(element)); - if (frameElement) { // Frame elements inherit their tabindex onto all child elements. if (getTabIndexValue(frameElement) === -1) { return false; - } // Browsers disable tabbing to an element inside of an invisible frame. - - + } + // Browsers disable tabbing to an element inside of an invisible frame. if (!this.isVisible(frameElement)) { return false; } } - let nodeName = element.nodeName.toLowerCase(); let tabIndexValue = getTabIndexValue(element); - if (element.hasAttribute('contenteditable')) { return tabIndexValue !== -1; } - if (nodeName === 'iframe' || nodeName === 'object') { // The frame or object's content may be tabbable depending on the content, but it's // not possibly to reliably detect the content of the frames. We always consider such // elements as non-tabbable. return false; - } // In iOS, the browser only considers some specific elements as tabbable. - - + } + // In iOS, the browser only considers some specific elements as tabbable. if (this._platform.WEBKIT && this._platform.IOS && !isPotentiallyTabbableIOS(element)) { return false; } - if (nodeName === 'audio') { // Audio elements without controls enabled are never tabbable, regardless // of the tabindex attribute explicitly being set. if (!element.hasAttribute('controls')) { return false; - } // Audio elements with controls are by default tabbable unless the + } + // Audio elements with controls are by default tabbable unless the // tabindex attribute is set to `-1` explicitly. - - return tabIndexValue !== -1; } - if (nodeName === 'video') { // For all video elements, if the tabindex attribute is set to `-1`, the video // is not tabbable. Note: We cannot rely on the default `HTMLElement.tabIndex` @@ -5777,20 +5315,17 @@ class InteractivityChecker { // tabindex attribute is the source of truth here. if (tabIndexValue === -1) { return false; - } // If the tabindex is explicitly set, and not `-1` (as per check before), the + } + // If the tabindex is explicitly set, and not `-1` (as per check before), the // video element is always tabbable (regardless of whether it has controls or not). - - if (tabIndexValue !== null) { return true; - } // Otherwise (when no explicit tabindex is set), a video is only tabbable if it + } + // Otherwise (when no explicit tabindex is set), a video is only tabbable if it // has controls enabled. Firefox is special as videos are always tabbable regardless // of whether there are controls or not. - - return this._platform.FIREFOX || element.hasAttribute('controls'); } - return element.tabIndex >= 0; } /** @@ -5800,26 +5335,20 @@ class InteractivityChecker { * @param config The config object with options to customize this method's behavior * @returns Whether the element is focusable. */ - - isFocusable(element, config) { // Perform checks in order of left to most expensive. // Again, naive approach that does not capture many edge cases and browser quirks. return isPotentiallyFocusable(element) && !this.isDisabled(element) && (config?.ignoreVisibility || this.isVisible(element)); } - } - InteractivityChecker.ɵfac = function InteractivityChecker_Factory(t) { return new (t || InteractivityChecker)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__.Platform)); }; - InteractivityChecker.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: InteractivityChecker, factory: InteractivityChecker.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](InteractivityChecker, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -5837,8 +5366,6 @@ InteractivityChecker.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MOD * the frameElement property is being accessed from a different host address, this property * should be accessed carefully. */ - - function getFrameElement(window) { try { return window.frameElement; @@ -5847,52 +5374,37 @@ function getFrameElement(window) { } } /** Checks whether the specified element has any geometry / rectangles. */ - - function hasGeometry(element) { // Use logic from jQuery to check for an invisible element. // See https://github.com/jquery/jquery/blob/master/src/css/hiddenVisibleSelectors.js#L12 return !!(element.offsetWidth || element.offsetHeight || typeof element.getClientRects === 'function' && element.getClientRects().length); } /** Gets whether an element's */ - - function isNativeFormElement(element) { let nodeName = element.nodeName.toLowerCase(); return nodeName === 'input' || nodeName === 'select' || nodeName === 'button' || nodeName === 'textarea'; } /** Gets whether an element is an ``. */ - - function isHiddenInput(element) { return isInputElement(element) && element.type == 'hidden'; } /** Gets whether an element is an anchor that has an href attribute. */ - - function isAnchorWithHref(element) { return isAnchorElement(element) && element.hasAttribute('href'); } /** Gets whether an element is an input element. */ - - function isInputElement(element) { return element.nodeName.toLowerCase() == 'input'; } /** Gets whether an element is an anchor element. */ - - function isAnchorElement(element) { return element.nodeName.toLowerCase() == 'a'; } /** Gets whether an element has a valid tabindex. */ - - function hasValidTabIndex(element) { if (!element.hasAttribute('tabindex') || element.tabIndex === undefined) { return false; } - let tabIndex = element.getAttribute('tabindex'); return !!(tabIndex && !isNaN(parseInt(tabIndex, 10))); } @@ -5900,20 +5412,15 @@ function hasValidTabIndex(element) { * Returns the parsed tabindex from the element attributes instead of returning the * evaluated tabindex from the browsers defaults. */ - - function getTabIndexValue(element) { if (!hasValidTabIndex(element)) { return null; - } // See browser issue in Gecko https://bugzilla.mozilla.org/show_bug.cgi?id=1128054 - - + } + // See browser issue in Gecko https://bugzilla.mozilla.org/show_bug.cgi?id=1128054 const tabIndex = parseInt(element.getAttribute('tabindex') || '', 10); return isNaN(tabIndex) ? -1 : tabIndex; } /** Checks whether the specified element is potentially tabbable on iOS */ - - function isPotentiallyTabbableIOS(element) { let nodeName = element.nodeName.toLowerCase(); let inputType = nodeName === 'input' && element.type; @@ -5923,23 +5430,19 @@ function isPotentiallyTabbableIOS(element) { * Gets whether an element is potentially focusable without taking current visible/disabled state * into account. */ - - function isPotentiallyFocusable(element) { // Inputs are potentially focusable *unless* they're type="hidden". if (isHiddenInput(element)) { return false; } - return isNativeFormElement(element) || isAnchorWithHref(element) || element.hasAttribute('contenteditable') || hasValidTabIndex(element); } /** Gets the parent window of a DOM node with regards of being inside of an iframe. */ - - function getWindow(node) { // ownerDocument is null if `node` itself *is* a document. return node.ownerDocument && node.ownerDocument.defaultView || window; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -5947,7 +5450,6 @@ function getWindow(node) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Class that allows for trapping focus within a DOM element. * @@ -5958,59 +5460,44 @@ function getWindow(node) { * @deprecated Use `ConfigurableFocusTrap` instead. * @breaking-change 11.0.0 */ - - class FocusTrap { + /** Whether the focus trap is active. */ + get enabled() { + return this._enabled; + } + set enabled(value) { + this._enabled = value; + if (this._startAnchor && this._endAnchor) { + this._toggleAnchorTabIndex(value, this._startAnchor); + this._toggleAnchorTabIndex(value, this._endAnchor); + } + } constructor(_element, _checker, _ngZone, _document, deferAnchors = false) { this._element = _element; this._checker = _checker; this._ngZone = _ngZone; this._document = _document; - this._hasAttached = false; // Event listeners for the anchors. Need to be regular functions so that we can unbind them later. - + this._hasAttached = false; + // Event listeners for the anchors. Need to be regular functions so that we can unbind them later. this.startAnchorListener = () => this.focusLastTabbableElement(); - this.endAnchorListener = () => this.focusFirstTabbableElement(); - this._enabled = true; - if (!deferAnchors) { this.attachAnchors(); } } - /** Whether the focus trap is active. */ - - - get enabled() { - return this._enabled; - } - - set enabled(value) { - this._enabled = value; - - if (this._startAnchor && this._endAnchor) { - this._toggleAnchorTabIndex(value, this._startAnchor); - - this._toggleAnchorTabIndex(value, this._endAnchor); - } - } /** Destroys the focus trap by cleaning up the anchors. */ - - destroy() { const startAnchor = this._startAnchor; const endAnchor = this._endAnchor; - if (startAnchor) { startAnchor.removeEventListener('focus', this.startAnchorListener); startAnchor.remove(); } - if (endAnchor) { endAnchor.removeEventListener('focus', this.endAnchorListener); endAnchor.remove(); } - this._startAnchor = this._endAnchor = null; this._hasAttached = false; } @@ -6020,36 +5507,26 @@ class FocusTrap { * @returns Whether the focus trap managed to attach successfully. This may not be the case * if the target element isn't currently in the DOM. */ - - attachAnchors() { // If we're not on the browser, there can be no focus to trap. if (this._hasAttached) { return true; } - this._ngZone.runOutsideAngular(() => { if (!this._startAnchor) { this._startAnchor = this._createAnchor(); - this._startAnchor.addEventListener('focus', this.startAnchorListener); } - if (!this._endAnchor) { this._endAnchor = this._createAnchor(); - this._endAnchor.addEventListener('focus', this.endAnchorListener); } }); - if (this._element.parentNode) { this._element.parentNode.insertBefore(this._startAnchor, this._element); - this._element.parentNode.insertBefore(this._endAnchor, this._element.nextSibling); - this._hasAttached = true; } - return this._hasAttached; } /** @@ -6057,8 +5534,6 @@ class FocusTrap { * @returns Returns a promise that resolves with a boolean, depending * on whether focus was moved successfully. */ - - focusInitialElementWhenReady(options) { return new Promise(resolve => { this._executeOnStable(() => resolve(this.focusInitialElement(options))); @@ -6070,8 +5545,6 @@ class FocusTrap { * @returns Returns a promise that resolves with a boolean, depending * on whether focus was moved successfully. */ - - focusFirstTabbableElementWhenReady(options) { return new Promise(resolve => { this._executeOnStable(() => resolve(this.focusFirstTabbableElement(options))); @@ -6083,8 +5556,6 @@ class FocusTrap { * @returns Returns a promise that resolves with a boolean, depending * on whether focus was moved successfully. */ - - focusLastTabbableElementWhenReady(options) { return new Promise(resolve => { this._executeOnStable(() => resolve(this.focusLastTabbableElement(options))); @@ -6095,12 +5566,9 @@ class FocusTrap { * @param bound The boundary to get (start or end of trapped region). * @returns The boundary element. */ - - _getRegionBoundary(bound) { // Contains the deprecated version of selector, for temporary backwards comparability. const markers = this._element.querySelectorAll(`[cdk-focus-region-${bound}], ` + `[cdkFocusRegion${bound}], ` + `[cdk-focus-${bound}]`); - if (typeof ngDevMode === 'undefined' || ngDevMode) { for (let i = 0; i < markers.length; i++) { // @breaking-change 8.0.0 @@ -6111,135 +5579,99 @@ class FocusTrap { } } } - if (bound == 'start') { return markers.length ? markers[0] : this._getFirstTabbableElement(this._element); } - return markers.length ? markers[markers.length - 1] : this._getLastTabbableElement(this._element); } /** * Focuses the element that should be focused when the focus trap is initialized. * @returns Whether focus was moved successfully. */ - - focusInitialElement(options) { // Contains the deprecated version of selector, for temporary backwards comparability. const redirectToElement = this._element.querySelector(`[cdk-focus-initial], ` + `[cdkFocusInitial]`); - if (redirectToElement) { // @breaking-change 8.0.0 if ((typeof ngDevMode === 'undefined' || ngDevMode) && redirectToElement.hasAttribute(`cdk-focus-initial`)) { console.warn(`Found use of deprecated attribute 'cdk-focus-initial', ` + `use 'cdkFocusInitial' instead. The deprecated attribute ` + `will be removed in 8.0.0`, redirectToElement); - } // Warn the consumer if the element they've pointed to + } + // Warn the consumer if the element they've pointed to // isn't focusable, when not in production mode. - - if ((typeof ngDevMode === 'undefined' || ngDevMode) && !this._checker.isFocusable(redirectToElement)) { console.warn(`Element matching '[cdkFocusInitial]' is not focusable.`, redirectToElement); } - if (!this._checker.isFocusable(redirectToElement)) { const focusableChild = this._getFirstTabbableElement(redirectToElement); - focusableChild?.focus(options); return !!focusableChild; } - redirectToElement.focus(options); return true; } - return this.focusFirstTabbableElement(options); } /** * Focuses the first tabbable element within the focus trap region. * @returns Whether focus was moved successfully. */ - - focusFirstTabbableElement(options) { const redirectToElement = this._getRegionBoundary('start'); - if (redirectToElement) { redirectToElement.focus(options); } - return !!redirectToElement; } /** * Focuses the last tabbable element within the focus trap region. * @returns Whether focus was moved successfully. */ - - focusLastTabbableElement(options) { const redirectToElement = this._getRegionBoundary('end'); - if (redirectToElement) { redirectToElement.focus(options); } - return !!redirectToElement; } /** * Checks whether the focus trap has successfully been attached. */ - - hasAttached() { return this._hasAttached; } /** Get the first tabbable element from a DOM subtree (inclusive). */ - - _getFirstTabbableElement(root) { if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) { return root; } - const children = root.children; - for (let i = 0; i < children.length; i++) { const tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE ? this._getFirstTabbableElement(children[i]) : null; - if (tabbableChild) { return tabbableChild; } } - return null; } /** Get the last tabbable element from a DOM subtree (inclusive). */ - - _getLastTabbableElement(root) { if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) { return root; - } // Iterate in reverse DOM order. - - + } + // Iterate in reverse DOM order. const children = root.children; - for (let i = children.length - 1; i >= 0; i--) { const tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE ? this._getLastTabbableElement(children[i]) : null; - if (tabbableChild) { return tabbableChild; } } - return null; } /** Creates an anchor element. */ - - _createAnchor() { const anchor = this._document.createElement('div'); - this._toggleAnchorTabIndex(this._enabled, anchor); - anchor.classList.add('cdk-visually-hidden'); anchor.classList.add('cdk-focus-trap-anchor'); anchor.setAttribute('aria-hidden', 'true'); @@ -6250,8 +5682,6 @@ class FocusTrap { * @param isEnabled Whether the focus trap is enabled. * @param anchor Anchor on which to toggle the tabindex. */ - - _toggleAnchorTabIndex(isEnabled, anchor) { // Remove the tabindex completely, rather than setting it to -1, because if the // element has a tabindex, the user might still hit it when navigating with the arrow keys. @@ -6261,18 +5691,13 @@ class FocusTrap { * Toggles the`tabindex` of both anchors to either trap Tab focus or allow it to escape. * @param enabled: Whether the anchors should trap Tab. */ - - toggleAnchors(enabled) { if (this._startAnchor && this._endAnchor) { this._toggleAnchorTabIndex(enabled, this._startAnchor); - this._toggleAnchorTabIndex(enabled, this._endAnchor); } } /** Executes a function when the zone is stable. */ - - _executeOnStable(fn) { if (this._ngZone.isStable) { fn(); @@ -6280,15 +5705,12 @@ class FocusTrap { this._ngZone.onStable.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.take)(1)).subscribe(fn); } } - } /** * Factory that allows easy instantiation of focus traps. * @deprecated Use `ConfigurableFocusTrapFactory` instead. * @breaking-change 11.0.0 */ - - class FocusTrapFactory { constructor(_checker, _ngZone, _document) { this._checker = _checker; @@ -6302,24 +5724,18 @@ class FocusTrapFactory { * manually by the user. * @returns The created focus trap instance. */ - - create(element, deferCaptureElements = false) { return new FocusTrap(element, this._checker, this._ngZone, this._document, deferCaptureElements); } - } - FocusTrapFactory.ɵfac = function FocusTrapFactory_Factory(t) { return new (t || FocusTrapFactory)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](InteractivityChecker), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT)); }; - FocusTrapFactory.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: FocusTrapFactory, factory: FocusTrapFactory.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](FocusTrapFactory, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -6341,29 +5757,11 @@ FocusTrapFactory.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_ }, null); })(); /** Directive for trapping focus within a region. */ - - class CdkTrapFocus { - constructor(_elementRef, _focusTrapFactory, - /** - * @deprecated No longer being used. To be removed. - * @breaking-change 13.0.0 - */ - _document) { - this._elementRef = _elementRef; - this._focusTrapFactory = _focusTrapFactory; - /** Previously focused element to restore focus to upon destroy when using autoCapture. */ - - this._previouslyFocusedElement = null; - this.focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement, true); - } /** Whether the focus trap is active. */ - - get enabled() { return this.focusTrap.enabled; } - set enabled(value) { this.focusTrap.enabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_11__.coerceBooleanProperty)(value); } @@ -6371,60 +5769,58 @@ class CdkTrapFocus { * Whether the directive should automatically move focus into the trapped region upon * initialization and return focus to the previous activeElement upon destruction. */ - - get autoCapture() { return this._autoCapture; } - set autoCapture(value) { this._autoCapture = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_11__.coerceBooleanProperty)(value); } - + constructor(_elementRef, _focusTrapFactory, + /** + * @deprecated No longer being used. To be removed. + * @breaking-change 13.0.0 + */ + _document) { + this._elementRef = _elementRef; + this._focusTrapFactory = _focusTrapFactory; + /** Previously focused element to restore focus to upon destroy when using autoCapture. */ + this._previouslyFocusedElement = null; + this.focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement, true); + } ngOnDestroy() { - this.focusTrap.destroy(); // If we stored a previously focused element when using autoCapture, return focus to that + this.focusTrap.destroy(); + // If we stored a previously focused element when using autoCapture, return focus to that // element now that the trapped region is being destroyed. - if (this._previouslyFocusedElement) { this._previouslyFocusedElement.focus(); - this._previouslyFocusedElement = null; } } - ngAfterContentInit() { this.focusTrap.attachAnchors(); - if (this.autoCapture) { this._captureFocus(); } } - ngDoCheck() { if (!this.focusTrap.hasAttached()) { this.focusTrap.attachAnchors(); } } - ngOnChanges(changes) { const autoCaptureChange = changes['autoCapture']; - if (autoCaptureChange && !autoCaptureChange.firstChange && this.autoCapture && this.focusTrap.hasAttached()) { this._captureFocus(); } } - _captureFocus() { this._previouslyFocusedElement = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__._getFocusedElementPierceShadowDom)(); this.focusTrap.focusInitialElementWhenReady(); } - } - CdkTrapFocus.ɵfac = function CdkTrapFocus_Factory(t) { return new (t || CdkTrapFocus)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](FocusTrapFactory), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_common__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT)); }; - CdkTrapFocus.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: CdkTrapFocus, selectors: [["", "cdkTrapFocus", ""]], @@ -6435,7 +5831,6 @@ CdkTrapFocus.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[" exportAs: ["cdkTrapFocus"], features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CdkTrapFocus, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, @@ -6466,6 +5861,7 @@ CdkTrapFocus.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[" }] }); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -6473,65 +5869,48 @@ CdkTrapFocus.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[" * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Class that allows for trapping focus within a DOM element. * * This class uses a strategy pattern that determines how it traps focus. * See FocusTrapInertStrategy. */ - - class ConfigurableFocusTrap extends FocusTrap { - constructor(_element, _checker, _ngZone, _document, _focusTrapManager, _inertStrategy, config) { - super(_element, _checker, _ngZone, _document, config.defer); - this._focusTrapManager = _focusTrapManager; - this._inertStrategy = _inertStrategy; - - this._focusTrapManager.register(this); - } /** Whether the FocusTrap is enabled. */ - - get enabled() { return this._enabled; } - set enabled(value) { this._enabled = value; - if (this._enabled) { this._focusTrapManager.register(this); } else { this._focusTrapManager.deregister(this); } } + constructor(_element, _checker, _ngZone, _document, _focusTrapManager, _inertStrategy, config) { + super(_element, _checker, _ngZone, _document, config.defer); + this._focusTrapManager = _focusTrapManager; + this._inertStrategy = _inertStrategy; + this._focusTrapManager.register(this); + } /** Notifies the FocusTrapManager that this FocusTrap will be destroyed. */ - - destroy() { this._focusTrapManager.deregister(this); - super.destroy(); } /** @docs-private Implemented as part of ManagedFocusTrap. */ - - _enable() { this._inertStrategy.preventFocus(this); - this.toggleAnchors(true); } /** @docs-private Implemented as part of ManagedFocusTrap. */ - - _disable() { this._inertStrategy.allowFocus(this); - this.toggleAnchors(false); } - } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -6547,11 +5926,9 @@ class ConfigurableFocusTrap extends FocusTrap { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** The injection token used to specify the inert strategy. */ - - const FOCUS_TRAP_INERT_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('FOCUS_TRAP_INERT_STRATEGY'); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -6559,42 +5936,32 @@ const FOCUS_TRAP_INERT_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_0__ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Lightweight FocusTrapInertStrategy that adds a document focus event * listener to redirect focus back inside the FocusTrap. */ - class EventListenerFocusTrapInertStrategy { constructor() { /** Focus event handler. */ this._listener = null; } /** Adds a document event listener that keeps focus inside the FocusTrap. */ - - preventFocus(focusTrap) { // Ensure there's only one listener per document if (this._listener) { focusTrap._document.removeEventListener('focus', this._listener, true); } - this._listener = e => this._trapFocus(focusTrap, e); - focusTrap._ngZone.runOutsideAngular(() => { focusTrap._document.addEventListener('focus', this._listener, true); }); } /** Removes the event listener added in preventFocus. */ - - allowFocus(focusTrap) { if (!this._listener) { return; } - focusTrap._document.removeEventListener('focus', this._listener, true); - this._listener = null; } /** @@ -6604,13 +5971,11 @@ class EventListenerFocusTrapInertStrategy { * This is an event listener callback. The event listener is added in runOutsideAngular, * so all this code runs outside Angular as well. */ - - _trapFocus(focusTrap, event) { const target = event.target; - const focusTrapRoot = focusTrap._element; // Don't refocus if target was in an overlay, because the overlay might be associated + const focusTrapRoot = focusTrap._element; + // Don't refocus if target was in an overlay, because the overlay might be associated // with an element inside the FocusTrap, ex. mat-select. - if (target && !focusTrapRoot.contains(target) && !target.closest?.('div.cdk-overlay-pane')) { // Some legacy FocusTrap usages have logic that focuses some element on the page // just before FocusTrap is destroyed. For backwards compatibility, wait @@ -6623,8 +5988,8 @@ class EventListenerFocusTrapInertStrategy { }); } } - } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -6632,10 +5997,7 @@ class EventListenerFocusTrapInertStrategy { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Injectable that ensures only the most recently enabled FocusTrap is active. */ - - class FocusTrapManager { constructor() { // A stack of the FocusTraps on the page. Only the FocusTrap at the @@ -6646,54 +6008,40 @@ class FocusTrapManager { * Disables the FocusTrap at the top of the stack, and then pushes * the new FocusTrap onto the stack. */ - - register(focusTrap) { // Dedupe focusTraps that register multiple times. this._focusTrapStack = this._focusTrapStack.filter(ft => ft !== focusTrap); let stack = this._focusTrapStack; - if (stack.length) { stack[stack.length - 1]._disable(); } - stack.push(focusTrap); - focusTrap._enable(); } /** * Removes the FocusTrap from the stack, and activates the * FocusTrap that is the new top of the stack. */ - - deregister(focusTrap) { focusTrap._disable(); - const stack = this._focusTrapStack; const i = stack.indexOf(focusTrap); - if (i !== -1) { stack.splice(i, 1); - if (stack.length) { stack[stack.length - 1]._enable(); } } } - } - FocusTrapManager.ɵfac = function FocusTrapManager_Factory(t) { return new (t || FocusTrapManager)(); }; - FocusTrapManager.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: FocusTrapManager, factory: FocusTrapManager.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](FocusTrapManager, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -6702,6 +6050,7 @@ FocusTrapManager.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_ }] }], null, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -6709,25 +6058,20 @@ FocusTrapManager.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Factory that allows easy instantiation of configurable focus traps. */ - - class ConfigurableFocusTrapFactory { constructor(_checker, _ngZone, _focusTrapManager, _document, _inertStrategy) { this._checker = _checker; this._ngZone = _ngZone; this._focusTrapManager = _focusTrapManager; - this._document = _document; // TODO split up the strategies into different modules, similar to DateAdapter. - + this._document = _document; + // TODO split up the strategies into different modules, similar to DateAdapter. this._inertStrategy = _inertStrategy || new EventListenerFocusTrapInertStrategy(); } - create(element, config = { defer: false }) { let configObject; - if (typeof config === 'boolean') { configObject = { defer: config @@ -6735,22 +6079,17 @@ class ConfigurableFocusTrapFactory { } else { configObject = config; } - return new ConfigurableFocusTrap(element, this._checker, this._ngZone, this._document, this._focusTrapManager, this._inertStrategy, configObject); } - } - ConfigurableFocusTrapFactory.ɵfac = function ConfigurableFocusTrapFactory_Factory(t) { return new (t || ConfigurableFocusTrapFactory)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](InteractivityChecker), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](FocusTrapManager), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](FOCUS_TRAP_INERT_STRATEGY, 8)); }; - ConfigurableFocusTrapFactory.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: ConfigurableFocusTrapFactory, factory: ConfigurableFocusTrapFactory.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ConfigurableFocusTrapFactory, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -6781,6 +6120,7 @@ ConfigurableFocusTrapFactory.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPO }]; }, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -6788,10 +6128,7 @@ ConfigurableFocusTrapFactory.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPO * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Gets whether an event could be a faked `mousedown` event dispatched by a screen reader. */ - - function isFakeMousedownFromScreenReader(event) { // Some screen readers will dispatch a fake `mousedown` event when pressing enter or space on // a clickable element. We can distinguish these events when both `offsetX` and `offsetY` are @@ -6803,16 +6140,15 @@ function isFakeMousedownFromScreenReader(event) { return event.buttons === 0 || event.offsetX === 0 && event.offsetY === 0; } /** Gets whether an event could be a faked `touchstart` event dispatched by a screen reader. */ - - function isFakeTouchstartFromScreenReader(event) { - const touch = event.touches && event.touches[0] || event.changedTouches && event.changedTouches[0]; // A fake `touchstart` can be distinguished from a real one by looking at the `identifier` + const touch = event.touches && event.touches[0] || event.changedTouches && event.changedTouches[0]; + // A fake `touchstart` can be distinguished from a real one by looking at the `identifier` // which is typically >= 0 on a real device versus -1 from a screen reader. Just to be safe, // we can also look at `radiusX` and `radiusY`. This behavior was observed against a Windows 10 // device with a touch screen running NVDA v2020.4 and Firefox 85 or Chrome 88. - return !!touch && touch.identifier === -1 && (touch.radiusX == null || touch.radiusX === 1) && (touch.radiusY == null || touch.radiusY === 1); } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -6820,13 +6156,10 @@ function isFakeTouchstartFromScreenReader(event) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Injectable options for the InputModalityDetector. These are shallowly merged with the default * options. */ - - const INPUT_MODALITY_DETECTOR_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('cdk-input-modality-detector-options'); /** * Default options for the InputModalityDetector. @@ -6844,7 +6177,6 @@ const INPUT_MODALITY_DETECTOR_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODU * code as the ContextMenu key on other browsers. When we switch to using event.key, we can * distinguish between the two. */ - const INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS = { ignoreKeys: [_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.ALT, _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.CONTROL, _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.MAC_META, _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.META, _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__.SHIFT] }; @@ -6855,13 +6187,11 @@ const INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS = { * This is the value used by AngularJS Material. Through trial and error (on iPhone 6S) they found * that a value of around 650ms seems appropriate. */ - const TOUCH_BUFFER_MS = 650; /** * Event listener options that enable capturing and also mark the listener as passive if the browser * supports it. */ - const modalityEventListenerOptions = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__.normalizePassiveListenerOptions)({ passive: true, capture: true @@ -6880,93 +6210,80 @@ const modalityEventListenerOptions = (0,_angular_cdk_platform__WEBPACK_IMPORTED_ * update the input modality to keyboard, but in general this service's behavior is largely * undefined. */ - class InputModalityDetector { + /** The most recently detected input modality. */ + get mostRecentModality() { + return this._modality.value; + } constructor(_platform, ngZone, document, options) { this._platform = _platform; /** * The most recently detected input modality event target. Is null if no input modality has been * detected or if the associated event target is null for some unknown reason. */ - this._mostRecentTarget = null; /** The underlying BehaviorSubject that emits whenever an input modality is detected. */ - this._modality = new rxjs__WEBPACK_IMPORTED_MODULE_12__.BehaviorSubject(null); /** * The timestamp of the last touch input modality. Used to determine whether mousedown events * should be attributed to mouse or touch. */ - this._lastTouchMs = 0; /** * Handles keydown events. Must be an arrow function in order to preserve the context when it gets * bound. */ - this._onKeydown = event => { // If this is one of the keys we should ignore, then ignore it and don't update the input // modality to keyboard. if (this._options?.ignoreKeys?.some(keyCode => keyCode === event.keyCode)) { return; } - this._modality.next('keyboard'); - this._mostRecentTarget = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__._getEventTarget)(event); }; /** * Handles mousedown events. Must be an arrow function in order to preserve the context when it * gets bound. */ - - this._onMousedown = event => { // Touches trigger both touch and mouse events, so we need to distinguish between mouse events // that were triggered via mouse vs touch. To do so, check if the mouse event occurs closely // after the previous touch event. if (Date.now() - this._lastTouchMs < TOUCH_BUFFER_MS) { return; - } // Fake mousedown events are fired by some screen readers when controls are activated by the + } + // Fake mousedown events are fired by some screen readers when controls are activated by the // screen reader. Attribute them to keyboard input modality. - - this._modality.next(isFakeMousedownFromScreenReader(event) ? 'keyboard' : 'mouse'); - this._mostRecentTarget = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__._getEventTarget)(event); }; /** * Handles touchstart events. Must be an arrow function in order to preserve the context when it * gets bound. */ - - this._onTouchstart = event => { // Same scenario as mentioned in _onMousedown, but on touch screen devices, fake touchstart // events are fired. Again, attribute to keyboard input modality. if (isFakeTouchstartFromScreenReader(event)) { this._modality.next('keyboard'); - return; - } // Store the timestamp of this touch event, as it's used to distinguish between mouse events + } + // Store the timestamp of this touch event, as it's used to distinguish between mouse events // triggered via mouse vs touch. - - this._lastTouchMs = Date.now(); - this._modality.next('touch'); - this._mostRecentTarget = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__._getEventTarget)(event); }; - - this._options = { ...INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS, + this._options = { + ...INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS, ...options - }; // Skip the first emission as it's null. - + }; + // Skip the first emission as it's null. this.modalityDetected = this._modality.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.skip)(1)); - this.modalityChanged = this.modalityDetected.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.distinctUntilChanged)()); // If we're not in a browser, this service should do nothing, as there's no relevant input + this.modalityChanged = this.modalityDetected.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.distinctUntilChanged)()); + // If we're not in a browser, this service should do nothing, as there's no relevant input // modality to detect. - if (_platform.isBrowser) { ngZone.runOutsideAngular(() => { document.addEventListener('keydown', this._onKeydown, modalityEventListenerOptions); @@ -6975,35 +6292,23 @@ class InputModalityDetector { }); } } - /** The most recently detected input modality. */ - - - get mostRecentModality() { - return this._modality.value; - } - ngOnDestroy() { this._modality.complete(); - if (this._platform.isBrowser) { document.removeEventListener('keydown', this._onKeydown, modalityEventListenerOptions); document.removeEventListener('mousedown', this._onMousedown, modalityEventListenerOptions); document.removeEventListener('touchstart', this._onTouchstart, modalityEventListenerOptions); } } - } - InputModalityDetector.ɵfac = function InputModalityDetector_Factory(t) { return new (t || InputModalityDetector)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__.Platform), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](INPUT_MODALITY_DETECTOR_OPTIONS, 8)); }; - InputModalityDetector.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: InputModalityDetector, factory: InputModalityDetector.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](InputModalityDetector, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -7032,6 +6337,7 @@ InputModalityDetector.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MO }]; }, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -7039,21 +6345,17 @@ InputModalityDetector.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MO * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - const LIVE_ANNOUNCER_ELEMENT_TOKEN = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('liveAnnouncerElement', { providedIn: 'root', factory: LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY }); /** @docs-private */ - function LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY() { return null; } /** Injection token that can be used to configure the default options for the LiveAnnouncer. */ - - const LIVE_ANNOUNCER_DEFAULT_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('LIVE_ANNOUNCER_DEFAULT_OPTIONS'); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -7061,63 +6363,55 @@ const LIVE_ANNOUNCER_DEFAULT_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODUL * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - +let uniqueIds = 0; class LiveAnnouncer { constructor(elementToken, _ngZone, _document, _defaultOptions) { this._ngZone = _ngZone; - this._defaultOptions = _defaultOptions; // We inject the live element and document as `any` because the constructor signature cannot + this._defaultOptions = _defaultOptions; + // We inject the live element and document as `any` because the constructor signature cannot // reference browser globals (HTMLElement, Document) on non-browser environments, since having // a class decorator causes TypeScript to preserve the constructor signature types. - this._document = _document; this._liveElement = elementToken || this._createLiveElement(); } - announce(message, ...args) { const defaultOptions = this._defaultOptions; let politeness; let duration; - if (args.length === 1 && typeof args[0] === 'number') { duration = args[0]; } else { [politeness, duration] = args; } - this.clear(); clearTimeout(this._previousTimeout); - if (!politeness) { politeness = defaultOptions && defaultOptions.politeness ? defaultOptions.politeness : 'polite'; } - if (duration == null && defaultOptions) { duration = defaultOptions.duration; - } // TODO: ensure changing the politeness works on all environments we support. - - - this._liveElement.setAttribute('aria-live', politeness); // This 100ms timeout is necessary for some browser + screen-reader combinations: + } + // TODO: ensure changing the politeness works on all environments we support. + this._liveElement.setAttribute('aria-live', politeness); + if (this._liveElement.id) { + this._exposeAnnouncerToModals(this._liveElement.id); + } + // This 100ms timeout is necessary for some browser + screen-reader combinations: // - Both JAWS and NVDA over IE11 will not announce anything without a non-zero timeout. // - With Chrome and IE11 with NVDA or JAWS, a repeated (identical) message won't be read a // second time without clearing and then using a non-zero delay. // (using JAWS 17 at time of this writing). - - return this._ngZone.runOutsideAngular(() => { if (!this._currentPromise) { this._currentPromise = new Promise(resolve => this._currentResolve = resolve); } - clearTimeout(this._previousTimeout); this._previousTimeout = setTimeout(() => { this._liveElement.textContent = message; - if (typeof duration === 'number') { this._previousTimeout = setTimeout(() => this.clear(), duration); } - this._currentResolve(); - this._currentPromise = this._currentResolve = undefined; }, 100); return this._currentPromise; @@ -7128,14 +6422,11 @@ class LiveAnnouncer { * screen readers from reading the text out again while the user is going * through the page landmarks. */ - - clear() { if (this._liveElement) { this._liveElement.textContent = ''; } } - ngOnDestroy() { clearTimeout(this._previousTimeout); this._liveElement?.remove(); @@ -7143,41 +6434,51 @@ class LiveAnnouncer { this._currentResolve?.(); this._currentPromise = this._currentResolve = undefined; } - _createLiveElement() { const elementClass = 'cdk-live-announcer-element'; - const previousElements = this._document.getElementsByClassName(elementClass); - - const liveEl = this._document.createElement('div'); // Remove any old containers. This can happen when coming in from a server-side-rendered page. - - + const liveEl = this._document.createElement('div'); + // Remove any old containers. This can happen when coming in from a server-side-rendered page. for (let i = 0; i < previousElements.length; i++) { previousElements[i].remove(); } - liveEl.classList.add(elementClass); liveEl.classList.add('cdk-visually-hidden'); liveEl.setAttribute('aria-atomic', 'true'); liveEl.setAttribute('aria-live', 'polite'); - + liveEl.id = `cdk-live-announcer-${uniqueIds++}`; this._document.body.appendChild(liveEl); - return liveEl; } - + /** + * Some browsers won't expose the accessibility node of the live announcer element if there is an + * `aria-modal` and the live announcer is outside of it. This method works around the issue by + * pointing the `aria-owns` of all modals to the live announcer element. + */ + _exposeAnnouncerToModals(id) { + // Note that the selector here is limited to CDK overlays at the moment in order to reduce the + // section of the DOM we need to look through. This should cover all the cases we support, but + // the selector can be expanded if it turns out to be too narrow. + const modals = this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]'); + for (let i = 0; i < modals.length; i++) { + const modal = modals[i]; + const ariaOwns = modal.getAttribute('aria-owns'); + if (!ariaOwns) { + modal.setAttribute('aria-owns', id); + } else if (ariaOwns.indexOf(id) === -1) { + modal.setAttribute('aria-owns', ariaOwns + ' ' + id); + } + } + } } - LiveAnnouncer.ɵfac = function LiveAnnouncer_Factory(t) { return new (t || LiveAnnouncer)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](LIVE_ANNOUNCER_ELEMENT_TOKEN, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](LIVE_ANNOUNCER_DEFAULT_OPTIONS, 8)); }; - LiveAnnouncer.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: LiveAnnouncer, factory: LiveAnnouncer.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](LiveAnnouncer, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -7216,61 +6517,49 @@ LiveAnnouncer.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__ * A directive that works similarly to aria-live, but uses the LiveAnnouncer to ensure compatibility * with a wider range of browsers and screen readers. */ - - class CdkAriaLive { - constructor(_elementRef, _liveAnnouncer, _contentObserver, _ngZone) { - this._elementRef = _elementRef; - this._liveAnnouncer = _liveAnnouncer; - this._contentObserver = _contentObserver; - this._ngZone = _ngZone; - this._politeness = 'polite'; - } /** The aria-live politeness level to use when announcing messages. */ - - get politeness() { return this._politeness; } - set politeness(value) { this._politeness = value === 'off' || value === 'assertive' ? value : 'polite'; - if (this._politeness === 'off') { if (this._subscription) { this._subscription.unsubscribe(); - this._subscription = null; } } else if (!this._subscription) { this._subscription = this._ngZone.runOutsideAngular(() => { return this._contentObserver.observe(this._elementRef).subscribe(() => { // Note that we use textContent here, rather than innerText, in order to avoid a reflow. - const elementText = this._elementRef.nativeElement.textContent; // The `MutationObserver` fires also for attribute + const elementText = this._elementRef.nativeElement.textContent; + // The `MutationObserver` fires also for attribute // changes which we don't want to announce. - if (elementText !== this._previousAnnouncedText) { this._liveAnnouncer.announce(elementText, this._politeness, this.duration); - this._previousAnnouncedText = elementText; } }); }); } } - + constructor(_elementRef, _liveAnnouncer, _contentObserver, _ngZone) { + this._elementRef = _elementRef; + this._liveAnnouncer = _liveAnnouncer; + this._contentObserver = _contentObserver; + this._ngZone = _ngZone; + this._politeness = 'polite'; + } ngOnDestroy() { if (this._subscription) { this._subscription.unsubscribe(); } } - } - CdkAriaLive.ɵfac = function CdkAriaLive_Factory(t) { return new (t || CdkAriaLive)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](LiveAnnouncer), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_cdk_observers__WEBPACK_IMPORTED_MODULE_15__.ContentObserver), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone)); }; - CdkAriaLive.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: CdkAriaLive, selectors: [["", "cdkAriaLive", ""]], @@ -7280,7 +6569,6 @@ CdkAriaLive.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[" }, exportAs: ["cdkAriaLive"] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CdkAriaLive, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, @@ -7309,6 +6597,7 @@ CdkAriaLive.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[" }] }); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -7316,46 +6605,35 @@ CdkAriaLive.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[" * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** InjectionToken for FocusMonitorOptions. */ - - const FOCUS_MONITOR_DEFAULT_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('cdk-focus-monitor-default-options'); /** * Event listener options that enable capturing and also * mark the listener as passive if the browser supports it. */ - const captureEventListenerOptions = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__.normalizePassiveListenerOptions)({ passive: true, capture: true }); /** Monitors mouse and keyboard events to determine the cause of focus events. */ - class FocusMonitor { - constructor(_ngZone, _platform, _inputModalityDetector, - /** @breaking-change 11.0.0 make document required */ + constructor(_ngZone, _platform, _inputModalityDetector, /** @breaking-change 11.0.0 make document required */ document, options) { this._ngZone = _ngZone; this._platform = _platform; this._inputModalityDetector = _inputModalityDetector; /** The focus origin that the next focus event is a result of. */ - this._origin = null; /** Whether the window has just been focused. */ - this._windowFocused = false; /** * Whether the origin was determined via a touch interaction. Necessary as properly attributing * focus events to touch interactions requires special logic. */ - this._originFromTouchInteraction = false; /** Map of elements being monitored to their info. */ - this._elementInfo = new Map(); /** The number of elements currently being monitored. */ - this._monitoredElementCount = 0; /** * Keeps track of the root nodes to which we've currently bound a focus/blur handler, @@ -7363,13 +6641,11 @@ class FocusMonitor { * handlers differently from the rest of the events, because the browser won't emit events * to the document when focus moves inside of a shadow root. */ - this._rootNodeFocusListenerCount = new Map(); /** * Event listener for `focus` events on the window. * Needs to be an arrow function in order to preserve the context when it gets bound. */ - this._windowFocusListener = () => { // Make a note of when the window regains focus, so we can // restore the origin info for the focused element. @@ -7377,45 +6653,38 @@ class FocusMonitor { this._windowFocusTimeoutId = window.setTimeout(() => this._windowFocused = false); }; /** Subject for stopping our InputModalityDetector subscription. */ - - this._stopInputModalityDetector = new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject(); /** * Event listener for `focus` and 'blur' events on the document. * Needs to be an arrow function in order to preserve the context when it gets bound. */ - this._rootNodeFocusAndBlurListener = event => { const target = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__._getEventTarget)(event); - - const handler = event.type === 'focus' ? this._onFocus : this._onBlur; // We need to walk up the ancestor chain in order to support `checkChildren`. - + // We need to walk up the ancestor chain in order to support `checkChildren`. for (let element = target; element; element = element.parentElement) { - handler.call(this, event, element); + if (event.type === 'focus') { + this._onFocus(event, element); + } else { + this._onBlur(event, element); + } } }; - this._document = document; - this._detectionMode = options?.detectionMode || 0 - /* FocusMonitorDetectionMode.IMMEDIATE */ - ; + this._detectionMode = options?.detectionMode || 0 /* FocusMonitorDetectionMode.IMMEDIATE */; } monitor(element, checkChildren = false) { - const nativeElement = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_11__.coerceElement)(element); // Do nothing if we're not on the browser platform or the passed in node isn't an element. - + const nativeElement = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_11__.coerceElement)(element); + // Do nothing if we're not on the browser platform or the passed in node isn't an element. if (!this._platform.isBrowser || nativeElement.nodeType !== 1) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_16__.of)(null); - } // If the element is inside the shadow DOM, we need to bind our focus/blur listeners to + } + // If the element is inside the shadow DOM, we need to bind our focus/blur listeners to // the shadow root, rather than the `document`, because the browser won't emit focus events // to the `document`, if focus is moving within the same shadow root. - - const rootNode = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__._getShadowRoot)(nativeElement) || this._getDocument(); - - const cachedInfo = this._elementInfo.get(nativeElement); // Check if we're already monitoring this element. - - + const cachedInfo = this._elementInfo.get(nativeElement); + // Check if we're already monitoring this element. if (cachedInfo) { if (checkChildren) { // TODO(COMP-318): this can be problematic, because it'll turn all non-checkChildren @@ -7423,78 +6692,56 @@ class FocusMonitor { // robust solution. cachedInfo.checkChildren = true; } - return cachedInfo.subject; - } // Create monitored element info. - - + } + // Create monitored element info. const info = { checkChildren: checkChildren, subject: new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject(), rootNode }; - this._elementInfo.set(nativeElement, info); - this._registerGlobalListeners(info); - return info.subject; } - stopMonitoring(element) { const nativeElement = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_11__.coerceElement)(element); - const elementInfo = this._elementInfo.get(nativeElement); - if (elementInfo) { elementInfo.subject.complete(); - this._setClasses(nativeElement); - this._elementInfo.delete(nativeElement); - this._removeGlobalListeners(elementInfo); } } - focusVia(element, origin, options) { const nativeElement = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_11__.coerceElement)(element); - - const focusedElement = this._getDocument().activeElement; // If the element is focused already, calling `focus` again won't trigger the event listener + const focusedElement = this._getDocument().activeElement; + // If the element is focused already, calling `focus` again won't trigger the event listener // which means that the focus classes won't be updated. If that's the case, update the classes // directly without waiting for an event. - - if (nativeElement === focusedElement) { this._getClosestElementsInfo(nativeElement).forEach(([currentElement, info]) => this._originChanged(currentElement, origin, info)); } else { - this._setOrigin(origin); // `focus` isn't available on the server - - + this._setOrigin(origin); + // `focus` isn't available on the server if (typeof nativeElement.focus === 'function') { nativeElement.focus(options); } } } - ngOnDestroy() { this._elementInfo.forEach((_info, element) => this.stopMonitoring(element)); } /** Access injected document if available or fallback to global document reference */ - - _getDocument() { return this._document || document; } /** Use defaultView of injected document if available or fallback to global window reference */ - - _getWindow() { const doc = this._getDocument(); - return doc.defaultView || window; } - _getFocusOrigin(focusEventTarget) { if (this._origin) { // If the origin was realized via a touch interaction, we need to perform additional checks @@ -7504,7 +6751,8 @@ class FocusMonitor { } else { return this._origin; } - } // If the window has just regained focus, we can restore the most recent origin from before the + } + // If the window has just regained focus, we can restore the most recent origin from before the // window blurred. Otherwise, we've reached the point where we can't identify the source of the // focus. This typically means one of two things happened: // @@ -7513,9 +6761,17 @@ class FocusMonitor { // events). // // Because we can't distinguish between these two cases, we default to setting `program`. - - - return this._windowFocused && this._lastFocusOrigin ? this._lastFocusOrigin : 'program'; + if (this._windowFocused && this._lastFocusOrigin) { + return this._lastFocusOrigin; + } + // If the interaction is coming from an input label, we consider it a mouse interactions. + // This is a special case where focus moves on `click`, rather than `mousedown` which breaks + // our detection, because all our assumptions are for `mousedown`. We need to handle this + // special case, because it's very common for checkboxes and radio buttons. + if (focusEventTarget && this._isLastInteractionFromInputLabel(focusEventTarget)) { + return 'mouse'; + } + return 'program'; } /** * Returns whether the focus event should be attributed to touch. Recall that in IMMEDIATE mode, a @@ -7525,8 +6781,6 @@ class FocusMonitor { * subsequent programmatic focus call triggered by the touch interaction. * @param focusEventTarget The target of the focus event under examination. */ - - _shouldBeAttributedToTouch(focusEventTarget) { // Please note that this check is not perfect. Consider the following edge case: // @@ -7538,17 +6792,13 @@ class FocusMonitor { // #child, #parent is programmatically focused. This code will attribute the focus to touch // instead of program. This is a relatively minor edge-case that can be worked around by using // focusVia(parent, 'program') to focus #parent. - return this._detectionMode === 1 - /* FocusMonitorDetectionMode.EVENTUAL */ - || !!focusEventTarget?.contains(this._inputModalityDetector._mostRecentTarget); + return this._detectionMode === 1 /* FocusMonitorDetectionMode.EVENTUAL */ || !!focusEventTarget?.contains(this._inputModalityDetector._mostRecentTarget); } /** * Sets the focus classes on the element based on the given focus origin. * @param element The element to update the classes on. * @param origin The focus origin. */ - - _setClasses(element, origin) { element.classList.toggle('cdk-focused', !!origin); element.classList.toggle('cdk-touch-focused', origin === 'touch'); @@ -7563,20 +6813,16 @@ class FocusMonitor { * @param origin The origin to set. * @param isFromInteraction Whether we are setting the origin from an interaction event. */ - - _setOrigin(origin, isFromInteraction = false) { this._ngZone.runOutsideAngular(() => { this._origin = origin; - this._originFromTouchInteraction = origin === 'touch' && isFromInteraction; // If we're in IMMEDIATE mode, reset the origin at the next tick (or in `TOUCH_BUFFER_MS` ms + this._originFromTouchInteraction = origin === 'touch' && isFromInteraction; + // If we're in IMMEDIATE mode, reset the origin at the next tick (or in `TOUCH_BUFFER_MS` ms // for a touch event). We reset the origin at the next tick because Firefox focuses one tick // after the interaction event. We wait `TOUCH_BUFFER_MS` ms before resetting the origin for // a touch event because when a touch event is fired, the associated focus event isn't yet in // the event queue. Before doing so, clear any pending timeouts. - - if (this._detectionMode === 0 - /* FocusMonitorDetectionMode.IMMEDIATE */ - ) { + if (this._detectionMode === 0 /* FocusMonitorDetectionMode.IMMEDIATE */) { clearTimeout(this._originTimeoutId); const ms = this._originFromTouchInteraction ? TOUCH_BUFFER_MS : 1; this._originTimeoutId = setTimeout(() => this._origin = null, ms); @@ -7588,8 +6834,6 @@ class FocusMonitor { * @param event The focus event. * @param element The monitored element. */ - - _onFocus(event, element) { // NOTE(mmalerba): We currently set the classes based on the focus origin of the most recent // focus event affecting the monitored element. If we want to use the origin of the first event @@ -7598,13 +6842,10 @@ class FocusMonitor { // If we are not counting child-element-focus as focused, make sure that the event target is the // monitored element itself. const elementInfo = this._elementInfo.get(element); - const focusEventTarget = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__._getEventTarget)(event); - if (!elementInfo || !elementInfo.checkChildren && element !== focusEventTarget) { return; } - this._originChanged(element, this._getFocusOrigin(focusEventTarget), elementInfo); } /** @@ -7612,101 +6853,76 @@ class FocusMonitor { * @param event The blur event. * @param element The monitored element. */ - - _onBlur(event, element) { // If we are counting child-element-focus as focused, make sure that we aren't just blurring in // order to focus another child of the monitored element. const elementInfo = this._elementInfo.get(element); - if (!elementInfo || elementInfo.checkChildren && event.relatedTarget instanceof Node && element.contains(event.relatedTarget)) { return; } - this._setClasses(element); - this._emitOrigin(elementInfo, null); } - _emitOrigin(info, origin) { if (info.subject.observers.length) { this._ngZone.run(() => info.subject.next(origin)); } } - _registerGlobalListeners(elementInfo) { if (!this._platform.isBrowser) { return; } - const rootNode = elementInfo.rootNode; const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode) || 0; - if (!rootNodeFocusListeners) { this._ngZone.runOutsideAngular(() => { rootNode.addEventListener('focus', this._rootNodeFocusAndBlurListener, captureEventListenerOptions); rootNode.addEventListener('blur', this._rootNodeFocusAndBlurListener, captureEventListenerOptions); }); } - - this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners + 1); // Register global listeners when first element is monitored. - - + this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners + 1); + // Register global listeners when first element is monitored. if (++this._monitoredElementCount === 1) { // Note: we listen to events in the capture phase so we // can detect them even if the user stops propagation. this._ngZone.runOutsideAngular(() => { const window = this._getWindow(); - window.addEventListener('focus', this._windowFocusListener); - }); // The InputModalityDetector is also just a collection of global listeners. - - + }); + // The InputModalityDetector is also just a collection of global listeners. this._inputModalityDetector.modalityDetected.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.takeUntil)(this._stopInputModalityDetector)).subscribe(modality => { - this._setOrigin(modality, true - /* isFromInteraction */ - ); + this._setOrigin(modality, true /* isFromInteraction */); }); } } _removeGlobalListeners(elementInfo) { const rootNode = elementInfo.rootNode; - if (this._rootNodeFocusListenerCount.has(rootNode)) { const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode); - if (rootNodeFocusListeners > 1) { this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners - 1); } else { rootNode.removeEventListener('focus', this._rootNodeFocusAndBlurListener, captureEventListenerOptions); rootNode.removeEventListener('blur', this._rootNodeFocusAndBlurListener, captureEventListenerOptions); - this._rootNodeFocusListenerCount.delete(rootNode); } - } // Unregister global listeners when last element is unmonitored. - - + } + // Unregister global listeners when last element is unmonitored. if (! --this._monitoredElementCount) { const window = this._getWindow(); - - window.removeEventListener('focus', this._windowFocusListener); // Equivalently, stop our InputModalityDetector subscription. - - this._stopInputModalityDetector.next(); // Clear timeouts for all potentially pending timeouts to prevent the leaks. - - + window.removeEventListener('focus', this._windowFocusListener); + // Equivalently, stop our InputModalityDetector subscription. + this._stopInputModalityDetector.next(); + // Clear timeouts for all potentially pending timeouts to prevent the leaks. clearTimeout(this._windowFocusTimeoutId); clearTimeout(this._originTimeoutId); } } /** Updates all the state on an element once its focus origin has changed. */ - - _originChanged(element, origin, elementInfo) { this._setClasses(element, origin); - this._emitOrigin(elementInfo, origin); - this._lastFocusOrigin = origin; } /** @@ -7714,32 +6930,50 @@ class FocusMonitor { * all of its ancestors that have enabled `checkChildren`. * @param element Element from which to start the search. */ - - _getClosestElementsInfo(element) { const results = []; - this._elementInfo.forEach((info, currentElement) => { if (currentElement === element || info.checkChildren && currentElement.contains(element)) { results.push([currentElement, info]); } }); - return results; } - + /** + * Returns whether an interaction is likely to have come from the user clicking the `label` of + * an `input` or `textarea` in order to focus it. + * @param focusEventTarget Target currently receiving focus. + */ + _isLastInteractionFromInputLabel(focusEventTarget) { + const { + _mostRecentTarget: mostRecentTarget, + mostRecentModality + } = this._inputModalityDetector; + // If the last interaction used the mouse on an element contained by one of the labels + // of an `input`/`textarea` that is currently focused, it is very likely that the + // user redirected focus using the label. + if (mostRecentModality !== 'mouse' || !mostRecentTarget || mostRecentTarget === focusEventTarget || focusEventTarget.nodeName !== 'INPUT' && focusEventTarget.nodeName !== 'TEXTAREA' || focusEventTarget.disabled) { + return false; + } + const labels = focusEventTarget.labels; + if (labels) { + for (let i = 0; i < labels.length; i++) { + if (labels[i].contains(mostRecentTarget)) { + return true; + } + } + } + return false; + } } - FocusMonitor.ɵfac = function FocusMonitor_Factory(t) { return new (t || FocusMonitor)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__.Platform), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](InputModalityDetector), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](FOCUS_MONITOR_DEFAULT_OPTIONS, 8)); }; - FocusMonitor.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: FocusMonitor, factory: FocusMonitor.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](FocusMonitor, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -7781,47 +7015,47 @@ FocusMonitor.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[ * focused. * 2) cdkMonitorSubtreeFocus: considers an element focused if it or any of its children are focused. */ - - class CdkMonitorFocus { constructor(_elementRef, _focusMonitor) { this._elementRef = _elementRef; this._focusMonitor = _focusMonitor; + this._focusOrigin = null; this.cdkFocusChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); } - + get focusOrigin() { + return this._focusOrigin; + } ngAfterViewInit() { const element = this._elementRef.nativeElement; - this._monitorSubscription = this._focusMonitor.monitor(element, element.nodeType === 1 && element.hasAttribute('cdkMonitorSubtreeFocus')).subscribe(origin => this.cdkFocusChange.emit(origin)); + this._monitorSubscription = this._focusMonitor.monitor(element, element.nodeType === 1 && element.hasAttribute('cdkMonitorSubtreeFocus')).subscribe(origin => { + this._focusOrigin = origin; + this.cdkFocusChange.emit(origin); + }); } - ngOnDestroy() { this._focusMonitor.stopMonitoring(this._elementRef); - if (this._monitorSubscription) { this._monitorSubscription.unsubscribe(); } } - } - CdkMonitorFocus.ɵfac = function CdkMonitorFocus_Factory(t) { return new (t || CdkMonitorFocus)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](FocusMonitor)); }; - CdkMonitorFocus.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: CdkMonitorFocus, selectors: [["", "cdkMonitorElementFocus", ""], ["", "cdkMonitorSubtreeFocus", ""]], outputs: { cdkFocusChange: "cdkFocusChange" - } + }, + exportAs: ["cdkMonitorFocus"] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CdkMonitorFocus, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ - selector: '[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]' + selector: '[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]', + exportAs: 'cdkMonitorFocus' }] }], function () { return [{ @@ -7835,6 +7069,7 @@ CdkMonitorFocus.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ }] }); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -7842,16 +7077,11 @@ CdkMonitorFocus.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** CSS class applied to the document body when in black-on-white high-contrast mode. */ - - const BLACK_ON_WHITE_CSS_CLASS = 'cdk-high-contrast-black-on-white'; /** CSS class applied to the document body when in white-on-black high-contrast mode. */ - const WHITE_ON_BLACK_CSS_CLASS = 'cdk-high-contrast-white-on-black'; /** CSS class applied to the document body when in high-contrast mode. */ - const HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS = 'cdk-high-contrast-active'; /** * Service to determine whether the browser is currently in a high-contrast-mode environment. @@ -7864,91 +7094,80 @@ const HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS = 'cdk-high-contrast-active'; * Mode. This service does not detect high-contrast mode as added by the Chrome "High Contrast" * browser extension. */ - class HighContrastModeDetector { constructor(_platform, document) { this._platform = _platform; this._document = document; + this._breakpointSubscription = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_cdk_layout__WEBPACK_IMPORTED_MODULE_18__.BreakpointObserver).observe('(forced-colors: active)').subscribe(() => { + if (this._hasCheckedHighContrastMode) { + this._hasCheckedHighContrastMode = false; + this._applyBodyHighContrastModeCssClasses(); + } + }); } /** Gets the current high-contrast-mode for the page. */ - - getHighContrastMode() { if (!this._platform.isBrowser) { - return 0 - /* HighContrastMode.NONE */ - ; - } // Create a test element with an arbitrary background-color that is neither black nor + return 0 /* HighContrastMode.NONE */; + } + // Create a test element with an arbitrary background-color that is neither black nor // white; high-contrast mode will coerce the color to either black or white. Also ensure that // appending the test element to the DOM does not affect layout by absolutely positioning it - - const testElement = this._document.createElement('div'); - testElement.style.backgroundColor = 'rgb(1,2,3)'; testElement.style.position = 'absolute'; - - this._document.body.appendChild(testElement); // Get the computed style for the background color, collapsing spaces to normalize between + this._document.body.appendChild(testElement); + // Get the computed style for the background color, collapsing spaces to normalize between // browsers. Once we get this color, we no longer need the test element. Access the `window` // via the document so we can fake it in tests. Note that we have extra null checks, because // this logic will likely run during app bootstrap and throwing can break the entire app. - - const documentWindow = this._document.defaultView || window; const computedStyle = documentWindow && documentWindow.getComputedStyle ? documentWindow.getComputedStyle(testElement) : null; const computedColor = (computedStyle && computedStyle.backgroundColor || '').replace(/ /g, ''); testElement.remove(); - switch (computedColor) { + // Pre Windows 11 dark theme. case 'rgb(0,0,0)': - return 2 - /* HighContrastMode.WHITE_ON_BLACK */ - ; - + // Windows 11 dark themes. + case 'rgb(45,50,54)': + case 'rgb(32,32,32)': + return 2 /* HighContrastMode.WHITE_ON_BLACK */; + // Pre Windows 11 light theme. case 'rgb(255,255,255)': - return 1 - /* HighContrastMode.BLACK_ON_WHITE */ - ; + // Windows 11 light theme. + case 'rgb(255,250,239)': + return 1 /* HighContrastMode.BLACK_ON_WHITE */; } - return 0 - /* HighContrastMode.NONE */ - ; + return 0 /* HighContrastMode.NONE */; } - /** Applies CSS classes indicating high-contrast mode to document body (browser-only). */ - + ngOnDestroy() { + this._breakpointSubscription.unsubscribe(); + } + /** Applies CSS classes indicating high-contrast mode to document body (browser-only). */ _applyBodyHighContrastModeCssClasses() { if (!this._hasCheckedHighContrastMode && this._platform.isBrowser && this._document.body) { const bodyClasses = this._document.body.classList; bodyClasses.remove(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, BLACK_ON_WHITE_CSS_CLASS, WHITE_ON_BLACK_CSS_CLASS); this._hasCheckedHighContrastMode = true; const mode = this.getHighContrastMode(); - - if (mode === 1 - /* HighContrastMode.BLACK_ON_WHITE */ - ) { + if (mode === 1 /* HighContrastMode.BLACK_ON_WHITE */) { bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, BLACK_ON_WHITE_CSS_CLASS); - } else if (mode === 2 - /* HighContrastMode.WHITE_ON_BLACK */ - ) { + } else if (mode === 2 /* HighContrastMode.WHITE_ON_BLACK */) { bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, WHITE_ON_BLACK_CSS_CLASS); } } } - } - HighContrastModeDetector.ɵfac = function HighContrastModeDetector_Factory(t) { return new (t || HighContrastModeDetector)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_2__.Platform), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT)); }; - HighContrastModeDetector.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: HighContrastModeDetector, factory: HighContrastModeDetector.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](HighContrastModeDetector, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -7967,6 +7186,7 @@ HighContrastModeDetector.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED }]; }, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -7974,26 +7194,20 @@ HighContrastModeDetector.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - class A11yModule { constructor(highContrastModeDetector) { highContrastModeDetector._applyBodyHighContrastModeCssClasses(); } - } - A11yModule.ɵfac = function A11yModule_Factory(t) { return new (t || A11yModule)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](HighContrastModeDetector)); }; - A11yModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: A11yModule }); A11yModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ imports: [_angular_cdk_observers__WEBPACK_IMPORTED_MODULE_15__.ObserversModule] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](A11yModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule, @@ -8008,6 +7222,7 @@ A11yModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵ }]; }, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8030,7 +7245,6 @@ A11yModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵ - /***/ }), /***/ 2867: @@ -8051,6 +7265,7 @@ __webpack_require__.r(__webpack_exports__); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8058,7 +7273,6 @@ __webpack_require__.r(__webpack_exports__); * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Injection token used to inject the document into Directionality. * This is used so that the value can be faked in tests. @@ -8066,7 +7280,7 @@ __webpack_require__.r(__webpack_exports__); * We can't use the real document in tests because changing the real `dir` causes geometry-based * tests in Safari to fail. * - * We also can't re-provide the DOCUMENT token from platform-brower because the unit tests + * We also can't re-provide the DOCUMENT token from platform-browser because the unit tests * themselves use things like `querySelector` in test code. * * This token is defined in a separate file from Directionality as a workaround for @@ -8074,16 +7288,15 @@ __webpack_require__.r(__webpack_exports__); * * @docs-private */ - const DIR_DOCUMENT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('cdk-dir-doc', { providedIn: 'root', factory: DIR_DOCUMENT_FACTORY }); /** @docs-private */ - function DIR_DOCUMENT_FACTORY() { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT); } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8091,59 +7304,44 @@ function DIR_DOCUMENT_FACTORY() { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Regex that matches locales with an RTL script. Taken from `goog.i18n.bidi.isRtlLanguage`. */ - - const RTL_LOCALE_PATTERN = /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i; /** Resolves a string value to a specific direction. */ - function _resolveDirectionality(rawValue) { const value = rawValue?.toLowerCase() || ''; - if (value === 'auto' && typeof navigator !== 'undefined' && navigator?.language) { return RTL_LOCALE_PATTERN.test(navigator.language) ? 'rtl' : 'ltr'; } - return value === 'rtl' ? 'rtl' : 'ltr'; } /** * The directionality (LTR / RTL) context for the application (or a subtree of it). * Exposes the current direction and a stream of direction changes. */ - - class Directionality { constructor(_document) { /** The current 'ltr' or 'rtl' value. */ this.value = 'ltr'; /** Stream that emits whenever the 'ltr' / 'rtl' state changes. */ - this.change = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); - if (_document) { const bodyDir = _document.body ? _document.body.dir : null; const htmlDir = _document.documentElement ? _document.documentElement.dir : null; this.value = _resolveDirectionality(bodyDir || htmlDir || 'ltr'); } } - ngOnDestroy() { this.change.complete(); } - } - Directionality.ɵfac = function Directionality_Factory(t) { return new (t || Directionality)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](DIR_DOCUMENT, 8)); }; - Directionality.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: Directionality, factory: Directionality.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](Directionality, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -8162,6 +7360,7 @@ Directionality.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ }]; }, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8169,68 +7368,51 @@ Directionality.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Directive to listen for changes of direction of part of the DOM. * * Provides itself as Directionality such that descendant directives only need to ever inject * Directionality to get the closest direction. */ - - class Dir { constructor() { /** Normalized direction that accounts for invalid/unsupported values. */ this._dir = 'ltr'; /** Whether the `value` has been set to its initial value. */ - this._isInitialized = false; /** Event emitted when the direction changes. */ - this.change = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); } /** @docs-private */ - - get dir() { return this._dir; } - set dir(value) { - const previousValue = this._dir; // Note: `_resolveDirectionality` resolves the language based on the browser's language, + const previousValue = this._dir; + // Note: `_resolveDirectionality` resolves the language based on the browser's language, // whereas the browser does it based on the content of the element. Since doing so based // on the content can be expensive, for now we're doing the simpler matching. - this._dir = _resolveDirectionality(value); this._rawDir = value; - if (previousValue !== this._dir && this._isInitialized) { this.change.emit(this._dir); } } /** Current layout direction of the element. */ - - get value() { return this.dir; } /** Initialize once default value has been set. */ - - ngAfterContentInit() { this._isInitialized = true; } - ngOnDestroy() { this.change.complete(); } - } - Dir.ɵfac = function Dir_Factory(t) { return new (t || Dir)(); }; - Dir.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: Dir, selectors: [["", "dir", ""]], @@ -8252,7 +7434,6 @@ Dir.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefin useExisting: Dir }])] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](Dir, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, @@ -8277,6 +7458,7 @@ Dir.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefin }] }); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8284,19 +7466,14 @@ Dir.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefin * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - class BidiModule {} - BidiModule.ɵfac = function BidiModule_Factory(t) { return new (t || BidiModule)(); }; - BidiModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: BidiModule }); BidiModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({}); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](BidiModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule, @@ -8306,6 +7483,7 @@ BidiModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵ }] }], null, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8328,7 +7506,6 @@ BidiModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵ - /***/ }), /***/ 8971: @@ -8349,6 +7526,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2560); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8356,12 +7534,11 @@ __webpack_require__.r(__webpack_exports__); * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Coerces a data-bound value (typically a string) to a boolean. */ - function coerceBooleanProperty(value) { return value != null && `${value}` !== 'false'; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8369,8 +7546,6 @@ function coerceBooleanProperty(value) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - function coerceNumberProperty(value, fallbackValue = 0) { return _isNumberValue(value) ? Number(value) : fallbackValue; } @@ -8378,14 +7553,13 @@ function coerceNumberProperty(value, fallbackValue = 0) { * Whether the provided value is considered a number. * @docs-private */ - - function _isNumberValue(value) { // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string, // and other non-number values as NaN, where Number just uses 0) but it considers the string // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN. return !isNaN(parseFloat(value)) && !isNaN(Number(value)); } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8393,11 +7567,10 @@ function _isNumberValue(value) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - function coerceArray(value) { return Array.isArray(value) ? value : [value]; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8405,17 +7578,14 @@ function coerceArray(value) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Coerces a value to a CSS pixel value. */ - - function coerceCssPixelValue(value) { if (value == null) { return ''; } - return typeof value === 'string' ? value : `${value}px`; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8423,16 +7593,14 @@ function coerceCssPixelValue(value) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Coerces an ElementRef or an Element into an element. * Useful for APIs that can accept either a ref or the native element itself. */ - - function coerceElement(elementOrRef) { return elementOrRef instanceof _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef ? elementOrRef.nativeElement : elementOrRef; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8440,7 +7608,6 @@ function coerceElement(elementOrRef) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Coerces a value to an array of trimmed non-empty strings. * Any input that is not an array, `null` or `undefined` will be turned into a string @@ -8458,25 +7625,20 @@ function coerceElement(elementOrRef) { * @param value the value to coerce into an array of strings * @param separator split-separator if value isn't an array */ - - function coerceStringArray(value, separator = /\s+/) { const result = []; - if (value != null) { const sourceValues = Array.isArray(value) ? value : `${value}`.split(separator); - for (const sourceValue of sourceValues) { const trimmedString = `${sourceValue}`.trim(); - if (trimmedString) { result.push(trimmedString); } } } - return result; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8495,7 +7657,6 @@ function coerceStringArray(value, separator = /\s+/) { - /***/ }), /***/ 1755: @@ -8516,10 +7677,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "getMultipleValuesInSingleSelectionError": () => (/* binding */ getMultipleValuesInSingleSelectionError), /* harmony export */ "isDataSource": () => (/* binding */ isDataSource) /* harmony export */ }); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 4437); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 745); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 228); -/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2560); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 3932); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 4437); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 745); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 228); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 2560); + @@ -8530,17 +7693,16 @@ __webpack_require__.r(__webpack_exports__); * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - class DataSource {} /** Checks whether an object is a data source. */ - - function isDataSource(value) { // Check if the value is a DataSource by observing if it has a connect function. Cannot // be checked as an `instanceof DataSource` since people could create their own sources - // that match the interface, but don't extend DataSource. - return value && typeof value.connect === 'function'; + // that match the interface, but don't extend DataSource. We also can't use `isObservable` + // here, because of some internal apps. + return value && typeof value.connect === 'function' && !(value instanceof rxjs__WEBPACK_IMPORTED_MODULE_0__.ConnectableObservable); } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8548,23 +7710,18 @@ function isDataSource(value) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** DataSource wrapper for a native array. */ - - class ArrayDataSource extends DataSource { constructor(_data) { super(); this._data = _data; } - connect() { - return (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.isObservable)(this._data) ? this._data : (0,rxjs__WEBPACK_IMPORTED_MODULE_1__.of)(this._data); + return (0,rxjs__WEBPACK_IMPORTED_MODULE_1__.isObservable)(this._data) ? this._data : (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.of)(this._data); } - disconnect() {} - } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8580,7 +7737,6 @@ class ArrayDataSource extends DataSource { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * A repeater that destroys views when they are removed from a * {@link ViewContainerRef}. When new items are inserted into the container, @@ -8590,31 +7746,22 @@ class ArrayDataSource extends DataSource { * @template R The type for the item in each IterableDiffer change record. * @template C The type for the context passed to each embedded view. */ - - class _DisposeViewRepeaterStrategy { applyChanges(changes, viewContainerRef, itemContextFactory, itemValueResolver, itemViewChanged) { changes.forEachOperation((record, adjustedPreviousIndex, currentIndex) => { let view; let operation; - if (record.previousIndex == null) { const insertContext = itemContextFactory(record, adjustedPreviousIndex, currentIndex); view = viewContainerRef.createEmbeddedView(insertContext.templateRef, insertContext.context, insertContext.index); - operation = 1 - /* _ViewRepeaterOperation.INSERTED */ - ; + operation = 1 /* _ViewRepeaterOperation.INSERTED */; } else if (currentIndex == null) { viewContainerRef.remove(adjustedPreviousIndex); - operation = 3 - /* _ViewRepeaterOperation.REMOVED */ - ; + operation = 3 /* _ViewRepeaterOperation.REMOVED */; } else { view = viewContainerRef.get(adjustedPreviousIndex); viewContainerRef.move(view, currentIndex); - operation = 2 - /* _ViewRepeaterOperation.MOVED */ - ; + operation = 2 /* _ViewRepeaterOperation.MOVED */; } if (itemViewChanged) { @@ -8626,10 +7773,9 @@ class _DisposeViewRepeaterStrategy { } }); } - detach() {} - } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8637,7 +7783,6 @@ class _DisposeViewRepeaterStrategy { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * A repeater that caches views when they are removed from a * {@link ViewContainerRef}. When new items are inserted into the container, @@ -8649,8 +7794,6 @@ class _DisposeViewRepeaterStrategy { * @template R The type for the item in each IterableDiffer change record. * @template C The type for the context passed to each embedded view. */ - - class _RecycleViewRepeaterStrategy { constructor() { /** @@ -8665,41 +7808,27 @@ class _RecycleViewRepeaterStrategy { * * TODO(michaeljamesparsons) Investigate whether using a linked list would improve performance. */ - this._viewCache = []; } /** Apply changes to the DOM. */ - - applyChanges(changes, viewContainerRef, itemContextFactory, itemValueResolver, itemViewChanged) { // Rearrange the views to put them in the right location. changes.forEachOperation((record, adjustedPreviousIndex, currentIndex) => { let view; let operation; - if (record.previousIndex == null) { // Item added. const viewArgsFactory = () => itemContextFactory(record, adjustedPreviousIndex, currentIndex); - view = this._insertView(viewArgsFactory, currentIndex, viewContainerRef, itemValueResolver(record)); - operation = view ? 1 - /* _ViewRepeaterOperation.INSERTED */ - : 0 - /* _ViewRepeaterOperation.REPLACED */ - ; + operation = view ? 1 /* _ViewRepeaterOperation.INSERTED */ : 0 /* _ViewRepeaterOperation.REPLACED */; } else if (currentIndex == null) { // Item removed. this._detachAndCacheView(adjustedPreviousIndex, viewContainerRef); - - operation = 3 - /* _ViewRepeaterOperation.REMOVED */ - ; + operation = 3 /* _ViewRepeaterOperation.REMOVED */; } else { // Item moved. view = this._moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, itemValueResolver(record)); - operation = 2 - /* _ViewRepeaterOperation.MOVED */ - ; + operation = 2 /* _ViewRepeaterOperation.MOVED */; } if (itemViewChanged) { @@ -8711,42 +7840,31 @@ class _RecycleViewRepeaterStrategy { } }); } - detach() { for (const view of this._viewCache) { view.destroy(); } - this._viewCache = []; } /** * Inserts a view for a new item, either from the cache or by creating a new * one. Returns `undefined` if the item was inserted into a cached view. */ - - _insertView(viewArgsFactory, currentIndex, viewContainerRef, value) { const cachedView = this._insertViewFromCache(currentIndex, viewContainerRef); - if (cachedView) { cachedView.context.$implicit = value; return undefined; } - const viewArgs = viewArgsFactory(); return viewContainerRef.createEmbeddedView(viewArgs.templateRef, viewArgs.context, viewArgs.index); } /** Detaches the view at the given index and inserts into the view cache. */ - - _detachAndCacheView(index, viewContainerRef) { const detachedView = viewContainerRef.detach(index); - this._maybeCacheView(detachedView, viewContainerRef); } /** Moves view at the previous index to the current index. */ - - _moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, value) { const view = viewContainerRef.get(adjustedPreviousIndex); viewContainerRef.move(view, currentIndex); @@ -8757,17 +7875,15 @@ class _RecycleViewRepeaterStrategy { * Cache the given detached view. If the cache is full, the view will be * destroyed. */ - - _maybeCacheView(view, viewContainerRef) { if (this._viewCache.length < this.viewCacheSize) { this._viewCache.push(view); } else { - const index = viewContainerRef.indexOf(view); // The host component could remove views from the container outside of + const index = viewContainerRef.indexOf(view); + // The host component could remove views from the container outside of // the view repeater. It's unlikely this will occur, but just in case, // destroy the view on its own, otherwise destroy it through the // container to ensure that all the references are removed. - if (index === -1) { view.destroy(); } else { @@ -8776,19 +7892,15 @@ class _RecycleViewRepeaterStrategy { } } /** Inserts a recycled view from the cache at the given index. */ - - _insertViewFromCache(index, viewContainerRef) { const cachedView = this._viewCache.pop(); - if (cachedView) { viewContainerRef.insert(cachedView, index); } - return cachedView || null; } - } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -8796,121 +7908,126 @@ class _RecycleViewRepeaterStrategy { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Class to be used to power selecting one or more options from a list. */ - - class SelectionModel { - constructor(_multiple = false, initiallySelectedValues, _emitChanges = true) { + /** Selected values. */ + get selected() { + if (!this._selected) { + this._selected = Array.from(this._selection.values()); + } + return this._selected; + } + constructor(_multiple = false, initiallySelectedValues, _emitChanges = true, compareWith) { this._multiple = _multiple; this._emitChanges = _emitChanges; + this.compareWith = compareWith; /** Currently-selected values. */ - this._selection = new Set(); /** Keeps track of the deselected options that haven't been emitted by the change event. */ - this._deselectedToEmit = []; /** Keeps track of the selected options that haven't been emitted by the change event. */ - this._selectedToEmit = []; /** Event emitted when the value has changed. */ - - this.changed = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); - + this.changed = new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject(); if (initiallySelectedValues && initiallySelectedValues.length) { if (_multiple) { initiallySelectedValues.forEach(value => this._markSelected(value)); } else { this._markSelected(initiallySelectedValues[0]); - } // Clear the array in order to avoid firing the change event for preselected values. - - + } + // Clear the array in order to avoid firing the change event for preselected values. this._selectedToEmit.length = 0; } } - /** Selected values. */ - - - get selected() { - if (!this._selected) { - this._selected = Array.from(this._selection.values()); - } - - return this._selected; - } /** * Selects a value or an array of values. + * @param values The values to select + * @return Whether the selection changed as a result of this call + * @breaking-change 16.0.0 make return type boolean */ - - select(...values) { this._verifyValueAssignment(values); - values.forEach(value => this._markSelected(value)); - + const changed = this._hasQueuedChanges(); this._emitChangeEvent(); + return changed; } /** * Deselects a value or an array of values. + * @param values The values to deselect + * @return Whether the selection changed as a result of this call + * @breaking-change 16.0.0 make return type boolean */ - - deselect(...values) { this._verifyValueAssignment(values); - values.forEach(value => this._unmarkSelected(value)); - + const changed = this._hasQueuedChanges(); + this._emitChangeEvent(); + return changed; + } + /** + * Sets the selected values + * @param values The new selected values + * @return Whether the selection changed as a result of this call + * @breaking-change 16.0.0 make return type boolean + */ + setSelection(...values) { + this._verifyValueAssignment(values); + const oldValues = this.selected; + const newSelectedSet = new Set(values); + values.forEach(value => this._markSelected(value)); + oldValues.filter(value => !newSelectedSet.has(value)).forEach(value => this._unmarkSelected(value)); + const changed = this._hasQueuedChanges(); this._emitChangeEvent(); + return changed; } /** * Toggles a value between selected and deselected. + * @param value The value to toggle + * @return Whether the selection changed as a result of this call + * @breaking-change 16.0.0 make return type boolean */ - - toggle(value) { - this.isSelected(value) ? this.deselect(value) : this.select(value); + return this.isSelected(value) ? this.deselect(value) : this.select(value); } /** * Clears all of the selected values. + * @param flushEvent Whether to flush the changes in an event. + * If false, the changes to the selection will be flushed along with the next event. + * @return Whether the selection changed as a result of this call + * @breaking-change 16.0.0 make return type boolean */ - - - clear() { + clear(flushEvent = true) { this._unmarkAll(); - - this._emitChangeEvent(); + const changed = this._hasQueuedChanges(); + if (flushEvent) { + this._emitChangeEvent(); + } + return changed; } /** * Determines whether a value is selected. */ - - isSelected(value) { - return this._selection.has(value); + return this._selection.has(this._getConcreteValue(value)); } /** * Determines whether the model does not have a value. */ - - isEmpty() { return this._selection.size === 0; } /** * Determines whether the model has a value. */ - - hasValue() { return !this.isEmpty(); } /** * Sorts the selected values based on a predicate function. */ - - sort(predicate) { if (this._multiple && this.selected) { this._selected.sort(predicate); @@ -8919,18 +8036,13 @@ class SelectionModel { /** * Gets whether multiple values can be selected. */ - - isMultipleSelection() { return this._multiple; } /** Emits a change event and clears the records of selected and deselected values. */ - - _emitChangeEvent() { // Clear the selected values so they can be re-cached. this._selected = null; - if (this._selectedToEmit.length || this._deselectedToEmit.length) { this.changed.next({ source: this, @@ -8942,36 +8054,31 @@ class SelectionModel { } } /** Selects a value. */ - - _markSelected(value) { + value = this._getConcreteValue(value); if (!this.isSelected(value)) { if (!this._multiple) { this._unmarkAll(); } - - this._selection.add(value); - + if (!this.isSelected(value)) { + this._selection.add(value); + } if (this._emitChanges) { this._selectedToEmit.push(value); } } } /** Deselects a value. */ - - _unmarkSelected(value) { + value = this._getConcreteValue(value); if (this.isSelected(value)) { this._selection.delete(value); - if (this._emitChanges) { this._deselectedToEmit.push(value); } } } /** Clears out the selected values. */ - - _unmarkAll() { if (!this.isEmpty()) { this._selection.forEach(value => this._unmarkSelected(value)); @@ -8981,25 +8088,38 @@ class SelectionModel { * Verifies the value assignment and throws an error if the specified value array is * including multiple values while the selection model is not supporting multiple values. */ - - _verifyValueAssignment(values) { if (values.length > 1 && !this._multiple && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw getMultipleValuesInSingleSelectionError(); } } - + /** Whether there are queued up change to be emitted. */ + _hasQueuedChanges() { + return !!(this._deselectedToEmit.length || this._selectedToEmit.length); + } + /** Returns a value that is comparable to inputValue by applying compareWith function, returns the same inputValue otherwise. */ + _getConcreteValue(inputValue) { + if (!this.compareWith) { + return inputValue; + } else { + for (let selectedValue of this._selection) { + if (this.compareWith(inputValue, selectedValue)) { + return selectedValue; + } + } + return inputValue; + } + } } /** * Returns an error that reports that multiple values are passed into a selection model * with a single value. * @docs-private */ - - function getMultipleValuesInSingleSelectionError() { return Error('Cannot pass multiple values into SelectionModel with single-value mode.'); } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -9007,7 +8127,6 @@ function getMultipleValuesInSingleSelectionError() { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Class to coordinate unique selection based on name. * Intended to be consumed as an Angular service. @@ -9017,8 +8136,6 @@ function getMultipleValuesInSingleSelectionError() { * This service does not *store* any IDs and names because they may change at any time, so it is * less error-prone if they are simply passed through when the events occur. */ - - class UniqueSelectionDispatcher { constructor() { this._listeners = []; @@ -9028,8 +8145,6 @@ class UniqueSelectionDispatcher { * @param id ID of the item. * @param name Name of the item. */ - - notify(id, name) { for (let listener of this._listeners) { listener(id, name); @@ -9039,42 +8154,35 @@ class UniqueSelectionDispatcher { * Listen for future changes to item selection. * @return Function used to deregister listener */ - - listen(listener) { this._listeners.push(listener); - return () => { this._listeners = this._listeners.filter(registered => { return listener !== registered; }); }; } - ngOnDestroy() { this._listeners = []; } - } - UniqueSelectionDispatcher.ɵfac = function UniqueSelectionDispatcher_Factory(t) { return new (t || UniqueSelectionDispatcher)(); }; - -UniqueSelectionDispatcher.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjectable"]({ +UniqueSelectionDispatcher.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjectable"]({ token: UniqueSelectionDispatcher, factory: UniqueSelectionDispatcher.ɵfac, providedIn: 'root' }); - (function () { - (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵsetClassMetadata"](UniqueSelectionDispatcher, [{ - type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Injectable, + (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵsetClassMetadata"](UniqueSelectionDispatcher, [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_4__.Injectable, args: [{ providedIn: 'root' }] }], null, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -9090,14 +8198,12 @@ UniqueSelectionDispatcher.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTE * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Injection token for {@link _ViewRepeater}. This token is for use by Angular Material only. * @docs-private */ +const _VIEW_REPEATER_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_4__.InjectionToken('_ViewRepeater'); - -const _VIEW_REPEATER_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_3__.InjectionToken('_ViewRepeater'); /** * @license * Copyright Google LLC All Rights Reserved. @@ -9120,7 +8226,6 @@ const _VIEW_REPEATER_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_3__.I - /***/ }), /***/ 7727: @@ -9157,10 +8262,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/common */ 4666); /* harmony import */ var _angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/cdk/scrolling */ 6328); /* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/cdk/platform */ 9107); -/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/coercion */ 8971); +/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/coercion */ 8971); /* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/a11y */ 4218); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 228); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 6078); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 228); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 6078); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 8653); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 8184); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ 833); @@ -9183,6 +8288,7 @@ __webpack_require__.r(__webpack_exports__); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -9190,18 +8296,15 @@ __webpack_require__.r(__webpack_exports__); * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Shallow-extends a stylesheet object with another stylesheet-like object. * Note that the keys in `source` have to be dash-cased. * @docs-private */ - function extendStyles(dest, source, importantProperties) { for (let key in source) { if (source.hasOwnProperty(key)) { const value = source[key]; - if (value) { dest.setProperty(key, value, importantProperties?.has(key) ? 'important' : ''); } else { @@ -9209,7 +8312,6 @@ function extendStyles(dest, source, importantProperties) { } } } - return dest; } /** @@ -9218,8 +8320,6 @@ function extendStyles(dest, source, importantProperties) { * @param enable Whether the drag interactions should be enabled. * @docs-private */ - - function toggleNativeDragInteractions(element, enable) { const userSelect = enable ? '' : 'none'; extendStyles(element.style, { @@ -9239,8 +8339,6 @@ function toggleNativeDragInteractions(element, enable) { * @param importantProperties Properties to be set as `!important`. * @docs-private */ - - function toggleVisibility(element, enable, importantProperties) { extendStyles(element.style, { position: enable ? '' : 'fixed', @@ -9253,11 +8351,10 @@ function toggleVisibility(element, enable, importantProperties) { * Combines a transform string with an optional other transform * that exited before the base transform was applied. */ - - function combineTransforms(transform, initialTransform) { return initialTransform && initialTransform != 'none' ? transform + ' ' + initialTransform : transform; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -9265,41 +8362,34 @@ function combineTransforms(transform, initialTransform) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Parses a CSS time value to milliseconds. */ - - function parseCssTimeUnitsToMs(value) { // Some browsers will return it in seconds, whereas others will return milliseconds. const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000; return parseFloat(value) * multiplier; } /** Gets the transform transition duration, including the delay, of an element in milliseconds. */ - - function getTransformTransitionDurationInMs(element) { const computedStyle = getComputedStyle(element); const transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property'); - const property = transitionedProperties.find(prop => prop === 'transform' || prop === 'all'); // If there's no transition for `all` or `transform`, we shouldn't do anything. - + const property = transitionedProperties.find(prop => prop === 'transform' || prop === 'all'); + // If there's no transition for `all` or `transform`, we shouldn't do anything. if (!property) { return 0; - } // Get the index of the property that we're interested in and match + } + // Get the index of the property that we're interested in and match // it up to the same index in `transition-delay` and `transition-duration`. - - const propertyIndex = transitionedProperties.indexOf(property); const rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration'); const rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay'); return parseCssTimeUnitsToMs(rawDurations[propertyIndex]) + parseCssTimeUnitsToMs(rawDelays[propertyIndex]); } /** Parses out multiple values from a computed style into an array. */ - - function parseCssPropertyValue(computedStyle, name) { const value = computedStyle.getPropertyValue(name); return value.split(',').map(part => part.trim()); } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -9307,16 +8397,13 @@ function parseCssPropertyValue(computedStyle, name) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Gets a mutable version of an element's bounding `ClientRect`. */ - - function getMutableClientRect(element) { - const clientRect = element.getBoundingClientRect(); // We need to clone the `clientRect` here, because all the values on it are readonly + const clientRect = element.getBoundingClientRect(); + // We need to clone the `clientRect` here, because all the values on it are readonly // and we need to be able to update them. Also we can't use a spread here, because // the values on a `ClientRect` aren't own properties. See: // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes - return { top: clientRect.top, right: clientRect.right, @@ -9334,8 +8421,6 @@ function getMutableClientRect(element) { * @param x Coordinates along the X axis. * @param y Coordinates along the Y axis. */ - - function isInsideClientRect(clientRect, x, y) { const { top, @@ -9351,8 +8436,6 @@ function isInsideClientRect(clientRect, x, y) { * @param top Amount to add to the `top` position. * @param left Amount to add to the `left` position. */ - - function adjustClientRect(clientRect, top, left) { clientRect.top += top; clientRect.bottom = clientRect.top + clientRect.height; @@ -9366,8 +8449,6 @@ function adjustClientRect(clientRect, top, left) { * @param pointerX Coordinates along the X axis. * @param pointerY Coordinates along the Y axis. */ - - function isPointerNearClientRect(rect, threshold, pointerX, pointerY) { const { top, @@ -9381,6 +8462,7 @@ function isPointerNearClientRect(rect, threshold, pointerX, pointerY) { const yThreshold = height * threshold; return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -9388,26 +8470,18 @@ function isPointerNearClientRect(rect, threshold, pointerX, pointerY) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Keeps track of the scroll position and dimensions of the parents of an element. */ - - class ParentPositionTracker { constructor(_document) { this._document = _document; /** Cached positions of the scrollable parent elements. */ - this.positions = new Map(); } /** Clears the cached positions. */ - - clear() { this.positions.clear(); } /** Caches the positions. Should be called at the beginning of a drag sequence. */ - - cache(elements) { this.clear(); this.positions.set(this._document, { @@ -9424,21 +8498,15 @@ class ParentPositionTracker { }); } /** Handles scrolling while a drag is taking place. */ - - handleScroll(event) { const target = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__._getEventTarget)(event); - const cachedPosition = this.positions.get(target); - if (!cachedPosition) { return null; } - const scrollPosition = cachedPosition.scrollPosition; let newTop; let newLeft; - if (target === this._document) { const viewportScrollPosition = this.getViewportScrollPosition(); newTop = viewportScrollPosition.top; @@ -9447,11 +8515,10 @@ class ParentPositionTracker { newTop = target.scrollTop; newLeft = target.scrollLeft; } - const topDifference = scrollPosition.top - newTop; - const leftDifference = scrollPosition.left - newLeft; // Go through and update the cached positions of the scroll + const leftDifference = scrollPosition.left - newLeft; + // Go through and update the cached positions of the scroll // parents that are inside the element that was scrolled. - this.positions.forEach((position, node) => { if (position.clientRect && target !== node && target.contains(node)) { adjustClientRect(position.clientRect, topDifference, leftDifference); @@ -9470,16 +8537,14 @@ class ParentPositionTracker { * the top/left offset of the `document.documentElement` which works for most cases, but breaks * if the element is offset by something like the `BlockScrollStrategy`. */ - - getViewportScrollPosition() { return { top: window.scrollY, left: window.scrollX }; } - } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -9487,69 +8552,53 @@ class ParentPositionTracker { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Creates a deep clone of an element. */ - - function deepCloneNode(node) { const clone = node.cloneNode(true); const descendantsWithId = clone.querySelectorAll('[id]'); - const nodeName = node.nodeName.toLowerCase(); // Remove the `id` to avoid having multiple elements with the same id on the page. - + const nodeName = node.nodeName.toLowerCase(); + // Remove the `id` to avoid having multiple elements with the same id on the page. clone.removeAttribute('id'); - for (let i = 0; i < descendantsWithId.length; i++) { descendantsWithId[i].removeAttribute('id'); } - if (nodeName === 'canvas') { transferCanvasData(node, clone); } else if (nodeName === 'input' || nodeName === 'select' || nodeName === 'textarea') { transferInputData(node, clone); } - transferData('canvas', node, clone, transferCanvasData); transferData('input, textarea, select', node, clone, transferInputData); return clone; } /** Matches elements between an element and its clone and allows for their data to be cloned. */ - - function transferData(selector, node, clone, callback) { const descendantElements = node.querySelectorAll(selector); - if (descendantElements.length) { const cloneElements = clone.querySelectorAll(selector); - for (let i = 0; i < descendantElements.length; i++) { callback(descendantElements[i], cloneElements[i]); } } -} // Counter for unique cloned radio button names. - - +} +// Counter for unique cloned radio button names. let cloneUniqueId = 0; /** Transfers the data of one input element to another. */ - function transferInputData(source, clone) { // Browsers throw an error when assigning the value of a file input programmatically. if (clone.type !== 'file') { clone.value = source.value; - } // Radio button `name` attributes must be unique for radio button groups + } + // Radio button `name` attributes must be unique for radio button groups // otherwise original radio buttons can lose their checked state // once the clone is inserted in the DOM. - - if (clone.type === 'radio' && clone.name) { clone.name = `mat-clone-${clone.name}-${cloneUniqueId++}`; } } /** Transfers the data of one canvas element to another. */ - - function transferCanvasData(source, clone) { const context = clone.getContext('2d'); - if (context) { // In some cases `drawImage` can throw (e.g. if the canvas size is 0x0). // We can't do much about it so just ignore the error. @@ -9558,6 +8607,7 @@ function transferCanvasData(source, clone) { } catch {} } } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -9565,15 +8615,11 @@ function transferCanvasData(source, clone) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Options that can be used to bind a passive event listener. */ - - const passiveEventListenerOptions = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__.normalizePassiveListenerOptions)({ passive: true }); /** Options that can be used to bind an active event listener. */ - const activeEventListenerOptions = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__.normalizePassiveListenerOptions)({ passive: false }); @@ -9583,17 +8629,27 @@ const activeEventListenerOptions = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MO * touch devices where the browser fires fake mouse events, in * addition to touch events. */ - const MOUSE_EVENT_IGNORE_TIME = 800; /** Inline styles to be set as `!important` while dragging. */ - -const dragImportantProperties = new Set([// Needs to be important, because some `mat-table` sets `position: sticky !important`. See #22781. +const dragImportantProperties = new Set([ +// Needs to be important, because some `mat-table` sets `position: sticky !important`. See #22781. 'position']); /** * Reference to a draggable item. Used to manipulate or dispose of the item. */ - class DragRef { + /** Whether starting to drag this element is disabled. */ + get disabled() { + return this._disabled || !!(this._dropContainer && this._dropContainer.disabled); + } + set disabled(value) { + const newValue = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceBooleanProperty)(value); + if (newValue !== this._disabled) { + this._disabled = newValue; + this._toggleNativeDragInteractions(); + this._handles.forEach(handle => toggleNativeDragInteractions(handle, newValue)); + } + } constructor(element, _config, _document, _ngZone, _viewportRuler, _dragDropRegistry) { this._config = _config; this._document = _document; @@ -9606,13 +8662,11 @@ class DragRef { * after the user has stopped dragging and because we need to know the relative * position in case they start dragging again. This corresponds to `element.style.transform`. */ - this._passiveTransform = { x: 0, y: 0 }; /** CSS `transform` that is applied to the element while it's being dragged. */ - this._activeTransform = { x: 0, y: 0 @@ -9621,80 +8675,58 @@ class DragRef { * Whether the dragging sequence has been started. Doesn't * necessarily mean that the element has been moved. */ - this._hasStartedDragging = false; /** Emits when the item is being moved. */ - - this._moveEvents = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this._moveEvents = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** Subscription to pointer movement events. */ - - this._pointerMoveSubscription = rxjs__WEBPACK_IMPORTED_MODULE_2__.Subscription.EMPTY; + this._pointerMoveSubscription = rxjs__WEBPACK_IMPORTED_MODULE_3__.Subscription.EMPTY; /** Subscription to the event that is dispatched when the user lifts their pointer. */ - - this._pointerUpSubscription = rxjs__WEBPACK_IMPORTED_MODULE_2__.Subscription.EMPTY; + this._pointerUpSubscription = rxjs__WEBPACK_IMPORTED_MODULE_3__.Subscription.EMPTY; /** Subscription to the viewport being scrolled. */ - - this._scrollSubscription = rxjs__WEBPACK_IMPORTED_MODULE_2__.Subscription.EMPTY; + this._scrollSubscription = rxjs__WEBPACK_IMPORTED_MODULE_3__.Subscription.EMPTY; /** Subscription to the viewport being resized. */ - - this._resizeSubscription = rxjs__WEBPACK_IMPORTED_MODULE_2__.Subscription.EMPTY; + this._resizeSubscription = rxjs__WEBPACK_IMPORTED_MODULE_3__.Subscription.EMPTY; /** Cached reference to the boundary element. */ - this._boundaryElement = null; /** Whether the native dragging interactions have been enabled on the root element. */ - this._nativeInteractionsEnabled = true; /** Elements that can be used to drag the draggable item. */ - this._handles = []; /** Registered handles that are currently disabled. */ - this._disabledHandles = new Set(); /** Layout direction of the item. */ - this._direction = 'ltr'; /** * Amount of milliseconds to wait after the user has put their * pointer down before starting to drag the element. */ - this.dragStartDelay = 0; this._disabled = false; /** Emits as the drag sequence is being prepared. */ - - this.beforeStarted = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.beforeStarted = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** Emits when the user starts dragging the item. */ - - this.started = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.started = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** Emits when the user has released a drag item, before any animations have started. */ - - this.released = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.released = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** Emits when the user stops dragging an item in the container. */ - - this.ended = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.ended = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** Emits when the user has moved the item into a new container. */ - - this.entered = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.entered = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** Emits when the user removes the item its container by dragging it into another container. */ - - this.exited = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.exited = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** Emits when the user drops the item inside a container. */ - - this.dropped = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.dropped = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** * Emits as the user is dragging the item. Use with caution, * because this event will fire for every pixel that the user has dragged. */ - this.moved = this._moveEvents; /** Handler for the `mousedown`/`touchstart` events. */ - this._pointerDown = event => { - this.beforeStarted.next(); // Delegate the event based on whether it started from a handle or the element itself. - + this.beforeStarted.next(); + // Delegate the event based on whether it started from a handle or the element itself. if (this._handles.length) { const targetHandle = this._getTargetHandle(event); - if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) { this._initializeDragSequence(targetHandle, event); } @@ -9703,71 +8735,58 @@ class DragRef { } }; /** Handler that is invoked when the user moves their pointer after they've initiated a drag. */ - - this._pointerMove = event => { const pointerPosition = this._getPointerPositionOnPage(event); - if (!this._hasStartedDragging) { const distanceX = Math.abs(pointerPosition.x - this._pickupPositionOnPage.x); const distanceY = Math.abs(pointerPosition.y - this._pickupPositionOnPage.y); - const isOverThreshold = distanceX + distanceY >= this._config.dragStartThreshold; // Only start dragging after the user has moved more than the minimum distance in either - // direction. Note that this is preferrable over doing something like `skip(minimumDistance)` + const isOverThreshold = distanceX + distanceY >= this._config.dragStartThreshold; + // Only start dragging after the user has moved more than the minimum distance in either + // direction. Note that this is preferable over doing something like `skip(minimumDistance)` // in the `pointerMove` subscription, because we're not guaranteed to have one move event // per pixel of movement (e.g. if the user moves their pointer quickly). - if (isOverThreshold) { const isDelayElapsed = Date.now() >= this._dragStartTime + this._getDragStartDelay(event); - const container = this._dropContainer; - if (!isDelayElapsed) { this._endDragSequence(event); - return; - } // Prevent other drag sequences from starting while something in the container is still + } + // Prevent other drag sequences from starting while something in the container is still // being dragged. This can happen while we're waiting for the drop animation to finish // and can cause errors, because some elements might still be moving around. - - if (!container || !container.isDragging() && !container.isReceiving()) { // Prevent the default action as soon as the dragging sequence is considered as // "started" since waiting for the next event can allow the device to begin scrolling. event.preventDefault(); this._hasStartedDragging = true; - this._ngZone.run(() => this._startDragSequence(event)); } } - return; - } // We prevent the default action down here so that we know that dragging has started. This is + } + // We prevent the default action down here so that we know that dragging has started. This is // important for touch devices where doing this too early can unnecessarily block scrolling, // if there's a dragging delay. - - event.preventDefault(); - const constrainedPointerPosition = this._getConstrainedPointerPosition(pointerPosition); - this._hasMoved = true; this._lastKnownPointerPosition = pointerPosition; - this._updatePointerDirectionDelta(constrainedPointerPosition); - if (this._dropContainer) { this._updateActiveDropContainer(constrainedPointerPosition, pointerPosition); } else { + // If there's a position constraint function, we want the element's top/left to be at the + // specific position on the page. Use the initial position as a reference if that's the case. + const offset = this.constrainPosition ? this._initialClientRect : this._pickupPositionOnPage; const activeTransform = this._activeTransform; - activeTransform.x = constrainedPointerPosition.x - this._pickupPositionOnPage.x + this._passiveTransform.x; - activeTransform.y = constrainedPointerPosition.y - this._pickupPositionOnPage.y + this._passiveTransform.y; - + activeTransform.x = constrainedPointerPosition.x - offset.x + this._passiveTransform.x; + activeTransform.y = constrainedPointerPosition.y - offset.y + this._passiveTransform.y; this._applyRootElementTransform(activeTransform.x, activeTransform.y); - } // Since this event gets fired for every pixel while dragging, we only + } + // Since this event gets fired for every pixel while dragging, we only // want to fire it if the consumer opted into it. Also we have to // re-enter the zone because we run all of the events on the outside. - - if (this._moveEvents.observers.length) { this._ngZone.run(() => { this._moveEvents.next({ @@ -9781,18 +8800,13 @@ class DragRef { } }; /** Handler that is invoked when the user lifts their pointer up, after initiating a drag. */ - - this._pointerUp = event => { this._endDragSequence(event); }; /** Handles a native `dragstart` event. */ - - this._nativeDragStart = event => { if (this._handles.length) { const targetHandle = this._getTargetHandle(event); - if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) { event.preventDefault(); } @@ -9802,42 +8816,18 @@ class DragRef { event.preventDefault(); } }; - this.withRootElement(element).withParent(_config.parentDragRef || null); this._parentPositions = new ParentPositionTracker(_document); - _dragDropRegistry.registerDragItem(this); } - /** Whether starting to drag this element is disabled. */ - - - get disabled() { - return this._disabled || !!(this._dropContainer && this._dropContainer.disabled); - } - - set disabled(value) { - const newValue = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceBooleanProperty)(value); - - if (newValue !== this._disabled) { - this._disabled = newValue; - - this._toggleNativeDragInteractions(); - - this._handles.forEach(handle => toggleNativeDragInteractions(handle, newValue)); - } - } /** * Returns the element that is being used as a placeholder * while the current element is being dragged. */ - - getPlaceholderElement() { return this._placeholder; } /** Returns the root draggable element. */ - - getRootElement() { return this._rootElement; } @@ -9845,33 +8835,24 @@ class DragRef { * Gets the currently-visible element that represents the drag item. * While dragging this is the placeholder, otherwise it's the root element. */ - - getVisibleElement() { return this.isDragging() ? this.getPlaceholderElement() : this.getRootElement(); } /** Registers the handles that can be used to drag the element. */ - - withHandles(handles) { - this._handles = handles.map(handle => (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(handle)); - + this._handles = handles.map(handle => (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(handle)); this._handles.forEach(handle => toggleNativeDragInteractions(handle, this.disabled)); - - this._toggleNativeDragInteractions(); // Delete any lingering disabled handles that may have been destroyed. Note that we re-create + this._toggleNativeDragInteractions(); + // Delete any lingering disabled handles that may have been destroyed. Note that we re-create // the set, rather than iterate over it and filter out the destroyed handles, because while // the ES spec allows for sets to be modified while they're being iterated over, some polyfills // use an array internally which may throw an error. - - const disabledHandles = new Set(); - this._disabledHandles.forEach(handle => { if (this._handles.indexOf(handle) > -1) { disabledHandles.add(handle); } }); - this._disabledHandles = disabledHandles; return this; } @@ -9879,8 +8860,6 @@ class DragRef { * Registers the template that should be used for the drag preview. * @param template Template that from which to stamp out the preview. */ - - withPreviewTemplate(template) { this._previewTemplate = template; return this; @@ -9889,8 +8868,6 @@ class DragRef { * Registers the template that should be used for the drag placeholder. * @param template Template that from which to stamp out the placeholder. */ - - withPlaceholderTemplate(template) { this._placeholderTemplate = template; return this; @@ -9900,79 +8877,56 @@ class DragRef { * the user is dragging. Passing an alternate root element is useful when trying to enable * dragging on an element that you might not have access to. */ - - withRootElement(rootElement) { - const element = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(rootElement); - + const element = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(rootElement); if (element !== this._rootElement) { if (this._rootElement) { this._removeRootElementListeners(this._rootElement); } - this._ngZone.runOutsideAngular(() => { element.addEventListener('mousedown', this._pointerDown, activeEventListenerOptions); element.addEventListener('touchstart', this._pointerDown, passiveEventListenerOptions); element.addEventListener('dragstart', this._nativeDragStart, activeEventListenerOptions); }); - this._initialTransform = undefined; this._rootElement = element; } - if (typeof SVGElement !== 'undefined' && this._rootElement instanceof SVGElement) { this._ownerSVGElement = this._rootElement.ownerSVGElement; } - return this; } /** * Element to which the draggable's position will be constrained. */ - - withBoundaryElement(boundaryElement) { - this._boundaryElement = boundaryElement ? (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(boundaryElement) : null; - + this._boundaryElement = boundaryElement ? (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(boundaryElement) : null; this._resizeSubscription.unsubscribe(); - if (boundaryElement) { this._resizeSubscription = this._viewportRuler.change(10).subscribe(() => this._containInsideBoundaryOnResize()); } - return this; } /** Sets the parent ref that the ref is nested in. */ - - withParent(parent) { this._parentDragRef = parent; return this; } /** Removes the dragging functionality from the DOM element. */ - - dispose() { - this._removeRootElementListeners(this._rootElement); // Do this check before removing from the registry since it'll + this._removeRootElementListeners(this._rootElement); + // Do this check before removing from the registry since it'll // stop being considered as dragged once it is removed. - - if (this.isDragging()) { // Since we move out the element to the end of the body while it's being // dragged, we have to make sure that it's removed if it gets destroyed. this._rootElement?.remove(); } - this._anchor?.remove(); - this._destroyPreview(); - this._destroyPlaceholder(); - this._dragDropRegistry.removeDragItem(this); - this._removeSubscriptions(); - this.beforeStarted.complete(); this.started.complete(); this.released.complete(); @@ -9980,30 +8934,19 @@ class DragRef { this.entered.complete(); this.exited.complete(); this.dropped.complete(); - this._moveEvents.complete(); - this._handles = []; - this._disabledHandles.clear(); - this._dropContainer = undefined; - this._resizeSubscription.unsubscribe(); - this._parentPositions.clear(); - this._boundaryElement = this._rootElement = this._ownerSVGElement = this._placeholderTemplate = this._previewTemplate = this._anchor = this._parentDragRef = null; } /** Checks whether the element is currently being dragged. */ - - isDragging() { return this._hasStartedDragging && this._dragDropRegistry.isDragging(this); } /** Resets a standalone drag item to its initial position. */ - - reset() { this._rootElement.style.transform = this._initialTransform || ''; this._activeTransform = { @@ -10019,12 +8962,9 @@ class DragRef { * Sets a handle as disabled. While a handle is disabled, it'll capture and interrupt dragging. * @param handle Handle element that should be disabled. */ - - disableHandle(handle) { if (!this._disabledHandles.has(handle) && this._handles.indexOf(handle) > -1) { this._disabledHandles.add(handle); - toggleNativeDragInteractions(handle, true); } } @@ -10032,33 +8972,24 @@ class DragRef { * Enables a handle, if it has been disabled. * @param handle Handle element to be enabled. */ - - enableHandle(handle) { if (this._disabledHandles.has(handle)) { this._disabledHandles.delete(handle); - toggleNativeDragInteractions(handle, this.disabled); } } /** Sets the layout direction of the draggable item. */ - - withDirection(direction) { this._direction = direction; return this; } /** Sets the container that the item is part of. */ - - _withDropContainer(container) { this._dropContainer = container; } /** * Gets the current position in pixels the draggable outside of a drop container. */ - - getFreeDragPosition() { const position = this.isDragging() ? this._activeTransform : this._passiveTransform; return { @@ -10070,8 +9001,6 @@ class DragRef { * Sets the current position in pixels the draggable outside of a drop container. * @param value New position to be set. */ - - setFreeDragPosition(value) { this._activeTransform = { x: 0, @@ -10079,54 +9008,39 @@ class DragRef { }; this._passiveTransform.x = value.x; this._passiveTransform.y = value.y; - if (!this._dropContainer) { this._applyRootElementTransform(value.x, value.y); } - return this; } /** * Sets the container into which to insert the preview element. * @param value Container into which to insert the preview. */ - - withPreviewContainer(value) { this._previewContainer = value; return this; } /** Updates the item's sort order based on the last-known pointer position. */ - - _sortFromLastPointerPosition() { const position = this._lastKnownPointerPosition; - if (position && this._dropContainer) { this._updateActiveDropContainer(this._getConstrainedPointerPosition(position), position); } } /** Unsubscribes from the global subscriptions. */ - - _removeSubscriptions() { this._pointerMoveSubscription.unsubscribe(); - this._pointerUpSubscription.unsubscribe(); - this._scrollSubscription.unsubscribe(); } /** Destroys the preview element and its ViewRef. */ - - _destroyPreview() { this._preview?.remove(); this._previewRef?.destroy(); this._preview = this._previewRef = null; } /** Destroys the placeholder element and its ViewRef. */ - - _destroyPlaceholder() { this._placeholder?.remove(); this._placeholderRef?.destroy(); @@ -10136,8 +9050,6 @@ class DragRef { * Clears subscriptions and stops the dragging sequence. * @param event Browser event object that ended the sequence. */ - - _endDragSequence(event) { // Note that here we use `isDragging` from the service, rather than from `this`. // The difference is that the one from the service reflects whether a dragging sequence @@ -10146,35 +9058,25 @@ class DragRef { if (!this._dragDropRegistry.isDragging(this)) { return; } - this._removeSubscriptions(); - this._dragDropRegistry.stopDragging(this); - this._toggleNativeDragInteractions(); - if (this._handles) { this._rootElement.style.webkitTapHighlightColor = this._rootElementTapHighlight; } - if (!this._hasStartedDragging) { return; } - this.released.next({ source: this, event }); - if (this._dropContainer) { // Stop scrolling immediately, instead of waiting for the animation to finish. this._dropContainer._stopScrolling(); - this._animatePreviewToPlaceholder().then(() => { this._cleanupDragArtifacts(event); - this._cleanupCachedDimensions(); - this._dragDropRegistry.stopDragging(this); }); } else { @@ -10182,11 +9084,8 @@ class DragRef { // the user starts dragging the item, its position will be calculated relatively // to the new passive transform. this._passiveTransform.x = this._activeTransform.x; - const pointerPosition = this._getPointerPositionOnPage(event); - this._passiveTransform.y = this._activeTransform.y; - this._ngZone.run(() => { this.ended.next({ source: this, @@ -10195,57 +9094,42 @@ class DragRef { event }); }); - this._cleanupCachedDimensions(); - this._dragDropRegistry.stopDragging(this); } } /** Starts the dragging sequence. */ - - _startDragSequence(event) { if (isTouchEvent(event)) { this._lastTouchEventTime = Date.now(); } - this._toggleNativeDragInteractions(); - const dropContainer = this._dropContainer; - if (dropContainer) { const element = this._rootElement; const parent = element.parentNode; - const placeholder = this._placeholder = this._createPlaceholderElement(); - - const anchor = this._anchor = this._anchor || this._document.createComment(''); // Needs to happen before the root element is moved. - - - const shadowRoot = this._getShadowRoot(); // Insert an anchor node so that we can restore the element's position in the DOM. - - - parent.insertBefore(anchor, element); // There's no risk of transforms stacking when inside a drop container so + const anchor = this._anchor = this._anchor || this._document.createComment(''); + // Needs to happen before the root element is moved. + const shadowRoot = this._getShadowRoot(); + // Insert an anchor node so that we can restore the element's position in the DOM. + parent.insertBefore(anchor, element); + // There's no risk of transforms stacking when inside a drop container so // we can keep the initial transform up to date any time dragging starts. - - this._initialTransform = element.style.transform || ''; // Create the preview after the initial transform has + this._initialTransform = element.style.transform || ''; + // Create the preview after the initial transform has // been cached, because it can be affected by the transform. - - this._preview = this._createPreviewElement(); // We move the element out at the end of the body and we make it hidden, because keeping it in + this._preview = this._createPreviewElement(); + // We move the element out at the end of the body and we make it hidden, because keeping it in // place will throw off the consumer's `:last-child` selectors. We can't remove the element // from the DOM completely, because iOS will stop firing all subsequent events in the chain. - toggleVisibility(element, false, dragImportantProperties); - this._document.body.appendChild(parent.replaceChild(placeholder, element)); - this._getPreviewInsertionPoint(parent, shadowRoot).appendChild(this._preview); - this.started.next({ source: this, event }); // Emit before notifying the container. - dropContainer.start(); this._initialContainer = dropContainer; this._initialIndex = dropContainer.getItemIndex(this); @@ -10255,10 +9139,9 @@ class DragRef { event }); this._initialContainer = this._initialIndex = undefined; - } // Important to run after we've called `start` on the parent container + } + // Important to run after we've called `start` on the parent container // so that it has had time to resolve its scrollable parents. - - this._parentPositions.cache(dropContainer ? dropContainer.getScrollableParents() : []); } /** @@ -10267,72 +9150,60 @@ class DragRef { * @param referenceElement Element that started the drag sequence. * @param event Browser event object that started the sequence. */ - - _initializeDragSequence(referenceElement, event) { // Stop propagation if the item is inside another // draggable so we don't start multiple drag sequences. if (this._parentDragRef) { event.stopPropagation(); } - const isDragging = this.isDragging(); const isTouchSequence = isTouchEvent(event); const isAuxiliaryMouseButton = !isTouchSequence && event.button !== 0; const rootElement = this._rootElement; - const target = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__._getEventTarget)(event); - const isSyntheticEvent = !isTouchSequence && this._lastTouchEventTime && this._lastTouchEventTime + MOUSE_EVENT_IGNORE_TIME > Date.now(); - const isFakeEvent = isTouchSequence ? (0,_angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_4__.isFakeTouchstartFromScreenReader)(event) : (0,_angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_4__.isFakeMousedownFromScreenReader)(event); // If the event started from an element with the native HTML drag&drop, it'll interfere + const isFakeEvent = isTouchSequence ? (0,_angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_4__.isFakeTouchstartFromScreenReader)(event) : (0,_angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_4__.isFakeMousedownFromScreenReader)(event); + // If the event started from an element with the native HTML drag&drop, it'll interfere // with our own dragging (e.g. `img` tags do it by default). Prevent the default action // to stop it from happening. Note that preventing on `dragstart` also seems to work, but // it's flaky and it fails if the user drags it away quickly. Also note that we only want // to do this for `mousedown` since doing the same for `touchstart` will stop any `click` // events from firing on touch devices. - if (target && target.draggable && event.type === 'mousedown') { event.preventDefault(); - } // Abort if the user is already dragging or is using a mouse button other than the primary one. - - + } + // Abort if the user is already dragging or is using a mouse button other than the primary one. if (isDragging || isAuxiliaryMouseButton || isSyntheticEvent || isFakeEvent) { return; - } // If we've got handles, we need to disable the tap highlight on the entire root element, + } + // If we've got handles, we need to disable the tap highlight on the entire root element, // otherwise iOS will still add it, even though all the drag interactions on the handle // are disabled. - - if (this._handles.length) { const rootStyles = rootElement.style; this._rootElementTapHighlight = rootStyles.webkitTapHighlightColor || ''; rootStyles.webkitTapHighlightColor = 'transparent'; } - - this._hasStartedDragging = this._hasMoved = false; // Avoid multiple subscriptions and memory leaks when multi touch + this._hasStartedDragging = this._hasMoved = false; + // Avoid multiple subscriptions and memory leaks when multi touch // (isDragging check above isn't enough because of possible temporal and/or dimensional delays) - this._removeSubscriptions(); - + this._initialClientRect = this._rootElement.getBoundingClientRect(); this._pointerMoveSubscription = this._dragDropRegistry.pointerMove.subscribe(this._pointerMove); this._pointerUpSubscription = this._dragDropRegistry.pointerUp.subscribe(this._pointerUp); this._scrollSubscription = this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(scrollEvent => this._updateOnScroll(scrollEvent)); - if (this._boundaryElement) { this._boundaryRect = getMutableClientRect(this._boundaryElement); - } // If we have a custom preview we can't know ahead of time how large it'll be so we position + } + // If we have a custom preview we can't know ahead of time how large it'll be so we position // it next to the cursor. The exception is when the consumer has opted into making the preview // the same size as the root element, in which case we do know the size. - - const previewTemplate = this._previewTemplate; this._pickupPositionInElement = previewTemplate && previewTemplate.template && !previewTemplate.matchSize ? { x: 0, y: 0 - } : this._getPointerPositionInElement(referenceElement, event); - + } : this._getPointerPositionInElement(this._initialClientRect, referenceElement, event); const pointerPosition = this._pickupPositionOnPage = this._lastKnownPointerPosition = this._getPointerPositionOnPage(event); - this._pointerDirectionDelta = { x: 0, y: 0 @@ -10342,37 +9213,26 @@ class DragRef { y: pointerPosition.y }; this._dragStartTime = Date.now(); - this._dragDropRegistry.startDragging(this, event); } /** Cleans up the DOM artifacts that were added to facilitate the element being dragged. */ - - _cleanupDragArtifacts(event) { // Restore the element's visibility and insert it at its old position in the DOM. // It's important that we maintain the position, because moving the element around in the DOM // can throw off `NgFor` which does smart diffing and re-creates elements only when necessary, // while moving the existing elements in all other cases. toggleVisibility(this._rootElement, true, dragImportantProperties); - this._anchor.parentNode.replaceChild(this._rootElement, this._anchor); - this._destroyPreview(); - this._destroyPlaceholder(); - - this._boundaryRect = this._previewRect = this._initialTransform = undefined; // Re-enter the NgZone since we bound `document` events on the outside. - + this._initialClientRect = this._boundaryRect = this._previewRect = this._initialTransform = undefined; + // Re-enter the NgZone since we bound `document` events on the outside. this._ngZone.run(() => { const container = this._dropContainer; const currentIndex = container.getItemIndex(this); - const pointerPosition = this._getPointerPositionOnPage(event); - const distance = this._getDragDistance(pointerPosition); - const isPointerOverContainer = container._isOverContainer(pointerPosition.x, pointerPosition.y); - this.ended.next({ source: this, distance, @@ -10390,7 +9250,7 @@ class DragRef { dropPoint: pointerPosition, event }); - container.drop(this, currentIndex, this._initialIndex, this._initialContainer, isPointerOverContainer, distance, pointerPosition); + container.drop(this, currentIndex, this._initialIndex, this._initialContainer, isPointerOverContainer, distance, pointerPosition, event); this._dropContainer = this._initialContainer; }); } @@ -10398,8 +9258,6 @@ class DragRef { * Updates the item's position in its drop container, or moves it * into a new one, depending on its current drag position. */ - - _updateActiveDropContainer({ x, y @@ -10408,16 +9266,14 @@ class DragRef { y: rawY }) { // Drop container that draggable has been moved into. - let newContainer = this._initialContainer._getSiblingContainerFromPosition(this, x, y); // If we couldn't find a new container to move the item into, and the item has left its + let newContainer = this._initialContainer._getSiblingContainerFromPosition(this, x, y); + // If we couldn't find a new container to move the item into, and the item has left its // initial container, check whether the it's over the initial container. This handles the // case where two containers are connected one way and the user tries to undo dragging an // item into a new container. - - if (!newContainer && this._dropContainer !== this._initialContainer && this._initialContainer._isOverContainer(x, y)) { newContainer = this._initialContainer; } - if (newContainer && newContainer !== this._dropContainer) { this._ngZone.run(() => { // Notify the old container that the item has left. @@ -10425,69 +9281,60 @@ class DragRef { item: this, container: this._dropContainer }); - - this._dropContainer.exit(this); // Notify the new container that the item has entered. - - + this._dropContainer.exit(this); + // Notify the new container that the item has entered. this._dropContainer = newContainer; - - this._dropContainer.enter(this, x, y, newContainer === this._initialContainer && // If we're re-entering the initial container and sorting is disabled, + this._dropContainer.enter(this, x, y, newContainer === this._initialContainer && + // If we're re-entering the initial container and sorting is disabled, // put item the into its starting index to begin with. newContainer.sortingDisabled ? this._initialIndex : undefined); - this.entered.next({ item: this, container: newContainer, currentIndex: newContainer.getItemIndex(this) }); }); - } // Dragging may have been interrupted as a result of the events above. - - + } + // Dragging may have been interrupted as a result of the events above. if (this.isDragging()) { this._dropContainer._startScrollingIfNecessary(rawX, rawY); - this._dropContainer._sortItem(this, x, y, this._pointerDirectionDelta); - - this._applyPreviewTransform(x - this._pickupPositionInElement.x, y - this._pickupPositionInElement.y); + if (this.constrainPosition) { + this._applyPreviewTransform(x, y); + } else { + this._applyPreviewTransform(x - this._pickupPositionInElement.x, y - this._pickupPositionInElement.y); + } } } /** * Creates the element that will be rendered next to the user's pointer * and will be used as a preview of the element that is being dragged. */ - - _createPreviewElement() { const previewConfig = this._previewTemplate; const previewClass = this.previewClass; const previewTemplate = previewConfig ? previewConfig.template : null; let preview; - if (previewTemplate && previewConfig) { // Measure the element before we've inserted the preview // since the insertion could throw off the measurement. - const rootRect = previewConfig.matchSize ? this._rootElement.getBoundingClientRect() : null; + const rootRect = previewConfig.matchSize ? this._initialClientRect : null; const viewRef = previewConfig.viewContainer.createEmbeddedView(previewTemplate, previewConfig.context); viewRef.detectChanges(); preview = getRootNode(viewRef, this._document); this._previewRef = viewRef; - if (previewConfig.matchSize) { matchElementSize(preview, rootRect); } else { preview.style.transform = getTransform(this._pickupPositionOnPage.x, this._pickupPositionOnPage.y); } } else { - const element = this._rootElement; - preview = deepCloneNode(element); - matchElementSize(preview, element.getBoundingClientRect()); - + preview = deepCloneNode(this._rootElement); + matchElementSize(preview, this._initialClientRect); if (this._initialTransform) { preview.style.transform = this._initialTransform; } } - extendStyles(preview.style, { // It's important that we disable the pointer events on the preview, because // it can throw off the `document.elementFromPoint` calls in the `CdkDropList`. @@ -10502,7 +9349,6 @@ class DragRef { toggleNativeDragInteractions(preview, false); preview.classList.add('cdk-drag-preview'); preview.setAttribute('dir', this._direction); - if (previewClass) { if (Array.isArray(previewClass)) { previewClass.forEach(className => preview.classList.add(className)); @@ -10510,39 +9356,30 @@ class DragRef { preview.classList.add(previewClass); } } - return preview; } /** * Animates the preview element from its current position to the location of the drop placeholder. * @returns Promise that resolves when the animation completes. */ - - _animatePreviewToPlaceholder() { // If the user hasn't moved yet, the transitionend event won't fire. if (!this._hasMoved) { return Promise.resolve(); } - - const placeholderRect = this._placeholder.getBoundingClientRect(); // Apply the class that adds a transition to the preview. - - - this._preview.classList.add('cdk-drag-animating'); // Move the preview to the placeholder position. - - - this._applyPreviewTransform(placeholderRect.left, placeholderRect.top); // If the element doesn't have a `transition`, the `transitionend` event won't fire. Since + const placeholderRect = this._placeholder.getBoundingClientRect(); + // Apply the class that adds a transition to the preview. + this._preview.classList.add('cdk-drag-animating'); + // Move the preview to the placeholder position. + this._applyPreviewTransform(placeholderRect.left, placeholderRect.top); + // If the element doesn't have a `transition`, the `transitionend` event won't fire. Since // we need to trigger a style recalculation in order for the `cdk-drag-animating` class to // apply its style, we take advantage of the available info to figure out whether we need to // bind the event in the first place. - - const duration = getTransformTransitionDurationInMs(this._preview); - if (duration === 0) { return Promise.resolve(); } - return this._ngZone.runOutsideAngular(() => { return new Promise(resolve => { const handler = event => { @@ -10551,37 +9388,29 @@ class DragRef { resolve(); clearTimeout(timeout); } - }; // If a transition is short enough, the browser might not fire the `transitionend` event. + }; + // If a transition is short enough, the browser might not fire the `transitionend` event. // Since we know how long it's supposed to take, add a timeout with a 50% buffer that'll // fire if the transition hasn't completed when it was supposed to. - - const timeout = setTimeout(handler, duration * 1.5); - this._preview.addEventListener('transitionend', handler); }); }); } /** Creates an element that will be shown instead of the current element while dragging. */ - - _createPlaceholderElement() { const placeholderConfig = this._placeholderTemplate; const placeholderTemplate = placeholderConfig ? placeholderConfig.template : null; let placeholder; - if (placeholderTemplate) { this._placeholderRef = placeholderConfig.viewContainer.createEmbeddedView(placeholderTemplate, placeholderConfig.context); - this._placeholderRef.detectChanges(); - placeholder = getRootNode(this._placeholderRef, this._document); } else { placeholder = deepCloneNode(this._rootElement); - } // Stop pointer events on the preview so the user can't + } + // Stop pointer events on the preview so the user can't // interact with it while the preview is animating. - - placeholder.style.pointerEvents = 'none'; placeholder.classList.add('cdk-drag-placeholder'); return placeholder; @@ -10591,17 +9420,11 @@ class DragRef { * @param referenceElement Element that initiated the dragging. * @param event Event that initiated the dragging. */ - - - _getPointerPositionInElement(referenceElement, event) { - const elementRect = this._rootElement.getBoundingClientRect(); - + _getPointerPositionInElement(elementRect, referenceElement, event) { const handleElement = referenceElement === this._rootElement ? null : referenceElement; const referenceRect = handleElement ? handleElement.getBoundingClientRect() : elementRect; const point = isTouchEvent(event) ? event.targetTouches[0] : event; - const scrollPosition = this._getViewportScrollPosition(); - const x = point.pageX - referenceRect.left - scrollPosition.left; const y = point.pageY - referenceRect.top - scrollPosition.top; return { @@ -10610,12 +9433,10 @@ class DragRef { }; } /** Determines the point of the page that was touched by the user. */ - - _getPointerPositionOnPage(event) { const scrollPosition = this._getViewportScrollPosition(); - - const point = isTouchEvent(event) ? // `touches` will be empty for start/end events so we have to fall back to `changedTouches`. + const point = isTouchEvent(event) ? + // `touches` will be empty for start/end events so we have to fall back to `changedTouches`. // Also note that on real devices we're guaranteed for either `touches` or `changedTouches` // to have a value, but Firefox in device emulation mode has a bug where both can be empty // for `touchstart` and `touchend` so we fall back to a dummy object in order to avoid @@ -10627,54 +9448,45 @@ class DragRef { pageY: 0 } : event; const x = point.pageX - scrollPosition.left; - const y = point.pageY - scrollPosition.top; // if dragging SVG element, try to convert from the screen coordinate system to the SVG + const y = point.pageY - scrollPosition.top; + // if dragging SVG element, try to convert from the screen coordinate system to the SVG // coordinate system - if (this._ownerSVGElement) { const svgMatrix = this._ownerSVGElement.getScreenCTM(); - if (svgMatrix) { const svgPoint = this._ownerSVGElement.createSVGPoint(); - svgPoint.x = x; svgPoint.y = y; return svgPoint.matrixTransform(svgMatrix.inverse()); } } - return { x, y }; } /** Gets the pointer position on the page, accounting for any position constraints. */ - - _getConstrainedPointerPosition(point) { const dropContainerLock = this._dropContainer ? this._dropContainer.lockAxis : null; let { x, y - } = this.constrainPosition ? this.constrainPosition(point, this) : point; - + } = this.constrainPosition ? this.constrainPosition(point, this, this._initialClientRect, this._pickupPositionInElement) : point; if (this.lockAxis === 'x' || dropContainerLock === 'x') { y = this._pickupPositionOnPage.y; } else if (this.lockAxis === 'y' || dropContainerLock === 'y') { x = this._pickupPositionOnPage.x; } - if (this._boundaryRect) { const { x: pickupX, y: pickupY } = this._pickupPositionInElement; const boundaryRect = this._boundaryRect; - const { width: previewWidth, height: previewHeight } = this._getPreviewRect(); - const minY = boundaryRect.top + pickupY; const maxY = boundaryRect.bottom - (previewHeight - pickupY); const minX = boundaryRect.left + pickupX; @@ -10682,59 +9494,48 @@ class DragRef { x = clamp$1(x, minX, maxX); y = clamp$1(y, minY, maxY); } - return { x, y }; } /** Updates the current drag delta, based on the user's current pointer position on the page. */ - - _updatePointerDirectionDelta(pointerPositionOnPage) { const { x, y } = pointerPositionOnPage; const delta = this._pointerDirectionDelta; - const positionSinceLastChange = this._pointerPositionAtLastDirectionChange; // Amount of pixels the user has dragged since the last time the direction changed. - + const positionSinceLastChange = this._pointerPositionAtLastDirectionChange; + // Amount of pixels the user has dragged since the last time the direction changed. const changeX = Math.abs(x - positionSinceLastChange.x); - const changeY = Math.abs(y - positionSinceLastChange.y); // Because we handle pointer events on a per-pixel basis, we don't want the delta + const changeY = Math.abs(y - positionSinceLastChange.y); + // Because we handle pointer events on a per-pixel basis, we don't want the delta // to change for every pixel, otherwise anything that depends on it can look erratic. // To make the delta more consistent, we track how much the user has moved since the last // delta change and we only update it after it has reached a certain threshold. - if (changeX > this._config.pointerDirectionChangeThreshold) { delta.x = x > positionSinceLastChange.x ? 1 : -1; positionSinceLastChange.x = x; } - if (changeY > this._config.pointerDirectionChangeThreshold) { delta.y = y > positionSinceLastChange.y ? 1 : -1; positionSinceLastChange.y = y; } - return delta; } /** Toggles the native drag interactions, based on how many handles are registered. */ - - _toggleNativeDragInteractions() { if (!this._rootElement || !this._handles) { return; } - const shouldEnable = this._handles.length > 0 || !this.isDragging(); - if (shouldEnable !== this._nativeInteractionsEnabled) { this._nativeInteractionsEnabled = shouldEnable; toggleNativeDragInteractions(this._rootElement, shouldEnable); } } /** Removes the manually-added event listeners from the root element. */ - - _removeRootElementListeners(element) { element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions); element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions); @@ -10745,21 +9546,18 @@ class DragRef { * @param x New transform value along the X axis. * @param y New transform value along the Y axis. */ - - _applyRootElementTransform(x, y) { const transform = getTransform(x, y); - const styles = this._rootElement.style; // Cache the previous transform amount only after the first drag sequence, because + const styles = this._rootElement.style; + // Cache the previous transform amount only after the first drag sequence, because // we don't want our own transforms to stack on top of each other. // Should be excluded none because none + translate3d(x, y, x) is invalid css - if (this._initialTransform == null) { this._initialTransform = styles.transform && styles.transform != 'none' ? styles.transform : ''; - } // Preserve the previous `transform` value, if there was one. Note that we apply our own + } + // Preserve the previous `transform` value, if there was one. Note that we apply our own // transform before the user's, because things like rotation can affect which direction // the element will be translated towards. - - styles.transform = combineTransforms(transform, this._initialTransform); } /** @@ -10767,8 +9565,6 @@ class DragRef { * @param x New transform value along the X axis. * @param y New transform value along the Y axis. */ - - _applyPreviewTransform(x, y) { // Only apply the initial transform if the preview is a clone of the original element, otherwise // it could be completely different and the transform might not make sense anymore. @@ -10780,89 +9576,72 @@ class DragRef { * Gets the distance that the user has dragged during the current drag sequence. * @param currentPosition Current position of the user's pointer. */ - - _getDragDistance(currentPosition) { const pickupPosition = this._pickupPositionOnPage; - if (pickupPosition) { return { x: currentPosition.x - pickupPosition.x, y: currentPosition.y - pickupPosition.y }; } - return { x: 0, y: 0 }; } /** Cleans up any cached element dimensions that we don't need after dragging has stopped. */ - - _cleanupCachedDimensions() { this._boundaryRect = this._previewRect = undefined; - this._parentPositions.clear(); } /** * Checks whether the element is still inside its boundary after the viewport has been resized. * If not, the position is adjusted so that the element fits again. */ - - _containInsideBoundaryOnResize() { let { x, y } = this._passiveTransform; - if (x === 0 && y === 0 || this.isDragging() || !this._boundaryElement) { return; } - + // Note: don't use `_clientRectAtStart` here, because we want the latest position. + const elementRect = this._rootElement.getBoundingClientRect(); const boundaryRect = this._boundaryElement.getBoundingClientRect(); - - const elementRect = this._rootElement.getBoundingClientRect(); // It's possible that the element got hidden away after dragging (e.g. by switching to a + // It's possible that the element got hidden away after dragging (e.g. by switching to a // different tab). Don't do anything in this case so we don't clear the user's position. - - if (boundaryRect.width === 0 && boundaryRect.height === 0 || elementRect.width === 0 && elementRect.height === 0) { return; } - const leftOverflow = boundaryRect.left - elementRect.left; const rightOverflow = elementRect.right - boundaryRect.right; const topOverflow = boundaryRect.top - elementRect.top; - const bottomOverflow = elementRect.bottom - boundaryRect.bottom; // If the element has become wider than the boundary, we can't + const bottomOverflow = elementRect.bottom - boundaryRect.bottom; + // If the element has become wider than the boundary, we can't // do much to make it fit so we just anchor it to the left. - if (boundaryRect.width > elementRect.width) { if (leftOverflow > 0) { x += leftOverflow; } - if (rightOverflow > 0) { x -= rightOverflow; } } else { x = 0; - } // If the element has become taller than the boundary, we can't + } + // If the element has become taller than the boundary, we can't // do much to make it fit so we just anchor it to the top. - - if (boundaryRect.height > elementRect.height) { if (topOverflow > 0) { y += topOverflow; } - if (bottomOverflow > 0) { y -= bottomOverflow; } } else { y = 0; } - if (x !== this._passiveTransform.x || y !== this._passiveTransform.y) { this.setFreeDragPosition({ y, @@ -10871,49 +9650,37 @@ class DragRef { } } /** Gets the drag start delay, based on the event type. */ - - _getDragStartDelay(event) { const value = this.dragStartDelay; - if (typeof value === 'number') { return value; } else if (isTouchEvent(event)) { return value.touch; } - return value ? value.mouse : 0; } /** Updates the internal state of the draggable element when scrolling has occurred. */ - - _updateOnScroll(event) { const scrollDifference = this._parentPositions.handleScroll(event); - if (scrollDifference) { - const target = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__._getEventTarget)(event); // ClientRect dimensions are based on the scroll position of the page and its parent + const target = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__._getEventTarget)(event); + // ClientRect dimensions are based on the scroll position of the page and its parent // node so we have to update the cached boundary ClientRect if the user has scrolled. - - if (this._boundaryRect && target !== this._boundaryElement && target.contains(this._boundaryElement)) { adjustClientRect(this._boundaryRect, scrollDifference.top, scrollDifference.left); } - this._pickupPositionOnPage.x += scrollDifference.left; - this._pickupPositionOnPage.y += scrollDifference.top; // If we're in free drag mode, we have to update the active transform, because + this._pickupPositionOnPage.y += scrollDifference.top; + // If we're in free drag mode, we have to update the active transform, because // it isn't relative to the viewport like the preview inside a drop list. - if (!this._dropContainer) { this._activeTransform.x -= scrollDifference.left; this._activeTransform.y -= scrollDifference.top; - this._applyRootElementTransform(this._activeTransform.x, this._activeTransform.y); } } } /** Gets the scroll position of the viewport. */ - - _getViewportScrollPosition() { return this._parentPositions.positions.get(this._document)?.scrollPosition || this._parentPositions.getViewportScrollPosition(); } @@ -10923,78 +9690,58 @@ class DragRef { * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`. */ - - _getShadowRoot() { if (this._cachedShadowRoot === undefined) { this._cachedShadowRoot = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__._getShadowRoot)(this._rootElement); } - return this._cachedShadowRoot; } /** Gets the element into which the drag preview should be inserted. */ - - _getPreviewInsertionPoint(initialParent, shadowRoot) { const previewContainer = this._previewContainer || 'global'; - if (previewContainer === 'parent') { return initialParent; } - if (previewContainer === 'global') { - const documentRef = this._document; // We can't use the body if the user is in fullscreen mode, + const documentRef = this._document; + // We can't use the body if the user is in fullscreen mode, // because the preview will render under the fullscreen element. // TODO(crisbeto): dedupe this with the `FullscreenOverlayContainer` eventually. - return shadowRoot || documentRef.fullscreenElement || documentRef.webkitFullscreenElement || documentRef.mozFullScreenElement || documentRef.msFullscreenElement || documentRef.body; } - - return (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(previewContainer); + return (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(previewContainer); } /** Lazily resolves and returns the dimensions of the preview. */ - - _getPreviewRect() { // Cache the preview element rect if we haven't cached it already or if // we cached it too early before the element dimensions were computed. if (!this._previewRect || !this._previewRect.width && !this._previewRect.height) { - this._previewRect = (this._preview || this._rootElement).getBoundingClientRect(); + this._previewRect = this._preview ? this._preview.getBoundingClientRect() : this._initialClientRect; } - return this._previewRect; } /** Gets a handle that is the target of an event. */ - - _getTargetHandle(event) { return this._handles.find(handle => { return event.target && (event.target === handle || handle.contains(event.target)); }); } - } /** * Gets a 3d `transform` that can be applied to an element. * @param x Desired position of the element along the X axis. * @param y Desired position of the element along the Y axis. */ - - function getTransform(x, y) { // Round the transforms since some browsers will // blur the elements for sub-pixel transforms. return `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`; } /** Clamps a value between a minimum and a maximum. */ - - function clamp$1(value, min, max) { return Math.max(min, Math.min(max, value)); } /** Determines whether an event is a touch event. */ - - function isTouchEvent(event) { // This function is called for every pixel that the user has dragged so we need it to be // as fast as possible. Since we only bind mouse events and touch events, we can assume @@ -11005,17 +9752,12 @@ function isTouchEvent(event) { * Gets the root HTML element of an embedded view. * If the root is not an HTML element it gets wrapped in one. */ - - function getRootNode(viewRef, _document) { const rootNodes = viewRef.rootNodes; - if (rootNodes.length === 1 && rootNodes[0].nodeType === _document.ELEMENT_NODE) { return rootNodes[0]; } - const wrapper = _document.createElement('div'); - rootNodes.forEach(node => wrapper.appendChild(node)); return wrapper; } @@ -11024,13 +9766,12 @@ function getRootNode(viewRef, _document) { * @param target Element that needs to be resized. * @param sourceRect Dimensions of the source element. */ - - function matchElementSize(target, sourceRect) { target.style.width = `${sourceRect.width}px`; target.style.height = `${sourceRect.height}px`; target.style.transform = getTransform(sourceRect.left, sourceRect.top); } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -11038,30 +9779,23 @@ function matchElementSize(target, sourceRect) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Moves an item one index in an array to another. * @param array Array in which to move the item. * @param fromIndex Starting index of the item. * @param toIndex Index to which the item should be moved. */ - - function moveItemInArray(array, fromIndex, toIndex) { const from = clamp(fromIndex, array.length - 1); const to = clamp(toIndex, array.length - 1); - if (from === to) { return; } - const target = array[from]; const delta = to < from ? -1 : 1; - for (let i = from; i !== to; i += delta) { array[i] = array[i + delta]; } - array[to] = target; } /** @@ -11071,12 +9805,9 @@ function moveItemInArray(array, fromIndex, toIndex) { * @param currentIndex Index of the item in its current array. * @param targetIndex Index at which to insert the item. */ - - function transferArrayItem(currentArray, targetArray, currentIndex, targetIndex) { const from = clamp(currentIndex, currentArray.length - 1); const to = clamp(targetIndex, targetArray.length); - if (currentArray.length) { targetArray.splice(to, 0, currentArray.splice(from, 1)[0]); } @@ -11090,21 +9821,17 @@ function transferArrayItem(currentArray, targetArray, currentIndex, targetIndex) * @param targetIndex Index at which to insert the item. * */ - - function copyArrayItem(currentArray, targetArray, currentIndex, targetIndex) { const to = clamp(targetIndex, targetArray.length); - if (currentArray.length) { targetArray.splice(to, 0, currentArray[currentIndex]); } } /** Clamps a number between zero and a maximum. */ - - function clamp(value, max) { return Math.max(0, Math.min(max, value)); } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -11112,277 +9839,477 @@ function clamp(value, max) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ +/** + * Strategy that only supports sorting along a single axis. + * Items are reordered using CSS transforms which allows for sorting to be animated. + * @docs-private + */ +class SingleAxisSortStrategy { + constructor(_element, _dragDropRegistry) { + this._element = _element; + this._dragDropRegistry = _dragDropRegistry; + /** Cache of the dimensions of all the items inside the container. */ + this._itemPositions = []; + /** Direction in which the list is oriented. */ + this.orientation = 'vertical'; + /** + * Keeps track of the item that was last swapped with the dragged item, as well as what direction + * the pointer was moving in when the swap occurred and whether the user's pointer continued to + * overlap with the swapped item after the swapping occurred. + */ + this._previousSwap = { + drag: null, + delta: 0, + overlaps: false + }; + } + /** + * To be called when the drag sequence starts. + * @param items Items that are currently in the list. + */ + start(items) { + this.withItems(items); + } + /** + * To be called when an item is being sorted. + * @param item Item to be sorted. + * @param pointerX Position of the item along the X axis. + * @param pointerY Position of the item along the Y axis. + * @param pointerDelta Direction in which the pointer is moving along each axis. + */ + sort(item, pointerX, pointerY, pointerDelta) { + const siblings = this._itemPositions; + const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY, pointerDelta); + if (newIndex === -1 && siblings.length > 0) { + return null; + } + const isHorizontal = this.orientation === 'horizontal'; + const currentIndex = siblings.findIndex(currentItem => currentItem.drag === item); + const siblingAtNewPosition = siblings[newIndex]; + const currentPosition = siblings[currentIndex].clientRect; + const newPosition = siblingAtNewPosition.clientRect; + const delta = currentIndex > newIndex ? 1 : -1; + // How many pixels the item's placeholder should be offset. + const itemOffset = this._getItemOffsetPx(currentPosition, newPosition, delta); + // How many pixels all the other items should be offset. + const siblingOffset = this._getSiblingOffsetPx(currentIndex, siblings, delta); + // Save the previous order of the items before moving the item to its new index. + // We use this to check whether an item has been moved as a result of the sorting. + const oldOrder = siblings.slice(); + // Shuffle the array in place. + moveItemInArray(siblings, currentIndex, newIndex); + siblings.forEach((sibling, index) => { + // Don't do anything if the position hasn't changed. + if (oldOrder[index] === sibling) { + return; + } + const isDraggedItem = sibling.drag === item; + const offset = isDraggedItem ? itemOffset : siblingOffset; + const elementToOffset = isDraggedItem ? item.getPlaceholderElement() : sibling.drag.getRootElement(); + // Update the offset to reflect the new position. + sibling.offset += offset; + // Since we're moving the items with a `transform`, we need to adjust their cached + // client rects to reflect their new position, as well as swap their positions in the cache. + // Note that we shouldn't use `getBoundingClientRect` here to update the cache, because the + // elements may be mid-animation which will give us a wrong result. + if (isHorizontal) { + // Round the transforms since some browsers will + // blur the elements, for sub-pixel transforms. + elementToOffset.style.transform = combineTransforms(`translate3d(${Math.round(sibling.offset)}px, 0, 0)`, sibling.initialTransform); + adjustClientRect(sibling.clientRect, 0, offset); + } else { + elementToOffset.style.transform = combineTransforms(`translate3d(0, ${Math.round(sibling.offset)}px, 0)`, sibling.initialTransform); + adjustClientRect(sibling.clientRect, offset, 0); + } + }); + // Note that it's important that we do this after the client rects have been adjusted. + this._previousSwap.overlaps = isInsideClientRect(newPosition, pointerX, pointerY); + this._previousSwap.drag = siblingAtNewPosition.drag; + this._previousSwap.delta = isHorizontal ? pointerDelta.x : pointerDelta.y; + return { + previousIndex: currentIndex, + currentIndex: newIndex + }; + } + /** + * Called when an item is being moved into the container. + * @param item Item that was moved into the container. + * @param pointerX Position of the item along the X axis. + * @param pointerY Position of the item along the Y axis. + * @param index Index at which the item entered. If omitted, the container will try to figure it + * out automatically. + */ + enter(item, pointerX, pointerY, index) { + const newIndex = index == null || index < 0 ? + // We use the coordinates of where the item entered the drop + // zone to figure out at which index it should be inserted. + this._getItemIndexFromPointerPosition(item, pointerX, pointerY) : index; + const activeDraggables = this._activeDraggables; + const currentIndex = activeDraggables.indexOf(item); + const placeholder = item.getPlaceholderElement(); + let newPositionReference = activeDraggables[newIndex]; + // If the item at the new position is the same as the item that is being dragged, + // it means that we're trying to restore the item to its initial position. In this + // case we should use the next item from the list as the reference. + if (newPositionReference === item) { + newPositionReference = activeDraggables[newIndex + 1]; + } + // If we didn't find a new position reference, it means that either the item didn't start off + // in this container, or that the item requested to be inserted at the end of the list. + if (!newPositionReference && (newIndex == null || newIndex === -1 || newIndex < activeDraggables.length - 1) && this._shouldEnterAsFirstChild(pointerX, pointerY)) { + newPositionReference = activeDraggables[0]; + } + // Since the item may be in the `activeDraggables` already (e.g. if the user dragged it + // into another container and back again), we have to ensure that it isn't duplicated. + if (currentIndex > -1) { + activeDraggables.splice(currentIndex, 1); + } + // Don't use items that are being dragged as a reference, because + // their element has been moved down to the bottom of the body. + if (newPositionReference && !this._dragDropRegistry.isDragging(newPositionReference)) { + const element = newPositionReference.getRootElement(); + element.parentElement.insertBefore(placeholder, element); + activeDraggables.splice(newIndex, 0, item); + } else { + (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(this._element).appendChild(placeholder); + activeDraggables.push(item); + } + // The transform needs to be cleared so it doesn't throw off the measurements. + placeholder.style.transform = ''; + // Note that usually `start` is called together with `enter` when an item goes into a new + // container. This will cache item positions, but we need to refresh them since the amount + // of items has changed. + this._cacheItemPositions(); + } + /** Sets the items that are currently part of the list. */ + withItems(items) { + this._activeDraggables = items.slice(); + this._cacheItemPositions(); + } + /** Assigns a sort predicate to the strategy. */ + withSortPredicate(predicate) { + this._sortPredicate = predicate; + } + /** Resets the strategy to its initial state before dragging was started. */ + reset() { + // TODO(crisbeto): may have to wait for the animations to finish. + this._activeDraggables.forEach(item => { + const rootElement = item.getRootElement(); + if (rootElement) { + const initialTransform = this._itemPositions.find(p => p.drag === item)?.initialTransform; + rootElement.style.transform = initialTransform || ''; + } + }); + this._itemPositions = []; + this._activeDraggables = []; + this._previousSwap.drag = null; + this._previousSwap.delta = 0; + this._previousSwap.overlaps = false; + } + /** + * Gets a snapshot of items currently in the list. + * Can include items that we dragged in from another list. + */ + getActiveItemsSnapshot() { + return this._activeDraggables; + } + /** Gets the index of a specific item. */ + getItemIndex(item) { + // Items are sorted always by top/left in the cache, however they flow differently in RTL. + // The rest of the logic still stands no matter what orientation we're in, however + // we need to invert the array when determining the index. + const items = this.orientation === 'horizontal' && this.direction === 'rtl' ? this._itemPositions.slice().reverse() : this._itemPositions; + return items.findIndex(currentItem => currentItem.drag === item); + } + /** Used to notify the strategy that the scroll position has changed. */ + updateOnScroll(topDifference, leftDifference) { + // Since we know the amount that the user has scrolled we can shift all of the + // client rectangles ourselves. This is cheaper than re-measuring everything and + // we can avoid inconsistent behavior where we might be measuring the element before + // its position has changed. + this._itemPositions.forEach(({ + clientRect + }) => { + adjustClientRect(clientRect, topDifference, leftDifference); + }); + // We need two loops for this, because we want all of the cached + // positions to be up-to-date before we re-sort the item. + this._itemPositions.forEach(({ + drag + }) => { + if (this._dragDropRegistry.isDragging(drag)) { + // We need to re-sort the item manually, because the pointer move + // events won't be dispatched while the user is scrolling. + drag._sortFromLastPointerPosition(); + } + }); + } + /** Refreshes the position cache of the items and sibling containers. */ + _cacheItemPositions() { + const isHorizontal = this.orientation === 'horizontal'; + this._itemPositions = this._activeDraggables.map(drag => { + const elementToMeasure = drag.getVisibleElement(); + return { + drag, + offset: 0, + initialTransform: elementToMeasure.style.transform || '', + clientRect: getMutableClientRect(elementToMeasure) + }; + }).sort((a, b) => { + return isHorizontal ? a.clientRect.left - b.clientRect.left : a.clientRect.top - b.clientRect.top; + }); + } + /** + * Gets the offset in pixels by which the item that is being dragged should be moved. + * @param currentPosition Current position of the item. + * @param newPosition Position of the item where the current item should be moved. + * @param delta Direction in which the user is moving. + */ + _getItemOffsetPx(currentPosition, newPosition, delta) { + const isHorizontal = this.orientation === 'horizontal'; + let itemOffset = isHorizontal ? newPosition.left - currentPosition.left : newPosition.top - currentPosition.top; + // Account for differences in the item width/height. + if (delta === -1) { + itemOffset += isHorizontal ? newPosition.width - currentPosition.width : newPosition.height - currentPosition.height; + } + return itemOffset; + } + /** + * Gets the offset in pixels by which the items that aren't being dragged should be moved. + * @param currentIndex Index of the item currently being dragged. + * @param siblings All of the items in the list. + * @param delta Direction in which the user is moving. + */ + _getSiblingOffsetPx(currentIndex, siblings, delta) { + const isHorizontal = this.orientation === 'horizontal'; + const currentPosition = siblings[currentIndex].clientRect; + const immediateSibling = siblings[currentIndex + delta * -1]; + let siblingOffset = currentPosition[isHorizontal ? 'width' : 'height'] * delta; + if (immediateSibling) { + const start = isHorizontal ? 'left' : 'top'; + const end = isHorizontal ? 'right' : 'bottom'; + // Get the spacing between the start of the current item and the end of the one immediately + // after it in the direction in which the user is dragging, or vice versa. We add it to the + // offset in order to push the element to where it will be when it's inline and is influenced + // by the `margin` of its siblings. + if (delta === -1) { + siblingOffset -= immediateSibling.clientRect[start] - currentPosition[end]; + } else { + siblingOffset += currentPosition[start] - immediateSibling.clientRect[end]; + } + } + return siblingOffset; + } + /** + * Checks if pointer is entering in the first position + * @param pointerX Position of the user's pointer along the X axis. + * @param pointerY Position of the user's pointer along the Y axis. + */ + _shouldEnterAsFirstChild(pointerX, pointerY) { + if (!this._activeDraggables.length) { + return false; + } + const itemPositions = this._itemPositions; + const isHorizontal = this.orientation === 'horizontal'; + // `itemPositions` are sorted by position while `activeDraggables` are sorted by child index + // check if container is using some sort of "reverse" ordering (eg: flex-direction: row-reverse) + const reversed = itemPositions[0].drag !== this._activeDraggables[0]; + if (reversed) { + const lastItemRect = itemPositions[itemPositions.length - 1].clientRect; + return isHorizontal ? pointerX >= lastItemRect.right : pointerY >= lastItemRect.bottom; + } else { + const firstItemRect = itemPositions[0].clientRect; + return isHorizontal ? pointerX <= firstItemRect.left : pointerY <= firstItemRect.top; + } + } + /** + * Gets the index of an item in the drop container, based on the position of the user's pointer. + * @param item Item that is being sorted. + * @param pointerX Position of the user's pointer along the X axis. + * @param pointerY Position of the user's pointer along the Y axis. + * @param delta Direction in which the user is moving their pointer. + */ + _getItemIndexFromPointerPosition(item, pointerX, pointerY, delta) { + const isHorizontal = this.orientation === 'horizontal'; + const index = this._itemPositions.findIndex(({ + drag, + clientRect + }) => { + // Skip the item itself. + if (drag === item) { + return false; + } + if (delta) { + const direction = isHorizontal ? delta.x : delta.y; + // If the user is still hovering over the same item as last time, their cursor hasn't left + // the item after we made the swap, and they didn't change the direction in which they're + // dragging, we don't consider it a direction swap. + if (drag === this._previousSwap.drag && this._previousSwap.overlaps && direction === this._previousSwap.delta) { + return false; + } + } + return isHorizontal ? + // Round these down since most browsers report client rects with + // sub-pixel precision, whereas the pointer coordinates are rounded to pixels. + pointerX >= Math.floor(clientRect.left) && pointerX < Math.floor(clientRect.right) : pointerY >= Math.floor(clientRect.top) && pointerY < Math.floor(clientRect.bottom); + }); + return index === -1 || !this._sortPredicate(index, item) ? -1 : index; + } +} +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ /** * Proximity, as a ratio to width/height, at which a * dragged item will affect the drop container. */ - - const DROP_PROXIMITY_THRESHOLD = 0.05; /** * Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the * viewport. The value comes from trying it out manually until it feels right. */ - const SCROLL_PROXIMITY_THRESHOLD = 0.05; /** * Reference to a drop list. Used to manipulate or dispose of the container. */ - class DropListRef { constructor(element, _dragDropRegistry, _document, _ngZone, _viewportRuler) { this._dragDropRegistry = _dragDropRegistry; this._ngZone = _ngZone; this._viewportRuler = _viewportRuler; /** Whether starting a dragging sequence from this container is disabled. */ - this.disabled = false; /** Whether sorting items within the list is disabled. */ - this.sortingDisabled = false; /** * Whether auto-scrolling the view when the user * moves their pointer close to the edges is disabled. */ - this.autoScrollDisabled = false; /** Number of pixels to scroll for each frame when auto-scrolling an element. */ - this.autoScrollStep = 2; /** * Function that is used to determine whether an item * is allowed to be moved into a drop container. */ - this.enterPredicate = () => true; - /** Functions that is used to determine whether an item can be sorted into a particular index. */ - - + /** Function that is used to determine whether an item can be sorted into a particular index. */ this.sortPredicate = () => true; /** Emits right before dragging has started. */ - - - this.beforeStarted = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.beforeStarted = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** * Emits when the user has moved a new drag item into this container. */ - - this.entered = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.entered = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** * Emits when the user removes an item from the container * by dragging it into another container. */ - - this.exited = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.exited = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** Emits when the user drops an item inside the container. */ - - this.dropped = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.dropped = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** Emits as the user is swapping items while actively dragging. */ - - this.sorted = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.sorted = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); + /** Emits when a dragging sequence is started in a list connected to the current one. */ + this.receivingStarted = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); + /** Emits when a dragging sequence is stopped from a list connected to the current one. */ + this.receivingStopped = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** Whether an item in the list is being dragged. */ - this._isDragging = false; - /** Cache of the dimensions of all the items inside the container. */ - - this._itemPositions = []; - /** - * Keeps track of the item that was last swapped with the dragged item, as well as what direction - * the pointer was moving in when the swap occured and whether the user's pointer continued to - * overlap with the swapped item after the swapping occurred. - */ - - this._previousSwap = { - drag: null, - delta: 0, - overlaps: false - }; /** Draggable items in the container. */ - this._draggables = []; /** Drop lists that are connected to the current one. */ - this._siblings = []; - /** Direction in which the list is oriented. */ - - this._orientation = 'vertical'; /** Connected siblings that currently have a dragged item. */ - this._activeSiblings = new Set(); - /** Layout direction of the drop list. */ - - this._direction = 'ltr'; /** Subscription to the window being scrolled. */ - - this._viewportScrollSubscription = rxjs__WEBPACK_IMPORTED_MODULE_2__.Subscription.EMPTY; + this._viewportScrollSubscription = rxjs__WEBPACK_IMPORTED_MODULE_3__.Subscription.EMPTY; /** Vertical direction in which the list is currently scrolling. */ - - this._verticalScrollDirection = 0 - /* AutoScrollVerticalDirection.NONE */ - ; + this._verticalScrollDirection = 0 /* AutoScrollVerticalDirection.NONE */; /** Horizontal direction in which the list is currently scrolling. */ - - this._horizontalScrollDirection = 0 - /* AutoScrollHorizontalDirection.NONE */ - ; + this._horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */; /** Used to signal to the current auto-scroll sequence when to stop. */ - - this._stopScrollTimers = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this._stopScrollTimers = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** Shadow root of the current element. Necessary for `elementFromPoint` to resolve correctly. */ - this._cachedShadowRoot = null; /** Starts the interval that'll auto-scroll the element. */ - this._startScrollInterval = () => { this._stopScrolling(); - (0,rxjs__WEBPACK_IMPORTED_MODULE_5__.interval)(0, rxjs__WEBPACK_IMPORTED_MODULE_6__.animationFrameScheduler).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.takeUntil)(this._stopScrollTimers)).subscribe(() => { const node = this._scrollNode; const scrollStep = this.autoScrollStep; - - if (this._verticalScrollDirection === 1 - /* AutoScrollVerticalDirection.UP */ - ) { + if (this._verticalScrollDirection === 1 /* AutoScrollVerticalDirection.UP */) { node.scrollBy(0, -scrollStep); - } else if (this._verticalScrollDirection === 2 - /* AutoScrollVerticalDirection.DOWN */ - ) { + } else if (this._verticalScrollDirection === 2 /* AutoScrollVerticalDirection.DOWN */) { node.scrollBy(0, scrollStep); } - - if (this._horizontalScrollDirection === 1 - /* AutoScrollHorizontalDirection.LEFT */ - ) { + if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) { node.scrollBy(-scrollStep, 0); - } else if (this._horizontalScrollDirection === 2 - /* AutoScrollHorizontalDirection.RIGHT */ - ) { + } else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) { node.scrollBy(scrollStep, 0); } }); }; - - this.element = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(element); + this.element = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(element); this._document = _document; this.withScrollableParents([this.element]); - _dragDropRegistry.registerDropContainer(this); - this._parentPositions = new ParentPositionTracker(_document); + this._sortStrategy = new SingleAxisSortStrategy(this.element, _dragDropRegistry); + this._sortStrategy.withSortPredicate((index, item) => this.sortPredicate(index, item, this)); } /** Removes the drop list functionality from the DOM element. */ - - dispose() { this._stopScrolling(); - this._stopScrollTimers.complete(); - this._viewportScrollSubscription.unsubscribe(); - this.beforeStarted.complete(); this.entered.complete(); this.exited.complete(); this.dropped.complete(); this.sorted.complete(); - + this.receivingStarted.complete(); + this.receivingStopped.complete(); this._activeSiblings.clear(); - this._scrollNode = null; - this._parentPositions.clear(); - this._dragDropRegistry.removeDropContainer(this); } /** Whether an item from this list is currently being dragged. */ - - isDragging() { return this._isDragging; } /** Starts dragging an item. */ - - start() { this._draggingStarted(); - this._notifyReceivingSiblings(); } /** - * Emits an event to indicate that the user moved an item into the container. + * Attempts to move an item into the container. * @param item Item that was moved into the container. * @param pointerX Position of the item along the X axis. * @param pointerY Position of the item along the Y axis. * @param index Index at which the item entered. If omitted, the container will try to figure it * out automatically. */ - - enter(item, pointerX, pointerY, index) { - this._draggingStarted(); // If sorting is disabled, we want the item to return to its starting + this._draggingStarted(); + // If sorting is disabled, we want the item to return to its starting // position if the user is returning it to its initial container. - - - let newIndex; - - if (index == null) { - newIndex = this.sortingDisabled ? this._draggables.indexOf(item) : -1; - - if (newIndex === -1) { - // We use the coordinates of where the item entered the drop - // zone to figure out at which index it should be inserted. - newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY); - } - } else { - newIndex = index; + if (index == null && this.sortingDisabled) { + index = this._draggables.indexOf(item); } - - const activeDraggables = this._activeDraggables; - const currentIndex = activeDraggables.indexOf(item); - const placeholder = item.getPlaceholderElement(); - let newPositionReference = activeDraggables[newIndex]; // If the item at the new position is the same as the item that is being dragged, - // it means that we're trying to restore the item to its initial position. In this - // case we should use the next item from the list as the reference. - - if (newPositionReference === item) { - newPositionReference = activeDraggables[newIndex + 1]; - } // If we didn't find a new position reference, it means that either the item didn't start off - // in this container, or that the item requested to be inserted at the end of the list. - - - if (!newPositionReference && (newIndex == null || newIndex === -1 || newIndex < activeDraggables.length - 1) && this._shouldEnterAsFirstChild(pointerX, pointerY)) { - newPositionReference = activeDraggables[0]; - } // Since the item may be in the `activeDraggables` already (e.g. if the user dragged it - // into another container and back again), we have to ensure that it isn't duplicated. - - - if (currentIndex > -1) { - activeDraggables.splice(currentIndex, 1); - } // Don't use items that are being dragged as a reference, because - // their element has been moved down to the bottom of the body. - - - if (newPositionReference && !this._dragDropRegistry.isDragging(newPositionReference)) { - const element = newPositionReference.getRootElement(); - element.parentElement.insertBefore(placeholder, element); - activeDraggables.splice(newIndex, 0, item); - } else { - (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(this.element).appendChild(placeholder); - activeDraggables.push(item); - } // The transform needs to be cleared so it doesn't throw off the measurements. - - - placeholder.style.transform = ''; // Note that the positions were already cached when we called `start` above, - // but we need to refresh them since the amount of items has changed and also parent rects. - - this._cacheItemPositions(); - - this._cacheParentPositions(); // Notify siblings at the end so that the item has been inserted into the `activeDraggables`. - - + this._sortStrategy.enter(item, pointerX, pointerY, index); + // Note that this usually happens inside `_draggingStarted` as well, but the dimensions + // can change when the sort strategy moves the item around inside `enter`. + this._cacheParentPositions(); + // Notify siblings at the end so that the item has been inserted into the `activeDraggables`. this._notifyReceivingSiblings(); - this.entered.next({ item, container: this, @@ -11393,11 +10320,8 @@ class DropListRef { * Removes an item from the container after it was dragged into another container by the user. * @param item Item that was dragged out. */ - - exit(item) { this._reset(); - this.exited.next({ item, container: this @@ -11416,11 +10340,8 @@ class DropListRef { * * @breaking-change 15.0.0 `previousIndex` and `event` parameters to become required. */ - - drop(item, currentIndex, previousIndex, previousContainer, isPointerOverContainer, distance, dropPoint, event = {}) { this._reset(); - this.dropped.next({ item, currentIndex, @@ -11437,31 +10358,25 @@ class DropListRef { * Sets the draggable items that are a part of this list. * @param items Items that are a part of this list. */ - - withItems(items) { const previousItems = this._draggables; this._draggables = items; items.forEach(item => item._withDropContainer(this)); - if (this.isDragging()) { - const draggedItems = previousItems.filter(item => item.isDragging()); // If all of the items being dragged were removed + const draggedItems = previousItems.filter(item => item.isDragging()); + // If all of the items being dragged were removed // from the list, abort the current drag sequence. - if (draggedItems.every(item => items.indexOf(item) === -1)) { this._reset(); } else { - this._cacheItems(); + this._sortStrategy.withItems(this._draggables); } } - return this; } /** Sets the layout direction of the drop list. */ - - withDirection(direction) { - this._direction = direction; + this._sortStrategy.direction = direction; return this; } /** @@ -11469,8 +10384,6 @@ class DropListRef { * connected, the user will be allowed to transfer items between them. * @param connectedTo Other containers that the current containers should be connected to. */ - - connectedTo(connectedTo) { this._siblings = connectedTo.slice(); return this; @@ -11479,28 +10392,24 @@ class DropListRef { * Sets the orientation of the container. * @param orientation New orientation for the container. */ - - withOrientation(orientation) { - this._orientation = orientation; + // TODO(crisbeto): eventually we should be constructing the new sort strategy here based on + // the new orientation. For now we can assume that it'll always be `SingleAxisSortStrategy`. + this._sortStrategy.orientation = orientation; return this; } /** * Sets which parent elements are can be scrolled while the user is dragging. * @param elements Elements that can be scrolled. */ - - withScrollableParents(elements) { - const element = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(this.element); // We always allow the current element to be scrollable + const element = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(this.element); + // We always allow the current element to be scrollable // so we need to ensure that it's in the array. - this._scrollableElements = elements.indexOf(element) === -1 ? [element, ...elements] : elements.slice(); return this; } /** Gets the scrollable parents that are registered with this drop container. */ - - getScrollableParents() { return this._scrollableElements; } @@ -11508,25 +10417,13 @@ class DropListRef { * Figures out the index of an item in the container. * @param item Item whose index should be determined. */ - - getItemIndex(item) { - if (!this._isDragging) { - return this._draggables.indexOf(item); - } // Items are sorted always by top/left in the cache, however they flow differently in RTL. - // The rest of the logic still stands no matter what orientation we're in, however - // we need to invert the array when determining the index. - - - const items = this._orientation === 'horizontal' && this._direction === 'rtl' ? this._itemPositions.slice().reverse() : this._itemPositions; - return items.findIndex(currentItem => currentItem.drag === item); + return this._isDragging ? this._sortStrategy.getItemIndex(item) : this._draggables.indexOf(item); } /** * Whether the list is able to receive the item that * is currently being dragged inside a connected drop list. */ - - isReceiving() { return this._activeSiblings.size > 0; } @@ -11537,74 +10434,20 @@ class DropListRef { * @param pointerY Position of the item along the Y axis. * @param pointerDelta Direction in which the pointer is moving along each axis. */ - - _sortItem(item, pointerX, pointerY, pointerDelta) { // Don't sort the item if sorting is disabled or it's out of range. if (this.sortingDisabled || !this._clientRect || !isPointerNearClientRect(this._clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) { return; } - - const siblings = this._itemPositions; - - const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY, pointerDelta); - - if (newIndex === -1 && siblings.length > 0) { - return; + const result = this._sortStrategy.sort(item, pointerX, pointerY, pointerDelta); + if (result) { + this.sorted.next({ + previousIndex: result.previousIndex, + currentIndex: result.currentIndex, + container: this, + item + }); } - - const isHorizontal = this._orientation === 'horizontal'; - const currentIndex = siblings.findIndex(currentItem => currentItem.drag === item); - const siblingAtNewPosition = siblings[newIndex]; - const currentPosition = siblings[currentIndex].clientRect; - const newPosition = siblingAtNewPosition.clientRect; - const delta = currentIndex > newIndex ? 1 : -1; // How many pixels the item's placeholder should be offset. - - const itemOffset = this._getItemOffsetPx(currentPosition, newPosition, delta); // How many pixels all the other items should be offset. - - - const siblingOffset = this._getSiblingOffsetPx(currentIndex, siblings, delta); // Save the previous order of the items before moving the item to its new index. - // We use this to check whether an item has been moved as a result of the sorting. - - - const oldOrder = siblings.slice(); // Shuffle the array in place. - - moveItemInArray(siblings, currentIndex, newIndex); - this.sorted.next({ - previousIndex: currentIndex, - currentIndex: newIndex, - container: this, - item - }); - siblings.forEach((sibling, index) => { - // Don't do anything if the position hasn't changed. - if (oldOrder[index] === sibling) { - return; - } - - const isDraggedItem = sibling.drag === item; - const offset = isDraggedItem ? itemOffset : siblingOffset; - const elementToOffset = isDraggedItem ? item.getPlaceholderElement() : sibling.drag.getRootElement(); // Update the offset to reflect the new position. - - sibling.offset += offset; // Since we're moving the items with a `transform`, we need to adjust their cached - // client rects to reflect their new position, as well as swap their positions in the cache. - // Note that we shouldn't use `getBoundingClientRect` here to update the cache, because the - // elements may be mid-animation which will give us a wrong result. - - if (isHorizontal) { - // Round the transforms since some browsers will - // blur the elements, for sub-pixel transforms. - elementToOffset.style.transform = combineTransforms(`translate3d(${Math.round(sibling.offset)}px, 0, 0)`, sibling.initialTransform); - adjustClientRect(sibling.clientRect, 0, offset); - } else { - elementToOffset.style.transform = combineTransforms(`translate3d(0, ${Math.round(sibling.offset)}px, 0)`, sibling.initialTransform); - adjustClientRect(sibling.clientRect, offset, 0); - } - }); // Note that it's important that we do this after the client rects have been adjusted. - - this._previousSwap.overlaps = isInsideClientRect(newPosition, pointerX, pointerY); - this._previousSwap.drag = siblingAtNewPosition.drag; - this._previousSwap.delta = isHorizontal ? pointerDelta.x : pointerDelta.y; } /** * Checks whether the user's pointer is close to the edges of either the @@ -11612,44 +10455,33 @@ class DropListRef { * @param pointerX User's pointer position along the x axis. * @param pointerY User's pointer position along the y axis. */ - - _startScrollingIfNecessary(pointerX, pointerY) { if (this.autoScrollDisabled) { return; } - let scrollNode; - let verticalScrollDirection = 0 - /* AutoScrollVerticalDirection.NONE */ - ; - let horizontalScrollDirection = 0 - /* AutoScrollHorizontalDirection.NONE */ - ; // Check whether we should start scrolling any of the parent containers. - + let verticalScrollDirection = 0 /* AutoScrollVerticalDirection.NONE */; + let horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */; + // Check whether we should start scrolling any of the parent containers. this._parentPositions.positions.forEach((position, element) => { // We have special handling for the `document` below. Also this would be // nicer with a for...of loop, but it requires changing a compiler flag. if (element === this._document || !position.clientRect || scrollNode) { return; } - if (isPointerNearClientRect(position.clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) { [verticalScrollDirection, horizontalScrollDirection] = getElementScrollDirections(element, position.clientRect, pointerX, pointerY); - if (verticalScrollDirection || horizontalScrollDirection) { scrollNode = element; } } - }); // Otherwise check if we can start scrolling the viewport. - - + }); + // Otherwise check if we can start scrolling the viewport. if (!verticalScrollDirection && !horizontalScrollDirection) { const { width, height } = this._viewportRuler.getViewportSize(); - const clientRect = { width, height, @@ -11662,12 +10494,10 @@ class DropListRef { horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX); scrollNode = window; } - if (scrollNode && (verticalScrollDirection !== this._verticalScrollDirection || horizontalScrollDirection !== this._horizontalScrollDirection || scrollNode !== this._scrollNode)) { this._verticalScrollDirection = verticalScrollDirection; this._horizontalScrollDirection = horizontalScrollDirection; this._scrollNode = scrollNode; - if ((verticalScrollDirection || horizontalScrollDirection) && scrollNode) { this._ngZone.runOutsideAngular(this._startScrollInterval); } else { @@ -11676,219 +10506,48 @@ class DropListRef { } } /** Stops any currently-running auto-scroll sequences. */ - - _stopScrolling() { this._stopScrollTimers.next(); } /** Starts the dragging sequence within the list. */ - - _draggingStarted() { - const styles = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(this.element).style; + const styles = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(this.element).style; this.beforeStarted.next(); - this._isDragging = true; // We need to disable scroll snapping while the user is dragging, because it breaks automatic + this._isDragging = true; + // We need to disable scroll snapping while the user is dragging, because it breaks automatic // scrolling. The browser seems to round the value based on the snapping points which means // that we can't increment/decrement the scroll position. - this._initialScrollSnap = styles.msScrollSnapType || styles.scrollSnapType || ''; styles.scrollSnapType = styles.msScrollSnapType = 'none'; - - this._cacheItems(); - + this._sortStrategy.start(this._draggables); + this._cacheParentPositions(); this._viewportScrollSubscription.unsubscribe(); - this._listenToScrollEvents(); } /** Caches the positions of the configured scrollable parents. */ - - _cacheParentPositions() { - const element = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(this.element); - - this._parentPositions.cache(this._scrollableElements); // The list element is always in the `scrollableElements` + const element = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(this.element); + this._parentPositions.cache(this._scrollableElements); + // The list element is always in the `scrollableElements` // so we can take advantage of the cached `ClientRect`. - - this._clientRect = this._parentPositions.positions.get(element).clientRect; } - /** Refreshes the position cache of the items and sibling containers. */ - - - _cacheItemPositions() { - const isHorizontal = this._orientation === 'horizontal'; - this._itemPositions = this._activeDraggables.map(drag => { - const elementToMeasure = drag.getVisibleElement(); - return { - drag, - offset: 0, - initialTransform: elementToMeasure.style.transform || '', - clientRect: getMutableClientRect(elementToMeasure) - }; - }).sort((a, b) => { - return isHorizontal ? a.clientRect.left - b.clientRect.left : a.clientRect.top - b.clientRect.top; - }); - } /** Resets the container to its initial state. */ - - _reset() { this._isDragging = false; - const styles = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(this.element).style; - styles.scrollSnapType = styles.msScrollSnapType = this._initialScrollSnap; // TODO(crisbeto): may have to wait for the animations to finish. - - this._activeDraggables.forEach(item => { - const rootElement = item.getRootElement(); - - if (rootElement) { - const initialTransform = this._itemPositions.find(current => current.drag === item)?.initialTransform; - rootElement.style.transform = initialTransform || ''; - } - }); - + const styles = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(this.element).style; + styles.scrollSnapType = styles.msScrollSnapType = this._initialScrollSnap; this._siblings.forEach(sibling => sibling._stopReceiving(this)); - - this._activeDraggables = []; - this._itemPositions = []; - this._previousSwap.drag = null; - this._previousSwap.delta = 0; - this._previousSwap.overlaps = false; - + this._sortStrategy.reset(); this._stopScrolling(); - this._viewportScrollSubscription.unsubscribe(); - this._parentPositions.clear(); } - /** - * Gets the offset in pixels by which the items that aren't being dragged should be moved. - * @param currentIndex Index of the item currently being dragged. - * @param siblings All of the items in the list. - * @param delta Direction in which the user is moving. - */ - - - _getSiblingOffsetPx(currentIndex, siblings, delta) { - const isHorizontal = this._orientation === 'horizontal'; - const currentPosition = siblings[currentIndex].clientRect; - const immediateSibling = siblings[currentIndex + delta * -1]; - let siblingOffset = currentPosition[isHorizontal ? 'width' : 'height'] * delta; - - if (immediateSibling) { - const start = isHorizontal ? 'left' : 'top'; - const end = isHorizontal ? 'right' : 'bottom'; // Get the spacing between the start of the current item and the end of the one immediately - // after it in the direction in which the user is dragging, or vice versa. We add it to the - // offset in order to push the element to where it will be when it's inline and is influenced - // by the `margin` of its siblings. - - if (delta === -1) { - siblingOffset -= immediateSibling.clientRect[start] - currentPosition[end]; - } else { - siblingOffset += currentPosition[start] - immediateSibling.clientRect[end]; - } - } - - return siblingOffset; - } - /** - * Gets the offset in pixels by which the item that is being dragged should be moved. - * @param currentPosition Current position of the item. - * @param newPosition Position of the item where the current item should be moved. - * @param delta Direction in which the user is moving. - */ - - - _getItemOffsetPx(currentPosition, newPosition, delta) { - const isHorizontal = this._orientation === 'horizontal'; - let itemOffset = isHorizontal ? newPosition.left - currentPosition.left : newPosition.top - currentPosition.top; // Account for differences in the item width/height. - - if (delta === -1) { - itemOffset += isHorizontal ? newPosition.width - currentPosition.width : newPosition.height - currentPosition.height; - } - - return itemOffset; - } - /** - * Checks if pointer is entering in the first position - * @param pointerX Position of the user's pointer along the X axis. - * @param pointerY Position of the user's pointer along the Y axis. - */ - - - _shouldEnterAsFirstChild(pointerX, pointerY) { - if (!this._activeDraggables.length) { - return false; - } - - const itemPositions = this._itemPositions; - const isHorizontal = this._orientation === 'horizontal'; // `itemPositions` are sorted by position while `activeDraggables` are sorted by child index - // check if container is using some sort of "reverse" ordering (eg: flex-direction: row-reverse) - - const reversed = itemPositions[0].drag !== this._activeDraggables[0]; - - if (reversed) { - const lastItemRect = itemPositions[itemPositions.length - 1].clientRect; - return isHorizontal ? pointerX >= lastItemRect.right : pointerY >= lastItemRect.bottom; - } else { - const firstItemRect = itemPositions[0].clientRect; - return isHorizontal ? pointerX <= firstItemRect.left : pointerY <= firstItemRect.top; - } - } - /** - * Gets the index of an item in the drop container, based on the position of the user's pointer. - * @param item Item that is being sorted. - * @param pointerX Position of the user's pointer along the X axis. - * @param pointerY Position of the user's pointer along the Y axis. - * @param delta Direction in which the user is moving their pointer. - */ - - - _getItemIndexFromPointerPosition(item, pointerX, pointerY, delta) { - const isHorizontal = this._orientation === 'horizontal'; - - const index = this._itemPositions.findIndex(({ - drag, - clientRect - }) => { - // Skip the item itself. - if (drag === item) { - return false; - } - - if (delta) { - const direction = isHorizontal ? delta.x : delta.y; // If the user is still hovering over the same item as last time, their cursor hasn't left - // the item after we made the swap, and they didn't change the direction in which they're - // dragging, we don't consider it a direction swap. - - if (drag === this._previousSwap.drag && this._previousSwap.overlaps && direction === this._previousSwap.delta) { - return false; - } - } - - return isHorizontal ? // Round these down since most browsers report client rects with - // sub-pixel precision, whereas the pointer coordinates are rounded to pixels. - pointerX >= Math.floor(clientRect.left) && pointerX < Math.floor(clientRect.right) : pointerY >= Math.floor(clientRect.top) && pointerY < Math.floor(clientRect.bottom); - }); - - return index === -1 || !this.sortPredicate(index, item, this) ? -1 : index; - } - /** Caches the current items in the list and their positions. */ - - - _cacheItems() { - this._activeDraggables = this._draggables.slice(); - - this._cacheItemPositions(); - - this._cacheParentPositions(); - } /** * Checks whether the user's pointer is positioned over the container. * @param x Pointer position along the X axis. * @param y Pointer position along the Y axis. */ - - _isOverContainer(x, y) { return this._clientRect != null && isInsideClientRect(this._clientRect, x, y); } @@ -11899,8 +10558,6 @@ class DropListRef { * @param x Position of the item along the X axis. * @param y Position of the item along the Y axis. */ - - _getSiblingContainerFromPosition(item, x, y) { return this._siblings.find(sibling => sibling._canReceive(item, x, y)); } @@ -11910,39 +10567,31 @@ class DropListRef { * @param x Position of the item along the X axis. * @param y Position of the item along the Y axis. */ - - _canReceive(item, x, y) { if (!this._clientRect || !isInsideClientRect(this._clientRect, x, y) || !this.enterPredicate(item, this)) { return false; } - - const elementFromPoint = this._getShadowRoot().elementFromPoint(x, y); // If there's no element at the pointer position, then + const elementFromPoint = this._getShadowRoot().elementFromPoint(x, y); + // If there's no element at the pointer position, then // the client rect is probably scrolled out of the view. - - if (!elementFromPoint) { return false; } - - const nativeElement = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(this.element); // The `ClientRect`, that we're using to find the container over which the user is + const nativeElement = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(this.element); + // The `ClientRect`, that we're using to find the container over which the user is // hovering, doesn't give us any information on whether the element has been scrolled // out of the view or whether it's overlapping with other containers. This means that // we could end up transferring the item into a container that's invisible or is positioned // below another one. We use the result from `elementFromPoint` to get the top-most element // at the pointer position and to find whether it's one of the intersecting drop containers. - return elementFromPoint === nativeElement || nativeElement.contains(elementFromPoint); } /** * Called by one of the connected drop lists when a dragging sequence has started. * @param sibling Sibling in which dragging has started. */ - - _startReceiving(sibling, items) { const activeSiblings = this._activeSiblings; - if (!activeSiblings.has(sibling) && items.every(item => { // Note that we have to add an exception to the `enterPredicate` for items that started off // in this drop list. The drag ref has logic that allows an item to return to its initial @@ -11951,56 +10600,37 @@ class DropListRef { return this.enterPredicate(item, this) || this._draggables.indexOf(item) > -1; })) { activeSiblings.add(sibling); - this._cacheParentPositions(); - this._listenToScrollEvents(); + this.receivingStarted.next({ + initiator: sibling, + receiver: this, + items + }); } } /** * Called by a connected drop list when dragging has stopped. * @param sibling Sibling whose dragging has stopped. */ - - _stopReceiving(sibling) { this._activeSiblings.delete(sibling); - this._viewportScrollSubscription.unsubscribe(); + this.receivingStopped.next({ + initiator: sibling, + receiver: this + }); } /** * Starts listening to scroll events on the viewport. * Used for updating the internal state of the list. */ - - _listenToScrollEvents() { this._viewportScrollSubscription = this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(event => { if (this.isDragging()) { const scrollDifference = this._parentPositions.handleScroll(event); - if (scrollDifference) { - // Since we know the amount that the user has scrolled we can shift all of the - // client rectangles ourselves. This is cheaper than re-measuring everything and - // we can avoid inconsistent behavior where we might be measuring the element before - // its position has changed. - this._itemPositions.forEach(({ - clientRect - }) => { - adjustClientRect(clientRect, scrollDifference.top, scrollDifference.left); - }); // We need two loops for this, because we want all of the cached - // positions to be up-to-date before we re-sort the item. - - - this._itemPositions.forEach(({ - drag - }) => { - if (this._dragDropRegistry.isDragging(drag)) { - // We need to re-sort the item manually, because the pointer move - // events won't be dispatched while the user is scrolling. - drag._sortFromLastPointerPosition(); - } - }); + this._sortStrategy.updateOnScroll(scrollDifference.top, scrollDifference.left); } } else if (this.isReceiving()) { this._cacheParentPositions(); @@ -12013,34 +10643,24 @@ class DropListRef { * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`. */ - - _getShadowRoot() { if (!this._cachedShadowRoot) { - const shadowRoot = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__._getShadowRoot)((0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(this.element)); - + const shadowRoot = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__._getShadowRoot)((0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(this.element)); this._cachedShadowRoot = shadowRoot || this._document; } - return this._cachedShadowRoot; } /** Notifies any siblings that may potentially receive the item. */ - - _notifyReceivingSiblings() { - const draggedItems = this._activeDraggables.filter(item => item.isDragging()); - + const draggedItems = this._sortStrategy.getActiveItemsSnapshot().filter(item => item.isDragging()); this._siblings.forEach(sibling => sibling._startReceiving(this, draggedItems)); } - } /** * Gets whether the vertical auto-scroll direction of a node. * @param clientRect Dimensions of the node. * @param pointerY Position of the user's pointer along the y axis. */ - - function getVerticalScrollDirection(clientRect, pointerY) { const { top, @@ -12048,28 +10668,19 @@ function getVerticalScrollDirection(clientRect, pointerY) { height } = clientRect; const yThreshold = height * SCROLL_PROXIMITY_THRESHOLD; - if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) { - return 1 - /* AutoScrollVerticalDirection.UP */ - ; + return 1 /* AutoScrollVerticalDirection.UP */; } else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) { - return 2 - /* AutoScrollVerticalDirection.DOWN */ - ; + return 2 /* AutoScrollVerticalDirection.DOWN */; } - return 0 - /* AutoScrollVerticalDirection.NONE */ - ; + return 0 /* AutoScrollVerticalDirection.NONE */; } /** * Gets whether the horizontal auto-scroll direction of a node. * @param clientRect Dimensions of the node. * @param pointerX Position of the user's pointer along the x axis. */ - - function getHorizontalScrollDirection(clientRect, pointerX) { const { left, @@ -12077,20 +10688,13 @@ function getHorizontalScrollDirection(clientRect, pointerX) { width } = clientRect; const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD; - if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) { - return 1 - /* AutoScrollHorizontalDirection.LEFT */ - ; + return 1 /* AutoScrollHorizontalDirection.LEFT */; } else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) { - return 2 - /* AutoScrollHorizontalDirection.RIGHT */ - ; + return 2 /* AutoScrollHorizontalDirection.RIGHT */; } - return 0 - /* AutoScrollHorizontalDirection.NONE */ - ; + return 0 /* AutoScrollHorizontalDirection.NONE */; } /** * Gets the directions in which an element node should be scrolled, @@ -12100,59 +10704,40 @@ function getHorizontalScrollDirection(clientRect, pointerX) { * @param pointerX Position of the user's pointer along the x axis. * @param pointerY Position of the user's pointer along the y axis. */ - - function getElementScrollDirections(element, clientRect, pointerX, pointerY) { const computedVertical = getVerticalScrollDirection(clientRect, pointerY); const computedHorizontal = getHorizontalScrollDirection(clientRect, pointerX); - let verticalScrollDirection = 0 - /* AutoScrollVerticalDirection.NONE */ - ; - let horizontalScrollDirection = 0 - /* AutoScrollHorizontalDirection.NONE */ - ; // Note that we here we do some extra checks for whether the element is actually scrollable in + let verticalScrollDirection = 0 /* AutoScrollVerticalDirection.NONE */; + let horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */; + // Note that we here we do some extra checks for whether the element is actually scrollable in // a certain direction and we only assign the scroll direction if it is. We do this so that we // can allow other elements to be scrolled, if the current element can't be scrolled anymore. // This allows us to handle cases where the scroll regions of two scrollable elements overlap. - if (computedVertical) { const scrollTop = element.scrollTop; - - if (computedVertical === 1 - /* AutoScrollVerticalDirection.UP */ - ) { + if (computedVertical === 1 /* AutoScrollVerticalDirection.UP */) { if (scrollTop > 0) { - verticalScrollDirection = 1 - /* AutoScrollVerticalDirection.UP */ - ; + verticalScrollDirection = 1 /* AutoScrollVerticalDirection.UP */; } } else if (element.scrollHeight - scrollTop > element.clientHeight) { - verticalScrollDirection = 2 - /* AutoScrollVerticalDirection.DOWN */ - ; + verticalScrollDirection = 2 /* AutoScrollVerticalDirection.DOWN */; } } if (computedHorizontal) { const scrollLeft = element.scrollLeft; - - if (computedHorizontal === 1 - /* AutoScrollHorizontalDirection.LEFT */ - ) { + if (computedHorizontal === 1 /* AutoScrollHorizontalDirection.LEFT */) { if (scrollLeft > 0) { - horizontalScrollDirection = 1 - /* AutoScrollHorizontalDirection.LEFT */ - ; + horizontalScrollDirection = 1 /* AutoScrollHorizontalDirection.LEFT */; } } else if (element.scrollWidth - scrollLeft > element.clientWidth) { - horizontalScrollDirection = 2 - /* AutoScrollHorizontalDirection.RIGHT */ - ; + horizontalScrollDirection = 2 /* AutoScrollHorizontalDirection.RIGHT */; } } return [verticalScrollDirection, horizontalScrollDirection]; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -12160,10 +10745,7 @@ function getElementScrollDirections(element, clientRect, pointerX, pointerY) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Event options that can be used to bind an active, capturing event. */ - - const activeCapturingEventOptions = (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_0__.normalizePassiveListenerOptions)({ passive: false, capture: true @@ -12176,61 +10758,48 @@ const activeCapturingEventOptions = (0,_angular_cdk_platform__WEBPACK_IMPORTED_M // Note: this class is generic, rather than referencing CdkDrag and CdkDropList directly, in order // to avoid circular imports. If we were to reference them here, importing the registry into the // classes that are registering themselves will introduce a circular import. - class DragDropRegistry { constructor(_ngZone, _document) { this._ngZone = _ngZone; /** Registered drop container instances. */ - this._dropInstances = new Set(); /** Registered drag item instances. */ - this._dragInstances = new Set(); /** Drag item instances that are currently being dragged. */ - this._activeDragInstances = []; /** Keeps track of the event listeners that we've bound to the `document`. */ - this._globalListeners = new Map(); /** * Predicate function to check if an item is being dragged. Moved out into a property, * because it'll be called a lot and we don't want to create a new function every time. */ - this._draggingPredicate = item => item.isDragging(); /** * Emits the `touchmove` or `mousemove` events that are dispatched * while the user is dragging a drag item instance. */ - - - this.pointerMove = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.pointerMove = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** * Emits the `touchend` or `mouseup` events that are dispatched * while the user is dragging a drag item instance. */ - - this.pointerUp = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.pointerUp = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** * Emits when the viewport has been scrolled while the user is dragging an item. * @deprecated To be turned into a private member. Use the `scrolled` method instead. * @breaking-change 13.0.0 */ - - this.scroll = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.scroll = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** * Event listener that will prevent the default browser action while the user is dragging. * @param event Event whose default action should be prevented. */ - this._preventDefaultWhileDragging = event => { if (this._activeDragInstances.length > 0) { event.preventDefault(); } }; /** Event listener for `touchmove` that is bound even if no dragging is happening. */ - - this._persistentTouchmoveListener = event => { if (this._activeDragInstances.length > 0) { // Note that we only want to prevent the default action after dragging has actually started. @@ -12239,30 +10808,23 @@ class DragDropRegistry { if (this._activeDragInstances.some(this._draggingPredicate)) { event.preventDefault(); } - this.pointerMove.next(event); } }; - this._document = _document; } /** Adds a drop container to the registry. */ - - registerDropContainer(drop) { if (!this._dropInstances.has(drop)) { this._dropInstances.add(drop); } } /** Adds a drag item instance to the registry. */ - - registerDragItem(drag) { - this._dragInstances.add(drag); // The `touchmove` event gets bound once, ahead of time, because WebKit + this._dragInstances.add(drag); + // The `touchmove` event gets bound once, ahead of time, because WebKit // won't preventDefault on a dynamically-added `touchmove` listener. // See https://bugs.webkit.org/show_bug.cgi?id=184250. - - if (this._dragInstances.size === 1) { this._ngZone.runOutsideAngular(() => { // The event handler has to be explicitly active, @@ -12272,19 +10834,13 @@ class DragDropRegistry { } } /** Removes a drop container from the registry. */ - - removeDropContainer(drop) { this._dropInstances.delete(drop); } /** Removes a drag item instance from the registry. */ - - removeDragItem(drag) { this._dragInstances.delete(drag); - this.stopDragging(drag); - if (this._dragInstances.size === 0) { this._document.removeEventListener('touchmove', this._persistentTouchmoveListener, activeCapturingEventOptions); } @@ -12294,21 +10850,17 @@ class DragDropRegistry { * @param drag Drag instance which is being dragged. * @param event Event that initiated the dragging. */ - - startDragging(drag, event) { // Do not process the same drag twice to avoid memory leaks and redundant listeners if (this._activeDragInstances.indexOf(drag) > -1) { return; } - this._activeDragInstances.push(drag); - if (this._activeDragInstances.length === 1) { - const isTouchEvent = event.type.startsWith('touch'); // We explicitly bind __active__ listeners here, because newer browsers will default to + const isTouchEvent = event.type.startsWith('touch'); + // We explicitly bind __active__ listeners here, because newer browsers will default to // passive ones for `mousemove` and `touchmove`. The events need to be active, because we // use `preventDefault` to prevent the page from scrolling while the user is dragging. - this._globalListeners.set(isTouchEvent ? 'touchend' : 'mouseup', { handler: e => this.pointerUp.next(e), options: true @@ -12317,24 +10869,23 @@ class DragDropRegistry { // Use capturing so that we pick up scroll changes in any scrollable nodes that aren't // the document. See https://github.com/angular/components/issues/17144. options: true - }) // Preventing the default action on `mousemove` isn't enough to disable text selection + }) + // Preventing the default action on `mousemove` isn't enough to disable text selection // on Safari so we need to prevent the selection event as well. Alternatively this can // be done by setting `user-select: none` on the `body`, however it has causes a style // recalculation which can be expensive on pages with a lot of elements. .set('selectstart', { handler: this._preventDefaultWhileDragging, options: activeCapturingEventOptions - }); // We don't have to bind a move event for touch drag sequences, because + }); + // We don't have to bind a move event for touch drag sequences, because // we already have a persistent global one bound from `registerDragItem`. - - if (!isTouchEvent) { this._globalListeners.set('mousemove', { handler: e => this.pointerMove.next(e), options: activeCapturingEventOptions }); } - this._ngZone.runOutsideAngular(() => { this._globalListeners.forEach((config, name) => { this._document.addEventListener(name, config.handler, config.options); @@ -12343,22 +10894,16 @@ class DragDropRegistry { } } /** Stops dragging a drag item instance. */ - - stopDragging(drag) { const index = this._activeDragInstances.indexOf(drag); - if (index > -1) { this._activeDragInstances.splice(index, 1); - if (this._activeDragInstances.length === 0) { this._clearGlobalListeners(); } } } /** Gets whether a drag item instance is currently being dragged. */ - - isDragging(drag) { return this._activeDragInstances.indexOf(drag) > -1; } @@ -12369,25 +10914,20 @@ class DragDropRegistry { * Top-level listeners won't pick up events coming from the shadow DOM so this parameter can * be used to include an additional top-level listener at the shadow root level. */ - - scrolled(shadowRoot) { const streams = [this.scroll]; - if (shadowRoot && shadowRoot !== this._document) { - // Note that this is basically the same as `fromEvent` from rjxs, but we do it ourselves, + // Note that this is basically the same as `fromEvent` from rxjs, but we do it ourselves, // because we want to guarantee that the event is bound outside of the `NgZone`. With // `fromEvent` it'll only happen if the subscription is outside the `NgZone`. streams.push(new rxjs__WEBPACK_IMPORTED_MODULE_8__.Observable(observer => { return this._ngZone.runOutsideAngular(() => { const eventOptions = true; - const callback = event => { if (this._activeDragInstances.length) { observer.next(event); } }; - shadowRoot.addEventListener('scroll', callback, eventOptions); return () => { shadowRoot.removeEventListener('scroll', callback, eventOptions); @@ -12395,43 +10935,31 @@ class DragDropRegistry { }); })); } - return (0,rxjs__WEBPACK_IMPORTED_MODULE_9__.merge)(...streams); } - ngOnDestroy() { this._dragInstances.forEach(instance => this.removeDragItem(instance)); - this._dropInstances.forEach(instance => this.removeDropContainer(instance)); - this._clearGlobalListeners(); - this.pointerMove.complete(); this.pointerUp.complete(); } /** Clears out the global event listeners from the `document`. */ - - _clearGlobalListeners() { this._globalListeners.forEach((config, name) => { this._document.removeEventListener(name, config.handler, config.options); }); - this._globalListeners.clear(); } - } - DragDropRegistry.ɵfac = function DragDropRegistry_Factory(t) { return new (t || DragDropRegistry)(_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_10__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_11__.DOCUMENT)); }; - DragDropRegistry.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineInjectable"]({ token: DragDropRegistry, factory: DragDropRegistry.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵsetClassMetadata"](DragDropRegistry, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_10__.Injectable, @@ -12450,6 +10978,7 @@ DragDropRegistry.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_ }]; }, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -12457,10 +10986,7 @@ DragDropRegistry.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Default configuration to be used when creating a `DragRef`. */ - - const DEFAULT_CONFIG = { dragStartThreshold: 5, pointerDirectionChangeThreshold: 5 @@ -12468,7 +10994,6 @@ const DEFAULT_CONFIG = { /** * Service that allows for drag-and-drop functionality to be attached to DOM elements. */ - class DragDrop { constructor(_document, _ngZone, _viewportRuler, _dragDropRegistry) { this._document = _document; @@ -12481,8 +11006,6 @@ class DragDrop { * @param element Element to which to attach the dragging functionality. * @param config Object used to configure the dragging behavior. */ - - createDrag(element, config = DEFAULT_CONFIG) { return new DragRef(element, config, this._document, this._ngZone, this._viewportRuler, this._dragDropRegistry); } @@ -12490,24 +11013,18 @@ class DragDrop { * Turns an element into a drop list. * @param element Element to which to attach the drop list functionality. */ - - createDropList(element) { return new DropListRef(element, this._dragDropRegistry, this._document, this._ngZone, this._viewportRuler); } - } - DragDrop.ɵfac = function DragDrop_Factory(t) { return new (t || DragDrop)(_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_11__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_10__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_12__.ViewportRuler), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵinject"](DragDropRegistry)); }; - DragDrop.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineInjectable"]({ token: DragDrop, factory: DragDrop.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵsetClassMetadata"](DragDrop, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_10__.Injectable, @@ -12530,6 +11047,7 @@ DragDrop.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵ }]; }, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -12537,16 +11055,14 @@ DragDrop.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Injection token that can be used for a `CdkDrag` to provide itself as a parent to the * drag-specific child directive (`CdkDragHandle`, `CdkDragPreview` etc.). Used primarily * to avoid circular imports. * @docs-private */ - - const CDK_DRAG_PARENT = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.InjectionToken('CDK_DRAG_PARENT'); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -12562,13 +11078,11 @@ const CDK_DRAG_PARENT = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.Injectio * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Injection token that can be used to reference instances of `CdkDropListGroup`. It serves as * alternative token to the actual `CdkDropListGroup` class which could cause unnecessary * retention of the class and its directive metadata. */ - const CDK_DROP_LIST_GROUP = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.InjectionToken('CdkDropListGroup'); /** * Declaratively connects sibling `cdkDropList` instances together. All of the `cdkDropList` @@ -12576,7 +11090,6 @@ const CDK_DROP_LIST_GROUP = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.Inje * automatically. Can be used as an alternative to the `cdkDropListConnectedTo` input * from `cdkDropList`. */ - class CdkDropListGroup { constructor() { /** Drop lists registered inside the group. */ @@ -12584,26 +11097,19 @@ class CdkDropListGroup { this._disabled = false; } /** Whether starting a dragging sequence from inside this group is disabled. */ - - get disabled() { return this._disabled; } - set disabled(value) { - this._disabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceBooleanProperty)(value); + this._disabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceBooleanProperty)(value); } - ngOnDestroy() { this._items.clear(); } - } - CdkDropListGroup.ɵfac = function CdkDropListGroup_Factory(t) { return new (t || CdkDropListGroup)(); }; - CdkDropListGroup.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineDirective"]({ type: CdkDropListGroup, selectors: [["", "cdkDropListGroup", ""]], @@ -12611,18 +11117,19 @@ CdkDropListGroup.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1 disabled: ["cdkDropListGroupDisabled", "disabled"] }, exportAs: ["cdkDropListGroup"], + standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵProvidersFeature"]([{ provide: CDK_DROP_LIST_GROUP, useExisting: CdkDropListGroup }])] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵsetClassMetadata"](CdkDropListGroup, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_10__.Directive, args: [{ selector: '[cdkDropListGroup]', exportAs: 'cdkDropListGroup', + standalone: true, providers: [{ provide: CDK_DROP_LIST_GROUP, useExisting: CdkDropListGroup @@ -12635,6 +11142,7 @@ CdkDropListGroup.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1 }] }); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -12642,14 +11150,12 @@ CdkDropListGroup.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1 * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Injection token that can be used to configure the * behavior of the drag&drop-related components. */ - - const CDK_DRAG_CONFIG = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.InjectionToken('CDK_DRAG_CONFIG'); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -12657,18 +11163,17 @@ const CDK_DRAG_CONFIG = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.Injectio * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Asserts that a particular node is an element. * @param node Node to be checked. * @param name Name to attach to the error message. */ - function assertElementNode(node, name) { if (node.nodeType !== 1) { throw Error(`${name} must be attached to an element node. ` + `Currently attached to "${node.nodeName}".`); } } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -12676,23 +11181,28 @@ function assertElementNode(node, name) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Counter used to generate unique ids for drop zones. */ - - let _uniqueIdCounter = 0; /** * Injection token that can be used to reference instances of `CdkDropList`. It serves as * alternative token to the actual `CdkDropList` class which could cause unnecessary * retention of the class and its directive metadata. */ - const CDK_DROP_LIST = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.InjectionToken('CdkDropList'); /** Container that wraps a set of draggable items. */ - class CdkDropList { - constructor( - /** Element that the drop list is attached to. */ + /** Whether starting a dragging sequence from this container is disabled. */ + get disabled() { + return this._disabled || !!this._group && this._group.disabled; + } + set disabled(value) { + // Usually we sync the directive and ref state right before dragging starts, in order to have + // a single point of failure and to avoid having to use setters for everything. `disabled` is + // a special case, because it can prevent the `beforeStarted` event from firing, which can lock + // the user in a disabled state, so we also need to sync it as it's being set. + this._dropListRef.disabled = this._disabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceBooleanProperty)(value); + } + constructor( /** Element that the drop list is attached to. */ element, dragDrop, _changeDetectorRef, _scrollDispatcher, _dir, _group, config) { this.element = element; this._changeDetectorRef = _changeDetectorRef; @@ -12700,48 +11210,37 @@ class CdkDropList { this._dir = _dir; this._group = _group; /** Emits when the list has been destroyed. */ - - this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** * Other draggable containers that this container is connected to and into which the * container's items can be transferred. Can either be references to other drop containers, * or their unique IDs. */ - this.connectedTo = []; /** * Unique ID for the drop zone. Can be used as a reference * in the `connectedTo` of another `CdkDropList`. */ - this.id = `cdk-drop-list-${_uniqueIdCounter++}`; /** * Function that is used to determine whether an item * is allowed to be moved into a drop container. */ - this.enterPredicate = () => true; /** Functions that is used to determine whether an item can be sorted into a particular index. */ - - this.sortPredicate = () => true; /** Emits when the user drops an item inside the container. */ - - this.dropped = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.EventEmitter(); /** * Emits when the user has moved a new drag item into this container. */ - this.entered = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.EventEmitter(); /** * Emits when the user removes an item from the container * by dragging it into another container. */ - this.exited = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.EventEmitter(); /** Emits as the user is swapping items while actively dragging. */ - this.sorted = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.EventEmitter(); /** * Keeps track of the items that are registered with this container. Historically we used to @@ -12750,163 +11249,109 @@ class CdkDropList { * correctly. What we do instead is to have the items register themselves with the container * and then we sort them based on their position in the DOM. */ - this._unsortedItems = new Set(); - if (typeof ngDevMode === 'undefined' || ngDevMode) { assertElementNode(element.nativeElement, 'cdkDropList'); } - this._dropListRef = dragDrop.createDropList(element); this._dropListRef.data = this; - if (config) { this._assignDefaults(config); } - this._dropListRef.enterPredicate = (drag, drop) => { return this.enterPredicate(drag.data, drop.data); }; - this._dropListRef.sortPredicate = (index, drag, drop) => { return this.sortPredicate(index, drag.data, drop.data); }; - this._setupInputSyncSubscription(this._dropListRef); - this._handleEvents(this._dropListRef); - CdkDropList._dropLists.push(this); - if (_group) { _group._items.add(this); } } - /** Whether starting a dragging sequence from this container is disabled. */ - - - get disabled() { - return this._disabled || !!this._group && this._group.disabled; - } - - set disabled(value) { - // Usually we sync the directive and ref state right before dragging starts, in order to have - // a single point of failure and to avoid having to use setters for everything. `disabled` is - // a special case, because it can prevent the `beforeStarted` event from firing, which can lock - // the user in a disabled state, so we also need to sync it as it's being set. - this._dropListRef.disabled = this._disabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceBooleanProperty)(value); - } /** Registers an items with the drop list. */ - - addItem(item) { this._unsortedItems.add(item); - if (this._dropListRef.isDragging()) { this._syncItemsWithRef(); } } /** Removes an item from the drop list. */ - - removeItem(item) { this._unsortedItems.delete(item); - if (this._dropListRef.isDragging()) { this._syncItemsWithRef(); } } /** Gets the registered items in the list, sorted by their position in the DOM. */ - - getSortedItems() { return Array.from(this._unsortedItems).sort((a, b) => { - const documentPosition = a._dragRef.getVisibleElement().compareDocumentPosition(b._dragRef.getVisibleElement()); // `compareDocumentPosition` returns a bitmask so we have to use a bitwise operator. + const documentPosition = a._dragRef.getVisibleElement().compareDocumentPosition(b._dragRef.getVisibleElement()); + // `compareDocumentPosition` returns a bitmask so we have to use a bitwise operator. // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition // tslint:disable-next-line:no-bitwise - - return documentPosition & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1; }); } - ngOnDestroy() { const index = CdkDropList._dropLists.indexOf(this); - if (index > -1) { CdkDropList._dropLists.splice(index, 1); } - if (this._group) { this._group._items.delete(this); } - this._unsortedItems.clear(); - this._dropListRef.dispose(); - this._destroyed.next(); - this._destroyed.complete(); } /** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */ - - _setupInputSyncSubscription(ref) { if (this._dir) { this._dir.change.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.startWith)(this._dir.value), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.takeUntil)(this._destroyed)).subscribe(value => ref.withDirection(value)); } - ref.beforeStarted.subscribe(() => { - const siblings = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceArray)(this.connectedTo).map(drop => { + const siblings = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceArray)(this.connectedTo).map(drop => { if (typeof drop === 'string') { const correspondingDropList = CdkDropList._dropLists.find(list => list.id === drop); - if (!correspondingDropList && (typeof ngDevMode === 'undefined' || ngDevMode)) { console.warn(`CdkDropList could not find connected drop list with id "${drop}"`); } - return correspondingDropList; } - return drop; }); - if (this._group) { this._group._items.forEach(drop => { if (siblings.indexOf(drop) === -1) { siblings.push(drop); } }); - } // Note that we resolve the scrollable parents here so that we delay the resolution + } + // Note that we resolve the scrollable parents here so that we delay the resolution // as long as possible, ensuring that the element is in its final place in the DOM. - - if (!this._scrollableParentsResolved) { const scrollableParents = this._scrollDispatcher.getAncestorScrollContainers(this.element).map(scrollable => scrollable.getElementRef().nativeElement); - - this._dropListRef.withScrollableParents(scrollableParents); // Only do this once since it involves traversing the DOM and the parents + this._dropListRef.withScrollableParents(scrollableParents); + // Only do this once since it involves traversing the DOM and the parents // shouldn't be able to change without the drop list being destroyed. - - this._scrollableParentsResolved = true; } - ref.disabled = this.disabled; ref.lockAxis = this.lockAxis; - ref.sortingDisabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceBooleanProperty)(this.sortingDisabled); - ref.autoScrollDisabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceBooleanProperty)(this.autoScrollDisabled); - ref.autoScrollStep = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceNumberProperty)(this.autoScrollStep, 2); + ref.sortingDisabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceBooleanProperty)(this.sortingDisabled); + ref.autoScrollDisabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceBooleanProperty)(this.autoScrollDisabled); + ref.autoScrollStep = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceNumberProperty)(this.autoScrollStep, 2); ref.connectedTo(siblings.filter(drop => drop && drop !== this).map(list => list._dropListRef)).withOrientation(this.orientation); }); } /** Handles events from the underlying DropListRef. */ - - _handleEvents(ref) { ref.beforeStarted.subscribe(() => { this._syncItemsWithRef(); - this._changeDetectorRef.markForCheck(); }); ref.entered.subscribe(event => { @@ -12921,7 +11366,6 @@ class CdkDropList { container: this, item: event.item.data }); - this._changeDetectorRef.markForCheck(); }); ref.sorted.subscribe(event => { @@ -12943,15 +11387,14 @@ class CdkDropList { distance: dropEvent.distance, dropPoint: dropEvent.dropPoint, event: dropEvent.event - }); // Mark for check since all of these events run outside of change + }); + // Mark for check since all of these events run outside of change // detection and we're not guaranteed for something else to have triggered it. - this._changeDetectorRef.markForCheck(); }); + (0,rxjs__WEBPACK_IMPORTED_MODULE_9__.merge)(ref.receivingStarted, ref.receivingStopped).subscribe(() => this._changeDetectorRef.markForCheck()); } /** Assigns the default input values based on a provided config object. */ - - _assignDefaults(config) { const { lockAxis, @@ -12964,28 +11407,20 @@ class CdkDropList { this.sortingDisabled = sortingDisabled == null ? false : sortingDisabled; this.autoScrollDisabled = listAutoScrollDisabled == null ? false : listAutoScrollDisabled; this.orientation = listOrientation || 'vertical'; - if (lockAxis) { this.lockAxis = lockAxis; } } /** Syncs up the registered drag items with underlying drop list ref. */ - - _syncItemsWithRef() { this._dropListRef.withItems(this.getSortedItems().map(item => item._dragRef)); } - } /** Keeps track of the drop lists that are currently on the page. */ - - CdkDropList._dropLists = []; - CdkDropList.ɵfac = function CdkDropList_Factory(t) { return new (t || CdkDropList)(_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_10__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](DragDrop), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_10__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_12__.ScrollDispatcher), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_14__.Directionality, 8), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](CDK_DROP_LIST_GROUP, 12), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](CDK_DRAG_CONFIG, 8)); }; - CdkDropList.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineDirective"]({ type: CdkDropList, selectors: [["", "cdkDropList", ""], ["cdk-drop-list"]], @@ -13017,7 +11452,9 @@ CdkDropList.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__[" sorted: "cdkDropListSorted" }, exportAs: ["cdkDropList"], - features: [_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵProvidersFeature"]([// Prevent child drop lists from picking up the same group as their parent. + standalone: true, + features: [_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵProvidersFeature"]([ + // Prevent child drop lists from picking up the same group as their parent. { provide: CDK_DROP_LIST_GROUP, useValue: undefined @@ -13026,14 +11463,15 @@ CdkDropList.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__[" useExisting: CdkDropList }])] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵsetClassMetadata"](CdkDropList, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_10__.Directive, args: [{ selector: '[cdkDropList], cdk-drop-list', exportAs: 'cdkDropList', - providers: [// Prevent child drop lists from picking up the same group as their parent. + standalone: true, + providers: [ + // Prevent child drop lists from picking up the same group as their parent. { provide: CDK_DROP_LIST_GROUP, useValue: undefined @@ -13144,6 +11582,7 @@ CdkDropList.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__[" }] }); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -13151,54 +11590,39 @@ CdkDropList.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__[" * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Injection token that can be used to reference instances of `CdkDragHandle`. It serves as * alternative token to the actual `CdkDragHandle` class which could cause unnecessary * retention of the class and its directive metadata. */ - - const CDK_DRAG_HANDLE = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.InjectionToken('CdkDragHandle'); /** Handle that can be used to drag a CdkDrag instance. */ - class CdkDragHandle { + /** Whether starting to drag through this handle is disabled. */ + get disabled() { + return this._disabled; + } + set disabled(value) { + this._disabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceBooleanProperty)(value); + this._stateChanges.next(this); + } constructor(element, parentDrag) { this.element = element; /** Emits when the state of the handle has changed. */ - - this._stateChanges = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this._stateChanges = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); this._disabled = false; - if (typeof ngDevMode === 'undefined' || ngDevMode) { assertElementNode(element.nativeElement, 'cdkDragHandle'); } - this._parentDrag = parentDrag; } - /** Whether starting to drag through this handle is disabled. */ - - - get disabled() { - return this._disabled; - } - - set disabled(value) { - this._disabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceBooleanProperty)(value); - - this._stateChanges.next(this); - } - ngOnDestroy() { this._stateChanges.complete(); } - } - CdkDragHandle.ɵfac = function CdkDragHandle_Factory(t) { return new (t || CdkDragHandle)(_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_10__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](CDK_DRAG_PARENT, 12)); }; - CdkDragHandle.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineDirective"]({ type: CdkDragHandle, selectors: [["", "cdkDragHandle", ""]], @@ -13206,17 +11630,18 @@ CdkDragHandle.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__ inputs: { disabled: ["cdkDragHandleDisabled", "disabled"] }, + standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵProvidersFeature"]([{ provide: CDK_DRAG_HANDLE, useExisting: CdkDragHandle }])] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵsetClassMetadata"](CdkDragHandle, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_10__.Directive, args: [{ selector: '[cdkDragHandle]', + standalone: true, host: { 'class': 'cdk-drag-handle' }, @@ -13246,6 +11671,7 @@ CdkDragHandle.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__ }] }); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -13253,48 +11679,42 @@ CdkDragHandle.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Injection token that can be used to reference instances of `CdkDragPlaceholder`. It serves as * alternative token to the actual `CdkDragPlaceholder` class which could cause unnecessary * retention of the class and its directive metadata. */ - - const CDK_DRAG_PLACEHOLDER = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.InjectionToken('CdkDragPlaceholder'); /** * Element that will be used as a template for the placeholder of a CdkDrag when * it is being dragged. The placeholder is displayed in place of the element being dragged. */ - class CdkDragPlaceholder { constructor(templateRef) { this.templateRef = templateRef; } - } - CdkDragPlaceholder.ɵfac = function CdkDragPlaceholder_Factory(t) { return new (t || CdkDragPlaceholder)(_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_10__.TemplateRef)); }; - CdkDragPlaceholder.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineDirective"]({ type: CdkDragPlaceholder, selectors: [["ng-template", "cdkDragPlaceholder", ""]], inputs: { data: "data" }, + standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵProvidersFeature"]([{ provide: CDK_DRAG_PLACEHOLDER, useExisting: CdkDragPlaceholder }])] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵsetClassMetadata"](CdkDragPlaceholder, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_10__.Directive, args: [{ selector: 'ng-template[cdkDragPlaceholder]', + standalone: true, providers: [{ provide: CDK_DRAG_PLACEHOLDER, useExisting: CdkDragPlaceholder @@ -13310,6 +11730,7 @@ CdkDragPlaceholder.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE }] }); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -13317,42 +11738,32 @@ CdkDragPlaceholder.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Injection token that can be used to reference instances of `CdkDragPreview`. It serves as * alternative token to the actual `CdkDragPreview` class which could cause unnecessary * retention of the class and its directive metadata. */ - - const CDK_DRAG_PREVIEW = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.InjectionToken('CdkDragPreview'); /** * Element that will be used as a template for the preview * of a CdkDrag when it is being dragged. */ - class CdkDragPreview { - constructor(templateRef) { - this.templateRef = templateRef; - this._matchSize = false; - } /** Whether the preview should preserve the same size as the item that is being dragged. */ - - get matchSize() { return this._matchSize; } - set matchSize(value) { - this._matchSize = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceBooleanProperty)(value); + this._matchSize = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceBooleanProperty)(value); + } + constructor(templateRef) { + this.templateRef = templateRef; + this._matchSize = false; } - } - CdkDragPreview.ɵfac = function CdkDragPreview_Factory(t) { return new (t || CdkDragPreview)(_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_10__.TemplateRef)); }; - CdkDragPreview.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineDirective"]({ type: CdkDragPreview, selectors: [["ng-template", "cdkDragPreview", ""]], @@ -13360,17 +11771,18 @@ CdkDragPreview.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10_ data: "data", matchSize: "matchSize" }, + standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵProvidersFeature"]([{ provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview }])] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵsetClassMetadata"](CdkDragPreview, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_10__.Directive, args: [{ selector: 'ng-template[cdkDragPreview]', + standalone: true, providers: [{ provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview @@ -13389,6 +11801,7 @@ CdkDragPreview.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10_ }] }); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -13396,16 +11809,19 @@ CdkDragPreview.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10_ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - const DRAG_HOST_CLASS = 'cdk-drag'; /** Element that can be moved inside a CdkDropList container. */ - class CdkDrag { - constructor( - /** Element that the draggable is attached to. */ - element, - /** Droppable container that the draggable is a part of. */ + /** Whether starting to drag this element is disabled. */ + get disabled() { + return this._disabled || this.dropContainer && this.dropContainer.disabled; + } + set disabled(value) { + this._disabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceBooleanProperty)(value); + this._dragRef.disabled = this._disabled; + } + constructor( /** Element that the draggable is attached to. */ + element, /** Droppable container that the draggable is a part of. */ dropContainer, /** * @deprecated `_document` parameter no longer being used and will be removed. @@ -13420,30 +11836,23 @@ class CdkDrag { this._changeDetectorRef = _changeDetectorRef; this._selfHandle = _selfHandle; this._parentDrag = _parentDrag; - this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); /** Emits when the user starts dragging the item. */ - this.started = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.EventEmitter(); /** Emits when the user has released a drag item, before any animations have started. */ - this.released = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.EventEmitter(); /** Emits when the user stops dragging an item in the container. */ - this.ended = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.EventEmitter(); /** Emits when the user has moved the item into a new container. */ - this.entered = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.EventEmitter(); /** Emits when the user removes the item its container by dragging it into another container. */ - this.exited = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.EventEmitter(); /** Emits when the user drops the item inside a container. */ - this.dropped = new _angular_core__WEBPACK_IMPORTED_MODULE_10__.EventEmitter(); /** * Emits as the user is dragging the item. Use with caution, * because this event will fire for every pixel that the user has dragged. */ - this.moved = new rxjs__WEBPACK_IMPORTED_MODULE_8__.Observable(observer => { const subscription = this._dragRef.moved.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_15__.map)(movedEvent => ({ source: this, @@ -13452,7 +11861,6 @@ class CdkDrag { delta: movedEvent.delta, distance: movedEvent.distance }))).subscribe(observer); - return () => { subscription.unsubscribe(); }; @@ -13462,70 +11870,46 @@ class CdkDrag { pointerDirectionChangeThreshold: config && config.pointerDirectionChangeThreshold != null ? config.pointerDirectionChangeThreshold : 5, zIndex: config?.zIndex }); - this._dragRef.data = this; // We have to keep track of the drag instances in order to be able to match an element to + this._dragRef.data = this; + // We have to keep track of the drag instances in order to be able to match an element to // a drag instance. We can't go through the global registry of `DragRef`, because the root // element could be different. - CdkDrag._dragInstances.push(this); - if (config) { this._assignDefaults(config); - } // Note that usually the container is assigned when the drop list is picks up the item, but in + } + // Note that usually the container is assigned when the drop list is picks up the item, but in // some cases (mainly transplanted views with OnPush, see #18341) we may end up in a situation // where there are no items on the first change detection pass, but the items get picked up as // soon as the user triggers another pass by dragging. This is a problem, because the item would // have to switch from standalone mode to drag mode in the middle of the dragging sequence which // is too late since the two modes save different kinds of information. We work around it by // assigning the drop container both from here and the list. - - if (dropContainer) { this._dragRef._withDropContainer(dropContainer._dropListRef); - dropContainer.addItem(this); } - this._syncInputs(this._dragRef); - this._handleEvents(this._dragRef); } - /** Whether starting to drag this element is disabled. */ - - - get disabled() { - return this._disabled || this.dropContainer && this.dropContainer.disabled; - } - - set disabled(value) { - this._disabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceBooleanProperty)(value); - this._dragRef.disabled = this._disabled; - } /** * Returns the element that is being used as a placeholder * while the current element is being dragged. */ - - getPlaceholderElement() { return this._dragRef.getPlaceholderElement(); } /** Returns the root draggable element. */ - - getRootElement() { return this._dragRef.getRootElement(); } /** Resets a standalone drag item to its initial position. */ - - reset() { this._dragRef.reset(); } /** * Gets the pixel coordinates of the draggable outside of a drop container. */ - - getFreeDragPosition() { return this._dragRef.getFreeDragPosition(); } @@ -13533,12 +11917,9 @@ class CdkDrag { * Sets the current position in pixels the draggable outside of a drop container. * @param value New position to be set. */ - - setFreeDragPosition(value) { this._dragRef.setFreeDragPosition(value); } - ngAfterViewInit() { // Normally this isn't in the zone, but it can cause major performance regressions for apps // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes. @@ -13549,88 +11930,67 @@ class CdkDrag { // their original DOM position and then they get transferred to the portal. this._ngZone.onStable.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.take)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.takeUntil)(this._destroyed)).subscribe(() => { this._updateRootElement(); - this._setupHandlesListener(); - if (this.freeDragPosition) { this._dragRef.setFreeDragPosition(this.freeDragPosition); } }); }); } - ngOnChanges(changes) { const rootSelectorChange = changes['rootElementSelector']; - const positionChange = changes['freeDragPosition']; // We don't have to react to the first change since it's being + const positionChange = changes['freeDragPosition']; + // We don't have to react to the first change since it's being // handled in `ngAfterViewInit` where it needs to be deferred. - if (rootSelectorChange && !rootSelectorChange.firstChange) { this._updateRootElement(); - } // Skip the first change since it's being handled in `ngAfterViewInit`. - - + } + // Skip the first change since it's being handled in `ngAfterViewInit`. if (positionChange && !positionChange.firstChange && this.freeDragPosition) { this._dragRef.setFreeDragPosition(this.freeDragPosition); } } - ngOnDestroy() { if (this.dropContainer) { this.dropContainer.removeItem(this); } - const index = CdkDrag._dragInstances.indexOf(this); - if (index > -1) { CdkDrag._dragInstances.splice(index, 1); - } // Unnecessary in most cases, but used to avoid extra change detections with `zone-paths-rxjs`. - - + } + // Unnecessary in most cases, but used to avoid extra change detections with `zone-paths-rxjs`. this._ngZone.runOutsideAngular(() => { this._destroyed.next(); - this._destroyed.complete(); - this._dragRef.dispose(); }); } /** Syncs the root element with the `DragRef`. */ - - _updateRootElement() { const element = this.element.nativeElement; let rootElement = element; - if (this.rootElementSelector) { - rootElement = element.closest !== undefined ? element.closest(this.rootElementSelector) : // Comment tag doesn't have closest method, so use parent's one. + rootElement = element.closest !== undefined ? element.closest(this.rootElementSelector) : + // Comment tag doesn't have closest method, so use parent's one. element.parentElement?.closest(this.rootElementSelector); } - if (rootElement && (typeof ngDevMode === 'undefined' || ngDevMode)) { assertElementNode(rootElement, 'cdkDrag'); } - this._dragRef.withRootElement(rootElement || element); } /** Gets the boundary element, based on the `boundaryElement` value. */ - - _getBoundaryElement() { const boundary = this.boundaryElement; - if (!boundary) { return null; } - if (typeof boundary === 'string') { return this.element.nativeElement.closest(boundary); } - - return (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(boundary); + return (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(boundary); } /** Syncs the inputs of the CdkDrag with the options of the underlying DragRef. */ - - _syncInputs(ref) { ref.beforeStarted.subscribe(() => { if (!ref.isDragging()) { @@ -13649,28 +12009,25 @@ class CdkDrag { } : null; ref.disabled = this.disabled; ref.lockAxis = this.lockAxis; - ref.dragStartDelay = typeof dragStartDelay === 'object' && dragStartDelay ? dragStartDelay : (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceNumberProperty)(dragStartDelay); + ref.dragStartDelay = typeof dragStartDelay === 'object' && dragStartDelay ? dragStartDelay : (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceNumberProperty)(dragStartDelay); ref.constrainPosition = this.constrainPosition; ref.previewClass = this.previewClass; ref.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(placeholder).withPreviewTemplate(preview).withPreviewContainer(this.previewContainer || 'global'); - if (dir) { ref.withDirection(dir.value); } } - }); // This only needs to be resolved once. - + }); + // This only needs to be resolved once. ref.beforeStarted.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.take)(1)).subscribe(() => { // If we managed to resolve a parent through DI, use it. if (this._parentDrag) { ref.withParent(this._parentDrag._dragRef); return; - } // Otherwise fall back to resolving the parent by looking up the DOM. This can happen if + } + // Otherwise fall back to resolving the parent by looking up the DOM. This can happen if // the item was projected into another item by something like `ngTemplateOutlet`. - - let parent = this.element.nativeElement.parentElement; - while (parent) { if (parent.classList.contains(DRAG_HOST_CLASS)) { ref.withParent(CdkDrag._dragInstances.find(drag => { @@ -13678,22 +12035,19 @@ class CdkDrag { })?._dragRef || null); break; } - parent = parent.parentElement; } }); } /** Handles the events from the underlying `DragRef`. */ - - _handleEvents(ref) { ref.started.subscribe(startEvent => { this.started.emit({ source: this, event: startEvent.event - }); // Since all of these events run outside of change detection, + }); + // Since all of these events run outside of change detection, // we need to ensure that everything is marked correctly. - this._changeDetectorRef.markForCheck(); }); ref.released.subscribe(releaseEvent => { @@ -13708,9 +12062,9 @@ class CdkDrag { distance: endEvent.distance, dropPoint: endEvent.dropPoint, event: endEvent.event - }); // Since all of these events run outside of change detection, + }); + // Since all of these events run outside of change detection, // we need to ensure that everything is marked correctly. - this._changeDetectorRef.markForCheck(); }); ref.entered.subscribe(enterEvent => { @@ -13741,8 +12095,6 @@ class CdkDrag { }); } /** Assigns the default input values based on a provided config object. */ - - _assignDefaults(config) { const { lockAxis, @@ -13756,48 +12108,41 @@ class CdkDrag { } = config; this.disabled = draggingDisabled == null ? false : draggingDisabled; this.dragStartDelay = dragStartDelay || 0; - if (lockAxis) { this.lockAxis = lockAxis; } - if (constrainPosition) { this.constrainPosition = constrainPosition; } - if (previewClass) { this.previewClass = previewClass; } - if (boundaryElement) { this.boundaryElement = boundaryElement; } - if (rootElementSelector) { this.rootElementSelector = rootElementSelector; } - if (previewContainer) { this.previewContainer = previewContainer; } } /** Sets up the listener that syncs the handles with the drag ref. */ - - _setupHandlesListener() { // Listen for any newly-added handles. - this._handles.changes.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.startWith)(this._handles), // Sync the new handles with the DragRef. + this._handles.changes.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.startWith)(this._handles), + // Sync the new handles with the DragRef. (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.tap)(handles => { - const childHandleElements = handles.filter(handle => handle._parentDrag === this).map(handle => handle.element); // Usually handles are only allowed to be a descendant of the drag element, but if + const childHandleElements = handles.filter(handle => handle._parentDrag === this).map(handle => handle.element); + // Usually handles are only allowed to be a descendant of the drag element, but if // the consumer defined a different drag root, we should allow the drag element // itself to be a handle too. - if (this._selfHandle && this.rootElementSelector) { childHandleElements.push(this.element); } - this._dragRef.withHandles(childHandleElements); - }), // Listen if the state of any of the handles changes. + }), + // Listen if the state of any of the handles changes. (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.switchMap)(handles => { return (0,rxjs__WEBPACK_IMPORTED_MODULE_9__.merge)(...handles.map(item => { return item._stateChanges.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.startWith)(item)); @@ -13809,15 +12154,11 @@ class CdkDrag { handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle); }); } - } - CdkDrag._dragInstances = []; - CdkDrag.ɵfac = function CdkDrag_Factory(t) { return new (t || CdkDrag)(_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_10__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](CDK_DROP_LIST, 12), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_common__WEBPACK_IMPORTED_MODULE_11__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_10__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_10__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](CDK_DRAG_CONFIG, 8), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_14__.Directionality, 8), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](DragDrop), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_10__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](CDK_DRAG_HANDLE, 10), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdirectiveInject"](CDK_DRAG_PARENT, 12)); }; - CdkDrag.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineDirective"]({ type: CdkDrag, selectors: [["", "cdkDrag", ""]], @@ -13827,10 +12168,8 @@ CdkDrag.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵ _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵcontentQuery"](dirIndex, CDK_DRAG_PLACEHOLDER, 5); _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵcontentQuery"](dirIndex, CDK_DRAG_HANDLE, 5); } - if (rf & 2) { let _t; - _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵloadQuery"]()) && (ctx._previewTemplate = _t.first); _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵloadQuery"]()) && (ctx._placeholderTemplate = _t.first); _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵloadQuery"]()) && (ctx._handles = _t); @@ -13865,18 +12204,19 @@ CdkDrag.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵ moved: "cdkDragMoved" }, exportAs: ["cdkDrag"], + standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵProvidersFeature"]([{ provide: CDK_DRAG_PARENT, useExisting: CdkDrag }]), _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵNgOnChangesFeature"]] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵsetClassMetadata"](CdkDrag, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_10__.Directive, args: [{ selector: '[cdkDrag]', exportAs: 'cdkDrag', + standalone: true, host: { 'class': DRAG_HOST_CLASS, '[class.cdk-drag-disabled]': 'disabled', @@ -14033,6 +12373,7 @@ CdkDrag.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵ }] }); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -14040,14 +12381,11 @@ CdkDrag.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - +const DRAG_DROP_DIRECTIVES = [CdkDropList, CdkDropListGroup, CdkDrag, CdkDragHandle, CdkDragPreview, CdkDragPlaceholder]; class DragDropModule {} - DragDropModule.ɵfac = function DragDropModule_Factory(t) { return new (t || DragDropModule)(); }; - DragDropModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵɵdefineNgModule"]({ type: DragDropModule }); @@ -14055,17 +12393,17 @@ DragDropModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10_ providers: [DragDrop], imports: [_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_12__.CdkScrollableModule] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_10__["ɵsetClassMetadata"](DragDropModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_10__.NgModule, args: [{ - declarations: [CdkDropList, CdkDropListGroup, CdkDrag, CdkDragHandle, CdkDragPreview, CdkDragPlaceholder], - exports: [_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_12__.CdkScrollableModule, CdkDropList, CdkDropListGroup, CdkDrag, CdkDragHandle, CdkDragPreview, CdkDragPlaceholder], + imports: DRAG_DROP_DIRECTIVES, + exports: [_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_12__.CdkScrollableModule, ...DRAG_DROP_DIRECTIVES], providers: [DragDrop] }] }], null, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -14088,7 +12426,6 @@ DragDropModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_10_ - /***/ }), /***/ 8456: @@ -14262,9 +12599,7 @@ const SEVEN = 55; const EIGHT = 56; const NINE = 57; const FF_SEMICOLON = 59; // Firefox (Gecko) fires this for semicolon instead of 186 - const FF_EQUALS = 61; // Firefox (Gecko) fires this for equals instead of 187 - const QUESTION_MARK = 63; const AT_SIGN = 64; const A = 65; @@ -14294,7 +12629,6 @@ const X = 88; const Y = 89; const Z = 90; const META = 91; // WIN_KEY_LEFT - const MAC_WK_CMD_LEFT = 91; const MAC_WK_CMD_RIGHT = 93; const CONTEXT_MENU = 93; @@ -14330,22 +12664,16 @@ const SCROLL_LOCK = 145; const FIRST_MEDIA = 166; const FF_MINUS = 173; const MUTE = 173; // Firefox (Gecko) fires 181 for MUTE - const VOLUME_DOWN = 174; // Firefox (Gecko) fires 182 for VOLUME_DOWN - const VOLUME_UP = 175; // Firefox (Gecko) fires 183 for VOLUME_UP - const FF_MUTE = 181; const FF_VOLUME_DOWN = 182; const LAST_MEDIA = 183; const FF_VOLUME_UP = 183; const SEMICOLON = 186; // Firefox (Gecko) fires 59 for SEMICOLON - const EQUALS = 187; // Firefox (Gecko) fires 61 for EQUALS - const COMMA = 188; const DASH = 189; // Firefox (Gecko) fires 173 for DASH/MINUS - const PERIOD = 190; const SLASH = 191; const APOSTROPHE = 192; @@ -14355,6 +12683,7 @@ const BACKSLASH = 220; const CLOSE_SQUARE_BRACKET = 221; const SINGLE_QUOTE = 222; const MAC_META = 224; + /** * @license * Copyright Google LLC All Rights Reserved. @@ -14362,19 +12691,17 @@ const MAC_META = 224; * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Checks whether a modifier key is pressed. * @param event Event to be checked. */ - function hasModifierKey(event, ...modifiers) { if (modifiers.length) { return modifiers.some(modifier => event[modifier]); } - return event.altKey || event.shiftKey || event.ctrlKey || event.metaKey; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -14397,6 +12724,324 @@ function hasModifierKey(event, ...modifiers) { +/***/ }), + +/***/ 3278: +/*!*******************************************************!*\ + !*** ./node_modules/@angular/cdk/fesm2020/layout.mjs ***! + \*******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "BreakpointObserver": () => (/* binding */ BreakpointObserver), +/* harmony export */ "Breakpoints": () => (/* binding */ Breakpoints), +/* harmony export */ "LayoutModule": () => (/* binding */ LayoutModule), +/* harmony export */ "MediaMatcher": () => (/* binding */ MediaMatcher) +/* harmony export */ }); +/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2560); +/* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/coercion */ 8971); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 228); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 6562); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 4240); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs */ 833); +/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ 9295); +/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ 7260); +/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs/operators */ 1989); +/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs/operators */ 635); +/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs/operators */ 4874); +/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs/operators */ 8951); +/* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/cdk/platform */ 9107); + + + + + + + +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +class LayoutModule {} +LayoutModule.ɵfac = function LayoutModule_Factory(t) { + return new (t || LayoutModule)(); +}; +LayoutModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ + type: LayoutModule +}); +LayoutModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({}); +(function () { + (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](LayoutModule, [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule, + args: [{}] + }], null, null); +})(); + +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** Global registry for all dynamically-created, injected media queries. */ +const mediaQueriesForWebkitCompatibility = new Set(); +/** Style tag that holds all of the dynamically-created media queries. */ +let mediaQueryStyleNode; +/** A utility for calling matchMedia queries. */ +class MediaMatcher { + constructor(_platform) { + this._platform = _platform; + this._matchMedia = this._platform.isBrowser && window.matchMedia ? + // matchMedia is bound to the window scope intentionally as it is an illegal invocation to + // call it from a different scope. + window.matchMedia.bind(window) : noopMatchMedia; + } + /** + * Evaluates the given media query and returns the native MediaQueryList from which results + * can be retrieved. + * Confirms the layout engine will trigger for the selector query provided and returns the + * MediaQueryList for the query provided. + */ + matchMedia(query) { + if (this._platform.WEBKIT || this._platform.BLINK) { + createEmptyStyleRule(query); + } + return this._matchMedia(query); + } +} +MediaMatcher.ɵfac = function MediaMatcher_Factory(t) { + return new (t || MediaMatcher)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_1__.Platform)); +}; +MediaMatcher.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ + token: MediaMatcher, + factory: MediaMatcher.ɵfac, + providedIn: 'root' +}); +(function () { + (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](MediaMatcher, [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, + args: [{ + providedIn: 'root' + }] + }], function () { + return [{ + type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_1__.Platform + }]; + }, null); +})(); +/** + * Creates an empty stylesheet that is used to work around browser inconsistencies related to + * `matchMedia`. At the time of writing, it handles the following cases: + * 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia` + * to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration. + * 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules + * inside the `@media` match existing elements on the page. We work around it by having one rule + * targeting the `body`. See https://github.com/angular/components/issues/23546. + */ +function createEmptyStyleRule(query) { + if (mediaQueriesForWebkitCompatibility.has(query)) { + return; + } + try { + if (!mediaQueryStyleNode) { + mediaQueryStyleNode = document.createElement('style'); + mediaQueryStyleNode.setAttribute('type', 'text/css'); + document.head.appendChild(mediaQueryStyleNode); + } + if (mediaQueryStyleNode.sheet) { + mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0); + mediaQueriesForWebkitCompatibility.add(query); + } + } catch (e) { + console.error(e); + } +} +/** No-op matchMedia replacement for non-browser platforms. */ +function noopMatchMedia(query) { + // Use `as any` here to avoid adding additional necessary properties for + // the noop matcher. + return { + matches: query === 'all' || query === '', + media: query, + addListener: () => {}, + removeListener: () => {} + }; +} + +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** Utility for checking the matching state of @media queries. */ +class BreakpointObserver { + constructor(_mediaMatcher, _zone) { + this._mediaMatcher = _mediaMatcher; + this._zone = _zone; + /** A map of all media queries currently being listened for. */ + this._queries = new Map(); + /** A subject for all other observables to takeUntil based on. */ + this._destroySubject = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); + } + /** Completes the active subject, signalling to all other observables to complete. */ + ngOnDestroy() { + this._destroySubject.next(); + this._destroySubject.complete(); + } + /** + * Whether one or more media queries match the current viewport size. + * @param value One or more media queries to check. + * @returns Whether any of the media queries match. + */ + isMatched(value) { + const queries = splitQueries((0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceArray)(value)); + return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches); + } + /** + * Gets an observable of results for the given queries that will emit new results for any changes + * in matching of the given queries. + * @param value One or more media queries to check. + * @returns A stream of matches for the given queries. + */ + observe(value) { + const queries = splitQueries((0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceArray)(value)); + const observables = queries.map(query => this._registerQuery(query).observable); + let stateObservable = (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.combineLatest)(observables); + // Emit the first state immediately, and then debounce the subsequent emissions. + stateObservable = (0,rxjs__WEBPACK_IMPORTED_MODULE_5__.concat)(stateObservable.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.take)(1)), stateObservable.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.skip)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_8__.debounceTime)(0))); + return stateObservable.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.map)(breakpointStates => { + const response = { + matches: false, + breakpoints: {} + }; + breakpointStates.forEach(({ + matches, + query + }) => { + response.matches = response.matches || matches; + response.breakpoints[query] = matches; + }); + return response; + })); + } + /** Registers a specific query to be listened for. */ + _registerQuery(query) { + // Only set up a new MediaQueryList if it is not already being listened for. + if (this._queries.has(query)) { + return this._queries.get(query); + } + const mql = this._mediaMatcher.matchMedia(query); + // Create callback for match changes and add it is as a listener. + const queryObservable = new rxjs__WEBPACK_IMPORTED_MODULE_10__.Observable(observer => { + // Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed + // back into the zone because matchMedia is only included in Zone.js by loading the + // webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not + // have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js + // patches it. + const handler = e => this._zone.run(() => observer.next(e)); + mql.addListener(handler); + return () => { + mql.removeListener(handler); + }; + }).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.startWith)(mql), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.map)(({ + matches + }) => ({ + query, + matches + })), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.takeUntil)(this._destroySubject)); + // Add the MediaQueryList to the set of queries. + const output = { + observable: queryObservable, + mql + }; + this._queries.set(query, output); + return output; + } +} +BreakpointObserver.ɵfac = function BreakpointObserver_Factory(t) { + return new (t || BreakpointObserver)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](MediaMatcher), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone)); +}; +BreakpointObserver.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ + token: BreakpointObserver, + factory: BreakpointObserver.ɵfac, + providedIn: 'root' +}); +(function () { + (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](BreakpointObserver, [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, + args: [{ + providedIn: 'root' + }] + }], function () { + return [{ + type: MediaMatcher + }, { + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone + }]; + }, null); +})(); +/** + * Split each query string into separate query strings if two queries are provided as comma + * separated. + */ +function splitQueries(queries) { + return queries.map(query => query.split(',')).reduce((a1, a2) => a1.concat(a2)).map(query => query.trim()); +} + +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +// PascalCase is being used as Breakpoints is used like an enum. +// tslint:disable-next-line:variable-name +const Breakpoints = { + XSmall: '(max-width: 599.98px)', + Small: '(min-width: 600px) and (max-width: 959.98px)', + Medium: '(min-width: 960px) and (max-width: 1279.98px)', + Large: '(min-width: 1280px) and (max-width: 1919.98px)', + XLarge: '(min-width: 1920px)', + Handset: '(max-width: 599.98px) and (orientation: portrait), ' + '(max-width: 959.98px) and (orientation: landscape)', + Tablet: '(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait), ' + '(min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)', + Web: '(min-width: 840px) and (orientation: portrait), ' + '(min-width: 1280px) and (orientation: landscape)', + HandsetPortrait: '(max-width: 599.98px) and (orientation: portrait)', + TabletPortrait: '(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait)', + WebPortrait: '(min-width: 840px) and (orientation: portrait)', + HandsetLandscape: '(max-width: 959.98px) and (orientation: landscape)', + TabletLandscape: '(min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)', + WebLandscape: '(min-width: 1280px) and (orientation: landscape)' +}; + +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * Generated bundle index. Do not edit. + */ + + /***/ }), @@ -14423,6 +13068,7 @@ __webpack_require__.r(__webpack_exports__); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -14430,29 +13076,23 @@ __webpack_require__.r(__webpack_exports__); * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Factory that creates a new MutationObserver and allows us to stub it out in unit tests. * @docs-private */ - class MutationObserverFactory { create(callback) { return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback); } - } - MutationObserverFactory.ɵfac = function MutationObserverFactory_Factory(t) { return new (t || MutationObserverFactory)(); }; - MutationObserverFactory.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: MutationObserverFactory, factory: MutationObserverFactory.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](MutationObserverFactory, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -14462,29 +13102,22 @@ MutationObserverFactory.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_ }], null, null); })(); /** An injectable service that allows watching elements for changes to their content. */ - - class ContentObserver { constructor(_mutationObserverFactory) { this._mutationObserverFactory = _mutationObserverFactory; /** Keeps track of the existing MutationObservers so they can be reused. */ - this._observedElements = new Map(); } - ngOnDestroy() { this._observedElements.forEach((_, element) => this._cleanupObserver(element)); } - observe(elementOrRef) { const element = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceElement)(elementOrRef); return new rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable(observer => { const stream = this._observeElement(element); - const subscription = stream.subscribe(observer); return () => { subscription.unsubscribe(); - this._unobserveElement(element); }; }); @@ -14493,14 +13126,10 @@ class ContentObserver { * Observes the given element by using the existing MutationObserver if available, or creating a * new one if not. */ - - _observeElement(element) { if (!this._observedElements.has(element)) { const stream = new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject(); - const observer = this._mutationObserverFactory.create(mutations => stream.next(mutations)); - if (observer) { observer.observe(element, { characterData: true, @@ -14508,7 +13137,6 @@ class ContentObserver { subtree: true }); } - this._observedElements.set(element, { observer, stream, @@ -14517,56 +13145,43 @@ class ContentObserver { } else { this._observedElements.get(element).count++; } - return this._observedElements.get(element).stream; } /** * Un-observes the given element and cleans up the underlying MutationObserver if nobody else is * observing this element. */ - - _unobserveElement(element) { if (this._observedElements.has(element)) { this._observedElements.get(element).count--; - if (!this._observedElements.get(element).count) { this._cleanupObserver(element); } } } /** Clean up the underlying MutationObserver for the specified element. */ - - _cleanupObserver(element) { if (this._observedElements.has(element)) { const { observer, stream } = this._observedElements.get(element); - if (observer) { observer.disconnect(); } - stream.complete(); - this._observedElements.delete(element); } } - } - ContentObserver.ɵfac = function ContentObserver_Factory(t) { return new (t || ContentObserver)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](MutationObserverFactory)); }; - ContentObserver.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: ContentObserver, factory: ContentObserver.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ContentObserver, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -14583,80 +13198,61 @@ ContentObserver.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0 * Directive that triggers a callback whenever the content of * its associated element has changed. */ - - class CdkObserveContent { - constructor(_contentObserver, _elementRef, _ngZone) { - this._contentObserver = _contentObserver; - this._elementRef = _elementRef; - this._ngZone = _ngZone; - /** Event emitted for each change in the element's content. */ - - this.event = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); - this._disabled = false; - this._currentSubscription = null; - } /** * Whether observing content is disabled. This option can be used * to disconnect the underlying MutationObserver until it is needed. */ - - get disabled() { return this._disabled; } - set disabled(value) { this._disabled = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceBooleanProperty)(value); this._disabled ? this._unsubscribe() : this._subscribe(); } /** Debounce interval for emitting the changes. */ - - get debounce() { return this._debounce; } - set debounce(value) { this._debounce = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__.coerceNumberProperty)(value); - this._subscribe(); } - + constructor(_contentObserver, _elementRef, _ngZone) { + this._contentObserver = _contentObserver; + this._elementRef = _elementRef; + this._ngZone = _ngZone; + /** Event emitted for each change in the element's content. */ + this.event = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); + this._disabled = false; + this._currentSubscription = null; + } ngAfterContentInit() { if (!this._currentSubscription && !this.disabled) { this._subscribe(); } } - ngOnDestroy() { this._unsubscribe(); } - _subscribe() { this._unsubscribe(); - - const stream = this._contentObserver.observe(this._elementRef); // TODO(mmalerba): We shouldn't be emitting on this @Output() outside the zone. + const stream = this._contentObserver.observe(this._elementRef); + // TODO(mmalerba): We shouldn't be emitting on this @Output() outside the zone. // Consider brining it back inside the zone next time we're making breaking changes. // Bringing it back inside can cause things like infinite change detection loops and changed // after checked errors if people's code isn't handling it properly. - - this._ngZone.runOutsideAngular(() => { this._currentSubscription = (this.debounce ? stream.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.debounceTime)(this.debounce)) : stream).subscribe(this.event); }); } - _unsubscribe() { this._currentSubscription?.unsubscribe(); } - } - CdkObserveContent.ɵfac = function CdkObserveContent_Factory(t) { return new (t || CdkObserveContent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ContentObserver), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone)); }; - CdkObserveContent.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: CdkObserveContent, selectors: [["", "cdkObserveContent", ""]], @@ -14669,7 +13265,6 @@ CdkObserveContent.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_ }, exportAs: ["cdkObserveContent"] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CdkObserveContent, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, @@ -14699,20 +13294,16 @@ CdkObserveContent.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_ }] }); })(); - class ObserversModule {} - ObserversModule.ɵfac = function ObserversModule_Factory(t) { return new (t || ObserversModule)(); }; - ObserversModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: ObserversModule }); ObserversModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ providers: [MutationObserverFactory] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ObserversModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule, @@ -14723,6 +13314,7 @@ ObserversModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ }] }], null, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -14745,7 +13337,6 @@ ObserversModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ - /***/ }), /***/ 9107: @@ -14774,6 +13365,7 @@ __webpack_require__.r(__webpack_exports__); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -14783,13 +13375,12 @@ __webpack_require__.r(__webpack_exports__); */ // Whether the current platform supports the V8 Break Iterator. The V8 check // is necessary to detect all Blink based browsers. - -let hasV8BreakIterator; // We need a try/catch around the reference to `Intl`, because accessing it in some cases can +let hasV8BreakIterator; +// We need a try/catch around the reference to `Intl`, because accessing it in some cases can // cause IE to throw. These cases are tied to particular versions of Windows and can happen if // the consumer is providing a polyfilled `Map`. See: // https://github.com/Microsoft/ChakraCore/issues/3189 // https://github.com/angular/components/issues/15687 - try { hasV8BreakIterator = typeof Intl !== 'undefined' && Intl.v8BreakIterator; } catch { @@ -14799,66 +13390,51 @@ try { * Service to detect the current platform by comparing the userAgent strings and * checking browser-specific global properties. */ - - class Platform { constructor(_platformId) { - this._platformId = _platformId; // We want to use the Angular platform check because if the Document is shimmed + this._platformId = _platformId; + // We want to use the Angular platform check because if the Document is shimmed // without the navigator, the following checks will fail. This is preferred because // sometimes the Document may be shimmed without the user's knowledge or intention - /** Whether the Angular application is being rendered in the browser. */ - this.isBrowser = this._platformId ? (0,_angular_common__WEBPACK_IMPORTED_MODULE_0__.isPlatformBrowser)(this._platformId) : typeof document === 'object' && !!document; /** Whether the current browser is Microsoft Edge. */ - this.EDGE = this.isBrowser && /(edge)/i.test(navigator.userAgent); /** Whether the current rendering engine is Microsoft Trident. */ - - this.TRIDENT = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent); // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check. - + this.TRIDENT = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent); + // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check. /** Whether the current rendering engine is Blink. */ - - this.BLINK = this.isBrowser && !!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT; // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to + this.BLINK = this.isBrowser && !!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT; + // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to // ensure that Webkit runs standalone and is not used as another engine's base. - /** Whether the current rendering engine is WebKit. */ - this.WEBKIT = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT; /** Whether the current platform is Apple iOS. */ - - this.IOS = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window); // It's difficult to detect the plain Gecko engine, because most of the browsers identify + this.IOS = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window); + // It's difficult to detect the plain Gecko engine, because most of the browsers identify // them self as Gecko-like browsers and modify the userAgent's according to that. // Since we only cover one explicit Firefox case, we can simply check for Firefox // instead of having an unstable check for Gecko. - /** Whether the current browser is Firefox. */ - this.FIREFOX = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent); /** Whether the current platform is Android. */ // Trident on mobile adds the android platform to the userAgent to trick detections. - - this.ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT; // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake + this.ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT; + // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake // this and just place the Safari keyword in the userAgent. To be more safe about Safari every // Safari browser should also use Webkit as its layout engine. - /** Whether the current browser is Safari. */ - this.SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT; } - } - Platform.ɵfac = function Platform_Factory(t) { return new (t || Platform)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.PLATFORM_ID)); }; - Platform.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: Platform, factory: Platform.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](Platform, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, @@ -14875,6 +13451,7 @@ Platform.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵ }]; }, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -14882,25 +13459,21 @@ Platform.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - class PlatformModule {} - PlatformModule.ɵfac = function PlatformModule_Factory(t) { return new (t || PlatformModule)(); }; - PlatformModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: PlatformModule }); PlatformModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({}); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](PlatformModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule, args: [{}] }], null, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -14908,34 +13481,28 @@ PlatformModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Cached result Set of input types support by the current browser. */ - - let supportedInputTypes; /** Types of `` that *might* be supported. */ - -const candidateInputTypes = [// `color` must come first. Chrome 56 shows a warning if we change the type to `color` after +const candidateInputTypes = [ +// `color` must come first. Chrome 56 shows a warning if we change the type to `color` after // first changing it to something else: // The specified value "" does not conform to the required format. // The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers. 'color', 'button', 'checkbox', 'date', 'datetime-local', 'email', 'file', 'hidden', 'image', 'month', 'number', 'password', 'radio', 'range', 'reset', 'search', 'submit', 'tel', 'text', 'time', 'url', 'week']; /** @returns The input types supported by this browser. */ - function getSupportedInputTypes() { // Result is cached. if (supportedInputTypes) { return supportedInputTypes; - } // We can't check if an input type is not supported until we're on the browser, so say that + } + // We can't check if an input type is not supported until we're on the browser, so say that // everything is supported when not on the browser. We don't use `Platform` here since it's // just a helper function and can't inject it. - - if (typeof document !== 'object' || !document) { supportedInputTypes = new Set(candidateInputTypes); return supportedInputTypes; } - let featureTestInput = document.createElement('input'); supportedInputTypes = new Set(candidateInputTypes.filter(value => { featureTestInput.setAttribute('type', value); @@ -14943,6 +13510,7 @@ function getSupportedInputTypes() { })); return supportedInputTypes; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -14950,16 +13518,12 @@ function getSupportedInputTypes() { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Cached result of whether the user's browser supports passive event listeners. */ - - let supportsPassiveEvents; /** * Checks whether the user's browser supports passive event listeners. * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md */ - function supportsPassiveEventListeners() { if (supportsPassiveEvents == null && typeof window !== 'undefined') { try { @@ -14970,7 +13534,6 @@ function supportsPassiveEventListeners() { supportsPassiveEvents = supportsPassiveEvents || false; } } - return supportsPassiveEvents; } /** @@ -14979,11 +13542,10 @@ function supportsPassiveEventListeners() { * `options` parameter. * @param options Object to be normalized. */ - - function normalizePassiveListenerOptions(options) { return supportsPassiveEventListeners() ? options : !!options.capture; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -14991,16 +13553,11 @@ function normalizePassiveListenerOptions(options) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */ - - let rtlScrollAxisType; /** Cached result of the check that indicates whether the browser supports scroll behaviors. */ - let scrollBehaviorSupported; /** Check whether the browser supports scroll behaviors. */ - function supportsScrollBehavior() { if (scrollBehaviorSupported == null) { // If we're not in the browser, it can't be supported. Also check for `Element`, because @@ -15008,16 +13565,14 @@ function supportsScrollBehavior() { if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) { scrollBehaviorSupported = false; return scrollBehaviorSupported; - } // If the element can have a `scrollBehavior` style, we can be sure that it's supported. - - + } + // If the element can have a `scrollBehavior` style, we can be sure that it's supported. if ('scrollBehavior' in document.documentElement.style) { scrollBehaviorSupported = true; } else { // At this point we have 3 possibilities: `scrollTo` isn't supported at all, it's // supported but it doesn't handle scroll behavior, or it has been polyfilled. const scrollToFunction = Element.prototype.scrollTo; - if (scrollToFunction) { // We can detect if the function has been polyfilled by calling `toString` on it. Native // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get @@ -15029,21 +13584,16 @@ function supportsScrollBehavior() { } } } - return scrollBehaviorSupported; } /** * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL, * Firefox & Safari are NEGATED, and IE & Edge are INVERTED. */ - - function getRtlScrollAxisType() { // We can't check unless we're on the browser. Just assume 'normal' if we're not. if (typeof document !== 'object' || !document) { - return 0 - /* RtlScrollAxisType.NORMAL */ - ; + return 0 /* RtlScrollAxisType.NORMAL */; } if (rtlScrollAxisType == null) { @@ -15062,30 +13612,24 @@ function getRtlScrollAxisType() { contentStyle.height = '1px'; scrollContainer.appendChild(content); document.body.appendChild(scrollContainer); - rtlScrollAxisType = 0 - /* RtlScrollAxisType.NORMAL */ - ; // The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL + rtlScrollAxisType = 0 /* RtlScrollAxisType.NORMAL */; + // The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL // browser this would mean that the scrollLeft should be 1. If it's zero instead we know we're // dealing with one of the other two types of browsers. - if (scrollContainer.scrollLeft === 0) { // In a NEGATED browser the scrollLeft is always somewhere in [-maxScrollAmount, 0]. For an // INVERTED browser it is always somewhere in [0, maxScrollAmount]. We can determine which by // setting to the scrollLeft to 1. This is past the max for a NEGATED browser, so it will // return 0 when we read it again. scrollContainer.scrollLeft = 1; - rtlScrollAxisType = scrollContainer.scrollLeft === 0 ? 1 - /* RtlScrollAxisType.NEGATED */ - : 2 - /* RtlScrollAxisType.INVERTED */ - ; + rtlScrollAxisType = scrollContainer.scrollLeft === 0 ? 1 /* RtlScrollAxisType.NEGATED */ : 2 /* RtlScrollAxisType.INVERTED */; } scrollContainer.remove(); } - return rtlScrollAxisType; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -15093,63 +13637,50 @@ function getRtlScrollAxisType() { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - - let shadowDomIsSupported; /** Checks whether the user's browser support Shadow DOM. */ - function _supportsShadowDom() { if (shadowDomIsSupported == null) { const head = typeof document !== 'undefined' ? document.head : null; shadowDomIsSupported = !!(head && (head.createShadowRoot || head.attachShadow)); } - return shadowDomIsSupported; } /** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */ - - function _getShadowRoot(element) { if (_supportsShadowDom()) { - const rootNode = element.getRootNode ? element.getRootNode() : null; // Note that this should be caught by `_supportsShadowDom`, but some + const rootNode = element.getRootNode ? element.getRootNode() : null; + // Note that this should be caught by `_supportsShadowDom`, but some // teams have been able to hit this code path on unsupported browsers. - if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) { return rootNode; } } - return null; } /** * Gets the currently-focused element on the page while * also piercing through Shadow DOM boundaries. */ - - function _getFocusedElementPierceShadowDom() { let activeElement = typeof document !== 'undefined' && document ? document.activeElement : null; - while (activeElement && activeElement.shadowRoot) { const newActiveElement = activeElement.shadowRoot.activeElement; - if (newActiveElement === activeElement) { break; } else { activeElement = newActiveElement; } } - return activeElement; } /** Gets the target of an event while accounting for Shadow DOM. */ - - function _getEventTarget(event) { // If an event is bound outside the Shadow DOM, the `event.target` will // point to the shadow root so we have to use `composedPath` instead. return event.composedPath ? event.composedPath()[0] : event.target; } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -15157,22 +13688,24 @@ function _getEventTarget(event) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Gets whether the code is currently running in a test environment. */ - - function _isTestEnvironment() { // We can't use `declare const` because it causes conflicts inside Google with the real typings // for these symbols and we can't read them off the global object, because they don't appear to // be attached there for some runners like Jest. // (see: https://github.com/angular/components/issues/23365#issuecomment-938146643) - return (// @ts-ignore - typeof __karma__ !== 'undefined' && !!__karma__ || // @ts-ignore - typeof jasmine !== 'undefined' && !!jasmine || // @ts-ignore - typeof jest !== 'undefined' && !!jest || // @ts-ignore + return ( + // @ts-ignore + typeof __karma__ !== 'undefined' && !!__karma__ || + // @ts-ignore + typeof jasmine !== 'undefined' && !!jasmine || + // @ts-ignore + typeof jest !== 'undefined' && !!jest || + // @ts-ignore typeof Mocha !== 'undefined' && !!Mocha ); } + /** * @license * Copyright Google LLC All Rights Reserved. @@ -15195,7 +13728,6 @@ function _isTestEnvironment() { - /***/ }), /***/ 6328: @@ -15211,11 +13743,15 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "CdkScrollableModule": () => (/* binding */ CdkScrollableModule), /* harmony export */ "CdkVirtualForOf": () => (/* binding */ CdkVirtualForOf), /* harmony export */ "CdkVirtualScrollViewport": () => (/* binding */ CdkVirtualScrollViewport), +/* harmony export */ "CdkVirtualScrollable": () => (/* binding */ CdkVirtualScrollable), +/* harmony export */ "CdkVirtualScrollableElement": () => (/* binding */ CdkVirtualScrollableElement), +/* harmony export */ "CdkVirtualScrollableWindow": () => (/* binding */ CdkVirtualScrollableWindow), /* harmony export */ "DEFAULT_RESIZE_TIME": () => (/* binding */ DEFAULT_RESIZE_TIME), /* harmony export */ "DEFAULT_SCROLL_TIME": () => (/* binding */ DEFAULT_SCROLL_TIME), /* harmony export */ "FixedSizeVirtualScrollStrategy": () => (/* binding */ FixedSizeVirtualScrollStrategy), /* harmony export */ "ScrollDispatcher": () => (/* binding */ ScrollDispatcher), /* harmony export */ "ScrollingModule": () => (/* binding */ ScrollingModule), +/* harmony export */ "VIRTUAL_SCROLLABLE": () => (/* binding */ VIRTUAL_SCROLLABLE), /* harmony export */ "VIRTUAL_SCROLL_STRATEGY": () => (/* binding */ VIRTUAL_SCROLL_STRATEGY), /* harmony export */ "ViewportRuler": () => (/* binding */ ViewportRuler), /* harmony export */ "_fixedSizeVirtualScrollStrategyFactory": () => (/* binding */ _fixedSizeVirtualScrollStrategyFactory) @@ -15229,19 +13765,20 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs */ 8184); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs */ 9672); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! rxjs */ 6078); -/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! rxjs */ 4437); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs */ 4437); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 8977); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ 998); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ 116); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs/operators */ 8951); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs/operators */ 4874); -/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs/operators */ 679); -/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs/operators */ 2673); -/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! rxjs/operators */ 9196); +/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! rxjs/operators */ 679); +/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! rxjs/operators */ 2673); +/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! rxjs/operators */ 9196); /* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/cdk/platform */ 9107); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/common */ 4666); /* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/cdk/bidi */ 2867); -/* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @angular/cdk/collections */ 1755); +/* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @angular/cdk/collections */ 1755); + @@ -15261,12 +13798,11 @@ __webpack_require__.r(__webpack_exports__); * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** The injection token used to specify the virtual scrolling strategy. */ - const _c0 = ["contentWrapper"]; const _c1 = ["*"]; const VIRTUAL_SCROLL_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('VIRTUAL_SCROLL_STRATEGY'); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -15274,9 +13810,7 @@ const VIRTUAL_SCROLL_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.I * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Virtual scrolling strategy for lists with items of known fixed size. */ - class FixedSizeVirtualScrollStrategy { /** * @param itemSize The size of the items in the virtually scrolling list. @@ -15286,10 +13820,8 @@ class FixedSizeVirtualScrollStrategy { constructor(itemSize, minBufferPx, maxBufferPx) { this._scrolledIndexChange = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); /** @docs-private Implemented as part of VirtualScrollStrategy. */ - this.scrolledIndexChange = this._scrolledIndexChange.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.distinctUntilChanged)()); /** The attached viewport. */ - this._viewport = null; this._itemSize = itemSize; this._minBufferPx = minBufferPx; @@ -15299,21 +13831,14 @@ class FixedSizeVirtualScrollStrategy { * Attaches this scroll strategy to a viewport. * @param viewport The viewport to attach this strategy to. */ - - attach(viewport) { this._viewport = viewport; - this._updateTotalContentSize(); - this._updateRenderedRange(); } /** Detaches this scroll strategy from the currently attached viewport. */ - - detach() { this._scrolledIndexChange.complete(); - this._viewport = null; } /** @@ -15322,44 +13847,30 @@ class FixedSizeVirtualScrollStrategy { * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more. */ - - updateItemAndBufferSize(itemSize, minBufferPx, maxBufferPx) { if (maxBufferPx < minBufferPx && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw Error('CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx'); } - this._itemSize = itemSize; this._minBufferPx = minBufferPx; this._maxBufferPx = maxBufferPx; - this._updateTotalContentSize(); - this._updateRenderedRange(); } /** @docs-private Implemented as part of VirtualScrollStrategy. */ - - onContentScrolled() { this._updateRenderedRange(); } /** @docs-private Implemented as part of VirtualScrollStrategy. */ - - onDataLengthChanged() { this._updateTotalContentSize(); - this._updateRenderedRange(); } /** @docs-private Implemented as part of VirtualScrollStrategy. */ - - onContentRendered() { /* no-op */ } /** @docs-private Implemented as part of VirtualScrollStrategy. */ - - onRenderedOffsetChanged() { /* no-op */ } @@ -15368,88 +13879,66 @@ class FixedSizeVirtualScrollStrategy { * @param index The index of the element to scroll to. * @param behavior The ScrollBehavior to use when scrolling. */ - - scrollToIndex(index, behavior) { if (this._viewport) { this._viewport.scrollToOffset(index * this._itemSize, behavior); } } /** Update the viewport's total content size. */ - - _updateTotalContentSize() { if (!this._viewport) { return; } - this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize); } /** Update the viewport's rendered range. */ - - _updateRenderedRange() { if (!this._viewport) { return; } - const renderedRange = this._viewport.getRenderedRange(); - const newRange = { start: renderedRange.start, end: renderedRange.end }; - const viewportSize = this._viewport.getViewportSize(); - const dataLength = this._viewport.getDataLength(); - - let scrollOffset = this._viewport.measureScrollOffset(); // Prevent NaN as result when dividing by zero. - - - let firstVisibleIndex = this._itemSize > 0 ? scrollOffset / this._itemSize : 0; // If user scrolls to the bottom of the list and data changes to a smaller list - + let scrollOffset = this._viewport.measureScrollOffset(); + // Prevent NaN as result when dividing by zero. + let firstVisibleIndex = this._itemSize > 0 ? scrollOffset / this._itemSize : 0; + // If user scrolls to the bottom of the list and data changes to a smaller list if (newRange.end > dataLength) { // We have to recalculate the first visible index based on new data length and viewport size. const maxVisibleItems = Math.ceil(viewportSize / this._itemSize); - const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems)); // If first visible index changed we must update scroll offset to handle start/end buffers + const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems)); + // If first visible index changed we must update scroll offset to handle start/end buffers // Current range must also be adjusted to cover the new position (bottom of new list). - if (firstVisibleIndex != newVisibleIndex) { firstVisibleIndex = newVisibleIndex; scrollOffset = newVisibleIndex * this._itemSize; newRange.start = Math.floor(firstVisibleIndex); } - newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems)); } - const startBuffer = scrollOffset - newRange.start * this._itemSize; - if (startBuffer < this._minBufferPx && newRange.start != 0) { const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize); newRange.start = Math.max(0, newRange.start - expandStart); newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize)); } else { const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize); - if (endBuffer < this._minBufferPx && newRange.end != dataLength) { const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize); - if (expandEnd > 0) { newRange.end = Math.min(dataLength, newRange.end + expandEnd); newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize)); } } } - this._viewport.setRenderedRange(newRange); - this._viewport.setRenderedContentOffset(this._itemSize * newRange.start); - this._scrolledIndexChange.next(Math.floor(firstVisibleIndex)); } - } /** * Provider factory for `FixedSizeVirtualScrollStrategy` that simply extracts the already created @@ -15457,30 +13946,22 @@ class FixedSizeVirtualScrollStrategy { * @param fixedSizeDir The instance of `CdkFixedSizeVirtualScroll` to extract the * `FixedSizeVirtualScrollStrategy` from. */ - - function _fixedSizeVirtualScrollStrategyFactory(fixedSizeDir) { return fixedSizeDir._scrollStrategy; } /** A virtual scroll strategy that supports fixed-size items. */ - - class CdkFixedSizeVirtualScroll { constructor() { this._itemSize = 20; this._minBufferPx = 100; this._maxBufferPx = 200; /** The scroll strategy used by this directive. */ - this._scrollStrategy = new FixedSizeVirtualScrollStrategy(this.itemSize, this.minBufferPx, this.maxBufferPx); } /** The size of the items in the list (in pixels). */ - - get itemSize() { return this._itemSize; } - set itemSize(value) { this._itemSize = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceNumberProperty)(value); } @@ -15488,38 +13969,28 @@ class CdkFixedSizeVirtualScroll { * The minimum amount of buffer rendered beyond the viewport (in pixels). * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px. */ - - get minBufferPx() { return this._minBufferPx; } - set minBufferPx(value) { this._minBufferPx = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceNumberProperty)(value); } /** * The number of pixels worth of buffer to render for when rendering new items. Defaults to 200px. */ - - get maxBufferPx() { return this._maxBufferPx; } - set maxBufferPx(value) { this._maxBufferPx = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceNumberProperty)(value); } - ngOnChanges() { this._scrollStrategy.updateItemAndBufferSize(this.itemSize, this.minBufferPx, this.maxBufferPx); } - } - CdkFixedSizeVirtualScroll.ɵfac = function CdkFixedSizeVirtualScroll_Factory(t) { return new (t || CdkFixedSizeVirtualScroll)(); }; - CdkFixedSizeVirtualScroll.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: CdkFixedSizeVirtualScroll, selectors: [["cdk-virtual-scroll-viewport", "itemSize", ""]], @@ -15528,18 +13999,19 @@ CdkFixedSizeVirtualScroll.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED minBufferPx: "minBufferPx", maxBufferPx: "maxBufferPx" }, + standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{ provide: VIRTUAL_SCROLL_STRATEGY, useFactory: _fixedSizeVirtualScrollStrategyFactory, deps: [(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(() => CdkFixedSizeVirtualScroll)] }]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CdkFixedSizeVirtualScroll, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ selector: 'cdk-virtual-scroll-viewport[itemSize]', + standalone: true, providers: [{ provide: VIRTUAL_SCROLL_STRATEGY, useFactory: _fixedSizeVirtualScrollStrategyFactory, @@ -15558,6 +14030,7 @@ CdkFixedSizeVirtualScroll.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED }] }); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -15565,34 +14038,26 @@ CdkFixedSizeVirtualScroll.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Time in ms to throttle the scrolling events by default. */ - - const DEFAULT_SCROLL_TIME = 20; /** * Service contained all registered Scrollable references and emits an event when any one of the * Scrollable references emit a scrolled event. */ - class ScrollDispatcher { constructor(_ngZone, _platform, document) { this._ngZone = _ngZone; this._platform = _platform; /** Subject for notifying that a registered scrollable reference element has been scrolled. */ - this._scrolled = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); /** Keeps track of the global `scroll` and `resize` subscriptions. */ - this._globalSubscription = null; /** Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards. */ - this._scrolledCount = 0; /** * Map of all the scrollable references that are registered with the service and their * scroll event subscriptions. */ - this.scrollContainers = new Map(); this._document = document; } @@ -15601,22 +14066,17 @@ class ScrollDispatcher { * scrollable is scrolled, the service emits the event to its scrolled observable. * @param scrollable Scrollable instance to be registered. */ - - register(scrollable) { if (!this.scrollContainers.has(scrollable)) { this.scrollContainers.set(scrollable, scrollable.elementScrolled().subscribe(() => this._scrolled.next(scrollable))); } } /** - * Deregisters a Scrollable reference and unsubscribes from its scroll event observable. + * De-registers a Scrollable reference and unsubscribes from its scroll event observable. * @param scrollable Scrollable instance to be deregistered. */ - - deregister(scrollable) { const scrollableReference = this.scrollContainers.get(scrollable); - if (scrollableReference) { scrollableReference.unsubscribe(); this.scrollContainers.delete(scrollable); @@ -15632,38 +14092,30 @@ class ScrollDispatcher { * If you need to update any data bindings as a result of a scroll event, you have * to run the callback using `NgZone.run`. */ - - scrolled(auditTimeInMs = DEFAULT_SCROLL_TIME) { if (!this._platform.isBrowser) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.of)(); } - return new rxjs__WEBPACK_IMPORTED_MODULE_5__.Observable(observer => { if (!this._globalSubscription) { this._addGlobalListener(); - } // In the case of a 0ms delay, use an observable without auditTime + } + // In the case of a 0ms delay, use an observable without auditTime // since it does add a perceptible delay in processing overhead. - - const subscription = auditTimeInMs > 0 ? this._scrolled.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.auditTime)(auditTimeInMs)).subscribe(observer) : this._scrolled.subscribe(observer); this._scrolledCount++; return () => { subscription.unsubscribe(); this._scrolledCount--; - if (!this._scrolledCount) { this._removeGlobalListener(); } }; }); } - ngOnDestroy() { this._removeGlobalListener(); - this.scrollContainers.forEach((_, container) => this.deregister(container)); - this._scrolled.complete(); } /** @@ -15672,8 +14124,6 @@ class ScrollDispatcher { * @param elementOrElementRef Element whose ancestors to listen for. * @param auditTimeInMs Time to throttle the scroll events. */ - - ancestorScrolled(elementOrElementRef, auditTimeInMs) { const ancestors = this.getAncestorScrollContainers(elementOrElementRef); return this.scrolled(auditTimeInMs).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.filter)(target => { @@ -15681,8 +14131,6 @@ class ScrollDispatcher { })); } /** Returns all registered Scrollables that contain the provided element. */ - - getAncestorScrollContainers(elementOrElementRef) { const scrollingContainers = []; this.scrollContainers.forEach((_subscription, scrollable) => { @@ -15693,60 +14141,45 @@ class ScrollDispatcher { return scrollingContainers; } /** Use defaultView of injected document if available or fallback to global window reference */ - - _getWindow() { return this._document.defaultView || window; } /** Returns true if the element is contained within the provided Scrollable. */ - - _scrollableContainsElement(scrollable, elementOrElementRef) { let element = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceElement)(elementOrElementRef); - let scrollableElement = scrollable.getElementRef().nativeElement; // Traverse through the element parents until we reach null, checking if any of the elements + let scrollableElement = scrollable.getElementRef().nativeElement; + // Traverse through the element parents until we reach null, checking if any of the elements // are the scrollable's element. - do { if (element == scrollableElement) { return true; } } while (element = element.parentElement); - return false; } /** Sets up the global scroll listeners. */ - - _addGlobalListener() { this._globalSubscription = this._ngZone.runOutsideAngular(() => { const window = this._getWindow(); - return (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.fromEvent)(window.document, 'scroll').subscribe(() => this._scrolled.next()); }); } /** Cleans up the global scroll listener. */ - - _removeGlobalListener() { if (this._globalSubscription) { this._globalSubscription.unsubscribe(); - this._globalSubscription = null; } } - } - ScrollDispatcher.ɵfac = function ScrollDispatcher_Factory(t) { return new (t || ScrollDispatcher)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.Platform), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_10__.DOCUMENT, 8)); }; - ScrollDispatcher.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: ScrollDispatcher, factory: ScrollDispatcher.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ScrollDispatcher, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -15769,6 +14202,7 @@ ScrollDispatcher.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_ }]; }, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -15776,14 +14210,11 @@ ScrollDispatcher.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** * Sends an event when the directive's element is scrolled. Registers itself with the * ScrollDispatcher service to include itself as part of its collection of scrolling events that it * can be listened to through the service. */ - - class CdkScrollable { constructor(elementRef, scrollDispatcher, ngZone, dir) { this.elementRef = elementRef; @@ -15793,27 +14224,19 @@ class CdkScrollable { this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); this._elementScrolled = new rxjs__WEBPACK_IMPORTED_MODULE_5__.Observable(observer => this.ngZone.runOutsideAngular(() => (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.fromEvent)(this.elementRef.nativeElement, 'scroll').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.takeUntil)(this._destroyed)).subscribe(observer))); } - ngOnInit() { this.scrollDispatcher.register(this); } - ngOnDestroy() { this.scrollDispatcher.deregister(this); - this._destroyed.next(); - this._destroyed.complete(); } /** Returns observable that emits when a scroll event is fired on the host element. */ - - elementScrolled() { return this._elementScrolled; } /** Gets the ElementRef for the viewport. */ - - getElementRef() { return this.elementRef; } @@ -15825,40 +14248,28 @@ class CdkScrollable { * in an RTL context. * @param options specified the offsets to scroll to. */ - - scrollTo(options) { const el = this.elementRef.nativeElement; - const isRtl = this.dir && this.dir.value == 'rtl'; // Rewrite start & end offsets as right or left offsets. - + const isRtl = this.dir && this.dir.value == 'rtl'; + // Rewrite start & end offsets as right or left offsets. if (options.left == null) { options.left = isRtl ? options.end : options.start; } - if (options.right == null) { options.right = isRtl ? options.start : options.end; - } // Rewrite the bottom offset as a top offset. - - + } + // Rewrite the bottom offset as a top offset. if (options.bottom != null) { options.top = el.scrollHeight - el.clientHeight - options.bottom; - } // Rewrite the right offset as a left offset. - - - if (isRtl && (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.getRtlScrollAxisType)() != 0 - /* RtlScrollAxisType.NORMAL */ - ) { + } + // Rewrite the right offset as a left offset. + if (isRtl && (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.getRtlScrollAxisType)() != 0 /* RtlScrollAxisType.NORMAL */) { if (options.left != null) { options.right = el.scrollWidth - el.clientWidth - options.left; } - - if ((0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.getRtlScrollAxisType)() == 2 - /* RtlScrollAxisType.INVERTED */ - ) { + if ((0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.getRtlScrollAxisType)() == 2 /* RtlScrollAxisType.INVERTED */) { options.left = options.right; - } else if ((0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.getRtlScrollAxisType)() == 1 - /* RtlScrollAxisType.NEGATED */ - ) { + } else if ((0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.getRtlScrollAxisType)() == 1 /* RtlScrollAxisType.NEGATED */) { options.left = options.right ? -options.right : options.right; } } else { @@ -15866,20 +14277,16 @@ class CdkScrollable { options.left = el.scrollWidth - el.clientWidth - options.right; } } - this._applyScrollToOptions(options); } - _applyScrollToOptions(options) { const el = this.elementRef.nativeElement; - if ((0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.supportsScrollBehavior)()) { el.scrollTo(options); } else { if (options.top != null) { el.scrollTop = options.top; } - if (options.left != null) { el.scrollLeft = options.left; } @@ -15894,33 +14301,24 @@ class CdkScrollable { * in an RTL context. * @param from The edge to measure from. */ - - measureScrollOffset(from) { const LEFT = 'left'; const RIGHT = 'right'; const el = this.elementRef.nativeElement; - if (from == 'top') { return el.scrollTop; } - if (from == 'bottom') { return el.scrollHeight - el.clientHeight - el.scrollTop; - } // Rewrite start & end as left or right offsets. - - + } + // Rewrite start & end as left or right offsets. const isRtl = this.dir && this.dir.value == 'rtl'; - if (from == 'start') { from = isRtl ? RIGHT : LEFT; } else if (from == 'end') { from = isRtl ? LEFT : RIGHT; } - - if (isRtl && (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.getRtlScrollAxisType)() == 2 - /* RtlScrollAxisType.INVERTED */ - ) { + if (isRtl && (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.getRtlScrollAxisType)() == 2 /* RtlScrollAxisType.INVERTED */) { // For INVERTED, scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and // 0 when scrolled all the way right. if (from == LEFT) { @@ -15928,9 +14326,7 @@ class CdkScrollable { } else { return el.scrollLeft; } - } else if (isRtl && (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.getRtlScrollAxisType)() == 1 - /* RtlScrollAxisType.NEGATED */ - ) { + } else if (isRtl && (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.getRtlScrollAxisType)() == 1 /* RtlScrollAxisType.NEGATED */) { // For NEGATED, scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and // 0 when scrolled all the way right. if (from == LEFT) { @@ -15948,23 +14344,21 @@ class CdkScrollable { } } } - } - CdkScrollable.ɵfac = function CdkScrollable_Factory(t) { return new (t || CdkScrollable)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ScrollDispatcher), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.Directionality, 8)); }; - CdkScrollable.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: CdkScrollable, - selectors: [["", "cdk-scrollable", ""], ["", "cdkScrollable", ""]] + selectors: [["", "cdk-scrollable", ""], ["", "cdkScrollable", ""]], + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CdkScrollable, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ - selector: '[cdk-scrollable], [cdkScrollable]' + selector: '[cdk-scrollable], [cdkScrollable]', + standalone: true }] }], function () { return [{ @@ -15981,6 +14375,7 @@ CdkScrollable.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[ }]; }, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -15988,77 +14383,59 @@ CdkScrollable.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Time in ms to throttle the resize events by default. */ - - const DEFAULT_RESIZE_TIME = 20; /** * Simple utility for getting the bounds of the browser viewport. * @docs-private */ - class ViewportRuler { constructor(_platform, ngZone, document) { this._platform = _platform; /** Stream of viewport change events. */ - this._change = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); /** Event listener that will be used to handle the viewport change events. */ - this._changeListener = event => { this._change.next(event); }; - this._document = document; ngZone.runOutsideAngular(() => { if (_platform.isBrowser) { - const window = this._getWindow(); // Note that bind the events ourselves, rather than going through something like RxJS's + const window = this._getWindow(); + // Note that bind the events ourselves, rather than going through something like RxJS's // `fromEvent` so that we can ensure that they're bound outside of the NgZone. - - window.addEventListener('resize', this._changeListener); window.addEventListener('orientationchange', this._changeListener); - } // Clear the cached position so that the viewport is re-measured next time it is required. + } + // Clear the cached position so that the viewport is re-measured next time it is required. // We don't need to keep track of the subscription, because it is completed on destroy. - - this.change().subscribe(() => this._viewportSize = null); }); } - ngOnDestroy() { if (this._platform.isBrowser) { const window = this._getWindow(); - window.removeEventListener('resize', this._changeListener); window.removeEventListener('orientationchange', this._changeListener); } - this._change.complete(); } /** Returns the viewport's width and height. */ - - getViewportSize() { if (!this._viewportSize) { this._updateViewportSize(); } - const output = { width: this._viewportSize.width, height: this._viewportSize.height - }; // If we're not on a browser, don't cache the size since it'll be mocked out anyway. - + }; + // If we're not on a browser, don't cache the size since it'll be mocked out anyway. if (!this._platform.isBrowser) { this._viewportSize = null; } - return output; } /** Gets a ClientRect for the viewport's bounds. */ - - getViewportRect() { // Use the document element's bounding rect rather than the window scroll properties // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll @@ -16084,8 +14461,6 @@ class ViewportRuler { }; } /** Gets the (top, left) scroll position of the viewport. */ - - getViewportScrollPosition() { // While we can get a reference to the fake document // during SSR, it doesn't have getBoundingClientRect. @@ -16094,18 +14469,15 @@ class ViewportRuler { top: 0, left: 0 }; - } // The top-left-corner of the viewport is determined by the scroll position of the document + } + // The top-left-corner of the viewport is determined by the scroll position of the document // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about // whether `document.body` or `document.documentElement` is the scrolled element, so reading // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of // `document.documentElement` works consistently, where the `top` and `left` values will // equal negative the scroll position. - - const document = this._document; - const window = this._getWindow(); - const documentElement = document.documentElement; const documentRect = documentElement.getBoundingClientRect(); const top = -documentRect.top || document.body.scrollTop || window.scrollY || documentElement.scrollTop || 0; @@ -16120,23 +14492,16 @@ class ViewportRuler { * This stream emits outside of the Angular zone. * @param throttleTime Time in milliseconds to throttle the stream. */ - - change(throttleTime = DEFAULT_RESIZE_TIME) { return throttleTime > 0 ? this._change.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.auditTime)(throttleTime)) : this._change; } /** Use defaultView of injected document if available or fallback to global window reference */ - - _getWindow() { return this._document.defaultView || window; } /** Updates the cached viewport size. */ - - _updateViewportSize() { const window = this._getWindow(); - this._viewportSize = this._platform.isBrowser ? { width: window.innerWidth, height: window.innerHeight @@ -16145,19 +14510,15 @@ class ViewportRuler { height: 0 }; } - } - ViewportRuler.ɵfac = function ViewportRuler_Factory(t) { return new (t || ViewportRuler)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.Platform), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_10__.DOCUMENT, 8)); }; - ViewportRuler.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: ViewportRuler, factory: ViewportRuler.ɵfac, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ViewportRuler, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -16180,6 +14541,7 @@ ViewportRuler.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__ }]; }, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -16187,10 +14549,58 @@ ViewportRuler.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ +const VIRTUAL_SCROLLABLE = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('VIRTUAL_SCROLLABLE'); +/** + * Extending the {@link CdkScrollable} to be used as scrolling container for virtual scrolling. + */ +class CdkVirtualScrollable extends CdkScrollable { + constructor(elementRef, scrollDispatcher, ngZone, dir) { + super(elementRef, scrollDispatcher, ngZone, dir); + } + /** + * Measure the viewport size for the provided orientation. + * + * @param orientation The orientation to measure the size from. + */ + measureViewportSize(orientation) { + const viewportEl = this.elementRef.nativeElement; + return orientation === 'horizontal' ? viewportEl.clientWidth : viewportEl.clientHeight; + } +} +CdkVirtualScrollable.ɵfac = function CdkVirtualScrollable_Factory(t) { + return new (t || CdkVirtualScrollable)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ScrollDispatcher), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.Directionality, 8)); +}; +CdkVirtualScrollable.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ + type: CdkVirtualScrollable, + features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]] +}); +(function () { + (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CdkVirtualScrollable, [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive + }], function () { + return [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef + }, { + type: ScrollDispatcher + }, { + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone + }, { + type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.Directionality, + decorators: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional + }] + }]; + }, null); +})(); +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ /** Checks if the given ranges are equal. */ - - function rangesEqual(r1, r2) { return r1.start == r2.start && r1.end == r2.end; } @@ -16199,223 +14609,182 @@ function rangesEqual(r1, r2) { * something that doesn't rely on requestAnimationFrame on environments * that don't support it (e.g. server-side rendering). */ - - const SCROLL_SCHEDULER = typeof requestAnimationFrame !== 'undefined' ? rxjs__WEBPACK_IMPORTED_MODULE_13__.animationFrameScheduler : rxjs__WEBPACK_IMPORTED_MODULE_14__.asapScheduler; /** A viewport that virtualizes its scrolling with the help of `CdkVirtualForOf`. */ - -class CdkVirtualScrollViewport extends CdkScrollable { - constructor(elementRef, _changeDetectorRef, ngZone, _scrollStrategy, dir, scrollDispatcher, viewportRuler) { +class CdkVirtualScrollViewport extends CdkVirtualScrollable { + /** The direction the viewport scrolls. */ + get orientation() { + return this._orientation; + } + set orientation(orientation) { + if (this._orientation !== orientation) { + this._orientation = orientation; + this._calculateSpacerSize(); + } + } + /** + * Whether rendered items should persist in the DOM after scrolling out of view. By default, items + * will be removed. + */ + get appendOnly() { + return this._appendOnly; + } + set appendOnly(value) { + this._appendOnly = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceBooleanProperty)(value); + } + constructor(elementRef, _changeDetectorRef, ngZone, _scrollStrategy, dir, scrollDispatcher, viewportRuler, scrollable) { super(elementRef, scrollDispatcher, ngZone, dir); this.elementRef = elementRef; this._changeDetectorRef = _changeDetectorRef; this._scrollStrategy = _scrollStrategy; + this.scrollable = scrollable; + this._platform = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_9__.Platform); /** Emits when the viewport is detached from a CdkVirtualForOf. */ - this._detachedSubject = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); /** Emits when the rendered range changes. */ - this._renderedRangeSubject = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); this._orientation = 'vertical'; - this._appendOnly = false; // Note: we don't use the typical EventEmitter here because we need to subscribe to the scroll + this._appendOnly = false; + // Note: we don't use the typical EventEmitter here because we need to subscribe to the scroll // strategy lazily (i.e. only if the user is actually listening to the events). We do this because // depending on how the strategy calculates the scrolled index, it may come at a cost to // performance. - /** Emits when the index of the first element visible in the viewport changes. */ - this.scrolledIndexChange = new rxjs__WEBPACK_IMPORTED_MODULE_5__.Observable(observer => this._scrollStrategy.scrolledIndexChange.subscribe(index => Promise.resolve().then(() => this.ngZone.run(() => observer.next(index))))); /** A stream that emits whenever the rendered range changes. */ - this.renderedRangeStream = this._renderedRangeSubject; /** * The total size of all content (in pixels), including content that is not currently rendered. */ - this._totalContentSize = 0; /** A string representing the `style.width` property value to be used for the spacer element. */ - this._totalContentWidth = ''; /** A string representing the `style.height` property value to be used for the spacer element. */ - this._totalContentHeight = ''; /** The currently rendered range of indices. */ - this._renderedRange = { start: 0, end: 0 }; /** The length of the data bound to this viewport (in number of items). */ - this._dataLength = 0; /** The size of the viewport (in pixels). */ - this._viewportSize = 0; /** The last rendered content offset that was set. */ - this._renderedContentOffset = 0; /** * Whether the last rendered content offset was to the end of the content (and therefore needs to * be rewritten as an offset to the start of the content). */ - this._renderedContentOffsetNeedsRewrite = false; /** Whether there is a pending change detection cycle. */ - this._isChangeDetectionPending = false; /** A list of functions to run after the next change detection cycle. */ - this._runAfterChangeDetection = []; /** Subscription to changes in the viewport size. */ - this._viewportChanges = rxjs__WEBPACK_IMPORTED_MODULE_15__.Subscription.EMPTY; - if (!_scrollStrategy && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw Error('Error: cdk-virtual-scroll-viewport requires the "itemSize" property to be set.'); } - this._viewportChanges = viewportRuler.change().subscribe(() => { this.checkViewportSize(); }); - } - /** The direction the viewport scrolls. */ - - - get orientation() { - return this._orientation; - } - - set orientation(orientation) { - if (this._orientation !== orientation) { - this._orientation = orientation; - - this._calculateSpacerSize(); + if (!this.scrollable) { + // No scrollable is provided, so the virtual-scroll-viewport needs to become a scrollable + this.elementRef.nativeElement.classList.add('cdk-virtual-scrollable'); + this.scrollable = this; } } - /** - * Whether rendered items should persist in the DOM after scrolling out of view. By default, items - * will be removed. - */ - - - get appendOnly() { - return this._appendOnly; - } - - set appendOnly(value) { - this._appendOnly = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceBooleanProperty)(value); - } - ngOnInit() { - super.ngOnInit(); // It's still too early to measure the viewport at this point. Deferring with a promise allows + // Scrolling depends on the element dimensions which we can't get during SSR. + if (!this._platform.isBrowser) { + return; + } + if (this.scrollable === this) { + super.ngOnInit(); + } + // It's still too early to measure the viewport at this point. Deferring with a promise allows // the Viewport to be rendered with the correct size before we measure. We run this outside the // zone to avoid causing more change detection cycles. We handle the change detection loop // ourselves instead. - this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => { this._measureViewportSize(); - this._scrollStrategy.attach(this); - - this.elementScrolled().pipe( // Start off with a fake scroll event so we properly detect our initial position. - (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.startWith)(null), // Collect multiple events into one until the next animation frame. This way if + this.scrollable.elementScrolled().pipe( + // Start off with a fake scroll event so we properly detect our initial position. + (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.startWith)(null), + // Collect multiple events into one until the next animation frame. This way if // there are multiple scroll events in the same frame we only need to recheck // our layout once. (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.auditTime)(0, SCROLL_SCHEDULER)).subscribe(() => this._scrollStrategy.onContentScrolled()); - this._markChangeDetectionNeeded(); })); } - ngOnDestroy() { this.detach(); - - this._scrollStrategy.detach(); // Complete all subjects - - + this._scrollStrategy.detach(); + // Complete all subjects this._renderedRangeSubject.complete(); - this._detachedSubject.complete(); - this._viewportChanges.unsubscribe(); - super.ngOnDestroy(); } /** Attaches a `CdkVirtualScrollRepeater` to this viewport. */ - - attach(forOf) { if (this._forOf && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw Error('CdkVirtualScrollViewport is already attached.'); - } // Subscribe to the data stream of the CdkVirtualForOf to keep track of when the data length + } + // Subscribe to the data stream of the CdkVirtualForOf to keep track of when the data length // changes. Run outside the zone to avoid triggering change detection, since we're managing the // change detection loop ourselves. - - this.ngZone.runOutsideAngular(() => { this._forOf = forOf; - this._forOf.dataStream.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.takeUntil)(this._detachedSubject)).subscribe(data => { const newLength = data.length; - if (newLength !== this._dataLength) { this._dataLength = newLength; - this._scrollStrategy.onDataLengthChanged(); } - this._doChangeDetection(); }); }); } /** Detaches the current `CdkVirtualForOf`. */ - - detach() { this._forOf = null; - this._detachedSubject.next(); } /** Gets the length of the data bound to this viewport (in number of items). */ - - getDataLength() { return this._dataLength; } /** Gets the size of the viewport (in pixels). */ - - getViewportSize() { return this._viewportSize; - } // TODO(mmalerba): This is technically out of sync with what's really rendered until a render + } + // TODO(mmalerba): This is technically out of sync with what's really rendered until a render // cycle happens. I'm being careful to only call it after the render cycle is complete and before // setting it to something else, but its error prone and should probably be split into // `pendingRange` and `renderedRange`, the latter reflecting whats actually in the DOM. - /** Get the current rendered range of items. */ - - getRenderedRange() { return this._renderedRange; } + measureBoundingClientRectWithScrollOffset(from) { + return this.getElementRef().nativeElement.getBoundingClientRect()[from]; + } /** * Sets the total size of all content (in pixels), including content that is not currently * rendered. */ - - setTotalContentSize(size) { if (this._totalContentSize !== size) { this._totalContentSize = size; - this._calculateSpacerSize(); - this._markChangeDetectionNeeded(); } } /** Sets the currently rendered range of indices. */ - - setRenderedRange(range) { if (!rangesEqual(this._renderedRange, range)) { if (this.appendOnly) { @@ -16424,17 +14793,13 @@ class CdkVirtualScrollViewport extends CdkScrollable { end: Math.max(this._renderedRange.end, range.end) }; } - this._renderedRangeSubject.next(this._renderedRange = range); - this._markChangeDetectionNeeded(() => this._scrollStrategy.onContentRendered()); } } /** * Gets the offset from the start of the viewport to the start of the rendered data (in pixels). */ - - getOffsetToRenderedContentStart() { return this._renderedContentOffsetNeedsRewrite ? null : this._renderedContentOffset; } @@ -16442,33 +14807,28 @@ class CdkVirtualScrollViewport extends CdkScrollable { * Sets the offset from the start of the viewport to either the start or end of the rendered data * (in pixels). */ - - setRenderedContentOffset(offset, to = 'to-start') { + // In appendOnly, we always start from the top + offset = this.appendOnly && to === 'to-start' ? 0 : offset; // For a horizontal viewport in a right-to-left language we need to translate along the x-axis // in the negative direction. const isRtl = this.dir && this.dir.value == 'rtl'; const isHorizontal = this.orientation == 'horizontal'; const axis = isHorizontal ? 'X' : 'Y'; const axisDirection = isHorizontal && isRtl ? -1 : 1; - let transform = `translate${axis}(${Number(axisDirection * offset)}px)`; // in appendOnly, we always start from the top - - offset = this.appendOnly && to === 'to-start' ? 0 : offset; + let transform = `translate${axis}(${Number(axisDirection * offset)}px)`; this._renderedContentOffset = offset; - if (to === 'to-end') { - transform += ` translate${axis}(-100%)`; // The viewport should rewrite this as a `to-start` offset on the next render cycle. Otherwise + transform += ` translate${axis}(-100%)`; + // The viewport should rewrite this as a `to-start` offset on the next render cycle. Otherwise // elements will appear to expand in the wrong direction (e.g. `mat-expansion-panel` would // expand upward). - this._renderedContentOffsetNeedsRewrite = true; } - if (this._renderedContentTransform != transform) { // We know this value is safe because we parse `offset` with `Number()` before passing it // into the string. this._renderedContentTransform = transform; - this._markChangeDetectionNeeded(() => { if (this._renderedContentOffsetNeedsRewrite) { this._renderedContentOffset -= this.measureRenderedContentSize(); @@ -16487,44 +14847,63 @@ class CdkVirtualScrollViewport extends CdkScrollable { * @param offset The offset to scroll to. * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`. */ - - scrollToOffset(offset, behavior = 'auto') { const options = { behavior }; - if (this.orientation === 'horizontal') { options.start = offset; } else { options.top = offset; } - - this.scrollTo(options); + this.scrollable.scrollTo(options); } /** * Scrolls to the offset for the given index. * @param index The index of the element to scroll to. * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`. */ - - scrollToIndex(index, behavior = 'auto') { this._scrollStrategy.scrollToIndex(index, behavior); } /** - * Gets the current scroll offset from the start of the viewport (in pixels). + * Gets the current scroll offset from the start of the scrollable (in pixels). * @param from The edge to measure the offset from. Defaults to 'top' in vertical mode and 'start' * in horizontal mode. */ - - measureScrollOffset(from) { - return from ? super.measureScrollOffset(from) : super.measureScrollOffset(this.orientation === 'horizontal' ? 'start' : 'top'); + // This is to break the call cycle + let measureScrollOffset; + if (this.scrollable == this) { + measureScrollOffset = _from => super.measureScrollOffset(_from); + } else { + measureScrollOffset = _from => this.scrollable.measureScrollOffset(_from); + } + return Math.max(0, measureScrollOffset(from ?? (this.orientation === 'horizontal' ? 'start' : 'top')) - this.measureViewportOffset()); + } + /** + * Measures the offset of the viewport from the scrolling container + * @param from The edge to measure from. + */ + measureViewportOffset(from) { + let fromRect; + const LEFT = 'left'; + const RIGHT = 'right'; + const isRtl = this.dir?.value == 'rtl'; + if (from == 'start') { + fromRect = isRtl ? RIGHT : LEFT; + } else if (from == 'end') { + fromRect = isRtl ? LEFT : RIGHT; + } else if (from) { + fromRect = from; + } else { + fromRect = this.orientation === 'horizontal' ? 'left' : 'top'; + } + const scrollerClientRect = this.scrollable.measureBoundingClientRectWithScrollOffset(fromRect); + const viewportClientRect = this.elementRef.nativeElement.getBoundingClientRect()[fromRect]; + return viewportClientRect - scrollerClientRect; } /** Measure the combined size of all of the rendered items. */ - - measureRenderedContentSize() { const contentEl = this._contentWrapper.nativeElement; return this.orientation === 'horizontal' ? contentEl.offsetWidth : contentEl.offsetHeight; @@ -16533,41 +14912,29 @@ class CdkVirtualScrollViewport extends CdkScrollable { * Measure the total combined size of the given range. Throws if the range includes items that are * not rendered. */ - - measureRangeSize(range) { if (!this._forOf) { return 0; } - return this._forOf.measureRangeSize(range, this.orientation); } /** Update the viewport dimensions and re-render. */ - - checkViewportSize() { // TODO: Cleanup later when add logic for handling content resize this._measureViewportSize(); - this._scrollStrategy.onDataLengthChanged(); } /** Measure the viewport size. */ - - _measureViewportSize() { - const viewportEl = this.elementRef.nativeElement; - this._viewportSize = this.orientation === 'horizontal' ? viewportEl.clientWidth : viewportEl.clientHeight; + this._viewportSize = this.scrollable.measureViewportSize(this.orientation); } /** Queue up change detection to run. */ - - _markChangeDetectionNeeded(runAfter) { if (runAfter) { this._runAfterChangeDetection.push(runAfter); - } // Use a Promise to batch together calls to `_doChangeDetection`. This way if we set a bunch of + } + // Use a Promise to batch together calls to `_doChangeDetection`. This way if we set a bunch of // properties sequentially we only have to run `_doChangeDetection` once at the end. - - if (!this._isChangeDetectionPending) { this._isChangeDetectionPending = true; this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => { @@ -16576,40 +14943,32 @@ class CdkVirtualScrollViewport extends CdkScrollable { } } /** Run change detection. */ - - _doChangeDetection() { - this._isChangeDetectionPending = false; // Apply the content transform. The transform can't be set via an Angular binding because + this._isChangeDetectionPending = false; + // Apply the content transform. The transform can't be set via an Angular binding because // bypassSecurityTrustStyle is banned in Google. However the value is safe, it's composed of // string literals, a variable that can only be 'X' or 'Y', and user input that is run through // the `Number` function first to coerce it to a numeric value. - - this._contentWrapper.nativeElement.style.transform = this._renderedContentTransform; // Apply changes to Angular bindings. Note: We must call `markForCheck` to run change detection + this._contentWrapper.nativeElement.style.transform = this._renderedContentTransform; + // Apply changes to Angular bindings. Note: We must call `markForCheck` to run change detection // from the root, since the repeated items are content projected in. Calling `detectChanges` // instead does not properly check the projected content. - this.ngZone.run(() => this._changeDetectorRef.markForCheck()); const runAfterChangeDetection = this._runAfterChangeDetection; this._runAfterChangeDetection = []; - for (const fn of runAfterChangeDetection) { fn(); } } /** Calculates the `style.width` and `style.height` for the spacer element. */ - - _calculateSpacerSize() { this._totalContentHeight = this.orientation === 'horizontal' ? '' : `${this._totalContentSize}px`; this._totalContentWidth = this.orientation === 'horizontal' ? `${this._totalContentSize}px` : ''; } - } - CdkVirtualScrollViewport.ɵfac = function CdkVirtualScrollViewport_Factory(t) { - return new (t || CdkVirtualScrollViewport)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](VIRTUAL_SCROLL_STRATEGY, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.Directionality, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ScrollDispatcher), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ViewportRuler)); + return new (t || CdkVirtualScrollViewport)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](VIRTUAL_SCROLL_STRATEGY, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.Directionality, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ScrollDispatcher), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ViewportRuler), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](VIRTUAL_SCROLLABLE, 8)); }; - CdkVirtualScrollViewport.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: CdkVirtualScrollViewport, selectors: [["cdk-virtual-scroll-viewport"]], @@ -16617,10 +14976,8 @@ CdkVirtualScrollViewport.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_ if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_c0, 7); } - if (rf & 2) { let _t; - _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx._contentWrapper = _t.first); } }, @@ -16638,10 +14995,12 @@ CdkVirtualScrollViewport.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_ outputs: { scrolledIndexChange: "scrolledIndexChange" }, + standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{ provide: CdkScrollable, - useExisting: CdkVirtualScrollViewport - }]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]], + useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport, + deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject(VIRTUAL_SCROLLABLE)], CdkVirtualScrollViewport] + }]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"], _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵStandaloneFeature"]], ngContentSelectors: _c1, decls: 4, vars: 4, @@ -16654,17 +15013,15 @@ CdkVirtualScrollViewport.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"](); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](3, "div", 2); } - if (rf & 2) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵstyleProp"]("width", ctx._totalContentWidth)("height", ctx._totalContentHeight); } }, - styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;overflow:auto;contain:strict;transform:translateZ(0);will-change:scroll-position;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{position:absolute;top:0;left:0;height:1px;width:1px;transform-origin:0 0}[dir=rtl] .cdk-virtual-scroll-spacer{right:0;left:auto;transform-origin:100% 0}"], + styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}"], encapsulation: 2, changeDetection: 0 }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CdkVirtualScrollViewport, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component, @@ -16677,12 +15034,14 @@ CdkVirtualScrollViewport.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_ }, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewEncapsulation.None, changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush, + standalone: true, providers: [{ provide: CdkScrollable, - useExisting: CdkVirtualScrollViewport + useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport, + deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject(VIRTUAL_SCROLLABLE)], CdkVirtualScrollViewport] }], template: "\n
\n \n
\n\n
\n", - styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;overflow:auto;contain:strict;transform:translateZ(0);will-change:scroll-position;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{position:absolute;top:0;left:0;height:1px;width:1px;transform-origin:0 0}[dir=rtl] .cdk-virtual-scroll-spacer{right:0;left:auto;transform-origin:100% 0}"] + styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}"] }] }], function () { return [{ @@ -16708,6 +15067,14 @@ CdkVirtualScrollViewport.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_ type: ScrollDispatcher }, { type: ViewportRuler + }, { + type: CdkVirtualScrollable, + decorators: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional + }, { + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject, + args: [VIRTUAL_SCROLLABLE] + }] }]; }, { orientation: [{ @@ -16727,6 +15094,7 @@ CdkVirtualScrollViewport.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_ }] }); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -16734,122 +15102,48 @@ CdkVirtualScrollViewport.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - /** Helper to extract the offset of a DOM Node in a certain direction. */ - - function getOffset(orientation, direction, node) { const el = node; - if (!el.getBoundingClientRect) { return 0; } - const rect = el.getBoundingClientRect(); - if (orientation === 'horizontal') { return direction === 'start' ? rect.left : rect.right; } - return direction === 'start' ? rect.top : rect.bottom; } /** * A directive similar to `ngForOf` to be used for rendering data inside a virtual scrolling * container. */ - - class CdkVirtualForOf { - constructor( - /** The view container to add items to. */ - _viewContainerRef, - /** The template to use when stamping out new items. */ - _template, - /** The set of available differs. */ - _differs, - /** The strategy used to render items in the virtual scroll viewport. */ - _viewRepeater, - /** The virtual scrolling viewport that these items are being rendered in. */ - _viewport, ngZone) { - this._viewContainerRef = _viewContainerRef; - this._template = _template; - this._differs = _differs; - this._viewRepeater = _viewRepeater; - this._viewport = _viewport; - /** Emits when the rendered view of the data changes. */ - - this.viewChange = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); - /** Subject that emits when a new DataSource instance is given. */ - - this._dataSourceChanges = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); - /** Emits whenever the data in the current DataSource changes. */ - - this.dataStream = this._dataSourceChanges.pipe( // Start off with null `DataSource`. - (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.startWith)(null), // Bundle up the previous and current data sources so we can work with both. - (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.pairwise)(), // Use `_changeDataSource` to disconnect from the previous data source and connect to the - // new one, passing back a stream of data changes which we run through `switchMap` to give - // us a data stream that emits the latest data from whatever the current `DataSource` is. - (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.switchMap)(([prev, cur]) => this._changeDataSource(prev, cur)), // Replay the last emitted data when someone subscribes. - (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_19__.shareReplay)(1)); - /** The differ used to calculate changes to the data. */ - - this._differ = null; - /** Whether the rendered data should be updated during the next ngDoCheck cycle. */ - - this._needsUpdate = false; - this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); - this.dataStream.subscribe(data => { - this._data = data; - - this._onRenderedDataChange(); - }); - - this._viewport.renderedRangeStream.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.takeUntil)(this._destroyed)).subscribe(range => { - this._renderedRange = range; - - if (this.viewChange.observers.length) { - ngZone.run(() => this.viewChange.next(this._renderedRange)); - } - - this._onRenderedDataChange(); - }); - - this._viewport.attach(this); - } /** The DataSource to display. */ - - get cdkVirtualForOf() { return this._cdkVirtualForOf; } - set cdkVirtualForOf(value) { this._cdkVirtualForOf = value; - - if ((0,_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_20__.isDataSource)(value)) { + if ((0,_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_17__.isDataSource)(value)) { this._dataSourceChanges.next(value); } else { // If value is an an NgIterable, convert it to an array. - this._dataSourceChanges.next(new _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_20__.ArrayDataSource((0,rxjs__WEBPACK_IMPORTED_MODULE_21__.isObservable)(value) ? value : Array.from(value || []))); + this._dataSourceChanges.next(new _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_17__.ArrayDataSource((0,rxjs__WEBPACK_IMPORTED_MODULE_18__.isObservable)(value) ? value : Array.from(value || []))); } } /** * The `TrackByFunction` to use for tracking changes. The `TrackByFunction` takes the index and * the item and produces a value to be used as the item's identity when tracking changes. */ - - get cdkVirtualForTrackBy() { return this._cdkVirtualForTrackBy; } - set cdkVirtualForTrackBy(fn) { this._needsUpdate = true; this._cdkVirtualForTrackBy = fn ? (index, item) => fn(index + (this._renderedRange ? this._renderedRange.start : 0), item) : undefined; } /** The template used to stamp out new elements. */ - - set cdkVirtualForTemplate(value) { if (value) { this._needsUpdate = true; @@ -16860,104 +15154,124 @@ class CdkVirtualForOf { * The size of the cache used to store templates that are not being used for re-use later. * Setting the cache size to `0` will disable caching. Defaults to 20 templates. */ - - get cdkVirtualForTemplateCacheSize() { return this._viewRepeater.viewCacheSize; } - set cdkVirtualForTemplateCacheSize(size) { this._viewRepeater.viewCacheSize = (0,_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_3__.coerceNumberProperty)(size); } + constructor( /** The view container to add items to. */ + _viewContainerRef, /** The template to use when stamping out new items. */ + _template, /** The set of available differs. */ + _differs, /** The strategy used to render items in the virtual scroll viewport. */ + _viewRepeater, /** The virtual scrolling viewport that these items are being rendered in. */ + _viewport, ngZone) { + this._viewContainerRef = _viewContainerRef; + this._template = _template; + this._differs = _differs; + this._viewRepeater = _viewRepeater; + this._viewport = _viewport; + /** Emits when the rendered view of the data changes. */ + this.viewChange = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + /** Subject that emits when a new DataSource instance is given. */ + this._dataSourceChanges = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + /** Emits whenever the data in the current DataSource changes. */ + this.dataStream = this._dataSourceChanges.pipe( + // Start off with null `DataSource`. + (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.startWith)(null), + // Bundle up the previous and current data sources so we can work with both. + (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_19__.pairwise)(), + // Use `_changeDataSource` to disconnect from the previous data source and connect to the + // new one, passing back a stream of data changes which we run through `switchMap` to give + // us a data stream that emits the latest data from whatever the current `DataSource` is. + (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_20__.switchMap)(([prev, cur]) => this._changeDataSource(prev, cur)), + // Replay the last emitted data when someone subscribes. + (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_21__.shareReplay)(1)); + /** The differ used to calculate changes to the data. */ + this._differ = null; + /** Whether the rendered data should be updated during the next ngDoCheck cycle. */ + this._needsUpdate = false; + this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(); + this.dataStream.subscribe(data => { + this._data = data; + this._onRenderedDataChange(); + }); + this._viewport.renderedRangeStream.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.takeUntil)(this._destroyed)).subscribe(range => { + this._renderedRange = range; + if (this.viewChange.observers.length) { + ngZone.run(() => this.viewChange.next(this._renderedRange)); + } + this._onRenderedDataChange(); + }); + this._viewport.attach(this); + } /** * Measures the combined size (width for horizontal orientation, height for vertical) of all items * in the specified range. Throws an error if the range includes items that are not currently * rendered. */ - - measureRangeSize(range, orientation) { if (range.start >= range.end) { return 0; } - if ((range.start < this._renderedRange.start || range.end > this._renderedRange.end) && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw Error(`Error: attempted to measure an item that isn't rendered.`); - } // The index into the list of rendered views for the first item in the range. - - - const renderedStartIndex = range.start - this._renderedRange.start; // The length of the range we're measuring. - - const rangeLen = range.end - range.start; // Loop over all the views, find the first and land node and compute the size by subtracting + } + // The index into the list of rendered views for the first item in the range. + const renderedStartIndex = range.start - this._renderedRange.start; + // The length of the range we're measuring. + const rangeLen = range.end - range.start; + // Loop over all the views, find the first and land node and compute the size by subtracting // the top of the first node from the bottom of the last one. - let firstNode; - let lastNode; // Find the first node by starting from the beginning and going forwards. - + let lastNode; + // Find the first node by starting from the beginning and going forwards. for (let i = 0; i < rangeLen; i++) { const view = this._viewContainerRef.get(i + renderedStartIndex); - if (view && view.rootNodes.length) { firstNode = lastNode = view.rootNodes[0]; break; } - } // Find the last node by starting from the end and going backwards. - - + } + // Find the last node by starting from the end and going backwards. for (let i = rangeLen - 1; i > -1; i--) { const view = this._viewContainerRef.get(i + renderedStartIndex); - if (view && view.rootNodes.length) { lastNode = view.rootNodes[view.rootNodes.length - 1]; break; } } - return firstNode && lastNode ? getOffset(orientation, 'end', lastNode) - getOffset(orientation, 'start', firstNode) : 0; } - ngDoCheck() { if (this._differ && this._needsUpdate) { // TODO(mmalerba): We should differentiate needs update due to scrolling and a new portion of // this list being rendered (can use simpler algorithm) vs needs update due to data actually // changing (need to do this diff). const changes = this._differ.diff(this._renderedItems); - if (!changes) { this._updateContext(); } else { this._applyChanges(changes); } - this._needsUpdate = false; } } - ngOnDestroy() { this._viewport.detach(); - this._dataSourceChanges.next(undefined); - this._dataSourceChanges.complete(); - this.viewChange.complete(); - this._destroyed.next(); - this._destroyed.complete(); - this._viewRepeater.detach(); } /** React to scroll state changes in the viewport. */ - - _onRenderedDataChange() { if (!this._renderedRange) { return; } - this._renderedItems = this._data.slice(this._renderedRange.start, this._renderedRange.end); - if (!this._differ) { // Use a wrapper function for the `trackBy` so any new values are // picked up automatically without having to recreate the differ. @@ -16965,73 +15279,53 @@ class CdkVirtualForOf { return this.cdkVirtualForTrackBy ? this.cdkVirtualForTrackBy(index, item) : item; }); } - this._needsUpdate = true; } /** Swap out one `DataSource` for another. */ - - _changeDataSource(oldDs, newDs) { if (oldDs) { oldDs.disconnect(this); } - this._needsUpdate = true; return newDs ? newDs.connect(this) : (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.of)(); } /** Update the `CdkVirtualForOfContext` for all views. */ - - _updateContext() { const count = this._data.length; let i = this._viewContainerRef.length; - while (i--) { const view = this._viewContainerRef.get(i); - view.context.index = this._renderedRange.start + i; view.context.count = count; - this._updateComputedContextProperties(view.context); - view.detectChanges(); } } /** Apply changes to the DOM. */ - - _applyChanges(changes) { - this._viewRepeater.applyChanges(changes, this._viewContainerRef, (record, _adjustedPreviousIndex, currentIndex) => this._getEmbeddedViewArgs(record, currentIndex), record => record.item); // Update $implicit for any items that had an identity change. - - + this._viewRepeater.applyChanges(changes, this._viewContainerRef, (record, _adjustedPreviousIndex, currentIndex) => this._getEmbeddedViewArgs(record, currentIndex), record => record.item); + // Update $implicit for any items that had an identity change. changes.forEachIdentityChange(record => { const view = this._viewContainerRef.get(record.currentIndex); - view.context.$implicit = record.item; - }); // Update the context variables on all items. - + }); + // Update the context variables on all items. const count = this._data.length; let i = this._viewContainerRef.length; - while (i--) { const view = this._viewContainerRef.get(i); - view.context.index = this._renderedRange.start + i; view.context.count = count; - this._updateComputedContextProperties(view.context); } } /** Update the computed properties on the `CdkVirtualForOfContext`. */ - - _updateComputedContextProperties(context) { context.first = context.index === 0; context.last = context.index === context.count - 1; context.even = context.index % 2 === 0; context.odd = !context.even; } - _getEmbeddedViewArgs(record, index) { // Note that it's important that we insert the item directly at the proper index, // rather than inserting it and the moving it in place, because if there's a directive @@ -17054,13 +15348,10 @@ class CdkVirtualForOf { index }; } - } - CdkVirtualForOf.ɵfac = function CdkVirtualForOf_Factory(t) { - return new (t || CdkVirtualForOf)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.IterableDiffers), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_20__._VIEW_REPEATER_STRATEGY), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](CdkVirtualScrollViewport, 4), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone)); + return new (t || CdkVirtualForOf)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.IterableDiffers), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_17__._VIEW_REPEATER_STRATEGY), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](CdkVirtualScrollViewport, 4), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone)); }; - CdkVirtualForOf.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: CdkVirtualForOf, selectors: [["", "cdkVirtualFor", "", "cdkVirtualForOf", ""]], @@ -17070,21 +15361,22 @@ CdkVirtualForOf.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ cdkVirtualForTemplate: "cdkVirtualForTemplate", cdkVirtualForTemplateCacheSize: "cdkVirtualForTemplateCacheSize" }, + standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{ - provide: _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_20__._VIEW_REPEATER_STRATEGY, - useClass: _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_20__._RecycleViewRepeaterStrategy + provide: _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_17__._VIEW_REPEATER_STRATEGY, + useClass: _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_17__._RecycleViewRepeaterStrategy }])] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CdkVirtualForOf, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ selector: '[cdkVirtualFor][cdkVirtualForOf]', providers: [{ - provide: _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_20__._VIEW_REPEATER_STRATEGY, - useClass: _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_20__._RecycleViewRepeaterStrategy - }] + provide: _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_17__._VIEW_REPEATER_STRATEGY, + useClass: _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_17__._RecycleViewRepeaterStrategy + }], + standalone: true }] }], function () { return [{ @@ -17094,10 +15386,10 @@ CdkVirtualForOf.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.IterableDiffers }, { - type: _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_20__._RecycleViewRepeaterStrategy, + type: _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_17__._RecycleViewRepeaterStrategy, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject, - args: [_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_20__._VIEW_REPEATER_STRATEGY] + args: [_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_17__._VIEW_REPEATER_STRATEGY] }] }, { type: CdkVirtualScrollViewport, @@ -17122,6 +15414,7 @@ CdkVirtualForOf.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ }] }); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -17129,56 +15422,163 @@ CdkVirtualForOf.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ +/** + * Provides a virtual scrollable for the element it is attached to. + */ +class CdkVirtualScrollableElement extends CdkVirtualScrollable { + constructor(elementRef, scrollDispatcher, ngZone, dir) { + super(elementRef, scrollDispatcher, ngZone, dir); + } + measureBoundingClientRectWithScrollOffset(from) { + return this.getElementRef().nativeElement.getBoundingClientRect()[from] - this.measureScrollOffset(from); + } +} +CdkVirtualScrollableElement.ɵfac = function CdkVirtualScrollableElement_Factory(t) { + return new (t || CdkVirtualScrollableElement)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ScrollDispatcher), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.Directionality, 8)); +}; +CdkVirtualScrollableElement.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ + type: CdkVirtualScrollableElement, + selectors: [["", "cdkVirtualScrollingElement", ""]], + hostAttrs: [1, "cdk-virtual-scrollable"], + standalone: true, + features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{ + provide: VIRTUAL_SCROLLABLE, + useExisting: CdkVirtualScrollableElement + }]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]] +}); +(function () { + (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CdkVirtualScrollableElement, [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, + args: [{ + selector: '[cdkVirtualScrollingElement]', + providers: [{ + provide: VIRTUAL_SCROLLABLE, + useExisting: CdkVirtualScrollableElement + }], + standalone: true, + host: { + 'class': 'cdk-virtual-scrollable' + } + }] + }], function () { + return [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef + }, { + type: ScrollDispatcher + }, { + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone + }, { + type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.Directionality, + decorators: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional + }] + }]; + }, null); +})(); +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** + * Provides as virtual scrollable for the global / window scrollbar. + */ +class CdkVirtualScrollableWindow extends CdkVirtualScrollable { + constructor(scrollDispatcher, ngZone, dir) { + super(new _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef(document.documentElement), scrollDispatcher, ngZone, dir); + this._elementScrolled = new rxjs__WEBPACK_IMPORTED_MODULE_5__.Observable(observer => this.ngZone.runOutsideAngular(() => (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.fromEvent)(document, 'scroll').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.takeUntil)(this._destroyed)).subscribe(observer))); + } + measureBoundingClientRectWithScrollOffset(from) { + return this.getElementRef().nativeElement.getBoundingClientRect()[from]; + } +} +CdkVirtualScrollableWindow.ɵfac = function CdkVirtualScrollableWindow_Factory(t) { + return new (t || CdkVirtualScrollableWindow)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ScrollDispatcher), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.Directionality, 8)); +}; +CdkVirtualScrollableWindow.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ + type: CdkVirtualScrollableWindow, + selectors: [["cdk-virtual-scroll-viewport", "scrollWindow", ""]], + standalone: true, + features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{ + provide: VIRTUAL_SCROLLABLE, + useExisting: CdkVirtualScrollableWindow + }]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]] +}); +(function () { + (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CdkVirtualScrollableWindow, [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, + args: [{ + selector: 'cdk-virtual-scroll-viewport[scrollWindow]', + providers: [{ + provide: VIRTUAL_SCROLLABLE, + useExisting: CdkVirtualScrollableWindow + }], + standalone: true + }] + }], function () { + return [{ + type: ScrollDispatcher + }, { + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone + }, { + type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.Directionality, + decorators: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional + }] + }]; + }, null); +})(); +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ class CdkScrollableModule {} - CdkScrollableModule.ɵfac = function CdkScrollableModule_Factory(t) { return new (t || CdkScrollableModule)(); }; - CdkScrollableModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: CdkScrollableModule }); CdkScrollableModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({}); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CdkScrollableModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule, args: [{ exports: [CdkScrollable], - declarations: [CdkScrollable] + imports: [CdkScrollable] }] }], null, null); })(); /** * @docs-primary-export */ - - class ScrollingModule {} - ScrollingModule.ɵfac = function ScrollingModule_Factory(t) { return new (t || ScrollingModule)(); }; - ScrollingModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: ScrollingModule }); ScrollingModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ - imports: [_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.BidiModule, CdkScrollableModule, _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.BidiModule, CdkScrollableModule] + imports: [_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.BidiModule, CdkScrollableModule, CdkVirtualScrollViewport, _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.BidiModule, CdkScrollableModule] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ScrollingModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule, args: [{ - imports: [_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.BidiModule, CdkScrollableModule], - exports: [_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.BidiModule, CdkScrollableModule, CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport], - declarations: [CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport] + imports: [_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.BidiModule, CdkScrollableModule, CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollableWindow, CdkVirtualScrollableElement], + exports: [_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_12__.BidiModule, CdkScrollableModule, CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport, CdkVirtualScrollableWindow, CdkVirtualScrollableElement] }] }], null, null); })(); + /** * @license * Copyright Google LLC All Rights Reserved. @@ -17209,7 +15609,6 @@ ScrollingModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ - /***/ }), /***/ 4666: @@ -17222,8 +15621,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "APP_BASE_HREF": () => (/* binding */ APP_BASE_HREF), /* harmony export */ "AsyncPipe": () => (/* binding */ AsyncPipe), +/* harmony export */ "BrowserPlatformLocation": () => (/* binding */ BrowserPlatformLocation), /* harmony export */ "CommonModule": () => (/* binding */ CommonModule), /* harmony export */ "CurrencyPipe": () => (/* binding */ CurrencyPipe), +/* harmony export */ "DATE_PIPE_DEFAULT_OPTIONS": () => (/* binding */ DATE_PIPE_DEFAULT_OPTIONS), /* harmony export */ "DATE_PIPE_DEFAULT_TIMEZONE": () => (/* binding */ DATE_PIPE_DEFAULT_TIMEZONE), /* harmony export */ "DOCUMENT": () => (/* binding */ DOCUMENT), /* harmony export */ "DatePipe": () => (/* binding */ DatePipe), @@ -17233,6 +15634,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "HashLocationStrategy": () => (/* binding */ HashLocationStrategy), /* harmony export */ "I18nPluralPipe": () => (/* binding */ I18nPluralPipe), /* harmony export */ "I18nSelectPipe": () => (/* binding */ I18nSelectPipe), +/* harmony export */ "IMAGE_CONFIG": () => (/* binding */ IMAGE_CONFIG), +/* harmony export */ "IMAGE_LOADER": () => (/* binding */ IMAGE_LOADER), /* harmony export */ "JsonPipe": () => (/* binding */ JsonPipe), /* harmony export */ "KeyValuePipe": () => (/* binding */ KeyValuePipe), /* harmony export */ "LOCATION_INITIALIZED": () => (/* binding */ LOCATION_INITIALIZED), @@ -17241,12 +15644,14 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "LowerCasePipe": () => (/* binding */ LowerCasePipe), /* harmony export */ "NgClass": () => (/* binding */ NgClass), /* harmony export */ "NgComponentOutlet": () => (/* binding */ NgComponentOutlet), +/* harmony export */ "NgFor": () => (/* binding */ NgForOf), /* harmony export */ "NgForOf": () => (/* binding */ NgForOf), /* harmony export */ "NgForOfContext": () => (/* binding */ NgForOfContext), /* harmony export */ "NgIf": () => (/* binding */ NgIf), /* harmony export */ "NgIfContext": () => (/* binding */ NgIfContext), /* harmony export */ "NgLocaleLocalization": () => (/* binding */ NgLocaleLocalization), /* harmony export */ "NgLocalization": () => (/* binding */ NgLocalization), +/* harmony export */ "NgOptimizedImage": () => (/* binding */ NgOptimizedImage), /* harmony export */ "NgPlural": () => (/* binding */ NgPlural), /* harmony export */ "NgPluralCase": () => (/* binding */ NgPluralCase), /* harmony export */ "NgStyle": () => (/* binding */ NgStyle), @@ -17256,6 +15661,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "NgTemplateOutlet": () => (/* binding */ NgTemplateOutlet), /* harmony export */ "NumberFormatStyle": () => (/* binding */ NumberFormatStyle), /* harmony export */ "NumberSymbol": () => (/* binding */ NumberSymbol), +/* harmony export */ "PRECONNECT_CHECK_BLOCKLIST": () => (/* binding */ PRECONNECT_CHECK_BLOCKLIST), /* harmony export */ "PathLocationStrategy": () => (/* binding */ PathLocationStrategy), /* harmony export */ "PercentPipe": () => (/* binding */ PercentPipe), /* harmony export */ "PlatformLocation": () => (/* binding */ PlatformLocation), @@ -17297,6 +15703,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "isPlatformServer": () => (/* binding */ isPlatformServer), /* harmony export */ "isPlatformWorkerApp": () => (/* binding */ isPlatformWorkerApp), /* harmony export */ "isPlatformWorkerUi": () => (/* binding */ isPlatformWorkerUi), +/* harmony export */ "provideCloudflareLoader": () => (/* binding */ provideCloudflareLoader), +/* harmony export */ "provideCloudinaryLoader": () => (/* binding */ provideCloudinaryLoader), +/* harmony export */ "provideImageKitLoader": () => (/* binding */ provideImageKitLoader), +/* harmony export */ "provideImgixLoader": () => (/* binding */ provideImgixLoader), /* harmony export */ "registerLocaleData": () => (/* binding */ registerLocaleData), /* harmony export */ "ɵBrowserPlatformLocation": () => (/* binding */ BrowserPlatformLocation), /* harmony export */ "ɵDomAdapter": () => (/* binding */ DomAdapter), @@ -17311,53 +15721,30 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 2560); /** - * @license Angular v14.0.0 + * @license Angular v15.1.3 * (c) 2010-2022 Google LLC. https://angular.io/ * License: MIT */ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ let _DOM = null; - function getDOM() { return _DOM; } - -function setDOM(adapter) { - _DOM = adapter; -} - function setRootDomAdapter(adapter) { if (!_DOM) { _DOM = adapter; } } /* tslint:disable:requireParameterType */ - /** * Provides DOM operations in an environment-agnostic way. * * @security Tread carefully! Interacting with the DOM directly is dangerous and * can introduce XSS risks. */ - - class DomAdapter {} -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * A DI Token representing the main rendering context. In a browser this is the DOM Document. @@ -17367,16 +15754,7 @@ class DomAdapter {} * * @publicApi */ - - const DOCUMENT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('DocumentToken'); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * This class should not be used directly by an application developer. Instead, use @@ -17400,18 +15778,14 @@ const DOCUMENT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken(' * * @publicApi */ - class PlatformLocation { historyGo(relativePosition) { throw new Error('Not implemented'); } - } - PlatformLocation.ɵfac = function PlatformLocation_Factory(t) { return new (t || PlatformLocation)(); }; - PlatformLocation.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: PlatformLocation, factory: function () { @@ -17419,7 +15793,6 @@ PlatformLocation.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_ }, providedIn: 'platform' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PlatformLocation, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -17430,7 +15803,6 @@ PlatformLocation.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_ }] }], null, null); })(); - function useBrowserPlatformLocation() { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(BrowserPlatformLocation); } @@ -17440,117 +15812,88 @@ function useBrowserPlatformLocation() { * * @publicApi */ - - const LOCATION_INITIALIZED = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('Location Initialized'); /** * `PlatformLocation` encapsulates all of the direct calls to platform APIs. * This class should not be used directly by an application developer. Instead, use * {@link Location}. + * + * @publicApi */ - class BrowserPlatformLocation extends PlatformLocation { constructor(_doc) { super(); this._doc = _doc; - - this._init(); - } // This is moved to its own method so that `MockPlatformLocationStrategy` can overwrite it - - /** @internal */ - - - _init() { - this.location = window.location; + this._location = window.location; this._history = window.history; } - getBaseHrefFromDOM() { return getDOM().getBaseHref(this._doc); } - onPopState(fn) { const window = getDOM().getGlobalEventTarget(this._doc, 'window'); window.addEventListener('popstate', fn, false); return () => window.removeEventListener('popstate', fn); } - onHashChange(fn) { const window = getDOM().getGlobalEventTarget(this._doc, 'window'); window.addEventListener('hashchange', fn, false); return () => window.removeEventListener('hashchange', fn); } - get href() { - return this.location.href; + return this._location.href; } - get protocol() { - return this.location.protocol; + return this._location.protocol; } - get hostname() { - return this.location.hostname; + return this._location.hostname; } - get port() { - return this.location.port; + return this._location.port; } - get pathname() { - return this.location.pathname; + return this._location.pathname; } - get search() { - return this.location.search; + return this._location.search; } - get hash() { - return this.location.hash; + return this._location.hash; } - set pathname(newPath) { - this.location.pathname = newPath; + this._location.pathname = newPath; } - pushState(state, title, url) { if (supportsState()) { this._history.pushState(state, title, url); } else { - this.location.hash = url; + this._location.hash = url; } } - replaceState(state, title, url) { if (supportsState()) { this._history.replaceState(state, title, url); } else { - this.location.hash = url; + this._location.hash = url; } } - forward() { this._history.forward(); } - back() { this._history.back(); } - historyGo(relativePosition = 0) { this._history.go(relativePosition); } - getState() { return this._history.state; } - } - BrowserPlatformLocation.ɵfac = function BrowserPlatformLocation_Factory(t) { return new (t || BrowserPlatformLocation)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](DOCUMENT)); }; - BrowserPlatformLocation.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: BrowserPlatformLocation, factory: function () { @@ -17558,7 +15901,6 @@ BrowserPlatformLocation.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_ }, providedIn: 'platform' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](BrowserPlatformLocation, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -17577,29 +15919,12 @@ BrowserPlatformLocation.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_ }]; }, null); })(); - function supportsState() { return !!window.history.pushState; } - function createBrowserPlatformLocation() { return new BrowserPlatformLocation((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(DOCUMENT)); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Joins two parts of a URL with a slash if needed. @@ -17610,35 +15935,26 @@ function createBrowserPlatformLocation() { * * @returns The joined URL string. */ - - function joinWithSlash(start, end) { if (start.length == 0) { return end; } - if (end.length == 0) { return start; } - let slashes = 0; - if (start.endsWith('/')) { slashes++; } - if (end.startsWith('/')) { slashes++; } - if (slashes == 2) { return start + end.substring(1); } - if (slashes == 1) { return start + end; } - return start + '/' + end; } /** @@ -17650,8 +15966,6 @@ function joinWithSlash(start, end) { * * @returns The URL string, modified if needed. */ - - function stripTrailingSlash(url) { const match = url.match(/#|\?|$/); const pathEndIdx = match && match.index || url.length; @@ -17665,18 +15979,9 @@ function stripTrailingSlash(url) { * * @returns The normalized URL parameters string. */ - - function normalizeQueryParams(params) { return params && params[0] !== '?' ? '?' + params : params; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Enables the `Location` service to read route state from the browser's URL. @@ -17695,42 +16000,30 @@ function normalizeQueryParams(params) { * * @publicApi */ - - class LocationStrategy { historyGo(relativePosition) { throw new Error('Not implemented'); } - } - LocationStrategy.ɵfac = function LocationStrategy_Factory(t) { return new (t || LocationStrategy)(); }; - LocationStrategy.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: LocationStrategy, factory: function () { - return provideLocationStrategy(); + return (() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(PathLocationStrategy))(); }, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](LocationStrategy, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, args: [{ providedIn: 'root', - useFactory: provideLocationStrategy + useFactory: () => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(PathLocationStrategy) }] }], null, null); })(); - -function provideLocationStrategy() { - // See #23917 - const location = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(DOCUMENT).location; - return new PathLocationStrategy((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(PlatformLocation), location && location.origin || ''); -} /** * A predefined [DI token](guide/glossary#di-token) for the base href * to be used with the `PathLocationStrategy`. @@ -17754,8 +16047,6 @@ function provideLocationStrategy() { * * @publicApi */ - - const APP_BASE_HREF = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('appBaseHref'); /** * @description @@ -17764,8 +16055,8 @@ const APP_BASE_HREF = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionTo * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the * browser's URL. * - * If you're using `PathLocationStrategy`, you must provide a {@link APP_BASE_HREF} - * or add a `` element to the document. + * If you're using `PathLocationStrategy`, you may provide a {@link APP_BASE_HREF} + * or add a `` element to the document to override the default. * * For instance, if you provide an `APP_BASE_HREF` of `'/my/app/'` and call * `location.go('/foo')`, the browser's URL will become @@ -17788,92 +16079,68 @@ const APP_BASE_HREF = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionTo * * @publicApi */ - class PathLocationStrategy extends LocationStrategy { constructor(_platformLocation, href) { super(); this._platformLocation = _platformLocation; this._removeListenerFns = []; - - if (href == null) { - href = this._platformLocation.getBaseHrefFromDOM(); - } - - if (href == null) { - throw new Error(`No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.`); - } - - this._baseHref = href; + this._baseHref = href ?? this._platformLocation.getBaseHrefFromDOM() ?? (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DOCUMENT).location?.origin ?? ''; } /** @nodoc */ - - ngOnDestroy() { while (this._removeListenerFns.length) { this._removeListenerFns.pop()(); } } - onPopState(fn) { this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn)); } - getBaseHref() { return this._baseHref; } - prepareExternalUrl(internal) { return joinWithSlash(this._baseHref, internal); } - path(includeHash = false) { const pathname = this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search); const hash = this._platformLocation.hash; return hash && includeHash ? `${pathname}${hash}` : pathname; } - pushState(state, title, url, queryParams) { const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams)); - this._platformLocation.pushState(state, title, externalUrl); } - replaceState(state, title, url, queryParams) { const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams)); - this._platformLocation.replaceState(state, title, externalUrl); } - forward() { this._platformLocation.forward(); } - back() { this._platformLocation.back(); } - getState() { return this._platformLocation.getState(); } - historyGo(relativePosition = 0) { this._platformLocation.historyGo?.(relativePosition); } - } - PathLocationStrategy.ɵfac = function PathLocationStrategy_Factory(t) { return new (t || PathLocationStrategy)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](PlatformLocation), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](APP_BASE_HREF, 8)); }; - PathLocationStrategy.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: PathLocationStrategy, - factory: PathLocationStrategy.ɵfac + factory: PathLocationStrategy.ɵfac, + providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PathLocationStrategy, [{ - type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, + args: [{ + providedIn: 'root' + }] }], function () { return [{ type: PlatformLocation @@ -17888,13 +16155,6 @@ PathLocationStrategy.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MOD }]; }, null); })(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * @description @@ -17914,36 +16174,28 @@ PathLocationStrategy.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MOD * * @publicApi */ - - class HashLocationStrategy extends LocationStrategy { constructor(_platformLocation, _baseHref) { super(); this._platformLocation = _platformLocation; this._baseHref = ''; this._removeListenerFns = []; - if (_baseHref != null) { this._baseHref = _baseHref; } } /** @nodoc */ - - ngOnDestroy() { while (this._removeListenerFns.length) { this._removeListenerFns.pop()(); } } - onPopState(fn) { this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn)); } - getBaseHref() { return this._baseHref; } - path(includeHash = false) { // the hash value is always prefixed with a `#` // and if it is empty then it will stay empty @@ -17951,59 +16203,44 @@ class HashLocationStrategy extends LocationStrategy { if (path == null) path = '#'; return path.length > 0 ? path.substring(1) : path; } - prepareExternalUrl(internal) { const url = joinWithSlash(this._baseHref, internal); return url.length > 0 ? '#' + url : url; } - pushState(state, title, path, queryParams) { let url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)); - if (url.length == 0) { url = this._platformLocation.pathname; } - this._platformLocation.pushState(state, title, url); } - replaceState(state, title, path, queryParams) { let url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)); - if (url.length == 0) { url = this._platformLocation.pathname; } - this._platformLocation.replaceState(state, title, url); } - forward() { this._platformLocation.forward(); } - back() { this._platformLocation.back(); } - getState() { return this._platformLocation.getState(); } - historyGo(relativePosition = 0) { this._platformLocation.historyGo?.(relativePosition); } - } - HashLocationStrategy.ɵfac = function HashLocationStrategy_Factory(t) { return new (t || HashLocationStrategy)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](PlatformLocation), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](APP_BASE_HREF, 8)); }; - HashLocationStrategy.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: HashLocationStrategy, factory: HashLocationStrategy.ɵfac }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](HashLocationStrategy, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable @@ -18021,13 +16258,6 @@ HashLocationStrategy.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MOD }]; }, null); })(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * @description @@ -18057,24 +16287,23 @@ HashLocationStrategy.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MOD * * @publicApi */ - - class Location { constructor(locationStrategy) { /** @internal */ this._subject = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); /** @internal */ - this._urlChangeListeners = []; /** @internal */ - this._urlChangeSubscription = null; this._locationStrategy = locationStrategy; - - const browserBaseHref = this._locationStrategy.getBaseHref(); - - this._baseHref = stripTrailingSlash(_stripIndexHtml(browserBaseHref)); - + const baseHref = this._locationStrategy.getBaseHref(); + // Note: This class's interaction with base HREF does not fully follow the rules + // outlined in the spec https://www.freesoft.org/CIE/RFC/1808/18.htm. + // Instead of trying to fix individual bugs with more and more code, we should + // investigate using the URL constructor and providing the base as a second + // argument. + // https://developer.mozilla.org/en-US/docs/Web/API/URL/URL#parameters + this._basePath = _stripOrigin(stripTrailingSlash(_stripIndexHtml(baseHref))); this._locationStrategy.onPopState(ev => { this._subject.emit({ 'url': this.path(true), @@ -18085,8 +16314,6 @@ class Location { }); } /** @nodoc */ - - ngOnDestroy() { this._urlChangeSubscription?.unsubscribe(); this._urlChangeListeners = []; @@ -18100,8 +16327,6 @@ class Location { */ // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is // removed. - - path(includeHash = false) { return this.normalize(this._locationStrategy.path(includeHash)); } @@ -18109,8 +16334,6 @@ class Location { * Reports the current state of the location history. * @returns The current value of the `history.state` object. */ - - getState() { return this._locationStrategy.getState(); } @@ -18123,8 +16346,6 @@ class Location { * @returns True if the given URL path is equal to the current normalized path, false * otherwise. */ - - isCurrentPathEqualTo(path, query = '') { return this.path() == this.normalize(path + normalizeQueryParams(query)); } @@ -18135,10 +16356,8 @@ class Location { * * @returns The normalized URL string. */ - - normalize(url) { - return Location.stripTrailingSlash(_stripBaseHref(this._baseHref, _stripIndexHtml(url))); + return Location.stripTrailingSlash(_stripBasePath(this._basePath, _stripIndexHtml(url))); } /** * Normalizes an external URL path. @@ -18150,16 +16369,13 @@ class Location { * * @returns A normalized platform-specific URL. */ - - prepareExternalUrl(url) { if (url && url[0] !== '/') { url = '/' + url; } - return this._locationStrategy.prepareExternalUrl(url); - } // TODO: rename this method to pushState - + } + // TODO: rename this method to pushState /** * Changes the browser's URL to a normalized version of a given URL, and pushes a * new item onto the platform's history. @@ -18169,11 +16385,8 @@ class Location { * @param state Location history state. * */ - - go(path, query = '', state = null) { this._locationStrategy.pushState(state, '', path, query); - this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state); } /** @@ -18184,26 +16397,19 @@ class Location { * @param query Query parameters. * @param state Location history state. */ - - replaceState(path, query = '', state = null) { this._locationStrategy.replaceState(state, '', path, query); - this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state); } /** * Navigates forward in the platform's history. */ - - forward() { this._locationStrategy.forward(); } /** * Navigates back in the platform's history. */ - - back() { this._locationStrategy.back(); } @@ -18219,8 +16425,6 @@ class Location { * when `relativePosition` equals 0. * @see https://developer.mozilla.org/en-US/docs/Web/API/History_API#Moving_to_a_specific_point_in_history */ - - historyGo(relativePosition = 0) { this._locationStrategy.historyGo?.(relativePosition); } @@ -18231,22 +16435,16 @@ class Location { * @param fn The change handler function, which take a URL and a location history state. * @returns A function that, when executed, unregisters a URL change listener. */ - - onUrlChange(fn) { this._urlChangeListeners.push(fn); - if (!this._urlChangeSubscription) { this._urlChangeSubscription = this.subscribe(v => { this._notifyUrlChangeListeners(v.url, v.state); }); } - return () => { const fnIndex = this._urlChangeListeners.indexOf(fn); - this._urlChangeListeners.splice(fnIndex, 1); - if (this._urlChangeListeners.length === 0) { this._urlChangeSubscription?.unsubscribe(); this._urlChangeSubscription = null; @@ -18254,8 +16452,6 @@ class Location { }; } /** @internal */ - - _notifyUrlChangeListeners(url = '', state) { this._urlChangeListeners.forEach(fn => fn(url, state)); } @@ -18272,8 +16468,6 @@ class Location { * * @returns Subscribed events. */ - - subscribe(onNext, onThrow, onReturn) { return this._subject.subscribe({ next: onNext, @@ -18281,7 +16475,6 @@ class Location { complete: onReturn }); } - } /** * Normalizes URL parameters by prepending with `?` if needed. @@ -18290,8 +16483,6 @@ class Location { * * @returns The normalized URL parameters string. */ - - Location.normalizeQueryParams = normalizeQueryParams; /** * Joins two parts of a URL with a slash if needed. @@ -18302,7 +16493,6 @@ Location.normalizeQueryParams = normalizeQueryParams; * * @returns The joined URL string. */ - Location.joinWithSlash = joinWithSlash; /** * Removes a trailing slash from a URL string if needed. @@ -18313,13 +16503,10 @@ Location.joinWithSlash = joinWithSlash; * * @returns The URL string, modified if needed. */ - Location.stripTrailingSlash = stripTrailingSlash; - Location.ɵfac = function Location_Factory(t) { return new (t || Location)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](LocationStrategy)); }; - Location.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: Location, factory: function () { @@ -18327,7 +16514,6 @@ Location.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵ }, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](Location, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -18342,37 +16528,30 @@ Location.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵ }]; }, null); })(); - function createLocation() { return new Location((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(LocationStrategy)); } - -function _stripBaseHref(baseHref, url) { - return baseHref && url.startsWith(baseHref) ? url.substring(baseHref.length) : url; +function _stripBasePath(basePath, url) { + return basePath && new RegExp(`^${basePath}([/;?#]|$)`).test(url) ? url.substring(basePath.length) : url; } - function _stripIndexHtml(url) { return url.replace(/\/index.html$/, ''); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ +function _stripOrigin(baseHref) { + // DO NOT REFACTOR! Previously, this check looked like this: + // `/^(https?:)?\/\//.test(baseHref)`, but that resulted in + // syntactically incorrect code after Closure Compiler minification. + // This was likely caused by a bug in Closure Compiler, but + // for now, the check is rewritten to use `new RegExp` instead. + const isAbsoluteUrl = new RegExp('^(https?:)?//').test(baseHref); + if (isAbsoluteUrl) { + const [, pathname] = baseHref.split(/\/\/[^\/]+/); + return pathname; + } + return baseHref; +} /** @internal */ - - const CURRENCIES_EN = { "ADP": [undefined, undefined, 0], "AFN": [undefined, "؋", 0], @@ -18515,13 +16694,6 @@ const CURRENCIES_EN = { "ZMW": [undefined, "ZK"], "ZWD": [undefined, undefined, 0] }; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Format styles that can be used to represent numbers. @@ -18530,9 +16702,7 @@ const CURRENCIES_EN = { * * @publicApi */ - var NumberFormatStyle; - (function (NumberFormatStyle) { NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal"; NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent"; @@ -18548,10 +16718,7 @@ var NumberFormatStyle; * * @publicApi */ - - var Plural; - (function (Plural) { Plural[Plural["Zero"] = 0] = "Zero"; Plural[Plural["One"] = 1] = "One"; @@ -18569,10 +16736,7 @@ var Plural; * * @publicApi */ - - var FormStyle; - (function (FormStyle) { FormStyle[FormStyle["Format"] = 0] = "Format"; FormStyle[FormStyle["Standalone"] = 1] = "Standalone"; @@ -18584,21 +16748,15 @@ var FormStyle; * * @publicApi */ - - var TranslationWidth; - (function (TranslationWidth) { /** 1 character for `en-US`. For example: 'S' */ TranslationWidth[TranslationWidth["Narrow"] = 0] = "Narrow"; /** 3 characters for `en-US`. For example: 'Sun' */ - TranslationWidth[TranslationWidth["Abbreviated"] = 1] = "Abbreviated"; /** Full length for `en-US`. For example: "Sunday" */ - TranslationWidth[TranslationWidth["Wide"] = 2] = "Wide"; /** 2 characters for `en-US`, For example: "Su" */ - TranslationWidth[TranslationWidth["Short"] = 3] = "Short"; })(TranslationWidth || (TranslationWidth = {})); /** @@ -18612,10 +16770,7 @@ var TranslationWidth; * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview) * @publicApi */ - - var FormatWidth; - (function (FormatWidth) { /** * For `en-US`, 'M/d/yy, h:mm a'` @@ -18626,19 +16781,16 @@ var FormatWidth; * For `en-US`, `'MMM d, y, h:mm:ss a'` * (Example: `Jun 15, 2015, 9:03:01 AM`) */ - FormatWidth[FormatWidth["Medium"] = 1] = "Medium"; /** * For `en-US`, `'MMMM d, y, h:mm:ss a z'` * (Example: `June 15, 2015 at 9:03:01 AM GMT+1`) */ - FormatWidth[FormatWidth["Long"] = 2] = "Long"; /** * For `en-US`, `'EEEE, MMMM d, y, h:mm:ss a zzzz'` * (Example: `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00`) */ - FormatWidth[FormatWidth["Full"] = 3] = "Full"; })(FormatWidth || (FormatWidth = {})); /** @@ -18650,10 +16802,7 @@ var FormatWidth; * * @publicApi */ - - var NumberSymbol; - (function (NumberSymbol) { /** * Decimal separator. @@ -18666,79 +16815,66 @@ var NumberSymbol; * For `en-US`, the comma character. * Example: 2`,`345.67 */ - NumberSymbol[NumberSymbol["Group"] = 1] = "Group"; /** * List-item separator. * Example: "one, two, and three" */ - NumberSymbol[NumberSymbol["List"] = 2] = "List"; /** * Sign for percentage (out of 100). * Example: 23.4% */ - NumberSymbol[NumberSymbol["PercentSign"] = 3] = "PercentSign"; /** * Sign for positive numbers. * Example: +23 */ - NumberSymbol[NumberSymbol["PlusSign"] = 4] = "PlusSign"; /** * Sign for negative numbers. * Example: -23 */ - NumberSymbol[NumberSymbol["MinusSign"] = 5] = "MinusSign"; /** * Computer notation for exponential value (n times a power of 10). * Example: 1.2E3 */ - NumberSymbol[NumberSymbol["Exponential"] = 6] = "Exponential"; /** * Human-readable format of exponential. * Example: 1.2x103 */ - NumberSymbol[NumberSymbol["SuperscriptingExponent"] = 7] = "SuperscriptingExponent"; /** * Sign for permille (out of 1000). * Example: 23.4‰ */ - NumberSymbol[NumberSymbol["PerMille"] = 8] = "PerMille"; /** * Infinity, can be used with plus and minus. * Example: ∞, +∞, -∞ */ - NumberSymbol[NumberSymbol["Infinity"] = 9] = "Infinity"; /** * Not a number. * Example: NaN */ - NumberSymbol[NumberSymbol["NaN"] = 10] = "NaN"; /** * Symbol used between time units. * Example: 10:52 */ - NumberSymbol[NumberSymbol["TimeSeparator"] = 11] = "TimeSeparator"; /** * Decimal separator for currency values (fallback to `Decimal`). * Example: $2,345.67 */ - NumberSymbol[NumberSymbol["CurrencyDecimal"] = 12] = "CurrencyDecimal"; /** * Group separator for currency values (fallback to `Group`). * Example: $2,345.67 */ - NumberSymbol[NumberSymbol["CurrencyGroup"] = 13] = "CurrencyGroup"; })(NumberSymbol || (NumberSymbol = {})); /** @@ -18746,10 +16882,7 @@ var NumberSymbol; * * @publicApi */ - - var WeekDay; - (function (WeekDay) { WeekDay[WeekDay["Sunday"] = 0] = "Sunday"; WeekDay[WeekDay["Monday"] = 1] = "Monday"; @@ -18768,8 +16901,6 @@ var WeekDay; * * @publicApi */ - - function getLocaleId(locale) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].LocaleId]; } @@ -18784,8 +16915,6 @@ function getLocaleId(locale) { * * @publicApi */ - - function getLocaleDayPeriods(locale, formStyle, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); const amPmData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DayPeriodsFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DayPeriodsStandalone]]; @@ -18804,8 +16933,6 @@ function getLocaleDayPeriods(locale, formStyle, width) { * * @publicApi */ - - function getLocaleDayNames(locale, formStyle, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); const daysData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DaysFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DaysStandalone]]; @@ -18824,8 +16951,6 @@ function getLocaleDayNames(locale, formStyle, width) { * * @publicApi */ - - function getLocaleMonthNames(locale, formStyle, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); const monthsData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].MonthsFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].MonthsStandalone]]; @@ -18843,8 +16968,6 @@ function getLocaleMonthNames(locale, formStyle, width) { * * @publicApi */ - - function getLocaleEraNames(locale, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); const erasData = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Eras]; @@ -18861,8 +16984,6 @@ function getLocaleEraNames(locale, width) { * * @publicApi */ - - function getLocaleFirstDayOfWeek(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].FirstDayOfWeek]; @@ -18876,25 +16997,21 @@ function getLocaleFirstDayOfWeek(locale) { * * @publicApi */ - - function getLocaleWeekEndRange(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].WeekendRange]; } /** - * Retrieves a localized date-value formating string. + * Retrieves a localized date-value formatting string. * * @param locale A locale code for the locale format rules to use. * @param width The format type. - * @returns The localized formating string. + * @returns The localized formatting string. * @see `FormatWidth` * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview) * * @publicApi */ - - function getLocaleDateFormat(locale, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); return getLastDefinedValue(data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DateFormat], width); @@ -18910,8 +17027,6 @@ function getLocaleDateFormat(locale, width) { * @publicApi */ - - function getLocaleTimeFormat(locale, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); return getLastDefinedValue(data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].TimeFormat], width); @@ -18927,8 +17042,6 @@ function getLocaleTimeFormat(locale, width) { * * @publicApi */ - - function getLocaleDateTimeFormat(locale, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); const dateTimeFormatData = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DateTimeFormat]; @@ -18944,12 +17057,9 @@ function getLocaleDateTimeFormat(locale, width) { * * @publicApi */ - - function getLocaleNumberSymbol(locale, symbol) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); const res = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberSymbols][symbol]; - if (typeof res === 'undefined') { if (symbol === NumberSymbol.CurrencyDecimal) { return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberSymbols][NumberSymbol.Decimal]; @@ -18957,7 +17067,6 @@ function getLocaleNumberSymbol(locale, symbol) { return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberSymbols][NumberSymbol.Group]; } } - return res; } /** @@ -18995,8 +17104,6 @@ function getLocaleNumberSymbol(locale, symbol) { * * @publicApi */ - - function getLocaleNumberFormat(locale, type) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberFormats][type]; @@ -19012,8 +17119,6 @@ function getLocaleNumberFormat(locale, type) { * * @publicApi */ - - function getLocaleCurrencySymbol(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].CurrencySymbol] || null; @@ -19028,8 +17133,6 @@ function getLocaleCurrencySymbol(locale) { * * @publicApi */ - - function getLocaleCurrencyName(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].CurrencyName] || null; @@ -19044,8 +17147,6 @@ function getLocaleCurrencyName(locale) { * * @publicApi */ - - function getLocaleCurrencyCode(locale) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵgetLocaleCurrencyCode"])(locale); } @@ -19055,8 +17156,6 @@ function getLocaleCurrencyCode(locale) { * @returns The currency values. * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview) */ - - function getLocaleCurrencies(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Currencies]; @@ -19065,10 +17164,7 @@ function getLocaleCurrencies(locale) { * @alias core/ɵgetLocalePluralCase * @publicApi */ - - const getLocalePluralCase = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵgetLocalePluralCase"]; - function checkFullData(data) { if (!data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData]) { throw new Error(`Missing extra locale data for the locale "${data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`); @@ -19096,19 +17192,14 @@ function checkFullData(data) { * * @publicApi */ - - function getLocaleExtraDayPeriodRules(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); checkFullData(data); - const rules = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][2 - /* ɵExtraLocaleDataIndex.ExtraDayPeriodsRules */ - ] || []; + const rules = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][2 /* ɵExtraLocaleDataIndex.ExtraDayPeriodsRules */] || []; return rules.map(rule => { if (typeof rule === 'string') { return extractTime(rule); } - return [extractTime(rule[0]), extractTime(rule[1])]; }); } @@ -19129,16 +17220,11 @@ function getLocaleExtraDayPeriodRules(locale) { * * @publicApi */ - - function getLocaleExtraDayPeriods(locale, formStyle, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); checkFullData(data); - const dayPeriodsData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][0 - /* ɵExtraLocaleDataIndex.ExtraDayPeriodFormats */ - ], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][1 - /* ɵExtraLocaleDataIndex.ExtraDayPeriodStandalone */ - ]]; + const dayPeriodsData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][0 /* ɵExtraLocaleDataIndex.ExtraDayPeriodFormats */], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][1 /* ɵExtraLocaleDataIndex.ExtraDayPeriodStandalone */]]; + const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || []; return getLastDefinedValue(dayPeriods, width) || []; } @@ -19149,8 +17235,6 @@ function getLocaleExtraDayPeriods(locale, formStyle, width) { * @returns 'rtl' or 'ltr' * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview) */ - - function getLocaleDirection(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Directionality]; @@ -19168,22 +17252,17 @@ function getLocaleDirection(locale) { * * @publicApi */ - - function getLastDefinedValue(data, index) { for (let i = index; i > -1; i--) { if (typeof data[i] !== 'undefined') { return data[i]; } } - throw new Error('Locale data API: locale data undefined'); } /** * Extracts the hours and minutes from a string like "15:45" */ - - function extractTime(time) { const [h, m] = time.split(':'); return { @@ -19206,24 +17285,15 @@ function extractTime(time) { * * @publicApi */ - - function getCurrencySymbol(code, format, locale = 'en') { const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || []; - const symbolNarrow = currency[1 - /* ɵCurrencyIndex.SymbolNarrow */ - ]; - + const symbolNarrow = currency[1 /* ɵCurrencyIndex.SymbolNarrow */]; if (format === 'narrow' && typeof symbolNarrow === 'string') { return symbolNarrow; } - - return currency[0 - /* ɵCurrencyIndex.Symbol */ - ] || code; -} // Most currencies have cents, that's why the default is 2 - - + return currency[0 /* ɵCurrencyIndex.Symbol */] || code; +} +// Most currencies have cents, that's why the default is 2 const DEFAULT_NB_OF_CURRENCY_DIGITS = 2; /** * Reports the number of decimal digits for a given currency. @@ -19235,43 +17305,27 @@ const DEFAULT_NB_OF_CURRENCY_DIGITS = 2; * * @publicApi */ - function getNumberOfCurrencyDigits(code) { let digits; const currency = CURRENCIES_EN[code]; - if (currency) { - digits = currency[2 - /* ɵCurrencyIndex.NbOfDigits */ - ]; + digits = currency[2 /* ɵCurrencyIndex.NbOfDigits */]; } return typeof digits === 'number' ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - -const ISO8601_DATE_REGEX = /^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; // 1 2 3 4 5 6 7 8 9 10 11 - +const ISO8601_DATE_REGEX = /^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; +// 1 2 3 4 5 6 7 8 9 10 11 const NAMED_FORMATS = {}; const DATE_FORMATS_SPLIT = /((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/; var ZoneWidth; - (function (ZoneWidth) { ZoneWidth[ZoneWidth["Short"] = 0] = "Short"; ZoneWidth[ZoneWidth["ShortGMT"] = 1] = "ShortGMT"; ZoneWidth[ZoneWidth["Long"] = 2] = "Long"; ZoneWidth[ZoneWidth["Extended"] = 3] = "Extended"; })(ZoneWidth || (ZoneWidth = {})); - var DateType; - (function (DateType) { DateType[DateType["FullYear"] = 0] = "FullYear"; DateType[DateType["Month"] = 1] = "Month"; @@ -19282,9 +17336,7 @@ var DateType; DateType[DateType["FractionalSeconds"] = 6] = "FractionalSeconds"; DateType[DateType["Day"] = 7] = "Day"; })(DateType || (DateType = {})); - var TranslationType; - (function (TranslationType) { TranslationType[TranslationType["DayPeriods"] = 0] = "DayPeriods"; TranslationType[TranslationType["Days"] = 1] = "Days"; @@ -19312,40 +17364,31 @@ var TranslationType; * * @publicApi */ - - function formatDate(value, format, locale, timezone) { let date = toDate(value); const namedFormat = getNamedFormat(locale, format); format = namedFormat || format; let parts = []; let match; - while (format) { match = DATE_FORMATS_SPLIT.exec(format); - if (match) { parts = parts.concat(match.slice(1)); const part = parts.pop(); - if (!part) { break; } - format = part; } else { parts.push(format); break; } } - let dateTimezoneOffset = date.getTimezoneOffset(); - if (timezone) { dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset); date = convertTimezoneToLocal(date, timezone, true); } - let text = ''; parts.forEach(value => { const dateFormatter = getDateFormatter(value); @@ -19363,115 +17406,92 @@ function formatDate(value, format, locale, timezone) { * timezone. In the future we might want to change this to be midnight in UTC, but this would be a * considerable breaking change. */ - - function createDate(year, month, date) { // The `newDate` is set to midnight (UTC) on January 1st 1970. // - In PST this will be December 31st 1969 at 4pm. // - In GMT this will be January 1st 1970 at 1am. // Note that they even have different years, dates and months! - const newDate = new Date(0); // `setFullYear()` allows years like 0001 to be set correctly. This function does not + const newDate = new Date(0); + // `setFullYear()` allows years like 0001 to be set correctly. This function does not // change the internal time of the date. // Consider calling `setFullYear(2019, 8, 20)` (September 20, 2019). // - In PST this will now be September 20, 2019 at 4pm // - In GMT this will now be September 20, 2019 at 1am - - newDate.setFullYear(year, month, date); // We want the final date to be at local midnight, so we reset the time. + newDate.setFullYear(year, month, date); + // We want the final date to be at local midnight, so we reset the time. // - In PST this will now be September 20, 2019 at 12am // - In GMT this will now be September 20, 2019 at 12am - newDate.setHours(0, 0, 0); return newDate; } - function getNamedFormat(locale, format) { const localeId = getLocaleId(locale); NAMED_FORMATS[localeId] = NAMED_FORMATS[localeId] || {}; - if (NAMED_FORMATS[localeId][format]) { return NAMED_FORMATS[localeId][format]; } - let formatValue = ''; - switch (format) { case 'shortDate': formatValue = getLocaleDateFormat(locale, FormatWidth.Short); break; - case 'mediumDate': formatValue = getLocaleDateFormat(locale, FormatWidth.Medium); break; - case 'longDate': formatValue = getLocaleDateFormat(locale, FormatWidth.Long); break; - case 'fullDate': formatValue = getLocaleDateFormat(locale, FormatWidth.Full); break; - case 'shortTime': formatValue = getLocaleTimeFormat(locale, FormatWidth.Short); break; - case 'mediumTime': formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium); break; - case 'longTime': formatValue = getLocaleTimeFormat(locale, FormatWidth.Long); break; - case 'fullTime': formatValue = getLocaleTimeFormat(locale, FormatWidth.Full); break; - case 'short': const shortTime = getNamedFormat(locale, 'shortTime'); const shortDate = getNamedFormat(locale, 'shortDate'); formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]); break; - case 'medium': const mediumTime = getNamedFormat(locale, 'mediumTime'); const mediumDate = getNamedFormat(locale, 'mediumDate'); formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]); break; - case 'long': const longTime = getNamedFormat(locale, 'longTime'); const longDate = getNamedFormat(locale, 'longDate'); formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]); break; - case 'full': const fullTime = getNamedFormat(locale, 'fullTime'); const fullDate = getNamedFormat(locale, 'fullDate'); formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]); break; } - if (formatValue) { NAMED_FORMATS[localeId][format] = formatValue; } - return formatValue; } - function formatDateTime(str, opt_values) { if (opt_values) { str = str.replace(/\{([^}]+)}/g, function (match, key) { return opt_values != null && key in opt_values ? opt_values[key] : match; }); } - return str; } - function padNumber(num, digits, minusSign = '-', trim, negWrap) { let neg = ''; - if (num < 0 || negWrap && num <= 0) { if (negWrap) { num = -num + 1; @@ -19480,20 +17500,15 @@ function padNumber(num, digits, minusSign = '-', trim, negWrap) { neg = minusSign; } } - let strNum = String(num); - while (strNum.length < digits) { strNum = '0' + strNum; } - if (trim) { strNum = strNum.slice(strNum.length - digits); } - return neg + strNum; } - function formatFractionalSeconds(milliseconds, digits) { const strMs = padNumber(milliseconds, 3); return strMs.substring(0, digits); @@ -19501,16 +17516,12 @@ function formatFractionalSeconds(milliseconds, digits) { /** * Returns a date formatter that transforms a date into its locale digit representation */ - - function dateGetter(name, size, offset = 0, trim = false, negWrap = false) { return function (date, locale) { let part = getDatePart(name, date); - if (offset > 0 || part > -offset) { part += offset; } - if (name === DateType.Hours) { if (part === 0 && offset === -12) { part = 12; @@ -19518,38 +17529,28 @@ function dateGetter(name, size, offset = 0, trim = false, negWrap = false) { } else if (name === DateType.FractionalSeconds) { return formatFractionalSeconds(part, size); } - const localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign); return padNumber(part, size, localeMinus, trim, negWrap); }; } - function getDatePart(part, date) { switch (part) { case DateType.FullYear: return date.getFullYear(); - case DateType.Month: return date.getMonth(); - case DateType.Date: return date.getDate(); - case DateType.Hours: return date.getHours(); - case DateType.Minutes: return date.getMinutes(); - case DateType.Seconds: return date.getSeconds(); - case DateType.FractionalSeconds: return date.getMilliseconds(); - case DateType.Day: return date.getDay(); - default: throw new Error(`Unknown DateType value "${part}".`); } @@ -19557,8 +17558,6 @@ function getDatePart(part, date) { /** * Returns a date formatter that transforms a date into its locale string representation */ - - function dateStrGetter(name, width, form = FormStyle.Format, extended = false) { return function (date, locale) { return getDateTranslation(date, locale, name, width, form, extended); @@ -19567,20 +17566,15 @@ function dateStrGetter(name, width, form = FormStyle.Format, extended = false) { /** * Returns the locale translation of a date for a given form, type and width */ - - function getDateTranslation(date, locale, name, width, form, extended) { switch (name) { case TranslationType.Months: return getLocaleMonthNames(locale, form, width)[date.getMonth()]; - case TranslationType.Days: return getLocaleDayNames(locale, form, width)[date.getDay()]; - case TranslationType.DayPeriods: const currentHours = date.getHours(); const currentMinutes = date.getMinutes(); - if (extended) { const rules = getLocaleExtraDayPeriodRules(locale); const dayPeriods = getLocaleExtraDayPeriods(locale, form, width); @@ -19589,7 +17583,8 @@ function getDateTranslation(date, locale, name, width, form, extended) { // morning, afternoon, evening, night const [from, to] = rule; const afterFrom = currentHours >= from.hours && currentMinutes >= from.minutes; - const beforeTo = currentHours < to.hours || currentHours === to.hours && currentMinutes < to.minutes; // We must account for normal rules that span a period during the day (e.g. 6am-9am) + const beforeTo = currentHours < to.hours || currentHours === to.hours && currentMinutes < to.minutes; + // We must account for normal rules that span a period during the day (e.g. 6am-9am) // where `from` is less (earlier) than `to`. But also rules that span midnight (e.g. // 10pm - 5am) where `from` is greater (later!) than `to`. // @@ -19599,7 +17594,6 @@ function getDateTranslation(date, locale, name, width, form, extended) { // In the second case the current time must be EITHER after `from` OR before `to` // (e.g. 4am is before 5am but not after 10pm; and 11pm is not before 5am but it is // after 10pm). - if (from.hours < to.hours) { if (afterFrom && beforeTo) { return true; @@ -19613,21 +17607,16 @@ function getDateTranslation(date, locale, name, width, form, extended) { return true; } } - return false; }); - if (index !== -1) { return dayPeriods[index]; } - } // if no rules for the day periods, we use am/pm by default - - + } + // if no rules for the day periods, we use am/pm by default return getLocaleDayPeriods(locale, form, width)[currentHours < 12 ? 0 : 1]; - case TranslationType.Eras: return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1]; - default: // This default case is not needed by TypeScript compiler, as the switch is exhaustive. // However Closure Compiler does not understand that and reports an error in typed mode. @@ -19642,61 +17631,49 @@ function getDateTranslation(date, locale, name, width, form, extended) { * GMT format depending on the width (eg: short = +0430, short:GMT = GMT+4, long = GMT+04:30, * extended = +04:30) */ - - function timeZoneGetter(width) { return function (date, locale, offset) { const zone = -1 * offset; const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign); const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60); - switch (width) { case ZoneWidth.Short: return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + padNumber(Math.abs(zone % 60), 2, minusSign); - case ZoneWidth.ShortGMT: return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 1, minusSign); - case ZoneWidth.Long: return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign); - case ZoneWidth.Extended: if (offset === 0) { return 'Z'; } else { return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign); } - default: throw new Error(`Unknown zone width "${width}"`); } }; } - const JANUARY = 0; const THURSDAY = 4; - function getFirstThursdayOfYear(year) { const firstDayOfYear = createDate(year, JANUARY, 1).getDay(); return createDate(year, 0, 1 + (firstDayOfYear <= THURSDAY ? THURSDAY : THURSDAY + 7) - firstDayOfYear); } - function getThursdayThisWeek(datetime) { return createDate(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + (THURSDAY - datetime.getDay())); } - function weekGetter(size, monthBased = false) { return function (date, locale) { let result; - if (monthBased) { const nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1; const today = date.getDate(); result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7); } else { - const thisThurs = getThursdayThisWeek(date); // Some days of a year are part of next year according to ISO 8601. + const thisThurs = getThursdayThisWeek(date); + // Some days of a year are part of next year according to ISO 8601. // Compute the firstThurs from the year of this week's Thursday - const firstThurs = getFirstThursdayOfYear(thisThurs.getFullYear()); const diff = thisThurs.getTime() - firstThurs.getTime(); result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week @@ -19708,8 +17685,6 @@ function weekGetter(size, monthBased = false) { /** * Returns a date formatter that provides the week-numbering year for the input date. */ - - function weekNumberingYearGetter(size, trim = false) { return function (date, locale) { const thisThurs = getThursdayThisWeek(date); @@ -19717,19 +17692,16 @@ function weekNumberingYearGetter(size, trim = false) { return padNumber(weekNumberingYear, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim); }; } - -const DATE_FORMATS = {}; // Based on CLDR formats: +const DATE_FORMATS = {}; +// Based on CLDR formats: // See complete list: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table // See also explanations: http://cldr.unicode.org/translation/date-time // TODO(ocombe): support all missing cldr formats: U, Q, D, F, e, j, J, C, A, v, V, X, x - function getDateFormatter(format) { if (DATE_FORMATS[format]) { return DATE_FORMATS[format]; } - let formatter; - switch (format) { // Era name (AD/BC) case 'G': @@ -19737,292 +17709,233 @@ function getDateFormatter(format) { case 'GGG': formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Abbreviated); break; - case 'GGGG': formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Wide); break; - case 'GGGGG': formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Narrow); break; // 1 digit representation of the year, e.g. (AD 1 => 1, AD 199 => 199) - case 'y': formatter = dateGetter(DateType.FullYear, 1, 0, false, true); break; // 2 digit representation of the year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10) - case 'yy': formatter = dateGetter(DateType.FullYear, 2, 0, true, true); break; // 3 digit representation of the year, padded (000-999). (e.g. AD 2001 => 01, AD 2010 => 10) - case 'yyy': formatter = dateGetter(DateType.FullYear, 3, 0, false, true); break; // 4 digit representation of the year (e.g. AD 1 => 0001, AD 2010 => 2010) - case 'yyyy': formatter = dateGetter(DateType.FullYear, 4, 0, false, true); break; // 1 digit representation of the week-numbering year, e.g. (AD 1 => 1, AD 199 => 199) - case 'Y': formatter = weekNumberingYearGetter(1); break; // 2 digit representation of the week-numbering year, padded (00-99). (e.g. AD 2001 => 01, AD // 2010 => 10) - case 'YY': formatter = weekNumberingYearGetter(2, true); break; // 3 digit representation of the week-numbering year, padded (000-999). (e.g. AD 1 => 001, AD // 2010 => 2010) - case 'YYY': formatter = weekNumberingYearGetter(3); break; // 4 digit representation of the week-numbering year (e.g. AD 1 => 0001, AD 2010 => 2010) - case 'YYYY': formatter = weekNumberingYearGetter(4); break; // Month of the year (1-12), numeric - case 'M': case 'L': formatter = dateGetter(DateType.Month, 1, 1); break; - case 'MM': case 'LL': formatter = dateGetter(DateType.Month, 2, 1); break; // Month of the year (January, ...), string, format - case 'MMM': formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated); break; - case 'MMMM': formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Wide); break; - case 'MMMMM': formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Narrow); break; // Month of the year (January, ...), string, standalone - case 'LLL': formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated, FormStyle.Standalone); break; - case 'LLLL': formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Wide, FormStyle.Standalone); break; - case 'LLLLL': formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Narrow, FormStyle.Standalone); break; // Week of the year (1, ... 52) - case 'w': formatter = weekGetter(1); break; - case 'ww': formatter = weekGetter(2); break; // Week of the month (1, ...) - case 'W': formatter = weekGetter(1, true); break; // Day of the month (1-31) - case 'd': formatter = dateGetter(DateType.Date, 1); break; - case 'dd': formatter = dateGetter(DateType.Date, 2); break; // Day of the Week StandAlone (1, 1, Mon, Monday, M, Mo) - case 'c': case 'cc': formatter = dateGetter(DateType.Day, 1); break; - case 'ccc': formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated, FormStyle.Standalone); break; - case 'cccc': formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide, FormStyle.Standalone); break; - case 'ccccc': formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Narrow, FormStyle.Standalone); break; - case 'cccccc': formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short, FormStyle.Standalone); break; // Day of the Week - case 'E': case 'EE': case 'EEE': formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated); break; - case 'EEEE': formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide); break; - case 'EEEEE': formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Narrow); break; - case 'EEEEEE': formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short); break; // Generic period of the day (am-pm) - case 'a': case 'aa': case 'aaa': formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated); break; - case 'aaaa': formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide); break; - case 'aaaaa': formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow); break; // Extended period of the day (midnight, at night, ...), standalone - case 'b': case 'bb': case 'bbb': formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Standalone, true); break; - case 'bbbb': formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Standalone, true); break; - case 'bbbbb': formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Standalone, true); break; // Extended period of the day (midnight, night, ...), standalone - case 'B': case 'BB': case 'BBB': formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Format, true); break; - case 'BBBB': formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Format, true); break; - case 'BBBBB': formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Format, true); break; // Hour in AM/PM, (1-12) - case 'h': formatter = dateGetter(DateType.Hours, 1, -12); break; - case 'hh': formatter = dateGetter(DateType.Hours, 2, -12); break; // Hour of the day (0-23) - case 'H': formatter = dateGetter(DateType.Hours, 1); break; // Hour in day, padded (00-23) - case 'HH': formatter = dateGetter(DateType.Hours, 2); break; // Minute of the hour (0-59) - case 'm': formatter = dateGetter(DateType.Minutes, 1); break; - case 'mm': formatter = dateGetter(DateType.Minutes, 2); break; // Second of the minute (0-59) - case 's': formatter = dateGetter(DateType.Seconds, 1); break; - case 'ss': formatter = dateGetter(DateType.Seconds, 2); break; // Fractional second - case 'S': formatter = dateGetter(DateType.FractionalSeconds, 1); break; - case 'SS': formatter = dateGetter(DateType.FractionalSeconds, 2); break; - case 'SSS': formatter = dateGetter(DateType.FractionalSeconds, 3); break; // Timezone ISO8601 short format (-0430) - case 'Z': case 'ZZ': case 'ZZZ': formatter = timeZoneGetter(ZoneWidth.Short); break; // Timezone ISO8601 extended format (-04:30) - case 'ZZZZZ': formatter = timeZoneGetter(ZoneWidth.Extended); break; // Timezone GMT short format (GMT+4) - case 'O': case 'OO': - case 'OOO': // Should be location, but fallback to format O instead because we don't have the data yet - + case 'OOO': + // Should be location, but fallback to format O instead because we don't have the data yet case 'z': case 'zz': case 'zzz': formatter = timeZoneGetter(ZoneWidth.ShortGMT); break; // Timezone GMT long format (GMT+0430) - case 'OOOO': - case 'ZZZZ': // Should be location, but fallback to format O instead because we don't have the data yet - + case 'ZZZZ': + // Should be location, but fallback to format O instead because we don't have the data yet case 'zzzz': formatter = timeZoneGetter(ZoneWidth.Long); break; - default: return null; } - DATE_FORMATS[format] = formatter; return formatter; } - function timezoneToOffset(timezone, fallback) { // Support: IE 11 only, Edge 13-15+ // IE/Edge do not "understand" colon (`:`) in timezone @@ -20030,13 +17943,11 @@ function timezoneToOffset(timezone, fallback) { const requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000; return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset; } - function addDateMinutes(date, minutes) { date = new Date(date.getTime()); date.setMinutes(date.getMinutes() + minutes); return date; } - function convertTimezoneToLocal(date, timezone, reverse) { const reverseValue = reverse ? -1 : 1; const dateTimezoneOffset = date.getTimezoneOffset(); @@ -20055,20 +17966,15 @@ function convertTimezoneToLocal(date, timezone, reverse) { * * Throws if unable to convert to a date. */ - - function toDate(value) { if (isDate(value)) { return value; } - if (typeof value === 'number' && !isNaN(value)) { return new Date(value); } - if (typeof value === 'string') { value = value.trim(); - if (/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(value)) { /* For ISO Strings without time the day, month and year must be extracted from the ISO String before Date creation to avoid time offset and errors in the new Date. @@ -20080,71 +17986,52 @@ function toDate(value) { const [y, m = 1, d = 1] = value.split('-').map(val => +val); return createDate(y, m - 1, d); } - - const parsedNb = parseFloat(value); // any string that only contains numbers, like "1234" but not like "1234hello" - + const parsedNb = parseFloat(value); + // any string that only contains numbers, like "1234" but not like "1234hello" if (!isNaN(value - parsedNb)) { return new Date(parsedNb); } - let match; - if (match = value.match(ISO8601_DATE_REGEX)) { return isoStringToDate(match); } } - const date = new Date(value); - if (!isDate(date)) { throw new Error(`Unable to convert "${value}" into a date`); } - return date; } /** * Converts a date in ISO8601 to a Date. * Used instead of `Date.parse` because of browser discrepancies. */ - - function isoStringToDate(match) { const date = new Date(0); let tzHour = 0; - let tzMin = 0; // match[8] means that the string contains "Z" (UTC) or a timezone like "+01:00" or "+0100" - + let tzMin = 0; + // match[8] means that the string contains "Z" (UTC) or a timezone like "+01:00" or "+0100" const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear; - const timeSetter = match[8] ? date.setUTCHours : date.setHours; // if there is a timezone defined like "+01:00" or "+0100" - + const timeSetter = match[8] ? date.setUTCHours : date.setHours; + // if there is a timezone defined like "+01:00" or "+0100" if (match[9]) { tzHour = Number(match[9] + match[10]); tzMin = Number(match[9] + match[11]); } - dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3])); const h = Number(match[4] || 0) - tzHour; const m = Number(match[5] || 0) - tzMin; - const s = Number(match[6] || 0); // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11) + const s = Number(match[6] || 0); + // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11) // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms` // becomes `999ms`. - const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000); timeSetter.call(date, h, m, s, ms); return date; } - function isDate(value) { return value instanceof Date && !isNaN(value.valueOf()); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - const NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/; const MAX_DIGITS = 22; const DECIMAL_SEP = '.'; @@ -20157,106 +18044,85 @@ const PERCENT_CHAR = '%'; /** * Transforms a number to a locale string based on a style and a format. */ - function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent = false) { let formattedText = ''; let isZero = false; - if (!isFinite(value)) { formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity); } else { let parsedNumber = parseNumber(value); - if (isPercent) { parsedNumber = toPercent(parsedNumber); } - let minInt = pattern.minInt; let minFraction = pattern.minFrac; let maxFraction = pattern.maxFrac; - if (digitsInfo) { const parts = digitsInfo.match(NUMBER_FORMAT_REGEXP); - if (parts === null) { throw new Error(`${digitsInfo} is not a valid digit info`); } - const minIntPart = parts[1]; const minFractionPart = parts[3]; const maxFractionPart = parts[5]; - if (minIntPart != null) { minInt = parseIntAutoRadix(minIntPart); } - if (minFractionPart != null) { minFraction = parseIntAutoRadix(minFractionPart); } - if (maxFractionPart != null) { maxFraction = parseIntAutoRadix(maxFractionPart); } else if (minFractionPart != null && minFraction > maxFraction) { maxFraction = minFraction; } } - roundNumber(parsedNumber, minFraction, maxFraction); let digits = parsedNumber.digits; let integerLen = parsedNumber.integerLen; const exponent = parsedNumber.exponent; let decimals = []; - isZero = digits.every(d => !d); // pad zeros for small numbers - + isZero = digits.every(d => !d); + // pad zeros for small numbers for (; integerLen < minInt; integerLen++) { digits.unshift(0); - } // pad zeros for small numbers - - + } + // pad zeros for small numbers for (; integerLen < 0; integerLen++) { digits.unshift(0); - } // extract decimals digits - - + } + // extract decimals digits if (integerLen > 0) { decimals = digits.splice(integerLen, digits.length); } else { decimals = digits; digits = [0]; - } // format the integer digits with grouping separators - - + } + // format the integer digits with grouping separators const groups = []; - if (digits.length >= pattern.lgSize) { groups.unshift(digits.splice(-pattern.lgSize, digits.length).join('')); } - while (digits.length > pattern.gSize) { groups.unshift(digits.splice(-pattern.gSize, digits.length).join('')); } - if (digits.length) { groups.unshift(digits.join('')); } - - formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol)); // append the decimal digits - + formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol)); + // append the decimal digits if (decimals.length) { formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join(''); } - if (exponent) { formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + '+' + exponent; } } - if (value < 0 && !isZero) { formattedText = pattern.negPre + formattedText + pattern.negSuf; } else { formattedText = pattern.posPre + formattedText + pattern.posSuf; } - return formattedText; } /** @@ -20284,17 +18150,17 @@ function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimal * * @publicApi */ - - function formatCurrency(value, locale, currency, currencyCode, digitsInfo) { const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency); const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign)); pattern.minFrac = getNumberOfCurrencyDigits(currencyCode); pattern.maxFrac = pattern.minFrac; const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo); - return res.replace(CURRENCY_CHAR, currency) // if we have 2 time the currency character, the second one is ignored - .replace(CURRENCY_CHAR, '') // If there is a spacing between currency character and the value and - // the currency character is supressed by passing an empty string, the + return res.replace(CURRENCY_CHAR, currency) + // if we have 2 time the currency character, the second one is ignored + .replace(CURRENCY_CHAR, '') + // If there is a spacing between currency character and the value and + // the currency character is suppressed by passing an empty string, the // spacing character would remain as part of the string. Then we // should remove it. .trim(); @@ -20318,8 +18184,6 @@ function formatCurrency(value, locale, currency, currencyCode, digitsInfo) { * @publicApi * */ - - function formatPercent(value, locale, digitsInfo) { const format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent); const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign)); @@ -20343,14 +18207,11 @@ function formatPercent(value, locale, digitsInfo) { * * @publicApi */ - - function formatNumber(value, locale, digitsInfo) { const format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal); const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign)); return formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo); } - function parseNumberFormat(format, minusSign = '-') { const p = { minInt: 1, @@ -20367,13 +18228,11 @@ function parseNumberFormat(format, minusSign = '-') { const positive = patternParts[0]; const negative = patternParts[1]; const positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ? positive.split(DECIMAL_SEP) : [positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1), positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)], - integer = positiveParts[0], - fraction = positiveParts[1] || ''; + integer = positiveParts[0], + fraction = positiveParts[1] || ''; p.posPre = integer.substring(0, integer.indexOf(DIGIT_CHAR)); - for (let i = 0; i < fraction.length; i++) { const ch = fraction.charAt(i); - if (ch === ZERO_CHAR) { p.minFrac = p.maxFrac = i + 1; } else if (ch === DIGIT_CHAR) { @@ -20382,34 +18241,28 @@ function parseNumberFormat(format, minusSign = '-') { p.posSuf += ch; } } - const groups = integer.split(GROUP_SEP); p.gSize = groups[1] ? groups[1].length : 0; p.lgSize = groups[2] || groups[1] ? (groups[2] || groups[1]).length : 0; - if (negative) { const trunkLen = positive.length - p.posPre.length - p.posSuf.length, - pos = negative.indexOf(DIGIT_CHAR); + pos = negative.indexOf(DIGIT_CHAR); p.negPre = negative.substring(0, pos).replace(/'/g, ''); p.negSuf = negative.slice(pos + trunkLen).replace(/'/g, ''); } else { p.negPre = minusSign + p.posPre; p.negSuf = p.posSuf; } - return p; -} // Transforms a parsed number into a percentage by multiplying it by 100 - - +} +// Transforms a parsed number into a percentage by multiplying it by 100 function toPercent(parsedNumber) { // if the number is 0, don't do anything if (parsedNumber.digits[0] === 0) { return parsedNumber; - } // Getting the current number of decimals - - + } + // Getting the current number of decimals const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen; - if (parsedNumber.exponent) { parsedNumber.exponent += 2; } else { @@ -20418,30 +18271,25 @@ function toPercent(parsedNumber) { } else if (fractionLen === 1) { parsedNumber.digits.push(0); } - parsedNumber.integerLen += 2; } - return parsedNumber; } /** * Parses a number. * Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/ */ - - function parseNumber(num) { let numStr = Math.abs(num) + ''; let exponent = 0, - digits, - integerLen; - let i, j, zeros; // Decimal point? - + digits, + integerLen; + let i, j, zeros; + // Decimal point? if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) { numStr = numStr.replace(DECIMAL_SEP, ''); - } // Exponential form? - - + } + // Exponential form? if ((i = numStr.search(/e/i)) > 0) { // Work out the exponent. if (integerLen < 0) integerLen = i; @@ -20450,13 +18298,10 @@ function parseNumber(num) { } else if (integerLen < 0) { // There was no decimal point or exponent so it is an integer. integerLen = numStr.length; - } // Count the number of leading zeros. - - - for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { - /* empty */ } - + // Count the number of leading zeros. + for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {/* empty */ + } if (i === (zeros = numStr.length)) { // The digits are all zero. digits = [0]; @@ -20464,25 +18309,21 @@ function parseNumber(num) { } else { // Count the number of trailing zeros zeros--; - - while (numStr.charAt(zeros) === ZERO_CHAR) zeros--; // Trailing zeros are insignificant so ignore them - - + while (numStr.charAt(zeros) === ZERO_CHAR) zeros--; + // Trailing zeros are insignificant so ignore them integerLen -= i; - digits = []; // Convert string to array of digits without leading/trailing zeros. - + digits = []; + // Convert string to array of digits without leading/trailing zeros. for (j = 0; i <= zeros; i++, j++) { digits[j] = Number(numStr.charAt(i)); } - } // If the number overflows the maximum allowed digits then use an exponent. - - + } + // If the number overflows the maximum allowed digits then use an exponent. if (integerLen > MAX_DIGITS) { digits = digits.splice(0, MAX_DIGITS - 1); exponent = integerLen - 1; integerLen = 1; } - return { digits, exponent, @@ -20493,24 +18334,20 @@ function parseNumber(num) { * Round the parsed number to the specified number of decimal places * This function changes the parsedNumber in-place */ - - function roundNumber(parsedNumber, minFrac, maxFrac) { if (minFrac > maxFrac) { throw new Error(`The minimum number of digits after fraction (${minFrac}) is higher than the maximum (${maxFrac}).`); } - let digits = parsedNumber.digits; let fractionLen = digits.length - parsedNumber.integerLen; - const fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac); // The index of the digit to where rounding is to occur - + const fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac); + // The index of the digit to where rounding is to occur let roundAt = fractionSize + parsedNumber.integerLen; let digit = digits[roundAt]; - if (roundAt > 0) { // Drop fractional digits beyond `roundAt` - digits.splice(Math.max(parsedNumber.integerLen, roundAt)); // Set non-fractional digits beyond `roundAt` to 0 - + digits.splice(Math.max(parsedNumber.integerLen, roundAt)); + // Set non-fractional digits beyond `roundAt` to 0 for (let j = roundAt; j < digits.length; j++) { digits[j] = 0; } @@ -20520,36 +18357,30 @@ function roundNumber(parsedNumber, minFrac, maxFrac) { parsedNumber.integerLen = 1; digits.length = Math.max(1, roundAt = fractionSize + 1); digits[0] = 0; - for (let i = 1; i < roundAt; i++) digits[i] = 0; } - if (digit >= 5) { if (roundAt - 1 < 0) { for (let k = 0; k > roundAt; k--) { digits.unshift(0); parsedNumber.integerLen++; } - digits.unshift(1); parsedNumber.integerLen++; } else { digits[roundAt - 1]++; } - } // Pad out with zeros to get the required fraction length - - + } + // Pad out with zeros to get the required fraction length for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0); - - let dropTrailingZeros = fractionSize !== 0; // Minimal length = nb of decimals required + current nb of integers + let dropTrailingZeros = fractionSize !== 0; + // Minimal length = nb of decimals required + current nb of integers // Any number besides that is optional and can be removed if it's a trailing 0 - - const minLen = minFrac + parsedNumber.integerLen; // Do any carrying, e.g. a digit was rounded up to 10 - + const minLen = minFrac + parsedNumber.integerLen; + // Do any carrying, e.g. a digit was rounded up to 10 const carry = digits.reduceRight(function (carry, d, i, digits) { d = d + carry; digits[i] = d < 10 ? d : d - 10; // d % 10 - if (dropTrailingZeros) { // Do not keep meaningless fractional trailing zeros (e.g. 15.52000 --> 15.52) if (digits[i] === 0 && i >= minLen) { @@ -20558,60 +18389,41 @@ function roundNumber(parsedNumber, minFrac, maxFrac) { dropTrailingZeros = false; } } - return d >= 10 ? 1 : 0; // Math.floor(d / 10); }, 0); - if (carry) { digits.unshift(carry); parsedNumber.integerLen++; } } - function parseIntAutoRadix(text) { const result = parseInt(text); - if (isNaN(result)) { throw new Error('Invalid integer literal when parsing ' + text); } - return result; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * @publicApi */ - - class NgLocalization {} - NgLocalization.ɵfac = function NgLocalization_Factory(t) { return new (t || NgLocalization)(); }; - NgLocalization.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: NgLocalization, factory: function NgLocalization_Factory(t) { let r = null; - if (t) { r = new t(); } else { r = (locale => new NgLocaleLocalization(locale))(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID)); } - return r; }, providedIn: 'root' }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgLocalization, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, @@ -20627,25 +18439,18 @@ NgLocalization.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ * - "=value" when the case exists, * - the plural category otherwise */ - - function getPluralCategory(value, cases, ngLocalization, locale) { let key = `=${value}`; - if (cases.indexOf(key) > -1) { return key; } - key = ngLocalization.getPluralCategory(value, locale); - if (cases.indexOf(key) > -1) { return key; } - if (cases.indexOf('other') > -1) { return 'other'; } - throw new Error(`No plural message found for value "${value}"`); } /** @@ -20653,49 +18458,36 @@ function getPluralCategory(value, cases, ngLocalization, locale) { * * @publicApi */ - - class NgLocaleLocalization extends NgLocalization { constructor(locale) { super(); this.locale = locale; } - getPluralCategory(value, locale) { const plural = getLocalePluralCase(locale || this.locale)(value); - switch (plural) { case Plural.Zero: return 'zero'; - case Plural.One: return 'one'; - case Plural.Two: return 'two'; - case Plural.Few: return 'few'; - case Plural.Many: return 'many'; - default: return 'other'; } } - } - NgLocaleLocalization.ɵfac = function NgLocaleLocalization_Factory(t) { return new (t || NgLocaleLocalization)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID)); }; - NgLocaleLocalization.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: NgLocaleLocalization, factory: NgLocaleLocalization.ɵfac }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgLocaleLocalization, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable @@ -20709,13 +18501,6 @@ NgLocaleLocalization.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MOD }]; }, null); })(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Register global data to be used internally by Angular. See the @@ -20726,42 +18511,22 @@ NgLocaleLocalization.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MOD * * @publicApi */ - - function registerLocaleData(data, localeId, extraData) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵregisterLocaleData"])(data, localeId, extraData); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - function parseCookieValue(cookieStr, name) { name = encodeURIComponent(name); - for (const cookie of cookieStr.split(';')) { const eqIndex = cookie.indexOf('='); const [cookieName, cookieValue] = eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)]; - if (cookieName.trim() === name) { return decodeURIComponent(cookieValue); } } - return null; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - +const WS_REGEXP = /\s+/; +const EMPTY_ARRAY = []; /** * @ngModule CommonModule * @@ -20790,124 +18555,106 @@ function parseCookieValue(cookieStr, name) { * * @publicApi */ - - class NgClass { - constructor(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) { + constructor( + // leaving references to differs in place since flex layout is extending NgClass... + _iterableDiffers, _keyValueDiffers, _ngEl, _renderer) { this._iterableDiffers = _iterableDiffers; this._keyValueDiffers = _keyValueDiffers; this._ngEl = _ngEl; this._renderer = _renderer; - this._iterableDiffer = null; - this._keyValueDiffer = null; - this._initialClasses = []; - this._rawClass = null; + this.initialClasses = EMPTY_ARRAY; + this.stateMap = new Map(); } - set klass(value) { - this._removeClasses(this._initialClasses); - - this._initialClasses = typeof value === 'string' ? value.split(/\s+/) : []; - - this._applyClasses(this._initialClasses); - - this._applyClasses(this._rawClass); + this.initialClasses = value != null ? value.trim().split(WS_REGEXP) : EMPTY_ARRAY; } - set ngClass(value) { - this._removeClasses(this._rawClass); - - this._applyClasses(this._initialClasses); - - this._iterableDiffer = null; - this._keyValueDiffer = null; - this._rawClass = typeof value === 'string' ? value.split(/\s+/) : value; - - if (this._rawClass) { - if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisListLikeIterable"])(this._rawClass)) { - this._iterableDiffer = this._iterableDiffers.find(this._rawClass).create(); - } else { - this._keyValueDiffer = this._keyValueDiffers.find(this._rawClass).create(); - } - } - } - + this.rawClass = typeof value === 'string' ? value.trim().split(WS_REGEXP) : value; + } + /* + The NgClass directive uses the custom change detection algorithm for its inputs. The custom + algorithm is necessary since inputs are represented as complex object or arrays that need to be + deeply-compared. + This algorithm is perf-sensitive since NgClass is used very frequently and its poor performance + might negatively impact runtime performance of the entire change detection cycle. The design of + this algorithm is making sure that: + - there is no unnecessary DOM manipulation (CSS classes are added / removed from the DOM only when + needed), even if references to bound objects change; + - there is no memory allocation if nothing changes (even relatively modest memory allocation + during the change detection cycle can result in GC pauses for some of the CD cycles). + The algorithm works by iterating over the set of bound classes, staring with [class] binding and + then going over [ngClass] binding. For each CSS class name: + - check if it was seen before (this information is tracked in the state map) and if its value + changed; + - mark it as "touched" - names that are not marked are not present in the latest set of binding + and we can remove such class name from the internal data structures; + After iteration over all the CSS class names we've got data structure with all the information + necessary to synchronize changes to the DOM - it is enough to iterate over the state map, flush + changes to the DOM and reset internal data structures so those are ready for the next change + detection cycle. + */ ngDoCheck() { - if (this._iterableDiffer) { - const iterableChanges = this._iterableDiffer.diff(this._rawClass); - - if (iterableChanges) { - this._applyIterableChanges(iterableChanges); - } - } else if (this._keyValueDiffer) { - const keyValueChanges = this._keyValueDiffer.diff(this._rawClass); - - if (keyValueChanges) { - this._applyKeyValueChanges(keyValueChanges); - } + // classes from the [class] binding + for (const klass of this.initialClasses) { + this._updateState(klass, true); } - } - - _applyKeyValueChanges(changes) { - changes.forEachAddedItem(record => this._toggleClass(record.key, record.currentValue)); - changes.forEachChangedItem(record => this._toggleClass(record.key, record.currentValue)); - changes.forEachRemovedItem(record => { - if (record.previousValue) { - this._toggleClass(record.key, false); + // classes from the [ngClass] binding + const rawClass = this.rawClass; + if (Array.isArray(rawClass) || rawClass instanceof Set) { + for (const klass of rawClass) { + this._updateState(klass, true); } - }); - } - - _applyIterableChanges(changes) { - changes.forEachAddedItem(record => { - if (typeof record.item === 'string') { - this._toggleClass(record.item, true); - } else { - throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(record.item)}`); + } else if (rawClass != null) { + for (const klass of Object.keys(rawClass)) { + this._updateState(klass, Boolean(rawClass[klass])); } - }); - changes.forEachRemovedItem(record => this._toggleClass(record.item, false)); + } + this._applyStateDiff(); } - /** - * Applies a collection of CSS classes to the DOM element. - * - * For argument of type Set and Array CSS class names contained in those collections are always - * added. - * For argument of type Map CSS class name in the map's key is toggled based on the value (added - * for truthy and removed for falsy). - */ - - - _applyClasses(rawClassVal) { - if (rawClassVal) { - if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) { - rawClassVal.forEach(klass => this._toggleClass(klass, true)); - } else { - Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, !!rawClassVal[klass])); + _updateState(klass, nextEnabled) { + const state = this.stateMap.get(klass); + if (state !== undefined) { + if (state.enabled !== nextEnabled) { + state.changed = true; + state.enabled = nextEnabled; } + state.touched = true; + } else { + this.stateMap.set(klass, { + enabled: nextEnabled, + changed: true, + touched: true + }); } } - /** - * Removes a collection of CSS classes from the DOM element. This is mostly useful for cleanup - * purposes. - */ - - - _removeClasses(rawClassVal) { - if (rawClassVal) { - if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) { - rawClassVal.forEach(klass => this._toggleClass(klass, false)); - } else { - Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, false)); + _applyStateDiff() { + for (const stateEntry of this.stateMap) { + const klass = stateEntry[0]; + const state = stateEntry[1]; + if (state.changed) { + this._toggleClass(klass, state.enabled); + state.changed = false; + } else if (!state.touched) { + // A class that was previously active got removed from the new collection of classes - + // remove from the DOM as well. + if (state.enabled) { + this._toggleClass(klass, false); + } + this.stateMap.delete(klass); } + state.touched = false; } } - _toggleClass(klass, enabled) { + if (ngDevMode) { + if (typeof klass !== 'string') { + throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(klass)}`); + } + } klass = klass.trim(); - - if (klass) { - klass.split(/\s+/g).forEach(klass => { + if (klass.length > 0) { + klass.split(WS_REGEXP).forEach(klass => { if (enabled) { this._renderer.addClass(this._ngEl.nativeElement, klass); } else { @@ -20916,27 +18663,25 @@ class NgClass { }); } } - } - NgClass.ɵfac = function NgClass_Factory(t) { return new (t || NgClass)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.IterableDiffers), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.KeyValueDiffers), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2)); }; - NgClass.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgClass, selectors: [["", "ngClass", ""]], inputs: { klass: ["class", "klass"], ngClass: "ngClass" - } + }, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgClass, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ - selector: '[ngClass]' + selector: '[ngClass]', + standalone: true }] }], function () { return [{ @@ -20959,13 +18704,6 @@ NgClass.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵd }] }); })(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Instantiates a {@link Component} type and inserts its Host View into the current View. @@ -21026,15 +18764,12 @@ NgClass.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵd * @publicApi * @ngModule CommonModule */ - - class NgComponentOutlet { constructor(_viewContainerRef) { this._viewContainerRef = _viewContainerRef; + this.ngComponentOutlet = null; } /** @nodoc */ - - ngOnChanges(changes) { const { _viewContainerRef: viewContainerRef, @@ -21043,22 +18778,18 @@ class NgComponentOutlet { } = this; viewContainerRef.clear(); this._componentRef = undefined; - if (this.ngComponentOutlet) { const injector = this.ngComponentOutletInjector || viewContainerRef.parentInjector; - if (changes['ngComponentOutletNgModule'] || changes['ngComponentOutletNgModuleFactory']) { if (this._moduleRef) this._moduleRef.destroy(); - if (ngModule) { - this._moduleRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.createNgModuleRef)(ngModule, getParentInjector(injector)); + this._moduleRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.createNgModule)(ngModule, getParentInjector(injector)); } else if (ngModuleFactory) { this._moduleRef = ngModuleFactory.create(getParentInjector(injector)); } else { this._moduleRef = undefined; } } - this._componentRef = viewContainerRef.createComponent(this.ngComponentOutlet, { index: viewContainerRef.length, injector, @@ -21068,18 +18799,13 @@ class NgComponentOutlet { } } /** @nodoc */ - - ngOnDestroy() { if (this._moduleRef) this._moduleRef.destroy(); } - } - NgComponentOutlet.ɵfac = function NgComponentOutlet_Factory(t) { return new (t || NgComponentOutlet)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef)); }; - NgComponentOutlet.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgComponentOutlet, selectors: [["", "ngComponentOutlet", ""]], @@ -21090,14 +18816,15 @@ NgComponentOutlet.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_ ngComponentOutletNgModule: "ngComponentOutletNgModule", ngComponentOutletNgModuleFactory: "ngComponentOutletNgModuleFactory" }, + standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgComponentOutlet, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ - selector: '[ngComponentOutlet]' + selector: '[ngComponentOutlet]', + standalone: true }] }], function () { return [{ @@ -21120,26 +18847,16 @@ NgComponentOutlet.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }] }); -})(); // Helper function that returns an Injector instance of a parent NgModule. - - +})(); +// Helper function that returns an Injector instance of a parent NgModule. function getParentInjector(injector) { const parentNgModule = injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModuleRef); return parentNgModule.injector; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - +const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode; /** * @publicApi */ - - class NgForOfContext { constructor($implicit, ngForOf, index, count) { this.$implicit = $implicit; @@ -21147,23 +18864,18 @@ class NgForOfContext { this.index = index; this.count = count; } - get first() { return this.index === 0; } - get last() { return this.index === this.count - 1; } - get even() { return this.index % 2 === 0; } - get odd() { return !this.even; } - } /** * A [structural directive](guide/structural-directives) that renders @@ -21204,7 +18916,7 @@ class NgForOfContext { * on an element](guide/structural-directives#one-per-element). * If you want to iterate conditionally, for example, * put the `*ngIf` on a container element that wraps the `*ngFor` element. - * For futher discussion, see + * For further discussion, see * [Structural Directives](guide/structural-directives#one-per-element). * * @usageNotes @@ -21263,23 +18975,11 @@ class NgForOfContext { * @ngModule CommonModule * @publicApi */ - - class NgForOf { - constructor(_viewContainer, _template, _differs) { - this._viewContainer = _viewContainer; - this._template = _template; - this._differs = _differs; - this._ngForOf = null; - this._ngForOfDirty = true; - this._differ = null; - } /** * The value of the iterable expression, which can be used as a * [template input variable](guide/structural-directives#shorthand). */ - - set ngForOf(ngForOf) { this._ngForOf = ngForOf; this._ngForOfDirty = true; @@ -21302,28 +19002,27 @@ class NgForOf { * * @see `TrackByFunction` */ - - set ngForTrackBy(fn) { - if ((typeof ngDevMode === 'undefined' || ngDevMode) && fn != null && typeof fn !== 'function') { - // TODO(vicb): use a log service once there is a public one available - if (console && console.warn) { - console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}. ` + `See https://angular.io/api/common/NgForOf#change-propagation for more information.`); - } + if (NG_DEV_MODE && fn != null && typeof fn !== 'function') { + console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}. ` + `See https://angular.io/api/common/NgForOf#change-propagation for more information.`); } - this._trackByFn = fn; } - get ngForTrackBy() { return this._trackByFn; } + constructor(_viewContainer, _template, _differs) { + this._viewContainer = _viewContainer; + this._template = _template; + this._differs = _differs; + this._ngForOf = null; + this._ngForOfDirty = true; + this._differ = null; + } /** * A reference to the template that is stamped out for each item in the iterable. * @see [template reference variable](guide/template-reference-variables) */ - - set ngForTemplate(value) { // TODO(TS2.1): make TemplateRef>> once we move to TS v2.1 // The current type is too restrictive; a template that just uses index, for example, @@ -21336,22 +19035,23 @@ class NgForOf { * Applies the changes when needed. * @nodoc */ - - ngDoCheck() { if (this._ngForOfDirty) { - this._ngForOfDirty = false; // React on ngForOf changes only once all inputs have been initialized - + this._ngForOfDirty = false; + // React on ngForOf changes only once all inputs have been initialized const value = this._ngForOf; - if (!this._differ && value) { - if (typeof ngDevMode === 'undefined' || ngDevMode) { + if (NG_DEV_MODE) { try { // CAUTION: this logic is duplicated for production mode below, as the try-catch // is only present in development builds. this._differ = this._differs.find(value).create(this.ngForTrackBy); } catch { - throw new Error(`Cannot find a differ supporting object '${value}' of type '${getTypeName(value)}'. NgFor only supports binding to Iterables such as Arrays.`); + let errorMessage = `Cannot find a differ supporting object '${value}' of type '` + `${getTypeName(value)}'. NgFor only supports binding to Iterables, such as Arrays.`; + if (typeof value === 'object') { + errorMessage += ' Did you mean to use the keyvalue pipe?'; + } + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](-2200 /* RuntimeErrorCode.NG_FOR_MISSING_DIFFER */, errorMessage); } } else { // CAUTION: this logic is duplicated for development mode above, as the try-catch @@ -21360,14 +19060,11 @@ class NgForOf { } } } - if (this._differ) { const changes = this._differ.diff(this._ngForOf); - if (changes) this._applyChanges(changes); } } - _applyChanges(changes) { const viewContainer = this._viewContainer; changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => { @@ -21384,7 +19081,6 @@ class NgForOf { applyViewChange(view, item); } }); - for (let i = 0, ilen = viewContainer.length; i < ilen; i++) { const viewRef = viewContainer.get(i); const context = viewRef.context; @@ -21392,7 +19088,6 @@ class NgForOf { context.count = ilen; context.ngForOf = this._ngForOf; } - changes.forEachIdentityChange(record => { const viewRef = viewContainer.get(record.currentIndex); applyViewChange(viewRef, record); @@ -21404,18 +19099,13 @@ class NgForOf { * The presence of this method is a signal to the Ivy template type-check compiler that the * `NgForOf` structural directive renders its template with a specific context type. */ - - static ngTemplateContextGuard(dir, ctx) { return true; } - } - NgForOf.ɵfac = function NgForOf_Factory(t) { return new (t || NgForOf)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.IterableDiffers)); }; - NgForOf.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgForOf, selectors: [["", "ngFor", "", "ngForOf", ""]], @@ -21423,14 +19113,15 @@ NgForOf.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵd ngForOf: "ngForOf", ngForTrackBy: "ngForTrackBy", ngForTemplate: "ngForTemplate" - } + }, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgForOf, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ - selector: '[ngFor][ngForOf]' + selector: '[ngFor][ngForOf]', + standalone: true }] }], function () { return [{ @@ -21452,21 +19143,12 @@ NgForOf.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵd }] }); })(); - function applyViewChange(view, record) { view.context.$implicit = record.item; } - function getTypeName(type) { return type['name'] || typeof type; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * A structural directive that conditionally includes a template based on the value of @@ -21607,8 +19289,6 @@ function getTypeName(type) { * @ngModule CommonModule * @publicApi */ - - class NgIf { constructor(_viewContainer, templateRef) { this._viewContainer = _viewContainer; @@ -21622,45 +19302,33 @@ class NgIf { /** * The Boolean expression to evaluate as the condition for showing a template. */ - - set ngIf(condition) { this._context.$implicit = this._context.ngIf = condition; - this._updateView(); } /** * A template to show if the condition expression evaluates to true. */ - - set ngIfThen(templateRef) { assertTemplate('ngIfThen', templateRef); this._thenTemplateRef = templateRef; this._thenViewRef = null; // clear previous view if any. - this._updateView(); } /** * A template to show if the condition expression evaluates to false. */ - - set ngIfElse(templateRef) { assertTemplate('ngIfElse', templateRef); this._elseTemplateRef = templateRef; this._elseViewRef = null; // clear previous view if any. - this._updateView(); } - _updateView() { if (this._context.$implicit) { if (!this._thenViewRef) { this._viewContainer.clear(); - this._elseViewRef = null; - if (this._thenTemplateRef) { this._thenViewRef = this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context); } @@ -21668,9 +19336,7 @@ class NgIf { } else { if (!this._elseViewRef) { this._viewContainer.clear(); - this._thenViewRef = null; - if (this._elseTemplateRef) { this._elseViewRef = this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context); } @@ -21683,18 +19349,13 @@ class NgIf { * The presence of this method is a signal to the Ivy template type-check compiler that the * `NgIf` structural directive renders its template with a specific context type. */ - - static ngTemplateContextGuard(dir, ctx) { return true; } - } - NgIf.ɵfac = function NgIf_Factory(t) { return new (t || NgIf)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef)); }; - NgIf.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgIf, selectors: [["", "ngIf", ""]], @@ -21702,14 +19363,15 @@ NgIf.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefi ngIf: "ngIf", ngIfThen: "ngIfThen", ngIfElse: "ngIfElse" - } + }, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgIf, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ - selector: '[ngIf]' + selector: '[ngIf]', + standalone: true }] }], function () { return [{ @@ -21732,51 +19394,32 @@ NgIf.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefi /** * @publicApi */ - - class NgIfContext { constructor() { this.$implicit = null; this.ngIf = null; } - } - function assertTemplate(property, templateRef) { const isTemplateRefOrNull = !!(!templateRef || templateRef.createEmbeddedView); - if (!isTemplateRefOrNull) { throw new Error(`${property} must be a TemplateRef, but received '${(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(templateRef)}'.`); } } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - class SwitchView { constructor(_viewContainerRef, _templateRef) { this._viewContainerRef = _viewContainerRef; this._templateRef = _templateRef; this._created = false; } - create() { this._created = true; - this._viewContainerRef.createEmbeddedView(this._templateRef); } - destroy() { this._created = false; - this._viewContainerRef.clear(); } - enforceState(created) { if (created && !this._created) { this.create(); @@ -21784,7 +19427,6 @@ class SwitchView { this.destroy(); } } - } /** * @ngModule CommonModule @@ -21852,87 +19494,66 @@ class SwitchView { * @see [Structural Directives](guide/structural-directives) * */ - - class NgSwitch { constructor() { + this._defaultViews = []; this._defaultUsed = false; this._caseCount = 0; this._lastCaseCheckIndex = 0; this._lastCasesMatched = false; } - set ngSwitch(newValue) { this._ngSwitch = newValue; - if (this._caseCount === 0) { this._updateDefaultCases(true); } } /** @internal */ - - _addCase() { return this._caseCount++; } /** @internal */ - - _addDefault(view) { - if (!this._defaultViews) { - this._defaultViews = []; - } - this._defaultViews.push(view); } /** @internal */ - - _matchCase(value) { const matched = value == this._ngSwitch; this._lastCasesMatched = this._lastCasesMatched || matched; this._lastCaseCheckIndex++; - if (this._lastCaseCheckIndex === this._caseCount) { this._updateDefaultCases(!this._lastCasesMatched); - this._lastCaseCheckIndex = 0; this._lastCasesMatched = false; } - return matched; } - _updateDefaultCases(useDefault) { - if (this._defaultViews && useDefault !== this._defaultUsed) { + if (this._defaultViews.length > 0 && useDefault !== this._defaultUsed) { this._defaultUsed = useDefault; - - for (let i = 0; i < this._defaultViews.length; i++) { - const defaultView = this._defaultViews[i]; + for (const defaultView of this._defaultViews) { defaultView.enforceState(useDefault); } } } - } - NgSwitch.ɵfac = function NgSwitch_Factory(t) { return new (t || NgSwitch)(); }; - NgSwitch.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgSwitch, selectors: [["", "ngSwitch", ""]], inputs: { ngSwitch: "ngSwitch" - } + }, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgSwitch, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ - selector: '[ngSwitch]' + selector: '[ngSwitch]', + standalone: true }] }], null, { ngSwitch: [{ @@ -21973,49 +19594,40 @@ NgSwitch.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵ * @see `NgSwitchDefault` * */ - - class NgSwitchCase { constructor(viewContainer, templateRef, ngSwitch) { this.ngSwitch = ngSwitch; - if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) { throwNgSwitchProviderNotFoundError('ngSwitchCase', 'NgSwitchCase'); } - ngSwitch._addCase(); - this._view = new SwitchView(viewContainer, templateRef); } /** * Performs case matching. For internal use only. * @nodoc */ - - ngDoCheck() { this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase)); } - } - NgSwitchCase.ɵfac = function NgSwitchCase_Factory(t) { return new (t || NgSwitchCase)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgSwitch, 9)); }; - NgSwitchCase.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgSwitchCase, selectors: [["", "ngSwitchCase", ""]], inputs: { ngSwitchCase: "ngSwitchCase" - } + }, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgSwitchCase, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ - selector: '[ngSwitchCase]' + selector: '[ngSwitchCase]', + standalone: true }] }], function () { return [{ @@ -22050,33 +19662,28 @@ NgSwitchCase.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[" * @see `NgSwitchCase` * */ - - class NgSwitchDefault { constructor(viewContainer, templateRef, ngSwitch) { if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) { throwNgSwitchProviderNotFoundError('ngSwitchDefault', 'NgSwitchDefault'); } - ngSwitch._addDefault(new SwitchView(viewContainer, templateRef)); } - } - NgSwitchDefault.ɵfac = function NgSwitchDefault_Factory(t) { return new (t || NgSwitchDefault)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgSwitch, 9)); }; - NgSwitchDefault.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgSwitchDefault, - selectors: [["", "ngSwitchDefault", ""]] + selectors: [["", "ngSwitchDefault", ""]], + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgSwitchDefault, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ - selector: '[ngSwitchDefault]' + selector: '[ngSwitchDefault]', + standalone: true }] }], function () { return [{ @@ -22093,19 +19700,9 @@ NgSwitchDefault.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ }]; }, null); })(); - function throwNgSwitchProviderNotFoundError(attrName, directiveName) { - throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2000 - /* RuntimeErrorCode.PARENT_NG_SWITCH_NOT_FOUND */ - , `An element with the "${attrName}" attribute ` + `(matching the "${directiveName}" directive) must be located inside an element with the "ngSwitch" attribute ` + `(matching "NgSwitch" directive)`); + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2000 /* RuntimeErrorCode.PARENT_NG_SWITCH_NOT_FOUND */, `An element with the "${attrName}" attribute ` + `(matching the "${directiveName}" directive) must be located inside an element with the "ngSwitch" attribute ` + `(matching "NgSwitch" directive)`); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * @ngModule CommonModule @@ -22138,64 +19735,50 @@ function throwNgSwitchProviderNotFoundError(attrName, directiveName) { * * @publicApi */ - - class NgPlural { constructor(_localization) { this._localization = _localization; this._caseViews = {}; } - set ngPlural(value) { - this._switchValue = value; - - this._updateView(); + this._updateView(value); } - addCase(value, switchView) { this._caseViews[value] = switchView; } - - _updateView() { + _updateView(switchValue) { this._clearViews(); - const cases = Object.keys(this._caseViews); - const key = getPluralCategory(this._switchValue, cases, this._localization); - + const key = getPluralCategory(switchValue, cases, this._localization); this._activateView(this._caseViews[key]); } - _clearViews() { if (this._activeView) this._activeView.destroy(); } - _activateView(view) { if (view) { this._activeView = view; - this._activeView.create(); } } - } - NgPlural.ɵfac = function NgPlural_Factory(t) { return new (t || NgPlural)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgLocalization)); }; - NgPlural.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgPlural, selectors: [["", "ngPlural", ""]], inputs: { ngPlural: "ngPlural" - } + }, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgPlural, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ - selector: '[ngPlural]' + selector: '[ngPlural]', + standalone: true }] }], function () { return [{ @@ -22227,31 +19810,27 @@ NgPlural.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵ * * @publicApi */ - - class NgPluralCase { constructor(value, template, viewContainer, ngPlural) { this.value = value; const isANumber = !isNaN(Number(value)); ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template)); } - } - NgPluralCase.ɵfac = function NgPluralCase_Factory(t) { return new (t || NgPluralCase)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinjectAttribute"]('ngPluralCase'), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgPlural, 1)); }; - NgPluralCase.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgPluralCase, - selectors: [["", "ngPluralCase", ""]] + selectors: [["", "ngPluralCase", ""]], + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgPluralCase, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ - selector: '[ngPluralCase]' + selector: '[ngPluralCase]', + standalone: true }] }], function () { return [{ @@ -22272,13 +19851,6 @@ NgPluralCase.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[" }]; }, null); })(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * @ngModule CommonModule @@ -22316,8 +19888,6 @@ NgPluralCase.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[" * * @publicApi */ - - class NgStyle { constructor(_ngEl, _differs, _renderer) { this._ngEl = _ngEl; @@ -22326,61 +19896,52 @@ class NgStyle { this._ngStyle = null; this._differ = null; } - set ngStyle(values) { this._ngStyle = values; - if (!this._differ && values) { this._differ = this._differs.find(values).create(); } } - ngDoCheck() { if (this._differ) { const changes = this._differ.diff(this._ngStyle); - if (changes) { this._applyChanges(changes); } } } - _setStyle(nameAndUnit, value) { const [name, unit] = nameAndUnit.split('.'); - value = value != null && unit ? `${value}${unit}` : value; - + const flags = name.indexOf('-') === -1 ? undefined : _angular_core__WEBPACK_IMPORTED_MODULE_0__.RendererStyleFlags2.DashCase; if (value != null) { - this._renderer.setStyle(this._ngEl.nativeElement, name, value); + this._renderer.setStyle(this._ngEl.nativeElement, name, unit ? `${value}${unit}` : value, flags); } else { - this._renderer.removeStyle(this._ngEl.nativeElement, name); + this._renderer.removeStyle(this._ngEl.nativeElement, name, flags); } } - _applyChanges(changes) { changes.forEachRemovedItem(record => this._setStyle(record.key, null)); changes.forEachAddedItem(record => this._setStyle(record.key, record.currentValue)); changes.forEachChangedItem(record => this._setStyle(record.key, record.currentValue)); } - } - NgStyle.ɵfac = function NgStyle_Factory(t) { return new (t || NgStyle)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.KeyValueDiffers), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2)); }; - NgStyle.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgStyle, selectors: [["", "ngStyle", ""]], inputs: { ngStyle: "ngStyle" - } + }, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgStyle, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ - selector: '[ngStyle]' + selector: '[ngStyle]', + standalone: true }] }], function () { return [{ @@ -22397,13 +19958,6 @@ NgStyle.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵd }] }); })(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * @ngModule CommonModule @@ -22429,8 +19983,6 @@ NgStyle.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵd * * @publicApi */ - - class NgTemplateOutlet { constructor(_viewContainerRef) { this._viewContainerRef = _viewContainerRef; @@ -22441,28 +19993,21 @@ class NgTemplateOutlet { * declarations. * Using the key `$implicit` in the context object will set its value as default. */ - this.ngTemplateOutletContext = null; /** * A string defining the template reference and optionally the context object for the template. */ - this.ngTemplateOutlet = null; /** Injector to be used within the embedded view. */ - this.ngTemplateOutletInjector = null; } /** @nodoc */ - - ngOnChanges(changes) { if (changes['ngTemplateOutlet'] || changes['ngTemplateOutletInjector']) { const viewContainerRef = this._viewContainerRef; - if (this._viewRef) { viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef)); } - if (this.ngTemplateOutlet) { const { ngTemplateOutlet: template, @@ -22479,13 +20024,10 @@ class NgTemplateOutlet { this._viewRef.context = this.ngTemplateOutletContext; } } - } - NgTemplateOutlet.ɵfac = function NgTemplateOutlet_Factory(t) { return new (t || NgTemplateOutlet)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef)); }; - NgTemplateOutlet.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgTemplateOutlet, selectors: [["", "ngTemplateOutlet", ""]], @@ -22494,14 +20036,15 @@ NgTemplateOutlet.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0 ngTemplateOutlet: "ngTemplateOutlet", ngTemplateOutletInjector: "ngTemplateOutletInjector" }, + standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgTemplateOutlet, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ - selector: '[ngTemplateOutlet]' + selector: '[ngTemplateOutlet]', + standalone: true }] }], function () { return [{ @@ -22519,44 +20062,15 @@ NgTemplateOutlet.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0 }] }); })(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * A collection of Angular directives that are likely to be used in each and every Angular * application. */ - - const COMMON_DIRECTIVES = [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase]; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - function invalidPipeArgumentError(type, value) { - const errorMessage = typeof ngDevMode === 'undefined' || ngDevMode ? `InvalidPipeArgument: '${value}' for pipe '${(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(type)}'` : ''; - return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2100 - /* RuntimeErrorCode.INVALID_PIPE_ARGUMENT */ - , errorMessage); + return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2100 /* RuntimeErrorCode.INVALID_PIPE_ARGUMENT */, ngDevMode && `InvalidPipeArgument: '${value}' for pipe '${(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(type)}'`); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - class SubscribableStrategy { createSubscription(async, updateLatestValue) { return async.subscribe({ @@ -22566,32 +20080,19 @@ class SubscribableStrategy { } }); } - dispose(subscription) { subscription.unsubscribe(); } - - onDestroy(subscription) { - subscription.unsubscribe(); - } - } - class PromiseStrategy { createSubscription(async, updateLatestValue) { return async.then(updateLatestValue, e => { throw e; }); } - dispose(subscription) {} - - onDestroy(subscription) {} - } - const _promiseStrategy = new PromiseStrategy(); - const _subscribableStrategy = new SubscribableStrategy(); /** * @ngModule CommonModule @@ -22621,93 +20122,86 @@ const _subscribableStrategy = new SubscribableStrategy(); * * @publicApi */ - - class AsyncPipe { - constructor(_ref) { - this._ref = _ref; + constructor(ref) { this._latestValue = null; this._subscription = null; this._obj = null; this._strategy = null; + // Assign `ref` into `this._ref` manually instead of declaring `_ref` in the constructor + // parameter list, as the type of `this._ref` includes `null` unlike the type of `ref`. + this._ref = ref; } - ngOnDestroy() { if (this._subscription) { this._dispose(); } + // Clear the `ChangeDetectorRef` and its association with the view data, to mitigate + // potential memory leaks in Observables that could otherwise cause the view data to + // be retained. + // https://github.com/angular/angular/issues/17624 + this._ref = null; } - transform(obj) { if (!this._obj) { if (obj) { this._subscribe(obj); } - return this._latestValue; } - if (obj !== this._obj) { this._dispose(); - return this.transform(obj); } - return this._latestValue; } - _subscribe(obj) { this._obj = obj; this._strategy = this._selectStrategy(obj); this._subscription = this._strategy.createSubscription(obj, value => this._updateLatestValue(obj, value)); } - _selectStrategy(obj) { if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisPromise"])(obj)) { return _promiseStrategy; } - if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisSubscribable"])(obj)) { return _subscribableStrategy; } - throw invalidPipeArgumentError(AsyncPipe, obj); } - _dispose() { + // Note: `dispose` is only called if a subscription has been initialized before, indicating + // that `this._strategy` is also available. this._strategy.dispose(this._subscription); - this._latestValue = null; this._subscription = null; this._obj = null; } - _updateLatestValue(async, value) { if (async === this._obj) { this._latestValue = value; - + // Note: `this._ref` is only cleared in `ngOnDestroy` so is known to be available when a + // value is being updated. this._ref.markForCheck(); } } - } - AsyncPipe.ɵfac = function AsyncPipe_Factory(t) { return new (t || AsyncPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef, 16)); }; - AsyncPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "async", type: AsyncPipe, - pure: false + pure: false, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AsyncPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe, args: [{ name: 'async', - pure: false + pure: false, + standalone: true }] }], function () { return [{ @@ -22715,13 +20209,6 @@ AsyncPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵ }]; }, null); })(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Transforms text to all lower case. @@ -22738,39 +20225,34 @@ AsyncPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵ * @ngModule CommonModule * @publicApi */ - - class LowerCasePipe { transform(value) { if (value == null) return null; - if (typeof value !== 'string') { throw invalidPipeArgumentError(LowerCasePipe, value); } - return value.toLowerCase(); } - } - LowerCasePipe.ɵfac = function LowerCasePipe_Factory(t) { return new (t || LowerCasePipe)(); }; - LowerCasePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "lowercase", type: LowerCasePipe, - pure: true + pure: true, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](LowerCasePipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe, args: [{ - name: 'lowercase' + name: 'lowercase', + standalone: true }] }], null, null); -})(); // +})(); +// // Regex below matches any Unicode word and number compatible with ES5. In ES2018 the same result // can be achieved by using /[0-9\p{L}]\S*/gu and also known as Unicode Property Escapes // (https://2ality.com/2017/07/regexp-unicode-property-escapes.html). Since there is no @@ -22778,8 +20260,6 @@ LowerCasePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__ // to use already transpiled form. Example can be found here - // https://mothereff.in/regexpu#input=var+regex+%3D+%2F%5B0-9%5Cp%7BL%7D%5D%5CS*%2Fgu%3B%0A%0A&unicodePropertyEscape=1 // - - const unicodeWordMatch = /(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g; /** * Transforms text to title case. @@ -22798,35 +20278,30 @@ const unicodeWordMatch = /(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1 * @ngModule CommonModule * @publicApi */ - class TitleCasePipe { transform(value) { if (value == null) return null; - if (typeof value !== 'string') { throw invalidPipeArgumentError(TitleCasePipe, value); } - return value.replace(unicodeWordMatch, txt => txt[0].toUpperCase() + txt.slice(1).toLowerCase()); } - } - TitleCasePipe.ɵfac = function TitleCasePipe_Factory(t) { return new (t || TitleCasePipe)(); }; - TitleCasePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "titlecase", type: TitleCasePipe, - pure: true + pure: true, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TitleCasePipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe, args: [{ - name: 'titlecase' + name: 'titlecase', + standalone: true }] }], null, null); })(); @@ -22838,55 +20313,80 @@ TitleCasePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__ * @ngModule CommonModule * @publicApi */ - - class UpperCasePipe { transform(value) { if (value == null) return null; - if (typeof value !== 'string') { throw invalidPipeArgumentError(UpperCasePipe, value); } - return value.toUpperCase(); } - } - UpperCasePipe.ɵfac = function UpperCasePipe_Factory(t) { return new (t || UpperCasePipe)(); }; - UpperCasePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "uppercase", type: UpperCasePipe, - pure: true + pure: true, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](UpperCasePipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe, args: [{ - name: 'uppercase' + name: 'uppercase', + standalone: true }] }], null, null); })(); + /** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license + * The default date format of Angular date pipe, which corresponds to the following format: + * `'MMM d,y'` (e.g. `Jun 15, 2015`) */ +const DEFAULT_DATE_FORMAT = 'mediumDate'; /** * Optionally-provided default timezone to use for all instances of `DatePipe` (such as `'+0430'`). * If the value isn't provided, the `DatePipe` will use the end-user's local system timezone. + * + * @deprecated use DATE_PIPE_DEFAULT_OPTIONS token to configure DatePipe */ - - -const DATE_PIPE_DEFAULT_TIMEZONE = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('DATE_PIPE_DEFAULT_TIMEZONE'); // clang-format off - +const DATE_PIPE_DEFAULT_TIMEZONE = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('DATE_PIPE_DEFAULT_TIMEZONE'); +/** + * DI token that allows to provide default configuration for the `DatePipe` instances in an + * application. The value is an object which can include the following fields: + * - `dateFormat`: configures the default date format. If not provided, the `DatePipe` + * will use the 'mediumDate' as a value. + * - `timezone`: configures the default timezone. If not provided, the `DatePipe` will + * use the end-user's local system timezone. + * + * @see `DatePipeConfig` + * + * @usageNotes + * + * Various date pipe default values can be overwritten by providing this token with + * the value that has this interface. + * + * For example: + * + * Override the default date format by providing a value using the token: + * ```typescript + * providers: [ + * {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {dateFormat: 'shortDate'}} + * ] + * ``` + * + * Override the default timezone by providing a value using the token: + * ```typescript + * providers: [ + * {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {timezone: '-1200'}} + * ] + * ``` + */ +const DATE_PIPE_DEFAULT_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('DATE_PIPE_DEFAULT_OPTIONS'); +// clang-format off /** * @ngModule CommonModule * @description @@ -22906,7 +20406,7 @@ const DATE_PIPE_DEFAULT_TIMEZONE = new _angular_core__WEBPACK_IMPORTED_MODULE_0_ * See the [I18n guide](guide/i18n-common-format-data-locale) for more information. * * The time zone of the formatted value can be specified either by passing it in as the second - * parameter of the pipe, or by setting the default through the `DATE_PIPE_DEFAULT_TIMEZONE` + * parameter of the pipe, or by setting the default through the `DATE_PIPE_DEFAULT_OPTIONS` * injection token. The value that is passed in as the second parameter takes precedence over * the one defined using the injection token. * @@ -23045,41 +20545,39 @@ const DATE_PIPE_DEFAULT_TIMEZONE = new _angular_core__WEBPACK_IMPORTED_MODULE_0_ * @publicApi */ // clang-format on - class DatePipe { - constructor(locale, defaultTimezone) { + constructor(locale, defaultTimezone, defaultOptions) { this.locale = locale; this.defaultTimezone = defaultTimezone; + this.defaultOptions = defaultOptions; } - - transform(value, format = 'mediumDate', timezone, locale) { + transform(value, format, timezone, locale) { if (value == null || value === '' || value !== value) return null; - try { - return formatDate(value, format, locale || this.locale, timezone ?? this.defaultTimezone ?? undefined); + const _format = format ?? this.defaultOptions?.dateFormat ?? DEFAULT_DATE_FORMAT; + const _timezone = timezone ?? this.defaultOptions?.timezone ?? this.defaultTimezone ?? undefined; + return formatDate(value, _format, locale || this.locale, _timezone); } catch (error) { throw invalidPipeArgumentError(DatePipe, error.message); } } - } - DatePipe.ɵfac = function DatePipe_Factory(t) { - return new (t || DatePipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID, 16), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](DATE_PIPE_DEFAULT_TIMEZONE, 24)); + return new (t || DatePipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID, 16), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](DATE_PIPE_DEFAULT_TIMEZONE, 24), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](DATE_PIPE_DEFAULT_OPTIONS, 24)); }; - DatePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "date", type: DatePipe, - pure: true + pure: true, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](DatePipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe, args: [{ name: 'date', - pure: true + pure: true, + standalone: true }] }], function () { return [{ @@ -23096,18 +20594,17 @@ DatePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵ }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional }] + }, { + type: undefined, + decorators: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject, + args: [DATE_PIPE_DEFAULT_OPTIONS] + }, { + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional + }] }]; }, null); })(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - const _INTERPOLATION_REGEXP = /#/g; /** * @ngModule CommonModule @@ -23123,7 +20620,6 @@ const _INTERPOLATION_REGEXP = /#/g; * * @publicApi */ - class I18nPluralPipe { constructor(_localization) { this._localization = _localization; @@ -23131,41 +20627,35 @@ class I18nPluralPipe { /** * @param value the number to be formatted * @param pluralMap an object that mimics the ICU format, see - * http://userguide.icu-project.org/formatparse/messages. + * https://unicode-org.github.io/icu/userguide/format_parse/messages/. * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by * default). */ - - transform(value, pluralMap, locale) { if (value == null) return ''; - if (typeof pluralMap !== 'object' || pluralMap === null) { throw invalidPipeArgumentError(I18nPluralPipe, pluralMap); } - const key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale); return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString()); } - } - I18nPluralPipe.ɵfac = function I18nPluralPipe_Factory(t) { return new (t || I18nPluralPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgLocalization, 16)); }; - I18nPluralPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "i18nPlural", type: I18nPluralPipe, - pure: true + pure: true, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](I18nPluralPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe, args: [{ name: 'i18nPlural', - pure: true + pure: true, + standalone: true }] }], function () { return [{ @@ -23173,13 +20663,6 @@ I18nPluralPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ }]; }, null); })(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * @ngModule CommonModule @@ -23198,8 +20681,6 @@ I18nPluralPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ * * @publicApi */ - - class I18nSelectPipe { /** * @param value a string to be internationalized. @@ -23208,50 +20689,37 @@ class I18nSelectPipe { */ transform(value, mapping) { if (value == null) return ''; - if (typeof mapping !== 'object' || typeof value !== 'string') { throw invalidPipeArgumentError(I18nSelectPipe, mapping); } - if (mapping.hasOwnProperty(value)) { return mapping[value]; } - if (mapping.hasOwnProperty('other')) { return mapping['other']; } - return ''; } - } - I18nSelectPipe.ɵfac = function I18nSelectPipe_Factory(t) { return new (t || I18nSelectPipe)(); }; - I18nSelectPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "i18nSelect", type: I18nSelectPipe, - pure: true + pure: true, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](I18nSelectPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe, args: [{ name: 'i18nSelect', - pure: true + pure: true, + standalone: true }] }], null, null); })(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * @ngModule CommonModule @@ -23268,8 +20736,6 @@ I18nSelectPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_ * * @publicApi */ - - class JsonPipe { /** * @param value A value of any type to convert into a JSON-format string. @@ -23277,37 +20743,26 @@ class JsonPipe { transform(value) { return JSON.stringify(value, null, 2); } - } - JsonPipe.ɵfac = function JsonPipe_Factory(t) { return new (t || JsonPipe)(); }; - JsonPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "json", type: JsonPipe, - pure: false + pure: false, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](JsonPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe, args: [{ name: 'json', - pure: false + pure: false, + standalone: true }] }], null, null); })(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - function makeKeyValuePair(key, value) { return { key: key, @@ -23334,61 +20789,51 @@ function makeKeyValuePair(key, value) { * * @publicApi */ - - class KeyValuePipe { constructor(differs) { this.differs = differs; this.keyValues = []; this.compareFn = defaultComparator; } - transform(input, compareFn = defaultComparator) { if (!input || !(input instanceof Map) && typeof input !== 'object') { return null; } - if (!this.differ) { // make a differ for whatever type we've been passed in this.differ = this.differs.find(input).create(); } - const differChanges = this.differ.diff(input); const compareFnChanged = compareFn !== this.compareFn; - if (differChanges) { this.keyValues = []; differChanges.forEachItem(r => { this.keyValues.push(makeKeyValuePair(r.key, r.currentValue)); }); } - if (differChanges || compareFnChanged) { this.keyValues.sort(compareFn); this.compareFn = compareFn; } - return this.keyValues; } - } - KeyValuePipe.ɵfac = function KeyValuePipe_Factory(t) { return new (t || KeyValuePipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.KeyValueDiffers, 16)); }; - KeyValuePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "keyvalue", type: KeyValuePipe, - pure: false + pure: false, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](KeyValuePipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe, args: [{ name: 'keyvalue', - pure: false + pure: false, + standalone: true }] }], function () { return [{ @@ -23396,43 +20841,31 @@ KeyValuePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[ }]; }, null); })(); - function defaultComparator(keyValueA, keyValueB) { const a = keyValueA.key; - const b = keyValueB.key; // if same exit with 0; - - if (a === b) return 0; // make sure that undefined are at the end of the sort. - + const b = keyValueB.key; + // if same exit with 0; + if (a === b) return 0; + // make sure that undefined are at the end of the sort. if (a === undefined) return 1; - if (b === undefined) return -1; // make sure that nulls are at the end of the sort. - + if (b === undefined) return -1; + // make sure that nulls are at the end of the sort. if (a === null) return 1; if (b === null) return -1; - if (typeof a == 'string' && typeof b == 'string') { return a < b ? -1 : 1; } - if (typeof a == 'number' && typeof b == 'number') { return a - b; } - if (typeof a == 'boolean' && typeof b == 'boolean') { return a < b ? -1 : 1; - } // `a` and `b` are of different types. Compare their string values. - - + } + // `a` and `b` are of different types. Compare their string values. const aString = String(a); const bString = String(b); return aString == bString ? 0 : aString < bString ? -1 : 1; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * @ngModule CommonModule @@ -23497,8 +20930,6 @@ function defaultComparator(keyValueA, keyValueB) { * * @publicApi */ - - class DecimalPipe { constructor(_locale) { this._locale = _locale; @@ -23510,12 +20941,9 @@ class DecimalPipe { * @param locale Specifies what locale format rules to use. * [See more](#locale). */ - - transform(value, digitsInfo, locale) { if (!isValue(value)) return null; locale = locale || this._locale; - try { const num = strToNumber(value); return formatNumber(num, locale, digitsInfo); @@ -23523,24 +20951,22 @@ class DecimalPipe { throw invalidPipeArgumentError(DecimalPipe, error.message); } } - } - DecimalPipe.ɵfac = function DecimalPipe_Factory(t) { return new (t || DecimalPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID, 16)); }; - DecimalPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "number", type: DecimalPipe, - pure: true + pure: true, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](DecimalPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe, args: [{ - name: 'number' + name: 'number', + standalone: true }] }], function () { return [{ @@ -23572,8 +20998,6 @@ DecimalPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[" * * @publicApi */ - - class PercentPipe { constructor(_locale) { this._locale = _locale; @@ -23594,12 +21018,9 @@ class PercentPipe { * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default. * See [Setting your app locale](guide/i18n-common-locale-id). */ - - transform(value, digitsInfo, locale) { if (!isValue(value)) return null; locale = locale || this._locale; - try { const num = strToNumber(value); return formatPercent(num, locale, digitsInfo); @@ -23607,24 +21028,22 @@ class PercentPipe { throw invalidPipeArgumentError(PercentPipe, error.message); } } - } - PercentPipe.ɵfac = function PercentPipe_Factory(t) { return new (t || PercentPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID, 16)); }; - PercentPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "percent", type: PercentPipe, - pure: true + pure: true, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PercentPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe, args: [{ - name: 'percent' + name: 'percent', + standalone: true }] }], function () { return [{ @@ -23644,25 +21063,6 @@ PercentPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[" * that determine group sizing and separator, decimal-point character, * and other locale-specific configurations. * - * {@a currency-code-deprecation} - *
- * - * **Deprecation notice:** - * - * The default currency code is currently always `USD` but this is deprecated from v9. - * - * **In v11 the default currency code will be taken from the current locale identified by - * the `LOCALE_ID` token. See the [i18n guide](guide/i18n-common-locale-id) for - * more information.** - * - * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in - * your application `NgModule`: - * - * ```ts - * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'} - * ``` - * - *
* * @see `getCurrencySymbol()` * @see `formatCurrency()` @@ -23676,8 +21076,6 @@ PercentPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[" * * @publicApi */ - - class CurrencyPipe { constructor(_locale, _defaultCurrencyCode = 'USD') { this._locale = _locale; @@ -23716,22 +21114,16 @@ class CurrencyPipe { * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default. * See [Setting your app locale](guide/i18n-common-locale-id). */ - - transform(value, currencyCode = this._defaultCurrencyCode, display = 'symbol', digitsInfo, locale) { if (!isValue(value)) return null; locale = locale || this._locale; - if (typeof display === 'boolean') { if ((typeof ngDevMode === 'undefined' || ngDevMode) && console && console.warn) { console.warn(`Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are "code", "symbol" or "symbol-narrow".`); } - display = display ? 'symbol' : 'code'; } - let currency = currencyCode || this._defaultCurrencyCode; - if (display !== 'code') { if (display === 'symbol' || display === 'symbol-narrow') { currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow', locale); @@ -23739,7 +21131,6 @@ class CurrencyPipe { currency = display; } } - try { const num = strToNumber(value); return formatCurrency(num, locale, currency, currencyCode, digitsInfo); @@ -23747,24 +21138,22 @@ class CurrencyPipe { throw invalidPipeArgumentError(CurrencyPipe, error.message); } } - } - CurrencyPipe.ɵfac = function CurrencyPipe_Factory(t) { return new (t || CurrencyPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID, 16), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_CURRENCY_CODE, 16)); }; - CurrencyPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "currency", type: CurrencyPipe, - pure: true + pure: true, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CurrencyPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe, args: [{ - name: 'currency' + name: 'currency', + standalone: true }] }], function () { return [{ @@ -23782,34 +21171,22 @@ CurrencyPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__[ }]; }, null); })(); - function isValue(value) { return !(value == null || value === '' || value !== value); } /** * Transforms a string into a number (if needed). */ - - function strToNumber(value) { // Convert strings to numbers if (typeof value === 'string' && !isNaN(Number(value) - parseFloat(value))) { return Number(value); } - if (typeof value !== 'number') { throw new Error(`${value} is not a number`); } - return value; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * @ngModule CommonModule @@ -23846,111 +21223,75 @@ function strToNumber(value) { * * @publicApi */ - - class SlicePipe { transform(value, start, end) { if (value == null) return null; - if (!this.supports(value)) { throw invalidPipeArgumentError(SlicePipe, value); } - return value.slice(start, end); } - supports(obj) { return typeof obj === 'string' || Array.isArray(obj); } - } - SlicePipe.ɵfac = function SlicePipe_Factory(t) { return new (t || SlicePipe)(); }; - SlicePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "slice", type: SlicePipe, - pure: false + pure: false, + standalone: true }); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](SlicePipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe, args: [{ name: 'slice', - pure: false + pure: false, + standalone: true }] }], null, null); })(); + /** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license + * @module + * @description + * This module provides a set of common Pipes. */ - /** * A collection of Angular pipes that are likely to be used in each and every application. */ - - const COMMON_PIPES = [AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe]; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ + // Note: This does not contain the location providers, // as they need some platform specific implementations to work. - /** * Exports all the basic Angular directives and pipes, * such as `NgIf`, `NgForOf`, `DecimalPipe`, and so on. * Re-exported by `BrowserModule`, which is included automatically in the root * `AppModule` when you create a new app with the CLI `new` command. * - * * The `providers` options configure the NgModule's injector to provide - * localization dependencies to members. - * * The `exports` options make the declared directives and pipes available for import - * by other NgModules. - * * @publicApi */ - class CommonModule {} - CommonModule.ɵfac = function CommonModule_Factory(t) { return new (t || CommonModule)(); }; - CommonModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: CommonModule }); CommonModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({}); - (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CommonModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule, args: [{ - declarations: [COMMON_DIRECTIVES, COMMON_PIPES], + imports: [COMMON_DIRECTIVES, COMMON_PIPES], exports: [COMMON_DIRECTIVES, COMMON_PIPES] }] }], null, null); })(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - const PLATFORM_BROWSER_ID = 'browser'; const PLATFORM_SERVER_ID = 'server'; const PLATFORM_WORKER_APP_ID = 'browserWorkerApp'; @@ -23959,7 +21300,6 @@ const PLATFORM_WORKER_UI_ID = 'browserWorkerUi'; * Returns whether a platform id represents a browser platform. * @publicApi */ - function isPlatformBrowser(platformId) { return platformId === PLATFORM_BROWSER_ID; } @@ -23967,8 +21307,6 @@ function isPlatformBrowser(platformId) { * Returns whether a platform id represents a server platform. * @publicApi */ - - function isPlatformServer(platformId) { return platformId === PLATFORM_SERVER_ID; } @@ -23976,8 +21314,6 @@ function isPlatformServer(platformId) { * Returns whether a platform id represents a web worker app platform. * @publicApi */ - - function isPlatformWorkerApp(platformId) { return platformId === PLATFORM_WORKER_APP_ID; } @@ -23985,45 +21321,29 @@ function isPlatformWorkerApp(platformId) { * Returns whether a platform id represents a web worker UI platform. * @publicApi */ - - function isPlatformWorkerUi(platformId) { return platformId === PLATFORM_WORKER_UI_ID; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** - * @publicApi + * @module + * @description + * Entry point for all public APIs of the common package. */ - - -const VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Version('14.0.0'); /** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license + * @publicApi */ +const VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Version('15.1.3'); /** * Defines a scroll position manager. Implemented by `BrowserViewportScroller`. * * @publicApi */ - -class ViewportScroller {} // De-sugared tree-shakable injection +class ViewportScroller {} +// De-sugared tree-shakable injection // See #23917 - /** @nocollapse */ - - ViewportScroller.ɵprov = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"])({ token: ViewportScroller, providedIn: 'root', @@ -24032,12 +21352,10 @@ ViewportScroller.ɵprov = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdef /** * Manages the scroll position for a browser window. */ - class BrowserViewportScroller { constructor(document, window) { this.document = document; this.window = window; - this.offset = () => [0, 0]; } /** @@ -24046,8 +21364,6 @@ class BrowserViewportScroller { * or a function that returns the top offset position. * */ - - setOffset(offset) { if (Array.isArray(offset)) { this.offset = () => offset; @@ -24059,8 +21375,6 @@ class BrowserViewportScroller { * Retrieves the current scroll position. * @returns The position in screen coordinates. */ - - getScrollPosition() { if (this.supportsScrolling()) { return [this.window.pageXOffset, this.window.pageYOffset]; @@ -24072,8 +21386,6 @@ class BrowserViewportScroller { * Sets the scroll position. * @param position The new position in screen coordinates. */ - - scrollToPosition(position) { if (this.supportsScrolling()) { this.window.scrollTo(position[0], position[1]); @@ -24090,35 +21402,28 @@ class BrowserViewportScroller { * @see https://html.spec.whatwg.org/#the-indicated-part-of-the-document * @see https://html.spec.whatwg.org/#scroll-to-fragid */ - - scrollToAnchor(target) { if (!this.supportsScrolling()) { return; } - const elSelected = findAnchorFromDocument(this.document, target); - if (elSelected) { - this.scrollToElement(elSelected); // After scrolling to the element, the spec dictates that we follow the focus steps for the + this.scrollToElement(elSelected); + // After scrolling to the element, the spec dictates that we follow the focus steps for the // target. Rather than following the robust steps, simply attempt focus. // // @see https://html.spec.whatwg.org/#get-the-focusable-area // @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus // @see https://html.spec.whatwg.org/#focusable-area - elSelected.focus(); } } /** * Disables automatic scroll restoration provided by the browser. */ - - setHistoryScrollRestoration(scrollRestoration) { if (this.supportScrollRestoration()) { const history = this.window.history; - if (history && history.scrollRestoration) { history.scrollRestoration = scrollRestoration; } @@ -24130,8 +21435,6 @@ class BrowserViewportScroller { * The offset can be used when we know that there is a floating header and scrolling naively to an * element (ex: `scrollIntoView`) leaves the element hidden behind the floating header. */ - - scrollToElement(el) { const rect = el.getBoundingClientRect(); const left = rect.left + this.window.pageXOffset; @@ -24147,24 +21450,20 @@ class BrowserViewportScroller { * Since webworkers aren't widely used, we will lift it once RouterScroller is * battle-tested. */ - - supportScrollRestoration() { try { if (!this.supportsScrolling()) { return false; - } // The `scrollRestoration` property could be on the `history` instance or its prototype. - - - const scrollRestorationDescriptor = getScrollRestorationProperty(this.window.history) || getScrollRestorationProperty(Object.getPrototypeOf(this.window.history)); // We can write to the `scrollRestoration` property if it is a writable data field or it has a + } + // The `scrollRestoration` property could be on the `history` instance or its prototype. + const scrollRestorationDescriptor = getScrollRestorationProperty(this.window.history) || getScrollRestorationProperty(Object.getPrototypeOf(this.window.history)); + // We can write to the `scrollRestoration` property if it is a writable data field or it has a // setter function. - return !!scrollRestorationDescriptor && !!(scrollRestorationDescriptor.writable || scrollRestorationDescriptor.set); } catch { return false; } } - supportsScrolling() { try { return !!this.window && !!this.window.scrollTo && 'pageXOffset' in this.window; @@ -24172,50 +21471,38 @@ class BrowserViewportScroller { return false; } } - } - function getScrollRestorationProperty(obj) { return Object.getOwnPropertyDescriptor(obj, 'scrollRestoration'); } - function findAnchorFromDocument(document, target) { const documentResult = document.getElementById(target) || document.getElementsByName(target)[0]; - if (documentResult) { return documentResult; - } // `getElementById` and `getElementsByName` won't pierce through the shadow DOM so we + } + // `getElementById` and `getElementsByName` won't pierce through the shadow DOM so we // have to traverse the DOM manually and do the lookup through the shadow roots. - - if (typeof document.createTreeWalker === 'function' && document.body && (document.body.createShadowRoot || document.body.attachShadow)) { const treeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT); let currentNode = treeWalker.currentNode; - while (currentNode) { const shadowRoot = currentNode.shadowRoot; - if (shadowRoot) { // Note that `ShadowRoot` doesn't support `getElementsByName` // so we have to fall back to `querySelector`. const result = shadowRoot.getElementById(target) || shadowRoot.querySelector(`[name="${target}"]`); - if (result) { return result; } } - currentNode = treeWalker.nextNode(); } } - return null; } /** * Provides an empty implementation of the viewport scroller. */ - - class NullViewportScroller { /** * Empty implementation @@ -24224,130 +21511,1410 @@ class NullViewportScroller { /** * Empty implementation */ - - getScrollPosition() { return [0, 0]; } /** * Empty implementation */ - - scrollToPosition(position) {} /** * Empty implementation */ - - scrollToAnchor(anchor) {} /** * Empty implementation */ - - setHistoryScrollRestoration(scrollRestoration) {} - } + /** - * @license - * Copyright Google LLC All Rights Reserved. + * A wrapper around the `XMLHttpRequest` constructor. * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license + * @publicApi */ +class XhrFactory {} + +// Converts a string that represents a URL into a URL class instance. +function getUrl(src, win) { + // Don't use a base URL is the URL is absolute. + return isAbsoluteUrl(src) ? new URL(src) : new URL(src, win.location.href); +} +// Checks whether a URL is absolute (i.e. starts with `http://` or `https://`). +function isAbsoluteUrl(src) { + return /^https?:\/\//.test(src); +} +// Given a URL, extract the hostname part. +// If a URL is a relative one - the URL is returned as is. +function extractHostname(url) { + return isAbsoluteUrl(url) ? new URL(url).hostname : url; +} +function isValidPath(path) { + const isString = typeof path === 'string'; + if (!isString || path.trim() === '') { + return false; + } + // Calling new URL() will throw if the path string is malformed + try { + const url = new URL(path); + return true; + } catch { + return false; + } +} +function normalizePath(path) { + return path.endsWith('/') ? path.slice(0, -1) : path; +} +function normalizeSrc(src) { + return src.startsWith('/') ? src.slice(1) : src; +} /** - * A wrapper around the `XMLHttpRequest` constructor. + * Noop image loader that does no transformation to the original src and just returns it as is. + * This loader is used as a default one if more specific logic is not provided in an app config. + * + * @see `ImageLoader` + * @see `NgOptimizedImage` + */ +const noopImageLoader = config => config.src; +/** + * Injection token that configures the image loader function. * + * @see `ImageLoader` + * @see `NgOptimizedImage` * @publicApi */ +const IMAGE_LOADER = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('ImageLoader', { + providedIn: 'root', + factory: () => noopImageLoader +}); +/** + * Internal helper function that makes it easier to introduce custom image loaders for the + * `NgOptimizedImage` directive. It is enough to specify a URL builder function to obtain full DI + * configuration for a given loader: a DI token corresponding to the actual loader function, plus DI + * tokens managing preconnect check functionality. + * @param buildUrlFn a function returning a full URL based on loader's configuration + * @param exampleUrls example of full URLs for a given loader (used in error messages) + * @returns a set of DI providers corresponding to the configured image loader + */ +function createImageLoader(buildUrlFn, exampleUrls) { + return function provideImageLoader(path) { + if (!isValidPath(path)) { + throwInvalidPathError(path, exampleUrls || []); + } + // The trailing / is stripped (if provided) to make URL construction (concatenation) easier in + // the individual loader functions. + path = normalizePath(path); + const loaderFn = config => { + if (isAbsoluteUrl(config.src)) { + // Image loader functions expect an image file name (e.g. `my-image.png`) + // or a relative path + a file name (e.g. `/a/b/c/my-image.png`) as an input, + // so the final absolute URL can be constructed. + // When an absolute URL is provided instead - the loader can not + // build a final URL, thus the error is thrown to indicate that. + throwUnexpectedAbsoluteUrlError(path, config.src); + } + return buildUrlFn(path, { + ...config, + src: normalizeSrc(config.src) + }); + }; + const providers = [{ + provide: IMAGE_LOADER, + useValue: loaderFn + }]; + return providers; + }; +} +function throwInvalidPathError(path, exampleUrls) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2959 /* RuntimeErrorCode.INVALID_LOADER_ARGUMENTS */, ngDevMode && `Image loader has detected an invalid path (\`${path}\`). ` + `To fix this, supply a path using one of the following formats: ${exampleUrls.join(' or ')}`); +} +function throwUnexpectedAbsoluteUrlError(path, url) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2959 /* RuntimeErrorCode.INVALID_LOADER_ARGUMENTS */, ngDevMode && `Image loader has detected a \`\` tag with an invalid \`ngSrc\` attribute: ${url}. ` + `This image loader expects \`ngSrc\` to be a relative URL - ` + `however the provided value is an absolute URL. ` + `To fix this, provide \`ngSrc\` as a path relative to the base URL ` + `configured for this loader (\`${path}\`).`); +} - -class XhrFactory {} /** - * @license - * Copyright Google LLC All Rights Reserved. + * Function that generates an ImageLoader for [Cloudflare Image + * Resizing](https://developers.cloudflare.com/images/image-resizing/) and turns it into an Angular + * provider. Note: Cloudflare has multiple image products - this provider is specifically for + * Cloudflare Image Resizing; it will not work with Cloudflare Images or Cloudflare Polish. * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license + * @param path Your domain name, e.g. https://mysite.com + * @returns Provider that provides an ImageLoader function + * + * @publicApi */ +const provideCloudflareLoader = createImageLoader(createCloudflareUrl, ngDevMode ? ['https:///cdn-cgi/image//'] : undefined); +function createCloudflareUrl(path, config) { + let params = `format=auto`; + if (config.width) { + params += `,width=${config.width}`; + } + // Cloudflare image URLs format: + // https://developers.cloudflare.com/images/image-resizing/url-format/ + return `${path}/cdn-cgi/image/${params}/${config.src}`; +} /** - * @license - * Copyright Google LLC All Rights Reserved. + * Name and URL tester for Cloudinary. + */ +const cloudinaryLoaderInfo = { + name: 'Cloudinary', + testUrl: isCloudinaryUrl +}; +const CLOUDINARY_LOADER_REGEX = /https?\:\/\/[^\/]+\.cloudinary\.com\/.+/; +/** + * Tests whether a URL is from Cloudinary CDN. + */ +function isCloudinaryUrl(url) { + return CLOUDINARY_LOADER_REGEX.test(url); +} +/** + * Function that generates an ImageLoader for Cloudinary and turns it into an Angular provider. * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license + * @param path Base URL of your Cloudinary images + * This URL should match one of the following formats: + * https://res.cloudinary.com/mysite + * https://mysite.cloudinary.com + * https://subdomain.mysite.com + * @returns Set of providers to configure the Cloudinary loader. + * + * @publicApi */ -// This file only reexports content of the `src` folder. Keep it that way. +const provideCloudinaryLoader = createImageLoader(createCloudinaryUrl, ngDevMode ? ['https://res.cloudinary.com/mysite', 'https://mysite.cloudinary.com', 'https://subdomain.mysite.com'] : undefined); +function createCloudinaryUrl(path, config) { + // Cloudinary image URLformat: + // https://cloudinary.com/documentation/image_transformations#transformation_url_structure + // Example of a Cloudinary image URL: + // https://res.cloudinary.com/mysite/image/upload/c_scale,f_auto,q_auto,w_600/marketing/tile-topics-m.png + let params = `f_auto,q_auto`; // sets image format and quality to "auto" + if (config.width) { + params += `,w_${config.width}`; + } + return `${path}/image/upload/${params}/${config.src}`; +} /** - * @license - * Copyright Google LLC All Rights Reserved. + * Name and URL tester for ImageKit. + */ +const imageKitLoaderInfo = { + name: 'ImageKit', + testUrl: isImageKitUrl +}; +const IMAGE_KIT_LOADER_REGEX = /https?\:\/\/[^\/]+\.imagekit\.io\/.+/; +/** + * Tests whether a URL is from ImageKit CDN. + */ +function isImageKitUrl(url) { + return IMAGE_KIT_LOADER_REGEX.test(url); +} +/** + * Function that generates an ImageLoader for ImageKit and turns it into an Angular provider. * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license + * @param path Base URL of your ImageKit images + * This URL should match one of the following formats: + * https://ik.imagekit.io/myaccount + * https://subdomain.mysite.com + * @returns Set of providers to configure the ImageKit loader. + * + * @publicApi */ +const provideImageKitLoader = createImageLoader(createImagekitUrl, ngDevMode ? ['https://ik.imagekit.io/mysite', 'https://subdomain.mysite.com'] : undefined); +function createImagekitUrl(path, config) { + // Example of an ImageKit image URL: + // https://ik.imagekit.io/demo/tr:w-300,h-300/medium_cafe_B1iTdD0C.jpg + let params = `tr:q-auto`; // applies the "auto quality" transformation + if (config.width) { + params += `,w-${config.width}`; + } + return `${path}/${params}/${config.src}`; +} /** - * Generated bundle index. Do not edit. + * Name and URL tester for Imgix. + */ +const imgixLoaderInfo = { + name: 'Imgix', + testUrl: isImgixUrl +}; +const IMGIX_LOADER_REGEX = /https?\:\/\/[^\/]+\.imgix\.net\/.+/; +/** + * Tests whether a URL is from Imgix CDN. + */ +function isImgixUrl(url) { + return IMGIX_LOADER_REGEX.test(url); +} +/** + * Function that generates an ImageLoader for Imgix and turns it into an Angular provider. + * + * @param path path to the desired Imgix origin, + * e.g. https://somepath.imgix.net or https://images.mysite.com + * @returns Set of providers to configure the Imgix loader. + * + * @publicApi */ +const provideImgixLoader = createImageLoader(createImgixUrl, ngDevMode ? ['https://somepath.imgix.net/'] : undefined); +function createImgixUrl(path, config) { + const url = new URL(`${path}/${config.src}`); + // This setting ensures the smallest allowable format is set. + url.searchParams.set('auto', 'format'); + if (config.width) { + url.searchParams.set('w', config.width.toString()); + } + return url.href; +} +// Assembles directive details string, useful for error messages. +function imgDirectiveDetails(ngSrc, includeNgSrc = true) { + const ngSrcInfo = includeNgSrc ? `(activated on an element with the \`ngSrc="${ngSrc}"\`) ` : ''; + return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`; +} +/** + * Asserts that the application is in development mode. Throws an error if the application is in + * production mode. This assert can be used to make sure that there is no dev-mode code invoked in + * the prod mode accidentally. + */ +function assertDevMode(checkName) { + if (!ngDevMode) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2958 /* RuntimeErrorCode.UNEXPECTED_DEV_MODE_CHECK_IN_PROD_MODE */, `Unexpected invocation of the ${checkName} in the prod mode. ` + `Please make sure that the prod mode is enabled for production builds.`); + } +} +/** + * Observer that detects whether an image with `NgOptimizedImage` + * is treated as a Largest Contentful Paint (LCP) element. If so, + * asserts that the image has the `priority` attribute. + * + * Note: this is a dev-mode only class and it does not appear in prod bundles, + * thus there is no `ngDevMode` use in the code. + * + * Based on https://web.dev/lcp/#measure-lcp-in-javascript. + */ +class LCPImageObserver { + constructor() { + // Map of full image URLs -> original `ngSrc` values. + this.images = new Map(); + // Keep track of images for which `console.warn` was produced. + this.alreadyWarned = new Set(); + this.window = null; + this.observer = null; + assertDevMode('LCP checker'); + const win = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DOCUMENT).defaultView; + if (typeof win !== 'undefined' && typeof PerformanceObserver !== 'undefined') { + this.window = win; + this.observer = this.initPerformanceObserver(); + } + } + /** + * Inits PerformanceObserver and subscribes to LCP events. + * Based on https://web.dev/lcp/#measure-lcp-in-javascript + */ + initPerformanceObserver() { + const observer = new PerformanceObserver(entryList => { + const entries = entryList.getEntries(); + if (entries.length === 0) return; + // We use the latest entry produced by the `PerformanceObserver` as the best + // signal on which element is actually an LCP one. As an example, the first image to load on + // a page, by virtue of being the only thing on the page so far, is often a LCP candidate + // and gets reported by PerformanceObserver, but isn't necessarily the LCP element. + const lcpElement = entries[entries.length - 1]; + // Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry. + // See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint + const imgSrc = lcpElement.element?.src ?? ''; + // Exclude `data:` and `blob:` URLs, since they are not supported by the directive. + if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:')) return; + const imgNgSrc = this.images.get(imgSrc); + if (imgNgSrc && !this.alreadyWarned.has(imgSrc)) { + this.alreadyWarned.add(imgSrc); + logMissingPriorityWarning(imgSrc); + } + }); + observer.observe({ + type: 'largest-contentful-paint', + buffered: true + }); + return observer; + } + registerImage(rewrittenSrc, originalNgSrc) { + if (!this.observer) return; + this.images.set(getUrl(rewrittenSrc, this.window).href, originalNgSrc); + } + unregisterImage(rewrittenSrc) { + if (!this.observer) return; + this.images.delete(getUrl(rewrittenSrc, this.window).href); + } + ngOnDestroy() { + if (!this.observer) return; + this.observer.disconnect(); + this.images.clear(); + this.alreadyWarned.clear(); + } +} +LCPImageObserver.ɵfac = function LCPImageObserver_Factory(t) { + return new (t || LCPImageObserver)(); +}; +LCPImageObserver.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ + token: LCPImageObserver, + factory: LCPImageObserver.ɵfac, + providedIn: 'root' +}); +(function () { + (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](LCPImageObserver, [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, + args: [{ + providedIn: 'root' + }] + }], function () { + return []; + }, null); +})(); +function logMissingPriorityWarning(ngSrc) { + const directiveDetails = imgDirectiveDetails(ngSrc); + console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2955 /* RuntimeErrorCode.LCP_IMG_MISSING_PRIORITY */, `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` + `element but was not marked "priority". This image should be marked ` + `"priority" in order to prioritize its loading. ` + `To fix this, add the "priority" attribute.`)); +} -/***/ }), +// Set of origins that are always excluded from the preconnect checks. +const INTERNAL_PRECONNECT_CHECK_BLOCKLIST = new Set(['localhost', '127.0.0.1', '0.0.0.0']); +/** + * Injection token to configure which origins should be excluded + * from the preconnect checks. It can either be a single string or an array of strings + * to represent a group of origins, for example: + * + * ```typescript + * {provide: PRECONNECT_CHECK_BLOCKLIST, useValue: 'https://your-domain.com'} + * ``` + * + * or: + * + * ```typescript + * {provide: PRECONNECT_CHECK_BLOCKLIST, + * useValue: ['https://your-domain-1.com', 'https://your-domain-2.com']} + * ``` + * + * @publicApi + */ +const PRECONNECT_CHECK_BLOCKLIST = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('PRECONNECT_CHECK_BLOCKLIST'); +/** + * Contains the logic to detect whether an image, marked with the "priority" attribute + * has a corresponding `` tag in the `document.head`. + * + * Note: this is a dev-mode only class, which should not appear in prod bundles, + * thus there is no `ngDevMode` use in the code. + */ +class PreconnectLinkChecker { + constructor() { + this.document = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DOCUMENT); + /** + * Set of tags found on this page. + * The `null` value indicates that there was no DOM query operation performed. + */ + this.preconnectLinks = null; + /* + * Keep track of all already seen origin URLs to avoid repeating the same check. + */ + this.alreadySeen = new Set(); + this.window = null; + this.blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST); + assertDevMode('preconnect link checker'); + const win = this.document.defaultView; + if (typeof win !== 'undefined') { + this.window = win; + } + const blocklist = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(PRECONNECT_CHECK_BLOCKLIST, { + optional: true + }); + if (blocklist) { + this.populateBlocklist(blocklist); + } + } + populateBlocklist(origins) { + if (Array.isArray(origins)) { + deepForEach(origins, origin => { + this.blocklist.add(extractHostname(origin)); + }); + } else { + this.blocklist.add(extractHostname(origins)); + } + } + /** + * Checks that a preconnect resource hint exists in the head for the + * given src. + * + * @param rewrittenSrc src formatted with loader + * @param originalNgSrc ngSrc value + */ + assertPreconnect(rewrittenSrc, originalNgSrc) { + if (!this.window) return; + const imgUrl = getUrl(rewrittenSrc, this.window); + if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin)) return; + // Register this origin as seen, so we don't check it again later. + this.alreadySeen.add(imgUrl.origin); + if (!this.preconnectLinks) { + // Note: we query for preconnect links only *once* and cache the results + // for the entire lifespan of an application, since it's unlikely that the + // list would change frequently. This allows to make sure there are no + // performance implications of making extra DOM lookups for each image. + this.preconnectLinks = this.queryPreconnectLinks(); + } + if (!this.preconnectLinks.has(imgUrl.origin)) { + console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2956 /* RuntimeErrorCode.PRIORITY_IMG_MISSING_PRECONNECT_TAG */, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this ` + `image. Preconnecting to the origin(s) that serve priority images ensures that these ` + `images are delivered as soon as possible. To fix this, please add the following ` + `element into the of the document:\n` + ` `)); + } + } + queryPreconnectLinks() { + const preconnectUrls = new Set(); + const selector = 'link[rel=preconnect]'; + const links = Array.from(this.document.querySelectorAll(selector)); + for (let link of links) { + const url = getUrl(link.href, this.window); + preconnectUrls.add(url.origin); + } + return preconnectUrls; + } + ngOnDestroy() { + this.preconnectLinks?.clear(); + this.alreadySeen.clear(); + } +} +PreconnectLinkChecker.ɵfac = function PreconnectLinkChecker_Factory(t) { + return new (t || PreconnectLinkChecker)(); +}; +PreconnectLinkChecker.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ + token: PreconnectLinkChecker, + factory: PreconnectLinkChecker.ɵfac, + providedIn: 'root' +}); +(function () { + (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PreconnectLinkChecker, [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, + args: [{ + providedIn: 'root' + }] + }], function () { + return []; + }, null); +})(); +/** + * Invokes a callback for each element in the array. Also invokes a callback + * recursively for each nested array. + */ +function deepForEach(input, fn) { + for (let value of input) { + Array.isArray(value) ? deepForEach(value, fn) : fn(value); + } +} -/***/ 2560: -/*!******************************************************!*\ - !*** ./node_modules/@angular/core/fesm2020/core.mjs ***! - \******************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { +/** + * In SSR scenarios, a preload `` element is generated for priority images. + * Having a large number of preload tags may negatively affect the performance, + * so we warn developers (by throwing an error) if the number of preloaded images + * is above a certain threshold. This const specifies this threshold. + */ +const DEFAULT_PRELOADED_IMAGES_LIMIT = 5; +/** + * Helps to keep track of priority images that already have a corresponding + * preload tag (to avoid generating multiple preload tags with the same URL). + * + * This Set tracks the original src passed into the `ngSrc` input not the src after it has been + * run through the specified `IMAGE_LOADER`. + */ +const PRELOADED_IMAGES = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('NG_OPTIMIZED_PRELOADED_IMAGES', { + providedIn: 'root', + factory: () => new Set() +}); -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "ANALYZE_FOR_ENTRY_COMPONENTS": () => (/* binding */ ANALYZE_FOR_ENTRY_COMPONENTS), -/* harmony export */ "ANIMATION_MODULE_TYPE": () => (/* binding */ ANIMATION_MODULE_TYPE), -/* harmony export */ "APP_BOOTSTRAP_LISTENER": () => (/* binding */ APP_BOOTSTRAP_LISTENER), -/* harmony export */ "APP_ID": () => (/* binding */ APP_ID), -/* harmony export */ "APP_INITIALIZER": () => (/* binding */ APP_INITIALIZER), -/* harmony export */ "ApplicationInitStatus": () => (/* binding */ ApplicationInitStatus), -/* harmony export */ "ApplicationModule": () => (/* binding */ ApplicationModule), -/* harmony export */ "ApplicationRef": () => (/* binding */ ApplicationRef), -/* harmony export */ "Attribute": () => (/* binding */ Attribute), -/* harmony export */ "COMPILER_OPTIONS": () => (/* binding */ COMPILER_OPTIONS), -/* harmony export */ "CUSTOM_ELEMENTS_SCHEMA": () => (/* binding */ CUSTOM_ELEMENTS_SCHEMA), -/* harmony export */ "ChangeDetectionStrategy": () => (/* binding */ ChangeDetectionStrategy), -/* harmony export */ "ChangeDetectorRef": () => (/* binding */ ChangeDetectorRef), -/* harmony export */ "Compiler": () => (/* binding */ Compiler), -/* harmony export */ "CompilerFactory": () => (/* binding */ CompilerFactory), -/* harmony export */ "Component": () => (/* binding */ Component), -/* harmony export */ "ComponentFactory": () => (/* binding */ ComponentFactory$1), -/* harmony export */ "ComponentFactoryResolver": () => (/* binding */ ComponentFactoryResolver$1), -/* harmony export */ "ComponentRef": () => (/* binding */ ComponentRef$1), -/* harmony export */ "ContentChild": () => (/* binding */ ContentChild), -/* harmony export */ "ContentChildren": () => (/* binding */ ContentChildren), -/* harmony export */ "DEFAULT_CURRENCY_CODE": () => (/* binding */ DEFAULT_CURRENCY_CODE), -/* harmony export */ "DebugElement": () => (/* binding */ DebugElement), -/* harmony export */ "DebugEventListener": () => (/* binding */ DebugEventListener), -/* harmony export */ "DebugNode": () => (/* binding */ DebugNode), -/* harmony export */ "DefaultIterableDiffer": () => (/* binding */ DefaultIterableDiffer), -/* harmony export */ "Directive": () => (/* binding */ Directive), -/* harmony export */ "ENVIRONMENT_INITIALIZER": () => (/* binding */ ENVIRONMENT_INITIALIZER), -/* harmony export */ "ElementRef": () => (/* binding */ ElementRef), -/* harmony export */ "EmbeddedViewRef": () => (/* binding */ EmbeddedViewRef), -/* harmony export */ "EnvironmentInjector": () => (/* binding */ EnvironmentInjector), -/* harmony export */ "ErrorHandler": () => (/* binding */ ErrorHandler), -/* harmony export */ "EventEmitter": () => (/* binding */ EventEmitter), -/* harmony export */ "Host": () => (/* binding */ Host), -/* harmony export */ "HostBinding": () => (/* binding */ HostBinding), -/* harmony export */ "HostListener": () => (/* binding */ HostListener), -/* harmony export */ "INJECTOR": () => (/* binding */ INJECTOR), -/* harmony export */ "Inject": () => (/* binding */ Inject), -/* harmony export */ "InjectFlags": () => (/* binding */ InjectFlags), -/* harmony export */ "Injectable": () => (/* binding */ Injectable), -/* harmony export */ "InjectionToken": () => (/* binding */ InjectionToken), +/** + * @description Contains the logic needed to track and add preload link tags to the `` tag. It + * will also track what images have already had preload link tags added so as to not duplicate link + * tags. + * + * In dev mode this service will validate that the number of preloaded images does not exceed the + * configured default preloaded images limit: {@link DEFAULT_PRELOADED_IMAGES_LIMIT}. + */ +class PreloadLinkCreator { + constructor() { + this.preloadedImages = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(PRELOADED_IMAGES); + this.document = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DOCUMENT); + } + /** + * @description Add a preload `` to the `` of the `index.html` that is served from the + * server while using Angular Universal and SSR to kick off image loads for high priority images. + * + * The `sizes` (passed in from the user) and `srcset` (parsed and formatted from `ngSrcset`) + * properties used to set the corresponding attributes, `imagesizes` and `imagesrcset` + * respectively, on the preload `` tag so that the correctly sized image is preloaded from + * the CDN. + * + * {@link https://web.dev/preload-responsive-images/#imagesrcset-and-imagesizes} + * + * @param renderer The `Renderer2` passed in from the directive + * @param src The original src of the image that is set on the `ngSrc` input. + * @param srcset The parsed and formatted srcset created from the `ngSrcset` input + * @param sizes The value of the `sizes` attribute passed in to the `` tag + */ + createPreloadLinkTag(renderer, src, srcset, sizes) { + if (ngDevMode) { + if (this.preloadedImages.size >= DEFAULT_PRELOADED_IMAGES_LIMIT) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2961 /* RuntimeErrorCode.TOO_MANY_PRELOADED_IMAGES */, ngDevMode && `The \`NgOptimizedImage\` directive has detected that more than ` + `${DEFAULT_PRELOADED_IMAGES_LIMIT} images were marked as priority. ` + `This might negatively affect an overall performance of the page. ` + `To fix this, remove the "priority" attribute from images with less priority.`); + } + } + if (this.preloadedImages.has(src)) { + return; + } + this.preloadedImages.add(src); + const preload = renderer.createElement('link'); + renderer.setAttribute(preload, 'as', 'image'); + renderer.setAttribute(preload, 'href', src); + renderer.setAttribute(preload, 'rel', 'preload'); + renderer.setAttribute(preload, 'fetchpriority', 'high'); + if (sizes) { + renderer.setAttribute(preload, 'imageSizes', sizes); + } + if (srcset) { + renderer.setAttribute(preload, 'imageSrcset', srcset); + } + renderer.appendChild(this.document.head, preload); + } +} +PreloadLinkCreator.ɵfac = function PreloadLinkCreator_Factory(t) { + return new (t || PreloadLinkCreator)(); +}; +PreloadLinkCreator.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ + token: PreloadLinkCreator, + factory: PreloadLinkCreator.ɵfac, + providedIn: 'root' +}); +(function () { + (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PreloadLinkCreator, [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, + args: [{ + providedIn: 'root' + }] + }], null, null); +})(); + +/** + * When a Base64-encoded image is passed as an input to the `NgOptimizedImage` directive, + * an error is thrown. The image content (as a string) might be very long, thus making + * it hard to read an error message if the entire string is included. This const defines + * the number of characters that should be included into the error message. The rest + * of the content is truncated. + */ +const BASE64_IMG_MAX_LENGTH_IN_ERROR = 50; +/** + * RegExpr to determine whether a src in a srcset is using width descriptors. + * Should match something like: "100w, 200w". + */ +const VALID_WIDTH_DESCRIPTOR_SRCSET = /^((\s*\d+w\s*(,|$)){1,})$/; +/** + * RegExpr to determine whether a src in a srcset is using density descriptors. + * Should match something like: "1x, 2x, 50x". Also supports decimals like "1.5x, 1.50x". + */ +const VALID_DENSITY_DESCRIPTOR_SRCSET = /^((\s*\d+(\.\d+)?x\s*(,|$)){1,})$/; +/** + * Srcset values with a density descriptor higher than this value will actively + * throw an error. Such densities are not permitted as they cause image sizes + * to be unreasonably large and slow down LCP. + */ +const ABSOLUTE_SRCSET_DENSITY_CAP = 3; +/** + * Used only in error message text to communicate best practices, as we will + * only throw based on the slightly more conservative ABSOLUTE_SRCSET_DENSITY_CAP. + */ +const RECOMMENDED_SRCSET_DENSITY_CAP = 2; +/** + * Used in generating automatic density-based srcsets + */ +const DENSITY_SRCSET_MULTIPLIERS = [1, 2]; +/** + * Used to determine which breakpoints to use on full-width images + */ +const VIEWPORT_BREAKPOINT_CUTOFF = 640; +/** + * Used to determine whether two aspect ratios are similar in value. + */ +const ASPECT_RATIO_TOLERANCE = .1; +/** + * Used to determine whether the image has been requested at an overly + * large size compared to the actual rendered image size (after taking + * into account a typical device pixel ratio). In pixels. + */ +const OVERSIZED_IMAGE_TOLERANCE = 1000; +/** + * Used to limit automatic srcset generation of very large sources for + * fixed-size images. In pixels. + */ +const FIXED_SRCSET_WIDTH_LIMIT = 1920; +const FIXED_SRCSET_HEIGHT_LIMIT = 1080; +/** Info about built-in loaders we can test for. */ +const BUILT_IN_LOADERS = [imgixLoaderInfo, imageKitLoaderInfo, cloudinaryLoaderInfo]; +const defaultConfig = { + breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840] +}; +/** + * Injection token that configures the image optimized image functionality. + * + * @see `NgOptimizedImage` + * @publicApi + * @developerPreview + */ +const IMAGE_CONFIG = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('ImageConfig', { + providedIn: 'root', + factory: () => defaultConfig +}); +/** + * Directive that improves image loading performance by enforcing best practices. + * + * `NgOptimizedImage` ensures that the loading of the Largest Contentful Paint (LCP) image is + * prioritized by: + * - Automatically setting the `fetchpriority` attribute on the `` tag + * - Lazy loading non-priority images by default + * - Asserting that there is a corresponding preconnect link tag in the document head + * + * In addition, the directive: + * - Generates appropriate asset URLs if a corresponding `ImageLoader` function is provided + * - Automatically generates a srcset + * - Requires that `width` and `height` are set + * - Warns if `width` or `height` have been set incorrectly + * - Warns if the image will be visually distorted when rendered + * + * @usageNotes + * The `NgOptimizedImage` directive is marked as [standalone](guide/standalone-components) and can + * be imported directly. + * + * Follow the steps below to enable and use the directive: + * 1. Import it into the necessary NgModule or a standalone Component. + * 2. Optionally provide an `ImageLoader` if you use an image hosting service. + * 3. Update the necessary `` tags in templates and replace `src` attributes with `ngSrc`. + * Using a `ngSrc` allows the directive to control when the `src` gets set, which triggers an image + * download. + * + * Step 1: import the `NgOptimizedImage` directive. + * + * ```typescript + * import { NgOptimizedImage } from '@angular/common'; + * + * // Include it into the necessary NgModule + * @NgModule({ + * imports: [NgOptimizedImage], + * }) + * class AppModule {} + * + * // ... or a standalone Component + * @Component({ + * standalone: true + * imports: [NgOptimizedImage], + * }) + * class MyStandaloneComponent {} + * ``` + * + * Step 2: configure a loader. + * + * To use the **default loader**: no additional code changes are necessary. The URL returned by the + * generic loader will always match the value of "src". In other words, this loader applies no + * transformations to the resource URL and the value of the `ngSrc` attribute will be used as is. + * + * To use an existing loader for a **third-party image service**: add the provider factory for your + * chosen service to the `providers` array. In the example below, the Imgix loader is used: + * + * ```typescript + * import {provideImgixLoader} from '@angular/common'; + * + * // Call the function and add the result to the `providers` array: + * providers: [ + * provideImgixLoader("https://my.base.url/"), + * ], + * ``` + * + * The `NgOptimizedImage` directive provides the following functions: + * - `provideCloudflareLoader` + * - `provideCloudinaryLoader` + * - `provideImageKitLoader` + * - `provideImgixLoader` + * + * If you use a different image provider, you can create a custom loader function as described + * below. + * + * To use a **custom loader**: provide your loader function as a value for the `IMAGE_LOADER` DI + * token. + * + * ```typescript + * import {IMAGE_LOADER, ImageLoaderConfig} from '@angular/common'; + * + * // Configure the loader using the `IMAGE_LOADER` token. + * providers: [ + * { + * provide: IMAGE_LOADER, + * useValue: (config: ImageLoaderConfig) => { + * return `https://example.com/${config.src}-${config.width}.jpg}`; + * } + * }, + * ], + * ``` + * + * Step 3: update `` tags in templates to use `ngSrc` instead of `src`. + * + * ``` + * + * ``` + * + * @publicApi + */ +class NgOptimizedImage { + constructor() { + this.imageLoader = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(IMAGE_LOADER); + this.config = processConfig((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(IMAGE_CONFIG)); + this.renderer = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2); + this.imgElement = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef).nativeElement; + this.injector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector); + this.isServer = isPlatformServer((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.PLATFORM_ID)); + this.preloadLinkChecker = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(PreloadLinkCreator); + // a LCP image observer - should be injected only in the dev mode + this.lcpObserver = ngDevMode ? this.injector.get(LCPImageObserver) : null; + /** + * Calculate the rewritten `src` once and store it. + * This is needed to avoid repetitive calculations and make sure the directive cleanup in the + * `ngOnDestroy` does not rely on the `IMAGE_LOADER` logic (which in turn can rely on some other + * instance that might be already destroyed). + */ + this._renderedSrc = null; + this._priority = false; + this._disableOptimizedSrcset = false; + this._fill = false; + } + /** + * For responsive images: the intrinsic width of the image in pixels. + * For fixed size images: the desired rendered width of the image in pixels. + */ + set width(value) { + ngDevMode && assertGreaterThanZero(this, value, 'width'); + this._width = inputToInteger(value); + } + get width() { + return this._width; + } + /** + * For responsive images: the intrinsic height of the image in pixels. + * For fixed size images: the desired rendered height of the image in pixels.* The intrinsic + * height of the image in pixels. + */ + set height(value) { + ngDevMode && assertGreaterThanZero(this, value, 'height'); + this._height = inputToInteger(value); + } + get height() { + return this._height; + } + /** + * Indicates whether this image should have a high priority. + */ + set priority(value) { + this._priority = inputToBoolean(value); + } + get priority() { + return this._priority; + } + /** + * Disables automatic srcset generation for this image. + */ + set disableOptimizedSrcset(value) { + this._disableOptimizedSrcset = inputToBoolean(value); + } + get disableOptimizedSrcset() { + return this._disableOptimizedSrcset; + } + /** + * Sets the image to "fill mode", which eliminates the height/width requirement and adds + * styles such that the image fills its containing element. + * + * @developerPreview + */ + set fill(value) { + this._fill = inputToBoolean(value); + } + get fill() { + return this._fill; + } + /** @nodoc */ + ngOnInit() { + if (ngDevMode) { + assertNonEmptyInput(this, 'ngSrc', this.ngSrc); + assertValidNgSrcset(this, this.ngSrcset); + assertNoConflictingSrc(this); + if (this.ngSrcset) { + assertNoConflictingSrcset(this); + } + assertNotBase64Image(this); + assertNotBlobUrl(this); + if (this.fill) { + assertEmptyWidthAndHeight(this); + assertNonZeroRenderedHeight(this, this.imgElement, this.renderer); + } else { + assertNonEmptyWidthAndHeight(this); + // Only check for distorted images when not in fill mode, where + // images may be intentionally stretched, cropped or letterboxed. + assertNoImageDistortion(this, this.imgElement, this.renderer); + } + assertValidLoadingInput(this); + if (!this.ngSrcset) { + assertNoComplexSizes(this); + } + assertNotMissingBuiltInLoader(this.ngSrc, this.imageLoader); + assertNoNgSrcsetWithoutLoader(this, this.imageLoader); + if (this.priority) { + const checker = this.injector.get(PreconnectLinkChecker); + checker.assertPreconnect(this.getRewrittenSrc(), this.ngSrc); + } else { + // Monitor whether an image is an LCP element only in case + // the `priority` attribute is missing. Otherwise, an image + // has the necessary settings and no extra checks are required. + if (this.lcpObserver !== null) { + const ngZone = this.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone); + ngZone.runOutsideAngular(() => { + this.lcpObserver.registerImage(this.getRewrittenSrc(), this.ngSrc); + }); + } + } + } + this.setHostAttributes(); + } + setHostAttributes() { + // Must set width/height explicitly in case they are bound (in which case they will + // only be reflected and not found by the browser) + if (this.fill) { + if (!this.sizes) { + this.sizes = '100vw'; + } + } else { + this.setHostAttribute('width', this.width.toString()); + this.setHostAttribute('height', this.height.toString()); + } + this.setHostAttribute('loading', this.getLoadingBehavior()); + this.setHostAttribute('fetchpriority', this.getFetchPriority()); + // The `data-ng-img` attribute flags an image as using the directive, to allow + // for analysis of the directive's performance. + this.setHostAttribute('ng-img', 'true'); + // The `src` and `srcset` attributes should be set last since other attributes + // could affect the image's loading behavior. + const rewrittenSrc = this.getRewrittenSrc(); + this.setHostAttribute('src', rewrittenSrc); + let rewrittenSrcset = undefined; + if (this.sizes) { + this.setHostAttribute('sizes', this.sizes); + } + if (this.ngSrcset) { + rewrittenSrcset = this.getRewrittenSrcset(); + } else if (this.shouldGenerateAutomaticSrcset()) { + rewrittenSrcset = this.getAutomaticSrcset(); + } + if (rewrittenSrcset) { + this.setHostAttribute('srcset', rewrittenSrcset); + } + if (this.isServer && this.priority) { + this.preloadLinkChecker.createPreloadLinkTag(this.renderer, rewrittenSrc, rewrittenSrcset, this.sizes); + } + } + /** @nodoc */ + ngOnChanges(changes) { + if (ngDevMode) { + assertNoPostInitInputChange(this, changes, ['ngSrc', 'ngSrcset', 'width', 'height', 'priority', 'fill', 'loading', 'sizes', 'disableOptimizedSrcset']); + } + } + getLoadingBehavior() { + if (!this.priority && this.loading !== undefined) { + return this.loading; + } + return this.priority ? 'eager' : 'lazy'; + } + getFetchPriority() { + return this.priority ? 'high' : 'auto'; + } + getRewrittenSrc() { + // ImageLoaderConfig supports setting a width property. However, we're not setting width here + // because if the developer uses rendered width instead of intrinsic width in the HTML width + // attribute, the image requested may be too small for 2x+ screens. + if (!this._renderedSrc) { + const imgConfig = { + src: this.ngSrc + }; + // Cache calculated image src to reuse it later in the code. + this._renderedSrc = this.imageLoader(imgConfig); + } + return this._renderedSrc; + } + getRewrittenSrcset() { + const widthSrcSet = VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset); + const finalSrcs = this.ngSrcset.split(',').filter(src => src !== '').map(srcStr => { + srcStr = srcStr.trim(); + const width = widthSrcSet ? parseFloat(srcStr) : parseFloat(srcStr) * this.width; + return `${this.imageLoader({ + src: this.ngSrc, + width + })} ${srcStr}`; + }); + return finalSrcs.join(', '); + } + getAutomaticSrcset() { + if (this.sizes) { + return this.getResponsiveSrcset(); + } else { + return this.getFixedSrcset(); + } + } + getResponsiveSrcset() { + const { + breakpoints + } = this.config; + let filteredBreakpoints = breakpoints; + if (this.sizes?.trim() === '100vw') { + // Since this is a full-screen-width image, our srcset only needs to include + // breakpoints with full viewport widths. + filteredBreakpoints = breakpoints.filter(bp => bp >= VIEWPORT_BREAKPOINT_CUTOFF); + } + const finalSrcs = filteredBreakpoints.map(bp => `${this.imageLoader({ + src: this.ngSrc, + width: bp + })} ${bp}w`); + return finalSrcs.join(', '); + } + getFixedSrcset() { + const finalSrcs = DENSITY_SRCSET_MULTIPLIERS.map(multiplier => `${this.imageLoader({ + src: this.ngSrc, + width: this.width * multiplier + })} ${multiplier}x`); + return finalSrcs.join(', '); + } + shouldGenerateAutomaticSrcset() { + return !this._disableOptimizedSrcset && !this.srcset && this.imageLoader !== noopImageLoader && !(this.width > FIXED_SRCSET_WIDTH_LIMIT || this.height > FIXED_SRCSET_HEIGHT_LIMIT); + } + /** @nodoc */ + ngOnDestroy() { + if (ngDevMode) { + if (!this.priority && this._renderedSrc !== null && this.lcpObserver !== null) { + this.lcpObserver.unregisterImage(this._renderedSrc); + } + } + } + setHostAttribute(name, value) { + this.renderer.setAttribute(this.imgElement, name, value); + } +} +NgOptimizedImage.ɵfac = function NgOptimizedImage_Factory(t) { + return new (t || NgOptimizedImage)(); +}; +NgOptimizedImage.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ + type: NgOptimizedImage, + selectors: [["img", "ngSrc", ""]], + hostVars: 8, + hostBindings: function NgOptimizedImage_HostBindings(rf, ctx) { + if (rf & 2) { + _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵstyleProp"]("position", ctx.fill ? "absolute" : null)("width", ctx.fill ? "100%" : null)("height", ctx.fill ? "100%" : null)("inset", ctx.fill ? "0px" : null); + } + }, + inputs: { + ngSrc: "ngSrc", + ngSrcset: "ngSrcset", + sizes: "sizes", + width: "width", + height: "height", + loading: "loading", + priority: "priority", + disableOptimizedSrcset: "disableOptimizedSrcset", + fill: "fill", + src: "src", + srcset: "srcset" + }, + standalone: true, + features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] +}); +(function () { + (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgOptimizedImage, [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, + args: [{ + standalone: true, + selector: 'img[ngSrc]', + host: { + '[style.position]': 'fill ? "absolute" : null', + '[style.width]': 'fill ? "100%" : null', + '[style.height]': 'fill ? "100%" : null', + '[style.inset]': 'fill ? "0px" : null' + } + }] + }], null, { + ngSrc: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input + }], + ngSrcset: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input + }], + sizes: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input + }], + width: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input + }], + height: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input + }], + loading: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input + }], + priority: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input + }], + disableOptimizedSrcset: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input + }], + fill: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input + }], + src: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input + }], + srcset: [{ + type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input + }] + }); +})(); +/***** Helpers *****/ +/** + * Convert input value to integer. + */ +function inputToInteger(value) { + return typeof value === 'string' ? parseInt(value, 10) : value; +} +/** + * Convert input value to boolean. + */ +function inputToBoolean(value) { + return value != null && `${value}` !== 'false'; +} +/** + * Sorts provided config breakpoints and uses defaults. + */ +function processConfig(config) { + let sortedBreakpoints = {}; + if (config.breakpoints) { + sortedBreakpoints.breakpoints = config.breakpoints.sort((a, b) => a - b); + } + return Object.assign({}, defaultConfig, config, sortedBreakpoints); +} +/***** Assert functions *****/ +/** + * Verifies that there is no `src` set on a host element. + */ +function assertNoConflictingSrc(dir) { + if (dir.src) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2950 /* RuntimeErrorCode.UNEXPECTED_SRC_ATTR */, `${imgDirectiveDetails(dir.ngSrc)} both \`src\` and \`ngSrc\` have been set. ` + `Supplying both of these attributes breaks lazy loading. ` + `The NgOptimizedImage directive sets \`src\` itself based on the value of \`ngSrc\`. ` + `To fix this, please remove the \`src\` attribute.`); + } +} +/** + * Verifies that there is no `srcset` set on a host element. + */ +function assertNoConflictingSrcset(dir) { + if (dir.srcset) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2951 /* RuntimeErrorCode.UNEXPECTED_SRCSET_ATTR */, `${imgDirectiveDetails(dir.ngSrc)} both \`srcset\` and \`ngSrcset\` have been set. ` + `Supplying both of these attributes breaks lazy loading. ` + `The NgOptimizedImage directive sets \`srcset\` itself based on the value of ` + `\`ngSrcset\`. To fix this, please remove the \`srcset\` attribute.`); + } +} +/** + * Verifies that the `ngSrc` is not a Base64-encoded image. + */ +function assertNotBase64Image(dir) { + let ngSrc = dir.ngSrc.trim(); + if (ngSrc.startsWith('data:')) { + if (ngSrc.length > BASE64_IMG_MAX_LENGTH_IN_ERROR) { + ngSrc = ngSrc.substring(0, BASE64_IMG_MAX_LENGTH_IN_ERROR) + '...'; + } + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc, false)} \`ngSrc\` is a Base64-encoded string ` + `(${ngSrc}). NgOptimizedImage does not support Base64-encoded strings. ` + `To fix this, disable the NgOptimizedImage directive for this element ` + `by removing \`ngSrc\` and using a standard \`src\` attribute instead.`); + } +} +/** + * Verifies that the 'sizes' only includes responsive values. + */ +function assertNoComplexSizes(dir) { + let sizes = dir.sizes; + if (sizes?.match(/((\)|,)\s|^)\d+px/)) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc, false)} \`sizes\` was set to a string including ` + `pixel values. For automatic \`srcset\` generation, \`sizes\` must only include responsive ` + `values, such as \`sizes="50vw"\` or \`sizes="(min-width: 768px) 50vw, 100vw"\`. ` + `To fix this, modify the \`sizes\` attribute, or provide your own \`ngSrcset\` value directly.`); + } +} +/** + * Verifies that the `ngSrc` is not a Blob URL. + */ +function assertNotBlobUrl(dir) { + const ngSrc = dir.ngSrc.trim(); + if (ngSrc.startsWith('blob:')) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrc\` was set to a blob URL (${ngSrc}). ` + `Blob URLs are not supported by the NgOptimizedImage directive. ` + `To fix this, disable the NgOptimizedImage directive for this element ` + `by removing \`ngSrc\` and using a regular \`src\` attribute instead.`); + } +} +/** + * Verifies that the input is set to a non-empty string. + */ +function assertNonEmptyInput(dir, name, value) { + const isString = typeof value === 'string'; + const isEmptyString = isString && value.trim() === ''; + if (!isString || isEmptyString) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \`${name}\` has an invalid value ` + `(\`${value}\`). To fix this, change the value to a non-empty string.`); + } +} +/** + * Verifies that the `ngSrcset` is in a valid format, e.g. "100w, 200w" or "1x, 2x". + */ +function assertValidNgSrcset(dir, value) { + if (value == null) return; + assertNonEmptyInput(dir, 'ngSrcset', value); + const stringVal = value; + const isValidWidthDescriptor = VALID_WIDTH_DESCRIPTOR_SRCSET.test(stringVal); + const isValidDensityDescriptor = VALID_DENSITY_DESCRIPTOR_SRCSET.test(stringVal); + if (isValidDensityDescriptor) { + assertUnderDensityCap(dir, stringVal); + } + const isValidSrcset = isValidWidthDescriptor || isValidDensityDescriptor; + if (!isValidSrcset) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrcset\` has an invalid value (\`${value}\`). ` + `To fix this, supply \`ngSrcset\` using a comma-separated list of one or more width ` + `descriptors (e.g. "100w, 200w") or density descriptors (e.g. "1x, 2x").`); + } +} +function assertUnderDensityCap(dir, value) { + const underDensityCap = value.split(',').every(num => num === '' || parseFloat(num) <= ABSOLUTE_SRCSET_DENSITY_CAP); + if (!underDensityCap) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` contains an unsupported image density:` + `\`${value}\`. NgOptimizedImage generally recommends a max image density of ` + `${RECOMMENDED_SRCSET_DENSITY_CAP}x but supports image densities up to ` + `${ABSOLUTE_SRCSET_DENSITY_CAP}x. The human eye cannot distinguish between image densities ` + `greater than ${RECOMMENDED_SRCSET_DENSITY_CAP}x - which makes them unnecessary for ` + `most use cases. Images that will be pinch-zoomed are typically the primary use case for ` + `${ABSOLUTE_SRCSET_DENSITY_CAP}x images. Please remove the high density descriptor and try again.`); + } +} +/** + * Creates a `RuntimeError` instance to represent a situation when an input is set after + * the directive has initialized. + */ +function postInitInputChangeError(dir, inputName) { + let reason; + if (inputName === 'width' || inputName === 'height') { + reason = `Changing \`${inputName}\` may result in different attribute value ` + `applied to the underlying image element and cause layout shifts on a page.`; + } else { + reason = `Changing the \`${inputName}\` would have no effect on the underlying ` + `image element, because the resource loading has already occurred.`; + } + return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2953 /* RuntimeErrorCode.UNEXPECTED_INPUT_CHANGE */, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` was updated after initialization. ` + `The NgOptimizedImage directive will not react to this input change. ${reason} ` + `To fix this, either switch \`${inputName}\` to a static value ` + `or wrap the image element in an *ngIf that is gated on the necessary value.`); +} +/** + * Verify that none of the listed inputs has changed. + */ +function assertNoPostInitInputChange(dir, changes, inputs) { + inputs.forEach(input => { + const isUpdated = changes.hasOwnProperty(input); + if (isUpdated && !changes[input].isFirstChange()) { + if (input === 'ngSrc') { + // When the `ngSrc` input changes, we detect that only in the + // `ngOnChanges` hook, thus the `ngSrc` is already set. We use + // `ngSrc` in the error message, so we use a previous value, but + // not the updated one in it. + dir = { + ngSrc: changes[input].previousValue + }; + } + throw postInitInputChangeError(dir, input); + } + }); +} +/** + * Verifies that a specified input is a number greater than 0. + */ +function assertGreaterThanZero(dir, inputValue, inputName) { + const validNumber = typeof inputValue === 'number' && inputValue > 0; + const validString = typeof inputValue === 'string' && /^\d+$/.test(inputValue.trim()) && parseInt(inputValue) > 0; + if (!validNumber && !validString) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` has an invalid value ` + `(\`${inputValue}\`). To fix this, provide \`${inputName}\` ` + `as a number greater than 0.`); + } +} +/** + * Verifies that the rendered image is not visually distorted. Effectively this is checking: + * - Whether the "width" and "height" attributes reflect the actual dimensions of the image. + * - Whether image styling is "correct" (see below for a longer explanation). + */ +function assertNoImageDistortion(dir, img, renderer) { + const removeListenerFn = renderer.listen(img, 'load', () => { + removeListenerFn(); + const renderedWidth = img.clientWidth; + const renderedHeight = img.clientHeight; + const renderedAspectRatio = renderedWidth / renderedHeight; + const nonZeroRenderedDimensions = renderedWidth !== 0 && renderedHeight !== 0; + const intrinsicWidth = img.naturalWidth; + const intrinsicHeight = img.naturalHeight; + const intrinsicAspectRatio = intrinsicWidth / intrinsicHeight; + const suppliedWidth = dir.width; + const suppliedHeight = dir.height; + const suppliedAspectRatio = suppliedWidth / suppliedHeight; + // Tolerance is used to account for the impact of subpixel rendering. + // Due to subpixel rendering, the rendered, intrinsic, and supplied + // aspect ratios of a correctly configured image may not exactly match. + // For example, a `width=4030 height=3020` image might have a rendered + // size of "1062w, 796.48h". (An aspect ratio of 1.334... vs. 1.333...) + const inaccurateDimensions = Math.abs(suppliedAspectRatio - intrinsicAspectRatio) > ASPECT_RATIO_TOLERANCE; + const stylingDistortion = nonZeroRenderedDimensions && Math.abs(intrinsicAspectRatio - renderedAspectRatio) > ASPECT_RATIO_TOLERANCE; + if (inaccurateDimensions) { + console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the image does not match ` + `the aspect ratio indicated by the width and height attributes. ` + `\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` + `(aspect-ratio: ${intrinsicAspectRatio}). \nSupplied width and height attributes: ` + `${suppliedWidth}w x ${suppliedHeight}h (aspect-ratio: ${suppliedAspectRatio}). ` + `\nTo fix this, update the width and height attributes.`)); + } else if (stylingDistortion) { + console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the rendered image ` + `does not match the image's intrinsic aspect ratio. ` + `\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` + `(aspect-ratio: ${intrinsicAspectRatio}). \nRendered image size: ` + `${renderedWidth}w x ${renderedHeight}h (aspect-ratio: ` + `${renderedAspectRatio}). \nThis issue can occur if "width" and "height" ` + `attributes are added to an image without updating the corresponding ` + `image styling. To fix this, adjust image styling. In most cases, ` + `adding "height: auto" or "width: auto" to the image styling will fix ` + `this issue.`)); + } else if (!dir.ngSrcset && nonZeroRenderedDimensions) { + // If `ngSrcset` hasn't been set, sanity check the intrinsic size. + const recommendedWidth = RECOMMENDED_SRCSET_DENSITY_CAP * renderedWidth; + const recommendedHeight = RECOMMENDED_SRCSET_DENSITY_CAP * renderedHeight; + const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE; + const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE; + if (oversizedWidth || oversizedHeight) { + console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2960 /* RuntimeErrorCode.OVERSIZED_IMAGE */, `${imgDirectiveDetails(dir.ngSrc)} the intrinsic image is significantly ` + `larger than necessary. ` + `\nRendered image size: ${renderedWidth}w x ${renderedHeight}h. ` + `\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h. ` + `\nRecommended intrinsic image size: ${recommendedWidth}w x ${recommendedHeight}h. ` + `\nNote: Recommended intrinsic image size is calculated assuming a maximum DPR of ` + `${RECOMMENDED_SRCSET_DENSITY_CAP}. To improve loading time, resize the image ` + `or consider using the "ngSrcset" and "sizes" attributes.`)); + } + } + }); +} +/** + * Verifies that a specified input is set. + */ +function assertNonEmptyWidthAndHeight(dir) { + let missingAttributes = []; + if (dir.width === undefined) missingAttributes.push('width'); + if (dir.height === undefined) missingAttributes.push('height'); + if (missingAttributes.length > 0) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2954 /* RuntimeErrorCode.REQUIRED_INPUT_MISSING */, `${imgDirectiveDetails(dir.ngSrc)} these required attributes ` + `are missing: ${missingAttributes.map(attr => `"${attr}"`).join(', ')}. ` + `Including "width" and "height" attributes will prevent image-related layout shifts. ` + `To fix this, include "width" and "height" attributes on the image tag or turn on ` + `"fill" mode with the \`fill\` attribute.`); + } +} +/** + * Verifies that width and height are not set. Used in fill mode, where those attributes don't make + * sense. + */ +function assertEmptyWidthAndHeight(dir) { + if (dir.width || dir.height) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the attributes \`height\` and/or \`width\` are present ` + `along with the \`fill\` attribute. Because \`fill\` mode causes an image to fill its containing ` + `element, the size attributes have no effect and should be removed.`); + } +} +/** + * Verifies that the rendered image has a nonzero height. If the image is in fill mode, provides + * guidance that this can be caused by the containing element's CSS position property. + */ +function assertNonZeroRenderedHeight(dir, img, renderer) { + const removeListenerFn = renderer.listen(img, 'load', () => { + removeListenerFn(); + const renderedHeight = img.clientHeight; + if (dir.fill && renderedHeight === 0) { + console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the height of the fill-mode image is zero. ` + `This is likely because the containing element does not have the CSS 'position' ` + `property set to one of the following: "relative", "fixed", or "absolute". ` + `To fix this problem, make sure the container element has the CSS 'position' ` + `property defined and the height of the element is not zero.`)); + } + }); +} +/** + * Verifies that the `loading` attribute is set to a valid input & + * is not used on priority images. + */ +function assertValidLoadingInput(dir) { + if (dir.loading && dir.priority) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute ` + `was used on an image that was marked "priority". ` + `Setting \`loading\` on priority images is not allowed ` + `because these images will always be eagerly loaded. ` + `To fix this, remove the “loading” attribute from the priority image.`); + } + const validInputs = ['auto', 'eager', 'lazy']; + if (typeof dir.loading === 'string' && !validInputs.includes(dir.loading)) { + throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute ` + `has an invalid value (\`${dir.loading}\`). ` + `To fix this, provide a valid value ("lazy", "eager", or "auto").`); + } +} +/** + * Warns if NOT using a loader (falling back to the generic loader) and + * the image appears to be hosted on one of the image CDNs for which + * we do have a built-in image loader. Suggests switching to the + * built-in loader. + * + * @param ngSrc Value of the ngSrc attribute + * @param imageLoader ImageLoader provided + */ +function assertNotMissingBuiltInLoader(ngSrc, imageLoader) { + if (imageLoader === noopImageLoader) { + let builtInLoaderName = ''; + for (const loader of BUILT_IN_LOADERS) { + if (loader.testUrl(ngSrc)) { + builtInLoaderName = loader.name; + break; + } + } + if (builtInLoaderName) { + console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2962 /* RuntimeErrorCode.MISSING_BUILTIN_LOADER */, `NgOptimizedImage: It looks like your images may be hosted on the ` + `${builtInLoaderName} CDN, but your app is not using Angular's ` + `built-in loader for that CDN. We recommend switching to use ` + `the built-in by calling \`provide${builtInLoaderName}Loader()\` ` + `in your \`providers\` and passing it your instance's base URL. ` + `If you don't want to use the built-in loader, define a custom ` + `loader function using IMAGE_LOADER to silence this warning.`)); + } + } +} +/** + * Warns if ngSrcset is present and no loader is configured (i.e. the default one is being used). + */ +function assertNoNgSrcsetWithoutLoader(dir, imageLoader) { + if (dir.ngSrcset && imageLoader === noopImageLoader) { + console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2963 /* RuntimeErrorCode.NGSRCSET_WITHOUT_LOADER */, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` attribute is present but ` + `no image loader is configured (i.e. the default one is being used), ` + `which would result in the same image being used for all configured sizes. ` + `To fix this, provide a loader or remove the \`ngSrcset\` attribute from the image.`)); + } +} + +// These exports represent the set of symbols exposed as a public API. + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +/** + * @module + * @description + * Entry point for all public APIs of this package. + */ +// This file only reexports content of the `src` folder. Keep it that way. + +// This file is not used to build this module. It is only used during editing + +/** + * Generated bundle index. Do not edit. + */ + + + +/***/ }), + +/***/ 2560: +/*!******************************************************!*\ + !*** ./node_modules/@angular/core/fesm2020/core.mjs ***! + \******************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "ANALYZE_FOR_ENTRY_COMPONENTS": () => (/* binding */ ANALYZE_FOR_ENTRY_COMPONENTS), +/* harmony export */ "ANIMATION_MODULE_TYPE": () => (/* binding */ ANIMATION_MODULE_TYPE), +/* harmony export */ "APP_BOOTSTRAP_LISTENER": () => (/* binding */ APP_BOOTSTRAP_LISTENER), +/* harmony export */ "APP_ID": () => (/* binding */ APP_ID), +/* harmony export */ "APP_INITIALIZER": () => (/* binding */ APP_INITIALIZER), +/* harmony export */ "ApplicationInitStatus": () => (/* binding */ ApplicationInitStatus), +/* harmony export */ "ApplicationModule": () => (/* binding */ ApplicationModule), +/* harmony export */ "ApplicationRef": () => (/* binding */ ApplicationRef), +/* harmony export */ "Attribute": () => (/* binding */ Attribute), +/* harmony export */ "COMPILER_OPTIONS": () => (/* binding */ COMPILER_OPTIONS), +/* harmony export */ "CUSTOM_ELEMENTS_SCHEMA": () => (/* binding */ CUSTOM_ELEMENTS_SCHEMA), +/* harmony export */ "ChangeDetectionStrategy": () => (/* binding */ ChangeDetectionStrategy), +/* harmony export */ "ChangeDetectorRef": () => (/* binding */ ChangeDetectorRef), +/* harmony export */ "Compiler": () => (/* binding */ Compiler), +/* harmony export */ "CompilerFactory": () => (/* binding */ CompilerFactory), +/* harmony export */ "Component": () => (/* binding */ Component), +/* harmony export */ "ComponentFactory": () => (/* binding */ ComponentFactory$1), +/* harmony export */ "ComponentFactoryResolver": () => (/* binding */ ComponentFactoryResolver$1), +/* harmony export */ "ComponentRef": () => (/* binding */ ComponentRef$1), +/* harmony export */ "ContentChild": () => (/* binding */ ContentChild), +/* harmony export */ "ContentChildren": () => (/* binding */ ContentChildren), +/* harmony export */ "DEFAULT_CURRENCY_CODE": () => (/* binding */ DEFAULT_CURRENCY_CODE), +/* harmony export */ "DebugElement": () => (/* binding */ DebugElement), +/* harmony export */ "DebugEventListener": () => (/* binding */ DebugEventListener), +/* harmony export */ "DebugNode": () => (/* binding */ DebugNode), +/* harmony export */ "DefaultIterableDiffer": () => (/* binding */ DefaultIterableDiffer), +/* harmony export */ "Directive": () => (/* binding */ Directive), +/* harmony export */ "ENVIRONMENT_INITIALIZER": () => (/* binding */ ENVIRONMENT_INITIALIZER), +/* harmony export */ "ElementRef": () => (/* binding */ ElementRef), +/* harmony export */ "EmbeddedViewRef": () => (/* binding */ EmbeddedViewRef), +/* harmony export */ "EnvironmentInjector": () => (/* binding */ EnvironmentInjector), +/* harmony export */ "ErrorHandler": () => (/* binding */ ErrorHandler), +/* harmony export */ "EventEmitter": () => (/* binding */ EventEmitter), +/* harmony export */ "Host": () => (/* binding */ Host), +/* harmony export */ "HostBinding": () => (/* binding */ HostBinding), +/* harmony export */ "HostListener": () => (/* binding */ HostListener), +/* harmony export */ "INJECTOR": () => (/* binding */ INJECTOR), +/* harmony export */ "Inject": () => (/* binding */ Inject), +/* harmony export */ "InjectFlags": () => (/* binding */ InjectFlags), +/* harmony export */ "Injectable": () => (/* binding */ Injectable), +/* harmony export */ "InjectionToken": () => (/* binding */ InjectionToken), /* harmony export */ "Injector": () => (/* binding */ Injector), /* harmony export */ "Input": () => (/* binding */ Input), /* harmony export */ "IterableDiffers": () => (/* binding */ IterableDiffers), @@ -24396,7 +22963,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "ViewRef": () => (/* binding */ ViewRef), /* harmony export */ "asNativeElements": () => (/* binding */ asNativeElements), /* harmony export */ "assertPlatform": () => (/* binding */ assertPlatform), +/* harmony export */ "createComponent": () => (/* binding */ createComponent), /* harmony export */ "createEnvironmentInjector": () => (/* binding */ createEnvironmentInjector), +/* harmony export */ "createNgModule": () => (/* binding */ createNgModule), /* harmony export */ "createNgModuleRef": () => (/* binding */ createNgModuleRef), /* harmony export */ "createPlatform": () => (/* binding */ createPlatform), /* harmony export */ "createPlatformFactory": () => (/* binding */ createPlatformFactory), @@ -24411,7 +22980,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "importProvidersFrom": () => (/* binding */ importProvidersFrom), /* harmony export */ "inject": () => (/* binding */ inject), /* harmony export */ "isDevMode": () => (/* binding */ isDevMode), +/* harmony export */ "isStandalone": () => (/* binding */ isStandalone), +/* harmony export */ "makeEnvironmentProviders": () => (/* binding */ makeEnvironmentProviders), /* harmony export */ "platformCore": () => (/* binding */ platformCore), +/* harmony export */ "reflectComponentType": () => (/* binding */ reflectComponentType), /* harmony export */ "resolveForwardRef": () => (/* binding */ resolveForwardRef), /* harmony export */ "setTestabilityGetter": () => (/* binding */ setTestabilityGetter), /* harmony export */ "ɵALLOW_MULTIPLE_PLATFORMS": () => (/* binding */ ALLOW_MULTIPLE_PLATFORMS), @@ -24443,6 +23015,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "ɵTESTABILITY": () => (/* binding */ TESTABILITY), /* harmony export */ "ɵTESTABILITY_GETTER": () => (/* binding */ TESTABILITY_GETTER), /* harmony export */ "ɵViewRef": () => (/* binding */ ViewRef$1), +/* harmony export */ "ɵXSS_SECURITY_URL": () => (/* binding */ XSS_SECURITY_URL), /* harmony export */ "ɵ_sanitizeHtml": () => (/* binding */ _sanitizeHtml), /* harmony export */ "ɵ_sanitizeUrl": () => (/* binding */ _sanitizeUrl), /* harmony export */ "ɵallowSanitizationBypassAndThrow": () => (/* binding */ allowSanitizationBypassAndThrow), @@ -24459,6 +23032,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "ɵcompileNgModuleDefs": () => (/* binding */ compileNgModuleDefs), /* harmony export */ "ɵcompileNgModuleFactory": () => (/* binding */ compileNgModuleFactory), /* harmony export */ "ɵcompilePipe": () => (/* binding */ compilePipe), +/* harmony export */ "ɵconvertToBitFlags": () => (/* binding */ convertToBitFlags), /* harmony export */ "ɵcreateInjector": () => (/* binding */ createInjector), /* harmony export */ "ɵdefaultIterableDiffers": () => (/* binding */ defaultIterableDiffers), /* harmony export */ "ɵdefaultKeyValueDiffers": () => (/* binding */ defaultKeyValueDiffers), @@ -24466,6 +23040,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "ɵdevModeEqual": () => (/* binding */ devModeEqual), /* harmony export */ "ɵfindLocaleData": () => (/* binding */ findLocaleData), /* harmony export */ "ɵflushModuleScopingQueueAsMuchAsPossible": () => (/* binding */ flushModuleScopingQueueAsMuchAsPossible), +/* harmony export */ "ɵformatRuntimeError": () => (/* binding */ formatRuntimeError), /* harmony export */ "ɵgetDebugNode": () => (/* binding */ getDebugNode), /* harmony export */ "ɵgetDebugNodeR2": () => (/* binding */ getDebugNodeR2), /* harmony export */ "ɵgetDirectives": () => (/* binding */ getDirectives), @@ -24479,23 +23054,22 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "ɵgetUnknownPropertyStrictMode": () => (/* binding */ ɵgetUnknownPropertyStrictMode), /* harmony export */ "ɵglobal": () => (/* binding */ _global), /* harmony export */ "ɵinjectChangeDetectorRef": () => (/* binding */ injectChangeDetectorRef), -/* harmony export */ "ɵinternalBootstrapApplication": () => (/* binding */ internalBootstrapApplication), +/* harmony export */ "ɵinternalCreateApplication": () => (/* binding */ internalCreateApplication), /* harmony export */ "ɵisBoundToModule": () => (/* binding */ isBoundToModule), /* harmony export */ "ɵisDefaultChangeDetectionStrategy": () => (/* binding */ isDefaultChangeDetectionStrategy), +/* harmony export */ "ɵisEnvironmentProviders": () => (/* binding */ isEnvironmentProviders), +/* harmony export */ "ɵisInjectable": () => (/* binding */ isInjectable), /* harmony export */ "ɵisListLikeIterable": () => (/* binding */ isListLikeIterable), /* harmony export */ "ɵisObservable": () => (/* binding */ isObservable), /* harmony export */ "ɵisPromise": () => (/* binding */ isPromise), -/* harmony export */ "ɵisStandalone": () => (/* binding */ isStandalone), /* harmony export */ "ɵisSubscribable": () => (/* binding */ isSubscribable), /* harmony export */ "ɵivyEnabled": () => (/* binding */ ɵivyEnabled), /* harmony export */ "ɵmakeDecorator": () => (/* binding */ makeDecorator), -/* harmony export */ "ɵmarkDirty": () => (/* binding */ markDirty), /* harmony export */ "ɵnoSideEffects": () => (/* binding */ noSideEffects), /* harmony export */ "ɵpatchComponentDefWithScope": () => (/* binding */ patchComponentDefWithScope), /* harmony export */ "ɵpublishDefaultGlobalUtils": () => (/* binding */ publishDefaultGlobalUtils$1), /* harmony export */ "ɵpublishGlobalUtil": () => (/* binding */ publishGlobalUtil), /* harmony export */ "ɵregisterLocaleData": () => (/* binding */ registerLocaleData), -/* harmony export */ "ɵrenderComponent": () => (/* binding */ renderComponent), /* harmony export */ "ɵresetCompiledComponents": () => (/* binding */ resetCompiledComponents), /* harmony export */ "ɵresetJitOptions": () => (/* binding */ resetJitOptions), /* harmony export */ "ɵresolveComponentResources": () => (/* binding */ resolveComponentResources), @@ -24511,9 +23085,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "ɵtransitiveScopesFor": () => (/* binding */ transitiveScopesFor), /* harmony export */ "ɵunregisterLocaleData": () => (/* binding */ unregisterAllLocaleData), /* harmony export */ "ɵunwrapSafeValue": () => (/* binding */ unwrapSafeValue), -/* harmony export */ "ɵwhenRendered": () => (/* binding */ whenRendered), /* harmony export */ "ɵɵCopyDefinitionFeature": () => (/* binding */ ɵɵCopyDefinitionFeature), /* harmony export */ "ɵɵFactoryTarget": () => (/* binding */ FactoryTarget), +/* harmony export */ "ɵɵHostDirectivesFeature": () => (/* binding */ ɵɵHostDirectivesFeature), /* harmony export */ "ɵɵInheritDefinitionFeature": () => (/* binding */ ɵɵInheritDefinitionFeature), /* harmony export */ "ɵɵNgOnChangesFeature": () => (/* binding */ ɵɵNgOnChangesFeature), /* harmony export */ "ɵɵProvidersFeature": () => (/* binding */ ɵɵProvidersFeature), @@ -24666,6 +23240,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "ɵɵtextInterpolateV": () => (/* binding */ ɵɵtextInterpolateV), /* harmony export */ "ɵɵtrustConstantHtml": () => (/* binding */ ɵɵtrustConstantHtml), /* harmony export */ "ɵɵtrustConstantResourceUrl": () => (/* binding */ ɵɵtrustConstantResourceUrl), +/* harmony export */ "ɵɵvalidateIframeAttribute": () => (/* binding */ ɵɵvalidateIframeAttribute), /* harmony export */ "ɵɵviewQuery": () => (/* binding */ ɵɵviewQuery) /* harmony export */ }); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 228); @@ -24674,19 +23249,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 6646); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 1203); /** - * @license Angular v14.0.0 + * @license Angular v15.1.3 * (c) 2010-2022 Google LLC. https://angular.io/ * License: MIT */ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ function getClosureSafeProperty(objWithPropertyToExtract) { for (let key in objWithPropertyToExtract) { @@ -24694,7 +23262,6 @@ function getClosureSafeProperty(objWithPropertyToExtract) { return key; } } - throw Error('Could not find renamed property on target object.'); } /** @@ -24703,8 +23270,6 @@ function getClosureSafeProperty(objWithPropertyToExtract) { * @param target The target to set properties on * @param source The source of the property keys and values to set */ - - function fillProperties(target, source) { for (const key in source) { if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) { @@ -24712,42 +23277,26 @@ function fillProperties(target, source) { } } } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - function stringify(token) { if (typeof token === 'string') { return token; } - if (Array.isArray(token)) { return '[' + token.map(stringify).join(', ') + ']'; } - if (token == null) { return '' + token; } - if (token.overriddenName) { return `${token.overriddenName}`; } - if (token.name) { return `${token.name}`; } - const res = token.toString(); - if (res == null) { return '' + res; } - const newLineIndex = res.indexOf('\n'); return newLineIndex === -1 ? res : res.substring(0, newLineIndex); } @@ -24759,20 +23308,9 @@ function stringify(token) { * @param after after string. * @returns concatenated string. */ - - function concatStringsWithSpace(before, after) { return before == null || before === '' ? after === null ? '' : after : after == null || after === '' ? before : before + ' ' + after; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - const __forward_ref__ = getClosureSafeProperty({ __forward_ref__: getClosureSafeProperty }); @@ -24788,15 +23326,11 @@ const __forward_ref__ = getClosureSafeProperty({ * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'} * @publicApi */ - - function forwardRef(forwardRefFn) { forwardRefFn.__forward_ref__ = forwardRef; - forwardRefFn.toString = function () { return stringify(this()); }; - return forwardRefFn; } /** @@ -24812,42 +23346,29 @@ function forwardRef(forwardRefFn) { * @see `forwardRef` * @publicApi */ - - function resolveForwardRef(type) { return isForwardRef(type) ? type() : type; } /** Checks whether a function is wrapped by a `forwardRef`. */ - - function isForwardRef(fn) { return typeof fn === 'function' && fn.hasOwnProperty(__forward_ref__) && fn.__forward_ref__ === forwardRef; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ +function isEnvironmentProviders(value) { + return value && !!value.ɵproviders; +} /** * Base URL for the error details page. * - * Keep the files below in full sync: + * Keep this constant in sync across: * - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts * - packages/core/src/error_details_base_url.ts */ - - const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors'; /** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license + * URL for the XSS security documentation. */ +const XSS_SECURITY_URL = 'https://g.co/ng/security#xss'; /** * Class that represents a runtime error. @@ -24864,39 +23385,29 @@ const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors'; * mode (when the `ngDevMode` is defined). In production mode (after tree-shaking pass), the * `message` argument becomes `false`, thus we account for it in the typings and the runtime logic. */ - class RuntimeError extends Error { constructor(code, message) { super(formatRuntimeError(code, message)); this.code = code; } - } /** * Called to format a runtime error. * See additional info on the `message` argument type in the `RuntimeError` class description. */ - - function formatRuntimeError(code, message) { // Error code might be a negative number, which is a special marker that instructs the logic to // generate a link to the error details page on angular.io. + // We also prepend `0` to non-compile-time errors. const fullCode = `NG0${Math.abs(code)}`; - let errorMessage = `${fullCode}${message ? ': ' + message : ''}`; - + let errorMessage = `${fullCode}${message ? ': ' + message.trim() : ''}`; if (ngDevMode && code < 0) { - errorMessage = `${errorMessage}. Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`; + const addPeriodSeparator = !errorMessage.match(/[.,;!?]$/); + const separator = addPeriodSeparator ? '.' : ''; + errorMessage = `${errorMessage}${separator} Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`; } - return errorMessage; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Used for stringify render output in Ivy. @@ -24904,13 +23415,11 @@ function formatRuntimeError(code, message) { * be extra careful not to introduce megamorphic reads in it. * Check `core/test/render3/perf/render_stringify` for benchmarks and alternate implementations. */ - - function renderStringify(value) { if (typeof value === 'string') return value; - if (value == null) return ''; // Use `String` so that it invokes the `toString` method of the value. Note that this + if (value == null) return ''; + // Use `String` so that it invokes the `toString` method of the value. Note that this // appears to be faster than calling `value.toString` (see `render_stringify` benchmark). - return String(value); } /** @@ -24918,184 +23427,133 @@ function renderStringify(value) { * Important! This function contains a megamorphic read and should only be * used for error messages. */ - - function stringifyForError(value) { if (typeof value === 'function') return value.name || value.toString(); - if (typeof value === 'object' && value != null && typeof value.type === 'function') { return value.type.name || value.type.toString(); } - return renderStringify(value); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** Called when directives inject each other (creating a circular dependency) */ - - function throwCyclicDependencyError(token, path) { const depPath = path ? `. Dependency path: ${path.join(' > ')} > ${token}` : ''; - throw new RuntimeError(-200 - /* RuntimeErrorCode.CYCLIC_DI_DEPENDENCY */ - , `Circular dependency in DI detected for ${token}${depPath}`); + throw new RuntimeError(-200 /* RuntimeErrorCode.CYCLIC_DI_DEPENDENCY */, `Circular dependency in DI detected for ${token}${depPath}`); } - function throwMixedMultiProviderError() { throw new Error(`Cannot mix multi providers and regular providers`); } - function throwInvalidProviderError(ngModuleType, providers, provider) { if (ngModuleType && providers) { const providerDetail = providers.map(v => v == provider ? '?' + provider + '?' : '...'); throw new Error(`Invalid provider for the NgModule '${stringify(ngModuleType)}' - only instances of Provider and Type are allowed, got: [${providerDetail.join(', ')}]`); - } else if (provider.ɵproviders) { - throw new RuntimeError(207 - /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */ - , `Invalid providers from 'importProvidersFrom' present in a non-environment injector. 'importProvidersFrom' can't be used for component providers.`); + } else if (isEnvironmentProviders(provider)) { + if (provider.ɵfromNgModule) { + throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, `Invalid providers from 'importProvidersFrom' present in a non-environment injector. 'importProvidersFrom' can't be used for component providers.`); + } else { + throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, `Invalid providers present in a non-environment injector. 'EnvironmentProviders' can't be used for component providers.`); + } } else { throw new Error('Invalid provider'); } } /** Throws an error when a token is not found in DI. */ - - function throwProviderNotFoundError(token, injectorName) { const injectorDetails = injectorName ? ` in ${injectorName}` : ''; - throw new RuntimeError(-201 - /* RuntimeErrorCode.PROVIDER_NOT_FOUND */ - , ngDevMode && `No provider for ${stringifyForError(token)} found${injectorDetails}`); + throw new RuntimeError(-201 /* RuntimeErrorCode.PROVIDER_NOT_FOUND */, ngDevMode && `No provider for ${stringifyForError(token)} found${injectorDetails}`); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - +// The functions in this file verify that the assumptions we are making function assertNumber(actual, msg) { if (!(typeof actual === 'number')) { throwError(msg, typeof actual, 'number', '==='); } } - function assertNumberInRange(actual, minInclusive, maxInclusive) { assertNumber(actual, 'Expected a number'); assertLessThanOrEqual(actual, maxInclusive, 'Expected number to be less than or equal to'); assertGreaterThanOrEqual(actual, minInclusive, 'Expected number to be greater than or equal to'); } - function assertString(actual, msg) { if (!(typeof actual === 'string')) { throwError(msg, actual === null ? 'null' : typeof actual, 'string', '==='); } } - function assertFunction(actual, msg) { if (!(typeof actual === 'function')) { throwError(msg, actual === null ? 'null' : typeof actual, 'function', '==='); } } - function assertEqual(actual, expected, msg) { if (!(actual == expected)) { throwError(msg, actual, expected, '=='); } } - function assertNotEqual(actual, expected, msg) { if (!(actual != expected)) { throwError(msg, actual, expected, '!='); } } - function assertSame(actual, expected, msg) { if (!(actual === expected)) { throwError(msg, actual, expected, '==='); } } - function assertNotSame(actual, expected, msg) { if (!(actual !== expected)) { throwError(msg, actual, expected, '!=='); } } - function assertLessThan(actual, expected, msg) { if (!(actual < expected)) { throwError(msg, actual, expected, '<'); } } - function assertLessThanOrEqual(actual, expected, msg) { if (!(actual <= expected)) { throwError(msg, actual, expected, '<='); } } - function assertGreaterThan(actual, expected, msg) { if (!(actual > expected)) { throwError(msg, actual, expected, '>'); } } - function assertGreaterThanOrEqual(actual, expected, msg) { if (!(actual >= expected)) { throwError(msg, actual, expected, '>='); } } - function assertNotDefined(actual, msg) { if (actual != null) { throwError(msg, actual, null, '=='); } } - function assertDefined(actual, msg) { if (actual == null) { throwError(msg, actual, null, '!='); } } - function throwError(msg, actual, expected, comparison) { throw new Error(`ASSERTION ERROR: ${msg}` + (comparison == null ? '' : ` [Expected=> ${expected} ${comparison} ${actual} <=Actual]`)); } - function assertDomNode(node) { // If we're in a worker, `Node` will not be defined. if (!(typeof Node !== 'undefined' && node instanceof Node) && !(typeof node === 'object' && node != null && node.constructor.name === 'WebWorkerRenderNode')) { throwError(`The provided value must be an instance of a DOM Node but got ${stringify(node)}`); } } - function assertIndexInRange(arr, index) { assertDefined(arr, 'Array must be defined.'); const maxLen = arr.length; - if (index < 0 || index >= maxLen) { throwError(`Index expected to be less than ${maxLen} but got ${index}`); } } - function assertOneOf(value, ...validValues) { if (validValues.indexOf(value) !== -1) return true; throwError(`Expected value to be one of ${JSON.stringify(validValues)} but was ${JSON.stringify(value)}.`); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Construct an injectable definition which defines how a token will be constructed by the DI @@ -25114,8 +23572,6 @@ function assertOneOf(value, ...validValues) { * @codeGenApi * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to npm. */ - - function ɵɵdefineInjectable(opts) { return { token: opts.token, @@ -25129,8 +23585,6 @@ function ɵɵdefineInjectable(opts) { * code should now use ɵɵdefineInjectable instead. * @publicApi */ - - const defineInjectable = ɵɵdefineInjectable; /** * Construct an `InjectorDef` which configures an injector. @@ -25149,7 +23603,6 @@ const defineInjectable = ɵɵdefineInjectable; * * @codeGenApi */ - function ɵɵdefineInjector(options) { return { providers: options.providers || [], @@ -25162,17 +23615,16 @@ function ɵɵdefineInjector(options) { * * @param type A type which may have its own (non-inherited) `ɵprov`. */ - - function getInjectableDef(type) { return getOwnDefinition(type, NG_PROV_DEF) || getOwnDefinition(type, NG_INJECTABLE_DEF); } +function isInjectable(type) { + return getInjectableDef(type) !== null; +} /** * Return definition only if it is defined directly on `type` and is not inherited from a base * class of `type`. */ - - function getOwnDefinition(type, field) { return type.hasOwnProperty(field) ? type[field] : null; } @@ -25184,15 +23636,12 @@ function getOwnDefinition(type, field) { * @deprecated Will be removed in a future version of Angular, where an error will occur in the * scenario if we find the `ɵprov` on an ancestor only. */ - - function getInheritedInjectableDef(type) { const def = type && (type[NG_PROV_DEF] || type[NG_INJECTABLE_DEF]); - if (def) { - const typeName = getTypeName(type); // TODO(FW-1307): Re-add ngDevMode when closure can handle it + const typeName = getTypeName(type); + // TODO(FW-1307): Re-add ngDevMode when closure can handle it // ngDevMode && - console.warn(`DEPRECATED: DI is instantiating a token "${typeName}" that inherits its @Injectable decorator but does not provide one itself.\n` + `This will become an error in a future version of Angular. Please add @Injectable() to the "${typeName}" class.`); return def; } else { @@ -25200,8 +23649,6 @@ function getInheritedInjectableDef(type) { } } /** Gets the name of a type, accounting for some cross-browser differences. */ - - function getTypeName(type) { // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers // it'll always return the name of the function itself, no matter how many other functions it @@ -25212,7 +23659,6 @@ function getTypeName(type) { if (type.hasOwnProperty('name')) { return type.name; } - const match = ('' + type).match(/^function\s*([^\s(]+)/); return match === null ? '' : match[1]; } @@ -25221,70 +23667,47 @@ function getTypeName(type) { * * @param type type which may have an injector def (`ɵinj`) */ - - function getInjectorDef(type) { return type && (type.hasOwnProperty(NG_INJ_DEF) || type.hasOwnProperty(NG_INJECTOR_DEF)) ? type[NG_INJ_DEF] : null; } - const NG_PROV_DEF = getClosureSafeProperty({ ɵprov: getClosureSafeProperty }); const NG_INJ_DEF = getClosureSafeProperty({ ɵinj: getClosureSafeProperty -}); // We need to keep these around so we can read off old defs if new defs are unavailable - +}); +// We need to keep these around so we can read off old defs if new defs are unavailable const NG_INJECTABLE_DEF = getClosureSafeProperty({ ngInjectableDef: getClosureSafeProperty }); const NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafeProperty }); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Injection flags for DI. * * @publicApi + * @deprecated use an options object for `inject` instead. */ - var InjectFlags; - (function (InjectFlags) { // TODO(alxhub): make this 'const' (and remove `InternalInjectFlags` enum) when ngc no longer // writes exports of it into ngfactory files. - /** Check self and check parent injector if needed */ InjectFlags[InjectFlags["Default"] = 0] = "Default"; /** * Specifies that an injector should retrieve a dependency from any injector until reaching the * host element of the current component. (Only used with Element Injector) */ - InjectFlags[InjectFlags["Host"] = 1] = "Host"; /** Don't ascend to ancestors of the node requesting injection. */ - InjectFlags[InjectFlags["Self"] = 2] = "Self"; /** Skip the node that is requesting injection. */ - InjectFlags[InjectFlags["SkipSelf"] = 4] = "SkipSelf"; /** Inject `defaultValue` instead if token not found. */ - InjectFlags[InjectFlags["Optional"] = 8] = "Optional"; })(InjectFlags || (InjectFlags = {})); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Current implementation of inject. @@ -25295,18 +23718,13 @@ var InjectFlags; * 1. `Injector` should not depend on ivy logic. * 2. To maintain tree shake-ability we don't want to bring in unnecessary code. */ - - let _injectImplementation; - function getInjectImplementation() { return _injectImplementation; } /** * Sets the current inject implementation. */ - - function setInjectImplementation(impl) { const previous = _injectImplementation; _injectImplementation = impl; @@ -25319,15 +23737,11 @@ function setInjectImplementation(impl) { * `"root"`. This is known as the limp mode injection. In such case the value is stored in the * injectable definition. */ - - function injectRootLimpMode(token, notFoundValue, flags) { const injectableDef = getInjectableDef(token); - if (injectableDef && injectableDef.providedIn == 'root') { return injectableDef.value === undefined ? injectableDef.value = injectableDef.factory() : injectableDef.value; } - if (flags & InjectFlags.Optional) return null; if (notFoundValue !== undefined) return notFoundValue; throwProviderNotFoundError(stringify(token), 'Injector'); @@ -25339,18 +23753,295 @@ function injectRootLimpMode(token, notFoundValue, flags) { * * @param fn Function which it should not equal to */ - - function assertInjectImplementationNotEqual(fn) { ngDevMode && assertNotEqual(_injectImplementation, fn, 'Calling ɵɵinject would cause infinite recursion'); } + +// Always use __globalThis if available, which is the spec-defined global variable across all +// environments, then fallback to __global first, because in Node tests both __global and +// __window may be defined and _global should be __global in that case. Note: Typeof/Instanceof +// checks are considered side-effects in Terser. We explicitly mark this as side-effect free: +// https://github.com/terser/terser/issues/250. +const _global = /* @__PURE__ */(() => typeof globalThis !== 'undefined' && globalThis || typeof global !== 'undefined' && global || typeof window !== 'undefined' && window || typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && self)(); +function ngDevModeResetPerfCounters() { + const locationString = typeof location !== 'undefined' ? location.toString() : ''; + const newCounters = { + namedConstructors: locationString.indexOf('ngDevMode=namedConstructors') != -1, + firstCreatePass: 0, + tNode: 0, + tView: 0, + rendererCreateTextNode: 0, + rendererSetText: 0, + rendererCreateElement: 0, + rendererAddEventListener: 0, + rendererSetAttribute: 0, + rendererRemoveAttribute: 0, + rendererSetProperty: 0, + rendererSetClassName: 0, + rendererAddClass: 0, + rendererRemoveClass: 0, + rendererSetStyle: 0, + rendererRemoveStyle: 0, + rendererDestroy: 0, + rendererDestroyNode: 0, + rendererMoveNode: 0, + rendererRemoveNode: 0, + rendererAppendChild: 0, + rendererInsertBefore: 0, + rendererCreateComment: 0 + }; + // Make sure to refer to ngDevMode as ['ngDevMode'] for closure. + const allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1; + _global['ngDevMode'] = allowNgDevModeTrue && newCounters; + return newCounters; +} /** - * @license - * Copyright Google LLC All Rights Reserved. + * This function checks to see if the `ngDevMode` has been set. If yes, + * then we honor it, otherwise we default to dev mode with additional checks. * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license + * The idea is that unless we are doing production build where we explicitly + * set `ngDevMode == false` we should be helping the developer by providing + * as much early warning and errors as possible. + * + * `ɵɵdefineComponent` is guaranteed to have been called before any component template functions + * (and thus Ivy instructions), so a single initialization there is sufficient to ensure ngDevMode + * is defined for the entire instruction set. + * + * When checking `ngDevMode` on toplevel, always init it before referencing it + * (e.g. `((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode())`), otherwise you can + * get a `ReferenceError` like in https://github.com/angular/angular/issues/31595. + * + * Details on possible values for `ngDevMode` can be found on its docstring. + * + * NOTE: + * - changes to the `ngDevMode` name must be synced with `compiler-cli/src/tooling.ts`. + */ +function initNgDevMode() { + // The below checks are to ensure that calling `initNgDevMode` multiple times does not + // reset the counters. + // If the `ngDevMode` is not an object, then it means we have not created the perf counters + // yet. + if (typeof ngDevMode === 'undefined' || ngDevMode) { + if (typeof ngDevMode !== 'object') { + ngDevModeResetPerfCounters(); + } + return typeof ngDevMode !== 'undefined' && !!ngDevMode; + } + return false; +} +const _THROW_IF_NOT_FOUND = {}; +const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND; +/* + * Name of a property (that we patch onto DI decorator), which is used as an annotation of which + * InjectFlag this decorator represents. This allows to avoid direct references to the DI decorators + * in the code, thus making them tree-shakable. + */ +const DI_DECORATOR_FLAG = '__NG_DI_FLAG__'; +const NG_TEMP_TOKEN_PATH = 'ngTempTokenPath'; +const NG_TOKEN_PATH = 'ngTokenPath'; +const NEW_LINE = /\n/gm; +const NO_NEW_LINE = 'ɵ'; +const SOURCE = '__source'; +/** + * Current injector value used by `inject`. + * - `undefined`: it is an error to call `inject` + * - `null`: `inject` can be called but there is no injector (limp-mode). + * - Injector instance: Use the injector for resolution. + */ +let _currentInjector = undefined; +function setCurrentInjector(injector) { + const former = _currentInjector; + _currentInjector = injector; + return former; +} +function injectInjectorOnly(token, flags = InjectFlags.Default) { + if (_currentInjector === undefined) { + throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode && `inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \`EnvironmentInjector#runInContext\`.`); + } else if (_currentInjector === null) { + return injectRootLimpMode(token, undefined, flags); + } else { + return _currentInjector.get(token, flags & InjectFlags.Optional ? null : undefined, flags); + } +} +function ɵɵinject(token, flags = InjectFlags.Default) { + return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags); +} +/** + * Throws an error indicating that a factory function could not be generated by the compiler for a + * particular class. + * + * The name of the class is not mentioned here, but will be in the generated factory function name + * and thus in the stack trace. + * + * @codeGenApi + */ +function ɵɵinvalidFactoryDep(index) { + throw new RuntimeError(202 /* RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY */, ngDevMode && `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid. +This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator. + +Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`); +} +/** + * Injects a token from the currently active injector. + * `inject` is only supported during instantiation of a dependency by the DI system. It can be used + * during: + * - Construction (via the `constructor`) of a class being instantiated by the DI system, such + * as an `@Injectable` or `@Component`. + * - In the initializer for fields of such classes. + * - In the factory function specified for `useFactory` of a `Provider` or an `@Injectable`. + * - In the `factory` function specified for an `InjectionToken`. + * + * @param token A token that represents a dependency that should be injected. + * @param flags Optional flags that control how injection is executed. + * The flags correspond to injection strategies that can be specified with + * parameter decorators `@Host`, `@Self`, `@SkipSelf`, and `@Optional`. + * @returns the injected value if operation is successful, `null` otherwise. + * @throws if called outside of a supported context. + * + * @usageNotes + * In practice the `inject()` calls are allowed in a constructor, a constructor parameter and a + * field initializer: + * + * ```typescript + * @Injectable({providedIn: 'root'}) + * export class Car { + * radio: Radio|undefined; + * // OK: field initializer + * spareTyre = inject(Tyre); + * + * constructor() { + * // OK: constructor body + * this.radio = inject(Radio); + * } + * } + * ``` + * + * It is also legal to call `inject` from a provider's factory: + * + * ```typescript + * providers: [ + * {provide: Car, useFactory: () => { + * // OK: a class factory + * const engine = inject(Engine); + * return new Car(engine); + * }} + * ] + * ``` + * + * Calls to the `inject()` function outside of the class creation context will result in error. Most + * notably, calls to `inject()` are disallowed after a class instance was created, in methods + * (including lifecycle hooks): + * + * ```typescript + * @Component({ ... }) + * export class CarComponent { + * ngOnInit() { + * // ERROR: too late, the component instance was already created + * const engine = inject(Engine); + * engine.start(); + * } + * } + * ``` + * + * @publicApi + */ +function inject(token, flags = InjectFlags.Default) { + return ɵɵinject(token, convertToBitFlags(flags)); +} +// Converts object-based DI flags (`InjectOptions`) to bit flags (`InjectFlags`). +function convertToBitFlags(flags) { + if (typeof flags === 'undefined' || typeof flags === 'number') { + return flags; + } + // While TypeScript doesn't accept it without a cast, bitwise OR with false-y values in + // JavaScript is a no-op. We can use that for a very codesize-efficient conversion from + // `InjectOptions` to `InjectFlags`. + return 0 /* InternalInjectFlags.Default */ | ( + // comment to force a line break in the formatter + flags.optional && 8 /* InternalInjectFlags.Optional */) | (flags.host && 1 /* InternalInjectFlags.Host */) | (flags.self && 2 /* InternalInjectFlags.Self */) | (flags.skipSelf && 4 /* InternalInjectFlags.SkipSelf */); +} + +function injectArgs(types) { + const args = []; + for (let i = 0; i < types.length; i++) { + const arg = resolveForwardRef(types[i]); + if (Array.isArray(arg)) { + if (arg.length === 0) { + throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && 'Arguments array must have arguments.'); + } + let type = undefined; + let flags = InjectFlags.Default; + for (let j = 0; j < arg.length; j++) { + const meta = arg[j]; + const flag = getInjectFlag(meta); + if (typeof flag === 'number') { + // Special case when we handle @Inject decorator. + if (flag === -1 /* DecoratorFlags.Inject */) { + type = meta.token; + } else { + flags |= flag; + } + } else { + type = meta; + } + } + args.push(ɵɵinject(type, flags)); + } else { + args.push(ɵɵinject(arg)); + } + } + return args; +} +/** + * Attaches a given InjectFlag to a given decorator using monkey-patching. + * Since DI decorators can be used in providers `deps` array (when provider is configured using + * `useFactory`) without initialization (e.g. `Host`) and as an instance (e.g. `new Host()`), we + * attach the flag to make it available both as a static property and as a field on decorator + * instance. + * + * @param decorator Provided DI decorator. + * @param flag InjectFlag that should be applied. + */ +function attachInjectFlag(decorator, flag) { + decorator[DI_DECORATOR_FLAG] = flag; + decorator.prototype[DI_DECORATOR_FLAG] = flag; + return decorator; +} +/** + * Reads monkey-patched property that contains InjectFlag attached to a decorator. + * + * @param token Token that may contain monkey-patched DI flags property. */ +function getInjectFlag(token) { + return token[DI_DECORATOR_FLAG]; +} +function catchInjectorError(e, token, injectorErrorName, source) { + const tokenPath = e[NG_TEMP_TOKEN_PATH]; + if (token[SOURCE]) { + tokenPath.unshift(token[SOURCE]); + } + e.message = formatError('\n' + e.message, tokenPath, injectorErrorName, source); + e[NG_TOKEN_PATH] = tokenPath; + e[NG_TEMP_TOKEN_PATH] = null; + throw e; +} +function formatError(text, obj, injectorErrorName, source = null) { + text = text && text.charAt(0) === '\n' && text.charAt(1) == NO_NEW_LINE ? text.slice(2) : text; + let context = stringify(obj); + if (Array.isArray(obj)) { + context = obj.map(stringify).join(' -> '); + } else if (typeof obj === 'object') { + let parts = []; + for (let key in obj) { + if (obj.hasOwnProperty(key)) { + let value = obj[key]; + parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value))); + } + } + context = `{${parts.join(', ')}}`; + } + return `${injectorErrorName}${source ? '(' + source + ')' : ''}[${context}]: ${text.replace(NEW_LINE, '\n ')}`; +} /** * Convince closure compiler that the wrapped function has no side-effects. @@ -25361,20 +24052,11 @@ function assertInjectImplementationNotEqual(fn) { * to something which is retained otherwise the call to `noSideEffects` will be removed by closure * compiler. */ - - function noSideEffects(fn) { return { toString: fn }.toString(); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * The strategy that the default change detector uses to detect changes. @@ -25384,10 +24066,7 @@ function noSideEffects(fn) { * * @publicApi */ - - var ChangeDetectionStrategy; - (function (ChangeDetectionStrategy) { /** * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated @@ -25400,17 +24079,13 @@ var ChangeDetectionStrategy; * Use the default `CheckAlways` strategy, in which change detection is automatic until * explicitly deactivated. */ - ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default"; })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {})); /** * Defines the possible states of the default change detector. * @see `ChangeDetectorRef` */ - - var ChangeDetectorStatus; - (function (ChangeDetectorStatus) { /** * A state in which, after calling `detectChanges()`, the change detector @@ -25421,31 +24096,26 @@ var ChangeDetectorStatus; * A state in which change detection is skipped until the change detector mode * becomes `CheckOnce`. */ - ChangeDetectorStatus[ChangeDetectorStatus["Checked"] = 1] = "Checked"; /** * A state in which change detection continues automatically until explicitly * deactivated. */ - ChangeDetectorStatus[ChangeDetectorStatus["CheckAlways"] = 2] = "CheckAlways"; /** * A state in which a change detector sub tree is not a part of the main tree and * should be skipped. */ - ChangeDetectorStatus[ChangeDetectorStatus["Detached"] = 3] = "Detached"; /** * Indicates that the change detector encountered an error checking a binding * or calling a directive lifecycle method and is now in an inconsistent state. Change * detectors in this state do not detect changes. */ - ChangeDetectorStatus[ChangeDetectorStatus["Errored"] = 4] = "Errored"; /** * Indicates that the change detector has been destroyed. */ - ChangeDetectorStatus[ChangeDetectorStatus["Destroyed"] = 5] = "Destroyed"; })(ChangeDetectorStatus || (ChangeDetectorStatus = {})); /** @@ -25455,18 +24125,9 @@ var ChangeDetectorStatus; * @see `ChangeDetectorStatus` * @see `ChangeDetectorRef` */ - - function isDefaultChangeDetectionStrategy(changeDetectionStrategy) { return changeDetectionStrategy == null || changeDetectionStrategy === ChangeDetectionStrategy.Default; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Defines the CSS styles encapsulation policies for the {@link Component} decorator's @@ -25481,14 +24142,10 @@ function isDefaultChangeDetectionStrategy(changeDetectionStrategy) { * * @publicApi */ - - var ViewEncapsulation$1; - (function (ViewEncapsulation) { // TODO: consider making `ViewEncapsulation` a `const enum` instead. See // https://github.com/angular/angular/issues/44119 for additional information. - /** * Emulates a native Shadow DOM encapsulation behavior by adding a specific attribute to the * component's host element and applying the same attribute to all the CSS selectors provided @@ -25496,124 +24153,21 @@ var ViewEncapsulation$1; * * This is the default option. */ - ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; // Historically the 1 value was for `Native` encapsulation which has been removed as of v11. - + ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; + // Historically the 1 value was for `Native` encapsulation which has been removed as of v11. /** * Doesn't provide any sort of CSS style encapsulation, meaning that all the styles provided * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls} are applicable * to any HTML element of the application regardless of their host Component. */ - ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; /** * Uses the browser's native Shadow DOM API to encapsulate CSS styles, meaning that it creates * a ShadowRoot for the component's host element which is then used to encapsulate * all the Component's styling. */ - ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom"; })(ViewEncapsulation$1 || (ViewEncapsulation$1 = {})); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -// Always use __globalThis if available, which is the spec-defined global variable across all -// environments, then fallback to __global first, because in Node tests both __global and -// __window may be defined and _global should be __global in that case. Note: Typeof/Instanceof -// checks are considered side-effects in Terser. We explicitly mark this as side-effect free: -// https://github.com/terser/terser/issues/250. - - -const _global = /* @__PURE__ */(() => typeof globalThis !== 'undefined' && globalThis || typeof global !== 'undefined' && global || typeof window !== 'undefined' && window || typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && self)(); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - -function ngDevModeResetPerfCounters() { - const locationString = typeof location !== 'undefined' ? location.toString() : ''; - const newCounters = { - namedConstructors: locationString.indexOf('ngDevMode=namedConstructors') != -1, - firstCreatePass: 0, - tNode: 0, - tView: 0, - rendererCreateTextNode: 0, - rendererSetText: 0, - rendererCreateElement: 0, - rendererAddEventListener: 0, - rendererSetAttribute: 0, - rendererRemoveAttribute: 0, - rendererSetProperty: 0, - rendererSetClassName: 0, - rendererAddClass: 0, - rendererRemoveClass: 0, - rendererSetStyle: 0, - rendererRemoveStyle: 0, - rendererDestroy: 0, - rendererDestroyNode: 0, - rendererMoveNode: 0, - rendererRemoveNode: 0, - rendererAppendChild: 0, - rendererInsertBefore: 0, - rendererCreateComment: 0 - }; // Make sure to refer to ngDevMode as ['ngDevMode'] for closure. - - const allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1; - _global['ngDevMode'] = allowNgDevModeTrue && newCounters; - return newCounters; -} -/** - * This function checks to see if the `ngDevMode` has been set. If yes, - * then we honor it, otherwise we default to dev mode with additional checks. - * - * The idea is that unless we are doing production build where we explicitly - * set `ngDevMode == false` we should be helping the developer by providing - * as much early warning and errors as possible. - * - * `ɵɵdefineComponent` is guaranteed to have been called before any component template functions - * (and thus Ivy instructions), so a single initialization there is sufficient to ensure ngDevMode - * is defined for the entire instruction set. - * - * When checking `ngDevMode` on toplevel, always init it before referencing it - * (e.g. `((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode())`), otherwise you can - * get a `ReferenceError` like in https://github.com/angular/angular/issues/31595. - * - * Details on possible values for `ngDevMode` can be found on its docstring. - * - * NOTE: - * - changes to the `ngDevMode` name must be synced with `compiler-cli/src/tooling.ts`. - */ - - -function initNgDevMode() { - // The below checks are to ensure that calling `initNgDevMode` multiple times does not - // reset the counters. - // If the `ngDevMode` is not an object, then it means we have not created the perf counters - // yet. - if (typeof ngDevMode === 'undefined' || ngDevMode) { - if (typeof ngDevMode !== 'object') { - ngDevModeResetPerfCounters(); - } - - return typeof ngDevMode !== 'undefined' && !!ngDevMode; - } - - return false; -} -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * This file contains reuseable "empty" symbols that can be used as default return values @@ -25621,28 +24175,17 @@ function initNgDevMode() { * allows for identity checks against these values to be consistently used by the framework * code. */ - - const EMPTY_OBJ = {}; -const EMPTY_ARRAY = []; // freezing the values prevents any code from accidentally inserting new values in - +const EMPTY_ARRAY = []; +// freezing the values prevents any code from accidentally inserting new values in if ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) { // These property accesses can be ignored because ngDevMode will be set to false // when optimizing code and the whole if statement will be dropped. // tslint:disable-next-line:no-toplevel-property-access - Object.freeze(EMPTY_OBJ); // tslint:disable-next-line:no-toplevel-property-access - + Object.freeze(EMPTY_OBJ); + // tslint:disable-next-line:no-toplevel-property-access Object.freeze(EMPTY_ARRAY); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - const NG_COMP_DEF = getClosureSafeProperty({ ɵcmp: getClosureSafeProperty }); @@ -25664,19 +24207,12 @@ const NG_FACTORY_DEF = getClosureSafeProperty({ * bloom filter bit for DI. */ // TODO(misko): This is wrong. The NG_ELEMENT_ID should never be minified. - const NG_ELEMENT_ID = getClosureSafeProperty({ __NG_ELEMENT_ID__: getClosureSafeProperty }); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -let _renderCompCount = 0; +/** Counter used to generate unique IDs for component definitions. */ +let componentDefCount = 0; /** * Create a component definition object. * @@ -25693,7 +24229,6 @@ let _renderCompCount = 0; * ``` * @codeGenApi */ - function ɵɵdefineComponent(componentDefinition) { return noSideEffects(() => { // Initialize ngDevMode. This must be the first statement in ɵɵdefineComponent. @@ -25730,16 +24265,17 @@ function ɵɵdefineComponent(componentDefinition) { features: componentDefinition.features || null, data: componentDefinition.data || {}, encapsulation: componentDefinition.encapsulation || ViewEncapsulation$1.Emulated, - id: 'c', + id: `c${componentDefCount++}`, styles: componentDefinition.styles || EMPTY_ARRAY, _: null, setInput: null, schemas: componentDefinition.schemas || null, - tView: null + tView: null, + findHostDirectiveDefs: null, + hostDirectives: null }; const dependencies = componentDefinition.dependencies; const feature = componentDefinition.features; - def.id += _renderCompCount++; def.inputs = invertObject(componentDefinition.inputs, declaredInputs), def.outputs = invertObject(componentDefinition.outputs), feature && feature.forEach(fn => fn(def)); def.directiveDefs = dependencies ? () => (typeof dependencies === 'function' ? dependencies() : dependencies).map(extractDirectiveDef).filter(nonNull) : null; def.pipeDefs = dependencies ? () => (typeof dependencies === 'function' ? dependencies() : dependencies).map(getPipeDef$1).filter(nonNull) : null; @@ -25755,29 +24291,20 @@ function ɵɵdefineComponent(componentDefinition) { * * @codeGenApi */ - - function ɵɵsetComponentScope(type, directives, pipes) { const def = type.ɵcmp; - def.directiveDefs = () => (typeof directives === 'function' ? directives() : directives).map(extractDirectiveDef); - def.pipeDefs = () => (typeof pipes === 'function' ? pipes() : pipes).map(getPipeDef$1); } - function extractDirectiveDef(type) { return getComponentDef(type) || getDirectiveDef(type); } - function nonNull(value) { return value !== null; } - -const autoRegisterModuleById = {}; /** * @codeGenApi */ - function ɵɵdefineNgModule(def) { return noSideEffects(() => { const res = { @@ -25790,11 +24317,6 @@ function ɵɵdefineNgModule(def) { schemas: def.schemas || null, id: def.id || null }; - - if (def.id != null) { - autoRegisterModuleById[def.id] = def.type; - } - return res; }); } @@ -25808,8 +24330,6 @@ function ɵɵdefineNgModule(def) { * * @codeGenApi */ - - function ɵɵsetNgModuleScope(type, scope) { return noSideEffects(() => { const ngModuleDef = getNgModuleDef(type, true); @@ -25873,30 +24393,23 @@ function ɵɵsetNgModuleScope(type, scope) { * */ - - function invertObject(obj, secondary) { if (obj == null) return EMPTY_OBJ; const newLookup = {}; - for (const minifiedKey in obj) { if (obj.hasOwnProperty(minifiedKey)) { let publicName = obj[minifiedKey]; let declaredName = publicName; - if (Array.isArray(publicName)) { declaredName = publicName[1]; publicName = publicName[0]; } - newLookup[publicName] = minifiedKey; - if (secondary) { secondary[publicName] = declaredName; } } } - return newLookup; } /** @@ -25915,8 +24428,6 @@ function invertObject(obj, secondary) { * * @codeGenApi */ - - const ɵɵdefineDirective = ɵɵdefineComponent; /** * Create a pipe definition object. @@ -25934,7 +24445,6 @@ const ɵɵdefineDirective = ɵɵdefineComponent; * * @codeGenApi */ - function ɵɵdefinePipe(pipeDef) { return { type: pipeDef.type, @@ -25950,41 +24460,38 @@ function ɵɵdefinePipe(pipeDef) { * honors inheritance, but in the future we may change the rule to require that definitions are * explicit. This would require some sort of migration strategy. */ - - function getComponentDef(type) { return type[NG_COMP_DEF] || null; } - function getDirectiveDef(type) { return type[NG_DIR_DEF] || null; } - function getPipeDef$1(type) { return type[NG_PIPE_DEF] || null; } - +/** + * Checks whether a given Component, Directive or Pipe is marked as standalone. + * This will return false if passed anything other than a Component, Directive, or Pipe class + * See this guide for additional information: https://angular.io/guide/standalone-components + * + * @param type A reference to a Component, Directive or Pipe. + * @publicApi + */ +function isStandalone(type) { + const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type); + return def !== null ? def.standalone : false; +} function getNgModuleDef(type, throwNotFound) { const ngModuleDef = type[NG_MOD_DEF] || null; - if (!ngModuleDef && throwNotFound === true) { throw new Error(`Type ${stringify(type)} does not have 'ɵmod' property.`); } - return ngModuleDef; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ + // Below are constants for LView indices to help us look up LView members // without having to remember the specific indices. // Uglify will inline these when minifying so there shouldn't be a cost. - - const HOST = 0; const TVIEW = 1; const FLAGS = 2; @@ -25999,8 +24506,8 @@ const RENDERER_FACTORY = 10; const RENDERER = 11; const SANITIZER = 12; const CHILD_HEAD = 13; -const CHILD_TAIL = 14; // FIXME(misko): Investigate if the three declarations aren't all same thing. - +const CHILD_TAIL = 14; +// FIXME(misko): Investigate if the three declarations aren't all same thing. const DECLARATION_VIEW = 15; const DECLARATION_COMPONENT_VIEW = 16; const DECLARATION_LCONTAINER = 17; @@ -26015,39 +24522,22 @@ const EMBEDDED_VIEW_INJECTOR = 21; * instruction index into `LView` index. All other indexes should be in the `LView` index space and * there should be no need to refer to `HEADER_OFFSET` anywhere else. */ - const HEADER_OFFSET = 22; -/** - * Converts `TViewType` into human readable text. - * Make sure this matches with `TViewType` - */ - -const TViewTypeAsString = ['Root', 'Component', 'Embedded' // 2 -]; // Note: This hack is necessary so we don't erroneously get a circular dependency +// Note: This hack is necessary so we don't erroneously get a circular dependency // failure based on types. - -const unusedValueExportToPlacateAjd$8 = 1; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ +const unusedValueExportToPlacateAjd$4 = 1; /** * Special location which allows easy identification of type. If we have an array which was * retrieved from the `LView` and that array has `true` at `TYPE` location, we know it is * `LContainer`. */ - const TYPE = 1; /** * Below are constants for LContainer indices to help us look up LContainer members * without having to remember the specific indices. * Uglify will inline these when minifying so there shouldn't be a cost. */ - /** * Flag to signify that this `LContainer` may have transplanted views which need to be change * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`. @@ -26056,12 +24546,11 @@ const TYPE = 1; * a lot of work in `refreshEmbeddedViews`. But when set we still need to verify * that the `MOVED_VIEWS` are transplanted and on-push. */ - -const HAS_TRANSPLANTED_VIEWS = 2; // PARENT, NEXT, TRANSPLANTED_VIEWS_TO_REFRESH are indices 3, 4, and 5 +const HAS_TRANSPLANTED_VIEWS = 2; +// PARENT, NEXT, TRANSPLANTED_VIEWS_TO_REFRESH are indices 3, 4, and 5 // As we already have these constants in LView, we don't need to re-create them. // T_HOST is index 6 // We already have this constants in LView, we don't need to re-create it. - const NATIVE = 7; const VIEW_REFS = 8; const MOVED_VIEWS = 9; @@ -26071,24 +24560,15 @@ const MOVED_VIEWS = 9; * which views are already in the DOM (and don't need to be re-added) and so we can * remove views from the DOM when they are no longer required. */ - -const CONTAINER_HEADER_OFFSET = 10; // Note: This hack is necessary so we don't erroneously get a circular dependency +const CONTAINER_HEADER_OFFSET = 10; +// Note: This hack is necessary so we don't erroneously get a circular dependency // failure based on types. - -const unusedValueExportToPlacateAjd$7 = 1; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ +const unusedValueExportToPlacateAjd$3 = 1; /** * True if `value` is `LView`. * @param value wrapped value of `RNode`, `LView`, `LContainer` */ - function isLView(value) { return Array.isArray(value) && typeof value[TYPE] === 'object'; } @@ -26096,123 +24576,78 @@ function isLView(value) { * True if `value` is `LContainer`. * @param value wrapped value of `RNode`, `LView`, `LContainer` */ - - function isLContainer(value) { return Array.isArray(value) && value[TYPE] === true; } - function isContentQueryHost(tNode) { - return (tNode.flags & 8 - /* TNodeFlags.hasContentQuery */ - ) !== 0; + return (tNode.flags & 4 /* TNodeFlags.hasContentQuery */) !== 0; } - function isComponentHost(tNode) { - return (tNode.flags & 2 - /* TNodeFlags.isComponentHost */ - ) === 2 - /* TNodeFlags.isComponentHost */ - ; + return tNode.componentOffset > -1; } - function isDirectiveHost(tNode) { - return (tNode.flags & 1 - /* TNodeFlags.isDirectiveHost */ - ) === 1 - /* TNodeFlags.isDirectiveHost */ - ; + return (tNode.flags & 1 /* TNodeFlags.isDirectiveHost */) === 1 /* TNodeFlags.isDirectiveHost */; } function isComponentDef(def) { return def.template !== null; } - function isRootView(target) { - return (target[FLAGS] & 256 - /* LViewFlags.IsRoot */ - ) !== 0; + return (target[FLAGS] & 256 /* LViewFlags.IsRoot */) !== 0; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ + // [Assert functions do not constraint type when they are guarded by a truthy // expression.](https://github.com/microsoft/TypeScript/issues/37295) - - function assertTNodeForLView(tNode, lView) { assertTNodeForTView(tNode, lView[TVIEW]); } - function assertTNodeForTView(tNode, tView) { assertTNode(tNode); tNode.hasOwnProperty('tView_') && assertEqual(tNode.tView_, tView, 'This TNode does not belong to this TView.'); } - function assertTNode(tNode) { assertDefined(tNode, 'TNode must be defined'); - if (!(tNode && typeof tNode === 'object' && tNode.hasOwnProperty('directiveStylingLast'))) { throwError('Not of type TNode, got: ' + tNode); } } - function assertTIcu(tIcu) { assertDefined(tIcu, 'Expected TIcu to be defined'); - if (!(typeof tIcu.currentCaseLViewIndex === 'number')) { throwError('Object is not of TIcu type.'); } } - function assertComponentType(actual, msg = 'Type passed in is not ComponentType, it does not have \'ɵcmp\' property.') { if (!getComponentDef(actual)) { throwError(msg); } } - function assertNgModuleType(actual, msg = 'Type passed in is not NgModuleType, it does not have \'ɵmod\' property.') { if (!getNgModuleDef(actual)) { throwError(msg); } } - function assertCurrentTNodeIsParent(isParent) { assertEqual(isParent, true, 'currentTNode should be a parent'); } - function assertHasParent(tNode) { assertDefined(tNode, 'currentTNode should exist!'); assertDefined(tNode.parent, 'currentTNode should have a parent'); } - -function assertDataNext(lView, index, arr) { - if (arr == null) arr = lView; - assertEqual(arr.length, index, `index ${index} expected to be at the end of arr (length ${arr.length})`); -} - function assertLContainer(value) { assertDefined(value, 'LContainer must be defined'); assertEqual(isLContainer(value), true, 'Expecting LContainer'); } - function assertLViewOrUndefined(value) { value && assertEqual(isLView(value), true, 'Expecting LView or undefined or null'); } - function assertLView(value) { assertDefined(value, 'LView must be defined'); assertEqual(isLView(value), true, 'Expecting LView'); } - function assertFirstCreatePass(tView, errMessage) { assertEqual(tView.firstCreatePass, true, errMessage || 'Should only be called in first create pass.'); } - function assertFirstUpdatePass(tView, errMessage) { assertEqual(tView.firstUpdatePass, true, errMessage || 'Should only be called in first update pass.'); } @@ -26220,40 +24655,28 @@ function assertFirstUpdatePass(tView, errMessage) { * This is a basic sanity check that an object is probably a directive def. DirectiveDef is * an interface, so we can't do a direct instanceof check. */ - - function assertDirectiveDef(obj) { if (obj.type === undefined || obj.selectors == undefined || obj.inputs === undefined) { throwError(`Expected a DirectiveDef/ComponentDef and this object does not seem to have the expected shape.`); } } - function assertIndexInDeclRange(lView, index) { const tView = lView[1]; assertBetween(HEADER_OFFSET, tView.bindingStartIndex, index); } - -function assertIndexInVarsRange(lView, index) { - const tView = lView[1]; - assertBetween(tView.bindingStartIndex, tView.expandoStartIndex, index); -} - function assertIndexInExpandoRange(lView, index) { const tView = lView[1]; assertBetween(tView.expandoStartIndex, lView.length, index); } - function assertBetween(lower, upper, index) { if (!(lower <= index && index < upper)) { throwError(`Index out of range (expecting ${lower} <= ${index} < ${upper})`); } } - function assertProjectionSlots(lView, errMessage) { assertDefined(lView[DECLARATION_COMPONENT_VIEW], 'Component views should exist.'); assertDefined(lView[DECLARATION_COMPONENT_VIEW][T_HOST].projection, errMessage || 'Components with projection nodes () must have projection slots defined.'); } - function assertParentView(lView, errMessage) { assertDefined(lView, errMessage || 'Component views should always have a parent view (component\'s host view)'); } @@ -26264,13 +24687,9 @@ function assertParentView(lView, errMessage) { * @param lView `LView` which should be checked. * @param injectorIndex index into the `LView` where the `NodeInjector` is expected. */ - - function assertNodeInjector(lView, injectorIndex) { assertIndexInExpandoRange(lView, injectorIndex); - assertIndexInExpandoRange(lView, injectorIndex + 8 - /* NodeInjectorOffset.PARENT */ - ); + assertIndexInExpandoRange(lView, injectorIndex + 8 /* NodeInjectorOffset.PARENT */); assertNumber(lView[injectorIndex + 0], 'injectorIndex should point to a bloom filter'); assertNumber(lView[injectorIndex + 1], 'injectorIndex should point to a bloom filter'); assertNumber(lView[injectorIndex + 2], 'injectorIndex should point to a bloom filter'); @@ -26279,35 +24698,15 @@ function assertNodeInjector(lView, injectorIndex) { assertNumber(lView[injectorIndex + 5], 'injectorIndex should point to a bloom filter'); assertNumber(lView[injectorIndex + 6], 'injectorIndex should point to a bloom filter'); assertNumber(lView[injectorIndex + 7], 'injectorIndex should point to a bloom filter'); - assertNumber(lView[injectorIndex + 8 - /* NodeInjectorOffset.PARENT */ - ], 'injectorIndex should point to parent injector'); + assertNumber(lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */], 'injectorIndex should point to parent injector'); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - function getFactoryDef(type, throwNotFound) { const hasFactoryDef = type.hasOwnProperty(NG_FACTORY_DEF); - if (!hasFactoryDef && throwNotFound === true && ngDevMode) { throw new Error(`Type ${stringify(type)} does not have 'ɵfac' property.`); } - return hasFactoryDef ? type[NG_FACTORY_DEF] : null; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Represents a basic change from a previous to a new value for a single @@ -26318,8 +24717,6 @@ function getFactoryDef(type, throwNotFound) { * * @publicApi */ - - class SimpleChange { constructor(previousValue, currentValue, firstChange) { this.previousValue = previousValue; @@ -26329,20 +24726,10 @@ class SimpleChange { /** * Check whether the new value is the first value assigned. */ - - isFirstChange() { return this.firstChange; } - } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * The NgOnChangesFeature decorates a component with support for the ngOnChanges @@ -26366,25 +24753,19 @@ class SimpleChange { * * @codeGenApi */ - - function ɵɵNgOnChangesFeature() { return NgOnChangesFeatureImpl; } - function NgOnChangesFeatureImpl(definition) { if (definition.type.prototype.ngOnChanges) { definition.setInput = ngOnChangesSetInput; } - return rememberChangeHistoryAndInvokeOnChangesHook; -} // This option ensures that the ngOnChanges lifecycle hook will be inherited +} +// This option ensures that the ngOnChanges lifecycle hook will be inherited // from superclasses (in InheritDefinitionFeature). - /** @nocollapse */ // tslint:disable-next-line:no-toplevel-property-access - - ɵɵNgOnChangesFeature.ngInherit = true; /** * This is a synthetic lifecycle hook which gets inserted into `TView.preOrderHooks` to simulate @@ -26396,14 +24777,11 @@ function NgOnChangesFeatureImpl(definition) { * @param this Component instance. Because this function gets inserted into `TView.preOrderHooks`, * it is guaranteed to be called with component instance. */ - function rememberChangeHistoryAndInvokeOnChangesHook() { const simpleChangesStore = getSimpleChangesStore(this); const current = simpleChangesStore?.current; - if (current) { const previous = simpleChangesStore.previous; - if (previous === EMPTY_OBJ) { simpleChangesStore.previous = current; } else { @@ -26413,43 +24791,30 @@ function rememberChangeHistoryAndInvokeOnChangesHook() { previous[key] = current[key]; } } - simpleChangesStore.current = null; this.ngOnChanges(current); } } - function ngOnChangesSetInput(instance, value, publicName, privateName) { + const declaredName = this.declaredInputs[publicName]; + ngDevMode && assertString(declaredName, 'Name of input in ngOnChanges has to be a string'); const simpleChangesStore = getSimpleChangesStore(instance) || setSimpleChangesStore(instance, { previous: EMPTY_OBJ, current: null }); const current = simpleChangesStore.current || (simpleChangesStore.current = {}); const previous = simpleChangesStore.previous; - const declaredName = this.declaredInputs[publicName]; const previousChange = previous[declaredName]; current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ); instance[privateName] = value; } - const SIMPLE_CHANGES_STORE = '__ngSimpleChanges__'; - function getSimpleChangesStore(instance) { return instance[SIMPLE_CHANGES_STORE] || null; } - function setSimpleChangesStore(instance, store) { return instance[SIMPLE_CHANGES_STORE] = store; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - let profilerCallback = null; /** * Sets the callback function which will be invoked before and after performing certain actions at @@ -26461,7 +24826,6 @@ let profilerCallback = null; * * @param profiler function provided by the caller or null value to disable profiling. */ - const setProfiler = profiler => { profilerCallback = profiler; }; @@ -26474,131 +24838,13 @@ const setProfiler = profiler => { * execution context * @returns */ - - const profiler = function (event, instance, hookOrListener) { - if (profilerCallback != null - /* both `null` and `undefined` */ - ) { + if (profilerCallback != null /* both `null` and `undefined` */) { profilerCallback(event, instance, hookOrListener); } }; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - const SVG_NAMESPACE = 'svg'; -const SVG_NAMESPACE_URI = 'http://www.w3.org/2000/svg'; const MATH_ML_NAMESPACE = 'math'; -const MATH_ML_NAMESPACE_URI = 'http://www.w3.org/1998/MathML/'; - -function getNamespaceUri(namespace) { - const name = namespace.toLowerCase(); - return name === SVG_NAMESPACE ? SVG_NAMESPACE_URI : name === MATH_ML_NAMESPACE ? MATH_ML_NAMESPACE_URI : null; -} -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -/** - * Most of the use of `document` in Angular is from within the DI system so it is possible to simply - * inject the `DOCUMENT` token and are done. - * - * Ivy is special because it does not rely upon the DI and must get hold of the document some other - * way. - * - * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy. - * Wherever ivy needs the global document, it calls `getDocument()` instead. - * - * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to - * tell ivy what the global `document` is. - * - * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`) - * by calling `setDocument()` when providing the `DOCUMENT` token. - */ - - -let DOCUMENT = undefined; -/** - * Tell ivy what the `document` is for this platform. - * - * It is only necessary to call this if the current platform is not a browser. - * - * @param document The object representing the global `document` in this environment. - */ - -function setDocument(document) { - DOCUMENT = document; -} -/** - * Access the object that represents the `document` for this platform. - * - * Ivy calls this whenever it needs to access the `document` object. - * For example to create the renderer or to do sanitization. - */ - - -function getDocument() { - if (DOCUMENT !== undefined) { - return DOCUMENT; - } else if (typeof document !== 'undefined') { - return document; - } // No "document" can be found. This should only happen if we are running ivy outside Angular and - // the current platform is not a browser. Since this is not a supported scenario at the moment - // this should not happen in Angular apps. - // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a - // public API. Meanwhile we just return `undefined` and let the application fail. - - - return undefined; -} -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -// TODO: cleanup once the code is merged in angular/angular - - -var RendererStyleFlags3; - -(function (RendererStyleFlags3) { - RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important"; - RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase"; -})(RendererStyleFlags3 || (RendererStyleFlags3 = {})); -/** Returns whether the `renderer` is a `ProceduralRenderer3` */ - - -function isProceduralRenderer(renderer) { - return !!renderer.listen; -} - -const domRendererFactory3 = { - createRenderer: (hostElement, rendererType) => { - return getDocument(); - } -}; // Note: This hack is necessary so we don't erroneously get a circular dependency -// failure based on types. - -const unusedValueExportToPlacateAjd$6 = 1; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`) @@ -26616,25 +24862,20 @@ const unusedValueExportToPlacateAjd$6 = 1; * * NOTE: it is assumed that `Array.isArray` and `typeof` operations are very efficient. */ - /** * Returns `RNode`. * @param value wrapped value of `RNode`, `LView`, `LContainer` */ - function unwrapRNode(value) { while (Array.isArray(value)) { value = value[HOST]; } - return value; } /** * Returns `LView` or `null` if not found. * @param value wrapped value of `RNode`, `LView`, `LContainer` */ - - function unwrapLView(value) { while (Array.isArray(value)) { // This check is same as `isLView()` but we don't call at as we don't want to call @@ -26642,31 +24883,12 @@ function unwrapLView(value) { if (typeof value[TYPE] === 'object') return value; value = value[HOST]; } - - return null; -} -/** - * Returns `LContainer` or `null` if not found. - * @param value wrapped value of `RNode`, `LView`, `LContainer` - */ - - -function unwrapLContainer(value) { - while (Array.isArray(value)) { - // This check is same as `isLContainer()` but we don't call at as we don't want to call - // `Array.isArray()` twice and give JITer more work for inlining. - if (value[TYPE] === true) return value; - value = value[HOST]; - } - return null; } /** * Retrieves an element value from the provided `viewData`, by unwrapping * from any containers, component views, or style contexts. */ - - function getNativeByIndex(index, lView) { ngDevMode && assertIndexInRange(lView, index); ngDevMode && assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Expected to be past HEADER_OFFSET'); @@ -26680,13 +24902,10 @@ function getNativeByIndex(index, lView) { * @param tNode * @param lView */ - - function getNativeByTNode(tNode, lView) { ngDevMode && assertTNodeForLView(tNode, lView); ngDevMode && assertIndexInRange(lView, tNode.index); const node = unwrapRNode(lView[tNode.index]); - ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node); return node; } /** @@ -26697,22 +24916,16 @@ function getNativeByTNode(tNode, lView) { * @param tNode * @param lView */ - - function getNativeByTNodeOrNull(tNode, lView) { const index = tNode === null ? -1 : tNode.index; - if (index !== -1) { ngDevMode && assertTNodeForLView(tNode, lView); const node = unwrapRNode(lView[index]); - ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node); return node; } - return null; -} // fixme(misko): The return Type should be `TNode|null` - - +} +// fixme(misko): The return Type should be `TNode|null` function getTNode(tView, index) { ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode'); ngDevMode && assertLessThan(index, tView.data.length, 'wrong index for TNode'); @@ -26721,13 +24934,10 @@ function getTNode(tView, index) { return tNode; } /** Retrieves a value from any `LView` or `TData`. */ - - function load(view, index) { ngDevMode && assertIndexInRange(view, index); return view[index]; } - function getComponentLViewByIndex(nodeIndex, hostView) { // Could be an LView or an LContainer. If LContainer, unwrap to find LView. ngDevMode && assertIndexInRange(hostView, nodeIndex); @@ -26736,14 +24946,8 @@ function getComponentLViewByIndex(nodeIndex, hostView) { return lView; } /** Checks whether a given view is in creation mode */ - - function isCreationMode(view) { - return (view[FLAGS] & 4 - /* LViewFlags.CreationMode */ - ) === 4 - /* LViewFlags.CreationMode */ - ; + return (view[FLAGS] & 4 /* LViewFlags.CreationMode */) === 4 /* LViewFlags.CreationMode */; } /** * Returns a boolean for whether the view is attached to the change detection tree. @@ -26751,22 +24955,13 @@ function isCreationMode(view) { * Note: This determines whether a view should be checked, not whether it's inserted * into a container. For that, you'll want `viewAttachedToContainer` below. */ - - function viewAttachedToChangeDetector(view) { - return (view[FLAGS] & 64 - /* LViewFlags.Attached */ - ) === 64 - /* LViewFlags.Attached */ - ; + return (view[FLAGS] & 64 /* LViewFlags.Attached */) === 64 /* LViewFlags.Attached */; } /** Returns a boolean for whether the view is attached to a container. */ - - function viewAttachedToContainer(view) { return isLContainer(view[PARENT]); } - function getConstant(consts, index) { if (index === null || index === undefined) return null; ngDevMode && assertIndexInRange(consts, index); @@ -26776,8 +24971,6 @@ function getConstant(consts, index) { * Resets the pre-order hook flags of the view. * @param lView the LView on which the flags are reset */ - - function resetPreOrderHookFlags(lView) { lView[PREORDER_HOOK_FLAGS] = 0; } @@ -26788,28 +24981,16 @@ function resetPreOrderHookFlags(lView) { * or * 2. counter goes from 1 to 0, indicating there are no more descendant views to refresh */ - - function updateTransplantedViewCount(lContainer, amount) { lContainer[TRANSPLANTED_VIEWS_TO_REFRESH] += amount; let viewOrContainer = lContainer; let parent = lContainer[PARENT]; - while (parent !== null && (amount === 1 && viewOrContainer[TRANSPLANTED_VIEWS_TO_REFRESH] === 1 || amount === -1 && viewOrContainer[TRANSPLANTED_VIEWS_TO_REFRESH] === 0)) { parent[TRANSPLANTED_VIEWS_TO_REFRESH] += amount; viewOrContainer = parent; parent = parent[PARENT]; } } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - const instructionState = { lFrame: createLFrame(null), bindingsEnabled: true @@ -26822,30 +25003,24 @@ const instructionState = { * The `checkNoChanges` function is invoked only in ngDevMode=true and verifies that no unintended * changes exist in the change detector or its children. */ - let _isInCheckNoChangesMode = false; /** * Returns true if the instruction state stack is empty. * * Intended to be called from tests only (tree shaken otherwise). */ - function specOnlyIsInstructionStateEmpty() { return instructionState.lFrame.parent === null; } - function getElementDepthCount() { return instructionState.lFrame.elementDepthCount; } - function increaseElementDepthCount() { instructionState.lFrame.elementDepthCount++; } - function decreaseElementDepthCount() { instructionState.lFrame.elementDepthCount--; } - function getBindingsEnabled() { return instructionState.bindingsEnabled; } @@ -26868,8 +25043,6 @@ function getBindingsEnabled() { * * @codeGenApi */ - - function ɵɵenableBindings() { instructionState.bindingsEnabled = true; } @@ -26892,28 +25065,21 @@ function ɵɵenableBindings() { * * @codeGenApi */ - - function ɵɵdisableBindings() { instructionState.bindingsEnabled = false; } /** * Return the current `LView`. */ - - function getLView() { return instructionState.lFrame.lView; } /** * Return the current `TView`. */ - - function getTView() { return instructionState.lFrame.tView; -} // TODO(crisbeto): revert the @noinline once Closure issue is resolved. - +} /** * Restores `contextViewData` to the given OpaqueViewState instance. * @@ -26925,10 +25091,7 @@ function getTView() { * @returns Context of the restored OpaqueViewState instance. * * @codeGenApi - * @noinline Disable inlining due to issue with Closure in listeners inside embedded views. */ - - function ɵɵrestoreView(viewToRestore) { instructionState.lFrame.contextLView = viewToRestore; return viewToRestore[CONTEXT]; @@ -26939,105 +25102,77 @@ function ɵɵrestoreView(viewToRestore) { * * @codeGenApi */ - - function ɵɵresetView(value) { instructionState.lFrame.contextLView = null; return value; } - function getCurrentTNode() { let currentTNode = getCurrentTNodePlaceholderOk(); - - while (currentTNode !== null && currentTNode.type === 64 - /* TNodeType.Placeholder */ - ) { + while (currentTNode !== null && currentTNode.type === 64 /* TNodeType.Placeholder */) { currentTNode = currentTNode.parent; } - return currentTNode; } - function getCurrentTNodePlaceholderOk() { return instructionState.lFrame.currentTNode; } - function getCurrentParentTNode() { const lFrame = instructionState.lFrame; const currentTNode = lFrame.currentTNode; return lFrame.isParent ? currentTNode : currentTNode.parent; } - function setCurrentTNode(tNode, isParent) { ngDevMode && tNode && assertTNodeForTView(tNode, instructionState.lFrame.tView); const lFrame = instructionState.lFrame; lFrame.currentTNode = tNode; lFrame.isParent = isParent; } - function isCurrentTNodeParent() { return instructionState.lFrame.isParent; } - function setCurrentTNodeAsNotParent() { instructionState.lFrame.isParent = false; } - -function setCurrentTNodeAsParent() { - instructionState.lFrame.isParent = true; -} - function getContextLView() { const contextLView = instructionState.lFrame.contextLView; ngDevMode && assertDefined(contextLView, 'contextLView must be defined.'); return contextLView; } - function isInCheckNoChangesMode() { !ngDevMode && throwError('Must never be called in production mode'); return _isInCheckNoChangesMode; } - function setIsInCheckNoChangesMode(mode) { !ngDevMode && throwError('Must never be called in production mode'); _isInCheckNoChangesMode = mode; -} // top level variables should not be exported for performance reasons (PERF_NOTES.md) - - +} +// top level variables should not be exported for performance reasons (PERF_NOTES.md) function getBindingRoot() { const lFrame = instructionState.lFrame; let index = lFrame.bindingRootIndex; - if (index === -1) { index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex; } - return index; } - function getBindingIndex() { return instructionState.lFrame.bindingIndex; } - function setBindingIndex(value) { return instructionState.lFrame.bindingIndex = value; } - function nextBindingIndex() { return instructionState.lFrame.bindingIndex++; } - function incrementBindingIndex(count) { const lFrame = instructionState.lFrame; const index = lFrame.bindingIndex; lFrame.bindingIndex = lFrame.bindingIndex + count; return index; } - function isInI18nBlock() { return instructionState.lFrame.inI18n; } - function setInI18nBlock(isInI18nBlock) { instructionState.lFrame.inI18n = isInI18nBlock; } @@ -27052,8 +25187,6 @@ function setInI18nBlock(isInI18nBlock) { * @param currentDirectiveIndex `TData[currentDirectiveIndex]` will point to the current directive * whose `hostBindings` are being processed. */ - - function setBindingRootForHostBindings(bindingRootIndex, currentDirectiveIndex) { const lFrame = instructionState.lFrame; lFrame.bindingIndex = lFrame.bindingRootIndex = bindingRootIndex; @@ -27064,8 +25197,6 @@ function setBindingRootForHostBindings(bindingRootIndex, currentDirectiveIndex) * `TView.data[getCurrentDirectiveIndex()]` is `DirectiveDef` * `LView[getCurrentDirectiveIndex()]` is directive instance. */ - - function getCurrentDirectiveIndex() { return instructionState.lFrame.currentDirectiveIndex; } @@ -27074,8 +25205,6 @@ function getCurrentDirectiveIndex() { * * @param currentDirectiveIndex `TData` index where current directive instance can be found. */ - - function setCurrentDirectiveIndex(currentDirectiveIndex) { instructionState.lFrame.currentDirectiveIndex = currentDirectiveIndex; } @@ -27085,17 +25214,13 @@ function setCurrentDirectiveIndex(currentDirectiveIndex) { * * @param tData Current `TData` where the `DirectiveDef` will be looked up at. */ - - function getCurrentDirectiveDef(tData) { const currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex; return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex]; } - function getCurrentQueryIndex() { return instructionState.lFrame.currentQueryIndex; } - function setCurrentQueryIndex(value) { instructionState.lFrame.currentQueryIndex = value; } @@ -27104,28 +25229,20 @@ function setCurrentQueryIndex(value) { * * @param lView an `LView` that we want to find parent `TNode` for. */ - - function getDeclarationTNode(lView) { - const tView = lView[TVIEW]; // Return the declaration parent for embedded views - - if (tView.type === 2 - /* TViewType.Embedded */ - ) { + const tView = lView[TVIEW]; + // Return the declaration parent for embedded views + if (tView.type === 2 /* TViewType.Embedded */) { ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.'); return tView.declTNode; - } // Components don't have `TView.declTNode` because each instance of component could be + } + // Components don't have `TView.declTNode` because each instance of component could be // inserted in different location, hence `TView.declTNode` is meaningless. // Falling back to `T_HOST` in case we cross component boundary. - - - if (tView.type === 1 - /* TViewType.Component */ - ) { + if (tView.type === 1 /* TViewType.Component */) { return lView[T_HOST]; - } // Remaining TNode type is `TViewType.Root` which doesn't have a parent TNode. - - + } + // Remaining TNode type is `TViewType.Root` which doesn't have a parent TNode. return null; } /** @@ -27141,42 +25258,32 @@ function getDeclarationTNode(lView) { * - If `true` than this call must be fallowed by `leaveDI` * - If `false` than this call failed and we should NOT call `leaveDI` */ - - function enterDI(lView, tNode, flags) { ngDevMode && assertLViewOrUndefined(lView); - if (flags & InjectFlags.SkipSelf) { ngDevMode && assertTNodeForTView(tNode, lView[TVIEW]); let parentTNode = tNode; let parentLView = lView; - while (true) { ngDevMode && assertDefined(parentTNode, 'Parent TNode should be defined'); parentTNode = parentTNode.parent; - if (parentTNode === null && !(flags & InjectFlags.Host)) { parentTNode = getDeclarationTNode(parentLView); - if (parentTNode === null) break; // In this case, a parent exists and is definitely an element. So it will definitely + if (parentTNode === null) break; + // In this case, a parent exists and is definitely an element. So it will definitely // have an existing lView as the declaration view, which is why we can assume it's defined. - ngDevMode && assertDefined(parentLView, 'Parent LView should be defined'); - parentLView = parentLView[DECLARATION_VIEW]; // In Ivy there are Comment nodes that correspond to ngIf and NgFor embedded directives + parentLView = parentLView[DECLARATION_VIEW]; + // In Ivy there are Comment nodes that correspond to ngIf and NgFor embedded directives // We want to skip those and look only at Elements and ElementContainers to ensure // we're looking at true parent nodes, and not content or other types. - - if (parentTNode.type & (2 - /* TNodeType.Element */ - | 8 - /* TNodeType.ElementContainer */ - )) { + if (parentTNode.type & (2 /* TNodeType.Element */ | 8 /* TNodeType.ElementContainer */)) { break; } } else { break; } } - if (parentTNode === null) { // If we failed to find a parent TNode this means that we should use module injector. return false; @@ -27185,7 +25292,6 @@ function enterDI(lView, tNode, flags) { lView = parentLView; } } - ngDevMode && assertTNodeForLView(tNode, lView); const lFrame = instructionState.lFrame = allocLFrame(); lFrame.currentTNode = tNode; @@ -27203,13 +25309,10 @@ function enterDI(lView, tNode, flags) { * @param newView New lView to become active * @returns the previously active lView; */ - - function enterView(newView) { ngDevMode && assertNotEqual(newView[0], newView[1], '????'); ngDevMode && assertLViewOrUndefined(newView); const newLFrame = allocLFrame(); - if (ngDevMode) { assertEqual(newLFrame.isParent, true, 'Expected clean LFrame'); assertEqual(newLFrame.lView, null, 'Expected clean LFrame'); @@ -27221,7 +25324,6 @@ function enterView(newView) { assertEqual(newLFrame.bindingRootIndex, -1, 'Expected clean LFrame'); assertEqual(newLFrame.currentQueryIndex, 0, 'Expected clean LFrame'); } - const tView = newView[TVIEW]; instructionState.lFrame = newLFrame; ngDevMode && tView.firstChild && assertTNodeForTView(tView.firstChild, tView); @@ -27235,15 +25337,12 @@ function enterView(newView) { /** * Allocates next free LFrame. This function tries to reuse the `LFrame`s to lower memory pressure. */ - - function allocLFrame() { const currentLFrame = instructionState.lFrame; const childLFrame = currentLFrame === null ? null : currentLFrame.child; const newLFrame = childLFrame === null ? createLFrame(currentLFrame) : childLFrame; return newLFrame; } - function createLFrame(parent) { const lFrame = { currentTNode: null, @@ -27263,7 +25362,6 @@ function createLFrame(parent) { inI18n: false }; parent !== null && (parent.child = lFrame); // link the new LFrame for reuse. - return lFrame; } /** @@ -27275,8 +25373,6 @@ function createLFrame(parent) { * NOTE: This function is reexported as `leaveDI`. However `leaveDI` has return type of `void` where * as `leaveViewLight` has `LFrame`. This is so that `leaveViewLight` can be used in `leaveView`. */ - - function leaveViewLight() { const oldLFrame = instructionState.lFrame; instructionState.lFrame = oldLFrame.parent; @@ -27290,8 +25386,6 @@ function leaveViewLight() { * NOTE: this function is an alias so that we can change the type of the function to have `void` * return type. */ - - const leaveDI = leaveViewLight; /** * Leave the current `LView` @@ -27301,7 +25395,6 @@ const leaveDI = leaveViewLight; * IMPORTANT: We must zero out the `LFrame` values here otherwise they will be retained. This is * because for performance reasons we don't release `LFrame` but rather keep it for next use. */ - function leaveView() { const oldLFrame = leaveViewLight(); oldLFrame.isParent = true; @@ -27315,19 +25408,16 @@ function leaveView() { oldLFrame.bindingIndex = -1; oldLFrame.currentQueryIndex = 0; } - function nextContextImpl(level) { const contextLView = instructionState.lFrame.contextLView = walkUpViews(level, instructionState.lFrame.contextLView); return contextLView[CONTEXT]; } - function walkUpViews(nestingLevel, currentView) { while (nestingLevel > 0) { ngDevMode && assertDefined(currentView[DECLARATION_VIEW], 'Declaration view should be defined if nesting level is greater than 0.'); currentView = currentView[DECLARATION_VIEW]; nestingLevel--; } - return currentView; } /** @@ -27336,8 +25426,6 @@ function walkUpViews(nestingLevel, currentView) { * Used with {@link property} instruction (and more in the future) to identify the index in the * current `LView` to act on. */ - - function getSelectedIndex() { return instructionState.lFrame.selectedIndex; } @@ -27350,8 +25438,6 @@ function getSelectedIndex() { * (Note that if an "exit function" was set earlier (via `setElementExitFn()`) then that will be * run if and when the provided `index` value is different from the current selected index value.) */ - - function setSelectedIndex(index) { ngDevMode && index !== -1 && assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Index must be past HEADER_OFFSET (or -1).'); ngDevMode && assertLessThan(index, instructionState.lFrame.lView.length, 'Can\'t set index passed end of LView'); @@ -27360,8 +25446,6 @@ function setSelectedIndex(index) { /** * Gets the `tNode` that represents currently selected element. */ - - function getSelectedTNode() { const lFrame = instructionState.lFrame; return getTNode(lFrame.tView, lFrame.selectedIndex); @@ -27371,8 +25455,6 @@ function getSelectedTNode() { * * @codeGenApi */ - - function ɵɵnamespaceSVG() { instructionState.lFrame.currentNamespace = SVG_NAMESPACE; } @@ -27381,8 +25463,6 @@ function ɵɵnamespaceSVG() { * * @codeGenApi */ - - function ɵɵnamespaceMathML() { instructionState.lFrame.currentNamespace = MATH_ML_NAMESPACE; } @@ -27392,8 +25472,6 @@ function ɵɵnamespaceMathML() { * * @codeGenApi */ - - function ɵɵnamespaceHTML() { namespaceHTMLInternal(); } @@ -27401,22 +25479,12 @@ function ɵɵnamespaceHTML() { * Sets the namespace used to create elements to `null`, which forces element creation to use * `createElement` rather than `createElementNS`. */ - - function namespaceHTMLInternal() { instructionState.lFrame.currentNamespace = null; } - function getNamespace$1() { return instructionState.lFrame.currentNamespace; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Adds all directive lifecycle hooks from the given `DirectiveDef` to the given `TView`. @@ -27430,8 +25498,6 @@ function getNamespace$1() { * @param directiveDef The definition containing the hooks to setup in tView * @param tView The current TView */ - - function registerPreOrderHooks(directiveIndex, directiveDef, tView) { ngDevMode && assertFirstCreatePass(tView); const { @@ -27439,17 +25505,14 @@ function registerPreOrderHooks(directiveIndex, directiveDef, tView) { ngOnInit, ngDoCheck } = directiveDef.type.prototype; - if (ngOnChanges) { const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef); (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, wrappedOnChanges); (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(directiveIndex, wrappedOnChanges); } - if (ngOnInit) { (tView.preOrderHooks || (tView.preOrderHooks = [])).push(0 - directiveIndex, ngOnInit); } - if (ngDoCheck) { (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, ngDoCheck); (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(directiveIndex, ngDoCheck); @@ -27473,13 +25536,11 @@ function registerPreOrderHooks(directiveIndex, directiveDef, tView) { * @param tView The current TView * @param tNode The TNode whose directives are to be searched for hooks to queue */ - - function registerPostOrderHooks(tView, tNode) { - ngDevMode && assertFirstCreatePass(tView); // It's necessary to loop through the directives at elementEnd() (rather than processing in + ngDevMode && assertFirstCreatePass(tView); + // It's necessary to loop through the directives at elementEnd() (rather than processing in // directiveCreate) so we can preserve the current hook order. Content, view, and destroy // hooks for projected components and directives must be called *before* their hosts. - for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) { const directiveDef = tView.data[i]; ngDevMode && assertDefined(directiveDef, 'Expecting DirectiveDef'); @@ -27491,25 +25552,20 @@ function registerPostOrderHooks(tView, tNode) { ngAfterViewChecked, ngOnDestroy } = lifecycleHooks; - if (ngAfterContentInit) { (tView.contentHooks || (tView.contentHooks = [])).push(-i, ngAfterContentInit); } - if (ngAfterContentChecked) { (tView.contentHooks || (tView.contentHooks = [])).push(i, ngAfterContentChecked); (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, ngAfterContentChecked); } - if (ngAfterViewInit) { (tView.viewHooks || (tView.viewHooks = [])).push(-i, ngAfterViewInit); } - if (ngAfterViewChecked) { (tView.viewHooks || (tView.viewHooks = [])).push(i, ngAfterViewChecked); (tView.viewCheckHooks || (tView.viewCheckHooks = [])).push(i, ngAfterViewChecked); } - if (ngOnDestroy != null) { (tView.destroyHooks || (tView.destroyHooks = [])).push(i, ngOnDestroy); } @@ -27534,7 +25590,6 @@ function registerPostOrderHooks(tView, tNode) { * - the number of init hooks already found in the processed part of the array * They are are stored as flags in LView[PREORDER_HOOK_FLAGS]. */ - /** * Executes pre-order check hooks ( OnChanges, DoChanges) given a view where all the init hooks were * executed once. This is a light version of executeInitAndCheckPreOrderHooks where we can skip read @@ -27548,12 +25603,8 @@ function registerPostOrderHooks(tView, tNode) { * - number: execute hooks only from the saved index until that node index exclusive (pre-order * case, when executing select(number)) */ - - function executeCheckHooks(lView, hooks, nodeIndex) { - callHooks(lView, hooks, 3 - /* InitPhaseState.InitPhaseCompleted */ - , nodeIndex); + callHooks(lView, hooks, 3 /* InitPhaseState.InitPhaseCompleted */, nodeIndex); } /** * Executes post-order init and check hooks (one of AfterContentInit, AfterContentChecked, @@ -27568,35 +25619,18 @@ function executeCheckHooks(lView, hooks, nodeIndex) { * - number: execute hooks only from the saved index until that node index exclusive (pre-order * case, when executing select(number)) */ - - function executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) { - ngDevMode && assertNotEqual(initPhase, 3 - /* InitPhaseState.InitPhaseCompleted */ - , 'Init pre-order hooks should not be called more than once'); - - if ((lView[FLAGS] & 3 - /* LViewFlags.InitPhaseStateMask */ - ) === initPhase) { + ngDevMode && assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init pre-order hooks should not be called more than once'); + if ((lView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) { callHooks(lView, hooks, initPhase, nodeIndex); } } - function incrementInitPhaseFlags(lView, initPhase) { - ngDevMode && assertNotEqual(initPhase, 3 - /* InitPhaseState.InitPhaseCompleted */ - , 'Init hooks phase should not be incremented after all init hooks have been run.'); + ngDevMode && assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init hooks phase should not be incremented after all init hooks have been run.'); let flags = lView[FLAGS]; - - if ((flags & 3 - /* LViewFlags.InitPhaseStateMask */ - ) === initPhase) { - flags &= 2047 - /* LViewFlags.IndexWithinInitPhaseReset */ - ; - flags += 1 - /* LViewFlags.InitPhaseStateIncrementer */ - ; + if ((flags & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) { + flags &= 2047 /* LViewFlags.IndexWithinInitPhaseReset */; + flags += 1 /* LViewFlags.InitPhaseStateIncrementer */; lView[FLAGS] = flags; } } @@ -27614,40 +25648,26 @@ function incrementInitPhaseFlags(lView, initPhase) { * - number: execute hooks only from the saved index until that node index exclusive (pre-order * case, when executing select(number)) */ - - function callHooks(currentView, arr, initPhase, currentNodeIndex) { ngDevMode && assertEqual(isInCheckNoChangesMode(), false, 'Hooks should never be run when in check no changes mode.'); - const startIndex = currentNodeIndex !== undefined ? currentView[PREORDER_HOOK_FLAGS] & 65535 - /* PreOrderHookFlags.IndexOfTheNextPreOrderHookMaskMask */ - : 0; + const startIndex = currentNodeIndex !== undefined ? currentView[PREORDER_HOOK_FLAGS] & 65535 /* PreOrderHookFlags.IndexOfTheNextPreOrderHookMaskMask */ : 0; const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1; const max = arr.length - 1; // Stop the loop at length - 1, because we look for the hook at i + 1 - let lastNodeIndexFound = 0; - for (let i = startIndex; i < max; i++) { const hook = arr[i + 1]; - if (typeof hook === 'number') { lastNodeIndexFound = arr[i]; - if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) { break; } } else { const isInitHook = arr[i] < 0; - if (isInitHook) currentView[PREORDER_HOOK_FLAGS] += 65536 - /* PreOrderHookFlags.NumberOfInitHooksCalledIncrementer */ - ; - + if (isInitHook) currentView[PREORDER_HOOK_FLAGS] += 65536 /* PreOrderHookFlags.NumberOfInitHooksCalledIncrementer */; if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) { callHook(currentView, initPhase, arr, i); - currentView[PREORDER_HOOK_FLAGS] = (currentView[PREORDER_HOOK_FLAGS] & 4294901760 - /* PreOrderHookFlags.NumberOfInitHooksCalledMask */ - ) + i + 2; + currentView[PREORDER_HOOK_FLAGS] = (currentView[PREORDER_HOOK_FLAGS] & 4294901760 /* PreOrderHookFlags.NumberOfInitHooksCalledMask */) + i + 2; } - i++; } } @@ -27660,62 +25680,32 @@ function callHooks(currentView, arr, initPhase, currentNodeIndex) { * @param arr The array in which the hooks are found * @param i The current index within the hook data array */ - - function callHook(currentView, initPhase, arr, i) { const isInitHook = arr[i] < 0; const hook = arr[i + 1]; const directiveIndex = isInitHook ? -arr[i] : arr[i]; const directive = currentView[directiveIndex]; - if (isInitHook) { - const indexWithintInitPhase = currentView[FLAGS] >> 11 - /* LViewFlags.IndexWithinInitPhaseShift */ - ; // The init phase state must be always checked here as it may have been recursively updated. - - if (indexWithintInitPhase < currentView[PREORDER_HOOK_FLAGS] >> 16 - /* PreOrderHookFlags.NumberOfInitHooksCalledShift */ - && (currentView[FLAGS] & 3 - /* LViewFlags.InitPhaseStateMask */ - ) === initPhase) { - currentView[FLAGS] += 2048 - /* LViewFlags.IndexWithinInitPhaseIncrementer */ - ; - profiler(4 - /* ProfilerEvent.LifecycleHookStart */ - , directive, hook); - + const indexWithintInitPhase = currentView[FLAGS] >> 11 /* LViewFlags.IndexWithinInitPhaseShift */; + // The init phase state must be always checked here as it may have been recursively updated. + if (indexWithintInitPhase < currentView[PREORDER_HOOK_FLAGS] >> 16 /* PreOrderHookFlags.NumberOfInitHooksCalledShift */ && (currentView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) { + currentView[FLAGS] += 2048 /* LViewFlags.IndexWithinInitPhaseIncrementer */; + profiler(4 /* ProfilerEvent.LifecycleHookStart */, directive, hook); try { hook.call(directive); } finally { - profiler(5 - /* ProfilerEvent.LifecycleHookEnd */ - , directive, hook); + profiler(5 /* ProfilerEvent.LifecycleHookEnd */, directive, hook); } } } else { - profiler(4 - /* ProfilerEvent.LifecycleHookStart */ - , directive, hook); - + profiler(4 /* ProfilerEvent.LifecycleHookStart */, directive, hook); try { hook.call(directive); } finally { - profiler(5 - /* ProfilerEvent.LifecycleHookEnd */ - , directive, hook); + profiler(5 /* ProfilerEvent.LifecycleHookEnd */, directive, hook); } } } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - const NO_PARENT_INJECTOR = -1; /** * Each injector is saved in 9 contiguous slots in `LView` and 9 contiguous slots in @@ -27796,7 +25786,6 @@ const NO_PARENT_INJECTOR = -1; * [TNODE]: TElementNode|TElementContainerNode|TContainerNode; * } */ - /** * Factory for creating instances of injectors in the NodeInjector. * @@ -27812,7 +25801,6 @@ const NO_PARENT_INJECTOR = -1; * - `providers` factory: `componentProviders` is a number and `index = -1`. * - `viewProviders` factory: `componentProviders` is a number and `index` points to `providers`. */ - class NodeInjectorFactory { constructor( /** @@ -27828,57 +25816,38 @@ class NodeInjectorFactory { * Marker set to true during factory invocation to see if we get into recursive loop. * Recursive loop causes an error to be displayed. */ - this.resolving = false; ngDevMode && assertDefined(factory, 'Factory not specified'); ngDevMode && assertEqual(typeof factory, 'function', 'Expected factory function.'); this.canSeeViewProviders = isViewProvider; this.injectImpl = injectImplementation; } - } - function isFactory(obj) { return obj instanceof NodeInjectorFactory; -} // Note: This hack is necessary so we don't erroneously get a circular dependency +} +// Note: This hack is necessary so we don't erroneously get a circular dependency // failure based on types. +const unusedValueExportToPlacateAjd$2 = 1; - -const unusedValueExportToPlacateAjd$5 = 1; /** * Converts `TNodeType` into human readable text. * Make sure this matches with `TNodeType` */ - function toTNodeTypeAsString(tNodeType) { let text = ''; - tNodeType & 1 - /* TNodeType.Text */ - && (text += '|Text'); - tNodeType & 2 - /* TNodeType.Element */ - && (text += '|Element'); - tNodeType & 4 - /* TNodeType.Container */ - && (text += '|Container'); - tNodeType & 8 - /* TNodeType.ElementContainer */ - && (text += '|ElementContainer'); - tNodeType & 16 - /* TNodeType.Projection */ - && (text += '|Projection'); - tNodeType & 32 - /* TNodeType.Icu */ - && (text += '|IcuContainer'); - tNodeType & 64 - /* TNodeType.Placeholder */ - && (text += '|Placeholder'); + tNodeType & 1 /* TNodeType.Text */ && (text += '|Text'); + tNodeType & 2 /* TNodeType.Element */ && (text += '|Element'); + tNodeType & 4 /* TNodeType.Container */ && (text += '|Container'); + tNodeType & 8 /* TNodeType.ElementContainer */ && (text += '|ElementContainer'); + tNodeType & 16 /* TNodeType.Projection */ && (text += '|Projection'); + tNodeType & 32 /* TNodeType.Icu */ && (text += '|IcuContainer'); + tNodeType & 64 /* TNodeType.Placeholder */ && (text += '|Placeholder'); return text.length > 0 ? text.substring(1) : text; -} // Note: This hack is necessary so we don't erroneously get a circular dependency +} +// Note: This hack is necessary so we don't erroneously get a circular dependency // failure based on types. - - -const unusedValueExportToPlacateAjd$4 = 1; +const unusedValueExportToPlacateAjd$1 = 1; /** * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding. * @@ -27900,11 +25869,8 @@ const unusedValueExportToPlacateAjd$4 = 1; * * @param tNode */ - function hasClassInput(tNode) { - return (tNode.flags & 16 - /* TNodeFlags.hasClassInput */ - ) !== 0; + return (tNode.flags & 8 /* TNodeFlags.hasClassInput */) !== 0; } /** * Returns `true` if the `TNode` has a directive which has `@Input()` for `style` binding. @@ -27927,55 +25893,33 @@ function hasClassInput(tNode) { * * @param tNode */ - - function hasStyleInput(tNode) { - return (tNode.flags & 32 - /* TNodeFlags.hasStyleInput */ - ) !== 0; + return (tNode.flags & 16 /* TNodeFlags.hasStyleInput */) !== 0; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - function assertTNodeType(tNode, expectedTypes, message) { assertDefined(tNode, 'should be called with a TNode'); - if ((tNode.type & expectedTypes) === 0) { throwError(message || `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(tNode.type)}.`); } } - function assertPureTNodeType(type) { - if (!(type === 2 - /* TNodeType.Element */ - || // - type === 1 - /* TNodeType.Text */ - || // - type === 4 - /* TNodeType.Container */ - || // - type === 8 - /* TNodeType.ElementContainer */ - || // - type === 32 - /* TNodeType.Icu */ - || // - type === 16 - /* TNodeType.Projection */ - || // - type === 64 - /* TNodeType.Placeholder */ - )) { + if (!(type === 2 /* TNodeType.Element */ || + // + type === 1 /* TNodeType.Text */ || + // + type === 4 /* TNodeType.Container */ || + // + type === 8 /* TNodeType.ElementContainer */ || + // + type === 32 /* TNodeType.Icu */ || + // + type === 16 /* TNodeType.Projection */ || + // + type === 64 /* TNodeType.Placeholder */)) { throwError(`Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(type)}.`); } } + /** * Assigns all attribute values to the provided element via the inferred renderer. * @@ -28003,55 +25947,42 @@ function assertPureTNodeType(type) { * @param attrs The attribute array of values that will be assigned to the element * @returns the index value that was last accessed in the attributes array */ - - function setUpAttributes(renderer, native, attrs) { - const isProc = isProceduralRenderer(renderer); let i = 0; - while (i < attrs.length) { const value = attrs[i]; - if (typeof value === 'number') { // only namespaces are supported. Other value types (such as style/class // entries) are not supported in this function. - if (value !== 0 - /* AttributeMarker.NamespaceURI */ - ) { + if (value !== 0 /* AttributeMarker.NamespaceURI */) { break; - } // we just landed on the marker value ... therefore + } + // we just landed on the marker value ... therefore // we should skip to the next entry - - i++; const namespaceURI = attrs[i++]; const attrName = attrs[i++]; const attrVal = attrs[i++]; ngDevMode && ngDevMode.rendererSetAttribute++; - isProc ? renderer.setAttribute(native, attrName, attrVal, namespaceURI) : native.setAttributeNS(namespaceURI, attrName, attrVal); + renderer.setAttribute(native, attrName, attrVal, namespaceURI); } else { // attrName is string; const attrName = value; - const attrVal = attrs[++i]; // Standard attributes - + const attrVal = attrs[++i]; + // Standard attributes ngDevMode && ngDevMode.rendererSetAttribute++; - if (isAnimationProp(attrName)) { - if (isProc) { - renderer.setProperty(native, attrName, attrVal); - } + renderer.setProperty(native, attrName, attrVal); } else { - isProc ? renderer.setAttribute(native, attrName, attrVal) : native.setAttribute(attrName, attrVal); + renderer.setAttribute(native, attrName, attrVal); } - i++; } - } // another piece of code may iterate over the same attributes array. Therefore + } + // another piece of code may iterate over the same attributes array. Therefore // it may be helpful to return the exact spot where the attributes array exited // whether by running into an unsupported marker or if all the static values were // iterated over. - - return i; } /** @@ -28061,25 +25992,15 @@ function setUpAttributes(renderer, native, attrs) { * @param marker The attribute marker to test. * @returns true if the marker is a "name-only" marker (e.g. `Bindings`, `Template` or `I18n`). */ - - function isNameOnlyAttributeMarker(marker) { - return marker === 3 - /* AttributeMarker.Bindings */ - || marker === 4 - /* AttributeMarker.Template */ - || marker === 6 - /* AttributeMarker.I18n */ - ; + return marker === 3 /* AttributeMarker.Bindings */ || marker === 4 /* AttributeMarker.Template */ || marker === 6 /* AttributeMarker.I18n */; } function isAnimationProp(name) { // Perf note: accessing charCodeAt to check for the first character of a string is faster as // compared to accessing a character at index 0 (ex. name[0]). The main reason for this is that // charCodeAt doesn't allocate memory to return a substring. - return name.charCodeAt(0) === 64 - /* CharCode.AT_SIGN */ - ; + return name.charCodeAt(0) === 64 /* CharCode.AT_SIGN */; } /** * Merges `src` `TAttributes` into `dst` `TAttributes` removing any duplicates in the process. @@ -28089,32 +26010,22 @@ function isAnimationProp(name) { * @param dst Location of where the merged `TAttributes` should end up. * @param src `TAttributes` which should be appended to `dst` */ - - function mergeHostAttrs(dst, src) { - if (src === null || src.length === 0) {// do nothing + if (src === null || src.length === 0) { + // do nothing } else if (dst === null || dst.length === 0) { // We have source, but dst is empty, just make a copy. dst = src.slice(); } else { - let srcMarker = -1 - /* AttributeMarker.ImplicitAttributes */ - ; - + let srcMarker = -1 /* AttributeMarker.ImplicitAttributes */; for (let i = 0; i < src.length; i++) { const item = src[i]; - if (typeof item === 'number') { srcMarker = item; } else { - if (srcMarker === 0 - /* AttributeMarker.NamespaceURI */ - ) {// Case where we need to consume `key1`, `key2`, `value` items. - } else if (srcMarker === -1 - /* AttributeMarker.ImplicitAttributes */ - || srcMarker === 2 - /* AttributeMarker.Styles */ - ) { + if (srcMarker === 0 /* AttributeMarker.NamespaceURI */) { + // Case where we need to consume `key1`, `key2`, `value` items. + } else if (srcMarker === -1 /* AttributeMarker.ImplicitAttributes */ || srcMarker === 2 /* AttributeMarker.Styles */) { // Case where we have to consume `key1` and `value` only. mergeHostAttribute(dst, srcMarker, item, null, src[++i]); } else { @@ -28124,7 +26035,6 @@ function mergeHostAttrs(dst, src) { } } } - return dst; } /** @@ -28136,21 +26046,16 @@ function mergeHostAttrs(dst, src) { * @param key2 Key to add to `TAttributes` (in case of `AttributeMarker.NamespaceURI`) * @param value Value to add or to overwrite to `TAttributes` Only used if `marker` is not Class. */ - - function mergeHostAttribute(dst, marker, key1, key2, value) { - let i = 0; // Assume that new markers will be inserted at the end. - - let markerInsertPosition = dst.length; // scan until correct type. - - if (marker === -1 - /* AttributeMarker.ImplicitAttributes */ - ) { + let i = 0; + // Assume that new markers will be inserted at the end. + let markerInsertPosition = dst.length; + // scan until correct type. + if (marker === -1 /* AttributeMarker.ImplicitAttributes */) { markerInsertPosition = -1; } else { while (i < dst.length) { const dstValue = dst[i++]; - if (typeof dstValue === 'number') { if (dstValue === marker) { markerInsertPosition = -1; @@ -28162,12 +26067,10 @@ function mergeHostAttribute(dst, marker, key1, key2, value) { } } } - } // search until you find place of insertion - - + } + // search until you find place of insertion while (i < dst.length) { const item = dst[i]; - if (typeof item === 'number') { // since `i` started as the index after the marker, we did not find it if we are at the next // marker @@ -28178,66 +26081,45 @@ function mergeHostAttribute(dst, marker, key1, key2, value) { if (value !== null) { dst[i + 1] = value; } - return; } else if (key2 === dst[i + 1]) { dst[i + 2] = value; return; } - } // Increment counter. - - + } + // Increment counter. i++; if (key2 !== null) i++; if (value !== null) i++; - } // insert at location. - - + } + // insert at location. if (markerInsertPosition !== -1) { dst.splice(markerInsertPosition, 0, marker); i = markerInsertPosition + 1; } - dst.splice(i++, 0, key1); - if (key2 !== null) { dst.splice(i++, 0, key2); } - if (value !== null) { dst.splice(i++, 0, value); } } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -/// Parent Injector Utils /////////////////////////////////////////////////////////////// - +/// Parent Injector Utils /////////////////////////////////////////////////////////////// function hasParentInjector(parentLocation) { return parentLocation !== NO_PARENT_INJECTOR; } - function getParentInjectorIndex(parentLocation) { ngDevMode && assertNumber(parentLocation, 'Number expected'); ngDevMode && assertNotEqual(parentLocation, -1, 'Not a valid state.'); - const parentInjectorIndex = parentLocation & 32767 - /* RelativeInjectorLocationFlags.InjectorIndexMask */ - ; + const parentInjectorIndex = parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */; ngDevMode && assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, 'Parent injector must be pointing past HEADER_OFFSET.'); - return parentLocation & 32767 - /* RelativeInjectorLocationFlags.InjectorIndexMask */ - ; + return parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */; } function getParentInjectorViewOffset(parentLocation) { - return parentLocation >> 16 - /* RelativeInjectorLocationFlags.ViewOffsetShift */ - ; + return parentLocation >> 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */; } /** * Unwraps a parent injector location number to find the view offset from the current injector, @@ -28248,29 +26130,19 @@ function getParentInjectorViewOffset(parentLocation) { * @param startView The LView instance from which to start walking up the view tree * @returns The LView instance that contains the parent injector */ - - function getParentInjectorView(location, startView) { let viewOffset = getParentInjectorViewOffset(location); - let parentView = startView; // For most cases, the parent injector can be found on the host node (e.g. for component + let parentView = startView; + // For most cases, the parent injector can be found on the host node (e.g. for component // or container), but we must keep the loop here to support the rarer case of deeply nested // tags or inline views, where the parent injector might live many views // above the child injector. - while (viewOffset > 0) { parentView = parentView[DECLARATION_VIEW]; viewOffset--; } - return parentView; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Defines if the call to `inject` should include `viewProviders` in its resolution. @@ -28308,10 +26180,7 @@ function getParentInjectorView(location, startView) { * * ``` */ - - let includeViewProviders = true; - function setIncludeViewProviders(v) { const oldValue = includeViewProviders; includeViewProviders = v; @@ -28322,8 +26191,6 @@ function setIncludeViewProviders(v) { * directives that will share slots, and thus, the fewer false positives when checking for * the existence of a directive. */ - - const BLOOM_SIZE = 256; const BLOOM_MASK = BLOOM_SIZE - 1; /** @@ -28331,13 +26198,10 @@ const BLOOM_MASK = BLOOM_SIZE - 1; * so each bucket represents 32 distinct tokens which accounts for log2(32) = 5 bits of a bloom hash * number. */ - const BLOOM_BUCKET_BITS = 5; /** Counter used to generate unique IDs for directives. */ - let nextNgElementId = 0; /** Value used when something wasn't found by an injector. */ - const NOT_FOUND = {}; /** * Registers this directive as present in its node's injector by flipping the directive's @@ -28347,33 +26211,29 @@ const NOT_FOUND = {}; * @param tView The TView for the injector's bloom filters * @param type The directive token to register */ - function bloomAdd(injectorIndex, tView, type) { ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true'); let id; - if (typeof type === 'string') { id = type.charCodeAt(0) || 0; } else if (type.hasOwnProperty(NG_ELEMENT_ID)) { id = type[NG_ELEMENT_ID]; - } // Set a unique ID on the directive type, so if something tries to inject the directive, + } + // Set a unique ID on the directive type, so if something tries to inject the directive, // we can easily retrieve the ID and hash it into the bloom bit that should be checked. - - if (id == null) { id = type[NG_ELEMENT_ID] = nextNgElementId++; - } // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each), + } + // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each), // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter. - - - const bloomHash = id & BLOOM_MASK; // Create a mask that targets the specific bit associated with the directive. + const bloomHash = id & BLOOM_MASK; + // Create a mask that targets the specific bit associated with the directive. // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding // to bit positions 0 - 31 in a 32 bit integer. - - const mask = 1 << bloomHash; // Each bloom bucket in `tData` represents `BLOOM_BUCKET_BITS` number of bits of `bloomHash`. + const mask = 1 << bloomHash; + // Each bloom bucket in `tData` represents `BLOOM_BUCKET_BITS` number of bits of `bloomHash`. // Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset that the mask // should be written to. - tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask; } /** @@ -28383,61 +26243,46 @@ function bloomAdd(injectorIndex, tView, type) { * @param lView View where the node is stored * @returns Node injector */ - - function getOrCreateNodeInjectorForNode(tNode, lView) { const existingInjectorIndex = getInjectorIndex(tNode, lView); - if (existingInjectorIndex !== -1) { return existingInjectorIndex; } - const tView = lView[TVIEW]; - if (tView.firstCreatePass) { tNode.injectorIndex = lView.length; insertBloom(tView.data, tNode); // foundation for node bloom - insertBloom(lView, null); // foundation for cumulative bloom - insertBloom(tView.blueprint, null); } - const parentLoc = getParentInjectorLocation(tNode, lView); - const injectorIndex = tNode.injectorIndex; // If a parent injector can't be found, its location is set to -1. + const injectorIndex = tNode.injectorIndex; + // If a parent injector can't be found, its location is set to -1. // In that case, we don't need to set up a cumulative bloom - if (hasParentInjector(parentLoc)) { const parentIndex = getParentInjectorIndex(parentLoc); const parentLView = getParentInjectorView(parentLoc, lView); - const parentData = parentLView[TVIEW].data; // Creates a cumulative bloom filter that merges the parent's bloom filter + const parentData = parentLView[TVIEW].data; + // Creates a cumulative bloom filter that merges the parent's bloom filter // and its own cumulative bloom (which contains tokens for all ancestors) - - for (let i = 0; i < 8 - /* NodeInjectorOffset.BLOOM_SIZE */ - ; i++) { + for (let i = 0; i < 8 /* NodeInjectorOffset.BLOOM_SIZE */; i++) { lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i]; } } - - lView[injectorIndex + 8 - /* NodeInjectorOffset.PARENT */ - ] = parentLoc; + lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */] = parentLoc; return injectorIndex; } - function insertBloom(arr, footer) { arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer); } - function getInjectorIndex(tNode, lView) { - if (tNode.injectorIndex === -1 || // If the injector index is the same as its parent's injector index, then the index has been + if (tNode.injectorIndex === -1 || + // If the injector index is the same as its parent's injector index, then the index has been // copied down from the parent node. No injector has been created yet on this node. - tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex || // After the first template pass, the injector index might exist but the parent values + tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex || + // After the first template pass, the injector index might exist but the parent values // might not have been calculated yet for this instance - lView[tNode.injectorIndex + 8 - /* NodeInjectorOffset.PARENT */ - ] === null) { + lView[tNode.injectorIndex + 8 /* NodeInjectorOffset.PARENT */] === null) { return -1; } else { ngDevMode && assertIndexInRange(lView, tNode.injectorIndex); @@ -28451,42 +26296,34 @@ function getInjectorIndex(tNode, lView) { * @returns Returns a number that is the combination of the number of LViews that we have to go up * to find the LView containing the parent inject AND the index of the injector within that LView. */ - - function getParentInjectorLocation(tNode, lView) { if (tNode.parent && tNode.parent.injectorIndex !== -1) { // If we have a parent `TNode` and there is an injector associated with it we are done, because // the parent injector is within the current `LView`. return tNode.parent.injectorIndex; // ViewOffset is 0 - } // When parent injector location is computed it may be outside of the current view. (ie it could + } + // When parent injector location is computed it may be outside of the current view. (ie it could // be pointing to a declared parent location). This variable stores number of declaration parents // we need to walk up in order to find the parent injector location. - - let declarationViewOffset = 0; let parentTNode = null; - let lViewCursor = lView; // The parent injector is not in the current `LView`. We will have to walk the declared parent + let lViewCursor = lView; + // The parent injector is not in the current `LView`. We will have to walk the declared parent // `LView` hierarchy and look for it. If we walk of the top, that means that there is no parent // `NodeInjector`. - while (lViewCursor !== null) { parentTNode = getTNodeFromLView(lViewCursor); - if (parentTNode === null) { // If we have no parent, than we are done. return NO_PARENT_INJECTOR; } - - ngDevMode && parentTNode && assertTNodeForLView(parentTNode, lViewCursor[DECLARATION_VIEW]); // Every iteration of the loop requires that we go to the declared parent. - + ngDevMode && parentTNode && assertTNodeForLView(parentTNode, lViewCursor[DECLARATION_VIEW]); + // Every iteration of the loop requires that we go to the declared parent. declarationViewOffset++; lViewCursor = lViewCursor[DECLARATION_VIEW]; - if (parentTNode.injectorIndex !== -1) { // We found a NodeInjector which points to something. - return parentTNode.injectorIndex | declarationViewOffset << 16 - /* RelativeInjectorLocationFlags.ViewOffsetShift */ - ; + return parentTNode.injectorIndex | declarationViewOffset << 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */; } } @@ -28499,8 +26336,6 @@ function getParentInjectorLocation(tNode, lView) { * @param di The node injector in which a directive will be added * @param token The type or the injection token to be made public */ - - function diPublicInInjector(injectorIndex, tView, token) { bloomAdd(injectorIndex, tView, token); } @@ -28535,38 +26370,25 @@ function diPublicInInjector(injectorIndex, tView, token) { * * @publicApi */ - - function injectAttributeImpl(tNode, attrNameToInject) { - ngDevMode && assertTNodeType(tNode, 12 - /* TNodeType.AnyContainer */ - | 3 - /* TNodeType.AnyRNode */ - ); + ngDevMode && assertTNodeType(tNode, 12 /* TNodeType.AnyContainer */ | 3 /* TNodeType.AnyRNode */); ngDevMode && assertDefined(tNode, 'expecting tNode'); - if (attrNameToInject === 'class') { return tNode.classes; } - if (attrNameToInject === 'style') { return tNode.styles; } - const attrs = tNode.attrs; - if (attrs) { const attrsLength = attrs.length; let i = 0; - while (i < attrsLength) { - const value = attrs[i]; // If we hit a `Bindings` or `Template` marker then we are done. - - if (isNameOnlyAttributeMarker(value)) break; // Skip namespaced attributes - - if (value === 0 - /* AttributeMarker.NamespaceURI */ - ) { + const value = attrs[i]; + // If we hit a `Bindings` or `Template` marker then we are done. + if (isNameOnlyAttributeMarker(value)) break; + // Skip namespaced attributes + if (value === 0 /* AttributeMarker.NamespaceURI */) { // we skip the next two values // as namespaced attributes looks like // [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist', @@ -28575,7 +26397,6 @@ function injectAttributeImpl(tNode, attrNameToInject) { } else if (typeof value === 'number') { // Skip to the first value of the marked attribute. i++; - while (i < attrsLength && typeof attrs[i] === 'string') { i++; } @@ -28586,12 +26407,10 @@ function injectAttributeImpl(tNode, attrNameToInject) { } } } - return null; } - function notFoundValueOrThrow(notFoundValue, token, flags) { - if (flags & InjectFlags.Optional) { + if (flags & InjectFlags.Optional || notFoundValue !== undefined) { return notFoundValue; } else { throwProviderNotFoundError(token, 'NodeInjector'); @@ -28606,21 +26425,17 @@ function notFoundValueOrThrow(notFoundValue, token, flags) { * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional` * @returns the value from the injector or throws an exception */ - - function lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) { if (flags & InjectFlags.Optional && notFoundValue === undefined) { // This must be set or the NullInjector will throw for optional deps notFoundValue = null; } - if ((flags & (InjectFlags.Self | InjectFlags.Host)) === 0) { - const moduleInjector = lView[INJECTOR$1]; // switch to `injectInjectorOnly` implementation for module injector, since module injector + const moduleInjector = lView[INJECTOR$1]; + // switch to `injectInjectorOnly` implementation for module injector, since module injector // should not have access to Component/Directive DI scope (that may happen through // `directiveInject` implementation) - const previousInjectImplementation = setInjectImplementation(undefined); - try { if (moduleInjector) { return moduleInjector.get(token, notFoundValue, flags & InjectFlags.Optional); @@ -28631,7 +26446,6 @@ function lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) { setInjectImplementation(previousInjectImplementation); } } - return notFoundValueOrThrow(notFoundValue, token, flags); } /** @@ -28650,31 +26464,23 @@ function lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) { * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional` * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided */ - - function getOrCreateInjectable(tNode, lView, token, flags = InjectFlags.Default, notFoundValue) { if (tNode !== null) { // If the view or any of its ancestors have an embedded // view injector, we have to look it up there first. - if (lView[FLAGS] & 1024 - /* LViewFlags.HasEmbeddedViewInjector */ - ) { + if (lView[FLAGS] & 1024 /* LViewFlags.HasEmbeddedViewInjector */) { const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND); - if (embeddedInjectorValue !== NOT_FOUND) { return embeddedInjectorValue; } - } // Otherwise try the node injector. - - + } + // Otherwise try the node injector. const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND); - if (value !== NOT_FOUND) { return value; } - } // Finally, fall back to the module injector. - - + } + // Finally, fall back to the module injector. return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue); } /** @@ -28687,22 +26493,18 @@ function getOrCreateInjectable(tNode, lView, token, flags = InjectFlags.Default, * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional` * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided */ - - function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) { - const bloomHash = bloomHashBitOrFactory(token); // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef + const bloomHash = bloomHashBitOrFactory(token); + // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef // so just call the factory function to create it. - if (typeof bloomHash === 'function') { if (!enterDI(lView, tNode, flags)) { // Failed to enter DI, try module injector instead. If a token is injected with the @Host // flag, the module injector is not searched for that token in Ivy. return flags & InjectFlags.Host ? notFoundValueOrThrow(notFoundValue, token, flags) : lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue); } - try { const value = bloomHash(flags); - if (value == null && !(flags & InjectFlags.Optional)) { throwProviderNotFoundError(token); } else { @@ -28718,14 +26520,11 @@ function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) let previousTView = null; let injectorIndex = getInjectorIndex(tNode, lView); let parentLocation = NO_PARENT_INJECTOR; - let hostTElementNode = flags & InjectFlags.Host ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null; // If we should skip this injector, or if there is no injector on this node, start by + let hostTElementNode = flags & InjectFlags.Host ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null; + // If we should skip this injector, or if there is no injector on this node, start by // searching the parent injector. - if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) { - parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) : lView[injectorIndex + 8 - /* NodeInjectorOffset.PARENT */ - ]; - + parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) : lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */]; if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) { injectorIndex = -1; } else { @@ -28733,36 +26532,25 @@ function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) injectorIndex = getParentInjectorIndex(parentLocation); lView = getParentInjectorView(parentLocation, lView); } - } // Traverse up the injector tree until we find a potential match or until we know there + } + // Traverse up the injector tree until we find a potential match or until we know there // *isn't* a match. - - while (injectorIndex !== -1) { - ngDevMode && assertNodeInjector(lView, injectorIndex); // Check the current injector. If it matches, see if it contains token. - + ngDevMode && assertNodeInjector(lView, injectorIndex); + // Check the current injector. If it matches, see if it contains token. const tView = lView[TVIEW]; - ngDevMode && assertTNodeForLView(tView.data[injectorIndex + 8 - /* NodeInjectorOffset.TNODE */ - ], lView); - + ngDevMode && assertTNodeForLView(tView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */], lView); if (bloomHasToken(bloomHash, injectorIndex, tView.data)) { // At this point, we have an injector which *may* contain the token, so we step through // the providers and directives associated with the injector's corresponding node to get // the instance. const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode); - if (instance !== NOT_FOUND) { return instance; } } - - parentLocation = lView[injectorIndex + 8 - /* NodeInjectorOffset.PARENT */ - ]; - - if (parentLocation !== NO_PARENT_INJECTOR && shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8 - /* NodeInjectorOffset.TNODE */ - ] === hostTElementNode) && bloomHasToken(bloomHash, injectorIndex, lView)) { + parentLocation = lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */]; + if (parentLocation !== NO_PARENT_INJECTOR && shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */] === hostTElementNode) && bloomHasToken(bloomHash, injectorIndex, lView)) { // The def wasn't found anywhere on this node, so it was a false positive. // Traverse up the tree and continue searching. previousTView = tView; @@ -28776,38 +26564,33 @@ function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) } } } - return notFoundValue; } - function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) { const currentTView = lView[TVIEW]; - const tNode = currentTView.data[injectorIndex + 8 - /* NodeInjectorOffset.TNODE */ - ]; // First, we need to determine if view providers can be accessed by the starting element. + const tNode = currentTView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */]; + // First, we need to determine if view providers can be accessed by the starting element. // There are two possibilities - - const canAccessViewProviders = previousTView == null ? // 1) This is the first invocation `previousTView == null` which means that we are at the + const canAccessViewProviders = previousTView == null ? + // 1) This is the first invocation `previousTView == null` which means that we are at the // `TNode` of where injector is starting to look. In such a case the only time we are allowed // to look into the ViewProviders is if: // - we are on a component // - AND the injector set `includeViewProviders` to true (implying that the token can see // ViewProviders because it is the Component or a Service which itself was declared in // ViewProviders) - isComponentHost(tNode) && includeViewProviders : // 2) `previousTView != null` which means that we are now walking across the parent nodes. + isComponentHost(tNode) && includeViewProviders : + // 2) `previousTView != null` which means that we are now walking across the parent nodes. // In such a case we are only allowed to look into the ViewProviders if: // - We just crossed from child View to Parent View `previousTView != currentTView` // - AND the parent TNode is an Element. // This means that we just came from the Component's View and therefore are allowed to see // into the ViewProviders. - previousTView != currentTView && (tNode.type & 3 - /* TNodeType.AnyRNode */ - ) !== 0; // This special case happens when there is a @host on the inject and when we are searching + previousTView != currentTView && (tNode.type & 3 /* TNodeType.AnyRNode */) !== 0; + // This special case happens when there is a @host on the inject and when we are searching // on the host element node. - const isHostSpecialCase = flags & InjectFlags.Host && hostTElementNode === tNode; const injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase); - if (injectableIdx !== null) { return getNodeInjectable(lView, currentTView, injectableIdx, tNode); } else { @@ -28824,39 +26607,28 @@ function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flag * @param isHostSpecialCase Whether the host special case applies. * @returns Index of a found directive or provider, or null when none found. */ - - function locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) { const nodeProviderIndexes = tNode.providerIndexes; const tInjectables = tView.data; - const injectablesStart = nodeProviderIndexes & 1048575 - /* TNodeProviderIndexes.ProvidersStartIndexMask */ - ; + const injectablesStart = nodeProviderIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */; const directivesStart = tNode.directiveStart; const directiveEnd = tNode.directiveEnd; - const cptViewProvidersCount = nodeProviderIndexes >> 20 - /* TNodeProviderIndexes.CptViewProvidersCountShift */ - ; - const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount; // When the host special case applies, only the viewProviders and the component are visible - + const cptViewProvidersCount = nodeProviderIndexes >> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */; + const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount; + // When the host special case applies, only the viewProviders and the component are visible const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd; - for (let i = startingIndex; i < endIndex; i++) { const providerTokenOrDef = tInjectables[i]; - if (i < directivesStart && token === providerTokenOrDef || i >= directivesStart && providerTokenOrDef.type === token) { return i; } } - if (isHostSpecialCase) { const dirDef = tInjectables[directivesStart]; - if (dirDef && isComponentDef(dirDef) && dirDef.type === token) { return directivesStart; } } - return null; } /** @@ -28866,33 +26638,27 @@ function locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, * cached `injectable`. Otherwise if it detects that the value is still a factory it * instantiates the `injectable` and caches the value. */ - - function getNodeInjectable(lView, tView, index, tNode) { let value = lView[index]; const tData = tView.data; - if (isFactory(value)) { const factory = value; - if (factory.resolving) { throwCyclicDependencyError(stringifyForError(tData[index])); } - const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders); factory.resolving = true; const previousInjectImplementation = factory.injectImpl ? setInjectImplementation(factory.injectImpl) : null; const success = enterDI(lView, tNode, InjectFlags.Default); ngDevMode && assertEqual(success, true, 'Because flags do not contain \`SkipSelf\' we expect this to always succeed.'); - try { - value = lView[index] = factory.factory(undefined, tData, lView, tNode); // This code path is hit for both directives and providers. + value = lView[index] = factory.factory(undefined, tData, lView, tNode); + // This code path is hit for both directives and providers. // For perf reasons, we want to avoid searching for hooks on providers. // It does no harm to try (the hooks just won't exist), but the extra // checks are unnecessary and this is a hot path. So we check to see // if the index of the dependency is in the directive range for this // tNode. If it's not, we know it's a provider and skip hook registration. - if (tView.firstCreatePass && index >= tNode.directiveStart) { ngDevMode && assertDirectiveDef(tData[index]); registerPreOrderHooks(index, tData[index], tView); @@ -28904,7 +26670,6 @@ function getNodeInjectable(lView, tView, index, tNode) { leaveDI(); } } - return value; } /** @@ -28919,103 +26684,85 @@ function getNodeInjectable(lView, tView, index, tNode) { * @returns the matching bit to check in the bloom filter or `null` if the token is not known. * When the returned value is negative then it represents special values such as `Injector`. */ - - function bloomHashBitOrFactory(token) { ngDevMode && assertDefined(token, 'token must be defined'); - if (typeof token === 'string') { return token.charCodeAt(0) || 0; } - - const tokenId = // First check with `hasOwnProperty` so we don't get an inherited ID. - token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined; // Negative token IDs are used for special objects such as `Injector` - + const tokenId = + // First check with `hasOwnProperty` so we don't get an inherited ID. + token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined; + // Negative token IDs are used for special objects such as `Injector` if (typeof tokenId === 'number') { if (tokenId >= 0) { return tokenId & BLOOM_MASK; } else { - ngDevMode && assertEqual(tokenId, -1 - /* InjectorMarkers.Injector */ - , 'Expecting to get Special Injector Id'); + ngDevMode && assertEqual(tokenId, -1 /* InjectorMarkers.Injector */, 'Expecting to get Special Injector Id'); return createNodeInjector; } } else { return tokenId; } } - function bloomHasToken(bloomHash, injectorIndex, injectorView) { // Create a mask that targets the specific bit associated with the directive we're looking for. // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding // to bit positions 0 - 31 in a 32 bit integer. - const mask = 1 << bloomHash; // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of + const mask = 1 << bloomHash; + // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of // `bloomHash`. Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset // that should be used. - - const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)]; // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on, + const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)]; + // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on, // this injector is a potential match. - return !!(value & mask); } /** Returns true if flags prevent parent injector from being searched for tokens */ - - function shouldSearchParent(flags, isFirstHostTNode) { return !(flags & InjectFlags.Self) && !(flags & InjectFlags.Host && isFirstHostTNode); } - class NodeInjector { constructor(_tNode, _lView) { this._tNode = _tNode; this._lView = _lView; } - get(token, notFoundValue, flags) { - return getOrCreateInjectable(this._tNode, this._lView, token, flags, notFoundValue); + return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue); } - } /** Creates a `NodeInjector` for the current node. */ - - function createNodeInjector() { return new NodeInjector(getCurrentTNode(), getLView()); } /** * @codeGenApi */ - - function ɵɵgetInheritedFactory(type) { return noSideEffects(() => { const ownConstructor = type.prototype.constructor; const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor); const objectPrototype = Object.prototype; - let parent = Object.getPrototypeOf(type.prototype).constructor; // Go up the prototype until we hit `Object`. - + let parent = Object.getPrototypeOf(type.prototype).constructor; + // Go up the prototype until we hit `Object`. while (parent && parent !== objectPrototype) { - const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent); // If we hit something that has a factory and the factory isn't the same as the type, + const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent); + // If we hit something that has a factory and the factory isn't the same as the type, // we've found the inherited factory. Note the check that the factory isn't the type's // own factory is redundant in most cases, but if the user has custom decorators on the // class, this lookup will start one level down in the prototype chain, causing us to // find the own factory first and potentially triggering an infinite loop downstream. - if (factory && factory !== ownFactory) { return factory; } - parent = Object.getPrototypeOf(parent); - } // There is no factory defined. Either this was improper usage of inheritance + } + // There is no factory defined. Either this was improper usage of inheritance // (no Angular decorator on the superclass) or there is no constructor at all // in the inheritance chain. Since the two cases cannot be distinguished, the // latter has to be assumed. - - return t => new t(); }); } - function getFactoryOf(type) { if (isForwardRef(type)) { return () => { @@ -29023,7 +26770,6 @@ function getFactoryOf(type) { return factory && factory(); }; } - return getFactoryDef(type); } /** @@ -29036,129 +26782,88 @@ function getFactoryOf(type) { * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional` * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided */ - - function lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundValue) { let currentTNode = tNode; - let currentLView = lView; // When an LView with an embedded view injector is inserted, it'll likely be interlaced with + let currentLView = lView; + // When an LView with an embedded view injector is inserted, it'll likely be interlaced with // nodes who may have injectors (e.g. node injector -> embedded view injector -> node injector). // Since the bloom filters for the node injectors have already been constructed and we don't // have a way of extracting the records from an injector, the only way to maintain the correct // hierarchy when resolving the value is to walk it node-by-node while attempting to resolve // the token at each level. - - while (currentTNode !== null && currentLView !== null && currentLView[FLAGS] & 1024 - /* LViewFlags.HasEmbeddedViewInjector */ - && !(currentLView[FLAGS] & 256 - /* LViewFlags.IsRoot */ - )) { - ngDevMode && assertTNodeForLView(currentTNode, currentLView); // Note that this lookup on the node injector is using the `Self` flag, because + while (currentTNode !== null && currentLView !== null && currentLView[FLAGS] & 1024 /* LViewFlags.HasEmbeddedViewInjector */ && !(currentLView[FLAGS] & 256 /* LViewFlags.IsRoot */)) { + ngDevMode && assertTNodeForLView(currentTNode, currentLView); + // Note that this lookup on the node injector is using the `Self` flag, because // we don't want the node injector to look at any parent injectors since we // may hit the embedded view injector first. - const nodeInjectorValue = lookupTokenUsingNodeInjector(currentTNode, currentLView, token, flags | InjectFlags.Self, NOT_FOUND); - if (nodeInjectorValue !== NOT_FOUND) { return nodeInjectorValue; - } // Has an explicit type due to a TS bug: https://github.com/microsoft/TypeScript/issues/33191 - - - let parentTNode = currentTNode.parent; // `TNode.parent` includes the parent within the current view only. If it doesn't exist, + } + // Has an explicit type due to a TS bug: https://github.com/microsoft/TypeScript/issues/33191 + let parentTNode = currentTNode.parent; + // `TNode.parent` includes the parent within the current view only. If it doesn't exist, // it means that we've hit the view boundary and we need to go up to the next view. - if (!parentTNode) { // Before we go to the next LView, check if the token exists on the current embedded injector. const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR]; - if (embeddedViewInjector) { const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND, flags); - if (embeddedViewInjectorValue !== NOT_FOUND) { return embeddedViewInjectorValue; } - } // Otherwise keep going up the tree. - - + } + // Otherwise keep going up the tree. parentTNode = getTNodeFromLView(currentLView); currentLView = currentLView[DECLARATION_VIEW]; } - currentTNode = parentTNode; } - return notFoundValue; } /** Gets the TNode associated with an LView inside of the declaration view. */ - - function getTNodeFromLView(lView) { const tView = lView[TVIEW]; - const tViewType = tView.type; // The parent pointer differs based on `TView.type`. - - if (tViewType === 2 - /* TViewType.Embedded */ - ) { + const tViewType = tView.type; + // The parent pointer differs based on `TView.type`. + if (tViewType === 2 /* TViewType.Embedded */) { ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.'); return tView.declTNode; - } else if (tViewType === 1 - /* TViewType.Component */ - ) { + } else if (tViewType === 1 /* TViewType.Component */) { // Components don't have `TView.declTNode` because each instance of component could be // inserted in different location, hence `TView.declTNode` is meaningless. return lView[T_HOST]; } - return null; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Facade for the attribute injection from DI. * * @codeGenApi */ - - function ɵɵinjectAttribute(attrNameToInject) { return injectAttributeImpl(getCurrentTNode(), attrNameToInject); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - const ANNOTATIONS = '__annotations__'; const PARAMETERS = '__parameters__'; const PROP_METADATA = '__prop__metadata__'; /** * @suppress {globalThis} */ - function makeDecorator(name, props, parentClass, additionalProcessing, typeFn) { return noSideEffects(() => { const metaCtor = makeMetadataCtor(props); - function DecoratorFactory(...args) { if (this instanceof DecoratorFactory) { metaCtor.call(this, ...args); return this; } - const annotationInstance = new DecoratorFactory(...args); return function TypeDecorator(cls) { - if (typeFn) typeFn(cls, ...args); // Use of Object.defineProperty is important since it creates non-enumerable property which + if (typeFn) typeFn(cls, ...args); + // Use of Object.defineProperty is important since it creates non-enumerable property which // prevents the property is copied during subclassing. - const annotations = cls.hasOwnProperty(ANNOTATIONS) ? cls[ANNOTATIONS] : Object.defineProperty(cls, ANNOTATIONS, { value: [] })[ANNOTATIONS]; @@ -29167,86 +26872,71 @@ function makeDecorator(name, props, parentClass, additionalProcessing, typeFn) { return cls; }; } - if (parentClass) { DecoratorFactory.prototype = Object.create(parentClass.prototype); } - DecoratorFactory.prototype.ngMetadataName = name; DecoratorFactory.annotationCls = DecoratorFactory; return DecoratorFactory; }); } - function makeMetadataCtor(props) { return function ctor(...args) { if (props) { const values = props(...args); - for (const propName in values) { this[propName] = values[propName]; } } }; } - function makeParamDecorator(name, props, parentClass) { return noSideEffects(() => { const metaCtor = makeMetadataCtor(props); - function ParamDecoratorFactory(...args) { if (this instanceof ParamDecoratorFactory) { metaCtor.apply(this, args); return this; } - const annotationInstance = new ParamDecoratorFactory(...args); ParamDecorator.annotation = annotationInstance; return ParamDecorator; - function ParamDecorator(cls, unusedKey, index) { // Use of Object.defineProperty is important since it creates non-enumerable property which // prevents the property is copied during subclassing. const parameters = cls.hasOwnProperty(PARAMETERS) ? cls[PARAMETERS] : Object.defineProperty(cls, PARAMETERS, { value: [] - })[PARAMETERS]; // there might be gaps if some in between parameters do not have annotations. + })[PARAMETERS]; + // there might be gaps if some in between parameters do not have annotations. // we pad with nulls. - while (parameters.length <= index) { parameters.push(null); } - (parameters[index] = parameters[index] || []).push(annotationInstance); return cls; } } - if (parentClass) { ParamDecoratorFactory.prototype = Object.create(parentClass.prototype); } - ParamDecoratorFactory.prototype.ngMetadataName = name; ParamDecoratorFactory.annotationCls = ParamDecoratorFactory; return ParamDecoratorFactory; }); } - function makePropDecorator(name, props, parentClass, additionalProcessing) { return noSideEffects(() => { const metaCtor = makeMetadataCtor(props); - function PropDecoratorFactory(...args) { if (this instanceof PropDecoratorFactory) { metaCtor.apply(this, args); return this; } - const decoratorInstance = new PropDecoratorFactory(...args); - function PropDecorator(target, name) { - const constructor = target.constructor; // Use of Object.defineProperty is important because it creates a non-enumerable property + const constructor = target.constructor; + // Use of Object.defineProperty is important because it creates a non-enumerable property // which prevents the property from being copied during subclassing. - const meta = constructor.hasOwnProperty(PROP_METADATA) ? constructor[PROP_METADATA] : Object.defineProperty(constructor, PROP_METADATA, { value: {} })[PROP_METADATA]; @@ -29254,26 +26944,16 @@ function makePropDecorator(name, props, parentClass, additionalProcessing) { meta[name].unshift(decoratorInstance); if (additionalProcessing) additionalProcessing(target, name, ...args); } - return PropDecorator; } - if (parentClass) { PropDecoratorFactory.prototype = Object.create(parentClass.prototype); } - PropDecoratorFactory.prototype.ngMetadataName = name; PropDecoratorFactory.annotationCls = PropDecoratorFactory; return PropDecoratorFactory; }); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Attribute decorator and metadata. @@ -29281,19 +26961,10 @@ function makePropDecorator(name, props, parentClass, additionalProcessing) { * @Annotation * @publicApi */ - - const Attribute = makeParamDecorator('Attribute', attributeName => ({ attributeName, __NG_ELEMENT_ID__: () => ɵɵinjectAttribute(attributeName) })); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Creates a token that can be used in a DI Provider. @@ -29319,8 +26990,11 @@ const Attribute = makeParamDecorator('Attribute', attributeName => ({ * As you can see in the Tree-shakable InjectionToken example below. * * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which - * overrides the above behavior and marks the token as belonging to a particular `@NgModule`. As - * mentioned above, `'root'` is the default value for `providedIn`. + * overrides the above behavior and marks the token as belonging to a particular `@NgModule` (note: + * this option is now deprecated). As mentioned above, `'root'` is the default value for + * `providedIn`. + * + * The `providedIn: NgModule` and `providedIn: 'any'` options are deprecated. * * @usageNotes * ### Basic Examples @@ -29336,7 +27010,6 @@ const Attribute = makeParamDecorator('Attribute', attributeName => ({ * * @publicApi */ - class InjectionToken { /** * @param _desc Description for the token, @@ -29347,14 +27020,12 @@ class InjectionToken { constructor(_desc, options) { this._desc = _desc; /** @internal */ - this.ngMetadataName = 'InjectionToken'; this.ɵprov = undefined; - if (typeof options == 'number') { - (typeof ngDevMode === 'undefined' || ngDevMode) && assertLessThan(options, 0, 'Only negative numbers are supported here'); // This is a special hack to assign __NG_ELEMENT_ID__ to this instance. + (typeof ngDevMode === 'undefined' || ngDevMode) && assertLessThan(options, 0, 'Only negative numbers are supported here'); + // This is a special hack to assign __NG_ELEMENT_ID__ to this instance. // See `InjectorMarkers` - this.__NG_ELEMENT_ID__ = options; } else if (options !== undefined) { this.ɵprov = ɵɵdefineInjectable({ @@ -29367,24 +27038,13 @@ class InjectionToken { /** * @internal */ - - get multi() { return this; } - toString() { return `InjectionToken ${this._desc}`; } - } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * A DI token that you can use to create a virtual [provider](guide/glossary#provider) @@ -29423,11 +27083,9 @@ class InjectionToken { * @publicApi * @deprecated Since 9.0.0. With Ivy, this property is no longer necessary. */ - - -const ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken('AnalyzeForEntryComponents'); // Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not +const ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken('AnalyzeForEntryComponents'); +// Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not // explicitly set. - const emitDistinctChangesOnlyDefaultValue = true; /** * Base class for query metadata. @@ -29439,7 +27097,6 @@ const emitDistinctChangesOnlyDefaultValue = true; * * @publicApi */ - class Query {} /** * ContentChildren decorator and metadata. @@ -29448,8 +27105,6 @@ class Query {} * @Annotation * @publicApi */ - - const ContentChildren = makePropDecorator('ContentChildren', (selector, data = {}) => ({ selector, first: false, @@ -29466,7 +27121,6 @@ const ContentChildren = makePropDecorator('ContentChildren', (selector, data = { * * @publicApi */ - const ContentChild = makePropDecorator('ContentChild', (selector, data = {}) => ({ selector, first: true, @@ -29480,7 +27134,6 @@ const ContentChild = makePropDecorator('ContentChild', (selector, data = {}) => * @Annotation * @publicApi */ - const ViewChildren = makePropDecorator('ViewChildren', (selector, data = {}) => ({ selector, first: false, @@ -29495,7 +27148,6 @@ const ViewChildren = makePropDecorator('ViewChildren', (selector, data = {}) => * @Annotation * @publicApi */ - const ViewChild = makePropDecorator('ViewChild', (selector, data) => ({ selector, first: true, @@ -29503,16 +27155,7 @@ const ViewChild = makePropDecorator('ViewChild', (selector, data) => ({ descendants: true, ...data }), Query); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - var FactoryTarget; - (function (FactoryTarget) { FactoryTarget[FactoryTarget["Directive"] = 0] = "Directive"; FactoryTarget[FactoryTarget["Component"] = 1] = "Component"; @@ -29520,48 +27163,30 @@ var FactoryTarget; FactoryTarget[FactoryTarget["Pipe"] = 3] = "Pipe"; FactoryTarget[FactoryTarget["NgModule"] = 4] = "NgModule"; })(FactoryTarget || (FactoryTarget = {})); - var R3TemplateDependencyKind; - (function (R3TemplateDependencyKind) { R3TemplateDependencyKind[R3TemplateDependencyKind["Directive"] = 0] = "Directive"; R3TemplateDependencyKind[R3TemplateDependencyKind["Pipe"] = 1] = "Pipe"; R3TemplateDependencyKind[R3TemplateDependencyKind["NgModule"] = 2] = "NgModule"; })(R3TemplateDependencyKind || (R3TemplateDependencyKind = {})); - var ViewEncapsulation; - (function (ViewEncapsulation) { - ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; // Historically the 1 value was for `Native` encapsulation which has been removed as of v11. - + ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; + // Historically the 1 value was for `Native` encapsulation which has been removed as of v11. ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom"; })(ViewEncapsulation || (ViewEncapsulation = {})); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - function getCompilerFacade(request) { const globalNg = _global['ng']; - if (globalNg && globalNg.ɵcompilerFacade) { return globalNg.ɵcompilerFacade; } - if (typeof ngDevMode === 'undefined' || ngDevMode) { // Log the type as an error so that a developer can easily navigate to the type from the // console. console.error(`JIT compilation failed for ${request.kind}`, request.type); let message = `The ${request.kind} '${request.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\n\n`; - - if (request.usage === 1 - /* JitCompilerUsage.PartialDeclaration */ - ) { + if (request.usage === 1 /* JitCompilerUsage.PartialDeclaration */) { message += `The ${request.kind} is part of a library that has been partially compiled.\n`; message += `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\n`; message += '\n'; @@ -29569,7 +27194,6 @@ function getCompilerFacade(request) { } else { message += `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\n`; } - message += `Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\n`; message += `or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.`; throw new Error(message); @@ -29577,13 +27201,6 @@ function getCompilerFacade(request) { throw new Error('JIT compiler unavailable'); } } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * @description @@ -29595,34 +27212,11 @@ function getCompilerFacade(request) { * * @publicApi */ - - const Type = Function; - function isType(v) { return typeof v === 'function'; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -/** - * Equivalent to ES6 spread, add each item to an array. - * - * @param items The items to add - * @param arr The array to which you want to add the items - */ - -function addAllToArray(items, arr) { - for (let i = 0; i < items.length; i++) { - arr.push(items[i]); - } -} /** * Determines if the contents of two arrays is identical * @@ -29631,59 +27225,30 @@ function addAllToArray(items, arr) { * @param identityAccessor Optional function for extracting stable object identity from a value in * the array. */ - - function arrayEquals(a, b, identityAccessor) { if (a.length !== b.length) return false; - for (let i = 0; i < a.length; i++) { let valueA = a[i]; let valueB = b[i]; - if (identityAccessor) { valueA = identityAccessor(valueA); valueB = identityAccessor(valueB); } - if (valueB !== valueA) { return false; } } - return true; } /** * Flattens an array. */ - - -function flatten(list, dst) { - if (dst === undefined) dst = list; - - for (let i = 0; i < list.length; i++) { - let item = list[i]; - - if (Array.isArray(item)) { - // we need to inline it. - if (dst === list) { - // Our assumption that the list was already flat was wrong and - // we need to clone flat since we need to write to it. - dst = list.slice(0, i); - } - - flatten(item, dst); - } else if (dst !== list) { - dst.push(item); - } - } - - return dst; +function flatten(list) { + return list.flat(Number.POSITIVE_INFINITY); } - function deepForEach(input, fn) { input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value)); } - function addToArray(arr, index, value) { // perf: array.push is faster than array.splice! if (index >= arr.length) { @@ -29692,7 +27257,6 @@ function addToArray(arr, index, value) { arr.splice(index, 0, value); } } - function removeFromArray(arr, index) { // perf: array.pop is faster than array.splice! if (index >= arr.length - 1) { @@ -29701,14 +27265,11 @@ function removeFromArray(arr, index) { return arr.splice(index, 1)[0]; } } - function newArray(size, value) { const list = []; - for (let i = 0; i < size; i++) { list.push(value); } - return list; } /** @@ -29724,16 +27285,12 @@ function newArray(size, value) { * @param index Index of element in array to remove. * @param count Number of items to remove. */ - - function arraySplice(array, index, count) { const length = array.length - count; - while (index < length) { array[index] = array[index + count]; index++; } - while (count--) { array.pop(); // shrink the array } @@ -29749,18 +27306,14 @@ function arraySplice(array, index, count) { * @param index Index in array where the `value` should be added. * @param value Value to add to array. */ - - function arrayInsert(array, index, value) { ngDevMode && assertLessThanOrEqual(index, array.length, 'Can\'t insert past array end.'); let end = array.length; - while (end > index) { const previousEnd = end - 1; array[end] = array[previousEnd]; end = previousEnd; } - array[index] = value; } /** @@ -29775,12 +27328,9 @@ function arrayInsert(array, index, value) { * @param value1 Value to add to array. * @param value2 Value to add to array. */ - - function arrayInsert2(array, index, value1, value2) { ngDevMode && assertLessThanOrEqual(index, array.length, 'Can\'t insert past array end.'); let end = array.length; - if (end == index) { // inserting at the end. array.push(value1, value2); @@ -29791,65 +27341,15 @@ function arrayInsert2(array, index, value1, value2) { } else { end--; array.push(array[end - 1], array[end]); - while (end > index) { const previousEnd = end - 2; array[end] = array[previousEnd]; end--; } - array[index] = value1; array[index + 1] = value2; } } -/** - * Insert a `value` into an `array` so that the array remains sorted. - * - * NOTE: - * - Duplicates are not allowed, and are ignored. - * - This uses binary search algorithm for fast inserts. - * - * @param array A sorted array to insert into. - * @param value The value to insert. - * @returns index of the inserted value. - */ - - -function arrayInsertSorted(array, value) { - let index = arrayIndexOfSorted(array, value); - - if (index < 0) { - // if we did not find it insert it. - index = ~index; - arrayInsert(array, index, value); - } - - return index; -} -/** - * Remove `value` from a sorted `array`. - * - * NOTE: - * - This uses binary search algorithm for fast removals. - * - * @param array A sorted array to remove from. - * @param value The value to remove. - * @returns index of the removed value. - * - positive index if value found and removed. - * - negative index if value not found. (`~index` to get the value where it should have been - * inserted) - */ - - -function arrayRemoveSorted(array, value) { - const index = arrayIndexOfSorted(array, value); - - if (index >= 0) { - arraySplice(array, index, 1); - } - - return index; -} /** * Get an index of an `value` in a sorted `array`. * @@ -29863,8 +27363,6 @@ function arrayRemoveSorted(array, value) { * - negative index if value not found. (`~index` to get the value where it should have been * located) */ - - function arrayIndexOfSorted(array, value) { return _arrayIndexOfSorted(array, value, 0); } @@ -29876,11 +27374,8 @@ function arrayIndexOfSorted(array, value) { * @param value The value to set for a `key`. * @returns index (always even) of where the value vas set. */ - - function keyValueArraySet(keyValueArray, key, value) { let index = keyValueArrayIndexOf(keyValueArray, key); - if (index >= 0) { // if we found it set it. keyValueArray[index | 1] = value; @@ -29888,7 +27383,6 @@ function keyValueArraySet(keyValueArray, key, value) { index = ~index; arrayInsert2(keyValueArray, index, key, value); } - return index; } /** @@ -29898,16 +27392,12 @@ function keyValueArraySet(keyValueArray, key, value) { * @param key The key to locate. * @return The `value` stored at the `key` location or `undefined if not found. */ - - function keyValueArrayGet(keyValueArray, key) { const index = keyValueArrayIndexOf(keyValueArray, key); - if (index >= 0) { // if we found it retrieve it. return keyValueArray[index | 1]; } - return undefined; } /** @@ -29920,8 +27410,6 @@ function keyValueArrayGet(keyValueArray, key) { * - negative index if key not found. (`~index` (even) to get the index where it should have * been inserted.) */ - - function keyValueArrayIndexOf(keyValueArray, key) { return _arrayIndexOfSorted(keyValueArray, key, 1); } @@ -29935,16 +27423,12 @@ function keyValueArrayIndexOf(keyValueArray, key) { * - negative index if key not found. (`~index` (even) to get the index where it should have * been.) */ - - function keyValueArrayDelete(keyValueArray, key) { const index = keyValueArrayIndexOf(keyValueArray, key); - if (index >= 0) { // if we found it remove it. arraySplice(keyValueArray, index, 2); } - return index; } /** @@ -29964,18 +27448,13 @@ function keyValueArrayDelete(keyValueArray, key) { * - negative index if value not found. (`~index` to get the value where it should have been * inserted) */ - - function _arrayIndexOfSorted(array, value, shift) { ngDevMode && assertEqual(Array.isArray(array), true, 'Expecting an array'); let start = 0; let end = array.length >> shift; - while (end !== start) { const middle = start + (end - start >> 1); // find the middle. - const current = array[middle << shift]; - if (value === current) { return middle << shift; } else if (current > value) { @@ -29987,20 +27466,12 @@ function _arrayIndexOfSorted(array, value, shift) { return ~(end << shift); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /* * ######################### * Attention: These Regular expressions have to hold even if the code is minified! * ########################## */ - /** * Regular expression that detects pass-through constructors for ES5 output. This Regex * intends to capture the common delegation pattern emitted by TypeScript and Babel. Also @@ -30026,23 +27497,18 @@ function _arrayIndexOfSorted(array, value, shift) { * * More details can be found in: https://github.com/angular/angular/issues/38453. */ - - const ES5_DELEGATE_CTOR = /^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*(arguments|(?:[^()]+\(\[\],)?[^()]+\(arguments\).*)\)/; /** Regular expression that detects ES2015 classes which extend from other classes. */ - const ES2015_INHERITED_CLASS = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{/; /** * Regular expression that detects ES2015 classes which extend from other classes and * have an explicit constructor defined. */ - const ES2015_INHERITED_CLASS_WITH_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(/; /** * Regular expression that detects ES2015 classes which extend from other classes * and inherit a constructor. */ - const ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{[^}]*super\(\.\.\.arguments\)/; /** * Determine whether a stringified type is a class which delegates its constructor @@ -30052,31 +27518,24 @@ const ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*exte * even if the original source code did not. For instance, when the child class contains * an initialized instance property. */ - function isDelegateCtor(typeStr) { return ES5_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr); } - class ReflectionCapabilities { constructor(reflect) { this._reflect = reflect || _global['Reflect']; } - factory(t) { return (...args) => new t(...args); } /** @internal */ - - _zipTypesAndAnnotations(paramTypes, paramAnnotations) { let result; - if (typeof paramTypes === 'undefined') { result = newArray(paramAnnotations.length); } else { result = newArray(paramTypes.length); } - for (let i = 0; i < result.length; i++) { // TS outputs Object for parameters without types, while Traceur omits // the annotations. For now we preserve the Traceur behavior to aid @@ -30088,36 +27547,30 @@ class ReflectionCapabilities { } else { result[i] = []; } - if (paramAnnotations && paramAnnotations[i] != null) { result[i] = result[i].concat(paramAnnotations[i]); } } - return result; } - _ownParameters(type, parentCtor) { - const typeStr = type.toString(); // If we have no decorators, we only have function.length as metadata. + const typeStr = type.toString(); + // If we have no decorators, we only have function.length as metadata. // In that case, to detect whether a child class declared an own constructor or not, // we need to look inside of that constructor to check whether it is // just calling the parent. // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439 // that sets 'design:paramtypes' to [] // if a class inherits from another class but has no ctor declared itself. - if (isDelegateCtor(typeStr)) { return null; - } // Prefer the direct API. - - + } + // Prefer the direct API. if (type.parameters && type.parameters !== parentCtor.parameters) { return type.parameters; - } // API of tsickle for lowering decorators to properties on the class. - - + } + // API of tsickle for lowering decorators to properties on the class. const tsickleCtorParams = type.ctorParameters; - if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) { // Newer tsickle uses a function closure // Retain the non-function case for compatibility with older tsickle @@ -30125,91 +27578,70 @@ class ReflectionCapabilities { const paramTypes = ctorParameters.map(ctorParam => ctorParam && ctorParam.type); const paramAnnotations = ctorParameters.map(ctorParam => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators)); return this._zipTypesAndAnnotations(paramTypes, paramAnnotations); - } // API for metadata created by invoking the decorators. - - + } + // API for metadata created by invoking the decorators. const paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS]; - const paramTypes = this._reflect && this._reflect.getOwnMetadata && this._reflect.getOwnMetadata('design:paramtypes', type); - if (paramTypes || paramAnnotations) { return this._zipTypesAndAnnotations(paramTypes, paramAnnotations); - } // If a class has no decorators, at least create metadata + } + // If a class has no decorators, at least create metadata // based on function.length. // Note: We know that this is a real constructor as we checked // the content of the constructor above. - - return newArray(type.length); } - parameters(type) { // Note: only report metadata if we have at least one class decorator // to stay in sync with the static reflector. if (!isType(type)) { return []; } - const parentCtor = getParentCtor(type); - let parameters = this._ownParameters(type, parentCtor); - if (!parameters && parentCtor !== Object) { parameters = this.parameters(parentCtor); } - return parameters || []; } - _ownAnnotations(typeOrFunc, parentCtor) { // Prefer the direct API. if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) { let annotations = typeOrFunc.annotations; - if (typeof annotations === 'function' && annotations.annotations) { annotations = annotations.annotations; } - return annotations; - } // API of tsickle for lowering decorators to properties on the class. - - + } + // API of tsickle for lowering decorators to properties on the class. if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) { return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators); - } // API for metadata created by invoking the decorators. - - + } + // API for metadata created by invoking the decorators. if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) { return typeOrFunc[ANNOTATIONS]; } - return null; } - annotations(typeOrFunc) { if (!isType(typeOrFunc)) { return []; } - const parentCtor = getParentCtor(typeOrFunc); const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || []; const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : []; return parentAnnotations.concat(ownAnnotations); } - _ownPropMetadata(typeOrFunc, parentCtor) { // Prefer the direct API. if (typeOrFunc.propMetadata && typeOrFunc.propMetadata !== parentCtor.propMetadata) { let propMetadata = typeOrFunc.propMetadata; - if (typeof propMetadata === 'function' && propMetadata.propMetadata) { propMetadata = propMetadata.propMetadata; } - return propMetadata; - } // API of tsickle for lowering decorators to properties on the class. - - + } + // API of tsickle for lowering decorators to properties on the class. if (typeOrFunc.propDecorators && typeOrFunc.propDecorators !== parentCtor.propDecorators) { const propDecorators = typeOrFunc.propDecorators; const propMetadata = {}; @@ -30217,68 +27649,52 @@ class ReflectionCapabilities { propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]); }); return propMetadata; - } // API for metadata created by invoking the decorators. - - + } + // API for metadata created by invoking the decorators. if (typeOrFunc.hasOwnProperty(PROP_METADATA)) { return typeOrFunc[PROP_METADATA]; } - return null; } - propMetadata(typeOrFunc) { if (!isType(typeOrFunc)) { return {}; } - const parentCtor = getParentCtor(typeOrFunc); const propMetadata = {}; - if (parentCtor !== Object) { const parentPropMetadata = this.propMetadata(parentCtor); Object.keys(parentPropMetadata).forEach(propName => { propMetadata[propName] = parentPropMetadata[propName]; }); } - const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor); - if (ownPropMetadata) { Object.keys(ownPropMetadata).forEach(propName => { const decorators = []; - if (propMetadata.hasOwnProperty(propName)) { decorators.push(...propMetadata[propName]); } - decorators.push(...ownPropMetadata[propName]); propMetadata[propName] = decorators; }); } - return propMetadata; } - ownPropMetadata(typeOrFunc) { if (!isType(typeOrFunc)) { return {}; } - return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {}; } - hasLifecycleHook(type, lcProperty) { return type instanceof Type && lcProperty in type.prototype; } - } - function convertTsickleDecoratorIntoMetadata(decoratorInvocations) { if (!decoratorInvocations) { return []; } - return decoratorInvocations.map(decoratorInvocation => { const decoratorType = decoratorInvocation.type; const annotationCls = decoratorType.annotationCls; @@ -30286,271 +27702,13 @@ function convertTsickleDecoratorIntoMetadata(decoratorInvocations) { return new annotationCls(...annotationArgs); }); } - function getParentCtor(ctor) { const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null; - const parentCtor = parentProto ? parentProto.constructor : null; // Note: We always use `Object` as the null value + const parentCtor = parentProto ? parentProto.constructor : null; + // Note: We always use `Object` as the null value // to simplify checking later on. - return parentCtor || Object; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - - -const _THROW_IF_NOT_FOUND = {}; -const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND; -/* - * Name of a property (that we patch onto DI decorator), which is used as an annotation of which - * InjectFlag this decorator represents. This allows to avoid direct references to the DI decorators - * in the code, thus making them tree-shakable. - */ - -const DI_DECORATOR_FLAG = '__NG_DI_FLAG__'; -const NG_TEMP_TOKEN_PATH = 'ngTempTokenPath'; -const NG_TOKEN_PATH = 'ngTokenPath'; -const NEW_LINE = /\n/gm; -const NO_NEW_LINE = 'ɵ'; -const SOURCE = '__source'; -/** - * Current injector value used by `inject`. - * - `undefined`: it is an error to call `inject` - * - `null`: `inject` can be called but there is no injector (limp-mode). - * - Injector instance: Use the injector for resolution. - */ - -let _currentInjector = undefined; - -function setCurrentInjector(injector) { - const former = _currentInjector; - _currentInjector = injector; - return former; -} - -function injectInjectorOnly(token, flags = InjectFlags.Default) { - if (_currentInjector === undefined) { - const errorMessage = typeof ngDevMode === 'undefined' || ngDevMode ? `inject() must be called from an injection context (a constructor, a factory function or a field initializer)` : ''; - throw new RuntimeError(-203 - /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */ - , errorMessage); - } else if (_currentInjector === null) { - return injectRootLimpMode(token, undefined, flags); - } else { - return _currentInjector.get(token, flags & InjectFlags.Optional ? null : undefined, flags); - } -} - -function ɵɵinject(token, flags = InjectFlags.Default) { - return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags); -} -/** - * Throws an error indicating that a factory function could not be generated by the compiler for a - * particular class. - * - * This instruction allows the actual error message to be optimized away when ngDevMode is turned - * off, saving bytes of generated code while still providing a good experience in dev mode. - * - * The name of the class is not mentioned here, but will be in the generated factory function name - * and thus in the stack trace. - * - * @codeGenApi - */ - - -function ɵɵinvalidFactoryDep(index) { - const msg = ngDevMode ? `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid. -This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator. - -Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.` : 'invalid'; - throw new Error(msg); -} -/** - * Injects a token from the currently active injector. - * `inject` is only supported during instantiation of a dependency by the DI system. It can be used - * during: - * - Construction (via the `constructor`) of a class being instantiated by the DI system, such - * as an `@Injectable` or `@Component`. - * - In the initializer for fields of such classes. - * - In the factory function specified for `useFactory` of a `Provider` or an `@Injectable`. - * - In the `factory` function specified for an `InjectionToken`. - * - * @param token A token that represents a dependency that should be injected. - * @param flags Optional flags that control how injection is executed. - * The flags correspond to injection strategies that can be specified with - * parameter decorators `@Host`, `@Self`, `@SkipSef`, and `@Optional`. - * @returns the injected value if operation is successful, `null` otherwise. - * @throws if called outside of a supported context. - * - * @usageNotes - * In practice the `inject()` calls are allowed in a constructor, a constructor parameter and a - * field initializer: - * - * ```typescript - * @Injectable({providedIn: 'root'}) - * export class Car { - * radio: Radio|undefined; - * // OK: field initializer - * spareTyre = inject(Tyre); - * - * constructor() { - * // OK: constructor body - * this.radio = inject(Radio); - * } - * } - * ``` - * - * It is also legal to call `inject` from a provider's factory: - * - * ```typescript - * providers: [ - * {provide: Car, useFactory: () => { - * // OK: a class factory - * const engine = inject(Engine); - * return new Car(engine); - * }} - * ] - * ``` - * - * Calls to the `inject()` function outside of the class creation context will result in error. Most - * notably, calls to `inject()` are disallowed after a class instance was created, in methods - * (including lifecycle hooks): - * - * ```typescript - * @Component({ ... }) - * export class CarComponent { - * ngOnInit() { - * // ERROR: too late, the component instance was already created - * const engine = inject(Engine); - * engine.start(); - * } - * } - * ``` - * - * @publicApi - */ - - -function inject(token, flags = InjectFlags.Default) { - return ɵɵinject(token, flags); -} - -function injectArgs(types) { - const args = []; - - for (let i = 0; i < types.length; i++) { - const arg = resolveForwardRef(types[i]); - - if (Array.isArray(arg)) { - if (arg.length === 0) { - const errorMessage = typeof ngDevMode === 'undefined' || ngDevMode ? 'Arguments array must have arguments.' : ''; - throw new RuntimeError(900 - /* RuntimeErrorCode.INVALID_DIFFER_INPUT */ - , errorMessage); - } - - let type = undefined; - let flags = InjectFlags.Default; - - for (let j = 0; j < arg.length; j++) { - const meta = arg[j]; - const flag = getInjectFlag(meta); - - if (typeof flag === 'number') { - // Special case when we handle @Inject decorator. - if (flag === -1 - /* DecoratorFlags.Inject */ - ) { - type = meta.token; - } else { - flags |= flag; - } - } else { - type = meta; - } - } - - args.push(ɵɵinject(type, flags)); - } else { - args.push(ɵɵinject(arg)); - } - } - - return args; -} -/** - * Attaches a given InjectFlag to a given decorator using monkey-patching. - * Since DI decorators can be used in providers `deps` array (when provider is configured using - * `useFactory`) without initialization (e.g. `Host`) and as an instance (e.g. `new Host()`), we - * attach the flag to make it available both as a static property and as a field on decorator - * instance. - * - * @param decorator Provided DI decorator. - * @param flag InjectFlag that should be applied. - */ - - -function attachInjectFlag(decorator, flag) { - decorator[DI_DECORATOR_FLAG] = flag; - decorator.prototype[DI_DECORATOR_FLAG] = flag; - return decorator; -} -/** - * Reads monkey-patched property that contains InjectFlag attached to a decorator. - * - * @param token Token that may contain monkey-patched DI flags property. - */ - - -function getInjectFlag(token) { - return token[DI_DECORATOR_FLAG]; -} - -function catchInjectorError(e, token, injectorErrorName, source) { - const tokenPath = e[NG_TEMP_TOKEN_PATH]; - - if (token[SOURCE]) { - tokenPath.unshift(token[SOURCE]); - } - - e.message = formatError('\n' + e.message, tokenPath, injectorErrorName, source); - e[NG_TOKEN_PATH] = tokenPath; - e[NG_TEMP_TOKEN_PATH] = null; - throw e; -} - -function formatError(text, obj, injectorErrorName, source = null) { - text = text && text.charAt(0) === '\n' && text.charAt(1) == NO_NEW_LINE ? text.slice(2) : text; - let context = stringify(obj); - - if (Array.isArray(obj)) { - context = obj.map(stringify).join(' -> '); - } else if (typeof obj === 'object') { - let parts = []; - - for (let key in obj) { - if (obj.hasOwnProperty(key)) { - let value = obj[key]; - parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value))); - } - } - - context = `{${parts.join(', ')}}`; - } - - return `${injectorErrorName}${source ? '(' + source + ')' : ''}[${context}]: ${text.replace(NEW_LINE, '\n ')}`; -} -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Inject decorator and metadata. @@ -30558,85 +27716,63 @@ function formatError(text, obj, injectorErrorName, source = null) { * @Annotation * @publicApi */ - - -const Inject = attachInjectFlag( // Disable tslint because `DecoratorFlags` is a const enum which gets inlined. +const Inject = attachInjectFlag( +// Disable tslint because `DecoratorFlags` is a const enum which gets inlined. // tslint:disable-next-line: no-toplevel-property-access makeParamDecorator('Inject', token => ({ token -})), -1 -/* DecoratorFlags.Inject */ -); +})), -1 /* DecoratorFlags.Inject */); /** * Optional decorator and metadata. * * @Annotation * @publicApi */ - -const Optional = // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined. +const Optional = +// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined. // tslint:disable-next-line: no-toplevel-property-access -attachInjectFlag(makeParamDecorator('Optional'), 8 -/* InternalInjectFlags.Optional */ -); +attachInjectFlag(makeParamDecorator('Optional'), 8 /* InternalInjectFlags.Optional */); /** * Self decorator and metadata. * * @Annotation * @publicApi */ - -const Self = // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined. +const Self = +// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined. // tslint:disable-next-line: no-toplevel-property-access -attachInjectFlag(makeParamDecorator('Self'), 2 -/* InternalInjectFlags.Self */ -); +attachInjectFlag(makeParamDecorator('Self'), 2 /* InternalInjectFlags.Self */); /** * `SkipSelf` decorator and metadata. * * @Annotation * @publicApi */ - -const SkipSelf = // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined. +const SkipSelf = +// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined. // tslint:disable-next-line: no-toplevel-property-access -attachInjectFlag(makeParamDecorator('SkipSelf'), 4 -/* InternalInjectFlags.SkipSelf */ -); +attachInjectFlag(makeParamDecorator('SkipSelf'), 4 /* InternalInjectFlags.SkipSelf */); /** * Host decorator and metadata. * * @Annotation * @publicApi */ - -const Host = // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined. +const Host = +// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined. // tslint:disable-next-line: no-toplevel-property-access -attachInjectFlag(makeParamDecorator('Host'), 1 -/* InternalInjectFlags.Host */ -); -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ +attachInjectFlag(makeParamDecorator('Host'), 1 /* InternalInjectFlags.Host */); let _reflect = null; - function getReflect() { return _reflect = _reflect || new ReflectionCapabilities(); } - function reflectDependencies(type) { return convertDependencies(getReflect().parameters(type)); } - function convertDependencies(deps) { return deps.map(dep => reflectDependency(dep)); } - function reflectDependency(dep) { const meta = { token: null, @@ -30646,18 +27782,14 @@ function reflectDependency(dep) { self: false, skipSelf: false }; - if (Array.isArray(dep) && dep.length > 0) { for (let j = 0; j < dep.length; j++) { const param = dep[j]; - if (param === undefined) { // param may be undefined if type of dep is not set by ngtsc continue; } - const proto = Object.getPrototypeOf(param); - if (param instanceof Optional || proto.ngMetadataName === 'Optional') { meta.optional = true; } else if (param instanceof SkipSelf || proto.ngMetadataName === 'SkipSelf') { @@ -30670,9 +27802,8 @@ function reflectDependency(dep) { meta.token = param.token; } else if (param instanceof Attribute) { if (param.attributeName === undefined) { - throw new Error(`Attribute name must be defined.`); + throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Attribute name must be defined.`); } - meta.attribute = param.attributeName; } else { meta.token = param; @@ -30683,19 +27814,11 @@ function reflectDependency(dep) { } else { meta.token = dep; } - return meta; } + /** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -/** - * Used to resolve resource URLs on `@Component` when used with JIT compilation. + * Used to resolve resource URLs on `@Component` when used with JIT compilation. * * Example: * ``` @@ -30726,44 +27849,34 @@ function reflectDependency(dep) { * @param resourceResolver a function which is responsible for returning a `Promise` to the * contents of the resolved URL. Browser's `fetch()` method is a good default implementation. */ - - function resolveComponentResources(resourceResolver) { // Store all promises which are fetching the resources. - const componentResolved = []; // Cache so that we don't fetch the same resource more than once. - + const componentResolved = []; + // Cache so that we don't fetch the same resource more than once. const urlMap = new Map(); - function cachedResourceResolve(url) { let promise = urlMap.get(url); - if (!promise) { const resp = resourceResolver(url); urlMap.set(url, promise = resp.then(unwrapResponse)); } - return promise; } - componentResourceResolutionQueue.forEach((component, type) => { const promises = []; - if (component.templateUrl) { promises.push(cachedResourceResolve(component.templateUrl).then(template => { component.template = template; })); } - const styleUrls = component.styleUrls; const styles = component.styles || (component.styles = []); const styleOffset = component.styles.length; styleUrls && styleUrls.forEach((styleUrl, index) => { styles.push(''); // pre-allocate array. - promises.push(cachedResourceResolve(styleUrl).then(style => { styles[styleOffset + index] = style; styleUrls.splice(styleUrls.indexOf(styleUrl), 1); - if (styleUrls.length == 0) { component.styleUrls = undefined; } @@ -30775,71 +27888,51 @@ function resolveComponentResources(resourceResolver) { clearResolutionOfComponentResourcesQueue(); return Promise.all(componentResolved).then(() => undefined); } - -let componentResourceResolutionQueue = new Map(); // Track when existing ɵcmp for a Type is waiting on resources. - +let componentResourceResolutionQueue = new Map(); +// Track when existing ɵcmp for a Type is waiting on resources. const componentDefPendingResolution = new Set(); - function maybeQueueResolutionOfComponentResources(type, metadata) { if (componentNeedsResolution(metadata)) { componentResourceResolutionQueue.set(type, metadata); componentDefPendingResolution.add(type); } } - function isComponentDefPendingResolution(type) { return componentDefPendingResolution.has(type); } - function componentNeedsResolution(component) { return !!(component.templateUrl && !component.hasOwnProperty('template') || component.styleUrls && component.styleUrls.length); } - function clearResolutionOfComponentResourcesQueue() { const old = componentResourceResolutionQueue; componentResourceResolutionQueue = new Map(); return old; } - function restoreComponentResolutionQueue(queue) { componentDefPendingResolution.clear(); queue.forEach((_, type) => componentDefPendingResolution.add(type)); componentResourceResolutionQueue = queue; } - function isComponentResourceResolutionQueueEmpty() { return componentResourceResolutionQueue.size === 0; } - function unwrapResponse(response) { return typeof response == 'string' ? response : response.text(); } - function componentDefResolved(type) { componentDefPendingResolution.delete(type); } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** * Map of module-id to the corresponding NgModule. */ - - const modules = new Map(); /** * Whether to check for duplicate NgModule registrations. * * This can be disabled for testing. */ - let checkForDuplicateNgModules = true; - function assertSameOrNotExisting(id, type, incoming) { if (type && type !== incoming && checkForDuplicateNgModules) { throw new Error(`Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`); @@ -30855,18 +27948,14 @@ function assertSameOrNotExisting(id, type, incoming) { * * @codeGenApi */ - - function registerNgModuleType(ngModuleType, id) { const existing = modules.get(id) || null; assertSameOrNotExisting(id, existing, ngModuleType); modules.set(id, ngModuleType); } - function clearModulesForTest() { modules.clear(); } - function getRegisteredNgModuleType(id) { return modules.get(id); } @@ -30877,3435 +27966,3738 @@ function getRegisteredNgModuleType(id) { * This is useful for testing as the NgModule registry cannot be properly reset between tests with * Angular's current API. */ - - function setAllowDuplicateNgModuleIdsForTest(allowDuplicates) { checkForDuplicateNgModules = !allowDuplicates; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** - * The Trusted Types policy, or null if Trusted Types are not - * enabled/supported, or undefined if the policy has not been created yet. + * Defines a schema that allows an NgModule to contain the following: + * - Non-Angular elements named with dash case (`-`). + * - Element properties named with dash case (`-`). + * Dash case is the naming convention for custom elements. + * + * @publicApi */ - - -let policy$1; +const CUSTOM_ELEMENTS_SCHEMA = { + name: 'custom-elements' +}; /** - * Returns the Trusted Types policy, or null if Trusted Types are not - * enabled/supported. The first call to this function will create the policy. + * Defines a schema that allows any property on any element. + * + * This schema allows you to ignore the errors related to any unknown elements or properties in a + * template. The usage of this schema is generally discouraged because it prevents useful validation + * and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead. + * + * @publicApi */ - -function getPolicy$1() { - if (policy$1 === undefined) { - policy$1 = null; - - if (_global.trustedTypes) { - try { - policy$1 = _global.trustedTypes.createPolicy('angular', { - createHTML: s => s, - createScript: s => s, - createScriptURL: s => s - }); - } catch {// trustedTypes.createPolicy throws if called with a name that is - // already registered, even in report-only mode. Until the API changes, - // catch the error not to break the applications functionally. In such - // cases, the code will fall back to using strings. - } - } - } - - return policy$1; -} +const NO_ERRORS_SCHEMA = { + name: 'no-errors-schema' +}; +let shouldThrowErrorOnUnknownElement = false; /** - * Unsafely promote a string to a TrustedHTML, falling back to strings when - * Trusted Types are not available. - * @security This is a security-sensitive function; any use of this function - * must go through security review. In particular, it must be assured that the - * provided string will never cause an XSS vulnerability if used in a context - * that will be interpreted as HTML by a browser, e.g. when assigning to - * element.innerHTML. + * Sets a strict mode for JIT-compiled components to throw an error on unknown elements, + * instead of just logging the error. + * (for AOT-compiled ones this check happens at build time). */ - - -function trustedHTMLFromString(html) { - return getPolicy$1()?.createHTML(html) || html; +function ɵsetUnknownElementStrictMode(shouldThrow) { + shouldThrowErrorOnUnknownElement = shouldThrow; } /** - * Unsafely promote a string to a TrustedScript, falling back to strings when - * Trusted Types are not available. - * @security In particular, it must be assured that the provided string will - * never cause an XSS vulnerability if used in a context that will be - * interpreted and executed as a script by a browser, e.g. when calling eval. + * Gets the current value of the strict mode. */ - - -function trustedScriptFromString(script) { - return getPolicy$1()?.createScript(script) || script; +function ɵgetUnknownElementStrictMode() { + return shouldThrowErrorOnUnknownElement; } +let shouldThrowErrorOnUnknownProperty = false; /** - * Unsafely promote a string to a TrustedScriptURL, falling back to strings - * when Trusted Types are not available. - * @security This is a security-sensitive function; any use of this function - * must go through security review. In particular, it must be assured that the - * provided string will never cause an XSS vulnerability if used in a context - * that will cause a browser to load and execute a resource, e.g. when - * assigning to script.src. + * Sets a strict mode for JIT-compiled components to throw an error on unknown properties, + * instead of just logging the error. + * (for AOT-compiled ones this check happens at build time). */ - - -function trustedScriptURLFromString(url) { - return getPolicy$1()?.createScriptURL(url) || url; +function ɵsetUnknownPropertyStrictMode(shouldThrow) { + shouldThrowErrorOnUnknownProperty = shouldThrow; } /** - * Unsafely call the Function constructor with the given string arguments. It - * is only available in development mode, and should be stripped out of - * production code. - * @security This is a security-sensitive function; any use of this function - * must go through security review. In particular, it must be assured that it - * is only called from development code, as use in production code can lead to - * XSS vulnerabilities. + * Gets the current value of the strict mode. */ - - -function newTrustedFunctionForDev(...args) { - if (typeof ngDevMode === 'undefined') { - throw new Error('newTrustedFunctionForDev should never be called in production'); - } - - if (!_global.trustedTypes) { - // In environments that don't support Trusted Types, fall back to the most - // straightforward implementation: - return new Function(...args); - } // Chrome currently does not support passing TrustedScript to the Function - // constructor. The following implements the workaround proposed on the page - // below, where the Chromium bug is also referenced: - // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor - - - const fnArgs = args.slice(0, -1).join(','); - const fnBody = args[args.length - 1]; - const body = `(function anonymous(${fnArgs} -) { ${fnBody} -})`; // Using eval directly confuses the compiler and prevents this module from - // being stripped out of JS binaries even if not used. The global['eval'] - // indirection fixes that. - - const fn = _global['eval'](trustedScriptFromString(body)); - - if (fn.bind === undefined) { - // Workaround for a browser bug that only exists in Chrome 83, where passing - // a TrustedScript to eval just returns the TrustedScript back without - // evaluating it. In that case, fall back to the most straightforward - // implementation: - return new Function(...args); - } // To completely mimic the behavior of calling "new Function", two more - // things need to happen: - // 1. Stringifying the resulting function should return its source code - - - fn.toString = () => body; // 2. When calling the resulting function, `this` should refer to `global` - - - return fn.bind(_global); // When Trusted Types support in Function constructors is widely available, - // the implementation of this function can be simplified to: - // return new Function(...args.map(a => trustedScriptFromString(a))); +function ɵgetUnknownPropertyStrictMode() { + return shouldThrowErrorOnUnknownProperty; } /** - * @license - * Copyright Google LLC All Rights Reserved. + * Validates that the element is known at runtime and produces + * an error if it's not the case. + * This check is relevant for JIT-compiled components (for AOT-compiled + * ones this check happens at build time). * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -/** - * The Trusted Types policy, or null if Trusted Types are not - * enabled/supported, or undefined if the policy has not been created yet. - */ - - -let policy; -/** - * Returns the Trusted Types policy, or null if Trusted Types are not - * enabled/supported. The first call to this function will create the policy. + * The element is considered known if either: + * - it's a known HTML element + * - it's a known custom element + * - the element matches any directive + * - the element is allowed by one of the schemas + * + * @param element Element to validate + * @param lView An `LView` that represents a current component that is being rendered + * @param tagName Name of the tag to check + * @param schemas Array of schemas + * @param hasDirectives Boolean indicating that the element matches any directive */ - -function getPolicy() { - if (policy === undefined) { - policy = null; - - if (_global.trustedTypes) { - try { - policy = _global.trustedTypes.createPolicy('angular#unsafe-bypass', { - createHTML: s => s, - createScript: s => s, - createScriptURL: s => s - }); - } catch {// trustedTypes.createPolicy throws if called with a name that is - // already registered, even in report-only mode. Until the API changes, - // catch the error not to break the applications functionally. In such - // cases, the code will fall back to using strings. +function validateElementIsKnown(element, lView, tagName, schemas, hasDirectives) { + // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT + // mode where this check happens at compile time. In JIT mode, `schemas` is always present and + // defined as an array (as an empty array in case `schemas` field is not defined) and we should + // execute the check below. + if (schemas === null) return; + // If the element matches any directive, it's considered as valid. + if (!hasDirectives && tagName !== null) { + // The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered + // as a custom element. Note that unknown elements with a dash in their name won't be instances + // of HTMLUnknownElement in browsers that support web components. + const isUnknown = + // Note that we can't check for `typeof HTMLUnknownElement === 'function'`, + // because while most browsers return 'function', IE returns 'object'. + typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement && element instanceof HTMLUnknownElement || typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 && !customElements.get(tagName); + if (isUnknown && !matchingSchemas(schemas, tagName)) { + const isHostStandalone = isHostComponentStandalone(lView); + const templateLocation = getTemplateLocationDetails(lView); + const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`; + let message = `'${tagName}' is not a known element${templateLocation}:\n`; + message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone ? 'included in the \'@Component.imports\' of this component' : 'a part of an @NgModule where this component is declared'}.\n`; + if (tagName && tagName.indexOf('-') > -1) { + message += `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`; + } else { + message += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`; + } + if (shouldThrowErrorOnUnknownElement) { + throw new RuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message); + } else { + console.error(formatRuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message)); } } } - - return policy; -} -/** - * Unsafely promote a string to a TrustedHTML, falling back to strings when - * Trusted Types are not available. - * @security This is a security-sensitive function; any use of this function - * must go through security review. In particular, it must be assured that it - * is only passed strings that come directly from custom sanitizers or the - * bypassSecurityTrust* functions. - */ - - -function trustedHTMLFromStringBypass(html) { - return getPolicy()?.createHTML(html) || html; -} -/** - * Unsafely promote a string to a TrustedScript, falling back to strings when - * Trusted Types are not available. - * @security This is a security-sensitive function; any use of this function - * must go through security review. In particular, it must be assured that it - * is only passed strings that come directly from custom sanitizers or the - * bypassSecurityTrust* functions. - */ - - -function trustedScriptFromStringBypass(script) { - return getPolicy()?.createScript(script) || script; } /** - * Unsafely promote a string to a TrustedScriptURL, falling back to strings - * when Trusted Types are not available. - * @security This is a security-sensitive function; any use of this function - * must go through security review. In particular, it must be assured that it - * is only passed strings that come directly from custom sanitizers or the - * bypassSecurityTrust* functions. + * Validates that the property of the element is known at runtime and returns + * false if it's not the case. + * This check is relevant for JIT-compiled components (for AOT-compiled + * ones this check happens at build time). + * + * The property is considered known if either: + * - it's a known property of the element + * - the element is allowed by one of the schemas + * - the property is used for animations + * + * @param element Element to validate + * @param propName Name of the property to check + * @param tagName Name of the tag hosting the property + * @param schemas Array of schemas */ - - -function trustedScriptURLFromStringBypass(url) { - return getPolicy()?.createScriptURL(url) || url; +function isPropertyValid(element, propName, tagName, schemas) { + // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT + // mode where this check happens at compile time. In JIT mode, `schemas` is always present and + // defined as an array (as an empty array in case `schemas` field is not defined) and we should + // execute the check below. + if (schemas === null) return true; + // The property is considered valid if the element matches the schema, it exists on the element, + // or it is synthetic, and we are in a browser context (web worker nodes should be skipped). + if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) { + return true; + } + // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we + // need to account for both here, while being careful with `typeof null` also returning 'object'. + return typeof Node === 'undefined' || Node === null || !(element instanceof Node); } /** - * @license - * Copyright Google LLC All Rights Reserved. + * Logs or throws an error that a property is not supported on an element. * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license + * @param propName Name of the invalid property + * @param tagName Name of the tag hosting the property + * @param nodeType Type of the node hosting the property + * @param lView An `LView` that represents a current component */ - - -class SafeValueImpl { - constructor(changingThisBreaksApplicationSecurity) { - this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity; - } - - toString() { - return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` + ` (see https://g.co/ng/security#xss)`; - } - -} - -class SafeHtmlImpl extends SafeValueImpl { - getTypeName() { - return "HTML" - /* BypassType.Html */ - ; - } - -} - -class SafeStyleImpl extends SafeValueImpl { - getTypeName() { - return "Style" - /* BypassType.Style */ - ; - } - -} - -class SafeScriptImpl extends SafeValueImpl { - getTypeName() { - return "Script" - /* BypassType.Script */ - ; - } - -} - -class SafeUrlImpl extends SafeValueImpl { - getTypeName() { - return "URL" - /* BypassType.Url */ - ; +function handleUnknownPropertyError(propName, tagName, nodeType, lView) { + // Special-case a situation when a structural directive is applied to + // an `` element, for example: ``. + // In this case the compiler generates the `ɵɵtemplate` instruction with + // the `null` as the tagName. The directive matching logic at runtime relies + // on this effect (see `isInlineTemplate`), thus using the 'ng-template' as + // a default value of the `tNode.value` is not feasible at this moment. + if (!tagName && nodeType === 4 /* TNodeType.Container */) { + tagName = 'ng-template'; } - -} - -class SafeResourceUrlImpl extends SafeValueImpl { - getTypeName() { - return "ResourceURL" - /* BypassType.ResourceUrl */ - ; + const isHostStandalone = isHostComponentStandalone(lView); + const templateLocation = getTemplateLocationDetails(lView); + let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`; + const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`; + const importLocation = isHostStandalone ? 'included in the \'@Component.imports\' of this component' : 'a part of an @NgModule where this component is declared'; + if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) { + // Most likely this is a control flow directive (such as `*ngIf`) used in + // a template, but the directive or the `CommonModule` is not imported. + const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName); + message += `\nIf the '${propName}' is an Angular control flow directive, ` + `please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`; + } else { + // May be an Angular component, which is not imported/declared? + message += `\n1. If '${tagName}' is an Angular component and it has the ` + `'${propName}' input, then verify that it is ${importLocation}.`; + // May be a Web Component? + if (tagName && tagName.indexOf('-') > -1) { + message += `\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` + `to the ${schemas} of this component to suppress this message.`; + message += `\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` + `the ${schemas} of this component.`; + } else { + // If it's expected, the error can be suppressed by the `NO_ERRORS_SCHEMA` schema. + message += `\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` + `the ${schemas} of this component.`; + } } - -} - -function unwrapSafeValue(value) { - return value instanceof SafeValueImpl ? value.changingThisBreaksApplicationSecurity : value; + reportUnknownPropertyError(message); } - -function allowSanitizationBypassAndThrow(value, type) { - const actualType = getSanitizationBypassType(value); - - if (actualType != null && actualType !== type) { - // Allow ResourceURLs in URL contexts, they are strictly more trusted. - if (actualType === "ResourceURL" - /* BypassType.ResourceUrl */ - && type === "URL" - /* BypassType.Url */ - ) return true; - throw new Error(`Required a safe ${type}, got a ${actualType} (see https://g.co/ng/security#xss)`); +function reportUnknownPropertyError(message) { + if (shouldThrowErrorOnUnknownProperty) { + throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message); + } else { + console.error(formatRuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message)); } - - return actualType === type; -} - -function getSanitizationBypassType(value) { - return value instanceof SafeValueImpl && value.getTypeName() || null; } /** - * Mark `html` string as trusted. + * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`) + * and must **not** be used in production bundles. The function makes megamorphic reads, which might + * be too slow for production mode and also it relies on the constructor function being available. * - * This function wraps the trusted string in `String` and brands it in a way which makes it - * recognizable to {@link htmlSanitizer} to be trusted implicitly. + * Gets a reference to the host component def (where a current component is declared). * - * @param trustedHtml `html` string which needs to be implicitly trusted. - * @returns a `html` which has been branded to be implicitly trusted. + * @param lView An `LView` that represents a current component that is being rendered. */ - - -function bypassSanitizationTrustHtml(trustedHtml) { - return new SafeHtmlImpl(trustedHtml); +function getDeclarationComponentDef(lView) { + !ngDevMode && throwError('Must never be called in production mode'); + const declarationLView = lView[DECLARATION_COMPONENT_VIEW]; + const context = declarationLView[CONTEXT]; + // Unable to obtain a context. + if (!context) return null; + return context.constructor ? getComponentDef(context.constructor) : null; } /** - * Mark `style` string as trusted. + * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`) + * and must **not** be used in production bundles. The function makes megamorphic reads, which might + * be too slow for production mode. * - * This function wraps the trusted string in `String` and brands it in a way which makes it - * recognizable to {@link styleSanitizer} to be trusted implicitly. + * Checks if the current component is declared inside of a standalone component template. * - * @param trustedStyle `style` string which needs to be implicitly trusted. - * @returns a `style` hich has been branded to be implicitly trusted. + * @param lView An `LView` that represents a current component that is being rendered. */ - - -function bypassSanitizationTrustStyle(trustedStyle) { - return new SafeStyleImpl(trustedStyle); +function isHostComponentStandalone(lView) { + !ngDevMode && throwError('Must never be called in production mode'); + const componentDef = getDeclarationComponentDef(lView); + // Treat host component as non-standalone if we can't obtain the def. + return !!componentDef?.standalone; } /** - * Mark `script` string as trusted. + * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`) + * and must **not** be used in production bundles. The function makes megamorphic reads, which might + * be too slow for production mode. * - * This function wraps the trusted string in `String` and brands it in a way which makes it - * recognizable to {@link scriptSanitizer} to be trusted implicitly. + * Constructs a string describing the location of the host component template. The function is used + * in dev mode to produce error messages. * - * @param trustedScript `script` string which needs to be implicitly trusted. - * @returns a `script` which has been branded to be implicitly trusted. + * @param lView An `LView` that represents a current component that is being rendered. */ - - -function bypassSanitizationTrustScript(trustedScript) { - return new SafeScriptImpl(trustedScript); +function getTemplateLocationDetails(lView) { + !ngDevMode && throwError('Must never be called in production mode'); + const hostComponentDef = getDeclarationComponentDef(lView); + const componentClassName = hostComponentDef?.type?.name; + return componentClassName ? ` (used in the '${componentClassName}' component template)` : ''; } /** - * Mark `url` string as trusted. - * - * This function wraps the trusted string in `String` and brands it in a way which makes it - * recognizable to {@link urlSanitizer} to be trusted implicitly. - * - * @param trustedUrl `url` string which needs to be implicitly trusted. - * @returns a `url` which has been branded to be implicitly trusted. + * The set of known control flow directives and their corresponding imports. + * We use this set to produce a more precises error message with a note + * that the `CommonModule` should also be included. */ - - -function bypassSanitizationTrustUrl(trustedUrl) { - return new SafeUrlImpl(trustedUrl); -} +const KNOWN_CONTROL_FLOW_DIRECTIVES = new Map([['ngIf', 'NgIf'], ['ngFor', 'NgFor'], ['ngSwitchCase', 'NgSwitchCase'], ['ngSwitchDefault', 'NgSwitchDefault']]); /** - * Mark `url` string as trusted. - * - * This function wraps the trusted string in `String` and brands it in a way which makes it - * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly. - * - * @param trustedResourceUrl `url` string which needs to be implicitly trusted. - * @returns a `url` which has been branded to be implicitly trusted. + * Returns true if the tag name is allowed by specified schemas. + * @param schemas Array of schemas + * @param tagName Name of the tag */ - - -function bypassSanitizationTrustResourceUrl(trustedResourceUrl) { - return new SafeResourceUrlImpl(trustedResourceUrl); +function matchingSchemas(schemas, tagName) { + if (schemas !== null) { + for (let i = 0; i < schemas.length; i++) { + const schema = schemas[i]; + if (schema === NO_ERRORS_SCHEMA || schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1) { + return true; + } + } + } + return false; } -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ /** - * This helper is used to get hold of an inert tree of DOM elements containing dirty HTML - * that needs sanitizing. - * Depending upon browser support we use one of two strategies for doing this. - * Default: DOMParser strategy - * Fallback: InertDocument strategy + * Flags for renderer-specific style modifiers. + * @publicApi */ +var RendererStyleFlags2; +(function (RendererStyleFlags2) { + // TODO(misko): This needs to be refactored into a separate file so that it can be imported from + // `node_manipulation.ts` Currently doing the import cause resolution order to change and fails + // the tests. The work around is to have hard coded value in `node_manipulation.ts` for now. + /** + * Marks a style as important. + */ + RendererStyleFlags2[RendererStyleFlags2["Important"] = 1] = "Important"; + /** + * Marks a style as using dash case naming (this-is-dash-case). + */ + RendererStyleFlags2[RendererStyleFlags2["DashCase"] = 2] = "DashCase"; +})(RendererStyleFlags2 || (RendererStyleFlags2 = {})); - -function getInertBodyHelper(defaultDoc) { - const inertDocumentHelper = new InertDocumentHelper(defaultDoc); - return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper; -} /** - * Uses DOMParser to create and fill an inert body element. - * This is the default strategy used in browsers that support it. + * Disallowed strings in the comment. + * + * see: https://html.spec.whatwg.org/multipage/syntax.html#comments */ - - -class DOMParserHelper { - constructor(inertDocumentHelper) { - this.inertDocumentHelper = inertDocumentHelper; - } - - getInertBodyElement(html) { - // We add these extra elements to ensure that the rest of the content is parsed as expected - // e.g. leading whitespace is maintained and tags like `` do not get hoisted to the - // `` tag. Note that the `` tag is closed implicitly to prevent unclosed tags - // in `html` from consuming the otherwise explicit `` tag. - html = '' + html; - - try { - const body = new window.DOMParser().parseFromString(trustedHTMLFromString(html), 'text/html').body; - - if (body === null) { - // In some browsers (e.g. Mozilla/5.0 iPad AppleWebKit Mobile) the `body` property only - // becomes available in the following tick of the JS engine. In that case we fall back to - // the `inertDocumentHelper` instead. - return this.inertDocumentHelper.getInertBodyElement(html); - } - - body.removeChild(body.firstChild); - return body; - } catch { - return null; - } - } - -} +const COMMENT_DISALLOWED = /^>|^->||--!>|)/; +const COMMENT_DELIMITER_ESCAPED = '\u200B$1\u200B'; +/** + * Escape the content of comment strings so that it can be safely inserted into a comment node. + * + * The issue is that HTML does not specify any way to escape comment end text inside the comment. + * Consider: `" or + * "--!>" at the end. -->`. Above the `"-->"` is meant to be text not an end to the comment. This + * can be created programmatically through DOM APIs. (`` or `--!>`) the + * text it will render normally but it will not cause the HTML parser to close/open the comment. + * + * @param value text to make safe for comment node by escaping the comment open/close character + * sequence. + */ +function escapeCommentText(value) { + return value.replace(COMMENT_DISALLOWED, text => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED)); +} +// Keeps track of the currently-active LViews. +const TRACKED_LVIEWS = new Map(); +// Used for generating unique IDs for LViews. +let uniqueIdCounter = 0; +/** Gets a unique ID that can be assigned to an LView. */ +function getUniqueLViewId() { + return uniqueIdCounter++; +} +/** Starts tracking an LView. */ +function registerLView(lView) { + ngDevMode && assertNumber(lView[ID], 'LView must have an ID in order to be registered'); + TRACKED_LVIEWS.set(lView[ID], lView); +} +/** Gets an LView by its unique ID. */ +function getLViewById(id) { + ngDevMode && assertNumber(id, 'ID used for LView lookup must be a number'); + return TRACKED_LVIEWS.get(id) || null; +} +/** Stops tracking an LView. */ +function unregisterLView(lView) { + ngDevMode && assertNumber(lView[ID], 'Cannot stop tracking an LView that does not have an ID'); + TRACKED_LVIEWS.delete(lView[ID]); +} -class InertDocumentHelper { - constructor(defaultDoc) { - this.defaultDoc = defaultDoc; - this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert'); - - if (this.inertDocument.body == null) { - // usually there should be only one body element in the document, but IE doesn't have any, so - // we need to create one. - const inertHtml = this.inertDocument.createElement('html'); - this.inertDocument.appendChild(inertHtml); - const inertBodyElement = this.inertDocument.createElement('body'); - inertHtml.appendChild(inertBodyElement); - } - } - - getInertBodyElement(html) { - // Prefer using