@vinicunca/perkakas 1.2.0 → 1.2.2

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 (47) hide show
  1. package/dist/add.d.cts +0 -1
  2. package/dist/add.d.ts +0 -1
  3. package/dist/chunk-AWXJSK4F.js +1 -0
  4. package/dist/chunk-GOUUMCT7.cjs +1 -0
  5. package/dist/funnel.cjs +1 -0
  6. package/dist/funnel.d.cts +147 -0
  7. package/dist/funnel.d.ts +147 -0
  8. package/dist/funnel.js +1 -0
  9. package/dist/funnel.lodash-debounce-with-cached-value.test.cjs +1 -0
  10. package/dist/funnel.lodash-debounce-with-cached-value.test.d.cts +2 -0
  11. package/dist/funnel.lodash-debounce-with-cached-value.test.d.ts +2 -0
  12. package/dist/funnel.lodash-debounce-with-cached-value.test.js +1 -0
  13. package/dist/funnel.lodash-debounce.test.cjs +1 -0
  14. package/dist/funnel.lodash-debounce.test.d.cts +2 -0
  15. package/dist/funnel.lodash-debounce.test.d.ts +2 -0
  16. package/dist/funnel.lodash-debounce.test.js +1 -0
  17. package/dist/funnel.lodash-throttle-with-cached-value.test.cjs +1 -0
  18. package/dist/funnel.lodash-throttle-with-cached-value.test.d.cts +2 -0
  19. package/dist/funnel.lodash-throttle-with-cached-value.test.d.ts +2 -0
  20. package/dist/funnel.lodash-throttle-with-cached-value.test.js +1 -0
  21. package/dist/funnel.lodash-throttle.test.cjs +1 -0
  22. package/dist/funnel.lodash-throttle.test.d.cts +2 -0
  23. package/dist/funnel.lodash-throttle.test.d.ts +2 -0
  24. package/dist/funnel.lodash-throttle.test.js +1 -0
  25. package/dist/funnel.reference-batch.test.cjs +1 -0
  26. package/dist/funnel.reference-batch.test.d.cts +2 -0
  27. package/dist/funnel.reference-batch.test.d.ts +2 -0
  28. package/dist/funnel.reference-batch.test.js +1 -0
  29. package/dist/funnel.remeda-debounce.test.cjs +1 -0
  30. package/dist/funnel.remeda-debounce.test.d.cts +2 -0
  31. package/dist/funnel.remeda-debounce.test.d.ts +2 -0
  32. package/dist/funnel.remeda-debounce.test.js +1 -0
  33. package/dist/funnel.test-d.cjs +1 -0
  34. package/dist/funnel.test-d.d.cts +2 -0
  35. package/dist/funnel.test-d.d.ts +2 -0
  36. package/dist/funnel.test-d.js +1 -0
  37. package/dist/funnel.test.cjs +1 -0
  38. package/dist/funnel.test.d.cts +2 -0
  39. package/dist/funnel.test.d.ts +2 -0
  40. package/dist/funnel.test.js +1 -0
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.d.cts +1 -0
  43. package/dist/index.d.ts +1 -0
  44. package/dist/index.js +1 -1
  45. package/dist/swap-indices.d.cts +1 -1
  46. package/dist/swap-indices.d.ts +1 -1
  47. package/package.json +5 -7
package/dist/add.d.cts CHANGED
@@ -8,7 +8,6 @@
8
8
  * @example
9
9
  * P.add(10, 5) // => 15
10
10
  * P.add(10, -5) // => 5
11
- * P.reduce([1, 2, 3, 4], P.add, 0) // => 10
12
11
  * @dataFirst
13
12
  * @category Number
14
13
  */
package/dist/add.d.ts CHANGED
@@ -8,7 +8,6 @@
8
8
  * @example
9
9
  * P.add(10, 5) // => 15
10
10
  * P.add(10, -5) // => 5
11
- * P.reduce([1, 2, 3, 4], P.add, 0) // => 10
12
11
  * @dataFirst
13
12
  * @category Number
14
13
  */
