@rxap/service-worker 16.0.0-dev.17 → 16.0.0-dev.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +1 -1
  3. package/esm2022/index.mjs +5 -15
  4. package/esm2022/lib/check-for-update.service.mjs +13 -19
  5. package/esm2022/lib/dialog-update.service.mjs +61 -0
  6. package/esm2022/lib/log-update.service.mjs +2 -14
  7. package/esm2022/lib/provide-service-worker-updater.mjs +32 -0
  8. package/esm2022/lib/service-worker-update-dialog/service-worker-update-dialog.component.mjs +28 -0
  9. package/fesm2022/rxap-service-worker.mjs +72 -267
  10. package/fesm2022/rxap-service-worker.mjs.map +1 -1
  11. package/index.d.ts +3 -9
  12. package/lib/check-for-update.service.d.ts +1 -6
  13. package/lib/log-update.service.d.ts +0 -6
  14. package/lib/provide-service-worker-updater.d.ts +4 -0
  15. package/package.json +4 -5
  16. package/theme.css +1 -1
  17. package/esm2022/lib/dialog/dialog-update.service.mjs +0 -61
  18. package/esm2022/lib/dialog/provide-service-worker-update-dialog.mjs +0 -11
  19. package/esm2022/lib/dialog/service-worker-update-dialog/service-worker-update-dialog.component.mjs +0 -28
  20. package/esm2022/lib/prompt-update/prompt-update.component.mjs +0 -52
  21. package/esm2022/lib/prompt-update/prompt-update.component.module.mjs +0 -23
  22. package/esm2022/lib/prompt-update/prompt-update.service.mjs +0 -44
  23. package/esm2022/lib/service-worker-prompt-update.module.mjs +0 -25
  24. package/esm2022/lib/service-worker-snack-bar-update.module.mjs +0 -25
  25. package/esm2022/lib/snack-bar-update.service.mjs +0 -61
  26. package/lib/dialog/provide-service-worker-update-dialog.d.ts +0 -2
  27. package/lib/prompt-update/prompt-update.component.d.ts +0 -19
  28. package/lib/prompt-update/prompt-update.component.module.d.ts +0 -9
  29. package/lib/prompt-update/prompt-update.service.d.ts +0 -12
  30. package/lib/service-worker-prompt-update.module.d.ts +0 -9
  31. package/lib/service-worker-snack-bar-update.module.d.ts +0 -9
  32. package/lib/snack-bar-update.service.d.ts +0 -19
  33. /package/lib/{dialog/dialog-update.service.d.ts → dialog-update.service.d.ts} +0 -0
  34. /package/lib/{dialog/service-worker-update-dialog → service-worker-update-dialog}/service-worker-update-dialog.component.d.ts +0 -0
@@ -1,114 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Inject, Injectable, NgModule, InjectionToken, EventEmitter, inject, ViewChild, Output, createComponent, Injector, ApplicationRef, APP_INITIALIZER } from '@angular/core';
3
- import * as i1 from '@angular/material/dialog';
4
- import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule, MatDialog } from '@angular/material/dialog';
5
- import { interval } from 'rxjs';
6
- import { tap, first, concatMap, filter, map, take, startWith } from 'rxjs/operators';
7
- import * as i5 from '@rxap/life-cycle';
8
- import { LifeCycleService } from '@rxap/life-cycle';
9
- import * as i4 from '@angular/material/button';
10
- import { MatButtonModule } from '@angular/material/button';
11
- import * as i3 from '@angular/material/tooltip';
12
- import { MatTooltipModule } from '@angular/material/tooltip';
13
- import * as i2 from '@angular/material/progress-bar';
14
- import { MatProgressBarModule } from '@angular/material/progress-bar';
2
+ import { InjectionToken, EventEmitter, inject, Component, ViewChild, Output, Injectable, Inject, createComponent, Injector, ApplicationRef, APP_INITIALIZER } from '@angular/core';
15
3
  import * as i1$1 from '@angular/service-worker';
16
4
  import { SwUpdate } from '@angular/service-worker';
5
+ import * as i1 from '@rxap/life-cycle';
6
+ import { LifeCycleService } from '@rxap/life-cycle';
7
+ import { interval } from 'rxjs';
8
+ import { startWith, tap, concatMap } from 'rxjs/operators';
17
9
  import { ErrorDialogComponent } from '@rxap/ngx-error';
