/*
 * ATTENTION: An "eval-source-map" devtool has been used.
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory();
	else if(typeof define === 'function' && define.amd)
		define([], factory);
	else {
		var a = factory();
		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
	}
})(self, function() {
return /******/ (function() { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./libs/bootstrap-select/bootstrap-select.js":
/*!***************************************************!*\
  !*** ./libs/bootstrap-select/bootstrap-select.js ***!
  \***************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"bootstrapSelect\": function() { return /* reexport default from dynamic */ bootstrap_select_js_bootstrap_select__WEBPACK_IMPORTED_MODULE_0___default.a; }\n/* harmony export */ });\n/* harmony import */ var bootstrap_select_js_bootstrap_select__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bootstrap-select/js/bootstrap-select */ \"./node_modules/bootstrap-select/js/bootstrap-select.js\");\n/* harmony import */ var bootstrap_select_js_bootstrap_select__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(bootstrap_select_js_bootstrap_select__WEBPACK_IMPORTED_MODULE_0__);\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9saWJzL2Jvb3RzdHJhcC1zZWxlY3QvYm9vdHN0cmFwLXNlbGVjdC5qcy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBbUUiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9TbmVhdC8uL2xpYnMvYm9vdHN0cmFwLXNlbGVjdC9ib290c3RyYXAtc2VsZWN0LmpzP2UwODUiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGJvb3RzdHJhcFNlbGVjdCBmcm9tICdib290c3RyYXAtc2VsZWN0L2pzL2Jvb3RzdHJhcC1zZWxlY3QnO1xyXG5cclxuZXhwb3J0IHsgYm9vdHN0cmFwU2VsZWN0IH07XHJcbiJdLCJuYW1lcyI6WyJib290c3RyYXBTZWxlY3QiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./libs/bootstrap-select/bootstrap-select.js\n");

/***/ }),

/***/ "./node_modules/bootstrap-select/js/bootstrap-select.js":
/*!**************************************************************!*\
  !*** ./node_modules/bootstrap-select/js/bootstrap-select.js ***!
  \**************************************************************/