@@ -0,0 +1 @@
1
+ function T(c,{triggerAt:l="end",minQuietPeriodMs:u,maxBurstDurationMs:t,minGapMs:o,reducer:p=g}){let e,n,d,r;function a(){let i=d;i!==void 0&&(d=void 0,c(i),o!==void 0&&(n=setTimeout(f,o)))}function f(){clearTimeout(n),n=void 0,e===void 0&&a()}function m(){clearTimeout(e),e=void 0,r=void 0,n===void 0&&a()}return{call:(...i)=>{let s=e===void 0&&n===void 0;if((l!=="start"||s)&&(d=p(d,...i)),!(e===void 0&&!s)){if(u!==void 0||t!==void 0||o===void 0){clearTimeout(e);let y=Date.now();r??=y;let R=t===void 0?u??0:Math.min(u??t,t-(y-r));e=setTimeout(m,R)}l!=="end"&&s&&a()}},cancel:()=>{clearTimeout(e),e=void 0,r=void 0,clearTimeout(n),n=void 0,d=void 0},flush:()=>{m(),f()},get isIdle(){return e===void 0&&n===void 0}}}var g=()=>"";export{T as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }function T(c,{triggerAt:l="end",minQuietPeriodMs:u,maxBurstDurationMs:t,minGapMs:o,reducer:p=g}){let e,n,d,r;function a(){let i=d;i!==void 0&&(d=void 0,c(i),o!==void 0&&(n=setTimeout(f,o)))}function f(){clearTimeout(n),n=void 0,e===void 0&&a()}function m(){clearTimeout(e),e=void 0,r=void 0,n===void 0&&a()}return{call:(...i)=>{let s=e===void 0&&n===void 0;if((l!=="start"||s)&&(d=p(d,...i)),!(e===void 0&&!s)){if(u!==void 0||t!==void 0||o===void 0){clearTimeout(e);let y=Date.now();r??=y;let R=t===void 0?_nullishCoalesce(u, () => (0)):Math.min(_nullishCoalesce(u, () => (t)),t-(y-r));e=setTimeout(m,R)}l!=="end"&&s&&a()}},cancel:()=>{clearTimeout(e),e=void 0,r=void 0,clearTimeout(n),n=void 0,d=void 0},flush:()=>{m(),f()},get isIdle(){return e===void 0&&n===void 0}}}var g=()=>"";exports.a = T;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');exports.funnel = _chunkGOUUMCT7cjs.a;
@@ -0,0 +1,147 @@
1
+ import { RequireAtLeastOne } from 'type-fest';
2
+
3
+ type FunnelOptions<Args extends RestArguments, R> = {
4
+ readonly reducer?: (accumulator: R | undefined, ...params: Args) => R;
5
+ } & FunnelTimingOptions;
6
+ /**
7
+ * Not all combinations of timing options are valid, there are dependencies
8
+ * between them to ensure users can't configure the funnel in a way which would
9
+ * cause it to never trigger.
10
+ */
11
+ type FunnelTimingOptions = {
12
+ readonly triggerAt: 'both' | 'start';
13
+ readonly minQuietPeriodMs?: number;
14
+ readonly maxBurstDurationMs?: number;
15
+ readonly minGapMs?: number;
16
+ } | ({
17
+ readonly triggerAt?: 'end';
18
+ } & (({
19
+ readonly minGapMs: number;
20
+ } & RequireAtLeastOne<{
21
+ readonly minQuietPeriodMs: number;
22
+ readonly maxBurstDurationMs: number;
23
+ }>) | {
24
+ readonly minQuietPeriodMs?: number;
25
+ readonly maxBurstDurationMs?: number;
26
+ readonly minGapMs?: never;
27
+ }));
28
+ type RestArguments = Array<any>;
29
+ interface Funnel<Args extends RestArguments = []> {
30
+ /**
31
+ * Call the function. This might result in the `execute` function being called
32
+ * now or later, depending on it's configuration and it's current state.
33
+ *
34
+ * @param args - The args are defined by the `reducer` function.
35
+ */
36
+ readonly call: (...args: Args) => void;
37
+ /**
38
+ * Resets the funnel to it's initial state. Any calls made since the last
39
+ * invocation will be discarded.
40
+ */
41
+ readonly cancel: () => void;
42
+ /**
43
+ * Triggers an invocation regardless of the current state of the funnel.
44
+ * Like any other invocation, The funnel will also be reset to it's initial
45
+ * state afterwards.
46
+ */
47
+ readonly flush: () => void;
48
+ /**
49
+ * The funnel is in it's initial state (there are no active timeouts).
50
+ */
51
+ readonly isIdle: boolean;
52
+ }
53
+ /**
54
+ * Creates a funnel that controls the timing and execution of `callback`. Its
55
+ * main purpose is to manage multiple consecutive (usually fast-paced) calls,
56
+ * reshaping them according to a defined batching strategy and timing policy.
57
+ * This is useful when handling uncontrolled call rates, such as DOM events or
58
+ * network traffic. It can implement strategies like debouncing, throttling,
59
+ * batching, and more.
60
+ *
61
+ * An optional `reducer` function can be provided to allow passing data to the
62
+ * callback via calls to `call` (otherwise the signature of `call` takes no
63
+ * arguments).
64
+ *
65
+ * Typing is inferred from `callback`s param, and from the rest params that
66
+ * the optional `reducer` function accepts. Use **explicit** types for these
67
+ * to ensure that everything _else_ is well-typed.
68
+ *
69
+ * Notice that this function constructs a funnel **object**, and does **not**
70
+ * execute anything when called. The returned object should be used to execute
71
+ * the funnel via the its `call` method.
72
+ *
73
+ * - Debouncing: use `minQuietPeriodMs` and any `triggerAt`.
74
+ * - Throttling: use `minGapMs` and `triggerAt: "start"` or `"both"`.
75
+ * - Batching: See the reference implementation in [`funnel.reference-batch.test.ts`](https://github.com/vinicunca/perkakas/blob/main/src/funnel.reference-batch.test.ts).
76
+ *
77
+ * @param callback - The main function that would be invoked periodically based
78
+ * on `options`. The function would take the latest result of the `reducer`; if
79
+ * no calls where made since the last time it was invoked it will not be
80
+ * invoked. (If a return value is needed, it should be passed via a reference or
81
+ * via closure to the outer scope of the funnel).
82
+ * @param options - An object that defines when `execute` should be invoked,
83
+ * relative to the calls of `call`. An empty/missing options object is
84
+ * equivalent to setting `minQuietPeriodMs` to `0`.
85
+ * @param options.reducer - Combines the arguments passed to `call` with the
86
+ * value computed on the previous call (or `undefined` on the first time). The
87
+ * goal of the function is to extract and summarize the data needed for
88
+ * `callback`. It should be fast and simple as it is called often and should
89
+ * defer heavy operations to the `execute` function. If the final value
90
+ * is `undefined`, `callback` will not be called.
91
+ * @param options.triggerAt - At what "edges" of the funnel's burst window
92
+ * would `execute` invoke:
93
+ * - `start` - the function will be invoked immediately (within the **same**
94
+ * execution frame!), and any subsequent calls would be ignored until the funnel
95
+ * is idle again. During this period `reducer` will also not be called.
96
+ * - `end` - the function will **not** be invoked initially but the timer will
97
+ * be started. Any calls during this time would be passed to the reducer, and
98
+ * when the timers are done, the reduced result would trigger an invocation.
99
+ * - `both` - the function will be invoked immediately, and then the funnel
100
+ * would behave as if it was in the 'end' state. @default 'end'.
101
+ * @param options.minQuietPeriodMs - The burst timer prevents subsequent calls
102
+ * in short succession to cause excessive invocations (aka "debounce"). This
103
+ * duration represents the **minimum** amount of time that needs to pass
104
+ * between calls (the "quiet" part) in order for the subsequent call to **not**
105
+ * be considered part of the burst. In other words, as long as calls are faster
106
+ * than this, they are considered part of the burst and the burst is extended.
107
+ * @param options.maxBurstDurationMs - Bursts are extended every time a call is
108
+ * made within the burst period. This means that the burst period could be
109
+ * extended indefinitely. To prevent such cases, a maximum burst duration could
110
+ * be defined. When `minQuietPeriodMs` is not defined and this option is, they
111
+ * will both share the same value.
112
+ * @param options.minGapMs - A minimum duration between calls of `execute`.
113
+ * This is maintained regardless of the shape of the burst and is ensured even
114
+ * if the `maxBurstDurationMs` is reached before it. (aka "throttle").
115
+ * @returns A funnel with a `call` function that is used to trigger invocations.
116
+ * In addition to it the funnel also comes with the following functions and
117
+ * properties:
118
+ * - `cancel` - Resets the funnel to it's initial state, discarding the current
119
+ * `reducer` result without calling `execute` on it.
120
+ * - `flush` - Triggers an invocation even if there are active timeouts, and
121
+ * then resets the funnel to it's initial state.
122
+ * - `isIdle` - Checks if there are any active timeouts.
123
+ * @signature
124
+ * P.funnel(callback, options);
125
+ * @example
126
+ * const debouncer = P.funnel(
127
+ * () => {
128
+ * console.log("Callback executed!");
129
+ * },
130
+ * { minQuietPeriodMs: 100 },
131
+ * );
132
+ * debouncer.call();
133
+ * debouncer.call();
134
+ *
135
+ * const throttle = P.funnel(
136
+ * () => {
137
+ * console.log("Callback executed!");
138
+ * },
139
+ * { minGapMs: 100, triggerAt: "start" },
140
+ * );
141
+ * throttle.call();
142
+ * throttle.call();
143
+ * @category Function
144
+ */
145
+ declare function funnel<Args extends RestArguments = [], R = never>(callback: (data: R) => void, { triggerAt, minQuietPeriodMs, maxBurstDurationMs, minGapMs, reducer, }: FunnelOptions<Args, R>): Funnel<Args>;
146
+
147
+ export { funnel };
@@ -0,0 +1,147 @@
1
+ import { RequireAtLeastOne } from 'type-fest';
2
+
3
+ type FunnelOptions<Args extends RestArguments, R> = {
4
+ readonly reducer?: (accumulator: R | undefined, ...params: Args) => R;
5
+ } & FunnelTimingOptions;
6
+ /**
7
+ * Not all combinations of timing options are valid, there are dependencies
8
+ * between them to ensure users can't configure the funnel in a way which would
9
+ * cause it to never trigger.
10
+ */
11
+ type FunnelTimingOptions = {
12
+ readonly triggerAt: 'both' | 'start';
13
+ readonly minQuietPeriodMs?: number;
14
+ readonly maxBurstDurationMs?: number;
15
+ readonly minGapMs?: number;
16
+ } | ({
17
+ readonly triggerAt?: 'end';
18
+ } & (({
19
+ readonly minGapMs: number;
20
+ } & RequireAtLeastOne<{
21
+ readonly minQuietPeriodMs: number;
22
+ readonly maxBurstDurationMs: number;
23
+ }>) | {
24
+ readonly minQuietPeriodMs?: number;
25
+ readonly maxBurstDurationMs?: number;
26
+ readonly minGapMs?: never;
27
+ }));
28
+ type RestArguments = Array<any>;
29
+ interface Funnel<Args extends RestArguments = []> {
30
+ /**
31
+ * Call the function. This might result in the `execute` function being called
32
+ * now or later, depending on it's configuration and it's current state.
33
+ *
34
+ * @param args - The args are defined by the `reducer` function.
35
+ */
36
+ readonly call: (...args: Args) => void;
37
+ /**
38
+ * Resets the funnel to it's initial state. Any calls made since the last
39
+ * invocation will be discarded.
40
+ */
41
+ readonly cancel: () => void;
42
+ /**
43
+ * Triggers an invocation regardless of the current state of the funnel.
44
+ * Like any other invocation, The funnel will also be reset to it's initial
45
+ * state afterwards.
46
+ */
47
+ readonly flush: () => void;
48
+ /**
49
+ * The funnel is in it's initial state (there are no active timeouts).
50
+ */
51
+ readonly isIdle: boolean;
52
+ }
53
+ /**
54
+ * Creates a funnel that controls the timing and execution of `callback`. Its
55
+ * main purpose is to manage multiple consecutive (usually fast-paced) calls,
56
+ * reshaping them according to a defined batching strategy and timing policy.
57
+ * This is useful when handling uncontrolled call rates, such as DOM events or
58
+ * network traffic. It can implement strategies like debouncing, throttling,
59
+ * batching, and more.
60
+ *
61
+ * An optional `reducer` function can be provided to allow passing data to the
62
+ * callback via calls to `call` (otherwise the signature of `call` takes no
63
+ * arguments).
64
+ *
65
+ * Typing is inferred from `callback`s param, and from the rest params that
66
+ * the optional `reducer` function accepts. Use **explicit** types for these
67
+ * to ensure that everything _else_ is well-typed.
68
+ *
69
+ * Notice that this function constructs a funnel **object**, and does **not**
70
+ * execute anything when called. The returned object should be used to execute
71
+ * the funnel via the its `call` method.
72
+ *
73
+ * - Debouncing: use `minQuietPeriodMs` and any `triggerAt`.
74
+ * - Throttling: use `minGapMs` and `triggerAt: "start"` or `"both"`.
75
+ * - Batching: See the reference implementation in [`funnel.reference-batch.test.ts`](https://github.com/vinicunca/perkakas/blob/main/src/funnel.reference-batch.test.ts).
76
+ *
77
+ * @param callback - The main function that would be invoked periodically based
78
+ * on `options`. The function would take the latest result of the `reducer`; if
79
+ * no calls where made since the last time it was invoked it will not be
80
+ * invoked. (If a return value is needed, it should be passed via a reference or
81
+ * via closure to the outer scope of the funnel).
82
+ * @param options - An object that defines when `execute` should be invoked,
83
+ * relative to the calls of `call`. An empty/missing options object is
84
+ * equivalent to setting `minQuietPeriodMs` to `0`.
85
+ * @param options.reducer - Combines the arguments passed to `call` with the
86
+ * value computed on the previous call (or `undefined` on the first time). The
87
+ * goal of the function is to extract and summarize the data needed for
88
+ * `callback`. It should be fast and simple as it is called often and should
89
+ * defer heavy operations to the `execute` function. If the final value
90
+ * is `undefined`, `callback` will not be called.
91
+ * @param options.triggerAt - At what "edges" of the funnel's burst window
92
+ * would `execute` invoke:
93
+ * - `start` - the function will be invoked immediately (within the **same**
94
+ * execution frame!), and any subsequent calls would be ignored until the funnel
95
+ * is idle again. During this period `reducer` will also not be called.
96
+ * - `end` - the function will **not** be invoked initially but the timer will
97
+ * be started. Any calls during this time would be passed to the reducer, and
98
+ * when the timers are done, the reduced result would trigger an invocation.
99
+ * - `both` - the function will be invoked immediately, and then the funnel
100
+ * would behave as if it was in the 'end' state. @default 'end'.
101
+ * @param options.minQuietPeriodMs - The burst timer prevents subsequent calls
102
+ * in short succession to cause excessive invocations (aka "debounce"). This
103
+ * duration represents the **minimum** amount of time that needs to pass
104
+ * between calls (the "quiet" part) in order for the subsequent call to **not**
105
+ * be considered part of the burst. In other words, as long as calls are faster
106
+ * than this, they are considered part of the burst and the burst is extended.
107
+ * @param options.maxBurstDurationMs - Bursts are extended every time a call is
108
+ * made within the burst period. This means that the burst period could be
109
+ * extended indefinitely. To prevent such cases, a maximum burst duration could
110
+ * be defined. When `minQuietPeriodMs` is not defined and this option is, they
111
+ * will both share the same value.
112
+ * @param options.minGapMs - A minimum duration between calls of `execute`.
113
+ * This is maintained regardless of the shape of the burst and is ensured even
114
+ * if the `maxBurstDurationMs` is reached before it. (aka "throttle").
115
+ * @returns A funnel with a `call` function that is used to trigger invocations.
116
+ * In addition to it the funnel also comes with the following functions and
117
+ * properties:
118
+ * - `cancel` - Resets the funnel to it's initial state, discarding the current
119
+ * `reducer` result without calling `execute` on it.
120
+ * - `flush` - Triggers an invocation even if there are active timeouts, and
121
+ * then resets the funnel to it's initial state.
122
+ * - `isIdle` - Checks if there are any active timeouts.
123
+ * @signature
124
+ * P.funnel(callback, options);
125
+ * @example
126
+ * const debouncer = P.funnel(
127
+ * () => {
128
+ * console.log("Callback executed!");
129
+ * },
130
+ * { minQuietPeriodMs: 100 },
131
+ * );
132
+ * debouncer.call();
133
+ * debouncer.call();
134
+ *
135
+ * const throttle = P.funnel(
136
+ * () => {
137
+ * console.log("Callback executed!");
138
+ * },
139
+ * { minGapMs: 100, triggerAt: "start" },
140
+ * );
141
+ * throttle.call();
142
+ * throttle.call();
143
+ * @category Function
144
+ */
145
+ declare function funnel<Args extends RestArguments = [], R = never>(callback: (data: R) => void, { triggerAt, minQuietPeriodMs, maxBurstDurationMs, minGapMs, reducer, }: FunnelOptions<Args, R>): Funnel<Args>;
146
+
147
+ export { funnel };
package/dist/funnel.js ADDED
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-AWXJSK4F.js";export{a as funnel};
@@ -0,0 +1 @@
1
+ "use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkAQRYBCA3cjs = require('./chunk-AQRYBCA3.cjs');var _chunkHC3HZK4Qcjs = require('./chunk-HC3HZK4Q.cjs');var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');var _chunkWLNQOMKLcjs = require('./chunk-WLNQOMKL.cjs');function o(e,t=0,{leading:s=!1,trailing:r=!0,maxWait:u}={}){let d,{call:h,flush:f,cancel:b}=_chunkGOUUMCT7cjs.a.call(void 0, l=>{!s&&!r||(d=e(...l))},{reducer:(l,...x)=>x,minQuietPeriodMs:t,...u!==void 0&&{maxBurstDurationMs:u},...r?s?{triggerAt:"both"}:{triggerAt:"end"}:{triggerAt:"start"}});return Object.assign((...l)=>(h(...l),d),{flush:()=>(f(),d),cancel:b})}var n=16;describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187",()=>{it("should debounce a function",async()=>{let e=vi.fn(_chunkAQRYBCA3cjs.a.call(void 0, )),t=o(e,n);expect(t("a")).toBeUndefined(),expect(t("b")).toBeUndefined(),expect(t("c")).toBeUndefined(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 4*n),expect(e).toHaveBeenCalledTimes(1),expect(t("d")).toBe("c"),expect(t("e")).toBe("c"),expect(t("f")).toBe("c"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 4*n),expect(e).toHaveBeenCalledTimes(2)}),it("subsequent debounced calls return the last `func` result",async()=>{let e=o(_chunkAQRYBCA3cjs.a.call(void 0, ),n);e("a"),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*n),expect(e("b")).not.toBe("b"),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*n),expect(e("c")).not.toBe("c")}),it("subsequent leading debounced calls return the last `func` result",async()=>{let e=o(_chunkAQRYBCA3cjs.a.call(void 0, ),n,{leading:!0,trailing:!1});expect(e("a")).toBe("a"),expect(e("b")).toBe("a"),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*n),expect(e("c")).toBe("c"),expect(e("d")).toBe("c")}),it("should invoke the trailing call with the correct arguments and `this` binding",async()=>{let e={},t=vi.fn(_chunkWLNQOMKLcjs.a.call(void 0, !1)),s=o(t,n,{maxWait:2*n});for(;_nullishCoalesce(s(e,"a"), () => (!0));)await _chunkHC3HZK4Qcjs.a.call(void 0, 0);await _chunkHC3HZK4Qcjs.a.call(void 0, 2*n),expect(t).toHaveBeenCalledTimes(2),expect(t).toHaveBeenLastCalledWith(e,"a")})});describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038",()=>{it("should reset `lastCalled` after cancelling",async()=>{let e=0,t=o(()=>(e+=1,e),n,{leading:!0});expect(t()).toBe(1),t.cancel(),expect(t()).toBe(2),t(),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*n),expect(e).toBe(3)}),it("should support flushing delayed calls",async()=>{let e=0,t=o(()=>(e+=1,e),n,{leading:!1});t(),expect(t.flush()).toBe(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*n),expect(e).toBe(1)}),it("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=vi.fn(_chunkWLNQOMKLcjs.a.call(void 0, "hello")),t=o(e,n);t.cancel(),expect(t.flush()).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*n),expect(e).toHaveBeenCalledTimes(0)})});describe("features not tested by Lodash",()=>{it("does nothing when neither leading nor trailing are enabled",async()=>{let e=o(_chunkAQRYBCA3cjs.a.call(void 0, ),n,{leading:!1,trailing:!1});expect(e("hello")).toBeUndefined(),expect(e("world")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 4*n),expect(e("goodbye")).toBeUndefined()})});
@@ -0,0 +1 @@
1
+ import{a as c}from"./chunk-46GBCFAG.js";import{a}from"./chunk-6SYP2DRD.js";import{a as p}from"./chunk-AWXJSK4F.js";import{a as i}from"./chunk-T5XG33UI.js";function o(e,t=0,{leading:s=!1,trailing:r=!0,maxWait:u}={}){let d,{call:h,flush:f,cancel:b}=p(l=>{!s&&!r||(d=e(...l))},{reducer:(l,...x)=>x,minQuietPeriodMs:t,...u!==void 0&&{maxBurstDurationMs:u},...r?s?{triggerAt:"both"}:{triggerAt:"end"}:{triggerAt:"start"}});return Object.assign((...l)=>(h(...l),d),{flush:()=>(f(),d),cancel:b})}var n=16;describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187",()=>{it("should debounce a function",async()=>{let e=vi.fn(c()),t=o(e,n);expect(t("a")).toBeUndefined(),expect(t("b")).toBeUndefined(),expect(t("c")).toBeUndefined(),expect(e).toHaveBeenCalledTimes(0),await a(4*n),expect(e).toHaveBeenCalledTimes(1),expect(t("d")).toBe("c"),expect(t("e")).toBe("c"),expect(t("f")).toBe("c"),expect(e).toHaveBeenCalledTimes(1),await a(4*n),expect(e).toHaveBeenCalledTimes(2)}),it("subsequent debounced calls return the last `func` result",async()=>{let e=o(c(),n);e("a"),await a(2*n),expect(e("b")).not.toBe("b"),await a(2*n),expect(e("c")).not.toBe("c")}),it("subsequent leading debounced calls return the last `func` result",async()=>{let e=o(c(),n,{leading:!0,trailing:!1});expect(e("a")).toBe("a"),expect(e("b")).toBe("a"),await a(2*n),expect(e("c")).toBe("c"),expect(e("d")).toBe("c")}),it("should invoke the trailing call with the correct arguments and `this` binding",async()=>{let e={},t=vi.fn(i(!1)),s=o(t,n,{maxWait:2*n});for(;s(e,"a")??!0;)await a(0);await a(2*n),expect(t).toHaveBeenCalledTimes(2),expect(t).toHaveBeenLastCalledWith(e,"a")})});describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038",()=>{it("should reset `lastCalled` after cancelling",async()=>{let e=0,t=o(()=>(e+=1,e),n,{leading:!0});expect(t()).toBe(1),t.cancel(),expect(t()).toBe(2),t(),await a(2*n),expect(e).toBe(3)}),it("should support flushing delayed calls",async()=>{let e=0,t=o(()=>(e+=1,e),n,{leading:!1});t(),expect(t.flush()).toBe(1),await a(2*n),expect(e).toBe(1)}),it("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=vi.fn(i("hello")),t=o(e,n);t.cancel(),expect(t.flush()).toBeUndefined(),await a(2*n),expect(e).toHaveBeenCalledTimes(0)})});describe("features not tested by Lodash",()=>{it("does nothing when neither leading nor trailing are enabled",async()=>{let e=o(c(),n,{leading:!1,trailing:!1});expect(e("hello")).toBeUndefined(),expect(e("world")).toBeUndefined(),await a(4*n),expect(e("goodbye")).toBeUndefined()})});
@@ -0,0 +1 @@
1
+ "use strict";var _chunkHC3HZK4Qcjs = require('./chunk-HC3HZK4Q.cjs');var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');function i(e,t=0,{leading:o=!1,trailing:s=!0,maxWait:c}={}){let{call:m,isIdle:v,...r}=_chunkGOUUMCT7cjs.a.call(void 0, d=>{!s&&!o||e(...d)},{reducer:(d,...p)=>p,minQuietPeriodMs:t,...c!==void 0&&{maxBurstDurationMs:c},...s?o?{triggerAt:"both"}:{triggerAt:"end"}:{triggerAt:"start"}});return Object.assign(m,r)}var a=16;describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187",()=>{it("should debounce a function",async()=>{let e=vi.fn(),t=i(e,a);t("a"),t("b"),t("c"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 4*a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenCalledWith("c"),t("d"),t("e"),t("f"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 4*a),expect(e).toHaveBeenCalledTimes(2)}),it("should not immediately call `func` when `wait` is `0`",async()=>{let e=vi.fn(),t=i(e,0);t(),t(),expect(e).toHaveBeenCalledTimes(0),await l(),expect(e).toHaveBeenCalledTimes(1)}),it("should apply default options",async()=>{let e=vi.fn();i(e,a,{})(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(1)}),it("should support a `leading` option",async()=>{let e=vi.fn(),t=vi.fn(),o=i(e,a,{leading:!0,trailing:!1}),s=i(t,a,{leading:!0,trailing:!0});o(),expect(e).toHaveBeenCalledTimes(1),s(),s(),expect(t).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(1),expect(t).toHaveBeenCalledTimes(2),o(),expect(e).toHaveBeenCalledTimes(2)}),it("should support a `trailing` option",async()=>{let e=vi.fn(),t=vi.fn(),o=i(e,a,{trailing:!0}),s=i(t,a,{trailing:!1});o(),expect(e).toHaveBeenCalledTimes(0),s(),expect(t).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(1),expect(t).toHaveBeenCalledTimes(0)}),it("should support a `maxWait` option",async()=>{let e=vi.fn(),t=i(e,a,{maxWait:2*a});t(),t(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 4*a),expect(e).toHaveBeenCalledTimes(1),t(),t(),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 4*a),expect(e).toHaveBeenCalledTimes(2)}),it("should support `maxWait` in a tight loop",async()=>{let e=vi.fn(),t=vi.fn(),o=i(e,2*a,{maxWait:4*a}),s=i(t,3*a),c=Date.now()+10*a;for(;Date.now()<c;)o(),s();expect(t).toHaveBeenCalledTimes(0),expect(e).toHaveBeenCalledTimes(0),await l(),expect(t).toHaveBeenCalledTimes(0),expect(e).toHaveBeenCalledTimes(1)}),it("should queue a trailing call for subsequent debounced calls after `maxWait`",async()=>{let e=vi.fn(),t=i(e,6*a,{maxWait:6*a});t(),await _chunkHC3HZK4Qcjs.a.call(void 0, 5.5*a),t(),await _chunkHC3HZK4Qcjs.a.call(void 0, .5*a),t(),await _chunkHC3HZK4Qcjs.a.call(void 0, .5*a),t(),await _chunkHC3HZK4Qcjs.a.call(void 0, 9.5*a),expect(e).toHaveBeenCalledTimes(2)}),it("should cancel `maxDelayed` when `delayed` is invoked",async()=>{let e=vi.fn(),t=i(e,a,{maxWait:2*a});t(),await _chunkHC3HZK4Qcjs.a.call(void 0, 4*a),t(),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(2)}),it("should invoke the trailing call with the correct arguments and `this` binding",async()=>{let e=vi.fn(),t={},o=i(e,a,{leading:!0,maxWait:2*a});for(;e.mock.calls.length<2;)o(t,"a"),await l();await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(t,"a")})});describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038",()=>{it("should use a default `wait` of `0`",async()=>{let e=vi.fn(),t=i(e);t(),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t(),expect(e).toHaveBeenCalledTimes(1)}),it("supports recursive calls",async()=>{let e=[],t=["a","b","c"],o=i(s=>{e.push(s);let c=t.shift();c!==void 0&&o(c)},a);o(t.shift()),expect(e).toStrictEqual([]),await _chunkHC3HZK4Qcjs.a.call(void 0, 8*a),expect(e).toStrictEqual(["a","b","c"])}),it("should support cancelling delayed calls",async()=>{let e=vi.fn(),t=i(e,a,{leading:!1});t(),t.cancel(),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(0)}),it("should reset `lastCalled` after cancelling",async()=>{let e=vi.fn(),t=i(e,a,{leading:!0});t(),expect(e).toHaveBeenCalledTimes(1),t.cancel(),t(),expect(e).toHaveBeenCalledTimes(2),t(),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(3)}),it("should support flushing delayed calls",async()=>{let e=vi.fn(),t=i(e,a,{leading:!1});t(),t.flush(),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(1)}),it("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=vi.fn(),t=i(e,a);t.cancel(),t.flush(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(0)})});var l=async()=>await _chunkHC3HZK4Qcjs.a.call(void 0, 0);
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ import{a as n}from"./chunk-6SYP2DRD.js";import{a as u}from"./chunk-AWXJSK4F.js";function i(e,t=0,{leading:o=!1,trailing:s=!0,maxWait:c}={}){let{call:m,isIdle:v,...r}=u(d=>{!s&&!o||e(...d)},{reducer:(d,...p)=>p,minQuietPeriodMs:t,...c!==void 0&&{maxBurstDurationMs:c},...s?o?{triggerAt:"both"}:{triggerAt:"end"}:{triggerAt:"start"}});return Object.assign(m,r)}var a=16;describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187",()=>{it("should debounce a function",async()=>{let e=vi.fn(),t=i(e,a);t("a"),t("b"),t("c"),expect(e).toHaveBeenCalledTimes(0),await n(4*a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenCalledWith("c"),t("d"),t("e"),t("f"),expect(e).toHaveBeenCalledTimes(1),await n(4*a),expect(e).toHaveBeenCalledTimes(2)}),it("should not immediately call `func` when `wait` is `0`",async()=>{let e=vi.fn(),t=i(e,0);t(),t(),expect(e).toHaveBeenCalledTimes(0),await l(),expect(e).toHaveBeenCalledTimes(1)}),it("should apply default options",async()=>{let e=vi.fn();i(e,a,{})(),expect(e).toHaveBeenCalledTimes(0),await n(2*a),expect(e).toHaveBeenCalledTimes(1)}),it("should support a `leading` option",async()=>{let e=vi.fn(),t=vi.fn(),o=i(e,a,{leading:!0,trailing:!1}),s=i(t,a,{leading:!0,trailing:!0});o(),expect(e).toHaveBeenCalledTimes(1),s(),s(),expect(t).toHaveBeenCalledTimes(1),await n(2*a),expect(e).toHaveBeenCalledTimes(1),expect(t).toHaveBeenCalledTimes(2),o(),expect(e).toHaveBeenCalledTimes(2)}),it("should support a `trailing` option",async()=>{let e=vi.fn(),t=vi.fn(),o=i(e,a,{trailing:!0}),s=i(t,a,{trailing:!1});o(),expect(e).toHaveBeenCalledTimes(0),s(),expect(t).toHaveBeenCalledTimes(0),await n(2*a),expect(e).toHaveBeenCalledTimes(1),expect(t).toHaveBeenCalledTimes(0)}),it("should support a `maxWait` option",async()=>{let e=vi.fn(),t=i(e,a,{maxWait:2*a});t(),t(),expect(e).toHaveBeenCalledTimes(0),await n(4*a),expect(e).toHaveBeenCalledTimes(1),t(),t(),expect(e).toHaveBeenCalledTimes(1),await n(4*a),expect(e).toHaveBeenCalledTimes(2)}),it("should support `maxWait` in a tight loop",async()=>{let e=vi.fn(),t=vi.fn(),o=i(e,2*a,{maxWait:4*a}),s=i(t,3*a),c=Date.now()+10*a;for(;Date.now()<c;)o(),s();expect(t).toHaveBeenCalledTimes(0),expect(e).toHaveBeenCalledTimes(0),await l(),expect(t).toHaveBeenCalledTimes(0),expect(e).toHaveBeenCalledTimes(1)}),it("should queue a trailing call for subsequent debounced calls after `maxWait`",async()=>{let e=vi.fn(),t=i(e,6*a,{maxWait:6*a});t(),await n(5.5*a),t(),await n(.5*a),t(),await n(.5*a),t(),await n(9.5*a),expect(e).toHaveBeenCalledTimes(2)}),it("should cancel `maxDelayed` when `delayed` is invoked",async()=>{let e=vi.fn(),t=i(e,a,{maxWait:2*a});t(),await n(4*a),t(),expect(e).toHaveBeenCalledTimes(1),await n(2*a),expect(e).toHaveBeenCalledTimes(2)}),it("should invoke the trailing call with the correct arguments and `this` binding",async()=>{let e=vi.fn(),t={},o=i(e,a,{leading:!0,maxWait:2*a});for(;e.mock.calls.length<2;)o(t,"a"),await l();await n(2*a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(t,"a")})});describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038",()=>{it("should use a default `wait` of `0`",async()=>{let e=vi.fn(),t=i(e);t(),await n(a),t(),expect(e).toHaveBeenCalledTimes(1)}),it("supports recursive calls",async()=>{let e=[],t=["a","b","c"],o=i(s=>{e.push(s);let c=t.shift();c!==void 0&&o(c)},a);o(t.shift()),expect(e).toStrictEqual([]),await n(8*a),expect(e).toStrictEqual(["a","b","c"])}),it("should support cancelling delayed calls",async()=>{let e=vi.fn(),t=i(e,a,{leading:!1});t(),t.cancel(),await n(2*a),expect(e).toHaveBeenCalledTimes(0)}),it("should reset `lastCalled` after cancelling",async()=>{let e=vi.fn(),t=i(e,a,{leading:!0});t(),expect(e).toHaveBeenCalledTimes(1),t.cancel(),t(),expect(e).toHaveBeenCalledTimes(2),t(),await n(2*a),expect(e).toHaveBeenCalledTimes(3)}),it("should support flushing delayed calls",async()=>{let e=vi.fn(),t=i(e,a,{leading:!1});t(),t.flush(),expect(e).toHaveBeenCalledTimes(1),await n(2*a),expect(e).toHaveBeenCalledTimes(1)}),it("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=vi.fn(),t=i(e,a);t.cancel(),t.flush(),expect(e).toHaveBeenCalledTimes(0),await n(2*a),expect(e).toHaveBeenCalledTimes(0)})});var l=async()=>await n(0);
@@ -0,0 +1 @@
1
+ "use strict";var _chunkAQRYBCA3cjs = require('./chunk-AQRYBCA3.cjs');var _chunkHC3HZK4Qcjs = require('./chunk-HC3HZK4Q.cjs');var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');var _chunkWLNQOMKLcjs = require('./chunk-WLNQOMKL.cjs');function o(e,t=0,{leading:a=!0,trailing:i=!0}={}){let c,{call:h,flush:p,cancel:f}=_chunkGOUUMCT7cjs.a.call(void 0, r=>{!a&&!i||(c=e(...r))},{reducer:(r,...g)=>g,minQuietPeriodMs:t,maxBurstDurationMs:t,...i?a?{triggerAt:"both"}:{triggerAt:"end"}:{triggerAt:"start"}});return Object.assign((...r)=>(h(...r),c),{flush:()=>(p(),c),cancel:f})}var n=16;describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768",()=>{it("subsequent calls should return the result of the first call",async()=>{let e=o(_chunkAQRYBCA3cjs.a.call(void 0, ),n);expect(e("a")).toBe("a"),expect(e("b")).toBe("a"),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*n);let t=e("c"),a=e("d");expect(t).not.toBe("a"),expect(t).toBeDefined(),expect(a).not.toBe("d"),expect(a).toBeDefined()}),it("should support a `leading` option",()=>{let e=o(_chunkAQRYBCA3cjs.a.call(void 0, ),n,{leading:!0}),t=o(_chunkAQRYBCA3cjs.a.call(void 0, ),n,{leading:!1});expect(e("a")).toBe("a"),expect(t("a")).toBeUndefined()}),it("should support a `trailing` option",async()=>{let e=vi.fn(_chunkAQRYBCA3cjs.a.call(void 0, )),t=vi.fn(_chunkAQRYBCA3cjs.a.call(void 0, )),a=o(e,2*n,{trailing:!0}),i=o(t,2*n,{trailing:!1});expect(a("a")).toBe("a"),expect(a("b")).toBe("a"),expect(i("a")).toBe("a"),expect(i("b")).toBe("a"),await _chunkHC3HZK4Qcjs.a.call(void 0, 8*n),expect(e).toHaveBeenCalledTimes(2),expect(t).toHaveBeenCalledTimes(1)})});describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038",()=>{it("should reset `lastCalled` after cancelling",async()=>{let e=0,t=o(()=>(e+=1,e),n,{leading:!0});expect(t()).toBe(1),t.cancel(),expect(t()).toBe(2),t(),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*n),expect(e).toBe(3)}),it("should support flushing delayed calls",async()=>{let e=0,t=o(()=>(e+=1,e),n,{leading:!1});t(),expect(t.flush()).toBe(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*n),expect(e).toBe(1)}),it("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=vi.fn(_chunkWLNQOMKLcjs.a.call(void 0, "hello")),t=o(e,n);t.cancel(),expect(t.flush()).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*n),expect(e).toHaveBeenCalledTimes(0)})});describe("features not tested by Lodash",()=>{it("does nothing when neither leading nor trailing are enabled",async()=>{let e=o(_chunkAQRYBCA3cjs.a.call(void 0, ),n,{leading:!1,trailing:!1});expect(e("hello")).toBeUndefined(),expect(e("world")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 4*n),expect(e("goodbye")).toBeUndefined()})});
@@ -0,0 +1 @@
1
+ import{a as l}from"./chunk-46GBCFAG.js";import{a as s}from"./chunk-6SYP2DRD.js";import{a as u}from"./chunk-AWXJSK4F.js";import{a as d}from"./chunk-T5XG33UI.js";function o(e,t=0,{leading:a=!0,trailing:i=!0}={}){let c,{call:h,flush:p,cancel:f}=u(r=>{!a&&!i||(c=e(...r))},{reducer:(r,...g)=>g,minQuietPeriodMs:t,maxBurstDurationMs:t,...i?a?{triggerAt:"both"}:{triggerAt:"end"}:{triggerAt:"start"}});return Object.assign((...r)=>(h(...r),c),{flush:()=>(p(),c),cancel:f})}var n=16;describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768",()=>{it("subsequent calls should return the result of the first call",async()=>{let e=o(l(),n);expect(e("a")).toBe("a"),expect(e("b")).toBe("a"),await s(2*n);let t=e("c"),a=e("d");expect(t).not.toBe("a"),expect(t).toBeDefined(),expect(a).not.toBe("d"),expect(a).toBeDefined()}),it("should support a `leading` option",()=>{let e=o(l(),n,{leading:!0}),t=o(l(),n,{leading:!1});expect(e("a")).toBe("a"),expect(t("a")).toBeUndefined()}),it("should support a `trailing` option",async()=>{let e=vi.fn(l()),t=vi.fn(l()),a=o(e,2*n,{trailing:!0}),i=o(t,2*n,{trailing:!1});expect(a("a")).toBe("a"),expect(a("b")).toBe("a"),expect(i("a")).toBe("a"),expect(i("b")).toBe("a"),await s(8*n),expect(e).toHaveBeenCalledTimes(2),expect(t).toHaveBeenCalledTimes(1)})});describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038",()=>{it("should reset `lastCalled` after cancelling",async()=>{let e=0,t=o(()=>(e+=1,e),n,{leading:!0});expect(t()).toBe(1),t.cancel(),expect(t()).toBe(2),t(),await s(2*n),expect(e).toBe(3)}),it("should support flushing delayed calls",async()=>{let e=0,t=o(()=>(e+=1,e),n,{leading:!1});t(),expect(t.flush()).toBe(1),await s(2*n),expect(e).toBe(1)}),it("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=vi.fn(d("hello")),t=o(e,n);t.cancel(),expect(t.flush()).toBeUndefined(),await s(2*n),expect(e).toHaveBeenCalledTimes(0)})});describe("features not tested by Lodash",()=>{it("does nothing when neither leading nor trailing are enabled",async()=>{let e=o(l(),n,{leading:!1,trailing:!1});expect(e("hello")).toBeUndefined(),expect(e("world")).toBeUndefined(),await s(4*n),expect(e("goodbye")).toBeUndefined()})});
@@ -0,0 +1 @@
1
+ "use strict";var _chunkHC3HZK4Qcjs = require('./chunk-HC3HZK4Q.cjs');var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');function l(e,t=0,{leading:o=!0,trailing:s=!0}={}){let{call:i,isIdle:u,...r}=_chunkGOUUMCT7cjs.a.call(void 0, c=>{!o&&!s||e(...c)},{reducer:(c,...h)=>h,minQuietPeriodMs:t,maxBurstDurationMs:t,...s?o?{triggerAt:"both"}:{triggerAt:"end"}:{triggerAt:"start"}});return Object.assign(i,r)}var a=16;describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768",()=>{it("should throttle a function",async()=>{let e=vi.fn(),t=l(e,a);t(),t(),t();let o=e.mock.calls.length;expect(o).toBeGreaterThan(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e.mock.calls.length).toBeGreaterThan(o)}),it("should clear timeout when `func` is called",async()=>{let e=vi.fn(),t=l(e,a);t(),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),t(),expect(e).toHaveBeenCalledTimes(2)}),it("should not trigger a trailing call when invoked once",async()=>{let e=vi.fn();l(e,a)(),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(1)}),it("should trigger a call when invoked repeatedly",()=>{let e=vi.fn(),t=l(e,a),o=Date.now()+10*a;for(;Date.now()<o;)t();expect(e).toHaveBeenCalledWith()}),it("should trigger a call when invoked repeatedly and `leading` is `false`",async()=>{let e=vi.fn(),t=l(e,a,{leading:!1}),o=Date.now()+10*a;for(;Date.now()<o;)t();await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledWith()}),it("should trigger a second throttled call as soon as possible",async()=>{let e=vi.fn(),t=l(e,4*a,{leading:!1});t(),await _chunkHC3HZK4Qcjs.a.call(void 0, 6*a),expect(e).toHaveBeenCalledTimes(1),t(),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 4*a),expect(e).toHaveBeenCalledTimes(2)}),it("should apply default options",async()=>{let e=vi.fn(),t=l(e,a,{});t(),t(),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 4*a),expect(e).toHaveBeenCalledTimes(2)}),it("should support a `leading` option",()=>{let e=vi.fn(),t=vi.fn(),o=l(e,a,{leading:!0}),s=l(t,a,{leading:!1});o(),s(),expect(e).toHaveBeenCalledTimes(1),expect(t).toHaveBeenCalledTimes(0)}),it("should support a `trailing` option",async()=>{let e=vi.fn(),t=vi.fn(),o=l(e,2*a,{trailing:!0}),s=l(t,2*a,{trailing:!1});o("a"),o("b"),s("a"),s("b"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenCalledWith("a"),expect(t).toHaveBeenCalledTimes(1),expect(t).toHaveBeenCalledWith("a"),await _chunkHC3HZK4Qcjs.a.call(void 0, 8*a),expect(e).toHaveBeenCalledTimes(2),expect(t).toHaveBeenCalledTimes(1)}),it("should not update `lastCalled`, at the end of the timeout, when `trailing` is `false`",async()=>{let e=vi.fn(),t=l(e,64,{trailing:!1});t(),t(),await _chunkHC3HZK4Qcjs.a.call(void 0, 3*a),t(),t(),await _chunkHC3HZK4Qcjs.a.call(void 0, 3*a),expect(e).toHaveBeenCalledWith()})});describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038",()=>{it("should use a default `wait` of `0`",async()=>{let e=vi.fn(),t=l(e);t(),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t(),expect(e).toHaveBeenCalledTimes(2)}),it("supports recursive calls",async()=>{let e=[],t=["a","b","c"],o=l(s=>{e.push(s);let i=t.shift();i!==void 0&&o(i)},a);o(t.shift()),expect(e).toStrictEqual(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 8*a),expect(e).toStrictEqual(["a","b","c"])}),it("should support cancelling delayed calls",async()=>{let e=vi.fn(),t=l(e,a,{leading:!1});t(),t.cancel(),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(0)}),it("should reset `lastCalled` after cancelling",async()=>{let e=vi.fn(),t=l(e,a,{leading:!0});t(),expect(e).toHaveBeenCalledTimes(1),t.cancel(),t(),expect(e).toHaveBeenCalledTimes(2),t(),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(3)}),it("should support flushing delayed calls",async()=>{let e=vi.fn(),t=l(e,a,{leading:!1});t(),t.flush(),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(1)}),it("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=vi.fn(),t=l(e,a);t.cancel(),t.flush(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(0)})});describe("not tested by Lodash",()=>{it("should do nothing when `leading` and `trailing` are both `disabled`",async()=>{let e=vi.fn(),t=l(e,a,{leading:!1,trailing:!1});t(),t(),t(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(0)})});
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ import{a as n}from"./chunk-6SYP2DRD.js";import{a as d}from"./chunk-AWXJSK4F.js";function l(e,t=0,{leading:o=!0,trailing:s=!0}={}){let{call:i,isIdle:u,...r}=d(c=>{!o&&!s||e(...c)},{reducer:(c,...h)=>h,minQuietPeriodMs:t,maxBurstDurationMs:t,...s?o?{triggerAt:"both"}:{triggerAt:"end"}:{triggerAt:"start"}});return Object.assign(i,r)}var a=16;describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768",()=>{it("should throttle a function",async()=>{let e=vi.fn(),t=l(e,a);t(),t(),t();let o=e.mock.calls.length;expect(o).toBeGreaterThan(0),await n(2*a),expect(e.mock.calls.length).toBeGreaterThan(o)}),it("should clear timeout when `func` is called",async()=>{let e=vi.fn(),t=l(e,a);t(),expect(e).toHaveBeenCalledTimes(1),await n(2*a),t(),expect(e).toHaveBeenCalledTimes(2)}),it("should not trigger a trailing call when invoked once",async()=>{let e=vi.fn();l(e,a)(),expect(e).toHaveBeenCalledTimes(1),await n(2*a),expect(e).toHaveBeenCalledTimes(1)}),it("should trigger a call when invoked repeatedly",()=>{let e=vi.fn(),t=l(e,a),o=Date.now()+10*a;for(;Date.now()<o;)t();expect(e).toHaveBeenCalledWith()}),it("should trigger a call when invoked repeatedly and `leading` is `false`",async()=>{let e=vi.fn(),t=l(e,a,{leading:!1}),o=Date.now()+10*a;for(;Date.now()<o;)t();await n(0),expect(e).toHaveBeenCalledWith()}),it("should trigger a second throttled call as soon as possible",async()=>{let e=vi.fn(),t=l(e,4*a,{leading:!1});t(),await n(6*a),expect(e).toHaveBeenCalledTimes(1),t(),await n(2*a),expect(e).toHaveBeenCalledTimes(1),await n(4*a),expect(e).toHaveBeenCalledTimes(2)}),it("should apply default options",async()=>{let e=vi.fn(),t=l(e,a,{});t(),t(),expect(e).toHaveBeenCalledTimes(1),await n(4*a),expect(e).toHaveBeenCalledTimes(2)}),it("should support a `leading` option",()=>{let e=vi.fn(),t=vi.fn(),o=l(e,a,{leading:!0}),s=l(t,a,{leading:!1});o(),s(),expect(e).toHaveBeenCalledTimes(1),expect(t).toHaveBeenCalledTimes(0)}),it("should support a `trailing` option",async()=>{let e=vi.fn(),t=vi.fn(),o=l(e,2*a,{trailing:!0}),s=l(t,2*a,{trailing:!1});o("a"),o("b"),s("a"),s("b"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenCalledWith("a"),expect(t).toHaveBeenCalledTimes(1),expect(t).toHaveBeenCalledWith("a"),await n(8*a),expect(e).toHaveBeenCalledTimes(2),expect(t).toHaveBeenCalledTimes(1)}),it("should not update `lastCalled`, at the end of the timeout, when `trailing` is `false`",async()=>{let e=vi.fn(),t=l(e,64,{trailing:!1});t(),t(),await n(3*a),t(),t(),await n(3*a),expect(e).toHaveBeenCalledWith()})});describe("https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038",()=>{it("should use a default `wait` of `0`",async()=>{let e=vi.fn(),t=l(e);t(),await n(a),t(),expect(e).toHaveBeenCalledTimes(2)}),it("supports recursive calls",async()=>{let e=[],t=["a","b","c"],o=l(s=>{e.push(s);let i=t.shift();i!==void 0&&o(i)},a);o(t.shift()),expect(e).toStrictEqual(["a"]),await n(8*a),expect(e).toStrictEqual(["a","b","c"])}),it("should support cancelling delayed calls",async()=>{let e=vi.fn(),t=l(e,a,{leading:!1});t(),t.cancel(),await n(2*a),expect(e).toHaveBeenCalledTimes(0)}),it("should reset `lastCalled` after cancelling",async()=>{let e=vi.fn(),t=l(e,a,{leading:!0});t(),expect(e).toHaveBeenCalledTimes(1),t.cancel(),t(),expect(e).toHaveBeenCalledTimes(2),t(),await n(2*a),expect(e).toHaveBeenCalledTimes(3)}),it("should support flushing delayed calls",async()=>{let e=vi.fn(),t=l(e,a,{leading:!1});t(),t.flush(),expect(e).toHaveBeenCalledTimes(1),await n(2*a),expect(e).toHaveBeenCalledTimes(1)}),it("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=vi.fn(),t=l(e,a);t.cancel(),t.flush(),expect(e).toHaveBeenCalledTimes(0),await n(2*a),expect(e).toHaveBeenCalledTimes(0)})});describe("not tested by Lodash",()=>{it("should do nothing when `leading` and `trailing` are both `disabled`",async()=>{let e=vi.fn(),t=l(e,a,{leading:!1,trailing:!1});t(),t(),t(),expect(e).toHaveBeenCalledTimes(0),await n(2*a),expect(e).toHaveBeenCalledTimes(0)})});
@@ -0,0 +1 @@
1
+ "use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkDOH2U2KJcjs = require('./chunk-DOH2U2KJ.cjs');var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');var _chunkWYRK6YJUcjs = require('./chunk-WYRK6YJU.cjs');require('./chunk-4MAOF3ZP.cjs');require('./chunk-4YUDBZFA.cjs');function i(e,a,n=0){let l=_chunkGOUUMCT7cjs.a.call(void 0, s=>{e(s.map(({params:t})=>t)).then(t=>{for(let[o,{params:r,promiseCallbacks:[c]}]of s.entries()){let y=a(t,o,...r);c(y)}}).catch(t=>{for(let{promiseCallbacks:[,o]}of s)o(t)})},{reducer:(s,t)=>[..._nullishCoalesce(s, () => ([])),t],maxBurstDurationMs:n,triggerAt:"end"});return{...l,call:async(...s)=>new Promise((...t)=>{l.call({promiseCallbacks:t,params:s})})}}describe("showcase",()=>{it("results as object",async()=>{let e=vi.fn(async o=>_chunkDOH2U2KJcjs.a.call(void 0, o,r=>r.length)),a=i(async o=>await e(o.flat()),(o,r,c)=>o[c]),n=[a.call("short"),a.call("medium"),a.call("loooooooooooooong")];expect(e).toHaveBeenCalledTimes(0);let[l,s,t]=await Promise.all(n);expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["short","medium","loooooooooooooong"]),expect(e).toHaveLastResolvedWith({short:5,medium:6,loooooooooooooong:17}),expect(l).toBe(5),expect(s).toBe(6),expect(t).toBe(17)}),it("results as array",async()=>{let e=vi.fn(async o=>o.map(r=>r.length)),a=i(async o=>await e(o.flat()),(o,r)=>o[r]),n=[a.call("short"),a.call("medium"),a.call("loooooooooooooong")];expect(e).toHaveBeenCalledTimes(0);let[l,s,t]=await Promise.all(n);expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["short","medium","loooooooooooooong"]),expect(e).toHaveLastResolvedWith([5,6,17]),expect(l).toBe(5),expect(s).toBe(6),expect(t).toBe(17)}),it("error handling",async()=>{let e=i(async a=>{if(a.length>1)throw new Error(`Batch too big! ${JSON.stringify(a)}`)},_chunkWYRK6YJUcjs.a.call(void 0, ));await expect(e.call("a")).resolves.toBeUndefined(),await expect(Promise.all([e.call("hello"),e.call("world")])).rejects.toThrow('Batch too big! [["hello"],["world"]]')})});
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ import{a as d}from"./chunk-AX5O7BNT.js";import{a as p}from"./chunk-AWXJSK4F.js";import{a as m}from"./chunk-AFO7BV2X.js";import"./chunk-ENYMRDJU.js";import"./chunk-K2EX7PYH.js";function i(e,a,n=0){let l=p(s=>{e(s.map(({params:t})=>t)).then(t=>{for(let[o,{params:r,promiseCallbacks:[c]}]of s.entries()){let y=a(t,o,...r);c(y)}}).catch(t=>{for(let{promiseCallbacks:[,o]}of s)o(t)})},{reducer:(s,t)=>[...s??[],t],maxBurstDurationMs:n,triggerAt:"end"});return{...l,call:async(...s)=>new Promise((...t)=>{l.call({promiseCallbacks:t,params:s})})}}describe("showcase",()=>{it("results as object",async()=>{let e=vi.fn(async o=>d(o,r=>r.length)),a=i(async o=>await e(o.flat()),(o,r,c)=>o[c]),n=[a.call("short"),a.call("medium"),a.call("loooooooooooooong")];expect(e).toHaveBeenCalledTimes(0);let[l,s,t]=await Promise.all(n);expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["short","medium","loooooooooooooong"]),expect(e).toHaveLastResolvedWith({short:5,medium:6,loooooooooooooong:17}),expect(l).toBe(5),expect(s).toBe(6),expect(t).toBe(17)}),it("results as array",async()=>{let e=vi.fn(async o=>o.map(r=>r.length)),a=i(async o=>await e(o.flat()),(o,r)=>o[r]),n=[a.call("short"),a.call("medium"),a.call("loooooooooooooong")];expect(e).toHaveBeenCalledTimes(0);let[l,s,t]=await Promise.all(n);expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["short","medium","loooooooooooooong"]),expect(e).toHaveLastResolvedWith([5,6,17]),expect(l).toBe(5),expect(s).toBe(6),expect(t).toBe(17)}),it("error handling",async()=>{let e=i(async a=>{if(a.length>1)throw new Error(`Batch too big! ${JSON.stringify(a)}`)},m());await expect(e.call("a")).resolves.toBeUndefined(),await expect(Promise.all([e.call("hello"),e.call("world")])).rejects.toThrow('Batch too big! [["hello"],["world"]]')})});
@@ -0,0 +1 @@
1
+ "use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkAQRYBCA3cjs = require('./chunk-AQRYBCA3.cjs');var _chunkHC3HZK4Qcjs = require('./chunk-HC3HZK4Q.cjs');var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');function n(e,{timing:t,waitMs:l,maxWaitMs:i}){if(i!==void 0&&l!==void 0&&i<l)throw new Error(`debounce: maxWaitMs (${i.toString()}) cannot be less than waitMs (${l.toString()})`);let o,s=_chunkGOUUMCT7cjs.a.call(void 0, d=>{o=e(...d)},{reducer:(d,...u)=>u,minQuietPeriodMs:_nullishCoalesce(_nullishCoalesce(l, () => (i)), () => (0)),...i!==void 0&&{maxBurstDurationMs:i},...t==="leading"?{triggerAt:"start"}:t==="both"?{triggerAt:"both"}:{triggerAt:"end"}});return{call:(...d)=>(s.call(...d),o),flush:()=>(s.flush(),o),cancel:()=>{s.cancel()},get isPending(){return!s.isIdle},get cachedValue(){return o}}}describe("main functionality",()=>{it("should debounce a function",async()=>{let e=vi.fn(_chunkAQRYBCA3cjs.a.call(void 0, )),t=n(e,{waitMs:32});expect([t.call("a"),t.call("b"),t.call("c")]).toStrictEqual([void 0,void 0,void 0]),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 128),expect(e).toHaveBeenCalledTimes(1),expect([t.call("d"),t.call("e"),t.call("f")]).toStrictEqual(["c","c","c"]),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 256),expect(e).toHaveBeenCalledTimes(2)}),it("subsequent debounced calls return the last `func` result",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});e.call("a"),await _chunkHC3HZK4Qcjs.a.call(void 0, 64),expect(e.call("b")).toBe("a"),await _chunkHC3HZK4Qcjs.a.call(void 0, 128),expect(e.call("c")).toBe("b")}),it("should not immediately call `func` when `wait` is `0`",async()=>{let e=vi.fn(),t=n(e,{});t.call(),t.call(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 5),expect(e).toHaveBeenCalledTimes(1)}),it("should apply default options",async()=>{let e=vi.fn();n(e,{waitMs:32}).call(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 64),expect(e).toHaveBeenCalledTimes(1)}),it("should support a `leading` option",async()=>{let e=vi.fn(),t=vi.fn(),l=n(e,{waitMs:32,timing:"leading"});l.call(),expect(e).toHaveBeenCalledTimes(1);let i=n(t,{waitMs:32,timing:"both"});i.call(),i.call(),expect(t).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 64),expect(t).toHaveBeenCalledTimes(2),l.call(),expect(e).toHaveBeenCalledTimes(2)}),it("subsequent leading debounced calls return the last `func` result",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32,timing:"leading"});expect([e.call("a"),e.call("b")]).toStrictEqual(["a","a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 64),expect([e.call("c"),e.call("d")]).toStrictEqual(["c","c"])}),it("should support a `trailing` option",async()=>{let e=vi.fn();n(e,{waitMs:32,timing:"trailing"}).call(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 64),expect(e).toHaveBeenCalledTimes(1)})});describe("optional param maxWaitMs",()=>{it("should support a `maxWait` option",async()=>{let e=vi.fn(_chunkAQRYBCA3cjs.a.call(void 0, )),t=n(e,{waitMs:32,maxWaitMs:64});t.call("a"),t.call("b"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 128),expect(e).toHaveBeenCalledTimes(1),t.call("c"),t.call("d"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 256),expect(e).toHaveBeenCalledTimes(2)}),it("should support `maxWait` in a tight loop",async()=>{let e=vi.fn(),t=vi.fn(),l=n(e,{waitMs:32,maxWaitMs:128}),i=n(t,{waitMs:96}),o=Date.now();for(;Date.now()-o<320;)l.call(),i.call();await _chunkHC3HZK4Qcjs.a.call(void 0, 1),expect(t).toHaveBeenCalledTimes(0),expect(e).not.toHaveBeenCalledTimes(0)}),it("should queue a trailing call for subsequent debounced calls after `maxWait`",async()=>{let e=vi.fn(),t=n(e,{waitMs:200,maxWaitMs:200});t.call(),setTimeout(()=>{t.call()},190),setTimeout(()=>{t.call()},200),setTimeout(()=>{t.call()},210),await _chunkHC3HZK4Qcjs.a.call(void 0, 500),expect(e).toHaveBeenCalledTimes(2)}),it("should cancel `maxDelayed` when `delayed` is invoked",async()=>{let e=vi.fn(),t=n(e,{waitMs:32,maxWaitMs:64});t.call(),await _chunkHC3HZK4Qcjs.a.call(void 0, 128),t.call(),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 192),expect(e).toHaveBeenCalledTimes(2)}),it("works like a leaky bucket when only maxWaitMs is set",async()=>{let e=vi.fn(),t=n(e,{maxWaitMs:32});t.call(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 16),t.call(),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 17),expect(e).toHaveBeenCalledTimes(1)})});describe("additional functionality",()=>{it("can cancel before the timer starts",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});expect(()=>{e.cancel()}).not.toThrow(),expect(e.call("hello")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.call("world")).toBe("hello")}),it("can cancel the timer",async()=>{let e="Hello, World!",t=vi.fn(()=>e),l=n(t,{waitMs:32});expect(l.call()).toBeUndefined(),expect(t).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 1),expect(l.call()).toBeUndefined(),expect(t).toHaveBeenCalledTimes(0),l.cancel(),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(l.call()).toBeUndefined(),expect(t).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(l.call()).toStrictEqual(e),expect(t).toHaveBeenCalledTimes(1)}),it("can cancel after the timer ends",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});expect(e.call("hello")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.call("world")).toBe("hello"),expect(()=>{e.cancel()}).not.toThrow()}),it("can cancel maxWait timer",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:16,maxWaitMs:32});expect(e.call("hello")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 1),e.cancel(),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.call("world")).toBeUndefined()}),it("can return a cached value",()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{timing:"leading",waitMs:32});expect(e.cachedValue).toBeUndefined(),expect(e.call("hello")).toBe("hello"),expect(e.cachedValue).toBe("hello")}),it("can check for inflight timers (trailing)",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});expect(e.isPending).toBe(!1),expect(e.call("hello")).toBeUndefined(),expect(e.isPending).toBe(!0),await _chunkHC3HZK4Qcjs.a.call(void 0, 1),expect(e.isPending).toBe(!0),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.isPending).toBe(!1)}),it("can check for inflight timers (leading)",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{timing:"leading",waitMs:32});expect(e.isPending).toBe(!1),expect(e.call("hello")).toBe("hello"),expect(e.isPending).toBe(!0),await _chunkHC3HZK4Qcjs.a.call(void 0, 1),expect(e.isPending).toBe(!0),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.isPending).toBe(!1)}),it("can flush before a cool-down",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});expect(e.flush()).toBeUndefined(),expect(e.call("hello")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.call("world")).toBe("hello")}),it("can flush during a cool-down",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});expect(e.call("hello")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 1),expect(e.call("world")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 1),expect(e.flush()).toBe("world")}),it("can flush after a cool-down",async()=>{let e=n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32});expect(e.call("hello")).toBeUndefined(),await _chunkHC3HZK4Qcjs.a.call(void 0, 32),expect(e.flush()).toBe("hello")})});describe("errors",()=>{it("prevents maxWaitMs to be less then waitMs",()=>{expect(()=>n(_chunkAQRYBCA3cjs.a.call(void 0, ),{waitMs:32,maxWaitMs:16})).toThrow("debounce: maxWaitMs (16) cannot be less than waitMs (32)")})});
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ import{a as c}from"./chunk-46GBCFAG.js";import{a}from"./chunk-6SYP2DRD.js";import{a as r}from"./chunk-AWXJSK4F.js";function n(e,{timing:t,waitMs:l,maxWaitMs:i}){if(i!==void 0&&l!==void 0&&i<l)throw new Error(`debounce: maxWaitMs (${i.toString()}) cannot be less than waitMs (${l.toString()})`);let o,s=r(d=>{o=e(...d)},{reducer:(d,...u)=>u,minQuietPeriodMs:l??i??0,...i!==void 0&&{maxBurstDurationMs:i},...t==="leading"?{triggerAt:"start"}:t==="both"?{triggerAt:"both"}:{triggerAt:"end"}});return{call:(...d)=>(s.call(...d),o),flush:()=>(s.flush(),o),cancel:()=>{s.cancel()},get isPending(){return!s.isIdle},get cachedValue(){return o}}}describe("main functionality",()=>{it("should debounce a function",async()=>{let e=vi.fn(c()),t=n(e,{waitMs:32});expect([t.call("a"),t.call("b"),t.call("c")]).toStrictEqual([void 0,void 0,void 0]),expect(e).toHaveBeenCalledTimes(0),await a(128),expect(e).toHaveBeenCalledTimes(1),expect([t.call("d"),t.call("e"),t.call("f")]).toStrictEqual(["c","c","c"]),expect(e).toHaveBeenCalledTimes(1),await a(256),expect(e).toHaveBeenCalledTimes(2)}),it("subsequent debounced calls return the last `func` result",async()=>{let e=n(c(),{waitMs:32});e.call("a"),await a(64),expect(e.call("b")).toBe("a"),await a(128),expect(e.call("c")).toBe("b")}),it("should not immediately call `func` when `wait` is `0`",async()=>{let e=vi.fn(),t=n(e,{});t.call(),t.call(),expect(e).toHaveBeenCalledTimes(0),await a(5),expect(e).toHaveBeenCalledTimes(1)}),it("should apply default options",async()=>{let e=vi.fn();n(e,{waitMs:32}).call(),expect(e).toHaveBeenCalledTimes(0),await a(64),expect(e).toHaveBeenCalledTimes(1)}),it("should support a `leading` option",async()=>{let e=vi.fn(),t=vi.fn(),l=n(e,{waitMs:32,timing:"leading"});l.call(),expect(e).toHaveBeenCalledTimes(1);let i=n(t,{waitMs:32,timing:"both"});i.call(),i.call(),expect(t).toHaveBeenCalledTimes(1),await a(64),expect(t).toHaveBeenCalledTimes(2),l.call(),expect(e).toHaveBeenCalledTimes(2)}),it("subsequent leading debounced calls return the last `func` result",async()=>{let e=n(c(),{waitMs:32,timing:"leading"});expect([e.call("a"),e.call("b")]).toStrictEqual(["a","a"]),await a(64),expect([e.call("c"),e.call("d")]).toStrictEqual(["c","c"])}),it("should support a `trailing` option",async()=>{let e=vi.fn();n(e,{waitMs:32,timing:"trailing"}).call(),expect(e).toHaveBeenCalledTimes(0),await a(64),expect(e).toHaveBeenCalledTimes(1)})});describe("optional param maxWaitMs",()=>{it("should support a `maxWait` option",async()=>{let e=vi.fn(c()),t=n(e,{waitMs:32,maxWaitMs:64});t.call("a"),t.call("b"),expect(e).toHaveBeenCalledTimes(0),await a(128),expect(e).toHaveBeenCalledTimes(1),t.call("c"),t.call("d"),expect(e).toHaveBeenCalledTimes(1),await a(256),expect(e).toHaveBeenCalledTimes(2)}),it("should support `maxWait` in a tight loop",async()=>{let e=vi.fn(),t=vi.fn(),l=n(e,{waitMs:32,maxWaitMs:128}),i=n(t,{waitMs:96}),o=Date.now();for(;Date.now()-o<320;)l.call(),i.call();await a(1),expect(t).toHaveBeenCalledTimes(0),expect(e).not.toHaveBeenCalledTimes(0)}),it("should queue a trailing call for subsequent debounced calls after `maxWait`",async()=>{let e=vi.fn(),t=n(e,{waitMs:200,maxWaitMs:200});t.call(),setTimeout(()=>{t.call()},190),setTimeout(()=>{t.call()},200),setTimeout(()=>{t.call()},210),await a(500),expect(e).toHaveBeenCalledTimes(2)}),it("should cancel `maxDelayed` when `delayed` is invoked",async()=>{let e=vi.fn(),t=n(e,{waitMs:32,maxWaitMs:64});t.call(),await a(128),t.call(),expect(e).toHaveBeenCalledTimes(1),await a(192),expect(e).toHaveBeenCalledTimes(2)}),it("works like a leaky bucket when only maxWaitMs is set",async()=>{let e=vi.fn(),t=n(e,{maxWaitMs:32});t.call(),expect(e).toHaveBeenCalledTimes(0),await a(16),t.call(),expect(e).toHaveBeenCalledTimes(0),await a(17),expect(e).toHaveBeenCalledTimes(1)})});describe("additional functionality",()=>{it("can cancel before the timer starts",async()=>{let e=n(c(),{waitMs:32});expect(()=>{e.cancel()}).not.toThrow(),expect(e.call("hello")).toBeUndefined(),await a(32),expect(e.call("world")).toBe("hello")}),it("can cancel the timer",async()=>{let e="Hello, World!",t=vi.fn(()=>e),l=n(t,{waitMs:32});expect(l.call()).toBeUndefined(),expect(t).toHaveBeenCalledTimes(0),await a(1),expect(l.call()).toBeUndefined(),expect(t).toHaveBeenCalledTimes(0),l.cancel(),await a(32),expect(l.call()).toBeUndefined(),expect(t).toHaveBeenCalledTimes(0),await a(32),expect(l.call()).toStrictEqual(e),expect(t).toHaveBeenCalledTimes(1)}),it("can cancel after the timer ends",async()=>{let e=n(c(),{waitMs:32});expect(e.call("hello")).toBeUndefined(),await a(32),expect(e.call("world")).toBe("hello"),expect(()=>{e.cancel()}).not.toThrow()}),it("can cancel maxWait timer",async()=>{let e=n(c(),{waitMs:16,maxWaitMs:32});expect(e.call("hello")).toBeUndefined(),await a(1),e.cancel(),await a(32),expect(e.call("world")).toBeUndefined()}),it("can return a cached value",()=>{let e=n(c(),{timing:"leading",waitMs:32});expect(e.cachedValue).toBeUndefined(),expect(e.call("hello")).toBe("hello"),expect(e.cachedValue).toBe("hello")}),it("can check for inflight timers (trailing)",async()=>{let e=n(c(),{waitMs:32});expect(e.isPending).toBe(!1),expect(e.call("hello")).toBeUndefined(),expect(e.isPending).toBe(!0),await a(1),expect(e.isPending).toBe(!0),await a(32),expect(e.isPending).toBe(!1)}),it("can check for inflight timers (leading)",async()=>{let e=n(c(),{timing:"leading",waitMs:32});expect(e.isPending).toBe(!1),expect(e.call("hello")).toBe("hello"),expect(e.isPending).toBe(!0),await a(1),expect(e.isPending).toBe(!0),await a(32),expect(e.isPending).toBe(!1)}),it("can flush before a cool-down",async()=>{let e=n(c(),{waitMs:32});expect(e.flush()).toBeUndefined(),expect(e.call("hello")).toBeUndefined(),await a(32),expect(e.call("world")).toBe("hello")}),it("can flush during a cool-down",async()=>{let e=n(c(),{waitMs:32});expect(e.call("hello")).toBeUndefined(),await a(1),expect(e.call("world")).toBeUndefined(),await a(1),expect(e.flush()).toBe("world")}),it("can flush after a cool-down",async()=>{let e=n(c(),{waitMs:32});expect(e.call("hello")).toBeUndefined(),await a(32),expect(e.flush()).toBe("hello")})});describe("errors",()=>{it("prevents maxWaitMs to be less then waitMs",()=>{expect(()=>n(c(),{waitMs:32,maxWaitMs:16})).toThrow("debounce: maxWaitMs (16) cannot be less than waitMs (32)")})});
@@ -0,0 +1 @@
1
+ "use strict";var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');var _chunkWYRK6YJUcjs = require('./chunk-WYRK6YJU.cjs');describe("'call' method args",()=>{test("no args",()=>{let e=_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{reducer:a=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()}),test("non-optional args",()=>{let e=_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{reducer:(a,n,s,o)=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()}),test("optional args",()=>{let e=_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{reducer:(a,n)=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()}),test("rest args",()=>{let e=_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{reducer:(a,...n)=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()})});describe("derive the reducer accumulator type from the executor param",()=>{test("simple types",()=>{_chunkGOUUMCT7cjs.a.call(void 0, e=>{},{reducer:e=>(expectTypeOf(e).toEqualTypeOf(),e),triggerAt:"start"})}),test("arrays",()=>{_chunkGOUUMCT7cjs.a.call(void 0, e=>{},{reducer:e=>(expectTypeOf(e).toEqualTypeOf(),e),triggerAt:"start"})}),test("objects",()=>{_chunkGOUUMCT7cjs.a.call(void 0, e=>{},{reducer:e=>(expectTypeOf(e).toEqualTypeOf(),e),triggerAt:"start"})})});describe("prevent bad options",()=>{test("minGapMs cannot be the only option with timing: end",()=>{_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{minGapMs:100}),_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{triggerAt:"end",minGapMs:100}),_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{triggerAt:"start",minGapMs:100}),_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{triggerAt:"both",minGapMs:100})})});
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ import{a as t}from"./chunk-AWXJSK4F.js";import{a as r}from"./chunk-AFO7BV2X.js";describe("'call' method args",()=>{test("no args",()=>{let e=t(r(),{reducer:a=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()}),test("non-optional args",()=>{let e=t(r(),{reducer:(a,n,s,o)=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()}),test("optional args",()=>{let e=t(r(),{reducer:(a,n)=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()}),test("rest args",()=>{let e=t(r(),{reducer:(a,...n)=>"test",triggerAt:"start"});expectTypeOf(e.call).parameters.toEqualTypeOf()})});describe("derive the reducer accumulator type from the executor param",()=>{test("simple types",()=>{t(e=>{},{reducer:e=>(expectTypeOf(e).toEqualTypeOf(),e),triggerAt:"start"})}),test("arrays",()=>{t(e=>{},{reducer:e=>(expectTypeOf(e).toEqualTypeOf(),e),triggerAt:"start"})}),test("objects",()=>{t(e=>{},{reducer:e=>(expectTypeOf(e).toEqualTypeOf(),e),triggerAt:"start"})})});describe("prevent bad options",()=>{test("minGapMs cannot be the only option with timing: end",()=>{t(r(),{minGapMs:100}),t(r(),{triggerAt:"end",minGapMs:100}),t(r(),{triggerAt:"start",minGapMs:100}),t(r(),{triggerAt:"both",minGapMs:100})})});
@@ -0,0 +1 @@
1
+ "use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkHC3HZK4Qcjs = require('./chunk-HC3HZK4Q.cjs');var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');var _chunkWYRK6YJUcjs = require('./chunk-WYRK6YJU.cjs');var _chunkWLNQOMKLcjs = require('./chunk-WLNQOMKL.cjs');var a=16;function i(e,t){return e===void 0?[t]:[...e,t]}describe("reducer behavior",()=>{it("passes the reduced arg to the executor",()=>{let e=vi.fn();_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:_chunkWLNQOMKLcjs.a.call(void 0, "hello world"),triggerAt:"start",minQuietPeriodMs:a}).call(),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith("hello world")}),it("reduces call args",async()=>{let e=vi.fn(n=>{}),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:(n,o)=>(_nullishCoalesce(n, () => (0)))+o,minQuietPeriodMs:2*a,triggerAt:"end"});t.call(1),t.call(2),t.call(3),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call(4),t.call(5),t.call(6),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(21)}),it("does not invoke if reduceArgs returns undefined",async()=>{let e=vi.fn();_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:_chunkWLNQOMKLcjs.a.call(void 0, void 0),triggerAt:"end",minQuietPeriodMs:a}).call(),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(0)}),it("supports multiple arguments",()=>{let e=vi.fn();_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:(n,o,r,m)=>[n,o,r,m],triggerAt:"start",minQuietPeriodMs:a}).call(1,"a",!0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith([void 0,1,"a",!0])}),it("reducer isn't called again when 'invokedAt: start'",async()=>{let e=vi.fn(i),t=_chunkGOUUMCT7cjs.a.call(void 0, _chunkWYRK6YJUcjs.a.call(void 0, ),{reducer:e,triggerAt:"start",minQuietPeriodMs:a});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(void 0,"a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(1)})});describe("non-trivial (>0ms) timer duration",()=>{describe("delay timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"start",minGapMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1),t.call("d"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"])}),it("invokedAt: both",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("invocations in the middle of a window",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, .75*a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, .75*a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])})}),describe("burst timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"start",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1),t.call("d"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"])}),it("invokedAt: both",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(4),expect(e).toHaveBeenLastCalledWith(["e","f"])}),it("invokedAt: end",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),t.call("e"),t.call("f"),t.call("g"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["e","f","g"])}),it("invocations in the middle of a window",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, .9*a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, .1*a),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c","d","e","f"])}),it("maxBurstDurationMs limits the burst duration",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,minQuietPeriodMs:a,maxBurstDurationMs:2*a,triggerAt:"end"});t.call("a"),await _chunkHC3HZK4Qcjs.a.call(void 0, .75*a),t.call("b"),await _chunkHC3HZK4Qcjs.a.call(void 0, .75*a),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, .75*a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"])})}),describe("both timers",()=>{it("delay is longer than burst",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,minGapMs:2*a,minQuietPeriodMs:a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])}),it("burst is longer than delay",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,minGapMs:a,minQuietPeriodMs:2*a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])}),it("burst and delay are equal",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,minGapMs:a,minQuietPeriodMs:a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("delay and maxBurstDurationMs are equal",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,minGapMs:a,minQuietPeriodMs:2*a,maxBurstDurationMs:a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])})})});describe("immediate (===0) timer durations",()=>{describe("delay timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"start",minGapMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(2)}),it("invokedAt: both",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("with a non-trivial burst timer",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:0,minQuietPeriodMs:a});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"])})}),describe("burst timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"start",minQuietPeriodMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(2)}),it("invokedAt: both",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minQuietPeriodMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(4),expect(e).toHaveBeenLastCalledWith(["e","f"])}),it("invokedAt: end",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("with a non-trivial delay timer",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:a,minQuietPeriodMs:0});t.call("a"),t.call("b"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"])}),it("burst timer with non-trivial maxBurstDuration",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,minQuietPeriodMs:0,maxBurstDurationMs:a,triggerAt:"end"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"])})}),it("both timers",async()=>{let e=vi.fn();_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:0,minQuietPeriodMs:0}).call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(1)}),it("maxBurstDurationMs = 0 limits the burst immediately",async()=>{let e=vi.fn();_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a,maxBurstDurationMs:0}).call("a"),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"])}),it("all timeouts zero",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minGapMs:0,minQuietPeriodMs:0,maxBurstDurationMs:0});t.call("a"),t.call("b"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"])})});describe("default minQuietPeriodMs === 0 when minGapMs is not defined",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"start"});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(1),t.call("c"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["c"])}),it("invokedAt: both",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both"});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"]),t.call("c"),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["c"])})});describe("utility functions",()=>{describe("flush",()=>{it("flush triggers an immediate invocation",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),t.flush(),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1)}),it("flush during active burst",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:2*a});t.call("a"),t.call("b"),t.call("c"),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.flush(),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 2*a),expect(e).toHaveBeenCalledTimes(1)})}),describe("cancel",()=>{it("cancel prevents invocation",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),t.cancel(),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(0)}),it("cancel during delay period",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"start",minGapMs:2*a});t.call("a"),t.call("b"),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.cancel(),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1)})}),describe("isIdle",()=>{it("isIdle reflects the funnel's state",()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});expect(t.isIdle).toBe(!0),t.call("a"),expect(t.isIdle).toBe(!1),t.cancel(),expect(t.isIdle).toBe(!0)}),it("isIdle works when burst duration is 0",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"end",minQuietPeriodMs:0});expect(t.isIdle).toBe(!0),t.call("a"),t.call("b"),t.call("c"),expect(t.isIdle).toBe(!1),await _chunkHC3HZK4Qcjs.a.call(void 0, 0),expect(t.isIdle).toBe(!0)})})});describe("edge-cases",()=>{it("bursts that start late don't prevent delayed invocations",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minQuietPeriodMs:a,minGapMs:2*a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, 1.5*a),expect(e).toHaveBeenCalledTimes(1),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, .5*a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])}),it("delay timeouts don't cause an invocation in the middle of bursts",async()=>{let e=vi.fn(),t=_chunkGOUUMCT7cjs.a.call(void 0, e,{reducer:i,triggerAt:"both",minQuietPeriodMs:2*a,minGapMs:a});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("c"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),t.call("d"),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(1),await _chunkHC3HZK4Qcjs.a.call(void 0, a),expect(e).toHaveBeenCalledTimes(2)})});
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ import{a as l}from"./chunk-6SYP2DRD.js";import{a as c}from"./chunk-AWXJSK4F.js";import{a as d}from"./chunk-AFO7BV2X.js";import{a as s}from"./chunk-T5XG33UI.js";var a=16;function i(e,t){return e===void 0?[t]:[...e,t]}describe("reducer behavior",()=>{it("passes the reduced arg to the executor",()=>{let e=vi.fn();c(e,{reducer:s("hello world"),triggerAt:"start",minQuietPeriodMs:a}).call(),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith("hello world")}),it("reduces call args",async()=>{let e=vi.fn(n=>{}),t=c(e,{reducer:(n,o)=>(n??0)+o,minQuietPeriodMs:2*a,triggerAt:"end"});t.call(1),t.call(2),t.call(3),await l(a),t.call(4),t.call(5),t.call(6),await l(2*a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(21)}),it("does not invoke if reduceArgs returns undefined",async()=>{let e=vi.fn();c(e,{reducer:s(void 0),triggerAt:"end",minQuietPeriodMs:a}).call(),await l(2*a),expect(e).toHaveBeenCalledTimes(0)}),it("supports multiple arguments",()=>{let e=vi.fn();c(e,{reducer:(n,o,r,m)=>[n,o,r,m],triggerAt:"start",minQuietPeriodMs:a}).call(1,"a",!0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith([void 0,1,"a",!0])}),it("reducer isn't called again when 'invokedAt: start'",async()=>{let e=vi.fn(i),t=c(d(),{reducer:e,triggerAt:"start",minQuietPeriodMs:a});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(void 0,"a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),await l(2*a),expect(e).toHaveBeenCalledTimes(1)})});describe("non-trivial (>0ms) timer duration",()=>{describe("delay timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"start",minGapMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),expect(e).toHaveBeenCalledTimes(1),t.call("d"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"])}),it("invokedAt: both",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minGapMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),await l(a),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("invocations in the middle of a window",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minGapMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(.75*a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await l(.75*a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])})}),describe("burst timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"start",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),expect(e).toHaveBeenCalledTimes(1),t.call("d"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"])}),it("invokedAt: both",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d"]),await l(a),expect(e).toHaveBeenCalledTimes(4),expect(e).toHaveBeenLastCalledWith(["e","f"])}),it("invokedAt: end",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await l(a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),t.call("e"),t.call("f"),t.call("g"),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["e","f","g"])}),it("invocations in the middle of a window",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await l(.9*a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(0),await l(.1*a),expect(e).toHaveBeenCalledTimes(0),await l(a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c","d","e","f"])}),it("maxBurstDurationMs limits the burst duration",async()=>{let e=vi.fn(),t=c(e,{reducer:i,minQuietPeriodMs:a,maxBurstDurationMs:2*a,triggerAt:"end"});t.call("a"),await l(.75*a),t.call("b"),await l(.75*a),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await l(.75*a),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"])})}),describe("both timers",()=>{it("delay is longer than burst",async()=>{let e=vi.fn(),t=c(e,{reducer:i,minGapMs:2*a,minQuietPeriodMs:a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])}),it("burst is longer than delay",async()=>{let e=vi.fn(),t=c(e,{reducer:i,minGapMs:a,minQuietPeriodMs:2*a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])}),it("burst and delay are equal",async()=>{let e=vi.fn(),t=c(e,{reducer:i,minGapMs:a,minQuietPeriodMs:a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),await l(a),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("delay and maxBurstDurationMs are equal",async()=>{let e=vi.fn(),t=c(e,{reducer:i,minGapMs:a,minQuietPeriodMs:2*a,maxBurstDurationMs:a,triggerAt:"both"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),await l(a),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])})})});describe("immediate (===0) timer durations",()=>{describe("delay timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"start",minGapMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"]),await l(0),expect(e).toHaveBeenCalledTimes(2)}),it("invokedAt: both",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minGapMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),await l(0),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("with a non-trivial burst timer",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minGapMs:0,minQuietPeriodMs:a});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"])})}),describe("burst timer",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"start",minQuietPeriodMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d"]),await l(0),expect(e).toHaveBeenCalledTimes(2)}),it("invokedAt: both",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minQuietPeriodMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["d"]),await l(0),expect(e).toHaveBeenCalledTimes(4),expect(e).toHaveBeenLastCalledWith(["e","f"])}),it("invokedAt: end",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:0});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await l(0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await l(0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["d","e","f"])}),it("with a non-trivial delay timer",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minGapMs:a,minQuietPeriodMs:0});t.call("a"),t.call("b"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"])}),it("burst timer with non-trivial maxBurstDuration",async()=>{let e=vi.fn(),t=c(e,{reducer:i,minQuietPeriodMs:0,maxBurstDurationMs:a,triggerAt:"end"});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(0),await l(0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"])})}),it("both timers",async()=>{let e=vi.fn();c(e,{reducer:i,triggerAt:"both",minGapMs:0,minQuietPeriodMs:0}).call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),expect(e).toHaveBeenCalledTimes(1)}),it("maxBurstDurationMs = 0 limits the burst immediately",async()=>{let e=vi.fn();c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a,maxBurstDurationMs:0}).call("a"),await l(0),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"])}),it("all timeouts zero",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minGapMs:0,minQuietPeriodMs:0,maxBurstDurationMs:0});t.call("a"),t.call("b"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"])})});describe("default minQuietPeriodMs === 0 when minGapMs is not defined",()=>{it("invokedAt: start",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"start"});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await l(0),expect(e).toHaveBeenCalledTimes(1),t.call("c"),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["c"])}),it("invokedAt: both",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both"});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await l(0),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b"]),t.call("c"),expect(e).toHaveBeenCalledTimes(3),expect(e).toHaveBeenLastCalledWith(["c"])})});describe("utility functions",()=>{describe("flush",()=>{it("flush triggers an immediate invocation",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),t.flush(),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),await l(a),expect(e).toHaveBeenCalledTimes(1)}),it("flush during active burst",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:2*a});t.call("a"),t.call("b"),t.call("c"),await l(a),t.flush(),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a","b","c"]),await l(2*a),expect(e).toHaveBeenCalledTimes(1)})}),describe("cancel",()=>{it("cancel prevents invocation",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});t.call("a"),t.call("b"),t.call("c"),t.cancel(),await l(a),expect(e).toHaveBeenCalledTimes(0)}),it("cancel during delay period",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"start",minGapMs:2*a});t.call("a"),t.call("b"),await l(a),t.cancel(),await l(a),expect(e).toHaveBeenCalledTimes(1)})}),describe("isIdle",()=>{it("isIdle reflects the funnel's state",()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:a});expect(t.isIdle).toBe(!0),t.call("a"),expect(t.isIdle).toBe(!1),t.cancel(),expect(t.isIdle).toBe(!0)}),it("isIdle works when burst duration is 0",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"end",minQuietPeriodMs:0});expect(t.isIdle).toBe(!0),t.call("a"),t.call("b"),t.call("c"),expect(t.isIdle).toBe(!1),await l(0),expect(t.isIdle).toBe(!0)})})});describe("edge-cases",()=>{it("bursts that start late don't prevent delayed invocations",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minQuietPeriodMs:a,minGapMs:2*a});t.call("a"),t.call("b"),t.call("c"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(1.5*a),expect(e).toHaveBeenCalledTimes(1),t.call("d"),t.call("e"),t.call("f"),expect(e).toHaveBeenCalledTimes(1),await l(.5*a),expect(e).toHaveBeenCalledTimes(2),expect(e).toHaveBeenLastCalledWith(["b","c","d","e","f"])}),it("delay timeouts don't cause an invocation in the middle of bursts",async()=>{let e=vi.fn(),t=c(e,{reducer:i,triggerAt:"both",minQuietPeriodMs:2*a,minGapMs:a});t.call("a"),expect(e).toHaveBeenCalledTimes(1),expect(e).toHaveBeenLastCalledWith(["a"]),await l(a),t.call("b"),expect(e).toHaveBeenCalledTimes(1),await l(a),t.call("c"),expect(e).toHaveBeenCalledTimes(1),await l(a),t.call("d"),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(1),await l(a),expect(e).toHaveBeenCalledTimes(2)})});
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkRGUX2LCHcjs = require('./chunk-RGUX2LCH.cjs');var _chunkBBYC5W6Ecjs = require('./chunk-BBYC5W6E.cjs');var _chunkMYUMWF5Acjs = require('./chunk-MYUMWF5A.cjs');var _chunkM5Z4GCV3cjs = require('./chunk-M5Z4GCV3.cjs');var _chunkEFURGOGBcjs = require('./chunk-EFURGOGB.cjs');var _chunkRAHS5RJScjs = require('./chunk-RAHS5RJS.cjs');var _chunkG74G5PZTcjs = require('./chunk-G74G5PZT.cjs');var _chunkWVTQN2AIcjs = require('./chunk-WVTQN2AI.cjs');var _chunkN7AESA4Wcjs = require('./chunk-N7AESA4W.cjs');var _chunkLPNHLDEAcjs = require('./chunk-LPNHLDEA.cjs');var _chunkI27XCDDIcjs = require('./chunk-I27XCDDI.cjs');var _chunkX7EK7EDZcjs = require('./chunk-X7EK7EDZ.cjs');var _chunkESGYUUU2cjs = require('./chunk-ESGYUUU2.cjs');var _chunkLLHOSKEGcjs = require('./chunk-LLHOSKEG.cjs');var _chunkP4KRPPMAcjs = require('./chunk-P4KRPPMA.cjs');var _chunkCZI4WD5Qcjs = require('./chunk-CZI4WD5Q.cjs');var _chunkVH3XIFK7cjs = require('./chunk-VH3XIFK7.cjs');var _chunk6DDL3ZF6cjs = require('./chunk-6DDL3ZF6.cjs');var _chunkVNI4VRFMcjs = require('./chunk-VNI4VRFM.cjs');var _chunk7GAGU65Ucjs = require('./chunk-7GAGU65U.cjs');var _chunk5GI4OEUMcjs = require('./chunk-5GI4OEUM.cjs');require('./chunk-OPJJI442.cjs');var _chunkRMLQX4GAcjs = require('./chunk-RMLQX4GA.cjs');var _chunkI4WQXZJHcjs = require('./chunk-I4WQXZJH.cjs');var _chunkTRUODFSQcjs = require('./chunk-TRUODFSQ.cjs');var _chunkQNFRANE2cjs = require('./chunk-QNFRANE2.cjs');var _chunkFRWE2CFIcjs = require('./chunk-FRWE2CFI.cjs');var _chunkU4HKRBD3cjs = require('./chunk-U4HKRBD3.cjs');var _chunk43XCMZYTcjs = require('./chunk-43XCMZYT.cjs');var _chunkUEL4TCYDcjs = require('./chunk-UEL4TCYD.cjs');var _chunkJ7LDTU7Wcjs = require('./chunk-J7LDTU7W.cjs');var _chunkNWEOHZQHcjs = require('./chunk-NWEOHZQH.cjs');var _chunkTNBCVNKHcjs = require('./chunk-TNBCVNKH.cjs');var _chunkJFHH5VKUcjs = require('./chunk-JFHH5VKU.cjs');var _chunkIP2ZEYIUcjs = require('./chunk-IP2ZEYIU.cjs');var _chunkTFN3JWPScjs = require('./chunk-TFN3JWPS.cjs');var _chunkVRZNQSZNcjs = require('./chunk-VRZNQSZN.cjs');var _chunkXGT73UQWcjs = require('./chunk-XGT73UQW.cjs');var _chunkHC3HZK4Qcjs = require('./chunk-HC3HZK4Q.cjs');var _chunk3WCOFJCScjs = require('./chunk-3WCOFJCS.cjs');var _chunkEP626HCIcjs = require('./chunk-EP626HCI.cjs');var _chunkKM5XOWVGcjs = require('./chunk-KM5XOWVG.cjs');var _chunkDGLS43L4cjs = require('./chunk-DGLS43L4.cjs');var _chunkUIXBYMGBcjs = require('./chunk-UIXBYMGB.cjs');var _chunkNOZQSRNNcjs = require('./chunk-NOZQSRNN.cjs');require('./chunk-7TDMV2GO.cjs');var _chunkRXSPNNEWcjs = require('./chunk-RXSPNNEW.cjs');var _chunkZLNSRDW7cjs = require('./chunk-ZLNSRDW7.cjs');var _chunkWQHSSKSDcjs = require('./chunk-WQHSSKSD.cjs');var _chunkCIWFQSJQcjs = require('./chunk-CIWFQSJQ.cjs');var _chunkGG67ZAXXcjs = require('./chunk-GG67ZAXX.cjs');var _chunkIPW4LWUMcjs = require('./chunk-IPW4LWUM.cjs');var _chunkSHU7K6YPcjs = require('./chunk-SHU7K6YP.cjs');var _chunkQSYAGOIBcjs = require('./chunk-QSYAGOIB.cjs');var _chunkRQHL6EVIcjs = require('./chunk-RQHL6EVI.cjs');var _chunkXTLGRWI2cjs = require('./chunk-XTLGRWI2.cjs');var _chunkFSTZSNDBcjs = require('./chunk-FSTZSNDB.cjs');var _chunkYNCQNUT4cjs = require('./chunk-YNCQNUT4.cjs');var _chunkI33LBSLYcjs = require('./chunk-I33LBSLY.cjs');var _chunkSJMGQLYScjs = require('./chunk-SJMGQLYS.cjs');var _chunkNC5GO4RUcjs = require('./chunk-NC5GO4RU.cjs');var _chunkPEJHW4CAcjs = require('./chunk-PEJHW4CA.cjs');var _chunkNAYMME55cjs = require('./chunk-NAYMME55.cjs');var _chunkAHHZAXLVcjs = require('./chunk-AHHZAXLV.cjs');var _chunkJRDQRETRcjs = require('./chunk-JRDQRETR.cjs');var _chunkOWGBKUJ2cjs = require('./chunk-OWGBKUJ2.cjs');var _chunkQXQ5BE4Ccjs = require('./chunk-QXQ5BE4C.cjs');var _chunkMGCDUMSJcjs = require('./chunk-MGCDUMSJ.cjs');var _chunkHNEXKGNRcjs = require('./chunk-HNEXKGNR.cjs');var _chunk3KWI3VEHcjs = require('./chunk-3KWI3VEH.cjs');var _chunkR55FGFKUcjs = require('./chunk-R55FGFKU.cjs');var _chunkGRFK4SBRcjs = require('./chunk-GRFK4SBR.cjs');var _chunk7RS2XXUGcjs = require('./chunk-7RS2XXUG.cjs');var _chunkZ4ZUDQ7Ecjs = require('./chunk-Z4ZUDQ7E.cjs');var _chunkDBRT37L4cjs = require('./chunk-DBRT37L4.cjs');var _chunkIMRTC6QScjs = require('./chunk-IMRTC6QS.cjs');var _chunkF3JXHUP4cjs = require('./chunk-F3JXHUP4.cjs');var _chunkAWGKYXZCcjs = require('./chunk-AWGKYXZC.cjs');var _chunkUTMQRL7Ncjs = require('./chunk-UTMQRL7N.cjs');var _chunkIADIYOLEcjs = require('./chunk-IADIYOLE.cjs');var _chunkIBMY5FOXcjs = require('./chunk-IBMY5FOX.cjs');var _chunkJJLTXK5Jcjs = require('./chunk-JJLTXK5J.cjs');var _chunkWNIVBVW7cjs = require('./chunk-WNIVBVW7.cjs');var _chunkNGLE2TBGcjs = require('./chunk-NGLE2TBG.cjs');var _chunk3YMN635Acjs = require('./chunk-3YMN635A.cjs');var _chunkR3TYGYBQcjs = require('./chunk-R3TYGYBQ.cjs');var _chunk7HFKYJCKcjs = require('./chunk-7HFKYJCK.cjs');var _chunkWM4KSO6Ccjs = require('./chunk-WM4KSO6C.cjs');var _chunkLAHSLTRJcjs = require('./chunk-LAHSLTRJ.cjs');var _chunkBEVPU2EQcjs = require('./chunk-BEVPU2EQ.cjs');var _chunkEHJK4JRFcjs = require('./chunk-EHJK4JRF.cjs');var _chunkSW62SX4Ycjs = require('./chunk-SW62SX4Y.cjs');var _chunkOFLOVIU2cjs = require('./chunk-OFLOVIU2.cjs');var _chunkHL3QPU5Jcjs = require('./chunk-HL3QPU5J.cjs');var _chunkZCCHYKDGcjs = require('./chunk-ZCCHYKDG.cjs');var _chunkWFR3HBYRcjs = require('./chunk-WFR3HBYR.cjs');var _chunk7XMQFPW7cjs = require('./chunk-7XMQFPW7.cjs');var _chunkDAFN5EJRcjs = require('./chunk-DAFN5EJR.cjs');var _chunkU3OEHN5Pcjs = require('./chunk-U3OEHN5P.cjs');var _chunkNBUEBREGcjs = require('./chunk-NBUEBREG.cjs');var _chunkYWTY4X2Rcjs = require('./chunk-YWTY4X2R.cjs');var _chunk4KUPCNXNcjs = require('./chunk-4KUPCNXN.cjs');var _chunkYXKPCISKcjs = require('./chunk-YXKPCISK.cjs');var _chunkTUZHNOSGcjs = require('./chunk-TUZHNOSG.cjs');var _chunk442DWBIMcjs = require('./chunk-442DWBIM.cjs');var _chunkPNTFWNQBcjs = require('./chunk-PNTFWNQB.cjs');var _chunkYSTUBBOJcjs = require('./chunk-YSTUBBOJ.cjs');var _chunkTRIZIXDAcjs = require('./chunk-TRIZIXDA.cjs');var _chunkR6GHLSJBcjs = require('./chunk-R6GHLSJB.cjs');var _chunkBL5SQB5Scjs = require('./chunk-BL5SQB5S.cjs');var _chunkY7RFTHSRcjs = require('./chunk-Y7RFTHSR.cjs');var _chunkAQRYBCA3cjs = require('./chunk-AQRYBCA3.cjs');var _chunkBZMSXMATcjs = require('./chunk-BZMSXMAT.cjs');var _chunkBDJWSWG6cjs = require('./chunk-BDJWSWG6.cjs');var _chunkZHNB3KNNcjs = require('./chunk-ZHNB3KNN.cjs');var _chunkAAOM3KE2cjs = require('./chunk-AAOM3KE2.cjs');var _chunk6G7TWED4cjs = require('./chunk-6G7TWED4.cjs');var _chunkCJ3FPRHUcjs = require('./chunk-CJ3FPRHU.cjs');var _chunk53BDOG3Ycjs = require('./chunk-53BDOG3Y.cjs');var _chunkQJUPJFCQcjs = require('./chunk-QJUPJFCQ.cjs');var _chunk66577RZGcjs = require('./chunk-66577RZG.cjs');var _chunkDOH2U2KJcjs = require('./chunk-DOH2U2KJ.cjs');var _chunkXPF42SEFcjs = require('./chunk-XPF42SEF.cjs');var _chunk4FCH7KNTcjs = require('./chunk-4FCH7KNT.cjs');var _chunkKRY2OVNWcjs = require('./chunk-KRY2OVNW.cjs');var _chunkLEH3IYNPcjs = require('./chunk-LEH3IYNP.cjs');var _chunkEYWIFSMNcjs = require('./chunk-EYWIFSMN.cjs');var _chunkE3XEHRICcjs = require('./chunk-E3XEHRIC.cjs');var _chunkH47HWN3Wcjs = require('./chunk-H47HWN3W.cjs');var _chunkP2IDCWXLcjs = require('./chunk-P2IDCWXL.cjs');var _chunkLOEKNPBGcjs = require('./chunk-LOEKNPBG.cjs');require('./chunk-OBWPUDD3.cjs');var _chunk2JSUJZJRcjs = require('./chunk-2JSUJZJR.cjs');var _chunkWYRK6YJUcjs = require('./chunk-WYRK6YJU.cjs');var _chunkE374WHO7cjs = require('./chunk-E374WHO7.cjs');require('./chunk-PEYRR7GN.cjs');require('./chunk-Z6OOXW67.cjs');require('./chunk-EROXO3T4.cjs');var _chunk6DKD76DKcjs = require('./chunk-6DKD76DK.cjs');var _chunkMIQQGQM6cjs = require('./chunk-MIQQGQM6.cjs');var _chunkBBVARAQQcjs = require('./chunk-BBVARAQQ.cjs');var _chunkD6F22MNScjs = require('./chunk-D6F22MNS.cjs');var _chunkHR3IUTNWcjs = require('./chunk-HR3IUTNW.cjs');var _chunkQLDNLCI3cjs = require('./chunk-QLDNLCI3.cjs');var _chunkA2HUSITFcjs = require('./chunk-A2HUSITF.cjs');var _chunkWYM2JV5Tcjs = require('./chunk-WYM2JV5T.cjs');var _chunkWLNQOMKLcjs = require('./chunk-WLNQOMKL.cjs');var _chunk6YAVWI3Xcjs = require('./chunk-6YAVWI3X.cjs');var _chunkOLZEQGPJcjs = require('./chunk-OLZEQGPJ.cjs');var _chunkJ3DPGMAEcjs = require('./chunk-J3DPGMAE.cjs');var _chunkFJX3YNGWcjs = require('./chunk-FJX3YNGW.cjs');require('./chunk-I6KKO3TI.cjs');var _chunkDGMGGT4Acjs = require('./chunk-DGMGGT4A.cjs');require('./chunk-BGYDTTCY.cjs');var _chunkG33UBR6Fcjs = require('./chunk-G33UBR6F.cjs');var _chunk5N3BA46Dcjs = require('./chunk-5N3BA46D.cjs');var _chunkWB2TJU2Jcjs = require('./chunk-WB2TJU2J.cjs');var _chunkJ2YCCSJVcjs = require('./chunk-J2YCCSJV.cjs');var _chunk5JPRNKKUcjs = require('./chunk-5JPRNKKU.cjs');require('./chunk-QFLTOQ2J.cjs');var _chunkEGUKWDAKcjs = require('./chunk-EGUKWDAK.cjs');var _chunkTTO5FQC7cjs = require('./chunk-TTO5FQC7.cjs');var _chunkY52SHFCPcjs = require('./chunk-Y52SHFCP.cjs');var _chunk4MAOF3ZPcjs = require('./chunk-4MAOF3ZP.cjs');require('./chunk-4YUDBZFA.cjs');var Yr=typeof window<"u";exports.KEY_CODES = _chunkUTMQRL7Ncjs.a; exports.add = _chunk5N3BA46Dcjs.a; exports.addProp = _chunkG33UBR6Fcjs.a; exports.allPass = _chunkWB2TJU2Jcjs.a; exports.anyPass = _chunkJ2YCCSJVcjs.a; exports.ceil = _chunk5JPRNKKUcjs.a; exports.chunk = _chunkEGUKWDAKcjs.a; exports.clamp = _chunkTTO5FQC7cjs.a; exports.clone = _chunkY52SHFCPcjs.a; exports.concat = _chunkA2HUSITFcjs.a; exports.conditional = _chunkWYM2JV5Tcjs.a; exports.constant = _chunkWLNQOMKLcjs.a; exports.countBy = _chunk6YAVWI3Xcjs.a; exports.curry = _chunk4MAOF3ZPcjs.a; exports.debounce = _chunkOLZEQGPJcjs.a; exports.difference = _chunkFJX3YNGWcjs.a; exports.differenceWith = _chunkJ3DPGMAEcjs.a; exports.divide = _chunk2JSUJZJRcjs.a; exports.doNothing = _chunkWYRK6YJUcjs.a; exports.drop = _chunkHR3IUTNWcjs.a; exports.dropFirstBy = _chunkE374WHO7cjs.a; exports.dropLast = _chunkBBVARAQQcjs.a; exports.dropLastWhile = _chunkMIQQGQM6cjs.a; exports.dropWhile = _chunkD6F22MNScjs.a; exports.entries = _chunkQLDNLCI3cjs.a; exports.evolve = _chunk4FCH7KNTcjs.a; exports.filter = _chunkKRY2OVNWcjs.a; exports.find = _chunkH47HWN3Wcjs.a; exports.findIndex = _chunkLEH3IYNPcjs.a; exports.findLast = _chunkE3XEHRICcjs.a; exports.findLastIndex = _chunkEYWIFSMNcjs.a; exports.first = _chunkLOEKNPBGcjs.a; exports.firstBy = _chunkP2IDCWXLcjs.a; exports.flat = _chunk6G7TWED4cjs.a; exports.flatMap = _chunkAAOM3KE2cjs.a; exports.floor = _chunkCJ3FPRHUcjs.a; exports.forEach = _chunkQJUPJFCQcjs.a; exports.forEachObj = _chunk53BDOG3Ycjs.a; exports.fromEntries = _chunk66577RZGcjs.a; exports.fromKeys = _chunkDOH2U2KJcjs.a; exports.groupBy = _chunkXPF42SEFcjs.a; exports.hasAtLeast = _chunk6DKD76DKcjs.a; exports.hasSubObject = _chunkR6GHLSJBcjs.a; exports.humanReadableFileSize = _chunkY7RFTHSRcjs.a; exports.identity = _chunkAQRYBCA3cjs.a; exports.indexBy = _chunkBZMSXMATcjs.a; exports.intersection = _chunkZHNB3KNNcjs.a; exports.intersectionWith = _chunkBDJWSWG6cjs.a; exports.invert = _chunk4KUPCNXNcjs.a; exports.isArray = _chunkYXKPCISKcjs.a; exports.isBigInt = _chunkTUZHNOSGcjs.a; exports.isBoolean = _chunk442DWBIMcjs.a; exports.isBrowser = Yr; exports.isDate = _chunkPNTFWNQBcjs.a; exports.isDeepEqual = _chunkBL5SQB5Scjs.a; exports.isDefined = _chunkYSTUBBOJcjs.a; exports.isEmpty = _chunkTRIZIXDAcjs.a; exports.isError = _chunkHL3QPU5Jcjs.a; exports.isFunction = _chunkZCCHYKDGcjs.a; exports.isIncludedIn = _chunkWFR3HBYRcjs.a; exports.isNonNull = _chunk7XMQFPW7cjs.a; exports.isNonNullish = _chunkDAFN5EJRcjs.a; exports.isNot = _chunkU3OEHN5Pcjs.a; exports.isNullish = _chunkNBUEBREGcjs.a; exports.isNumber = _chunkYWTY4X2Rcjs.a; exports.isObjectType = _chunkR3TYGYBQcjs.a; exports.isPlainObject = _chunk7HFKYJCKcjs.a; exports.isPromise = _chunkWM4KSO6Ccjs.a; exports.isShallowEqual = _chunkLAHSLTRJcjs.a; exports.isStrictEqual = _chunkBEVPU2EQcjs.a; exports.isString = _chunkEHJK4JRFcjs.a; exports.isSymbol = _chunkSW62SX4Ycjs.a; exports.isTruthy = _chunkOFLOVIU2cjs.a; exports.join = _chunkAWGKYXZCcjs.a; exports.keys = _chunkIADIYOLEcjs.a; exports.last = _chunkIBMY5FOXcjs.a; exports.length = _chunkJJLTXK5Jcjs.a; exports.map = _chunkR55FGFKUcjs.a; exports.mapKeys = _chunkWNIVBVW7cjs.a; exports.mapToObj = _chunkNGLE2TBGcjs.a; exports.mapValues = _chunk3YMN635Acjs.a; exports.mapWithFeedback = _chunk3KWI3VEHcjs.a; exports.meanBy = _chunkGRFK4SBRcjs.a; exports.merge = _chunkDBRT37L4cjs.a; exports.mergeAll = _chunk7RS2XXUGcjs.a; exports.mergeDeep = _chunkZ4ZUDQ7Ecjs.a; exports.multiply = _chunkIMRTC6QScjs.a; exports.nthBy = _chunkF3JXHUP4cjs.a; exports.objOf = _chunkPEJHW4CAcjs.a; exports.omit = _chunkAHHZAXLVcjs.a; exports.omitBy = _chunkNAYMME55cjs.a; exports.once = _chunkJRDQRETRcjs.a; exports.only = _chunkOWGBKUJ2cjs.a; exports.partition = _chunkQXQ5BE4Ccjs.a; exports.pathOr = _chunkMGCDUMSJcjs.a; exports.pick = _chunkRQHL6EVIcjs.a; exports.pickBy = _chunkHNEXKGNRcjs.a; exports.pipe = _chunkDGMGGT4Acjs.a; exports.piped = _chunkXTLGRWI2cjs.a; exports.product = _chunkFSTZSNDBcjs.a; exports.prop = _chunkYNCQNUT4cjs.a; exports.propImplementation = _chunkYNCQNUT4cjs.b; exports.pullObject = _chunkI33LBSLYcjs.a; exports.randomInteger = _chunkSJMGQLYScjs.a; exports.randomString = _chunkNC5GO4RUcjs.a; exports.range = _chunkRXSPNNEWcjs.a; exports.rankBy = _chunkZLNSRDW7cjs.a; exports.reduce = _chunkWQHSSKSDcjs.a; exports.reverse = _chunkCIWFQSJQcjs.a; exports.round = _chunkGG67ZAXXcjs.a; exports.sample = _chunkIPW4LWUMcjs.a; exports.set = _chunkQSYAGOIBcjs.a; exports.setPath = _chunkSHU7K6YPcjs.a; exports.setPathImplementation = _chunkSHU7K6YPcjs.b; exports.shuffle = _chunkXGT73UQWcjs.a; exports.sleep = _chunkHC3HZK4Qcjs.a; exports.sliceString = _chunk3WCOFJCScjs.a; exports.slugify = _chunkEP626HCIcjs.a; exports.sort = _chunkDGLS43L4cjs.a; exports.sortBy = _chunkKM5XOWVGcjs.a; exports.sortedIndex = _chunkUEL4TCYDcjs.a; exports.sortedIndexBy = _chunkUIXBYMGBcjs.a; exports.sortedIndexWith = _chunkNOZQSRNNcjs.a; exports.sortedLastIndex = _chunkNWEOHZQHcjs.a; exports.sortedLastIndexBy = _chunkJ7LDTU7Wcjs.a; exports.splice = _chunkTNBCVNKHcjs.a; exports.split = _chunkTFN3JWPScjs.a; exports.splitAt = _chunkJFHH5VKUcjs.a; exports.splitWhen = _chunkIP2ZEYIUcjs.a; exports.stringToPath = _chunkVRZNQSZNcjs.a; exports.subtract = _chunkRMLQX4GAcjs.a; exports.sum = _chunkTRUODFSQcjs.a; exports.sumBy = _chunkI4WQXZJHcjs.a; exports.swapIndices = _chunkQNFRANE2cjs.a; exports.swapProps = _chunkFRWE2CFIcjs.a; exports.take = _chunkCZI4WD5Qcjs.a; exports.takeFirstBy = _chunkU4HKRBD3cjs.a; exports.takeLast = _chunkLLHOSKEGcjs.a; exports.takeLastWhile = _chunk43XCMZYTcjs.a; exports.takeWhile = _chunkP4KRPPMAcjs.a; exports.tap = _chunkVH3XIFK7cjs.a; exports.times = _chunk6DDL3ZF6cjs.a; exports.toCamelCase = _chunkVNI4VRFMcjs.a; exports.toCapitalCase = _chunk7GAGU65Ucjs.a; exports.toConstantCase = _chunk5GI4OEUMcjs.a; exports.toKebabCase = _chunkRAHS5RJScjs.a; exports.toNoCase = _chunkI27XCDDIcjs.a; exports.toPascalCase = _chunkG74G5PZTcjs.a; exports.toPascalSnakeCase = _chunkWVTQN2AIcjs.a; exports.toSentenceCase = _chunkN7AESA4Wcjs.a; exports.toSnakeCase = _chunkLPNHLDEAcjs.a; exports.toTrainCase = _chunkX7EK7EDZcjs.a; exports.unique = _chunkBBYC5W6Ecjs.a; exports.uniqueBy = _chunkESGYUUU2cjs.a; exports.uniqueWith = _chunkRGUX2LCHcjs.a; exports.values = _chunkMYUMWF5Acjs.a; exports.zip = _chunkEFURGOGBcjs.a; exports.zipWith = _chunkM5Z4GCV3cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkESGYUUU2cjs = require('./chunk-ESGYUUU2.cjs');var _chunkRGUX2LCHcjs = require('./chunk-RGUX2LCH.cjs');var _chunkBBYC5W6Ecjs = require('./chunk-BBYC5W6E.cjs');var _chunkMYUMWF5Acjs = require('./chunk-MYUMWF5A.cjs');var _chunkM5Z4GCV3cjs = require('./chunk-M5Z4GCV3.cjs');var _chunkEFURGOGBcjs = require('./chunk-EFURGOGB.cjs');var _chunk5GI4OEUMcjs = require('./chunk-5GI4OEUM.cjs');var _chunkRAHS5RJScjs = require('./chunk-RAHS5RJS.cjs');var _chunkG74G5PZTcjs = require('./chunk-G74G5PZT.cjs');var _chunkWVTQN2AIcjs = require('./chunk-WVTQN2AI.cjs');var _chunkN7AESA4Wcjs = require('./chunk-N7AESA4W.cjs');var _chunkLPNHLDEAcjs = require('./chunk-LPNHLDEA.cjs');var _chunkI27XCDDIcjs = require('./chunk-I27XCDDI.cjs');var _chunkX7EK7EDZcjs = require('./chunk-X7EK7EDZ.cjs');var _chunkLLHOSKEGcjs = require('./chunk-LLHOSKEG.cjs');var _chunkP4KRPPMAcjs = require('./chunk-P4KRPPMA.cjs');var _chunkCZI4WD5Qcjs = require('./chunk-CZI4WD5Q.cjs');var _chunkVH3XIFK7cjs = require('./chunk-VH3XIFK7.cjs');var _chunk6DDL3ZF6cjs = require('./chunk-6DDL3ZF6.cjs');var _chunkVNI4VRFMcjs = require('./chunk-VNI4VRFM.cjs');var _chunk7GAGU65Ucjs = require('./chunk-7GAGU65U.cjs');require('./chunk-OPJJI442.cjs');var _chunkVRZNQSZNcjs = require('./chunk-VRZNQSZN.cjs');var _chunkRMLQX4GAcjs = require('./chunk-RMLQX4GA.cjs');var _chunkI4WQXZJHcjs = require('./chunk-I4WQXZJH.cjs');var _chunkTRUODFSQcjs = require('./chunk-TRUODFSQ.cjs');var _chunkQNFRANE2cjs = require('./chunk-QNFRANE2.cjs');var _chunkFRWE2CFIcjs = require('./chunk-FRWE2CFI.cjs');var _chunkU4HKRBD3cjs = require('./chunk-U4HKRBD3.cjs');var _chunk43XCMZYTcjs = require('./chunk-43XCMZYT.cjs');var _chunkNOZQSRNNcjs = require('./chunk-NOZQSRNN.cjs');var _chunkUEL4TCYDcjs = require('./chunk-UEL4TCYD.cjs');var _chunkJ7LDTU7Wcjs = require('./chunk-J7LDTU7W.cjs');var _chunkNWEOHZQHcjs = require('./chunk-NWEOHZQH.cjs');var _chunkTNBCVNKHcjs = require('./chunk-TNBCVNKH.cjs');var _chunkJFHH5VKUcjs = require('./chunk-JFHH5VKU.cjs');var _chunkIP2ZEYIUcjs = require('./chunk-IP2ZEYIU.cjs');var _chunkTFN3JWPScjs = require('./chunk-TFN3JWPS.cjs');var _chunkQSYAGOIBcjs = require('./chunk-QSYAGOIB.cjs');var _chunkXGT73UQWcjs = require('./chunk-XGT73UQW.cjs');var _chunk3WCOFJCScjs = require('./chunk-3WCOFJCS.cjs');var _chunkEP626HCIcjs = require('./chunk-EP626HCI.cjs');var _chunkKM5XOWVGcjs = require('./chunk-KM5XOWVG.cjs');var _chunkDGLS43L4cjs = require('./chunk-DGLS43L4.cjs');var _chunkUIXBYMGBcjs = require('./chunk-UIXBYMGB.cjs');require('./chunk-7TDMV2GO.cjs');var _chunkNC5GO4RUcjs = require('./chunk-NC5GO4RU.cjs');var _chunkRXSPNNEWcjs = require('./chunk-RXSPNNEW.cjs');var _chunkZLNSRDW7cjs = require('./chunk-ZLNSRDW7.cjs');var _chunkWQHSSKSDcjs = require('./chunk-WQHSSKSD.cjs');var _chunkCIWFQSJQcjs = require('./chunk-CIWFQSJQ.cjs');var _chunkGG67ZAXXcjs = require('./chunk-GG67ZAXX.cjs');var _chunkIPW4LWUMcjs = require('./chunk-IPW4LWUM.cjs');var _chunkSHU7K6YPcjs = require('./chunk-SHU7K6YP.cjs');var _chunkHNEXKGNRcjs = require('./chunk-HNEXKGNR.cjs');var _chunkRQHL6EVIcjs = require('./chunk-RQHL6EVI.cjs');var _chunkXTLGRWI2cjs = require('./chunk-XTLGRWI2.cjs');var _chunkFSTZSNDBcjs = require('./chunk-FSTZSNDB.cjs');var _chunkYNCQNUT4cjs = require('./chunk-YNCQNUT4.cjs');var _chunkI33LBSLYcjs = require('./chunk-I33LBSLY.cjs');var _chunkSJMGQLYScjs = require('./chunk-SJMGQLYS.cjs');var _chunkF3JXHUP4cjs = require('./chunk-F3JXHUP4.cjs');var _chunkPEJHW4CAcjs = require('./chunk-PEJHW4CA.cjs');var _chunkNAYMME55cjs = require('./chunk-NAYMME55.cjs');var _chunkAHHZAXLVcjs = require('./chunk-AHHZAXLV.cjs');var _chunkJRDQRETRcjs = require('./chunk-JRDQRETR.cjs');var _chunkOWGBKUJ2cjs = require('./chunk-OWGBKUJ2.cjs');var _chunkQXQ5BE4Ccjs = require('./chunk-QXQ5BE4C.cjs');var _chunkMGCDUMSJcjs = require('./chunk-MGCDUMSJ.cjs');var _chunk3YMN635Acjs = require('./chunk-3YMN635A.cjs');var _chunk3KWI3VEHcjs = require('./chunk-3KWI3VEH.cjs');var _chunkR55FGFKUcjs = require('./chunk-R55FGFKU.cjs');var _chunkGRFK4SBRcjs = require('./chunk-GRFK4SBR.cjs');var _chunk7RS2XXUGcjs = require('./chunk-7RS2XXUG.cjs');var _chunkZ4ZUDQ7Ecjs = require('./chunk-Z4ZUDQ7E.cjs');var _chunkDBRT37L4cjs = require('./chunk-DBRT37L4.cjs');var _chunkIMRTC6QScjs = require('./chunk-IMRTC6QS.cjs');var _chunkOFLOVIU2cjs = require('./chunk-OFLOVIU2.cjs');var _chunkAWGKYXZCcjs = require('./chunk-AWGKYXZC.cjs');var _chunkUTMQRL7Ncjs = require('./chunk-UTMQRL7N.cjs');var _chunkIADIYOLEcjs = require('./chunk-IADIYOLE.cjs');var _chunkIBMY5FOXcjs = require('./chunk-IBMY5FOX.cjs');var _chunkJJLTXK5Jcjs = require('./chunk-JJLTXK5J.cjs');var _chunkWNIVBVW7cjs = require('./chunk-WNIVBVW7.cjs');var _chunkNGLE2TBGcjs = require('./chunk-NGLE2TBG.cjs');var _chunkYWTY4X2Rcjs = require('./chunk-YWTY4X2R.cjs');var _chunkR3TYGYBQcjs = require('./chunk-R3TYGYBQ.cjs');var _chunk7HFKYJCKcjs = require('./chunk-7HFKYJCK.cjs');var _chunkWM4KSO6Ccjs = require('./chunk-WM4KSO6C.cjs');var _chunkLAHSLTRJcjs = require('./chunk-LAHSLTRJ.cjs');var _chunkBEVPU2EQcjs = require('./chunk-BEVPU2EQ.cjs');var _chunkEHJK4JRFcjs = require('./chunk-EHJK4JRF.cjs');var _chunkSW62SX4Ycjs = require('./chunk-SW62SX4Y.cjs');var _chunkTRIZIXDAcjs = require('./chunk-TRIZIXDA.cjs');var _chunkHL3QPU5Jcjs = require('./chunk-HL3QPU5J.cjs');var _chunkZCCHYKDGcjs = require('./chunk-ZCCHYKDG.cjs');var _chunkWFR3HBYRcjs = require('./chunk-WFR3HBYR.cjs');var _chunk7XMQFPW7cjs = require('./chunk-7XMQFPW7.cjs');var _chunkDAFN5EJRcjs = require('./chunk-DAFN5EJR.cjs');var _chunkU3OEHN5Pcjs = require('./chunk-U3OEHN5P.cjs');var _chunkNBUEBREGcjs = require('./chunk-NBUEBREG.cjs');var _chunkZHNB3KNNcjs = require('./chunk-ZHNB3KNN.cjs');var _chunk4KUPCNXNcjs = require('./chunk-4KUPCNXN.cjs');var _chunkYXKPCISKcjs = require('./chunk-YXKPCISK.cjs');var _chunkTUZHNOSGcjs = require('./chunk-TUZHNOSG.cjs');var _chunk442DWBIMcjs = require('./chunk-442DWBIM.cjs');var _chunkPNTFWNQBcjs = require('./chunk-PNTFWNQB.cjs');var _chunkYSTUBBOJcjs = require('./chunk-YSTUBBOJ.cjs');var _chunkXPF42SEFcjs = require('./chunk-XPF42SEF.cjs');var _chunkR6GHLSJBcjs = require('./chunk-R6GHLSJB.cjs');var _chunkBL5SQB5Scjs = require('./chunk-BL5SQB5S.cjs');var _chunkY7RFTHSRcjs = require('./chunk-Y7RFTHSR.cjs');var _chunkBZMSXMATcjs = require('./chunk-BZMSXMAT.cjs');var _chunkBDJWSWG6cjs = require('./chunk-BDJWSWG6.cjs');var _chunkAAOM3KE2cjs = require('./chunk-AAOM3KE2.cjs');var _chunk6G7TWED4cjs = require('./chunk-6G7TWED4.cjs');var _chunkCJ3FPRHUcjs = require('./chunk-CJ3FPRHU.cjs');var _chunk53BDOG3Ycjs = require('./chunk-53BDOG3Y.cjs');var _chunkQJUPJFCQcjs = require('./chunk-QJUPJFCQ.cjs');var _chunk66577RZGcjs = require('./chunk-66577RZG.cjs');var _chunkDOH2U2KJcjs = require('./chunk-DOH2U2KJ.cjs');var _chunkAQRYBCA3cjs = require('./chunk-AQRYBCA3.cjs');var _chunkHC3HZK4Qcjs = require('./chunk-HC3HZK4Q.cjs');var _chunkGOUUMCT7cjs = require('./chunk-GOUUMCT7.cjs');var _chunk4FCH7KNTcjs = require('./chunk-4FCH7KNT.cjs');var _chunkKRY2OVNWcjs = require('./chunk-KRY2OVNW.cjs');var _chunkLEH3IYNPcjs = require('./chunk-LEH3IYNP.cjs');var _chunkEYWIFSMNcjs = require('./chunk-EYWIFSMN.cjs');var _chunkE3XEHRICcjs = require('./chunk-E3XEHRIC.cjs');var _chunkH47HWN3Wcjs = require('./chunk-H47HWN3W.cjs');var _chunkP2IDCWXLcjs = require('./chunk-P2IDCWXL.cjs');var _chunkLOEKNPBGcjs = require('./chunk-LOEKNPBG.cjs');require('./chunk-OBWPUDD3.cjs');var _chunk2JSUJZJRcjs = require('./chunk-2JSUJZJR.cjs');var _chunkWYRK6YJUcjs = require('./chunk-WYRK6YJU.cjs');var _chunkE374WHO7cjs = require('./chunk-E374WHO7.cjs');require('./chunk-PEYRR7GN.cjs');require('./chunk-Z6OOXW67.cjs');require('./chunk-EROXO3T4.cjs');var _chunk6DKD76DKcjs = require('./chunk-6DKD76DK.cjs');var _chunkMIQQGQM6cjs = require('./chunk-MIQQGQM6.cjs');var _chunkBBVARAQQcjs = require('./chunk-BBVARAQQ.cjs');var _chunkD6F22MNScjs = require('./chunk-D6F22MNS.cjs');var _chunkHR3IUTNWcjs = require('./chunk-HR3IUTNW.cjs');var _chunkQLDNLCI3cjs = require('./chunk-QLDNLCI3.cjs');var _chunkA2HUSITFcjs = require('./chunk-A2HUSITF.cjs');var _chunkWYM2JV5Tcjs = require('./chunk-WYM2JV5T.cjs');var _chunkWLNQOMKLcjs = require('./chunk-WLNQOMKL.cjs');var _chunk6YAVWI3Xcjs = require('./chunk-6YAVWI3X.cjs');var _chunkOLZEQGPJcjs = require('./chunk-OLZEQGPJ.cjs');var _chunkJ3DPGMAEcjs = require('./chunk-J3DPGMAE.cjs');var _chunkFJX3YNGWcjs = require('./chunk-FJX3YNGW.cjs');require('./chunk-I6KKO3TI.cjs');var _chunkDGMGGT4Acjs = require('./chunk-DGMGGT4A.cjs');require('./chunk-BGYDTTCY.cjs');var _chunkG33UBR6Fcjs = require('./chunk-G33UBR6F.cjs');var _chunk5N3BA46Dcjs = require('./chunk-5N3BA46D.cjs');var _chunkWB2TJU2Jcjs = require('./chunk-WB2TJU2J.cjs');var _chunkJ2YCCSJVcjs = require('./chunk-J2YCCSJV.cjs');var _chunk5JPRNKKUcjs = require('./chunk-5JPRNKKU.cjs');require('./chunk-QFLTOQ2J.cjs');var _chunkEGUKWDAKcjs = require('./chunk-EGUKWDAK.cjs');var _chunkTTO5FQC7cjs = require('./chunk-TTO5FQC7.cjs');var _chunkY52SHFCPcjs = require('./chunk-Y52SHFCP.cjs');var _chunk4MAOF3ZPcjs = require('./chunk-4MAOF3ZP.cjs');require('./chunk-4YUDBZFA.cjs');var Zr=typeof window<"u";exports.KEY_CODES = _chunkUTMQRL7Ncjs.a; exports.add = _chunk5N3BA46Dcjs.a; exports.addProp = _chunkG33UBR6Fcjs.a; exports.allPass = _chunkWB2TJU2Jcjs.a; exports.anyPass = _chunkJ2YCCSJVcjs.a; exports.ceil = _chunk5JPRNKKUcjs.a; exports.chunk = _chunkEGUKWDAKcjs.a; exports.clamp = _chunkTTO5FQC7cjs.a; exports.clone = _chunkY52SHFCPcjs.a; exports.concat = _chunkA2HUSITFcjs.a; exports.conditional = _chunkWYM2JV5Tcjs.a; exports.constant = _chunkWLNQOMKLcjs.a; exports.countBy = _chunk6YAVWI3Xcjs.a; exports.curry = _chunk4MAOF3ZPcjs.a; exports.debounce = _chunkOLZEQGPJcjs.a; exports.difference = _chunkFJX3YNGWcjs.a; exports.differenceWith = _chunkJ3DPGMAEcjs.a; exports.divide = _chunk2JSUJZJRcjs.a; exports.doNothing = _chunkWYRK6YJUcjs.a; exports.drop = _chunkHR3IUTNWcjs.a; exports.dropFirstBy = _chunkE374WHO7cjs.a; exports.dropLast = _chunkBBVARAQQcjs.a; exports.dropLastWhile = _chunkMIQQGQM6cjs.a; exports.dropWhile = _chunkD6F22MNScjs.a; exports.entries = _chunkQLDNLCI3cjs.a; exports.evolve = _chunk4FCH7KNTcjs.a; exports.filter = _chunkKRY2OVNWcjs.a; exports.find = _chunkH47HWN3Wcjs.a; exports.findIndex = _chunkLEH3IYNPcjs.a; exports.findLast = _chunkE3XEHRICcjs.a; exports.findLastIndex = _chunkEYWIFSMNcjs.a; exports.first = _chunkLOEKNPBGcjs.a; exports.firstBy = _chunkP2IDCWXLcjs.a; exports.flat = _chunk6G7TWED4cjs.a; exports.flatMap = _chunkAAOM3KE2cjs.a; exports.floor = _chunkCJ3FPRHUcjs.a; exports.forEach = _chunkQJUPJFCQcjs.a; exports.forEachObj = _chunk53BDOG3Ycjs.a; exports.fromEntries = _chunk66577RZGcjs.a; exports.fromKeys = _chunkDOH2U2KJcjs.a; exports.funnel = _chunkGOUUMCT7cjs.a; exports.groupBy = _chunkXPF42SEFcjs.a; exports.hasAtLeast = _chunk6DKD76DKcjs.a; exports.hasSubObject = _chunkR6GHLSJBcjs.a; exports.humanReadableFileSize = _chunkY7RFTHSRcjs.a; exports.identity = _chunkAQRYBCA3cjs.a; exports.indexBy = _chunkBZMSXMATcjs.a; exports.intersection = _chunkZHNB3KNNcjs.a; exports.intersectionWith = _chunkBDJWSWG6cjs.a; exports.invert = _chunk4KUPCNXNcjs.a; exports.isArray = _chunkYXKPCISKcjs.a; exports.isBigInt = _chunkTUZHNOSGcjs.a; exports.isBoolean = _chunk442DWBIMcjs.a; exports.isBrowser = Zr; exports.isDate = _chunkPNTFWNQBcjs.a; exports.isDeepEqual = _chunkBL5SQB5Scjs.a; exports.isDefined = _chunkYSTUBBOJcjs.a; exports.isEmpty = _chunkTRIZIXDAcjs.a; exports.isError = _chunkHL3QPU5Jcjs.a; exports.isFunction = _chunkZCCHYKDGcjs.a; exports.isIncludedIn = _chunkWFR3HBYRcjs.a; exports.isNonNull = _chunk7XMQFPW7cjs.a; exports.isNonNullish = _chunkDAFN5EJRcjs.a; exports.isNot = _chunkU3OEHN5Pcjs.a; exports.isNullish = _chunkNBUEBREGcjs.a; exports.isNumber = _chunkYWTY4X2Rcjs.a; exports.isObjectType = _chunkR3TYGYBQcjs.a; exports.isPlainObject = _chunk7HFKYJCKcjs.a; exports.isPromise = _chunkWM4KSO6Ccjs.a; exports.isShallowEqual = _chunkLAHSLTRJcjs.a; exports.isStrictEqual = _chunkBEVPU2EQcjs.a; exports.isString = _chunkEHJK4JRFcjs.a; exports.isSymbol = _chunkSW62SX4Ycjs.a; exports.isTruthy = _chunkOFLOVIU2cjs.a; exports.join = _chunkAWGKYXZCcjs.a; exports.keys = _chunkIADIYOLEcjs.a; exports.last = _chunkIBMY5FOXcjs.a; exports.length = _chunkJJLTXK5Jcjs.a; exports.map = _chunkR55FGFKUcjs.a; exports.mapKeys = _chunkWNIVBVW7cjs.a; exports.mapToObj = _chunkNGLE2TBGcjs.a; exports.mapValues = _chunk3YMN635Acjs.a; exports.mapWithFeedback = _chunk3KWI3VEHcjs.a; exports.meanBy = _chunkGRFK4SBRcjs.a; exports.merge = _chunkDBRT37L4cjs.a; exports.mergeAll = _chunk7RS2XXUGcjs.a; exports.mergeDeep = _chunkZ4ZUDQ7Ecjs.a; exports.multiply = _chunkIMRTC6QScjs.a; exports.nthBy = _chunkF3JXHUP4cjs.a; exports.objOf = _chunkPEJHW4CAcjs.a; exports.omit = _chunkAHHZAXLVcjs.a; exports.omitBy = _chunkNAYMME55cjs.a; exports.once = _chunkJRDQRETRcjs.a; exports.only = _chunkOWGBKUJ2cjs.a; exports.partition = _chunkQXQ5BE4Ccjs.a; exports.pathOr = _chunkMGCDUMSJcjs.a; exports.pick = _chunkRQHL6EVIcjs.a; exports.pickBy = _chunkHNEXKGNRcjs.a; exports.pipe = _chunkDGMGGT4Acjs.a; exports.piped = _chunkXTLGRWI2cjs.a; exports.product = _chunkFSTZSNDBcjs.a; exports.prop = _chunkYNCQNUT4cjs.a; exports.propImplementation = _chunkYNCQNUT4cjs.b; exports.pullObject = _chunkI33LBSLYcjs.a; exports.randomInteger = _chunkSJMGQLYScjs.a; exports.randomString = _chunkNC5GO4RUcjs.a; exports.range = _chunkRXSPNNEWcjs.a; exports.rankBy = _chunkZLNSRDW7cjs.a; exports.reduce = _chunkWQHSSKSDcjs.a; exports.reverse = _chunkCIWFQSJQcjs.a; exports.round = _chunkGG67ZAXXcjs.a; exports.sample = _chunkIPW4LWUMcjs.a; exports.set = _chunkQSYAGOIBcjs.a; exports.setPath = _chunkSHU7K6YPcjs.a; exports.setPathImplementation = _chunkSHU7K6YPcjs.b; exports.shuffle = _chunkXGT73UQWcjs.a; exports.sleep = _chunkHC3HZK4Qcjs.a; exports.sliceString = _chunk3WCOFJCScjs.a; exports.slugify = _chunkEP626HCIcjs.a; exports.sort = _chunkDGLS43L4cjs.a; exports.sortBy = _chunkKM5XOWVGcjs.a; exports.sortedIndex = _chunkUEL4TCYDcjs.a; exports.sortedIndexBy = _chunkUIXBYMGBcjs.a; exports.sortedIndexWith = _chunkNOZQSRNNcjs.a; exports.sortedLastIndex = _chunkNWEOHZQHcjs.a; exports.sortedLastIndexBy = _chunkJ7LDTU7Wcjs.a; exports.splice = _chunkTNBCVNKHcjs.a; exports.split = _chunkTFN3JWPScjs.a; exports.splitAt = _chunkJFHH5VKUcjs.a; exports.splitWhen = _chunkIP2ZEYIUcjs.a; exports.stringToPath = _chunkVRZNQSZNcjs.a; exports.subtract = _chunkRMLQX4GAcjs.a; exports.sum = _chunkTRUODFSQcjs.a; exports.sumBy = _chunkI4WQXZJHcjs.a; exports.swapIndices = _chunkQNFRANE2cjs.a; exports.swapProps = _chunkFRWE2CFIcjs.a; exports.take = _chunkCZI4WD5Qcjs.a; exports.takeFirstBy = _chunkU4HKRBD3cjs.a; exports.takeLast = _chunkLLHOSKEGcjs.a; exports.takeLastWhile = _chunk43XCMZYTcjs.a; exports.takeWhile = _chunkP4KRPPMAcjs.a; exports.tap = _chunkVH3XIFK7cjs.a; exports.times = _chunk6DDL3ZF6cjs.a; exports.toCamelCase = _chunkVNI4VRFMcjs.a; exports.toCapitalCase = _chunk7GAGU65Ucjs.a; exports.toConstantCase = _chunk5GI4OEUMcjs.a; exports.toKebabCase = _chunkRAHS5RJScjs.a; exports.toNoCase = _chunkI27XCDDIcjs.a; exports.toPascalCase = _chunkG74G5PZTcjs.a; exports.toPascalSnakeCase = _chunkWVTQN2AIcjs.a; exports.toSentenceCase = _chunkN7AESA4Wcjs.a; exports.toSnakeCase = _chunkLPNHLDEAcjs.a; exports.toTrainCase = _chunkX7EK7EDZcjs.a; exports.unique = _chunkBBYC5W6Ecjs.a; exports.uniqueBy = _chunkESGYUUU2cjs.a; exports.uniqueWith = _chunkRGUX2LCHcjs.a; exports.values = _chunkMYUMWF5Acjs.a; exports.zip = _chunkEFURGOGBcjs.a; exports.zipWith = _chunkM5Z4GCV3cjs.a;
package/dist/index.d.cts CHANGED
@@ -37,6 +37,7 @@ export { forEach } from './for-each.cjs';
37
37
  export { forEachObj } from './for-each-obj.cjs';
