diff --git a/dist/MultiSelect.min.js b/dist/MultiSelect.min.js index 70f3022..c6de090 100644 --- a/dist/MultiSelect.min.js +++ b/dist/MultiSelect.min.js @@ -6,7 +6,7 @@ function tt(e) { for (var n = 0; n < e.length; n++) e[n](); } -const q = 2, pn = 4, ue = 8, mn = 16, K = 32, Se = 64, G = 128, de = 256, P = 512, Y = 1024, ie = 2048, L = 4096, fe = 8192, rt = 16384, He = 32768, lt = 65536, ut = 1 << 18, wn = 1 << 19, xe = Symbol("$state"); +const q = 2, pn = 4, ue = 8, wn = 16, K = 32, Se = 64, G = 128, de = 256, P = 512, Y = 1024, ie = 2048, L = 4096, fe = 8192, rt = 16384, He = 32768, lt = 65536, ut = 1 << 18, mn = 1 << 19, xe = Symbol("$state"); function En(e) { return e === this.v; } @@ -69,14 +69,14 @@ function pt(e) { function C(e, n) { return b !== null && ge() && b.f & q && // If the source was created locally within the current derived, then // we allow the mutation. - (M === null || !M.includes(e)) && ht(), e.equals(n) || (e.v = n, e.version = Dn(), yn(e, Y), ge() && w !== null && w.f & P && !(w.f & K) && (I !== null && I.includes(e) ? (F(w, Y), Te(w)) : U === null ? Ct([e]) : U.push(e))), n; + (M === null || !M.includes(e)) && ht(), e.equals(n) || (e.v = n, e.version = Dn(), yn(e, Y), ge() && m !== null && m.f & P && !(m.f & K) && (I !== null && I.includes(e) ? (F(m, Y), Te(m)) : U === null ? Ct([e]) : U.push(e))), n; } function yn(e, n) { var t = e.reactions; if (t !== null) for (var r = ge(), l = t.length, u = 0; u < l; u++) { var i = t[u], _ = i.f; - _ & Y || !r && i === w || (F(i, n), _ & (P | G) && (_ & q ? yn( + _ & Y || !r && i === m || (F(i, n), _ & (P | G) && (_ & q ? yn( /** @type {Derived} */ i, ie @@ -86,15 +86,15 @@ function yn(e, n) { ))); } } -function mt(e) { - w === null && b === null && ot(), b !== null && b.f & G && at(), Ke && ft(); +function wt(e) { + m === null && b === null && ot(), b !== null && b.f & G && at(), Ke && ft(); } -function wt(e, n) { +function mt(e, n) { var t = n.last; t === null ? n.last = n.first = e : (t.next = e, e.prev = t, n.last = e); } function ae(e, n, t, r = !0) { - var l = (e & Se) !== 0, u = w, i = { + var l = (e & Se) !== 0, u = m, i = { ctx: x, deps: null, nodes_start: null, @@ -120,8 +120,8 @@ function ae(e, n, t, r = !0) { Qe(_); } } else n !== null && Te(i); - var s = t && i.deps === null && i.first === null && i.nodes_start === null && i.teardown === null && (i.f & wn) === 0; - if (!s && !l && r && (u !== null && wt(i, u), b !== null && b.f & q)) { + var s = t && i.deps === null && i.first === null && i.nodes_start === null && i.teardown === null && (i.f & mn) === 0; + if (!s && !l && r && (u !== null && mt(i, u), b !== null && b.f & q)) { var f = ( /** @type {Derived} */ b @@ -131,8 +131,8 @@ function ae(e, n, t, r = !0) { return i; } function Et(e) { - mt(); - var n = w !== null && (w.f & ue) !== 0 && // TODO do we actually need this? removing them changes nothing + wt(); + var n = m !== null && (m.f & ue) !== 0 && // TODO do we actually need this? removing them changes nothing x !== null && !x.m; if (n) { var t = ( @@ -141,7 +141,7 @@ function Et(e) { ); (t.e ?? (t.e = [])).push({ fn: e, - effect: w, + effect: m, reaction: b }); } else { @@ -165,7 +165,7 @@ function J(e) { return Sn(e); } function kn(e, n = 0) { - return ae(ue | mn | n, e, !0); + return ae(ue | wn | n, e, !0); } function re(e, n = !0) { return ae(ue | K, e, !0, n); @@ -174,11 +174,11 @@ function Tn(e) { var n = e.teardown; if (n !== null) { const t = Ke, r = b; - $e(!0), we(null); + $e(!0), me(null); try { n.call(null); } finally { - $e(t), we(r); + $e(t), me(r); } } } @@ -260,7 +260,7 @@ function bt(e) { // @__NO_SIDE_EFFECTS__ function pe(e) { let n = q | Y; - w === null ? n |= G : w.f |= wn; + m === null ? n |= G : m.f |= mn; const t = { children: null, deps: null, @@ -273,7 +273,7 @@ function pe(e) { null ), version: 0, - parent: w + parent: m }; if (b !== null && b.f & q) { var r = ( @@ -306,7 +306,7 @@ function In(e) { } } function Nn(e) { - var n, t = w; + var n, t = m; Ee(e.parent); try { In(e), n = Pn(e); @@ -320,7 +320,7 @@ function kt(e) { In(e), le(e, 0), F(e, fe), e.children = e.deps = e.reactions = // @ts-expect-error `signal.fn` cannot be `null` while the signal is alive e.fn = null; } -let me = !1, $ = !1, Ke = !1; +let we = !1, $ = !1, Ke = !1; function Qe(e) { $ = e; } @@ -329,12 +329,12 @@ function $e(e) { } let Le = [], te = 0; let b = null; -function we(e) { +function me(e) { b = e; } -let w = null; +let m = null; function Ee(e) { - w = e; + m = e; } let M = null; function Tt(e) { @@ -373,7 +373,7 @@ function oe(e) { ) && Nn( /** @type {Derived} */ u - ), r && w !== null && !X && !((_ = u == null ? void 0 : u.reactions) != null && _.includes(e)) && (u.reactions ?? (u.reactions = [])).push(e), u.version > e.version) + ), r && m !== null && !X && !((_ = u == null ? void 0 : u.reactions) != null && _.includes(e)) && (u.reactions ?? (u.reactions = [])).push(e), u.version > e.version) return !0; } } @@ -445,10 +445,10 @@ function ke(e) { var n = e.f; if (!(n & fe)) { F(e, P); - var t = w, r = x; - w = e, x = e.ctx; + var t = m, r = x; + m = e, x = e.ctx; try { - n & mn || Rn(e), Tn(e); + n & wn || Rn(e), Tn(e); var l = Pn(e); e.teardown = typeof l == "function" ? l : null, e.version = On; } catch (u) { @@ -457,7 +457,7 @@ function ke(e) { u ); } finally { - w = t, x = r; + m = t, x = r; } } } @@ -491,13 +491,13 @@ function Ot(e) { } } function Dt() { - if (me = !1, te > 1001) + if (we = !1, te > 1001) return; const e = Le; - Le = [], Nt(e), me || (te = 0); + Le = [], Nt(e), we || (te = 0); } function Te(e) { - me || (me = !0, queueMicrotask(Dt)); + we || (we = !0, queueMicrotask(Dt)); for (var n = e; n.parent !== null; ) { n = n.parent; var t = n.f; @@ -547,7 +547,7 @@ function g(e) { if (b !== null) { M !== null && M.includes(e) && dt(); var t = b.deps; - I === null && t !== null && t[O] === e ? O++ : I === null ? I = [e] : I.push(e), U !== null && w !== null && w.f & P && !(w.f & K) && U.includes(e) && (F(w, Y), Te(w)); + I === null && t !== null && t[O] === e ? O++ : I === null ? I = [e] : I.push(e), U !== null && m !== null && m.f & P && !(m.f & K) && U.includes(e) && (F(m, Y), Te(m)); } if (n & q) { var r = ( @@ -591,15 +591,15 @@ function qn(e) { if (n !== null) { const i = n.e; if (i !== null) { - var t = w, r = b; + var t = m, r = b; n.e = null; try { for (var l = 0; l < i.length; l++) { var u = i[l]; - Ee(u.effect), we(u.reaction), bn(u.fn); + Ee(u.effect), me(u.reaction), bn(u.fn); } } finally { - Ee(t), we(r); + Ee(t), me(r); } } x = n.p, n.m = !0; @@ -667,7 +667,7 @@ function H(e, n = null, t) { if (f === xe) return !0; var a = l.get(f), o = a !== void 0 && a.v !== N || Reflect.has(s, f); - if (a !== void 0 || w !== null && (!o || (c = Q(s, f)) != null && c.writable)) { + if (a !== void 0 || m !== null && (!o || (c = Q(s, f)) != null && c.writable)) { a === void 0 && (a = D(o ? H(s[f], _) : N), l.set(f, a)); var v = g(a); if (v === N) @@ -837,7 +837,7 @@ function Ft(e) { function Fe(e, n) { var t = ( /** @type {Effect} */ - w + m ); t.nodes_start === null && (t.nodes_start = e, t.nodes_end = n); } @@ -1046,12 +1046,12 @@ function an(e, n, t, r, l, u = null) { } function Yt(e, n, t, r, l, u) { var Ge, Je, Ze, ze; - var i = (l & Yn) !== 0, _ = (l & (Ve | je)) !== 0, s = e.length, f = n.items, a = n.first, o = a, v, c = null, h, E = [], S = [], k, p, d, m; + var i = (l & Yn) !== 0, _ = (l & (Ve | je)) !== 0, s = e.length, f = n.items, a = n.first, o = a, v, c = null, h, E = [], S = [], k, p, d, w; if (i) - for (m = 0; m < s; m += 1) - k = e[m], p = u(k, m), d = f.get(p), d !== void 0 && ((Ge = d.a) == null || Ge.measure(), (h ?? (h = /* @__PURE__ */ new Set())).add(d)); - for (m = 0; m < s; m += 1) { - if (k = e[m], p = u(k, m), d = f.get(p), d === void 0) { + for (w = 0; w < s; w += 1) + k = e[w], p = u(k, w), d = f.get(p), d !== void 0 && ((Ge = d.a) == null || Ge.measure(), (h ?? (h = /* @__PURE__ */ new Set())).add(d)); + for (w = 0; w < s; w += 1) { + if (k = e[w], p = u(k, w), d = f.get(p), d === void 0) { var y = o ? ( /** @type {TemplateNode} */ o.e.nodes_start @@ -1063,13 +1063,13 @@ function Yt(e, n, t, r, l, u) { c === null ? n.first : c.next, k, p, - m, + w, r, l ), f.set(p, c), E = [], S = [], o = c.next; continue; } - if (_ && Kt(d, k, m, l), d.e.f & L && (he(d.e), i && ((Je = d.a) == null || Je.unfix(), (h ?? (h = /* @__PURE__ */ new Set())).delete(d))), d !== o) { + if (_ && Kt(d, k, w, l), d.e.f & L && (he(d.e), i && ((Je = d.a) == null || Je.unfix(), (h ?? (h = /* @__PURE__ */ new Set())).delete(d))), d !== o) { if (v !== void 0 && v.has(d)) { if (E.length < S.length) { var A = S[0], T; @@ -1079,7 +1079,7 @@ function Yt(e, n, t, r, l, u) { on(E[T], A, t); for (T = 0; T < S.length; T += 1) v.delete(S[T]); - B(n, R.prev, V.next), B(n, c, R), B(n, V, A), o = A, c = V, m -= 1, E = [], S = []; + B(n, R.prev, V.next), B(n, c, R), B(n, V, A), o = A, c = V, w -= 1, E = [], S = []; } else v.delete(d), on(d, o, t), B(n, d.prev, d.next), B(n, d, c === null ? n.first : c.next), B(n, c, d), c = d; continue; @@ -1099,10 +1099,10 @@ function Yt(e, n, t, r, l, u) { if (ne > 0) { var Hn = l & vn && s === 0 ? t : null; if (i) { - for (m = 0; m < ne; m += 1) - (Ze = j[m].a) == null || Ze.measure(); - for (m = 0; m < ne; m += 1) - (ze = j[m].a) == null || ze.fix(); + for (w = 0; w < ne; w += 1) + (Ze = j[w].a) == null || Ze.measure(); + for (w = 0; w < ne; w += 1) + (ze = j[w].a) == null || ze.fix(); } Ut(n, j, Hn, f); } @@ -1112,7 +1112,7 @@ function Yt(e, n, t, r, l, u) { if (h !== void 0) for (d of h) (Xe = d.a) == null || Xe.apply(); - }), w.first = n.first && n.first.e, w.last = c && c.e; + }), m.first = n.first && n.first.e, m.last = c && c.e; } function Kt(e, n, t, r) { r & Ve && C(e.v, n), r & je ? C( @@ -1212,11 +1212,11 @@ function cn(e) { return e === "" ? null : +e; } function ce(e, n, t, r) { - var m; + var w; var l = (t & Wn) !== 0, u = (t & Gn) !== 0, i = (t & Zn) !== 0, _ = (t & zn) !== 0, s = ( /** @type {V} */ e[n] - ), f = (m = Q(e, n)) == null ? void 0 : m.set, a = ( + ), f = (w = Q(e, n)) == null ? void 0 : w.set, a = ( /** @type {V} */ r ), o = !0, v = !1, c = () => (v = !0, o && (o = !1, _ ? a = Pt( @@ -1275,10 +1275,10 @@ var Qt = (e, n) => n(), $t = () => { }, er = (e, n, t) => n(e, g(t)), nr = /* @__PURE__ */ se(' '), tr = /* @__PURE__ */ se(' '), rr = (e, n, t) => n(g(t)), lr = /* @__PURE__ */ se('
'), ur = /* @__PURE__ */ se('