@sneat/core 0.1.3 → 0.1.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 (161) hide show
  1. package/esm2022/index.js +2 -0
  2. package/esm2022/index.js.map +1 -0
  3. package/esm2022/lib/analytics.interface.js +3 -0
  4. package/esm2022/lib/analytics.interface.js.map +1 -0
  5. package/esm2022/lib/animations/form-animations.js +8 -0
  6. package/esm2022/lib/animations/form-animations.js.map +1 -0
  7. package/esm2022/lib/animations/index.js +3 -0
  8. package/esm2022/lib/animations/index.js.map +1 -0
  9. package/esm2022/lib/animations/list-animations.js +29 -0
  10. package/esm2022/lib/animations/list-animations.js.map +1 -0
  11. package/esm2022/lib/app.service.js +3 -0
  12. package/esm2022/lib/app.service.js.map +1 -0
  13. package/esm2022/lib/core-models.js +2 -0
  14. package/esm2022/lib/core-models.js.map +1 -0
  15. package/esm2022/lib/directives/index.js +2 -0
  16. package/esm2022/lib/directives/index.js.map +1 -0
  17. package/esm2022/lib/directives/sneat-select-all-on-focus.directive.js +42 -0
  18. package/esm2022/lib/directives/sneat-select-all-on-focus.directive.js.map +1 -0
  19. package/esm2022/lib/environment-config.js +4 -0
  20. package/esm2022/lib/environment-config.js.map +1 -0
  21. package/esm2022/lib/eq.js +2 -0
  22. package/esm2022/lib/eq.js.map +1 -0
  23. package/esm2022/lib/exclude-undefined.js +43 -0
  24. package/esm2022/lib/exclude-undefined.js.map +1 -0
  25. package/esm2022/lib/form-field.js +2 -0
  26. package/esm2022/lib/form-field.js.map +1 -0
  27. package/esm2022/lib/index.js +22 -0
  28. package/esm2022/lib/index.js.map +1 -0
  29. package/esm2022/lib/interfaces.js +11 -0
  30. package/esm2022/lib/interfaces.js.map +1 -0
  31. package/esm2022/lib/location-href.js +6 -0
  32. package/esm2022/lib/location-href.js.map +1 -0
  33. package/esm2022/lib/logging/interfaces.js +3 -0
  34. package/esm2022/lib/logging/interfaces.js.map +1 -0
  35. package/esm2022/lib/logging.js +16 -0
  36. package/esm2022/lib/logging.js.map +1 -0
  37. package/esm2022/lib/nav/index.js +3 -0
  38. package/esm2022/lib/nav/index.js.map +1 -0
  39. package/esm2022/lib/nav/nav-context.js +7 -0
  40. package/esm2022/lib/nav/nav-context.js.map +1 -0
  41. package/esm2022/lib/nav/routing-state.js +29 -0
  42. package/esm2022/lib/nav/routing-state.js.map +1 -0
  43. package/esm2022/lib/services/index.js +4 -0
  44. package/esm2022/lib/services/index.js.map +1 -0
  45. package/esm2022/lib/services/ng-module-preloader.service.js +108 -0
  46. package/esm2022/lib/services/ng-module-preloader.service.js.map +1 -0
  47. package/esm2022/lib/services/sneat-nav.service.js +41 -0
  48. package/esm2022/lib/services/sneat-nav.service.js.map +1 -0
  49. package/esm2022/lib/services/top-menu.service.js +25 -0
  50. package/esm2022/lib/services/top-menu.service.js.map +1 -0
  51. package/esm2022/lib/sneat-enum-keys.js +2 -0
  52. package/esm2022/lib/sneat-enum-keys.js.map +1 -0
  53. package/esm2022/lib/sneat-extensions.js +38 -0
  54. package/esm2022/lib/sneat-extensions.js.map +1 -0
  55. package/esm2022/lib/store.js +42 -0
  56. package/esm2022/lib/store.js.map +1 -0
  57. package/esm2022/lib/team-type.js +2 -0
  58. package/esm2022/lib/team-type.js.map +1 -0
  59. package/esm2022/lib/types/age-group.js +2 -0
  60. package/esm2022/lib/types/age-group.js.map +1 -0
  61. package/{src/lib/types/gender.ts → esm2022/lib/types/gender.js} +1 -7
  62. package/esm2022/lib/types/gender.js.map +1 -0
  63. package/esm2022/lib/types/index.js +3 -0
  64. package/esm2022/lib/types/index.js.map +1 -0
  65. package/esm2022/lib/utils/datetimes.js +39 -0
  66. package/esm2022/lib/utils/datetimes.js.map +1 -0
  67. package/esm2022/lib/utils/index.js +2 -0
  68. package/esm2022/lib/utils/index.js.map +1 -0
  69. package/esm2022/sneat-core.js +5 -0
  70. package/esm2022/sneat-core.js.map +1 -0
  71. package/lib/analytics.interface.d.ts +12 -0
  72. package/lib/animations/form-animations.d.ts +1 -0
  73. package/lib/animations/list-animations.d.ts +3 -0
  74. package/lib/app.service.d.ts +9 -0
  75. package/{src/lib/core-models.ts → lib/core-models.d.ts} +4 -6
  76. package/lib/directives/sneat-select-all-on-focus.directive.d.ts +7 -0
  77. package/lib/environment-config.d.ts +37 -0
  78. package/lib/eq.d.ts +1 -0
  79. package/lib/exclude-undefined.d.ts +6 -0
  80. package/lib/form-field.d.ts +4 -0
  81. package/lib/interfaces.d.ts +53 -0
  82. package/lib/location-href.d.ts +1 -0
  83. package/lib/logging/interfaces.d.ts +12 -0
  84. package/lib/logging.d.ts +12 -0
  85. package/lib/nav/nav-context.d.ts +4 -0
  86. package/lib/nav/routing-state.d.ts +8 -0
  87. package/lib/services/ng-module-preloader.service.d.ts +18 -0
  88. package/lib/services/sneat-nav.service.d.ts +12 -0
  89. package/lib/services/top-menu.service.d.ts +10 -0
  90. package/lib/sneat-enum-keys.d.ts +1 -0
  91. package/lib/sneat-extensions.d.ts +7 -0
  92. package/lib/store.d.ts +14 -0
  93. package/lib/team-type.d.ts +2 -0
  94. package/lib/types/gender.d.ts +6 -0
  95. package/lib/utils/datetimes.d.ts +7 -0
  96. package/package.json +14 -2
  97. package/sneat-core.d.ts +5 -0
  98. package/tsconfig.lib.prod.tsbuildinfo +1 -0
  99. package/eslint.config.js +0 -7
  100. package/ng-package.json +0 -7
  101. package/project.json +0 -38
  102. package/src/lib/analytics.interface.ts +0 -34
  103. package/src/lib/animations/form-animations.spec.ts +0 -26
  104. package/src/lib/animations/form-animations.ts +0 -11
  105. package/src/lib/animations/list-animations.spec.ts +0 -50
  106. package/src/lib/animations/list-animations.ts +0 -44
  107. package/src/lib/app.service.ts +0 -33
  108. package/src/lib/constants.spec.ts +0 -20
  109. package/src/lib/constants.ts +0 -1
  110. package/src/lib/directives/sneat-select-all-on-focus.directive.spec.ts +0 -142
  111. package/src/lib/directives/sneat-select-all-on-focus.directive.ts +0 -36
  112. package/src/lib/environment-config.ts +0 -54
  113. package/src/lib/eq.spec.ts +0 -24
  114. package/src/lib/eq.ts +0 -1
  115. package/src/lib/exclude-undefined.spec.ts +0 -165
  116. package/src/lib/exclude-undefined.ts +0 -47
  117. package/src/lib/form-field.ts +0 -5
  118. package/src/lib/interfaces.spec.ts +0 -116
  119. package/src/lib/interfaces.ts +0 -85
  120. package/src/lib/location-href.spec.ts +0 -53
  121. package/src/lib/location-href.ts +0 -9
  122. package/src/lib/logging/interfaces.ts +0 -19
  123. package/src/lib/logging.spec.ts +0 -132
  124. package/src/lib/logging.ts +0 -33
  125. package/src/lib/nav/nav-context.ts +0 -16
  126. package/src/lib/nav/routing-state.spec.ts +0 -65
  127. package/src/lib/nav/routing-state.ts +0 -26
  128. package/src/lib/services/ng-module-preloader.service.spec.ts +0 -72
  129. package/src/lib/services/ng-module-preloader.service.ts +0 -125
  130. package/src/lib/services/sneat-nav.service.spec.ts +0 -95
  131. package/src/lib/services/sneat-nav.service.ts +0 -46
  132. package/src/lib/services/top-menu.service.spec.ts +0 -42
  133. package/src/lib/services/top-menu.service.ts +0 -19
  134. package/src/lib/sneat-enum-keys.ts +0 -2
  135. package/src/lib/sneat-extensions.spec.ts +0 -127
  136. package/src/lib/sneat-extensions.ts +0 -49
  137. package/src/lib/store.spec.ts +0 -156
  138. package/src/lib/store.ts +0 -54
  139. package/src/lib/team-type.spec.ts +0 -8
  140. package/src/lib/team-type.ts +0 -13
  141. package/src/lib/testing/base-test-setup.ts +0 -247
  142. package/src/lib/testing/test-setup-light.ts +0 -1
  143. package/src/lib/testing/test-setup.ts +0 -70
  144. package/src/lib/types/gender.spec.ts +0 -42
  145. package/src/lib/utils/datetimes.spec.ts +0 -144
  146. package/src/lib/utils/datetimes.ts +0 -51
  147. package/src/test-setup.ts +0 -3
  148. package/tsconfig.json +0 -13
  149. package/tsconfig.lib.json +0 -19
  150. package/tsconfig.lib.prod.json +0 -7
  151. package/tsconfig.spec.json +0 -31
  152. package/vite.config.mts +0 -10
  153. /package/{src/index.ts → index.d.ts} +0 -0
  154. /package/{src/lib/animations/index.ts → lib/animations/index.d.ts} +0 -0
  155. /package/{src/lib/directives/index.ts → lib/directives/index.d.ts} +0 -0
  156. /package/{src/lib/index.ts → lib/index.d.ts} +0 -0
  157. /package/{src/lib/nav/index.ts → lib/nav/index.d.ts} +0 -0
  158. /package/{src/lib/services/index.ts → lib/services/index.d.ts} +0 -0
  159. /package/{src/lib/types/age-group.ts → lib/types/age-group.d.ts} +0 -0
  160. /package/{src/lib/types/index.ts → lib/types/index.d.ts} +0 -0
  161. /package/{src/lib/utils/index.ts → lib/utils/index.d.ts} +0 -0