38
38
  export { fromEntries } from './from-entries.cjs';
39
39
  export { fromKeys } from './from-keys.cjs';
40
+ export { funnel } from './funnel.cjs';
40
41
  export { groupBy } from './group-by.cjs';
41
42
  export { hasAtLeast } from './has-at-least.cjs';
42
43
  export { hasSubObject } from './has-sub-object.cjs';
package/dist/index.d.ts CHANGED
@@ -37,6 +37,7 @@ export { forEach } from './for-each.js';
37
37
  export { forEachObj } from './for-each-obj.js';
38
38
  export { fromEntries } from './from-entries.js';
39
39
  export { fromKeys } from './from-keys.js';
40
+ export { funnel } from './funnel.js';
40
41
  export { groupBy } from './group-by.js';
41
42
  export { hasAtLeast } from './has-at-least.js';
42
43
  export { hasSubObject } from './has-sub-object.js';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as Ur}from"./chunk-ONHSFOMY.js";import{a as Sr}from"./chunk-EF5X6QTJ.js";import{a as Vr}from"./chunk-LG6MCIRY.js";import{a as Xr}from"./chunk-NUWRLWTO.js";import{a as Wr}from"./chunk-QF7NW7HB.js";import{a as Mr}from"./chunk-L4ZCRIBG.js";import{a as Nr}from"./chunk-ZIGQWNCG.js";import{a as Or}from"./chunk-OT55MXTZ.js";import{a as Pr}from"./chunk-L4S5OAPG.js";import{a as Qr}from"./chunk-5OPUQ5T6.js";import{a as Lr}from"./chunk-MFSRIHWE.js";import{a as Rr}from"./chunk-RW5FFMRB.js";import{a as Tr}from"./chunk-NLFMCMRF.js";import{a as Dr}from"./chunk-X5D4U2SM.js";import{a as Fr}from"./chunk-DYTMLSGO.js";import{a as Ar}from"./chunk-KN4W6OD3.js";import{a as Gr}from"./chunk-HI5HNTZE.js";import{a as Hr}from"./chunk-5BVIP7QQ.js";import{a as Ir}from"./chunk-ZAZDS3SB.js";import{a as Jr}from"./chunk-CQ7LGCRX.js";import{a as Kr}from"./chunk-EYPNBGK5.js";import"./chunk-MZEHWQF3.js";import{a as kr}from"./chunk-QDVSGYJD.js";import{a as qr}from"./chunk-2ZDGLSFC.js";import{a as lr}from"./chunk-V2A3F3I4.js";import{a as vr}from"./chunk-CII3USNE.js";import{a as zr}from"./chunk-QI5SZK45.js";import{a as Cr}from"./chunk-SB72SOA2.js";import{a as Er}from"./chunk-RYG2DHC3.js";import{a as wr}from"./chunk-24TP4E2P.js";import{a as Br}from"./chunk-4WJ75PJB.js";import{a as yr}from"./chunk-37JFJJRL.js";import{a as ar}from"./chunk-I2WOF7PP.js";import{a as gr}from"./chunk-2Y6BV2AH.js";import{a as hr}from"./chunk-NWX42UEX.js";import{a as br}from"./chunk-RBODUO3Q.js";import{a as jr}from"./chunk-CZLV6ZLZ.js";import{a as xr}from"./chunk-JYFYY7NT.js";import{a as mr}from"./chunk-6SYP2DRD.js";import{a as nr}from"./chunk-FGVDZJ7U.js";import{a as dr}from"./chunk-XSSRBOMF.js";import{a as sr}from"./chunk-2GPOH4MN.js";import{a as ir}from"./chunk-3UB2RIEU.js";import{a as cr}from"./chunk-ATE3F5N2.js";import{a as ur}from"./chunk-TWWU2V2W.js";import"./chunk-JZ463SIK.js";import{a as Zo}from"./chunk-OW5U2BI2.js";import{a as _o}from"./chunk-G57ZPKMR.js";import{a as $o}from"./chunk-2IZU6WD5.js";import{a as or}from"./chunk-V6HQDVID.js";import{a as rr}from"./chunk-XCB6Q73P.js";import{a as er}from"./chunk-5JB2UNJV.js";import{a as fr,b as pr}from"./chunk-6UDUSN46.js";import{a as tr}from"./chunk-OOJU5HRX.js";import{a as Qo}from"./chunk-32CXKACC.js";import{a as So}from"./chunk-RLO65MYN.js";import{a as To}from"./chunk-7UGK4BYN.js";import{a as Uo,b as Vo}from"./chunk-ETVIOWIV.js";import{a as Wo}from"./chunk-XIC3HU42.js";import{a as Xo}from"./chunk-I2Z6A55T.js";import{a as Yo}from"./chunk-JOTWEYDR.js";import{a as Jo}from"./chunk-FQQ7JL2Z.js";import{a as Lo}from"./chunk-AE3CGQUB.js";import{a as Ko}from"./chunk-UKXOFPA6.js";import{a as Mo}from"./chunk-C6IMN7SF.js";import{a as No}from"./chunk-TJCE2J3B.js";import{a as Oo}from"./chunk-HZNODTV6.js";import{a as Po}from"./chunk-HF5OFI3W.js";import{a as Ro}from"./chunk-JTEBK6CE.js";import{a as Co}from"./chunk-XL4J54XF.js";import{a as qo}from"./chunk-5RDW3Z6T.js";import{a as Do}from"./chunk-72XBT2YD.js";import{a as Fo}from"./chunk-7P7RJIIO.js";import{a as Go}from"./chunk-PQTXQYXP.js";import{a as Eo}from"./chunk-T4EXOJCT.js";import{a as Ho}from"./chunk-JJ5JH3YT.js";import{a as Io}from"./chunk-UDSRBKNR.js";import{a as go}from"./chunk-RFNOAVDK.js";import{a as ho}from"./chunk-BQA4B5JX.js";import{a as jo}from"./chunk-7TAKH2LO.js";import{a as ko}from"./chunk-N2IZRL36.js";import{a as lo}from"./chunk-7DBLJJ5X.js";import{a as vo}from"./chunk-QSH3UEIB.js";import{a as zo}from"./chunk-Y5CMISVL.js";import{a as Ao}from"./chunk-FBGRS3MN.js";import{a as so}from"./chunk-EBS4GCKX.js";import{a as wo}from"./chunk-6AFNPQW2.js";import{a as co}from"./chunk-HFNVS6OX.js";import{a as uo}from"./chunk-OAHCRUJ7.js";import{a as yo}from"./chunk-5ZDIGGAT.js";import{a as Bo}from"./chunk-UYLVIAK4.js";import{a as ao}from"./chunk-YBJMFRB6.js";import{a as bo}from"./chunk-RFHE6DOJ.js";import{a as eo}from"./chunk-7EMQYM4A.js";import{a as to}from"./chunk-VPHS3T3W.js";import{a as fo}from"./chunk-75K2QEB3.js";import{a as po}from"./chunk-6BKLAQWR.js";import{a as xo}from"./chunk-QPP664N4.js";import{a as mo}from"./chunk-G73S4IVJ.js";import{a as no}from"./chunk-3I7FLADN.js";import{a as io}from"./chunk-Q2HW4RVT.js";import{a as X}from"./chunk-VGOZYUH3.js";import{a as Y}from"./chunk-PHYBTFYH.js";import{a as Z}from"./chunk-QID4F4QT.js";import{a as _}from"./chunk-AZUJCNUP.js";import{a as $}from"./chunk-F3EZ6NQM.js";import{a as oo}from"./chunk-DNSXSQCO.js";import{a as ro}from"./chunk-UVAWCZB6.js";import{a as R}from"./chunk-A3CPN3V3.js";import{a as Q}from"./chunk-EPZOLJ72.js";import{a as S}from"./chunk-4YJCXB4Y.js";import{a as T}from"./chunk-46GBCFAG.js";import{a as U}from"./chunk-NDZHL7TS.js";import{a as W}from"./chunk-R5ZG4R5L.js";import{a as V}from"./chunk-BY7H5COY.js";import{a as I}from"./chunk-CMLEUN6Z.js";import{a as J}from"./chunk-6HDZ5MBT.js";import{a as K}from"./chunk-P5SZ4PXO.js";import{a as L}from"./chunk-65GY7S4U.js";import{a as M}from"./chunk-QEPOLOSH.js";import{a as N}from"./chunk-EMC6CON4.js";import{a as O}from"./chunk-AX5O7BNT.js";import{a as P}from"./chunk-7ERLIBAL.js";import{a as z}from"./chunk-2RIB46MQ.js";import{a as A}from"./chunk-SHEET7PF.js";import{a as C}from"./chunk-LNBMZUOM.js";import{a as D}from"./chunk-YNWN6VKC.js";import{a as E}from"./chunk-GHJ6ICLU.js";import{a as F}from"./chunk-3A5UOUAH.js";import{a as G}from"./chunk-RBENSFJD.js";import{a as H}from"./chunk-NZMN2PA5.js";import"./chunk-5SAUYUEK.js";import{a}from"./chunk-XXNSQDJF.js";import{a as b}from"./chunk-AFO7BV2X.js";import{a as h}from"./chunk-HTYL3XQS.js";import"./chunk-QNK2WMNL.js";import"./chunk-YYEJOSR3.js";import"./chunk-7KBK2RWQ.js";import{a as g}from"./chunk-AFLCNPZB.js";import{a as j}from"./chunk-HW7P5ZFZ.js";import{a as k}from"./chunk-BUJTXQXW.js";import{a as l}from"./chunk-2VBBLHTV.js";import{a as q}from"./chunk-MPQ2QXOP.js";import{a as v}from"./chunk-BQT4FWHH.js";import{a as d}from"./chunk-7FMUBMHT.js";import{a as i}from"./chunk-A2PAJNYA.js";import{a as s}from"./chunk-T5XG33UI.js";import{a as w}from"./chunk-C3NLWEGJ.js";import{a as c}from"./chunk-ENPSKQUH.js";import{a as y}from"./chunk-PRI7GNFW.js";import{a as B}from"./chunk-6VSPLMEZ.js";import"./chunk-VEZP7VBA.js";import{a as u}from"./chunk-LSSVVDEJ.js";import"./chunk-YK4IY5DJ.js";import{a as r}from"./chunk-3ZQNA333.js";import{a as e}from"./chunk-AOSBQ3GE.js";import{a as t}from"./chunk-KVO54AJZ.js";import{a as f}from"./chunk-2Y7RBPNW.js";import{a as p}from"./chunk-7DI34UJJ.js";import"./chunk-MBNDHLAB.js";import{a as x}from"./chunk-CUCNZMQN.js";import{a as m}from"./chunk-LDSQEYGI.js";import{a as n}from"./chunk-DDJKFY7F.js";import{a as o}from"./chunk-ENYMRDJU.js";import"./chunk-K2EX7PYH.js";var Yr=typeof window<"u";export{ho as KEY_CODES,e as add,r as addProp,t as allPass,f as anyPass,p as ceil,x as chunk,m as clamp,n as clone,d as concat,i as conditional,s as constant,w as countBy,o as curry,c as debounce,B as difference,y as differenceWith,a as divide,b as doNothing,q as drop,h as dropFirstBy,k as dropLast,j as dropLastWhile,l as dropWhile,v as entries,z as evolve,A as filter,F as find,C as findIndex,E as findLast,D as findLastIndex,H as first,G as firstBy,J as flat,I as flatMap,K as floor,M as forEach,L as forEachObj,N as fromEntries,O as fromKeys,P as groupBy,g as hasAtLeast,R as hasSubObject,S as humanReadableFileSize,T as identity,U as indexBy,V as intersection,W as intersectionWith,X as invert,Y as isArray,Z as isBigInt,_ as isBoolean,Yr as isBrowser,$ as isDate,Q as isDeepEqual,oo as isDefined,ro as isEmpty,eo as isError,to as isFunction,fo as isIncludedIn,po as isNonNull,xo as isNonNullish,mo as isNot,no as isNullish,io as isNumber,so as isObjectType,wo as isPlainObject,co as isPromise,uo as isShallowEqual,yo as isStrictEqual,Bo as isString,ao as isSymbol,bo as isTruthy,go as join,jo as keys,ko as last,lo as length,qo as map,vo as mapKeys,zo as mapToObj,Ao as mapValues,Co as mapWithFeedback,Do as meanBy,Eo as merge,Fo as mergeAll,Go as mergeDeep,Ho as multiply,Io as nthBy,Jo as objOf,Ko as omit,Lo as omitBy,Mo as once,No as only,Oo as partition,Po as pathOr,Qo as pick,Ro as pickBy,u as pipe,So as piped,To as product,Uo as prop,Vo as propImplementation,Wo as pullObject,Xo as randomInteger,Yo as randomString,Zo as range,_o as rankBy,$o as reduce,or as reverse,rr as round,er as sample,tr as set,fr as setPath,pr as setPathImplementation,xr as shuffle,mr as sleep,nr as sliceString,dr as slugify,ir as sort,sr as sortBy,wr as sortedIndex,cr as sortedIndexBy,ur as sortedIndexWith,yr as sortedLastIndex,Br as sortedLastIndexBy,ar as splice,br as split,gr as splitAt,hr as splitWhen,jr as stringToPath,kr as subtract,lr as sum,qr as sumBy,vr as swapIndices,zr as swapProps,Ar as take,Cr as takeFirstBy,Dr as takeLast,Er as takeLastWhile,Fr as takeWhile,Gr as tap,Hr as times,Ir as toCamelCase,Jr as toCapitalCase,Kr as toConstantCase,Mr as toKebabCase,Lr as toNoCase,Nr as toPascalCase,Or as toPascalSnakeCase,Pr as toSentenceCase,Qr as toSnakeCase,Rr as toTrainCase,Sr as unique,Tr as uniqueBy,Ur as uniqueWith,Vr as values,Wr as zip,Xr as zipWith};
