simple-search-dropdown
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -6,4 +6,5 @@ import { default as React } from 'react'; | ||
itemClassName?: string; | ||
autoValue?: boolean; | ||
} | ||
declare const SearchSelect: React.MemoExoticComponent<React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLInputElement>>>; | ||
export { SearchSelect }; |
@@ -5,2 +5,3 @@ import { default as React, ForwardRefExoticComponent, RefAttributes } from 'react'; | ||
type SelectProps = React.HTMLAttributes<HTMLDivElement>; | ||
type ClearCacheSelect = 'off' | 'first'; | ||
export interface SelectItem { | ||
@@ -14,2 +15,4 @@ label: string; | ||
name?: string; | ||
value?: string | number | readonly string[]; | ||
clearCache?: ClearCacheSelect; | ||
} | ||
@@ -16,0 +19,0 @@ type SelectExtendedProps = SelectTriggerProps & { |
1027
dist/index.es.js
@@ -1,32 +0,32 @@ | ||
import { jsx as D, jsxs as me } from "react/jsx-runtime"; | ||
import * as y from "react"; | ||
import C, { useState as te, useRef as oe, useEffect as Ae } from "react"; | ||
var T = function() { | ||
return T = Object.assign || function(t) { | ||
for (var r, n = 1, o = arguments.length; n < o; n++) { | ||
r = arguments[n]; | ||
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (t[i] = r[i]); | ||
import { jsx as T, jsxs as me } from "react/jsx-runtime"; | ||
import * as w from "react"; | ||
import D, { useState as H, useRef as oe, useEffect as Ae } from "react"; | ||
var x = function() { | ||
return x = Object.assign || function(t) { | ||
for (var n, r = 1, o = arguments.length; r < o; r++) { | ||
n = arguments[r]; | ||
for (var c in n) Object.prototype.hasOwnProperty.call(n, c) && (t[c] = n[c]); | ||
} | ||
return t; | ||
}, T.apply(this, arguments); | ||
}, x.apply(this, arguments); | ||
}; | ||
function ye(e, t) { | ||
var r = {}; | ||
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]); | ||
var n = {}; | ||
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); | ||
if (e != null && typeof Object.getOwnPropertySymbols == "function") | ||
for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++) | ||
t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (r[n[o]] = e[n[o]]); | ||
return r; | ||
for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++) | ||
t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]); | ||
return n; | ||
} | ||
function ke(e, t, r) { | ||
if (r || arguments.length === 2) for (var n = 0, o = t.length, i; n < o; n++) | ||
(i || !(n in t)) && (i || (i = Array.prototype.slice.call(t, 0, n)), i[n] = t[n]); | ||
return e.concat(i || Array.prototype.slice.call(t)); | ||
function ke(e, t, n) { | ||
if (n || arguments.length === 2) for (var r = 0, o = t.length, c; r < o; r++) | ||
(c || !(r in t)) && (c || (c = Array.prototype.slice.call(t, 0, r)), c[r] = t[r]); | ||
return e.concat(c || Array.prototype.slice.call(t)); | ||
} | ||
var j = "right-scroll-bar-position", H = "width-before-scroll-bar", Ie = "with-scroll-bars-hidden", Ve = "--removed-body-scroll-bar-size"; | ||
function q(e, t) { | ||
var G = "right-scroll-bar-position", F = "width-before-scroll-bar", Ie = "with-scroll-bars-hidden", Ve = "--removed-body-scroll-bar-size"; | ||
function X(e, t) { | ||
return typeof e == "function" ? e(t) : e && (e.current = t), e; | ||
} | ||
function Be(e, t) { | ||
var r = te(function() { | ||
var n = H(function() { | ||
return { | ||
@@ -40,7 +40,7 @@ // value | ||
get current() { | ||
return r.value; | ||
return n.value; | ||
}, | ||
set current(n) { | ||
var o = r.value; | ||
o !== n && (r.value = n, r.callback(n, o)); | ||
set current(r) { | ||
var o = n.value; | ||
o !== r && (n.value = r, n.callback(r, o)); | ||
} | ||
@@ -50,23 +50,23 @@ } | ||
})[0]; | ||
return r.callback = t, r.facade; | ||
return n.callback = t, n.facade; | ||
} | ||
var Me = typeof window < "u" ? y.useLayoutEffect : y.useEffect, ae = /* @__PURE__ */ new WeakMap(); | ||
var Me = typeof window < "u" ? w.useLayoutEffect : w.useEffect, ae = /* @__PURE__ */ new WeakMap(); | ||
function Ne(e, t) { | ||
var r = Be(null, function(n) { | ||
var n = Be(null, function(r) { | ||
return e.forEach(function(o) { | ||
return q(o, n); | ||
return X(o, r); | ||
}); | ||
}); | ||
return Me(function() { | ||
var n = ae.get(r); | ||
if (n) { | ||
var o = new Set(n), i = new Set(e), l = r.current; | ||
var r = ae.get(n); | ||
if (r) { | ||
var o = new Set(r), c = new Set(e), s = n.current; | ||
o.forEach(function(a) { | ||
i.has(a) || q(a, null); | ||
}), i.forEach(function(a) { | ||
o.has(a) || q(a, l); | ||
c.has(a) || X(a, null); | ||
}), c.forEach(function(a) { | ||
o.has(a) || X(a, s); | ||
}); | ||
} | ||
ae.set(r, e); | ||
}, [e]), r; | ||
ae.set(n, e); | ||
}, [e]), n; | ||
} | ||
@@ -78,49 +78,49 @@ function Pe(e) { | ||
t === void 0 && (t = Pe); | ||
var r = [], n = !1, o = { | ||
var n = [], r = !1, o = { | ||
read: function() { | ||
if (n) | ||
if (r) | ||
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`."); | ||
return r.length ? r[r.length - 1] : e; | ||
return n.length ? n[n.length - 1] : e; | ||
}, | ||
useMedium: function(i) { | ||
var l = t(i, n); | ||
return r.push(l), function() { | ||
r = r.filter(function(a) { | ||
return a !== l; | ||
useMedium: function(c) { | ||
var s = t(c, r); | ||
return n.push(s), function() { | ||
n = n.filter(function(a) { | ||
return a !== s; | ||
}); | ||
}; | ||
}, | ||
assignSyncMedium: function(i) { | ||
for (n = !0; r.length; ) { | ||
var l = r; | ||
r = [], l.forEach(i); | ||
assignSyncMedium: function(c) { | ||
for (r = !0; n.length; ) { | ||
var s = n; | ||
n = [], s.forEach(c); | ||
} | ||
r = { | ||
n = { | ||
push: function(a) { | ||
return i(a); | ||
return c(a); | ||
}, | ||
filter: function() { | ||
return r; | ||
return n; | ||
} | ||
}; | ||
}, | ||
assignMedium: function(i) { | ||
n = !0; | ||
var l = []; | ||
if (r.length) { | ||
var a = r; | ||
r = [], a.forEach(i), l = r; | ||
assignMedium: function(c) { | ||
r = !0; | ||
var s = []; | ||
if (n.length) { | ||
var a = n; | ||
n = [], a.forEach(c), s = n; | ||
} | ||
var S = function() { | ||
var c = l; | ||
l = [], c.forEach(i); | ||
}, g = function() { | ||
return Promise.resolve().then(S); | ||
var g = function() { | ||
var i = s; | ||
s = [], i.forEach(c); | ||
}, v = function() { | ||
return Promise.resolve().then(g); | ||
}; | ||
g(), r = { | ||
push: function(c) { | ||
l.push(c), g(); | ||
v(), n = { | ||
push: function(i) { | ||
s.push(i), v(); | ||
}, | ||
filter: function(c) { | ||
return l = l.filter(c), r; | ||
filter: function(i) { | ||
return s = s.filter(i), n; | ||
} | ||
@@ -135,12 +135,12 @@ }; | ||
var t = We(null); | ||
return t.options = T({ async: !0, ssr: !1 }, e), t; | ||
return t.options = x({ async: !0, ssr: !1 }, e), t; | ||
} | ||
var Ee = function(e) { | ||
var t = e.sideCar, r = ye(e, ["sideCar"]); | ||
var t = e.sideCar, n = ye(e, ["sideCar"]); | ||
if (!t) | ||
throw new Error("Sidecar: please provide `sideCar` property to import the right car"); | ||
var n = t.read(); | ||
if (!n) | ||
var r = t.read(); | ||
if (!r) | ||
throw new Error("Sidecar medium not found"); | ||
return y.createElement(n, T({}, r)); | ||
return w.createElement(r, x({}, n)); | ||
}; | ||
@@ -151,17 +151,17 @@ Ee.isSideCarExport = !0; | ||
} | ||
var _e = je(), X = function() { | ||
}, G = y.forwardRef(function(e, t) { | ||
var r = y.useRef(null), n = y.useState({ | ||
onScrollCapture: X, | ||
onWheelCapture: X, | ||
onTouchMoveCapture: X | ||
}), o = n[0], i = n[1], l = e.forwardProps, a = e.children, S = e.className, g = e.removeScrollBar, c = e.enabled, f = e.shards, s = e.sideCar, d = e.noIsolation, _ = e.inert, u = e.allowPinchZoom, v = e.as, w = v === void 0 ? "div" : v, O = e.gapMode, m = ye(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), h = s, E = Ne([r, t]), p = T(T({}, m), o); | ||
return y.createElement( | ||
y.Fragment, | ||
var _e = je(), Z = function() { | ||
}, U = w.forwardRef(function(e, t) { | ||
var n = w.useRef(null), r = w.useState({ | ||
onScrollCapture: Z, | ||
onWheelCapture: Z, | ||
onTouchMoveCapture: Z | ||
}), o = r[0], c = r[1], s = e.forwardProps, a = e.children, g = e.className, v = e.removeScrollBar, i = e.enabled, l = e.shards, f = e.sideCar, d = e.noIsolation, y = e.inert, u = e.allowPinchZoom, h = e.as, _ = h === void 0 ? "div" : h, C = e.gapMode, p = ye(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), S = f, E = Ne([n, t]), m = x(x({}, p), o); | ||
return w.createElement( | ||
w.Fragment, | ||
null, | ||
c && y.createElement(h, { sideCar: _e, removeScrollBar: g, shards: f, noIsolation: d, inert: _, setCallbacks: i, allowPinchZoom: !!u, lockRef: r, gapMode: O }), | ||
l ? y.cloneElement(y.Children.only(a), T(T({}, p), { ref: E })) : y.createElement(w, T({}, p, { className: S, ref: E }), a) | ||
i && w.createElement(S, { sideCar: _e, removeScrollBar: v, shards: l, noIsolation: d, inert: y, setCallbacks: c, allowPinchZoom: !!u, lockRef: n, gapMode: C }), | ||
s ? w.cloneElement(w.Children.only(a), x(x({}, m), { ref: E })) : w.createElement(_, x({}, m, { className: g, ref: E }), a) | ||
); | ||
}); | ||
G.defaultProps = { | ||
U.defaultProps = { | ||
enabled: !0, | ||
@@ -171,5 +171,5 @@ removeScrollBar: !0, | ||
}; | ||
G.classNames = { | ||
fullWidth: H, | ||
zeroRight: j | ||
U.classNames = { | ||
fullWidth: F, | ||
zeroRight: G | ||
}; | ||
@@ -198,4 +198,4 @@ var Ge = function() { | ||
return { | ||
add: function(r) { | ||
e == 0 && (t = Fe()) && (Ue(t, r), ze(t)), e++; | ||
add: function(n) { | ||
e == 0 && (t = Fe()) && (Ue(t, n), ze(t)), e++; | ||
}, | ||
@@ -208,13 +208,13 @@ remove: function() { | ||
var e = Ke(); | ||
return function(t, r) { | ||
y.useEffect(function() { | ||
return function(t, n) { | ||
w.useEffect(function() { | ||
return e.add(t), function() { | ||
e.remove(); | ||
}; | ||
}, [t && r]); | ||
}, [t && n]); | ||
}; | ||
}, we = function() { | ||
var e = Ye(), t = function(r) { | ||
var n = r.styles, o = r.dynamic; | ||
return e(n, o), null; | ||
var e = Ye(), t = function(n) { | ||
var r = n.styles, o = n.dynamic; | ||
return e(r, o), null; | ||
}; | ||
@@ -227,11 +227,11 @@ return t; | ||
gap: 0 | ||
}, Z = function(e) { | ||
}, $ = function(e) { | ||
return parseInt(e || "", 10) || 0; | ||
}, Xe = function(e) { | ||
var t = window.getComputedStyle(document.body), r = t[e === "padding" ? "paddingLeft" : "marginLeft"], n = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"]; | ||
return [Z(r), Z(n), Z(o)]; | ||
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"]; | ||
return [$(n), $(r), $(o)]; | ||
}, Ze = function(e) { | ||
if (e === void 0 && (e = "margin"), typeof window > "u") | ||
return qe; | ||
var t = Xe(e), r = document.documentElement.clientWidth, n = window.innerWidth; | ||
var t = Xe(e), n = document.documentElement.clientWidth, r = window.innerWidth; | ||
return { | ||
@@ -241,45 +241,45 @@ left: t[0], | ||
right: t[2], | ||
gap: Math.max(0, n - r + t[2] - t[0]) | ||
gap: Math.max(0, r - n + t[2] - t[0]) | ||
}; | ||
}, $e = we(), I = "data-scroll-locked", Qe = function(e, t, r, n) { | ||
var o = e.left, i = e.top, l = e.right, a = e.gap; | ||
return r === void 0 && (r = "margin"), ` | ||
}, $e = we(), B = "data-scroll-locked", Qe = function(e, t, n, r) { | ||
var o = e.left, c = e.top, s = e.right, a = e.gap; | ||
return n === void 0 && (n = "margin"), ` | ||
.`.concat(Ie, ` { | ||
overflow: hidden `).concat(n, `; | ||
padding-right: `).concat(a, "px ").concat(n, `; | ||
overflow: hidden `).concat(r, `; | ||
padding-right: `).concat(a, "px ").concat(r, `; | ||
} | ||
body[`).concat(I, `] { | ||
overflow: hidden `).concat(n, `; | ||
body[`).concat(B, `] { | ||
overflow: hidden `).concat(r, `; | ||
overscroll-behavior: contain; | ||
`).concat([ | ||
t && "position: relative ".concat(n, ";"), | ||
r === "margin" && ` | ||
t && "position: relative ".concat(r, ";"), | ||
n === "margin" && ` | ||
padding-left: `.concat(o, `px; | ||
padding-top: `).concat(i, `px; | ||
padding-right: `).concat(l, `px; | ||
padding-top: `).concat(c, `px; | ||
padding-right: `).concat(s, `px; | ||
margin-left:0; | ||
margin-top:0; | ||
margin-right: `).concat(a, "px ").concat(n, `; | ||
margin-right: `).concat(a, "px ").concat(r, `; | ||
`), | ||
r === "padding" && "padding-right: ".concat(a, "px ").concat(n, ";") | ||
n === "padding" && "padding-right: ".concat(a, "px ").concat(r, ";") | ||
].filter(Boolean).join(""), ` | ||
} | ||
.`).concat(j, ` { | ||
right: `).concat(a, "px ").concat(n, `; | ||
.`).concat(G, ` { | ||
right: `).concat(a, "px ").concat(r, `; | ||
} | ||
.`).concat(H, ` { | ||
margin-right: `).concat(a, "px ").concat(n, `; | ||
.`).concat(F, ` { | ||
margin-right: `).concat(a, "px ").concat(r, `; | ||
} | ||
.`).concat(j, " .").concat(j, ` { | ||
right: 0 `).concat(n, `; | ||
.`).concat(G, " .").concat(G, ` { | ||
right: 0 `).concat(r, `; | ||
} | ||
.`).concat(H, " .").concat(H, ` { | ||
margin-right: 0 `).concat(n, `; | ||
.`).concat(F, " .").concat(F, ` { | ||
margin-right: 0 `).concat(r, `; | ||
} | ||
body[`).concat(I, `] { | ||
body[`).concat(B, `] { | ||
`).concat(Ve, ": ").concat(a, `px; | ||
@@ -289,31 +289,31 @@ } | ||
}, ie = function() { | ||
var e = parseInt(document.body.getAttribute(I) || "0", 10); | ||
var e = parseInt(document.body.getAttribute(B) || "0", 10); | ||
return isFinite(e) ? e : 0; | ||
}, Je = function() { | ||
y.useEffect(function() { | ||
return document.body.setAttribute(I, (ie() + 1).toString()), function() { | ||
w.useEffect(function() { | ||
return document.body.setAttribute(B, (ie() + 1).toString()), function() { | ||
var e = ie() - 1; | ||
e <= 0 ? document.body.removeAttribute(I) : document.body.setAttribute(I, e.toString()); | ||
e <= 0 ? document.body.removeAttribute(B) : document.body.setAttribute(B, e.toString()); | ||
}; | ||
}, []); | ||
}, et = function(e) { | ||
var t = e.noRelative, r = e.noImportant, n = e.gapMode, o = n === void 0 ? "margin" : n; | ||
var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r; | ||
Je(); | ||
var i = y.useMemo(function() { | ||
var c = w.useMemo(function() { | ||
return Ze(o); | ||
}, [o]); | ||
return y.createElement($e, { styles: Qe(i, !t, o, r ? "" : "!important") }); | ||
}, ne = !1; | ||
return w.createElement($e, { styles: Qe(c, !t, o, n ? "" : "!important") }); | ||
}, re = !1; | ||
if (typeof window < "u") | ||
try { | ||
var N = Object.defineProperty({}, "passive", { | ||
var P = Object.defineProperty({}, "passive", { | ||
get: function() { | ||
return ne = !0, !0; | ||
return re = !0, !0; | ||
} | ||
}); | ||
window.addEventListener("test", N, N), window.removeEventListener("test", N, N); | ||
window.addEventListener("test", P, P), window.removeEventListener("test", P, P); | ||
} catch { | ||
ne = !1; | ||
re = !1; | ||
} | ||
var A = ne ? { passive: !1 } : !1, tt = function(e) { | ||
var I = re ? { passive: !1 } : !1, tt = function(e) { | ||
return e.tagName === "TEXTAREA"; | ||
@@ -323,41 +323,41 @@ }, be = function(e, t) { | ||
return !1; | ||
var r = window.getComputedStyle(e); | ||
var n = window.getComputedStyle(e); | ||
return ( | ||
// not-not-scrollable | ||
r[t] !== "hidden" && // contains scroll inside self | ||
!(r.overflowY === r.overflowX && !tt(e) && r[t] === "visible") | ||
n[t] !== "hidden" && // contains scroll inside self | ||
!(n.overflowY === n.overflowX && !tt(e) && n[t] === "visible") | ||
); | ||
}, rt = function(e) { | ||
return be(e, "overflowY"); | ||
}, nt = function(e) { | ||
return be(e, "overflowY"); | ||
}, rt = function(e) { | ||
return be(e, "overflowX"); | ||
}, ce = function(e, t) { | ||
var r = t.ownerDocument, n = t; | ||
var n = t.ownerDocument, r = t; | ||
do { | ||
typeof ShadowRoot < "u" && n instanceof ShadowRoot && (n = n.host); | ||
var o = Oe(e, n); | ||
typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host); | ||
var o = Oe(e, r); | ||
if (o) { | ||
var i = Ce(e, n), l = i[1], a = i[2]; | ||
if (l > a) | ||
var c = Ce(e, r), s = c[1], a = c[2]; | ||
if (s > a) | ||
return !0; | ||
} | ||
n = n.parentNode; | ||
} while (n && n !== r.body); | ||
r = r.parentNode; | ||
} while (r && r !== n.body); | ||
return !1; | ||
}, ot = function(e) { | ||
var t = e.scrollTop, r = e.scrollHeight, n = e.clientHeight; | ||
var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight; | ||
return [ | ||
t, | ||
r, | ||
n | ||
n, | ||
r | ||
]; | ||
}, at = function(e) { | ||
var t = e.scrollLeft, r = e.scrollWidth, n = e.clientWidth; | ||
var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth; | ||
return [ | ||
t, | ||
r, | ||
n | ||
n, | ||
r | ||
]; | ||
}, Oe = function(e, t) { | ||
return e === "v" ? nt(t) : rt(t); | ||
return e === "v" ? rt(t) : nt(t); | ||
}, Ce = function(e, t) { | ||
@@ -367,14 +367,14 @@ return e === "v" ? ot(t) : at(t); | ||
return e === "h" && t === "rtl" ? -1 : 1; | ||
}, ct = function(e, t, r, n, o) { | ||
var i = it(e, window.getComputedStyle(t).direction), l = i * n, a = r.target, S = t.contains(a), g = !1, c = l > 0, f = 0, s = 0; | ||
}, ct = function(e, t, n, r, o) { | ||
var c = it(e, window.getComputedStyle(t).direction), s = c * r, a = n.target, g = t.contains(a), v = !1, i = s > 0, l = 0, f = 0; | ||
do { | ||
var d = Ce(e, a), _ = d[0], u = d[1], v = d[2], w = u - v - i * _; | ||
(_ || w) && Oe(e, a) && (f += w, s += _), a instanceof ShadowRoot ? a = a.host : a = a.parentNode; | ||
var d = Ce(e, a), y = d[0], u = d[1], h = d[2], _ = u - h - c * y; | ||
(y || _) && Oe(e, a) && (l += _, f += y), a instanceof ShadowRoot ? a = a.host : a = a.parentNode; | ||
} while ( | ||
// portaled content | ||
!S && a !== document.body || // self content | ||
S && (t.contains(a) || t === a) | ||
!g && a !== document.body || // self content | ||
g && (t.contains(a) || t === a) | ||
); | ||
return (c && (Math.abs(f) < 1 || !o) || !c && (Math.abs(s) < 1 || !o)) && (g = !0), g; | ||
}, P = function(e) { | ||
return (i && (Math.abs(l) < 1 || !o) || !i && (Math.abs(f) < 1 || !o)) && (v = !0), v; | ||
}, W = function(e) { | ||
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0]; | ||
@@ -392,16 +392,16 @@ }, ue = function(e) { | ||
`); | ||
}, st = 0, k = []; | ||
}, st = 0, V = []; | ||
function ft(e) { | ||
var t = y.useRef([]), r = y.useRef([0, 0]), n = y.useRef(), o = y.useState(st++)[0], i = y.useState(we)[0], l = y.useRef(e); | ||
y.useEffect(function() { | ||
l.current = e; | ||
}, [e]), y.useEffect(function() { | ||
var t = w.useRef([]), n = w.useRef([0, 0]), r = w.useRef(), o = w.useState(st++)[0], c = w.useState(we)[0], s = w.useRef(e); | ||
w.useEffect(function() { | ||
s.current = e; | ||
}, [e]), w.useEffect(function() { | ||
if (e.inert) { | ||
document.body.classList.add("block-interactivity-".concat(o)); | ||
var u = ke([e.lockRef.current], (e.shards || []).map(le), !0).filter(Boolean); | ||
return u.forEach(function(v) { | ||
return v.classList.add("allow-interactivity-".concat(o)); | ||
return u.forEach(function(h) { | ||
return h.classList.add("allow-interactivity-".concat(o)); | ||
}), function() { | ||
document.body.classList.remove("block-interactivity-".concat(o)), u.forEach(function(v) { | ||
return v.classList.remove("allow-interactivity-".concat(o)); | ||
document.body.classList.remove("block-interactivity-".concat(o)), u.forEach(function(h) { | ||
return h.classList.remove("allow-interactivity-".concat(o)); | ||
}); | ||
@@ -411,65 +411,65 @@ }; | ||
}, [e.inert, e.lockRef.current, e.shards]); | ||
var a = y.useCallback(function(u, v) { | ||
var a = w.useCallback(function(u, h) { | ||
if ("touches" in u && u.touches.length === 2) | ||
return !l.current.allowPinchZoom; | ||
var w = P(u), O = r.current, m = "deltaX" in u ? u.deltaX : O[0] - w[0], h = "deltaY" in u ? u.deltaY : O[1] - w[1], E, p = u.target, b = Math.abs(m) > Math.abs(h) ? "h" : "v"; | ||
if ("touches" in u && b === "h" && p.type === "range") | ||
return !s.current.allowPinchZoom; | ||
var _ = W(u), C = n.current, p = "deltaX" in u ? u.deltaX : C[0] - _[0], S = "deltaY" in u ? u.deltaY : C[1] - _[1], E, m = u.target, b = Math.abs(p) > Math.abs(S) ? "h" : "v"; | ||
if ("touches" in u && b === "h" && m.type === "range") | ||
return !1; | ||
var L = ce(b, p); | ||
if (!L) | ||
var O = ce(b, m); | ||
if (!O) | ||
return !0; | ||
if (L ? E = b : (E = b === "v" ? "h" : "v", L = ce(b, p)), !L) | ||
if (O ? E = b : (E = b === "v" ? "h" : "v", O = ce(b, m)), !O) | ||
return !1; | ||
if (!n.current && "changedTouches" in u && (m || h) && (n.current = E), !E) | ||
if (!r.current && "changedTouches" in u && (p || S) && (r.current = E), !E) | ||
return !0; | ||
var R = n.current || E; | ||
return ct(R, v, u, R === "h" ? m : h, !0); | ||
}, []), S = y.useCallback(function(u) { | ||
var v = u; | ||
if (!(!k.length || k[k.length - 1] !== i)) { | ||
var w = "deltaY" in v ? ue(v) : P(v), O = t.current.filter(function(E) { | ||
return E.name === v.type && (E.target === v.target || v.target === E.shadowParent) && ut(E.delta, w); | ||
var L = r.current || E; | ||
return ct(L, h, u, L === "h" ? p : S, !0); | ||
}, []), g = w.useCallback(function(u) { | ||
var h = u; | ||
if (!(!V.length || V[V.length - 1] !== c)) { | ||
var _ = "deltaY" in h ? ue(h) : W(h), C = t.current.filter(function(E) { | ||
return E.name === h.type && (E.target === h.target || h.target === E.shadowParent) && ut(E.delta, _); | ||
})[0]; | ||
if (O && O.should) { | ||
v.cancelable && v.preventDefault(); | ||
if (C && C.should) { | ||
h.cancelable && h.preventDefault(); | ||
return; | ||
} | ||
if (!O) { | ||
var m = (l.current.shards || []).map(le).filter(Boolean).filter(function(E) { | ||
return E.contains(v.target); | ||
}), h = m.length > 0 ? a(v, m[0]) : !l.current.noIsolation; | ||
h && v.cancelable && v.preventDefault(); | ||
if (!C) { | ||
var p = (s.current.shards || []).map(le).filter(Boolean).filter(function(E) { | ||
return E.contains(h.target); | ||
}), S = p.length > 0 ? a(h, p[0]) : !s.current.noIsolation; | ||
S && h.cancelable && h.preventDefault(); | ||
} | ||
} | ||
}, []), g = y.useCallback(function(u, v, w, O) { | ||
var m = { name: u, delta: v, target: w, should: O, shadowParent: dt(w) }; | ||
t.current.push(m), setTimeout(function() { | ||
t.current = t.current.filter(function(h) { | ||
return h !== m; | ||
}, []), v = w.useCallback(function(u, h, _, C) { | ||
var p = { name: u, delta: h, target: _, should: C, shadowParent: dt(_) }; | ||
t.current.push(p), setTimeout(function() { | ||
t.current = t.current.filter(function(S) { | ||
return S !== p; | ||
}); | ||
}, 1); | ||
}, []), c = y.useCallback(function(u) { | ||
r.current = P(u), n.current = void 0; | ||
}, []), f = y.useCallback(function(u) { | ||
g(u.type, ue(u), u.target, a(u, e.lockRef.current)); | ||
}, []), s = y.useCallback(function(u) { | ||
g(u.type, P(u), u.target, a(u, e.lockRef.current)); | ||
}, []), i = w.useCallback(function(u) { | ||
n.current = W(u), r.current = void 0; | ||
}, []), l = w.useCallback(function(u) { | ||
v(u.type, ue(u), u.target, a(u, e.lockRef.current)); | ||
}, []), f = w.useCallback(function(u) { | ||
v(u.type, W(u), u.target, a(u, e.lockRef.current)); | ||
}, []); | ||
y.useEffect(function() { | ||
return k.push(i), e.setCallbacks({ | ||
onScrollCapture: f, | ||
onWheelCapture: f, | ||
onTouchMoveCapture: s | ||
}), document.addEventListener("wheel", S, A), document.addEventListener("touchmove", S, A), document.addEventListener("touchstart", c, A), function() { | ||
k = k.filter(function(u) { | ||
return u !== i; | ||
}), document.removeEventListener("wheel", S, A), document.removeEventListener("touchmove", S, A), document.removeEventListener("touchstart", c, A); | ||
w.useEffect(function() { | ||
return V.push(c), e.setCallbacks({ | ||
onScrollCapture: l, | ||
onWheelCapture: l, | ||
onTouchMoveCapture: f | ||
}), document.addEventListener("wheel", g, I), document.addEventListener("touchmove", g, I), document.addEventListener("touchstart", i, I), function() { | ||
V = V.filter(function(u) { | ||
return u !== c; | ||
}), document.removeEventListener("wheel", g, I), document.removeEventListener("touchmove", g, I), document.removeEventListener("touchstart", i, I); | ||
}; | ||
}, []); | ||
var d = e.removeScrollBar, _ = e.inert; | ||
return y.createElement( | ||
y.Fragment, | ||
var d = e.removeScrollBar, y = e.inert; | ||
return w.createElement( | ||
w.Fragment, | ||
null, | ||
_ ? y.createElement(i, { styles: lt(o) }) : null, | ||
d ? y.createElement(et, { gapMode: e.gapMode }) : null | ||
y ? w.createElement(c, { styles: lt(o) }) : null, | ||
d ? w.createElement(et, { gapMode: e.gapMode }) : null | ||
); | ||
@@ -483,20 +483,20 @@ } | ||
const vt = He(_e, ft); | ||
var Le = y.forwardRef(function(e, t) { | ||
return y.createElement(G, T({}, e, { ref: t, sideCar: vt })); | ||
var Le = w.forwardRef(function(e, t) { | ||
return w.createElement(U, x({}, e, { ref: t, sideCar: vt })); | ||
}); | ||
Le.classNames = G.classNames; | ||
Le.classNames = U.classNames; | ||
const ht = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, se = (e) => { | ||
let t; | ||
const r = /* @__PURE__ */ new Set(), n = (c, f) => { | ||
const s = typeof c == "function" ? c(t) : c; | ||
if (!Object.is(s, t)) { | ||
const n = /* @__PURE__ */ new Set(), r = (i, l) => { | ||
const f = typeof i == "function" ? i(t) : i; | ||
if (!Object.is(f, t)) { | ||
const d = t; | ||
t = f ?? (typeof s != "object" || s === null) ? s : Object.assign({}, t, s), r.forEach((_) => _(t, d)); | ||
t = l ?? (typeof f != "object" || f === null) ? f : Object.assign({}, t, f), n.forEach((y) => y(t, d)); | ||
} | ||
}, o = () => t, S = { setState: n, getState: o, getInitialState: () => g, subscribe: (c) => (r.add(c), () => r.delete(c)), destroy: () => { | ||
}, o = () => t, g = { setState: r, getState: o, getInitialState: () => v, subscribe: (i) => (n.add(i), () => n.delete(i)), destroy: () => { | ||
(ht ? "production" : void 0) !== "production" && console.warn( | ||
"[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected." | ||
), r.clear(); | ||
} }, g = t = e(n, o, S); | ||
return S; | ||
), n.clear(); | ||
} }, v = t = e(r, o, g); | ||
return g; | ||
}, St = (e) => e ? se(e) : se; | ||
@@ -506,3 +506,3 @@ function gt(e) { | ||
} | ||
var re = { exports: {} }, $ = {}, W = { exports: {} }, Q = {}; | ||
var ne = { exports: {} }, Q = {}, j = { exports: {} }, J = {}; | ||
/** | ||
@@ -519,25 +519,25 @@ * @license React | ||
function pt() { | ||
if (fe) return Q; | ||
if (fe) return J; | ||
fe = 1; | ||
var e = C; | ||
function t(f, s) { | ||
return f === s && (f !== 0 || 1 / f === 1 / s) || f !== f && s !== s; | ||
var e = D; | ||
function t(l, f) { | ||
return l === f && (l !== 0 || 1 / l === 1 / f) || l !== l && f !== f; | ||
} | ||
var r = typeof Object.is == "function" ? Object.is : t, n = e.useState, o = e.useEffect, i = e.useLayoutEffect, l = e.useDebugValue; | ||
function a(f, s) { | ||
var d = s(), _ = n({ inst: { value: d, getSnapshot: s } }), u = _[0].inst, v = _[1]; | ||
return i(function() { | ||
u.value = d, u.getSnapshot = s, S(u) && v({ inst: u }); | ||
}, [f, d, s]), o(function() { | ||
return S(u) && v({ inst: u }), f(function() { | ||
S(u) && v({ inst: u }); | ||
var n = typeof Object.is == "function" ? Object.is : t, r = e.useState, o = e.useEffect, c = e.useLayoutEffect, s = e.useDebugValue; | ||
function a(l, f) { | ||
var d = f(), y = r({ inst: { value: d, getSnapshot: f } }), u = y[0].inst, h = y[1]; | ||
return c(function() { | ||
u.value = d, u.getSnapshot = f, g(u) && h({ inst: u }); | ||
}, [l, d, f]), o(function() { | ||
return g(u) && h({ inst: u }), l(function() { | ||
g(u) && h({ inst: u }); | ||
}); | ||
}, [f]), l(d), d; | ||
}, [l]), s(d), d; | ||
} | ||
function S(f) { | ||
var s = f.getSnapshot; | ||
f = f.value; | ||
function g(l) { | ||
var f = l.getSnapshot; | ||
l = l.value; | ||
try { | ||
var d = s(); | ||
return !r(f, d); | ||
var d = f(); | ||
return !n(l, d); | ||
} catch { | ||
@@ -547,9 +547,9 @@ return !0; | ||
} | ||
function g(f, s) { | ||
return s(); | ||
function v(l, f) { | ||
return f(); | ||
} | ||
var c = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? g : a; | ||
return Q.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : c, Q; | ||
var i = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : a; | ||
return J.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : i, J; | ||
} | ||
var J = {}; | ||
var ee = {}; | ||
/** | ||
@@ -568,58 +568,58 @@ * @license React | ||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); | ||
var e = C, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
function r(m) { | ||
var e = D, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
function n(p) { | ||
{ | ||
for (var h = arguments.length, E = new Array(h > 1 ? h - 1 : 0), p = 1; p < h; p++) | ||
E[p - 1] = arguments[p]; | ||
n("error", m, E); | ||
for (var S = arguments.length, E = new Array(S > 1 ? S - 1 : 0), m = 1; m < S; m++) | ||
E[m - 1] = arguments[m]; | ||
r("error", p, E); | ||
} | ||
} | ||
function n(m, h, E) { | ||
function r(p, S, E) { | ||
{ | ||
var p = t.ReactDebugCurrentFrame, b = p.getStackAddendum(); | ||
b !== "" && (h += "%s", E = E.concat([b])); | ||
var L = E.map(function(R) { | ||
return String(R); | ||
var m = t.ReactDebugCurrentFrame, b = m.getStackAddendum(); | ||
b !== "" && (S += "%s", E = E.concat([b])); | ||
var O = E.map(function(L) { | ||
return String(L); | ||
}); | ||
L.unshift("Warning: " + h), Function.prototype.apply.call(console[m], console, L); | ||
O.unshift("Warning: " + S), Function.prototype.apply.call(console[p], console, O); | ||
} | ||
} | ||
function o(m, h) { | ||
return m === h && (m !== 0 || 1 / m === 1 / h) || m !== m && h !== h; | ||
function o(p, S) { | ||
return p === S && (p !== 0 || 1 / p === 1 / S) || p !== p && S !== S; | ||
} | ||
var i = typeof Object.is == "function" ? Object.is : o, l = e.useState, a = e.useEffect, S = e.useLayoutEffect, g = e.useDebugValue, c = !1, f = !1; | ||
function s(m, h, E) { | ||
c || e.startTransition !== void 0 && (c = !0, r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.")); | ||
var p = h(); | ||
if (!f) { | ||
var b = h(); | ||
i(p, b) || (r("The result of getSnapshot should be cached to avoid an infinite loop"), f = !0); | ||
var c = typeof Object.is == "function" ? Object.is : o, s = e.useState, a = e.useEffect, g = e.useLayoutEffect, v = e.useDebugValue, i = !1, l = !1; | ||
function f(p, S, E) { | ||
i || e.startTransition !== void 0 && (i = !0, n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.")); | ||
var m = S(); | ||
if (!l) { | ||
var b = S(); | ||
c(m, b) || (n("The result of getSnapshot should be cached to avoid an infinite loop"), l = !0); | ||
} | ||
var L = l({ | ||
var O = s({ | ||
inst: { | ||
value: p, | ||
getSnapshot: h | ||
value: m, | ||
getSnapshot: S | ||
} | ||
}), R = L[0].inst, B = L[1]; | ||
return S(function() { | ||
R.value = p, R.getSnapshot = h, d(R) && B({ | ||
inst: R | ||
}), L = O[0].inst, R = O[1]; | ||
return g(function() { | ||
L.value = m, L.getSnapshot = S, d(L) && R({ | ||
inst: L | ||
}); | ||
}, [m, p, h]), a(function() { | ||
d(R) && B({ | ||
inst: R | ||
}, [p, m, S]), a(function() { | ||
d(L) && R({ | ||
inst: L | ||
}); | ||
var F = function() { | ||
d(R) && B({ | ||
inst: R | ||
var k = function() { | ||
d(L) && R({ | ||
inst: L | ||
}); | ||
}; | ||
return m(F); | ||
}, [m]), g(p), p; | ||
return p(k); | ||
}, [p]), v(m), m; | ||
} | ||
function d(m) { | ||
var h = m.getSnapshot, E = m.value; | ||
function d(p) { | ||
var S = p.getSnapshot, E = p.value; | ||
try { | ||
var p = h(); | ||
return !i(E, p); | ||
var m = S(); | ||
return !c(E, m); | ||
} catch { | ||
@@ -629,12 +629,12 @@ return !0; | ||
} | ||
function _(m, h, E) { | ||
return h(); | ||
function y(p, S, E) { | ||
return S(); | ||
} | ||
var u = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", v = !u, w = v ? _ : s, O = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : w; | ||
J.useSyncExternalStore = O, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); | ||
}()), J; | ||
var u = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", h = !u, _ = h ? y : f, C = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : _; | ||
ee.useSyncExternalStore = C, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); | ||
}()), ee; | ||
} | ||
var ve; | ||
function Re() { | ||
return ve || (ve = 1, process.env.NODE_ENV === "production" ? W.exports = pt() : W.exports = mt()), W.exports; | ||
function De() { | ||
return ve || (ve = 1, process.env.NODE_ENV === "production" ? j.exports = pt() : j.exports = mt()), j.exports; | ||
} | ||
@@ -652,42 +652,42 @@ /** | ||
function yt() { | ||
if (he) return $; | ||
if (he) return Q; | ||
he = 1; | ||
var e = C, t = Re(); | ||
function r(g, c) { | ||
return g === c && (g !== 0 || 1 / g === 1 / c) || g !== g && c !== c; | ||
var e = D, t = De(); | ||
function n(v, i) { | ||
return v === i && (v !== 0 || 1 / v === 1 / i) || v !== v && i !== i; | ||
} | ||
var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, i = e.useRef, l = e.useEffect, a = e.useMemo, S = e.useDebugValue; | ||
return $.useSyncExternalStoreWithSelector = function(g, c, f, s, d) { | ||
var _ = i(null); | ||
if (_.current === null) { | ||
var r = typeof Object.is == "function" ? Object.is : n, o = t.useSyncExternalStore, c = e.useRef, s = e.useEffect, a = e.useMemo, g = e.useDebugValue; | ||
return Q.useSyncExternalStoreWithSelector = function(v, i, l, f, d) { | ||
var y = c(null); | ||
if (y.current === null) { | ||
var u = { hasValue: !1, value: null }; | ||
_.current = u; | ||
} else u = _.current; | ||
_ = a(function() { | ||
function w(p) { | ||
if (!O) { | ||
if (O = !0, m = p, p = s(p), d !== void 0 && u.hasValue) { | ||
y.current = u; | ||
} else u = y.current; | ||
y = a(function() { | ||
function _(m) { | ||
if (!C) { | ||
if (C = !0, p = m, m = f(m), d !== void 0 && u.hasValue) { | ||
var b = u.value; | ||
if (d(b, p)) return h = b; | ||
if (d(b, m)) return S = b; | ||
} | ||
return h = p; | ||
return S = m; | ||
} | ||
if (b = h, n(m, p)) return b; | ||
var L = s(p); | ||
return d !== void 0 && d(b, L) ? b : (m = p, h = L); | ||
if (b = S, r(p, m)) return b; | ||
var O = f(m); | ||
return d !== void 0 && d(b, O) ? b : (p = m, S = O); | ||
} | ||
var O = !1, m, h, E = f === void 0 ? null : f; | ||
var C = !1, p, S, E = l === void 0 ? null : l; | ||
return [function() { | ||
return w(c()); | ||
return _(i()); | ||
}, E === null ? void 0 : function() { | ||
return w(E()); | ||
return _(E()); | ||
}]; | ||
}, [c, f, s, d]); | ||
var v = o(g, _[0], _[1]); | ||
return l(function() { | ||
u.hasValue = !0, u.value = v; | ||
}, [v]), S(v), v; | ||
}, $; | ||
}, [i, l, f, d]); | ||
var h = o(v, y[0], y[1]); | ||
return s(function() { | ||
u.hasValue = !0, u.value = h; | ||
}, [h]), g(h), h; | ||
}, Q; | ||
} | ||
var ee = {}; | ||
var te = {}; | ||
/** | ||
@@ -706,54 +706,54 @@ * @license React | ||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); | ||
var e = C, t = Re(); | ||
function r(c, f) { | ||
return c === f && (c !== 0 || 1 / c === 1 / f) || c !== c && f !== f; | ||
var e = D, t = De(); | ||
function n(i, l) { | ||
return i === l && (i !== 0 || 1 / i === 1 / l) || i !== i && l !== l; | ||
} | ||
var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, i = e.useRef, l = e.useEffect, a = e.useMemo, S = e.useDebugValue; | ||
function g(c, f, s, d, _) { | ||
var u = i(null), v; | ||
u.current === null ? (v = { | ||
var r = typeof Object.is == "function" ? Object.is : n, o = t.useSyncExternalStore, c = e.useRef, s = e.useEffect, a = e.useMemo, g = e.useDebugValue; | ||
function v(i, l, f, d, y) { | ||
var u = c(null), h; | ||
u.current === null ? (h = { | ||
hasValue: !1, | ||
value: null | ||
}, u.current = v) : v = u.current; | ||
var w = a(function() { | ||
var E = !1, p, b, L = function(M) { | ||
}, u.current = h) : h = u.current; | ||
var _ = a(function() { | ||
var E = !1, m, b, O = function(N) { | ||
if (!E) { | ||
E = !0, p = M; | ||
var U = d(M); | ||
if (_ !== void 0 && v.hasValue) { | ||
var z = v.value; | ||
if (_(z, U)) | ||
return b = z, z; | ||
E = !0, m = N; | ||
var z = d(N); | ||
if (y !== void 0 && h.hasValue) { | ||
var K = h.value; | ||
if (y(K, z)) | ||
return b = K, K; | ||
} | ||
return b = U, U; | ||
return b = z, z; | ||
} | ||
var xe = p, K = b; | ||
if (n(xe, M)) | ||
return K; | ||
var Y = d(M); | ||
return _ !== void 0 && _(K, Y) ? K : (p = M, b = Y, Y); | ||
}, R = s === void 0 ? null : s, B = function() { | ||
return L(f()); | ||
}, F = R === null ? void 0 : function() { | ||
return L(R()); | ||
var xe = m, Y = b; | ||
if (r(xe, N)) | ||
return Y; | ||
var q = d(N); | ||
return y !== void 0 && y(Y, q) ? Y : (m = N, b = q, q); | ||
}, L = f === void 0 ? null : f, R = function() { | ||
return O(l()); | ||
}, k = L === null ? void 0 : function() { | ||
return O(L()); | ||
}; | ||
return [B, F]; | ||
}, [f, s, d, _]), O = w[0], m = w[1], h = o(c, O, m); | ||
return l(function() { | ||
v.hasValue = !0, v.value = h; | ||
}, [h]), S(h), h; | ||
return [R, k]; | ||
}, [l, f, d, y]), C = _[0], p = _[1], S = o(i, C, p); | ||
return s(function() { | ||
h.hasValue = !0, h.value = S; | ||
}, [S]), g(S), S; | ||
} | ||
ee.useSyncExternalStoreWithSelector = g, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); | ||
}()), ee; | ||
te.useSyncExternalStoreWithSelector = v, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); | ||
}()), te; | ||
} | ||
process.env.NODE_ENV === "production" ? re.exports = yt() : re.exports = Et(); | ||
var _t = re.exports; | ||
const wt = /* @__PURE__ */ gt(_t), De = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, { useDebugValue: bt } = C, { useSyncExternalStoreWithSelector: Ot } = wt; | ||
process.env.NODE_ENV === "production" ? ne.exports = yt() : ne.exports = Et(); | ||
var _t = ne.exports; | ||
const wt = /* @__PURE__ */ gt(_t), Re = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, { useDebugValue: bt } = D, { useSyncExternalStoreWithSelector: Ot } = wt; | ||
let ge = !1; | ||
const Ct = (e) => e; | ||
function Lt(e, t = Ct, r) { | ||
(De ? "production" : void 0) !== "production" && r && !ge && (console.warn( | ||
function Lt(e, t = Ct, n) { | ||
(Re ? "production" : void 0) !== "production" && n && !ge && (console.warn( | ||
"[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937" | ||
), ge = !0); | ||
const n = Ot( | ||
const r = Ot( | ||
e.subscribe, | ||
@@ -763,23 +763,23 @@ e.getState, | ||
t, | ||
r | ||
n | ||
); | ||
return bt(n), n; | ||
return bt(r), r; | ||
} | ||
const pe = (e) => { | ||
(De ? "production" : void 0) !== "production" && typeof e != "function" && console.warn( | ||
(Re ? "production" : void 0) !== "production" && typeof e != "function" && console.warn( | ||
"[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`." | ||
); | ||
const t = typeof e == "function" ? St(e) : e, r = (n, o) => Lt(t, n, o); | ||
return Object.assign(r, t), r; | ||
}, Rt = (e) => e ? pe(e) : pe, Te = Rt((e) => ({ | ||
const t = typeof e == "function" ? St(e) : e, n = (r, o) => Lt(t, r, o); | ||
return Object.assign(n, t), n; | ||
}, Dt = (e) => e ? pe(e) : pe, Te = Dt((e) => ({ | ||
instances: {}, | ||
setData: (t, r) => e((n) => { | ||
var i, l; | ||
const o = n.instances[t] || { isTyping: !1, inDelay: !1 }; | ||
return r || (r = { filteredData: ((i = o.data) == null ? void 0 : i.filteredData) ?? [], name: t, search: "" }), !r.filteredData && ((l = o.data) != null && l.filteredData) && (r.filteredData = o.data.filteredData), { | ||
setData: (t, n) => e((r) => { | ||
var c, s, a; | ||
const o = r.instances[t] || { isTyping: !1, inDelay: !1 }; | ||
return n || (n = { filteredData: ((c = o.data) == null ? void 0 : c.filteredData) ?? [], name: t, search: "" }), !((s = n.filteredData) != null && s.length) && ((a = o.data) != null && a.filteredData) && (n.filteredData = o.data.filteredData), { | ||
instances: { | ||
...n.instances, | ||
...r.instances, | ||
[t]: { | ||
...o, | ||
data: r | ||
data: n | ||
} | ||
@@ -789,12 +789,12 @@ } | ||
}), | ||
setFilteredData: (t, r) => e((n) => { | ||
setFilteredData: (t, n) => e((r) => { | ||
var o; | ||
return { | ||
instances: { | ||
...n.instances, | ||
...r.instances, | ||
[t]: { | ||
...n.instances[t], | ||
...r.instances[t], | ||
data: { | ||
...((o = n.instances[t]) == null ? void 0 : o.data) || { name: t, search: "" }, | ||
filteredData: r | ||
...((o = r.instances[t]) == null ? void 0 : o.data) || { name: t, search: "" }, | ||
filteredData: n | ||
} | ||
@@ -805,23 +805,24 @@ } | ||
}), | ||
setTyping: (t, r) => e((n) => ({ | ||
setTyping: (t, n) => e((r) => ({ | ||
instances: { | ||
...n.instances, | ||
...r.instances, | ||
[t]: { | ||
...n.instances[t], | ||
isTyping: r | ||
...r.instances[t], | ||
isTyping: n | ||
} | ||
} | ||
})), | ||
setDelay: (t, r) => e((n) => ({ | ||
setDelay: (t, n) => e((r) => ({ | ||
instances: { | ||
...n.instances, | ||
...r.instances, | ||
[t]: { | ||
...n.instances[t], | ||
inDelay: r | ||
...r.instances[t], | ||
inDelay: n | ||
} | ||
} | ||
})) | ||
})), V = C.createContext({ | ||
})), M = D.createContext({ | ||
isOpen: !1, | ||
isTyping: !1, | ||
clearCache: "off", | ||
selected: { label: "", value: "" }, | ||
@@ -836,118 +837,146 @@ toggleOpen: () => { | ||
} | ||
}), x = C.forwardRef( | ||
({ children: e, onChange: t, onBlur: r, name: n, onOpenChange: o, ...i }, l) => { | ||
const [a, S] = te(!1), { instances: g, setData: c, setTyping: f, setFilteredData: s } = Te((h) => h), { data: d, isTyping: _ } = g[n ?? ""] ?? {}, [u, v] = te({ label: "", value: "" }), w = oe(null), O = oe(null); | ||
C.useEffect(() => { | ||
const h = (p) => { | ||
const b = p.target; | ||
w != null && w.current && !w.current.contains(b) && (O != null && O.current) && !O.current.contains(b) && S(!1); | ||
}, E = (p) => { | ||
p.key === "Escape" ? S(!1) : (p.key === "Backspace" || p.key === "Delete") && s(n ?? "", []); | ||
}), A = D.forwardRef( | ||
({ children: e, onChange: t, onBlur: n, name: r, onOpenChange: o, value: c, clearCache: s = "off", ...a }, g) => { | ||
const [v, i] = H(!1), [l, f] = H(0), { instances: d, setData: y, setTyping: u, setFilteredData: h } = Te((O) => O), { data: _, isTyping: C } = d[r ?? ""] ?? {}, [p, S] = H({ label: "", value: "" }), E = oe(null), m = oe(null); | ||
D.useEffect(() => { | ||
const O = (R) => { | ||
const k = R.target; | ||
E != null && E.current && !E.current.contains(k) && (m != null && m.current) && !m.current.contains(k) && i(!1); | ||
}, L = (R) => { | ||
R.key === "Escape" ? i(!1) : (R.key === "Backspace" || R.key === "Delete") && h(r ?? "", []); | ||
}; | ||
return document.addEventListener("mousedown", h), document.addEventListener("keydown", E), () => { | ||
document.removeEventListener("mousedown", h), document.addEventListener("keydown", E); | ||
return document.addEventListener("mousedown", O), document.addEventListener("keydown", L), () => { | ||
document.removeEventListener("mousedown", O), document.addEventListener("keydown", L); | ||
}; | ||
}, []), C.useEffect(() => { | ||
a ? c(n ?? "", { | ||
name: n ?? "", | ||
search: u.label.toLowerCase() | ||
}) : c(n ?? ""), o && o(a); | ||
}, [a]); | ||
const m = () => { | ||
S(!a); | ||
}, []), D.useEffect(() => { | ||
v ? y(r ?? "", { | ||
name: r ?? "", | ||
search: p.label.toLowerCase() | ||
}) : y(r ?? ""), o && o(v); | ||
}, [v]), D.useEffect(() => { | ||
c && c !== "" && l === 0 && (S({ label: c, value: p.value }), y(r ?? "", { | ||
name: r ?? "", | ||
search: c | ||
}), u(r ?? "", !0), f(1)); | ||
}, [c]), D.useEffect(() => { | ||
var O, L; | ||
if (_ && _.name === (r ?? "") && ((O = _.filteredData) != null && O.length) && _.filteredData[0].label.toLowerCase() === p.label.toLowerCase() && l === 1) { | ||
f(2); | ||
const R = _.filteredData.find((k) => k.label.toLowerCase() === p.label.toLowerCase()) ?? _.filteredData[0]; | ||
S(R), t && t({ target: { name: r, value: R.value } }), s === "first" && (y(r ?? "", { | ||
name: r ?? "", | ||
search: "", | ||
filteredData: [] | ||
}), u(r ?? "", !1)); | ||
} else l === 2 && !C && ((L = _ == null ? void 0 : _.filteredData) != null && L.length) && (_ == null ? void 0 : _.search) !== "" && s === "first" && (f(3), y(r ?? "", { | ||
name: r ?? "", | ||
search: "", | ||
filteredData: [] | ||
}), u(r ?? "", !C)); | ||
}, [_ == null ? void 0 : _.filteredData, C, l]); | ||
const b = () => { | ||
i(!v); | ||
}; | ||
return /* @__PURE__ */ D( | ||
V.Provider, | ||
return /* @__PURE__ */ T( | ||
M.Provider, | ||
{ | ||
value: { | ||
data: d, | ||
isOpen: a, | ||
isTyping: _, | ||
selected: u, | ||
toggleOpen: m, | ||
areaRef: w, | ||
searchRef: O, | ||
setSelected: v, | ||
setTyping: f, | ||
setData: c, | ||
data: _, | ||
isOpen: v, | ||
isTyping: C, | ||
selected: p, | ||
toggleOpen: b, | ||
clearCache: s, | ||
areaRef: E, | ||
searchRef: m, | ||
setSelected: S, | ||
setTyping: u, | ||
setData: y, | ||
onChange: t, | ||
onBlur: r, | ||
name: n, | ||
ref: l | ||
onBlur: n, | ||
name: r, | ||
ref: g | ||
}, | ||
children: /* @__PURE__ */ D("div", { ...i, children: e }) | ||
children: /* @__PURE__ */ T("div", { ...a, children: e }) | ||
} | ||
); | ||
} | ||
), Dt = ({ children: e, ...t }) => { | ||
const { name: r = "", selected: n, onChange: o, onBlur: i, ref: l } = C.useContext(V); | ||
return C.useEffect(() => { | ||
const a = document.getElementById(r); | ||
), Rt = ({ children: e, ...t }) => { | ||
const { name: n = "", selected: r, onChange: o, onBlur: c, ref: s } = D.useContext(M); | ||
return D.useEffect(() => { | ||
const a = document.getElementById(n); | ||
a !== null && (a.hidden = !0); | ||
}, [r]), /* @__PURE__ */ me("div", { ...t, children: [ | ||
}, [n]), /* @__PURE__ */ me("div", { ...t, children: [ | ||
e, | ||
/* @__PURE__ */ D("input", { id: r, type: "text", value: n.value, onChange: o, onBlur: i, name: r, ref: l }) | ||
/* @__PURE__ */ T("input", { id: n, type: "text", value: r.value, onChange: o, onBlur: c, name: n, ref: s }) | ||
] }); | ||
}, Tt = ({ children: e, ...t }) => { | ||
const { isOpen: r, areaRef: n } = C.useContext(V); | ||
return r && /* @__PURE__ */ D(Le, { children: /* @__PURE__ */ D("div", { ...t, ref: n, children: e }) }); | ||
}, xt = ({ children: e, onClick: t, value: r, label: n, ...o }) => { | ||
const { setSelected: i, isOpen: l, toggleOpen: a, onChange: S, name: g, data: c, selected: f } = C.useContext(V), s = (d) => { | ||
t && t(d), i({ value: r, label: n }), l && a(), S && S({ target: { name: g, value: r } }); | ||
const { isOpen: n, areaRef: r } = D.useContext(M); | ||
return n && /* @__PURE__ */ T(Le, { children: /* @__PURE__ */ T("div", { ...t, ref: r, children: e }) }); | ||
}, xt = ({ children: e, onClick: t, value: n, label: r, ...o }) => { | ||
const { setSelected: c, isOpen: s, toggleOpen: a, onChange: g, name: v, data: i, selected: l } = D.useContext(M), f = (d) => { | ||
t && t(d), c({ value: n, label: r }), s && a(), g && g({ target: { name: v, value: n } }); | ||
}; | ||
return C.useEffect(() => { | ||
if ((c == null ? void 0 : c.name) === g) { | ||
if ((c == null ? void 0 : c.search) !== "" && (c == null ? void 0 : c.search.toLowerCase()) === n.toLowerCase()) { | ||
i({ value: r, label: n }), S && S({ target: { name: g, value: r } }); | ||
return; | ||
} | ||
i({ value: "", label: f.label }), S && S({ target: { name: g, value: "" } }); | ||
} | ||
}, [n, r, c, f.label, i, g, S]), /* @__PURE__ */ D("div", { ...o, onClick: s, children: e ?? n }); | ||
}, At = ({ children: e, onClick: t, ...r }) => { | ||
const { toggleOpen: n } = C.useContext(V); | ||
return /* @__PURE__ */ D("button", { ...r, onClick: (i) => { | ||
n(), t && t(i); | ||
return D.useEffect(() => { | ||
var d, y; | ||
(i == null ? void 0 : i.name) === v && ((i == null ? void 0 : i.search) !== "" && (i == null ? void 0 : i.search.toLowerCase()) === r.toLowerCase() ? (c({ value: n, label: r }), g && g({ target: { name: v, value: n } })) : (l.label === "" || ((d = i == null ? void 0 : i.filteredData) == null ? void 0 : d.length) === 0 || !((y = i == null ? void 0 : i.filteredData) != null && y.find((u) => u.label.toLowerCase() === l.label.toLowerCase()))) && (c({ value: "", label: l.label }), g && g({ target: { name: v, value: "" } }))); | ||
}, [r, n, i, l.label, c, v, g]), /* @__PURE__ */ T("div", { ...o, onClick: f, children: e ?? r }); | ||
}, At = ({ children: e, onClick: t, ...n }) => { | ||
const { toggleOpen: r } = D.useContext(M); | ||
return /* @__PURE__ */ T("button", { ...n, onClick: (c) => { | ||
r(), t && t(c); | ||
}, children: e }); | ||
}, kt = C.memo(({ onChange: e, onFocus: t, ...r }) => { | ||
const { isOpen: n, toggleOpen: o, selected: i, searchRef: l, setData: a, setTyping: S, setSelected: g, name: c } = C.useContext(V); | ||
return /* @__PURE__ */ D( | ||
}, kt = D.memo(({ onChange: e, onFocus: t, ...n }) => { | ||
const { isOpen: r, toggleOpen: o, selected: c, searchRef: s, setData: a, setTyping: g, setSelected: v, name: i } = D.useContext(M); | ||
return /* @__PURE__ */ T( | ||
"input", | ||
{ | ||
ref: l, | ||
ref: s, | ||
onChange: (d) => { | ||
a(c ?? "", { | ||
name: c ?? "", | ||
a(i ?? "", { | ||
name: i ?? "", | ||
search: d.target.value.toLowerCase() | ||
}), g({ label: d.target.value, value: i.value }), S(c ?? "", !0), e && e(d); | ||
}), v({ label: d.target.value, value: c.value }), g(i ?? "", !0), e && e(d); | ||
}, | ||
onFocus: (d) => { | ||
n || o(), t && t(d); | ||
r || o(), t && t(d); | ||
}, | ||
type: "text", | ||
value: i.label, | ||
...r | ||
value: c.label, | ||
...n | ||
} | ||
); | ||
}); | ||
x.Trigger = Dt; | ||
x.Item = xt; | ||
x.Panel = Tt; | ||
x.Button = At; | ||
x.Search = kt; | ||
const It = () => /* @__PURE__ */ D("p", { className: "p-2", children: "Carregando..." }), Vt = C.memo( | ||
C.forwardRef( | ||
A.Trigger = Rt; | ||
A.Item = xt; | ||
A.Panel = Tt; | ||
A.Button = At; | ||
A.Search = kt; | ||
const It = () => /* @__PURE__ */ T("p", { className: "p-2", children: "Carregando..." }), Vt = D.memo( | ||
D.forwardRef( | ||
({ | ||
data: e, | ||
placeholder: t, | ||
className: r = "border-[1px] p-4 w-full cursor-pointer focus:cursor-text placeholder:gray-400 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition duration-300 ease-in-out", | ||
itemClassName: n = "p-2 cursor-pointer hover:bg-gray-200 transition duration-300 ease-in-out", | ||
className: n = "border-[1px] p-4 w-full cursor-pointer focus:cursor-text placeholder:gray-400 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition duration-300 ease-in-out", | ||
itemClassName: r = "p-2 cursor-pointer hover:bg-gray-200 transition duration-300 ease-in-out", | ||
disabled: o, | ||
...i | ||
}, l) => { | ||
const a = Bt(e, i.name); | ||
return /* @__PURE__ */ me(x, { className: "relative flex flex-col", ref: l, ...i, children: [ | ||
/* @__PURE__ */ D(x.Trigger, { className: "z-10", children: /* @__PURE__ */ D(x.Search, { className: r, placeholder: t, disabled: o }) }), | ||
/* @__PURE__ */ D(x.Panel, { className: "flex z-20 flex-col absolute bg-white mt-1 rounded-lg shadow-lg p-2 w-full overflow-y-auto max-h-[360%] scrollbar-none", children: a.length ? a.map((S, g) => /* @__PURE__ */ D(x.Item, { value: S.value, label: S.label, className: n }, g)) : /* @__PURE__ */ D(It, {}) }) | ||
] }); | ||
autoValue: c, | ||
value: s, | ||
...a | ||
}, g) => { | ||
const v = Bt(e, a.name), i = c && !s && v.length ? v[0].label : null; | ||
return /* @__PURE__ */ me( | ||
A, | ||
{ | ||
value: i ?? s, | ||
clearCache: c && !s ? "first" : "off", | ||
className: "relative flex flex-col", | ||
ref: g, | ||
...a, | ||
children: [ | ||
/* @__PURE__ */ T(A.Trigger, { className: "z-10", children: /* @__PURE__ */ T(A.Search, { className: n, placeholder: t, disabled: o }) }), | ||
/* @__PURE__ */ T(A.Panel, { className: "flex z-20 flex-col absolute bg-white mt-1 rounded-lg shadow-lg p-2 w-full overflow-y-auto max-h-[360%] scrollbar-none", children: v.length ? v.map((l, f) => /* @__PURE__ */ T(A.Item, { value: l.value, label: l.label, className: r }, f)) : /* @__PURE__ */ T(It, {}) }) | ||
] | ||
} | ||
); | ||
} | ||
@@ -957,14 +986,14 @@ ) | ||
Vt.displayName = "SearchSelect"; | ||
const Bt = (e, t = "", r = 500) => { | ||
const { setFilteredData: n, setTyping: o, setDelay: i, instances: l } = Te((c) => c), { | ||
const Bt = (e, t = "", n = 500) => { | ||
const { setFilteredData: r, setTyping: o, setDelay: c, instances: s } = Te((i) => i), { | ||
data: a, | ||
isTyping: S, | ||
inDelay: g | ||
} = l[t] ?? { data: void 0, isTyping: !1, inDelay: !1 }; | ||
isTyping: g, | ||
inDelay: v | ||
} = s[t] ?? { data: void 0, isTyping: !1, inDelay: !1 }; | ||
return Ae(() => { | ||
let c = ""; | ||
if (a && a.name === t && (c = a.search), S) { | ||
g || (i(t, !0), setTimeout(() => { | ||
o(t, !1), i(t, !1); | ||
}, r)); | ||
let i = ""; | ||
if (a && a.name === t && (i = a.search), g) { | ||
v || (c(t, !0), setTimeout(() => { | ||
o(t, !1), c(t, !1); | ||
}, n)); | ||
return; | ||
@@ -974,22 +1003,22 @@ } | ||
if (a != null && a.filteredData && (a != null && a.filteredData.length)) { | ||
const s = a.filteredData.filter((d) => d.label.toLowerCase().includes(c.toLowerCase())); | ||
if (s.length) return n(t, s); | ||
const f = a.filteredData.filter((d) => d.label.toLowerCase().includes(i.toLowerCase())); | ||
if (f.length && i !== "") return r(t, f); | ||
} | ||
if (n(t, []), typeof e == "function") { | ||
const s = await e(c); | ||
Array.isArray(s) && n( | ||
if (r(t, []), typeof e == "function") { | ||
const f = await e(i); | ||
Array.isArray(f) && r( | ||
t, | ||
s.filter((d) => d.label.toLowerCase().includes(c.toLowerCase())) | ||
f.filter((d) => d.label.toLowerCase().includes(i.toLowerCase())) | ||
); | ||
} else if (Array.isArray(e)) { | ||
const s = e.filter((d) => d.label.toLowerCase().includes(c.toLowerCase())); | ||
n(t, s); | ||
const f = e.filter((d) => d.label.toLowerCase().includes(i.toLowerCase())); | ||
r(t, f); | ||
} | ||
})(); | ||
}, [S]), (a == null ? void 0 : a.filteredData) ?? []; | ||
}, [g]), (a == null ? void 0 : a.filteredData) ?? []; | ||
}; | ||
export { | ||
Vt as SearchSelect, | ||
x as Select, | ||
A as Select, | ||
Bt as useDataSearch | ||
}; |
@@ -1,42 +0,42 @@ | ||
(function(A,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],L):(A=typeof globalThis<"u"?globalThis:A||self,L(A["simple-search-dropdown"]={},A["react/jsx-runtime"],A.React))})(this,function(A,L,w){"use strict";function Ae(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const m=Ae(w);var k=function(){return k=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},k.apply(this,arguments)};function oe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function ke(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var N="right-scroll-bar-position",j="width-before-scroll-bar",Ie="with-scroll-bars-hidden",Ve="--removed-body-scroll-bar-size";function F(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Be(e,t){var r=w.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Me=typeof window<"u"?m.useLayoutEffect:m.useEffect,ae=new WeakMap;function Pe(e,t){var r=Be(null,function(n){return e.forEach(function(o){return F(o,n)})});return Me(function(){var n=ae.get(r);if(n){var o=new Set(n),i=new Set(e),l=r.current;o.forEach(function(a){i.has(a)||F(a,null)}),i.forEach(function(a){o.has(a)||F(a,l)})}ae.set(r,e)},[e]),r}function Re(e){return e}function Ne(e,t){t===void 0&&(t=Re);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var l=t(i,n);return r.push(l),function(){r=r.filter(function(a){return a!==l})}},assignSyncMedium:function(i){for(n=!0;r.length;){var l=r;r=[],l.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var l=[];if(r.length){var a=r;r=[],a.forEach(i),l=r}var S=function(){var c=l;l=[],c.forEach(i)},p=function(){return Promise.resolve().then(S)};p(),r={push:function(c){l.push(c),p()},filter:function(c){return l=l.filter(c),r}}}};return o}function je(e){e===void 0&&(e={});var t=Ne(null);return t.options=k({async:!0,ssr:!1},e),t}var ie=function(e){var t=e.sideCar,r=oe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return m.createElement(n,k({},r))};ie.isSideCarExport=!0;function We(e,t){return e.useMedium(t),ie}var ce=je(),U=function(){},W=m.forwardRef(function(e,t){var r=m.useRef(null),n=m.useState({onScrollCapture:U,onWheelCapture:U,onTouchMoveCapture:U}),o=n[0],i=n[1],l=e.forwardProps,a=e.children,S=e.className,p=e.removeScrollBar,c=e.enabled,f=e.shards,s=e.sideCar,d=e.noIsolation,_=e.inert,u=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,C=e.gapMode,y=oe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),h=s,E=Pe([r,t]),g=k(k({},y),o);return m.createElement(m.Fragment,null,c&&m.createElement(h,{sideCar:ce,removeScrollBar:p,shards:f,noIsolation:d,inert:_,setCallbacks:i,allowPinchZoom:!!u,lockRef:r,gapMode:C}),l?m.cloneElement(m.Children.only(a),k(k({},g),{ref:E})):m.createElement(b,k({},g,{className:S,ref:E}),a))});W.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},W.classNames={fullWidth:j,zeroRight:N};var He=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ge(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=He();return t&&e.setAttribute("nonce",t),e}function ze(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Fe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ue=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Ge())&&(ze(t,r),Fe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ke=function(){var e=Ue();return function(t,r){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},ue=function(){var e=Ke(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},qe={left:0,top:0,right:0,gap:0},K=function(e){return parseInt(e||"",10)||0},Ye=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[K(r),K(n),K(o)]},Xe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qe;var t=Ye(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},$e=ue(),I="data-scroll-locked",Ze=function(e,t,r,n){var o=e.left,i=e.top,l=e.right,a=e.gap;return r===void 0&&(r="margin"),` | ||
(function(k,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],T):(k=typeof globalThis<"u"?globalThis:k||self,T(k["simple-search-dropdown"]={},k["react/jsx-runtime"],k.React))})(this,function(k,T,w){"use strict";function Ae(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const _=Ae(w);var I=function(){return I=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(t[c]=n[c])}return t},I.apply(this,arguments)};function oe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function ke(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,c;r<o;r++)(c||!(r in t))&&(c||(c=Array.prototype.slice.call(t,0,r)),c[r]=t[r]);return e.concat(c||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var R="right-scroll-bar-position",W="width-before-scroll-bar",Ie="with-scroll-bars-hidden",Ve="--removed-body-scroll-bar-size";function U(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Be(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Me=typeof window<"u"?_.useLayoutEffect:_.useEffect,ae=new WeakMap;function Pe(e,t){var n=Be(null,function(r){return e.forEach(function(o){return U(o,r)})});return Me(function(){var r=ae.get(n);if(r){var o=new Set(r),c=new Set(e),s=n.current;o.forEach(function(a){c.has(a)||U(a,null)}),c.forEach(function(a){o.has(a)||U(a,s)})}ae.set(n,e)},[e]),n}function Ne(e){return e}function je(e,t){t===void 0&&(t=Ne);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(c){var s=t(c,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(c){for(r=!0;n.length;){var s=n;n=[],s.forEach(c)}n={push:function(a){return c(a)},filter:function(){return n}}},assignMedium:function(c){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(c),s=n}var g=function(){var i=s;s=[],i.forEach(c)},v=function(){return Promise.resolve().then(g)};v(),n={push:function(i){s.push(i),v()},filter:function(i){return s=s.filter(i),n}}}};return o}function Re(e){e===void 0&&(e={});var t=je(null);return t.options=I({async:!0,ssr:!1},e),t}var ie=function(e){var t=e.sideCar,n=oe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return _.createElement(r,I({},n))};ie.isSideCarExport=!0;function We(e,t){return e.useMedium(t),ie}var ce=Re(),K=function(){},H=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:K,onWheelCapture:K,onTouchMoveCapture:K}),o=r[0],c=r[1],s=e.forwardProps,a=e.children,g=e.className,v=e.removeScrollBar,i=e.enabled,l=e.shards,f=e.sideCar,d=e.noIsolation,y=e.inert,u=e.allowPinchZoom,h=e.as,b=h===void 0?"div":h,D=e.gapMode,p=oe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,E=Pe([n,t]),m=I(I({},p),o);return _.createElement(_.Fragment,null,i&&_.createElement(S,{sideCar:ce,removeScrollBar:v,shards:l,noIsolation:d,inert:y,setCallbacks:c,allowPinchZoom:!!u,lockRef:n,gapMode:D}),s?_.cloneElement(_.Children.only(a),I(I({},m),{ref:E})):_.createElement(b,I({},m,{className:g,ref:E}),a))});H.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},H.classNames={fullWidth:W,zeroRight:R};var He=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ge(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=He();return t&&e.setAttribute("nonce",t),e}function ze(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Fe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ue=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ge())&&(ze(t,n),Fe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ke=function(){var e=Ue();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ue=function(){var e=Ke(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},qe={left:0,top:0,right:0,gap:0},q=function(e){return parseInt(e||"",10)||0},Ye=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[q(n),q(r),q(o)]},Xe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qe;var t=Ye(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$e=ue(),B="data-scroll-locked",Ze=function(e,t,n,r){var o=e.left,c=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` | ||
.`.concat(Ie,` { | ||
overflow: hidden `).concat(n,`; | ||
padding-right: `).concat(a,"px ").concat(n,`; | ||
overflow: hidden `).concat(r,`; | ||
padding-right: `).concat(a,"px ").concat(r,`; | ||
} | ||
body[`).concat(I,`] { | ||
overflow: hidden `).concat(n,`; | ||
body[`).concat(B,`] { | ||
overflow: hidden `).concat(r,`; | ||
overscroll-behavior: contain; | ||
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` | ||
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` | ||
padding-left: `.concat(o,`px; | ||
padding-top: `).concat(i,`px; | ||
padding-right: `).concat(l,`px; | ||
padding-top: `).concat(c,`px; | ||
padding-right: `).concat(s,`px; | ||
margin-left:0; | ||
margin-top:0; | ||
margin-right: `).concat(a,"px ").concat(n,`; | ||
`),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` | ||
margin-right: `).concat(a,"px ").concat(r,`; | ||
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` | ||
} | ||
.`).concat(N,` { | ||
right: `).concat(a,"px ").concat(n,`; | ||
.`).concat(R,` { | ||
right: `).concat(a,"px ").concat(r,`; | ||
} | ||
.`).concat(j,` { | ||
margin-right: `).concat(a,"px ").concat(n,`; | ||
.`).concat(W,` { | ||
margin-right: `).concat(a,"px ").concat(r,`; | ||
} | ||
.`).concat(N," .").concat(N,` { | ||
right: 0 `).concat(n,`; | ||
.`).concat(R," .").concat(R,` { | ||
right: 0 `).concat(r,`; | ||
} | ||
.`).concat(j," .").concat(j,` { | ||
margin-right: 0 `).concat(n,`; | ||
.`).concat(W," .").concat(W,` { | ||
margin-right: 0 `).concat(r,`; | ||
} | ||
body[`).concat(I,`] { | ||
body[`).concat(B,`] { | ||
`).concat(Ve,": ").concat(a,`px; | ||
} | ||
`)},le=function(){var e=parseInt(document.body.getAttribute(I)||"0",10);return isFinite(e)?e:0},Qe=function(){m.useEffect(function(){return document.body.setAttribute(I,(le()+1).toString()),function(){var e=le()-1;e<=0?document.body.removeAttribute(I):document.body.setAttribute(I,e.toString())}},[])},Je=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;Qe();var i=m.useMemo(function(){return Xe(o)},[o]);return m.createElement($e,{styles:Ze(i,!t,o,r?"":"!important")})},q=!1;if(typeof window<"u")try{var H=Object.defineProperty({},"passive",{get:function(){return q=!0,!0}});window.addEventListener("test",H,H),window.removeEventListener("test",H,H)}catch{q=!1}var V=q?{passive:!1}:!1,et=function(e){return e.tagName==="TEXTAREA"},se=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!et(e)&&r[t]==="visible")},tt=function(e){return se(e,"overflowY")},nt=function(e){return se(e,"overflowX")},fe=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=de(e,n);if(o){var i=ve(e,n),l=i[1],a=i[2];if(l>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},rt=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},ot=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},de=function(e,t){return e==="v"?tt(t):nt(t)},ve=function(e,t){return e==="v"?rt(t):ot(t)},at=function(e,t){return e==="h"&&t==="rtl"?-1:1},it=function(e,t,r,n,o){var i=at(e,window.getComputedStyle(t).direction),l=i*n,a=r.target,S=t.contains(a),p=!1,c=l>0,f=0,s=0;do{var d=ve(e,a),_=d[0],u=d[1],v=d[2],b=u-v-i*_;(_||b)&&de(e,a)&&(f+=b,s+=_),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!S&&a!==document.body||S&&(t.contains(a)||t===a));return(c&&(Math.abs(f)<1||!o)||!c&&(Math.abs(s)<1||!o))&&(p=!0),p},G=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},he=function(e){return[e.deltaX,e.deltaY]},Se=function(e){return e&&"current"in e?e.current:e},ct=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ut=function(e){return` | ||
`)},le=function(){var e=parseInt(document.body.getAttribute(B)||"0",10);return isFinite(e)?e:0},Qe=function(){_.useEffect(function(){return document.body.setAttribute(B,(le()+1).toString()),function(){var e=le()-1;e<=0?document.body.removeAttribute(B):document.body.setAttribute(B,e.toString())}},[])},Je=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Qe();var c=_.useMemo(function(){return Xe(o)},[o]);return _.createElement($e,{styles:Ze(c,!t,o,n?"":"!important")})},Y=!1;if(typeof window<"u")try{var G=Object.defineProperty({},"passive",{get:function(){return Y=!0,!0}});window.addEventListener("test",G,G),window.removeEventListener("test",G,G)}catch{Y=!1}var M=Y?{passive:!1}:!1,et=function(e){return e.tagName==="TEXTAREA"},se=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!et(e)&&n[t]==="visible")},tt=function(e){return se(e,"overflowY")},rt=function(e){return se(e,"overflowX")},fe=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=de(e,r);if(o){var c=ve(e,r),s=c[1],a=c[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},nt=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ot=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},de=function(e,t){return e==="v"?tt(t):rt(t)},ve=function(e,t){return e==="v"?nt(t):ot(t)},at=function(e,t){return e==="h"&&t==="rtl"?-1:1},it=function(e,t,n,r,o){var c=at(e,window.getComputedStyle(t).direction),s=c*r,a=n.target,g=t.contains(a),v=!1,i=s>0,l=0,f=0;do{var d=ve(e,a),y=d[0],u=d[1],h=d[2],b=u-h-c*y;(y||b)&&de(e,a)&&(l+=b,f+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!g&&a!==document.body||g&&(t.contains(a)||t===a));return(i&&(Math.abs(l)<1||!o)||!i&&(Math.abs(f)<1||!o))&&(v=!0),v},z=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},he=function(e){return[e.deltaX,e.deltaY]},Se=function(e){return e&&"current"in e?e.current:e},ct=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ut=function(e){return` | ||
.block-interactivity-`.concat(e,` {pointer-events: none;} | ||
.allow-interactivity-`).concat(e,` {pointer-events: all;} | ||
`)},lt=0,B=[];function st(e){var t=m.useRef([]),r=m.useRef([0,0]),n=m.useRef(),o=m.useState(lt++)[0],i=m.useState(ue)[0],l=m.useRef(e);m.useEffect(function(){l.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var u=ke([e.lockRef.current],(e.shards||[]).map(Se),!0).filter(Boolean);return u.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),u.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=m.useCallback(function(u,v){if("touches"in u&&u.touches.length===2)return!l.current.allowPinchZoom;var b=G(u),C=r.current,y="deltaX"in u?u.deltaX:C[0]-b[0],h="deltaY"in u?u.deltaY:C[1]-b[1],E,g=u.target,O=Math.abs(y)>Math.abs(h)?"h":"v";if("touches"in u&&O==="h"&&g.type==="range")return!1;var D=fe(O,g);if(!D)return!0;if(D?E=O:(E=O==="v"?"h":"v",D=fe(O,g)),!D)return!1;if(!n.current&&"changedTouches"in u&&(y||h)&&(n.current=E),!E)return!0;var T=n.current||E;return it(T,v,u,T==="h"?y:h,!0)},[]),S=m.useCallback(function(u){var v=u;if(!(!B.length||B[B.length-1]!==i)){var b="deltaY"in v?he(v):G(v),C=t.current.filter(function(E){return E.name===v.type&&(E.target===v.target||v.target===E.shadowParent)&&ct(E.delta,b)})[0];if(C&&C.should){v.cancelable&&v.preventDefault();return}if(!C){var y=(l.current.shards||[]).map(Se).filter(Boolean).filter(function(E){return E.contains(v.target)}),h=y.length>0?a(v,y[0]):!l.current.noIsolation;h&&v.cancelable&&v.preventDefault()}}},[]),p=m.useCallback(function(u,v,b,C){var y={name:u,delta:v,target:b,should:C,shadowParent:ft(b)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(h){return h!==y})},1)},[]),c=m.useCallback(function(u){r.current=G(u),n.current=void 0},[]),f=m.useCallback(function(u){p(u.type,he(u),u.target,a(u,e.lockRef.current))},[]),s=m.useCallback(function(u){p(u.type,G(u),u.target,a(u,e.lockRef.current))},[]);m.useEffect(function(){return B.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:s}),document.addEventListener("wheel",S,V),document.addEventListener("touchmove",S,V),document.addEventListener("touchstart",c,V),function(){B=B.filter(function(u){return u!==i}),document.removeEventListener("wheel",S,V),document.removeEventListener("touchmove",S,V),document.removeEventListener("touchstart",c,V)}},[]);var d=e.removeScrollBar,_=e.inert;return m.createElement(m.Fragment,null,_?m.createElement(i,{styles:ut(o)}):null,d?m.createElement(Je,{gapMode:e.gapMode}):null)}function ft(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dt=We(ce,st);var pe=m.forwardRef(function(e,t){return m.createElement(W,k({},e,{ref:t,sideCar:dt}))});pe.classNames=W.classNames;const vt={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},ge=e=>{let t;const r=new Set,n=(c,f)=>{const s=typeof c=="function"?c(t):c;if(!Object.is(s,t)){const d=t;t=f??(typeof s!="object"||s===null)?s:Object.assign({},t,s),r.forEach(_=>_(t,d))}},o=()=>t,S={setState:n,getState:o,getInitialState:()=>p,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{(vt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},p=t=e(n,o,S);return S},ht=e=>e?ge(e):ge;function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y={exports:{}},X={},z={exports:{}},$={};/** | ||
`)},lt=0,P=[];function st(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),o=_.useState(lt++)[0],c=_.useState(ue)[0],s=_.useRef(e);_.useEffect(function(){s.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var u=ke([e.lockRef.current],(e.shards||[]).map(Se),!0).filter(Boolean);return u.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),u.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=_.useCallback(function(u,h){if("touches"in u&&u.touches.length===2)return!s.current.allowPinchZoom;var b=z(u),D=n.current,p="deltaX"in u?u.deltaX:D[0]-b[0],S="deltaY"in u?u.deltaY:D[1]-b[1],E,m=u.target,O=Math.abs(p)>Math.abs(S)?"h":"v";if("touches"in u&&O==="h"&&m.type==="range")return!1;var C=fe(O,m);if(!C)return!0;if(C?E=O:(E=O==="v"?"h":"v",C=fe(O,m)),!C)return!1;if(!r.current&&"changedTouches"in u&&(p||S)&&(r.current=E),!E)return!0;var L=r.current||E;return it(L,h,u,L==="h"?p:S,!0)},[]),g=_.useCallback(function(u){var h=u;if(!(!P.length||P[P.length-1]!==c)){var b="deltaY"in h?he(h):z(h),D=t.current.filter(function(E){return E.name===h.type&&(E.target===h.target||h.target===E.shadowParent)&&ct(E.delta,b)})[0];if(D&&D.should){h.cancelable&&h.preventDefault();return}if(!D){var p=(s.current.shards||[]).map(Se).filter(Boolean).filter(function(E){return E.contains(h.target)}),S=p.length>0?a(h,p[0]):!s.current.noIsolation;S&&h.cancelable&&h.preventDefault()}}},[]),v=_.useCallback(function(u,h,b,D){var p={name:u,delta:h,target:b,should:D,shadowParent:ft(b)};t.current.push(p),setTimeout(function(){t.current=t.current.filter(function(S){return S!==p})},1)},[]),i=_.useCallback(function(u){n.current=z(u),r.current=void 0},[]),l=_.useCallback(function(u){v(u.type,he(u),u.target,a(u,e.lockRef.current))},[]),f=_.useCallback(function(u){v(u.type,z(u),u.target,a(u,e.lockRef.current))},[]);_.useEffect(function(){return P.push(c),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:f}),document.addEventListener("wheel",g,M),document.addEventListener("touchmove",g,M),document.addEventListener("touchstart",i,M),function(){P=P.filter(function(u){return u!==c}),document.removeEventListener("wheel",g,M),document.removeEventListener("touchmove",g,M),document.removeEventListener("touchstart",i,M)}},[]);var d=e.removeScrollBar,y=e.inert;return _.createElement(_.Fragment,null,y?_.createElement(c,{styles:ut(o)}):null,d?_.createElement(Je,{gapMode:e.gapMode}):null)}function ft(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dt=We(ce,st);var ge=_.forwardRef(function(e,t){return _.createElement(H,I({},e,{ref:t,sideCar:dt}))});ge.classNames=H.classNames;const vt={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},pe=e=>{let t;const n=new Set,r=(i,l)=>{const f=typeof i=="function"?i(t):i;if(!Object.is(f,t)){const d=t;t=l??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,d))}},o=()=>t,g={setState:r,getState:o,getInitialState:()=>v,subscribe:i=>(n.add(i),()=>n.delete(i)),destroy:()=>{(vt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},v=t=e(r,o,g);return g},ht=e=>e?pe(e):pe;function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X={exports:{}},$={},F={exports:{}},Z={};/** | ||
* @license React | ||
@@ -49,3 +49,3 @@ * use-sync-external-store-shim.production.min.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var me;function pt(){if(me)return $;me=1;var e=w;function t(f,s){return f===s&&(f!==0||1/f===1/s)||f!==f&&s!==s}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,o=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function a(f,s){var d=s(),_=n({inst:{value:d,getSnapshot:s}}),u=_[0].inst,v=_[1];return i(function(){u.value=d,u.getSnapshot=s,S(u)&&v({inst:u})},[f,d,s]),o(function(){return S(u)&&v({inst:u}),f(function(){S(u)&&v({inst:u})})},[f]),l(d),d}function S(f){var s=f.getSnapshot;f=f.value;try{var d=s();return!r(f,d)}catch{return!0}}function p(f,s){return s()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:a;return $.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,$}var Z={};/** | ||
*/var me;function gt(){if(me)return Z;me=1;var e=w;function t(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,c=e.useLayoutEffect,s=e.useDebugValue;function a(l,f){var d=f(),y=r({inst:{value:d,getSnapshot:f}}),u=y[0].inst,h=y[1];return c(function(){u.value=d,u.getSnapshot=f,g(u)&&h({inst:u})},[l,d,f]),o(function(){return g(u)&&h({inst:u}),l(function(){g(u)&&h({inst:u})})},[l]),s(d),d}function g(l){var f=l.getSnapshot;l=l.value;try{var d=f();return!n(l,d)}catch{return!0}}function v(l,f){return f()}var i=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?v:a;return Z.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:i,Z}var Q={};/** | ||
* @license React | ||
@@ -58,3 +58,3 @@ * use-sync-external-store-shim.development.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var ye;function gt(){return ye||(ye=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=w,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(y){{for(var h=arguments.length,E=new Array(h>1?h-1:0),g=1;g<h;g++)E[g-1]=arguments[g];n("error",y,E)}}function n(y,h,E){{var g=t.ReactDebugCurrentFrame,O=g.getStackAddendum();O!==""&&(h+="%s",E=E.concat([O]));var D=E.map(function(T){return String(T)});D.unshift("Warning: "+h),Function.prototype.apply.call(console[y],console,D)}}function o(y,h){return y===h&&(y!==0||1/y===1/h)||y!==y&&h!==h}var i=typeof Object.is=="function"?Object.is:o,l=e.useState,a=e.useEffect,S=e.useLayoutEffect,p=e.useDebugValue,c=!1,f=!1;function s(y,h,E){c||e.startTransition!==void 0&&(c=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=h();if(!f){var O=h();i(g,O)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var D=l({inst:{value:g,getSnapshot:h}}),T=D[0].inst,P=D[1];return S(function(){T.value=g,T.getSnapshot=h,d(T)&&P({inst:T})},[y,g,h]),a(function(){d(T)&&P({inst:T});var J=function(){d(T)&&P({inst:T})};return y(J)},[y]),p(g),g}function d(y){var h=y.getSnapshot,E=y.value;try{var g=h();return!i(E,g)}catch{return!0}}function _(y,h,E){return h()}var u=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",v=!u,b=v?_:s,C=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b;Z.useSyncExternalStore=C,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Z}var Ee;function _e(){return Ee||(Ee=1,process.env.NODE_ENV==="production"?z.exports=pt():z.exports=gt()),z.exports}/** | ||
*/var ye;function pt(){return ye||(ye=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=w,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(p){{for(var S=arguments.length,E=new Array(S>1?S-1:0),m=1;m<S;m++)E[m-1]=arguments[m];r("error",p,E)}}function r(p,S,E){{var m=t.ReactDebugCurrentFrame,O=m.getStackAddendum();O!==""&&(S+="%s",E=E.concat([O]));var C=E.map(function(L){return String(L)});C.unshift("Warning: "+S),Function.prototype.apply.call(console[p],console,C)}}function o(p,S){return p===S&&(p!==0||1/p===1/S)||p!==p&&S!==S}var c=typeof Object.is=="function"?Object.is:o,s=e.useState,a=e.useEffect,g=e.useLayoutEffect,v=e.useDebugValue,i=!1,l=!1;function f(p,S,E){i||e.startTransition!==void 0&&(i=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=S();if(!l){var O=S();c(m,O)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var C=s({inst:{value:m,getSnapshot:S}}),L=C[0].inst,x=C[1];return g(function(){L.value=m,L.getSnapshot=S,d(L)&&x({inst:L})},[p,m,S]),a(function(){d(L)&&x({inst:L});var V=function(){d(L)&&x({inst:L})};return p(V)},[p]),v(m),m}function d(p){var S=p.getSnapshot,E=p.value;try{var m=S();return!c(E,m)}catch{return!0}}function y(p,S,E){return S()}var u=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",h=!u,b=h?y:f,D=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b;Q.useSyncExternalStore=D,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Q}var Ee;function _e(){return Ee||(Ee=1,process.env.NODE_ENV==="production"?F.exports=gt():F.exports=pt()),F.exports}/** | ||
* @license React | ||
@@ -67,3 +67,3 @@ * use-sync-external-store-shim/with-selector.production.min.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var we;function mt(){if(we)return X;we=1;var e=w,t=_e();function r(p,c){return p===c&&(p!==0||1/p===1/c)||p!==p&&c!==c}var n=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,a=e.useMemo,S=e.useDebugValue;return X.useSyncExternalStoreWithSelector=function(p,c,f,s,d){var _=i(null);if(_.current===null){var u={hasValue:!1,value:null};_.current=u}else u=_.current;_=a(function(){function b(g){if(!C){if(C=!0,y=g,g=s(g),d!==void 0&&u.hasValue){var O=u.value;if(d(O,g))return h=O}return h=g}if(O=h,n(y,g))return O;var D=s(g);return d!==void 0&&d(O,D)?O:(y=g,h=D)}var C=!1,y,h,E=f===void 0?null:f;return[function(){return b(c())},E===null?void 0:function(){return b(E())}]},[c,f,s,d]);var v=o(p,_[0],_[1]);return l(function(){u.hasValue=!0,u.value=v},[v]),S(v),v},X}var Q={};/** | ||
*/var be;function mt(){if(be)return $;be=1;var e=w,t=_e();function n(v,i){return v===i&&(v!==0||1/v===1/i)||v!==v&&i!==i}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,c=e.useRef,s=e.useEffect,a=e.useMemo,g=e.useDebugValue;return $.useSyncExternalStoreWithSelector=function(v,i,l,f,d){var y=c(null);if(y.current===null){var u={hasValue:!1,value:null};y.current=u}else u=y.current;y=a(function(){function b(m){if(!D){if(D=!0,p=m,m=f(m),d!==void 0&&u.hasValue){var O=u.value;if(d(O,m))return S=O}return S=m}if(O=S,r(p,m))return O;var C=f(m);return d!==void 0&&d(O,C)?O:(p=m,S=C)}var D=!1,p,S,E=l===void 0?null:l;return[function(){return b(i())},E===null?void 0:function(){return b(E())}]},[i,l,f,d]);var h=o(v,y[0],y[1]);return s(function(){u.hasValue=!0,u.value=h},[h]),g(h),h},$}var J={};/** | ||
* @license React | ||
@@ -76,2 +76,2 @@ * use-sync-external-store-shim/with-selector.development.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var be;function yt(){return be||(be=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=w,t=_e();function r(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var n=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,a=e.useMemo,S=e.useDebugValue;function p(c,f,s,d,_){var u=i(null),v;u.current===null?(v={hasValue:!1,value:null},u.current=v):v=u.current;var b=a(function(){var E=!1,g,O,D=function(R){if(!E){E=!0,g=R;var ee=d(R);if(_!==void 0&&v.hasValue){var te=v.value;if(_(te,ee))return O=te,te}return O=ee,ee}var It=g,ne=O;if(n(It,R))return ne;var re=d(R);return _!==void 0&&_(ne,re)?ne:(g=R,O=re,re)},T=s===void 0?null:s,P=function(){return D(f())},J=T===null?void 0:function(){return D(T())};return[P,J]},[f,s,d,_]),C=b[0],y=b[1],h=o(c,C,y);return l(function(){v.hasValue=!0,v.value=h},[h]),S(h),h}Q.useSyncExternalStoreWithSelector=p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Q}process.env.NODE_ENV==="production"?Y.exports=mt():Y.exports=yt();var Et=Y.exports;const _t=St(Et),Oe={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:wt}=w,{useSyncExternalStoreWithSelector:bt}=_t;let Ce=!1;const Ot=e=>e;function Ct(e,t=Ot,r){(Oe?"production":void 0)!=="production"&&r&&!Ce&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Ce=!0);const n=bt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return wt(n),n}const Le=e=>{(Oe?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?ht(e):e,r=(n,o)=>Ct(t,n,o);return Object.assign(r,t),r},De=(e=>e?Le(e):Le)(e=>({instances:{},setData:(t,r)=>e(n=>{var i,l;const o=n.instances[t]||{isTyping:!1,inDelay:!1};return r||(r={filteredData:((i=o.data)==null?void 0:i.filteredData)??[],name:t,search:""}),!r.filteredData&&((l=o.data)!=null&&l.filteredData)&&(r.filteredData=o.data.filteredData),{instances:{...n.instances,[t]:{...o,data:r}}}}),setFilteredData:(t,r)=>e(n=>{var o;return{instances:{...n.instances,[t]:{...n.instances[t],data:{...((o=n.instances[t])==null?void 0:o.data)||{name:t,search:""},filteredData:r}}}}}),setTyping:(t,r)=>e(n=>({instances:{...n.instances,[t]:{...n.instances[t],isTyping:r}}})),setDelay:(t,r)=>e(n=>({instances:{...n.instances,[t]:{...n.instances[t],inDelay:r}}}))})),M=w.createContext({isOpen:!1,isTyping:!1,selected:{label:"",value:""},toggleOpen:()=>{},setSelected:()=>{},setTyping:()=>{},setData:()=>{}}),x=w.forwardRef(({children:e,onChange:t,onBlur:r,name:n,onOpenChange:o,...i},l)=>{const[a,S]=w.useState(!1),{instances:p,setData:c,setTyping:f,setFilteredData:s}=De(h=>h),{data:d,isTyping:_}=p[n??""]??{},[u,v]=w.useState({label:"",value:""}),b=w.useRef(null),C=w.useRef(null);w.useEffect(()=>{const h=g=>{const O=g.target;b!=null&&b.current&&!b.current.contains(O)&&(C!=null&&C.current)&&!C.current.contains(O)&&S(!1)},E=g=>{g.key==="Escape"?S(!1):(g.key==="Backspace"||g.key==="Delete")&&s(n??"",[])};return document.addEventListener("mousedown",h),document.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",h),document.addEventListener("keydown",E)}},[]),w.useEffect(()=>{a?c(n??"",{name:n??"",search:u.label.toLowerCase()}):c(n??""),o&&o(a)},[a]);const y=()=>{S(!a)};return L.jsx(M.Provider,{value:{data:d,isOpen:a,isTyping:_,selected:u,toggleOpen:y,areaRef:b,searchRef:C,setSelected:v,setTyping:f,setData:c,onChange:t,onBlur:r,name:n,ref:l},children:L.jsx("div",{...i,children:e})})}),Lt=({children:e,...t})=>{const{name:r="",selected:n,onChange:o,onBlur:i,ref:l}=w.useContext(M);return w.useEffect(()=>{const a=document.getElementById(r);a!==null&&(a.hidden=!0)},[r]),L.jsxs("div",{...t,children:[e,L.jsx("input",{id:r,type:"text",value:n.value,onChange:o,onBlur:i,name:r,ref:l})]})},Dt=({children:e,...t})=>{const{isOpen:r,areaRef:n}=w.useContext(M);return r&&L.jsx(pe,{children:L.jsx("div",{...t,ref:n,children:e})})},Tt=({children:e,onClick:t,value:r,label:n,...o})=>{const{setSelected:i,isOpen:l,toggleOpen:a,onChange:S,name:p,data:c,selected:f}=w.useContext(M),s=d=>{t&&t(d),i({value:r,label:n}),l&&a(),S&&S({target:{name:p,value:r}})};return w.useEffect(()=>{if((c==null?void 0:c.name)===p){if((c==null?void 0:c.search)!==""&&(c==null?void 0:c.search.toLowerCase())===n.toLowerCase()){i({value:r,label:n}),S&&S({target:{name:p,value:r}});return}i({value:"",label:f.label}),S&&S({target:{name:p,value:""}})}},[n,r,c,f.label,i,p,S]),L.jsx("div",{...o,onClick:s,children:e??n})},xt=({children:e,onClick:t,...r})=>{const{toggleOpen:n}=w.useContext(M),o=i=>{n(),t&&t(i)};return L.jsx("button",{...r,onClick:o,children:e})},At=w.memo(({onChange:e,onFocus:t,...r})=>{const{isOpen:n,toggleOpen:o,selected:i,searchRef:l,setData:a,setTyping:S,setSelected:p,name:c}=w.useContext(M),f=d=>{a(c??"",{name:c??"",search:d.target.value.toLowerCase()}),p({label:d.target.value,value:i.value}),S(c??"",!0),e&&e(d)},s=d=>{n||o(),t&&t(d)};return L.jsx("input",{ref:l,onChange:f,onFocus:s,type:"text",value:i.label,...r})});x.Trigger=Lt,x.Item=Tt,x.Panel=Dt,x.Button=xt,x.Search=At;const kt=()=>L.jsx("p",{className:"p-2",children:"Carregando..."}),Te=w.memo(w.forwardRef(({data:e,placeholder:t,className:r="border-[1px] p-4 w-full cursor-pointer focus:cursor-text placeholder:gray-400 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition duration-300 ease-in-out",itemClassName:n="p-2 cursor-pointer hover:bg-gray-200 transition duration-300 ease-in-out",disabled:o,...i},l)=>{const a=xe(e,i.name);return L.jsxs(x,{className:"relative flex flex-col",ref:l,...i,children:[L.jsx(x.Trigger,{className:"z-10",children:L.jsx(x.Search,{className:r,placeholder:t,disabled:o})}),L.jsx(x.Panel,{className:"flex z-20 flex-col absolute bg-white mt-1 rounded-lg shadow-lg p-2 w-full overflow-y-auto max-h-[360%] scrollbar-none",children:a.length?a.map((S,p)=>L.jsx(x.Item,{value:S.value,label:S.label,className:n},p)):L.jsx(kt,{})})]})}));Te.displayName="SearchSelect";const xe=(e,t="",r=500)=>{const{setFilteredData:n,setTyping:o,setDelay:i,instances:l}=De(c=>c),{data:a,isTyping:S,inDelay:p}=l[t]??{data:void 0,isTyping:!1,inDelay:!1};return w.useEffect(()=>{let c="";if(a&&a.name===t&&(c=a.search),S){p||(i(t,!0),setTimeout(()=>{o(t,!1),i(t,!1)},r));return}(async()=>{if(a!=null&&a.filteredData&&(a!=null&&a.filteredData.length)){const s=a.filteredData.filter(d=>d.label.toLowerCase().includes(c.toLowerCase()));if(s.length)return n(t,s)}if(n(t,[]),typeof e=="function"){const s=await e(c);Array.isArray(s)&&n(t,s.filter(d=>d.label.toLowerCase().includes(c.toLowerCase())))}else if(Array.isArray(e)){const s=e.filter(d=>d.label.toLowerCase().includes(c.toLowerCase()));n(t,s)}})()},[S]),(a==null?void 0:a.filteredData)??[]};A.SearchSelect=Te,A.Select=x,A.useDataSearch=xe,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}); | ||
*/var we;function yt(){return we||(we=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=w,t=_e();function n(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,c=e.useRef,s=e.useEffect,a=e.useMemo,g=e.useDebugValue;function v(i,l,f,d,y){var u=c(null),h;u.current===null?(h={hasValue:!1,value:null},u.current=h):h=u.current;var b=a(function(){var E=!1,m,O,C=function(j){if(!E){E=!0,m=j;var ee=d(j);if(y!==void 0&&h.hasValue){var te=h.value;if(y(te,ee))return O=te,te}return O=ee,ee}var It=m,re=O;if(r(It,j))return re;var ne=d(j);return y!==void 0&&y(re,ne)?re:(m=j,O=ne,ne)},L=f===void 0?null:f,x=function(){return C(l())},V=L===null?void 0:function(){return C(L())};return[x,V]},[l,f,d,y]),D=b[0],p=b[1],S=o(i,D,p);return s(function(){h.hasValue=!0,h.value=S},[S]),g(S),S}J.useSyncExternalStoreWithSelector=v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),J}process.env.NODE_ENV==="production"?X.exports=mt():X.exports=yt();var Et=X.exports;const _t=St(Et),Oe={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:bt}=w,{useSyncExternalStoreWithSelector:wt}=_t;let Ce=!1;const Ot=e=>e;function Ct(e,t=Ot,n){(Oe?"production":void 0)!=="production"&&n&&!Ce&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Ce=!0);const r=wt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return bt(r),r}const De=e=>{(Oe?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?ht(e):e,n=(r,o)=>Ct(t,r,o);return Object.assign(n,t),n},Le=(e=>e?De(e):De)(e=>({instances:{},setData:(t,n)=>e(r=>{var c,s,a;const o=r.instances[t]||{isTyping:!1,inDelay:!1};return n||(n={filteredData:((c=o.data)==null?void 0:c.filteredData)??[],name:t,search:""}),!((s=n.filteredData)!=null&&s.length)&&((a=o.data)!=null&&a.filteredData)&&(n.filteredData=o.data.filteredData),{instances:{...r.instances,[t]:{...o,data:n}}}}),setFilteredData:(t,n)=>e(r=>{var o;return{instances:{...r.instances,[t]:{...r.instances[t],data:{...((o=r.instances[t])==null?void 0:o.data)||{name:t,search:""},filteredData:n}}}}}),setTyping:(t,n)=>e(r=>({instances:{...r.instances,[t]:{...r.instances[t],isTyping:n}}})),setDelay:(t,n)=>e(r=>({instances:{...r.instances,[t]:{...r.instances[t],inDelay:n}}}))})),N=w.createContext({isOpen:!1,isTyping:!1,clearCache:"off",selected:{label:"",value:""},toggleOpen:()=>{},setSelected:()=>{},setTyping:()=>{},setData:()=>{}}),A=w.forwardRef(({children:e,onChange:t,onBlur:n,name:r,onOpenChange:o,value:c,clearCache:s="off",...a},g)=>{const[v,i]=w.useState(!1),[l,f]=w.useState(0),{instances:d,setData:y,setTyping:u,setFilteredData:h}=Le(C=>C),{data:b,isTyping:D}=d[r??""]??{},[p,S]=w.useState({label:"",value:""}),E=w.useRef(null),m=w.useRef(null);w.useEffect(()=>{const C=x=>{const V=x.target;E!=null&&E.current&&!E.current.contains(V)&&(m!=null&&m.current)&&!m.current.contains(V)&&i(!1)},L=x=>{x.key==="Escape"?i(!1):(x.key==="Backspace"||x.key==="Delete")&&h(r??"",[])};return document.addEventListener("mousedown",C),document.addEventListener("keydown",L),()=>{document.removeEventListener("mousedown",C),document.addEventListener("keydown",L)}},[]),w.useEffect(()=>{v?y(r??"",{name:r??"",search:p.label.toLowerCase()}):y(r??""),o&&o(v)},[v]),w.useEffect(()=>{c&&c!==""&&l===0&&(S({label:c,value:p.value}),y(r??"",{name:r??"",search:c}),u(r??"",!0),f(1))},[c]),w.useEffect(()=>{var C,L;if(b&&b.name===(r??"")&&((C=b.filteredData)!=null&&C.length)&&b.filteredData[0].label.toLowerCase()===p.label.toLowerCase()&&l===1){f(2);const x=b.filteredData.find(V=>V.label.toLowerCase()===p.label.toLowerCase())??b.filteredData[0];S(x),t&&t({target:{name:r,value:x.value}}),s==="first"&&(y(r??"",{name:r??"",search:"",filteredData:[]}),u(r??"",!1))}else l===2&&!D&&((L=b==null?void 0:b.filteredData)!=null&&L.length)&&(b==null?void 0:b.search)!==""&&s==="first"&&(f(3),y(r??"",{name:r??"",search:"",filteredData:[]}),u(r??"",!D))},[b==null?void 0:b.filteredData,D,l]);const O=()=>{i(!v)};return T.jsx(N.Provider,{value:{data:b,isOpen:v,isTyping:D,selected:p,toggleOpen:O,clearCache:s,areaRef:E,searchRef:m,setSelected:S,setTyping:u,setData:y,onChange:t,onBlur:n,name:r,ref:g},children:T.jsx("div",{...a,children:e})})}),Dt=({children:e,...t})=>{const{name:n="",selected:r,onChange:o,onBlur:c,ref:s}=w.useContext(N);return w.useEffect(()=>{const a=document.getElementById(n);a!==null&&(a.hidden=!0)},[n]),T.jsxs("div",{...t,children:[e,T.jsx("input",{id:n,type:"text",value:r.value,onChange:o,onBlur:c,name:n,ref:s})]})},Lt=({children:e,...t})=>{const{isOpen:n,areaRef:r}=w.useContext(N);return n&&T.jsx(ge,{children:T.jsx("div",{...t,ref:r,children:e})})},Tt=({children:e,onClick:t,value:n,label:r,...o})=>{const{setSelected:c,isOpen:s,toggleOpen:a,onChange:g,name:v,data:i,selected:l}=w.useContext(N),f=d=>{t&&t(d),c({value:n,label:r}),s&&a(),g&&g({target:{name:v,value:n}})};return w.useEffect(()=>{var d,y;(i==null?void 0:i.name)===v&&((i==null?void 0:i.search)!==""&&(i==null?void 0:i.search.toLowerCase())===r.toLowerCase()?(c({value:n,label:r}),g&&g({target:{name:v,value:n}})):(l.label===""||((d=i==null?void 0:i.filteredData)==null?void 0:d.length)===0||!((y=i==null?void 0:i.filteredData)!=null&&y.find(u=>u.label.toLowerCase()===l.label.toLowerCase())))&&(c({value:"",label:l.label}),g&&g({target:{name:v,value:""}})))},[r,n,i,l.label,c,v,g]),T.jsx("div",{...o,onClick:f,children:e??r})},xt=({children:e,onClick:t,...n})=>{const{toggleOpen:r}=w.useContext(N),o=c=>{r(),t&&t(c)};return T.jsx("button",{...n,onClick:o,children:e})},At=w.memo(({onChange:e,onFocus:t,...n})=>{const{isOpen:r,toggleOpen:o,selected:c,searchRef:s,setData:a,setTyping:g,setSelected:v,name:i}=w.useContext(N),l=d=>{a(i??"",{name:i??"",search:d.target.value.toLowerCase()}),v({label:d.target.value,value:c.value}),g(i??"",!0),e&&e(d)},f=d=>{r||o(),t&&t(d)};return T.jsx("input",{ref:s,onChange:l,onFocus:f,type:"text",value:c.label,...n})});A.Trigger=Dt,A.Item=Tt,A.Panel=Lt,A.Button=xt,A.Search=At;const kt=()=>T.jsx("p",{className:"p-2",children:"Carregando..."}),Te=w.memo(w.forwardRef(({data:e,placeholder:t,className:n="border-[1px] p-4 w-full cursor-pointer focus:cursor-text placeholder:gray-400 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition duration-300 ease-in-out",itemClassName:r="p-2 cursor-pointer hover:bg-gray-200 transition duration-300 ease-in-out",disabled:o,autoValue:c,value:s,...a},g)=>{const v=xe(e,a.name),i=c&&!s&&v.length?v[0].label:null;return T.jsxs(A,{value:i??s,clearCache:c&&!s?"first":"off",className:"relative flex flex-col",ref:g,...a,children:[T.jsx(A.Trigger,{className:"z-10",children:T.jsx(A.Search,{className:n,placeholder:t,disabled:o})}),T.jsx(A.Panel,{className:"flex z-20 flex-col absolute bg-white mt-1 rounded-lg shadow-lg p-2 w-full overflow-y-auto max-h-[360%] scrollbar-none",children:v.length?v.map((l,f)=>T.jsx(A.Item,{value:l.value,label:l.label,className:r},f)):T.jsx(kt,{})})]})}));Te.displayName="SearchSelect";const xe=(e,t="",n=500)=>{const{setFilteredData:r,setTyping:o,setDelay:c,instances:s}=Le(i=>i),{data:a,isTyping:g,inDelay:v}=s[t]??{data:void 0,isTyping:!1,inDelay:!1};return w.useEffect(()=>{let i="";if(a&&a.name===t&&(i=a.search),g){v||(c(t,!0),setTimeout(()=>{o(t,!1),c(t,!1)},n));return}(async()=>{if(a!=null&&a.filteredData&&(a!=null&&a.filteredData.length)){const f=a.filteredData.filter(d=>d.label.toLowerCase().includes(i.toLowerCase()));if(f.length&&i!=="")return r(t,f)}if(r(t,[]),typeof e=="function"){const f=await e(i);Array.isArray(f)&&r(t,f.filter(d=>d.label.toLowerCase().includes(i.toLowerCase())))}else if(Array.isArray(e)){const f=e.filter(d=>d.label.toLowerCase().includes(i.toLowerCase()));r(t,f)}})()},[g]),(a==null?void 0:a.filteredData)??[]};k.SearchSelect=Te,k.Select=A,k.useDataSearch=xe,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}); |
{ | ||
"name": "simple-search-dropdown", | ||
"private": false, | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"repository": { | ||
@@ -38,6 +38,2 @@ "type": "git", | ||
"dependencies": { | ||
"conventional-changelog-conventionalcommits": "7.0.2", | ||
"conventional-recommended-bump": "9.0.0", | ||
"install": "^0.13.0", | ||
"pnpm": "^9.7.1", | ||
"react": "^18.3.1", | ||
@@ -44,0 +40,0 @@ "react-dom": "^18.3.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80660
4
1270
1
- Removedconventional-recommended-bump@9.0.0
- Removedinstall@^0.13.0
- Removedpnpm@^9.7.1
- RemovedJSONStream@1.3.5(transitive)
- Removedarray-ify@1.0.0(transitive)
- Removedcompare-func@2.0.0(transitive)
- Removedconventional-changelog-conventionalcommits@7.0.2(transitive)
- Removedconventional-changelog-preset-loader@4.1.0(transitive)
- Removedconventional-commits-filter@4.0.0(transitive)
- Removedconventional-commits-parser@5.0.0(transitive)
- Removedconventional-recommended-bump@9.0.0(transitive)
- Removeddargs@8.1.0(transitive)
- Removeddot-prop@5.3.0(transitive)
- Removedgit-raw-commits@4.0.0(transitive)
- Removedgit-semver-tags@7.0.1(transitive)
- Removedinstall@0.13.0(transitive)
- Removedis-obj@2.0.0(transitive)
- Removedis-text-path@2.0.0(transitive)
- Removedjsonparse@1.3.1(transitive)
- Removedmeow@12.1.1(transitive)
- Removedpnpm@9.14.2(transitive)
- Removedsemver@7.6.3(transitive)
- Removedsplit2@4.2.0(transitive)
- Removedtext-extensions@2.4.0(transitive)
- Removedthrough@2.3.8(transitive)