@dereekb/rxjs 13.11.14 → 13.11.15

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 (53) hide show
  1. package/index.cjs.js +478 -442
  2. package/index.esm.js +478 -442
  3. package/package.json +2 -2
  4. package/src/lib/asset/asset.builder.d.ts +14 -14
  5. package/src/lib/asset/asset.loader.d.ts +7 -7
  6. package/src/lib/asset/asset.loader.delegated.d.ts +3 -3
  7. package/src/lib/asset/asset.loader.fetch.d.ts +3 -3
  8. package/src/lib/asset/asset.loader.memory.d.ts +3 -3
  9. package/src/lib/filter/filter.map.d.ts +12 -12
  10. package/src/lib/filter/filter.preset.d.ts +5 -4
  11. package/src/lib/filter/filter.source.d.ts +4 -4
  12. package/src/lib/iterator/iteration.accumulator.d.ts +3 -4
  13. package/src/lib/iterator/iteration.accumulator.rxjs.d.ts +8 -8
  14. package/src/lib/iterator/iteration.mapped.d.ts +4 -4
  15. package/src/lib/iterator/iteration.mapped.page.d.ts +3 -3
  16. package/src/lib/iterator/iteration.next.d.ts +11 -13
  17. package/src/lib/iterator/iterator.page.d.ts +4 -4
  18. package/src/lib/loading/loading.context.rxjs.d.ts +2 -2
  19. package/src/lib/loading/loading.context.simple.d.ts +4 -4
  20. package/src/lib/loading/loading.context.state.d.ts +6 -6
  21. package/src/lib/loading/loading.context.state.list.d.ts +3 -3
  22. package/src/lib/loading/loading.state.d.ts +68 -68
  23. package/src/lib/loading/loading.state.list.d.ts +12 -12
  24. package/src/lib/loading/loading.state.rxjs.d.ts +18 -18
  25. package/src/lib/lock.d.ts +25 -25
  26. package/src/lib/object.d.ts +1 -1
  27. package/src/lib/rxjs/array.d.ts +7 -7
  28. package/src/lib/rxjs/boolean.d.ts +6 -6
  29. package/src/lib/rxjs/decision.d.ts +6 -6
  30. package/src/lib/rxjs/delta.d.ts +7 -7
  31. package/src/lib/rxjs/expires.d.ts +13 -13
  32. package/src/lib/rxjs/factory.d.ts +7 -7
  33. package/src/lib/rxjs/getter.d.ts +4 -4
  34. package/src/lib/rxjs/key.d.ts +4 -4
  35. package/src/lib/rxjs/lifecycle.d.ts +5 -5
  36. package/src/lib/rxjs/loading.d.ts +2 -2
  37. package/src/lib/rxjs/map.d.ts +3 -3
  38. package/src/lib/rxjs/misc.d.ts +6 -5
  39. package/src/lib/rxjs/model.d.ts +2 -2
  40. package/src/lib/rxjs/number.d.ts +4 -4
  41. package/src/lib/rxjs/rxjs.async.d.ts +5 -5
  42. package/src/lib/rxjs/rxjs.d.ts +12 -12
  43. package/src/lib/rxjs/rxjs.error.d.ts +3 -3
  44. package/src/lib/rxjs/rxjs.map.d.ts +11 -11
  45. package/src/lib/rxjs/rxjs.unique.d.ts +3 -3
  46. package/src/lib/rxjs/set.d.ts +12 -12
  47. package/src/lib/rxjs/string.d.ts +3 -3
  48. package/src/lib/rxjs/timeout.d.ts +9 -9
  49. package/src/lib/rxjs/use.d.ts +2 -2
  50. package/src/lib/rxjs/value.d.ts +49 -45
  51. package/src/lib/subscription.d.ts +7 -7
  52. package/src/lib/work/work.factory.d.ts +8 -6
  53. package/src/lib/work/work.instance.d.ts +9 -8
