@ethlete/core 0.2.0-next.2 → 0.2.0-next.20

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 (146) hide show
  1. package/esm2020/lib/components/public-api.mjs +2 -0
  2. package/esm2020/lib/components/structured-data/public-api.mjs +2 -0
  3. package/esm2020/lib/components/structured-data/structured-data.component.mjs +37 -0
  4. package/esm2020/lib/directives/click-outside/click-outside.directive.mjs +37 -0
  5. package/esm2020/lib/directives/click-outside/public-api.mjs +2 -0
  6. package/esm2020/lib/directives/cursor-drag-scroll/cursor-drag-scroll.constants.mjs +3 -0
  7. package/esm2020/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +147 -0
  8. package/esm2020/lib/directives/cursor-drag-scroll/public-api.mjs +2 -0
  9. package/esm2020/lib/directives/let/let.directive.mjs +8 -8
  10. package/esm2020/lib/directives/observe-content/observe-content.directive.mjs +11 -11
  11. package/esm2020/lib/directives/observe-resize/observe-resize.directive.mjs +11 -12
  12. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.constants.mjs +3 -0
  13. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +171 -0
  14. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.types.mjs +2 -0
  15. package/esm2020/lib/directives/observe-scroll-state/public-api.mjs +3 -0
  16. package/esm2020/lib/directives/public-api.mjs +10 -3
  17. package/esm2020/lib/directives/repeat/repeat.directive.mjs +10 -11
  18. package/esm2020/lib/directives/scroll-observer-first-element/index.mjs +2 -0
  19. package/esm2020/lib/directives/scroll-observer-first-element/public-api.mjs +2 -0
  20. package/esm2020/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.mjs +31 -0
  21. package/esm2020/lib/directives/scroll-observer-ignore-target/index.mjs +2 -0
  22. package/esm2020/lib/directives/scroll-observer-ignore-target/public-api.mjs +2 -0
  23. package/esm2020/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +18 -0
  24. package/esm2020/lib/directives/scroll-observer-last-element/index.mjs +2 -0
  25. package/esm2020/lib/directives/scroll-observer-last-element/public-api.mjs +2 -0
  26. package/esm2020/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.mjs +34 -0
  27. package/esm2020/lib/directives/seo/public-api.mjs +5 -0
  28. package/esm2020/lib/directives/seo/seo.directive.constants.mjs +3 -0
  29. package/esm2020/lib/directives/seo/seo.directive.mjs +166 -0
  30. package/esm2020/lib/directives/seo/seo.directive.types.mjs +2 -0
  31. package/esm2020/lib/directives/seo/seo.directive.utils.mjs +7 -0
  32. package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.mjs +15 -0
  33. package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.types.mjs +2 -0
  34. package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.util.mjs +34 -0
  35. package/esm2020/lib/pipes/normalize-game-result-type/public-api.mjs +4 -0
  36. package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.mjs +15 -0
  37. package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.types.mjs +2 -0
  38. package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.util.mjs +47 -0
  39. package/esm2020/lib/pipes/normalize-match-participants/public-api.mjs +4 -0
  40. package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.pipe.mjs +15 -0
  41. package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.types.mjs +2 -0
  42. package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.util.mjs +126 -0
  43. package/esm2020/lib/pipes/normalize-match-score/public-api.mjs +4 -0
  44. package/esm2020/lib/pipes/normalize-match-state/index.mjs +2 -0
  45. package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.constants.mjs +2 -0
  46. package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.pipe.mjs +15 -0
  47. package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.util.mjs +19 -0
  48. package/esm2020/lib/pipes/normalize-match-state/public-api.mjs +4 -0
  49. package/esm2020/lib/pipes/normalize-match-type/normalize-match-type.pipe.mjs +15 -0
  50. package/esm2020/lib/pipes/normalize-match-type/normalize-match-type.util.mjs +38 -0
  51. package/esm2020/lib/pipes/normalize-match-type/public-api.mjs +3 -0
  52. package/esm2020/lib/pipes/public-api.mjs +6 -1
  53. package/esm2020/lib/pipes/to-array/to-array.pipe.mjs +3 -3
  54. package/esm2020/lib/public-api.mjs +2 -1
  55. package/esm2020/lib/services/click-observer.service.mjs +73 -0
  56. package/esm2020/lib/services/content-observer.service.mjs +6 -6
  57. package/esm2020/lib/services/destroy.service.mjs +19 -0
  58. package/esm2020/lib/services/focus-visible.service.mjs +7 -7
  59. package/esm2020/lib/services/public-api.mjs +7 -4
  60. package/esm2020/lib/services/resize-observer.service.mjs +6 -6
  61. package/esm2020/lib/services/router-state.service.mjs +81 -0
  62. package/esm2020/lib/services/viewport.service.mjs +16 -16
  63. package/esm2020/lib/types/angular.types.mjs +36 -2
  64. package/esm2020/lib/types/i18n.types.mjs +2 -0
  65. package/esm2020/lib/types/public-api.mjs +3 -2
  66. package/esm2020/lib/utils/clone.util.mjs +78 -0
  67. package/esm2020/lib/utils/cookie.util.mjs +48 -0
  68. package/esm2020/lib/utils/equal.util.mjs +118 -0
  69. package/esm2020/lib/utils/index.mjs +2 -0
  70. package/esm2020/lib/utils/public-api.mjs +7 -2
  71. package/esm2020/lib/utils/reactive-binding.util.mjs +111 -0
  72. package/esm2020/lib/utils/scrollable.utils.mjs +5 -0
  73. package/fesm2015/ethlete-core.mjs +1788 -289
  74. package/fesm2015/ethlete-core.mjs.map +1 -1
  75. package/fesm2020/ethlete-core.mjs +1784 -288
  76. package/fesm2020/ethlete-core.mjs.map +1 -1
  77. package/lib/components/public-api.d.ts +1 -0
  78. package/lib/components/structured-data/public-api.d.ts +1 -0
  79. package/lib/components/structured-data/structured-data.component.d.ts +11 -0
  80. package/lib/directives/click-outside/click-outside.directive.d.ts +12 -0
  81. package/lib/directives/click-outside/public-api.d.ts +1 -0
  82. package/lib/directives/cursor-drag-scroll/cursor-drag-scroll.constants.d.ts +2 -0
  83. package/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.d.ts +27 -0
  84. package/lib/directives/cursor-drag-scroll/public-api.d.ts +1 -0
  85. package/lib/directives/let/let.directive.d.ts +1 -1
  86. package/lib/directives/observe-content/observe-content.directive.d.ts +2 -4
  87. package/lib/directives/observe-resize/observe-resize.directive.d.ts +3 -5
  88. package/lib/directives/observe-scroll-state/observe-scroll-state.constants.d.ts +3 -0
  89. package/lib/directives/observe-scroll-state/observe-scroll-state.directive.d.ts +31 -0
  90. package/lib/directives/observe-scroll-state/observe-scroll-state.types.d.ts +6 -0
  91. package/lib/directives/observe-scroll-state/public-api.d.ts +3 -0
  92. package/lib/directives/public-api.d.ts +9 -2
  93. package/lib/directives/repeat/repeat.directive.d.ts +3 -4
  94. package/lib/directives/scroll-observer-first-element/index.d.ts +1 -0
  95. package/lib/directives/scroll-observer-first-element/public-api.d.ts +1 -0
  96. package/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.d.ts +10 -0
  97. package/lib/directives/scroll-observer-ignore-target/index.d.ts +1 -0
  98. package/lib/directives/scroll-observer-ignore-target/public-api.d.ts +1 -0
  99. package/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.d.ts +6 -0
  100. package/lib/directives/scroll-observer-last-element/index.d.ts +1 -0
  101. package/lib/directives/scroll-observer-last-element/public-api.d.ts +1 -0
  102. package/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.d.ts +10 -0
  103. package/lib/directives/seo/public-api.d.ts +4 -0
  104. package/lib/directives/seo/seo.directive.constants.d.ts +3 -0
  105. package/lib/directives/seo/seo.directive.d.ts +21 -0
  106. package/lib/directives/seo/seo.directive.types.d.ts +51 -0
  107. package/lib/directives/seo/seo.directive.utils.d.ts +2 -0
  108. package/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.d.ts +7 -0
  109. package/lib/pipes/normalize-game-result-type/normalize-game-result-type.types.d.ts +4 -0
  110. package/lib/pipes/normalize-game-result-type/normalize-game-result-type.util.d.ts +2 -0
  111. package/lib/pipes/normalize-game-result-type/public-api.d.ts +3 -0
  112. package/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.d.ts +7 -0
  113. package/lib/pipes/normalize-match-participants/normalize-match-participants.types.d.ts +21 -0
  114. package/lib/pipes/normalize-match-participants/normalize-match-participants.util.d.ts +4 -0
  115. package/lib/pipes/normalize-match-participants/public-api.d.ts +3 -0
  116. package/lib/pipes/normalize-match-score/normalize-match-score.pipe.d.ts +7 -0
  117. package/lib/pipes/normalize-match-score/normalize-match-score.types.d.ts +12 -0
  118. package/lib/pipes/normalize-match-score/normalize-match-score.util.d.ts +27 -0
  119. package/lib/pipes/normalize-match-score/public-api.d.ts +3 -0
  120. package/lib/pipes/normalize-match-state/index.d.ts +1 -0
  121. package/lib/pipes/normalize-match-state/normalize-match-state.constants.d.ts +7 -0
  122. package/lib/pipes/normalize-match-state/normalize-match-state.pipe.d.ts +7 -0
  123. package/lib/pipes/normalize-match-state/normalize-match-state.util.d.ts +3 -0
  124. package/lib/pipes/normalize-match-state/public-api.d.ts +3 -0
  125. package/lib/pipes/normalize-match-type/normalize-match-type.pipe.d.ts +7 -0
  126. package/lib/pipes/normalize-match-type/normalize-match-type.util.d.ts +3 -0
  127. package/lib/pipes/normalize-match-type/public-api.d.ts +2 -0
  128. package/lib/pipes/public-api.d.ts +5 -0
  129. package/lib/public-api.d.ts +1 -0
  130. package/lib/services/click-observer.service.d.ts +21 -0
  131. package/lib/services/destroy.service.d.ts +9 -0
  132. package/lib/services/public-api.d.ts +6 -3
  133. package/lib/services/router-state.service.d.ts +34 -0
  134. package/lib/services/viewport.types.d.ts +1 -1
  135. package/lib/types/angular.types.d.ts +14 -1
  136. package/lib/types/i18n.types.d.ts +4 -0
  137. package/lib/types/public-api.d.ts +2 -1
  138. package/lib/types/viewport.types.d.ts +2 -2
  139. package/lib/utils/clone.util.d.ts +15 -0
  140. package/lib/utils/cookie.util.d.ts +5 -0
  141. package/lib/utils/equal.util.d.ts +27 -0
  142. package/lib/utils/index.d.ts +1 -0
  143. package/lib/utils/public-api.d.ts +6 -1
  144. package/lib/utils/reactive-binding.util.d.ts +19 -0
  145. package/lib/utils/scrollable.utils.d.ts +1 -0
  146. package/package.json +9 -5
@@ -1,12 +1,48 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Directive, Input, Injectable, Inject, Optional, inject, EventEmitter, Output, Pipe } from '@angular/core';
3
- import { coerceNumberProperty, coerceElement, coerceBooleanProperty } from '@angular/cdk/coercion';
4
- import { BehaviorSubject, combineLatest, map, shareReplay, Observable, Subject, debounceTime } from 'rxjs';
2
+ import { inject, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, InjectionToken, Injectable, Inject, Optional, ElementRef, EventEmitter, Directive, Output, NgZone, Pipe, QueryList } from '@angular/core';
3
+ import { DomSanitizer, Meta, Title } from '@angular/platform-browser';
4
+ import { coerceElement, coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
5
+ import { fromEvent, Observable, Subject, BehaviorSubject, filter, distinctUntilChanged, map, pairwise, combineLatest, shareReplay, takeUntil, startWith, debounceTime, tap, take } from 'rxjs';
6
+ import { DOCUMENT } from '@angular/common';
7
+ import { Router, NavigationEnd } from '@angular/router';
5
8
  import { __decorate, __metadata } from 'tslib';
6
9
  import * as i1 from '@angular/cdk/layout';
7
- import { DOCUMENT } from '@angular/common';
8
10
  import { debounceTime as debounceTime$1 } from 'rxjs/operators';
9
11
 
12
+ class StructuredDataComponent {
13
+ constructor() {
14
+ this._sanitizer = inject(DomSanitizer);
15
+ }
16
+ set data(currentValue) {
17
+ this.jsonLD = this.getSafeHTML(currentValue);
18
+ }
19
+ getSafeHTML(value) {
20
+ const json = value ? JSON.stringify(value, null, 2).replace(/<\/script>/g, '<\\/script>') : '';
21
+ const html = `<script type="application/ld+json">${json}</script>`;
22
+ return this._sanitizer.bypassSecurityTrustHtml(html);
23
+ }
24
+ }
25
+ StructuredDataComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: StructuredDataComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
26
+ StructuredDataComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: StructuredDataComponent, isStandalone: true, selector: "et-structured-data", inputs: { data: "data" }, host: { properties: { "innerHTML": "this.jsonLD" }, styleAttribute: "display: none" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: StructuredDataComponent, decorators: [{
28
+ type: Component,
29
+ args: [{
30
+ selector: 'et-structured-data',
31
+ standalone: true,
32
+ template: '',
33
+ changeDetection: ChangeDetectionStrategy.OnPush,
34
+ encapsulation: ViewEncapsulation.None,
35
+ host: {
36
+ style: 'display: none',
37
+ },
38
+ }]
39
+ }], propDecorators: { data: [{
40
+ type: Input
41
+ }], jsonLD: [{
42
+ type: HostBinding,
43
+ args: ['innerHTML']
44
+ }] } });
45
+
10
46
  const VIEWPORT_CONFIG = new InjectionToken('ViewportConfig');
