@softpak/components 19.1.0-beta.3 → 19.1.0-beta.5

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/fesm2022/softpak-components-spx-helpers.mjs +9 -1
  2. package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -1
  3. package/fesm2022/softpak-components-spx-translate.mjs +34 -0
  4. package/fesm2022/softpak-components-spx-translate.mjs.map +1 -0
  5. package/fesm2022/softpak-components-spx-update.mjs +336 -111
  6. package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
  7. package/package.json +21 -21
  8. package/spx-helpers/public-api.d.ts +1 -0
  9. package/spx-helpers/unsubscribe-subscriptions.function.d.ts +1 -0
  10. package/{spx-app-update → spx-translate}/index.d.ts +1 -1
  11. package/spx-translate/public-api.d.ts +3 -0
  12. package/spx-translate/spx-translate._const.d.ts +16 -0
  13. package/spx-translate/spx-translate.en.d.ts +2 -0
  14. package/spx-translate/spx-translate.nl.d.ts +2 -0
  15. package/spx-update/public-api.d.ts +12 -2
  16. package/spx-update/spx-upd-page.component.d.ts +16 -0
  17. package/spx-update/spx-upd-pending.component.d.ts +28 -0
  18. package/spx-update/store/upd-pending/upd-pending.effects.d.ts +10 -0
  19. package/spx-update/store/upd-pending/upd-pending.initial.d.ts +2 -0
  20. package/spx-update/store/upd-pending/upd-pending.reducer.d.ts +9 -0
  21. package/spx-update/store/upd-pending/upd-pending.state.d.ts +4 -0
  22. package/tailwind.css +1 -1
  23. package/fesm2022/softpak-components-spx-app-update.mjs +0 -504
  24. package/fesm2022/softpak-components-spx-app-update.mjs.map +0 -1
  25. package/spx-app-update/public-api.d.ts +0 -6
  26. package/spx-app-update/spx-app-update.component.d.ts +0 -49
  27. package/spx-update/src/spx-update-info.component.d.ts +0 -18
  28. package/spx-update/src/spx-update-progress.component.d.ts +0 -14
  29. /package/{spx-app-update → spx-update}/store/upd-check/upd-check.actions.d.ts +0 -0
  30. /package/{spx-app-update → spx-update}/store/upd-check/upd-check.effects.d.ts +0 -0
  31. /package/{spx-app-update → spx-update}/store/upd-check/upd-check.initial.d.ts +0 -0
  32. /package/{spx-app-update → spx-update}/store/upd-check/upd-check.reducer.d.ts +0 -0
  33. /package/{spx-app-update → spx-update}/store/upd-check/upd-check.state.d.ts +0 -0
  34. /package/{spx-app-update → spx-update}/store/upd-pending/upd-pending.actions.d.ts +0 -0
@@ -29,6 +29,14 @@ var SpxSeverityEnum;
29
29
  SpxSeverityEnum["primary"] = "primary";
30
30
  })(SpxSeverityEnum || (SpxSeverityEnum = {}));
31
31
 
