{"version":3,"file":"ng-web-apis-common.mjs","sources":["../../../libs/common/src/tokens/window.ts","../../../libs/common/src/tokens/animation-frame.ts","../../../libs/common/src/tokens/caches.ts","../../../libs/common/src/tokens/crypto.ts","../../../libs/common/src/tokens/css.ts","../../../libs/common/src/tokens/history.ts","../../../libs/common/src/tokens/local-storage.ts","../../../libs/common/src/tokens/location.ts","../../../libs/common/src/tokens/navigator.ts","../../../libs/common/src/tokens/media-devices.ts","../../../libs/common/src/tokens/network-information.ts","../../../libs/common/src/tokens/page-visibility.ts","../../../libs/common/src/tokens/performance.ts","../../../libs/common/src/tokens/screen.ts","../../../libs/common/src/tokens/session-storage.ts","../../../libs/common/src/tokens/speech-recognition.ts","../../../libs/common/src/tokens/speech-synthesis.ts","../../../libs/common/src/tokens/user-agent.ts","../../../libs/common/src/utils/inject-element.ts","../../../libs/common/src/ng-web-apis-common.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {inject, InjectionToken} from '@angular/core';\n\nexport const WA_WINDOW = new InjectionToken<Window>(ngDevMode ? '[WA_WINDOW]' : '', {\n    factory: () => {\n        const {defaultView} = inject(DOCUMENT);\n\n        if (!defaultView) {\n            throw new Error('Window is not available');\n        }\n\n        return defaultView;\n    },\n});\n","import {inject, InjectionToken} from '@angular/core';\nimport {Observable, share} from 'rxjs';\n\nimport {WA_WINDOW} from './window';\n\nexport const WA_ANIMATION_FRAME = new InjectionToken<Observable<DOMHighResTimeStamp>>(\n    ngDevMode ? '[WA_ANIMATION_FRAME]' : '',\n    {\n        factory: () => {\n            const {requestAnimationFrame, cancelAnimationFrame} = inject(WA_WINDOW);\n\n            const animationFrame$ = new Observable<DOMHighResTimeStamp>((subscriber) => {\n                let id = Number.NaN;\n\n                const callback = (timestamp: DOMHighResTimeStamp): void => {\n                    subscriber.next(timestamp);\n                    id = requestAnimationFrame(callback);\n                };\n\n                id = requestAnimationFrame(callback);\n\n                return () => {\n                    cancelAnimationFrame(id);\n                };\n            });\n\n            return animationFrame$.pipe(share());\n        },\n    },\n);\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_WINDOW} from './window';\n\nexport const WA_CACHES = new InjectionToken<CacheStorage>(\n    ngDevMode ? '[WA_CACHES]' : '',\n    {factory: () => inject(WA_WINDOW).caches},\n);\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_WINDOW} from './window';\n\nexport const WA_CRYPTO = new InjectionToken<Crypto>(ngDevMode ? '[WA_CRYPTO]' : '', {\n    factory: () => inject(WA_WINDOW).crypto,\n});\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_WINDOW} from './window';\n\ndeclare global {\n    interface Window {\n        CSS: typeof CSS | null;\n    }\n}\n\nexport const WA_CSS = new InjectionToken<typeof CSS>(ngDevMode ? '[WA_CSS]' : '', {\n    factory: () =>\n        inject(WA_WINDOW).CSS ??\n        ({\n            escape: (v: string) => v,\n            supports: () => false,\n        } as unknown as typeof CSS),\n});\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_WINDOW} from './window';\n\nexport const WA_HISTORY = new InjectionToken<History>(ngDevMode ? '[WA_HISTORY]' : '', {\n    factory: () => inject(WA_WINDOW).history,\n});\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_WINDOW} from './window';\n\nexport const WA_LOCAL_STORAGE = new InjectionToken<Storage | null>(\n    ngDevMode ? '[WA_LOCAL_STORAGE]' : '',\n    {factory: () => inject(WA_WINDOW).localStorage},\n);\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_WINDOW} from './window';\n\nexport const WA_LOCATION = new InjectionToken<Location>(\n    ngDevMode ? '[WA_LOCATION]' : '',\n    {factory: () => inject(WA_WINDOW).location},\n);\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_WINDOW} from './window';\n\nexport const WA_NAVIGATOR = new InjectionToken<Navigator>(\n    ngDevMode ? '[WA_NAVIGATOR]' : '',\n    {factory: () => inject(WA_WINDOW).navigator},\n);\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_NAVIGATOR} from './navigator';\n\nexport const WA_MEDIA_DEVICES = new InjectionToken<MediaDevices>(\n    ngDevMode ? '[WA_MEDIA_DEVICES]' : '',\n    {factory: () => inject(WA_NAVIGATOR).mediaDevices},\n);\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_NAVIGATOR} from './navigator';\n\n// http://wicg.github.io/netinfo/#navigatornetworkinformation-interface\ndeclare interface NavigatorNetworkInformation {\n    readonly connection?: NetworkInformation;\n}\n\n// http://wicg.github.io/netinfo/#connection-types\ntype ConnectionType =\n    | 'bluetooth'\n    | 'cellular'\n    | 'ethernet'\n    | 'mixed'\n    | 'none'\n    | 'other'\n    | 'unknown'\n    | 'wifi'\n    | 'wimax';\n\n// http://wicg.github.io/netinfo/#effectiveconnectiontype-enum\ntype EffectiveConnectionType = '2g' | '3g' | '4g' | 'slow-2g';\n\n// http://wicg.github.io/netinfo/#dom-megabit\ntype Megabit = number;\n\n// http://wicg.github.io/netinfo/#dom-millisecond\ntype Millisecond = number;\n\n// http://wicg.github.io/netinfo/#networkinformation-interface\ninterface NetworkInformation extends EventTarget {\n    // http://wicg.github.io/netinfo/#type-attribute\n    readonly type?: ConnectionType;\n    // http://wicg.github.io/netinfo/#effectivetype-attribute\n    readonly effectiveType?: EffectiveConnectionType;\n    // http://wicg.github.io/netinfo/#downlinkmax-attribute\n    readonly downlinkMax?: Megabit;\n    // http://wicg.github.io/netinfo/#downlink-attribute\n    readonly downlink?: Megabit;\n    // http://wicg.github.io/netinfo/#rtt-attribute\n    readonly rtt?: Millisecond;\n    // http://wicg.github.io/netinfo/#savedata-attribute\n    readonly saveData?: boolean;\n    // http://wicg.github.io/netinfo/#handling-changes-to-the-underlying-connection\n    onchange?: EventListener;\n}\n\nexport const WA_NETWORK_INFORMATION = new InjectionToken<NetworkInformation | null>(\n    ngDevMode ? '[WA_NETWORK_INFORMATION]' : '',\n    {\n        factory: () =>\n            inject<NavigatorNetworkInformation>(WA_NAVIGATOR).connection || null,\n    },\n);\n","import {DOCUMENT} from '@angular/common';\nimport {inject, InjectionToken} from '@angular/core';\nimport {\n    distinctUntilChanged,\n    fromEvent,\n    map,\n    type Observable,\n    shareReplay,\n    startWith,\n} from 'rxjs';\n\nexport const WA_PAGE_VISIBILITY = new InjectionToken<Observable<boolean>>(\n    ngDevMode ? '[WA_PAGE_VISIBILITY]' : '',\n    {\n        factory: () => {\n            const documentRef = inject(DOCUMENT);\n\n            return fromEvent(documentRef, 'visibilitychange').pipe(\n                startWith(0),\n                map(() => documentRef.visibilityState !== 'hidden'),\n                distinctUntilChanged(),\n                shareReplay({refCount: false, bufferSize: 1}),\n            );\n        },\n    },\n);\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_WINDOW} from './window';\n\nexport const WA_PERFORMANCE = new InjectionToken<Performance>(\n    ngDevMode ? '[WA_PERFORMANCE]' : '',\n    {factory: () => inject(WA_WINDOW).performance},\n);\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_WINDOW} from './window';\n\nexport const WA_SCREEN = new InjectionToken<Screen>(ngDevMode ? '[WA_SCREEN]' : '', {\n    factory: () => inject(WA_WINDOW).screen,\n});\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_WINDOW} from './window';\n\nexport const WA_SESSION_STORAGE = new InjectionToken<Storage | null>(\n    ngDevMode ? '[WA_SESSION_STORAGE]' : '',\n    {factory: () => inject(WA_WINDOW).sessionStorage},\n);\n","import {inject, InjectionToken, type Type} from '@angular/core';\n\nimport {WA_WINDOW} from './window';\n\ndeclare global {\n    /**\n     * Workaround:\n     * This empty interface prevents TS errors when a consumer has\n     * `skipLibCheck: false` and did not include `dom-speech-recognition`\n     * in `tsconfig.types`.\n     *\n     * The real `SpeechRecognition` interface is provided by\n     * `@types/dom-speech-recognition` when it is present.\n     */\n    // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n    interface SpeechRecognition {}\n}\n\nexport const WA_SPEECH_RECOGNITION = new InjectionToken<Type<SpeechRecognition> | null>(\n    ngDevMode ? '[WA_SPEECH_RECOGNITION]' : '',\n    {\n        factory: () => {\n            const windowRef: any = inject(WA_WINDOW);\n\n            return (\n                windowRef.speechRecognition || windowRef.webkitSpeechRecognition || null\n            );\n        },\n    },\n);\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_WINDOW} from './window';\n\nexport const WA_SPEECH_SYNTHESIS = new InjectionToken<SpeechSynthesis>(\n    ngDevMode ? '[WA_SPEECH_SYNTHESIS]' : '',\n    {factory: () => inject(WA_WINDOW).speechSynthesis},\n);\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {WA_NAVIGATOR} from './navigator';\n\nexport const WA_USER_AGENT = new InjectionToken<string>(\n    ngDevMode ? '[WA_USER_AGENT]' : '',\n    {factory: () => inject(WA_NAVIGATOR).userAgent},\n);\n","import {ElementRef, inject} from '@angular/core';\n\nexport function waInjectElement<T = HTMLElement>(): T {\n    return inject(ElementRef).nativeElement;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGO,MAAM,SAAS,GAAG,IAAI,cAAc,CAAS,SAAS,GAAG,aAAa,GAAG,EAAE,EAAE;IAChF,OAAO,EAAE,MAAK;QACV,MAAM,EAAC,WAAW,EAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAEtC,IAAI,CAAC,WAAW,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;QAC9C;AAEA,QAAA,OAAO,WAAW;IACtB,CAAC;AACJ,CAAA;;ACRM,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAChD,SAAS,GAAG,sBAAsB,GAAG,EAAE,EACvC;IACI,OAAO,EAAE,MAAK;QACV,MAAM,EAAC,qBAAqB,EAAE,oBAAoB,EAAC,GAAG,MAAM,CAAC,SAAS,CAAC;QAEvE,MAAM,eAAe,GAAG,IAAI,UAAU,CAAsB,CAAC,UAAU,KAAI;AACvE,YAAA,IAAI,EAAE,GAAG,MAAM,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