11
47
  /**
12
48
  * Default viewport config based on Tailwind CSS.
@@ -50,127 +86,375 @@ const Memo = (config = {}) => (_, __, descriptor) => {
50
86
  return descriptor;
51
87
  };
52
88
 
53
- class LetContext {
54
- constructor() {
55
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
56
- this.$implicit = null;
57
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
58
- this.etLet = null;
89
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
90
+ class ClickObserverFactory {
91
+ create() {
92
+ return fromEvent(document, 'click');
59
93
  }
60
94
  }
61
-
62
- class LetDirective {
63
- constructor(_viewContainer, templateRef) {
64
- this._viewContainer = _viewContainer;
65
- this._context = new LetContext();
66
- this._templateRef = null;
67
- this._viewRef = null;
68
- this._templateRef = templateRef;
95
+ ClickObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
96
+ ClickObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverFactory, providedIn: 'root' });
97
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverFactory, decorators: [{
98
+ type: Injectable,
99
+ args: [{ providedIn: 'root' }]
100
+ }] });
101
+ class ClickObserverService {
102
+ constructor(_clickObserverFactory) {
103
+ this._clickObserverFactory = _clickObserverFactory;
104
+ this._observedElements = new Map();
69
105
  }
70
- set etLet(value) {
71
- this._context.$implicit = this._context.etLet = value;
72
- this._updateView();
106
+ ngOnDestroy() {
107
+ this._observedElements.forEach((_, element) => this._cleanupObserver(element));
73
108
  }
74
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
75
- static ngTemplateContextGuard(dir, ctx) {
76
- return true;
109
+ observe(elementOrRef) {
110
+ const element = coerceElement(elementOrRef);
111
+ return new Observable((observer) => {
112
+ const stream = this._observeElement(element);
113
+ const subscription = stream.subscribe(observer);
114
+ return () => {
115
+ subscription.unsubscribe();
116
+ this._unobserveElement(element);
117
+ };
118
+ });
77
119
  }
78
- _updateView() {
79
- if (!this._viewRef) {
80
- this._viewContainer.clear();
81
- if (this._templateRef) {
82
- this._viewRef = this._viewContainer.createEmbeddedView(this._templateRef, this._context);
120
+ _observeElement(element) {
121
+ if (!this._observedElements.has(element)) {
122
+ const stream = new Subject();
123
+ const observer = this._clickObserverFactory.create();
124
+ const sub = observer.subscribe((event) => stream.next(event));
125
+ this._observedElements.set(element, { observer: sub, stream, count: 1 });
126
+ }
127
+ else {
128
+ this._observedElements.get(element).count++;
129
+ }
130
+ return this._observedElements.get(element).stream;
131
+ }
132
+ _unobserveElement(element) {
133
+ if (this._observedElements.has(element)) {
134
+ this._observedElements.get(element).count--;
135
+ if (!this._observedElements.get(element).count) {
136
+ this._cleanupObserver(element);
137
+ }
138
+ }
139
+ }
140
+ _cleanupObserver(element) {
141
+ if (this._observedElements.has(element)) {
142
+ const { observer, stream } = this._observedElements.get(element);
143
+ if (observer) {
144
+ observer.unsubscribe();
83
145
  }
146
+ stream.complete();
147
+ this._observedElements.delete(element);
84
148
  }
85
149
  }
86
150
  }
87
- LetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: LetDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
88
- LetDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 });
89
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: LetDirective, decorators: [{
90
- type: Directive,
91
- args: [{
92
- selector: '[etLet]',
93
- standalone: true,
94
- }]
95
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { etLet: [{
96
- type: Input
97
- }] } });
151
+ ClickObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverService, deps: [{ token: ClickObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
152
+ ClickObserverServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverService, providedIn: 'root' });
153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverService, decorators: [{
154
+ type: Injectable,
155
+ args: [{ providedIn: 'root' }]
156
+ }], ctorParameters: function () { return [{ type: ClickObserverFactory }]; } });
98
157
 
99
- class RepeatDirective {
100
- constructor(_mainTemplateRef, _viewContainerRef) {
101
- this._mainTemplateRef = _mainTemplateRef;
102
- this._viewContainerRef = _viewContainerRef;
103
- this._repeatCount = 2;
158
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
159
+ class MutationObserverFactory {
160
+ create(callback) {
161
+ return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
104
162
  }
105
- get repeatCount() {
106
- return this._repeatCount;
163
+ }
164
+ MutationObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
165
+ MutationObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' });
166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: MutationObserverFactory, decorators: [{
167
+ type: Injectable,
168
+ args: [{ providedIn: 'root' }]
169
+ }] });
170
+ class ContentObserverService {
171
+ constructor(_mutationObserverFactory) {
172
+ this._mutationObserverFactory = _mutationObserverFactory;
173
+ this._observedElements = new Map();
107
174
  }
108
- set repeatCount(value) {
109
- this._repeatCount = coerceNumberProperty(value);
175
+ ngOnDestroy() {
176
+ this._observedElements.forEach((_, element) => this._cleanupObserver(element));
110
177
  }
111
- ngOnInit() {
112
- this._render();
178
+ observe(elementOrRef) {
179
+ const element = coerceElement(elementOrRef);
180
+ return new Observable((observer) => {
181
+ const stream = this._observeElement(element);
182
+ const subscription = stream.subscribe(observer);
183
+ return () => {
184
+ subscription.unsubscribe();
185
+ this._unobserveElement(element);
186
+ };
187
+ });
113
188
  }
114
- _render() {
115
- for (let i = 0; i < this.repeatCount; i++) {
116
- this._viewContainerRef.createEmbeddedView(this._mainTemplateRef);
189
+ _observeElement(element) {
190
+ if (!this._observedElements.has(element)) {
191
+ const stream = new Subject();
192
+ const observer = this._mutationObserverFactory.create((mutations) => stream.next(mutations));
193
+ if (observer) {
194
+ observer.observe(element, {
195
+ characterData: true,
196
+ childList: true,
197
+ subtree: true,
198
+ });
199
+ }
200
+ this._observedElements.set(element, { observer, stream, count: 1 });
201
+ }
202
+ else {
203
+ this._observedElements.get(element).count++;
204
+ }
205
+ return this._observedElements.get(element).stream;
206
+ }
207
+ _unobserveElement(element) {
208
+ if (this._observedElements.has(element)) {
209
+ this._observedElements.get(element).count--;
210
+ if (!this._observedElements.get(element).count) {
211
+ this._cleanupObserver(element);
212
+ }
213
+ }
214
+ }
215
+ _cleanupObserver(element) {
216
+ if (this._observedElements.has(element)) {
217
+ const { observer, stream } = this._observedElements.get(element);
218
+ if (observer) {
219
+ observer.disconnect();
220
+ }
221
+ stream.complete();
222
+ this._observedElements.delete(element);
117
223
  }
118
224
  }
119
225
  }
120
- RepeatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: RepeatDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
121
- RepeatDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 });
122
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: RepeatDirective, decorators: [{
123
- type: Directive,
124
- args: [{
125
- selector: '[etRepeat]',
126
- standalone: true,
127
- }]
128
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { repeatCount: [{
129
- type: Input,
130
- args: ['etRepeat']
131
- }] } });
226
+ ContentObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ContentObserverService, deps: [{ token: MutationObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
227
+ ContentObserverServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ContentObserverService, providedIn: 'root' });
228
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ContentObserverService, decorators: [{
229
+ type: Injectable,
230
+ args: [{ providedIn: 'root' }]
231
+ }], ctorParameters: function () { return [{ type: MutationObserverFactory }]; } });
132
232
 
133
- class ViewportService {
134
- constructor(_viewportConfig, _breakpointObserver) {
135
- this._breakpointObserver = _breakpointObserver;
136
- this._isXs$ = new BehaviorSubject(false);
137
- this._isSm$ = new BehaviorSubject(false);
138
- this._isMd$ = new BehaviorSubject(false);
139
- this._isLg$ = new BehaviorSubject(false);
140
- this._isXl$ = new BehaviorSubject(false);
141
- this._is2Xl$ = new BehaviorSubject(false);
142
- this.currentViewport$ = combineLatest([this.isXs$, this.isSm$, this.isMd$, this.isLg$, this.isXl$, this.is2Xl$]).pipe(map((val) => this.getCurrentViewport(val)), shareReplay());
143
- this._viewportConfig = _viewportConfig || DEFAULT_VIEWPORT_CONFIG;
144
- this._observeDefaultBreakpoints();
233
+ class DestroyService {
234
+ constructor() {
235
+ this._destroy$ = new Subject();
236
+ this.destroy$ = this._destroy$.asObservable();
145
237
  }
146
- get isXs$() {
147
- return this._isXs$.asObservable();
238
+ ngOnDestroy() {
239
+ this._destroy$.next(true);
240
+ this._destroy$.unsubscribe();
148
241
  }
149
- get isXs() {
150
- return this._isXs$.value;
242
+ }
243
+ DestroyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: DestroyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
244
+ DestroyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: DestroyService });
245
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: DestroyService, decorators: [{
246
+ type: Injectable
247
+ }] });
248
+
249
+ class FocusVisibleService {
250
+ get isFocusVisible() {
251
+ return this._hadKeyboardEvent;
151
252
  }
152
- get isSm$() {
153
- return this._isSm$.asObservable();
253
+ constructor() {
254
+ this._document = inject(DOCUMENT);
255
+ this._hadKeyboardEvent = false;
256
+ this._document.addEventListener('keydown', this.onKeyDown.bind(this), true);
257
+ this._document.addEventListener('mousedown', this.onPointerDown.bind(this), true);
258
+ this._document.addEventListener('pointerdown', this.onPointerDown.bind(this), true);
259
+ this._document.addEventListener('touchstart', this.onPointerDown.bind(this), true);
154
260
  }
155
- get isSm() {
156
- return this._isSm$.value;
261
+ onKeyDown(e) {
262
+ if (e.metaKey || e.altKey || e.ctrlKey) {
263
+ return;
264
+ }
265
+ this._hadKeyboardEvent = true;
157
266
  }
158
- get isMd$() {
159
- return this._isMd$.asObservable();
267
+ onPointerDown() {
268
+ this._hadKeyboardEvent = false;
160
269
  }
161
- get isMd() {
162
- return this._isMd$.value;
270
+ }
271
+ FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: FocusVisibleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
272
+ FocusVisibleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: FocusVisibleService, providedIn: 'root' });
273
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: FocusVisibleService, decorators: [{
274
+ type: Injectable,
275
+ args: [{
276
+ providedIn: 'root',
277
+ }]
278
+ }], ctorParameters: function () { return []; } });
279
+
280
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
281
+ class ResizeObserverFactory {
282
+ create(callback) {
283
+ return typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(callback);
163
284
  }
164
- get isLg$() {
165
- return this._isLg$.asObservable();
285
+ }
286
+ ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
287
+ ResizeObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverFactory, providedIn: 'root' });
288
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverFactory, decorators: [{
289
+ type: Injectable,
290
+ args: [{ providedIn: 'root' }]
291
+ }] });
292
+ class ResizeObserverService {
293
+ constructor(_mutationObserverFactory) {
294
+ this._mutationObserverFactory = _mutationObserverFactory;
295
+ this._observedElements = new Map();
166
296
  }
167
- get isLg() {
168
- return this._isLg$.value;
297
+ ngOnDestroy() {
298
+ this._observedElements.forEach((_, element) => this._cleanupObserver(element));
169
299
  }
170
- get isXl$() {
171
- return this._isXl$.asObservable();
300
+ observe(elementOrRef) {
301
+ const element = coerceElement(elementOrRef);
302
+ return new Observable((observer) => {
303
+ const stream = this._observeElement(element);
304
+ const subscription = stream.subscribe(observer);
305
+ return () => {
306
+ subscription.unsubscribe();
307
+ this._unobserveElement(element);
308
+ };
309
+ });
172
310
  }
173
- get isXl() {
311
+ _observeElement(element) {
312
+ if (!this._observedElements.has(element)) {
313
+ const stream = new Subject();
314
+ const observer = this._mutationObserverFactory.create((resizes) => stream.next(resizes));
315
+ if (observer) {
316
+ observer.observe(element);
317
+ }
318
+ this._observedElements.set(element, { observer, stream, count: 1 });
319
+ }
320
+ else {
321
+ this._observedElements.get(element).count++;
322
+ }
323
+ return this._observedElements.get(element).stream;
324
+ }
325
+ _unobserveElement(element) {
326
+ if (this._observedElements.has(element)) {
327
+ this._observedElements.get(element).count--;
328
+ if (!this._observedElements.get(element).count) {
329
+ this._cleanupObserver(element);
330
+ }
331
+ }
332
+ }
333
+ _cleanupObserver(element) {
334
+ if (this._observedElements.has(element)) {
335
+ const { observer, stream } = this._observedElements.get(element);
336
+ if (observer) {
337
+ observer.disconnect();
338
+ }
339
+ stream.complete();
340
+ this._observedElements.delete(element);
341
+ }
342
+ }
343
+ }
344
+ ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverService, deps: [{ token: ResizeObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
345
+ ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverService, providedIn: 'root' });
346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverService, decorators: [{
347
+ type: Injectable,
348
+ args: [{ providedIn: 'root' }]
349
+ }], ctorParameters: function () { return [{ type: ResizeObserverFactory }]; } });
350
+
351
+ const routerDisableScrollTop = (config = {}) => {
352
+ if (!config.asReturnRoute) {
353
+ return {
354
+ disableScrollTop: true,
355
+ };
356
+ }
357
+ return {
358
+ disableScrollTopAsReturnRoute: true,
359
+ };
360
+ };
361
+ class RouterStateService {
362
+ get route$() {
363
+ return this._route$.asObservable();
364
+ }
365
+ get state$() {
366
+ return this._state$.asObservable();
367
+ }
368
+ constructor() {
369
+ this._isScrollTopOnNavigationEnabled = false;
370
+ this._router = inject(Router);
371
+ this._route$ = new BehaviorSubject('/');
372
+ this._state$ = new BehaviorSubject({
373
+ title: undefined,
374
+ data: {},
375
+ pathParams: {},
376
+ queryParams: {},
377
+ });
378
+ this._router.events
379
+ .pipe(filter((event) => event instanceof NavigationEnd), distinctUntilChanged((a, b) => a.url === b.url), map((event) => event.url))
380
+ .subscribe(this._route$);
381
+ this._route$
382
+ .pipe(map(() => {
383
+ let route = this._router.routerState.snapshot.root;
384
+ while (route.firstChild) {
385
+ route = route.firstChild;
386
+ }
387
+ const { data, params, queryParams, title } = route;
388
+ return {
389
+ data,
390
+ pathParams: params,
391
+ queryParams,
392
+ title,
393
+ };
394
+ }))
395
+ .subscribe(this._state$);
396
+ }
397
+ enableScrollTopOnNavigation(config = {}) {
398
+ if (this._isScrollTopOnNavigationEnabled) {
399
+ return;
400
+ }
401
+ this._isScrollTopOnNavigationEnabled = true;
402
+ this._state$.pipe(pairwise()).subscribe(([oldData, newData]) => {
403
+ var _a;
404
+ if (!(newData.data['disableScrollTopAsReturnRoute'] && oldData.data['disableScrollTop']) &&
405
+ !newData.data['disableScrollTop']) {
406
+ ((_a = config.scrollElement) !== null && _a !== void 0 ? _a : document.documentElement).scrollTop = 0;
407
+ }
408
+ });
409
+ }
410
+ selectQueryParam(key) {
411
+ return this._state$.pipe(map((state) => state.queryParams[key]));
412
+ }
413
+ selectPathParam(key) {
414
+ return this._state$.pipe(map((state) => state.pathParams[key]));
415
+ }
416
+ selectData(key) {
417
+ return this._state$.pipe(map((state) => state.data[key]));
418
+ }
419
+ }
420
+ RouterStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RouterStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
421
+ RouterStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RouterStateService, providedIn: 'root' });
422
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RouterStateService, decorators: [{
423
+ type: Injectable,
424
+ args: [{
425
+ providedIn: 'root',
426
+ }]
427
+ }], ctorParameters: function () { return []; } });
428
+
429
+ class ViewportService {
430
+ get isXs$() {
431
+ return this._isXs$.asObservable();
432
+ }
433
+ get isXs() {
434
+ return this._isXs$.value;
435
+ }
436
+ get isSm$() {
437
+ return this._isSm$.asObservable();
438
+ }
439
+ get isSm() {
440
+ return this._isSm$.value;
441
+ }
442
+ get isMd$() {
443
+ return this._isMd$.asObservable();
444
+ }
445
+ get isMd() {
446
+ return this._isMd$.value;
447
+ }
448
+ get isLg$() {
449
+ return this._isLg$.asObservable();
450
+ }
451
+ get isLg() {
452
+ return this._isLg$.value;
453
+ }
454
+ get isXl$() {
455
+ return this._isXl$.asObservable();
456
+ }
457
+ get isXl() {
174
458
  return this._isXl$.value;
175
459
  }
176
460
  get is2Xl$() {
@@ -182,6 +466,18 @@ class ViewportService {
182
466
  get currentViewport() {
183
467
  return this.getCurrentViewport([this.isXs, this.isSm, this.isMd, this.isLg, this.isXl, this.is2Xl]);
184
468
  }
469
+ constructor(_viewportConfig, _breakpointObserver) {
470
+ this._breakpointObserver = _breakpointObserver;
471
+ this._isXs$ = new BehaviorSubject(false);
472
+ this._isSm$ = new BehaviorSubject(false);
473
+ this._isMd$ = new BehaviorSubject(false);
474
+ this._isLg$ = new BehaviorSubject(false);
475
+ this._isXl$ = new BehaviorSubject(false);
476
+ this._is2Xl$ = new BehaviorSubject(false);
477
+ this.currentViewport$ = combineLatest([this.isXs$, this.isSm$, this.isMd$, this.isLg$, this.isXl$, this.is2Xl$]).pipe(map((val) => this.getCurrentViewport(val)), shareReplay());
478
+ this._viewportConfig = _viewportConfig || DEFAULT_VIEWPORT_CONFIG;
479
+ this._observeDefaultBreakpoints();
480
+ }
185
481
  observe(options) {
186
482
  const mediaQuery = this._buildMediaQuery(options);
187
483
  return this._breakpointObserver.observe(mediaQuery).pipe(map((x) => x.matches), shareReplay());
@@ -260,8 +556,8 @@ class ViewportService {
260
556
  return 'xs';
261
557
  }
262
558
  }
263
- ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ViewportService, deps: [{ token: VIEWPORT_CONFIG, optional: true }, { token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
264
- ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ViewportService, providedIn: 'root' });
559
+ ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ViewportService, deps: [{ token: VIEWPORT_CONFIG, optional: true }, { token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
560
+ ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ViewportService, providedIn: 'root' });
265
561
  __decorate([
266
562
  Memo(),
267
563
  __metadata("design:type", Function),
@@ -279,7 +575,7 @@ __decorate([
279
575
  __metadata("design:paramtypes", [Object]),
280
576
  __metadata("design:returntype", void 0)
281
577
  ], ViewportService.prototype, "_buildMediaQuery", null);
282
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ViewportService, decorators: [{
578
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ViewportService, decorators: [{
283
579
  type: Injectable,
284
580
  args: [{
285
581
  providedIn: 'root',
@@ -293,188 +589,604 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
293
589
  }] }, { type: i1.BreakpointObserver }];
294
590
  }, propDecorators: { _getViewportSize: [], _buildMediaQuery: [] } });
295
591
 
296
- class FocusVisibleService {
592
+ class ClickOutsideDirective {
297
593
  constructor() {
298
- this._document = inject(DOCUMENT);
299
- this._hadKeyboardEvent = false;
300
- this._document.addEventListener('keydown', this.onKeyDown.bind(this), true);
301
- this._document.addEventListener('mousedown', this.onPointerDown.bind(this), true);
302
- this._document.addEventListener('pointerdown', this.onPointerDown.bind(this), true);
303
- this._document.addEventListener('touchstart', this.onPointerDown.bind(this), true);
304
- }
305
- get isFocusVisible() {
306
- return this._hadKeyboardEvent;
594
+ this._elementRef = inject(ElementRef);
595
+ this._clickObserverService = inject(ClickObserverService);
596
+ this._subscription = null;
597
+ this.etClickOutside = new EventEmitter();
307
598
  }
308
- onKeyDown(e) {
309
- if (e.metaKey || e.altKey || e.ctrlKey) {
310
- return;
311
- }
312
- this._hadKeyboardEvent = true;
599
+ ngOnInit() {
600
+ setTimeout(() => {
601
+ this._subscription = this._clickObserverService.observe(this._elementRef.nativeElement).subscribe((event) => {
602
+ const activeElement = event.target;
603
+ const isInside = this._elementRef.nativeElement.contains(activeElement);
604
+ if (!isInside) {
605
+ this.etClickOutside.emit(event);
606
+ }
607
+ });
608
+ });
313
609
  }
314
- onPointerDown() {
315
- this._hadKeyboardEvent = false;
610
+ ngOnDestroy() {
611
+ var _a;
612
+ (_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
316
613
  }
317
614
  }
318
- FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: FocusVisibleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
319
- FocusVisibleServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: FocusVisibleService, providedIn: 'root' });
320
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: FocusVisibleService, decorators: [{
321
- type: Injectable,
615
+ ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickOutsideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
616
+ ClickOutsideDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ClickOutsideDirective, isStandalone: true, selector: "[etClickOutside]", outputs: { etClickOutside: "etClickOutside" }, ngImport: i0 });
617
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickOutsideDirective, decorators: [{
618
+ type: Directive,
322
619
  args: [{
323
- providedIn: 'root',
620
+ selector: '[etClickOutside]',
621
+ standalone: true,
324
622
  }]
325
- }], ctorParameters: function () { return []; } });
623
+ }], propDecorators: { etClickOutside: [{
624
+ type: Output
625
+ }] } });
326
626
 
327
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
328
- class ResizeObserverFactory {
329
- create(callback) {
330
- return typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(callback);
627
+ const clamp = (value, min = 0, max = 100) => {
628
+ return Math.max(min, Math.min(max, value));
629
+ };
630
+
631
+ /* eslint-disable @typescript-eslint/no-explicit-any */
632
+ /* eslint-disable no-var */
633
+ /**
634
+ * Stolen from klona to avoid adding a dependency
635
+ * https://github.com/lukeed/klona
636
+ *
637
+ * MIT License
638
+ *
639
+ * Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
640
+ *
641
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
642
+ *
643
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
644
+ *
645
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
646
+ */
647
+ const set = (obj, key, val) => {
648
+ if (typeof val.value === 'object')
649
+ val.value = clone(val.value);
650
+ if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {
651
+ Object.defineProperty(obj, key, val);
652
+ }
653
+ else
654
+ obj[key] = val.value;
655
+ };
656
+ const clone = (original) => {
657
+ if (typeof original !== 'object')
658
+ return original;
659
+ var _og = original;
660
+ var i = 0, k, list, tmp, str = Object.prototype.toString.call(_og);
661
+ if (str === '[object Object]') {
662
+ tmp = Object.create(_og.__proto__ || null);
663
+ }
664
+ else if (str === '[object Array]') {
665
+ tmp = Array(_og.length);
666
+ }
667
+ else if (str === '[object Set]') {
668
+ tmp = new Set();
669
+ _og.forEach(function (val) {
670
+ tmp.add(clone(val));
671
+ });
331
672
  }
332
- }
333
- ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ResizeObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
334
- ResizeObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ResizeObserverFactory, providedIn: 'root' });
335
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ResizeObserverFactory, decorators: [{
336
- type: Injectable,
337
- args: [{ providedIn: 'root' }]
338
- }] });
339
- class ResizeObserverService {
340
- constructor(_mutationObserverFactory) {
341
- this._mutationObserverFactory = _mutationObserverFactory;
342
- this._observedElements = new Map();
673
+ else if (str === '[object Map]') {
674
+ tmp = new Map();
675
+ _og.forEach(function (val, key) {
676
+ tmp.set(clone(key), clone(val));
677
+ });
343
678
  }
344
- ngOnDestroy() {
345
- this._observedElements.forEach((_, element) => this._cleanupObserver(element));
679
+ else if (str === '[object Date]') {
680
+ tmp = new Date(+_og);
346
681
  }
347
- observe(elementOrRef) {
348
- const element = coerceElement(elementOrRef);
349
- return new Observable((observer) => {
350
- const stream = this._observeElement(element);
351
- const subscription = stream.subscribe(observer);
352
- return () => {
353
- subscription.unsubscribe();
354
- this._unobserveElement(element);
355
- };
356
- });
682
+ else if (str === '[object RegExp]') {
683
+ tmp = new RegExp(_og.source, _og.flags);
357
684
  }
358
- _observeElement(element) {
359
- if (!this._observedElements.has(element)) {
360
- const stream = new Subject();
361
- const observer = this._mutationObserverFactory.create((resizes) => stream.next(resizes));
362
- if (observer) {
363
- observer.observe(element);
364
- }
365
- this._observedElements.set(element, { observer, stream, count: 1 });
366
- }
367
- else {
368
- this._observedElements.get(element).count++;
369
- }
370
- return this._observedElements.get(element).stream;
685
+ else if (str === '[object DataView]') {
686
+ tmp = new _og.constructor(clone(_og.buffer));
371
687
  }
372
- _unobserveElement(element) {
373
- if (this._observedElements.has(element)) {
374
- this._observedElements.get(element).count--;
375
- if (!this._observedElements.get(element).count) {
376
- this._cleanupObserver(element);
377
- }
378
- }
688
+ else if (str === '[object ArrayBuffer]') {
689
+ tmp = _og.slice(0);
379
690
  }
380
- _cleanupObserver(element) {
381
- if (this._observedElements.has(element)) {
382
- const { observer, stream } = this._observedElements.get(element);
383
- if (observer) {
384
- observer.disconnect();
385
- }
386
- stream.complete();
387
- this._observedElements.delete(element);
691
+ else if (str.slice(-6) === 'Array]') {
692
+ // ArrayBuffer.isView(x)
693
+ // ~> `new` bcuz `Buffer.slice` => ref
694
+ tmp = new _og.constructor(_og);
695
+ }
696
+ if (tmp) {
697
+ for (list = Object.getOwnPropertySymbols(_og); i < list.length; i++) {
698
+ set(tmp, list[i], Object.getOwnPropertyDescriptor(_og, list[i]));
699
+ }
700
+ for (i = 0, list = Object.getOwnPropertyNames(_og); i < list.length; i++) {
701
+ if (Object.hasOwnProperty.call(tmp, (k = list[i])) && tmp[k] === _og[k])
702
+ continue;
703
+ set(tmp, k, Object.getOwnPropertyDescriptor(_og, k));
388
704
  }
389
705
  }
390
- }
391
- ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ResizeObserverService, deps: [{ token: ResizeObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
392
- ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ResizeObserverService, providedIn: 'root' });
393
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ResizeObserverService, decorators: [{
394
- type: Injectable,
395
- args: [{ providedIn: 'root' }]
396
- }], ctorParameters: function () { return [{ type: ResizeObserverFactory }]; } });
706
+ return tmp || _og;
707
+ };
397
708
 
398
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
399
- class MutationObserverFactory {
400
- create(callback) {
401
- return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
709
+ const hasCookie = (name) => {
710
+ if (typeof document === 'undefined') {
711
+ return false;
402
712
  }
403
- }
404
- MutationObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
405
- MutationObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' });
406
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MutationObserverFactory, decorators: [{
407
- type: Injectable,
408
- args: [{ providedIn: 'root' }]
409
- }] });
410
- class ContentObserverService {
411
- constructor(_mutationObserverFactory) {
412
- this._mutationObserverFactory = _mutationObserverFactory;
413
- this._observedElements = new Map();
713
+ return document.cookie.split(';').some((c) => {
714
+ return c.trim().startsWith(name + '=');
715
+ });
716
+ };
717
+ const getCookie = (name) => {
718
+ var _a;
719
+ if (typeof document === 'undefined') {
720
+ return null;
414
721
  }
415
- ngOnDestroy() {
416
- this._observedElements.forEach((_, element) => this._cleanupObserver(element));
722
+ // From https://stackoverflow.com/questions/10730362/get-cookie-by-name
723
+ return (_a = ('; ' + document.cookie).split(`; ${name}=`).pop()) === null || _a === void 0 ? void 0 : _a.split(';')[0];
724
+ };
725
+ const setCookie = (name, data, expiresInDays = 30, domain = getDomain()) => {
726
+ if (typeof document === 'undefined') {
727
+ return;
417
728
  }
418
- observe(elementOrRef) {
419
- const element = coerceElement(elementOrRef);
420
- return new Observable((observer) => {
421
- const stream = this._observeElement(element);
422
- const subscription = stream.subscribe(observer);
423
- return () => {
424
- subscription.unsubscribe();
425
- this._unobserveElement(element);
426
- };
427
- });
729
+ const date = new Date();
730
+ date.setTime(date.getTime() + expiresInDays * 24 * 60 * 60 * 1000);
731
+ document.cookie = `${name}=${data}; path=/; expires=${date.toUTCString()}; domain=${domain}; SameSite=Lax;`;
732
+ };
733
+ const deleteCookie = (name, path, domain = getDomain()) => {
734
+ if (hasCookie(name)) {
735
+ document.cookie =
736
+ name +
737
+ '=' +
738
+ (path ? ';path=' + path : '') +
739
+ (domain ? ';domain=' + domain : '') +
740
+ ';expires=Thu, 01 Jan 1970 00:00:01 GMT';
428
741
  }
429
- _observeElement(element) {
430
- if (!this._observedElements.has(element)) {
431
- const stream = new Subject();
432
- const observer = this._mutationObserverFactory.create((mutations) => stream.next(mutations));
433
- if (observer) {
434
- observer.observe(element, {
435
- characterData: true,
436
- childList: true,
437
- subtree: true,
438
- });
439
- }
440
- this._observedElements.set(element, { observer, stream, count: 1 });
441
- }
442
- else {
443
- this._observedElements.get(element).count++;
444
- }
445
- return this._observedElements.get(element).stream;
742
+ };
743
+ const getDomain = () => {
744
+ if (typeof navigator === 'undefined') {
745
+ return null;
446
746
  }
447
- _unobserveElement(element) {
448
- if (this._observedElements.has(element)) {
449
- this._observedElements.get(element).count--;
450
- if (!this._observedElements.get(element).count) {
451
- this._cleanupObserver(element);
747
+ const hostname = window.location.hostname;
748
+ if (hostname.includes('localhost')) {
749
+ return 'localhost';
750
+ }
751
+ const splitHost = hostname.split('.');
752
+ if (splitHost.length > 2) {
753
+ return `${splitHost[splitHost.length - 2]}.${splitHost[splitHost.length - 1]}`;
754
+ }
755
+ return hostname;
756
+ };
757
+
758
+ /* eslint-disable @typescript-eslint/no-explicit-any */
759
+ /* eslint-disable no-var */
760
+ /**
761
+ * Stolen from dequal to avoid adding a dependency
762
+ * https://github.com/lukeed/dequal
763
+ *
764
+ * The MIT License (MIT)
765
+ *
766
+ * Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
767
+ *
768
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
769
+ * of this software and associated documentation files (the "Software"), to deal
770
+ * in the Software without restriction, including without limitation the rights
771
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
772
+ * copies of the Software, and to permit persons to whom the Software is
773
+ * furnished to do so, subject to the following conditions:
774
+ *
775
+ * The above copyright notice and this permission notice shall be included in
776
+ * all copies or substantial portions of the Software.
777
+ *
778
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
779
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
780
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
781
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
782
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
783
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
784
+ * THE SOFTWARE.
785
+ */
786
+ const has = Object.prototype.hasOwnProperty;
787
+ function find(iter, tar, key) {
788
+ for (key of iter.keys()) {
789
+ if (equal(key, tar))
790
+ return key;
791
+ }
792
+ }
793
+ const equal = (foo, bar) => {
794
+ var ctor, len, tmp;
795
+ if (foo === bar)
796
+ return true;
797
+ if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
798
+ if (ctor === Date)
799
+ return foo.getTime() === bar.getTime();
800
+ if (ctor === RegExp)
801
+ return foo.toString() === bar.toString();
802
+ if (ctor === Array) {
803
+ if ((len = foo.length) === bar.length) {
804
+ while (len-- && equal(foo[len], bar[len]))
805
+ ;
452
806
  }
807
+ return len === -1;
808
+ }
809
+ if (ctor === Set) {
810
+ if (foo.size !== bar.size) {
811
+ return false;
812
+ }
813
+ for (len of foo) {
814
+ tmp = len;
815
+ if (tmp && typeof tmp === 'object') {
816
+ tmp = find(bar, tmp);
817
+ if (!tmp)
818
+ return false;
819
+ }
820
+ if (!bar.has(tmp))
821
+ return false;
822
+ }
823
+ return true;
824
+ }
825
+ if (ctor === Map) {
826
+ if (foo.size !== bar.size) {
827
+ return false;
828
+ }
829
+ for (len of foo) {
830
+ tmp = len[0];
831
+ if (tmp && typeof tmp === 'object') {
832
+ tmp = find(bar, tmp);
833
+ if (!tmp)
834
+ return false;
835
+ }
836
+ if (!equal(len[1], bar.get(tmp))) {
837
+ return false;
838
+ }
839
+ }
840
+ return true;
841
+ }
842
+ if (ctor === ArrayBuffer) {
843
+ foo = new Uint8Array(foo);
844
+ bar = new Uint8Array(bar);
845
+ }
846
+ else if (ctor === DataView) {
847
+ if ((len = foo.byteLength) === bar.byteLength) {
848
+ while (len-- && foo.getInt8(len) === bar.getInt8(len))
849
+ ;
850
+ }
851
+ return len === -1;
852
+ }
853
+ if (ArrayBuffer.isView(foo)) {
854
+ if ((len = foo.byteLength) === bar.byteLength) {
855
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
856
+ //@ts-ignore
857
+ while (len-- && foo[len] === bar[len])
858
+ ;
859
+ }
860
+ return len === -1;
861
+ }
862
+ if (!ctor || typeof foo === 'object') {
863
+ len = 0;
864
+ for (ctor in foo) {
865
+ if (has.call(foo, ctor) && ++len && !has.call(bar, ctor))
866
+ return false;
867
+ if (!(ctor in bar) || !equal(foo[ctor], bar[ctor]))
868
+ return false;
869
+ }
870
+ return Object.keys(bar).length === len;
453
871
  }
454
872
  }
455
- _cleanupObserver(element) {
456
- if (this._observedElements.has(element)) {
457
- const { observer, stream } = this._observedElements.get(element);
458
- if (observer) {
459
- observer.disconnect();
873
+ return foo !== foo && bar !== bar;
874
+ };
875
+
876
+ const isAttributeRenderBinding = (value) => typeof value === 'boolean';
877
+ const isAttributeValueBinding = (value) => typeof value === 'object';
878
+ const createReactiveBindings = (...values) => {
879
+ const rootElementRef = inject(ElementRef);
880
+ const destroy$ = inject(DestroyService, { host: true }).destroy$;
881
+ const subscriptions = [];
882
+ const pushedAttributes = [];
883
+ const defaults = {};
884
+ const push = (value) => {
885
+ const { attribute, observable, elementRef } = value;
886
+ const elRef = elementRef || rootElementRef;
887
+ const attributes = Array.isArray(attribute) ? attribute : [attribute];
888
+ pushedAttributes.push(attributes);
889
+ for (const attribute of attributes) {
890
+ if (!defaults[attribute]) {
891
+ defaults[attribute] = elRef.nativeElement.getAttribute(attribute) || undefined;
460
892
  }
461
- stream.complete();
462
- this._observedElements.delete(element);
893
+ }
894
+ const subscription = observable
895
+ .pipe(takeUntil(destroy$), distinctUntilChanged((a, b) => {
896
+ if (isAttributeRenderBinding(a) && isAttributeRenderBinding(b)) {
897
+ return a === b;
898
+ }
899
+ else if (isAttributeValueBinding(a) && isAttributeValueBinding(b)) {
900
+ return a.render === b.render && a.value === b.value;
901
+ }
902
+ return false;
903
+ }))
904
+ .subscribe((value) => {
905
+ const currentAttributes = pushedAttributes.find((s) => s.some((current) => attributes.includes(current))) || [];
906
+ for (const attribute of currentAttributes) {
907
+ const isSingleClassMutation = attribute.startsWith('class.');
908
+ const isMultipleClassMutation = attribute === 'class';
909
+ const render = isAttributeRenderBinding(value) ? value : value.render;
910
+ if (isSingleClassMutation) {
911
+ const className = attribute.replace('class.', '');
912
+ if (!className) {
913
+ continue;
914
+ }
915
+ if (!render) {
916
+ elRef.nativeElement.classList.remove(className);
917
+ }
918
+ else {
919
+ elRef.nativeElement.classList.add(className);
920
+ }
921
+ }
922
+ else if (isMultipleClassMutation) {
923
+ const classes = isAttributeRenderBinding(value) ? '' : `${value.value}`;
924
+ if (!classes) {
925
+ continue;
926
+ }
927
+ if (!render) {
928
+ elRef.nativeElement.classList.remove(...classes.split(' '));
929
+ }
930
+ else {
931
+ elRef.nativeElement.classList.add(...classes.split(' '));
932
+ }
933
+ }
934
+ else {
935
+ const attributeValue = isAttributeRenderBinding(value) ? true : `${value.value}`;
936
+ if (!attribute) {
937
+ continue;
938
+ }
939
+ if (!render) {
940
+ elRef.nativeElement.removeAttribute(attribute);
941
+ }
942
+ else {
943
+ elRef.nativeElement.setAttribute(attribute, `${attributeValue}`);
944
+ }
945
+ }
946
+ }
947
+ });
948
+ subscriptions.push({ attributes, subscription });
949
+ };
950
+ const remove = (...attributes) => {
951
+ for (const attribute of attributes) {
952
+ const sub = subscriptions.find((s) => s.attributes.includes(attribute));
953
+ const attributeStack = pushedAttributes.find((a) => a.includes(attribute));
954
+ if (sub) {
955
+ sub.attributes = sub.attributes.filter((a) => a !== attribute);
956
+ attributeStack === null || attributeStack === void 0 ? void 0 : attributeStack.splice(attributeStack.indexOf(attribute), 1);
957
+ if (sub.attributes.length === 0) {
958
+ sub.subscription.unsubscribe();
959
+ subscriptions.splice(subscriptions.indexOf(sub), 1);
960
+ }
961
+ }
962
+ }
963
+ };
964
+ const reset = () => {
965
+ for (const attribute in defaults) {
966
+ if (defaults[attribute] === undefined) {
967
+ rootElementRef.nativeElement.removeAttribute(attribute);
968
+ }
969
+ else {
970
+ rootElementRef.nativeElement.setAttribute(attribute, defaults[attribute]);
971
+ }
972
+ }
973
+ };
974
+ for (const value of values) {
975
+ push(value);
976
+ }
977
+ return {
978
+ push,
979
+ remove,
980
+ reset,
981
+ };
982
+ };
983
+
984
+ const elementCanScroll = (element) => {
985
+ const { scrollHeight, clientHeight, scrollWidth, clientWidth } = element;
986
+ return scrollHeight > clientHeight || scrollWidth > clientWidth;
987
+ };
988
+
989
+ const provideViewportConfig = (viewportConfig) => {
990
+ return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
991
+ };
992
+
993
+ const CURSOR_DRAG_SCROLLING_CLASS = 'et-cursor-drag-scroll--scrolling';
994
+ const CURSOR_DRAG_SCROLLING_PREPARED_CLASS = 'et-cursor-drag-scroll--prepared';
995
+
996
+ class CursorDragScrollDirective {
997
+ constructor() {
998
+ this._subscriptions = [];
999
+ this._destroy$ = inject(DestroyService, { host: true }).destroy$;
1000
+ this._elementRef = inject(ElementRef);
1001
+ this._contentObserverService = inject(ContentObserverService);
1002
+ this._resizeObserverService = inject(ResizeObserverService);
1003
+ this._bufferUntilScroll = 5;
1004
+ this._mouseUp$ = new Subject();
1005
+ this._isScrolling = false;
1006
+ this._canScroll = false;
1007
+ this._currentScrollState = {
1008
+ top: 0,
1009
+ left: 0,
1010
+ x: 0,
1011
+ y: 0,
1012
+ };
1013
+ this._enabled = false;
1014
+ }
1015
+ get enabled() {
1016
+ return this._enabled;
1017
+ }
1018
+ set enabled(value) {
1019
+ this._enabled = coerceBooleanProperty(value);
1020
+ if (this._enabled) {
1021
+ this._enableCursorDragScroll();
1022
+ }
1023
+ else {
1024
+ this._disableCursorDragScroll();
1025
+ }
1026
+ }
1027
+ ngAfterViewInit() {
1028
+ if (this.enabled) {
1029
+ this._enableCursorDragScroll();
1030
+ }
1031
+ else {
1032
+ this._disableCursorDragScroll();
1033
+ }
1034
+ }
1035
+ _enableCursorDragScroll() {
1036
+ const contentResizeSub = combineLatest([
1037
+ this._contentObserverService.observe(this._elementRef.nativeElement).pipe(startWith(null)),
1038
+ this._resizeObserverService.observe(this._elementRef.nativeElement).pipe(startWith(null)),
1039
+ ])
1040
+ .pipe(debounceTime(25), tap(() => this._updateCanScrollState()), takeUntil(this._destroy$))
1041
+ .subscribe();
1042
+ const mousedownSub = fromEvent(this._elementRef.nativeElement, 'mousedown')
1043
+ .pipe(tap((e) => this._onMouseDown(e)), takeUntil(this._destroy$))
1044
+ .subscribe();
1045
+ this._subscriptions.push(contentResizeSub, mousedownSub);
1046
+ this._updateCanScrollState();
1047
+ }
1048
+ _disableCursorDragScroll() {
1049
+ this._subscriptions.forEach((sub) => sub.unsubscribe());
1050
+ this._subscriptions.length = 0;
1051
+ this._elementRef.nativeElement.style.cursor = 'default';
1052
+ }
1053
+ _onMouseDown(e) {
1054
+ var _a;
1055
+ if (!((_a = this._elementRef) === null || _a === void 0 ? void 0 : _a.nativeElement) || !this._canScroll) {
1056
+ return;
1057
+ }
1058
+ const element = this._elementRef.nativeElement;
1059
+ element.classList.add(CURSOR_DRAG_SCROLLING_PREPARED_CLASS);
1060
+ this._elementRef.nativeElement.style.scrollSnapType = 'none';
1061
+ this._elementRef.nativeElement.style.scrollBehavior = 'unset';
1062
+ this._currentScrollState = {
1063
+ left: this._elementRef.nativeElement.scrollLeft,
1064
+ top: this._elementRef.nativeElement.scrollTop,
1065
+ x: e.clientX,
1066
+ y: e.clientY,
1067
+ };
1068
+ fromEvent(document, 'mousemove')
1069
+ .pipe(tap((e) => this._mouseMoveHandler(e)), takeUntil(this._mouseUp$), takeUntil(this._destroy$))
1070
+ .subscribe();
1071
+ fromEvent(document, 'mouseup')
1072
+ .pipe(tap(() => this._mouseUpHandler()), take(1), takeUntil(this._destroy$))
1073
+ .subscribe();
1074
+ }
1075
+ _mouseMoveHandler(e) {
1076
+ var _a;
1077
+ e.preventDefault();
1078
+ if (!((_a = this._elementRef) === null || _a === void 0 ? void 0 : _a.nativeElement)) {
1079
+ return;
1080
+ }
1081
+ const dx = e.clientX - this._currentScrollState.x;
1082
+ const dy = e.clientY - this._currentScrollState.y;
1083
+ if (Math.abs(dx) > this._bufferUntilScroll || Math.abs(dy) > this._bufferUntilScroll) {
1084
+ const element = this._elementRef.nativeElement;
1085
+ if (!this._isScrolling) {
1086
+ this._isScrolling = true;
1087
+ element.style.cursor = 'grabbing';
1088
+ element.classList.add(CURSOR_DRAG_SCROLLING_CLASS);
1089
+ element.scroll({
1090
+ top: this._currentScrollState.top - dy,
1091
+ left: this._currentScrollState.left - dx,
1092
+ behavior: 'smooth',
1093
+ });
1094
+ }
1095
+ else {
1096
+ element.scrollTop = this._currentScrollState.top - dy;
1097
+ element.scrollLeft = this._currentScrollState.left - dx;
1098
+ }
1099
+ }
1100
+ }
1101
+ _mouseUpHandler() {
1102
+ var _a;
1103
+ this._mouseUp$.next(true);
1104
+ this._isScrolling = false;
1105
+ if (!((_a = this._elementRef) === null || _a === void 0 ? void 0 : _a.nativeElement)) {
1106
+ return;
1107
+ }
1108
+ this._elementRef.nativeElement.style.scrollSnapType = '';
1109
+ this._elementRef.nativeElement.style.scrollBehavior = '';
1110
+ this._elementRef.nativeElement.style.cursor = 'grab';
1111
+ this._elementRef.nativeElement.classList.remove(CURSOR_DRAG_SCROLLING_CLASS);
1112
+ this._elementRef.nativeElement.classList.remove(CURSOR_DRAG_SCROLLING_PREPARED_CLASS);
1113
+ }
1114
+ _updateCanScrollState() {
1115
+ this._canScroll = elementCanScroll(this._elementRef.nativeElement);
1116
+ if (this._canScroll) {
1117
+ this._elementRef.nativeElement.style.cursor = 'grab';
1118
+ }
1119
+ else {
1120
+ this._elementRef.nativeElement.style.cursor = 'default';
463
1121
  }
464
1122
  }
465
1123
  }
466
- ContentObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ContentObserverService, deps: [{ token: MutationObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
467
- ContentObserverServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ContentObserverService, providedIn: 'root' });
468
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ContentObserverService, decorators: [{
469
- type: Injectable,
470
- args: [{ providedIn: 'root' }]
471
- }], ctorParameters: function () { return [{ type: MutationObserverFactory }]; } });
1124
+ CursorDragScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: CursorDragScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1125
+ CursorDragScrollDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: CursorDragScrollDirective, isStandalone: true, selector: "[etCursorDragScroll]", inputs: { enabled: ["etCursorDragScroll", "enabled"] }, providers: [DestroyService], exportAs: ["etCursorDragScroll"], ngImport: i0 });
1126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: CursorDragScrollDirective, decorators: [{
1127
+ type: Directive,
1128
+ args: [{
1129
+ selector: '[etCursorDragScroll]',
1130
+ exportAs: 'etCursorDragScroll',
1131
+ standalone: true,
1132
+ providers: [DestroyService],
1133
+ }]
1134
+ }], propDecorators: { enabled: [{
1135
+ type: Input,
1136
+ args: ['etCursorDragScroll']
1137
+ }] } });
472
1138
 
473
- class ObserveResizeDirective {
474
- constructor(_contentObserver, _elementRef, _ngZone) {
475
- this._contentObserver = _contentObserver;
476
- this._elementRef = _elementRef;
477
- this._ngZone = _ngZone;
1139
+ class LetContext {
1140
+ constructor() {
1141
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1142
+ this.$implicit = null;
1143
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1144
+ this.etLet = null;
1145
+ }
1146
+ }
1147
+
1148
+ class LetDirective {
1149
+ set etLet(value) {
1150
+ this._context.$implicit = this._context.etLet = value;
1151
+ this._updateView();
1152
+ }
1153
+ constructor(_viewContainer, templateRef) {
1154
+ this._viewContainer = _viewContainer;
1155
+ this._context = new LetContext();
1156
+ this._templateRef = null;
1157
+ this._viewRef = null;
1158
+ this._templateRef = templateRef;
1159
+ }
1160
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1161
+ static ngTemplateContextGuard(dir, ctx) {
1162
+ return true;
1163
+ }
1164
+ _updateView() {
1165
+ if (!this._viewRef) {
1166
+ this._viewContainer.clear();
1167
+ if (this._templateRef) {
1168
+ this._viewRef = this._viewContainer.createEmbeddedView(this._templateRef, this._context);
1169
+ }
1170
+ }
1171
+ }
1172
+ }
1173
+ LetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: LetDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
1174
+ LetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 });
1175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: LetDirective, decorators: [{
1176
+ type: Directive,
1177
+ args: [{
1178
+ selector: '[etLet]',
1179
+ standalone: true,
1180
+ }]
1181
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { etLet: [{
1182
+ type: Input
1183
+ }] } });
1184
+
1185
+ class ObserveContentDirective {
1186
+ constructor() {
1187
+ this._contentObserver = inject(ContentObserverService);
1188
+ this._elementRef = inject(ElementRef);
1189
+ this._ngZone = inject(NgZone);
478
1190
  this.event = new EventEmitter();
479
1191
  this._disabled = false;
480
1192
  this._debounce = null;
@@ -506,7 +1218,7 @@ class ObserveResizeDirective {
506
1218
  this._unsubscribe();
507
1219
  const stream = this._contentObserver.observe(this._elementRef);
508
1220
  this._ngZone.runOutsideAngular(() => {
509
- this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);
1221
+ this._currentSubscription = (this.debounce ? stream.pipe(debounceTime$1(this.debounce)) : stream).subscribe(this.event);
510
1222
  });
511
1223
  }
512
1224
  _unsubscribe() {
@@ -514,31 +1226,31 @@ class ObserveResizeDirective {
514
1226
  (_a = this._currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
515
1227
  }
516
1228
  }
517
- ObserveResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ObserveResizeDirective, deps: [{ token: ResizeObserverService }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
518
- ObserveResizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: ObserveResizeDirective, isStandalone: true, selector: "[etObserveResize]", inputs: { disabled: ["etObserveResizeDisabled", "disabled"], debounce: ["etObserveResizeDebounce", "debounce"] }, outputs: { event: "etObserveResize" }, exportAs: ["etObserveResize"], ngImport: i0 });
519
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ObserveResizeDirective, decorators: [{
1229
+ ObserveContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1230
+ ObserveContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ObserveContentDirective, isStandalone: true, selector: "[etObserveContent]", inputs: { disabled: ["etObserveContentDisabled", "disabled"], debounce: ["etObserveContentDebounce", "debounce"] }, outputs: { event: "etObserveContent" }, exportAs: ["etObserveContent"], ngImport: i0 });
1231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveContentDirective, decorators: [{
520
1232
  type: Directive,
521
1233
  args: [{
522
- selector: '[etObserveResize]',
523
- exportAs: 'etObserveResize',
1234
+ selector: '[etObserveContent]',
1235
+ exportAs: 'etObserveContent',
524
1236
  standalone: true,
525
1237
  }]
526
- }], ctorParameters: function () { return [{ type: ResizeObserverService }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { event: [{
1238
+ }], propDecorators: { event: [{
527
1239
  type: Output,
528
- args: ['etObserveResize']
1240
+ args: ['etObserveContent']
529
1241
  }], disabled: [{
530
1242
  type: Input,
531
- args: ['etObserveResizeDisabled']
1243
+ args: ['etObserveContentDisabled']
532
1244
  }], debounce: [{
533
1245
  type: Input,
534
- args: ['etObserveResizeDebounce']
1246
+ args: ['etObserveContentDebounce']
535
1247
  }] } });
536
1248
 
537
- class ObserveContentDirective {
538
- constructor(_contentObserver, _elementRef, _ngZone) {
539
- this._contentObserver = _contentObserver;
540
- this._elementRef = _elementRef;
541
- this._ngZone = _ngZone;
1249
+ class ObserveResizeDirective {
1250
+ constructor() {
1251
+ this._resizeObserver = inject(ResizeObserverService);
1252
+ this._elementRef = inject(ElementRef);
1253
+ this._ngZone = inject(NgZone);
542
1254
  this.event = new EventEmitter();
543
1255
  this._disabled = false;
544
1256
  this._debounce = null;
@@ -568,9 +1280,9 @@ class ObserveContentDirective {
568
1280
  }
569
1281
  _subscribe() {
570
1282
  this._unsubscribe();
571
- const stream = this._contentObserver.observe(this._elementRef);
1283
+ const stream = this._resizeObserver.observe(this._elementRef);
572
1284
  this._ngZone.runOutsideAngular(() => {
573
- this._currentSubscription = (this.debounce ? stream.pipe(debounceTime$1(this.debounce)) : stream).subscribe(this.event);
1285
+ this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);
574
1286
  });
575
1287
  }
576
1288
  _unsubscribe() {
@@ -578,25 +1290,785 @@ class ObserveContentDirective {
578
1290
  (_a = this._currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
579
1291
  }
580
1292
  }
581
- ObserveContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ObserveContentDirective, deps: [{ token: ContentObserverService }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
582
- ObserveContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: ObserveContentDirective, selector: "[etObserveContent]", inputs: { disabled: ["etObserveContentDisabled", "disabled"], debounce: ["etObserveContentDebounce", "debounce"] }, outputs: { event: "etObserveContent" }, exportAs: ["etObserveContent"], ngImport: i0 });
583
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ObserveContentDirective, decorators: [{
1293
+ ObserveResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1294
+ ObserveResizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ObserveResizeDirective, isStandalone: true, selector: "[etObserveResize]", inputs: { disabled: ["etObserveResizeDisabled", "disabled"], debounce: ["etObserveResizeDebounce", "debounce"] }, outputs: { event: "etObserveResize" }, exportAs: ["etObserveResize"], ngImport: i0 });
1295
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveResizeDirective, decorators: [{
584
1296
  type: Directive,
585
1297
  args: [{
586
- selector: '[etObserveContent]',
587
- exportAs: 'etObserveContent',
1298
+ selector: '[etObserveResize]',
1299
+ exportAs: 'etObserveResize',
1300
+ standalone: true,
588
1301
  }]
589
- }], ctorParameters: function () { return [{ type: ContentObserverService }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { event: [{
1302
+ }], propDecorators: { event: [{
590
1303
  type: Output,
591
- args: ['etObserveContent']
1304
+ args: ['etObserveResize']
592
1305
  }], disabled: [{
593
1306
  type: Input,
594
- args: ['etObserveContentDisabled']
1307
+ args: ['etObserveResizeDisabled']
595
1308
  }], debounce: [{
596
1309
  type: Input,
597
- args: ['etObserveContentDebounce']
1310
+ args: ['etObserveResizeDebounce']
1311
+ }] } });
1312
+
1313
+ const SCROLL_OBSERVER_FIRST_ELEMENT_CLASS = 'et-scroll-observer-first-element';
1314
+ class ScrollObserverFirstElementDirective {
1315
+ constructor() {
1316
+ this._isFirstElement = false;
1317
+ }
1318
+ get isFirstElement() {
1319
+ return this._isFirstElement;
1320
+ }
1321
+ set isFirstElement(value) {
1322
+ this._isFirstElement = coerceBooleanProperty(value);
1323
+ }
1324
+ }
1325
+ ScrollObserverFirstElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverFirstElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1326
+ ScrollObserverFirstElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ScrollObserverFirstElementDirective, isStandalone: true, selector: "[etScrollObserverFirstElement]", inputs: { isFirstElement: ["etScrollObserverFirstElement", "isFirstElement"] }, host: { properties: { "class.et-scroll-observer-first-element": "this.isFirstElement" } }, ngImport: i0 });
1327
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverFirstElementDirective, decorators: [{
1328
+ type: Directive,
1329
+ args: [{
1330
+ selector: '[etScrollObserverFirstElement]',
1331
+ standalone: true,
1332
+ }]
1333
+ }], propDecorators: { isFirstElement: [{
1334
+ type: Input,
1335
+ args: ['etScrollObserverFirstElement']
1336
+ }, {
1337
+ type: HostBinding,
1338
+ args: [`class.${SCROLL_OBSERVER_FIRST_ELEMENT_CLASS}`]
1339
+ }] } });
1340
+
1341
+ const SCROLL_OBSERVER_IGNORE_TARGET_CLASS = 'et-scroll-observer-ignore-target';
1342
+ class ScrollObserverIgnoreTargetDirective {
1343
+ }
1344
+ ScrollObserverIgnoreTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1345
+ ScrollObserverIgnoreTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ScrollObserverIgnoreTargetDirective, isStandalone: true, selector: "[etScrollObserverIgnoreTarget]", host: { classAttribute: "et-scroll-observer-ignore-target" }, ngImport: i0 });
1346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, decorators: [{
1347
+ type: Directive,
1348
+ args: [{
1349
+ selector: '[etScrollObserverIgnoreTarget]',
1350
+ standalone: true,
1351
+ host: {
1352
+ class: SCROLL_OBSERVER_IGNORE_TARGET_CLASS,
1353
+ },
1354
+ }]
1355
+ }] });
1356
+
1357
+ const SCROLL_OBSERVER_LAST_ELEMENT_CLASS = 'et-scroll-observer-last-element';
1358
+ class ScrollObserverLastElementDirective {
1359
+ constructor() {
1360
+ this._isLastElement = false;
1361
+ }
1362
+ get isLastElement() {
1363
+ return this._isLastElement;
1364
+ }
1365
+ set isLastElement(value) {
1366
+ this._isLastElement = coerceBooleanProperty(value);
1367
+ }
1368
+ }
1369
+ ScrollObserverLastElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverLastElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1370
+ ScrollObserverLastElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ScrollObserverLastElementDirective, isStandalone: true, selector: "[etScrollObserverLastElement]", inputs: { isLastElement: ["etScrollObserverLastElement", "isLastElement"] }, host: { properties: { "class.et-scroll-observer-last-element": "this.isLastElement" }, classAttribute: "et-scroll-observer-last-element" }, ngImport: i0 });
1371
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverLastElementDirective, decorators: [{
1372
+ type: Directive,
1373
+ args: [{
1374
+ selector: '[etScrollObserverLastElement]',
1375
+ standalone: true,
1376
+ host: {
1377
+ class: SCROLL_OBSERVER_LAST_ELEMENT_CLASS,
1378
+ },
1379
+ }]
1380
+ }], propDecorators: { isLastElement: [{
1381
+ type: Input,
1382
+ args: ['etScrollObserverLastElement']
1383
+ }, {
1384
+ type: HostBinding,
1385
+ args: [`class.${SCROLL_OBSERVER_LAST_ELEMENT_CLASS}`]
1386
+ }] } });
1387
+
1388
+ const OBSERVE_SCROLL_STATE = new InjectionToken('OBSERVE_SCROLL_STATE');
1389
+
1390
+ class ObserveScrollStateDirective {
1391
+ constructor() {
1392
+ this._destroy$ = inject(DestroyService, { host: true }).destroy$;
1393
+ this._elementRef = inject(ElementRef);
1394
+ this._contentObserverService = inject(ContentObserverService);
1395
+ this._resizeObserverService = inject(ResizeObserverService);
1396
+ this._observedChildren = {
1397
+ first: this._firstCurrentChild,
1398
+ last: this._lastCurrentChild,
1399
+ };
1400
+ this._rootMargin = 0;
1401
+ this._threshold = 1;
1402
+ this._intersectionObserver = null;
1403
+ this.etObserveScrollState = new EventEmitter();
1404
+ }
1405
+ get _firstCurrentChild() {
1406
+ const explicitFirstElement = this._elementRef.nativeElement.querySelector(`.${SCROLL_OBSERVER_FIRST_ELEMENT_CLASS}`);
1407
+ if (explicitFirstElement) {
1408
+ return explicitFirstElement;
1409
+ }
1410
+ const element = this._elementRef.nativeElement.children[0];
1411
+ return this._getNonIgnoredChild(element, 'next');
1412
+ }
1413
+ get _lastCurrentChild() {
1414
+ const explicitLastElement = this._elementRef.nativeElement.querySelector(`.${SCROLL_OBSERVER_LAST_ELEMENT_CLASS}`);
1415
+ if (explicitLastElement) {
1416
+ return explicitLastElement;
1417
+ }
1418
+ const element = this._elementRef.nativeElement.children[this._elementRef.nativeElement.children.length - 1];
1419
+ return this._getNonIgnoredChild(element, 'previous');
1420
+ }
1421
+ get observerRootMargin() {
1422
+ return this._rootMargin;
1423
+ }
1424
+ set observerRootMargin(value) {
1425
+ this._rootMargin = coerceNumberProperty(value);
1426
+ }
1427
+ get observerThreshold() {
1428
+ return this._threshold;
1429
+ }
1430
+ set observerThreshold(value) {
1431
+ this._threshold = coerceNumberProperty(value);
1432
+ }
1433
+ ngOnInit() {
1434
+ this._contentObserverService
1435
+ .observe(this._elementRef.nativeElement)
1436
+ .pipe(tap(() => this._checkChildren()), takeUntil(this._destroy$))
1437
+ .subscribe();
1438
+ this._resizeObserverService
1439
+ .observe(this._elementRef.nativeElement)
1440
+ .pipe(debounceTime(25), tap(() => {
1441
+ const canScroll = elementCanScroll(this._elementRef.nativeElement);
1442
+ if ((!this._intersectionObserver && canScroll) || (this._intersectionObserver && !canScroll)) {
1443
+ this._checkChildren();
1444
+ }
1445
+ }), takeUntil(this._destroy$))
1446
+ .subscribe();
1447
+ this._checkChildren();
1448
+ }
1449
+ ngOnDestroy() {
1450
+ this._clearIntersectionObserver();
1451
+ }
1452
+ _checkChildren() {
1453
+ this._clearIntersectionObserver();
1454
+ if (this._firstCurrentChild === this._lastCurrentChild ||
1455
+ !this._firstCurrentChild ||
1456
+ !this._lastCurrentChild ||
1457
+ !elementCanScroll(this._elementRef.nativeElement)) {
1458
+ this._unobserveChild('first');
1459
+ this._unobserveChild('last');
1460
+ this.etObserveScrollState.emit({
1461
+ isAtStart: true,
1462
+ isAtEnd: true,
1463
+ canScroll: false,
1464
+ });
1465
+ }
1466
+ else {
1467
+ this._intersectionObserver = this._initiateIntersectionObserver();
1468
+ this._observeChild('first', this._firstCurrentChild);
1469
+ this._observeChild('last', this._lastCurrentChild);
1470
+ }
1471
+ }
1472
+ _initiateIntersectionObserver() {
1473
+ const observer = new IntersectionObserver((entries) => {
1474
+ var _a, _b, _c, _d;
1475
+ const { first, last } = this._observedChildren;
1476
+ const isAtStart = (_b = (_a = entries.find((entry) => entry.target === first)) === null || _a === void 0 ? void 0 : _a.isIntersecting) !== null && _b !== void 0 ? _b : false;
1477
+ const isAtEnd = (_d = (_c = entries.find((entry) => entry.target === last)) === null || _c === void 0 ? void 0 : _c.isIntersecting) !== null && _d !== void 0 ? _d : false;
1478
+ this.etObserveScrollState.emit({
1479
+ isAtStart,
1480
+ isAtEnd,
1481
+ canScroll: !isAtStart || !isAtEnd,
1482
+ });
1483
+ }, {
1484
+ root: this._elementRef.nativeElement,
1485
+ rootMargin: `${this._rootMargin}px`,
1486
+ threshold: this._threshold,
1487
+ });
1488
+ return observer;
1489
+ }
1490
+ _observeChild(child, element) {
1491
+ var _a;
1492
+ (_a = this._intersectionObserver) === null || _a === void 0 ? void 0 : _a.observe(element);
1493
+ this._observedChildren[child] = element;
1494
+ element.classList.add(`et-scroll-observer-observing-${child}-element`);
1495
+ }
1496
+ _unobserveChild(child) {
1497
+ var _a;
1498
+ const observedChild = this._observedChildren[child];
1499
+ if (!observedChild) {
1500
+ return;
1501
+ }
1502
+ observedChild.classList.remove('et-scroll-observer-observing-first-element', 'et-scroll-observer-observing-last-element');
1503
+ (_a = this._intersectionObserver) === null || _a === void 0 ? void 0 : _a.unobserve(observedChild);
1504
+ this._observedChildren[child] = null;
1505
+ }
1506
+ _clearIntersectionObserver() {
1507
+ var _a;
1508
+ (_a = this._intersectionObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
1509
+ this._intersectionObserver = null;
1510
+ }
1511
+ _getNonIgnoredChild(element, direction) {
1512
+ if (!element) {
1513
+ return null;
1514
+ }
1515
+ if (element === null || element === void 0 ? void 0 : element.classList.contains(SCROLL_OBSERVER_IGNORE_TARGET_CLASS)) {
1516
+ const nextElement = element[`${direction}ElementSibling`];
1517
+ if (!nextElement) {
1518
+ return null;
1519
+ }
1520
+ return this._getNonIgnoredChild(nextElement, direction);
1521
+ }
1522
+ return element;
1523
+ }
1524
+ }
1525
+ ObserveScrollStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveScrollStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1526
+ ObserveScrollStateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ObserveScrollStateDirective, isStandalone: true, selector: "[etObserveScrollState]", inputs: { observerRootMargin: "observerRootMargin", observerThreshold: "observerThreshold" }, outputs: { etObserveScrollState: "etObserveScrollState" }, providers: [
1527
+ {
1528
+ provide: OBSERVE_SCROLL_STATE,
1529
+ useExisting: ObserveScrollStateDirective,
1530
+ },
1531
+ DestroyService,
1532
+ ], exportAs: ["etObserveScrollState"], ngImport: i0 });
1533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveScrollStateDirective, decorators: [{
1534
+ type: Directive,
1535
+ args: [{
1536
+ selector: '[etObserveScrollState]',
1537
+ exportAs: 'etObserveScrollState',
1538
+ standalone: true,
1539
+ providers: [
1540
+ {
1541
+ provide: OBSERVE_SCROLL_STATE,
1542
+ useExisting: ObserveScrollStateDirective,
1543
+ },
1544
+ DestroyService,
1545
+ ],
1546
+ }]
1547
+ }], propDecorators: { observerRootMargin: [{
1548
+ type: Input
1549
+ }], observerThreshold: [{
1550
+ type: Input
1551
+ }], etObserveScrollState: [{
1552
+ type: Output
598
1553
  }] } });
