@tachui/core 0.8.23 → 0.8.24

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 (55) hide show
  1. package/dist/assets/index.js +41 -40
  2. package/dist/{binding-DCV5PKkK.js → binding-DCr-JHsC.js} +9 -9
  3. package/dist/build-tools/typegen-runner.d.ts +4 -0
  4. package/dist/build-tools/typegen-runner.d.ts.map +1 -1
  5. package/dist/cleanup-BR8UpYPX.js +61 -0
  6. package/dist/common.js +272 -277
  7. package/dist/{component-D-O9yq0P.js → component-BzvSm8rM.js} +19 -19
  8. package/dist/{component-base-C41K3NTe.js → component-base-Do2EdQkr.js} +32 -33
  9. package/dist/{component-context-B9HI2nZH.js → component-context-C7Y6Xu6h.js} +1 -1
  10. package/dist/components/index.js +1 -1
  11. package/dist/computed-CA4Cgtoe.js +407 -0
  12. package/dist/{concatenated-component-2Gzy5e2c.js → concatenated-component-CA54ng_j.js} +43 -44
  13. package/dist/css-classes/index.js +2 -2
  14. package/dist/{effect-BsW3fy1q.js → effect-DgNm6jk9.js} +3 -3
  15. package/dist/{enhanced-renderer-t9Ni2EEG.js → enhanced-renderer-D05CCloF.js} +26 -28
  16. package/dist/essential.js +276 -281
  17. package/dist/factories-B05hE6kc.js +644 -0
  18. package/dist/{factory-gqfMcmOy.js → factory-B1YXfgU1.js} +23 -29
  19. package/dist/full.d.ts +12 -0
  20. package/dist/full.d.ts.map +1 -0
  21. package/dist/full.js +436 -0
  22. package/dist/gradients/index.js +53 -53
  23. package/dist/hooks-w_FYPLjI.js +158 -0
  24. package/dist/{index-DL9Cys3t.js → index-CmQmIgPK.js} +220 -233
  25. package/dist/index.d.ts +0 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +295 -300
  28. package/dist/minimal-prod.js +106 -108
  29. package/dist/minimal.js +97 -98
  30. package/dist/modifiers/base.d.ts.map +1 -1
  31. package/dist/modifiers/base.js +121 -120
  32. package/dist/modifiers/builder.js +1 -1
  33. package/dist/modifiers/index.js +22 -23
  34. package/dist/modifiers/registry.js +1 -1
  35. package/dist/{observed-object-p1CLdrFm.js → observed-object-DCoyucmV.js} +3 -3
  36. package/dist/optimization-D9t53vNJ.js +308 -0
  37. package/dist/{proxy-Cp0QUXME.js → proxy-B7ZIqGd0.js} +3 -3
  38. package/dist/reactive/index.js +87 -85
  39. package/dist/runtime/dom-bridge.js +15 -17
  40. package/dist/runtime/index.js +71 -71
  41. package/dist/runtime/renderer.js +10 -11
  42. package/dist/signal-BRoiFOO7.js +262 -0
  43. package/dist/{signal-list-07gNXGiW.js → signal-list-_Eid-N7_.js} +285 -176
  44. package/dist/state/index.js +43 -44
  45. package/dist/theme-D5-09a8N.js +26 -0
  46. package/dist/validation/index.js +24 -26
  47. package/dist/version.js +1 -1
  48. package/package.json +16 -3
  49. package/dist/factories-B3-rmvkB.js +0 -268
  50. package/dist/hooks-WGmpzYgD.js +0 -446
  51. package/dist/optimization-CbKNA9w4.js +0 -21
  52. package/dist/presets-B9x94uRn.js +0 -381
  53. package/dist/scheduler-DppMK9mR.js +0 -169
  54. package/dist/theme-CRLPHryV.js +0 -687
  55. package/dist/{index-JQ1sW1SK.js → index-7vhCZc7g.js} +1 -1
