@softpak/components 19.1.0-beta.4 → 19.1.0-beta.6

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 +340 -111
  6. package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
  7. package/package.json +16 -16
  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 +17 -0
  17. package/spx-update/spx-upd-pending.component.d.ts +28 -0
  18. package/{spx-app-update → spx-update}/store/upd-check/upd-check.actions.d.ts +5 -5
  19. package/tailwind.css +1 -1
  20. package/fesm2022/softpak-components-spx-app-update.mjs +0 -573
  21. package/fesm2022/softpak-components-spx-app-update.mjs.map +0 -1
  22. package/spx-app-update/public-api.d.ts +0 -11
  23. package/spx-app-update/spx-app-update.component.d.ts +0 -49
  24. package/spx-update/src/spx-update-info.component.d.ts +0 -18
  25. package/spx-update/src/spx-update-progress.component.d.ts +0 -14
  26. /package/{spx-app-update → spx-update}/store/upd-check/upd-check.effects.d.ts +0 -0
  27. /package/{spx-app-update → spx-update}/store/upd-check/upd-check.initial.d.ts +0 -0
  28. /package/{spx-app-update → spx-update}/store/upd-check/upd-check.reducer.d.ts +0 -0
  29. /package/{spx-app-update → spx-update}/store/upd-check/upd-check.state.d.ts +0 -0
  30. /package/{spx-app-update → spx-update}/store/upd-pending/upd-pending.actions.d.ts +0 -0
  31. /package/{spx-app-update → spx-update}/store/upd-pending/upd-pending.effects.d.ts +0 -0
  32. /package/{spx-app-update → spx-update}/store/upd-pending/upd-pending.initial.d.ts +0 -0
  33. /package/{spx-app-update → spx-update}/store/upd-pending/upd-pending.reducer.d.ts +0 -0
  34. /package/{spx-app-update → spx-update}/store/upd-pending/upd-pending.state.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,363 @@
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 i3 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 * as i2 from '@angular/router';
13
+ import { AppUpdate } from '@capawesome/capacitor-app-update';
14
+ import { Capacitor } from '@capacitor/core';
15
+ import { SpxButtonComponent } from '@softpak/components/spx-button';
16
+ import * as i1$1 from '@ngrx/effects';
17
+ import { createEffect, ofType } from '@ngrx/effects';
18
+ import { from, of } from 'rxjs';
19
+ import { delay, mergeMap, tap, exhaustMap, map, catchError } from 'rxjs/operators';
20
+ import { getConfig, setConfig, sync, reload } from '@capacitor/live-updates';
21
+ import { captureMessage } from '@sentry/angular';
22
+
23
+ const anUpdateIsReady = createAction('[UPD / Check] An update is ready', props());
24
+ const clearError = createAction('[UPD / Check] Clear error', props());
25
+ const checkFailed = createAction('[UPD / Check] Error happened', props());
26
+ const initialize = createAction('[UPD / Check] Initialize', props());
27
+ const noUpdateWasFound = createAction('[UPD / Check] No update was found', props());
28
+ const notAvailableOnWeb = createAction('[UPD / Check] Not available on web', props());
29
+ const runCheck = createAction('[UPD / Check] Run', props());
30
+ const all$1 = union({
31
+ anUpdateIsReady,
32
+ clearError,
33
+ checkFailed,
34
+ initialize,
35
+ noUpdateWasFound,
36
+ notAvailableOnWeb,
37
+ runCheck,
38
+ });
39
+
40
+ var updCheck_actions = /*#__PURE__*/Object.freeze({
41
+ __proto__: null,
42
+ anUpdateIsReady: anUpdateIsReady,
43
+ checkFailed: checkFailed,
44
+ clearError: clearError,
45
+ initialize: initialize,
46
+ noUpdateWasFound: noUpdateWasFound,
47
+ notAvailableOnWeb: notAvailableOnWeb,
48
+ runCheck: runCheck
49
+ });
50
+
51
+ const initialState$1 = {
52
+ forceWaitForUpdate: false,
53
+ lastCheck: null,
54
+ showError: false,
55
+ };
56
+
57
+ var updCheck_initial = /*#__PURE__*/Object.freeze({
58
+ __proto__: null,
59
+ initialState: initialState$1
60
+ });
61
+
62
+ var updCheck = createFeature({
63
+ name: 'spxUpdCheck',
64
+ reducer: createReducer(initialState$1, on(anUpdateIsReady, (state) => {
65
+ return {
66
+ ...state,
67
+ lastCheck: DateTime.now().toISO(),
68
+ showError: false,
69
+ };
70
+ }), on(clearError, (state) => {
71
+ return {
72
+ ...state,
73
+ showError: false,
74
+ };
75
+ }), on(checkFailed, (state) => {
76
+ return {
77
+ ...state,
78
+ forceWaitForUpdate: false,
79
+ showError: true,
80
+ };
81
+ }), on(noUpdateWasFound, (state) => {
82
+ return {
83
+ ...state,
84
+ forceWaitForUpdate: false,
85
+ lastCheck: DateTime.now().toISO(),
86
+ showError: false,
87
+ };
88
+ }), on(runCheck, (state, { forceWaitForUpdate }) => {
89
+ return {
90
+ ...state,
91
+ forceWaitForUpdate: forceWaitForUpdate ? true : state.forceWaitForUpdate
92
+ };
93
+ }), on(notAvailableOnWeb, (state) => {
94
+ return {
95
+ ...state,
96
+ forceWaitForUpdate: false
97
+ };
98
+ })),
99
+ });
100
+
101
+ var updCheck_reducer = /*#__PURE__*/Object.freeze({
102
+ __proto__: null,
103
+ default: updCheck
104
+ });
105
+
106
+ class SpxUpdPageComponent {
107
+ ionViewDidEnter() {
108
+ this.appStore.dispatch(runCheck({ forceWaitForUpdate: true }));
109
+ this.subscriptions.updCheck = this.appStore.select(updCheck.selectForceWaitForUpdate).subscribe(forceWaitForUpdate => {
110
+ if (forceWaitForUpdate === false) {
111
+ if (this.activatedRoute.snapshot.data['url'] === undefined) {
112
+ console.error('configure data property \'url\' in route for update page');
113
+ }
114
+ this.navController.navigateRoot([this.activatedRoute.snapshot.data['url']], {
115
+ animated: true,
116
+ animationDirection: 'forward'
117
+ });
118
+ }
25
119
  });
26
120
  }
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
- });
121
+ ionViewWillLeave() {
122
+ unsubscribeSubscriptions(this.subscriptions);
123
+ }
124
+ constructor(appStore, activatedRoute, navController) {
125
+ this.appStore = appStore;
126
+ this.activatedRoute = activatedRoute;
127
+ this.navController = navController;
128
+ this.spxTextCheckingForUpdates = spxTextCheckingForUpdates;
129
+ this.spxTextOneMomentPlease = spxTextOneMomentPlease;
130
+ this.subscriptions = {};
40
131
  }
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"] }] }); }
132
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxUpdPageComponent, deps: [{ token: i1.Store }, { token: i2.ActivatedRoute }, { token: i3.NavController }], target: i0.ɵɵFactoryTarget.Component }); }
133
+ 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
134
  }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxUpdateInfoComponent, decorators: [{
135
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxUpdPageComponent, decorators: [{
56
136
  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,
137
+ args: [{ selector: 'spx-upd-page', imports: [
138
+ IonContent,
139
+ IonHeader,
140
+ IonToolbar,
141
+ IonTitle,
74
142
  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 {
143
+ TranslatePipe,
144
+ ], 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" }]
145
+ }], ctorParameters: () => [{ type: i1.Store }, { type: i2.ActivatedRoute }, { type: i3.NavController }] });
146
+
147
+ const acceptUpdate = createAction('[UPD / Available] Accept update', props());
148
+ const hasBeenDownloaded = createAction('[UPD / Available] Has been downloaded', props());
149
+ const hasBeenInstalled = createAction('[UPD / Available] Has been installed', props());
150
+ const postpone = createAction('[UPD / Available] Postpone', props());
151
+ const postponeExpired = createAction('[UPD / Available] Postpone expired', props());
152
+ const all = union({
153
+ acceptUpdate,
154
+ hasBeenDownloaded,
155
+ hasBeenInstalled,
156
+ postpone,
157
+ postponeExpired,
158
+ });
159
+
160
+ var updPending_actions = /*#__PURE__*/Object.freeze({
161
+ __proto__: null,
162
+ acceptUpdate: acceptUpdate,
163
+ hasBeenDownloaded: hasBeenDownloaded,
164
+ hasBeenInstalled: hasBeenInstalled,
165
+ postpone: postpone,
166
+ postponeExpired: postponeExpired
167
+ });
168
+
169
+ const initialState = {
170
+ showLiveUpdateReady: false,
171
+ updateIsDownloadedAndPending: false,
172
+ };
173
+
174
+ var updPending_initial = /*#__PURE__*/Object.freeze({
175
+ __proto__: null,
176
+ initialState: initialState
177
+ });
178
+
179
+ var updPending = createFeature({
180
+ name: 'spxUpdPending',
181
+ reducer: createReducer(initialState, on(hasBeenDownloaded, (state) => {
182
+ return {
183
+ ...state,
184
+ showLiveUpdateReady: true,
185
+ updateIsDownloadedAndPending: true,
186
+ };
187
+ }), on(hasBeenInstalled, (state) => {
188
+ return {
189
+ ...state,
190
+ showLiveUpdateReady: false,
191
+ updateIsDownloadedAndPending: false,
192
+ };
193
+ }), on(postpone, (state) => {
194
+ return {
195
+ ...state,
196
+ showLiveUpdateReady: false,
197
+ };
198
+ }), on(postponeExpired, (state) => {
199
+ return {
200
+ ...state,
201
+ showLiveUpdateReady: true,
202
+ };
203
+ })),
204
+ });
205
+
206
+ var updPending_reducer = /*#__PURE__*/Object.freeze({
207
+ __proto__: null,
208
+ default: updPending
209
+ });
210
+
211
+ class SpxUpdPendingComponent {
89
212
  ngOnInit() {
90
- this.startLoaderSync();
213
+ this.getVersionInfo().then(() => { });
214
+ this.subscriptions.updPending = this.appStore.select(updPending.selectShowLiveUpdateReady).subscribe(showLiveUpdateReady => {
215
+ this.showLiveUpdateReady.set(showLiveUpdateReady);
216
+ });
91
217
  }
92
218
  ngOnDestroy() {
93
- this.stopLoaderSync();
219
+ unsubscribeSubscriptions(this.subscriptions);
94
220
  }
95
- startLoaderSync() {
96
- if (this.syncTruckInterval === null) {
97
- this.syncTruckInterval = setInterval(() => {
98
- this.delayedPercentage = this.percentage;
99
- }, 200);
100
- }
221
+ constructor(appStore) {
222
+ this.appStore = appStore;
223
+ this.availableStoreVersion = signal(undefined);
224
+ this.currentStoreVersion = signal(undefined);
225
+ this.majorAppStoreUpdate = computed(() => this.availableStoreVersion()?.substring(0, 3) !== this.currentStoreVersion()?.substring(0, 3));
226
+ this.minorAppStoreUpdate = computed(() => !this.majorAppStoreUpdate() && this.availableStoreVersion() !== this.currentStoreVersion());
227
+ this.severitySuccess = SpxSeverityEnum.success;
228
+ this.showLiveUpdateReady = signal(false);
229
+ this.spxTextUpdate = spxTextUpdate;
230
+ this.spxTextReadyToBeInstalled = spxTextReadyToBeInstalled;
231
+ this.spxTextPatchAvailable = spxTextPatchAvailable;
232
+ this.spxTextUpdateAvailable = spxTextUpdateAvailable;
233
+ this.spxTextOpenAppStore = spxTextOpenAppStore;
234
+ this.subscriptions = {};
235
+ this.openAppStore = async () => {
236
+ await AppUpdate.openAppStore();
237
+ };
238
+ this.getVersionInfo = async () => {
239
+ await this.getCurrentAppVersion().then(() => { });
240
+ await this.getAvailableAppVersion().then(() => { });
241
+ };
242
+ this.getCurrentAppVersion = async () => {
243
+ if (Capacitor.getPlatform() !== 'web') {
244
+ const result = await AppUpdate.getAppUpdateInfo();
245
+ this.currentStoreVersion.set(Capacitor.getPlatform() === 'android' ? result.currentVersionCode : result.currentVersionName);
246
+ }
247
+ };
248
+ this.getAvailableAppVersion = async () => {
249
+ if (Capacitor.getPlatform() !== 'web') {
250
+ const result = await AppUpdate.getAppUpdateInfo();
251
+ this.availableStoreVersion.set(Capacitor.getPlatform() === 'android' ? result.availableVersionCode : result.availableVersionName);
252
+ }
253
+ };
101
254
  }
102
- stopLoaderSync() {
103
- if (this.syncTruckInterval !== null) {
104
- clearInterval(this.syncTruckInterval);
105
- this.syncTruckInterval = undefined;
106
- }
255
+ onUpdate() {
256
+ this.appStore.dispatch(acceptUpdate({}));
107
257
  }
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" }] }); }
258
+ 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 }); }
259
+ 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
260
  }
112
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxUpdateProgressComponent, decorators: [{
261
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxUpdPendingComponent, decorators: [{
113
262
  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,
263
+ args: [{ selector: 'spx-upd-pending', imports: [
264
+ SpxButtonComponent,
120
265
  SpxCapitalizePipe,
121
- ]
122
- }]
123
- }], propDecorators: { title: [{
124
- type: Input
125
- }], percentage: [{
126
- type: Input
127
- }] } });
266
+ TranslatePipe,
267
+ ], 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}" }]
268
+ }], ctorParameters: () => [{ type: i1.Store }] });
269
+
270
+ let Effects$1 = class Effects {
271
+ constructor(actions$) {
272
+ this.actions$ = actions$;
273
+ this.afterInitialize$ = createEffect(() => this.actions$.pipe(ofType(initialize), delay(120000), mergeMap(() => [
274
+ runCheck({}),
275
+ ])));
276
+ this.onRun$ = createEffect(() => this.actions$.pipe(ofType(runCheck), tap(async () => {
277
+ if (Capacitor.getPlatform() !== 'web') {
278
+ // Migrate from e.g. 1.2.x to 1.3.x
279
+ const binaryInfo = await AppUpdate.getAppUpdateInfo();
280
+ const binaryVersionGroup = (Capacitor.getPlatform() === 'android' ? binaryInfo.currentVersionCode : binaryInfo.currentVersionName).substring(0, 3);
281
+ const config = await getConfig();
282
+ const channelVersionGroup = config.channel.split('-')[1].substring(0, 3); // e.g. "1.4"
283
+ const channelType = config.channel.split('-')[0];
284
+ captureMessage("[UPD] Changed chanel to `${channelType}-${binaryVersionGroup}.x`");
285
+ if (binaryVersionGroup != channelVersionGroup) {
286
+ await setConfig({
287
+ channel: `${channelType}-${binaryVersionGroup}.x`
288
+ });
289
+ }
290
+ // End migrate from e.g. 1.2.x to 1.3.x
291
+ }
292
+ }), exhaustMap((action) => from(sync()).pipe(map((syncResult) => {
293
+ if (syncResult.activeApplicationPathChanged) {
294
+ if (action.forceWaitForUpdate) {
295
+ reload();
296
+ }
297
+ return anUpdateIsReady({});
298
+ }
299
+ else {
300
+ return noUpdateWasFound({ startUpdateAgainAfterTimeout: !action.forceWaitForUpdate });
301
+ }
302
+ }), catchError((err) => {
303
+ if (err.message !== 'Not implemented for web only') {
304
+ captureMessage("[UPD] Handled: " + err.message);
305
+ }
306
+ return err.message === 'Not implemented for web only' ? of(notAvailableOnWeb({})) : of(checkFailed({ startUpdateAgainAfterTimeout: !action.forceWaitForUpdate }));
307
+ })))));
308
+ this.whenAndUpdateIsReady$ = createEffect(() => this.actions$.pipe(ofType(anUpdateIsReady), mergeMap(() => [
309
+ hasBeenDownloaded({}),
310
+ ])));
311
+ this.whenCheckHasFailed$ = createEffect(() => this.actions$.pipe(ofType(checkFailed), delay(30000), mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [
312
+ runCheck({}),
313
+ ])));
314
+ this.whenNoUpdateWasFound$ = createEffect(() => this.actions$.pipe(ofType(noUpdateWasFound), delay(120000), mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [
315
+ runCheck({}),
316
+ ])));
317
+ }
318
+ 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 }); }
319
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Effects }); }
320
+ };
321
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Effects$1, decorators: [{
322
+ type: Injectable
323
+ }], ctorParameters: () => [{ type: i1$1.Actions }] });
324
+
325
+ var updCheck_effects = /*#__PURE__*/Object.freeze({
326
+ __proto__: null,
327
+ Effects: Effects$1
328
+ });
329
+
330
+ var updCheck_state = /*#__PURE__*/Object.freeze({
331
+ __proto__: null
332
+ });
333
+
334
+ class Effects {
335
+ constructor(actions$) {
336
+ this.actions$ = actions$;
337
+ this.whenAccepted$ = createEffect(() => this.actions$.pipe(ofType(acceptUpdate), mergeMap(() => {
338
+ reload();
339
+ return [];
340
+ })));
341
+ }
342
+ 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 }); }
343
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Effects }); }
344
+ }
345
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Effects, decorators: [{
346
+ type: Injectable
347
+ }], ctorParameters: () => [{ type: i1$1.Actions }] });
348
+
349
+ var updPending_effects = /*#__PURE__*/Object.freeze({
350
+ __proto__: null,
351
+ Effects: Effects
352
+ });
353
+
354
+ var updPending_state = /*#__PURE__*/Object.freeze({
355
+ __proto__: null
356
+ });
128
357
 
129
358
  /**
130
359
  * Generated bundle index. Do not edit.
131
360
  */
132
361
 
133
- export { SpxUpdateInfoComponent, SpxUpdateProgressComponent };
362
+ 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
363
  //# sourceMappingURL=softpak-components-spx-update.mjs.map