1
+ import{a as Ur}from"./chunk-NLFMCMRF.js";import{a as Vr}from"./chunk-ONHSFOMY.js";import{a as Tr}from"./chunk-EF5X6QTJ.js";import{a as Wr}from"./chunk-LG6MCIRY.js";import{a as Yr}from"./chunk-NUWRLWTO.js";import{a as Xr}from"./chunk-QF7NW7HB.js";import{a as Lr}from"./chunk-EYPNBGK5.js";import{a as Nr}from"./chunk-L4ZCRIBG.js";import{a as Or}from"./chunk-ZIGQWNCG.js";import{a as Pr}from"./chunk-OT55MXTZ.js";import{a as Qr}from"./chunk-L4S5OAPG.js";import{a as Rr}from"./chunk-5OPUQ5T6.js";import{a as Mr}from"./chunk-MFSRIHWE.js";import{a as Sr}from"./chunk-RW5FFMRB.js";import{a as Er}from"./chunk-X5D4U2SM.js";import{a as Gr}from"./chunk-DYTMLSGO.js";import{a as Cr}from"./chunk-KN4W6OD3.js";import{a as Hr}from"./chunk-HI5HNTZE.js";import{a as Ir}from"./chunk-5BVIP7QQ.js";import{a as Jr}from"./chunk-ZAZDS3SB.js";import{a as Kr}from"./chunk-CQ7LGCRX.js";import"./chunk-MZEHWQF3.js";import{a as kr}from"./chunk-CZLV6ZLZ.js";import{a as lr}from"./chunk-QDVSGYJD.js";import{a as vr}from"./chunk-2ZDGLSFC.js";import{a as qr}from"./chunk-V2A3F3I4.js";import{a as zr}from"./chunk-CII3USNE.js";import{a as Ar}from"./chunk-QI5SZK45.js";import{a as Dr}from"./chunk-SB72SOA2.js";import{a as Fr}from"./chunk-RYG2DHC3.js";import{a as yr}from"./chunk-TWWU2V2W.js";import{a as cr}from"./chunk-24TP4E2P.js";import{a as ar}from"./chunk-4WJ75PJB.js";import{a as Br}from"./chunk-37JFJJRL.js";import{a as br}from"./chunk-I2WOF7PP.js";import{a as hr}from"./chunk-2Y6BV2AH.js";import{a as jr}from"./chunk-NWX42UEX.js";import{a as gr}from"./chunk-RBODUO3Q.js";import{a as pr}from"./chunk-OOJU5HRX.js";import{a as nr}from"./chunk-JYFYY7NT.js";import{a as dr}from"./chunk-FGVDZJ7U.js";import{a as ir}from"./chunk-XSSRBOMF.js";import{a as wr}from"./chunk-2GPOH4MN.js";import{a as sr}from"./chunk-3UB2RIEU.js";import{a as ur}from"./chunk-ATE3F5N2.js";import"./chunk-JZ463SIK.js";import{a as _o}from"./chunk-JOTWEYDR.js";import{a as $o}from"./chunk-OW5U2BI2.js";import{a as or}from"./chunk-G57ZPKMR.js";import{a as rr}from"./chunk-2IZU6WD5.js";import{a as er}from"./chunk-V6HQDVID.js";import{a as tr}from"./chunk-XCB6Q73P.js";import{a as fr}from"./chunk-5JB2UNJV.js";import{a as xr,b as mr}from"./chunk-6UDUSN46.js";import{a as To}from"./chunk-JTEBK6CE.js";import{a as So}from"./chunk-32CXKACC.js";import{a as Uo}from"./chunk-RLO65MYN.js";import{a as Vo}from"./chunk-7UGK4BYN.js";import{a as Wo,b as Xo}from"./chunk-ETVIOWIV.js";import{a as Yo}from"./chunk-XIC3HU42.js";import{a as Zo}from"./chunk-I2Z6A55T.js";import{a as Ko}from"./chunk-UDSRBKNR.js";import{a as Lo}from"./chunk-FQQ7JL2Z.js";import{a as No}from"./chunk-AE3CGQUB.js";import{a as Mo}from"./chunk-UKXOFPA6.js";import{a as Oo}from"./chunk-C6IMN7SF.js";import{a as Po}from"./chunk-TJCE2J3B.js";import{a as Qo}from"./chunk-HZNODTV6.js";import{a as Ro}from"./chunk-HF5OFI3W.js";import{a as Do}from"./chunk-FBGRS3MN.js";import{a as Eo}from"./chunk-XL4J54XF.js";import{a as zo}from"./chunk-5RDW3Z6T.js";import{a as Fo}from"./chunk-72XBT2YD.js";import{a as Ho}from"./chunk-7P7RJIIO.js";import{a as Io}from"./chunk-PQTXQYXP.js";import{a as Go}from"./chunk-T4EXOJCT.js";import{a as Jo}from"./chunk-JJ5JH3YT.js";import{a as ho}from"./chunk-RFHE6DOJ.js";import{a as jo}from"./chunk-RFNOAVDK.js";import{a as ko}from"./chunk-BQA4B5JX.js";import{a as lo}from"./chunk-7TAKH2LO.js";import{a as qo}from"./chunk-N2IZRL36.js";import{a as vo}from"./chunk-7DBLJJ5X.js";import{a as Ao}from"./chunk-QSH3UEIB.js";import{a as Co}from"./chunk-Y5CMISVL.js";import{a as wo}from"./chunk-Q2HW4RVT.js";import{a as co}from"./chunk-EBS4GCKX.js";import{a as uo}from"./chunk-6AFNPQW2.js";import{a as yo}from"./chunk-HFNVS6OX.js";import{a as Bo}from"./chunk-OAHCRUJ7.js";import{a as ao}from"./chunk-5ZDIGGAT.js";import{a as bo}from"./chunk-UYLVIAK4.js";import{a as go}from"./chunk-YBJMFRB6.js";import{a as to}from"./chunk-UVAWCZB6.js";import{a as fo}from"./chunk-7EMQYM4A.js";import{a as po}from"./chunk-VPHS3T3W.js";import{a as xo}from"./chunk-75K2QEB3.js";import{a as mo}from"./chunk-6BKLAQWR.js";import{a as no}from"./chunk-QPP664N4.js";import{a as io}from"./chunk-G73S4IVJ.js";import{a as so}from"./chunk-3I7FLADN.js";import{a as X}from"./chunk-BY7H5COY.js";import{a as Z}from"./chunk-VGOZYUH3.js";import{a as _}from"./chunk-PHYBTFYH.js";import{a as $}from"./chunk-QID4F4QT.js";import{a as oo}from"./chunk-AZUJCNUP.js";import{a as ro}from"./chunk-F3EZ6NQM.js";import{a as eo}from"./chunk-DNSXSQCO.js";import{a as S}from"./chunk-7ERLIBAL.js";import{a as U}from"./chunk-A3CPN3V3.js";import{a as T}from"./chunk-EPZOLJ72.js";import{a as V}from"./chunk-4YJCXB4Y.js";import{a as W}from"./chunk-NDZHL7TS.js";import{a as Y}from"./chunk-R5ZG4R5L.js";import{a as I}from"./chunk-CMLEUN6Z.js";import{a as J}from"./chunk-6HDZ5MBT.js";import{a as K}from"./chunk-P5SZ4PXO.js";import{a as L}from"./chunk-65GY7S4U.js";import{a as M}from"./chunk-QEPOLOSH.js";import{a as N}from"./chunk-EMC6CON4.js";import{a as O}from"./chunk-AX5O7BNT.js";import{a as Q}from"./chunk-46GBCFAG.js";import{a as R}from"./chunk-6SYP2DRD.js";import{a as P}from"./chunk-AWXJSK4F.js";import{a as z}from"./chunk-2RIB46MQ.js";import{a as A}from"./chunk-SHEET7PF.js";import{a as C}from"./chunk-LNBMZUOM.js";import{a as D}from"./chunk-YNWN6VKC.js";import{a as E}from"./chunk-GHJ6ICLU.js";import{a as F}from"./chunk-3A5UOUAH.js";import{a as G}from"./chunk-RBENSFJD.js";import{a as H}from"./chunk-NZMN2PA5.js";import"./chunk-5SAUYUEK.js";import{a}from"./chunk-XXNSQDJF.js";import{a as b}from"./chunk-AFO7BV2X.js";import{a as h}from"./chunk-HTYL3XQS.js";import"./chunk-QNK2WMNL.js";import"./chunk-YYEJOSR3.js";import"./chunk-7KBK2RWQ.js";import{a as g}from"./chunk-AFLCNPZB.js";import{a as j}from"./chunk-HW7P5ZFZ.js";import{a as k}from"./chunk-BUJTXQXW.js";import{a as l}from"./chunk-2VBBLHTV.js";import{a as q}from"./chunk-MPQ2QXOP.js";import{a as v}from"./chunk-BQT4FWHH.js";import{a as d}from"./chunk-7FMUBMHT.js";import{a as i}from"./chunk-A2PAJNYA.js";import{a as s}from"./chunk-T5XG33UI.js";import{a as w}from"./chunk-C3NLWEGJ.js";import{a as c}from"./chunk-ENPSKQUH.js";import{a as y}from"./chunk-PRI7GNFW.js";import{a as B}from"./chunk-6VSPLMEZ.js";import"./chunk-VEZP7VBA.js";import{a as u}from"./chunk-LSSVVDEJ.js";import"./chunk-YK4IY5DJ.js";import{a as r}from"./chunk-3ZQNA333.js";import{a as e}from"./chunk-AOSBQ3GE.js";import{a as t}from"./chunk-KVO54AJZ.js";import{a as f}from"./chunk-2Y7RBPNW.js";import{a as p}from"./chunk-7DI34UJJ.js";import"./chunk-MBNDHLAB.js";import{a as x}from"./chunk-CUCNZMQN.js";import{a as m}from"./chunk-LDSQEYGI.js";import{a as n}from"./chunk-DDJKFY7F.js";import{a as o}from"./chunk-ENYMRDJU.js";import"./chunk-K2EX7PYH.js";var Zr=typeof window<"u";export{ko as KEY_CODES,e as add,r as addProp,t as allPass,f as anyPass,p as ceil,x as chunk,m as clamp,n as clone,d as concat,i as conditional,s as constant,w as countBy,o as curry,c as debounce,B as difference,y as differenceWith,a as divide,b as doNothing,q as drop,h as dropFirstBy,k as dropLast,j as dropLastWhile,l as dropWhile,v as entries,z as evolve,A as filter,F as find,C as findIndex,E as findLast,D as findLastIndex,H as first,G as firstBy,J as flat,I as flatMap,K as floor,M as forEach,L as forEachObj,N as fromEntries,O as fromKeys,P as funnel,S as groupBy,g as hasAtLeast,U as hasSubObject,V as humanReadableFileSize,Q as identity,W as indexBy,X as intersection,Y as intersectionWith,Z as invert,_ as isArray,$ as isBigInt,oo as isBoolean,Zr as isBrowser,ro as isDate,T as isDeepEqual,eo as isDefined,to as isEmpty,fo as isError,po as isFunction,xo as isIncludedIn,mo as isNonNull,no as isNonNullish,io as isNot,so as isNullish,wo as isNumber,co as isObjectType,uo as isPlainObject,yo as isPromise,Bo as isShallowEqual,ao as isStrictEqual,bo as isString,go as isSymbol,ho as isTruthy,jo as join,lo as keys,qo as last,vo as length,zo as map,Ao as mapKeys,Co as mapToObj,Do as mapValues,Eo as mapWithFeedback,Fo as meanBy,Go as merge,Ho as mergeAll,Io as mergeDeep,Jo as multiply,Ko as nthBy,Lo as objOf,Mo as omit,No as omitBy,Oo as once,Po as only,Qo as partition,Ro as pathOr,So as pick,To as pickBy,u as pipe,Uo as piped,Vo as product,Wo as prop,Xo as propImplementation,Yo as pullObject,Zo as randomInteger,_o as randomString,$o as range,or as rankBy,rr as reduce,er as reverse,tr as round,fr as sample,pr as set,xr as setPath,mr as setPathImplementation,nr as shuffle,R as sleep,dr as sliceString,ir as slugify,sr as sort,wr as sortBy,cr as sortedIndex,ur as sortedIndexBy,yr as sortedIndexWith,Br as sortedLastIndex,ar as sortedLastIndexBy,br as splice,gr as split,hr as splitAt,jr as splitWhen,kr as stringToPath,lr as subtract,qr as sum,vr as sumBy,zr as swapIndices,Ar as swapProps,Cr as take,Dr as takeFirstBy,Er as takeLast,Fr as takeLastWhile,Gr as takeWhile,Hr as tap,Ir as times,Jr as toCamelCase,Kr as toCapitalCase,Lr as toConstantCase,Nr as toKebabCase,Mr as toNoCase,Or as toPascalCase,Pr as toPascalSnakeCase,Qr as toSentenceCase,Rr as toSnakeCase,Sr as toTrainCase,Tr as unique,Ur as uniqueBy,Vr as uniqueWith,Wr as values,Xr as zip,Yr as zipWith};
@@ -35,7 +35,7 @@ type SwappedIndices<T extends IterableContainer | string, K1 extends number, K2
35
35
  * swapIndices(data, index1, index2)