package/index.esm.js CHANGED
@@ -33,14 +33,14 @@ function _class_call_check$9(instance, Constructor) {
33
33
  /**
34
34
  * Creates a local {@link AssetLocalPathRef}.
35
35
  *
36
+ * @param path - Relative path from the environment's base asset directory.
37
+ * @returns A local asset reference with the given path.
38
+ *
36
39
  * @example
37
40
  * ```ts
38
41
  * const DISTRICTS = localAsset('data/school-districts.json');
39
42
  * // { sourceType: 'local', path: 'data/school-districts.json' }
40
43
  * ```
41
- *
42
- * @param path - Relative path from the environment's base asset directory.
43
- * @returns A local asset reference with the given path.
44
44
  */ function localAsset(path) {
45
45
  return {
46
46
  sourceType: 'local',
@@ -53,15 +53,15 @@ function _class_call_check$9(instance, Constructor) {
53
53
  * Remote assets always use absolute URLs with an http:// or https:// prefix.
54
54
  * Throws if the provided URL does not have a valid prefix.
55
55
  *
56
+ * @param url - Absolute URL with http/https prefix to fetch the asset from.
57
+ * @returns A remote asset reference with the given URL.
58
+ * @throws {Error} If the URL does not have a valid http/https prefix.
59
+ *
56
60
  * @example
57
61
  * ```ts
58
62
  * const CDN = remoteAsset('https://cdn.example.com/geo.json');
59
63
  * // { sourceType: 'remote', url: 'https://cdn.example.com/geo.json' }
60
64
  * ```
61
- *
62
- * @param url - Absolute URL with http/https prefix to fetch the asset from.
63
- * @returns A remote asset reference with the given URL.
64
- * @throws Error if the URL does not have a valid http/https prefix.
65
65
  */ function remoteAsset(url) {
66
66
  if (!isWebsiteUrlWithPrefix(url)) {
67
67
  throw new Error('remoteAsset() requires a URL with http:// or https:// prefix, got: "'.concat(url, '"'));
@@ -75,6 +75,9 @@ function _class_call_check$9(instance, Constructor) {
75
75
  * Creates a fluent builder for creating multiple local asset refs
76
76
  * from the same folder.
77
77
  *
78
+ * @param folder - Base folder path for the assets.
79
+ * @returns A fluent builder for creating local asset refs within the specified folder.
80
+ *
78
81
  * @example
79
82
  * ```ts
80
83
  * const DATA = assetFolder('data');
@@ -88,9 +91,6 @@ function _class_call_check$9(instance, Constructor) {
88
91
  * // { sourceType: 'local', path: 'data/b.txt' }
89
92
  * // ]
90
93
  * ```
91
- *
92
- * @param folder - Base folder path for the assets.
93
- * @returns A fluent builder for creating local asset refs within the specified folder.
94
94
  */ function assetFolder(folder) {
95
95
  var normalizedFolder = folder.endsWith('/') ? folder : folder + '/';
96
96
  var builder = {
@@ -112,6 +112,10 @@ function _class_call_check$9(instance, Constructor) {
112
112
  * The base URL must be a valid {@link WebsiteUrlWithPrefix}.
113
113
  * Each child path is appended to produce a full absolute URL.
114
114
  *
115
+ * @param baseUrl - Base URL with http/https prefix.
116
+ * @returns A fluent builder for creating remote asset refs under the specified base URL.
117
+ * @throws {Error} If the base URL does not have a valid http/https prefix.
118
+ *
115
119
  * @example
116
120
  * ```ts
117
121
  * const CDN = remoteAssetBaseUrl('https://cdn.example.com/assets');
@@ -125,10 +129,6 @@ function _class_call_check$9(instance, Constructor) {
125
129
  * // { sourceType: 'remote', url: 'https://cdn.example.com/assets/b.json' }
126
130
  * // ]
127
131
  * ```
128
- *
129
- * @param baseUrl - Base URL with http/https prefix.
130
- * @returns A fluent builder for creating remote asset refs under the specified base URL.
131
- * @throws Error if the base URL does not have a valid http/https prefix.
132
132
  */ function remoteAssetBaseUrl(baseUrl) {
133
133
  if (!isWebsiteUrlWithPrefix(baseUrl)) {
134
134
  throw new Error('remoteAssetBaseUrl() requires a URL with http:// or https:// prefix, got: "'.concat(baseUrl, '"'));
@@ -156,15 +156,15 @@ function _class_call_check$9(instance, Constructor) {
156
156
  * The returned {@link AssetLoaderAssetInstance.load} observable is cold — each subscription
157
157
  * invokes the get function anew.
158
158
  *
159
+ * @param ref - The asset path reference this instance represents.
160
+ * @param getFn - Promise-based function that loads the asset bytes.
161
+ * @returns An {@link AssetLoaderAssetInstance} with a cold observable that invokes getFn on each subscription.
162
+ *
159
163
  * @example
160
164
  * ```ts
161
165
  * const instance = assetLoaderAssetInstance(ref, (r) => fetch(r.path).then(res => res.arrayBuffer()));
162
166
  * instance.load().subscribe((data) => { ... });
163
167
  * ```
164
- *
165
- * @param ref - The asset path reference this instance represents.
166
- * @param getFn - Promise-based function that loads the asset bytes.
167
- * @returns An {@link AssetLoaderAssetInstance} with a cold observable that invokes getFn on each subscription.
168
168
  */ function assetLoaderAssetInstance(ref, getFn) {
169
169
  return {
170
170
  ref: function ref1() {
@@ -183,6 +183,9 @@ function _class_call_check$9(instance, Constructor) {
183
183
  * This is the primary helper for building functional AssetLoader implementations
184
184
  * from a Promise-based leaf loader.
185
185
  *
186
+ * @param getFn - Promise-based function that loads any asset's bytes.
187
+ * @returns An {@link AssetLoader} that creates instances using the provided get function.
188
+ *
186
189
  * @example
187
190
  * ```ts
188
191
  * const loader = assetLoaderFromGetFn(async (ref) => {
@@ -190,9 +193,6 @@ function _class_call_check$9(instance, Constructor) {
190
193
  * return response.arrayBuffer();
191
194
  * });
192
195
  * ```
193
- *
194
- * @param getFn - Promise-based function that loads any asset's bytes.
195
- * @returns An {@link AssetLoader} that creates instances using the provided get function.
196
196
  */ function assetLoaderFromGetFn(getFn) {
197
197
  var loader = {
198
198
  get: function get(ref) {
@@ -209,6 +209,9 @@ function _class_call_check$9(instance, Constructor) {
209
209
  * loader together, and the delegated loader routes each {@link AssetPathRef}
210
210
  * to the correct one based on {@link AssetPathRef.sourceType}.
211
211
  *
212
+ * @param config - Specifies the local and remote delegate loaders.
213
+ * @returns An {@link AssetLoader} that routes requests to the appropriate delegate based on source type.
214
+ *
212
215
  * @example
213
216
  * ```ts
214
217
  * const loader = delegatedAssetLoader({
@@ -219,9 +222,6 @@ function _class_call_check$9(instance, Constructor) {
219
222
  * loader.get(localAsset('data/districts.json')); // → local loader
220
223
  * loader.get(remoteAsset('data/geo.json')); // → remote loader
221
224
  * ```
222
- *
223
- * @param config - Specifies the local and remote delegate loaders.
224
- * @returns An {@link AssetLoader} that routes requests to the appropriate delegate based on source type.
225
225
  */ function delegatedAssetLoader(config) {
226
226
  var local = config.local, remote = config.remote;
227
227
  var loader = {
@@ -367,6 +367,9 @@ function _ts_generator$3(thisArg, body) {
367
367
  *
368
368
  * Remote refs always have absolute URLs, so no base URL resolution is needed.
369
369
  *
370
+ * @param config - Optional fetch configuration with custom fetch function.
371
+ * @returns An {@link AssetLoader} that loads remote assets via HTTP fetch.
372
+ *
370
373
  * @example
371
374
  * ```ts
372
375
  * const loader = fetchAssetLoader();
@@ -377,9 +380,6 @@ function _ts_generator$3(thisArg, body) {
377
380
  * // With a custom fetch function:
378
381
  * const loader = fetchAssetLoader({ fetch: myAuthenticatedFetch });
379
382
  * ```
380
- *
381
- * @param config - Optional fetch configuration with custom fetch function.
382
- * @returns An {@link AssetLoader} that loads remote assets via HTTP fetch.
383
383
  */ function fetchAssetLoader() {
384
384
  var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
385
385
  var _config_fetch;
@@ -547,6 +547,9 @@ function _ts_generator$2(thisArg, body) {
547
547
  * Assets are matched by reference identity — the same {@link AssetPathRef}
548
548
  * object used to populate the map must be used to retrieve the data.
549
549
  *
550
+ * @param assets - Map of asset refs to their raw byte data.
551
+ * @returns An {@link AssetLoader} backed by the provided in-memory map.
552
+ *
550
553
  * @example
551
554
  * ```ts
552
555
  * const DISTRICTS = localAsset('districts.json');
@@ -556,9 +559,6 @@ function _ts_generator$2(thisArg, body) {
556
559
  *
557
560
  * loader.get(DISTRICTS).load().subscribe((data) => { ... });
558
561
  * ```
559
- *
560
- * @param assets - Map of asset refs to their raw byte data.
561
- * @returns An {@link AssetLoader} backed by the provided in-memory map.
562
562
  */ function memoryAssetLoader(assets) {
563
563
  var getFn = function getFn(ref) {
564
564
  return _async_to_generator$2(function() {
@@ -584,7 +584,7 @@ function asObservable(valueOrObs) {
584
584
  /**
585
585
  * RxJS operator that flattens an emitted {@link ObservableOrValue} into its unwrapped value via `switchMap`.
586
586
  *
587
- * @returns an operator that unwraps ObservableOrValue emissions
587
+ * @returns An operator that unwraps ObservableOrValue emissions.
588
588
  */ function valueFromObservableOrValue() {
589
589
  return switchMap(function(x) {
590
590
  return asObservable(x);
@@ -594,7 +594,7 @@ function asObservable(valueOrObs) {
594
594
  * RxJS operator that flattens an emitted Maybe<{@link ObservableOrValue}> into its unwrapped value,
595
595
  * emitting `undefined` when the input is nullish.
596
596
  *
597
- * @returns an operator that unwraps Maybe<ObservableOrValue> emissions
597
+ * @returns An operator that unwraps Maybe<ObservableOrValue> emissions.
598
598
  */ function maybeValueFromObservableOrValue() {
599
599
  return switchMap(function(x) {
600
600
  return x != null ? asObservable(x) : of(undefined);
@@ -607,7 +607,7 @@ function asObservableFromGetter(input, args) {
607
607
  /**
608
608
  * RxJS operator that flattens an emitted {@link ObservableOrValueGetter} into its resolved value via `switchMap`.
609
609
  *
610
- * @returns an operator that unwraps getter emissions
610
+ * @returns An operator that unwraps getter emissions.
611
611
  */ function valueFromObservableOrValueGetter() {
612
612
  return switchMap(function(x) {
613
613
  return asObservableFromGetter(x);
@@ -617,7 +617,7 @@ function asObservableFromGetter(input, args) {
617
617
  * RxJS operator that flattens an emitted Maybe<{@link ObservableOrValueGetter}> into its resolved value,
618
618
  * emitting `undefined` when the input is nullish.
619
619
  *
620
- * @returns an operator that unwraps Maybe<ObservableOrValueGetter> emissions, emitting undefined for nullish inputs
620
+ * @returns An operator that unwraps Maybe<ObservableOrValueGetter> emissions, emitting undefined for nullish inputs.
621
621
  */ function maybeValueFromObservableOrValueGetter() {
622
622
  return switchMap(function(x) {
623
623
  return x != null ? asObservableFromGetter(x) : of(undefined);
@@ -676,8 +676,9 @@ function _unsupported_iterable_to_array$b(o, minLen) {
676
676
  /**
677
677
  * Creates an {@link IsModifiedFunction} by inverting the result of an {@link IsEqualFunction}.
678
678
  *
679
- * @param isEqualFunction - equality check function to invert
680
- * @returns a function that returns true when the value has been modified
679
+ * @param isEqualFunction - Equality check function to invert.
680
+ * @returns Predicate that reports true whenever the underlying equality check signals inequality.
681
+ *
681
682
  * @__NO_SIDE_EFFECTS__
682
683
  */ function makeIsModifiedFunction(isEqualFunction) {
683
684
  return function(value) {
@@ -692,8 +693,9 @@ function _unsupported_iterable_to_array$b(o, minLen) {
692
693
  * Prefers `isModified` over `isEqual` (which is inverted), falling back to `defaultFunction`
693
694
  * or a function that always returns true.
694
695
  *
695
- * @param config - configuration with isModified, isEqual, and/or defaultFunction
696
- * @returns an observable of the resolved IsModifiedFunction
696
+ * @param config - Configuration with isModified, isEqual, and/or defaultFunction.
697
+ * @returns An observable of the resolved IsModifiedFunction.
698
+ *
697
699
  * @__NO_SIDE_EFFECTS__
698
700
  */ function makeIsModifiedFunctionObservable(config) {
699
701
  var isModified = config.isModified, isEqual = config.isEqual, defaultFunction = config.defaultFunction;
@@ -712,9 +714,10 @@ function _unsupported_iterable_to_array$b(o, minLen) {
712
714
  /**
713
715
  * Creates a function that returns the value if the check function returns true, otherwise undefined.
714
716
  *
715
- * @param isCheckFunction - optional check function
716
- * @param defaultValueOnMaybe - default result for null/undefined values
717
- * @returns a function that evaluates each value against the check function and returns it or undefined
717
+ * @param isCheckFunction - Optional check function.
718
+ * @param defaultValueOnMaybe - Default result for null/undefined values.
719
+ * @returns Function that yields the input value when it passes the check, or undefined otherwise.
720
+ *
718
721
  * @__NO_SIDE_EFFECTS__
719
722
  */ function makeReturnIfIsFunction(isCheckFunction, defaultValueOnMaybe) {
720
723
  return function(value) {
@@ -724,10 +727,10 @@ function _unsupported_iterable_to_array$b(o, minLen) {
724
727
  /**
725
728
  * Returns the value wrapped in an observable if the check function passes, otherwise emits undefined.
726
729
  *
727
- * @param isCheckFunction - optional check function
728
- * @param value - the value to check
729
- * @param defaultValueOnMaybe - default result for null/undefined values
730
- * @returns an observable that emits the value if the check passes, or undefined otherwise
730
+ * @param isCheckFunction - Optional check function.
731
+ * @param value - The value to check.
732
+ * @param defaultValueOnMaybe - Default result for null/undefined values.
733
+ * @returns An observable that emits the value if the check passes, or undefined otherwise.
731
734
  */ function returnIfIs(isCheckFunction, value, defaultValueOnMaybe) {
732
735
  return checkIs(isCheckFunction, value, defaultValueOnMaybe).pipe(map(function(x) {
733
736
  return x ? value : undefined;
@@ -736,9 +739,10 @@ function _unsupported_iterable_to_array$b(o, minLen) {
736
739
  /**
737
740
  * Creates a function that checks a value against the check function and returns an observable boolean.
738
741
  *
739
- * @param isCheckFunction - optional check function
740
- * @param defaultValueOnMaybe - default result for null/undefined values
741
- * @returns a function that evaluates each value against the check function and returns an observable boolean
742
+ * @param isCheckFunction - Optional check function.
743
+ * @param defaultValueOnMaybe - Default result for null/undefined values.
744
+ * @returns Function that emits whether the supplied value passes the check, falling back to the default for missing values.
745
+ *
742
746
  * @__NO_SIDE_EFFECTS__
743
747
  */ function makeCheckIsFunction(isCheckFunction, defaultValueOnMaybe) {
744
748
  return function(value) {
@@ -750,10 +754,10 @@ function _unsupported_iterable_to_array$b(o, minLen) {
750
754
  *
751
755
  * Returns `of(true)` when no check function is provided.
752
756
  *
753
- * @param isCheckFunction - optional check function
754
- * @param value - the value to check
755
- * @param defaultValueOnMaybe - default result for null/undefined values (defaults to false)
756
- * @returns an observable boolean indicating whether the value passes the check
757
+ * @param isCheckFunction - Optional check function.
758
+ * @param value - The value to check.
759
+ * @param defaultValueOnMaybe - Default result for null/undefined values (defaults to false)
760
+ * @returns An observable boolean indicating whether the value passes the check.
757
761
  */ function checkIs(isCheckFunction, value) {
758
762
  var defaultValueOnMaybe = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
759
763
  var is = isCheckFunction ? value != null ? isCheckFunction(value) : of(defaultValueOnMaybe) : of(true);
@@ -763,7 +767,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
763
767
  /**
764
768
  * RxJS operator that filters out null and undefined values, only passing through defined values.
765
769
  *
766
- * @returns operator that filters out null and undefined emissions
770
+ * @returns Operator that filters out null and undefined emissions.
767
771
  */ function filterMaybe() {
768
772
  return filter(isMaybeSo);
769
773
  }
@@ -773,14 +777,14 @@ function _unsupported_iterable_to_array$b(o, minLen) {
773
777
  /**
774
778
  * RxJS operator that filters out null/undefined elements from an emitted array, keeping only defined values.
775
779
  *
776
- * @returns operator that maps each emitted array to a version with null/undefined elements removed
780
+ * @returns Operator that maps each emitted array to a version with null/undefined elements removed.
777
781
  */ function filterMaybeArray() {
778
782
  return map(filterMaybeArrayValues);
779
783
  }
780
784
  /**
781
785
  * RxJS operator that skips all leading null/undefined emissions, then passes all subsequent values through.
782
786
  *
783
- * @returns operator that skips all null/undefined emissions at the start of the stream
787
+ * @returns Operator that skips all null/undefined emissions at the start of the stream.
784
788
  */ function skipAllInitialMaybe() {
785
789
  return skipWhile(function(x) {
786
790
  return x == null;
@@ -789,15 +793,15 @@ function _unsupported_iterable_to_array$b(o, minLen) {
789
793
  /**
790
794
  * RxJS operator that skips only the first emission if it is null/undefined, then passes all subsequent values.
791
795
  *
792
- * @returns operator that skips the first null/undefined emission if it occurs at the start of the stream
796
+ * @returns Operator that skips the first null/undefined emission if it occurs at the start of the stream.
793
797
  */ function skipInitialMaybe() {
794
798
  return skipMaybes(1);
795
799
  }
796
800
  /**
797
801
  * RxJS operator that skips up to `maxToSkip` null/undefined emissions, then passes all subsequent values.
798
802
  *
799
- * @param maxToSkip - maximum number of null/undefined emissions to skip
800
- * @returns operator that skips the first N null/undefined emissions from the stream
803
+ * @param maxToSkip - Maximum number of null/undefined emissions to skip.
804
+ * @returns Operator that skips the first N null/undefined emissions from the stream.
801
805
  */ function skipMaybes(maxToSkip) {
802
806
  return skipWhile(function(x, i) {
803
807
  return x == null && i < maxToSkip;
@@ -806,8 +810,8 @@ function _unsupported_iterable_to_array$b(o, minLen) {
806
810
  /**
807
811
  * RxJS operator that switches to the emitted observable if defined, or emits the default value if null/undefined.
808
812
  *
809
- * @param defaultValue - fallback value when the observable is nullish (defaults to undefined)
810
- * @returns an operator that handles optional observables
813
+ * @param defaultValue - Fallback value when the observable is nullish (defaults to undefined)
814
+ * @returns An operator that handles optional observables.
811
815
  */ function switchMapMaybeDefault() {
812
816
  var defaultValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : undefined;
813
817
  return switchMap(function(x) {
@@ -828,8 +832,8 @@ function switchMapToDefault(defaultObs, useDefault) {
828
832
  * RxJS operator that resolves an observable/getter config input into a value, applying defaults
829
833
  * for `null`/`undefined`/`true` inputs and emitting `null` for `false`.
830
834
  *
831
- * @param config - configuration providing an optional default getter for null/undefined/true inputs
832
- * @returns operator that resolves each emitted getter into a value, using the default for nullish or true inputs
835
+ * @param config - Configuration providing an optional default getter for null/undefined/true inputs.
836
+ * @returns Operator that resolves each emitted getter into a value, using the default for nullish or true inputs.
833
837
  */ function switchMapObject(config) {
834
838
  var defaultGetter = config.defaultGetter;
835
839
  return switchMap(function(inputConfig) {
@@ -853,10 +857,13 @@ function switchMapWhileFalse(obs, otherwise) {
853
857
  }
854
858
  function switchMapOnBoolean(switchOnValue, obs, otherwise) {
855
859
  return switchMap(function(x) {
860
+ var result;
856
861
  if (x === switchOnValue) {
857
- return asObservableFromGetter(obs);
862
+ result = asObservableFromGetter(obs);
863
+ } else {
864
+ result = otherwise == null ? EMPTY : asObservableFromGetter(otherwise);
858
865
  }
859
- return otherwise == null ? EMPTY : asObservableFromGetter(otherwise);
866
+ return result;
860
867
  });
861
868
  }
862
869
  /**
@@ -864,7 +871,7 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
864
871
  *
865
872
  * Combines {@link filterMaybe} and `switchMap` to only subscribe to non-nullish observables.
866
873
  *
867
- * @returns operator that filters nullish observables and subscribes to the non-nullish ones
874
+ * @returns Operator that filters nullish observables and subscribes to the non-nullish ones.
868
875
  */ function switchMapFilterMaybe() {
869
876
  return function(source) {
870
877
  var subscriber = source.pipe(filterMaybe(), switchMap(function(x) {
@@ -876,7 +883,7 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
876
883
  /**
877
884
  * RxJS operator that switches to the emitted observable if defined, or emits `undefined` when the observable is nullish.
878
885
  *
879
- * @returns operator that switches to the emitted observable or emits undefined for null/undefined inputs
886
+ * @returns Operator that switches to the emitted observable or emits undefined for null/undefined inputs.
880
887
  */ function switchMapMaybe() {
881
888
  return function(source) {
882
889
  var subscriber = source.pipe(switchMap(function(x) {
@@ -888,17 +895,17 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
888
895
  /**
889
896
  * RxJS operator that applies a map function only when the emitted value is non-null/non-undefined.
890
897
  *
891
- * @param mapFn - function to transform defined values
892
- * @returns an operator that maps defined values and passes through undefined
898
+ * @param mapFn - Function to transform defined values.
899
+ * @returns An operator that maps defined values and passes through undefined.
893
900
  */ function mapMaybe(mapFn) {
894
901
  return mapIf(mapFn, isMaybeSo);
895
902
  }
896
903
  /**
897
904
  * RxJS operator that applies a map function only when the decision function returns true.
898
905
  *
899
- * @param mapFn - function to transform the value
900
- * @param decision - predicate that determines whether to apply the map
901
- * @returns an operator that conditionally maps values
906
+ * @param mapFn - Function to transform the value.
907
+ * @param decision - Predicate that determines whether to apply the map.
908
+ * @returns An operator that conditionally maps values.
902
909
  */ function mapIf(mapFn, decision) {
903
910
  return map(function(x) {
904
911
  return decision(x) ? mapFn(x) : undefined;
@@ -907,9 +914,9 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
907
914
  /**
908
915
  * Combines the source observable with another observable via `combineLatest`, then maps the pair to a result.
909
916
  *
910
- * @param combineObs - the secondary observable to combine with the source
911
- * @param mapFn - function that maps the source value and combined value to the output
912
- * @returns operator that combines the source with `combineObs` and maps each pair using `mapFn`
917
+ * @param combineObs - The secondary observable to combine with the source.
918
+ * @param mapFn - Function that maps the source value and combined value to the output.
919
+ * @returns Operator that combines the source with `combineObs` and maps each pair using `mapFn`
913
920
  */ function combineLatestMapFrom(combineObs, mapFn) {
914
921
  return function(obs) {
915
922
  return combineLatest([
@@ -926,10 +933,10 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
926
933
  *
927
934
  * If the delay is not provided, or is falsy, then the second value is never emitted.
928
935
  *
929
- * @param startWith - the value to emit immediately
930
- * @param endWith - the value to emit after the delay
931
- * @param delayTime - optional delay in milliseconds before emitting the second value
932
- * @returns an observable that emits `startWith` immediately and `endWith` after the delay (if provided)
936
+ * @param startWith - The value to emit immediately.
937
+ * @param endWith - The value to emit after the delay.
938
+ * @param delayTime - Optional delay in milliseconds before emitting the second value.
939
+ * @returns An observable that emits `startWith` immediately and `endWith` after the delay (if provided)
933
940
  */ function emitDelayObs(startWith, endWith, delayTime) {
934
941
  var obs = of(startWith);
935
942
  if (delayTime) {
@@ -940,9 +947,9 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
940
947
  /**
941
948
  * Emits a value after a given delay after every new emission.
942
949
  *
943
- * @param value - the value to emit after the delay
944
- * @param delayTime - duration in milliseconds before emitting the value
945
- * @returns operator that appends the given value after each source emission with the specified delay
950
+ * @param value - The value to emit after the delay.
951
+ * @param delayTime - Duration in milliseconds before emitting the value.
952
+ * @returns Operator that appends the given value after each source emission with the specified delay.
946
953
  */ function emitAfterDelay(value, delayTime) {
947
954
  return function(obs) {
948
955
  return obs.pipe(switchMap(function(x) {
@@ -957,7 +964,7 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
957
964
  * Uses {@link areEqualPOJOValues} for comparison, so the emitted objects should be plain objects
958
965
  * or compatible with deep value equality checks.
959
966
  *
960
- * @returns operator that filters out consecutive duplicate POJO emissions
967
+ * @returns Operator that filters out consecutive duplicate POJO emissions.
961
968
  *
962
969
  * @example
963
970
  * ```ts
@@ -1067,7 +1074,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
1067
1074
  get: /**
1068
1075
  * Whether a subscription is currently being managed.
1069
1076
  *
1070
- * @returns true if a subscription is currently active
1077
+ * @returns True if a subscription is currently active.
1071
1078
  */ function get() {
1072
1079
  return Boolean(this._subscription);
1073
1080
  }
@@ -1084,7 +1091,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
1084
1091
  /**
1085
1092
  * Replaces the current subscription with the given one, unsubscribing from the previous.
1086
1093
  *
1087
- * @param sub - new subscription to manage, or `undefined`/`void` to just unsubscribe
1094
+ * @param sub - New subscription to manage, or `undefined`/`void` to just unsubscribe.
1088
1095
  */ key: "setSub",
1089
1096
  value: function setSub(sub) {
1090
1097
  this.unsub();
@@ -1148,7 +1155,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
1148
1155
  get: /**
1149
1156
  * Whether any subscriptions are currently being managed.
1150
1157
  *
1151
- * @returns true if one or more subscriptions are currently active
1158
+ * @returns True if one or more subscriptions are currently active.
1152
1159
  */ function get() {
1153
1160
  var _this__subscriptions;
1154
1161
  return Boolean((_this__subscriptions = this._subscriptions) === null || _this__subscriptions === void 0 ? void 0 : _this__subscriptions.length);
@@ -1166,7 +1173,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
1166
1173
  /**
1167
1174
  * Replaces all managed subscriptions with the given ones, unsubscribing from all previous.
1168
1175
  *
1169
- * @param subs - new subscription(s) to manage
1176
+ * @param subs - New subscription(s) to manage.
1170
1177
  */ key: "setSubs",
1171
1178
  value: function setSubs(subs) {
1172
1179
  this.unsub();
@@ -1177,7 +1184,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
1177
1184
  /**
1178
1185
  * Adds subscription(s) to the managed set without affecting existing ones. Duplicate subscriptions are ignored.
1179
1186
  *
1180
- * @param subs - subscription(s) to add
1187
+ * @param subs - Subscription(s) to add.
1181
1188
  */ key: "addSubs",
1182
1189
  value: function addSubs(subs) {
1183
1190
  var _this__subscriptions;
@@ -1360,7 +1367,7 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1360
1367
  /**
1361
1368
  * Sets an initial filter observable that takes priority over the default filter.
1362
1369
  *
1363
- * @param filterObs - observable providing the initial filter value
1370
+ * @param filterObs - Observable providing the initial filter value.
1364
1371
  */ key: "initWithFilter",
1365
1372
  value: function initWithFilter(filterObs) {
1366
1373
  this._initialFilter.next(filterObs);
@@ -1371,7 +1378,7 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1371
1378
  /**
1372
1379
  * Sets the default filter, used as a fallback when no explicit or initial filter is active.
1373
1380
  *
1374
- * @param filter - default filter value, observable, or undefined to clear
1381
+ * @param filter - Default filter value, observable, or undefined to clear.
1375
1382
  */ key: "setDefaultFilter",
1376
1383
  value: function setDefaultFilter(filter) {
1377
1384
  this._defaultFilter.next(asObservable(filter));
@@ -1381,7 +1388,7 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1381
1388
  /**
1382
1389
  * Sets an explicit filter value that takes priority over the initial and default filters.
1383
1390
  *
1384
- * @param filter - the filter value to set
1391
+ * @param filter - The filter value to set.
1385
1392
  */ key: "setFilter",
1386
1393
  value: function setFilter(filter) {
1387
1394
  this._filter.next(filter);
@@ -1402,7 +1409,7 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1402
1409
  * When enabled, any new emission from the initial filter observable clears the explicit
1403
1410
  * filter, causing `filter$` to fall back to the initial filter value.
1404
1411
  *
1405
- * @param initialFilterTakesPriority - whether initial filter changes should reset the explicit filter
1412
+ * @param initialFilterTakesPriority - Whether initial filter changes should reset the explicit filter.
1406
1413
  */ key: "setInitialFilterTakesPriority",
1407
1414
  value: function setInitialFilterTakesPriority(initialFilterTakesPriority) {
1408
1415
  this._initialFilterTakesPriority.next(initialFilterTakesPriority);
@@ -1416,15 +1423,18 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1416
1423
  var _this = this;
1417
1424
  var _this__initialFilterSub, _subscription;
1418
1425
  (_subscription = (_this__initialFilterSub = this._initialFilterSub).subscription) !== null && _subscription !== void 0 ? _subscription : _this__initialFilterSub.subscription = this._initialFilterTakesPriority.pipe(switchMap(function(clearFilterOnInitialFilterPush) {
1426
+ var result;
1419
1427
  if (clearFilterOnInitialFilterPush) {
1420
- return _this._initialFilter.pipe(switchMap(function(x) {
1428
+ result = _this._initialFilter.pipe(switchMap(function(x) {
1421
1429
  return x !== null && x !== void 0 ? x : EMPTY;
1422
1430
  }), filterMaybe(), map(function() {
1423
1431
  return true;
1424
1432
  }), skip(1) // skip the first emission
1425
1433
  );
1434
+ } else {
1435
+ result = EMPTY;
1426
1436
  }
1427
- return EMPTY;
1437
+ return result;
1428
1438
  }), defaultIfEmpty(false)).subscribe(function(clear) {
1429
1439
  if (clear) {
1430
1440
  _this.resetFilter();
@@ -1534,8 +1544,8 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1534
1544
  *
1535
1545
  * Waits until a filter entry exists for the key, then switches to its filter stream.
1536
1546
  *
1537
- * @param key - filter map key to observe
1538
- * @returns observable that emits the current filter value for the key
1547
+ * @param key - Filter map key to observe.
1548
+ * @returns Observable that emits the current filter value for the key.
1539
1549
  */ key: "filterForKey",
1540
1550
  value: function filterForKey(key) {
1541
1551
  return this._map.pipe(map(function(x) {
@@ -1549,8 +1559,8 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1549
1559
  /**
1550
1560
  * Sets a default filter observable for the given key, used as a fallback when no explicit filter is set.
1551
1561
  *
1552
- * @param key - filter map key
1553
- * @param obs - default filter observable or value
1562
+ * @param key - Filter map key.
1563
+ * @param obs - Default filter observable or value.
1554
1564
  */ key: "addDefaultFilterObs",
1555
1565
  value: function addDefaultFilterObs(key, obs) {
1556
1566
  this._itemForKey(key).setDefaultFilterObs(obs);
@@ -1561,8 +1571,8 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1561
1571
  * Adds a filter observable for the given key. Multiple observables can be added per key
1562
1572
  * and their emissions are merged together.
1563
1573
  *
1564
- * @param key - filter map key
1565
- * @param obs - filter observable to add
1574
+ * @param key - Filter map key.
1575
+ * @param obs - Filter observable to add.
1566
1576
  */ key: "addFilterObs",
1567
1577
  value: function addFilterObs(key, obs) {
1568
1578
  this._itemForKey(key).addFilterObs(obs);
@@ -1573,8 +1583,8 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1573
1583
  * Creates a {@link FilterMapKeyInstance} bound to the given key, providing both
1574
1584
  * {@link FilterSource} and {@link FilterSourceConnector} interfaces for that key.
1575
1585
  *
1576
- * @param key - filter map key to bind
1577
- * @returns instance for interacting with the filter at the given key
1586
+ * @param key - Filter map key to bind.
1587
+ * @returns Instance for interacting with the filter at the given key.
1578
1588
  */ key: "makeInstance",
1579
1589
  value: function makeInstance(key) {
1580
1590
  return new FilterMapKeyInstance(this, key);
@@ -1584,8 +1594,8 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1584
1594
  /**
1585
1595
  * Creates an observable that emits a new {@link FilterMapKeyInstance} each time the key changes.
1586
1596
  *
1587
- * @param keyObs - observable of filter map keys
1588
- * @returns observable that emits instances for the current key
1597
+ * @param keyObs - Observable of filter map keys.
1598
+ * @returns Observable that emits instances for the current key.
1589
1599
  */ key: "instanceObsForKeyObs",
1590
1600
  value: function instanceObsForKeyObs(keyObs) {
1591
1601
  var _this = this;
@@ -1655,7 +1665,7 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1655
1665
  /**
1656
1666
  * Sets the default filter observable for this key.
1657
1667
  *
1658
- * @param filterObs - the observable to use as the default filter for this key
1668
+ * @param filterObs - The observable to use as the default filter for this key.
1659
1669
  */ key: "initWithFilter",
1660
1670
  value: function initWithFilter(filterObs) {
1661
1671
  this.dbxFilterMap.addDefaultFilterObs(this.key, filterObs);
@@ -1665,7 +1675,7 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1665
1675
  /**
1666
1676
  * Connects a filter source, adding its filter observable to this key's merged filters.
1667
1677
  *
1668
- * @param filterSource - the filter source whose filter$ will be added to this key's merged stream
1678
+ * @param filterSource - The filter source whose filter$ will be added to this key's merged stream.
1669
1679
  */ key: "connectWithSource",
1670
1680
  value: function connectWithSource(filterSource) {
1671
1681
  this.dbxFilterMap.addFilterObs(this.key, filterSource.filter$);
@@ -1774,8 +1784,8 @@ var FilterMapItem = /*#__PURE__*/ function() {
1774
1784
  * into concrete filter values, then the `preset` field is removed from the result.
1775
1785
  * Filters without a preset are passed through unchanged.
1776
1786
  *
1777
- * @param fn - function that expands a preset into concrete filter values
1778
- * @returns mapping function that resolves presets and strips the preset field
1787
+ * @param fn - Function that expands a preset into concrete filter values.
1788
+ * @returns Mapping function that resolves presets and strips the preset field.
1779
1789
  *
1780
1790
  * @example
1781
1791
  * ```ts
@@ -1791,22 +1801,26 @@ var FilterMapItem = /*#__PURE__*/ function() {
1791
1801
  * const result = resolve({ preset: 'active' });
1792
1802
  * // result === { active: true }
1793
1803
  * ```
1804
+ *
1794
1805
  * @__NO_SIDE_EFFECTS__
1795
1806
  */ function makeMapFilterWithPresetFn(fn) {
1796
1807
  return function(filter) {
1808
+ var result;
1797
1809
  if (filter.preset) {
1798
- var result = fn(filter);
1799
- delete result.preset;
1800
- return result;
1810
+ var expanded = fn(filter);
1811
+ delete expanded.preset;
1812
+ result = expanded;
1813
+ } else {
1814
+ result = filter;
1801
1815
  }
1802
- return filter;
1816
+ return result;
1803
1817
  };
1804
1818
  }
1805
1819
  /**
1806
1820
  * RxJS operator that resolves preset references in a filter stream using the provided mapping function.
1807
1821
  *
1808
- * @param fn - function that expands a preset into concrete filter values
1809
- * @returns operator that maps filter emissions, resolving any preset references
1822
+ * @param fn - Function that expands a preset into concrete filter values.
1823
+ * @returns Operator that maps filter emissions, resolving any preset references.
1810
1824
  */ function mapFilterWithPreset(fn) {
1811
1825
  return map(makeMapFilterWithPresetFn(fn));
1812
1826
  }
@@ -2031,8 +2045,8 @@ function _ts_generator$1(thisArg, body) {
2031
2045
  * Combines an iteration's `hasNext$` and `canLoadMore$` into a single observable that emits
2032
2046
  * `true` only when both conditions are met (more items exist and the page limit hasn't been reached).
2033
2047
  *
2034
- * @param iteration - the iteration to check
2035
- * @returns observable that emits `true` when more items can be loaded
2048
+ * @param iteration - The iteration to check.
2049
+ * @returns Observable that emits `true` when more items can be loaded.
2036
2050
  */ function iterationHasNextAndCanLoadMore(iteration) {
2037
2051
  return iteration.canLoadMore$.pipe(switchMap(function(canLoadMore) {
2038
2052
  return canLoadMore ? iteration.hasNext$ : of(false);
@@ -2043,12 +2057,11 @@ function _ts_generator$1(thisArg, body) {
2043
2057
  *
2044
2058
  * Falls back to the provided default limit if no max is configured on the iterator.
2045
2059
  *
2046
- * @param iterator - the page iteration to advance
2047
- * @param defaultLimit - fallback page limit if none is configured (defaults to 100)
2048
- * @returns promise resolving to the last loaded page number
2049
- *
2050
- * @throws {Error} If neither a max page load limit nor a default limit is defined
2051
- * @throws Rejects if the iteration encounters a loading error
2060
+ * @param iterator - The page iteration to advance.
2061
+ * @param defaultLimit - Fallback page limit if none is configured (defaults to 100)
2062
+ * @returns Promise resolving to the last loaded page number.
2063
+ * @throws {Error} If neither a max page load limit nor a default limit is defined.
2064
+ * @throws {Error} Rejects if the iteration encounters a loading error.
2052
2065
  */ function iteratorNextPageUntilMaxPageLoadLimit(iterator) {
2053
2066
  var defaultLimit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100;
2054
2067
  return iteratorNextPageUntilPage(iterator, function() {
@@ -2064,11 +2077,10 @@ function _ts_generator$1(thisArg, body) {
2064
2077
  * Automatically pages through a {@link PageItemIteration} until the specified page number is reached,
2065
2078
  * respecting the iteration's max page load limit.
2066
2079
  *
2067
- * @param iteration - the page iteration to advance
2068
- * @param page - target page number (or getter returning one) representing total pages to load
2069
- * @returns promise resolving to the last loaded page number
2070
- *
2071
- * @throws Rejects if the iteration encounters a loading error
2080
+ * @param iteration - The page iteration to advance.
2081
+ * @param page - Target page number (or getter returning one) representing total pages to load.
2082
+ * @returns Promise resolving to the last loaded page number.
2083
+ * @throws {Error} Rejects if the iteration encounters a loading error.
2072
2084
  */ function iteratorNextPageUntilPage(iteration, page) {
2073
2085
  var getPageLimit = asGetter(page);
2074
2086
  function checkPageLimit(page) {
@@ -2170,8 +2182,8 @@ function scanIntoArray() {
2170
2182
  * are incrementally appended. Useful when loading large datasets where the initial page and
2171
2183
  * subsequent pages come from different sources.
2172
2184
  *
2173
- * @param init - function that receives the seed state and returns the accumulator config
2174
- * @returns an operator that emits the growing array
2185
+ * @param init - Function that receives the seed state and returns the accumulator config.
2186
+ * @returns An operator that emits the growing array.
2175
2187
  */ function scanBuildArray(init) {
2176
2188
  return exhaustMap(function(seedState) {
2177
2189
  var _init = init(seedState), _init_seed = _init.seed, seed = _init_seed === void 0 ? [] : _init_seed, accumulatorObs = _init.accumulatorObs, _init_flattenArray = _init.flattenArray, flattenArray = _init_flattenArray === void 0 ? false : _init_flattenArray;
@@ -2193,8 +2205,8 @@ function scanIntoArray() {
2193
2205
  /**
2194
2206
  * RxJS operator that executes a side-effect on each element of the emitted array, then passes the array through.
2195
2207
  *
2196
- * @param forEach - callback to run for each element, or null/undefined to pass through unchanged
2197
- * @returns an operator that taps each element in emitted arrays
2208
+ * @param forEach - Callback to run for each element, or null/undefined to pass through unchanged.
2209
+ * @returns An operator that taps each element in emitted arrays.
2198
2210
  */ function mapForEach(forEach) {
2199
2211
  return forEach ? map(function(x) {
2200
2212
  return forEachWithArray(x, forEach);
@@ -2208,21 +2220,24 @@ function scanIntoArray() {
2208
2220
  *
2209
2221
  * Emits `[]` for empty arrays. When `onlyFirst` is true, takes only the first combined emission.
2210
2222
  *
2211
- * @param mapFunction - function that maps each item to an ObservableInput
2212
- * @param config - optional config (e.g., `onlyFirst`)
2213
- * @returns an operator that async-maps each array element
2223
+ * @param mapFunction - Function that maps each item to an ObservableInput.
2224
+ * @param config - Optional config (e.g., `onlyFirst`)
2225
+ * @returns An operator that async-maps each array element.
2214
2226
  */ function mapEachAsync(mapFunction, config) {
2215
2227
  var _ref = config !== null && config !== void 0 ? config : {}, _ref_onlyFirst = _ref.onlyFirst, onlyFirst = _ref_onlyFirst === void 0 ? false : _ref_onlyFirst;
2216
2228
  return switchMap(function(values) {
2229
+ var result;
2217
2230
  if (values.length) {
2218
2231
  var mappedObs = values.map(mapFunction);
2219
- var result = combineLatest(mappedObs);
2232
+ var combined = combineLatest(mappedObs);
2220
2233
  if (onlyFirst) {
2221
- result = result.pipe(first());
2234
+ combined = combined.pipe(first());
2222
2235
  }
2223
- return result;
2236
+ result = combined;
2237
+ } else {
2238
+ result = of([]);
2224
2239
  }
2225
- return of([]);
2240
+ return result;
2226
2241
  });
2227
2242
  }
2228
2243
 
@@ -2232,6 +2247,9 @@ function scanIntoArray() {
2232
2247
  * The `from` value must be seen first; only then is the `to` value emitted. When `requireConsecutive`
2233
2248
  * is true, the two values must be adjacent emissions.
2234
2249
  *
2250
+ * @param config - From/to values, optional comparator, and consecutive requirement.
2251
+ * @returns An operator that emits on value transitions.
2252
+ *
2235
2253
  * @example
2236
2254
  * ```ts
2237
2255
  * // Emit when transitioning from true to false
@@ -2239,9 +2257,6 @@ function scanIntoArray() {
2239
2257
  * onMatchDelta({ from: true, to: false, requireConsecutive: true })
2240
2258
  * ).subscribe((val) => console.log('Transitioned to false'));
2241
2259
  * ```
2242
- *
2243
- * @param config - from/to values, optional comparator, and consecutive requirement
2244
- * @returns an operator that emits on value transitions
2245
2260
  */ function onMatchDelta(config) {
2246
2261
  var inputIsSame = config.isMatch, from = config.from, to = config.to, requireConsecutive = config.requireConsecutive;
2247
2262
  var isMatch = inputIsSame !== null && inputIsSame !== void 0 ? inputIsSame : function(a, b) {
@@ -2300,16 +2315,16 @@ function scanIntoArray() {
2300
2315
  /**
2301
2316
  * Conditionally applies an operator. Returns the given pipe when `usePipe` is true, otherwise returns identity (pass-through).
2302
2317
  *
2303
- * @param usePipe - whether to apply the pipe
2304
- * @param pipe - the operator to conditionally apply
2305
- * @returns the pipe or identity operator
2318
+ * @param usePipe - Whether to apply the pipe.
2319
+ * @param pipe - The operator to conditionally apply.
2320
+ * @returns The pipe or identity operator.
2306
2321
  */ function pipeIf(usePipe, pipe) {
2307
2322
  return usePipe ? pipe : identity;
2308
2323
  }
2309
2324
  /**
2310
2325
  * RxJS operator that negates each emitted boolean value.
2311
2326
  *
2312
- * @returns operator that maps each boolean emission to its negated value
2327
+ * @returns Operator that maps each boolean emission to its negated value.
2313
2328
  */ function isNot() {
2314
2329
  return map(function(x) {
2315
2330
  return !x;
@@ -2318,7 +2333,7 @@ function scanIntoArray() {
2318
2333
  /**
2319
2334
  * RxJS operator that only emits when a boolean stream transitions from `true` to `false`.
2320
2335
  *
2321
- * @returns operator that filters to only true-to-false transition emissions
2336
+ * @returns Operator that filters to only true-to-false transition emissions.
2322
2337
  */ function onTrueToFalse() {
2323
2338
  return onMatchDelta({
2324
2339
  from: true,
@@ -2329,7 +2344,7 @@ function scanIntoArray() {
2329
2344
  /**
2330
2345
  * RxJS operator that only emits when a boolean stream transitions from `false` to `true`.
2331
2346
  *
2332
- * @returns operator that filters to only false-to-true transition emissions
2347
+ * @returns Operator that filters to only false-to-true transition emissions.
2333
2348
  */ function onFalseToTrue() {
2334
2349
  return onMatchDelta({
2335
2350
  from: false,
@@ -2343,9 +2358,9 @@ function scanIntoArray() {
2343
2358
  *
2344
2359
  * When `invert` is false, returns the original function unchanged.
2345
2360
  *
2346
- * @param decisionFn - the decision function to invert
2347
- * @param invert - whether to apply the inversion (defaults to true)
2348
- * @returns the inverted (or original) decision function
2361
+ * @param decisionFn - The decision function to invert.
2362
+ * @param invert - Whether to apply the inversion (defaults to true)
2363
+ * @returns The inverted (or original) decision function.
2349
2364
  */ function invertObservableDecision(decisionFn) {
2350
2365
  var invert = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
2351
2366
  return invert ? function(value) {
@@ -2361,9 +2376,9 @@ function scanIntoArray() {
2361
2376
  * Items where the decision returns true are kept; others are removed. Results are throttled
2362
2377
  * to prevent excessive re-emissions.
2363
2378
  *
2364
- * @param observableDecisionFunction - async predicate to evaluate each item
2365
- * @param throttle - throttle duration in ms (defaults to 20)
2366
- * @returns an operator that async-filters array elements
2379
+ * @param observableDecisionFunction - Async predicate to evaluate each item.
2380
+ * @param throttle - Throttle duration in ms (defaults to 20)
2381
+ * @returns An operator that async-filters array elements.
2367
2382
  */ function filterItemsWithObservableDecision(observableDecisionFunction) {
2368
2383
  var throttle = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 20;
2369
2384
  var filterAndMap = filterAndMapFunction(function(x) {
@@ -2397,8 +2412,8 @@ function scanIntoArray() {
2397
2412
  * RxJS operator that maps each emission to a new {@link Expires} object with an expiration
2398
2413
  * time relative to the current moment.
2399
2414
  *
2400
- * @param expiresIn - duration in milliseconds until expiration
2401
- * @returns an `OperatorFunction` that maps each emission to an {@link Expires} object
2415
+ * @param expiresIn - Duration in milliseconds until expiration.
2416
+ * @returns An `OperatorFunction` that maps each emission to an {@link Expires} object.
2402
2417
  */ function toExpiration(expiresIn) {
2403
2418
  return map(function() {
2404
2419
  var now = new Date();
@@ -2414,7 +2429,7 @@ function scanIntoArray() {
2414
2429
  /**
2415
2430
  * RxJS operator that filters out emissions whose {@link Expires} value has already expired.
2416
2431
  *
2417
- * @returns operator that only passes through non-expired emissions
2432
+ * @returns Operator that only passes through non-expired emissions.
2418
2433
  */ function skipExpired() {
2419
2434
  return filter(function(expires) {
2420
2435
  return !expirationDetails({
@@ -2425,8 +2440,8 @@ function scanIntoArray() {
2425
2440
  /**
2426
2441
  * RxJS operator that skips emissions until the elapsed time since the emitted date/timestamp has exceeded `expiresIn`.
2427
2442
  *
2428
- * @param expiresIn - duration in milliseconds
2429
- * @returns operator that skips emissions until the time window has elapsed
2443
+ * @param expiresIn - Duration in milliseconds.
2444
+ * @returns Operator that skips emissions until the time window has elapsed.
2430
2445
  */ function skipUntilExpiration(expiresIn) {
2431
2446
  return filter(function(x) {
2432
2447
  return expirationDetails({
@@ -2438,8 +2453,8 @@ function scanIntoArray() {
2438
2453
  /**
2439
2454
  * RxJS operator that skips emissions after the elapsed time since the emitted date/timestamp has exceeded `expiresIn`.
2440
2455
  *
2441
- * @param expiresIn - duration in milliseconds
2442
- * @returns operator that passes through emissions only within the time window
2456
+ * @param expiresIn - Duration in milliseconds.
2457
+ * @returns Operator that passes through emissions only within the time window.
2443
2458
  */ function skipAfterExpiration(expiresIn) {
2444
2459
  return filter(function(x) {
2445
2460
  return !expirationDetails({
@@ -2451,9 +2466,9 @@ function scanIntoArray() {
2451
2466
  /**
2452
2467
  * RxJS operator that only takes emissions from the source within a time window after each emission from a watch observable.
2453
2468
  *
2454
- * @param watch - observable whose emissions reset the time window
2455
- * @param takeFor - duration in milliseconds of each time window
2456
- * @returns operator that limits source emissions to the active time window after each watch emission
2469
+ * @param watch - Observable whose emissions reset the time window.
2470
+ * @param takeFor - Duration in milliseconds of each time window.
2471
+ * @returns Operator that limits source emissions to the active time window after each watch emission.
2457
2472
  */ function skipUntilTimeElapsedAfterLastEmission(watch, takeFor) {
2458
2473
  return function(observable) {
2459
2474
  return watch.pipe(switchMap(function() {
@@ -2471,9 +2486,9 @@ function scanIntoArray() {
2471
2486
  * RxJS operator that skips emissions from the source for a duration after each emission from a watch observable,
2472
2487
  * then passes values through once the time has elapsed.
2473
2488
  *
2474
- * @param watch - observable whose emissions reset the skip window
2475
- * @param skipFor - duration in milliseconds to skip after each watch emission
2476
- * @returns an operator that delays passing values through until time has elapsed since the last watch emission
2489
+ * @param watch - Observable whose emissions reset the skip window.
2490
+ * @param skipFor - Duration in milliseconds to skip after each watch emission.
2491
+ * @returns An operator that delays passing values through until time has elapsed since the last watch emission.
2477
2492
  */ function takeAfterTimeElapsedSinceLastEmission(watch, skipFor) {
2478
2493
  return function(observable) {
2479
2494
  return watch.pipe(switchMap(function() {
@@ -2493,9 +2508,9 @@ function scanIntoArray() {
2493
2508
  *
2494
2509
  * After the timeout, the default value is prepended and the source continues normally.
2495
2510
  *
2496
- * @param defaultValue - value or getter to use as the default
2497
- * @param first - timeout in ms before emitting the default (defaults to 0)
2498
- * @returns an operator that provides a fallback on slow emissions
2511
+ * @param defaultValue - Value or getter to use as the default.
2512
+ * @param first - Timeout in ms before emitting the default (defaults to 0)
2513
+ * @returns An operator that provides a fallback on slow emissions.
2499
2514
  */ function timeoutStartWith(defaultValue) {
2500
2515
  var first = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
2501
2516
  return function(source) {
@@ -2510,9 +2525,9 @@ function scanIntoArray() {
2510
2525
  /**
2511
2526
  * RxJS operator that executes a side-effect function if the source does not emit within the given timeout.
2512
2527
  *
2513
- * @param timeoutDelay - timeout in ms before triggering the side-effect
2514
- * @param useFn - side-effect function to call on timeout
2515
- * @returns an operator that taps after timeout
2528
+ * @param timeoutDelay - Timeout in ms before triggering the side-effect.
2529
+ * @param useFn - Side-effect function to call on timeout.
2530
+ * @returns An operator that taps after timeout.
2516
2531
  */ function tapAfterTimeout(timeoutDelay, useFn) {
2517
2532
  return timeout({
2518
2533
  first: timeoutDelay,
@@ -2524,9 +2539,9 @@ function scanIntoArray() {
2524
2539
  /**
2525
2540
  * RxJS operator that throws an error if the source does not emit within the given timeout.
2526
2541
  *
2527
- * @param timeoutDelay - timeout in ms before throwing
2528
- * @param error - getter that produces the error to throw
2529
- * @returns an operator that throws on timeout
2542
+ * @param timeoutDelay - Timeout in ms before throwing.
2543
+ * @param error - Getter that produces the error to throw.
2544
+ * @returns An operator that throws on timeout.
2530
2545
  */ function throwErrorAfterTimeout(timeoutDelay, error) {
2531
2546
  return timeout({
2532
2547
  first: timeoutDelay,
@@ -2545,6 +2560,9 @@ var DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
2545
2560
  * Wraps `timer()` internally and maps each tick index through the factory. Optionally limits
2546
2561
  * the total number of emissions.
2547
2562
  *
2563
+ * @param config - Timer configuration including factory, interval, wait, and limit.
2564
+ * @returns An observable of factory-produced values.
2565
+ *
2548
2566
  * @example
2549
2567
  * ```ts
2550
2568
  * const countdown$ = factoryTimer({
@@ -2554,9 +2572,6 @@ var DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
2554
2572
  * });
2555
2573
  * // emits 10, 9, 8, ... 0
2556
2574
  * ```
2557
- *
2558
- * @param config - timer configuration including factory, interval, wait, and limit
2559
- * @returns an observable of factory-produced values
2560
2575
  */ function factoryTimer(config) {
2561
2576
  var _config_wait = config.wait, wait = _config_wait === void 0 ? 0 : _config_wait, _config_interval = config.interval, interval = _config_interval === void 0 ? DEFAULT_FACTORY_TIMER_INTERVAL : _config_interval, limit = config.limit, factory = config.factory;
2562
2577
  var obs = timer(wait, interval);
@@ -2574,16 +2589,16 @@ var DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
2574
2589
  * `distinctUntilChanged` variant for arrays that only emits when the set of keys extracted from
2575
2590
  * the array elements changes.
2576
2591
  *
2577
- * @param readKey - function to extract one or more keys from each element
2578
- * @returns an operator that filters out arrays with unchanged key sets
2592
+ * @param readKey - Function to extract one or more keys from each element.
2593
+ * @returns An operator that filters out arrays with unchanged key sets.
2579
2594
  */ function distinctUntilKeysChange(readKey) {
2580
2595
  return distinctUntilChanged(objectKeysEqualityComparatorFunction(readKey));
2581
2596
  }
2582
2597
  /**
2583
2598
  * `distinctUntilChanged` variant for single objects that only emits when the extracted key changes.
2584
2599
  *
2585
- * @param readKey - function to extract a key from the emitted object
2586
- * @returns an operator that filters out emissions with unchanged keys
2600
+ * @param readKey - Function to extract a key from the emitted object.
2601
+ * @returns An operator that filters out emissions with unchanged keys.
2587
2602
  */ function distinctUntilObjectKeyChange(readKey) {
2588
2603
  return distinctUntilChanged(objectKeyEqualityComparatorFunction(readKey));
2589
2604
  }
@@ -2595,9 +2610,9 @@ var DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
2595
2610
  * delays emitting the new value until the previous destruction completes.
2596
2611
  * On unsubscription, the last emitted instance is also destroyed.
2597
2612
  *
2598
- * @param destroy - function to clean up each replaced instance
2599
- * @param wait - whether to wait for the previous destroy to complete before emitting
2600
- * @returns an operator that manages instance lifecycle
2613
+ * @param destroy - Function to clean up each replaced instance.
2614
+ * @param wait - Whether to wait for the previous destroy to complete before emitting.
2615
+ * @returns An operator that manages instance lifecycle.
2601
2616
  */ function cleanup(destroy) {
2602
2617
  var wait = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
2603
2618
  return function(obs) {
@@ -2636,8 +2651,8 @@ var DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
2636
2651
  * Accepts both {@link Destroyable} and {@link Maybe}<{@link Destroyable}> values,
2637
2652
  * skipping cleanup for nullish emissions.
2638
2653
  *
2639
- * @param wait - whether to wait for the previous destroy to complete before emitting
2640
- * @returns an operator that manages Destroyable lifecycle
2654
+ * @param wait - Whether to wait for the previous destroy to complete before emitting.
2655
+ * @returns An operator that manages Destroyable lifecycle.
2641
2656
  */ function cleanupDestroyable(wait) {
2642
2657
  return cleanup(function(x) {
2643
2658
  if (x) {
@@ -2651,13 +2666,13 @@ var DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
2651
2666
  *
2652
2667
  * Only considers the first emission from the source. The result is shared via `shareReplay(1)`.
2653
2668
  *
2669
+ * @returns An operator that tracks whether the first value has been emitted.
2670
+ *
2654
2671
  * @example
2655
2672
  * ```ts
2656
2673
  * const loading$ = dataFetch$.pipe(isLoading());
2657
2674
  * // emits true initially, then false once dataFetch$ emits
2658
2675
  * ```
2659
- *
2660
- * @returns an operator that tracks whether the first value has been emitted
2661
2676
  */ function isLoading() {
2662
2677
  return function(source) {
2663
2678
  return source.pipe(first(), map(function() {
@@ -2685,8 +2700,8 @@ function tapLog(messageOrFunction) {
2685
2700
  *
2686
2701
  * Useful for simulating network latency or staggering requests.
2687
2702
  *
2688
- * @param maxOrArgs - maximum delay in ms, or a full random number config
2689
- * @returns an operator that delays each emission by a random amount
2703
+ * @param maxOrArgs - Maximum delay in ms, or a full random number config.
2704
+ * @returns An operator that delays each emission by a random amount.
2690
2705
  */ function randomDelay(maxOrArgs) {
2691
2706
  var makeRandomDelay = randomNumberFactory(maxOrArgs);
2692
2707
  return randomDelayWithRandomFunction(makeRandomDelay);
@@ -2694,9 +2709,10 @@ function tapLog(messageOrFunction) {
2694
2709
  /**
2695
2710
  * RxJS operator that adds a random delay using a custom random number generator.
2696
2711
  *
2697
- * @param makeRandomDelay - factory that produces random delay values
2698
- * @param scheduler - the scheduler to use for the delay (defaults to asyncScheduler)
2699
- * @returns an operator that delays each emission
2712
+ * @param makeRandomDelay - Factory that produces random delay values.
2713
+ * @param scheduler - The scheduler to use for the delay (defaults to asyncScheduler)
2714
+ * @returns An operator that delays each emission.
2715
+ *
2700
2716
  * @__NO_SIDE_EFFECTS__
2701
2717
  */ function randomDelayWithRandomFunction(makeRandomDelay) {
2702
2718
  var scheduler = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : asyncScheduler;
@@ -2708,7 +2724,7 @@ function tapLog(messageOrFunction) {
2708
2724
  /**
2709
2725
  * `distinctUntilChanged` variant that only emits when the model's `id` property changes.
2710
2726
  *
2711
- * @returns operator that suppresses consecutive emissions with the same model `id`
2727
+ * @returns Operator that suppresses consecutive emissions with the same model `id`
2712
2728
  */ function distinctUntilModelIdChange() {
2713
2729
  return distinctUntilObjectKeyChange(function(x) {
2714
2730
  return x.id;
@@ -2717,7 +2733,7 @@ function tapLog(messageOrFunction) {
2717
2733
  /**
2718
2734
  * `distinctUntilChanged` variant that only emits when the model's `key` property changes.
2719
2735
  *
2720
- * @returns operator that suppresses consecutive emissions with the same model `key`
2736
+ * @returns Operator that suppresses consecutive emissions with the same model `key`
2721
2737
  */ function distinctUntilModelKeyChange() {
2722
2738
  return distinctUntilObjectKeyChange(function(x) {
2723
2739
  return x.key;
@@ -2728,8 +2744,8 @@ function tapLog(messageOrFunction) {
2728
2744
  * RxJS operator that extracts values from a keyed object using a keys observable,
2729
2745
  * returning only the values whose keys are present in both.
2730
2746
  *
2731
- * @param keysObs - observable (or static value) of keys to intersect with
2732
- * @returns an operator that maps a keyed object to an array of matching values
2747
+ * @param keysObs - Observable (or static value) of keys to intersect with.
2748
+ * @returns An operator that maps a keyed object to an array of matching values.
2733
2749
  */ function mapKeysIntersectionToArray(keysObs) {
2734
2750
  return switchMap(function(object) {
2735
2751
  return asObservable(keysObs).pipe(map(function(keys) {
@@ -2740,7 +2756,7 @@ function tapLog(messageOrFunction) {
2740
2756
  /**
2741
2757
  * `distinctUntilChanged` variant for `Map` instances that only emits when the set of map keys changes.
2742
2758
  *
2743
- * @returns an operator that filters out Maps with unchanged key sets
2759
+ * @returns An operator that filters out Maps with unchanged key sets.
2744
2760
  */ function distinctUntilMapHasDifferentKeys() {
2745
2761
  return distinctUntilChanged(mapsHaveSameKeys);
2746
2762
  }
@@ -2796,8 +2812,8 @@ function _object_spread_props$7(target, source) {
2796
2812
  * RxJS operator that counts emissions as they occur using `scan`, emitting the running count
2797
2813
  * after each emission (unlike `count()` which only emits on completion).
2798
2814
  *
2799
- * @param startAt - initial count value (defaults to 0)
2800
- * @returns an operator that emits the running emission count
2815
+ * @param startAt - Initial count value (defaults to 0)
2816
+ * @returns An operator that emits the running emission count.
2801
2817
  */ function scanCount() {
2802
2818
  var startAt = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
2803
2819
  return scan(function(count) {
@@ -2807,8 +2823,8 @@ function _object_spread_props$7(target, source) {
2807
2823
  /**
2808
2824
  * Creates a {@link factoryTimer} that emits incrementing numbers on an interval.
2809
2825
  *
2810
- * @param config - timer and incrementing number configuration
2811
- * @returns an observable of incrementing numbers
2826
+ * @param config - Timer and incrementing number configuration.
2827
+ * @returns An observable of incrementing numbers.
2812
2828
  */ function incrementingNumberTimer() {
2813
2829
  var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2814
2830
  return factoryTimer(_object_spread_props$7(_object_spread$7({}, config), {
@@ -2867,10 +2883,10 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2867
2883
  *
2868
2884
  * Emits the `initial` value first, then taps on the first emitted value to run the provided callback.
2869
2885
  *
2870
- * @param tap - side-effect function called with the first value
2871
- * @param initial - optional starting value emitted before the source
2872
- * @param skipFirst - if true, skips tapping the initial value
2873
- * @returns an operator that initializes the pipe with a tap
2886
+ * @param tap - Side-effect function called with the first value.
2887
+ * @param initial - Optional starting value emitted before the source.
2888
+ * @param skipFirst - If true, skips tapping the initial value.
2889
+ * @returns An operator that initializes the pipe with a tap.
2874
2890
  */ function initialize(tap, initial, skipFirst) {
2875
2891
  return function(source) {
2876
2892
  var subscriber = source.pipe(startWith(initial), tapFirst(function(x) {
@@ -2882,9 +2898,9 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2882
2898
  /**
2883
2899
  * Executes a side-effect on the first emission from the observable, then passes all values through.
2884
2900
  *
2885
- * @param tap - the side-effect function to call once
2886
- * @param skipFirst - if true, skips the very first emission before tapping
2887
- * @returns an operator that taps the first value
2901
+ * @param tap - The side-effect function to call once.
2902
+ * @param skipFirst - If true, skips the very first emission before tapping.
2903
+ * @returns An operator that taps the first value.
2888
2904
  */ function tapFirst(tap) {
2889
2905
  var skipFirst = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
2890
2906
  return skipWhile(function(value) {
@@ -2899,8 +2915,8 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2899
2915
  * The subscription will never have `complete()` called since it only triggers after unsubscription.
2900
2916
  * Use `finalize()` for additional cleanup.
2901
2917
  *
2902
- * @param obs - the source observable to wrap
2903
- * @returns an observable that only completes on unsubscription
2918
+ * @param obs - The source observable to wrap.
2919
+ * @returns An observable that only completes on unsubscription.
2904
2920
  */ function preventComplete(obs) {
2905
2921
  var complete = new BehaviorSubject(0);
2906
2922
  return combineLatest([
@@ -2918,14 +2934,14 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2918
2934
  *
2919
2935
  * Unlike `from()`, the promise/observable is not created until the first subscriber connects.
2920
2936
  *
2937
+ * @param getter - Factory that returns a Promise or Observable.
2938
+ * @returns A shared observable that defers execution until subscription.
2939
+ *
2921
2940
  * @example
2922
2941
  * ```ts
2923
2942
  * const data$ = lazyFrom(() => fetch('/api/data').then(r => r.json()));
2924
2943
  * // The fetch is not called until data$ is subscribed to
2925
2944
  * ```
2926
- *
2927
- * @param getter - factory that returns a Promise or Observable
2928
- * @returns a shared observable that defers execution until subscription
2929
2945
  */ function lazyFrom(getter) {
2930
2946
  return of(undefined).pipe(mergeMap(function() {
2931
2947
  return from(getter());
@@ -2937,9 +2953,9 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2937
2953
  *
2938
2954
  * Uses {@link filterUniqueFunction} to deduplicate emitted arrays by extracting a key from each item.
2939
2955
  *
2940
- * @param readKey - function to extract the unique key from each item
2941
- * @param additionalKeysInput - optional additional keys to include in the unique set
2942
- * @returns an operator that emits deduplicated arrays
2956
+ * @param readKey - Function to extract the unique key from each item.
2957
+ * @param additionalKeysInput - Optional additional keys to include in the unique set.
2958
+ * @returns An operator that emits deduplicated arrays.
2943
2959
  */ function filterUnique(readKey, additionalKeysInput) {
2944
2960
  var filterFn = filterUniqueFunction(readKey, additionalKeysInput);
2945
2961
  return map(function(x) {
@@ -2956,6 +2972,9 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2956
2972
  * Each call pushes a value onto the internal subject and returns the shared, throttled observable.
2957
2973
  * Useful for debouncing repeated calls while sharing a single observable output.
2958
2974
  *
2975
+ * @param config - Optional throttle, distinct, and pipe settings.
2976
+ * @returns An async pusher function.
2977
+ *
2959
2978
  * @example
2960
2979
  * ```ts
2961
2980
  * const pusher = asyncPusher<string>({ throttle: 100 });
@@ -2965,9 +2984,6 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2965
2984
  * // clean up
2966
2985
  * pusher.destroy();
2967
2986
  * ```
2968
- *
2969
- * @param config - optional throttle, distinct, and pipe settings
2970
- * @returns an async pusher function
2971
2987
  */ function asyncPusher() {
2972
2988
  var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2973
2989
  var _config_throttle = config.throttle, throttle = _config_throttle === void 0 ? DEFAULT_ASYNC_PUSHER_THROTTLE : _config_throttle, cleanupObs = config.cleanupObs, _config_distinct = config.distinct, distinct = _config_distinct === void 0 ? true : _config_distinct, pipeObs = config.pipe;
@@ -3013,8 +3029,8 @@ function _unsupported_iterable_to_array$6(o, minLen) {
3013
3029
  *
3014
3030
  * The factory optionally accepts a cleanup observable — when it completes, the pusher is destroyed.
3015
3031
  *
3016
- * @param config - optional config passed to the underlying async pusher
3017
- * @returns a cached factory that produces an async pusher
3032
+ * @param config - Optional config passed to the underlying async pusher.
3033
+ * @returns A cached factory that produces an async pusher.
3018
3034
  */ function asyncPusherCache(config) {
3019
3035
  return cachedGetter(function(cleanupObs) {
3020
3036
  var pusher = asyncPusher(config);
@@ -3087,8 +3103,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3087
3103
  * Creates a function that takes a `Map` and combines the latest emissions from observables
3088
3104
  * created from each map value.
3089
3105
  *
3090
- * @param mapToObs - function to transform each map value into an observable
3091
- * @returns a function that converts a Map to a combined observable of results
3106
+ * @param mapToObs - Function to transform each map value into an observable.
3107
+ * @returns Operator-ready function that combines the per-entry observables into one emission of results.
3092
3108
  */ function combineLatestFromMapValuesObsFn(mapToObs) {
3093
3109
  var combineArrayFn = combineLatestFromArrayObsFn(mapToObs);
3094
3110
  return function(latestMap) {
@@ -3103,8 +3119,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3103
3119
  *
3104
3120
  * Returns `of([])` for empty arrays.
3105
3121
  *
3106
- * @param mapToObs - function to transform each value into an observable
3107
- * @returns a function that converts an array to a combined observable
3122
+ * @param mapToObs - Function to transform each value into an observable.
3123
+ * @returns Operator-ready function that combines the latest emissions from each derived observable.
3108
3124
  */ function combineLatestFromArrayObsFn(mapToObs) {
3109
3125
  return function(latest) {
3110
3126
  var newObs = latest.map(mapToObs);
@@ -3117,6 +3133,9 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3117
3133
  * Each key in the input object maps to an observable (or static value). The result observable
3118
3134
  * emits an object with the same keys, where each value is the latest emission from its source.
3119
3135
  *
3136
+ * @param objectMap - An object whose values are observables or static values.
3137
+ * @returns An observable that emits the resolved object.
3138
+ *
3120
3139
  * @example
3121
3140
  * ```ts
3122
3141
  * const result$ = combineLatestFromObject({
@@ -3125,9 +3144,6 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3125
3144
  * });
3126
3145
  * // emits { name: 'Alice', age: 30 }
3127
3146
  * ```
3128
- *
3129
- * @param objectMap - an object whose values are observables or static values
3130
- * @returns an observable that emits the resolved object
3131
3147
  */ function combineLatestFromObject(objectMap) {
3132
3148
  var pairs = allKeyValueTuples(objectMap);
3133
3149
  var observables = pairs.map(function(x) {
@@ -3151,8 +3167,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3151
3167
  /**
3152
3168
  * RxJS operator that maps an array of items to a `Map<K, T>` using the provided key reader.
3153
3169
  *
3154
- * @param read - function to extract the key from each item
3155
- * @returns an operator that converts an array into a keyed Map
3170
+ * @param read - Function to extract the key from each item.
3171
+ * @returns An operator that converts an array into a keyed Map.
3156
3172
  */ function keyValueMap(read) {
3157
3173
  return map(keyValueMapFactory(read));
3158
3174
  }
@@ -3160,8 +3176,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3160
3176
  * RxJS operator that maps an array of items to a `Map<K, T>` using a multi-key reader,
3161
3177
  * allowing each item to appear under multiple keys.
3162
3178
  *
3163
- * @param read - function to extract multiple keys from each item
3164
- * @returns an operator that converts an array into a multi-keyed Map
3179
+ * @param read - Function to extract multiple keys from each item.
3180
+ * @returns An operator that converts an array into a multi-keyed Map.
3165
3181
  */ function multiKeyValueMap(read) {
3166
3182
  return map(multiKeyValueMapFactory(read));
3167
3183
  }
@@ -3172,6 +3188,9 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3172
3188
  *
3173
3189
  * Useful as a safety valve to detect infinite loops or runaway observables.
3174
3190
  *
3191
+ * @param config - Period duration, max emissions, and error/fallback handling.
3192
+ * @returns An operator that monitors emission frequency.
3193
+ *
3175
3194
  * @example
3176
3195
  * ```ts
3177
3196
  * source$.pipe(
@@ -3179,9 +3198,6 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3179
3198
  * ).subscribe();
3180
3199
  * // throws if more than 100 emissions occur within 1 second
3181
3200
  * ```
3182
- *
3183
- * @param config - period duration, max emissions, and error/fallback handling
3184
- * @returns an operator that monitors emission frequency
3185
3201
  */ function errorOnEmissionsInPeriod(config) {
3186
3202
  var _config_period = config.period, period = _config_period === void 0 ? 1000 : _config_period, maxEmissionsPerPeriod = config.maxEmissionsPerPeriod, onError = config.onError, inputErrorFactory = config.errorFactory, inputErrorMessage = config.errorMessage, switchToObs = config.switchToObs;
3187
3203
  var errorMessage = inputErrorMessage !== null && inputErrorMessage !== void 0 ? inputErrorMessage : 'errorOnEmissionsInPeriod(): Too many emissions in time period.';
@@ -3190,8 +3206,9 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3190
3206
  } : undefined;
3191
3207
  return function(source) {
3192
3208
  var counter = timePeriodCounter(period);
3209
+ var result;
3193
3210
  if (errorFactory) {
3194
- return source.pipe(map(function(x) {
3211
+ result = source.pipe(map(function(x) {
3195
3212
  if (counter() > maxEmissionsPerPeriod) {
3196
3213
  var error = errorFactory();
3197
3214
  onError === null || onError === void 0 ? void 0 : onError(error);
@@ -3199,19 +3216,21 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3199
3216
  }
3200
3217
  return x;
3201
3218
  }));
3219
+ } else {
3220
+ // switchToObs was provided.
3221
+ result = source.pipe(switchMap(function(x) {
3222
+ return counter() > maxEmissionsPerPeriod ? switchToObs : of(x);
3223
+ }));
3202
3224
  }
3203
- // switchToObs was provided.
3204
- return source.pipe(switchMap(function(x) {
3205
- return counter() > maxEmissionsPerPeriod ? switchToObs : of(x);
3206
- }));
3225
+ return result;
3207
3226
  };
3208
3227
  }
3209
3228
 
3210
3229
  /**
3211
3230
  * RxJS operator that checks whether the emitted `Set` contains all values from the given observable.
3212
3231
  *
3213
- * @param valuesObs - observable of values to check against
3214
- * @returns an operator that emits true if all values are contained in the set
3232
+ * @param valuesObs - Observable of values to check against.
3233
+ * @returns An operator that emits true if all values are contained in the set.
3215
3234
  */ function setContainsAllValuesFrom(valuesObs) {
3216
3235
  return combineLatestMapFrom(valuesObs, function(set, values) {
3217
3236
  return setContainsAllValues(set, values !== null && values !== void 0 ? values : []);
@@ -3220,8 +3239,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3220
3239
  /**
3221
3240
  * RxJS operator that checks whether the emitted `Set` contains any value from the given observable.
3222
3241
  *
3223
- * @param valuesObs - observable of values to check against
3224
- * @returns an operator that emits true if any value is contained in the set
3242
+ * @param valuesObs - Observable of values to check against.
3243
+ * @returns An operator that emits true if any value is contained in the set.
3225
3244
  */ function setContainsAnyValueFrom(valuesObs) {
3226
3245
  return combineLatestMapFrom(valuesObs, function(set, values) {
3227
3246
  return setContainsAnyValue(set, values !== null && values !== void 0 ? values : []);
@@ -3230,8 +3249,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3230
3249
  /**
3231
3250
  * RxJS operator that checks whether the emitted `Set` contains none of the values from the given observable.
3232
3251
  *
3233
- * @param valuesObs - observable of values to check against
3234
- * @returns an operator that emits true if no values are contained in the set
3252
+ * @param valuesObs - Observable of values to check against.
3253
+ * @returns An operator that emits true if no values are contained in the set.
3235
3254
  */ function setContainsNoValueFrom(valuesObs) {
3236
3255
  return combineLatestMapFrom(valuesObs, function(set, values) {
3237
3256
  return setContainsNoneOfValue(set, values !== null && values !== void 0 ? values : []);
@@ -3240,7 +3259,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3240
3259
  /**
3241
3260
  * `distinctUntilChanged` variant for iterables that only emits when the contained values change.
3242
3261
  *
3243
- * @returns operator that suppresses consecutive iterable emissions with the same set of values
3262
+ * @returns Operator that suppresses consecutive iterable emissions with the same set of values.
3244
3263
  */ function distinctUntilHasDifferentValues() {
3245
3264
  return distinctUntilChanged(hasSameValues);
3246
3265
  }
@@ -3248,8 +3267,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3248
3267
  * `distinctUntilChanged` variant that extracts iterable values from the emitted item and only emits
3249
3268
  * when the set of extracted values changes.
3250
3269
  *
3251
- * @param readValues - function to extract the iterable of values to compare
3252
- * @returns operator that suppresses consecutive emissions whose extracted iterable values are the same
3270
+ * @param readValues - Function to extract the iterable of values to compare.
3271
+ * @returns Operator that suppresses consecutive emissions whose extracted iterable values are the same.
3253
3272
  */ function distinctUntilItemsHaveDifferentValues(readValues) {
3254
3273
  return distinctUntilItemsValueChanges(readValues, hasSameValues);
3255
3274
  }
@@ -3257,9 +3276,9 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3257
3276
  * `distinctUntilChanged` variant that extracts values from the emitted item and compares them
3258
3277
  * using a custom equality comparator.
3259
3278
  *
3260
- * @param readValues - function to extract the value to compare
3261
- * @param isEqualComparator - custom equality function for the extracted values
3262
- * @returns operator that suppresses consecutive emissions whose extracted values are considered equal
3279
+ * @param readValues - Function to extract the value to compare.
3280
+ * @param isEqualComparator - Custom equality function for the extracted values.
3281
+ * @returns Operator that suppresses consecutive emissions whose extracted values are considered equal.
3263
3282
  */ function distinctUntilItemsValueChanges(readValues, isEqualComparator) {
3264
3283
  return distinctUntilChanged(compareEqualityWithValueFromItemsFunction(readValues, isEqualComparator));
3265
3284
  }
@@ -3270,6 +3289,9 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3270
3289
  * Combines the source array with the `search$` observable and applies the configured
3271
3290
  * search string filter function. When the search is null/undefined, all items pass through.
3272
3291
  *
3292
+ * @param config - Search filter configuration with filter function and search$ observable.
3293
+ * @returns An operator that filters arrays by search string.
3294
+ *
3273
3295
  * @example
3274
3296
  * ```ts
3275
3297
  * const items$ = of(['apple', 'banana', 'cherry']);
@@ -3280,9 +3302,6 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3280
3302
  * ).subscribe(console.log);
3281
3303
  * // ['banana']
3282
3304
  * ```
3283
- *
3284
- * @param config - search filter configuration with filter function and search$ observable
3285
- * @returns an operator that filters arrays by search string
3286
3305
  */ function filterWithSearchString(config) {
3287
3306
  var filter = config.filter, search$ = config.search$;
3288
3307
  var filterFactory = searchStringFilterFunction(filter);
@@ -3297,8 +3316,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3297
3316
  * Subscribes to the observable, calls the provided function with the first emitted value,
3298
3317
  * then automatically unsubscribes.
3299
3318
  *
3300
- * @param obs - the source observable
3301
- * @param useFn - function to call with the first value
3319
+ * @param obs - The source observable.
3320
+ * @param useFn - Function to call with the first value.
3302
3321
  */ function useFirst(obs, useFn) {
3303
3322
  obs.pipe(first()).subscribe(useFn);
3304
3323
  }
@@ -3309,6 +3328,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3309
3328
  *
3310
3329
  * Useful for flattening an observable of optional loading contexts into a single stream of loading events.
3311
3330
  *
3331
+ * @returns An RxJS operator that switches to the stream$ of each non-null LoadingContext.
3332
+ *
3312
3333
  * @example
3313
3334
  * ```ts
3314
3335
  * const context$ = new BehaviorSubject<Maybe<LoadingContext>>(myLoadingContext);
@@ -3319,8 +3340,6 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3319
3340
  * // emits LoadingContextEvent values from myLoadingContext.stream$
3320
3341
  * // emits undefined when context$ emits null/undefined
3321
3342
  * ```
3322
- *
3323
- * @returns an RxJS operator that switches to the stream$ of each non-null LoadingContext
3324
3343
  */ function switchMapMaybeLoadingContextStream() {
3325
3344
  return switchMap(function(x) {
3326
3345
  return x != null ? x.stream$ : of(undefined);
@@ -3402,6 +3421,10 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3402
3421
  /**
3403
3422
  * Compares two {@link LoadingState} instances for shallow equality across all key properties.
3404
3423
  *
3424
+ * @param a - First loading state.
3425
+ * @param b - Second loading state.
3426
+ * @returns True if loading, loadingProgress, error, and value are all strictly equal.
3427
+ *
3405
3428
  * @example
3406
3429
  * ```ts
3407
3430
  * const a = successResult('hello');
@@ -3411,10 +3434,6 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3411
3434
  * const c = beginLoading();
3412
3435
  * isLoadingStateEqual(a, c); // false
3413
3436
  * ```
3414
- *
3415
- * @param a - first loading state
3416
- * @param b - second loading state
3417
- * @returns true if loading, loadingProgress, error, and value are all strictly equal
3418
3437
  */ function isLoadingStateEqual(a, b) {
3419
3438
  return a.loading === b.loading && a.loadingProgress === b.loadingProgress && a.error === b.error && a.value === b.value;
3420
3439
  }
@@ -3424,9 +3443,9 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3424
3443
  *
3425
3444
  * Does not compare the `value` property — only structural metadata.
3426
3445
  *
3427
- * @param a - first loading error pair
3428
- * @param b - second loading error pair
3429
- * @returns true if both pairs have equivalent metadata
3446
+ * @param a - First loading error pair.
3447
+ * @param b - Second loading error pair.
3448
+ * @returns True if both pairs have equivalent metadata.
3430
3449
  */ function isLoadingStateMetadataEqual(a, b) {
3431
3450
  return a.loading == b.loading && valuesAreBothNullishOrEquivalent(a.loadingProgress, b.loadingProgress) && valuesAreBothNullishOrEquivalent(a.error, b.error);
3432
3451
  }
@@ -3454,6 +3473,9 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3454
3473
  * Returns `LOADING` if still loading, `SUCCESS` if finished with a value key,
3455
3474
  * `ERROR` if finished with an error key, or `IDLE` if finished with neither.
3456
3475
  *
3476
+ * @param loadingState - The loading state to classify.
3477
+ * @returns The corresponding {@link LoadingStateType}
3478
+ *
3457
3479
  * @example
3458
3480
  * ```ts
3459
3481
  * loadingStateType(beginLoading()); // LoadingStateType.LOADING
@@ -3461,9 +3483,6 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3461
3483
  * loadingStateType(errorResult(new Error())); // LoadingStateType.ERROR
3462
3484
  * loadingStateType({ loading: false }); // LoadingStateType.IDLE
3463
3485
  * ```
3464
- *
3465
- * @param loadingState - the loading state to classify
3466
- * @returns the corresponding {@link LoadingStateType}
3467
3486
  */ function loadingStateType(loadingState) {
3468
3487
  var isLoading = !isLoadingStateFinishedLoading(loadingState);
3469
3488
  var type;
@@ -3486,6 +3505,9 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3486
3505
  * Returns `true` when `loading` is explicitly `false`, or when `loading` is not `true`
3487
3506
  * and either a value, error, or `null` value is present.
3488
3507
  *
3508
+ * @param state - The loading state to check (may be null/undefined)
3509
+ * @returns True if loading is complete.
3510
+ *
3489
3511
  * @example
3490
3512
  * ```ts
3491
3513
  * isLoadingStateFinishedLoading(successResult('done')); // true
@@ -3493,9 +3515,6 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3493
3515
  * isLoadingStateFinishedLoading({ loading: false }); // true
3494
3516
  * isLoadingStateFinishedLoading(null); // false
3495
3517
  * ```
3496
- *
3497
- * @param state - the loading state to check (may be null/undefined)
3498
- * @returns true if loading is complete
3499
3518
  */ function isLoadingStateFinishedLoading(state) {
3500
3519
  var result = false;
3501
3520
  if (state) {
@@ -3514,14 +3533,14 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3514
3533
  *
3515
3534
  * Represents a state where no loading has been initiated yet.
3516
3535
  *
3536
+ * @returns A loading state with `loading: false` and no value or error.
3537
+ *
3517
3538
  * @example
3518
3539
  * ```ts
3519
3540
  * const state = idleLoadingState();
3520
3541
  * // { loading: false }
3521
3542
  * loadingStateType(state); // LoadingStateType.IDLE
3522
3543
  * ```
3523
- *
3524
- * @returns a loading state with `loading: false` and no value or error
3525
3544
  */ function idleLoadingState() {
3526
3545
  return {
3527
3546
  loading: false
@@ -3537,9 +3556,9 @@ function beginLoading(state) {
3537
3556
  /**
3538
3557
  * Creates a {@link PageLoadingState} that is loading for the given page number.
3539
3558
  *
3540
- * @param page - the page number being loaded
3541
- * @param state - optional partial state to merge
3542
- * @returns a page loading state with `loading: true`
3559
+ * @param page - The page number being loaded.
3560
+ * @param state - Optional partial state to merge.
3561
+ * @returns A page loading state with `loading: true`
3543
3562
  */ function beginLoadingPage(page, state) {
3544
3563
  return state ? _object_spread_props$6(_object_spread$6({
3545
3564
  page: page
@@ -3553,14 +3572,14 @@ function beginLoading(state) {
3553
3572
  /**
3554
3573
  * Creates a successful {@link LoadingState} with the given value and `loading: false`.
3555
3574
  *
3575
+ * @param value - The loaded value.
3576
+ * @returns A loading state representing a successful result.
3577
+ *
3556
3578
  * @example
3557
3579
  * ```ts
3558
3580
  * const state = successResult({ name: 'Alice' });
3559
3581
  * // { value: { name: 'Alice' }, loading: false }
3560
3582
  * ```
3561
- *
3562
- * @param value - the loaded value
3563
- * @returns a loading state representing a successful result
3564
3583
  */ function successResult(value) {
3565
3584
  return {
3566
3585
  value: value,
@@ -3570,9 +3589,9 @@ function beginLoading(state) {
3570
3589
  /**
3571
3590
  * Creates a successful {@link PageLoadingState} for a specific page.
3572
3591
  *
3573
- * @param page - the page number
3574
- * @param value - the loaded value
3575
- * @returns a page loading state representing success
3592
+ * @param page - The page number.
3593
+ * @param value - The loaded value.
3594
+ * @returns A page loading state representing success.
3576
3595
  */ function successPageResult(page, value) {
3577
3596
  return _object_spread_props$6(_object_spread$6({}, successResult(value)), {
3578
3597
  page: page
@@ -3583,14 +3602,14 @@ function beginLoading(state) {
3583
3602
  *
3584
3603
  * Converts the input error to a {@link ReadableError} via {@link toReadableError}.
3585
3604
  *
3605
+ * @param error - The error to wrap (string, Error, or ReadableError)
3606
+ * @returns A loading state representing an error.
3607
+ *
3586
3608
  * @example
3587
3609
  * ```ts
3588
3610
  * const state = errorResult(new Error('Not found'));
3589
3611
  * // { error: { message: 'Not found', ... }, loading: false }
3590
3612
  * ```
3591
- *
3592
- * @param error - the error to wrap (string, Error, or ReadableError)
3593
- * @returns a loading state representing an error
3594
3613
  */ function errorResult(error) {
3595
3614
  return {
3596
3615
  error: toReadableError(error),
@@ -3600,9 +3619,9 @@ function beginLoading(state) {
3600
3619
  /**
3601
3620
  * Creates a {@link PageLoadingState} representing an error for a specific page.
3602
3621
  *
3603
- * @param page - the page number
3604
- * @param error - the error to include
3605
- * @returns a page loading state representing an error
3622
+ * @param page - The page number.
3623
+ * @param error - The error to include.
3624
+ * @returns A page loading state representing an error.
3606
3625
  */ function errorPageResult(page, error) {
3607
3626
  return _object_spread_props$6(_object_spread$6({}, errorResult(error)), {
3608
3627
  page: page
@@ -3611,28 +3630,28 @@ function beginLoading(state) {
3611
3630
  /**
3612
3631
  * Whether any of the given {@link LoadingState} instances are currently loading.
3613
3632
  *
3633
+ * @param states - Array of loading states to check.
3634
+ * @returns True if at least one state is loading.
3635
+ *
3614
3636
  * @example
3615
3637
  * ```ts
3616
3638
  * isAnyLoadingStateInLoadingState([successResult(1), beginLoading()]); // true
3617
3639
  * isAnyLoadingStateInLoadingState([successResult(1), successResult(2)]); // false
3618
3640
  * ```
3619
- *
3620
- * @param states - array of loading states to check
3621
- * @returns true if at least one state is loading
3622
3641
  */ function isAnyLoadingStateInLoadingState(states) {
3623
3642
  return reduceBooleansWithOr(states.map(isLoadingStateLoading), false);
3624
3643
  }
3625
3644
  /**
3626
3645
  * Whether all given {@link LoadingState} instances have finished loading.
3627
3646
  *
3647
+ * @param states - Array of loading states to check.
3648
+ * @returns True if every state has finished loading.
3649
+ *
3628
3650
  * @example
3629
3651
  * ```ts
3630
3652
  * areAllLoadingStatesFinishedLoading([successResult(1), successResult(2)]); // true
3631
3653
  * areAllLoadingStatesFinishedLoading([successResult(1), beginLoading()]); // false
3632
3654
  * ```
3633
- *
3634
- * @param states - array of loading states to check
3635
- * @returns true if every state has finished loading
3636
3655
  */ function areAllLoadingStatesFinishedLoading(states) {
3637
3656
  return reduceBooleansWithAnd(states.map(isLoadingStateFinishedLoading), true);
3638
3657
  }
@@ -3641,8 +3660,8 @@ function beginLoading(state) {
3641
3660
  *
3642
3661
  * When the target type is `IDLE`, returns `true` for null/undefined states.
3643
3662
  *
3644
- * @param type - the loading state type to match against
3645
- * @returns a predicate function for the given type
3663
+ * @param type - The loading state type to match against.
3664
+ * @returns A predicate function for the given type.
3646
3665
  */ function isLoadingStateWithStateType(type) {
3647
3666
  var defaultResult = type === LoadingStateType.IDLE;
3648
3667
  return function(state) {
@@ -3679,45 +3698,45 @@ function beginLoading(state) {
3679
3698
  /**
3680
3699
  * Type guard that checks whether a {@link LoadingState} has a non-undefined value, regardless of loading status.
3681
3700
  *
3701
+ * @param state - The loading state to check.
3702
+ * @returns True if the state has a defined (non-undefined) value.
3703
+ *
3682
3704
  * @example
3683
3705
  * ```ts
3684
3706
  * isLoadingStateWithDefinedValue(successResult('hello')); // true
3685
3707
  * isLoadingStateWithDefinedValue(successResult(null)); // true (null is defined)
3686
3708
  * isLoadingStateWithDefinedValue(beginLoading()); // false
3687
3709
  * ```
3688
- *
3689
- * @param state - the loading state to check
3690
- * @returns true if the state has a defined (non-undefined) value
3691
3710
  */ function isLoadingStateWithDefinedValue(state) {
3692
3711
  return state ? state.value !== undefined : false;
3693
3712
  }
3694
3713
  /**
3695
3714
  * Type guard that checks whether a {@link LoadingState} has a non-null error, regardless of loading status.
3696
3715
  *
3716
+ * @param state - The loading state to check.
3717
+ * @returns True if the state has an error.
3718
+ *
3697
3719
  * @example
3698
3720
  * ```ts
3699
3721
  * isLoadingStateWithError(errorResult(new Error('fail'))); // true
3700
3722
  * isLoadingStateWithError(successResult('ok')); // false
3701
3723
  * ```
3702
- *
3703
- * @param state - the loading state to check
3704
- * @returns true if the state has an error
3705
3724
  */ function isLoadingStateWithError(state) {
3706
3725
  return state ? state.error != null : false;
3707
3726
  }
3708
3727
  /**
3709
3728
  * Type guard that checks whether a {@link LoadingState} has finished loading and has a defined value.
3710
3729
  *
3711
- * @param state - the loading state to check
3712
- * @returns true if finished loading with a non-undefined value
3730
+ * @param state - The loading state to check.
3731
+ * @returns True if finished loading with a non-undefined value.
3713
3732
  */ function isLoadingStateFinishedLoadingWithDefinedValue(state) {
3714
3733
  return state ? isLoadingStateFinishedLoading(state) && state.value !== undefined : false;
3715
3734
  }
3716
3735
  /**
3717
3736
  * Type guard that checks whether a {@link LoadingState} has finished loading and has an error.
3718
3737
  *
3719
- * @param state - the loading state to check
3720
- * @returns true if finished loading with an error
3738
+ * @param state - The loading state to check.
3739
+ * @returns True if finished loading with an error.
3721
3740
  */ function isLoadingStateFinishedLoadingWithError(state) {
3722
3741
  return state ? isLoadingStateFinishedLoading(state) && state.error != null : false;
3723
3742
  }
@@ -3726,6 +3745,10 @@ function beginLoading(state) {
3726
3745
  *
3727
3746
  * Does not compare values — only structural metadata.
3728
3747
  *
3748
+ * @param a - First page loading state.
3749
+ * @param b - Second page loading state.
3750
+ * @returns True if metadata is equivalent.
3751
+ *
3729
3752
  * @example
3730
3753
  * ```ts
3731
3754
  * isPageLoadingStateMetadataEqual(
@@ -3738,10 +3761,6 @@ function beginLoading(state) {
3738
3761
  * { page: 2 }
3739
3762
  * ); // false
3740
3763
  * ```
3741
- *
3742
- * @param a - first page loading state
3743
- * @param b - second page loading state
3744
- * @returns true if metadata is equivalent
3745
3764
  */ function isPageLoadingStateMetadataEqual(a, b) {
3746
3765
  return valuesAreBothNullishOrEquivalent(a.page, b.page) && a.loading == b.loading && valuesAreBothNullishOrEquivalent(a.error, b.error);
3747
3766
  }
@@ -3803,9 +3822,9 @@ function mergeLoadingStates() {
3803
3822
  *
3804
3823
  * Useful for resetting a state back to loading or idle without losing other metadata (e.g., page).
3805
3824
  *
3806
- * @param state - the state to copy metadata from
3807
- * @param loading - whether to mark as loading (defaults to true)
3808
- * @returns a new state with value/error cleared
3825
+ * @param state - The state to copy metadata from.
3826
+ * @param loading - Whether to mark as loading (defaults to true)
3827
+ * @returns A new state with value/error cleared.
3809
3828
  */ function mergeLoadingStateWithLoading(state) {
3810
3829
  var loading = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
3811
3830
  return _object_spread_props$6(_object_spread$6({}, state), {
@@ -3817,9 +3836,9 @@ function mergeLoadingStates() {
3817
3836
  /**
3818
3837
  * Returns a copy of the state with the given value, `loading: false`, and error cleared.
3819
3838
  *
3820
- * @param state - the state to copy metadata from
3821
- * @param value - the new value to set
3822
- * @returns a new state representing success
3839
+ * @param state - The state to copy metadata from.
3840
+ * @param value - The new value to set.
3841
+ * @returns A new state representing success.
3823
3842
  */ function mergeLoadingStateWithValue(state, value) {
3824
3843
  return _object_spread_props$6(_object_spread$6({}, state), {
3825
3844
  value: value !== null && value !== void 0 ? value : undefined,
@@ -3830,9 +3849,9 @@ function mergeLoadingStates() {
3830
3849
  /**
3831
3850
  * Returns a copy of the state with the given error and `loading: false`.
3832
3851
  *
3833
- * @param state - the state to copy metadata from
3834
- * @param error - the error to set
3835
- * @returns a new state representing an error
3852
+ * @param state - The state to copy metadata from.
3853
+ * @param error - The error to set.
3854
+ * @returns A new state representing an error.
3836
3855
  */ function mergeLoadingStateWithError(state, error) {
3837
3856
  return _object_spread_props$6(_object_spread$6({}, state), {
3838
3857
  loading: false,
@@ -3844,10 +3863,9 @@ function mergeLoadingStates() {
3844
3863
  *
3845
3864
  * Returns `undefined` if any input is still loading or has an error.
3846
3865
  *
3847
- * @param input - array of loading states to combine
3848
- * @param config - mapping configuration with either `mapValues` or `mapState`
3849
- * @returns the combined loading state, or undefined if inputs are not ready
3850
- *
3866
+ * @param input - Array of loading states to combine.
3867
+ * @param config - Mapping configuration with either `mapValues` or `mapState`
3868
+ * @returns The combined loading state, or undefined if inputs are not ready.
3851
3869
  * @throws {Error} When neither `mapValues` nor `mapState` is provided in the config.
3852
3870
  */ function mapMultipleLoadingStateResults(input, config) {
3853
3871
  var mapValues = config.mapValues, mapState = config.mapState;
@@ -3897,8 +3915,9 @@ function mapLoadingStateResults(input, config) {
3897
3915
  * Creates a function that extracts and maps the value from a {@link LoadingState}, returning undefined
3898
3916
  * when the state has no value.
3899
3917
  *
3900
- * @param mapFn - function to transform the value and state into the output type
3901
- * @returns a function that accepts a loading state and returns the mapped value or undefined
3918
+ * @param mapFn - Function to transform the value and state into the output type.
3919
+ * @returns Mapper that yields the transformed value when present, or undefined when the state has none.
3920
+ *
3902
3921
  * @__NO_SIDE_EFFECTS__
3903
3922
  */ function mapLoadingStateValueFunction(mapFn) {
3904
3923
  return function(state) {
@@ -3991,6 +4010,10 @@ function _unsupported_iterable_to_array$3(o, minLen) {
3991
4010
  *
3992
4011
  * If firstOnly is provided, it will only take the first value the observable returns.
3993
4012
  *
4013
+ * @param obs - The source observable to wrap.
4014
+ * @param firstOnly - If true, only takes the first value from the observable.
4015
+ * @returns An observable that emits {@link LoadingState} values representing the loading lifecycle.
4016
+ *
3994
4017
  * @example
3995
4018
  * ```ts
3996
4019
  * // Wrap a data fetch observable into a LoadingState
@@ -3999,10 +4022,6 @@ function _unsupported_iterable_to_array$3(o, minLen) {
3999
4022
  * // Wrap an observable and only take the first emitted value
4000
4023
  * readonly singleValueState$ = loadingStateFromObs(this.data$, true);
4001
4024
  * ```
4002
- *
4003
- * @param obs - The source observable to wrap.
4004
- * @param firstOnly - If true, only takes the first value from the observable.
4005
- * @returns An observable that emits {@link LoadingState} values representing the loading lifecycle.
4006
4025
  */ function loadingStateFromObs(obs, firstOnly) {
4007
4026
  if (firstOnly) {
4008
4027
  obs = obs.pipe(first());
@@ -4027,6 +4046,8 @@ function combineLoadingStates() {
4027
4046
  return x[i] !== y[i];
4028
4047
  });
4029
4048
  }), map(function(states) {
4049
+ // TODO(breaking-change): pass O explicitly (mergeLoadingStates<O>(...states, mergeFn)) or restructure the variadic signature so O is inferable without the cast.
4050
+ // TODO: Fix eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- mergeLoadingStates is variadic; the generic O cannot be inferred from the call, so tsc widens the result to LoadingState<unknown> without this cast
4030
4051
  return mergeLoadingStates.apply(void 0, _to_consumable_array$1(states).concat([
4031
4052
  mergeFn
4032
4053
  ]));
@@ -4040,6 +4061,9 @@ function combineLoadingStates() {
4040
4061
  * If any source has an error, the error is propagated. If any source is still loading, the result is loading.
4041
4062
  * When all sources are successful, the result value is `true`.
4042
4063
  *
4064
+ * @param sources - LoadingState observables whose statuses participate in the combined emission.
4065
+ * @returns An observable emitting a {@link LoadingState}<boolean> representing the combined status.
4066
+ *
4043
4067
  * @example
4044
4068
  * ```ts
4045
4069
  * const success$ = of(successResult(1));
@@ -4052,9 +4076,6 @@ function combineLoadingStates() {
4052
4076
  * const loading$ = of(beginLoading());
4053
4077
  * const status$ = combineLoadingStatesStatus([loading$, success$]);
4054
4078
  * ```
4055
- *
4056
- * @param sources - An array of LoadingState observables to combine.
4057
- * @returns An observable emitting a {@link LoadingState}<boolean> representing the combined status.
4058
4079
  */ function combineLoadingStatesStatus(sources) {
4059
4080
  return combineLatest(sources).pipe(map(function(allLoadingStates) {
4060
4081
  var firstErrorState = allLoadingStates.find(function(x) {
@@ -4084,6 +4105,8 @@ function startWithBeginLoading(state) {
4084
4105
  *
4085
4106
  * Unlike {@link valueFromLoadingState}, this operator emits for every state change, regardless of whether the value is defined.
4086
4107
  *
4108
+ * @returns An `OperatorFunction` that maps each {@link LoadingState} to its current value (or undefined).
4109
+ *
4087
4110
  * @example
4088
4111
  * ```ts
4089
4112
  * // Expose the current (possibly undefined) value from a loading state
@@ -4092,8 +4115,6 @@ function startWithBeginLoading(state) {
4092
4115
  * shareReplay(1)
4093
4116
  * );
4094
4117
  * ```
4095
- *
4096
- * @returns An `OperatorFunction` that maps each {@link LoadingState} to its current value (or undefined).
4097
4118
  */ function currentValueFromLoadingState() {
4098
4119
  return function(obs) {
4099
4120
  return obs.pipe(map(function(x) {
@@ -4107,6 +4128,8 @@ function startWithBeginLoading(state) {
4107
4128
  * Equivalent to piping {@link currentValueFromLoadingState} and `filterMaybeStrict()`.
4108
4129
  * Only emits when the value is defined, filtering out loading and error states without values.
4109
4130
  *
4131
+ * @returns An `OperatorFunction` that emits only defined values from the {@link LoadingState}.
4132
+ *
4110
4133
  * @example
4111
4134
  * ```ts
4112
4135
  * // Only emit when the loading state has a defined value
@@ -4115,8 +4138,6 @@ function startWithBeginLoading(state) {
4115
4138
  * // only emits non-null/non-undefined values
4116
4139
  * );
4117
4140
  * ```
4118
- *
4119
- * @returns An `OperatorFunction` that emits only defined values from the {@link LoadingState}.
4120
4141
  */ function valueFromLoadingState() {
4121
4142
  return function(obs) {
4122
4143
  return obs.pipe(map(function(x) {
@@ -4129,6 +4150,8 @@ function startWithBeginLoading(state) {
4129
4150
  *
4130
4151
  * Filters to only emit when the state contains an error, then extracts and emits the {@link ReadableError}.
4131
4152
  *
4153
+ * @returns An `OperatorFunction` that emits the {@link ReadableError} from error states.
4154
+ *
4132
4155
  * @example
4133
4156
  * ```ts
4134
4157
  * // React to errors from a loading state
@@ -4137,8 +4160,6 @@ function startWithBeginLoading(state) {
4137
4160
  * tap((error) => console.error('Loading failed:', error))
4138
4161
  * ).subscribe();
4139
4162
  * ```
4140
- *
4141
- * @returns An `OperatorFunction` that emits the {@link ReadableError} from error states.
4142
4163
  */ function errorFromLoadingState() {
4143
4164
  return function(obs) {
4144
4165
  return obs.pipe(filter(isLoadingStateWithError), map(function(x) {
@@ -4152,6 +4173,8 @@ function startWithBeginLoading(state) {
4152
4173
  * Passes through non-error states unchanged, but throws the error from any {@link LoadingStateWithError},
4153
4174
  * converting the loading state error into an observable error that can be caught with `catchError`.
4154
4175
  *
4176
+ * @returns An `OperatorFunction` that passes through non-error states and throws on error states.
4177
+ *
4155
4178
  * @example
4156
4179
  * ```ts
4157
4180
  * // Convert a LoadingState observable to a Promise, throwing on error states
@@ -4162,8 +4185,6 @@ function startWithBeginLoading(state) {
4162
4185
  * )
4163
4186
  * );
4164
4187
  * ```
4165
- *
4166
- * @returns An `OperatorFunction` that passes through non-error states and throws on error states.
4167
4188
  */ function throwErrorFromLoadingStateError() {
4168
4189
  return function(obs) {
4169
4190
  return obs.pipe(map(function(x) {
@@ -4246,6 +4267,8 @@ function catchLoadingStateErrorWithOperator(operator) {
4246
4267
  if (isLoadingStateWithError(state)) {
4247
4268
  // map the value using the error state
4248
4269
  mappedObs = of(state).pipe(operator, // if the operator does not return nearly instantly, then return the current state, minus a value
4270
+ // TODO(breaking-change): consider tightening this operator's generic constraints (or accepting Partial<L> for the placeholder) so the structural spread can satisfy L without the double cast.
4271
+ // TODO: Fix eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- L is a generic Partial<PageLoadingState> subtype; the spread literal cannot structurally satisfy that intersection without this cast
4249
4272
  timeoutStartWith(_object_spread_props$5(_object_spread$5({}, state), {
4250
4273
  loading: true,
4251
4274
  value: undefined
@@ -4308,6 +4331,9 @@ function distinctLoadingState(inputConfig) {
4308
4331
  * Waits for the first finished loading state, then resolves with the value. If the finished state
4309
4332
  * contains an error, the promise is rejected with that error.
4310
4333
  *
4334
+ * @param obs - The observable emitting {@link LoadingState} values.
4335
+ * @returns Resolves with the first finished value or rejects when the finished state carries an error.
4336
+ *
4311
4337
  * @example
4312
4338
  * ```ts
4313
4339
  * // Await a loading state observable as a promise
@@ -4324,9 +4350,6 @@ function distinctLoadingState(inputConfig) {
4324
4350
  * throw e;
4325
4351
  * });
4326
4352
  * ```
4327
- *
4328
- * @param obs - The observable emitting {@link LoadingState} values.
4329
- * @returns A Promise that resolves with the value or rejects with the error.
4330
4353
  */ function promiseFromLoadingState(obs) {
4331
4354
  return firstValueFrom(obs.pipe(filter(isLoadingStateFinishedLoading))).then(function(x) {
4332
4355
  var result;
@@ -4345,9 +4368,9 @@ function distinctLoadingState(inputConfig) {
4345
4368
  * Determines the `loading` flag based on whether an error is present, whether the value is defined,
4346
4369
  * and the `showLoadingOnUndefinedValue` setting. Loading progress is only included while loading.
4347
4370
  *
4348
- * @param state - the current loading state to convert into a context event
4349
- * @param input - configuration input controlling how the loading flag is derived
4350
- * @returns a loading state context event derived from the given state
4371
+ * @param state - The current loading state to convert into a context event.
4372
+ * @param input - Configuration input controlling how the loading flag is derived.
4373
+ * @returns A loading state context event derived from the given state.
4351
4374
  */ var DEFAULT_LOADING_EVENT_FOR_LOADING_PAIR_FUNCTION = function DEFAULT_LOADING_EVENT_FOR_LOADING_PAIR_FUNCTION(state, input) {
4352
4375
  var showLoadingOnUndefinedValue = input.showLoadingOnUndefinedValue;
4353
4376
  var error = state.error, value = state.value, loadingProgress = state.loadingProgress;
@@ -4373,6 +4396,9 @@ function distinctLoadingState(inputConfig) {
4373
4396
  * Accepts either a raw observable or a {@link LoadingStateContextConfig} for fine-grained control
4374
4397
  * over how loading events are derived from the state.
4375
4398
  *
4399
+ * @param input - Optional observable or config to initialize the context.
4400
+ * @returns A mutable loading state context with reactive accessors.
4401
+ *
4376
4402
  * @example
4377
4403
  * ```ts
4378
4404
  * // Create a context from a state observable
@@ -4390,9 +4416,6 @@ function distinctLoadingState(inputConfig) {
4390
4416
  * // Clean up
4391
4417
  * context.destroy();
4392
4418
  * ```
4393
- *
4394
- * @param input - optional observable or config to initialize the context
4395
- * @returns a mutable loading state context with reactive accessors
4396
4419
  */ function loadingStateContext(input) {
4397
4420
  var _ref, _ref1;
4398
4421
  var _config = input && isObservable(input) ? {
@@ -4452,15 +4475,15 @@ function distinctLoadingState(inputConfig) {
4452
4475
  *
4453
4476
  * Returns true if the value is nullish or has zero length, regardless of loading status.
4454
4477
  *
4478
+ * @param listLoadingState - The list loading state to check.
4479
+ * @returns True if the value is empty or absent.
4480
+ *
4455
4481
  * @example
4456
4482
  * ```ts
4457
4483
  * isListLoadingStateWithEmptyValue(successResult([])); // true
4458
4484
  * isListLoadingStateWithEmptyValue(successResult([1, 2])); // false
4459
4485
  * isListLoadingStateWithEmptyValue(beginLoading()); // true (no value)
4460
4486
  * ```
4461
- *
4462
- * @param listLoadingState - the list loading state to check
4463
- * @returns true if the value is empty or absent
4464
4487
  */ function isListLoadingStateWithEmptyValue(listLoadingState) {
4465
4488
  var _listLoadingState_value;
4466
4489
  return Boolean(!((_listLoadingState_value = listLoadingState.value) === null || _listLoadingState_value === void 0 ? void 0 : _listLoadingState_value.length));
@@ -4468,14 +4491,14 @@ function distinctLoadingState(inputConfig) {
4468
4491
  /**
4469
4492
  * RxJS operator that maps each emitted {@link ListLoadingState} to a boolean indicating whether the list is empty.
4470
4493
  *
4494
+ * @returns An operator that emits true when the list value is empty or absent.
4495
+ *
4471
4496
  * @example
4472
4497
  * ```ts
4473
4498
  * of(successResult([])).pipe(
4474
4499
  * mapIsListLoadingStateWithEmptyValue()
4475
4500
  * ).subscribe((isEmpty) => console.log(isEmpty)); // true
4476
4501
  * ```
4477
- *
4478
- * @returns an operator that emits true when the list value is empty or absent
4479
4502
  */ function mapIsListLoadingStateWithEmptyValue() {
4480
4503
  return map(isListLoadingStateWithEmptyValue);
4481
4504
  }
@@ -4484,16 +4507,16 @@ function distinctLoadingState(inputConfig) {
4484
4507
  *
4485
4508
  * Uses {@link loadingStateFromObs} internally and attaches the page number to each emitted state.
4486
4509
  *
4510
+ * @param obs - The source observable to wrap.
4511
+ * @param firstOnly - If true, only takes the first value.
4512
+ * @param page - The page number to attach (defaults to 0)
4513
+ * @returns An observable of page loading states.
4514
+ *
4487
4515
  * @example
4488
4516
  * ```ts
4489
4517
  * const pageState$ = pageLoadingStateFromObs(fetchItems$, false, 2);
4490
4518
  * // emits: { loading: true, page: 2 }, then { value: items, loading: false, page: 2 }
4491
4519
  * ```
4492
- *
4493
- * @param obs - the source observable to wrap
4494
- * @param firstOnly - if true, only takes the first value
4495
- * @param page - the page number to attach (defaults to 0)
4496
- * @returns an observable of page loading states
4497
4520
  */ function pageLoadingStateFromObs(obs, firstOnly) {
4498
4521
  var page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
4499
4522
  return loadingStateFromObs(obs, firstOnly).pipe(map(function(x) {
@@ -4507,6 +4530,8 @@ function distinctLoadingState(inputConfig) {
4507
4530
  *
4508
4531
  * Combines {@link valueFromFinishedLoadingState} with a default of `[]`.
4509
4532
  *
4533
+ * @returns An operator that emits the array value or an empty array.
4534
+ *
4510
4535
  * @example
4511
4536
  * ```ts
4512
4537
  * of(successResult([1, 2, 3])).pipe(
@@ -4517,8 +4542,6 @@ function distinctLoadingState(inputConfig) {
4517
4542
  * arrayValueFromFinishedLoadingState()
4518
4543
  * ).subscribe((items) => console.log(items)); // []
4519
4544
  * ```
4520
- *
4521
- * @returns an operator that emits the array value or an empty array
4522
4545
  */ function arrayValueFromFinishedLoadingState() {
4523
4546
  return function(obs) {
4524
4547
  return obs.pipe(valueFromFinishedLoadingState(function() {
@@ -4585,6 +4608,9 @@ function _type_of$2(obj) {
4585
4608
  * Extends {@link loadingStateContext} with list-aware behavior, including optional array length limiting
4586
4609
  * via {@link LimitArrayConfig} and empty-state detection streams.
4587
4610
  *
4611
+ * @param input - Optional observable or config to initialize the context.
4612
+ * @returns A mutable list loading state context.
4613
+ *
4588
4614
  * @example
4589
4615
  * ```ts
4590
4616
  * const context = listLoadingStateContext<string>();
@@ -4602,9 +4628,6 @@ function _type_of$2(obj) {
4602
4628
  *
4603
4629
  * context.destroy();
4604
4630
  * ```
4605
- *
4606
- * @param input - optional observable or config to initialize the context
4607
- * @returns a mutable list loading state context
4608
4631
  */ function listLoadingStateContext(input) {
4609
4632
  var limitArrayConfig = (typeof input === "undefined" ? "undefined" : _type_of$2(input)) === 'object' ? input : undefined;
4610
4633
  var loadingState = loadingStateContext(_object_spread_props$4(_object_spread$4({}, input), {
@@ -4746,7 +4769,7 @@ function _object_spread_props$3(target, source) {
4746
4769
  /**
4747
4770
  * Whether the current state has a non-null error.
4748
4771
  *
4749
- * @returns true if the current state contains an error
4772
+ * @returns True if the current state contains an error.
4750
4773
  */ key: "hasError",
4751
4774
  value: function hasError() {
4752
4775
  return isLoadingStateWithError(this._subject.value);
@@ -4774,7 +4797,7 @@ function _object_spread_props$3(target, source) {
4774
4797
  /**
4775
4798
  * Sets the loading flag and clears any existing error.
4776
4799
  *
4777
- * @param loading - whether loading is in progress (defaults to true)
4800
+ * @param loading - Whether loading is in progress (defaults to true)
4778
4801
  */ key: "setLoading",
4779
4802
  value: function setLoading() {
4780
4803
  var loading = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
@@ -4788,8 +4811,8 @@ function _object_spread_props$3(target, source) {
4788
4811
  /**
4789
4812
  * Sets an error state with an optional loading flag.
4790
4813
  *
4791
- * @param error - the error to set
4792
- * @param loading - whether loading is still in progress (defaults to false)
4814
+ * @param error - The error to set.
4815
+ * @param loading - Whether loading is still in progress (defaults to false)
4793
4816
  */ key: "setError",
4794
4817
  value: function setError(error) {
4795
4818
  var loading = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
@@ -5189,10 +5212,9 @@ function itemAccumulator(itemIteration, inputMapItem) {
5189
5212
  * Automatically pages through an accumulator's iteration until the desired number of results
5190
5213
  * is reached or no more pages are available.
5191
5214
  *
5192
- * @param config - configuration specifying the accumulator, result limit, and counting function
5193
- * @returns promise resolving to the final page number and total results count
5194
- *
5195
- * @throws Rejects if the iteration encounters an error during loading
5215
+ * @param config - Configuration specifying the accumulator, result limit, and counting function.
5216
+ * @returns Promise resolving to the final page number and total results count.
5217
+ * @throws {Error} Rejects if the iteration encounters a loading error.
5196
5218
  */ function itemAccumulatorNextPageUntilResultsCount(config) {
5197
5219
  var accumulator = config.accumulator, maxResultsLimit = config.maxResultsLimit, countResults = config.countResultsFunction;
5198
5220
  var getMaxResultsLimit = asGetter(maxResultsLimit);
@@ -5341,8 +5363,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
5341
5363
  * Designed for accumulators where each page returns an array of items. Concatenates all
5342
5364
  * page results into one flat array that grows as new pages are loaded.
5343
5365
  *
5344
- * @param accumulator - accumulator whose page results are arrays to flatten
5345
- * @returns observable emitting the flattened array of all accumulated items
5366
+ * @param accumulator - Accumulator whose page results are arrays to flatten.
5367
+ * @returns Observable emitting the flattened array of all accumulated items.
5346
5368
  */ function flattenAccumulatorResultItemArray(accumulator) {
5347
5369
  return accumulator.currentAllItemPairs$.pipe(scanBuildArray(function(allItems) {
5348
5370
  var pairs = allItems;
@@ -5369,8 +5391,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
5369
5391
  * The loading state reflects whether a page is currently being fetched, while the value
5370
5392
  * always contains the full flattened array of all items loaded so far.
5371
5393
  *
5372
- * @param accumulator - page accumulator whose results are arrays to flatten
5373
- * @returns observable of the combined loading state with all accumulated items
5394
+ * @param accumulator - Page accumulator whose results are arrays to flatten.
5395
+ * @returns Observable of the combined loading state with all accumulated items.
5374
5396
  */ function accumulatorFlattenPageListLoadingState(accumulator) {
5375
5397
  return combineLatest([
5376
5398
  accumulator.itemIteration.currentState$,
@@ -5392,8 +5414,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
5392
5414
  * Unlike {@link accumulatorFlattenPageListLoadingState}, this does not flatten arrays —
5393
5415
  * each accumulated value is included as-is.
5394
5416
  *
5395
- * @param accumulator - page accumulator to observe
5396
- * @returns observable of the combined loading state with all accumulated items
5417
+ * @param accumulator - Page accumulator to observe.
5418
+ * @returns Observable of the combined loading state with all accumulated items.
5397
5419
  */ function accumulatorCurrentPageListLoadingState(accumulator) {
5398
5420
  return combineLatest([
5399
5421
  accumulator.itemIteration.currentState$,
@@ -5411,8 +5433,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
5411
5433
  /**
5412
5434
  * Returns the latest loaded page number from the input accumulator's underlying iteration.
5413
5435
  *
5414
- * @param pageItemAccumulator - accumulator to observe the current page from
5415
- * @returns observable emitting the most recently loaded page number
5436
+ * @param pageItemAccumulator - Accumulator to observe the current page from.
5437
+ * @returns Observable emitting the most recently loaded page number.
5416
5438
  */ function pageItemAccumulatorCurrentPage(pageItemAccumulator) {
5417
5439
  return pageItemAccumulator.itemIteration.latestLoadedPage$;
5418
5440
  }
@@ -5423,9 +5445,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
5423
5445
  *
5424
5446
  * Control flow (next, hasNext, canLoadMore) is delegated directly to the underlying iteration.
5425
5447
  *
5426
- * @param itemIterator - the source iteration to wrap
5427
- * @param config - mapping configuration for transforming loading state values
5428
- * @returns mapped iteration instance with transformed state observables
5448
+ * @param itemIterator - The source iteration to wrap.
5449
+ * @param config - Mapping configuration for transforming loading state values.
5450
+ * @returns Mapped iteration instance with transformed state observables.
5429
5451
  */ function mapItemIteration(itemIterator, config) {
5430
5452
  var hasNext$ = itemIterator.hasNext$;
5431
5453
  var canLoadMore$ = itemIterator.canLoadMore$;
@@ -5512,9 +5534,9 @@ function _object_spread_props$2(target, source) {
5512
5534
  * and transforms its loading state values while preserving page-level operations
5513
5535
  * (nextPage, page load limits, latestLoadedPage).
5514
5536
  *
5515
- * @param itemIteration - the source page iteration to wrap
5516
- * @param config - mapping configuration for transforming loading state values
5517
- * @returns mapped page iteration instance
5537
+ * @param itemIteration - The source page iteration to wrap.
5538
+ * @param config - Mapping configuration for transforming loading state values.
5539
+ * @returns Mapped page iteration instance.
5518
5540
  */ function mappedPageItemIteration(itemIteration, config) {
5519
5541
  function nextPage(request) {
5520
5542
  return itemIteration.nextPage(request);
@@ -5699,8 +5721,8 @@ function _unsupported_iterable_to_array(o, minLen) {
5699
5721
  /**
5700
5722
  * Creates a new iteration instance with the given configuration.
5701
5723
  *
5702
- * @param config - filter and page limit configuration for this iteration session
5703
- * @returns new iteration instance ready to begin loading pages
5724
+ * @param config - Filter and page limit configuration for this iteration session.
5725
+ * @returns New iteration instance ready to begin loading pages.
5704
5726
  */ key: "instance",
5705
5727
  value: function instance(config) {
5706
5728
  return new ItemPageIterationInstance(this, config);
@@ -5741,6 +5763,7 @@ function _unsupported_iterable_to_array(o, minLen) {
5741
5763
  ];
5742
5764
  }), mergeMap(function(param) {
5743
5765
  var _param = _sliced_to_array(param, 2), shouldLoadNextPage = _param[0], prevResult = _param[1];
5766
+ var outputObs;
5744
5767
  if (shouldLoadNextPage) {
5745
5768
  var nextPageNumber = nextIteratorPageNumber(prevResult); // retry number if error occured
5746
5769
  var page = filteredPage(nextPageNumber, _this._config);
@@ -5756,19 +5779,24 @@ function _unsupported_iterable_to_array(o, minLen) {
5756
5779
  }).pipe(first());
5757
5780
  }));
5758
5781
  var stateObs = iteratorResultObs.pipe(first(), map(function(result) {
5759
- if (result.error != null) {
5760
- return {
5782
+ var mappedState;
5783
+ if (result.error == null) {
5784
+ mappedState = successPageResult(nextPageNumber, result);
5785
+ } else {
5786
+ mappedState = {
5761
5787
  loading: false,
5762
5788
  page: nextPageNumber,
5763
5789
  error: result.error,
5764
5790
  value: result
5765
5791
  };
5766
5792
  }
5767
- return successPageResult(nextPageNumber, result);
5793
+ return mappedState;
5768
5794
  }), startWithBeginLoading(page), shareReplay(1));
5769
- return stateObs;
5795
+ outputObs = stateObs;
5796
+ } else {
5797
+ outputObs = of(prevResult).pipe();
5770
5798
  }
5771
- return of(prevResult).pipe();
5799
+ return outputObs;
5772
5800
  }), map(function(inputState) {
5773
5801
  var state;
5774
5802
  if (inputState != null) {
@@ -6007,16 +6035,18 @@ function _unsupported_iterable_to_array(o, minLen) {
6007
6035
  * - `end` is not explicitly `false` and the result value is empty/null (via `hasValueOrNotEmpty`)
6008
6036
  * - Error results are never considered the end
6009
6037
  *
6010
- * @param result - the page result to check
6011
- * @returns `true` if this result indicates no more pages are available
6038
+ * @param result - The page result to check.
6039
+ * @returns `true` if this result indicates no more pages are available.
6012
6040
  */ function isItemPageIteratorResultEndResult(result) {
6041
+ var isEnd;
6013
6042
  if (result.error != null) {
6014
- return false;
6015
- }
6016
- if (result.end != null) {
6017
- return result.end;
6043
+ isEnd = false;
6044
+ } else if (result.end == null) {
6045
+ isEnd = !hasValueOrNotEmpty(result);
6046
+ } else {
6047
+ isEnd = result.end;
6018
6048
  }
6019
- return !hasValueOrNotEmpty(result);
6049
+ return isEnd;
6020
6050
  }
6021
6051
  function itemPageIteratorShouldLoadNextPage(request, hasNextAndCanLoadMore, prevResult) {
6022
6052
  return hasNextAndCanLoadMore && // Must be able to load more
@@ -6031,6 +6061,8 @@ function mapItemPageLoadingStateFromResultPageLoadingState() {
6031
6061
  }
6032
6062
  function itemPageLoadingStateFromResultPageLoadingState(input) {
6033
6063
  var _input_value;
6064
+ // TODO(breaking-change): refactor to build the result as an object literal so mapValue narrows V and hasNextPage can be assigned without the cast. See https://github.com/dereekb/dbx-components issue tracking for cleanup.
6065
+ // TODO: Fix eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- cast widens mapValue's V|undefined inference to V and removes readonly so hasNextPage can be assigned; tsc reports both errors without it
6034
6066
  var result = mapLoadingStateResults(input, {
6035
6067
  mapValue: function mapValue(result) {
6036
6068
  return result.value;
@@ -6117,12 +6149,12 @@ function _type_of(obj) {
6117
6149
  *
6118
6150
  * Useful for deferring an action until all locks are released, with a safety timeout to avoid waiting indefinitely.
6119
6151
  *
6120
- * @param config - configuration specifying the lock set, callback, timeout, and optional delay
6121
- * @param config.lockSet - the lock set to monitor for the next unlock event
6122
- * @param config.fn - optional callback to invoke when the lock set unlocks or the timeout is reached
6123
- * @param config.timeout - maximum time in milliseconds to wait before timing out
6124
- * @param config.delayTime - optional delay in milliseconds after unlock before invoking the callback
6125
- * @returns subscription that can be unsubscribed to cancel the wait
6152
+ * @param config - Configuration specifying the lock set, callback, timeout, and optional delay.
6153
+ * @param config.lockSet - The lock set to monitor for the next unlock event.
6154
+ * @param config.fn - Optional callback to invoke when the lock set unlocks or the timeout is reached.
6155
+ * @param config.timeout - Maximum time in milliseconds to wait before timing out.
6156
+ * @param config.delayTime - Optional delay in milliseconds after unlock before invoking the callback.
6157
+ * @returns Subscription that can be unsubscribed to cancel the wait.
6126
6158
  *
6127
6159
  * @example
6128
6160
  * ```ts
@@ -6240,7 +6272,7 @@ function _type_of(obj) {
6240
6272
  /**
6241
6273
  * Locks for a specified number of seconds using the default time lock key.
6242
6274
  *
6243
- * @param seconds - duration in seconds
6275
+ * @param seconds - Duration in seconds.
6244
6276
  */ key: "lockForSeconds",
6245
6277
  value: function lockForSeconds(seconds) {
6246
6278
  this.lockForTime(seconds * 1000);
@@ -6250,8 +6282,8 @@ function _type_of(obj) {
6250
6282
  /**
6251
6283
  * Locks for a specified duration in milliseconds, automatically unlocking when the time elapses.
6252
6284
  *
6253
- * @param milliseconds - lock duration
6254
- * @param key - optional lock key, defaults to {@link DEFAULT_LOCK_SET_TIME_LOCK_KEY}
6285
+ * @param milliseconds - Lock duration.
6286
+ * @param key - Optional lock key, defaults to {@link DEFAULT_LOCK_SET_TIME_LOCK_KEY}
6255
6287
  */ key: "lockForTime",
6256
6288
  value: function lockForTime(milliseconds, key) {
6257
6289
  this.addLock(key !== null && key !== void 0 ? key : DEFAULT_LOCK_SET_TIME_LOCK_KEY, of(false).pipe(delay(milliseconds), startWith(true)));
@@ -6262,9 +6294,9 @@ function _type_of(obj) {
6262
6294
  * Registers a lock observable under the given key. The lock is considered active when
6263
6295
  * the observable emits `true`. Empty observables are treated as unlocked.
6264
6296
  *
6265
- * @param key - identifier for this lock
6266
- * @param obs - observable that emits the lock state
6267
- * @returns function that removes this specific lock when called
6297
+ * @param key - Identifier for this lock.
6298
+ * @param obs - Observable that emits the lock state.
6299
+ * @returns Function that removes this specific lock when called.
6268
6300
  *
6269
6301
  * @example
6270
6302
  * ```ts
@@ -6300,7 +6332,7 @@ function _type_of(obj) {
6300
6332
  /**
6301
6333
  * Removes the lock registered under the given key, if it exists.
6302
6334
  *
6303
- * @param key - identifier of the lock to remove
6335
+ * @param key - Identifier of the lock to remove.
6304
6336
  */ key: "removeLock",
6305
6337
  value: function removeLock(key) {
6306
6338
  if (this._locks.value.delete(key)) {
@@ -6312,9 +6344,9 @@ function _type_of(obj) {
6312
6344
  /**
6313
6345
  * Registers a callback for the next time this lock set becomes unlocked.
6314
6346
  *
6315
- * @param config - callback function or configuration object
6316
- * @param delayTime - optional delay in milliseconds after unlock before invoking the callback
6317
- * @returns subscription that can be unsubscribed to cancel the wait
6347
+ * @param config - Callback function or configuration object.
6348
+ * @param delayTime - Optional delay in milliseconds after unlock before invoking the callback.
6349
+ * @returns Subscription that can be unsubscribed to cancel the wait.
6318
6350
  */ key: "onNextUnlock",
6319
6351
  value: function onNextUnlock(config, delayTime) {
6320
6352
  return onLockSetNextUnlock(_object_spread({
@@ -6330,7 +6362,7 @@ function _type_of(obj) {
6330
6362
  * Establishes a parent-child relationship where this lock set's locked state is propagated
6331
6363
  * to the parent. When this lock set is locked, the parent will also reflect a locked state.
6332
6364
  *
6333
- * @param parent - parent lock set or observable of one; pass `undefined` to detach
6365
+ * @param parent - Parent lock set or observable of one; pass `undefined` to detach.
6334
6366
  */ key: "setParentLockSet",
6335
6367
  value: function setParentLockSet(parent) {
6336
6368
  var _this = this;
@@ -6349,9 +6381,9 @@ function _type_of(obj) {
6349
6381
  /**
6350
6382
  * Registers a child lock set so its locked state propagates upward to this lock set.
6351
6383
  *
6352
- * @param lockSet - child lock set to monitor
6353
- * @param key - optional lock key, auto-generated if not provided
6354
- * @returns function that removes the child lock relationship when called
6384
+ * @param lockSet - Child lock set to monitor.
6385
+ * @param key - Optional lock key, auto-generated if not provided.
6386
+ * @returns Function that removes the child lock relationship when called.
6355
6387
  */ key: "addChildLockSet",
6356
6388
  value: function addChildLockSet(lockSet) {
6357
6389
  var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "".concat(LockSet.LOCK_SET_CHILD_INDEX_STEPPER++);
@@ -6372,8 +6404,8 @@ function _type_of(obj) {
6372
6404
  * After the unlock event (or timeout), the optional callback is invoked and then
6373
6405
  * {@link destroy} is called after a short delay.
6374
6406
  *
6375
- * @param config - optional callback or configuration for the unlock wait
6376
- * @param delayTime - optional delay in milliseconds after unlock before invoking the callback
6407
+ * @param config - Optional callback or configuration for the unlock wait.
6408
+ * @param delayTime - Optional delay in milliseconds after unlock before invoking the callback.
6377
6409
  */ key: "destroyOnNextUnlock",
6378
6410
  value: function destroyOnNextUnlock(config, delayTime) {
6379
6411
  var _this = this;
@@ -6547,7 +6579,7 @@ function _define_property(obj, key, value) {
6547
6579
  *
6548
6580
  * If the loading state returns an error, the error is forwarded.
6549
6581
  *
6550
- * @param loadingStateObs - observable of the loading state to track as the work result
6582
+ * @param loadingStateObs - Observable of the loading state to track as the work result.
6551
6583
  */ key: "startWorkingWithLoadingStateObservable",
6552
6584
  value: function startWorkingWithLoadingStateObservable(loadingStateObs) {
6553
6585
  var _this = this;
@@ -6573,8 +6605,8 @@ function _define_property(obj, key, value) {
6573
6605
  *
6574
6606
  * It is used in conjunction with startWorking() and ideal for cases where multiple observables or promises are used.
6575
6607
  *
6576
- * @param loadingStateObs - promise or observable of the loading state to track for errors
6577
- * @returns a promise that resolves with the value from the loading state or rejects on error
6608
+ * @param loadingStateObs - Promise or observable of the loading state to track for errors.
6609
+ * @returns Resolves with the first non-loading value, or rejects when the loading state surfaces an error.
6578
6610
  */ key: "performTaskWithLoadingState",
6579
6611
  value: function performTaskWithLoadingState(loadingStateObs) {
6580
6612
  var _this = this;
@@ -6593,7 +6625,8 @@ function _define_property(obj, key, value) {
6593
6625
  *
6594
6626
  * If an error is thrown, the error is forwarded to the reject function.
6595
6627
  *
6596
- * @param fn - synchronous function that returns the result value or throws an error
6628
+ * @param fn - Synchronous function that returns the result value or throws an error.
6629
+ * @throws Re-throws the error from `fn` after forwarding it to the reject function.
6597
6630
  */ key: "performTaskWithReturnValue",
6598
6631
  value: function performTaskWithReturnValue(fn) {
6599
6632
  try {
@@ -6609,7 +6642,7 @@ function _define_property(obj, key, value) {
6609
6642
  /**
6610
6643
  * Begins working using a promise.
6611
6644
  *
6612
- * @param promise - the promise that represents the asynchronous work
6645
+ * @param promise - Asynchronous work whose resolved value should be tracked as the work result.
6613
6646
  */ key: "startWorkingWithPromise",
6614
6647
  value: function startWorkingWithPromise(promise) {
6615
6648
  this.startWorkingWithObservable(from(promise));
@@ -6619,7 +6652,7 @@ function _define_property(obj, key, value) {
6619
6652
  /**
6620
6653
  * Begins working using an observable.
6621
6654
  *
6622
- * @param workObs - the observable that represents the asynchronous work and emits the result
6655
+ * @param workObs - The observable that represents the asynchronous work and emits the result.
6623
6656
  */ key: "startWorkingWithObservable",
6624
6657
  value: function startWorkingWithObservable(workObs) {
6625
6658
  var _this = this;
@@ -6647,7 +6680,7 @@ function _define_property(obj, key, value) {
6647
6680
  /**
6648
6681
  * Sets success on the work.
6649
6682
  *
6650
- * @param result - the successful result value to pass to the delegate
6683
+ * @param result - The successful result value to pass to the delegate.
6651
6684
  */ key: "success",
6652
6685
  value: function success(result) {
6653
6686
  this._setComplete(successResult(result));
@@ -6658,7 +6691,7 @@ function _define_property(obj, key, value) {
6658
6691
  /**
6659
6692
  * Sets rejected on the work.
6660
6693
  *
6661
- * @param error - the error to pass to the delegate as the rejection reason
6694
+ * @param error - The error to pass to the delegate as the rejection reason.
6662
6695
  */ key: "reject",
6663
6696
  value: function reject(error) {
6664
6697
  this._setComplete(errorResult(error));
@@ -6708,6 +6741,11 @@ function _define_property(obj, key, value) {
6708
6741
  * If the work function returns an observable, it is automatically subscribed to. If it uses
6709
6742
  * the handler directly, the observable return is ignored.
6710
6743
  *
6744
+ * @param config - Work function and delegate configuration.
6745
+ * @param config.work - The work function to execute for each input value.
6746
+ * @param config.delegate - Delegate that receives lifecycle callbacks (start, success, reject)
6747
+ * @returns A factory function that creates WorkInstance for each input.
6748
+ *
6711
6749
  * @example
6712
6750
  * ```ts
6713
6751
  * const factory = workFactory({
@@ -6719,38 +6757,36 @@ function _define_property(obj, key, value) {
6719
6757
  * // instance tracks the work lifecycle
6720
6758
  * ```
6721
6759
  *
6722
- * @param config - work function and delegate configuration
6723
- * @param config.work - the work function to execute for each input value
6724
- * @param config.delegate - delegate that receives lifecycle callbacks (start, success, reject)
6725
- * @returns a factory function that creates WorkInstance for each input
6726
6760
  * @__NO_SIDE_EFFECTS__
6727
6761
  */ function workFactory(param) {
6728
6762
  var work = param.work, delegate = param.delegate;
6729
6763
  return function(value) {
6730
6764
  var handler = new WorkInstance(value, delegate);
6731
- var fnResult;
6765
+ var fnResult = undefined;
6766
+ var result;
6732
6767
  try {
6733
6768
  fnResult = work(value, handler);
6769
+ result = handler;
6734
6770
  } catch (e) {
6735
6771
  console.error('Work encountered an unexpected error.', e);
6736
6772
  handler.reject(e);
6737
- return;
6738
6773
  }
6739
- if (!handler.isComplete && fnResult && isObservable(fnResult)) {
6774
+ if (result != null && !handler.isComplete && fnResult && isObservable(fnResult)) {
6740
6775
  if (handler.hasStarted) {
6741
6776
  throw new Error('Work already marked as begun from returned result. Either return an observable or use the handler directly.');
6742
6777
  }
6743
6778
  handler.startWorkingWithObservable(fnResult);
6744
6779
  }
6745
- return handler;
6780
+ return result;
6746
6781
  };
6747
6782
  }
6748
6783
  /**
6749
6784
  * Creates a {@link WorkFactory} that generates a new {@link WorkFactoryConfig} for each input,
6750
6785
  * enabling dynamic work and delegate selection per invocation.
6751
6786
  *
6752
- * @param configFactory - factory that produces work configuration from the input value
6753
- * @returns a work factory with per-invocation configuration
6787
+ * @param configFactory - Factory that produces work configuration from the input value.
6788
+ * @returns A work factory with per-invocation configuration.
6789
+ *
6754
6790
  * @__NO_SIDE_EFFECTS__
6755
6791
  */ function workFactoryForConfigFactory(configFactory) {
6756
6792
  return function(value) {