2023-09-05 09:25:47 +02:00
|
|
|
//deka-dom-el library is available via global namespace `dde`
|
|
|
|
(()=> {
|
2023-09-13 13:20:00 +02:00
|
|
|
// src/signals-common.js
|
2023-10-09 13:49:38 +02:00
|
|
|
var w = {
|
2023-09-21 12:35:27 +02:00
|
|
|
isSignal(e) {
|
|
|
|
return !1;
|
2023-09-13 13:20:00 +02:00
|
|
|
},
|
2023-09-19 12:34:42 +02:00
|
|
|
processReactiveAttribute(e, t, n, r) {
|
|
|
|
return n;
|
2023-09-13 13:20:00 +02:00
|
|
|
}
|
|
|
|
};
|
2023-10-09 13:49:38 +02:00
|
|
|
function A(e, t = !0) {
|
|
|
|
return t ? Object.assign(w, e) : (Object.setPrototypeOf(e, w), e);
|
2023-09-13 13:20:00 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function S(e) {
|
|
|
|
return w.isPrototypeOf(e) && e !== w ? e : w;
|
2023-09-13 13:20:00 +02:00
|
|
|
}
|
|
|
|
|
2023-09-05 09:25:47 +02:00
|
|
|
// src/helpers.js
|
2023-09-11 18:32:05 +02:00
|
|
|
function m(e) {
|
2023-09-13 13:20:00 +02:00
|
|
|
return typeof e > "u";
|
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function D(e) {
|
2023-09-05 09:25:47 +02:00
|
|
|
let t = typeof e;
|
|
|
|
return t !== "object" ? t : e === null ? "null" : Object.prototype.toString.call(e);
|
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function C(e, t) {
|
2023-09-09 21:15:43 +02:00
|
|
|
if (!e || !(e instanceof AbortSignal))
|
|
|
|
return !0;
|
|
|
|
if (!e.aborted)
|
|
|
|
return e.addEventListener("abort", t), function() {
|
|
|
|
e.removeEventListener("abort", t);
|
|
|
|
};
|
|
|
|
}
|
2023-09-05 09:25:47 +02:00
|
|
|
|
2023-09-13 13:20:00 +02:00
|
|
|
// src/dom-common.js
|
2023-10-09 13:49:38 +02:00
|
|
|
var P = { setDeleteAttr: q };
|
|
|
|
function q(e, t, n) {
|
2023-09-21 12:35:27 +02:00
|
|
|
if (Reflect.set(e, t, n), !!m(n)) {
|
2023-09-21 16:27:00 +02:00
|
|
|
if (Reflect.deleteProperty(e, t), e instanceof HTMLElement && e.getAttribute(t) === "undefined")
|
2023-09-21 12:35:27 +02:00
|
|
|
return e.removeAttribute(t);
|
|
|
|
if (Reflect.get(e, t) === "undefined")
|
|
|
|
return Reflect.set(e, t, "");
|
|
|
|
}
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// src/dom.js
|
2023-10-09 13:49:38 +02:00
|
|
|
var b = "html", F = {
|
|
|
|
elNamespace(e) {
|
|
|
|
return b = e === "svg" ? "http://www.w3.org/2000/svg" : e, {
|
|
|
|
append(...t) {
|
|
|
|
return b = "html", t.length === 1 ? t[0] : document.createDocumentFragment().append(...t);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
get namespace() {
|
|
|
|
return b;
|
|
|
|
},
|
|
|
|
set namespace(e) {
|
|
|
|
return b = e;
|
|
|
|
}
|
|
|
|
}, ce = Object.assign((e) => e ? e(document.body) : document.body, F);
|
|
|
|
function ie(e, t, ...n) {
|
|
|
|
let r = this, o = S(this), c;
|
2023-09-21 17:04:40 +02:00
|
|
|
switch ((Object(t) !== t || o.isSignal(t)) && (t = { textContent: t }), !0) {
|
2023-09-09 21:15:43 +02:00
|
|
|
case typeof e == "function": {
|
2023-10-09 13:49:38 +02:00
|
|
|
let l = Object.assign((u) => u ? (n.unshift(u), void 0) : c, F);
|
|
|
|
c = e(t || void 0, l), b = "html";
|
2023-09-05 09:25:47 +02:00
|
|
|
break;
|
2023-09-09 21:15:43 +02:00
|
|
|
}
|
2023-09-05 09:25:47 +02:00
|
|
|
case e === "#text":
|
2023-10-09 13:49:38 +02:00
|
|
|
c = y.call(r, document.createTextNode(""), t);
|
2023-09-08 20:18:58 +02:00
|
|
|
break;
|
|
|
|
case e === "<>":
|
2023-10-09 13:49:38 +02:00
|
|
|
c = y.call(r, document.createDocumentFragment(), t);
|
2023-09-05 09:25:47 +02:00
|
|
|
break;
|
2023-10-09 13:49:38 +02:00
|
|
|
case b !== "html":
|
|
|
|
c = y.call(r, document.createElementNS(b, e), t);
|
2023-09-05 09:25:47 +02:00
|
|
|
break;
|
2023-09-21 17:04:40 +02:00
|
|
|
case !c:
|
2023-10-09 13:49:38 +02:00
|
|
|
c = y.call(r, document.createElement(e), t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
return n.forEach((l) => l(c)), c;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-21 12:35:27 +02:00
|
|
|
var { setDeleteAttr: j } = P;
|
2023-10-09 13:49:38 +02:00
|
|
|
function y(e, ...t) {
|
|
|
|
let n = this, r = S(this);
|
2023-09-05 09:25:47 +02:00
|
|
|
if (!t.length)
|
|
|
|
return e;
|
2023-09-21 17:04:40 +02:00
|
|
|
let c = (e instanceof SVGElement ? I : H).bind(null, e, "Attribute");
|
2023-10-09 13:49:38 +02:00
|
|
|
return Object.entries(Object.assign({}, ...t)).forEach(function l([u, a]) {
|
|
|
|
a = r.processReactiveAttribute(e, u, a, l);
|
|
|
|
let [v] = u;
|
|
|
|
if (v === "=")
|
|
|
|
return c(u.slice(1), a);
|
|
|
|
if (v === ".")
|
|
|
|
return W(e, u.slice(1), a);
|
|
|
|
if (/(aria|data)([A-Z])/.test(u))
|
|
|
|
return u = u.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), c(u, a);
|
|
|
|
switch (u === "className" && (u = "class"), u) {
|
2023-09-21 13:14:55 +02:00
|
|
|
case "xlink:href":
|
2023-10-09 13:49:38 +02:00
|
|
|
return c(u, a, "http://www.w3.org/1999/xlink");
|
2023-09-05 09:25:47 +02:00
|
|
|
case "textContent":
|
2023-10-09 13:49:38 +02:00
|
|
|
return j(e, u, a);
|
2023-09-21 14:37:20 +02:00
|
|
|
case "style":
|
2023-09-21 16:27:00 +02:00
|
|
|
if (typeof a != "object")
|
|
|
|
break;
|
2023-09-21 14:37:20 +02:00
|
|
|
case "dataset":
|
2023-10-09 13:49:38 +02:00
|
|
|
return L(r, a, W.bind(null, e[u]));
|
2023-09-21 14:37:20 +02:00
|
|
|
case "ariaset":
|
2023-10-09 13:49:38 +02:00
|
|
|
return L(r, a, (x, i) => c("aria-" + x, i));
|
2023-09-21 14:37:20 +02:00
|
|
|
case "classList":
|
|
|
|
return B.call(n, e, a);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
return G(e, u) ? j(e, u, a) : c(u, a);
|
2023-09-05 09:25:47 +02:00
|
|
|
}), e;
|
|
|
|
}
|
2023-09-21 12:35:27 +02:00
|
|
|
function B(e, t) {
|
2023-10-09 13:49:38 +02:00
|
|
|
let n = S(this);
|
|
|
|
return L(
|
2023-09-21 12:35:27 +02:00
|
|
|
n,
|
2023-09-05 09:25:47 +02:00
|
|
|
t,
|
2023-09-21 12:35:27 +02:00
|
|
|
(r, o) => e.classList.toggle(r, o === -1 ? void 0 : !!o)
|
2023-09-05 09:25:47 +02:00
|
|
|
), e;
|
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function fe(e) {
|
2023-09-05 09:25:47 +02:00
|
|
|
return Array.from(e.children).forEach((t) => t.remove()), e;
|
|
|
|
}
|
2023-09-21 16:27:00 +02:00
|
|
|
function G(e, t) {
|
2023-09-21 12:35:27 +02:00
|
|
|
if (!Reflect.has(e, t))
|
|
|
|
return !1;
|
2023-09-21 16:27:00 +02:00
|
|
|
let n = M(e, t);
|
2023-09-21 12:35:27 +02:00
|
|
|
return !m(n.set);
|
2023-09-06 14:54:28 +02:00
|
|
|
}
|
2023-09-21 16:27:00 +02:00
|
|
|
function M(e, t) {
|
2023-09-06 14:54:28 +02:00
|
|
|
if (e = Object.getPrototypeOf(e), !e)
|
2023-09-21 12:35:27 +02:00
|
|
|
return {};
|
2023-09-21 16:27:00 +02:00
|
|
|
let n = Object.getOwnPropertyDescriptor(e, t);
|
|
|
|
return n || M(e, t);
|
2023-09-06 14:54:28 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function L(e, t, n) {
|
2023-09-21 16:27:00 +02:00
|
|
|
if (!(typeof t != "object" || t === null))
|
2023-09-21 17:04:40 +02:00
|
|
|
return Object.entries(t).forEach(function([o, c]) {
|
2023-10-09 13:49:38 +02:00
|
|
|
o && (c = e.processReactiveAttribute(t, o, c, (l) => n(...l)), n(o, c));
|
2023-09-21 14:37:20 +02:00
|
|
|
});
|
2023-09-21 12:35:27 +02:00
|
|
|
}
|
2023-09-21 16:27:00 +02:00
|
|
|
function z(e) {
|
2023-09-21 12:35:27 +02:00
|
|
|
return Array.isArray(e) ? e.filter(Boolean).join(" ") : e;
|
2023-09-19 12:34:42 +02:00
|
|
|
}
|
2023-09-21 16:27:00 +02:00
|
|
|
function H(e, t, n, r) {
|
|
|
|
return e[(m(r) ? "remove" : "set") + t](n, z(r));
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-21 16:27:00 +02:00
|
|
|
function I(e, t, n, r, o = null) {
|
|
|
|
return e[(m(r) ? "remove" : "set") + t + "NS"](o, n, z(r));
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function W(e, t, n) {
|
2023-09-19 12:34:42 +02:00
|
|
|
if (Reflect.set(e, t, n), !!m(n))
|
|
|
|
return Reflect.deleteProperty(e, t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// src/events.js
|
2023-10-09 13:49:38 +02:00
|
|
|
function de(e, t, ...n) {
|
2023-09-19 12:34:42 +02:00
|
|
|
let r = n.length ? new CustomEvent(t, { detail: n[0] }) : new Event(t);
|
|
|
|
return e.dispatchEvent(r);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-21 16:27:00 +02:00
|
|
|
function T(e, t, n) {
|
2023-09-09 21:15:43 +02:00
|
|
|
return function(o) {
|
2023-09-19 12:34:42 +02:00
|
|
|
return o.addEventListener(e, t, n), o;
|
2023-09-09 21:15:43 +02:00
|
|
|
};
|
|
|
|
}
|
2023-09-21 16:27:00 +02:00
|
|
|
var O = J();
|
|
|
|
T.connected = function(e, t) {
|
2023-10-09 13:49:38 +02:00
|
|
|
return typeof t != "object" && (t = {}), t.once = !0, function(r) {
|
|
|
|
return r.addEventListener("dde:connected", e, t), typeof r.connectedCallback == "function" ? r : r.isConnected ? (r.dispatchEvent(new Event("dde:connected")), r) : (C(t.signal, () => O.offConnected(r, e)) && O.onConnected(r, e), r);
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
|
|
|
};
|
2023-09-21 16:27:00 +02:00
|
|
|
T.disconnected = function(e, t) {
|
2023-10-09 13:49:38 +02:00
|
|
|
return typeof t != "object" && (t = {}), t.once = !0, function(r) {
|
|
|
|
return r.addEventListener("dde:disconnected", e, t), typeof r.disconnectedCallback == "function" || C(t.signal, () => O.offDisconnected(r, e)) && O.onDisconnected(r, e), r;
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
|
|
|
};
|
2023-09-21 16:27:00 +02:00
|
|
|
function J() {
|
2023-09-21 17:04:40 +02:00
|
|
|
let e = /* @__PURE__ */ new Map(), t = !1, n = new MutationObserver(function(i) {
|
2023-10-09 13:49:38 +02:00
|
|
|
for (let s of i)
|
|
|
|
if (s.type === "childList") {
|
|
|
|
if (v(s.addedNodes, !0)) {
|
|
|
|
l();
|
2023-09-05 09:25:47 +02:00
|
|
|
continue;
|
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
x(s.removedNodes, !0) && l();
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
return {
|
2023-10-09 13:49:38 +02:00
|
|
|
onConnected(i, s) {
|
|
|
|
c();
|
|
|
|
let f = o(i);
|
|
|
|
f.connected.has(s) || (f.connected.add(s), f.length_c += 1);
|
2023-09-05 09:25:47 +02:00
|
|
|
},
|
2023-10-09 13:49:38 +02:00
|
|
|
offConnected(i, s) {
|
2023-09-21 17:04:40 +02:00
|
|
|
if (!e.has(i))
|
2023-09-05 09:25:47 +02:00
|
|
|
return;
|
2023-10-09 13:49:38 +02:00
|
|
|
let f = e.get(i);
|
|
|
|
f.connected.has(s) && (f.connected.delete(s), f.length_c -= 1, r(i, f));
|
2023-09-05 09:25:47 +02:00
|
|
|
},
|
2023-10-09 13:49:38 +02:00
|
|
|
onDisconnected(i, s) {
|
|
|
|
c();
|
|
|
|
let f = o(i);
|
|
|
|
f.disconnected.has(s) || (f.disconnected.add(s), f.length_d += 1);
|
2023-09-05 09:25:47 +02:00
|
|
|
},
|
2023-10-09 13:49:38 +02:00
|
|
|
offDisconnected(i, s) {
|
2023-09-21 17:04:40 +02:00
|
|
|
if (!e.has(i))
|
2023-09-05 09:25:47 +02:00
|
|
|
return;
|
2023-10-09 13:49:38 +02:00
|
|
|
let f = e.get(i);
|
|
|
|
f.disconnected.has(s) && (f.disconnected.delete(s), f.length_d -= 1, r(i, f));
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
};
|
2023-10-09 13:49:38 +02:00
|
|
|
function r(i, s) {
|
|
|
|
s.length_c || s.length_d || (e.delete(i), l());
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-21 17:04:40 +02:00
|
|
|
function o(i) {
|
|
|
|
if (e.has(i))
|
|
|
|
return e.get(i);
|
2023-10-09 13:49:38 +02:00
|
|
|
let s = {
|
|
|
|
connected: /* @__PURE__ */ new WeakSet(),
|
|
|
|
length_c: 0,
|
|
|
|
disconnected: /* @__PURE__ */ new WeakSet(),
|
|
|
|
length_d: 0
|
|
|
|
};
|
|
|
|
return e.set(i, s), s;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-21 17:04:40 +02:00
|
|
|
function c() {
|
2023-09-19 12:34:42 +02:00
|
|
|
t || (t = !0, n.observe(document.body, { childList: !0, subtree: !0 }));
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function l() {
|
2023-09-19 12:34:42 +02:00
|
|
|
!t || e.size || (t = !1, n.disconnect());
|
2023-09-11 18:32:05 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function u() {
|
2023-09-21 17:04:40 +02:00
|
|
|
return new Promise(function(i) {
|
|
|
|
(requestIdleCallback || requestAnimationFrame)(i);
|
2023-09-05 09:25:47 +02:00
|
|
|
});
|
|
|
|
}
|
2023-09-21 17:04:40 +02:00
|
|
|
async function a(i) {
|
2023-10-09 13:49:38 +02:00
|
|
|
e.size > 30 && await u();
|
|
|
|
let s = [];
|
2023-09-21 17:04:40 +02:00
|
|
|
if (!(i instanceof Node))
|
2023-10-09 13:49:38 +02:00
|
|
|
return s;
|
|
|
|
for (let f of e.keys())
|
|
|
|
f === i || !(f instanceof Node) || i.contains(f) && s.push(f);
|
|
|
|
return s;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function v(i, s) {
|
|
|
|
let f = !1;
|
|
|
|
for (let p of i) {
|
|
|
|
if (s && a(p).then(v), !e.has(p))
|
2023-09-09 21:15:43 +02:00
|
|
|
continue;
|
2023-10-09 13:49:38 +02:00
|
|
|
let E = e.get(p);
|
|
|
|
E.length_c && (p.dispatchEvent(new Event("dde:connected")), E.connected = /* @__PURE__ */ new WeakSet(), E.length_c = 0, E.length_d || e.delete(p), f = !0);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
return f;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function x(i, s) {
|
|
|
|
let f = !1;
|
|
|
|
for (let p of i)
|
|
|
|
s && a(p).then(x), !(!e.has(p) || !e.get(p).length_d) && (p.dispatchEvent(new Event("dde:disconnected")), e.delete(p), f = !0);
|
|
|
|
return f;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// index.js
|
2023-09-21 16:27:00 +02:00
|
|
|
[HTMLElement, SVGElement, DocumentFragment].forEach((e) => {
|
2023-09-05 09:25:47 +02:00
|
|
|
let { append: t } = e.prototype;
|
2023-09-19 12:34:42 +02:00
|
|
|
e.prototype.append = function(...n) {
|
|
|
|
return t.apply(this, n), this;
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
// src/signals-lib.js
|
2023-09-08 10:52:45 +02:00
|
|
|
var d = Symbol.for("Signal");
|
2023-10-09 13:49:38 +02:00
|
|
|
function _(e) {
|
2023-09-05 09:25:47 +02:00
|
|
|
try {
|
2023-09-08 10:52:45 +02:00
|
|
|
return Reflect.has(e, d);
|
2023-09-05 09:25:47 +02:00
|
|
|
} catch {
|
|
|
|
return !1;
|
|
|
|
}
|
|
|
|
}
|
2023-09-21 12:35:27 +02:00
|
|
|
var h = /* @__PURE__ */ new WeakMap();
|
2023-09-11 18:32:05 +02:00
|
|
|
function g(e, t) {
|
2023-09-05 09:25:47 +02:00
|
|
|
if (typeof e != "function")
|
2023-09-21 12:35:27 +02:00
|
|
|
return U(e, t);
|
2023-10-09 13:49:38 +02:00
|
|
|
if (_(e))
|
2023-09-05 09:25:47 +02:00
|
|
|
return e;
|
2023-09-21 12:35:27 +02:00
|
|
|
let n = U(""), r = () => n(e());
|
2023-10-09 13:49:38 +02:00
|
|
|
return h.set(r, /* @__PURE__ */ new Set([n])), K(r), n;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
g.action = function(e, t, ...n) {
|
|
|
|
let r = e[d], { actions: o } = r;
|
2023-09-05 09:25:47 +02:00
|
|
|
if (!o || !Reflect.has(o, t))
|
|
|
|
throw new Error(`'${e}' has no action with name '${t}'!`);
|
2023-09-19 12:34:42 +02:00
|
|
|
if (o[t].apply(r, n), r.skip)
|
|
|
|
return Reflect.deleteProperty(r, "skip");
|
2023-09-21 17:04:40 +02:00
|
|
|
r.listeners.forEach((c) => c(r.value));
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
2023-09-19 12:34:42 +02:00
|
|
|
g.on = function e(t, n, r = {}) {
|
|
|
|
let { signal: o } = r;
|
2023-09-07 17:35:23 +02:00
|
|
|
if (!(o && o.aborted)) {
|
|
|
|
if (Array.isArray(t))
|
2023-09-21 17:04:40 +02:00
|
|
|
return t.forEach((c) => e(c, n, r));
|
2023-10-09 13:49:38 +02:00
|
|
|
N(t, n), o && o.addEventListener("abort", () => k(t, n));
|
2023-09-07 17:35:23 +02:00
|
|
|
}
|
|
|
|
};
|
2023-09-11 18:32:05 +02:00
|
|
|
g.symbols = {
|
2023-09-08 10:52:45 +02:00
|
|
|
signal: d,
|
2023-09-07 17:35:23 +02:00
|
|
|
onclear: Symbol.for("Signal.onclear")
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
2023-09-11 18:32:05 +02:00
|
|
|
g.clear = function(...e) {
|
2023-09-19 12:34:42 +02:00
|
|
|
for (let n of e) {
|
|
|
|
Reflect.deleteProperty(n, "toJSON");
|
|
|
|
let r = n[d], { onclear: o } = g.symbols;
|
|
|
|
r.actions && r.actions[o] && r.actions[o].call(r), t(n, r), Reflect.deleteProperty(n, d);
|
2023-09-08 10:52:45 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function t(n, r) {
|
|
|
|
r.listeners.forEach((o) => {
|
2023-09-21 12:35:27 +02:00
|
|
|
if (r.listeners.delete(o), !h.has(o))
|
2023-09-08 10:52:45 +02:00
|
|
|
return;
|
2023-09-21 17:04:40 +02:00
|
|
|
let c = h.get(o);
|
|
|
|
c.delete(n), !(c.size > 1) && (g.clear(...c), h.delete(o));
|
2023-09-08 10:52:45 +02:00
|
|
|
});
|
2023-09-07 17:35:23 +02:00
|
|
|
}
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
2023-09-11 18:32:05 +02:00
|
|
|
g.el = function(e, t) {
|
2023-09-19 12:34:42 +02:00
|
|
|
let n = document.createComment("<#reactive>"), r = document.createComment("</#reactive>"), o = document.createDocumentFragment();
|
|
|
|
o.append(n, r);
|
2023-10-09 13:49:38 +02:00
|
|
|
let c = (l) => {
|
2023-09-19 12:34:42 +02:00
|
|
|
if (!n.parentNode || !r.parentNode)
|
2023-10-09 13:49:38 +02:00
|
|
|
return k(e, c);
|
|
|
|
let u = t(l);
|
|
|
|
Array.isArray(u) || (u = [u]);
|
2023-09-21 12:35:27 +02:00
|
|
|
let a = n;
|
|
|
|
for (; (a = n.nextSibling) !== r; )
|
|
|
|
a.remove();
|
2023-10-09 13:49:38 +02:00
|
|
|
n.after(...u);
|
2023-09-08 20:18:58 +02:00
|
|
|
};
|
2023-10-09 13:49:38 +02:00
|
|
|
return N(e, c), c(e()), o;
|
2023-09-08 20:18:58 +02:00
|
|
|
};
|
2023-09-21 12:35:27 +02:00
|
|
|
var $ = {
|
2023-10-09 13:49:38 +02:00
|
|
|
isSignal: _,
|
2023-09-19 12:34:42 +02:00
|
|
|
processReactiveAttribute(e, t, n, r) {
|
2023-10-09 13:49:38 +02:00
|
|
|
return _(n) ? (N(n, (o) => r([t, o])), n()) : n;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
};
|
2023-09-21 12:35:27 +02:00
|
|
|
function U(e, t) {
|
2023-10-09 13:49:38 +02:00
|
|
|
let n = (...r) => r.length ? Y(n, r[0]) : X(n);
|
2023-09-21 16:27:00 +02:00
|
|
|
return Z(n, e, t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-21 16:27:00 +02:00
|
|
|
var V = Object.assign(/* @__PURE__ */ Object.create(null), {
|
2023-09-05 09:25:47 +02:00
|
|
|
stopPropagation() {
|
|
|
|
this.skip = !0;
|
|
|
|
}
|
|
|
|
});
|
2023-09-21 16:27:00 +02:00
|
|
|
function Z(e, t, n) {
|
2023-10-09 13:49:38 +02:00
|
|
|
return D(n) !== "[object Object]" && (n = {}), e[d] = {
|
2023-09-05 09:25:47 +02:00
|
|
|
value: t,
|
2023-09-19 12:34:42 +02:00
|
|
|
actions: n,
|
2023-09-05 09:25:47 +02:00
|
|
|
listeners: /* @__PURE__ */ new Set()
|
2023-09-21 16:27:00 +02:00
|
|
|
}, e.toJSON = () => e(), Object.setPrototypeOf(e[d], V), e;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-21 12:35:27 +02:00
|
|
|
var R = [];
|
2023-10-09 13:49:38 +02:00
|
|
|
function K(e) {
|
2023-09-05 09:25:47 +02:00
|
|
|
let t = function() {
|
2023-09-21 12:35:27 +02:00
|
|
|
R.push(t), e(), R.pop();
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
2023-09-21 12:35:27 +02:00
|
|
|
h.has(e) && (h.set(t, h.get(e)), h.delete(e)), t();
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function Q() {
|
2023-09-21 12:35:27 +02:00
|
|
|
return R[R.length - 1];
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function X(e) {
|
2023-09-08 10:52:45 +02:00
|
|
|
if (!e[d])
|
2023-09-05 09:25:47 +02:00
|
|
|
return;
|
2023-10-09 13:49:38 +02:00
|
|
|
let { value: t, listeners: n } = e[d], r = Q();
|
2023-09-21 12:35:27 +02:00
|
|
|
return r && n.add(r), h.has(r) && h.get(r).add(e), t;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function Y(e, t) {
|
2023-09-08 10:52:45 +02:00
|
|
|
if (!e[d])
|
2023-09-05 09:25:47 +02:00
|
|
|
return;
|
2023-09-19 12:34:42 +02:00
|
|
|
let n = e[d];
|
|
|
|
if (n.value !== t)
|
|
|
|
return n.value = t, n.listeners.forEach((r) => r(t)), t;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function N(e, t) {
|
2023-09-09 21:15:43 +02:00
|
|
|
if (e[d])
|
|
|
|
return e[d].listeners.add(t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-10-09 13:49:38 +02:00
|
|
|
function k(e, t) {
|
2023-09-09 21:15:43 +02:00
|
|
|
if (e[d])
|
|
|
|
return e[d].listeners.delete(t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
|
2023-09-19 09:30:21 +02:00
|
|
|
// signals.js
|
2023-10-09 13:49:38 +02:00
|
|
|
A($);
|
2023-09-05 09:25:47 +02:00
|
|
|
|
|
|
|
globalThis.dde= {
|
2023-09-11 18:32:05 +02:00
|
|
|
S: g,
|
2023-10-09 13:49:38 +02:00
|
|
|
assign: y,
|
2023-09-21 12:35:27 +02:00
|
|
|
classListDeclarative: B,
|
2023-10-09 13:49:38 +02:00
|
|
|
createElement: ie,
|
|
|
|
dispatchEvent: de,
|
|
|
|
el: ie,
|
|
|
|
empty: fe,
|
|
|
|
isSignal: _,
|
2023-09-21 16:27:00 +02:00
|
|
|
on: T,
|
2023-10-09 13:49:38 +02:00
|
|
|
registerReactivity: A,
|
|
|
|
scope: ce
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
})();
|