@ethlete/core 0.2.0-next.1 → 0.2.0-next.11

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 (149) 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/decorators/index.mjs +2 -0
  5. package/esm2020/lib/decorators/memo/memo.decorator.mjs +2 -2
  6. package/esm2020/lib/directives/click-outside/click-outside.directive.mjs +37 -0
  7. package/esm2020/lib/directives/click-outside/public-api.mjs +2 -0
  8. package/esm2020/lib/directives/cursor-drag-scroll/cursor-drag-scroll.constants.mjs +3 -0
  9. package/esm2020/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +147 -0
  10. package/esm2020/lib/directives/cursor-drag-scroll/public-api.mjs +2 -0
  11. package/esm2020/lib/directives/let/let.directive.mjs +8 -8
  12. package/esm2020/lib/directives/observe-content/observe-content.directive.mjs +68 -0
  13. package/esm2020/lib/directives/observe-content/public-api.mjs +2 -0
  14. package/esm2020/lib/directives/observe-resize/observe-resize.directive.mjs +68 -0
  15. package/esm2020/lib/directives/observe-resize/public-api.mjs +2 -0
  16. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.constants.mjs +3 -0
  17. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +171 -0
  18. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.types.mjs +2 -0
  19. package/esm2020/lib/directives/observe-scroll-state/public-api.mjs +3 -0
  20. package/esm2020/lib/directives/public-api.mjs +10 -1
  21. package/esm2020/lib/directives/repeat/repeat.directive.mjs +10 -11
  22. package/esm2020/lib/directives/scroll-observer-first-element/index.mjs +2 -0
  23. package/esm2020/lib/directives/scroll-observer-first-element/public-api.mjs +2 -0
  24. package/esm2020/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.mjs +31 -0
  25. package/esm2020/lib/directives/scroll-observer-ignore-target/index.mjs +2 -0
  26. package/esm2020/lib/directives/scroll-observer-ignore-target/public-api.mjs +2 -0
  27. package/esm2020/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +18 -0
  28. package/esm2020/lib/directives/scroll-observer-last-element/index.mjs +2 -0
  29. package/esm2020/lib/directives/scroll-observer-last-element/public-api.mjs +2 -0
  30. package/esm2020/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.mjs +34 -0
  31. package/esm2020/lib/directives/seo/public-api.mjs +5 -0
  32. package/esm2020/lib/directives/seo/seo.directive.constants.mjs +3 -0
  33. package/esm2020/lib/directives/seo/seo.directive.mjs +166 -0
  34. package/esm2020/lib/directives/seo/seo.directive.types.mjs +2 -0
  35. package/esm2020/lib/directives/seo/seo.directive.utils.mjs +7 -0
  36. package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.mjs +15 -0
  37. package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.types.mjs +2 -0
  38. package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.util.mjs +34 -0
  39. package/esm2020/lib/pipes/normalize-game-result-type/public-api.mjs +4 -0
  40. package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.mjs +15 -0
  41. package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.types.mjs +2 -0
  42. package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.util.mjs +47 -0
  43. package/esm2020/lib/pipes/normalize-match-participants/public-api.mjs +4 -0
  44. package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.pipe.mjs +15 -0
  45. package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.types.mjs +2 -0
  46. package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.util.mjs +126 -0
  47. package/esm2020/lib/pipes/normalize-match-score/public-api.mjs +4 -0
  48. package/esm2020/lib/pipes/normalize-match-state/index.mjs +2 -0
  49. package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.constants.mjs +2 -0
  50. package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.pipe.mjs +15 -0
  51. package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.util.mjs +19 -0
  52. package/esm2020/lib/pipes/normalize-match-state/public-api.mjs +4 -0
  53. package/esm2020/lib/pipes/normalize-match-type/normalize-match-type.pipe.mjs +15 -0
  54. package/esm2020/lib/pipes/normalize-match-type/normalize-match-type.util.mjs +38 -0
  55. package/esm2020/lib/pipes/normalize-match-type/public-api.mjs +3 -0
  56. package/esm2020/lib/pipes/public-api.mjs +6 -1
  57. package/esm2020/lib/pipes/to-array/to-array.pipe.mjs +3 -3
  58. package/esm2020/lib/public-api.mjs +2 -1
  59. package/esm2020/lib/services/click-observer.service.mjs +73 -0
  60. package/esm2020/lib/services/content-observer.service.mjs +79 -0
  61. package/esm2020/lib/services/destroy.service.mjs +19 -0
  62. package/esm2020/lib/services/focus-visible.service.mjs +7 -7
  63. package/esm2020/lib/services/index.mjs +2 -0
  64. package/esm2020/lib/services/public-api.mjs +6 -2
  65. package/esm2020/lib/services/resize-observer.service.mjs +75 -0
  66. package/esm2020/lib/services/viewport.service.mjs +43 -18
  67. package/esm2020/lib/types/i18n.types.mjs +2 -0
  68. package/esm2020/lib/types/public-api.mjs +3 -2
  69. package/esm2020/lib/utils/index.mjs +2 -0
  70. package/esm2020/lib/utils/public-api.mjs +4 -2
  71. package/esm2020/lib/utils/reactive-binding.util.mjs +67 -0
  72. package/esm2020/lib/utils/scrollable.utils.mjs +5 -0
  73. package/fesm2015/ethlete-core.mjs +1514 -119
  74. package/fesm2015/ethlete-core.mjs.map +1 -1
  75. package/fesm2020/ethlete-core.mjs +1511 -119
  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/decorators/index.d.ts +1 -0
  81. package/lib/directives/click-outside/click-outside.directive.d.ts +12 -0
  82. package/lib/directives/click-outside/public-api.d.ts +1 -0
  83. package/lib/directives/cursor-drag-scroll/cursor-drag-scroll.constants.d.ts +2 -0
  84. package/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.d.ts +27 -0
  85. package/lib/directives/cursor-drag-scroll/public-api.d.ts +1 -0
  86. package/lib/directives/let/let.directive.d.ts +1 -1
  87. package/lib/directives/observe-content/observe-content.directive.d.ts +22 -0
  88. package/lib/directives/observe-content/public-api.d.ts +1 -0
  89. package/lib/directives/observe-resize/observe-resize.directive.d.ts +22 -0
  90. package/lib/directives/observe-resize/public-api.d.ts +1 -0
  91. package/lib/directives/observe-scroll-state/observe-scroll-state.constants.d.ts +3 -0
  92. package/lib/directives/observe-scroll-state/observe-scroll-state.directive.d.ts +31 -0
  93. package/lib/directives/observe-scroll-state/observe-scroll-state.types.d.ts +6 -0
  94. package/lib/directives/observe-scroll-state/public-api.d.ts +3 -0
  95. package/lib/directives/public-api.d.ts +9 -0
  96. package/lib/directives/repeat/repeat.directive.d.ts +3 -4
  97. package/lib/directives/scroll-observer-first-element/index.d.ts +1 -0
  98. package/lib/directives/scroll-observer-first-element/public-api.d.ts +1 -0
  99. package/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.d.ts +10 -0
  100. package/lib/directives/scroll-observer-ignore-target/index.d.ts +1 -0
  101. package/lib/directives/scroll-observer-ignore-target/public-api.d.ts +1 -0
  102. package/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.d.ts +6 -0
  103. package/lib/directives/scroll-observer-last-element/index.d.ts +1 -0
  104. package/lib/directives/scroll-observer-last-element/public-api.d.ts +1 -0
  105. package/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.d.ts +10 -0
  106. package/lib/directives/seo/public-api.d.ts +4 -0
  107. package/lib/directives/seo/seo.directive.constants.d.ts +3 -0
  108. package/lib/directives/seo/seo.directive.d.ts +21 -0
  109. package/lib/directives/seo/seo.directive.types.d.ts +51 -0
  110. package/lib/directives/seo/seo.directive.utils.d.ts +2 -0
  111. package/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.d.ts +7 -0
  112. package/lib/pipes/normalize-game-result-type/normalize-game-result-type.types.d.ts +4 -0
  113. package/lib/pipes/normalize-game-result-type/normalize-game-result-type.util.d.ts +2 -0
  114. package/lib/pipes/normalize-game-result-type/public-api.d.ts +3 -0
  115. package/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.d.ts +7 -0
  116. package/lib/pipes/normalize-match-participants/normalize-match-participants.types.d.ts +21 -0
  117. package/lib/pipes/normalize-match-participants/normalize-match-participants.util.d.ts +4 -0
  118. package/lib/pipes/normalize-match-participants/public-api.d.ts +3 -0
  119. package/lib/pipes/normalize-match-score/normalize-match-score.pipe.d.ts +7 -0
  120. package/lib/pipes/normalize-match-score/normalize-match-score.types.d.ts +12 -0
  121. package/lib/pipes/normalize-match-score/normalize-match-score.util.d.ts +27 -0
  122. package/lib/pipes/normalize-match-score/public-api.d.ts +3 -0
  123. package/lib/pipes/normalize-match-state/index.d.ts +1 -0
  124. package/lib/pipes/normalize-match-state/normalize-match-state.constants.d.ts +7 -0
  125. package/lib/pipes/normalize-match-state/normalize-match-state.pipe.d.ts +7 -0
  126. package/lib/pipes/normalize-match-state/normalize-match-state.util.d.ts +3 -0
  127. package/lib/pipes/normalize-match-state/public-api.d.ts +3 -0
  128. package/lib/pipes/normalize-match-type/normalize-match-type.pipe.d.ts +7 -0
  129. package/lib/pipes/normalize-match-type/normalize-match-type.util.d.ts +3 -0
  130. package/lib/pipes/normalize-match-type/public-api.d.ts +2 -0
  131. package/lib/pipes/public-api.d.ts +5 -0
  132. package/lib/public-api.d.ts +1 -0
  133. package/lib/services/click-observer.service.d.ts +21 -0
  134. package/lib/services/content-observer.service.d.ts +21 -0
  135. package/lib/services/destroy.service.d.ts +9 -0
  136. package/lib/services/index.d.ts +1 -0
  137. package/lib/services/public-api.d.ts +5 -1
  138. package/lib/services/resize-observer.service.d.ts +21 -0
  139. package/lib/services/viewport.service.d.ts +3 -0
  140. package/lib/services/viewport.types.d.ts +1 -1
  141. package/lib/types/angular.types.d.ts +1 -1
  142. package/lib/types/i18n.types.d.ts +4 -0
  143. package/lib/types/public-api.d.ts +2 -1
  144. package/lib/types/viewport.types.d.ts +2 -2
  145. package/lib/utils/index.d.ts +1 -0
  146. package/lib/utils/public-api.d.ts +3 -1
  147. package/lib/utils/reactive-binding.util.d.ts +14 -0
  148. package/lib/utils/scrollable.utils.d.ts +1 -0
  149. package/package.json +8 -6