599
1554
 
1555
+ class RepeatDirective {
1556
+ get repeatCount() {
1557
+ return this._repeatCount;
1558
+ }
1559
+ set repeatCount(value) {
1560
+ this._repeatCount = coerceNumberProperty(value);
1561
+ this._render();
1562
+ }
1563
+ constructor(_mainTemplateRef, _viewContainerRef) {
1564
+ this._mainTemplateRef = _mainTemplateRef;
1565
+ this._viewContainerRef = _viewContainerRef;
1566
+ this._repeatCount = 2;
1567
+ }
1568
+ _render() {
1569
+ this._viewContainerRef.clear();
1570
+ for (let i = 0; i < this.repeatCount; i++) {
1571
+ this._viewContainerRef.createEmbeddedView(this._mainTemplateRef);
1572
+ }
1573
+ }
1574
+ }
1575
+ RepeatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RepeatDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
1576
+ RepeatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 });
1577
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RepeatDirective, decorators: [{
1578
+ type: Directive,
1579
+ args: [{
1580
+ selector: '[etRepeat]',
1581
+ standalone: true,
1582
+ }]
1583
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { repeatCount: [{
1584
+ type: Input,
1585
+ args: ['etRepeat']
1586
+ }] } });
1587
+
1588
+ const SEO_DIRECTIVE_TOKEN = new InjectionToken('SEO_DIRECTIVE_TOKEN');
1589
+
1590
+ const mergeSeoConfig = (config, parentConfig) => {
1591
+ return Object.assign(Object.assign({}, parentConfig), config);
1592
+ };
1593
+
1594
+ class SeoDirective {
1595
+ constructor() {
1596
+ this._metaService = inject(Meta);
1597
+ this._titleService = inject(Title);
1598
+ this._onDeactivate$ = new Subject();
1599
+ this._isDeactivated = false;
1600
+ this.parent = inject(SEO_DIRECTIVE_TOKEN, { optional: true, skipSelf: true });
1601
+ this._config = {};
1602
+ }
1603
+ get config() {
1604
+ return this._config;
1605
+ }
1606
+ ngOnInit() {
1607
+ var _a;
1608
+ (_a = this.parent) === null || _a === void 0 ? void 0 : _a._deactivate();
1609
+ }
1610
+ ngOnDestroy() {
1611
+ var _a;
1612
+ this._deactivate();
1613
+ this._cleanUp();
1614
+ (_a = this.parent) === null || _a === void 0 ? void 0 : _a._activate();
1615
+ }
1616
+ // TODO(TRB): This should get split up into multiple methods to make it more readable
1617
+ // - updateTitle
1618
+ // - updateMeta
1619
+ // - updateLink
1620
+ updateConfig(config) {
1621
+ var _a;
1622
+ this._config = mergeSeoConfig(config, ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.config) || {});
1623
+ if (this._isDeactivated) {
1624
+ return;
1625
+ }
1626
+ this._deactivate();
1627
+ this._activate();
1628
+ }
1629
+ _activate() {
1630
+ this._onDeactivate$.next(false);
1631
+ this._isDeactivated = false;
1632
+ for (const [key, value] of Object.entries(this._config)) {
1633
+ if (value instanceof Observable) {
1634
+ value.pipe(takeUntil(this._onDeactivate$)).subscribe((value) => this._update(key, value));
1635
+ }
1636
+ else if (Array.isArray(value)) {
1637
+ value.forEach((value) => {
1638
+ if (value instanceof Observable) {
1639
+ value.pipe(takeUntil(this._onDeactivate$)).subscribe((value) => this._update(key, value));
1640
+ }
1641
+ else {
1642
+ this._update(key, value);
1643
+ }
1644
+ });
1645
+ }
1646
+ else if (typeof value === 'object' && value !== null) {
1647
+ for (const [subKey, subValue] of Object.entries(value)) {
1648
+ if (subValue instanceof Observable) {
1649
+ subValue.pipe(takeUntil(this._onDeactivate$)).subscribe((value) => this._update(`${key}:${subKey}`, value));
1650
+ }
1651
+ else {
1652
+ this._update(`${key}:${subKey}`, subValue);
1653
+ }
1654
+ }
1655
+ }
1656
+ else {
1657
+ this._update(key, value);
1658
+ }
1659
+ }
1660
+ }
1661
+ _deactivate() {
1662
+ this._onDeactivate$.next(true);
1663
+ this._isDeactivated = true;
1664
+ }
1665
+ _update(key, value) {
1666
+ switch (key) {
1667
+ case 'title':
1668
+ if (value && typeof value === 'string') {
1669
+ this._titleService.setTitle(value);
1670
+ }
1671
+ break;
1672
+ case 'canonical':
1673
+ {
1674
+ const link = document.querySelector(`link[rel="${key}"]`);
1675
+ if (link) {
1676
+ link.setAttribute('href', value);
1677
+ }
1678
+ else {
1679
+ const newLink = document.createElement('link');
1680
+ newLink.setAttribute('rel', key);
1681
+ newLink.setAttribute('href', value);
1682
+ document.head.appendChild(newLink);
1683
+ }
1684
+ }
1685
+ break;
1686
+ case 'alternate':
1687
+ {
1688
+ const link = document.querySelector(`link[rel="${key}"][hreflang="${value.hreflang}"]`);
1689
+ if (link) {
1690
+ link.setAttribute('href', value.href);
1691
+ }
1692
+ else {
1693
+ const newLink = document.createElement('link');
1694
+ newLink.setAttribute('rel', key);
1695
+ newLink.setAttribute('hreflang', value.hreflang);
1696
+ newLink.setAttribute('href', value.href);
1697
+ document.head.appendChild(newLink);
1698
+ }
1699
+ }
1700
+ break;
1701
+ default:
1702
+ if (value !== undefined && value !== null) {
1703
+ const val = Array.isArray(value) ? value.join(', ') : value;
1704
+ this._metaService.updateTag({ name: key, content: val });
1705
+ }
1706
+ else {
1707
+ this._metaService.removeTag(`name="${key}"`);
1708
+ }
1709
+ break;
1710
+ }
1711
+ }
1712
+ _cleanUp() {
1713
+ var _a, _b, _c, _d, _e;
1714
+ for (const key in this._config) {
1715
+ if (key === 'alternate') {
1716
+ const links = document.querySelectorAll(`link[rel="${key}"]`);
1717
+ links.forEach((link) => {
1718
+ link.remove();
1719
+ });
1720
+ continue;
1721
+ }
1722
+ if (key === 'canonical') {
1723
+ const link = document.querySelector(`link[rel="${key}"]`);
1724
+ if (link) {
1725
+ link.remove();
1726
+ }
1727
+ continue;
1728
+ }
1729
+ if (typeof this._config[key] === 'object' &&
1730
+ this._config[key] !== null &&
1731
+ !(this._config[key] instanceof Observable)) {
1732
+ for (const subKey in this._config[key]) {
1733
+ const parentValue = (_c = (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b[key]) === null || _c === void 0 ? void 0 : _c[subKey];
1734
+ if (parentValue === undefined) {
1735
+ this._update(`${key}:${subKey}`, undefined);
1736
+ }
1737
+ }
1738
+ }
1739
+ else {
1740
+ const parentValue = (_e = (_d = this.parent) === null || _d === void 0 ? void 0 : _d.config) === null || _e === void 0 ? void 0 : _e[key];
1741
+ if (parentValue === undefined) {
1742
+ this._update(key, null);
1743
+ }
1744
+ }
1745
+ }
1746
+ }
1747
+ }
1748
+ SeoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: SeoDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1749
+ SeoDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: SeoDirective, isStandalone: true, providers: [{ provide: SEO_DIRECTIVE_TOKEN, useExisting: SeoDirective }], ngImport: i0 });
1750
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: SeoDirective, decorators: [{
1751
+ type: Directive,
1752
+ args: [{
1753
+ standalone: true,
1754
+ providers: [{ provide: SEO_DIRECTIVE_TOKEN, useExisting: SeoDirective }],
1755
+ }]
1756
+ }] });
1757
+
1758
+ // TODO(TRB): Add correct type once provided by API
1759
+ const normalizeGameResultType = (type) => {
1760
+ if (!type) {
1761
+ return null;
1762
+ }
1763
+ switch (type) {
1764
+ case 'extra_time':
1765
+ return {
1766
+ i18n: 'game-result-type.extra-time',
1767
+ shortCode: 'AET',
1768
+ text: 'After Extra Time',
1769
+ };
1770
+ case 'penalty':
1771
+ return {
1772
+ i18n: 'game-result-type.penalty',
1773
+ shortCode: 'PSO',
1774
+ text: 'Penalty shootout',
1775
+ };
1776
+ case 'golden_goal':
1777
+ return {
1778
+ i18n: 'game-result-type.golden-goal',
1779
+ shortCode: 'GG',
1780
+ text: 'Golden Goal',
1781
+ };
1782
+ case 'default':
1783
+ default:
1784
+ return {
1785
+ i18n: 'game-result-type.full-time',
1786
+ shortCode: 'FT',
1787
+ text: 'Full Time',
1788
+ };
1789
+ }
1790
+ };
1791
+
1792
+ class NormalizeGameResultTypePipe {
1793
+ constructor() {
1794
+ this.transform = normalizeGameResultType;
1795
+ }
1796
+ }
1797
+ NormalizeGameResultTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeGameResultTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1798
+ NormalizeGameResultTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeGameResultTypePipe, isStandalone: true, name: "etNormalizeGameResultType" });
1799
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeGameResultTypePipe, decorators: [{
1800
+ type: Pipe,
1801
+ args: [{ name: 'etNormalizeGameResultType', standalone: true }]
1802
+ }] });
1803
+
1804
+ const normalizeMatchState = (match) => {
1805
+ if (match === null || match === void 0 ? void 0 : match.isCompletedByReferee) {
1806
+ return "autoWin" /* MatchStateType.AUTO_WIN */;
1807
+ }
1808
+ else if ((match === null || match === void 0 ? void 0 : match.status) === 'preparing') {
1809
+ return "preMatch" /* MatchStateType.PRE_MATCH */;
1810
+ }
1811
+ else if ((match === null || match === void 0 ? void 0 : match.status) === 'started') {
1812
+ return "live" /* MatchStateType.LIVE */;
1813
+ }
1814
+ else if ((match === null || match === void 0 ? void 0 : match.status) === 'published' || (match === null || match === void 0 ? void 0 : match.status) === 'finished') {
1815
+ return "postMatch" /* MatchStateType.POST_MATCH */;
1816
+ }
1817
+ else if ((match === null || match === void 0 ? void 0 : match.round.state) !== 'preparing') {
1818
+ return "preparingRound" /* MatchStateType.PREPARING_ROUND */;
1819
+ }
1820
+ return null;
1821
+ };
1822
+
1823
+ class NormalizeMatchStatePipe {
1824
+ constructor() {
1825
+ this.transform = normalizeMatchState;
1826
+ }
1827
+ }
1828
+ NormalizeMatchStatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchStatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1829
+ NormalizeMatchStatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchStatePipe, isStandalone: true, name: "etNormalizeMatchState" });
1830
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchStatePipe, decorators: [{
1831
+ type: Pipe,
1832
+ args: [{ name: 'etNormalizeMatchState', standalone: true }]
1833
+ }] });
1834
+
1835
+ const normalizeMatchParticipants = (match) => {
1836
+ const matchState = normalizeMatchState(match);
1837
+ if (!match || !matchState) {
1838
+ return null;
1839
+ }
1840
+ return {
1841
+ home: normalizeMatchParticipant(match, 'home'),
1842
+ away: normalizeMatchParticipant(match, 'away'),
1843
+ };
1844
+ };
1845
+ const normalizeMatchParticipant = (match, side) => {
1846
+ var _a, _b, _c, _d;
1847
+ const matchState = normalizeMatchState(match);
1848
+ if (!match || !matchState) {
1849
+ return null;
1850
+ }
1851
+ const participant = match[side];
1852
+ const participantType = (_d = (_b = (_a = match.home) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : (_c = match.away) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : 'unknown';
1853
+ if (!participant) {
1854
+ if (matchState === "postMatch" /* MatchStateType.POST_MATCH */ || matchState === "autoWin" /* MatchStateType.AUTO_WIN */) {
1855
+ return {
1856
+ participantType,
1857
+ type: 'none',
1858
+ i18n: 'match-participant.none',
1859
+ text: 'No opponent',
1860
+ data: participant,
1861
+ };
1862
+ }
1863
+ else {
1864
+ return {
1865
+ participantType,
1866
+ type: 'tbd',
1867
+ i18n: 'match-participant.tbd',
1868
+ text: 'TBD',
1869
+ data: participant,
1870
+ };
1871
+ }
1872
+ }
1873
+ else {
1874
+ return {
1875
+ participantType,
1876
+ type: 'participant',
1877
+ data: participant,
1878
+ };
1879
+ }
1880
+ };
1881
+
1882
+ class NormalizeMatchParticipantsPipe {
1883
+ constructor() {
1884
+ this.transform = normalizeMatchParticipants;
1885
+ }
1886
+ }
1887
+ NormalizeMatchParticipantsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchParticipantsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1888
+ NormalizeMatchParticipantsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchParticipantsPipe, isStandalone: true, name: "etNormalizeMatchParticipants" });
1889
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchParticipantsPipe, decorators: [{
1890
+ type: Pipe,
1891
+ args: [{ name: 'etNormalizeMatchParticipants', standalone: true }]
1892
+ }] });
1893
+
1894
+ const EMPTY_SCORE = {
1895
+ home: { score: 'match-score.placeholder', isWinner: false },
1896
+ away: { score: 'match-score.placeholder', isWinner: false },
1897
+ isNumeric: false,
1898
+ subLine: null,
1899
+ };
1900
+ const normalizeMatchScore = (match) => {
1901
+ var _a, _b;
1902
+ if (!match) {
1903
+ return null;
1904
+ }
1905
+ const matchState = normalizeMatchState(match);
1906
+ const subLine = getMatchScoreSubLine(match);
1907
+ if (!match.homeScore && !match.awayScore) {
1908
+ return Object.assign(Object.assign({}, EMPTY_SCORE), { subLine, isNumeric: false });
1909
+ }
1910
+ if (isKnockoutMatch(match)) {
1911
+ if (matchState === "preMatch" /* MatchStateType.PRE_MATCH */ || matchState === "live" /* MatchStateType.LIVE */) {
1912
+ return Object.assign(Object.assign({}, EMPTY_SCORE), { subLine, isNumeric: false });
1913
+ }
1914
+ return {
1915
+ home: {
1916
+ score: getKnockoutMatchScore(match.homeScore),
1917
+ isWinner: ((_a = match.homeScore) === null || _a === void 0 ? void 0 : _a.status) === 'won',
1918
+ },
1919
+ away: {
1920
+ score: getKnockoutMatchScore(match.awayScore),
1921
+ isWinner: ((_b = match.awayScore) === null || _b === void 0 ? void 0 : _b.status) === 'won',
1922
+ },
1923
+ subLine,
1924
+ isNumeric: false,
1925
+ };
1926
+ }
1927
+ else if (isGroupMatch(match)) {
1928
+ if (match.games.length === 1) {
1929
+ // Return the score if only one game has been played
1930
+ return Object.assign(Object.assign({}, getGroupMatchScore(match)), { subLine, isNumeric: true });
1931
+ }
1932
+ else {
1933
+ return Object.assign(Object.assign({}, getGroupMatchPoints(match)), { subLine, isNumeric: true });
1934
+ }
1935
+ }
1936
+ else {
1937
+ return Object.assign(Object.assign({}, getGroupMatchScore(match)), { subLine, isNumeric: true });
1938
+ }
1939
+ };
1940
+ const isKnockoutMatch = (match) => {
1941
+ if (!match) {
1942
+ return false;
1943
+ }
1944
+ return (match.matchType === 'single_elimination' ||
1945
+ match.matchType === 'double_elimination' ||
1946
+ match.matchType === 'fifa_swiss');
1947
+ };
1948
+ const isGroupMatch = (match) => {
1949
+ if (!match) {
1950
+ return false;
1951
+ }
1952
+ return match.matchType === 'groups' || match.matchType === 'league';
1953
+ };
1954
+ const getKnockoutMatchScore = (score) => {
1955
+ if ((score === null || score === void 0 ? void 0 : score.status) === 'won') {
1956
+ return 'match-score.knockout.won';
1957
+ }
1958
+ else if ((score === null || score === void 0 ? void 0 : score.status) === 'lost') {
1959
+ return 'match-score.knockout.lost';
1960
+ }
1961
+ else if ((score === null || score === void 0 ? void 0 : score.status) === 'tie') {
1962
+ return 'match-score.knockout.tie';
1963
+ }
1964
+ return null;
1965
+ };
1966
+ const getMatchScoreSubLine = (match) => {
1967
+ if (isKnockoutMatch(match)) {
1968
+ return null;
1969
+ }
1970
+ else if (isGroupMatch(match)) {
1971
+ return 'match-score.groups.sub-line';
1972
+ }
1973
+ else {
1974
+ return null;
1975
+ }
1976
+ };
1977
+ const getGroupMatchScore = (match) => {
1978
+ var _a, _b, _c, _d;
1979
+ if (!match) {
1980
+ return null;
1981
+ }
1982
+ return {
1983
+ home: {
1984
+ score: ((_a = match.homeScore) === null || _a === void 0 ? void 0 : _a.ownPoints) || 0,
1985
+ isWinner: ((_b = match.homeScore) === null || _b === void 0 ? void 0 : _b.status) === 'won',
1986
+ },
1987
+ away: {
1988
+ score: ((_c = match.awayScore) === null || _c === void 0 ? void 0 : _c.ownPoints) || 0,
1989
+ isWinner: ((_d = match.awayScore) === null || _d === void 0 ? void 0 : _d.status) === 'won',
1990
+ },
1991
+ };
1992
+ };
1993
+ const getGroupMatchPoints = (match) => {
1994
+ var _a, _b, _c, _d;
1995
+ if (!match) {
1996
+ return null;
1997
+ }
1998
+ return {
1999
+ home: {
2000
+ score: ((_a = match.homeScore) === null || _a === void 0 ? void 0 : _a.score) || 0,
2001
+ isWinner: ((_b = match.homeScore) === null || _b === void 0 ? void 0 : _b.status) === 'won',
2002
+ },
2003
+ away: {
2004
+ score: ((_c = match.awayScore) === null || _c === void 0 ? void 0 : _c.score) || 0,
2005
+ isWinner: ((_d = match.awayScore) === null || _d === void 0 ? void 0 : _d.status) === 'won',
2006
+ },
2007
+ };
2008
+ };
2009
+
2010
+ class NormalizeMatchScorePipe {
2011
+ constructor() {
2012
+ this.transform = normalizeMatchScore;
2013
+ }
2014
+ }
2015
+ NormalizeMatchScorePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchScorePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2016
+ NormalizeMatchScorePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchScorePipe, isStandalone: true, name: "etNormalizeMatchScore" });
2017
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchScorePipe, decorators: [{
2018
+ type: Pipe,
2019
+ args: [{ name: 'etNormalizeMatchScore', standalone: true }]
2020
+ }] });
2021
+
2022
+ const normalizeMatchType = (matchType) => {
2023
+ if (!matchType) {
2024
+ return null;
2025
+ }
2026
+ switch (matchType) {
2027
+ case 'double_elimination':
2028
+ return {
2029
+ i18n: 'match-type.double-elimination',
2030
+ text: 'Double Elimination',
2031
+ };
2032
+ case 'single_elimination':
2033
+ return {
2034
+ i18n: 'match-type.single-elimination',
2035
+ text: 'Single Elimination',
2036
+ };
2037
+ case 'fifa_swiss':
2038
+ return {
2039
+ i18n: 'match-type.fifa-swiss',
2040
+ text: 'FIFA Swiss',
2041
+ };
2042
+ case 'groups':
2043
+ return {
2044
+ i18n: 'match-type.groups',
2045
+ text: 'Groups',
2046
+ };
2047
+ case 'league':
2048
+ return {
2049
+ i18n: 'match-type.league',
2050
+ text: 'League',
2051
+ };
2052
+ case 'pools':
2053
+ return {
2054
+ i18n: 'match-type.pools',
2055
+ text: 'Pools',
2056
+ };
2057
+ }
2058
+ };
2059
+
2060
+ class NormalizeMatchTypePipe {
2061
+ constructor() {
2062
+ this.transform = normalizeMatchType;
2063
+ }
2064
+ }
2065
+ NormalizeMatchTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2066
+ NormalizeMatchTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchTypePipe, isStandalone: true, name: "etNormalizeMatchType" });
2067
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchTypePipe, decorators: [{
2068
+ type: Pipe,
2069
+ args: [{ name: 'etNormalizeMatchType', standalone: true }]
2070
+ }] });
2071
+
600
2072
  const toArray = (value) => {
601
2073
  return Array.from({ length: value }, (_, i) => i);
602
2074
  };