/***/ (function() {

eval("(function ($) {\r\n  'use strict';\r\n\r\n  var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];\r\n\r\n  var uriAttrs = [\r\n    'background',\r\n    'cite',\r\n    'href',\r\n    'itemtype',\r\n    'longdesc',\r\n    'poster',\r\n    'src',\r\n    'xlink:href'\r\n  ];\r\n\r\n  var ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i;\r\n\r\n  var DefaultWhitelist = {\r\n    // Global attributes allowed on any supplied element below.\r\n    '*': ['class', 'dir', 'id', 'lang', 'role', 'tabindex', 'style', ARIA_ATTRIBUTE_PATTERN],\r\n    a: ['target', 'href', 'title', 'rel'],\r\n    area: [],\r\n    b: [],\r\n    br: [],\r\n    col: [],\r\n    code: [],\r\n    div: [],\r\n    em: [],\r\n    hr: [],\r\n    h1: [],\r\n    h2: [],\r\n    h3: [],\r\n    h4: [],\r\n    h5: [],\r\n    h6: [],\r\n    i: [],\r\n    img: ['src', 'alt', 'title', 'width', 'height'],\r\n    li: [],\r\n    ol: [],\r\n    p: [],\r\n    pre: [],\r\n    s: [],\r\n    small: [],\r\n    span: [],\r\n    sub: [],\r\n    sup: [],\r\n    strong: [],\r\n    u: [],\r\n    ul: []\r\n  };\r\n\r\n  /**\r\n   * A pattern that recognizes a commonly useful subset of URLs that are safe.\r\n   *\r\n   * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\r\n   */\r\n  var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;\r\n\r\n  /**\r\n   * A pattern that matches safe data URLs. Only matches image, video and audio types.\r\n   *\r\n   * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\r\n   */\r\n  var DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;\r\n\r\n  var ParseableAttributes = ['title', 'placeholder']; // attributes to use as settings, can add others in the future\r\n\r\n  function allowedAttribute (attr, allowedAttributeList) {\r\n    var attrName = attr.nodeName.toLowerCase();\r\n\r\n    if ($.inArray(attrName, allowedAttributeList) !== -1) {\r\n      if ($.inArray(attrName, uriAttrs) !== -1) {\r\n        return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));\r\n      }\r\n\r\n      return true;\r\n    }\r\n\r\n    var regExp = $(allowedAttributeList).filter(function (index, value) {\r\n      return value instanceof RegExp;\r\n    });\r\n\r\n    // Check if a regular expression validates the attribute.\r\n    for (var i = 0, l = regExp.length; i < l; i++) {\r\n      if (attrName.match(regExp[i])) {\r\n        return true;\r\n      }\r\n    }\r\n\r\n    return false;\r\n  }\r\n\r\n  function sanitizeHtml (unsafeElements, whiteList, sanitizeFn) {\r\n    if (sanitizeFn && typeof sanitizeFn === 'function') {\r\n      return sanitizeFn(unsafeElements);\r\n    }\r\n\r\n    var whitelistKeys = Object.keys(whiteList);\r\n\r\n    for (var i = 0, len = unsafeElements.length; i < len; i++) {\r\n      var elements = unsafeElements[i].querySelectorAll('*');\r\n\r\n      for (var j = 0, len2 = elements.length; j < len2; j++) {\r\n        var el = elements[j];\r\n        var elName = el.nodeName.toLowerCase();\r\n\r\n        if (whitelistKeys.indexOf(elName) === -1) {\r\n          el.parentNode.removeChild(el);\r\n\r\n          continue;\r\n        }\r\n\r\n        var attributeList = [].slice.call(el.attributes);\r\n        var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);\r\n\r\n        for (var k = 0, len3 = attributeList.length; k < len3; k++) {\r\n          var attr = attributeList[k];\r\n\r\n          if (!allowedAttribute(attr, whitelistedAttributes)) {\r\n            el.removeAttribute(attr.nodeName);\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n\r\n  function getAttributesObject ($select) {\r\n    var attributesObject = {},\r\n        attrVal;\r\n\r\n    ParseableAttributes.forEach(function (item) {\r\n      attrVal = $select.attr(item);\r\n      if (attrVal) attributesObject[item] = attrVal;\r\n    });\r\n\r\n    // for backwards compatibility\r\n    // (using title as placeholder is deprecated - remove in v2.0.0)\r\n    if (!attributesObject.placeholder && attributesObject.title) {\r\n      attributesObject.placeholder = attributesObject.title;\r\n    }\r\n\r\n    return attributesObject;\r\n  }\r\n\r\n  // Polyfill for browsers with no classList support\r\n  // Remove in v2\r\n  if (!('classList' in document.createElement('_'))) {\r\n    (function (view) {\r\n      if (!('Element' in view)) return;\r\n\r\n      var classListProp = 'classList',\r\n          protoProp = 'prototype',\r\n          elemCtrProto = view.Element[protoProp],\r\n          objCtr = Object,\r\n          classListGetter = function () {\r\n            var $elem = $(this);\r\n\r\n            return {\r\n              add: function (classes) {\r\n                classes = Array.prototype.slice.call(arguments).join(' ');\r\n                return $elem.addClass(classes);\r\n              },\r\n              remove: function (classes) {\r\n                classes = Array.prototype.slice.call(arguments).join(' ');\r\n                return $elem.removeClass(classes);\r\n              },\r\n              toggle: function (classes, force) {\r\n                return $elem.toggleClass(classes, force);\r\n              },\r\n              contains: function (classes) {\r\n                return $elem.hasClass(classes);\r\n              }\r\n            };\r\n          };\r\n\r\n      if (objCtr.defineProperty) {\r\n        var classListPropDesc = {\r\n          get: classListGetter,\r\n          enumerable: true,\r\n          configurable: true\r\n        };\r\n        try {\r\n          objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\r\n        } catch (ex) { // IE 8 doesn't support enumerable:true\r\n          // adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36\r\n          // modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected\r\n          if (ex.number === undefined || ex.number === -0x7FF5EC54) {\r\n            classListPropDesc.enumerable = false;\r\n            objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\r\n          }\r\n        }\r\n      } else if (objCtr[protoProp].__defineGetter__) {\r\n        elemCtrProto.__defineGetter__(classListProp, classListGetter);\r\n      }\r\n    }(window));\r\n  }\r\n\r\n  var testElement = document.createElement('_');\r\n\r\n  testElement.classList.add('c1', 'c2');\r\n\r\n  if (!testElement.classList.contains('c2')) {\r\n    var _add = DOMTokenList.prototype.add,\r\n        _remove = DOMTokenList.prototype.remove;\r\n\r\n    DOMTokenList.prototype.add = function () {\r\n      Array.prototype.forEach.call(arguments, _add.bind(this));\r\n    };\r\n\r\n    DOMTokenList.prototype.remove = function () {\r\n      Array.prototype.forEach.call(arguments, _remove.bind(this));\r\n    };\r\n  }\r\n\r\n  testElement.classList.toggle('c3', false);\r\n\r\n  // Polyfill for IE 10 and Firefox <24, where classList.toggle does not\r\n  // support the second argument.\r\n  if (testElement.classList.contains('c3')) {\r\n    var _toggle = DOMTokenList.prototype.toggle;\r\n\r\n    DOMTokenList.prototype.toggle = function (token, force) {\r\n      if (1 in arguments && !this.contains(token) === !force) {\r\n        return force;\r\n      } else {\r\n        return _toggle.call(this, token);\r\n      }\r\n    };\r\n  }\r\n\r\n  testElement = null;\r\n\r\n  // Polyfill for IE (remove in v2)\r\n  Object.values = typeof Object.values === 'function' ? Object.values : function (obj) {\r\n    return Object.keys(obj).map(function (key) {\r\n      return obj[key];\r\n    });\r\n  };\r\n\r\n  // shallow array comparison\r\n  function isEqual (array1, array2) {\r\n    return array1.length === array2.length && array1.every(function (element, index) {\r\n      return element === array2[index];\r\n    });\r\n  };\r\n\r\n  // <editor-fold desc=\"Shims\">\r\n  if (!String.prototype.startsWith) {\r\n    (function () {\r\n      'use strict'; // needed to support `apply`/`call` with `undefined`/`null`\r\n      var toString = {}.toString;\r\n      var startsWith = function (search) {\r\n        if (this == null) {\r\n          throw new TypeError();\r\n        }\r\n        var string = String(this);\r\n        if (search && toString.call(search) == '[object RegExp]') {\r\n          throw new TypeError();\r\n        }\r\n        var stringLength = string.length;\r\n        var searchString = String(search);\r\n        var searchLength = searchString.length;\r\n        var position = arguments.length > 1 ? arguments[1] : undefined;\r\n        // `ToInteger`\r\n        var pos = position ? Number(position) : 0;\r\n        if (pos != pos) { // better `isNaN`\r\n          pos = 0;\r\n        }\r\n        var start = Math.min(Math.max(pos, 0), stringLength);\r\n        // Avoid the `indexOf` call if no match is possible\r\n        if (searchLength + start > stringLength) {\r\n          return false;\r\n        }\r\n        var index = -1;\r\n        while (++index < searchLength) {\r\n          if (string.charCodeAt(start + index) != searchString.charCodeAt(index)) {\r\n            return false;\r\n          }\r\n        }\r\n        return true;\r\n      };\r\n      if (Object.defineProperty) {\r\n        Object.defineProperty(String.prototype, 'startsWith', {\r\n          'value': startsWith,\r\n          'configurable': true,\r\n          'writable': true\r\n        });\r\n      } else {\r\n        String.prototype.startsWith = startsWith;\r\n      }\r\n    }());\r\n  }\r\n\r\n  function toKebabCase (str) {\r\n    return str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, function ($, ofs) {\r\n      return (ofs ? '-' : '') + $.toLowerCase();\r\n    });\r\n  }\r\n\r\n  function getSelectedOptions () {\r\n    var options = this.selectpicker.main.data;\r\n\r\n    if (this.options.source.data || this.options.source.search) {\r\n      options = Object.values(this.selectpicker.optionValuesDataMap);\r\n    }\r\n\r\n    var selectedOptions = options.filter(function (item) {\r\n      if (item.selected) {\r\n        if (this.options.hideDisabled && item.disabled) return false;\r\n        return true;\r\n      }\r\n\r\n      return false;\r\n    }, this);\r\n\r\n    // ensure only 1 option is selected if multiple are set in the data source\r\n    if (this.options.source.data && !this.multiple && selectedOptions.length > 1) {\r\n      for (var i = 0; i < selectedOptions.length - 1; i++) {\r\n        selectedOptions[i].selected = false;\r\n      }\r\n\r\n      selectedOptions = [ selectedOptions[selectedOptions.length - 1] ];\r\n    }\r\n\r\n    return selectedOptions;\r\n  }\r\n\r\n  // much faster than $.val()\r\n  function getSelectValues (selectedOptions) {\r\n    var value = [],\r\n        options = selectedOptions || getSelectedOptions.call(this),\r\n        opt;\r\n\r\n    for (var i = 0, len = options.length; i < len; i++) {\r\n      opt = options[i];\r\n\r\n      if (!opt.disabled) {\r\n        value.push(opt.value === undefined ? opt.text : opt.value);\r\n      }\r\n    }\r\n\r\n    if (!this.multiple) {\r\n      return !value.length ? null : value[0];\r\n    }\r\n\r\n    return value;\r\n  }\r\n\r\n  // set data-selected on select element if the value has been programmatically selected\r\n  // prior to initialization of bootstrap-select\r\n  // * consider removing or replacing an alternative method *\r\n  var valHooks = {\r\n    useDefault: false,\r\n    _set: $.valHooks.select.set\r\n  };\r\n\r\n  $.valHooks.select.set = function (elem, value) {\r\n    if (value && !valHooks.useDefault) $(elem).data('selected', true);\r\n\r\n    return valHooks._set.apply(this, arguments);\r\n  };\r\n\r\n  var changedArguments = null;\r\n\r\n  var EventIsSupported = (function () {\r\n    try {\r\n      new Event('change');\r\n      return true;\r\n    } catch (e) {\r\n      return false;\r\n    }\r\n  })();\r\n\r\n  $.fn.triggerNative = function (eventName) {\r\n    var el = this[0],\r\n        event;\r\n\r\n    if (el.dispatchEvent) { // for modern browsers & IE9+\r\n      if (EventIsSupported) {\r\n        // For modern browsers\r\n        event = new Event(eventName, {\r\n          bubbles: true\r\n        });\r\n      } else {\r\n        // For IE since it doesn't support Event constructor\r\n        event = document.createEvent('Event');\r\n        event.initEvent(eventName, true, false);\r\n      }\r\n\r\n      el.dispatchEvent(event);\r\n    }\r\n  };\r\n  // </editor-fold>\r\n\r\n  function stringSearch (li, searchString, method, normalize) {\r\n    var stringTypes = [\r\n          'display',\r\n          'subtext',\r\n          'tokens'\r\n        ],\r\n        searchSuccess = false;\r\n\r\n    for (var i = 0; i < stringTypes.length; i++) {\r\n      var stringType = stringTypes[i],\r\n          string = li[stringType];\r\n\r\n      if (string) {\r\n        string = string.toString();\r\n\r\n        // Strip HTML tags. This isn't perfect, but it's much faster than any other method\r\n        if (stringType === 'display') {\r\n          string = string.replace(/<[^>]+>/g, '');\r\n        }\r\n\r\n        if (normalize) string = normalizeToBase(string);\r\n        string = string.toUpperCase();\r\n\r\n        if (typeof method === 'function') {\r\n          searchSuccess = method(string, searchString);\r\n        } else if (method === 'contains') {\r\n          searchSuccess = string.indexOf(searchString) >= 0;\r\n        } else {\r\n          searchSuccess = string.startsWith(searchString);\r\n        }\r\n\r\n        if (searchSuccess) break;\r\n      }\r\n    }\r\n\r\n    return searchSuccess;\r\n  }\r\n\r\n  function toInteger (value) {\r\n    return parseInt(value, 10) || 0;\r\n  }\r\n\r\n  // Borrowed from Lodash (_.deburr)\r\n  /** Used to map Latin Unicode letters to basic Latin letters. */\r\n  var deburredLetters = {\r\n    // Latin-1 Supplement block.\r\n    '\\xc0': 'A',  '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\r\n    '\\xe0': 'a',  '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\r\n    '\\xc7': 'C',  '\\xe7': 'c',\r\n    '\\xd0': 'D',  '\\xf0': 'd',\r\n    '\\xc8': 'E',  '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\r\n    '\\xe8': 'e',  '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\r\n    '\\xcc': 'I',  '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\r\n    '\\xec': 'i',  '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\r\n    '\\xd1': 'N',  '\\xf1': 'n',\r\n    '\\xd2': 'O',  '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\r\n    '\\xf2': 'o',  '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\r\n    '\\xd9': 'U',  '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\r\n    '\\xf9': 'u',  '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\r\n    '\\xdd': 'Y',  '\\xfd': 'y', '\\xff': 'y',\r\n    '\\xc6': 'Ae', '\\xe6': 'ae',\r\n    '\\xde': 'Th', '\\xfe': 'th',\r\n    '\\xdf': 'ss',\r\n    // Latin Extended-A block.\r\n    '\\u0100': 'A',  '\\u0102': 'A', '\\u0104': 'A',\r\n    '\\u0101': 'a',  '\\u0103': 'a', '\\u0105': 'a',\r\n    '\\u0106': 'C',  '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\r\n    '\\u0107': 'c',  '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\r\n    '\\u010e': 'D',  '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\r\n    '\\u0112': 'E',  '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\r\n    '\\u0113': 'e',  '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\r\n    '\\u011c': 'G',  '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\r\n    '\\u011d': 'g',  '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\r\n    '\\u0124': 'H',  '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\r\n    '\\u0128': 'I',  '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\r\n    '\\u0129': 'i',  '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\r\n    '\\u0134': 'J',  '\\u0135': 'j',\r\n    '\\u0136': 'K',  '\\u0137': 'k', '\\u0138': 'k',\r\n    '\\u0139': 'L',  '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\r\n    '\\u013a': 'l',  '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\r\n    '\\u0143': 'N',  '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\r\n    '\\u0144': 'n',  '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\r\n    '\\u014c': 'O',  '\\u014e': 'O', '\\u0150': 'O',\r\n    '\\u014d': 'o',  '\\u014f': 'o', '\\u0151': 'o',\r\n    '\\u0154': 'R',  '\\u0156': 'R', '\\u0158': 'R',\r\n    '\\u0155': 'r',  '\\u0157': 'r', '\\u0159': 'r',\r\n    '\\u015a': 'S',  '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\r\n    '\\u015b': 's',  '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\r\n    '\\u0162': 'T',  '\\u0164': 'T', '\\u0166': 'T',\r\n    '\\u0163': 't',  '\\u0165': 't', '\\u0167': 't',\r\n    '\\u0168': 'U',  '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\r\n    '\\u0169': 'u',  '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\r\n    '\\u0174': 'W',  '\\u0175': 'w',\r\n    '\\u0176': 'Y',  '\\u0177': 'y', '\\u0178': 'Y',\r\n    '\\u0179': 'Z',  '\\u017b': 'Z', '\\u017d': 'Z',\r\n    '\\u017a': 'z',  '\\u017c': 'z', '\\u017e': 'z',\r\n    '\\u0132': 'IJ', '\\u0133': 'ij',\r\n    '\\u0152': 'Oe', '\\u0153': 'oe',\r\n    '\\u0149': \"'n\", '\\u017f': 's'\r\n  };\r\n\r\n  /** Used to match Latin Unicode letters (excluding mathematical operators). */\r\n  var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\r\n\r\n  /** Used to compose unicode character classes. */\r\n  var rsComboMarksRange = '\\\\u0300-\\\\u036f',\r\n      reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\r\n      rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\r\n      rsComboMarksExtendedRange = '\\\\u1ab0-\\\\u1aff',\r\n      rsComboMarksSupplementRange = '\\\\u1dc0-\\\\u1dff',\r\n      rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange + rsComboMarksExtendedRange + rsComboMarksSupplementRange;\r\n\r\n  /** Used to compose unicode capture groups. */\r\n  var rsCombo = '[' + rsComboRange + ']';\r\n\r\n  /**\r\n   * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\r\n   * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\r\n   */\r\n  var reComboMark = RegExp(rsCombo, 'g');\r\n\r\n  function deburrLetter (key) {\r\n    return deburredLetters[key];\r\n  };\r\n\r\n  function normalizeToBase (string) {\r\n    string = string.toString();\r\n    return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\r\n  }\r\n\r\n  // List of HTML entities for escaping.\r\n  var escapeMap = {\r\n    '&': '&amp;',\r\n    '<': '&lt;',\r\n    '>': '&gt;',\r\n    '\"': '&quot;',\r\n    \"'\": '&#x27;',\r\n    '`': '&#x60;'\r\n  };\r\n\r\n  // Functions for escaping and unescaping strings to/from HTML interpolation.\r\n  var createEscaper = function (map) {\r\n    var escaper = function (match) {\r\n      return map[match];\r\n    };\r\n    // Regexes for identifying a key that needs to be escaped.\r\n    var source = '(?:' + Object.keys(map).join('|') + ')';\r\n    var testRegexp = RegExp(source);\r\n    var replaceRegexp = RegExp(source, 'g');\r\n    return function (string) {\r\n      string = string == null ? '' : '' + string;\r\n      return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\r\n    };\r\n  };\r\n\r\n  var htmlEscape = createEscaper(escapeMap);\r\n\r\n  /**\r\n   * ------------------------------------------------------------------------\r\n   * Constants\r\n   * ------------------------------------------------------------------------\r\n   */\r\n\r\n  var keyCodeMap = {\r\n    32: ' ',\r\n    48: '0',\r\n    49: '1',\r\n    50: '2',\r\n    51: '3',\r\n    52: '4',\r\n    53: '5',\r\n    54: '6',\r\n    55: '7',\r\n    56: '8',\r\n    57: '9',\r\n    59: ';',\r\n    65: 'A',\r\n    66: 'B',\r\n    67: 'C',\r\n    68: 'D',\r\n    69: 'E',\r\n    70: 'F',\r\n    71: 'G',\r\n    72: 'H',\r\n    73: 'I',\r\n    74: 'J',\r\n    75: 'K',\r\n    76: 'L',\r\n    77: 'M',\r\n    78: 'N',\r\n    79: 'O',\r\n    80: 'P',\r\n    81: 'Q',\r\n    82: 'R',\r\n    83: 'S',\r\n    84: 'T',\r\n    85: 'U',\r\n    86: 'V',\r\n    87: 'W',\r\n    88: 'X',\r\n    89: 'Y',\r\n    90: 'Z',\r\n    96: '0',\r\n    97: '1',\r\n    98: '2',\r\n    99: '3',\r\n    100: '4',\r\n    101: '5',\r\n    102: '6',\r\n    103: '7',\r\n    104: '8',\r\n    105: '9'\r\n  };\r\n\r\n  var keyCodes = {\r\n    ESCAPE: 27, // KeyboardEvent.which value for Escape (Esc) key\r\n    ENTER: 13, // KeyboardEvent.which value for Enter key\r\n    SPACE: 32, // KeyboardEvent.which value for space key\r\n    TAB: 9, // KeyboardEvent.which value for tab key\r\n    ARROW_UP: 38, // KeyboardEvent.which value for up arrow key\r\n    ARROW_DOWN: 40 // KeyboardEvent.which value for down arrow key\r\n  };\r\n\r\n  // eslint-disable-next-line no-undef\r\n  var Dropdown = window.Dropdown || bootstrap.Dropdown;\r\n\r\n  function getVersion () {\r\n    var version;\r\n\r\n    try {\r\n      version = $.fn.dropdown.Constructor.VERSION;\r\n    } catch (err) {\r\n      version = Dropdown.VERSION;\r\n    }\r\n\r\n    return version;\r\n  }\r\n\r\n  var version = {\r\n    success: false,\r\n    major: '3'\r\n  };\r\n\r\n  try {\r\n    version.full = (getVersion() || '').split(' ')[0].split('.');\r\n    version.major = version.full[0];\r\n    version.success = true;\r\n  } catch (err) {\r\n    // do nothing\r\n  }\r\n\r\n  var selectId = 0;\r\n\r\n  var EVENT_KEY = '.bs.select';\r\n\r\n  var classNames = {\r\n    DISABLED: 'disabled',\r\n    DIVIDER: 'divider',\r\n    SHOW: 'open',\r\n    DROPUP: 'dropup',\r\n    MENU: 'dropdown-menu',\r\n    MENURIGHT: 'dropdown-menu-right',\r\n    MENULEFT: 'dropdown-menu-left',\r\n    // to-do: replace with more advanced template/customization options\r\n    BUTTONCLASS: 'btn-default',\r\n    POPOVERHEADER: 'popover-title',\r\n    ICONBASE: 'glyphicon',\r\n    TICKICON: 'glyphicon-ok'\r\n  };\r\n\r\n  var Selector = {\r\n    MENU: '.' + classNames.MENU,\r\n    DATA_TOGGLE: 'data-toggle=\"dropdown\"'\r\n  };\r\n\r\n  var elementTemplates = {\r\n    div: document.createElement('div'),\r\n    span: document.createElement('span'),\r\n    i: document.createElement('i'),\r\n    subtext: document.createElement('small'),\r\n    a: document.createElement('a'),\r\n    li: document.createElement('li'),\r\n    whitespace: document.createTextNode('\\u00A0'),\r\n    fragment: document.createDocumentFragment(),\r\n    option: document.createElement('option')\r\n  };\r\n\r\n  elementTemplates.selectedOption = elementTemplates.option.cloneNode(false);\r\n  elementTemplates.selectedOption.setAttribute('selected', true);\r\n\r\n  elementTemplates.noResults = elementTemplates.li.cloneNode(false);\r\n  elementTemplates.noResults.className = 'no-results';\r\n\r\n  elementTemplates.a.setAttribute('role', 'option');\r\n  elementTemplates.a.className = 'dropdown-item';\r\n\r\n  elementTemplates.subtext.className = 'text-muted';\r\n\r\n  elementTemplates.text = elementTemplates.span.cloneNode(false);\r\n  elementTemplates.text.className = 'text';\r\n\r\n  elementTemplates.checkMark = elementTemplates.span.cloneNode(false);\r\n\r\n  var REGEXP_ARROW = new RegExp(keyCodes.ARROW_UP + '|' + keyCodes.ARROW_DOWN);\r\n  var REGEXP_TAB_OR_ESCAPE = new RegExp('^' + keyCodes.TAB + '$|' + keyCodes.ESCAPE);\r\n\r\n  var generateOption = {\r\n    li: function (content, classes, optgroup) {\r\n      var li = elementTemplates.li.cloneNode(false);\r\n\r\n      if (content) {\r\n        if (content.nodeType === 1 || content.nodeType === 11) {\r\n          li.appendChild(content);\r\n        } else {\r\n          li.innerHTML = content;\r\n        }\r\n      }\r\n\r\n      if (typeof classes !== 'undefined' && classes !== '') li.className = classes;\r\n      if (typeof optgroup !== 'undefined' && optgroup !== null) li.classList.add('optgroup-' + optgroup);\r\n\r\n      return li;\r\n    },\r\n\r\n    a: function (text, classes, inline) {\r\n      var a = elementTemplates.a.cloneNode(true);\r\n\r\n      if (text) {\r\n        if (text.nodeType === 11) {\r\n          a.appendChild(text);\r\n        } else {\r\n          a.insertAdjacentHTML('beforeend', text);\r\n        }\r\n      }\r\n\r\n      if (typeof classes !== 'undefined' && classes !== '') a.classList.add.apply(a.classList, classes.split(/\\s+/));\r\n      if (inline) a.setAttribute('style', inline);\r\n\r\n      return a;\r\n    },\r\n\r\n    text: function (options, useFragment) {\r\n      var textElement = elementTemplates.text.cloneNode(false),\r\n          subtextElement,\r\n          iconElement;\r\n\r\n      if (options.content) {\r\n        textElement.innerHTML = options.content;\r\n      } else {\r\n        textElement.textContent = options.text;\r\n\r\n        if (options.icon) {\r\n          var whitespace = elementTemplates.whitespace.cloneNode(false);\r\n\r\n          // need to use <i> for icons in the button to prevent a breaking change\r\n          // note: switch to span in next major release\r\n          iconElement = (useFragment === true ? elementTemplates.i : elementTemplates.span).cloneNode(false);\r\n          iconElement.className = this.options.iconBase + ' ' + options.icon;\r\n\r\n          elementTemplates.fragment.appendChild(iconElement);\r\n          elementTemplates.fragment.appendChild(whitespace);\r\n        }\r\n\r\n        if (options.subtext) {\r\n          subtextElement = elementTemplates.subtext.cloneNode(false);\r\n          subtextElement.textContent = options.subtext;\r\n          textElement.appendChild(subtextElement);\r\n        }\r\n      }\r\n\r\n      if (useFragment === true) {\r\n        while (textElement.childNodes.length > 0) {\r\n          elementTemplates.fragment.appendChild(textElement.childNodes[0]);\r\n        }\r\n      } else {\r\n        elementTemplates.fragment.appendChild(textElement);\r\n      }\r\n\r\n      return elementTemplates.fragment;\r\n    },\r\n\r\n    label: function (options) {\r\n      var textElement = elementTemplates.text.cloneNode(false),\r\n          subtextElement,\r\n          iconElement;\r\n\r\n      textElement.innerHTML = options.display;\r\n\r\n      if (options.icon) {\r\n        var whitespace = elementTemplates.whitespace.cloneNode(false);\r\n\r\n        iconElement = elementTemplates.span.cloneNode(false);\r\n        iconElement.className = this.options.iconBase + ' ' + options.icon;\r\n\r\n        elementTemplates.fragment.appendChild(iconElement);\r\n        elementTemplates.fragment.appendChild(whitespace);\r\n      }\r\n\r\n      if (options.subtext) {\r\n        subtextElement = elementTemplates.subtext.cloneNode(false);\r\n        subtextElement.textContent = options.subtext;\r\n        textElement.appendChild(subtextElement);\r\n      }\r\n\r\n      elementTemplates.fragment.appendChild(textElement);\r\n\r\n      return elementTemplates.fragment;\r\n    }\r\n  };\r\n\r\n  var getOptionData = {\r\n    fromOption: function (option, type) {\r\n      var value;\r\n\r\n      switch (type) {\r\n        case 'divider':\r\n          value = option.getAttribute('data-divider') === 'true';\r\n          break;\r\n\r\n        case 'text':\r\n          value = option.textContent;\r\n          break;\r\n\r\n        case 'label':\r\n          value = option.label;\r\n          break;\r\n\r\n        case 'style':\r\n          value = option.style.cssText;\r\n          break;\r\n\r\n        case 'title':\r\n          value = option.title;\r\n          break;\r\n\r\n        default:\r\n          value = option.getAttribute('data-' + toKebabCase(type));\r\n          break;\r\n      }\r\n\r\n      return value;\r\n    },\r\n    fromDataSource: function (option, type) {\r\n      var value;\r\n\r\n      switch (type) {\r\n        case 'text':\r\n        case 'label':\r\n          value = option.text || option.value || '';\r\n          break;\r\n\r\n        default:\r\n          value = option[type];\r\n          break;\r\n      }\r\n\r\n      return value;\r\n    }\r\n  };\r\n\r\n  function showNoResults (searchMatch, searchValue) {\r\n    if (!searchMatch.length) {\r\n      elementTemplates.noResults.innerHTML = this.options.noneResultsText.replace('{0}', '\"' + htmlEscape(searchValue) + '\"');\r\n      this.$menuInner[0].firstChild.appendChild(elementTemplates.noResults);\r\n    }\r\n  }\r\n\r\n  function filterHidden (item) {\r\n    return !(item.hidden || this.options.hideDisabled && item.disabled);\r\n  }\r\n\r\n  var Selectpicker = function (element, options) {\r\n    var that = this;\r\n\r\n    // bootstrap-select has been initialized - revert valHooks.select.set back to its original function\r\n    if (!valHooks.useDefault) {\r\n      $.valHooks.select.set = valHooks._set;\r\n      valHooks.useDefault = true;\r\n    }\r\n\r\n    this.$element = $(element);\r\n    this.$newElement = null;\r\n    this.$button = null;\r\n    this.$menu = null;\r\n    this.options = options;\r\n    this.selectpicker = {\r\n      main: {\r\n        data: [],\r\n        optionQueue: elementTemplates.fragment.cloneNode(false),\r\n        hasMore: false\r\n      },\r\n      search: {\r\n        data: [],\r\n        hasMore: false\r\n      },\r\n      current: {}, // current is either equal to main or search depending on if a search is in progress\r\n      view: {},\r\n      // map of option values and their respective data (only used in conjunction with options.source)\r\n      optionValuesDataMap: {},\r\n      isSearching: false,\r\n      keydown: {\r\n        keyHistory: '',\r\n        resetKeyHistory: {\r\n          start: function () {\r\n            return setTimeout(function () {\r\n              that.selectpicker.keydown.keyHistory = '';\r\n            }, 800);\r\n          }\r\n        }\r\n      }\r\n    };\r\n\r\n    this.sizeInfo = {};\r\n\r\n    // Format window padding\r\n    var winPad = this.options.windowPadding;\r\n    if (typeof winPad === 'number') {\r\n      this.options.windowPadding = [winPad, winPad, winPad, winPad];\r\n    }\r\n\r\n    // Expose public methods\r\n    this.val = Selectpicker.prototype.val;\r\n    this.render = Selectpicker.prototype.render;\r\n    this.refresh = Selectpicker.prototype.refresh;\r\n    this.setStyle = Selectpicker.prototype.setStyle;\r\n    this.selectAll = Selectpicker.prototype.selectAll;\r\n    this.deselectAll = Selectpicker.prototype.deselectAll;\r\n    this.destroy = Selectpicker.prototype.destroy;\r\n    this.remove = Selectpicker.prototype.remove;\r\n    this.show = Selectpicker.prototype.show;\r\n    this.hide = Selectpicker.prototype.hide;\r\n\r\n    this.init();\r\n  };\r\n\r\n  Selectpicker.VERSION = '1.14.0-beta3';\r\n\r\n  // part of this is duplicated in i18n/defaults-en_US.js. Make sure to update both.\r\n  Selectpicker.DEFAULTS = {\r\n    noneSelectedText: 'Nothing selected',\r\n    noneResultsText: 'No results matched {0}',\r\n    countSelectedText: function (numSelected, numTotal) {\r\n      return (numSelected == 1) ? '{0} item selected' : '{0} items selected';\r\n    },\r\n    maxOptionsText: function (numAll, numGroup) {\r\n      return [\r\n        (numAll == 1) ? 'Limit reached ({n} item max)' : 'Limit reached ({n} items max)',\r\n        (numGroup == 1) ? 'Group limit reached ({n} item max)' : 'Group limit reached ({n} items max)'\r\n      ];\r\n    },\r\n    selectAllText: 'Select All',\r\n    deselectAllText: 'Deselect All',\r\n    source: {\r\n      pageSize: 40\r\n    },\r\n    chunkSize: 40,\r\n    doneButton: false,\r\n    doneButtonText: 'Close',\r\n    multipleSeparator: ', ',\r\n    styleBase: 'btn',\r\n    style: classNames.BUTTONCLASS,\r\n    size: 'auto',\r\n    title: null,\r\n    placeholder: null,\r\n    allowClear: false,\r\n    selectedTextFormat: 'values',\r\n    width: false,\r\n    container: false,\r\n    hideDisabled: false,\r\n    showSubtext: false,\r\n    showIcon: true,\r\n    showContent: true,\r\n    dropupAuto: true,\r\n    header: false,\r\n    liveSearch: false,\r\n    liveSearchPlaceholder: null,\r\n    liveSearchNormalize: false,\r\n    liveSearchStyle: 'contains',\r\n    actionsBox: false,\r\n    iconBase: classNames.ICONBASE,\r\n    tickIcon: classNames.TICKICON,\r\n    showTick: false,\r\n    template: {\r\n      caret: '<span class=\"caret\"></span>'\r\n    },\r\n    maxOptions: false,\r\n    mobile: false,\r\n    selectOnTab: true,\r\n    dropdownAlignRight: false,\r\n    windowPadding: 0,\r\n    virtualScroll: 600,\r\n    display: false,\r\n    sanitize: true,\r\n    sanitizeFn: null,\r\n    whiteList: DefaultWhitelist\r\n  };\r\n\r\n  Selectpicker.prototype = {\r\n\r\n    constructor: Selectpicker,\r\n\r\n    init: function () {\r\n      var that = this,\r\n          id = this.$element.attr('id'),\r\n          element = this.$element[0],\r\n          form = element.form;\r\n\r\n      selectId++;\r\n      this.selectId = 'bs-select-' + selectId;\r\n\r\n      element.classList.add('bs-select-hidden');\r\n\r\n      this.multiple = this.$element.prop('multiple');\r\n      this.autofocus = this.$element.prop('autofocus');\r\n\r\n      if (element.classList.contains('show-tick')) {\r\n        this.options.showTick = true;\r\n      }\r\n\r\n      this.$newElement = this.createDropdown();\r\n\r\n      this.$element\r\n        .after(this.$newElement)\r\n        .prependTo(this.$newElement);\r\n\r\n      // ensure select is associated with form element if it got unlinked after moving it inside newElement\r\n      if (form && element.form === null) {\r\n        if (!form.id) form.id = 'form-' + this.selectId;\r\n        element.setAttribute('form', form.id);\r\n      }\r\n\r\n      this.$button = this.$newElement.children('button');\r\n      if (this.options.allowClear) this.$clearButton = this.$button.children('.bs-select-clear-selected');\r\n      this.$menu = this.$newElement.children(Selector.MENU);\r\n      this.$menuInner = this.$menu.children('.inner');\r\n      this.$searchbox = this.$menu.find('input');\r\n\r\n      element.classList.remove('bs-select-hidden');\r\n\r\n      this.fetchData(function () {\r\n        that.render(true);\r\n        that.buildList();\r\n\r\n        requestAnimationFrame(function () {\r\n          that.$element.trigger('loaded' + EVENT_KEY);\r\n        });\r\n      });\r\n\r\n      if (this.options.dropdownAlignRight === true) this.$menu[0].classList.add(classNames.MENURIGHT);\r\n\r\n      if (typeof id !== 'undefined') {\r\n        this.$button.attr('data-id', id);\r\n      }\r\n\r\n      this.checkDisabled();\r\n      this.clickListener();\r\n\r\n      if (version.major > 4) this.dropdown = new Dropdown(this.$button[0]);\r\n\r\n      if (this.options.liveSearch) {\r\n        this.liveSearchListener();\r\n        this.focusedParent = this.$searchbox[0];\r\n      } else {\r\n        this.focusedParent = this.$menuInner[0];\r\n      }\r\n\r\n      this.setStyle();\r\n      this.setWidth();\r\n      if (this.options.container) {\r\n        this.selectPosition();\r\n      } else {\r\n        this.$element.on('hide' + EVENT_KEY, function () {\r\n          if (that.isVirtual()) {\r\n            // empty menu on close\r\n            var menuInner = that.$menuInner[0],\r\n                emptyMenu = menuInner.firstChild.cloneNode(false);\r\n\r\n            // replace the existing UL with an empty one - this is faster than $.empty() or innerHTML = ''\r\n            menuInner.replaceChild(emptyMenu, menuInner.firstChild);\r\n            menuInner.scrollTop = 0;\r\n          }\r\n        });\r\n      }\r\n      this.$menu.data('this', this);\r\n      this.$newElement.data('this', this);\r\n      if (this.options.mobile) this.mobile();\r\n\r\n      this.$newElement.on({\r\n        'hide.bs.dropdown': function (e) {\r\n          that.$element.trigger('hide' + EVENT_KEY, e);\r\n        },\r\n        'hidden.bs.dropdown': function (e) {\r\n          that.$element.trigger('hidden' + EVENT_KEY, e);\r\n        },\r\n        'show.bs.dropdown': function (e) {\r\n          that.$element.trigger('show' + EVENT_KEY, e);\r\n        },\r\n        'shown.bs.dropdown': function (e) {\r\n          that.$element.trigger('shown' + EVENT_KEY, e);\r\n        }\r\n      });\r\n\r\n      if (element.hasAttribute('required')) {\r\n        this.$element.on('invalid' + EVENT_KEY, function () {\r\n          that.$button[0].classList.add('bs-invalid');\r\n\r\n          that.$element\r\n            .on('shown' + EVENT_KEY + '.invalid', function () {\r\n              that.$element\r\n                .val(that.$element.val()) // set the value to hide the validation message in Chrome when menu is opened\r\n                .off('shown' + EVENT_KEY + '.invalid');\r\n            })\r\n            .on('rendered' + EVENT_KEY, function () {\r\n              // if select is no longer invalid, remove the bs-invalid class\r\n              if (this.validity.valid) that.$button[0].classList.remove('bs-invalid');\r\n              that.$element.off('rendered' + EVENT_KEY);\r\n            });\r\n\r\n          that.$button.on('blur' + EVENT_KEY, function () {\r\n            that.$element.trigger('focus').trigger('blur');\r\n            that.$button.off('blur' + EVENT_KEY);\r\n          });\r\n        });\r\n      }\r\n\r\n      if (form) {\r\n        $(form).on('reset' + EVENT_KEY, function () {\r\n          requestAnimationFrame(function () {\r\n            that.render();\r\n          });\r\n        });\r\n      }\r\n    },\r\n\r\n    createDropdown: function () {\r\n      // Options\r\n      // If we are multiple or showTick option is set, then add the show-tick class\r\n      var showTick = (this.multiple || this.options.showTick) ? ' show-tick' : '',\r\n          multiselectable = this.multiple ? ' aria-multiselectable=\"true\"' : '',\r\n          inputGroup = '',\r\n          autofocus = this.autofocus ? ' autofocus' : '';\r\n\r\n      if (version.major < 4 && this.$element.parent().hasClass('input-group')) {\r\n        inputGroup = ' input-group-btn';\r\n      }\r\n\r\n      // Elements\r\n      var drop,\r\n          header = '',\r\n          searchbox = '',\r\n          actionsbox = '',\r\n          donebutton = '',\r\n          clearButton = '';\r\n\r\n      if (this.options.header) {\r\n        header =\r\n          '<div class=\"' + classNames.POPOVERHEADER + '\">' +\r\n            '<button type=\"button\" class=\"close\" aria-hidden=\"true\">&times;</button>' +\r\n              this.options.header +\r\n          '</div>';\r\n      }\r\n\r\n      if (this.options.liveSearch) {\r\n        searchbox =\r\n          '<div class=\"bs-searchbox\">' +\r\n            '<input type=\"search\" class=\"form-control\" autocomplete=\"off\"' +\r\n              (\r\n                this.options.liveSearchPlaceholder === null ? ''\r\n                :\r\n                ' placeholder=\"' + htmlEscape(this.options.liveSearchPlaceholder) + '\"'\r\n              ) +\r\n              ' role=\"combobox\" aria-label=\"Search\" aria-controls=\"' + this.selectId + '\" aria-autocomplete=\"list\">' +\r\n          '</div>';\r\n      }\r\n\r\n      if (this.multiple && this.options.actionsBox) {\r\n        actionsbox =\r\n          '<div class=\"bs-actionsbox\">' +\r\n            '<div class=\"btn-group btn-group-sm\">' +\r\n              '<button type=\"button\" class=\"actions-btn bs-select-all btn ' + classNames.BUTTONCLASS + '\">' +\r\n                this.options.selectAllText +\r\n              '</button>' +\r\n              '<button type=\"button\" class=\"actions-btn bs-deselect-all btn ' + classNames.BUTTONCLASS + '\">' +\r\n                this.options.deselectAllText +\r\n              '</button>' +\r\n            '</div>' +\r\n          '</div>';\r\n      }\r\n\r\n      if (this.multiple && this.options.doneButton) {\r\n        donebutton =\r\n          '<div class=\"bs-donebutton\">' +\r\n            '<div class=\"btn-group\">' +\r\n              '<button type=\"button\" class=\"btn btn-sm ' + classNames.BUTTONCLASS + '\">' +\r\n                this.options.doneButtonText +\r\n              '</button>' +\r\n            '</div>' +\r\n          '</div>';\r\n      }\r\n\r\n      if (this.options.allowClear) {\r\n        clearButton = '<span class=\"close bs-select-clear-selected\" title=\"' + this.options.deselectAllText + '\"><span>&times;</span>';\r\n      }\r\n\r\n      drop =\r\n        '<div class=\"dropdown bootstrap-select' + showTick + inputGroup + '\">' +\r\n          '<button type=\"button\" tabindex=\"-1\" class=\"' +\r\n            this.options.styleBase +\r\n            ' dropdown-toggle\" ' +\r\n            (this.options.display === 'static' ? 'data-display=\"static\"' : '') +\r\n            Selector.DATA_TOGGLE +\r\n            autofocus +\r\n            ' role=\"combobox\" aria-owns=\"' +\r\n            this.selectId +\r\n            '\" aria-haspopup=\"listbox\" aria-expanded=\"false\">' +\r\n            '<div class=\"filter-option\">' +\r\n              '<div class=\"filter-option-inner\">' +\r\n                '<div class=\"filter-option-inner-inner\">&nbsp;</div>' +\r\n              '</div> ' +\r\n            '</div>' +\r\n            clearButton +\r\n            '</span>' +\r\n            (\r\n              version.major >= '4' ? ''\r\n              :\r\n              '<span class=\"bs-caret\">' +\r\n                this.options.template.caret +\r\n              '</span>'\r\n            ) +\r\n          '</button>' +\r\n          '<div class=\"' + classNames.MENU + ' ' + (version.major >= '4' ? '' : classNames.SHOW) + '\">' +\r\n            header +\r\n            searchbox +\r\n            actionsbox +\r\n            '<div class=\"inner ' + classNames.SHOW + '\" role=\"listbox\" id=\"' + this.selectId + '\" tabindex=\"-1\" ' + multiselectable + '>' +\r\n                '<ul class=\"' + classNames.MENU + ' inner ' + (version.major >= '4' ? classNames.SHOW : '') + '\" role=\"presentation\">' +\r\n                '</ul>' +\r\n            '</div>' +\r\n            donebutton +\r\n          '</div>' +\r\n        '</div>';\r\n\r\n      return $(drop);\r\n    },\r\n\r\n    setPositionData: function () {\r\n      this.selectpicker.view.canHighlight = [];\r\n      this.selectpicker.view.size = 0;\r\n      this.selectpicker.view.firstHighlightIndex = false;\r\n\r\n      for (var i = 0; i < this.selectpicker.current.data.length; i++) {\r\n        var li = this.selectpicker.current.data[i],\r\n            canHighlight = true;\r\n\r\n        if (li.type === 'divider') {\r\n          canHighlight = false;\r\n          li.height = this.sizeInfo.dividerHeight;\r\n        } else if (li.type === 'optgroup-label') {\r\n          canHighlight = false;\r\n          li.height = this.sizeInfo.dropdownHeaderHeight;\r\n        } else {\r\n          li.height = this.sizeInfo.liHeight;\r\n        }\r\n\r\n        if (li.disabled) canHighlight = false;\r\n\r\n        this.selectpicker.view.canHighlight.push(canHighlight);\r\n\r\n        if (canHighlight) {\r\n          this.selectpicker.view.size++;\r\n          li.posinset = this.selectpicker.view.size;\r\n          if (this.selectpicker.view.firstHighlightIndex === false) this.selectpicker.view.firstHighlightIndex = i;\r\n        }\r\n\r\n        li.position = (i === 0 ? 0 : this.selectpicker.current.data[i - 1].position) + li.height;\r\n      }\r\n    },\r\n\r\n    isVirtual: function () {\r\n      return (this.options.virtualScroll !== false) && (this.selectpicker.main.data.length >= this.options.virtualScroll) || this.options.virtualScroll === true;\r\n    },\r\n\r\n    createView: function (isSearching, setSize, refresh) {\r\n      var that = this,\r\n          scrollTop = 0;\r\n\r\n      this.selectpicker.isSearching = isSearching;\r\n      this.selectpicker.current = isSearching ? this.selectpicker.search : this.selectpicker.main;\r\n\r\n      this.setPositionData();\r\n\r\n      if (setSize) {\r\n        if (refresh) {\r\n          scrollTop = this.$menuInner[0].scrollTop;\r\n        } else if (!that.multiple) {\r\n          var element = that.$element[0],\r\n              selectedIndex = (element.options[element.selectedIndex] || {}).liIndex;\r\n\r\n          if (typeof selectedIndex === 'number' && that.options.size !== false) {\r\n            var selectedData = that.selectpicker.main.data[selectedIndex],\r\n                position = selectedData && selectedData.position;\r\n\r\n            if (position) {\r\n              scrollTop = position - ((that.sizeInfo.menuInnerHeight + that.sizeInfo.liHeight) / 2);\r\n            }\r\n          }\r\n        }\r\n      }\r\n\r\n      scroll(scrollTop, true);\r\n\r\n      this.$menuInner.off('scroll.createView').on('scroll.createView', function (e, updateValue) {\r\n        if (!that.noScroll) scroll(this.scrollTop, updateValue);\r\n        that.noScroll = false;\r\n      });\r\n\r\n      function scroll (scrollTop, init) {\r\n        var size = that.selectpicker.current.data.length,\r\n            chunks = [],\r\n            chunkSize,\r\n            chunkCount,\r\n            firstChunk,\r\n            lastChunk,\r\n            currentChunk,\r\n            prevPositions,\r\n            positionIsDifferent,\r\n            previousElements,\r\n            menuIsDifferent = true,\r\n            isVirtual = that.isVirtual();\r\n\r\n        that.selectpicker.view.scrollTop = scrollTop;\r\n\r\n        chunkSize = that.options.chunkSize; // number of options in a chunk\r\n        chunkCount = Math.ceil(size / chunkSize) || 1; // number of chunks\r\n\r\n        for (var i = 0; i < chunkCount; i++) {\r\n          var endOfChunk = (i + 1) * chunkSize;\r\n\r\n          if (i === chunkCount - 1) {\r\n            endOfChunk = size;\r\n          }\r\n\r\n          chunks[i] = [\r\n            (i) * chunkSize + (!i ? 0 : 1),\r\n            endOfChunk\r\n          ];\r\n\r\n          if (!size) break;\r\n\r\n          if (currentChunk === undefined && scrollTop - 1 <= that.selectpicker.current.data[endOfChunk - 1].position - that.sizeInfo.menuInnerHeight) {\r\n            currentChunk = i;\r\n          }\r\n        }\r\n\r\n        if (currentChunk === undefined) currentChunk = 0;\r\n\r\n        prevPositions = [that.selectpicker.view.position0, that.selectpicker.view.position1];\r\n\r\n        // always display previous, current, and next chunks\r\n        firstChunk = Math.max(0, currentChunk - 1);\r\n        lastChunk = Math.min(chunkCount - 1, currentChunk + 1);\r\n\r\n        that.selectpicker.view.position0 = isVirtual === false ? 0 : (Math.max(0, chunks[firstChunk][0]) || 0);\r\n        that.selectpicker.view.position1 = isVirtual === false ? size : (Math.min(size, chunks[lastChunk][1]) || 0);\r\n\r\n        positionIsDifferent = prevPositions[0] !== that.selectpicker.view.position0 || prevPositions[1] !== that.selectpicker.view.position1;\r\n\r\n        if (that.activeElement !== undefined) {\r\n          if (init) {\r\n            if (that.activeElement !== that.selectedElement) {\r\n              that.defocusItem(that.activeElement);\r\n            }\r\n            that.activeElement = undefined;\r\n          }\r\n\r\n          if (that.activeElement !== that.selectedElement) {\r\n            that.defocusItem(that.selectedElement);\r\n          }\r\n        }\r\n\r\n        if (that.prevActiveElement !== undefined && that.prevActiveElement !== that.activeElement && that.prevActiveElement !== that.selectedElement) {\r\n          that.defocusItem(that.prevActiveElement);\r\n        }\r\n\r\n        if (init || positionIsDifferent || that.selectpicker.current.hasMore) {\r\n          previousElements = that.selectpicker.view.visibleElements ? that.selectpicker.view.visibleElements.slice() : [];\r\n\r\n          if (isVirtual === false) {\r\n            that.selectpicker.view.visibleElements = that.selectpicker.current.elements;\r\n          } else {\r\n            that.selectpicker.view.visibleElements = that.selectpicker.current.elements.slice(that.selectpicker.view.position0, that.selectpicker.view.position1);\r\n          }\r\n\r\n          that.setOptionStatus();\r\n\r\n          // if searching, check to make sure the list has actually been updated before updating DOM\r\n          // this prevents unnecessary repaints\r\n          if (isSearching || (isVirtual === false && init)) menuIsDifferent = !isEqual(previousElements, that.selectpicker.view.visibleElements);\r\n\r\n          // if virtual scroll is disabled and not searching,\r\n          // menu should never need to be updated more than once\r\n          if ((init || isVirtual === true) && menuIsDifferent) {\r\n            var menuInner = that.$menuInner[0],\r\n                menuFragment = document.createDocumentFragment(),\r\n                emptyMenu = menuInner.firstChild.cloneNode(false),\r\n                marginTop,\r\n                marginBottom,\r\n                elements = that.selectpicker.view.visibleElements,\r\n                toSanitize = [];\r\n\r\n            // replace the existing UL with an empty one - this is faster than $.empty()\r\n            menuInner.replaceChild(emptyMenu, menuInner.firstChild);\r\n\r\n            for (var i = 0, visibleElementsLen = elements.length; i < visibleElementsLen; i++) {\r\n              var element = elements[i],\r\n                  elText,\r\n                  elementData;\r\n\r\n              if (that.options.sanitize) {\r\n                elText = element.lastChild;\r\n\r\n                if (elText) {\r\n                  elementData = that.selectpicker.current.data[i + that.selectpicker.view.position0];\r\n\r\n                  if (elementData && elementData.content && !elementData.sanitized) {\r\n                    toSanitize.push(elText);\r\n                    elementData.sanitized = true;\r\n                  }\r\n                }\r\n              }\r\n\r\n              menuFragment.appendChild(element);\r\n            }\r\n\r\n            if (that.options.sanitize && toSanitize.length) {\r\n              sanitizeHtml(toSanitize, that.options.whiteList, that.options.sanitizeFn);\r\n            }\r\n\r\n            if (isVirtual === true) {\r\n              marginTop = (that.selectpicker.view.position0 === 0 ? 0 : that.selectpicker.current.data[that.selectpicker.view.position0 - 1].position);\r\n              marginBottom = (that.selectpicker.view.position1 > size - 1 ? 0 : that.selectpicker.current.data[size - 1].position - that.selectpicker.current.data[that.selectpicker.view.position1 - 1].position);\r\n\r\n              menuInner.firstChild.style.marginTop = marginTop + 'px';\r\n              menuInner.firstChild.style.marginBottom = marginBottom + 'px';\r\n            } else {\r\n              menuInner.firstChild.style.marginTop = 0;\r\n              menuInner.firstChild.style.marginBottom = 0;\r\n            }\r\n\r\n            menuInner.firstChild.appendChild(menuFragment);\r\n\r\n            // if an option is encountered that is wider than the current menu width, update the menu width accordingly\r\n            // switch to ResizeObserver with increased browser support\r\n            if (isVirtual === true && that.sizeInfo.hasScrollBar) {\r\n              var menuInnerInnerWidth = menuInner.firstChild.offsetWidth;\r\n\r\n              if (init && menuInnerInnerWidth < that.sizeInfo.menuInnerInnerWidth && that.sizeInfo.totalMenuWidth > that.sizeInfo.selectWidth) {\r\n                menuInner.firstChild.style.minWidth = that.sizeInfo.menuInnerInnerWidth + 'px';\r\n              } else if (menuInnerInnerWidth > that.sizeInfo.menuInnerInnerWidth) {\r\n                // set to 0 to get actual width of menu\r\n                that.$menu[0].style.minWidth = 0;\r\n\r\n                var actualMenuWidth = menuInner.firstChild.offsetWidth;\r\n\r\n                if (actualMenuWidth > that.sizeInfo.menuInnerInnerWidth) {\r\n                  that.sizeInfo.menuInnerInnerWidth = actualMenuWidth;\r\n                  menuInner.firstChild.style.minWidth = that.sizeInfo.menuInnerInnerWidth + 'px';\r\n                }\r\n\r\n                // reset to default CSS styling\r\n                that.$menu[0].style.minWidth = '';\r\n              }\r\n            }\r\n          }\r\n\r\n          if ((!isSearching && that.options.source.data || isSearching && that.options.source.search) && that.selectpicker.current.hasMore && currentChunk === chunkCount - 1) {\r\n            // Don't load the next chunk until scrolling has started\r\n            // This prevents unnecessary requests while the user is typing if pageSize is <= chunkSize\r\n            if (scrollTop > 0) {\r\n              // Chunks use 0-based indexing, but pages use 1-based. Add 1 to convert and add 1 again to get next page\r\n              var page = Math.floor((currentChunk * that.options.chunkSize) / that.options.source.pageSize) + 2;\r\n\r\n              that.fetchData(function () {\r\n                that.render();\r\n                that.buildList(size, isSearching);\r\n                that.setPositionData();\r\n                scroll(scrollTop);\r\n              }, isSearching ? 'search' : 'data', page, isSearching ? that.selectpicker.search.previousValue : undefined);\r\n            }\r\n          }\r\n        }\r\n\r\n        that.prevActiveElement = that.activeElement;\r\n\r\n        if (!that.options.liveSearch) {\r\n          that.$menuInner.trigger('focus');\r\n        } else if (isSearching && init) {\r\n          var index = 0,\r\n              newActive;\r\n\r\n          if (!that.selectpicker.view.canHighlight[index]) {\r\n            index = 1 + that.selectpicker.view.canHighlight.slice(1).indexOf(true);\r\n          }\r\n\r\n          newActive = that.selectpicker.view.visibleElements[index];\r\n\r\n          that.defocusItem(that.selectpicker.view.currentActive);\r\n\r\n          that.activeElement = (that.selectpicker.current.data[index] || {}).element;\r\n\r\n          that.focusItem(newActive);\r\n        }\r\n      }\r\n\r\n      $(window)\r\n        .off('resize' + EVENT_KEY + '.' + this.selectId + '.createView')\r\n        .on('resize' + EVENT_KEY + '.' + this.selectId + '.createView', function () {\r\n          var isActive = that.$newElement.hasClass(classNames.SHOW);\r\n\r\n          if (isActive) scroll(that.$menuInner[0].scrollTop);\r\n        });\r\n    },\r\n\r\n    focusItem: function (li, liData, noStyle) {\r\n      if (li) {\r\n        liData = liData || this.selectpicker.current.data[this.selectpicker.current.elements.indexOf(this.activeElement)];\r\n        var a = li.firstChild;\r\n\r\n        if (a) {\r\n          a.setAttribute('aria-setsize', this.selectpicker.view.size);\r\n          a.setAttribute('aria-posinset', liData.posinset);\r\n\r\n          if (noStyle !== true) {\r\n            this.focusedParent.setAttribute('aria-activedescendant', a.id);\r\n            li.classList.add('active');\r\n            a.classList.add('active');\r\n          }\r\n        }\r\n      }\r\n    },\r\n\r\n    defocusItem: function (li) {\r\n      if (li) {\r\n        li.classList.remove('active');\r\n        if (li.firstChild) li.firstChild.classList.remove('active');\r\n      }\r\n    },\r\n\r\n    setPlaceholder: function () {\r\n      var that = this,\r\n          updateIndex = false;\r\n\r\n      if ((this.options.placeholder || this.options.allowClear) && !this.multiple) {\r\n        if (!this.selectpicker.view.titleOption) this.selectpicker.view.titleOption = document.createElement('option');\r\n\r\n        // this option doesn't create a new <li> element, but does add a new option at the start,\r\n        // so startIndex should increase to prevent having to check every option for the bs-title-option class\r\n        updateIndex = true;\r\n\r\n        var element = this.$element[0],\r\n            selectTitleOption = false,\r\n            titleNotAppended = !this.selectpicker.view.titleOption.parentNode,\r\n            selectedIndex = element.selectedIndex,\r\n            selectedOption = element.options[selectedIndex],\r\n            firstSelectable = element.querySelector('select > *:not(:disabled)'),\r\n            firstSelectableIndex = firstSelectable ? firstSelectable.index : 0,\r\n            navigation = window.performance && window.performance.getEntriesByType('navigation'),\r\n            // Safari doesn't support getEntriesByType('navigation') - fall back to performance.navigation\r\n            isNotBackForward = (navigation && navigation.length) ? navigation[0].type !== 'back_forward' : window.performance.navigation.type !== 2;\r\n\r\n        if (titleNotAppended) {\r\n          // Use native JS to prepend option (faster)\r\n          this.selectpicker.view.titleOption.className = 'bs-title-option';\r\n          this.selectpicker.view.titleOption.value = '';\r\n\r\n          // Check if selected or data-selected attribute is already set on an option. If not, select the titleOption option.\r\n          // the selected item may have been changed by user or programmatically before the bootstrap select plugin runs,\r\n          // if so, the select will have the data-selected attribute\r\n          selectTitleOption = !selectedOption || (selectedIndex === firstSelectableIndex && selectedOption.defaultSelected === false && this.$element.data('selected') === undefined);\r\n        }\r\n\r\n        if (titleNotAppended || this.selectpicker.view.titleOption.index !== 0) {\r\n          element.insertBefore(this.selectpicker.view.titleOption, element.firstChild);\r\n        }\r\n\r\n        // Set selected *after* appending to select,\r\n        // otherwise the option doesn't get selected in IE\r\n        // set using selectedIndex, as setting the selected attr to true here doesn't work in IE11\r\n        if (selectTitleOption && isNotBackForward) {\r\n          element.selectedIndex = 0;\r\n        } else if (document.readyState !== 'complete') {\r\n          // if navigation type is back_forward, there's a chance the select will have its value set by BFCache\r\n          // wait for that value to be set, then run render again\r\n          window.addEventListener('pageshow', function () {\r\n            if (that.selectpicker.view.displayedValue !== element.value) that.render();\r\n          });\r\n        }\r\n      }\r\n\r\n      return updateIndex;\r\n    },\r\n\r\n    fetchData: function (callback, type, page, searchValue) {\r\n      page = page || 1;\r\n      type = type || 'data';\r\n\r\n      var that = this,\r\n          data = this.options.source[type],\r\n          builtData;\r\n\r\n      if (data) {\r\n        this.options.virtualScroll = true;\r\n\r\n        if (typeof data === 'function') {\r\n          data.call(\r\n            this,\r\n            function (data, more, totalItems) {\r\n              var current = that.selectpicker[type === 'search' ? 'search' : 'main'];\r\n              current.hasMore = more;\r\n              current.totalItems = totalItems;\r\n              builtData = that.buildData(data, type);\r\n              callback.call(that, builtData);\r\n              that.$element.trigger('fetched' + EVENT_KEY);\r\n            },\r\n            page,\r\n            searchValue\r\n          );\r\n        } else if (Array.isArray(data)) {\r\n          builtData = that.buildData(data, type);\r\n          callback.call(that, builtData);\r\n        }\r\n      } else {\r\n        builtData = this.buildData(false, type);\r\n        callback.call(that, builtData);\r\n      }\r\n    },\r\n\r\n    buildData: function (data, type) {\r\n      var that = this;\r\n      var dataGetter = data === false ? getOptionData.fromOption : getOptionData.fromDataSource;\r\n\r\n      var optionSelector = ':not([hidden]):not([data-hidden=\"true\"]):not([style*=\"display: none\"])',\r\n          mainData = [],\r\n          startLen = this.selectpicker.main.data ? this.selectpicker.main.data.length : 0,\r\n          optID = 0,\r\n          startIndex = this.setPlaceholder() && !data ? 1 : 0; // append the titleOption if necessary and skip the first option in the loop\r\n\r\n      if (type === 'search') {\r\n        startLen = this.selectpicker.search.data.length;\r\n      }\r\n\r\n      if (this.options.hideDisabled) optionSelector += ':not(:disabled)';\r\n\r\n      var selectOptions = data ? data.filter(filterHidden, this) : this.$element[0].querySelectorAll('select > *' + optionSelector);\r\n\r\n      function addDivider (config) {\r\n        var previousData = mainData[mainData.length - 1];\r\n\r\n        // ensure optgroup doesn't create back-to-back dividers\r\n        if (\r\n          previousData &&\r\n          previousData.type === 'divider' &&\r\n          (previousData.optID || config.optID)\r\n        ) {\r\n          return;\r\n        }\r\n\r\n        config = config || {};\r\n        config.type = 'divider';\r\n\r\n        mainData.push(config);\r\n      }\r\n\r\n      function addOption (item, config) {\r\n        config = config || {};\r\n\r\n        config.divider = dataGetter(item, 'divider');\r\n\r\n        if (config.divider === true) {\r\n          addDivider({\r\n            optID: config.optID\r\n          });\r\n        } else {\r\n          var liIndex = mainData.length + startLen,\r\n              cssText = dataGetter(item, 'style'),\r\n              inlineStyle = cssText ? htmlEscape(cssText) : '',\r\n              optionClass = (item.className || '') + (config.optgroupClass || '');\r\n\r\n          if (config.optID) optionClass = 'opt ' + optionClass;\r\n\r\n          config.optionClass = optionClass.trim();\r\n          config.inlineStyle = inlineStyle;\r\n\r\n          config.text = dataGetter(item, 'text');\r\n          config.title = dataGetter(item, 'title');\r\n          config.content = dataGetter(item, 'content');\r\n          config.tokens = dataGetter(item, 'tokens');\r\n          config.subtext = dataGetter(item, 'subtext');\r\n          config.icon = dataGetter(item, 'icon');\r\n\r\n          config.display = config.content || config.text;\r\n          config.value = item.value === undefined ? item.text : item.value;\r\n          config.type = 'option';\r\n          config.index = liIndex;\r\n\r\n          config.option = !item.option ? item : item.option; // reference option element if it exists\r\n          config.option.liIndex = liIndex;\r\n          config.selected = !!item.selected;\r\n          config.disabled = config.disabled || !!item.disabled;\r\n\r\n          if (data !== false) {\r\n            if (that.selectpicker.optionValuesDataMap[config.value]) {\r\n              config = $.extend(that.selectpicker.optionValuesDataMap[config.value], config);\r\n            } else {\r\n              that.selectpicker.optionValuesDataMap[config.value] = config;\r\n            }\r\n          }\r\n\r\n          mainData.push(config);\r\n        }\r\n      }\r\n\r\n      function addOptgroup (index, selectOptions) {\r\n        var optgroup = selectOptions[index],\r\n            // skip placeholder option\r\n            previous = index - 1 < startIndex ? false : selectOptions[index - 1],\r\n            next = selectOptions[index + 1],\r\n            options = data ? optgroup.children.filter(filterHidden, this) : optgroup.querySelectorAll('option' + optionSelector);\r\n\r\n        if (!options.length) return;\r\n\r\n        var config = {\r\n              display: htmlEscape(dataGetter(item, 'label')),\r\n              subtext: dataGetter(optgroup, 'subtext'),\r\n              icon: dataGetter(optgroup, 'icon'),\r\n              type: 'optgroup-label',\r\n              optgroupClass: ' ' + (optgroup.className || ''),\r\n              optgroup: optgroup\r\n            },\r\n            headerIndex,\r\n            lastIndex;\r\n\r\n        optID++;\r\n\r\n        if (previous) {\r\n          addDivider({ optID: optID });\r\n        }\r\n\r\n        config.optID = optID;\r\n\r\n        mainData.push(config);\r\n\r\n        for (var j = 0, len = options.length; j < len; j++) {\r\n          var option = options[j];\r\n\r\n          if (j === 0) {\r\n            headerIndex = mainData.length - 1;\r\n            lastIndex = headerIndex + len;\r\n          }\r\n\r\n          addOption(option, {\r\n            headerIndex: headerIndex,\r\n            lastIndex: lastIndex,\r\n            optID: config.optID,\r\n            optgroupClass: config.optgroupClass,\r\n            disabled: optgroup.disabled\r\n          });\r\n        }\r\n\r\n        if (next) {\r\n          addDivider({ optID: optID });\r\n        }\r\n      }\r\n\r\n      for (var len = selectOptions.length, i = startIndex; i < len; i++) {\r\n        var item = selectOptions[i],\r\n            children = item.children;\r\n\r\n        if (children && children.length) {\r\n          addOptgroup.call(this, i, selectOptions);\r\n        } else {\r\n          addOption.call(this, item, {});\r\n        }\r\n      }\r\n\r\n      switch (type) {\r\n        case 'data': {\r\n          if (!this.selectpicker.main.data) {\r\n            this.selectpicker.main.data = [];\r\n          }\r\n          Array.prototype.push.apply(this.selectpicker.main.data, mainData);\r\n          this.selectpicker.current.data = this.selectpicker.main.data;\r\n          break;\r\n        }\r\n        case 'search': {\r\n          Array.prototype.push.apply(this.selectpicker.search.data, mainData);\r\n          break;\r\n        }\r\n      }\r\n\r\n      return mainData;\r\n    },\r\n\r\n    buildList: function (size, searching) {\r\n      var that = this,\r\n          selectData = searching ? this.selectpicker.search.data : this.selectpicker.main.data,\r\n          mainElements = [],\r\n          widestOptionLength = 0;\r\n\r\n      if ((that.options.showTick || that.multiple) && !elementTemplates.checkMark.parentNode) {\r\n        elementTemplates.checkMark.className = this.options.iconBase + ' ' + that.options.tickIcon + ' check-mark';\r\n        elementTemplates.a.appendChild(elementTemplates.checkMark);\r\n      }\r\n\r\n      function buildElement (mainElements, item) {\r\n        var liElement,\r\n            combinedLength = 0;\r\n\r\n        switch (item.type) {\r\n          case 'divider':\r\n            liElement = generateOption.li(\r\n              false,\r\n              classNames.DIVIDER,\r\n              (item.optID ? item.optID + 'div' : undefined)\r\n            );\r\n\r\n            break;\r\n\r\n          case 'option':\r\n            liElement = generateOption.li(\r\n              generateOption.a(\r\n                generateOption.text.call(that, item),\r\n                item.optionClass,\r\n                item.inlineStyle\r\n              ),\r\n              '',\r\n              item.optID\r\n            );\r\n\r\n            if (liElement.firstChild) {\r\n              liElement.firstChild.id = that.selectId + '-' + item.index;\r\n            }\r\n\r\n            break;\r\n\r\n          case 'optgroup-label':\r\n            liElement = generateOption.li(\r\n              generateOption.label.call(that, item),\r\n              'dropdown-header' + item.optgroupClass,\r\n              item.optID\r\n            );\r\n\r\n            break;\r\n        }\r\n\r\n        if (!item.element) {\r\n          item.element = liElement;\r\n        } else {\r\n          item.element.innerHTML = liElement.innerHTML;\r\n        }\r\n        mainElements.push(item.element);\r\n\r\n        // count the number of characters in the option - not perfect, but should work in most cases\r\n        if (item.display) combinedLength += item.display.length;\r\n        if (item.subtext) combinedLength += item.subtext.length;\r\n        // if there is an icon, ensure this option's width is checked\r\n        if (item.icon) combinedLength += 1;\r\n\r\n        if (combinedLength > widestOptionLength) {\r\n          widestOptionLength = combinedLength;\r\n\r\n          // guess which option is the widest\r\n          // use this when calculating menu width\r\n          // not perfect, but it's fast, and the width will be updating accordingly when scrolling\r\n          that.selectpicker.view.widestOption = mainElements[mainElements.length - 1];\r\n        }\r\n      }\r\n\r\n      var startIndex = size || 0;\r\n\r\n      for (var len = selectData.length, i = startIndex; i < len; i++) {\r\n        var item = selectData[i];\r\n\r\n        buildElement(mainElements, item);\r\n      }\r\n\r\n      if (size) {\r\n        if (searching) {\r\n          Array.prototype.push.apply(this.selectpicker.search.elements, mainElements);\r\n        } else {\r\n          Array.prototype.push.apply(this.selectpicker.main.elements, mainElements);\r\n          this.selectpicker.current.elements = this.selectpicker.main.elements;\r\n        }\r\n      } else {\r\n        if (searching) {\r\n          this.selectpicker.search.elements = mainElements;\r\n        } else {\r\n          this.selectpicker.main.elements = this.selectpicker.current.elements = mainElements;\r\n        }\r\n      }\r\n    },\r\n\r\n    findLis: function () {\r\n      return this.$menuInner.find('.inner > li');\r\n    },\r\n\r\n    render: function (init) {\r\n      var that = this,\r\n          element = this.$element[0],\r\n          // ensure titleOption is appended and selected (if necessary) before getting selectedOptions\r\n          placeholderSelected = this.setPlaceholder() && element.selectedIndex === 0,\r\n          selectedOptions = getSelectedOptions.call(this),\r\n          selectedCount = selectedOptions.length,\r\n          selectedValues = getSelectValues.call(this, selectedOptions),\r\n          button = this.$button[0],\r\n          buttonInner = button.querySelector('.filter-option-inner-inner'),\r\n          multipleSeparator = document.createTextNode(this.options.multipleSeparator),\r\n          titleFragment = elementTemplates.fragment.cloneNode(false),\r\n          showCount,\r\n          countMax,\r\n          hasContent = false;\r\n\r\n      function createSelected (item) {\r\n        if (item.selected) {\r\n          that.createOption(item, true);\r\n        } else if (item.children && item.children.length) {\r\n          item.children.map(createSelected);\r\n        }\r\n      }\r\n\r\n      // create selected option elements to ensure select value is correct\r\n      if (this.options.source.data && init) {\r\n        selectedOptions.map(createSelected);\r\n        element.appendChild(this.selectpicker.main.optionQueue);\r\n\r\n        if (placeholderSelected) placeholderSelected = element.selectedIndex === 0;\r\n      }\r\n\r\n      button.classList.toggle('bs-placeholder', that.multiple ? !selectedCount : !selectedValues && selectedValues !== 0);\r\n\r\n      if (!that.multiple && selectedOptions.length === 1) {\r\n        that.selectpicker.view.displayedValue = selectedValues;\r\n      }\r\n\r\n      if (this.options.selectedTextFormat === 'static') {\r\n        titleFragment = generateOption.text.call(this, { text: this.options.placeholder }, true);\r\n      } else {\r\n        showCount = this.multiple && this.options.selectedTextFormat.indexOf('count') !== -1 && selectedCount > 0;\r\n\r\n        // determine if the number of selected options will be shown (showCount === true)\r\n        if (showCount) {\r\n          countMax = this.options.selectedTextFormat.split('>');\r\n          showCount = (countMax.length > 1 && selectedCount > countMax[1]) || (countMax.length === 1 && selectedCount >= 2);\r\n        }\r\n\r\n        // only loop through all selected options if the count won't be shown\r\n        if (showCount === false) {\r\n          if (!placeholderSelected) {\r\n            for (var selectedIndex = 0; selectedIndex < selectedCount; selectedIndex++) {\r\n              if (selectedIndex < 50) {\r\n                var option = selectedOptions[selectedIndex],\r\n                    titleOptions = {};\r\n\r\n                if (option) {\r\n                  if (this.multiple && selectedIndex > 0) {\r\n                    titleFragment.appendChild(multipleSeparator.cloneNode(false));\r\n                  }\r\n\r\n                  if (option.title) {\r\n                    titleOptions.text = option.title;\r\n                  } else if (option.content && that.options.showContent) {\r\n                    titleOptions.content = option.content.toString();\r\n                    hasContent = true;\r\n                  } else {\r\n                    if (that.options.showIcon) {\r\n                      titleOptions.icon = option.icon;\r\n                    }\r\n                    if (that.options.showSubtext && !that.multiple && option.subtext) titleOptions.subtext = ' ' + option.subtext;\r\n                    titleOptions.text = option.text.trim();\r\n                  }\r\n\r\n                  titleFragment.appendChild(generateOption.text.call(this, titleOptions, true));\r\n                }\r\n              } else {\r\n                break;\r\n              }\r\n            }\r\n\r\n            // add ellipsis\r\n            if (selectedCount > 49) {\r\n              titleFragment.appendChild(document.createTextNode('...'));\r\n            }\r\n          }\r\n        } else {\r\n          var optionSelector = ':not([hidden]):not([data-hidden=\"true\"]):not([data-divider=\"true\"]):not([style*=\"display: none\"])';\r\n          if (this.options.hideDisabled) optionSelector += ':not(:disabled)';\r\n\r\n          // If this is a multiselect, and selectedTextFormat is count, then show 1 of 2 selected, etc.\r\n          var totalCount = this.$element[0].querySelectorAll('select > option' + optionSelector + ', optgroup' + optionSelector + ' option' + optionSelector).length,\r\n              tr8nText = (typeof this.options.countSelectedText === 'function') ? this.options.countSelectedText(selectedCount, totalCount) : this.options.countSelectedText;\r\n\r\n          titleFragment = generateOption.text.call(this, {\r\n            text: tr8nText.replace('{0}', selectedCount.toString()).replace('{1}', totalCount.toString())\r\n          }, true);\r\n        }\r\n      }\r\n\r\n      // If the select doesn't have a title, then use the default, or if nothing is set at all, use noneSelectedText\r\n      if (!titleFragment.childNodes.length) {\r\n        titleFragment = generateOption.text.call(this, {\r\n          text: this.options.placeholder ? this.options.placeholder : this.options.noneSelectedText\r\n        }, true);\r\n      }\r\n\r\n      // if the select has a title, apply it to the button, and if not, apply titleFragment text\r\n      // strip all HTML tags and trim the result, then unescape any escaped tags\r\n      button.title = titleFragment.textContent.replace(/<[^>]*>?/g, '').trim();\r\n\r\n      if (this.options.sanitize && hasContent) {\r\n        sanitizeHtml([titleFragment], that.options.whiteList, that.options.sanitizeFn);\r\n      }\r\n\r\n      buttonInner.innerHTML = '';\r\n      buttonInner.appendChild(titleFragment);\r\n\r\n      if (version.major < 4 && this.$newElement[0].classList.contains('bs3-has-addon')) {\r\n        var filterExpand = button.querySelector('.filter-expand'),\r\n            clone = buttonInner.cloneNode(true);\r\n\r\n        clone.className = 'filter-expand';\r\n\r\n        if (filterExpand) {\r\n          button.replaceChild(clone, filterExpand);\r\n        } else {\r\n          button.appendChild(clone);\r\n        }\r\n      }\r\n\r\n      this.$element.trigger('rendered' + EVENT_KEY);\r\n    },\r\n\r\n    /**\r\n     * @param [style]\r\n     * @param [status]\r\n     */\r\n    setStyle: function (newStyle, status) {\r\n      var button = this.$button[0],\r\n          newElement = this.$newElement[0],\r\n          style = this.options.style.trim(),\r\n          buttonClass;\r\n\r\n      if (this.$element.attr('class')) {\r\n        this.$newElement.addClass(this.$element.attr('class').replace(/selectpicker|mobile-device|bs-select-hidden|validate\\[.*\\]/gi, ''));\r\n      }\r\n\r\n      if (version.major < 4) {\r\n        newElement.classList.add('bs3');\r\n\r\n        if (newElement.parentNode.classList && newElement.parentNode.classList.contains('input-group') &&\r\n            (newElement.previousElementSibling || newElement.nextElementSibling) &&\r\n            (newElement.previousElementSibling || newElement.nextElementSibling).classList.contains('input-group-addon')\r\n        ) {\r\n          newElement.classList.add('bs3-has-addon');\r\n        }\r\n      }\r\n\r\n      if (newStyle) {\r\n        buttonClass = newStyle.trim();\r\n      } else {\r\n        buttonClass = style;\r\n      }\r\n\r\n      if (status == 'add') {\r\n        if (buttonClass) button.classList.add.apply(button.classList, buttonClass.split(' '));\r\n      } else if (status == 'remove') {\r\n        if (buttonClass) button.classList.remove.apply(button.classList, buttonClass.split(' '));\r\n      } else {\r\n        if (style) button.classList.remove.apply(button.classList, style.split(' '));\r\n        if (buttonClass) button.classList.add.apply(button.classList, buttonClass.split(' '));\r\n      }\r\n    },\r\n\r\n    liHeight: function (refresh) {\r\n      if (!refresh && (this.options.size === false || Object.keys(this.sizeInfo).length)) return;\r\n\r\n      var newElement = elementTemplates.div.cloneNode(false),\r\n          menu = elementTemplates.div.cloneNode(false),\r\n          menuInner = elementTemplates.div.cloneNode(false),\r\n          menuInnerInner = document.createElement('ul'),\r\n          divider = elementTemplates.li.cloneNode(false),\r\n          dropdownHeader = elementTemplates.li.cloneNode(false),\r\n          li,\r\n          a = elementTemplates.a.cloneNode(false),\r\n          text = elementTemplates.span.cloneNode(false),\r\n          header = this.options.header && this.$menu.find('.' + classNames.POPOVERHEADER).length > 0 ? this.$menu.find('.' + classNames.POPOVERHEADER)[0].cloneNode(true) : null,\r\n          search = this.options.liveSearch ? elementTemplates.div.cloneNode(false) : null,\r\n          actions = this.options.actionsBox && this.multiple && this.$menu.find('.bs-actionsbox').length > 0 ? this.$menu.find('.bs-actionsbox')[0].cloneNode(true) : null,\r\n          doneButton = this.options.doneButton && this.multiple && this.$menu.find('.bs-donebutton').length > 0 ? this.$menu.find('.bs-donebutton')[0].cloneNode(true) : null,\r\n          firstOption = this.$element[0].options[0];\r\n\r\n      this.sizeInfo.selectWidth = this.$newElement[0].offsetWidth;\r\n\r\n      text.className = 'text';\r\n      a.className = 'dropdown-item ' + (firstOption ? firstOption.className : '');\r\n      newElement.className = this.$menu[0].parentNode.className + ' ' + classNames.SHOW;\r\n      newElement.style.width = 0; // ensure button width doesn't affect natural width of menu when calculating\r\n      if (this.options.width === 'auto') menu.style.minWidth = 0;\r\n      menu.className = classNames.MENU + ' ' + classNames.SHOW;\r\n      menuInner.className = 'inner ' + classNames.SHOW;\r\n      menuInnerInner.className = classNames.MENU + ' inner ' + (version.major >= '4' ? classNames.SHOW : '');\r\n      divider.className = classNames.DIVIDER;\r\n      dropdownHeader.className = 'dropdown-header';\r\n\r\n      text.appendChild(document.createTextNode('\\u200b'));\r\n\r\n      if (this.selectpicker.current.data.length) {\r\n        for (var i = 0; i < this.selectpicker.current.data.length; i++) {\r\n          var data = this.selectpicker.current.data[i];\r\n          if (data.type === 'option' && $(data.element.firstChild).css('display') !== 'none') {\r\n            li = data.element;\r\n            break;\r\n          }\r\n        }\r\n      } else {\r\n        li = elementTemplates.li.cloneNode(false);\r\n        a.appendChild(text);\r\n        li.appendChild(a);\r\n      }\r\n\r\n      dropdownHeader.appendChild(text.cloneNode(true));\r\n\r\n      if (this.selectpicker.view.widestOption) {\r\n        menuInnerInner.appendChild(this.selectpicker.view.widestOption.cloneNode(true));\r\n      }\r\n\r\n      menuInnerInner.appendChild(li);\r\n      menuInnerInner.appendChild(divider);\r\n      menuInnerInner.appendChild(dropdownHeader);\r\n      if (header) menu.appendChild(header);\r\n      if (search) {\r\n        var input = document.createElement('input');\r\n        search.className = 'bs-searchbox';\r\n        input.className = 'form-control';\r\n        search.appendChild(input);\r\n        menu.appendChild(search);\r\n      }\r\n      if (actions) menu.appendChild(actions);\r\n      menuInner.appendChild(menuInnerInner);\r\n      menu.appendChild(menuInner);\r\n      if (doneButton) menu.appendChild(doneButton);\r\n      newElement.appendChild(menu);\r\n\r\n      document.body.appendChild(newElement);\r\n\r\n      var liHeight = li.offsetHeight,\r\n          dropdownHeaderHeight = dropdownHeader ? dropdownHeader.offsetHeight : 0,\r\n          headerHeight = header ? header.offsetHeight : 0,\r\n          searchHeight = search ? search.offsetHeight : 0,\r\n          actionsHeight = actions ? actions.offsetHeight : 0,\r\n          doneButtonHeight = doneButton ? doneButton.offsetHeight : 0,\r\n          dividerHeight = $(divider).outerHeight(true),\r\n          menuStyle = window.getComputedStyle(menu),\r\n          menuWidth = menu.offsetWidth,\r\n          menuPadding = {\r\n            vert: toInteger(menuStyle.paddingTop) +\r\n                  toInteger(menuStyle.paddingBottom) +\r\n                  toInteger(menuStyle.borderTopWidth) +\r\n                  toInteger(menuStyle.borderBottomWidth),\r\n            horiz: toInteger(menuStyle.paddingLeft) +\r\n                  toInteger(menuStyle.paddingRight) +\r\n                  toInteger(menuStyle.borderLeftWidth) +\r\n                  toInteger(menuStyle.borderRightWidth)\r\n          },\r\n          menuExtras = {\r\n            vert: menuPadding.vert +\r\n                  toInteger(menuStyle.marginTop) +\r\n                  toInteger(menuStyle.marginBottom) + 2,\r\n            horiz: menuPadding.horiz +\r\n                  toInteger(menuStyle.marginLeft) +\r\n                  toInteger(menuStyle.marginRight) + 2\r\n          },\r\n          scrollBarWidth;\r\n\r\n      menuInner.style.overflowY = 'scroll';\r\n\r\n      scrollBarWidth = menu.offsetWidth - menuWidth;\r\n\r\n      document.body.removeChild(newElement);\r\n\r\n      this.sizeInfo.liHeight = liHeight;\r\n      this.sizeInfo.dropdownHeaderHeight = dropdownHeaderHeight;\r\n      this.sizeInfo.headerHeight = headerHeight;\r\n      this.sizeInfo.searchHeight = searchHeight;\r\n      this.sizeInfo.actionsHeight = actionsHeight;\r\n      this.sizeInfo.doneButtonHeight = doneButtonHeight;\r\n      this.sizeInfo.dividerHeight = dividerHeight;\r\n      this.sizeInfo.menuPadding = menuPadding;\r\n      this.sizeInfo.menuExtras = menuExtras;\r\n      this.sizeInfo.menuWidth = menuWidth;\r\n      this.sizeInfo.menuInnerInnerWidth = menuWidth - menuPadding.horiz;\r\n      this.sizeInfo.totalMenuWidth = this.sizeInfo.menuWidth;\r\n      this.sizeInfo.scrollBarWidth = scrollBarWidth;\r\n      this.sizeInfo.selectHeight = this.$newElement[0].offsetHeight;\r\n\r\n      this.setPositionData();\r\n    },\r\n\r\n    getSelectPosition: function () {\r\n      var that = this,\r\n          $window = $(window),\r\n          pos = that.$newElement.offset(),\r\n          $container = $(that.options.container),\r\n          containerPos;\r\n\r\n      if (that.options.container && $container.length && !$container.is('body')) {\r\n        containerPos = $container.offset();\r\n        containerPos.top += parseInt($container.css('borderTopWidth'));\r\n        containerPos.left += parseInt($container.css('borderLeftWidth'));\r\n      } else {\r\n        containerPos = { top: 0, left: 0 };\r\n      }\r\n\r\n      var winPad = that.options.windowPadding;\r\n\r\n      this.sizeInfo.selectOffsetTop = pos.top - containerPos.top - $window.scrollTop();\r\n      this.sizeInfo.selectOffsetBot = $window.height() - this.sizeInfo.selectOffsetTop - this.sizeInfo.selectHeight - containerPos.top - winPad[2];\r\n      this.sizeInfo.selectOffsetLeft = pos.left - containerPos.left - $window.scrollLeft();\r\n      this.sizeInfo.selectOffsetRight = $window.width() - this.sizeInfo.selectOffsetLeft - this.sizeInfo.selectWidth - containerPos.left - winPad[1];\r\n      this.sizeInfo.selectOffsetTop -= winPad[0];\r\n      this.sizeInfo.selectOffsetLeft -= winPad[3];\r\n    },\r\n\r\n    setMenuSize: function (isAuto) {\r\n      this.getSelectPosition();\r\n\r\n      var selectWidth = this.sizeInfo.selectWidth,\r\n          liHeight = this.sizeInfo.liHeight,\r\n          headerHeight = this.sizeInfo.headerHeight,\r\n          searchHeight = this.sizeInfo.searchHeight,\r\n          actionsHeight = this.sizeInfo.actionsHeight,\r\n          doneButtonHeight = this.sizeInfo.doneButtonHeight,\r\n          divHeight = this.sizeInfo.dividerHeight,\r\n          menuPadding = this.sizeInfo.menuPadding,\r\n          menuInnerHeight,\r\n          menuHeight,\r\n          divLength = 0,\r\n          minHeight,\r\n          _minHeight,\r\n          maxHeight,\r\n          menuInnerMinHeight,\r\n          estimate,\r\n          isDropup;\r\n\r\n      if (this.options.dropupAuto) {\r\n        // Get the estimated height of the menu without scrollbars.\r\n        // This is useful for smaller menus, where there might be plenty of room\r\n        // below the button without setting dropup, but we can't know\r\n        // the exact height of the menu until createView is called later\r\n        estimate = liHeight * this.selectpicker.current.data.length + menuPadding.vert;\r\n\r\n        isDropup = this.sizeInfo.selectOffsetTop - this.sizeInfo.selectOffsetBot > this.sizeInfo.menuExtras.vert && estimate + this.sizeInfo.menuExtras.vert + 50 > this.sizeInfo.selectOffsetBot;\r\n\r\n        // ensure dropup doesn't change while searching (so menu doesn't bounce back and forth)\r\n        if (this.selectpicker.isSearching === true) {\r\n          isDropup = this.selectpicker.dropup;\r\n        }\r\n\r\n        this.$newElement.toggleClass(classNames.DROPUP, isDropup);\r\n        this.selectpicker.dropup = isDropup;\r\n      }\r\n\r\n      if (this.options.size === 'auto') {\r\n        _minHeight = this.selectpicker.current.data.length > 3 ? this.sizeInfo.liHeight * 3 + this.sizeInfo.menuExtras.vert - 2 : 0;\r\n        menuHeight = this.sizeInfo.selectOffsetBot - this.sizeInfo.menuExtras.vert;\r\n        minHeight = _minHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight;\r\n        menuInnerMinHeight = Math.max(_minHeight - menuPadding.vert, 0);\r\n\r\n        if (this.$newElement.hasClass(classNames.DROPUP)) {\r\n          menuHeight = this.sizeInfo.selectOffsetTop - this.sizeInfo.menuExtras.vert;\r\n        }\r\n\r\n        maxHeight = menuHeight;\r\n        menuInnerHeight = menuHeight - headerHeight - searchHeight - actionsHeight - doneButtonHeight - menuPadding.vert;\r\n      } else if (this.options.size && this.options.size != 'auto' && this.selectpicker.current.elements.length > this.options.size) {\r\n        for (var i = 0; i < this.options.size; i++) {\r\n          if (this.selectpicker.current.data[i].type === 'divider') divLength++;\r\n        }\r\n\r\n        menuHeight = liHeight * this.options.size + divLength * divHeight + menuPadding.vert;\r\n        menuInnerHeight = menuHeight - menuPadding.vert;\r\n        maxHeight = menuHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight;\r\n        minHeight = menuInnerMinHeight = '';\r\n      }\r\n\r\n      this.$menu.css({\r\n        'max-height': maxHeight + 'px',\r\n        'overflow': 'hidden',\r\n        'min-height': minHeight + 'px'\r\n      });\r\n\r\n      this.$menuInner.css({\r\n        'max-height': menuInnerHeight + 'px',\r\n        'overflow': 'hidden auto',\r\n        'min-height': menuInnerMinHeight + 'px'\r\n      });\r\n\r\n      // ensure menuInnerHeight is always a positive number to prevent issues calculating chunkSize in createView\r\n      this.sizeInfo.menuInnerHeight = Math.max(menuInnerHeight, 1);\r\n\r\n      if (this.selectpicker.current.data.length && this.selectpicker.current.data[this.selectpicker.current.data.length - 1].position > this.sizeInfo.menuInnerHeight) {\r\n        this.sizeInfo.hasScrollBar = true;\r\n        this.sizeInfo.totalMenuWidth = this.sizeInfo.menuWidth + this.sizeInfo.scrollBarWidth;\r\n      }\r\n\r\n      if (this.options.dropdownAlignRight === 'auto') {\r\n        this.$menu.toggleClass(classNames.MENURIGHT, this.sizeInfo.selectOffsetLeft > this.sizeInfo.selectOffsetRight && this.sizeInfo.selectOffsetRight < (this.sizeInfo.totalMenuWidth - selectWidth));\r\n      }\r\n\r\n      if (this.dropdown && this.dropdown._popper) this.dropdown._popper.update();\r\n    },\r\n\r\n    setSize: function (refresh) {\r\n      this.liHeight(refresh);\r\n\r\n      if (this.options.header) this.$menu.css('padding-top', 0);\r\n\r\n      if (this.options.size !== false) {\r\n        var that = this,\r\n            $window = $(window);\r\n\r\n        this.setMenuSize();\r\n\r\n        if (this.options.liveSearch) {\r\n          this.$searchbox\r\n            .off('input.setMenuSize propertychange.setMenuSize')\r\n            .on('input.setMenuSize propertychange.setMenuSize', function () {\r\n              return that.setMenuSize();\r\n            });\r\n        }\r\n\r\n        if (this.options.size === 'auto') {\r\n          $window\r\n            .off('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize')\r\n            .on('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize', function () {\r\n              return that.setMenuSize();\r\n            });\r\n        } else if (this.options.size && this.options.size != 'auto' && this.selectpicker.current.elements.length > this.options.size) {\r\n          $window.off('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize');\r\n        }\r\n      }\r\n\r\n      this.createView(false, true, refresh);\r\n    },\r\n\r\n    setWidth: function () {\r\n      var that = this;\r\n\r\n      if (this.options.width === 'auto') {\r\n        requestAnimationFrame(function () {\r\n          that.$menu.css('min-width', '0');\r\n\r\n          that.$element.on('loaded' + EVENT_KEY, function () {\r\n            that.liHeight();\r\n            that.setMenuSize();\r\n\r\n            // Get correct width if element is hidden\r\n            var $selectClone = that.$newElement.clone().appendTo('body'),\r\n                btnWidth = $selectClone.css('width', 'auto').children('button').outerWidth();\r\n\r\n            $selectClone.remove();\r\n\r\n            // Set width to whatever's larger, button title or longest option\r\n            that.sizeInfo.selectWidth = Math.max(that.sizeInfo.totalMenuWidth, btnWidth);\r\n            that.$newElement.css('width', that.sizeInfo.selectWidth + 'px');\r\n          });\r\n        });\r\n      } else if (this.options.width === 'fit') {\r\n        // Remove inline min-width so width can be changed from 'auto'\r\n        this.$menu.css('min-width', '');\r\n        this.$newElement.css('width', '').addClass('fit-width');\r\n      } else if (this.options.width) {\r\n        // Remove inline min-width so width can be changed from 'auto'\r\n        this.$menu.css('min-width', '');\r\n        this.$newElement.css('width', this.options.width);\r\n      } else {\r\n        // Remove inline min-width/width so width can be changed\r\n        this.$menu.css('min-width', '');\r\n        this.$newElement.css('width', '');\r\n      }\r\n      // Remove fit-width class if width is changed programmatically\r\n      if (this.$newElement.hasClass('fit-width') && this.options.width !== 'fit') {\r\n        this.$newElement[0].classList.remove('fit-width');\r\n      }\r\n    },\r\n\r\n    selectPosition: function () {\r\n      this.$bsContainer = $('<div class=\"bs-container\" />');\r\n\r\n      var that = this,\r\n          $container = $(this.options.container),\r\n          pos,\r\n          containerPos,\r\n          actualHeight,\r\n          getPlacement = function ($element) {\r\n            var containerPosition = {},\r\n                // fall back to dropdown's default display setting if display is not manually set\r\n                display = that.options.display || (\r\n                  // Bootstrap 3 doesn't have $.fn.dropdown.Constructor.Default\r\n                  $.fn.dropdown.Constructor.Default ? $.fn.dropdown.Constructor.Default.display\r\n                  : false\r\n                );\r\n\r\n            that.$bsContainer.addClass($element.attr('class').replace(/form-control|fit-width/gi, '')).toggleClass(classNames.DROPUP, $element.hasClass(classNames.DROPUP));\r\n            pos = $element.offset();\r\n\r\n            if (!$container.is('body')) {\r\n              containerPos = $container.offset();\r\n              containerPos.top += parseInt($container.css('borderTopWidth')) - $container.scrollTop();\r\n              containerPos.left += parseInt($container.css('borderLeftWidth')) - $container.scrollLeft();\r\n            } else {\r\n              containerPos = { top: 0, left: 0 };\r\n            }\r\n\r\n            actualHeight = $element.hasClass(classNames.DROPUP) ? 0 : $element[0].offsetHeight;\r\n\r\n            // Bootstrap 4+ uses Popper for menu positioning\r\n            if (version.major < 4 || display === 'static') {\r\n              containerPosition.top = pos.top - containerPos.top + actualHeight;\r\n              containerPosition.left = pos.left - containerPos.left;\r\n            }\r\n\r\n            containerPosition.width = $element[0].offsetWidth;\r\n\r\n            that.$bsContainer.css(containerPosition);\r\n          };\r\n\r\n      this.$button.on('click.bs.dropdown.data-api', function () {\r\n        if (that.isDisabled()) {\r\n          return;\r\n        }\r\n\r\n        getPlacement(that.$newElement);\r\n\r\n        that.$bsContainer\r\n          .appendTo(that.options.container)\r\n          .toggleClass(classNames.SHOW, !that.$button.hasClass(classNames.SHOW))\r\n          .append(that.$menu);\r\n      });\r\n\r\n      $(window)\r\n        .off('resize' + EVENT_KEY + '.' + this.selectId + ' scroll' + EVENT_KEY + '.' + this.selectId)\r\n        .on('resize' + EVENT_KEY + '.' + this.selectId + ' scroll' + EVENT_KEY + '.' + this.selectId, function () {\r\n          var isActive = that.$newElement.hasClass(classNames.SHOW);\r\n\r\n          if (isActive) getPlacement(that.$newElement);\r\n        });\r\n\r\n      this.$element.on('hide' + EVENT_KEY, function () {\r\n        that.$menu.data('height', that.$menu.height());\r\n        that.$bsContainer.detach();\r\n      });\r\n    },\r\n\r\n    createOption: function (data, init) {\r\n      var optionData = !data.option ? data : data.option;\r\n\r\n      if (optionData && optionData.nodeType !== 1) {\r\n        var option = (init ? elementTemplates.selectedOption : elementTemplates.option).cloneNode(true);\r\n        if (optionData.value !== undefined) option.value = optionData.value;\r\n        option.textContent = optionData.text;\r\n\r\n        option.selected = true;\r\n\r\n        if (optionData.liIndex !== undefined) {\r\n          option.liIndex = optionData.liIndex;\r\n        } else if (!init) {\r\n          option.liIndex = data.index;\r\n        }\r\n\r\n        data.option = option;\r\n\r\n        this.selectpicker.main.optionQueue.appendChild(option);\r\n      }\r\n    },\r\n\r\n    setOptionStatus: function (selectedOnly) {\r\n      var that = this;\r\n\r\n      that.noScroll = false;\r\n\r\n      if (that.selectpicker.view.visibleElements && that.selectpicker.view.visibleElements.length) {\r\n        for (var i = 0; i < that.selectpicker.view.visibleElements.length; i++) {\r\n          var liData = that.selectpicker.current.data[i + that.selectpicker.view.position0],\r\n              option = liData.option;\r\n\r\n          if (option) {\r\n            if (selectedOnly !== true) {\r\n              that.setDisabled(liData);\r\n            }\r\n\r\n            that.setSelected(liData);\r\n          }\r\n        }\r\n\r\n        // append optionQueue (documentFragment with option elements for select options)\r\n        if (this.options.source.data) this.$element[0].appendChild(this.selectpicker.main.optionQueue);\r\n      }\r\n    },\r\n\r\n    /**\r\n     * @param {Object} liData - the option object that is being changed\r\n     * @param {boolean} selected - true if the option is being selected, false if being deselected\r\n     */\r\n    setSelected: function (liData, selected) {\r\n      selected = selected === undefined ? liData.selected : selected;\r\n\r\n      var li = liData.element,\r\n          activeElementIsSet = this.activeElement !== undefined,\r\n          thisIsActive = this.activeElement === li,\r\n          prevActive,\r\n          a,\r\n          // if current option is already active\r\n          // OR\r\n          // if the current option is being selected, it's NOT multiple, and\r\n          // activeElement is undefined:\r\n          //  - when the menu is first being opened, OR\r\n          //  - after a search has been performed, OR\r\n          //  - when retainActive is false when selecting a new option (i.e. index of the newly selected option is not the same as the current activeElement)\r\n          keepActive = thisIsActive || (selected && !this.multiple && !activeElementIsSet);\r\n\r\n      if (!li) return;\r\n\r\n      if (selected !== undefined) {\r\n        liData.selected = selected;\r\n        if (liData.option) liData.option.selected = selected;\r\n      }\r\n\r\n      if (selected && this.options.source.data) {\r\n        this.createOption(liData, false);\r\n      }\r\n\r\n      a = li.firstChild;\r\n\r\n      if (selected) {\r\n        this.selectedElement = li;\r\n      }\r\n\r\n      li.classList.toggle('selected', selected);\r\n\r\n      if (keepActive) {\r\n        this.focusItem(li, liData);\r\n        this.selectpicker.view.currentActive = li;\r\n        this.activeElement = li;\r\n      } else {\r\n        this.defocusItem(li);\r\n      }\r\n\r\n      if (a) {\r\n        a.classList.toggle('selected', selected);\r\n\r\n        if (selected) {\r\n          a.setAttribute('aria-selected', true);\r\n        } else {\r\n          if (this.multiple) {\r\n            a.setAttribute('aria-selected', false);\r\n          } else {\r\n            a.removeAttribute('aria-selected');\r\n          }\r\n        }\r\n      }\r\n\r\n      if (!keepActive && !activeElementIsSet && selected && this.prevActiveElement !== undefined) {\r\n        prevActive = this.prevActiveElement;\r\n\r\n        this.defocusItem(prevActive);\r\n      }\r\n    },\r\n\r\n    /**\r\n     * @param {number} index - the index of the option that is being disabled\r\n     * @param {boolean} disabled - true if the option is being disabled, false if being enabled\r\n     */\r\n    setDisabled: function (liData) {\r\n      var disabled = liData.disabled,\r\n          li = liData.element,\r\n          a;\r\n\r\n      if (!li) return;\r\n\r\n      a = li.firstChild;\r\n\r\n      li.classList.toggle(classNames.DISABLED, disabled);\r\n\r\n      if (a) {\r\n        if (version.major >= '4') a.classList.toggle(classNames.DISABLED, disabled);\r\n\r\n        if (disabled) {\r\n          a.setAttribute('aria-disabled', disabled);\r\n          a.setAttribute('tabindex', -1);\r\n        } else {\r\n          a.removeAttribute('aria-disabled');\r\n          a.setAttribute('tabindex', 0);\r\n        }\r\n      }\r\n    },\r\n\r\n    isDisabled: function () {\r\n      return this.$element[0].disabled;\r\n    },\r\n\r\n    checkDisabled: function () {\r\n      if (this.isDisabled()) {\r\n        this.$newElement[0].classList.add(classNames.DISABLED);\r\n        this.$button.addClass(classNames.DISABLED).attr('aria-disabled', true);\r\n      } else {\r\n        if (this.$button[0].classList.contains(classNames.DISABLED)) {\r\n          this.$newElement[0].classList.remove(classNames.DISABLED);\r\n          this.$button.removeClass(classNames.DISABLED).attr('aria-disabled', false);\r\n        }\r\n      }\r\n    },\r\n\r\n    clickListener: function () {\r\n      var that = this,\r\n          $document = $(document);\r\n\r\n      $document.data('spaceSelect', false);\r\n\r\n      this.$button.on('keyup', function (e) {\r\n        if (/(32)/.test(e.keyCode.toString(10)) && $document.data('spaceSelect')) {\r\n          e.preventDefault();\r\n          $document.data('spaceSelect', false);\r\n        }\r\n      });\r\n\r\n      this.$newElement.on('show.bs.dropdown', function () {\r\n        if (!that.dropdown && version.major === '4') {\r\n          that.dropdown = that.$button.data('bs.dropdown');\r\n          that.dropdown._menu = that.$menu[0];\r\n        }\r\n      });\r\n\r\n      function clearSelection (e) {\r\n        if (that.multiple) {\r\n          that.deselectAll();\r\n        } else {\r\n          var element = that.$element[0],\r\n              prevValue = element.value,\r\n              prevIndex = element.selectedIndex,\r\n              prevOption = element.options[prevIndex],\r\n              prevData = prevOption ? that.selectpicker.main.data[prevOption.liIndex] : false;\r\n\r\n          if (prevData) {\r\n            that.setSelected(prevData, false);\r\n          }\r\n\r\n          element.selectedIndex = 0;\r\n\r\n          changedArguments = [prevIndex, false, prevValue];\r\n          that.$element.triggerNative('change');\r\n        }\r\n\r\n        // remove selected styling if menu is open\r\n        if (that.$newElement.hasClass(classNames.SHOW)) {\r\n          if (that.options.liveSearch) {\r\n            that.$searchbox.trigger('focus');\r\n          }\r\n\r\n          that.createView(false);\r\n        }\r\n      }\r\n\r\n      this.$button.on('click.bs.dropdown.data-api', function (e) {\r\n        if (that.options.allowClear) {\r\n          var target = e.target,\r\n              clearButton = that.$clearButton[0];\r\n\r\n          // IE doesn't support event listeners on child elements of buttons\r\n          if (/MSIE|Trident/.test(window.navigator.userAgent)) {\r\n            target = document.elementFromPoint(e.clientX, e.clientY);\r\n          }\r\n\r\n          if (target === clearButton || target.parentElement === clearButton) {\r\n            e.stopImmediatePropagation();\r\n            clearSelection(e);\r\n          }\r\n        }\r\n\r\n        if (!that.$newElement.hasClass(classNames.SHOW)) {\r\n          that.setSize();\r\n        }\r\n      });\r\n\r\n      function setFocus () {\r\n        if (that.options.liveSearch) {\r\n          that.$searchbox.trigger('focus');\r\n        } else {\r\n          that.$menuInner.trigger('focus');\r\n        }\r\n      }\r\n\r\n      function checkPopperExists () {\r\n        if (that.dropdown && that.dropdown._popper && that.dropdown._popper.state) {\r\n          setFocus();\r\n        } else {\r\n          requestAnimationFrame(checkPopperExists);\r\n        }\r\n      }\r\n\r\n      this.$element.on('shown' + EVENT_KEY, function () {\r\n        if (that.$menuInner[0].scrollTop !== that.selectpicker.view.scrollTop) {\r\n          that.$menuInner[0].scrollTop = that.selectpicker.view.scrollTop;\r\n        }\r\n\r\n        if (version.major > 3) {\r\n          requestAnimationFrame(checkPopperExists);\r\n        } else {\r\n          setFocus();\r\n        }\r\n      });\r\n\r\n      // ensure posinset and setsize are correct before selecting an option via a click\r\n      this.$menuInner.on('mouseenter', 'li a', function (e) {\r\n        var hoverLi = this.parentElement,\r\n            position0 = that.isVirtual() ? that.selectpicker.view.position0 : 0,\r\n            index = Array.prototype.indexOf.call(hoverLi.parentElement.children, hoverLi),\r\n            hoverData = that.selectpicker.current.data[index + position0];\r\n\r\n        that.focusItem(hoverLi, hoverData, true);\r\n      });\r\n\r\n      this.$menuInner.on('click', 'li a', function (e, retainActive) {\r\n        var $this = $(this),\r\n            element = that.$element[0],\r\n            position0 = that.isVirtual() ? that.selectpicker.view.position0 : 0,\r\n            clickedData = that.selectpicker.current.data[$this.parent().index() + position0],\r\n            clickedElement = clickedData.element,\r\n            prevValue = getSelectValues.call(that),\r\n            prevIndex = element.selectedIndex,\r\n            prevOption = element.options[prevIndex],\r\n            prevData = prevOption ? that.selectpicker.main.data[prevOption.liIndex] : false,\r\n            triggerChange = true;\r\n\r\n        // Don't close on multi choice menu\r\n        if (that.multiple && that.options.maxOptions !== 1) {\r\n          e.stopPropagation();\r\n        }\r\n\r\n        e.preventDefault();\r\n\r\n        // Don't run if the select is disabled\r\n        if (!that.isDisabled() && !$this.parent().hasClass(classNames.DISABLED)) {\r\n          var option = clickedData.option,\r\n              $option = $(option),\r\n              state = option.selected,\r\n              optgroupData = that.selectpicker.current.data.find(function (datum) {\r\n                return datum.optID === clickedData.optID && datum.type === 'optgroup-label';\r\n              }),\r\n              optgroup = optgroupData ? optgroupData.optgroup : undefined,\r\n              dataGetter = optgroup instanceof Element ? getOptionData.fromOption : getOptionData.fromDataSource,\r\n              optgroupOptions = optgroup && optgroup.children,\r\n              maxOptions = parseInt(that.options.maxOptions),\r\n              maxOptionsGrp = optgroup && parseInt(dataGetter(optgroup, 'maxOptions')) || false;\r\n\r\n          if (clickedElement === that.activeElement) retainActive = true;\r\n\r\n          if (!retainActive) {\r\n            that.prevActiveElement = that.activeElement;\r\n            that.activeElement = undefined;\r\n          }\r\n\r\n          if (!that.multiple || maxOptions === 1) { // Deselect previous option if not multi select\r\n            if (prevData) that.setSelected(prevData, false);\r\n            that.setSelected(clickedData, true);\r\n          } else { // Toggle the clicked option if multi select.\r\n            that.setSelected(clickedData, !state);\r\n            that.focusedParent.focus();\r\n\r\n            if (maxOptions !== false || maxOptionsGrp !== false) {\r\n              var maxReached = maxOptions < getSelectedOptions.call(that).length,\r\n                  selectedGroupOptions = 0;\r\n\r\n              if (optgroup && optgroup.children) {\r\n                for (var i = 0; i < optgroup.children.length; i++) {\r\n                  if (optgroup.children[i].selected) selectedGroupOptions++;\r\n                }\r\n              }\r\n\r\n              var maxReachedGrp = maxOptionsGrp < selectedGroupOptions;\r\n\r\n              if ((maxOptions && maxReached) || (maxOptionsGrp && maxReachedGrp)) {\r\n                if (maxOptions && maxOptions === 1) {\r\n                  element.selectedIndex = -1;\r\n                  that.setOptionStatus(true);\r\n                } else if (maxOptionsGrp && maxOptionsGrp === 1) {\r\n                  for (var i = 0; i < optgroupOptions.length; i++) {\r\n                    var _option = optgroupOptions[i];\r\n                    that.setSelected(that.selectpicker.current.data[_option.liIndex], false);\r\n                  }\r\n\r\n                  that.setSelected(clickedData, true);\r\n                } else {\r\n                  var maxOptionsText = typeof that.options.maxOptionsText === 'string' ? [that.options.maxOptionsText, that.options.maxOptionsText] : that.options.maxOptionsText,\r\n                      maxOptionsArr = typeof maxOptionsText === 'function' ? maxOptionsText(maxOptions, maxOptionsGrp) : maxOptionsText,\r\n                      maxTxt = maxOptionsArr[0].replace('{n}', maxOptions),\r\n                      maxTxtGrp = maxOptionsArr[1].replace('{n}', maxOptionsGrp),\r\n                      $notify = $('<div class=\"notify\"></div>');\r\n                  // If {var} is set in array, replace it\r\n                  /** @deprecated */\r\n                  if (maxOptionsArr[2]) {\r\n                    maxTxt = maxTxt.replace('{var}', maxOptionsArr[2][maxOptions > 1 ? 0 : 1]);\r\n                    maxTxtGrp = maxTxtGrp.replace('{var}', maxOptionsArr[2][maxOptionsGrp > 1 ? 0 : 1]);\r\n                  }\r\n\r\n                  that.$menu.append($notify);\r\n\r\n                  if (maxOptions && maxReached) {\r\n                    $notify.append($('<div>' + maxTxt + '</div>'));\r\n                    triggerChange = false;\r\n                    that.$element.trigger('maxReached' + EVENT_KEY);\r\n                  }\r\n\r\n                  if (maxOptionsGrp && maxReachedGrp) {\r\n                    $notify.append($('<div>' + maxTxtGrp + '</div>'));\r\n                    triggerChange = false;\r\n                    that.$element.trigger('maxReachedGrp' + EVENT_KEY);\r\n                  }\r\n\r\n                  setTimeout(function () {\r\n                    that.setSelected(clickedData, false);\r\n                  }, 10);\r\n\r\n                  $notify[0].classList.add('fadeOut');\r\n\r\n                  setTimeout(function () {\r\n                    $notify.remove();\r\n                  }, 1050);\r\n                }\r\n              }\r\n            }\r\n          }\r\n\r\n          if (that.options.source.data) that.$element[0].appendChild(that.selectpicker.main.optionQueue);\r\n\r\n          if (!that.multiple || (that.multiple && that.options.maxOptions === 1)) {\r\n            that.$button.trigger('focus');\r\n          } else if (that.options.liveSearch) {\r\n            that.$searchbox.trigger('focus');\r\n          }\r\n\r\n          // Trigger select 'change'\r\n          if (triggerChange) {\r\n            if (that.multiple || prevIndex !== element.selectedIndex) {\r\n              // $option.prop('selected') is current option state (selected/unselected). prevValue is the value of the select prior to being changed.\r\n              changedArguments = [option.index, $option.prop('selected'), prevValue];\r\n              that.$element\r\n                .triggerNative('change');\r\n            }\r\n          }\r\n        }\r\n      });\r\n\r\n      this.$menu.on('click', 'li.' + classNames.DISABLED + ' a, .' + classNames.POPOVERHEADER + ', .' + classNames.POPOVERHEADER + ' :not(.close)', function (e) {\r\n        if (e.currentTarget == this) {\r\n          e.preventDefault();\r\n          e.stopPropagation();\r\n          if (that.options.liveSearch && !$(e.target).hasClass('close')) {\r\n            that.$searchbox.trigger('focus');\r\n          } else {\r\n            that.$button.trigger('focus');\r\n          }\r\n        }\r\n      });\r\n\r\n      this.$menuInner.on('click', '.divider, .dropdown-header', function (e) {\r\n        e.preventDefault();\r\n        e.stopPropagation();\r\n        if (that.options.liveSearch) {\r\n          that.$searchbox.trigger('focus');\r\n        } else {\r\n          that.$button.trigger('focus');\r\n        }\r\n      });\r\n\r\n      this.$menu.on('click', '.' + classNames.POPOVERHEADER + ' .close', function () {\r\n        that.$button.trigger('click');\r\n      });\r\n\r\n      this.$searchbox.on('click', function (e) {\r\n        e.stopPropagation();\r\n      });\r\n\r\n      this.$menu.on('click', '.actions-btn', function (e) {\r\n        if (that.options.liveSearch) {\r\n          that.$searchbox.trigger('focus');\r\n        } else {\r\n          that.$button.trigger('focus');\r\n        }\r\n\r\n        e.preventDefault();\r\n        e.stopPropagation();\r\n\r\n        if ($(this).hasClass('bs-select-all')) {\r\n          that.selectAll();\r\n        } else {\r\n          that.deselectAll();\r\n        }\r\n      });\r\n\r\n      this.$button\r\n        .on('focus' + EVENT_KEY, function (e) {\r\n          var tabindex = that.$element[0].getAttribute('tabindex');\r\n\r\n          // only change when button is actually focused\r\n          if (tabindex !== undefined && e.originalEvent && e.originalEvent.isTrusted) {\r\n            // apply select element's tabindex to ensure correct order is followed when tabbing to the next element\r\n            this.setAttribute('tabindex', tabindex);\r\n            // set element's tabindex to -1 to allow for reverse tabbing\r\n            that.$element[0].setAttribute('tabindex', -1);\r\n            that.selectpicker.view.tabindex = tabindex;\r\n          }\r\n        })\r\n        .on('blur' + EVENT_KEY, function (e) {\r\n          // revert everything to original tabindex\r\n          if (that.selectpicker.view.tabindex !== undefined && e.originalEvent && e.originalEvent.isTrusted) {\r\n            that.$element[0].setAttribute('tabindex', that.selectpicker.view.tabindex);\r\n            this.setAttribute('tabindex', -1);\r\n            that.selectpicker.view.tabindex = undefined;\r\n          }\r\n        });\r\n\r\n      this.$element\r\n        .on('change' + EVENT_KEY, function () {\r\n          that.render();\r\n          that.$element.trigger('changed' + EVENT_KEY, changedArguments);\r\n          changedArguments = null;\r\n        })\r\n        .on('focus' + EVENT_KEY, function () {\r\n          if (!that.options.mobile) that.$button[0].focus();\r\n        });\r\n    },\r\n\r\n    liveSearchListener: function () {\r\n      var that = this;\r\n\r\n      this.$button.on('click.bs.dropdown.data-api', function () {\r\n        if (!!that.$searchbox.val()) {\r\n          that.$searchbox.val('');\r\n          that.selectpicker.search.previousValue = undefined;\r\n        }\r\n      });\r\n\r\n      this.$searchbox.on('click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api', function (e) {\r\n        e.stopPropagation();\r\n      });\r\n\r\n      this.$searchbox.on('input propertychange', function () {\r\n        var searchValue = that.$searchbox[0].value;\r\n\r\n        that.selectpicker.search.elements = [];\r\n        that.selectpicker.search.data = [];\r\n\r\n        if (searchValue) {\r\n          that.selectpicker.search.previousValue = searchValue;\r\n\r\n          if (that.options.source.search) {\r\n            that.fetchData(function (builtData) {\r\n              that.render();\r\n              that.buildList(undefined, true);\r\n              that.noScroll = true;\r\n              that.$menuInner.scrollTop(0);\r\n              that.createView(true);\r\n              showNoResults.call(that, builtData, searchValue);\r\n            }, 'search', 0, searchValue);\r\n          } else {\r\n            var i,\r\n                searchMatch = [],\r\n                q = searchValue.toUpperCase(),\r\n                cache = {},\r\n                cacheArr = [],\r\n                searchStyle = that._searchStyle(),\r\n                normalizeSearch = that.options.liveSearchNormalize;\r\n\r\n            if (normalizeSearch) q = normalizeToBase(q);\r\n\r\n            for (var i = 0; i < that.selectpicker.main.data.length; i++) {\r\n              var li = that.selectpicker.main.data[i];\r\n\r\n              if (!cache[i]) {\r\n                cache[i] = stringSearch(li, q, searchStyle, normalizeSearch);\r\n              }\r\n\r\n              if (cache[i] && li.headerIndex !== undefined && cacheArr.indexOf(li.headerIndex) === -1) {\r\n                if (li.headerIndex > 0) {\r\n                  cache[li.headerIndex - 1] = true;\r\n                  cacheArr.push(li.headerIndex - 1);\r\n                }\r\n\r\n                cache[li.headerIndex] = true;\r\n                cacheArr.push(li.headerIndex);\r\n\r\n                cache[li.lastIndex + 1] = true;\r\n              }\r\n\r\n              if (cache[i] && li.type !== 'optgroup-label') cacheArr.push(i);\r\n            }\r\n\r\n            for (var i = 0, cacheLen = cacheArr.length; i < cacheLen; i++) {\r\n              var index = cacheArr[i],\r\n                  prevIndex = cacheArr[i - 1],\r\n                  li = that.selectpicker.main.data[index],\r\n                  liPrev = that.selectpicker.main.data[prevIndex];\r\n\r\n              if (li.type !== 'divider' || (li.type === 'divider' && liPrev && liPrev.type !== 'divider' && cacheLen - 1 !== i)) {\r\n                that.selectpicker.search.data.push(li);\r\n                searchMatch.push(that.selectpicker.main.elements[index]);\r\n              }\r\n            }\r\n\r\n            that.activeElement = undefined;\r\n            that.noScroll = true;\r\n            that.$menuInner.scrollTop(0);\r\n            that.selectpicker.search.elements = searchMatch;\r\n            that.createView(true);\r\n            showNoResults.call(that, searchMatch, searchValue);\r\n          }\r\n        } else if (that.selectpicker.search.previousValue) { // for IE11 (#2402)\r\n          that.$menuInner.scrollTop(0);\r\n          that.createView(false);\r\n        }\r\n      });\r\n    },\r\n\r\n    _searchStyle: function () {\r\n      return this.options.liveSearchStyle || 'contains';\r\n    },\r\n\r\n    val: function (value) {\r\n      var element = this.$element[0];\r\n\r\n      if (typeof value !== 'undefined') {\r\n        var selectedOptions = getSelectedOptions.call(this),\r\n            prevValue = getSelectValues.call(this, selectedOptions);\r\n\r\n        changedArguments = [null, null, prevValue];\r\n\r\n        if (!Array.isArray(value)) value = [ value ];\r\n\r\n        value.map(String);\r\n\r\n        for (var i = 0; i < selectedOptions.length; i++) {\r\n          var item = selectedOptions[i];\r\n\r\n          if (item && value.indexOf(String(item.value)) === -1) {\r\n            this.setSelected(item, false);\r\n          }\r\n        }\r\n\r\n        // only update selected value if it matches an existing option\r\n        this.selectpicker.main.data.filter(function (item) {\r\n          if (value.indexOf(String(item.value)) !== -1) {\r\n            this.setSelected(item, true);\r\n            return true;\r\n          }\r\n\r\n          return false;\r\n        }, this);\r\n\r\n        if (this.options.source.data) element.appendChild(this.selectpicker.main.optionQueue);\r\n\r\n        this.$element.trigger('changed' + EVENT_KEY, changedArguments);\r\n\r\n        if (this.$newElement.hasClass(classNames.SHOW)) {\r\n          if (this.multiple) {\r\n            this.setOptionStatus(true);\r\n          } else {\r\n            var liSelectedIndex = (element.options[element.selectedIndex] || {}).liIndex;\r\n\r\n            if (typeof liSelectedIndex === 'number') {\r\n              this.setSelected(this.selectpicker.current.data[liSelectedIndex], true);\r\n            }\r\n          }\r\n        }\r\n\r\n        this.render();\r\n\r\n        changedArguments = null;\r\n\r\n        return this.$element;\r\n      } else {\r\n        return this.$element.val();\r\n      }\r\n    },\r\n\r\n    changeAll: function (status) {\r\n      if (!this.multiple) return;\r\n      if (typeof status === 'undefined') status = true;\r\n\r\n      var element = this.$element[0],\r\n          previousSelected = 0,\r\n          currentSelected = 0,\r\n          prevValue = getSelectValues.call(this);\r\n\r\n      element.classList.add('bs-select-hidden');\r\n\r\n      for (var i = 0, data = this.selectpicker.current.data, len = data.length; i < len; i++) {\r\n        var liData = data[i],\r\n            option = liData.option;\r\n\r\n        if (option && !liData.disabled && liData.type !== 'divider') {\r\n          if (liData.selected) previousSelected++;\r\n          option.selected = status;\r\n          liData.selected = status;\r\n          if (status === true) currentSelected++;\r\n        }\r\n      }\r\n\r\n      element.classList.remove('bs-select-hidden');\r\n\r\n      if (previousSelected === currentSelected) return;\r\n\r\n      this.setOptionStatus();\r\n\r\n      changedArguments = [null, null, prevValue];\r\n\r\n      this.$element\r\n        .triggerNative('change');\r\n    },\r\n\r\n    selectAll: function () {\r\n      return this.changeAll(true);\r\n    },\r\n\r\n    deselectAll: function () {\r\n      return this.changeAll(false);\r\n    },\r\n\r\n    toggle: function (e, state) {\r\n      var isActive,\r\n          triggerClick = state === undefined;\r\n\r\n      e = e || window.event;\r\n\r\n      if (e) e.stopPropagation();\r\n\r\n      if (triggerClick === false) {\r\n        isActive = this.$newElement[0].classList.contains(classNames.SHOW);\r\n        triggerClick = state === true && isActive === false || state === false && isActive === true;\r\n      }\r\n\r\n      if (triggerClick) this.$button.trigger('click.bs.dropdown.data-api');\r\n    },\r\n\r\n    open: function (e) {\r\n      this.toggle(e, true);\r\n    },\r\n\r\n    close: function (e) {\r\n      this.toggle(e, false);\r\n    },\r\n\r\n    keydown: function (e) {\r\n      var $this = $(this),\r\n          isToggle = $this.hasClass('dropdown-toggle'),\r\n          $parent = isToggle ? $this.closest('.dropdown') : $this.closest(Selector.MENU),\r\n          that = $parent.data('this'),\r\n          $items = that.findLis(),\r\n          index,\r\n          isActive,\r\n          liActive,\r\n          activeLi,\r\n          offset,\r\n          updateScroll = false,\r\n          downOnTab = e.which === keyCodes.TAB && !isToggle && !that.options.selectOnTab,\r\n          isArrowKey = REGEXP_ARROW.test(e.which) || downOnTab,\r\n          scrollTop = that.$menuInner[0].scrollTop,\r\n          isVirtual = that.isVirtual(),\r\n          position0 = isVirtual === true ? that.selectpicker.view.position0 : 0;\r\n\r\n      // do nothing if a function key is pressed\r\n      if (e.which >= 112 && e.which <= 123) return;\r\n\r\n      isActive = that.$menu.hasClass(classNames.SHOW);\r\n\r\n      if (\r\n        !isActive &&\r\n        (\r\n          isArrowKey ||\r\n          (e.which >= 48 && e.which <= 57) ||\r\n          (e.which >= 96 && e.which <= 105) ||\r\n          (e.which >= 65 && e.which <= 90)\r\n        )\r\n      ) {\r\n        that.$button.trigger('click.bs.dropdown.data-api');\r\n\r\n        if (that.options.liveSearch) {\r\n          that.$searchbox.trigger('focus');\r\n          return;\r\n        }\r\n      }\r\n\r\n      if (e.which === keyCodes.ESCAPE && isActive) {\r\n        e.preventDefault();\r\n        that.$button.trigger('click.bs.dropdown.data-api').trigger('focus');\r\n      }\r\n\r\n      if (isArrowKey) { // if up or down\r\n        if (!$items.length) return;\r\n\r\n        liActive = that.activeElement;\r\n        index = liActive ? Array.prototype.indexOf.call(liActive.parentElement.children, liActive) : -1;\r\n\r\n        if (index !== -1) {\r\n          that.defocusItem(liActive);\r\n        }\r\n\r\n        if (e.which === keyCodes.ARROW_UP) { // up\r\n          if (index !== -1) index--;\r\n          if (index + position0 < 0) index += $items.length;\r\n\r\n          if (!that.selectpicker.view.canHighlight[index + position0]) {\r\n            index = that.selectpicker.view.canHighlight.slice(0, index + position0).lastIndexOf(true) - position0;\r\n            if (index === -1) index = $items.length - 1;\r\n          }\r\n        } else if (e.which === keyCodes.ARROW_DOWN || downOnTab) { // down\r\n          index++;\r\n          if (index + position0 >= that.selectpicker.view.canHighlight.length) index = that.selectpicker.view.firstHighlightIndex;\r\n\r\n          if (!that.selectpicker.view.canHighlight[index + position0]) {\r\n            index = index + 1 + that.selectpicker.view.canHighlight.slice(index + position0 + 1).indexOf(true);\r\n          }\r\n        }\r\n\r\n        e.preventDefault();\r\n\r\n        var liActiveIndex = position0 + index;\r\n\r\n        if (e.which === keyCodes.ARROW_UP) { // up\r\n          // scroll to bottom and highlight last option\r\n          if (position0 === 0 && index === $items.length - 1) {\r\n            that.$menuInner[0].scrollTop = that.$menuInner[0].scrollHeight;\r\n\r\n            liActiveIndex = that.selectpicker.current.elements.length - 1;\r\n          } else {\r\n            activeLi = that.selectpicker.current.data[liActiveIndex];\r\n\r\n            // could be undefined if no results exist\r\n            if (activeLi) {\r\n              offset = activeLi.position - activeLi.height;\r\n\r\n              updateScroll = offset < scrollTop;\r\n            }\r\n          }\r\n        } else if (e.which === keyCodes.ARROW_DOWN || downOnTab) { // down\r\n          // scroll to top and highlight first option\r\n          if (index === that.selectpicker.view.firstHighlightIndex) {\r\n            that.$menuInner[0].scrollTop = 0;\r\n\r\n            liActiveIndex = that.selectpicker.view.firstHighlightIndex;\r\n          } else {\r\n            activeLi = that.selectpicker.current.data[liActiveIndex];\r\n\r\n            // could be undefined if no results exist\r\n            if (activeLi) {\r\n              offset = activeLi.position - that.sizeInfo.menuInnerHeight;\r\n\r\n              updateScroll = offset > scrollTop;\r\n            }\r\n          }\r\n        }\r\n\r\n        liActive = that.selectpicker.current.elements[liActiveIndex];\r\n\r\n        that.activeElement = (that.selectpicker.current.data[liActiveIndex] || {}).element;\r\n\r\n        that.focusItem(liActive);\r\n\r\n        that.selectpicker.view.currentActive = liActive;\r\n\r\n        if (updateScroll) that.$menuInner[0].scrollTop = offset;\r\n\r\n        if (that.options.liveSearch) {\r\n          that.$searchbox.trigger('focus');\r\n        } else {\r\n          $this.trigger('focus');\r\n        }\r\n      } else if (\r\n        (!$this.is('input') && !REGEXP_TAB_OR_ESCAPE.test(e.which)) ||\r\n        (e.which === keyCodes.SPACE && that.selectpicker.keydown.keyHistory)\r\n      ) {\r\n        var searchMatch,\r\n            matches = [],\r\n            keyHistory;\r\n\r\n        e.preventDefault();\r\n\r\n        that.selectpicker.keydown.keyHistory += keyCodeMap[e.which];\r\n\r\n        if (that.selectpicker.keydown.resetKeyHistory.cancel) clearTimeout(that.selectpicker.keydown.resetKeyHistory.cancel);\r\n        that.selectpicker.keydown.resetKeyHistory.cancel = that.selectpicker.keydown.resetKeyHistory.start();\r\n\r\n        keyHistory = that.selectpicker.keydown.keyHistory;\r\n\r\n        // if all letters are the same, set keyHistory to just the first character when searching\r\n        if (/^(.)\\1+$/.test(keyHistory)) {\r\n          keyHistory = keyHistory.charAt(0);\r\n        }\r\n\r\n        // find matches\r\n        for (var i = 0; i < that.selectpicker.current.data.length; i++) {\r\n          var li = that.selectpicker.current.data[i],\r\n              hasMatch;\r\n\r\n          hasMatch = stringSearch(li, keyHistory, 'startsWith', true);\r\n\r\n          if (hasMatch && that.selectpicker.view.canHighlight[i]) {\r\n            matches.push(li.element);\r\n          }\r\n        }\r\n\r\n        if (matches.length) {\r\n          var matchIndex = 0;\r\n\r\n          $items.removeClass('active').find('a').removeClass('active');\r\n\r\n          // either only one key has been pressed or they are all the same key\r\n          if (keyHistory.length === 1) {\r\n            matchIndex = matches.indexOf(that.activeElement);\r\n\r\n            if (matchIndex === -1 || matchIndex === matches.length - 1) {\r\n              matchIndex = 0;\r\n            } else {\r\n              matchIndex++;\r\n            }\r\n          }\r\n\r\n          searchMatch = matches[matchIndex];\r\n\r\n          activeLi = that.selectpicker.main.data[searchMatch];\r\n\r\n          if (scrollTop - activeLi.position > 0) {\r\n            offset = activeLi.position - activeLi.height;\r\n            updateScroll = true;\r\n          } else {\r\n            offset = activeLi.position - that.sizeInfo.menuInnerHeight;\r\n            // if the option is already visible at the current scroll position, just keep it the same\r\n            updateScroll = activeLi.position > scrollTop + that.sizeInfo.menuInnerHeight;\r\n          }\r\n\r\n          liActive = that.selectpicker.main.elements[searchMatch];\r\n\r\n          that.activeElement = liActive;\r\n\r\n          that.focusItem(liActive);\r\n\r\n          if (liActive) liActive.firstChild.focus();\r\n\r\n          if (updateScroll) that.$menuInner[0].scrollTop = offset;\r\n\r\n          $this.trigger('focus');\r\n        }\r\n      }\r\n\r\n      // Select focused option if \"Enter\", \"Spacebar\" or \"Tab\" (when selectOnTab is true) are pressed inside the menu.\r\n      if (\r\n        isActive &&\r\n        (\r\n          (e.which === keyCodes.SPACE && !that.selectpicker.keydown.keyHistory) ||\r\n          e.which === keyCodes.ENTER ||\r\n          (e.which === keyCodes.TAB && that.options.selectOnTab)\r\n        )\r\n      ) {\r\n        if (e.which !== keyCodes.SPACE) e.preventDefault();\r\n\r\n        if (!that.options.liveSearch || e.which !== keyCodes.SPACE) {\r\n          that.$menuInner.find('.active a').trigger('click', true); // retain active class\r\n          $this.trigger('focus');\r\n\r\n          if (!that.options.liveSearch) {\r\n            // Prevent screen from scrolling if the user hits the spacebar\r\n            e.preventDefault();\r\n            // Fixes spacebar selection of dropdown items in FF & IE\r\n            $(document).data('spaceSelect', true);\r\n          }\r\n        }\r\n      }\r\n    },\r\n\r\n    mobile: function () {\r\n      // ensure mobile is set to true if mobile function is called after init\r\n      this.options.mobile = true;\r\n      this.$element[0].classList.add('mobile-device');\r\n    },\r\n\r\n    refresh: function () {\r\n      var that = this;\r\n      // update options if data attributes have been changed\r\n      var config = $.extend({}, this.options, getAttributesObject(this.$element), this.$element.data()); // in this order on refresh, as user may change attributes on select, and options object is not passed on refresh\r\n      this.options = config;\r\n\r\n      if (this.options.source.data) {\r\n        this.render();\r\n        this.buildList();\r\n      } else {\r\n        this.fetchData(function () {\r\n          that.render();\r\n          that.buildList();\r\n        });\r\n      }\r\n\r\n      this.checkDisabled();\r\n      this.setStyle();\r\n      this.setWidth();\r\n\r\n      this.setSize(true);\r\n\r\n      this.$element.trigger('refreshed' + EVENT_KEY);\r\n    },\r\n\r\n    hide: function () {\r\n      this.$newElement.hide();\r\n    },\r\n\r\n    show: function () {\r\n      this.$newElement.show();\r\n    },\r\n\r\n    remove: function () {\r\n      this.$newElement.remove();\r\n      this.$element.remove();\r\n    },\r\n\r\n    destroy: function () {\r\n      this.$newElement.before(this.$element).remove();\r\n\r\n      if (this.$bsContainer) {\r\n        this.$bsContainer.remove();\r\n      } else {\r\n        this.$menu.remove();\r\n      }\r\n\r\n      if (this.selectpicker.view.titleOption && this.selectpicker.view.titleOption.parentNode) {\r\n        this.selectpicker.view.titleOption.parentNode.removeChild(this.selectpicker.view.titleOption);\r\n      }\r\n\r\n      this.$element\r\n        .off(EVENT_KEY)\r\n        .removeData('selectpicker')\r\n        .removeClass('bs-select-hidden selectpicker mobile-device');\r\n\r\n      $(window).off(EVENT_KEY + '.' + this.selectId);\r\n    }\r\n  };\r\n\r\n  // SELECTPICKER PLUGIN DEFINITION\r\n  // ==============================\r\n  function Plugin (option) {\r\n    // get the args of the outer function..\r\n    var args = arguments;\r\n    // The arguments of the function are explicitly re-defined from the argument list, because the shift causes them\r\n    // to get lost/corrupted in android 2.3 and IE9 #715 #775\r\n    var _option = option;\r\n\r\n    [].shift.apply(args);\r\n\r\n    // if the version was not set successfully\r\n    if (!version.success) {\r\n      // try to retreive it again\r\n      try {\r\n        version.full = (getVersion() || '').split(' ')[0].split('.');\r\n      } catch (err) {\r\n        // fall back to use BootstrapVersion if set\r\n        if (Selectpicker.BootstrapVersion) {\r\n          version.full = Selectpicker.BootstrapVersion.split(' ')[0].split('.');\r\n        } else {\r\n          version.full = [version.major, '0', '0'];\r\n\r\n          console.warn(\r\n            'There was an issue retrieving Bootstrap\\'s version. ' +\r\n            'Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. ' +\r\n            'If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.',\r\n            err\r\n          );\r\n        }\r\n      }\r\n\r\n      version.major = version.full[0];\r\n      version.success = true;\r\n    }\r\n\r\n    if (version.major >= '4') {\r\n      // some defaults need to be changed if using Bootstrap 4\r\n      // check to see if they have already been manually changed before forcing them to update\r\n      var toUpdate = [];\r\n\r\n      if (Selectpicker.DEFAULTS.style === classNames.BUTTONCLASS) toUpdate.push({ name: 'style', className: 'BUTTONCLASS' });\r\n      if (Selectpicker.DEFAULTS.iconBase === classNames.ICONBASE) toUpdate.push({ name: 'iconBase', className: 'ICONBASE' });\r\n      if (Selectpicker.DEFAULTS.tickIcon === classNames.TICKICON) toUpdate.push({ name: 'tickIcon', className: 'TICKICON' });\r\n\r\n      classNames.DIVIDER = 'dropdown-divider';\r\n      classNames.SHOW = 'show';\r\n      classNames.BUTTONCLASS = 'btn-light';\r\n      classNames.POPOVERHEADER = 'popover-header';\r\n      classNames.ICONBASE = '';\r\n      classNames.TICKICON = 'bs-ok-default';\r\n\r\n      for (var i = 0; i < toUpdate.length; i++) {\r\n        var option = toUpdate[i];\r\n        Selectpicker.DEFAULTS[option.name] = classNames[option.className];\r\n      }\r\n    }\r\n\r\n    if (version.major > '4') {\r\n      Selector.DATA_TOGGLE = 'data-bs-toggle=\"dropdown\"';\r\n    }\r\n\r\n    var value;\r\n    var chain = this.each(function () {\r\n      var $this = $(this);\r\n      if ($this.is('select')) {\r\n        var data = $this.data('selectpicker'),\r\n            options = typeof _option == 'object' && _option;\r\n\r\n        // for backwards compatibility\r\n        // (using title as placeholder is deprecated - remove in v2.0.0)\r\n        if (options.title) options.placeholder = options.title;\r\n\r\n        if (!data) {\r\n          var dataAttributes = $this.data();\r\n\r\n          for (var dataAttr in dataAttributes) {\r\n            if (Object.prototype.hasOwnProperty.call(dataAttributes, dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) {\r\n              delete dataAttributes[dataAttr];\r\n            }\r\n          }\r\n\r\n          var config = $.extend({}, Selectpicker.DEFAULTS, $.fn.selectpicker.defaults || {}, getAttributesObject($this), dataAttributes, options); // this is correct order on initial render\r\n          config.template = $.extend({}, Selectpicker.DEFAULTS.template, ($.fn.selectpicker.defaults ? $.fn.selectpicker.defaults.template : {}), dataAttributes.template, options.template);\r\n          config.source = $.extend({}, Selectpicker.DEFAULTS.source, ($.fn.selectpicker.defaults ? $.fn.selectpicker.defaults.source : {}), options.source);\r\n          $this.data('selectpicker', (data = new Selectpicker(this, config)));\r\n        } else if (options) {\r\n          for (var i in options) {\r\n            if (Object.prototype.hasOwnProperty.call(options, i)) {\r\n              data.options[i] = options[i];\r\n            }\r\n          }\r\n        }\r\n\r\n        if (typeof _option == 'string') {\r\n          if (data[_option] instanceof Function) {\r\n            value = data[_option].apply(data, args);\r\n          } else {\r\n            value = data.options[_option];\r\n          }\r\n        }\r\n      }\r\n    });\r\n\r\n    if (typeof value !== 'undefined') {\r\n      // noinspection JSUnusedAssignment\r\n      return value;\r\n    } else {\r\n      return chain;\r\n    }\r\n  }\r\n\r\n  var old = $.fn.selectpicker;\r\n  $.fn.selectpicker = Plugin;\r\n  $.fn.selectpicker.Constructor = Selectpicker;\r\n\r\n  // SELECTPICKER NO CONFLICT\r\n  // ========================\r\n  $.fn.selectpicker.noConflict = function () {\r\n    $.fn.selectpicker = old;\r\n    return this;\r\n  };\r\n\r\n  // get Bootstrap's keydown event handler for either Bootstrap 4 or Bootstrap 3\r\n  function keydownHandler () {\r\n    if (version.major < 5) {\r\n      if ($.fn.dropdown) {\r\n        // wait to define until function is called in case Bootstrap isn't loaded yet\r\n        var bootstrapKeydown = $.fn.dropdown.Constructor._dataApiKeydownHandler || $.fn.dropdown.Constructor.prototype.keydown;\r\n        return bootstrapKeydown.apply(this, arguments);\r\n      }\r\n    } else {\r\n      return Dropdown.dataApiKeydownHandler;\r\n    }\r\n  }\r\n\r\n  $(document)\r\n    .off('keydown.bs.dropdown.data-api')\r\n    .on('keydown.bs.dropdown.data-api', ':not(.bootstrap-select) > [' + Selector.DATA_TOGGLE + ']', keydownHandler)\r\n    .on('keydown.bs.dropdown.data-api', ':not(.bootstrap-select) > .dropdown-menu', keydownHandler)\r\n    .on('keydown' + EVENT_KEY, '.bootstrap-select [' + Selector.DATA_TOGGLE + '], .bootstrap-select [role=\"listbox\"], .bootstrap-select .bs-searchbox input', Selectpicker.prototype.keydown)\r\n    .on('focusin.modal', '.bootstrap-select [' + Selector.DATA_TOGGLE + '], .bootstrap-select [role=\"listbox\"], .bootstrap-select .bs-searchbox input', function (e) {\r\n      e.stopPropagation();\r\n    });\r\n\r\n  // SELECTPICKER DATA-API\r\n  // =====================\r\n  document.addEventListener('DOMContentLoaded', function () {\r\n    $('.selectpicker').each(function () {\r\n      var $selectpicker = $(this);\r\n      Plugin.call($selectpicker, $selectpicker.data());\r\n    });\r\n  });\r\n})(jQuery);\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 212364 characters]\n//# sourceURL=webpack-internal:///./node_modules/bootstrap-select/js/bootstrap-select.js\n");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval-source-map devtool is used.
/******/ 	var __webpack_exports__ = __webpack_require__("./libs/bootstrap-select/bootstrap-select.js");
/******/ 	
/******/ 	return __webpack_exports__;
/******/ })()
;
});