@@ -1,10 +1,46 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Directive, Input, Pipe, Injectable, Inject, Optional, inject } from '@angular/core';
3
- import { coerceNumberProperty } from '@angular/cdk/coercion';
2
+ import { inject, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, InjectionToken, Injectable, Inject, Optional, ElementRef, EventEmitter, Directive, Output, NgZone, Pipe } 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, combineLatest, map, shareReplay, takeUntil, distinctUntilChanged, startWith, debounceTime, tap, take } from 'rxjs';
6
+ import { DOCUMENT } from '@angular/common';
4
7
  import { __decorate, __metadata } from 'tslib';
5
- import { BehaviorSubject, map, shareReplay } from 'rxjs';
6
8
  import * as i1 from '@angular/cdk/layout';
7
- import { DOCUMENT } from '@angular/common';
9
+ import { debounceTime as debounceTime$1 } from 'rxjs/operators';
10
+
11
+ class StructuredDataComponent {
12
+ constructor() {
13
+ this._sanitizer = inject(DomSanitizer);
14
+ }
15
+ set data(currentValue) {
16
+ this.jsonLD = this.getSafeHTML(currentValue);
17
+ }
18
+ getSafeHTML(value) {
19
+ const json = value ? JSON.stringify(value, null, 2).replace(/<\/script>/g, '<\\/script>') : '';
20
+ const html = `<script type="application/ld+json">${json}</script>`;
21
+ return this._sanitizer.bypassSecurityTrustHtml(html);
22
+ }
23
+ }
24
+ StructuredDataComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: StructuredDataComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
25
+ StructuredDataComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.0", 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 });
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: StructuredDataComponent, decorators: [{
27
+ type: Component,
28
+ args: [{
29
+ selector: 'et-structured-data',
30
+ standalone: true,
31
+ template: '',
32
+ changeDetection: ChangeDetectionStrategy.OnPush,
33
+ encapsulation: ViewEncapsulation.None,
34
+ host: {
35
+ style: 'display: none',
36
+ },
37
+ }]
38
+ }], propDecorators: { data: [{
39
+ type: Input
40
+ }], jsonLD: [{
41
+ type: HostBinding,
42
+ args: ['innerHTML']
43
+ }] } });
8
44
 
9
45
  const VIEWPORT_CONFIG = new InjectionToken('ViewportConfig');
