diff --git a/public/assets/scripts/choices.js b/public/assets/scripts/choices.js index 6690678b..63f8d939 100644 --- a/public/assets/scripts/choices.js +++ b/public/assets/scripts/choices.js @@ -227,7 +227,6 @@ var USER_DEFAULTS = {}; */ var Choices = /** @class */function () { function Choices(element, userConfig) { - var _a; if (element === void 0) { element = '[data-choice]'; } @@ -272,6 +271,7 @@ var Choices = /** @class */function () { this._isSelectOneElement = this._elementType === constants_1.SELECT_ONE_TYPE; this._isSelectMultipleElement = this._elementType === constants_1.SELECT_MULTIPLE_TYPE; this._isSelectElement = this._isSelectOneElement || this._isSelectMultipleElement; + this._canAddUserChoices = this._isTextElement && this.config.addItems || this._isSelectElement && this.config.addChoices; if (!['auto', 'always'].includes("".concat(this.config.renderSelectedChoices))) { this.config.renderSelectedChoices = 'auto'; } @@ -321,30 +321,6 @@ var Choices = /** @class */function () { this._idNames = { itemChoice: 'item-choice' }; - if (this._isTextElement) { - // Assign preset items from passed object first - this._presetItems = this.config.items.map(function (e) { - return (0, choice_input_1.mapInputToChoice)(e, false); - }); - // Add any values passed from attribute - var value = this.passedElement.value; - if (value) { - var elementItems = value.split(this.config.delimiter).map(function (e) { - return (0, choice_input_1.mapInputToChoice)(e, false); - }); - this._presetItems = this._presetItems.concat(elementItems); - } - } else if (this._isSelectElement) { - // Assign preset choices from passed object - this._presetChoices = this.config.choices.map(function (e) { - return (0, choice_input_1.mapInputToChoice)(e, true); - }); - // Create array of choices from option elements - var choicesFromOptions = this.passedElement.optionsAsChoices(); - if (choicesFromOptions) { - (_a = this._presetChoices).push.apply(_a, choicesFromOptions); - } - } this._render = this._render.bind(this); this._onFocus = this._onFocus.bind(this); this._onBlur = this._onBlur.bind(this); @@ -399,6 +375,7 @@ var Choices = /** @class */function () { if (this.initialised) { return; } + this._loadChoices(); this._createTemplates(); this._createElements(); this._createStructure(); @@ -424,6 +401,8 @@ var Choices = /** @class */function () { this.passedElement.reveal(); this.containerOuter.unwrap(this.passedElement.element); this.clearStore(); + this._isSearching = false; + this._currentValue = ''; this._templates = templates_1.default; this.initialised = false; }; @@ -1101,12 +1080,12 @@ var Choices = /** @class */function () { this._triggerChange(placeholderChoice.value); } }; - Choices.prototype._handleButtonAction = function (activeItems, element) { - if (!activeItems || !this.config.removeItems || !this.config.removeItemButton) { + Choices.prototype._handleButtonAction = function (items, element) { + if (items.length === 0 || !this.config.removeItems || !this.config.removeItemButton) { return; } var id = element && (0, utils_1.parseDataSetId)(element.parentNode); - var itemToRemove = id && activeItems.find(function (item) { + var itemToRemove = id && items.find(function (item) { return item.id === id; }); if (!itemToRemove) { @@ -1119,12 +1098,12 @@ var Choices = /** @class */function () { this._selectPlaceholderChoice(this._store.placeholderChoice); } }; - Choices.prototype._handleItemAction = function (activeItems, element, hasShiftKey) { + Choices.prototype._handleItemAction = function (items, element, hasShiftKey) { var _this = this; if (hasShiftKey === void 0) { hasShiftKey = false; } - if (!activeItems || !this.config.removeItems || this._isSelectOneElement) { + if (items.length === 0 || !this.config.removeItems || this._isSelectOneElement) { return; } var id = (0, utils_1.parseDataSetId)(element); @@ -1134,7 +1113,7 @@ var Choices = /** @class */function () { // We only want to select one item with a click // so we deselect any items that aren't the target // unless shift is being pressed - activeItems.forEach(function (item) { + items.forEach(function (item) { if (item.id === id && !item.highlighted) { _this.highlightItem(item); } else if (!hasShiftKey && item.highlighted) { @@ -1145,18 +1124,15 @@ var Choices = /** @class */function () { // highlighted item this.input.focus(); }; - Choices.prototype._handleChoiceAction = function (activeItems, element) { + Choices.prototype._handleChoiceAction = function (items, element) { var _this = this; - if (!activeItems) { - return; - } // If we are clicking on an option var id = (0, utils_1.parseDataSetId)(element); var choice = id && this._store.getChoiceById(id); if (!choice) { return; } - var passedKeyCode = activeItems[0] && activeItems[0].keyCode ? activeItems[0].keyCode : undefined; + var passedKeyCode = items.length !== 0 && items[0] && items[0].keyCode ? items[0].keyCode : undefined; var hasActiveDropdown = this.dropdown.isActive; // Update choice keyCode choice.keyCode = passedKeyCode; @@ -1166,11 +1142,11 @@ var Choices = /** @class */function () { var triggerChange = false; this._store.withDeferRendering(function () { if (!choice.selected && !choice.disabled) { - var canAddItem = _this._canAddItem(activeItems, choice.value); + var canAddItem = _this._canAddItem(items, choice.value); if (canAddItem.response) { if (_this.config.singleModeForMultiSelect) { - var lastItem = activeItems[activeItems.length - 1]; - if (lastItem) { + if (items.length !== 0) { + var lastItem = items[items.length - 1]; _this._removeItem(lastItem); } } @@ -1189,12 +1165,12 @@ var Choices = /** @class */function () { this.containerOuter.focus(); } }; - Choices.prototype._handleBackspace = function (activeItems) { - if (!this.config.removeItems || !activeItems) { + Choices.prototype._handleBackspace = function (items) { + if (!this.config.removeItems || items.length === 0) { return; } - var lastItem = activeItems[activeItems.length - 1]; - var hasHighlightedItems = activeItems.some(function (item) { + var lastItem = items[items.length - 1]; + var hasHighlightedItems = items.some(function (item) { return item.highlighted; }); // If editing the last item is allowed and there are not other selected items, @@ -1212,6 +1188,33 @@ var Choices = /** @class */function () { this.removeHighlightedItems(true); } }; + Choices.prototype._loadChoices = function () { + var _a; + if (this._isTextElement) { + // Assign preset items from passed object first + this._presetItems = this.config.items.map(function (e) { + return (0, choice_input_1.mapInputToChoice)(e, false); + }); + // Add any values passed from attribute + var value = this.passedElement.value; + if (value) { + var elementItems = value.split(this.config.delimiter).map(function (e) { + return (0, choice_input_1.mapInputToChoice)(e, false); + }); + this._presetItems = this._presetItems.concat(elementItems); + } + } else if (this._isSelectElement) { + // Assign preset choices from passed object + this._presetChoices = this.config.choices.map(function (e) { + return (0, choice_input_1.mapInputToChoice)(e, true); + }); + // Create array of choices from option elements + var choicesFromOptions = this.passedElement.optionsAsChoices(); + if (choicesFromOptions) { + (_a = this._presetChoices).push.apply(_a, choicesFromOptions); + } + } + }; // noinspection JSUnusedGlobalSymbols Choices.prototype._startLoading = function () { this._store.startDeferRendering(); @@ -1279,32 +1282,42 @@ var Choices = /** @class */function () { this._store.dispatch((0, choices_1.activateChoices)(true)); } }; - Choices.prototype._canAddChoice = function (activeItems, value) { - var canAddItem = this._canAddItem(activeItems, value); - canAddItem.response = this.config.addChoices && canAddItem.response; - return canAddItem; + Choices.prototype._canAddChoice = function (items, value) { + if (!this._canAddUserChoices) { + return { + response: false, + notice: '' + }; + } + return this._canAddItem(items, value); }; - Choices.prototype._canAddItem = function (activeItems, value) { + Choices.prototype._canAddItem = function (items, value) { + var _this = this; var canAddItem = true; - var notice = typeof this.config.addItemText === 'function' ? this.config.addItemText((0, utils_1.sanitise)(value), value) : this.config.addItemText; - if (!this._isSelectOneElement) { - var isDuplicateValue = (0, utils_1.existsInArray)(activeItems, value); - if (this.config.maxItemCount > 0 && this.config.maxItemCount <= activeItems.length) { - // If there is a max entry limit and we have reached that limit - // don't update - if (!this.config.singleModeForMultiSelect) { - canAddItem = false; - notice = typeof this.config.maxItemText === 'function' ? this.config.maxItemText(this.config.maxItemCount) : this.config.maxItemText; - } + var notice = ''; + if (this.config.maxItemCount > 0 && this.config.maxItemCount <= items.length) { + // If there is a max entry limit and we have reached that limit + // don't update + if (!this.config.singleModeForMultiSelect) { + canAddItem = false; + notice = typeof this.config.maxItemText === 'function' ? this.config.maxItemText(this.config.maxItemCount) : this.config.maxItemText; } - if (!this.config.duplicateItemsAllowed && isDuplicateValue && canAddItem) { + } + if (canAddItem && this._canAddUserChoices && value !== '' && typeof this.config.addItemFilter === 'function' && !this.config.addItemFilter(value)) { + canAddItem = false; + notice = typeof this.config.customAddItemText === 'function' ? this.config.customAddItemText((0, utils_1.sanitise)(value), value) : this.config.customAddItemText; + } + if (canAddItem && (this._isSelectElement || !this.config.duplicateItemsAllowed)) { + var foundChoice = this._store.items.find(function (choice) { + return _this.config.valueComparer(choice.value, value); + }); + if (foundChoice) { canAddItem = false; notice = typeof this.config.uniqueItemText === 'function' ? this.config.uniqueItemText((0, utils_1.sanitise)(value), value) : this.config.uniqueItemText; } - if (this._isTextElement && this.config.addItems && canAddItem && typeof this.config.addItemFilter === 'function' && !this.config.addItemFilter(value)) { - canAddItem = false; - notice = typeof this.config.customAddItemText === 'function' ? this.config.customAddItemText((0, utils_1.sanitise)(value), value) : this.config.customAddItemText; - } + } + if (canAddItem) { + notice = typeof this.config.addItemText === 'function' ? this.config.addItemText((0, utils_1.sanitise)(value), value) : this.config.addItemText; } return { response: canAddItem, @@ -1396,7 +1409,7 @@ var Choices = /** @class */function () { }; Choices.prototype._onKeyDown = function (event) { var keyCode = event.keyCode; - var activeItems = this._store.activeItems; + var items = this._store.items; var hasFocusedInput = this.input.isFocussed; var hasActiveDropdown = this.dropdown.isActive; var hasItems = this.itemList.hasChildren(); @@ -1439,7 +1452,7 @@ var Choices = /** @class */function () { case 65 /* KeyCodeMap.A_KEY */: return this._onSelectKey(event, hasItems); case 13 /* KeyCodeMap.ENTER_KEY */: - return this._onEnterKey(event, activeItems, hasActiveDropdown); + return this._onEnterKey(event, items, hasActiveDropdown); case 27 /* KeyCodeMap.ESC_KEY */: return this._onEscapeKey(event, hasActiveDropdown); case 38 /* KeyCodeMap.UP_KEY */: @@ -1449,7 +1462,7 @@ var Choices = /** @class */function () { return this._onDirectionKey(event, hasActiveDropdown); case 8 /* KeyCodeMap.DELETE_KEY */: case 46 /* KeyCodeMap.BACK_KEY */: - return this._onDeleteKey(event, activeItems, hasFocusedInput); + return this._onDeleteKey(event, items, hasFocusedInput); default: } }; @@ -1457,8 +1470,8 @@ var Choices = /** @class */function () { var target = _a.target, keyCode = _a.keyCode; var value = this.input.value; - var activeItems = this._store.activeItems; - var canAddItem = this._canAddItem(activeItems, value); + var items = this._store.items; + var canAddItem = this._canAddItem(items, value); // We are typing into a text input and have a value, we want to show a dropdown // notice. Otherwise hide the dropdown if (this._isTextElement) { @@ -1497,35 +1510,50 @@ var Choices = /** @class */function () { } } }; - Choices.prototype._onEnterKey = function (event, activeItems, hasActiveDropdown) { + Choices.prototype._onEnterKey = function (event, items, hasActiveDropdown) { + var _this = this; var target = event.target; var targetWasButton = target && target.hasAttribute('data-button'); var addedItem = false; if (target && target.value) { - var value = this.input.value; + var value_1 = this.input.value; var canAdd = void 0; if (this._isTextElement) { - canAdd = this._canAddItem(activeItems, value); + canAdd = this._canAddItem(items, value_1); } else { - canAdd = this._canAddChoice(activeItems, value); + canAdd = this._canAddChoice(items, value_1); } if (canAdd.response) { this.hideDropdown(true); - this._addChoice((0, choice_input_1.mapInputToChoice)({ - value: this.config.allowHtmlUserInput ? value : (0, utils_1.sanitise)(value), - label: { - escaped: (0, utils_1.sanitise)(value), - raw: value - }, - selected: true - }, false)); - this._triggerChange(value); - this.clearInput(); + this._store.withDeferRendering(function () { + if (_this._isSelectOneElement || _this.config.singleModeForMultiSelect) { + if (items.length !== 0) { + var lastItem = items[items.length - 1]; + _this._removeItem(lastItem); + } + } + var choiceNotFound = true; + if (_this._isSelectElement || !_this.config.duplicateItemsAllowed) { + choiceNotFound = !_this._findAndSelectChoiceByValue(value_1); + } + if (choiceNotFound) { + _this._addChoice((0, choice_input_1.mapInputToChoice)({ + value: _this.config.allowHtmlUserInput ? value_1 : (0, utils_1.sanitise)(value_1), + label: { + escaped: (0, utils_1.sanitise)(value_1), + raw: value_1 + }, + selected: true + }, false)); + } + _this.clearInput(); + }); + this._triggerChange(value_1); addedItem = true; } } if (targetWasButton) { - this._handleButtonAction(activeItems, target); + this._handleButtonAction(items, target); event.preventDefault(); } if (hasActiveDropdown) { @@ -1534,11 +1562,11 @@ var Choices = /** @class */function () { if (addedItem) { this.unhighlightAll(); } else { - if (activeItems[0]) { + if (items[0]) { // add enter keyCode value - activeItems[0].keyCode = 13 /* KeyCodeMap.ENTER_KEY */; // eslint-disable-line no-param-reassign + items[0].keyCode = 13 /* KeyCodeMap.ENTER_KEY */; // eslint-disable-line no-param-reassign } - this._handleChoiceAction(activeItems, highlightedChoice); + this._handleChoiceAction(items, highlightedChoice); } } event.preventDefault(); @@ -1592,11 +1620,11 @@ var Choices = /** @class */function () { event.preventDefault(); } }; - Choices.prototype._onDeleteKey = function (event, activeItems, hasFocusedInput) { + Choices.prototype._onDeleteKey = function (event, items, hasFocusedInput) { var target = event.target; // If backspace or delete key is pressed and the input has no value if (!this._isSelectOneElement && !target.value && hasFocusedInput) { - this._handleBackspace(activeItems); + this._handleBackspace(items); event.preventDefault(); } }; @@ -1643,12 +1671,14 @@ var Choices = /** @class */function () { var item = target.closest('[data-button],[data-item],[data-choice]'); if (item instanceof HTMLElement) { var hasShiftKey = event.shiftKey; - var activeItems = this._store.activeItems; + var _a = this._store, + activeItems = _a.activeItems, + items = _a.items; var dataset = item.dataset; if ('button' in dataset) { - this._handleButtonAction(activeItems, item); + this._handleButtonAction(items, item); } else if ('item' in dataset) { - this._handleItemAction(activeItems, item, hasShiftKey); + this._handleItemAction(items, item, hasShiftKey); } else if ('choice' in dataset) { this._handleChoiceAction(activeItems, item); } @@ -2047,7 +2077,9 @@ var Choices = /** @class */function () { }); if (foundChoice && !foundChoice.selected) { this._addItem(foundChoice); + return true; } + return false; }; Choices.prototype._generatePlaceholderValue = function () { var _a = this.config, @@ -3253,7 +3285,7 @@ exports.isHTMLOptgroup = isHTMLOptgroup; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseDataSetId = exports.parseCustomProperties = exports.getClassNamesSelector = exports.getClassNames = exports.diff = exports.isEmptyObject = exports.cloneObject = exports.existsInArray = exports.dispatchEvent = exports.sortByScore = exports.sortByAlpha = exports.unwrapStringForEscaped = exports.unwrapStringForRaw = exports.strToEl = exports.sanitise = exports.isScrolledIntoView = exports.getAdjacentEl = exports.wrap = exports.isType = exports.getType = exports.generateId = exports.generateChars = exports.getRandomNumber = void 0; +exports.parseDataSetId = exports.parseCustomProperties = exports.getClassNamesSelector = exports.getClassNames = exports.diff = exports.isEmptyObject = exports.cloneObject = exports.dispatchEvent = exports.sortByScore = exports.sortByAlpha = exports.unwrapStringForEscaped = exports.unwrapStringForRaw = exports.strToEl = exports.sanitise = exports.isScrolledIntoView = exports.getAdjacentEl = exports.wrap = exports.isType = exports.getType = exports.generateId = exports.generateChars = exports.getRandomNumber = void 0; var getRandomNumber = function (min, max) { return Math.floor(Math.random() * (max - min) + min); }; @@ -3428,18 +3460,6 @@ var dispatchEvent = function (element, type, customArgs) { return element.dispatchEvent(event); }; exports.dispatchEvent = dispatchEvent; -var existsInArray = function (array, value, key) { - if (key === void 0) { - key = 'value'; - } - return array.some(function (item) { - if (typeof value === 'string') { - return item[key] === value.trim(); - } - return item[key] === value; - }); -}; -exports.existsInArray = existsInArray; var cloneObject = function (obj) { return JSON.parse(JSON.stringify(obj)); }; diff --git a/public/assets/scripts/choices.min.js b/public/assets/scripts/choices.min.js index eec3657a..ba896d2e 100644 --- a/public/assets/scripts/choices.min.js +++ b/public/assets/scripts/choices.min.js @@ -1,2 +1,2 @@ /*! For license information please see choices.min.js.LICENSE.txt */ -(()=>{"use strict";var e={808:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clearChoices=t.activateChoices=t.filterChoices=t.removeChoice=t.addChoice=void 0,t.addChoice=function(e){return{type:"ADD_CHOICE",choice:e}},t.removeChoice=function(e){return{type:"REMOVE_CHOICE",value:e}},t.filterChoices=function(e){return{type:"FILTER_CHOICES",results:e}},t.activateChoices=function(e){return void 0===e&&(e=!0),{type:"ACTIVATE_CHOICES",active:e}},t.clearChoices=function(){return{type:"CLEAR_CHOICES"}}},18:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addGroup=void 0,t.addGroup=function(e){return{type:"ADD_GROUP",group:e}}},956:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.highlightItem=t.removeItem=t.addItem=void 0,t.addItem=function(e){return{type:"ADD_ITEM",item:e}},t.removeItem=function(e){return{type:"REMOVE_ITEM",item:e}},t.highlightItem=function(e,t){return{type:"HIGHLIGHT_ITEM",id:e,highlighted:t}}},278:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setIsLoading=t.clearAll=void 0,t.clearAll=function(){return{type:"CLEAR_ALL"}},t.setIsLoading=function(e){return{type:"SET_IS_LOADING",isLoading:e}}},472:function(e,t,i){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i element"),this)},e.prototype.removeChoice=function(e){return this._store.dispatch((0,h.removeChoice)(e)),this},e.prototype.clearChoices=function(){return this._store.dispatch((0,h.clearChoices)()),this},e.prototype.clearStore=function(){return this._store.dispatch((0,p.clearAll)()),this._lastAddedChoiceId=0,this._lastAddedGroupId=0,this},e.prototype.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._currentValue="",this._store.dispatch((0,h.activateChoices)(!0))),this},e.prototype._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var e=this._currentState.items!==this._prevState.items;(this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||e)&&(this._isSelectElement&&this._renderChoices(),e&&this._renderItems(),this._prevState=this._currentState)}},e.prototype._renderChoices=function(){var e=this,t=this._store,i=t.activeGroups,n=t.activeChoices,s=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame((function(){return e.choiceList.scrollToTop()})),i.length>=1&&!this._isSearching){var r=n.filter((function(e){return e.placeholder&&-1===e.groupId}));r.length>=1&&(s=this._createChoicesFragment(r,s)),s=this._createGroupsFragment(i,n,s)}else n.length>=1&&(s=this._createChoicesFragment(n,s));var o=this._store.activeItems;if(s.childNodes&&s.childNodes.length>0){var a=this._canAddItem(o,this.input.value);if(a.response)this.choiceList.append(s),this._highlightChoice();else{var c=this._templates.notice(this.config,a.notice);this.choiceList.append(c)}}else{var l=this._canAddChoice(o,this.input.value),h=void 0;l.response?h=this._templates.notice(this.config,l.notice):this._isSearching?(c="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,h=this._templates.notice(this.config,c,"no-results")):(c="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,h=this._templates.notice(this.config,c,"no-choices")),this.choiceList.append(h)}},e.prototype._renderItems=function(){var e=this._store.activeItems||[];this.itemList.clear();var t=this._createItemsFragment(e);t.childNodes&&this.itemList.append(t)},e.prototype._createGroupsFragment=function(e,t,i){var n=this;void 0===i&&(i=document.createDocumentFragment()),this.config.shouldSort&&e.sort(this.config.sorter);var s=t.filter((function(e){return 0===e.groupId}));return s.length>0&&this._createChoicesFragment(s,i,!1),e.forEach((function(e){var s=function(e){return t.filter((function(t){return n._isSelectOneElement?t.groupId===e.id:t.groupId===e.id&&("always"===n.config.renderSelectedChoices||!t.selected)}))}(e);if(s.length>=1){var r=n._templates.choiceGroup(n.config,e);i.appendChild(r),n._createChoicesFragment(s,i,!0)}})),i},e.prototype._createChoicesFragment=function(e,t,i){var n=this;void 0===t&&(t=document.createDocumentFragment()),void 0===i&&(i=!1);var s=this.config,r=s.renderSelectedChoices,o=s.searchResultLimit,c=s.renderChoiceLimit,l=s.appendGroupInSearch,h=this._isSearching?_.sortByScore:this.config.sorter,u=function(e){if("auto"!==r||n._isSelectOneElement||!e.selected){var i=n._templates.choice(n.config,e,n.config.itemSelectText);if(l){var s="";n._store.groups.every((function(t){return t.id!==e.groupId||(s=t.label,!1)})),s&&n._isSearching&&(i.innerHTML+=" (".concat(s,")"))}t.appendChild(i)}},d=e;if("auto"!==r||this._isSelectOneElement||(d=e.filter((function(e){return!e.selected}))),this._isSelectElement){var p=e.filter((function(e){return!e.element}));0!==p.length&&this.passedElement.addOptions(p)}var f=d.reduce((function(e,t){return t.placeholder?e.placeholderChoices.push(t):e.normalChoices.push(t),e}),{placeholderChoices:[],normalChoices:[]}),m=f.placeholderChoices,g=f.normalChoices;(this.config.shouldSort||this._isSearching)&&g.sort(h);var v=d.length,y=this._isSelectOneElement?a(a([],m,!0),g,!0):g;this._isSearching?v=o:c&&c>0&&!i&&(v=c);for(var b=0;b0?this._store.getGroupById(t.groupId):null;return{id:t.id,value:t.value,label:t.label,labelClass:t.labelClass,labelDescription:t.labelDescription,customProperties:t.customProperties,groupValue:i&&i.label?i.label:null,element:t.element,keyCode:t.keyCode}}},e.prototype._triggerChange=function(e){null!=e&&this.passedElement.triggerEvent("change",{value:e})},e.prototype._selectPlaceholderChoice=function(e){this._addItem(e),e.value&&this._triggerChange(e.value)},e.prototype._handleButtonAction=function(e,t){if(e&&this.config.removeItems&&this.config.removeItemButton){var i=t&&(0,_.parseDataSetId)(t.parentNode),n=i&&e.find((function(e){return e.id===i}));n&&(this._removeItem(n),this._triggerChange(n.value),this._isSelectOneElement&&this._store.placeholderChoice&&this._selectPlaceholderChoice(this._store.placeholderChoice))}},e.prototype._handleItemAction=function(e,t,i){var n=this;if(void 0===i&&(i=!1),e&&this.config.removeItems&&!this._isSelectOneElement){var s=(0,_.parseDataSetId)(t);s&&(e.forEach((function(e){e.id!==s||e.highlighted?!i&&e.highlighted&&n.unhighlightItem(e):n.highlightItem(e)})),this.input.focus())}},e.prototype._handleChoiceAction=function(e,t){var i=this;if(e){var n=(0,_.parseDataSetId)(t),s=n&&this._store.getChoiceById(n);if(s){var r=e[0]&&e[0].keyCode?e[0].keyCode:void 0,o=this.dropdown.isActive;s.keyCode=r,this.passedElement.triggerEvent("choice",{choice:s});var a=!1;this._store.withDeferRendering((function(){if(!s.selected&&!s.disabled&&i._canAddItem(e,s.value).response){if(i.config.singleModeForMultiSelect){var t=e[e.length-1];t&&i._removeItem(t)}i._addItem(s),a=!0}i.clearInput()})),a&&this._triggerChange(s.value),o&&(this.config.singleModeForMultiSelect||this._isSelectOneElement)&&(this.hideDropdown(!0),this.containerOuter.focus())}}},e.prototype._handleBackspace=function(e){if(this.config.removeItems&&e){var t=e[e.length-1],i=e.some((function(e){return e.highlighted}));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))}},e.prototype._startLoading=function(){this._store.startDeferRendering()},e.prototype._stopLoading=function(){this._store.stopDeferRendering()},e.prototype._handleLoadingState=function(e){void 0===e&&(e=!0);var t=this.itemList.getChild((0,_.getClassNamesSelector)(this.config.classNames.placeholder));e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t?t.innerHTML=this.config.loadingText:(t=this._templates.placeholder(this.config,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||"")},e.prototype._handleSearch=function(e){if(this.input.isFocussed){var t=this._store.choices,i=this.config,n=i.searchFloor,s=i.searchChoices,r=t.some((function(e){return!e.active}));if(null!=e&&e.length>=n){var o=s?this._searchChoices(e):0;null!==o&&this.passedElement.triggerEvent("search",{value:e,resultCount:o})}else r&&(this._isSearching=!1,this._store.dispatch((0,h.activateChoices)(!0)))}},e.prototype._canAddChoice=function(e,t){var i=this._canAddItem(e,t);return i.response=this.config.addChoices&&i.response,i},e.prototype._canAddItem=function(e,t){var i=!0,n="function"==typeof this.config.addItemText?this.config.addItemText((0,_.sanitise)(t),t):this.config.addItemText;if(!this._isSelectOneElement){var s=(0,_.existsInArray)(e,t);this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(this.config.singleModeForMultiSelect||(i=!1,n="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText)),!this.config.duplicateItemsAllowed&&s&&i&&(i=!1,n="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText((0,_.sanitise)(t),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((0,_.sanitise)(t),t):this.config.customAddItemText)}return{response:i,notice:{trusted:n}}},e.prototype._searchChoices=function(e){var t=e.trim().replace(/\s{2,}/," ");if(0===t.length||t===this._currentValue)return null;var i=this._store.searchableChoices,n=t,s=Object.assign(this.config.fuseOptions,{keys:a([],this.config.searchFields,!0),includeMatches:!0}),r=new l.default(i,s).search(n);return this._currentValue=t,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch((0,h.filterChoices)(r)),r.length},e.prototype._addEventListeners=function(){var e=this.config.shadowRoot||document.documentElement;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()},e.prototype._removeEventListeners=function(){var e=this.config.shadowRoot||document.documentElement;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()},e.prototype._onKeyDown=function(e){var t=e.keyCode,i=this._store.activeItems,n=this.input.isFocussed,s=this.dropdown.isActive,r=this.itemList.hasChildren(),o=1===e.key.length||2===e.key.length&&e.key.charCodeAt(0)>=55296||"Unidentified"===e.key;switch(this._isTextElement||s||(this.showDropdown(),!this.input.isFocussed&&o&&(this.input.value+=e.key)),t){case 65:return this._onSelectKey(e,r);case 13:return this._onEnterKey(e,i,s);case 27:return this._onEscapeKey(e,s);case 38:case 33:case 40:case 34:return this._onDirectionKey(e,s);case 8:case 46:return this._onDeleteKey(e,i,n)}},e.prototype._onKeyUp=function(e){var t=e.target,i=e.keyCode,n=this.input.value,s=this._store.activeItems,r=this._canAddItem(s,n);if(this._isTextElement)if(r.notice&&n){var o=this._templates.notice(this.config,r.notice);this.dropdown.element.innerHTML=o.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0);else{var a=(46===i||8===i)&&t&&!t.value,c=!this._isTextElement&&this._isSearching,l=this._canSearch&&r.response;a&&c?(this._isSearching=!1,this._store.dispatch((0,h.activateChoices)(!0))):l&&this._handleSearch(this.input.rawValue)}this._canSearch=this.config.searchEnabled},e.prototype._onSelectKey=function(e,t){var i=e.ctrlKey,n=e.metaKey;(i||n)&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e.prototype._onEnterKey=function(e,t,i){var n=e.target,s=n&&n.hasAttribute("data-button"),r=!1;if(n&&n.value){var o=this.input.value;(this._isTextElement?this._canAddItem(t,o):this._canAddChoice(t,o)).response&&(this.hideDropdown(!0),this._addChoice((0,C.mapInputToChoice)({value:this.config.allowHtmlUserInput?o:(0,_.sanitise)(o),label:{escaped:(0,_.sanitise)(o),raw:o},selected:!0},!1)),this._triggerChange(o),this.clearInput(),r=!0)}if(s&&(this._handleButtonAction(t,n),e.preventDefault()),i){var a=this.dropdown.getChild((0,_.getClassNamesSelector)(this.config.classNames.highlightedState));a&&(r?this.unhighlightAll():(t[0]&&(t[0].keyCode=13),this._handleChoiceAction(t,a))),e.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),e.preventDefault())},e.prototype._onEscapeKey=function(e,t){t&&(e.stopPropagation(),this.hideDropdown(!0),this.containerOuter.focus())},e.prototype._onDirectionKey=function(e,t){var i=e.keyCode,n=e.metaKey;if(t||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var s=40===i||34===i?1:-1,r="[data-choice-selectable]",o=void 0;if(n||34===i||33===i)o=s>0?this.dropdown.element.querySelector("".concat(r,":last-of-type")):this.dropdown.element.querySelector(r);else{var a=this.dropdown.element.querySelector((0,_.getClassNamesSelector)(this.config.classNames.highlightedState));o=a?(0,_.getAdjacentEl)(a,r,s):this.dropdown.element.querySelector(r)}o&&((0,_.isScrolledIntoView)(o,this.choiceList.element,s)||this.choiceList.scrollToChildElement(o,s),this._highlightChoice(o)),e.preventDefault()}},e.prototype._onDeleteKey=function(e,t,i){var n=e.target;this._isSelectOneElement||n.value||!i||(this._handleBackspace(t),e.preventDefault())},e.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target;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},e.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(S&&this.choiceList.element.contains(t)){var i=this.choiceList.element.firstElementChild,n="ltr"===this._direction?e.offsetX>=i.offsetWidth:e.offsetX0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},e.prototype._onFocus=function(e){var t,i=this,n=e.target;n&&this.containerOuter.element.contains(n)&&((t={})[m.TEXT_TYPE]=function(){n===i.input.element&&i.containerOuter.addFocusState()},t[m.SELECT_ONE_TYPE]=function(){i.containerOuter.addFocusState(),n===i.input.element&&i.showDropdown(!0)},t[m.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.showDropdown(!0),i.containerOuter.addFocusState())},t)[this._elementType]()},e.prototype._onBlur=function(e){var t,i=this,n=e.target;if(n&&this.containerOuter.element.contains(n)&&!this._isScrollingOnIe){var s=this._store.activeItems.some((function(e){return e.highlighted}));((t={})[m.TEXT_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),s&&i.unhighlightAll(),i.hideDropdown(!0))},t[m.SELECT_ONE_TYPE]=function(){i.containerOuter.removeFocusState(),(n===i.input.element||n===i.containerOuter.element&&!i._canSearch)&&i.hideDropdown(!0)},t[m.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),i.hideDropdown(!0),s&&i.unhighlightAll())},t)[this._elementType]()}else this._isScrollingOnIe=!1,this.input.element.focus()},e.prototype._onFormReset=function(){var e=this;this._store.withDeferRendering((function(){e.clearInput(),e.hideDropdown(),e.refresh(!1,!1,!0),0!==e._initialItems.length&&e.setChoiceByValue(e._initialItems)}))},e.prototype._highlightChoice=function(e){var t,i=this;void 0===e&&(e=null);var n=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(n.length){var s=e;Array.from(this.dropdown.element.querySelectorAll((0,_.getClassNamesSelector)(this.config.classNames.highlightedState))).forEach((function(e){var t;(t=e.classList).remove.apply(t,(0,_.getClassNames)(i.config.classNames.highlightedState)),e.setAttribute("aria-selected","false")})),s?this._highlightPosition=n.indexOf(s):(s=n.length>this._highlightPosition?n[this._highlightPosition]:n[n.length-1])||(s=n[0]),(t=s.classList).add.apply(t,(0,_.getClassNames)(this.config.classNames.highlightedState)),s.setAttribute("aria-selected","true"),this.passedElement.triggerEvent("highlightChoice",{el:s}),this.dropdown.isActive&&(this.input.setActiveDescendant(s.id),this.containerOuter.setActiveDescendant(s.id))}},e.prototype._addItem=function(e,t){void 0===t&&(t=!0);var i=e.id;if(0===i)throw new TypeError("item.id must be set before _addItem is called for a choice/item");this._store.dispatch((0,d.addItem)(e)),this._isSelectOneElement&&this.removeActiveItems(i),t&&this.passedElement.triggerEvent("addItem",this._getChoiceForEvent(e))},e.prototype._removeItem=function(e){e.id&&(this._store.dispatch((0,d.removeItem)(e)),this.passedElement.triggerEvent("removeItem",this._getChoiceForEvent(e)))},e.prototype._addChoice=function(e,t){if(void 0===t&&(t=!0),0!==e.id)throw new TypeError("Can not re-add a choice which has already been added");var i=e;this._lastAddedChoiceId++,i.id=this._lastAddedChoiceId,i.elementId="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(i.id),this.config.prependValue&&(i.value=this.config.prependValue+i.value),this.config.appendValue&&(i.value+=this.config.appendValue.toString()),(this.config.prependValue||this.config.appendValue)&&i.element&&(i.element.value=i.value),this._store.dispatch((0,h.addChoice)(e)),e.selected&&this._addItem(e,t)},e.prototype._addGroup=function(e,t){var i=this;if(void 0===t&&(t=!0),0!==e.id)throw new TypeError("Can not re-add a group which has already been added");if(this._store.dispatch((0,u.addGroup)(e)),e.choices){var n=e;this._lastAddedGroupId++,n.id=this._lastAddedGroupId;var s=e.id,r=e.choices;n.choices=[],r.forEach((function(n){var r=n;r.groupId=s,e.disabled&&(r.disabled=!0),i._addChoice(r,t)}))}},e.prototype._getTemplate=function(e){for(var t,i=[],n=1;n{Object.defineProperty(t,"__esModule",{value:!0});var n=i(705),s=i(493),r=function(){function e(e){var t=e.element,i=e.type,n=e.classNames,s=e.position;this.element=t,this.classNames=n,this.type=i,this.position=s,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)}return e.prototype.addEventListeners=function(){this.element.addEventListener("focus",this._onFocus),this.element.addEventListener("blur",this._onBlur)},e.prototype.removeEventListeners=function(){this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},e.prototype.shouldFlip=function(e){var t=!1;return"auto"===this.position?t=!window.matchMedia("(min-height: ".concat(e+1,"px)")).matches:"top"===this.position&&(t=!0),t},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype.open=function(e){var t,i;(t=this.element.classList).add.apply(t,(0,n.getClassNames)(this.classNames.openState)),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e)&&((i=this.element.classList).add.apply(i,(0,n.getClassNames)(this.classNames.flippedState)),this.isFlipped=!0)},e.prototype.close=function(){var e,t;(e=this.element.classList).remove.apply(e,(0,n.getClassNames)(this.classNames.openState)),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&((t=this.element.classList).remove.apply(t,(0,n.getClassNames)(this.classNames.flippedState)),this.isFlipped=!1)},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.addFocusState=function(){var e;(e=this.element.classList).add.apply(e,(0,n.getClassNames)(this.classNames.focusState))},e.prototype.removeFocusState=function(){var e;(e=this.element.classList).remove.apply(e,(0,n.getClassNames)(this.classNames.focusState))},e.prototype.enable=function(){var e;(e=this.element.classList).remove.apply(e,(0,n.getClassNames)(this.classNames.disabledState)),this.element.removeAttribute("aria-disabled"),this.type===s.SELECT_ONE_TYPE&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},e.prototype.disable=function(){var e;(e=this.element.classList).add.apply(e,(0,n.getClassNames)(this.classNames.disabledState)),this.element.setAttribute("aria-disabled","true"),this.type===s.SELECT_ONE_TYPE&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},e.prototype.wrap=function(e){(0,n.wrap)(e,this.element)},e.prototype.unwrap=function(e){this.element.parentNode&&(this.element.parentNode.insertBefore(e,this.element),this.element.parentNode.removeChild(this.element))},e.prototype.addLoadingState=function(){var e;(e=this.element.classList).add.apply(e,(0,n.getClassNames)(this.classNames.loadingState)),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},e.prototype.removeLoadingState=function(){var e;(e=this.element.classList).remove.apply(e,(0,n.getClassNames)(this.classNames.loadingState)),this.element.removeAttribute("aria-busy"),this.isLoading=!1},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}();t.default=r},836:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=i(705),s=function(){function e(e){var t=e.element,i=e.type,n=e.classNames;this.element=t,this.classNames=n,this.type=i,this.isActive=!1}return Object.defineProperty(e.prototype,"distanceFromTopWindow",{get:function(){return this.element.getBoundingClientRect().bottom},enumerable:!1,configurable:!0}),e.prototype.getChild=function(e){return this.element.querySelector(e)},e.prototype.show=function(){var e;return(e=this.element.classList).add.apply(e,(0,n.getClassNames)(this.classNames.activeState)),this.element.setAttribute("aria-expanded","true"),this.isActive=!0,this},e.prototype.hide=function(){var e;return(e=this.element.classList).remove.apply(e,(0,n.getClassNames)(this.classNames.activeState)),this.element.setAttribute("aria-expanded","false"),this.isActive=!1,this},e}();t.default=s},253:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WrappedSelect=t.WrappedInput=t.List=t.Input=t.Container=t.Dropdown=void 0;var s=n(i(836));t.Dropdown=s.default;var r=n(i(382));t.Container=r.default;var o=n(i(37));t.Input=o.default;var a=n(i(937));t.List=a.default;var c=n(i(733));t.WrappedInput=c.default;var l=n(i(129));t.WrappedSelect=l.default},37:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=i(493),s=function(){function e(e){var t=e.element,i=e.type,n=e.classNames,s=e.preventPaste;this.element=t,this.type=i,this.classNames=n,this.preventPaste=s,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)}return Object.defineProperty(e.prototype,"placeholder",{set:function(e){this.element.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rawValue",{get:function(){return this.element.value},enumerable:!1,configurable:!0}),e.prototype.addEventListeners=function(){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})},e.prototype.removeEventListeners=function(){this.element.removeEventListener("input",this._onInput),this.element.removeEventListener("paste",this._onPaste),this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.isDisabled=!0},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.blur=function(){this.isFocussed&&this.element.blur()},e.prototype.clear=function(e){return void 0===e&&(e=!0),this.element.value&&(this.element.value=""),e&&this.setWidth(),this},e.prototype.setWidth=function(){var e=this.element,t=e.style,i=e.value,n=e.placeholder;t.minWidth="".concat(n.length+1,"ch"),t.width="".concat(i.length+1,"ch")},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype._onInput=function(){this.type!==n.SELECT_ONE_TYPE&&this.setWidth()},e.prototype._onPaste=function(e){this.preventPaste&&e.preventDefault()},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}();t.default=s},937:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=i(493),s=function(){function e(e){var t=e.element;this.element=t,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}return e.prototype.clear=function(){this.element.innerHTML=""},e.prototype.append=function(e){this.element.appendChild(e)},e.prototype.getChild=function(e){return this.element.querySelector(e)},e.prototype.hasChildren=function(){return this.element.hasChildNodes()},e.prototype.scrollToTop=function(){this.element.scrollTop=0},e.prototype.scrollToChildElement=function(e,t){var i=this;if(e){var n=this.element.offsetHeight,s=this.element.scrollTop+n,r=e.offsetHeight,o=e.offsetTop+r,a=t>0?this.element.scrollTop+o-s:e.offsetTop;requestAnimationFrame((function(){i._animateScroll(a,t)}))}},e.prototype._scrollDown=function(e,t,i){var n=(i-e)/t,s=n>1?n:1;this.element.scrollTop=e+s},e.prototype._scrollUp=function(e,t,i){var n=(e-i)/t,s=n>1?n:1;this.element.scrollTop=e-s},e.prototype._animateScroll=function(e,t){var i=this,s=n.SCROLLING_SPEED,r=this.element.scrollTop,o=!1;t>0?(this._scrollDown(r,s,e),re&&(o=!0)),o&&requestAnimationFrame((function(){i._animateScroll(e,t)}))},e}();t.default=s},617:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=i(705),s=function(){function e(e){var t=e.element,i=e.classNames;this.element=t,this.classNames=i,this.isDisabled=!1}return Object.defineProperty(e.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.conceal=function(){var e;(e=this.element.classList).add.apply(e,(0,n.getClassNames)(this.classNames.input)),this.element.hidden=!0,this.element.tabIndex=-1;var t=this.element.getAttribute("style");t&&this.element.setAttribute("data-choice-orig-style",t),this.element.setAttribute("data-choice","active")},e.prototype.reveal=function(){var e;(e=this.element.classList).remove.apply(e,(0,n.getClassNames)(this.classNames.input)),this.element.hidden=!1,this.element.removeAttribute("tabindex");var t=this.element.getAttribute("data-choice-orig-style");t?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",t)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},e.prototype.triggerEvent=function(e,t){(0,n.dispatchEvent)(this.element,e,t)},e}();t.default=s},733:function(e,t,i){var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){var i=t.element,n=t.classNames,s=t.delimiter,r=e.call(this,{element:i,classNames:n})||this;return r.delimiter=s,r}return s(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),t}(r(i(617)).default);t.default=o},129:function(e,t,i){var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(705),a=r(i(617)),c=i(353),l=i(200),h=function(e){function t(t){var i=t.element,n=t.classNames,s=t.template,r=e.call(this,{element:i,classNames:n})||this;return r.template=s,r}return s(t,e),Object.defineProperty(t.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optionGroups",{get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return Array.from(this.element.options)},enumerable:!1,configurable:!0}),t.prototype.addOptions=function(e){var t=this;e.forEach((function(e){var i=e;if(!i.element){var n=t.template(i);t.element.appendChild(n),i.element=n}}))},t.prototype.optionsAsChoices=function(){var e=this,t=[];return this.element.querySelectorAll(":scope > option, :scope > optgroup").forEach((function(i){(0,c.isHTMLOption)(i)?t.push(e._optionToChoice(i)):(0,c.isHTMLOptgroup)(i)&&t.push(e._optgroupToChoice(i))})),t},t.prototype._optionToChoice=function(e){return{id:0,groupId:0,value:e.value,label:e.innerHTML,element:e,active:!0,selected:e.selected,disabled:e.disabled,highlighted:!1,placeholder:""===e.value||e.hasAttribute("placeholder"),labelClass:void 0!==e.dataset.labelClass?(0,l.stringToHtmlClass)(e.dataset.labelClass):void 0,labelDescription:void 0!==e.dataset.labelDescription?e.dataset.labelDescription:void 0,customProperties:(0,o.parseCustomProperties)(e.dataset.customProperties)}},t.prototype._optgroupToChoice=function(e){var t=this,i=e.querySelectorAll("option"),n=Array.from(i).map((function(e){return t._optionToChoice(e)}));return{id:0,label:e.label||"",element:e,active:0!==n.length,disabled:e.disabled,choices:n}},t}(a.default);t.default=h},493:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SCROLLING_SPEED=t.SELECT_MULTIPLE_TYPE=t.SELECT_ONE_TYPE=t.TEXT_TYPE=void 0,t.TEXT_TYPE="text",t.SELECT_ONE_TYPE="select-one",t.SELECT_MULTIPLE_TYPE="select-multiple",t.SCROLLING_SPEED=4},468:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CONFIG=t.DEFAULT_CLASSNAMES=void 0;var n=i(705);t.DEFAULT_CLASSNAMES={containerOuter:["choices"],containerInner:["choices__inner"],input:["choices__input"],inputCloned:["choices__input--cloned"],list:["choices__list"],listItems:["choices__list--multiple"],listSingle:["choices__list--single"],listDropdown:["choices__list--dropdown"],item:["choices__item"],itemSelectable:["choices__item--selectable"],itemDisabled:["choices__item--disabled"],itemChoice:["choices__item--choice"],description:["choices__description"],placeholder:["choices__placeholder"],group:["choices__group"],groupHeading:["choices__heading"],button:["choices__button"],activeState:["is-active"],focusState:["is-focused"],openState:["is-open"],disabledState:["is-disabled"],highlightedState:["is-highlighted"],selectedState:["is-selected"],flippedState:["is-flipped"],loadingState:["is-loading"],noResults:["has-no-results"],noChoices:["has-no-choices"]},t.DEFAULT_CONFIG={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,singleModeForMultiSelect:!1,addChoices:!1,addItems:!0,addItemFilter:function(e){return!!e&&""!==e},removeItems:!0,removeItemButton:!1,removeItemButtonAlignLeft:!1,editItems:!1,allowHTML:!1,allowHtmlUserInput:!1,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:n.sortByAlpha,shadowRoot:null,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add "'.concat(e,'"')},removeItemIconText:function(){return"Remove item"},removeItemLabelText:function(e){return"Remove item: ".concat(e)},maxItemText:function(e){return"Only ".concat(e," values can be added")},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:t.DEFAULT_CLASSNAMES,appendGroupInSearch:!1}},360:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},405:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},424:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},394:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},689:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),s(i(360),t),s(i(405),t),s(i(424),t),s(i(394),t),s(i(13),t),s(i(536),t),s(i(641),t),s(i(411),t),s(i(364),t),s(i(89),t),s(i(638),t),s(i(512),t),s(i(132),t)},13:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},536:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},641:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},411:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectsInConfig=void 0,t.ObjectsInConfig=["fuseOptions","classNames"]},89:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},364:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},638:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},512:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},132:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},200:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mapInputToChoice=t.stringToHtmlClass=void 0;var n=i(705),s=function(e,t){return void 0===t&&(t=!0),void 0===e?t:!!e};t.stringToHtmlClass=function(e){if("string"==typeof e&&(e=e.split(" ").filter((function(e){return 0!==e.length}))),Array.isArray(e)&&0!==e.length)return e},t.mapInputToChoice=function(e,i){if("string"==typeof e)return(0,t.mapInputToChoice)({value:e,label:e},!1);var r=e;if("choices"in r){if(!i)throw new TypeError("optGroup is not allowed");var o=r,a=o.choices.map((function(e){return(0,t.mapInputToChoice)(e,!1)}));return{id:0,label:(0,n.unwrapStringForRaw)(o.label)||o.value,active:0!==a.length,disabled:!!o.disabled,choices:a}}var c=r;return{id:0,groupId:0,value:c.value,label:c.label||c.value,active:s(c.active),selected:s(c.selected,!1),disabled:s(c.disabled,!1),placeholder:s(c.placeholder,!1),highlighted:!1,labelClass:(0,t.stringToHtmlClass)(c.labelClass),labelDescription:c.labelDescription,customProperties:c.customProperties}}},353:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isHTMLOptgroup=t.isHTMLOption=void 0,t.isHTMLOption=function(e){return"OPTION"===e.tagName},t.isHTMLOptgroup=function(e){return"OPTGROUP"===e.tagName}},705:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.parseDataSetId=t.parseCustomProperties=t.getClassNamesSelector=t.getClassNames=t.diff=t.isEmptyObject=t.cloneObject=t.existsInArray=t.dispatchEvent=t.sortByScore=t.sortByAlpha=t.unwrapStringForEscaped=t.unwrapStringForRaw=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){return Math.floor(Math.random()*(t-e)+e)},t.generateChars=function(e){return Array.from({length:e},(function(){return(0,t.getRandomNumber)(0,36).toString(36)})).join("")},t.generateId=function(e,i){var n=e.id||e.name&&"".concat(e.name,"-").concat((0,t.generateChars)(2))||(0,t.generateChars)(4);return n=n.replace(/(:|\.|\[|\]|,)/g,""),"".concat(i,"-").concat(n)},t.getType=function(e){return Object.prototype.toString.call(e).slice(8,-1)},t.isType=function(e,i){return null!=i&&(0,t.getType)(i)===e},t.wrap=function(e,t){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)},t.getAdjacentEl=function(e,t,i){void 0===i&&(i=1);for(var n="".concat(i>0?"next":"previous","ElementSibling"),s=e[n];s;){if(s.matches(t))return s;s=s[n]}return s},t.isScrolledIntoView=function(e,t,i){return void 0===i&&(i=1),!!e&&(i>0?t.scrollTop+t.offsetHeight>=e.offsetTop+e.offsetHeight:e.offsetTop>=t.scrollTop)},t.sanitise=function(e){if("string"!=typeof e){if(null==e)return"";if("object"==typeof e){if("raw"in e)return(0,t.sanitise)(e.raw);if("trusted"in e)return e.trusted}return e}return e.replace(/&/g,"&").replace(/>/g,">").replace(/{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0,t.defaultState=0,t.default=function(e,i){return void 0===e&&(e=t.defaultState),void 0===i&&(i={}),"SET_IS_LOADING"===i.type?i.isLoading?e+1:Math.max(0,e-1):e}},771:function(e,t,i){var n=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,s=0,r=t.length;s0},e.prototype.getChoiceById=function(e){return this.activeChoices.find((function(t){return t.id===e}))},e.prototype.getGroupById=function(e){return this.groups.find((function(t){return t.id===e}))},e}();t.default=c},543:function(e,t,i){var n=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,s=0,r=t.length;s0?"treeitem":"option"),Object.assign(A.dataset,{choice:"",id:y,value:b,selectText:n}),O&&(A.dataset.labelClass=(0,s.getClassNames)(O).join(" ")),I&&(A.dataset.labelDescription=I),w?((c=A.classList).add.apply(c,(0,s.getClassNames)(g)),A.dataset.choiceDisabled="",A.setAttribute("aria-disabled","true")):((l=A.classList).add.apply(l,(0,s.getClassNames)(f)),A.dataset.choiceSelectable=""),A},input:function(e,t){var i=e.classNames,n=i.input,r=i.inputCloned,o=Object.assign(document.createElement("input"),{type:"search",className:"".concat((0,s.getClassNames)(n).join(" ")," ").concat((0,s.getClassNames)(r).join(" ")),autocomplete:"off",autocapitalize:"off",spellcheck:!1});return o.setAttribute("role","textbox"),o.setAttribute("aria-autocomplete","list"),t&&o.setAttribute("aria-label",t),o},dropdown:function(e){var t,i,n=e.classNames,r=n.list,o=n.listDropdown,a=document.createElement("div");return(t=a.classList).add.apply(t,(0,s.getClassNames)(r)),(i=a.classList).add.apply(i,(0,s.getClassNames)(o)),a.setAttribute("aria-expanded","false"),a},notice:function(e,i,r){var o=e.allowHTML,a=e.classNames,c=a.item,l=a.itemChoice,h=a.noResults,u=a.noChoices;void 0===r&&(r="");var d=n(n([],(0,s.getClassNames)(c),!0),(0,s.getClassNames)(l),!0);return"no-choices"===r?d.push(u):"no-results"===r&&d.push(h),Object.assign(document.createElement("div"),{innerHTML:(0,t.escapeForTemplate)(o,i),className:d.join(" ")})},option:function(e){var t=e.label,i=e.value,n=e.labelClass,r=e.labelDescription,o=e.customProperties,a=e.active,c=e.disabled,l=(0,s.unwrapStringForRaw)(t),h=new Option(l,i,!1,a);return n&&(h.dataset.labelClass=(0,s.getClassNames)(n).join(" ")),r&&(h.dataset.labelDescription=r),(0,s.isEmptyObject)(o)||(h.dataset.customProperties=JSON.stringify(o)),h.disabled=c,h}};t.default=r},120:(e,t,i)=>{function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===l(e)}i.r(t),i.d(t,{default:()=>K});function s(e){return"string"==typeof e}function r(e){return"number"==typeof e}function o(e){return"object"==typeof e}function a(e){return null!=e}function c(e){return!e.trim().length}function l(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const h=e=>`Missing ${e} property in key`,u=e=>`Property 'weight' in key '${e}' must be a positive integer`,d=Object.prototype.hasOwnProperty;class p{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let i=f(e);t+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function f(e){let t=null,i=null,r=null,o=1,a=null;if(s(e)||n(e))r=e,t=m(e),i=g(e);else{if(!d.call(e,"name"))throw new Error(h("name"));const n=e.name;if(r=n,d.call(e,"weight")&&(o=e.weight,o<=0))throw new Error(u(n));t=m(n),i=g(n),a=e.getFn}return{path:t,id:i,weight:o,src:r,getFn:a}}function m(e){return n(e)?e:e.split(".")}function g(e){return n(e)?e.join("."):e}var v={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx{if(a(e))if(t[u]){const d=e[t[u]];if(!a(d))return;if(u===t.length-1&&(s(d)||r(d)||function(e){return!0===e||!1===e||function(e){return o(e)&&null!==e}(e)&&"[object Boolean]"==l(e)}(d)))i.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(d));else if(n(d)){c=!0;for(let e=0,i=d.length;e{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,s(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();s(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t{let o=t.getFn?t.getFn(e):this.getFn(e,t.path);if(a(o))if(n(o)){let e=[];const t=[{nestedArrIndex:-1,value:o}];for(;t.length;){const{nestedArrIndex:i,value:r}=t.pop();if(a(r))if(s(r)&&!c(r)){let t={v:r,i,n:this.norm.get(r)};e.push(t)}else n(r)&&r.forEach(((e,i)=>{t.push({nestedArrIndex:i,value:e})}))}i.$[r]=e}else if(s(o)&&!c(o)){let e={v:o,n:this.norm.get(o)};i.$[r]=e}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function b(e,t,{getFn:i=v.getFn,fieldNormWeight:n=v.fieldNormWeight}={}){const s=new y({getFn:i,fieldNormWeight:n});return s.setKeys(e.map(f)),s.setSources(t),s.create(),s}function E(e,{errors:t=0,currentLocation:i=0,expectedLocation:n=0,distance:s=v.distance,ignoreLocation:r=v.ignoreLocation}={}){const o=t/e.length;if(r)return o;const a=Math.abs(n-i);return s?o+a/s:a?1:o}const C=32;function S(e){let t={};for(let i=0,n=e.length;i{this.chunks.push({pattern:e,alphabet:S(e),startIndex:t})},h=this.pattern.length;if(h>C){let e=0;const t=h%C,i=h-t;for(;e{const{isMatch:f,score:m,indices:g}=function(e,t,i,{location:n=v.location,distance:s=v.distance,threshold:r=v.threshold,findAllMatches:o=v.findAllMatches,minMatchCharLength:a=v.minMatchCharLength,includeMatches:c=v.includeMatches,ignoreLocation:l=v.ignoreLocation}={}){if(t.length>C)throw new Error("Pattern length exceeds max of 32.");const h=t.length,u=e.length,d=Math.max(0,Math.min(n,u));let p=r,f=d;const m=a>1||c,g=m?Array(u):[];let _;for(;(_=e.indexOf(t,f))>-1;){let e=E(t,{currentLocation:_,expectedLocation:d,distance:s,ignoreLocation:l});if(p=Math.min(e,p),f=_+h,m){let e=0;for(;e=c;r-=1){let o=r-1,a=i[e.charAt(o)];if(m&&(g[o]=+!!a),_[r]=(_[r+1]<<1|1)&a,n&&(_[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),_[r]&O&&(b=E(t,{errors:n,currentLocation:o,expectedLocation:d,distance:s,ignoreLocation:l}),b<=p)){if(p=b,f=o,f<=d)break;c=Math.max(1,2*d-f)}}if(E(t,{errors:n+1,currentLocation:d,expectedLocation:d,distance:s,ignoreLocation:l})>p)break;y=_}const I={isMatch:f>=0,score:Math.max(.001,b)};if(m){const e=function(e=[],t=v.minMatchCharLength){let i=[],n=-1,s=-1,r=0;for(let o=e.length;r=t&&i.push([n,s]),n=-1)}return e[r-1]&&r-n>=t&&i.push([n,r-1]),i}(g,a);e.length?c&&(I.indices=e):I.isMatch=!1}return I}(e,t,d,{location:n+p,distance:s,threshold:r,findAllMatches:o,minMatchCharLength:a,includeMatches:i,ignoreLocation:c});f&&(u=!0),h+=m,f&&g&&(l=[...l,...g])}));let d={isMatch:u,score:u?h/this.chunks.length:1};return u&&i&&(d.indices=l),d}}class I{constructor(e){this.pattern=e}static isMultiMatch(e){return w(e,this.multiRegex)}static isSingleMatch(e){return w(e,this.singleRegex)}search(){}}function w(e,t){const i=e.match(t);return i?i[1]:null}class T extends I{constructor(e,{location:t=v.location,threshold:i=v.threshold,distance:n=v.distance,includeMatches:s=v.includeMatches,findAllMatches:r=v.findAllMatches,minMatchCharLength:o=v.minMatchCharLength,isCaseSensitive:a=v.isCaseSensitive,ignoreLocation:c=v.ignoreLocation}={}){super(e),this._bitapSearch=new O(e,{location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:r,minMatchCharLength:o,isCaseSensitive:a,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class L extends I{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,i=0;const n=[],s=this.pattern.length;for(;(t=e.indexOf(this.pattern,i))>-1;)i=t+s,n.push([t,i-1]);const r=!!n.length;return{isMatch:r,score:r?0:1,indices:n}}}const A=[class extends I{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},L,class extends I{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends I{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends I{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends I{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends I{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},T],M=A.length,N=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,x=new Set([T.type,L.type]);const j=[];function P(e,t){for(let i=0,n=j.length;i!(!e[D]&&!e.$or),k=e=>({[D]:Object.keys(e).map((t=>({[t]:e[t]})))});function H(e,t,{auto:i=!0}={}){const r=e=>{let a=Object.keys(e);const c=(e=>!!e[F])(e);if(!c&&a.length>1&&!R(e))return r(k(e));if((e=>!n(e)&&o(e)&&!R(e))(e)){const n=c?e[F]:a[0],r=c?e.$val:e[n];if(!s(r))throw new Error((e=>`Invalid value for key ${e}`)(n));const o={keyId:g(n),pattern:r};return i&&(o.searcher=P(r,t)),o}let l={children:[],operator:a[0]};return a.forEach((t=>{const i=e[t];n(i)&&i.forEach((e=>{l.children.push(r(e))}))})),l};return R(e)||(e=k(e)),r(e)}function B(e,t){const i=e.matches;t.matches=[],a(i)&&i.forEach((e=>{if(!a(e.indices)||!e.indices.length)return;const{indices:i,value:n}=e;let s={indices:i,value:n};e.key&&(s.key=e.key.src),e.idx>-1&&(s.refIndex=e.idx),t.matches.push(s)}))}function V(e,t){t.score=e.score}class K{constructor(e,t={},i){this.options={...v,...t},this.options.useExtendedSearch,this._keyStore=new p(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof y))throw new Error("Incorrect 'index' type");this._myIndex=t||b(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){a(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const t=[];for(let i=0,n=this._docs.length;i{let i=1;e.matches.forEach((({key:e,norm:n,score:s})=>{const r=e?e.weight:null;i*=Math.pow(0===s&&r?Number.EPSILON:s,(r||1)*(t?1:n))})),e.score=i}))}(l,{ignoreFieldNorm:c}),o&&l.sort(a),r(t)&&t>-1&&(l=l.slice(0,t)),function(e,t,{includeMatches:i=v.includeMatches,includeScore:n=v.includeScore}={}){const s=[];return i&&s.push(B),n&&s.push(V),e.map((e=>{const{idx:i}=e,n={item:t[i],refIndex:i};return s.length&&s.forEach((t=>{t(e,n)})),n}))}(l,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const t=P(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach((({v:e,i,n:s})=>{if(!a(e))return;const{isMatch:r,score:o,indices:c}=t.searchIn(e);r&&n.push({item:e,idx:i,matches:[{score:o,value:e,norm:s,indices:c}]})})),n}_searchLogical(e){const t=H(e,this.options),i=(e,t,n)=>{if(!e.children){const{keyId:i,searcher:s}=e,r=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:s});return r&&r.length?[{idx:n,item:t,matches:r}]:[]}const s=[];for(let r=0,o=e.children.length;r{if(a(e)){let o=i(t,e,n);o.length&&(s[n]||(s[n]={idx:n,item:e,matches:[]},r.push(s[n])),o.forEach((({matches:e})=>{s[n].matches.push(...e)})))}})),r}_searchObjectList(e){const t=P(e,this.options),{keys:i,records:n}=this._myIndex,s=[];return n.forEach((({$:e,i:n})=>{if(!a(e))return;let r=[];i.forEach(((i,n)=>{r.push(...this._findMatches({key:i,value:e[n],searcher:t}))})),r.length&&s.push({idx:n,item:e,matches:r})})),s}_findMatches({key:e,value:t,searcher:i}){if(!a(t))return[];let s=[];if(n(t))t.forEach((({v:t,i:n,n:r})=>{if(!a(t))return;const{isMatch:o,score:c,indices:l}=i.searchIn(t);o&&s.push({score:c,key:e,value:t,idx:n,norm:r,indices:l})}));else{const{v:n,n:r}=t,{isMatch:o,score:a,indices:c}=i.searchIn(n);o&&s.push({score:a,key:e,value:n,norm:r,indices:c})}return s}}K.version="6.6.2",K.createIndex=b,K.parseIndex=function(e,{getFn:t=v.getFn,fieldNormWeight:i=v.fieldNormWeight}={}){const{keys:n,records:s}=e,r=new y({getFn:t,fieldNormWeight:i});return r.setKeys(n),r.setIndexRecords(s),r},K.config=v,K.parseQuery=H,function(...e){j.push(...e)}(class{constructor(e,{isCaseSensitive:t=v.isCaseSensitive,includeMatches:i=v.includeMatches,minMatchCharLength:n=v.minMatchCharLength,ignoreLocation:s=v.ignoreLocation,findAllMatches:r=v.findAllMatches,location:o=v.location,threshold:a=v.threshold,distance:c=v.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:r,ignoreLocation:s,location:o,threshold:a,distance:c},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map((e=>{let i=e.trim().split(N).filter((e=>e&&!!e.trim())),n=[];for(let e=0,s=i.length;e{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function s(e,t,i){return(t=function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function o(e){for(var t=1;th,applyMiddleware:()=>v,bindActionCreators:()=>m,combineReducers:()=>p,compose:()=>g,createStore:()=>u,legacy_createStore:()=>d});var c="function"==typeof Symbol&&Symbol.observable||"@@observable",l=function(){return Math.random().toString(36).substring(7).split("").join(".")},h={INIT:"@@redux/INIT"+l(),REPLACE:"@@redux/REPLACE"+l(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+l()}};function u(e,t,i){var n;if("function"==typeof t&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(a(0));if("function"==typeof t&&void 0===i&&(i=t,t=void 0),void 0!==i){if("function"!=typeof i)throw new Error(a(1));return i(u)(e,t)}if("function"!=typeof e)throw new Error(a(2));var s=e,r=t,o=[],l=o,d=!1;function p(){l===o&&(l=o.slice())}function f(){if(d)throw new Error(a(3));return r}function m(e){if("function"!=typeof e)throw new Error(a(4));if(d)throw new Error(a(5));var t=!0;return p(),l.push(e),function(){if(t){if(d)throw new Error(a(6));t=!1,p();var i=l.indexOf(e);l.splice(i,1),o=null}}}function g(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(a(7));if(void 0===e.type)throw new Error(a(8));if(d)throw new Error(a(9));try{d=!0,r=s(r,e)}finally{d=!1}for(var t=o=l,i=0;i{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};i.d(n,{default:()=>o});var s=i(472),r=i.n(s);i(689),i(493),i(468),i(543);const o=r();window.Choices=n.default})(); \ No newline at end of file +(()=>{"use strict";var e={808:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clearChoices=t.activateChoices=t.filterChoices=t.removeChoice=t.addChoice=void 0,t.addChoice=function(e){return{type:"ADD_CHOICE",choice:e}},t.removeChoice=function(e){return{type:"REMOVE_CHOICE",value:e}},t.filterChoices=function(e){return{type:"FILTER_CHOICES",results:e}},t.activateChoices=function(e){return void 0===e&&(e=!0),{type:"ACTIVATE_CHOICES",active:e}},t.clearChoices=function(){return{type:"CLEAR_CHOICES"}}},18:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addGroup=void 0,t.addGroup=function(e){return{type:"ADD_GROUP",group:e}}},956:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.highlightItem=t.removeItem=t.addItem=void 0,t.addItem=function(e){return{type:"ADD_ITEM",item:e}},t.removeItem=function(e){return{type:"REMOVE_ITEM",item:e}},t.highlightItem=function(e,t){return{type:"HIGHLIGHT_ITEM",id:e,highlighted:t}}},278:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setIsLoading=t.clearAll=void 0,t.clearAll=function(){return{type:"CLEAR_ALL"}},t.setIsLoading=function(e){return{type:"SET_IS_LOADING",isLoading:e}}},472:function(e,t,i){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i element"),this)},e.prototype.removeChoice=function(e){return this._store.dispatch((0,h.removeChoice)(e)),this},e.prototype.clearChoices=function(){return this._store.dispatch((0,h.clearChoices)()),this},e.prototype.clearStore=function(){return this._store.dispatch((0,p.clearAll)()),this._lastAddedChoiceId=0,this._lastAddedGroupId=0,this},e.prototype.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._currentValue="",this._store.dispatch((0,h.activateChoices)(!0))),this},e.prototype._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var e=this._currentState.items!==this._prevState.items;(this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||e)&&(this._isSelectElement&&this._renderChoices(),e&&this._renderItems(),this._prevState=this._currentState)}},e.prototype._renderChoices=function(){var e=this,t=this._store,i=t.activeGroups,n=t.activeChoices,s=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame((function(){return e.choiceList.scrollToTop()})),i.length>=1&&!this._isSearching){var r=n.filter((function(e){return e.placeholder&&-1===e.groupId}));r.length>=1&&(s=this._createChoicesFragment(r,s)),s=this._createGroupsFragment(i,n,s)}else n.length>=1&&(s=this._createChoicesFragment(n,s));var o=this._store.activeItems;if(s.childNodes&&s.childNodes.length>0){var a=this._canAddItem(o,this.input.value);if(a.response)this.choiceList.append(s),this._highlightChoice();else{var c=this._templates.notice(this.config,a.notice);this.choiceList.append(c)}}else{var l=this._canAddChoice(o,this.input.value),h=void 0;l.response?h=this._templates.notice(this.config,l.notice):this._isSearching?(c="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,h=this._templates.notice(this.config,c,"no-results")):(c="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,h=this._templates.notice(this.config,c,"no-choices")),this.choiceList.append(h)}},e.prototype._renderItems=function(){var e=this._store.activeItems||[];this.itemList.clear();var t=this._createItemsFragment(e);t.childNodes&&this.itemList.append(t)},e.prototype._createGroupsFragment=function(e,t,i){var n=this;void 0===i&&(i=document.createDocumentFragment()),this.config.shouldSort&&e.sort(this.config.sorter);var s=t.filter((function(e){return 0===e.groupId}));return s.length>0&&this._createChoicesFragment(s,i,!1),e.forEach((function(e){var s=function(e){return t.filter((function(t){return n._isSelectOneElement?t.groupId===e.id:t.groupId===e.id&&("always"===n.config.renderSelectedChoices||!t.selected)}))}(e);if(s.length>=1){var r=n._templates.choiceGroup(n.config,e);i.appendChild(r),n._createChoicesFragment(s,i,!0)}})),i},e.prototype._createChoicesFragment=function(e,t,i){var n=this;void 0===t&&(t=document.createDocumentFragment()),void 0===i&&(i=!1);var s=this.config,r=s.renderSelectedChoices,o=s.searchResultLimit,c=s.renderChoiceLimit,l=s.appendGroupInSearch,h=this._isSearching?_.sortByScore:this.config.sorter,u=function(e){if("auto"!==r||n._isSelectOneElement||!e.selected){var i=n._templates.choice(n.config,e,n.config.itemSelectText);if(l){var s="";n._store.groups.every((function(t){return t.id!==e.groupId||(s=t.label,!1)})),s&&n._isSearching&&(i.innerHTML+=" (".concat(s,")"))}t.appendChild(i)}},d=e;if("auto"!==r||this._isSelectOneElement||(d=e.filter((function(e){return!e.selected}))),this._isSelectElement){var p=e.filter((function(e){return!e.element}));0!==p.length&&this.passedElement.addOptions(p)}var f=d.reduce((function(e,t){return t.placeholder?e.placeholderChoices.push(t):e.normalChoices.push(t),e}),{placeholderChoices:[],normalChoices:[]}),m=f.placeholderChoices,g=f.normalChoices;(this.config.shouldSort||this._isSearching)&&g.sort(h);var v=d.length,y=this._isSelectOneElement?a(a([],m,!0),g,!0):g;this._isSearching?v=o:c&&c>0&&!i&&(v=c);for(var b=0;b0?this._store.getGroupById(t.groupId):null;return{id:t.id,value:t.value,label:t.label,labelClass:t.labelClass,labelDescription:t.labelDescription,customProperties:t.customProperties,groupValue:i&&i.label?i.label:null,element:t.element,keyCode:t.keyCode}}},e.prototype._triggerChange=function(e){null!=e&&this.passedElement.triggerEvent("change",{value:e})},e.prototype._selectPlaceholderChoice=function(e){this._addItem(e),e.value&&this._triggerChange(e.value)},e.prototype._handleButtonAction=function(e,t){if(0!==e.length&&this.config.removeItems&&this.config.removeItemButton){var i=t&&(0,_.parseDataSetId)(t.parentNode),n=i&&e.find((function(e){return e.id===i}));n&&(this._removeItem(n),this._triggerChange(n.value),this._isSelectOneElement&&this._store.placeholderChoice&&this._selectPlaceholderChoice(this._store.placeholderChoice))}},e.prototype._handleItemAction=function(e,t,i){var n=this;if(void 0===i&&(i=!1),0!==e.length&&this.config.removeItems&&!this._isSelectOneElement){var s=(0,_.parseDataSetId)(t);s&&(e.forEach((function(e){e.id!==s||e.highlighted?!i&&e.highlighted&&n.unhighlightItem(e):n.highlightItem(e)})),this.input.focus())}},e.prototype._handleChoiceAction=function(e,t){var i=this,n=(0,_.parseDataSetId)(t),s=n&&this._store.getChoiceById(n);if(s){var r=0!==e.length&&e[0]&&e[0].keyCode?e[0].keyCode:void 0,o=this.dropdown.isActive;s.keyCode=r,this.passedElement.triggerEvent("choice",{choice:s});var a=!1;this._store.withDeferRendering((function(){if(!s.selected&&!s.disabled&&i._canAddItem(e,s.value).response){if(i.config.singleModeForMultiSelect&&0!==e.length){var t=e[e.length-1];i._removeItem(t)}i._addItem(s),a=!0}i.clearInput()})),a&&this._triggerChange(s.value),o&&(this.config.singleModeForMultiSelect||this._isSelectOneElement)&&(this.hideDropdown(!0),this.containerOuter.focus())}},e.prototype._handleBackspace=function(e){if(this.config.removeItems&&0!==e.length){var t=e[e.length-1],i=e.some((function(e){return e.highlighted}));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))}},e.prototype._loadChoices=function(){var e;if(this._isTextElement){this._presetItems=this.config.items.map((function(e){return(0,C.mapInputToChoice)(e,!1)}));var t=this.passedElement.value;if(t){var i=t.split(this.config.delimiter).map((function(e){return(0,C.mapInputToChoice)(e,!1)}));this._presetItems=this._presetItems.concat(i)}}else if(this._isSelectElement){this._presetChoices=this.config.choices.map((function(e){return(0,C.mapInputToChoice)(e,!0)}));var n=this.passedElement.optionsAsChoices();n&&(e=this._presetChoices).push.apply(e,n)}},e.prototype._startLoading=function(){this._store.startDeferRendering()},e.prototype._stopLoading=function(){this._store.stopDeferRendering()},e.prototype._handleLoadingState=function(e){void 0===e&&(e=!0);var t=this.itemList.getChild((0,_.getClassNamesSelector)(this.config.classNames.placeholder));e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t?t.innerHTML=this.config.loadingText:(t=this._templates.placeholder(this.config,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||"")},e.prototype._handleSearch=function(e){if(this.input.isFocussed){var t=this._store.choices,i=this.config,n=i.searchFloor,s=i.searchChoices,r=t.some((function(e){return!e.active}));if(null!=e&&e.length>=n){var o=s?this._searchChoices(e):0;null!==o&&this.passedElement.triggerEvent("search",{value:e,resultCount:o})}else r&&(this._isSearching=!1,this._store.dispatch((0,h.activateChoices)(!0)))}},e.prototype._canAddChoice=function(e,t){return this._canAddUserChoices?this._canAddItem(e,t):{response:!1,notice:""}},e.prototype._canAddItem=function(e,t){var i=this,n=!0,s="";return this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(this.config.singleModeForMultiSelect||(n=!1,s="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText)),n&&this._canAddUserChoices&&""!==t&&"function"==typeof this.config.addItemFilter&&!this.config.addItemFilter(t)&&(n=!1,s="function"==typeof this.config.customAddItemText?this.config.customAddItemText((0,_.sanitise)(t),t):this.config.customAddItemText),!n||!this._isSelectElement&&this.config.duplicateItemsAllowed||this._store.items.find((function(e){return i.config.valueComparer(e.value,t)}))&&(n=!1,s="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText((0,_.sanitise)(t),t):this.config.uniqueItemText),n&&(s="function"==typeof this.config.addItemText?this.config.addItemText((0,_.sanitise)(t),t):this.config.addItemText),{response:n,notice:{trusted:s}}},e.prototype._searchChoices=function(e){var t=e.trim().replace(/\s{2,}/," ");if(0===t.length||t===this._currentValue)return null;var i=this._store.searchableChoices,n=t,s=Object.assign(this.config.fuseOptions,{keys:a([],this.config.searchFields,!0),includeMatches:!0}),r=new l.default(i,s).search(n);return this._currentValue=t,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch((0,h.filterChoices)(r)),r.length},e.prototype._addEventListeners=function(){var e=this.config.shadowRoot||document.documentElement;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()},e.prototype._removeEventListeners=function(){var e=this.config.shadowRoot||document.documentElement;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()},e.prototype._onKeyDown=function(e){var t=e.keyCode,i=this._store.items,n=this.input.isFocussed,s=this.dropdown.isActive,r=this.itemList.hasChildren(),o=1===e.key.length||2===e.key.length&&e.key.charCodeAt(0)>=55296||"Unidentified"===e.key;switch(this._isTextElement||s||(this.showDropdown(),!this.input.isFocussed&&o&&(this.input.value+=e.key)),t){case 65:return this._onSelectKey(e,r);case 13:return this._onEnterKey(e,i,s);case 27:return this._onEscapeKey(e,s);case 38:case 33:case 40:case 34:return this._onDirectionKey(e,s);case 8:case 46:return this._onDeleteKey(e,i,n)}},e.prototype._onKeyUp=function(e){var t=e.target,i=e.keyCode,n=this.input.value,s=this._store.items,r=this._canAddItem(s,n);if(this._isTextElement)if(r.notice&&n){var o=this._templates.notice(this.config,r.notice);this.dropdown.element.innerHTML=o.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0);else{var a=(46===i||8===i)&&t&&!t.value,c=!this._isTextElement&&this._isSearching,l=this._canSearch&&r.response;a&&c?(this._isSearching=!1,this._store.dispatch((0,h.activateChoices)(!0))):l&&this._handleSearch(this.input.rawValue)}this._canSearch=this.config.searchEnabled},e.prototype._onSelectKey=function(e,t){var i=e.ctrlKey,n=e.metaKey;(i||n)&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e.prototype._onEnterKey=function(e,t,i){var n=this,s=e.target,r=s&&s.hasAttribute("data-button"),o=!1;if(s&&s.value){var a=this.input.value;(this._isTextElement?this._canAddItem(t,a):this._canAddChoice(t,a)).response&&(this.hideDropdown(!0),this._store.withDeferRendering((function(){if((n._isSelectOneElement||n.config.singleModeForMultiSelect)&&0!==t.length){var e=t[t.length-1];n._removeItem(e)}var i=!0;!n._isSelectElement&&n.config.duplicateItemsAllowed||(i=!n._findAndSelectChoiceByValue(a)),i&&n._addChoice((0,C.mapInputToChoice)({value:n.config.allowHtmlUserInput?a:(0,_.sanitise)(a),label:{escaped:(0,_.sanitise)(a),raw:a},selected:!0},!1)),n.clearInput()})),this._triggerChange(a),o=!0)}if(r&&(this._handleButtonAction(t,s),e.preventDefault()),i){var c=this.dropdown.getChild((0,_.getClassNamesSelector)(this.config.classNames.highlightedState));c&&(o?this.unhighlightAll():(t[0]&&(t[0].keyCode=13),this._handleChoiceAction(t,c))),e.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),e.preventDefault())},e.prototype._onEscapeKey=function(e,t){t&&(e.stopPropagation(),this.hideDropdown(!0),this.containerOuter.focus())},e.prototype._onDirectionKey=function(e,t){var i=e.keyCode,n=e.metaKey;if(t||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var s=40===i||34===i?1:-1,r="[data-choice-selectable]",o=void 0;if(n||34===i||33===i)o=s>0?this.dropdown.element.querySelector("".concat(r,":last-of-type")):this.dropdown.element.querySelector(r);else{var a=this.dropdown.element.querySelector((0,_.getClassNamesSelector)(this.config.classNames.highlightedState));o=a?(0,_.getAdjacentEl)(a,r,s):this.dropdown.element.querySelector(r)}o&&((0,_.isScrolledIntoView)(o,this.choiceList.element,s)||this.choiceList.scrollToChildElement(o,s),this._highlightChoice(o)),e.preventDefault()}},e.prototype._onDeleteKey=function(e,t,i){var n=e.target;this._isSelectOneElement||n.value||!i||(this._handleBackspace(t),e.preventDefault())},e.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target;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},e.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(S&&this.choiceList.element.contains(t)){var i=this.choiceList.element.firstElementChild,n="ltr"===this._direction?e.offsetX>=i.offsetWidth:e.offsetX0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},e.prototype._onFocus=function(e){var t,i=this,n=e.target;n&&this.containerOuter.element.contains(n)&&((t={})[m.TEXT_TYPE]=function(){n===i.input.element&&i.containerOuter.addFocusState()},t[m.SELECT_ONE_TYPE]=function(){i.containerOuter.addFocusState(),n===i.input.element&&i.showDropdown(!0)},t[m.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.showDropdown(!0),i.containerOuter.addFocusState())},t)[this._elementType]()},e.prototype._onBlur=function(e){var t,i=this,n=e.target;if(n&&this.containerOuter.element.contains(n)&&!this._isScrollingOnIe){var s=this._store.activeItems.some((function(e){return e.highlighted}));((t={})[m.TEXT_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),s&&i.unhighlightAll(),i.hideDropdown(!0))},t[m.SELECT_ONE_TYPE]=function(){i.containerOuter.removeFocusState(),(n===i.input.element||n===i.containerOuter.element&&!i._canSearch)&&i.hideDropdown(!0)},t[m.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),i.hideDropdown(!0),s&&i.unhighlightAll())},t)[this._elementType]()}else this._isScrollingOnIe=!1,this.input.element.focus()},e.prototype._onFormReset=function(){var e=this;this._store.withDeferRendering((function(){e.clearInput(),e.hideDropdown(),e.refresh(!1,!1,!0),0!==e._initialItems.length&&e.setChoiceByValue(e._initialItems)}))},e.prototype._highlightChoice=function(e){var t,i=this;void 0===e&&(e=null);var n=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(n.length){var s=e;Array.from(this.dropdown.element.querySelectorAll((0,_.getClassNamesSelector)(this.config.classNames.highlightedState))).forEach((function(e){var t;(t=e.classList).remove.apply(t,(0,_.getClassNames)(i.config.classNames.highlightedState)),e.setAttribute("aria-selected","false")})),s?this._highlightPosition=n.indexOf(s):(s=n.length>this._highlightPosition?n[this._highlightPosition]:n[n.length-1])||(s=n[0]),(t=s.classList).add.apply(t,(0,_.getClassNames)(this.config.classNames.highlightedState)),s.setAttribute("aria-selected","true"),this.passedElement.triggerEvent("highlightChoice",{el:s}),this.dropdown.isActive&&(this.input.setActiveDescendant(s.id),this.containerOuter.setActiveDescendant(s.id))}},e.prototype._addItem=function(e,t){void 0===t&&(t=!0);var i=e.id;if(0===i)throw new TypeError("item.id must be set before _addItem is called for a choice/item");this._store.dispatch((0,d.addItem)(e)),this._isSelectOneElement&&this.removeActiveItems(i),t&&this.passedElement.triggerEvent("addItem",this._getChoiceForEvent(e))},e.prototype._removeItem=function(e){e.id&&(this._store.dispatch((0,d.removeItem)(e)),this.passedElement.triggerEvent("removeItem",this._getChoiceForEvent(e)))},e.prototype._addChoice=function(e,t){if(void 0===t&&(t=!0),0!==e.id)throw new TypeError("Can not re-add a choice which has already been added");var i=e;this._lastAddedChoiceId++,i.id=this._lastAddedChoiceId,i.elementId="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(i.id),this.config.prependValue&&(i.value=this.config.prependValue+i.value),this.config.appendValue&&(i.value+=this.config.appendValue.toString()),(this.config.prependValue||this.config.appendValue)&&i.element&&(i.element.value=i.value),this._store.dispatch((0,h.addChoice)(e)),e.selected&&this._addItem(e,t)},e.prototype._addGroup=function(e,t){var i=this;if(void 0===t&&(t=!0),0!==e.id)throw new TypeError("Can not re-add a group which has already been added");if(this._store.dispatch((0,u.addGroup)(e)),e.choices){var n=e;this._lastAddedGroupId++,n.id=this._lastAddedGroupId;var s=e.id,r=e.choices;n.choices=[],r.forEach((function(n){var r=n;r.groupId=s,e.disabled&&(r.disabled=!0),i._addChoice(r,t)}))}},e.prototype._getTemplate=function(e){for(var t,i=[],n=1;n{Object.defineProperty(t,"__esModule",{value:!0});var n=i(705),s=i(493),r=function(){function e(e){var t=e.element,i=e.type,n=e.classNames,s=e.position;this.element=t,this.classNames=n,this.type=i,this.position=s,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)}return e.prototype.addEventListeners=function(){this.element.addEventListener("focus",this._onFocus),this.element.addEventListener("blur",this._onBlur)},e.prototype.removeEventListeners=function(){this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},e.prototype.shouldFlip=function(e){var t=!1;return"auto"===this.position?t=!window.matchMedia("(min-height: ".concat(e+1,"px)")).matches:"top"===this.position&&(t=!0),t},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype.open=function(e){var t,i;(t=this.element.classList).add.apply(t,(0,n.getClassNames)(this.classNames.openState)),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e)&&((i=this.element.classList).add.apply(i,(0,n.getClassNames)(this.classNames.flippedState)),this.isFlipped=!0)},e.prototype.close=function(){var e,t;(e=this.element.classList).remove.apply(e,(0,n.getClassNames)(this.classNames.openState)),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&((t=this.element.classList).remove.apply(t,(0,n.getClassNames)(this.classNames.flippedState)),this.isFlipped=!1)},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.addFocusState=function(){var e;(e=this.element.classList).add.apply(e,(0,n.getClassNames)(this.classNames.focusState))},e.prototype.removeFocusState=function(){var e;(e=this.element.classList).remove.apply(e,(0,n.getClassNames)(this.classNames.focusState))},e.prototype.enable=function(){var e;(e=this.element.classList).remove.apply(e,(0,n.getClassNames)(this.classNames.disabledState)),this.element.removeAttribute("aria-disabled"),this.type===s.SELECT_ONE_TYPE&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},e.prototype.disable=function(){var e;(e=this.element.classList).add.apply(e,(0,n.getClassNames)(this.classNames.disabledState)),this.element.setAttribute("aria-disabled","true"),this.type===s.SELECT_ONE_TYPE&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},e.prototype.wrap=function(e){(0,n.wrap)(e,this.element)},e.prototype.unwrap=function(e){this.element.parentNode&&(this.element.parentNode.insertBefore(e,this.element),this.element.parentNode.removeChild(this.element))},e.prototype.addLoadingState=function(){var e;(e=this.element.classList).add.apply(e,(0,n.getClassNames)(this.classNames.loadingState)),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},e.prototype.removeLoadingState=function(){var e;(e=this.element.classList).remove.apply(e,(0,n.getClassNames)(this.classNames.loadingState)),this.element.removeAttribute("aria-busy"),this.isLoading=!1},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}();t.default=r},836:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=i(705),s=function(){function e(e){var t=e.element,i=e.type,n=e.classNames;this.element=t,this.classNames=n,this.type=i,this.isActive=!1}return Object.defineProperty(e.prototype,"distanceFromTopWindow",{get:function(){return this.element.getBoundingClientRect().bottom},enumerable:!1,configurable:!0}),e.prototype.getChild=function(e){return this.element.querySelector(e)},e.prototype.show=function(){var e;return(e=this.element.classList).add.apply(e,(0,n.getClassNames)(this.classNames.activeState)),this.element.setAttribute("aria-expanded","true"),this.isActive=!0,this},e.prototype.hide=function(){var e;return(e=this.element.classList).remove.apply(e,(0,n.getClassNames)(this.classNames.activeState)),this.element.setAttribute("aria-expanded","false"),this.isActive=!1,this},e}();t.default=s},253:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WrappedSelect=t.WrappedInput=t.List=t.Input=t.Container=t.Dropdown=void 0;var s=n(i(836));t.Dropdown=s.default;var r=n(i(382));t.Container=r.default;var o=n(i(37));t.Input=o.default;var a=n(i(937));t.List=a.default;var c=n(i(733));t.WrappedInput=c.default;var l=n(i(129));t.WrappedSelect=l.default},37:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=i(493),s=function(){function e(e){var t=e.element,i=e.type,n=e.classNames,s=e.preventPaste;this.element=t,this.type=i,this.classNames=n,this.preventPaste=s,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)}return Object.defineProperty(e.prototype,"placeholder",{set:function(e){this.element.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rawValue",{get:function(){return this.element.value},enumerable:!1,configurable:!0}),e.prototype.addEventListeners=function(){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})},e.prototype.removeEventListeners=function(){this.element.removeEventListener("input",this._onInput),this.element.removeEventListener("paste",this._onPaste),this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.isDisabled=!0},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.blur=function(){this.isFocussed&&this.element.blur()},e.prototype.clear=function(e){return void 0===e&&(e=!0),this.element.value&&(this.element.value=""),e&&this.setWidth(),this},e.prototype.setWidth=function(){var e=this.element,t=e.style,i=e.value,n=e.placeholder;t.minWidth="".concat(n.length+1,"ch"),t.width="".concat(i.length+1,"ch")},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype._onInput=function(){this.type!==n.SELECT_ONE_TYPE&&this.setWidth()},e.prototype._onPaste=function(e){this.preventPaste&&e.preventDefault()},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}();t.default=s},937:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=i(493),s=function(){function e(e){var t=e.element;this.element=t,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}return e.prototype.clear=function(){this.element.innerHTML=""},e.prototype.append=function(e){this.element.appendChild(e)},e.prototype.getChild=function(e){return this.element.querySelector(e)},e.prototype.hasChildren=function(){return this.element.hasChildNodes()},e.prototype.scrollToTop=function(){this.element.scrollTop=0},e.prototype.scrollToChildElement=function(e,t){var i=this;if(e){var n=this.element.offsetHeight,s=this.element.scrollTop+n,r=e.offsetHeight,o=e.offsetTop+r,a=t>0?this.element.scrollTop+o-s:e.offsetTop;requestAnimationFrame((function(){i._animateScroll(a,t)}))}},e.prototype._scrollDown=function(e,t,i){var n=(i-e)/t,s=n>1?n:1;this.element.scrollTop=e+s},e.prototype._scrollUp=function(e,t,i){var n=(e-i)/t,s=n>1?n:1;this.element.scrollTop=e-s},e.prototype._animateScroll=function(e,t){var i=this,s=n.SCROLLING_SPEED,r=this.element.scrollTop,o=!1;t>0?(this._scrollDown(r,s,e),re&&(o=!0)),o&&requestAnimationFrame((function(){i._animateScroll(e,t)}))},e}();t.default=s},617:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=i(705),s=function(){function e(e){var t=e.element,i=e.classNames;this.element=t,this.classNames=i,this.isDisabled=!1}return Object.defineProperty(e.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.conceal=function(){var e;(e=this.element.classList).add.apply(e,(0,n.getClassNames)(this.classNames.input)),this.element.hidden=!0,this.element.tabIndex=-1;var t=this.element.getAttribute("style");t&&this.element.setAttribute("data-choice-orig-style",t),this.element.setAttribute("data-choice","active")},e.prototype.reveal=function(){var e;(e=this.element.classList).remove.apply(e,(0,n.getClassNames)(this.classNames.input)),this.element.hidden=!1,this.element.removeAttribute("tabindex");var t=this.element.getAttribute("data-choice-orig-style");t?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",t)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},e.prototype.triggerEvent=function(e,t){(0,n.dispatchEvent)(this.element,e,t)},e}();t.default=s},733:function(e,t,i){var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){var i=t.element,n=t.classNames,s=t.delimiter,r=e.call(this,{element:i,classNames:n})||this;return r.delimiter=s,r}return s(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),t}(r(i(617)).default);t.default=o},129:function(e,t,i){var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(705),a=r(i(617)),c=i(353),l=i(200),h=function(e){function t(t){var i=t.element,n=t.classNames,s=t.template,r=e.call(this,{element:i,classNames:n})||this;return r.template=s,r}return s(t,e),Object.defineProperty(t.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optionGroups",{get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return Array.from(this.element.options)},enumerable:!1,configurable:!0}),t.prototype.addOptions=function(e){var t=this;e.forEach((function(e){var i=e;if(!i.element){var n=t.template(i);t.element.appendChild(n),i.element=n}}))},t.prototype.optionsAsChoices=function(){var e=this,t=[];return this.element.querySelectorAll(":scope > option, :scope > optgroup").forEach((function(i){(0,c.isHTMLOption)(i)?t.push(e._optionToChoice(i)):(0,c.isHTMLOptgroup)(i)&&t.push(e._optgroupToChoice(i))})),t},t.prototype._optionToChoice=function(e){return{id:0,groupId:0,value:e.value,label:e.innerHTML,element:e,active:!0,selected:e.selected,disabled:e.disabled,highlighted:!1,placeholder:""===e.value||e.hasAttribute("placeholder"),labelClass:void 0!==e.dataset.labelClass?(0,l.stringToHtmlClass)(e.dataset.labelClass):void 0,labelDescription:void 0!==e.dataset.labelDescription?e.dataset.labelDescription:void 0,customProperties:(0,o.parseCustomProperties)(e.dataset.customProperties)}},t.prototype._optgroupToChoice=function(e){var t=this,i=e.querySelectorAll("option"),n=Array.from(i).map((function(e){return t._optionToChoice(e)}));return{id:0,label:e.label||"",element:e,active:0!==n.length,disabled:e.disabled,choices:n}},t}(a.default);t.default=h},493:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SCROLLING_SPEED=t.SELECT_MULTIPLE_TYPE=t.SELECT_ONE_TYPE=t.TEXT_TYPE=void 0,t.TEXT_TYPE="text",t.SELECT_ONE_TYPE="select-one",t.SELECT_MULTIPLE_TYPE="select-multiple",t.SCROLLING_SPEED=4},468:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CONFIG=t.DEFAULT_CLASSNAMES=void 0;var n=i(705);t.DEFAULT_CLASSNAMES={containerOuter:["choices"],containerInner:["choices__inner"],input:["choices__input"],inputCloned:["choices__input--cloned"],list:["choices__list"],listItems:["choices__list--multiple"],listSingle:["choices__list--single"],listDropdown:["choices__list--dropdown"],item:["choices__item"],itemSelectable:["choices__item--selectable"],itemDisabled:["choices__item--disabled"],itemChoice:["choices__item--choice"],description:["choices__description"],placeholder:["choices__placeholder"],group:["choices__group"],groupHeading:["choices__heading"],button:["choices__button"],activeState:["is-active"],focusState:["is-focused"],openState:["is-open"],disabledState:["is-disabled"],highlightedState:["is-highlighted"],selectedState:["is-selected"],flippedState:["is-flipped"],loadingState:["is-loading"],noResults:["has-no-results"],noChoices:["has-no-choices"]},t.DEFAULT_CONFIG={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,singleModeForMultiSelect:!1,addChoices:!1,addItems:!0,addItemFilter:function(e){return!!e&&""!==e},removeItems:!0,removeItemButton:!1,removeItemButtonAlignLeft:!1,editItems:!1,allowHTML:!1,allowHtmlUserInput:!1,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:n.sortByAlpha,shadowRoot:null,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add "'.concat(e,'"')},removeItemIconText:function(){return"Remove item"},removeItemLabelText:function(e){return"Remove item: ".concat(e)},maxItemText:function(e){return"Only ".concat(e," values can be added")},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:t.DEFAULT_CLASSNAMES,appendGroupInSearch:!1}},360:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},405:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},424:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},394:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},689:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),s(i(360),t),s(i(405),t),s(i(424),t),s(i(394),t),s(i(13),t),s(i(536),t),s(i(641),t),s(i(411),t),s(i(364),t),s(i(89),t),s(i(638),t),s(i(512),t),s(i(132),t)},13:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},536:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},641:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},411:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectsInConfig=void 0,t.ObjectsInConfig=["fuseOptions","classNames"]},89:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},364:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},638:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},512:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},132:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},200:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mapInputToChoice=t.stringToHtmlClass=void 0;var n=i(705),s=function(e,t){return void 0===t&&(t=!0),void 0===e?t:!!e};t.stringToHtmlClass=function(e){if("string"==typeof e&&(e=e.split(" ").filter((function(e){return 0!==e.length}))),Array.isArray(e)&&0!==e.length)return e},t.mapInputToChoice=function(e,i){if("string"==typeof e)return(0,t.mapInputToChoice)({value:e,label:e},!1);var r=e;if("choices"in r){if(!i)throw new TypeError("optGroup is not allowed");var o=r,a=o.choices.map((function(e){return(0,t.mapInputToChoice)(e,!1)}));return{id:0,label:(0,n.unwrapStringForRaw)(o.label)||o.value,active:0!==a.length,disabled:!!o.disabled,choices:a}}var c=r;return{id:0,groupId:0,value:c.value,label:c.label||c.value,active:s(c.active),selected:s(c.selected,!1),disabled:s(c.disabled,!1),placeholder:s(c.placeholder,!1),highlighted:!1,labelClass:(0,t.stringToHtmlClass)(c.labelClass),labelDescription:c.labelDescription,customProperties:c.customProperties}}},353:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isHTMLOptgroup=t.isHTMLOption=void 0,t.isHTMLOption=function(e){return"OPTION"===e.tagName},t.isHTMLOptgroup=function(e){return"OPTGROUP"===e.tagName}},705:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.parseDataSetId=t.parseCustomProperties=t.getClassNamesSelector=t.getClassNames=t.diff=t.isEmptyObject=t.cloneObject=t.dispatchEvent=t.sortByScore=t.sortByAlpha=t.unwrapStringForEscaped=t.unwrapStringForRaw=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){return Math.floor(Math.random()*(t-e)+e)},t.generateChars=function(e){return Array.from({length:e},(function(){return(0,t.getRandomNumber)(0,36).toString(36)})).join("")},t.generateId=function(e,i){var n=e.id||e.name&&"".concat(e.name,"-").concat((0,t.generateChars)(2))||(0,t.generateChars)(4);return n=n.replace(/(:|\.|\[|\]|,)/g,""),"".concat(i,"-").concat(n)},t.getType=function(e){return Object.prototype.toString.call(e).slice(8,-1)},t.isType=function(e,i){return null!=i&&(0,t.getType)(i)===e},t.wrap=function(e,t){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)},t.getAdjacentEl=function(e,t,i){void 0===i&&(i=1);for(var n="".concat(i>0?"next":"previous","ElementSibling"),s=e[n];s;){if(s.matches(t))return s;s=s[n]}return s},t.isScrolledIntoView=function(e,t,i){return void 0===i&&(i=1),!!e&&(i>0?t.scrollTop+t.offsetHeight>=e.offsetTop+e.offsetHeight:e.offsetTop>=t.scrollTop)},t.sanitise=function(e){if("string"!=typeof e){if(null==e)return"";if("object"==typeof e){if("raw"in e)return(0,t.sanitise)(e.raw);if("trusted"in e)return e.trusted}return e}return e.replace(/&/g,"&").replace(/>/g,">").replace(/{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0,t.defaultState=0,t.default=function(e,i){return void 0===e&&(e=t.defaultState),void 0===i&&(i={}),"SET_IS_LOADING"===i.type?i.isLoading?e+1:Math.max(0,e-1):e}},771:function(e,t,i){var n=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,s=0,r=t.length;s0},e.prototype.getChoiceById=function(e){return this.activeChoices.find((function(t){return t.id===e}))},e.prototype.getGroupById=function(e){return this.groups.find((function(t){return t.id===e}))},e}();t.default=c},543:function(e,t,i){var n=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,s=0,r=t.length;s0?"treeitem":"option"),Object.assign(A.dataset,{choice:"",id:y,value:b,selectText:n}),O&&(A.dataset.labelClass=(0,s.getClassNames)(O).join(" ")),I&&(A.dataset.labelDescription=I),w?((c=A.classList).add.apply(c,(0,s.getClassNames)(g)),A.dataset.choiceDisabled="",A.setAttribute("aria-disabled","true")):((l=A.classList).add.apply(l,(0,s.getClassNames)(f)),A.dataset.choiceSelectable=""),A},input:function(e,t){var i=e.classNames,n=i.input,r=i.inputCloned,o=Object.assign(document.createElement("input"),{type:"search",className:"".concat((0,s.getClassNames)(n).join(" ")," ").concat((0,s.getClassNames)(r).join(" ")),autocomplete:"off",autocapitalize:"off",spellcheck:!1});return o.setAttribute("role","textbox"),o.setAttribute("aria-autocomplete","list"),t&&o.setAttribute("aria-label",t),o},dropdown:function(e){var t,i,n=e.classNames,r=n.list,o=n.listDropdown,a=document.createElement("div");return(t=a.classList).add.apply(t,(0,s.getClassNames)(r)),(i=a.classList).add.apply(i,(0,s.getClassNames)(o)),a.setAttribute("aria-expanded","false"),a},notice:function(e,i,r){var o=e.allowHTML,a=e.classNames,c=a.item,l=a.itemChoice,h=a.noResults,u=a.noChoices;void 0===r&&(r="");var d=n(n([],(0,s.getClassNames)(c),!0),(0,s.getClassNames)(l),!0);return"no-choices"===r?d.push(u):"no-results"===r&&d.push(h),Object.assign(document.createElement("div"),{innerHTML:(0,t.escapeForTemplate)(o,i),className:d.join(" ")})},option:function(e){var t=e.label,i=e.value,n=e.labelClass,r=e.labelDescription,o=e.customProperties,a=e.active,c=e.disabled,l=(0,s.unwrapStringForRaw)(t),h=new Option(l,i,!1,a);return n&&(h.dataset.labelClass=(0,s.getClassNames)(n).join(" ")),r&&(h.dataset.labelDescription=r),(0,s.isEmptyObject)(o)||(h.dataset.customProperties=JSON.stringify(o)),h.disabled=c,h}};t.default=r},120:(e,t,i)=>{function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===l(e)}i.r(t),i.d(t,{default:()=>K});function s(e){return"string"==typeof e}function r(e){return"number"==typeof e}function o(e){return"object"==typeof e}function a(e){return null!=e}function c(e){return!e.trim().length}function l(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const h=e=>`Missing ${e} property in key`,u=e=>`Property 'weight' in key '${e}' must be a positive integer`,d=Object.prototype.hasOwnProperty;class p{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let i=f(e);t+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function f(e){let t=null,i=null,r=null,o=1,a=null;if(s(e)||n(e))r=e,t=m(e),i=g(e);else{if(!d.call(e,"name"))throw new Error(h("name"));const n=e.name;if(r=n,d.call(e,"weight")&&(o=e.weight,o<=0))throw new Error(u(n));t=m(n),i=g(n),a=e.getFn}return{path:t,id:i,weight:o,src:r,getFn:a}}function m(e){return n(e)?e:e.split(".")}function g(e){return n(e)?e.join("."):e}var v={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx{if(a(e))if(t[u]){const d=e[t[u]];if(!a(d))return;if(u===t.length-1&&(s(d)||r(d)||function(e){return!0===e||!1===e||function(e){return o(e)&&null!==e}(e)&&"[object Boolean]"==l(e)}(d)))i.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(d));else if(n(d)){c=!0;for(let e=0,i=d.length;e{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,s(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();s(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t{let o=t.getFn?t.getFn(e):this.getFn(e,t.path);if(a(o))if(n(o)){let e=[];const t=[{nestedArrIndex:-1,value:o}];for(;t.length;){const{nestedArrIndex:i,value:r}=t.pop();if(a(r))if(s(r)&&!c(r)){let t={v:r,i,n:this.norm.get(r)};e.push(t)}else n(r)&&r.forEach(((e,i)=>{t.push({nestedArrIndex:i,value:e})}))}i.$[r]=e}else if(s(o)&&!c(o)){let e={v:o,n:this.norm.get(o)};i.$[r]=e}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function b(e,t,{getFn:i=v.getFn,fieldNormWeight:n=v.fieldNormWeight}={}){const s=new y({getFn:i,fieldNormWeight:n});return s.setKeys(e.map(f)),s.setSources(t),s.create(),s}function E(e,{errors:t=0,currentLocation:i=0,expectedLocation:n=0,distance:s=v.distance,ignoreLocation:r=v.ignoreLocation}={}){const o=t/e.length;if(r)return o;const a=Math.abs(n-i);return s?o+a/s:a?1:o}const C=32;function S(e){let t={};for(let i=0,n=e.length;i{this.chunks.push({pattern:e,alphabet:S(e),startIndex:t})},h=this.pattern.length;if(h>C){let e=0;const t=h%C,i=h-t;for(;e{const{isMatch:f,score:m,indices:g}=function(e,t,i,{location:n=v.location,distance:s=v.distance,threshold:r=v.threshold,findAllMatches:o=v.findAllMatches,minMatchCharLength:a=v.minMatchCharLength,includeMatches:c=v.includeMatches,ignoreLocation:l=v.ignoreLocation}={}){if(t.length>C)throw new Error("Pattern length exceeds max of 32.");const h=t.length,u=e.length,d=Math.max(0,Math.min(n,u));let p=r,f=d;const m=a>1||c,g=m?Array(u):[];let _;for(;(_=e.indexOf(t,f))>-1;){let e=E(t,{currentLocation:_,expectedLocation:d,distance:s,ignoreLocation:l});if(p=Math.min(e,p),f=_+h,m){let e=0;for(;e=c;r-=1){let o=r-1,a=i[e.charAt(o)];if(m&&(g[o]=+!!a),_[r]=(_[r+1]<<1|1)&a,n&&(_[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),_[r]&O&&(b=E(t,{errors:n,currentLocation:o,expectedLocation:d,distance:s,ignoreLocation:l}),b<=p)){if(p=b,f=o,f<=d)break;c=Math.max(1,2*d-f)}}if(E(t,{errors:n+1,currentLocation:d,expectedLocation:d,distance:s,ignoreLocation:l})>p)break;y=_}const I={isMatch:f>=0,score:Math.max(.001,b)};if(m){const e=function(e=[],t=v.minMatchCharLength){let i=[],n=-1,s=-1,r=0;for(let o=e.length;r=t&&i.push([n,s]),n=-1)}return e[r-1]&&r-n>=t&&i.push([n,r-1]),i}(g,a);e.length?c&&(I.indices=e):I.isMatch=!1}return I}(e,t,d,{location:n+p,distance:s,threshold:r,findAllMatches:o,minMatchCharLength:a,includeMatches:i,ignoreLocation:c});f&&(u=!0),h+=m,f&&g&&(l=[...l,...g])}));let d={isMatch:u,score:u?h/this.chunks.length:1};return u&&i&&(d.indices=l),d}}class I{constructor(e){this.pattern=e}static isMultiMatch(e){return w(e,this.multiRegex)}static isSingleMatch(e){return w(e,this.singleRegex)}search(){}}function w(e,t){const i=e.match(t);return i?i[1]:null}class T extends I{constructor(e,{location:t=v.location,threshold:i=v.threshold,distance:n=v.distance,includeMatches:s=v.includeMatches,findAllMatches:r=v.findAllMatches,minMatchCharLength:o=v.minMatchCharLength,isCaseSensitive:a=v.isCaseSensitive,ignoreLocation:c=v.ignoreLocation}={}){super(e),this._bitapSearch=new O(e,{location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:r,minMatchCharLength:o,isCaseSensitive:a,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class L extends I{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,i=0;const n=[],s=this.pattern.length;for(;(t=e.indexOf(this.pattern,i))>-1;)i=t+s,n.push([t,i-1]);const r=!!n.length;return{isMatch:r,score:r?0:1,indices:n}}}const A=[class extends I{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},L,class extends I{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends I{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends I{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends I{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends I{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},T],M=A.length,N=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,x=new Set([T.type,L.type]);const j=[];function P(e,t){for(let i=0,n=j.length;i!(!e[D]&&!e.$or),k=e=>({[D]:Object.keys(e).map((t=>({[t]:e[t]})))});function H(e,t,{auto:i=!0}={}){const r=e=>{let a=Object.keys(e);const c=(e=>!!e[F])(e);if(!c&&a.length>1&&!R(e))return r(k(e));if((e=>!n(e)&&o(e)&&!R(e))(e)){const n=c?e[F]:a[0],r=c?e.$val:e[n];if(!s(r))throw new Error((e=>`Invalid value for key ${e}`)(n));const o={keyId:g(n),pattern:r};return i&&(o.searcher=P(r,t)),o}let l={children:[],operator:a[0]};return a.forEach((t=>{const i=e[t];n(i)&&i.forEach((e=>{l.children.push(r(e))}))})),l};return R(e)||(e=k(e)),r(e)}function B(e,t){const i=e.matches;t.matches=[],a(i)&&i.forEach((e=>{if(!a(e.indices)||!e.indices.length)return;const{indices:i,value:n}=e;let s={indices:i,value:n};e.key&&(s.key=e.key.src),e.idx>-1&&(s.refIndex=e.idx),t.matches.push(s)}))}function V(e,t){t.score=e.score}class K{constructor(e,t={},i){this.options={...v,...t},this.options.useExtendedSearch,this._keyStore=new p(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof y))throw new Error("Incorrect 'index' type");this._myIndex=t||b(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){a(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const t=[];for(let i=0,n=this._docs.length;i{let i=1;e.matches.forEach((({key:e,norm:n,score:s})=>{const r=e?e.weight:null;i*=Math.pow(0===s&&r?Number.EPSILON:s,(r||1)*(t?1:n))})),e.score=i}))}(l,{ignoreFieldNorm:c}),o&&l.sort(a),r(t)&&t>-1&&(l=l.slice(0,t)),function(e,t,{includeMatches:i=v.includeMatches,includeScore:n=v.includeScore}={}){const s=[];return i&&s.push(B),n&&s.push(V),e.map((e=>{const{idx:i}=e,n={item:t[i],refIndex:i};return s.length&&s.forEach((t=>{t(e,n)})),n}))}(l,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const t=P(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach((({v:e,i,n:s})=>{if(!a(e))return;const{isMatch:r,score:o,indices:c}=t.searchIn(e);r&&n.push({item:e,idx:i,matches:[{score:o,value:e,norm:s,indices:c}]})})),n}_searchLogical(e){const t=H(e,this.options),i=(e,t,n)=>{if(!e.children){const{keyId:i,searcher:s}=e,r=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:s});return r&&r.length?[{idx:n,item:t,matches:r}]:[]}const s=[];for(let r=0,o=e.children.length;r{if(a(e)){let o=i(t,e,n);o.length&&(s[n]||(s[n]={idx:n,item:e,matches:[]},r.push(s[n])),o.forEach((({matches:e})=>{s[n].matches.push(...e)})))}})),r}_searchObjectList(e){const t=P(e,this.options),{keys:i,records:n}=this._myIndex,s=[];return n.forEach((({$:e,i:n})=>{if(!a(e))return;let r=[];i.forEach(((i,n)=>{r.push(...this._findMatches({key:i,value:e[n],searcher:t}))})),r.length&&s.push({idx:n,item:e,matches:r})})),s}_findMatches({key:e,value:t,searcher:i}){if(!a(t))return[];let s=[];if(n(t))t.forEach((({v:t,i:n,n:r})=>{if(!a(t))return;const{isMatch:o,score:c,indices:l}=i.searchIn(t);o&&s.push({score:c,key:e,value:t,idx:n,norm:r,indices:l})}));else{const{v:n,n:r}=t,{isMatch:o,score:a,indices:c}=i.searchIn(n);o&&s.push({score:a,key:e,value:n,norm:r,indices:c})}return s}}K.version="6.6.2",K.createIndex=b,K.parseIndex=function(e,{getFn:t=v.getFn,fieldNormWeight:i=v.fieldNormWeight}={}){const{keys:n,records:s}=e,r=new y({getFn:t,fieldNormWeight:i});return r.setKeys(n),r.setIndexRecords(s),r},K.config=v,K.parseQuery=H,function(...e){j.push(...e)}(class{constructor(e,{isCaseSensitive:t=v.isCaseSensitive,includeMatches:i=v.includeMatches,minMatchCharLength:n=v.minMatchCharLength,ignoreLocation:s=v.ignoreLocation,findAllMatches:r=v.findAllMatches,location:o=v.location,threshold:a=v.threshold,distance:c=v.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:r,ignoreLocation:s,location:o,threshold:a,distance:c},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map((e=>{let i=e.trim().split(N).filter((e=>e&&!!e.trim())),n=[];for(let e=0,s=i.length;e{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function s(e,t,i){return(t=function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function o(e){for(var t=1;th,applyMiddleware:()=>v,bindActionCreators:()=>m,combineReducers:()=>p,compose:()=>g,createStore:()=>u,legacy_createStore:()=>d});var c="function"==typeof Symbol&&Symbol.observable||"@@observable",l=function(){return Math.random().toString(36).substring(7).split("").join(".")},h={INIT:"@@redux/INIT"+l(),REPLACE:"@@redux/REPLACE"+l(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+l()}};function u(e,t,i){var n;if("function"==typeof t&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(a(0));if("function"==typeof t&&void 0===i&&(i=t,t=void 0),void 0!==i){if("function"!=typeof i)throw new Error(a(1));return i(u)(e,t)}if("function"!=typeof e)throw new Error(a(2));var s=e,r=t,o=[],l=o,d=!1;function p(){l===o&&(l=o.slice())}function f(){if(d)throw new Error(a(3));return r}function m(e){if("function"!=typeof e)throw new Error(a(4));if(d)throw new Error(a(5));var t=!0;return p(),l.push(e),function(){if(t){if(d)throw new Error(a(6));t=!1,p();var i=l.indexOf(e);l.splice(i,1),o=null}}}function g(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(a(7));if(void 0===e.type)throw new Error(a(8));if(d)throw new Error(a(9));try{d=!0,r=s(r,e)}finally{d=!1}for(var t=o=l,i=0;i{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};i.d(n,{default:()=>o});var s=i(472),r=i.n(s);i(689),i(493),i(468),i(543);const o=r();window.Choices=n.default})(); \ No newline at end of file diff --git a/public/types/src/scripts/choices.d.ts b/public/types/src/scripts/choices.d.ts index 601b42bd..cea618d1 100644 --- a/public/types/src/scripts/choices.d.ts +++ b/public/types/src/scripts/choices.d.ts @@ -34,6 +34,7 @@ declare class Choices implements ChoicesInterface { _isSelectOneElement: boolean; _isSelectMultipleElement: boolean; _isSelectElement: boolean; + _canAddUserChoices: boolean; _store: Store; _templates: typeof templates; _initialState: State; @@ -151,26 +152,27 @@ declare class Choices implements ChoicesInterface { _getChoiceForEvent(id: number | ChoiceFull): object | undefined; _triggerChange(value: any): void; _selectPlaceholderChoice(placeholderChoice: ChoiceFull): void; - _handleButtonAction(activeItems?: ChoiceFull[], element?: HTMLElement): void; - _handleItemAction(activeItems?: InputChoice[], element?: HTMLElement, hasShiftKey?: boolean): void; - _handleChoiceAction(activeItems?: ChoiceFull[], element?: HTMLElement): void; - _handleBackspace(activeItems?: ChoiceFull[]): void; + _handleButtonAction(items: ChoiceFull[], element?: HTMLElement): void; + _handleItemAction(items: InputChoice[], element?: HTMLElement, hasShiftKey?: boolean): void; + _handleChoiceAction(items: ChoiceFull[], element?: HTMLElement): void; + _handleBackspace(items: ChoiceFull[]): void; + _loadChoices(): void; _startLoading(): void; _stopLoading(): void; _handleLoadingState(setLoading?: boolean): void; _handleSearch(value?: string): void; - _canAddChoice(activeItems: InputChoice[], value: string): Notice; - _canAddItem(activeItems: InputChoice[], value: string): Notice; + _canAddChoice(items: InputChoice[], value: string): Notice; + _canAddItem(items: InputChoice[], value: string): Notice; _searchChoices(value: string): number | null; _addEventListeners(): void; _removeEventListeners(): void; _onKeyDown(event: KeyboardEvent): void; _onKeyUp({ target, keyCode, }: Pick): void; _onSelectKey(event: KeyboardEvent, hasItems: boolean): void; - _onEnterKey(event: KeyboardEvent, activeItems: ChoiceFull[], hasActiveDropdown: boolean): void; + _onEnterKey(event: KeyboardEvent, items: ChoiceFull[], hasActiveDropdown: boolean): void; _onEscapeKey(event: KeyboardEvent, hasActiveDropdown: boolean): void; _onDirectionKey(event: KeyboardEvent, hasActiveDropdown: boolean): void; - _onDeleteKey(event: KeyboardEvent, activeItems: ChoiceFull[], hasFocusedInput: boolean): void; + _onDeleteKey(event: KeyboardEvent, items: ChoiceFull[], hasFocusedInput: boolean): void; _onTouchMove(): void; _onTouchEnd(event: TouchEvent): void; /** @@ -202,7 +204,7 @@ declare class Choices implements ChoicesInterface { _createStructure(): void; _addPredefinedChoices(choices: (ChoiceFull | GroupFull)[], selectFirstOption?: boolean, withEvents?: boolean): void; _addPredefinedItems(items: ChoiceFull[]): void; - _findAndSelectChoiceByValue(value: string): void; + _findAndSelectChoiceByValue(value: string): boolean; _generatePlaceholderValue(): string | null; } export default Choices; diff --git a/public/types/src/scripts/choices.d.ts.map b/public/types/src/scripts/choices.d.ts.map index 3530c050..2aa0c143 100644 --- a/public/types/src/scripts/choices.d.ts.map +++ b/public/types/src/scripts/choices.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../../../../src/scripts/choices.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,aAAa,EACd,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAmB,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAe3C,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,SAAgC,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAyB,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AASnE;;;GAGG;AACH,cAAM,OAAQ,YAAW,gBAAgB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AU,EAAE,QAAQ,CAAC,GAAG,IAAI;IAiCtD,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,GAAG,IAAI;IA+CrD,YAAY,IAAI,IAAI;IAYpB,gBAAgB,CAAC,EAAE,GAAE,WAAW,GAAG,IAAW,GAAG,IAAI;IAuDrD,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,GAAE,OAAc,GAAG,IAAI;IAsB5D,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAcnC,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,GAAE,OAAc,GAAG,IAAI;IA8BhE,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,GAAE,OAAc,GAAG,IAAI;IA+B7D;;;;OAIG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,GAAG,GAAG;IAIjD,gBAAgB,IAAI,IAAI;IA2BxB,eAAe,IAAI,IAAI;IAgDvB,gBAAgB,IAAI,IAAI;IAgDxB,qBAAqB,CACnB,OAAO,EAAE,CAAC,UAAU,GAAG,SAAS,CAAC,EAAE,EACnC,iBAAiB,GAAE,OAAe,EAClC,UAAU,GAAE,OAAc,GACzB,IAAI;IAuCP,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,IAAI;IAM9C,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAgBnD,yBAAyB,IAAI,MAAM,GAAG,IAAI;CA6B3C;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/lib/utils.d.ts b/public/types/src/scripts/lib/utils.d.ts index a28d5f40..c97daeaf 100644 --- a/public/types/src/scripts/lib/utils.d.ts +++ b/public/types/src/scripts/lib/utils.d.ts @@ -21,7 +21,6 @@ export declare const unwrapStringForEscaped: (s?: StringUntrusted | StringPreEsc export declare const sortByAlpha: ({ value, label }: RecordToCompare, { value: value2, label: label2 }: RecordToCompare) => number; export declare const sortByScore: (a: Pick, b: Pick) => number; export declare const dispatchEvent: (element: HTMLElement, type: EventType, customArgs?: object | null) => boolean; -export declare const existsInArray: (array: any[], value: string, key?: string) => boolean; export declare const cloneObject: (obj: T) => T; export declare const isEmptyObject: (obj: object | undefined | null) => boolean; /** diff --git a/public/types/src/scripts/lib/utils.d.ts.map b/public/types/src/scripts/lib/utils.d.ts.map index cafefa33..77d4cb3e 100644 --- a/public/types/src/scripts/lib/utils.d.ts.map +++ b/public/types/src/scripts/lib/utils.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/lib/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,eAAO,MAAM,eAAe,QAAS,MAAM,OAAO,MAAM,KAAG,MACZ,CAAC;AAEhD,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,MAC6B,CAAC;AAE7E,eAAO,MAAM,UAAU,YACZ,gBAAgB,GAAG,iBAAiB,UACrC,MAAM,KACb,MASF,CAAC;AAEF,eAAO,MAAM,OAAO,QAAS,GAAG,KAAG,MACe,CAAC;AAEnD,eAAO,MAAM,MAAM,SAAU,MAAM,OAAO,GAAG,KAAG,OACY,CAAC;AAE7D,eAAO,MAAM,IAAI,YACN,WAAW,YACX,WAAW,KACnB,WAUF,CAAC;AAEF,eAAO,MAAM,aAAa,YACf,OAAO,YACN,MAAM,yBAEf,OAYF,CAAC;AAEF,eAAO,MAAM,kBAAkB,YACpB,WAAW,UACZ,WAAW,yBAElB,OAkBF,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,CAAC,SACjB,CAAC,GA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