@eox/itemfilter 0.8.4 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/eox-itemfilter.js +165 -138
- package/dist/eox-itemfilter.umd.cjs +5 -2
- package/package.json +1 -1
- package/test/general.cy.ts +36 -0
package/README.md
CHANGED
|
@@ -14,6 +14,16 @@ import "@eox/itemfilter"
|
|
|
14
14
|
|
|
15
15
|
// TODO: add documentation
|
|
16
16
|
|
|
17
|
+
## Attributes
|
|
18
|
+
|
|
19
|
+
### `expandMultipleFilters?: boolean = true`
|
|
20
|
+
|
|
21
|
+
Allow opening multiple filter accordeons in parallel.
|
|
22
|
+
|
|
23
|
+
### `expandMultipleResults?: boolean = true`
|
|
24
|
+
|
|
25
|
+
Allow opening multiple result accordeons in parallel.
|
|
26
|
+
|
|
17
27
|
## Contribute
|
|
18
28
|
|
|
19
29
|
```
|
package/dist/eox-itemfilter.js
CHANGED
|
@@ -255,8 +255,8 @@ pt[Ur] = !0, pt.elementProperties = /* @__PURE__ */ new Map(), pt.elementStyles
|
|
|
255
255
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
256
256
|
*/
|
|
257
257
|
var Lr;
|
|
258
|
-
const Kt = window, mt = Kt.trustedTypes, Wi = mt ? mt.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Jt = "$lit$", Ye = `lit$${(Math.random() + "").slice(9)}$`, si = "?" + Ye, fo = `<${si}>`, nt = document, Ot = () => nt.createComment(""), Pt = (r) => r === null || typeof r != "object" && typeof r != "function", wn = Array.isArray, _n = (r) => wn(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function",
|
|
259
|
-
\f\r]`, At = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, qi = /-->/g, Gi = />/g, et = RegExp(`>|${
|
|
258
|
+
const Kt = window, mt = Kt.trustedTypes, Wi = mt ? mt.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Jt = "$lit$", Ye = `lit$${(Math.random() + "").slice(9)}$`, si = "?" + Ye, fo = `<${si}>`, nt = document, Ot = () => nt.createComment(""), Pt = (r) => r === null || typeof r != "object" && typeof r != "function", wn = Array.isArray, _n = (r) => wn(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", Rr = `[
|
|
259
|
+
\f\r]`, At = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, qi = /-->/g, Gi = />/g, et = RegExp(`>|${Rr}(?:([^\\s"'>=/]+)(${Rr}*=${Rr}*(?:[^
|
|
260
260
|
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ki = /'/g, Ji = /"/g, En = /^(?:script|style|textarea|title)$/i, po = (r) => (e, ...t) => ({ _$litType$: r, strings: e, values: t }), he = po(1), Pe = Symbol.for("lit-noChange"), se = Symbol.for("lit-nothing"), Zi = /* @__PURE__ */ new WeakMap(), it = nt.createTreeWalker(nt, 129, null, !1), Mn = (r, e) => {
|
|
261
261
|
const t = r.length - 1, i = [];
|
|
262
262
|
let n, s = e === 2 ? "<svg>" : "", o = At;
|
|
@@ -516,7 +516,7 @@ const mo = (r, e, t) => {
|
|
|
516
516
|
* Copyright 2017 Google LLC
|
|
517
517
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
518
518
|
*/
|
|
519
|
-
var
|
|
519
|
+
var Tr, Dr;
|
|
520
520
|
let Ce = class extends pt {
|
|
521
521
|
constructor() {
|
|
522
522
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
@@ -542,7 +542,7 @@ let Ce = class extends pt {
|
|
|
542
542
|
return Pe;
|
|
543
543
|
}
|
|
544
544
|
};
|
|
545
|
-
Ce.finalized = !0, Ce._$litElement$ = !0, (
|
|
545
|
+
Ce.finalized = !0, Ce._$litElement$ = !0, (Tr = globalThis.litElementHydrateSupport) === null || Tr === void 0 || Tr.call(globalThis, { LitElement: Ce });
|
|
546
546
|
const en = globalThis.litElementPolyfillSupport;
|
|
547
547
|
en == null || en({ LitElement: Ce });
|
|
548
548
|
((Dr = globalThis.litElementVersions) !== null && Dr !== void 0 ? Dr : globalThis.litElementVersions = []).push("3.3.2");
|
|
@@ -789,9 +789,9 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
789
789
|
return r(e, ...t);
|
|
790
790
|
}, Nr = Ao(he);
|
|
791
791
|
(() => {
|
|
792
|
-
var r = Object.defineProperty, e = Math.pow, t = (l, d, b) => d in l ? r(l, d, { enumerable: !0, configurable: !0, writable: !0, value: b }) : l[d] = b, i = (l, d, b) => (t(l, typeof d != "symbol" ? d + "" : d, b), b), n = (l, d) => ` ${d && d.length > 0 ? d.map((b) => `<link rel="stylesheet" href="${b}" />`).join("") : ""} <style> ${l} </style> <div class="range-slider-box"> <div class="row"> <div id="range-slider" class="range-slider"> <div class="container"> <div class="panel"></div> <div class="panel-fill"></div> <div class="container"> <div class="pointer" tabindex="0" role="slider"> <div class="pointer-shape"></div> </div> </div> </div> </div> </div> </div>`, s = ":host{--width:300px;--height:.25rem;--opacity:.4;--panel-bg:#cbd5e1;--panel-bg-hover:#94a3b8;--panel-bg-fill:#475569;--panel-bg-border-radius:1rem;--pointer-width:1rem;--pointer-height:1rem;--pointer-bg:#fff;--pointer-bg-hover:#dcdcdc;--pointer-bg-focus:#dcdcdc;--pointer-shadow:0 0 2px rgba(0,0,0,0.8);--pointer-shadow-hover:0 0 2px #000;--pointer-shadow-focus:var(--pointer-shadow-hover);--pointer-border:1px solid hsla(0,0%,88%,0.5);--pointer-border-hover:1px solid #94a3b8;--pointer-border-focus:var(--pointer-border-hover);--pointer-border-radius:100%;--animate-onclick:.3s}:host{max-width:100%}.range-slider-box{display:flex;position:relative;flex-direction:column}.range-slider{position:relative;width:var(--width,100%);height:var(--height,0.25rem);touch-action:none;max-width:100%;box-sizing:border-box;cursor:pointer}.row{width:100%;display:flex;align-items:center}.range-slider.disabled{opacity:var(--opacity,0.4);cursor:default}.pointer.disabled{-webkit-filter:brightness(0.8);filter:brightness(0.8);cursor:default}.range-slider *{box-sizing:border-box}.container{position:absolute;width:100%;height:100%}.panel{position:absolute;z-index:10;width:100%;height:100%;background:var(--panel-bg,#2d4373);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;transition:.3s all ease}.panel-fill{background:var(--panel-bg-fill,#000);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;height:100%;position:absolute;z-index:10}.panel:hover{background:var(--panel-bg-hover,#5f79b7)}.disabled .panel:hover{background:var(--panel-bg,#5f79b7)}.pointer{position:absolute;z-index:20;outline:0;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;box-shadow:var(--pointer-shadow);border:var(--pointer-border);border-radius:var(--pointer-border-radius,100%);-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--pointer-width,15px);height:var(--pointer-height,15px);transition:.3s all ease}.pointer-shape:hover{background:var(--pointer-bg-hover,#fff);background-size:contain;border:var(--pointer-border-hover);box-shadow:var(--pointer-shadow-hover)}.disabled .pointer-shape:hover{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.pointer:focus .pointer-shape{background:var(--pointer-bg-focus,#fff);background-size:contain;border:var(--pointer-border-focus);box-shadow:var(--pointer-shadow-focus)}.disabled .pointer:focus .pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.type-vertical .range-slider{--width:.25rem;--height:300px;max-height:100%}.type-vertical .range-slider .pointer{left:50%}.type-vertical .range-slider .panel-fill{width:100%}.type-vertical.range-slider-box{flex-direction:row}.type-vertical .row{flex-direction:column}.animate-on-click .pointer,.animate-on-click .panel-fill{transition:all var(--animate-onclick)}.range-dragging .panel-fill{cursor:move}", o = "pointers-overlap", c = "pointers-min-distance", a = "pointers-max-distance", u = "range-dragging", p = "data", v = "min", y = "max", x = "step", M = "round", j = "type", q = "theme", J = "rtl", f = "btt", g = "disabled", $ = "keyboard-disabled", O = "mousewheel-disabled", E = "slider-width", A = "slider-height", C = "slider-radius", L = "slider-bg", I = "slider-bg-hover", W = "slider-bg-fill", re = "pointer-width", k = "pointer-height", _ = "pointer-radius", S = "pointer-bg", B = "pointer-bg-hover", P = "pointer-bg-focus", H = "pointer-shadow", X = "pointer-shadow-hover", ee = "pointer-shadow-focus", le = "pointer-border", Z = "pointer-border-hover", ve = "pointer-border-focus",
|
|
792
|
+
var r = Object.defineProperty, e = Math.pow, t = (l, d, b) => d in l ? r(l, d, { enumerable: !0, configurable: !0, writable: !0, value: b }) : l[d] = b, i = (l, d, b) => (t(l, typeof d != "symbol" ? d + "" : d, b), b), n = (l, d) => ` ${d && d.length > 0 ? d.map((b) => `<link rel="stylesheet" href="${b}" />`).join("") : ""} <style> ${l} </style> <div class="range-slider-box"> <div class="row"> <div id="range-slider" class="range-slider"> <div class="container"> <div class="panel"></div> <div class="panel-fill"></div> <div class="container"> <div class="pointer" tabindex="0" role="slider"> <div class="pointer-shape"></div> </div> </div> </div> </div> </div> </div>`, s = ":host{--width:300px;--height:.25rem;--opacity:.4;--panel-bg:#cbd5e1;--panel-bg-hover:#94a3b8;--panel-bg-fill:#475569;--panel-bg-border-radius:1rem;--pointer-width:1rem;--pointer-height:1rem;--pointer-bg:#fff;--pointer-bg-hover:#dcdcdc;--pointer-bg-focus:#dcdcdc;--pointer-shadow:0 0 2px rgba(0,0,0,0.8);--pointer-shadow-hover:0 0 2px #000;--pointer-shadow-focus:var(--pointer-shadow-hover);--pointer-border:1px solid hsla(0,0%,88%,0.5);--pointer-border-hover:1px solid #94a3b8;--pointer-border-focus:var(--pointer-border-hover);--pointer-border-radius:100%;--animate-onclick:.3s}:host{max-width:100%}.range-slider-box{display:flex;position:relative;flex-direction:column}.range-slider{position:relative;width:var(--width,100%);height:var(--height,0.25rem);touch-action:none;max-width:100%;box-sizing:border-box;cursor:pointer}.row{width:100%;display:flex;align-items:center}.range-slider.disabled{opacity:var(--opacity,0.4);cursor:default}.pointer.disabled{-webkit-filter:brightness(0.8);filter:brightness(0.8);cursor:default}.range-slider *{box-sizing:border-box}.container{position:absolute;width:100%;height:100%}.panel{position:absolute;z-index:10;width:100%;height:100%;background:var(--panel-bg,#2d4373);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;transition:.3s all ease}.panel-fill{background:var(--panel-bg-fill,#000);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;height:100%;position:absolute;z-index:10}.panel:hover{background:var(--panel-bg-hover,#5f79b7)}.disabled .panel:hover{background:var(--panel-bg,#5f79b7)}.pointer{position:absolute;z-index:20;outline:0;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;box-shadow:var(--pointer-shadow);border:var(--pointer-border);border-radius:var(--pointer-border-radius,100%);-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--pointer-width,15px);height:var(--pointer-height,15px);transition:.3s all ease}.pointer-shape:hover{background:var(--pointer-bg-hover,#fff);background-size:contain;border:var(--pointer-border-hover);box-shadow:var(--pointer-shadow-hover)}.disabled .pointer-shape:hover{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.pointer:focus .pointer-shape{background:var(--pointer-bg-focus,#fff);background-size:contain;border:var(--pointer-border-focus);box-shadow:var(--pointer-shadow-focus)}.disabled .pointer:focus .pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.type-vertical .range-slider{--width:.25rem;--height:300px;max-height:100%}.type-vertical .range-slider .pointer{left:50%}.type-vertical .range-slider .panel-fill{width:100%}.type-vertical.range-slider-box{flex-direction:row}.type-vertical .row{flex-direction:column}.animate-on-click .pointer,.animate-on-click .panel-fill{transition:all var(--animate-onclick)}.range-dragging .panel-fill{cursor:move}", o = "pointers-overlap", c = "pointers-min-distance", a = "pointers-max-distance", u = "range-dragging", p = "data", v = "min", y = "max", x = "step", M = "round", j = "type", q = "theme", J = "rtl", f = "btt", g = "disabled", $ = "keyboard-disabled", O = "mousewheel-disabled", E = "slider-width", A = "slider-height", C = "slider-radius", L = "slider-bg", I = "slider-bg-hover", W = "slider-bg-fill", re = "pointer-width", k = "pointer-height", _ = "pointer-radius", S = "pointer-bg", B = "pointer-bg-hover", P = "pointer-bg-focus", H = "pointer-shadow", X = "pointer-shadow-hover", ee = "pointer-shadow-focus", le = "pointer-border", Z = "pointer-border-hover", ve = "pointer-border-focus", Re = "animate-onclick", Te = "css-links", ye = "vertical", Se = "horizontal", je = (l, d, b, m, R) => {
|
|
793
793
|
let U = d - l;
|
|
794
|
-
return U === 0 ? b : (m - b) * (
|
|
794
|
+
return U === 0 ? b : (m - b) * (R - l) / U + b;
|
|
795
795
|
}, ue = (l) => !isNaN(parseFloat(l)) && isFinite(l), oe = (l, d) => ue(l) ? Number(l) : d, at = (l, d) => d === 0 ? 0 : Math.round(l / d) * d, lt = (l, d = 1 / 0) => {
|
|
796
796
|
if (d === 1 / 0)
|
|
797
797
|
return l;
|
|
@@ -808,19 +808,19 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
808
808
|
}, vs = (l, d) => {
|
|
809
809
|
if (!d || d.length <= 0)
|
|
810
810
|
return;
|
|
811
|
-
let b = d.map((
|
|
811
|
+
let b = d.map((R) => ue(R) ? oe(R, R) : R), m = { values: b || [] };
|
|
812
812
|
m.value = b[0], m.value0 = b[0], m.value1 = b[0];
|
|
813
|
-
for (let
|
|
814
|
-
m[`value${
|
|
813
|
+
for (let R = 1; R < b.length; R++)
|
|
814
|
+
m[`value${R + 1}`] = b[R];
|
|
815
815
|
l.dispatchEvent(new CustomEvent("change", { detail: m }));
|
|
816
816
|
}, sr = (l, d, b) => {
|
|
817
|
-
let m = 0,
|
|
817
|
+
let m = 0, R, U, G, T, D = !1, K = (z, ce, me, ge, de, fe) => {
|
|
818
818
|
let we = m;
|
|
819
819
|
me !== void 0 && z > me && (z = me), ce !== void 0 && z < ce && (z = ce), m = z;
|
|
820
820
|
let _e = m;
|
|
821
821
|
return (ge === ye && fe || ge === Se && de) && (_e = 100 - _e), ge === ye ? d.style.top = `${_e}%` : d.style.left = `${_e}%`, we !== m;
|
|
822
822
|
}, te = (z) => z === d || d.contains(z), F = (z, ce, me, ge) => {
|
|
823
|
-
|
|
823
|
+
R = z, U = ce, G = me, T = ge;
|
|
824
824
|
}, ne = (z) => {
|
|
825
825
|
D = z, d.classList.toggle("disabled", D), D ? d.setAttribute("aria-disabled", "true") : d.hasAttribute("aria-disabled") && d.removeAttribute("aria-disabled");
|
|
826
826
|
}, Oe = (z, ce) => {
|
|
@@ -829,7 +829,7 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
829
829
|
if (!D) {
|
|
830
830
|
switch (z.key) {
|
|
831
831
|
case "ArrowLeft": {
|
|
832
|
-
z.preventDefault(), typeof
|
|
832
|
+
z.preventDefault(), typeof R == "function" && R(b);
|
|
833
833
|
break;
|
|
834
834
|
}
|
|
835
835
|
case "ArrowRight": {
|
|
@@ -841,7 +841,7 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
841
841
|
break;
|
|
842
842
|
}
|
|
843
843
|
case "ArrowDown": {
|
|
844
|
-
z.preventDefault(), typeof
|
|
844
|
+
z.preventDefault(), typeof T == "function" && T(b);
|
|
845
845
|
break;
|
|
846
846
|
}
|
|
847
847
|
}
|
|
@@ -867,42 +867,42 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
867
867
|
if (l.trim() === "")
|
|
868
868
|
return;
|
|
869
869
|
let d = l.split(","), b = [], m = !0;
|
|
870
|
-
for (let
|
|
871
|
-
let U = d[
|
|
870
|
+
for (let R = 0; R < d.length; R++) {
|
|
871
|
+
let U = d[R].trim();
|
|
872
872
|
U !== "" && (b.push(U), ue(U) || (m = !1));
|
|
873
873
|
}
|
|
874
|
-
return m ? b.map((
|
|
875
|
-
}, ys = (l, d) => d ? d.findIndex((b) => b === l || b.toString().trim() === l.toString().trim()) : -1, bs = (l) => ({ updatePosition: (d, b, m,
|
|
874
|
+
return m ? b.map((R) => Number(R)) : b;
|
|
875
|
+
}, ys = (l, d) => d ? d.findIndex((b) => b === l || b.toString().trim() === l.toString().trim()) : -1, bs = (l) => ({ updatePosition: (d, b, m, R) => {
|
|
876
876
|
if (b.length <= 0)
|
|
877
877
|
return;
|
|
878
|
-
let U = b.length === 1, G = b[0],
|
|
879
|
-
d === ye ? (l.style.removeProperty("width"), l.style.removeProperty("right"), l.style.removeProperty("left"), U ? l.style.height = `${G}%` : l.style.height = `${Math.abs(G -
|
|
880
|
-
} }), xi = "--animate-onclick", xs = "--width", $s = "--height", ws = "--panel-bg-border-radius", _s = "--panel-bg", Es = "--panel-bg-hover", Ms = "--panel-bg-fill", As = "--pointer-width", Ss = "--pointer-height", Os = "--pointer-border-radius", Ps = "--pointer-bg", Cs = "--pointer-bg-hover", ks = "--pointer-bg-focus", Ls = "--pointer-shadow",
|
|
878
|
+
let U = b.length === 1, G = b[0], T = b[b.length - 1];
|
|
879
|
+
d === ye ? (l.style.removeProperty("width"), l.style.removeProperty("right"), l.style.removeProperty("left"), U ? l.style.height = `${G}%` : l.style.height = `${Math.abs(G - T)}%`, R ? (l.style.bottom = "0%", U ? l.style.top = "auto" : l.style.top = `${Math.min(100 - T, 100 - G)}%`) : (l.style.bottom = "auto", U ? l.style.top = "0%" : l.style.top = `${Math.min(G, T)}%`)) : (l.style.removeProperty("height"), l.style.removeProperty("top"), l.style.removeProperty("bottom"), U ? l.style.width = `${G}%` : l.style.width = `${Math.abs(G - T)}%`, m ? (l.style.right = "0%", U ? l.style.left = "auto" : l.style.left = `${Math.min(100 - T, 100 - G)}%`) : (l.style.right = "auto", U ? l.style.left = "0%" : l.style.left = `${Math.min(G, T)}%`));
|
|
880
|
+
} }), xi = "--animate-onclick", xs = "--width", $s = "--height", ws = "--panel-bg-border-radius", _s = "--panel-bg", Es = "--panel-bg-hover", Ms = "--panel-bg-fill", As = "--pointer-width", Ss = "--pointer-height", Os = "--pointer-border-radius", Ps = "--pointer-bg", Cs = "--pointer-bg-hover", ks = "--pointer-bg-focus", Ls = "--pointer-shadow", Rs = "--pointer-shadow-hover", Ts = "--pointer-shadow-focus", Ds = "--pointer-border", Is = "--pointer-border-hover", js = "--pointer-border-focus", Tt = (l, d, b) => {
|
|
881
881
|
let m = /* @__PURE__ */ new Map();
|
|
882
|
-
for (let
|
|
883
|
-
let U =
|
|
882
|
+
for (let R of l.attributes) {
|
|
883
|
+
let U = R.nodeName.trim().toLowerCase();
|
|
884
884
|
if (!d.test(U))
|
|
885
885
|
continue;
|
|
886
|
-
let G = U.replace(/\D/g, "").trim(),
|
|
887
|
-
m.set(
|
|
886
|
+
let G = U.replace(/\D/g, "").trim(), T = G === "" || G === "0" || G === "1" ? 0 : oe(G, 0) - 1, D = b && typeof b == "function" ? b(R.value) : R.value;
|
|
887
|
+
m.set(T, D);
|
|
888
888
|
}
|
|
889
889
|
return m;
|
|
890
890
|
}, Ns = (l) => {
|
|
891
891
|
if (!l)
|
|
892
892
|
return null;
|
|
893
|
-
let d = l.getAttribute(
|
|
893
|
+
let d = l.getAttribute(Te);
|
|
894
894
|
if (!d)
|
|
895
895
|
return null;
|
|
896
896
|
let b = d.split(";"), m = [];
|
|
897
|
-
for (let
|
|
898
|
-
|
|
897
|
+
for (let R of b)
|
|
898
|
+
R.trim() !== "" && m.push(R.trim());
|
|
899
899
|
return m;
|
|
900
|
-
}, $i = [[xs, E, "sliderWidth", null], [$s, A, "sliderHeight", null], [ws, C, "sliderRadius", null], [_s, L, "sliderBg", null], [Es, I, "sliderBgHover", null], [Ms, W, "sliderBgFill", null], [As, re, "pointer#Width", /^pointer([0-9]*)-width$/], [Ss, k, "pointer#Height", /^pointer([0-9]*)-height$/], [Os, _, "pointer#Radius", /^pointer([0-9]*)-radius$/], [Ps, S, "pointer#Bg", /^pointer([0-9]*)-bg$/], [Cs, B, "pointer#BgHover", /^pointer([0-9]*)-bg-hover$/], [ks, P, "pointer#BgFocus", /^pointer([0-9]*)-bg-focus$/], [Ls, H, "pointer#Shadow", /^pointer([0-9]*)-shadow$/], [
|
|
901
|
-
let m = null,
|
|
900
|
+
}, $i = [[xs, E, "sliderWidth", null], [$s, A, "sliderHeight", null], [ws, C, "sliderRadius", null], [_s, L, "sliderBg", null], [Es, I, "sliderBgHover", null], [Ms, W, "sliderBgFill", null], [As, re, "pointer#Width", /^pointer([0-9]*)-width$/], [Ss, k, "pointer#Height", /^pointer([0-9]*)-height$/], [Os, _, "pointer#Radius", /^pointer([0-9]*)-radius$/], [Ps, S, "pointer#Bg", /^pointer([0-9]*)-bg$/], [Cs, B, "pointer#BgHover", /^pointer([0-9]*)-bg-hover$/], [ks, P, "pointer#BgFocus", /^pointer([0-9]*)-bg-focus$/], [Ls, H, "pointer#Shadow", /^pointer([0-9]*)-shadow$/], [Rs, X, "pointer#ShadowHover", /^pointer([0-9]*)-shadow-hover$/], [Ts, ee, "pointer#ShadowFocus", /^pointer([0-9]*)-shadow-focus$/], [Ds, le, "pointer#Border", /^pointer([0-9]*)-border$/], [Is, Z, "pointer#BorderHover", /^pointer([0-9]*)-border-hover$/], [js, ve, "pointer#BorderFocus", /^pointer([0-9]*)-border-focus$/]], Bs = (l, d, b) => {
|
|
901
|
+
let m = null, R = [], U = /* @__PURE__ */ new Map(), G = (Y, Q = d) => {
|
|
902
902
|
let z = [...Q.classList];
|
|
903
903
|
for (let ce of z)
|
|
904
904
|
ce.startsWith(Y) && d.classList.remove(ce);
|
|
905
|
-
},
|
|
905
|
+
}, T = () => {
|
|
906
906
|
G("shape");
|
|
907
907
|
let Y = d.querySelectorAll(".pointer");
|
|
908
908
|
for (let Q of Y)
|
|
@@ -910,10 +910,10 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
910
910
|
}, D = (Y) => {
|
|
911
911
|
m = Y, G("theme-"), typeof Y == "string" && d.classList.add(`theme-${Y}`);
|
|
912
912
|
}, K = () => {
|
|
913
|
-
if (
|
|
914
|
-
d.classList.add("shape", `shape-${
|
|
915
|
-
for (let Y = 1; Y <
|
|
916
|
-
let Q =
|
|
913
|
+
if (T(), !(R.length <= 0)) {
|
|
914
|
+
d.classList.add("shape", `shape-${R[0]}`);
|
|
915
|
+
for (let Y = 1; Y < R.length; Y++) {
|
|
916
|
+
let Q = R[Y];
|
|
917
917
|
if (!Q)
|
|
918
918
|
continue;
|
|
919
919
|
let z = d.querySelector(`.pointer-${Y}`);
|
|
@@ -921,14 +921,14 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
921
921
|
}
|
|
922
922
|
}
|
|
923
923
|
}, te = (Y, Q) => {
|
|
924
|
-
|
|
924
|
+
R[Y] = Q, K();
|
|
925
925
|
}, F = () => {
|
|
926
|
-
|
|
927
|
-
let Y =
|
|
926
|
+
T();
|
|
927
|
+
let Y = Tt(l, /^pointer([0-9]*)-shape$/);
|
|
928
928
|
if (!(Y.size <= 0)) {
|
|
929
929
|
for (let Q of Y) {
|
|
930
930
|
let z = Q[0];
|
|
931
|
-
|
|
931
|
+
R[z] = Q[1];
|
|
932
932
|
}
|
|
933
933
|
K();
|
|
934
934
|
}
|
|
@@ -947,7 +947,7 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
947
947
|
for (let Y of $i) {
|
|
948
948
|
let [Q, z, ce, me] = Y;
|
|
949
949
|
if (me) {
|
|
950
|
-
let de =
|
|
950
|
+
let de = Tt(l, me);
|
|
951
951
|
for (let fe of de) {
|
|
952
952
|
let we = fe[0], _e = fe[1];
|
|
953
953
|
Oe(Q, _e, we);
|
|
@@ -982,17 +982,17 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
982
982
|
}, set theme(Y) {
|
|
983
983
|
D(Y);
|
|
984
984
|
}, get pointerShapes() {
|
|
985
|
-
return
|
|
985
|
+
return R;
|
|
986
986
|
}, setPointerShape: te };
|
|
987
987
|
}, ct = "animate-on-click", wi = "range-dragging", Fs = (l, d, b, m) => {
|
|
988
|
-
let
|
|
989
|
-
for (let F of
|
|
988
|
+
let R = [], U = (te) => {
|
|
989
|
+
for (let F of R)
|
|
990
990
|
F.update && typeof F.update == "function" && F.update(te);
|
|
991
991
|
}, G = () => {
|
|
992
|
-
for (let te of
|
|
992
|
+
for (let te of R)
|
|
993
993
|
te.destroy && typeof te.destroy == "function" && te.destroy();
|
|
994
|
-
},
|
|
995
|
-
for (let ne of
|
|
994
|
+
}, T = (te, F) => {
|
|
995
|
+
for (let ne of R)
|
|
996
996
|
ne.onAttrChange && typeof ne.onAttrChange == "function" && ne.onAttrChange(te, F);
|
|
997
997
|
}, D = (te) => {
|
|
998
998
|
if (te.gettersAndSetters) {
|
|
@@ -1015,59 +1015,59 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
1015
1015
|
if (window.tcRangeSliderPlugins)
|
|
1016
1016
|
for (let te of window.tcRangeSliderPlugins) {
|
|
1017
1017
|
let F = te();
|
|
1018
|
-
|
|
1018
|
+
R.push(F), F.init && typeof F.init == "function" && (F.init(l, d, b, m), D(F), K(F));
|
|
1019
1019
|
}
|
|
1020
|
-
}, update: U, onAttrChange:
|
|
1020
|
+
}, update: U, onAttrChange: T, destroy: G };
|
|
1021
1021
|
}, Hs = 10, Us = (l, d) => {
|
|
1022
1022
|
let b = /* @__PURE__ */ new Map(), m = /^value([0-9]*)$/;
|
|
1023
|
-
for (let
|
|
1024
|
-
let D =
|
|
1023
|
+
for (let T of l.attributes) {
|
|
1024
|
+
let D = T.nodeName.trim().toLowerCase();
|
|
1025
1025
|
if (!m.test(D))
|
|
1026
1026
|
continue;
|
|
1027
|
-
let K = D.replace("value", "").trim(), te = K === "" || K === "0" || K === "1" ? 0 : oe(K, 0) - 1, F = ue(
|
|
1027
|
+
let K = D.replace("value", "").trim(), te = K === "" || K === "0" || K === "1" ? 0 : oe(K, 0) - 1, F = ue(T.value) ? oe(T.value, 0) : T.value;
|
|
1028
1028
|
b.set(te, F);
|
|
1029
1029
|
}
|
|
1030
|
-
let
|
|
1030
|
+
let R = Math.max(...Array.from(b.keys())), U = [];
|
|
1031
1031
|
U.push([sr(l, d, 0), b.get(0)]);
|
|
1032
1032
|
let G = d;
|
|
1033
|
-
for (let
|
|
1033
|
+
for (let T = 1; T <= R; T++) {
|
|
1034
1034
|
let D = d.cloneNode(!0);
|
|
1035
|
-
G.after(D), G = D, U.push([sr(l, D,
|
|
1035
|
+
G.after(D), G = D, U.push([sr(l, D, T), b.get(T)]);
|
|
1036
1036
|
}
|
|
1037
1037
|
return U;
|
|
1038
|
-
}, _i = (l, d, b, m,
|
|
1038
|
+
}, _i = (l, d, b, m, R, U, G) => {
|
|
1039
1039
|
try {
|
|
1040
1040
|
Object.defineProperty(l, m, { configurable: !0, get() {
|
|
1041
1041
|
if (!d)
|
|
1042
1042
|
return;
|
|
1043
|
-
let
|
|
1044
|
-
if (!
|
|
1043
|
+
let T = d.pointers[b];
|
|
1044
|
+
if (!T)
|
|
1045
1045
|
return;
|
|
1046
|
-
let D = d.getTextValue(
|
|
1046
|
+
let D = d.getTextValue(T.percent);
|
|
1047
1047
|
return ue(D) ? oe(D, D) : D;
|
|
1048
|
-
}, set: (
|
|
1049
|
-
d.pointers[b] ? d == null || d.setValue(
|
|
1050
|
-
} }), Object.defineProperty(l,
|
|
1051
|
-
var
|
|
1052
|
-
return (D = (
|
|
1053
|
-
}, set: (
|
|
1054
|
-
!d || d.setAriaLabel(b,
|
|
1048
|
+
}, set: (T) => {
|
|
1049
|
+
d.pointers[b] ? d == null || d.setValue(T, b) : d == null || d.addPointer(T);
|
|
1050
|
+
} }), Object.defineProperty(l, R, { configurable: !0, get() {
|
|
1051
|
+
var T, D;
|
|
1052
|
+
return (D = (T = d == null ? void 0 : d.pointers[b]) == null ? void 0 : T.getAttr("aria-label")) != null ? D : void 0;
|
|
1053
|
+
}, set: (T) => {
|
|
1054
|
+
!d || d.setAriaLabel(b, T);
|
|
1055
1055
|
} }), Object.defineProperty(l, U, { configurable: !0, get() {
|
|
1056
|
-
var
|
|
1057
|
-
return (D = (
|
|
1058
|
-
}, set: (
|
|
1059
|
-
!d || !d.styles || d.styles.setPointerShape(b,
|
|
1056
|
+
var T, D;
|
|
1057
|
+
return (D = (T = d == null ? void 0 : d.styles) == null ? void 0 : T.pointerShapes[b]) != null ? D : null;
|
|
1058
|
+
}, set: (T) => {
|
|
1059
|
+
!d || !d.styles || d.styles.setPointerShape(b, T);
|
|
1060
1060
|
} }), Object.defineProperty(l, G, { configurable: !0, get() {
|
|
1061
|
-
var
|
|
1062
|
-
return (
|
|
1063
|
-
}, set: (
|
|
1061
|
+
var T;
|
|
1062
|
+
return (T = d == null ? void 0 : d.pointers[b].disabled) != null ? T : !1;
|
|
1063
|
+
}, set: (T) => {
|
|
1064
1064
|
if (!d)
|
|
1065
1065
|
return;
|
|
1066
1066
|
let D = d == null ? void 0 : d.pointers[b];
|
|
1067
|
-
!D || (D.disabled =
|
|
1067
|
+
!D || (D.disabled = T);
|
|
1068
1068
|
} });
|
|
1069
|
-
} catch (
|
|
1070
|
-
console.error(
|
|
1069
|
+
} catch (T) {
|
|
1070
|
+
console.error(T);
|
|
1071
1071
|
}
|
|
1072
1072
|
}, Ys = (l, d) => {
|
|
1073
1073
|
let b = [["value", "ariaLabel", "pointerShape", "pointerDisabled", 0], ["value0", "ariaLabel0", "pointerShape0", "pointer0Disabled", 0], ["value1", "ariaLabel1", "pointerShape1", "pointer1Disabled", 0]];
|
|
@@ -1077,12 +1077,12 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
1077
1077
|
_i(l, d, m[4], m[0], m[1], m[2], m[3]);
|
|
1078
1078
|
}, Ei = (l, d, b) => {
|
|
1079
1079
|
var m;
|
|
1080
|
-
let
|
|
1081
|
-
if (
|
|
1080
|
+
let R = (m = b.shadowRoot) == null ? void 0 : m.querySelector(".container");
|
|
1081
|
+
if (R)
|
|
1082
1082
|
for (let U of l)
|
|
1083
|
-
d ?
|
|
1083
|
+
d ? R.prepend(U.$pointer) : R.append(U.$pointer);
|
|
1084
1084
|
}, or = 0, _t = 100, ut = 2, Mi = "0.3s", zs = (l, d, b) => {
|
|
1085
|
-
let m = b.map((h) => h[0]),
|
|
1085
|
+
let m = b.map((h) => h[0]), R = null, U = null, G = null, T = null, D = or, K = _t, te, F, ne = Se, Oe = ut, xe = !1, Y = !1, Q = !1, z = 0, ce = 1 / 0, me = !1, ge, de, fe = !1, we = !1, _e = !1, We = Mi, Ai = [], Si = (h) => {
|
|
1086
1086
|
fe || (h.preventDefault && h.preventDefault(), Ze(h), window.addEventListener("mousemove", Ze), window.addEventListener("mouseup", Dt), fs(l, h));
|
|
1087
1087
|
}, Dt = (h) => {
|
|
1088
1088
|
fe || (ge = void 0, de = void 0, window.removeEventListener("mousemove", Ze), window.removeEventListener("mouseup", Dt), We && d.classList.add(ct), ps(l, h));
|
|
@@ -1101,7 +1101,7 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
1101
1101
|
if (!(!ie.isClicked(h) || ie.disabled))
|
|
1102
1102
|
return We && d.classList.remove(ct), ie;
|
|
1103
1103
|
for (let ie of m)
|
|
1104
|
-
if (
|
|
1104
|
+
if (R === ie)
|
|
1105
1105
|
return ie;
|
|
1106
1106
|
}
|
|
1107
1107
|
let ae = 1 / 0, pe = null;
|
|
@@ -1112,7 +1112,7 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
1112
1112
|
De < ae && (ae = De, pe = ie);
|
|
1113
1113
|
}
|
|
1114
1114
|
return pe;
|
|
1115
|
-
}, Oi = () => m.findIndex((h) =>
|
|
1115
|
+
}, Oi = () => m.findIndex((h) => R === h && !h.disabled), Ze = (h) => {
|
|
1116
1116
|
let w;
|
|
1117
1117
|
if (ne === ye) {
|
|
1118
1118
|
let { height: ae, top: pe } = d.getBoundingClientRect(), ie = h.type.indexOf("mouse") !== -1 ? h.clientY : h.touches[0].clientY;
|
|
@@ -1121,7 +1121,7 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
1121
1121
|
let { width: ae, left: pe } = d.getBoundingClientRect(), ie = h.type.indexOf("mouse") !== -1 ? h.clientX : h.touches[0].clientX;
|
|
1122
1122
|
w = Math.min(Math.max(0, ie - pe), ae) * 100 / ae;
|
|
1123
1123
|
}
|
|
1124
|
-
if ((xe || Y) && (w = 100 - w),
|
|
1124
|
+
if ((xe || Y) && (w = 100 - w), R = Ws(h.target, w), me && m.length > 1 && de !== void 0) {
|
|
1125
1125
|
let ae = m[0], pe = m[m.length - 1], ie = ae.percent + de < 0, De = pe.percent + de > 100;
|
|
1126
1126
|
if (ie || De)
|
|
1127
1127
|
return;
|
|
@@ -1130,9 +1130,9 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
1130
1130
|
return;
|
|
1131
1131
|
}
|
|
1132
1132
|
let N = Oi();
|
|
1133
|
-
N !== -1 && (Ee(N, w),
|
|
1133
|
+
N !== -1 && (Ee(N, w), R == null || R.$pointer.focus());
|
|
1134
1134
|
}, It = (h) => {
|
|
1135
|
-
if (fe || document.activeElement !== l ||
|
|
1135
|
+
if (fe || document.activeElement !== l || R != null && R.disabled)
|
|
1136
1136
|
return;
|
|
1137
1137
|
h.stopPropagation(), h.preventDefault();
|
|
1138
1138
|
let w = h.deltaY < 0, N = xe || Y, ae = w ? !N : N, pe = Oi();
|
|
@@ -1156,7 +1156,7 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
1156
1156
|
let N = jt(w);
|
|
1157
1157
|
N == null && (N = 1), w += N, w > 100 && (w = 100), Ee(h, w);
|
|
1158
1158
|
}, Qe = () => {
|
|
1159
|
-
!
|
|
1159
|
+
!T || T.update({ percents: Ri(), values: Ti(), $pointers: Di(), min: Ii(), max: ji(), data: cr(), step: lr(), round: hr(), type: ur(), textMin: Nt(), textMax: Bt(), rightToLeft: pr(), bottomToTop: gr(), pointersOverlap: br(), pointersMinDistance: dr(), pointersMaxDistance: fr(), rangeDragging: xr(), disabled: vr(), keyboardDisabled: mr(), mousewheelDisabled: yr() });
|
|
1160
1160
|
}, Ks = () => {
|
|
1161
1161
|
Qe();
|
|
1162
1162
|
}, Js = (h) => {
|
|
@@ -1199,7 +1199,7 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
1199
1199
|
}, eo = (h) => {
|
|
1200
1200
|
var w;
|
|
1201
1201
|
return m.length <= 1 || h >= m.length - 1 || Q ? Bt() : (w = ht(m[h + 1].percent)) != null ? w : "";
|
|
1202
|
-
},
|
|
1202
|
+
}, Ri = () => m.map((h) => h.percent), Ti = () => m.map((h) => ht(h.percent)), Di = () => m.map((h) => h.$pointer), Ii = () => D, ji = () => K, cr = () => F, ur = () => ne, hr = () => Oe, dr = () => z, fr = () => ce, to = (h) => Ai[h], pr = () => xe, gr = () => Y, vr = () => fe, mr = () => we, yr = () => _e, br = () => Q, xr = () => me, Ee = (h, w) => {
|
|
1203
1203
|
if (w === void 0)
|
|
1204
1204
|
return;
|
|
1205
1205
|
let N = jt(w);
|
|
@@ -1308,13 +1308,13 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
1308
1308
|
me = h, d.classList.toggle(wi, me);
|
|
1309
1309
|
}, no = () => {
|
|
1310
1310
|
Er(be(l.getAttribute(g))), we = be(l.getAttribute($)), _e = be(l.getAttribute(O));
|
|
1311
|
-
let h =
|
|
1311
|
+
let h = Tt(l, /^pointer([0-9]*)-disabled$/, (w) => be(w));
|
|
1312
1312
|
for (let w of h) {
|
|
1313
1313
|
let N = w[0];
|
|
1314
1314
|
!m[N] || (m[N].disabled = w[1]);
|
|
1315
1315
|
}
|
|
1316
1316
|
}, so = () => {
|
|
1317
|
-
let h =
|
|
1317
|
+
let h = Tt(l, /^aria-label([0-9]*)$/);
|
|
1318
1318
|
for (let w of h) {
|
|
1319
1319
|
let N = w[0];
|
|
1320
1320
|
Ui(N, w[1]);
|
|
@@ -1333,13 +1333,13 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
1333
1333
|
for (let ae of m)
|
|
1334
1334
|
ae.setCallbacks(Pi, Ci, ki, Li);
|
|
1335
1335
|
let N = (h = l.shadowRoot) == null ? void 0 : h.querySelector(".panel-fill");
|
|
1336
|
-
N && (U = bs(N)), Ar(l.getAttribute(j)), Sr(be(l.getAttribute(J))), Or(be(l.getAttribute(f))), ro(l.getAttribute(v), l.getAttribute(y)), Yt(l.getAttribute(x)), Mr(l.getAttribute(p)), Ni(b.map((ae) => ae[1])), $r(be(l.getAttribute(o))), wr(oe(l.getAttribute(c), 0)), _r(oe(l.getAttribute(a), 1 / 0)), zt(be(l.getAttribute(u))), Pr(oe(l.getAttribute(M), ut)), no(), so(), G = Bs(l, d, m), Hi((w = l.getAttribute(
|
|
1336
|
+
N && (U = bs(N)), Ar(l.getAttribute(j)), Sr(be(l.getAttribute(J))), Or(be(l.getAttribute(f))), ro(l.getAttribute(v), l.getAttribute(y)), Yt(l.getAttribute(x)), Mr(l.getAttribute(p)), Ni(b.map((ae) => ae[1])), $r(be(l.getAttribute(o))), wr(oe(l.getAttribute(c), 0)), _r(oe(l.getAttribute(a), 1 / 0)), zt(be(l.getAttribute(u))), Pr(oe(l.getAttribute(M), ut)), no(), so(), G = Bs(l, d, m), Hi((w = l.getAttribute(Re)) != null ? w : Mi), d.addEventListener("mousedown", Si), d.addEventListener("mouseup", Dt), d.addEventListener("touchmove", Ze), d.addEventListener("touchstart", Ze), _e || document.addEventListener("wheel", It, { passive: !1 }), T = Fs(l, Ks, { setValues: Ni, setMin: Ft, setMax: Ht, setStep: Yt, setPointersOverlap: $r, setPointersMinDistance: wr, setPointersMaxDistance: _r, setDisabled: Er, setType: Ar, setRightToLeft: Sr, setBottomToTop: Or, setRound: Pr, setKeyboardDisabled: Bi, setMousewheelDisabled: Fi, setRangeDragging: zt, setData: Mr }, { getPercents: Ri, getValues: Ti, getPointerElements: Di, getMin: Ii, getMax: ji, getStep: lr, getData: cr, getType: ur, getRound: hr, getTextMin: Nt, getTextMax: Bt, isRightToLeft: pr, isBottomToTop: gr, isDisabled: vr, isKeyboardDisabled: mr, isMousewheelDisabled: yr, isPointersOverlap: br, isRangeDraggingEnabled: xr, getPointersMinDistance: dr, getPointersMaxDistance: fr }), T.init();
|
|
1337
1337
|
})(), { get pointers() {
|
|
1338
1338
|
return m;
|
|
1339
1339
|
}, get styles() {
|
|
1340
1340
|
return G;
|
|
1341
1341
|
}, get pluginsManager() {
|
|
1342
|
-
return
|
|
1342
|
+
return T;
|
|
1343
1343
|
}, get min() {
|
|
1344
1344
|
return Nt();
|
|
1345
1345
|
}, get max() {
|
|
@@ -1400,13 +1400,13 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
1400
1400
|
d.removeEventListener("mousedown", Si), d.removeEventListener("mouseup", Dt), d.removeEventListener("touchmove", Ze), d.removeEventListener("touchstart", Ze), document.removeEventListener("wheel", It);
|
|
1401
1401
|
for (let h of m)
|
|
1402
1402
|
h.destroy();
|
|
1403
|
-
|
|
1403
|
+
T == null || T.destroy();
|
|
1404
1404
|
} };
|
|
1405
1405
|
}, Xs = (l, d, b) => {
|
|
1406
|
-
let m = $i.find(([
|
|
1406
|
+
let m = $i.find(([T, D, K, te]) => D.replace("#", "") === d.replace(/\d+/g, ""));
|
|
1407
1407
|
if (m && l.styles) {
|
|
1408
|
-
let [
|
|
1409
|
-
l.styles.setStyle(
|
|
1408
|
+
let [T, D, K, te] = m, F = d.replace(/\D/g, "").trim(), ne = F === "" || F === "0" || F === "1" ? 0 : oe(F, 0) - 1;
|
|
1409
|
+
l.styles.setStyle(T, b, ne);
|
|
1410
1410
|
return;
|
|
1411
1411
|
}
|
|
1412
1412
|
switch (l && l.pluginsManager && l.pluginsManager.onAttrChange(d, b), d) {
|
|
@@ -1474,25 +1474,25 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
1474
1474
|
l.styles && (l.styles.theme = b);
|
|
1475
1475
|
break;
|
|
1476
1476
|
}
|
|
1477
|
-
case
|
|
1477
|
+
case Re: {
|
|
1478
1478
|
l.animateOnClick = b;
|
|
1479
1479
|
break;
|
|
1480
1480
|
}
|
|
1481
1481
|
}
|
|
1482
|
-
let
|
|
1483
|
-
if (/^value([0-9]*)$/.test(d) && (
|
|
1482
|
+
let R = null;
|
|
1483
|
+
if (/^value([0-9]*)$/.test(d) && (R = "value"), /^pointer([0-9]*)-disabled$/.test(d) && (R = "pointer-disabled"), /^aria-label([0-9]*)$/.test(d) && (R = "aria-label"), /^pointer([0-9]*)-shape$/.test(d) && (R = "pointer-shape"), !R)
|
|
1484
1484
|
return;
|
|
1485
1485
|
let U = d.replace(/\D/g, "").trim(), G = U === "" || U === "0" || U === "1" ? 0 : oe(U, 0) - 1;
|
|
1486
|
-
switch (
|
|
1486
|
+
switch (R) {
|
|
1487
1487
|
case "value": {
|
|
1488
1488
|
l.setValue(b, G);
|
|
1489
1489
|
break;
|
|
1490
1490
|
}
|
|
1491
1491
|
case "pointer-disabled": {
|
|
1492
|
-
let
|
|
1493
|
-
if (!
|
|
1492
|
+
let T = l == null ? void 0 : l.pointers[G];
|
|
1493
|
+
if (!T)
|
|
1494
1494
|
return;
|
|
1495
|
-
|
|
1495
|
+
T.disabled = be(b);
|
|
1496
1496
|
break;
|
|
1497
1497
|
}
|
|
1498
1498
|
case "aria-label": {
|
|
@@ -1661,14 +1661,14 @@ const Ln = Symbol.for(""), Mo = (r) => {
|
|
|
1661
1661
|
let m = (d = this.shadowRoot) == null ? void 0 : d.getElementById("range-slider");
|
|
1662
1662
|
if (!m)
|
|
1663
1663
|
return;
|
|
1664
|
-
let
|
|
1665
|
-
this.slider = zs(this, m,
|
|
1664
|
+
let R = Us(this, b);
|
|
1665
|
+
this.slider = zs(this, m, R), Ys(this, this.slider), this._observer = new MutationObserver((U) => {
|
|
1666
1666
|
U.forEach((G) => {
|
|
1667
|
-
var
|
|
1667
|
+
var T;
|
|
1668
1668
|
if (!this.slider || G.type !== "attributes")
|
|
1669
1669
|
return;
|
|
1670
1670
|
let D = G.attributeName;
|
|
1671
|
-
!D || Xs(this.slider, D, (
|
|
1671
|
+
!D || Xs(this.slider, D, (T = this.getAttribute(D)) != null ? T : "");
|
|
1672
1672
|
});
|
|
1673
1673
|
}), this._observer.observe(this, { attributes: !0 });
|
|
1674
1674
|
}
|
|
@@ -1710,7 +1710,7 @@ function ci(r) {
|
|
|
1710
1710
|
});
|
|
1711
1711
|
}), t;
|
|
1712
1712
|
}
|
|
1713
|
-
var
|
|
1713
|
+
var Rn = { exports: {} };
|
|
1714
1714
|
(function(r, e) {
|
|
1715
1715
|
(function(t, i) {
|
|
1716
1716
|
r.exports = i();
|
|
@@ -1812,7 +1812,7 @@ var Tn = { exports: {} };
|
|
|
1812
1812
|
return H ? oe : oe.endOf(u);
|
|
1813
1813
|
}, le = function(je, ue) {
|
|
1814
1814
|
return I.w(P.toDate()[je].apply(P.toDate("s"), (H ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ue)), P);
|
|
1815
|
-
}, Z = this.$W, ve = this.$M,
|
|
1815
|
+
}, Z = this.$W, ve = this.$M, Re = this.$D, Te = "set" + (this.$u ? "UTC" : "");
|
|
1816
1816
|
switch (X) {
|
|
1817
1817
|
case x:
|
|
1818
1818
|
return H ? ee(1, 0) : ee(31, 11);
|
|
@@ -1820,16 +1820,16 @@ var Tn = { exports: {} };
|
|
|
1820
1820
|
return H ? ee(1, ve) : ee(0, ve + 1);
|
|
1821
1821
|
case p:
|
|
1822
1822
|
var ye = this.$locale().weekStart || 0, Se = (Z < ye ? Z + 7 : Z) - ye;
|
|
1823
|
-
return ee(H ?
|
|
1823
|
+
return ee(H ? Re - Se : Re + (6 - Se), ve);
|
|
1824
1824
|
case u:
|
|
1825
1825
|
case M:
|
|
1826
|
-
return le(
|
|
1826
|
+
return le(Te + "Hours", 0);
|
|
1827
1827
|
case a:
|
|
1828
|
-
return le(
|
|
1828
|
+
return le(Te + "Minutes", 1);
|
|
1829
1829
|
case c:
|
|
1830
|
-
return le(
|
|
1830
|
+
return le(Te + "Seconds", 2);
|
|
1831
1831
|
case o:
|
|
1832
|
-
return le(
|
|
1832
|
+
return le(Te + "Milliseconds", 3);
|
|
1833
1833
|
default:
|
|
1834
1834
|
return this.clone();
|
|
1835
1835
|
}
|
|
@@ -1851,8 +1851,8 @@ var Tn = { exports: {} };
|
|
|
1851
1851
|
var P, H = this;
|
|
1852
1852
|
S = Number(S);
|
|
1853
1853
|
var X = I.p(B), ee = function(ve) {
|
|
1854
|
-
var
|
|
1855
|
-
return I.w(
|
|
1854
|
+
var Re = L(H);
|
|
1855
|
+
return I.w(Re.date(Re.date() + Math.round(ve * S)), H);
|
|
1856
1856
|
};
|
|
1857
1857
|
if (X === v)
|
|
1858
1858
|
return this.set(v, this.$M + S);
|
|
@@ -1870,14 +1870,14 @@ var Tn = { exports: {} };
|
|
|
1870
1870
|
var B = this, P = this.$locale();
|
|
1871
1871
|
if (!this.isValid())
|
|
1872
1872
|
return P.invalidDate || j;
|
|
1873
|
-
var H = S || "YYYY-MM-DDTHH:mm:ssZ", X = I.z(this), ee = this.$H, le = this.$m, Z = this.$M, ve = P.weekdays,
|
|
1873
|
+
var H = S || "YYYY-MM-DDTHH:mm:ssZ", X = I.z(this), ee = this.$H, le = this.$m, Z = this.$M, ve = P.weekdays, Re = P.months, Te = function(ue, oe, at, lt) {
|
|
1874
1874
|
return ue && (ue[oe] || ue(B, H)) || at[oe].slice(0, lt);
|
|
1875
1875
|
}, ye = function(ue) {
|
|
1876
1876
|
return I.s(ee % 12 || 12, ue, "0");
|
|
1877
1877
|
}, Se = P.meridiem || function(ue, oe, at) {
|
|
1878
1878
|
var lt = ue < 12 ? "AM" : "PM";
|
|
1879
1879
|
return at ? lt.toLowerCase() : lt;
|
|
1880
|
-
}, je = { YY: String(this.$y).slice(-2), YYYY: I.s(this.$y, 4, "0"), M: Z + 1, MM: I.s(Z + 1, 2, "0"), MMM:
|
|
1880
|
+
}, je = { YY: String(this.$y).slice(-2), YYYY: I.s(this.$y, 4, "0"), M: Z + 1, MM: I.s(Z + 1, 2, "0"), MMM: Te(P.monthsShort, Z, Re, 3), MMMM: Te(Re, Z), D: this.$D, DD: I.s(this.$D, 2, "0"), d: String(this.$W), dd: Te(P.weekdaysMin, this.$W, ve, 2), ddd: Te(P.weekdaysShort, this.$W, ve, 3), dddd: ve[this.$W], H: String(ee), HH: I.s(ee, 2, "0"), h: ye(1), hh: ye(2), a: Se(ee, le, !0), A: Se(ee, le, !1), m: String(le), mm: I.s(le, 2, "0"), s: String(this.$s), ss: I.s(this.$s, 2, "0"), SSS: I.s(this.$ms, 3, "0"), Z: X };
|
|
1881
1881
|
return H.replace(J, function(ue, oe) {
|
|
1882
1882
|
return oe || je[ue] || X.replace(":", "");
|
|
1883
1883
|
});
|
|
@@ -1917,8 +1917,8 @@ var Tn = { exports: {} };
|
|
|
1917
1917
|
return L(1e3 * k);
|
|
1918
1918
|
}, L.en = E[O], L.Ls = E, L.p = {}, L;
|
|
1919
1919
|
});
|
|
1920
|
-
})(
|
|
1921
|
-
var So =
|
|
1920
|
+
})(Rn);
|
|
1921
|
+
var So = Rn.exports;
|
|
1922
1922
|
const Zt = /* @__PURE__ */ li(So);
|
|
1923
1923
|
class Oo extends Ce {
|
|
1924
1924
|
constructor() {
|
|
@@ -2037,7 +2037,7 @@ class Oo extends Ce {
|
|
|
2037
2037
|
this.templates = this.getTemplates();
|
|
2038
2038
|
}
|
|
2039
2039
|
}
|
|
2040
|
-
const
|
|
2040
|
+
const Tn = `
|
|
2041
2041
|
:host {
|
|
2042
2042
|
display: flex;
|
|
2043
2043
|
box-sizing: border-box;
|
|
@@ -2416,19 +2416,27 @@ eox-itemfilter-range {
|
|
|
2416
2416
|
margin-left: .5rem;
|
|
2417
2417
|
}
|
|
2418
2418
|
`;
|
|
2419
|
-
var
|
|
2420
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
2419
|
+
var Ro = Object.defineProperty, To = Object.getOwnPropertyDescriptor, ui = (r, e, t, i) => {
|
|
2420
|
+
for (var n = i > 1 ? void 0 : i ? To(e, t) : e, s = r.length - 1, o; s >= 0; s--)
|
|
2421
2421
|
(o = r[s]) && (n = (i ? o(e, t, n) : o(n)) || n);
|
|
2422
|
-
return i && n &&
|
|
2422
|
+
return i && n && Ro(e, t, n), n;
|
|
2423
2423
|
};
|
|
2424
2424
|
let Qt = class extends Ce {
|
|
2425
|
+
handleDetailsToggle(r) {
|
|
2426
|
+
this.dispatchEvent(new CustomEvent("details-toggled", {
|
|
2427
|
+
detail: r,
|
|
2428
|
+
bubbles: !0,
|
|
2429
|
+
composed: !0
|
|
2430
|
+
}));
|
|
2431
|
+
}
|
|
2425
2432
|
render() {
|
|
2426
2433
|
return he`
|
|
2427
2434
|
<style>
|
|
2428
|
-
${
|
|
2435
|
+
${Tn}
|
|
2429
2436
|
${!this.unstyled && Dn}
|
|
2430
2437
|
</style>
|
|
2431
2438
|
<details
|
|
2439
|
+
@toggle="${this.handleDetailsToggle}"
|
|
2432
2440
|
class="details-filter"
|
|
2433
2441
|
part="details-filter"
|
|
2434
2442
|
open=${this.filterObject.expanded || se}
|
|
@@ -3533,10 +3541,10 @@ function cn(r) {
|
|
|
3533
3541
|
throw new Error("geojson is required");
|
|
3534
3542
|
var e = [];
|
|
3535
3543
|
return ze(r, function(t) {
|
|
3536
|
-
|
|
3544
|
+
Ra(t, e);
|
|
3537
3545
|
}), Ge(e);
|
|
3538
3546
|
}
|
|
3539
|
-
function
|
|
3547
|
+
function Ra(r, e) {
|
|
3540
3548
|
var t = [], i = r.geometry;
|
|
3541
3549
|
if (i !== null) {
|
|
3542
3550
|
switch (i.type) {
|
|
@@ -3547,14 +3555,14 @@ function Ta(r, e) {
|
|
|
3547
3555
|
t = [yt(i)];
|
|
3548
3556
|
}
|
|
3549
3557
|
t.forEach(function(n) {
|
|
3550
|
-
var s =
|
|
3558
|
+
var s = Ta(n, r.properties);
|
|
3551
3559
|
s.forEach(function(o) {
|
|
3552
3560
|
o.id = e.length, e.push(o);
|
|
3553
3561
|
});
|
|
3554
3562
|
});
|
|
3555
3563
|
}
|
|
3556
3564
|
}
|
|
3557
|
-
function
|
|
3565
|
+
function Ta(r, e) {
|
|
3558
3566
|
var t = [];
|
|
3559
3567
|
return r.reduce(function(i, n) {
|
|
3560
3568
|
var s = Ie([i, n], e);
|
|
@@ -4183,7 +4191,7 @@ function es(r, e) {
|
|
|
4183
4191
|
function ll(r, e) {
|
|
4184
4192
|
return [(r[0] + e[0]) / 2, (r[1] + e[1]) / 2];
|
|
4185
4193
|
}
|
|
4186
|
-
var cl = Object.defineProperty, ul = Object.getOwnPropertyDescriptor,
|
|
4194
|
+
var cl = Object.defineProperty, ul = Object.getOwnPropertyDescriptor, Rt = (r, e, t, i) => {
|
|
4187
4195
|
for (var n = i > 1 ? void 0 : i ? ul(e, t) : e, s = r.length - 1, o; s >= 0; s--)
|
|
4188
4196
|
(o = r[s]) && (n = (i ? o(e, t, n) : o(n)) || n);
|
|
4189
4197
|
return i && n && cl(e, t, n), n;
|
|
@@ -4239,10 +4247,10 @@ let Kr = class extends Ce {
|
|
|
4239
4247
|
`;
|
|
4240
4248
|
}
|
|
4241
4249
|
};
|
|
4242
|
-
|
|
4250
|
+
Rt([
|
|
4243
4251
|
Ae()
|
|
4244
4252
|
], Kr.prototype, "filterObject", 2);
|
|
4245
|
-
Kr =
|
|
4253
|
+
Kr = Rt([
|
|
4246
4254
|
Ke("eox-itemfilter-spatial")
|
|
4247
4255
|
], Kr);
|
|
4248
4256
|
let ir = class extends Ce {
|
|
@@ -4325,13 +4333,13 @@ let ir = class extends Ce {
|
|
|
4325
4333
|
((e = r.getFeatures()) == null ? void 0 : e.length) > 0 && (r.clear(), this.eoxMap.removeInteraction("drawInteraction_modify"), this.setup());
|
|
4326
4334
|
}
|
|
4327
4335
|
};
|
|
4328
|
-
|
|
4336
|
+
Rt([
|
|
4329
4337
|
Ae()
|
|
4330
4338
|
], ir.prototype, "geometry", 2);
|
|
4331
|
-
|
|
4339
|
+
Rt([
|
|
4332
4340
|
Lt()
|
|
4333
4341
|
], ir.prototype, "eoxMap", 2);
|
|
4334
|
-
ir =
|
|
4342
|
+
ir = Rt([
|
|
4335
4343
|
Ke("eox-itemfilter-spatial-filter")
|
|
4336
4344
|
], ir);
|
|
4337
4345
|
var fl = Object.defineProperty, pl = Object.getOwnPropertyDescriptor, ts = (r, e, t, i) => {
|
|
@@ -4654,7 +4662,7 @@ function os(r, e, { getFn: t = V.getFn, fieldNormWeight: i = V.fieldNormWeight }
|
|
|
4654
4662
|
const n = new bi({ getFn: t, fieldNormWeight: i });
|
|
4655
4663
|
return n.setKeys(r.map(ss)), n.setSources(e), n.create(), n;
|
|
4656
4664
|
}
|
|
4657
|
-
function
|
|
4665
|
+
function Rl(r, { getFn: e = V.getFn, fieldNormWeight: t = V.fieldNormWeight } = {}) {
|
|
4658
4666
|
const { keys: i, records: n } = r, s = new bi({ getFn: e, fieldNormWeight: t });
|
|
4659
4667
|
return s.setKeys(i), s.setIndexRecords(n), s;
|
|
4660
4668
|
}
|
|
@@ -4671,7 +4679,7 @@ function Wt(r, {
|
|
|
4671
4679
|
const c = Math.abs(i - t);
|
|
4672
4680
|
return n ? o + c / n : c ? 1 : o;
|
|
4673
4681
|
}
|
|
4674
|
-
function
|
|
4682
|
+
function Tl(r = [], e = V.minMatchCharLength) {
|
|
4675
4683
|
let t = [], i = -1, n = -1, s = 0;
|
|
4676
4684
|
for (let o = r.length; s < o; s += 1) {
|
|
4677
4685
|
let c = r[s];
|
|
@@ -4754,7 +4762,7 @@ function Dl(r, e, t, {
|
|
|
4754
4762
|
score: Math.max(1e-3, g)
|
|
4755
4763
|
};
|
|
4756
4764
|
if (j) {
|
|
4757
|
-
const A =
|
|
4765
|
+
const A = Tl(q, c);
|
|
4758
4766
|
A.length ? a && (E.indices = A) : E.isMatch = !1;
|
|
4759
4767
|
}
|
|
4760
4768
|
return E;
|
|
@@ -5388,7 +5396,7 @@ class wt {
|
|
|
5388
5396
|
}
|
|
5389
5397
|
wt.version = "6.6.2";
|
|
5390
5398
|
wt.createIndex = os;
|
|
5391
|
-
wt.parseIndex =
|
|
5399
|
+
wt.parseIndex = Rl;
|
|
5392
5400
|
wt.config = V;
|
|
5393
5401
|
wt.parseQuery = us;
|
|
5394
5402
|
ql(Wl);
|
|
@@ -5498,7 +5506,7 @@ class bn {
|
|
|
5498
5506
|
constructor() {
|
|
5499
5507
|
this.aggregateResults = void 0, this.enableHighlighting = !1, this.filterProperties = [], this.inlineMode = !1, this.matchAllWhenEmpty = !0, this.onFilter = () => {
|
|
5500
5508
|
}, this.onSelect = () => {
|
|
5501
|
-
}, this.showResults = !0, this.titleProperty = "title";
|
|
5509
|
+
}, this.showResults = !0, this.titleProperty = "title", this.expandMultipleFilters = !0, this.expandMultipleResults = !0;
|
|
5502
5510
|
}
|
|
5503
5511
|
}
|
|
5504
5512
|
let Ue = class extends Oo {
|
|
@@ -5591,10 +5599,27 @@ let Ue = class extends Oo {
|
|
|
5591
5599
|
r.reset();
|
|
5592
5600
|
}), this.search();
|
|
5593
5601
|
}
|
|
5602
|
+
toggleAccordion(r) {
|
|
5603
|
+
let e;
|
|
5604
|
+
if (r.detail ? e = r.detail.target : e = r.target, e.classList.contains("details-filter")) {
|
|
5605
|
+
if (!e.open || this.config.expandMultipleFilters)
|
|
5606
|
+
return;
|
|
5607
|
+
this.shadowRoot.querySelectorAll("eox-itemfilter-expandcontainer").forEach((t) => {
|
|
5608
|
+
const i = t.shadowRoot.querySelector(".details-filter");
|
|
5609
|
+
i && i !== e && i.removeAttribute("open");
|
|
5610
|
+
});
|
|
5611
|
+
} else {
|
|
5612
|
+
if (!e.open || this.config.expandMultipleResults)
|
|
5613
|
+
return;
|
|
5614
|
+
this.shadowRoot.querySelectorAll("details").forEach((t) => {
|
|
5615
|
+
t !== e && t.removeAttribute("open");
|
|
5616
|
+
});
|
|
5617
|
+
}
|
|
5618
|
+
}
|
|
5594
5619
|
render() {
|
|
5595
5620
|
return he`
|
|
5596
5621
|
<style>
|
|
5597
|
-
${
|
|
5622
|
+
${Tn}
|
|
5598
5623
|
${!this.unstyled && Dn}
|
|
5599
5624
|
${this.styleOverride}
|
|
5600
5625
|
</style>
|
|
@@ -5630,6 +5655,7 @@ let Ue = class extends Oo {
|
|
|
5630
5655
|
<eox-itemfilter-expandcontainer
|
|
5631
5656
|
.filterObject=${r}
|
|
5632
5657
|
.unstyled=${this.unstyled}
|
|
5658
|
+
@details-toggled=${this.toggleAccordion}
|
|
5633
5659
|
>
|
|
5634
5660
|
<eox-itemfilter-${Vt(r.type)}
|
|
5635
5661
|
slot="filter"
|
|
@@ -5683,6 +5709,7 @@ let Ue = class extends Oo {
|
|
|
5683
5709
|
),
|
|
5684
5710
|
(r) => he`<details
|
|
5685
5711
|
class="details-results"
|
|
5712
|
+
@toggle=${this.toggleAccordion}
|
|
5686
5713
|
open
|
|
5687
5714
|
>
|
|
5688
5715
|
<summary>
|
|
@@ -438,12 +438,13 @@ eox-itemfilter-range {
|
|
|
438
438
|
.range-after {
|
|
439
439
|
margin-left: .5rem;
|
|
440
440
|
}
|
|
441
|
-
`;var Ls=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,_r=(r,e,t,i)=>{for(var n=i>1?void 0:i?Ts(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Ls(e,t,n),n};let Ft=class extends Pe{render(){return he`
|
|
441
|
+
`;var Ls=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,_r=(r,e,t,i)=>{for(var n=i>1?void 0:i?Ts(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Ls(e,t,n),n};let Ft=class extends Pe{handleDetailsToggle(r){this.dispatchEvent(new CustomEvent("details-toggled",{detail:r,bubbles:!0,composed:!0}))}render(){return he`
|
|
442
442
|
<style>
|
|
443
443
|
${Ji}
|
|
444
444
|
${!this.unstyled&&Zi}
|
|
445
445
|
</style>
|
|
446
446
|
<details
|
|
447
|
+
@toggle="${this.handleDetailsToggle}"
|
|
447
448
|
class="details-filter"
|
|
448
449
|
part="details-filter"
|
|
449
450
|
open=${this.filterObject.expanded||ne}
|
|
@@ -545,7 +546,7 @@ eox-itemfilter-range {
|
|
|
545
546
|
value="${Object.values(this.filterObject.state)[0]}"
|
|
546
547
|
@input="${this.debouncedInputHandler}"
|
|
547
548
|
/>
|
|
548
|
-
`}};On([Ae()],Fr.prototype,"filterObject",2),Fr=On([qe("eox-itemfilter-text")],Fr);function Xe(r){return Array.isArray?Array.isArray(r):Cn(r)==="[object Array]"}const pa=1/0;function ga(r){if(typeof r=="string")return r;let e=r+"";return e=="0"&&1/r==-pa?"-0":e}function va(r){return r==null?"":ga(r)}function Fe(r){return typeof r=="string"}function Sn(r){return typeof r=="number"}function ma(r){return r===!0||r===!1||ya(r)&&Cn(r)=="[object Boolean]"}function Pn(r){return typeof r=="object"}function ya(r){return Pn(r)&&r!==null}function Oe(r){return r!=null}function Hr(r){return!r.trim().length}function Cn(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}const ic="Extended search is not available",ba="Incorrect 'index' type",xa=r=>`Invalid value for key ${r}`,$a=r=>`Pattern length exceeds max of ${r}.`,wa=r=>`Missing ${r} property in key`,_a=r=>`Property 'weight' in key '${r}' must be a positive integer`,kn=Object.prototype.hasOwnProperty;class Ea{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(i=>{let n=Ln(i);t+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(i=>{i.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Ln(r){let e=null,t=null,i=null,n=1,s=null;if(Fe(r)||Xe(r))i=r,e=Tn(r),t=Ur(r);else{if(!kn.call(r,"name"))throw new Error(wa("name"));const o=r.name;if(i=o,kn.call(r,"weight")&&(n=r.weight,n<=0))throw new Error(_a(o));e=Tn(o),t=Ur(o),s=r.getFn}return{path:e,id:t,weight:n,src:i,getFn:s}}function Tn(r){return Xe(r)?r:r.split(".")}function Ur(r){return Xe(r)?r.join("."):r}function Ma(r,e){let t=[],i=!1;const n=(s,o,l)=>{if(Oe(s))if(!o[l])t.push(s);else{let a=o[l];const u=s[a];if(!Oe(u))return;if(l===o.length-1&&(Fe(u)||Sn(u)||ma(u)))t.push(va(u));else if(Xe(u)){i=!0;for(let p=0,v=u.length;p<v;p+=1)n(u[p],o,l+1)}else o.length&&n(u,o,l+1)}};return n(r,Fe(e)?e.split("."):e,0),i?t:t[0]}var X={...{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(r,e)=>r.score===e.score?r.idx<e.idx?-1:1:r.score<e.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:Ma,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const Aa=/[^ ]+/g;function Oa(r=1,e=3){const t=new Map,i=Math.pow(10,e);return{get(n){const s=n.match(Aa).length;if(t.has(s))return t.get(s);const o=1/Math.pow(s,.5*r),l=parseFloat(Math.round(o*i)/i);return t.set(s,l),l},clear(){t.clear()}}}class Yr{constructor({getFn:e=X.getFn,fieldNormWeight:t=X.fieldNormWeight}={}){this.norm=Oa(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,i)=>{this._keysMap[t.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Fe(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){const t=this.size();Fe(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t<i;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!Oe(e)||Hr(e))return;let i={v:e,i:t,n:this.norm.get(e)};this.records.push(i)}_addObject(e,t){let i={i:t,$:{}};this.keys.forEach((n,s)=>{let o=n.getFn?n.getFn(e):this.getFn(e,n.path);if(Oe(o)){if(Xe(o)){let l=[];const a=[{nestedArrIndex:-1,value:o}];for(;a.length;){const{nestedArrIndex:u,value:p}=a.pop();if(Oe(p))if(Fe(p)&&!Hr(p)){let v={v:p,i:u,n:this.norm.get(p)};l.push(v)}else Xe(p)&&p.forEach((v,y)=>{a.push({nestedArrIndex:y,value:v})})}i.$[s]=l}else if(Fe(o)&&!Hr(o)){let l={v:o,n:this.norm.get(o)};i.$[s]=l}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function Rn(r,e,{getFn:t=X.getFn,fieldNormWeight:i=X.fieldNormWeight}={}){const n=new Yr({getFn:t,fieldNormWeight:i});return n.setKeys(r.map(Ln)),n.setSources(e),n.create(),n}function Sa(r,{getFn:e=X.getFn,fieldNormWeight:t=X.fieldNormWeight}={}){const{keys:i,records:n}=r,s=new Yr({getFn:e,fieldNormWeight:t});return s.setKeys(i),s.setIndexRecords(n),s}function Xt(r,{errors:e=0,currentLocation:t=0,expectedLocation:i=0,distance:n=X.distance,ignoreLocation:s=X.ignoreLocation}={}){const o=e/r.length;if(s)return o;const l=Math.abs(i-t);return n?o+l/n:l?1:o}function Pa(r=[],e=X.minMatchCharLength){let t=[],i=-1,n=-1,s=0;for(let o=r.length;s<o;s+=1){let l=r[s];l&&i===-1?i=s:!l&&i!==-1&&(n=s-1,n-i+1>=e&&t.push([i,n]),i=-1)}return r[s-1]&&s-i>=e&&t.push([i,s-1]),t}const st=32;function Ca(r,e,t,{location:i=X.location,distance:n=X.distance,threshold:s=X.threshold,findAllMatches:o=X.findAllMatches,minMatchCharLength:l=X.minMatchCharLength,includeMatches:a=X.includeMatches,ignoreLocation:u=X.ignoreLocation}={}){if(e.length>st)throw new Error($a(st));const p=e.length,v=r.length,y=Math.max(0,Math.min(i,v));let x=s,M=y;const j=l>1||a,q=j?Array(v):[];let J;for(;(J=r.indexOf(e,M))>-1;){let A=Xt(e,{currentLocation:J,expectedLocation:y,distance:n,ignoreLocation:u});if(x=Math.min(A,x),M=J+p,j){let C=0;for(;C<p;)q[J+C]=1,C+=1}}M=-1;let f=[],g=1,$=p+v;const S=1<<p-1;for(let A=0;A<p;A+=1){let C=0,L=$;for(;C<L;)Xt(e,{errors:A,currentLocation:y+L,expectedLocation:y,distance:n,ignoreLocation:u})<=x?C=L:$=L,L=Math.floor(($-C)/2+C);$=L;let I=Math.max(1,y-L+1),W=o?v:Math.min(y+L,v)+p,re=Array(W+2);re[W+1]=(1<<A)-1;for(let _=W;_>=I;_-=1){let O=_-1,B=t[r.charAt(O)];if(j&&(q[O]=+!!B),re[_]=(re[_+1]<<1|1)&B,A&&(re[_]|=(f[_+1]|f[_])<<1|1|f[_+1]),re[_]&S&&(g=Xt(e,{errors:A,currentLocation:O,expectedLocation:y,distance:n,ignoreLocation:u}),g<=x)){if(x=g,M=O,M<=y)break;I=Math.max(1,2*y-M)}}if(Xt(e,{errors:A+1,currentLocation:y,expectedLocation:y,distance:n,ignoreLocation:u})>x)break;f=re}const E={isMatch:M>=0,score:Math.max(.001,g)};if(j){const A=Pa(q,l);A.length?a&&(E.indices=A):E.isMatch=!1}return E}function ka(r){let e={};for(let t=0,i=r.length;t<i;t+=1){const n=r.charAt(t);e[n]=(e[n]||0)|1<<i-t-1}return e}class Dn{constructor(e,{location:t=X.location,threshold:i=X.threshold,distance:n=X.distance,includeMatches:s=X.includeMatches,findAllMatches:o=X.findAllMatches,minMatchCharLength:l=X.minMatchCharLength,isCaseSensitive:a=X.isCaseSensitive,ignoreLocation:u=X.ignoreLocation}={}){if(this.options={location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:a,ignoreLocation:u},this.pattern=a?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const p=(y,x)=>{this.chunks.push({pattern:y,alphabet:ka(y),startIndex:x})},v=this.pattern.length;if(v>st){let y=0;const x=v%st,M=v-x;for(;y<M;)p(this.pattern.substr(y,st),y),y+=st;if(x){const j=v-st;p(this.pattern.substr(j),j)}}else p(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:i}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let M={isMatch:!0,score:0};return i&&(M.indices=[[0,e.length-1]]),M}const{location:n,distance:s,threshold:o,findAllMatches:l,minMatchCharLength:a,ignoreLocation:u}=this.options;let p=[],v=0,y=!1;this.chunks.forEach(({pattern:M,alphabet:j,startIndex:q})=>{const{isMatch:J,score:f,indices:g}=Ca(e,M,j,{location:n+q,distance:s,threshold:o,findAllMatches:l,minMatchCharLength:a,includeMatches:i,ignoreLocation:u});J&&(y=!0),v+=f,J&&g&&(p=[...p,...g])});let x={isMatch:y,score:y?v/this.chunks.length:1};return y&&i&&(x.indices=p),x}}class Je{constructor(e){this.pattern=e}static isMultiMatch(e){return In(e,this.multiRegex)}static isSingleMatch(e){return In(e,this.singleRegex)}search(){}}function In(r,e){const t=r.match(e);return t?t[1]:null}class La extends Je{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class Ta extends Je{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const i=e.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,e.length-1]}}}class Ra extends Je{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class Da extends Je{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class Ia extends Je{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class ja extends Je{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class jn extends Je{constructor(e,{location:t=X.location,threshold:i=X.threshold,distance:n=X.distance,includeMatches:s=X.includeMatches,findAllMatches:o=X.findAllMatches,minMatchCharLength:l=X.minMatchCharLength,isCaseSensitive:a=X.isCaseSensitive,ignoreLocation:u=X.ignoreLocation}={}){super(e),this._bitapSearch=new Dn(e,{location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:a,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Nn extends Je{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0,i;const n=[],s=this.pattern.length;for(;(i=e.indexOf(this.pattern,t))>-1;)t=i+s,n.push([i,t-1]);const o=!!n.length;return{isMatch:o,score:o?0:1,indices:n}}}const zr=[La,Nn,Ra,Da,ja,Ia,Ta,jn],Bn=zr.length,Na=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Ba="|";function Fa(r,e={}){return r.split(Ba).map(t=>{let i=t.trim().split(Na).filter(s=>s&&!!s.trim()),n=[];for(let s=0,o=i.length;s<o;s+=1){const l=i[s];let a=!1,u=-1;for(;!a&&++u<Bn;){const p=zr[u];let v=p.isMultiMatch(l);v&&(n.push(new p(v,e)),a=!0)}if(!a)for(u=-1;++u<Bn;){const p=zr[u];let v=p.isSingleMatch(l);if(v){n.push(new p(v,e));break}}}return n})}const Ha=new Set([jn.type,Nn.type]);class Ua{constructor(e,{isCaseSensitive:t=X.isCaseSensitive,includeMatches:i=X.includeMatches,minMatchCharLength:n=X.minMatchCharLength,ignoreLocation:s=X.ignoreLocation,findAllMatches:o=X.findAllMatches,location:l=X.location,threshold:a=X.threshold,distance:u=X.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:o,ignoreLocation:s,location:l,threshold:a,distance:u},this.pattern=t?e:e.toLowerCase(),this.query=Fa(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:n}=this.options;e=n?e:e.toLowerCase();let s=0,o=[],l=0;for(let a=0,u=t.length;a<u;a+=1){const p=t[a];o.length=0,s=0;for(let v=0,y=p.length;v<y;v+=1){const x=p[v],{isMatch:M,indices:j,score:q}=x.search(e);if(M){if(s+=1,l+=q,i){const J=x.constructor.type;Ha.has(J)?o=[...o,...j]:o.push(j)}}else{l=0,s=0,o.length=0;break}}if(s){let v={isMatch:!0,score:l/s};return i&&(v.indices=o),v}}return{isMatch:!1,score:1}}}const Xr=[];function Ya(...r){Xr.push(...r)}function Vr(r,e){for(let t=0,i=Xr.length;t<i;t+=1){let n=Xr[t];if(n.condition(r,e))return new n(r,e)}return new Dn(r,e)}const Vt={AND:"$and",OR:"$or"},Wr={PATH:"$path",PATTERN:"$val"},qr=r=>!!(r[Vt.AND]||r[Vt.OR]),za=r=>!!r[Wr.PATH],Xa=r=>!Xe(r)&&Pn(r)&&!qr(r),Fn=r=>({[Vt.AND]:Object.keys(r).map(e=>({[e]:r[e]}))});function Hn(r,e,{auto:t=!0}={}){const i=n=>{let s=Object.keys(n);const o=za(n);if(!o&&s.length>1&&!qr(n))return i(Fn(n));if(Xa(n)){const a=o?n[Wr.PATH]:s[0],u=o?n[Wr.PATTERN]:n[a];if(!Fe(u))throw new Error(xa(a));const p={keyId:Ur(a),pattern:u};return t&&(p.searcher=Vr(u,e)),p}let l={children:[],operator:s[0]};return s.forEach(a=>{const u=n[a];Xe(u)&&u.forEach(p=>{l.children.push(i(p))})}),l};return qr(r)||(r=Fn(r)),i(r)}function Va(r,{ignoreFieldNorm:e=X.ignoreFieldNorm}){r.forEach(t=>{let i=1;t.matches.forEach(({key:n,norm:s,score:o})=>{const l=n?n.weight:null;i*=Math.pow(o===0&&l?Number.EPSILON:o,(l||1)*(e?1:s))}),t.score=i})}function Wa(r,e){const t=r.matches;e.matches=[],Oe(t)&&t.forEach(i=>{if(!Oe(i.indices)||!i.indices.length)return;const{indices:n,value:s}=i;let o={indices:n,value:s};i.key&&(o.key=i.key.src),i.idx>-1&&(o.refIndex=i.idx),e.matches.push(o)})}function qa(r,e){e.score=r.score}function Ga(r,e,{includeMatches:t=X.includeMatches,includeScore:i=X.includeScore}={}){const n=[];return t&&n.push(Wa),i&&n.push(qa),r.map(s=>{const{idx:o}=s,l={item:e[o],refIndex:o};return n.length&&n.forEach(a=>{a(s,l)}),l})}class yt{constructor(e,t={},i){this.options={...X,...t},this.options.useExtendedSearch,this._keyStore=new Ea(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Yr))throw new Error(ba);this._myIndex=t||Rn(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){Oe(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const t=[];for(let i=0,n=this._docs.length;i<n;i+=1){const s=this._docs[i];e(s,i)&&(this.removeAt(i),i-=1,n-=1,t.push(s))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:i,includeScore:n,shouldSort:s,sortFn:o,ignoreFieldNorm:l}=this.options;let a=Fe(e)?Fe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return Va(a,{ignoreFieldNorm:l}),s&&a.sort(o),Sn(t)&&t>-1&&(a=a.slice(0,t)),Ga(a,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const t=Vr(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach(({v:s,i:o,n:l})=>{if(!Oe(s))return;const{isMatch:a,score:u,indices:p}=t.searchIn(s);a&&n.push({item:s,idx:o,matches:[{score:u,value:s,norm:l,indices:p}]})}),n}_searchLogical(e){const t=Hn(e,this.options),i=(l,a,u)=>{if(!l.children){const{keyId:v,searcher:y}=l,x=this._findMatches({key:this._keyStore.get(v),value:this._myIndex.getValueForItemAtKeyId(a,v),searcher:y});return x&&x.length?[{idx:u,item:a,matches:x}]:[]}const p=[];for(let v=0,y=l.children.length;v<y;v+=1){const x=l.children[v],M=i(x,a,u);if(M.length)p.push(...M);else if(l.operator===Vt.AND)return[]}return p},n=this._myIndex.records,s={},o=[];return n.forEach(({$:l,i:a})=>{if(Oe(l)){let u=i(t,l,a);u.length&&(s[a]||(s[a]={idx:a,item:l,matches:[]},o.push(s[a])),u.forEach(({matches:p})=>{s[a].matches.push(...p)}))}}),o}_searchObjectList(e){const t=Vr(e,this.options),{keys:i,records:n}=this._myIndex,s=[];return n.forEach(({$:o,i:l})=>{if(!Oe(o))return;let a=[];i.forEach((u,p)=>{a.push(...this._findMatches({key:u,value:o[p],searcher:t}))}),a.length&&s.push({idx:l,item:o,matches:a})}),s}_findMatches({key:e,value:t,searcher:i}){if(!Oe(t))return[];let n=[];if(Xe(t))t.forEach(({v:s,i:o,n:l})=>{if(!Oe(s))return;const{isMatch:a,score:u,indices:p}=i.searchIn(s);a&&n.push({score:u,key:e,value:s,idx:o,norm:l,indices:p})});else{const{v:s,n:o}=t,{isMatch:l,score:a,indices:u}=i.searchIn(s);l&&n.push({score:a,key:e,value:s,norm:o,indices:u})}return n}}yt.version="6.6.2",yt.createIndex=Rn,yt.parseIndex=Sa,yt.config=X,yt.parseQuery=Hn,Ya(Ua);const Ka=(r,e="highlight",t="title")=>{const i=(s,o,l)=>{const a=o.split(".");let u;for(u=0;u<a.length-1;u++)s=s[a[u]];s[a[u]]=l},n=(s,o=[])=>{let l="",a=0;return o.forEach(u=>{const p=u[1]+1;l+=[s.substring(a,u[0]),`<mark class="${e}">`,s.substring(u[0],p),"</mark>"].join(""),a=p}),l+=s.substring(a),l};return r.filter(({matches:s})=>s&&s.length).map(({item:s,matches:o})=>{const l={...s};return o.forEach(a=>{a.key===t&&i(l,a.key,n(a.value,a.indices))}),l})};let Un;const Ja=(r,e)=>{Un=new yt(r,{threshold:.4,distance:50,includeMatches:!0,useExtendedSearch:!0,...e})},Za=async(r,e,t)=>{const i=Object.entries(e).filter(([l,a])=>a.type==="text"||a.type==="select"||a.type==="multiselect").reduce((l,[a,u])=>{const p="$or",v=[],y=(x,M)=>{const j={};u.type==="text"?j[x]=`${M}`:j[a]=`="${x}"`,v.push(j)};return Object.entries(u.state).filter(([x,M])=>M).forEach(([x,M])=>y(x,M)),v.length>0&&l.push({[p]:v}),l},[]);let n;if(!(i.length>0)&&t.matchAllWhenEmpty!==!1)n=r;else{const l={$and:[...i]},a=Un.search(l);n=t.enableHighlighting?Ka(a,"highlight",t.titleProperty):a.map(u=>u.item)}const s=Object.entries(e).filter(([l,a])=>a.type==="range").reduce((l,[a,u])=>(l[a]={min:u.state.min,max:u.state.max,format:u.format},l),{});if(Object.keys(s).length>0){const l=[];for(let a=0;a<n.length;a++){const u={};for(const[p,v]of Object.entries(s)){const y=x=>v.format==="date"?Bt(x).unix():x;n[a].hasOwnProperty(p)?Array.isArray(n[a][p])?u[p]=s[p].min<=y(n[a][p][1])&&y(n[a][p][0])<=s[p].max:y(n[a][p])>=s[p].min&&y(n[a][p])<=s[p].max?u[p]=!0:u[p]=!1:u[p]=!0}Object.values(u).every(p=>!!p)&&l.push(n[a])}n=[...l]}const o=Object.entries(e).filter(([l,a])=>a.type==="spatial").reduce((l,[a,u])=>(l[a]={geometry:u.state.geometry,mode:u.state.mode},l),{});if(Object.values(o).map(l=>l.geometry).filter(l=>!!l).length>0){const l=[];for(let a=0;a<n.length;a++){const u={};for(const p of Object.keys(o)){const v=o[p].mode||"within";n[a].hasOwnProperty(p)&&(v==="within"?ha(n[a][p],o[p].geometry):ua(n[a][p],o[p].geometry))?u[p]=!0:u[p]=!1}Object.values(u).every(p=>!!p)&&l.push(n[a])}n=[...l]}return n},Qa=async(r,e,t)=>(await(await fetch(`${t.externalFilter(r,e)}`)).json()).features;var el=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,Ve=(r,e,t,i)=>{for(var n=i>1?void 0:i?tl(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&el(e,t,n),n};class Gr{constructor(){this.aggregateResults=void 0,this.enableHighlighting=!1,this.filterProperties=[],this.inlineMode=!1,this.matchAllWhenEmpty=!0,this.onFilter=()=>{},this.onSelect=()=>{},this.showResults=!0,this.titleProperty="title"}}ye.EOxItemFilter=class extends ks{constructor(){super(...arguments),this._resultAggregation=[],this.filters={},this.items=[],this._config=new Gr,this.apply=e=>{this.items=e.map((i,n)=>({id:`item-${n}`,...i})),this._config.filterProperties.length&&this._config.filterProperties.forEach(i=>{const n={},s=o=>i.format==="date"?Bt(o).unix():parseInt(o);this.items.forEach(o=>{if(i.type==="range"){if(Array.isArray(o[i.key])){const l=[s(o[i.key][0]),s(o[i.key][1])];n.min=n.min!==void 0?Math.min(n.min,l[0]):l[0],n.max=n.max!==void 0?Math.max(n.max,l[1]):l[1]}else{const l=s(o[i.key]);n.min=n.min!==void 0?Math.min(n.min,l):l,n.max=n.max!==void 0?Math.max(n.max,l):l}return}Array.isArray(o[i.key])?o[i.key].forEach(l=>{n[l]=void 0}):i.type==="spatial"?(n.geometry=void 0,n.mode=i.mode||"intersects"):n[o[i.key]]=void 0}),this.filters[i.key||i.keys.join("|")]={...i,type:i.type||"multiselect",state:{...n,...i.state},...i.state&&{dirty:!0},...i.type==="range"&&{min:n.min,max:n.max,format:i.format}}}),this._config.matchAllWhenEmpty!==!1&&(this.results=this.sortResults(this.items),this.requestUpdate()),this._config.aggregateResults&&(this._resultAggregation=[...new Set(this.items.reduce((i,n)=>i.concat(n[this._config.aggregateResults]),[]))].sort((i,n)=>i.localeCompare(n)));const t=[];Object.values(this.filters).forEach(i=>{i.type==="text"?i.keys.forEach(n=>{t.includes(n)||t.push(n)}):(i.type==="select"||i.type==="multiselect")&&(t.includes(i.key)||t.push(i.key))}),Ja(this.items,{keys:t,...this._config.fuseConfig}),this.search()}}set config(e){const t=this._config;this._config={...new Gr,...e},this.requestUpdate("config",t)}get config(){return this._config}async search(){let e;this.config.externalFilter?e=await Qa(this.items,this.filters,this._config):e=await Za(this.items,this.filters,this._config),this.results=this.sortResults(e),this._config.onFilter(this.results,this.filters)}aggregateResults(e,t){return e.filter(i=>{const n=i[this._config.aggregateResults];let s;return this.filters[this._config.aggregateResults]&&(s=Object.keys(this.filters[this._config.aggregateResults]).filter(l=>this.filters[this._config.aggregateResults].state[l])),(s!=null&&s.length?s.includes(t):!0)&&Array.isArray(n)?n.includes(t):n===t})}sortResults(e){return[...e].sort((t,i)=>t[this._config.titleProperty].localeCompare(i[this._config.titleProperty]))}resetFilters(){this.renderRoot.querySelectorAll("[data-type='filter']").forEach(e=>{e.reset()}),this.search()}render(){return he`
|
|
549
|
+
`}};On([Ae()],Fr.prototype,"filterObject",2),Fr=On([qe("eox-itemfilter-text")],Fr);function Xe(r){return Array.isArray?Array.isArray(r):Cn(r)==="[object Array]"}const pa=1/0;function ga(r){if(typeof r=="string")return r;let e=r+"";return e=="0"&&1/r==-pa?"-0":e}function va(r){return r==null?"":ga(r)}function Fe(r){return typeof r=="string"}function Sn(r){return typeof r=="number"}function ma(r){return r===!0||r===!1||ya(r)&&Cn(r)=="[object Boolean]"}function Pn(r){return typeof r=="object"}function ya(r){return Pn(r)&&r!==null}function Oe(r){return r!=null}function Hr(r){return!r.trim().length}function Cn(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}const ic="Extended search is not available",ba="Incorrect 'index' type",xa=r=>`Invalid value for key ${r}`,$a=r=>`Pattern length exceeds max of ${r}.`,wa=r=>`Missing ${r} property in key`,_a=r=>`Property 'weight' in key '${r}' must be a positive integer`,kn=Object.prototype.hasOwnProperty;class Ea{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(i=>{let n=Ln(i);t+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(i=>{i.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Ln(r){let e=null,t=null,i=null,n=1,s=null;if(Fe(r)||Xe(r))i=r,e=Tn(r),t=Ur(r);else{if(!kn.call(r,"name"))throw new Error(wa("name"));const o=r.name;if(i=o,kn.call(r,"weight")&&(n=r.weight,n<=0))throw new Error(_a(o));e=Tn(o),t=Ur(o),s=r.getFn}return{path:e,id:t,weight:n,src:i,getFn:s}}function Tn(r){return Xe(r)?r:r.split(".")}function Ur(r){return Xe(r)?r.join("."):r}function Ma(r,e){let t=[],i=!1;const n=(s,o,l)=>{if(Oe(s))if(!o[l])t.push(s);else{let a=o[l];const u=s[a];if(!Oe(u))return;if(l===o.length-1&&(Fe(u)||Sn(u)||ma(u)))t.push(va(u));else if(Xe(u)){i=!0;for(let p=0,v=u.length;p<v;p+=1)n(u[p],o,l+1)}else o.length&&n(u,o,l+1)}};return n(r,Fe(e)?e.split("."):e,0),i?t:t[0]}var X={...{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(r,e)=>r.score===e.score?r.idx<e.idx?-1:1:r.score<e.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:Ma,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const Aa=/[^ ]+/g;function Oa(r=1,e=3){const t=new Map,i=Math.pow(10,e);return{get(n){const s=n.match(Aa).length;if(t.has(s))return t.get(s);const o=1/Math.pow(s,.5*r),l=parseFloat(Math.round(o*i)/i);return t.set(s,l),l},clear(){t.clear()}}}class Yr{constructor({getFn:e=X.getFn,fieldNormWeight:t=X.fieldNormWeight}={}){this.norm=Oa(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,i)=>{this._keysMap[t.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Fe(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){const t=this.size();Fe(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t<i;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!Oe(e)||Hr(e))return;let i={v:e,i:t,n:this.norm.get(e)};this.records.push(i)}_addObject(e,t){let i={i:t,$:{}};this.keys.forEach((n,s)=>{let o=n.getFn?n.getFn(e):this.getFn(e,n.path);if(Oe(o)){if(Xe(o)){let l=[];const a=[{nestedArrIndex:-1,value:o}];for(;a.length;){const{nestedArrIndex:u,value:p}=a.pop();if(Oe(p))if(Fe(p)&&!Hr(p)){let v={v:p,i:u,n:this.norm.get(p)};l.push(v)}else Xe(p)&&p.forEach((v,y)=>{a.push({nestedArrIndex:y,value:v})})}i.$[s]=l}else if(Fe(o)&&!Hr(o)){let l={v:o,n:this.norm.get(o)};i.$[s]=l}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function Rn(r,e,{getFn:t=X.getFn,fieldNormWeight:i=X.fieldNormWeight}={}){const n=new Yr({getFn:t,fieldNormWeight:i});return n.setKeys(r.map(Ln)),n.setSources(e),n.create(),n}function Sa(r,{getFn:e=X.getFn,fieldNormWeight:t=X.fieldNormWeight}={}){const{keys:i,records:n}=r,s=new Yr({getFn:e,fieldNormWeight:t});return s.setKeys(i),s.setIndexRecords(n),s}function Xt(r,{errors:e=0,currentLocation:t=0,expectedLocation:i=0,distance:n=X.distance,ignoreLocation:s=X.ignoreLocation}={}){const o=e/r.length;if(s)return o;const l=Math.abs(i-t);return n?o+l/n:l?1:o}function Pa(r=[],e=X.minMatchCharLength){let t=[],i=-1,n=-1,s=0;for(let o=r.length;s<o;s+=1){let l=r[s];l&&i===-1?i=s:!l&&i!==-1&&(n=s-1,n-i+1>=e&&t.push([i,n]),i=-1)}return r[s-1]&&s-i>=e&&t.push([i,s-1]),t}const st=32;function Ca(r,e,t,{location:i=X.location,distance:n=X.distance,threshold:s=X.threshold,findAllMatches:o=X.findAllMatches,minMatchCharLength:l=X.minMatchCharLength,includeMatches:a=X.includeMatches,ignoreLocation:u=X.ignoreLocation}={}){if(e.length>st)throw new Error($a(st));const p=e.length,v=r.length,y=Math.max(0,Math.min(i,v));let x=s,M=y;const j=l>1||a,q=j?Array(v):[];let J;for(;(J=r.indexOf(e,M))>-1;){let A=Xt(e,{currentLocation:J,expectedLocation:y,distance:n,ignoreLocation:u});if(x=Math.min(A,x),M=J+p,j){let C=0;for(;C<p;)q[J+C]=1,C+=1}}M=-1;let f=[],g=1,$=p+v;const S=1<<p-1;for(let A=0;A<p;A+=1){let C=0,L=$;for(;C<L;)Xt(e,{errors:A,currentLocation:y+L,expectedLocation:y,distance:n,ignoreLocation:u})<=x?C=L:$=L,L=Math.floor(($-C)/2+C);$=L;let I=Math.max(1,y-L+1),W=o?v:Math.min(y+L,v)+p,re=Array(W+2);re[W+1]=(1<<A)-1;for(let _=W;_>=I;_-=1){let O=_-1,B=t[r.charAt(O)];if(j&&(q[O]=+!!B),re[_]=(re[_+1]<<1|1)&B,A&&(re[_]|=(f[_+1]|f[_])<<1|1|f[_+1]),re[_]&S&&(g=Xt(e,{errors:A,currentLocation:O,expectedLocation:y,distance:n,ignoreLocation:u}),g<=x)){if(x=g,M=O,M<=y)break;I=Math.max(1,2*y-M)}}if(Xt(e,{errors:A+1,currentLocation:y,expectedLocation:y,distance:n,ignoreLocation:u})>x)break;f=re}const E={isMatch:M>=0,score:Math.max(.001,g)};if(j){const A=Pa(q,l);A.length?a&&(E.indices=A):E.isMatch=!1}return E}function ka(r){let e={};for(let t=0,i=r.length;t<i;t+=1){const n=r.charAt(t);e[n]=(e[n]||0)|1<<i-t-1}return e}class Dn{constructor(e,{location:t=X.location,threshold:i=X.threshold,distance:n=X.distance,includeMatches:s=X.includeMatches,findAllMatches:o=X.findAllMatches,minMatchCharLength:l=X.minMatchCharLength,isCaseSensitive:a=X.isCaseSensitive,ignoreLocation:u=X.ignoreLocation}={}){if(this.options={location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:a,ignoreLocation:u},this.pattern=a?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const p=(y,x)=>{this.chunks.push({pattern:y,alphabet:ka(y),startIndex:x})},v=this.pattern.length;if(v>st){let y=0;const x=v%st,M=v-x;for(;y<M;)p(this.pattern.substr(y,st),y),y+=st;if(x){const j=v-st;p(this.pattern.substr(j),j)}}else p(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:i}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let M={isMatch:!0,score:0};return i&&(M.indices=[[0,e.length-1]]),M}const{location:n,distance:s,threshold:o,findAllMatches:l,minMatchCharLength:a,ignoreLocation:u}=this.options;let p=[],v=0,y=!1;this.chunks.forEach(({pattern:M,alphabet:j,startIndex:q})=>{const{isMatch:J,score:f,indices:g}=Ca(e,M,j,{location:n+q,distance:s,threshold:o,findAllMatches:l,minMatchCharLength:a,includeMatches:i,ignoreLocation:u});J&&(y=!0),v+=f,J&&g&&(p=[...p,...g])});let x={isMatch:y,score:y?v/this.chunks.length:1};return y&&i&&(x.indices=p),x}}class Je{constructor(e){this.pattern=e}static isMultiMatch(e){return In(e,this.multiRegex)}static isSingleMatch(e){return In(e,this.singleRegex)}search(){}}function In(r,e){const t=r.match(e);return t?t[1]:null}class La extends Je{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class Ta extends Je{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const i=e.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,e.length-1]}}}class Ra extends Je{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class Da extends Je{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class Ia extends Je{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class ja extends Je{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class jn extends Je{constructor(e,{location:t=X.location,threshold:i=X.threshold,distance:n=X.distance,includeMatches:s=X.includeMatches,findAllMatches:o=X.findAllMatches,minMatchCharLength:l=X.minMatchCharLength,isCaseSensitive:a=X.isCaseSensitive,ignoreLocation:u=X.ignoreLocation}={}){super(e),this._bitapSearch=new Dn(e,{location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:a,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Nn extends Je{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0,i;const n=[],s=this.pattern.length;for(;(i=e.indexOf(this.pattern,t))>-1;)t=i+s,n.push([i,t-1]);const o=!!n.length;return{isMatch:o,score:o?0:1,indices:n}}}const zr=[La,Nn,Ra,Da,ja,Ia,Ta,jn],Bn=zr.length,Na=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Ba="|";function Fa(r,e={}){return r.split(Ba).map(t=>{let i=t.trim().split(Na).filter(s=>s&&!!s.trim()),n=[];for(let s=0,o=i.length;s<o;s+=1){const l=i[s];let a=!1,u=-1;for(;!a&&++u<Bn;){const p=zr[u];let v=p.isMultiMatch(l);v&&(n.push(new p(v,e)),a=!0)}if(!a)for(u=-1;++u<Bn;){const p=zr[u];let v=p.isSingleMatch(l);if(v){n.push(new p(v,e));break}}}return n})}const Ha=new Set([jn.type,Nn.type]);class Ua{constructor(e,{isCaseSensitive:t=X.isCaseSensitive,includeMatches:i=X.includeMatches,minMatchCharLength:n=X.minMatchCharLength,ignoreLocation:s=X.ignoreLocation,findAllMatches:o=X.findAllMatches,location:l=X.location,threshold:a=X.threshold,distance:u=X.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:o,ignoreLocation:s,location:l,threshold:a,distance:u},this.pattern=t?e:e.toLowerCase(),this.query=Fa(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:n}=this.options;e=n?e:e.toLowerCase();let s=0,o=[],l=0;for(let a=0,u=t.length;a<u;a+=1){const p=t[a];o.length=0,s=0;for(let v=0,y=p.length;v<y;v+=1){const x=p[v],{isMatch:M,indices:j,score:q}=x.search(e);if(M){if(s+=1,l+=q,i){const J=x.constructor.type;Ha.has(J)?o=[...o,...j]:o.push(j)}}else{l=0,s=0,o.length=0;break}}if(s){let v={isMatch:!0,score:l/s};return i&&(v.indices=o),v}}return{isMatch:!1,score:1}}}const Xr=[];function Ya(...r){Xr.push(...r)}function Vr(r,e){for(let t=0,i=Xr.length;t<i;t+=1){let n=Xr[t];if(n.condition(r,e))return new n(r,e)}return new Dn(r,e)}const Vt={AND:"$and",OR:"$or"},Wr={PATH:"$path",PATTERN:"$val"},qr=r=>!!(r[Vt.AND]||r[Vt.OR]),za=r=>!!r[Wr.PATH],Xa=r=>!Xe(r)&&Pn(r)&&!qr(r),Fn=r=>({[Vt.AND]:Object.keys(r).map(e=>({[e]:r[e]}))});function Hn(r,e,{auto:t=!0}={}){const i=n=>{let s=Object.keys(n);const o=za(n);if(!o&&s.length>1&&!qr(n))return i(Fn(n));if(Xa(n)){const a=o?n[Wr.PATH]:s[0],u=o?n[Wr.PATTERN]:n[a];if(!Fe(u))throw new Error(xa(a));const p={keyId:Ur(a),pattern:u};return t&&(p.searcher=Vr(u,e)),p}let l={children:[],operator:s[0]};return s.forEach(a=>{const u=n[a];Xe(u)&&u.forEach(p=>{l.children.push(i(p))})}),l};return qr(r)||(r=Fn(r)),i(r)}function Va(r,{ignoreFieldNorm:e=X.ignoreFieldNorm}){r.forEach(t=>{let i=1;t.matches.forEach(({key:n,norm:s,score:o})=>{const l=n?n.weight:null;i*=Math.pow(o===0&&l?Number.EPSILON:o,(l||1)*(e?1:s))}),t.score=i})}function Wa(r,e){const t=r.matches;e.matches=[],Oe(t)&&t.forEach(i=>{if(!Oe(i.indices)||!i.indices.length)return;const{indices:n,value:s}=i;let o={indices:n,value:s};i.key&&(o.key=i.key.src),i.idx>-1&&(o.refIndex=i.idx),e.matches.push(o)})}function qa(r,e){e.score=r.score}function Ga(r,e,{includeMatches:t=X.includeMatches,includeScore:i=X.includeScore}={}){const n=[];return t&&n.push(Wa),i&&n.push(qa),r.map(s=>{const{idx:o}=s,l={item:e[o],refIndex:o};return n.length&&n.forEach(a=>{a(s,l)}),l})}class yt{constructor(e,t={},i){this.options={...X,...t},this.options.useExtendedSearch,this._keyStore=new Ea(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Yr))throw new Error(ba);this._myIndex=t||Rn(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){Oe(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const t=[];for(let i=0,n=this._docs.length;i<n;i+=1){const s=this._docs[i];e(s,i)&&(this.removeAt(i),i-=1,n-=1,t.push(s))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:i,includeScore:n,shouldSort:s,sortFn:o,ignoreFieldNorm:l}=this.options;let a=Fe(e)?Fe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return Va(a,{ignoreFieldNorm:l}),s&&a.sort(o),Sn(t)&&t>-1&&(a=a.slice(0,t)),Ga(a,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const t=Vr(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach(({v:s,i:o,n:l})=>{if(!Oe(s))return;const{isMatch:a,score:u,indices:p}=t.searchIn(s);a&&n.push({item:s,idx:o,matches:[{score:u,value:s,norm:l,indices:p}]})}),n}_searchLogical(e){const t=Hn(e,this.options),i=(l,a,u)=>{if(!l.children){const{keyId:v,searcher:y}=l,x=this._findMatches({key:this._keyStore.get(v),value:this._myIndex.getValueForItemAtKeyId(a,v),searcher:y});return x&&x.length?[{idx:u,item:a,matches:x}]:[]}const p=[];for(let v=0,y=l.children.length;v<y;v+=1){const x=l.children[v],M=i(x,a,u);if(M.length)p.push(...M);else if(l.operator===Vt.AND)return[]}return p},n=this._myIndex.records,s={},o=[];return n.forEach(({$:l,i:a})=>{if(Oe(l)){let u=i(t,l,a);u.length&&(s[a]||(s[a]={idx:a,item:l,matches:[]},o.push(s[a])),u.forEach(({matches:p})=>{s[a].matches.push(...p)}))}}),o}_searchObjectList(e){const t=Vr(e,this.options),{keys:i,records:n}=this._myIndex,s=[];return n.forEach(({$:o,i:l})=>{if(!Oe(o))return;let a=[];i.forEach((u,p)=>{a.push(...this._findMatches({key:u,value:o[p],searcher:t}))}),a.length&&s.push({idx:l,item:o,matches:a})}),s}_findMatches({key:e,value:t,searcher:i}){if(!Oe(t))return[];let n=[];if(Xe(t))t.forEach(({v:s,i:o,n:l})=>{if(!Oe(s))return;const{isMatch:a,score:u,indices:p}=i.searchIn(s);a&&n.push({score:u,key:e,value:s,idx:o,norm:l,indices:p})});else{const{v:s,n:o}=t,{isMatch:l,score:a,indices:u}=i.searchIn(s);l&&n.push({score:a,key:e,value:s,norm:o,indices:u})}return n}}yt.version="6.6.2",yt.createIndex=Rn,yt.parseIndex=Sa,yt.config=X,yt.parseQuery=Hn,Ya(Ua);const Ka=(r,e="highlight",t="title")=>{const i=(s,o,l)=>{const a=o.split(".");let u;for(u=0;u<a.length-1;u++)s=s[a[u]];s[a[u]]=l},n=(s,o=[])=>{let l="",a=0;return o.forEach(u=>{const p=u[1]+1;l+=[s.substring(a,u[0]),`<mark class="${e}">`,s.substring(u[0],p),"</mark>"].join(""),a=p}),l+=s.substring(a),l};return r.filter(({matches:s})=>s&&s.length).map(({item:s,matches:o})=>{const l={...s};return o.forEach(a=>{a.key===t&&i(l,a.key,n(a.value,a.indices))}),l})};let Un;const Ja=(r,e)=>{Un=new yt(r,{threshold:.4,distance:50,includeMatches:!0,useExtendedSearch:!0,...e})},Za=async(r,e,t)=>{const i=Object.entries(e).filter(([l,a])=>a.type==="text"||a.type==="select"||a.type==="multiselect").reduce((l,[a,u])=>{const p="$or",v=[],y=(x,M)=>{const j={};u.type==="text"?j[x]=`${M}`:j[a]=`="${x}"`,v.push(j)};return Object.entries(u.state).filter(([x,M])=>M).forEach(([x,M])=>y(x,M)),v.length>0&&l.push({[p]:v}),l},[]);let n;if(!(i.length>0)&&t.matchAllWhenEmpty!==!1)n=r;else{const l={$and:[...i]},a=Un.search(l);n=t.enableHighlighting?Ka(a,"highlight",t.titleProperty):a.map(u=>u.item)}const s=Object.entries(e).filter(([l,a])=>a.type==="range").reduce((l,[a,u])=>(l[a]={min:u.state.min,max:u.state.max,format:u.format},l),{});if(Object.keys(s).length>0){const l=[];for(let a=0;a<n.length;a++){const u={};for(const[p,v]of Object.entries(s)){const y=x=>v.format==="date"?Bt(x).unix():x;n[a].hasOwnProperty(p)?Array.isArray(n[a][p])?u[p]=s[p].min<=y(n[a][p][1])&&y(n[a][p][0])<=s[p].max:y(n[a][p])>=s[p].min&&y(n[a][p])<=s[p].max?u[p]=!0:u[p]=!1:u[p]=!0}Object.values(u).every(p=>!!p)&&l.push(n[a])}n=[...l]}const o=Object.entries(e).filter(([l,a])=>a.type==="spatial").reduce((l,[a,u])=>(l[a]={geometry:u.state.geometry,mode:u.state.mode},l),{});if(Object.values(o).map(l=>l.geometry).filter(l=>!!l).length>0){const l=[];for(let a=0;a<n.length;a++){const u={};for(const p of Object.keys(o)){const v=o[p].mode||"within";n[a].hasOwnProperty(p)&&(v==="within"?ha(n[a][p],o[p].geometry):ua(n[a][p],o[p].geometry))?u[p]=!0:u[p]=!1}Object.values(u).every(p=>!!p)&&l.push(n[a])}n=[...l]}return n},Qa=async(r,e,t)=>(await(await fetch(`${t.externalFilter(r,e)}`)).json()).features;var el=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,Ve=(r,e,t,i)=>{for(var n=i>1?void 0:i?tl(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&el(e,t,n),n};class Gr{constructor(){this.aggregateResults=void 0,this.enableHighlighting=!1,this.filterProperties=[],this.inlineMode=!1,this.matchAllWhenEmpty=!0,this.onFilter=()=>{},this.onSelect=()=>{},this.showResults=!0,this.titleProperty="title",this.expandMultipleFilters=!0,this.expandMultipleResults=!0}}ye.EOxItemFilter=class extends ks{constructor(){super(...arguments),this._resultAggregation=[],this.filters={},this.items=[],this._config=new Gr,this.apply=e=>{this.items=e.map((i,n)=>({id:`item-${n}`,...i})),this._config.filterProperties.length&&this._config.filterProperties.forEach(i=>{const n={},s=o=>i.format==="date"?Bt(o).unix():parseInt(o);this.items.forEach(o=>{if(i.type==="range"){if(Array.isArray(o[i.key])){const l=[s(o[i.key][0]),s(o[i.key][1])];n.min=n.min!==void 0?Math.min(n.min,l[0]):l[0],n.max=n.max!==void 0?Math.max(n.max,l[1]):l[1]}else{const l=s(o[i.key]);n.min=n.min!==void 0?Math.min(n.min,l):l,n.max=n.max!==void 0?Math.max(n.max,l):l}return}Array.isArray(o[i.key])?o[i.key].forEach(l=>{n[l]=void 0}):i.type==="spatial"?(n.geometry=void 0,n.mode=i.mode||"intersects"):n[o[i.key]]=void 0}),this.filters[i.key||i.keys.join("|")]={...i,type:i.type||"multiselect",state:{...n,...i.state},...i.state&&{dirty:!0},...i.type==="range"&&{min:n.min,max:n.max,format:i.format}}}),this._config.matchAllWhenEmpty!==!1&&(this.results=this.sortResults(this.items),this.requestUpdate()),this._config.aggregateResults&&(this._resultAggregation=[...new Set(this.items.reduce((i,n)=>i.concat(n[this._config.aggregateResults]),[]))].sort((i,n)=>i.localeCompare(n)));const t=[];Object.values(this.filters).forEach(i=>{i.type==="text"?i.keys.forEach(n=>{t.includes(n)||t.push(n)}):(i.type==="select"||i.type==="multiselect")&&(t.includes(i.key)||t.push(i.key))}),Ja(this.items,{keys:t,...this._config.fuseConfig}),this.search()}}set config(e){const t=this._config;this._config={...new Gr,...e},this.requestUpdate("config",t)}get config(){return this._config}async search(){let e;this.config.externalFilter?e=await Qa(this.items,this.filters,this._config):e=await Za(this.items,this.filters,this._config),this.results=this.sortResults(e),this._config.onFilter(this.results,this.filters)}aggregateResults(e,t){return e.filter(i=>{const n=i[this._config.aggregateResults];let s;return this.filters[this._config.aggregateResults]&&(s=Object.keys(this.filters[this._config.aggregateResults]).filter(l=>this.filters[this._config.aggregateResults].state[l])),(s!=null&&s.length?s.includes(t):!0)&&Array.isArray(n)?n.includes(t):n===t})}sortResults(e){return[...e].sort((t,i)=>t[this._config.titleProperty].localeCompare(i[this._config.titleProperty]))}resetFilters(){this.renderRoot.querySelectorAll("[data-type='filter']").forEach(e=>{e.reset()}),this.search()}toggleAccordion(e){let t;if(e.detail?t=e.detail.target:t=e.target,t.classList.contains("details-filter")){if(!t.open||this.config.expandMultipleFilters)return;this.shadowRoot.querySelectorAll("eox-itemfilter-expandcontainer").forEach(i=>{const n=i.shadowRoot.querySelector(".details-filter");n&&n!==t&&n.removeAttribute("open")})}else{if(!t.open||this.config.expandMultipleResults)return;this.shadowRoot.querySelectorAll("details").forEach(i=>{i!==t&&i.removeAttribute("open")})}}render(){return he`
|
|
549
550
|
<style>
|
|
550
551
|
${Ji}
|
|
551
552
|
${!this.unstyled&&Zi}
|
|
@@ -576,6 +577,7 @@ eox-itemfilter-range {
|
|
|
576
577
|
<eox-itemfilter-expandcontainer
|
|
577
578
|
.filterObject=${e}
|
|
578
579
|
.unstyled=${this.unstyled}
|
|
580
|
+
@details-toggled=${this.toggleAccordion}
|
|
579
581
|
>
|
|
580
582
|
<eox-itemfilter-${Nt(e.type)}
|
|
581
583
|
slot="filter"
|
|
@@ -613,6 +615,7 @@ eox-itemfilter-range {
|
|
|
613
615
|
<ul id="results" part="results">
|
|
614
616
|
${this._config.aggregateResults?dt(this._resultAggregation.filter(e=>this.aggregateResults(this.results,e).length),e=>he`<details
|
|
615
617
|
class="details-results"
|
|
618
|
+
@toggle=${this.toggleAccordion}
|
|
616
619
|
open
|
|
617
620
|
>
|
|
618
621
|
<summary>
|
package/package.json
CHANGED
package/test/general.cy.ts
CHANGED
|
@@ -137,4 +137,40 @@ describe("Item Filter Config", () => {
|
|
|
137
137
|
// });
|
|
138
138
|
// });
|
|
139
139
|
// });
|
|
140
|
+
|
|
141
|
+
it('should allow only one accordion of each type to be open at a time if configured', () => {
|
|
142
|
+
cy.get("eox-itemfilter").then(($el) => {
|
|
143
|
+
(<EOxItemFilter>$el[0]).config.expandMultipleFilters = false;
|
|
144
|
+
(<EOxItemFilter>$el[0]).config.expandMultipleResults = false;
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
const checkExclusiveOpen = (selector: string, isSubcomponent = false) => {
|
|
148
|
+
cy.get("eox-itemfilter").shadow().within(() => {
|
|
149
|
+
cy.get(selector).then(accordions => {
|
|
150
|
+
for (let i = 0; i < accordions.length; i++) {
|
|
151
|
+
const accordionToClick = isSubcomponent
|
|
152
|
+
? cy.get(selector).eq(i).find('eox-itemfilter-expandcontainer').shadow().find('details')
|
|
153
|
+
: cy.get(selector).eq(i).find('details');
|
|
154
|
+
|
|
155
|
+
accordionToClick.click({ multiple: true, force: true });
|
|
156
|
+
accordionToClick.should('have.attr', 'open');
|
|
157
|
+
|
|
158
|
+
// Check that all other accordions are closed
|
|
159
|
+
for (let j = 0; j < accordions.length; j++) {
|
|
160
|
+
if (i !== j) {
|
|
161
|
+
const accordionToCheck = isSubcomponent
|
|
162
|
+
? cy.get(selector).eq(j).find('eox-itemfilter-expandcontainer').shadow().find('details')
|
|
163
|
+
: cy.get(selector).eq(j).find('details');
|
|
164
|
+
|
|
165
|
+
accordionToCheck.should('not.have.attr', 'open');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
checkExclusiveOpen('ul#filters', true);
|
|
174
|
+
checkExclusiveOpen('ul#results');
|
|
175
|
+
});
|
|
140
176
|
});
|