10
46
  /**
@@ -36,7 +72,7 @@ function memoize(func, resolver, cache) {
36
72
  memoized.cache = cache;
37
73
  return memoized;
38
74
  }
39
- const defaultResolver = (...args) => args[0];
75
+ const defaultResolver = (...args) => args.join('-');
40
76
  const Memo = (config = {}) => (_, __, descriptor) => {
41
77
  if (typeof descriptor.value !== 'function') {
42
78
  throw new Error('Memoization can be applied only to methods');
@@ -47,115 +83,269 @@ const Memo = (config = {}) => (_, __, descriptor) => {
47
83
  return descriptor;
48
84
  };
49
85
 
50
- class LetContext {
51
- constructor() {
52
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
53
- this.$implicit = null;
54
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
55
- this.etLet = null;
86
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
87
+ class ClickObserverFactory {
88
+ create() {
89
+ return fromEvent(document, 'click');
90
+ }
91
+ }
92
+ ClickObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
93
+ ClickObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickObserverFactory, providedIn: 'root' });
94
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickObserverFactory, decorators: [{
95
+ type: Injectable,
96
+ args: [{ providedIn: 'root' }]
97
+ }] });
98
+ class ClickObserverService {
99
+ constructor(_clickObserverFactory) {
100
+ this._clickObserverFactory = _clickObserverFactory;
101
+ this._observedElements = new Map();
102
+ }
103
+ ngOnDestroy() {
104
+ this._observedElements.forEach((_, element) => this._cleanupObserver(element));
105
+ }
106
+ observe(elementOrRef) {
107
+ const element = coerceElement(elementOrRef);
108
+ return new Observable((observer) => {
109
+ const stream = this._observeElement(element);
110
+ const subscription = stream.subscribe(observer);
111
+ return () => {
112
+ subscription.unsubscribe();
113
+ this._unobserveElement(element);
114
+ };
115
+ });
116
+ }
117
+ _observeElement(element) {
118
+ if (!this._observedElements.has(element)) {
119
+ const stream = new Subject();
120
+ const observer = this._clickObserverFactory.create();
121
+ const sub = observer.subscribe((event) => stream.next(event));
122
+ this._observedElements.set(element, { observer: sub, stream, count: 1 });
123
+ }
124
+ else {
125
+ this._observedElements.get(element).count++;
126
+ }
127
+ return this._observedElements.get(element).stream;
128
+ }
129
+ _unobserveElement(element) {
130
+ if (this._observedElements.has(element)) {
131
+ this._observedElements.get(element).count--;
132
+ if (!this._observedElements.get(element).count) {
133
+ this._cleanupObserver(element);
134
+ }
135
+ }
136
+ }
137
+ _cleanupObserver(element) {
138
+ if (this._observedElements.has(element)) {
139
+ const { observer, stream } = this._observedElements.get(element);
140
+ if (observer) {
141
+ observer.unsubscribe();
142
+ }
143
+ stream.complete();
144
+ this._observedElements.delete(element);
145
+ }
56
146
  }
57
147
  }
148
+ ClickObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickObserverService, deps: [{ token: ClickObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
149
+ ClickObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickObserverService, providedIn: 'root' });
150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickObserverService, decorators: [{
151
+ type: Injectable,
152
+ args: [{ providedIn: 'root' }]
153
+ }], ctorParameters: function () { return [{ type: ClickObserverFactory }]; } });
58
154
 
59
- class LetDirective {
60
- constructor(_viewContainer, templateRef) {
61
- this._viewContainer = _viewContainer;
62
- this._context = new LetContext();
63
- this._templateRef = null;
64
- this._viewRef = null;
65
- this._templateRef = templateRef;
155
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
156
+ class MutationObserverFactory {
157
+ create(callback) {
158
+ return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
66
159
  }
67
- set etLet(value) {
68
- this._context.$implicit = this._context.etLet = value;
69
- this._updateView();
160
+ }
161
+ MutationObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
162
+ MutationObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' });
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MutationObserverFactory, decorators: [{
164
+ type: Injectable,
165
+ args: [{ providedIn: 'root' }]
166
+ }] });
167
+ class ContentObserverService {
168
+ constructor(_mutationObserverFactory) {
169
+ this._mutationObserverFactory = _mutationObserverFactory;
170
+ this._observedElements = new Map();
70
171
  }
71
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
72
- static ngTemplateContextGuard(dir, ctx) {
73
- return true;
172
+ ngOnDestroy() {
173
+ this._observedElements.forEach((_, element) => this._cleanupObserver(element));
74
174
  }
75
- _updateView() {
76
- if (!this._viewRef) {
77
- this._viewContainer.clear();
78
- if (this._templateRef) {
79
- this._viewRef = this._viewContainer.createEmbeddedView(this._templateRef, this._context);
175
+ observe(elementOrRef) {
176
+ const element = coerceElement(elementOrRef);
177
+ return new Observable((observer) => {
178
+ const stream = this._observeElement(element);
179
+ const subscription = stream.subscribe(observer);
180
+ return () => {
181
+ subscription.unsubscribe();
182
+ this._unobserveElement(element);
183
+ };
184
+ });
185
+ }
186
+ _observeElement(element) {
187
+ if (!this._observedElements.has(element)) {
188
+ const stream = new Subject();
189
+ const observer = this._mutationObserverFactory.create((mutations) => stream.next(mutations));
190
+ if (observer) {
191
+ observer.observe(element, {
192
+ characterData: true,
193
+ childList: true,
194
+ subtree: true,
195
+ });
196
+ }
197
+ this._observedElements.set(element, { observer, stream, count: 1 });
198
+ }
199
+ else {
200
+ this._observedElements.get(element).count++;
201
+ }
202
+ return this._observedElements.get(element).stream;
203
+ }
204
+ _unobserveElement(element) {
205
+ if (this._observedElements.has(element)) {
206
+ this._observedElements.get(element).count--;
207
+ if (!this._observedElements.get(element).count) {
208
+ this._cleanupObserver(element);
209
+ }
210
+ }
211
+ }
212
+ _cleanupObserver(element) {
213
+ if (this._observedElements.has(element)) {
214
+ const { observer, stream } = this._observedElements.get(element);
215
+ if (observer) {
216
+ observer.disconnect();
80
217
  }
218
+ stream.complete();
219
+ this._observedElements.delete(element);
81
220
  }
82
221
  }
83
222
  }
84
- LetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: LetDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
85
- LetDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.6", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 });
86
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: LetDirective, decorators: [{
87
- type: Directive,
88
- args: [{
89
- selector: '[etLet]',
90
- standalone: true,
91
- }]
92
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { etLet: [{
93
- type: Input
94
- }] } });
223
+ ContentObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ContentObserverService, deps: [{ token: MutationObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
224
+ ContentObserverServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ContentObserverService, providedIn: 'root' });
225
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ContentObserverService, decorators: [{
226
+ type: Injectable,
227
+ args: [{ providedIn: 'root' }]
228
+ }], ctorParameters: function () { return [{ type: MutationObserverFactory }]; } });
95
229
 
96
- class RepeatDirective {
97
- constructor(_mainTemplateRef, _viewContainerRef) {
98
- this._mainTemplateRef = _mainTemplateRef;
99
- this._viewContainerRef = _viewContainerRef;
100
- this._repeatCount = 2;
230
+ class DestroyService {
231
+ constructor() {
232
+ this._destroy$ = new Subject();
233
+ this.destroy$ = this._destroy$.asObservable();
101
234
  }
102
- get repeatCount() {
103
- return this._repeatCount;
235
+ ngOnDestroy() {
236
+ this._destroy$.next(true);
237
+ this._destroy$.unsubscribe();
104
238
  }
105
- set repeatCount(value) {
106
- this._repeatCount = coerceNumberProperty(value);
239
+ }
240
+ DestroyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: DestroyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
241
+ DestroyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: DestroyService });
242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: DestroyService, decorators: [{
243
+ type: Injectable
244
+ }] });
245
+
246
+ class FocusVisibleService {
247
+ get isFocusVisible() {
248
+ return this._hadKeyboardEvent;
107
249
  }
108
- ngOnInit() {
109
- this._render();
250
+ constructor() {
251
+ this._document = inject(DOCUMENT);
252
+ this._hadKeyboardEvent = false;
253
+ this._document.addEventListener('keydown', this.onKeyDown.bind(this), true);
254
+ this._document.addEventListener('mousedown', this.onPointerDown.bind(this), true);
255
+ this._document.addEventListener('pointerdown', this.onPointerDown.bind(this), true);
256
+ this._document.addEventListener('touchstart', this.onPointerDown.bind(this), true);
110
257
  }
111
- _render() {
112
- for (let i = 0; i < this.repeatCount; i++) {
113
- this._viewContainerRef.createEmbeddedView(this._mainTemplateRef);
258
+ onKeyDown(e) {
259
+ if (e.metaKey || e.altKey || e.ctrlKey) {
260
+ return;
114
261
  }
262
+ this._hadKeyboardEvent = true;
263
+ }
264
+ onPointerDown() {
265
+ this._hadKeyboardEvent = false;
115
266
  }
116
267
  }
117
- RepeatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: RepeatDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
118
- RepeatDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.6", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 });
119
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: RepeatDirective, decorators: [{
120
- type: Directive,
268
+ FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FocusVisibleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
269
+ FocusVisibleServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FocusVisibleService, providedIn: 'root' });
270
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FocusVisibleService, decorators: [{
271
+ type: Injectable,
121
272
  args: [{
122
- selector: '[etRepeat]',
123
- standalone: true,
273
+ providedIn: 'root',
124
274
  }]
125
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { repeatCount: [{
126
- type: Input,
127
- args: ['etRepeat']
128
- }] } });
129
-
130
- const toArray = (value) => {
131
- return Array.from({ length: value }, (_, i) => i);
132
- };
133
- const toArrayTrackByFn = (_, item) => item;
275
+ }], ctorParameters: function () { return []; } });
134
276
 
135
- class ToArrayPipe {
136
- constructor() {
137
- this.transform = toArray;
277
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
278
+ class ResizeObserverFactory {
279
+ create(callback) {
280
+ return typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(callback);
138
281
  }
139
282
  }
140
- ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
141
- ToArrayPipepipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.6", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" });
142
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ToArrayPipe, decorators: [{
143
- type: Pipe,
144
- args: [{ name: 'toArray', standalone: true }]
283
+ ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ResizeObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
284
+ ResizeObserverFactoryprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ResizeObserverFactory, providedIn: 'root' });
285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ResizeObserverFactory, decorators: [{
286
+ type: Injectable,
287
+ args: [{ providedIn: 'root' }]
145
288
  }] });
289
+ class ResizeObserverService {
290
+ constructor(_mutationObserverFactory) {
291
+ this._mutationObserverFactory = _mutationObserverFactory;
292
+ this._observedElements = new Map();
293
+ }
294
+ ngOnDestroy() {
295
+ this._observedElements.forEach((_, element) => this._cleanupObserver(element));
296
+ }
297
+ observe(elementOrRef) {
298
+ const element = coerceElement(elementOrRef);
299
+ return new Observable((observer) => {
300
+ const stream = this._observeElement(element);
301
+ const subscription = stream.subscribe(observer);
302
+ return () => {
303
+ subscription.unsubscribe();
304
+ this._unobserveElement(element);
305
+ };
306
+ });
307
+ }
308
+ _observeElement(element) {
309
+ if (!this._observedElements.has(element)) {
310
+ const stream = new Subject();
311
+ const observer = this._mutationObserverFactory.create((resizes) => stream.next(resizes));
312
+ if (observer) {
313
+ observer.observe(element);
314
+ }
315
+ this._observedElements.set(element, { observer, stream, count: 1 });
316
+ }
317
+ else {
318
+ this._observedElements.get(element).count++;
319
+ }
320
+ return this._observedElements.get(element).stream;
321
+ }
322
+ _unobserveElement(element) {
323
+ if (this._observedElements.has(element)) {
324
+ this._observedElements.get(element).count--;
325
+ if (!this._observedElements.get(element).count) {
326
+ this._cleanupObserver(element);
327
+ }
328
+ }
329
+ }
330
+ _cleanupObserver(element) {
331
+ if (this._observedElements.has(element)) {
332
+ const { observer, stream } = this._observedElements.get(element);
333
+ if (observer) {
334
+ observer.disconnect();
335
+ }
336
+ stream.complete();
337
+ this._observedElements.delete(element);
338
+ }
339
+ }
340
+ }
341
+ ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ResizeObserverService, deps: [{ token: ResizeObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
342
+ ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ResizeObserverService, providedIn: 'root' });
343
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ResizeObserverService, decorators: [{
344
+ type: Injectable,
345
+ args: [{ providedIn: 'root' }]
346
+ }], ctorParameters: function () { return [{ type: ResizeObserverFactory }]; } });
146
347
 
147
348
  class ViewportService {
148
- constructor(_viewportConfig, _breakpointObserver) {
149
- this._breakpointObserver = _breakpointObserver;
150
- this._isXs$ = new BehaviorSubject(false);
151
- this._isSm$ = new BehaviorSubject(false);
152
- this._isMd$ = new BehaviorSubject(false);
153
- this._isLg$ = new BehaviorSubject(false);
154
- this._isXl$ = new BehaviorSubject(false);
155
- this._is2Xl$ = new BehaviorSubject(false);
156
- this._viewportConfig = _viewportConfig || DEFAULT_VIEWPORT_CONFIG;
157
- this._observeDefaultBreakpoints();
158
- }
159
349
  get isXs$() {
160
350
  return this._isXs$.asObservable();
161
351
  }
@@ -192,6 +382,21 @@ class ViewportService {
192
382
  get is2Xl() {
193
383
  return this._is2Xl$.value;
194
384
  }
385
+ get currentViewport() {
386
+ return this.getCurrentViewport([this.isXs, this.isSm, this.isMd, this.isLg, this.isXl, this.is2Xl]);
387
+ }
388
+ constructor(_viewportConfig, _breakpointObserver) {
389
+ this._breakpointObserver = _breakpointObserver;
390
+ this._isXs$ = new BehaviorSubject(false);
391
+ this._isSm$ = new BehaviorSubject(false);
392
+ this._isMd$ = new BehaviorSubject(false);
393
+ this._isLg$ = new BehaviorSubject(false);
394
+ this._isXl$ = new BehaviorSubject(false);
395
+ this._is2Xl$ = new BehaviorSubject(false);
396
+ this.currentViewport$ = combineLatest([this.isXs$, this.isSm$, this.isMd$, this.isLg$, this.isXl$, this.is2Xl$]).pipe(map((val) => this.getCurrentViewport(val)), shareReplay());
397
+ this._viewportConfig = _viewportConfig || DEFAULT_VIEWPORT_CONFIG;
398
+ this._observeDefaultBreakpoints();
399
+ }
195
400
  observe(options) {
196
401
  const mediaQuery = this._buildMediaQuery(options);
197
402
  return this._breakpointObserver.observe(mediaQuery).pipe(map((x) => x.matches), shareReplay());
@@ -220,7 +425,7 @@ class ViewportService {
220
425
  // Due to scaling, the actual size of the viewport may be a decimal number.
221
426
  // Eg. on Windows 11 with 150% scaling, the viewport size may be 1535.33px
222
427
  // and thus not matching any of the default breakpoints.
223
- return size + 0.9999;
428
+ return size + 0.9;
224
429
  }
225
430
  _buildMediaQuery(options) {
226
431
  if (!options.min && !options.max) {
@@ -248,9 +453,30 @@ class ViewportService {
248
453
  }
249
454
  return mediaQueryParts.join(' ');
250
455
  }
456
+ getCurrentViewport([isXs, isSm, isMd, isLg, isXl, is2Xl]) {
457
+ if (isXs) {
458
+ return 'xs';
459
+ }
460
+ else if (isSm) {
461
+ return 'sm';
462
+ }
463
+ else if (isMd) {
464
+ return 'md';
465
+ }
466
+ else if (isLg) {
467
+ return 'lg';
468
+ }
469
+ else if (isXl) {
470
+ return 'xl';
471
+ }
472
+ else if (is2Xl) {
473
+ return '2xl';
474
+ }
475
+ return 'xs';
476
+ }
251
477
  }
252
- ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ViewportService, deps: [{ token: VIEWPORT_CONFIG, optional: true }, { token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
253
- ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ViewportService, providedIn: 'root' });
478
+ ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ViewportService, deps: [{ token: VIEWPORT_CONFIG, optional: true }, { token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
479
+ ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ViewportService, providedIn: 'root' });
254
480
  __decorate([
255
481
  Memo(),
256
482
  __metadata("design:type", Function),
@@ -267,7 +493,7 @@ __decorate([
267
493
  __metadata("design:paramtypes", [Object]),
268
494
  __metadata("design:returntype", void 0)
269
495
  ], ViewportService.prototype, "_buildMediaQuery", null);
270
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ViewportService, decorators: [{
496
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ViewportService, decorators: [{
271
497
  type: Injectable,
272
498
  args: [{
273
499
  providedIn: 'root',
@@ -279,48 +505,1214 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
279
505
  type: Optional
280
506
  }] }, { type: i1.BreakpointObserver }]; }, propDecorators: { _getViewportSize: [], _buildMediaQuery: [] } });
281
507
 
282
- class FocusVisibleService {
508
+ class ClickOutsideDirective {
283
509
  constructor() {
284
- this._document = inject(DOCUMENT);
285
- this._hadKeyboardEvent = false;
286
- this._document.addEventListener('keydown', this.onKeyDown.bind(this), true);
287
- this._document.addEventListener('mousedown', this.onPointerDown.bind(this), true);
288
- this._document.addEventListener('pointerdown', this.onPointerDown.bind(this), true);
289
- this._document.addEventListener('touchstart', this.onPointerDown.bind(this), true);
290
- }
291
- get isFocusVisible() {
292
- return this._hadKeyboardEvent;
510
+ this._elementRef = inject(ElementRef);
511
+ this._clickObserverService = inject(ClickObserverService);
512
+ this._subscription = null;
513
+ this.etClickOutside = new EventEmitter();
293
514
  }
294
- onKeyDown(e) {
295
- if (e.metaKey || e.altKey || e.ctrlKey) {
296
- return;
297
- }
298
- this._hadKeyboardEvent = true;
515
+ ngOnInit() {
516
+ setTimeout(() => {
517
+ this._subscription = this._clickObserverService.observe(this._elementRef.nativeElement).subscribe((event) => {
518
+ const activeElement = event.target;
519
+ const isInside = this._elementRef.nativeElement.contains(activeElement);
520
+ if (!isInside) {
521
+ this.etClickOutside.emit(event);
522
+ }
523
+ });
524
+ });
299
525
  }
300
- onPointerDown() {
301
- this._hadKeyboardEvent = false;
526
+ ngOnDestroy() {
527
+ this._subscription?.unsubscribe();
302
528
  }
303
529
  }
304
- FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: FocusVisibleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
305
- FocusVisibleServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: FocusVisibleService, providedIn: 'root' });
306
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: FocusVisibleService, decorators: [{
307
- type: Injectable,
530
+ ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickOutsideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
531
+ ClickOutsideDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: ClickOutsideDirective, isStandalone: true, selector: "[etClickOutside]", outputs: { etClickOutside: "etClickOutside" }, ngImport: i0 });
532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickOutsideDirective, decorators: [{
533
+ type: Directive,
308
534
  args: [{
309
- providedIn: 'root',
535
+ selector: '[etClickOutside]',
536
+ standalone: true,
310
537
  }]
311
- }], ctorParameters: function () { return []; } });
538
+ }], propDecorators: { etClickOutside: [{
539
+ type: Output
540
+ }] } });
541
+
542
+ const clamp = (value, min = 0, max = 100) => {
543
+ return Math.max(min, Math.min(max, value));
544
+ };
545
+
546
+ const createReactiveBindings = (...values) => {
547
+ const elementRef = inject(ElementRef);
548
+ const destroy$ = inject(DestroyService).destroy$;
549
+ const subscriptions = [];
550
+ const pushedAttributes = [];
551
+ const defaults = {};
552
+ const push = (value) => {
553
+ const { attribute, observable } = value;
554
+ const attributes = Array.isArray(attribute) ? attribute : [attribute];
555
+ pushedAttributes.push(attributes);
556
+ for (const attribute of attributes) {
557
+ if (!defaults[attribute]) {
558
+ defaults[attribute] = elementRef.nativeElement.getAttribute(attribute) || undefined;
559
+ }
560
+ }
561
+ const subscription = observable
562
+ .pipe(takeUntil(destroy$), distinctUntilChanged((a, b) => a.render === b.render && a.value === b.value))
563
+ .subscribe((value) => {
564
+ const currentAttributes = pushedAttributes.find((s) => s.some((current) => attributes.includes(current))) || [];
565
+ for (const attribute of currentAttributes) {
566
+ if (!value.render) {
567
+ elementRef.nativeElement.removeAttribute(attribute);
568
+ }
569
+ else {
570
+ elementRef.nativeElement.setAttribute(attribute, `${value.value}`);
571
+ }
572
+ }
573
+ });
574
+ subscriptions.push({ attributes, subscription });
575
+ };
576
+ const remove = (...attributes) => {
577
+ for (const attribute of attributes) {
578
+ const sub = subscriptions.find((s) => s.attributes.includes(attribute));
579
+ const attributeStack = pushedAttributes.find((a) => a.includes(attribute));
580
+ if (sub) {
581
+ sub.attributes = sub.attributes.filter((a) => a !== attribute);
582
+ attributeStack?.splice(attributeStack.indexOf(attribute), 1);
583
+ if (sub.attributes.length === 0) {
584
+ sub.subscription.unsubscribe();
585
+ subscriptions.splice(subscriptions.indexOf(sub), 1);
586
+ }
587
+ }
588
+ }
589
+ };
590
+ const reset = () => {
591
+ for (const attribute in defaults) {
592
+ if (defaults[attribute] === undefined) {
593
+ elementRef.nativeElement.removeAttribute(attribute);
594
+ }
595
+ else {
596
+ elementRef.nativeElement.setAttribute(attribute, defaults[attribute]);
597
+ }
598
+ }
599
+ };
600
+ for (const value of values) {
601
+ push(value);
602
+ }
603
+ return {
604
+ push,
605
+ remove,
606
+ reset,
607
+ };
608
+ };
609
+
610
+ const elementCanScroll = (element) => {
611
+ const { scrollHeight, clientHeight, scrollWidth, clientWidth } = element;
612
+ return scrollHeight > clientHeight || scrollWidth > clientWidth;
613
+ };
312
614
 
313
615
  const provideViewportConfig = (viewportConfig) => {
314
616
  return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
315
617
  };
316
618
 
317
- const clamp = (value, min = 0, max = 100) => {
318
- return Math.max(min, Math.min(max, value));
319
- };
619
+ const CURSOR_DRAG_SCROLLING_CLASS = 'et-cursor-drag-scroll--scrolling';
620
+ const CURSOR_DRAG_SCROLLING_PREPARED_CLASS = 'et-cursor-drag-scroll--prepared';
621
+
622
+ class CursorDragScrollDirective {
623
+ constructor() {
624
+ this._subscriptions = [];
625
+ this._destroy$ = inject(DestroyService).destroy$;
626
+ this._elementRef = inject(ElementRef);
627
+ this._contentObserverService = inject(ContentObserverService);
628
+ this._resizeObserverService = inject(ResizeObserverService);
629
+ this._bufferUntilScroll = 5;
630
+ this._mouseUp$ = new Subject();
631
+ this._isScrolling = false;
632
+ this._canScroll = false;
633
+ this._currentScrollState = {
634
+ top: 0,
635
+ left: 0,
636
+ x: 0,
637
+ y: 0,
638
+ };
639
+ this._enabled = false;
640
+ }
641
+ get enabled() {
642
+ return this._enabled;
643
+ }
644
+ set enabled(value) {
645
+ this._enabled = coerceBooleanProperty(value);
646
+ if (this._enabled) {
647
+ this._enableCursorDragScroll();
648
+ }
649
+ else {
650
+ this._disableCursorDragScroll();
651
+ }
652
+ }
653
+ ngAfterViewInit() {
654
+ if (this.enabled) {
655
+ this._enableCursorDragScroll();
656
+ }
657
+ else {
658
+ this._disableCursorDragScroll();
659
+ }
660
+ }
661
+ _enableCursorDragScroll() {
662
+ const contentResizeSub = combineLatest([
663
+ this._contentObserverService.observe(this._elementRef.nativeElement).pipe(startWith(null)),
664
+ this._resizeObserverService.observe(this._elementRef.nativeElement).pipe(startWith(null)),
665
+ ])
666
+ .pipe(debounceTime(25), tap(() => this._updateCanScrollState()), takeUntil(this._destroy$))
667
+ .subscribe();
668
+ const mousedownSub = fromEvent(this._elementRef.nativeElement, 'mousedown')
669
+ .pipe(tap((e) => this._onMouseDown(e)), takeUntil(this._destroy$))
670
+ .subscribe();
671
+ this._subscriptions.push(contentResizeSub, mousedownSub);
672
+ this._updateCanScrollState();
673
+ }
674
+ _disableCursorDragScroll() {
675
+ this._subscriptions.forEach((sub) => sub.unsubscribe());
676
+ this._subscriptions.length = 0;
677
+ this._elementRef.nativeElement.style.cursor = 'default';
678
+ }
679
+ _onMouseDown(e) {
680
+ if (!this._elementRef?.nativeElement || !this._canScroll) {
681
+ return;
682
+ }
683
+ const element = this._elementRef.nativeElement;
684
+ element.classList.add(CURSOR_DRAG_SCROLLING_PREPARED_CLASS);
685
+ this._elementRef.nativeElement.style.scrollSnapType = 'none';
686
+ this._elementRef.nativeElement.style.scrollBehavior = 'unset';
687
+ this._currentScrollState = {
688
+ left: this._elementRef.nativeElement.scrollLeft,
689
+ top: this._elementRef.nativeElement.scrollTop,
690
+ x: e.clientX,
691
+ y: e.clientY,
692
+ };
693
+ fromEvent(document, 'mousemove')
694
+ .pipe(tap((e) => this._mouseMoveHandler(e)), takeUntil(this._mouseUp$), takeUntil(this._destroy$))
695
+ .subscribe();
696
+ fromEvent(document, 'mouseup')
697
+ .pipe(tap(() => this._mouseUpHandler()), take(1), takeUntil(this._destroy$))
698
+ .subscribe();
699
+ }
700
+ _mouseMoveHandler(e) {
701
+ e.preventDefault();
702
+ if (!this._elementRef?.nativeElement) {
703
+ return;
704
+ }
705
+ const dx = e.clientX - this._currentScrollState.x;
706
+ const dy = e.clientY - this._currentScrollState.y;
707
+ if (Math.abs(dx) > this._bufferUntilScroll || Math.abs(dy) > this._bufferUntilScroll) {
708
+ const element = this._elementRef.nativeElement;
709
+ if (!this._isScrolling) {
710
+ this._isScrolling = true;
711
+ element.style.cursor = 'grabbing';
712
+ element.classList.add(CURSOR_DRAG_SCROLLING_CLASS);
713
+ element.scroll({
714
+ top: this._currentScrollState.top - dy,
715
+ left: this._currentScrollState.left - dx,
716
+ behavior: 'smooth',
717
+ });
718
+ }
719
+ else {
720
+ element.scrollTop = this._currentScrollState.top - dy;
721
+ element.scrollLeft = this._currentScrollState.left - dx;
722
+ }
723
+ }
724
+ }
725
+ _mouseUpHandler() {
726
+ this._mouseUp$.next(true);
727
+ this._isScrolling = false;
728
+ if (!this._elementRef?.nativeElement) {
729
+ return;
730
+ }
731
+ this._elementRef.nativeElement.style.scrollSnapType = '';
732
+ this._elementRef.nativeElement.style.scrollBehavior = '';
733
+ this._elementRef.nativeElement.style.cursor = 'grab';
734
+ this._elementRef.nativeElement.classList.remove(CURSOR_DRAG_SCROLLING_CLASS);
735
+ this._elementRef.nativeElement.classList.remove(CURSOR_DRAG_SCROLLING_PREPARED_CLASS);
736
+ }
737
+ _updateCanScrollState() {
738
+ this._canScroll = elementCanScroll(this._elementRef.nativeElement);
739
+ if (this._canScroll) {
740
+ this._elementRef.nativeElement.style.cursor = 'grab';
741
+ }
742
+ else {
743
+ this._elementRef.nativeElement.style.cursor = 'default';
744
+ }
745
+ }
746
+ }
747
+ CursorDragScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CursorDragScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
748
+ CursorDragScrollDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: CursorDragScrollDirective, isStandalone: true, selector: "[etCursorDragScroll]", inputs: { enabled: ["etCursorDragScroll", "enabled"] }, providers: [DestroyService], exportAs: ["etCursorDragScroll"], ngImport: i0 });
749
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CursorDragScrollDirective, decorators: [{
750
+ type: Directive,
751
+ args: [{
752
+ selector: '[etCursorDragScroll]',
753
+ exportAs: 'etCursorDragScroll',
754
+ standalone: true,
755
+ providers: [DestroyService],
756
+ }]
757
+ }], propDecorators: { enabled: [{
758
+ type: Input,
759
+ args: ['etCursorDragScroll']
760
+ }] } });
761
+
762
+ class LetContext {
763
+ constructor() {
764
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
765
+ this.$implicit = null;
766
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
767
+ this.etLet = null;
768
+ }
769
+ }
770
+
771
+ class LetDirective {
772
+ set etLet(value) {
773
+ this._context.$implicit = this._context.etLet = value;
774
+ this._updateView();
775
+ }
776
+ constructor(_viewContainer, templateRef) {
777
+ this._viewContainer = _viewContainer;
778
+ this._context = new LetContext();
779
+ this._templateRef = null;
780
+ this._viewRef = null;
781
+ this._templateRef = templateRef;
782
+ }
783
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
784
+ static ngTemplateContextGuard(dir, ctx) {
785
+ return true;
786
+ }
787
+ _updateView() {
788
+ if (!this._viewRef) {
789
+ this._viewContainer.clear();
790
+ if (this._templateRef) {
791
+ this._viewRef = this._viewContainer.createEmbeddedView(this._templateRef, this._context);
792
+ }
793
+ }
794
+ }
795
+ }
796
+ LetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: LetDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
797
+ LetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 });
798
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: LetDirective, decorators: [{
799
+ type: Directive,
800
+ args: [{
801
+ selector: '[etLet]',
802
+ standalone: true,
803
+ }]
804
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { etLet: [{
805
+ type: Input
806
+ }] } });
807
+
808
+ class ObserveContentDirective {
809
+ constructor() {
810
+ this._contentObserver = inject(ContentObserverService);
811
+ this._elementRef = inject(ElementRef);
812
+ this._ngZone = inject(NgZone);
813
+ this.event = new EventEmitter();
814
+ this._disabled = false;
815
+ this._debounce = null;
816
+ this._currentSubscription = null;
817
+ }
818
+ get disabled() {
819
+ return this._disabled;
820
+ }
821
+ set disabled(value) {
822
+ this._disabled = coerceBooleanProperty(value);
823
+ this._disabled ? this._unsubscribe() : this._subscribe();
824
+ }
825
+ get debounce() {
826
+ return this._debounce;
827
+ }
828
+ set debounce(value) {
829
+ this._debounce = coerceNumberProperty(value);
830
+ this._subscribe();
831
+ }
832
+ ngAfterContentInit() {
833
+ if (!this._currentSubscription && !this.disabled) {
834
+ this._subscribe();
835
+ }
836
+ }
837
+ ngOnDestroy() {
838
+ this._unsubscribe();
839
+ }
840
+ _subscribe() {
841
+ this._unsubscribe();
842
+ const stream = this._contentObserver.observe(this._elementRef);
843
+ this._ngZone.runOutsideAngular(() => {
844
+ this._currentSubscription = (this.debounce ? stream.pipe(debounceTime$1(this.debounce)) : stream).subscribe(this.event);
845
+ });
846
+ }
847
+ _unsubscribe() {
848
+ this._currentSubscription?.unsubscribe();
849
+ }
850
+ }
851
+ ObserveContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ObserveContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
852
+ ObserveContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: ObserveContentDirective, isStandalone: true, selector: "[etObserveContent]", inputs: { disabled: ["etObserveContentDisabled", "disabled"], debounce: ["etObserveContentDebounce", "debounce"] }, outputs: { event: "etObserveContent" }, exportAs: ["etObserveContent"], ngImport: i0 });
853
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ObserveContentDirective, decorators: [{
854
+ type: Directive,
855
+ args: [{
856
+ selector: '[etObserveContent]',
857
+ exportAs: 'etObserveContent',
858
+ standalone: true,
859
+ }]
860
+ }], propDecorators: { event: [{
861
+ type: Output,
862
+ args: ['etObserveContent']
863
+ }], disabled: [{
864
+ type: Input,
865
+ args: ['etObserveContentDisabled']
866
+ }], debounce: [{
867
+ type: Input,
868
+ args: ['etObserveContentDebounce']
869
+ }] } });
870
+
871
+ class ObserveResizeDirective {
872
+ constructor() {
873
+ this._resizeObserver = inject(ResizeObserverService);
874
+ this._elementRef = inject(ElementRef);
875
+ this._ngZone = inject(NgZone);
876
+ this.event = new EventEmitter();
877
+ this._disabled = false;
878
+ this._debounce = null;
879
+ this._currentSubscription = null;
880
+ }
881
+ get disabled() {
882
+ return this._disabled;
883
+ }
884
+ set disabled(value) {
885
+ this._disabled = coerceBooleanProperty(value);
886
+ this._disabled ? this._unsubscribe() : this._subscribe();
887
+ }
888
+ get debounce() {
889
+ return this._debounce;
890
+ }
891
+ set debounce(value) {
892
+ this._debounce = coerceNumberProperty(value);
893
+ this._subscribe();
894
+ }
895
+ ngAfterContentInit() {
896
+ if (!this._currentSubscription && !this.disabled) {
897
+ this._subscribe();
898
+ }
899
+ }
900
+ ngOnDestroy() {
901
+ this._unsubscribe();
902
+ }
903
+ _subscribe() {
904
+ this._unsubscribe();
905
+ const stream = this._resizeObserver.observe(this._elementRef);
906
+ this._ngZone.runOutsideAngular(() => {
907
+ this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);
908
+ });
909
+ }
910
+ _unsubscribe() {
911
+ this._currentSubscription?.unsubscribe();
912
+ }
913
+ }
914
+ ObserveResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ObserveResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
915
+ ObserveResizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: ObserveResizeDirective, isStandalone: true, selector: "[etObserveResize]", inputs: { disabled: ["etObserveResizeDisabled", "disabled"], debounce: ["etObserveResizeDebounce", "debounce"] }, outputs: { event: "etObserveResize" }, exportAs: ["etObserveResize"], ngImport: i0 });
916
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ObserveResizeDirective, decorators: [{
917
+ type: Directive,
918
+ args: [{
919
+ selector: '[etObserveResize]',
920
+ exportAs: 'etObserveResize',
921
+ standalone: true,
922
+ }]
923
+ }], propDecorators: { event: [{
924
+ type: Output,
925
+ args: ['etObserveResize']
926
+ }], disabled: [{
927
+ type: Input,
928
+ args: ['etObserveResizeDisabled']
929
+ }], debounce: [{
930
+ type: Input,
931
+ args: ['etObserveResizeDebounce']
932
+ }] } });
933
+
934
+ const SCROLL_OBSERVER_FIRST_ELEMENT_CLASS = 'et-scroll-observer-first-element';
935
+ class ScrollObserverFirstElementDirective {
936
+ constructor() {
937
+ this._isFirstElement = false;
938
+ }
939
+ get isFirstElement() {
940
+ return this._isFirstElement;
941
+ }
942
+ set isFirstElement(value) {
943
+ this._isFirstElement = coerceBooleanProperty(value);
944
+ }
945
+ }
946
+ ScrollObserverFirstElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ScrollObserverFirstElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
947
+ ScrollObserverFirstElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: ScrollObserverFirstElementDirective, isStandalone: true, selector: "[etScrollObserverFirstElement]", inputs: { isFirstElement: ["etScrollObserverFirstElement", "isFirstElement"] }, host: { properties: { "class.et-scroll-observer-first-element": "this.isFirstElement" } }, ngImport: i0 });
948
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ScrollObserverFirstElementDirective, decorators: [{
949
+ type: Directive,
950
+ args: [{
951
+ selector: '[etScrollObserverFirstElement]',
952
+ standalone: true,
953
+ }]
954
+ }], propDecorators: { isFirstElement: [{
955
+ type: Input,
956
+ args: ['etScrollObserverFirstElement']
957
+ }, {
958
+ type: HostBinding,
959
+ args: [`class.${SCROLL_OBSERVER_FIRST_ELEMENT_CLASS}`]
960
+ }] } });
961
+
962
+ const SCROLL_OBSERVER_IGNORE_TARGET_CLASS = 'et-scroll-observer-ignore-target';
963
+ class ScrollObserverIgnoreTargetDirective {
964
+ }
965
+ ScrollObserverIgnoreTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
966
+ ScrollObserverIgnoreTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: ScrollObserverIgnoreTargetDirective, isStandalone: true, selector: "[etScrollObserverIgnoreTarget]", host: { classAttribute: "et-scroll-observer-ignore-target" }, ngImport: i0 });
967
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, decorators: [{
968
+ type: Directive,
969
+ args: [{
970
+ selector: '[etScrollObserverIgnoreTarget]',
971
+ standalone: true,
972
+ host: {
973
+ class: SCROLL_OBSERVER_IGNORE_TARGET_CLASS,
974
+ },
975
+ }]
976
+ }] });
977
+
978
+ const SCROLL_OBSERVER_LAST_ELEMENT_CLASS = 'et-scroll-observer-last-element';
979
+ class ScrollObserverLastElementDirective {
980
+ constructor() {
981
+ this._isLastElement = false;
982
+ }
983
+ get isLastElement() {
984
+ return this._isLastElement;
985
+ }
986
+ set isLastElement(value) {
987
+ this._isLastElement = coerceBooleanProperty(value);
988
+ }
989
+ }
990
+ ScrollObserverLastElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ScrollObserverLastElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
991
+ ScrollObserverLastElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", 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 });
992
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ScrollObserverLastElementDirective, decorators: [{
993
+ type: Directive,
994
+ args: [{
995
+ selector: '[etScrollObserverLastElement]',
996
+ standalone: true,
997
+ host: {
998
+ class: SCROLL_OBSERVER_LAST_ELEMENT_CLASS,
999
+ },
1000
+ }]
1001
+ }], propDecorators: { isLastElement: [{
1002
+ type: Input,
1003
+ args: ['etScrollObserverLastElement']
1004
+ }, {
1005
+ type: HostBinding,
1006
+ args: [`class.${SCROLL_OBSERVER_LAST_ELEMENT_CLASS}`]
1007
+ }] } });
1008
+
1009
+ const OBSERVE_SCROLL_STATE = new InjectionToken('OBSERVE_SCROLL_STATE');
1010
+
1011
+ class ObserveScrollStateDirective {
1012
+ constructor() {
1013
+ this._destroy$ = inject(DestroyService).destroy$;
1014
+ this._elementRef = inject(ElementRef);
1015
+ this._contentObserverService = inject(ContentObserverService);
1016
+ this._resizeObserverService = inject(ResizeObserverService);
1017
+ this._observedChildren = {
1018
+ first: this._firstCurrentChild,
1019
+ last: this._lastCurrentChild,
1020
+ };
1021
+ this._rootMargin = 0;
1022
+ this._threshold = 1;
1023
+ this._intersectionObserver = null;
1024
+ this.etObserveScrollState = new EventEmitter();
1025
+ }
1026
+ get _firstCurrentChild() {
1027
+ const explicitFirstElement = this._elementRef.nativeElement.querySelector(`.${SCROLL_OBSERVER_FIRST_ELEMENT_CLASS}`);
1028
+ if (explicitFirstElement) {
1029
+ return explicitFirstElement;
1030
+ }
1031
+ const element = this._elementRef.nativeElement.children[0];
1032
+ return this._getNonIgnoredChild(element, 'next');
1033
+ }
1034
+ get _lastCurrentChild() {
1035
+ const explicitLastElement = this._elementRef.nativeElement.querySelector(`.${SCROLL_OBSERVER_LAST_ELEMENT_CLASS}`);
1036
+ if (explicitLastElement) {
1037
+ return explicitLastElement;
1038
+ }
1039
+ const element = this._elementRef.nativeElement.children[this._elementRef.nativeElement.children.length - 1];
1040
+ return this._getNonIgnoredChild(element, 'previous');
1041
+ }
1042
+ get observerRootMargin() {
1043
+ return this._rootMargin;
1044
+ }
1045
+ set observerRootMargin(value) {
1046
+ this._rootMargin = coerceNumberProperty(value);
1047
+ }
1048
+ get observerThreshold() {
1049
+ return this._threshold;
1050
+ }
1051
+ set observerThreshold(value) {
1052
+ this._threshold = coerceNumberProperty(value);
1053
+ }
1054
+ ngOnInit() {
1055
+ this._contentObserverService
1056
+ .observe(this._elementRef.nativeElement)
1057
+ .pipe(tap(() => this._checkChildren()), takeUntil(this._destroy$))
1058
+ .subscribe();
1059
+ this._resizeObserverService
1060
+ .observe(this._elementRef.nativeElement)
1061
+ .pipe(debounceTime(25), tap(() => {
1062
+ const canScroll = elementCanScroll(this._elementRef.nativeElement);
1063
+ if ((!this._intersectionObserver && canScroll) || (this._intersectionObserver && !canScroll)) {
1064
+ this._checkChildren();
1065
+ }
1066
+ }), takeUntil(this._destroy$))
1067
+ .subscribe();
1068
+ this._checkChildren();
1069
+ }
1070
+ ngOnDestroy() {
1071
+ this._clearIntersectionObserver();
1072
+ }
1073
+ _checkChildren() {
1074
+ this._clearIntersectionObserver();
1075
+ if (this._firstCurrentChild === this._lastCurrentChild ||
1076
+ !this._firstCurrentChild ||
1077
+ !this._lastCurrentChild ||
1078
+ !elementCanScroll(this._elementRef.nativeElement)) {
1079
+ this._unobserveChild('first');
1080
+ this._unobserveChild('last');
1081
+ this.etObserveScrollState.emit({
1082
+ isAtStart: true,
1083
+ isAtEnd: true,
1084
+ canScroll: false,
1085
+ });
1086
+ }
1087
+ else {
1088
+ this._intersectionObserver = this._initiateIntersectionObserver();
1089
+ this._observeChild('first', this._firstCurrentChild);
1090
+ this._observeChild('last', this._lastCurrentChild);
1091
+ }
1092
+ }
1093
+ _initiateIntersectionObserver() {
1094
+ const observer = new IntersectionObserver((entries) => {
1095
+ const { first, last } = this._observedChildren;
1096
+ const isAtStart = entries.find((entry) => entry.target === first)?.isIntersecting ?? false;
1097
+ const isAtEnd = entries.find((entry) => entry.target === last)?.isIntersecting ?? false;
1098
+ this.etObserveScrollState.emit({
1099
+ isAtStart,
1100
+ isAtEnd,
1101
+ canScroll: !isAtStart || !isAtEnd,
1102
+ });
1103
+ }, {
1104
+ root: this._elementRef.nativeElement,
1105
+ rootMargin: `${this._rootMargin}px`,
1106
+ threshold: this._threshold,
1107
+ });
1108
+ return observer;
1109
+ }
1110
+ _observeChild(child, element) {
1111
+ this._intersectionObserver?.observe(element);
1112
+ this._observedChildren[child] = element;
1113
+ element.classList.add(`et-scroll-observer-observing-${child}-element`);
1114
+ }
1115
+ _unobserveChild(child) {
1116
+ const observedChild = this._observedChildren[child];
1117
+ if (!observedChild) {
1118
+ return;
1119
+ }
1120
+ observedChild.classList.remove('et-scroll-observer-observing-first-element', 'et-scroll-observer-observing-last-element');
1121
+ this._intersectionObserver?.unobserve(observedChild);
1122
+ this._observedChildren[child] = null;
1123
+ }
1124
+ _clearIntersectionObserver() {
1125
+ this._intersectionObserver?.disconnect();
1126
+ this._intersectionObserver = null;
1127
+ }
1128
+ _getNonIgnoredChild(element, direction) {
1129
+ if (!element) {
1130
+ return null;
1131
+ }
1132
+ if (element?.classList.contains(SCROLL_OBSERVER_IGNORE_TARGET_CLASS)) {
1133
+ const nextElement = element[`${direction}ElementSibling`];
1134
+ if (!nextElement) {
1135
+ return null;
1136
+ }
1137
+ return this._getNonIgnoredChild(nextElement, direction);
1138
+ }
1139
+ return element;
1140
+ }
1141
+ }
1142
+ ObserveScrollStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ObserveScrollStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1143
+ ObserveScrollStateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: ObserveScrollStateDirective, isStandalone: true, selector: "[etObserveScrollState]", inputs: { observerRootMargin: "observerRootMargin", observerThreshold: "observerThreshold" }, outputs: { etObserveScrollState: "etObserveScrollState" }, providers: [
1144
+ {
1145
+ provide: OBSERVE_SCROLL_STATE,
1146
+ useExisting: ObserveScrollStateDirective,
1147
+ },
1148
+ DestroyService,
1149
+ ], exportAs: ["etObserveScrollState"], ngImport: i0 });
1150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ObserveScrollStateDirective, decorators: [{
1151
+ type: Directive,
1152
+ args: [{
1153
+ selector: '[etObserveScrollState]',
1154
+ exportAs: 'etObserveScrollState',
1155
+ standalone: true,
1156
+ providers: [
1157
+ {
1158
+ provide: OBSERVE_SCROLL_STATE,
1159
+ useExisting: ObserveScrollStateDirective,
1160
+ },
1161
+ DestroyService,
1162
+ ],
1163
+ }]
1164
+ }], propDecorators: { observerRootMargin: [{
1165
+ type: Input
1166
+ }], observerThreshold: [{
1167
+ type: Input
1168
+ }], etObserveScrollState: [{
1169
+ type: Output
1170
+ }] } });
1171
+
1172
+ class RepeatDirective {
1173
+ get repeatCount() {
1174
+ return this._repeatCount;
1175
+ }
1176
+ set repeatCount(value) {
1177
+ this._repeatCount = coerceNumberProperty(value);
1178
+ this._render();
1179
+ }
1180
+ constructor(_mainTemplateRef, _viewContainerRef) {
1181
+ this._mainTemplateRef = _mainTemplateRef;
1182
+ this._viewContainerRef = _viewContainerRef;
1183
+ this._repeatCount = 2;
1184
+ }
1185
+ _render() {
1186
+ this._viewContainerRef.clear();
1187
+ for (let i = 0; i < this.repeatCount; i++) {
1188
+ this._viewContainerRef.createEmbeddedView(this._mainTemplateRef);
1189
+ }
1190
+ }
1191
+ }
1192
+ RepeatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: RepeatDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
1193
+ RepeatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 });
1194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: RepeatDirective, decorators: [{
1195
+ type: Directive,
1196
+ args: [{
1197
+ selector: '[etRepeat]',
1198
+ standalone: true,
1199
+ }]
1200
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { repeatCount: [{
1201
+ type: Input,
1202
+ args: ['etRepeat']
1203
+ }] } });
1204
+
1205
+ const SEO_DIRECTIVE_TOKEN = new InjectionToken('SEO_DIRECTIVE_TOKEN');
1206
+
1207
+ const mergeSeoConfig = (config, parentConfig) => {
1208
+ return {
1209
+ ...parentConfig,
1210
+ ...config,
1211
+ };
1212
+ };
1213
+
1214
+ class SeoDirective {
1215
+ constructor() {
1216
+ this._metaService = inject(Meta);
1217
+ this._titleService = inject(Title);
1218
+ this._onDeactivate$ = new Subject();
1219
+ this._isDeactivated = false;
1220
+ this.parent = inject(SEO_DIRECTIVE_TOKEN, { optional: true, skipSelf: true });
1221
+ this._config = {};
1222
+ }
1223
+ get config() {
1224
+ return this._config;
1225
+ }
1226
+ ngOnInit() {
1227
+ this.parent?._deactivate();
1228
+ }
1229
+ ngOnDestroy() {
1230
+ this._deactivate();
1231
+ this._cleanUp();
1232
+ this.parent?._activate();
1233
+ }
1234
+ // TODO(TRB): This should get split up into multiple methods to make it more readable
1235
+ // - updateTitle
1236
+ // - updateMeta
1237
+ // - updateLink
1238
+ updateConfig(config) {
1239
+ this._config = mergeSeoConfig(config, this.parent?.config || {});
1240
+ if (this._isDeactivated) {
1241
+ return;
1242
+ }
1243
+ this._deactivate();
1244
+ this._activate();
1245
+ }
1246
+ _activate() {
1247
+ this._onDeactivate$.next(false);
1248
+ this._isDeactivated = false;
1249
+ for (const [key, value] of Object.entries(this._config)) {
1250
+ if (value instanceof Observable) {
1251
+ value.pipe(takeUntil(this._onDeactivate$)).subscribe((value) => this._update(key, value));
1252
+ }
1253
+ else if (Array.isArray(value)) {
1254
+ value.forEach((value) => {
1255
+ if (value instanceof Observable) {
1256
+ value.pipe(takeUntil(this._onDeactivate$)).subscribe((value) => this._update(key, value));
1257
+ }
1258
+ else {
1259
+ this._update(key, value);
1260
+ }
1261
+ });
1262
+ }
1263
+ else if (typeof value === 'object' && value !== null) {
1264
+ for (const [subKey, subValue] of Object.entries(value)) {
1265
+ if (subValue instanceof Observable) {
1266
+ subValue.pipe(takeUntil(this._onDeactivate$)).subscribe((value) => this._update(`${key}:${subKey}`, value));
1267
+ }
1268
+ else {
1269
+ this._update(`${key}:${subKey}`, subValue);
1270
+ }
1271
+ }
1272
+ }
1273
+ else {
1274
+ this._update(key, value);
1275
+ }
1276
+ }
1277
+ }
1278
+ _deactivate() {
1279
+ this._onDeactivate$.next(true);
1280
+ this._isDeactivated = true;
1281
+ }
1282
+ _update(key, value) {
1283
+ switch (key) {
1284
+ case 'title':
1285
+ if (value && typeof value === 'string') {
1286
+ this._titleService.setTitle(value);
1287
+ }
1288
+ break;
1289
+ case 'canonical':
1290
+ {
1291
+ const link = document.querySelector(`link[rel="${key}"]`);
1292
+ if (link) {
1293
+ link.setAttribute('href', value);
1294
+ }
1295
+ else {
1296
+ const newLink = document.createElement('link');
1297
+ newLink.setAttribute('rel', key);
1298
+ newLink.setAttribute('href', value);
1299
+ document.head.appendChild(newLink);
1300
+ }
1301
+ }
1302
+ break;
1303
+ case 'alternate':
1304
+ {
1305
+ const link = document.querySelector(`link[rel="${key}"][hreflang="${value.hreflang}"]`);
1306
+ if (link) {
1307
+ link.setAttribute('href', value.href);
1308
+ }
1309
+ else {
1310
+ const newLink = document.createElement('link');
1311
+ newLink.setAttribute('rel', key);
1312
+ newLink.setAttribute('hreflang', value.hreflang);
1313
+ newLink.setAttribute('href', value.href);
1314
+ document.head.appendChild(newLink);
1315
+ }
1316
+ }
1317
+ break;
1318
+ default:
1319
+ if (value !== undefined && value !== null) {
1320
+ const val = Array.isArray(value) ? value.join(', ') : value;
1321
+ this._metaService.updateTag({ name: key, content: val });
1322
+ }
1323
+ else {
1324
+ this._metaService.removeTag(`name="${key}"`);
1325
+ }
1326
+ break;
1327
+ }
1328
+ }
1329
+ _cleanUp() {
1330
+ for (const key in this._config) {
1331
+ if (key === 'alternate') {
1332
+ const links = document.querySelectorAll(`link[rel="${key}"]`);
1333
+ links.forEach((link) => {
1334
+ link.remove();
1335
+ });
1336
+ continue;
1337
+ }
1338
+ if (key === 'canonical') {
1339
+ const link = document.querySelector(`link[rel="${key}"]`);
1340
+ if (link) {
1341
+ link.remove();
1342
+ }
1343
+ continue;
1344
+ }
1345
+ if (typeof this._config[key] === 'object' &&
1346
+ this._config[key] !== null &&
1347
+ !(this._config[key] instanceof Observable)) {
1348
+ for (const subKey in this._config[key]) {
1349
+ const parentValue = this.parent?.config?.[key]?.[subKey];
1350
+ if (parentValue === undefined) {
1351
+ this._update(`${key}:${subKey}`, undefined);
1352
+ }
1353
+ }
1354
+ }
1355
+ else {
1356
+ const parentValue = this.parent?.config?.[key];
1357
+ if (parentValue === undefined) {
1358
+ this._update(key, null);
1359
+ }
1360
+ }
1361
+ }
1362
+ }
1363
+ }
1364
+ SeoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: SeoDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1365
+ SeoDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: SeoDirective, isStandalone: true, providers: [{ provide: SEO_DIRECTIVE_TOKEN, useExisting: SeoDirective }], ngImport: i0 });
1366
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: SeoDirective, decorators: [{
1367
+ type: Directive,
1368
+ args: [{
1369
+ standalone: true,
1370
+ providers: [{ provide: SEO_DIRECTIVE_TOKEN, useExisting: SeoDirective }],
1371
+ }]
1372
+ }] });
1373
+
1374
+ // TODO(TRB): Add correct type once provided by API
1375
+ const normalizeGameResultType = (type) => {
1376
+ if (!type) {
1377
+ return null;
1378
+ }
1379
+ switch (type) {
1380
+ case 'extra_time':
1381
+ return {
1382
+ i18n: 'game-result-type.extra-time',
1383
+ shortCode: 'AET',
1384
+ text: 'After Extra Time',
1385
+ };
1386
+ case 'penalty':
1387
+ return {
1388
+ i18n: 'game-result-type.penalty',
1389
+ shortCode: 'PSO',
1390
+ text: 'Penalty shootout',
1391
+ };
1392
+ case 'golden_goal':
1393
+ return {
1394
+ i18n: 'game-result-type.golden-goal',
1395
+ shortCode: 'GG',
1396
+ text: 'Golden Goal',
1397
+ };
1398
+ case 'default':
1399
+ default:
1400
+ return {
1401
+ i18n: 'game-result-type.full-time',
1402
+ shortCode: 'FT',
1403
+ text: 'Full Time',
1404
+ };
1405
+ }
1406
+ };
1407
+
1408
+ class NormalizeGameResultTypePipe {
1409
+ constructor() {
1410
+ this.transform = normalizeGameResultType;
1411
+ }
1412
+ }
1413
+ NormalizeGameResultTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeGameResultTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1414
+ NormalizeGameResultTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: NormalizeGameResultTypePipe, isStandalone: true, name: "etNormalizeGameResultType" });
1415
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeGameResultTypePipe, decorators: [{
1416
+ type: Pipe,
1417
+ args: [{ name: 'etNormalizeGameResultType', standalone: true }]
1418
+ }] });
1419
+
1420
+ const normalizeMatchState = (match) => {
1421
+ if (match?.isCompletedByReferee) {
1422
+ return "autoWin" /* MatchStateType.AUTO_WIN */;
1423
+ }
1424
+ else if (match?.status === 'preparing') {
1425
+ return "preMatch" /* MatchStateType.PRE_MATCH */;
1426
+ }
1427
+ else if (match?.status === 'started') {
1428
+ return "live" /* MatchStateType.LIVE */;
1429
+ }
1430
+ else if (match?.status === 'published' || match?.status === 'finished') {
1431
+ return "postMatch" /* MatchStateType.POST_MATCH */;
1432
+ }
1433
+ else if (match?.round.state !== 'preparing') {
1434
+ return "preparingRound" /* MatchStateType.PREPARING_ROUND */;
1435
+ }
1436
+ return null;
1437
+ };
1438
+
1439
+ class NormalizeMatchStatePipe {
1440
+ constructor() {
1441
+ this.transform = normalizeMatchState;
1442
+ }
1443
+ }
1444
+ NormalizeMatchStatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchStatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1445
+ NormalizeMatchStatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchStatePipe, isStandalone: true, name: "etNormalizeMatchState" });
1446
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchStatePipe, decorators: [{
1447
+ type: Pipe,
1448
+ args: [{ name: 'etNormalizeMatchState', standalone: true }]
1449
+ }] });
1450
+
1451
+ const normalizeMatchParticipants = (match) => {
1452
+ const matchState = normalizeMatchState(match);
1453
+ if (!match || !matchState) {
1454
+ return null;
1455
+ }
1456
+ return {
1457
+ home: normalizeMatchParticipant(match, 'home'),
1458
+ away: normalizeMatchParticipant(match, 'away'),
1459
+ };
1460
+ };
1461
+ const normalizeMatchParticipant = (match, side) => {
1462
+ const matchState = normalizeMatchState(match);
1463
+ if (!match || !matchState) {
1464
+ return null;
1465
+ }
1466
+ const participant = match[side];
1467
+ const participantType = match.home?.type ?? match.away?.type ?? 'unknown';
1468
+ if (!participant) {
1469
+ if (matchState === "postMatch" /* MatchStateType.POST_MATCH */ || matchState === "autoWin" /* MatchStateType.AUTO_WIN */) {
1470
+ return {
1471
+ participantType,
1472
+ type: 'none',
1473
+ i18n: 'match-participant.none',
1474
+ text: 'No opponent',
1475
+ data: participant,
1476
+ };
1477
+ }
1478
+ else {
1479
+ return {
1480
+ participantType,
1481
+ type: 'tbd',
1482
+ i18n: 'match-participant.tbd',
1483
+ text: 'TBD',
1484
+ data: participant,
1485
+ };
1486
+ }
1487
+ }
1488
+ else {
1489
+ return {
1490
+ participantType,
1491
+ type: 'participant',
1492
+ data: participant,
1493
+ };
1494
+ }
1495
+ };
1496
+
1497
+ class NormalizeMatchParticipantsPipe {
1498
+ constructor() {
1499
+ this.transform = normalizeMatchParticipants;
1500
+ }
1501
+ }
1502
+ NormalizeMatchParticipantsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchParticipantsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1503
+ NormalizeMatchParticipantsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchParticipantsPipe, isStandalone: true, name: "etNormalizeMatchParticipants" });
1504
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchParticipantsPipe, decorators: [{
1505
+ type: Pipe,
1506
+ args: [{ name: 'etNormalizeMatchParticipants', standalone: true }]
1507
+ }] });
1508
+
1509
+ const EMPTY_SCORE = {
1510
+ home: { score: 'match-score.placeholder', isWinner: false },
1511
+ away: { score: 'match-score.placeholder', isWinner: false },
1512
+ isNumeric: false,
1513
+ subLine: null,
1514
+ };
1515
+ const normalizeMatchScore = (match) => {
1516
+ if (!match) {
1517
+ return null;
1518
+ }
1519
+ const matchState = normalizeMatchState(match);
1520
+ const subLine = getMatchScoreSubLine(match);
1521
+ if (!match.homeScore && !match.awayScore) {
1522
+ return { ...EMPTY_SCORE, subLine, isNumeric: false };
1523
+ }
1524
+ if (isKnockoutMatch(match)) {
1525
+ if (matchState === "preMatch" /* MatchStateType.PRE_MATCH */ || matchState === "live" /* MatchStateType.LIVE */) {
1526
+ return { ...EMPTY_SCORE, subLine, isNumeric: false };
1527
+ }
1528
+ return {
1529
+ home: {
1530
+ score: getKnockoutMatchScore(match.homeScore),
1531
+ isWinner: match.homeScore?.status === 'won',
1532
+ },
1533
+ away: {
1534
+ score: getKnockoutMatchScore(match.awayScore),
1535
+ isWinner: match.awayScore?.status === 'won',
1536
+ },
1537
+ subLine,
1538
+ isNumeric: false,
1539
+ };
1540
+ }
1541
+ else if (isGroupMatch(match)) {
1542
+ if (match.games.length === 1) {
1543
+ // Return the score if only one game has been played
1544
+ return {
1545
+ ...getGroupMatchScore(match),
1546
+ subLine,
1547
+ isNumeric: true,
1548
+ };
1549
+ }
1550
+ else {
1551
+ return {
1552
+ ...getGroupMatchPoints(match),
1553
+ subLine,
1554
+ isNumeric: true,
1555
+ };
1556
+ }
1557
+ }
1558
+ else {
1559
+ return {
1560
+ ...getGroupMatchScore(match),
1561
+ subLine,
1562
+ isNumeric: true,
1563
+ };
1564
+ }
1565
+ };
1566
+ const isKnockoutMatch = (match) => {
1567
+ if (!match) {
1568
+ return false;
1569
+ }
1570
+ return (match.matchType === 'single_elimination' ||
1571
+ match.matchType === 'double_elimination' ||
1572
+ match.matchType === 'fifa_swiss');
1573
+ };
1574
+ const isGroupMatch = (match) => {
1575
+ if (!match) {
1576
+ return false;
1577
+ }
1578
+ return match.matchType === 'groups' || match.matchType === 'league';
1579
+ };
1580
+ const getKnockoutMatchScore = (score) => {
1581
+ if (score?.status === 'won') {
1582
+ return 'match-score.knockout.won';
1583
+ }
1584
+ else if (score?.status === 'lost') {
1585
+ return 'match-score.knockout.lost';
1586
+ }
1587
+ else if (score?.status === 'tie') {
1588
+ return 'match-score.knockout.tie';
1589
+ }
1590
+ return null;
1591
+ };
1592
+ const getMatchScoreSubLine = (match) => {
1593
+ if (isKnockoutMatch(match)) {
1594
+ return null;
1595
+ }
1596
+ else if (isGroupMatch(match)) {
1597
+ return 'match-score.groups.sub-line';
1598
+ }
1599
+ else {
1600
+ return null;
1601
+ }
1602
+ };
1603
+ const getGroupMatchScore = (match) => {
1604
+ if (!match) {
1605
+ return null;
1606
+ }
1607
+ return {
1608
+ home: {
1609
+ score: match.homeScore?.ownPoints || 0,
1610
+ isWinner: match.homeScore?.status === 'won',
1611
+ },
1612
+ away: {
1613
+ score: match.awayScore?.ownPoints || 0,
1614
+ isWinner: match.awayScore?.status === 'won',
1615
+ },
1616
+ };
1617
+ };
1618
+ const getGroupMatchPoints = (match) => {
1619
+ if (!match) {
1620
+ return null;
1621
+ }
1622
+ return {
1623
+ home: {
1624
+ score: match.homeScore?.score || 0,
1625
+ isWinner: match.homeScore?.status === 'won',
1626
+ },
1627
+ away: {
1628
+ score: match.awayScore?.score || 0,
1629
+ isWinner: match.awayScore?.status === 'won',
1630
+ },
1631
+ };
1632
+ };
1633
+
1634
+ class NormalizeMatchScorePipe {
1635
+ constructor() {
1636
+ this.transform = normalizeMatchScore;
1637
+ }
1638
+ }
1639
+ NormalizeMatchScorePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchScorePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1640
+ NormalizeMatchScorePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchScorePipe, isStandalone: true, name: "etNormalizeMatchScore" });
1641
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchScorePipe, decorators: [{
1642
+ type: Pipe,
1643
+ args: [{ name: 'etNormalizeMatchScore', standalone: true }]
1644
+ }] });
1645
+
1646
+ const normalizeMatchType = (matchType) => {
1647
+ if (!matchType) {
1648
+ return null;
1649
+ }
1650
+ switch (matchType) {
1651
+ case 'double_elimination':
1652
+ return {
1653
+ i18n: 'match-type.double-elimination',
1654
+ text: 'Double Elimination',
1655
+ };
1656
+ case 'single_elimination':
1657
+ return {
1658
+ i18n: 'match-type.single-elimination',
1659
+ text: 'Single Elimination',
1660
+ };
1661
+ case 'fifa_swiss':
1662
+ return {
1663
+ i18n: 'match-type.fifa-swiss',
1664
+ text: 'FIFA Swiss',
1665
+ };
1666
+ case 'groups':
1667
+ return {
1668
+ i18n: 'match-type.groups',
1669
+ text: 'Groups',
1670
+ };
1671
+ case 'league':
1672
+ return {
1673
+ i18n: 'match-type.league',
1674
+ text: 'League',
1675
+ };
1676
+ case 'pools':
1677
+ return {
1678
+ i18n: 'match-type.pools',
1679
+ text: 'Pools',
1680
+ };
1681
+ }
1682
+ };
1683
+
1684
+ class NormalizeMatchTypePipe {
1685
+ constructor() {
1686
+ this.transform = normalizeMatchType;
1687
+ }
1688
+ }
1689
+ NormalizeMatchTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1690
+ NormalizeMatchTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchTypePipe, isStandalone: true, name: "etNormalizeMatchType" });
1691
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchTypePipe, decorators: [{
1692
+ type: Pipe,
1693
+ args: [{ name: 'etNormalizeMatchType', standalone: true }]
1694
+ }] });
1695
+
1696
+ const toArray = (value) => {
1697
+ return Array.from({ length: value }, (_, i) => i);
1698
+ };
1699
+ const toArrayTrackByFn = (_, item) => item;
1700
+
1701
+ class ToArrayPipe {
1702
+ constructor() {
1703
+ this.transform = toArray;
1704
+ }
1705
+ }
1706
+ ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1707
+ ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" });
1708
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ToArrayPipe, decorators: [{
1709
+ type: Pipe,
1710
+ args: [{ name: 'toArray', standalone: true }]
1711
+ }] });
320
1712
 