@@ -1,10 +1,11 @@
1
- import { l as F, U as m, M as p, k as $, G as q, E as A, B as x, c as y, a as z, p as E, o as L, n as V } from "./theme-CRLPHryV.js";
2
- import { ComputationState as S } from "@tachui/types/reactive";
3
- var B = Object.defineProperty, H = (t, e, r) => e in t ? B(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, l = (t, e, r) => H(t, typeof e != "symbol" ? e + "" : e, r);
4
- let T = 0;
5
- class W {
1
+ import { U as v, m as g, s as $, j as H, h as M, c as V } from "./computed-CA4Cgtoe.js";
2
+ import { j as O, h as x, d as y, g as C, r as j, c as W } from "./signal-BRoiFOO7.js";
3
+ import { ComputationState as E } from "@tachui/types/reactive";
4
+ var B = Object.defineProperty, K = (t, e, r) => e in t ? B(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, f = (t, e, r) => K(t, typeof e != "symbol" ? e + "" : e, r);
5
+ let G = 0;
6
+ class J {
6
7
  constructor(e, r = {}) {
7
- this.effectFn = e, l(this, "id", ++T), l(this, "type", "effect"), l(this, "priority"), l(this, "sources", /* @__PURE__ */ new Set()), l(this, "observers", /* @__PURE__ */ new Set()), l(this, "isDisposed", !1), l(this, "cleanupFn"), l(this, "options"), l(this, "owner"), this.priority = r.priority ?? m.Normal, this.options = r, this.owner = F(), r.fireImmediately !== !1 && this.execute();
8
+ this.effectFn = e, f(this, "id", ++G), f(this, "type", "effect"), f(this, "priority"), f(this, "sources", /* @__PURE__ */ new Set()), f(this, "observers", /* @__PURE__ */ new Set()), f(this, "isDisposed", !1), f(this, "cleanupFn"), f(this, "options"), f(this, "owner"), this.priority = r.priority ?? v.Normal, this.options = r, this.owner = O(), r.fireImmediately !== !1 && this.execute();
8
9
  }
9
10
  /**
10
11
  * Notify method called by unified scheduler
@@ -28,7 +29,7 @@ class W {
28
29
  for (const s of this.sources)
29
30
  "removeObserver" in s && typeof s.removeObserver == "function" ? s.removeObserver(this) : "observers" in s && s.observers instanceof Set && s.observers.delete(this);
30
31
  this.sources.clear();
31
- const e = $(), r = this.setCurrentComputation || (() => {
32
+ const e = x(), r = this.setCurrentComputation || (() => {
32
33
  });
33
34
  r(this);
34
35
  try {
@@ -38,8 +39,8 @@ class W {
38
39
  if (this.options.onError)
39
40
  try {
40
41
  this.options.onError(s);
41
- } catch (i) {
42
- throw console.error("Effect error handler threw error:", i), s;
42
+ } catch (o) {
43
+ throw console.error("Effect error handler threw error:", o), s;
43
44
  }
44
45
  else
45
46
  throw console.error(`Effect ${this.options.debugName || this.id} threw error:`, s), s;
@@ -85,7 +86,7 @@ class W {
85
86
  return {
86
87
  id: this.id,
87
88
  type: this.type,
88
- priority: m[this.priority],
89
+ priority: v[this.priority],
89
90
  debugName: this.options.debugName,
90
91
  disposed: this.isDisposed,
91
92
  sourceCount: this.sources.size,
@@ -96,61 +97,61 @@ class W {
96
97
  return `Effect(${this.options.debugName || this.id})`;
97
98
  }
98
99
  }
99
- function v(t, e) {
100
- const r = new W(t, e), s = F();
100
+ function b(t, e) {
101
+ const r = new J(t, e), s = O();
101
102
  return s && s.cleanups.push(() => r.cleanup()), () => r.cleanup();
102
103
  }
103
- function ie(t, e) {
104
- return v(t, { ...e, priority: m.High });
104
+ function ge(t, e) {
105
+ return b(t, { ...e, priority: v.High });
105
106
  }
106
- function ae(t, e) {
107
- return v(t, { ...e, priority: m.Low });
107
+ function me(t, e) {
108
+ return b(t, { ...e, priority: v.Low });
108
109
  }
109
- function ce(t, e) {
110
- return v(t, { ...e, fireImmediately: !1 });
110
+ function ve(t, e) {
111
+ return b(t, { ...e, fireImmediately: !1 });
111
112
  }
112
- function ue(t, e, r = 3, s) {
113
- let i = 0;
114
- const d = () => {
113
+ function be(t, e, r = 3, s) {
114
+ let o = 0;
115
+ const u = () => {
115
116
  try {
116
117
  return t();
117
118
  } catch (h) {
118
- if (i++, e && i <= r && e(h, i)) {
119
- setTimeout(() => d(), i * 100);
119
+ if (o++, e && o <= r && e(h, o)) {
120
+ setTimeout(() => u(), o * 100);
120
121
  return;
121
122
  } else
122
123
  throw h;
123
124
  }
124
125
  };
125
- return v(d, {
126
+ return b(u, {
126
127
  ...s,
127
128
  debugName: `${s?.debugName || "effect"}(resilient)`
128
129
  });
129
130
  }
130
- function le(t) {
131
- const e = t.map(({ fn: r, options: s }) => v(r, s));
131
+ function Se(t) {
132
+ const e = t.map(({ fn: r, options: s }) => b(r, s));
132
133
  return () => {
133
134
  e.forEach((r) => r());
134
135
  };
135
136
  }
136
- function fe() {
137
- return p.getInstance().getPerformanceMetrics();
137
+ function ye() {
138
+ return g.getInstance().getPerformanceMetrics();
138
139
  }
139
- function de() {
140
- p.getInstance().flushSync();
140
+ function we() {
141
+ g.getInstance().flushSync();
141
142
  }
142
- var j = Object.defineProperty, G = (t, e, r) => e in t ? j(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, f = (t, e, r) => G(t, typeof e != "symbol" ? e + "" : e, r);
143
- let k = 0;
144
- class K {
143
+ var Q = Object.defineProperty, X = (t, e, r) => e in t ? Q(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, d = (t, e, r) => X(t, typeof e != "symbol" ? e + "" : e, r);
144
+ let Y = 0;
145
+ class Z {
145
146
  constructor(e, r = {}) {
146
- f(this, "id", ++k), f(this, "type", "signal"), f(this, "priority"), f(this, "observers", /* @__PURE__ */ new Set()), f(this, "_value"), f(this, "scheduler", p.getInstance()), f(this, "equalsFn"), f(this, "debugName"), f(this, "options"), this._value = e, this.options = r, this.priority = r.priority ?? m.Normal, this.equalsFn = r.equals ?? A, this.debugName = r.debugName;
147
+ d(this, "id", ++Y), d(this, "type", "signal"), d(this, "priority"), d(this, "observers", /* @__PURE__ */ new Set()), d(this, "_value"), d(this, "scheduler", g.getInstance()), d(this, "equalsFn"), d(this, "debugName"), d(this, "options"), this._value = e, this.options = r, this.priority = r.priority ?? v.Normal, this.equalsFn = r.equals ?? H, this.debugName = r.debugName;
147
148
  }
148
149
  /**
149
150
  * Get the current value and track dependency
150
151
  */
151
152
  getValue() {
152
- const e = $();
153
- return e && e.state !== S.Disposed && (this.observers.add(e), e.sources.add(this)), this._value;
153
+ const e = x();
154
+ return e && e.state !== E.Disposed && (this.observers.add(e), e.sources.add(this)), this._value;
154
155
  }
155
156
  /**
156
157
  * Get the current value without tracking dependency
@@ -174,7 +175,7 @@ class K {
174
175
  */
175
176
  notify() {
176
177
  for (const e of this.observers)
177
- e.state !== S.Disposed && (e.state = S.Dirty, "type" in e && "priority" in e && this.scheduler.schedule(e));
178
+ e.state !== E.Disposed && (e.state = E.Dirty, "type" in e && "priority" in e && this.scheduler.schedule(e));
178
179
  }
179
180
  /**
180
181
  * Remove an observer (cleanup)
@@ -199,7 +200,7 @@ class K {
199
200
  type: this.type,
200
201
  value: this._value,
201
202
  observerCount: this.observers.size,
202
- priority: m[this.priority],
203
+ priority: v[this.priority],
203
204
  debugName: this.debugName,
204
205
  equalsFn: this.equalsFn.name || "anonymous"
205
206
  };
@@ -208,59 +209,59 @@ class K {
208
209
  return `Signal(${this.options.debugName || this.id}): ${this._value}`;
209
210
  }
210
211
  }
211
- function C(t, e) {
212
- const r = new K(t, e), s = r.getValue.bind(r);
212
+ function q(t, e) {
213
+ const r = new Z(t, e), s = r.getValue.bind(r);
213
214
  s.peek = r.peek.bind(r);
214
- const i = r.setValue.bind(r);
215
+ const o = r.setValue.bind(r);
215
216
  return Object.defineProperty(s, Symbol.for("tachui.signal"), {
216
217
  value: r,
217
218
  enumerable: !1
218
- }), [s, i];
219
+ }), [s, o];
219
220
  }
220
- function he(t, e) {
221
- return C(t, {
221
+ function Ee(t, e) {
222
+ return q(t, {
222
223
  ...e,
223
- equals: x
224
+ equals: M
224
225
  });
225
226
  }
226
- function pe(t, e) {
227
- return C(t, {
227
+ function Ce(t, e) {
228
+ return q(t, {
228
229
  ...e,
229
- equals: q
230
+ equals: $
230
231
  });
231
232
  }
232
- function ge(t) {
233
+ function qe(t) {
233
234
  return t[Symbol.for("tachui.signal")] || null;
234
235
  }
235
- function me(t) {
236
+ function Fe(t) {
236
237
  return typeof t == "function" && Symbol.for("tachui.signal") in t;
237
238
  }
238
- function ve() {
239
- p.getInstance().flushSync();
239
+ function Ie() {
240
+ g.getInstance().flushSync();
240
241
  }
241
- function be() {
242
- return p.getInstance().getPerformanceMetrics();
242
+ function _e() {
243
+ return g.getInstance().getPerformanceMetrics();
243
244
  }
244
- let O = !0, c = {
245
+ let R = !0, c = {
245
246
  signalsConverted: 0,
246
247
  computedsConverted: 0,
247
248
  effectsConverted: 0,
248
249
  errorsFixed: 0
249
250
  };
250
- function ye(t) {
251
- return O && console.warn(
251
+ function Ne(t) {
252
+ return R && console.warn(
252
253
  "createLegacySignal is deprecated. Use createSignal() or createEnhancedSignal() instead. See: https://docs.tachui.dev/migration/reactive-system"
253
254
  ), c.signalsConverted++, y(t);
254
255
  }
255
- function J(t, e) {
256
+ function T(t, e) {
256
257
  const r = t[0]();
257
258
  let s;
258
259
  switch (e?.equals) {
259
260
  case "deep":
260
- s = x;
261
+ s = M;
261
262
  break;
262
263
  case "shallow":
263
- s = q;
264
+ s = $;
264
265
  break;
265
266
  case "custom":
266
267
  s = e.customEquals;
@@ -268,18 +269,18 @@ function J(t, e) {
268
269
  default:
269
270
  s = void 0;
270
271
  }
271
- return c.signalsConverted++, C(r, {
272
+ return c.signalsConverted++, q(r, {
272
273
  equals: s,
273
274
  priority: e?.priority,
274
275
  debugName: e?.debugName
275
276
  });
276
277
  }
277
- function Se(t) {
278
+ function $e(t) {
278
279
  const e = t(), r = [];
279
280
  let s = "enhanced";
280
281
  return typeof e == "object" && e !== null && (Array.isArray(e) ? (r.push("Consider using deepEquals for array values to detect mutations"), r.push("Use createDeepSignal() for automatic deep comparison"), s = "deep") : (r.push("Consider using shallowEquals for object values with simple properties"), r.push("Use createShallowSignal() for automatic shallow comparison"), s = "shallow")), r.length === 0 && r.push("Signal looks good for reference equality"), { recommendations: r, suggestedMigration: s };
281
282
  }
282
- function Ee(t) {
283
+ function Me(t) {
283
284
  const e = {
284
285
  signals: [],
285
286
  computeds: [],
@@ -288,18 +289,18 @@ function Ee(t) {
288
289
  }
289
290
  };
290
291
  t.signals && (e.signals = t.signals.map(
291
- ({ original: s, options: i }) => J(s, i)
292
- )), t.computeds && (e.computeds = t.computeds.map(({ original: s, options: i }) => (c.computedsConverted++, z(s, i))));
292
+ ({ original: s, options: o }) => T(s, o)
293
+ )), t.computeds && (e.computeds = t.computeds.map(({ original: s, options: o }) => (c.computedsConverted++, V(s, o))));
293
294
  const r = [];
294
- return t.effects && t.effects.forEach(({ original: s, options: i }) => {
295
+ return t.effects && t.effects.forEach(({ original: s, options: o }) => {
295
296
  c.effectsConverted++;
296
- const d = v(s, i);
297
- r.push(d);
297
+ const u = b(s, o);
298
+ r.push(u);
298
299
  }), e.cleanup = () => {
299
300
  r.forEach((s) => s());
300
301
  }, e;
301
302
  }
302
- function Ce(t) {
303
+ function Oe(t) {
303
304
  const e = [];
304
305
  let r = t;
305
306
  return [
@@ -318,12 +319,12 @@ function Ce(t) {
318
319
  to: "createEnhancedEffect($1, { debugName: 'effect' })",
319
320
  description: "Upgraded createEffect to createEnhancedEffect with debug name"
320
321
  }
321
- ].forEach((i) => {
322
- r.match(i.from) && (r = r.replace(i.from, i.to), e.push(i.description));
322
+ ].forEach((o) => {
323
+ r.match(o.from) && (r = r.replace(o.from, o.to), e.push(o.description));
323
324
  }), { newCode: r, transformations: e };
324
325
  }
325
- function Q() {
326
- const t = p.getInstance(), e = t.getPerformanceMetrics(), r = [];
326
+ function ee() {
327
+ const t = g.getInstance(), e = t.getPerformanceMetrics(), r = [];
327
328
  let s = 100;
328
329
  return e.errorCount > 0 && (r.push(`Fix ${e.errorCount} reactive errors for better stability`), s -= e.errorCount * 5), e.averageUpdateTime > 16 && (r.push("Update times exceed 16ms - consider optimizing computations"), s -= 20), e.totalNodes > 1e3 && (r.push("High number of reactive nodes - consider batching updates"), s -= 10), {
329
330
  scheduler: t.getDebugInfo(),
@@ -343,18 +344,18 @@ function Q() {
343
344
  recommendations: r
344
345
  };
345
346
  }
346
- function we(t = { verbose: !1 }) {
347
- const e = p.getInstance(), r = (i) => {
348
- console.error("🔥 Reactive System Error:", i), c.errorsFixed++;
347
+ function xe(t = { verbose: !1 }) {
348
+ const e = g.getInstance(), r = (o) => {
349
+ console.error("🔥 Reactive System Error:", o), c.errorsFixed++;
349
350
  }, s = e.onError(r);
350
351
  return t.verbose && (console.log("🔍 Reactive debugging enabled"), console.log("📊 Migration stats:", c)), () => {
351
352
  s(), t.verbose && console.log("🔍 Reactive debugging disabled");
352
353
  };
353
354
  }
354
- function Ne() {
355
+ function Re() {
355
356
  return { ...c };
356
357
  }
357
- function _e() {
358
+ function De() {
358
359
  c = {
359
360
  signalsConverted: 0,
360
361
  computedsConverted: 0,
@@ -362,11 +363,11 @@ function _e() {
362
363
  errorsFixed: 0
363
364
  };
364
365
  }
365
- function Ie(t) {
366
- O = t;
366
+ function Ue(t) {
367
+ R = t;
367
368
  }
368
- function Fe() {
369
- const t = Q();
369
+ function ze() {
370
+ const t = ee();
370
371
  return `
371
372
  # TachUI Reactive System Migration Report
372
373
 
@@ -385,141 +386,249 @@ ${t.recommendations.map((e) => `- ${e}`).join(`
385
386
  ## Generated: ${(/* @__PURE__ */ new Date()).toISOString()}