18
- import * as i1$2 from '@angular/material/snack-bar';
19
- import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
20
-
21
- class PromptUpdateComponent {
22
- static { this.AUTO_UPDATE_IN = 1000 * 60 * 1.5; }
23
- constructor(event, dialogRef, lifecycle) {
24
- this.event = event;
25
- this.dialogRef = dialogRef;
26
- this.lifecycle = lifecycle;
27
- this.progress = 1;
28
- }
29
- ngOnInit() {
30
- this.subscription = this.lifecycle
31
- .whenReady(() => interval(100).pipe(tap((i) => (this.progress = Math.floor(((i + 1) / (PromptUpdateComponent.AUTO_UPDATE_IN / 100)) * 100))), first((i) => i >= PromptUpdateComponent.AUTO_UPDATE_IN / 100), tap(() => console.log('start auto update')), tap(() => this.dialogRef.close(true))))
32
- .subscribe();
33
- }
34
- ngOnDestroy() {
35
- this.subscription?.unsubscribe();
36
- }
37
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PromptUpdateComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: MatDialogRef }, { token: LifeCycleService }], target: i0.ɵɵFactoryTarget.Component }); }
38
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: PromptUpdateComponent, isStandalone: true, selector: "rxap-prompt-update", ngImport: i0, template: "<h2 mat-dialog-title>Update available</h2>\n<mat-dialog-content>\n <p>Ein neue Version der App steht zur Verf\u00FCgung!</p>\n <p>Soll die neue Version heruntergeladen werden und aktiviert werden?</p>\n <table class=\"version\">\n <tr>\n <th>Aktuelle Version</th>\n <td>{{event.current.hash}}</td>\n </tr>\n <tr>\n <th>Neue Version</th>\n <td>{{event.available.hash}}</td>\n </tr>\n </table>\n <mat-progress-bar [value]=\"progress\" matTooltip=\"start auto update\" mode=\"determinate\"></mat-progress-bar>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button [mat-dialog-close]=\"false\" mat-button>Abbrechen</button>\n <!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. -->\n <button [mat-dialog-close]=\"true\" mat-button>Update</button>\n</mat-dialog-actions>\n", styles: [".version th{padding-right:12px}\n"], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
39
- }
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PromptUpdateComponent, decorators: [{
41
- type: Component,
42
- args: [{ selector: 'rxap-prompt-update', changeDetection: ChangeDetectionStrategy.Default, standalone: true, imports: [
43
- MatDialogModule,
44
- MatProgressBarModule,
45
- MatTooltipModule,
46
- MatButtonModule,
47
- ], template: "<h2 mat-dialog-title>Update available</h2>\n<mat-dialog-content>\n <p>Ein neue Version der App steht zur Verf\u00FCgung!</p>\n <p>Soll die neue Version heruntergeladen werden und aktiviert werden?</p>\n <table class=\"version\">\n <tr>\n <th>Aktuelle Version</th>\n <td>{{event.current.hash}}</td>\n </tr>\n <tr>\n <th>Neue Version</th>\n <td>{{event.available.hash}}</td>\n </tr>\n </table>\n <mat-progress-bar [value]=\"progress\" matTooltip=\"start auto update\" mode=\"determinate\"></mat-progress-bar>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button [mat-dialog-close]=\"false\" mat-button>Abbrechen</button>\n <!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. -->\n <button [mat-dialog-close]=\"true\" mat-button>Update</button>\n</mat-dialog-actions>\n", styles: [".version th{padding-right:12px}\n"] }]
48
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
49
- type: Inject,
50
- args: [MAT_DIALOG_DATA]
51
- }] }, { type: i1.MatDialogRef, decorators: [{
52
- type: Inject,
53
- args: [MatDialogRef]
54
- }] }, { type: i5.LifeCycleService, decorators: [{
55
- type: Inject,
56
- args: [LifeCycleService]
57
- }] }]; } });
58
-
59
- class PromptUpdateService {
60
- constructor(dialog, updates) {
61
- this.dialog = dialog;
62
- this.updates = updates;
63
- }
64
- start() {
65
- console.debug('start prompt update');
66
- this.updates.available
67
- .pipe(concatMap((event) => this.promptUser(event)), filter(Boolean), tap(() => console.log('start app update')), tap(() => this.updates.activateUpdate().then(() => {
68
- console.log('app update completed. Reload app.');
69
- document.location.reload();
70
- })))
71
- .subscribe();
72
- }
73
- promptUser(event) {
74
- const dialogRef = this.dialog.open(PromptUpdateComponent, {
75
- data: event,
76
- });
77
- return dialogRef.afterClosed().pipe(map(Boolean), take(1));
78
- }
79
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PromptUpdateService, deps: [{ token: MatDialog }, { token: SwUpdate }], target: i0.ɵɵFactoryTarget.Injectable }); }
80
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PromptUpdateService, providedIn: 'root' }); }
81
- }
82
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PromptUpdateService, decorators: [{
83
- type: Injectable,
84
- args: [{
85
- providedIn: 'root',
86
- }]
87
- }], ctorParameters: function () { return [{ type: i1.MatDialog, decorators: [{
88
- type: Inject,
89
- args: [MatDialog]
90
- }] }, { type: i1$1.SwUpdate, decorators: [{
91
- type: Inject,
92
- args: [SwUpdate]
93
- }] }]; } });
94
-
95
- class PromptUpdateModule {
96
- constructor(promptUpdate) {
97
- promptUpdate.start();
98
- }
99
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PromptUpdateModule, deps: [{ token: PromptUpdateService }], target: i0.ɵɵFactoryTarget.NgModule }); }
100
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: PromptUpdateModule, imports: [PromptUpdateComponent], exports: [PromptUpdateComponent] }); }
101
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PromptUpdateModule, imports: [PromptUpdateComponent] }); }
102
- }
103
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PromptUpdateModule, decorators: [{
104
- type: NgModule,
105
- args: [{
106
- imports: [
107
- PromptUpdateComponent,
108
- ],
109
- exports: [PromptUpdateComponent],
110
- }]
111
- }], ctorParameters: function () { return [{ type: PromptUpdateService }]; } });
112
10
 
113
11
  const UPDATE_AVAILABLE_EVENT = new InjectionToken('UPDATE_AVAILABLE_EVENT');
114
12
  class ServiceWorkerUpdateDialogComponent {
@@ -136,6 +34,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
136
34
  type: Output
137
35
  }] } });
138
36
 
37
+ class CheckForUpdateService {
38
+ constructor(lifeCycle, updates) {
39
+ this.lifeCycle = lifeCycle;
40
+ this.updates = updates;
41
+ this._started = false;
42
+ }
43
+ start() {
44
+ if (this._started) {
45
+ console.warn('check for update already started');
46
+ return;
47
+ }
48
+ this._started = true;
49
+ if (this.updates.isEnabled) {
50
+ console.debug('start check for update');
51
+ this.updates.checkForUpdate();
52
+ this
53
+ .lifeCycle
54
+ .whenReady(() => interval(15 * 60 * 1000)
55
+ .pipe(startWith(null), tap(() => console.log('check for update')), tap(() => this.updates.checkForUpdate())))
56
+ .subscribe();
57
+ }
58
+ else {
59
+ console.warn('service worker updates are not enabled');
60
+ }
61
+ }
62
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateService, deps: [{ token: LifeCycleService }, { token: SwUpdate }], target: i0.ɵɵFactoryTarget.Injectable }); }
63
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateService, providedIn: 'root' }); }
64
+ }
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateService, decorators: [{
66
+ type: Injectable,
67
+ args: [{
68
+ providedIn: 'root',
69
+ }]
70
+ }], ctorParameters: function () { return [{ type: i1.LifeCycleService, decorators: [{
71
+ type: Inject,
72
+ args: [LifeCycleService]
73
+ }] }, { type: i1$1.SwUpdate, decorators: [{
74
+ type: Inject,
75
+ args: [SwUpdate]
76
+ }] }]; } });
77
+
139
78
  class DialogUpdateService {
140
79
  constructor(applicationRef, updates) {
141
80
  this.applicationRef = applicationRef;
@@ -190,62 +129,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
190
129
  args: [SwUpdate]
191
130
  }] }]; } });
192
131
 
