@trunkjs/browser-utils 1.0.49 → 1.0.50
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/.ai-usage-info.md +4 -0
- package/CHANGELOG.md +4 -0
- package/index.js +158 -156
- package/package.json +1 -1
package/.ai-usage-info.md
CHANGED
|
@@ -153,6 +153,10 @@ Empty slots get the CSS class:
|
|
|
153
153
|
<slot class="slot-empty"></slot>
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
+
Notes:
|
|
157
|
+
- whitespace-only text nodes are treated as empty
|
|
158
|
+
- HTML comments are treated as empty as well (important for Lit comment markers)
|
|
159
|
+
|
|
156
160
|
## Other exports
|
|
157
161
|
|
|
158
162
|
```ts
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 1.0.50 (2026-05-19)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for browser-utils to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
1
5
|
## 1.0.49 (2026-05-18)
|
|
2
6
|
|
|
3
7
|
This was a version bump only for browser-utils to align it with other projects, there were no code changes.
|
package/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var B = Object.defineProperty;
|
|
2
|
+
var _ = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var O = (e, t, n) => t in e ? B(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
6
|
+
var m = (e, t, n) => O(e, typeof t != "symbol" ? t + "" : t, n), T = (e, t, n) => t.has(e) || _("Cannot " + n);
|
|
7
|
+
var l = (e, t, n) => (T(e, t, "read from private field"), n ? n.call(e) : t.get(e)), f = (e, t, n) => t.has(e) ? _("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), b = (e, t, n, i) => (T(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n), w = (e, t, n) => (T(e, t, "access private method"), n);
|
|
8
8
|
const v = [
|
|
9
9
|
{ name: "xs", minWidth: 0 },
|
|
10
10
|
{ name: "sm", minWidth: 576 },
|
|
@@ -12,26 +12,26 @@ const v = [
|
|
|
12
12
|
{ name: "lg", minWidth: 992 },
|
|
13
13
|
{ name: "xl", minWidth: 1200 },
|
|
14
14
|
{ name: "xxl", minWidth: 1400 }
|
|
15
|
-
],
|
|
15
|
+
], M = v.reduce(
|
|
16
16
|
(e, t) => (e[t.name] = t.minWidth, e),
|
|
17
17
|
{}
|
|
18
18
|
);
|
|
19
19
|
function E(e) {
|
|
20
|
-
if (!(e in
|
|
20
|
+
if (!(e in M))
|
|
21
21
|
throw new Error(`Unknown breakpoint: ${e}`);
|
|
22
|
-
return
|
|
22
|
+
return M[e];
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function U() {
|
|
25
25
|
return window.visualViewport ? window.visualViewport.width : window.innerWidth;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
e === void 0 && (e =
|
|
27
|
+
function j(e) {
|
|
28
|
+
e === void 0 && (e = U());
|
|
29
29
|
for (let t = v.length - 1; t >= 0; t--)
|
|
30
30
|
if (e >= v[t].minWidth)
|
|
31
31
|
return v[t].name;
|
|
32
32
|
return "xs";
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function X(e, t = {}, n = []) {
|
|
35
35
|
Array.isArray(n) || (n = [n]);
|
|
36
36
|
const i = document.createElement(e);
|
|
37
37
|
for (const r in t)
|
|
@@ -40,16 +40,16 @@ function J(e, t = {}, n = []) {
|
|
|
40
40
|
i.append(typeof r == "string" ? document.createTextNode(r) : r);
|
|
41
41
|
return i;
|
|
42
42
|
}
|
|
43
|
-
class
|
|
43
|
+
class C {
|
|
44
44
|
/**
|
|
45
45
|
*
|
|
46
46
|
* @param delay Debounce delay in milliseconds
|
|
47
47
|
* @param max_delay Maximum delay in milliseconds, if false then no maximum delay is applied
|
|
48
48
|
*/
|
|
49
49
|
constructor(t, n = !1) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
m(this, "timeout", null);
|
|
51
|
+
m(this, "startTimeWithMs", 0);
|
|
52
|
+
m(this, "maxTimeout", null);
|
|
53
53
|
this.delay = t, this.max_delay = n;
|
|
54
54
|
}
|
|
55
55
|
async wait() {
|
|
@@ -70,25 +70,25 @@ class P {
|
|
|
70
70
|
this.timeout && (clearTimeout(this.timeout), this.timeout = null), this.maxTimeout && (clearTimeout(this.maxTimeout), this.maxTimeout = null), this.startTimeWithMs = 0, t();
|
|
71
71
|
};
|
|
72
72
|
if (this.timeout && clearTimeout(this.timeout), this.timeout = setTimeout(i, this.delay), this.max_delay !== !1 && !this.maxTimeout) {
|
|
73
|
-
const r = n - this.startTimeWithMs,
|
|
74
|
-
this.maxTimeout = setTimeout(i,
|
|
73
|
+
const r = n - this.startTimeWithMs, o = Math.max(0, this.max_delay - r);
|
|
74
|
+
this.maxTimeout = setTimeout(i, o);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Q(e, t = !1) {
|
|
79
79
|
const n = /* @__PURE__ */ new WeakMap();
|
|
80
80
|
return function(i, r) {
|
|
81
81
|
if (r.kind !== "method") return i;
|
|
82
|
-
const
|
|
83
|
-
return function(...
|
|
82
|
+
const o = r.name;
|
|
83
|
+
return function(...c) {
|
|
84
84
|
let s = n.get(this);
|
|
85
85
|
s || (s = /* @__PURE__ */ new Map(), n.set(this, s));
|
|
86
|
-
let
|
|
87
|
-
|
|
86
|
+
let a = s.get(o);
|
|
87
|
+
a || (a = new C(e, t), s.set(o, a)), a.debounce(() => i.apply(this, c));
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Y(e) {
|
|
92
92
|
if (typeof e.lineNumber == "number")
|
|
93
93
|
return {
|
|
94
94
|
file: e.fileName || e.sourceURL,
|
|
@@ -104,13 +104,13 @@ function Q(e) {
|
|
|
104
104
|
const n = String(e.stack || e.message || "").split(`
|
|
105
105
|
`), i = /(.*?)(?:\(|@)?(.*?):(\d+):(\d+)\)?$/;
|
|
106
106
|
for (const r of n) {
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
109
|
-
return { file:
|
|
107
|
+
const o = r.match(i);
|
|
108
|
+
if (o)
|
|
109
|
+
return { file: o[2], line: +o[3], column: +o[4] };
|
|
110
110
|
}
|
|
111
111
|
return { file: e.fileName || e.sourceURL };
|
|
112
112
|
}
|
|
113
|
-
class
|
|
113
|
+
class V {
|
|
114
114
|
constructor(t, n, i, r = "main") {
|
|
115
115
|
this._debug = t, this.myTag = n, this.myElementId = i, this.instanceId = r;
|
|
116
116
|
}
|
|
@@ -131,13 +131,13 @@ class j {
|
|
|
131
131
|
throw this.error(...t), new Error(n);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
class
|
|
134
|
+
class Z {
|
|
135
135
|
constructor(t, n = !0) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
136
|
+
m(this, "label");
|
|
137
|
+
m(this, "last");
|
|
138
|
+
m(this, "startTime");
|
|
139
|
+
m(this, "running", !1);
|
|
140
|
+
m(this, "enabled");
|
|
141
141
|
this.label = t, this.enabled = n, this.startTime = this.last = performance.now(), this.running = !0;
|
|
142
142
|
}
|
|
143
143
|
lap(t = "") {
|
|
@@ -161,10 +161,10 @@ class Y {
|
|
|
161
161
|
return this.running;
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function F(e) {
|
|
165
165
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function K(e) {
|
|
168
168
|
if (e != null)
|
|
169
169
|
try {
|
|
170
170
|
return JSON.parse(e);
|
|
@@ -172,28 +172,28 @@ function F(e) {
|
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function P(e) {
|
|
176
176
|
const t = JSON.stringify(e);
|
|
177
177
|
return t === void 0 ? "null" : t;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function z(e, t) {
|
|
180
180
|
const n = { ...t };
|
|
181
|
-
if (
|
|
181
|
+
if (F(e))
|
|
182
182
|
for (const i of Object.keys(t))
|
|
183
183
|
i in e && (n[i] = e[i]);
|
|
184
184
|
return n;
|
|
185
185
|
}
|
|
186
|
-
class
|
|
186
|
+
class A {
|
|
187
187
|
constructor(t, n, i) {
|
|
188
|
-
|
|
188
|
+
m(this, "cache");
|
|
189
189
|
this.backend = t, this.storageKey = n, this.initialValue = i;
|
|
190
190
|
}
|
|
191
191
|
read() {
|
|
192
192
|
if (this.cache) return this.cache;
|
|
193
|
-
const t = this.backend ?
|
|
193
|
+
const t = this.backend ? K(this.backend.getItem(this.storageKey)) : void 0, n = z(t, this.initialValue);
|
|
194
194
|
if (this.backend && this.backend.getItem(this.storageKey) == null)
|
|
195
195
|
try {
|
|
196
|
-
this.backend.setItem(this.storageKey,
|
|
196
|
+
this.backend.setItem(this.storageKey, P(n));
|
|
197
197
|
} catch {
|
|
198
198
|
}
|
|
199
199
|
return this.cache = n, n;
|
|
@@ -201,7 +201,7 @@ class C {
|
|
|
201
201
|
write(t) {
|
|
202
202
|
if (this.cache = t, !!this.backend)
|
|
203
203
|
try {
|
|
204
|
-
this.backend.setItem(this.storageKey,
|
|
204
|
+
this.backend.setItem(this.storageKey, P(t));
|
|
205
205
|
} catch {
|
|
206
206
|
}
|
|
207
207
|
}
|
|
@@ -215,15 +215,15 @@ class C {
|
|
|
215
215
|
},
|
|
216
216
|
set: (n, i, r) => {
|
|
217
217
|
if (typeof i != "string") return !1;
|
|
218
|
-
const
|
|
219
|
-
return
|
|
218
|
+
const c = { ...this.read() };
|
|
219
|
+
return c[i] = r, this.write(c), !0;
|
|
220
220
|
},
|
|
221
221
|
deleteProperty: (n, i) => {
|
|
222
222
|
if (typeof i != "string") return !1;
|
|
223
223
|
const r = this.read();
|
|
224
224
|
if (!(i in r)) return !0;
|
|
225
|
-
const
|
|
226
|
-
return delete
|
|
225
|
+
const o = { ...r };
|
|
226
|
+
return delete o[i], this.write(o), !0;
|
|
227
227
|
},
|
|
228
228
|
has: (n, i) => {
|
|
229
229
|
if (typeof i != "string") return !1;
|
|
@@ -249,47 +249,47 @@ class C {
|
|
|
249
249
|
return new Proxy({}, t);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function W(e) {
|
|
253
253
|
const t = globalThis.window;
|
|
254
254
|
return (e === "session" ? t == null ? void 0 : t.sessionStorage : t == null ? void 0 : t.localStorage) ?? void 0;
|
|
255
255
|
}
|
|
256
|
-
function Z(e, t) {
|
|
257
|
-
return new C(A("session"), e, t).asProxy();
|
|
258
|
-
}
|
|
259
256
|
function tt(e, t) {
|
|
260
|
-
return new
|
|
257
|
+
return new A(W("session"), e, t).asProxy();
|
|
258
|
+
}
|
|
259
|
+
function et(e, t) {
|
|
260
|
+
return new A(W("local"), e, t).asProxy();
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function L(e, t, n) {
|
|
263
263
|
return new Promise((i, r) => {
|
|
264
|
-
const
|
|
265
|
-
e.removeEventListener(t,
|
|
264
|
+
const o = (c) => {
|
|
265
|
+
e.removeEventListener(t, o, n), i(c);
|
|
266
266
|
};
|
|
267
|
-
e.addEventListener(t,
|
|
267
|
+
e.addEventListener(t, o, n);
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function H() {
|
|
271
271
|
return document.readyState === "loading" ? new Promise((e) => {
|
|
272
272
|
document.addEventListener("DOMContentLoaded", () => e());
|
|
273
273
|
}) : Promise.resolve();
|
|
274
274
|
}
|
|
275
|
-
function et() {
|
|
276
|
-
return window.tj_loader_state ? window.tj_loader_state !== "loading" ? Promise.resolve() : T(window, "loader:ready") : L();
|
|
277
|
-
}
|
|
278
275
|
function nt() {
|
|
279
|
-
return window.tj_loader_state ? window.tj_loader_state
|
|
276
|
+
return window.tj_loader_state ? window.tj_loader_state !== "loading" ? Promise.resolve() : L(window, "loader:ready") : x();
|
|
280
277
|
}
|
|
281
278
|
function it() {
|
|
282
|
-
return window.tj_loader_state ? window.tj_loader_state === "visual" ? Promise.resolve() :
|
|
279
|
+
return window.tj_loader_state ? window.tj_loader_state === "pre-visual" || window.tj_loader_state === "visual" ? Promise.resolve() : L(window, "loader:pre-visual") : x();
|
|
280
|
+
}
|
|
281
|
+
function rt() {
|
|
282
|
+
return window.tj_loader_state ? window.tj_loader_state === "visual" ? Promise.resolve() : L(window, "loader:visual") : x();
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function x(e = window) {
|
|
285
285
|
return e || (e = window), e === window ? document.readyState === "complete" ? Promise.resolve() : new Promise((t) => window.addEventListener("load", () => t(), { once: !0 })) : e instanceof HTMLImageElement ? e.complete && e.naturalWidth !== 0 ? Promise.resolve() : new Promise((t, n) => {
|
|
286
286
|
e.addEventListener("load", () => t(), { once: !0 }), e.addEventListener("error", () => n(new Error("image error")), { once: !0 });
|
|
287
287
|
}) : e instanceof HTMLMediaElement ? e.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA ? Promise.resolve() : new Promise((t) => e.addEventListener("loadeddata", () => t(), { once: !0 })) : new Promise((t) => e.addEventListener("load", () => t(), { once: !0 }));
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function st(e) {
|
|
290
290
|
return new Promise((t) => setTimeout(t, e));
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function ot(e) {
|
|
293
293
|
return new Promise((t) => {
|
|
294
294
|
const n = (i) => {
|
|
295
295
|
e.removeEventListener("animationend", n), t(i);
|
|
@@ -297,118 +297,118 @@ function st(e) {
|
|
|
297
297
|
e.addEventListener("animationend", n);
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function at(e) {
|
|
301
301
|
var n, i;
|
|
302
302
|
class t extends e {
|
|
303
303
|
constructor() {
|
|
304
304
|
super(...arguments);
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
var
|
|
309
|
-
await
|
|
310
|
-
const
|
|
311
|
-
let
|
|
312
|
-
if (!
|
|
305
|
+
f(this, n, new C(200, 5e3));
|
|
306
|
+
m(this, "currentBreakPoint", null);
|
|
307
|
+
f(this, i, async () => {
|
|
308
|
+
var y;
|
|
309
|
+
await l(this, n).wait(), await H();
|
|
310
|
+
const c = this, s = window.innerWidth;
|
|
311
|
+
let a = getComputedStyle(c).getPropertyValue("--breakpoint");
|
|
312
|
+
if (!a || a === "")
|
|
313
313
|
return;
|
|
314
|
-
|
|
315
|
-
const
|
|
316
|
-
this.currentBreakPoint !== g && (E(
|
|
314
|
+
a = a.trim().replace(/^['"]|['"]$/g, "");
|
|
315
|
+
const u = a.split(","), d = u[0].trim(), h = ((y = u[1]) == null ? void 0 : y.trim()) ?? d, g = j(s);
|
|
316
|
+
this.currentBreakPoint !== g && (E(h) <= E(g) ? c.setAttribute("mode", "desktop") : E(d) > E(g) ? c.setAttribute("mode", "mobile") : c.setAttribute("mode", "tablet"));
|
|
317
317
|
});
|
|
318
318
|
}
|
|
319
319
|
connectedCallback() {
|
|
320
320
|
super.connectedCallback();
|
|
321
321
|
try {
|
|
322
|
-
|
|
323
|
-
} catch (
|
|
324
|
-
throw console.error("Error in BreakPointMixin:",
|
|
322
|
+
l(this, i).call(this), window.addEventListener("resize", l(this, i)), l(this, i).call(this);
|
|
323
|
+
} catch (c) {
|
|
324
|
+
throw console.error("Error in BreakPointMixin:", c, "in element", this), c;
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
disconnectedCallback() {
|
|
328
|
-
super.disconnectedCallback(), window.removeEventListener("resize",
|
|
328
|
+
super.disconnectedCallback(), window.removeEventListener("resize", l(this, i));
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
return n = new WeakMap(), i = new WeakMap(), t;
|
|
332
332
|
}
|
|
333
|
-
const p = Symbol("listenerDefs"),
|
|
334
|
-
function
|
|
333
|
+
const p = Symbol("listenerDefs"), $ = Symbol("withEventBindings");
|
|
334
|
+
function ut(e, t) {
|
|
335
335
|
const n = Array.isArray(e) ? e : [e];
|
|
336
336
|
return function(i, r) {
|
|
337
337
|
if (r.kind !== "method") throw new Error("@Listen nur für Methoden");
|
|
338
338
|
return r.addInitializer(function() {
|
|
339
|
-
const
|
|
340
|
-
(
|
|
339
|
+
const o = this;
|
|
340
|
+
(o[p] || (o[p] = [])).push({
|
|
341
341
|
method: r.name,
|
|
342
342
|
events: [...n],
|
|
343
343
|
opts: t
|
|
344
344
|
});
|
|
345
|
-
}), function(...
|
|
346
|
-
if (!this[
|
|
345
|
+
}), function(...o) {
|
|
346
|
+
if (!this[$])
|
|
347
347
|
throw new Error("[EventBindings] @Listen - decorator requires EventBindingMixin.");
|
|
348
|
-
return i.apply(this,
|
|
348
|
+
return i.apply(this, o);
|
|
349
349
|
};
|
|
350
350
|
};
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function G(e, t) {
|
|
353
353
|
var n;
|
|
354
354
|
return !t || t === "host" ? e : t === "document" ? e.ownerDocument ?? document : t === "window" ? ((n = e.ownerDocument) == null ? void 0 : n.defaultView) ?? window : t === "shadowRoot" ? e.shadowRoot ?? e : typeof t == "function" ? t(e) : t;
|
|
355
355
|
}
|
|
356
356
|
function dt(e) {
|
|
357
|
-
var n, i,
|
|
357
|
+
var n, i, I;
|
|
358
358
|
class t extends e {
|
|
359
359
|
constructor(...s) {
|
|
360
360
|
super(...s);
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
this[
|
|
361
|
+
f(this, i);
|
|
362
|
+
f(this, n);
|
|
363
|
+
this[$] = !0;
|
|
364
364
|
}
|
|
365
365
|
connectedCallback() {
|
|
366
366
|
var s;
|
|
367
|
-
(s = super.connectedCallback) == null || s.call(this),
|
|
367
|
+
(s = super.connectedCallback) == null || s.call(this), w(this, i, I).call(this);
|
|
368
368
|
}
|
|
369
369
|
disconnectedCallback() {
|
|
370
|
-
var s,
|
|
371
|
-
(s =
|
|
370
|
+
var s, a;
|
|
371
|
+
(s = l(this, n)) == null || s.abort(), (a = super.disconnectedCallback) == null || a.call(this);
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
-
return n = new WeakMap(), i = new WeakSet(),
|
|
375
|
-
var
|
|
376
|
-
(
|
|
374
|
+
return n = new WeakMap(), i = new WeakSet(), I = function() {
|
|
375
|
+
var a, u, d;
|
|
376
|
+
(a = l(this, n)) == null || a.abort(), b(this, n, new AbortController());
|
|
377
377
|
const s = this[p] || [];
|
|
378
|
-
for (const
|
|
379
|
-
const g =
|
|
380
|
-
for (const
|
|
381
|
-
g.addEventListener(
|
|
378
|
+
for (const h of s) {
|
|
379
|
+
const g = G(this, (u = h.opts) == null ? void 0 : u.target), y = ((d = h.opts) == null ? void 0 : d.options) ?? {}, D = this[h.method].bind(this);
|
|
380
|
+
for (const R of h.events)
|
|
381
|
+
g.addEventListener(R, D, { ...y, signal: l(this, n).signal });
|
|
382
382
|
}
|
|
383
383
|
}, t;
|
|
384
384
|
}
|
|
385
|
-
let
|
|
386
|
-
function
|
|
385
|
+
let q = 1;
|
|
386
|
+
function lt(e) {
|
|
387
387
|
var n, i, r;
|
|
388
388
|
class t extends e {
|
|
389
389
|
constructor() {
|
|
390
390
|
super(...arguments);
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
391
|
+
f(this, n, null);
|
|
392
|
+
f(this, i, q++);
|
|
393
|
+
f(this, r, null);
|
|
394
394
|
}
|
|
395
395
|
/**
|
|
396
396
|
* Clears the cached debug flag so the attribute will be checked again
|
|
397
397
|
* on the next log/warn/error call.
|
|
398
398
|
*/
|
|
399
399
|
invalidateDebugCache() {
|
|
400
|
-
|
|
400
|
+
b(this, n, null);
|
|
401
401
|
}
|
|
402
402
|
get _debug() {
|
|
403
|
-
return
|
|
403
|
+
return l(this, n) !== null ? l(this, n) : (this instanceof HTMLElement && b(this, n, this.hasAttribute("debug") && !["false", "0", "off", "no"].includes(this.getAttribute("debug") || "")), l(this, n) === !0 && console.info(
|
|
404
404
|
// @ts-expect-error - it says tagName is not defined -whatever
|
|
405
|
-
`[DEBUG][ID:${
|
|
405
|
+
`[DEBUG][ID:${l(this, i)}] LoggingMixin: Debug mode is enabled for <${this.tagName}>`,
|
|
406
406
|
this
|
|
407
|
-
),
|
|
407
|
+
), l(this, n) ?? !1);
|
|
408
408
|
}
|
|
409
409
|
getLogger(s = "main") {
|
|
410
|
-
const
|
|
411
|
-
return
|
|
410
|
+
const a = "<" + (this.tagName || this.constructor.name || "UnknownElement") + ">";
|
|
411
|
+
return l(this, r) || b(this, r, new V(this._debug, a, `${l(this, i)}`, s)), l(this, r);
|
|
412
412
|
}
|
|
413
413
|
debug(...s) {
|
|
414
414
|
this.getLogger().debug(...s);
|
|
@@ -428,7 +428,7 @@ function ut(e) {
|
|
|
428
428
|
}
|
|
429
429
|
return n = new WeakMap(), i = new WeakMap(), r = new WeakMap(), t;
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function ct(e) {
|
|
432
432
|
class t extends e {
|
|
433
433
|
connectedCallback() {
|
|
434
434
|
this.dispatchEvent(
|
|
@@ -470,58 +470,60 @@ function lt(e) {
|
|
|
470
470
|
}
|
|
471
471
|
return t;
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
var n,
|
|
473
|
+
function ht(e) {
|
|
474
|
+
var n, N, r, k, S;
|
|
475
475
|
class t extends e {
|
|
476
476
|
constructor() {
|
|
477
477
|
super(...arguments);
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
const
|
|
481
|
-
|
|
478
|
+
f(this, n);
|
|
479
|
+
f(this, r, (u) => {
|
|
480
|
+
const d = u.target, h = w(this, n, k).call(this, d.assignedNodes({ flatten: !0 })), g = w(this, n, k).call(this, d.childNodes);
|
|
481
|
+
h || g ? d.classList.remove("slot-empty") : d.classList.add("slot-empty");
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
|
-
firstUpdated(
|
|
485
|
-
var
|
|
486
|
-
(
|
|
484
|
+
firstUpdated(u) {
|
|
485
|
+
var d;
|
|
486
|
+
(d = super.firstUpdated) == null || d.call(this, u), w(this, n, N).call(this);
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
return n = new WeakSet(),
|
|
490
|
-
var
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
h.childNodes
|
|
489
|
+
return n = new WeakSet(), N = function() {
|
|
490
|
+
var d;
|
|
491
|
+
const u = (d = this.shadowRoot) == null ? void 0 : d.querySelectorAll("slot");
|
|
492
|
+
u == null || u.forEach((h) => {
|
|
493
|
+
w(this, n, k).call(this, h.childNodes) || h.classList.add("slot-empty"), h.addEventListener("slotchange", (g) => l(this, r).call(this, g));
|
|
494
494
|
});
|
|
495
|
-
}, r = new WeakMap(),
|
|
496
|
-
return
|
|
495
|
+
}, r = new WeakMap(), k = function(u) {
|
|
496
|
+
return Array.from(u).some((d) => w(this, n, S).call(this, d));
|
|
497
|
+
}, S = function(u) {
|
|
498
|
+
return u.nodeType === Node.TEXT_NODE ? (u.textContent || "").trim().length > 0 : u.nodeType === Node.ELEMENT_NODE;
|
|
497
499
|
}, t;
|
|
498
500
|
}
|
|
499
501
|
export {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
+
at as BreakPointMixin,
|
|
503
|
+
C as Debouncer,
|
|
502
504
|
dt as EventBindingsMixin,
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
505
|
+
ut as Listen,
|
|
506
|
+
ct as LoaderMixin,
|
|
507
|
+
V as Logger,
|
|
508
|
+
lt as LoggingMixin,
|
|
509
|
+
ht as SlotVisibilityMixin,
|
|
510
|
+
Z as Stopwatch,
|
|
511
|
+
M as breakpointMap,
|
|
510
512
|
v as breakpoints,
|
|
511
|
-
|
|
512
|
-
|
|
513
|
+
X as create_element,
|
|
514
|
+
Q as debounce,
|
|
513
515
|
E as getBreakpointMinWidth,
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
516
|
+
j as getCurrentBreakpoint,
|
|
517
|
+
Y as getErrorLocation,
|
|
518
|
+
U as getViewportWidth,
|
|
519
|
+
et as local_storage,
|
|
520
|
+
tt as session_storage,
|
|
521
|
+
st as sleep,
|
|
522
|
+
L as waitFor,
|
|
523
|
+
ot as waitForAnimationEnd,
|
|
524
|
+
H as waitForDomContentLoaded,
|
|
525
|
+
x as waitForLoad,
|
|
526
|
+
it as waitForPreVisual,
|
|
527
|
+
nt as waitForReady,
|
|
528
|
+
rt as waitForVisual
|
|
527
529
|
};
|