2023-09-05 09:25:47 +02:00
|
|
|
// src/helpers.js
|
2023-09-08 10:52:45 +02:00
|
|
|
function m(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);
|
|
|
|
}
|
|
|
|
|
|
|
|
// src/signals-common.js
|
2023-09-07 17:35:23 +02:00
|
|
|
var b = {
|
2023-09-05 09:25:47 +02:00
|
|
|
isTextContent(e) {
|
2023-09-08 10:52:45 +02:00
|
|
|
return m(e) !== "[object Object]";
|
2023-09-05 09:25:47 +02:00
|
|
|
},
|
2023-09-08 20:18:58 +02:00
|
|
|
processReactiveAttribute(e, t, n, r) {
|
|
|
|
return n;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
};
|
2023-09-08 20:18:58 +02:00
|
|
|
function j(e, t = !0) {
|
2023-09-07 17:35:23 +02:00
|
|
|
return t ? Object.assign(b, e) : (Object.setPrototypeOf(e, b), e);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function N(e) {
|
2023-09-07 17:35:23 +02:00
|
|
|
return b.isPrototypeOf(e) && e !== b ? e : b;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// src/dom.js
|
2023-09-08 20:18:58 +02:00
|
|
|
var v = "html";
|
2023-09-08 10:52:45 +02:00
|
|
|
function ee(e) {
|
2023-09-08 20:18:58 +02:00
|
|
|
return v = e === "svg" ? "http://www.w3.org/2000/svg" : e, {
|
2023-09-05 09:25:47 +02:00
|
|
|
append(t) {
|
2023-09-08 20:18:58 +02:00
|
|
|
return v = "html", t;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function te(e, t, ...n) {
|
|
|
|
let r = N(this), o;
|
|
|
|
switch (r.isTextContent(t) && (t = { textContent: t }), !0) {
|
2023-09-05 09:25:47 +02:00
|
|
|
case typeof e == "function":
|
|
|
|
o = e(t || void 0);
|
|
|
|
break;
|
|
|
|
case e === "#text":
|
2023-09-08 20:18:58 +02:00
|
|
|
o = y(document.createTextNode(""), t);
|
|
|
|
break;
|
|
|
|
case e === "<>":
|
|
|
|
o = y(document.createDocumentFragment(), t);
|
2023-09-05 09:25:47 +02:00
|
|
|
break;
|
2023-09-08 20:18:58 +02:00
|
|
|
case v !== "html":
|
|
|
|
o = y(document.createElementNS(v, e), t);
|
2023-09-05 09:25:47 +02:00
|
|
|
break;
|
2023-09-06 14:54:28 +02:00
|
|
|
case !o:
|
2023-09-08 20:18:58 +02:00
|
|
|
o = y(document.createElement(e), t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
return n.forEach((a) => a(o)), o;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-07 13:52:09 +02:00
|
|
|
var x = new Map(JSON.parse('[["#text,textContent",true],["HTMLElement,textContent",true],["HTMLElement,className",true]]'));
|
2023-09-08 20:18:58 +02:00
|
|
|
function y(e, ...t) {
|
|
|
|
let n = N(this);
|
2023-09-05 09:25:47 +02:00
|
|
|
if (!t.length)
|
|
|
|
return e;
|
2023-09-08 20:18:58 +02:00
|
|
|
let r = e instanceof SVGElement, o = (r ? q : D).bind(null, e, "Attribute");
|
|
|
|
return Object.entries(Object.assign({}, ...t)).forEach(function a([f, s]) {
|
|
|
|
s = n.processReactiveAttribute(e, f, s, a);
|
|
|
|
let [h] = f;
|
2023-09-08 10:52:45 +02:00
|
|
|
if (h === "=")
|
2023-09-08 20:18:58 +02:00
|
|
|
return o(f.slice(1), s);
|
2023-09-08 10:52:45 +02:00
|
|
|
if (h === ".")
|
2023-09-08 20:18:58 +02:00
|
|
|
return _(e, f.slice(1), s);
|
2023-09-08 10:52:45 +02:00
|
|
|
if (typeof s == "object")
|
2023-09-08 20:18:58 +02:00
|
|
|
switch (f) {
|
2023-09-05 09:25:47 +02:00
|
|
|
case "style":
|
2023-09-08 20:18:58 +02:00
|
|
|
return w(s, D.bind(null, e.style, "Property"));
|
2023-09-05 09:25:47 +02:00
|
|
|
case "dataset":
|
2023-09-08 20:18:58 +02:00
|
|
|
return w(s, _.bind(null, e.dataset));
|
2023-09-05 09:25:47 +02:00
|
|
|
case "ariaset":
|
2023-09-08 20:18:58 +02:00
|
|
|
return w(s, (E, O) => o("aria-" + E, O));
|
2023-09-05 09:25:47 +02:00
|
|
|
case "classList":
|
2023-09-08 15:57:51 +02:00
|
|
|
return $(e, s);
|
2023-09-05 09:25:47 +02:00
|
|
|
default:
|
2023-09-08 20:18:58 +02:00
|
|
|
return Reflect.set(e, f, s);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
if (/(aria|data)([A-Z])/.test(f))
|
|
|
|
return f = f.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), o(f, s);
|
|
|
|
switch (f) {
|
2023-09-08 15:57:51 +02:00
|
|
|
case "href":
|
2023-09-08 20:18:58 +02:00
|
|
|
return o(f, s);
|
2023-09-05 09:25:47 +02:00
|
|
|
case "xlink:href":
|
2023-09-08 20:18:58 +02:00
|
|
|
return o(f, s, "http://www.w3.org/1999/xlink");
|
2023-09-05 09:25:47 +02:00
|
|
|
case "textContent":
|
2023-09-08 20:18:58 +02:00
|
|
|
if (!r)
|
2023-09-05 09:25:47 +02:00
|
|
|
break;
|
2023-09-08 10:52:45 +02:00
|
|
|
return e.appendChild(document.createTextNode(s));
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
return k(e, f) ? _(e, f, s) : o(f, s);
|
2023-09-05 09:25:47 +02:00
|
|
|
}), e;
|
|
|
|
}
|
2023-09-08 15:57:51 +02:00
|
|
|
function $(e, t) {
|
2023-09-08 20:18:58 +02:00
|
|
|
return typeof t != "object" || w(
|
2023-09-05 09:25:47 +02:00
|
|
|
t,
|
2023-09-08 20:18:58 +02:00
|
|
|
(n, r) => e.classList.toggle(n, r === -1 ? void 0 : !!r)
|
2023-09-05 09:25:47 +02:00
|
|
|
), e;
|
|
|
|
}
|
2023-09-08 10:52:45 +02:00
|
|
|
function ne(e) {
|
2023-09-05 09:25:47 +02:00
|
|
|
return Array.from(e.children).forEach((t) => t.remove()), e;
|
|
|
|
}
|
2023-09-08 15:57:51 +02:00
|
|
|
function k(e, t) {
|
2023-09-08 20:18:58 +02:00
|
|
|
let n = "HTMLElement," + t;
|
|
|
|
if (e instanceof HTMLElement && x.has(n))
|
2023-09-08 10:52:45 +02:00
|
|
|
return x.get(n);
|
2023-09-08 20:18:58 +02:00
|
|
|
let r = e.nodeName + "," + t;
|
|
|
|
if (x.has(r))
|
|
|
|
return x.get(r);
|
|
|
|
let [o, a, f] = T(e, t), s = !A(o.set);
|
|
|
|
return (!s || a) && x.set(f === HTMLElement.prototype ? n : r, s), s;
|
2023-09-06 14:54:28 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function T(e, t, n = 0) {
|
2023-09-06 14:54:28 +02:00
|
|
|
if (e = Object.getPrototypeOf(e), !e)
|
2023-09-08 20:18:58 +02:00
|
|
|
return [{}, n, e];
|
|
|
|
let r = Object.getOwnPropertyDescriptor(e, t);
|
|
|
|
return r ? [r, n, e] : T(e, t, n + 1);
|
2023-09-06 14:54:28 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function w(e, t) {
|
|
|
|
return Object.entries(e).forEach(([n, r]) => t(n, r));
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function A(e) {
|
2023-09-05 09:25:47 +02:00
|
|
|
return typeof e > "u";
|
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function D(e, t, n, r) {
|
|
|
|
return e[(A(r) ? "remove" : "set") + t](n, r);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function q(e, t, n, r, o = null) {
|
|
|
|
return e[(A(r) ? "remove" : "set") + t + "NS"](o, n, r);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function _(e, t, n) {
|
|
|
|
return Reflect.set(e, t, n);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// src/events.js
|
2023-09-08 20:18:58 +02:00
|
|
|
function M(e, t, n) {
|
|
|
|
return (r) => (r.addEventListener(e, t, n), r);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
var S = J();
|
2023-09-08 10:52:45 +02:00
|
|
|
M.connected = function(e, t) {
|
2023-09-08 20:18:58 +02:00
|
|
|
return function(r) {
|
|
|
|
S.onConnected(r, e), t && t.signal && t.signal.addEventListener("abort", () => S.offConnected(r, e));
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
|
|
|
};
|
2023-09-08 10:52:45 +02:00
|
|
|
M.disconnected = function(e, t) {
|
2023-09-08 20:18:58 +02:00
|
|
|
return function(r) {
|
|
|
|
S.onDisconnected(r, e), t && t.signal && t.signal.addEventListener("abort", () => S.offDisconnected(r, e));
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
|
|
|
};
|
2023-09-08 20:18:58 +02:00
|
|
|
function J() {
|
|
|
|
let e = /* @__PURE__ */ new Map(), t = !1, n = new MutationObserver(function(c) {
|
|
|
|
for (let i of c)
|
|
|
|
if (i.type === "childList") {
|
|
|
|
if (E(i.addedNodes, !0)) {
|
|
|
|
f();
|
2023-09-05 09:25:47 +02:00
|
|
|
continue;
|
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
O(i.removedNodes, !0) && f();
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
return {
|
2023-09-08 20:18:58 +02:00
|
|
|
onConnected(c, i) {
|
|
|
|
a(), o(c).connected.push(i);
|
2023-09-05 09:25:47 +02:00
|
|
|
},
|
2023-09-08 20:18:58 +02:00
|
|
|
offConnected(c, i) {
|
2023-09-05 09:25:47 +02:00
|
|
|
if (!e.has(c))
|
|
|
|
return;
|
2023-09-08 10:52:45 +02:00
|
|
|
let u = e.get(c), l = u.connected;
|
2023-09-08 20:18:58 +02:00
|
|
|
l.splice(l.indexOf(i), 1), r(c, u);
|
2023-09-05 09:25:47 +02:00
|
|
|
},
|
2023-09-08 20:18:58 +02:00
|
|
|
onDisconnected(c, i) {
|
|
|
|
a(), o(c).disconnected.push(i);
|
2023-09-05 09:25:47 +02:00
|
|
|
},
|
2023-09-08 20:18:58 +02:00
|
|
|
offDisconnected(c, i) {
|
2023-09-05 09:25:47 +02:00
|
|
|
if (!e.has(c))
|
|
|
|
return;
|
2023-09-08 10:52:45 +02:00
|
|
|
let u = e.get(c), l = u.disconnected;
|
2023-09-08 20:18:58 +02:00
|
|
|
l.splice(l.indexOf(i), 1), r(c, u);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
};
|
2023-09-08 20:18:58 +02:00
|
|
|
function r(c, i) {
|
|
|
|
i.connected.length || i.disconnect.length || (e.delete(c), f());
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
function o(c) {
|
|
|
|
if (e.has(c))
|
|
|
|
return e.get(c);
|
2023-09-08 20:18:58 +02:00
|
|
|
let i = { connected: [], disconnected: [] };
|
|
|
|
return e.set(c, i), i;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-07 13:52:09 +02:00
|
|
|
function a() {
|
2023-09-08 20:18:58 +02:00
|
|
|
t || (t = !0, n.observe(document.body, { childList: !0, subtree: !0 }));
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function f() {
|
|
|
|
!t || e.size || (t = !1, n.disconnect());
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 10:52:45 +02:00
|
|
|
function s() {
|
2023-09-05 09:25:47 +02:00
|
|
|
return new Promise(function(c) {
|
|
|
|
(requestIdleCallback || requestAnimationFrame)(c);
|
|
|
|
});
|
|
|
|
}
|
2023-09-08 10:52:45 +02:00
|
|
|
async function h(c) {
|
|
|
|
e.size > 30 && await s();
|
2023-09-08 20:18:58 +02:00
|
|
|
let i = [];
|
2023-09-05 09:25:47 +02:00
|
|
|
if (!(c instanceof Node))
|
2023-09-08 20:18:58 +02:00
|
|
|
return i;
|
2023-09-07 17:35:23 +02:00
|
|
|
for (let u of e.keys())
|
2023-09-08 20:18:58 +02:00
|
|
|
u === c || !(u instanceof Node) || c.contains(u) && i.push(u);
|
|
|
|
return i;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function E(c, i) {
|
2023-09-07 17:35:23 +02:00
|
|
|
for (let u of c) {
|
2023-09-08 20:18:58 +02:00
|
|
|
if (i && h(u).then(E), !e.has(u))
|
2023-09-05 09:25:47 +02:00
|
|
|
return !1;
|
2023-09-08 10:52:45 +02:00
|
|
|
let l = e.get(u);
|
2023-09-08 20:18:58 +02:00
|
|
|
return l.connected.forEach((L) => L(u)), l.connected.length = 0, l.disconnected.length || e.delete(u), !0;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function O(c, i) {
|
2023-09-07 17:35:23 +02:00
|
|
|
for (let u of c) {
|
2023-09-08 20:18:58 +02:00
|
|
|
if (i && h(u).then(O), !e.has(u))
|
2023-09-05 09:25:47 +02:00
|
|
|
return !1;
|
2023-09-08 10:52:45 +02:00
|
|
|
let l = e.get(u);
|
2023-09-08 20:18:58 +02:00
|
|
|
return l.disconnected.forEach((L) => L(u)), l.connected.length = 0, l.disconnected.length = 0, e.delete(u), !0;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// index.js
|
|
|
|
[HTMLElement, DocumentFragment].forEach((e) => {
|
|
|
|
let { append: t } = e.prototype;
|
2023-09-08 20:18:58 +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-09-08 20:18:58 +02:00
|
|
|
function C(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-08 10:52:45 +02:00
|
|
|
var p = /* @__PURE__ */ new WeakMap();
|
|
|
|
function g(e, t) {
|
2023-09-05 09:25:47 +02:00
|
|
|
if (typeof e != "function")
|
2023-09-08 10:52:45 +02:00
|
|
|
return H(e, t);
|
2023-09-08 20:18:58 +02:00
|
|
|
if (C(e))
|
2023-09-05 09:25:47 +02:00
|
|
|
return e;
|
2023-09-08 20:18:58 +02:00
|
|
|
let n = H(""), r = () => n(e());
|
|
|
|
return p.set(r, /* @__PURE__ */ new Set([n])), Z(r), n;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +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-08 20:18:58 +02:00
|
|
|
if (o[t].apply(r, n), r.skip)
|
|
|
|
return Reflect.deleteProperty(r, "skip");
|
|
|
|
r.listeners.forEach((a) => a(r.value));
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
2023-09-08 20:18:58 +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-08 20:18:58 +02:00
|
|
|
return t.forEach((a) => e(a, n, r));
|
|
|
|
P(t, n), o && o.addEventListener("abort", () => F(t, n));
|
2023-09-07 17:35:23 +02:00
|
|
|
}
|
|
|
|
};
|
2023-09-08 10:52:45 +02:00
|
|
|
g.symbols = {
|
|
|
|
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-08 10:52:45 +02:00
|
|
|
g.clear = function(...e) {
|
2023-09-08 20:18:58 +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-08 20:18:58 +02:00
|
|
|
function t(n, r) {
|
|
|
|
r.listeners.forEach((o) => {
|
|
|
|
if (r.listeners.delete(o), !p.has(o))
|
2023-09-08 10:52:45 +02:00
|
|
|
return;
|
|
|
|
let a = p.get(o);
|
2023-09-08 20:18:58 +02:00
|
|
|
a.delete(n), !(a.size > 1) && (g.clear(...a), p.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-08 20:18:58 +02:00
|
|
|
g.el = function(e, t) {
|
|
|
|
let n = document.createComment("<#reactive>"), r = document.createComment("</#reactive>"), o = document.createDocumentFragment();
|
|
|
|
o.append(n, r);
|
|
|
|
let a = (f) => {
|
|
|
|
if (!n.parentNode || !r.parentNode)
|
|
|
|
return F(e, a);
|
|
|
|
let s = t(f);
|
|
|
|
Array.isArray(s) || (s = [s]);
|
|
|
|
let h = n;
|
|
|
|
for (; (h = n.nextSibling) !== r; )
|
|
|
|
h.remove();
|
|
|
|
n.after(...s);
|
|
|
|
};
|
|
|
|
return P(e, a), a(e()), o;
|
|
|
|
};
|
2023-09-08 15:57:51 +02:00
|
|
|
var z = {
|
2023-09-05 09:25:47 +02:00
|
|
|
isTextContent(e) {
|
2023-09-08 20:18:58 +02:00
|
|
|
return m(e) === "string" || C(e) && m(V(e)) === "string";
|
2023-09-05 09:25:47 +02:00
|
|
|
},
|
2023-09-08 20:18:58 +02:00
|
|
|
processReactiveAttribute(e, t, n, r) {
|
|
|
|
return C(n) ? (P(n, (o) => r([t, o])), n()) : n;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
};
|
2023-09-08 10:52:45 +02:00
|
|
|
function H(e, t) {
|
2023-09-08 20:18:58 +02:00
|
|
|
let n = (...r) => r.length ? U(n, r[0]) : G(n);
|
|
|
|
return I(n, e, t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
var W = Object.assign(/* @__PURE__ */ Object.create(null), {
|
2023-09-05 09:25:47 +02:00
|
|
|
stopPropagation() {
|
|
|
|
this.skip = !0;
|
|
|
|
}
|
|
|
|
});
|
2023-09-08 20:18:58 +02:00
|
|
|
function I(e, t, n) {
|
|
|
|
return m(n) !== "[object Object]" && (n = {}), e[d] = {
|
2023-09-05 09:25:47 +02:00
|
|
|
value: t,
|
2023-09-08 20:18:58 +02:00
|
|
|
actions: n,
|
2023-09-05 09:25:47 +02:00
|
|
|
listeners: /* @__PURE__ */ new Set()
|
2023-09-08 20:18:58 +02:00
|
|
|
}, e.toJSON = () => e(), Object.setPrototypeOf(e[d], W), e;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
var R = [];
|
|
|
|
function Z(e) {
|
2023-09-05 09:25:47 +02:00
|
|
|
let t = function() {
|
2023-09-08 20:18:58 +02:00
|
|
|
R.push(t), e(), R.pop();
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
2023-09-08 10:52:45 +02:00
|
|
|
p.has(e) && (p.set(t, p.get(e)), p.delete(e)), t();
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function B() {
|
|
|
|
return R[R.length - 1];
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function G(e) {
|
2023-09-08 10:52:45 +02:00
|
|
|
if (!e[d])
|
2023-09-05 09:25:47 +02:00
|
|
|
return;
|
2023-09-08 20:18:58 +02:00
|
|
|
let { value: t, listeners: n } = e[d], r = B();
|
|
|
|
return r && n.add(r), p.has(r) && p.get(r).add(e), t;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 10:52:45 +02:00
|
|
|
function U(e, t) {
|
|
|
|
if (!e[d])
|
2023-09-05 09:25:47 +02:00
|
|
|
return;
|
2023-09-08 20:18:58 +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-09-08 10:52:45 +02:00
|
|
|
function V(e) {
|
|
|
|
return e[d].value;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 20:18:58 +02:00
|
|
|
function P(e, t) {
|
2023-09-08 10:52:45 +02:00
|
|
|
return e[d].listeners.add(t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-08 15:57:51 +02:00
|
|
|
function F(e, t) {
|
2023-09-08 10:52:45 +02:00
|
|
|
return e[d].listeners.delete(t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// src/signals.js
|
2023-09-08 20:18:58 +02:00
|
|
|
j(z);
|
2023-09-05 09:25:47 +02:00
|
|
|
export {
|
2023-09-08 10:52:45 +02:00
|
|
|
g as S,
|
2023-09-08 20:18:58 +02:00
|
|
|
y as assign,
|
2023-09-08 15:57:51 +02:00
|
|
|
$ as classListDeclarative,
|
2023-09-08 10:52:45 +02:00
|
|
|
te as createElement,
|
|
|
|
te as el,
|
|
|
|
ne as empty,
|
2023-09-08 20:18:58 +02:00
|
|
|
C as isSignal,
|
2023-09-08 10:52:45 +02:00
|
|
|
ee as namespace,
|
|
|
|
M as on,
|
2023-09-08 20:18:58 +02:00
|
|
|
j as registerReactivity
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|