193
- function ProvideServiceWorkerUpdateDialog() {
194
- return {
195
- provide: APP_INITIALIZER,
196
- multi: true,
197
- useFactory: (dus) => () => dus.start(),
198
- deps: [DialogUpdateService],
199
- };
200
- }
201
-
202
- class CheckForUpdateService {
203
- constructor(lifeCycle, updates) {
204
- this.lifeCycle = lifeCycle;
205
- this.updates = updates;
206
- }
207
- start() {
208
- if (this.updates.isEnabled) {
209
- console.debug('start check for update');
210
- this.updates.checkForUpdate();
211
- this
212
- .lifeCycle
213
- .whenReady(() => interval(15 * 60 * 1000)
214
- .pipe(startWith(null), tap(() => console.log('check for update')), tap(() => this.updates.checkForUpdate())))
215
- .subscribe();
216
- }
217
- }
218
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateService, deps: [{ token: LifeCycleService }, { token: SwUpdate }], target: i0.ɵɵFactoryTarget.Injectable }); }
219
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateService, providedIn: 'root' }); }
220
- }
221
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateService, decorators: [{
222
- type: Injectable,
223
- args: [{
224
- providedIn: 'root',
225
- }]
226
- }], ctorParameters: function () { return [{ type: i5.LifeCycleService, decorators: [{
227
- type: Inject,
228
- args: [LifeCycleService]
229
- }] }, { type: i1$1.SwUpdate, decorators: [{
230
- type: Inject,
231
- args: [SwUpdate]
232
- }] }]; } });
233
- class CheckForUpdateModule {
234
- constructor(checkForUpdate) {
235
- checkForUpdate.start();
236
- }
237
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateModule, deps: [{ token: CheckForUpdateService }], target: i0.ɵɵFactoryTarget.NgModule }); }
238
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateModule }); }
239
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateModule }); }
240
- }
241
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateModule, decorators: [{
242
- type: NgModule,
243
- args: [{}]
244
- }], ctorParameters: function () { return [{ type: CheckForUpdateService, decorators: [{
245
- type: Inject,
246
- args: [CheckForUpdateService]
247
- }] }]; } });
248
-
249
132
  class LogUpdateService {
250
133
  constructor(updates) {
251
134
  this.updates = updates;
@@ -270,112 +153,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
270
153
  providedIn: 'root',
271
154
  }]
272
155
  }], ctorParameters: function () { return [{ type: i1$1.SwUpdate }]; } });
273
- class LogUpdateModule {
274
- constructor(logUpdate) {
275
- logUpdate.start();
276
- }
277
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateModule, deps: [{ token: LogUpdateService }], target: i0.ɵɵFactoryTarget.NgModule }); }
278
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateModule }); }
279
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateModule }); }
280
- }
281
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateModule, decorators: [{
282
- type: NgModule,
283
- args: [{}]
284
- }], ctorParameters: function () { return [{ type: LogUpdateService }]; } });
285
156
 
286
- class ServiceWorkerPromptUpdateModule {
287
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerPromptUpdateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
288
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerPromptUpdateModule, exports: [LogUpdateModule,
289
- CheckForUpdateModule,
290
- PromptUpdateModule] }); }
291
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerPromptUpdateModule, imports: [LogUpdateModule,
292
- CheckForUpdateModule,
293
- PromptUpdateModule] }); }
157
+ function ProvideServiceWorkerUpdater(...providers) {
158
+ return [
159
+ {
160
+ provide: APP_INITIALIZER,
161
+ multi: true,
162
+ useFactory: (checkForUpdate) => () => checkForUpdate.start(),
163
+ deps: [CheckForUpdateService],
164
+ },
165
+ ...providers,
166
+ ];
294
167
  }
295
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerPromptUpdateModule, decorators: [{
296
- type: NgModule,
297
- args: [{
298
- exports: [
299
- LogUpdateModule,
300
- CheckForUpdateModule,
301
- PromptUpdateModule,
302
- ],
303
- }]
304
- }] });
305
-
306
- class SnackBarUpdateService {
307
- constructor(snackBar, updates) {
308
- this.snackBar = snackBar;
309
- this.updates = updates;
310
- }
311
- start() {
312
- console.debug('start prompt update');
313
- this.updates.available
314
- .pipe(concatMap((event) => this.openSnackBar(event)), tap(() => console.log('start app update')), tap(() => this.updates.activateUpdate().then(() => {
315
- console.log('app update completed. Reload app.');
316
- document.location.reload();
317
- })))
318
- .subscribe();
319
- }
320
- openSnackBar(event) {
321
- const snackBarRef = this.snackBar.open('New update available', 'update', {
322
- duration: 25 * 1000,
323
- data: event,
324
- });
325
- return snackBarRef.onAction();
326
- }
327
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SnackBarUpdateService, deps: [{ token: MatSnackBar }, { token: SwUpdate }], target: i0.ɵɵFactoryTarget.Injectable }); }
328
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SnackBarUpdateService, providedIn: 'root' }); }
329
- }
330
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SnackBarUpdateService, decorators: [{
331
- type: Injectable,
332
- args: [{
333
- providedIn: 'root',
334
- }]
335
- }], ctorParameters: function () { return [{ type: i1$2.MatSnackBar, decorators: [{
336
- type: Inject,
337
- args: [MatSnackBar]
338
- }] }, { type: i1$1.SwUpdate, decorators: [{
339
- type: Inject,
340
- args: [SwUpdate]
341
- }] }]; } });
342
- class SnackBarUpdateServiceModule {
343
- constructor(snackBarUpdate) {
344
- snackBarUpdate.start();
345
- }
346
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SnackBarUpdateServiceModule, deps: [{ token: SnackBarUpdateService }], target: i0.ɵɵFactoryTarget.NgModule }); }
347
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: SnackBarUpdateServiceModule, exports: [MatSnackBarModule] }); }
348
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SnackBarUpdateServiceModule, imports: [MatSnackBarModule] }); }
168
+ function withLogUpdater() {
169
+ return {
170
+ provide: APP_INITIALIZER,
171
+ multi: true,
172
+ useFactory: (logUpdateService) => () => logUpdateService.start(),
173
+ deps: [LogUpdateService],
174
+ };
349
175
  }
350
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SnackBarUpdateServiceModule, decorators: [{
351
- type: NgModule,
352
- args: [{
353
- exports: [MatSnackBarModule],
354
- }]
355
- }], ctorParameters: function () { return [{ type: SnackBarUpdateService, decorators: [{
356
- type: Inject,
357
- args: [SnackBarUpdateService]
358
- }] }]; } });
359
-
360
- class ServiceWorkerSnackBarUpdateModule {
361
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerSnackBarUpdateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
362
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerSnackBarUpdateModule, exports: [LogUpdateModule,
363
- CheckForUpdateModule,
364
- SnackBarUpdateServiceModule] }); }
365
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerSnackBarUpdateModule, imports: [LogUpdateModule,
366
- CheckForUpdateModule,
367
- SnackBarUpdateServiceModule] }); }
176
+ function withDialogUpdater() {
177
+ return {
178
+ provide: APP_INITIALIZER,
179
+ multi: true,
180
+ useFactory: (dus) => () => dus.start(),
181
+ deps: [DialogUpdateService],
182
+ };
368
183
  }
369
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerSnackBarUpdateModule, decorators: [{
370
- type: NgModule,
371
- args: [{
372
- exports: [
373
- LogUpdateModule,
374
- CheckForUpdateModule,
375
- SnackBarUpdateServiceModule,
376
- ],
377
- }]
378
- }] });
379
184
 
