@but212/atom-effect-jquery 0.16.0 → 0.17.0
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.
- package/README.md +17 -158
- package/dist/atom-effect-jquery.min.js +1 -1
- package/dist/atom-effect-jquery.min.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1054 -1278
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { default as
|
|
3
|
-
const
|
|
4
|
-
/** One second in milliseconds */
|
|
1
|
+
import u from "jquery";
|
|
2
|
+
import { default as Me } from "jquery";
|
|
3
|
+
const Wt = {
|
|
5
4
|
ONE_SECOND_MS: 1e3
|
|
6
|
-
},
|
|
5
|
+
}, ht = {
|
|
7
6
|
IDLE: "idle",
|
|
8
7
|
PENDING: "pending",
|
|
9
8
|
RESOLVED: "resolved",
|
|
10
9
|
REJECTED: "rejected"
|
|
11
|
-
},
|
|
10
|
+
}, F = {
|
|
12
11
|
DISPOSED: 1,
|
|
13
12
|
HAS_FN_SUBS: 2,
|
|
14
13
|
HAS_OBJ_SUBS: 4
|
|
15
|
-
},
|
|
16
|
-
...
|
|
14
|
+
}, k = {
|
|
15
|
+
...F,
|
|
17
16
|
EXECUTING: 8
|
|
18
|
-
},
|
|
19
|
-
...
|
|
17
|
+
}, h = {
|
|
18
|
+
...F,
|
|
20
19
|
DIRTY: 8,
|
|
21
20
|
IDLE: 16,
|
|
22
21
|
PENDING: 32,
|
|
@@ -24,695 +23,540 @@ const Ze = {
|
|
|
24
23
|
REJECTED: 128,
|
|
25
24
|
RECOMPUTING: 256,
|
|
26
25
|
HAS_ERROR: 512
|
|
27
|
-
},
|
|
28
|
-
...
|
|
26
|
+
}, R = {
|
|
27
|
+
...F,
|
|
29
28
|
SYNC: 8,
|
|
30
29
|
NOTIFICATION_SCHEDULED: 16
|
|
31
|
-
},
|
|
32
|
-
|
|
30
|
+
}, $ = {
|
|
31
|
+
// Infinite loop protection
|
|
33
32
|
MAX_EXECUTIONS_PER_SECOND: 1e3,
|
|
34
|
-
/**
|
|
35
|
-
* Maximum executions per effect within a single flush cycle
|
|
36
|
-
* Increased from 50 to 100
|
|
37
|
-
*/
|
|
38
33
|
MAX_EXECUTIONS_PER_EFFECT: 100,
|
|
39
|
-
|
|
40
|
-
* Maximum total executions across all effects in a single flush cycle
|
|
41
|
-
* Increased from 5000 to 10000
|
|
42
|
-
*/
|
|
34
|
+
// Batch processing limits to prevent blocking the main thread for too long
|
|
43
35
|
MAX_EXECUTIONS_PER_FLUSH: 1e4,
|
|
44
|
-
/** Maximum iterations for synchronous flush loop to prevent infinite loops */
|
|
45
36
|
MAX_FLUSH_ITERATIONS: 1e3,
|
|
46
|
-
/** Minimum allowed value for max flush iterations */
|
|
47
37
|
MIN_FLUSH_ITERATIONS: 10,
|
|
48
|
-
/** Threshold for shrinking the batch queue to assist GC */
|
|
49
38
|
BATCH_QUEUE_SHRINK_THRESHOLD: 1e3
|
|
50
|
-
},
|
|
51
|
-
/** Maximum dependencies before warning about large dependency graphs */
|
|
39
|
+
}, kt = {
|
|
52
40
|
MAX_DEPENDENCIES: 1e3,
|
|
53
|
-
/** Enable infinite loop detection warnings */
|
|
54
41
|
WARN_INFINITE_LOOP: !0
|
|
55
|
-
},
|
|
56
|
-
class
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
* @param message - Error message describing what went wrong
|
|
60
|
-
* @param cause - Original error that caused this error
|
|
61
|
-
* @param recoverable - Whether the operation can be retried
|
|
62
|
-
*/
|
|
63
|
-
constructor(e, t = null, s = !0) {
|
|
64
|
-
super(e), this.name = "AtomError", this.cause = t, this.recoverable = s, this.timestamp = /* @__PURE__ */ new Date();
|
|
42
|
+
}, G = 1073741823, m = typeof process < "u" && process.env && process.env.NODE_ENV !== "production" || typeof __DEV__ < "u" && !!__DEV__, Kt = Object.freeze([]);
|
|
43
|
+
class Z extends Error {
|
|
44
|
+
constructor(t, e = null, s = !0) {
|
|
45
|
+
super(t), this.cause = e, this.recoverable = s, this.timestamp = /* @__PURE__ */ new Date(), this.name = "AtomError";
|
|
65
46
|
}
|
|
66
47
|
}
|
|
67
|
-
class
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
* @param message - Error message
|
|
71
|
-
* @param cause - Original error
|
|
72
|
-
*/
|
|
73
|
-
constructor(e, t = null) {
|
|
74
|
-
super(e, t, !0), this.name = "ComputedError";
|
|
48
|
+
class B extends Z {
|
|
49
|
+
constructor(t, e = null) {
|
|
50
|
+
super(t, e, !0), this.name = "ComputedError";
|
|
75
51
|
}
|
|
76
52
|
}
|
|
77
|
-
class
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
* @param message - Error message
|
|
81
|
-
* @param cause - Original error
|
|
82
|
-
*/
|
|
83
|
-
constructor(e, t = null) {
|
|
84
|
-
super(e, t, !1), this.name = "EffectError";
|
|
53
|
+
class q extends Z {
|
|
54
|
+
constructor(t, e = null) {
|
|
55
|
+
super(t, e, !1), this.name = "EffectError";
|
|
85
56
|
}
|
|
86
57
|
}
|
|
87
|
-
class
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
* @param message - Error message
|
|
91
|
-
* @param cause - Original error
|
|
92
|
-
*/
|
|
93
|
-
constructor(e, t = null) {
|
|
94
|
-
super(e, t, !1), this.name = "SchedulerError";
|
|
58
|
+
class it extends Z {
|
|
59
|
+
constructor(t, e = null) {
|
|
60
|
+
super(t, e, !1), this.name = "SchedulerError";
|
|
95
61
|
}
|
|
96
62
|
}
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
COMPUTED_ASYNC_PENDING_NO_DEFAULT: "Async computation is pending. No default value provided",
|
|
109
|
-
/**
|
|
110
|
-
* Error thrown when a synchronous computed computation fails.
|
|
111
|
-
*/
|
|
112
|
-
COMPUTED_COMPUTATION_FAILED: "Computed computation failed",
|
|
113
|
-
/**
|
|
114
|
-
* Error thrown when an asynchronous computed computation fails.
|
|
115
|
-
*/
|
|
116
|
-
COMPUTED_ASYNC_COMPUTATION_FAILED: "Async computed computation failed",
|
|
117
|
-
/**
|
|
118
|
-
* Error thrown when a circular dependency is detected during computation.
|
|
119
|
-
*/
|
|
120
|
-
COMPUTED_CIRCULAR_DEPENDENCY: "Circular dependency detected during computation",
|
|
121
|
-
/**
|
|
122
|
-
* Error thrown when accessing a disposed computed value.
|
|
123
|
-
*/
|
|
124
|
-
COMPUTED_DISPOSED: "Cannot access a disposed computed",
|
|
125
|
-
// ─────────────────────────────────────────────────────────────────
|
|
126
|
-
// Atom errors
|
|
127
|
-
// ─────────────────────────────────────────────────────────────────
|
|
128
|
-
/**
|
|
129
|
-
* Error thrown when atom.subscribe() receives an invalid listener.
|
|
130
|
-
*/
|
|
131
|
-
ATOM_SUBSCRIBER_MUST_BE_FUNCTION: "Subscription listener must be a function or Subscriber object",
|
|
132
|
-
/**
|
|
133
|
-
* Error logged when an individual subscriber throws during notification.
|
|
134
|
-
* @remarks This error is caught and logged to prevent cascading failures.
|
|
135
|
-
*/
|
|
136
|
-
ATOM_INDIVIDUAL_SUBSCRIBER_FAILED: "Error during individual atom subscriber execution",
|
|
137
|
-
// ─────────────────────────────────────────────────────────────────
|
|
138
|
-
// Effect errors
|
|
139
|
-
// ─────────────────────────────────────────────────────────────────
|
|
140
|
-
/**
|
|
141
|
-
* Error thrown when effect() receives a non-function argument.
|
|
142
|
-
*/
|
|
143
|
-
EFFECT_MUST_BE_FUNCTION: "Effect function must be a function",
|
|
144
|
-
/**
|
|
145
|
-
* Error thrown when an effect's execution fails.
|
|
146
|
-
*/
|
|
147
|
-
EFFECT_EXECUTION_FAILED: "Effect execution failed",
|
|
148
|
-
/**
|
|
149
|
-
* Error thrown when an effect's cleanup function fails.
|
|
150
|
-
*/
|
|
151
|
-
EFFECT_CLEANUP_FAILED: "Effect cleanup function execution failed",
|
|
152
|
-
/**
|
|
153
|
-
* Error thrown when attempting to run a disposed effect.
|
|
154
|
-
*/
|
|
155
|
-
EFFECT_DISPOSED: "Cannot run a disposed effect",
|
|
156
|
-
// ─────────────────────────────────────────────────────────────────
|
|
157
|
-
// Debug warnings
|
|
158
|
-
// ─────────────────────────────────────────────────────────────────
|
|
159
|
-
/**
|
|
160
|
-
* Warning message for large dependency graphs.
|
|
161
|
-
*
|
|
162
|
-
* @param count - The number of dependencies detected
|
|
163
|
-
* @returns Formatted warning message with dependency count
|
|
164
|
-
*
|
|
165
|
-
* @example
|
|
166
|
-
* ```ts
|
|
167
|
-
* console.warn(ERROR_MESSAGES.LARGE_DEPENDENCY_GRAPH(150));
|
|
168
|
-
* // Output: "Large dependency graph detected: 150 dependencies"
|
|
169
|
-
* ```
|
|
170
|
-
*/
|
|
171
|
-
LARGE_DEPENDENCY_GRAPH: (n) => `Large dependency graph detected: ${n} dependencies`,
|
|
172
|
-
/**
|
|
173
|
-
* Error logged when the onError callback itself throws an error.
|
|
174
|
-
* @remarks This prevents cascading failures from masking the original error.
|
|
175
|
-
*/
|
|
176
|
-
CALLBACK_ERROR_IN_ERROR_HANDLER: "Error occurred during onError callback execution"
|
|
177
|
-
}, Se = /* @__PURE__ */ Symbol("debugName"), tt = /* @__PURE__ */ Symbol("id"), ye = /* @__PURE__ */ Symbol("type"), Ie = /* @__PURE__ */ Symbol("noDefaultValue");
|
|
178
|
-
function nt(n) {
|
|
179
|
-
return "dependencies" in n && Array.isArray(n.dependencies);
|
|
180
|
-
}
|
|
181
|
-
function Ve(n, e, t) {
|
|
182
|
-
if (!t.has(n.id)) {
|
|
183
|
-
if (t.add(n.id), n === e)
|
|
184
|
-
throw new $("Indirect circular dependency detected");
|
|
185
|
-
if (nt(n)) {
|
|
186
|
-
const s = n.dependencies;
|
|
187
|
-
for (let i = 0; i < s.length; i++) {
|
|
188
|
-
const o = s[i];
|
|
189
|
-
o && Ve(o, e, t);
|
|
190
|
-
}
|
|
63
|
+
const At = /* @__PURE__ */ Symbol("AtomEffect.DebugName"), Zt = /* @__PURE__ */ Symbol("AtomEffect.Id"), vt = /* @__PURE__ */ Symbol("AtomEffect.Type"), pt = /* @__PURE__ */ Symbol("AtomEffect.NoDefaultValue"), te = (n) => "dependencies" in n && Array.isArray(n.dependencies);
|
|
64
|
+
function Bt(n, t, e) {
|
|
65
|
+
if (n === t)
|
|
66
|
+
throw new B(
|
|
67
|
+
"Circular dependency detected: The computation refers to itself explicitly or implicitly."
|
|
68
|
+
);
|
|
69
|
+
if (!e.has(n.id) && (e.add(n.id), te(n))) {
|
|
70
|
+
const s = n.dependencies;
|
|
71
|
+
for (let i = 0; i < s.length; i++) {
|
|
72
|
+
const o = s[i];
|
|
73
|
+
o && Bt(o, t, e);
|
|
191
74
|
}
|
|
192
75
|
}
|
|
193
76
|
}
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
77
|
+
const X = {
|
|
78
|
+
// Dev mode flag
|
|
79
|
+
enabled: m,
|
|
80
|
+
maxDependencies: kt.MAX_DEPENDENCIES,
|
|
81
|
+
warnInfiniteLoop: kt.WARN_INFINITE_LOOP,
|
|
82
|
+
warn(n, t) {
|
|
83
|
+
m && this.enabled && n && console.warn(`[Atom Effect] ${t}`);
|
|
200
84
|
},
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
*/
|
|
206
|
-
checkCircular(n, e) {
|
|
207
|
-
if (n === e)
|
|
208
|
-
throw new $("Direct circular dependency detected");
|
|
209
|
-
this.enabled && Ve(n, e, /* @__PURE__ */ new Set());
|
|
85
|
+
checkCircular(n, t) {
|
|
86
|
+
if (n === t)
|
|
87
|
+
throw new B("Direct circular dependency detected");
|
|
88
|
+
m && this.enabled && Bt(n, t, /* @__PURE__ */ new Set());
|
|
210
89
|
},
|
|
211
|
-
attachDebugInfo(n,
|
|
212
|
-
if (!this.enabled)
|
|
213
|
-
return;
|
|
90
|
+
attachDebugInfo(n, t, e) {
|
|
91
|
+
if (!m || !this.enabled) return;
|
|
214
92
|
const s = n;
|
|
215
|
-
s[
|
|
216
|
-
},
|
|
217
|
-
getDebugName(n) {
|
|
218
|
-
if (n != null && Se in n)
|
|
219
|
-
return n[Se];
|
|
93
|
+
s[At] = `${t}_${e}`, s[Zt] = e, s[vt] = t;
|
|
220
94
|
},
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
return n[ye];
|
|
224
|
-
}
|
|
95
|
+
getDebugName: (n) => n?.[At],
|
|
96
|
+
getDebugType: (n) => n?.[vt]
|
|
225
97
|
};
|
|
226
|
-
let
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
subscribe(e) {
|
|
238
|
-
if (typeof e == "function")
|
|
239
|
-
return this._addSubscriber(this._fnSubs, e, w.HAS_FN_SUBS);
|
|
240
|
-
if (e !== null && typeof e == "object" && "execute" in e)
|
|
241
|
-
return this._addSubscriber(this._objSubs, e, w.HAS_OBJ_SUBS);
|
|
242
|
-
throw new Q(C.ATOM_SUBSCRIBER_MUST_BE_FUNCTION);
|
|
98
|
+
let ee = 1;
|
|
99
|
+
const ne = () => ee++;
|
|
100
|
+
function $t(n, t, e) {
|
|
101
|
+
if (typeof t == "function") {
|
|
102
|
+
const i = t;
|
|
103
|
+
for (let o = 0, r = e.length; o < r; o++) {
|
|
104
|
+
const c = e[o];
|
|
105
|
+
if (c && c.fn === i) return;
|
|
106
|
+
}
|
|
107
|
+
e.push(new St(i, void 0)), n.flags |= F.HAS_FN_SUBS, "_fnSubCount" in n && n._fnSubCount++;
|
|
108
|
+
return;
|
|
243
109
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
_addSubscriber(e, t, s) {
|
|
248
|
-
return e.indexOf(t) !== -1 ? (Z && console.warn(
|
|
249
|
-
"Attempted to subscribe the same listener twice. Ignoring duplicate subscription."
|
|
250
|
-
), () => {
|
|
251
|
-
}) : (e.push(t), this.flags |= s, () => {
|
|
252
|
-
const i = e.indexOf(t);
|
|
253
|
-
if (i === -1) return;
|
|
254
|
-
const o = e.pop();
|
|
255
|
-
i < e.length && (e[i] = o), e.length === 0 && (this.flags &= ~s);
|
|
256
|
-
});
|
|
110
|
+
if ("addDependency" in t) {
|
|
111
|
+
t.addDependency(n);
|
|
112
|
+
return;
|
|
257
113
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return this._fnSubs.length + this._objSubs.length;
|
|
114
|
+
const s = t;
|
|
115
|
+
for (let i = 0, o = e.length; i < o; i++) {
|
|
116
|
+
const r = e[i];
|
|
117
|
+
if (r && r.sub === s) return;
|
|
263
118
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
try {
|
|
283
|
-
i[o].execute();
|
|
284
|
-
} catch (r) {
|
|
285
|
-
this._handleNotifyError(r);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
119
|
+
e.push(new St(void 0, s)), n.flags |= F.HAS_OBJ_SUBS, "_objSubCount" in n && n._objSubCount++;
|
|
120
|
+
}
|
|
121
|
+
function se(n, t, e) {
|
|
122
|
+
for (let s = 0, i = t.length; s < i; s++) {
|
|
123
|
+
const o = t[s];
|
|
124
|
+
o && (o.node._tempUnsub = o.unsub);
|
|
125
|
+
}
|
|
126
|
+
for (let s = 0, i = n.length; s < i; s++) {
|
|
127
|
+
const o = n[s];
|
|
128
|
+
if (!o) continue;
|
|
129
|
+
const r = o.node;
|
|
130
|
+
r._tempUnsub !== void 0 ? (o.unsub = r._tempUnsub, r._tempUnsub = void 0) : (X.checkCircular(r, e), o.unsub = r.subscribe(e));
|
|
131
|
+
}
|
|
132
|
+
for (let s = 0, i = t.length; s < i; s++) {
|
|
133
|
+
const o = t[s];
|
|
134
|
+
if (o) {
|
|
135
|
+
const r = o.node;
|
|
136
|
+
r._tempUnsub !== void 0 && (r._tempUnsub(), r._tempUnsub = void 0), o.unsub = void 0;
|
|
288
137
|
}
|
|
289
138
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
console.error(new Q(C.ATOM_INDIVIDUAL_SUBSCRIBER_FAILED, e));
|
|
139
|
+
}
|
|
140
|
+
class mt {
|
|
141
|
+
constructor(t, e, s = void 0) {
|
|
142
|
+
this.node = t, this.version = e, this.unsub = s;
|
|
295
143
|
}
|
|
296
144
|
}
|
|
297
|
-
class
|
|
298
|
-
constructor() {
|
|
299
|
-
this.
|
|
145
|
+
class St {
|
|
146
|
+
constructor(t, e) {
|
|
147
|
+
this.fn = t, this.sub = e;
|
|
300
148
|
}
|
|
301
149
|
}
|
|
302
|
-
|
|
150
|
+
const S = {
|
|
151
|
+
// Computed Errors
|
|
152
|
+
COMPUTED_MUST_BE_FUNCTION: "Computed target must be a function",
|
|
153
|
+
COMPUTED_ASYNC_PENDING_NO_DEFAULT: "Async computation pending with no default value",
|
|
154
|
+
COMPUTED_COMPUTATION_FAILED: "Computation execution failed",
|
|
155
|
+
COMPUTED_ASYNC_COMPUTATION_FAILED: "Async computation execution failed",
|
|
156
|
+
COMPUTED_CIRCULAR_DEPENDENCY: "Circular dependency detected",
|
|
157
|
+
COMPUTED_DISPOSED: "Attempted to access disposed computed",
|
|
158
|
+
// Atom Errors
|
|
159
|
+
ATOM_SUBSCRIBER_MUST_BE_FUNCTION: "Subscriber must be a function or Subscriber object",
|
|
160
|
+
ATOM_INDIVIDUAL_SUBSCRIBER_FAILED: "Subscriber execution failed",
|
|
161
|
+
// Effect Errors
|
|
162
|
+
EFFECT_MUST_BE_FUNCTION: "Effect target must be a function",
|
|
163
|
+
EFFECT_EXECUTION_FAILED: "Effect execution failed",
|
|
164
|
+
EFFECT_CLEANUP_FAILED: "Effect cleanup failed",
|
|
165
|
+
EFFECT_DISPOSED: "Attempted to run disposed effect",
|
|
166
|
+
CALLBACK_ERROR_IN_ERROR_HANDLER: "Exception encountered in onError handler"
|
|
167
|
+
};
|
|
168
|
+
function K(n, t, e) {
|
|
169
|
+
if (n instanceof Z)
|
|
170
|
+
return n;
|
|
171
|
+
const s = n instanceof Error, i = s ? n.message : String(n), o = s ? n : void 0;
|
|
172
|
+
let r = "Unexpected error";
|
|
173
|
+
n instanceof TypeError ? r = "Type error" : n instanceof ReferenceError && (r = "Reference error");
|
|
174
|
+
const c = `${r} (${e}): ${i}`;
|
|
175
|
+
return new t(c, o);
|
|
176
|
+
}
|
|
177
|
+
class jt {
|
|
303
178
|
constructor() {
|
|
304
|
-
this.
|
|
179
|
+
this.flags = 0, this.version = 0, this._lastSeenEpoch = -1, this._modifiedAtEpoch = -1, this.id = ne() & G, this._tempUnsub = void 0;
|
|
305
180
|
}
|
|
306
181
|
}
|
|
307
|
-
class
|
|
182
|
+
class Ht extends jt {
|
|
308
183
|
constructor() {
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
/** Acquires an array from the pool or creates a new one if the pool is empty. */
|
|
312
|
-
acquire() {
|
|
313
|
-
const e = this.stats;
|
|
314
|
-
return e && e.acquired++, this.pool.pop() ?? [];
|
|
184
|
+
super(...arguments), this._fnSubCount = 0, this._objSubCount = 0;
|
|
315
185
|
}
|
|
316
186
|
/**
|
|
317
|
-
*
|
|
318
|
-
* Clears the array before storing it.
|
|
187
|
+
* Adds subscriber.
|
|
319
188
|
*/
|
|
320
|
-
|
|
321
|
-
const
|
|
322
|
-
if (
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
return;
|
|
189
|
+
subscribe(t) {
|
|
190
|
+
const e = typeof t == "function";
|
|
191
|
+
if (!e && (!t || typeof t.execute != "function"))
|
|
192
|
+
throw K(
|
|
193
|
+
new TypeError("Invalid subscriber"),
|
|
194
|
+
Z,
|
|
195
|
+
S.ATOM_SUBSCRIBER_MUST_BE_FUNCTION
|
|
196
|
+
);
|
|
197
|
+
const s = this._subscribers;
|
|
198
|
+
for (let o = 0, r = s.length; o < r; o++) {
|
|
199
|
+
const c = s[o];
|
|
200
|
+
if (c && (e ? c.fn === t : c.sub === t))
|
|
201
|
+
return m && console.warn("Duplicate subscription ignored."), () => {
|
|
202
|
+
};
|
|
335
203
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
if (!e) return null;
|
|
342
|
-
const { acquired: t, released: s, rejected: i } = e, { frozen: o, tooLarge: r, poolFull: c } = i;
|
|
343
|
-
return {
|
|
344
|
-
acquired: t,
|
|
345
|
-
released: s,
|
|
346
|
-
rejected: {
|
|
347
|
-
frozen: o,
|
|
348
|
-
tooLarge: r,
|
|
349
|
-
poolFull: c
|
|
350
|
-
},
|
|
351
|
-
leaked: t - s - (o + r + c),
|
|
352
|
-
poolSize: this.pool.length
|
|
353
|
-
};
|
|
204
|
+
const i = new St(
|
|
205
|
+
e ? t : void 0,
|
|
206
|
+
e ? void 0 : t
|
|
207
|
+
);
|
|
208
|
+
return s.push(i), e ? (this._fnSubCount++, this.flags |= F.HAS_FN_SUBS) : (this._objSubCount++, this.flags |= F.HAS_OBJ_SUBS), () => this._unsubscribe(i);
|
|
354
209
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
const
|
|
359
|
-
e && (e
|
|
210
|
+
_unsubscribe(t) {
|
|
211
|
+
const e = this._subscribers, s = e.indexOf(t);
|
|
212
|
+
if (s === -1) return;
|
|
213
|
+
const i = e.pop();
|
|
214
|
+
s < e.length && i && (e[s] = i), t.fn ? this._fnSubCount-- : this._objSubCount--, e.length === 0 ? (this.flags &= -7, this._fnSubCount = 0, this._objSubCount = 0) : t.fn && this._fnSubCount <= 0 ? (this.flags &= -3, this._fnSubCount = 0) : !t.fn && this._objSubCount <= 0 && (this.flags &= -5, this._objSubCount = 0);
|
|
360
215
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
if (
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
const i = e;
|
|
376
|
-
s.indexOf(i) === -1 && (s.push(i), n.flags |= w.HAS_OBJ_SUBS);
|
|
216
|
+
subscriberCount() {
|
|
217
|
+
return this._subscribers.length;
|
|
218
|
+
}
|
|
219
|
+
_notifySubscribers(t, e) {
|
|
220
|
+
if (!(this.flags & (F.HAS_FN_SUBS | F.HAS_OBJ_SUBS))) return;
|
|
221
|
+
const s = this._subscribers, i = s.length;
|
|
222
|
+
for (let o = 0; o < i; o++) {
|
|
223
|
+
const r = s[o];
|
|
224
|
+
if (r)
|
|
225
|
+
try {
|
|
226
|
+
r.fn ? r.fn(t, e) : r.sub && r.sub.execute();
|
|
227
|
+
} catch (c) {
|
|
228
|
+
this._handleNotifyError(c);
|
|
229
|
+
}
|
|
377
230
|
}
|
|
378
231
|
}
|
|
232
|
+
_handleNotifyError(t) {
|
|
233
|
+
console.error(K(t, Z, S.ATOM_INDIVIDUAL_SUBSCRIBER_FAILED));
|
|
234
|
+
}
|
|
379
235
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
u && (u._tempUnsub = t[c]);
|
|
386
|
-
}
|
|
387
|
-
const o = n.length, r = W.acquire();
|
|
388
|
-
r.length = o;
|
|
389
|
-
for (let c = 0; c < o; c++) {
|
|
390
|
-
const u = n[c];
|
|
391
|
-
if (!u) continue;
|
|
392
|
-
const h = u._tempUnsub;
|
|
393
|
-
h ? (r[c] = h, u._tempUnsub = void 0) : (F.checkCircular(u, s), r[c] = u.subscribe(s));
|
|
394
|
-
}
|
|
395
|
-
if (i > 0)
|
|
396
|
-
for (let c = 0; c < i; c++) {
|
|
397
|
-
const u = e[c];
|
|
398
|
-
if (u) {
|
|
399
|
-
const h = u._tempUnsub;
|
|
400
|
-
h && (h(), u._tempUnsub = void 0);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
return t !== X && W.release(t), r;
|
|
404
|
-
}
|
|
405
|
-
let le = 0;
|
|
406
|
-
function qe() {
|
|
407
|
-
return le = le + 1 & K || 1, le;
|
|
408
|
-
}
|
|
409
|
-
function ut() {
|
|
410
|
-
return le;
|
|
411
|
-
}
|
|
412
|
-
let De = 0, Oe = 0, fe = !1;
|
|
413
|
-
function ke() {
|
|
414
|
-
return fe ? (Z && console.warn(
|
|
415
|
-
"Warning: startFlush() called during flush - ignored to prevent infinite loop detection bypass"
|
|
416
|
-
), !1) : (fe = !0, De = De + 1 & K || 1, Oe = 0, !0);
|
|
417
|
-
}
|
|
418
|
-
function Le() {
|
|
419
|
-
fe = !1;
|
|
420
|
-
}
|
|
421
|
-
function ht() {
|
|
422
|
-
return fe ? ++Oe : 0;
|
|
236
|
+
let rt = 0;
|
|
237
|
+
const Vt = () => (rt = rt + 1 & G || 1, rt), ie = () => rt;
|
|
238
|
+
let bt = 0, Ct = 0, ut = !1;
|
|
239
|
+
function Ut() {
|
|
240
|
+
return ut ? (m && console.warn("startFlush() called during flush - ignored"), !1) : (ut = !0, bt = bt + 1 & G || 1, Ct = 0, !0);
|
|
423
241
|
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
242
|
+
const Rt = () => {
|
|
243
|
+
ut = !1;
|
|
244
|
+
}, oe = () => ut ? ++Ct : 0, A = {
|
|
245
|
+
/** Queue buffer */
|
|
246
|
+
_queueBuffer: [[], []],
|
|
247
|
+
_bufferIndex: 0,
|
|
248
|
+
_size: 0,
|
|
249
|
+
/** Epoch counter */
|
|
250
|
+
_epoch: 0,
|
|
251
|
+
/** State flags */
|
|
252
|
+
_isProcessing: !1,
|
|
253
|
+
_isBatching: !1,
|
|
254
|
+
_isFlushingSync: !1,
|
|
255
|
+
/** Batching state */
|
|
256
|
+
_batchDepth: 0,
|
|
257
|
+
_batchQueue: [],
|
|
258
|
+
_batchQueueSize: 0,
|
|
259
|
+
/** Config */
|
|
260
|
+
_maxFlushIterations: $.MAX_FLUSH_ITERATIONS,
|
|
431
261
|
get phase() {
|
|
432
262
|
return this._isProcessing || this._isFlushingSync ? 2 : this._isBatching ? 1 : 0;
|
|
433
|
-
}
|
|
434
|
-
/** Current number of pending jobs. */
|
|
263
|
+
},
|
|
435
264
|
get queueSize() {
|
|
436
265
|
return this._size;
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* Returns whether the scheduler is currently batching updates.
|
|
440
|
-
*/
|
|
266
|
+
},
|
|
441
267
|
get isBatching() {
|
|
442
268
|
return this._isBatching;
|
|
443
|
-
}
|
|
269
|
+
},
|
|
444
270
|
/**
|
|
445
|
-
* Schedules
|
|
271
|
+
* Schedules job.
|
|
446
272
|
*/
|
|
447
|
-
schedule(
|
|
448
|
-
if (
|
|
449
|
-
throw new
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
273
|
+
schedule(n) {
|
|
274
|
+
if (m && typeof n != "function")
|
|
275
|
+
throw new it("Scheduler callback must be a function");
|
|
276
|
+
if (n._nextEpoch !== this._epoch) {
|
|
277
|
+
if (n._nextEpoch = this._epoch, this._isBatching || this._isFlushingSync) {
|
|
278
|
+
this._batchQueue[this._batchQueueSize++] = n;
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
this._queueBuffer[this._bufferIndex][this._size++] = n, this._isProcessing || this._flush();
|
|
455
282
|
}
|
|
456
|
-
|
|
457
|
-
this._queueBuffer[s][i] = e, this._size = i + 1, this._isProcessing || this.flush();
|
|
458
|
-
}
|
|
283
|
+
},
|
|
459
284
|
/**
|
|
460
|
-
*
|
|
461
|
-
* Coalesces multiple schedule calls into a single microtask execution.
|
|
285
|
+
* Triggers flush.
|
|
462
286
|
*/
|
|
463
|
-
|
|
464
|
-
this._isProcessing || this._size === 0 || (this._isProcessing = !0, queueMicrotask(
|
|
465
|
-
|
|
466
|
-
if (this._size === 0) return;
|
|
467
|
-
const e = ke();
|
|
468
|
-
this._drainQueue(), e && Le();
|
|
469
|
-
} finally {
|
|
470
|
-
this._isProcessing = !1, this._size > 0 && !this._isBatching && this.flush();
|
|
471
|
-
}
|
|
472
|
-
}));
|
|
473
|
-
}
|
|
287
|
+
_flush() {
|
|
288
|
+
this._isProcessing || this._size === 0 || (this._isProcessing = !0, queueMicrotask(this._runLoop));
|
|
289
|
+
},
|
|
474
290
|
/**
|
|
475
|
-
*
|
|
476
|
-
* Used at the end of a batch block or when immediate reflection is required.
|
|
291
|
+
* Scheduler loop.
|
|
477
292
|
*/
|
|
478
|
-
|
|
293
|
+
_runLoop: () => {
|
|
294
|
+
try {
|
|
295
|
+
if (A._size === 0) return;
|
|
296
|
+
const n = Ut();
|
|
297
|
+
A._drainQueue(), n && Rt();
|
|
298
|
+
} finally {
|
|
299
|
+
A._isProcessing = !1, A._size > 0 && !A._isBatching && A._flush();
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
_flushSync() {
|
|
479
303
|
this._isFlushingSync = !0;
|
|
480
|
-
const
|
|
304
|
+
const n = Ut();
|
|
481
305
|
try {
|
|
482
306
|
this._mergeBatchQueue(), this._drainQueue();
|
|
483
307
|
} finally {
|
|
484
|
-
this._isFlushingSync = !1,
|
|
308
|
+
this._isFlushingSync = !1, n && Rt();
|
|
485
309
|
}
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* Merges jobs from the batching queue into the primary queue.
|
|
489
|
-
* Increments the epoch to ensure deduplication.
|
|
490
|
-
*/
|
|
310
|
+
},
|
|
491
311
|
_mergeBatchQueue() {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
let
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
c._nextEpoch !== t && (c._nextEpoch = t, i[o++] = c);
|
|
312
|
+
if (this._batchQueueSize === 0) return;
|
|
313
|
+
const n = ++this._epoch, t = this._batchQueue, e = this._queueBuffer[this._bufferIndex];
|
|
314
|
+
let s = this._size;
|
|
315
|
+
for (let i = 0; i < this._batchQueueSize; i++) {
|
|
316
|
+
const o = t[i];
|
|
317
|
+
o._nextEpoch !== n && (o._nextEpoch = n, e[s++] = o);
|
|
499
318
|
}
|
|
500
|
-
this._size =
|
|
501
|
-
}
|
|
319
|
+
this._size = s, this._batchQueueSize = 0, t.length > $.BATCH_QUEUE_SHRINK_THRESHOLD && (t.length = 0);
|
|
320
|
+
},
|
|
502
321
|
_drainQueue() {
|
|
503
|
-
let
|
|
504
|
-
const t = this._maxFlushIterations;
|
|
322
|
+
let n = 0;
|
|
505
323
|
for (; this._size > 0; ) {
|
|
506
|
-
if (++
|
|
324
|
+
if (++n > this._maxFlushIterations) {
|
|
507
325
|
this._handleFlushOverflow();
|
|
508
326
|
return;
|
|
509
327
|
}
|
|
510
328
|
this._processQueue(), this._mergeBatchQueue();
|
|
511
329
|
}
|
|
512
|
-
}
|
|
330
|
+
},
|
|
513
331
|
_processQueue() {
|
|
514
|
-
const
|
|
515
|
-
this._bufferIndex =
|
|
516
|
-
|
|
332
|
+
const n = this._bufferIndex, t = this._queueBuffer[n], e = this._size;
|
|
333
|
+
this._bufferIndex = n ^ 1, this._size = 0, this._epoch++;
|
|
334
|
+
for (let s = 0; s < e; s++)
|
|
335
|
+
try {
|
|
336
|
+
t[s]();
|
|
337
|
+
} catch (i) {
|
|
338
|
+
console.error(new it("Error occurred during scheduler execution", i));
|
|
339
|
+
}
|
|
340
|
+
t.length = 0;
|
|
341
|
+
},
|
|
517
342
|
_handleFlushOverflow() {
|
|
518
343
|
console.error(
|
|
519
|
-
new
|
|
344
|
+
new it(
|
|
520
345
|
`Maximum flush iterations (${this._maxFlushIterations}) exceeded. Possible infinite loop.`
|
|
521
346
|
)
|
|
522
347
|
), this._size = 0, this._queueBuffer[this._bufferIndex].length = 0, this._batchQueueSize = 0;
|
|
523
|
-
}
|
|
524
|
-
_processJobs(e, t) {
|
|
525
|
-
for (let s = 0; s < t; s++)
|
|
526
|
-
try {
|
|
527
|
-
const i = e[s];
|
|
528
|
-
i && i();
|
|
529
|
-
} catch (i) {
|
|
530
|
-
console.error(
|
|
531
|
-
new ue("Error occurred during scheduler execution", i)
|
|
532
|
-
);
|
|
533
|
-
}
|
|
534
|
-
e.length = 0;
|
|
535
|
-
}
|
|
348
|
+
},
|
|
536
349
|
startBatch() {
|
|
537
350
|
this._batchDepth++, this._isBatching = !0;
|
|
538
|
-
}
|
|
351
|
+
},
|
|
539
352
|
endBatch() {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
Z && console.warn("endBatch() called without matching startBatch(). Ignoring.");
|
|
353
|
+
if (this._batchDepth === 0) {
|
|
354
|
+
m && console.warn("endBatch() called without matching startBatch(). Ignoring.");
|
|
543
355
|
return;
|
|
544
356
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
`Max flush iterations must be at least ${q.MIN_FLUSH_ITERATIONS}`
|
|
357
|
+
--this._batchDepth === 0 && (this._flushSync(), this._isBatching = !1);
|
|
358
|
+
},
|
|
359
|
+
setMaxFlushIterations(n) {
|
|
360
|
+
if (n < $.MIN_FLUSH_ITERATIONS)
|
|
361
|
+
throw new it(
|
|
362
|
+
`Max flush iterations must be at least ${$.MIN_FLUSH_ITERATIONS}`
|
|
552
363
|
);
|
|
553
|
-
this._maxFlushIterations =
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
const oe = new lt();
|
|
557
|
-
class at {
|
|
558
|
-
constructor() {
|
|
559
|
-
this.current = null;
|
|
364
|
+
this._maxFlushIterations = n;
|
|
560
365
|
}
|
|
366
|
+
}, Q = {
|
|
367
|
+
/** Active listener. */
|
|
368
|
+
current: null,
|
|
561
369
|
/**
|
|
562
|
-
*
|
|
563
|
-
* Restores the previous context after the function completes or throws.
|
|
370
|
+
* Executes in context.
|
|
564
371
|
*
|
|
565
|
-
* @param listener - The
|
|
566
|
-
* @param fn - The
|
|
372
|
+
* @param listener - The subscriber.
|
|
373
|
+
* @param fn - The logic to execute.
|
|
374
|
+
* @returns The result of `fn`.
|
|
567
375
|
*/
|
|
568
|
-
run(
|
|
569
|
-
const
|
|
570
|
-
this.current =
|
|
376
|
+
run(n, t) {
|
|
377
|
+
const e = this.current;
|
|
378
|
+
this.current = n;
|
|
571
379
|
try {
|
|
572
380
|
return t();
|
|
573
381
|
} finally {
|
|
574
|
-
this.current =
|
|
382
|
+
this.current = e;
|
|
575
383
|
}
|
|
576
384
|
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
const O = new at();
|
|
585
|
-
function Xe(n) {
|
|
586
|
-
if (typeof n != "function")
|
|
587
|
-
throw new Q("Untracked callback must be a function");
|
|
588
|
-
const e = O.current;
|
|
589
|
-
O.current = null;
|
|
385
|
+
};
|
|
386
|
+
function zt(n) {
|
|
387
|
+
const t = Q.current;
|
|
388
|
+
if (t === null) return n();
|
|
389
|
+
Q.current = null;
|
|
590
390
|
try {
|
|
591
391
|
return n();
|
|
592
392
|
} finally {
|
|
593
|
-
|
|
393
|
+
Q.current = t;
|
|
594
394
|
}
|
|
595
395
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
396
|
+
const re = R.HAS_FN_SUBS | R.HAS_OBJ_SUBS;
|
|
397
|
+
class ce extends Ht {
|
|
398
|
+
constructor(t, e) {
|
|
399
|
+
super(), this._pendingOldValue = void 0, this._notifyTask = void 0, this._subscribers = [], this._value = t, e && (this.flags |= R.SYNC), X.attachDebugInfo(this, "atom", this.id);
|
|
400
|
+
}
|
|
401
|
+
get value() {
|
|
402
|
+
const t = Q.current;
|
|
403
|
+
return t && $t(this, t, this._subscribers), this._value;
|
|
404
|
+
}
|
|
405
|
+
set value(t) {
|
|
406
|
+
const e = this._value;
|
|
407
|
+
if (Object.is(e, t)) return;
|
|
408
|
+
this._value = t, this.version = this.version + 1 & G;
|
|
409
|
+
const s = this.flags;
|
|
410
|
+
if (!((s & re) === 0 || s & R.NOTIFICATION_SCHEDULED)) {
|
|
411
|
+
if (this._pendingOldValue = e, this.flags = s | R.NOTIFICATION_SCHEDULED, s & R.SYNC && !A.isBatching) {
|
|
412
|
+
this._flushNotifications();
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
this._notifyTask || (this._notifyTask = () => this._flushNotifications()), A.schedule(this._notifyTask);
|
|
416
|
+
}
|
|
599
417
|
}
|
|
600
418
|
/**
|
|
601
|
-
*
|
|
419
|
+
* Triggers subscribers.
|
|
602
420
|
*/
|
|
603
|
-
|
|
604
|
-
const
|
|
605
|
-
|
|
421
|
+
_flushNotifications() {
|
|
422
|
+
const t = this.flags;
|
|
423
|
+
if (!(t & R.NOTIFICATION_SCHEDULED) || t & R.DISPOSED)
|
|
424
|
+
return;
|
|
425
|
+
const e = this._pendingOldValue;
|
|
426
|
+
this._pendingOldValue = void 0, this.flags &= -17, this._notifySubscribers(this._value, e);
|
|
427
|
+
}
|
|
428
|
+
peek() {
|
|
429
|
+
return this._value;
|
|
430
|
+
}
|
|
431
|
+
dispose() {
|
|
432
|
+
this.flags & R.DISPOSED || (this._subscribers.length = 0, this.flags |= R.DISPOSED, this._value = void 0, this._pendingOldValue = void 0, this._notifyTask = void 0);
|
|
606
433
|
}
|
|
434
|
+
}
|
|
435
|
+
function ue(n, t = {}) {
|
|
436
|
+
return new ce(n, t.sync ?? !1);
|
|
437
|
+
}
|
|
438
|
+
class le {
|
|
607
439
|
/**
|
|
608
|
-
*
|
|
440
|
+
* @param limit - Max unique arrays to hold (default: 50). Prevents the pool itself from consuming too much memory.
|
|
441
|
+
* @param capacity - Max length of an array to accept (default: 256).
|
|
609
442
|
*/
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
443
|
+
constructor(t = 50, e = 256) {
|
|
444
|
+
this.limit = t, this.capacity = e, this.pool = [], this.stats = m ? {
|
|
445
|
+
acquired: 0,
|
|
446
|
+
released: 0,
|
|
447
|
+
rejected: { frozen: 0, tooLarge: 0, poolFull: 0 }
|
|
448
|
+
} : null;
|
|
613
449
|
}
|
|
614
450
|
/**
|
|
615
|
-
*
|
|
451
|
+
* Acquires array.
|
|
616
452
|
*/
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
if (t & L.NOTIFICATION_SCHEDULED || (this._pendingOldValue = e, t |= L.NOTIFICATION_SCHEDULED, this.flags = t), t & L.SYNC && !oe.isBatching) {
|
|
620
|
-
this._flushNotifications();
|
|
621
|
-
return;
|
|
622
|
-
}
|
|
623
|
-
this._notifyTask || (this._notifyTask = () => this._flushNotifications());
|
|
624
|
-
const s = this._notifyTask;
|
|
625
|
-
oe.schedule(s);
|
|
453
|
+
acquire() {
|
|
454
|
+
return m && this.stats && this.stats.acquired++, this.pool.pop() ?? [];
|
|
626
455
|
}
|
|
627
456
|
/**
|
|
628
|
-
*
|
|
457
|
+
* Releases array.
|
|
458
|
+
*
|
|
459
|
+
* @param arr - Array to release.
|
|
460
|
+
* @param emptyConst - Optional empty constant.
|
|
629
461
|
*/
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
462
|
+
release(t, e) {
|
|
463
|
+
if (!(e && t === e)) {
|
|
464
|
+
if (t.length > this.capacity) {
|
|
465
|
+
m && this.stats && this.stats.rejected.tooLarge++;
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
if (this.pool.length >= this.limit) {
|
|
469
|
+
m && this.stats && this.stats.rejected.poolFull++;
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
if (Object.isFrozen(t)) {
|
|
473
|
+
m && this.stats && this.stats.rejected.frozen++;
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
t.length = 0, this.pool.push(t), m && this.stats && this.stats.released++;
|
|
477
|
+
}
|
|
636
478
|
}
|
|
637
479
|
/**
|
|
638
|
-
*
|
|
480
|
+
* Pool stats.
|
|
639
481
|
*/
|
|
640
|
-
|
|
641
|
-
|
|
482
|
+
getStats() {
|
|
483
|
+
if (!m || !this.stats) return null;
|
|
484
|
+
const { acquired: t, released: e, rejected: s } = this.stats, i = t - e - (s.frozen + s.tooLarge + s.poolFull);
|
|
485
|
+
return {
|
|
486
|
+
acquired: t,
|
|
487
|
+
released: e,
|
|
488
|
+
rejected: { ...s },
|
|
489
|
+
leaked: i,
|
|
490
|
+
poolSize: this.pool.length
|
|
491
|
+
};
|
|
642
492
|
}
|
|
643
493
|
/**
|
|
644
|
-
*
|
|
494
|
+
* Resets pool.
|
|
645
495
|
*/
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
496
|
+
reset() {
|
|
497
|
+
this.pool.length = 0, m && this.stats && (this.stats = {
|
|
498
|
+
acquired: 0,
|
|
499
|
+
released: 0,
|
|
500
|
+
rejected: { frozen: 0, tooLarge: 0, poolFull: 0 }
|
|
501
|
+
});
|
|
649
502
|
}
|
|
650
503
|
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
return n;
|
|
661
|
-
const s = n instanceof Error ? n.message : String(n), i = n instanceof Error ? n : null;
|
|
662
|
-
return new e(`Unexpected error (${t}): ${s}`, i);
|
|
663
|
-
}
|
|
664
|
-
function Te(n) {
|
|
504
|
+
const tt = (n) => Object.freeze(n);
|
|
505
|
+
tt([]);
|
|
506
|
+
tt([]);
|
|
507
|
+
tt([]);
|
|
508
|
+
tt([]);
|
|
509
|
+
const T = tt([]);
|
|
510
|
+
tt([]);
|
|
511
|
+
const j = new le();
|
|
512
|
+
function yt(n) {
|
|
665
513
|
return n !== null && typeof n == "object" && "value" in n && typeof n.subscribe == "function";
|
|
666
514
|
}
|
|
667
|
-
function
|
|
668
|
-
return
|
|
515
|
+
function wt(n) {
|
|
516
|
+
return yt(n) && typeof n.invalidate == "function";
|
|
669
517
|
}
|
|
670
|
-
function
|
|
671
|
-
return n
|
|
518
|
+
function qt(n) {
|
|
519
|
+
return n !== null && typeof n == "object" && typeof n.then == "function";
|
|
672
520
|
}
|
|
673
|
-
const
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
const
|
|
678
|
-
class
|
|
679
|
-
constructor(
|
|
680
|
-
if (typeof
|
|
681
|
-
|
|
682
|
-
if (super(), this._value = void 0, this.flags = f.DIRTY | f.IDLE, this._error = null, this._promiseId = 0, this._equal = t.equal ?? Object.is, this._fn = e, this._defaultValue = "defaultValue" in t ? t.defaultValue : Ie, this._onError = t.onError ?? null, this._fnSubs = [], this._objSubs = [], this._dependencies = v, this._dependencyVersions = R, this._unsubscribes = X, this._cachedErrors = null, this._errorCacheEpoch = -1, this._asyncStartAggregateVersion = 0, this._asyncRetryCount = 0, this._trackEpoch = -1, this._trackDeps = v, this._trackVersions = R, this._trackCount = 0, F.attachDebugInfo(this, "computed", this.id), F.enabled) {
|
|
683
|
-
const s = this;
|
|
684
|
-
s.subscriberCount = this.subscriberCount.bind(this), s.isDirty = () => (this.flags & f.DIRTY) !== 0, s.dependencies = this._dependencies;
|
|
685
|
-
}
|
|
686
|
-
if (t.lazy === !1)
|
|
521
|
+
const Xt = h.RESOLVED | h.PENDING | h.REJECTED, at = Array(Xt + 1).fill(ht.IDLE);
|
|
522
|
+
at[h.RESOLVED] = ht.RESOLVED;
|
|
523
|
+
at[h.PENDING] = ht.PENDING;
|
|
524
|
+
at[h.REJECTED] = ht.REJECTED;
|
|
525
|
+
const xt = 3, Lt = Number.MAX_SAFE_INTEGER - 1;
|
|
526
|
+
class Gt extends Ht {
|
|
527
|
+
constructor(t, e = {}) {
|
|
528
|
+
if (typeof t != "function") throw new B(S.COMPUTED_MUST_BE_FUNCTION);
|
|
529
|
+
if (super(), this._error = null, this._promiseId = 0, this._subscribers = [], this._links = T, this._cachedErrors = null, this._errorCacheEpoch = -1, this._asyncStartAggregateVersion = 0, this._asyncRetryCount = 0, this._trackEpoch = -1, this._trackLinks = T, this._trackCount = 0, this._value = void 0, this.flags = h.DIRTY | h.IDLE, this._equal = e.equal ?? Object.is, this._fn = t, this._defaultValue = "defaultValue" in e ? e.defaultValue : pt, this._onError = e.onError ?? null, X.attachDebugInfo(this, "computed", this.id), e.lazy === !1)
|
|
687
530
|
try {
|
|
688
531
|
this._recompute();
|
|
689
532
|
} catch {
|
|
690
533
|
}
|
|
691
534
|
}
|
|
535
|
+
_track() {
|
|
536
|
+
const t = Q.current;
|
|
537
|
+
t && $t(this, t, this._subscribers);
|
|
538
|
+
}
|
|
692
539
|
get value() {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
if ((t & (f.RESOLVED | f.DIRTY | f.IDLE)) === f.RESOLVED)
|
|
540
|
+
this._track();
|
|
541
|
+
const t = this.flags;
|
|
542
|
+
if ((t & (h.RESOLVED | h.DIRTY | h.IDLE)) === h.RESOLVED)
|
|
697
543
|
return this._value;
|
|
698
|
-
if (t &
|
|
699
|
-
throw new
|
|
700
|
-
if (t &
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
throw new $(C.COMPUTED_CIRCULAR_DEPENDENCY);
|
|
544
|
+
if (t & h.DISPOSED)
|
|
545
|
+
throw new B(S.COMPUTED_DISPOSED);
|
|
546
|
+
if (t & h.RECOMPUTING) {
|
|
547
|
+
if (this._defaultValue !== pt) return this._defaultValue;
|
|
548
|
+
throw new B(S.COMPUTED_CIRCULAR_DEPENDENCY);
|
|
704
549
|
}
|
|
705
|
-
if (t & (
|
|
550
|
+
if (t & (h.DIRTY | h.IDLE) && (this._recompute(), this.flags & h.RESOLVED))
|
|
706
551
|
return this._value;
|
|
707
|
-
const
|
|
708
|
-
if (
|
|
709
|
-
if (
|
|
710
|
-
throw new
|
|
552
|
+
const e = this._defaultValue, s = e !== pt;
|
|
553
|
+
if (this.flags & h.PENDING) {
|
|
554
|
+
if (s) return e;
|
|
555
|
+
throw new B(S.COMPUTED_ASYNC_PENDING_NO_DEFAULT);
|
|
711
556
|
}
|
|
712
|
-
if (
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
throw o;
|
|
557
|
+
if (this.flags & h.REJECTED) {
|
|
558
|
+
if (this._error?.recoverable && s) return e;
|
|
559
|
+
throw this._error;
|
|
716
560
|
}
|
|
717
561
|
return this._value;
|
|
718
562
|
}
|
|
@@ -720,454 +564,386 @@ class Je extends ze {
|
|
|
720
564
|
return this._value;
|
|
721
565
|
}
|
|
722
566
|
get state() {
|
|
723
|
-
|
|
724
|
-
return e && z(this, e, this._fnSubs, this._objSubs), pe[this.flags & Qe];
|
|
567
|
+
return this._track(), at[this.flags & Xt];
|
|
725
568
|
}
|
|
726
569
|
get hasError() {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
if (
|
|
570
|
+
if (this._track(), this.flags & (h.REJECTED | h.HAS_ERROR)) return !0;
|
|
571
|
+
const t = this._links;
|
|
572
|
+
for (let e = 0, s = t.length; e < s; e++) {
|
|
573
|
+
const i = t[e]?.node;
|
|
574
|
+
if (i && i.flags & h.HAS_ERROR) return !0;
|
|
575
|
+
}
|
|
732
576
|
return !1;
|
|
733
577
|
}
|
|
578
|
+
// ... (isValid, errors, lastError getters remain structurally similar, omitted for brevity if mostly unchanged) ...
|
|
734
579
|
get isValid() {
|
|
735
580
|
return !this.hasError;
|
|
736
581
|
}
|
|
737
582
|
get errors() {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
const s =
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
d && s.add(d);
|
|
583
|
+
if (this._track(), !this.hasError) return Kt;
|
|
584
|
+
const t = ie();
|
|
585
|
+
if (this._errorCacheEpoch === t && this._cachedErrors) return this._cachedErrors;
|
|
586
|
+
const e = /* @__PURE__ */ new Set();
|
|
587
|
+
this._error && e.add(this._error);
|
|
588
|
+
const s = this._links;
|
|
589
|
+
for (let o = 0, r = s.length; o < r; o++) {
|
|
590
|
+
const c = s[o].node;
|
|
591
|
+
if (c.flags & h.HAS_ERROR) {
|
|
592
|
+
const l = c;
|
|
593
|
+
if (l.errors) {
|
|
594
|
+
const a = l.errors;
|
|
595
|
+
for (let d = 0; d < a.length; d++) {
|
|
596
|
+
const N = a[d];
|
|
597
|
+
N && e.add(N);
|
|
754
598
|
}
|
|
599
|
+
}
|
|
755
600
|
}
|
|
756
601
|
}
|
|
757
|
-
const
|
|
758
|
-
return this._errorCacheEpoch = t, this._cachedErrors =
|
|
602
|
+
const i = Object.freeze(Array.from(e));
|
|
603
|
+
return this._errorCacheEpoch = t, this._cachedErrors = i, i;
|
|
759
604
|
}
|
|
760
605
|
get lastError() {
|
|
761
|
-
|
|
762
|
-
return e && z(this, e, this._fnSubs, this._objSubs), this._error;
|
|
606
|
+
return this._track(), this._error;
|
|
763
607
|
}
|
|
764
608
|
get isPending() {
|
|
765
|
-
|
|
766
|
-
return e && z(this, e, this._fnSubs, this._objSubs), (this.flags & f.PENDING) !== 0;
|
|
609
|
+
return this._track(), (this.flags & h.PENDING) !== 0;
|
|
767
610
|
}
|
|
768
611
|
get isResolved() {
|
|
769
|
-
|
|
770
|
-
return e && z(this, e, this._fnSubs, this._objSubs), (this.flags & f.RESOLVED) !== 0;
|
|
612
|
+
return this._track(), (this.flags & h.RESOLVED) !== 0;
|
|
771
613
|
}
|
|
772
614
|
invalidate() {
|
|
773
|
-
this._markDirty();
|
|
774
|
-
const e = this._dependencyVersions;
|
|
775
|
-
e !== R && (j.release(e), this._dependencyVersions = R), this._errorCacheEpoch = -1, this._cachedErrors = null;
|
|
615
|
+
this._markDirty(), this._errorCacheEpoch = -1, this._cachedErrors = null;
|
|
776
616
|
}
|
|
777
617
|
dispose() {
|
|
778
|
-
if (this.flags &
|
|
779
|
-
const
|
|
780
|
-
if (
|
|
781
|
-
for (let
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
618
|
+
if (this.flags & h.DISPOSED) return;
|
|
619
|
+
const t = this._links;
|
|
620
|
+
if (t !== T) {
|
|
621
|
+
for (let e = 0, s = t.length; e < s; e++)
|
|
622
|
+
t[e].unsub?.();
|
|
623
|
+
j.release(t), this._links = T;
|
|
624
|
+
}
|
|
625
|
+
this._subscribers.length = 0, this.flags = h.DISPOSED | h.DIRTY | h.IDLE, this._error = null, this._value = void 0, this._promiseId = (this._promiseId + 1) % Lt, this._cachedErrors = null, this._errorCacheEpoch = -1;
|
|
626
|
+
}
|
|
627
|
+
addDependency(t) {
|
|
628
|
+
if (t._lastSeenEpoch !== this._trackEpoch) {
|
|
629
|
+
if (t._lastSeenEpoch = this._trackEpoch, this._trackCount < this._trackLinks.length) {
|
|
630
|
+
const e = this._trackLinks[this._trackCount];
|
|
631
|
+
e.node = t, e.version = t.version;
|
|
632
|
+
} else
|
|
633
|
+
this._trackLinks.push(new mt(t, t.version));
|
|
634
|
+
this._trackCount++;
|
|
786
635
|
}
|
|
787
|
-
const t = this._dependencies;
|
|
788
|
-
t !== v && (G.release(t), this._dependencies = v);
|
|
789
|
-
const s = this._dependencyVersions;
|
|
790
|
-
s !== R && (j.release(s), this._dependencyVersions = R), this._fnSubs.length = 0, this._objSubs.length = 0, this.flags = f.DISPOSED | f.DIRTY | f.IDLE, this._error = null, this._value = void 0, this._promiseId = (this._promiseId + 1) % Me, this._cachedErrors = null, this._errorCacheEpoch = -1;
|
|
791
|
-
}
|
|
792
|
-
addDependency(e) {
|
|
793
|
-
if (e._lastSeenEpoch === this._trackEpoch) return;
|
|
794
|
-
e._lastSeenEpoch = this._trackEpoch;
|
|
795
|
-
const t = this._trackCount, s = this._trackDeps, i = this._trackVersions;
|
|
796
|
-
t < s.length ? (s[t] = e, i[t] = e.version) : (s.push(e), i.push(e.version)), this._trackCount = t + 1;
|
|
797
636
|
}
|
|
798
|
-
_commitDeps(
|
|
799
|
-
|
|
800
|
-
t.length = i, s.length = i, this._unsubscribes = ct(t, e, this._unsubscribes, this), this._dependencies = t, this._dependencyVersions = s;
|
|
637
|
+
_commitDeps(t) {
|
|
638
|
+
this._trackLinks.length = this._trackCount, se(this._trackLinks, t, this), this._links = this._trackLinks;
|
|
801
639
|
}
|
|
802
640
|
_recompute() {
|
|
803
|
-
if (this.flags &
|
|
804
|
-
this.flags |=
|
|
805
|
-
const
|
|
806
|
-
this._trackEpoch =
|
|
807
|
-
let
|
|
641
|
+
if (this.flags & h.RECOMPUTING) return;
|
|
642
|
+
this.flags |= h.RECOMPUTING;
|
|
643
|
+
const t = this._links;
|
|
644
|
+
this._trackEpoch = Vt(), this._trackLinks = j.acquire(), this._trackCount = 0;
|
|
645
|
+
let e = !1;
|
|
808
646
|
try {
|
|
809
|
-
const
|
|
810
|
-
this._commitDeps(
|
|
811
|
-
} catch (
|
|
812
|
-
|
|
813
|
-
if (!s)
|
|
647
|
+
const s = Q.run(this, this._fn);
|
|
648
|
+
this._commitDeps(t), e = !0, qt(s) ? this._handleAsyncComputation(s) : this._finalizeResolution(s);
|
|
649
|
+
} catch (s) {
|
|
650
|
+
if (!e)
|
|
814
651
|
try {
|
|
815
|
-
this._commitDeps(
|
|
816
|
-
} catch
|
|
817
|
-
o = r;
|
|
652
|
+
this._commitDeps(t), e = !0;
|
|
653
|
+
} catch {
|
|
818
654
|
}
|
|
819
|
-
this.
|
|
655
|
+
this._handleError(s, S.COMPUTED_COMPUTATION_FAILED, !0);
|
|
820
656
|
} finally {
|
|
821
|
-
|
|
657
|
+
e && t !== T ? j.release(t) : e || j.release(this._trackLinks), this._trackEpoch = -1, this._trackLinks = T, this._trackCount = 0, this.flags &= -257;
|
|
822
658
|
}
|
|
823
659
|
}
|
|
824
|
-
_handleAsyncComputation(
|
|
825
|
-
this.flags = (this.flags |
|
|
826
|
-
const
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
if (
|
|
830
|
-
if (this.
|
|
831
|
-
this._asyncRetryCount
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
);
|
|
837
|
-
return;
|
|
660
|
+
_handleAsyncComputation(t) {
|
|
661
|
+
this.flags = (this.flags | h.PENDING) & -217, this._notifySubscribers(void 0, void 0), this._asyncStartAggregateVersion = this._captureVersionSnapshot(), this._asyncRetryCount = 0, this._promiseId = (this._promiseId + 1) % Lt;
|
|
662
|
+
const e = this._promiseId;
|
|
663
|
+
t.then(
|
|
664
|
+
(s) => {
|
|
665
|
+
if (e === this._promiseId) {
|
|
666
|
+
if (this._captureVersionSnapshot() !== this._asyncStartAggregateVersion)
|
|
667
|
+
return this._asyncRetryCount++ < xt ? this._markDirty() : this._handleError(
|
|
668
|
+
new B(`Async drift threshold exceeded after ${xt} retries.`),
|
|
669
|
+
S.COMPUTED_ASYNC_COMPUTATION_FAILED
|
|
670
|
+
);
|
|
671
|
+
this._finalizeResolution(s), this._notifySubscribers(s, void 0);
|
|
838
672
|
}
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
t === this._promiseId && this._handleAsyncRejection(s);
|
|
843
|
-
});
|
|
673
|
+
},
|
|
674
|
+
(s) => e === this._promiseId && this._handleError(s, S.COMPUTED_ASYNC_COMPUTATION_FAILED)
|
|
675
|
+
);
|
|
844
676
|
}
|
|
845
677
|
_captureVersionSnapshot() {
|
|
846
|
-
let
|
|
847
|
-
const
|
|
848
|
-
for (let s = 0, i =
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
return e;
|
|
856
|
-
}
|
|
857
|
-
_handleAsyncRejection(e) {
|
|
858
|
-
const t = se(e, $, C.COMPUTED_ASYNC_COMPUTATION_FAILED);
|
|
859
|
-
this.flags & f.REJECTED || (this.version = this.version + 1 & K), this._error = t, this.flags = this.flags & -121 | (f.REJECTED | f.HAS_ERROR);
|
|
860
|
-
const s = this._onError;
|
|
861
|
-
if (s)
|
|
678
|
+
let t = 0;
|
|
679
|
+
const e = this._links;
|
|
680
|
+
for (let s = 0, i = e.length; s < i; s++)
|
|
681
|
+
t = ((t << 5) - t | 0) + e[s].node.version & G;
|
|
682
|
+
return t;
|
|
683
|
+
}
|
|
684
|
+
_handleError(t, e, s = !1) {
|
|
685
|
+
const i = K(t, B, e);
|
|
686
|
+
if (!s && !(this.flags & h.REJECTED) && (this.version = this.version + 1 & G), this._error = i, this.flags = this.flags & -121 | (h.REJECTED | h.HAS_ERROR), this._onError)
|
|
862
687
|
try {
|
|
863
|
-
|
|
864
|
-
} catch (
|
|
865
|
-
console.error(
|
|
688
|
+
this._onError(i);
|
|
689
|
+
} catch (o) {
|
|
690
|
+
console.error(S.CALLBACK_ERROR_IN_ERROR_HANDLER, o);
|
|
866
691
|
}
|
|
692
|
+
if (s) throw i;
|
|
867
693
|
this._notifySubscribers(void 0, void 0);
|
|
868
694
|
}
|
|
869
|
-
_finalizeResolution(
|
|
870
|
-
(!(this.flags &
|
|
871
|
-
}
|
|
872
|
-
_handleComputationError(e) {
|
|
873
|
-
const t = se(e, $, C.COMPUTED_COMPUTATION_FAILED);
|
|
874
|
-
this._error = t, this.flags = this.flags & -121 | (f.REJECTED | f.HAS_ERROR);
|
|
875
|
-
const s = this._onError;
|
|
876
|
-
if (s)
|
|
877
|
-
try {
|
|
878
|
-
s(t);
|
|
879
|
-
} catch (i) {
|
|
880
|
-
console.error(C.CALLBACK_ERROR_IN_ERROR_HANDLER, i);
|
|
881
|
-
}
|
|
882
|
-
throw t;
|
|
695
|
+
_finalizeResolution(t) {
|
|
696
|
+
(!(this.flags & h.RESOLVED) || !this._equal(this._value, t)) && (this.version = this.version + 1 & G), this._value = t, this._error = null, this.flags = (this.flags | h.RESOLVED) & -697, this._cachedErrors = null, this._errorCacheEpoch = -1;
|
|
883
697
|
}
|
|
884
698
|
execute() {
|
|
885
699
|
this._markDirty();
|
|
886
700
|
}
|
|
887
701
|
/** @internal */
|
|
888
702
|
_markDirty() {
|
|
889
|
-
|
|
890
|
-
e & (f.RECOMPUTING | f.DIRTY) || (this.flags = e | f.DIRTY, this._notifySubscribers(void 0, void 0));
|
|
703
|
+
this.flags & (h.RECOMPUTING | h.DIRTY) || (this.flags |= h.DIRTY, this._notifySubscribers(void 0, void 0));
|
|
891
704
|
}
|
|
892
705
|
}
|
|
893
|
-
Object.freeze(
|
|
894
|
-
function
|
|
895
|
-
return new
|
|
706
|
+
Object.freeze(Gt.prototype);
|
|
707
|
+
function he(n, t = {}) {
|
|
708
|
+
return new Gt(n, t);
|
|
896
709
|
}
|
|
897
|
-
class
|
|
898
|
-
constructor(
|
|
899
|
-
super(), this._cleanup = null, this.
|
|
900
|
-
const s = Number.isFinite(this._maxExecutions), i = s ? Math.min(this._maxExecutions + 1,
|
|
901
|
-
this._historyCapacity = i, this._history =
|
|
710
|
+
class ae extends jt {
|
|
711
|
+
constructor(t, e = {}) {
|
|
712
|
+
super(), this._cleanup = null, this._links = T, this._nextLinks = null, this._currentEpoch = -1, this._lastFlushEpoch = -1, this._executionsInEpoch = 0, this._executionCount = 0, this._historyPtr = 0, this._execId = 0, this._fn = t, this._onError = e.onError ?? null, this._sync = e.sync ?? !1, this._maxExecutions = e.maxExecutionsPerSecond ?? $.MAX_EXECUTIONS_PER_SECOND, this._maxExecutionsPerFlush = e.maxExecutionsPerFlush ?? $.MAX_EXECUTIONS_PER_EFFECT, this._trackModifications = e.trackModifications ?? !1;
|
|
713
|
+
const s = Number.isFinite(this._maxExecutions), i = s ? Math.min(this._maxExecutions + 1, $.MAX_EXECUTIONS_PER_SECOND + 1) : 0;
|
|
714
|
+
this._historyCapacity = i, this._history = m && s && i > 0 ? new Array(i).fill(0) : null, X.attachDebugInfo(this, "effect", this.id);
|
|
902
715
|
}
|
|
903
716
|
run() {
|
|
904
|
-
if (this.flags &
|
|
905
|
-
throw new
|
|
717
|
+
if (this.flags & k.DISPOSED)
|
|
718
|
+
throw new q(S.EFFECT_DISPOSED);
|
|
906
719
|
this.execute(!0);
|
|
907
720
|
}
|
|
908
721
|
dispose() {
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
this._cleanup = null;
|
|
918
|
-
}
|
|
919
|
-
const t = this._unsubscribes;
|
|
920
|
-
if (t !== X) {
|
|
921
|
-
for (let o = 0, r = t.length; o < r; o++) {
|
|
922
|
-
const c = t[o];
|
|
923
|
-
c && c();
|
|
924
|
-
}
|
|
925
|
-
W.release(t), this._unsubscribes = X;
|
|
926
|
-
}
|
|
927
|
-
const s = this._dependencies;
|
|
928
|
-
s !== v && (G.release(s), this._dependencies = v);
|
|
929
|
-
const i = this._dependencyVersions;
|
|
930
|
-
i !== R && (j.release(i), this._dependencyVersions = R), this._executeTask = void 0;
|
|
931
|
-
}
|
|
932
|
-
addDependency(e) {
|
|
933
|
-
if (!(this.flags & U.EXECUTING)) return;
|
|
934
|
-
const t = this._currentEpoch;
|
|
935
|
-
if (e._lastSeenEpoch === t) return;
|
|
936
|
-
e._lastSeenEpoch = t;
|
|
937
|
-
const s = this._nextDeps, i = this._nextVersions, o = this._nextUnsubs;
|
|
938
|
-
s.push(e), i.push(e.version);
|
|
939
|
-
const r = e._tempUnsub;
|
|
940
|
-
if (r) {
|
|
941
|
-
o.push(r), e._tempUnsub = void 0;
|
|
722
|
+
this.flags & k.DISPOSED || (this.flags |= k.DISPOSED, this._execCleanup(), this._releaseLinks(this._links), this._links = T, this._executeTask = void 0);
|
|
723
|
+
}
|
|
724
|
+
addDependency(t) {
|
|
725
|
+
if (!(this.flags & k.EXECUTING) || t._lastSeenEpoch === this._currentEpoch) return;
|
|
726
|
+
t._lastSeenEpoch = this._currentEpoch;
|
|
727
|
+
const e = this._nextLinks;
|
|
728
|
+
if (t._tempUnsub) {
|
|
729
|
+
e.push(new mt(t, t.version, t._tempUnsub)), t._tempUnsub = void 0;
|
|
942
730
|
return;
|
|
943
731
|
}
|
|
944
732
|
try {
|
|
945
|
-
const
|
|
946
|
-
if (
|
|
947
|
-
|
|
948
|
-
return;
|
|
949
|
-
}
|
|
950
|
-
this._executeTask || (this._executeTask = () => this.execute());
|
|
951
|
-
const p = this._executeTask;
|
|
952
|
-
oe.schedule(p);
|
|
953
|
-
});
|
|
954
|
-
o.push(h);
|
|
955
|
-
} catch (c) {
|
|
956
|
-
console.error(se(c, Y, C.EFFECT_EXECUTION_FAILED)), o.push(() => {
|
|
733
|
+
const s = t.subscribe(() => {
|
|
734
|
+
if (this._trackModifications && this.flags & k.EXECUTING && (t._modifiedAtEpoch = this._currentEpoch), this._sync) return this.execute();
|
|
735
|
+
this._executeTask || (this._executeTask = () => this.execute()), A.schedule(this._executeTask);
|
|
957
736
|
});
|
|
737
|
+
e.push(new mt(t, t.version, s));
|
|
738
|
+
} catch (s) {
|
|
739
|
+
console.error(K(s, q, S.EFFECT_EXECUTION_FAILED));
|
|
958
740
|
}
|
|
959
741
|
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
742
|
+
/**
|
|
743
|
+
* Executes effect with tracking.
|
|
744
|
+
*/
|
|
745
|
+
execute(t = !1) {
|
|
746
|
+
if (this.flags & (k.DISPOSED | k.EXECUTING) || !t && this._links.length > 0 && !this._isDirty()) return;
|
|
747
|
+
this._checkInfiniteLoops(), this.flags |= k.EXECUTING, this._execCleanup();
|
|
748
|
+
const e = this._links;
|
|
749
|
+
if (e !== T)
|
|
750
|
+
for (let o = 0, r = e.length; o < r; o++) {
|
|
751
|
+
const c = e[o];
|
|
752
|
+
c && (c.node._tempUnsub = c.unsub);
|
|
753
|
+
}
|
|
754
|
+
const s = j.acquire();
|
|
755
|
+
this._nextLinks = s, this._currentEpoch = Vt();
|
|
756
|
+
let i = !1;
|
|
757
|
+
try {
|
|
758
|
+
const o = Q.run(this, this._fn);
|
|
759
|
+
this._links = s, i = !0, this._checkLoopWarnings(), qt(o) ? this._handleAsyncResult(o) : this._cleanup = typeof o == "function" ? o : null;
|
|
760
|
+
} catch (o) {
|
|
761
|
+
i = !0, this._handleExecutionError(o), this._cleanup = null;
|
|
762
|
+
} finally {
|
|
763
|
+
this._finalizeDependencies(i, e, s), this.flags &= -9;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
_handleAsyncResult(t) {
|
|
767
|
+
const e = ++this._execId;
|
|
768
|
+
t.then(
|
|
769
|
+
(s) => {
|
|
770
|
+
if (e !== this._execId || this.flags & k.DISPOSED) {
|
|
771
|
+
if (typeof s == "function")
|
|
974
772
|
try {
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
}
|
|
979
|
-
} catch {
|
|
980
|
-
S = !0;
|
|
981
|
-
break;
|
|
773
|
+
s();
|
|
774
|
+
} catch (i) {
|
|
775
|
+
this._handleExecutionError(i, S.EFFECT_CLEANUP_FAILED);
|
|
982
776
|
}
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
typeof s == "function" && (this._cleanup = s);
|
|
780
|
+
},
|
|
781
|
+
(s) => e === this._execId && this._handleExecutionError(s)
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
_finalizeDependencies(t, e, s) {
|
|
785
|
+
if (this._nextLinks = null, t) {
|
|
786
|
+
if (e !== T) {
|
|
787
|
+
for (let i = 0, o = e.length; i < o; i++) {
|
|
788
|
+
const r = e[i], c = r?.node._tempUnsub;
|
|
789
|
+
c && (c(), r && (r.node._tempUnsub = void 0));
|
|
983
790
|
}
|
|
984
|
-
|
|
791
|
+
j.release(e);
|
|
985
792
|
}
|
|
793
|
+
} else if (this._releaseLinks(s), j.release(s), e !== T)
|
|
794
|
+
for (let i = 0, o = e.length; i < o; i++)
|
|
795
|
+
e[i] && (e[i].node._tempUnsub = void 0);
|
|
796
|
+
}
|
|
797
|
+
_releaseLinks(t) {
|
|
798
|
+
if (t !== T) {
|
|
799
|
+
for (let e = 0, s = t.length; e < s; e++)
|
|
800
|
+
t[e]?.unsub?.();
|
|
801
|
+
j.release(t);
|
|
986
802
|
}
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
const
|
|
990
|
-
|
|
991
|
-
const
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
);
|
|
1000
|
-
if (this.dispose(), this._handleExecutionError(T), Z) throw T;
|
|
1001
|
-
return;
|
|
803
|
+
}
|
|
804
|
+
_isDirty() {
|
|
805
|
+
const t = this._links;
|
|
806
|
+
for (let e = 0, s = t.length; e < s; e++) {
|
|
807
|
+
const i = t[e], o = i.node;
|
|
808
|
+
if (o.version !== i.version) return !0;
|
|
809
|
+
if ("value" in o) {
|
|
810
|
+
try {
|
|
811
|
+
zt(() => o.value);
|
|
812
|
+
} catch {
|
|
813
|
+
return !0;
|
|
814
|
+
}
|
|
815
|
+
if (o.version !== i.version) return !0;
|
|
1002
816
|
}
|
|
1003
817
|
}
|
|
1004
|
-
|
|
818
|
+
return !1;
|
|
819
|
+
}
|
|
820
|
+
_execCleanup() {
|
|
821
|
+
if (this._cleanup) {
|
|
1005
822
|
try {
|
|
1006
823
|
this._cleanup();
|
|
1007
|
-
} catch (
|
|
1008
|
-
this._handleExecutionError(
|
|
824
|
+
} catch (t) {
|
|
825
|
+
this._handleExecutionError(t, S.EFFECT_CLEANUP_FAILED);
|
|
1009
826
|
}
|
|
1010
827
|
this._cleanup = null;
|
|
1011
828
|
}
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
const _ = ++this._execId;
|
|
1025
|
-
Ge(a) ? a.then((d) => {
|
|
1026
|
-
if (_ !== this._execId || this.flags & U.DISPOSED) {
|
|
1027
|
-
if (typeof d == "function")
|
|
1028
|
-
try {
|
|
1029
|
-
d();
|
|
1030
|
-
} catch (S) {
|
|
1031
|
-
this._handleExecutionError(S, C.EFFECT_CLEANUP_FAILED);
|
|
1032
|
-
}
|
|
1033
|
-
return;
|
|
1034
|
-
}
|
|
1035
|
-
typeof d == "function" && (this._cleanup = d);
|
|
1036
|
-
}).catch((d) => {
|
|
1037
|
-
_ === this._execId && this._handleExecutionError(d);
|
|
1038
|
-
}) : this._cleanup = typeof a == "function" ? a : null;
|
|
1039
|
-
} catch (a) {
|
|
1040
|
-
p = !0, this._handleExecutionError(a), this._cleanup = null;
|
|
1041
|
-
} finally {
|
|
1042
|
-
if (this._nextDeps = null, this._nextVersions = null, this._nextUnsubs = null, p) {
|
|
1043
|
-
if (i !== v) {
|
|
1044
|
-
for (let a = 0, _ = i.length; a < _; a++) {
|
|
1045
|
-
const d = i[a], S = d ? d._tempUnsub : void 0;
|
|
1046
|
-
S && (S(), d && (d._tempUnsub = void 0));
|
|
1047
|
-
}
|
|
1048
|
-
G.release(i);
|
|
1049
|
-
}
|
|
1050
|
-
o !== R && j.release(o), r !== X && W.release(r);
|
|
1051
|
-
} else {
|
|
1052
|
-
G.release(c), j.release(u);
|
|
1053
|
-
for (let a = 0, _ = h.length; a < _; a++) {
|
|
1054
|
-
const d = h[a];
|
|
1055
|
-
d && d();
|
|
1056
|
-
}
|
|
1057
|
-
if (W.release(h), i !== v)
|
|
1058
|
-
for (let a = 0, _ = i.length; a < _; a++) {
|
|
1059
|
-
const d = i[a];
|
|
1060
|
-
d && (d._tempUnsub = void 0);
|
|
1061
|
-
}
|
|
829
|
+
}
|
|
830
|
+
_checkInfiniteLoops() {
|
|
831
|
+
const t = bt;
|
|
832
|
+
if (this._lastFlushEpoch !== t && (this._lastFlushEpoch = t, this._executionsInEpoch = 0), ++this._executionsInEpoch > this._maxExecutionsPerFlush && this._throwInfiniteLoopError("per-effect"), oe() > $.MAX_EXECUTIONS_PER_FLUSH && this._throwInfiniteLoopError("global"), this._executionCount++, this._history) {
|
|
833
|
+
const e = Date.now();
|
|
834
|
+
this._history[this._historyPtr] = e, this._historyPtr = (this._historyPtr + 1) % this._historyCapacity;
|
|
835
|
+
const s = this._history[this._historyPtr] || 0;
|
|
836
|
+
if (s > 0 && e - s < Wt.ONE_SECOND_MS) {
|
|
837
|
+
const i = new q(
|
|
838
|
+
"Effect executed too frequently within 1 second. Suspected infinite loop."
|
|
839
|
+
);
|
|
840
|
+
if (this.dispose(), this._handleExecutionError(i), m) throw i;
|
|
1062
841
|
}
|
|
1063
|
-
this.flags &= -9;
|
|
1064
842
|
}
|
|
1065
843
|
}
|
|
1066
844
|
get isDisposed() {
|
|
1067
|
-
return (this.flags &
|
|
845
|
+
return (this.flags & k.DISPOSED) !== 0;
|
|
1068
846
|
}
|
|
1069
847
|
get executionCount() {
|
|
1070
848
|
return this._executionCount;
|
|
1071
849
|
}
|
|
1072
850
|
get isExecuting() {
|
|
1073
|
-
return (this.flags &
|
|
851
|
+
return (this.flags & k.EXECUTING) !== 0;
|
|
1074
852
|
}
|
|
1075
|
-
_throwInfiniteLoopError(
|
|
1076
|
-
const
|
|
1077
|
-
`Infinite loop detected (${
|
|
853
|
+
_throwInfiniteLoopError(t) {
|
|
854
|
+
const e = new q(
|
|
855
|
+
`Infinite loop detected (${t}): effect executed ${this._executionsInEpoch} times in current flush. Total executions in flush: ${Ct}`
|
|
1078
856
|
);
|
|
1079
|
-
throw this.dispose(), console.error(
|
|
857
|
+
throw this.dispose(), console.error(e), e;
|
|
1080
858
|
}
|
|
1081
|
-
_handleExecutionError(
|
|
1082
|
-
const s =
|
|
1083
|
-
console.error(s)
|
|
1084
|
-
const i = this._onError;
|
|
1085
|
-
if (i)
|
|
859
|
+
_handleExecutionError(t, e = S.EFFECT_EXECUTION_FAILED) {
|
|
860
|
+
const s = K(t, q, e);
|
|
861
|
+
if (console.error(s), this._onError)
|
|
1086
862
|
try {
|
|
1087
|
-
|
|
1088
|
-
} catch (
|
|
1089
|
-
console.error(
|
|
863
|
+
this._onError(s);
|
|
864
|
+
} catch (i) {
|
|
865
|
+
console.error(K(i, q, S.CALLBACK_ERROR_IN_ERROR_HANDLER));
|
|
1090
866
|
}
|
|
1091
867
|
}
|
|
1092
868
|
_checkLoopWarnings() {
|
|
1093
|
-
if (this._trackModifications &&
|
|
1094
|
-
const
|
|
869
|
+
if (this._trackModifications && X.enabled) {
|
|
870
|
+
const t = this._currentEpoch, e = this._links;
|
|
1095
871
|
for (let s = 0, i = e.length; s < i; s++) {
|
|
1096
|
-
const o = e[s];
|
|
1097
|
-
o
|
|
872
|
+
const o = e[s].node;
|
|
873
|
+
o._modifiedAtEpoch === t && X.warn(
|
|
1098
874
|
!0,
|
|
1099
|
-
`Effect is reading a dependency (${
|
|
875
|
+
`Effect is reading a dependency (${X.getDebugName(o) || "unknown"}) that it just modified. Infinite loop may occur`
|
|
1100
876
|
);
|
|
1101
877
|
}
|
|
1102
878
|
}
|
|
1103
879
|
}
|
|
1104
880
|
}
|
|
1105
|
-
function
|
|
881
|
+
function Y(n, t = {}) {
|
|
1106
882
|
if (typeof n != "function")
|
|
1107
|
-
throw new
|
|
1108
|
-
const
|
|
1109
|
-
return
|
|
883
|
+
throw new q(S.EFFECT_MUST_BE_FUNCTION);
|
|
884
|
+
const e = new ae(n, t);
|
|
885
|
+
return e.execute(), e;
|
|
1110
886
|
}
|
|
1111
|
-
function
|
|
887
|
+
function It(n) {
|
|
1112
888
|
if (typeof n != "function")
|
|
1113
|
-
throw new
|
|
1114
|
-
|
|
889
|
+
throw new TypeError("Batch callback must be a function");
|
|
890
|
+
A.startBatch();
|
|
1115
891
|
try {
|
|
1116
892
|
return n();
|
|
1117
893
|
} finally {
|
|
1118
|
-
|
|
894
|
+
A.endBatch();
|
|
1119
895
|
}
|
|
1120
896
|
}
|
|
1121
|
-
function
|
|
897
|
+
function fe(n) {
|
|
1122
898
|
return n !== null && typeof n == "object" && "value" in n && "subscribe" in n;
|
|
1123
899
|
}
|
|
1124
|
-
function
|
|
900
|
+
function ft(n) {
|
|
1125
901
|
if (!n) return "unknown";
|
|
1126
|
-
const
|
|
1127
|
-
if (!
|
|
1128
|
-
const
|
|
1129
|
-
if (
|
|
1130
|
-
const s =
|
|
902
|
+
const t = "jquery" in n ? n[0] : n;
|
|
903
|
+
if (!t) return "unknown";
|
|
904
|
+
const e = t.id;
|
|
905
|
+
if (e && typeof e == "string") return `#${e}`;
|
|
906
|
+
const s = t.tagName.toLowerCase(), i = t.classList;
|
|
1131
907
|
if (i && i.length > 0) {
|
|
1132
908
|
let o = s;
|
|
1133
909
|
for (let r = 0, c = i.length; r < c; r++) {
|
|
1134
|
-
const
|
|
1135
|
-
|
|
910
|
+
const l = i[r];
|
|
911
|
+
l && (o += `.${l}`);
|
|
1136
912
|
}
|
|
1137
913
|
return o;
|
|
1138
914
|
}
|
|
1139
915
|
return s;
|
|
1140
916
|
}
|
|
1141
|
-
function
|
|
1142
|
-
const
|
|
1143
|
-
if (
|
|
1144
|
-
const
|
|
917
|
+
function _e(n) {
|
|
918
|
+
const t = n.length;
|
|
919
|
+
if (t === 0) return new Int32Array(0);
|
|
920
|
+
const e = new Int32Array(t), s = new Int32Array(t);
|
|
1145
921
|
let i = 0;
|
|
1146
|
-
for (let r = 0; r <
|
|
922
|
+
for (let r = 0; r < t; r++) {
|
|
1147
923
|
const c = n[r];
|
|
1148
924
|
if (c === void 0 || c === -1) continue;
|
|
1149
|
-
const
|
|
1150
|
-
if (i === 0 ||
|
|
1151
|
-
|
|
925
|
+
const l = i > 0 ? s[i - 1] : void 0;
|
|
926
|
+
if (i === 0 || l !== void 0 && (n[l] ?? -1) < c) {
|
|
927
|
+
e[r] = l ?? -1, s[i++] = r;
|
|
1152
928
|
continue;
|
|
1153
929
|
}
|
|
1154
|
-
let
|
|
1155
|
-
for (;
|
|
1156
|
-
const
|
|
1157
|
-
|
|
930
|
+
let a = 0, d = i - 1;
|
|
931
|
+
for (; a < d; ) {
|
|
932
|
+
const C = a + d >>> 1, v = s[C];
|
|
933
|
+
v !== void 0 && (n[v] ?? -1) < c ? a = C + 1 : d = C;
|
|
1158
934
|
}
|
|
1159
|
-
const
|
|
1160
|
-
|
|
935
|
+
const N = s[a];
|
|
936
|
+
N !== void 0 && c < (n[N] ?? Number.MAX_SAFE_INTEGER) && (a > 0 && (e[r] = s[a - 1] ?? -1), s[a] = r);
|
|
1161
937
|
}
|
|
1162
938
|
const o = new Int32Array(i);
|
|
1163
939
|
if (i > 0) {
|
|
1164
940
|
let r = s[i - 1];
|
|
1165
941
|
for (let c = i - 1; c >= 0 && r !== void 0 && r !== -1; c--)
|
|
1166
|
-
o[c] = r, r =
|
|
942
|
+
o[c] = r, r = e[r];
|
|
1167
943
|
}
|
|
1168
944
|
return o;
|
|
1169
945
|
}
|
|
1170
|
-
function
|
|
946
|
+
function de() {
|
|
1171
947
|
if (typeof window < "u") {
|
|
1172
948
|
const n = window.__ATOM_DEBUG__;
|
|
1173
949
|
if (typeof n == "boolean") return n;
|
|
@@ -1178,401 +954,401 @@ function mt() {
|
|
|
1178
954
|
}
|
|
1179
955
|
return !1;
|
|
1180
956
|
}
|
|
1181
|
-
let
|
|
1182
|
-
const
|
|
957
|
+
let z = de();
|
|
958
|
+
const _ = {
|
|
1183
959
|
get enabled() {
|
|
1184
|
-
return
|
|
960
|
+
return z;
|
|
1185
961
|
},
|
|
1186
962
|
set enabled(n) {
|
|
1187
|
-
|
|
963
|
+
z = n;
|
|
1188
964
|
},
|
|
1189
|
-
log(n, ...
|
|
1190
|
-
|
|
965
|
+
log(n, ...t) {
|
|
966
|
+
z && console.log(`[atom-effect-jquery] ${n}:`, ...t);
|
|
1191
967
|
},
|
|
1192
|
-
atomChanged(n,
|
|
1193
|
-
|
|
968
|
+
atomChanged(n, t, e) {
|
|
969
|
+
z && console.log(
|
|
1194
970
|
`[atom-effect-jquery] Atom "${n ?? "anonymous"}" changed:`,
|
|
1195
|
-
|
|
971
|
+
t,
|
|
1196
972
|
"→",
|
|
1197
|
-
|
|
973
|
+
e
|
|
1198
974
|
);
|
|
1199
975
|
},
|
|
1200
976
|
/**
|
|
1201
977
|
* Logs DOM updates and triggers visual highlight.
|
|
1202
978
|
*/
|
|
1203
|
-
domUpdated(n,
|
|
1204
|
-
|
|
979
|
+
domUpdated(n, t, e) {
|
|
980
|
+
z && (console.log(`[atom-effect-jquery] DOM updated: ${ft(n)}.${t} =`, e), Ee(n));
|
|
1205
981
|
},
|
|
1206
982
|
cleanup(n) {
|
|
1207
|
-
|
|
983
|
+
z && console.log(`[atom-effect-jquery] Cleanup: ${n}`);
|
|
1208
984
|
},
|
|
1209
985
|
warn(...n) {
|
|
1210
|
-
|
|
1211
|
-
}
|
|
1212
|
-
},
|
|
1213
|
-
function
|
|
1214
|
-
const
|
|
1215
|
-
if (!
|
|
1216
|
-
let
|
|
1217
|
-
if (
|
|
1218
|
-
const i =
|
|
1219
|
-
|
|
986
|
+
z && console.warn("[atom-effect-jquery]", ...n);
|
|
987
|
+
}
|
|
988
|
+
}, gt = /* @__PURE__ */ new WeakMap();
|
|
989
|
+
function Ee(n) {
|
|
990
|
+
const t = "jquery" in n ? n[0] : n;
|
|
991
|
+
if (!t || !t.isConnected) return;
|
|
992
|
+
let e = gt.get(t);
|
|
993
|
+
if (e || (e = {}, gt.set(t, e)), e.timer && clearTimeout(e.timer), e.cleanupTimer && clearTimeout(e.cleanupTimer), !e.orgStyle) {
|
|
994
|
+
const i = t.style;
|
|
995
|
+
e.orgStyle = {
|
|
1220
996
|
outline: i.outline,
|
|
1221
997
|
outlineOffset: i.outlineOffset,
|
|
1222
998
|
transition: i.transition
|
|
1223
999
|
};
|
|
1224
1000
|
}
|
|
1225
|
-
const s =
|
|
1226
|
-
s.outline = "2px solid rgba(255, 68, 68, 0.8)", s.outlineOffset = "1px", s.transition = "none",
|
|
1227
|
-
|
|
1228
|
-
if (!
|
|
1229
|
-
const i =
|
|
1230
|
-
i && (s.outline = i.outline, s.outlineOffset = i.outlineOffset),
|
|
1231
|
-
|
|
1001
|
+
const s = t.style;
|
|
1002
|
+
s.outline = "2px solid rgba(255, 68, 68, 0.8)", s.outlineOffset = "1px", s.transition = "none", e.timer = setTimeout(() => {
|
|
1003
|
+
t.isConnected && (s.transition = "outline 0.5s ease-out", requestAnimationFrame(() => {
|
|
1004
|
+
if (!t.isConnected) return;
|
|
1005
|
+
const i = e?.orgStyle;
|
|
1006
|
+
i && (s.outline = i.outline, s.outlineOffset = i.outlineOffset), e.cleanupTimer = setTimeout(() => {
|
|
1007
|
+
t.isConnected && e?.orgStyle && (s.transition = e.orgStyle.transition), gt.delete(t);
|
|
1232
1008
|
}, 500);
|
|
1233
1009
|
}));
|
|
1234
1010
|
}, 100);
|
|
1235
1011
|
}
|
|
1236
|
-
const
|
|
1237
|
-
function
|
|
1238
|
-
const
|
|
1239
|
-
return
|
|
1012
|
+
const pe = /* @__PURE__ */ new WeakMap();
|
|
1013
|
+
function Qt(n, t = {}) {
|
|
1014
|
+
const e = ue(n, t);
|
|
1015
|
+
return t.name && pe.set(e, { name: t.name }), e;
|
|
1240
1016
|
}
|
|
1241
|
-
Object.defineProperty(
|
|
1017
|
+
Object.defineProperty(Qt, "debug", {
|
|
1242
1018
|
get() {
|
|
1243
|
-
return
|
|
1019
|
+
return _.enabled;
|
|
1244
1020
|
},
|
|
1245
1021
|
set(n) {
|
|
1246
|
-
|
|
1022
|
+
_.enabled = n;
|
|
1247
1023
|
}
|
|
1248
1024
|
});
|
|
1249
|
-
function
|
|
1025
|
+
function ge() {
|
|
1250
1026
|
return new Promise((n) => setTimeout(n, 0));
|
|
1251
1027
|
}
|
|
1252
|
-
|
|
1253
|
-
atom:
|
|
1254
|
-
computed:
|
|
1255
|
-
effect:
|
|
1256
|
-
batch:
|
|
1257
|
-
untracked:
|
|
1258
|
-
isAtom:
|
|
1259
|
-
isComputed:
|
|
1260
|
-
isReactive: (n) =>
|
|
1261
|
-
nextTick:
|
|
1028
|
+
u.extend({
|
|
1029
|
+
atom: Qt,
|
|
1030
|
+
computed: he,
|
|
1031
|
+
effect: Y,
|
|
1032
|
+
batch: It,
|
|
1033
|
+
untracked: zt,
|
|
1034
|
+
isAtom: yt,
|
|
1035
|
+
isComputed: wt,
|
|
1036
|
+
isReactive: (n) => yt(n) || wt(n),
|
|
1037
|
+
nextTick: ge
|
|
1262
1038
|
});
|
|
1263
|
-
const
|
|
1264
|
-
class
|
|
1039
|
+
const ot = "_aes-bound";
|
|
1040
|
+
class me {
|
|
1265
1041
|
records = /* @__PURE__ */ new WeakMap();
|
|
1266
1042
|
boundElements = /* @__PURE__ */ new WeakSet();
|
|
1267
1043
|
preservedNodes = /* @__PURE__ */ new WeakSet();
|
|
1268
1044
|
ignoredNodes = /* @__PURE__ */ new WeakSet();
|
|
1269
1045
|
// Prevent redundant cleanup
|
|
1270
|
-
keep(
|
|
1271
|
-
this.preservedNodes.add(
|
|
1046
|
+
keep(t) {
|
|
1047
|
+
this.preservedNodes.add(t);
|
|
1272
1048
|
}
|
|
1273
|
-
isKept(
|
|
1274
|
-
return this.preservedNodes.has(
|
|
1049
|
+
isKept(t) {
|
|
1050
|
+
return this.preservedNodes.has(t);
|
|
1275
1051
|
}
|
|
1276
|
-
markIgnored(
|
|
1277
|
-
this.ignoredNodes.add(
|
|
1052
|
+
markIgnored(t) {
|
|
1053
|
+
this.ignoredNodes.add(t);
|
|
1278
1054
|
}
|
|
1279
|
-
isIgnored(
|
|
1280
|
-
return this.ignoredNodes.has(
|
|
1055
|
+
isIgnored(t) {
|
|
1056
|
+
return this.ignoredNodes.has(t);
|
|
1281
1057
|
}
|
|
1282
|
-
_getOrCreateRecord(
|
|
1283
|
-
let
|
|
1284
|
-
return
|
|
1058
|
+
_getOrCreateRecord(t) {
|
|
1059
|
+
let e = this.records.get(t);
|
|
1060
|
+
return e || (e = {}, this.records.set(t, e), this.boundElements.has(t) || (this.boundElements.add(t), t.classList.add(ot))), e;
|
|
1285
1061
|
}
|
|
1286
|
-
trackEffect(
|
|
1287
|
-
const s = this._getOrCreateRecord(
|
|
1288
|
-
s.effects || (s.effects = []), s.effects.push(
|
|
1062
|
+
trackEffect(t, e) {
|
|
1063
|
+
const s = this._getOrCreateRecord(t);
|
|
1064
|
+
s.effects || (s.effects = []), s.effects.push(e);
|
|
1289
1065
|
}
|
|
1290
|
-
trackCleanup(
|
|
1291
|
-
const s = this._getOrCreateRecord(
|
|
1292
|
-
s.cleanups || (s.cleanups = []), s.cleanups.push(
|
|
1066
|
+
trackCleanup(t, e) {
|
|
1067
|
+
const s = this._getOrCreateRecord(t);
|
|
1068
|
+
s.cleanups || (s.cleanups = []), s.cleanups.push(e);
|
|
1293
1069
|
}
|
|
1294
|
-
hasBind(
|
|
1295
|
-
return this.boundElements.has(
|
|
1070
|
+
hasBind(t) {
|
|
1071
|
+
return this.boundElements.has(t);
|
|
1296
1072
|
}
|
|
1297
|
-
cleanup(
|
|
1298
|
-
if (!this.boundElements.delete(
|
|
1299
|
-
const
|
|
1300
|
-
if (!
|
|
1301
|
-
this.records.delete(
|
|
1302
|
-
const s =
|
|
1073
|
+
cleanup(t) {
|
|
1074
|
+
if (!this.boundElements.delete(t)) return;
|
|
1075
|
+
const e = this.records.get(t);
|
|
1076
|
+
if (!e) return;
|
|
1077
|
+
this.records.delete(t), this.preservedNodes.delete(t), this.ignoredNodes.delete(t), t.classList.remove(ot), _.enabled && _.cleanup(ft(t));
|
|
1078
|
+
const s = e.effects;
|
|
1303
1079
|
if (s)
|
|
1304
1080
|
for (let o = 0, r = s.length; o < r; o++)
|
|
1305
1081
|
try {
|
|
1306
1082
|
s[o]?.dispose();
|
|
1307
1083
|
} catch (c) {
|
|
1308
|
-
|
|
1084
|
+
_.warn("Effect dispose error:", c);
|
|
1309
1085
|
}
|
|
1310
|
-
const i =
|
|
1086
|
+
const i = e.cleanups;
|
|
1311
1087
|
if (i)
|
|
1312
1088
|
for (let o = 0, r = i.length; o < r; o++)
|
|
1313
1089
|
try {
|
|
1314
1090
|
i[o]?.();
|
|
1315
1091
|
} catch (c) {
|
|
1316
|
-
|
|
1092
|
+
_.warn("Cleanup error:", c);
|
|
1317
1093
|
}
|
|
1318
1094
|
}
|
|
1319
|
-
cleanupDescendants(
|
|
1320
|
-
const
|
|
1321
|
-
for (let s = 0, i =
|
|
1322
|
-
const o =
|
|
1323
|
-
o && this.boundElements.has(o) ? this.cleanup(o) : o && o.classList.remove(
|
|
1095
|
+
cleanupDescendants(t) {
|
|
1096
|
+
const e = t.querySelectorAll(`.${ot}`);
|
|
1097
|
+
for (let s = 0, i = e.length; s < i; s++) {
|
|
1098
|
+
const o = e[s];
|
|
1099
|
+
o && this.boundElements.has(o) ? this.cleanup(o) : o && o.classList.remove(ot);
|
|
1324
1100
|
}
|
|
1325
1101
|
}
|
|
1326
|
-
cleanupTree(
|
|
1327
|
-
this.cleanupDescendants(
|
|
1102
|
+
cleanupTree(t) {
|
|
1103
|
+
this.cleanupDescendants(t), this.cleanup(t);
|
|
1328
1104
|
}
|
|
1329
1105
|
}
|
|
1330
|
-
const
|
|
1331
|
-
let
|
|
1332
|
-
function
|
|
1333
|
-
|
|
1334
|
-
for (let
|
|
1335
|
-
const i = e
|
|
1106
|
+
const p = new me();
|
|
1107
|
+
let et = null;
|
|
1108
|
+
function Se(n = document.body) {
|
|
1109
|
+
et || (et = new MutationObserver((t) => {
|
|
1110
|
+
for (let e = 0, s = t.length; e < s; e++) {
|
|
1111
|
+
const i = t[e]?.removedNodes;
|
|
1336
1112
|
if (!i) continue;
|
|
1337
1113
|
const o = i.length;
|
|
1338
1114
|
if (o !== 0)
|
|
1339
1115
|
for (let r = 0; r < o; r++) {
|
|
1340
1116
|
const c = i[r];
|
|
1341
|
-
c.nodeType === 1 && (c.isConnected ||
|
|
1117
|
+
c.nodeType === 1 && (c.isConnected || p.isKept(c) || p.isIgnored(c) || p.cleanupTree(c));
|
|
1342
1118
|
}
|
|
1343
1119
|
}
|
|
1344
|
-
}),
|
|
1120
|
+
}), et.observe(n, { childList: !0, subtree: !0 }));
|
|
1345
1121
|
}
|
|
1346
|
-
function
|
|
1347
|
-
|
|
1122
|
+
function xe() {
|
|
1123
|
+
et?.disconnect(), et = null;
|
|
1348
1124
|
}
|
|
1349
|
-
function
|
|
1350
|
-
|
|
1125
|
+
function b(n, t, e, s) {
|
|
1126
|
+
fe(t) ? p.trackEffect(
|
|
1351
1127
|
n,
|
|
1352
|
-
|
|
1353
|
-
const i =
|
|
1354
|
-
|
|
1128
|
+
Y(() => {
|
|
1129
|
+
const i = t.value;
|
|
1130
|
+
e(i), _.domUpdated(u(n), s, i);
|
|
1355
1131
|
})
|
|
1356
|
-
) : (t
|
|
1132
|
+
) : (e(t), _.domUpdated(u(n), s, t));
|
|
1357
1133
|
}
|
|
1358
|
-
var
|
|
1359
|
-
function
|
|
1134
|
+
var g = /* @__PURE__ */ ((n) => (n[n.None = 0] = "None", n[n.Focused = 1] = "Focused", n[n.Composing = 2] = "Composing", n[n.SyncingToAtom = 4] = "SyncingToAtom", n[n.SyncingToDom = 8] = "SyncingToDom", n[n.Busy = 14] = "Busy", n))(g || {});
|
|
1135
|
+
function Dt() {
|
|
1360
1136
|
return {
|
|
1361
1137
|
timeoutId: null,
|
|
1362
1138
|
flags: 0
|
|
1363
1139
|
/* None */
|
|
1364
1140
|
};
|
|
1365
1141
|
}
|
|
1366
|
-
function
|
|
1142
|
+
function Yt(n, t, e = {}) {
|
|
1367
1143
|
const {
|
|
1368
1144
|
debounce: s,
|
|
1369
1145
|
event: i = "input",
|
|
1370
1146
|
parse: o = (I) => I,
|
|
1371
1147
|
format: r = (I) => String(I ?? ""),
|
|
1372
1148
|
equal: c = Object.is
|
|
1373
|
-
} =
|
|
1374
|
-
if (!(
|
|
1375
|
-
|
|
1149
|
+
} = e, l = Dt(), a = n[0], d = () => {
|
|
1150
|
+
if (!(l.flags & g.Busy)) {
|
|
1151
|
+
l.flags |= g.SyncingToAtom;
|
|
1376
1152
|
try {
|
|
1377
|
-
const I =
|
|
1378
|
-
c(
|
|
1153
|
+
const I = a.value, D = o(I);
|
|
1154
|
+
c(t.value, D) || (t.value = D);
|
|
1379
1155
|
} finally {
|
|
1380
|
-
|
|
1156
|
+
l.flags &= ~g.SyncingToAtom;
|
|
1381
1157
|
}
|
|
1382
1158
|
}
|
|
1383
|
-
},
|
|
1384
|
-
|
|
1385
|
-
const I = r(
|
|
1386
|
-
|
|
1387
|
-
},
|
|
1388
|
-
|
|
1389
|
-
},
|
|
1159
|
+
}, N = () => {
|
|
1160
|
+
l.timeoutId && (clearTimeout(l.timeoutId), l.timeoutId = null, d()), l.flags &= ~g.Focused;
|
|
1161
|
+
const I = r(t.value);
|
|
1162
|
+
a.value !== I && (a.value = I);
|
|
1163
|
+
}, C = () => {
|
|
1164
|
+
l.flags & g.Busy || (s ? (l.timeoutId && clearTimeout(l.timeoutId), l.timeoutId = setTimeout(d, s)) : d());
|
|
1165
|
+
}, v = {
|
|
1390
1166
|
compositionstart: () => {
|
|
1391
|
-
|
|
1167
|
+
l.flags |= g.Composing;
|
|
1392
1168
|
},
|
|
1393
1169
|
compositionend: () => {
|
|
1394
|
-
|
|
1170
|
+
l.flags &= ~g.Composing, d();
|
|
1395
1171
|
},
|
|
1396
1172
|
focus: () => {
|
|
1397
|
-
|
|
1173
|
+
l.flags |= g.Focused;
|
|
1398
1174
|
},
|
|
1399
|
-
blur:
|
|
1400
|
-
[i]:
|
|
1401
|
-
change:
|
|
1175
|
+
blur: N,
|
|
1176
|
+
[i]: C,
|
|
1177
|
+
change: C
|
|
1402
1178
|
};
|
|
1403
|
-
return n.on(
|
|
1404
|
-
const I =
|
|
1405
|
-
if (
|
|
1406
|
-
|
|
1179
|
+
return n.on(v), { effect: () => {
|
|
1180
|
+
const I = t.value, D = r(I), O = a.value;
|
|
1181
|
+
if (O !== D && !(l.flags & g.Focused && c(o(O), I))) {
|
|
1182
|
+
l.flags |= g.SyncingToDom;
|
|
1407
1183
|
try {
|
|
1408
|
-
if (
|
|
1409
|
-
const { selectionStart:
|
|
1410
|
-
|
|
1411
|
-
const
|
|
1412
|
-
|
|
1184
|
+
if (l.flags & g.Focused) {
|
|
1185
|
+
const { selectionStart: nt, selectionEnd: _t } = a;
|
|
1186
|
+
a.value = D;
|
|
1187
|
+
const P = D.length;
|
|
1188
|
+
a.setSelectionRange(Math.min(nt ?? P, P), Math.min(_t ?? P, P));
|
|
1413
1189
|
} else
|
|
1414
|
-
|
|
1415
|
-
|
|
1190
|
+
a.value = D;
|
|
1191
|
+
_.domUpdated(n, "val", D);
|
|
1416
1192
|
} finally {
|
|
1417
|
-
|
|
1193
|
+
l.flags &= ~g.SyncingToDom;
|
|
1418
1194
|
}
|
|
1419
1195
|
}
|
|
1420
1196
|
}, cleanup: () => {
|
|
1421
|
-
n.off(
|
|
1197
|
+
n.off(v), l.timeoutId && clearTimeout(l.timeoutId);
|
|
1422
1198
|
} };
|
|
1423
1199
|
}
|
|
1424
|
-
|
|
1200
|
+
u.fn.atomText = function(n, t) {
|
|
1425
1201
|
return this.each(function() {
|
|
1426
|
-
const
|
|
1427
|
-
|
|
1202
|
+
const e = u(this);
|
|
1203
|
+
b(this, n, t ? (i) => e.text(t(i)) : (i) => e.text(String(i ?? "")), "text");
|
|
1428
1204
|
});
|
|
1429
1205
|
};
|
|
1430
|
-
|
|
1206
|
+
u.fn.atomHtml = function(n) {
|
|
1431
1207
|
return this.each(function() {
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1208
|
+
const t = u(this);
|
|
1209
|
+
b(this, n, (e) => t.html(String(e ?? "")), "html");
|
|
1434
1210
|
});
|
|
1435
1211
|
};
|
|
1436
|
-
|
|
1212
|
+
u.fn.atomClass = function(n, t) {
|
|
1437
1213
|
return this.each(function() {
|
|
1438
|
-
const
|
|
1439
|
-
|
|
1214
|
+
const e = u(this);
|
|
1215
|
+
b(
|
|
1440
1216
|
this,
|
|
1441
|
-
|
|
1442
|
-
(s) =>
|
|
1217
|
+
t,
|
|
1218
|
+
(s) => e.toggleClass(n, !!s),
|
|
1443
1219
|
`class.${n}`
|
|
1444
1220
|
);
|
|
1445
1221
|
});
|
|
1446
1222
|
};
|
|
1447
|
-
|
|
1223
|
+
u.fn.atomCss = function(n, t, e) {
|
|
1448
1224
|
return this.each(function() {
|
|
1449
|
-
const s =
|
|
1450
|
-
|
|
1225
|
+
const s = u(this);
|
|
1226
|
+
b(this, t, e ? (o) => s.css(n, `${o}${e}`) : (o) => s.css(n, o), `css.${n}`);
|
|
1451
1227
|
});
|
|
1452
1228
|
};
|
|
1453
|
-
|
|
1229
|
+
u.fn.atomAttr = function(n, t) {
|
|
1454
1230
|
return this.each(function() {
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1231
|
+
const e = u(this);
|
|
1232
|
+
b(
|
|
1457
1233
|
this,
|
|
1458
|
-
|
|
1234
|
+
t,
|
|
1459
1235
|
(s) => {
|
|
1460
1236
|
if (s == null || s === !1) {
|
|
1461
|
-
|
|
1237
|
+
e.removeAttr(n);
|
|
1462
1238
|
return;
|
|
1463
1239
|
}
|
|
1464
|
-
|
|
1240
|
+
e.attr(n, s === !0 ? n : String(s));
|
|
1465
1241
|
},
|
|
1466
1242
|
`attr.${n}`
|
|
1467
1243
|
);
|
|
1468
1244
|
});
|
|
1469
1245
|
};
|
|
1470
|
-
|
|
1246
|
+
u.fn.atomProp = function(n, t) {
|
|
1471
1247
|
return this.each(function() {
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1248
|
+
const e = u(this);
|
|
1249
|
+
b(this, t, (s) => e.prop(n, s), `prop.${n}`);
|
|
1474
1250
|
});
|
|
1475
1251
|
};
|
|
1476
|
-
|
|
1252
|
+
u.fn.atomShow = function(n) {
|
|
1477
1253
|
return this.each(function() {
|
|
1478
|
-
const
|
|
1479
|
-
|
|
1254
|
+
const t = u(this);
|
|
1255
|
+
b(this, n, (e) => t.toggle(!!e), "show");
|
|
1480
1256
|
});
|
|
1481
1257
|
};
|
|
1482
|
-
|
|
1258
|
+
u.fn.atomHide = function(n) {
|
|
1483
1259
|
return this.each(function() {
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1260
|
+
const t = u(this);
|
|
1261
|
+
b(this, n, (e) => t.toggle(!e), "hide");
|
|
1486
1262
|
});
|
|
1487
1263
|
};
|
|
1488
|
-
|
|
1264
|
+
u.fn.atomVal = function(n, t = {}) {
|
|
1489
1265
|
return this.each(function() {
|
|
1490
|
-
const { effect:
|
|
1491
|
-
|
|
1266
|
+
const { effect: e, cleanup: s } = Yt(u(this), n, t);
|
|
1267
|
+
p.trackEffect(this, Y(e)), p.trackCleanup(this, s);
|
|
1492
1268
|
});
|
|
1493
1269
|
};
|
|
1494
|
-
|
|
1270
|
+
u.fn.atomChecked = function(n) {
|
|
1495
1271
|
return this.each(function() {
|
|
1496
|
-
const
|
|
1497
|
-
if (s.flags &
|
|
1498
|
-
const r =
|
|
1272
|
+
const t = u(this), e = this, s = Dt(), i = () => {
|
|
1273
|
+
if (s.flags & g.Busy) return;
|
|
1274
|
+
const r = e.checked;
|
|
1499
1275
|
n.value !== r && (n.value = r);
|
|
1500
1276
|
};
|
|
1501
|
-
|
|
1502
|
-
const o =
|
|
1503
|
-
s.flags |=
|
|
1277
|
+
t.on("change", i), p.trackCleanup(this, () => t.off("change", i));
|
|
1278
|
+
const o = Y(() => {
|
|
1279
|
+
s.flags |= g.SyncingToDom;
|
|
1504
1280
|
const r = !!n.value;
|
|
1505
|
-
|
|
1281
|
+
e.checked !== r && (e.checked = r, _.domUpdated(t, "checked", r)), s.flags &= ~g.SyncingToDom;
|
|
1506
1282
|
});
|
|
1507
|
-
|
|
1283
|
+
p.trackEffect(this, o);
|
|
1508
1284
|
});
|
|
1509
1285
|
};
|
|
1510
|
-
|
|
1286
|
+
u.fn.atomOn = function(n, t) {
|
|
1511
1287
|
return this.each(function() {
|
|
1512
|
-
const
|
|
1513
|
-
|
|
1288
|
+
const e = u(this);
|
|
1289
|
+
e.on(n, t), p.trackCleanup(this, () => e.off(n, t));
|
|
1514
1290
|
});
|
|
1515
1291
|
};
|
|
1516
|
-
|
|
1292
|
+
u.fn.atomUnbind = function() {
|
|
1517
1293
|
return this.each(function() {
|
|
1518
|
-
|
|
1294
|
+
p.cleanupTree(this);
|
|
1519
1295
|
});
|
|
1520
1296
|
};
|
|
1521
|
-
const
|
|
1522
|
-
function
|
|
1523
|
-
let
|
|
1524
|
-
return
|
|
1297
|
+
const Ft = /* @__PURE__ */ Object.create(null);
|
|
1298
|
+
function be(n) {
|
|
1299
|
+
let t = Ft[n];
|
|
1300
|
+
return t || (t = n.includes("-") ? n.replace(/-./g, (e) => e[1].toUpperCase()) : n, Ft[n] = t, t);
|
|
1525
1301
|
}
|
|
1526
|
-
function
|
|
1527
|
-
const
|
|
1528
|
-
|
|
1529
|
-
t,
|
|
1302
|
+
function ye(n, t) {
|
|
1303
|
+
const e = n.el;
|
|
1304
|
+
b(
|
|
1530
1305
|
e,
|
|
1306
|
+
t,
|
|
1531
1307
|
(s) => {
|
|
1532
1308
|
const i = typeof s == "string" ? s : String(s ?? "");
|
|
1533
|
-
|
|
1309
|
+
e.textContent !== i && (e.textContent = i);
|
|
1534
1310
|
},
|
|
1535
1311
|
"text"
|
|
1536
1312
|
);
|
|
1537
1313
|
}
|
|
1538
|
-
function
|
|
1539
|
-
const
|
|
1540
|
-
|
|
1541
|
-
t,
|
|
1314
|
+
function Ce(n, t) {
|
|
1315
|
+
const e = n.el;
|
|
1316
|
+
b(
|
|
1542
1317
|
e,
|
|
1318
|
+
t,
|
|
1543
1319
|
(s) => {
|
|
1544
1320
|
const i = String(s ?? "");
|
|
1545
|
-
|
|
1321
|
+
e.innerHTML !== i && (e.innerHTML = i);
|
|
1546
1322
|
},
|
|
1547
1323
|
"html"
|
|
1548
1324
|
);
|
|
1549
1325
|
}
|
|
1550
|
-
function
|
|
1551
|
-
for (const
|
|
1552
|
-
|
|
1326
|
+
function Ie(n, t) {
|
|
1327
|
+
for (const e in t)
|
|
1328
|
+
b(
|
|
1553
1329
|
n.el,
|
|
1554
|
-
e
|
|
1330
|
+
t[e],
|
|
1555
1331
|
(s) => {
|
|
1556
|
-
n.el.classList.toggle(
|
|
1332
|
+
n.el.classList.toggle(e, !!s);
|
|
1557
1333
|
},
|
|
1558
|
-
`class.${
|
|
1334
|
+
`class.${e}`
|
|
1559
1335
|
);
|
|
1560
1336
|
}
|
|
1561
|
-
function
|
|
1562
|
-
const
|
|
1563
|
-
for (const i in
|
|
1564
|
-
const o =
|
|
1337
|
+
function De(n, t) {
|
|
1338
|
+
const e = n.el, s = e.style;
|
|
1339
|
+
for (const i in t) {
|
|
1340
|
+
const o = t[i];
|
|
1565
1341
|
if (o === void 0) continue;
|
|
1566
|
-
const r =
|
|
1567
|
-
Array.isArray(o) ?
|
|
1568
|
-
|
|
1342
|
+
const r = be(i);
|
|
1343
|
+
Array.isArray(o) ? b(
|
|
1344
|
+
e,
|
|
1569
1345
|
o[0],
|
|
1570
1346
|
(c) => {
|
|
1571
1347
|
s[r] = `${c}${o[1]}`;
|
|
1572
1348
|
},
|
|
1573
1349
|
`css.${i}`
|
|
1574
|
-
) :
|
|
1575
|
-
|
|
1350
|
+
) : b(
|
|
1351
|
+
e,
|
|
1576
1352
|
o,
|
|
1577
1353
|
(c) => {
|
|
1578
1354
|
s[r] = c;
|
|
@@ -1581,316 +1357,316 @@ function At(n, e) {
|
|
|
1581
1357
|
);
|
|
1582
1358
|
}
|
|
1583
1359
|
}
|
|
1584
|
-
function
|
|
1585
|
-
const
|
|
1586
|
-
for (const s in
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1360
|
+
function Te(n, t) {
|
|
1361
|
+
const e = n.el;
|
|
1362
|
+
for (const s in t)
|
|
1363
|
+
b(
|
|
1364
|
+
e,
|
|
1365
|
+
t[s],
|
|
1590
1366
|
(i) => {
|
|
1591
1367
|
if (i == null || i === !1) {
|
|
1592
|
-
|
|
1368
|
+
e.removeAttribute(s);
|
|
1593
1369
|
return;
|
|
1594
1370
|
}
|
|
1595
1371
|
const o = i === !0 ? s : String(i);
|
|
1596
|
-
|
|
1372
|
+
e.getAttribute(s) !== o && e.setAttribute(s, o);
|
|
1597
1373
|
},
|
|
1598
1374
|
`attr.${s}`
|
|
1599
1375
|
);
|
|
1600
1376
|
}
|
|
1601
|
-
function
|
|
1602
|
-
const
|
|
1603
|
-
for (const s in
|
|
1604
|
-
|
|
1377
|
+
function Ne(n, t) {
|
|
1378
|
+
const e = n.el;
|
|
1379
|
+
for (const s in t)
|
|
1380
|
+
b(
|
|
1605
1381
|
n.el,
|
|
1606
|
-
|
|
1382
|
+
t[s],
|
|
1607
1383
|
(i) => {
|
|
1608
|
-
|
|
1384
|
+
e[s] !== i && (e[s] = i);
|
|
1609
1385
|
},
|
|
1610
1386
|
`prop.${s}`
|
|
1611
1387
|
);
|
|
1612
1388
|
}
|
|
1613
|
-
function
|
|
1614
|
-
const
|
|
1615
|
-
|
|
1616
|
-
t,
|
|
1389
|
+
function Oe(n, t) {
|
|
1390
|
+
const e = n.el;
|
|
1391
|
+
b(
|
|
1617
1392
|
e,
|
|
1393
|
+
t,
|
|
1618
1394
|
(s) => {
|
|
1619
|
-
|
|
1395
|
+
e.style.display = s ? "" : "none", _.enabled && _.domUpdated(e, "show", s);
|
|
1620
1396
|
},
|
|
1621
1397
|
"show"
|
|
1622
1398
|
);
|
|
1623
1399
|
}
|
|
1624
|
-
function
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1627
|
-
t,
|
|
1400
|
+
function ke(n, t) {
|
|
1401
|
+
const e = n.el;
|
|
1402
|
+
b(
|
|
1628
1403
|
e,
|
|
1404
|
+
t,
|
|
1629
1405
|
(s) => {
|
|
1630
|
-
|
|
1406
|
+
e.style.display = s ? "none" : "", _.enabled && _.domUpdated(e, "hide", s);
|
|
1631
1407
|
},
|
|
1632
1408
|
"hide"
|
|
1633
1409
|
);
|
|
1634
1410
|
}
|
|
1635
|
-
function
|
|
1636
|
-
const
|
|
1411
|
+
function Ae(n, t) {
|
|
1412
|
+
const e = Array.isArray(t), { effect: s, cleanup: i } = Yt(
|
|
1637
1413
|
n.$el,
|
|
1638
|
-
|
|
1639
|
-
|
|
1414
|
+
e ? t[0] : t,
|
|
1415
|
+
e ? t[1] : {}
|
|
1640
1416
|
);
|
|
1641
|
-
|
|
1417
|
+
p.trackEffect(n.el, Y(s)), n.trackCleanup(i);
|
|
1642
1418
|
}
|
|
1643
|
-
function
|
|
1644
|
-
const
|
|
1645
|
-
if (s.flags &
|
|
1646
|
-
const r =
|
|
1647
|
-
|
|
1419
|
+
function ve(n, t) {
|
|
1420
|
+
const e = n.el, s = Dt(), i = () => {
|
|
1421
|
+
if (s.flags & g.Busy) return;
|
|
1422
|
+
const r = e.checked;
|
|
1423
|
+
t.value !== r && (t.value = r);
|
|
1648
1424
|
};
|
|
1649
|
-
|
|
1650
|
-
const o =
|
|
1651
|
-
s.flags |=
|
|
1652
|
-
const r = !!
|
|
1653
|
-
|
|
1425
|
+
e.addEventListener("change", i), n.trackCleanup(() => e.removeEventListener("change", i));
|
|
1426
|
+
const o = Y(() => {
|
|
1427
|
+
s.flags |= g.SyncingToDom;
|
|
1428
|
+
const r = !!t.value;
|
|
1429
|
+
e.checked !== r && (e.checked = r, _.enabled && _.domUpdated(e, "checked", r)), s.flags &= ~g.SyncingToDom;
|
|
1654
1430
|
});
|
|
1655
|
-
|
|
1431
|
+
p.trackEffect(e, o);
|
|
1656
1432
|
}
|
|
1657
|
-
function
|
|
1658
|
-
for (const
|
|
1659
|
-
const s = e
|
|
1433
|
+
function Ue(n, t) {
|
|
1434
|
+
for (const e in t) {
|
|
1435
|
+
const s = t[e];
|
|
1660
1436
|
if (typeof s != "function") continue;
|
|
1661
1437
|
const i = (o) => {
|
|
1662
|
-
|
|
1438
|
+
It(
|
|
1663
1439
|
() => s.call(
|
|
1664
1440
|
n.el,
|
|
1665
|
-
|
|
1441
|
+
u.Event(o.type, { originalEvent: o })
|
|
1666
1442
|
)
|
|
1667
1443
|
);
|
|
1668
1444
|
};
|
|
1669
|
-
n.el.addEventListener(
|
|
1445
|
+
n.el.addEventListener(e, i), n.trackCleanup(() => n.el.removeEventListener(e, i));
|
|
1670
1446
|
}
|
|
1671
1447
|
}
|
|
1672
|
-
|
|
1448
|
+
u.fn.atomBind = function(n) {
|
|
1673
1449
|
return this.each(function() {
|
|
1674
|
-
const
|
|
1675
|
-
let
|
|
1450
|
+
const t = this;
|
|
1451
|
+
let e = null;
|
|
1676
1452
|
const s = {
|
|
1677
1453
|
get $el() {
|
|
1678
|
-
return
|
|
1454
|
+
return e || (e = u(t)), e;
|
|
1679
1455
|
},
|
|
1680
|
-
el:
|
|
1681
|
-
trackCleanup: (i) =>
|
|
1456
|
+
el: t,
|
|
1457
|
+
trackCleanup: (i) => p.trackCleanup(t, i)
|
|
1682
1458
|
};
|
|
1683
|
-
n.text !== void 0 &&
|
|
1459
|
+
n.text !== void 0 && ye(s, n.text), n.html !== void 0 && Ce(s, n.html), n.class && Ie(s, n.class), n.css && De(s, n.css), n.attr && Te(s, n.attr), n.prop && Ne(s, n.prop), n.show !== void 0 && Oe(s, n.show), n.hide !== void 0 && ke(s, n.hide), n.val !== void 0 && Ae(s, n.val), n.checked !== void 0 && ve(s, n.checked), n.on && Ue(s, n.on);
|
|
1684
1460
|
});
|
|
1685
1461
|
};
|
|
1686
|
-
|
|
1687
|
-
const { key:
|
|
1462
|
+
u.fn.atomList = function(n, t) {
|
|
1463
|
+
const { key: e, render: s, bind: i, update: o, onAdd: r, onRemove: c, empty: l } = t, a = typeof e == "function" ? e : (d, N) => d[e];
|
|
1688
1464
|
return this.each(function() {
|
|
1689
|
-
const
|
|
1690
|
-
let
|
|
1691
|
-
const I =
|
|
1692
|
-
const
|
|
1693
|
-
if (
|
|
1694
|
-
|
|
1465
|
+
const d = u(this), N = ft(this), C = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Set();
|
|
1466
|
+
let H = [], V = null;
|
|
1467
|
+
const I = Y(() => {
|
|
1468
|
+
const D = n.value, O = D.length;
|
|
1469
|
+
if (O === 0 ? l && !V && (V = u(l).appendTo(d)) : V && (V.remove(), V = null), O === 0 && C.size === 0) {
|
|
1470
|
+
H = [];
|
|
1695
1471
|
return;
|
|
1696
1472
|
}
|
|
1697
|
-
|
|
1698
|
-
const
|
|
1699
|
-
for (let
|
|
1700
|
-
|
|
1701
|
-
const
|
|
1702
|
-
for (let
|
|
1703
|
-
const
|
|
1704
|
-
|
|
1473
|
+
_.log("list", `${N} updating with ${O} items`);
|
|
1474
|
+
const nt = /* @__PURE__ */ new Map(), _t = H.length;
|
|
1475
|
+
for (let f = 0; f < _t; f++)
|
|
1476
|
+
nt.set(H[f], f);
|
|
1477
|
+
const P = new Array(O), dt = /* @__PURE__ */ new Set(), Tt = new Int32Array(O);
|
|
1478
|
+
for (let f = 0; f < O; f++) {
|
|
1479
|
+
const x = D[f], E = a(x, f);
|
|
1480
|
+
_.enabled && dt.has(E) && console.warn(`[atomList] Duplicate key "${E}" at index ${f}.`), P[f] = E, dt.add(E), Tt[f] = nt.get(E) ?? -1;
|
|
1705
1481
|
}
|
|
1706
|
-
if (
|
|
1707
|
-
for (const [
|
|
1708
|
-
if (
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1482
|
+
if (C.size > 0)
|
|
1483
|
+
for (const [f, x] of C) {
|
|
1484
|
+
if (dt.has(f) || v.has(f)) continue;
|
|
1485
|
+
const E = () => {
|
|
1486
|
+
x.$el.remove(), x.$el[0] && p.cleanup(x.$el[0]), v.delete(f), _.log("list", `${N} removed item:`, f);
|
|
1711
1487
|
};
|
|
1712
|
-
if (
|
|
1713
|
-
const
|
|
1714
|
-
|
|
1488
|
+
if (C.delete(f), v.add(f), c) {
|
|
1489
|
+
const y = c(x.$el);
|
|
1490
|
+
y instanceof Promise ? y.then(E) : E();
|
|
1715
1491
|
} else
|
|
1716
|
-
|
|
1492
|
+
E();
|
|
1717
1493
|
}
|
|
1718
|
-
if (
|
|
1719
|
-
|
|
1494
|
+
if (O === 0) {
|
|
1495
|
+
H = [];
|
|
1720
1496
|
return;
|
|
1721
1497
|
}
|
|
1722
|
-
const
|
|
1723
|
-
let
|
|
1724
|
-
for (let
|
|
1725
|
-
const
|
|
1726
|
-
if (
|
|
1727
|
-
const
|
|
1728
|
-
|
|
1729
|
-
const
|
|
1730
|
-
if (!
|
|
1498
|
+
const Nt = _e(Tt);
|
|
1499
|
+
let Et = Nt.length - 1, w = null;
|
|
1500
|
+
for (let f = O - 1; f >= 0; f--) {
|
|
1501
|
+
const x = P[f], E = D[f], y = C.get(x);
|
|
1502
|
+
if (y) {
|
|
1503
|
+
const J = y.item;
|
|
1504
|
+
y.item = E;
|
|
1505
|
+
const U = y.$el[0];
|
|
1506
|
+
if (!U) continue;
|
|
1731
1507
|
if (o)
|
|
1732
|
-
o(
|
|
1733
|
-
else if (
|
|
1734
|
-
let
|
|
1735
|
-
if (typeof
|
|
1736
|
-
|
|
1737
|
-
let
|
|
1738
|
-
const
|
|
1739
|
-
for (const
|
|
1740
|
-
if (
|
|
1741
|
-
|
|
1508
|
+
o(y.$el, E, f), _.domUpdated(y.$el, "list.update", E);
|
|
1509
|
+
else if (J !== E) {
|
|
1510
|
+
let M = !0;
|
|
1511
|
+
if (typeof J == "object" && J !== null && typeof E == "object" && E !== null) {
|
|
1512
|
+
M = !1;
|
|
1513
|
+
let L = 0;
|
|
1514
|
+
const st = J, Ot = E;
|
|
1515
|
+
for (const W in st) {
|
|
1516
|
+
if (st[W] !== Ot[W]) {
|
|
1517
|
+
M = !0;
|
|
1742
1518
|
break;
|
|
1743
1519
|
}
|
|
1744
|
-
|
|
1520
|
+
L++;
|
|
1745
1521
|
}
|
|
1746
|
-
if (!
|
|
1747
|
-
let
|
|
1748
|
-
for (const
|
|
1749
|
-
if (
|
|
1750
|
-
|
|
1522
|
+
if (!M) {
|
|
1523
|
+
let W = 0;
|
|
1524
|
+
for (const Re in Ot)
|
|
1525
|
+
if (W++, W > L) {
|
|
1526
|
+
M = !0;
|
|
1751
1527
|
break;
|
|
1752
1528
|
}
|
|
1753
|
-
|
|
1529
|
+
L !== W && (M = !0);
|
|
1754
1530
|
}
|
|
1755
1531
|
}
|
|
1756
|
-
if (
|
|
1757
|
-
const
|
|
1758
|
-
|
|
1532
|
+
if (M) {
|
|
1533
|
+
const L = u(s(E, f)), st = w === U;
|
|
1534
|
+
y.$el.replaceWith(L), y.$el = L, i && i(L, E, f), _.domUpdated(L, "list.render", E), st && (w = L[0] || null);
|
|
1759
1535
|
}
|
|
1760
1536
|
}
|
|
1761
|
-
if (
|
|
1762
|
-
|
|
1537
|
+
if (Et >= 0 && Nt[Et] === f)
|
|
1538
|
+
Et--;
|
|
1763
1539
|
else {
|
|
1764
|
-
const
|
|
1765
|
-
|
|
1540
|
+
const M = y.$el[0];
|
|
1541
|
+
w?.isConnected ? w !== M && y.$el.insertBefore(w) : y.$el.appendTo(d);
|
|
1766
1542
|
}
|
|
1767
|
-
|
|
1543
|
+
w = y.$el[0] || null;
|
|
1768
1544
|
} else {
|
|
1769
|
-
const
|
|
1770
|
-
|
|
1545
|
+
const J = s(E, f), U = u(J);
|
|
1546
|
+
C.set(x, { $el: U, item: E }), w?.isConnected ? U.insertBefore(w) : U.appendTo(d), i && i(U, E, f), r && r(U), _.domUpdated(U, "list.add", E), w = U[0] || null;
|
|
1771
1547
|
}
|
|
1772
1548
|
}
|
|
1773
|
-
|
|
1549
|
+
H = P;
|
|
1774
1550
|
});
|
|
1775
|
-
|
|
1776
|
-
|
|
1551
|
+
p.trackEffect(this, I), p.trackCleanup(this, () => {
|
|
1552
|
+
C.clear(), v.clear(), H = [], V?.remove();
|
|
1777
1553
|
});
|
|
1778
1554
|
});
|
|
1779
1555
|
};
|
|
1780
|
-
const
|
|
1781
|
-
|
|
1556
|
+
const ct = /* @__PURE__ */ new WeakMap();
|
|
1557
|
+
u.fn.atomMount = function(n, t = {}) {
|
|
1782
1558
|
return this.each(function() {
|
|
1783
|
-
const
|
|
1784
|
-
i && (
|
|
1559
|
+
const e = _.enabled, s = e ? ft(this) : "", i = ct.get(this);
|
|
1560
|
+
i && (e && _.log("mount", `${s} unmounting existing component`), i()), e && _.log("mount", `${s} mounting component`);
|
|
1785
1561
|
let o;
|
|
1786
1562
|
try {
|
|
1787
|
-
o = n(
|
|
1563
|
+
o = n(u(this), t);
|
|
1788
1564
|
} catch (c) {
|
|
1789
1565
|
console.error("[atom-effect-jquery] Mount error:", c);
|
|
1790
1566
|
return;
|
|
1791
1567
|
}
|
|
1792
1568
|
const r = () => {
|
|
1793
|
-
if (
|
|
1794
|
-
if (
|
|
1569
|
+
if (ct.delete(this)) {
|
|
1570
|
+
if (e && _.log("mount", `${s} full cleanup`), typeof o == "function")
|
|
1795
1571
|
try {
|
|
1796
1572
|
o();
|
|
1797
1573
|
} catch (c) {
|
|
1798
1574
|
console.error("[atom-effect-jquery] Cleanup error:", c);
|
|
1799
1575
|
}
|
|
1800
|
-
|
|
1576
|
+
p.cleanupTree(this);
|
|
1801
1577
|
}
|
|
1802
1578
|
};
|
|
1803
|
-
|
|
1579
|
+
ct.set(this, r), p.trackCleanup(this, r);
|
|
1804
1580
|
});
|
|
1805
1581
|
};
|
|
1806
|
-
|
|
1582
|
+
u.fn.atomUnmount = function() {
|
|
1807
1583
|
return this.each(function() {
|
|
1808
|
-
const n =
|
|
1584
|
+
const n = ct.get(this);
|
|
1809
1585
|
n && n();
|
|
1810
1586
|
});
|
|
1811
1587
|
};
|
|
1812
|
-
const
|
|
1813
|
-
let
|
|
1814
|
-
const
|
|
1815
|
-
let
|
|
1816
|
-
return
|
|
1817
|
-
return
|
|
1818
|
-
},
|
|
1588
|
+
const lt = /* @__PURE__ */ new WeakMap();
|
|
1589
|
+
let Pt = !1;
|
|
1590
|
+
const Mt = (n) => {
|
|
1591
|
+
let t = lt.get(n);
|
|
1592
|
+
return t || (t = function(...e) {
|
|
1593
|
+
return It(() => n.apply(this, e));
|
|
1594
|
+
}, lt.set(n, t)), t;
|
|
1819
1595
|
};
|
|
1820
|
-
function
|
|
1821
|
-
if (
|
|
1822
|
-
|
|
1823
|
-
const n =
|
|
1824
|
-
|
|
1596
|
+
function Jt() {
|
|
1597
|
+
if (Pt) return;
|
|
1598
|
+
Pt = !0;
|
|
1599
|
+
const n = u.fn.on, t = u.fn.off, e = u.fn.remove, s = u.fn.empty, i = u.fn.detach;
|
|
1600
|
+
u.fn.remove = function(o) {
|
|
1825
1601
|
const r = o ? this.filter(o) : this;
|
|
1826
|
-
for (let c = 0,
|
|
1827
|
-
const
|
|
1828
|
-
|
|
1602
|
+
for (let c = 0, l = r.length; c < l; c++) {
|
|
1603
|
+
const a = r[c];
|
|
1604
|
+
a && (p.cleanupTree(a), p.markIgnored(a));
|
|
1829
1605
|
}
|
|
1830
|
-
return
|
|
1831
|
-
},
|
|
1606
|
+
return e.call(this, o);
|
|
1607
|
+
}, u.fn.empty = function() {
|
|
1832
1608
|
for (let o = 0, r = this.length; o < r; o++) {
|
|
1833
1609
|
const c = this[o];
|
|
1834
|
-
c &&
|
|
1610
|
+
c && p.cleanupDescendants(c);
|
|
1835
1611
|
}
|
|
1836
1612
|
return s.call(this);
|
|
1837
|
-
},
|
|
1613
|
+
}, u.fn.detach = function(o) {
|
|
1838
1614
|
const r = o ? this.filter(o) : this;
|
|
1839
|
-
for (let c = 0,
|
|
1840
|
-
const
|
|
1841
|
-
|
|
1615
|
+
for (let c = 0, l = r.length; c < l; c++) {
|
|
1616
|
+
const a = r[c];
|
|
1617
|
+
a && p.keep(a);
|
|
1842
1618
|
}
|
|
1843
1619
|
return i.call(this, o);
|
|
1844
|
-
},
|
|
1620
|
+
}, u.fn.on = function(...o) {
|
|
1845
1621
|
const r = o[0];
|
|
1846
1622
|
if (r && typeof r == "object") {
|
|
1847
|
-
const c = r,
|
|
1848
|
-
for (const
|
|
1849
|
-
const
|
|
1850
|
-
|
|
1623
|
+
const c = r, l = {};
|
|
1624
|
+
for (const a in c) {
|
|
1625
|
+
const d = c[a];
|
|
1626
|
+
d && (l[a] = Mt(d));
|
|
1851
1627
|
}
|
|
1852
|
-
o[0] =
|
|
1628
|
+
o[0] = l;
|
|
1853
1629
|
} else
|
|
1854
1630
|
for (let c = o.length - 1; c >= 0; c--)
|
|
1855
1631
|
if (typeof o[c] == "function") {
|
|
1856
|
-
o[c] =
|
|
1632
|
+
o[c] = Mt(o[c]);
|
|
1857
1633
|
break;
|
|
1858
1634
|
}
|
|
1859
1635
|
return n.apply(this, o);
|
|
1860
|
-
},
|
|
1636
|
+
}, u.fn.off = function(...o) {
|
|
1861
1637
|
const r = o[0];
|
|
1862
1638
|
if (r && typeof r == "object") {
|
|
1863
|
-
const c = r,
|
|
1864
|
-
for (const
|
|
1865
|
-
const
|
|
1866
|
-
|
|
1639
|
+
const c = r, l = {};
|
|
1640
|
+
for (const a in c) {
|
|
1641
|
+
const d = c[a];
|
|
1642
|
+
d && (l[a] = lt.get(d) || d);
|
|
1867
1643
|
}
|
|
1868
|
-
o[0] =
|
|
1644
|
+
o[0] = l;
|
|
1869
1645
|
} else
|
|
1870
1646
|
for (let c = o.length - 1; c >= 0; c--)
|
|
1871
1647
|
if (typeof o[c] == "function") {
|
|
1872
|
-
o[c] =
|
|
1648
|
+
o[c] = lt.get(o[c]) || o[c];
|
|
1873
1649
|
break;
|
|
1874
1650
|
}
|
|
1875
|
-
return
|
|
1651
|
+
return t.apply(this, o);
|
|
1876
1652
|
};
|
|
1877
1653
|
}
|
|
1878
|
-
const
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1654
|
+
const Le = Jt;
|
|
1655
|
+
Jt();
|
|
1656
|
+
u(() => {
|
|
1657
|
+
Se(document.body);
|
|
1882
1658
|
});
|
|
1883
1659
|
export {
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1660
|
+
ue as atom,
|
|
1661
|
+
It as batch,
|
|
1662
|
+
he as computed,
|
|
1663
|
+
Me as default,
|
|
1664
|
+
xe as disableAutoCleanup,
|
|
1665
|
+
Y as effect,
|
|
1666
|
+
Se as enableAutoCleanup,
|
|
1667
|
+
Le as enablejQueryBatching,
|
|
1668
|
+
Jt as enablejQueryOverrides,
|
|
1669
|
+
p as registry,
|
|
1670
|
+
zt as untracked
|
|
1895
1671
|
};
|
|
1896
1672
|
//# sourceMappingURL=index.mjs.map
|