@angular/fire 18.0.0 → 18.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/analytics/analytics.module.mjs +5 -5
- package/esm2022/analytics/screen-tracking.service.mjs +4 -4
- package/esm2022/analytics/user-tracking.service.mjs +4 -4
- package/esm2022/app/app.module.mjs +5 -5
- package/esm2022/app-check/app-check.module.mjs +5 -5
- package/esm2022/auth/auth.module.mjs +5 -5
- package/esm2022/auth-guard/auth-guard.mjs +4 -4
- package/esm2022/auth-guard/auth-guard.module.mjs +5 -5
- package/esm2022/compat/analytics/analytics.mjs +4 -4
- package/esm2022/compat/analytics/analytics.module.mjs +5 -5
- package/esm2022/compat/analytics/screen-tracking.service.mjs +4 -4
- package/esm2022/compat/analytics/user-tracking.service.mjs +4 -4
- package/esm2022/compat/auth/auth.mjs +4 -4
- package/esm2022/compat/auth/auth.module.mjs +5 -5
- package/esm2022/compat/auth-guard/auth-guard.mjs +4 -4
- package/esm2022/compat/auth-guard/auth-guard.module.mjs +5 -5
- package/esm2022/compat/database/database.mjs +4 -4
- package/esm2022/compat/database/database.module.mjs +5 -5
- package/esm2022/compat/firebase.app.module.mjs +5 -5
- package/esm2022/compat/firestore/firestore.mjs +4 -4
- package/esm2022/compat/firestore/firestore.module.mjs +5 -5
- package/esm2022/compat/functions/functions.mjs +4 -4
- package/esm2022/compat/functions/functions.module.mjs +5 -5
- package/esm2022/compat/messaging/messaging.mjs +4 -4
- package/esm2022/compat/messaging/messaging.module.mjs +5 -5
- package/esm2022/compat/performance/performance.mjs +4 -4
- package/esm2022/compat/performance/performance.module.mjs +5 -5
- package/esm2022/compat/performance/performance.service.mjs +4 -4
- package/esm2022/compat/remote-config/remote-config.mjs +4 -4
- package/esm2022/compat/remote-config/remote-config.module.mjs +5 -5
- package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +8 -8
- package/esm2022/compat/storage/storage.mjs +4 -4
- package/esm2022/compat/storage/storage.module.mjs +5 -5
- package/esm2022/database/database.module.mjs +5 -5
- package/esm2022/firestore/firestore.module.mjs +5 -5
- package/esm2022/firestore/lite/lite.module.mjs +5 -5
- package/esm2022/functions/functions.module.mjs +5 -5
- package/esm2022/messaging/messaging.module.mjs +5 -5
- package/esm2022/performance/performance.module.mjs +5 -5
- package/esm2022/remote-config/remote-config.module.mjs +5 -5
- package/esm2022/storage/storage.module.mjs +5 -5
- package/esm2022/vertexai-preview/vertexai.module.mjs +5 -5
- package/esm2022/zones.mjs +4 -4
- package/fesm2022/angular-fire-analytics.mjs +297 -410
- package/fesm2022/angular-fire-analytics.mjs.map +1 -7
- package/fesm2022/angular-fire-app-check.mjs +91 -162
- package/fesm2022/angular-fire-app-check.mjs.map +1 -7
- package/fesm2022/angular-fire-app.mjs +108 -181
- package/fesm2022/angular-fire-app.mjs.map +1 -7
- package/fesm2022/angular-fire-auth-guard.mjs +73 -83
- package/fesm2022/angular-fire-auth-guard.mjs.map +1 -7
- package/fesm2022/angular-fire-auth.mjs +142 -421
- package/fesm2022/angular-fire-auth.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-analytics.mjs +271 -262
- package/fesm2022/angular-fire-compat-analytics.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-auth-guard.mjs +72 -83
- package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-auth.mjs +214 -215
- package/fesm2022/angular-fire-compat-auth.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-database.mjs +378 -375
- package/fesm2022/angular-fire-compat-database.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-firestore.mjs +677 -537
- package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-functions.mjs +94 -98
- package/fesm2022/angular-fire-compat-functions.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-messaging.mjs +107 -107
- package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-performance.mjs +152 -158
- package/fesm2022/angular-fire-compat-performance.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-remote-config.mjs +232 -216
- package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-storage.mjs +231 -226
- package/fesm2022/angular-fire-compat-storage.mjs.map +1 -7
- package/fesm2022/angular-fire-compat.mjs +153 -140
- package/fesm2022/angular-fire-compat.mjs.map +1 -7
- package/fesm2022/angular-fire-database.mjs +136 -376
- package/fesm2022/angular-fire-database.mjs.map +1 -7
- package/fesm2022/angular-fire-firestore-lite.mjs +139 -388
- package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -7
- package/fesm2022/angular-fire-firestore.mjs +167 -526
- package/fesm2022/angular-fire-firestore.mjs.map +1 -7
- package/fesm2022/angular-fire-functions.mjs +93 -166
- package/fesm2022/angular-fire-functions.mjs.map +1 -7
- package/fesm2022/angular-fire-messaging.mjs +118 -196
- package/fesm2022/angular-fire-messaging.mjs.map +1 -7
- package/fesm2022/angular-fire-performance.mjs +104 -178
- package/fesm2022/angular-fire-performance.mjs.map +1 -7
- package/fesm2022/angular-fire-remote-config.mjs +132 -254
- package/fesm2022/angular-fire-remote-config.mjs.map +1 -7
- package/fesm2022/angular-fire-storage.mjs +105 -225
- package/fesm2022/angular-fire-storage.mjs.map +1 -7
- package/fesm2022/angular-fire-vertexai-preview.mjs +85 -146
- package/fesm2022/angular-fire-vertexai-preview.mjs.map +1 -7
- package/fesm2022/angular-fire.mjs +213 -183
- package/fesm2022/angular-fire.mjs.map +1 -7
- package/package.json +1 -1
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, PLATFORM_ID, Injectable, Inject, Optional, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/fire';
|
|
4
|
+
import { VERSION } from '@angular/fire';
|
|
5
|
+
import { ɵfirebaseAppFactory as _firebaseAppFactory, ɵcacheInstance as _cacheInstance, ɵlazySDKProxy as _lazySDKProxy, FIREBASE_OPTIONS, FIREBASE_APP_NAME, ɵapplyMixins as _applyMixins } from '@angular/fire/compat';
|
|
6
|
+
import { isSupported } from 'firebase/messaging';
|
|
7
|
+
import { of, EMPTY, Observable, concat } from 'rxjs';
|
|
8
|
+
import { subscribeOn, observeOn, switchMap, map, shareReplay, switchMapTo, catchError, mergeMap, defaultIfEmpty } from 'rxjs/operators';
|
|
9
|
+
import firebase from 'firebase/compat/app';
|
|
8
10
|
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import { catchError, defaultIfEmpty, map, mergeMap, observeOn, shareReplay, subscribeOn, switchMap, switchMapTo } from "rxjs/operators";
|
|
17
|
-
import * as i0 from "@angular/core";
|
|
18
|
-
import * as i1 from "@angular/fire";
|
|
19
|
-
var VAPID_KEY = new InjectionToken("angularfire2.messaging.vapid-key");
|
|
20
|
-
var SERVICE_WORKER = new InjectionToken("angularfire2.messaging.service-worker-registeration");
|
|
21
|
-
var AngularFireMessaging = class _AngularFireMessaging {
|
|
22
|
-
requestPermission;
|
|
23
|
-
getToken;
|
|
24
|
-
tokenChanges;
|
|
25
|
-
messages;
|
|
26
|
-
requestToken;
|
|
27
|
-
deleteToken;
|
|
28
|
-
constructor(options, name, platformId, zone, schedulers, vapidKey, _serviceWorker) {
|
|
29
|
-
const serviceWorker = _serviceWorker;
|
|
30
|
-
const messaging = of(void 0).pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap(isSupported), switchMap((supported) => supported ? import("firebase/compat/messaging") : EMPTY), map(() => ɵfirebaseAppFactory(options, zone, name)), switchMap((app) => ɵcacheInstance(`${app.name}.messaging`, "AngularFireMessaging", app.name, () => {
|
|
31
|
-
return of(app.messaging());
|
|
32
|
-
}, [])), shareReplay({ bufferSize: 1, refCount: false }));
|
|
33
|
-
this.requestPermission = messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap(() => Notification.requestPermission()));
|
|
34
|
-
this.getToken = messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap(async (messaging2) => {
|
|
35
|
-
if (Notification.permission === "granted") {
|
|
36
|
-
const serviceWorkerRegistration = serviceWorker ? await serviceWorker : null;
|
|
37
|
-
return await messaging2.getToken({ vapidKey, serviceWorkerRegistration });
|
|
38
|
-
} else {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
}));
|
|
42
|
-
const notificationPermission$ = new Observable((emitter) => {
|
|
43
|
-
navigator.permissions.query({ name: "notifications" }).then((notificationPerm) => {
|
|
44
|
-
notificationPerm.onchange = () => emitter.next();
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
const tokenChange$ = messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMapTo(notificationPermission$), switchMapTo(this.getToken));
|
|
48
|
-
this.tokenChanges = messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap(() => concat(this.getToken, tokenChange$)));
|
|
49
|
-
this.messages = messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap((messaging2) => new Observable((emitter) => messaging2.onMessage(emitter))));
|
|
50
|
-
this.requestToken = messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap(() => this.requestPermission), catchError(() => of(null)), mergeMap(() => this.tokenChanges));
|
|
51
|
-
this.deleteToken = () => messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap((messaging2) => messaging2.deleteToken()), defaultIfEmpty(false));
|
|
52
|
-
return ɵlazySDKProxy(this, messaging, zone);
|
|
53
|
-
}
|
|
54
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: _AngularFireMessaging, deps: [{ token: FIREBASE_OPTIONS }, { token: FIREBASE_APP_NAME, optional: true }, { token: PLATFORM_ID }, { token: i0.NgZone }, { token: i1.ɵAngularFireSchedulers }, { token: VAPID_KEY, optional: true }, { token: SERVICE_WORKER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
55
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: _AngularFireMessaging, providedIn: "any" });
|
|
11
|
+
// DO NOT MODIFY, this file is autogenerated by tools/build.ts
|
|
12
|
+
// Export a null object with the same keys as firebase/compat/messaging, so Proxy can work with proxy-polyfill in Internet Explorer
|
|
13
|
+
const proxyPolyfillCompat = {
|
|
14
|
+
deleteToken: null,
|
|
15
|
+
getToken: null,
|
|
16
|
+
onMessage: null,
|
|
17
|
+
onBackgroundMessage: null,
|
|
56
18
|
};
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: AngularFireMessaging, decorators: [{
|
|
58
|
-
type: Injectable,
|
|
59
|
-
args: [{
|
|
60
|
-
providedIn: "any"
|
|
61
|
-
}]
|
|
62
|
-
}], ctorParameters: () => [{ type: void 0, decorators: [{
|
|
63
|
-
type: Inject,
|
|
64
|
-
args: [FIREBASE_OPTIONS]
|
|
65
|
-
}] }, { type: void 0, decorators: [{
|
|
66
|
-
type: Optional
|
|
67
|
-
}, {
|
|
68
|
-
type: Inject,
|
|
69
|
-
args: [FIREBASE_APP_NAME]
|
|
70
|
-
}] }, { type: Object, decorators: [{
|
|
71
|
-
type: Inject,
|
|
72
|
-
args: [PLATFORM_ID]
|
|
73
|
-
}] }, { type: i0.NgZone }, { type: i1.ɵAngularFireSchedulers }, { type: void 0, decorators: [{
|
|
74
|
-
type: Optional
|
|
75
|
-
}, {
|
|
76
|
-
type: Inject,
|
|
77
|
-
args: [VAPID_KEY]
|
|
78
|
-
}] }, { type: void 0, decorators: [{
|
|
79
|
-
type: Optional
|
|
80
|
-
}, {
|
|
81
|
-
type: Inject,
|
|
82
|
-
args: [SERVICE_WORKER]
|
|
83
|
-
}] }] });
|
|
84
|
-
ɵapplyMixins(AngularFireMessaging, [proxyPolyfillCompat]);
|
|
85
19
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
20
|
+
const VAPID_KEY = new InjectionToken('angularfire2.messaging.vapid-key');
|
|
21
|
+
const SERVICE_WORKER = new InjectionToken('angularfire2.messaging.service-worker-registeration');
|
|
22
|
+
class AngularFireMessaging {
|
|
23
|
+
requestPermission;
|
|
24
|
+
getToken;
|
|
25
|
+
tokenChanges;
|
|
26
|
+
messages;
|
|
27
|
+
requestToken;
|
|
28
|
+
deleteToken;
|
|
29
|
+
constructor(options, name,
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
31
|
+
platformId, zone, schedulers, vapidKey, _serviceWorker) {
|
|
32
|
+
const serviceWorker = _serviceWorker;
|
|
33
|
+
const messaging = of(undefined).pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap(isSupported), switchMap(supported => supported ? import('firebase/compat/messaging') : EMPTY), map(() => _firebaseAppFactory(options, zone, name)), switchMap(app => _cacheInstance(`${app.name}.messaging`, 'AngularFireMessaging', app.name, () => {
|
|
34
|
+
return of(app.messaging());
|
|
35
|
+
}, [])), shareReplay({ bufferSize: 1, refCount: false }));
|
|
36
|
+
this.requestPermission = messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap(() => Notification.requestPermission()));
|
|
37
|
+
this.getToken = messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap(async (messaging) => {
|
|
38
|
+
if (Notification.permission === 'granted') {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
40
|
+
const serviceWorkerRegistration = serviceWorker ? await serviceWorker : null;
|
|
41
|
+
return await messaging.getToken({ vapidKey, serviceWorkerRegistration });
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
const notificationPermission$ = new Observable(emitter => {
|
|
48
|
+
navigator.permissions.query({ name: 'notifications' }).then(notificationPerm => {
|
|
49
|
+
notificationPerm.onchange = () => emitter.next();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
const tokenChange$ = messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMapTo(notificationPermission$), switchMapTo(this.getToken));
|
|
53
|
+
this.tokenChanges = messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap(() => concat(this.getToken, tokenChange$)));
|
|
54
|
+
this.messages = messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap(messaging => new Observable(emitter => messaging.onMessage(emitter))));
|
|
55
|
+
this.requestToken = messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap(() => this.requestPermission), catchError(() => of(null)), mergeMap(() => this.tokenChanges));
|
|
56
|
+
this.deleteToken = () => messaging.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), switchMap(messaging => messaging.deleteToken()), defaultIfEmpty(false));
|
|
57
|
+
return _lazySDKProxy(this, messaging, zone);
|
|
58
|
+
}
|
|
59
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireMessaging, deps: [{ token: FIREBASE_OPTIONS }, { token: FIREBASE_APP_NAME, optional: true }, { token: PLATFORM_ID }, { token: i0.NgZone }, { token: i1.ɵAngularFireSchedulers }, { token: VAPID_KEY, optional: true }, { token: SERVICE_WORKER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
60
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireMessaging, providedIn: 'any' });
|
|
61
|
+
}
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireMessaging, decorators: [{
|
|
63
|
+
type: Injectable,
|
|
64
|
+
args: [{
|
|
65
|
+
providedIn: 'any'
|
|
66
|
+
}]
|
|
67
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
68
|
+
type: Inject,
|
|
69
|
+
args: [FIREBASE_OPTIONS]
|
|
70
|
+
}] }, { type: undefined, decorators: [{
|
|
71
|
+
type: Optional
|
|
72
|
+
}, {
|
|
73
|
+
type: Inject,
|
|
74
|
+
args: [FIREBASE_APP_NAME]
|
|
75
|
+
}] }, { type: Object, decorators: [{
|
|
76
|
+
type: Inject,
|
|
77
|
+
args: [PLATFORM_ID]
|
|
78
|
+
}] }, { type: i0.NgZone }, { type: i1.ɵAngularFireSchedulers }, { type: undefined, decorators: [{
|
|
79
|
+
type: Optional
|
|
80
|
+
}, {
|
|
81
|
+
type: Inject,
|
|
82
|
+
args: [VAPID_KEY]
|
|
83
|
+
}] }, { type: undefined, decorators: [{
|
|
84
|
+
type: Optional
|
|
85
|
+
}, {
|
|
86
|
+
type: Inject,
|
|
87
|
+
args: [SERVICE_WORKER]
|
|
88
|
+
}] }] });
|
|
89
|
+
_applyMixins(AngularFireMessaging, [proxyPolyfillCompat]);
|
|
90
|
+
|
|
91
|
+
class AngularFireMessagingModule {
|
|
92
|
+
constructor() {
|
|
93
|
+
firebase.registerVersion('angularfire', VERSION.full, 'fcm-compat');
|
|
94
|
+
}
|
|
95
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireMessagingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
96
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0", ngImport: i0, type: AngularFireMessagingModule });
|
|
97
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireMessagingModule, providers: [AngularFireMessaging] });
|
|
98
|
+
}
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireMessagingModule, decorators: [{
|
|
100
|
+
type: NgModule,
|
|
101
|
+
args: [{
|
|
102
|
+
providers: [AngularFireMessaging]
|
|
103
|
+
}]
|
|
104
|
+
}], ctorParameters: () => [] });
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Generated bundle index. Do not edit.
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
export { AngularFireMessaging, AngularFireMessagingModule, SERVICE_WORKER, VAPID_KEY };
|
|
111
111
|
//# sourceMappingURL=angular-fire-compat-messaging.mjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/compat/messaging/base.ts", "../../../src/compat/messaging/messaging.ts", "../../../src/compat/messaging/messaging.module.ts"],
|
|
4
|
-
"sourcesContent": ["// DO NOT MODIFY, this file is autogenerated by tools/build.ts\n// Export a null object with the same keys as firebase/compat/messaging, so Proxy can work with proxy-polyfill in Internet Explorer\nexport const proxyPolyfillCompat = {\n deleteToken: null,\n getToken: null,\n onMessage: null,\n onBackgroundMessage: null,\n};\n", "import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core';\nimport { ɵAngularFireSchedulers } from '@angular/fire';\nimport { ɵPromiseProxy, ɵapplyMixins, ɵlazySDKProxy } from '@angular/fire/compat';\nimport { FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat';\nimport { FirebaseOptions } from 'firebase/app';\nimport firebase from 'firebase/compat/app';\nimport { isSupported } from 'firebase/messaging';\nimport { EMPTY, Observable, concat, of } from 'rxjs';\nimport { catchError, defaultIfEmpty, map, mergeMap, observeOn, shareReplay, subscribeOn, switchMap, switchMapTo } from 'rxjs/operators';\nimport { proxyPolyfillCompat } from './base';\n\nexport const VAPID_KEY = new InjectionToken<string>('angularfire2.messaging.vapid-key');\nexport const SERVICE_WORKER = new InjectionToken<Promise<ServiceWorkerRegistration>>('angularfire2.messaging.service-worker-registeration');\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface AngularFireMessaging extends Omit<ɵPromiseProxy<firebase.messaging.Messaging>, 'deleteToken' | 'getToken' | 'requestPermission'> {\n}\n\n@Injectable({\n providedIn: 'any'\n})\nexport class AngularFireMessaging {\n\n public readonly requestPermission: Observable<NotificationPermission>;\n public readonly getToken: Observable<string | null>;\n public readonly tokenChanges: Observable<string | null>;\n public readonly messages: Observable<firebase.messaging.MessagePayload>;\n public readonly requestToken: Observable<string | null>;\n public readonly deleteToken: (token: string) => Observable<boolean>;\n\n constructor(\n @Inject(FIREBASE_OPTIONS) options: FirebaseOptions,\n @Optional() @Inject(FIREBASE_APP_NAME) name: string | null | undefined,\n // eslint-disable-next-line @typescript-eslint/ban-types\n @Inject(PLATFORM_ID) platformId: Object,\n zone: NgZone,\n schedulers: ɵAngularFireSchedulers,\n @Optional() @Inject(VAPID_KEY) vapidKey: string|null,\n @Optional() @Inject(SERVICE_WORKER) _serviceWorker: any,\n ) {\n const serviceWorker: Promise<ServiceWorkerRegistration> | null = _serviceWorker;\n\n const messaging = of(undefined).pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(isSupported),\n switchMap(supported => supported ? import('firebase/compat/messaging') : EMPTY),\n map(() => ɵfirebaseAppFactory(options, zone, name)),\n switchMap(app => ɵcacheInstance(`${app.name}.messaging`, 'AngularFireMessaging', app.name, () => {\n return of(app.messaging());\n }, [])),\n shareReplay({ bufferSize: 1, refCount: false })\n );\n\n\n this.requestPermission = messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(() => Notification.requestPermission())\n );\n\n this.getToken = messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(async messaging => {\n if (Notification.permission === 'granted') {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n const serviceWorkerRegistration = serviceWorker ? await serviceWorker : null;\n return await messaging.getToken({ vapidKey, serviceWorkerRegistration });\n } else {\n return null;\n }\n })\n );\n\n const notificationPermission$ = new Observable<string>(emitter => {\n navigator.permissions.query({ name: 'notifications' }).then(notificationPerm => {\n notificationPerm.onchange = () => emitter.next();\n });\n });\n\n\n const tokenChange$ = messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMapTo(notificationPermission$),\n switchMapTo(this.getToken)\n );\n\n this.tokenChanges = messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(() => concat(this.getToken, tokenChange$))\n );\n\n\n this.messages = messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(messaging => new Observable<firebase.messaging.MessagePayload>(emitter =>\n messaging.onMessage(emitter)\n )),\n );\n\n this.requestToken = messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(() => this.requestPermission),\n catchError(() => of(null)),\n mergeMap(() => this.tokenChanges)\n );\n\n this.deleteToken = () => messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(messaging => messaging.deleteToken()),\n defaultIfEmpty(false)\n );\n\n return ɵlazySDKProxy(this, messaging, zone);\n }\n\n}\n\nɵapplyMixins(AngularFireMessaging, [proxyPolyfillCompat]);\n", "import { NgModule } from '@angular/core';\nimport { VERSION } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { AngularFireMessaging } from './messaging';\n\n@NgModule({\n providers: [ AngularFireMessaging ]\n})\nexport class AngularFireMessagingModule {\n constructor() {\n firebase.registerVersion('angularfire', VERSION.full, 'fcm-compat');\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAEO,IAAM,sBAAsB;EACjC,aAAa;EACb,UAAU;EACV,WAAW;EACX,qBAAqB;;;;ACNvB,SAAS,QAAQ,YAAY,gBAAgB,QAAQ,UAAU,mBAAmB;AAClF,SAAS,8BAA8B;AACvC,SAAwB,cAAc,qBAAqB;AAC3D,SAAS,mBAAmB,kBAAkB,gBAAgB,2BAA2B;AAGzF,SAAS,mBAAmB;AAC5B,SAAS,OAAO,YAAY,QAAQ,UAAU;AAC9C,SAAS,YAAY,gBAAgB,KAAK,UAAU,WAAW,aAAa,aAAa,WAAW,mBAAmB;;;AAGhH,IAAM,YAAY,IAAI,eAAuB,kCAAkC;AAC/E,IAAM,iBAAiB,IAAI,eAAmD,qDAAqD;AASpI,IAAO,uBAAP,MAAO,sBAAoB;EAEf;EACA;EACA;EACA;EACA;EACA;EAEhB,YAC4B,SACa,MAElB,YACrB,MACA,YAC+B,UACK,gBAAmB;AAEvD,UAAM,gBAA2D;AAEjE,UAAM,YAAY,GAAG,MAAS,EAAE,KAC9B,YAAY,WAAW,cAAc,GACrC,UAAU,WAAW,aAAa,GAClC,UAAU,WAAW,GACrB,UAAU,eAAa,YAAY,OAAO,2BAA2B,IAAI,KAAK,GAC9E,IAAI,MAAM,oBAAoB,SAAS,MAAM,IAAI,CAAC,GAClD,UAAU,SAAO,eAAe,GAAG,IAAI,IAAI,cAAc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{"version":3,"file":"angular-fire-compat-messaging.mjs","sources":["../../../src/compat/messaging/base.ts","../../../src/compat/messaging/messaging.ts","../../../src/compat/messaging/messaging.module.ts","../../../src/compat/messaging/angular-fire-compat-messaging.ts"],"sourcesContent":["// DO NOT MODIFY, this file is autogenerated by tools/build.ts\n// Export a null object with the same keys as firebase/compat/messaging, so Proxy can work with proxy-polyfill in Internet Explorer\nexport const proxyPolyfillCompat = {\n deleteToken: null,\n getToken: null,\n onMessage: null,\n onBackgroundMessage: null,\n};\n","import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core';\nimport { ɵAngularFireSchedulers } from '@angular/fire';\nimport { ɵPromiseProxy, ɵapplyMixins, ɵlazySDKProxy } from '@angular/fire/compat';\nimport { FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat';\nimport { FirebaseOptions } from 'firebase/app';\nimport firebase from 'firebase/compat/app';\nimport { isSupported } from 'firebase/messaging';\nimport { EMPTY, Observable, concat, of } from 'rxjs';\nimport { catchError, defaultIfEmpty, map, mergeMap, observeOn, shareReplay, subscribeOn, switchMap, switchMapTo } from 'rxjs/operators';\nimport { proxyPolyfillCompat } from './base';\n\nexport const VAPID_KEY = new InjectionToken<string>('angularfire2.messaging.vapid-key');\nexport const SERVICE_WORKER = new InjectionToken<Promise<ServiceWorkerRegistration>>('angularfire2.messaging.service-worker-registeration');\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface AngularFireMessaging extends Omit<ɵPromiseProxy<firebase.messaging.Messaging>, 'deleteToken' | 'getToken' | 'requestPermission'> {\n}\n\n@Injectable({\n providedIn: 'any'\n})\nexport class AngularFireMessaging {\n\n public readonly requestPermission: Observable<NotificationPermission>;\n public readonly getToken: Observable<string | null>;\n public readonly tokenChanges: Observable<string | null>;\n public readonly messages: Observable<firebase.messaging.MessagePayload>;\n public readonly requestToken: Observable<string | null>;\n public readonly deleteToken: (token: string) => Observable<boolean>;\n\n constructor(\n @Inject(FIREBASE_OPTIONS) options: FirebaseOptions,\n @Optional() @Inject(FIREBASE_APP_NAME) name: string | null | undefined,\n // eslint-disable-next-line @typescript-eslint/ban-types\n @Inject(PLATFORM_ID) platformId: Object,\n zone: NgZone,\n schedulers: ɵAngularFireSchedulers,\n @Optional() @Inject(VAPID_KEY) vapidKey: string|null,\n @Optional() @Inject(SERVICE_WORKER) _serviceWorker: any,\n ) {\n const serviceWorker: Promise<ServiceWorkerRegistration> | null = _serviceWorker;\n\n const messaging = of(undefined).pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(isSupported),\n switchMap(supported => supported ? import('firebase/compat/messaging') : EMPTY),\n map(() => ɵfirebaseAppFactory(options, zone, name)),\n switchMap(app => ɵcacheInstance(`${app.name}.messaging`, 'AngularFireMessaging', app.name, () => {\n return of(app.messaging());\n }, [])),\n shareReplay({ bufferSize: 1, refCount: false })\n );\n\n\n this.requestPermission = messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(() => Notification.requestPermission())\n );\n\n this.getToken = messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(async messaging => {\n if (Notification.permission === 'granted') {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n const serviceWorkerRegistration = serviceWorker ? await serviceWorker : null;\n return await messaging.getToken({ vapidKey, serviceWorkerRegistration });\n } else {\n return null;\n }\n })\n );\n\n const notificationPermission$ = new Observable<string>(emitter => {\n navigator.permissions.query({ name: 'notifications' }).then(notificationPerm => {\n notificationPerm.onchange = () => emitter.next();\n });\n });\n\n\n const tokenChange$ = messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMapTo(notificationPermission$),\n switchMapTo(this.getToken)\n );\n\n this.tokenChanges = messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(() => concat(this.getToken, tokenChange$))\n );\n\n\n this.messages = messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(messaging => new Observable<firebase.messaging.MessagePayload>(emitter =>\n messaging.onMessage(emitter)\n )),\n );\n\n this.requestToken = messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(() => this.requestPermission),\n catchError(() => of(null)),\n mergeMap(() => this.tokenChanges)\n );\n\n this.deleteToken = () => messaging.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n switchMap(messaging => messaging.deleteToken()),\n defaultIfEmpty(false)\n );\n\n return ɵlazySDKProxy(this, messaging, zone);\n }\n\n}\n\nɵapplyMixins(AngularFireMessaging, [proxyPolyfillCompat]);\n","import { NgModule } from '@angular/core';\nimport { VERSION } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { AngularFireMessaging } from './messaging';\n\n@NgModule({\n providers: [ AngularFireMessaging ]\n})\nexport class AngularFireMessagingModule {\n constructor() {\n firebase.registerVersion('angularfire', VERSION.full, 'fcm-compat');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["ɵfirebaseAppFactory","ɵcacheInstance","ɵlazySDKProxy","ɵapplyMixins"],"mappings":";;;;;;;;;;AAAA;AACA;AACO,MAAM,mBAAmB,GAAG;AACjC,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,mBAAmB,EAAE,IAAI;CAC1B;;MCIY,SAAS,GAAG,IAAI,cAAc,CAAS,kCAAkC,EAAE;MAC3E,cAAc,GAAG,IAAI,cAAc,CAAqC,qDAAqD,EAAE;MAS/H,oBAAoB,CAAA;AAEf,IAAA,iBAAiB,CAAqC;AACtD,IAAA,QAAQ,CAA4B;AACpC,IAAA,YAAY,CAA4B;AACxC,IAA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import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, PLATFORM_ID, Injectable, Optional, Inject, NgModule } from '@angular/core';
|
|
4
|
+
import * as i1 from '@angular/fire/compat';
|
|
5
|
+
import { ɵcacheInstance as _cacheInstance, ɵlazySDKProxy as _lazySDKProxy, ɵapplyMixins as _applyMixins } from '@angular/fire/compat';
|
|
6
|
+
import { of, EMPTY, Observable } from 'rxjs';
|
|
7
|
+
import { switchMap, map, shareReplay, tap, first } from 'rxjs/operators';
|
|
8
|
+
import { VERSION } from '@angular/fire';
|
|
9
|
+
import firebase from 'firebase/compat/app';
|
|
8
10
|
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import * as i0 from "@angular/core";
|
|
17
|
-
import * as i1 from "@angular/fire/compat";
|
|
18
|
-
var INSTRUMENTATION_ENABLED = new InjectionToken("angularfire2.performance.instrumentationEnabled");
|
|
19
|
-
var DATA_COLLECTION_ENABLED = new InjectionToken("angularfire2.performance.dataCollectionEnabled");
|
|
20
|
-
var AngularFirePerformance = class _AngularFirePerformance {
|
|
21
|
-
zone;
|
|
22
|
-
performance;
|
|
23
|
-
constructor(app, instrumentationEnabled, dataCollectionEnabled, zone, platformId) {
|
|
24
|
-
this.zone = zone;
|
|
25
|
-
this.performance = of(void 0).pipe(switchMap(() => isPlatformBrowser(platformId) ? zone.runOutsideAngular(() => import("firebase/compat/performance")) : EMPTY), map(() => ɵcacheInstance(`performance`, "AngularFirePerformance", app.name, () => {
|
|
26
|
-
const performance = zone.runOutsideAngular(() => app.performance());
|
|
27
|
-
if (instrumentationEnabled === false) {
|
|
28
|
-
performance.instrumentationEnabled = false;
|
|
29
|
-
}
|
|
30
|
-
if (dataCollectionEnabled === false) {
|
|
31
|
-
performance.dataCollectionEnabled = false;
|
|
32
|
-
}
|
|
33
|
-
return performance;
|
|
34
|
-
}, [instrumentationEnabled, dataCollectionEnabled])), shareReplay({ bufferSize: 1, refCount: false }));
|
|
35
|
-
return ɵlazySDKProxy(this, this.performance, zone);
|
|
36
|
-
}
|
|
37
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: _AngularFirePerformance, deps: [{ token: i1.FirebaseApp }, { token: INSTRUMENTATION_ENABLED, optional: true }, { token: DATA_COLLECTION_ENABLED, optional: true }, { token: i0.NgZone }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
38
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: _AngularFirePerformance, providedIn: "any" });
|
|
11
|
+
// DO NOT MODIFY, this file is autogenerated by tools/build.ts
|
|
12
|
+
// Export a null object with the same keys as firebase/compat/performance, so Proxy can work with proxy-polyfill in Internet Explorer
|
|
13
|
+
const proxyPolyfillCompat = {
|
|
14
|
+
app: null,
|
|
15
|
+
trace: null,
|
|
16
|
+
instrumentationEnabled: null,
|
|
17
|
+
dataCollectionEnabled: null,
|
|
39
18
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
19
|
+
|
|
20
|
+
const INSTRUMENTATION_ENABLED = new InjectionToken('angularfire2.performance.instrumentationEnabled');
|
|
21
|
+
const DATA_COLLECTION_ENABLED = new InjectionToken('angularfire2.performance.dataCollectionEnabled');
|
|
22
|
+
class AngularFirePerformance {
|
|
23
|
+
zone;
|
|
24
|
+
performance;
|
|
25
|
+
constructor(app, instrumentationEnabled, dataCollectionEnabled, zone,
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
27
|
+
platformId) {
|
|
28
|
+
this.zone = zone;
|
|
29
|
+
this.performance = of(undefined).pipe(switchMap(() => isPlatformBrowser(platformId) ? zone.runOutsideAngular(() => import('firebase/compat/performance')) : EMPTY), map(() => _cacheInstance(`performance`, 'AngularFirePerformance', app.name, () => {
|
|
30
|
+
const performance = zone.runOutsideAngular(() => app.performance());
|
|
31
|
+
if (instrumentationEnabled === false) {
|
|
32
|
+
performance.instrumentationEnabled = false;
|
|
33
|
+
}
|
|
34
|
+
if (dataCollectionEnabled === false) {
|
|
35
|
+
performance.dataCollectionEnabled = false;
|
|
36
|
+
}
|
|
37
|
+
return performance;
|
|
38
|
+
}, [instrumentationEnabled, dataCollectionEnabled])), shareReplay({ bufferSize: 1, refCount: false }));
|
|
39
|
+
return _lazySDKProxy(this, this.performance, zone);
|
|
40
|
+
}
|
|
41
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFirePerformance, deps: [{ token: i1.FirebaseApp }, { token: INSTRUMENTATION_ENABLED, optional: true }, { token: DATA_COLLECTION_ENABLED, optional: true }, { token: i0.NgZone }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
42
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFirePerformance, providedIn: 'any' });
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFirePerformance, decorators: [{
|
|
45
|
+
type: Injectable,
|
|
46
|
+
args: [{
|
|
47
|
+
providedIn: 'any'
|
|
48
|
+
}]
|
|
49
|
+
}], ctorParameters: () => [{ type: i1.FirebaseApp }, { type: undefined, decorators: [{
|
|
50
|
+
type: Optional
|
|
51
|
+
}, {
|
|
52
|
+
type: Inject,
|
|
53
|
+
args: [INSTRUMENTATION_ENABLED]
|
|
54
|
+
}] }, { type: undefined, decorators: [{
|
|
55
|
+
type: Optional
|
|
56
|
+
}, {
|
|
57
|
+
type: Inject,
|
|
58
|
+
args: [DATA_COLLECTION_ENABLED]
|
|
59
|
+
}] }, { type: i0.NgZone }, { type: Object, decorators: [{
|
|
60
|
+
type: Inject,
|
|
61
|
+
args: [PLATFORM_ID]
|
|
62
|
+
}] }] });
|
|
63
|
+
const trace$ = (traceId) => {
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
65
|
+
if (typeof window !== 'undefined' && window.performance?.mark) {
|
|
66
|
+
const entries = window.performance.getEntriesByName(traceId, 'measure') || [];
|
|
67
|
+
const startMarkName = `_${traceId}Start[${entries.length}]`;
|
|
68
|
+
const endMarkName = `_${traceId}End[${entries.length}]`;
|
|
69
|
+
return new Observable(emitter => {
|
|
70
|
+
window.performance.mark(startMarkName);
|
|
71
|
+
emitter.next();
|
|
72
|
+
return {
|
|
73
|
+
unsubscribe: () => {
|
|
74
|
+
window.performance.mark(endMarkName);
|
|
75
|
+
window.performance.measure(traceId, startMarkName, endMarkName);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
return EMPTY;
|
|
82
|
+
}
|
|
77
83
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
const traceUntil = (name, test, options) => (source$) => new Observable(subscriber => {
|
|
85
|
+
const traceSubscription = trace$(name).subscribe();
|
|
86
|
+
return source$.pipe(tap(a => test(a) && traceSubscription.unsubscribe(), () => undefined, () => options && options.orComplete && traceSubscription.unsubscribe())).subscribe(subscriber);
|
|
81
87
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
const traceWhile = (name, test, options) => (source$) => new Observable(subscriber => {
|
|
89
|
+
let traceSubscription;
|
|
90
|
+
return source$.pipe(tap(a => {
|
|
91
|
+
if (test(a)) {
|
|
92
|
+
traceSubscription = traceSubscription || trace$(name).subscribe();
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
if (traceSubscription) {
|
|
96
|
+
traceSubscription.unsubscribe();
|
|
97
|
+
}
|
|
98
|
+
traceSubscription = undefined;
|
|
99
|
+
}
|
|
100
|
+
}, () => undefined, () => options && options.orComplete && traceSubscription && traceSubscription.unsubscribe())).subscribe(subscriber);
|
|
94
101
|
});
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
const traceUntilComplete = (name) => (source$) => new Observable(subscriber => {
|
|
103
|
+
const traceSubscription = trace$(name).subscribe();
|
|
104
|
+
return source$.pipe(tap(() => undefined, () => undefined, () => traceSubscription.unsubscribe())).subscribe(subscriber);
|
|
98
105
|
});
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
106
|
+
const traceUntilFirst = (name) => (source$) => new Observable(subscriber => {
|
|
107
|
+
const traceSubscription = trace$(name).subscribe();
|
|
108
|
+
return source$.pipe(tap(() => traceSubscription.unsubscribe(), () => undefined, () => undefined)).subscribe(subscriber);
|
|
102
109
|
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
110
|
+
const trace = (name) => (source$) => new Observable(subscriber => {
|
|
111
|
+
const traceSubscription = trace$(name).subscribe();
|
|
112
|
+
return source$.pipe(tap(() => traceSubscription.unsubscribe(), () => undefined, () => traceSubscription.unsubscribe())).subscribe(subscriber);
|
|
106
113
|
});
|
|
107
|
-
|
|
114
|
+
_applyMixins(AngularFirePerformance, [proxyPolyfillCompat]);
|
|
108
115
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
window.performance.measure("isStable", IS_STABLE_START_MARK, IS_STABLE_END_MARK);
|
|
122
|
-
})).subscribe();
|
|
116
|
+
const IS_STABLE_START_MARK = 'Zone';
|
|
117
|
+
const IS_STABLE_END_MARK = '_isStableEnd';
|
|
118
|
+
class PerformanceMonitoringService {
|
|
119
|
+
disposable;
|
|
120
|
+
constructor(appRef) {
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
122
|
+
if (typeof window !== 'undefined' && window.performance?.mark) {
|
|
123
|
+
this.disposable = appRef.isStable.pipe(first(it => it), tap(() => {
|
|
124
|
+
window.performance.mark(IS_STABLE_END_MARK);
|
|
125
|
+
window.performance.measure('isStable', IS_STABLE_START_MARK, IS_STABLE_END_MARK);
|
|
126
|
+
})).subscribe();
|
|
127
|
+
}
|
|
123
128
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
ngOnDestroy() {
|
|
130
|
+
if (this.disposable) {
|
|
131
|
+
this.disposable.unsubscribe();
|
|
132
|
+
}
|
|
128
133
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}], ctorParameters: () => [{ type: i02.ApplicationRef }] });
|
|
134
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: PerformanceMonitoringService, deps: [{ token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
135
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: PerformanceMonitoringService });
|
|
136
|
+
}
|
|
137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: PerformanceMonitoringService, decorators: [{
|
|
138
|
+
type: Injectable
|
|
139
|
+
}], ctorParameters: () => [{ type: i0.ApplicationRef }] });
|
|
136
140
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
AngularFirePerformanceModule,
|
|
162
|
-
DATA_COLLECTION_ENABLED,
|
|
163
|
-
INSTRUMENTATION_ENABLED,
|
|
164
|
-
PerformanceMonitoringService,
|
|
165
|
-
trace,
|
|
166
|
-
traceUntil,
|
|
167
|
-
traceUntilComplete,
|
|
168
|
-
traceUntilFirst,
|
|
169
|
-
traceWhile
|
|
170
|
-
};
|
|
141
|
+
class AngularFirePerformanceModule {
|
|
142
|
+
constructor(perf, _) {
|
|
143
|
+
firebase.registerVersion('angularfire', VERSION.full, 'perf-compat');
|
|
144
|
+
// call anything here to get perf loading
|
|
145
|
+
perf.dataCollectionEnabled.then(() => undefined);
|
|
146
|
+
}
|
|
147
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFirePerformanceModule, deps: [{ token: AngularFirePerformance }, { token: PerformanceMonitoringService, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
148
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0", ngImport: i0, type: AngularFirePerformanceModule });
|
|
149
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFirePerformanceModule, providers: [AngularFirePerformance] });
|
|
150
|
+
}
|
|
151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFirePerformanceModule, decorators: [{
|
|
152
|
+
type: NgModule,
|
|
153
|
+
args: [{
|
|
154
|
+
providers: [AngularFirePerformance]
|
|
155
|
+
}]
|
|
156
|
+
}], ctorParameters: () => [{ type: AngularFirePerformance }, { type: PerformanceMonitoringService, decorators: [{
|
|
157
|
+
type: Optional
|
|
158
|
+
}] }] });
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Generated bundle index. Do not edit.
|
|
162
|
+
*/
|
|
163
|
+
|
|
164
|
+
export { AngularFirePerformance, AngularFirePerformanceModule, DATA_COLLECTION_ENABLED, INSTRUMENTATION_ENABLED, PerformanceMonitoringService, trace, traceUntil, traceUntilComplete, traceUntilFirst, traceWhile };
|
|
171
165
|
//# sourceMappingURL=angular-fire-compat-performance.mjs.map
|