@@ -0,0 +1,2 @@
1
+ export * from './lib';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/core/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC","sourcesContent":["export * from './lib';\n\n\n"]}
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export const AnalyticsService = new InjectionToken('IAnalyticsService');
3
+ //# sourceMappingURL=analytics.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.interface.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/analytics.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AA+B/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAChD,mBAAmB,CACpB,CAAC","sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface IAnalyticsCallOptions {\n // If true, this config or event call applies globally to all analytics properties on the page.\n // This is from Firebase Analytics https://firebase.google.com/docs/reference/js/analytics.md#logevent_d5f1743\n global: boolean;\n}\n\nexport type UserProperties = Record<string, unknown>;\n\n/*\n * An interface for analytics service\n */\nexport interface IAnalyticsService {\n logEvent(\n eventName: string,\n eventParams?: Readonly<Record<string, unknown>>,\n options?: IAnalyticsCallOptions,\n ): void;\n\n identify(\n userID: string,\n userPropertiesToSet?: UserProperties,\n userPropertiesToSetOnce?: UserProperties,\n ): void;\n\n loggedOut(): void;\n\n setCurrentScreen(screenName: string, options?: IAnalyticsCallOptions): void;\n}\n\nexport const AnalyticsService = new InjectionToken<IAnalyticsService>(\n 'IAnalyticsService',\n);\n"]}
@@ -0,0 +1,8 @@
1
+ import { animate, style, transition, trigger } from '@angular/animations';
2
+ export const formNexInAnimation = trigger('formNextIn', [
3
+ transition(':enter', [
4
+ style({ opacity: 0 }), // initial styles
5
+ animate('250ms', style({ opacity: 1 })),
6
+ ]),
7
+ ]);
8
+ //# sourceMappingURL=form-animations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-animations.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/animations/form-animations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE1E,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC,YAAY,EAAE;IACtD,UAAU,CAAC,QAAQ,EAAE;QACnB,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,iBAAiB;QACxC,OAAO,CACL,OAAO,EACP,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CACtB;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { animate, style, transition, trigger } from '@angular/animations';\n\nexport const formNexInAnimation = trigger('formNextIn', [\n transition(':enter', [\n style({ opacity: 0 }), // initial styles\n animate(\n '250ms',\n style({ opacity: 1 }), // final style after the transition has finished\n ),\n ]),\n]);\n"]}
@@ -0,0 +1,3 @@
1
+ export * from './list-animations';
2
+ export * from './form-animations';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/animations/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './list-animations';\nexport * from './form-animations';\n"]}
@@ -0,0 +1,29 @@
1
+ import { animate, style, transition, trigger, } from '@angular/animations';
2
+ const removeListItemAnimation = transition('* => void', [
3
+ animate('0.2s ease-in-out', style({
4
+ height: 0,
5
+ opacity: 0,
6
+ })),
7
+ ]);
8
+ const addListItemAnimation = transition('void => added', [
9
+ style({
10
+ height: 0,
11
+ opacity: 0,
12
+ }),
13
+ animate('0.5s ease-in', style({
14
+ height: '*',
15
+ opacity: 1,
16
+ })),
17
+ ]);
18
+ // TODO: How it is different from listAddRemoveAnimation ?
19
+ export const listItemAnimations = trigger('listItem', [
20
+ removeListItemAnimation,
21
+ addListItemAnimation,
22
+ ]);
23
+ // TODO: How it is different from listItemAnimations ?
24
+ export const listAddRemoveAnimation = [
25
+ trigger('addRemove', [
26
+ transition(':leave', [animate('0.2s ease-in-out', style({ height: 0 }))]),
27
+ ]),
28
+ ];
29
+ //# sourceMappingURL=list-animations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-animations.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/animations/list-animations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,KAAK,EACL,UAAU,EACV,OAAO,GACR,MAAM,qBAAqB,CAAC;AAE7B,MAAM,uBAAuB,GAAG,UAAU,CAAC,WAAW,EAAE;IACtD,OAAO,CACL,kBAAkB,EAClB,KAAK,CAAC;QACJ,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;KACX,CAAC,CACH;CACF,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,UAAU,CAAC,eAAe,EAAE;IACvD,KAAK,CAAC;QACJ,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;KACX,CAAC;IACF,OAAO,CACL,cAAc,EACd,KAAK,CAAC;QACJ,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,CAAC;KACX,CAAC,CACH;CACF,CAAC,CAAC;AAEH,0DAA0D;AAC1D,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC,UAAU,EAAE;IACpD,uBAAuB;IACvB,oBAAoB;CACrB,CAAC,CAAC;AAEH,sDAAsD;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAA+B;IAChE,OAAO,CAAC,WAAW,EAAE;QACnB,UAAU,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,mBAAmB,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC3E,CAAC;CACH,CAAC","sourcesContent":["import {\n animate,\n AnimationTriggerMetadata,\n style,\n transition,\n trigger,\n} from '@angular/animations';\n\nconst removeListItemAnimation = transition('* => void', [\n animate(\n '0.2s ease-in-out',\n style({\n height: 0,\n opacity: 0,\n }),\n ),\n]);\n\nconst addListItemAnimation = transition('void => added', [\n style({\n height: 0,\n opacity: 0,\n }),\n animate(\n '0.5s ease-in',\n style({\n height: '*',\n opacity: 1,\n }),\n ),\n]);\n\n// TODO: How it is different from listAddRemoveAnimation ?\nexport const listItemAnimations = trigger('listItem', [\n removeListItemAnimation,\n addListItemAnimation,\n]);\n\n// TODO: How it is different from listItemAnimations ?\nexport const listAddRemoveAnimation: AnimationTriggerMetadata[] = [\n trigger('addRemove', [\n transition(':leave', [animate('0.2s ease-in-out', style({ height: 0 }))]),\n ]),\n];\n"]}
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export const APP_INFO = new InjectionToken('app_info');
3
+ //# sourceMappingURL=app.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.service.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/app.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAgC/C,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAW,UAAU,CAAC,CAAC","sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { SpaceType } from './team-type';\n\nexport type SneatApp =\n | 'sneat'\n | 'aaproject'\n | 'agendum'\n | 'class'\n | 'contactus'\n | 'creche'\n | 'debtus'\n | 'docus'\n | 'dream7'\n | 'feis'\n | 'logist'\n | 'listus'\n | 'neighbours'\n | 'parish'\n | 'renterra'\n | 'rsvp'\n | 'sizechart'\n | 'splitus'\n | 'sportclubs'\n | 'tournament'\n | 'datatug';\n\nexport interface IAppInfo {\n readonly appId: SneatApp;\n readonly appTitle: string;\n readonly requiredSpaceType?: SpaceType;\n}\n\nexport const APP_INFO = new InjectionToken<IAppInfo>('app_info');\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=core-models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-models.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/core-models.ts"],"names":[],"mappings":"","sourcesContent":["export interface IApiError {\n code?: string;\n message: string;\n}\n\nexport interface IErrorResponse {\n error: IApiError;\n}\n\nexport interface IFieldError extends IApiError {\n field: string;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { SneatSelectAllOnFocusDirective } from './sneat-select-all-on-focus.directive';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/directives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAC","sourcesContent":["export { SneatSelectAllOnFocusDirective } from './sneat-select-all-on-focus.directive';\n"]}
@@ -0,0 +1,42 @@
1
+ import { Directive, ElementRef, HostListener, inject } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class SneatSelectAllOnFocusDirective {
4
+ constructor() {
5
+ this.el = inject(ElementRef);
6
+ }
7
+ selectAll(_target) {
8
+ const nativeElement = this.el.nativeElement;
9
+ const input = nativeElement instanceof HTMLInputElement ||
10
+ nativeElement instanceof HTMLTextAreaElement
11
+ ? nativeElement
12
+ : nativeElement.querySelector('input') ||
13
+ nativeElement.querySelector('textarea');
14
+ if (input) {
15
+ if ('setSelectionRange' in input) {
16
+ try {
17
+ input.setSelectionRange(0, input.value.length);
18
+ return;
19
+ }
20
+ catch {
21
+ console.warn('Element does not support setSelectionRange');
22
+ }
23
+ }
24
+ if (input instanceof HTMLInputElement ||
25
+ input instanceof HTMLTextAreaElement) {
26
+ input.select();
27
+ }
28
+ }
29
+ }
30
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SneatSelectAllOnFocusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
31
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: SneatSelectAllOnFocusDirective, isStandalone: true, selector: "[sneatSelectAllOnFocus]", host: { listeners: { "focus": "selectAll($event.target)" } }, ngImport: i0 }); }
32
+ }
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SneatSelectAllOnFocusDirective, decorators: [{
34
+ type: Directive,
35
+ args: [{
36
+ selector: '[sneatSelectAllOnFocus]',
37
+ }]
38
+ }], propDecorators: { selectAll: [{
39
+ type: HostListener,
40
+ args: ['focus', ['$event.target']]
41
+ }] } });
42
+ //# sourceMappingURL=sneat-select-all-on-focus.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sneat-select-all-on-focus.directive.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/directives/sneat-select-all-on-focus.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;;AAK5E,MAAM,OAAO,8BAA8B;IAH3C;QAImB,OAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;KA6B1C;IA1BQ,SAAS,CAAC,OAA4B;QAC3C,MAAM,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC;QAC5C,MAAM,KAAK,GACT,aAAa,YAAY,gBAAgB;YACzC,aAAa,YAAY,mBAAmB;YAC1C,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC;gBACpC,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAE9C,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,mBAAmB,IAAI,KAAK,EAAE,CAAC;gBACjC,IAAI,CAAC;oBACH,KAAK,CAAC,iBAAiB,CAAC,CAAC,EAAG,KAA0B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;oBACrE,OAAO;gBACT,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;YACD,IACE,KAAK,YAAY,gBAAgB;gBACjC,KAAK,YAAY,mBAAmB,EACpC,CAAC;gBACD,KAAK,CAAC,MAAM,EAAE,CAAC;YACjB,CAAC;QACH,CAAC;IACH,CAAC;8GA7BU,8BAA8B;kGAA9B,8BAA8B;;2FAA9B,8BAA8B;kBAH1C,SAAS;mBAAC;oBACT,QAAQ,EAAE,yBAAyB;iBACpC;;sBAIE,YAAY;uBAAC,OAAO,EAAE,CAAC,eAAe,CAAC","sourcesContent":["import { Directive, ElementRef, HostListener, inject } from '@angular/core';\n\n@Directive({\n selector: '[sneatSelectAllOnFocus]',\n})\nexport class SneatSelectAllOnFocusDirective {\n private readonly el = inject(ElementRef);\n\n @HostListener('focus', ['$event.target'])\n public selectAll(_target?: EventTarget | null) {\n const nativeElement = this.el.nativeElement;\n const input =\n nativeElement instanceof HTMLInputElement ||\n nativeElement instanceof HTMLTextAreaElement\n ? nativeElement\n : nativeElement.querySelector('input') ||\n nativeElement.querySelector('textarea');\n\n if (input) {\n if ('setSelectionRange' in input) {\n try {\n input.setSelectionRange(0, (input as HTMLInputElement).value.length);\n return;\n } catch {\n console.warn('Element does not support setSelectionRange');\n }\n }\n if (\n input instanceof HTMLInputElement ||\n input instanceof HTMLTextAreaElement\n ) {\n input.select();\n }\n }\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export const FirebaseConfigToken = new InjectionToken('firebaseConfig');
3
+ export const EnvConfigToken = new InjectionToken('envConfig');
4
+ //# sourceMappingURL=environment-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-config.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/environment-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAgD/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,cAAc,CACnD,gBAAgB,CACjB,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,cAAc,CAC9C,WAAW,CACZ,CAAC","sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { BrowserOptions } from '@sentry/browser';\nimport { PostHogConfig } from 'posthog-js';\n\nexport interface IFirebaseEmulatorConfig {\n authPort: number;\n authHost?: string;\n firestorePort: number;\n firestoreHost?: string;\n}\n\nexport interface IFirebaseConfig {\n emulator?: IFirebaseEmulatorConfig;\n //\n projectId: string;\n appId: string;\n measurementId?: string;\n messagingSenderId?: string;\n apiKey: string;\n authDomain: string;\n databaseURL?: string;\n storageBucket?: string;\n}\n\ntype OnlyValidKeys<T, Shape> = T extends Shape\n ? Exclude<keyof T, keyof Shape> extends never\n ? T\n : never\n : never;\n\nexport interface IPosthogSettings {\n readonly token: string;\n readonly config?: OnlyValidKeys<\n Partial<PostHogConfig>,\n Partial<PostHogConfig>\n >;\n}\n\nexport interface IEnvironmentConfig {\n production: boolean;\n useNgrok?: boolean;\n posthog?: IPosthogSettings;\n sentry?: BrowserOptions;\n agents: Record<string, string>;\n firebaseConfig: IFirebaseConfig;\n firebaseBaseUrl?: string;\n}\n\nexport const FirebaseConfigToken = new InjectionToken<IFirebaseConfig>(\n 'firebaseConfig',\n);\nexport const EnvConfigToken = new InjectionToken<IEnvironmentConfig>(\n 'envConfig',\n);\n"]}
@@ -0,0 +1,2 @@
1
+ export const eq = (x, y) => (!x && !y) || x === y;
2
+ //# sourceMappingURL=eq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eq.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/eq.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG,CAAsB,CAAK,EAAE,CAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC","sourcesContent":["export const eq = <T = string | number>(x?: T, y?: T) => (!x && !y) || x === y;\n"]}
@@ -0,0 +1,43 @@
1
+ export function excludeUndefined(o) {
2
+ if (!o) {
3
+ return o;
4
+ }
5
+ return Object.keys(o).reduce((r, k) => {
6
+ const v = o[k];
7
+ if (v !== undefined) {
8
+ r[k] = v;
9
+ }
10
+ return r;
11
+ }, {});
12
+ }
13
+ export function excludeEmpty(o) {
14
+ if (!o) {
15
+ return o;
16
+ }
17
+ return Object.keys(o).reduce((r, k) => {
18
+ const v = o[k];
19
+ if (v !== undefined && v !== '') {
20
+ r[k] = v;
21
+ }
22
+ return r;
23
+ }, {});
24
+ }
25
+ export function undefinedIfEmpty(o) {
26
+ if (!o) {
27
+ return o;
28
+ }
29
+ return Object.keys(o).length === 0 ? undefined : o;
30
+ }
31
+ export function excludeZeroValues(o) {
32
+ if (!o) {
33
+ return o;
34
+ }
35
+ return Object.keys(o).reduce((r, k) => {
36
+ const v = o[k];
37
+ if (v !== undefined && v !== 0) {
38
+ r[k] = v;
39
+ }
40
+ return r;
41
+ }, {});
42
+ }
43
+ //# sourceMappingURL=exclude-undefined.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exclude-undefined.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/exclude-undefined.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB,CAAI,CAAI;IACtC,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,CAAC,GAAI,CAAkB,CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YACpB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC,EAAE,EAAO,CAAiB,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,YAAY,CAAI,CAAI;IAClC,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,CAAC,GAAI,CAAkB,CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC,EAAE,EAAO,CAAiB,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAc,CAAI;IAChD,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAI,CAAI;IACvC,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,CAAC,GAAI,CAAkB,CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/B,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC,EAAE,EAAO,CAAiB,CAAC;AAC9B,CAAC","sourcesContent":["type O = Record<string, unknown>;\n\nexport function excludeUndefined<T>(o: T): T {\n if (!o) {\n return o;\n }\n return Object.keys(o).reduce((r, k) => {\n const v = (o as unknown as O)[k];\n if (v !== undefined) {\n r[k] = v;\n }\n return r;\n }, {} as O) as unknown as T;\n}\n\nexport function excludeEmpty<T>(o: T): T {\n if (!o) {\n return o;\n }\n return Object.keys(o).reduce((r, k) => {\n const v = (o as unknown as O)[k];\n if (v !== undefined && v !== '') {\n r[k] = v;\n }\n return r;\n }, {} as O) as unknown as T;\n}\n\nexport function undefinedIfEmpty<T extends O>(o: T): T | undefined {\n if (!o) {\n return o;\n }\n return Object.keys(o).length === 0 ? undefined : o;\n}\n\nexport function excludeZeroValues<T>(o: T): T {\n if (!o) {\n return o;\n }\n return Object.keys(o).reduce((r, k) => {\n const v = (o as unknown as O)[k];\n if (v !== undefined && v !== 0) {\n r[k] = v;\n }\n return r;\n }, {} as O) as unknown as T;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=form-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-field.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/form-field.ts"],"names":[],"mappings":"","sourcesContent":["export interface IFormField {\n // TODO: This should be in a UI-related package\n readonly hide?: boolean;\n readonly required?: boolean;\n}\n"]}
@@ -0,0 +1,22 @@
1
+ export * from './animations';
2
+ export * from './app.service';
3
+ export * from './core-models';
4
+ export * from './nav';
5
+ export * from './store';
6
+ export * from './sneat-enum-keys';
7
+ export * from './services';
8
+ export * from './exclude-undefined';
9
+ export * from './logging';
10
+ export * from './utils';
11
+ export * from './eq';
12
+ export * from './types';
13
+ export * from './sneat-extensions';
14
+ export * from './form-field';
15
+ export * from './team-type';
16
+ export * from './location-href';
17
+ export * from './interfaces';
18
+ export * from './directives';
19
+ export * from './environment-config';
20
+ export * from './logging/interfaces';
21
+ export * from './analytics.interface';
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './animations';\nexport * from './app.service';\nexport * from './core-models';\nexport * from './nav';\nexport * from './store';\nexport * from './sneat-enum-keys';\nexport * from './services';\nexport * from './exclude-undefined';\nexport * from './logging';\nexport * from './utils';\nexport * from './eq';\nexport * from './types';\nexport * from './sneat-extensions';\nexport * from './form-field';\nexport * from './team-type';\nexport * from './location-href';\nexport * from './interfaces';\nexport * from './directives';\nexport * from './environment-config';\nexport * from './logging/interfaces';\nexport * from './analytics.interface';\n"]}
@@ -0,0 +1,11 @@
1
+ export function equalSpaceRefs(v1, v2) {
2
+ if (v1 === v2) {
3
+ return true;
4
+ }
5
+ return v1?.id === v2?.id && v1?.type === v2?.type;
6
+ }
7
+ export const emptySpaceRef = { id: '' };
8
+ export function spaceItemBriefWithSpaceRefFromBrief(space, id, brief) {
9
+ return { id, brief, space };
10
+ }
11
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/interfaces.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,cAAc,CAC5B,EAAqB,EACrB,EAAqB;IAErB,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,KAAK,EAAE,EAAE,IAAI,CAAC;AACpD,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAc,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAyDnD,MAAM,UAAU,mCAAmC,CACjD,KAAgB,EAChB,EAAU,EACV,KAAY;IAEZ,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["import { SpaceType } from './team-type';\n\nexport interface ISpaceRef {\n readonly id: string;\n readonly type?: SpaceType;\n}\n\nexport function equalSpaceRefs(\n v1?: ISpaceRef | null,\n v2?: ISpaceRef | null,\n): boolean {\n if (v1 === v2) {\n return true;\n }\n return v1?.id === v2?.id && v1?.type === v2?.type;\n}\n\nexport const emptySpaceRef: ISpaceRef = { id: '' };\n\nexport interface IIdAndBrief<Brief> {\n readonly id: string;\n readonly brief: Brief;\n}\n\nexport interface IIdAndBriefWithSpaceRef<Brief> {\n readonly id: string;\n readonly brief: Brief;\n readonly space: ISpaceRef;\n}\n\nexport interface IIdAndOptionalBrief<Brief> {\n readonly id: string;\n readonly brief?: Brief | null;\n}\n\nexport interface IIdAndOptionalDbo<Dbo> {\n readonly id: string;\n readonly dbo?: Dbo | null;\n}\n\nexport interface IIdAndDbo<Dbo> {\n readonly id: string;\n readonly dbo: Dbo;\n}\n\nexport interface IIdAndOptionalBriefAndOptionalDbo<Brief, Dbo extends Brief> {\n readonly id: string;\n readonly brief?: Brief | null;\n readonly dbo?: Dbo | null;\n}\n\nexport interface IIdAndBriefAndOptionalDbo<Brief, Dbo extends Brief> {\n readonly id: string;\n readonly brief: Brief;\n readonly dbo?: Dbo | null;\n}\n\nexport interface IIdAndBriefAndDbo<Brief, Dbo extends Brief> {\n readonly id: string;\n readonly brief: Brief;\n readonly dbo: Dbo;\n}\n\nexport interface ISpaceItemWithBriefAndDbo<\n Brief,\n Dbo extends Brief,\n> extends IIdAndBriefAndDbo<Brief, Dbo> {\n readonly space: ISpaceRef;\n}\n\nexport interface ISpaceItemBriefWithSpace<Brief> extends IIdAndBrief<Brief> {\n readonly space: ISpaceRef;\n}\n\nexport function spaceItemBriefWithSpaceRefFromBrief<Brief>(\n space: ISpaceRef,\n id: string,\n brief: Brief,\n): ISpaceItemBriefWithSpace<Brief> {\n return { id, brief, space };\n}\n\nexport interface IIdAndDboWithSpaceRef<Dbo> extends IIdAndDbo<Dbo> {\n space: ISpaceRef;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export function setHrefQueryParam(param, value, href = location.href) {
2
+ const url = new URL(href);
3
+ url.searchParams.set(param, value);
4
+ return url.href;
5
+ }
6
+ //# sourceMappingURL=location-href.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location-href.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/location-href.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB,CAC/B,KAAa,EACb,KAAa,EACb,IAAI,GAAG,QAAQ,CAAC,IAAI;IAEpB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1B,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACnC,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC","sourcesContent":["export function setHrefQueryParam(\n param: string,\n value: string,\n href = location.href,\n): string {\n const url = new URL(href);\n url.searchParams.set(param, value);\n return url.href;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export const ErrorLogger = new InjectionToken('IErrorLogger');
3
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/logging/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAkB/C,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,cAAc,CAAe,cAAc,CAAC,CAAC","sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface ILogErrorOptions {\n readonly report?: boolean;\n readonly feedback?: boolean;\n readonly show?: boolean;\n readonly showDuration?: number;\n}\n\nexport interface IErrorLogger {\n logError(e: unknown, message?: string, options?: ILogErrorOptions): void;\n\n logErrorHandler(\n message?: string,\n options?: ILogErrorOptions,\n ): (error: unknown) => void;\n}\n\nexport const ErrorLogger = new InjectionToken<IErrorLogger>('IErrorLogger');\n"]}
@@ -0,0 +1,16 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export const LOGGER_FACTORY = new InjectionToken('loggerFactory');
3
+ export const loggerFactory = {
4
+ getLogger(name) {
5
+ if (!name) {
6
+ throw new Error('Logger name is required');
7
+ }
8
+ return {
9
+ debug: console.log,
10
+ info: console.log,
11
+ error: console.error,
12
+ warn: console.warn,
13
+ };
14
+ },
15
+ };
16
+ //# sourceMappingURL=logging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAgB/C,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,cAAc,CAC9C,eAAe,CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAmB;IAC3C,SAAS,CAAC,IAAY;QACpB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO;YACL,KAAK,EAAE,OAAO,CAAC,GAAG;YAClB,IAAI,EAAE,OAAO,CAAC,GAAG;YACjB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface ILogger {\n debug(...v: unknown[]): void;\n\n info(...v: unknown[]): void;\n\n warn(...v: unknown[]): void;\n\n error(...v: unknown[]): void;\n}\n\nexport interface ILoggerFactory {\n getLogger(name: string): ILogger;\n}\n\nexport const LOGGER_FACTORY = new InjectionToken<ILoggerFactory>(\n 'loggerFactory',\n);\n\nexport const loggerFactory: ILoggerFactory = {\n getLogger(name: string): ILogger {\n if (!name) {\n throw new Error('Logger name is required');\n }\n return {\n debug: console.log,\n info: console.log,\n error: console.error,\n warn: console.warn,\n };\n },\n};\n"]}
@@ -0,0 +1,3 @@
1
+ export * from './nav-context';
2
+ export * from './routing-state';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/nav/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './nav-context';\nexport * from './routing-state';\n"]}
@@ -0,0 +1,7 @@
1
+ export {};
2
+ // export interface INavContext<Brief, Dto> {
3
+ // readonly id: string;
4
+ // readonly brief?: Brief | null;
5
+ // readonly dto?: Dto | null;
6
+ // }
7
+ //# sourceMappingURL=nav-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nav-context.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/nav/nav-context.ts"],"names":[],"mappings":";AAWA,6CAA6C;AAC7C,wBAAwB;AACxB,kCAAkC;AAClC,8BAA8B;AAC9B,IAAI","sourcesContent":["import { IIdAndOptionalBriefAndOptionalDbo } from '../interfaces';\n\nexport type SpaceItem = 'happening' | 'contact' | 'document' | 'asset' | 'list';\n\nexport type DeleteOperationState = 'deleting' | 'deleted' | undefined;\n\nexport type INavContext<\n Brief,\n Dbo extends Brief,\n> = IIdAndOptionalBriefAndOptionalDbo<Brief, Dbo>;\n\n// export interface INavContext<Brief, Dto> {\n// \treadonly id: string;\n// \treadonly brief?: Brief | null;\n// \treadonly dto?: Dto | null;\n// }\n"]}
@@ -0,0 +1,29 @@
1
+ import { Injectable, inject } from '@angular/core';
2
+ import { NavigationEnd, Router } from '@angular/router';
3
+ import * as i0 from "@angular/core";
4
+ export class RoutingState {
5
+ constructor() {
6
+ this.history = [];
7
+ const router = inject(Router);
8
+ router.events.subscribe({
9
+ next: (event) => {
10
+ if (event instanceof NavigationEnd) {
11
+ this.history = [...this.history, event.urlAfterRedirects];
12
+ if (this.history.length > 2) {
13
+ this.history.slice(this.history.length - 2, this.history.length);
14
+ }
15
+ }
16
+ },
17
+ });
18
+ }
19
+ hasHistory() {
20
+ return this.history.length > 1;
21
+ }
22
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: RoutingState, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
23
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: RoutingState, providedIn: 'root' }); }
24
+ }
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: RoutingState, decorators: [{
26
+ type: Injectable,
27
+ args: [{ providedIn: 'root' }]
28
+ }], ctorParameters: () => [] });
29
+ //# sourceMappingURL=routing-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routing-state.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/nav/routing-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;;AAGxD,MAAM,OAAO,YAAY;IAGvB;QAFQ,YAAO,GAAa,EAAE,CAAC;QAG7B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAE9B,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;YACtB,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;gBACd,IAAI,KAAK,YAAY,aAAa,EAAE,CAAC;oBACnC,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;oBAC1D,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBAC5B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;oBACnE,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IACjC,CAAC;8GApBU,YAAY;kHAAZ,YAAY,cADC,MAAM;;2FACnB,YAAY;kBADxB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE","sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport { NavigationEnd, Router } from '@angular/router';\n\n@Injectable({ providedIn: 'root' })\nexport class RoutingState {\n private history: string[] = [];\n\n constructor() {\n const router = inject(Router);\n\n router.events.subscribe({\n next: (event) => {\n if (event instanceof NavigationEnd) {\n this.history = [...this.history, event.urlAfterRedirects];\n if (this.history.length > 2) {\n this.history.slice(this.history.length - 2, this.history.length);\n }\n }\n },\n });\n }\n\n public hasHistory(): boolean {\n return this.history.length > 1;\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export * from './top-menu.service';
2
+ export * from './ng-module-preloader.service';
3
+ export * from './sneat-nav.service';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC","sourcesContent":["export * from './top-menu.service';\nexport * from './ng-module-preloader.service';\nexport * from './sneat-nav.service';\n"]}
@@ -0,0 +1,108 @@
1
+ import { Injectable } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class NgModulePreloaderService {
4
+ constructor() {
5
+ this.preloaded = [];
6
+ /*
7
+ 'applicants': './pages/commune/contact/contacts/commune-contacts.page.module#CommuneContactsPageModule',
8
+ 'assets': './pages/commune/asset/assets/assets.module#AssetsPageModule',
9
+ 'commune-overview': './pages/commune/overview/commune-overview.module#CommuneOverviewPageModule',
10
+ 'bills': '',
11
+ 'budget': './pages/commune/budget/budget.module#BudgetPageModule',
12
+ 'staff': './pages/commune/members/staff/staff.module#StaffPageModule',
13
+ 'member': './pages/commune/member/member/commune-member.module#CommuneMemberPageModule',
14
+ 'member-new': './pages/commune/member/member-new/member-new.module#MemberNewPageModule',
15
+ 'members': './pages/commune/members/members/commune-members.module#CommuneMembersPageModule',
16
+ 'group': './pages/commune/member-group/member-group/member-group.module#MemberGrpupPageModule',
17
+ 'group-new': './pages/commune/member-group/member-group-new/member-group-new.module#MemberGroupNewPageModule',
18
+ 'groups': './pages/commune/member-group/member-groups/member-groups.module#MemberGroupsPageModule',
19
+ 'contact': './pages/commune/contact/contact/commune-contact.module#CommuneContactPageModule',
20
+ 'contact-new': './pages/commune/contact/contact-new/contact-new.module#ContactNewPageModule',
21
+ 'contacts': './pages/commune/contact/contacts/commune-contacts.page.module#CommuneContactsPageModule',
22
+ 'document': './pages/commune/document/document/commune-document.module#CommuneDocumentPageModule',
23
+ 'document-new': './pages/commune/document/document-new/document-new.module#DocumentNewPageModule',
24
+ 'documents': './pages/commune/document/documents/commune-documents.module#CommuneDocumentsPageModule',
25
+ 'landlords': './pages/commune/contact/contacts/commune-contacts.page.module#CommuneContactsPageModule',
26
+ 'lists': './shared/listus/commune/list/lists/lists.module#ListsPageModule',
27
+ 'pupils': './pages/commune/members/pupils/pupils.module#PupilsPageModule',
28
+ 'real-estates': './pages/commune/asset/real-estate/real-estate.module#RealEstatePageModule',
29
+ 'schedule': './pages/commune/calendar/schedule/schedule-page.module#SchedulePageModule',
30
+ 'tenants': './pages/commune/contact/contacts/commune-contacts.page.module#CommuneContactsPageModule',
31
+ 'terms': './pages/commune/term/terms/terms.module#TermsPageModule',
32
+ 'tasks': './pages/commune/todo/tasks/tasks-page.module#TasksPageModule',
33
+ */
34
+ this.configs = {}; // Use addPreloadConfigs
35
+ this.warned = false;
36
+ }
37
+ /*
38
+ * https://blog.angularindepth.com/as-busy-as-a-bee-lazy-loading-in-the-angular-cli-d2812141637f
39
+ * https://blog.angularindepth.com/here-is-what-you-need-to-know-about-dynamic-components-in-angular-ac1e96167f9e
40
+ */
41
+ // constructor(
42
+ // // private readonly injector: Injector,
43
+ // // private loader: NgModuleFactoryLoader,
44
+ // ) {
45
+ // }
46
+ addPreloadConfigs(...configs) {
47
+ configs.forEach((config) => {
48
+ this.configs[config.id] = { path: config.path, type: config.type };
49
+ });
50
+ }
51
+ markAsPreloaded(path) {
52
+ this.preloaded.push(path);
53
+ }
54
+ preload(paths, ms = 1000) {
55
+ if (!this.warned) {
56
+ this.warned = true;
57
+ console.warn(`Preloading is disabled until migrated to Ivy (delay=${ms}ms)`);
58
+ }
59
+ return; // TODO: Enable preloading once migrated to Angular Ivy
60
+ // setTimeout(
61
+ // () => {
62
+ // paths = paths.filter(p => !this.preloaded.includes(p));
63
+ // if (!paths.length) {
64
+ // return;
65
+ // }
66
+ // console.log('preloading:', paths);
67
+ // paths.forEach(p => {
68
+ // if (this.preloaded.includes(p)) {
69
+ // return;
70
+ // }
71
+ // const config = this.configs[p];
72
+ // if (!config) {
73
+ // console.error('Unknown preload id:', p);
74
+ // return;
75
+ // }
76
+ // this.loader.load(config.path)
77
+ // .then((factory) => {
78
+ // console.log('preloaded:', factory);
79
+ // this.preloaded.push(p);
80
+ // if (config.type) {
81
+ // try {
82
+ // const module = factory.create(this.injector);
83
+ // const cf = module.componentFactoryResolver.resolveComponentFactory(config.type);
84
+ // const cr = cf.create(this.injector);
85
+ // cr.destroy();
86
+ // } catch (e) {
87
+ // console.error(`Failed to create or destroy preloaded component ${config.path}:`, e);
88
+ // }
89
+ // }
90
+ // })
91
+ // .catch(err => {
92
+ // console.error('Failed to preload NG module:', err);
93
+ // });
94
+ // });
95
+ // },
96
+ // ms,
97
+ // );
98
+ }
99
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NgModulePreloaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
100
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NgModulePreloaderService, providedIn: 'root' }); }
101
+ }
102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NgModulePreloaderService, decorators: [{
103
+ type: Injectable,
104
+ args: [{
105
+ providedIn: 'root',
106
+ }]
107
+ }] });
108
+ //# sourceMappingURL=ng-module-preloader.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ng-module-preloader.service.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/services/ng-module-preloader.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,eAAe,CAAC;;AAYjD,MAAM,OAAO,wBAAwB;IAHrC;QAImB,cAAS,GAAa,EAAE,CAAC;QAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;aA2BE;QACe,YAAO,GAGpB,EAAE,CAAC,CAAC,wBAAwB;QAExB,WAAM,GAAG,KAAK,CAAC;KA4ExB;IA1EC;;;OAGG;IACH,eAAe;IACf,2CAA2C;IAC3C,6CAA6C;IAC7C,MAAM;IACN,IAAI;IAEG,iBAAiB,CACtB,GAAG,OAKA;QAEH,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YACzB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QACrE,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,eAAe,CAAC,IAAY;QACjC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAEM,OAAO,CAAC,KAAe,EAAE,EAAE,GAAG,IAAI;QACvC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,OAAO,CAAC,IAAI,CACV,uDAAuD,EAAE,KAAK,CAC/D,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,uDAAuD;QAC/D,cAAc;QACd,WAAW;QACX,4DAA4D;QAC5D,yBAAyB;QACzB,aAAa;QACb,MAAM;QACN,uCAAuC;QACvC,yBAAyB;QACzB,uCAAuC;QACvC,cAAc;QACd,OAAO;QACP,qCAAqC;QACrC,oBAAoB;QACpB,+CAA+C;QAC/C,cAAc;QACd,OAAO;QACP,oCAAoC;QACpC,4BAA4B;QAC5B,4CAA4C;QAC5C,gCAAgC;QAChC,2BAA2B;QAC3B,eAAe;QACf,wDAAwD;QACxD,2FAA2F;QAC3F,+CAA+C;QAC/C,wBAAwB;QACxB,uBAAuB;QACvB,+FAA+F;QAC/F,WAAW;QACX,UAAU;QACV,UAAU;QACV,uBAAuB;QACvB,4DAA4D;QAC5D,WAAW;QACX,QAAQ;QACR,MAAM;QACN,OAAO;QACP,KAAK;IACP,CAAC;8GA/GU,wBAAwB;kHAAxB,wBAAwB,cAFvB,MAAM;;2FAEP,wBAAwB;kBAHpC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable, Type } from '@angular/core';\n\nexport type PreloadPages =\n | 'assets'\n | 'contacts'\n | 'members'\n | 'real-estates'\n | 'budget';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgModulePreloaderService {\n private readonly preloaded: string[] = [];\n\n /*\n\t\t 'applicants': './pages/commune/contact/contacts/commune-contacts.page.module#CommuneContactsPageModule',\n\t\t 'assets': './pages/commune/asset/assets/assets.module#AssetsPageModule',\n\t\t 'commune-overview': './pages/commune/overview/commune-overview.module#CommuneOverviewPageModule',\n\t\t 'bills': '',\n\t\t 'budget': './pages/commune/budget/budget.module#BudgetPageModule',\n\t\t 'staff': './pages/commune/members/staff/staff.module#StaffPageModule',\n\t\t 'member': './pages/commune/member/member/commune-member.module#CommuneMemberPageModule',\n\t\t 'member-new': './pages/commune/member/member-new/member-new.module#MemberNewPageModule',\n\t\t 'members': './pages/commune/members/members/commune-members.module#CommuneMembersPageModule',\n\t\t 'group': './pages/commune/member-group/member-group/member-group.module#MemberGrpupPageModule',\n\t\t 'group-new': './pages/commune/member-group/member-group-new/member-group-new.module#MemberGroupNewPageModule',\n\t\t 'groups': './pages/commune/member-group/member-groups/member-groups.module#MemberGroupsPageModule',\n\t\t 'contact': './pages/commune/contact/contact/commune-contact.module#CommuneContactPageModule',\n\t\t 'contact-new': './pages/commune/contact/contact-new/contact-new.module#ContactNewPageModule',\n\t\t 'contacts': './pages/commune/contact/contacts/commune-contacts.page.module#CommuneContactsPageModule',\n\t\t 'document': './pages/commune/document/document/commune-document.module#CommuneDocumentPageModule',\n\t\t 'document-new': './pages/commune/document/document-new/document-new.module#DocumentNewPageModule',\n\t\t 'documents': './pages/commune/document/documents/commune-documents.module#CommuneDocumentsPageModule',\n\t\t 'landlords': './pages/commune/contact/contacts/commune-contacts.page.module#CommuneContactsPageModule',\n\t\t 'lists': './shared/listus/commune/list/lists/lists.module#ListsPageModule',\n\t\t 'pupils': './pages/commune/members/pupils/pupils.module#PupilsPageModule',\n\t\t 'real-estates': './pages/commune/asset/real-estate/real-estate.module#RealEstatePageModule',\n\t\t 'schedule': './pages/commune/calendar/schedule/schedule-page.module#SchedulePageModule',\n\t\t 'tenants': './pages/commune/contact/contacts/commune-contacts.page.module#CommuneContactsPageModule',\n\t\t 'terms': './pages/commune/term/terms/terms.module#TermsPageModule',\n\t\t 'tasks': './pages/commune/todo/tasks/tasks-page.module#TasksPageModule',\n\t */\n private readonly configs: Record<\n string,\n { path: string; type: Type<unknown> }\n > = {}; // Use addPreloadConfigs\n\n private warned = false;\n\n /*\n * https://blog.angularindepth.com/as-busy-as-a-bee-lazy-loading-in-the-angular-cli-d2812141637f\n * https://blog.angularindepth.com/here-is-what-you-need-to-know-about-dynamic-components-in-angular-ac1e96167f9e\n */\n // constructor(\n // \t// private readonly injector: Injector,\n // \t// private loader: NgModuleFactoryLoader,\n // ) {\n // }\n\n public addPreloadConfigs(\n ...configs: {\n id: string;\n path: string;\n type: Type<unknown>;\n module?: string;\n }[]\n ): void {\n configs.forEach((config) => {\n this.configs[config.id] = { path: config.path, type: config.type };\n });\n }\n\n public markAsPreloaded(path: string): void {\n this.preloaded.push(path);\n }\n\n public preload(paths: string[], ms = 1000): void {\n if (!this.warned) {\n this.warned = true;\n console.warn(\n `Preloading is disabled until migrated to Ivy (delay=${ms}ms)`,\n );\n }\n return; // TODO: Enable preloading once migrated to Angular Ivy\n // setTimeout(\n // \t() => {\n // \t\tpaths = paths.filter(p => !this.preloaded.includes(p));\n // \t\tif (!paths.length) {\n // \t\t\treturn;\n // \t\t}\n // \t\tconsole.log('preloading:', paths);\n // \t\tpaths.forEach(p => {\n // \t\t\tif (this.preloaded.includes(p)) {\n // \t\t\t\treturn;\n // \t\t\t}\n // \t\t\tconst config = this.configs[p];\n // \t\t\tif (!config) {\n // \t\t\t\tconsole.error('Unknown preload id:', p);\n // \t\t\t\treturn;\n // \t\t\t}\n // \t\t\t\tthis.loader.load(config.path)\n // \t\t\t\t\t.then((factory) => {\n // \t\t\t\t\t\tconsole.log('preloaded:', factory);\n // \t\t\t\t\t\tthis.preloaded.push(p);\n // \t\t\t\t\t\tif (config.type) {\n // \t\t\t\t\t\t\ttry {\n // \t\t\t\t\t\t\t\tconst module = factory.create(this.injector);\n // \t\t\t\t\t\t\t\tconst cf = module.componentFactoryResolver.resolveComponentFactory(config.type);\n // \t\t\t\t\t\t\t\tconst cr = cf.create(this.injector);\n // \t\t\t\t\t\t\t\tcr.destroy();\n // \t\t\t\t\t\t\t} catch (e) {\n // \t\t\t\t\t\t\t\tconsole.error(`Failed to create or destroy preloaded component ${config.path}:`, e);\n // \t\t\t\t\t\t\t}\n // \t\t\t\t\t\t}\n // \t\t\t\t\t})\n // \t\t\t\t\t.catch(err => {\n // \t\t\t\t\t\tconsole.error('Failed to preload NG module:', err);\n // \t\t\t\t\t});\n // \t\t});\n // \t},\n // \tms,\n // );\n }\n}\n"]}
@@ -0,0 +1,41 @@
1
+ import { Location } from '@angular/common';
2
+ import { Injectable, inject } from '@angular/core';
3
+ import { NavigationEnd, Router, } from '@angular/router';
4
+ import { NavController } from '@ionic/angular/standalone';
5
+ import * as i0 from "@angular/core";
6
+ export class SneatNavService {
7
+ constructor() {
8
+ this.router = inject(Router);
9
+ this.location = inject(Location);
10
+ this.navController = inject(NavController);
11
+ const router = this.router;
12
+ router.events.subscribe((event) => {
13
+ if (event instanceof NavigationEnd) {
14
+ this.previous = event;
15
+ }
16
+ });
17
+ }
18
+ goBack(url, extras) {
19
+ if (this.previous) {
20
+ this.navController.pop().then((isPopped) => {
21
+ if (!isPopped) {
22
+ this.location.back();
23
+ }
24
+ });
25
+ }
26
+ else {
27
+ this.router
28
+ .navigateByUrl(url, extras)
29
+ .catch((err) => console.error('SneatNavService.goBack() - failed to navigate', err));
30
+ }
31
+ }
32
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SneatNavService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
33
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SneatNavService, providedIn: 'root' }); }
34
+ }
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SneatNavService, decorators: [{
36
+ type: Injectable,
37
+ args: [{
38
+ providedIn: 'root',
39
+ }]
40
+ }], ctorParameters: () => [] });
41
+ //# sourceMappingURL=sneat-nav.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sneat-nav.service.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/services/sneat-nav.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAEL,aAAa,EACb,MAAM,GAEP,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;;AAK1D,MAAM,OAAO,eAAe;IAO1B;QANiB,WAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QACxB,aAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC5B,kBAAa,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;QAKrD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAE3B,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YAChC,IAAI,KAAK,YAAY,aAAa,EAAE,CAAC;gBACnC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACxB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,GAAqB,EAAE,MAAkC;QAC9D,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACzC,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACd,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;gBACvB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM;iBACR,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC;iBAC1B,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CACb,OAAO,CAAC,KAAK,CAAC,+CAA+C,EAAE,GAAG,CAAC,CACpE,CAAC;QACN,CAAC;IACH,CAAC;8GA/BU,eAAe;kHAAf,eAAe,cAFd,MAAM;;2FAEP,eAAe;kBAH3B,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Location } from '@angular/common';\nimport { Injectable, inject } from '@angular/core';\nimport {\n NavigationBehaviorOptions,\n NavigationEnd,\n Router,\n UrlTree,\n} from '@angular/router';\nimport { NavController } from '@ionic/angular/standalone';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SneatNavService {\n private readonly router = inject(Router);\n private readonly location = inject(Location);\n private readonly navController = inject(NavController);\n\n private previous?: NavigationEnd;\n\n constructor() {\n const router = this.router;\n\n router.events.subscribe((event) => {\n if (event instanceof NavigationEnd) {\n this.previous = event;\n }\n });\n }\n\n goBack(url: string | UrlTree, extras?: NavigationBehaviorOptions): void {\n if (this.previous) {\n this.navController.pop().then((isPopped) => {\n if (!isPopped) {\n this.location.back();\n }\n });\n } else {\n this.router\n .navigateByUrl(url, extras)\n .catch((err) =>\n console.error('SneatNavService.goBack() - failed to navigate', err),\n );\n }\n }\n}\n"]}