├── docs ├── styles-5INURTSO.css ├── prerendered-routes.json ├── favicon.ico ├── index.html ├── 3rdpartylicenses.txt └── polyfills-SCHOHYNV.js ├── projects ├── demo │ ├── src │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.routes.ts │ │ │ ├── app.component.spec.ts │ │ │ ├── app.config.ts │ │ │ ├── app.component.ts │ │ │ └── app.component.html │ │ ├── styles.css │ │ ├── main.ts │ │ └── index.html │ ├── public │ │ └── favicon.ico │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── eslint.config.js └── ng2-events │ ├── ng-package.json │ ├── src │ ├── public-api.ts │ └── lib │ │ ├── event-manager-plugin.ts │ │ ├── multi.event.ts │ │ ├── once.event.ts │ │ ├── outside.event.ts │ │ ├── undetected.event.ts │ │ ├── touch.event.ts │ │ ├── condition-event.directive.ts │ │ ├── observe-event.directive.ts │ │ └── scroll.event.ts │ ├── tsconfig.lib.prod.json │ ├── tsconfig.spec.json │ ├── tsconfig.lib.json │ ├── eslint.config.js │ ├── package.json │ └── README.md ├── .yarnrc.yml ├── .vscode ├── extensions.json ├── launch.json └── tasks.json ├── .editorconfig ├── .gitignore ├── .prettierignore ├── eslint.config.js ├── tsconfig.json ├── LICENSE.md ├── package.json ├── README.md ├── CHANGELOG.md └── angular.json /docs/styles-5INURTSO.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/prerendered-routes.json: -------------------------------------------------------------------------------- 1 | { 2 | "routes": {} 3 | } -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryops/ng2-events/HEAD/docs/favicon.ico -------------------------------------------------------------------------------- /projects/demo/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .thumbnail { 2 | max-width: 300px; 3 | } 4 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | 3 | yarnPath: .yarn/releases/yarn-4.9.1.cjs 4 | -------------------------------------------------------------------------------- /projects/demo/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/demo/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryops/ng2-events/HEAD/projects/demo/public/favicon.ico -------------------------------------------------------------------------------- /projects/demo/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | export const routes: Routes = []; 4 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /projects/ng2-events/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "../../dist/ng2-events", 4 | "lib": { 5 | "entryFile": "src/public-api.ts" 6 | } 7 | } -------------------------------------------------------------------------------- /projects/demo/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig).catch((err) => 6 | console.error(err), 7 | ); 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | ij_typescript_use_double_quotes = false 14 | 15 | [*.md] 16 | max_line_length = off 17 | trim_trailing_whitespace = false 18 | -------------------------------------------------------------------------------- /projects/ng2-events/src/public-api.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of ng2-events 3 | */ 4 | 5 | export * from './lib/condition-event.directive'; 6 | export * from './lib/multi.event'; 7 | export * from './lib/observe-event.directive'; 8 | export * from './lib/once.event'; 9 | export * from './lib/outside.event'; 10 | export * from './lib/scroll.event'; 11 | export * from './lib/touch.event'; 12 | export * from './lib/undetected.event'; 13 | -------------------------------------------------------------------------------- /projects/ng2-events/tsconfig.lib.prod.json: -------------------------------------------------------------------------------- 1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ 2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ 3 | { 4 | "extends": "./tsconfig.lib.json", 5 | "compilerOptions": { 6 | "declarationMap": false 7 | }, 8 | "angularCompilerOptions": { 9 | "compilationMode": "partial" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /projects/demo/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ 2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ 3 | { 4 | "extends": "../../tsconfig.json", 5 | "compilerOptions": { 6 | "outDir": "../../out-tsc/app", 7 | "types": [] 8 | }, 9 | "files": [ 10 | "src/main.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /projects/ng2-events/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ 2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ 3 | { 4 | "extends": "../../tsconfig.json", 5 | "compilerOptions": { 6 | "outDir": "../../out-tsc/spec", 7 | "types": [ 8 | "jasmine" 9 | ] 10 | }, 11 | "include": [ 12 | "**/*.spec.ts", 13 | "**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /projects/demo/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ 2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ 3 | { 4 | "extends": "../../tsconfig.json", 5 | "compilerOptions": { 6 | "outDir": "../../out-tsc/spec", 7 | "types": [ 8 | "jasmine" 9 | ] 10 | }, 11 | "include": [ 12 | "src/**/*.spec.ts", 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /projects/demo/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(async () => { 6 | await TestBed.configureTestingModule({ 7 | imports: [AppComponent], 8 | }).compileComponents(); 9 | }); 10 | 11 | it('should create the app', () => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.componentInstance; 14 | expect(app).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /projects/ng2-events/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ 2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ 3 | { 4 | "extends": "../../tsconfig.json", 5 | "compilerOptions": { 6 | "outDir": "../../out-tsc/lib", 7 | "declaration": true, 8 | "declarationMap": true, 9 | "inlineSources": true, 10 | "types": [] 11 | }, 12 | "exclude": [ 13 | "**/*.spec.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /projects/demo/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /projects/ng2-events/eslint.config.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | const tseslint = require("typescript-eslint"); 3 | const rootConfig = require("../../eslint.config.js"); 4 | 5 | module.exports = tseslint.config( 6 | ...rootConfig, 7 | { 8 | files: ["**/*.ts"], 9 | rules: { 10 | "@angular-eslint/directive-selector": "off", 11 | "@angular-eslint/no-input-rename": "off", 12 | "@angular-eslint/no-output-rename": "off", 13 | "@angular-eslint/component-selector": [ 14 | "error", 15 | { 16 | type: "element", 17 | prefix: "lib", 18 | style: "kebab-case", 19 | }, 20 | ], 21 | }, 22 | }, 23 | { 24 | files: ["**/*.html"], 25 | rules: {}, 26 | }, 27 | ); 28 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /projects/demo/eslint.config.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | const tseslint = require("typescript-eslint"); 3 | const rootConfig = require("../../eslint.config.js"); 4 | 5 | module.exports = tseslint.config( 6 | ...rootConfig, 7 | { 8 | files: ["**/*.ts"], 9 | rules: { 10 | "@angular-eslint/directive-selector": [ 11 | "error", 12 | { 13 | type: "attribute", 14 | prefix: "app", 15 | style: "camelCase", 16 | }, 17 | ], 18 | "@angular-eslint/component-selector": [ 19 | "error", 20 | { 21 | type: "element", 22 | prefix: "app", 23 | style: "kebab-case", 24 | }, 25 | ], 26 | }, 27 | }, 28 | { 29 | files: ["**/*.html"], 30 | rules: {}, 31 | }, 32 | ); 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | 44 | ### 45 | 46 | *~ 47 | *.tgz 48 | .yarn/install-state.gz 49 | .yarn/cache 50 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | *.json 2 | docs 3 | 4 | # Copy of .gitignore 5 | 6 | # See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files. 7 | 8 | # Compiled output 9 | /dist 10 | /tmp 11 | /out-tsc 12 | /bazel-out 13 | 14 | # Node 15 | /node_modules 16 | npm-debug.log 17 | yarn-error.log 18 | 19 | # IDEs and editors 20 | .idea/ 21 | .project 22 | .classpath 23 | .c9/ 24 | *.launch 25 | .settings/ 26 | *.sublime-workspace 27 | 28 | # Visual Studio Code 29 | .vscode/* 30 | !.vscode/settings.json 31 | !.vscode/tasks.json 32 | !.vscode/launch.json 33 | !.vscode/extensions.json 34 | .history/* 35 | 36 | # Miscellaneous 37 | /.angular/cache 38 | .sass-cache/ 39 | /connect.lock 40 | /coverage 41 | /libpeerconnection.log 42 | testem.log 43 | /typings 44 | 45 | # System files 46 | .DS_Store 47 | Thumbs.db 48 | 49 | ### 50 | 51 | *~ 52 | *.tgz 53 | 54 | -------------------------------------------------------------------------------- /eslint.config.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | const eslint = require("@eslint/js"); 3 | const tseslint = require("typescript-eslint"); 4 | const angular = require("angular-eslint"); 5 | const prettier = require("eslint-config-prettier/flat"); 6 | 7 | module.exports = tseslint.config( 8 | { 9 | files: ["**/*.ts"], 10 | extends: [ 11 | eslint.configs.recommended, 12 | ...tseslint.configs.recommended, 13 | ...tseslint.configs.stylistic, 14 | ...angular.configs.tsRecommended, 15 | ], 16 | processor: angular.processInlineTemplates, 17 | rules: { 18 | "@angular-eslint/directive-selector": "off", 19 | "@angular-eslint/component-selector": "off", 20 | }, 21 | }, 22 | { 23 | files: ["**/*.html"], 24 | extends: [ 25 | ...angular.configs.templateRecommended, 26 | ...angular.configs.templateAccessibility, 27 | ], 28 | rules: {}, 29 | }, 30 | prettier, 31 | ); 32 | -------------------------------------------------------------------------------- /projects/ng2-events/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ng2-events", 3 | "version": "6.0.0", 4 | "description": "Supercharge your Angular event handling", 5 | "keywords": [ 6 | "angular", 7 | "events", 8 | "event-handler", 9 | "event-listener", 10 | "changedetection", 11 | "conditional", 12 | "observe", 13 | "once", 14 | "outside", 15 | "scroll", 16 | "touch" 17 | ], 18 | "repository": { 19 | "type": "git", 20 | "url": "git+ssh://git@github.com/kryops/ng2-events.git" 21 | }, 22 | "author": "Michael Manzinger ", 23 | "license": "MIT", 24 | "bugs": { 25 | "url": "https://github.com/kryops/ng2-events/issues" 26 | }, 27 | "homepage": "https://github.com/kryops/ng2-events#readme", 28 | "peerDependencies": { 29 | "@angular/common": ">=18.0.0", 30 | "@angular/core": ">=18.0.0" 31 | }, 32 | "dependencies": { 33 | "tslib": "^2.3.0" 34 | }, 35 | "sideEffects": false 36 | } 37 | -------------------------------------------------------------------------------- /projects/ng2-events/src/lib/event-manager-plugin.ts: -------------------------------------------------------------------------------- 1 | import { EventManager } from '@angular/platform-browser'; 2 | 3 | export abstract class MyEventManagerPlugin { 4 | constructor(protected _doc: Document) {} 5 | 6 | declare manager: EventManager; 7 | 8 | abstract supports(eventName: string): boolean; 9 | 10 | abstract addEventListener( 11 | element: EventTarget, 12 | eventName: string, 13 | handler: () => void, 14 | ): () => void; 15 | 16 | addGlobalEventListener( 17 | element: string, 18 | eventName: string, 19 | handler: () => void, 20 | ): () => void { 21 | let target: EventTarget | undefined = undefined; 22 | if (element === 'document') target = this._doc; 23 | else if (element === 'window' && typeof window !== 'undefined') 24 | target = window; 25 | 26 | if (!target) { 27 | throw new Error( 28 | `Unsupported event target ${target} for event ${eventName}`, 29 | ); 30 | } 31 | return this.addEventListener(target, eventName, handler); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /projects/ng2-events/src/lib/multi.event.ts: -------------------------------------------------------------------------------- 1 | import { Inject, Injectable, DOCUMENT } from '@angular/core'; 2 | 3 | import { MyEventManagerPlugin } from './event-manager-plugin'; 4 | 5 | /** 6 | * Register multiple event listeners 7 | * 8 | * Usage: 9 | * ``` 10 | * 11 | * ``` 12 | */ 13 | @Injectable() 14 | export class MultiEventPlugin extends MyEventManagerPlugin { 15 | constructor(@Inject(DOCUMENT) doc: Document) { 16 | super(doc); 17 | } 18 | 19 | supports(eventName: string): boolean { 20 | return eventName.indexOf('multi.') === 0; 21 | } 22 | 23 | addEventListener( 24 | element: HTMLElement, 25 | eventName: string, 26 | handler: () => void, 27 | ): () => void { 28 | const eventNames = eventName.slice(6).split(','); 29 | 30 | const eventListeners = eventNames.map((x) => 31 | this.manager.addEventListener(element, x, handler), 32 | ); 33 | 34 | return () => { 35 | eventListeners.forEach((x) => x()); 36 | }; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 3 | "version": "2.0.0", 4 | "tasks": [ 5 | { 6 | "type": "npm", 7 | "script": "start", 8 | "isBackground": true, 9 | "problemMatcher": { 10 | "owner": "typescript", 11 | "pattern": "$tsc", 12 | "background": { 13 | "activeOnStart": true, 14 | "beginsPattern": { 15 | "regexp": "(.*?)" 16 | }, 17 | "endsPattern": { 18 | "regexp": "bundle generation complete" 19 | } 20 | } 21 | } 22 | }, 23 | { 24 | "type": "npm", 25 | "script": "test", 26 | "isBackground": true, 27 | "problemMatcher": { 28 | "owner": "typescript", 29 | "pattern": "$tsc", 30 | "background": { 31 | "activeOnStart": true, 32 | "beginsPattern": { 33 | "regexp": "(.*?)" 34 | }, 35 | "endsPattern": { 36 | "regexp": "bundle generation complete" 37 | } 38 | } 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ 2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ 3 | { 4 | "compileOnSave": false, 5 | "compilerOptions": { 6 | "outDir": "./dist/out-tsc", 7 | "strict": true, 8 | "noImplicitOverride": true, 9 | "noPropertyAccessFromIndexSignature": true, 10 | "noImplicitReturns": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "paths": { 13 | "ng2-events": [ 14 | "./dist/ng2-events" 15 | ] 16 | }, 17 | "skipLibCheck": true, 18 | "isolatedModules": true, 19 | "esModuleInterop": true, 20 | "experimentalDecorators": true, 21 | "moduleResolution": "bundler", 22 | "importHelpers": true, 23 | "target": "ES2022", 24 | "module": "ES2022" 25 | }, 26 | "angularCompilerOptions": { 27 | "enableI18nLegacyMessageIdFormat": false, 28 | "strictInjectionParameters": true, 29 | "strictInputAccessModifiers": true, 30 | "strictTemplates": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-2025 Michael Manzinger 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /projects/ng2-events/src/lib/once.event.ts: -------------------------------------------------------------------------------- 1 | import { Inject, Injectable, DOCUMENT } from '@angular/core'; 2 | 3 | import { MyEventManagerPlugin } from './event-manager-plugin'; 4 | 5 | /** 6 | * Automatically unregister an event listener after the event fired once 7 | * 8 | * Usage: 9 | * ``` 10 | * 11 | * ``` 12 | */ 13 | @Injectable() 14 | export class OnceEventPlugin extends MyEventManagerPlugin { 15 | constructor(@Inject(DOCUMENT) doc: Document) { 16 | super(doc); 17 | } 18 | 19 | supports(eventName: string): boolean { 20 | return eventName.indexOf('once.') === 0; 21 | } 22 | 23 | addEventListener( 24 | element: HTMLElement, 25 | eventName: string, 26 | handler: ($event?: unknown) => void, 27 | ): () => void { 28 | const realEventName = eventName.slice(5); 29 | let active = true; 30 | 31 | const eventListener = this.manager.addEventListener( 32 | element, 33 | realEventName, 34 | ($event: unknown) => { 35 | eventListener(); 36 | active = false; 37 | handler($event); 38 | }, 39 | ); 40 | 41 | return () => { 42 | if (active) eventListener(); 43 | }; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /projects/ng2-events/src/lib/outside.event.ts: -------------------------------------------------------------------------------- 1 | import { Inject, Injectable, DOCUMENT } from '@angular/core'; 2 | import { MyEventManagerPlugin } from './event-manager-plugin'; 3 | 4 | /** 5 | * Listen to events that are fired outside of the current element and its children 6 | * 7 | * Usage: 8 | * ``` 9 | *
10 | * ``` 11 | */ 12 | @Injectable() 13 | export class OutsideEventPlugin extends MyEventManagerPlugin { 14 | constructor(@Inject(DOCUMENT) doc: Document) { 15 | super(doc); 16 | } 17 | 18 | supports(eventName: string): boolean { 19 | return eventName.indexOf('outside.') === 0; 20 | } 21 | 22 | addEventListener( 23 | element: HTMLElement, 24 | eventName: string, 25 | handler: ($event?: unknown) => void, 26 | ): () => void { 27 | const realEventName = eventName.slice(8); 28 | 29 | const removeEventListener = this.manager.addEventListener( 30 | (element.ownerDocument || document) as unknown as HTMLElement, 31 | realEventName, 32 | (e: Event) => { 33 | if ( 34 | element !== e.target && 35 | !element.contains(e.target as Node | null) 36 | ) { 37 | handler(e); 38 | } 39 | }, 40 | ); 41 | return () => removeEventListener(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /projects/ng2-events/src/lib/undetected.event.ts: -------------------------------------------------------------------------------- 1 | import { Inject, Injectable, DOCUMENT } from '@angular/core'; 2 | 3 | import { MyEventManagerPlugin } from './event-manager-plugin'; 4 | 5 | /** 6 | * Listen to events without triggering change detection 7 | * 8 | * Usage: 9 | * ``` 10 | * 11 | * 12 | * // ... 13 | * 14 | * export class ExampleComponent implements OnInit { 15 | * 16 | * constructor(private zone: NgZone) {} 17 | * 18 | * handleClick() { 19 | * if(someCondition) { 20 | * this.zone.run(() => { 21 | * ... 22 | * }); 23 | * } 24 | * } 25 | * } 26 | * ``` 27 | */ 28 | @Injectable() 29 | export class UndetectedEventPlugin extends MyEventManagerPlugin { 30 | constructor(@Inject(DOCUMENT) doc: Document) { 31 | super(doc); 32 | } 33 | 34 | supports(eventName: string): boolean { 35 | return eventName.indexOf('undetected.') === 0; 36 | } 37 | 38 | addEventListener( 39 | element: HTMLElement, 40 | eventName: string, 41 | handler: () => void, 42 | ): () => void { 43 | const realEventName = eventName.slice(11); 44 | 45 | const removeEventListener = this.manager 46 | .getZone() 47 | .runOutsideAngular(() => 48 | this.manager.addEventListener(element, realEventName, handler), 49 | ); 50 | 51 | return () => removeEventListener(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /projects/demo/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | 4 | import { routes } from './app.routes'; 5 | import { EVENT_MANAGER_PLUGINS } from '@angular/platform-browser'; 6 | import { 7 | MultiEventPlugin, 8 | OnceEventPlugin, 9 | OutsideEventPlugin, 10 | SCROLL_EVENT_TIME, 11 | ScrollEventPlugin, 12 | TouchEventPlugin, 13 | UndetectedEventPlugin, 14 | } from 'ng2-events'; 15 | 16 | export const appConfig: ApplicationConfig = { 17 | providers: [ 18 | provideZoneChangeDetection({ eventCoalescing: true }), 19 | provideRouter(routes), 20 | { 21 | provide: EVENT_MANAGER_PLUGINS, 22 | useClass: MultiEventPlugin, 23 | multi: true, 24 | }, 25 | { 26 | provide: EVENT_MANAGER_PLUGINS, 27 | useClass: OnceEventPlugin, 28 | multi: true, 29 | }, 30 | { 31 | provide: EVENT_MANAGER_PLUGINS, 32 | useClass: OutsideEventPlugin, 33 | multi: true, 34 | }, 35 | { provide: SCROLL_EVENT_TIME, useValue: 500 }, 36 | { 37 | provide: EVENT_MANAGER_PLUGINS, 38 | useClass: ScrollEventPlugin, 39 | multi: true, 40 | }, 41 | { 42 | provide: EVENT_MANAGER_PLUGINS, 43 | useClass: TouchEventPlugin, 44 | multi: true, 45 | }, 46 | { 47 | provide: EVENT_MANAGER_PLUGINS, 48 | useClass: UndetectedEventPlugin, 49 | multi: true, 50 | }, 51 | ], 52 | }; 53 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ng2-events-workspace", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build ng2-events && ng build demo", 8 | "postinstall": "yarn build", 9 | "lint": "ng lint && prettier --check .", 10 | "format": "prettier --write ." 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "^20.0.3", 15 | "@angular/common": "^20.0.3", 16 | "@angular/compiler": "^20.0.3", 17 | "@angular/core": "^20.0.3", 18 | "@angular/forms": "^20.0.3", 19 | "@angular/platform-browser": "^20.0.3", 20 | "@angular/platform-browser-dynamic": "^20.0.3", 21 | "@angular/router": "^20.0.3", 22 | "rxjs": "~7.8.0", 23 | "tslib": "^2.3.0", 24 | "zone.js": "~0.15.0" 25 | }, 26 | "devDependencies": { 27 | "@angular/build": "^20.0.2", 28 | "@angular/cli": "^20.0.2", 29 | "@angular/compiler-cli": "^20.0.3", 30 | "@types/jasmine": "~5.1.0", 31 | "angular-eslint": "19.3.0", 32 | "eslint": "^9.23.0", 33 | "eslint-config-prettier": "^10.1.2", 34 | "jasmine-core": "~5.5.0", 35 | "karma": "~6.4.0", 36 | "karma-chrome-launcher": "~3.2.0", 37 | "karma-coverage": "~2.2.0", 38 | "karma-jasmine": "~5.1.0", 39 | "karma-jasmine-html-reporter": "~2.1.0", 40 | "ng-packagr": "^20.0.0", 41 | "prettier": "^3.5.3", 42 | "typescript": "~5.8.3", 43 | "typescript-eslint": "8.27.0" 44 | }, 45 | "packageManager": "yarn@4.9.1" 46 | } 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ng2-events monorepo 2 | 3 | > **The README for the ng2-events package can be found [here](./projects/ng2-events/README.md).** 4 | 5 | This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.1.2. 6 | 7 | ## Development server 8 | 9 | To start a local development server, run: 10 | 11 | ```bash 12 | ng serve 13 | ``` 14 | 15 | Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files. 16 | 17 | ## Code scaffolding 18 | 19 | Angular CLI includes powerful code scaffolding tools. To generate a new component, run: 20 | 21 | ```bash 22 | ng generate component component-name 23 | ``` 24 | 25 | For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run: 26 | 27 | ```bash 28 | ng generate --help 29 | ``` 30 | 31 | ## Building 32 | 33 | To build the project run: 34 | 35 | ```bash 36 | ng build 37 | ``` 38 | 39 | This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed. 40 | 41 | ## Running unit tests 42 | 43 | To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command: 44 | 45 | ```bash 46 | ng test 47 | ``` 48 | 49 | ## Running end-to-end tests 50 | 51 | For end-to-end (e2e) testing, run: 52 | 53 | ```bash 54 | ng e2e 55 | ``` 56 | 57 | Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs. 58 | 59 | ## Additional Resources 60 | 61 | For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page. 62 | -------------------------------------------------------------------------------- /projects/ng2-events/src/lib/touch.event.ts: -------------------------------------------------------------------------------- 1 | import { Inject, Injectable, DOCUMENT } from '@angular/core'; 2 | 3 | import { MyEventManagerPlugin } from './event-manager-plugin'; 4 | 5 | function getNativeEventNames(eventName: string): string[] { 6 | const supportsPointerEvents = 7 | typeof window !== 'undefined' && 'PointerEvent' in window; 8 | 9 | switch (eventName) { 10 | case 'up': 11 | return supportsPointerEvents ? ['pointerup'] : ['mouseup', 'touchend']; 12 | 13 | case 'down': 14 | return supportsPointerEvents 15 | ? ['pointerdown'] 16 | : ['mousedown', 'touchstart']; 17 | 18 | case 'move': 19 | return supportsPointerEvents 20 | ? ['pointermove'] 21 | : ['mousemove', 'touchmove']; 22 | 23 | default: 24 | return []; 25 | } 26 | } 27 | 28 | /** 29 | * Quick-firing 'up' and 'down' events that work cross-browser for mouse and touch events 30 | * 31 | * Usage: 32 | * ``` 33 | * 34 | * ``` 35 | */ 36 | @Injectable() 37 | export class TouchEventPlugin extends MyEventManagerPlugin { 38 | constructor(@Inject(DOCUMENT) doc: Document) { 39 | super(doc); 40 | } 41 | 42 | supports(eventName: string): boolean { 43 | return eventName === 'down' || eventName === 'up' || eventName === 'move'; 44 | } 45 | 46 | addEventListener( 47 | element: HTMLElement, 48 | eventName: string, 49 | handler: ($event: unknown) => void, 50 | ): () => void { 51 | const eventListeners = getNativeEventNames(eventName).map((x) => 52 | this.manager.addEventListener(element, x, (e: Event) => { 53 | // prevent default so only one of the event listeners is fired 54 | e.preventDefault(); 55 | handler(e); 56 | }), 57 | ); 58 | 59 | return () => { 60 | eventListeners.forEach((x) => x()); 61 | }; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## Unreleased 4 | 5 | - **[BREAKING]** Requires Angular 20 6 | 7 | ## v6.0.0 (2025-04-21) 8 | 9 | - **[BREAKING]** Converted project to Angular CLI workspace 10 | - **[BREAKING]** Removed Angular modules 11 | - **[BREAKING]** Removed `observe` event 12 | 13 | ## v5.0.0 (2021-05-28) 14 | 15 | - **[BREAKING]** Changed compilation to partial-Ivy 16 | - Updated to Angular 12 17 | - Removed deprecated `EventManager.addGlobalEventListener` calls 18 | 19 | For applications using Angular Ivy, but without the Angular CLI, follow the [docs on consuming partial Ivy code](https://angular.dev/tools/libraries/creating-libraries#consuming-partial-ivy-code-outside-the-angular-cli). 20 | 21 | ## v4.2.2 (2020-03-06) 22 | 23 | - Made compatible with Angular 9 24 | 25 | ## v4.2.1 (2019-10-15) 26 | 27 | - Prevent `up`/`down` events from firing twice on iOS 13 and Chrome Android (#5) 28 | 29 | ## v4.2.0 (2018-05-05) 30 | 31 | - RxJS 6 compatibility 32 | 33 | ## v4.1.0 (2018-01-02) 34 | 35 | - Added `move` touch event (@saitho in #2) 36 | 37 | ## v4.0.0 (2017-11-04) 38 | 39 | - Angular 5 compatibility 40 | 41 | ## v3.1.0 (2017-04-29) [Angular 4] 42 | 43 | This release adds flat ESM bundles in ES5 and ES2015 to the library 44 | 45 | **package.json main fields:** 46 | 47 | - `main`: CommonJS library index (ES5) 48 | - `jsnext:main`: Flat ESM bundle (ES5) 49 | - `module`: Flat ESM bundle (ES5) 50 | - `es2015`: Flat ESM bundle (ES2015) 51 | 52 | ## v3.0.0 (2017-03-26) 53 | 54 | - Angular 4 compatibility 55 | 56 | ## v2.0.0 (2017-01-05) [Angular 2] 57 | 58 | - Added `once` event util 59 | - Added `scroll-in` / `scroll-out` events 60 | - Added condition directive to conditionally attach event handlers 61 | - Restructuring to eliminate dead code when only some sub-modules are used 62 | - Minor fixes 63 | 64 | ### BREAKING 65 | 66 | The import path for sub-modules has changed. 67 | 68 | Before: 69 | 70 | ```ts 71 | import { OutsideEventModule } from "ng2-events"; 72 | ``` 73 | 74 | Now: 75 | 76 | ```ts 77 | import { OutsideEventModule } from "ng2-events/lib/outside"; 78 | ``` 79 | -------------------------------------------------------------------------------- /projects/ng2-events/src/lib/condition-event.directive.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Directive, 3 | Renderer2, 4 | ElementRef, 5 | Input, 6 | EventEmitter, 7 | Output, 8 | OnChanges, 9 | OnDestroy, 10 | } from '@angular/core'; 11 | 12 | /** 13 | * Conditionally apply event listeners to an element 14 | * 15 | * Usage: 16 | * ``` 17 | * 20 | *``` 21 | * 22 | * Notes: 23 | * The `[ev-events]` property can be either a string or an array of strings to handle multiple events 24 | */ 25 | @Directive({ 26 | selector: '[ev-condition]', 27 | standalone: true, 28 | }) 29 | export class ConditionEventDirective implements OnChanges, OnDestroy { 30 | @Input({ alias: 'ev-condition', required: true }) condition!: boolean; 31 | @Input({ alias: 'ev-events', required: true }) events!: string | string[]; 32 | 33 | @Output('ev-fire') fire = new EventEmitter(); 34 | 35 | private listeners: (() => void)[] = []; 36 | 37 | constructor( 38 | private elm: ElementRef, 39 | private renderer: Renderer2, 40 | ) {} 41 | 42 | ngOnChanges(): void { 43 | this.unregisterAll(); 44 | 45 | if (!this.condition || !this.events) return; 46 | 47 | const events = 48 | typeof this.events === 'string' ? [this.events] : this.events; 49 | 50 | this.listeners = events.map((x) => this.addListener(x)); 51 | } 52 | 53 | ngOnDestroy(): void { 54 | this.unregisterAll(); 55 | } 56 | 57 | private unregisterAll() { 58 | this.listeners.forEach((x) => x()); 59 | this.listeners = []; 60 | } 61 | 62 | private addListener(eventName: string): () => void { 63 | const colon = eventName.indexOf(':'); 64 | const handler = ($event: unknown) => this.fire.next($event); 65 | 66 | if (colon === -1) { 67 | return this.renderer.listen(this.elm.nativeElement, eventName, handler); 68 | } else { 69 | const scope = eventName.slice(0, colon); 70 | const realEventName = eventName.slice(colon + 1); 71 | return this.renderer.listen(scope, realEventName, handler); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /projects/ng2-events/src/lib/observe-event.directive.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Directive, 3 | Renderer2, 4 | ElementRef, 5 | Input, 6 | NgZone, 7 | OnDestroy, 8 | } from '@angular/core'; 9 | import { Subject } from 'rxjs'; 10 | 11 | /** 12 | * Pass events to a given observable subject without triggering change detection 13 | * 14 | * Usage: 15 | * ``` 16 | * 17 | * 18 | * // ... 19 | * 20 | * export class ExampleComponent implements OnInit { 21 | * public subject = new Subject(); 22 | * 23 | * constructor(private zone: NgZone) {} 24 | * 25 | * ngOnInit() { 26 | * this.subject 27 | * .throttleTime(300) 28 | * .filter(someCondition) 29 | * ... 30 | * .subscribe($event => this.zone.run(() => this.handleEvent($event))); 31 | * } 32 | * } 33 | * ``` 34 | * 35 | * Notes: 36 | * The `[ev-events]` property can be either a string or an array of strings to handle multiple events 37 | * 38 | */ 39 | @Directive({ 40 | selector: '[ev-observe]', 41 | standalone: true, 42 | }) 43 | export class ObserveEventDirective implements OnDestroy { 44 | @Input({ alias: 'ev-observe', required: true }) observe!: Subject; 45 | @Input({ alias: 'ev-events', required: true }) set events( 46 | e: string | string[], 47 | ) { 48 | this.unregisterAll(); 49 | 50 | const events = typeof e === 'string' ? [e] : e; 51 | 52 | this.zone.runOutsideAngular(() => { 53 | this.listeners = events.map((x) => this.addListener(x)); 54 | }); 55 | } 56 | 57 | private listeners: (() => void)[] = []; 58 | 59 | constructor( 60 | private elm: ElementRef, 61 | private renderer: Renderer2, 62 | private zone: NgZone, 63 | ) {} 64 | 65 | ngOnDestroy(): void { 66 | this.unregisterAll(); 67 | } 68 | 69 | private unregisterAll() { 70 | this.listeners.forEach((x) => x()); 71 | this.listeners = []; 72 | } 73 | 74 | private addListener(eventName: string): () => void { 75 | const colon = eventName.indexOf(':'); 76 | const handler = ($event: Event) => this.fireEvent($event); 77 | 78 | if (colon === -1) { 79 | return this.renderer.listen(this.elm.nativeElement, eventName, handler); 80 | } else { 81 | const scope = eventName.slice(0, colon); 82 | const realEventName = eventName.slice(colon + 1); 83 | return this.renderer.listen(scope, realEventName, handler); 84 | } 85 | } 86 | 87 | private fireEvent($event: Event) { 88 | if (!this.observe) return; 89 | this.observe.next($event); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /projects/demo/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { CommonModule } from '@angular/common'; 2 | import { Component, DoCheck, NgZone, OnInit } from '@angular/core'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { ConditionEventDirective, ObserveEventDirective } from 'ng2-events'; 5 | import { Subject, throttleTime } from 'rxjs'; 6 | 7 | @Component({ 8 | selector: 'app-root', 9 | imports: [ 10 | CommonModule, 11 | FormsModule, 12 | ConditionEventDirective, 13 | ObserveEventDirective, 14 | ], 15 | templateUrl: './app.component.html', 16 | styleUrl: './app.component.css', 17 | }) 18 | export class AppComponent implements OnInit, DoCheck { 19 | constructor(private zone: NgZone) {} 20 | 21 | changeDetection = 0; 22 | events: string[] = []; 23 | active = 'outside'; 24 | 25 | ngOnInit() { 26 | this.observeSubject.pipe(throttleTime(1000)).subscribe(($event: Event) => { 27 | this.zone.run(() => this.addEvent($event.type, '(observe directive)')); 28 | }); 29 | } 30 | 31 | ngDoCheck() { 32 | this.changeDetection++; 33 | } 34 | 35 | addEvent(type: string, message?: string) { 36 | const eventString = 37 | new Date().toLocaleTimeString() + ' ' + type + ' ' + (message || ''); 38 | 39 | console.log(eventString); 40 | 41 | this.events.unshift(eventString); 42 | 43 | if (this.events.length > 20) { 44 | this.events = this.events.slice(0, 20); 45 | } 46 | } 47 | 48 | // scroll-in/scroll-out 49 | 50 | scrollImagesVisible: number[] = []; 51 | 52 | setScrollVisibility(index: number, visibility: boolean) { 53 | this.addEvent( 54 | visibility ? 'scroll-in' : 'scroll-out', 55 | 'for element ' + index, 56 | ); 57 | 58 | const i = this.scrollImagesVisible.indexOf(index); 59 | 60 | if (i === -1 && visibility) { 61 | this.scrollImagesVisible.push(index); 62 | } else if (i !== -1 && !visibility) { 63 | this.scrollImagesVisible.splice(i, 1); 64 | } 65 | } 66 | 67 | isScrollImageVisible(index: number) { 68 | return this.scrollImagesVisible.indexOf(index) !== -1; 69 | } 70 | 71 | // condition 72 | 73 | condition = true; 74 | 75 | toggleCondition() { 76 | this.condition = !this.condition; 77 | } 78 | 79 | // undetected 80 | 81 | undetectedCount = 0; 82 | 83 | undetectedClick() { 84 | this.addEvent('undetected.click'); 85 | this.undetectedCount++; 86 | 87 | if (this.undetectedCount % 3 === 0) 88 | this.zone.run(() => { 89 | // do nothing 90 | }); 91 | } 92 | 93 | // observe directive 94 | 95 | observeSubject = new Subject(); 96 | } 97 | -------------------------------------------------------------------------------- /projects/ng2-events/src/lib/scroll.event.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, Inject, InjectionToken, DOCUMENT } from '@angular/core'; 2 | 3 | import { MyEventManagerPlugin } from './event-manager-plugin'; 4 | import { Subject } from 'rxjs'; 5 | import { auditTime } from 'rxjs/operators'; 6 | 7 | export const SCROLL_EVENT_TIME = new InjectionToken('ScrollEventTime'); 8 | 9 | /** 10 | * Detects when an element is scrolled into or out of the viewport 11 | * 12 | * Usage: 13 | * ``` 14 | *
...
15 | * ``` 16 | * 17 | * The matching handler of the initial status is called upon attaching 18 | * to notify the element of its current status. `$event` is true for the 19 | * initial call, false otherwise 20 | * 21 | */ 22 | @Injectable() 23 | export class ScrollEventPlugin extends MyEventManagerPlugin { 24 | private listeners: (() => void)[] = []; 25 | private globalListener: (() => void) | undefined = undefined; 26 | 27 | private subject = new Subject(); 28 | 29 | constructor( 30 | @Inject(DOCUMENT) doc: Document, 31 | @Inject(SCROLL_EVENT_TIME) time: number, 32 | ) { 33 | super(doc); 34 | 35 | this.subject.pipe(auditTime(time)).subscribe(() => { 36 | this.listeners.forEach((x) => x()); 37 | }); 38 | } 39 | 40 | supports(eventName: string): boolean { 41 | return eventName === 'scroll-in' || eventName === 'scroll-out'; 42 | } 43 | 44 | addEventListener( 45 | element: HTMLElement, 46 | eventName: string, 47 | handler: ($event?: unknown) => void, 48 | ): () => void { 49 | const isScrollIn = eventName === 'scroll-in'; 50 | let status: boolean | undefined = undefined; 51 | 52 | setTimeout(() => { 53 | status = this.getStatus(element); 54 | 55 | if ((isScrollIn && status) || (!isScrollIn && !status)) { 56 | handler(true); 57 | } 58 | }, 0); 59 | 60 | const listener = () => { 61 | const newStatus = this.getStatus(element); 62 | 63 | if (status === newStatus) return; 64 | 65 | if ((isScrollIn && newStatus) || (!isScrollIn && !newStatus)) { 66 | this.manager.getZone().run(() => handler(false)); 67 | } 68 | 69 | status = newStatus; 70 | }; 71 | 72 | this.listeners.push(listener); 73 | this.updateGlobalListener(); 74 | 75 | return () => { 76 | const index = this.listeners.indexOf(listener); 77 | if (index === -1) return; 78 | 79 | this.listeners.splice(index, 1); 80 | this.updateGlobalListener(); 81 | }; 82 | } 83 | 84 | private updateGlobalListener() { 85 | if (this.listeners.length && this.globalListener === undefined) { 86 | this.manager.getZone().runOutsideAngular(() => { 87 | const handler = () => { 88 | this.subject.next(); 89 | }; 90 | 91 | const listeners = ['scroll', 'resize', 'orientationchange'].map((x) => 92 | this.manager.addEventListener( 93 | (this._doc.defaultView || window) as unknown as HTMLElement, 94 | x, 95 | handler, 96 | ), 97 | ); 98 | 99 | this.globalListener = () => { 100 | listeners.forEach((x) => x()); 101 | }; 102 | }); 103 | } else if (!this.listeners.length && this.globalListener !== undefined) { 104 | this.globalListener(); 105 | this.globalListener = undefined; 106 | } 107 | } 108 | 109 | private getStatus(element: HTMLElement): boolean { 110 | const rect = element.getBoundingClientRect(); 111 | return rect.bottom >= 0 && rect.top <= window.innerHeight; 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /projects/demo/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 |

ng2-events

3 | 4 |
5 |
6 | 16 |
17 |
18 |
19 | 25 |
26 | 27 |
28 | 36 |
37 | 38 |
39 |
45 | Example image 51 | 52 |
56 | 57 |
58 |

Lorem ipsum

59 |

60 | dolor sit amet, consetetur sadipscing elitr, sed diam nonumy 61 | eirmod tempor invidunt ut labore et dolore magna aliquyam erat, 62 | sed diam voluptua. At vero eos et accusam et justo duo dolores et 63 | ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est 64 | Lorem ipsum dolor sit amet. 65 |

66 |
67 |
68 |
69 | 70 |
71 | 77 |
78 | 79 |
80 | 83 |
84 | 85 |
86 |

87 | 95 | 96 | 104 | 105 | 108 |

109 | 110 |

Condition: {{ condition }}

111 |
112 | 113 |
114 |

115 | 121 | 122 | 125 |

126 | 127 |

128 | The function this button calls runs change detection every 3 clicks. 129 | However, all events are logged to the console. 130 |

131 |
132 | 133 |
134 | 141 |
142 |
143 |
144 | 145 |
146 |
Change detection runs: {{ changeDetection }}
147 |
148 | 149 |
150 |
151 |

{{ event }}

152 |
153 |
154 |
155 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "ng2-events": { 7 | "projectType": "library", 8 | "root": "projects/ng2-events", 9 | "sourceRoot": "projects/ng2-events/src", 10 | "prefix": "lib", 11 | "architect": { 12 | "build": { 13 | "builder": "@angular/build:ng-packagr", 14 | "options": { 15 | "project": "projects/ng2-events/ng-package.json" 16 | }, 17 | "configurations": { 18 | "production": { 19 | "tsConfig": "projects/ng2-events/tsconfig.lib.prod.json" 20 | }, 21 | "development": { 22 | "tsConfig": "projects/ng2-events/tsconfig.lib.json" 23 | } 24 | }, 25 | "defaultConfiguration": "production" 26 | }, 27 | "test": { 28 | "builder": "@angular/build:karma", 29 | "options": { 30 | "tsConfig": "projects/ng2-events/tsconfig.spec.json", 31 | "polyfills": [ 32 | "zone.js", 33 | "zone.js/testing" 34 | ] 35 | } 36 | }, 37 | "lint": { 38 | "builder": "@angular-eslint/builder:lint", 39 | "options": { 40 | "lintFilePatterns": [ 41 | "projects/ng2-events/**/*.ts", 42 | "projects/ng2-events/**/*.html" 43 | ], 44 | "eslintConfig": "projects/ng2-events/eslint.config.js" 45 | } 46 | } 47 | } 48 | }, 49 | "demo": { 50 | "projectType": "application", 51 | "schematics": {}, 52 | "root": "projects/demo", 53 | "sourceRoot": "projects/demo/src", 54 | "prefix": "app", 55 | "architect": { 56 | "build": { 57 | "builder": "@angular/build:application", 58 | "options": { 59 | "outputPath": { 60 | "base": "docs", 61 | "browser": "" 62 | }, 63 | "index": "projects/demo/src/index.html", 64 | "browser": "projects/demo/src/main.ts", 65 | "polyfills": [ 66 | "zone.js" 67 | ], 68 | "tsConfig": "projects/demo/tsconfig.app.json", 69 | "assets": [ 70 | { 71 | "glob": "**/*", 72 | "input": "projects/demo/public" 73 | } 74 | ], 75 | "styles": [ 76 | "projects/demo/src/styles.css" 77 | ], 78 | "scripts": [] 79 | }, 80 | "configurations": { 81 | "production": { 82 | "budgets": [ 83 | { 84 | "type": "initial", 85 | "maximumWarning": "500kB", 86 | "maximumError": "1MB" 87 | }, 88 | { 89 | "type": "anyComponentStyle", 90 | "maximumWarning": "4kB", 91 | "maximumError": "8kB" 92 | } 93 | ], 94 | "outputHashing": "all" 95 | }, 96 | "development": { 97 | "optimization": false, 98 | "extractLicenses": false, 99 | "sourceMap": true 100 | } 101 | }, 102 | "defaultConfiguration": "production" 103 | }, 104 | "serve": { 105 | "builder": "@angular/build:dev-server", 106 | "configurations": { 107 | "production": { 108 | "buildTarget": "demo:build:production" 109 | }, 110 | "development": { 111 | "buildTarget": "demo:build:development" 112 | } 113 | }, 114 | "defaultConfiguration": "development" 115 | }, 116 | "extract-i18n": { 117 | "builder": "@angular/build:extract-i18n" 118 | }, 119 | "test": { 120 | "builder": "@angular/build:karma", 121 | "options": { 122 | "polyfills": [ 123 | "zone.js", 124 | "zone.js/testing" 125 | ], 126 | "tsConfig": "projects/demo/tsconfig.spec.json", 127 | "assets": [ 128 | { 129 | "glob": "**/*", 130 | "input": "projects/demo/public" 131 | } 132 | ], 133 | "styles": [ 134 | "projects/demo/src/styles.css" 135 | ], 136 | "scripts": [] 137 | } 138 | }, 139 | "lint": { 140 | "builder": "@angular-eslint/builder:lint", 141 | "options": { 142 | "lintFilePatterns": [ 143 | "projects/demo/**/*.ts", 144 | "projects/demo/**/*.html" 145 | ], 146 | "eslintConfig": "projects/demo/eslint.config.js" 147 | } 148 | } 149 | } 150 | } 151 | }, 152 | "schematics": { 153 | "@schematics/angular:component": { 154 | "type": "component" 155 | }, 156 | "@schematics/angular:directive": { 157 | "type": "directive" 158 | }, 159 | "@schematics/angular:service": { 160 | "type": "service" 161 | }, 162 | "@schematics/angular:guard": { 163 | "typeSeparator": "." 164 | }, 165 | "@schematics/angular:interceptor": { 166 | "typeSeparator": "." 167 | }, 168 | "@schematics/angular:module": { 169 | "typeSeparator": "." 170 | }, 171 | "@schematics/angular:pipe": { 172 | "typeSeparator": "." 173 | }, 174 | "@schematics/angular:resolver": { 175 | "typeSeparator": "." 176 | } 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /projects/ng2-events/README.md: -------------------------------------------------------------------------------- 1 | # ng2-events 2 | 3 | **This version is compatible with Angular 20+** 4 | 5 | - For Angular 18-19, use version 6.0.0 6 | - For Angular 13-17, use version 5.0.0 7 | - For Angular 9-12 apps using View Engine, use version 4.2.2 8 | - For Angular 5-8, use version 4.2.2 9 | - For Angular 4, use version 3.1.0 10 | - For Angular 2, use version 2.0.0 11 | 12 | Extensions to the Angular event handling to make use of additional events and allow for better control over change detection for high-performance applications: 13 | 14 | - Listen to events outside of the current element 15 | - Up/down event handlers for cross-browser touch/mouse events 16 | - Scroll-in/out event handlers to control behavior of elements within or outside the viewport 17 | - Listen to multiple events with a single handler 18 | - Unregister an event listener after the event fires once 19 | - Attach event listeners only when a condition is met 20 | - Listen to events without triggering change detection 21 | - Use Observables to fine-tune when to trigger change detection 22 | 23 | **Examples**: 24 | 25 | ```html 26 |
...
27 | 28 | 29 | 30 |
...
31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | ``` 42 | 43 | ## Installation 44 | 45 | ``` 46 | npm install --save ng2-events 47 | ``` 48 | 49 | For applications using Angular Ivy, but without the Angular CLI, follow the [docs on consuming partial Ivy code](https://angular.dev/tools/libraries/creating-libraries#consuming-partial-ivy-code-outside-the-angular-cli). 50 | 51 | ## Usage 52 | 53 | To use the events, provide them in your application config: 54 | 55 | ```ts 56 | import { ApplicationConfig, provideZoneChangeDetection } from "@angular/core"; 57 | import { provideRouter } from "@angular/router"; 58 | 59 | import { routes } from "./app.routes"; 60 | import { EVENT_MANAGER_PLUGINS } from "@angular/platform-browser"; 61 | import { MultiEventPlugin, OnceEventPlugin, OutsideEventPlugin, SCROLL_EVENT_TIME, ScrollEventPlugin, TouchEventPlugin, UndetectedEventPlugin } from "ng2-events"; 62 | 63 | export const appConfig: ApplicationConfig = { 64 | providers: [ 65 | provideZoneChangeDetection({ eventCoalescing: true }), 66 | provideRouter(routes), 67 | { 68 | provide: EVENT_MANAGER_PLUGINS, 69 | useClass: MultiEventPlugin, 70 | multi: true, 71 | }, 72 | { 73 | provide: EVENT_MANAGER_PLUGINS, 74 | useClass: OnceEventPlugin, 75 | multi: true, 76 | }, 77 | { 78 | provide: EVENT_MANAGER_PLUGINS, 79 | useClass: OutsideEventPlugin, 80 | multi: true, 81 | }, 82 | { provide: SCROLL_EVENT_TIME, useValue: 500 }, 83 | { 84 | provide: EVENT_MANAGER_PLUGINS, 85 | useClass: ScrollEventPlugin, 86 | multi: true, 87 | }, 88 | { 89 | provide: EVENT_MANAGER_PLUGINS, 90 | useClass: TouchEventPlugin, 91 | multi: true, 92 | }, 93 | { 94 | provide: EVENT_MANAGER_PLUGINS, 95 | useClass: UndetectedEventPlugin, 96 | multi: true, 97 | }, 98 | ], 99 | }; 100 | ``` 101 | 102 | ## Additional Events 103 | 104 | ### _outside_: Listen to events outside of an element 105 | 106 | ```ts 107 | { 108 | provide: EVENT_MANAGER_PLUGINS, 109 | useClass: OutsideEventPlugin, 110 | multi: true, 111 | } 112 | ``` 113 | 114 | ```html 115 |
...
116 | ``` 117 | 118 | The event handler is called when an event is fired outside of the element and its children. 119 | 120 | ### _up/down/move_: Cross-browser quick mouse/touch events 121 | 122 | ```ts 123 | { 124 | provide: EVENT_MANAGER_PLUGINS, 125 | useClass: TouchEventPlugin, 126 | multi: true, 127 | } 128 | ``` 129 | 130 | ```html 131 | 132 | ``` 133 | 134 | The up/down events are fired when one of the following events is fired on the element: 135 | 136 | - mousedown/mouseup 137 | - pointerdown/pointerup 138 | - touchstart/touchend 139 | 140 | The move event is fired when one of the following events is fired on the element: 141 | 142 | - mousemove 143 | - pointermove 144 | - touchmove 145 | 146 | Note that `preventDefault()` is called on the first event to occur to make sure that the event handler is only fired once. This prevents touch-enabled devices from firing the handler for both the `touchstart` and the `mousedown` event. Be aware that especially with the `move` event this might interfere with scrolling on touch-based devices! 147 | 148 | ### _scroll-in / scroll-out_: Detect when an element is entering or leaving the viewport 149 | 150 | ```ts 151 | { provide: SCROLL_EVENT_TIME, useValue: 500 }, 152 | { 153 | provide: EVENT_MANAGER_PLUGINS, 154 | useClass: ScrollEventPlugin, 155 | multi: true, 156 | } 157 | ``` 158 | 159 | ```html 160 |
...
161 | ``` 162 | 163 | This event handler reacts to the window's `scroll`, `resize`, and `orientationchange` events. It only checks the vertical scrolling within the window. 164 | 165 | The configuration value `SCROLL_EVENT_TIME` sets a minimum time distance between checks to keep the performance impact low. The default value is 200ms. 166 | 167 | Upon initialization the event handler is called directly if the element has the matching status (`scroll-in` is called if the element is visible in the viewport at rendering time, `scroll-out` is called otherwise). `$event` is `true` for the initial call, `false` for all subsequent calls. 168 | 169 | ## Event Helpers 170 | 171 | ### _multi_: Listen to multiple events at once 172 | 173 | ```ts 174 | { 175 | provide: EVENT_MANAGER_PLUGINS, 176 | useClass: MultiEventPlugin, 177 | multi: true, 178 | } 179 | ``` 180 | 181 | ```html 182 | 183 | ``` 184 | 185 | ### _once_: Only fire event listener once 186 | 187 | ```ts 188 | { 189 | provide: EVENT_MANAGER_PLUGINS, 190 | useClass: OnceEventPlugin, 191 | multi: true, 192 | } 193 | ``` 194 | 195 | ```html 196 | 197 | ``` 198 | 199 | The event listener is unregistered when the event is first fired. Note that it is reattached every time the element is newly rendered, especially inside `*ngIf` and `*ngFor` blocks when conditions or references change. 200 | 201 | ### _condition Directive_: Only attach event listeners when a condition is met 202 | 203 | Import the `ConditionEventDirective` to use this directive. 204 | 205 | Listen to a single event: 206 | 207 | ```html 208 | 209 | ``` 210 | 211 | Listen to multiple events: 212 | 213 | ```html 214 | 215 | ``` 216 | 217 | This directive also allows for listening to a dynamic set of events: 218 | 219 | ```html 220 | 221 | ``` 222 | 223 | ```ts 224 | export class ExampleComponent { 225 | events = ["mousedown"]; 226 | 227 | changeEvents() { 228 | this.events = ["mouseup"]; 229 | } 230 | } 231 | ``` 232 | 233 | **Note**: If you just change events within the array, you have to manually change its reference so the change detector picks the change up and resets the event listeners: 234 | 235 | ```ts 236 | this.events.push("click"); 237 | this.events = this.events.slice(); 238 | ``` 239 | 240 | ## Change Detection 241 | 242 | **Note**: The following event helpers will work for primitive events (such as 'click', 'mousemove', ...). More complex event plugins such as the HammerJS touch gesture integration take control over their own change detection handling. 243 | 244 | ### _undetected_: Listen to events without triggering change detection 245 | 246 | **Note**: Does not work with zoneless change detection. 247 | 248 | ```ts 249 | { 250 | provide: EVENT_MANAGER_PLUGINS, 251 | useClass: UndetectedEventPlugin, 252 | multi: true, 253 | } 254 | ``` 255 | 256 | ```html 257 | 258 | ``` 259 | 260 | ```ts 261 | export class ExampleComponent implements OnInit { 262 | 263 | constructor(private zone: NgZone) {} 264 | 265 | handleClick() { 266 | if(someCondition) { 267 | this.zone.run(() => { 268 | ... 269 | }); 270 | } 271 | } 272 | } 273 | ``` 274 | 275 | This adds the event listener outside of the Angular zone, thus change detection is not triggered until you manually call `NgZone.run()` or a different event is fired within the Angular zone. 276 | 277 | ### _observe Directive_: Fire events on an observable subject 278 | 279 | Import the `ObserveEventDirective` to use this directive. 280 | 281 | Observe a single event: 282 | 283 | ```html 284 | 285 | ``` 286 | 287 | Observe multiple events: 288 | 289 | ```html 290 | 291 | ``` 292 | 293 | ```ts 294 | export class ExampleComponent implements OnInit { 295 | public subject = new Subject(); 296 | 297 | constructor(private zone: NgZone) {} 298 | 299 | ngOnInit() { 300 | this.subject 301 | .throttleTime(300) 302 | .filter(someCondition) 303 | // ... 304 | .subscribe(($event) => this.zone.run(() => this.handleEvent($event))); 305 | } 306 | 307 | private handleEvent($event: any) { 308 | // ... 309 | } 310 | } 311 | ``` 312 | 313 | With zoneless change detection: 314 | 315 | ```ts 316 | export class ExampleComponent implements OnInit { 317 | public subject = new Subject(); 318 | 319 | constructor(private ref: ChangeDetectorRef) {} 320 | 321 | ngOnInit() { 322 | this.subject 323 | .throttleTime(300) 324 | .filter(someCondition) 325 | // ... 326 | .subscribe(($event) => { 327 | this.handleEvent($event); 328 | this.ref.markForCheck(); 329 | }); 330 | } 331 | 332 | private handleEvent($event: any) { 333 | // ... 334 | } 335 | } 336 | ``` 337 | -------------------------------------------------------------------------------- /docs/3rdpartylicenses.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- 3 | Package: @angular/core 4 | License: "MIT" 5 | 6 | The MIT License 7 | 8 | Copyright (c) 2010-2025 Google LLC. https://angular.dev/license 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | THE SOFTWARE. 27 | 28 | -------------------------------------------------------------------------------- 29 | Package: rxjs 30 | License: "Apache-2.0" 31 | 32 | Apache License 33 | Version 2.0, January 2004 34 | http://www.apache.org/licenses/ 35 | 36 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 37 | 38 | 1. Definitions. 39 | 40 | "License" shall mean the terms and conditions for use, reproduction, 41 | and distribution as defined by Sections 1 through 9 of this document. 42 | 43 | "Licensor" shall mean the copyright owner or entity authorized by 44 | the copyright owner that is granting the License. 45 | 46 | "Legal Entity" shall mean the union of the acting entity and all 47 | other entities that control, are controlled by, or are under common 48 | control with that entity. For the purposes of this definition, 49 | "control" means (i) the power, direct or indirect, to cause the 50 | direction or management of such entity, whether by contract or 51 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 52 | outstanding shares, or (iii) beneficial ownership of such entity. 53 | 54 | "You" (or "Your") shall mean an individual or Legal Entity 55 | exercising permissions granted by this License. 56 | 57 | "Source" form shall mean the preferred form for making modifications, 58 | including but not limited to software source code, documentation 59 | source, and configuration files. 60 | 61 | "Object" form shall mean any form resulting from mechanical 62 | transformation or translation of a Source form, including but 63 | not limited to compiled object code, generated documentation, 64 | and conversions to other media types. 65 | 66 | "Work" shall mean the work of authorship, whether in Source or 67 | Object form, made available under the License, as indicated by a 68 | copyright notice that is included in or attached to the work 69 | (an example is provided in the Appendix below). 70 | 71 | "Derivative Works" shall mean any work, whether in Source or Object 72 | form, that is based on (or derived from) the Work and for which the 73 | editorial revisions, annotations, elaborations, or other modifications 74 | represent, as a whole, an original work of authorship. For the purposes 75 | of this License, Derivative Works shall not include works that remain 76 | separable from, or merely link (or bind by name) to the interfaces of, 77 | the Work and Derivative Works thereof. 78 | 79 | "Contribution" shall mean any work of authorship, including 80 | the original version of the Work and any modifications or additions 81 | to that Work or Derivative Works thereof, that is intentionally 82 | submitted to Licensor for inclusion in the Work by the copyright owner 83 | or by an individual or Legal Entity authorized to submit on behalf of 84 | the copyright owner. For the purposes of this definition, "submitted" 85 | means any form of electronic, verbal, or written communication sent 86 | to the Licensor or its representatives, including but not limited to 87 | communication on electronic mailing lists, source code control systems, 88 | and issue tracking systems that are managed by, or on behalf of, the 89 | Licensor for the purpose of discussing and improving the Work, but 90 | excluding communication that is conspicuously marked or otherwise 91 | designated in writing by the copyright owner as "Not a Contribution." 92 | 93 | "Contributor" shall mean Licensor and any individual or Legal Entity 94 | on behalf of whom a Contribution has been received by Licensor and 95 | subsequently incorporated within the Work. 96 | 97 | 2. Grant of Copyright License. Subject to the terms and conditions of 98 | this License, each Contributor hereby grants to You a perpetual, 99 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 100 | copyright license to reproduce, prepare Derivative Works of, 101 | publicly display, publicly perform, sublicense, and distribute the 102 | Work and such Derivative Works in Source or Object form. 103 | 104 | 3. Grant of Patent License. Subject to the terms and conditions of 105 | this License, each Contributor hereby grants to You a perpetual, 106 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 107 | (except as stated in this section) patent license to make, have made, 108 | use, offer to sell, sell, import, and otherwise transfer the Work, 109 | where such license applies only to those patent claims licensable 110 | by such Contributor that are necessarily infringed by their 111 | Contribution(s) alone or by combination of their Contribution(s) 112 | with the Work to which such Contribution(s) was submitted. If You 113 | institute patent litigation against any entity (including a 114 | cross-claim or counterclaim in a lawsuit) alleging that the Work 115 | or a Contribution incorporated within the Work constitutes direct 116 | or contributory patent infringement, then any patent licenses 117 | granted to You under this License for that Work shall terminate 118 | as of the date such litigation is filed. 119 | 120 | 4. Redistribution. You may reproduce and distribute copies of the 121 | Work or Derivative Works thereof in any medium, with or without 122 | modifications, and in Source or Object form, provided that You 123 | meet the following conditions: 124 | 125 | (a) You must give any other recipients of the Work or 126 | Derivative Works a copy of this License; and 127 | 128 | (b) You must cause any modified files to carry prominent notices 129 | stating that You changed the files; and 130 | 131 | (c) You must retain, in the Source form of any Derivative Works 132 | that You distribute, all copyright, patent, trademark, and 133 | attribution notices from the Source form of the Work, 134 | excluding those notices that do not pertain to any part of 135 | the Derivative Works; and 136 | 137 | (d) If the Work includes a "NOTICE" text file as part of its 138 | distribution, then any Derivative Works that You distribute must 139 | include a readable copy of the attribution notices contained 140 | within such NOTICE file, excluding those notices that do not 141 | pertain to any part of the Derivative Works, in at least one 142 | of the following places: within a NOTICE text file distributed 143 | as part of the Derivative Works; within the Source form or 144 | documentation, if provided along with the Derivative Works; or, 145 | within a display generated by the Derivative Works, if and 146 | wherever such third-party notices normally appear. The contents 147 | of the NOTICE file are for informational purposes only and 148 | do not modify the License. You may add Your own attribution 149 | notices within Derivative Works that You distribute, alongside 150 | or as an addendum to the NOTICE text from the Work, provided 151 | that such additional attribution notices cannot be construed 152 | as modifying the License. 153 | 154 | You may add Your own copyright statement to Your modifications and 155 | may provide additional or different license terms and conditions 156 | for use, reproduction, or distribution of Your modifications, or 157 | for any such Derivative Works as a whole, provided Your use, 158 | reproduction, and distribution of the Work otherwise complies with 159 | the conditions stated in this License. 160 | 161 | 5. Submission of Contributions. Unless You explicitly state otherwise, 162 | any Contribution intentionally submitted for inclusion in the Work 163 | by You to the Licensor shall be under the terms and conditions of 164 | this License, without any additional terms or conditions. 165 | Notwithstanding the above, nothing herein shall supersede or modify 166 | the terms of any separate license agreement you may have executed 167 | with Licensor regarding such Contributions. 168 | 169 | 6. Trademarks. This License does not grant permission to use the trade 170 | names, trademarks, service marks, or product names of the Licensor, 171 | except as required for reasonable and customary use in describing the 172 | origin of the Work and reproducing the content of the NOTICE file. 173 | 174 | 7. Disclaimer of Warranty. Unless required by applicable law or 175 | agreed to in writing, Licensor provides the Work (and each 176 | Contributor provides its Contributions) on an "AS IS" BASIS, 177 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 178 | implied, including, without limitation, any warranties or conditions 179 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 180 | PARTICULAR PURPOSE. You are solely responsible for determining the 181 | appropriateness of using or redistributing the Work and assume any 182 | risks associated with Your exercise of permissions under this License. 183 | 184 | 8. Limitation of Liability. In no event and under no legal theory, 185 | whether in tort (including negligence), contract, or otherwise, 186 | unless required by applicable law (such as deliberate and grossly 187 | negligent acts) or agreed to in writing, shall any Contributor be 188 | liable to You for damages, including any direct, indirect, special, 189 | incidental, or consequential damages of any character arising as a 190 | result of this License or out of the use or inability to use the 191 | Work (including but not limited to damages for loss of goodwill, 192 | work stoppage, computer failure or malfunction, or any and all 193 | other commercial damages or losses), even if such Contributor 194 | has been advised of the possibility of such damages. 195 | 196 | 9. Accepting Warranty or Additional Liability. While redistributing 197 | the Work or Derivative Works thereof, You may choose to offer, 198 | and charge a fee for, acceptance of support, warranty, indemnity, 199 | or other liability obligations and/or rights consistent with this 200 | License. However, in accepting such obligations, You may act only 201 | on Your own behalf and on Your sole responsibility, not on behalf 202 | of any other Contributor, and only if You agree to indemnify, 203 | defend, and hold each Contributor harmless for any liability 204 | incurred by, or claims asserted against, such Contributor by reason 205 | of your accepting any such warranty or additional liability. 206 | 207 | END OF TERMS AND CONDITIONS 208 | 209 | APPENDIX: How to apply the Apache License to your work. 210 | 211 | To apply the Apache License to your work, attach the following 212 | boilerplate notice, with the fields enclosed by brackets "[]" 213 | replaced with your own identifying information. (Don't include 214 | the brackets!) The text should be enclosed in the appropriate 215 | comment syntax for the file format. We also recommend that a 216 | file or class name and description of purpose be included on the 217 | same "printed page" as the copyright notice for easier 218 | identification within third-party archives. 219 | 220 | Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors 221 | 222 | Licensed under the Apache License, Version 2.0 (the "License"); 223 | you may not use this file except in compliance with the License. 224 | You may obtain a copy of the License at 225 | 226 | http://www.apache.org/licenses/LICENSE-2.0 227 | 228 | Unless required by applicable law or agreed to in writing, software 229 | distributed under the License is distributed on an "AS IS" BASIS, 230 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 231 | See the License for the specific language governing permissions and 232 | limitations under the License. 233 | 234 | 235 | -------------------------------------------------------------------------------- 236 | Package: tslib 237 | License: "0BSD" 238 | 239 | Copyright (c) Microsoft Corporation. 240 | 241 | Permission to use, copy, modify, and/or distribute this software for any 242 | purpose with or without fee is hereby granted. 243 | 244 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 245 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 246 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 247 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 248 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 249 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 250 | PERFORMANCE OF THIS SOFTWARE. 251 | -------------------------------------------------------------------------------- 252 | Package: @angular/common 253 | License: "MIT" 254 | 255 | The MIT License 256 | 257 | Copyright (c) 2010-2025 Google LLC. https://angular.dev/license 258 | 259 | Permission is hereby granted, free of charge, to any person obtaining a copy 260 | of this software and associated documentation files (the "Software"), to deal 261 | in the Software without restriction, including without limitation the rights 262 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 263 | copies of the Software, and to permit persons to whom the Software is 264 | furnished to do so, subject to the following conditions: 265 | 266 | The above copyright notice and this permission notice shall be included in 267 | all copies or substantial portions of the Software. 268 | 269 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 270 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 271 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 272 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 273 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 274 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 275 | THE SOFTWARE. 276 | 277 | -------------------------------------------------------------------------------- 278 | Package: @angular/platform-browser 279 | License: "MIT" 280 | 281 | The MIT License 282 | 283 | Copyright (c) 2010-2025 Google LLC. https://angular.dev/license 284 | 285 | Permission is hereby granted, free of charge, to any person obtaining a copy 286 | of this software and associated documentation files (the "Software"), to deal 287 | in the Software without restriction, including without limitation the rights 288 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 289 | copies of the Software, and to permit persons to whom the Software is 290 | furnished to do so, subject to the following conditions: 291 | 292 | The above copyright notice and this permission notice shall be included in 293 | all copies or substantial portions of the Software. 294 | 295 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 296 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 297 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 298 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 299 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 300 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 301 | THE SOFTWARE. 302 | 303 | -------------------------------------------------------------------------------- 304 | Package: @angular/router 305 | License: "MIT" 306 | 307 | The MIT License 308 | 309 | Copyright (c) 2010-2025 Google LLC. https://angular.dev/license 310 | 311 | Permission is hereby granted, free of charge, to any person obtaining a copy 312 | of this software and associated documentation files (the "Software"), to deal 313 | in the Software without restriction, including without limitation the rights 314 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 315 | copies of the Software, and to permit persons to whom the Software is 316 | furnished to do so, subject to the following conditions: 317 | 318 | The above copyright notice and this permission notice shall be included in 319 | all copies or substantial portions of the Software. 320 | 321 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 322 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 323 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 324 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 325 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 326 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 327 | THE SOFTWARE. 328 | 329 | -------------------------------------------------------------------------------- 330 | Package: @angular/forms 331 | License: "MIT" 332 | 333 | The MIT License 334 | 335 | Copyright (c) 2010-2025 Google LLC. https://angular.dev/license 336 | 337 | Permission is hereby granted, free of charge, to any person obtaining a copy 338 | of this software and associated documentation files (the "Software"), to deal 339 | in the Software without restriction, including without limitation the rights 340 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 341 | copies of the Software, and to permit persons to whom the Software is 342 | furnished to do so, subject to the following conditions: 343 | 344 | The above copyright notice and this permission notice shall be included in 345 | all copies or substantial portions of the Software. 346 | 347 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 348 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 349 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 350 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 351 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 352 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 353 | THE SOFTWARE. 354 | 355 | -------------------------------------------------------------------------------- 356 | Package: zone.js 357 | License: "MIT" 358 | 359 | The MIT License 360 | 361 | Copyright (c) 2010-2024 Google LLC. https://angular.io/license 362 | 363 | Permission is hereby granted, free of charge, to any person obtaining a copy 364 | of this software and associated documentation files (the "Software"), to deal 365 | in the Software without restriction, including without limitation the rights 366 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 367 | copies of the Software, and to permit persons to whom the Software is 368 | furnished to do so, subject to the following conditions: 369 | 370 | The above copyright notice and this permission notice shall be included in 371 | all copies or substantial portions of the Software. 372 | 373 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 374 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 375 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 376 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 377 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 378 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 379 | THE SOFTWARE. 380 | 381 | -------------------------------------------------------------------------------- 382 | -------------------------------------------------------------------------------- /docs/polyfills-SCHOHYNV.js: -------------------------------------------------------------------------------- 1 | var ae=globalThis;function ee(e){return(ae.__Zone_symbol_prefix||"__zone_symbol__")+e}function dt(){let e=ae.performance;function n(j){e&&e.mark&&e.mark(j)}function a(j,i){e&&e.measure&&e.measure(j,i)}n("Zone");let Y=class Y{static assertZonePatched(){if(ae.Promise!==S.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost 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 i=Y.current;for(;i.parent;)i=i.parent;return i}static get current(){return b.zone}static get currentTask(){return D}static __load_patch(i,s,o=!1){if(S.hasOwnProperty(i)){let p=ae[ee("forceDuplicateZoneCheck")]===!0;if(!o&&p)throw Error("Already loaded patch: "+i)}else if(!ae["__Zone_disable_"+i]){let p="Zone:"+i;n(p),S[i]=s(ae,Y,w),a(p,p)}}get parent(){return this._parent}get name(){return this._name}constructor(i,s){this._parent=i,this._name=s?s.name||"unnamed":"",this._properties=s&&s.properties||{},this._zoneDelegate=new f(this,this._parent&&this._parent._zoneDelegate,s)}get(i){let s=this.getZoneWith(i);if(s)return s._properties[i]}getZoneWith(i){let s=this;for(;s;){if(s._properties.hasOwnProperty(i))return s;s=s._parent}return null}fork(i){if(!i)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,i)}wrap(i,s){if(typeof i!="function")throw new Error("Expecting function got: "+i);let o=this._zoneDelegate.intercept(this,i,s),p=this;return function(){return p.runGuarded(o,this,arguments,s)}}run(i,s,o,p){b={parent:b,zone:this};try{return this._zoneDelegate.invoke(this,i,s,o,p)}finally{b=b.parent}}runGuarded(i,s=null,o,p){b={parent:b,zone:this};try{try{return this._zoneDelegate.invoke(this,i,s,o,p)}catch(H){if(this._zoneDelegate.handleError(this,H))throw H}}finally{b=b.parent}}runTask(i,s,o){if(i.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(i.zone||K).name+"; Execution: "+this.name+")");let p=i,{type:H,data:{isPeriodic:M=!1,isRefreshable:se=!1}={}}=i;if(i.state===q&&(H===z||H===g))return;let le=i.state!=Z;le&&p._transitionTo(Z,d);let ue=D;D=p,b={parent:b,zone:this};try{H==g&&i.data&&!M&&!se&&(i.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,p,s,o)}catch(ne){if(this._zoneDelegate.handleError(this,ne))throw ne}}finally{let ne=i.state;if(ne!==q&&ne!==X)if(H==z||M||se&&ne===k)le&&p._transitionTo(d,Z,k);else{let h=p._zoneDelegates;this._updateTaskCount(p,-1),le&&p._transitionTo(q,Z,q),se&&(p._zoneDelegates=h)}b=b.parent,D=ue}}scheduleTask(i){if(i.zone&&i.zone!==this){let o=this;for(;o;){if(o===i.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${i.zone.name}`);o=o.parent}}i._transitionTo(k,q);let s=[];i._zoneDelegates=s,i._zone=this;try{i=this._zoneDelegate.scheduleTask(this,i)}catch(o){throw i._transitionTo(X,k,q),this._zoneDelegate.handleError(this,o),o}return i._zoneDelegates===s&&this._updateTaskCount(i,1),i.state==k&&i._transitionTo(d,k),i}scheduleMicroTask(i,s,o,p){return this.scheduleTask(new E(G,i,s,o,p,void 0))}scheduleMacroTask(i,s,o,p,H){return this.scheduleTask(new E(g,i,s,o,p,H))}scheduleEventTask(i,s,o,p,H){return this.scheduleTask(new E(z,i,s,o,p,H))}cancelTask(i){if(i.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(i.zone||K).name+"; Execution: "+this.name+")");if(!(i.state!==d&&i.state!==Z)){i._transitionTo(V,d,Z);try{this._zoneDelegate.cancelTask(this,i)}catch(s){throw i._transitionTo(X,V),this._zoneDelegate.handleError(this,s),s}return this._updateTaskCount(i,-1),i._transitionTo(q,V),i.runCount=-1,i}}_updateTaskCount(i,s){let o=i._zoneDelegates;s==-1&&(i._zoneDelegates=null);for(let p=0;pj.hasTask(s,o),onScheduleTask:(j,i,s,o)=>j.scheduleTask(s,o),onInvokeTask:(j,i,s,o,p,H)=>j.invokeTask(s,o,p,H),onCancelTask:(j,i,s,o)=>j.cancelTask(s,o)};class f{get zone(){return this._zone}constructor(i,s,o){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this._zone=i,this._parentDelegate=s,this._forkZS=o&&(o&&o.onFork?o:s._forkZS),this._forkDlgt=o&&(o.onFork?s:s._forkDlgt),this._forkCurrZone=o&&(o.onFork?this._zone:s._forkCurrZone),this._interceptZS=o&&(o.onIntercept?o:s._interceptZS),this._interceptDlgt=o&&(o.onIntercept?s:s._interceptDlgt),this._interceptCurrZone=o&&(o.onIntercept?this._zone:s._interceptCurrZone),this._invokeZS=o&&(o.onInvoke?o:s._invokeZS),this._invokeDlgt=o&&(o.onInvoke?s:s._invokeDlgt),this._invokeCurrZone=o&&(o.onInvoke?this._zone:s._invokeCurrZone),this._handleErrorZS=o&&(o.onHandleError?o:s._handleErrorZS),this._handleErrorDlgt=o&&(o.onHandleError?s:s._handleErrorDlgt),this._handleErrorCurrZone=o&&(o.onHandleError?this._zone:s._handleErrorCurrZone),this._scheduleTaskZS=o&&(o.onScheduleTask?o:s._scheduleTaskZS),this._scheduleTaskDlgt=o&&(o.onScheduleTask?s:s._scheduleTaskDlgt),this._scheduleTaskCurrZone=o&&(o.onScheduleTask?this._zone:s._scheduleTaskCurrZone),this._invokeTaskZS=o&&(o.onInvokeTask?o:s._invokeTaskZS),this._invokeTaskDlgt=o&&(o.onInvokeTask?s:s._invokeTaskDlgt),this._invokeTaskCurrZone=o&&(o.onInvokeTask?this._zone:s._invokeTaskCurrZone),this._cancelTaskZS=o&&(o.onCancelTask?o:s._cancelTaskZS),this._cancelTaskDlgt=o&&(o.onCancelTask?s:s._cancelTaskDlgt),this._cancelTaskCurrZone=o&&(o.onCancelTask?this._zone:s._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;let p=o&&o.onHasTask,H=s&&s._hasTaskZS;(p||H)&&(this._hasTaskZS=p?o:c,this._hasTaskDlgt=s,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,o.onScheduleTask||(this._scheduleTaskZS=c,this._scheduleTaskDlgt=s,this._scheduleTaskCurrZone=this._zone),o.onInvokeTask||(this._invokeTaskZS=c,this._invokeTaskDlgt=s,this._invokeTaskCurrZone=this._zone),o.onCancelTask||(this._cancelTaskZS=c,this._cancelTaskDlgt=s,this._cancelTaskCurrZone=this._zone))}fork(i,s){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,i,s):new t(i,s)}intercept(i,s,o){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,i,s,o):s}invoke(i,s,o,p,H){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,i,s,o,p,H):s.apply(o,p)}handleError(i,s){return this._handleErrorZS?this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,i,s):!0}scheduleTask(i,s){let o=s;if(this._scheduleTaskZS)this._hasTaskZS&&o._zoneDelegates.push(this._hasTaskDlgtOwner),o=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,i,s),o||(o=s);else if(s.scheduleFn)s.scheduleFn(s);else if(s.type==G)U(s);else throw new Error("Task is missing scheduleFn.");return o}invokeTask(i,s,o,p){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,i,s,o,p):s.callback.apply(o,p)}cancelTask(i,s){let o;if(this._cancelTaskZS)o=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,i,s);else{if(!s.cancelFn)throw Error("Task is not cancelable");o=s.cancelFn(s)}return o}hasTask(i,s){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,i,s)}catch(o){this.handleError(i,o)}}_updateTaskCount(i,s){let o=this._taskCounts,p=o[i],H=o[i]=p+s;if(H<0)throw new Error("More tasks executed then were scheduled.");if(p==0||H==0){let M={microTask:o.microTask>0,macroTask:o.macroTask>0,eventTask:o.eventTask>0,change:i};this.hasTask(this._zone,M)}}}class E{constructor(i,s,o,p,H,M){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=i,this.source=s,this.data=p,this.scheduleFn=H,this.cancelFn=M,!o)throw new Error("callback is not defined");this.callback=o;let se=this;i===z&&p&&p.useG?this.invoke=E.invokeTask:this.invoke=function(){return E.invokeTask.call(ae,se,this,arguments)}}static invokeTask(i,s,o){i||(i=this),Q++;try{return i.runCount++,i.zone.runTask(i,s,o)}finally{Q==1&&J(),Q--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(q,k)}_transitionTo(i,s,o){if(this._state===s||this._state===o)this._state=i,i==q&&(this._zoneDelegates=null);else throw new Error(`${this.type} '${this.source}': can not transition to '${i}', expecting state '${s}'${o?" or '"+o+"'":""}, was '${this._state}'.`)}toString(){return this.data&&typeof this.data.handleId<"u"?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}let T=ee("setTimeout"),m=ee("Promise"),C=ee("then"),_=[],P=!1,I;function x(j){if(I||ae[m]&&(I=ae[m].resolve(0)),I){let i=I[C];i||(i=I.then),i.call(I,j)}else ae[T](j,0)}function U(j){Q===0&&_.length===0&&x(J),j&&_.push(j)}function J(){if(!P){for(P=!0;_.length;){let j=_;_=[];for(let i=0;ib,onUnhandledError:W,microtaskDrainDone:W,scheduleMicroTask:U,showUncaughtError:()=>!t[ee("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:W,patchMethod:()=>W,bindArguments:()=>[],patchThen:()=>W,patchMacroTask:()=>W,patchEventPrototype:()=>W,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>W,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>W,wrapWithCurrentZone:()=>W,filterProperties:()=>[],attachOriginToPatched:()=>W,_redefineProperty:()=>W,patchCallbacks:()=>W,nativeScheduleMicroTask:x},b={parent:null,zone:new t(null,null)},D=null,Q=0;function W(){}return a("Zone","Zone"),t}function _t(){let e=globalThis,n=e[ee("forceDuplicateZoneCheck")]===!0;if(e.Zone&&(n||typeof e.Zone.__symbol__!="function"))throw new Error("Zone already loaded.");return e.Zone??=dt(),e.Zone}var be=Object.getOwnPropertyDescriptor,Ae=Object.defineProperty,je=Object.getPrototypeOf,Et=Object.create,Tt=Array.prototype.slice,He="addEventListener",xe="removeEventListener",Le=ee(He),Ie=ee(xe),fe="true",he="false",Pe=ee("");function Ve(e,n){return Zone.current.wrap(e,n)}function Ge(e,n,a,t,c){return Zone.current.scheduleMacroTask(e,n,a,t,c)}var A=ee,De=typeof window<"u",pe=De?window:void 0,$=De&&pe||globalThis,gt="removeAttribute";function Fe(e,n){for(let a=e.length-1;a>=0;a--)typeof e[a]=="function"&&(e[a]=Ve(e[a],n+"_"+a));return e}function yt(e,n){let a=e.constructor.name;for(let t=0;t{let m=function(){return T.apply(this,Fe(arguments,a+"."+c))};return _e(m,T),m})(f)}}}function tt(e){return e?e.writable===!1?!1:!(typeof e.get=="function"&&typeof e.set>"u"):!0}var nt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Se=!("nw"in $)&&typeof $.process<"u"&&$.process.toString()==="[object process]",Be=!Se&&!nt&&!!(De&&pe.HTMLElement),rt=typeof $.process<"u"&&$.process.toString()==="[object process]"&&!nt&&!!(De&&pe.HTMLElement),Ce={},mt=A("enable_beforeunload"),Ye=function(e){if(e=e||$.event,!e)return;let n=Ce[e.type];n||(n=Ce[e.type]=A("ON_PROPERTY"+e.type));let a=this||e.target||$,t=a[n],c;if(Be&&a===pe&&e.type==="error"){let f=e;c=t&&t.call(this,f.message,f.filename,f.lineno,f.colno,f.error),c===!0&&e.preventDefault()}else c=t&&t.apply(this,arguments),e.type==="beforeunload"&&$[mt]&&typeof c=="string"?e.returnValue=c:c!=null&&!c&&e.preventDefault();return c};function $e(e,n,a){let t=be(e,n);if(!t&&a&&be(a,n)&&(t={enumerable:!0,configurable:!0}),!t||!t.configurable)return;let c=A("on"+n+"patched");if(e.hasOwnProperty(c)&&e[c])return;delete t.writable,delete t.value;let f=t.get,E=t.set,T=n.slice(2),m=Ce[T];m||(m=Ce[T]=A("ON_PROPERTY"+T)),t.set=function(C){let _=this;if(!_&&e===$&&(_=$),!_)return;typeof _[m]=="function"&&_.removeEventListener(T,Ye),E&&E.call(_,null),_[m]=C,typeof C=="function"&&_.addEventListener(T,Ye,!1)},t.get=function(){let C=this;if(!C&&e===$&&(C=$),!C)return null;let _=C[m];if(_)return _;if(f){let P=f.call(this);if(P)return t.set.call(this,P),typeof C[gt]=="function"&&C.removeAttribute(n),P}return null},Ae(e,n,t),e[c]=!0}function ot(e,n,a){if(n)for(let t=0;tfunction(E,T){let m=a(E,T);return m.cbIdx>=0&&typeof T[m.cbIdx]=="function"?Ge(m.name,T[m.cbIdx],m,c):f.apply(E,T)})}function _e(e,n){e[A("OriginalDelegate")]=n}var Je=!1,Me=!1;function kt(){try{let e=pe.navigator.userAgent;if(e.indexOf("MSIE ")!==-1||e.indexOf("Trident/")!==-1)return!0}catch{}return!1}function vt(){if(Je)return Me;Je=!0;try{let e=pe.navigator.userAgent;(e.indexOf("MSIE ")!==-1||e.indexOf("Trident/")!==-1||e.indexOf("Edge/")!==-1)&&(Me=!0)}catch{}return Me}function Ke(e){return typeof e=="function"}function Qe(e){return typeof e=="number"}var me=!1;if(typeof window<"u")try{let e=Object.defineProperty({},"passive",{get:function(){me=!0}});window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch{me=!1}var bt={useG:!0},te={},st={},it=new RegExp("^"+Pe+"(\\w+)(true|false)$"),ct=A("propagationStopped");function at(e,n){let a=(n?n(e):e)+he,t=(n?n(e):e)+fe,c=Pe+a,f=Pe+t;te[e]={},te[e][he]=c,te[e][fe]=f}function Pt(e,n,a,t){let c=t&&t.add||He,f=t&&t.rm||xe,E=t&&t.listeners||"eventListeners",T=t&&t.rmAll||"removeAllListeners",m=A(c),C="."+c+":",_="prependListener",P="."+_+":",I=function(k,d,Z){if(k.isRemoved)return;let V=k.callback;typeof V=="object"&&V.handleEvent&&(k.callback=g=>V.handleEvent(g),k.originalDelegate=V);let X;try{k.invoke(k,d,[Z])}catch(g){X=g}let G=k.options;if(G&&typeof G=="object"&&G.once){let g=k.originalDelegate?k.originalDelegate:k.callback;d[f].call(d,Z.type,g,G)}return X};function x(k,d,Z){if(d=d||e.event,!d)return;let V=k||d.target||e,X=V[te[d.type][Z?fe:he]];if(X){let G=[];if(X.length===1){let g=I(X[0],V,d);g&&G.push(g)}else{let g=X.slice();for(let z=0;z{throw z})}}}let U=function(k){return x(this,k,!1)},J=function(k){return x(this,k,!0)};function K(k,d){if(!k)return!1;let Z=!0;d&&d.useG!==void 0&&(Z=d.useG);let V=d&&d.vh,X=!0;d&&d.chkDup!==void 0&&(X=d.chkDup);let G=!1;d&&d.rt!==void 0&&(G=d.rt);let g=k;for(;g&&!g.hasOwnProperty(c);)g=je(g);if(!g&&k[c]&&(g=k),!g||g[m])return!1;let z=d&&d.eventNameToString,S={},w=g[m]=g[c],b=g[A(f)]=g[f],D=g[A(E)]=g[E],Q=g[A(T)]=g[T],W;d&&d.prepend&&(W=g[A(d.prepend)]=g[d.prepend]);function Y(r,u){return!me&&typeof r=="object"&&r?!!r.capture:!me||!u?r:typeof r=="boolean"?{capture:r,passive:!0}:r?typeof r=="object"&&r.passive!==!1?{...r,passive:!0}:r:{passive:!0}}let j=function(r){if(!S.isExisting)return w.call(S.target,S.eventName,S.capture?J:U,S.options)},i=function(r){if(!r.isRemoved){let u=te[r.eventName],v;u&&(v=u[r.capture?fe:he]);let R=v&&r.target[v];if(R){for(let y=0;yre.zone.cancelTask(re);r.call(Te,"abort",ce,{once:!0}),re.removeAbortListener=()=>Te.removeEventListener("abort",ce)}if(S.target=null,ke&&(ke.taskData=null),Ue&&(S.options.once=!0),!me&&typeof re.options=="boolean"||(re.options=ie),re.target=N,re.capture=Oe,re.eventName=L,B&&(re.originalDelegate=F),O?ge.unshift(re):ge.push(re),y)return N}};return g[c]=l(w,C,H,M,G),W&&(g[_]=l(W,P,o,M,G,!0)),g[f]=function(){let r=this||e,u=arguments[0];d&&d.transferEventName&&(u=d.transferEventName(u));let v=arguments[2],R=v?typeof v=="boolean"?!0:v.capture:!1,y=arguments[1];if(!y)return b.apply(this,arguments);if(V&&!V(b,y,r,arguments))return;let O=te[u],N;O&&(N=O[R?fe:he]);let L=N&&r[N];if(L)for(let F=0;Ffunction(c,f){c[ct]=!0,t&&t.apply(c,f)})}function Rt(e,n){n.patchMethod(e,"queueMicrotask",a=>function(t,c){Zone.current.scheduleMicroTask("queueMicrotask",c[0])})}var Re=A("zoneTask");function ye(e,n,a,t){let c=null,f=null;n+=t,a+=t;let E={};function T(C){let _=C.data;_.args[0]=function(){return C.invoke.apply(this,arguments)};let P=c.apply(e,_.args);return Qe(P)?_.handleId=P:(_.handle=P,_.isRefreshable=Ke(P.refresh)),C}function m(C){let{handle:_,handleId:P}=C.data;return f.call(e,_??P)}c=de(e,n,C=>function(_,P){if(Ke(P[0])){let I={isRefreshable:!1,isPeriodic:t==="Interval",delay:t==="Timeout"||t==="Interval"?P[1]||0:void 0,args:P},x=P[0];P[0]=function(){try{return x.apply(this,arguments)}finally{let{handle:Z,handleId:V,isPeriodic:X,isRefreshable:G}=I;!X&&!G&&(V?delete E[V]:Z&&(Z[Re]=null))}};let U=Ge(n,P[0],I,T,m);if(!U)return U;let{handleId:J,handle:K,isRefreshable:q,isPeriodic:k}=U.data;if(J)E[J]=U;else if(K&&(K[Re]=U,q&&!k)){let d=K.refresh;K.refresh=function(){let{zone:Z,state:V}=U;return V==="notScheduled"?(U._state="scheduled",Z._updateTaskCount(U,1)):V==="running"&&(U._state="scheduling"),d.call(this)}}return K??J??U}else return C.apply(e,P)}),f=de(e,a,C=>function(_,P){let I=P[0],x;Qe(I)?(x=E[I],delete E[I]):(x=I?.[Re],x?I[Re]=null:x=I),x?.type?x.cancelFn&&x.zone.cancelTask(x):C.apply(e,P)})}function Ct(e,n){let{isBrowser:a,isMix:t}=n.getGlobalObjects();if(!a&&!t||!e.customElements||!("customElements"in e))return;let c=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"];n.patchCallbacks(n,e.customElements,"customElements","define",c)}function Dt(e,n){if(Zone[n.symbol("patchEventTarget")])return;let{eventNames:a,zoneSymbolEventNames:t,TRUE_STR:c,FALSE_STR:f,ZONE_SYMBOL_PREFIX:E}=n.getGlobalObjects();for(let m=0;mf.target===e);if(!t||t.length===0)return n;let c=t[0].ignoreProperties;return n.filter(f=>c.indexOf(f)===-1)}function et(e,n,a,t){if(!e)return;let c=ut(e,n,a);ot(e,c,t)}function Ze(e){return Object.getOwnPropertyNames(e).filter(n=>n.startsWith("on")&&n.length>2).map(n=>n.substring(2))}function Ot(e,n){if(Se&&!rt||Zone[e.symbol("patchEvents")])return;let a=n.__Zone_ignore_on_properties,t=[];if(Be){let c=window;t=t.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);let f=kt()?[{target:c,ignoreProperties:["error"]}]:[];et(c,Ze(c),a&&a.concat(f),je(c))}t=t.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let c=0;c{let a=n[e.__symbol__("legacyPatch")];a&&a()}),e.__load_patch("timers",n=>{let a="set",t="clear";ye(n,a,t,"Timeout"),ye(n,a,t,"Interval"),ye(n,a,t,"Immediate")}),e.__load_patch("requestAnimationFrame",n=>{ye(n,"request","cancel","AnimationFrame"),ye(n,"mozRequest","mozCancel","AnimationFrame"),ye(n,"webkitRequest","webkitCancel","AnimationFrame")}),e.__load_patch("blocking",(n,a)=>{let t=["alert","prompt","confirm"];for(let c=0;cfunction(C,_){return a.current.run(E,n,_,m)})}}),e.__load_patch("EventTarget",(n,a,t)=>{St(n,t),Dt(n,t);let c=n.XMLHttpRequestEventTarget;c&&c.prototype&&t.patchEventTarget(n,t,[c.prototype])}),e.__load_patch("MutationObserver",(n,a,t)=>{ve("MutationObserver"),ve("WebKitMutationObserver")}),e.__load_patch("IntersectionObserver",(n,a,t)=>{ve("IntersectionObserver")}),e.__load_patch("FileReader",(n,a,t)=>{ve("FileReader")}),e.__load_patch("on_property",(n,a,t)=>{Ot(t,n)}),e.__load_patch("customElements",(n,a,t)=>{Ct(n,t)}),e.__load_patch("XHR",(n,a)=>{C(n);let t=A("xhrTask"),c=A("xhrSync"),f=A("xhrListener"),E=A("xhrScheduled"),T=A("xhrURL"),m=A("xhrErrorBeforeScheduled");function C(_){let P=_.XMLHttpRequest;if(!P)return;let I=P.prototype;function x(w){return w[t]}let U=I[Le],J=I[Ie];if(!U){let w=_.XMLHttpRequestEventTarget;if(w){let b=w.prototype;U=b[Le],J=b[Ie]}}let K="readystatechange",q="scheduled";function k(w){let b=w.data,D=b.target;D[E]=!1,D[m]=!1;let Q=D[f];U||(U=D[Le],J=D[Ie]),Q&&J.call(D,K,Q);let W=D[f]=()=>{if(D.readyState===D.DONE)if(!b.aborted&&D[E]&&w.state===q){let j=D[a.__symbol__("loadfalse")];if(D.status!==0&&j&&j.length>0){let i=w.invoke;w.invoke=function(){let s=D[a.__symbol__("loadfalse")];for(let o=0;ofunction(w,b){return w[c]=b[2]==!1,w[T]=b[1],V.apply(w,b)}),X="XMLHttpRequest.send",G=A("fetchTaskAborting"),g=A("fetchTaskScheduling"),z=de(I,"send",()=>function(w,b){if(a.current[g]===!0||w[c])return z.apply(w,b);{let D={target:w,url:w[T],isPeriodic:!1,args:b,aborted:!1},Q=Ge(X,d,D,k,Z);w&&w[m]===!0&&!D.aborted&&Q.state===q&&Q.invoke()}}),S=de(I,"abort",()=>function(w,b){let D=x(w);if(D&&typeof D.type=="string"){if(D.cancelFn==null||D.data&&D.data.aborted)return;D.zone.cancelTask(D)}else if(a.current[G]===!0)return S.apply(w,b)})}}),e.__load_patch("geolocation",n=>{n.navigator&&n.navigator.geolocation&&yt(n.navigator.geolocation,["getCurrentPosition","watchPosition"])}),e.__load_patch("PromiseRejectionEvent",(n,a)=>{function t(c){return function(f){lt(n,c).forEach(T=>{let m=n.PromiseRejectionEvent;if(m){let C=new m(c,{promise:f.promise,reason:f.rejection});T.invoke(C)}})}}n.PromiseRejectionEvent&&(a[A("unhandledPromiseRejectionHandler")]=t("unhandledrejection"),a[A("rejectionHandledHandler")]=t("rejectionhandled"))}),e.__load_patch("queueMicrotask",(n,a,t)=>{Rt(n,t)})}function Lt(e){e.__load_patch("ZoneAwarePromise",(n,a,t)=>{let c=Object.getOwnPropertyDescriptor,f=Object.defineProperty;function E(h){if(h&&h.toString===Object.prototype.toString){let l=h.constructor&&h.constructor.name;return(l||"")+": "+JSON.stringify(h)}return h?h.toString():Object.prototype.toString.call(h)}let T=t.symbol,m=[],C=n[T("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")]!==!1,_=T("Promise"),P=T("then"),I="__creationTrace__";t.onUnhandledError=h=>{if(t.showUncaughtError()){let l=h&&h.rejection;l?console.error("Unhandled Promise rejection:",l instanceof Error?l.message:l,"; Zone:",h.zone.name,"; Task:",h.task&&h.task.source,"; Value:",l,l instanceof Error?l.stack:void 0):console.error(h)}},t.microtaskDrainDone=()=>{for(;m.length;){let h=m.shift();try{h.zone.runGuarded(()=>{throw h.throwOriginal?h.rejection:h})}catch(l){U(l)}}};let x=T("unhandledPromiseRejectionHandler");function U(h){t.onUnhandledError(h);try{let l=a[x];typeof l=="function"&&l.call(this,h)}catch{}}function J(h){return h&&h.then}function K(h){return h}function q(h){return M.reject(h)}let k=T("state"),d=T("value"),Z=T("finally"),V=T("parentPromiseValue"),X=T("parentPromiseState"),G="Promise.then",g=null,z=!0,S=!1,w=0;function b(h,l){return r=>{try{Y(h,l,r)}catch(u){Y(h,!1,u)}}}let D=function(){let h=!1;return function(r){return function(){h||(h=!0,r.apply(null,arguments))}}},Q="Promise resolved with itself",W=T("currentTaskTrace");function Y(h,l,r){let u=D();if(h===r)throw new TypeError(Q);if(h[k]===g){let v=null;try{(typeof r=="object"||typeof r=="function")&&(v=r&&r.then)}catch(R){return u(()=>{Y(h,!1,R)})(),h}if(l!==S&&r instanceof M&&r.hasOwnProperty(k)&&r.hasOwnProperty(d)&&r[k]!==g)i(r),Y(h,r[k],r[d]);else if(l!==S&&typeof v=="function")try{v.call(r,u(b(h,l)),u(b(h,!1)))}catch(R){u(()=>{Y(h,!1,R)})()}else{h[k]=l;let R=h[d];if(h[d]=r,h[Z]===Z&&l===z&&(h[k]=h[X],h[d]=h[V]),l===S&&r instanceof Error){let y=a.currentTask&&a.currentTask.data&&a.currentTask.data[I];y&&f(r,W,{configurable:!0,enumerable:!1,writable:!0,value:y})}for(let y=0;y{try{let O=h[d],N=!!r&&Z===r[Z];N&&(r[V]=O,r[X]=R);let L=l.run(y,void 0,N&&y!==q&&y!==K?[]:[O]);Y(r,!0,L)}catch(O){Y(r,!1,O)}},r)}let o="function ZoneAwarePromise() { [native code] }",p=function(){},H=n.AggregateError;class M{static toString(){return o}static resolve(l){return l instanceof M?l:Y(new this(null),z,l)}static reject(l){return Y(new this(null),S,l)}static withResolvers(){let l={};return l.promise=new M((r,u)=>{l.resolve=r,l.reject=u}),l}static any(l){if(!l||typeof l[Symbol.iterator]!="function")return Promise.reject(new H([],"All promises were rejected"));let r=[],u=0;try{for(let y of l)u++,r.push(M.resolve(y))}catch{return Promise.reject(new H([],"All promises were rejected"))}if(u===0)return Promise.reject(new H([],"All promises were rejected"));let v=!1,R=[];return new M((y,O)=>{for(let N=0;N{v||(v=!0,y(L))},L=>{R.push(L),u--,u===0&&(v=!0,O(new H(R,"All promises were rejected")))})})}static race(l){let r,u,v=new this((O,N)=>{r=O,u=N});function R(O){r(O)}function y(O){u(O)}for(let O of l)J(O)||(O=this.resolve(O)),O.then(R,y);return v}static all(l){return M.allWithCallback(l)}static allSettled(l){return(this&&this.prototype instanceof M?this:M).allWithCallback(l,{thenCallback:u=>({status:"fulfilled",value:u}),errorCallback:u=>({status:"rejected",reason:u})})}static allWithCallback(l,r){let u,v,R=new this((L,F)=>{u=L,v=F}),y=2,O=0,N=[];for(let L of l){J(L)||(L=this.resolve(L));let F=O;try{L.then(B=>{N[F]=r?r.thenCallback(B):B,y--,y===0&&u(N)},B=>{r?(N[F]=r.errorCallback(B),y--,y===0&&u(N)):v(B)})}catch(B){v(B)}y++,O++}return y-=2,y===0&&u(N),R}constructor(l){let r=this;if(!(r instanceof M))throw new Error("Must be an instanceof Promise.");r[k]=g,r[d]=[];try{let u=D();l&&l(u(b(r,z)),u(b(r,S)))}catch(u){Y(r,!1,u)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return M}then(l,r){let u=this.constructor?.[Symbol.species];(!u||typeof u!="function")&&(u=this.constructor||M);let v=new u(p),R=a.current;return this[k]==g?this[d].push(R,v,l,r):s(this,R,v,l,r),v}catch(l){return this.then(null,l)}finally(l){let r=this.constructor?.[Symbol.species];(!r||typeof r!="function")&&(r=M);let u=new r(p);u[Z]=Z;let v=a.current;return this[k]==g?this[d].push(v,u,l,l):s(this,v,u,l,l),u}}M.resolve=M.resolve,M.reject=M.reject,M.race=M.race,M.all=M.all;let se=n[_]=n.Promise;n.Promise=M;let le=T("thenPatched");function ue(h){let l=h.prototype,r=c(l,"then");if(r&&(r.writable===!1||!r.configurable))return;let u=l.then;l[P]=u,h.prototype.then=function(v,R){return new M((O,N)=>{u.call(this,O,N)}).then(v,R)},h[le]=!0}t.patchThen=ue;function ne(h){return function(l,r){let u=h.apply(l,r);if(u instanceof M)return u;let v=u.constructor;return v[le]||ue(v),u}}return se&&(ue(se),de(n,"fetch",h=>ne(h))),Promise[a.__symbol__("uncaughtPromiseErrors")]=m,M})}function It(e){e.__load_patch("toString",n=>{let a=Function.prototype.toString,t=A("OriginalDelegate"),c=A("Promise"),f=A("Error"),E=function(){if(typeof this=="function"){let _=this[t];if(_)return typeof _=="function"?a.call(_):Object.prototype.toString.call(_);if(this===Promise){let P=n[c];if(P)return a.call(P)}if(this===Error){let P=n[f];if(P)return a.call(P)}}return a.call(this)};E[t]=a,Function.prototype.toString=E;let T=Object.prototype.toString,m="[object Promise]";Object.prototype.toString=function(){return typeof Promise=="function"&&this instanceof Promise?m:T.call(this)}})}function Mt(e,n,a,t,c){let f=Zone.__symbol__(t);if(n[f])return;let E=n[f]=n[t];n[t]=function(T,m,C){return m&&m.prototype&&c.forEach(function(_){let P=`${a}.${t}::`+_,I=m.prototype;try{if(I.hasOwnProperty(_)){let x=e.ObjectGetOwnPropertyDescriptor(I,_);x&&x.value?(x.value=e.wrapWithCurrentZone(x.value,P),e._redefineProperty(m.prototype,_,x)):I[_]&&(I[_]=e.wrapWithCurrentZone(I[_],P))}else I[_]&&(I[_]=e.wrapWithCurrentZone(I[_],P))}catch{}}),E.call(n,T,m,C)},e.attachOriginToPatched(n[t],E)}function Zt(e){e.__load_patch("util",(n,a,t)=>{let c=Ze(n);t.patchOnProperties=ot,t.patchMethod=de,t.bindArguments=Fe,t.patchMacroTask=pt;let f=a.__symbol__("BLACK_LISTED_EVENTS"),E=a.__symbol__("UNPATCHED_EVENTS");n[E]&&(n[f]=n[E]),n[f]&&(a[f]=a[E]=n[f]),t.patchEventPrototype=wt,t.patchEventTarget=Pt,t.isIEOrEdge=vt,t.ObjectDefineProperty=Ae,t.ObjectGetOwnPropertyDescriptor=be,t.ObjectCreate=Et,t.ArraySlice=Tt,t.patchClass=ve,t.wrapWithCurrentZone=Ve,t.filterProperties=ut,t.attachOriginToPatched=_e,t._redefineProperty=Object.defineProperty,t.patchCallbacks=Mt,t.getGlobalObjects=()=>({globalSources:st,zoneSymbolEventNames:te,eventNames:c,isBrowser:Be,isMix:rt,isNode:Se,TRUE_STR:fe,FALSE_STR:he,ZONE_SYMBOL_PREFIX:Pe,ADD_EVENT_LISTENER_STR:He,REMOVE_EVENT_LISTENER_STR:xe})})}function At(e){Lt(e),It(e),Zt(e)}var ft=_t();At(ft);Nt(ft); 3 | --------------------------------------------------------------------------------