@eox/itemfilter 0.4.0 → 0.5.2
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/dist/eox-itemfilter.js +2610 -1279
- package/dist/eox-itemfilter.umd.cjs +101 -93
- package/package.json +3 -2
- package/test/general.cy.ts +7 -2
- package/test/general.html +6 -0
- package/test/testItems.json +120 -20
package/dist/eox-itemfilter.js
CHANGED
|
@@ -1,235 +1,235 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Or = Object.defineProperty;
|
|
2
|
+
var Lr = (i, e, t) => e in i ? Or(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var Z = (i, e, t) => (Lr(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2019 Google LLC
|
|
7
7
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
10
|
-
let
|
|
11
|
-
constructor(
|
|
12
|
-
if (this._$cssResult$ = !0, s !==
|
|
9
|
+
const kt = window, Ms = kt.ShadowRoot && (kt.ShadyCSS === void 0 || kt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, yi = Symbol(), Gs = /* @__PURE__ */ new WeakMap();
|
|
10
|
+
let Tr = class {
|
|
11
|
+
constructor(e, t, s) {
|
|
12
|
+
if (this._$cssResult$ = !0, s !== yi)
|
|
13
13
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
14
|
-
this.cssText =
|
|
14
|
+
this.cssText = e, this.t = t;
|
|
15
15
|
}
|
|
16
16
|
get styleSheet() {
|
|
17
|
-
let
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
const s =
|
|
21
|
-
s && (
|
|
17
|
+
let e = this.o;
|
|
18
|
+
const t = this.t;
|
|
19
|
+
if (Ms && e === void 0) {
|
|
20
|
+
const s = t !== void 0 && t.length === 1;
|
|
21
|
+
s && (e = Gs.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && Gs.set(t, e));
|
|
22
22
|
}
|
|
23
|
-
return
|
|
23
|
+
return e;
|
|
24
24
|
}
|
|
25
25
|
toString() {
|
|
26
26
|
return this.cssText;
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const s = document.createElement("style"),
|
|
32
|
-
|
|
29
|
+
const Dr = (i) => new Tr(typeof i == "string" ? i : i + "", void 0, yi), Rr = (i, e) => {
|
|
30
|
+
Ms ? i.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet) : e.forEach((t) => {
|
|
31
|
+
const s = document.createElement("style"), r = kt.litNonce;
|
|
32
|
+
r !== void 0 && s.setAttribute("nonce", r), s.textContent = t.cssText, i.appendChild(s);
|
|
33
33
|
});
|
|
34
|
-
},
|
|
35
|
-
let
|
|
36
|
-
for (const s of
|
|
37
|
-
|
|
38
|
-
return
|
|
34
|
+
}, Zs = Ms ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((e) => {
|
|
35
|
+
let t = "";
|
|
36
|
+
for (const s of e.cssRules)
|
|
37
|
+
t += s.cssText;
|
|
38
|
+
return Dr(t);
|
|
39
39
|
})(i) : i;
|
|
40
40
|
/**
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright 2017 Google LLC
|
|
43
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
44
|
*/
|
|
45
|
-
var
|
|
46
|
-
const
|
|
47
|
-
switch (
|
|
45
|
+
var os;
|
|
46
|
+
const Ct = window, Qs = Ct.trustedTypes, Pr = Qs ? Qs.emptyScript : "", ei = Ct.reactiveElementPolyfillSupport, gs = { toAttribute(i, e) {
|
|
47
|
+
switch (e) {
|
|
48
48
|
case Boolean:
|
|
49
|
-
i = i ?
|
|
49
|
+
i = i ? Pr : null;
|
|
50
50
|
break;
|
|
51
51
|
case Object:
|
|
52
52
|
case Array:
|
|
53
53
|
i = i == null ? i : JSON.stringify(i);
|
|
54
54
|
}
|
|
55
55
|
return i;
|
|
56
|
-
}, fromAttribute(i,
|
|
57
|
-
let
|
|
58
|
-
switch (
|
|
56
|
+
}, fromAttribute(i, e) {
|
|
57
|
+
let t = i;
|
|
58
|
+
switch (e) {
|
|
59
59
|
case Boolean:
|
|
60
|
-
|
|
60
|
+
t = i !== null;
|
|
61
61
|
break;
|
|
62
62
|
case Number:
|
|
63
|
-
|
|
63
|
+
t = i === null ? null : Number(i);
|
|
64
64
|
break;
|
|
65
65
|
case Object:
|
|
66
66
|
case Array:
|
|
67
67
|
try {
|
|
68
|
-
|
|
68
|
+
t = JSON.parse(i);
|
|
69
69
|
} catch {
|
|
70
|
-
|
|
70
|
+
t = null;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
return
|
|
74
|
-
} },
|
|
75
|
-
let
|
|
73
|
+
return t;
|
|
74
|
+
} }, bi = (i, e) => e !== i && (e == e || i == i), ls = { attribute: !0, type: String, converter: gs, reflect: !1, hasChanged: bi }, vs = "finalized";
|
|
75
|
+
let Qe = class extends HTMLElement {
|
|
76
76
|
constructor() {
|
|
77
77
|
super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this.u();
|
|
78
78
|
}
|
|
79
|
-
static addInitializer(
|
|
80
|
-
var
|
|
81
|
-
this.finalize(), ((
|
|
79
|
+
static addInitializer(e) {
|
|
80
|
+
var t;
|
|
81
|
+
this.finalize(), ((t = this.h) !== null && t !== void 0 ? t : this.h = []).push(e);
|
|
82
82
|
}
|
|
83
83
|
static get observedAttributes() {
|
|
84
84
|
this.finalize();
|
|
85
|
-
const
|
|
86
|
-
return this.elementProperties.forEach((
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
}),
|
|
90
|
-
}
|
|
91
|
-
static createProperty(
|
|
92
|
-
if (
|
|
93
|
-
const s = typeof
|
|
94
|
-
|
|
85
|
+
const e = [];
|
|
86
|
+
return this.elementProperties.forEach((t, s) => {
|
|
87
|
+
const r = this._$Ep(s, t);
|
|
88
|
+
r !== void 0 && (this._$Ev.set(r, s), e.push(r));
|
|
89
|
+
}), e;
|
|
90
|
+
}
|
|
91
|
+
static createProperty(e, t = ls) {
|
|
92
|
+
if (t.state && (t.attribute = !1), this.finalize(), this.elementProperties.set(e, t), !t.noAccessor && !this.prototype.hasOwnProperty(e)) {
|
|
93
|
+
const s = typeof e == "symbol" ? Symbol() : "__" + e, r = this.getPropertyDescriptor(e, s, t);
|
|
94
|
+
r !== void 0 && Object.defineProperty(this.prototype, e, r);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
static getPropertyDescriptor(
|
|
97
|
+
static getPropertyDescriptor(e, t, s) {
|
|
98
98
|
return { get() {
|
|
99
|
-
return this[
|
|
100
|
-
}, set(
|
|
101
|
-
const
|
|
102
|
-
this[
|
|
99
|
+
return this[t];
|
|
100
|
+
}, set(r) {
|
|
101
|
+
const o = this[e];
|
|
102
|
+
this[t] = r, this.requestUpdate(e, o, s);
|
|
103
103
|
}, configurable: !0, enumerable: !0 };
|
|
104
104
|
}
|
|
105
|
-
static getPropertyOptions(
|
|
106
|
-
return this.elementProperties.get(
|
|
105
|
+
static getPropertyOptions(e) {
|
|
106
|
+
return this.elementProperties.get(e) || ls;
|
|
107
107
|
}
|
|
108
108
|
static finalize() {
|
|
109
|
-
if (this.hasOwnProperty(
|
|
109
|
+
if (this.hasOwnProperty(vs))
|
|
110
110
|
return !1;
|
|
111
|
-
this
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
115
|
-
for (const
|
|
116
|
-
this.createProperty(
|
|
111
|
+
this[vs] = !0;
|
|
112
|
+
const e = Object.getPrototypeOf(this);
|
|
113
|
+
if (e.finalize(), e.h !== void 0 && (this.h = [...e.h]), this.elementProperties = new Map(e.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {
|
|
114
|
+
const t = this.properties, s = [...Object.getOwnPropertyNames(t), ...Object.getOwnPropertySymbols(t)];
|
|
115
|
+
for (const r of s)
|
|
116
|
+
this.createProperty(r, t[r]);
|
|
117
117
|
}
|
|
118
118
|
return this.elementStyles = this.finalizeStyles(this.styles), !0;
|
|
119
119
|
}
|
|
120
|
-
static finalizeStyles(
|
|
121
|
-
const
|
|
122
|
-
if (Array.isArray(
|
|
123
|
-
const s = new Set(
|
|
124
|
-
for (const
|
|
125
|
-
|
|
120
|
+
static finalizeStyles(e) {
|
|
121
|
+
const t = [];
|
|
122
|
+
if (Array.isArray(e)) {
|
|
123
|
+
const s = new Set(e.flat(1 / 0).reverse());
|
|
124
|
+
for (const r of s)
|
|
125
|
+
t.unshift(Zs(r));
|
|
126
126
|
} else
|
|
127
|
-
|
|
128
|
-
return
|
|
127
|
+
e !== void 0 && t.push(Zs(e));
|
|
128
|
+
return t;
|
|
129
129
|
}
|
|
130
|
-
static _$Ep(
|
|
131
|
-
const s =
|
|
132
|
-
return s === !1 ? void 0 : typeof s == "string" ? s : typeof
|
|
130
|
+
static _$Ep(e, t) {
|
|
131
|
+
const s = t.attribute;
|
|
132
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
133
133
|
}
|
|
134
134
|
u() {
|
|
135
|
-
var
|
|
136
|
-
this._$E_ = new Promise((
|
|
135
|
+
var e;
|
|
136
|
+
this._$E_ = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), (e = this.constructor.h) === null || e === void 0 || e.forEach((t) => t(this));
|
|
137
137
|
}
|
|
138
|
-
addController(
|
|
139
|
-
var
|
|
140
|
-
((
|
|
138
|
+
addController(e) {
|
|
139
|
+
var t, s;
|
|
140
|
+
((t = this._$ES) !== null && t !== void 0 ? t : this._$ES = []).push(e), this.renderRoot !== void 0 && this.isConnected && ((s = e.hostConnected) === null || s === void 0 || s.call(e));
|
|
141
141
|
}
|
|
142
|
-
removeController(
|
|
143
|
-
var
|
|
144
|
-
(
|
|
142
|
+
removeController(e) {
|
|
143
|
+
var t;
|
|
144
|
+
(t = this._$ES) === null || t === void 0 || t.splice(this._$ES.indexOf(e) >>> 0, 1);
|
|
145
145
|
}
|
|
146
146
|
_$Eg() {
|
|
147
|
-
this.constructor.elementProperties.forEach((
|
|
148
|
-
this.hasOwnProperty(
|
|
147
|
+
this.constructor.elementProperties.forEach((e, t) => {
|
|
148
|
+
this.hasOwnProperty(t) && (this._$Ei.set(t, this[t]), delete this[t]);
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
createRenderRoot() {
|
|
152
|
-
var
|
|
153
|
-
const
|
|
154
|
-
return
|
|
152
|
+
var e;
|
|
153
|
+
const t = (e = this.shadowRoot) !== null && e !== void 0 ? e : this.attachShadow(this.constructor.shadowRootOptions);
|
|
154
|
+
return Rr(t, this.constructor.elementStyles), t;
|
|
155
155
|
}
|
|
156
156
|
connectedCallback() {
|
|
157
|
-
var
|
|
158
|
-
this.renderRoot === void 0 && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (
|
|
157
|
+
var e;
|
|
158
|
+
this.renderRoot === void 0 && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (e = this._$ES) === null || e === void 0 || e.forEach((t) => {
|
|
159
159
|
var s;
|
|
160
|
-
return (s =
|
|
160
|
+
return (s = t.hostConnected) === null || s === void 0 ? void 0 : s.call(t);
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
enableUpdating(
|
|
163
|
+
enableUpdating(e) {
|
|
164
164
|
}
|
|
165
165
|
disconnectedCallback() {
|
|
166
|
-
var
|
|
167
|
-
(
|
|
166
|
+
var e;
|
|
167
|
+
(e = this._$ES) === null || e === void 0 || e.forEach((t) => {
|
|
168
168
|
var s;
|
|
169
|
-
return (s =
|
|
169
|
+
return (s = t.hostDisconnected) === null || s === void 0 ? void 0 : s.call(t);
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
|
-
attributeChangedCallback(
|
|
173
|
-
this._$AK(
|
|
172
|
+
attributeChangedCallback(e, t, s) {
|
|
173
|
+
this._$AK(e, s);
|
|
174
174
|
}
|
|
175
|
-
_$EO(
|
|
176
|
-
var
|
|
177
|
-
const
|
|
178
|
-
if (
|
|
179
|
-
const
|
|
180
|
-
this._$El =
|
|
175
|
+
_$EO(e, t, s = ls) {
|
|
176
|
+
var r;
|
|
177
|
+
const o = this.constructor._$Ep(e, s);
|
|
178
|
+
if (o !== void 0 && s.reflect === !0) {
|
|
179
|
+
const l = (((r = s.converter) === null || r === void 0 ? void 0 : r.toAttribute) !== void 0 ? s.converter : gs).toAttribute(t, s.type);
|
|
180
|
+
this._$El = e, l == null ? this.removeAttribute(o) : this.setAttribute(o, l), this._$El = null;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
_$AK(
|
|
183
|
+
_$AK(e, t) {
|
|
184
184
|
var s;
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
const
|
|
188
|
-
this._$El =
|
|
185
|
+
const r = this.constructor, o = r._$Ev.get(e);
|
|
186
|
+
if (o !== void 0 && this._$El !== o) {
|
|
187
|
+
const l = r.getPropertyOptions(o), c = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((s = l.converter) === null || s === void 0 ? void 0 : s.fromAttribute) !== void 0 ? l.converter : gs;
|
|
188
|
+
this._$El = o, this[o] = c.fromAttribute(t, l.type), this._$El = null;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
requestUpdate(
|
|
192
|
-
let
|
|
193
|
-
|
|
191
|
+
requestUpdate(e, t, s) {
|
|
192
|
+
let r = !0;
|
|
193
|
+
e !== void 0 && (((s = s || this.constructor.getPropertyOptions(e)).hasChanged || bi)(this[e], t) ? (this._$AL.has(e) || this._$AL.set(e, t), s.reflect === !0 && this._$El !== e && (this._$EC === void 0 && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(e, s))) : r = !1), !this.isUpdatePending && r && (this._$E_ = this._$Ej());
|
|
194
194
|
}
|
|
195
195
|
async _$Ej() {
|
|
196
196
|
this.isUpdatePending = !0;
|
|
197
197
|
try {
|
|
198
198
|
await this._$E_;
|
|
199
|
-
} catch (
|
|
200
|
-
Promise.reject(
|
|
199
|
+
} catch (t) {
|
|
200
|
+
Promise.reject(t);
|
|
201
201
|
}
|
|
202
|
-
const
|
|
203
|
-
return
|
|
202
|
+
const e = this.scheduleUpdate();
|
|
203
|
+
return e != null && await e, !this.isUpdatePending;
|
|
204
204
|
}
|
|
205
205
|
scheduleUpdate() {
|
|
206
206
|
return this.performUpdate();
|
|
207
207
|
}
|
|
208
208
|
performUpdate() {
|
|
209
|
-
var
|
|
209
|
+
var e;
|
|
210
210
|
if (!this.isUpdatePending)
|
|
211
211
|
return;
|
|
212
|
-
this.hasUpdated, this._$Ei && (this._$Ei.forEach((
|
|
213
|
-
let
|
|
212
|
+
this.hasUpdated, this._$Ei && (this._$Ei.forEach((r, o) => this[o] = r), this._$Ei = void 0);
|
|
213
|
+
let t = !1;
|
|
214
214
|
const s = this._$AL;
|
|
215
215
|
try {
|
|
216
|
-
|
|
217
|
-
var
|
|
218
|
-
return (
|
|
216
|
+
t = this.shouldUpdate(s), t ? (this.willUpdate(s), (e = this._$ES) === null || e === void 0 || e.forEach((r) => {
|
|
217
|
+
var o;
|
|
218
|
+
return (o = r.hostUpdate) === null || o === void 0 ? void 0 : o.call(r);
|
|
219
219
|
}), this.update(s)) : this._$Ek();
|
|
220
|
-
} catch (
|
|
221
|
-
throw
|
|
220
|
+
} catch (r) {
|
|
221
|
+
throw t = !1, this._$Ek(), r;
|
|
222
222
|
}
|
|
223
|
-
|
|
223
|
+
t && this._$AE(s);
|
|
224
224
|
}
|
|
225
|
-
willUpdate(
|
|
225
|
+
willUpdate(e) {
|
|
226
226
|
}
|
|
227
|
-
_$AE(
|
|
228
|
-
var
|
|
229
|
-
(
|
|
230
|
-
var
|
|
231
|
-
return (
|
|
232
|
-
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(
|
|
227
|
+
_$AE(e) {
|
|
228
|
+
var t;
|
|
229
|
+
(t = this._$ES) === null || t === void 0 || t.forEach((s) => {
|
|
230
|
+
var r;
|
|
231
|
+
return (r = s.hostUpdated) === null || r === void 0 ? void 0 : r.call(s);
|
|
232
|
+
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
233
233
|
}
|
|
234
234
|
_$Ek() {
|
|
235
235
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
@@ -240,104 +240,104 @@ let B = class extends HTMLElement {
|
|
|
240
240
|
getUpdateComplete() {
|
|
241
241
|
return this._$E_;
|
|
242
242
|
}
|
|
243
|
-
shouldUpdate(
|
|
243
|
+
shouldUpdate(e) {
|
|
244
244
|
return !0;
|
|
245
245
|
}
|
|
246
|
-
update(
|
|
247
|
-
this._$EC !== void 0 && (this._$EC.forEach((
|
|
246
|
+
update(e) {
|
|
247
|
+
this._$EC !== void 0 && (this._$EC.forEach((t, s) => this._$EO(s, this[s], t)), this._$EC = void 0), this._$Ek();
|
|
248
248
|
}
|
|
249
|
-
updated(
|
|
249
|
+
updated(e) {
|
|
250
250
|
}
|
|
251
|
-
firstUpdated(
|
|
251
|
+
firstUpdated(e) {
|
|
252
252
|
}
|
|
253
253
|
};
|
|
254
|
-
|
|
254
|
+
Qe[vs] = !0, Qe.elementProperties = /* @__PURE__ */ new Map(), Qe.elementStyles = [], Qe.shadowRootOptions = { mode: "open" }, ei == null || ei({ ReactiveElement: Qe }), ((os = Ct.reactiveElementVersions) !== null && os !== void 0 ? os : Ct.reactiveElementVersions = []).push("1.6.2");
|
|
255
255
|
/**
|
|
256
256
|
* @license
|
|
257
257
|
* Copyright 2017 Google LLC
|
|
258
258
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
259
259
|
*/
|
|
260
|
-
var
|
|
261
|
-
const
|
|
262
|
-
\f\r]`,
|
|
263
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
264
|
-
const
|
|
265
|
-
let
|
|
266
|
-
for (let
|
|
267
|
-
const
|
|
268
|
-
let
|
|
269
|
-
for (;
|
|
270
|
-
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
const c =
|
|
260
|
+
var as;
|
|
261
|
+
const Ot = window, et = Ot.trustedTypes, ti = et ? et.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, ms = "$lit$", Ne = `lit$${(Math.random() + "").slice(9)}$`, $i = "?" + Ne, Ir = `<${$i}>`, Ve = document, ct = () => Ve.createComment(""), ut = (i) => i === null || typeof i != "object" && typeof i != "function", _i = Array.isArray, Nr = (i) => _i(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", hs = `[
|
|
262
|
+
\f\r]`, ot = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, si = /-->/g, ii = />/g, Be = RegExp(`>|${hs}(?:([^\\s"'>=/]+)(${hs}*=${hs}*(?:[^
|
|
263
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ri = /'/g, ni = /"/g, xi = /^(?:script|style|textarea|title)$/i, jr = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), ge = jr(1), Ye = Symbol.for("lit-noChange"), te = Symbol.for("lit-nothing"), oi = /* @__PURE__ */ new WeakMap(), We = Ve.createTreeWalker(Ve, 129, null, !1), Hr = (i, e) => {
|
|
264
|
+
const t = i.length - 1, s = [];
|
|
265
|
+
let r, o = e === 2 ? "<svg>" : "", l = ot;
|
|
266
|
+
for (let u = 0; u < t; u++) {
|
|
267
|
+
const d = i[u];
|
|
268
|
+
let m, v, $ = -1, E = 0;
|
|
269
|
+
for (; E < d.length && (l.lastIndex = E, v = l.exec(d), v !== null); )
|
|
270
|
+
E = l.lastIndex, l === ot ? v[1] === "!--" ? l = si : v[1] !== void 0 ? l = ii : v[2] !== void 0 ? (xi.test(v[2]) && (r = RegExp("</" + v[2], "g")), l = Be) : v[3] !== void 0 && (l = Be) : l === Be ? v[0] === ">" ? (l = r ?? ot, $ = -1) : v[1] === void 0 ? $ = -2 : ($ = l.lastIndex - v[2].length, m = v[1], l = v[3] === void 0 ? Be : v[3] === '"' ? ni : ri) : l === ni || l === ri ? l = Be : l === si || l === ii ? l = ot : (l = Be, r = void 0);
|
|
271
|
+
const j = l === Be && i[u + 1].startsWith("/>") ? " " : "";
|
|
272
|
+
o += l === ot ? d + Ir : $ >= 0 ? (s.push(m), d.slice(0, $) + ms + d.slice($) + Ne + j) : d + Ne + ($ === -2 ? (s.push(void 0), u) : j);
|
|
273
|
+
}
|
|
274
|
+
const c = o + (i[t] || "<?>") + (e === 2 ? "</svg>" : "");
|
|
275
275
|
if (!Array.isArray(i) || !i.hasOwnProperty("raw"))
|
|
276
276
|
throw Error("invalid template strings array");
|
|
277
|
-
return [
|
|
277
|
+
return [ti !== void 0 ? ti.createHTML(c) : c, s];
|
|
278
278
|
};
|
|
279
|
-
class
|
|
280
|
-
constructor({ strings:
|
|
281
|
-
let
|
|
279
|
+
class dt {
|
|
280
|
+
constructor({ strings: e, _$litType$: t }, s) {
|
|
281
|
+
let r;
|
|
282
282
|
this.parts = [];
|
|
283
|
-
let
|
|
284
|
-
const c =
|
|
285
|
-
if (this.el =
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
for (; (
|
|
290
|
-
if (
|
|
291
|
-
if (
|
|
292
|
-
const
|
|
293
|
-
for (const
|
|
294
|
-
if (
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
const
|
|
298
|
-
|
|
283
|
+
let o = 0, l = 0;
|
|
284
|
+
const c = e.length - 1, u = this.parts, [d, m] = Hr(e, t);
|
|
285
|
+
if (this.el = dt.createElement(d, s), We.currentNode = this.el.content, t === 2) {
|
|
286
|
+
const v = this.el.content, $ = v.firstChild;
|
|
287
|
+
$.remove(), v.append(...$.childNodes);
|
|
288
|
+
}
|
|
289
|
+
for (; (r = We.nextNode()) !== null && u.length < c; ) {
|
|
290
|
+
if (r.nodeType === 1) {
|
|
291
|
+
if (r.hasAttributes()) {
|
|
292
|
+
const v = [];
|
|
293
|
+
for (const $ of r.getAttributeNames())
|
|
294
|
+
if ($.endsWith(ms) || $.startsWith(Ne)) {
|
|
295
|
+
const E = m[l++];
|
|
296
|
+
if (v.push($), E !== void 0) {
|
|
297
|
+
const j = r.getAttribute(E.toLowerCase() + ms).split(Ne), G = /([.?@])?(.*)/.exec(E);
|
|
298
|
+
u.push({ type: 1, index: o, name: G[2], strings: j, ctor: G[1] === "." ? Fr : G[1] === "?" ? zr : G[1] === "@" ? Wr : Tt });
|
|
299
299
|
} else
|
|
300
|
-
|
|
300
|
+
u.push({ type: 6, index: o });
|
|
301
301
|
}
|
|
302
|
-
for (const
|
|
303
|
-
|
|
302
|
+
for (const $ of v)
|
|
303
|
+
r.removeAttribute($);
|
|
304
304
|
}
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
308
|
-
|
|
309
|
-
for (let
|
|
310
|
-
|
|
311
|
-
|
|
305
|
+
if (xi.test(r.tagName)) {
|
|
306
|
+
const v = r.textContent.split(Ne), $ = v.length - 1;
|
|
307
|
+
if ($ > 0) {
|
|
308
|
+
r.textContent = et ? et.emptyScript : "";
|
|
309
|
+
for (let E = 0; E < $; E++)
|
|
310
|
+
r.append(v[E], ct()), We.nextNode(), u.push({ type: 2, index: ++o });
|
|
311
|
+
r.append(v[$], ct());
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
} else if (
|
|
315
|
-
if (
|
|
316
|
-
|
|
314
|
+
} else if (r.nodeType === 8)
|
|
315
|
+
if (r.data === $i)
|
|
316
|
+
u.push({ type: 2, index: o });
|
|
317
317
|
else {
|
|
318
|
-
let
|
|
319
|
-
for (; (
|
|
320
|
-
|
|
318
|
+
let v = -1;
|
|
319
|
+
for (; (v = r.data.indexOf(Ne, v + 1)) !== -1; )
|
|
320
|
+
u.push({ type: 7, index: o }), v += Ne.length - 1;
|
|
321
321
|
}
|
|
322
|
-
|
|
322
|
+
o++;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
static createElement(
|
|
326
|
-
const s =
|
|
327
|
-
return s.innerHTML =
|
|
325
|
+
static createElement(e, t) {
|
|
326
|
+
const s = Ve.createElement("template");
|
|
327
|
+
return s.innerHTML = e, s;
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
var
|
|
332
|
-
if (
|
|
333
|
-
return
|
|
334
|
-
let
|
|
335
|
-
const
|
|
336
|
-
return (
|
|
330
|
+
function tt(i, e, t = i, s) {
|
|
331
|
+
var r, o, l, c;
|
|
332
|
+
if (e === Ye)
|
|
333
|
+
return e;
|
|
334
|
+
let u = s !== void 0 ? (r = t._$Co) === null || r === void 0 ? void 0 : r[s] : t._$Cl;
|
|
335
|
+
const d = ut(e) ? void 0 : e._$litDirective$;
|
|
336
|
+
return (u == null ? void 0 : u.constructor) !== d && ((o = u == null ? void 0 : u._$AO) === null || o === void 0 || o.call(u, !1), d === void 0 ? u = void 0 : (u = new d(i), u._$AT(i, t, s)), s !== void 0 ? ((l = (c = t)._$Co) !== null && l !== void 0 ? l : c._$Co = [])[s] = u : t._$Cl = u), u !== void 0 && (e = tt(i, u._$AS(i, e.values), u, s)), e;
|
|
337
337
|
}
|
|
338
|
-
class
|
|
339
|
-
constructor(
|
|
340
|
-
this._$AV = [], this._$AN = void 0, this._$AD =
|
|
338
|
+
class Ur {
|
|
339
|
+
constructor(e, t) {
|
|
340
|
+
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
341
341
|
}
|
|
342
342
|
get parentNode() {
|
|
343
343
|
return this._$AM.parentNode;
|
|
@@ -345,39 +345,39 @@ class Me {
|
|
|
345
345
|
get _$AU() {
|
|
346
346
|
return this._$AM._$AU;
|
|
347
347
|
}
|
|
348
|
-
u(
|
|
349
|
-
var
|
|
350
|
-
const { el: { content: s }, parts:
|
|
351
|
-
|
|
352
|
-
let
|
|
353
|
-
for (;
|
|
354
|
-
if (c ===
|
|
355
|
-
let
|
|
356
|
-
|
|
348
|
+
u(e) {
|
|
349
|
+
var t;
|
|
350
|
+
const { el: { content: s }, parts: r } = this._$AD, o = ((t = e == null ? void 0 : e.creationScope) !== null && t !== void 0 ? t : Ve).importNode(s, !0);
|
|
351
|
+
We.currentNode = o;
|
|
352
|
+
let l = We.nextNode(), c = 0, u = 0, d = r[0];
|
|
353
|
+
for (; d !== void 0; ) {
|
|
354
|
+
if (c === d.index) {
|
|
355
|
+
let m;
|
|
356
|
+
d.type === 2 ? m = new pt(l, l.nextSibling, this, e) : d.type === 1 ? m = new d.ctor(l, d.name, d.strings, this, e) : d.type === 6 && (m = new Vr(l, this, e)), this._$AV.push(m), d = r[++u];
|
|
357
357
|
}
|
|
358
|
-
c !== (
|
|
358
|
+
c !== (d == null ? void 0 : d.index) && (l = We.nextNode(), c++);
|
|
359
359
|
}
|
|
360
|
-
return
|
|
360
|
+
return We.currentNode = Ve, o;
|
|
361
361
|
}
|
|
362
|
-
v(
|
|
363
|
-
let
|
|
362
|
+
v(e) {
|
|
363
|
+
let t = 0;
|
|
364
364
|
for (const s of this._$AV)
|
|
365
|
-
s !== void 0 && (s.strings !== void 0 ? (s._$AI(
|
|
365
|
+
s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, t), t += s.strings.length - 2) : s._$AI(e[t])), t++;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
class
|
|
369
|
-
constructor(
|
|
370
|
-
var
|
|
371
|
-
this.type = 2, this._$AH =
|
|
368
|
+
class pt {
|
|
369
|
+
constructor(e, t, s, r) {
|
|
370
|
+
var o;
|
|
371
|
+
this.type = 2, this._$AH = te, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = r, this._$Cp = (o = r == null ? void 0 : r.isConnected) === null || o === void 0 || o;
|
|
372
372
|
}
|
|
373
373
|
get _$AU() {
|
|
374
|
-
var
|
|
375
|
-
return (
|
|
374
|
+
var e, t;
|
|
375
|
+
return (t = (e = this._$AM) === null || e === void 0 ? void 0 : e._$AU) !== null && t !== void 0 ? t : this._$Cp;
|
|
376
376
|
}
|
|
377
377
|
get parentNode() {
|
|
378
|
-
let
|
|
379
|
-
const
|
|
380
|
-
return
|
|
378
|
+
let e = this._$AA.parentNode;
|
|
379
|
+
const t = this._$AM;
|
|
380
|
+
return t !== void 0 && (e == null ? void 0 : e.nodeType) === 11 && (e = t.parentNode), e;
|
|
381
381
|
}
|
|
382
382
|
get startNode() {
|
|
383
383
|
return this._$AA;
|
|
@@ -385,55 +385,55 @@ class et {
|
|
|
385
385
|
get endNode() {
|
|
386
386
|
return this._$AB;
|
|
387
387
|
}
|
|
388
|
-
_$AI(
|
|
389
|
-
|
|
388
|
+
_$AI(e, t = this) {
|
|
389
|
+
e = tt(this, e, t), ut(e) ? e === te || e == null || e === "" ? (this._$AH !== te && this._$AR(), this._$AH = te) : e !== this._$AH && e !== Ye && this._(e) : e._$litType$ !== void 0 ? this.g(e) : e.nodeType !== void 0 ? this.$(e) : Nr(e) ? this.T(e) : this._(e);
|
|
390
390
|
}
|
|
391
|
-
k(
|
|
392
|
-
return this._$AA.parentNode.insertBefore(
|
|
391
|
+
k(e) {
|
|
392
|
+
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
393
393
|
}
|
|
394
|
-
$(
|
|
395
|
-
this._$AH !==
|
|
394
|
+
$(e) {
|
|
395
|
+
this._$AH !== e && (this._$AR(), this._$AH = this.k(e));
|
|
396
396
|
}
|
|
397
|
-
_(
|
|
398
|
-
this._$AH !==
|
|
397
|
+
_(e) {
|
|
398
|
+
this._$AH !== te && ut(this._$AH) ? this._$AA.nextSibling.data = e : this.$(Ve.createTextNode(e)), this._$AH = e;
|
|
399
399
|
}
|
|
400
|
-
g(
|
|
401
|
-
var
|
|
402
|
-
const { values: s, _$litType$:
|
|
403
|
-
if (((
|
|
400
|
+
g(e) {
|
|
401
|
+
var t;
|
|
402
|
+
const { values: s, _$litType$: r } = e, o = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = dt.createElement(r.h, this.options)), r);
|
|
403
|
+
if (((t = this._$AH) === null || t === void 0 ? void 0 : t._$AD) === o)
|
|
404
404
|
this._$AH.v(s);
|
|
405
405
|
else {
|
|
406
|
-
const
|
|
407
|
-
|
|
406
|
+
const l = new Ur(o, this), c = l.u(this.options);
|
|
407
|
+
l.v(s), this.$(c), this._$AH = l;
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
_$AC(
|
|
411
|
-
let
|
|
412
|
-
return
|
|
410
|
+
_$AC(e) {
|
|
411
|
+
let t = oi.get(e.strings);
|
|
412
|
+
return t === void 0 && oi.set(e.strings, t = new dt(e)), t;
|
|
413
413
|
}
|
|
414
|
-
T(
|
|
415
|
-
|
|
416
|
-
const
|
|
417
|
-
let s,
|
|
418
|
-
for (const
|
|
419
|
-
|
|
420
|
-
|
|
414
|
+
T(e) {
|
|
415
|
+
_i(this._$AH) || (this._$AH = [], this._$AR());
|
|
416
|
+
const t = this._$AH;
|
|
417
|
+
let s, r = 0;
|
|
418
|
+
for (const o of e)
|
|
419
|
+
r === t.length ? t.push(s = new pt(this.k(ct()), this.k(ct()), this, this.options)) : s = t[r], s._$AI(o), r++;
|
|
420
|
+
r < t.length && (this._$AR(s && s._$AB.nextSibling, r), t.length = r);
|
|
421
421
|
}
|
|
422
|
-
_$AR(
|
|
422
|
+
_$AR(e = this._$AA.nextSibling, t) {
|
|
423
423
|
var s;
|
|
424
|
-
for ((s = this._$AP) === null || s === void 0 || s.call(this, !1, !0,
|
|
425
|
-
const
|
|
426
|
-
|
|
424
|
+
for ((s = this._$AP) === null || s === void 0 || s.call(this, !1, !0, t); e && e !== this._$AB; ) {
|
|
425
|
+
const r = e.nextSibling;
|
|
426
|
+
e.remove(), e = r;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
setConnected(
|
|
430
|
-
var
|
|
431
|
-
this._$AM === void 0 && (this._$Cp =
|
|
429
|
+
setConnected(e) {
|
|
430
|
+
var t;
|
|
431
|
+
this._$AM === void 0 && (this._$Cp = e, (t = this._$AP) === null || t === void 0 || t.call(this, e));
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
class
|
|
435
|
-
constructor(
|
|
436
|
-
this.type = 1, this._$AH =
|
|
434
|
+
class Tt {
|
|
435
|
+
constructor(e, t, s, r, o) {
|
|
436
|
+
this.type = 1, this._$AH = te, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = te;
|
|
437
437
|
}
|
|
438
438
|
get tagName() {
|
|
439
439
|
return this.element.tagName;
|
|
@@ -441,175 +441,175 @@ class at {
|
|
|
441
441
|
get _$AU() {
|
|
442
442
|
return this._$AM._$AU;
|
|
443
443
|
}
|
|
444
|
-
_$AI(
|
|
445
|
-
const
|
|
446
|
-
let
|
|
447
|
-
if (
|
|
448
|
-
|
|
444
|
+
_$AI(e, t = this, s, r) {
|
|
445
|
+
const o = this.strings;
|
|
446
|
+
let l = !1;
|
|
447
|
+
if (o === void 0)
|
|
448
|
+
e = tt(this, e, t, 0), l = !ut(e) || e !== this._$AH && e !== Ye, l && (this._$AH = e);
|
|
449
449
|
else {
|
|
450
|
-
const c =
|
|
451
|
-
let
|
|
452
|
-
for (
|
|
453
|
-
|
|
450
|
+
const c = e;
|
|
451
|
+
let u, d;
|
|
452
|
+
for (e = o[0], u = 0; u < o.length - 1; u++)
|
|
453
|
+
d = tt(this, c[s + u], t, u), d === Ye && (d = this._$AH[u]), l || (l = !ut(d) || d !== this._$AH[u]), d === te ? e = te : e !== te && (e += (d ?? "") + o[u + 1]), this._$AH[u] = d;
|
|
454
454
|
}
|
|
455
|
-
|
|
455
|
+
l && !r && this.j(e);
|
|
456
456
|
}
|
|
457
|
-
j(
|
|
458
|
-
|
|
457
|
+
j(e) {
|
|
458
|
+
e === te ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
class
|
|
461
|
+
class Fr extends Tt {
|
|
462
462
|
constructor() {
|
|
463
463
|
super(...arguments), this.type = 3;
|
|
464
464
|
}
|
|
465
|
-
j(
|
|
466
|
-
this.element[this.name] =
|
|
465
|
+
j(e) {
|
|
466
|
+
this.element[this.name] = e === te ? void 0 : e;
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
const
|
|
470
|
-
class
|
|
469
|
+
const Br = et ? et.emptyScript : "";
|
|
470
|
+
class zr extends Tt {
|
|
471
471
|
constructor() {
|
|
472
472
|
super(...arguments), this.type = 4;
|
|
473
473
|
}
|
|
474
|
-
j(
|
|
475
|
-
|
|
474
|
+
j(e) {
|
|
475
|
+
e && e !== te ? this.element.setAttribute(this.name, Br) : this.element.removeAttribute(this.name);
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
-
class
|
|
479
|
-
constructor(
|
|
480
|
-
super(
|
|
478
|
+
class Wr extends Tt {
|
|
479
|
+
constructor(e, t, s, r, o) {
|
|
480
|
+
super(e, t, s, r, o), this.type = 5;
|
|
481
481
|
}
|
|
482
|
-
_$AI(
|
|
482
|
+
_$AI(e, t = this) {
|
|
483
483
|
var s;
|
|
484
|
-
if ((
|
|
484
|
+
if ((e = (s = tt(this, e, t, 0)) !== null && s !== void 0 ? s : te) === Ye)
|
|
485
485
|
return;
|
|
486
|
-
const
|
|
487
|
-
|
|
486
|
+
const r = this._$AH, o = e === te && r !== te || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, l = e !== te && (r === te || o);
|
|
487
|
+
o && this.element.removeEventListener(this.name, this, r), l && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
488
488
|
}
|
|
489
|
-
handleEvent(
|
|
490
|
-
var
|
|
491
|
-
typeof this._$AH == "function" ? this._$AH.call((s = (
|
|
489
|
+
handleEvent(e) {
|
|
490
|
+
var t, s;
|
|
491
|
+
typeof this._$AH == "function" ? this._$AH.call((s = (t = this.options) === null || t === void 0 ? void 0 : t.host) !== null && s !== void 0 ? s : this.element, e) : this._$AH.handleEvent(e);
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
class
|
|
495
|
-
constructor(
|
|
496
|
-
this.element =
|
|
494
|
+
class Vr {
|
|
495
|
+
constructor(e, t, s) {
|
|
496
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
|
|
497
497
|
}
|
|
498
498
|
get _$AU() {
|
|
499
499
|
return this._$AM._$AU;
|
|
500
500
|
}
|
|
501
|
-
_$AI(
|
|
502
|
-
|
|
501
|
+
_$AI(e) {
|
|
502
|
+
tt(this, e);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
const
|
|
508
|
-
var s,
|
|
509
|
-
const
|
|
510
|
-
let
|
|
511
|
-
if (
|
|
512
|
-
const c = (
|
|
513
|
-
|
|
505
|
+
const li = Ot.litHtmlPolyfillSupport;
|
|
506
|
+
li == null || li(dt, pt), ((as = Ot.litHtmlVersions) !== null && as !== void 0 ? as : Ot.litHtmlVersions = []).push("2.7.4");
|
|
507
|
+
const Yr = (i, e, t) => {
|
|
508
|
+
var s, r;
|
|
509
|
+
const o = (s = t == null ? void 0 : t.renderBefore) !== null && s !== void 0 ? s : e;
|
|
510
|
+
let l = o._$litPart$;
|
|
511
|
+
if (l === void 0) {
|
|
512
|
+
const c = (r = t == null ? void 0 : t.renderBefore) !== null && r !== void 0 ? r : null;
|
|
513
|
+
o._$litPart$ = l = new pt(e.insertBefore(ct(), c), c, void 0, t ?? {});
|
|
514
514
|
}
|
|
515
|
-
return
|
|
515
|
+
return l._$AI(i), l;
|
|
516
516
|
};
|
|
517
517
|
/**
|
|
518
518
|
* @license
|
|
519
519
|
* Copyright 2017 Google LLC
|
|
520
520
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
521
521
|
*/
|
|
522
|
-
var
|
|
523
|
-
class
|
|
522
|
+
var cs, us;
|
|
523
|
+
class ht extends Qe {
|
|
524
524
|
constructor() {
|
|
525
525
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
526
526
|
}
|
|
527
527
|
createRenderRoot() {
|
|
528
|
-
var
|
|
528
|
+
var e, t;
|
|
529
529
|
const s = super.createRenderRoot();
|
|
530
|
-
return (
|
|
530
|
+
return (e = (t = this.renderOptions).renderBefore) !== null && e !== void 0 || (t.renderBefore = s.firstChild), s;
|
|
531
531
|
}
|
|
532
|
-
update(
|
|
533
|
-
const
|
|
534
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(
|
|
532
|
+
update(e) {
|
|
533
|
+
const t = this.render();
|
|
534
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Yr(t, this.renderRoot, this.renderOptions);
|
|
535
535
|
}
|
|
536
536
|
connectedCallback() {
|
|
537
|
-
var
|
|
538
|
-
super.connectedCallback(), (
|
|
537
|
+
var e;
|
|
538
|
+
super.connectedCallback(), (e = this._$Do) === null || e === void 0 || e.setConnected(!0);
|
|
539
539
|
}
|
|
540
540
|
disconnectedCallback() {
|
|
541
|
-
var
|
|
542
|
-
super.disconnectedCallback(), (
|
|
541
|
+
var e;
|
|
542
|
+
super.disconnectedCallback(), (e = this._$Do) === null || e === void 0 || e.setConnected(!1);
|
|
543
543
|
}
|
|
544
544
|
render() {
|
|
545
|
-
return
|
|
545
|
+
return Ye;
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
((
|
|
548
|
+
ht.finalized = !0, ht._$litElement$ = !0, (cs = globalThis.litElementHydrateSupport) === null || cs === void 0 || cs.call(globalThis, { LitElement: ht });
|
|
549
|
+
const ai = globalThis.litElementPolyfillSupport;
|
|
550
|
+
ai == null || ai({ LitElement: ht });
|
|
551
|
+
((us = globalThis.litElementVersions) !== null && us !== void 0 ? us : globalThis.litElementVersions = []).push("3.3.2");
|
|
552
552
|
/**
|
|
553
553
|
* @license
|
|
554
554
|
* Copyright 2017 Google LLC
|
|
555
555
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
556
556
|
*/
|
|
557
|
-
const
|
|
558
|
-
const { kind:
|
|
559
|
-
return { kind:
|
|
560
|
-
customElements.define(
|
|
557
|
+
const Kr = (i) => (e) => typeof e == "function" ? ((t, s) => (customElements.define(t, s), s))(i, e) : ((t, s) => {
|
|
558
|
+
const { kind: r, elements: o } = s;
|
|
559
|
+
return { kind: r, elements: o, finisher(l) {
|
|
560
|
+
customElements.define(t, l);
|
|
561
561
|
} };
|
|
562
|
-
})(i,
|
|
562
|
+
})(i, e);
|
|
563
563
|
/**
|
|
564
564
|
* @license
|
|
565
565
|
* Copyright 2017 Google LLC
|
|
566
566
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
567
567
|
*/
|
|
568
|
-
const
|
|
569
|
-
|
|
570
|
-
} } : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey:
|
|
571
|
-
typeof
|
|
572
|
-
}, finisher(
|
|
573
|
-
|
|
574
|
-
} }
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
568
|
+
const qr = (i, e) => e.kind === "method" && e.descriptor && !("value" in e.descriptor) ? { ...e, finisher(t) {
|
|
569
|
+
t.createProperty(e.key, i);
|
|
570
|
+
} } : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: e.key, initializer() {
|
|
571
|
+
typeof e.initializer == "function" && (this[e.key] = e.initializer.call(this));
|
|
572
|
+
}, finisher(t) {
|
|
573
|
+
t.createProperty(e.key, i);
|
|
574
|
+
} }, Xr = (i, e, t) => {
|
|
575
|
+
e.constructor.createProperty(t, i);
|
|
576
|
+
};
|
|
577
|
+
function Dt(i) {
|
|
578
|
+
return (e, t) => t !== void 0 ? Xr(i, e, t) : qr(i, e);
|
|
579
579
|
}
|
|
580
580
|
/**
|
|
581
581
|
* @license
|
|
582
582
|
* Copyright 2017 Google LLC
|
|
583
583
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
584
584
|
*/
|
|
585
|
-
function
|
|
586
|
-
return
|
|
585
|
+
function Rt(i) {
|
|
586
|
+
return Dt({ ...i, state: !0 });
|
|
587
587
|
}
|
|
588
588
|
/**
|
|
589
589
|
* @license
|
|
590
590
|
* Copyright 2021 Google LLC
|
|
591
591
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
592
592
|
*/
|
|
593
|
-
var
|
|
594
|
-
((
|
|
593
|
+
var ds;
|
|
594
|
+
((ds = window.HTMLSlotElement) === null || ds === void 0 ? void 0 : ds.prototype.assignedElements) != null;
|
|
595
595
|
/**
|
|
596
596
|
* @license
|
|
597
597
|
* Copyright 2021 Google LLC
|
|
598
598
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
599
599
|
*/
|
|
600
|
-
function
|
|
601
|
-
return i ?
|
|
600
|
+
function Ze(i, e, t) {
|
|
601
|
+
return i ? e() : t == null ? void 0 : t();
|
|
602
602
|
}
|
|
603
603
|
/**
|
|
604
604
|
* @license
|
|
605
605
|
* Copyright 2021 Google LLC
|
|
606
606
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
607
607
|
*/
|
|
608
|
-
function*
|
|
608
|
+
function* lt(i, e) {
|
|
609
609
|
if (i !== void 0) {
|
|
610
|
-
let
|
|
610
|
+
let t = 0;
|
|
611
611
|
for (const s of i)
|
|
612
|
-
yield
|
|
612
|
+
yield e(s, t++);
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
/**
|
|
@@ -617,21 +617,21 @@ function* X(i, t) {
|
|
|
617
617
|
* Copyright 2017 Google LLC
|
|
618
618
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
619
619
|
*/
|
|
620
|
-
const
|
|
621
|
-
class
|
|
622
|
-
constructor(
|
|
620
|
+
const Jr = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, Gr = (i) => (...e) => ({ _$litDirective$: i, values: e });
|
|
621
|
+
class Zr {
|
|
622
|
+
constructor(e) {
|
|
623
623
|
}
|
|
624
624
|
get _$AU() {
|
|
625
625
|
return this._$AM._$AU;
|
|
626
626
|
}
|
|
627
|
-
_$AT(
|
|
628
|
-
this._$Ct =
|
|
627
|
+
_$AT(e, t, s) {
|
|
628
|
+
this._$Ct = e, this._$AM = t, this._$Ci = s;
|
|
629
629
|
}
|
|
630
|
-
_$AS(
|
|
631
|
-
return this.update(
|
|
630
|
+
_$AS(e, t) {
|
|
631
|
+
return this.update(e, t);
|
|
632
632
|
}
|
|
633
|
-
update(
|
|
634
|
-
return this.render(...
|
|
633
|
+
update(e, t) {
|
|
634
|
+
return this.render(...t);
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
/**
|
|
@@ -639,78 +639,78 @@ class He {
|
|
|
639
639
|
* Copyright 2017 Google LLC
|
|
640
640
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
641
641
|
*/
|
|
642
|
-
class
|
|
643
|
-
constructor(
|
|
644
|
-
if (super(
|
|
642
|
+
class ys extends Zr {
|
|
643
|
+
constructor(e) {
|
|
644
|
+
if (super(e), this.et = te, e.type !== Jr.CHILD)
|
|
645
645
|
throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
646
646
|
}
|
|
647
|
-
render(
|
|
648
|
-
if (
|
|
649
|
-
return this.ft = void 0, this.et =
|
|
650
|
-
if (
|
|
651
|
-
return
|
|
652
|
-
if (typeof
|
|
647
|
+
render(e) {
|
|
648
|
+
if (e === te || e == null)
|
|
649
|
+
return this.ft = void 0, this.et = e;
|
|
650
|
+
if (e === Ye)
|
|
651
|
+
return e;
|
|
652
|
+
if (typeof e != "string")
|
|
653
653
|
throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
654
|
-
if (
|
|
654
|
+
if (e === this.et)
|
|
655
655
|
return this.ft;
|
|
656
|
-
this.et =
|
|
657
|
-
const
|
|
658
|
-
return
|
|
656
|
+
this.et = e;
|
|
657
|
+
const t = [e];
|
|
658
|
+
return t.raw = t, this.ft = { _$litType$: this.constructor.resultType, strings: t, values: [] };
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
|
|
662
|
-
const
|
|
663
|
-
function
|
|
664
|
-
return Array.isArray ? Array.isArray(i) :
|
|
661
|
+
ys.directiveName = "unsafeHTML", ys.resultType = 1;
|
|
662
|
+
const hi = Gr(ys);
|
|
663
|
+
function Re(i) {
|
|
664
|
+
return Array.isArray ? Array.isArray(i) : Ei(i) === "[object Array]";
|
|
665
665
|
}
|
|
666
|
-
const
|
|
667
|
-
function
|
|
666
|
+
const Qr = 1 / 0;
|
|
667
|
+
function en(i) {
|
|
668
668
|
if (typeof i == "string")
|
|
669
669
|
return i;
|
|
670
|
-
let
|
|
671
|
-
return
|
|
670
|
+
let e = i + "";
|
|
671
|
+
return e == "0" && 1 / i == -Qr ? "-0" : e;
|
|
672
672
|
}
|
|
673
|
-
function
|
|
674
|
-
return i == null ? "" :
|
|
673
|
+
function tn(i) {
|
|
674
|
+
return i == null ? "" : en(i);
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function De(i) {
|
|
677
677
|
return typeof i == "string";
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function wi(i) {
|
|
680
680
|
return typeof i == "number";
|
|
681
681
|
}
|
|
682
|
-
function
|
|
683
|
-
return i === !0 || i === !1 ||
|
|
682
|
+
function sn(i) {
|
|
683
|
+
return i === !0 || i === !1 || rn(i) && Ei(i) == "[object Boolean]";
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function Ai(i) {
|
|
686
686
|
return typeof i == "object";
|
|
687
687
|
}
|
|
688
|
-
function
|
|
689
|
-
return
|
|
688
|
+
function rn(i) {
|
|
689
|
+
return Ai(i) && i !== null;
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function xe(i) {
|
|
692
692
|
return i != null;
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function ps(i) {
|
|
695
695
|
return !i.trim().length;
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function Ei(i) {
|
|
698
698
|
return i == null ? i === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(i);
|
|
699
699
|
}
|
|
700
|
-
const
|
|
701
|
-
class
|
|
702
|
-
constructor(
|
|
700
|
+
const nn = "Incorrect 'index' type", on = (i) => `Invalid value for key ${i}`, ln = (i) => `Pattern length exceeds max of ${i}.`, an = (i) => `Missing ${i} property in key`, hn = (i) => `Property 'weight' in key '${i}' must be a positive integer`, ci = Object.prototype.hasOwnProperty;
|
|
701
|
+
class cn {
|
|
702
|
+
constructor(e) {
|
|
703
703
|
this._keys = [], this._keyMap = {};
|
|
704
|
-
let
|
|
705
|
-
|
|
706
|
-
let
|
|
707
|
-
|
|
704
|
+
let t = 0;
|
|
705
|
+
e.forEach((s) => {
|
|
706
|
+
let r = Mi(s);
|
|
707
|
+
t += r.weight, this._keys.push(r), this._keyMap[r.id] = r, t += r.weight;
|
|
708
708
|
}), this._keys.forEach((s) => {
|
|
709
|
-
s.weight /=
|
|
709
|
+
s.weight /= t;
|
|
710
710
|
});
|
|
711
711
|
}
|
|
712
|
-
get(
|
|
713
|
-
return this._keyMap[
|
|
712
|
+
get(e) {
|
|
713
|
+
return this._keyMap[e];
|
|
714
714
|
}
|
|
715
715
|
keys() {
|
|
716
716
|
return this._keys;
|
|
@@ -719,50 +719,50 @@ class Je {
|
|
|
719
719
|
return JSON.stringify(this._keys);
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
|
-
function
|
|
723
|
-
let
|
|
724
|
-
if (
|
|
725
|
-
s = i,
|
|
722
|
+
function Mi(i) {
|
|
723
|
+
let e = null, t = null, s = null, r = 1, o = null;
|
|
724
|
+
if (De(i) || Re(i))
|
|
725
|
+
s = i, e = ui(i), t = bs(i);
|
|
726
726
|
else {
|
|
727
|
-
if (!
|
|
728
|
-
throw new Error(
|
|
729
|
-
const
|
|
730
|
-
if (s =
|
|
731
|
-
throw new Error(
|
|
732
|
-
|
|
733
|
-
}
|
|
734
|
-
return { path:
|
|
735
|
-
}
|
|
736
|
-
function
|
|
737
|
-
return
|
|
738
|
-
}
|
|
739
|
-
function
|
|
740
|
-
return
|
|
741
|
-
}
|
|
742
|
-
function
|
|
743
|
-
let
|
|
744
|
-
const
|
|
745
|
-
if (
|
|
746
|
-
if (!
|
|
747
|
-
|
|
727
|
+
if (!ci.call(i, "name"))
|
|
728
|
+
throw new Error(an("name"));
|
|
729
|
+
const l = i.name;
|
|
730
|
+
if (s = l, ci.call(i, "weight") && (r = i.weight, r <= 0))
|
|
731
|
+
throw new Error(hn(l));
|
|
732
|
+
e = ui(l), t = bs(l), o = i.getFn;
|
|
733
|
+
}
|
|
734
|
+
return { path: e, id: t, weight: r, src: s, getFn: o };
|
|
735
|
+
}
|
|
736
|
+
function ui(i) {
|
|
737
|
+
return Re(i) ? i : i.split(".");
|
|
738
|
+
}
|
|
739
|
+
function bs(i) {
|
|
740
|
+
return Re(i) ? i.join(".") : i;
|
|
741
|
+
}
|
|
742
|
+
function un(i, e) {
|
|
743
|
+
let t = [], s = !1;
|
|
744
|
+
const r = (o, l, c) => {
|
|
745
|
+
if (xe(o))
|
|
746
|
+
if (!l[c])
|
|
747
|
+
t.push(o);
|
|
748
748
|
else {
|
|
749
|
-
let
|
|
750
|
-
const
|
|
751
|
-
if (!
|
|
749
|
+
let u = l[c];
|
|
750
|
+
const d = o[u];
|
|
751
|
+
if (!xe(d))
|
|
752
752
|
return;
|
|
753
|
-
if (c ===
|
|
754
|
-
|
|
755
|
-
else if (
|
|
753
|
+
if (c === l.length - 1 && (De(d) || wi(d) || sn(d)))
|
|
754
|
+
t.push(tn(d));
|
|
755
|
+
else if (Re(d)) {
|
|
756
756
|
s = !0;
|
|
757
|
-
for (let
|
|
758
|
-
|
|
757
|
+
for (let m = 0, v = d.length; m < v; m += 1)
|
|
758
|
+
r(d[m], l, c + 1);
|
|
759
759
|
} else
|
|
760
|
-
|
|
760
|
+
l.length && r(d, l, c + 1);
|
|
761
761
|
}
|
|
762
762
|
};
|
|
763
|
-
return
|
|
763
|
+
return r(i, De(e) ? e.split(".") : e, 0), s ? t : t[0];
|
|
764
764
|
}
|
|
765
|
-
const
|
|
765
|
+
const dn = {
|
|
766
766
|
// Whether the matches should be included in the result set. When `true`, each record in the result
|
|
767
767
|
// set will include the indices of the matched characters.
|
|
768
768
|
// These can consequently be used for highlighting purposes.
|
|
@@ -772,7 +772,7 @@ const Qe = {
|
|
|
772
772
|
findAllMatches: !1,
|
|
773
773
|
// Minimum number of characters that must be matched before a result is considered a match
|
|
774
774
|
minMatchCharLength: 1
|
|
775
|
-
},
|
|
775
|
+
}, pn = {
|
|
776
776
|
// When `true`, the algorithm continues searching to the end of the input even if a perfect
|
|
777
777
|
// match is found before the end of the same input.
|
|
778
778
|
isCaseSensitive: !1,
|
|
@@ -783,8 +783,8 @@ const Qe = {
|
|
|
783
783
|
// Whether to sort the result list, by score
|
|
784
784
|
shouldSort: !0,
|
|
785
785
|
// Default sort function: sort by ascending score, ascending index
|
|
786
|
-
sortFn: (i,
|
|
787
|
-
},
|
|
786
|
+
sortFn: (i, e) => i.score === e.score ? i.idx < e.idx ? -1 : 1 : i.score < e.score ? -1 : 1
|
|
787
|
+
}, fn = {
|
|
788
788
|
// Approximately where in the text is the pattern expected to be found?
|
|
789
789
|
location: 0,
|
|
790
790
|
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
|
|
@@ -796,12 +796,12 @@ const Qe = {
|
|
|
796
796
|
// the exact location specified, a threshold of '1000' would require a perfect match
|
|
797
797
|
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
|
|
798
798
|
distance: 100
|
|
799
|
-
},
|
|
799
|
+
}, gn = {
|
|
800
800
|
// When `true`, it enables the use of unix-like search commands
|
|
801
801
|
useExtendedSearch: !1,
|
|
802
802
|
// The get function to use when fetching an object's properties.
|
|
803
803
|
// The default will search nested paths *ie foo.bar.baz*
|
|
804
|
-
getFn:
|
|
804
|
+
getFn: un,
|
|
805
805
|
// When `true`, search will ignore `location` and `distance`, so it won't matter
|
|
806
806
|
// where in the string the pattern appears.
|
|
807
807
|
// More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
|
|
@@ -813,113 +813,113 @@ const Qe = {
|
|
|
813
813
|
// The weight to determine how much field length norm effects scoring.
|
|
814
814
|
fieldNormWeight: 1
|
|
815
815
|
};
|
|
816
|
-
var
|
|
817
|
-
...
|
|
818
|
-
...
|
|
819
|
-
...
|
|
820
|
-
...
|
|
816
|
+
var D = {
|
|
817
|
+
...pn,
|
|
818
|
+
...dn,
|
|
819
|
+
...fn,
|
|
820
|
+
...gn
|
|
821
821
|
};
|
|
822
|
-
const
|
|
823
|
-
function
|
|
824
|
-
const
|
|
822
|
+
const vn = /[^ ]+/g;
|
|
823
|
+
function mn(i = 1, e = 3) {
|
|
824
|
+
const t = /* @__PURE__ */ new Map(), s = Math.pow(10, e);
|
|
825
825
|
return {
|
|
826
|
-
get(
|
|
827
|
-
const
|
|
828
|
-
if (
|
|
829
|
-
return
|
|
830
|
-
const
|
|
831
|
-
return
|
|
826
|
+
get(r) {
|
|
827
|
+
const o = r.match(vn).length;
|
|
828
|
+
if (t.has(o))
|
|
829
|
+
return t.get(o);
|
|
830
|
+
const l = 1 / Math.pow(o, 0.5 * i), c = parseFloat(Math.round(l * s) / s);
|
|
831
|
+
return t.set(o, c), c;
|
|
832
832
|
},
|
|
833
833
|
clear() {
|
|
834
|
-
|
|
834
|
+
t.clear();
|
|
835
835
|
}
|
|
836
836
|
};
|
|
837
837
|
}
|
|
838
|
-
class
|
|
838
|
+
class Ss {
|
|
839
839
|
constructor({
|
|
840
|
-
getFn:
|
|
841
|
-
fieldNormWeight:
|
|
840
|
+
getFn: e = D.getFn,
|
|
841
|
+
fieldNormWeight: t = D.fieldNormWeight
|
|
842
842
|
} = {}) {
|
|
843
|
-
this.norm =
|
|
843
|
+
this.norm = mn(t, 3), this.getFn = e, this.isCreated = !1, this.setIndexRecords();
|
|
844
844
|
}
|
|
845
|
-
setSources(
|
|
846
|
-
this.docs =
|
|
845
|
+
setSources(e = []) {
|
|
846
|
+
this.docs = e;
|
|
847
847
|
}
|
|
848
|
-
setIndexRecords(
|
|
849
|
-
this.records =
|
|
848
|
+
setIndexRecords(e = []) {
|
|
849
|
+
this.records = e;
|
|
850
850
|
}
|
|
851
|
-
setKeys(
|
|
852
|
-
this.keys =
|
|
853
|
-
this._keysMap[
|
|
851
|
+
setKeys(e = []) {
|
|
852
|
+
this.keys = e, this._keysMap = {}, e.forEach((t, s) => {
|
|
853
|
+
this._keysMap[t.id] = s;
|
|
854
854
|
});
|
|
855
855
|
}
|
|
856
856
|
create() {
|
|
857
|
-
this.isCreated || !this.docs.length || (this.isCreated = !0,
|
|
858
|
-
this._addString(
|
|
859
|
-
}) : this.docs.forEach((
|
|
860
|
-
this._addObject(
|
|
857
|
+
this.isCreated || !this.docs.length || (this.isCreated = !0, De(this.docs[0]) ? this.docs.forEach((e, t) => {
|
|
858
|
+
this._addString(e, t);
|
|
859
|
+
}) : this.docs.forEach((e, t) => {
|
|
860
|
+
this._addObject(e, t);
|
|
861
861
|
}), this.norm.clear());
|
|
862
862
|
}
|
|
863
863
|
// Adds a doc to the end of the index
|
|
864
|
-
add(
|
|
865
|
-
const
|
|
866
|
-
|
|
864
|
+
add(e) {
|
|
865
|
+
const t = this.size();
|
|
866
|
+
De(e) ? this._addString(e, t) : this._addObject(e, t);
|
|
867
867
|
}
|
|
868
868
|
// Removes the doc at the specified index of the index
|
|
869
|
-
removeAt(
|
|
870
|
-
this.records.splice(
|
|
871
|
-
for (let
|
|
872
|
-
this.records[
|
|
869
|
+
removeAt(e) {
|
|
870
|
+
this.records.splice(e, 1);
|
|
871
|
+
for (let t = e, s = this.size(); t < s; t += 1)
|
|
872
|
+
this.records[t].i -= 1;
|
|
873
873
|
}
|
|
874
|
-
getValueForItemAtKeyId(
|
|
875
|
-
return
|
|
874
|
+
getValueForItemAtKeyId(e, t) {
|
|
875
|
+
return e[this._keysMap[t]];
|
|
876
876
|
}
|
|
877
877
|
size() {
|
|
878
878
|
return this.records.length;
|
|
879
879
|
}
|
|
880
|
-
_addString(
|
|
881
|
-
if (!
|
|
880
|
+
_addString(e, t) {
|
|
881
|
+
if (!xe(e) || ps(e))
|
|
882
882
|
return;
|
|
883
883
|
let s = {
|
|
884
|
-
v:
|
|
885
|
-
i:
|
|
886
|
-
n: this.norm.get(
|
|
884
|
+
v: e,
|
|
885
|
+
i: t,
|
|
886
|
+
n: this.norm.get(e)
|
|
887
887
|
};
|
|
888
888
|
this.records.push(s);
|
|
889
889
|
}
|
|
890
|
-
_addObject(
|
|
891
|
-
let s = { i:
|
|
892
|
-
this.keys.forEach((
|
|
893
|
-
let
|
|
894
|
-
if (
|
|
895
|
-
if (
|
|
890
|
+
_addObject(e, t) {
|
|
891
|
+
let s = { i: t, $: {} };
|
|
892
|
+
this.keys.forEach((r, o) => {
|
|
893
|
+
let l = r.getFn ? r.getFn(e) : this.getFn(e, r.path);
|
|
894
|
+
if (xe(l)) {
|
|
895
|
+
if (Re(l)) {
|
|
896
896
|
let c = [];
|
|
897
|
-
const
|
|
898
|
-
for (;
|
|
899
|
-
const { nestedArrIndex:
|
|
900
|
-
if (
|
|
901
|
-
if (
|
|
902
|
-
let
|
|
903
|
-
v:
|
|
904
|
-
i:
|
|
905
|
-
n: this.norm.get(
|
|
897
|
+
const u = [{ nestedArrIndex: -1, value: l }];
|
|
898
|
+
for (; u.length; ) {
|
|
899
|
+
const { nestedArrIndex: d, value: m } = u.pop();
|
|
900
|
+
if (xe(m))
|
|
901
|
+
if (De(m) && !ps(m)) {
|
|
902
|
+
let v = {
|
|
903
|
+
v: m,
|
|
904
|
+
i: d,
|
|
905
|
+
n: this.norm.get(m)
|
|
906
906
|
};
|
|
907
|
-
c.push(
|
|
907
|
+
c.push(v);
|
|
908
908
|
} else
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
nestedArrIndex:
|
|
912
|
-
value:
|
|
909
|
+
Re(m) && m.forEach((v, $) => {
|
|
910
|
+
u.push({
|
|
911
|
+
nestedArrIndex: $,
|
|
912
|
+
value: v
|
|
913
913
|
});
|
|
914
914
|
});
|
|
915
915
|
}
|
|
916
|
-
s.$[
|
|
917
|
-
} else if (
|
|
916
|
+
s.$[o] = c;
|
|
917
|
+
} else if (De(l) && !ps(l)) {
|
|
918
918
|
let c = {
|
|
919
|
-
v:
|
|
920
|
-
n: this.norm.get(
|
|
919
|
+
v: l,
|
|
920
|
+
n: this.norm.get(l)
|
|
921
921
|
};
|
|
922
|
-
s.$[
|
|
922
|
+
s.$[o] = c;
|
|
923
923
|
}
|
|
924
924
|
}
|
|
925
925
|
}), this.records.push(s);
|
|
@@ -931,221 +931,221 @@ class Tt {
|
|
|
931
931
|
};
|
|
932
932
|
}
|
|
933
933
|
}
|
|
934
|
-
function
|
|
935
|
-
const
|
|
936
|
-
return
|
|
934
|
+
function Si(i, e, { getFn: t = D.getFn, fieldNormWeight: s = D.fieldNormWeight } = {}) {
|
|
935
|
+
const r = new Ss({ getFn: t, fieldNormWeight: s });
|
|
936
|
+
return r.setKeys(i.map(Mi)), r.setSources(e), r.create(), r;
|
|
937
937
|
}
|
|
938
|
-
function
|
|
939
|
-
const { keys: s, records:
|
|
940
|
-
return
|
|
938
|
+
function yn(i, { getFn: e = D.getFn, fieldNormWeight: t = D.fieldNormWeight } = {}) {
|
|
939
|
+
const { keys: s, records: r } = i, o = new Ss({ getFn: e, fieldNormWeight: t });
|
|
940
|
+
return o.setKeys(s), o.setIndexRecords(r), o;
|
|
941
941
|
}
|
|
942
|
-
function
|
|
943
|
-
errors:
|
|
944
|
-
currentLocation:
|
|
942
|
+
function Mt(i, {
|
|
943
|
+
errors: e = 0,
|
|
944
|
+
currentLocation: t = 0,
|
|
945
945
|
expectedLocation: s = 0,
|
|
946
|
-
distance:
|
|
947
|
-
ignoreLocation:
|
|
946
|
+
distance: r = D.distance,
|
|
947
|
+
ignoreLocation: o = D.ignoreLocation
|
|
948
948
|
} = {}) {
|
|
949
|
-
const
|
|
950
|
-
if (
|
|
951
|
-
return
|
|
952
|
-
const c = Math.abs(s -
|
|
953
|
-
return
|
|
954
|
-
}
|
|
955
|
-
function
|
|
956
|
-
let
|
|
957
|
-
for (let
|
|
958
|
-
let c = i[
|
|
959
|
-
c && s === -1 ? s =
|
|
960
|
-
}
|
|
961
|
-
return i[
|
|
962
|
-
}
|
|
963
|
-
const
|
|
964
|
-
function
|
|
965
|
-
location: s =
|
|
966
|
-
distance:
|
|
967
|
-
threshold:
|
|
968
|
-
findAllMatches:
|
|
969
|
-
minMatchCharLength: c =
|
|
970
|
-
includeMatches:
|
|
971
|
-
ignoreLocation:
|
|
949
|
+
const l = e / i.length;
|
|
950
|
+
if (o)
|
|
951
|
+
return l;
|
|
952
|
+
const c = Math.abs(s - t);
|
|
953
|
+
return r ? l + c / r : c ? 1 : l;
|
|
954
|
+
}
|
|
955
|
+
function bn(i = [], e = D.minMatchCharLength) {
|
|
956
|
+
let t = [], s = -1, r = -1, o = 0;
|
|
957
|
+
for (let l = i.length; o < l; o += 1) {
|
|
958
|
+
let c = i[o];
|
|
959
|
+
c && s === -1 ? s = o : !c && s !== -1 && (r = o - 1, r - s + 1 >= e && t.push([s, r]), s = -1);
|
|
960
|
+
}
|
|
961
|
+
return i[o - 1] && o - s >= e && t.push([s, o - 1]), t;
|
|
962
|
+
}
|
|
963
|
+
const ze = 32;
|
|
964
|
+
function $n(i, e, t, {
|
|
965
|
+
location: s = D.location,
|
|
966
|
+
distance: r = D.distance,
|
|
967
|
+
threshold: o = D.threshold,
|
|
968
|
+
findAllMatches: l = D.findAllMatches,
|
|
969
|
+
minMatchCharLength: c = D.minMatchCharLength,
|
|
970
|
+
includeMatches: u = D.includeMatches,
|
|
971
|
+
ignoreLocation: d = D.ignoreLocation
|
|
972
972
|
} = {}) {
|
|
973
|
-
if (
|
|
974
|
-
throw new Error(
|
|
975
|
-
const
|
|
976
|
-
let
|
|
977
|
-
const
|
|
978
|
-
let
|
|
979
|
-
for (; (
|
|
980
|
-
let
|
|
981
|
-
currentLocation:
|
|
982
|
-
expectedLocation:
|
|
983
|
-
distance:
|
|
984
|
-
ignoreLocation:
|
|
973
|
+
if (e.length > ze)
|
|
974
|
+
throw new Error(ln(ze));
|
|
975
|
+
const m = e.length, v = i.length, $ = Math.max(0, Math.min(s, v));
|
|
976
|
+
let E = o, j = $;
|
|
977
|
+
const G = c > 1 || u, ve = G ? Array(v) : [];
|
|
978
|
+
let le;
|
|
979
|
+
for (; (le = i.indexOf(e, j)) > -1; ) {
|
|
980
|
+
let X = Mt(e, {
|
|
981
|
+
currentLocation: le,
|
|
982
|
+
expectedLocation: $,
|
|
983
|
+
distance: r,
|
|
984
|
+
ignoreLocation: d
|
|
985
985
|
});
|
|
986
|
-
if (
|
|
987
|
-
let
|
|
988
|
-
for (;
|
|
989
|
-
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
let
|
|
994
|
-
const
|
|
995
|
-
for (let
|
|
996
|
-
let
|
|
997
|
-
for (;
|
|
998
|
-
|
|
999
|
-
errors:
|
|
1000
|
-
currentLocation:
|
|
1001
|
-
expectedLocation:
|
|
1002
|
-
distance:
|
|
1003
|
-
ignoreLocation:
|
|
1004
|
-
}) <=
|
|
1005
|
-
|
|
1006
|
-
let
|
|
1007
|
-
|
|
1008
|
-
for (let
|
|
1009
|
-
let
|
|
1010
|
-
if (
|
|
1011
|
-
errors:
|
|
1012
|
-
currentLocation:
|
|
1013
|
-
expectedLocation:
|
|
1014
|
-
distance:
|
|
1015
|
-
ignoreLocation:
|
|
1016
|
-
}),
|
|
1017
|
-
if (
|
|
986
|
+
if (E = Math.min(X, E), j = le + m, G) {
|
|
987
|
+
let ie = 0;
|
|
988
|
+
for (; ie < m; )
|
|
989
|
+
ve[le + ie] = 1, ie += 1;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
j = -1;
|
|
993
|
+
let me = [], pe = 1, Ee = m + v;
|
|
994
|
+
const ye = 1 << m - 1;
|
|
995
|
+
for (let X = 0; X < m; X += 1) {
|
|
996
|
+
let ie = 0, z = Ee;
|
|
997
|
+
for (; ie < z; )
|
|
998
|
+
Mt(e, {
|
|
999
|
+
errors: X,
|
|
1000
|
+
currentLocation: $ + z,
|
|
1001
|
+
expectedLocation: $,
|
|
1002
|
+
distance: r,
|
|
1003
|
+
ignoreLocation: d
|
|
1004
|
+
}) <= E ? ie = z : Ee = z, z = Math.floor((Ee - ie) / 2 + ie);
|
|
1005
|
+
Ee = z;
|
|
1006
|
+
let B = Math.max(1, $ - z + 1), Oe = l ? v : Math.min($ + z, v) + m, Me = Array(Oe + 2);
|
|
1007
|
+
Me[Oe + 1] = (1 << X) - 1;
|
|
1008
|
+
for (let y = Oe; y >= B; y -= 1) {
|
|
1009
|
+
let b = y - 1, k = t[i.charAt(b)];
|
|
1010
|
+
if (G && (ve[b] = +!!k), Me[y] = (Me[y + 1] << 1 | 1) & k, X && (Me[y] |= (me[y + 1] | me[y]) << 1 | 1 | me[y + 1]), Me[y] & ye && (pe = Mt(e, {
|
|
1011
|
+
errors: X,
|
|
1012
|
+
currentLocation: b,
|
|
1013
|
+
expectedLocation: $,
|
|
1014
|
+
distance: r,
|
|
1015
|
+
ignoreLocation: d
|
|
1016
|
+
}), pe <= E)) {
|
|
1017
|
+
if (E = pe, j = b, j <= $)
|
|
1018
1018
|
break;
|
|
1019
|
-
|
|
1019
|
+
B = Math.max(1, 2 * $ - j);
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
1022
|
-
if (
|
|
1023
|
-
errors:
|
|
1024
|
-
currentLocation:
|
|
1025
|
-
expectedLocation:
|
|
1026
|
-
distance:
|
|
1027
|
-
ignoreLocation:
|
|
1028
|
-
}) >
|
|
1022
|
+
if (Mt(e, {
|
|
1023
|
+
errors: X + 1,
|
|
1024
|
+
currentLocation: $,
|
|
1025
|
+
expectedLocation: $,
|
|
1026
|
+
distance: r,
|
|
1027
|
+
ignoreLocation: d
|
|
1028
|
+
}) > E)
|
|
1029
1029
|
break;
|
|
1030
|
-
|
|
1030
|
+
me = Me;
|
|
1031
1031
|
}
|
|
1032
|
-
const
|
|
1033
|
-
isMatch:
|
|
1032
|
+
const F = {
|
|
1033
|
+
isMatch: j >= 0,
|
|
1034
1034
|
// Count exact matches (those with a score of 0) to be "almost" exact
|
|
1035
|
-
score: Math.max(1e-3,
|
|
1035
|
+
score: Math.max(1e-3, pe)
|
|
1036
1036
|
};
|
|
1037
|
-
if (
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1037
|
+
if (G) {
|
|
1038
|
+
const X = bn(ve, c);
|
|
1039
|
+
X.length ? u && (F.indices = X) : F.isMatch = !1;
|
|
1040
1040
|
}
|
|
1041
|
-
return
|
|
1041
|
+
return F;
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1044
|
-
let
|
|
1045
|
-
for (let
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1043
|
+
function _n(i) {
|
|
1044
|
+
let e = {};
|
|
1045
|
+
for (let t = 0, s = i.length; t < s; t += 1) {
|
|
1046
|
+
const r = i.charAt(t);
|
|
1047
|
+
e[r] = (e[r] || 0) | 1 << s - t - 1;
|
|
1048
1048
|
}
|
|
1049
|
-
return
|
|
1049
|
+
return e;
|
|
1050
1050
|
}
|
|
1051
|
-
class
|
|
1052
|
-
constructor(
|
|
1053
|
-
location:
|
|
1054
|
-
threshold: s =
|
|
1055
|
-
distance:
|
|
1056
|
-
includeMatches:
|
|
1057
|
-
findAllMatches:
|
|
1058
|
-
minMatchCharLength: c =
|
|
1059
|
-
isCaseSensitive:
|
|
1060
|
-
ignoreLocation:
|
|
1051
|
+
class ki {
|
|
1052
|
+
constructor(e, {
|
|
1053
|
+
location: t = D.location,
|
|
1054
|
+
threshold: s = D.threshold,
|
|
1055
|
+
distance: r = D.distance,
|
|
1056
|
+
includeMatches: o = D.includeMatches,
|
|
1057
|
+
findAllMatches: l = D.findAllMatches,
|
|
1058
|
+
minMatchCharLength: c = D.minMatchCharLength,
|
|
1059
|
+
isCaseSensitive: u = D.isCaseSensitive,
|
|
1060
|
+
ignoreLocation: d = D.ignoreLocation
|
|
1061
1061
|
} = {}) {
|
|
1062
1062
|
if (this.options = {
|
|
1063
|
-
location:
|
|
1063
|
+
location: t,
|
|
1064
1064
|
threshold: s,
|
|
1065
|
-
distance:
|
|
1066
|
-
includeMatches:
|
|
1067
|
-
findAllMatches:
|
|
1065
|
+
distance: r,
|
|
1066
|
+
includeMatches: o,
|
|
1067
|
+
findAllMatches: l,
|
|
1068
1068
|
minMatchCharLength: c,
|
|
1069
|
-
isCaseSensitive:
|
|
1070
|
-
ignoreLocation:
|
|
1071
|
-
}, this.pattern =
|
|
1069
|
+
isCaseSensitive: u,
|
|
1070
|
+
ignoreLocation: d
|
|
1071
|
+
}, this.pattern = u ? e : e.toLowerCase(), this.chunks = [], !this.pattern.length)
|
|
1072
1072
|
return;
|
|
1073
|
-
const
|
|
1073
|
+
const m = ($, E) => {
|
|
1074
1074
|
this.chunks.push({
|
|
1075
|
-
pattern:
|
|
1076
|
-
alphabet:
|
|
1077
|
-
startIndex:
|
|
1075
|
+
pattern: $,
|
|
1076
|
+
alphabet: _n($),
|
|
1077
|
+
startIndex: E
|
|
1078
1078
|
});
|
|
1079
|
-
},
|
|
1080
|
-
if (
|
|
1081
|
-
let
|
|
1082
|
-
const
|
|
1083
|
-
for (;
|
|
1084
|
-
|
|
1085
|
-
if (
|
|
1086
|
-
const
|
|
1087
|
-
|
|
1079
|
+
}, v = this.pattern.length;
|
|
1080
|
+
if (v > ze) {
|
|
1081
|
+
let $ = 0;
|
|
1082
|
+
const E = v % ze, j = v - E;
|
|
1083
|
+
for (; $ < j; )
|
|
1084
|
+
m(this.pattern.substr($, ze), $), $ += ze;
|
|
1085
|
+
if (E) {
|
|
1086
|
+
const G = v - ze;
|
|
1087
|
+
m(this.pattern.substr(G), G);
|
|
1088
1088
|
}
|
|
1089
1089
|
} else
|
|
1090
|
-
|
|
1090
|
+
m(this.pattern, 0);
|
|
1091
1091
|
}
|
|
1092
|
-
searchIn(
|
|
1093
|
-
const { isCaseSensitive:
|
|
1094
|
-
if (
|
|
1095
|
-
let
|
|
1092
|
+
searchIn(e) {
|
|
1093
|
+
const { isCaseSensitive: t, includeMatches: s } = this.options;
|
|
1094
|
+
if (t || (e = e.toLowerCase()), this.pattern === e) {
|
|
1095
|
+
let j = {
|
|
1096
1096
|
isMatch: !0,
|
|
1097
1097
|
score: 0
|
|
1098
1098
|
};
|
|
1099
|
-
return s && (
|
|
1099
|
+
return s && (j.indices = [[0, e.length - 1]]), j;
|
|
1100
1100
|
}
|
|
1101
1101
|
const {
|
|
1102
|
-
location:
|
|
1103
|
-
distance:
|
|
1104
|
-
threshold:
|
|
1102
|
+
location: r,
|
|
1103
|
+
distance: o,
|
|
1104
|
+
threshold: l,
|
|
1105
1105
|
findAllMatches: c,
|
|
1106
|
-
minMatchCharLength:
|
|
1107
|
-
ignoreLocation:
|
|
1106
|
+
minMatchCharLength: u,
|
|
1107
|
+
ignoreLocation: d
|
|
1108
1108
|
} = this.options;
|
|
1109
|
-
let
|
|
1110
|
-
this.chunks.forEach(({ pattern:
|
|
1111
|
-
const { isMatch:
|
|
1112
|
-
location:
|
|
1113
|
-
distance:
|
|
1114
|
-
threshold:
|
|
1109
|
+
let m = [], v = 0, $ = !1;
|
|
1110
|
+
this.chunks.forEach(({ pattern: j, alphabet: G, startIndex: ve }) => {
|
|
1111
|
+
const { isMatch: le, score: me, indices: pe } = $n(e, j, G, {
|
|
1112
|
+
location: r + ve,
|
|
1113
|
+
distance: o,
|
|
1114
|
+
threshold: l,
|
|
1115
1115
|
findAllMatches: c,
|
|
1116
|
-
minMatchCharLength:
|
|
1116
|
+
minMatchCharLength: u,
|
|
1117
1117
|
includeMatches: s,
|
|
1118
|
-
ignoreLocation:
|
|
1118
|
+
ignoreLocation: d
|
|
1119
1119
|
});
|
|
1120
|
-
|
|
1120
|
+
le && ($ = !0), v += me, le && pe && (m = [...m, ...pe]);
|
|
1121
1121
|
});
|
|
1122
|
-
let
|
|
1123
|
-
isMatch:
|
|
1124
|
-
score:
|
|
1122
|
+
let E = {
|
|
1123
|
+
isMatch: $,
|
|
1124
|
+
score: $ ? v / this.chunks.length : 1
|
|
1125
1125
|
};
|
|
1126
|
-
return
|
|
1126
|
+
return $ && s && (E.indices = m), E;
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
class
|
|
1130
|
-
constructor(
|
|
1131
|
-
this.pattern =
|
|
1129
|
+
class je {
|
|
1130
|
+
constructor(e) {
|
|
1131
|
+
this.pattern = e;
|
|
1132
1132
|
}
|
|
1133
|
-
static isMultiMatch(
|
|
1134
|
-
return
|
|
1133
|
+
static isMultiMatch(e) {
|
|
1134
|
+
return di(e, this.multiRegex);
|
|
1135
1135
|
}
|
|
1136
|
-
static isSingleMatch(
|
|
1137
|
-
return
|
|
1136
|
+
static isSingleMatch(e) {
|
|
1137
|
+
return di(e, this.singleRegex);
|
|
1138
1138
|
}
|
|
1139
1139
|
search() {
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
|
-
function
|
|
1143
|
-
const
|
|
1144
|
-
return
|
|
1142
|
+
function di(i, e) {
|
|
1143
|
+
const t = i.match(e);
|
|
1144
|
+
return t ? t[1] : null;
|
|
1145
1145
|
}
|
|
1146
|
-
class
|
|
1147
|
-
constructor(
|
|
1148
|
-
super(
|
|
1146
|
+
class xn extends je {
|
|
1147
|
+
constructor(e) {
|
|
1148
|
+
super(e);
|
|
1149
1149
|
}
|
|
1150
1150
|
static get type() {
|
|
1151
1151
|
return "exact";
|
|
@@ -1156,18 +1156,18 @@ class ls extends L {
|
|
|
1156
1156
|
static get singleRegex() {
|
|
1157
1157
|
return /^=(.*)$/;
|
|
1158
1158
|
}
|
|
1159
|
-
search(
|
|
1160
|
-
const
|
|
1159
|
+
search(e) {
|
|
1160
|
+
const t = e === this.pattern;
|
|
1161
1161
|
return {
|
|
1162
|
-
isMatch:
|
|
1163
|
-
score:
|
|
1162
|
+
isMatch: t,
|
|
1163
|
+
score: t ? 0 : 1,
|
|
1164
1164
|
indices: [0, this.pattern.length - 1]
|
|
1165
1165
|
};
|
|
1166
1166
|
}
|
|
1167
1167
|
}
|
|
1168
|
-
class
|
|
1169
|
-
constructor(
|
|
1170
|
-
super(
|
|
1168
|
+
class wn extends je {
|
|
1169
|
+
constructor(e) {
|
|
1170
|
+
super(e);
|
|
1171
1171
|
}
|
|
1172
1172
|
static get type() {
|
|
1173
1173
|
return "inverse-exact";
|
|
@@ -1178,18 +1178,18 @@ class cs extends L {
|
|
|
1178
1178
|
static get singleRegex() {
|
|
1179
1179
|
return /^!(.*)$/;
|
|
1180
1180
|
}
|
|
1181
|
-
search(
|
|
1182
|
-
const s =
|
|
1181
|
+
search(e) {
|
|
1182
|
+
const s = e.indexOf(this.pattern) === -1;
|
|
1183
1183
|
return {
|
|
1184
1184
|
isMatch: s,
|
|
1185
1185
|
score: s ? 0 : 1,
|
|
1186
|
-
indices: [0,
|
|
1186
|
+
indices: [0, e.length - 1]
|
|
1187
1187
|
};
|
|
1188
1188
|
}
|
|
1189
1189
|
}
|
|
1190
|
-
class
|
|
1191
|
-
constructor(
|
|
1192
|
-
super(
|
|
1190
|
+
class An extends je {
|
|
1191
|
+
constructor(e) {
|
|
1192
|
+
super(e);
|
|
1193
1193
|
}
|
|
1194
1194
|
static get type() {
|
|
1195
1195
|
return "prefix-exact";
|
|
@@ -1200,18 +1200,18 @@ class as extends L {
|
|
|
1200
1200
|
static get singleRegex() {
|
|
1201
1201
|
return /^\^(.*)$/;
|
|
1202
1202
|
}
|
|
1203
|
-
search(
|
|
1204
|
-
const
|
|
1203
|
+
search(e) {
|
|
1204
|
+
const t = e.startsWith(this.pattern);
|
|
1205
1205
|
return {
|
|
1206
|
-
isMatch:
|
|
1207
|
-
score:
|
|
1206
|
+
isMatch: t,
|
|
1207
|
+
score: t ? 0 : 1,
|
|
1208
1208
|
indices: [0, this.pattern.length - 1]
|
|
1209
1209
|
};
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
|
-
class
|
|
1213
|
-
constructor(
|
|
1214
|
-
super(
|
|
1212
|
+
class En extends je {
|
|
1213
|
+
constructor(e) {
|
|
1214
|
+
super(e);
|
|
1215
1215
|
}
|
|
1216
1216
|
static get type() {
|
|
1217
1217
|
return "inverse-prefix-exact";
|
|
@@ -1222,18 +1222,18 @@ class hs extends L {
|
|
|
1222
1222
|
static get singleRegex() {
|
|
1223
1223
|
return /^!\^(.*)$/;
|
|
1224
1224
|
}
|
|
1225
|
-
search(
|
|
1226
|
-
const
|
|
1225
|
+
search(e) {
|
|
1226
|
+
const t = !e.startsWith(this.pattern);
|
|
1227
1227
|
return {
|
|
1228
|
-
isMatch:
|
|
1229
|
-
score:
|
|
1230
|
-
indices: [0,
|
|
1228
|
+
isMatch: t,
|
|
1229
|
+
score: t ? 0 : 1,
|
|
1230
|
+
indices: [0, e.length - 1]
|
|
1231
1231
|
};
|
|
1232
1232
|
}
|
|
1233
1233
|
}
|
|
1234
|
-
class
|
|
1235
|
-
constructor(
|
|
1236
|
-
super(
|
|
1234
|
+
class Mn extends je {
|
|
1235
|
+
constructor(e) {
|
|
1236
|
+
super(e);
|
|
1237
1237
|
}
|
|
1238
1238
|
static get type() {
|
|
1239
1239
|
return "suffix-exact";
|
|
@@ -1244,18 +1244,18 @@ class us extends L {
|
|
|
1244
1244
|
static get singleRegex() {
|
|
1245
1245
|
return /^(.*)\$$/;
|
|
1246
1246
|
}
|
|
1247
|
-
search(
|
|
1248
|
-
const
|
|
1247
|
+
search(e) {
|
|
1248
|
+
const t = e.endsWith(this.pattern);
|
|
1249
1249
|
return {
|
|
1250
|
-
isMatch:
|
|
1251
|
-
score:
|
|
1252
|
-
indices: [
|
|
1250
|
+
isMatch: t,
|
|
1251
|
+
score: t ? 0 : 1,
|
|
1252
|
+
indices: [e.length - this.pattern.length, e.length - 1]
|
|
1253
1253
|
};
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
|
-
class
|
|
1257
|
-
constructor(
|
|
1258
|
-
super(
|
|
1256
|
+
class Sn extends je {
|
|
1257
|
+
constructor(e) {
|
|
1258
|
+
super(e);
|
|
1259
1259
|
}
|
|
1260
1260
|
static get type() {
|
|
1261
1261
|
return "inverse-suffix-exact";
|
|
@@ -1266,35 +1266,35 @@ class ds extends L {
|
|
|
1266
1266
|
static get singleRegex() {
|
|
1267
1267
|
return /^!(.*)\$$/;
|
|
1268
1268
|
}
|
|
1269
|
-
search(
|
|
1270
|
-
const
|
|
1269
|
+
search(e) {
|
|
1270
|
+
const t = !e.endsWith(this.pattern);
|
|
1271
1271
|
return {
|
|
1272
|
-
isMatch:
|
|
1273
|
-
score:
|
|
1274
|
-
indices: [0,
|
|
1272
|
+
isMatch: t,
|
|
1273
|
+
score: t ? 0 : 1,
|
|
1274
|
+
indices: [0, e.length - 1]
|
|
1275
1275
|
};
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
1278
|
-
class
|
|
1279
|
-
constructor(
|
|
1280
|
-
location:
|
|
1281
|
-
threshold: s =
|
|
1282
|
-
distance:
|
|
1283
|
-
includeMatches:
|
|
1284
|
-
findAllMatches:
|
|
1285
|
-
minMatchCharLength: c =
|
|
1286
|
-
isCaseSensitive:
|
|
1287
|
-
ignoreLocation:
|
|
1278
|
+
class Ci extends je {
|
|
1279
|
+
constructor(e, {
|
|
1280
|
+
location: t = D.location,
|
|
1281
|
+
threshold: s = D.threshold,
|
|
1282
|
+
distance: r = D.distance,
|
|
1283
|
+
includeMatches: o = D.includeMatches,
|
|
1284
|
+
findAllMatches: l = D.findAllMatches,
|
|
1285
|
+
minMatchCharLength: c = D.minMatchCharLength,
|
|
1286
|
+
isCaseSensitive: u = D.isCaseSensitive,
|
|
1287
|
+
ignoreLocation: d = D.ignoreLocation
|
|
1288
1288
|
} = {}) {
|
|
1289
|
-
super(
|
|
1290
|
-
location:
|
|
1289
|
+
super(e), this._bitapSearch = new ki(e, {
|
|
1290
|
+
location: t,
|
|
1291
1291
|
threshold: s,
|
|
1292
|
-
distance:
|
|
1293
|
-
includeMatches:
|
|
1294
|
-
findAllMatches:
|
|
1292
|
+
distance: r,
|
|
1293
|
+
includeMatches: o,
|
|
1294
|
+
findAllMatches: l,
|
|
1295
1295
|
minMatchCharLength: c,
|
|
1296
|
-
isCaseSensitive:
|
|
1297
|
-
ignoreLocation:
|
|
1296
|
+
isCaseSensitive: u,
|
|
1297
|
+
ignoreLocation: d
|
|
1298
1298
|
});
|
|
1299
1299
|
}
|
|
1300
1300
|
static get type() {
|
|
@@ -1306,13 +1306,13 @@ class pe extends L {
|
|
|
1306
1306
|
static get singleRegex() {
|
|
1307
1307
|
return /^(.*)$/;
|
|
1308
1308
|
}
|
|
1309
|
-
search(
|
|
1310
|
-
return this._bitapSearch.searchIn(
|
|
1309
|
+
search(e) {
|
|
1310
|
+
return this._bitapSearch.searchIn(e);
|
|
1311
1311
|
}
|
|
1312
1312
|
}
|
|
1313
|
-
class
|
|
1314
|
-
constructor(
|
|
1315
|
-
super(
|
|
1313
|
+
class Oi extends je {
|
|
1314
|
+
constructor(e) {
|
|
1315
|
+
super(e);
|
|
1316
1316
|
}
|
|
1317
1317
|
static get type() {
|
|
1318
1318
|
return "include";
|
|
@@ -1323,110 +1323,110 @@ class ge extends L {
|
|
|
1323
1323
|
static get singleRegex() {
|
|
1324
1324
|
return /^'(.*)$/;
|
|
1325
1325
|
}
|
|
1326
|
-
search(
|
|
1327
|
-
let
|
|
1328
|
-
const
|
|
1329
|
-
for (; (s =
|
|
1330
|
-
|
|
1331
|
-
const
|
|
1326
|
+
search(e) {
|
|
1327
|
+
let t = 0, s;
|
|
1328
|
+
const r = [], o = this.pattern.length;
|
|
1329
|
+
for (; (s = e.indexOf(this.pattern, t)) > -1; )
|
|
1330
|
+
t = s + o, r.push([s, t - 1]);
|
|
1331
|
+
const l = !!r.length;
|
|
1332
1332
|
return {
|
|
1333
|
-
isMatch:
|
|
1334
|
-
score:
|
|
1335
|
-
indices:
|
|
1333
|
+
isMatch: l,
|
|
1334
|
+
score: l ? 0 : 1,
|
|
1335
|
+
indices: r
|
|
1336
1336
|
};
|
|
1337
1337
|
}
|
|
1338
1338
|
}
|
|
1339
|
-
const
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
],
|
|
1349
|
-
function
|
|
1350
|
-
return i.split(
|
|
1351
|
-
let s =
|
|
1352
|
-
for (let
|
|
1353
|
-
const c = s[
|
|
1354
|
-
let
|
|
1355
|
-
for (; !
|
|
1356
|
-
const
|
|
1357
|
-
let
|
|
1358
|
-
|
|
1339
|
+
const $s = [
|
|
1340
|
+
xn,
|
|
1341
|
+
Oi,
|
|
1342
|
+
An,
|
|
1343
|
+
En,
|
|
1344
|
+
Sn,
|
|
1345
|
+
Mn,
|
|
1346
|
+
wn,
|
|
1347
|
+
Ci
|
|
1348
|
+
], pi = $s.length, kn = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, Cn = "|";
|
|
1349
|
+
function On(i, e = {}) {
|
|
1350
|
+
return i.split(Cn).map((t) => {
|
|
1351
|
+
let s = t.trim().split(kn).filter((o) => o && !!o.trim()), r = [];
|
|
1352
|
+
for (let o = 0, l = s.length; o < l; o += 1) {
|
|
1353
|
+
const c = s[o];
|
|
1354
|
+
let u = !1, d = -1;
|
|
1355
|
+
for (; !u && ++d < pi; ) {
|
|
1356
|
+
const m = $s[d];
|
|
1357
|
+
let v = m.isMultiMatch(c);
|
|
1358
|
+
v && (r.push(new m(v, e)), u = !0);
|
|
1359
1359
|
}
|
|
1360
|
-
if (!
|
|
1361
|
-
for (
|
|
1362
|
-
const
|
|
1363
|
-
let
|
|
1364
|
-
if (
|
|
1365
|
-
|
|
1360
|
+
if (!u)
|
|
1361
|
+
for (d = -1; ++d < pi; ) {
|
|
1362
|
+
const m = $s[d];
|
|
1363
|
+
let v = m.isSingleMatch(c);
|
|
1364
|
+
if (v) {
|
|
1365
|
+
r.push(new m(v, e));
|
|
1366
1366
|
break;
|
|
1367
1367
|
}
|
|
1368
1368
|
}
|
|
1369
1369
|
}
|
|
1370
|
-
return
|
|
1370
|
+
return r;
|
|
1371
1371
|
});
|
|
1372
1372
|
}
|
|
1373
|
-
const
|
|
1374
|
-
class
|
|
1375
|
-
constructor(
|
|
1376
|
-
isCaseSensitive:
|
|
1377
|
-
includeMatches: s =
|
|
1378
|
-
minMatchCharLength:
|
|
1379
|
-
ignoreLocation:
|
|
1380
|
-
findAllMatches:
|
|
1381
|
-
location: c =
|
|
1382
|
-
threshold:
|
|
1383
|
-
distance:
|
|
1373
|
+
const Ln = /* @__PURE__ */ new Set([Ci.type, Oi.type]);
|
|
1374
|
+
class Tn {
|
|
1375
|
+
constructor(e, {
|
|
1376
|
+
isCaseSensitive: t = D.isCaseSensitive,
|
|
1377
|
+
includeMatches: s = D.includeMatches,
|
|
1378
|
+
minMatchCharLength: r = D.minMatchCharLength,
|
|
1379
|
+
ignoreLocation: o = D.ignoreLocation,
|
|
1380
|
+
findAllMatches: l = D.findAllMatches,
|
|
1381
|
+
location: c = D.location,
|
|
1382
|
+
threshold: u = D.threshold,
|
|
1383
|
+
distance: d = D.distance
|
|
1384
1384
|
} = {}) {
|
|
1385
1385
|
this.query = null, this.options = {
|
|
1386
|
-
isCaseSensitive:
|
|
1386
|
+
isCaseSensitive: t,
|
|
1387
1387
|
includeMatches: s,
|
|
1388
|
-
minMatchCharLength:
|
|
1389
|
-
findAllMatches:
|
|
1390
|
-
ignoreLocation:
|
|
1388
|
+
minMatchCharLength: r,
|
|
1389
|
+
findAllMatches: l,
|
|
1390
|
+
ignoreLocation: o,
|
|
1391
1391
|
location: c,
|
|
1392
|
-
threshold:
|
|
1393
|
-
distance:
|
|
1394
|
-
}, this.pattern =
|
|
1392
|
+
threshold: u,
|
|
1393
|
+
distance: d
|
|
1394
|
+
}, this.pattern = t ? e : e.toLowerCase(), this.query = On(this.pattern, this.options);
|
|
1395
1395
|
}
|
|
1396
|
-
static condition(
|
|
1397
|
-
return
|
|
1396
|
+
static condition(e, t) {
|
|
1397
|
+
return t.useExtendedSearch;
|
|
1398
1398
|
}
|
|
1399
|
-
searchIn(
|
|
1400
|
-
const
|
|
1401
|
-
if (!
|
|
1399
|
+
searchIn(e) {
|
|
1400
|
+
const t = this.query;
|
|
1401
|
+
if (!t)
|
|
1402
1402
|
return {
|
|
1403
1403
|
isMatch: !1,
|
|
1404
1404
|
score: 1
|
|
1405
1405
|
};
|
|
1406
|
-
const { includeMatches: s, isCaseSensitive:
|
|
1407
|
-
|
|
1408
|
-
let
|
|
1409
|
-
for (let
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1412
|
-
for (let
|
|
1413
|
-
const
|
|
1414
|
-
if (
|
|
1415
|
-
if (
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1406
|
+
const { includeMatches: s, isCaseSensitive: r } = this.options;
|
|
1407
|
+
e = r ? e : e.toLowerCase();
|
|
1408
|
+
let o = 0, l = [], c = 0;
|
|
1409
|
+
for (let u = 0, d = t.length; u < d; u += 1) {
|
|
1410
|
+
const m = t[u];
|
|
1411
|
+
l.length = 0, o = 0;
|
|
1412
|
+
for (let v = 0, $ = m.length; v < $; v += 1) {
|
|
1413
|
+
const E = m[v], { isMatch: j, indices: G, score: ve } = E.search(e);
|
|
1414
|
+
if (j) {
|
|
1415
|
+
if (o += 1, c += ve, s) {
|
|
1416
|
+
const le = E.constructor.type;
|
|
1417
|
+
Ln.has(le) ? l = [...l, ...G] : l.push(G);
|
|
1418
1418
|
}
|
|
1419
1419
|
} else {
|
|
1420
|
-
c = 0,
|
|
1420
|
+
c = 0, o = 0, l.length = 0;
|
|
1421
1421
|
break;
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
|
-
if (
|
|
1425
|
-
let
|
|
1424
|
+
if (o) {
|
|
1425
|
+
let v = {
|
|
1426
1426
|
isMatch: !0,
|
|
1427
|
-
score: c /
|
|
1427
|
+
score: c / o
|
|
1428
1428
|
};
|
|
1429
|
-
return s && (
|
|
1429
|
+
return s && (v.indices = l), v;
|
|
1430
1430
|
}
|
|
1431
1431
|
}
|
|
1432
1432
|
return {
|
|
@@ -1435,354 +1435,1573 @@ class _s {
|
|
|
1435
1435
|
};
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
|
-
const
|
|
1439
|
-
function
|
|
1440
|
-
|
|
1438
|
+
const _s = [];
|
|
1439
|
+
function Dn(...i) {
|
|
1440
|
+
_s.push(...i);
|
|
1441
1441
|
}
|
|
1442
|
-
function
|
|
1443
|
-
for (let
|
|
1444
|
-
let
|
|
1445
|
-
if (
|
|
1446
|
-
return new
|
|
1442
|
+
function xs(i, e) {
|
|
1443
|
+
for (let t = 0, s = _s.length; t < s; t += 1) {
|
|
1444
|
+
let r = _s[t];
|
|
1445
|
+
if (r.condition(i, e))
|
|
1446
|
+
return new r(i, e);
|
|
1447
1447
|
}
|
|
1448
|
-
return new
|
|
1448
|
+
return new ki(i, e);
|
|
1449
1449
|
}
|
|
1450
|
-
const
|
|
1450
|
+
const Lt = {
|
|
1451
1451
|
AND: "$and",
|
|
1452
1452
|
OR: "$or"
|
|
1453
|
-
},
|
|
1453
|
+
}, ws = {
|
|
1454
1454
|
PATH: "$path",
|
|
1455
1455
|
PATTERN: "$val"
|
|
1456
|
-
},
|
|
1457
|
-
[
|
|
1458
|
-
[
|
|
1456
|
+
}, As = (i) => !!(i[Lt.AND] || i[Lt.OR]), Rn = (i) => !!i[ws.PATH], Pn = (i) => !Re(i) && Ai(i) && !As(i), fi = (i) => ({
|
|
1457
|
+
[Lt.AND]: Object.keys(i).map((e) => ({
|
|
1458
|
+
[e]: i[e]
|
|
1459
1459
|
}))
|
|
1460
1460
|
});
|
|
1461
|
-
function
|
|
1462
|
-
const s = (
|
|
1463
|
-
let
|
|
1464
|
-
const
|
|
1465
|
-
if (!
|
|
1466
|
-
return s(
|
|
1467
|
-
if (
|
|
1468
|
-
const
|
|
1469
|
-
if (!
|
|
1470
|
-
throw new Error(
|
|
1471
|
-
const
|
|
1472
|
-
keyId:
|
|
1473
|
-
pattern:
|
|
1461
|
+
function Li(i, e, { auto: t = !0 } = {}) {
|
|
1462
|
+
const s = (r) => {
|
|
1463
|
+
let o = Object.keys(r);
|
|
1464
|
+
const l = Rn(r);
|
|
1465
|
+
if (!l && o.length > 1 && !As(r))
|
|
1466
|
+
return s(fi(r));
|
|
1467
|
+
if (Pn(r)) {
|
|
1468
|
+
const u = l ? r[ws.PATH] : o[0], d = l ? r[ws.PATTERN] : r[u];
|
|
1469
|
+
if (!De(d))
|
|
1470
|
+
throw new Error(on(u));
|
|
1471
|
+
const m = {
|
|
1472
|
+
keyId: bs(u),
|
|
1473
|
+
pattern: d
|
|
1474
1474
|
};
|
|
1475
|
-
return
|
|
1475
|
+
return t && (m.searcher = xs(d, e)), m;
|
|
1476
1476
|
}
|
|
1477
1477
|
let c = {
|
|
1478
1478
|
children: [],
|
|
1479
|
-
operator:
|
|
1479
|
+
operator: o[0]
|
|
1480
1480
|
};
|
|
1481
|
-
return
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1484
|
-
c.children.push(s(
|
|
1481
|
+
return o.forEach((u) => {
|
|
1482
|
+
const d = r[u];
|
|
1483
|
+
Re(d) && d.forEach((m) => {
|
|
1484
|
+
c.children.push(s(m));
|
|
1485
1485
|
});
|
|
1486
1486
|
}), c;
|
|
1487
1487
|
};
|
|
1488
|
-
return
|
|
1488
|
+
return As(i) || (i = fi(i)), s(i);
|
|
1489
1489
|
}
|
|
1490
|
-
function
|
|
1491
|
-
i.forEach((
|
|
1490
|
+
function In(i, { ignoreFieldNorm: e = D.ignoreFieldNorm }) {
|
|
1491
|
+
i.forEach((t) => {
|
|
1492
1492
|
let s = 1;
|
|
1493
|
-
|
|
1494
|
-
const c =
|
|
1493
|
+
t.matches.forEach(({ key: r, norm: o, score: l }) => {
|
|
1494
|
+
const c = r ? r.weight : null;
|
|
1495
1495
|
s *= Math.pow(
|
|
1496
|
-
|
|
1497
|
-
(c || 1) * (
|
|
1496
|
+
l === 0 && c ? Number.EPSILON : l,
|
|
1497
|
+
(c || 1) * (e ? 1 : o)
|
|
1498
1498
|
);
|
|
1499
|
-
}),
|
|
1499
|
+
}), t.score = s;
|
|
1500
1500
|
});
|
|
1501
1501
|
}
|
|
1502
|
-
function
|
|
1503
|
-
const
|
|
1504
|
-
|
|
1505
|
-
if (!
|
|
1502
|
+
function Nn(i, e) {
|
|
1503
|
+
const t = i.matches;
|
|
1504
|
+
e.matches = [], xe(t) && t.forEach((s) => {
|
|
1505
|
+
if (!xe(s.indices) || !s.indices.length)
|
|
1506
1506
|
return;
|
|
1507
|
-
const { indices:
|
|
1508
|
-
let
|
|
1509
|
-
indices:
|
|
1510
|
-
value:
|
|
1507
|
+
const { indices: r, value: o } = s;
|
|
1508
|
+
let l = {
|
|
1509
|
+
indices: r,
|
|
1510
|
+
value: o
|
|
1511
1511
|
};
|
|
1512
|
-
s.key && (
|
|
1512
|
+
s.key && (l.key = s.key.src), s.idx > -1 && (l.refIndex = s.idx), e.matches.push(l);
|
|
1513
1513
|
});
|
|
1514
1514
|
}
|
|
1515
|
-
function
|
|
1516
|
-
|
|
1515
|
+
function jn(i, e) {
|
|
1516
|
+
e.score = i.score;
|
|
1517
1517
|
}
|
|
1518
|
-
function
|
|
1519
|
-
includeMatches:
|
|
1520
|
-
includeScore: s =
|
|
1518
|
+
function Hn(i, e, {
|
|
1519
|
+
includeMatches: t = D.includeMatches,
|
|
1520
|
+
includeScore: s = D.includeScore
|
|
1521
1521
|
} = {}) {
|
|
1522
|
-
const
|
|
1523
|
-
return
|
|
1524
|
-
const { idx:
|
|
1525
|
-
item:
|
|
1526
|
-
refIndex:
|
|
1522
|
+
const r = [];
|
|
1523
|
+
return t && r.push(Nn), s && r.push(jn), i.map((o) => {
|
|
1524
|
+
const { idx: l } = o, c = {
|
|
1525
|
+
item: e[l],
|
|
1526
|
+
refIndex: l
|
|
1527
1527
|
};
|
|
1528
|
-
return
|
|
1529
|
-
|
|
1528
|
+
return r.length && r.forEach((u) => {
|
|
1529
|
+
u(o, c);
|
|
1530
1530
|
}), c;
|
|
1531
1531
|
});
|
|
1532
1532
|
}
|
|
1533
|
-
class
|
|
1534
|
-
constructor(
|
|
1535
|
-
this.options = { ...
|
|
1533
|
+
class st {
|
|
1534
|
+
constructor(e, t = {}, s) {
|
|
1535
|
+
this.options = { ...D, ...t }, this.options.useExtendedSearch, this._keyStore = new cn(this.options.keys), this.setCollection(e, s);
|
|
1536
1536
|
}
|
|
1537
|
-
setCollection(
|
|
1538
|
-
if (this._docs =
|
|
1539
|
-
throw new Error(
|
|
1540
|
-
this._myIndex =
|
|
1537
|
+
setCollection(e, t) {
|
|
1538
|
+
if (this._docs = e, t && !(t instanceof Ss))
|
|
1539
|
+
throw new Error(nn);
|
|
1540
|
+
this._myIndex = t || Si(this.options.keys, this._docs, {
|
|
1541
1541
|
getFn: this.options.getFn,
|
|
1542
1542
|
fieldNormWeight: this.options.fieldNormWeight
|
|
1543
1543
|
});
|
|
1544
1544
|
}
|
|
1545
|
-
add(
|
|
1546
|
-
|
|
1545
|
+
add(e) {
|
|
1546
|
+
xe(e) && (this._docs.push(e), this._myIndex.add(e));
|
|
1547
1547
|
}
|
|
1548
|
-
remove(
|
|
1549
|
-
const
|
|
1550
|
-
for (let s = 0,
|
|
1551
|
-
const
|
|
1552
|
-
|
|
1548
|
+
remove(e = () => !1) {
|
|
1549
|
+
const t = [];
|
|
1550
|
+
for (let s = 0, r = this._docs.length; s < r; s += 1) {
|
|
1551
|
+
const o = this._docs[s];
|
|
1552
|
+
e(o, s) && (this.removeAt(s), s -= 1, r -= 1, t.push(o));
|
|
1553
1553
|
}
|
|
1554
|
-
return
|
|
1554
|
+
return t;
|
|
1555
1555
|
}
|
|
1556
|
-
removeAt(
|
|
1557
|
-
this._docs.splice(
|
|
1556
|
+
removeAt(e) {
|
|
1557
|
+
this._docs.splice(e, 1), this._myIndex.removeAt(e);
|
|
1558
1558
|
}
|
|
1559
1559
|
getIndex() {
|
|
1560
1560
|
return this._myIndex;
|
|
1561
1561
|
}
|
|
1562
|
-
search(
|
|
1562
|
+
search(e, { limit: t = -1 } = {}) {
|
|
1563
1563
|
const {
|
|
1564
1564
|
includeMatches: s,
|
|
1565
|
-
includeScore:
|
|
1566
|
-
shouldSort:
|
|
1567
|
-
sortFn:
|
|
1565
|
+
includeScore: r,
|
|
1566
|
+
shouldSort: o,
|
|
1567
|
+
sortFn: l,
|
|
1568
1568
|
ignoreFieldNorm: c
|
|
1569
1569
|
} = this.options;
|
|
1570
|
-
let
|
|
1571
|
-
return
|
|
1570
|
+
let u = De(e) ? De(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e);
|
|
1571
|
+
return In(u, { ignoreFieldNorm: c }), o && u.sort(l), wi(t) && t > -1 && (u = u.slice(0, t)), Hn(u, this._docs, {
|
|
1572
1572
|
includeMatches: s,
|
|
1573
|
-
includeScore:
|
|
1573
|
+
includeScore: r
|
|
1574
1574
|
});
|
|
1575
1575
|
}
|
|
1576
|
-
_searchStringList(
|
|
1577
|
-
const
|
|
1578
|
-
return s.forEach(({ v:
|
|
1579
|
-
if (!
|
|
1576
|
+
_searchStringList(e) {
|
|
1577
|
+
const t = xs(e, this.options), { records: s } = this._myIndex, r = [];
|
|
1578
|
+
return s.forEach(({ v: o, i: l, n: c }) => {
|
|
1579
|
+
if (!xe(o))
|
|
1580
1580
|
return;
|
|
1581
|
-
const { isMatch:
|
|
1582
|
-
|
|
1583
|
-
item:
|
|
1584
|
-
idx:
|
|
1585
|
-
matches: [{ score:
|
|
1581
|
+
const { isMatch: u, score: d, indices: m } = t.searchIn(o);
|
|
1582
|
+
u && r.push({
|
|
1583
|
+
item: o,
|
|
1584
|
+
idx: l,
|
|
1585
|
+
matches: [{ score: d, value: o, norm: c, indices: m }]
|
|
1586
1586
|
});
|
|
1587
|
-
}),
|
|
1587
|
+
}), r;
|
|
1588
1588
|
}
|
|
1589
|
-
_searchLogical(
|
|
1590
|
-
const
|
|
1589
|
+
_searchLogical(e) {
|
|
1590
|
+
const t = Li(e, this.options), s = (c, u, d) => {
|
|
1591
1591
|
if (!c.children) {
|
|
1592
|
-
const { keyId:
|
|
1593
|
-
key: this._keyStore.get(
|
|
1594
|
-
value: this._myIndex.getValueForItemAtKeyId(
|
|
1595
|
-
searcher:
|
|
1592
|
+
const { keyId: v, searcher: $ } = c, E = this._findMatches({
|
|
1593
|
+
key: this._keyStore.get(v),
|
|
1594
|
+
value: this._myIndex.getValueForItemAtKeyId(u, v),
|
|
1595
|
+
searcher: $
|
|
1596
1596
|
});
|
|
1597
|
-
return
|
|
1597
|
+
return E && E.length ? [
|
|
1598
1598
|
{
|
|
1599
|
-
idx:
|
|
1600
|
-
item:
|
|
1601
|
-
matches:
|
|
1599
|
+
idx: d,
|
|
1600
|
+
item: u,
|
|
1601
|
+
matches: E
|
|
1602
1602
|
}
|
|
1603
1603
|
] : [];
|
|
1604
1604
|
}
|
|
1605
|
-
const
|
|
1606
|
-
for (let
|
|
1607
|
-
const
|
|
1608
|
-
if (
|
|
1609
|
-
|
|
1610
|
-
else if (c.operator ===
|
|
1605
|
+
const m = [];
|
|
1606
|
+
for (let v = 0, $ = c.children.length; v < $; v += 1) {
|
|
1607
|
+
const E = c.children[v], j = s(E, u, d);
|
|
1608
|
+
if (j.length)
|
|
1609
|
+
m.push(...j);
|
|
1610
|
+
else if (c.operator === Lt.AND)
|
|
1611
1611
|
return [];
|
|
1612
1612
|
}
|
|
1613
|
-
return
|
|
1614
|
-
},
|
|
1615
|
-
return
|
|
1616
|
-
if (
|
|
1617
|
-
let
|
|
1618
|
-
|
|
1619
|
-
|
|
1613
|
+
return m;
|
|
1614
|
+
}, r = this._myIndex.records, o = {}, l = [];
|
|
1615
|
+
return r.forEach(({ $: c, i: u }) => {
|
|
1616
|
+
if (xe(c)) {
|
|
1617
|
+
let d = s(t, c, u);
|
|
1618
|
+
d.length && (o[u] || (o[u] = { idx: u, item: c, matches: [] }, l.push(o[u])), d.forEach(({ matches: m }) => {
|
|
1619
|
+
o[u].matches.push(...m);
|
|
1620
1620
|
}));
|
|
1621
1621
|
}
|
|
1622
|
-
}),
|
|
1622
|
+
}), l;
|
|
1623
1623
|
}
|
|
1624
|
-
_searchObjectList(
|
|
1625
|
-
const
|
|
1626
|
-
return
|
|
1627
|
-
if (!
|
|
1624
|
+
_searchObjectList(e) {
|
|
1625
|
+
const t = xs(e, this.options), { keys: s, records: r } = this._myIndex, o = [];
|
|
1626
|
+
return r.forEach(({ $: l, i: c }) => {
|
|
1627
|
+
if (!xe(l))
|
|
1628
1628
|
return;
|
|
1629
|
-
let
|
|
1630
|
-
s.forEach((
|
|
1631
|
-
|
|
1629
|
+
let u = [];
|
|
1630
|
+
s.forEach((d, m) => {
|
|
1631
|
+
u.push(
|
|
1632
1632
|
...this._findMatches({
|
|
1633
|
-
key:
|
|
1634
|
-
value:
|
|
1635
|
-
searcher:
|
|
1633
|
+
key: d,
|
|
1634
|
+
value: l[m],
|
|
1635
|
+
searcher: t
|
|
1636
1636
|
})
|
|
1637
1637
|
);
|
|
1638
|
-
}),
|
|
1638
|
+
}), u.length && o.push({
|
|
1639
1639
|
idx: c,
|
|
1640
|
-
item:
|
|
1641
|
-
matches:
|
|
1640
|
+
item: l,
|
|
1641
|
+
matches: u
|
|
1642
1642
|
});
|
|
1643
|
-
}),
|
|
1643
|
+
}), o;
|
|
1644
1644
|
}
|
|
1645
|
-
_findMatches({ key:
|
|
1646
|
-
if (!
|
|
1645
|
+
_findMatches({ key: e, value: t, searcher: s }) {
|
|
1646
|
+
if (!xe(t))
|
|
1647
1647
|
return [];
|
|
1648
|
-
let
|
|
1649
|
-
if (
|
|
1650
|
-
|
|
1651
|
-
if (!
|
|
1648
|
+
let r = [];
|
|
1649
|
+
if (Re(t))
|
|
1650
|
+
t.forEach(({ v: o, i: l, n: c }) => {
|
|
1651
|
+
if (!xe(o))
|
|
1652
1652
|
return;
|
|
1653
|
-
const { isMatch:
|
|
1654
|
-
|
|
1655
|
-
score:
|
|
1656
|
-
key:
|
|
1657
|
-
value:
|
|
1658
|
-
idx:
|
|
1653
|
+
const { isMatch: u, score: d, indices: m } = s.searchIn(o);
|
|
1654
|
+
u && r.push({
|
|
1655
|
+
score: d,
|
|
1656
|
+
key: e,
|
|
1657
|
+
value: o,
|
|
1658
|
+
idx: l,
|
|
1659
1659
|
norm: c,
|
|
1660
|
-
indices:
|
|
1660
|
+
indices: m
|
|
1661
1661
|
});
|
|
1662
1662
|
});
|
|
1663
1663
|
else {
|
|
1664
|
-
const { v:
|
|
1665
|
-
c &&
|
|
1664
|
+
const { v: o, n: l } = t, { isMatch: c, score: u, indices: d } = s.searchIn(o);
|
|
1665
|
+
c && r.push({ score: u, key: e, value: o, norm: l, indices: d });
|
|
1666
1666
|
}
|
|
1667
|
-
return
|
|
1667
|
+
return r;
|
|
1668
1668
|
}
|
|
1669
1669
|
}
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
var
|
|
1677
|
-
function
|
|
1670
|
+
st.version = "6.6.2";
|
|
1671
|
+
st.createIndex = Si;
|
|
1672
|
+
st.parseIndex = yn;
|
|
1673
|
+
st.config = D;
|
|
1674
|
+
st.parseQuery = Li;
|
|
1675
|
+
Dn(Tn);
|
|
1676
|
+
var at = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
1677
|
+
function Ti(i) {
|
|
1678
1678
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
1679
1679
|
}
|
|
1680
|
-
var
|
|
1681
|
-
return
|
|
1680
|
+
var Un = "Expected a function", gi = 0 / 0, Fn = "[object Symbol]", Bn = /^\s+|\s+$/g, zn = /^[-+]0x[0-9a-f]+$/i, Wn = /^0b[01]+$/i, Vn = /^0o[0-7]+$/i, Yn = parseInt, Kn = typeof at == "object" && at && at.Object === Object && at, qn = typeof self == "object" && self && self.Object === Object && self, Xn = Kn || qn || Function("return this")(), Jn = Object.prototype, Gn = Jn.toString, Zn = Math.max, Qn = Math.min, fs = function() {
|
|
1681
|
+
return Xn.Date.now();
|
|
1682
1682
|
};
|
|
1683
|
-
function
|
|
1684
|
-
var s,
|
|
1683
|
+
function eo(i, e, t) {
|
|
1684
|
+
var s, r, o, l, c, u, d = 0, m = !1, v = !1, $ = !0;
|
|
1685
1685
|
if (typeof i != "function")
|
|
1686
|
-
throw new TypeError(
|
|
1687
|
-
|
|
1688
|
-
function
|
|
1689
|
-
var
|
|
1690
|
-
return s =
|
|
1686
|
+
throw new TypeError(Un);
|
|
1687
|
+
e = vi(e) || 0, Es(t) && (m = !!t.leading, v = "maxWait" in t, o = v ? Zn(vi(t.maxWait) || 0, e) : o, $ = "trailing" in t ? !!t.trailing : $);
|
|
1688
|
+
function E(F) {
|
|
1689
|
+
var X = s, ie = r;
|
|
1690
|
+
return s = r = void 0, d = F, l = i.apply(ie, X), l;
|
|
1691
1691
|
}
|
|
1692
|
-
function
|
|
1693
|
-
return
|
|
1692
|
+
function j(F) {
|
|
1693
|
+
return d = F, c = setTimeout(le, e), m ? E(F) : l;
|
|
1694
1694
|
}
|
|
1695
|
-
function
|
|
1696
|
-
var
|
|
1697
|
-
return
|
|
1695
|
+
function G(F) {
|
|
1696
|
+
var X = F - u, ie = F - d, z = e - X;
|
|
1697
|
+
return v ? Qn(z, o - ie) : z;
|
|
1698
1698
|
}
|
|
1699
|
-
function
|
|
1700
|
-
var
|
|
1701
|
-
return
|
|
1699
|
+
function ve(F) {
|
|
1700
|
+
var X = F - u, ie = F - d;
|
|
1701
|
+
return u === void 0 || X >= e || X < 0 || v && ie >= o;
|
|
1702
1702
|
}
|
|
1703
|
-
function
|
|
1704
|
-
var
|
|
1705
|
-
if (
|
|
1706
|
-
return
|
|
1707
|
-
c = setTimeout(
|
|
1703
|
+
function le() {
|
|
1704
|
+
var F = fs();
|
|
1705
|
+
if (ve(F))
|
|
1706
|
+
return me(F);
|
|
1707
|
+
c = setTimeout(le, G(F));
|
|
1708
1708
|
}
|
|
1709
|
-
function
|
|
1710
|
-
return c = void 0,
|
|
1709
|
+
function me(F) {
|
|
1710
|
+
return c = void 0, $ && s ? E(F) : (s = r = void 0, l);
|
|
1711
1711
|
}
|
|
1712
|
-
function
|
|
1713
|
-
c !== void 0 && clearTimeout(c),
|
|
1712
|
+
function pe() {
|
|
1713
|
+
c !== void 0 && clearTimeout(c), d = 0, s = u = r = c = void 0;
|
|
1714
1714
|
}
|
|
1715
|
-
function
|
|
1716
|
-
return c === void 0 ?
|
|
1715
|
+
function Ee() {
|
|
1716
|
+
return c === void 0 ? l : me(fs());
|
|
1717
1717
|
}
|
|
1718
|
-
function
|
|
1719
|
-
var
|
|
1720
|
-
if (s = arguments,
|
|
1718
|
+
function ye() {
|
|
1719
|
+
var F = fs(), X = ve(F);
|
|
1720
|
+
if (s = arguments, r = this, u = F, X) {
|
|
1721
1721
|
if (c === void 0)
|
|
1722
|
-
return
|
|
1723
|
-
if (
|
|
1724
|
-
return c = setTimeout(
|
|
1722
|
+
return j(u);
|
|
1723
|
+
if (v)
|
|
1724
|
+
return c = setTimeout(le, e), E(u);
|
|
1725
1725
|
}
|
|
1726
|
-
return c === void 0 && (c = setTimeout(
|
|
1726
|
+
return c === void 0 && (c = setTimeout(le, e)), l;
|
|
1727
1727
|
}
|
|
1728
|
-
return
|
|
1728
|
+
return ye.cancel = pe, ye.flush = Ee, ye;
|
|
1729
1729
|
}
|
|
1730
|
-
function
|
|
1731
|
-
var
|
|
1732
|
-
return !!i && (
|
|
1730
|
+
function Es(i) {
|
|
1731
|
+
var e = typeof i;
|
|
1732
|
+
return !!i && (e == "object" || e == "function");
|
|
1733
1733
|
}
|
|
1734
|
-
function
|
|
1734
|
+
function to(i) {
|
|
1735
1735
|
return !!i && typeof i == "object";
|
|
1736
1736
|
}
|
|
1737
|
-
function
|
|
1738
|
-
return typeof i == "symbol" ||
|
|
1737
|
+
function so(i) {
|
|
1738
|
+
return typeof i == "symbol" || to(i) && Gn.call(i) == Fn;
|
|
1739
1739
|
}
|
|
1740
|
-
function
|
|
1740
|
+
function vi(i) {
|
|
1741
1741
|
if (typeof i == "number")
|
|
1742
1742
|
return i;
|
|
1743
|
-
if (
|
|
1744
|
-
return
|
|
1745
|
-
if (
|
|
1746
|
-
var
|
|
1747
|
-
i =
|
|
1743
|
+
if (so(i))
|
|
1744
|
+
return gi;
|
|
1745
|
+
if (Es(i)) {
|
|
1746
|
+
var e = typeof i.valueOf == "function" ? i.valueOf() : i;
|
|
1747
|
+
i = Es(e) ? e + "" : e;
|
|
1748
1748
|
}
|
|
1749
1749
|
if (typeof i != "string")
|
|
1750
1750
|
return i === 0 ? i : +i;
|
|
1751
|
-
i = i.replace(
|
|
1752
|
-
var
|
|
1753
|
-
return
|
|
1754
|
-
}
|
|
1755
|
-
var
|
|
1756
|
-
const
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
let
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
let
|
|
1765
|
-
return
|
|
1766
|
-
|
|
1751
|
+
i = i.replace(Bn, "");
|
|
1752
|
+
var t = Wn.test(i);
|
|
1753
|
+
return t || Vn.test(i) ? Yn(i.slice(2), t ? 2 : 8) : zn.test(i) ? gi : +i;
|
|
1754
|
+
}
|
|
1755
|
+
var io = eo;
|
|
1756
|
+
const ro = /* @__PURE__ */ Ti(io);
|
|
1757
|
+
(() => {
|
|
1758
|
+
var i = Object.defineProperty, e = Math.pow, t = (n, h, f) => h in n ? i(n, h, { enumerable: !0, configurable: !0, writable: !0, value: f }) : n[h] = f, s = (n, h, f) => (t(n, typeof h != "symbol" ? h + "" : h, f), f), r = (n, h) => ` ${h && h.length > 0 ? h.map((f) => `<link rel="stylesheet" href="${f}" />`).join("") : ""} <style> ${n} </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>`, o = ":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}", l = "pointers-overlap", c = "pointers-min-distance", u = "pointers-max-distance", d = "range-dragging", m = "data", v = "min", $ = "max", E = "step", j = "round", G = "type", ve = "theme", le = "rtl", me = "btt", pe = "disabled", Ee = "keyboard-disabled", ye = "mousewheel-disabled", F = "slider-width", X = "slider-height", ie = "slider-radius", z = "slider-bg", B = "slider-bg-hover", Oe = "slider-bg-fill", Me = "pointer-width", T = "pointer-height", y = "pointer-radius", b = "pointer-bg", k = "pointer-bg-hover", _ = "pointer-bg-focus", P = "pointer-shadow", R = "pointer-shadow-hover", V = "pointer-shadow-focus", se = "pointer-border", Q = "pointer-border-hover", he = "pointer-border-focus", Se = "animate-onclick", ke = "css-links", ue = "vertical", we = "horizontal", Le = (n, h, f, p, x) => {
|
|
1759
|
+
let C = h - n;
|
|
1760
|
+
return C === 0 ? f : (p - f) * (x - n) / C + f;
|
|
1761
|
+
}, ee = (n) => !isNaN(parseFloat(n)) && isFinite(n), K = (n, h) => ee(n) ? Number(n) : h, Ke = (n, h) => h === 0 ? 0 : Math.round(n / h) * h, qe = (n, h = 1 / 0) => {
|
|
1762
|
+
if (h === 1 / 0)
|
|
1763
|
+
return n;
|
|
1764
|
+
let f = e(10, h);
|
|
1765
|
+
return Math.round(n * f) / f;
|
|
1766
|
+
}, de = (n) => n == null ? !1 : typeof n == "boolean" ? n : n.trim().toLowerCase() === "true", Ri = (n, h) => {
|
|
1767
|
+
n.dispatchEvent(new CustomEvent("onPointerClicked", { detail: { $pointer: h } }));
|
|
1768
|
+
}, Pi = (n, h) => {
|
|
1769
|
+
n.dispatchEvent(new CustomEvent("onMouseDown", { detail: { nativeEvent: h } }));
|
|
1770
|
+
}, Ii = (n, h) => {
|
|
1771
|
+
n.dispatchEvent(new CustomEvent("onMouseUp", { detail: { nativeEvent: h } }));
|
|
1772
|
+
}, Ni = (n, h) => {
|
|
1773
|
+
n.dispatchEvent(new CustomEvent("onKeyDown", { detail: { nativeEvent: h } }));
|
|
1774
|
+
}, ji = (n, h) => {
|
|
1775
|
+
if (!h || h.length <= 0)
|
|
1776
|
+
return;
|
|
1777
|
+
let f = h.map((x) => ee(x) ? K(x, x) : x), p = { values: f || [] };
|
|
1778
|
+
p.value = f[0], p.value0 = f[0], p.value1 = f[0];
|
|
1779
|
+
for (let x = 1; x < f.length; x++)
|
|
1780
|
+
p[`value${x + 1}`] = f[x];
|
|
1781
|
+
n.dispatchEvent(new CustomEvent("change", { detail: p }));
|
|
1782
|
+
}, Pt = (n, h, f) => {
|
|
1783
|
+
let p = 0, x, C, I, w, A = !1, N = (L, J, ce, ae, re, ne) => {
|
|
1784
|
+
let be = p;
|
|
1785
|
+
ce !== void 0 && L > ce && (L = ce), J !== void 0 && L < J && (L = J), p = L;
|
|
1786
|
+
let $e = p;
|
|
1787
|
+
return (ae === ue && ne || ae === we && re) && ($e = 100 - $e), ae === ue ? h.style.top = `${$e}%` : h.style.left = `${$e}%`, be !== p;
|
|
1788
|
+
}, U = (L) => L === h || h.contains(L), S = (L, J, ce, ae) => {
|
|
1789
|
+
x = L, C = J, I = ce, w = ae;
|
|
1790
|
+
}, Y = (L) => {
|
|
1791
|
+
A = L, h.classList.toggle("disabled", A), A ? h.setAttribute("aria-disabled", "true") : h.hasAttribute("aria-disabled") && h.removeAttribute("aria-disabled");
|
|
1792
|
+
}, Ae = (L, J) => {
|
|
1793
|
+
J == null ? h.removeAttribute(L) : h.setAttribute(L, J);
|
|
1794
|
+
}, fe = (L) => h.getAttribute(L), O = (L) => {
|
|
1795
|
+
if (!A) {
|
|
1796
|
+
switch (L.key) {
|
|
1797
|
+
case "ArrowLeft": {
|
|
1798
|
+
L.preventDefault(), typeof x == "function" && x(f);
|
|
1799
|
+
break;
|
|
1800
|
+
}
|
|
1801
|
+
case "ArrowRight": {
|
|
1802
|
+
L.preventDefault(), typeof C == "function" && C(f);
|
|
1803
|
+
break;
|
|
1804
|
+
}
|
|
1805
|
+
case "ArrowUp": {
|
|
1806
|
+
L.preventDefault(), typeof I == "function" && I(f);
|
|
1807
|
+
break;
|
|
1808
|
+
}
|
|
1809
|
+
case "ArrowDown": {
|
|
1810
|
+
L.preventDefault(), typeof w == "function" && w(f);
|
|
1811
|
+
break;
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
Ni(n, L);
|
|
1815
|
+
}
|
|
1816
|
+
}, H = () => {
|
|
1817
|
+
A || Ri(n, h);
|
|
1818
|
+
};
|
|
1819
|
+
return h.className = `pointer pointer-${f}`, h.addEventListener("keydown", O), h.addEventListener("click", H), { $pointer: h, get percent() {
|
|
1820
|
+
return p;
|
|
1821
|
+
}, get disabled() {
|
|
1822
|
+
return A;
|
|
1823
|
+
}, set disabled(L) {
|
|
1824
|
+
Y(L);
|
|
1825
|
+
}, updatePosition: N, isClicked: U, setCallbacks: S, setAttr: Ae, getAttr: fe, destroy: () => {
|
|
1826
|
+
h.removeEventListener("keydown", O), h.removeEventListener("click", H), h.remove();
|
|
1827
|
+
} };
|
|
1828
|
+
}, Hi = (n) => {
|
|
1829
|
+
if (n == null)
|
|
1830
|
+
return;
|
|
1831
|
+
if (Array.isArray(n))
|
|
1832
|
+
return n;
|
|
1833
|
+
if (n.trim() === "")
|
|
1834
|
+
return;
|
|
1835
|
+
let h = n.split(","), f = [], p = !0;
|
|
1836
|
+
for (let x = 0; x < h.length; x++) {
|
|
1837
|
+
let C = h[x].trim();
|
|
1838
|
+
C !== "" && (f.push(C), ee(C) || (p = !1));
|
|
1839
|
+
}
|
|
1840
|
+
return p ? f.map((x) => Number(x)) : f;
|
|
1841
|
+
}, Ui = (n, h) => h ? h.findIndex((f) => f === n || f.toString().trim() === n.toString().trim()) : -1, Fi = (n) => ({ updatePosition: (h, f, p, x) => {
|
|
1842
|
+
if (f.length <= 0)
|
|
1843
|
+
return;
|
|
1844
|
+
let C = f.length === 1, I = f[0], w = f[f.length - 1];
|
|
1845
|
+
h === ue ? (n.style.removeProperty("width"), n.style.removeProperty("right"), n.style.removeProperty("left"), C ? n.style.height = `${I}%` : n.style.height = `${Math.abs(I - w)}%`, x ? (n.style.bottom = "0%", C ? n.style.top = "auto" : n.style.top = `${Math.min(100 - w, 100 - I)}%`) : (n.style.bottom = "auto", C ? n.style.top = "0%" : n.style.top = `${Math.min(I, w)}%`)) : (n.style.removeProperty("height"), n.style.removeProperty("top"), n.style.removeProperty("bottom"), C ? n.style.width = `${I}%` : n.style.width = `${Math.abs(I - w)}%`, p ? (n.style.right = "0%", C ? n.style.left = "auto" : n.style.left = `${Math.min(100 - w, 100 - I)}%`) : (n.style.right = "auto", C ? n.style.left = "0%" : n.style.left = `${Math.min(I, w)}%`));
|
|
1846
|
+
} }), ks = "--animate-onclick", Bi = "--width", zi = "--height", Wi = "--panel-bg-border-radius", Vi = "--panel-bg", Yi = "--panel-bg-hover", Ki = "--panel-bg-fill", qi = "--pointer-width", Xi = "--pointer-height", Ji = "--pointer-border-radius", Gi = "--pointer-bg", Zi = "--pointer-bg-hover", Qi = "--pointer-bg-focus", er = "--pointer-shadow", tr = "--pointer-shadow-hover", sr = "--pointer-shadow-focus", ir = "--pointer-border", rr = "--pointer-border-hover", nr = "--pointer-border-focus", ft = (n, h, f) => {
|
|
1847
|
+
let p = /* @__PURE__ */ new Map();
|
|
1848
|
+
for (let x of n.attributes) {
|
|
1849
|
+
let C = x.nodeName.trim().toLowerCase();
|
|
1850
|
+
if (!h.test(C))
|
|
1851
|
+
continue;
|
|
1852
|
+
let I = C.replace(/\D/g, "").trim(), w = I === "" || I === "0" || I === "1" ? 0 : K(I, 0) - 1, A = f && typeof f == "function" ? f(x.value) : x.value;
|
|
1853
|
+
p.set(w, A);
|
|
1854
|
+
}
|
|
1855
|
+
return p;
|
|
1856
|
+
}, or = (n) => {
|
|
1857
|
+
if (!n)
|
|
1858
|
+
return null;
|
|
1859
|
+
let h = n.getAttribute(ke);
|
|
1860
|
+
if (!h)
|
|
1861
|
+
return null;
|
|
1862
|
+
let f = h.split(";"), p = [];
|
|
1863
|
+
for (let x of f)
|
|
1864
|
+
x.trim() !== "" && p.push(x.trim());
|
|
1865
|
+
return p;
|
|
1866
|
+
}, Cs = [[Bi, F, "sliderWidth", null], [zi, X, "sliderHeight", null], [Wi, ie, "sliderRadius", null], [Vi, z, "sliderBg", null], [Yi, B, "sliderBgHover", null], [Ki, Oe, "sliderBgFill", null], [qi, Me, "pointer#Width", /^pointer([0-9]*)-width$/], [Xi, T, "pointer#Height", /^pointer([0-9]*)-height$/], [Ji, y, "pointer#Radius", /^pointer([0-9]*)-radius$/], [Gi, b, "pointer#Bg", /^pointer([0-9]*)-bg$/], [Zi, k, "pointer#BgHover", /^pointer([0-9]*)-bg-hover$/], [Qi, _, "pointer#BgFocus", /^pointer([0-9]*)-bg-focus$/], [er, P, "pointer#Shadow", /^pointer([0-9]*)-shadow$/], [tr, R, "pointer#ShadowHover", /^pointer([0-9]*)-shadow-hover$/], [sr, V, "pointer#ShadowFocus", /^pointer([0-9]*)-shadow-focus$/], [ir, se, "pointer#Border", /^pointer([0-9]*)-border$/], [rr, Q, "pointer#BorderHover", /^pointer([0-9]*)-border-hover$/], [nr, he, "pointer#BorderFocus", /^pointer([0-9]*)-border-focus$/]], lr = (n, h, f) => {
|
|
1867
|
+
let p = null, x = [], C = /* @__PURE__ */ new Map(), I = (O, H = h) => {
|
|
1868
|
+
let L = [...H.classList];
|
|
1869
|
+
for (let J of L)
|
|
1870
|
+
J.startsWith(O) && h.classList.remove(J);
|
|
1871
|
+
}, w = () => {
|
|
1872
|
+
I("shape");
|
|
1873
|
+
let O = h.querySelectorAll(".pointer");
|
|
1874
|
+
for (let H of O)
|
|
1875
|
+
I("shape", H);
|
|
1876
|
+
}, A = (O) => {
|
|
1877
|
+
p = O, I("theme-"), typeof O == "string" && h.classList.add(`theme-${O}`);
|
|
1878
|
+
}, N = () => {
|
|
1879
|
+
if (w(), !(x.length <= 0)) {
|
|
1880
|
+
h.classList.add("shape", `shape-${x[0]}`);
|
|
1881
|
+
for (let O = 1; O < x.length; O++) {
|
|
1882
|
+
let H = x[O];
|
|
1883
|
+
if (!H)
|
|
1884
|
+
continue;
|
|
1885
|
+
let L = h.querySelector(`.pointer-${O}`);
|
|
1886
|
+
!L || L.classList.add("shape", `shape-${H}`);
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
}, U = (O, H) => {
|
|
1890
|
+
x[O] = H, N();
|
|
1891
|
+
}, S = () => {
|
|
1892
|
+
w();
|
|
1893
|
+
let O = ft(n, /^pointer([0-9]*)-shape$/);
|
|
1894
|
+
if (!(O.size <= 0)) {
|
|
1895
|
+
for (let H of O) {
|
|
1896
|
+
let L = H[0];
|
|
1897
|
+
x[L] = H[1];
|
|
1898
|
+
}
|
|
1899
|
+
N();
|
|
1900
|
+
}
|
|
1901
|
+
}, Y = (O, H) => `${O}-${H}`, Ae = (O, H, L) => {
|
|
1902
|
+
let J = f[L];
|
|
1903
|
+
if (!J)
|
|
1904
|
+
return;
|
|
1905
|
+
let ce = L === 0 ? h : J.$pointer;
|
|
1906
|
+
if (H == null) {
|
|
1907
|
+
C.has(Y(O, L)) && C.delete(Y(O, L)), ce.style.removeProperty(O);
|
|
1908
|
+
return;
|
|
1909
|
+
}
|
|
1910
|
+
C.set(Y(O, L), H), ce.style.setProperty(O, H);
|
|
1911
|
+
}, fe = (O, H) => C.get(Y(O, H));
|
|
1912
|
+
return (() => {
|
|
1913
|
+
for (let O of Cs) {
|
|
1914
|
+
let [H, L, J, ce] = O;
|
|
1915
|
+
if (ce) {
|
|
1916
|
+
let re = ft(n, ce);
|
|
1917
|
+
for (let ne of re) {
|
|
1918
|
+
let be = ne[0], $e = ne[1];
|
|
1919
|
+
Ae(H, $e, be);
|
|
1920
|
+
}
|
|
1921
|
+
} else {
|
|
1922
|
+
let re = n.getAttribute(L);
|
|
1923
|
+
Ae(H, re, 0);
|
|
1924
|
+
}
|
|
1925
|
+
let ae = [];
|
|
1926
|
+
if (J.indexOf("#") === -1)
|
|
1927
|
+
ae.push([J, 0]);
|
|
1928
|
+
else {
|
|
1929
|
+
ae.push([J.replace("#", ""), 0]), ae.push([J.replace("#", "0"), 0]), ae.push([J.replace("#", "1"), 0]);
|
|
1930
|
+
for (let re = 1; re < f.length; re++)
|
|
1931
|
+
ae.push([J.replace("#", (re + 1).toString()), re]);
|
|
1932
|
+
}
|
|
1933
|
+
for (let re of ae)
|
|
1934
|
+
try {
|
|
1935
|
+
let ne = re[0], be = re[1];
|
|
1936
|
+
Object.prototype.hasOwnProperty.call(n, ne) || Object.defineProperty(n, ne, { get() {
|
|
1937
|
+
return fe(H, be);
|
|
1938
|
+
}, set: ($e) => {
|
|
1939
|
+
Ae(H, $e, be);
|
|
1940
|
+
} });
|
|
1941
|
+
} catch (ne) {
|
|
1942
|
+
console.error(ne);
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
A(n.getAttribute(ve)), S();
|
|
1946
|
+
})(), { setStyle: Ae, getStyle: fe, get theme() {
|
|
1947
|
+
return p;
|
|
1948
|
+
}, set theme(O) {
|
|
1949
|
+
A(O);
|
|
1950
|
+
}, get pointerShapes() {
|
|
1951
|
+
return x;
|
|
1952
|
+
}, setPointerShape: U };
|
|
1953
|
+
}, Xe = "animate-on-click", Os = "range-dragging", ar = (n, h, f, p) => {
|
|
1954
|
+
let x = [], C = (U) => {
|
|
1955
|
+
for (let S of x)
|
|
1956
|
+
S.update && typeof S.update == "function" && S.update(U);
|
|
1957
|
+
}, I = () => {
|
|
1958
|
+
for (let U of x)
|
|
1959
|
+
U.destroy && typeof U.destroy == "function" && U.destroy();
|
|
1960
|
+
}, w = (U, S) => {
|
|
1961
|
+
for (let Y of x)
|
|
1962
|
+
Y.onAttrChange && typeof Y.onAttrChange == "function" && Y.onAttrChange(U, S);
|
|
1963
|
+
}, A = (U) => {
|
|
1964
|
+
if (U.gettersAndSetters) {
|
|
1965
|
+
for (let S of U.gettersAndSetters)
|
|
1966
|
+
if (!(!S.name || !S.attributes))
|
|
1967
|
+
try {
|
|
1968
|
+
Object.prototype.hasOwnProperty.call(n, S.name) || Object.defineProperty(n, S.name, S.attributes);
|
|
1969
|
+
} catch (Y) {
|
|
1970
|
+
console.error("defineSettersGetters error:", Y);
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
}, N = (U) => {
|
|
1974
|
+
var S;
|
|
1975
|
+
if (!U.css)
|
|
1976
|
+
return;
|
|
1977
|
+
let Y = (S = n.shadowRoot) == null ? void 0 : S.querySelector("style");
|
|
1978
|
+
!Y || (Y.innerHTML += U.css);
|
|
1979
|
+
};
|
|
1980
|
+
return { init: () => {
|
|
1981
|
+
if (window.tcRangeSliderPlugins)
|
|
1982
|
+
for (let U of window.tcRangeSliderPlugins) {
|
|
1983
|
+
let S = U();
|
|
1984
|
+
x.push(S), S.init && typeof S.init == "function" && (S.init(n, h, f, p), A(S), N(S));
|
|
1985
|
+
}
|
|
1986
|
+
}, update: C, onAttrChange: w, destroy: I };
|
|
1987
|
+
}, hr = 10, cr = (n, h) => {
|
|
1988
|
+
let f = /* @__PURE__ */ new Map(), p = /^value([0-9]*)$/;
|
|
1989
|
+
for (let w of n.attributes) {
|
|
1990
|
+
let A = w.nodeName.trim().toLowerCase();
|
|
1991
|
+
if (!p.test(A))
|
|
1992
|
+
continue;
|
|
1993
|
+
let N = A.replace("value", "").trim(), U = N === "" || N === "0" || N === "1" ? 0 : K(N, 0) - 1, S = ee(w.value) ? K(w.value, 0) : w.value;
|
|
1994
|
+
f.set(U, S);
|
|
1995
|
+
}
|
|
1996
|
+
let x = Math.max(...Array.from(f.keys())), C = [];
|
|
1997
|
+
C.push([Pt(n, h, 0), f.get(0)]);
|
|
1998
|
+
let I = h;
|
|
1999
|
+
for (let w = 1; w <= x; w++) {
|
|
2000
|
+
let A = h.cloneNode(!0);
|
|
2001
|
+
I.after(A), I = A, C.push([Pt(n, A, w), f.get(w)]);
|
|
2002
|
+
}
|
|
2003
|
+
return C;
|
|
2004
|
+
}, Ls = (n, h, f, p, x, C, I) => {
|
|
2005
|
+
try {
|
|
2006
|
+
Object.defineProperty(n, p, { configurable: !0, get() {
|
|
2007
|
+
if (!h)
|
|
2008
|
+
return;
|
|
2009
|
+
let w = h.pointers[f];
|
|
2010
|
+
if (!w)
|
|
2011
|
+
return;
|
|
2012
|
+
let A = h.getTextValue(w.percent);
|
|
2013
|
+
return ee(A) ? K(A, A) : A;
|
|
2014
|
+
}, set: (w) => {
|
|
2015
|
+
h.pointers[f] ? h == null || h.setValue(w, f) : h == null || h.addPointer(w);
|
|
2016
|
+
} }), Object.defineProperty(n, x, { configurable: !0, get() {
|
|
2017
|
+
var w, A;
|
|
2018
|
+
return (A = (w = h == null ? void 0 : h.pointers[f]) == null ? void 0 : w.getAttr("aria-label")) != null ? A : void 0;
|
|
2019
|
+
}, set: (w) => {
|
|
2020
|
+
!h || h.setAriaLabel(f, w);
|
|
2021
|
+
} }), Object.defineProperty(n, C, { configurable: !0, get() {
|
|
2022
|
+
var w, A;
|
|
2023
|
+
return (A = (w = h == null ? void 0 : h.styles) == null ? void 0 : w.pointerShapes[f]) != null ? A : null;
|
|
2024
|
+
}, set: (w) => {
|
|
2025
|
+
!h || !h.styles || h.styles.setPointerShape(f, w);
|
|
2026
|
+
} }), Object.defineProperty(n, I, { configurable: !0, get() {
|
|
2027
|
+
var w;
|
|
2028
|
+
return (w = h == null ? void 0 : h.pointers[f].disabled) != null ? w : !1;
|
|
2029
|
+
}, set: (w) => {
|
|
2030
|
+
if (!h)
|
|
2031
|
+
return;
|
|
2032
|
+
let A = h == null ? void 0 : h.pointers[f];
|
|
2033
|
+
!A || (A.disabled = w);
|
|
2034
|
+
} });
|
|
2035
|
+
} catch (w) {
|
|
2036
|
+
console.error(w);
|
|
2037
|
+
}
|
|
2038
|
+
}, ur = (n, h) => {
|
|
2039
|
+
let f = [["value", "ariaLabel", "pointerShape", "pointerDisabled", 0], ["value0", "ariaLabel0", "pointerShape0", "pointer0Disabled", 0], ["value1", "ariaLabel1", "pointerShape1", "pointer1Disabled", 0]];
|
|
2040
|
+
for (let p = 2; p < hr; p++)
|
|
2041
|
+
f.push([`value${p}`, `ariaLabel${p}`, `pointer${p}Shape`, `pointer${p}Disabled`, p - 1]);
|
|
2042
|
+
for (let p of f)
|
|
2043
|
+
Ls(n, h, p[4], p[0], p[1], p[2], p[3]);
|
|
2044
|
+
}, Ts = (n, h, f) => {
|
|
2045
|
+
var p;
|
|
2046
|
+
let x = (p = f.shadowRoot) == null ? void 0 : p.querySelector(".container");
|
|
2047
|
+
if (x)
|
|
2048
|
+
for (let C of n)
|
|
2049
|
+
h ? x.prepend(C.$pointer) : x.append(C.$pointer);
|
|
2050
|
+
}, It = 0, it = 100, Je = 2, Ds = "0.3s", dr = (n, h, f) => {
|
|
2051
|
+
let p = f.map((a) => a[0]), x = null, C = null, I = null, w = null, A = It, N = it, U, S, Y = we, Ae = Je, fe = !1, O = !1, H = !1, L = 0, J = 1 / 0, ce = !1, ae, re, ne = !1, be = !1, $e = !1, Ie = Ds, Rs = [], Ps = (a) => {
|
|
2052
|
+
ne || (a.preventDefault && a.preventDefault(), Ue(a), window.addEventListener("mousemove", Ue), window.addEventListener("mouseup", gt), Pi(n, a));
|
|
2053
|
+
}, gt = (a) => {
|
|
2054
|
+
ne || (ae = void 0, re = void 0, window.removeEventListener("mousemove", Ue), window.removeEventListener("mouseup", gt), Ie && h.classList.add(Xe), Ii(n, a));
|
|
2055
|
+
}, gr = (a, g) => {
|
|
2056
|
+
if (p.length <= 0)
|
|
2057
|
+
return;
|
|
2058
|
+
if (p.length === 1)
|
|
2059
|
+
return p[0].isClicked(a) && Ie && h.classList.remove(Xe), p[0];
|
|
2060
|
+
let M = mr(a);
|
|
2061
|
+
if (ce) {
|
|
2062
|
+
let W = g, Ce = mt(W);
|
|
2063
|
+
Ce !== void 0 && (W = Ke(W, Ce)), M ? (ae = W, re = 0, Ie && h.classList.remove(Xe)) : ae !== void 0 && (re = W - ae, ae = W);
|
|
2064
|
+
}
|
|
2065
|
+
if (!vr(a) && !M) {
|
|
2066
|
+
for (let W of p)
|
|
2067
|
+
if (!(!W.isClicked(a) || W.disabled))
|
|
2068
|
+
return Ie && h.classList.remove(Xe), W;
|
|
2069
|
+
for (let W of p)
|
|
2070
|
+
if (x === W)
|
|
2071
|
+
return W;
|
|
2072
|
+
}
|
|
2073
|
+
let q = 1 / 0, oe = null;
|
|
2074
|
+
for (let W of p) {
|
|
2075
|
+
if (W.disabled)
|
|
2076
|
+
continue;
|
|
2077
|
+
let Ce = Math.abs(g - W.percent);
|
|
2078
|
+
Ce < q && (q = Ce, oe = W);
|
|
2079
|
+
}
|
|
2080
|
+
return oe;
|
|
2081
|
+
}, Is = () => p.findIndex((a) => x === a && !a.disabled), Ue = (a) => {
|
|
2082
|
+
let g;
|
|
2083
|
+
if (Y === ue) {
|
|
2084
|
+
let { height: q, top: oe } = h.getBoundingClientRect(), W = a.type.indexOf("mouse") !== -1 ? a.clientY : a.touches[0].clientY;
|
|
2085
|
+
g = Math.min(Math.max(0, W - oe), q) * 100 / q;
|
|
2086
|
+
} else {
|
|
2087
|
+
let { width: q, left: oe } = h.getBoundingClientRect(), W = a.type.indexOf("mouse") !== -1 ? a.clientX : a.touches[0].clientX;
|
|
2088
|
+
g = Math.min(Math.max(0, W - oe), q) * 100 / q;
|
|
2089
|
+
}
|
|
2090
|
+
if ((fe || O) && (g = 100 - g), x = gr(a.target, g), ce && p.length > 1 && re !== void 0) {
|
|
2091
|
+
let q = p[0], oe = p[p.length - 1], W = q.percent + re < 0, Ce = oe.percent + re > 100;
|
|
2092
|
+
if (W || Ce)
|
|
2093
|
+
return;
|
|
2094
|
+
for (let Et = 0; Et < p.length; Et++)
|
|
2095
|
+
_e(Et, p[Et].percent + re);
|
|
2096
|
+
return;
|
|
2097
|
+
}
|
|
2098
|
+
let M = Is();
|
|
2099
|
+
M !== -1 && (_e(M, g), x == null || x.$pointer.focus());
|
|
2100
|
+
}, vt = (a) => {
|
|
2101
|
+
if (ne || document.activeElement !== n || x != null && x.disabled)
|
|
2102
|
+
return;
|
|
2103
|
+
a.stopPropagation(), a.preventDefault();
|
|
2104
|
+
let g = a.deltaY < 0, M = fe || O, q = g ? !M : M, oe = Is();
|
|
2105
|
+
oe !== -1 && (q ? rt(oe, p[oe].percent) : nt(oe, p[oe].percent));
|
|
2106
|
+
}, Ns = (a) => {
|
|
2107
|
+
ne || be || (Y === ue ? O ? _e(a, 100) : _e(a, 0) : fe ? nt(a, p[a].percent) : rt(a, p[a].percent));
|
|
2108
|
+
}, js = (a) => {
|
|
2109
|
+
ne || be || (Y === ue ? O ? _e(a, 0) : _e(a, 100) : fe ? rt(a, p[a].percent) : nt(a, p[a].percent));
|
|
2110
|
+
}, Hs = (a) => {
|
|
2111
|
+
ne || be || (Y === ue ? O ? nt(a, p[a].percent) : rt(a, p[a].percent) : fe ? _e(a, 100) : _e(a, 0));
|
|
2112
|
+
}, Us = (a) => {
|
|
2113
|
+
ne || be || (Y === ue ? O ? rt(a, p[a].percent) : nt(a, p[a].percent) : fe ? _e(a, 0) : _e(a, 100));
|
|
2114
|
+
}, vr = (a) => a.classList.contains("panel"), mr = (a) => a.classList.contains("panel-fill"), rt = (a, g) => {
|
|
2115
|
+
if (g === void 0)
|
|
2116
|
+
return;
|
|
2117
|
+
let M = mt(g);
|
|
2118
|
+
M == null && (M = 1), g -= M, g < 0 && (g = 0), _e(a, g);
|
|
2119
|
+
}, nt = (a, g) => {
|
|
2120
|
+
if (g === void 0)
|
|
2121
|
+
return;
|
|
2122
|
+
let M = mt(g);
|
|
2123
|
+
M == null && (M = 1), g += M, g > 100 && (g = 100), _e(a, g);
|
|
2124
|
+
}, Fe = () => {
|
|
2125
|
+
!w || w.update({ percents: Fs(), values: Bs(), $pointers: zs(), min: Ws(), max: Vs(), data: Ht(), step: jt(), round: Ft(), type: Ut(), textMin: yt(), textMax: bt(), rightToLeft: Wt(), bottomToTop: Vt(), pointersOverlap: Xt(), pointersMinDistance: Bt(), pointersMaxDistance: zt(), rangeDragging: Jt(), disabled: Yt(), keyboardDisabled: Kt(), mousewheelDisabled: qt() });
|
|
2126
|
+
}, yr = () => {
|
|
2127
|
+
Fe();
|
|
2128
|
+
}, br = (a) => {
|
|
2129
|
+
if (!(H || p.length <= 1 || N === A))
|
|
2130
|
+
if (a === 0) {
|
|
2131
|
+
let g = J * 100 / (N - A);
|
|
2132
|
+
return Math.max(0, p[a + 1].percent - g);
|
|
2133
|
+
} else {
|
|
2134
|
+
let g = L * 100 / (N - A);
|
|
2135
|
+
return Math.min(p[a - 1].percent + g, 100);
|
|
2136
|
+
}
|
|
2137
|
+
}, $r = (a) => {
|
|
2138
|
+
if (!(H || p.length <= 1 || N === A))
|
|
2139
|
+
if (a === p.length - 1) {
|
|
2140
|
+
let g = J * 100 / (N - A);
|
|
2141
|
+
return Math.min(p[a - 1].percent + g, 100);
|
|
2142
|
+
} else {
|
|
2143
|
+
let g = L * 100 / (N - A);
|
|
2144
|
+
return Math.max(0, p[a + 1].percent - g);
|
|
2145
|
+
}
|
|
2146
|
+
}, mt = (a) => {
|
|
2147
|
+
let g;
|
|
2148
|
+
if (typeof U == "function") {
|
|
2149
|
+
let M = Le(0, 100, A, N, a);
|
|
2150
|
+
g = U(M, a);
|
|
2151
|
+
} else
|
|
2152
|
+
g = U;
|
|
2153
|
+
if (ee(g)) {
|
|
2154
|
+
let M = N - A;
|
|
2155
|
+
return g = M === 0 ? 0 : g * 100 / M, g;
|
|
2156
|
+
}
|
|
2157
|
+
}, Ge = (a) => {
|
|
2158
|
+
if (a === void 0)
|
|
2159
|
+
return;
|
|
2160
|
+
let g = Le(0, 100, A, N, a);
|
|
2161
|
+
return S !== void 0 ? S[Math.round(g)] : qe(g, Ae);
|
|
2162
|
+
}, yt = () => S !== void 0 ? S[A] : A, bt = () => S !== void 0 ? S[N] : N, jt = () => U, _r = (a) => {
|
|
2163
|
+
var g;
|
|
2164
|
+
return a <= 0 || H ? yt() : (g = Ge(p[a - 1].percent)) != null ? g : "";
|
|
2165
|
+
}, xr = (a) => {
|
|
2166
|
+
var g;
|
|
2167
|
+
return p.length <= 1 || a >= p.length - 1 || H ? bt() : (g = Ge(p[a + 1].percent)) != null ? g : "";
|
|
2168
|
+
}, Fs = () => p.map((a) => a.percent), Bs = () => p.map((a) => Ge(a.percent)), zs = () => p.map((a) => a.$pointer), Ws = () => A, Vs = () => N, Ht = () => S, Ut = () => Y, Ft = () => Ae, Bt = () => L, zt = () => J, wr = (a) => Rs[a], Wt = () => fe, Vt = () => O, Yt = () => ne, Kt = () => be, qt = () => $e, Xt = () => H, Jt = () => ce, _e = (a, g) => {
|
|
2169
|
+
if (g === void 0)
|
|
2170
|
+
return;
|
|
2171
|
+
let M = mt(g);
|
|
2172
|
+
M !== void 0 && (g = Ke(g, M));
|
|
2173
|
+
let q = p[a];
|
|
2174
|
+
if (!q)
|
|
2175
|
+
return;
|
|
2176
|
+
let oe = q.updatePosition(g, br(a), $r(a), Y, fe, O);
|
|
2177
|
+
C == null || C.updatePosition(Y, p.map((W) => W.percent), fe, O), Fe();
|
|
2178
|
+
for (let W of p) {
|
|
2179
|
+
let Ce = Ge(W.percent);
|
|
2180
|
+
Ce !== void 0 && (W.setAttr("aria-valuenow", Ce.toString()), W.setAttr("aria-valuetext", Ce.toString()));
|
|
2181
|
+
}
|
|
2182
|
+
Er(), oe && ji(n, p.map((W) => Ge(W.percent)));
|
|
2183
|
+
}, Te = () => {
|
|
2184
|
+
for (let a = 0; a < p.length; a++)
|
|
2185
|
+
_e(a, p[a].percent);
|
|
2186
|
+
}, Ar = (a, g) => {
|
|
2187
|
+
A = S !== void 0 ? 0 : K(a, It), N = S !== void 0 ? S.length - 1 : K(g, it), $t(A), _t(N);
|
|
2188
|
+
}, Er = () => {
|
|
2189
|
+
var a, g;
|
|
2190
|
+
for (let M = 0; M < p.length; M++) {
|
|
2191
|
+
let q = p[M];
|
|
2192
|
+
q.setAttr("aria-valuemin", ((a = _r(M)) != null ? a : "").toString()), q.setAttr("aria-valuemax", ((g = xr(M)) != null ? g : "").toString());
|
|
2193
|
+
}
|
|
2194
|
+
}, $t = (a) => {
|
|
2195
|
+
A = K(a, It), A > N && (N = A + it), Te();
|
|
2196
|
+
}, _t = (a) => {
|
|
2197
|
+
N = K(a, it), N < A && (N = A + it), Te();
|
|
2198
|
+
}, Ys = (a) => {
|
|
2199
|
+
H = !0;
|
|
2200
|
+
for (let g = 0; g < a.length; g++)
|
|
2201
|
+
xt(a[g], g);
|
|
2202
|
+
H = !1;
|
|
2203
|
+
for (let g = 0; g < a.length; g++)
|
|
2204
|
+
xt(a[g], g);
|
|
2205
|
+
}, xt = (a, g) => {
|
|
2206
|
+
let M;
|
|
2207
|
+
S !== void 0 ? (M = a == null ? 0 : Ui(a, S), M === -1 && (M = 0)) : (M = K(a, A), M < A && (M = A), M > N && (M = N));
|
|
2208
|
+
let q = Le(A, N, 0, 100, M);
|
|
2209
|
+
_e(g, q);
|
|
2210
|
+
}, wt = (a) => {
|
|
2211
|
+
if (a == null) {
|
|
2212
|
+
U = void 0;
|
|
2213
|
+
return;
|
|
2214
|
+
}
|
|
2215
|
+
if (typeof a == "function") {
|
|
2216
|
+
U = a, Te();
|
|
2217
|
+
return;
|
|
2218
|
+
}
|
|
2219
|
+
if (ee(a)) {
|
|
2220
|
+
U = K(a, 1);
|
|
2221
|
+
let g = Math.abs(N - A);
|
|
2222
|
+
U > g && (U = void 0), Te();
|
|
2223
|
+
return;
|
|
2224
|
+
}
|
|
2225
|
+
U = void 0;
|
|
2226
|
+
}, Gt = (a) => {
|
|
2227
|
+
H = a, Te();
|
|
2228
|
+
}, Zt = (a) => {
|
|
2229
|
+
(!ee(a) || a < 0) && (a = 0), L = a;
|
|
2230
|
+
}, Qt = (a) => {
|
|
2231
|
+
(!ee(a) || a < 0) && (a = 1 / 0), J = a;
|
|
2232
|
+
}, es = (a) => {
|
|
2233
|
+
ne = a, h.classList.toggle("disabled", ne), ne ? h.setAttribute("aria-disabled", "true") : h.hasAttribute("aria-disabled") && h.removeAttribute("aria-disabled");
|
|
2234
|
+
}, Ks = (a) => {
|
|
2235
|
+
be = a;
|
|
2236
|
+
}, qs = (a) => {
|
|
2237
|
+
$e = a, $e ? document.removeEventListener("wheel", vt) : document.addEventListener("wheel", vt, { passive: !1 });
|
|
2238
|
+
}, ts = (a) => {
|
|
2239
|
+
if (a == null) {
|
|
2240
|
+
S = void 0;
|
|
2241
|
+
return;
|
|
2242
|
+
}
|
|
2243
|
+
if (S = Hi(a), S === void 0 || S.length <= 0) {
|
|
2244
|
+
S = void 0;
|
|
2245
|
+
return;
|
|
2246
|
+
}
|
|
2247
|
+
$t(0), _t(S.length - 1), U === void 0 && wt(1);
|
|
2248
|
+
}, ss = (a) => {
|
|
2249
|
+
var g;
|
|
2250
|
+
typeof a == "string" ? Y = a.trim().toLowerCase() === ue ? ue : we : Y = we;
|
|
2251
|
+
let M = (g = n.shadowRoot) == null ? void 0 : g.querySelector(".range-slider-box");
|
|
2252
|
+
if (!M)
|
|
2253
|
+
return;
|
|
2254
|
+
M.className = `range-slider-box type-${Y}`, Te();
|
|
2255
|
+
let q = Y === ue ? "vertical" : "horizontal";
|
|
2256
|
+
for (let oe of p)
|
|
2257
|
+
oe.setAttr("aria-orientation", q);
|
|
2258
|
+
}, is = (a) => {
|
|
2259
|
+
fe = a, p.length > 1 && Ts(p, fe, n), Te(), Fe();
|
|
2260
|
+
}, rs = (a) => {
|
|
2261
|
+
O = a, p.length > 1 && Ts(p, O, n), Te(), Fe();
|
|
2262
|
+
}, ns = (a) => {
|
|
2263
|
+
Ae = K(a, Je), Ae < 0 && (Ae = Je), Fe();
|
|
2264
|
+
}, Xs = (a) => {
|
|
2265
|
+
a == null || a.toString().trim().toLowerCase() === "false" ? (Ie = void 0, h.style.removeProperty(ks), h.classList.remove(Xe)) : (Ie = a.toString(), h.style.setProperty(ks, Ie), h.classList.add(Xe));
|
|
2266
|
+
}, Js = (a, g) => {
|
|
2267
|
+
let M = p[a];
|
|
2268
|
+
!M || (M.setAttr("aria-label", g), Rs[a] = g);
|
|
2269
|
+
}, At = (a) => {
|
|
2270
|
+
if (ae = void 0, p.length <= 1) {
|
|
2271
|
+
ce = !1, h.classList.remove(Os);
|
|
2272
|
+
return;
|
|
2273
|
+
}
|
|
2274
|
+
ce = a, h.classList.toggle(Os, ce);
|
|
2275
|
+
}, Mr = () => {
|
|
2276
|
+
es(de(n.getAttribute(pe))), be = de(n.getAttribute(Ee)), $e = de(n.getAttribute(ye));
|
|
2277
|
+
let a = ft(n, /^pointer([0-9]*)-disabled$/, (g) => de(g));
|
|
2278
|
+
for (let g of a) {
|
|
2279
|
+
let M = g[0];
|
|
2280
|
+
!p[M] || (p[M].disabled = g[1]);
|
|
2281
|
+
}
|
|
2282
|
+
}, Sr = () => {
|
|
2283
|
+
let a = ft(n, /^aria-label([0-9]*)$/);
|
|
2284
|
+
for (let g of a) {
|
|
2285
|
+
let M = g[0];
|
|
2286
|
+
Js(M, g[1]);
|
|
2287
|
+
}
|
|
2288
|
+
}, kr = (a) => {
|
|
2289
|
+
let g = p.length, M = p[g - 1].$pointer, q = M.cloneNode(!0);
|
|
2290
|
+
M.after(q);
|
|
2291
|
+
let oe = Pt(n, q, g);
|
|
2292
|
+
return oe.setCallbacks(Ns, js, Hs, Us), p.push(oe), xt(a, g), Te(), Fe(), g;
|
|
2293
|
+
}, Cr = () => {
|
|
2294
|
+
let a = p.length, g = p[a - 1];
|
|
2295
|
+
return g ? (g.destroy(), p.pop(), p.length <= 1 && At(!1), Te(), Fe(), a - 1) : -1;
|
|
2296
|
+
};
|
|
2297
|
+
return (() => {
|
|
2298
|
+
var a, g;
|
|
2299
|
+
for (let q of p)
|
|
2300
|
+
q.setCallbacks(Ns, js, Hs, Us);
|
|
2301
|
+
let M = (a = n.shadowRoot) == null ? void 0 : a.querySelector(".panel-fill");
|
|
2302
|
+
M && (C = Fi(M)), ss(n.getAttribute(G)), is(de(n.getAttribute(le))), rs(de(n.getAttribute(me))), Ar(n.getAttribute(v), n.getAttribute($)), wt(n.getAttribute(E)), ts(n.getAttribute(m)), Ys(f.map((q) => q[1])), Gt(de(n.getAttribute(l))), Zt(K(n.getAttribute(c), 0)), Qt(K(n.getAttribute(u), 1 / 0)), At(de(n.getAttribute(d))), ns(K(n.getAttribute(j), Je)), Mr(), Sr(), I = lr(n, h, p), Xs((g = n.getAttribute(Se)) != null ? g : Ds), h.addEventListener("mousedown", Ps), h.addEventListener("mouseup", gt), h.addEventListener("touchmove", Ue), h.addEventListener("touchstart", Ue), $e || document.addEventListener("wheel", vt, { passive: !1 }), w = ar(n, yr, { setValues: Ys, setMin: $t, setMax: _t, setStep: wt, setPointersOverlap: Gt, setPointersMinDistance: Zt, setPointersMaxDistance: Qt, setDisabled: es, setType: ss, setRightToLeft: is, setBottomToTop: rs, setRound: ns, setKeyboardDisabled: Ks, setMousewheelDisabled: qs, setRangeDragging: At, setData: ts }, { getPercents: Fs, getValues: Bs, getPointerElements: zs, getMin: Ws, getMax: Vs, getStep: jt, getData: Ht, getType: Ut, getRound: Ft, getTextMin: yt, getTextMax: bt, isRightToLeft: Wt, isBottomToTop: Vt, isDisabled: Yt, isKeyboardDisabled: Kt, isMousewheelDisabled: qt, isPointersOverlap: Xt, isRangeDraggingEnabled: Jt, getPointersMinDistance: Bt, getPointersMaxDistance: zt }), w.init();
|
|
2303
|
+
})(), { get pointers() {
|
|
2304
|
+
return p;
|
|
2305
|
+
}, get styles() {
|
|
2306
|
+
return I;
|
|
2307
|
+
}, get pluginsManager() {
|
|
2308
|
+
return w;
|
|
2309
|
+
}, get min() {
|
|
2310
|
+
return yt();
|
|
2311
|
+
}, get max() {
|
|
2312
|
+
return bt();
|
|
2313
|
+
}, get step() {
|
|
2314
|
+
return jt();
|
|
2315
|
+
}, get pointersOverlap() {
|
|
2316
|
+
return Xt();
|
|
2317
|
+
}, set pointersOverlap(a) {
|
|
2318
|
+
Gt(a);
|
|
2319
|
+
}, get pointersMinDistance() {
|
|
2320
|
+
return Bt();
|
|
2321
|
+
}, set pointersMinDistance(a) {
|
|
2322
|
+
Zt(a);
|
|
2323
|
+
}, get pointersMaxDistance() {
|
|
2324
|
+
return zt();
|
|
2325
|
+
}, set pointersMaxDistance(a) {
|
|
2326
|
+
Qt(a);
|
|
2327
|
+
}, get disabled() {
|
|
2328
|
+
return Yt();
|
|
2329
|
+
}, set disabled(a) {
|
|
2330
|
+
es(a);
|
|
2331
|
+
}, get data() {
|
|
2332
|
+
return Ht();
|
|
2333
|
+
}, get type() {
|
|
2334
|
+
return Ut();
|
|
2335
|
+
}, set type(a) {
|
|
2336
|
+
ss(a);
|
|
2337
|
+
}, get rightToLeft() {
|
|
2338
|
+
return Wt();
|
|
2339
|
+
}, set rightToLeft(a) {
|
|
2340
|
+
is(a);
|
|
2341
|
+
}, get bottomToTop() {
|
|
2342
|
+
return Vt();
|
|
2343
|
+
}, set bottomToTop(a) {
|
|
2344
|
+
rs(a);
|
|
2345
|
+
}, get round() {
|
|
2346
|
+
return Ft();
|
|
2347
|
+
}, set round(a) {
|
|
2348
|
+
ns(a);
|
|
2349
|
+
}, get animateOnClick() {
|
|
2350
|
+
return Ie;
|
|
2351
|
+
}, set animateOnClick(a) {
|
|
2352
|
+
Xs(a);
|
|
2353
|
+
}, get keyboardDisabled() {
|
|
2354
|
+
return Kt();
|
|
2355
|
+
}, set keyboardDisabled(a) {
|
|
2356
|
+
Ks(a);
|
|
2357
|
+
}, get mousewheelDisabled() {
|
|
2358
|
+
return qt();
|
|
2359
|
+
}, set mousewheelDisabled(a) {
|
|
2360
|
+
qs(a);
|
|
2361
|
+
}, get rangeDragging() {
|
|
2362
|
+
return Jt();
|
|
2363
|
+
}, set rangeDragging(a) {
|
|
2364
|
+
At(a);
|
|
2365
|
+
}, setMin: $t, setMax: _t, setValue: xt, setStep: wt, setData: ts, getTextValue: Ge, setAriaLabel: Js, getAriaLabel: wr, addPointer: kr, removePointer: Cr, destroy: () => {
|
|
2366
|
+
h.removeEventListener("mousedown", Ps), h.removeEventListener("mouseup", gt), h.removeEventListener("touchmove", Ue), h.removeEventListener("touchstart", Ue), document.removeEventListener("wheel", vt);
|
|
2367
|
+
for (let a of p)
|
|
2368
|
+
a.destroy();
|
|
2369
|
+
w == null || w.destroy();
|
|
2370
|
+
} };
|
|
2371
|
+
}, pr = (n, h, f) => {
|
|
2372
|
+
let p = Cs.find(([w, A, N, U]) => A.replace("#", "") === h.replace(/\d+/g, ""));
|
|
2373
|
+
if (p && n.styles) {
|
|
2374
|
+
let [w, A, N, U] = p, S = h.replace(/\D/g, "").trim(), Y = S === "" || S === "0" || S === "1" ? 0 : K(S, 0) - 1;
|
|
2375
|
+
n.styles.setStyle(w, f, Y);
|
|
2376
|
+
return;
|
|
2377
|
+
}
|
|
2378
|
+
switch (n && n.pluginsManager && n.pluginsManager.onAttrChange(h, f), h) {
|
|
2379
|
+
case v: {
|
|
2380
|
+
n.setMin(f);
|
|
2381
|
+
break;
|
|
2382
|
+
}
|
|
2383
|
+
case $: {
|
|
2384
|
+
n.setMax(f);
|
|
2385
|
+
break;
|
|
2386
|
+
}
|
|
2387
|
+
case E: {
|
|
2388
|
+
n.setStep(f);
|
|
2389
|
+
break;
|
|
2390
|
+
}
|
|
2391
|
+
case l: {
|
|
2392
|
+
n.pointersOverlap = de(f);
|
|
2393
|
+
break;
|
|
2394
|
+
}
|
|
2395
|
+
case c: {
|
|
2396
|
+
n.pointersMinDistance = K(f, 0);
|
|
2397
|
+
break;
|
|
2398
|
+
}
|
|
2399
|
+
case d: {
|
|
2400
|
+
n.rangeDragging = de(f);
|
|
2401
|
+
break;
|
|
2402
|
+
}
|
|
2403
|
+
case u: {
|
|
2404
|
+
n.pointersMaxDistance = K(f, 1 / 0);
|
|
2405
|
+
break;
|
|
2406
|
+
}
|
|
2407
|
+
case pe: {
|
|
2408
|
+
n.disabled = de(f);
|
|
2409
|
+
break;
|
|
2410
|
+
}
|
|
2411
|
+
case Ee: {
|
|
2412
|
+
n.keyboardDisabled = de(f);
|
|
2413
|
+
break;
|
|
2414
|
+
}
|
|
2415
|
+
case ye: {
|
|
2416
|
+
n.mousewheelDisabled = de(f);
|
|
2417
|
+
break;
|
|
2418
|
+
}
|
|
2419
|
+
case m: {
|
|
2420
|
+
n.setData(f);
|
|
2421
|
+
break;
|
|
2422
|
+
}
|
|
2423
|
+
case G: {
|
|
2424
|
+
n.type = f;
|
|
2425
|
+
break;
|
|
2426
|
+
}
|
|
2427
|
+
case le: {
|
|
2428
|
+
n.rightToLeft = de(f);
|
|
2429
|
+
break;
|
|
2430
|
+
}
|
|
2431
|
+
case me: {
|
|
2432
|
+
n.bottomToTop = de(f);
|
|
2433
|
+
break;
|
|
2434
|
+
}
|
|
2435
|
+
case j: {
|
|
2436
|
+
n.round = K(f, Je);
|
|
2437
|
+
break;
|
|
2438
|
+
}
|
|
2439
|
+
case ve: {
|
|
2440
|
+
n.styles && (n.styles.theme = f);
|
|
2441
|
+
break;
|
|
2442
|
+
}
|
|
2443
|
+
case Se: {
|
|
2444
|
+
n.animateOnClick = f;
|
|
2445
|
+
break;
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
let x = null;
|
|
2449
|
+
if (/^value([0-9]*)$/.test(h) && (x = "value"), /^pointer([0-9]*)-disabled$/.test(h) && (x = "pointer-disabled"), /^aria-label([0-9]*)$/.test(h) && (x = "aria-label"), /^pointer([0-9]*)-shape$/.test(h) && (x = "pointer-shape"), !x)
|
|
2450
|
+
return;
|
|
2451
|
+
let C = h.replace(/\D/g, "").trim(), I = C === "" || C === "0" || C === "1" ? 0 : K(C, 0) - 1;
|
|
2452
|
+
switch (x) {
|
|
2453
|
+
case "value": {
|
|
2454
|
+
n.setValue(f, I);
|
|
2455
|
+
break;
|
|
2456
|
+
}
|
|
2457
|
+
case "pointer-disabled": {
|
|
2458
|
+
let w = n == null ? void 0 : n.pointers[I];
|
|
2459
|
+
if (!w)
|
|
2460
|
+
return;
|
|
2461
|
+
w.disabled = de(f);
|
|
2462
|
+
break;
|
|
2463
|
+
}
|
|
2464
|
+
case "aria-label": {
|
|
2465
|
+
n.setAriaLabel(I, f);
|
|
2466
|
+
break;
|
|
2467
|
+
}
|
|
2468
|
+
case "pointer-shape": {
|
|
2469
|
+
n.styles && n.styles.setPointerShape(I, f);
|
|
2470
|
+
break;
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
}, fr = class extends HTMLElement {
|
|
2474
|
+
constructor() {
|
|
2475
|
+
super(), s(this, "slider"), s(this, "_externalCSSList", []), s(this, "_observer", null), this.attachShadow({ mode: "open" });
|
|
2476
|
+
}
|
|
2477
|
+
set step(n) {
|
|
2478
|
+
this.slider && this.slider.setStep(n);
|
|
2479
|
+
}
|
|
2480
|
+
get step() {
|
|
2481
|
+
var n;
|
|
2482
|
+
return (n = this.slider) == null ? void 0 : n.step;
|
|
2483
|
+
}
|
|
2484
|
+
set disabled(n) {
|
|
2485
|
+
this.slider && (this.slider.disabled = n);
|
|
2486
|
+
}
|
|
2487
|
+
get disabled() {
|
|
2488
|
+
var n, h;
|
|
2489
|
+
return (h = (n = this.slider) == null ? void 0 : n.disabled) != null ? h : !1;
|
|
2490
|
+
}
|
|
2491
|
+
set data(n) {
|
|
2492
|
+
var h;
|
|
2493
|
+
(h = this.slider) == null || h.setData(n);
|
|
2494
|
+
}
|
|
2495
|
+
get data() {
|
|
2496
|
+
var n;
|
|
2497
|
+
return (n = this.slider) == null ? void 0 : n.data;
|
|
2498
|
+
}
|
|
2499
|
+
set min(n) {
|
|
2500
|
+
var h;
|
|
2501
|
+
(h = this.slider) == null || h.setMin(n);
|
|
2502
|
+
}
|
|
2503
|
+
get min() {
|
|
2504
|
+
var n;
|
|
2505
|
+
return (n = this.slider) == null ? void 0 : n.min;
|
|
2506
|
+
}
|
|
2507
|
+
set max(n) {
|
|
2508
|
+
var h;
|
|
2509
|
+
(h = this.slider) == null || h.setMax(n);
|
|
2510
|
+
}
|
|
2511
|
+
get max() {
|
|
2512
|
+
var n;
|
|
2513
|
+
return (n = this.slider) == null ? void 0 : n.max;
|
|
2514
|
+
}
|
|
2515
|
+
set round(n) {
|
|
2516
|
+
!this.slider || (this.slider.round = n);
|
|
2517
|
+
}
|
|
2518
|
+
get round() {
|
|
2519
|
+
var n, h;
|
|
2520
|
+
return (h = (n = this.slider) == null ? void 0 : n.round) != null ? h : Je;
|
|
2521
|
+
}
|
|
2522
|
+
set type(n) {
|
|
2523
|
+
!this.slider || (this.slider.type = n ?? we);
|
|
2524
|
+
}
|
|
2525
|
+
get type() {
|
|
2526
|
+
var n;
|
|
2527
|
+
return ((n = this.slider) == null ? void 0 : n.type) || we;
|
|
2528
|
+
}
|
|
2529
|
+
set pointersOverlap(n) {
|
|
2530
|
+
!this.slider || (this.slider.pointersOverlap = n);
|
|
2531
|
+
}
|
|
2532
|
+
get pointersOverlap() {
|
|
2533
|
+
var n, h;
|
|
2534
|
+
return (h = (n = this.slider) == null ? void 0 : n.pointersOverlap) != null ? h : !1;
|
|
2535
|
+
}
|
|
2536
|
+
set pointersMinDistance(n) {
|
|
2537
|
+
!this.slider || (this.slider.pointersMinDistance = n);
|
|
2538
|
+
}
|
|
2539
|
+
get pointersMinDistance() {
|
|
2540
|
+
var n, h;
|
|
2541
|
+
return (h = (n = this.slider) == null ? void 0 : n.pointersMinDistance) != null ? h : 0;
|
|
2542
|
+
}
|
|
2543
|
+
set pointersMaxDistance(n) {
|
|
2544
|
+
!this.slider || (this.slider.pointersMaxDistance = n);
|
|
2545
|
+
}
|
|
2546
|
+
get pointersMaxDistance() {
|
|
2547
|
+
var n, h;
|
|
2548
|
+
return (h = (n = this.slider) == null ? void 0 : n.pointersMaxDistance) != null ? h : 1 / 0;
|
|
2549
|
+
}
|
|
2550
|
+
set theme(n) {
|
|
2551
|
+
!this.slider || !this.slider.styles || (this.slider.styles.theme = n);
|
|
2552
|
+
}
|
|
2553
|
+
get theme() {
|
|
2554
|
+
var n, h, f;
|
|
2555
|
+
return (f = (h = (n = this.slider) == null ? void 0 : n.styles) == null ? void 0 : h.theme) != null ? f : null;
|
|
2556
|
+
}
|
|
2557
|
+
set rtl(n) {
|
|
2558
|
+
!this.slider || (this.slider.rightToLeft = n);
|
|
2559
|
+
}
|
|
2560
|
+
get rtl() {
|
|
2561
|
+
var n, h;
|
|
2562
|
+
return (h = (n = this.slider) == null ? void 0 : n.rightToLeft) != null ? h : !1;
|
|
2563
|
+
}
|
|
2564
|
+
set btt(n) {
|
|
2565
|
+
!this.slider || (this.slider.bottomToTop = n);
|
|
2566
|
+
}
|
|
2567
|
+
get btt() {
|
|
2568
|
+
var n, h;
|
|
2569
|
+
return (h = (n = this.slider) == null ? void 0 : n.bottomToTop) != null ? h : !1;
|
|
2570
|
+
}
|
|
2571
|
+
set keyboardDisabled(n) {
|
|
2572
|
+
!this.slider || (this.slider.keyboardDisabled = n);
|
|
2573
|
+
}
|
|
2574
|
+
get keyboardDisabled() {
|
|
2575
|
+
var n, h;
|
|
2576
|
+
return (h = (n = this.slider) == null ? void 0 : n.keyboardDisabled) != null ? h : !1;
|
|
2577
|
+
}
|
|
2578
|
+
set mousewheelDisabled(n) {
|
|
2579
|
+
!this.slider || (this.slider.mousewheelDisabled = n);
|
|
2580
|
+
}
|
|
2581
|
+
get mousewheelDisabled() {
|
|
2582
|
+
var n, h;
|
|
2583
|
+
return (h = (n = this.slider) == null ? void 0 : n.mousewheelDisabled) != null ? h : !1;
|
|
2584
|
+
}
|
|
2585
|
+
set animateOnClick(n) {
|
|
2586
|
+
!this.slider || (this.slider.animateOnClick = n);
|
|
2587
|
+
}
|
|
2588
|
+
get animateOnClick() {
|
|
2589
|
+
var n;
|
|
2590
|
+
return (n = this.slider) == null ? void 0 : n.animateOnClick;
|
|
2591
|
+
}
|
|
2592
|
+
get rangeDragging() {
|
|
2593
|
+
var n, h;
|
|
2594
|
+
return (h = (n = this.slider) == null ? void 0 : n.rangeDragging) != null ? h : !1;
|
|
2595
|
+
}
|
|
2596
|
+
set rangeDragging(n) {
|
|
2597
|
+
this.slider && (this.slider.rangeDragging = de(n));
|
|
2598
|
+
}
|
|
2599
|
+
get externalCSSList() {
|
|
2600
|
+
return this._externalCSSList;
|
|
2601
|
+
}
|
|
2602
|
+
addPointer(n) {
|
|
2603
|
+
var h;
|
|
2604
|
+
if (!this.slider)
|
|
2605
|
+
return;
|
|
2606
|
+
let f = (h = this.slider) == null ? void 0 : h.addPointer(n);
|
|
2607
|
+
Ls(this, this.slider, f, `value${f + 1}`, `ariaLabel${f + 1}`, `pointerShape${f + 1}`, `pointer${f + 1}Disabled`);
|
|
2608
|
+
}
|
|
2609
|
+
removePointer() {
|
|
2610
|
+
var n;
|
|
2611
|
+
!this.slider || (n = this.slider) == null || n.removePointer();
|
|
2612
|
+
}
|
|
2613
|
+
addCSS(n) {
|
|
2614
|
+
if (!this.shadowRoot)
|
|
2615
|
+
return;
|
|
2616
|
+
let h = document.createElement("style");
|
|
2617
|
+
h.textContent = n, this.shadowRoot.appendChild(h);
|
|
2618
|
+
}
|
|
2619
|
+
connectedCallback() {
|
|
2620
|
+
var n, h;
|
|
2621
|
+
if (!this.shadowRoot)
|
|
2622
|
+
return;
|
|
2623
|
+
this._externalCSSList = or(this), this.shadowRoot.innerHTML = r(o, this._externalCSSList);
|
|
2624
|
+
let f = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".pointer");
|
|
2625
|
+
if (!f)
|
|
2626
|
+
return;
|
|
2627
|
+
let p = (h = this.shadowRoot) == null ? void 0 : h.getElementById("range-slider");
|
|
2628
|
+
if (!p)
|
|
2629
|
+
return;
|
|
2630
|
+
let x = cr(this, f);
|
|
2631
|
+
this.slider = dr(this, p, x), ur(this, this.slider), this._observer = new MutationObserver((C) => {
|
|
2632
|
+
C.forEach((I) => {
|
|
2633
|
+
var w;
|
|
2634
|
+
if (!this.slider || I.type !== "attributes")
|
|
2635
|
+
return;
|
|
2636
|
+
let A = I.attributeName;
|
|
2637
|
+
!A || pr(this.slider, A, (w = this.getAttribute(A)) != null ? w : "");
|
|
2638
|
+
});
|
|
2639
|
+
}), this._observer.observe(this, { attributes: !0 });
|
|
2640
|
+
}
|
|
2641
|
+
disconnectedCallback() {
|
|
2642
|
+
this._observer && this._observer.disconnect(), this.slider && this.slider.destroy();
|
|
2643
|
+
}
|
|
2644
|
+
}, Nt = fr;
|
|
2645
|
+
window.tcRangeSlider = Nt, customElements.get("toolcool-range-slider") || customElements.define("toolcool-range-slider", Nt), customElements.get("tc-range-slider") || customElements.define("tc-range-slider", class extends Nt {
|
|
2646
|
+
});
|
|
2647
|
+
})();
|
|
2648
|
+
var Di = { exports: {} };
|
|
2649
|
+
(function(i, e) {
|
|
2650
|
+
(function(t, s) {
|
|
2651
|
+
i.exports = s();
|
|
2652
|
+
})(at, function() {
|
|
2653
|
+
var t = 1e3, s = 6e4, r = 36e5, o = "millisecond", l = "second", c = "minute", u = "hour", d = "day", m = "week", v = "month", $ = "quarter", E = "year", j = "date", G = "Invalid Date", ve = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, le = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, me = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(T) {
|
|
2654
|
+
var y = ["th", "st", "nd", "rd"], b = T % 100;
|
|
2655
|
+
return "[" + T + (y[(b - 20) % 10] || y[b] || y[0]) + "]";
|
|
2656
|
+
} }, pe = function(T, y, b) {
|
|
2657
|
+
var k = String(T);
|
|
2658
|
+
return !k || k.length >= y ? T : "" + Array(y + 1 - k.length).join(b) + T;
|
|
2659
|
+
}, Ee = { s: pe, z: function(T) {
|
|
2660
|
+
var y = -T.utcOffset(), b = Math.abs(y), k = Math.floor(b / 60), _ = b % 60;
|
|
2661
|
+
return (y <= 0 ? "+" : "-") + pe(k, 2, "0") + ":" + pe(_, 2, "0");
|
|
2662
|
+
}, m: function T(y, b) {
|
|
2663
|
+
if (y.date() < b.date())
|
|
2664
|
+
return -T(b, y);
|
|
2665
|
+
var k = 12 * (b.year() - y.year()) + (b.month() - y.month()), _ = y.clone().add(k, v), P = b - _ < 0, R = y.clone().add(k + (P ? -1 : 1), v);
|
|
2666
|
+
return +(-(k + (b - _) / (P ? _ - R : R - _)) || 0);
|
|
2667
|
+
}, a: function(T) {
|
|
2668
|
+
return T < 0 ? Math.ceil(T) || 0 : Math.floor(T);
|
|
2669
|
+
}, p: function(T) {
|
|
2670
|
+
return { M: v, y: E, w: m, d, D: j, h: u, m: c, s: l, ms: o, Q: $ }[T] || String(T || "").toLowerCase().replace(/s$/, "");
|
|
2671
|
+
}, u: function(T) {
|
|
2672
|
+
return T === void 0;
|
|
2673
|
+
} }, ye = "en", F = {};
|
|
2674
|
+
F[ye] = me;
|
|
2675
|
+
var X = function(T) {
|
|
2676
|
+
return T instanceof Oe;
|
|
2677
|
+
}, ie = function T(y, b, k) {
|
|
2678
|
+
var _;
|
|
2679
|
+
if (!y)
|
|
2680
|
+
return ye;
|
|
2681
|
+
if (typeof y == "string") {
|
|
2682
|
+
var P = y.toLowerCase();
|
|
2683
|
+
F[P] && (_ = P), b && (F[P] = b, _ = P);
|
|
2684
|
+
var R = y.split("-");
|
|
2685
|
+
if (!_ && R.length > 1)
|
|
2686
|
+
return T(R[0]);
|
|
2687
|
+
} else {
|
|
2688
|
+
var V = y.name;
|
|
2689
|
+
F[V] = y, _ = V;
|
|
2690
|
+
}
|
|
2691
|
+
return !k && _ && (ye = _), _ || !k && ye;
|
|
2692
|
+
}, z = function(T, y) {
|
|
2693
|
+
if (X(T))
|
|
2694
|
+
return T.clone();
|
|
2695
|
+
var b = typeof y == "object" ? y : {};
|
|
2696
|
+
return b.date = T, b.args = arguments, new Oe(b);
|
|
2697
|
+
}, B = Ee;
|
|
2698
|
+
B.l = ie, B.i = X, B.w = function(T, y) {
|
|
2699
|
+
return z(T, { locale: y.$L, utc: y.$u, x: y.$x, $offset: y.$offset });
|
|
2700
|
+
};
|
|
2701
|
+
var Oe = function() {
|
|
2702
|
+
function T(b) {
|
|
2703
|
+
this.$L = ie(b.locale, null, !0), this.parse(b);
|
|
2704
|
+
}
|
|
2705
|
+
var y = T.prototype;
|
|
2706
|
+
return y.parse = function(b) {
|
|
2707
|
+
this.$d = function(k) {
|
|
2708
|
+
var _ = k.date, P = k.utc;
|
|
2709
|
+
if (_ === null)
|
|
2710
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
2711
|
+
if (B.u(_))
|
|
2712
|
+
return /* @__PURE__ */ new Date();
|
|
2713
|
+
if (_ instanceof Date)
|
|
2714
|
+
return new Date(_);
|
|
2715
|
+
if (typeof _ == "string" && !/Z$/i.test(_)) {
|
|
2716
|
+
var R = _.match(ve);
|
|
2717
|
+
if (R) {
|
|
2718
|
+
var V = R[2] - 1 || 0, se = (R[7] || "0").substring(0, 3);
|
|
2719
|
+
return P ? new Date(Date.UTC(R[1], V, R[3] || 1, R[4] || 0, R[5] || 0, R[6] || 0, se)) : new Date(R[1], V, R[3] || 1, R[4] || 0, R[5] || 0, R[6] || 0, se);
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
return new Date(_);
|
|
2723
|
+
}(b), this.$x = b.x || {}, this.init();
|
|
2724
|
+
}, y.init = function() {
|
|
2725
|
+
var b = this.$d;
|
|
2726
|
+
this.$y = b.getFullYear(), this.$M = b.getMonth(), this.$D = b.getDate(), this.$W = b.getDay(), this.$H = b.getHours(), this.$m = b.getMinutes(), this.$s = b.getSeconds(), this.$ms = b.getMilliseconds();
|
|
2727
|
+
}, y.$utils = function() {
|
|
2728
|
+
return B;
|
|
2729
|
+
}, y.isValid = function() {
|
|
2730
|
+
return this.$d.toString() !== G;
|
|
2731
|
+
}, y.isSame = function(b, k) {
|
|
2732
|
+
var _ = z(b);
|
|
2733
|
+
return this.startOf(k) <= _ && _ <= this.endOf(k);
|
|
2734
|
+
}, y.isAfter = function(b, k) {
|
|
2735
|
+
return z(b) < this.startOf(k);
|
|
2736
|
+
}, y.isBefore = function(b, k) {
|
|
2737
|
+
return this.endOf(k) < z(b);
|
|
2738
|
+
}, y.$g = function(b, k, _) {
|
|
2739
|
+
return B.u(b) ? this[k] : this.set(_, b);
|
|
2740
|
+
}, y.unix = function() {
|
|
2741
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
2742
|
+
}, y.valueOf = function() {
|
|
2743
|
+
return this.$d.getTime();
|
|
2744
|
+
}, y.startOf = function(b, k) {
|
|
2745
|
+
var _ = this, P = !!B.u(k) || k, R = B.p(b), V = function(Le, ee) {
|
|
2746
|
+
var K = B.w(_.$u ? Date.UTC(_.$y, ee, Le) : new Date(_.$y, ee, Le), _);
|
|
2747
|
+
return P ? K : K.endOf(d);
|
|
2748
|
+
}, se = function(Le, ee) {
|
|
2749
|
+
return B.w(_.toDate()[Le].apply(_.toDate("s"), (P ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ee)), _);
|
|
2750
|
+
}, Q = this.$W, he = this.$M, Se = this.$D, ke = "set" + (this.$u ? "UTC" : "");
|
|
2751
|
+
switch (R) {
|
|
2752
|
+
case E:
|
|
2753
|
+
return P ? V(1, 0) : V(31, 11);
|
|
2754
|
+
case v:
|
|
2755
|
+
return P ? V(1, he) : V(0, he + 1);
|
|
2756
|
+
case m:
|
|
2757
|
+
var ue = this.$locale().weekStart || 0, we = (Q < ue ? Q + 7 : Q) - ue;
|
|
2758
|
+
return V(P ? Se - we : Se + (6 - we), he);
|
|
2759
|
+
case d:
|
|
2760
|
+
case j:
|
|
2761
|
+
return se(ke + "Hours", 0);
|
|
2762
|
+
case u:
|
|
2763
|
+
return se(ke + "Minutes", 1);
|
|
2764
|
+
case c:
|
|
2765
|
+
return se(ke + "Seconds", 2);
|
|
2766
|
+
case l:
|
|
2767
|
+
return se(ke + "Milliseconds", 3);
|
|
2768
|
+
default:
|
|
2769
|
+
return this.clone();
|
|
2770
|
+
}
|
|
2771
|
+
}, y.endOf = function(b) {
|
|
2772
|
+
return this.startOf(b, !1);
|
|
2773
|
+
}, y.$set = function(b, k) {
|
|
2774
|
+
var _, P = B.p(b), R = "set" + (this.$u ? "UTC" : ""), V = (_ = {}, _[d] = R + "Date", _[j] = R + "Date", _[v] = R + "Month", _[E] = R + "FullYear", _[u] = R + "Hours", _[c] = R + "Minutes", _[l] = R + "Seconds", _[o] = R + "Milliseconds", _)[P], se = P === d ? this.$D + (k - this.$W) : k;
|
|
2775
|
+
if (P === v || P === E) {
|
|
2776
|
+
var Q = this.clone().set(j, 1);
|
|
2777
|
+
Q.$d[V](se), Q.init(), this.$d = Q.set(j, Math.min(this.$D, Q.daysInMonth())).$d;
|
|
2778
|
+
} else
|
|
2779
|
+
V && this.$d[V](se);
|
|
2780
|
+
return this.init(), this;
|
|
2781
|
+
}, y.set = function(b, k) {
|
|
2782
|
+
return this.clone().$set(b, k);
|
|
2783
|
+
}, y.get = function(b) {
|
|
2784
|
+
return this[B.p(b)]();
|
|
2785
|
+
}, y.add = function(b, k) {
|
|
2786
|
+
var _, P = this;
|
|
2787
|
+
b = Number(b);
|
|
2788
|
+
var R = B.p(k), V = function(he) {
|
|
2789
|
+
var Se = z(P);
|
|
2790
|
+
return B.w(Se.date(Se.date() + Math.round(he * b)), P);
|
|
2791
|
+
};
|
|
2792
|
+
if (R === v)
|
|
2793
|
+
return this.set(v, this.$M + b);
|
|
2794
|
+
if (R === E)
|
|
2795
|
+
return this.set(E, this.$y + b);
|
|
2796
|
+
if (R === d)
|
|
2797
|
+
return V(1);
|
|
2798
|
+
if (R === m)
|
|
2799
|
+
return V(7);
|
|
2800
|
+
var se = (_ = {}, _[c] = s, _[u] = r, _[l] = t, _)[R] || 1, Q = this.$d.getTime() + b * se;
|
|
2801
|
+
return B.w(Q, this);
|
|
2802
|
+
}, y.subtract = function(b, k) {
|
|
2803
|
+
return this.add(-1 * b, k);
|
|
2804
|
+
}, y.format = function(b) {
|
|
2805
|
+
var k = this, _ = this.$locale();
|
|
2806
|
+
if (!this.isValid())
|
|
2807
|
+
return _.invalidDate || G;
|
|
2808
|
+
var P = b || "YYYY-MM-DDTHH:mm:ssZ", R = B.z(this), V = this.$H, se = this.$m, Q = this.$M, he = _.weekdays, Se = _.months, ke = function(ee, K, Ke, qe) {
|
|
2809
|
+
return ee && (ee[K] || ee(k, P)) || Ke[K].slice(0, qe);
|
|
2810
|
+
}, ue = function(ee) {
|
|
2811
|
+
return B.s(V % 12 || 12, ee, "0");
|
|
2812
|
+
}, we = _.meridiem || function(ee, K, Ke) {
|
|
2813
|
+
var qe = ee < 12 ? "AM" : "PM";
|
|
2814
|
+
return Ke ? qe.toLowerCase() : qe;
|
|
2815
|
+
}, Le = { YY: String(this.$y).slice(-2), YYYY: B.s(this.$y, 4, "0"), M: Q + 1, MM: B.s(Q + 1, 2, "0"), MMM: ke(_.monthsShort, Q, Se, 3), MMMM: ke(Se, Q), D: this.$D, DD: B.s(this.$D, 2, "0"), d: String(this.$W), dd: ke(_.weekdaysMin, this.$W, he, 2), ddd: ke(_.weekdaysShort, this.$W, he, 3), dddd: he[this.$W], H: String(V), HH: B.s(V, 2, "0"), h: ue(1), hh: ue(2), a: we(V, se, !0), A: we(V, se, !1), m: String(se), mm: B.s(se, 2, "0"), s: String(this.$s), ss: B.s(this.$s, 2, "0"), SSS: B.s(this.$ms, 3, "0"), Z: R };
|
|
2816
|
+
return P.replace(le, function(ee, K) {
|
|
2817
|
+
return K || Le[ee] || R.replace(":", "");
|
|
2818
|
+
});
|
|
2819
|
+
}, y.utcOffset = function() {
|
|
2820
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
2821
|
+
}, y.diff = function(b, k, _) {
|
|
2822
|
+
var P, R = B.p(k), V = z(b), se = (V.utcOffset() - this.utcOffset()) * s, Q = this - V, he = B.m(this, V);
|
|
2823
|
+
return he = (P = {}, P[E] = he / 12, P[v] = he, P[$] = he / 3, P[m] = (Q - se) / 6048e5, P[d] = (Q - se) / 864e5, P[u] = Q / r, P[c] = Q / s, P[l] = Q / t, P)[R] || Q, _ ? he : B.a(he);
|
|
2824
|
+
}, y.daysInMonth = function() {
|
|
2825
|
+
return this.endOf(v).$D;
|
|
2826
|
+
}, y.$locale = function() {
|
|
2827
|
+
return F[this.$L];
|
|
2828
|
+
}, y.locale = function(b, k) {
|
|
2829
|
+
if (!b)
|
|
2830
|
+
return this.$L;
|
|
2831
|
+
var _ = this.clone(), P = ie(b, k, !0);
|
|
2832
|
+
return P && (_.$L = P), _;
|
|
2833
|
+
}, y.clone = function() {
|
|
2834
|
+
return B.w(this.$d, this);
|
|
2835
|
+
}, y.toDate = function() {
|
|
2836
|
+
return new Date(this.valueOf());
|
|
2837
|
+
}, y.toJSON = function() {
|
|
2838
|
+
return this.isValid() ? this.toISOString() : null;
|
|
2839
|
+
}, y.toISOString = function() {
|
|
2840
|
+
return this.$d.toISOString();
|
|
2841
|
+
}, y.toString = function() {
|
|
2842
|
+
return this.$d.toUTCString();
|
|
2843
|
+
}, T;
|
|
2844
|
+
}(), Me = Oe.prototype;
|
|
2845
|
+
return z.prototype = Me, [["$ms", o], ["$s", l], ["$m", c], ["$H", u], ["$W", d], ["$M", v], ["$y", E], ["$D", j]].forEach(function(T) {
|
|
2846
|
+
Me[T[1]] = function(y) {
|
|
2847
|
+
return this.$g(y, T[0], T[1]);
|
|
2848
|
+
};
|
|
2849
|
+
}), z.extend = function(T, y) {
|
|
2850
|
+
return T.$i || (T(y, Oe, z), T.$i = !0), z;
|
|
2851
|
+
}, z.locale = ie, z.isDayjs = X, z.unix = function(T) {
|
|
2852
|
+
return z(1e3 * T);
|
|
2853
|
+
}, z.en = F[ye], z.Ls = F, z.p = {}, z;
|
|
2854
|
+
});
|
|
2855
|
+
})(Di);
|
|
2856
|
+
var no = Di.exports;
|
|
2857
|
+
const St = /* @__PURE__ */ Ti(no);
|
|
2858
|
+
class oo extends ht {
|
|
2859
|
+
constructor() {
|
|
2860
|
+
super(...arguments), this.templates = {}, this._renderedTemplates = {};
|
|
2861
|
+
}
|
|
2862
|
+
/**
|
|
2863
|
+
* Set an alternative binding syntax. Default is {{ <value> }}
|
|
2864
|
+
*
|
|
2865
|
+
* @param {string} startStr start of binding syntax
|
|
2866
|
+
* @param {string} endStr end of binding syntax
|
|
2867
|
+
*/
|
|
2868
|
+
setBindingSyntax(e, t) {
|
|
2869
|
+
this._startExpression = e, this._endExpression = t;
|
|
2870
|
+
const s = this.escapeRegex(this._startExpression), r = this.escapeRegex(this._endExpression);
|
|
2871
|
+
this._expression = new RegExp(
|
|
2872
|
+
`${s}\\s*([$\\w\\.,'"\\s()\\[\\]]+)\\s*${r}`,
|
|
2873
|
+
"g"
|
|
2874
|
+
);
|
|
2875
|
+
}
|
|
2876
|
+
/**
|
|
2877
|
+
* Check if a specific template has been provided.
|
|
2878
|
+
*
|
|
2879
|
+
* @param {string} templateName
|
|
2880
|
+
* @returns {boolean}
|
|
2881
|
+
*/
|
|
2882
|
+
hasTemplate(e) {
|
|
2883
|
+
return this.templates && !!this.templates[e];
|
|
2884
|
+
}
|
|
2885
|
+
/**
|
|
2886
|
+
* Render a <template> by type and return content to render
|
|
2887
|
+
*
|
|
2888
|
+
* @param templateType type of template (indicated by the data-type attribute)
|
|
2889
|
+
* @param context the data context that should be expanded in template
|
|
2890
|
+
* @param slotName the slot name that will be used to host the new rendered template. set to a unique value if multiple templates of this type will be rendered. default is templateType
|
|
2891
|
+
*/
|
|
2892
|
+
renderTemplate(e, t, s) {
|
|
2893
|
+
if (!this.hasTemplate(e))
|
|
2894
|
+
return null;
|
|
2895
|
+
s = s || e;
|
|
2896
|
+
const r = ge` <slot name=${s}></slot> `, o = { [e]: { ...t } };
|
|
2897
|
+
if (this._renderedTemplates.hasOwnProperty(s)) {
|
|
2898
|
+
const { slot: c } = (
|
|
2899
|
+
// @ts-ignore
|
|
2900
|
+
this._renderedTemplates[s]
|
|
2901
|
+
);
|
|
2902
|
+
this.removeChild(c);
|
|
2903
|
+
}
|
|
2904
|
+
const l = document.createElement("div");
|
|
2905
|
+
return l.slot = s, l.dataset.generated = "template", this._renderTemplate(l, this.templates[e], o), this.appendChild(l), this._renderedTemplates[s] = { context: o, slot: l }, r;
|
|
2906
|
+
}
|
|
2907
|
+
getTemplates() {
|
|
2908
|
+
const e = {};
|
|
2909
|
+
for (let t = 0; t < this.children.length; t++) {
|
|
2910
|
+
const s = this.children[t];
|
|
2911
|
+
if (s.nodeName === "TEMPLATE") {
|
|
2912
|
+
const r = s;
|
|
2913
|
+
r.dataset.type ? e[r.dataset.type] = r : e.default = r, r.templateOrder = t;
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
return e;
|
|
2917
|
+
}
|
|
2918
|
+
_renderTemplate(e, t, s) {
|
|
2919
|
+
let r;
|
|
2920
|
+
if (t.content && t.content.childNodes.length) {
|
|
2921
|
+
const o = t.content.cloneNode(!0);
|
|
2922
|
+
r = this.renderNode(o, e, s);
|
|
2923
|
+
}
|
|
2924
|
+
r && e.appendChild(r);
|
|
2925
|
+
}
|
|
2926
|
+
expandExpressionsAsString(e, t) {
|
|
2927
|
+
return e.replace(this.expression, (s, r) => {
|
|
2928
|
+
const o = this.evalInContext(
|
|
2929
|
+
r || this.trimExpression(s),
|
|
2930
|
+
t
|
|
2931
|
+
);
|
|
2932
|
+
return o ? typeof o == "object" ? JSON.stringify(o) : o.toString() : "";
|
|
2933
|
+
});
|
|
2934
|
+
}
|
|
2935
|
+
get expression() {
|
|
2936
|
+
return this._expression || this.setBindingSyntax("{{", "}}"), this._expression;
|
|
2937
|
+
}
|
|
2938
|
+
escapeRegex(e) {
|
|
2939
|
+
return e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
2940
|
+
}
|
|
2941
|
+
evalInContext(e, t) {
|
|
2942
|
+
t = { ...t };
|
|
2943
|
+
const s = new Function("with(this) { return " + e + ";}");
|
|
2944
|
+
let r;
|
|
2945
|
+
try {
|
|
2946
|
+
r = s.call(t);
|
|
2947
|
+
} catch {
|
|
2948
|
+
}
|
|
2949
|
+
return r;
|
|
2950
|
+
}
|
|
2951
|
+
trimExpression(e) {
|
|
2952
|
+
return e = e.trim(), e.startsWith(this._startExpression) && e.endsWith(this._endExpression) && (e = e.substr(
|
|
2953
|
+
this._startExpression.length,
|
|
2954
|
+
e.length - this._startExpression.length - this._endExpression.length
|
|
2955
|
+
), e = e.trim()), e;
|
|
2956
|
+
}
|
|
2957
|
+
renderNode(e, t, s) {
|
|
2958
|
+
if (e.nodeName === "#text")
|
|
2959
|
+
return e.textContent = this.expandExpressionsAsString(
|
|
2960
|
+
e.textContent,
|
|
2961
|
+
s
|
|
2962
|
+
), e;
|
|
2963
|
+
if (e.nodeName === "TEMPLATE")
|
|
2964
|
+
return e.$parentTemplateContext = s, e;
|
|
2965
|
+
for (let r = 0; r < e.childNodes.length; r++) {
|
|
2966
|
+
const o = e.childNodes[r];
|
|
2967
|
+
this.renderNode(o, t, s);
|
|
2968
|
+
}
|
|
2969
|
+
return e;
|
|
2970
|
+
}
|
|
2971
|
+
updated() {
|
|
2972
|
+
this.templates = this.getTemplates();
|
|
2973
|
+
}
|
|
2974
|
+
}
|
|
2975
|
+
const lo = (i, e = "highlight", t = "title") => {
|
|
2976
|
+
const s = (o, l, c) => {
|
|
2977
|
+
const u = l.split(".");
|
|
2978
|
+
let d;
|
|
2979
|
+
for (d = 0; d < u.length - 1; d++)
|
|
2980
|
+
o = o[u[d]];
|
|
2981
|
+
o[u[d]] = c;
|
|
2982
|
+
}, r = (o, l = []) => {
|
|
2983
|
+
let c = "", u = 0;
|
|
2984
|
+
return l.forEach((d) => {
|
|
2985
|
+
const m = d[1] + 1;
|
|
1767
2986
|
c += [
|
|
1768
|
-
|
|
1769
|
-
`<mark class="${
|
|
1770
|
-
|
|
2987
|
+
o.substring(u, d[0]),
|
|
2988
|
+
`<mark class="${e}">`,
|
|
2989
|
+
o.substring(d[0], m),
|
|
1771
2990
|
"</mark>"
|
|
1772
|
-
].join(""),
|
|
1773
|
-
}), c +=
|
|
2991
|
+
].join(""), u = m;
|
|
2992
|
+
}), c += o.substring(u), c;
|
|
1774
2993
|
};
|
|
1775
|
-
return i.filter(({ matches:
|
|
1776
|
-
const c = { ...
|
|
1777
|
-
return
|
|
1778
|
-
|
|
2994
|
+
return i.filter(({ matches: o }) => o && o.length).map(({ item: o, matches: l }) => {
|
|
2995
|
+
const c = { ...o };
|
|
2996
|
+
return l.forEach((u) => {
|
|
2997
|
+
u.key === t && s(
|
|
1779
2998
|
c,
|
|
1780
|
-
|
|
1781
|
-
|
|
2999
|
+
u.key,
|
|
3000
|
+
r(u.value, u.indices)
|
|
1782
3001
|
);
|
|
1783
3002
|
}), c;
|
|
1784
3003
|
});
|
|
1785
|
-
},
|
|
3004
|
+
}, ao = `
|
|
1786
3005
|
:host {
|
|
1787
3006
|
display: flex;
|
|
1788
3007
|
box-sizing: border-box;
|
|
@@ -1800,6 +3019,9 @@ form {
|
|
|
1800
3019
|
display: flex;
|
|
1801
3020
|
flex-direction: column;
|
|
1802
3021
|
}
|
|
3022
|
+
|
|
3023
|
+
|
|
3024
|
+
`, ho = `
|
|
1803
3025
|
ul {
|
|
1804
3026
|
padding-left: 0;
|
|
1805
3027
|
margin-top: 0;
|
|
@@ -1838,22 +3060,31 @@ details summary {
|
|
|
1838
3060
|
.details-filter summary {
|
|
1839
3061
|
justify-content: space-between;
|
|
1840
3062
|
}
|
|
3063
|
+
.details-filter summary span {
|
|
3064
|
+
font-size: small;
|
|
3065
|
+
font-weight: 900;
|
|
3066
|
+
}
|
|
1841
3067
|
#details-results summary {
|
|
1842
3068
|
list-style: none;
|
|
1843
3069
|
}
|
|
1844
|
-
|
|
1845
|
-
|
|
3070
|
+
#details-results summary>.title {
|
|
3071
|
+
font-weight: 900;
|
|
3072
|
+
}
|
|
3073
|
+
.details-filter summary::after,
|
|
3074
|
+
#details-results summary::before {
|
|
3075
|
+
content: url("data:image/svg+xml,%3Csvg data-cy='expand-button' xmlns='http://www.w3.org/2000/svg' viewBox='6 6 12 12' %3E%3Ctitle%3Echevron-down%3C/title%3E%3Cpath d='M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z' /%3E%3C/svg%3E");
|
|
1846
3076
|
width: 14px;
|
|
1847
3077
|
height: 14px;
|
|
3078
|
+
margin-right: 4px;
|
|
1848
3079
|
transition: all ease-in-out 0.3s;
|
|
1849
3080
|
}
|
|
1850
|
-
#details-results summary
|
|
3081
|
+
#details-results summary::before {
|
|
1851
3082
|
transform: rotate(-90deg);
|
|
1852
3083
|
}
|
|
1853
|
-
.details-filter[open] summary
|
|
3084
|
+
.details-filter[open] summary::after {
|
|
1854
3085
|
transform: rotate(180deg);
|
|
1855
3086
|
}
|
|
1856
|
-
#details-results[open] summary
|
|
3087
|
+
#details-results[open] summary::before {
|
|
1857
3088
|
transform: rotate(0deg);
|
|
1858
3089
|
}
|
|
1859
3090
|
.details-filter li span,
|
|
@@ -1901,6 +3132,7 @@ ul#results li {
|
|
|
1901
3132
|
}
|
|
1902
3133
|
#filter-reset {
|
|
1903
3134
|
cursor: pointer;
|
|
3135
|
+
font-size: small;
|
|
1904
3136
|
}
|
|
1905
3137
|
section.inline,
|
|
1906
3138
|
section.inline > ul {
|
|
@@ -1927,92 +3159,92 @@ section.inline details.details-filter summary {
|
|
|
1927
3159
|
overflow-y: auto;
|
|
1928
3160
|
}
|
|
1929
3161
|
`;
|
|
1930
|
-
var
|
|
1931
|
-
for (var
|
|
1932
|
-
(
|
|
1933
|
-
return s &&
|
|
3162
|
+
var co = Object.defineProperty, uo = Object.getOwnPropertyDescriptor, He = (i, e, t, s) => {
|
|
3163
|
+
for (var r = s > 1 ? void 0 : s ? uo(e, t) : e, o = i.length - 1, l; o >= 0; o--)
|
|
3164
|
+
(l = i[o]) && (r = (s ? l(e, t, r) : l(r)) || r);
|
|
3165
|
+
return s && r && co(e, t, r), r;
|
|
1934
3166
|
};
|
|
1935
|
-
class
|
|
3167
|
+
class mi {
|
|
1936
3168
|
constructor() {
|
|
1937
3169
|
/**
|
|
1938
3170
|
* Aggregate results by a property key
|
|
1939
3171
|
*/
|
|
1940
|
-
|
|
3172
|
+
Z(this, "aggregateResults");
|
|
1941
3173
|
/**
|
|
1942
3174
|
* Highlighting of search result character matches
|
|
1943
3175
|
*/
|
|
1944
|
-
|
|
3176
|
+
Z(this, "enableHighlighting", !1);
|
|
1945
3177
|
/**
|
|
1946
3178
|
* Search functionality
|
|
1947
3179
|
*/
|
|
1948
|
-
|
|
3180
|
+
Z(this, "enableSearch", !1);
|
|
1949
3181
|
/**
|
|
1950
3182
|
* Make the filters mutually exclusive
|
|
1951
3183
|
*/
|
|
1952
|
-
|
|
3184
|
+
Z(this, "exclusiveFilters", !1);
|
|
1953
3185
|
/**
|
|
1954
3186
|
* Use an external search endpoint instead of fuse search.
|
|
1955
3187
|
* Passed properties: input string, filters object
|
|
1956
3188
|
*/
|
|
1957
|
-
|
|
3189
|
+
Z(this, "externalSearch");
|
|
1958
3190
|
/**
|
|
1959
3191
|
* The filter properties.
|
|
1960
3192
|
* @param filterProperties
|
|
1961
3193
|
*/
|
|
1962
|
-
|
|
3194
|
+
Z(this, "filterProperties", []);
|
|
1963
3195
|
/**
|
|
1964
3196
|
* Native fuse.js config override
|
|
1965
3197
|
*/
|
|
1966
|
-
|
|
3198
|
+
Z(this, "fuseConfig", {
|
|
1967
3199
|
keys: ["title"]
|
|
1968
3200
|
});
|
|
1969
3201
|
/**
|
|
1970
3202
|
* Inline mode, for rendering the itemfilter in avery condensed space.
|
|
1971
3203
|
* Expexts showResults to be false and enableSearch to be true
|
|
1972
3204
|
*/
|
|
1973
|
-
|
|
3205
|
+
Z(this, "inlineMode", !1);
|
|
1974
3206
|
/**
|
|
1975
3207
|
* Show all result items if nothing is input by the user
|
|
1976
3208
|
* @default true
|
|
1977
3209
|
*/
|
|
1978
|
-
|
|
3210
|
+
Z(this, "matchAllWhenEmpty", !0);
|
|
1979
3211
|
/**
|
|
1980
3212
|
* Callback that is triggered on item search
|
|
1981
3213
|
* @returns result items
|
|
1982
3214
|
*/
|
|
1983
|
-
|
|
3215
|
+
Z(this, "onSearch", () => {
|
|
1984
3216
|
});
|
|
1985
3217
|
/**
|
|
1986
3218
|
* Callback that is triggered on item selection
|
|
1987
3219
|
* @returns selected item
|
|
1988
3220
|
*/
|
|
1989
|
-
|
|
3221
|
+
Z(this, "onSelect", () => {
|
|
1990
3222
|
});
|
|
1991
3223
|
/**
|
|
1992
3224
|
* Display results list
|
|
1993
3225
|
*/
|
|
1994
|
-
|
|
3226
|
+
Z(this, "showResults", !0);
|
|
1995
3227
|
/**
|
|
1996
3228
|
* The property of the result items used for display
|
|
1997
3229
|
*/
|
|
1998
|
-
|
|
3230
|
+
Z(this, "titleProperty", "title");
|
|
1999
3231
|
}
|
|
2000
3232
|
}
|
|
2001
|
-
let
|
|
3233
|
+
let Pe = class extends oo {
|
|
2002
3234
|
constructor() {
|
|
2003
3235
|
super(...arguments);
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
this._items =
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
})), this._fuse = new
|
|
3236
|
+
Z(this, "_fuse");
|
|
3237
|
+
Z(this, "_resultAggregation", []);
|
|
3238
|
+
Z(this, "_items", []);
|
|
3239
|
+
Z(this, "_results");
|
|
3240
|
+
Z(this, "_filters", {});
|
|
3241
|
+
Z(this, "_selectedResult");
|
|
3242
|
+
Z(this, "_config", new mi());
|
|
3243
|
+
Z(this, "apply", (e) => {
|
|
3244
|
+
this._items = e.map((t, s) => ({
|
|
3245
|
+
id: `item-${s}`,
|
|
3246
|
+
...t
|
|
3247
|
+
})), this._fuse = new st(this._items, {
|
|
2016
3248
|
// minMatchCharLength: 3,
|
|
2017
3249
|
// location: 0,
|
|
2018
3250
|
threshold: 0.4,
|
|
@@ -2020,138 +3252,202 @@ let T = class extends Q {
|
|
|
2020
3252
|
includeMatches: !0,
|
|
2021
3253
|
useExtendedSearch: !0,
|
|
2022
3254
|
...this._config.fuseConfig
|
|
2023
|
-
}), this._config.filterProperties.length && this._config.filterProperties.forEach((
|
|
2024
|
-
const s = {};
|
|
2025
|
-
this._items.forEach((
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
3255
|
+
}), this._config.filterProperties.length && this._config.filterProperties.forEach((t) => {
|
|
3256
|
+
const s = {}, r = (o) => t.format === "date" ? St(o).unix() : parseInt(o);
|
|
3257
|
+
this._items.forEach((o) => {
|
|
3258
|
+
if (t.type === "range") {
|
|
3259
|
+
if (Array.isArray(o[t.key])) {
|
|
3260
|
+
const l = [
|
|
3261
|
+
// @ts-ignore
|
|
3262
|
+
r(o[t.key][0]),
|
|
3263
|
+
// @ts-ignore
|
|
3264
|
+
r(o[t.key][1])
|
|
3265
|
+
];
|
|
3266
|
+
s.min = // @ts-ignore
|
|
3267
|
+
s.min !== void 0 ? (
|
|
3268
|
+
// @ts-ignore
|
|
3269
|
+
Math.min(s.min, l[0])
|
|
3270
|
+
) : l[0], s.max = // @ts-ignore
|
|
3271
|
+
s.max !== void 0 ? (
|
|
3272
|
+
// @ts-ignore
|
|
3273
|
+
Math.max(s.max, l[1])
|
|
3274
|
+
) : l[1];
|
|
3275
|
+
} else {
|
|
3276
|
+
const l = r(o[t.key]);
|
|
3277
|
+
s.min = // @ts-ignore
|
|
3278
|
+
s.min !== void 0 ? (
|
|
3279
|
+
// @ts-ignore
|
|
3280
|
+
Math.min(s.min, l)
|
|
3281
|
+
) : l, s.max = // @ts-ignore
|
|
3282
|
+
s.max !== void 0 ? (
|
|
3283
|
+
// @ts-ignore
|
|
3284
|
+
Math.max(s.max, l)
|
|
3285
|
+
) : l;
|
|
3286
|
+
}
|
|
3287
|
+
return;
|
|
3288
|
+
}
|
|
3289
|
+
Array.isArray(o[t.key]) ? o[t.key].forEach((l) => {
|
|
3290
|
+
s[l] = void 0;
|
|
3291
|
+
}) : s[o[t.key]] = void 0;
|
|
3292
|
+
}), this._filters[t.key] = {
|
|
3293
|
+
type: t.type || "string",
|
|
3294
|
+
keys: s,
|
|
3295
|
+
...t.type === "range" && {
|
|
3296
|
+
// @ts-ignore
|
|
3297
|
+
min: s.min,
|
|
3298
|
+
// @ts-ignore
|
|
3299
|
+
max: s.max,
|
|
3300
|
+
format: t.format
|
|
3301
|
+
}
|
|
3302
|
+
};
|
|
2030
3303
|
}), this._config.matchAllWhenEmpty !== !1 && (this._results = this.sortResults(this._items), this.requestUpdate()), this._config.aggregateResults && (this._resultAggregation = [
|
|
2031
3304
|
...new Set(
|
|
2032
|
-
this._items.reduce((
|
|
3305
|
+
this._items.reduce((t, s) => t.concat(s[this._config.aggregateResults]), [])
|
|
2033
3306
|
)
|
|
2034
|
-
].sort((
|
|
3307
|
+
].sort((t, s) => t.localeCompare(s)));
|
|
2035
3308
|
});
|
|
2036
|
-
|
|
3309
|
+
Z(this, "unstyled");
|
|
3310
|
+
Z(this, "inputHandler", () => {
|
|
2037
3311
|
this.search(this.renderRoot.querySelector("input[type='text']").value);
|
|
2038
3312
|
});
|
|
2039
|
-
|
|
3313
|
+
Z(this, "debouncedInputHandler", ro(this.inputHandler, 500, {
|
|
2040
3314
|
leading: !0
|
|
2041
3315
|
}));
|
|
2042
3316
|
}
|
|
2043
|
-
set config(
|
|
2044
|
-
const
|
|
3317
|
+
set config(e) {
|
|
3318
|
+
const t = this._config;
|
|
2045
3319
|
this._config = {
|
|
2046
|
-
...new
|
|
2047
|
-
...
|
|
2048
|
-
}, this.requestUpdate("config",
|
|
3320
|
+
...new mi(),
|
|
3321
|
+
...e
|
|
3322
|
+
}, this.requestUpdate("config", t);
|
|
2049
3323
|
}
|
|
2050
3324
|
get config() {
|
|
2051
3325
|
return this._config;
|
|
2052
3326
|
}
|
|
2053
|
-
async search(
|
|
2054
|
-
const s = Object.entries(
|
|
2055
|
-
|
|
2056
|
-
const
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
let n;
|
|
2067
|
-
if (!(t.length > 0) && !s.length && this._config.matchAllWhenEmpty !== !1)
|
|
2068
|
-
n = this._items;
|
|
3327
|
+
async search(e = "", t = this._filters) {
|
|
3328
|
+
const s = Object.entries(t).filter(([l, c]) => c.type === "string").reduce((l, [c, u]) => {
|
|
3329
|
+
const d = "$or", m = [], v = ($) => {
|
|
3330
|
+
const E = {};
|
|
3331
|
+
E[c] = `="${$}"`, m.push(E);
|
|
3332
|
+
};
|
|
3333
|
+
return Object.entries(u.keys).filter(([$, E]) => E).forEach(([$, E]) => v($)), m.length > 0 && l.push({
|
|
3334
|
+
[d]: m
|
|
3335
|
+
}), l;
|
|
3336
|
+
}, []);
|
|
3337
|
+
let r;
|
|
3338
|
+
if (!(e.length > 0) && !s.length && this._config.matchAllWhenEmpty !== !1)
|
|
3339
|
+
r = this._items;
|
|
2069
3340
|
else if (this.config.externalSearch)
|
|
2070
|
-
|
|
2071
|
-
`${this.config.externalSearch(
|
|
3341
|
+
r = (await (await fetch(
|
|
3342
|
+
`${this.config.externalSearch(e, t)}`
|
|
2072
3343
|
)).json()).features;
|
|
2073
3344
|
else {
|
|
2074
|
-
const
|
|
3345
|
+
const l = {
|
|
2075
3346
|
$and: [
|
|
2076
|
-
...
|
|
3347
|
+
...e.length > 0 ? [
|
|
2077
3348
|
{
|
|
2078
3349
|
$or: [
|
|
2079
3350
|
// @ts-ignore
|
|
2080
|
-
...this._config.fuseConfig.keys.map((
|
|
2081
|
-
[
|
|
3351
|
+
...this._config.fuseConfig.keys.map((u) => ({
|
|
3352
|
+
[u]: e
|
|
2082
3353
|
}))
|
|
2083
3354
|
]
|
|
2084
3355
|
}
|
|
2085
3356
|
] : [],
|
|
2086
3357
|
...s
|
|
2087
3358
|
]
|
|
2088
|
-
},
|
|
2089
|
-
|
|
3359
|
+
}, c = this._fuse.search(l);
|
|
3360
|
+
r = this._config.enableHighlighting ? lo(c, "highlight", this._config.titleProperty) : c.map((u) => u.item);
|
|
3361
|
+
}
|
|
3362
|
+
const o = Object.entries(this._filters).filter(([l, c]) => c.type === "range").reduce((l, [c, u]) => (l[c] = {
|
|
3363
|
+
min: u.keys.min,
|
|
3364
|
+
max: u.keys.max,
|
|
3365
|
+
format: u.format
|
|
3366
|
+
}, l), {});
|
|
3367
|
+
if (Object.keys(o).length > 0) {
|
|
3368
|
+
const l = [];
|
|
3369
|
+
for (let c = 0; c < r.length; c++) {
|
|
3370
|
+
const u = {};
|
|
3371
|
+
for (let [d, m] of Object.entries(o)) {
|
|
3372
|
+
const v = ($) => m.format === "date" ? St($).unix() : $;
|
|
3373
|
+
r[c].hasOwnProperty(d) ? Array.isArray(r[c][d]) ? u[d] = // @ts-ignore
|
|
3374
|
+
o[d].min <= v(r[c][d][1]) && // @ts-ignore
|
|
3375
|
+
v(r[c][d][0]) <= o[d].max : /* @ts-ignore */ v(r[c][d]) >= o[d].min && // @ts-ignore
|
|
3376
|
+
v(r[c][d]) <= o[d].max ? u[d] = !0 : u[d] = !1 : u[d] = !0;
|
|
3377
|
+
}
|
|
3378
|
+
Object.values(u).every((d) => !!d) && l.push(r[c]);
|
|
3379
|
+
}
|
|
3380
|
+
r = [...l];
|
|
2090
3381
|
}
|
|
2091
|
-
this._results = this.sortResults(
|
|
3382
|
+
this._results = this.sortResults(r), this._config.onSearch(r), this.requestUpdate();
|
|
2092
3383
|
}
|
|
2093
|
-
aggregateResults(
|
|
2094
|
-
return
|
|
2095
|
-
const
|
|
3384
|
+
aggregateResults(e, t) {
|
|
3385
|
+
return e.filter((s) => {
|
|
3386
|
+
const r = s[this._config.aggregateResults], o = Object.keys(
|
|
2096
3387
|
// @ts-ignore
|
|
2097
3388
|
this._filters[this._config.aggregateResults]
|
|
2098
3389
|
// @ts-ignore
|
|
2099
|
-
).filter((c) => this._filters[this._config.aggregateResults][c]);
|
|
2100
|
-
return (
|
|
3390
|
+
).filter((c) => this._filters[this._config.aggregateResults].keys[c]);
|
|
3391
|
+
return (o.length ? (
|
|
2101
3392
|
// @ts-ignore
|
|
2102
|
-
|
|
2103
|
-
) : !0) && Array.isArray(
|
|
3393
|
+
o.includes(t)
|
|
3394
|
+
) : !0) && Array.isArray(r) ? r.includes(t) : r === t;
|
|
2104
3395
|
});
|
|
2105
3396
|
}
|
|
2106
|
-
sortResults(
|
|
2107
|
-
return [...
|
|
2108
|
-
(
|
|
3397
|
+
sortResults(e) {
|
|
3398
|
+
return [...e].sort(
|
|
3399
|
+
(t, s) => (
|
|
2109
3400
|
// @ts-ignore
|
|
2110
|
-
|
|
3401
|
+
t[this._config.titleProperty].localeCompare(s[this._config.titleProperty])
|
|
2111
3402
|
)
|
|
2112
3403
|
);
|
|
2113
3404
|
}
|
|
2114
|
-
toggleFilter(
|
|
2115
|
-
s && Object.keys(this._filters).forEach((
|
|
2116
|
-
this._config.filterProperties.find((c) => c.key ===
|
|
2117
|
-
this._filters[
|
|
3405
|
+
toggleFilter(e, t, s) {
|
|
3406
|
+
s && Object.keys(this._filters).filter((l) => this._filters[l].type === "string").forEach((l) => {
|
|
3407
|
+
this._config.filterProperties.find((c) => c.key === l).exclusive && Object.keys(this._filters[l].keys).forEach((c) => {
|
|
3408
|
+
this._filters[l].keys[c] = !1;
|
|
2118
3409
|
});
|
|
2119
|
-
}), this._filters[
|
|
2120
|
-
const
|
|
2121
|
-
|
|
2122
|
-
const
|
|
3410
|
+
}), this._filters[e].keys[t] = !this._filters[e].keys[t];
|
|
3411
|
+
const r = this.renderRoot.querySelector('input[type="text"]');
|
|
3412
|
+
r ? this.search(r.value) : this.search();
|
|
3413
|
+
const o = this.renderRoot.querySelectorAll(
|
|
2123
3414
|
"ul#results input[type='radio']"
|
|
2124
3415
|
);
|
|
2125
|
-
for (let
|
|
2126
|
-
|
|
3416
|
+
for (let l = 0; l < o.length; l++)
|
|
3417
|
+
o[l].checked = !1;
|
|
2127
3418
|
this._selectedResult && setTimeout(() => {
|
|
2128
|
-
const
|
|
3419
|
+
const l = this.renderRoot.querySelector(
|
|
2129
3420
|
// @ts-ignore
|
|
2130
3421
|
`#${this._selectedResult.id}`
|
|
2131
3422
|
);
|
|
2132
|
-
|
|
3423
|
+
l && (l.checked = !0, this.requestUpdate());
|
|
2133
3424
|
});
|
|
2134
3425
|
}
|
|
2135
3426
|
resetFilters() {
|
|
2136
|
-
this.renderRoot.querySelectorAll(".details-filter input").forEach((
|
|
2137
|
-
|
|
3427
|
+
this.renderRoot.querySelectorAll(".details-filter input").forEach((t) => {
|
|
3428
|
+
t.checked = !1;
|
|
2138
3429
|
});
|
|
2139
|
-
const
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
this._filters[
|
|
3430
|
+
const e = this.renderRoot.querySelector('input[type="text"]');
|
|
3431
|
+
e && (e.value = ""), Object.keys(this._filters).forEach((t) => {
|
|
3432
|
+
if (this._filters[t].type === "range") {
|
|
3433
|
+
this._filters[t].keys.min = this._filters[t].min, this._filters[t].keys.max = this._filters[t].max;
|
|
3434
|
+
return;
|
|
3435
|
+
}
|
|
3436
|
+
Object.keys(this._filters[t].keys).forEach((s) => {
|
|
3437
|
+
this._filters[t].keys[s] = !1;
|
|
2143
3438
|
});
|
|
2144
3439
|
}), this.search(), this.requestUpdate();
|
|
2145
3440
|
}
|
|
2146
3441
|
render() {
|
|
2147
|
-
return
|
|
3442
|
+
return ge`
|
|
2148
3443
|
<style>
|
|
2149
|
-
${
|
|
3444
|
+
${ao}
|
|
3445
|
+
${!this.unstyled && ho}
|
|
2150
3446
|
</style>
|
|
2151
|
-
<form @submit="${(
|
|
2152
|
-
${
|
|
3447
|
+
<form @submit="${(e) => e.preventDefault()}">
|
|
3448
|
+
${Ze(
|
|
2153
3449
|
this._config.enableSearch,
|
|
2154
|
-
() =>
|
|
3450
|
+
() => ge`
|
|
2155
3451
|
<section>
|
|
2156
3452
|
<input
|
|
2157
3453
|
type="text"
|
|
@@ -2163,179 +3459,211 @@ let T = class extends Q {
|
|
|
2163
3459
|
</section>
|
|
2164
3460
|
`
|
|
2165
3461
|
)}
|
|
2166
|
-
${
|
|
3462
|
+
${Ze(
|
|
2167
3463
|
this._config.filterProperties.length,
|
|
2168
|
-
() =>
|
|
2169
|
-
<section class="${this.config.inlineMode ? "inline" :
|
|
2170
|
-
${
|
|
3464
|
+
() => ge`
|
|
3465
|
+
<section class="${this.config.inlineMode ? "inline" : te}">
|
|
3466
|
+
${Ze(
|
|
2171
3467
|
!this.config.inlineMode,
|
|
2172
|
-
() =>
|
|
3468
|
+
() => ge` <slot name="filterstitle"></slot> `
|
|
2173
3469
|
)}
|
|
2174
3470
|
<ul id="filters">
|
|
2175
|
-
${
|
|
3471
|
+
${lt(
|
|
2176
3472
|
this._config.filterProperties,
|
|
2177
|
-
(
|
|
3473
|
+
(e) => ge`
|
|
2178
3474
|
<details
|
|
2179
3475
|
class="details-filter"
|
|
2180
3476
|
part="details-filter"
|
|
2181
|
-
data-filter="${
|
|
3477
|
+
data-filter="${e.key}"
|
|
2182
3478
|
>
|
|
2183
3479
|
<summary>
|
|
2184
|
-
<
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
style="${!t.title && "text-transform: capitalize"}"
|
|
2188
|
-
>
|
|
2189
|
-
${t.title || t.key}
|
|
2190
|
-
${// @ts-ignore
|
|
2191
|
-
Object.values(this._filters[t.key]).filter(
|
|
2192
|
-
(e) => e
|
|
2193
|
-
).length ? `(${Object.values(
|
|
2194
|
-
// @ts-ignore
|
|
2195
|
-
this._filters[t.key]
|
|
2196
|
-
).filter((e) => e).length})` : _}
|
|
2197
|
-
</strong>
|
|
2198
|
-
</small>
|
|
2199
|
-
<div
|
|
2200
|
-
style="display: flex; align-items: center; justify-content: center; margin-left: 4px;"
|
|
3480
|
+
<span
|
|
3481
|
+
class="title"
|
|
3482
|
+
style="${!e.title && "text-transform: capitalize"}"
|
|
2201
3483
|
>
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
</svg>
|
|
2212
|
-
</div>
|
|
3484
|
+
${e.title || e.key}
|
|
3485
|
+
${e.type === "string" && Object.values(
|
|
3486
|
+
// @ts-ignore
|
|
3487
|
+
this._filters[e.key].keys
|
|
3488
|
+
).filter((t) => t).length ? `(${Object.values(
|
|
3489
|
+
// @ts-ignore
|
|
3490
|
+
this._filters[e.key].keys
|
|
3491
|
+
).filter((t) => t).length})` : te}
|
|
3492
|
+
</span>
|
|
2213
3493
|
</summary>
|
|
2214
3494
|
<div class="scroll" style="max-height: 150px">
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
3495
|
+
${e.type === "range" ? ge`
|
|
3496
|
+
<div>
|
|
3497
|
+
${e.format === "date" ? St.unix(
|
|
2218
3498
|
// @ts-ignore
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
3499
|
+
this._filters[e.key].keys.min
|
|
3500
|
+
) : (
|
|
3501
|
+
// @ts-ignore
|
|
3502
|
+
this._filters[e.key].keys.min
|
|
3503
|
+
)}
|
|
3504
|
+
</div>
|
|
3505
|
+
<tc-range-slider
|
|
3506
|
+
min="${// @ts-ignore
|
|
3507
|
+
this._filters[e.key].min}"
|
|
3508
|
+
max="${// @ts-ignore
|
|
3509
|
+
this._filters[e.key].max}"
|
|
3510
|
+
value1="${// @ts-ignore
|
|
3511
|
+
this._filters[e.key].keys.min}"
|
|
3512
|
+
value2="${// @ts-ignore
|
|
3513
|
+
this._filters[e.key].keys.max}"
|
|
3514
|
+
step="1"
|
|
3515
|
+
@change="${(t) => {
|
|
3516
|
+
[
|
|
3517
|
+
// @ts-ignore
|
|
3518
|
+
this._filters[e.key].keys.min,
|
|
3519
|
+
// @ts-ignore
|
|
3520
|
+
this._filters[e.key].keys.max
|
|
3521
|
+
// @ts-ignore
|
|
3522
|
+
] = t.detail.values, this.search(
|
|
3523
|
+
this.renderRoot.querySelector(
|
|
3524
|
+
"input[type='text']"
|
|
3525
|
+
// @ts-ignore
|
|
3526
|
+
).value
|
|
3527
|
+
);
|
|
3528
|
+
}}"
|
|
3529
|
+
></tc-range-slider>
|
|
3530
|
+
<div>
|
|
3531
|
+
${e.format === "date" ? St.unix(
|
|
3532
|
+
// @ts-ignore
|
|
3533
|
+
this._filters[e.key].keys.max
|
|
3534
|
+
) : (
|
|
3535
|
+
// @ts-ignore
|
|
3536
|
+
this._filters[e.key].keys.max
|
|
3537
|
+
)}
|
|
3538
|
+
</div>
|
|
3539
|
+
` : ge`
|
|
3540
|
+
<ul>
|
|
3541
|
+
${// @ts-ignore
|
|
3542
|
+
this._filters[e.key] ? lt(
|
|
3543
|
+
Object.keys(
|
|
3544
|
+
// @ts-ignore
|
|
3545
|
+
this._filters[e.key].keys
|
|
3546
|
+
).sort((t, s) => t.localeCompare(s)),
|
|
3547
|
+
(t) => ge`
|
|
3548
|
+
<li>
|
|
3549
|
+
<label>
|
|
3550
|
+
<input
|
|
3551
|
+
name="selection"
|
|
3552
|
+
type="${e.exclusive ? "radio" : "checkbox"}"
|
|
3553
|
+
checked="${// @ts-ignore
|
|
3554
|
+
this._filters[e.key].keys[t] || te}"
|
|
3555
|
+
@click=${() => this.toggleFilter(
|
|
3556
|
+
e.key,
|
|
3557
|
+
t,
|
|
3558
|
+
e.exclusive
|
|
2234
3559
|
)}
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
3560
|
+
/>
|
|
3561
|
+
<span class="title">${t}</span>
|
|
3562
|
+
</label>
|
|
3563
|
+
</li>
|
|
3564
|
+
`
|
|
2240
3565
|
) : null}
|
|
2241
|
-
|
|
3566
|
+
</ul>
|
|
3567
|
+
`}
|
|
2242
3568
|
</div>
|
|
2243
3569
|
</details>
|
|
2244
3570
|
`
|
|
2245
3571
|
)}
|
|
2246
3572
|
</ul>
|
|
2247
|
-
${
|
|
3573
|
+
${Ze(
|
|
2248
3574
|
this._config.filterProperties,
|
|
2249
|
-
() =>
|
|
3575
|
+
() => ge`
|
|
2250
3576
|
<a
|
|
2251
3577
|
id="filter-reset"
|
|
2252
3578
|
data-cy="filter-reset"
|
|
2253
3579
|
@click=${() => this.resetFilters()}
|
|
2254
|
-
|
|
3580
|
+
>Reset filters</a
|
|
2255
3581
|
>
|
|
2256
3582
|
`
|
|
2257
3583
|
)}
|
|
2258
3584
|
</section>
|
|
2259
3585
|
`
|
|
2260
3586
|
)}
|
|
2261
|
-
${
|
|
3587
|
+
${Ze(
|
|
2262
3588
|
this.config.showResults && this._results,
|
|
2263
|
-
() =>
|
|
3589
|
+
() => ge`
|
|
2264
3590
|
<section id="section-results">
|
|
2265
3591
|
<div>
|
|
2266
3592
|
<slot name="resultstitle"></slot>
|
|
2267
3593
|
</div>
|
|
2268
3594
|
<div id="container-results" class="scroll">
|
|
2269
|
-
${this._results.length < 1 ?
|
|
3595
|
+
${this._results.length < 1 ? ge` <small class="no-results">No matching items</small> ` : te}
|
|
2270
3596
|
<ul id="results" part="results">
|
|
2271
|
-
${this._config.aggregateResults ?
|
|
3597
|
+
${this._config.aggregateResults ? lt(
|
|
2272
3598
|
this._resultAggregation.filter(
|
|
2273
|
-
(
|
|
3599
|
+
(e) => this.aggregateResults(
|
|
2274
3600
|
this._results,
|
|
2275
|
-
|
|
3601
|
+
e
|
|
2276
3602
|
).length
|
|
2277
3603
|
),
|
|
2278
|
-
(
|
|
3604
|
+
(e) => ge`<details
|
|
2279
3605
|
id="details-results"
|
|
2280
3606
|
open
|
|
2281
3607
|
>
|
|
2282
3608
|
<summary>
|
|
2283
|
-
<
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
<title>chevron-down</title>
|
|
2288
|
-
<path
|
|
2289
|
-
d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
|
|
2290
|
-
/>
|
|
2291
|
-
</svg>
|
|
2292
|
-
<strong class="title">
|
|
2293
|
-
${t}
|
|
2294
|
-
</strong>
|
|
2295
|
-
<span style="margin-left: 0.25rem"
|
|
2296
|
-
>(${this.aggregateResults(
|
|
3609
|
+
<span class="title">
|
|
3610
|
+
${e}
|
|
3611
|
+
<span class="count"
|
|
3612
|
+
>(${this.aggregateResults(
|
|
2297
3613
|
this._results,
|
|
2298
|
-
|
|
3614
|
+
e
|
|
2299
3615
|
).length})</span
|
|
2300
|
-
|
|
3616
|
+
>
|
|
3617
|
+
</span>
|
|
2301
3618
|
</summary>
|
|
2302
3619
|
<ul>
|
|
2303
|
-
${
|
|
3620
|
+
${lt(
|
|
2304
3621
|
this.aggregateResults(
|
|
2305
3622
|
this._results,
|
|
2306
|
-
|
|
3623
|
+
e
|
|
2307
3624
|
),
|
|
2308
3625
|
// @ts-ignore
|
|
2309
|
-
(
|
|
3626
|
+
(t) => ge`
|
|
2310
3627
|
<li>
|
|
2311
3628
|
<label>
|
|
2312
3629
|
<input
|
|
2313
3630
|
type="radio"
|
|
2314
3631
|
name="result"
|
|
2315
3632
|
id="${// @ts-ignore
|
|
2316
|
-
|
|
3633
|
+
t.id}"
|
|
2317
3634
|
@click=${() => {
|
|
2318
|
-
this._selectedResult =
|
|
3635
|
+
this._selectedResult = t, this._config.onSelect(t);
|
|
2319
3636
|
}}
|
|
2320
3637
|
/>
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
3638
|
+
${Ze(
|
|
3639
|
+
this.hasTemplate("result"),
|
|
3640
|
+
() => this.renderTemplate(
|
|
3641
|
+
"result",
|
|
3642
|
+
t,
|
|
3643
|
+
// @ts-ignore
|
|
3644
|
+
`result-${t.id}`
|
|
3645
|
+
),
|
|
3646
|
+
() => ge`
|
|
3647
|
+
<span class="title"
|
|
3648
|
+
>${hi(
|
|
3649
|
+
// @ts-ignore
|
|
3650
|
+
t[this._config.titleProperty]
|
|
3651
|
+
)}</span
|
|
3652
|
+
>
|
|
3653
|
+
`
|
|
3654
|
+
)}
|
|
2327
3655
|
</label>
|
|
2328
3656
|
</li>
|
|
2329
3657
|
`
|
|
2330
3658
|
)}
|
|
2331
3659
|
</ul>
|
|
2332
3660
|
</details>`
|
|
2333
|
-
) :
|
|
3661
|
+
) : lt(
|
|
2334
3662
|
this._results,
|
|
2335
3663
|
// @ts-ignore
|
|
2336
|
-
(
|
|
3664
|
+
(e) => ge`<li part="result">
|
|
2337
3665
|
${// @ts-ignore
|
|
2338
|
-
|
|
3666
|
+
hi(e[this._config.titleProperty])}
|
|
2339
3667
|
</li>`
|
|
2340
3668
|
)}
|
|
2341
3669
|
</ul>
|
|
@@ -2363,27 +3691,30 @@ let T = class extends Q {
|
|
|
2363
3691
|
// slot.replaceWith(clon);
|
|
2364
3692
|
// }
|
|
2365
3693
|
};
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
],
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
],
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
],
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
],
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
],
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
],
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
],
|
|
3694
|
+
He([
|
|
3695
|
+
Rt()
|
|
3696
|
+
], Pe.prototype, "_items", 2);
|
|
3697
|
+
He([
|
|
3698
|
+
Rt()
|
|
3699
|
+
], Pe.prototype, "_results", 2);
|
|
3700
|
+
He([
|
|
3701
|
+
Rt()
|
|
3702
|
+
], Pe.prototype, "_filters", 2);
|
|
3703
|
+
He([
|
|
3704
|
+
Rt()
|
|
3705
|
+
], Pe.prototype, "_selectedResult", 2);
|
|
3706
|
+
He([
|
|
3707
|
+
Dt({ attribute: !1 })
|
|
3708
|
+
], Pe.prototype, "config", 1);
|
|
3709
|
+
He([
|
|
3710
|
+
Dt()
|
|
3711
|
+
], Pe.prototype, "apply", 2);
|
|
3712
|
+
He([
|
|
3713
|
+
Dt({ type: Boolean })
|
|
3714
|
+
], Pe.prototype, "unstyled", 2);
|
|
3715
|
+
Pe = He([
|
|
3716
|
+
Kr("eox-itemfilter")
|
|
3717
|
+
], Pe);
|
|
2387
3718
|
export {
|
|
2388
|
-
|
|
3719
|
+
Pe as EOxItemFilter
|
|
2389
3720
|
};
|