@@ -607,24 +2079,51 @@ class ToArrayPipe {
607
2079
  this.transform = toArray;
608
2080
  }
609
2081
  }
610
- ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
611
- ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" });
612
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ToArrayPipe, decorators: [{
2082
+ ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2083
+ ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" });
2084
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ToArrayPipe, decorators: [{
613
2085
  type: Pipe,
614
2086
  args: [{ name: 'toArray', standalone: true }]
615
2087
  }] });
616
2088
 
617
- const provideViewportConfig = (viewportConfig) => {
618
- return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
619
- };
620
-
621
- const clamp = (value, min = 0, max = 100) => {
622
- return Math.max(min, Math.min(max, value));
623
- };
2089
+ var _a;
2090
+ class TypedQueryList extends QueryList {
2091
+ constructor() {
2092
+ super(...arguments);
2093
+ this[_a] = () => {
2094
+ return super[Symbol.iterator]();
2095
+ };
2096
+ }
2097
+ get changes() {
2098
+ return super.changes;
2099
+ }
2100
+ toArray() {
2101
+ return super.toArray();
2102
+ }
2103
+ forEach(fn) {
2104
+ super.forEach(fn);
2105
+ }
2106
+ filter(fn) {
2107
+ return super.filter(fn);
2108
+ }
2109
+ map(fn) {
2110
+ return super.map(fn);
2111
+ }
2112
+ reduce(fn, initialValue) {
2113
+ return super.reduce(fn, initialValue);
2114
+ }
2115
+ some(fn) {
2116
+ return super.some(fn);
2117
+ }
2118
+ find(fn) {
2119
+ return super.find(fn);
2120
+ }
2121
+ }
2122
+ _a = Symbol.iterator;
624
2123
 
