New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@freact/core

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@freact/core - npm Package Compare versions

Comparing version
0.0.15
to
0.0.16
+230
-215
dist/freact.es.js

@@ -1,6 +0,6 @@

function f(s, e, ...t) {
const n = e && Object.hasOwn(e, "key"), l = e?.key;
if (delete e?.key, s === D)
return n && (t.key = l), t.length > 0 ? t : void 0;
const p = {
function c(s, e, ...t) {
const n = e && Object.hasOwn(e, "key"), o = e?.key;
if (delete e?.key, s === N)
return n && (t.key = o), t.length > 0 ? t : void 0;
const h = {
type: s,

@@ -11,7 +11,4 @@ props: {

};
return t.length > 0 && (p.props.children = t.length > 1 ? t : t[0]), n && (p.key = l), p;
return t.length > 0 && (h.props.children = t.length > 1 ? t : t[0]), n && (h.key = o), h;
}
function v(s) {
throw new Error(s);
}
const i = {

@@ -22,4 +19,7 @@ root: null,

};
function G(s, e) {
(!i.root || !i.data) && v("Missing context data inside useMemo hook");
function x(s) {
throw new Error(s);
}
function K(s, e) {
(!i.root || !i.data) && x("Missing context data inside useMemo hook");
const t = i.data.hookData, n = i.index++;

@@ -29,15 +29,15 @@ if (!Object.hasOwn(t, n))

else {
let l = t[n].deps.length === e.length;
if (l) {
for (let p = 0; p < e.length; p++)
if (!Object.is(t[n].deps[p], e[p])) {
l = !1;
let o = t[n].deps.length === e.length;
if (o) {
for (let h = 0; h < e.length; h++)
if (!Object.is(t[n].deps[h], e[h])) {
o = !1;
break;
}
}
l || (t[n].val = s(), t[n].deps = e);
o || (t[n].val = s(), t[n].deps = e);
}
return t[n].val;
}
const W = (s, e) => {
const V = (s, e) => {
const t = Object.keys(e);

@@ -52,12 +52,12 @@ if (t.length !== Object.keys(s).length)

return !1;
for (let l = 0; l < e.children.length; l++)
if (!Object.is(e.children[l], s.children[l]))
for (let o = 0; o < e.children.length; o++)
if (!Object.is(e.children[o], s.children[o]))
return !1;
}
for (const l of t)
if (l !== "children" && !Object.is(s[l], e[l]))
for (const o of t)
if (o !== "children" && !Object.is(s[o], e[o]))
return !1;
return !0;
};
function $(s, e = W) {
function $(s, e = V) {
let t = !1;

@@ -67,6 +67,6 @@ return (n) => (t = e(

n
) ? t : !t, G(() => f(s, n), [t]));
) ? t : !t, K(() => c(s, n), [t]));
}
function V(s, e) {
(!i.root || !i.data) && v("Missing context data inside useEffect hook");
function q(s, e) {
(!i.root || !i.data) && x("Missing context data inside useEffect hook");
const t = i.data.hookData, n = i.index++;

@@ -80,25 +80,25 @@ if (!Object.hasOwn(t, n))

else {
let l = !!t[n].deps && t[n].deps?.length === e?.length;
if (l) {
for (let p = 0; p < e.length; p++)
if (!Object.is(t[n].deps[p], e[p])) {
l = !1;
let o = !!t[n].deps && t[n].deps?.length === e?.length;
if (o) {
for (let h = 0; h < e.length; h++)
if (!Object.is(t[n].deps[h], e[h])) {
o = !1;
break;
}
}
l || (t[n].effect = s, t[n].deps = e ?? null);
o || (t[n].effect = s, t[n].deps = e ?? null);
}
}
function q(s) {
(!i.root || !i.data) && v("Missing context data inside useContext hook");
function H(s) {
(!i.root || !i.data) && x("Missing context data inside useContext hook");
const e = i.data.hookData, t = i.index++, n = i.data.self;
if (!Object.hasOwn(e, t)) {
let l = i.data.parent?.value;
for (; l && l.type !== s.Provider; )
l = l.__context?.parent?.value;
l ? (l.__context?.providerData || v("Provider doesn't contain ProviderData. How?"), l.__context.providerData.subs.add(n), e[t] = l.__context.providerData) : e[t] = { val: s.__defaultValue };
let o = i.data.parent?.value;
for (; o && o.type !== s.Provider; )
o = o.__context?.parent?.value;
o ? (o.__context?.providerData || x("Provider doesn't contain ProviderData. How?"), o.__context.providerData.subs.add(n), e[t] = o.__context.providerData) : e[t] = { val: s.__defaultValue };
}
return V(() => () => e[t].subs?.delete(n), []), e[t].val;
return q(() => () => e[t].subs?.delete(n), []), e[t].val;
}
class H {
class U {
// @ts-ignore

@@ -110,48 +110,48 @@ __defaultValue;

Provider = ({ value: e, children: t }) => {
const n = m({ val: e, subs: /* @__PURE__ */ new Set() }), l = m(!0);
return l.current && (i.data.providerData = n.current, l.current = !1), Object.is(n.current.val, e) || (n.current.val = e, n.current.subs.forEach((p) => {
i.root?.__internalAddPending(p);
})), f(D, null, t);
const n = S({ val: e, subs: /* @__PURE__ */ new Set() }), o = S(!0);
return o.current && (i.data.providerData = n.current, o.current = !1), Object.is(n.current.val, e) || (n.current.val = e, n.current.subs.forEach((h) => {
i.root?.__internalAddPending(h);
})), c(N, null, t);
};
Consumer = ({ children: e }) => {
const t = q(this);
return f(D, null, e(t));
const t = H(this);
return c(N, null, e(t));
};
}
function B(s) {
return new H(s);
return new U(s);
}
function F(s, e) {
return (!i.root || !i.data) && v("Missing context data inside useCallback hook"), G(() => s, e);
return (!i.root || !i.data) && x("Missing context data inside useCallback hook"), K(() => s, e);
}
function z(s, e, t) {
(!i.root || !i.data) && v("Missing context data inside useReducer hook");
const n = i.data.hookData, l = i.index++, p = i.root, y = i.data.self;
if (!Object.hasOwn(n, l)) {
const b = (L) => {
const x = s(n[l].val, L);
Object.is(x, n[l].val) || (n[l].val = x, p.__internalAddPending(y), p.__internalUpdate());
function J(s, e, t) {
(!i.root || !i.data) && x("Missing context data inside useReducer hook");
const n = i.data.hookData, o = i.index++, h = i.root, O = i.data.self;
if (!Object.hasOwn(n, o)) {
const k = (m) => {
const E = s(n[o].val, m);
Object.is(E, n[o].val) || (n[o].val = E, h.__internalAddPending(O), h.__internalUpdate());
};
n[l] = {
n[o] = {
val: t ? t(e) : e,
dispatch: b
dispatch: k
};
}
return [n[l].val, n[l].dispatch];
return [n[o].val, n[o].dispatch];
}
function m(s) {
(!i.root || !i.data) && v("Missing context data inside useRef hook");
function S(s) {
(!i.root || !i.data) && x("Missing context data inside useRef hook");
const e = i.data.hookData, t = i.index++;
return Object.hasOwn(e, t) || (e[t] = { current: s }), e[t];
}
function J(s) {
(!i.root || !i.data) && v("Missing context data inside useState hook");
const e = i.data.hookData, t = i.index++, n = i.root, l = i.data.self;
function Q(s) {
(!i.root || !i.data) && x("Missing context data inside useState hook");
const e = i.data.hookData, t = i.index++, n = i.root, o = i.data.self;
if (!Object.hasOwn(e, t)) {
const p = (y) => {
const b = typeof y == "function" ? y(e[t].val) : y;
Object.is(b, e[t].val) || (e[t].val = b, n.__internalAddPending(l), n.__internalUpdate());
const h = (O) => {
const k = typeof O == "function" ? O(e[t].val) : O;
Object.is(k, e[t].val) || (e[t].val = k, n.__internalAddPending(o), n.__internalUpdate());
};
e[t] = {
setter: p,
setter: h,
val: typeof s != "function" ? s : s()

@@ -163,3 +163,3 @@ };

var a = /* @__PURE__ */ ((s) => (s[s.LITERAL = 0] = "LITERAL", s[s.FRAGMENT = 1] = "FRAGMENT", s[s.ELEMENT = 2] = "ELEMENT", s[s.COMPONENT = 4] = "COMPONENT", s[s.NODRAW = 5] = "NODRAW", s))(a || {});
function S(s) {
function P(s) {
for (const e of s.fx)

@@ -174,3 +174,3 @@ e.effect && e.cb?.();

}
function P(s) {
function I(s) {
return Object.hasOwn(s.props, "children") ? Array.isArray(s.props.children) ? s.props.children : [s.props.children] : [];

@@ -181,14 +181,14 @@ }

}
function R(s) {
function L(s) {
return typeof s == "object" && s !== null ? Array.isArray(s) ? a.FRAGMENT : typeof s.type == "function" ? a.COMPONENT : a.ELEMENT : typeof s == "string" || typeof s == "number" || typeof s == "bigint" ? a.LITERAL : a.NODRAW;
}
function N(s, e, t) {
function R(s, e, t) {
const n = typeof e == "object" ? e : document.createTextNode(`${e}`);
s.childNodes.length > 0 ? s.insertBefore(n, s.childNodes[t]) : s.appendChild(n);
}
function M(s) {
function j(s) {
const e = Array.isArray(s) ? [...s] : [s];
for (let t = 0; t < e.length; t++) {
const n = e[t];
switch (R(n)) {
switch (L(n)) {
case a.COMPONENT: {

@@ -203,3 +203,3 @@ e[t] = {

case a.ELEMENT: {
const l = {
const o = {
type: n.type,

@@ -209,8 +209,8 @@ props: { ...n.props },

};
Object.hasOwn(n, "key") && (l.key = n.key), n.props.children && (l.props.children = M(l.props.children)), e[t] = l;
Object.hasOwn(n, "key") && (o.key = n.key), n.props.children && (o.props.children = j(o.props.children)), e[t] = o;
break;
}
case a.FRAGMENT: {
const l = M(n);
Object.hasOwn(n, "key") && (l.key = n.key), l.__vnode = n, e[t] = l;
const o = j(n);
Object.hasOwn(n, "key") && (o.key = n.key), o.__vnode = n, e[t] = o;
break;

@@ -222,14 +222,14 @@ }

}
function I(s, e) {
function G(s, e) {
const t = i.data, n = i.index;
i.data = s, i.index = 0, e(), i.data = t, i.index = n;
}
function K(s, e) {
function W(s, e) {
for (const t of Object.keys(e))
typeof e[t] == "object" ? K(s[t], e[t]) : s[t] = e[t];
typeof e[t] == "object" ? W(s[t], e[t]) : s[t] = e[t];
}
function w(s, e, t) {
e === "class" && (e = "className"), typeof t == "object" ? K(s[e], t) : s[e] = t;
e === "class" && (e = "className"), typeof t == "object" ? W(s[e], t) : s[e] = t;
}
class U {
class z {
#s;

@@ -241,122 +241,122 @@ #t = /* @__PURE__ */ new Set();

}
#e(e, t, n, l) {
for (const o of Object.keys(t.props))
(t.props[o] === void 0 || t.props[o] === null) && delete t.props[o];
const p = /* @__PURE__ */ new Set([...Object.keys(t.props), ...Object.keys(e.props)]);
for (const o of p)
if (o !== "children") {
if (o === "ref") {
Object.hasOwn(e.props, o) && (e.props[o].current = null), Object.hasOwn(t.props, o) && (t.props[o].current = n);
#e(e, t, n, o) {
for (const l of Object.keys(t.props))
(t.props[l] === void 0 || t.props[l] === null) && delete t.props[l];
const h = /* @__PURE__ */ new Set([...Object.keys(t.props), ...Object.keys(e.props)]);
for (const l of h)
if (l !== "children") {
if (l === "ref") {
Object.hasOwn(e.props, l) && (e.props[l].current = null), Object.hasOwn(t.props, l) && (t.props[l].current = n);
continue;
}
if (!Object.hasOwn(t.props, o))
o.slice(0, 2) === "on" && typeof e.props[o] == "function" ? n.removeEventListener(o.slice(2).toLowerCase(), e.props[o]) : n[o] = "";
else if (!Object.hasOwn(e.props, o))
o.slice(0, 2) === "on" && typeof t.props[o] == "function" ? n.addEventListener(o.slice(2).toLowerCase(), t.props[o]) : w(n, o, t.props[o]);
else if (o.slice(0, 2) === "on") {
if (t.props[o] === e.props[o])
if (!Object.hasOwn(t.props, l))
l.slice(0, 2) === "on" && typeof e.props[l] == "function" ? n.removeEventListener(l.slice(2).toLowerCase(), e.props[l]) : n[l] = "";
else if (!Object.hasOwn(e.props, l))
l.slice(0, 2) === "on" && typeof t.props[l] == "function" ? n.addEventListener(l.slice(2).toLowerCase(), t.props[l]) : w(n, l, t.props[l]);
else if (l.slice(0, 2) === "on") {
if (t.props[l] === e.props[l])
continue;
const h = o.slice(2).toLowerCase();
typeof e.props[o] == "function" ? n.removeEventListener(h, e.props[o]) : w(n, o, ""), typeof t.props[o] == "function" ? n.addEventListener(h, t.props[o]) : w(n, o, t.props[o]);
} else if (o === "value" || o === "checked")
n[o] !== t.props[o] && w(n, o, t.props[o]);
const u = l.slice(2).toLowerCase();
typeof e.props[l] == "function" ? n.removeEventListener(u, e.props[l]) : w(n, l, ""), typeof t.props[l] == "function" ? n.addEventListener(u, t.props[l]) : w(n, l, t.props[l]);
} else if (l === "value" || l === "checked")
n[l] !== t.props[l] && w(n, l, t.props[l]);
else {
if (t.props[o] === e.props[o])
if (t.props[l] === e.props[l])
continue;
w(n, o, t.props[o]);
w(n, l, t.props[l]);
}
}
const y = P(e), b = P(t), L = Math.max(y.length, b.length), x = /* @__PURE__ */ new Map(), c = l ?? { value: 0 };
let A = c.value;
for (let o = 0; o < y.length; o++) {
const h = y[o], O = b[o], k = C(h), g = C(O), E = R(h), _ = A;
if (A = E === a.FRAGMENT || E === a.COMPONENT ? h.__domEnd : A + 1, k === null || k === g)
const O = I(e), k = I(t), m = Math.max(O.length, k.length), E = /* @__PURE__ */ new Map(), f = o ?? { value: 0 };
let A = f.value;
for (let l = 0; l < O.length; l++) {
const u = O[l], _ = k[l], v = C(u), g = C(_), b = L(u), d = A;
if (A = b === a.FRAGMENT || b === a.COMPONENT ? u.__domEnd : A + 1, v === null || v === g)
continue;
const r = [];
for (let u = _; u < A; u++)
r.push(n.childNodes[u]);
x.set(k, [h, r]), y[o] = void 0;
for (let p = d; p < A; p++)
r.push(n.childNodes[p]);
E.set(v, [u, r]), O[l] = void 0;
}
for (const [o, [h, O]] of x)
for (const k of O)
n.removeChild(k);
for (let o = 0; o < L; o++) {
const h = b[o];
let O = y[o];
const k = C(O), g = C(h);
if (g !== null && g !== k && x.has(g)) {
const [d, j] = x.get(g);
x.delete(g), k === null && this.#e(
f(null, null, O),
f(null, null),
for (const [l, [u, _]] of E)
for (const v of _)
n.removeChild(v);
for (let l = 0; l < m; l++) {
const u = k[l];
let _ = O[l];
const v = C(_), g = C(u);
if (g !== null && g !== v && E.has(g)) {
const [y, M] = E.get(g);
E.delete(g), v === null && this.#e(
c(null, null, _),
c(null, null),
n,
c
), y[o] = d, O = d;
for (let T = 0; T < j.length; T++)
N(n, j[T], c.value + T);
f
), O[l] = y, _ = y;
for (let T = 0; T < M.length; T++)
R(n, M[T], f.value + T);
}
const E = R(O), _ = R(h), r = h, u = O;
if (_ !== a.NODRAW) {
if (E !== a.NODRAW)
if (E !== _ || (_ === a.ELEMENT || _ === a.COMPONENT) && r.type !== u.type)
const b = L(_), d = L(u), r = u, p = _;
if (d !== a.NODRAW) {
if (b !== a.NODRAW)
if (b !== d || (d === a.ELEMENT || d === a.COMPONENT) && r.type !== p.type)
this.#e(
f(null, null, O),
f(null, null),
c(null, null, _),
c(null, null),
n,
c
f
), this.#e(
f(null, null),
f(null, null, h),
c(null, null),
c(null, null, u),
n,
c
f
);
else {
if (_ === a.ELEMENT || _ === a.COMPONENT || _ === a.FRAGMENT) {
if (Object.is(u.__vnode, r.__vnode)) {
r.__vnode = u.__vnode, (_ === a.COMPONENT || _ === a.FRAGMENT) && (r.__domStart = u.__domStart, r.__domEnd = u.__domEnd), _ === a.COMPONENT && (r.__context = u.__context, r.__context.self.value = r, r.__ref = u.__ref), c.value = _ === a.ELEMENT ? c.value + 1 : u.__domEnd;
if (d === a.ELEMENT || d === a.COMPONENT || d === a.FRAGMENT) {
if (Object.is(p.__vnode, r.__vnode)) {
r.__vnode = p.__vnode, (d === a.COMPONENT || d === a.FRAGMENT) && (r.__domStart = p.__domStart, r.__domEnd = p.__domEnd), d === a.COMPONENT && (r.__context = p.__context, r.__context.self.value = r, r.__ref = p.__ref), f.value = d === a.ELEMENT ? f.value + 1 : p.__domEnd;
continue;
}
} else if (Object.is(O, h)) {
c.value++;
} else if (Object.is(_, u)) {
f.value++;
continue;
}
if (_ === a.LITERAL)
n.childNodes[c.value++].textContent = `${h}`;
else if (_ === a.ELEMENT) {
const d = n.childNodes[c.value++];
if (d === a.LITERAL)
n.childNodes[f.value++].textContent = `${u}`;
else if (d === a.ELEMENT) {
const y = n.childNodes[f.value++];
this.#e(
u,
p,
r,
d
y
);
} else
_ === a.COMPONENT ? (this.#t.delete(u.__context.self), I(u.__context, () => {
const d = M(r.type(r.props));
r.__domStart = c.value, r.__context = u.__context, r.__context.self.value = r, r.__ref = n, this.#e(
f(null, null, u.__context.prevTree),
f(null, null, d),
d === a.COMPONENT ? (this.#t.delete(p.__context.self), G(p.__context, () => {
const y = j(r.type(r.props));
r.__domStart = f.value, r.__context = p.__context, r.__context.self.value = r, r.__ref = n, this.#e(
c(null, null, p.__context.prevTree),
c(null, null, y),
n,
c
), r.__context.prevTree = d, r.__domEnd = c.value, S(r.__context);
})) : (r.__domStart = c.value, this.#e(
f(null, null, ...O),
f(null, null, ...h),
f
), r.__context.prevTree = y, r.__domEnd = f.value, P(r.__context);
})) : (r.__domStart = f.value, this.#e(
c(null, null, ..._),
c(null, null, ...u),
n,
c
), r.__domEnd = c.value);
f
), r.__domEnd = f.value);
}
else if (_ === a.LITERAL)
N(n, h, c.value++);
else if (_ === a.FRAGMENT)
r.__domStart = c.value, this.#e(
f(null, null),
f(null, null, ...h),
else if (d === a.LITERAL)
R(n, u, f.value++);
else if (d === a.FRAGMENT)
r.__domStart = f.value, this.#e(
c(null, null),
c(null, null, ...u),
n,
c
), r.__domEnd = c.value;
f
), r.__domEnd = f.value;
else if (typeof r.type == "string") {
const d = document.createElement(r.type);
this.#e(f(r.type, {}), r, d), N(n, d, c.value++);
const y = document.createElement(r.type);
this.#e(c(r.type, {}), r, y), R(n, y, f.value++);
} else if (r.type !== null) {
const d = {
const y = {
hookData: [],

@@ -367,38 +367,51 @@ fx: [],

prevTree: null,
parent: i.data?.self ?? null
parent: i.data?.self ?? null,
depth: (i.data?.depth ?? -1) + 1
};
I(d, () => {
const j = M(r.type(r.props));
r.__domStart = c.value, r.__context = d, r.__ref = n, this.#e(
f(null, null),
f(null, null, j),
G(y, () => {
const M = j(r.type(r.props));
r.__domStart = f.value, r.__context = y, r.__ref = n, this.#e(
c(null, null),
c(null, null, M),
n,
c
), r.__domEnd = c.value, d.prevTree = j, S(r.__context);
f
), r.__domEnd = f.value, y.prevTree = M, P(r.__context);
});
}
} else if (E !== a.NODRAW)
if (E === a.FRAGMENT)
} else if (b !== a.NODRAW)
if (b === a.FRAGMENT)
this.#e(
f(null, null, ...O),
f(null, null, h),
c(null, null, ..._),
c(null, null),
n,
c
f
);
else if (E === a.COMPONENT) {
this.#t.delete(u.__context.self), this.#e(
f(null, null, u.__context.prevTree),
f(null, null, h),
else if (b === a.COMPONENT) {
this.#t.delete(p.__context.self), this.#e(
c(null, null, p.__context.prevTree),
c(null, null),
n,
c
f
);
for (const d of u.__context.fx)
d.cb?.();
for (const y of p.__context.fx)
y.cb?.();
} else
E === a.ELEMENT && (y.length > 0 && this.#e(
u,
f(null, null),
n.childNodes[c.value]
), Object.hasOwn(u.props, "ref") && (u.props.ref.current = null)), n.childNodes[c.value].remove();
b === a.ELEMENT && (O.length > 0 && this.#e(
p,
c(null, null),
n.childNodes[f.value]
), Object.hasOwn(p.props, "ref") && (p.props.ref.current = null)), n.childNodes[f.value].remove();
}
if (E.size < 1)
return;
const D = document.createElement("div");
for (const [l, [u, _]] of E) {
for (let v = 0; v < _.length; v++)
R(D, _[v], v);
typeof u == "object" && u !== null && Object.hasOwn(u, "key") && delete u.key, this.#e(
c(null, null, u),
c(null, null),
D
);
}
}

@@ -412,10 +425,12 @@ // @ts-ignore

this.#n || (this.#n = !0, requestIdleCallback(() => {
i.root = this;
for (const e of this.#t) {
const t = { value: e.value.__domStart };
for (i.root = this; this.#t.size > 0; ) {
let e, t = 1 / 0;
for (const o of this.#t)
o.value.__context.depth < t && (t = o.value.__context.depth, e = o);
const n = { value: e.value.__domStart };
this.#t.delete(e), this.#e(
f(null, null, e.value),
M(f(null, null, e.value)),
c(null, null, e.value),
j(c(null, null, e.value)),
e.value.__ref,
t
n
);

@@ -428,4 +443,4 @@ }

i.root = this, this.#e(
f(null, null),
M(f(null, null, e)),
c(null, null),
j(c(null, null, e)),
this.#s

@@ -435,20 +450,20 @@ );

}
function Q(s) {
function X(s) {
const e = document.querySelector(s);
return e || v("Root element doesn't exist"), new U(e);
return e || x("Root element doesn't exist"), new z(e);
}
const D = Symbol.for("freact.fragment");
const N = Symbol.for("freact.fragment");
export {
D as Fragment,
N as Fragment,
B as createContext,
Q as createRoot,
f as h,
X as createRoot,
c as h,
$ as memo,
F as useCallback,
q as useContext,
V as useEffect,
G as useMemo,
z as useReducer,
m as useRef,
J as useState
H as useContext,
q as useEffect,
K as useMemo,
J as useReducer,
S as useRef,
Q as useState
};

@@ -1,1 +0,1 @@

var Freact=function(y){"use strict";function c(s,e,...t){const n=e&&Object.hasOwn(e,"key"),o=e?.key;if(delete e?.key,s===R)return n&&(t.key=o),t.length>0?t:void 0;const p={type:s,props:{...e}};return t.length>0&&(p.props.children=t.length>1?t:t[0]),n&&(p.key=o),p}function v(s){throw new Error(s)}const i={root:null,data:null,index:0};function N(s,e){(!i.root||!i.data)&&v("Missing context data inside useMemo hook");const t=i.data.hookData,n=i.index++;if(!Object.hasOwn(t,n))t[n]={val:s(),deps:e};else{let o=t[n].deps.length===e.length;if(o){for(let p=0;p<e.length;p++)if(!Object.is(t[n].deps[p],e[p])){o=!1;break}}o||(t[n].val=s(),t[n].deps=e)}return t[n].val}const F=(s,e)=>{const t=Object.keys(e);if(t.length!==Object.keys(s).length)return!1;const n=Object.hasOwn(e,"children");if(Object.hasOwn(s,"children")!==n)return!1;if(n){if(s.children.length!==e.children.length)return!1;for(let o=0;o<e.children.length;o++)if(!Object.is(e.children[o],s.children[o]))return!1}for(const o of t)if(o!=="children"&&!Object.is(s[o],e[o]))return!1;return!0};function H(s,e=F){let t=!1;return n=>(t=e(i.data?.self.value.__context?.prevProps??{},n)?t:!t,N(()=>c(s,n),[t]))}function I(s,e){(!i.root||!i.data)&&v("Missing context data inside useEffect hook");const t=i.data.hookData,n=i.index++;if(!Object.hasOwn(t,n))t[n]={effect:s,cb:null,deps:e??null},i.data.fx.push(t[n]);else{let o=!!t[n].deps&&t[n].deps?.length===e?.length;if(o){for(let p=0;p<e.length;p++)if(!Object.is(t[n].deps[p],e[p])){o=!1;break}}o||(t[n].effect=s,t[n].deps=e??null)}}function G(s){(!i.root||!i.data)&&v("Missing context data inside useContext hook");const e=i.data.hookData,t=i.index++,n=i.data.self;if(!Object.hasOwn(e,t)){let o=i.data.parent?.value;for(;o&&o.type!==s.Provider;)o=o.__context?.parent?.value;o?(o.__context?.providerData||v("Provider doesn't contain ProviderData. How?"),o.__context.providerData.subs.add(n),e[t]=o.__context.providerData):e[t]={val:s.__defaultValue}}return I(()=>()=>e[t].subs?.delete(n),[]),e[t].val}class U{__defaultValue;constructor(e){this.__defaultValue=e}Provider=({value:e,children:t})=>{const n=D({val:e,subs:new Set}),o=D(!0);return o.current&&(i.data.providerData=n.current,o.current=!1),Object.is(n.current.val,e)||(n.current.val=e,n.current.subs.forEach(p=>{i.root?.__internalAddPending(p)})),c(R,null,t)};Consumer=({children:e})=>{const t=G(this);return c(R,null,e(t))}}function $(s){return new U(s)}function B(s,e){return(!i.root||!i.data)&&v("Missing context data inside useCallback hook"),N(()=>s,e)}function z(s,e,t){(!i.root||!i.data)&&v("Missing context data inside useReducer hook");const n=i.data.hookData,o=i.index++,p=i.root,O=i.data.self;if(!Object.hasOwn(n,o)){const k=P=>{const x=s(n[o].val,P);Object.is(x,n[o].val)||(n[o].val=x,p.__internalAddPending(O),p.__internalUpdate())};n[o]={val:t?t(e):e,dispatch:k}}return[n[o].val,n[o].dispatch]}function D(s){(!i.root||!i.data)&&v("Missing context data inside useRef hook");const e=i.data.hookData,t=i.index++;return Object.hasOwn(e,t)||(e[t]={current:s}),e[t]}function J(s){(!i.root||!i.data)&&v("Missing context data inside useState hook");const e=i.data.hookData,t=i.index++,n=i.root,o=i.data.self;if(!Object.hasOwn(e,t)){const p=O=>{const k=typeof O=="function"?O(e[t].val):O;Object.is(k,e[t].val)||(e[t].val=k,n.__internalAddPending(o),n.__internalUpdate())};e[t]={setter:p,val:typeof s!="function"?s:s()}}return[e[t].val,e[t].setter]}var a=(s=>(s[s.LITERAL=0]="LITERAL",s[s.FRAGMENT=1]="FRAGMENT",s[s.ELEMENT=2]="ELEMENT",s[s.COMPONENT=4]="COMPONENT",s[s.NODRAW=5]="NODRAW",s))(a||{});function K(s){for(const e of s.fx)e.effect&&e.cb?.();for(const e of s.fx){if(!e.effect)continue;const t=e.effect();e.effect=null,typeof t=="function"&&(e.cb=t)}}function W(s){return Object.hasOwn(s.props,"children")?Array.isArray(s.props.children)?s.props.children:[s.props.children]:[]}function A(s){return typeof s!="object"||s===null||!Object.hasOwn(s,"key")||typeof s.key!="bigint"&&typeof s.key!="boolean"&&typeof s.key!="number"&&typeof s.key!="string"&&typeof s.key!="symbol"&&typeof s.key!="object"?null:s.key}function C(s){return typeof s=="object"&&s!==null?Array.isArray(s)?a.FRAGMENT:typeof s.type=="function"?a.COMPONENT:a.ELEMENT:typeof s=="string"||typeof s=="number"||typeof s=="bigint"?a.LITERAL:a.NODRAW}function S(s,e,t){const n=typeof e=="object"?e:document.createTextNode(`${e}`);s.childNodes.length>0?s.insertBefore(n,s.childNodes[t]):s.appendChild(n)}function j(s){const e=Array.isArray(s)?[...s]:[s];for(let t=0;t<e.length;t++){const n=e[t];switch(C(n)){case a.COMPONENT:{e[t]={type:n.type,props:{...n.props},__vnode:n},Object.hasOwn(n,"key")&&(e[t].key=n.key);break}case a.ELEMENT:{const o={type:n.type,props:{...n.props},__vnode:n};Object.hasOwn(n,"key")&&(o.key=n.key),n.props.children&&(o.props.children=j(o.props.children)),e[t]=o;break}case a.FRAGMENT:{const o=j(n);Object.hasOwn(n,"key")&&(o.key=n.key),o.__vnode=n,e[t]=o;break}}}return Array.isArray(s)?e:e[0]}function V(s,e){const t=i.data,n=i.index;i.data=s,i.index=0,e(),i.data=t,i.index=n}function q(s,e){for(const t of Object.keys(e))typeof e[t]=="object"?q(s[t],e[t]):s[t]=e[t]}function T(s,e,t){e==="class"&&(e="className"),typeof t=="object"?q(s[e],t):s[e]=t}class Q{#s;#t=new Set;#n=!1;constructor(e){this.#s=e,e.innerHTML=""}#e(e,t,n,o){for(const l of Object.keys(t.props))(t.props[l]===void 0||t.props[l]===null)&&delete t.props[l];const p=new Set([...Object.keys(t.props),...Object.keys(e.props)]);for(const l of p)if(l!=="children"){if(l==="ref"){Object.hasOwn(e.props,l)&&(e.props[l].current=null),Object.hasOwn(t.props,l)&&(t.props[l].current=n);continue}if(!Object.hasOwn(t.props,l))l.slice(0,2)==="on"&&typeof e.props[l]=="function"?n.removeEventListener(l.slice(2).toLowerCase(),e.props[l]):n[l]="";else if(!Object.hasOwn(e.props,l))l.slice(0,2)==="on"&&typeof t.props[l]=="function"?n.addEventListener(l.slice(2).toLowerCase(),t.props[l]):T(n,l,t.props[l]);else if(l.slice(0,2)==="on"){if(t.props[l]===e.props[l])continue;const h=l.slice(2).toLowerCase();typeof e.props[l]=="function"?n.removeEventListener(h,e.props[l]):T(n,l,""),typeof t.props[l]=="function"?n.addEventListener(h,t.props[l]):T(n,l,t.props[l])}else if(l==="value"||l==="checked")n[l]!==t.props[l]&&T(n,l,t.props[l]);else{if(t.props[l]===e.props[l])continue;T(n,l,t.props[l])}}const O=W(e),k=W(t),P=Math.max(O.length,k.length),x=new Map,f=o??{value:0};let L=f.value;for(let l=0;l<O.length;l++){const h=O[l],E=k[l],g=A(h),M=A(E),b=C(h),_=L;if(L=b===a.FRAGMENT||b===a.COMPONENT?h.__domEnd:L+1,g===null||g===M)continue;const r=[];for(let u=_;u<L;u++)r.push(n.childNodes[u]);x.set(g,[h,r]),O[l]=void 0}for(const[l,[h,E]]of x)for(const g of E)n.removeChild(g);for(let l=0;l<P;l++){const h=k[l];let E=O[l];const g=A(E),M=A(h);if(M!==null&&M!==g&&x.has(M)){const[d,w]=x.get(M);x.delete(M),g===null&&this.#e(c(null,null,E),c(null,null),n,f),O[l]=d,E=d;for(let m=0;m<w.length;m++)S(n,w[m],f.value+m)}const b=C(E),_=C(h),r=h,u=E;if(_!==a.NODRAW){if(b!==a.NODRAW)if(b!==_||(_===a.ELEMENT||_===a.COMPONENT)&&r.type!==u.type)this.#e(c(null,null,E),c(null,null),n,f),this.#e(c(null,null),c(null,null,h),n,f);else{if(_===a.ELEMENT||_===a.COMPONENT||_===a.FRAGMENT){if(Object.is(u.__vnode,r.__vnode)){r.__vnode=u.__vnode,(_===a.COMPONENT||_===a.FRAGMENT)&&(r.__domStart=u.__domStart,r.__domEnd=u.__domEnd),_===a.COMPONENT&&(r.__context=u.__context,r.__context.self.value=r,r.__ref=u.__ref),f.value=_===a.ELEMENT?f.value+1:u.__domEnd;continue}}else if(Object.is(E,h)){f.value++;continue}if(_===a.LITERAL)n.childNodes[f.value++].textContent=`${h}`;else if(_===a.ELEMENT){const d=n.childNodes[f.value++];this.#e(u,r,d)}else _===a.COMPONENT?(this.#t.delete(u.__context.self),V(u.__context,()=>{const d=j(r.type(r.props));r.__domStart=f.value,r.__context=u.__context,r.__context.self.value=r,r.__ref=n,this.#e(c(null,null,u.__context.prevTree),c(null,null,d),n,f),r.__context.prevTree=d,r.__domEnd=f.value,K(r.__context)})):(r.__domStart=f.value,this.#e(c(null,null,...E),c(null,null,...h),n,f),r.__domEnd=f.value)}else if(_===a.LITERAL)S(n,h,f.value++);else if(_===a.FRAGMENT)r.__domStart=f.value,this.#e(c(null,null),c(null,null,...h),n,f),r.__domEnd=f.value;else if(typeof r.type=="string"){const d=document.createElement(r.type);this.#e(c(r.type,{}),r,d),S(n,d,f.value++)}else if(r.type!==null){const d={hookData:[],fx:[],self:{value:r},prevProps:r.props,prevTree:null,parent:i.data?.self??null};V(d,()=>{const w=j(r.type(r.props));r.__domStart=f.value,r.__context=d,r.__ref=n,this.#e(c(null,null),c(null,null,w),n,f),r.__domEnd=f.value,d.prevTree=w,K(r.__context)})}}else if(b!==a.NODRAW)if(b===a.FRAGMENT)this.#e(c(null,null,...E),c(null,null,h),n,f);else if(b===a.COMPONENT){this.#t.delete(u.__context.self),this.#e(c(null,null,u.__context.prevTree),c(null,null,h),n,f);for(const d of u.__context.fx)d.cb?.()}else b===a.ELEMENT&&(O.length>0&&this.#e(u,c(null,null),n.childNodes[f.value]),Object.hasOwn(u.props,"ref")&&(u.props.ref.current=null)),n.childNodes[f.value].remove()}}__internalAddPending(e){this.#t.add(e)}__internalUpdate(){this.#n||(this.#n=!0,requestIdleCallback(()=>{i.root=this;for(const e of this.#t){const t={value:e.value.__domStart};this.#t.delete(e),this.#e(c(null,null,e.value),j(c(null,null,e.value)),e.value.__ref,t)}this.#n=!1}))}render(e){i.root=this,this.#e(c(null,null),j(c(null,null,e)),this.#s)}}function X(s){const e=document.querySelector(s);return e||v("Root element doesn't exist"),new Q(e)}const R=Symbol.for("freact.fragment");return y.Fragment=R,y.createContext=$,y.createRoot=X,y.h=c,y.memo=H,y.useCallback=B,y.useContext=G,y.useEffect=I,y.useMemo=N,y.useReducer=z,y.useRef=D,y.useState=J,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),y}({});
var Freact=function(O){"use strict";function c(l,e,...t){const n=e&&Object.hasOwn(e,"key"),o=e?.key;if(delete e?.key,l===m)return n&&(t.key=o),t.length>0?t:void 0;const p={type:l,props:{...e}};return t.length>0&&(p.props.children=t.length>1?t:t[0]),n&&(p.key=o),p}const i={root:null,data:null,index:0};function k(l){throw new Error(l)}function D(l,e){(!i.root||!i.data)&&k("Missing context data inside useMemo hook");const t=i.data.hookData,n=i.index++;if(!Object.hasOwn(t,n))t[n]={val:l(),deps:e};else{let o=t[n].deps.length===e.length;if(o){for(let p=0;p<e.length;p++)if(!Object.is(t[n].deps[p],e[p])){o=!1;break}}o||(t[n].val=l(),t[n].deps=e)}return t[n].val}const H=(l,e)=>{const t=Object.keys(e);if(t.length!==Object.keys(l).length)return!1;const n=Object.hasOwn(e,"children");if(Object.hasOwn(l,"children")!==n)return!1;if(n){if(l.children.length!==e.children.length)return!1;for(let o=0;o<e.children.length;o++)if(!Object.is(e.children[o],l.children[o]))return!1}for(const o of t)if(o!=="children"&&!Object.is(l[o],e[o]))return!1;return!0};function U(l,e=H){let t=!1;return n=>(t=e(i.data?.self.value.__context?.prevProps??{},n)?t:!t,D(()=>c(l,n),[t]))}function I(l,e){(!i.root||!i.data)&&k("Missing context data inside useEffect hook");const t=i.data.hookData,n=i.index++;if(!Object.hasOwn(t,n))t[n]={effect:l,cb:null,deps:e??null},i.data.fx.push(t[n]);else{let o=!!t[n].deps&&t[n].deps?.length===e?.length;if(o){for(let p=0;p<e.length;p++)if(!Object.is(t[n].deps[p],e[p])){o=!1;break}}o||(t[n].effect=l,t[n].deps=e??null)}}function G(l){(!i.root||!i.data)&&k("Missing context data inside useContext hook");const e=i.data.hookData,t=i.index++,n=i.data.self;if(!Object.hasOwn(e,t)){let o=i.data.parent?.value;for(;o&&o.type!==l.Provider;)o=o.__context?.parent?.value;o?(o.__context?.providerData||k("Provider doesn't contain ProviderData. How?"),o.__context.providerData.subs.add(n),e[t]=o.__context.providerData):e[t]={val:l.__defaultValue}}return I(()=>()=>e[t].subs?.delete(n),[]),e[t].val}class z{__defaultValue;constructor(e){this.__defaultValue=e}Provider=({value:e,children:t})=>{const n=S({val:e,subs:new Set}),o=S(!0);return o.current&&(i.data.providerData=n.current,o.current=!1),Object.is(n.current.val,e)||(n.current.val=e,n.current.subs.forEach(p=>{i.root?.__internalAddPending(p)})),c(m,null,t)};Consumer=({children:e})=>{const t=G(this);return c(m,null,e(t))}}function $(l){return new z(l)}function B(l,e){return(!i.root||!i.data)&&k("Missing context data inside useCallback hook"),D(()=>l,e)}function J(l,e,t){(!i.root||!i.data)&&k("Missing context data inside useReducer hook");const n=i.data.hookData,o=i.index++,p=i.root,v=i.data.self;if(!Object.hasOwn(n,o)){const g=P=>{const b=l(n[o].val,P);Object.is(b,n[o].val)||(n[o].val=b,p.__internalAddPending(v),p.__internalUpdate())};n[o]={val:t?t(e):e,dispatch:g}}return[n[o].val,n[o].dispatch]}function S(l){(!i.root||!i.data)&&k("Missing context data inside useRef hook");const e=i.data.hookData,t=i.index++;return Object.hasOwn(e,t)||(e[t]={current:l}),e[t]}function Q(l){(!i.root||!i.data)&&k("Missing context data inside useState hook");const e=i.data.hookData,t=i.index++,n=i.root,o=i.data.self;if(!Object.hasOwn(e,t)){const p=v=>{const g=typeof v=="function"?v(e[t].val):v;Object.is(g,e[t].val)||(e[t].val=g,n.__internalAddPending(o),n.__internalUpdate())};e[t]={setter:p,val:typeof l!="function"?l:l()}}return[e[t].val,e[t].setter]}var a=(l=>(l[l.LITERAL=0]="LITERAL",l[l.FRAGMENT=1]="FRAGMENT",l[l.ELEMENT=2]="ELEMENT",l[l.COMPONENT=4]="COMPONENT",l[l.NODRAW=5]="NODRAW",l))(a||{});function K(l){for(const e of l.fx)e.effect&&e.cb?.();for(const e of l.fx){if(!e.effect)continue;const t=e.effect();e.effect=null,typeof t=="function"&&(e.cb=t)}}function W(l){return Object.hasOwn(l.props,"children")?Array.isArray(l.props.children)?l.props.children:[l.props.children]:[]}function T(l){return typeof l!="object"||l===null||!Object.hasOwn(l,"key")||typeof l.key!="bigint"&&typeof l.key!="boolean"&&typeof l.key!="number"&&typeof l.key!="string"&&typeof l.key!="symbol"&&typeof l.key!="object"?null:l.key}function A(l){return typeof l=="object"&&l!==null?Array.isArray(l)?a.FRAGMENT:typeof l.type=="function"?a.COMPONENT:a.ELEMENT:typeof l=="string"||typeof l=="number"||typeof l=="bigint"?a.LITERAL:a.NODRAW}function R(l,e,t){const n=typeof e=="object"?e:document.createTextNode(`${e}`);l.childNodes.length>0?l.insertBefore(n,l.childNodes[t]):l.appendChild(n)}function j(l){const e=Array.isArray(l)?[...l]:[l];for(let t=0;t<e.length;t++){const n=e[t];switch(A(n)){case a.COMPONENT:{e[t]={type:n.type,props:{...n.props},__vnode:n},Object.hasOwn(n,"key")&&(e[t].key=n.key);break}case a.ELEMENT:{const o={type:n.type,props:{...n.props},__vnode:n};Object.hasOwn(n,"key")&&(o.key=n.key),n.props.children&&(o.props.children=j(o.props.children)),e[t]=o;break}case a.FRAGMENT:{const o=j(n);Object.hasOwn(n,"key")&&(o.key=n.key),o.__vnode=n,e[t]=o;break}}}return Array.isArray(l)?e:e[0]}function V(l,e){const t=i.data,n=i.index;i.data=l,i.index=0,e(),i.data=t,i.index=n}function q(l,e){for(const t of Object.keys(e))typeof e[t]=="object"?q(l[t],e[t]):l[t]=e[t]}function w(l,e,t){e==="class"&&(e="className"),typeof t=="object"?q(l[e],t):l[e]=t}class X{#l;#t=new Set;#n=!1;constructor(e){this.#l=e,e.innerHTML=""}#e(e,t,n,o){for(const s of Object.keys(t.props))(t.props[s]===void 0||t.props[s]===null)&&delete t.props[s];const p=new Set([...Object.keys(t.props),...Object.keys(e.props)]);for(const s of p)if(s!=="children"){if(s==="ref"){Object.hasOwn(e.props,s)&&(e.props[s].current=null),Object.hasOwn(t.props,s)&&(t.props[s].current=n);continue}if(!Object.hasOwn(t.props,s))s.slice(0,2)==="on"&&typeof e.props[s]=="function"?n.removeEventListener(s.slice(2).toLowerCase(),e.props[s]):n[s]="";else if(!Object.hasOwn(e.props,s))s.slice(0,2)==="on"&&typeof t.props[s]=="function"?n.addEventListener(s.slice(2).toLowerCase(),t.props[s]):w(n,s,t.props[s]);else if(s.slice(0,2)==="on"){if(t.props[s]===e.props[s])continue;const u=s.slice(2).toLowerCase();typeof e.props[s]=="function"?n.removeEventListener(u,e.props[s]):w(n,s,""),typeof t.props[s]=="function"?n.addEventListener(u,t.props[s]):w(n,s,t.props[s])}else if(s==="value"||s==="checked")n[s]!==t.props[s]&&w(n,s,t.props[s]);else{if(t.props[s]===e.props[s])continue;w(n,s,t.props[s])}}const v=W(e),g=W(t),P=Math.max(v.length,g.length),b=new Map,f=o??{value:0};let L=f.value;for(let s=0;s<v.length;s++){const u=v[s],_=g[s],E=T(u),M=T(_),x=A(u),d=L;if(L=x===a.FRAGMENT||x===a.COMPONENT?u.__domEnd:L+1,E===null||E===M)continue;const r=[];for(let h=d;h<L;h++)r.push(n.childNodes[h]);b.set(E,[u,r]),v[s]=void 0}for(const[s,[u,_]]of b)for(const E of _)n.removeChild(E);for(let s=0;s<P;s++){const u=g[s];let _=v[s];const E=T(_),M=T(u);if(M!==null&&M!==E&&b.has(M)){const[y,C]=b.get(M);b.delete(M),E===null&&this.#e(c(null,null,_),c(null,null),n,f),v[s]=y,_=y;for(let N=0;N<C.length;N++)R(n,C[N],f.value+N)}const x=A(_),d=A(u),r=u,h=_;if(d!==a.NODRAW){if(x!==a.NODRAW)if(x!==d||(d===a.ELEMENT||d===a.COMPONENT)&&r.type!==h.type)this.#e(c(null,null,_),c(null,null),n,f),this.#e(c(null,null),c(null,null,u),n,f);else{if(d===a.ELEMENT||d===a.COMPONENT||d===a.FRAGMENT){if(Object.is(h.__vnode,r.__vnode)){r.__vnode=h.__vnode,(d===a.COMPONENT||d===a.FRAGMENT)&&(r.__domStart=h.__domStart,r.__domEnd=h.__domEnd),d===a.COMPONENT&&(r.__context=h.__context,r.__context.self.value=r,r.__ref=h.__ref),f.value=d===a.ELEMENT?f.value+1:h.__domEnd;continue}}else if(Object.is(_,u)){f.value++;continue}if(d===a.LITERAL)n.childNodes[f.value++].textContent=`${u}`;else if(d===a.ELEMENT){const y=n.childNodes[f.value++];this.#e(h,r,y)}else d===a.COMPONENT?(this.#t.delete(h.__context.self),V(h.__context,()=>{const y=j(r.type(r.props));r.__domStart=f.value,r.__context=h.__context,r.__context.self.value=r,r.__ref=n,this.#e(c(null,null,h.__context.prevTree),c(null,null,y),n,f),r.__context.prevTree=y,r.__domEnd=f.value,K(r.__context)})):(r.__domStart=f.value,this.#e(c(null,null,..._),c(null,null,...u),n,f),r.__domEnd=f.value)}else if(d===a.LITERAL)R(n,u,f.value++);else if(d===a.FRAGMENT)r.__domStart=f.value,this.#e(c(null,null),c(null,null,...u),n,f),r.__domEnd=f.value;else if(typeof r.type=="string"){const y=document.createElement(r.type);this.#e(c(r.type,{}),r,y),R(n,y,f.value++)}else if(r.type!==null){const y={hookData:[],fx:[],self:{value:r},prevProps:r.props,prevTree:null,parent:i.data?.self??null,depth:(i.data?.depth??-1)+1};V(y,()=>{const C=j(r.type(r.props));r.__domStart=f.value,r.__context=y,r.__ref=n,this.#e(c(null,null),c(null,null,C),n,f),r.__domEnd=f.value,y.prevTree=C,K(r.__context)})}}else if(x!==a.NODRAW)if(x===a.FRAGMENT)this.#e(c(null,null,..._),c(null,null),n,f);else if(x===a.COMPONENT){this.#t.delete(h.__context.self),this.#e(c(null,null,h.__context.prevTree),c(null,null),n,f);for(const y of h.__context.fx)y.cb?.()}else x===a.ELEMENT&&(v.length>0&&this.#e(h,c(null,null),n.childNodes[f.value]),Object.hasOwn(h.props,"ref")&&(h.props.ref.current=null)),n.childNodes[f.value].remove()}if(b.size<1)return;const F=document.createElement("div");for(const[s,[u,_]]of b){for(let E=0;E<_.length;E++)R(F,_[E],E);typeof u=="object"&&u!==null&&Object.hasOwn(u,"key")&&delete u.key,this.#e(c(null,null,u),c(null,null),F)}}__internalAddPending(e){this.#t.add(e)}__internalUpdate(){this.#n||(this.#n=!0,requestIdleCallback(()=>{for(i.root=this;this.#t.size>0;){let e,t=1/0;for(const o of this.#t)o.value.__context.depth<t&&(t=o.value.__context.depth,e=o);const n={value:e.value.__domStart};this.#t.delete(e),this.#e(c(null,null,e.value),j(c(null,null,e.value)),e.value.__ref,n)}this.#n=!1}))}render(e){i.root=this,this.#e(c(null,null),j(c(null,null,e)),this.#l)}}function Y(l){const e=document.querySelector(l);return e||k("Root element doesn't exist"),new X(e)}const m=Symbol.for("freact.fragment");return O.Fragment=m,O.createContext=$,O.createRoot=Y,O.h=c,O.memo=U,O.useCallback=B,O.useContext=G,O.useEffect=I,O.useMemo=D,O.useReducer=J,O.useRef=S,O.useState=Q,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}),O}({});

@@ -1,1 +0,1 @@

(function(_,a){typeof exports=="object"&&typeof module<"u"?a(exports):typeof define=="function"&&define.amd?define(["exports"],a):(_=typeof globalThis<"u"?globalThis:_||self,a(_.Freact={}))})(this,function(_){"use strict";function a(s,e,...t){const n=e&&Object.hasOwn(e,"key"),l=e?.key;if(delete e?.key,s===R)return n&&(t.key=l),t.length>0?t:void 0;const p={type:s,props:{...e}};return t.length>0&&(p.props.children=t.length>1?t:t[0]),n&&(p.key=l),p}function v(s){throw new Error(s)}const i={root:null,data:null,index:0};function N(s,e){(!i.root||!i.data)&&v("Missing context data inside useMemo hook");const t=i.data.hookData,n=i.index++;if(!Object.hasOwn(t,n))t[n]={val:s(),deps:e};else{let l=t[n].deps.length===e.length;if(l){for(let p=0;p<e.length;p++)if(!Object.is(t[n].deps[p],e[p])){l=!1;break}}l||(t[n].val=s(),t[n].deps=e)}return t[n].val}const F=(s,e)=>{const t=Object.keys(e);if(t.length!==Object.keys(s).length)return!1;const n=Object.hasOwn(e,"children");if(Object.hasOwn(s,"children")!==n)return!1;if(n){if(s.children.length!==e.children.length)return!1;for(let l=0;l<e.children.length;l++)if(!Object.is(e.children[l],s.children[l]))return!1}for(const l of t)if(l!=="children"&&!Object.is(s[l],e[l]))return!1;return!0};function H(s,e=F){let t=!1;return n=>(t=e(i.data?.self.value.__context?.prevProps??{},n)?t:!t,N(()=>a(s,n),[t]))}function I(s,e){(!i.root||!i.data)&&v("Missing context data inside useEffect hook");const t=i.data.hookData,n=i.index++;if(!Object.hasOwn(t,n))t[n]={effect:s,cb:null,deps:e??null},i.data.fx.push(t[n]);else{let l=!!t[n].deps&&t[n].deps?.length===e?.length;if(l){for(let p=0;p<e.length;p++)if(!Object.is(t[n].deps[p],e[p])){l=!1;break}}l||(t[n].effect=s,t[n].deps=e??null)}}function G(s){(!i.root||!i.data)&&v("Missing context data inside useContext hook");const e=i.data.hookData,t=i.index++,n=i.data.self;if(!Object.hasOwn(e,t)){let l=i.data.parent?.value;for(;l&&l.type!==s.Provider;)l=l.__context?.parent?.value;l?(l.__context?.providerData||v("Provider doesn't contain ProviderData. How?"),l.__context.providerData.subs.add(n),e[t]=l.__context.providerData):e[t]={val:s.__defaultValue}}return I(()=>()=>e[t].subs?.delete(n),[]),e[t].val}class U{__defaultValue;constructor(e){this.__defaultValue=e}Provider=({value:e,children:t})=>{const n=D({val:e,subs:new Set}),l=D(!0);return l.current&&(i.data.providerData=n.current,l.current=!1),Object.is(n.current.val,e)||(n.current.val=e,n.current.subs.forEach(p=>{i.root?.__internalAddPending(p)})),a(R,null,t)};Consumer=({children:e})=>{const t=G(this);return a(R,null,e(t))}}function $(s){return new U(s)}function B(s,e){return(!i.root||!i.data)&&v("Missing context data inside useCallback hook"),N(()=>s,e)}function z(s,e,t){(!i.root||!i.data)&&v("Missing context data inside useReducer hook");const n=i.data.hookData,l=i.index++,p=i.root,O=i.data.self;if(!Object.hasOwn(n,l)){const k=P=>{const x=s(n[l].val,P);Object.is(x,n[l].val)||(n[l].val=x,p.__internalAddPending(O),p.__internalUpdate())};n[l]={val:t?t(e):e,dispatch:k}}return[n[l].val,n[l].dispatch]}function D(s){(!i.root||!i.data)&&v("Missing context data inside useRef hook");const e=i.data.hookData,t=i.index++;return Object.hasOwn(e,t)||(e[t]={current:s}),e[t]}function J(s){(!i.root||!i.data)&&v("Missing context data inside useState hook");const e=i.data.hookData,t=i.index++,n=i.root,l=i.data.self;if(!Object.hasOwn(e,t)){const p=O=>{const k=typeof O=="function"?O(e[t].val):O;Object.is(k,e[t].val)||(e[t].val=k,n.__internalAddPending(l),n.__internalUpdate())};e[t]={setter:p,val:typeof s!="function"?s:s()}}return[e[t].val,e[t].setter]}var c=(s=>(s[s.LITERAL=0]="LITERAL",s[s.FRAGMENT=1]="FRAGMENT",s[s.ELEMENT=2]="ELEMENT",s[s.COMPONENT=4]="COMPONENT",s[s.NODRAW=5]="NODRAW",s))(c||{});function K(s){for(const e of s.fx)e.effect&&e.cb?.();for(const e of s.fx){if(!e.effect)continue;const t=e.effect();e.effect=null,typeof t=="function"&&(e.cb=t)}}function W(s){return Object.hasOwn(s.props,"children")?Array.isArray(s.props.children)?s.props.children:[s.props.children]:[]}function A(s){return typeof s!="object"||s===null||!Object.hasOwn(s,"key")||typeof s.key!="bigint"&&typeof s.key!="boolean"&&typeof s.key!="number"&&typeof s.key!="string"&&typeof s.key!="symbol"&&typeof s.key!="object"?null:s.key}function C(s){return typeof s=="object"&&s!==null?Array.isArray(s)?c.FRAGMENT:typeof s.type=="function"?c.COMPONENT:c.ELEMENT:typeof s=="string"||typeof s=="number"||typeof s=="bigint"?c.LITERAL:c.NODRAW}function S(s,e,t){const n=typeof e=="object"?e:document.createTextNode(`${e}`);s.childNodes.length>0?s.insertBefore(n,s.childNodes[t]):s.appendChild(n)}function j(s){const e=Array.isArray(s)?[...s]:[s];for(let t=0;t<e.length;t++){const n=e[t];switch(C(n)){case c.COMPONENT:{e[t]={type:n.type,props:{...n.props},__vnode:n},Object.hasOwn(n,"key")&&(e[t].key=n.key);break}case c.ELEMENT:{const l={type:n.type,props:{...n.props},__vnode:n};Object.hasOwn(n,"key")&&(l.key=n.key),n.props.children&&(l.props.children=j(l.props.children)),e[t]=l;break}case c.FRAGMENT:{const l=j(n);Object.hasOwn(n,"key")&&(l.key=n.key),l.__vnode=n,e[t]=l;break}}}return Array.isArray(s)?e:e[0]}function V(s,e){const t=i.data,n=i.index;i.data=s,i.index=0,e(),i.data=t,i.index=n}function q(s,e){for(const t of Object.keys(e))typeof e[t]=="object"?q(s[t],e[t]):s[t]=e[t]}function T(s,e,t){e==="class"&&(e="className"),typeof t=="object"?q(s[e],t):s[e]=t}class Q{#s;#t=new Set;#n=!1;constructor(e){this.#s=e,e.innerHTML=""}#e(e,t,n,l){for(const o of Object.keys(t.props))(t.props[o]===void 0||t.props[o]===null)&&delete t.props[o];const p=new Set([...Object.keys(t.props),...Object.keys(e.props)]);for(const o of p)if(o!=="children"){if(o==="ref"){Object.hasOwn(e.props,o)&&(e.props[o].current=null),Object.hasOwn(t.props,o)&&(t.props[o].current=n);continue}if(!Object.hasOwn(t.props,o))o.slice(0,2)==="on"&&typeof e.props[o]=="function"?n.removeEventListener(o.slice(2).toLowerCase(),e.props[o]):n[o]="";else if(!Object.hasOwn(e.props,o))o.slice(0,2)==="on"&&typeof t.props[o]=="function"?n.addEventListener(o.slice(2).toLowerCase(),t.props[o]):T(n,o,t.props[o]);else if(o.slice(0,2)==="on"){if(t.props[o]===e.props[o])continue;const d=o.slice(2).toLowerCase();typeof e.props[o]=="function"?n.removeEventListener(d,e.props[o]):T(n,o,""),typeof t.props[o]=="function"?n.addEventListener(d,t.props[o]):T(n,o,t.props[o])}else if(o==="value"||o==="checked")n[o]!==t.props[o]&&T(n,o,t.props[o]);else{if(t.props[o]===e.props[o])continue;T(n,o,t.props[o])}}const O=W(e),k=W(t),P=Math.max(O.length,k.length),x=new Map,f=l??{value:0};let L=f.value;for(let o=0;o<O.length;o++){const d=O[o],E=k[o],g=A(d),M=A(E),b=C(d),h=L;if(L=b===c.FRAGMENT||b===c.COMPONENT?d.__domEnd:L+1,g===null||g===M)continue;const r=[];for(let u=h;u<L;u++)r.push(n.childNodes[u]);x.set(g,[d,r]),O[o]=void 0}for(const[o,[d,E]]of x)for(const g of E)n.removeChild(g);for(let o=0;o<P;o++){const d=k[o];let E=O[o];const g=A(E),M=A(d);if(M!==null&&M!==g&&x.has(M)){const[y,w]=x.get(M);x.delete(M),g===null&&this.#e(a(null,null,E),a(null,null),n,f),O[o]=y,E=y;for(let m=0;m<w.length;m++)S(n,w[m],f.value+m)}const b=C(E),h=C(d),r=d,u=E;if(h!==c.NODRAW){if(b!==c.NODRAW)if(b!==h||(h===c.ELEMENT||h===c.COMPONENT)&&r.type!==u.type)this.#e(a(null,null,E),a(null,null),n,f),this.#e(a(null,null),a(null,null,d),n,f);else{if(h===c.ELEMENT||h===c.COMPONENT||h===c.FRAGMENT){if(Object.is(u.__vnode,r.__vnode)){r.__vnode=u.__vnode,(h===c.COMPONENT||h===c.FRAGMENT)&&(r.__domStart=u.__domStart,r.__domEnd=u.__domEnd),h===c.COMPONENT&&(r.__context=u.__context,r.__context.self.value=r,r.__ref=u.__ref),f.value=h===c.ELEMENT?f.value+1:u.__domEnd;continue}}else if(Object.is(E,d)){f.value++;continue}if(h===c.LITERAL)n.childNodes[f.value++].textContent=`${d}`;else if(h===c.ELEMENT){const y=n.childNodes[f.value++];this.#e(u,r,y)}else h===c.COMPONENT?(this.#t.delete(u.__context.self),V(u.__context,()=>{const y=j(r.type(r.props));r.__domStart=f.value,r.__context=u.__context,r.__context.self.value=r,r.__ref=n,this.#e(a(null,null,u.__context.prevTree),a(null,null,y),n,f),r.__context.prevTree=y,r.__domEnd=f.value,K(r.__context)})):(r.__domStart=f.value,this.#e(a(null,null,...E),a(null,null,...d),n,f),r.__domEnd=f.value)}else if(h===c.LITERAL)S(n,d,f.value++);else if(h===c.FRAGMENT)r.__domStart=f.value,this.#e(a(null,null),a(null,null,...d),n,f),r.__domEnd=f.value;else if(typeof r.type=="string"){const y=document.createElement(r.type);this.#e(a(r.type,{}),r,y),S(n,y,f.value++)}else if(r.type!==null){const y={hookData:[],fx:[],self:{value:r},prevProps:r.props,prevTree:null,parent:i.data?.self??null};V(y,()=>{const w=j(r.type(r.props));r.__domStart=f.value,r.__context=y,r.__ref=n,this.#e(a(null,null),a(null,null,w),n,f),r.__domEnd=f.value,y.prevTree=w,K(r.__context)})}}else if(b!==c.NODRAW)if(b===c.FRAGMENT)this.#e(a(null,null,...E),a(null,null,d),n,f);else if(b===c.COMPONENT){this.#t.delete(u.__context.self),this.#e(a(null,null,u.__context.prevTree),a(null,null,d),n,f);for(const y of u.__context.fx)y.cb?.()}else b===c.ELEMENT&&(O.length>0&&this.#e(u,a(null,null),n.childNodes[f.value]),Object.hasOwn(u.props,"ref")&&(u.props.ref.current=null)),n.childNodes[f.value].remove()}}__internalAddPending(e){this.#t.add(e)}__internalUpdate(){this.#n||(this.#n=!0,requestIdleCallback(()=>{i.root=this;for(const e of this.#t){const t={value:e.value.__domStart};this.#t.delete(e),this.#e(a(null,null,e.value),j(a(null,null,e.value)),e.value.__ref,t)}this.#n=!1}))}render(e){i.root=this,this.#e(a(null,null),j(a(null,null,e)),this.#s)}}function X(s){const e=document.querySelector(s);return e||v("Root element doesn't exist"),new Q(e)}const R=Symbol.for("freact.fragment");_.Fragment=R,_.createContext=$,_.createRoot=X,_.h=a,_.memo=H,_.useCallback=B,_.useContext=G,_.useEffect=I,_.useMemo=N,_.useReducer=z,_.useRef=D,_.useState=J,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
(function(_,a){typeof exports=="object"&&typeof module<"u"?a(exports):typeof define=="function"&&define.amd?define(["exports"],a):(_=typeof globalThis<"u"?globalThis:_||self,a(_.Freact={}))})(this,function(_){"use strict";function a(s,e,...t){const n=e&&Object.hasOwn(e,"key"),o=e?.key;if(delete e?.key,s===R)return n&&(t.key=o),t.length>0?t:void 0;const d={type:s,props:{...e}};return t.length>0&&(d.props.children=t.length>1?t:t[0]),n&&(d.key=o),d}const i={root:null,data:null,index:0};function k(s){throw new Error(s)}function D(s,e){(!i.root||!i.data)&&k("Missing context data inside useMemo hook");const t=i.data.hookData,n=i.index++;if(!Object.hasOwn(t,n))t[n]={val:s(),deps:e};else{let o=t[n].deps.length===e.length;if(o){for(let d=0;d<e.length;d++)if(!Object.is(t[n].deps[d],e[d])){o=!1;break}}o||(t[n].val=s(),t[n].deps=e)}return t[n].val}const H=(s,e)=>{const t=Object.keys(e);if(t.length!==Object.keys(s).length)return!1;const n=Object.hasOwn(e,"children");if(Object.hasOwn(s,"children")!==n)return!1;if(n){if(s.children.length!==e.children.length)return!1;for(let o=0;o<e.children.length;o++)if(!Object.is(e.children[o],s.children[o]))return!1}for(const o of t)if(o!=="children"&&!Object.is(s[o],e[o]))return!1;return!0};function U(s,e=H){let t=!1;return n=>(t=e(i.data?.self.value.__context?.prevProps??{},n)?t:!t,D(()=>a(s,n),[t]))}function I(s,e){(!i.root||!i.data)&&k("Missing context data inside useEffect hook");const t=i.data.hookData,n=i.index++;if(!Object.hasOwn(t,n))t[n]={effect:s,cb:null,deps:e??null},i.data.fx.push(t[n]);else{let o=!!t[n].deps&&t[n].deps?.length===e?.length;if(o){for(let d=0;d<e.length;d++)if(!Object.is(t[n].deps[d],e[d])){o=!1;break}}o||(t[n].effect=s,t[n].deps=e??null)}}function G(s){(!i.root||!i.data)&&k("Missing context data inside useContext hook");const e=i.data.hookData,t=i.index++,n=i.data.self;if(!Object.hasOwn(e,t)){let o=i.data.parent?.value;for(;o&&o.type!==s.Provider;)o=o.__context?.parent?.value;o?(o.__context?.providerData||k("Provider doesn't contain ProviderData. How?"),o.__context.providerData.subs.add(n),e[t]=o.__context.providerData):e[t]={val:s.__defaultValue}}return I(()=>()=>e[t].subs?.delete(n),[]),e[t].val}class z{__defaultValue;constructor(e){this.__defaultValue=e}Provider=({value:e,children:t})=>{const n=S({val:e,subs:new Set}),o=S(!0);return o.current&&(i.data.providerData=n.current,o.current=!1),Object.is(n.current.val,e)||(n.current.val=e,n.current.subs.forEach(d=>{i.root?.__internalAddPending(d)})),a(R,null,t)};Consumer=({children:e})=>{const t=G(this);return a(R,null,e(t))}}function $(s){return new z(s)}function B(s,e){return(!i.root||!i.data)&&k("Missing context data inside useCallback hook"),D(()=>s,e)}function J(s,e,t){(!i.root||!i.data)&&k("Missing context data inside useReducer hook");const n=i.data.hookData,o=i.index++,d=i.root,v=i.data.self;if(!Object.hasOwn(n,o)){const g=P=>{const b=s(n[o].val,P);Object.is(b,n[o].val)||(n[o].val=b,d.__internalAddPending(v),d.__internalUpdate())};n[o]={val:t?t(e):e,dispatch:g}}return[n[o].val,n[o].dispatch]}function S(s){(!i.root||!i.data)&&k("Missing context data inside useRef hook");const e=i.data.hookData,t=i.index++;return Object.hasOwn(e,t)||(e[t]={current:s}),e[t]}function Q(s){(!i.root||!i.data)&&k("Missing context data inside useState hook");const e=i.data.hookData,t=i.index++,n=i.root,o=i.data.self;if(!Object.hasOwn(e,t)){const d=v=>{const g=typeof v=="function"?v(e[t].val):v;Object.is(g,e[t].val)||(e[t].val=g,n.__internalAddPending(o),n.__internalUpdate())};e[t]={setter:d,val:typeof s!="function"?s:s()}}return[e[t].val,e[t].setter]}var c=(s=>(s[s.LITERAL=0]="LITERAL",s[s.FRAGMENT=1]="FRAGMENT",s[s.ELEMENT=2]="ELEMENT",s[s.COMPONENT=4]="COMPONENT",s[s.NODRAW=5]="NODRAW",s))(c||{});function K(s){for(const e of s.fx)e.effect&&e.cb?.();for(const e of s.fx){if(!e.effect)continue;const t=e.effect();e.effect=null,typeof t=="function"&&(e.cb=t)}}function W(s){return Object.hasOwn(s.props,"children")?Array.isArray(s.props.children)?s.props.children:[s.props.children]:[]}function C(s){return typeof s!="object"||s===null||!Object.hasOwn(s,"key")||typeof s.key!="bigint"&&typeof s.key!="boolean"&&typeof s.key!="number"&&typeof s.key!="string"&&typeof s.key!="symbol"&&typeof s.key!="object"?null:s.key}function A(s){return typeof s=="object"&&s!==null?Array.isArray(s)?c.FRAGMENT:typeof s.type=="function"?c.COMPONENT:c.ELEMENT:typeof s=="string"||typeof s=="number"||typeof s=="bigint"?c.LITERAL:c.NODRAW}function m(s,e,t){const n=typeof e=="object"?e:document.createTextNode(`${e}`);s.childNodes.length>0?s.insertBefore(n,s.childNodes[t]):s.appendChild(n)}function M(s){const e=Array.isArray(s)?[...s]:[s];for(let t=0;t<e.length;t++){const n=e[t];switch(A(n)){case c.COMPONENT:{e[t]={type:n.type,props:{...n.props},__vnode:n},Object.hasOwn(n,"key")&&(e[t].key=n.key);break}case c.ELEMENT:{const o={type:n.type,props:{...n.props},__vnode:n};Object.hasOwn(n,"key")&&(o.key=n.key),n.props.children&&(o.props.children=M(o.props.children)),e[t]=o;break}case c.FRAGMENT:{const o=M(n);Object.hasOwn(n,"key")&&(o.key=n.key),o.__vnode=n,e[t]=o;break}}}return Array.isArray(s)?e:e[0]}function V(s,e){const t=i.data,n=i.index;i.data=s,i.index=0,e(),i.data=t,i.index=n}function q(s,e){for(const t of Object.keys(e))typeof e[t]=="object"?q(s[t],e[t]):s[t]=e[t]}function T(s,e,t){e==="class"&&(e="className"),typeof t=="object"?q(s[e],t):s[e]=t}class X{#s;#t=new Set;#n=!1;constructor(e){this.#s=e,e.innerHTML=""}#e(e,t,n,o){for(const l of Object.keys(t.props))(t.props[l]===void 0||t.props[l]===null)&&delete t.props[l];const d=new Set([...Object.keys(t.props),...Object.keys(e.props)]);for(const l of d)if(l!=="children"){if(l==="ref"){Object.hasOwn(e.props,l)&&(e.props[l].current=null),Object.hasOwn(t.props,l)&&(t.props[l].current=n);continue}if(!Object.hasOwn(t.props,l))l.slice(0,2)==="on"&&typeof e.props[l]=="function"?n.removeEventListener(l.slice(2).toLowerCase(),e.props[l]):n[l]="";else if(!Object.hasOwn(e.props,l))l.slice(0,2)==="on"&&typeof t.props[l]=="function"?n.addEventListener(l.slice(2).toLowerCase(),t.props[l]):T(n,l,t.props[l]);else if(l.slice(0,2)==="on"){if(t.props[l]===e.props[l])continue;const u=l.slice(2).toLowerCase();typeof e.props[l]=="function"?n.removeEventListener(u,e.props[l]):T(n,l,""),typeof t.props[l]=="function"?n.addEventListener(u,t.props[l]):T(n,l,t.props[l])}else if(l==="value"||l==="checked")n[l]!==t.props[l]&&T(n,l,t.props[l]);else{if(t.props[l]===e.props[l])continue;T(n,l,t.props[l])}}const v=W(e),g=W(t),P=Math.max(v.length,g.length),b=new Map,f=o??{value:0};let L=f.value;for(let l=0;l<v.length;l++){const u=v[l],y=g[l],E=C(u),j=C(y),x=A(u),h=L;if(L=x===c.FRAGMENT||x===c.COMPONENT?u.__domEnd:L+1,E===null||E===j)continue;const r=[];for(let p=h;p<L;p++)r.push(n.childNodes[p]);b.set(E,[u,r]),v[l]=void 0}for(const[l,[u,y]]of b)for(const E of y)n.removeChild(E);for(let l=0;l<P;l++){const u=g[l];let y=v[l];const E=C(y),j=C(u);if(j!==null&&j!==E&&b.has(j)){const[O,w]=b.get(j);b.delete(j),E===null&&this.#e(a(null,null,y),a(null,null),n,f),v[l]=O,y=O;for(let N=0;N<w.length;N++)m(n,w[N],f.value+N)}const x=A(y),h=A(u),r=u,p=y;if(h!==c.NODRAW){if(x!==c.NODRAW)if(x!==h||(h===c.ELEMENT||h===c.COMPONENT)&&r.type!==p.type)this.#e(a(null,null,y),a(null,null),n,f),this.#e(a(null,null),a(null,null,u),n,f);else{if(h===c.ELEMENT||h===c.COMPONENT||h===c.FRAGMENT){if(Object.is(p.__vnode,r.__vnode)){r.__vnode=p.__vnode,(h===c.COMPONENT||h===c.FRAGMENT)&&(r.__domStart=p.__domStart,r.__domEnd=p.__domEnd),h===c.COMPONENT&&(r.__context=p.__context,r.__context.self.value=r,r.__ref=p.__ref),f.value=h===c.ELEMENT?f.value+1:p.__domEnd;continue}}else if(Object.is(y,u)){f.value++;continue}if(h===c.LITERAL)n.childNodes[f.value++].textContent=`${u}`;else if(h===c.ELEMENT){const O=n.childNodes[f.value++];this.#e(p,r,O)}else h===c.COMPONENT?(this.#t.delete(p.__context.self),V(p.__context,()=>{const O=M(r.type(r.props));r.__domStart=f.value,r.__context=p.__context,r.__context.self.value=r,r.__ref=n,this.#e(a(null,null,p.__context.prevTree),a(null,null,O),n,f),r.__context.prevTree=O,r.__domEnd=f.value,K(r.__context)})):(r.__domStart=f.value,this.#e(a(null,null,...y),a(null,null,...u),n,f),r.__domEnd=f.value)}else if(h===c.LITERAL)m(n,u,f.value++);else if(h===c.FRAGMENT)r.__domStart=f.value,this.#e(a(null,null),a(null,null,...u),n,f),r.__domEnd=f.value;else if(typeof r.type=="string"){const O=document.createElement(r.type);this.#e(a(r.type,{}),r,O),m(n,O,f.value++)}else if(r.type!==null){const O={hookData:[],fx:[],self:{value:r},prevProps:r.props,prevTree:null,parent:i.data?.self??null,depth:(i.data?.depth??-1)+1};V(O,()=>{const w=M(r.type(r.props));r.__domStart=f.value,r.__context=O,r.__ref=n,this.#e(a(null,null),a(null,null,w),n,f),r.__domEnd=f.value,O.prevTree=w,K(r.__context)})}}else if(x!==c.NODRAW)if(x===c.FRAGMENT)this.#e(a(null,null,...y),a(null,null),n,f);else if(x===c.COMPONENT){this.#t.delete(p.__context.self),this.#e(a(null,null,p.__context.prevTree),a(null,null),n,f);for(const O of p.__context.fx)O.cb?.()}else x===c.ELEMENT&&(v.length>0&&this.#e(p,a(null,null),n.childNodes[f.value]),Object.hasOwn(p.props,"ref")&&(p.props.ref.current=null)),n.childNodes[f.value].remove()}if(b.size<1)return;const F=document.createElement("div");for(const[l,[u,y]]of b){for(let E=0;E<y.length;E++)m(F,y[E],E);typeof u=="object"&&u!==null&&Object.hasOwn(u,"key")&&delete u.key,this.#e(a(null,null,u),a(null,null),F)}}__internalAddPending(e){this.#t.add(e)}__internalUpdate(){this.#n||(this.#n=!0,requestIdleCallback(()=>{for(i.root=this;this.#t.size>0;){let e,t=1/0;for(const o of this.#t)o.value.__context.depth<t&&(t=o.value.__context.depth,e=o);const n={value:e.value.__domStart};this.#t.delete(e),this.#e(a(null,null,e.value),M(a(null,null,e.value)),e.value.__ref,n)}this.#n=!1}))}render(e){i.root=this,this.#e(a(null,null),M(a(null,null,e)),this.#s)}}function Y(s){const e=document.querySelector(s);return e||k("Root element doesn't exist"),new X(e)}const R=Symbol.for("freact.fragment");_.Fragment=R,_.createContext=$,_.createRoot=Y,_.h=a,_.memo=U,_.useCallback=B,_.useContext=G,_.useEffect=I,_.useMemo=D,_.useReducer=J,_.useRef=S,_.useState=Q,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});

@@ -59,2 +59,3 @@ import { ProviderData } from "./createContext";

} | null;
depth: number;
providerData?: ProviderData;

@@ -61,0 +62,0 @@ }

@@ -1,2 +0,2 @@

import { FreactNode } from "@/types";
import { FreactNode } from "../types";
export declare function reinstantiate<T extends FreactNode>(node: T): T;
{
"name": "@freact/core",
"version": "0.0.15",
"version": "0.0.16",
"author": "Fry",

@@ -36,3 +36,2 @@ "license": "MIT",

"rimraf": "^5.0.1",
"terser": "^5.17.5",
"typescript": "^5.0.2",

@@ -39,0 +38,0 @@ "vite": "^4.3.2"

Sorry, the diff of this file is not supported yet