386
387
  `;
387
388
  }
388
- function $e() {
389
- return E() !== null;
389
+ function Pe() {
390
+ return C() !== null;
390
391
  }
391
- function X(t) {
392
- return L(null, t);
392
+ function te(t) {
393
+ return j(null, t);
393
394
  }
394
- function qe(t) {
395
- return X(() => V(t));
395
+ function Ae(t) {
396
+ return te(() => W(t));
396
397
  }
397
- function xe() {
398
- let t = E();
398
+ function Le() {
399
+ let t = C();
399
400
  if (!t) return null;
400
401
  for (; t.parent; )
401
402
  t = t.parent;
402
403
  return t;
403
404
  }
404
- function Oe() {
405
+ function ke() {
405
406
  const t = [];
406
- let e = E();
407
+ let e = C();
407
408
  for (; e; )
408
409
  t.push(e), e = e.parent;
409
410
  return t;
410
411
  }
411
- function Y(t, e) {
412
- const r = /* @__PURE__ */ new Map(), [s, i] = y(t.map(e)), d = s, h = () => s.peek(), b = (o) => {
412
+ var re = Object.defineProperty, se = (t, e, r) => e in t ? re(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, w = (t, e, r) => se(t, typeof e != "symbol" ? e + "" : e, r);
413
+ class D {
414
+ constructor() {
415
+ w(this, "pending", /* @__PURE__ */ new Set()), w(this, "isFlushScheduled", !1);
416
+ }
417
+ schedule(e) {
418
+ this.pending.add(e), this.isFlushScheduled || (this.isFlushScheduled = !0, queueMicrotask(() => this.flush()));
419
+ }
420
+ flush() {
421
+ if (this.pending.size === 0) {
422
+ this.isFlushScheduled = !1;
423
+ return;
424
+ }
425
+ const e = Array.from(this.pending);
426
+ this.pending.clear(), this.isFlushScheduled = !1;
427
+ for (const r of e)
428
+ try {
429
+ r();
430
+ } catch (s) {
431
+ console.error("Error in scheduled task:", s);
432
+ }
433
+ this.pending.size > 0 && (this.isFlushScheduled = !0, queueMicrotask(() => this.flush()));
434
+ }
435
+ }
436
+ class ne {
437
+ schedule(e) {
438
+ try {
439
+ e();
440
+ } catch (r) {
441
+ console.error("Error in sync scheduled task:", r);
442
+ }
443
+ }
444
+ flush() {
445
+ }
446
+ }
447
+ var U = /* @__PURE__ */ ((t) => (t[t.Immediate = 0] = "Immediate", t[t.High = 1] = "High", t[t.Normal = 2] = "Normal", t[t.Low = 3] = "Low", t[t.Idle = 4] = "Idle", t))(U || {});
448
+ class ie {
449
+ constructor() {
450
+ w(this, "queues", /* @__PURE__ */ new Map()), w(this, "taskIdCounter", 0), w(this, "isFlushScheduled", !1);
451
+ for (const e of Object.values(U))
452
+ typeof e == "number" && this.queues.set(e, /* @__PURE__ */ new Set());
453
+ }
454
+ schedule(e, r = 2) {
455
+ const s = {
456
+ fn: e,
457
+ priority: r,
458
+ id: ++this.taskIdCounter
459
+ }, o = this.queues.get(r);
460
+ o && o.add(s), this.isFlushScheduled || (this.isFlushScheduled = !0, r === 0 ? this.flush() : queueMicrotask(() => this.flush()));
461
+ }
462
+ flush() {
463
+ this.isFlushScheduled = !1;
464
+ for (const e of [
465
+ 0,
466
+ 1,
467
+ 2,
468
+ 3,
469
+ 4
470
+ /* Idle */
471
+ ]) {
472
+ const r = this.queues.get(e);
473
+ if (!r || r.size === 0) continue;
474
+ const s = Array.from(r).sort((o, u) => o.id - u.id);
475
+ r.clear();
476
+ for (const o of s)
477
+ try {
478
+ o.fn();
479
+ } catch (u) {
480
+ console.error(`Error in priority ${e} task:`, u);
481
+ }
482
+ if (r.size === 0 && this.hasMoreTasks()) {
483
+ queueMicrotask(() => this.flush());
484
+ return;
485
+ }
486
+ }
487
+ }
488
+ hasMoreTasks() {
489
+ for (const e of this.queues.values())
490
+ if (e.size > 0) return !0;
491
+ return !1;
492
+ }
493
+ }
494
+ let p = new D();
495
+ function He() {
496
+ return p;
497
+ }
498
+ function Ve(t) {
499
+ p = t;
500
+ }
501
+ function je(t = !0) {
502
+ t ? p = new D() : p = new ne();
503
+ }
504
+ function We(t) {
505
+ p.schedule(t);
506
+ }
507
+ function Be(t, e) {
508
+ p instanceof ie ? p.schedule(t, e) : p.schedule(t);
509
+ }
510
+ function Ke(t) {
511
+ typeof requestIdleCallback < "u" ? requestIdleCallback(t) : setTimeout(t, 0);
512
+ }
513
+ function oe(t, e) {
514
+ const r = /* @__PURE__ */ new Map(), [s, o] = y(t.map(e)), u = s, h = () => s.peek(), S = (i) => {
413
515
  const n = h();
414
- R(n, o) || i(o);
415
- }, R = (o, n) => {
416
- if (o.length !== n.length) return !1;
417
- for (let a = 0; a < o.length; a++)
418
- if (o[a] !== n[a]) return !1;
516
+ z(n, i) || o(i);
517
+ }, z = (i, n) => {
518
+ if (i.length !== n.length) return !1;
519
+ for (let a = 0; a < i.length; a++)
520
+ if (i[a] !== n[a]) return !1;
419
521
  return !0;
420
522
  };
421
- t.forEach((o) => {
422
- const n = e(o);
423
- r.set(n, y(o));
523
+ t.forEach((i) => {
524
+ const n = e(i);
525
+ r.set(n, y(i));
424
526
  });
425
- const D = (o) => {
426
- const n = r.get(o);
527
+ const P = (i) => {
528
+ const n = r.get(i);
427
529
  if (!n)
428
- throw new Error(`SignalList: Item with key "${String(o)}" not found`);
530
+ throw new Error(`SignalList: Item with key "${String(i)}" not found`);
429
531
  return n[0];
430
- }, P = (o, n) => {
431
- const a = r.get(o);
532
+ }, A = (i, n) => {
533
+ const a = r.get(i);
432
534
  if (a)
433
535
  a[1](n);
434
536
  else {
435
- r.set(o, y(n));
436
- const u = h();
437
- b([...u, o]);
537
+ r.set(i, y(n));
538
+ const l = h();
539
+ S([...l, i]);
438
540
  }
439
- }, M = (o, n) => {
440
- if (o.length !== n.length)
541
+ }, L = (i, n) => {
542
+ if (i.length !== n.length)
441
543
  return !0;
442
- const a = new Set(o), u = new Set(n);
443
- if (a.size !== u.size)
544
+ const a = new Set(i), l = new Set(n);
545
+ if (a.size !== l.size)
444
546
  return !0;
445
- for (const N of n)
446
- if (!a.has(N))
547
+ for (const I of n)
548
+ if (!a.has(I))
447
549
  return !0;
448
550
  return !1;
449
- }, U = (o) => {
450
- const n = o.map(e), a = new Set(n), u = h();
451
- o.forEach((g) => {
452
- const _ = e(g), I = r.get(_);
453
- I ? I[1](g) : r.set(_, y(g));
454
- }), u.forEach((g) => {
455
- a.has(g) || r.delete(g);
456
- }), M(u, n) && b(n);
457
- }, w = (o, n) => {
458
- const a = r.get(o);
551
+ }, k = (i) => {
552
+ const n = i.map(e), a = new Set(n), l = h();
553
+ i.forEach((m) => {
554
+ const _ = e(m), N = r.get(_);
555
+ N ? N[1](m) : r.set(_, y(m));
556
+ }), l.forEach((m) => {
557
+ a.has(m) || r.delete(m);
558
+ }), L(l, n) && S(n);
559
+ }, F = (i, n) => {
560
+ const a = r.get(i);
459
561
  if (!a) return null;
460
- const u = a[0];
461
- return u ? n ? u() : typeof u.peek == "function" ? u.peek() : u() : null;
562
+ const l = a[0];
563
+ return l ? n ? l() : typeof l.peek == "function" ? l.peek() : l() : null;
462
564
  };
463
565
  return [
464
- () => d().map((n) => w(n, !0)).filter((n) => n !== null),
566
+ () => u().map((n) => F(n, !0)).filter((n) => n !== null),
465
567
  {
466
- ids: d,
467
- get: D,
468
- update: P,
469
- set: U,
568
+ ids: u,
569
+ get: P,
570
+ update: A,
571
+ set: k,
470
572
  clear: () => {
471
- r.clear(), b([]);
573
+ r.clear(), S([]);
472
574
  },
473
- remove: (o) => {
474
- r.delete(o);
575
+ remove: (i) => {
576
+ r.delete(i);
475
577
  const n = h();
476
- b(n.filter((a) => a !== o));
578
+ S(n.filter((a) => a !== i));
477
579
  },
478
- reorder: (o) => {
479
- if (!o.every((a) => r.has(a)))
580
+ reorder: (i) => {
581
+ if (!i.every((a) => r.has(a)))
480
582
  throw new Error("[SignalList.reorder] Cannot reorder with unknown ids");
481
- b([...o]);
583
+ S([...i]);
482
584
  },
483
- getAll: () => h().map((n) => w(n, !1)).filter((n) => n !== null)
585
+ getAll: () => h().map((n) => F(n, !1)).filter((n) => n !== null)
484
586
  }
485
587
  ];
486
588
  }
487
- function Re(t, e) {
488
- const [, r] = Y(t, e);
589
+ function Ge(t, e) {
590
+ const [, r] = oe(t, e);
489
591
  return r;
490
592
  }
491
593
  export {
492
- qe as A,
493
- Oe as B,
494
- xe as C,
495
- $e as D,
496
- X as E,
497
- Y as F,
498
- Re as G,
499
- v as a,
500
- ie as b,
501
- le as c,
502
- ae as d,
503
- ue as e,
504
- ce as f,
505
- de as g,
506
- fe as h,
507
- he as i,
508
- C as j,
509
- pe as k,
510
- ve as l,
511
- ge as m,
512
- be as n,
513
- me as o,
514
- Q as p,
515
- Se as q,
516
- ye as r,
517
- Fe as s,
518
- we as t,
519
- Ne as u,
520
- Ee as v,
521
- Ce as w,
522
- J as x,
523
- _e as y,
524
- Ie as z
594
+ Ae as A,
595
+ ke as B,
596
+ Le as C,
597
+ Pe as D,
598
+ te as E,
599
+ je as F,
600
+ He as G,
601
+ Ke as H,
602
+ We as I,
603
+ Be as J,
604
+ Ve as K,
605
+ oe as L,
606
+ Ge as M,
607
+ U as T,
608
+ b as a,
609
+ ge as b,
610
+ Se as c,
611
+ me as d,
612
+ be as e,
613
+ ve as f,
614
+ we as g,
615
+ ye as h,
616
+ Ee as i,
617
+ q as j,
618
+ Ce as k,
619
+ Ie as l,
620
+ qe as m,
621
+ _e as n,
622
+ Fe as o,
623
+ ee as p,
624
+ $e as q,
625
+ Ne as r,
626
+ ze as s,
627
+ xe as t,
628
+ Re as u,
629
+ Me as v,
630
+ Oe as w,
631
+ T as x,
632
+ De as y,
633
+ Ue as z
525
634
  };