text: import{r as t,c as e,h as i,H as n,g as r}from"./p-e501253c.js";import{c as s,g as o}from"./p-eab67c09.js";import{c as a}from"./p-c2089e63.js";const c=o(s((function(t){
  /*! @bkkr/choices v10.0.1-beta.26 | © 2021 Imre Bekker | https://github.com/bkkr-team/bkkr-choices#readme */
  var e;window,e=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/public/assets/scripts/",i(i.s=7)}([function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(1);e.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",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"},e.DEFAULT_CONFIG={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,duplicateItemsAllowed:!0,inline:!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,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(t){return'Press Enter to add <b>"'+n.sanitise(t)+'"</b>'},maxItemText:function(t){return"Only "+t+" values can be added"},valueComparer:function(t,e){return t===e},fuseOptions:{includeScore:!0},callbackOnInit:null,callbackOnCreateTemplates:null,classNames:e.DEFAULT_CLASSNAMES},e.EVENTS={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice",unhighlightItem:"unhighlightItem"},e.ACTION_TYPES={ADD_CHOICE:"ADD_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM",CLEAR_ALL:"CLEAR_ALL",RESET_TO:"RESET_TO",SET_IS_LOADING:"SET_IS_LOADING"},e.KEY_CODES={BACK_KEY:"Backspace",DELETE_KEY:"Delete",ENTER_KEY:"Enter",A_KEY:"KeyA",ESC_KEY:"Escape",UP_KEY:"ArrowUp",DOWN_KEY:"ArrowDown",LEFT_KEY:"ArrowLeft",RIGHT_KEY:"ArrowRight",PAGE_UP_KEY:"PageUp",PAGE_DOWN_KEY:"PageDown"},e.TEXT_TYPE="text",e.SELECT_ONE_TYPE="select-one",e.SELECT_MULTIPLE_TYPE="select-multiple",e.SCROLLING_SPEED=4},function(t,e){var i;Object.defineProperty(e,"__esModule",{value:!0}),e.getRandomNumber=function(t,e){return Math.floor(Math.random()*(e-t)+t)},e.generateChars=function(t){return Array.from({length:t},(function(){return e.getRandomNumber(0,36).toString(36)})).join("")},e.generateId=function(t,i){var n=t.id||t.name&&t.name+"-"+e.generateChars(2)||e.generateChars(4);return i+"-"+n.replace(/(:|\.|\[|\]|,)/g,"")},e.getType=function(t){return Object.prototype.toString.call(t).slice(8,-1)},e.isType=function(t,i){return null!=i&&e.getType(i)===t},e.wrap=function(t,e){return void 0===e&&(e=document.createElement("div")),t.nextSibling?t.parentNode&&t.parentNode.insertBefore(e,t.nextSibling):t.parentNode&&t.parentNode.appendChild(e),e.appendChild(t)},e.getAdjacentEl=function(t,e,i){void 0===i&&(i=1);for(var n=(i>0?"next":"previous")+"ElementSibling",r=t[n];r;){if(r.matches(e))return r;r=r[n]}return r},e.isScrolledIntoView=function(t,e,i){return void 0===i&&(i=1),!!t&&(i>0?e.scrollTop+e.offsetHeight>=t.offsetTop+t.offsetHeight:t.offsetTop>=e.scrollTop)},e.sanitise=function(t){return"string"!=typeof t?t:t.replace(/&/g,"&amp;").replace(/>/g,"&rt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},e.strToEl=(i=document.createElement("div"),function(t){var e=t.trim();i.innerHTML=e;for(var n=i.children[0];i.firstChild;)i.removeChild(i.firstChild);return n}),e.sortByAlpha=function(t,e){var i=t.label,n=e.label;return(void 0===i?t.value:i).localeCompare(void 0===n?e.value:n,[],{sensitivity:"base",ignorePunctuation:!0,numeric:!0})},e.sortByScore=function(t,e){var i=t.score,n=e.score;return(void 0===i?0:i)-(void 0===n?0:n)},e.dispatchEvent=function(t,e,i){void 0===i&&(i=null);var n=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0});return t.dispatchEvent(n)},e.existsInArray=function(t,e,i){return void 0===i&&(i="value"),t.some((function(t){return"string"==typeof e?t[i]===e.trim():t[i]===e}))},e.cloneObject=function(t){return JSON.parse(JSON.stringify(t))},e.diff=function(t,e){var i=Object.keys(t).sort(),n=Object.keys(e).sort();return i.filter((function(t){return n.indexOf(t)<0}))}},function(t,e,i){(function(t,n){var r,s=i(6);r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:n;var o=Object(s.a)(r);e.a=o}).call(this,i(12),i(13)(t))},function(t,e,i){i.r(e),i.d(e,"__DO_NOT_USE__ActionTypes",(function(){return s})),i.d(e,"applyMiddleware",(function(){return b})),i.d(e,"bindActionCreators",(function(){return l})),i.d(e,"combineReducers",(function(){return h})),i.d(e,"compose",(function(){return p})),i.d(e,"createStore",(function(){return a}));var n=i(2),r=function(){return Math.random().toString(36).substring(7).split("").join(".")},s={INIT:"@@redux/INIT"+r(),REPLACE:"@@redux/REPLACE"+r(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+r()}};function o(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function a(t,e,i){var r;if("function"==typeof e&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof e&&void 0===i&&(i=e,e=void 0),void 0!==i){if("function"!=typeof i)throw new Error("Expected the enhancer to be a function.");return i(a)(t,e)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var c=t,h=e,u=[],l=u,f=!1;function d(){l===u&&(l=u.slice())}function v(){if(f)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return h}function p(t){if("function"!=typeof t)throw new Error("Expected the listener to be a function.");if(f)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var e=!0;return d(),l.push(t),function(){if(e){if(f)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");e=!1,d();var i=l.indexOf(t);l.splice(i,1)}}}function b(t){if(!o(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(f)throw new Error("Reducers may not dispatch actions.");try{f=!0,h=c(h,t)}finally{f=!1}for(var e=u=l,i=0;i<e.length;i++)(0,e[i])();return t}function m(t){if("function"!=typeof t)throw new Error("Expected the nextReducer to be a function.");c=t,b({type:s.REPLACE})}function g(){var t,e=p;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new TypeError("Expected the observer to be an object.");function i(){t.next&&t.next(v())}return i(),{unsubscribe:e(i)}}})[n.a]=function(){return this},t}return b({type:s.INIT}),(r={dispatch:b,subscribe:p,getState:v,replaceReducer:m})[n.a]=g,r}function c(t,e){var i=e&&e.type;return"Given "+(i&&'action "'+String(i)+'"'||"an action")+', reducer "'+t+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function h(t){for(var e=Object.keys(t),i={},n=0;n<e.length;n++){var r=e[n];"function"==typeof t[r]&&(i[r]=t[r])}var o,a=Object.keys(i);try{!function(t){Object.keys(t).forEach((function(e){var i=t[e];if(void 0===i(void 0,{type:s.INIT}))throw new Error('Reducer "'+e+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===i(void 0,{type:s.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+e+"\" returned undefined when probed with a random type. Don't try to handle "+s.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(i)}catch(t){o=t}return function(t,e){if(void 0===t&&(t={}),o)throw o;for(var n=!1,r={},s=0;s<a.length;s++){var h=a[s],u=t[h],l=(0,i[h])(u,e);if(void 0===l){var f=c(h,e);throw new Error(f)}r[h]=l,n=n||l!==u}return n?r:t}}function u(t,e){return function(){return e(t.apply(this,arguments))}}function l(t,e){if("function"==typeof t)return u(t,e);if("object"!=typeof t||null===t)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===t?"null":typeof t)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var i={};for(var n in t){var r=t[n];"function"==typeof r&&(i[n]=u(r,e))}return i}function f(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function d(t,e){var i=Object.keys(t);return Object.getOwnPropertySymbols&&i.push.apply(i,Object.getOwnPropertySymbols(t)),e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i}function v(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?d(i,!0).forEach((function(e){f(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):d(i).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function p(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function b(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return function(){var i=t.apply(void 0,arguments),n=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},r={getState:i.getState,dispatch:function(){return n.apply(void 0,arguments)}},s=e.map((function(t){return t(r)}));return v({},i,{dispatch:n=p.apply(void 0,s)(i.dispatch)})}}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(3),s=n(i(14)),o=n(i(15)),a=n(i(16)),c=n(i(17)),h=i(1);e.defaultState={groups:[],items:[],choices:[],loading:!1};var u=r.combineReducers({items:s.default,groups:o.default,choices:a.default,loading:c.default});e.default=function(t,i){var n=t;if("CLEAR_ALL"===i.type)n=e.defaultState;else if("RESET_TO"===i.type)return h.cloneObject(i.state);return u(n,i)}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(1),r=function(){function t(t){var e=t.element,i=t.classNames;if(this.element=e,this.classNames=i,!(e instanceof HTMLInputElement||e instanceof HTMLSelectElement))throw new TypeError("Invalid element passed");this.isDisabled=!1}return Object.defineProperty(t.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dir",{get:function(){return this.element.dir},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.element.value},set:function(t){this.element.value=t},enumerable:!0,configurable:!0}),t.prototype.conceal=function(){this.element.classList.add(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")},t.prototype.reveal=function(){this.element.classList.remove(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},t.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},t.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},t.prototype.triggerEvent=function(t,e){n.dispatchEvent(this.element,t,e)},t}();e.default=r},function(t,e,i){function n(t){var e,i=t.Symbol;return"function"==typeof i?i.observable?e=i.observable:(e=i("observable"),i.observable=e):e="@@observable",e}i.d(e,"a",(function(){return n}))},function(t,e,i){t.exports=i(8)},function(t,e,i){var n=this&&this.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,r++)n[r]=s[o];return n},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=r(i(9)),o=r(i(10)),a=r(i(11)),c=i(18),h=i(0),u=r(i(25)),l=i(26),f=i(27),d=i(28),v=i(29),p=i(1),b=i(4),m="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,g={},y=function(){function t(e,i){var r=this;void 0===e&&(e="[data-choice]"),void 0===i&&(i={}),this.config=o.default.all([h.DEFAULT_CONFIG,t.defaults.options,i],{arrayMerge:function(t,e){return n(e)}});var s=p.diff(this.config,h.DEFAULT_CONFIG);s.length&&console.warn("Unknown config option(s) passed",s.join(", "));var u="string"==typeof e?document.querySelector(e):e;if(!(u instanceof HTMLInputElement||u instanceof HTMLSelectElement))throw TypeError("Expected one of the following types text|select-one|select-multiple");if(this._isTextElement=u.type===h.TEXT_TYPE,this._isSelectOneElement=u.type===h.SELECT_ONE_TYPE,this._isSelectMultipleElement=u.type===h.SELECT_MULTIPLE_TYPE,this._isSelectElement=this._isSelectOneElement||this._isSelectMultipleElement,this.config.searchEnabled=this._isSelectMultipleElement||this.config.searchEnabled,["auto","always"].includes(""+this.config.renderSelectedChoices)||(this.config.renderSelectedChoices="auto"),i.addItemFilter&&"function"!=typeof i.addItemFilter){var l=i.addItemFilter instanceof RegExp?i.addItemFilter:new RegExp(i.addItemFilter);this.config.addItemFilter=l.test.bind(l)}if(this.passedElement=this._isTextElement?new c.WrappedInput({element:u,classNames:this.config.classNames,delimiter:this.config.delimiter}):new c.WrappedSelect({element:u,classNames:this.config.classNames,template:function(t){return r._templates.option(t)}}),this.initialised=!1,this._store=new a.default,this._initialState=b.defaultState,this._currentState=b.defaultState,this._prevState=b.defaultState,this._currentValue="",this._canSearch=!!this.config.searchEnabled,this._isScrollingOnIe=!1,this._highlightPosition=0,this._wasTap=!0,this._placeholderValue=this._generatePlaceholderValue(),this._baseId=p.generateId(this.passedElement.element,"choices-"),this._direction=this.passedElement.dir,!this._direction){var f=window.getComputedStyle(this.passedElement.element).direction;f!==window.getComputedStyle(document.documentElement).direction&&(this._direction=f)}if(this._idNames={itemChoice:"item-choice"},this._isSelectElement&&(this._presetGroups=this.passedElement.optionGroups,this._presetOptions=this.passedElement.options),this._presetChoices=this.config.choices,this._presetItems=this.config.items,this.passedElement.value&&this._isTextElement){var d=this.passedElement.value.split(this.config.delimiter);this._presetItems=this._presetItems.concat(d)}if(this.passedElement.options&&this.passedElement.options.forEach((function(t){r._presetChoices.push({value:t.value,label:t.innerHTML,selected:!!t.selected,disabled:t.disabled||t.parentNode.disabled,placeholder:""===t.value||t.hasAttribute("placeholder"),customProperties:t.dataset["custom-properties"]})})),this._render=this._render.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onClick=this._onClick.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseOver=this._onMouseOver.bind(this),this._onFormReset=this._onFormReset.bind(this),this._onSelectKey=this._onSelectKey.bind(this),this._onEnterKey=this._onEnterKey.bind(this),this._onEscapeKey=this._onEscapeKey.bind(this),this._onDirectionKey=this._onDirectionKey.bind(this),this._onDeleteKey=this._onDeleteKey.bind(this),this.passedElement.isActive)return this.config.silent||console.warn("Trying to initialise Choices on element already initialised",{element:e}),void(this.initialised=!0);this.init()}return Object.defineProperty(t,"defaults",{get:function(){return Object.preventExtensions({get options(){return g},get templates(){return u.default}})},enumerable:!0,configurable:!0}),t.prototype.init=function(){if(!this.initialised){this._createTemplates(),this._createElements(),this._createStructure(),this._store.subscribe(this._render),this._render(),this._addEventListeners(),(!this.config.addItems||this.passedElement.element.hasAttribute("disabled"))&&this.disable(),this.initialised=!0;var t=this.config.callbackOnInit;t&&"function"==typeof t&&t.call(this)}},t.prototype.destroy=function(){this.initialised&&(this._removeEventListeners(),this.passedElement.reveal(),this.containerOuter.unwrap(this.passedElement.element),this.clearStore(),this._isSelectElement&&(this.passedElement.options=this._presetOptions),this._templates=u.default,this.initialised=!1)},t.prototype.enable=function(){return this.passedElement.isDisabled&&this.passedElement.enable(),this.containerOuter.isDisabled&&(this._addEventListeners(),this.input.enable(),this.containerOuter.enable()),this},t.prototype.disable=function(){return this.passedElement.isDisabled||this.passedElement.disable(),this.containerOuter.isDisabled||(this._removeEventListeners(),this.input.disable(),this.containerOuter.disable()),this},t.prototype.highlightItem=function(t,e){if(void 0===e&&(e=!0),!t||!t.id)return this;var i=t.id,n=t.groupId,r=void 0===n?-1:n,s=t.value,o=void 0===s?"":s,a=t.label,c=void 0===a?"":a,u=r>=0?this._store.getGroupById(r):null;return this._store.dispatch(f.highlightItem(i,!0)),e&&this.passedElement.triggerEvent(h.EVENTS.highlightItem,{id:i,value:o,label:c,groupValue:u&&u.value?u.value:null}),this},t.prototype.unhighlightItem=function(t){if(!t||!t.id)return this;var e=t.id,i=t.groupId,n=void 0===i?-1:i,r=t.value,s=void 0===r?"":r,o=t.label,a=void 0===o?"":o,c=n>=0?this._store.getGroupById(n):null;return this._store.dispatch(f.highlightItem(e,!1)),this.passedElement.triggerEvent(h.EVENTS.highlightItem,{id:e,value:s,label:a,groupValue:c&&c.value?c.value:null}),this},t.prototype.highlightAll=function(){var t=this;return this._store.items.forEach((function(e){return t.highlightItem(e)})),this},t.prototype.unhighlightAll=function(){var t=this;return this._store.items.forEach((function(e){return t.unhighlightItem(e)})),this},t.prototype.removeActiveItemsByValue=function(t){var e=this;return this._store.activeItems.filter((function(e){return e.value===t})).forEach((function(t){return e._removeItem(t)})),this},t.prototype.removeActiveItems=function(t){var e=this;return this._store.activeItems.filter((function(e){return e.id!==t})).forEach((function(t){return e._removeItem(t)})),this},t.prototype.removeHighlightedItems=function(t){var e=this;return void 0===t&&(t=!1),this._store.highlightedActiveItems.forEach((function(i){e._removeItem(i),t&&e._triggerChange(i.value)})),this},t.prototype.showDropdown=function(t){var e=this;return this.dropdown.isActive||this.config.inline||requestAnimationFrame((function(){e.dropdown.show(),e.containerOuter.open(e.dropdown.distanceFromTopWindow),!t&&e._canSearch&&e.input.focus(),e.passedElement.triggerEvent(h.EVENTS.showDropdown,{})})),this},t.prototype.hideDropdown=function(t){var e=this;return this.dropdown.isActive?(requestAnimationFrame((function(){e.dropdown.hide(),e.containerOuter.close(),!t&&e._canSearch&&(e.input.removeActiveDescendant(),e.input.blur()),e.passedElement.triggerEvent(h.EVENTS.hideDropdown,{})})),this):this},t.prototype.getValue=function(t){void 0===t&&(t=!1);var e=this._store.activeItems.reduce((function(e,i){return e.push(t?i.value:i),e}),[]);return this._isSelectOneElement?e[0]:e},t.prototype.setValue=function(t){var e=this;return this.initialised?(t.forEach((function(t){return e._setChoiceOrItem(t)})),this):this},t.prototype.setChoiceByValue=function(t){var e=this;return!this.initialised||this._isTextElement||(Array.isArray(t)?t:[t]).forEach((function(t){return e._findAndSelectChoiceByValue(t)})),this},t.prototype.setChoices=function(t,e,i,n){var r=this;if(void 0===t&&(t=[]),void 0===e&&(e="value"),void 0===i&&(i="label"),void 0===n&&(n=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof e||!e)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(n&&this.clearChoices(),"function"==typeof t){var s=t(this);if("function"==typeof Promise&&s instanceof Promise)return new Promise((function(t){return requestAnimationFrame(t)})).then((function(){return r._handleLoadingState(!0)})).then((function(){return s})).then((function(t){return r.setChoices(t,e,i,n)})).catch((function(t){r.config.silent||console.error(t)})).then((function(){return r._handleLoadingState(!1)})).then((function(){return r}));if(!Array.isArray(s))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: "+typeof s);return this.setChoices(s,e,i,!1)}if(!Array.isArray(t))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),t.forEach((function(t){t.choices?r._addGroup({id:t.id?parseInt(""+t.id,10):null,group:t,valueKey:e,labelKey:i}):r._addChoice({value:t[e],label:t[i],isSelected:!!t.selected,isDisabled:!!t.disabled,placeholder:!!t.placeholder,customProperties:t.customProperties})})),this._stopLoading(),this},t.prototype.clearChoices=function(){return this._store.dispatch(l.clearChoices()),this},t.prototype.clearStore=function(){return this._store.dispatch(v.clearAll()),this},t.prototype.clearInput=function(){return this.input.clear(!this._isSelectElement),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch(l.activateChoices(!0))),this},t.prototype._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var t=this._currentState.items!==this._prevState.items;(this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items)&&(this._isSelectElement&&this._renderChoices(),t&&this._renderItems(),this._prevState=this._currentState)}},t.prototype._renderChoices=function(){var t=this,e=this._store,i=e.activeGroups,n=e.activeChoices,r=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame((function(){return t.choiceList.scrollToTop()})),i.length>=1&&!this._isSearching){var s=n.filter((function(t){return!0===t.placeholder&&-1===t.groupId}));s.length>=1&&(r=this._createChoicesFragment(s,r)),r=this._createGroupsFragment(i,n,r)}else n.length>=1&&(r=this._createChoicesFragment(n,r));if(r.childNodes&&r.childNodes.length>0){var o=this._canAddItem(this._store.activeItems,this.input.value);if(o.response)this.choiceList.append(r),this._highlightChoice();else{var a=this._getTemplate("notice",o.notice);this.choiceList.append(a)}}else{var c=void 0;a=void 0,this._isSearching?(a="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,c=this._getTemplate("notice",a,"no-results")):(a="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,c=this._getTemplate("notice",a,"no-choices")),this.choiceList.append(c)}},t.prototype._renderItems=function(){var t=this._store.activeItems||[];this.itemList.clear();var e=this._createItemsFragment(t);e.childNodes&&this.itemList.append(e)},t.prototype._createGroupsFragment=function(t,e,i){var n=this;return void 0===i&&(i=document.createDocumentFragment()),this.config.shouldSort&&t.sort(this.config.sorter),t.forEach((function(t){var r=function(t){return e.filter((function(e){return n._isSelectOneElement?e.groupId===t.id:e.groupId===t.id&&("always"===n.config.renderSelectedChoices||!e.selected)}))}(t);if(r.length>=1){var s=n._getTemplate("choiceGroup",t);i.appendChild(s),n._createChoicesFragment(r,i,!0)}})),i},t.prototype._createChoicesFragment=function(t,e,i){var r=this;void 0===e&&(e=document.createDocumentFragment()),void 0===i&&(i=!1);var s=this.config,o=s.renderSelectedChoices,a=s.searchResultLimit,c=s.renderChoiceLimit,h=this._isSearching?p.sortByScore:this.config.sorter,u=function(t){if("auto"!==o||r._isSelectOneElement||!t.selected){var i=r._getTemplate("choice",t,r.config.itemSelectText,r.config.inline);e.appendChild(i)}},l=t;"auto"!==o||this._isSelectOneElement||(l=t.filter((function(t){return!t.selected})));var f=l.reduce((function(t,e){return e.placeholder?t.placeholderChoices.push(e):t.normalChoices.push(e),t}),{placeholderChoices:[],normalChoices:[]}),d=f.placeholderChoices,v=f.normalChoices;(this.config.shouldSort||this._isSearching)&&v.sort(h);var b=l.length,m=this._isSelectOneElement?n(d,v):v;this._isSearching?b=a:c&&c>0&&!i&&(b=c);for(var g=0;g<b;g+=1)m[g]&&u(m[g]);return e},t.prototype._createItemsFragment=function(t,e){var i=this;void 0===e&&(e=document.createDocumentFragment());var n=this.config,r=n.removeItemButton;return n.shouldSortItems&&!this._isSelectOneElement&&t.sort(n.sorter),this._isTextElement?this.passedElement.value=t.map((function(t){return t.value})).join(this.config.delimiter):this.passedElement.options=t,t.forEach((function(t){var n=i._getTemplate("item",t,r);e.appendChild(n)})),e},t.prototype._triggerChange=function(t){null!=t&&this.passedElement.triggerEvent(h.EVENTS.change,{value:t})},t.prototype._selectPlaceholderChoice=function(t){this._addItem({value:t.value,label:t.label,choiceId:t.id,groupId:t.groupId,placeholder:t.placeholder}),this._triggerChange(t.value)},t.prototype._handleButtonAction=function(t,e){if(t&&e&&this.config.removeItems&&this.config.removeItemButton){var i=e.parentNode&&e.parentNode.dataset.id,n=i&&t.find((function(t){return t.id===parseInt(i,10)}));n&&(this._removeItem(n),this._triggerChange(n.value),this._isSelectElement&&this._store.placeholderChoice&&this._selectPlaceholderChoice(this._store.placeholderChoice))}},t.prototype._handleItemAction=function(t,e,i){var n=this;if(void 0===i&&(i=!1),t&&e&&this.config.removeItems&&!this._isSelectElement){var r=e.dataset.id;t.forEach((function(t){t.id!==parseInt(""+r,10)||t.highlighted?!i&&t.highlighted&&n.unhighlightItem(t):n.highlightItem(t)})),this.input.focus()}},t.prototype._handleChoiceAction=function(t,e){var i=this;if(t&&e){var n=e.dataset.id,r=n&&this._store.getChoiceById(n);if(r&&!r.disabled){var s=this.dropdown.isActive;r.keyCode=t[0]&&t[0].keyCode?t[0].keyCode:void 0,this.passedElement.triggerEvent(h.EVENTS.choice,{choice:r}),r.selected?(this._store.activeItems.filter((function(t){return t.choiceId===r.id})).forEach((function(t){return i._removeItem(t)})),this._triggerChange(r.value)):this._canAddItem(t,r.value).response&&(this._addItem({value:r.value,label:r.label,choiceId:r.id,groupId:r.groupId,customProperties:r.customProperties,placeholder:r.placeholder,keyCode:r.keyCode}),this._triggerChange(r.value)),this.clearInput(),s&&this._isSelectOneElement&&this.hideDropdown(!0)}}},t.prototype._handleBackspace=function(t){if(this.config.removeItems&&t){var e=t[t.length-1],i=t.some((function(t){return t.highlighted}));this.config.editItems&&!i&&e?(this.input.value=e.value,this.input.setWidth(),this._removeItem(e),this._triggerChange(e.value)):this.removeHighlightedItems(!0)}},t.prototype._startLoading=function(){this._store.dispatch(v.setIsLoading(!0))},t.prototype._stopLoading=function(){this._store.dispatch(v.setIsLoading(!1))},t.prototype._handleLoadingState=function(t){void 0===t&&(t=!0);var e=this.itemList.getChild("."+this.config.classNames.placeholder);t?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?e?e.innerHTML=this.config.loadingText:(e=this._getTemplate("placeholder",this.config.loadingText))&&this.itemList.append(e):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?e&&(e.innerHTML=this._placeholderValue||""):this.input.placeholder=this._placeholderValue||"")},t.prototype._handleSearch=function(t){if(t&&this.input.isFocussed){var e=this.config,i=e.searchFloor,n=e.searchChoices,r=this._store.choices.some((function(t){return!t.active}));if(t&&t.length>=i){var s=n?this._searchChoices(t):0;this.passedElement.triggerEvent(h.EVENTS.search,{value:t,resultCount:s})}else r&&(this._isSearching=!1,this._store.dispatch(l.activateChoices(!0)))}},t.prototype._canAddItem=function(t,e){var i=!0,n="function"==typeof this.config.addItemText?this.config.addItemText(e):this.config.addItemText;if(!this._isSelectOneElement){var r=p.existsInArray(t,e);this.config.maxItemCount>0&&this.config.maxItemCount<=t.length&&(i=!1,n="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&r&&i&&(i=!1,n="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText(e):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&i&&"function"==typeof this.config.addItemFilter&&!this.config.addItemFilter(e)&&(i=!1,n="function"==typeof this.config.customAddItemText?this.config.customAddItemText(e):this.config.customAddItemText)}return{response:i,notice:n}},t.prototype._searchChoices=function(t){var e="string"==typeof t?t.trim():t,i="string"==typeof this._currentValue?this._currentValue.trim():this._currentValue;if(e.length<1&&e===i+" ")return 0;var r=this._store.searchableChoices,o=e,a=n(this.config.searchFields),c=Object.assign(this.config.fuseOptions,{keys:a,includeMatches:!0}),h=new s.default(r,c).search(o);return this._currentValue=e,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch(l.filterChoices(h)),h.length},t.prototype._addEventListeners=function(){var t=document.documentElement;t.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),t.addEventListener("click",this._onClick,{passive:!0}),t.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()},t.prototype._removeEventListeners=function(){var t=document.documentElement;t.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),t.removeEventListener("click",this._onClick),t.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()},t.prototype._onKeyDown=function(t){var e=t.code,i=this._store.activeItems,n=this.input.isFocussed,r=this.dropdown.isActive,s=this.itemList.hasChildren();switch(e){case h.KEY_CODES.A_KEY:return this._onSelectKey(t,s);case h.KEY_CODES.ENTER_KEY:return this._onEnterKey(t,i,r);case h.KEY_CODES.ESC_KEY:return this._onEscapeKey(r);case h.KEY_CODES.UP_KEY:case h.KEY_CODES.PAGE_UP_KEY:case h.KEY_CODES.DOWN_KEY:case h.KEY_CODES.PAGE_DOWN_KEY:return this._onDirectionKey(t,r);case h.KEY_CODES.DELETE_KEY:case h.KEY_CODES.BACK_KEY:return this._onDeleteKey(t,i,n)}},t.prototype._onKeyUp=function(t){var e=t.target,i=t.code,n=this.input.value,r=this._canAddItem(this._store.activeItems,n),s=h.KEY_CODES.BACK_KEY,o=h.KEY_CODES.DELETE_KEY;if(this._isTextElement)if(r.notice&&n){var a=this._getTemplate("notice",r.notice);this.dropdown.element.innerHTML=a.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0);else i!==s&&i!==o||!e||e.value||this._isTextElement||!this._isSearching?this._canSearch&&r.response&&this._handleSearch(this.input.value):(this._isSearching=!1,this._store.dispatch(l.activateChoices(!0)));this._canSearch=this.config.searchEnabled},t.prototype._onSelectKey=function(t,e){(t.ctrlKey||t.metaKey)&&e&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},t.prototype._onEnterKey=function(t,e,i){var n=t.target,r=h.KEY_CODES.ENTER_KEY,s=n&&n.hasAttribute("data-button");if(this._isTextElement&&n&&n.value){var o=this.input.value;this._canAddItem(e,o).response&&(this.hideDropdown(!0),this._addItem({value:o}),this._triggerChange(o),this.clearInput())}if(s&&(this._handleButtonAction(e,n),t.preventDefault()),i){var a=this.dropdown.getChild("."+this.config.classNames.highlightedState);a&&(e[0]&&(e[0].keyCode=r),this._handleChoiceAction(e,a)),t.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),t.preventDefault())},t.prototype._onEscapeKey=function(t){t&&(this.hideDropdown(!0),this.containerOuter.focus())},t.prototype._onDirectionKey=function(t,e){var i=t.code,n=t.metaKey,r=h.KEY_CODES.DOWN_KEY,s=h.KEY_CODES.PAGE_UP_KEY,o=h.KEY_CODES.PAGE_DOWN_KEY;if(e||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var a=i===r||i===o?1:-1,c="[data-choice-selectable]",u=void 0;if(n||i===o||i===s)u=this.dropdown.element.querySelector(a>0?"[data-choice-selectable]:last-of-type":c);else{var l=this.dropdown.element.querySelector("."+this.config.classNames.highlightedState);u=l?p.getAdjacentEl(l,c,a):this.dropdown.element.querySelector(c)}u&&(p.isScrolledIntoView(u,this.choiceList.element,a)||this.choiceList.scrollToChildElement(u,a),this._highlightChoice(u)),t.preventDefault()}},t.prototype._onDeleteKey=function(t,e,i){this._isSelectOneElement||t.target.value||!i||(this._handleBackspace(e),t.preventDefault())},t.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},t.prototype._onTouchEnd=function(t){var e=(t||t.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(e)&&((e===this.containerOuter.element||e===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),t.stopPropagation()),this._wasTap=!0},t.prototype._onMouseDown=function(t){var e=t.target;if(e instanceof HTMLElement){if(m&&this.choiceList.element.contains(e)){var i=this.choiceList.element.firstElementChild;this._isScrollingOnIe="ltr"===this._direction?t.offsetX>=i.offsetWidth:t.offsetX<i.offsetLeft}if(e!==this.input.element){var n=e.closest("[data-button],[data-item],[data-choice]");if(n instanceof HTMLElement){var r=t.shiftKey,s=this._store.activeItems,o=n.dataset;"button"in o?this._handleButtonAction(s,n):"item"in o?this._handleItemAction(s,n,r):"choice"in o&&this._handleChoiceAction(s,n)}t.preventDefault()}}},t.prototype._onMouseOver=function(t){var e=t.target;e instanceof HTMLElement&&"choice"in e.dataset&&this._highlightChoice(e)},t.prototype._onClick=function(t){var e=t.target;this.containerOuter.element.contains(e)?this.dropdown.isActive||this.containerOuter.isDisabled?this._isSelectOneElement&&e!==this.input.element&&!this.dropdown.element.contains(e)&&this.hideDropdown():this._isTextElement?document.activeElement!==this.input.element&&this.input.focus():(this.showDropdown(),this.containerOuter.focus()):(this._store.highlightedActiveItems.length>0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},t.prototype._onFocus=function(t){var e,i=this,n=t.target;n&&this.containerOuter.element.contains(n)&&((e={})[h.TEXT_TYPE]=function(){n===i.input.element&&i.containerOuter.addFocusState()},e[h.SELECT_ONE_TYPE]=function(){i.containerOuter.addFocusState(),n===i.input.element&&i.showDropdown(!0)},e[h.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.showDropdown(!0),i.containerOuter.addFocusState())},e)[this.passedElement.element.type]()},t.prototype._onBlur=function(t){var e,i=this,n=t.target;if(n&&this.containerOuter.element.contains(n)&&!this._isScrollingOnIe){var r=this._store.activeItems.some((function(t){return t.highlighted}));((e={})[h.TEXT_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),r&&i.unhighlightAll(),i.hideDropdown(!0))},e[h.SELECT_ONE_TYPE]=function(){i.containerOuter.removeFocusState(),(n===i.input.element||n===i.containerOuter.element&&!i._canSearch)&&i.hideDropdown(!0)},e[h.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),i.hideDropdown(!0),r&&i.unhighlightAll())},e)[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},t.prototype._onFormReset=function(){this._store.dispatch(v.resetTo(this._initialState))},t.prototype._highlightChoice=function(t){var e=this;void 0===t&&(t=null);var i=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(i.length){var n=t;Array.from(this.dropdown.element.querySelectorAll("."+this.config.classNames.highlightedState)).forEach((function(t){t.classList.remove(e.config.classNames.highlightedState),t.setAttribute("aria-selected","false")})),n?this._highlightPosition=i.indexOf(n):(n=i.length>this._highlightPosition?i[this._highlightPosition]:i[i.length-1])||(n=i[0]),n.classList.add(this.config.classNames.highlightedState),n.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(h.EVENTS.highlightChoice,{el:n}),this.dropdown.isActive&&(this.input.setActiveDescendant(n.id),this.containerOuter.setActiveDescendant(n.id))}},t.prototype._addItem=function(t){var e=t.value,i=t.label,n=void 0===i?null:i,r=t.choiceId,s=void 0===r?-1:r,o=t.groupId,a=void 0===o?-1:o,c=t.customProperties,u=void 0===c?{}:c,l=t.placeholder,d=void 0!==l&&l,v=t.keyCode,p=void 0===v?"":v,b="string"==typeof e?e.trim():e,m=this._store.items,g=n||b,y=s||-1,w=a>=0?this._store.getGroupById(a):null,O=m?m.length+1:1;this.config.prependValue&&(b=this.config.prependValue+b.toString()),this.config.appendValue&&(b+=this.config.appendValue.toString()),this._store.dispatch(f.addItem({value:b,label:g,id:O,choiceId:y,groupId:a,customProperties:u,placeholder:d,keyCode:p})),this._isSelectOneElement&&this.removeActiveItems(O),this.passedElement.triggerEvent(h.EVENTS.addItem,{id:O,value:b,label:g,customProperties:u,groupValue:w&&w.value?w.value:null,keyCode:p})},t.prototype._removeItem=function(t){var e=t.id,i=t.value,n=t.label,r=t.customProperties,s=t.choiceId,o=t.groupId,a=o&&o>=0?this._store.getGroupById(o):null;e&&s&&(this._store.dispatch(f.removeItem(e,s)),this.passedElement.triggerEvent(h.EVENTS.removeItem,{id:e,value:i,label:n,customProperties:r,groupValue:a&&a.value?a.value:null}))},t.prototype._addChoice=function(t){var e=t.value,i=t.label,n=t.isSelected,r=void 0!==n&&n,s=t.isDisabled,o=t.groupId,a=t.customProperties,c=void 0===a?{}:a,h=t.placeholder,u=void 0!==h&&h,f=t.keyCode,d=void 0===f?"":f;if(null!=e){var v=this._store.choices,p=(void 0===i?null:i)||e,b=v?v.length+1:1;this._store.dispatch(l.addChoice({id:b,groupId:void 0===o?-1:o,elementId:this._baseId+"-"+this._idNames.itemChoice+"-"+b,value:e,label:p,disabled:void 0!==s&&s,customProperties:c,placeholder:u,keyCode:d})),r&&this._addItem({value:e,label:p,choiceId:b,customProperties:c,placeholder:u,keyCode:d})}},t.prototype._addGroup=function(t){var e=this,i=t.group,n=t.id,r=t.valueKey,s=void 0===r?"value":r,o=t.labelKey,a=void 0===o?"label":o,c=p.isType("Object",i)?i.choices:Array.from(i.getElementsByTagName("OPTION")),h=n||Math.floor((new Date).valueOf()*Math.random());c?(this._store.dispatch(d.addGroup({value:i.label,id:h,active:!0,disabled:!!i.disabled&&i.disabled})),c.forEach((function(t){var i=t.disabled||t.parentNode&&t.parentNode.disabled;e._addChoice({value:t[s],label:p.isType("Object",t)?t[a]:t.innerHTML,isSelected:t.selected,isDisabled:i,groupId:h,customProperties:t.customProperties,placeholder:t.placeholder})}))):this._store.dispatch(d.addGroup({value:i.label,id:i.id,active:!1,disabled:i.disabled}))},t.prototype._getTemplate=function(t){for(var e,i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];var s=this.config.classNames;return(e=this._templates[t]).call.apply(e,n([this,s],i))},t.prototype._createTemplates=function(){var t=this.config.callbackOnCreateTemplates,e={};t&&"function"==typeof t&&(e=t.call(this,p.strToEl)),this._templates=o.default(u.default,e)},t.prototype._createElements=function(){this.containerOuter=new c.Container({element:this._getTemplate("containerOuter",this._direction,this._isSelectElement,this._isSelectOneElement,this.config.searchEnabled,this.passedElement.element.type),classNames:this.config.classNames,type:this.passedElement.element.type,position:this.config.position,inline:this.config.inline}),this.containerInner=new c.Container({element:this._getTemplate("containerInner"),classNames:this.config.classNames,type:this.passedElement.element.type,position:this.config.position,inline:this.config.inline}),this.input=new c.Input({element:this._getTemplate("input",this._placeholderValue),classNames:this.config.classNames,type:this.passedElement.element.type,preventPaste:!this.config.paste}),this.choiceList=new c.List({element:this._getTemplate("choiceList",this._isSelectOneElement)}),this.itemList=new c.List({element:this._getTemplate("itemList",this._isSelectOneElement)}),this.dropdown=new c.Dropdown({element:this._getTemplate("dropdown"),classNames:this.config.classNames,type:this.passedElement.element.type,inline:this.config.inline})},t.prototype._createStructure=function(){this.passedElement.conceal(),this.containerInner.wrap(this.passedElement.element),this.containerOuter.wrap(this.containerInner.element),this._isSelectElement?this.input.placeholder=this.config.searchPlaceholderValue||"":this._placeholderValue&&(this.input.placeholder=this._placeholderValue,this.input.setWidth()),this.containerOuter.element.appendChild(this.containerInner.element),this.containerOuter.element.appendChild(this.dropdown.element),this.containerInner.element.appendChild(this.itemList.element),this._isTextElement||this.dropdown.element.appendChild(this.choiceList.element),this._isSelectElement?this.config.searchEnabled&&this.dropdown.element.insertBefore(this.input.element,this.dropdown.element.firstChild):this.containerInner.element.appendChild(this.input.element),this._isSelectElement&&(this._highlightPosition=0,this._isSearching=!1,this._startLoading(),this._presetGroups.length?this._addPredefinedGroups(this._presetGroups):this._addPredefinedChoices(this._presetChoices),this._stopLoading()),this._isTextElement&&this._addPredefinedItems(this._presetItems)},t.prototype._addPredefinedGroups=function(t){var e=this,i=this.passedElement.placeholderOption;i&&i.parentNode&&"SELECT"===i.parentNode.tagName&&this._addChoice({value:i.value,label:i.innerHTML,isSelected:i.selected,isDisabled:i.disabled,placeholder:!0}),t.forEach((function(t){return e._addGroup({group:t,id:t.id||null})}))},t.prototype._addPredefinedChoices=function(t){var e=this;this.config.shouldSort&&t.sort(this.config.sorter),t.forEach((function(t){var i=t.value,n=void 0===i?"":i,r=t.label,s=t.customProperties,o=t.placeholder;e._isSelectElement?t.choices?e._addGroup({group:t,id:t.id||null}):e._addChoice({value:n,label:r,isSelected:!!t.selected,isDisabled:!!t.disabled,placeholder:!!o,customProperties:s}):e._addChoice({value:n,label:r,isSelected:!!t.selected,isDisabled:!!t.disabled,placeholder:!!t.placeholder,customProperties:s})}))},t.prototype._addPredefinedItems=function(t){var e=this;t.forEach((function(t){"object"==typeof t&&t.value&&e._addItem({value:t.value,label:t.label,choiceId:t.id,customProperties:t.customProperties,placeholder:t.placeholder}),"string"==typeof t&&e._addItem({value:t})}))},t.prototype._setChoiceOrItem=function(t){var e=this;({object:function(){t.value&&(e._isTextElement?e._addItem({value:t.value,label:t.label,choiceId:t.id,customProperties:t.customProperties,placeholder:t.placeholder}):e._addChoice({value:t.value,label:t.label,isSelected:!0,isDisabled:!1,customProperties:t.customProperties,placeholder:t.placeholder}))},string:function(){e._isTextElement?e._addItem({value:t}):e._addChoice({value:t,label:t,isSelected:!0,isDisabled:!1})}})[p.getType(t).toLowerCase()]()},t.prototype._findAndSelectChoiceByValue=function(t){var e=this,i=this._store.choices.find((function(i){return e.config.valueComparer(i.value,t)}));i&&!i.selected&&this._addItem({value:i.value,label:i.label,choiceId:i.id,groupId:i.groupId,customProperties:i.customProperties,placeholder:i.placeholder,keyCode:i.keyCode})},t.prototype._generatePlaceholderValue=function(){if(this._isSelectElement&&this.passedElement.placeholderOption){var t=this.passedElement.placeholderOption;return t?t.text:null}var e=this.config,i=e.placeholderValue,n=this.passedElement.element.dataset;if(e.placeholder){if(i)return i;if(n.placeholder)return n.placeholder}return null},t}();e.default=y},function(t){
  /*!
   * Fuse.js v3.4.6 - Lightweight fuzzy-search (http://fusejs.io)
   * 
   * Copyright (c) 2012-2017 Kirollos Risk (http://kiro.me)
   * All Rights Reserved. Apache Software License 2.0
   * 
   * http://www.apache.org/licenses/LICENSE-2.0
   */
  t.exports=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1)}([function(t){t.exports=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,i){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r=i(2),s=i(8),o=i(0),a=function(){function t(e,i){var n=i.location,r=void 0===n?0:n,o=i.distance,a=void 0===o?100:o,c=i.threshold,h=void 0===c?.6:c,u=i.maxPatternLength,l=void 0===u?32:u,f=i.caseSensitive,d=void 0!==f&&f,v=i.tokenSeparator,p=void 0===v?/ +/g:v,b=i.findAllMatches,m=void 0!==b&&b,g=i.minMatchCharLength,y=void 0===g?1:g,w=i.id,O=void 0===w?null:w,k=i.keys,_=void 0===k?[]:k,x=i.shouldSort,I=void 0===x||x,j=i.getFn,E=void 0===j?s:j,C=i.sortFn,S=void 0===C?function(t,e){return t.score-e.score}:C,T=i.tokenize,A=void 0!==T&&T,M=i.matchAllTokens,P=void 0!==M&&M,L=i.includeMatches,D=void 0!==L&&L,N=i.includeScore,R=void 0!==N&&N,H=i.verbose,z=void 0!==H&&H;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options={location:r,distance:a,threshold:h,maxPatternLength:l,isCaseSensitive:d,tokenSeparator:p,findAllMatches:m,minMatchCharLength:y,id:O,keys:_,includeMatches:D,includeScore:R,shouldSort:I,getFn:E,sortFn:S,verbose:z,tokenize:A,matchAllTokens:P},this.setCollection(e)}var e;return(e=[{key:"setCollection",value:function(t){return this.list=t,t}},{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\nSearch pattern: "'.concat(t,'"'));var i=this._prepareSearchers(t),n=this._search(i.tokenSearchers,i.fullSearcher),r=n.results;return this._computeScore(n.weights,r),this.options.shouldSort&&this._sort(r),e.limit&&"number"==typeof e.limit&&(r=r.slice(0,e.limit)),this._format(r)}},{key:"_prepareSearchers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=[];if(this.options.tokenize)for(var i=t.split(this.options.tokenSeparator),n=0,s=i.length;n<s;n+=1)e.push(new r(i[n],this.options));return{tokenSearchers:e,fullSearcher:new r(t,this.options)}}},{key:"_search",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,i=this.list,n={},r=[];if("string"==typeof i[0]){for(var s=0,o=i.length;s<o;s+=1)this._analyze({key:"",value:i[s],record:s,index:s},{resultMap:n,results:r,tokenSearchers:t,fullSearcher:e});return{weights:null,results:r}}for(var a={},c=0,h=i.length;c<h;c+=1)for(var u=i[c],l=0,f=this.options.keys.length;l<f;l+=1){var d=this.options.keys[l];if("string"!=typeof d){if(a[d.name]={weight:1-d.weight||1},d.weight<=0||d.weight>1)throw new Error("Key weight has to be > 0 and <= 1");d=d.name}else a[d]={weight:1};this._analyze({key:d,value:this.options.getFn(u,d),record:u,index:c},{resultMap:n,results:r,tokenSearchers:t,fullSearcher:e})}return{weights:a,results:r}}},{key:"_analyze",value:function(t,e){var i=t.key,n=t.arrayIndex,r=void 0===n?-1:n,s=t.value,a=t.record,c=t.index,h=e.tokenSearchers,u=void 0===h?[]:h,l=e.fullSearcher,f=void 0===l?[]:l,d=e.resultMap,v=void 0===d?{}:d,p=e.results,b=void 0===p?[]:p;if(null!=s){var m=!1,g=-1,y=0;if("string"==typeof s){this._log("\nKey: ".concat(""===i?"-":i));var w=f.search(s);if(this._log('Full text: "'.concat(s,'", score: ').concat(w.score)),this.options.tokenize){for(var O=s.split(this.options.tokenSeparator),k=[],_=0;_<u.length;_+=1){var x=u[_];this._log('\nPattern: "'.concat(x.pattern,'"'));for(var I=!1,j=0;j<O.length;j+=1){var E=O[j],C=x.search(E),S={};C.isMatch?(S[E]=C.score,m=!0,I=!0,k.push(C.score)):(S[E]=1,this.options.matchAllTokens||k.push(1)),this._log('Token: "'.concat(E,'", score: ').concat(S[E]))}I&&(y+=1)}g=k[0];for(var T=k.length,A=1;A<T;A+=1)g+=k[A];this._log("Token score average:",g/=T)}var M=w.score;g>-1&&(M=(M+g)/2),this._log("Score average:",M);var P=!this.options.tokenize||!this.options.matchAllTokens||y>=u.length;if(this._log("\nCheck Matches: ".concat(P)),(m||w.isMatch)&&P){var L=v[c];L?L.output.push({key:i,arrayIndex:r,value:s,score:M,matchedIndices:w.matchedIndices}):(v[c]={item:a,output:[{key:i,arrayIndex:r,value:s,score:M,matchedIndices:w.matchedIndices}]},b.push(v[c]))}}else if(o(s))for(var D=0,N=s.length;D<N;D+=1)this._analyze({key:i,arrayIndex:D,value:s[D],record:a,index:c},{resultMap:v,results:b,tokenSearchers:u,fullSearcher:f})}}},{key:"_computeScore",value:function(t,e){this._log("\n\nComputing score:\n");for(var i=0,n=e.length;i<n;i+=1){for(var r=e[i].output,s=r.length,o=1,a=1,c=0;c<s;c+=1){var h=t?t[r[c].key].weight:1,u=(1===h?r[c].score:r[c].score||.001)*h;1!==h?a=Math.min(a,u):(r[c].nScore=u,o*=u)}e[i].score=1===a?o:a,this._log(e[i])}}},{key:"_sort",value:function(t){this._log("\n\nSorting...."),t.sort(this.options.sortFn)}},{key:"_format",value:function(t){var e=[];if(this.options.verbose){var i=[];this._log("\n\nOutput:\n\n",JSON.stringify(t,(function(t,e){if("object"===n(e)&&null!==e){if(-1!==i.indexOf(e))return;i.push(e)}return e}))),i=null}var r=[];this.options.includeMatches&&r.push((function(t,e){var i=t.output;e.matches=[];for(var n=0,r=i.length;n<r;n+=1){var s=i[n];if(0!==s.matchedIndices.length){var o={indices:s.matchedIndices,value:s.value};s.key&&(o.key=s.key),s.hasOwnProperty("arrayIndex")&&s.arrayIndex>-1&&(o.arrayIndex=s.arrayIndex),e.matches.push(o)}}})),this.options.includeScore&&r.push((function(t,e){e.score=t.score}));for(var s=0,o=t.length;s<o;s+=1){var a=t[s];if(this.options.id&&(a.item=this.options.getFn(a.item,this.options.id)[0]),r.length){for(var c={item:a.item},h=0,u=r.length;h<u;h+=1)r[h](a,c);e.push(c)}else e.push(a.item)}return e}},{key:"_log",value:function(){var t;this.options.verbose&&(t=console).log.apply(t,arguments)}}])&&function(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,e),t}();t.exports=a},function(t,e,i){var n=i(3),r=i(4),s=i(7),o=function(){function t(e,i){var n=i.location,r=void 0===n?0:n,o=i.distance,a=void 0===o?100:o,c=i.threshold,h=void 0===c?.6:c,u=i.maxPatternLength,l=void 0===u?32:u,f=i.isCaseSensitive,d=void 0!==f&&f,v=i.tokenSeparator,p=void 0===v?/ +/g:v,b=i.findAllMatches,m=void 0!==b&&b,g=i.minMatchCharLength,y=void 0===g?1:g;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options={location:r,distance:a,threshold:h,maxPatternLength:l,isCaseSensitive:d,tokenSeparator:p,findAllMatches:m,minMatchCharLength:y},this.pattern=this.options.isCaseSensitive?e:e.toLowerCase(),this.pattern.length<=l&&(this.patternAlphabet=s(this.pattern))}var e;return(e=[{key:"search",value:function(t){if(this.options.isCaseSensitive||(t=t.toLowerCase()),this.pattern===t)return{isMatch:!0,score:0,matchedIndices:[[0,t.length-1]]};var e=this.options;if(this.pattern.length>e.maxPatternLength)return n(t,this.pattern,e.tokenSeparator);var i=this.options;return r(t,this.pattern,this.patternAlphabet,{location:i.location,distance:i.distance,threshold:i.threshold,findAllMatches:i.findAllMatches,minMatchCharLength:i.minMatchCharLength})}}])&&function(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,e),t}();t.exports=o},function(t){var e=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;t.exports=function(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:/ +/g,r=new RegExp(i.replace(e,"\\$&").replace(n,"|")),s=t.match(r),o=!!s,a=[];if(o)for(var c=0,h=s.length;c<h;c+=1){var u=s[c];a.push([t.indexOf(u),u.length-1])}return{score:o?.5:1,isMatch:o,matchedIndices:a}}},function(t,e,i){var n=i(5),r=i(6);t.exports=function(t,e,i,s){for(var o=s.location,a=s.distance,c=void 0===a?100:a,h=s.threshold,u=s.findAllMatches,l=void 0!==u&&u,f=s.minMatchCharLength,d=void 0===f?1:f,v=void 0===o?0:o,p=t.length,b=void 0===h?.6:h,m=t.indexOf(e,v),g=e.length,y=[],w=0;w<p;w+=1)y[w]=0;if(-1!==m){var O=n(e,{errors:0,currentLocation:m,expectedLocation:v,distance:c});if(b=Math.min(O,b),-1!==(m=t.lastIndexOf(e,v+g))){var k=n(e,{errors:0,currentLocation:m,expectedLocation:v,distance:c});b=Math.min(k,b)}}m=-1;for(var _=[],x=1,I=g+p,j=1<<(g<=31?g-1:30),E=0;E<g;E+=1){for(var C=0,S=I;C<S;)n(e,{errors:E,currentLocation:v+S,expectedLocation:v,distance:c})<=b?C=S:I=S,S=Math.floor((I-C)/2+C);I=S;var T=Math.max(1,v-S+1),A=l?p:Math.min(v+S,p)+g,M=Array(A+2);M[A+1]=(1<<E)-1;for(var P=A;P>=T;P-=1){var L=P-1,D=i[t.charAt(L)];if(D&&(y[L]=1),M[P]=(M[P+1]<<1|1)&D,0!==E&&(M[P]|=(_[P+1]|_[P])<<1|1|_[P+1]),M[P]&j&&(x=n(e,{errors:E,currentLocation:L,expectedLocation:v,distance:c}))<=b){if(b=x,(m=L)<=v)break;T=Math.max(1,2*v-m)}}if(n(e,{errors:E+1,currentLocation:v,expectedLocation:v,distance:c})>b)break;_=M}return{isMatch:m>=0,score:0===x?.001:x,matchedIndices:r(y,d)}}},function(t){t.exports=function(t,e){var i=e.errors,n=e.currentLocation,r=e.expectedLocation,s=e.distance,o=void 0===s?100:s,a=(void 0===i?0:i)/t.length,c=Math.abs((void 0===r?0:r)-(void 0===n?0:n));return o?a+c/o:c?1:a}},function(t){t.exports=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[],n=-1,r=-1,s=0,o=t.length;s<o;s+=1){var a=t[s];a&&-1===n?n=s:a||-1===n||((r=s-1)-n+1>=e&&i.push([n,r]),n=-1)}return t[s-1]&&s-n>=e&&i.push([n,s-1]),i}},function(t){t.exports=function(t){for(var e={},i=t.length,n=0;n<i;n+=1)e[t.charAt(n)]=0;for(var r=0;r<i;r+=1)e[t.charAt(r)]|=1<<i-r-1;return e}},function(t,e,i){var n=i(0);t.exports=function(t,e){return function t(e,i,r){if(i){var s=i.indexOf("."),o=i,a=null;-1!==s&&(o=i.slice(0,s),a=i.slice(s+1));var c=e[o];if(null!=c)if(a||"string"!=typeof c&&"number"!=typeof c)if(n(c))for(var h=0,u=c.length;h<u;h+=1)t(c[h],a,r);else a&&t(c,a,r);else r.push(c.toString())}else r.push(e);return r}(t,e,[])}}])},function(t){var e=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===i}(t)}(t)},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?o(Array.isArray(t)?[]:{},t,e):t}function r(t,e,i){return t.concat(e).map((function(t){return n(t,i)}))}function s(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return t.propertyIsEnumerable(e)})):[]}(t))}function o(t,i,a){(a=a||{}).arrayMerge=a.arrayMerge||r,a.isMergeableObject=a.isMergeableObject||e,a.cloneUnlessOtherwiseSpecified=n;var c=Array.isArray(i);return c===Array.isArray(t)?c?a.arrayMerge(t,i,a):function(t,e,i){var r={};return i.isMergeableObject(t)&&s(t).forEach((function(e){r[e]=n(t[e],i)})),s(e).forEach((function(s){(function(t,e){try{return e in t&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}catch(t){return!1}})(t,s)||(r[s]=i.isMergeableObject(e[s])&&t[s]?function(t,e){if(!e.customMerge)return o;var i=e.customMerge(t);return"function"==typeof i?i:o}(s,i)(t[s],e[s],i):n(e[s],i))})),r}(t,i,a):n(i,a)}o.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,i){return o(t,i,e)}),{})},t.exports=o},function(t,e,i){var n=this&&this.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,r++)n[r]=s[o];return n},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=i(3),o=r(i(4)),a=function(){function t(){this._store=s.createStore(o.default,window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__())}return t.prototype.subscribe=function(t){this._store.subscribe(t)},t.prototype.dispatch=function(t){this._store.dispatch(t)},Object.defineProperty(t.prototype,"state",{get:function(){return this._store.getState()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return this.state.items},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeItems",{get:function(){return this.items.filter((function(t){return!0===t.active}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"highlightedActiveItems",{get:function(){return this.items.filter((function(t){return t.active&&t.highlighted}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"choices",{get:function(){return this.state.choices},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeChoices",{get:function(){return this.choices.filter((function(t){return!0===t.active}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectableChoices",{get:function(){return this.choices.filter((function(t){return!0!==t.disabled}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"searchableChoices",{get:function(){return this.selectableChoices.filter((function(t){return!0!==t.placeholder}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholderChoice",{get:function(){return n(this.choices).reverse().find((function(t){return!0===t.placeholder}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"groups",{get:function(){return this.state.groups},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeGroups",{get:function(){var t=this.choices;return this.groups.filter((function(e){var i=!0===e.active&&!1===e.disabled,n=t.some((function(t){return!0===t.active&&!1===t.disabled}));return i&&n}),[])},enumerable:!0,configurable:!0}),t.prototype.isLoading=function(){return this.state.loading},t.prototype.getChoiceById=function(t){return this.activeChoices.find((function(e){return e.id===parseInt(t,10)}))},t.prototype.getGroupById=function(t){return this.groups.find((function(e){return e.id===t}))},t}();e.default=a},function(t){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e){var i=this&&this.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,r++)n[r]=s[o];return n};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultState=[],e.default=function(t,n){switch(void 0===t&&(t=e.defaultState),n.type){case"ADD_ITEM":return i(t,[{id:n.id,choiceId:n.choiceId,groupId:n.groupId,value:n.value,label:n.label,active:!0,highlighted:!1,customProperties:n.customProperties,placeholder:n.placeholder||!1,keyCode:null}]).map((function(t){var e=t;return e.highlighted=!1,e}));case"REMOVE_ITEM":return t.map((function(t){var e=t;return e.id===n.id&&(e.active=!1),e}));case"HIGHLIGHT_ITEM":var r=n;return t.map((function(t){var e=t;return e.id===r.id&&(e.highlighted=r.highlighted),e}));default:return t}}},function(t,e){var i=this&&this.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,r++)n[r]=s[o];return n};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultState=[],e.default=function(t,n){switch(void 0===t&&(t=e.defaultState),n.type){case"ADD_GROUP":return i(t,[{id:n.id,value:n.value,active:n.active,disabled:n.disabled}]);case"CLEAR_CHOICES":return[];default:return t}}},function(t,e){var i=this&&this.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,r++)n[r]=s[o];return n};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultState=[],e.default=function(t,n){switch(void 0===t&&(t=e.defaultState),n.type){case"ADD_CHOICE":return i(t,[{id:n.id,elementId:n.elementId,groupId:n.groupId,value:n.value,label:n.label||n.value,disabled:n.disabled||!1,selected:!1,active:!0,score:9999,customProperties:n.customProperties,placeholder:n.placeholder||!1}]);case"ADD_ITEM":var r=n;return r.choiceId>-1?t.map((function(t){var e=t;return e.id===parseInt(""+r.choiceId,10)&&(e.selected=!0),e})):t;case"REMOVE_ITEM":var s=n;return s.choiceId&&s.choiceId>-1?t.map((function(t){var e=t;return e.id===parseInt(""+s.choiceId,10)&&(e.selected=!1),e})):t;case"FILTER_CHOICES":var o=n;return t.map((function(t){var e=t;return e.active=o.results.some((function(t){return t.item.id===e.id&&(e.score=t.score,!0)})),e}));case"ACTIVATE_CHOICES":var a=n;return t.map((function(t){var e=t;return e.active=a.active,e}));case"CLEAR_CHOICES":return e.defaultState;default:return t}}},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.defaultState=!1,e.default=function(t,i){switch(void 0===t&&(t=e.defaultState),i.type){case"SET_IS_LOADING":return i.isLoading;default:return t}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(i(19));e.Dropdown=r.default;var s=n(i(20));e.Container=s.default;var o=n(i(21));e.Input=o.default;var a=n(i(22));e.List=a.default;var c=n(i(23));e.WrappedInput=c.default;var h=n(i(24));e.WrappedSelect=h.default},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){var e=t.type,i=t.classNames;this.element=t.element,this.classNames=i,this.type=e,this.isActive=!0,this.inline=!0}return Object.defineProperty(t.prototype,"distanceFromTopWindow",{get:function(){return this.element.getBoundingClientRect().bottom},enumerable:!0,configurable:!0}),t.prototype.getChild=function(t){return this.element.querySelector(t)},t.prototype.show=function(){return this.inline||(this.element.classList.add(this.classNames.activeState),this.element.setAttribute("aria-expanded","true"),this.isActive=!0),this},t.prototype.hide=function(){return this.inline||(this.element.classList.remove(this.classNames.activeState),this.element.setAttribute("aria-expanded","false"),this.isActive=!1),this},t}();e.default=i},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(1),r=i(0),s=function(){function t(t){var e=t.type,i=t.classNames,n=t.position;this.element=t.element,this.classNames=i,this.type=e,this.position=n,this.inline=!0,this.isOpen=!0,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 t.prototype.addEventListeners=function(){this.element.addEventListener("focus",this._onFocus),this.element.addEventListener("blur",this._onBlur)},t.prototype.removeEventListeners=function(){this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},t.prototype.shouldFlip=function(t){if("number"!=typeof t)return!1;var e=!1;return"auto"===this.position?e=!window.matchMedia("(min-height: "+(t+1)+"px)").matches:"top"===this.position&&(e=!0),e},t.prototype.setActiveDescendant=function(t){this.element.setAttribute("aria-activedescendant",t)},t.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},t.prototype.open=function(t){this.element.classList.add(this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(t)&&(this.element.classList.add(this.classNames.flippedState),this.isFlipped=!0)},t.prototype.close=function(){this.element.classList.remove(this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(this.element.classList.remove(this.classNames.flippedState),this.isFlipped=!1)},t.prototype.focus=function(){this.isFocussed||this.element.focus()},t.prototype.addFocusState=function(){this.element.classList.add(this.classNames.focusState)},t.prototype.removeFocusState=function(){this.element.classList.remove(this.classNames.focusState)},t.prototype.enable=function(){this.element.classList.remove(this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===r.SELECT_ONE_TYPE&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},t.prototype.disable=function(){this.element.classList.add(this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===r.SELECT_ONE_TYPE&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},t.prototype.wrap=function(t){n.wrap(t,this.element)},t.prototype.unwrap=function(t){this.element.parentNode&&(this.element.parentNode.insertBefore(t,this.element),this.element.parentNode.removeChild(this.element))},t.prototype.addLoadingState=function(){this.element.classList.add(this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},t.prototype.removeLoadingState=function(){this.element.classList.remove(this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},t.prototype._onFocus=function(){this.isFocussed=!0},t.prototype._onBlur=function(){this.isFocussed=!1},t}();e.default=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(1),r=i(0),s=function(){function t(t){var e=t.element,i=t.type,n=t.classNames,r=t.preventPaste;this.element=e,this.type=i,this.classNames=n,this.preventPaste=r,this.isFocussed=this.element.isEqualNode(document.activeElement),this.isDisabled=e.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(t.prototype,"placeholder",{set:function(t){this.element.placeholder=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return n.sanitise(this.element.value)},set:function(t){this.element.value=t},enumerable:!0,configurable:!0}),t.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})},t.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)},t.prototype.enable=function(){this.element.removeAttribute("disabled"),this.isDisabled=!1},t.prototype.disable=function(){this.element.setAttribute("disabled",""),this.isDisabled=!0},t.prototype.focus=function(){this.isFocussed||this.element.focus()},t.prototype.blur=function(){this.isFocussed&&this.element.blur()},t.prototype.clear=function(t){return void 0===t&&(t=this.type===r.TEXT_TYPE),this.element.value&&(this.element.value=""),t&&this.setWidth(),this},t.prototype.setWidth=function(){var t=this.element,e=t.style,i=t.value;e.minWidth=t.placeholder.length+1+"ch",e.width=i.length+1+"ch"},t.prototype.setActiveDescendant=function(t){this.element.setAttribute("aria-activedescendant",t)},t.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},t.prototype._onInput=function(){this.type===r.TEXT_TYPE&&this.setWidth()},t.prototype._onPaste=function(t){this.preventPaste&&t.preventDefault()},t.prototype._onFocus=function(){this.isFocussed=!0},t.prototype._onBlur=function(){this.isFocussed=!1},t}();e.default=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),r=function(){function t(t){this.element=t.element,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}return t.prototype.clear=function(){this.element.innerHTML=""},t.prototype.append=function(t){this.element.appendChild(t)},t.prototype.getChild=function(t){return this.element.querySelector(t)},t.prototype.hasChildren=function(){return this.element.hasChildNodes()},t.prototype.scrollToTop=function(){this.element.scrollTop=0},t.prototype.scrollToChildElement=function(t,e){var i=this;if(t){var n=e>0?this.element.scrollTop+(t.offsetTop+t.offsetHeight)-(this.element.scrollTop+this.element.offsetHeight):t.offsetTop;requestAnimationFrame((function(){i._animateScroll(n,e)}))}},t.prototype._scrollDown=function(t,e,i){var n=(i-t)/e;this.element.scrollTop=t+(n>1?n:1)},t.prototype._scrollUp=function(t,e,i){var n=(t-i)/e;this.element.scrollTop=t-(n>1?n:1)},t.prototype._animateScroll=function(t,e){var i=this,r=n.SCROLLING_SPEED,s=this.element.scrollTop,o=!1;e>0?(this._scrollDown(s,r,t),s<t&&(o=!0)):(this._scrollUp(s,r,t),s>t&&(o=!0)),o&&requestAnimationFrame((function(){i._animateScroll(t,e)}))},t}();e.default=r},function(t,e,i){var n,r=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e){var i=e.delimiter,n=t.call(this,{element:e.element,classNames:e.classNames})||this;return n.delimiter=i,n}return r(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(t){this.element.setAttribute("value",t),this.element.value=t},enumerable:!0,configurable:!0}),e}(s(i(5)).default);e.default=o},function(t,e,i){var n,r=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e){var i=e.template,n=t.call(this,{element:e.element,classNames:e.classNames})||this;return n.template=i,n}return r(e,t),Object.defineProperty(e.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionGroups",{get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return Array.from(this.element.options)},set:function(t){var e=this,i=document.createDocumentFragment();t.forEach((function(t){return n=e.template(t),void i.appendChild(n);var n})),this.appendDocFragment(i)},enumerable:!0,configurable:!0}),e.prototype.appendDocFragment=function(t){this.element.innerHTML="",this.element.appendChild(t)},e}(s(i(5)).default);e.default=o},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={containerOuter:function(t,e,i,n,r,s){var o=t.containerOuter,a=Object.assign(document.createElement("div"),{className:o});return a.dataset.type=s,e&&(a.dir=e),n&&(a.tabIndex=0),i&&(a.setAttribute("role",r?"combobox":"listbox"),r&&a.setAttribute("aria-autocomplete","list")),a.setAttribute("aria-haspopup","true"),a.setAttribute("aria-expanded","false"),a},containerInner:function(t){var e=t.containerInner;return Object.assign(document.createElement("div"),{className:e})},itemList:function(t,e){var i=t.list,n=t.listSingle,r=t.listItems;return Object.assign(document.createElement("div"),{className:i+" "+(e?n:r)})},placeholder:function(t,e){var i=t.placeholder;return Object.assign(document.createElement("div"),{className:i,innerHTML:e})},item:function(t,e,i){var n=t.item,r=t.button,s=t.highlightedState,o=t.itemSelectable,a=t.placeholder,c=e.id,h=e.value,u=e.label,l=e.customProperties,f=e.active,d=e.disabled,v=e.highlighted,p=e.placeholder,b=Object.assign(document.createElement("div"),{className:n,innerHTML:u});if(Object.assign(b.dataset,{item:"",id:c,value:h,customProperties:l}),f&&b.setAttribute("aria-selected","true"),d&&b.setAttribute("aria-disabled","true"),p&&b.classList.add(a),b.classList.add(v?s:o),i){d&&b.classList.remove(o),b.dataset.deletable="";var m=Object.assign(document.createElement("button"),{type:"button",className:r,innerHTML:"Remove item"});m.setAttribute("aria-label","Remove item: '"+h+"'"),m.dataset.button="",b.appendChild(m)}return b},choiceList:function(t,e){var i=t.list,n=Object.assign(document.createElement("div"),{className:i});return e||n.setAttribute("aria-multiselectable","true"),n.setAttribute("role","listbox"),n},choiceGroup:function(t,e){var i=t.group,n=t.groupHeading,r=t.itemDisabled,s=e.id,o=e.value,a=e.disabled,c=Object.assign(document.createElement("div"),{className:i+" "+(a?r:"")});return c.setAttribute("role","group"),Object.assign(c.dataset,{group:"",id:s,value:o}),a&&c.setAttribute("aria-disabled","true"),c.appendChild(Object.assign(document.createElement("div"),{className:n,innerHTML:o})),c},choice:function(t,e,i){var n=t.item,r=t.itemChoice,s=t.itemSelectable,o=t.selectedState,a=t.itemDisabled,c=t.placeholder,h=e.id,u=e.value,l=e.label,f=e.groupId,d=e.elementId,v=e.disabled,p=e.selected,b=e.placeholder,m=Object.assign(document.createElement("div"),{id:d,innerHTML:l,className:n+" "+r});return p&&m.classList.add(o),b&&m.classList.add(c),m.setAttribute("role",f&&f>0?"treeitem":"option"),Object.assign(m.dataset,{choice:"",id:h,value:u,selectText:i}),v?(m.classList.add(a),m.dataset.choiceDisabled="",m.setAttribute("aria-disabled","true")):(m.classList.add(s),m.dataset.choiceSelectable=""),m},input:function(t,e){var i=t.input,n=t.inputCloned,r=Object.assign(document.createElement("input"),{type:"text",className:i+" "+n,autocomplete:"off",autocapitalize:"off",spellcheck:!1});return r.setAttribute("role","textbox"),r.setAttribute("aria-autocomplete","list"),r.setAttribute("aria-label",e),r},dropdown:function(t){var e=t.list,i=t.listDropdown,n=document.createElement("div");return n.classList.add(e,i),n.setAttribute("aria-expanded","false"),n},notice:function(t,e,i){var n=t.noResults;void 0===i&&(i="");var r=[t.item,t.itemChoice];return"no-choices"===i?r.push(t.noChoices):"no-results"===i&&r.push(n),Object.assign(document.createElement("div"),{innerHTML:e,className:r.join(" ")})},option:function(t){var e=t.customProperties,i=t.disabled,n=new Option(t.label,t.value,!1,t.active);return e&&(n.dataset.customProperties=""+e),n.disabled=!!i,n}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(0);e.addChoice=function(t){return{type:n.ACTION_TYPES.ADD_CHOICE,value:t.value,label:t.label,id:t.id,groupId:t.groupId,disabled:t.disabled,elementId:t.elementId,customProperties:t.customProperties,placeholder:t.placeholder,keyCode:t.keyCode}},e.filterChoices=function(t){return{type:n.ACTION_TYPES.FILTER_CHOICES,results:t}},e.activateChoices=function(t){return void 0===t&&(t=!0),{type:n.ACTION_TYPES.ACTIVATE_CHOICES,active:t}},e.clearChoices=function(){return{type:n.ACTION_TYPES.CLEAR_CHOICES}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(0);e.addItem=function(t){return{type:n.ACTION_TYPES.ADD_ITEM,value:t.value,label:t.label,id:t.id,choiceId:t.choiceId,groupId:t.groupId,customProperties:t.customProperties,placeholder:t.placeholder,keyCode:t.keyCode}},e.removeItem=function(t,e){return{type:n.ACTION_TYPES.REMOVE_ITEM,id:t,choiceId:e}},e.highlightItem=function(t,e){return{type:n.ACTION_TYPES.HIGHLIGHT_ITEM,id:t,highlighted:e}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(0);e.addGroup=function(t){return{type:n.ACTION_TYPES.ADD_GROUP,value:t.value,id:t.id,active:t.active,disabled:t.disabled}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(0);e.clearAll=function(){return{type:n.ACTION_TYPES.CLEAR_ALL}},e.resetTo=function(t){return{type:n.ACTION_TYPES.RESET_TO,state:t}},e.setIsLoading=function(t){return{type:n.ACTION_TYPES.SET_IS_LOADING,isLoading:t}}}]).default},t.exports=e()}))),h=class{constructor(i){t(this,i),this.bkkrSelectDidSearch=e(this,"bkkrSelectDidSearch",7),this.bkkrSelectDidReset=e(this,"bkkrSelectDidReset",7),this.bkkrSelectDidLoad=e(this,"bkkrSelectDidLoad",7),this.didInit=!1,this.choicesReady=!1,this.choicesId="bkkr-sel-"+u++,this.choices=new Promise((t=>{this.readyChoices=t})),this.multiple=!1,this.name=this.choicesId,this.search=!0,this.interfaceOptions={},this.options=[]}async interfaceOptionsChanged(){if(this.choicesReady){const t=await this.getChoices();Object.assign(t.config,this.interfaceOptions),await this.update()}}async optionsChanged(){this.choicesReady&&await this.setChoices(this.options,"value","label",!0)}async onSelect(){return this.changeValue()}async connectedCallback(){"undefined"!=typeof MutationObserver&&((this.mutationO=new MutationObserver((()=>{this.choicesReady&&this.update()}))).observe(this.el,{childList:!0,subtree:!0}),await new Promise((t=>a(this.el,t))),this.didInit||(this.didInit=!0,this.initChoices()))}disconnectedCallback(){this.mutationO&&(this.mutationO.disconnect(),this.mutationO=void 0);const t=this.syncChoices;void 0!==t&&(t.destroy(),this.choices=new Promise((t=>{this.readyChoices=t})),this.choicesReady=!1,this.syncChoices=void 0)}async highlightItem(t,e){const[i]=await Promise.all([this.getChoices()]);return i.highlightItem(t,e),this}async unhighlightItem(t){const[e]=await Promise.all([this.getChoices()]);return e.unhighlightItem(t),this}async highlightAll(){const[t]=await Promise.all([this.getChoices()]);return t.highlightAll(),this}async unhighlightAll(){const[t]=await Promise.all([this.getChoices()]);return t.unhighlightAll(),this}async removeActiveItemsByValue(t){const[e]=await Promise.all([this.getChoices()]);return e.removeActiveItemsByValue(t),this}async removeActiveItems(t){const[e]=await Promise.all([this.getChoices()]);return e.removeActiveItems(t),this}async removeHighlightedItems(t){const[e]=await Promise.all([this.getChoices()]);return e.removeHighlightedItems(t),this}async showDropdown(t){const[e]=await Promise.all([this.getChoices()]);return e.showDropdown(t),this}async hideDropdown(t){const[e]=await Promise.all([this.getChoices()]);return e.hideDropdown(t),this}async getValue(t){const[e]=await Promise.all([this.getChoices()]);return e.getValue(t)}async setValue(t){const[e]=await Promise.all([this.getChoices()]);return e.setValue(t),this}async setChoiceByValue(t){const[e]=await Promise.all([this.getChoices()]);return e.setChoiceByValue(t),this}async setChoices(t,e,i,n){const[r]=await Promise.all([this.getChoices()]);return r.setChoices(t,e,i,n),this}async clearChoices(){const[t]=await Promise.all([this.getChoices()]);return t.clearChoices(),this}async clearStore(){const[t]=await Promise.all([this.getChoices()]);return t.clearStore(),this}async clearInput(){const[t]=await Promise.all([this.getChoices()]);return t.clearInput(),this}async enable(){const[t]=await Promise.all([this.getChoices()]);return t.enable(),this}async disable(){const[t]=await Promise.all([this.getChoices()]);return t.disable(),this}async ajax(t){const[e]=await Promise.all([this.getChoices()]);return e.ajax(t),this}async update(){const[t]=await Promise.all([this.getChoices()]);return t}async getChoices(){return this.choices}async initChoices(){const t=this.normalizeOptions(),e=new c(this.el.querySelector("select"),t);this.el.addEventListener("change",(()=>this.changeValue()),!1),this.el.addEventListener("search",(t=>this.bkkrSelectDidSearch.emit(t)),!1),this.choicesReady=!0,this.syncChoices=e,this.readyChoices(e)}normalizeOptions(){const t={callbackOnInit:()=>{setTimeout((()=>{this.bkkrSelectDidLoad.emit()}),20)}};return Object.assign(Object.assign(Object.assign(Object.assign({},{silent:!1,items:[],choices:this.options,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,duplicateItemsAllowed:!1,delimiter:",",paste:!1,searchEnabled:this.search,searchChoices:!0,searchFloor:0,searchResultLimit:20,searchFields:["label","value"],position:"auto",resetScrollPosition:!1,shouldSort:!1,shouldSortItems:!1,sorter:function(t,e){return e.label.length-t.label.length},placeholder:!0,placeholderValue:null,searchPlaceholderValue:"Search",prependValue:null,appendValue:null,renderSelectedChoices:"always",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",addItemText:t=>`Press Enter to add <b>"${t}"</b>`,maxItemText:t=>`Only ${t} values can be added`,valueComparer:(t,e)=>t===e}),this.interfaceOptions),{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",placeholder:"choices-placeholder",group:"choices-group",groupHeading:"choices-heading",button:"choices-button",activeState:"state-active",focusState:"state-focus",openState:"state-open",disabledState:"state-disabled",highlightedState:"state-highlighted",selectedState:"state-selected",flippedState:"state-flipped",loadingState:"state-loading",noResults:"has-no-results",noChoices:"has-no-choices"}}),t)}async changeValue(){const[t]=await Promise.all([this.getChoices()]),e=t.getValue(!0),i=Array.isArray(e)?e:[e],n=t=>this.options.find((e=>!isNaN(e.value)&&!isNaN(t)&&parseInt(e.value,10)===parseInt(t,10)||e.value===t));this.value=this.multiple?i.filter((t=>n(t))):i.find((t=>n(t))),this.options.length>0?this.options[0].handler(this.value):this.bkkrSelectDidReset.emit()}render(){const{multiple:t,name:e,search:r}=this;return i(n,{class:{"choices-container":!0,"choices-search-enabled":r}},i("select",{part:"native",multiple:t,name:e,class:"native-select"}),r&&i("div",{class:"choices-searchbar-icons search-icon"},i("bkkr-icon",{name:"search"})))}get el(){return r(this)}static get watchers(){return{interfaceOptions:["interfaceOptionsChanged"],options:["optionsChanged"]}}};let u=0;h.style='.choices-container{--searchbar-height:36px;--searchbar-placeholder-color:var(--color-step-600, #666666);--searchbar-placeholder-font-style:initial;--searchbar-placeholder-font-weight:initial;--searchbar-placeholder-opacity:.5;--searchbar-border-radius:0.75em;--searchbar-background:rgba(var(--bkkr-text-color-rgb, 0, 0, 0), 0.04);--searchbar-background-hover:rgba(var(--bkkr-text-color-rgb, 0, 0, 0), 0.08);--searchbar-background-focus:rgba(var(--bkkr-text-color-rgb, 0, 0, 0), 0.08);--searchbar-background-active:rgba(var(--bkkr-text-color-rgb, 0, 0, 0), 0.12);--searchbar-transition:all 0.2s cubic-bezier(0.32, 0.72, 0, 1);--searchbar-icon-color:var(--color-step-600, #666666);--searchbar-icon-size:22px;--searchbar-box-shadow:none;--searchbar-margin-top:5px;--searchbar-margin-bottom:5px;--item-color:var(--bkkr-text-color, #000);--item-color-active:var(--color);--item-color-focus:var(--color);--item-color-hover:var(--color);--item-color-selected:var(--color-base, var(--color-primary, #3880ff));--item-background:transparent;--item-background-active:currentColor;--item-background-focus:currentColor;--item-background-hover:currentColor;--item-background-selected:var(--color-base, var(--color-primary, #3880ff));--item-background-active-opacity:.12;--item-background-focus-opacity:.04;--item-background-hover-opacity:.04;--item-background-selected-opacity:.12;--item-padding-top:0;--item-padding-bottom:0;--item-padding-end:0;--item-padding-start:var(--bkkr-spacer, 16px);--item-min-height:44px;--item-transition:0.2s border cubic-bezier(0.32, 0.72, 0, 1), 0.2s background cubic-bezier(0.32, 0.72, 0, 1);position:relative}.choices,.choices-list-dropdown{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:column;flex-direction:column;height:100%;outline:0;font-family:var(--bkkr-font-family);font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.choices-inner{display:none}.choices-list:not(.choices-list-dropdown){height:100%;overflow-y:auto;padding-bottom:var(--safe-area-bottom);border-top:0.55px solid var(--bkkr-border, rgba(var(--bkkr-text-color-rgb, 0, 0, 0), 0.1))}.choices-input{border-radius:0.75em;padding-left:36px;padding-right:36px;padding-top:0;padding-bottom:0;margin-left:var(--bkkr-spacer);margin-right:var(--bkkr-spacer);margin-top:var(--searchbar-margin-top);margin-bottom:var(--searchbar-margin-bottom);color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-align:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;white-space:inherit;display:block;max-width:100%;min-height:var(--searchbar-height);-webkit-transition:var(--searchbar-transition);transition:var(--searchbar-transition);border:0;outline:none;background:var(--searchbar-background);font-size:16px;font-weight:400;line-height:var(--searchbar-height);-webkit-box-shadow:var(--searchbar-box-shadow);box-shadow:var(--searchbar-box-shadow);contain:strict;z-index:10;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.choices-input{padding-left:unset;padding-right:unset;-webkit-padding-start:36px;padding-inline-start:36px;-webkit-padding-end:36px;padding-inline-end:36px}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.choices-input{margin-left:unset;margin-right:unset;-webkit-margin-start:var(--bkkr-spacer);margin-inline-start:var(--bkkr-spacer);-webkit-margin-end:var(--bkkr-spacer);margin-inline-end:var(--bkkr-spacer)}}.choices-input::-moz-placeholder{color:var(--searchbar-placeholder-color);font-family:inherit;font-style:var(--searchbar-placeholder-font-style);font-weight:var(--searchbar-placeholder-font-weight);opacity:var(--searchbar-placeholder-opacity)}.choices-input::-ms-input-placeholder{color:var(--searchbar-placeholder-color);font-family:inherit;font-style:var(--searchbar-placeholder-font-style);font-weight:var(--searchbar-placeholder-font-weight);opacity:var(--searchbar-placeholder-opacity)}.choices-input::-webkit-input-placeholder{color:var(--searchbar-placeholder-color);font-family:inherit;font-style:var(--searchbar-placeholder-font-style);font-weight:var(--searchbar-placeholder-font-weight);opacity:var(--searchbar-placeholder-opacity)}.choices-input:-ms-input-placeholder{color:var(--searchbar-placeholder-color);font-family:inherit;font-style:var(--searchbar-placeholder-font-style);font-weight:var(--searchbar-placeholder-font-weight);opacity:var(--searchbar-placeholder-opacity)}.choices-input::placeholder{color:var(--searchbar-placeholder-color);font-family:inherit;font-style:var(--searchbar-placeholder-font-style);font-weight:var(--searchbar-placeholder-font-weight);opacity:var(--searchbar-placeholder-opacity)}.choices-input::-webkit-search-cancel-button,.choices-input::-ms-clear{display:none}@media (any-hover: hover){.choices-input:hover{background:var(--searchbar-background-hover)}}.choices-input:focus{background:var(--searchbar-background-focus)}.choices-input:active{background:var(--searchbar-background-active)}.choices-searchbar-icons{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:36px;min-height:var(--searchbar-height);z-index:15}.choices-searchbar-icons bkkr-icon{--color:var(--searchbar-icon-color);height:var(--searchbar-icon-size)}.search-icon{top:var(--searchbar-margin-top);left:var(--bkkr-spacer);pointer-events:none}.choices-item{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-align:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;white-space:inherit;padding-left:calc(var(--item-padding-start) + var(--safe-area-left, 0));padding-right:var(--item-padding-end);padding-top:var(--item-padding-top);padding-bottom:var(--item-padding-bottom);display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:100%;min-height:var(--item-min-height);outline:none;color:var(--item-color);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-drag:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.choices-item{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--item-padding-start) + var(--safe-area-left, 0));padding-inline-start:calc(var(--item-padding-start) + var(--safe-area-left, 0));-webkit-padding-end:var(--item-padding-end);padding-inline-end:var(--item-padding-end)}}.choices-item::-moz-focus-inner{border:0}.choices-item:not(.has-no-results)::after{top:0;right:0;bottom:0;left:0;position:absolute;content:"";opacity:0;-webkit-transition:var(--item-transition);transition:var(--item-transition);pointer-events:none;z-index:-1}.choices-item.has-no-results{cursor:initial}.popover-viewport{--searchbar-margin-top:var(--bkkr-spacer)}.choices-item.state-highlighted{color:var(--item-color-hover)}.choices-item.state-highlighted::after{background:var(--item-background-hover);opacity:var(--item-background-hover-opacity)}.choices-item.state-focus{color:var(--item-color-focus)}.choices-item.state-focus::after{background:var(--item-background-focus);opacity:var(--item-background-focus-opacity)}.choices-item.state-active{color:var(--item-color-active)}.choices-item.state-active::after{background:var(--item-background-active);opacity:var(--item-background-active-opacity)}.choices-item.state-selected{color:var(--item-color-selected)}.choices-item.state-selected::after{background:var(--item-background-selected);opacity:var(--item-background-selected-opacity)}.choices-item.state-disabled{pointer-events:none;cursor:default;opacity:0.3}';export{h as bkkr_select_choices}