PageSourceSearch

https://hunter.io/assets/useAsyncQueuer-DxA58iaB.js

js hunter.io collected 2026-09-24 07:50:22 UTC 35,883 bytes, 1,011 lines download raw bytes

1(function() {
2	try {
3		var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {};
4		e.SENTRY_RELEASE = { id: "b96dc26" };
5		var n = new e.Error().stack;
6		n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "ddfa87cd-cc25-4e40-a59f-2696e14f4a4a", e._sentryDebugIdIdentifier = "sentry-dbid-ddfa87cd-cc25-4e40-a59f-2696e14f4a4a");
7	} catch (e) {}
8})();
9import { a as __toESM, n as __esmMin } from "./rolldown-runtime-sLwMD6dS.js";
10import { C as init_event_client, E as init_store, O as parseFunctionOrValue, S as emitChange, T as Store, w as pacerEventClient } from "./controllers-jdPQjaCB.js";
11import { a as cn, i as require_compiler_runtime, t as require_jsx_runtime, u as init_utils$1 } from "./jsx-runtime-CHSMGLHp.js";
12import { t as require_react } from "./react-CrLPhuc5.js";
13import { Y as require_with_selector } from "./debounce-Dd_EcllH.js";
14//#region node_modules/.pnpm/@[email protected]/node_modules/@tanstack/store/dist/shallow.js
15function shallow(objA, objB) {
16	if (Object.is(objA, objB)) return true;
17	if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) return false;
18	if (objA instanceof Map && objB instanceof Map) {
19		if (objA.size !== objB.size) return false;
20		for (const [k, v] of objA) if (!objB.has(k) || !Object.is(v, objB.get(k))) return false;
21		return true;
22	}
23	if (objA instanceof Set && objB instanceof Set) {
24		if (objA.size !== objB.size) return false;
25		for (const v of objA) if (!objB.has(v)) return false;
26		return true;
27	}
28	if (objA instanceof Date && objB instanceof Date) {
29		if (objA.getTime() !== objB.getTime()) return false;
30		return true;
31	}
32	const keysA = getOwnKeys(objA);
33	if (keysA.length !== getOwnKeys(objB).length) return false;
34	for (let i = 0; i < keysA.length; i++) if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) return false;
35	return true;
36}
37function getOwnKeys(obj) {
38	return Object.keys(obj).concat(Object.getOwnPropertySymbols(obj));
39}
40function init_shallow() {
41	return (init_shallow = __esmMin((() => {})))();
42}
43//#endregion
44//#region node_modules/.pnpm/@[email protected]/node_modules/@tanstack/pacer/dist/async-retryer.js
45/**
46* Creates the default initial state for an AsyncRetryer instance
47* @returns The default state with all values reset to initial values
48*/
49function getDefaultAsyncRetryerState() {
50	return {
51		currentAttempt: 0,
52		executionCount: 0,
53		isExecuting: false,
54		lastError: void 0,
55		lastExecutionTime: 0,
56		lastResult: void 0,
57		status: "idle",
58		totalExecutionTime: 0
59	};
60}
61var defaultOptions$1, AsyncRetryer;
62function init_async_retryer() {
63	return (init_async_retryer = __esmMin((() => {
64		init_store();
65		defaultOptions$1 = {
66			backoff: "exponential",
67			baseWait: 1e3,
68			maxWait: Infinity,
69			enabled: true,
70			jitter: 0,
71			maxAttempts: 3,
72			maxExecutionTime: Infinity,
73			maxTotalExecutionTime: Infinity,
74			throwOnError: "last"
75		};
76		AsyncRetryer = class {
77			#abortController;
78			/**
79			* Creates a new AsyncRetryer instance
80			* @param fn The async function to retry
81			* @param initialOptions Configuration options for the retryer
82			*/
83			constructor(fn, initialOptions = {}) {
84				this.fn = fn;
85				this.store = new Store(getDefaultAsyncRetryerState());
86				this.#abortController = null;
87				this.setOptions = (newOptions) => {
88					this.options = {
89						...this.options,
90						...newOptions
91					};
92				};
93				this.#setState = (newState) => {
94					this.store.setState((state) => {
95						const combinedState = {
96							...state,
97							...newState
98						};
99						const { isExecuting, currentAttempt } = combinedState;
100						return {
101							...combinedState,
102							status: !this.#getEnabled() ? "disabled" : isExecuting && currentAttempt === 1 ? "executing" : isExecuting && currentAttempt > 1 ? "retrying" : "idle"
103						};
104					});
105				};
106				this.#getEnabled = () => {
107					return !!parseFunctionOrValue(this.options.enabled, this);
108				};
109				this.#getMaxAttempts = () => {
110					return parseFunctionOrValue(this.options.maxAttempts, this);
111				};
112				this.#getBaseWait = () => {
113					return parseFunctionOrValue(this.options.baseWait, this);
114				};
115				this.#getMaxWait = () => {
116					return parseFunctionOrValue(this.options.maxWait, this);
117				};
118				this.#calculateJitter = (waitTime) => {
119					const jitterAmount = this.options.jitter;
120					if (jitterAmount <= 0) return 0;
121					try {
122						const crypto = typeof globalThis !== "undefined" ? globalThis.crypto : void 0;
123						if (crypto?.getRandomValues) {
124							const array = /* @__PURE__ */ new Uint32Array(1);
125							crypto.getRandomValues(array);
126							const randomFactor = array[0] / 4294967295 * 2 - 1;
127							return Math.floor(waitTime * jitterAmount * randomFactor);
128						}
129					} catch {}
130					return 0;
131				};
132				this.#calculateWait = (attempt) => {
133					const baseWait = this.#getBaseWait();
134					let waitTime;
135					switch (this.options.backoff) {
136						case "linear":
137							waitTime = baseWait * attempt;
138							break;
139						case "exponential":
140							waitTime = baseWait * Math.pow(2, attempt - 1);
141							break;
142						default: waitTime = baseWait;
143					}
144					waitTime = Math.min(waitTime, this.#getMaxWait());
145					const jitter = this.#calculateJitter(waitTime);
146					return Math.max(0, waitTime + jitter);
147				};
148				this.execute = async (...args) => {
149					if (!this.#getEnabled()) return;
150					this.abort("new-execution");
151					const startTime = Date.now();
152					let lastError;
153					let result;
154					this.#abortController = new AbortController();
155					const signal = this.#abortController.signal;
156					this.#setState({
157						isExecuting: true,
158						currentAttempt: 0,
159						lastError: void 0
160					});
161					let totalTimeoutId;
162					if (this.options.maxTotalExecutionTime !== Infinity) totalTimeoutId = setTimeout(() => {
163						this.options.onTotalExecutionTimeout?.(this);
164						this.abort("total-timeout");
165					}, this.options.maxTotalExecutionTime);
166					let isLastAttempt = false;
167					for (let attempt = 1; attempt <= this.#getMaxAttempts(); attempt++) {
168						isLastAttempt = attempt === this.#getMaxAttempts();
169						this.#setState({ currentAttempt: attempt });
170						try {
171							if (signal.aborted) return;
172							const currentTotalTime = Date.now() - startTime;
173							if (this.options.maxTotalExecutionTime !== Infinity && currentTotalTime >= this.options.maxTotalExecutionTime) {
174								this.options.onTotalExecutionTimeout?.(this);
175								this.abort("total-timeout");
176								return;
177							}
178							if (this.options.maxExecutionTime === Infinity) result = await this.fn(...args);
179							else result = await Promise.race([this.fn(...args), new Promise((_, reject) => {
180								const timeout = setTimeout(() => {
181									this.options.onExecutionTimeout?.(this);
182									this.abort("execution-timeout");
183									reject(/* @__PURE__ */ new Error(`Execution timeout: ${this.options.maxExecutionTime}ms exceeded`));
184								}, this.options.maxExecutionTime);
185								signal.addEventListener("abort", () => {
186									clearTimeout(timeout);
187									reject(/* @__PURE__ */ new Error("Aborted"));
188								}, { once: true });
189							})]);
190							if (signal.aborted) return;
191							const totalTime = Date.now() - startTime;
192							this.#setState({
193								executionCount: this.store.state.executionCount + 1,
194								isExecuting: false,
195								lastExecutionTime: Date.now(),
196								totalExecutionTime: totalTime,
197								currentAttempt: 0,
198								lastResult: result
199							});
200							this.options.onSuccess?.(result, args, this);
201							return result;
202						} catch (error) {
203							if (error && typeof error === "object" && "name" in error && error.name === "AbortError") return;
204							lastError = error instanceof Error ? error : new Error(String(error));
205							this.#setState({ lastError });
206							this.options.onError?.(lastError, args, this);
207							if (attempt < this.#getMaxAttempts()) {
208								this.options.onRetry?.(attempt, lastError, this);
209								const wait = this.#calculateWait(attempt);
210								if (wait > 0) {
211									this.#setState({
212										isExecuting: true,
213										currentAttempt: attempt + 1
214									});
215									await new Promise((resolve) => {
216										const timeout = setTimeout(() => {
217											signal.removeEventListener("abort", onAbort);
218											resolve();
219										}, wait);
220										const onAbort = () => {
221											clearTimeout(timeout);
222											signal.removeEventListener("abort", onAbort);
223											resolve();
224										};
225										signal.addEventListener("abort", onAbort);
226									});
227									if (signal.aborted) return;
228								}
229							}
230						} finally {
231							this.options.onSettled?.(args, this);
232						}
233					}
234					if (totalTimeoutId) clearTimeout(totalTimeoutId);
235					this.#setState({ isExecuting: false });
236					this.options.onLastError?.(lastError, this);
237					this.options.onSettled?.(args, this);
238					if (this.options.throwOnError === "last" && isLastAttempt || this.options.throwOnError === true) throw lastError;
239				};
240				this.getAbortSignal = () => {
241					return this.#abortController?.signal ?? null;
242				};
243				this.abort = (reason = "manual") => {
244					if (this.#abortController) {
245						this.#abortController.abort();
246						this.#abortController = null;
247						this.#setState({ isExecuting: false });
248						this.options.onAbort?.(reason, this);
249					}
250				};
251				this.reset = () => {
252					this.#setState(getDefaultAsyncRetryerState());
253				};
254				this.key = initialOptions.key;
255				this.options = {
256					...defaultOptions$1,
257					...initialOptions,
258					throwOnError: initialOptions.throwOnError ?? (initialOptions.onError ? false : defaultOptions$1.throwOnError)
259				};
260				this.#setState(this.options.initialState ?? {});
261			}
262			#setState;
263			#getEnabled;
264			#getMaxAttempts;
265			#getBaseWait;
266			#getMaxWait;
267			#calculateJitter;
268			#calculateWait;
269		};
270	})))();
271}
272//#endregion
273//#region node_modules/.pnpm/@[email protected]/node_modules/@tanstack/pacer/dist/async-queuer.js
274function getDefaultAsyncQueuerState() {
275	return {
276		activeItems: [],
277		addItemCount: 0,
278		errorCount: 0,
279		executeCount: 0,
280		expirationCount: 0,
281		isEmpty: true,
282		isExecuting: false,
283		isFull: false,
284		isIdle: true,
285		isRunning: true,
286		itemTimestamps: [],
287		items: [],
288		lastResult: null,
289		pendingTick: false,
290		rejectionCount: 0,
291		settledCount: 0,
292		size: 0,
293		status: "idle",
294		successCount: 0
295	};
296}
297var defaultOptions, AsyncQueuer;
298function init_async_queuer() {
299	return (init_async_queuer = __esmMin((() => {
300		init_async_retryer();
301		init_event_client();
302		init_store();
303		defaultOptions = {
304			addItemsTo: "back",
305			asyncRetryerOptions: { maxAttempts: 1 },
306			concurrency: 1,
307			expirationDuration: Infinity,
308			getIsExpired: () => false,
309			getItemsFrom: "front",
310			getPriority: (item) => item?.priority ?? 0,
311			initialItems: [],
312			maxSize: Infinity,
313			started: true,
314			wait: 0
315		};
316		AsyncQueuer = class {
317			#timeoutIds;
318			constructor(fn, initialOptions = {}) {
319				this.fn = fn;
320				this.store = new Store(getDefaultAsyncQueuerState());
321				this.asyncRetryers = /* @__PURE__ */ new Map();
322				this.#timeoutIds = /* @__PURE__ */ new Set();
323				this.setOptions = (newOptions) => {
324					this.options = {
325						...this.options,
326						...newOptions
327					};
328				};
329				this.#setState = (newState) => {
330					this.store.setState((state) => {
331						const combinedState = {
332							...state,
333							...newState
334						};
335						const { activeItems, items, isRunning } = combinedState;
336						const size = items.length;
337						const isFull = size >= (this.options.maxSize ?? Infinity);
338						const isEmpty = size === 0;
339						const isIdle = isRunning && isEmpty && activeItems.length === 0;
340						const status = isIdle ? "idle" : isRunning ? "running" : "stopped";
341						return {
342							...combinedState,
343							isEmpty,
344							isFull,
345							isIdle,
346							size,
347							status
348						};
349					});
350					emitChange("AsyncQueuer", this);
351				};
352				this.#getWait = () => {
353					return parseFunctionOrValue(this.options.wait ?? 0, this);
354				};
355				this.#getConcurrency = () => {
356					return parseFunctionOrValue(this.options.concurrency ?? 1, this);
357				};
358				this.#tick = () => {
359					if (!this.store.state.isRunning) {
360						this.#setState({ pendingTick: false });
361						return;
362					}
363					this.#setState({ pendingTick: true });
364					this.#checkExpiredItems();
365					let scheduledAsyncWork = false;
366					const activeItems = [...this.store.state.activeItems];
367					while (activeItems.length < this.#getConcurrency() && this.store.state.items.length > 0) {
368						const nextItem = this.peekNextItem();
369						if (nextItem === void 0) break;
370						activeItems.push(nextItem);
371						this.#setState({ activeItems: [...activeItems] });
372						scheduledAsyncWork = true;
373						(async () => {
374							try {
375								await this.execute();
376							} catch {}
377							const wait = this.#getWait();
378							if (wait > 0) {
379								const timeoutId = setTimeout(() => {
380									this.#timeoutIds.delete(timeoutId);
381									this.#tick();
382								}, wait);
383								this.#timeoutIds.add(timeoutId);
384								return;
385							}
386							this.#tick();
387						})();
388					}
389					if (!scheduledAsyncWork) this.#setState({ pendingTick: false });
390				};
391				this.addItem = (item, position = this.options.addItemsTo ?? "back", runOnItemsChange = true) => {
392					this.#setState({ addItemCount: this.store.state.addItemCount + 1 });
393					if (item === void 0) {
394						this.#setState({ rejectionCount: this.store.state.rejectionCount + 1 });
395						this.options.onReject?.(item, this);
396						return false;
397					}
398					if (this.store.state.items.length >= (this.options.maxSize ?? Infinity)) {
399						this.#setState({ rejectionCount: this.store.state.rejectionCount + 1 });
400						this.options.onReject?.(item, this);
401						return false;
402					}
403					const priority = this.options.getPriority !== defaultOptions.getPriority ? this.options.getPriority(item) : item?.priority;
404					const items = this.store.state.items;
405					const itemTimestamps = this.store.state.itemTimestamps;
406					if (priority !== void 0) {
407						const insertIndex = items.findIndex((existing) => {
408							return (this.options.getPriority !== defaultOptions.getPriority ? this.options.getPriority(existing) : existing?.priority) < priority;
409						});
410						if (insertIndex === -1) {
411							items.push(item);
412							itemTimestamps.push(Date.now());
413						} else {
414							items.splice(insertIndex, 0, item);
415							itemTimestamps.splice(insertIndex, 0, Date.now());
416						}
417					} else if (position === "front") {
418						items.unshift(item);
419						itemTimestamps.unshift(Date.now());
420					} else {
421						items.push(item);
422						itemTimestamps.push(Date.now());
423					}
424					this.#setState({
425						items,
426						itemTimestamps
427					});
428					if (runOnItemsChange) this.options.onItemsChange?.(this);
429					if (this.store.state.isRunning && !this.store.state.pendingTick) this.#tick();
430					return true;
431				};
432				this.getNextItem = (position = this.options.getItemsFrom ?? "front") => {
433					const { items, itemTimestamps } = this.store.state;
434					let item;
435					if (this.options.getPriority !== defaultOptions.getPriority || position === "front") {
436						item = items[0];
437						if (item !== void 0) this.#setState({
438							items: items.slice(1),
439							itemTimestamps: itemTimestamps.slice(1)
440						});
441					} else {
442						item = items[items.length - 1];
443						if (item !== void 0) this.#setState({
444							items: items.slice(0, -1),
445							itemTimestamps: itemTimestamps.slice(0, -1)
446						});
447					}
448					if (item !== void 0) this.options.onItemsChange?.(this);
449					return item;
450				};
451				this.#getAllItems = () => {
452					const items = this.peekAllItems();
453					this.clear();
454					return items;
455				};
456				this.execute = async (position) => {
457					const item = this.getNextItem(position);
458					if (item !== void 0) {
459						const currentExecuteCount = this.store.state.executeCount + 1;
460						this.#setState({
461							executeCount: currentExecuteCount,
462							isExecuting: true
463						});
464						try {
465							const currentAsyncRetryer = new AsyncRetryer(this.fn, this.options.asyncRetryerOptions);
466							this.asyncRetryers.set(currentExecuteCount, currentAsyncRetryer);
467							const lastResult = await currentAsyncRetryer.execute(item);
468							this.#setState({
469								successCount: this.store.state.successCount + 1,
470								lastResult
471							});
472							this.options.onSuccess?.(lastResult, item, this);
473						} catch (error) {
474							this.#setState({ errorCount: this.store.state.errorCount + 1 });
475							this.options.onError?.(error, item, this);
476							if (this.options.throwOnError) throw error;
477						} finally {
478							this.asyncRetryers.delete(currentExecuteCount);
479							const remainingActiveItems = [...this.store.state.activeItems];
480							const activeItemIndex = remainingActiveItems.indexOf(item);
481							if (activeItemIndex !== -1) remainingActiveItems.splice(activeItemIndex, 1);
482							this.#setState({
483								activeItems: remainingActiveItems,
484								isExecuting: this.asyncRetryers.size > 0,
485								settledCount: this.store.state.settledCount + 1
486							});
487							this.options.onSettled?.(item, this);
488						}
489					}
490					return item;
491				};
492				this.flush = async (numberOfItems = this.store.state.items.length, position) => {
493					this.#clearTimeouts();
494					const results = await Promise.allSettled(Array.from({ length: numberOfItems }, () => this.execute(position)));
495					this.#setState({ pendingTick: false });
496					if (this.store.state.isRunning && this.store.state.items.length > 0) {
497						const wait = this.#getWait();
498						if (wait > 0) {
499							this.#setState({ pendingTick: true });
500							const timeoutId = setTimeout(() => {
501								this.#timeoutIds.delete(timeoutId);
502								this.#tick();
503							}, wait);
504							this.#timeoutIds.add(timeoutId);
505						} else this.#tick();
506					}
507					const failure = results.find((result) => result.status === "rejected");
508					if (failure) throw failure.reason;
509				};
510				this.flushAsBatch = async (batchFunction) => {
511					this.#clearTimeouts();
512					const items = this.#getAllItems();
513					try {
514						await batchFunction(items);
515					} finally {
516						this.#setState({ pendingTick: false });
517						if (this.store.state.isRunning && this.store.state.items.length > 0) this.#tick();
518					}
519				};
520				this.#checkExpiredItems = () => {
521					if ((this.options.expirationDuration ?? Infinity) === Infinity && this.options.getIsExpired === defaultOptions.getIsExpired) return;
522					const now = Date.now();
523					const expiredIndices = [];
524					for (let i = 0; i < this.store.state.items.length; i++) {
525						const timestamp = this.store.state.itemTimestamps[i];
526						if (timestamp === void 0) continue;
527						const item = this.store.state.items[i];
528						if (item === void 0) continue;
529						if (this.options.getIsExpired !== defaultOptions.getIsExpired ? this.options.getIsExpired(item, timestamp) : now - timestamp > (this.options.expirationDuration ?? Infinity)) expiredIndices.push(i);
530					}
531					for (let i = expiredIndices.length - 1; i >= 0; i--) {
532						const index = expiredIndices[i];
533						if (index === void 0) continue;
534						const expiredItem = this.store.state.items[index];
535						if (expiredItem === void 0) continue;
536						const newItems = [...this.store.state.items];
537						const newTimestamps = [...this.store.state.itemTimestamps];
538						newItems.splice(index, 1);
539						newTimestamps.splice(index, 1);
540						this.#setState({
541							items: newItems,
542							itemTimestamps: newTimestamps,
543							expirationCount: this.store.state.expirationCount + 1
544						});
545						this.options.onExpire?.(expiredItem, this);
546					}
547					if (expiredIndices.length > 0) this.options.onItemsChange?.(this);
548				};
549				this.peekNextItem = (position = "front") => {
550					if (position === "front") return this.store.state.items[0];
551					return this.store.state.items[this.store.state.items.length - 1];
552				};
553				this.peekAllItems = () => {
554					return [...this.peekActiveItems(), ...this.peekPendingItems()];
555				};
556				this.peekActiveItems = () => {
557					return [...this.store.state.activeItems];
558				};
559				this.peekPendingItems = () => {
560					return [...this.store.state.items];
561				};
562				this.start = () => {
563					this.#setState({ isRunning: true });
564					if (!this.store.state.pendingTick && this.store.state.items.length > 0) this.#tick();
565				};
566				this.stop = () => {
567					this.#clearTimeouts();
568					this.#setState({
569						isRunning: false,
570						pendingTick: false
571					});
572				};
573				this.#clearTimeouts = () => {
574					this.#timeoutIds.forEach((timeoutId) => clearTimeout(timeoutId));
575					this.#timeoutIds.clear();
576				};
577				this.clear = () => {
578					this.#setState({
579						items: [],
580						itemTimestamps: []
581					});
582					this.options.onItemsChange?.(this);
583				};
584				this.getAbortSignal = (executeCount) => {
585					const count = executeCount ?? this.store.state.executeCount;
586					return this.asyncRetryers.get(count)?.getAbortSignal() ?? null;
587				};
588				this.abort = () => {
589					this.asyncRetryers.forEach((retryer) => retryer.abort());
590					this.asyncRetryers.clear();
591					this.#setState({ isExecuting: false });
592				};
593				this.reset = () => {
594					this.#setState(getDefaultAsyncQueuerState());
595					this.options.onItemsChange?.(this);
596					this.asyncRetryers.forEach((retryer) => retryer.reset());
597				};
598				this.key = initialOptions.key;
599				this.options = {
600					...defaultOptions,
601					...initialOptions,
602					throwOnError: initialOptions.throwOnError ?? !initialOptions.onError
603				};
604				const isInitiallyRunning = this.options.initialState?.isRunning ?? this.options.started ?? true;
605				this.#setState({
606					...this.options.initialState,
607					isRunning: isInitiallyRunning
608				});
609				if (this.options.initialState?.items) {
610					if (this.store.state.isRunning) this.#tick();
611				} else for (let i = 0; i < (this.options.initialItems?.length ?? 0); i++) {
612					const item = this.options.initialItems[i];
613					const isLast = i === (this.options.initialItems?.length ?? 0) - 1;
614					this.addItem(item, this.options.addItemsTo ?? "back", isLast);
615				}
616				if (this.key) pacerEventClient.on("d-AsyncQueuer", (e) => {
617					if (e.payload.key !== this.key) return;
618					this.#setState(e.payload.store.state);
619					this.setOptions(e.payload.options);
620				});
621			}
622			#setState;
623			/**
624			* Returns the current wait time (in milliseconds) between processing items.
625			* If a function is provided, it is called with the queuer instance.
626			*/
627			#getWait;
628			/**
629			* Returns the current concurrency limit for processing items.
630			* If a function is provided, it is called with the queuer instance.
631			*/
632			#getConcurrency;
633			/**
634			* Processes items in the queue up to the concurrency limit. Internal use only.
635			*/
636			#tick;
637			#getAllItems;
638			/**
639			* Checks for expired items in the queue and removes them. Calls onExpire for each expired item.
640			* Internal use only.
641			*/
642			#checkExpiredItems;
643			#clearTimeouts;
644		};
645	})))();
646}
647//#endregion
648//#region app/frontend/react/ui/snackbar.tsx
649var import_compiler_runtime, import_jsx_runtime, Snackbar, SnackbarText, SnackbarLink;
650function init_snackbar() {
651	return (init_snackbar = __esmMin((() => {
652		import_compiler_runtime = require_compiler_runtime();
653		require_react();
654		init_utils$1();
655		import_jsx_runtime = require_jsx_runtime();
656		Snackbar = (t0) => {
657			const $ = (0, import_compiler_runtime.c)(10);
658			let children;
659			let className;
660			let props;
661			if ($[0] !== t0) {
662				({children, className, ...props} = t0);
663				$[0] = t0;
664				$[1] = children;
665				$[2] = className;
666				$[3] = props;
667			} else {
668				children = $[1];
669				className = $[2];
670				props = $[3];
671			}
672			let t1;
673			if ($[4] !== className) {
674				t1 = cn("snackbar is-visible", className);
675				$[4] = className;
676				$[5] = t1;
677			} else t1 = $[5];
678			let t2;
679			if ($[6] !== children || $[7] !== props || $[8] !== t1) {
680				t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
681					className: t1,
682					...props,
683					children
684				});
685				$[6] = children;
686				$[7] = props;
687				$[8] = t1;
688				$[9] = t2;
689			} else t2 = $[9];
690			return t2;
691		};
692		SnackbarText = (t0) => {
693			const $ = (0, import_compiler_runtime.c)(10);
694			let children;
695			let className;
696			let props;
697			if ($[0] !== t0) {
698				({children, className, ...props} = t0);
699				$[0] = t0;
700				$[1] = children;
701				$[2] = className;
702				$[3] = props;
703			} else {
704				children = $[1];
705				className = $[2];
706				props = $[3];
707			}
708			let t1;
709			if ($[4] !== className) {
710				t1 = cn("snackbar__text", className);
711				$[4] = className;
712				$[5] = t1;
713			} else t1 = $[5];
714			let t2;
715			if ($[6] !== children || $[7] !== props || $[8] !== t1) {
716				t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
717					className: t1,
718					...props,
719					children
720				});
721				$[6] = children;
722				$[7] = props;
723				$[8] = t1;
724				$[9] = t2;
725			} else t2 = $[9];
726			return t2;
727		};
728		SnackbarLink = ({ href, turboFrame = "_top", children, className, ...props }) => {
729			return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
730				href,
731				"data-turbo-frame": turboFrame,
732				className: cn("snackbar__link", className),
733				...props,
734				children
735			});
736		};
737	})))();
738}
739//#endregion
740//#region node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@tanstack/react-pacer/dist/provider/PacerProvider.js
741function useDefaultPacerOptions() {
742	return (0, import_react$2.useContext)(PacerContext)?.defaultOptions ?? {};
743}
744var import_react$2, PacerContext;
745function init_PacerProvider() {
746	return (init_PacerProvider = __esmMin((() => {
747		import_react$2 = /* @__PURE__ */ __toESM(require_react(), 1);
748		PacerContext = (0, import_react$2.createContext)(null);
749	})))();
750}
751//#endregion
752//#region node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@tanstack/react-store/dist/useSelector.js
753function defaultCompare(a, b) {
754	return a === b;
755}
756/**
757* Selects a slice of state from an atom or store and subscribes the component
758* to that selection.
759*
760* This is the primary React read hook for TanStack Store. It works with any
761* source that exposes `get()` and `subscribe()`, including atoms, readonly
762* atoms, stores, and readonly stores.
763*
764* Omit the selector to subscribe to the whole value.
765*
766* @example
767* ```tsx
768* const count = useSelector(counterStore, (state) => state.count)
769* ```
770*
771* @example
772* ```tsx
773* const value = useSelector(countAtom)
774* ```
775*/
776function useSelector(source, selector = (s) => s, options) {
777	const compare = options?.compare ?? defaultCompare;
778	const subscribe = (0, import_react$1.useCallback)((handleStoreChange) => {
779		const { unsubscribe } = source.subscribe(handleStoreChange);
780		return unsubscribe;
781	}, [source]);
782	const getSnapshot = (0, import_react$1.useCallback)(() => source.get(), [source]);
783	return (0, import_with_selector.useSyncExternalStoreWithSelector)(subscribe, getSnapshot, getSnapshot, selector, compare);
784}
785var import_react$1, import_with_selector;
786function init_useSelector() {
787	return (init_useSelector = __esmMin((() => {
788		import_react$1 = require_react();
789		import_with_selector = require_with_selector();
790	})))();
791}
792//#endregion
793//#region node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@tanstack/react-pacer/dist/async-queuer/useAsyncQueuer.js
794/**
795* A lower-level React hook that creates an `AsyncQueuer` instance for managing an async queue of items.
796*
797* Features:
798* - Priority queue support via getPriority option
799* - Configurable concurrency limit
800* - Task success/error/completion callbacks
801* - FIFO (First In First Out) or LIFO (Last In First Out) queue behavior
802* - Pause/resume task processing
803* - Task cancellation
804* - Item expiration to clear stale items from the queue
805*
806* Tasks are processed concurrently up to the configured concurrency limit. When a task completes,
807* the next pending task is processed if below the concurrency limit.
808*
809* Error Handling:
810* - If an `onError` handler is provided, it will be called with the error and queuer instance
811* - If `throwOnError` is true (default when no onError handler is provided), the error will be thrown
812* - If `throwOnError` is false (default when onError handler is provided), the error will be swallowed
813* - Both onError and throwOnError can be used together - the handler will be called before any error is thrown
814* - The error state can be checked using the underlying AsyncQueuer instance
815*
816* ## State Management and Selector
817*
818* The hook uses TanStack Store for reactive state management. You can subscribe to state changes
819* in two ways:
820*
821* **1. Using `queuer.Subscribe` HOC (Recommended for component tree subscriptions)**
822*
823* Use the `Subscribe` HOC to subscribe to state changes deep in your component tree without
824* needing to pass a selector to the hook. This is ideal when you want to subscribe to state
825* in child components.
826*
827* **2. Using the `selector` parameter (For hook-level subscriptions)**
828*
829* The `selector` parameter allows you to specify which state changes will trigger a re-render
830* at the hook level, optimizing performance by preventing unnecessary re-renders when irrelevant
831* state changes occur.
832*
833* **By default, there will be no reactive state subscriptions** and you must opt-in to state
834* tracking by providing a selector function or using the `Subscribe` HOC. This prevents unnecessary
835* re-renders and gives you full control over when your component updates.
836*
837* Available state properties:
838* - `activeItems`: Items currently being processed by the queuer
839* - `errorCount`: Number of task executions that have resulted in errors
840* - `expirationCount`: Number of items that have been removed due to expiration
841* - `isEmpty`: Whether the queuer has no items to process
842* - `isFull`: Whether the queuer has reached its maximum capacity
843* - `isIdle`: Whether the queuer is not currently processing any items
844* - `isRunning`: Whether the queuer is active and will process items automatically
845* - `items`: Array of items currently waiting to be processed
846* - `itemTimestamps`: Timestamps when items were added for expiration tracking
847* - `lastResult`: The result from the most recent task execution
848* - `pendingTick`: Whether the queuer has a pending timeout for processing the next item
849* - `rejectionCount`: Number of items that have been rejected from being added
850* - `settledCount`: Number of task executions that have completed (success or error)
851* - `size`: Number of items currently in the queue
852* - `status`: Current processing status ('idle' | 'running' | 'stopped')
853* - `successCount`: Number of task executions that have completed successfully
854*
855* ## Unmount behavior
856*
857* By default, the hook stops the queuer and aborts any in-flight task executions when the component unmounts.
858* Abort only cancels underlying operations (e.g. fetch) when the abort signal from `getAbortSignal()` is passed to them.
859* Use the `onUnmount` option to customize this. For example, to flush pending items instead:
860*
861* ```tsx
862* const queuer = useAsyncQueuer(fn, {
863*   concurrency: 2,
864*   started: false,
865*   onUnmount: (q) => q.flush()
866* });
867* ```
868*
869* Note: For async utils, `flush()` returns a Promise and runs fire-and-forget in the cleanup.
870* If your task function updates React state, those updates may run after the component has
871* unmounted, which can cause "setState on unmounted component" warnings. Guard your callbacks
872* accordingly when using onUnmount with flush.
873*
874* @example
875* ```tsx
876* // Default behavior - no reactive state subscriptions
877* const asyncQueuer = useAsyncQueuer(
878*   async (item) => {
879*     const result = await processItem(item);
880*     return result;
881*   },
882*   { concurrency: 2, maxSize: 100, started: false }
883* );
884*
885* // Subscribe to state changes deep in component tree using Subscribe HOC
886* <asyncQueuer.Subscribe selector={(state) => ({ size: state.size, isRunning: state.isRunning })}>
887*   {({ size, isRunning }) => (
888*     <div>Queue: {size} items, {isRunning ? 'Processing' : 'Idle'}</div>
889*   )}
890* </asyncQueuer.Subscribe>
891*
892* // Opt-in to re-render when queue size changes at hook level (optimized for displaying queue length)
893* const asyncQueuer = useAsyncQueuer(
894*   async (item) => {
895*     const result = await processItem(item);
896*     return result;
897*   },
898*   { concurrency: 2, maxSize: 100, started: false },
899*   (state) => ({
900*     size: state.size,
901*     isEmpty: state.isEmpty,
902*     isFull: state.isFull
903*   })
904* );
905*
906* // Opt-in to re-render when processing state changes (optimized for loading indicators)
907* const asyncQueuer = useAsyncQueuer(
908*   async (item) => {
909*     const result = await processItem(item);
910*     return result;
911*   },
912*   { concurrency: 2, maxSize: 100, started: false },
913*   (state) => ({
914*     isRunning: state.isRunning,
915*     isIdle: state.isIdle,
916*     status: state.status,
917*     activeItems: state.activeItems,
918*     pendingTick: state.pendingTick
919*   })
920* );
921*
922* // Opt-in to re-render when execution metrics change (optimized for stats display)
923* const asyncQueuer = useAsyncQueuer(
924*   async (item) => {
925*     const result = await processItem(item);
926*     return result;
927*   },
928*   { concurrency: 2, maxSize: 100, started: false },
929*   (state) => ({
930*     successCount: state.successCount,
931*     errorCount: state.errorCount,
932*     settledCount: state.settledCount,
933*     expirationCount: state.expirationCount,
934*     rejectionCount: state.rejectionCount
935*   })
936* );
937*
938* // Opt-in to re-render when results are available (optimized for data display)
939* const asyncQueuer = useAsyncQueuer(
940*   async (item) => {
941*     const result = await processItem(item);
942*     return result;
943*   },
944*   {
945*     concurrency: 2,
946*     maxSize: 100,
947*     started: false,
948*     onSuccess: (result) => {
949*       console.log('Item processed:', result);
950*     },
951*     onError: (error) => {
952*       console.error('Processing failed:', error);
953*     }
954*   },
955*   (state) => ({
956*     lastResult: state.lastResult,
957*     successCount: state.successCount
958*   })
959* );
960*
961* // Add items to queue
962* asyncQueuer.addItem(newItem);
963*
964* // Start processing
965* asyncQueuer.start();
966*
967* // Access the selected state (will be empty object {} unless selector provided)
968* const { size, isRunning, activeItems } = asyncQueuer.state;
969* ```
970*/
971function useAsyncQueuer(fn, options = {}, selector = () => ({})) {
972	const mergedOptions = {
973		...useDefaultPacerOptions().asyncQueuer,
974		...options
975	};
976	const [asyncQueuer] = (0, import_react.useState)(() => {
977		const asyncQueuerInstance = new AsyncQueuer(fn, mergedOptions);
978		asyncQueuerInstance.Subscribe = function Subscribe(props) {
979			const selected = useSelector(asyncQueuerInstance.store, props.selector, { compare: shallow });
980			return typeof props.children === "function" ? props.children(selected) : props.children;
981		};
982		return asyncQueuerInstance;
983	});
984	asyncQueuer.fn = fn;
985	asyncQueuer.setOptions(mergedOptions);
986	(0, import_react.useEffect)(() => {
987		return () => {
988			if (mergedOptions.onUnmount) mergedOptions.onUnmount(asyncQueuer);
989			else {
990				asyncQueuer.stop();
991				asyncQueuer.abort();
992			}
993		};
994	}, []);
995	const state = useSelector(asyncQueuer.store, selector, { compare: shallow });
996	return (0, import_react.useMemo)(() => ({
997		...asyncQueuer,
998		state
999	}), [asyncQueuer, state]);
1000}
1001var import_react;
1002function init_useAsyncQueuer() {
1003	return (init_useAsyncQueuer = __esmMin((() => {
1004		init_PacerProvider();
1005		import_react = require_react();
1006		init_useSelector();
1007		init_async_queuer();
1008	})))();
1009}
1010//#endregion
1011export { init_PacerProvider as a, SnackbarLink as c, init_shallow as d, shallow as f, useSelector as i, SnackbarText as l, useAsyncQueuer as n, useDefaultPacerOptions as o, init_useSelector as r, Snackbar as s, init_useAsyncQueuer as t, init_snackbar as u };

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.