@koppajs/koppajs-core 3.0.9 → 3.0.10
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/CHANGELOG.md +20 -0
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +756 -730
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
const
|
|
1
|
+
var Le = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e[e.NONE = 4] = "NONE", e))(Le || {});
|
|
2
|
+
const z = {
|
|
3
3
|
ERROR: "❌",
|
|
4
4
|
WARN: "⚠️",
|
|
5
5
|
INFO: "ℹ️",
|
|
6
6
|
DEBUG: "🔍"
|
|
7
7
|
};
|
|
8
|
-
class
|
|
8
|
+
class De {
|
|
9
9
|
level = 3;
|
|
10
10
|
isDevelopment = !1;
|
|
11
11
|
/**
|
|
@@ -34,57 +34,57 @@ class Le {
|
|
|
34
34
|
shouldLog(t) {
|
|
35
35
|
return t >= this.level;
|
|
36
36
|
}
|
|
37
|
-
formatMessage(t,
|
|
38
|
-
const
|
|
37
|
+
formatMessage(t, r, n) {
|
|
38
|
+
const o = [t, r];
|
|
39
39
|
if (n) {
|
|
40
|
-
const l = Object.entries(n).map(([
|
|
41
|
-
l &&
|
|
40
|
+
const l = Object.entries(n).map(([i, s]) => `${i}: ${s}`).join(", ");
|
|
41
|
+
l && o.push(`[${l}]`);
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return o.join(" ");
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Log an error message.
|
|
47
47
|
* @param message - Error message
|
|
48
48
|
* @param args - Additional arguments to log
|
|
49
49
|
*/
|
|
50
|
-
error(t, ...
|
|
50
|
+
error(t, ...r) {
|
|
51
51
|
this.shouldLog(
|
|
52
52
|
3
|
|
53
53
|
/* ERROR */
|
|
54
|
-
) && console.error(this.formatMessage(
|
|
54
|
+
) && console.error(this.formatMessage(z.ERROR, t), ...r);
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Log a warning message.
|
|
58
58
|
* @param message - Warning message
|
|
59
59
|
* @param args - Additional arguments to log
|
|
60
60
|
*/
|
|
61
|
-
warn(t, ...
|
|
61
|
+
warn(t, ...r) {
|
|
62
62
|
this.shouldLog(
|
|
63
63
|
2
|
|
64
64
|
/* WARN */
|
|
65
|
-
) && console.warn(this.formatMessage(
|
|
65
|
+
) && console.warn(this.formatMessage(z.WARN, t), ...r);
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* Log an info message.
|
|
69
69
|
* @param message - Info message
|
|
70
70
|
* @param args - Additional arguments to log
|
|
71
71
|
*/
|
|
72
|
-
info(t, ...
|
|
72
|
+
info(t, ...r) {
|
|
73
73
|
this.shouldLog(
|
|
74
74
|
1
|
|
75
75
|
/* INFO */
|
|
76
|
-
) && console.info(this.formatMessage(
|
|
76
|
+
) && console.info(this.formatMessage(z.INFO, t), ...r);
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* Log a debug message.
|
|
80
80
|
* @param message - Debug message
|
|
81
81
|
* @param args - Additional arguments to log
|
|
82
82
|
*/
|
|
83
|
-
debug(t, ...
|
|
83
|
+
debug(t, ...r) {
|
|
84
84
|
this.shouldLog(
|
|
85
85
|
0
|
|
86
86
|
/* DEBUG */
|
|
87
|
-
) && console.debug(this.formatMessage(
|
|
87
|
+
) && console.debug(this.formatMessage(z.DEBUG, t), ...r);
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* Log an error with context information.
|
|
@@ -92,29 +92,29 @@ class Le {
|
|
|
92
92
|
* @param context - Context object with additional information
|
|
93
93
|
* @param error - Optional error object
|
|
94
94
|
*/
|
|
95
|
-
errorWithContext(t,
|
|
95
|
+
errorWithContext(t, r, n) {
|
|
96
96
|
if (!this.shouldLog(
|
|
97
97
|
3
|
|
98
98
|
/* ERROR */
|
|
99
99
|
)) return;
|
|
100
|
-
const
|
|
101
|
-
n ? console.error(
|
|
100
|
+
const o = this.formatMessage(z.ERROR, t, r);
|
|
101
|
+
n ? console.error(o, n) : console.error(o);
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* Log a warning with context information.
|
|
105
105
|
* @param message - Warning message
|
|
106
106
|
* @param context - Context object with additional information
|
|
107
107
|
*/
|
|
108
|
-
warnWithContext(t,
|
|
108
|
+
warnWithContext(t, r) {
|
|
109
109
|
this.shouldLog(
|
|
110
110
|
2
|
|
111
111
|
/* WARN */
|
|
112
|
-
) && console.warn(this.formatMessage(
|
|
112
|
+
) && console.warn(this.formatMessage(z.WARN, t, r));
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
const
|
|
115
|
+
const N = new De();
|
|
116
|
+
N.init();
|
|
117
|
+
const ue = /* @__PURE__ */ Symbol("isBounded"), Ee = /* @__PURE__ */ Symbol("isProxy"), Ve = [
|
|
118
118
|
"created",
|
|
119
119
|
"beforeMount",
|
|
120
120
|
"mounted",
|
|
@@ -124,51 +124,51 @@ const fe = /* @__PURE__ */ Symbol("isBounded"), ge = /* @__PURE__ */ Symbol("isP
|
|
|
124
124
|
"destroyed",
|
|
125
125
|
"processed"
|
|
126
126
|
];
|
|
127
|
-
function
|
|
128
|
-
if (typeof e != "function" || e[
|
|
127
|
+
function Q(e, t) {
|
|
128
|
+
if (typeof e != "function" || e[ue]) return e;
|
|
129
129
|
const n = e.bind(t);
|
|
130
|
-
return n[
|
|
130
|
+
return n[ue] = !0, n;
|
|
131
131
|
}
|
|
132
132
|
function We(e, t) {
|
|
133
|
-
for (const
|
|
134
|
-
const n = e[
|
|
135
|
-
if (Object.prototype.hasOwnProperty.call(e,
|
|
133
|
+
for (const r in e) {
|
|
134
|
+
const n = e[r];
|
|
135
|
+
if (Object.prototype.hasOwnProperty.call(e, r) && typeof n == "function")
|
|
136
136
|
try {
|
|
137
|
-
e[
|
|
138
|
-
} catch (
|
|
139
|
-
|
|
140
|
-
`Failed to bind method "${
|
|
141
|
-
{ methodName:
|
|
142
|
-
|
|
137
|
+
e[r] = Q(n, t);
|
|
138
|
+
} catch (o) {
|
|
139
|
+
N.errorWithContext(
|
|
140
|
+
`Failed to bind method "${r}"`,
|
|
141
|
+
{ methodName: r },
|
|
142
|
+
o
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function je(e) {
|
|
148
148
|
return /<\/?[a-z][^>]*>/i.test(e);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function se(e, t) {
|
|
151
151
|
if (e == null || typeof t != "string") return;
|
|
152
|
-
const
|
|
152
|
+
const r = t.trim().replace(/\[(\w+)\]/g, ".$1").split(".").filter(Boolean);
|
|
153
153
|
try {
|
|
154
|
-
return
|
|
154
|
+
return r.reduce((n, o) => {
|
|
155
155
|
if (n != null)
|
|
156
|
-
return n[
|
|
156
|
+
return n[o];
|
|
157
157
|
}, e);
|
|
158
158
|
} catch {
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function He(e) {
|
|
163
163
|
return typeof e == "string" ? e.toLowerCase() : typeof e == "function" && typeof e.name == "string" ? e.name.toLowerCase() : "unknown";
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function ve(e) {
|
|
166
166
|
const t = e.trim();
|
|
167
167
|
return /^[a-zA-Z_$][0-9a-zA-Z_$]*(?:\[(?:\d+|\w+)\]|\.[a-zA-Z_$][0-9a-zA-Z_$]*)*$/.test(
|
|
168
168
|
t
|
|
169
169
|
);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Be(e, t, r) {
|
|
172
172
|
if (e == null || typeof e != "object" && typeof e != "function")
|
|
173
173
|
throw new Error("❌ setValueByPath: target must be an object.");
|
|
174
174
|
if (typeof t != "string" || !t.trim())
|
|
@@ -176,40 +176,40 @@ function je(e, t, o) {
|
|
|
176
176
|
const n = t.trim().replace(/\[(\w+)\]/g, ".$1").split(".").filter(Boolean);
|
|
177
177
|
if (n.length === 0)
|
|
178
178
|
throw new Error(`❌ setValueByPath: invalid path "${t}".`);
|
|
179
|
-
const
|
|
180
|
-
let
|
|
179
|
+
const o = (c, a) => Object.prototype.hasOwnProperty.call(c, a), l = n.pop();
|
|
180
|
+
let i = e;
|
|
181
181
|
for (const c of n) {
|
|
182
|
-
if (
|
|
182
|
+
if (i == null || typeof i != "object" && typeof i != "function")
|
|
183
183
|
throw new Error(
|
|
184
184
|
`❌ setValueByPath: invalid path "${t}". Segment "${c}" is not an object.`
|
|
185
185
|
);
|
|
186
|
-
if (!i
|
|
186
|
+
if (!o(i, c))
|
|
187
187
|
throw new Error(
|
|
188
188
|
`❌ setValueByPath: invalid path "${t}". Missing segment "${c}".`
|
|
189
189
|
);
|
|
190
|
-
const a =
|
|
190
|
+
const a = i[c];
|
|
191
191
|
if (a == null || typeof a != "object" && typeof a != "function")
|
|
192
192
|
throw new Error(
|
|
193
193
|
`❌ setValueByPath: invalid path "${t}". Segment "${c}" is not an object.`
|
|
194
194
|
);
|
|
195
|
-
|
|
195
|
+
i = a;
|
|
196
196
|
}
|
|
197
|
-
if (
|
|
197
|
+
if (i == null || typeof i != "object" && typeof i != "function")
|
|
198
198
|
throw new Error(
|
|
199
199
|
`❌ setValueByPath: invalid path "${t}". Final target is not an object.`
|
|
200
200
|
);
|
|
201
|
-
if (!i
|
|
201
|
+
if (!o(i, l))
|
|
202
202
|
throw new Error(
|
|
203
203
|
`❌ setValueByPath: invalid path "${t}". Final key "${l}" does not exist.`
|
|
204
204
|
);
|
|
205
|
-
const s = Object.getOwnPropertyDescriptor(
|
|
205
|
+
const s = Object.getOwnPropertyDescriptor(i, l);
|
|
206
206
|
if (s && s.writable === !1 && !s.set)
|
|
207
207
|
throw new Error(
|
|
208
208
|
`❌ setValueByPath: cannot write "${t}". Property "${l}" is read-only.`
|
|
209
209
|
);
|
|
210
|
-
|
|
210
|
+
i[l] = r;
|
|
211
211
|
}
|
|
212
|
-
const
|
|
212
|
+
const qe = {
|
|
213
213
|
select: {
|
|
214
214
|
get() {
|
|
215
215
|
return (e) => this instanceof HTMLInputElement || this instanceof HTMLTextAreaElement ? (this.select(), null) : this.querySelector(e);
|
|
@@ -252,9 +252,9 @@ const He = {
|
|
|
252
252
|
return (e) => {
|
|
253
253
|
if (!this.parentNode) return [];
|
|
254
254
|
const t = [];
|
|
255
|
-
let
|
|
256
|
-
for (;
|
|
257
|
-
|
|
255
|
+
let r = this.parentNode.firstChild;
|
|
256
|
+
for (; r; )
|
|
257
|
+
r.nodeType === Node.ELEMENT_NODE && r !== this && r instanceof HTMLElement && (e?.(r), t.push(r)), r = r.nextSibling;
|
|
258
258
|
return t;
|
|
259
259
|
};
|
|
260
260
|
}
|
|
@@ -278,51 +278,51 @@ const He = {
|
|
|
278
278
|
return (e, t) => (t !== void 0 && this.setAttribute(e, t || "true"), this.getAttribute(e));
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
},
|
|
282
|
-
function
|
|
281
|
+
}, ze = {};
|
|
282
|
+
function Ue(e) {
|
|
283
283
|
return e.replace(/-./g, (t) => t[1].toUpperCase());
|
|
284
284
|
}
|
|
285
|
-
const
|
|
286
|
-
function
|
|
287
|
-
const t = Object.keys(e),
|
|
288
|
-
if (n && n.fingerprint ===
|
|
285
|
+
const Xe = /(?:\bwindow\b|\bdocument\b|\bglobalThis\b|\bFunction\b|\beval\b|\bsetTimeout\b|\bsetInterval\b|\bfetch\b|\bXMLHttpRequest\b|\bimport\b|\brequire\b|\bthis\b)/, U = /* @__PURE__ */ new Map(), Ge = 1e3, de = /* @__PURE__ */ new WeakMap();
|
|
286
|
+
function Ke(e) {
|
|
287
|
+
const t = Object.keys(e), r = t.join("\0"), n = de.get(e);
|
|
288
|
+
if (n && n.fingerprint === r)
|
|
289
289
|
return n.keys;
|
|
290
|
-
const
|
|
291
|
-
return
|
|
290
|
+
const o = t.sort();
|
|
291
|
+
return de.set(e, { keys: o, fingerprint: r }), o;
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
const
|
|
295
|
-
if (
|
|
293
|
+
function q(e, t = {}) {
|
|
294
|
+
const r = (e ?? "").trim();
|
|
295
|
+
if (r)
|
|
296
296
|
try {
|
|
297
|
-
if (
|
|
297
|
+
if (Xe.test(r))
|
|
298
298
|
return;
|
|
299
|
-
if (
|
|
300
|
-
const
|
|
301
|
-
return typeof
|
|
299
|
+
if (ve(r)) {
|
|
300
|
+
const i = se(t, r);
|
|
301
|
+
return typeof i == "function" ? i.call(t) : i;
|
|
302
302
|
}
|
|
303
|
-
const n =
|
|
304
|
-
let l =
|
|
303
|
+
const n = Ke(t), o = `${r}|${n.join(",")}`;
|
|
304
|
+
let l = U.get(o);
|
|
305
305
|
if (!l) {
|
|
306
|
-
const
|
|
307
|
-
if (l = new Function(...n,
|
|
308
|
-
const s =
|
|
309
|
-
s &&
|
|
306
|
+
const i = `"use strict"; return (${r});`;
|
|
307
|
+
if (l = new Function(...n, i), U.size >= Ge) {
|
|
308
|
+
const s = U.keys().next().value;
|
|
309
|
+
s && U.delete(s);
|
|
310
310
|
}
|
|
311
|
-
|
|
311
|
+
U.set(o, l);
|
|
312
312
|
}
|
|
313
|
-
return l(...n.map((
|
|
313
|
+
return l(...n.map((i) => t[i]));
|
|
314
314
|
} catch (n) {
|
|
315
|
-
|
|
315
|
+
N.debug(`Expression evaluation failed: ${r}`, n);
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function Ze(e) {
|
|
320
320
|
return e.length === 0 ? "" : e.map((t) => `var ${t} = __deps.${t};`).join(`
|
|
321
321
|
`) + `
|
|
322
322
|
`;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
const
|
|
324
|
+
function Ye(e, t) {
|
|
325
|
+
const r = e.replace(/\$-\{/g, "${"), n = t ? Object.keys(t) : [], l = `
|
|
326
326
|
const { $refs, $parent, $emit, $take, $handleEventFromChild, ...rest } = context;
|
|
327
327
|
|
|
328
328
|
// Expose all $*-prefixed context entries (e.g. $router, $store) as local variables
|
|
@@ -335,109 +335,109 @@ function Ke(e, t) {
|
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
// Inject resolved dependencies as local variables
|
|
338
|
-
${
|
|
338
|
+
${Ze(n)}
|
|
339
339
|
|
|
340
|
-
return (${
|
|
340
|
+
return (${r});
|
|
341
341
|
`;
|
|
342
342
|
try {
|
|
343
|
-
const
|
|
344
|
-
return ((c) => t ?
|
|
345
|
-
} catch (
|
|
346
|
-
throw
|
|
343
|
+
const i = t ? new Function("context", "__deps", l) : new Function("context", l);
|
|
344
|
+
return ((c) => t ? i(c, t) : i(c));
|
|
345
|
+
} catch (i) {
|
|
346
|
+
throw N.errorWithContext("Failed to compile dynamic code", { functionBody: l }, i), i;
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function we() {
|
|
350
350
|
return /* @__PURE__ */ new Map();
|
|
351
351
|
}
|
|
352
|
-
const
|
|
353
|
-
function
|
|
354
|
-
e === "global" && (e =
|
|
352
|
+
const _e = we();
|
|
353
|
+
function Ce(e, t, r) {
|
|
354
|
+
e === "global" && (e = _e), e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(r);
|
|
355
355
|
}
|
|
356
|
-
async function
|
|
357
|
-
e === "global" && (e =
|
|
356
|
+
async function I(e, t, r) {
|
|
357
|
+
e === "global" && (e = _e);
|
|
358
358
|
const n = Array.from(e.get(t) ?? []);
|
|
359
|
-
for (const
|
|
359
|
+
for (const o of n)
|
|
360
360
|
try {
|
|
361
|
-
await
|
|
361
|
+
await o(r);
|
|
362
362
|
} catch (l) {
|
|
363
|
-
|
|
363
|
+
N.errorWithContext(`Hook "${t}" callback failed`, { hook: t }, l);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
const
|
|
366
|
+
const J = {
|
|
367
367
|
modules: {},
|
|
368
368
|
plugins: {}
|
|
369
369
|
};
|
|
370
|
-
function
|
|
370
|
+
function Je(e) {
|
|
371
371
|
if (e == null || typeof e != "object") return !1;
|
|
372
372
|
const t = e;
|
|
373
373
|
return typeof t.template == "string" && typeof t.script == "string" && typeof t.style == "string";
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function ee(e) {
|
|
376
376
|
if (e == null || typeof e != "object") return !1;
|
|
377
377
|
const t = e;
|
|
378
378
|
return typeof t.setup == "function" && t.attach === void 0;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function Qe(e) {
|
|
381
381
|
if (e == null || typeof e != "object") return !1;
|
|
382
382
|
const t = e;
|
|
383
383
|
return typeof t.attach == "function" && t.setup === void 0;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function et(e) {
|
|
386
386
|
return e instanceof HTMLElement && "instance" in e && e.instance !== void 0;
|
|
387
387
|
}
|
|
388
|
-
const
|
|
389
|
-
Object.defineProperties(Object.prototype,
|
|
388
|
+
const tt = () => {
|
|
389
|
+
Object.defineProperties(Object.prototype, ze), typeof HTMLElement < "u" && Object.defineProperties(HTMLElement.prototype, qe);
|
|
390
390
|
};
|
|
391
|
-
function
|
|
391
|
+
function X(e) {
|
|
392
392
|
return e.nodeType === Node.ELEMENT_NODE && e.tagName.includes("-");
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
const
|
|
396
|
-
acceptNode: (
|
|
394
|
+
function nt(e, t) {
|
|
395
|
+
const r = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
396
|
+
acceptNode: (o) => X(o) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
|
|
397
397
|
});
|
|
398
|
-
let n =
|
|
398
|
+
let n = r.nextNode();
|
|
399
399
|
for (; n; ) {
|
|
400
|
-
const
|
|
401
|
-
|
|
400
|
+
const o = n.getAttribute(t);
|
|
401
|
+
o !== null && (Se(n) === void 0 && Te(n, o), n.removeAttribute(t)), n = r.nextNode();
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
if (!
|
|
406
|
-
const
|
|
407
|
-
let n =
|
|
408
|
-
const
|
|
404
|
+
function he(e, t) {
|
|
405
|
+
if (!X(e)) return null;
|
|
406
|
+
const r = e.tagName;
|
|
407
|
+
let n = Se(e);
|
|
408
|
+
const o = st(e);
|
|
409
409
|
if (n === void 0 && t) {
|
|
410
410
|
const l = e.getAttribute(t);
|
|
411
|
-
l !== null && (
|
|
411
|
+
l !== null && (Te(e, l), n = l, e.removeAttribute(t));
|
|
412
412
|
}
|
|
413
|
-
return n === void 0 ? null :
|
|
413
|
+
return n === void 0 ? null : o !== void 0 ? `${r}:${String(n)}:${String(o)}` : `${r}:${String(n)}`;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function rt(e, t) {
|
|
416
416
|
return e.nodeType !== t.nodeType ? !1 : e.nodeType === Node.TEXT_NODE || e.nodeType === Node.COMMENT_NODE ? !0 : e.nodeType === Node.ELEMENT_NODE ? e.tagName === t.tagName : !1;
|
|
417
417
|
}
|
|
418
|
-
function
|
|
419
|
-
const
|
|
420
|
-
for (const
|
|
421
|
-
!n.has(
|
|
422
|
-
for (const
|
|
423
|
-
const l = t.getAttribute(
|
|
424
|
-
l !==
|
|
418
|
+
function te(e, t) {
|
|
419
|
+
const r = new Set(e.getAttributeNames()), n = new Set(t.getAttributeNames());
|
|
420
|
+
for (const o of r)
|
|
421
|
+
!n.has(o) && !o.startsWith("@") && e.removeAttribute(o);
|
|
422
|
+
for (const o of n) {
|
|
423
|
+
const l = t.getAttribute(o), i = e.getAttribute(o);
|
|
424
|
+
l !== i && (l === null ? e.removeAttribute(o) : e.setAttribute(o, l));
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
|
-
function Ne(e, t,
|
|
428
|
-
const n = Array.from(e.childNodes),
|
|
427
|
+
function Ne(e, t, r) {
|
|
428
|
+
const n = Array.from(e.childNodes), o = Array.from(t.childNodes), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
429
429
|
for (const s of n) {
|
|
430
|
-
const c =
|
|
430
|
+
const c = he(s, r);
|
|
431
431
|
c !== null && !l.has(c) && l.set(c, s);
|
|
432
432
|
}
|
|
433
|
-
for (let s = 0; s <
|
|
434
|
-
const c =
|
|
433
|
+
for (let s = 0; s < o.length; s++) {
|
|
434
|
+
const c = o[s], a = n[s], u = he(c, r);
|
|
435
435
|
let d = null;
|
|
436
|
-
if (u !== null && l.has(u) && (d = l.get(u),
|
|
437
|
-
a !== d && (s < e.childNodes.length ? e.insertBefore(d, e.childNodes[s]) : e.appendChild(d)),
|
|
436
|
+
if (u !== null && l.has(u) && (d = l.get(u), i.add(d)), d && X(d)) {
|
|
437
|
+
a !== d && (s < e.childNodes.length ? e.insertBefore(d, e.childNodes[s]) : e.appendChild(d)), te(d, c);
|
|
438
438
|
continue;
|
|
439
439
|
}
|
|
440
|
-
if (
|
|
440
|
+
if (X(c) && u !== null) {
|
|
441
441
|
a ? e.replaceChild(c, a) : e.appendChild(c);
|
|
442
442
|
continue;
|
|
443
443
|
}
|
|
@@ -445,7 +445,7 @@ function Ne(e, t, o) {
|
|
|
445
445
|
e.appendChild(c);
|
|
446
446
|
continue;
|
|
447
447
|
}
|
|
448
|
-
if (!
|
|
448
|
+
if (!rt(a, c)) {
|
|
449
449
|
e.replaceChild(c, a);
|
|
450
450
|
continue;
|
|
451
451
|
}
|
|
@@ -458,124 +458,124 @@ function Ne(e, t, o) {
|
|
|
458
458
|
continue;
|
|
459
459
|
}
|
|
460
460
|
if (a.nodeType === Node.ELEMENT_NODE) {
|
|
461
|
-
const v = a,
|
|
462
|
-
if (
|
|
463
|
-
|
|
461
|
+
const v = a, A = c;
|
|
462
|
+
if (X(v)) {
|
|
463
|
+
te(v, A);
|
|
464
464
|
continue;
|
|
465
465
|
}
|
|
466
|
-
|
|
466
|
+
te(v, A), Ne(v, A, r);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
for (; e.childNodes.length >
|
|
469
|
+
for (; e.childNodes.length > o.length; ) {
|
|
470
470
|
const s = e.lastChild;
|
|
471
471
|
s && e.removeChild(s);
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
if (
|
|
476
|
-
n &&
|
|
474
|
+
function ot(e, t, r, n) {
|
|
475
|
+
if (r || e.childNodes.length === 0) {
|
|
476
|
+
n && nt(t, n), e.replaceChildren(t);
|
|
477
477
|
return;
|
|
478
478
|
}
|
|
479
|
-
const
|
|
480
|
-
|
|
479
|
+
const o = document.createElement("div");
|
|
480
|
+
o.appendChild(t), Ne(e, o, n);
|
|
481
481
|
}
|
|
482
|
-
const
|
|
483
|
-
function
|
|
482
|
+
const ce = /* @__PURE__ */ Symbol("STRUCT_ID"), ae = /* @__PURE__ */ Symbol("SLOT_ID");
|
|
483
|
+
function Ae(e, t, r) {
|
|
484
484
|
Object.defineProperty(e, t, {
|
|
485
|
-
value:
|
|
485
|
+
value: r,
|
|
486
486
|
writable: !0,
|
|
487
487
|
configurable: !0,
|
|
488
488
|
enumerable: !1
|
|
489
489
|
});
|
|
490
490
|
}
|
|
491
|
-
function
|
|
492
|
-
|
|
491
|
+
function Te(e, t) {
|
|
492
|
+
Ae(e, ce, t);
|
|
493
493
|
}
|
|
494
|
-
function
|
|
495
|
-
return Object.prototype.hasOwnProperty.call(e,
|
|
494
|
+
function Se(e) {
|
|
495
|
+
return Object.prototype.hasOwnProperty.call(e, ce) ? e[ce] : void 0;
|
|
496
496
|
}
|
|
497
|
-
function
|
|
498
|
-
|
|
497
|
+
function it(e, t) {
|
|
498
|
+
Ae(e, ae, t);
|
|
499
499
|
}
|
|
500
|
-
function
|
|
501
|
-
return Object.prototype.hasOwnProperty.call(e,
|
|
500
|
+
function st(e) {
|
|
501
|
+
return Object.prototype.hasOwnProperty.call(e, ae) ? e[ae] : void 0;
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function ct(e, t, r, n) {
|
|
504
504
|
if (!Array.isArray(t)) return () => {
|
|
505
505
|
};
|
|
506
|
-
const
|
|
507
|
-
return t.forEach(([l,
|
|
506
|
+
const o = [];
|
|
507
|
+
return t.forEach(([l, i, s]) => {
|
|
508
508
|
if (typeof l != "string" || typeof s != "function") {
|
|
509
|
-
|
|
509
|
+
N.error("Provided handler is not a function", s);
|
|
510
510
|
return;
|
|
511
511
|
}
|
|
512
512
|
let c = [];
|
|
513
|
-
if (
|
|
513
|
+
if (i === "window")
|
|
514
514
|
c = [window];
|
|
515
|
-
else if (typeof
|
|
516
|
-
if (
|
|
517
|
-
const [a, ...u] =
|
|
515
|
+
else if (typeof i == "string")
|
|
516
|
+
if (i.startsWith("$refs.")) {
|
|
517
|
+
const [a, ...u] = i.slice(6).split(" "), d = n[a];
|
|
518
518
|
d && (c = u.length ? Array.from(d.querySelectorAll(u.join(" "))) : [d]);
|
|
519
519
|
} else
|
|
520
|
-
c = Array.from(
|
|
521
|
-
else if (
|
|
522
|
-
c = [
|
|
523
|
-
else if (typeof
|
|
524
|
-
const { ref: a, selector: u } =
|
|
520
|
+
c = Array.from(r.querySelectorAll(i));
|
|
521
|
+
else if (i instanceof Element || i instanceof Window)
|
|
522
|
+
c = [i];
|
|
523
|
+
else if (typeof i == "object" && i && "ref" in i) {
|
|
524
|
+
const { ref: a, selector: u } = i, d = n[a];
|
|
525
525
|
d && (c = u ? Array.from(d.querySelectorAll(u)) : [d]);
|
|
526
526
|
}
|
|
527
527
|
for (const a of c) {
|
|
528
|
-
const u =
|
|
529
|
-
a.addEventListener(l, u),
|
|
528
|
+
const u = Q(s, e);
|
|
529
|
+
a.addEventListener(l, u), o.push({ target: a, type: l, handler: u });
|
|
530
530
|
}
|
|
531
531
|
}), () => {
|
|
532
|
-
for (const { target: l, type:
|
|
533
|
-
l.removeEventListener(
|
|
534
|
-
|
|
532
|
+
for (const { target: l, type: i, handler: s } of o)
|
|
533
|
+
l.removeEventListener(i, s);
|
|
534
|
+
o.length = 0;
|
|
535
535
|
};
|
|
536
536
|
}
|
|
537
|
-
const
|
|
538
|
-
function
|
|
539
|
-
const
|
|
540
|
-
let n =
|
|
537
|
+
const xe = /^on([a-z]+)$/i;
|
|
538
|
+
function at(e, t) {
|
|
539
|
+
const r = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT);
|
|
540
|
+
let n = r.nextNode();
|
|
541
541
|
for (; n; ) {
|
|
542
|
-
for (const
|
|
543
|
-
const l =
|
|
542
|
+
for (const o of Array.from(n.attributes)) {
|
|
543
|
+
const l = o.name.match(xe);
|
|
544
544
|
if (l) {
|
|
545
|
-
const
|
|
545
|
+
const i = l[1].toLowerCase(), s = o.value;
|
|
546
546
|
if (s) {
|
|
547
547
|
const c = e[s];
|
|
548
|
-
typeof c == "function" && (n.removeAttribute(
|
|
548
|
+
typeof c == "function" && (n.removeAttribute(o.name), n.addEventListener(i, c));
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
n =
|
|
552
|
+
n = r.nextNode();
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
const
|
|
557
|
-
let n =
|
|
555
|
+
function lt(e, t) {
|
|
556
|
+
const r = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT);
|
|
557
|
+
let n = r.nextNode();
|
|
558
558
|
for (; n; ) {
|
|
559
|
-
for (const
|
|
560
|
-
const l =
|
|
559
|
+
for (const o of Array.from(n.attributes)) {
|
|
560
|
+
const l = o.name.match(xe);
|
|
561
561
|
if (l) {
|
|
562
|
-
const
|
|
562
|
+
const i = l[1].toLowerCase(), s = o.value;
|
|
563
563
|
if (s) {
|
|
564
564
|
const c = e[s];
|
|
565
|
-
typeof c == "function" && (n.removeAttribute(
|
|
565
|
+
typeof c == "function" && (n.removeAttribute(o.name), n.addEventListener(i, c));
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
n =
|
|
569
|
+
n = r.nextNode();
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
function
|
|
573
|
-
if (!Array.isArray(
|
|
572
|
+
function ft(e, t, r, n, o) {
|
|
573
|
+
if (!Array.isArray(r)) return () => {
|
|
574
574
|
};
|
|
575
575
|
const l = [];
|
|
576
|
-
return
|
|
577
|
-
if (typeof
|
|
578
|
-
|
|
576
|
+
return r.forEach(([i, s, c]) => {
|
|
577
|
+
if (typeof i != "string" || typeof c != "function") {
|
|
578
|
+
N.error("Provided handler is not a function", c);
|
|
579
579
|
return;
|
|
580
580
|
}
|
|
581
581
|
let a = [];
|
|
@@ -583,208 +583,208 @@ function at(e, t, o, n, i) {
|
|
|
583
583
|
a = [window];
|
|
584
584
|
else if (typeof s == "string")
|
|
585
585
|
if (s.startsWith("$refs.")) {
|
|
586
|
-
const [u, ...d] = s.slice(6).split(" "), v =
|
|
586
|
+
const [u, ...d] = s.slice(6).split(" "), v = o[u];
|
|
587
587
|
v && (a = d.length ? Array.from(v.querySelectorAll(d.join(" "))) : [v]);
|
|
588
588
|
} else
|
|
589
589
|
a = Array.from(n.querySelectorAll(s));
|
|
590
590
|
else if (s instanceof Element || s instanceof Window)
|
|
591
591
|
a = [s];
|
|
592
592
|
else if (typeof s == "object" && s && "ref" in s) {
|
|
593
|
-
const { ref: u, selector: d } = s, v =
|
|
593
|
+
const { ref: u, selector: d } = s, v = o[u];
|
|
594
594
|
v && (a = d ? Array.from(v.querySelectorAll(d)) : [v]);
|
|
595
595
|
}
|
|
596
596
|
for (const u of a) {
|
|
597
|
-
const d =
|
|
598
|
-
u.addEventListener(
|
|
597
|
+
const d = Q(c, t);
|
|
598
|
+
u.addEventListener(i, d), l.push({ target: u, type: i, handler: d });
|
|
599
599
|
}
|
|
600
600
|
}), () => {
|
|
601
|
-
for (const { target:
|
|
602
|
-
|
|
601
|
+
for (const { target: i, type: s, handler: c } of l)
|
|
602
|
+
i.removeEventListener(s, c);
|
|
603
603
|
l.length = 0;
|
|
604
604
|
};
|
|
605
605
|
}
|
|
606
|
-
const
|
|
607
|
-
let
|
|
608
|
-
function
|
|
606
|
+
const j = /* @__PURE__ */ new WeakMap();
|
|
607
|
+
let ne;
|
|
608
|
+
function ut() {
|
|
609
609
|
if (typeof EventTarget > "u") return;
|
|
610
610
|
const e = globalThis;
|
|
611
611
|
if (e.__koppajsEventTrackingPatched) return;
|
|
612
612
|
e.__koppajsEventTrackingPatched = !0;
|
|
613
|
-
const t = EventTarget.prototype.addEventListener,
|
|
614
|
-
EventTarget.prototype.addEventListener = function(n,
|
|
615
|
-
return
|
|
616
|
-
}, EventTarget.prototype.removeEventListener = function(n,
|
|
617
|
-
const
|
|
618
|
-
if (
|
|
619
|
-
for (const s of
|
|
620
|
-
if (s.type === n && s.listener ===
|
|
621
|
-
|
|
613
|
+
const t = EventTarget.prototype.addEventListener, r = EventTarget.prototype.removeEventListener;
|
|
614
|
+
EventTarget.prototype.addEventListener = function(n, o, l) {
|
|
615
|
+
return j.has(this) || j.set(this, /* @__PURE__ */ new Set()), j.get(this).add({ type: n, listener: o, options: l }), t.call(this, n, o, l);
|
|
616
|
+
}, EventTarget.prototype.removeEventListener = function(n, o, l) {
|
|
617
|
+
const i = j.get(this);
|
|
618
|
+
if (i) {
|
|
619
|
+
for (const s of i)
|
|
620
|
+
if (s.type === n && s.listener === o) {
|
|
621
|
+
i.delete(s);
|
|
622
622
|
break;
|
|
623
623
|
}
|
|
624
|
-
|
|
624
|
+
i.size === 0 && j.delete(this);
|
|
625
625
|
}
|
|
626
|
-
return
|
|
626
|
+
return r.call(this, n, o, l);
|
|
627
627
|
};
|
|
628
628
|
}
|
|
629
|
-
function
|
|
630
|
-
const t =
|
|
629
|
+
function dt(e) {
|
|
630
|
+
const t = j.get(e);
|
|
631
631
|
if (t) {
|
|
632
|
-
for (const { type:
|
|
633
|
-
e.removeEventListener(
|
|
634
|
-
|
|
632
|
+
for (const { type: r, listener: n, options: o } of t)
|
|
633
|
+
e.removeEventListener(r, n, o);
|
|
634
|
+
j.delete(e);
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
-
function
|
|
637
|
+
function Pe(e) {
|
|
638
638
|
if (typeof document > "u" || typeof NodeFilter > "u" || typeof Element > "u")
|
|
639
639
|
return;
|
|
640
640
|
const t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT);
|
|
641
|
-
let
|
|
642
|
-
for (;
|
|
643
|
-
|
|
641
|
+
let r = e instanceof Element ? e : null;
|
|
642
|
+
for (; r; )
|
|
643
|
+
j.has(r) && dt(r), r = t.nextNode();
|
|
644
644
|
}
|
|
645
|
-
function
|
|
646
|
-
|
|
645
|
+
function ht() {
|
|
646
|
+
ne || typeof MutationObserver > "u" || typeof document > "u" || document.body && (ne = new MutationObserver((e) => {
|
|
647
647
|
for (const t of e)
|
|
648
|
-
t.removedNodes.forEach((
|
|
649
|
-
|
|
648
|
+
t.removedNodes.forEach((r) => {
|
|
649
|
+
r.nodeType !== Node.ELEMENT_NODE || r.isConnected || Pe(r);
|
|
650
650
|
});
|
|
651
|
-
}),
|
|
651
|
+
}), ne.observe(document.body, { childList: !0, subtree: !0 }));
|
|
652
652
|
}
|
|
653
|
-
const
|
|
654
|
-
let
|
|
655
|
-
const
|
|
656
|
-
const t =
|
|
657
|
-
return t &&
|
|
653
|
+
const ke = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap();
|
|
654
|
+
let pt = 0;
|
|
655
|
+
const B = () => `slot-${++pt}`, L = (e) => typeof e == "object" && e !== null, re = (e) => typeof e == "symbol" ? e.toString() : String(e), mt = (e) => {
|
|
656
|
+
const t = ke.get(e);
|
|
657
|
+
return t && L(t) ? t : void 0;
|
|
658
658
|
};
|
|
659
659
|
function Oe(e) {
|
|
660
|
-
const t =
|
|
660
|
+
const t = Re.get(e);
|
|
661
661
|
return t || e;
|
|
662
662
|
}
|
|
663
|
-
const
|
|
664
|
-
function
|
|
665
|
-
const t =
|
|
666
|
-
return
|
|
663
|
+
const W = (e) => L(e) ? Reflect.get(e, Ee) === !0 : !1;
|
|
664
|
+
function yt(e) {
|
|
665
|
+
const t = W(e) ? Oe(e) : e;
|
|
666
|
+
return G.get(t);
|
|
667
667
|
}
|
|
668
|
-
const
|
|
669
|
-
let t =
|
|
670
|
-
return t || (t = e.map(() =>
|
|
671
|
-
},
|
|
672
|
-
const t =
|
|
668
|
+
const gt = (e) => e !== null && (typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "function" || typeof e > "u"), Y = (e) => {
|
|
669
|
+
let t = G.get(e);
|
|
670
|
+
return t || (t = e.map(() => B()), G.set(e, t)), t;
|
|
671
|
+
}, pe = (e) => {
|
|
672
|
+
const t = G.get(e);
|
|
673
673
|
if (t && t.length !== e.length)
|
|
674
674
|
throw new Error(
|
|
675
675
|
`Slot sidecar invariant violation: slotIds length (${t.length}) does not match array length (${e.length})`
|
|
676
676
|
);
|
|
677
677
|
};
|
|
678
|
-
function
|
|
679
|
-
const t = /* @__PURE__ */ new Set(),
|
|
680
|
-
let n = 0,
|
|
681
|
-
const l = /* @__PURE__ */ new Map(),
|
|
682
|
-
const b =
|
|
683
|
-
return b ? `${b}.${
|
|
678
|
+
function bt(e) {
|
|
679
|
+
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new WeakMap();
|
|
680
|
+
let n = 0, o = /* @__PURE__ */ new Set();
|
|
681
|
+
const l = /* @__PURE__ */ new Map(), i = (f, h) => !!(f === h || f.startsWith(h + ".")), s = (f, h) => {
|
|
682
|
+
const b = r.get(f) ?? "";
|
|
683
|
+
return b ? `${b}.${h}` : h;
|
|
684
684
|
};
|
|
685
685
|
let c = !1;
|
|
686
686
|
const a = (f) => {
|
|
687
|
-
|
|
688
|
-
c = !1, t.forEach((
|
|
687
|
+
o.add(f), n++, c || (c = !0, queueMicrotask(() => {
|
|
688
|
+
c = !1, t.forEach((h) => {
|
|
689
689
|
try {
|
|
690
|
-
|
|
690
|
+
h();
|
|
691
691
|
} catch (b) {
|
|
692
692
|
console.error("Observer error:", b);
|
|
693
693
|
}
|
|
694
694
|
});
|
|
695
695
|
}));
|
|
696
|
-
}, u = (f,
|
|
697
|
-
if (f ===
|
|
698
|
-
let
|
|
699
|
-
if (!
|
|
700
|
-
for (let
|
|
701
|
-
if (f[
|
|
702
|
-
|
|
696
|
+
}, u = (f, h, b) => {
|
|
697
|
+
if (f === h) return;
|
|
698
|
+
let _ = f.length !== h.length;
|
|
699
|
+
if (!_) {
|
|
700
|
+
for (let p = 0; p < f.length; p++)
|
|
701
|
+
if (f[p] !== h[p]) {
|
|
702
|
+
_ = !0;
|
|
703
703
|
break;
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
|
-
f.splice(0, f.length, ...
|
|
707
|
-
}, d = (f,
|
|
708
|
-
const
|
|
709
|
-
let
|
|
710
|
-
for (const E of
|
|
711
|
-
if (!
|
|
712
|
-
|
|
706
|
+
f.splice(0, f.length, ...h), _ && a(b);
|
|
707
|
+
}, d = (f, h, b) => {
|
|
708
|
+
const _ = new Set(f), p = new Set(h);
|
|
709
|
+
let y = !1;
|
|
710
|
+
for (const E of _)
|
|
711
|
+
if (!p.has(E)) {
|
|
712
|
+
y = !0;
|
|
713
713
|
break;
|
|
714
714
|
}
|
|
715
|
-
if (!
|
|
716
|
-
for (const E of
|
|
717
|
-
if (!
|
|
718
|
-
|
|
715
|
+
if (!y) {
|
|
716
|
+
for (const E of p)
|
|
717
|
+
if (!_.has(E)) {
|
|
718
|
+
y = !0;
|
|
719
719
|
break;
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
|
-
|
|
723
|
-
}, v = (f,
|
|
724
|
-
const
|
|
725
|
-
f.length !==
|
|
726
|
-
},
|
|
727
|
-
if (f ===
|
|
728
|
-
let
|
|
729
|
-
for (const
|
|
730
|
-
|
|
731
|
-
for (const
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
|
|
722
|
+
y && (f.splice(0, f.length, ...h), a(b));
|
|
723
|
+
}, v = (f, h, b) => {
|
|
724
|
+
const _ = new Set(f), p = new Set(h);
|
|
725
|
+
f.length !== h.length || [..._].some((E) => !p.has(E)) || [...p].some((E) => !_.has(E)) ? d(f, h, b) : u(f, h, b);
|
|
726
|
+
}, A = (f, h, b) => {
|
|
727
|
+
if (f === h) return !1;
|
|
728
|
+
let _ = !1;
|
|
729
|
+
for (const p of Object.keys(f))
|
|
730
|
+
p in h || (_ = !0, Reflect.deleteProperty(f, p));
|
|
731
|
+
for (const p of Object.keys(h)) {
|
|
732
|
+
const y = f[p], E = h[p];
|
|
733
|
+
y !== E && (L(y) && W(y) && L(E) && !W(E) ? (A(
|
|
734
|
+
y,
|
|
735
735
|
E
|
|
736
|
-
) && (
|
|
736
|
+
) && (_ = !0), y !== E && (_ = !0, Reflect.set(f, p, E))) : (_ = !0, Reflect.set(f, p, E)));
|
|
737
737
|
}
|
|
738
|
-
return
|
|
739
|
-
},
|
|
740
|
-
const
|
|
741
|
-
switch (
|
|
738
|
+
return _;
|
|
739
|
+
}, R = (f, h, b) => {
|
|
740
|
+
const _ = Y(f);
|
|
741
|
+
switch (h) {
|
|
742
742
|
case "push": {
|
|
743
|
-
const
|
|
744
|
-
|
|
743
|
+
const p = Array.from({ length: b.length }, () => B());
|
|
744
|
+
_.push(...p);
|
|
745
745
|
break;
|
|
746
746
|
}
|
|
747
747
|
case "pop": {
|
|
748
|
-
|
|
748
|
+
_.pop();
|
|
749
749
|
break;
|
|
750
750
|
}
|
|
751
751
|
case "shift": {
|
|
752
|
-
|
|
752
|
+
_.shift();
|
|
753
753
|
break;
|
|
754
754
|
}
|
|
755
755
|
case "unshift": {
|
|
756
|
-
const
|
|
757
|
-
|
|
756
|
+
const p = Array.from({ length: b.length }, () => B());
|
|
757
|
+
_.unshift(...p);
|
|
758
758
|
break;
|
|
759
759
|
}
|
|
760
760
|
case "splice": {
|
|
761
|
-
const
|
|
761
|
+
const p = b[0] ?? 0, y = b[1] !== void 0 ? b[1] : f.length - p, E = b.slice(2), S = Array.from(
|
|
762
762
|
{ length: E.length },
|
|
763
|
-
() =>
|
|
763
|
+
() => B()
|
|
764
764
|
);
|
|
765
|
-
|
|
765
|
+
_.splice(p, y, ...S);
|
|
766
766
|
break;
|
|
767
767
|
}
|
|
768
768
|
case "reverse": {
|
|
769
|
-
|
|
769
|
+
_.reverse();
|
|
770
770
|
break;
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
|
|
774
|
-
},
|
|
773
|
+
pe(f);
|
|
774
|
+
}, w = (f, h = "") => {
|
|
775
775
|
if (f instanceof Node || f instanceof Window || f instanceof Document)
|
|
776
776
|
return f;
|
|
777
|
-
const b =
|
|
777
|
+
const b = mt(f);
|
|
778
778
|
if (b) return b;
|
|
779
|
-
|
|
780
|
-
const
|
|
781
|
-
get: (
|
|
782
|
-
if (
|
|
783
|
-
if (
|
|
779
|
+
h && r.set(f, h), Array.isArray(f) && Y(f);
|
|
780
|
+
const _ = new Proxy(f, {
|
|
781
|
+
get: (p, y, E) => {
|
|
782
|
+
if (y === Ee) return !0;
|
|
783
|
+
if (y === "toJSON")
|
|
784
784
|
return function() {
|
|
785
|
-
return Oe(
|
|
785
|
+
return Oe(p);
|
|
786
786
|
};
|
|
787
|
-
if (Array.isArray(
|
|
787
|
+
if (Array.isArray(p) && typeof y == "string" && [
|
|
788
788
|
"push",
|
|
789
789
|
"pop",
|
|
790
790
|
"shift",
|
|
@@ -792,86 +792,86 @@ function yt(e) {
|
|
|
792
792
|
"splice",
|
|
793
793
|
"reverse",
|
|
794
794
|
"sort"
|
|
795
|
-
].includes(
|
|
796
|
-
const
|
|
797
|
-
if (typeof
|
|
795
|
+
].includes(y)) {
|
|
796
|
+
const k = p[y];
|
|
797
|
+
if (typeof k == "function")
|
|
798
798
|
return function(...D) {
|
|
799
|
-
if (
|
|
800
|
-
const
|
|
801
|
-
el:
|
|
802
|
-
slotId:
|
|
803
|
-
})),
|
|
804
|
-
for (let
|
|
805
|
-
const
|
|
806
|
-
let
|
|
807
|
-
|
|
799
|
+
if (y === "sort") {
|
|
800
|
+
const O = Y(p), $ = p.map((m, g) => ({
|
|
801
|
+
el: m,
|
|
802
|
+
slotId: O[g] || B()
|
|
803
|
+
})), V = k.apply(this, D), K = /* @__PURE__ */ new Map();
|
|
804
|
+
for (let m = 0; m < $.length; m++) {
|
|
805
|
+
const g = $[m].el;
|
|
806
|
+
let C = K.get(g);
|
|
807
|
+
C || (C = [], K.set(g, C)), C.push(m);
|
|
808
808
|
}
|
|
809
|
-
for (let
|
|
810
|
-
const
|
|
811
|
-
if (
|
|
812
|
-
const
|
|
813
|
-
|
|
809
|
+
for (let m = 0; m < p.length; m++) {
|
|
810
|
+
const g = p[m], C = K.get(g);
|
|
811
|
+
if (C && C.length > 0) {
|
|
812
|
+
const M = C.shift();
|
|
813
|
+
O[m] = $[M].slotId;
|
|
814
814
|
} else
|
|
815
|
-
|
|
815
|
+
O[m] = B();
|
|
816
816
|
}
|
|
817
|
-
return
|
|
817
|
+
return pe(p), V;
|
|
818
818
|
} else {
|
|
819
|
-
const
|
|
820
|
-
return
|
|
819
|
+
const O = k.apply(this, D);
|
|
820
|
+
return R(p, y, D), O;
|
|
821
821
|
}
|
|
822
822
|
};
|
|
823
823
|
}
|
|
824
|
-
const
|
|
825
|
-
if (
|
|
826
|
-
const
|
|
827
|
-
return
|
|
824
|
+
const S = Reflect.get(p, y, E), x = Array.isArray(p) && typeof y == "string" && /^\d+$/.test(y);
|
|
825
|
+
if (L(S) && !W(S) && !x && (Array.isArray(S) || !Array.isArray(p))) {
|
|
826
|
+
const T = re(y), k = s(p, T);
|
|
827
|
+
return w(S, k);
|
|
828
828
|
}
|
|
829
|
-
return
|
|
829
|
+
return S;
|
|
830
830
|
},
|
|
831
|
-
set: (
|
|
832
|
-
const
|
|
833
|
-
if (
|
|
834
|
-
const
|
|
835
|
-
if (Array.isArray(
|
|
836
|
-
const
|
|
837
|
-
if (
|
|
838
|
-
const $ = Reflect.set(
|
|
839
|
-
return a(
|
|
831
|
+
set: (p, y, E, S) => {
|
|
832
|
+
const x = Reflect.get(p, y, S);
|
|
833
|
+
if (x === E) return !0;
|
|
834
|
+
const T = re(y), k = s(p, T);
|
|
835
|
+
if (Array.isArray(p) && typeof y == "string" && /^\d+$/.test(y)) {
|
|
836
|
+
const O = parseInt(y, 10);
|
|
837
|
+
if (O >= 0 && O < p.length) {
|
|
838
|
+
const $ = Reflect.set(p, y, E, S);
|
|
839
|
+
return a(k), $;
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
|
-
if (Array.isArray(
|
|
843
|
-
v(
|
|
844
|
-
const
|
|
845
|
-
return
|
|
842
|
+
if (Array.isArray(x) && !gt(E) && Array.isArray(E)) {
|
|
843
|
+
v(x, E, k);
|
|
844
|
+
const O = x.map(() => B());
|
|
845
|
+
return G.set(x, O), !0;
|
|
846
846
|
}
|
|
847
|
-
if (
|
|
848
|
-
if (
|
|
849
|
-
|
|
847
|
+
if (L(x) && W(x) && L(E) && !W(E)) {
|
|
848
|
+
if (A(
|
|
849
|
+
x,
|
|
850
850
|
E
|
|
851
851
|
)) {
|
|
852
852
|
let $ = E;
|
|
853
|
-
|
|
853
|
+
L($) && !W($) && ($ = w($, k)), Reflect.set(p, y, $, S), a(k);
|
|
854
854
|
}
|
|
855
855
|
return !0;
|
|
856
856
|
}
|
|
857
|
-
const D = Reflect.set(
|
|
858
|
-
if (
|
|
859
|
-
const
|
|
860
|
-
Reflect.set(
|
|
857
|
+
const D = Reflect.set(p, y, E, S);
|
|
858
|
+
if (L(E) && !W(E)) {
|
|
859
|
+
const O = w(E, k);
|
|
860
|
+
Reflect.set(p, y, O, S), Array.isArray(E) && Y(E);
|
|
861
861
|
}
|
|
862
|
-
return a(
|
|
862
|
+
return a(k), D;
|
|
863
863
|
},
|
|
864
|
-
deleteProperty: (
|
|
865
|
-
if (
|
|
866
|
-
return Reflect.deleteProperty(
|
|
867
|
-
const E =
|
|
868
|
-
return
|
|
864
|
+
deleteProperty: (p, y) => {
|
|
865
|
+
if (y === "changedPaths")
|
|
866
|
+
return Reflect.deleteProperty(p, y);
|
|
867
|
+
const E = re(y), S = s(p, E), x = Reflect.get(p, y), T = Reflect.deleteProperty(p, y);
|
|
868
|
+
return T && x !== void 0 && a(S), T;
|
|
869
869
|
}
|
|
870
870
|
});
|
|
871
|
-
return
|
|
871
|
+
return ke.set(f, _), Re.set(_, f), _;
|
|
872
872
|
};
|
|
873
873
|
return {
|
|
874
|
-
state:
|
|
874
|
+
state: w(e),
|
|
875
875
|
/**
|
|
876
876
|
* Registers a watcher for a path prefix.
|
|
877
877
|
* The callback is called at most once per flush cycle with the subset of
|
|
@@ -884,15 +884,15 @@ function yt(e) {
|
|
|
884
884
|
* @param cb - Callback receiving { changedPaths: Set<string> } with matching paths
|
|
885
885
|
* @returns A cleanup function stop() that unregisters this watcher (idempotent)
|
|
886
886
|
*/
|
|
887
|
-
watch(f,
|
|
887
|
+
watch(f, h) {
|
|
888
888
|
let b = l.get(f);
|
|
889
|
-
b || (b = /* @__PURE__ */ new Set(), l.set(f, b)), b.add(
|
|
890
|
-
let
|
|
889
|
+
b || (b = /* @__PURE__ */ new Set(), l.set(f, b)), b.add(h);
|
|
890
|
+
let _ = !1;
|
|
891
891
|
return () => {
|
|
892
|
-
if (
|
|
893
|
-
|
|
894
|
-
const
|
|
895
|
-
|
|
892
|
+
if (_) return;
|
|
893
|
+
_ = !0;
|
|
894
|
+
const p = l.get(f);
|
|
895
|
+
p && (p.delete(h), p.size === 0 && l.delete(f));
|
|
896
896
|
};
|
|
897
897
|
},
|
|
898
898
|
addObserver(f) {
|
|
@@ -911,9 +911,9 @@ function yt(e) {
|
|
|
911
911
|
* @returns True if at least one pending change matches a prefix
|
|
912
912
|
*/
|
|
913
913
|
hasPendingChangesFor(f) {
|
|
914
|
-
for (const
|
|
914
|
+
for (const h of o)
|
|
915
915
|
for (const b of f)
|
|
916
|
-
if (
|
|
916
|
+
if (h === b || h.startsWith(b + ".")) return !0;
|
|
917
917
|
return !1;
|
|
918
918
|
},
|
|
919
919
|
/**
|
|
@@ -924,50 +924,50 @@ function yt(e) {
|
|
|
924
924
|
* @returns A copy of all changed paths since the last flush
|
|
925
925
|
*/
|
|
926
926
|
flushChanges() {
|
|
927
|
-
const f = new Set(
|
|
927
|
+
const f = new Set(o);
|
|
928
928
|
if (f.size > 0 && l.size > 0) {
|
|
929
|
-
const
|
|
930
|
-
for (const [b,
|
|
931
|
-
const
|
|
932
|
-
for (const
|
|
933
|
-
|
|
934
|
-
if (
|
|
935
|
-
for (const
|
|
936
|
-
const E =
|
|
929
|
+
const h = /* @__PURE__ */ new Map();
|
|
930
|
+
for (const [b, _] of l) {
|
|
931
|
+
const p = /* @__PURE__ */ new Set();
|
|
932
|
+
for (const y of f)
|
|
933
|
+
i(y, b) && p.add(y);
|
|
934
|
+
if (p.size > 0)
|
|
935
|
+
for (const y of _) {
|
|
936
|
+
const E = h.get(y);
|
|
937
937
|
if (E)
|
|
938
|
-
for (const
|
|
939
|
-
E.add(
|
|
938
|
+
for (const S of p)
|
|
939
|
+
E.add(S);
|
|
940
940
|
else
|
|
941
|
-
|
|
941
|
+
h.set(y, new Set(p));
|
|
942
942
|
}
|
|
943
943
|
}
|
|
944
|
-
for (const [b,
|
|
945
|
-
b({ changedPaths:
|
|
944
|
+
for (const [b, _] of h)
|
|
945
|
+
b({ changedPaths: _ });
|
|
946
946
|
}
|
|
947
|
-
return
|
|
947
|
+
return o = /* @__PURE__ */ new Set(), f;
|
|
948
948
|
}
|
|
949
949
|
};
|
|
950
950
|
}
|
|
951
|
-
const
|
|
952
|
-
function
|
|
951
|
+
const oe = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
952
|
+
function Et(e) {
|
|
953
953
|
const t = e.trim();
|
|
954
954
|
if (t.startsWith("[") && t.endsWith("]")) {
|
|
955
|
-
const n = t.slice(1, -1).split(",").map((
|
|
955
|
+
const n = t.slice(1, -1).split(",").map((i) => i.trim());
|
|
956
956
|
if (n.length !== 2)
|
|
957
957
|
throw new Error("Invalid loop binding: expected <id> or [<id>, <id>]");
|
|
958
|
-
const [
|
|
959
|
-
if (!
|
|
958
|
+
const [o, l] = n;
|
|
959
|
+
if (!oe.test(o) || !oe.test(l))
|
|
960
960
|
throw new Error("Invalid loop binding: expected <id> or [<id>, <id>]");
|
|
961
|
-
return { type: "tuple", keyVar:
|
|
961
|
+
return { type: "tuple", keyVar: o, itemVar: l };
|
|
962
962
|
}
|
|
963
|
-
if (!
|
|
963
|
+
if (!oe.test(t))
|
|
964
964
|
throw new Error("Invalid loop binding: expected <id> or [<id>, <id>]");
|
|
965
965
|
return { type: "single", itemVar: t };
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function vt(e) {
|
|
968
968
|
const t = {
|
|
969
|
-
acceptNode(
|
|
970
|
-
return
|
|
969
|
+
acceptNode(r) {
|
|
970
|
+
return r.nodeType === Node.ELEMENT_NODE || r.nodeType === Node.TEXT_NODE && /\{\{(.+?)\}\}/g.test(r.nodeValue || "") ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
971
971
|
}
|
|
972
972
|
};
|
|
973
973
|
return document.createTreeWalker(
|
|
@@ -976,80 +976,80 @@ function bt(e) {
|
|
|
976
976
|
t
|
|
977
977
|
);
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function wt(e) {
|
|
980
980
|
const t = e.currentNode;
|
|
981
981
|
return t?.nextSibling ? e.currentNode = t.nextSibling : e.nextNode();
|
|
982
982
|
}
|
|
983
|
-
function
|
|
984
|
-
let
|
|
985
|
-
if (!
|
|
983
|
+
function _t(e, t) {
|
|
984
|
+
let r = t.nextSibling;
|
|
985
|
+
if (!r) {
|
|
986
986
|
let n = t.parentNode;
|
|
987
987
|
for (; n && n !== e.root; ) {
|
|
988
988
|
if (n.nextSibling) {
|
|
989
|
-
|
|
989
|
+
r = n.nextSibling;
|
|
990
990
|
break;
|
|
991
991
|
}
|
|
992
992
|
n = n.parentNode;
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
|
-
return
|
|
995
|
+
return r ? (e.currentNode = r, r) : null;
|
|
996
996
|
}
|
|
997
|
-
function
|
|
997
|
+
function Ct(e) {
|
|
998
998
|
return e == null || e === !0 || e === !1 ? "" : String(e);
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1001
|
-
return e.replace(/\{\{(.+?)\}\}/g, (
|
|
1002
|
-
const
|
|
1003
|
-
return
|
|
1000
|
+
function $e(e, t) {
|
|
1001
|
+
return e.replace(/\{\{(.+?)\}\}/g, (r, n) => {
|
|
1002
|
+
const o = q(n.trim(), t);
|
|
1003
|
+
return Ct(o);
|
|
1004
1004
|
});
|
|
1005
1005
|
}
|
|
1006
|
-
async function Nt(e, t,
|
|
1006
|
+
async function Nt(e, t, r) {
|
|
1007
1007
|
const n = e.getAttribute("loop");
|
|
1008
1008
|
if (!n) return;
|
|
1009
1009
|
e.removeAttribute("loop");
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1010
|
+
const o = e.getAttribute("if");
|
|
1011
|
+
o && e.removeAttribute("if");
|
|
1012
1012
|
const l = n.match(/^(.+?)\s+in\s+(.+)$/);
|
|
1013
1013
|
if (!l)
|
|
1014
1014
|
throw new Error("Invalid loop binding: expected <id> or [<id>, <id>]");
|
|
1015
|
-
const [,
|
|
1015
|
+
const [, i, s] = l, c = Et(i), a = q(s.trim(), t);
|
|
1016
1016
|
if (a == null) {
|
|
1017
1017
|
e.remove();
|
|
1018
1018
|
return;
|
|
1019
1019
|
}
|
|
1020
1020
|
if (typeof a != "object") {
|
|
1021
|
-
|
|
1021
|
+
N.error("State source is not iterable", { collectionExp: s, raw: a });
|
|
1022
1022
|
return;
|
|
1023
1023
|
}
|
|
1024
|
-
const u = Array.isArray(a), d = u ? a.map((f,
|
|
1025
|
-
let
|
|
1026
|
-
for (const [f,
|
|
1027
|
-
if (
|
|
1028
|
-
|
|
1024
|
+
const u = Array.isArray(a), d = u ? a.map((f, h) => [String(h), f]) : Object.entries(a), v = d.length, A = document.createDocumentFragment(), R = u ? yt(a) : void 0, w = { ...t };
|
|
1025
|
+
let P = 0;
|
|
1026
|
+
for (const [f, h] of d) {
|
|
1027
|
+
if (w.index = P, w.key = f, w.isFirst = P === 0, w.isLast = P === v - 1, w.isEven = P % 2 === 0, w.isOdd = P % 2 !== 0, c.type === "single" || (w[c.keyVar] = f), w[c.itemVar] = h, o && !q(o, w)) {
|
|
1028
|
+
P++;
|
|
1029
1029
|
continue;
|
|
1030
1030
|
}
|
|
1031
1031
|
const b = e.cloneNode(!0);
|
|
1032
|
-
u && b instanceof HTMLElement &&
|
|
1032
|
+
u && b instanceof HTMLElement && R && R[P] !== void 0 && it(b, R[P]), b instanceof HTMLElement && (await Me(b, w, r), A.appendChild(b)), P++;
|
|
1033
1033
|
}
|
|
1034
|
-
|
|
1034
|
+
A.childNodes.length > 0 && e.parentNode ? e.parentNode.replaceChild(A, e) : e.remove();
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1037
|
-
const n = e.parentNode,
|
|
1036
|
+
function At(e, t, r) {
|
|
1037
|
+
const n = e.parentNode, o = () => {
|
|
1038
1038
|
if (n)
|
|
1039
|
-
return
|
|
1039
|
+
return r.get(n);
|
|
1040
1040
|
}, l = (a) => {
|
|
1041
|
-
n &&
|
|
1042
|
-
},
|
|
1043
|
-
n &&
|
|
1041
|
+
n && r.set(n, a);
|
|
1042
|
+
}, i = () => {
|
|
1043
|
+
n && r.delete(n);
|
|
1044
1044
|
}, s = e.getAttribute("if");
|
|
1045
1045
|
if (s !== null) {
|
|
1046
|
-
const a = !!
|
|
1046
|
+
const a = !!q(s, t);
|
|
1047
1047
|
l({ hasHead: !0, resolved: a }), a ? e.removeAttribute("if") : e.remove();
|
|
1048
1048
|
return;
|
|
1049
1049
|
}
|
|
1050
1050
|
const c = e.getAttribute("else-if");
|
|
1051
1051
|
if (c !== null) {
|
|
1052
|
-
const a =
|
|
1052
|
+
const a = o();
|
|
1053
1053
|
if (!a?.hasHead) {
|
|
1054
1054
|
e.remove();
|
|
1055
1055
|
return;
|
|
@@ -1058,79 +1058,79 @@ function _t(e, t, o) {
|
|
|
1058
1058
|
e.remove();
|
|
1059
1059
|
return;
|
|
1060
1060
|
}
|
|
1061
|
-
const u = !!
|
|
1061
|
+
const u = !!q(c, t);
|
|
1062
1062
|
l({ hasHead: !0, resolved: u }), u ? e.removeAttribute("else-if") : e.remove();
|
|
1063
1063
|
return;
|
|
1064
1064
|
}
|
|
1065
1065
|
if (e.hasAttribute("else")) {
|
|
1066
|
-
const a =
|
|
1066
|
+
const a = o();
|
|
1067
1067
|
if (!a?.hasHead) {
|
|
1068
1068
|
e.remove();
|
|
1069
1069
|
return;
|
|
1070
1070
|
}
|
|
1071
|
-
a.resolved ? e.remove() : e.removeAttribute("else"),
|
|
1071
|
+
a.resolved ? e.remove() : e.removeAttribute("else"), i();
|
|
1072
1072
|
return;
|
|
1073
1073
|
}
|
|
1074
1074
|
}
|
|
1075
|
-
async function
|
|
1075
|
+
async function Tt(e, t, r = 50) {
|
|
1076
1076
|
const n = /* @__PURE__ */ new WeakMap();
|
|
1077
|
-
for (let
|
|
1078
|
-
const l = e.slice(
|
|
1079
|
-
for (const { node:
|
|
1080
|
-
if (
|
|
1081
|
-
if (
|
|
1082
|
-
await Nt(
|
|
1077
|
+
for (let o = 0; o < e.length; o += r) {
|
|
1078
|
+
const l = e.slice(o, o + r);
|
|
1079
|
+
for (const { node: i, state: s } of l) {
|
|
1080
|
+
if (i instanceof HTMLElement) {
|
|
1081
|
+
if (i.hasAttribute("loop")) {
|
|
1082
|
+
await Nt(i, s, t);
|
|
1083
1083
|
continue;
|
|
1084
1084
|
}
|
|
1085
|
-
if (
|
|
1086
|
-
|
|
1085
|
+
if (i.hasAttribute("if") || i.hasAttribute("else") || i.hasAttribute("else-if")) {
|
|
1086
|
+
At(i, s, n);
|
|
1087
1087
|
continue;
|
|
1088
1088
|
}
|
|
1089
1089
|
continue;
|
|
1090
1090
|
}
|
|
1091
|
-
const c =
|
|
1092
|
-
if (
|
|
1091
|
+
const c = $e(i.nodeValue, s);
|
|
1092
|
+
if (je(c)) {
|
|
1093
1093
|
const a = document.createRange().createContextualFragment(c);
|
|
1094
|
-
|
|
1094
|
+
i.replaceWith(a);
|
|
1095
1095
|
} else
|
|
1096
|
-
|
|
1096
|
+
i.nodeValue = c;
|
|
1097
1097
|
}
|
|
1098
|
-
|
|
1098
|
+
o + r < e.length && await new Promise(requestAnimationFrame);
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
|
-
async function
|
|
1101
|
+
async function Me(e, t, r) {
|
|
1102
1102
|
try {
|
|
1103
|
-
const n =
|
|
1104
|
-
let
|
|
1105
|
-
for (;
|
|
1106
|
-
if (
|
|
1107
|
-
|
|
1103
|
+
const n = vt(e), o = /* @__PURE__ */ new Set(), l = [];
|
|
1104
|
+
let i = n.currentNode;
|
|
1105
|
+
for (; i; ) {
|
|
1106
|
+
if (o.has(i)) {
|
|
1107
|
+
i = n.nextNode();
|
|
1108
1108
|
continue;
|
|
1109
1109
|
}
|
|
1110
|
-
if (
|
|
1111
|
-
const s =
|
|
1110
|
+
if (o.add(i), i.nodeType === Node.ELEMENT_NODE && i instanceof HTMLElement) {
|
|
1111
|
+
const s = i;
|
|
1112
1112
|
if (s.hasAttribute("loop")) {
|
|
1113
|
-
l.push({ node: s, state: t }),
|
|
1113
|
+
l.push({ node: s, state: t }), i = _t(n, s);
|
|
1114
1114
|
continue;
|
|
1115
1115
|
}
|
|
1116
1116
|
(s.hasAttribute("if") || s.hasAttribute("else") || s.hasAttribute("else-if")) && l.push({ node: s, state: t });
|
|
1117
1117
|
for (const c of Array.from(s.attributes)) {
|
|
1118
|
-
if (c.name === "ref" && (
|
|
1118
|
+
if (c.name === "ref" && (r[c.value] = s), c.name.startsWith(":")) {
|
|
1119
1119
|
const a = c.name.slice(1), u = c.value.trim();
|
|
1120
1120
|
try {
|
|
1121
|
-
const d =
|
|
1121
|
+
const d = q(u, t);
|
|
1122
1122
|
if (a === "class" && typeof d == "object" && d !== null) {
|
|
1123
1123
|
const v = [];
|
|
1124
|
-
for (const [
|
|
1125
|
-
|
|
1124
|
+
for (const [A, R] of Object.entries(d))
|
|
1125
|
+
R && v.push(A);
|
|
1126
1126
|
if (v.length > 0) {
|
|
1127
|
-
const
|
|
1128
|
-
s.setAttribute("class",
|
|
1127
|
+
const A = s.getAttribute("class") || "", R = A ? `${A} ${v.join(" ")}` : v.join(" ");
|
|
1128
|
+
s.setAttribute("class", R);
|
|
1129
1129
|
}
|
|
1130
1130
|
} else d != null && d !== !1 && (d === !0 ? s.setAttribute(a, "") : s.setAttribute(a, String(d)));
|
|
1131
1131
|
s.removeAttribute(c.name);
|
|
1132
1132
|
} catch (d) {
|
|
1133
|
-
|
|
1133
|
+
N.errorWithContext(
|
|
1134
1134
|
`Error evaluating dynamic attribute "${c.name}"`,
|
|
1135
1135
|
{ attributeName: c.name, expression: u },
|
|
1136
1136
|
d
|
|
@@ -1140,10 +1140,10 @@ async function $e(e, t, o) {
|
|
|
1140
1140
|
}
|
|
1141
1141
|
if (c.value.includes("{{"))
|
|
1142
1142
|
try {
|
|
1143
|
-
let a =
|
|
1143
|
+
let a = $e(c.value, t);
|
|
1144
1144
|
c.name === "class" && (a = a.replace(/\s+/g, " ").trim()), a !== c.value && s.setAttribute(c.name, a);
|
|
1145
1145
|
} catch (a) {
|
|
1146
|
-
|
|
1146
|
+
N.errorWithContext(
|
|
1147
1147
|
`Error replacing attribute "${c.name}"`,
|
|
1148
1148
|
{ attributeName: c.name },
|
|
1149
1149
|
a
|
|
@@ -1151,11 +1151,11 @@ async function $e(e, t, o) {
|
|
|
1151
1151
|
}
|
|
1152
1152
|
}
|
|
1153
1153
|
if (s.tagName.includes("-")) {
|
|
1154
|
-
|
|
1154
|
+
i = wt(n) || n.nextNode();
|
|
1155
1155
|
continue;
|
|
1156
1156
|
}
|
|
1157
|
-
} else if (
|
|
1158
|
-
let s =
|
|
1157
|
+
} else if (i.nodeType === Node.TEXT_NODE && i instanceof Text) {
|
|
1158
|
+
let s = i.parentElement, c = !1;
|
|
1159
1159
|
for (; s; ) {
|
|
1160
1160
|
if (s.tagName.includes("-")) {
|
|
1161
1161
|
c = !0;
|
|
@@ -1163,45 +1163,45 @@ async function $e(e, t, o) {
|
|
|
1163
1163
|
}
|
|
1164
1164
|
s = s.parentElement;
|
|
1165
1165
|
}
|
|
1166
|
-
c || l.push({ node:
|
|
1166
|
+
c || l.push({ node: i, state: t });
|
|
1167
1167
|
}
|
|
1168
|
-
|
|
1168
|
+
i = n.nextNode();
|
|
1169
1169
|
}
|
|
1170
|
-
await
|
|
1170
|
+
await Tt(l, r);
|
|
1171
1171
|
} catch (n) {
|
|
1172
|
-
throw
|
|
1172
|
+
throw N.errorWithContext("Error processing template", {}, n), n;
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
|
-
function
|
|
1175
|
+
function St(e, t = {}) {
|
|
1176
1176
|
if (!Array.isArray(e) || e.length === 0)
|
|
1177
1177
|
throw new Error("composeBySource: layers must be a non-empty array");
|
|
1178
1178
|
if (e.some((s) => s == null || typeof s != "object"))
|
|
1179
1179
|
throw new Error("composeBySource: all layers must be objects");
|
|
1180
|
-
const { defaultWriteIndex:
|
|
1181
|
-
|
|
1182
|
-
`Invalid defaultWriteIndex ${
|
|
1183
|
-
{ defaultWriteIndex:
|
|
1180
|
+
const { defaultWriteIndex: r = e.length - 1, includePrototype: n = !1 } = t, o = r >= 0 && r < e.length && Number.isInteger(r) ? r : e.length - 1;
|
|
1181
|
+
r !== o && N.warnWithContext(
|
|
1182
|
+
`Invalid defaultWriteIndex ${r}, using ${o}`,
|
|
1183
|
+
{ defaultWriteIndex: r, validWriteIndex: o, layersLength: e.length }
|
|
1184
1184
|
);
|
|
1185
|
-
const l = (s, c) => n ? c in s : Object.prototype.hasOwnProperty.call(s, c),
|
|
1185
|
+
const l = (s, c) => n ? c in s : Object.prototype.hasOwnProperty.call(s, c), i = (s) => {
|
|
1186
1186
|
for (let c = 0; c < e.length; c++)
|
|
1187
1187
|
if (l(e[c], s)) return c;
|
|
1188
1188
|
return -1;
|
|
1189
1189
|
};
|
|
1190
|
-
return new Proxy(e[
|
|
1190
|
+
return new Proxy(e[o], {
|
|
1191
1191
|
get(s, c) {
|
|
1192
|
-
const a =
|
|
1192
|
+
const a = i(c);
|
|
1193
1193
|
if (a !== -1) return e[a][c];
|
|
1194
1194
|
},
|
|
1195
1195
|
set(s, c, a) {
|
|
1196
|
-
const u =
|
|
1196
|
+
const u = i(c), d = u !== -1 ? u : o;
|
|
1197
1197
|
return e[d][c] = a, !0;
|
|
1198
1198
|
},
|
|
1199
1199
|
deleteProperty(s, c) {
|
|
1200
|
-
const a =
|
|
1200
|
+
const a = i(c);
|
|
1201
1201
|
return a === -1 ? !0 : delete e[a][c];
|
|
1202
1202
|
},
|
|
1203
1203
|
has(s, c) {
|
|
1204
|
-
return
|
|
1204
|
+
return i(c) !== -1;
|
|
1205
1205
|
},
|
|
1206
1206
|
ownKeys() {
|
|
1207
1207
|
const s = /* @__PURE__ */ new Set();
|
|
@@ -1219,43 +1219,43 @@ function At(e, t = {}) {
|
|
|
1219
1219
|
}
|
|
1220
1220
|
});
|
|
1221
1221
|
}
|
|
1222
|
-
function
|
|
1223
|
-
const t = e.getRootNode(),
|
|
1224
|
-
if (
|
|
1225
|
-
return
|
|
1222
|
+
function me(e) {
|
|
1223
|
+
const t = e.getRootNode(), r = e.parentElement ?? (t instanceof ShadowRoot ? t.host : void 0);
|
|
1224
|
+
if (et(r))
|
|
1225
|
+
return r.instance;
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1227
|
+
function xt({
|
|
1228
1228
|
container: e,
|
|
1229
1229
|
host: t
|
|
1230
1230
|
}) {
|
|
1231
|
-
const
|
|
1232
|
-
(
|
|
1231
|
+
const r = Array.from(t.childNodes).filter(
|
|
1232
|
+
(o) => o.nodeType === Node.ELEMENT_NODE || o.nodeType === Node.TEXT_NODE
|
|
1233
1233
|
), n = {};
|
|
1234
|
-
for (const
|
|
1235
|
-
const l =
|
|
1236
|
-
n[l] || (n[l] = []), n[l].push(
|
|
1234
|
+
for (const o of r) {
|
|
1235
|
+
const l = o instanceof HTMLElement && o.hasAttribute("slot") ? o.getAttribute("slot") : "default";
|
|
1236
|
+
n[l] || (n[l] = []), n[l].push(o);
|
|
1237
1237
|
}
|
|
1238
|
-
e.querySelectorAll("slot").forEach((
|
|
1239
|
-
const l =
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
}),
|
|
1238
|
+
e.querySelectorAll("slot").forEach((o) => {
|
|
1239
|
+
const l = o.getAttribute("name") || "default", i = n[l];
|
|
1240
|
+
i && i.length > 0 && i.forEach((s) => {
|
|
1241
|
+
o.parentNode.insertBefore(s, o);
|
|
1242
|
+
}), o.remove();
|
|
1243
1243
|
});
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1246
|
-
const n = /* @__PURE__ */ new Map(),
|
|
1247
|
-
for (const a of Object.keys(
|
|
1248
|
-
const u = n.get(
|
|
1249
|
-
u instanceof HTMLElement && (
|
|
1245
|
+
function Pt(e, t, r) {
|
|
1246
|
+
const n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = () => {
|
|
1247
|
+
for (const a of Object.keys(r)) {
|
|
1248
|
+
const u = n.get(r[a]);
|
|
1249
|
+
u instanceof HTMLElement && (r[a] = u);
|
|
1250
1250
|
}
|
|
1251
1251
|
};
|
|
1252
1252
|
if (!e.querySelector("slot")) return { commit: () => {
|
|
1253
1253
|
}, remapRefs: l };
|
|
1254
|
-
const
|
|
1254
|
+
const i = document.createElement("div"), s = (a) => {
|
|
1255
1255
|
const u = a.cloneNode(!1);
|
|
1256
1256
|
if (n.set(u, a), !(a instanceof HTMLElement && a.tagName.includes("-")))
|
|
1257
1257
|
for (const d of a.childNodes) u.appendChild(s(d));
|
|
1258
|
-
return
|
|
1258
|
+
return o.set(u, {
|
|
1259
1259
|
attributes: new Map(
|
|
1260
1260
|
a instanceof HTMLElement ? Array.from(a.attributes, (d) => [d.name, d.value]) : []
|
|
1261
1261
|
),
|
|
@@ -1263,20 +1263,20 @@ function St(e, t, o) {
|
|
|
1263
1263
|
value: u.nodeValue
|
|
1264
1264
|
}), u;
|
|
1265
1265
|
};
|
|
1266
|
-
for (const a of t.childNodes)
|
|
1267
|
-
return
|
|
1266
|
+
for (const a of t.childNodes) i.appendChild(s(a));
|
|
1267
|
+
return xt({ container: e, host: i }), { commit: () => {
|
|
1268
1268
|
const a = (u) => {
|
|
1269
|
-
const d = n.get(u), v =
|
|
1269
|
+
const d = n.get(u), v = o.get(u), A = Array.from(u.childNodes), R = A.map(a);
|
|
1270
1270
|
if (!d || !v)
|
|
1271
|
-
return
|
|
1272
|
-
|
|
1271
|
+
return A.forEach((w, P) => {
|
|
1272
|
+
R[P] !== w && w.replaceWith(R[P]);
|
|
1273
1273
|
}), u;
|
|
1274
1274
|
if (d instanceof HTMLElement && u instanceof HTMLElement) {
|
|
1275
|
-
for (const
|
|
1276
|
-
u.hasAttribute(
|
|
1277
|
-
for (const
|
|
1278
|
-
v.attributes.get(
|
|
1279
|
-
!d.tagName.includes("-") && (
|
|
1275
|
+
for (const w of v.attributes.keys())
|
|
1276
|
+
u.hasAttribute(w) || d.removeAttribute(w);
|
|
1277
|
+
for (const w of Array.from(u.attributes))
|
|
1278
|
+
v.attributes.get(w.name) !== w.value && d.setAttribute(w.name, w.value);
|
|
1279
|
+
!d.tagName.includes("-") && (A.length !== v.children.length || A.some((w, P) => w !== v.children[P])) && d.replaceChildren(...R);
|
|
1280
1280
|
} else u.nodeValue !== v.value && (d.nodeValue = u.nodeValue);
|
|
1281
1281
|
return d;
|
|
1282
1282
|
};
|
|
@@ -1287,76 +1287,93 @@ function St(e, t, o) {
|
|
|
1287
1287
|
l();
|
|
1288
1288
|
}, remapRefs: l };
|
|
1289
1289
|
}
|
|
1290
|
-
function
|
|
1290
|
+
function ye(e) {
|
|
1291
|
+
const t = ["opacity", "transition-property"], r = t.map((o) => ({
|
|
1292
|
+
name: o,
|
|
1293
|
+
value: e.style.getPropertyValue(o),
|
|
1294
|
+
priority: e.style.getPropertyPriority(o)
|
|
1295
|
+
}));
|
|
1296
|
+
e.style.setProperty("transition-property", "none", "important"), e.style.setProperty("opacity", "0", "important");
|
|
1297
|
+
const n = t.map(
|
|
1298
|
+
(o) => e.style.getPropertyPriority(o)
|
|
1299
|
+
);
|
|
1300
|
+
return () => {
|
|
1301
|
+
for (const [o, { name: l, value: i, priority: s }] of r.entries()) {
|
|
1302
|
+
const c = l === "opacity" ? "0" : "none";
|
|
1303
|
+
e.style.getPropertyValue(l) !== c || e.style.getPropertyPriority(l) !== n[o] || (i ? e.style.setProperty(l, i, s) : e.style.removeProperty(l));
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
}
|
|
1307
|
+
function ie({
|
|
1291
1308
|
propName: e,
|
|
1292
1309
|
propValue: t,
|
|
1293
|
-
props:
|
|
1310
|
+
props: r
|
|
1294
1311
|
}) {
|
|
1295
|
-
const n =
|
|
1312
|
+
const n = r[e], o = t ?? n?.default;
|
|
1296
1313
|
if (!n) return !0;
|
|
1297
|
-
const l =
|
|
1298
|
-
string:
|
|
1299
|
-
number:
|
|
1300
|
-
boolean:
|
|
1301
|
-
array: Array.isArray(
|
|
1302
|
-
object:
|
|
1303
|
-
function:
|
|
1314
|
+
const l = He(n.type), i = Array.isArray(o) ? "array" : typeof o, s = {
|
|
1315
|
+
string: i === "string",
|
|
1316
|
+
number: i === "number",
|
|
1317
|
+
boolean: i === "boolean",
|
|
1318
|
+
array: Array.isArray(o),
|
|
1319
|
+
object: i === "object" && o !== null && !Array.isArray(o),
|
|
1320
|
+
function: i === "function"
|
|
1304
1321
|
};
|
|
1305
|
-
return (l === "unknown" ? !0 : s[l] ?? !1) ? n.regex && typeof
|
|
1306
|
-
`Prop "${e}" should be of type "${l}", but got "${
|
|
1307
|
-
|
|
1322
|
+
return (l === "unknown" ? !0 : s[l] ?? !1) ? n.regex && typeof o == "string" && !new RegExp(n.regex).test(o) ? (N.error(`Prop "${e}" does not match regex "${n.regex}".`), !1) : !0 : (N.error(
|
|
1323
|
+
`Prop "${e}" should be of type "${l}", but got "${i}".`,
|
|
1324
|
+
o
|
|
1308
1325
|
), !1);
|
|
1309
1326
|
}
|
|
1310
|
-
function
|
|
1327
|
+
function ge({
|
|
1311
1328
|
ele: e,
|
|
1312
1329
|
parent: t,
|
|
1313
|
-
props:
|
|
1330
|
+
props: r,
|
|
1314
1331
|
state: n
|
|
1315
1332
|
}) {
|
|
1316
|
-
const
|
|
1317
|
-
Object.defineProperty(n,
|
|
1333
|
+
const o = Object.keys(r).length > 0, l = (i, s) => {
|
|
1334
|
+
Object.defineProperty(n, i, {
|
|
1318
1335
|
enumerable: !0,
|
|
1319
1336
|
configurable: !0,
|
|
1320
1337
|
get() {
|
|
1321
1338
|
if (t)
|
|
1322
|
-
return
|
|
1339
|
+
return se(t.state, s);
|
|
1323
1340
|
},
|
|
1324
1341
|
set(c) {
|
|
1325
1342
|
if (!(!t || !t.state))
|
|
1326
1343
|
try {
|
|
1327
|
-
|
|
1344
|
+
Be(t.state, s, c);
|
|
1328
1345
|
} catch (a) {
|
|
1329
|
-
|
|
1330
|
-
`Failed to set bound prop "${
|
|
1331
|
-
{ propName:
|
|
1346
|
+
N.errorWithContext(
|
|
1347
|
+
`Failed to set bound prop "${i}" → "${s}"`,
|
|
1348
|
+
{ propName: i, parentPath: s },
|
|
1332
1349
|
a
|
|
1333
1350
|
);
|
|
1334
1351
|
}
|
|
1335
1352
|
}
|
|
1336
1353
|
});
|
|
1337
1354
|
};
|
|
1338
|
-
for (const
|
|
1339
|
-
const s =
|
|
1340
|
-
if (s && !t || !(!
|
|
1355
|
+
for (const i of e.attributes) {
|
|
1356
|
+
const s = i.name.startsWith(":"), c = Ue(i.name.substring(s ? 1 : 0));
|
|
1357
|
+
if (s && !t || !(!o || r[c] && r[c] !== void 0)) continue;
|
|
1341
1358
|
if (!s) {
|
|
1342
|
-
const v =
|
|
1343
|
-
(!
|
|
1359
|
+
const v = i.value !== "" ? i.value : !0;
|
|
1360
|
+
(!o || ie({ propName: c, propValue: v, props: r })) && (n[c] = v);
|
|
1344
1361
|
continue;
|
|
1345
1362
|
}
|
|
1346
|
-
const u =
|
|
1347
|
-
if (u &&
|
|
1348
|
-
const v =
|
|
1349
|
-
(!
|
|
1363
|
+
const u = i.value?.trim() ?? "";
|
|
1364
|
+
if (u && ve(u)) {
|
|
1365
|
+
const v = se(t.state, u);
|
|
1366
|
+
(!o || ie({ propName: c, propValue: v, props: r })) && l(c, u);
|
|
1350
1367
|
continue;
|
|
1351
1368
|
}
|
|
1352
|
-
const d = u ?
|
|
1353
|
-
(!
|
|
1369
|
+
const d = u ? q(u, t.state) : void 0;
|
|
1370
|
+
(!o || ie({ propName: c, propValue: d, props: r })) && (n[c] = d);
|
|
1354
1371
|
}
|
|
1355
|
-
for (const [
|
|
1356
|
-
|
|
1372
|
+
for (const [i, s] of Object.entries(r))
|
|
1373
|
+
i in n || (s.default !== void 0 ? n[i] = s.default : s.required && N.error(`Required prop "${i}" is missing.`));
|
|
1357
1374
|
}
|
|
1358
|
-
function
|
|
1359
|
-
const
|
|
1375
|
+
function kt(e, t) {
|
|
1376
|
+
const r = /* @__PURE__ */ new Set();
|
|
1360
1377
|
customElements.define(
|
|
1361
1378
|
e,
|
|
1362
1379
|
class extends HTMLElement {
|
|
@@ -1368,8 +1385,8 @@ function xt(e, t) {
|
|
|
1368
1385
|
// Cleanup state for deterministic teardown
|
|
1369
1386
|
_connectionVersion = 0;
|
|
1370
1387
|
_isDisconnected = !1;
|
|
1371
|
-
|
|
1372
|
-
|
|
1388
|
+
_hasRendered = !1;
|
|
1389
|
+
_releaseFirstPresentation;
|
|
1373
1390
|
_model;
|
|
1374
1391
|
_observerFn;
|
|
1375
1392
|
_renderAborted = !1;
|
|
@@ -1380,288 +1397,297 @@ function xt(e, t) {
|
|
|
1380
1397
|
super(), this.template = document.createElement("template"), this.template.innerHTML = t.template;
|
|
1381
1398
|
}
|
|
1382
1399
|
async connectedCallback() {
|
|
1383
|
-
const n = this,
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1400
|
+
const n = this, o = ++this._connectionVersion;
|
|
1401
|
+
this._isDisconnected = !1, this._renderAborted = !1, this._pendingRender = null, !this._hasRendered && !this._releaseFirstPresentation && (this._releaseFirstPresentation = ye(this));
|
|
1402
|
+
try {
|
|
1403
|
+
await this.initializeConnection(n, o);
|
|
1404
|
+
} catch (l) {
|
|
1405
|
+
if (o !== this._connectionVersion || this._isDisconnected)
|
|
1406
|
+
return;
|
|
1407
|
+
this.releaseFirstPresentation(), N.errorWithContext("Error during initialization", { componentName: e }, l);
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
async initializeConnection(n, o) {
|
|
1411
|
+
if (r.add(this), !document.head.querySelector(`style#style-${e}`)) {
|
|
1412
|
+
const m = document.createElement("style");
|
|
1413
|
+
m.id = `style-${e}`, m.textContent = t.style, document.head.appendChild(m);
|
|
1387
1414
|
}
|
|
1388
1415
|
if (n.instance && this._model && this._observerFn) {
|
|
1389
|
-
const
|
|
1390
|
-
|
|
1416
|
+
const m = n.instance, g = me(n);
|
|
1417
|
+
m.$parent = g, this._isDisconnected = !1, this._renderAborted = !1, this._pendingRender = null, this._model.addObserver(this._observerFn), m.props && m.state && ge({
|
|
1391
1418
|
ele: n,
|
|
1392
|
-
parent:
|
|
1393
|
-
props:
|
|
1394
|
-
state:
|
|
1419
|
+
parent: g,
|
|
1420
|
+
props: m.props,
|
|
1421
|
+
state: m.state
|
|
1395
1422
|
});
|
|
1396
1423
|
return;
|
|
1397
1424
|
}
|
|
1398
|
-
const
|
|
1425
|
+
const i = (t.type || "options") === "options", s = me(n), c = this.template.cloneNode(!0);
|
|
1399
1426
|
let a;
|
|
1400
1427
|
if (t.deps) {
|
|
1401
1428
|
a = {};
|
|
1402
|
-
const
|
|
1403
|
-
|
|
1429
|
+
const m = Object.entries(t.deps), g = await Promise.all(
|
|
1430
|
+
m.map(([, C]) => C())
|
|
1404
1431
|
);
|
|
1405
|
-
for (let
|
|
1406
|
-
a[
|
|
1432
|
+
for (let C = 0; C < m.length; C++)
|
|
1433
|
+
a[m[C][0]] = g[C];
|
|
1407
1434
|
}
|
|
1408
|
-
if (
|
|
1409
|
-
const u =
|
|
1410
|
-
let v = !1,
|
|
1435
|
+
if (o !== this._connectionVersion || this._isDisconnected) return;
|
|
1436
|
+
const u = Ye(t.script, a), d = {};
|
|
1437
|
+
let v = !1, A = -1, R;
|
|
1411
1438
|
this._isDisconnected = !1, this._renderAborted = !1, this._pendingRender = null;
|
|
1412
|
-
const
|
|
1413
|
-
let
|
|
1414
|
-
return { promise: new Promise((
|
|
1415
|
-
|
|
1416
|
-
}), resolve:
|
|
1439
|
+
const w = we(), P = (() => {
|
|
1440
|
+
let m;
|
|
1441
|
+
return { promise: new Promise((C) => {
|
|
1442
|
+
m = C;
|
|
1443
|
+
}), resolve: m };
|
|
1417
1444
|
})();
|
|
1418
|
-
let
|
|
1419
|
-
const
|
|
1420
|
-
const
|
|
1421
|
-
if (!
|
|
1422
|
-
|
|
1423
|
-
`Plugin "${
|
|
1424
|
-
{ pluginName:
|
|
1445
|
+
let f, h;
|
|
1446
|
+
const b = (m) => {
|
|
1447
|
+
const g = J.plugins[m];
|
|
1448
|
+
if (!g || typeof g.setup != "function") {
|
|
1449
|
+
N.warnWithContext(
|
|
1450
|
+
`Plugin "${m}" not found or has no setup method`,
|
|
1451
|
+
{ pluginName: m }
|
|
1425
1452
|
);
|
|
1426
1453
|
return;
|
|
1427
1454
|
}
|
|
1428
1455
|
try {
|
|
1429
|
-
const
|
|
1430
|
-
return
|
|
1431
|
-
} catch (
|
|
1432
|
-
|
|
1433
|
-
`Plugin "${
|
|
1434
|
-
{ pluginName:
|
|
1435
|
-
|
|
1456
|
+
const C = i && h ? h : f;
|
|
1457
|
+
return g.setup.call(C);
|
|
1458
|
+
} catch (C) {
|
|
1459
|
+
N.errorWithContext(
|
|
1460
|
+
`Plugin "${m}" setup failed`,
|
|
1461
|
+
{ pluginName: m },
|
|
1462
|
+
C
|
|
1436
1463
|
);
|
|
1437
1464
|
return;
|
|
1438
1465
|
}
|
|
1439
|
-
},
|
|
1440
|
-
for (const [
|
|
1441
|
-
if (typeof
|
|
1442
|
-
const
|
|
1466
|
+
}, _ = {};
|
|
1467
|
+
for (const [m, g] of Object.entries(J.modules))
|
|
1468
|
+
if (typeof g.attach == "function") {
|
|
1469
|
+
const C = g.attach.call({
|
|
1443
1470
|
element: n,
|
|
1444
1471
|
parent: s,
|
|
1445
|
-
core: { take:
|
|
1472
|
+
core: { take: Fe.take }
|
|
1446
1473
|
});
|
|
1447
|
-
|
|
1474
|
+
C && (_[`$${m}`] = C);
|
|
1448
1475
|
}
|
|
1449
|
-
const
|
|
1450
|
-
let
|
|
1451
|
-
return
|
|
1452
|
-
},
|
|
1453
|
-
const
|
|
1454
|
-
let
|
|
1455
|
-
for (;
|
|
1456
|
-
const
|
|
1457
|
-
if (
|
|
1458
|
-
const
|
|
1459
|
-
typeof
|
|
1460
|
-
} else if (
|
|
1461
|
-
const
|
|
1462
|
-
typeof
|
|
1476
|
+
const p = /* @__PURE__ */ new Map(), y = (m) => {
|
|
1477
|
+
let g = p.get(m);
|
|
1478
|
+
return g || (g = `on${m.charAt(0).toUpperCase()}${m.slice(1)}`, p.set(m, g)), g;
|
|
1479
|
+
}, E = (m, ...g) => {
|
|
1480
|
+
const C = y(m);
|
|
1481
|
+
let M = s;
|
|
1482
|
+
for (; M; ) {
|
|
1483
|
+
const F = M.userContext;
|
|
1484
|
+
if (F) {
|
|
1485
|
+
const H = F[C];
|
|
1486
|
+
typeof H == "function" && H(...g);
|
|
1487
|
+
} else if (M.methods) {
|
|
1488
|
+
const H = M.methods[C];
|
|
1489
|
+
typeof H == "function" && H(...g);
|
|
1463
1490
|
}
|
|
1464
|
-
|
|
1491
|
+
M = M.$parent;
|
|
1465
1492
|
}
|
|
1466
|
-
},
|
|
1493
|
+
}, S = {
|
|
1467
1494
|
$refs: d,
|
|
1468
1495
|
$parent: s,
|
|
1469
|
-
$emit:
|
|
1470
|
-
$take:
|
|
1471
|
-
...
|
|
1472
|
-
},
|
|
1473
|
-
|
|
1474
|
-
const
|
|
1475
|
-
let
|
|
1476
|
-
|
|
1496
|
+
$emit: E,
|
|
1497
|
+
$take: b,
|
|
1498
|
+
..._
|
|
1499
|
+
}, x = u(S), T = bt(x.state ?? {});
|
|
1500
|
+
f = T.state;
|
|
1501
|
+
const k = x.methods || {}, D = x.props || {}, O = x.events || [];
|
|
1502
|
+
let $ = x.watchList || [];
|
|
1503
|
+
i && (h = St([k, f])), ge({
|
|
1477
1504
|
ele: n,
|
|
1478
1505
|
parent: s,
|
|
1479
|
-
props:
|
|
1480
|
-
state:
|
|
1481
|
-
}),
|
|
1482
|
-
for (const
|
|
1483
|
-
const
|
|
1484
|
-
if (typeof
|
|
1485
|
-
const
|
|
1486
|
-
|
|
1487
|
-
const
|
|
1488
|
-
|
|
1506
|
+
props: D,
|
|
1507
|
+
state: f
|
|
1508
|
+
}), i && h && We(k, h);
|
|
1509
|
+
for (const m of Ve) {
|
|
1510
|
+
const g = x[m];
|
|
1511
|
+
if (typeof g == "function") {
|
|
1512
|
+
const C = i && h ? Q(g, h) : g;
|
|
1513
|
+
Ce(w, m, async () => {
|
|
1514
|
+
const M = C();
|
|
1515
|
+
M instanceof Promise && await M;
|
|
1489
1516
|
});
|
|
1490
1517
|
}
|
|
1491
1518
|
}
|
|
1492
|
-
this._model =
|
|
1493
|
-
const
|
|
1519
|
+
this._model = T;
|
|
1520
|
+
const V = async () => {
|
|
1494
1521
|
if (this._isDisconnected)
|
|
1495
1522
|
return;
|
|
1496
1523
|
if (v) {
|
|
1497
|
-
this._renderAborted = !0, this._pendingRender =
|
|
1524
|
+
this._renderAborted = !0, this._pendingRender = V;
|
|
1498
1525
|
return;
|
|
1499
1526
|
}
|
|
1500
|
-
const
|
|
1501
|
-
if (
|
|
1502
|
-
v = !0, this._renderAborted = !1, n.instance && (n.instance.isRendering = !0);
|
|
1527
|
+
const m = T.getStateVersion();
|
|
1528
|
+
if (A !== m) {
|
|
1529
|
+
!this._hasRendered && !this._releaseFirstPresentation && (this._releaseFirstPresentation = ye(this)), v = !0, this._renderAborted = !1, n.instance && (n.instance.isRendering = !0);
|
|
1503
1530
|
try {
|
|
1504
|
-
const
|
|
1505
|
-
if (await
|
|
1506
|
-
this._pendingRender =
|
|
1531
|
+
const g = c.content.cloneNode(!0), C = Pt(g, n, d);
|
|
1532
|
+
if (await Me(g, i && h ? h : f, d), C.remapRefs(), this._renderAborted || this._model !== T) {
|
|
1533
|
+
this._pendingRender = V;
|
|
1507
1534
|
return;
|
|
1508
1535
|
}
|
|
1509
|
-
const
|
|
1510
|
-
if (await
|
|
1511
|
-
this._pendingRender =
|
|
1536
|
+
const F = i && h ? h : f;
|
|
1537
|
+
if (await I("global", "processed", F), await I(w, "processed"), this._renderAborted || this._model !== T) {
|
|
1538
|
+
this._pendingRender = V;
|
|
1512
1539
|
return;
|
|
1513
1540
|
}
|
|
1514
|
-
const
|
|
1515
|
-
Object.defineProperty(
|
|
1516
|
-
value:
|
|
1541
|
+
const H = T.flushChanges();
|
|
1542
|
+
Object.defineProperty(F, "changedPaths", {
|
|
1543
|
+
value: H,
|
|
1517
1544
|
writable: !0,
|
|
1518
1545
|
configurable: !0,
|
|
1519
1546
|
enumerable: !1
|
|
1520
1547
|
});
|
|
1521
|
-
const
|
|
1522
|
-
if (await
|
|
1548
|
+
const Z = !this._hasRendered;
|
|
1549
|
+
if (await I(
|
|
1523
1550
|
"global",
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
), await
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
), this._renderAborted || this._model !==
|
|
1531
|
-
delete
|
|
1551
|
+
Z ? "beforeMount" : "beforeUpdate",
|
|
1552
|
+
F
|
|
1553
|
+
), await I(
|
|
1554
|
+
w,
|
|
1555
|
+
Z ? "beforeMount" : "beforeUpdate",
|
|
1556
|
+
F
|
|
1557
|
+
), this._renderAborted || this._model !== T) {
|
|
1558
|
+
delete F.changedPaths, this._pendingRender = V;
|
|
1532
1559
|
return;
|
|
1533
1560
|
}
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1561
|
+
C.commit(), i && h ? (at(h, g), this._eventCleanup && this._eventCleanup(), this._eventCleanup = ct(h, O, g, d)) : (lt(k, g), this._eventCleanup && this._eventCleanup(), this._eventCleanup = ft(
|
|
1562
|
+
k,
|
|
1563
|
+
f,
|
|
1564
|
+
O,
|
|
1565
|
+
g,
|
|
1539
1566
|
d
|
|
1540
|
-
)),
|
|
1541
|
-
} catch (
|
|
1542
|
-
|
|
1567
|
+
)), ot(n, g, Z, t.structAttr), this._hasRendered = !0, this.releaseFirstPresentation(), Z || (await I("global", "updated", F), await I(w, "updated", F)), delete F.changedPaths, A = m, n.instance && (n.instance._lastRenderedStateVersion = A);
|
|
1568
|
+
} catch (g) {
|
|
1569
|
+
this._model === T && this.releaseFirstPresentation(), N.errorWithContext("Error during render", { componentName: e }, g);
|
|
1570
|
+
return;
|
|
1543
1571
|
} finally {
|
|
1544
|
-
const
|
|
1545
|
-
if (delete
|
|
1546
|
-
const
|
|
1572
|
+
const g = i && h ? h : f;
|
|
1573
|
+
if (delete g.changedPaths, v = !1, n.instance && (n.instance.isRendering = !1), this._pendingRender && !this._isDisconnected) {
|
|
1574
|
+
const C = this._pendingRender;
|
|
1547
1575
|
this._pendingRender = null, requestAnimationFrame(() => {
|
|
1548
|
-
this._isDisconnected ||
|
|
1549
|
-
|
|
1576
|
+
this._isDisconnected || C().catch((M) => {
|
|
1577
|
+
N.errorWithContext(
|
|
1550
1578
|
"Error during pending render",
|
|
1551
1579
|
{ componentName: e },
|
|
1552
|
-
|
|
1580
|
+
M
|
|
1553
1581
|
);
|
|
1554
1582
|
});
|
|
1555
1583
|
});
|
|
1556
1584
|
}
|
|
1557
1585
|
}
|
|
1586
|
+
this._isDisconnected || this._model !== T || (R || (R = (async () => {
|
|
1587
|
+
await I("global", "mounted", i && h ? h : f), !(this._isDisconnected || this._model !== T) && await I(w, "mounted");
|
|
1588
|
+
})()), await R, !(this._isDisconnected || this._model !== T) && P.resolve());
|
|
1558
1589
|
}
|
|
1559
1590
|
};
|
|
1560
1591
|
n.instance = {
|
|
1561
1592
|
element: n,
|
|
1562
1593
|
template: c,
|
|
1563
|
-
state:
|
|
1564
|
-
userContext:
|
|
1565
|
-
props:
|
|
1566
|
-
methods:
|
|
1567
|
-
events:
|
|
1568
|
-
watchList:
|
|
1594
|
+
state: f,
|
|
1595
|
+
userContext: i ? h : void 0,
|
|
1596
|
+
props: D,
|
|
1597
|
+
methods: k,
|
|
1598
|
+
events: O,
|
|
1599
|
+
watchList: $,
|
|
1569
1600
|
$refs: d,
|
|
1570
1601
|
$parent: s,
|
|
1571
|
-
$emit:
|
|
1572
|
-
$take:
|
|
1573
|
-
readyPromise:
|
|
1574
|
-
lifecycleRegistry:
|
|
1575
|
-
...
|
|
1602
|
+
$emit: E,
|
|
1603
|
+
$take: b,
|
|
1604
|
+
readyPromise: P.promise,
|
|
1605
|
+
lifecycleRegistry: w,
|
|
1606
|
+
..._,
|
|
1576
1607
|
isRendering: !1
|
|
1577
1608
|
}, this._observerFn = () => {
|
|
1578
|
-
if (this._isDisconnected ||
|
|
1609
|
+
if (this._isDisconnected || $ && $.length > 0 && !T.hasPendingChangesFor($))
|
|
1579
1610
|
return;
|
|
1580
|
-
let
|
|
1581
|
-
for (;
|
|
1582
|
-
if (
|
|
1611
|
+
let m = s;
|
|
1612
|
+
for (; m; ) {
|
|
1613
|
+
if (m.isRendering)
|
|
1583
1614
|
return;
|
|
1584
|
-
|
|
1615
|
+
m = m.$parent;
|
|
1585
1616
|
}
|
|
1586
1617
|
requestAnimationFrame(() => {
|
|
1587
|
-
this._isDisconnected ||
|
|
1588
|
-
|
|
1618
|
+
this._isDisconnected || V().catch((g) => {
|
|
1619
|
+
N.errorWithContext(
|
|
1589
1620
|
"Error during render (observer)",
|
|
1590
1621
|
{ componentName: e },
|
|
1591
|
-
|
|
1622
|
+
g
|
|
1592
1623
|
);
|
|
1593
1624
|
});
|
|
1594
1625
|
});
|
|
1595
|
-
},
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
if (await P("global", "mounted", G), this._isDisconnected || this._model !== A || (await P(M, "mounted"), this._isDisconnected || this._model !== A)) return;
|
|
1600
|
-
this._isMounted = !0;
|
|
1601
|
-
}
|
|
1602
|
-
N.resolve();
|
|
1603
|
-
}
|
|
1626
|
+
}, T.addObserver(this._observerFn), await I("global", "created", i && h ? h : f), await I(w, "created"), !(this._isDisconnected || this._model !== T) && await V();
|
|
1627
|
+
}
|
|
1628
|
+
releaseFirstPresentation() {
|
|
1629
|
+
this._releaseFirstPresentation?.(), this._releaseFirstPresentation = void 0;
|
|
1604
1630
|
}
|
|
1605
1631
|
async disconnectedCallback() {
|
|
1606
|
-
const n = this,
|
|
1607
|
-
if (this._isDisconnected = !0, this._renderAborted = !0, this._pendingRender = null,
|
|
1632
|
+
const n = this, o = ++this._connectionVersion;
|
|
1633
|
+
if (this._isDisconnected = !0, this._renderAborted = !0, this._pendingRender = null, this.releaseFirstPresentation(), r.delete(this), r.size === 0 && document.head.querySelector(`style#style-${e}`)?.remove(), !n.instance) return;
|
|
1608
1634
|
const l = n.instance;
|
|
1609
1635
|
this._isDisconnected = !0, this._renderAborted = !0, this._pendingRender = null, this._model && this._observerFn && this._model.removeObserver(this._observerFn);
|
|
1610
|
-
const
|
|
1611
|
-
await
|
|
1636
|
+
const i = l.userContext || l.state;
|
|
1637
|
+
await I("global", "beforeDestroy", i), await I(l.lifecycleRegistry, "beforeDestroy"), !(!this._isDisconnected || o !== this._connectionVersion) && (Pe(this), this._eventCleanup && (this._eventCleanup(), this._eventCleanup = null), await I("global", "destroyed", i), await I(l.lifecycleRegistry, "destroyed"), !(!this._isDisconnected || o !== this._connectionVersion) && (this._hasRendered = !1, this._model = void 0, this._observerFn = void 0, this._eventCleanup = null, n.instance = void 0));
|
|
1612
1638
|
}
|
|
1613
1639
|
}
|
|
1614
1640
|
);
|
|
1615
1641
|
}
|
|
1616
|
-
let
|
|
1617
|
-
function
|
|
1618
|
-
|
|
1642
|
+
let le = !1, be = !1, fe = [];
|
|
1643
|
+
function Rt() {
|
|
1644
|
+
be || (be = !0, !(typeof document > "u" || typeof HTMLElement > "u") && (ut(), tt(), ht()));
|
|
1619
1645
|
}
|
|
1620
|
-
function
|
|
1621
|
-
const t = e[0],
|
|
1622
|
-
if (
|
|
1623
|
-
if (!
|
|
1624
|
-
|
|
1646
|
+
function Ie(...e) {
|
|
1647
|
+
const t = e[0], r = e[1];
|
|
1648
|
+
if (Je(t)) {
|
|
1649
|
+
if (!r) {
|
|
1650
|
+
N.error("ComponentSource requires a component name when calling take()");
|
|
1625
1651
|
return;
|
|
1626
1652
|
}
|
|
1627
|
-
|
|
1653
|
+
kt(r, t);
|
|
1628
1654
|
return;
|
|
1629
1655
|
}
|
|
1630
|
-
if (
|
|
1656
|
+
if (ee(t) || Qe(t)) {
|
|
1631
1657
|
const n = {
|
|
1632
|
-
registerHook: (
|
|
1633
|
-
|
|
1658
|
+
registerHook: (o, l) => {
|
|
1659
|
+
Ce("global", o, l);
|
|
1634
1660
|
},
|
|
1635
|
-
take:
|
|
1661
|
+
take: Fe.take
|
|
1636
1662
|
};
|
|
1637
1663
|
try {
|
|
1638
|
-
t.install(n),
|
|
1639
|
-
} catch (
|
|
1640
|
-
|
|
1664
|
+
t.install(n), ee(t) ? J.plugins[t.name] = t : J.modules[t.name] = t;
|
|
1665
|
+
} catch (o) {
|
|
1666
|
+
N.errorWithContext(
|
|
1641
1667
|
"Failed to install extension",
|
|
1642
|
-
{ name: t.name, type:
|
|
1643
|
-
|
|
1668
|
+
{ name: t.name, type: ee(t) ? "plugin" : "module" },
|
|
1669
|
+
o
|
|
1644
1670
|
);
|
|
1645
1671
|
}
|
|
1646
1672
|
return;
|
|
1647
1673
|
}
|
|
1648
|
-
|
|
1674
|
+
N.error("Unknown extension type", t);
|
|
1649
1675
|
}
|
|
1650
1676
|
function Ot() {
|
|
1651
|
-
|
|
1677
|
+
le || (le = !0, fe.forEach((e) => Ie(...e)), fe = [], N.info("Core initialized"));
|
|
1652
1678
|
}
|
|
1653
|
-
const
|
|
1679
|
+
const Fe = Object.assign(
|
|
1654
1680
|
() => {
|
|
1655
|
-
|
|
1681
|
+
Rt(), Ot();
|
|
1656
1682
|
},
|
|
1657
1683
|
{
|
|
1658
1684
|
take: (...t) => {
|
|
1659
|
-
|
|
1685
|
+
le ? Ie(...t) : fe.push(t);
|
|
1660
1686
|
}
|
|
1661
1687
|
}
|
|
1662
1688
|
);
|
|
1663
1689
|
export {
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1690
|
+
Fe as Core,
|
|
1691
|
+
Le as LogLevel,
|
|
1692
|
+
N as logger
|
|
1667
1693
|
};
|