32
+ function unsubscribeSubscriptions(subscriptionObject) {
33
+ for (const key in subscriptionObject) {
34
+ if (subscriptionObject[key]) {
35
+ subscriptionObject[key].unsubscribe();
36
+ }
37
+ }
38
+ }
39
+
32
40
  const valuePairToValue = (pair) => {
33
41
  if (pair === null || (typeof pair === 'object' && pair.value === undefined)) {
34
42
  return null;
@@ -40,5 +48,5 @@ const valuePairToValue = (pair) => {
40
48
  * Generated bundle index. Do not edit.
41
49
  */
42
50
 
43
- export { SpxSeverityEnum, calcCheckDigit, valuePairToValue };
51
+ export { SpxSeverityEnum, calcCheckDigit, unsubscribeSubscriptions, valuePairToValue };
44
52
  //# sourceMappingURL=softpak-components-spx-helpers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-helpers.mjs","sources":["../../../../projects/softpak/components/spx-helpers/calc-check-digit.function.ts","../../../../projects/softpak/components/spx-helpers/spx-severity.enum.ts","../../../../projects/softpak/components/spx-helpers/value-pair-to-value.function.ts","../../../../projects/softpak/components/spx-helpers/softpak-components-spx-helpers.ts"],"sourcesContent":["export const calcCheckDigit = (container: string): string => {\n container = container.toUpperCase();\n\n const mapping = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n A: 10, B: 12, C: 13, D: 14, E: 15, F: 16, G: 17, H: 18, I: 19, J: 20, K: 21, L: 23, M: 24,\n N: 25, O: 26, P: 27, Q: 28, R: 29, S: 30, T: 31, U: 32, V: 34, W: 35, X: 36, Y: 37, Z: 38\n };\n\n let total = 0;\n\n for (let i = 0; i < container.length; i++) {\n const cChar = container.substr(i, 1);\n const value = (mapping as any)[cChar];\n const multiplier = Math.pow(2, i);\n total = total + (value * multiplier);\n }\n\n let outcome = total % 11;\n if (outcome === 10) {\n outcome = 0;\n }\n\n return outcome.toString();\n}\n","export enum SpxSeverityEnum {\n error = 'error',\n info = 'info',\n success = 'success',\n unknown = 'unknown',\n warning = 'warning',\n primary = 'primary',\n}\n","export const valuePairToValue = (pair: any) => {\n if (pair === null || (typeof pair === 'object' && pair.value === undefined)) {\n return null;\n }\n return pair?.value || pair?.value === false || pair?.value === null || pair?.value === '' || pair?.value === 0 ? pair?.value : pair;\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAa,MAAA,cAAc,GAAG,CAAC,SAAiB,KAAY;AAC1D,IAAA,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE;AAEnC,IAAA,MAAM,OAAO,GAAG;AACd,QAAA,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC1D,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE;QACzF,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE;KACxF;IAED,IAAI,KAAK,GAAG,CAAC;AAEb,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACzC,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;AACpC,QAAA,MAAM,KAAK,GAAI,OAAe,CAAC,KAAK,CAAC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACjC,KAAK,GAAG,KAAK,IAAI,KAAK,GAAG,UAAU,CAAC;;AAGtC,IAAA,IAAI,OAAO,GAAG,KAAK,GAAG,EAAE;AACxB,IAAA,IAAI,OAAO,KAAK,EAAE,EAAE;QAClB,OAAO,GAAG,CAAC;;AAGb,IAAA,OAAO,OAAO,CAAC,QAAQ,EAAE;AAC3B;;ICxBY;AAAZ,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,eAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EAPW,eAAe,KAAf,eAAe,GAO1B,EAAA,CAAA,CAAA;;ACPY,MAAA,gBAAgB,GAAG,CAAC,IAAS,KAAI;AAC1C,IAAA,IAAI,IAAI,KAAK,IAAI,KAAK,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE;AACzE,QAAA,OAAO,IAAI;;AAEf,IAAA,OAAO,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,IAAI,IAAI,IAAI,EAAE,KAAK,KAAK,EAAE,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,IAAI,EAAE,KAAK,GAAG,IAAI;AACvI;;ACLA;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-helpers.mjs","sources":["../../../../projects/softpak/components/spx-helpers/calc-check-digit.function.ts","../../../../projects/softpak/components/spx-helpers/spx-severity.enum.ts","../../../../projects/softpak/components/spx-helpers/unsubscribe-subscriptions.function.ts","../../../../projects/softpak/components/spx-helpers/value-pair-to-value.function.ts","../../../../projects/softpak/components/spx-helpers/softpak-components-spx-helpers.ts"],"sourcesContent":["export const calcCheckDigit = (container: string): string => {\n container = container.toUpperCase();\n\n const mapping = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n A: 10, B: 12, C: 13, D: 14, E: 15, F: 16, G: 17, H: 18, I: 19, J: 20, K: 21, L: 23, M: 24,\n N: 25, O: 26, P: 27, Q: 28, R: 29, S: 30, T: 31, U: 32, V: 34, W: 35, X: 36, Y: 37, Z: 38\n };\n\n let total = 0;\n\n for (let i = 0; i < container.length; i++) {\n const cChar = container.substr(i, 1);\n const value = (mapping as any)[cChar];\n const multiplier = Math.pow(2, i);\n total = total + (value * multiplier);\n }\n\n let outcome = total % 11;\n if (outcome === 10) {\n outcome = 0;\n }\n\n return outcome.toString();\n}\n","export enum SpxSeverityEnum {\n error = 'error',\n info = 'info',\n success = 'success',\n unknown = 'unknown',\n warning = 'warning',\n primary = 'primary',\n}\n","import { Subscription } from \"rxjs\";\n\nexport function unsubscribeSubscriptions(subscriptionObject: object): void {\n for (const key in subscriptionObject) {\n if ((subscriptionObject as any)[key]) {\n ((subscriptionObject as any)[key] as Subscription).unsubscribe();\n }\n }\n}","export const valuePairToValue = (pair: any) => {\n if (pair === null || (typeof pair === 'object' && pair.value === undefined)) {\n return null;\n }\n return pair?.value || pair?.value === false || pair?.value === null || pair?.value === '' || pair?.value === 0 ? pair?.value : pair;\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,34 @@
1
+ const spxTextCheckingForUpdates = 'spxTextCheckingForUpdates';
2
+ const spxTextOneMomentPlease = 'spxTextOneMomentPlease';
3
+ const spxTextPatchAvailable = 'spxTextPatchAvailable';
4
+ const spxTextUpdateAvailable = 'spxTextUpdateAvailable';
5
+ const spxTextReadyToBeInstalled = 'spxTextReadyToBeInstalled';
6
+ const spxTextUpdate = 'spxTextUpdate';
7
+ const spxTextOpenAppStore = 'spxTextOpenAppStore';
8
+
9
+ const SpxTranslateEn = {
10
+ [spxTextCheckingForUpdates]: 'checking for updates',
11
+ [spxTextOneMomentPlease]: 'one moment please',
12
+ [spxTextReadyToBeInstalled]: 'ready to be installed',
13
+ [spxTextPatchAvailable]: 'patch available',
14
+ [spxTextUpdateAvailable]: 'update available',
15
+ [spxTextUpdate]: 'update',
16
+ [spxTextOpenAppStore]: 'open app store',
17
+ };
18
+
19
+ const SpxTranslateNl = {
20
+ [spxTextCheckingForUpdates]: 'controleren op updates',
21
+ [spxTextOneMomentPlease]: 'een moment geduld alstublieft',
22
+ [spxTextReadyToBeInstalled]: 'ready to be installed',
23
+ [spxTextPatchAvailable]: 'patch available',
24
+ [spxTextUpdateAvailable]: 'update available',
25
+ [spxTextUpdate]: 'updaten',
26
+ [spxTextOpenAppStore]: 'open app store',
27
+ };
28
+
29
+ /**
30
+ * Generated bundle index. Do not edit.
31
+ */
32
+
33
+ export { SpxTranslateEn, SpxTranslateNl, spxTextCheckingForUpdates, spxTextOneMomentPlease, spxTextOpenAppStore, spxTextPatchAvailable, spxTextReadyToBeInstalled, spxTextUpdate, spxTextUpdateAvailable };
34
+ //# sourceMappingURL=softpak-components-spx-translate.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"softpak-components-spx-translate.mjs","sources":["../../../../projects/softpak/components/spx-translate/spx-translate._const.ts","../../../../projects/softpak/components/spx-translate/spx-translate.en.ts","../../../../projects/softpak/components/spx-translate/spx-translate.nl.ts","../../../../projects/softpak/components/spx-translate/softpak-components-spx-translate.ts"],"sourcesContent":["export const spxTextCheckingForUpdates = 'spxTextCheckingForUpdates';\nexport const spxTextOneMomentPlease = 'spxTextOneMomentPlease';\nexport const spxTextPatchAvailable = 'spxTextPatchAvailable';\nexport const spxTextUpdateAvailable = 'spxTextUpdateAvailable';\nexport const spxTextReadyToBeInstalled = 'spxTextReadyToBeInstalled';\nexport const spxTextUpdate = 'spxTextUpdate';\nexport const spxTextOpenAppStore = 'spxTextOpenAppStore';\n\nexport interface SpxTranslateI {\n [spxTextCheckingForUpdates]: string;\n [spxTextOneMomentPlease]: string;\n [spxTextPatchAvailable]: string;\n [spxTextUpdateAvailable]: string;\n [spxTextReadyToBeInstalled]: string;\n [spxTextUpdate]: string;\n [spxTextOpenAppStore]: string;\n}\n","import { spxTextCheckingForUpdates, spxTextOneMomentPlease, spxTextOpenAppStore, spxTextPatchAvailable, spxTextReadyToBeInstalled, spxTextUpdate, spxTextUpdateAvailable, SpxTranslateI } from \"./spx-translate._const\";\n\nexport const SpxTranslateEn: SpxTranslateI = {\n [spxTextCheckingForUpdates]: 'checking for updates',\n [spxTextOneMomentPlease]: 'one moment please',\n [spxTextReadyToBeInstalled]: 'ready to be installed',\n [spxTextPatchAvailable]: 'patch available',\n [spxTextUpdateAvailable]: 'update available',\n [spxTextUpdate]: 'update',\n [spxTextOpenAppStore]: 'open app store',\n}\n","import { spxTextCheckingForUpdates, spxTextOneMomentPlease, spxTextOpenAppStore, spxTextPatchAvailable, spxTextReadyToBeInstalled, spxTextUpdate, spxTextUpdateAvailable, SpxTranslateI } from \"./spx-translate._const\";\n\nexport const SpxTranslateNl: SpxTranslateI = {\n [spxTextCheckingForUpdates]: 'controleren op updates',\n [spxTextOneMomentPlease]: 'een moment geduld alstublieft',\n [spxTextReadyToBeInstalled]: 'ready to be installed',\n [spxTextPatchAvailable]: 'patch available',\n [spxTextUpdateAvailable]: 'update available',\n [spxTextUpdate]: 'updaten',\n [spxTextOpenAppStore]: 'open app store',\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAO,MAAM,yBAAyB,GAAG;AAClC,MAAM,sBAAsB,GAAG;AAC/B,MAAM,qBAAqB,GAAG;AAC9B,MAAM,sBAAsB,GAAG;AAC/B,MAAM,yBAAyB,GAAG;AAClC,MAAM,aAAa,GAAG;AACtB,MAAM,mBAAmB,GAAG;;ACJtB,MAAA,cAAc,GAAkB;IAC3C,CAAC,yBAAyB,GAAG,sBAAsB;IACnD,CAAC,sBAAsB,GAAG,mBAAmB;IAC7C,CAAC,yBAAyB,GAAG,uBAAuB;IACpD,CAAC,qBAAqB,GAAG,iBAAiB;IAC1C,CAAC,sBAAsB,GAAG,kBAAkB;IAC5C,CAAC,aAAa,GAAG,QAAQ;IACzB,CAAC,mBAAmB,GAAG,gBAAgB;;;ACP5B,MAAA,cAAc,GAAkB;IAC3C,CAAC,yBAAyB,GAAG,wBAAwB;IACrD,CAAC,sBAAsB,GAAG,+BAA+B;IACzD,CAAC,yBAAyB,GAAG,uBAAuB;IACpD,CAAC,qBAAqB,GAAG,iBAAiB;IAC1C,CAAC,sBAAsB,GAAG,kBAAkB;IAC5C,CAAC,aAAa,GAAG,SAAS;IAC1B,CAAC,mBAAmB,GAAG,gBAAgB;;;ACTzC;;AAEG;;;;"}
@@ -1,134 +1,359 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, Input } from '@angular/core';
3
- import * as i1 from '@angular/forms';
4
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
2
+ import { Component, signal, computed, Injectable } from '@angular/core';
3
+ import { TranslatePipe } from '@ngx-translate/core';
4
+ import * as i2 from '@ionic/angular/standalone';
5
+ import { IonContent, IonHeader, IonToolbar, IonTitle } from '@ionic/angular/standalone';
6
+ import * as i1 from '@ngrx/store';
7
+ import { createAction, props, union, createFeature, createReducer, on } from '@ngrx/store';
8
+ import { DateTime } from 'luxon';
9
+ import { unsubscribeSubscriptions, SpxSeverityEnum } from '@softpak/components/spx-helpers';
5
10
  import { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';
6
- import { SpxInputComponent } from '@softpak/components/spx-inputs';
7
- import { SpxProgressBarComponent } from '@softpak/components/spx-progress-bar';
8
-
9
- const ctrlAppStoreVersion = 'appStoreVersion';
10
- const ctrlChannel = 'channel';
11
- const ctrlNextVersionNumber = 'nextVersionNumber';
12
- const ctrlVersionNumber = 'versionNumber';
13
- class SpxUpdateInfoComponent {
14
- get ctrlVersionNumber() { return this.form.get(ctrlVersionNumber); }
15
- get ctrlNextVersionNumber() { return this.form.get(ctrlNextVersionNumber); }
16
- get ctrlConfiguredChannel() { return this.form.get(ctrlChannel); }
17
- get ctrlAppStoreVersion() { return this.form.get(ctrlAppStoreVersion); }
18
- constructor(formBuilder) {
19
- this.formBuilder = formBuilder;
20
- this.form = this.formBuilder.group({
21
- [ctrlAppStoreVersion]: [null, []],
22
- [ctrlChannel]: [null, []],
23
- [ctrlNextVersionNumber]: [null, []],
24
- [ctrlVersionNumber]: [null, []],
11
+ import { spxTextCheckingForUpdates, spxTextOneMomentPlease, spxTextUpdate, spxTextReadyToBeInstalled, spxTextPatchAvailable, spxTextUpdateAvailable, spxTextOpenAppStore } from '@softpak/components/spx-translate';
12
+ import { AppUpdate } from '@capawesome/capacitor-app-update';
13
+ import { Capacitor } from '@capacitor/core';
14
+ import { SpxButtonComponent } from '@softpak/components/spx-button';
15
+ import * as i1$1 from '@ngrx/effects';
16
+ import { createEffect, ofType } from '@ngrx/effects';
17
+ import { from, of } from 'rxjs';
18
+ import { delay, mergeMap, tap, exhaustMap, map, catchError } from 'rxjs/operators';
19
+ import { getConfig, setConfig, sync, reload } from '@capacitor/live-updates';
20
+ import { captureMessage } from '@sentry/angular';
21
+
22
+ const anUpdateIsReady = createAction('[UPD / Check] An update is ready', props());
23
+ const clearError = createAction('[UPD / Check] Clear error', props());
24
+ const checkFailed = createAction('[UPD / Check] Error happened', props());
25
+ const initialize = createAction('[UPD / Check] Initialize', props());
26
+ const noUpdateWasFound = createAction('[UPD / Check] No update was found', props());
27
+ const notAvailableOnWeb = createAction('[UPD / Check] Not available on web', props());
28
+ const runCheck = createAction('[UPD / Check] Run', props());
29
+ const all$1 = union({
30
+ anUpdateIsReady,
31
+ clearError,
32
+ checkFailed,
33
+ initialize,
34
+ noUpdateWasFound,
35
+ notAvailableOnWeb,
36
+ runCheck,
37
+ });
38
+
39
+ var updCheck_actions = /*#__PURE__*/Object.freeze({
40
+ __proto__: null,
41
+ anUpdateIsReady: anUpdateIsReady,
42
+ checkFailed: checkFailed,
43
+ clearError: clearError,
44
+ initialize: initialize,
45
+ noUpdateWasFound: noUpdateWasFound,
46
+ notAvailableOnWeb: notAvailableOnWeb,
47
+ runCheck: runCheck
48
+ });
49
+
50
+ const initialState$1 = {
51
+ forceWaitForUpdate: false,
52
+ lastCheck: null,
53
+ showError: false,
54
+ };
55
+
56
+ var updCheck_initial = /*#__PURE__*/Object.freeze({
57
+ __proto__: null,
58
+ initialState: initialState$1
59
+ });
60
+
61
+ var updCheck = createFeature({
62
+ name: 'spxUpdCheck',
63
+ reducer: createReducer(initialState$1, on(anUpdateIsReady, (state) => {
64
+ return {
65
+ ...state,
66
+ lastCheck: DateTime.now().toISO(),
67
+ showError: false,
68
+ };
69
+ }), on(clearError, (state) => {
70
+ return {
71
+ ...state,
72
+ showError: false,
73
+ };
74
+ }), on(checkFailed, (state) => {
75
+ return {
76
+ ...state,
77
+ forceWaitForUpdate: false,
78
+ showError: true,
79
+ };
80
+ }), on(noUpdateWasFound, (state) => {
81
+ return {
82
+ ...state,
83
+ forceWaitForUpdate: false,
84
+ lastCheck: DateTime.now().toISO(),
85
+ showError: false,
86
+ };
87
+ }), on(runCheck, (state, { forceWaitForUpdate }) => {
88
+ return {
89
+ ...state,
90
+ forceWaitForUpdate: forceWaitForUpdate ? true : state.forceWaitForUpdate
91
+ };
92
+ }), on(notAvailableOnWeb, (state) => {
93
+ return {
94
+ ...state,
95
+ forceWaitForUpdate: false
96
+ };
97
+ })),
98
+ });
99
+
100
+ var updCheck_reducer = /*#__PURE__*/Object.freeze({
101
+ __proto__: null,
102
+ default: updCheck
103
+ });
104
+
105
+ class SpxUpdPageComponent {
106
+ ionViewDidEnter() {
107
+ this.appStore.dispatch(runCheck({ forceWaitForUpdate: true }));
108
+ this.subscriptions.updCheck = this.appStore.select(updCheck.selectForceWaitForUpdate).subscribe(forceWaitForUpdate => {
109
+ if (forceWaitForUpdate === false) {
110
+ this.navController.navigateRoot([this.spxHomeUrl], {
111
+ animated: true,
112
+ animationDirection: 'forward'
113
+ });
114
+ }
25
115
  });
26
116
  }
27
- update(appStoreVersion, channel, nextVersion, version) {
28
- this.ctrlVersionNumber.setValue({
29
- value: version,
30
- });
31
- this.ctrlNextVersionNumber.setValue({
32
- value: nextVersion,
33
- });
34
- this.ctrlConfiguredChannel.setValue({
35
- value: channel,
36
- });
37
- this.ctrlAppStoreVersion.setValue({
38
- value: appStoreVersion,
39
- });
117
+ ionViewWillLeave() {
118
+ unsubscribeSubscriptions(this.subscriptions);
119
+ }
120
+ constructor(appStore, navController) {
121
+ this.appStore = appStore;
122
+ this.navController = navController;
123
+ this.spxHomeUrl = ''; // OVERWRITE IN APP
124
+ this.spxTextCheckingForUpdates = spxTextCheckingForUpdates;
125
+ this.spxTextOneMomentPlease = spxTextOneMomentPlease;
126
+ this.subscriptions = {};
40
127
  }
41
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxUpdateInfoComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
42
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: SpxUpdateInfoComponent, isStandalone: true, selector: "spx-update-info", inputs: { txtAppStoreVersion: "txtAppStoreVersion", txtChannel: "txtChannel", txtNextVersion: "txtNextVersion", txtVersion: "txtVersion" }, ngImport: i0, template: `<form [formGroup]="form" class="mt-3">
43
- <div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3">
44
- <spx-input [formControl]="ctrlVersionNumber" [spxLabel]="txtVersion | capitalize"
45
- [spxReadonly]="true"></spx-input>
46
- <spx-input [formControl]="ctrlNextVersionNumber" [spxLabel]="txtNextVersion | capitalize"
47
- [spxReadonly]="true"></spx-input>
48
- <spx-input [formControl]="ctrlConfiguredChannel" [spxLabel]="txtChannel | capitalize"
49
- [spxReadonly]="true"></spx-input>
50
- <spx-input [formControl]="ctrlAppStoreVersion" [spxLabel]="txtAppStoreVersion | capitalize"
51
- [spxReadonly]="true"></spx-input>
52
- </div>
53
- </form>`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "value", "spxCapitalize", "spxFocused"], outputs: ["spxBlur", "spxClear", "spxChange", "spxFocus", "spxEdit", "spxHelp", "spxSearch"] }] }); }
128
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxUpdPageComponent, deps: [{ token: i1.Store }, { token: i2.NavController }], target: i0.ɵɵFactoryTarget.Component }); }
129
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: SpxUpdPageComponent, isStandalone: true, selector: "spx-upd-page", ngImport: i0, template: "<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ spxTextCheckingForUpdates | translate | capitalize }}\n </ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n {{ spxTextOneMomentPlease | translate | capitalize }}...\n</ion-content>\n", dependencies: [{ kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
54
130
  }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxUpdateInfoComponent, decorators: [{
131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxUpdPageComponent, decorators: [{
56
132
  type: Component,
57
- args: [{
58
- selector: 'spx-update-info',
59
- template: `<form [formGroup]="form" class="mt-3">
60
- <div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3">
61
- <spx-input [formControl]="ctrlVersionNumber" [spxLabel]="txtVersion | capitalize"
62
- [spxReadonly]="true"></spx-input>
63
- <spx-input [formControl]="ctrlNextVersionNumber" [spxLabel]="txtNextVersion | capitalize"
64
- [spxReadonly]="true"></spx-input>
65
- <spx-input [formControl]="ctrlConfiguredChannel" [spxLabel]="txtChannel | capitalize"
66
- [spxReadonly]="true"></spx-input>
67
- <spx-input [formControl]="ctrlAppStoreVersion" [spxLabel]="txtAppStoreVersion | capitalize"
68
- [spxReadonly]="true"></spx-input>
69
- </div>
70
- </form>`,
71
- imports: [
72
- FormsModule,
73
- ReactiveFormsModule,
133
+ args: [{ selector: 'spx-upd-page', imports: [
134
+ IonContent,
135
+ IonHeader,
136
+ IonToolbar,
137
+ IonTitle,
74
138
  SpxCapitalizePipe,
75
- SpxInputComponent
76
- ]
77
- }]
78
- }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { txtAppStoreVersion: [{
79
- type: Input
80
- }], txtChannel: [{
81
- type: Input
82
- }], txtNextVersion: [{
83
- type: Input
84
- }], txtVersion: [{
85
- type: Input
86
- }] } });
87
-
88
- class SpxUpdateProgressComponent {
139
+ TranslatePipe,
140
+ ], template: "<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ spxTextCheckingForUpdates | translate | capitalize }}\n </ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n {{ spxTextOneMomentPlease | translate | capitalize }}...\n</ion-content>\n" }]
141
+ }], ctorParameters: () => [{ type: i1.Store }, { type: i2.NavController }] });
142
+
143
+ const acceptUpdate = createAction('[UPD / Available] Accept update', props());
144
+ const hasBeenDownloaded = createAction('[UPD / Available] Has been downloaded', props());
145
+ const hasBeenInstalled = createAction('[UPD / Available] Has been installed', props());
146
+ const postpone = createAction('[UPD / Available] Postpone', props());
147
+ const postponeExpired = createAction('[UPD / Available] Postpone expired', props());
148
+ const all = union({
149
+ acceptUpdate,
150
+ hasBeenDownloaded,
151
+ hasBeenInstalled,
152
+ postpone,
153
+ postponeExpired,
154
+ });
155
+
156
+ var updPending_actions = /*#__PURE__*/Object.freeze({
157
+ __proto__: null,
158
+ acceptUpdate: acceptUpdate,
159
+ hasBeenDownloaded: hasBeenDownloaded,
160
+ hasBeenInstalled: hasBeenInstalled,
161
+ postpone: postpone,
162
+ postponeExpired: postponeExpired
163
+ });
164
+
165
+ const initialState = {
166
+ showLiveUpdateReady: false,
167
+ updateIsDownloadedAndPending: false,
168
+ };
169
+
170
+ var updPending_initial = /*#__PURE__*/Object.freeze({
171
+ __proto__: null,
172
+ initialState: initialState
173
+ });
174
+
175
+ var updPending = createFeature({
176
+ name: 'spxUpdPending',
177
+ reducer: createReducer(initialState, on(hasBeenDownloaded, (state) => {
178
+ return {
179
+ ...state,
180
+ showLiveUpdateReady: true,
181
+ updateIsDownloadedAndPending: true,
182
+ };
183
+ }), on(hasBeenInstalled, (state) => {
184
+ return {
185
+ ...state,
186
+ showLiveUpdateReady: false,
187
+ updateIsDownloadedAndPending: false,
188
+ };
189
+ }), on(postpone, (state) => {
190
+ return {
191
+ ...state,
192
+ showLiveUpdateReady: false,
193
+ };
194
+ }), on(postponeExpired, (state) => {
195
+ return {
196
+ ...state,
197
+ showLiveUpdateReady: true,
198
+ };
199
+ })),
200
+ });
201
+
202
+ var updPending_reducer = /*#__PURE__*/Object.freeze({
203
+ __proto__: null,
204
+ default: updPending
205
+ });
206
+
207
+ class SpxUpdPendingComponent {
89
208
  ngOnInit() {
90
- this.startLoaderSync();
209
+ this.getVersionInfo().then(() => { });
210
+ this.subscriptions.updPending = this.appStore.select(updPending.selectShowLiveUpdateReady).subscribe(showLiveUpdateReady => {
211
+ this.showLiveUpdateReady.set(showLiveUpdateReady);
212
+ });
91
213
  }
92
214
  ngOnDestroy() {
93
- this.stopLoaderSync();
215
+ unsubscribeSubscriptions(this.subscriptions);
94
216
  }
95
- startLoaderSync() {
96
- if (this.syncTruckInterval === null) {
97
- this.syncTruckInterval = setInterval(() => {
98
- this.delayedPercentage = this.percentage;
99
- }, 200);
100
- }
217
+ constructor(appStore) {
218
+ this.appStore = appStore;
219
+ this.availableStoreVersion = signal(undefined);
220
+ this.currentStoreVersion = signal(undefined);
221
+ this.majorAppStoreUpdate = computed(() => this.availableStoreVersion()?.substring(0, 3) !== this.currentStoreVersion()?.substring(0, 3));
222
+ this.minorAppStoreUpdate = computed(() => !this.majorAppStoreUpdate() && this.availableStoreVersion() !== this.currentStoreVersion());
223
+ this.severitySuccess = SpxSeverityEnum.success;
224
+ this.showLiveUpdateReady = signal(false);
225
+ this.spxTextUpdate = spxTextUpdate;
226
+ this.spxTextReadyToBeInstalled = spxTextReadyToBeInstalled;
227
+ this.spxTextPatchAvailable = spxTextPatchAvailable;
228
+ this.spxTextUpdateAvailable = spxTextUpdateAvailable;
229
+ this.spxTextOpenAppStore = spxTextOpenAppStore;
230
+ this.subscriptions = {};
231
+ this.openAppStore = async () => {
232
+ await AppUpdate.openAppStore();
233
+ };
234
+ this.getVersionInfo = async () => {
235
+ await this.getCurrentAppVersion().then(() => { });
236
+ await this.getAvailableAppVersion().then(() => { });
237
+ };
238
+ this.getCurrentAppVersion = async () => {
239
+ if (Capacitor.getPlatform() !== 'web') {
240
+ const result = await AppUpdate.getAppUpdateInfo();
241
+ this.currentStoreVersion.set(Capacitor.getPlatform() === 'android' ? result.currentVersionCode : result.currentVersionName);
242
+ }
243
+ };
244
+ this.getAvailableAppVersion = async () => {
245
+ if (Capacitor.getPlatform() !== 'web') {
246
+ const result = await AppUpdate.getAppUpdateInfo();
247
+ this.availableStoreVersion.set(Capacitor.getPlatform() === 'android' ? result.availableVersionCode : result.availableVersionName);
248
+ }
249
+ };
101
250
  }
102
- stopLoaderSync() {
103
- if (this.syncTruckInterval !== null) {
104
- clearInterval(this.syncTruckInterval);
105
- this.syncTruckInterval = undefined;
106
- }
251
+ onUpdate() {
252
+ this.appStore.dispatch(acceptUpdate({}));
107
253
  }
108
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxUpdateProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
109
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: SpxUpdateProgressComponent, isStandalone: true, selector: "spx-update-progress", inputs: { title: "title", percentage: "percentage" }, ngImport: i0, template: `<spx-progress-bar [spxPercentage]="delayedPercentage" [spxTitle]="title | capitalize">
110
- </spx-progress-bar>`, isInline: true, dependencies: [{ kind: "component", type: SpxProgressBarComponent, selector: "spx-progress-bar", inputs: ["spxPercentage", "spxTitle"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }] }); }
254
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxUpdPendingComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
255
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxUpdPendingComponent, isStandalone: true, selector: "spx-upd-pending", ngImport: i0, template: "@if (majorAppStoreUpdate() || minorAppStoreUpdate()) {\n<div class=\"bg-zinc-700 text-black p-3 rounded flex flex-col gap-3 mx-auto w-full max-w-lg items-center\">\n <div class=\"grow\">\n <p\n class=\"text-xl font-extrabold bg-clip-text text-transparent bg-[linear-gradient(to_right,theme(colors.green.300),theme(colors.green.100),theme(colors.sky.400),theme(colors.yellow.200),theme(colors.sky.400),theme(colors.green.100),theme(colors.green.300))] bg-[length:200%_auto] animate-gradient\">\n {{ spxTextUpdateAvailable | translate | capitalize }}</p>\n <div class=\"text-sm text-zinc-300\">{{ currentStoreVersion() }} -> {{ availableStoreVersion() }}</div>\n </div>\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"severitySuccess\" (spxClick)=\"openAppStore()\">{{ spxTextOpenAppStore |\n translate | capitalize }}</spx-button>\n</div>\n}\n@if (!majorAppStoreUpdate() && !minorAppStoreUpdate() && showLiveUpdateReady()) {\n<div class=\"bg-zinc-700 text-black p-3 rounded flex gap-3 mx-auto max-w-lg items-center\">\n <div class=\"grow\">\n <p\n class=\"text-xl font-extrabold bg-clip-text text-transparent bg-[linear-gradient(to_right,theme(colors.green.300),theme(colors.green.100),theme(colors.sky.400),theme(colors.yellow.200),theme(colors.sky.400),theme(colors.green.100),theme(colors.green.300))] bg-[length:200%_auto] animate-gradient\">\n {{ spxTextPatchAvailable | translate | capitalize }}</p>\n <div class=\"text-sm text-zinc-300\">{{ spxTextReadyToBeInstalled | translate | capitalize }}</div>\n </div>\n <spx-button [spxSeverity]=\"severitySuccess\" (spxClick)=\"onUpdate()\">{{ spxTextUpdate | translate | capitalize\n }}</spx-button>\n</div>\n}", dependencies: [{ kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
111
256
  }
112
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxUpdateProgressComponent, decorators: [{
257
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxUpdPendingComponent, decorators: [{
113
258
  type: Component,
114
- args: [{
115
- selector: 'spx-update-progress',
116
- template: `<spx-progress-bar [spxPercentage]="delayedPercentage" [spxTitle]="title | capitalize">
117
- </spx-progress-bar>`,
118
- imports: [
119
- SpxProgressBarComponent,
259
+ args: [{ selector: 'spx-upd-pending', imports: [
260
+ SpxButtonComponent,
120
261
  SpxCapitalizePipe,
121
- ]
122
- }]
123
- }], propDecorators: { title: [{
124
- type: Input
125
- }], percentage: [{
126
- type: Input
127
- }] } });
262
+ TranslatePipe,
263
+ ], template: "@if (majorAppStoreUpdate() || minorAppStoreUpdate()) {\n<div class=\"bg-zinc-700 text-black p-3 rounded flex flex-col gap-3 mx-auto w-full max-w-lg items-center\">\n <div class=\"grow\">\n <p\n class=\"text-xl font-extrabold bg-clip-text text-transparent bg-[linear-gradient(to_right,theme(colors.green.300),theme(colors.green.100),theme(colors.sky.400),theme(colors.yellow.200),theme(colors.sky.400),theme(colors.green.100),theme(colors.green.300))] bg-[length:200%_auto] animate-gradient\">\n {{ spxTextUpdateAvailable | translate | capitalize }}</p>\n <div class=\"text-sm text-zinc-300\">{{ currentStoreVersion() }} -> {{ availableStoreVersion() }}</div>\n </div>\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"severitySuccess\" (spxClick)=\"openAppStore()\">{{ spxTextOpenAppStore |\n translate | capitalize }}</spx-button>\n</div>\n}\n@if (!majorAppStoreUpdate() && !minorAppStoreUpdate() && showLiveUpdateReady()) {\n<div class=\"bg-zinc-700 text-black p-3 rounded flex gap-3 mx-auto max-w-lg items-center\">\n <div class=\"grow\">\n <p\n class=\"text-xl font-extrabold bg-clip-text text-transparent bg-[linear-gradient(to_right,theme(colors.green.300),theme(colors.green.100),theme(colors.sky.400),theme(colors.yellow.200),theme(colors.sky.400),theme(colors.green.100),theme(colors.green.300))] bg-[length:200%_auto] animate-gradient\">\n {{ spxTextPatchAvailable | translate | capitalize }}</p>\n <div class=\"text-sm text-zinc-300\">{{ spxTextReadyToBeInstalled | translate | capitalize }}</div>\n </div>\n <spx-button [spxSeverity]=\"severitySuccess\" (spxClick)=\"onUpdate()\">{{ spxTextUpdate | translate | capitalize\n }}</spx-button>\n</div>\n}" }]
264
+ }], ctorParameters: () => [{ type: i1.Store }] });
265
+
266
+ let Effects$1 = class Effects {
267
+ constructor(actions$) {
268
+ this.actions$ = actions$;
269
+ this.afterInitialize$ = createEffect(() => this.actions$.pipe(ofType(initialize), delay(120000), mergeMap(() => [
270
+ runCheck({}),
271
+ ])));
272
+ this.onRun$ = createEffect(() => this.actions$.pipe(ofType(runCheck), tap(async () => {
273
+ if (Capacitor.getPlatform() !== 'web') {
274
+ // Migrate from e.g. 1.2.x to 1.3.x
275
+ const binaryInfo = await AppUpdate.getAppUpdateInfo();
276
+ const binaryVersionGroup = (Capacitor.getPlatform() === 'android' ? binaryInfo.currentVersionCode : binaryInfo.currentVersionName).substring(0, 3);
277
+ const config = await getConfig();
278
+ const channelVersionGroup = config.channel.split('-')[1].substring(0, 3); // e.g. "1.4"
279
+ const channelType = config.channel.split('-')[0];
280
+ captureMessage("[UPD] Changed chanel to `${channelType}-${binaryVersionGroup}.x`");
281
+ if (binaryVersionGroup != channelVersionGroup) {
282
+ await setConfig({
283
+ channel: `${channelType}-${binaryVersionGroup}.x`
284
+ });
285
+ }
286
+ // End migrate from e.g. 1.2.x to 1.3.x
287
+ }
288
+ }), exhaustMap((action) => from(sync()).pipe(map((syncResult) => {
289
+ if (syncResult.activeApplicationPathChanged) {
290
+ if (action.forceWaitForUpdate) {
291
+ reload();
292
+ }
293
+ return anUpdateIsReady({});
294
+ }
295
+ else {
296
+ return noUpdateWasFound({ startUpdateAgainAfterTimeout: !action.forceWaitForUpdate });
297
+ }
298
+ }), catchError((err) => {
299
+ if (err.message !== 'Not implemented for web only') {
300
+ captureMessage("[UPD] Handled: " + err.message);
301
+ }
302
+ return err.message === 'Not implemented for web only' ? of(notAvailableOnWeb({})) : of(checkFailed({ startUpdateAgainAfterTimeout: !action.forceWaitForUpdate }));
303
+ })))));
304
+ this.whenAndUpdateIsReady$ = createEffect(() => this.actions$.pipe(ofType(anUpdateIsReady), mergeMap(() => [
305
+ hasBeenDownloaded({}),
306
+ ])));
307
+ this.whenCheckHasFailed$ = createEffect(() => this.actions$.pipe(ofType(checkFailed), delay(30000), mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [
308
+ runCheck({}),
309
+ ])));
310
+ this.whenNoUpdateWasFound$ = createEffect(() => this.actions$.pipe(ofType(noUpdateWasFound), delay(120000), mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [
311
+ runCheck({}),
312
+ ])));
313
+ }
314
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Effects, deps: [{ token: i1$1.Actions }], target: i0.ɵɵFactoryTarget.Injectable }); }
315
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Effects }); }
316
+ };
317
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Effects$1, decorators: [{
318
+ type: Injectable
319
+ }], ctorParameters: () => [{ type: i1$1.Actions }] });
320
+
321
+ var updCheck_effects = /*#__PURE__*/Object.freeze({
322
+ __proto__: null,
323
+ Effects: Effects$1
324
+ });
325
+
326
+ var updCheck_state = /*#__PURE__*/Object.freeze({
327
+ __proto__: null
328
+ });
329
+
330
+ class Effects {
331
+ constructor(actions$) {
332
+ this.actions$ = actions$;
333
+ this.whenAccepted$ = createEffect(() => this.actions$.pipe(ofType(acceptUpdate), mergeMap(() => {
334
+ reload();
335
+ return [];
336
+ })));
337
+ }
338
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Effects, deps: [{ token: i1$1.Actions }], target: i0.ɵɵFactoryTarget.Injectable }); }
339
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Effects }); }
340
+ }
341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Effects, decorators: [{
342
+ type: Injectable
343
+ }], ctorParameters: () => [{ type: i1$1.Actions }] });
344
+
345
+ var updPending_effects = /*#__PURE__*/Object.freeze({
346
+ __proto__: null,
347
+ Effects: Effects
348
+ });
349
+
350
+ var updPending_state = /*#__PURE__*/Object.freeze({
351
+ __proto__: null
352
+ });
128
353
 
129
354
  /**
130
355
  * Generated bundle index. Do not edit.
131
356
  */
132
357
 
133
- export { SpxUpdateInfoComponent, SpxUpdateProgressComponent };
358
+ export { SpxUpdPageComponent, SpxUpdPendingComponent, updCheck_actions as updCheckActions, updCheck_effects as updCheckEffects, updCheck_initial as updCheckInitial, updCheck_reducer as updCheckReducer, updCheck_state as updCheckState, updPending_actions as updPendingActions, updPending_effects as updPendingEffects, updPending_initial as updPendingInitial, updPending_reducer as updPendingReducer, updPending_state as updPendingState };
134
359
  //# sourceMappingURL=softpak-components-spx-update.mjs.map