321
1713
  /**
322
1714
  * Generated bundle index. Do not edit.
323
1715
  */
324
1716
 
325
- export { DEFAULT_VIEWPORT_CONFIG, FocusVisibleService, LetContext, LetDirective, Memo, RepeatDirective, ToArrayPipe, VIEWPORT_CONFIG, ViewportService, clamp, provideViewportConfig, toArray, toArrayTrackByFn };
1717
+ 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, SCROLL_OBSERVER_FIRST_ELEMENT_CLASS, SCROLL_OBSERVER_IGNORE_TARGET_CLASS, SCROLL_OBSERVER_LAST_ELEMENT_CLASS, SEO_DIRECTIVE_TOKEN, ScrollObserverFirstElementDirective, ScrollObserverIgnoreTargetDirective, ScrollObserverLastElementDirective, SeoDirective, StructuredDataComponent, ToArrayPipe, VIEWPORT_CONFIG, ViewportService, clamp, createReactiveBindings, elementCanScroll, getGroupMatchPoints, getGroupMatchScore, getKnockoutMatchScore, getMatchScoreSubLine, isGroupMatch, isKnockoutMatch, mergeSeoConfig, normalizeGameResultType, normalizeMatchParticipant, normalizeMatchParticipants, normalizeMatchScore, normalizeMatchState, normalizeMatchType, provideViewportConfig, toArray, toArrayTrackByFn };
326
1718
  //# sourceMappingURL=ethlete-core.mjs.map