380
185
  function UnregisterServiceWorker(environment) {
381
186
  if (!environment.serviceWorker) {
@@ -394,12 +199,12 @@ function UnregisterServiceWorker(environment) {
394
199
  }
395
200
  }
396
201
 
397
- // region prompt-update
202
+ // region service-worker-update-dialog
398
203
  // endregion
399
204
 
400
205
  /**
401
206
  * Generated bundle index. Do not edit.
402
207
  */
403
208
 
404
- export { CheckForUpdateModule, CheckForUpdateService, DialogUpdateService, LogUpdateModule, LogUpdateService, PromptUpdateComponent, PromptUpdateModule, PromptUpdateService, ProvideServiceWorkerUpdateDialog, ServiceWorkerPromptUpdateModule, ServiceWorkerSnackBarUpdateModule, ServiceWorkerUpdateDialogComponent, SnackBarUpdateService, SnackBarUpdateServiceModule, UPDATE_AVAILABLE_EVENT, UnregisterServiceWorker };
209
+ export { CheckForUpdateService, DialogUpdateService, LogUpdateService, ProvideServiceWorkerUpdater, ServiceWorkerUpdateDialogComponent, UPDATE_AVAILABLE_EVENT, UnregisterServiceWorker, withDialogUpdater, withLogUpdater };
405
210
  //# sourceMappingURL=rxap-service-worker.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"rxap-service-worker.mjs","sources":["../../../../../packages/angular/service-worker/src/lib/prompt-update/prompt-update.component.ts","../../../../../packages/angular/service-worker/src/lib/prompt-update/prompt-update.component.html","../../../../../packages/angular/service-worker/src/lib/prompt-update/prompt-update.service.ts","../../../../../packages/angular/service-worker/src/lib/prompt-update/prompt-update.component.module.ts","../../../../../packages/angular/service-worker/src/lib/dialog/service-worker-update-dialog/service-worker-update-dialog.component.ts","../../../../../packages/angular/service-worker/src/lib/dialog/service-worker-update-dialog/service-worker-update-dialog.component.html","../../../../../packages/angular/service-worker/src/lib/dialog/dialog-update.service.ts","../../../../../packages/angular/service-worker/src/lib/dialog/provide-service-worker-update-dialog.ts","../../../../../packages/angular/service-worker/src/lib/check-for-update.service.ts","../../../../../packages/angular/service-worker/src/lib/log-update.service.ts","../../../../../packages/angular/service-worker/src/lib/service-worker-prompt-update.module.ts","../../../../../packages/angular/service-worker/src/lib/snack-bar-update.service.ts","../../../../../packages/angular/service-worker/src/lib/service-worker-snack-bar-update.module.ts","../../../../../packages/angular/service-worker/src/lib/unregister-service-worker.ts","../../../../../packages/angular/service-worker/src/index.ts","../../../../../packages/angular/service-worker/src/rxap-service-worker.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Inject,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport { UpdateAvailableEvent } from '@angular/service-worker';\nimport {\n MAT_DIALOG_DATA,\n MatDialogModule,\n MatDialogRef,\n} from '@angular/material/dialog';\nimport {\n interval,\n Subscription,\n} from 'rxjs';\nimport {\n first,\n tap,\n} from 'rxjs/operators';\nimport { LifeCycleService } from '@rxap/life-cycle';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\n@Component({\n selector: 'rxap-prompt-update',\n templateUrl: './prompt-update.component.html',\n styleUrls: [ './prompt-update.component.scss' ],\n changeDetection: ChangeDetectionStrategy.Default,\n standalone: true,\n imports: [\n MatDialogModule,\n MatProgressBarModule,\n MatTooltipModule,\n MatButtonModule,\n ],\n})\nexport class PromptUpdateComponent implements OnInit, OnDestroy {\n public static AUTO_UPDATE_IN = 1000 * 60 * 1.5;\n\n public progress = 1;\n\n public subscription?: Subscription;\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public readonly event: UpdateAvailableEvent,\n @Inject(MatDialogRef)\n private readonly dialogRef: MatDialogRef<boolean>,\n @Inject(LifeCycleService)\n private readonly lifecycle: LifeCycleService,\n ) {\n }\n\n public ngOnInit(): void {\n this.subscription = this.lifecycle\n .whenReady(() =>\n interval(100).pipe(\n tap(\n (i) =>\n (this.progress = Math.floor(\n ((i + 1) / (PromptUpdateComponent.AUTO_UPDATE_IN / 100)) * 100,\n )),\n ),\n first((i) => i >= PromptUpdateComponent.AUTO_UPDATE_IN / 100),\n tap(() => console.log('start auto update')),\n tap(() => this.dialogRef.close(true)),\n ),\n )\n .subscribe();\n }\n\n public ngOnDestroy(): void {\n this.subscription?.unsubscribe();\n }\n}\n","<h2 mat-dialog-title>Update available</h2>\n<mat-dialog-content>\n <p>Ein neue Version der App steht zur Verfügung!</p>\n <p>Soll die neue Version heruntergeladen werden und aktiviert werden?</p>\n <table class=\"version\">\n <tr>\n <th>Aktuelle Version</th>\n <td>{{event.current.hash}}</td>\n </tr>\n <tr>\n <th>Neue Version</th>\n <td>{{event.available.hash}}</td>\n </tr>\n </table>\n <mat-progress-bar [value]=\"progress\" matTooltip=\"start auto update\" mode=\"determinate\"></mat-progress-bar>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button [mat-dialog-close]=\"false\" mat-button>Abbrechen</button>\n <!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. -->\n <button [mat-dialog-close]=\"true\" mat-button>Update</button>\n</mat-dialog-actions>\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n SwUpdate,\n UpdateAvailableEvent,\n} from '@angular/service-worker';\nimport {\n concatMap,\n filter,\n map,\n take,\n tap,\n} from 'rxjs/operators';\nimport { MatDialog } from '@angular/material/dialog';\nimport { PromptUpdateComponent } from './prompt-update.component';\nimport { Observable } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PromptUpdateService {\n constructor(\n @Inject(MatDialog)\n private readonly dialog: MatDialog,\n @Inject(SwUpdate)\n private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n console.debug('start prompt update');\n this.updates.available\n .pipe(\n concatMap((event) => this.promptUser(event)),\n filter(Boolean),\n tap(() => console.log('start app update')),\n tap(() =>\n this.updates.activateUpdate().then(() => {\n console.log('app update completed. Reload app.');\n document.location.reload();\n }),\n ),\n )\n .subscribe();\n }\n\n private promptUser(event: UpdateAvailableEvent): Observable<boolean> {\n const dialogRef = this.dialog.open<PromptUpdateComponent, any, boolean>(\n PromptUpdateComponent,\n {\n data: event,\n },\n );\n\n return dialogRef.afterClosed().pipe(map(Boolean), take(1));\n }\n}\n","import { NgModule } from '@angular/core';\nimport { PromptUpdateComponent } from './prompt-update.component';\nimport { PromptUpdateService } from './prompt-update.service';\n\n\n@NgModule({\n imports: [\n PromptUpdateComponent,\n ],\n exports: [ PromptUpdateComponent ],\n})\nexport class PromptUpdateModule {\n\n constructor(promptUpdate: PromptUpdateService) {\n promptUpdate.start();\n }\n\n}\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n inject,\n InjectionToken,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { UpdateAvailableEvent } from '@angular/service-worker';\n\nexport const UPDATE_AVAILABLE_EVENT = new InjectionToken<UpdateAvailableEvent>('UPDATE_AVAILABLE_EVENT');\n\n@Component({\n selector: 'rxap-service-worker-update-dialog',\n standalone: true,\n imports: [],\n templateUrl: './service-worker-update-dialog.component.html',\n styleUrls: [ './service-worker-update-dialog.component.scss' ],\n})\nexport class ServiceWorkerUpdateDialogComponent implements AfterViewInit {\n\n @ViewChild('dialog', { static: true })\n public dialog!: ElementRef<HTMLDialogElement>;\n\n @Output()\n public closeDialog = new EventEmitter<void>();\n\n public readonly updateAvailableEvent = inject(UPDATE_AVAILABLE_EVENT);\n\n ngAfterViewInit() {\n this.dialog.nativeElement.showModal();\n }\n\n close() {\n this.dialog.nativeElement.close();\n this.closeDialog.emit();\n }\n\n}\n","<dialog #dialog\n class=\"max-w-6xl rounded overflow-auto drop-shadow-2xl dark:bg-black dark:text-white flex flex-col gap-3 p-6\">\n <h2 class=\"text-2xl font-bold\" i18n>A new application version is available</h2>\n <table class=\"table-auto\">\n <tr>\n <th>Current version hash</th>\n <td>{{updateAvailableEvent.current.hash}}</td>\n </tr>\n <tr>\n <th>New version hash</th>\n <td>{{updateAvailableEvent.available.hash}}</td>\n </tr>\n </table>\n <button (click)=\"close()\" class=\"px-4 py-2 rounded bg-primary-500\" i18n>Update</button>\n</dialog>\n","import {\n ApplicationRef,\n createComponent,\n Inject,\n Injectable,\n Injector,\n} from '@angular/core';\nimport {\n SwUpdate,\n UpdateAvailableEvent,\n} from '@angular/service-worker';\nimport { ErrorDialogComponent } from '@rxap/ngx-error';\nimport { Observable } from 'rxjs';\nimport {\n concatMap,\n tap,\n} from 'rxjs/operators';\nimport { UPDATE_AVAILABLE_EVENT } from './service-worker-update-dialog/service-worker-update-dialog.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DialogUpdateService {\n constructor(\n @Inject(ApplicationRef)\n private readonly applicationRef: ApplicationRef,\n @Inject(SwUpdate)\n private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n console.debug('start dialog update service');\n this.updates.available\n .pipe(\n concatMap((event) => this.openUpdateDialog(event)),\n tap(() => console.log('start app update')),\n tap(() =>\n this.updates.activateUpdate().then(() => {\n console.log('app update completed. Reload app.');\n document.location.reload();\n }),\n ),\n )\n .subscribe();\n }\n\n private openUpdateDialog(event: UpdateAvailableEvent): Observable<void> {\n console.debug('open update dialog');\n const body = document.getElementsByTagName('body')[0];\n const div = document.createElement('div');\n body.appendChild(div);\n const componentRef = createComponent(ErrorDialogComponent, {\n hostElement: div,\n environmentInjector: this.applicationRef.injector,\n elementInjector: Injector.create({\n providers: [\n {\n provide: UPDATE_AVAILABLE_EVENT,\n useValue: event,\n },\n ],\n }),\n });\n this.applicationRef.attachView(componentRef.hostView);\n\n return componentRef.instance.closeDialog.pipe(\n tap(() => {\n componentRef.destroy();\n body.removeChild(div);\n div.remove();\n }),\n );\n }\n}\n","import {\n APP_INITIALIZER,\n Provider,\n} from '@angular/core';\nimport { DialogUpdateService } from './dialog-update.service';\n\nexport function ProvideServiceWorkerUpdateDialog(): Provider {\n return {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: (dus: DialogUpdateService) => () => dus.start(),\n deps: [ DialogUpdateService ],\n };\n}\n","import {\n Inject,\n Injectable,\n NgModule,\n} from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport {\n startWith,\n tap,\n} from 'rxjs/operators';\nimport { interval } from 'rxjs';\nimport { LifeCycleService } from '@rxap/life-cycle';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CheckForUpdateService {\n\n constructor(\n @Inject(LifeCycleService) private readonly lifeCycle: LifeCycleService,\n @Inject(SwUpdate) private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n if (this.updates.isEnabled) {\n\n console.debug('start check for update');\n\n this.updates.checkForUpdate();\n\n this\n .lifeCycle\n .whenReady(() => interval(15 * 60 * 1000)\n .pipe(\n startWith(null),\n tap(() => console.log('check for update')),\n tap(() => this.updates.checkForUpdate()),\n ),\n )\n .subscribe();\n\n }\n }\n\n}\n\n@NgModule({})\nexport class CheckForUpdateModule {\n\n constructor(@Inject(CheckForUpdateService) checkForUpdate: CheckForUpdateService) {\n checkForUpdate.start();\n }\n\n}\n","import {\n Injectable,\n NgModule,\n} from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LogUpdateService {\n\n constructor(private readonly updates: SwUpdate) {\n }\n\n public start() {\n console.debug('start log update');\n this.updates.available.subscribe(event => {\n console.log('current version is', event.current);\n console.log('available version is', event.available);\n });\n this.updates.activated.subscribe(event => {\n console.log('old version was', event.previous);\n console.log('new version is', event.current);\n });\n }\n\n}\n\n@NgModule({})\nexport class LogUpdateModule {\n\n constructor(logUpdate: LogUpdateService) {\n logUpdate.start();\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { LogUpdateModule } from './log-update.service';\nimport { CheckForUpdateModule } from './check-for-update.service';\nimport { PromptUpdateModule } from './prompt-update/prompt-update.component.module';\n\n@NgModule({\n exports: [\n LogUpdateModule,\n CheckForUpdateModule,\n PromptUpdateModule,\n ],\n})\nexport class ServiceWorkerPromptUpdateModule {}\n","import {\n Inject,\n Injectable,\n NgModule,\n} from '@angular/core';\nimport {\n SwUpdate,\n UpdateAvailableEvent,\n} from '@angular/service-worker';\nimport {\n concatMap,\n tap,\n} from 'rxjs/operators';\nimport { Observable } from 'rxjs';\nimport {\n MatSnackBar,\n MatSnackBarModule,\n} from '@angular/material/snack-bar';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SnackBarUpdateService {\n constructor(\n @Inject(MatSnackBar)\n private readonly snackBar: MatSnackBar,\n @Inject(SwUpdate)\n private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n console.debug('start prompt update');\n this.updates.available\n .pipe(\n concatMap((event) => this.openSnackBar(event)),\n tap(() => console.log('start app update')),\n tap(() =>\n this.updates.activateUpdate().then(() => {\n console.log('app update completed. Reload app.');\n document.location.reload();\n }),\n ),\n )\n .subscribe();\n }\n\n private openSnackBar(event: UpdateAvailableEvent): Observable<void> {\n const snackBarRef = this.snackBar.open('New update available', 'update', {\n duration: 25 * 1000,\n data: event,\n });\n\n return snackBarRef.onAction();\n }\n}\n\n@NgModule({\n exports: [ MatSnackBarModule ],\n})\nexport class SnackBarUpdateServiceModule {\n constructor(\n @Inject(SnackBarUpdateService)\n snackBarUpdate: SnackBarUpdateService,\n ) {\n snackBarUpdate.start();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { SnackBarUpdateServiceModule } from './snack-bar-update.service';\nimport { LogUpdateModule } from './log-update.service';\nimport { CheckForUpdateModule } from './check-for-update.service';\n\n@NgModule({\n exports: [\n LogUpdateModule,\n CheckForUpdateModule,\n SnackBarUpdateServiceModule,\n ],\n})\nexport class ServiceWorkerSnackBarUpdateModule {}\n","import { Environment } from '@rxap/environment';\n\nexport function UnregisterServiceWorker(environment: Environment) {\n if (!environment.serviceWorker) {\n navigator?.serviceWorker?.getRegistrations().then(async (registrations) => {\n await Promise.all(registrations.map((registration) => {\n console.log('unregister service worker: ' + registration.scope);\n return registration.unregister();\n }));\n if (registrations.length) {\n const response = confirm(\n 'All dangling service worker are unregistered. Should the application be reloaded to complete the migration');\n if (response) {\n location.reload();\n }\n }\n });\n }\n}\n","// region prompt-update\nexport * from './lib/prompt-update/prompt-update.component.module';\nexport * from './lib/prompt-update/prompt-update.component';\nexport * from './lib/prompt-update/prompt-update.service';\n// endregion\n\n// region dialog service-worker-update-dialog\nexport * from './lib/dialog/service-worker-update-dialog/service-worker-update-dialog.component';\n// endregion\n\n// region dialog\nexport * from './lib/dialog/dialog-update.service';\nexport * from './lib/dialog/provide-service-worker-update-dialog';\n// endregion\n\n// region \nexport * from './lib/check-for-update.service';\nexport * from './lib/log-update.service';\nexport * from './lib/service-worker-prompt-update.module';\nexport * from './lib/service-worker-snack-bar-update.module';\nexport * from './lib/snack-bar-update.service';\nexport * from './lib/unregister-service-worker';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.PromptUpdateService","i1"],"mappings":";;;;;;;;;;;;;;;;;;;;MAuCa,qBAAqB,CAAA;AAClB,IAAA,SAAA,IAAA,CAAA,cAAc,GAAG,IAAI,GAAG,EAAE,GAAG,GAAG,CAAC,EAAA;AAM/C,IAAA,WAAA,CAC2C,KAA2B,EAEnD,SAAgC,EAEhC,SAA2B,EAAA;QAJH,IAAK,CAAA,KAAA,GAAL,KAAK,CAAsB;QAEnD,I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kBAP7C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,eAAe;wBACf,oBAAoB;wBACpB,2BAA2B;AAC5B,qBAAA;AACF,iBAAA,CAAA;;;ACTK,SAAU,uBAAuB,CAAC,WAAwB,EAAA;AAC9D,IAAA,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;AAC9B,QAAA,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC,IAAI,CAAC,OAAO,aAAa,KAAI;YACxE,MAAM,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,KAAI;gBACnD,OAAO,CAAC,GAAG,CAAC,6BAA6B,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;AAChE,gBAAA,OAAO,YAAY,CAAC,UAAU,EAAE,CAAC;aAClC,CAAC,CAAC,CAAC;YACJ,IAAI,aAAa,CAAC,MAAM,EAAE;AACxB,gBAAA,MAAM,QAAQ,GAAG,OAAO,CACtB,4GAA4G,CAAC,CAAC;AAChH,gBAAA,IAAI,QAAQ,EAAE;oBACZ,QAAQ,CAAC,MAAM,EAAE,CAAC;AACnB,iBAAA;AACF,aAAA;AACH,SAAC,CAAC,CAAC;AACJ,KAAA;AACH;;AClBA;AAsBA;;ACtBA;;AAEG;;;;"}
1
+ {"version":3,"file":"rxap-service-worker.mjs","sources":["../../../../../packages/angular/service-worker/src/lib/service-worker-update-dialog/service-worker-update-dialog.component.ts","../../../../../packages/angular/service-worker/src/lib/service-worker-update-dialog/service-worker-update-dialog.component.html","../../../../../packages/angular/service-worker/src/lib/check-for-update.service.ts","../../../../../packages/angular/service-worker/src/lib/dialog-update.service.ts","../../../../../packages/angular/service-worker/src/lib/log-update.service.ts","../../../../../packages/angular/service-worker/src/lib/provide-service-worker-updater.ts","../../../../../packages/angular/service-worker/src/lib/unregister-service-worker.ts","../../../../../packages/angular/service-worker/src/index.ts","../../../../../packages/angular/service-worker/src/rxap-service-worker.ts"],"sourcesContent":["import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n inject,\n InjectionToken,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { UpdateAvailableEvent } from '@angular/service-worker';\n\nexport const UPDATE_AVAILABLE_EVENT = new InjectionToken<UpdateAvailableEvent>('UPDATE_AVAILABLE_EVENT');\n\n@Component({\n selector: 'rxap-service-worker-update-dialog',\n standalone: true,\n imports: [],\n templateUrl: './service-worker-update-dialog.component.html',\n styleUrls: [ './service-worker-update-dialog.component.scss' ],\n})\nexport class ServiceWorkerUpdateDialogComponent implements AfterViewInit {\n\n @ViewChild('dialog', { static: true })\n public dialog!: ElementRef<HTMLDialogElement>;\n\n @Output()\n public closeDialog = new EventEmitter<void>();\n\n public readonly updateAvailableEvent = inject(UPDATE_AVAILABLE_EVENT);\n\n ngAfterViewInit() {\n this.dialog.nativeElement.showModal();\n }\n\n close() {\n this.dialog.nativeElement.close();\n this.closeDialog.emit();\n }\n\n}\n","<dialog #dialog\n class=\"max-w-6xl rounded overflow-auto drop-shadow-2xl dark:bg-black dark:text-white flex flex-col gap-3 p-6\">\n <h2 class=\"text-2xl font-bold\" i18n>A new application version is available</h2>\n <table class=\"table-auto\">\n <tr>\n <th>Current version hash</th>\n <td>{{updateAvailableEvent.current.hash}}</td>\n </tr>\n <tr>\n <th>New version hash</th>\n <td>{{updateAvailableEvent.available.hash}}</td>\n </tr>\n </table>\n <button (click)=\"close()\" class=\"px-4 py-2 rounded bg-primary-500\" i18n>Update</button>\n</dialog>\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport { LifeCycleService } from '@rxap/life-cycle';\nimport { interval } from 'rxjs';\nimport {\n startWith,\n tap,\n} from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CheckForUpdateService {\n\n private _started = false;\n\n constructor(\n @Inject(LifeCycleService) private readonly lifeCycle: LifeCycleService,\n @Inject(SwUpdate) private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n if (this._started) {\n console.warn('check for update already started');\n return;\n }\n this._started = true;\n if (this.updates.isEnabled) {\n\n console.debug('start check for update');\n\n this.updates.checkForUpdate();\n\n this\n .lifeCycle\n .whenReady(() => interval(15 * 60 * 1000)\n .pipe(\n startWith(null),\n tap(() => console.log('check for update')),\n tap(() => this.updates.checkForUpdate()),\n ),\n )\n .subscribe();\n\n } else {\n console.warn('service worker updates are not enabled');\n }\n }\n\n}\n","import {\n ApplicationRef,\n createComponent,\n Inject,\n Injectable,\n Injector,\n} from '@angular/core';\nimport {\n SwUpdate,\n UpdateAvailableEvent,\n} from '@angular/service-worker';\nimport { ErrorDialogComponent } from '@rxap/ngx-error';\nimport { Observable } from 'rxjs';\nimport {\n concatMap,\n tap,\n} from 'rxjs/operators';\nimport { UPDATE_AVAILABLE_EVENT } from './service-worker-update-dialog/service-worker-update-dialog.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DialogUpdateService {\n constructor(\n @Inject(ApplicationRef)\n private readonly applicationRef: ApplicationRef,\n @Inject(SwUpdate)\n private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n console.debug('start dialog update service');\n this.updates.available\n .pipe(\n concatMap((event) => this.openUpdateDialog(event)),\n tap(() => console.log('start app update')),\n tap(() =>\n this.updates.activateUpdate().then(() => {\n console.log('app update completed. Reload app.');\n document.location.reload();\n }),\n ),\n )\n .subscribe();\n }\n\n private openUpdateDialog(event: UpdateAvailableEvent): Observable<void> {\n console.debug('open update dialog');\n const body = document.getElementsByTagName('body')[0];\n const div = document.createElement('div');\n body.appendChild(div);\n const componentRef = createComponent(ErrorDialogComponent, {\n hostElement: div,\n environmentInjector: this.applicationRef.injector,\n elementInjector: Injector.create({\n providers: [\n {\n provide: UPDATE_AVAILABLE_EVENT,\n useValue: event,\n },\n ],\n }),\n });\n this.applicationRef.attachView(componentRef.hostView);\n\n return componentRef.instance.closeDialog.pipe(\n tap(() => {\n componentRef.destroy();\n body.removeChild(div);\n div.remove();\n }),\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LogUpdateService {\n\n constructor(private readonly updates: SwUpdate) {\n }\n\n public start() {\n console.debug('start log update');\n this.updates.available.subscribe(event => {\n console.log('current version is', event.current);\n console.log('available version is', event.available);\n });\n this.updates.activated.subscribe(event => {\n console.log('old version was', event.previous);\n console.log('new version is', event.current);\n });\n }\n\n}\n\n","import {\n APP_INITIALIZER,\n Provider,\n} from '@angular/core';\nimport { CheckForUpdateService } from './check-for-update.service';\nimport { DialogUpdateService } from './dialog-update.service';\nimport { LogUpdateService } from './log-update.service';\n\nexport function ProvideServiceWorkerUpdater(...providers: Provider[]): Provider[] {\n return [\n {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: (checkForUpdate: CheckForUpdateService) => () => checkForUpdate.start(),\n deps: [ CheckForUpdateService ],\n },\n ...providers,\n ];\n}\n\nexport function withLogUpdater(): Provider {\n return {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: (logUpdateService: LogUpdateService) => () => logUpdateService.start(),\n deps: [ LogUpdateService ],\n };\n}\n\nexport function withDialogUpdater(): Provider {\n return {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: (dus: DialogUpdateService) => () => dus.start(),\n deps: [ DialogUpdateService ],\n };\n}\n","import { Environment } from '@rxap/environment';\n\nexport function UnregisterServiceWorker(environment: Environment) {\n if (!environment.serviceWorker) {\n navigator?.serviceWorker?.getRegistrations().then(async (registrations) => {\n await Promise.all(registrations.map((registration) => {\n console.log('unregister service worker: ' + registration.scope);\n return registration.unregister();\n }));\n if (registrations.length) {\n const response = confirm(\n 'All dangling service worker are unregistered. Should the application be reloaded to complete the migration');\n if (response) {\n location.reload();\n }\n }\n });\n }\n}\n","// region service-worker-update-dialog\nexport * from './lib/service-worker-update-dialog/service-worker-update-dialog.component';\n// endregion\n\n// region \nexport * from './lib/check-for-update.service';\nexport * from './lib/dialog-update.service';\nexport * from './lib/log-update.service';\nexport * from './lib/provide-service-worker-updater';\nexport * from './lib/unregister-service-worker';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;MAYa,sBAAsB,GAAG,IAAI,cAAc,CAAuB,wBAAwB,EAAE;MAS5F,kCAAkC,CAAA;AAP/C,IAAA,WAAA,GAAA;AAaS,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,YAAY,EAAQ,CAAC;AAE9B,QAAA,IAAA,CAAA,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAWvE,KAAA;IATC,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;KACvC;IAED,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;AAClC,QAAA,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;KACzB;8GAjBU,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAlC,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,kCAAkC,sPCrB/C,slBAeA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;2FDMa,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAP9C,SAAS;+BACE,mCAAmC,EAAA,UAAA,EACjC,IAAI,EAAA,OAAA,EACP,EAAE,EAAA,QAAA,EAAA,slBAAA,EAAA,CAAA;8BAOJ,MAAM,EAAA,CAAA;sBADZ,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,QAAQ,EAAE,EAAE,MAAM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AA,OAAO,YAAY,CAAC,UAAU,EAAE,CAAC;aAClC,CAAC,CAAC,CAAC;YACJ,IAAI,aAAa,CAAC,MAAM,EAAE;AACxB,gBAAA,MAAM,QAAQ,GAAG,OAAO,CACtB,4GAA4G,CAAC,CAAC;AAChH,gBAAA,IAAI,QAAQ,EAAE;oBACZ,QAAQ,CAAC,MAAM,EAAE,CAAC;AACnB,iBAAA;AACF,aAAA;AACH,SAAC,CAAC,CAAC;AACJ,KAAA;AACH;;AClBA;AAUA;;ACVA;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,12 +1,6 @@
1
- export * from './lib/prompt-update/prompt-update.component.module';
2
- export * from './lib/prompt-update/prompt-update.component';
3
- export * from './lib/prompt-update/prompt-update.service';
4
- export * from './lib/dialog/service-worker-update-dialog/service-worker-update-dialog.component';
5
- export * from './lib/dialog/dialog-update.service';
6
- export * from './lib/dialog/provide-service-worker-update-dialog';
1
+ export * from './lib/service-worker-update-dialog/service-worker-update-dialog.component';
7
2
  export * from './lib/check-for-update.service';
3
+ export * from './lib/dialog-update.service';
8
4
  export * from './lib/log-update.service';
9
- export * from './lib/service-worker-prompt-update.module';
10
- export * from './lib/service-worker-snack-bar-update.module';
11
- export * from './lib/snack-bar-update.service';
5
+ export * from './lib/provide-service-worker-updater';
12
6
  export * from './lib/unregister-service-worker';
@@ -4,14 +4,9 @@ import * as i0 from "@angular/core";
4
4
  export declare class CheckForUpdateService {
5
5
  private readonly lifeCycle;
6
6
  private readonly updates;
7
+ private _started;
7
8
  constructor(lifeCycle: LifeCycleService, updates: SwUpdate);
8
9
  start(): void;
9
10
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckForUpdateService, never>;
10
11
  static ɵprov: i0.ɵɵInjectableDeclaration<CheckForUpdateService>;
11
12
  }
12
- export declare class CheckForUpdateModule {
13
- constructor(checkForUpdate: CheckForUpdateService);
14
- static ɵfac: i0.ɵɵFactoryDeclaration<CheckForUpdateModule, never>;
15
- static ɵmod: i0.ɵɵNgModuleDeclaration<CheckForUpdateModule, never, never, never>;
16
- static ɵinj: i0.ɵɵInjectorDeclaration<CheckForUpdateModule>;
17
- }
@@ -7,9 +7,3 @@ export declare class LogUpdateService {
7
7
  static ɵfac: i0.ɵɵFactoryDeclaration<LogUpdateService, never>;
8
8
  static ɵprov: i0.ɵɵInjectableDeclaration<LogUpdateService>;
9
9
  }
10
- export declare class LogUpdateModule {
11
- constructor(logUpdate: LogUpdateService);
12
- static ɵfac: i0.ɵɵFactoryDeclaration<LogUpdateModule, never>;
13
- static ɵmod: i0.ɵɵNgModuleDeclaration<LogUpdateModule, never, never, never>;
14
- static ɵinj: i0.ɵɵInjectorDeclaration<LogUpdateModule>;
15
- }
@@ -0,0 +1,4 @@
1
+ import { Provider } from '@angular/core';
2
+ export declare function ProvideServiceWorkerUpdater(...providers: Provider[]): Provider[];
3
+ export declare function withLogUpdater(): Provider;
4
+ export declare function withDialogUpdater(): Provider;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "16.0.0-dev.17",
2
+ "version": "16.0.0-dev.19",
3
3
  "name": "@rxap/service-worker",
4
4
  "license": "GPL-3.0-or-later",
5
5
  "dependencies": {
@@ -7,11 +7,10 @@
7
7
  },
8
8
  "peerDependencies": {
9
9
  "@angular/core": "^16.1.4",
10
- "@angular/material": "^16.1.4",
11
10
  "@angular/service-worker": "^16.1.4",
12
11
  "@rxap/environment": "^16.0.0-dev.15",
13
12
  "@rxap/life-cycle": "^16.0.0-dev.14",
14
- "@rxap/ngx-error": "^16.0.1-dev.4",
13
+ "@rxap/ngx-error": "^16.1.0-dev.1",
15
14
  "rxjs": "^7.8.0"
16
15
  },
17
16
  "author": {
@@ -43,7 +42,7 @@
43
42
  },
44
43
  {
45
44
  "package": "@rxap/ngx-error",
46
- "version": "16.0.1-dev.4"
45
+ "version": "16.1.0-dev.1"
47
46
  }
48
47
  ]
49
48
  },
@@ -57,7 +56,7 @@
57
56
  "directory": "packages/angular/service-worker"
58
57
  },