36
36
  * @example
37
37
  * swapIndices(['a', 'b', 'c'], 0, 1) // => ['b', 'a', 'c']
38
- * swapIndices(['a', 'b', 'c'], 1, -1) // => ['c', 'b', 'a']
38
+ * swapIndices(['a', 'b', 'c'], 1, -1) // => ['a', 'c', 'b']
39
39
  * swapIndices('abc', 0, 1) // => 'bac'
40
40
  * @dataFirst
41
41
  * @category Array
@@ -35,7 +35,7 @@ type SwappedIndices<T extends IterableContainer | string, K1 extends number, K2
35
35
  * swapIndices(data, index1, index2)
36
36
  * @example
37
37
  * swapIndices(['a', 'b', 'c'], 0, 1) // => ['b', 'a', 'c']
38
- * swapIndices(['a', 'b', 'c'], 1, -1) // => ['c', 'b', 'a']
38
+ * swapIndices(['a', 'b', 'c'], 1, -1) // => ['a', 'c', 'b']
39
39
  * swapIndices('abc', 0, 1) // => 'bac'
40
40
  * @dataFirst
41
41
  * @category Array
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vinicunca/perkakas",
3
3
  "type": "module",
4
- "version": "1.2.0",
4
+ "version": "1.2.2",
5
5
  "description": "Utility for JavaScript and Typescript.",