625
2124
  /**
626
2125
  * Generated bundle index. Do not edit.
627
2126
  */
628
2127
 
629
- export { ContentObserverService, DEFAULT_VIEWPORT_CONFIG, FocusVisibleService, LetContext, LetDirective, Memo, MutationObserverFactory, ObserveContentDirective, ObserveResizeDirective, RepeatDirective, ResizeObserverFactory, ResizeObserverService, ToArrayPipe, VIEWPORT_CONFIG, ViewportService, clamp, provideViewportConfig, toArray, toArrayTrackByFn };
2128
+ export { ClickObserverFactory, ClickObserverService, ClickOutsideDirective, ContentObserverService, CursorDragScrollDirective, DEFAULT_VIEWPORT_CONFIG, DestroyService, FocusVisibleService, LetContext, LetDirective, Memo, MutationObserverFactory, NormalizeGameResultTypePipe, NormalizeMatchParticipantsPipe, NormalizeMatchScorePipe, NormalizeMatchStatePipe, NormalizeMatchTypePipe, OBSERVE_SCROLL_STATE, ObserveContentDirective, ObserveResizeDirective, ObserveScrollStateDirective, RepeatDirective, ResizeObserverFactory, ResizeObserverService, RouterStateService, SCROLL_OBSERVER_FIRST_ELEMENT_CLASS, SCROLL_OBSERVER_IGNORE_TARGET_CLASS, SCROLL_OBSERVER_LAST_ELEMENT_CLASS, SEO_DIRECTIVE_TOKEN, ScrollObserverFirstElementDirective, ScrollObserverIgnoreTargetDirective, ScrollObserverLastElementDirective, SeoDirective, StructuredDataComponent, ToArrayPipe, TypedQueryList, VIEWPORT_CONFIG, ViewportService, clamp, clone, createReactiveBindings, deleteCookie, elementCanScroll, equal, getCookie, getDomain, getGroupMatchPoints, getGroupMatchScore, getKnockoutMatchScore, getMatchScoreSubLine, hasCookie, isGroupMatch, isKnockoutMatch, mergeSeoConfig, normalizeGameResultType, normalizeMatchParticipant, normalizeMatchParticipants, normalizeMatchScore, normalizeMatchState, normalizeMatchType, provideViewportConfig, routerDisableScrollTop, setCookie, toArray, toArrayTrackByFn };
630
2129
  //# sourceMappingURL=ethlete-core.mjs.map