5
282: function (e, t, i) {
6
Object.defineProperty(t, "__esModule", {value: !0}), t.clearChoices = t.activateChoices = t.filterChoices = t.addChoice = void 0;
8
t.addChoice = function (e) {
9
var t = e.value, i = e.label, r = e.id, s = e.groupId, o = e.disabled, a = e.elementId,
10
c = e.customProperties, l = e.placeholder, h = e.keyCode;
12
type: n.ACTION_TYPES.ADD_CHOICE,
23
}, t.filterChoices = function (e) {
24
return {type: n.ACTION_TYPES.FILTER_CHOICES, results: e}
25
}, t.activateChoices = function (e) {
26
return void 0 === e && (e = !0), {type: n.ACTION_TYPES.ACTIVATE_CHOICES, active: e}
27
}, t.clearChoices = function () {
28
return {type: n.ACTION_TYPES.CLEAR_CHOICES}
30
}, 783: function (e, t, i) {
31
Object.defineProperty(t, "__esModule", {value: !0}), t.addGroup = void 0;
33
t.addGroup = function (e) {
34
var t = e.value, i = e.id, r = e.active, s = e.disabled;
35
return {type: n.ACTION_TYPES.ADD_GROUP, value: t, id: i, active: r, disabled: s}
37
}, 464: function (e, t, i) {
38
Object.defineProperty(t, "__esModule", {value: !0}), t.highlightItem = t.removeItem = t.addItem = void 0;
40
t.addItem = function (e) {
41
var t = e.value, i = e.label, r = e.id, s = e.choiceId, o = e.groupId, a = e.customProperties,
42
c = e.placeholder, l = e.keyCode;
44
type: n.ACTION_TYPES.ADD_ITEM,
54
}, t.removeItem = function (e, t) {
55
return {type: n.ACTION_TYPES.REMOVE_ITEM, id: e, choiceId: t}
56
}, t.highlightItem = function (e, t) {
57
return {type: n.ACTION_TYPES.HIGHLIGHT_ITEM, id: e, highlighted: t}
59
}, 137: function (e, t, i) {
60
Object.defineProperty(t, "__esModule", {value: !0}), t.setIsLoading = t.resetTo = t.clearAll = void 0;
62
t.clearAll = function () {
63
return {type: n.ACTION_TYPES.CLEAR_ALL}
64
}, t.resetTo = function (e) {
65
return {type: n.ACTION_TYPES.RESET_TO, state: e}
66
}, t.setIsLoading = function (e) {
67
return {type: n.ACTION_TYPES.SET_IS_LOADING, isLoading: e}
69
}, 373: function (e, t, i) {
70
var n = this && this.__spreadArray || function (e, t, i) {
71
if (i || 2 === arguments.length) for (var n, r = 0, s = t.length; r < s; r++) !n && r in t || (n || (n = Array.prototype.slice.call(t, 0, r)), n[r] = t[r]);
72
return e.concat(n || Array.prototype.slice.call(t))
73
}, r = this && this.__importDefault || function (e) {
74
return e && e.__esModule ? e : {default: e}
76
Object.defineProperty(t, "__esModule", {value: !0});
77
var s = r(i(996)), o = r(i(221)), a = i(282), c = i(783), l = i(464), h = i(137), u = i(520), d = i(883),
78
p = i(789), f = i(799), m = i(655), v = r(i(744)), g = r(i(686)),
79
_ = "-ms-scroll-limit" in document.documentElement.style && "-ms-ime-align" in document.documentElement.style,
80
y = {}, E = function () {
82
void 0 === t && (t = "[data-choice]"), void 0 === i && (i = {});
84
void 0 === i.allowHTML && console.warn("Deprecation warning: allowHTML will default to false in a future release. To render HTML in Choices, you will need to set it to true. Setting allowHTML will suppress this message."), this.config = s.default.all([p.DEFAULT_CONFIG, e.defaults.options, i], {
85
arrayMerge: function (e, t) {
89
var o = (0, f.diff)(this.config, p.DEFAULT_CONFIG);
90
o.length && console.warn("Unknown config option(s) passed", o.join(", "));
91
var a = "string" == typeof t ? document.querySelector(t) : t;
92
if (!(a instanceof HTMLInputElement || a instanceof HTMLSelectElement)) throw TypeError("Expected one of the following types text|select-one|select-multiple");
93
if (this._isTextElement = a.type === d.TEXT_TYPE, this._isSelectOneElement = a.type === d.SELECT_ONE_TYPE, this._isSelectMultipleElement = a.type === d.SELECT_MULTIPLE_TYPE, this._isSelectElement = this._isSelectOneElement || this._isSelectMultipleElement, this.config.searchEnabled = this._isSelectMultipleElement || this.config.searchEnabled, ["auto", "always"].includes("".concat(this.config.renderSelectedChoices)) || (this.config.renderSelectedChoices = "auto"), i.addItemFilter && "function" != typeof i.addItemFilter) {
94
var c = i.addItemFilter instanceof RegExp ? i.addItemFilter : new RegExp(i.addItemFilter);
95
this.config.addItemFilter = c.test.bind(c)
97
if (this._isTextElement ? this.passedElement = new u.WrappedInput({
99
classNames: this.config.classNames,
100
delimiter: this.config.delimiter
101
}) : this.passedElement = new u.WrappedSelect({
103
classNames: this.config.classNames,
104
template: function (e) {
105
return r._templates.option(e)
107
}), this.initialised = !1, this._store = new v.default, this._initialState = m.defaultState, this._currentState = m.defaultState, this._prevState = m.defaultState, this._currentValue = "", this._canSearch = !!this.config.searchEnabled, this._isScrollingOnIe = !1, this._highlightPosition = 0, this._wasTap = !0, this._placeholderValue = this._generatePlaceholderValue(), this._baseId = (0, f.generateId)(this.passedElement.element, "choices-"), this._direction = this.passedElement.dir, !this._direction) {
108
var l = window.getComputedStyle(this.passedElement.element).direction;
109
l !== window.getComputedStyle(document.documentElement).direction && (this._direction = l)
111
if (this._idNames = {itemChoice: "item-choice"}, this._isSelectElement && (this._presetGroups = this.passedElement.optionGroups, this._presetOptions = this.passedElement.options), this._presetChoices = this.config.choices, this._presetItems = this.config.items, this.passedElement.value && this._isTextElement) {
112
var h = this.passedElement.value.split(this.config.delimiter);
113
this._presetItems = this._presetItems.concat(h)
115
if (this.passedElement.options && this.passedElement.options.forEach((function (e) {
116
r._presetChoices.push({
119
selected: !!e.selected,
120
disabled: e.disabled || e.parentNode.disabled,
121
placeholder: "" === e.value || e.hasAttribute("placeholder"),
122
customProperties: (0, f.parseCustomProperties)(e.dataset.customProperties)
124
})), this._render = this._render.bind(this), this._onFocus = this._onFocus.bind(this), this._onBlur = this._onBlur.bind(this), this._onKeyUp = this._onKeyUp.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onClick = this._onClick.bind(this), this._onTouchMove = this._onTouchMove.bind(this), this._onTouchEnd = this._onTouchEnd.bind(this), this._onMouseDown = this._onMouseDown.bind(this), this._onMouseOver = this._onMouseOver.bind(this), this._onFormReset = this._onFormReset.bind(this), this._onSelectKey = this._onSelectKey.bind(this), this._onEnterKey = this._onEnterKey.bind(this), this._onEscapeKey = this._onEscapeKey.bind(this), this._onDirectionKey = this._onDirectionKey.bind(this), this._onDeleteKey = this._onDeleteKey.bind(this), this.passedElement.isActive) return this.config.silent || console.warn("Trying to initialise Choices on element already initialised", {element: t}), void (this.initialised = !0);
128
return Object.defineProperty(e, "defaults", {
130
return Object.preventExtensions({
137
}, enumerable: !1, configurable: !0
138
}), e.prototype.init = function () {
139
if (!this.initialised) {
140
this._createTemplates(), this._createElements(), this._createStructure(), this._store.subscribe(this._render), this._render(), this._addEventListeners(), (!this.config.addItems || this.passedElement.element.hasAttribute("disabled")) && this.disable(), this.initialised = !0;
141
var e = this.config.callbackOnInit;
142
e && "function" == typeof e && e.call(this)
144
}, e.prototype.destroy = function () {
145
this.initialised && (this._removeEventListeners(), this.passedElement.reveal(), this.containerOuter.unwrap(this.passedElement.element), this.clearStore(), this._isSelectElement && (this.passedElement.options = this._presetOptions), this._templates = g.default, this.initialised = !1)
146
}, e.prototype.enable = function () {
147
return this.passedElement.isDisabled && this.passedElement.enable(), this.containerOuter.isDisabled && (this._addEventListeners(), this.input.enable(), this.containerOuter.enable()), this
148
}, e.prototype.disable = function () {
149
return this.passedElement.isDisabled || this.passedElement.disable(), this.containerOuter.isDisabled || (this._removeEventListeners(), this.input.disable(), this.containerOuter.disable()), this
150
}, e.prototype.highlightItem = function (e, t) {
151
if (void 0 === t && (t = !0), !e || !e.id) return this;
152
var i = e.id, n = e.groupId, r = void 0 === n ? -1 : n, s = e.value, o = void 0 === s ? "" : s,
153
a = e.label, c = void 0 === a ? "" : a, h = r >= 0 ? this._store.getGroupById(r) : null;
154
return this._store.dispatch((0, l.highlightItem)(i, !0)), t && this.passedElement.triggerEvent(d.EVENTS.highlightItem, {
158
groupValue: h && h.value ? h.value : null
160
}, e.prototype.unhighlightItem = function (e) {
161
if (!e || !e.id) return this;
162
var t = e.id, i = e.groupId, n = void 0 === i ? -1 : i, r = e.value, s = void 0 === r ? "" : r,
163
o = e.label, a = void 0 === o ? "" : o, c = n >= 0 ? this._store.getGroupById(n) : null;
164
return this._store.dispatch((0, l.highlightItem)(t, !1)), this.passedElement.triggerEvent(d.EVENTS.highlightItem, {
168
groupValue: c && c.value ? c.value : null
170
}, e.prototype.highlightAll = function () {
172
return this._store.items.forEach((function (t) {
173
return e.highlightItem(t)
175
}, e.prototype.unhighlightAll = function () {
177
return this._store.items.forEach((function (t) {
178
return e.unhighlightItem(t)
180
}, e.prototype.removeActiveItemsByValue = function (e) {
182
return this._store.activeItems.filter((function (t) {
184
})).forEach((function (e) {
185
return t._removeItem(e)
187
}, e.prototype.removeActiveItems = function (e) {
189
return this._store.activeItems.filter((function (t) {
191
})).forEach((function (e) {
192
return t._removeItem(e)
194
}, e.prototype.removeHighlightedItems = function (e) {
196
return void 0 === e && (e = !1), this._store.highlightedActiveItems.forEach((function (i) {
197
t._removeItem(i), e && t._triggerChange(i.value)
199
}, e.prototype.showDropdown = function (e) {
201
return this.dropdown.isActive || requestAnimationFrame((function () {
202
t.dropdown.show(), t.containerOuter.open(t.dropdown.distanceFromTopWindow), !e && t._canSearch && t.input.focus(), t.passedElement.triggerEvent(d.EVENTS.showDropdown, {})
204
}, e.prototype.hideDropdown = function (e) {
206
return this.dropdown.isActive ? (requestAnimationFrame((function () {
207
t.dropdown.hide(), t.containerOuter.close(), !e && t._canSearch && (t.input.removeActiveDescendant(), t.input.blur()), t.passedElement.triggerEvent(d.EVENTS.hideDropdown, {})
209
}, e.prototype.getValue = function (e) {
210
void 0 === e && (e = !1);
211
var t = this._store.activeItems.reduce((function (t, i) {
212
var n = e ? i.value : i;
215
return this._isSelectOneElement ? t[0] : t
216
}, e.prototype.setValue = function (e) {
218
return this.initialised ? (e.forEach((function (e) {
219
return t._setChoiceOrItem(e)
221
}, e.prototype.setChoiceByValue = function (e) {
223
return !this.initialised || this._isTextElement || (Array.isArray(e) ? e : [e]).forEach((function (e) {
224
return t._findAndSelectChoiceByValue(e)
226
}, e.prototype.setChoices = function (e, t, i, n) {
228
if (void 0 === e && (e = []), void 0 === t && (t = "value"), void 0 === i && (i = "label"), void 0 === n && (n = !1), !this.initialised) throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");
229
if (!this._isSelectElement) throw new TypeError("setChoices can't be used with INPUT based Choices");
230
if ("string" != typeof t || !t) throw new TypeError("value parameter must be a name of 'value' field in passed objects");
231
if (n && this.clearChoices(), "function" == typeof e) {
233
if ("function" == typeof Promise && s instanceof Promise) return new Promise((function (e) {
234
return requestAnimationFrame(e)
235
})).then((function () {
236
return r._handleLoadingState(!0)
237
})).then((function () {
239
})).then((function (e) {
240
return r.setChoices(e, t, i, n)
241
})).catch((function (e) {
242
r.config.silent || console.error(e)
243
})).then((function () {
244
return r._handleLoadingState(!1)
245
})).then((function () {
248
if (!Array.isArray(s)) throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof s));
249
return this.setChoices(s, t, i, !1)
251
if (!Array.isArray(e)) throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");
252
return this.containerOuter.removeLoadingState(), this._startLoading(), e.forEach((function (e) {
253
if (e.choices) r._addGroup({
254
id: e.id ? parseInt("".concat(e.id), 10) : null,
263
isSelected: !!n.selected,
264
isDisabled: !!n.disabled,
265
placeholder: !!n.placeholder,
266
customProperties: n.customProperties
269
})), this._stopLoading(), this
270
}, e.prototype.clearChoices = function () {
271
return this._store.dispatch((0, a.clearChoices)()), this
272
}, e.prototype.clearStore = function () {
273
return this._store.dispatch((0, h.clearAll)()), this
274
}, e.prototype.clearInput = function () {
275
var e = !this._isSelectOneElement;
276
return this.input.clear(e), !this._isTextElement && this._canSearch && (this._isSearching = !1, this._store.dispatch((0, a.activateChoices)(!0))), this
277
}, e.prototype._render = function () {
278
if (!this._store.isLoading()) {
279
this._currentState = this._store.state;
280
var e = this._currentState.choices !== this._prevState.choices || this._currentState.groups !== this._prevState.groups || this._currentState.items !== this._prevState.items,
281
t = this._isSelectElement, i = this._currentState.items !== this._prevState.items;
282
e && (t && this._renderChoices(), i && this._renderItems(), this._prevState = this._currentState)
284
}, e.prototype._renderChoices = function () {
285
var e = this, t = this._store, i = t.activeGroups, n = t.activeChoices,
286
r = document.createDocumentFragment();
287
if (this.choiceList.clear(), this.config.resetScrollPosition && requestAnimationFrame((function () {
288
return e.choiceList.scrollToTop()
289
})), i.length >= 1 && !this._isSearching) {
290
var s = n.filter((function (e) {
291
return !0 === e.placeholder && -1 === e.groupId
293
s.length >= 1 && (r = this._createChoicesFragment(s, r)), r = this._createGroupsFragment(i, n, r)
294
} else n.length >= 1 && (r = this._createChoicesFragment(n, r));
295
if (r.childNodes && r.childNodes.length > 0) {
296
var o = this._store.activeItems, a = this._canAddItem(o, this.input.value);
297
if (a.response) this.choiceList.append(r), this._highlightChoice(); else {
298
var c = this._getTemplate("notice", a.notice);
299
this.choiceList.append(c)
303
c = void 0, this._isSearching ? (c = "function" == typeof this.config.noResultsText ? this.config.noResultsText() : this.config.noResultsText, l = this._getTemplate("notice", c, "no-results")) : (c = "function" == typeof this.config.noChoicesText ? this.config.noChoicesText() : this.config.noChoicesText, l = this._getTemplate("notice", c, "no-choices")), this.choiceList.append(l)
305
}, e.prototype._renderItems = function () {
306
var e = this._store.activeItems || [];
307
this.itemList.clear();
308
var t = this._createItemsFragment(e);
309
t.childNodes && this.itemList.append(t)
310
}, e.prototype._createGroupsFragment = function (e, t, i) {
312
return void 0 === i && (i = document.createDocumentFragment()), this.config.shouldSort && e.sort(this.config.sorter), e.forEach((function (e) {
313
var r = function (e) {
314
return t.filter((function (t) {
315
return n._isSelectOneElement ? t.groupId === e.id : t.groupId === e.id && ("always" === n.config.renderSelectedChoices || !t.selected)
319
var s = n._getTemplate("choiceGroup", e);
320
i.appendChild(s), n._createChoicesFragment(r, i, !0)
323
}, e.prototype._createChoicesFragment = function (e, t, i) {
325
void 0 === t && (t = document.createDocumentFragment()), void 0 === i && (i = !1);
326
var s = this.config, o = s.renderSelectedChoices, a = s.searchResultLimit, c = s.renderChoiceLimit,
327
l = this._isSearching ? f.sortByScore : this.config.sorter, h = function (e) {
328
if ("auto" !== o || r._isSelectOneElement || !e.selected) {
329
var i = r._getTemplate("choice", e, r.config.itemSelectText);
333
"auto" !== o || this._isSelectOneElement || (u = e.filter((function (e) {
336
var d = u.reduce((function (e, t) {
337
return t.placeholder ? e.placeholderChoices.push(t) : e.normalChoices.push(t), e
338
}), {placeholderChoices: [], normalChoices: []}), p = d.placeholderChoices, m = d.normalChoices;
339
(this.config.shouldSort || this._isSearching) && m.sort(l);
340
var v = u.length, g = this._isSelectOneElement ? n(n([], p, !0), m, !0) : m;
341
this._isSearching ? v = a : c && c > 0 && !i && (v = c);
342
for (var _ = 0; _ < v; _ += 1) g[_] && h(g[_]);
344
}, e.prototype._createItemsFragment = function (e, t) {
346
void 0 === t && (t = document.createDocumentFragment());
347
var n = this.config, r = n.shouldSortItems, s = n.sorter, o = n.removeItemButton;
348
return r && !this._isSelectOneElement && e.sort(s), this._isTextElement ? this.passedElement.value = e.map((function (e) {
350
})).join(this.config.delimiter) : this.passedElement.options = e, e.forEach((function (e) {
351
var n = i._getTemplate("item", e, o);
354
}, e.prototype._triggerChange = function (e) {
355
null != e && this.passedElement.triggerEvent(d.EVENTS.change, {value: e})
356
}, e.prototype._selectPlaceholderChoice = function (e) {
362
placeholder: e.placeholder
363
}), this._triggerChange(e.value)
364
}, e.prototype._handleButtonAction = function (e, t) {
365
if (e && t && this.config.removeItems && this.config.removeItemButton) {
366
var i = t.parentNode && t.parentNode.dataset.id, n = i && e.find((function (e) {
367
return e.id === parseInt(i, 10)
369
n && (this._removeItem(n), this._triggerChange(n.value), this._isSelectOneElement && this._store.placeholderChoice && this._selectPlaceholderChoice(this._store.placeholderChoice))
371
}, e.prototype._handleItemAction = function (e, t, i) {
373
if (void 0 === i && (i = !1), e && t && this.config.removeItems && !this._isSelectOneElement) {
374
var r = t.dataset.id;
375
e.forEach((function (e) {
376
e.id !== parseInt("".concat(r), 10) || e.highlighted ? !i && e.highlighted && n.unhighlightItem(e) : n.highlightItem(e)
377
})), this.input.focus()
379
}, e.prototype._handleChoiceAction = function (e, t) {
381
var i = t.dataset.id, n = i && this._store.getChoiceById(i);
383
var r = e[0] && e[0].keyCode ? e[0].keyCode : void 0, s = this.dropdown.isActive;
384
n.keyCode = r, this.passedElement.triggerEvent(d.EVENTS.choice, {choice: n}), n.selected || n.disabled || this._canAddItem(e, n.value).response && (this._addItem({
389
customProperties: n.customProperties,
390
placeholder: n.placeholder,
392
}), this._triggerChange(n.value)), this.clearInput(), s && this._isSelectOneElement && (this.hideDropdown(!0), this.containerOuter.focus())
395
}, e.prototype._handleBackspace = function (e) {
396
if (this.config.removeItems && e) {
397
var t = e[e.length - 1], i = e.some((function (e) {
400
this.config.editItems && !i && t ? (this.input.value = t.value, this.input.setWidth(), this._removeItem(t), this._triggerChange(t.value)) : (i || this.highlightItem(t, !1), this.removeHighlightedItems(!0))
402
}, e.prototype._startLoading = function () {
403
this._store.dispatch((0, h.setIsLoading)(!0))
404
}, e.prototype._stopLoading = function () {
405
this._store.dispatch((0, h.setIsLoading)(!1))
406
}, e.prototype._handleLoadingState = function (e) {
407
void 0 === e && (e = !0);
408
var t = this.itemList.getChild(".".concat(this.config.classNames.placeholder));
409
e ? (this.disable(), this.containerOuter.addLoadingState(), this._isSelectOneElement ? t ? t.innerHTML = this.config.loadingText : (t = this._getTemplate("placeholder", this.config.loadingText)) && this.itemList.append(t) : this.input.placeholder = this.config.loadingText) : (this.enable(), this.containerOuter.removeLoadingState(), this._isSelectOneElement ? t && (t.innerHTML = this._placeholderValue || "") : this.input.placeholder = this._placeholderValue || "")
410
}, e.prototype._handleSearch = function (e) {
411
if (this.input.isFocussed) {
412
var t = this._store.choices, i = this.config, n = i.searchFloor, r = i.searchChoices,
413
s = t.some((function (e) {
416
if (null != e && e.length >= n) {
417
var o = r ? this._searchChoices(e) : 0;
418
this.passedElement.triggerEvent(d.EVENTS.search, {value: e, resultCount: o})
419
} else s && (this._isSearching = !1, this._store.dispatch((0, a.activateChoices)(!0)))
421
}, e.prototype._canAddItem = function (e, t) {
423
n = "function" == typeof this.config.addItemText ? this.config.addItemText(t) : this.config.addItemText;
424
if (!this._isSelectOneElement) {
425
var r = (0, f.existsInArray)(e, t);
426
this.config.maxItemCount > 0 && this.config.maxItemCount <= e.length && (i = !1, n = "function" == typeof this.config.maxItemText ? this.config.maxItemText(this.config.maxItemCount) : this.config.maxItemText), !this.config.duplicateItemsAllowed && r && i && (i = !1, n = "function" == typeof this.config.uniqueItemText ? this.config.uniqueItemText(t) : this.config.uniqueItemText), this._isTextElement && this.config.addItems && i && "function" == typeof this.config.addItemFilter && !this.config.addItemFilter(t) && (i = !1, n = "function" == typeof this.config.customAddItemText ? this.config.customAddItemText(t) : this.config.customAddItemText)
428
return {response: i, notice: n}
429
}, e.prototype._searchChoices = function (e) {
430
var t = "string" == typeof e ? e.trim() : e,
431
i = "string" == typeof this._currentValue ? this._currentValue.trim() : this._currentValue;
432
if (t.length < 1 && t === "".concat(i, " ")) return 0;
433
var r = this._store.searchableChoices, s = t, c = Object.assign(this.config.fuseOptions, {
434
keys: n([], this.config.searchFields, !0),
436
}), l = new o.default(r, c).search(s);
437
return this._currentValue = t, this._highlightPosition = 0, this._isSearching = !0, this._store.dispatch((0, a.filterChoices)(l)), l.length
438
}, e.prototype._addEventListeners = function () {
439
var e = document.documentElement;
440
e.addEventListener("touchend", this._onTouchEnd, !0), this.containerOuter.element.addEventListener("keydown", this._onKeyDown, !0), this.containerOuter.element.addEventListener("mousedown", this._onMouseDown, !0), e.addEventListener("click", this._onClick, {passive: !0}), e.addEventListener("touchmove", this._onTouchMove, {passive: !0}), this.dropdown.element.addEventListener("mouseover", this._onMouseOver, {passive: !0}), this._isSelectOneElement && (this.containerOuter.element.addEventListener("focus", this._onFocus, {passive: !0}), this.containerOuter.element.addEventListener("blur", this._onBlur, {passive: !0})), this.input.element.addEventListener("keyup", this._onKeyUp, {passive: !0}), this.input.element.addEventListener("focus", this._onFocus, {passive: !0}), this.input.element.addEventListener("blur", this._onBlur, {passive: !0}), this.input.element.form && this.input.element.form.addEventListener("reset", this._onFormReset, {passive: !0}), this.input.addEventListeners()
441
}, e.prototype._removeEventListeners = function () {
442
var e = document.documentElement;
443
e.removeEventListener("touchend", this._onTouchEnd, !0), this.containerOuter.element.removeEventListener("keydown", this._onKeyDown, !0), this.containerOuter.element.removeEventListener("mousedown", this._onMouseDown, !0), e.removeEventListener("click", this._onClick), e.removeEventListener("touchmove", this._onTouchMove), this.dropdown.element.removeEventListener("mouseover", this._onMouseOver), this._isSelectOneElement && (this.containerOuter.element.removeEventListener("focus", this._onFocus), this.containerOuter.element.removeEventListener("blur", this._onBlur)), this.input.element.removeEventListener("keyup", this._onKeyUp), this.input.element.removeEventListener("focus", this._onFocus), this.input.element.removeEventListener("blur", this._onBlur), this.input.element.form && this.input.element.form.removeEventListener("reset", this._onFormReset), this.input.removeEventListeners()
444
}, e.prototype._onKeyDown = function (e) {
445
var t = e.keyCode, i = this._store.activeItems, n = this.input.isFocussed,
446
r = this.dropdown.isActive, s = this.itemList.hasChildren(), o = String.fromCharCode(t),
447
a = /[^\x00-\x1F]/.test(o), c = d.KEY_CODES.BACK_KEY, l = d.KEY_CODES.DELETE_KEY,
448
h = d.KEY_CODES.ENTER_KEY, u = d.KEY_CODES.A_KEY, p = d.KEY_CODES.ESC_KEY,
449
f = d.KEY_CODES.UP_KEY, m = d.KEY_CODES.DOWN_KEY, v = d.KEY_CODES.PAGE_UP_KEY,
450
g = d.KEY_CODES.PAGE_DOWN_KEY;
451
switch (this._isTextElement || r || !a || (this.showDropdown(), this.input.isFocussed || (this.input.value += e.key.toLowerCase())), t) {
453
return this._onSelectKey(e, s);
455
return this._onEnterKey(e, i, r);
457
return this._onEscapeKey(r);
462
return this._onDirectionKey(e, r);
465
return this._onDeleteKey(e, i, n)
467
}, e.prototype._onKeyUp = function (e) {
468
var t = e.target, i = e.keyCode, n = this.input.value, r = this._store.activeItems,
469
s = this._canAddItem(r, n), o = d.KEY_CODES.BACK_KEY, c = d.KEY_CODES.DELETE_KEY;
470
if (this._isTextElement) if (s.notice && n) {
471
var l = this._getTemplate("notice", s.notice);
472
this.dropdown.element.innerHTML = l.outerHTML, this.showDropdown(!0)
473
} else this.hideDropdown(!0); else {
474
var h = (i === o || i === c) && t && !t.value, u = !this._isTextElement && this._isSearching,
475
p = this._canSearch && s.response;
476
h && u ? (this._isSearching = !1, this._store.dispatch((0, a.activateChoices)(!0))) : p && this._handleSearch(this.input.rawValue)
478
this._canSearch = this.config.searchEnabled
479
}, e.prototype._onSelectKey = function (e, t) {
480
var i = e.ctrlKey, n = e.metaKey;
481
(i || n) && t && (this._canSearch = !1, this.config.removeItems && !this.input.value && this.input.element === document.activeElement && this.highlightAll())
482
}, e.prototype._onEnterKey = function (e, t, i) {
483
var n = e.target, r = d.KEY_CODES.ENTER_KEY, s = n && n.hasAttribute("data-button");
484
if (this._isTextElement && n && n.value) {
485
var o = this.input.value;
486
this._canAddItem(t, o).response && (this.hideDropdown(!0), this._addItem({value: o}), this._triggerChange(o), this.clearInput())
488
if (s && (this._handleButtonAction(t, n), e.preventDefault()), i) {
489
var a = this.dropdown.getChild(".".concat(this.config.classNames.highlightedState));
490
a && (t[0] && (t[0].keyCode = r), this._handleChoiceAction(t, a)), e.preventDefault()
491
} else this._isSelectOneElement && (this.showDropdown(), e.preventDefault())
492
}, e.prototype._onEscapeKey = function (e) {
493
e && (this.hideDropdown(!0), this.containerOuter.focus())
494
}, e.prototype._onDirectionKey = function (e, t) {
495
var i = e.keyCode, n = e.metaKey, r = d.KEY_CODES.DOWN_KEY, s = d.KEY_CODES.PAGE_UP_KEY,
496
o = d.KEY_CODES.PAGE_DOWN_KEY;
497
if (t || this._isSelectOneElement) {
498
this.showDropdown(), this._canSearch = !1;
499
var a = i === r || i === o ? 1 : -1, c = "[data-choice-selectable]", l = void 0;
500
if (n || i === o || i === s) l = a > 0 ? this.dropdown.element.querySelector("".concat(c, ":last-of-type")) : this.dropdown.element.querySelector(c); else {
501
var h = this.dropdown.element.querySelector(".".concat(this.config.classNames.highlightedState));
502
l = h ? (0, f.getAdjacentEl)(h, c, a) : this.dropdown.element.querySelector(c)
504
l && ((0, f.isScrolledIntoView)(l, this.choiceList.element, a) || this.choiceList.scrollToChildElement(l, a), this._highlightChoice(l)), e.preventDefault()
506
}, e.prototype._onDeleteKey = function (e, t, i) {
508
this._isSelectOneElement || n.value || !i || (this._handleBackspace(t), e.preventDefault())
509
}, e.prototype._onTouchMove = function () {
510
this._wasTap && (this._wasTap = !1)
511
}, e.prototype._onTouchEnd = function (e) {
512
var t = (e || e.touches[0]).target;
513
this._wasTap && this.containerOuter.element.contains(t) && ((t === this.containerOuter.element || t === this.containerInner.element) && (this._isTextElement ? this.input.focus() : this._isSelectMultipleElement && this.showDropdown()), e.stopPropagation()), this._wasTap = !0
514
}, e.prototype._onMouseDown = function (e) {
516
if (t instanceof HTMLElement) {
517
if (_ && this.choiceList.element.contains(t)) {
518
var i = this.choiceList.element.firstElementChild,
519
n = "ltr" === this._direction ? e.offsetX >= i.offsetWidth : e.offsetX < i.offsetLeft;
520
this._isScrollingOnIe = n
522
if (t !== this.input.element) {
523
var r = t.closest("[data-button],[data-item],[data-choice]");
524
if (r instanceof HTMLElement) {
525
var s = e.shiftKey, o = this._store.activeItems, a = r.dataset;
526
"button" in a ? this._handleButtonAction(o, r) : "item" in a ? this._handleItemAction(o, r, s) : "choice" in a && this._handleChoiceAction(o, r)
531
}, e.prototype._onMouseOver = function (e) {
533
t instanceof HTMLElement && "choice" in t.dataset && this._highlightChoice(t)
534
}, e.prototype._onClick = function (e) {
536
this.containerOuter.element.contains(t) ? this.dropdown.isActive || this.containerOuter.isDisabled ? this._isSelectOneElement && t !== this.input.element && !this.dropdown.element.contains(t) && this.hideDropdown() : this._isTextElement ? document.activeElement !== this.input.element && this.input.focus() : (this.showDropdown(), this.containerOuter.focus()) : (this._store.highlightedActiveItems.length > 0 && this.unhighlightAll(), this.containerOuter.removeFocusState(), this.hideDropdown(!0))
537
}, e.prototype._onFocus = function (e) {
538
var t, i = this, n = e.target;
539
n && this.containerOuter.element.contains(n) && ((t = {})[d.TEXT_TYPE] = function () {
540
n === i.input.element && i.containerOuter.addFocusState()
541
}, t[d.SELECT_ONE_TYPE] = function () {
542
i.containerOuter.addFocusState(), n === i.input.element && i.showDropdown(!0)
543
}, t[d.SELECT_MULTIPLE_TYPE] = function () {
544
n === i.input.element && (i.showDropdown(!0), i.containerOuter.addFocusState())
545
}, t)[this.passedElement.element.type]()
546
}, e.prototype._onBlur = function (e) {
547
var t, i = this, n = e.target;
548
if (n && this.containerOuter.element.contains(n) && !this._isScrollingOnIe) {
549
var r = this._store.activeItems.some((function (e) {
552
((t = {})[d.TEXT_TYPE] = function () {
553
n === i.input.element && (i.containerOuter.removeFocusState(), r && i.unhighlightAll(), i.hideDropdown(!0))
554
}, t[d.SELECT_ONE_TYPE] = function () {
555
i.containerOuter.removeFocusState(), (n === i.input.element || n === i.containerOuter.element && !i._canSearch) && i.hideDropdown(!0)
556
}, t[d.SELECT_MULTIPLE_TYPE] = function () {
557
n === i.input.element && (i.containerOuter.removeFocusState(), i.hideDropdown(!0), r && i.unhighlightAll())
558
}, t)[this.passedElement.element.type]()
559
} else this._isScrollingOnIe = !1, this.input.element.focus()
560
}, e.prototype._onFormReset = function () {
561
this._store.dispatch((0, h.resetTo)(this._initialState))
562
}, e.prototype._highlightChoice = function (e) {
564
void 0 === e && (e = null);
565
var i = Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));
568
Array.from(this.dropdown.element.querySelectorAll(".".concat(this.config.classNames.highlightedState))).forEach((function (e) {
569
e.classList.remove(t.config.classNames.highlightedState), e.setAttribute("aria-selected", "false")
570
})), n ? this._highlightPosition = i.indexOf(n) : (n = i.length > this._highlightPosition ? i[this._highlightPosition] : i[i.length - 1]) || (n = i[0]), n.classList.add(this.config.classNames.highlightedState), n.setAttribute("aria-selected", "true"), this.passedElement.triggerEvent(d.EVENTS.highlightChoice, {el: n}), this.dropdown.isActive && (this.input.setActiveDescendant(n.id), this.containerOuter.setActiveDescendant(n.id))
572
}, e.prototype._addItem = function (e) {
573
var t = e.value, i = e.label, n = void 0 === i ? null : i, r = e.choiceId,
574
s = void 0 === r ? -1 : r, o = e.groupId, a = void 0 === o ? -1 : o, c = e.customProperties,
575
h = void 0 === c ? {} : c, u = e.placeholder, p = void 0 !== u && u, f = e.keyCode,
576
m = void 0 === f ? -1 : f, v = "string" == typeof t ? t.trim() : t, g = this._store.items,
577
_ = n || v, y = s || -1, E = a >= 0 ? this._store.getGroupById(a) : null,
578
b = g ? g.length + 1 : 1;
579
this.config.prependValue && (v = this.config.prependValue + v.toString()), this.config.appendValue && (v += this.config.appendValue.toString()), this._store.dispatch((0, l.addItem)({
588
})), this._isSelectOneElement && this.removeActiveItems(b), this.passedElement.triggerEvent(d.EVENTS.addItem, {
593
groupValue: E && E.value ? E.value : null,
596
}, e.prototype._removeItem = function (e) {
597
var t = e.id, i = e.value, n = e.label, r = e.customProperties, s = e.choiceId, o = e.groupId,
598
a = o && o >= 0 ? this._store.getGroupById(o) : null;
599
t && s && (this._store.dispatch((0, l.removeItem)(t, s)), this.passedElement.triggerEvent(d.EVENTS.removeItem, {
604
groupValue: a && a.value ? a.value : null
606
}, e.prototype._addChoice = function (e) {
607
var t = e.value, i = e.label, n = void 0 === i ? null : i, r = e.isSelected, s = void 0 !== r && r,
608
o = e.isDisabled, c = void 0 !== o && o, l = e.groupId, h = void 0 === l ? -1 : l,
609
u = e.customProperties, d = void 0 === u ? {} : u, p = e.placeholder, f = void 0 !== p && p,
610
m = e.keyCode, v = void 0 === m ? -1 : m;
612
var g = this._store.choices, _ = n || t, y = g ? g.length + 1 : 1,
613
E = "".concat(this._baseId, "-").concat(this._idNames.itemChoice, "-").concat(y);
614
this._store.dispatch((0, a.addChoice)({
624
})), s && this._addItem({
633
}, e.prototype._addGroup = function (e) {
634
var t = this, i = e.group, n = e.id, r = e.valueKey, s = void 0 === r ? "value" : r, o = e.labelKey,
635
a = void 0 === o ? "label" : o,
636
l = (0, f.isType)("Object", i) ? i.choices : Array.from(i.getElementsByTagName("OPTION")),
637
h = n || Math.floor((new Date).valueOf() * Math.random()), u = !!i.disabled && i.disabled;
638
l ? (this._store.dispatch((0, c.addGroup)({
643
})), l.forEach((function (e) {
644
var i = e.disabled || e.parentNode && e.parentNode.disabled;
647
label: (0, f.isType)("Object", e) ? e[a] : e.innerHTML,
648
isSelected: e.selected,
651
customProperties: e.customProperties,
652
placeholder: e.placeholder
654
}))) : this._store.dispatch((0, c.addGroup)({
660
}, e.prototype._getTemplate = function (e) {
661
for (var t, i = [], r = 1; r < arguments.length; r++) i[r - 1] = arguments[r];
662
return (t = this._templates[e]).call.apply(t, n([this, this.config], i, !1))
663
}, e.prototype._createTemplates = function () {
664
var e = this.config.callbackOnCreateTemplates, t = {};
665
e && "function" == typeof e && (t = e.call(this, f.strToEl)), this._templates = (0, s.default)(g.default, t)
666
}, e.prototype._createElements = function () {
667
this.containerOuter = new u.Container({
668
element: this._getTemplate("containerOuter", this._direction, this._isSelectElement, this._isSelectOneElement, this.config.searchEnabled, this.passedElement.element.type, this.config.labelId),
669
classNames: this.config.classNames,
670
type: this.passedElement.element.type,
671
position: this.config.position
672
}), this.containerInner = new u.Container({
673
element: this._getTemplate("containerInner"),
674
classNames: this.config.classNames,
675
type: this.passedElement.element.type,
676
position: this.config.position
677
}), this.input = new u.Input({
678
element: this._getTemplate("input", this._placeholderValue),
679
classNames: this.config.classNames,
680
type: this.passedElement.element.type,
681
preventPaste: !this.config.paste
682
}), this.choiceList = new u.List({element: this._getTemplate("choiceList", this._isSelectOneElement)}), this.itemList = new u.List({element: this._getTemplate("itemList", this._isSelectOneElement)}), this.dropdown = new u.Dropdown({
683
element: this._getTemplate("dropdown"),
684
classNames: this.config.classNames,
685
type: this.passedElement.element.type
687
}, e.prototype._createStructure = function () {
688
this.passedElement.conceal(), this.containerInner.wrap(this.passedElement.element), this.containerOuter.wrap(this.containerInner.element), this._isSelectOneElement ? this.input.placeholder = this.config.searchPlaceholderValue || "" : this._placeholderValue && (this.input.placeholder = this._placeholderValue, this.input.setWidth()), this.containerOuter.element.appendChild(this.containerInner.element), this.containerOuter.element.appendChild(this.dropdown.element), this.containerInner.element.appendChild(this.itemList.element), this._isTextElement || this.dropdown.element.appendChild(this.choiceList.element), this._isSelectOneElement ? this.config.searchEnabled && this.dropdown.element.insertBefore(this.input.element, this.dropdown.element.firstChild) : this.containerInner.element.appendChild(this.input.element), this._isSelectElement && (this._highlightPosition = 0, this._isSearching = !1, this._startLoading(), this._presetGroups.length ? this._addPredefinedGroups(this._presetGroups) : this._addPredefinedChoices(this._presetChoices), this._stopLoading()), this._isTextElement && this._addPredefinedItems(this._presetItems)
689
}, e.prototype._addPredefinedGroups = function (e) {
690
var t = this, i = this.passedElement.placeholderOption;
691
i && i.parentNode && "SELECT" === i.parentNode.tagName && this._addChoice({
694
isSelected: i.selected,
695
isDisabled: i.disabled,
697
}), e.forEach((function (e) {
698
return t._addGroup({group: e, id: e.id || null})
700
}, e.prototype._addPredefinedChoices = function (e) {
702
this.config.shouldSort && e.sort(this.config.sorter);
703
var i = e.some((function (e) {
705
})), n = e.findIndex((function (e) {
706
return void 0 === e.disabled || !e.disabled
708
e.forEach((function (e, r) {
709
var s = e.value, o = void 0 === s ? "" : s, a = e.label, c = e.customProperties,
711
if (t._isSelectElement) if (e.choices) t._addGroup({group: e, id: e.id || null}); else {
712
var h = !(!t._isSelectOneElement || i || r !== n) || e.selected, u = e.disabled;
721
} else t._addChoice({
724
isSelected: !!e.selected,
725
isDisabled: !!e.disabled,
726
placeholder: !!e.placeholder,
730
}, e.prototype._addPredefinedItems = function (e) {
732
e.forEach((function (e) {
733
"object" == typeof e && e.value && t._addItem({
737
customProperties: e.customProperties,
738
placeholder: e.placeholder
739
}), "string" == typeof e && t._addItem({value: e})
741
}, e.prototype._setChoiceOrItem = function (e) {
744
object: function () {
745
e.value && (t._isTextElement ? t._addItem({
749
customProperties: e.customProperties,
750
placeholder: e.placeholder
756
customProperties: e.customProperties,
757
placeholder: e.placeholder
759
}, string: function () {
760
t._isTextElement ? t._addItem({value: e}) : t._addChoice({
767
})[(0, f.getType)(e).toLowerCase()]()
768
}, e.prototype._findAndSelectChoiceByValue = function (e) {
769
var t = this, i = this._store.choices.find((function (i) {
770
return t.config.valueComparer(i.value, e)
772
i && !i.selected && this._addItem({
777
customProperties: i.customProperties,
778
placeholder: i.placeholder,
781
}, e.prototype._generatePlaceholderValue = function () {
782
if (this._isSelectElement && this.passedElement.placeholderOption) {
783
var e = this.passedElement.placeholderOption;
784
return e ? e.text : null
786
var t = this.config, i = t.placeholder, n = t.placeholderValue,
787
r = this.passedElement.element.dataset;
790
if (r.placeholder) return r.placeholder
796
}, 613: function (e, t, i) {
797
Object.defineProperty(t, "__esModule", {value: !0});
798
var n = i(799), r = i(883), s = function () {
800
var t = e.element, i = e.type, n = e.classNames, r = e.position;
801
this.element = t, this.classNames = n, this.type = i, this.position = r, this.isOpen = !1, this.isFlipped = !1, this.isFocussed = !1, this.isDisabled = !1, this.isLoading = !1, this._onFocus = this._onFocus.bind(this), this._onBlur = this._onBlur.bind(this)
804
return e.prototype.addEventListeners = function () {
805
this.element.addEventListener("focus", this._onFocus), this.element.addEventListener("blur", this._onBlur)
806
}, e.prototype.removeEventListeners = function () {
807
this.element.removeEventListener("focus", this._onFocus), this.element.removeEventListener("blur", this._onBlur)
808
}, e.prototype.shouldFlip = function (e) {
809
if ("number" != typeof e) return !1;
811
return "auto" === this.position ? t = !window.matchMedia("(min-height: ".concat(e + 1, "px)")).matches : "top" === this.position && (t = !0), t
812
}, e.prototype.setActiveDescendant = function (e) {
813
this.element.setAttribute("aria-activedescendant", e)
814
}, e.prototype.removeActiveDescendant = function () {
815
this.element.removeAttribute("aria-activedescendant")
816
}, e.prototype.open = function (e) {
817
this.element.classList.add(this.classNames.openState), this.element.setAttribute("aria-expanded", "true"), this.isOpen = !0, this.shouldFlip(e) && (this.element.classList.add(this.classNames.flippedState), this.isFlipped = !0)
818
}, e.prototype.close = function () {
819
this.element.classList.remove(this.classNames.openState), this.element.setAttribute("aria-expanded", "false"), this.removeActiveDescendant(), this.isOpen = !1, this.isFlipped && (this.element.classList.remove(this.classNames.flippedState), this.isFlipped = !1)
820
}, e.prototype.focus = function () {
821
this.isFocussed || this.element.focus()
822
}, e.prototype.addFocusState = function () {
823
this.element.classList.add(this.classNames.focusState)
824
}, e.prototype.removeFocusState = function () {
825
this.element.classList.remove(this.classNames.focusState)
826
}, e.prototype.enable = function () {
827
this.element.classList.remove(this.classNames.disabledState), this.element.removeAttribute("aria-disabled"), this.type === r.SELECT_ONE_TYPE && this.element.setAttribute("tabindex", "0"), this.isDisabled = !1
828
}, e.prototype.disable = function () {
829
this.element.classList.add(this.classNames.disabledState), this.element.setAttribute("aria-disabled", "true"), this.type === r.SELECT_ONE_TYPE && this.element.setAttribute("tabindex", "-1"), this.isDisabled = !0
830
}, e.prototype.wrap = function (e) {
831
(0, n.wrap)(e, this.element)
832
}, e.prototype.unwrap = function (e) {
833
this.element.parentNode && (this.element.parentNode.insertBefore(e, this.element), this.element.parentNode.removeChild(this.element))
834
}, e.prototype.addLoadingState = function () {
835
this.element.classList.add(this.classNames.loadingState), this.element.setAttribute("aria-busy", "true"), this.isLoading = !0
836
}, e.prototype.removeLoadingState = function () {
837
this.element.classList.remove(this.classNames.loadingState), this.element.removeAttribute("aria-busy"), this.isLoading = !1
838
}, e.prototype._onFocus = function () {
840
}, e.prototype._onBlur = function () {
845
}, 217: function (e, t) {
846
Object.defineProperty(t, "__esModule", {value: !0});
847
var i = function () {
849
var t = e.element, i = e.type, n = e.classNames;
850
this.element = t, this.classNames = n, this.type = i, this.isActive = !1
853
return Object.defineProperty(e.prototype, "distanceFromTopWindow", {
855
return this.element.getBoundingClientRect().bottom
856
}, enumerable: !1, configurable: !0
857
}), e.prototype.getChild = function (e) {
858
return this.element.querySelector(e)
859
}, e.prototype.show = function () {
860
return this.element.classList.add(this.classNames.activeState), this.element.setAttribute("aria-expanded", "true"), this.isActive = !0, this
861
}, e.prototype.hide = function () {
862
return this.element.classList.remove(this.classNames.activeState), this.element.setAttribute("aria-expanded", "false"), this.isActive = !1, this
866
}, 520: function (e, t, i) {
867
var n = this && this.__importDefault || function (e) {
868
return e && e.__esModule ? e : {default: e}
870
Object.defineProperty(t, "__esModule", {value: !0}), t.WrappedSelect = t.WrappedInput = t.List = t.Input = t.Container = t.Dropdown = void 0;
872
t.Dropdown = r.default;
874
t.Container = s.default;
880
t.WrappedInput = c.default;
882
t.WrappedSelect = l.default
883
}, 11: function (e, t, i) {
884
Object.defineProperty(t, "__esModule", {value: !0});
885
var n = i(799), r = i(883), s = function () {
887
var t = e.element, i = e.type, n = e.classNames, r = e.preventPaste;
888
this.element = t, this.type = i, this.classNames = n, this.preventPaste = r, this.isFocussed = this.element.isEqualNode(document.activeElement), this.isDisabled = t.disabled, this._onPaste = this._onPaste.bind(this), this._onInput = this._onInput.bind(this), this._onFocus = this._onFocus.bind(this), this._onBlur = this._onBlur.bind(this)
891
return Object.defineProperty(e.prototype, "placeholder", {
893
this.element.placeholder = e
894
}, enumerable: !1, configurable: !0
895
}), Object.defineProperty(e.prototype, "value", {
897
return (0, n.sanitise)(this.element.value)
898
}, set: function (e) {
899
this.element.value = e
900
}, enumerable: !1, configurable: !0
901
}), Object.defineProperty(e.prototype, "rawValue", {
903
return this.element.value
904
}, enumerable: !1, configurable: !0
905
}), e.prototype.addEventListeners = function () {
906
this.element.addEventListener("paste", this._onPaste), this.element.addEventListener("input", this._onInput, {passive: !0}), this.element.addEventListener("focus", this._onFocus, {passive: !0}), this.element.addEventListener("blur", this._onBlur, {passive: !0})
907
}, e.prototype.removeEventListeners = function () {
908
this.element.removeEventListener("input", this._onInput), this.element.removeEventListener("paste", this._onPaste), this.element.removeEventListener("focus", this._onFocus), this.element.removeEventListener("blur", this._onBlur)
909
}, e.prototype.enable = function () {
910
this.element.removeAttribute("disabled"), this.isDisabled = !1
911
}, e.prototype.disable = function () {
912
this.element.setAttribute("disabled", ""), this.isDisabled = !0
913
}, e.prototype.focus = function () {
914
this.isFocussed || this.element.focus()
915
}, e.prototype.blur = function () {
916
this.isFocussed && this.element.blur()
917
}, e.prototype.clear = function (e) {
918
return void 0 === e && (e = !0), this.element.value && (this.element.value = ""), e && this.setWidth(), this
919
}, e.prototype.setWidth = function () {
920
var e = this.element, t = e.style, i = e.value, n = e.placeholder;
921
t.minWidth = "".concat(n.length + 1, "ch"), t.width = "".concat(i.length + 1, "ch")
922
}, e.prototype.setActiveDescendant = function (e) {
923
this.element.setAttribute("aria-activedescendant", e)
924
}, e.prototype.removeActiveDescendant = function () {
925
this.element.removeAttribute("aria-activedescendant")
926
}, e.prototype._onInput = function () {
927
this.type !== r.SELECT_ONE_TYPE && this.setWidth()
928
}, e.prototype._onPaste = function (e) {
929
this.preventPaste && e.preventDefault()
930
}, e.prototype._onFocus = function () {
932
}, e.prototype._onBlur = function () {
937
}, 624: function (e, t, i) {
938
Object.defineProperty(t, "__esModule", {value: !0});
939
var n = i(883), r = function () {
942
this.element = t, this.scrollPos = this.element.scrollTop, this.height = this.element.offsetHeight
945
return e.prototype.clear = function () {
946
this.element.innerHTML = ""
947
}, e.prototype.append = function (e) {
948
this.element.appendChild(e)
949
}, e.prototype.getChild = function (e) {
950
return this.element.querySelector(e)
951
}, e.prototype.hasChildren = function () {
952
return this.element.hasChildNodes()
953
}, e.prototype.scrollToTop = function () {
954
this.element.scrollTop = 0
955
}, e.prototype.scrollToChildElement = function (e, t) {
958
var n = this.element.offsetHeight, r = this.element.scrollTop + n, s = e.offsetHeight,
959
o = e.offsetTop + s, a = t > 0 ? this.element.scrollTop + o - r : e.offsetTop;
960
requestAnimationFrame((function () {
961
i._animateScroll(a, t)
964
}, e.prototype._scrollDown = function (e, t, i) {
965
var n = (i - e) / t, r = n > 1 ? n : 1;
966
this.element.scrollTop = e + r
967
}, e.prototype._scrollUp = function (e, t, i) {
968
var n = (e - i) / t, r = n > 1 ? n : 1;
969
this.element.scrollTop = e - r
970
}, e.prototype._animateScroll = function (e, t) {
971
var i = this, r = n.SCROLLING_SPEED, s = this.element.scrollTop, o = !1;
972
t > 0 ? (this._scrollDown(s, r, e), s < e && (o = !0)) : (this._scrollUp(s, r, e), s > e && (o = !0)), o && requestAnimationFrame((function () {
973
i._animateScroll(e, t)
978
}, 730: function (e, t, i) {
979
Object.defineProperty(t, "__esModule", {value: !0});
980
var n = i(799), r = function () {
982
var t = e.element, i = e.classNames;
983
if (this.element = t, this.classNames = i, !(t instanceof HTMLInputElement || t instanceof HTMLSelectElement)) throw new TypeError("Invalid element passed");
987
return Object.defineProperty(e.prototype, "isActive", {
989
return "active" === this.element.dataset.choice
990
}, enumerable: !1, configurable: !0
991
}), Object.defineProperty(e.prototype, "dir", {
993
return this.element.dir
994
}, enumerable: !1, configurable: !0
995
}), Object.defineProperty(e.prototype, "value", {
997
return this.element.value
998
}, set: function (e) {
999
this.element.value = e
1000
}, enumerable: !1, configurable: !0
1001
}), e.prototype.conceal = function () {
1002
this.element.classList.add(this.classNames.input), this.element.hidden = !0, this.element.tabIndex = -1;
1003
var e = this.element.getAttribute("style");
1004
e && this.element.setAttribute("data-choice-orig-style", e), this.element.setAttribute("data-choice", "active")
1005
}, e.prototype.reveal = function () {
1006
this.element.classList.remove(this.classNames.input), this.element.hidden = !1, this.element.removeAttribute("tabindex");
1007
var e = this.element.getAttribute("data-choice-orig-style");
1008
e ? (this.element.removeAttribute("data-choice-orig-style"), this.element.setAttribute("style", e)) : this.element.removeAttribute("style"), this.element.removeAttribute("data-choice"), this.element.value = this.element.value
1009
}, e.prototype.enable = function () {
1010
this.element.removeAttribute("disabled"), this.element.disabled = !1, this.isDisabled = !1
1011
}, e.prototype.disable = function () {
1012
this.element.setAttribute("disabled", ""), this.element.disabled = !0, this.isDisabled = !0
1013
}, e.prototype.triggerEvent = function (e, t) {
1014
(0, n.dispatchEvent)(this.element, e, t)
1018
}, 541: function (e, t, i) {
1019
var n, r = this && this.__extends || (n = function (e, t) {
1020
return n = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (e, t) {
1022
} || function (e, t) {
1023
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i])
1025
}, function (e, t) {
1026
if ("function" != typeof t && null !== t) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
1029
this.constructor = e
1032
n(e, t), e.prototype = null === t ? Object.create(t) : (i.prototype = t.prototype, new i)
1033
}), s = this && this.__importDefault || function (e) {
1034
return e && e.__esModule ? e : {default: e}
1036
Object.defineProperty(t, "__esModule", {value: !0});
1037
var o = function (e) {
1039
var i = t.element, n = t.classNames, r = t.delimiter,
1040
s = e.call(this, {element: i, classNames: n}) || this;
1041
return s.delimiter = r, s
1044
return r(t, e), Object.defineProperty(t.prototype, "value", {
1046
return this.element.value
1047
}, set: function (e) {
1048
this.element.setAttribute("value", e), this.element.value = e
1049
}, enumerable: !1, configurable: !0
1051
}(s(i(730)).default);
1053
}, 982: function (e, t, i) {
1054
var n, r = this && this.__extends || (n = function (e, t) {
1055
return n = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (e, t) {
1057
} || function (e, t) {
1058
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i])
1060
}, function (e, t) {
1061
if ("function" != typeof t && null !== t) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
1064
this.constructor = e
1067
n(e, t), e.prototype = null === t ? Object.create(t) : (i.prototype = t.prototype, new i)
1068
}), s = this && this.__importDefault || function (e) {
1069
return e && e.__esModule ? e : {default: e}
1071
Object.defineProperty(t, "__esModule", {value: !0});
1072
var o = function (e) {
1074
var i = t.element, n = t.classNames, r = t.template,
1075
s = e.call(this, {element: i, classNames: n}) || this;
1076
return s.template = r, s
1079
return r(t, e), Object.defineProperty(t.prototype, "placeholderOption", {
1081
return this.element.querySelector('option[value=""]') || this.element.querySelector("option[placeholder]")
1082
}, enumerable: !1, configurable: !0
1083
}), Object.defineProperty(t.prototype, "optionGroups", {
1085
return Array.from(this.element.getElementsByTagName("OPTGROUP"))
1086
}, enumerable: !1, configurable: !0
1087
}), Object.defineProperty(t.prototype, "options", {
1089
return Array.from(this.element.options)
1090
}, set: function (e) {
1091
var t = this, i = document.createDocumentFragment();
1092
e.forEach((function (e) {
1093
return n = e, r = t.template(n), void i.appendChild(r);
1095
})), this.appendDocFragment(i)
1096
}, enumerable: !1, configurable: !0
1097
}), t.prototype.appendDocFragment = function (e) {
1098
this.element.innerHTML = "", this.element.appendChild(e)
1100
}(s(i(730)).default);
1102
}, 883: function (e, t) {
1103
Object.defineProperty(t, "__esModule", {value: !0}), t.SCROLLING_SPEED = t.SELECT_MULTIPLE_TYPE = t.SELECT_ONE_TYPE = t.TEXT_TYPE = t.KEY_CODES = t.ACTION_TYPES = t.EVENTS = void 0, t.EVENTS = {
1104
showDropdown: "showDropdown",
1105
hideDropdown: "hideDropdown",
1110
removeItem: "removeItem",
1111
highlightItem: "highlightItem",
1112
highlightChoice: "highlightChoice",
1113
unhighlightItem: "unhighlightItem"
1114
}, t.ACTION_TYPES = {
1115
ADD_CHOICE: "ADD_CHOICE",
1116
FILTER_CHOICES: "FILTER_CHOICES",
1117
ACTIVATE_CHOICES: "ACTIVATE_CHOICES",
1118
CLEAR_CHOICES: "CLEAR_CHOICES",
1119
ADD_GROUP: "ADD_GROUP",
1120
ADD_ITEM: "ADD_ITEM",
1121
REMOVE_ITEM: "REMOVE_ITEM",
1122
HIGHLIGHT_ITEM: "HIGHLIGHT_ITEM",
1123
CLEAR_ALL: "CLEAR_ALL",
1124
RESET_TO: "RESET_TO",
1125
SET_IS_LOADING: "SET_IS_LOADING"
1136
}, t.TEXT_TYPE = "text", t.SELECT_ONE_TYPE = "select-one", t.SELECT_MULTIPLE_TYPE = "select-multiple", t.SCROLLING_SPEED = 4
1137
}, 789: function (e, t, i) {
1138
Object.defineProperty(t, "__esModule", {value: !0}), t.DEFAULT_CONFIG = t.DEFAULT_CLASSNAMES = void 0;
1140
t.DEFAULT_CLASSNAMES = {
1141
containerOuter: "choices",
1142
containerInner: "choices__inner",
1143
input: "choices__input",
1144
inputCloned: "choices__input--cloned",
1145
list: "choices__list",
1146
listItems: "choices__list--multiple",
1147
listSingle: "choices__list--single",
1148
listDropdown: "choices__list--dropdown",
1149
item: "choices__item",
1150
itemSelectable: "choices__item--selectable",
1151
itemDisabled: "choices__item--disabled",
1152
itemChoice: "choices__item--choice",
1153
placeholder: "choices__placeholder",
1154
group: "choices__group",
1155
groupHeading: "choices__heading",
1156
button: "choices__button",
1157
activeState: "is-active",
1158
focusState: "is-focused",
1159
openState: "is-open",
1160
disabledState: "is-disabled",
1161
highlightedState: "is-highlighted",
1162
selectedState: "is-selected",
1163
flippedState: "is-flipped",
1164
loadingState: "is-loading",
1165
noResults: "has-no-results",
1166
noChoices: "has-no-choices"
1167
}, t.DEFAULT_CONFIG = {
1171
renderChoiceLimit: -1,
1174
addItemFilter: null,
1176
removeItemButton: !1,
1179
duplicateItemsAllowed: !0,
1185
searchResultLimit: 4,
1186
searchFields: ["label", "value"],
1188
resetScrollPosition: !0,
1190
shouldSortItems: !1,
1191
sorter: n.sortByAlpha,
1193
placeholderValue: null,
1194
searchPlaceholderValue: null,
1197
renderSelectedChoices: "auto",
1198
loadingText: "Loading...",
1199
noResultsText: "No results found",
1200
noChoicesText: "No choices to choose from",
1201
itemSelectText: "Press to select",
1202
uniqueItemText: "Only unique values can be added",
1203
customAddItemText: "Only values matching specific conditions can be added",
1204
addItemText: function (e) {
1205
return 'Press Enter to add <b>"'.concat((0, n.sanitise)(e), '"</b>')
1207
maxItemText: function (e) {
1208
return "Only ".concat(e, " values can be added")
1210
valueComparer: function (e, t) {
1213
fuseOptions: {includeScore: !0},
1215
callbackOnInit: null,
1216
callbackOnCreateTemplates: null,
1217
classNames: t.DEFAULT_CLASSNAMES
1219
}, 18: function (e, t) {
1220
Object.defineProperty(t, "__esModule", {value: !0})
1221
}, 978: function (e, t) {
1222
Object.defineProperty(t, "__esModule", {value: !0})
1223
}, 948: function (e, t) {
1224
Object.defineProperty(t, "__esModule", {value: !0})
1225
}, 359: function (e, t) {
1226
Object.defineProperty(t, "__esModule", {value: !0})
1227
}, 285: function (e, t) {
1228
Object.defineProperty(t, "__esModule", {value: !0})
1229
}, 533: function (e, t) {
1230
Object.defineProperty(t, "__esModule", {value: !0})
1231
}, 187: function (e, t, i) {
1232
var n = this && this.__createBinding || (Object.create ? function (e, t, i, n) {
1233
void 0 === n && (n = i);
1234
var r = Object.getOwnPropertyDescriptor(t, i);
1235
r && !("get" in r ? !t.__esModule : r.writable || r.configurable) || (r = {
1240
}), Object.defineProperty(e, n, r)
1241
} : function (e, t, i, n) {
1242
void 0 === n && (n = i), e[n] = t[i]
1243
}), r = this && this.__exportStar || function (e, t) {
1244
for (var i in e) "default" === i || Object.prototype.hasOwnProperty.call(t, i) || n(t, e, i)
1246
Object.defineProperty(t, "__esModule", {value: !0}), r(i(18), t), r(i(978), t), r(i(948), t), r(i(359), t), r(i(285), t), r(i(533), t), r(i(287), t), r(i(132), t), r(i(837), t), r(i(598), t), r(i(369), t), r(i(37), t), r(i(47), t), r(i(923), t), r(i(876), t)
1247
}, 287: function (e, t) {
1248
Object.defineProperty(t, "__esModule", {value: !0})
1249
}, 132: function (e, t) {
1250
Object.defineProperty(t, "__esModule", {value: !0})
1251
}, 837: function (e, t) {
1252
Object.defineProperty(t, "__esModule", {value: !0})
1253
}, 598: function (e, t) {
1254
Object.defineProperty(t, "__esModule", {value: !0})
1255
}, 37: function (e, t) {
1256
Object.defineProperty(t, "__esModule", {value: !0})
1257
}, 369: function (e, t) {
1258
Object.defineProperty(t, "__esModule", {value: !0})
1259
}, 47: function (e, t) {
1260
Object.defineProperty(t, "__esModule", {value: !0})
1261
}, 923: function (e, t) {
1262
Object.defineProperty(t, "__esModule", {value: !0})
1263
}, 876: function (e, t) {
1264
Object.defineProperty(t, "__esModule", {value: !0})
1265
}, 799: function (e, t) {
1267
Object.defineProperty(t, "__esModule", {value: !0}), t.parseCustomProperties = t.diff = t.cloneObject = t.existsInArray = t.dispatchEvent = t.sortByScore = t.sortByAlpha = t.strToEl = t.sanitise = t.isScrolledIntoView = t.getAdjacentEl = t.wrap = t.isType = t.getType = t.generateId = t.generateChars = t.getRandomNumber = void 0, t.getRandomNumber = function (e, t) {
1268
return Math.floor(Math.random() * (t - e) + e)
1269
}, t.generateChars = function (e) {
1270
return Array.from({length: e}, (function () {
1271
return (0, t.getRandomNumber)(0, 36).toString(36)
1273
}, t.generateId = function (e, i) {
1274
var n = e.id || e.name && "".concat(e.name, "-").concat((0, t.generateChars)(2)) || (0, t.generateChars)(4);
1275
return n = n.replace(/(:|\.|\[|\]|,)/g, ""), "".concat(i, "-").concat(n)
1276
}, t.getType = function (e) {
1277
return Object.prototype.toString.call(e).slice(8, -1)
1278
}, t.isType = function (e, i) {
1279
return null != i && (0, t.getType)(i) === e
1280
}, t.wrap = function (e, t) {
1281
return void 0 === t && (t = document.createElement("div")), e.parentNode && (e.nextSibling ? e.parentNode.insertBefore(t, e.nextSibling) : e.parentNode.appendChild(t)), t.appendChild(e)
1282
}, t.getAdjacentEl = function (e, t, i) {
1283
void 0 === i && (i = 1);
1284
for (var n = "".concat(i > 0 ? "next" : "previous", "ElementSibling"), r = e[n]; r;) {
1285
if (r.matches(t)) return r;
1289
}, t.isScrolledIntoView = function (e, t, i) {
1290
return void 0 === i && (i = 1), !!e && (i > 0 ? t.scrollTop + t.offsetHeight >= e.offsetTop + e.offsetHeight : e.offsetTop >= t.scrollTop)
1291
}, t.sanitise = function (e) {
1292
return "string" != typeof e ? e : e.replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<").replace(/"/g, """)
1293
}, t.strToEl = (i = document.createElement("div"), function (e) {
1296
for (var n = i.children[0]; i.firstChild;) i.removeChild(i.firstChild);
1298
}), t.sortByAlpha = function (e, t) {
1299
var i = e.value, n = e.label, r = void 0 === n ? i : n, s = t.value, o = t.label,
1300
a = void 0 === o ? s : o;
1301
return r.localeCompare(a, [], {sensitivity: "base", ignorePunctuation: !0, numeric: !0})
1302
}, t.sortByScore = function (e, t) {
1303
var i = e.score, n = void 0 === i ? 0 : i, r = t.score;
1304
return n - (void 0 === r ? 0 : r)
1305
}, t.dispatchEvent = function (e, t, i) {
1306
void 0 === i && (i = null);
1307
var n = new CustomEvent(t, {detail: i, bubbles: !0, cancelable: !0});
1308
return e.dispatchEvent(n)
1309
}, t.existsInArray = function (e, t, i) {
1310
return void 0 === i && (i = "value"), e.some((function (e) {
1311
return "string" == typeof t ? e[i] === t.trim() : e[i] === t
1313
}, t.cloneObject = function (e) {
1314
return JSON.parse(JSON.stringify(e))
1315
}, t.diff = function (e, t) {
1316
var i = Object.keys(e).sort(), n = Object.keys(t).sort();
1317
return i.filter((function (e) {
1318
return n.indexOf(e) < 0
1320
}, t.parseCustomProperties = function (e) {
1321
if (void 0 !== e) try {
1322
return JSON.parse(e)
1328
}, 273: function (e, t) {
1329
var i = this && this.__spreadArray || function (e, t, i) {
1330
if (i || 2 === arguments.length) for (var n, r = 0, s = t.length; r < s; r++) !n && r in t || (n || (n = Array.prototype.slice.call(t, 0, r)), n[r] = t[r]);
1331
return e.concat(n || Array.prototype.slice.call(t))
1333
Object.defineProperty(t, "__esModule", {value: !0}), t.defaultState = void 0, t.defaultState = [], t.default = function (e, n) {
1334
switch (void 0 === e && (e = t.defaultState), void 0 === n && (n = {}), n.type) {
1338
elementId: r.elementId,
1341
label: r.label || r.value,
1342
disabled: r.disabled || !1,
1346
customProperties: r.customProperties,
1347
placeholder: r.placeholder || !1
1349
return i(i([], e, !0), [s], !1);
1352
return o.choiceId > -1 ? e.map((function (e) {
1354
return t.id === parseInt("".concat(o.choiceId), 10) && (t.selected = !0), t
1358
return a.choiceId && a.choiceId > -1 ? e.map((function (e) {
1360
return t.id === parseInt("".concat(a.choiceId), 10) && (t.selected = !1), t
1362
case"FILTER_CHOICES":
1364
return e.map((function (e) {
1366
return t.active = c.results.some((function (e) {
1367
var i = e.item, n = e.score;
1368
return i.id === t.id && (t.score = n, !0)
1371
case"ACTIVATE_CHOICES":
1373
return e.map((function (e) {
1375
return t.active = l.active, t
1377
case"CLEAR_CHOICES":
1378
return t.defaultState;
1383
}, 871: function (e, t) {
1384
var i = this && this.__spreadArray || function (e, t, i) {
1385
if (i || 2 === arguments.length) for (var n, r = 0, s = t.length; r < s; r++) !n && r in t || (n || (n = Array.prototype.slice.call(t, 0, r)), n[r] = t[r]);
1386
return e.concat(n || Array.prototype.slice.call(t))
1388
Object.defineProperty(t, "__esModule", {value: !0}), t.defaultState = void 0, t.defaultState = [], t.default = function (e, n) {
1389
switch (void 0 === e && (e = t.defaultState), void 0 === n && (n = {}), n.type) {
1392
return i(i([], e, !0), [{
1396
disabled: r.disabled
1398
case"CLEAR_CHOICES":
1404
}, 655: function (e, t, i) {
1405
var n = this && this.__importDefault || function (e) {
1406
return e && e.__esModule ? e : {default: e}
1408
Object.defineProperty(t, "__esModule", {value: !0}), t.defaultState = void 0;
1409
var r = i(791), s = n(i(52)), o = n(i(871)), a = n(i(273)), c = n(i(502)), l = i(799);
1410
t.defaultState = {groups: [], items: [], choices: [], loading: !1};
1411
var h = (0, r.combineReducers)({
1417
t.default = function (e, i) {
1419
if ("CLEAR_ALL" === i.type) n = t.defaultState; else if ("RESET_TO" === i.type) return (0, l.cloneObject)(i.state);
1422
}, 52: function (e, t) {
1423
var i = this && this.__spreadArray || function (e, t, i) {
1424
if (i || 2 === arguments.length) for (var n, r = 0, s = t.length; r < s; r++) !n && r in t || (n || (n = Array.prototype.slice.call(t, 0, r)), n[r] = t[r]);
1425
return e.concat(n || Array.prototype.slice.call(t))
1427
Object.defineProperty(t, "__esModule", {value: !0}), t.defaultState = void 0, t.defaultState = [], t.default = function (e, n) {
1428
switch (void 0 === e && (e = t.defaultState), void 0 === n && (n = {}), n.type) {
1431
return i(i([], e, !0), [{
1433
choiceId: r.choiceId,
1439
customProperties: r.customProperties,
1440
placeholder: r.placeholder || !1,
1442
}], !1).map((function (e) {
1444
return t.highlighted = !1, t
1447
return e.map((function (e) {
1449
return t.id === n.id && (t.active = !1), t
1451
case"HIGHLIGHT_ITEM":
1453
return e.map((function (e) {
1455
return t.id === s.id && (t.highlighted = s.highlighted), t
1461
}, 502: function (e, t) {
1462
Object.defineProperty(t, "__esModule", {value: !0}), t.defaultState = void 0, t.defaultState = !1, t.default = function (e, i) {
1463
return void 0 === e && (e = t.defaultState), void 0 === i && (i = {}), "SET_IS_LOADING" === i.type ? i.isLoading : e
1465
}, 744: function (e, t, i) {
1466
var n = this && this.__spreadArray || function (e, t, i) {
1467
if (i || 2 === arguments.length) for (var n, r = 0, s = t.length; r < s; r++) !n && r in t || (n || (n = Array.prototype.slice.call(t, 0, r)), n[r] = t[r]);
1468
return e.concat(n || Array.prototype.slice.call(t))
1469
}, r = this && this.__importDefault || function (e) {
1470
return e && e.__esModule ? e : {default: e}
1472
Object.defineProperty(t, "__esModule", {value: !0});
1473
var s = i(791), o = r(i(655)), a = function () {
1475
this._store = (0, s.createStore)(o.default, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__())
1478
return e.prototype.subscribe = function (e) {
1479
this._store.subscribe(e)
1480
}, e.prototype.dispatch = function (e) {
1481
this._store.dispatch(e)
1482
}, Object.defineProperty(e.prototype, "state", {
1484
return this._store.getState()
1485
}, enumerable: !1, configurable: !0
1486
}), Object.defineProperty(e.prototype, "items", {
1488
return this.state.items
1489
}, enumerable: !1, configurable: !0
1490
}), Object.defineProperty(e.prototype, "activeItems", {
1492
return this.items.filter((function (e) {
1493
return !0 === e.active
1495
}, enumerable: !1, configurable: !0
1496
}), Object.defineProperty(e.prototype, "highlightedActiveItems", {
1498
return this.items.filter((function (e) {
1499
return e.active && e.highlighted
1501
}, enumerable: !1, configurable: !0
1502
}), Object.defineProperty(e.prototype, "choices", {
1504
return this.state.choices
1505
}, enumerable: !1, configurable: !0
1506
}), Object.defineProperty(e.prototype, "activeChoices", {
1508
return this.choices.filter((function (e) {
1509
return !0 === e.active
1511
}, enumerable: !1, configurable: !0
1512
}), Object.defineProperty(e.prototype, "selectableChoices", {
1514
return this.choices.filter((function (e) {
1515
return !0 !== e.disabled
1517
}, enumerable: !1, configurable: !0
1518
}), Object.defineProperty(e.prototype, "searchableChoices", {
1520
return this.selectableChoices.filter((function (e) {
1521
return !0 !== e.placeholder
1523
}, enumerable: !1, configurable: !0
1524
}), Object.defineProperty(e.prototype, "placeholderChoice", {
1526
return n([], this.choices, !0).reverse().find((function (e) {
1527
return !0 === e.placeholder
1529
}, enumerable: !1, configurable: !0
1530
}), Object.defineProperty(e.prototype, "groups", {
1532
return this.state.groups
1533
}, enumerable: !1, configurable: !0
1534
}), Object.defineProperty(e.prototype, "activeGroups", {
1536
var e = this.groups, t = this.choices;
1537
return e.filter((function (e) {
1538
var i = !0 === e.active && !1 === e.disabled, n = t.some((function (e) {
1539
return !0 === e.active && !1 === e.disabled
1543
}, enumerable: !1, configurable: !0
1544
}), e.prototype.isLoading = function () {
1545
return this.state.loading
1546
}, e.prototype.getChoiceById = function (e) {
1547
return this.activeChoices.find((function (t) {
1548
return t.id === parseInt(e, 10)
1550
}, e.prototype.getGroupById = function (e) {
1551
return this.groups.find((function (t) {
1557
}, 686: function (e, t) {
1558
Object.defineProperty(t, "__esModule", {value: !0});
1560
containerOuter: function (e, t, i, n, r, s, o) {
1561
var a = e.classNames.containerOuter,
1562
c = Object.assign(document.createElement("div"), {className: a});
1563
return c.dataset.type = s, t && (c.dir = t), n && (c.tabIndex = 0), i && (c.setAttribute("role", r ? "combobox" : "listbox"), r && c.setAttribute("aria-autocomplete", "list")), c.setAttribute("aria-haspopup", "true"), c.setAttribute("aria-expanded", "false"), o && c.setAttribute("aria-labelledby", o), c
1564
}, containerInner: function (e) {
1565
var t = e.classNames.containerInner;
1566
return Object.assign(document.createElement("div"), {className: t})
1567
}, itemList: function (e, t) {
1568
var i = e.classNames, n = i.list, r = i.listSingle, s = i.listItems;
1569
return Object.assign(document.createElement("div"), {className: "".concat(n, " ").concat(t ? r : s)})
1570
}, placeholder: function (e, t) {
1571
var i, n = e.allowHTML, r = e.classNames.placeholder;
1572
return Object.assign(document.createElement("div"), ((i = {className: r})[n ? "innerHTML" : "innerText"] = t, i))
1573
}, item: function (e, t, i) {
1574
var n, r, s = e.allowHTML, o = e.classNames, a = o.item, c = o.button, l = o.highlightedState,
1575
h = o.itemSelectable, u = o.placeholder, d = t.id, p = t.value, f = t.label,
1576
m = t.customProperties, v = t.active, g = t.disabled, _ = t.highlighted, y = t.placeholder,
1577
E = Object.assign(document.createElement("div"), ((n = {className: a})[s ? "innerHTML" : "innerText"] = f, n));
1578
if (Object.assign(E.dataset, {
1583
}), v && E.setAttribute("aria-selected", "true"), g && E.setAttribute("aria-disabled", "true"), y && E.classList.add(u), E.classList.add(_ ? l : h), i) {
1584
g && E.classList.remove(h), E.dataset.deletable = "";
1585
var b = "Remove item", S = Object.assign(document.createElement("button"), ((r = {
1588
})[s ? "innerHTML" : "innerText"] = b, r));
1589
S.setAttribute("aria-label", "".concat(b, ": '").concat(p, "'")), S.dataset.button = "", E.appendChild(S)
1592
}, choiceList: function (e, t) {
1593
var i = e.classNames.list, n = Object.assign(document.createElement("div"), {className: i});
1594
return t || n.setAttribute("aria-multiselectable", "true"), n.setAttribute("role", "listbox"), n
1595
}, choiceGroup: function (e, t) {
1596
var i, n = e.allowHTML, r = e.classNames, s = r.group, o = r.groupHeading, a = r.itemDisabled,
1597
c = t.id, l = t.value, h = t.disabled,
1598
u = Object.assign(document.createElement("div"), {className: "".concat(s, " ").concat(h ? a : "")});
1599
return u.setAttribute("role", "group"), Object.assign(u.dataset, {
1603
}), h && u.setAttribute("aria-disabled", "true"), u.appendChild(Object.assign(document.createElement("div"), ((i = {className: o})[n ? "innerHTML" : "innerText"] = l, i))), u
1604
}, choice: function (e, t, i) {
1605
var n, r = e.allowHTML, s = e.classNames, o = s.item, a = s.itemChoice, c = s.itemSelectable,
1606
l = s.selectedState, h = s.itemDisabled, u = s.placeholder, d = t.id, p = t.value, f = t.label,
1607
m = t.groupId, v = t.elementId, g = t.disabled, _ = t.selected, y = t.placeholder,
1608
E = Object.assign(document.createElement("div"), ((n = {id: v})[r ? "innerHTML" : "innerText"] = f, n.className = "".concat(o, " ").concat(a), n));
1609
return _ && E.classList.add(l), y && E.classList.add(u), E.setAttribute("role", m && m > 0 ? "treeitem" : "option"), Object.assign(E.dataset, {
1614
}), g ? (E.classList.add(h), E.dataset.choiceDisabled = "", E.setAttribute("aria-disabled", "true")) : (E.classList.add(c), E.dataset.choiceSelectable = ""), E
1615
}, input: function (e, t) {
1616
var i = e.classNames, n = i.input, r = i.inputCloned,
1617
s = Object.assign(document.createElement("input"), {
1619
name: "search_terms",
1620
className: "".concat(n, " ").concat(r),
1621
autocomplete: "off",
1622
autocapitalize: "off",
1625
return s.setAttribute("role", "textbox"), s.setAttribute("aria-autocomplete", "list"), s.setAttribute("aria-label", t), s
1626
}, dropdown: function (e) {
1627
var t = e.classNames, i = t.list, n = t.listDropdown, r = document.createElement("div");
1628
return r.classList.add(i, n), r.setAttribute("aria-expanded", "false"), r
1629
}, notice: function (e, t, i) {
1630
var n, r = e.allowHTML, s = e.classNames, o = s.item, a = s.itemChoice, c = s.noResults,
1632
void 0 === i && (i = "");
1634
return "no-choices" === i ? h.push(l) : "no-results" === i && h.push(c), Object.assign(document.createElement("div"), ((n = {})[r ? "innerHTML" : "innerText"] = t, n.className = h.join(" "), n))
1635
}, option: function (e) {
1636
var t = e.label, i = e.value, n = e.customProperties, r = e.active, s = e.disabled,
1637
o = new Option(t, i, !1, r);
1638
return n && (o.dataset.customProperties = "".concat(n)), o.disabled = !!s, o
1642
}, 996: function (e) {
1643
var t = function (e) {
1644
return function (e) {
1645
return !!e && "object" == typeof e
1646
}(e) && !function (e) {
1647
var t = Object.prototype.toString.call(e);
1648
return "[object RegExp]" === t || "[object Date]" === t || function (e) {
1649
return e.$$typeof === i
1652
}, i = "function" == typeof Symbol && Symbol.for ? Symbol.for("react.element") : 60103;
1655
return !1 !== t.clone && t.isMergeableObject(e) ? a((i = e, Array.isArray(i) ? [] : {}), e, t) : e;
1659
function r(e, t, i) {
1660
return e.concat(t).map((function (e) {
1666
return Object.keys(e).concat(function (e) {
1667
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter((function (t) {
1668
return e.propertyIsEnumerable(t)
1681
function a(e, i, c) {
1682
(c = c || {}).arrayMerge = c.arrayMerge || r, c.isMergeableObject = c.isMergeableObject || t, c.cloneUnlessOtherwiseSpecified = n;
1683
var l = Array.isArray(i);
1684
return l === Array.isArray(e) ? l ? c.arrayMerge(e, i, c) : function (e, t, i) {
1686
return i.isMergeableObject(e) && s(e).forEach((function (t) {
1688
})), s(t).forEach((function (s) {
1690
return o(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t))
1691
})(e, s) || (o(e, s) && i.isMergeableObject(t[s]) ? r[s] = function (e, t) {
1692
if (!t.customMerge) return a;
1693
var i = t.customMerge(e);
1694
return "function" == typeof i ? i : a
1695
}(s, i)(e[s], t[s], i) : r[s] = n(t[s], i))
1697
}(e, i, c) : n(i, c)
1700
a.all = function (e, t) {
1701
if (!Array.isArray(e)) throw new Error("first argument should be an array");
1702
return e.reduce((function (e, i) {
1708
}, 221: function (e, t, i) {
1710
return Array.isArray ? Array.isArray(e) : "[object Array]" === l(e)
1714
return "string" == typeof e
1718
return "number" == typeof e
1722
return "object" == typeof e
1730
return !e.trim().length
1734
return null == e ? void 0 === e ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e)
1738
default: function () {
1742
const h = Object.prototype.hasOwnProperty;
1746
this._keys = [], this._keyMap = {};
1750
t += i.weight, this._keys.push(i), this._keyMap[i.id] = i, t += i.weight
1751
})), this._keys.forEach((e => {
1757
return this._keyMap[e]
1765
return JSON.stringify(this._keys)
1770
let t = null, i = null, s = null, o = 1, a = null;
1771
if (r(e) || n(e)) s = e, t = p(e), i = f(e); else {
1772
if (!h.call(e, "name")) throw new Error("Missing name property in key");
1774
if (s = n, h.call(e, "weight") && (o = e.weight, o <= 0)) throw new Error((e => `Property 'weight' in key '${e}' must be a positive integer`)(n));
1775
t = p(n), i = f(n), a = e.getFn
1777
return {path: t, id: i, weight: o, src: s, getFn: a}
1781
return n(e) ? e : e.split(".")
1785
return n(e) ? e.join(".") : e
1789
isCaseSensitive: !1,
1793
sortFn: (e, t) => e.score === t.score ? e.idx < t.idx ? -1 : 1 : e.score < t.score ? -1 : 1,
1796
minMatchCharLength: 1,
1800
useExtendedSearch: !1,
1801
getFn: function (e, t) {
1803
const h = (e, t, u) => {
1804
if (a(e)) if (t[u]) {
1807
if (u === t.length - 1 && (r(d) || s(d) || function (e) {
1808
return !0 === e || !1 === e || function (e) {
1809
return o(e) && null !== e
1810
}(e) && "[object Boolean]" == l(e)
1811
}(d))) i.push(function (e) {
1812
return null == e ? "" : function (e) {
1813
if ("string" == typeof e) return e;
1815
return "0" == t && 1 / e == -1 / 0 ? "-0" : t
1817
}(d)); else if (n(d)) {
1819
for (let e = 0, i = d.length; e < i; e += 1) h(d[e], t, u + 1)
1820
} else t.length && h(d, t, u + 1)
1823
return h(e, r(t) ? t.split(".") : t, 0), c ? i : i[0]
1826
ignoreFieldNorm: !1,
1832
constructor({getFn: e = m.getFn, fieldNormWeight: t = m.fieldNormWeight} = {}) {
1833
this.norm = function (e = 1, t = 3) {
1834
const i = new Map, n = Math.pow(10, t);
1837
const r = t.match(v).length;
1838
if (i.has(r)) return i.get(r);
1839
const s = 1 / Math.pow(r, .5 * e), o = parseFloat(Math.round(s * n) / n);
1840
return i.set(r, o), o
1845
}(t, 3), this.getFn = e, this.isCreated = !1, this.setIndexRecords()
1848
setSources(e = []) {
1852
setIndexRecords(e = []) {
1857
this.keys = e, this._keysMap = {}, e.forEach(((e, t) => {
1858
this._keysMap[e.id] = t
1863
!this.isCreated && this.docs.length && (this.isCreated = !0, r(this.docs[0]) ? this.docs.forEach(((e, t) => {
1864
this._addString(e, t)
1865
})) : this.docs.forEach(((e, t) => {
1866
this._addObject(e, t)
1867
})), this.norm.clear())
1871
const t = this.size();
1872
r(e) ? this._addString(e, t) : this._addObject(e, t)
1876
this.records.splice(e, 1);
1877
for (let t = e, i = this.size(); t < i; t += 1) this.records[t].i -= 1
1880
getValueForItemAtKeyId(e, t) {
1881
return e[this._keysMap[t]]
1885
return this.records.length
1889
if (!a(e) || c(e)) return;
1890
let i = {v: e, i: t, n: this.norm.get(e)};
1891
this.records.push(i)
1895
let i = {i: t, $: {}};
1896
this.keys.forEach(((t, s) => {
1897
let o = t.getFn ? t.getFn(e) : this.getFn(e, t.path);
1898
if (a(o)) if (n(o)) {
1900
const t = [{nestedArrIndex: -1, value: o}];
1902
const {nestedArrIndex: i, value: s} = t.pop();
1903
if (a(s)) if (r(s) && !c(s)) {
1904
let t = {v: s, i: i, n: this.norm.get(s)};
1906
} else n(s) && s.forEach(((e, i) => {
1907
t.push({nestedArrIndex: i, value: e})
1911
} else if (r(o) && !c(o)) {
1912
let e = {v: o, n: this.norm.get(o)};
1915
})), this.records.push(i)
1919
return {keys: this.keys, records: this.records}
1923
function _(e, t, {getFn: i = m.getFn, fieldNormWeight: n = m.fieldNormWeight} = {}) {
1924
const r = new g({getFn: i, fieldNormWeight: n});
1925
return r.setKeys(e.map(d)), r.setSources(t), r.create(), r
1930
currentLocation: i = 0,
1931
expectedLocation: n = 0,
1932
distance: r = m.distance,
1933
ignoreLocation: s = m.ignoreLocation
1935
const o = t / e.length;
1937
const a = Math.abs(n - i);
1938
return r ? o + a / r : a ? 1 : o
1945
for (let i = 0, n = e.length; i < n; i += 1) {
1946
const r = e.charAt(i);
1947
t[r] = (t[r] || 0) | 1 << n - i - 1
1954
location: t = m.location,
1955
threshold: i = m.threshold,
1956
distance: n = m.distance,
1957
includeMatches: r = m.includeMatches,
1958
findAllMatches: s = m.findAllMatches,
1959
minMatchCharLength: o = m.minMatchCharLength,
1960
isCaseSensitive: a = m.isCaseSensitive,
1961
ignoreLocation: c = m.ignoreLocation
1963
if (this.options = {
1969
minMatchCharLength: o,
1972
}, this.pattern = a ? e : e.toLowerCase(), this.chunks = [], !this.pattern.length) return;
1973
const l = (e, t) => {
1974
this.chunks.push({pattern: e, alphabet: b(e), startIndex: t})
1975
}, h = this.pattern.length;
1978
const t = h % E, i = h - t;
1979
for (; e < i;) l(this.pattern.substr(e, E), e), e += E;
1982
l(this.pattern.substr(e), e)
1984
} else l(this.pattern, 0)
1988
const {isCaseSensitive: t, includeMatches: i} = this.options;
1989
if (t || (e = e.toLowerCase()), this.pattern === e) {
1990
let t = {isMatch: !0, score: 0};
1991
return i && (t.indices = [[0, e.length - 1]]), t
1998
minMatchCharLength: a,
2001
let l = [], h = 0, u = !1;
2002
this.chunks.forEach((({pattern: t, alphabet: d, startIndex: p}) => {
2003
const {isMatch: f, score: v, indices: g} = function (e, t, i, {
2004
location: n = m.location,
2005
distance: r = m.distance,
2006
threshold: s = m.threshold,
2007
findAllMatches: o = m.findAllMatches,
2008
minMatchCharLength: a = m.minMatchCharLength,
2009
includeMatches: c = m.includeMatches,
2010
ignoreLocation: l = m.ignoreLocation
2012
if (t.length > E) throw new Error("Pattern length exceeds max of 32.");
2013
const h = t.length, u = e.length, d = Math.max(0, Math.min(n, u));
2015
const v = a > 1 || c, g = v ? Array(u) : [];
2017
for (; (_ = e.indexOf(t, f)) > -1;) {
2018
let e = y(t, {currentLocation: _, expectedLocation: d, distance: r, ignoreLocation: l});
2019
if (p = Math.min(e, p), f = _ + h, v) {
2021
for (; e < h;) g[_ + e] = 1, e += 1
2025
let b = [], S = 1, O = h + u;
2026
const I = 1 << h - 1;
2027
for (let n = 0; n < h; n += 1) {
2029
for (; s < a;) y(t, {
2031
currentLocation: d + a,
2032
expectedLocation: d,
2035
}) <= p ? s = a : O = a, a = Math.floor((O - s) / 2 + s);
2037
let c = Math.max(1, d - a + 1), m = o ? u : Math.min(d + a, u) + h, _ = Array(m + 2);
2038
_[m + 1] = (1 << n) - 1;
2039
for (let s = m; s >= c; s -= 1) {
2040
let o = s - 1, a = i[e.charAt(o)];
2041
if (v && (g[o] = +!!a), _[s] = (_[s + 1] << 1 | 1) & a, n && (_[s] |= (b[s + 1] | b[s]) << 1 | 1 | b[s + 1]), _[s] & I && (S = y(t, {
2044
expectedLocation: d,
2048
if (p = S, f = o, f <= d) break;
2049
c = Math.max(1, 2 * d - f)
2055
expectedLocation: d,
2061
const C = {isMatch: f >= 0, score: Math.max(.001, S)};
2063
const e = function (e = [], t = m.minMatchCharLength) {
2064
let i = [], n = -1, r = -1, s = 0;
2065
for (let o = e.length; s < o; s += 1) {
2067
o && -1 === n ? n = s : o || -1 === n || (r = s - 1, r - n + 1 >= t && i.push([n, r]), n = -1)
2069
return e[s - 1] && s - n >= t && i.push([n, s - 1]), i
2071
e.length ? c && (C.indices = e) : C.isMatch = !1
2079
minMatchCharLength: a,
2083
f && (u = !0), h += v, f && g && (l = [...l, ...g])
2085
let d = {isMatch: u, score: u ? h / this.chunks.length : 1};
2086
return u && i && (d.indices = l), d
2095
static isMultiMatch(e) {
2096
return I(e, this.multiRegex)
2099
static isSingleMatch(e) {
2100
return I(e, this.singleRegex)
2108
const i = e.match(t);
2109
return i ? i[1] : null
2114
location: t = m.location,
2115
threshold: i = m.threshold,
2116
distance: n = m.distance,
2117
includeMatches: r = m.includeMatches,
2118
findAllMatches: s = m.findAllMatches,
2119
minMatchCharLength: o = m.minMatchCharLength,
2120
isCaseSensitive: a = m.isCaseSensitive,
2121
ignoreLocation: c = m.ignoreLocation
2123
super(e), this._bitapSearch = new S(e, {
2129
minMatchCharLength: o,
2139
static get multiRegex() {
2143
static get singleRegex() {
2148
return this._bitapSearch.searchIn(e)
2161
static get multiRegex() {
2165
static get singleRegex() {
2171
const n = [], r = this.pattern.length;
2172
for (; (t = e.indexOf(this.pattern, i)) > -1;) i = t + r, n.push([t, i - 1]);
2173
const s = !!n.length;
2174
return {isMatch: s, score: s ? 0 : 1, indices: n}
2178
const L = [class extends O {
2187
static get multiRegex() {
2191
static get singleRegex() {
2196
const t = e === this.pattern;
2197
return {isMatch: t, score: t ? 0 : 1, indices: [0, this.pattern.length - 1]}
2199
}, T, class extends O {
2205
return "prefix-exact"
2208
static get multiRegex() {
2212
static get singleRegex() {
2217
const t = e.startsWith(this.pattern);
2218
return {isMatch: t, score: t ? 0 : 1, indices: [0, this.pattern.length - 1]}
2220
}, class extends O {
2226
return "inverse-prefix-exact"
2229
static get multiRegex() {
2230
return /^!\^"(.*)"$/
2233
static get singleRegex() {
2238
const t = !e.startsWith(this.pattern);
2239
return {isMatch: t, score: t ? 0 : 1, indices: [0, e.length - 1]}
2241
}, class extends O {
2247
return "inverse-suffix-exact"
2250
static get multiRegex() {
2251
return /^!"(.*)"\$$/
2254
static get singleRegex() {
2259
const t = !e.endsWith(this.pattern);
2260
return {isMatch: t, score: t ? 0 : 1, indices: [0, e.length - 1]}
2262
}, class extends O {
2268
return "suffix-exact"
2271
static get multiRegex() {
2275
static get singleRegex() {
2280
const t = e.endsWith(this.pattern);
2281
return {isMatch: t, score: t ? 0 : 1, indices: [e.length - this.pattern.length, e.length - 1]}
2283
}, class extends O {
2289
return "inverse-exact"
2292
static get multiRegex() {
2296
static get singleRegex() {
2301
const t = -1 === e.indexOf(this.pattern);
2302
return {isMatch: t, score: t ? 0 : 1, indices: [0, e.length - 1]}
2304
}, C], w = L.length, A = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, M = new Set([C.type, T.type]);
2308
for (let i = 0, n = P.length; i < n; i += 1) {
2310
if (n.condition(e, t)) return new n(e, t)
2315
const N = "$and", D = e => !(!e.$and && !e.$or), j = e => ({[N]: Object.keys(e).map((t => ({[t]: e[t]})))});
2317
function F(e, t, {auto: i = !0} = {}) {
2319
let a = Object.keys(e);
2320
const c = (e => !!e.$path)(e);
2321
if (!c && a.length > 1 && !D(e)) return s(j(e));
2322
if ((e => !n(e) && o(e) && !D(e))(e)) {
2323
const n = c ? e.$path : a[0], s = c ? e.$val : e[n];
2324
if (!r(s)) throw new Error((e => `Invalid value for key ${e}`)(n));
2325
const o = {keyId: f(n), pattern: s};
2326
return i && (o.searcher = x(s, t)), o
2328
let l = {children: [], operator: a[0]};
2329
return a.forEach((t => {
2331
n(i) && i.forEach((e => {
2332
l.children.push(s(e))
2336
return D(e) || (e = j(e)), s(e)
2340
const i = e.matches;
2341
t.matches = [], a(i) && i.forEach((e => {
2342
if (!a(e.indices) || !e.indices.length) return;
2343
const {indices: i, value: n} = e;
2344
let r = {indices: i, value: n};
2345
e.key && (r.key = e.key.src), e.idx > -1 && (r.refIndex = e.idx), t.matches.push(r)
2354
constructor(e, t = {}, i) {
2355
this.options = {...m, ...t}, this.options.useExtendedSearch, this._keyStore = new u(this.options.keys), this.setCollection(e, i)
2358
setCollection(e, t) {
2359
if (this._docs = e, t && !(t instanceof g)) throw new Error("Incorrect 'index' type");
2360
this._myIndex = t || _(this.options.keys, this._docs, {
2361
getFn: this.options.getFn,
2362
fieldNormWeight: this.options.fieldNormWeight
2367
a(e) && (this._docs.push(e), this._myIndex.add(e))
2370
remove(e = (() => !1)) {
2372
for (let i = 0, n = this._docs.length; i < n; i += 1) {
2373
const r = this._docs[i];
2374
e(r, i) && (this.removeAt(i), i -= 1, n -= 1, t.push(r))
2380
this._docs.splice(e, 1), this._myIndex.removeAt(e)
2384
return this._myIndex
2387
search(e, {limit: t = -1} = {}) {
2395
let l = r(e) ? r(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e);
2396
return function (e, {ignoreFieldNorm: t = m.ignoreFieldNorm}) {
2399
e.matches.forEach((({key: e, norm: n, score: r}) => {
2400
const s = e ? e.weight : null;
2401
i *= Math.pow(0 === r && s ? Number.EPSILON : r, (s || 1) * (t ? 1 : n))
2404
}(l, {ignoreFieldNorm: c}), o && l.sort(a), s(t) && t > -1 && (l = l.slice(0, t)), function (e, t, {
2405
includeMatches: i = m.includeMatches,
2406
includeScore: n = m.includeScore
2409
return i && r.push(k), n && r.push(K), e.map((e => {
2410
const {idx: i} = e, n = {item: t[i], refIndex: i};
2411
return r.length && r.forEach((t => {
2415
}(l, this._docs, {includeMatches: i, includeScore: n})
2418
_searchStringList(e) {
2419
const t = x(e, this.options), {records: i} = this._myIndex, n = [];
2420
return i.forEach((({v: e, i: i, n: r}) => {
2422
const {isMatch: s, score: o, indices: c} = t.searchIn(e);
2423
s && n.push({item: e, idx: i, matches: [{score: o, value: e, norm: r, indices: c}]})
2428
const t = F(e, this.options), i = (e, t, n) => {
2430
const {keyId: i, searcher: r} = e, s = this._findMatches({
2431
key: this._keyStore.get(i),
2432
value: this._myIndex.getValueForItemAtKeyId(t, i),
2435
return s && s.length ? [{idx: n, item: t, matches: s}] : []
2438
for (let s = 0, o = e.children.length; s < o; s += 1) {
2439
const o = e.children[s], a = i(o, t, n);
2440
if (a.length) r.push(...a); else if (e.operator === N) return []
2443
}, n = this._myIndex.records, r = {}, s = [];
2444
return n.forEach((({$: e, i: n}) => {
2447
o.length && (r[n] || (r[n] = {
2451
}, s.push(r[n])), o.forEach((({matches: e}) => {
2452
r[n].matches.push(...e)
2458
_searchObjectList(e) {
2459
const t = x(e, this.options), {keys: i, records: n} = this._myIndex, r = [];
2460
return n.forEach((({$: e, i: n}) => {
2463
i.forEach(((i, n) => {
2464
s.push(...this._findMatches({key: i, value: e[n], searcher: t}))
2465
})), s.length && r.push({idx: n, item: e, matches: s})
2469
_findMatches({key: e, value: t, searcher: i}) {
2470
if (!a(t)) return [];
2472
if (n(t)) t.forEach((({v: t, i: n, n: s}) => {
2474
const {isMatch: o, score: c, indices: l} = i.searchIn(t);
2475
o && r.push({score: c, key: e, value: t, idx: n, norm: s, indices: l})
2477
const {v: n, n: s} = t, {isMatch: o, score: a, indices: c} = i.searchIn(n);
2478
o && r.push({score: a, key: e, value: n, norm: s, indices: c})
2484
R.version = "6.6.2", R.createIndex = _, R.parseIndex = function (e, {
2486
fieldNormWeight: i = m.fieldNormWeight
2488
const {keys: n, records: r} = e, s = new g({getFn: t, fieldNormWeight: i});
2489
return s.setKeys(n), s.setIndexRecords(r), s
2490
}, R.config = m, R.parseQuery = F, function (...e) {
2494
isCaseSensitive: t = m.isCaseSensitive,
2495
includeMatches: i = m.includeMatches,
2496
minMatchCharLength: n = m.minMatchCharLength,
2497
ignoreLocation: r = m.ignoreLocation,
2498
findAllMatches: s = m.findAllMatches,
2499
location: o = m.location,
2500
threshold: a = m.threshold,
2501
distance: c = m.distance
2503
this.query = null, this.options = {
2506
minMatchCharLength: n,
2512
}, this.pattern = t ? e : e.toLowerCase(), this.query = function (e, t = {}) {
2513
return e.split("|").map((e => {
2514
let i = e.trim().split(A).filter((e => e && !!e.trim())), n = [];
2515
for (let e = 0, r = i.length; e < r; e += 1) {
2518
for (; !s && ++o < w;) {
2520
let i = e.isMultiMatch(r);
2521
i && (n.push(new e(i, t)), s = !0)
2523
if (!s) for (o = -1; ++o < w;) {
2525
let i = e.isSingleMatch(r);
2527
n.push(new e(i, t));
2534
}(this.pattern, this.options)
2537
static condition(e, t) {
2538
return t.useExtendedSearch
2542
const t = this.query;
2543
if (!t) return {isMatch: !1, score: 1};
2544
const {includeMatches: i, isCaseSensitive: n} = this.options;
2545
e = n ? e : e.toLowerCase();
2546
let r = 0, s = [], o = 0;
2547
for (let n = 0, a = t.length; n < a; n += 1) {
2549
s.length = 0, r = 0;
2550
for (let t = 0, n = a.length; t < n; t += 1) {
2551
const n = a[t], {isMatch: c, indices: l, score: h} = n.search(e);
2553
o = 0, r = 0, s.length = 0;
2556
if (r += 1, o += h, i) {
2557
const e = n.constructor.type;
2558
M.has(e) ? s = [...s, ...l] : s.push(l)
2562
let e = {isMatch: !0, score: o / r};
2563
return i && (e.indices = s), e
2566
return {isMatch: !1, score: 1}
2569
}, 791: function (e, t, i) {
2571
return n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
2574
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
2578
function r(e, t, i) {
2579
return (t = function (e) {
2580
var t = function (e, t) {
2581
if ("object" !== n(e) || null === e) return e;
2582
var i = e[Symbol.toPrimitive];
2584
var r = i.call(e, t);
2585
if ("object" !== n(r)) return r;
2586
throw new TypeError("@@toPrimitive must return a primitive value.")
2590
return "symbol" === n(t) ? t : String(t)
2591
}(t)) in e ? Object.defineProperty(e, t, {
2600
var i = Object.keys(e);
2601
if (Object.getOwnPropertySymbols) {
2602
var n = Object.getOwnPropertySymbols(e);
2603
t && (n = n.filter((function (t) {
2604
return Object.getOwnPropertyDescriptor(e, t).enumerable
2605
}))), i.push.apply(i, n)
2611
for (var t = 1; t < arguments.length; t++) {
2612
var i = null != arguments[t] ? arguments[t] : {};
2613
t % 2 ? s(Object(i), !0).forEach((function (t) {
2615
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) : s(Object(i)).forEach((function (t) {
2616
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t))
2623
return "Minified Redux error #" + e + "; visit https://redux.js.org/Errors?code=" + e + " for the full message or use the non-minified dev environment for full errors. "
2627
__DO_NOT_USE__ActionTypes: function () {
2629
}, applyMiddleware: function () {
2631
}, bindActionCreators: function () {
2633
}, combineReducers: function () {
2635
}, compose: function () {
2637
}, createStore: function () {
2639
}, legacy_createStore: function () {
2643
var c = "function" == typeof Symbol && Symbol.observable || "@@observable", l = function () {
2644
return Math.random().toString(36).substring(7).split("").join(".")
2646
INIT: "@@redux/INIT" + l(), REPLACE: "@@redux/REPLACE" + l(), PROBE_UNKNOWN_ACTION: function () {
2647
return "@@redux/PROBE_UNKNOWN_ACTION" + l()
2652
if ("object" != typeof e || null === e) return !1;
2653
for (var t = e; null !== Object.getPrototypeOf(t);) t = Object.getPrototypeOf(t);
2654
return Object.getPrototypeOf(e) === t
2657
function d(e, t, i) {
2659
if ("function" == typeof t && "function" == typeof i || "function" == typeof i && "function" == typeof arguments[3]) throw new Error(a(0));
2660
if ("function" == typeof t && void 0 === i && (i = t, t = void 0), void 0 !== i) {
2661
if ("function" != typeof i) throw new Error(a(1));
2664
if ("function" != typeof e) throw new Error(a(2));
2665
var r = e, s = t, o = [], l = o, p = !1;
2668
l === o && (l = o.slice())
2672
if (p) throw new Error(a(3));
2677
if ("function" != typeof e) throw new Error(a(4));
2678
if (p) throw new Error(a(5));
2680
return f(), l.push(e), function () {
2682
if (p) throw new Error(a(6));
2684
var i = l.indexOf(e);
2685
l.splice(i, 1), o = null
2691
if (!u(e)) throw new Error(a(7));
2692
if (void 0 === e.type) throw new Error(a(8));
2693
if (p) throw new Error(a(9));
2699
for (var t = o = l, i = 0; i < t.length; i++) (0, t[i])();
2704
if ("function" != typeof e) throw new Error(a(10));
2705
r = e, g({type: h.REPLACE})
2711
subscribe: function (e) {
2712
if ("object" != typeof e || null === e) throw new Error(a(11));
2715
e.next && e.next(m())
2718
return i(), {unsubscribe: t(i)}
2720
})[c] = function () {
2725
return g({type: h.INIT}), (n = {dispatch: g, subscribe: v, getState: m, replaceReducer: _})[c] = y, n
2731
for (var t = Object.keys(e), i = {}, n = 0; n < t.length; n++) {
2733
"function" == typeof e[r] && (i[r] = e[r])
2735
var s, o = Object.keys(i);
2738
Object.keys(e).forEach((function (t) {
2740
if (void 0 === i(void 0, {type: h.INIT})) throw new Error(a(12));
2741
if (void 0 === i(void 0, {type: h.PROBE_UNKNOWN_ACTION()})) throw new Error(a(13))
2747
return function (e, t) {
2748
if (void 0 === e && (e = {}), s) throw s;
2749
for (var n = !1, r = {}, c = 0; c < o.length; c++) {
2750
var l = o[c], h = i[l], u = e[l], d = h(u, t);
2751
if (void 0 === d) throw t && t.type, new Error(a(14));
2752
r[l] = d, n = n || d !== u
2754
return (n = n || o.length !== Object.keys(e).length) ? r : e
2759
return function () {
2760
return t(e.apply(this, arguments))
2765
if ("function" == typeof e) return m(e, t);
2766
if ("object" != typeof e || null === e) throw new Error(a(16));
2770
"function" == typeof r && (i[n] = m(r, t))
2776
for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i];
2777
return 0 === t.length ? function (e) {
2779
} : 1 === t.length ? t[0] : t.reduce((function (e, t) {
2780
return function () {
2781
return e(t.apply(void 0, arguments))
2787
for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i];
2788
return function (e) {
2789
return function () {
2790
var i = e.apply(void 0, arguments), n = function () {
2791
throw new Error(a(15))
2793
getState: i.getState, dispatch: function () {
2794
return n.apply(void 0, arguments)
2796
}, s = t.map((function (e) {
2799
return n = g.apply(void 0, s)(i.dispatch), o(o({}, i), {}, {dispatch: n})
2808
if (void 0 !== r) return r.exports;
2809
var s = t[n] = {exports: {}};
2810
return e[n].call(s.exports, s, s.exports, i), s.exports
2813
i.n = function (e) {
2814
var t = e && e.__esModule ? function () {
2819
return i.d(t, {a: t}), t
2820
}, i.d = function (e, t) {
2821
for (var n in t) i.o(t, n) && !i.o(e, n) && Object.defineProperty(e, n, {enumerable: !0, get: t[n]})
2822
}, i.o = function (e, t) {
2823
return Object.prototype.hasOwnProperty.call(e, t)
2824
}, i.r = function (e) {
2825
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(e, "__esModule", {value: !0})
2828
n = i(373), r = i.n(n), i(187), i(883), i(789), i(686), s.default = r(), window.Choices = s.default