59
58
  "sideEffects": false,
60
- "gitHead": "846a620a91a0612c991d8f3a8ef5893a2a0a292f",
59
+ "gitHead": "4f7e75289cf13b73132a75df8a92a64c4752192f",
61
60
  "module": "fesm2022/rxap-service-worker.mjs",
62
61
  "typings": "index.d.ts",
63
62
  "exports": {
package/theme.css CHANGED
@@ -1 +1 @@
1
- .container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.mt-4{margin-top:1rem}.block{display:block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-20{height:5rem}.w-full{width:100%}.max-w-6xl{max-width:72rem}.grow-0{flex-grow:0}.table-auto{table-layout:auto}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-6{row-gap:1.5rem}.gap-y-8{row-gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem*var(--tw-space-x-reverse));margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)))}.overflow-auto{overflow:auto}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.bg-accent-500{background-color:var(--accent-500)}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-primary-500{background-color:var(--primary-500)}.p-10{padding:2.5rem}.p-6{padding:1.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-8{padding-left:2rem}.pr-4{padding-right:1rem}.pt-8{padding-top:2rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity))}.text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.drop-shadow-2xl{--tw-drop-shadow:drop-shadow(0 25px 25px #00000026)}.drop-shadow-2xl,.invert{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-colors{transition-duration:.15s}.hover\:bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity))}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:is(.dark .dark\:bg-black){--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-800){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}:is(.dark .dark\:text-black){--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .dark\:hover\:bg-gray-900:hover){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}
1
+ .container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.mt-4{margin-top:1rem}.block{display:block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-20{height:5rem}.w-full{width:100%}.max-w-6xl{max-width:72rem}.grow-0{flex-grow:0}.table-auto{table-layout:auto}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-6{row-gap:1.5rem}.gap-y-8{row-gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem*var(--tw-space-x-reverse));margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)))}.overflow-auto{overflow:auto}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.bg-accent-500{background-color:var(--accent-500)}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-primary-500{background-color:var(--primary-500)}.p-10{padding:2.5rem}.p-6{padding:1.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pl-8{padding-left:2rem}.pr-4{padding-right:1rem}.pt-8{padding-top:2rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity))}.text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.drop-shadow-2xl{--tw-drop-shadow:drop-shadow(0 25px 25px #00000026)}.drop-shadow-2xl,.invert{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-colors{transition-duration:.15s}.hover\:bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity))}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:is(.dark .dark\:bg-black){--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-800){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}:is(.dark .dark\:text-black){--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .dark\:hover\:bg-gray-900:hover){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}