6
6
  "author": "praburangki<https://github.com/praburangki>",
7
7
  "license": "MIT",
@@ -37,25 +37,23 @@
37
37
  "node": ">=20.0.0"
38
38
  },
39
39
  "dependencies": {
40
- "type-fest": "^4.30.2"
40
+ "type-fest": "^4.31.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@types/node": "^22.10.2",
44
- "@vinicunca/eslint-config": "^2.15.2",
43
+ "@types/node": "^22.10.5",
44
+ "@vinicunca/eslint-config": "^2.15.5",
45
45
  "@vitest/coverage-v8": "^2.1.8",
46
- "bumpp": "^9.9.1",
46
+ "bumpp": "^9.9.2",
47
47
  "eslint": "^9.17.0",
48
48
  "prettier": "^3.4.2",
49
49
  "taze": "^0.18.0",
50
50
  "tsup": "^8.3.5",
51
- "typedoc": "^0.27.5",
52
51
  "typescript": "^5.7.2",
53
52
  "vitest": "^2.1.8"
54
53
  },
55
54
  "scripts": {
56
55
  "build": "tsup",
57
56
  "prepublish": "pnpm run build",
58
- "typedoc": "typedoc --json docs/.vitepress/data/metadata.json",
59
57
  "dev": "pnpm build --watch",
60
58
  "lint": "eslint . --fix",
61
59
  "publish:ci": "pnpm publish --access public --no-git-checks",