1! function (e) { 2 "use strict"; 3 var t, i, n, s; 4 5 function o(t) { 6 return e.each([{ 7 re: /[\xC0-\xC6]/g, 8 ch: "A" 9 }, { 10 re: /[\xE0-\xE6]/g, 11 ch: "a" 12 }, { 13 re: /[\xC8-\xCB]/g, 14 ch: "E" 15 }, { 16 re: /[\xE8-\xEB]/g, 17 ch: "e" 18 }, { 19 re: /[\xCC-\xCF]/g, 20 ch: "I" 21 }, { 22 re: /[\xEC-\xEF]/g, 23 ch: "i" 24 }, { 25 re: /[\xD2-\xD6]/g, 26 ch: "O" 27 }, { 28 re: /[\xF2-\xF6]/g, 29 ch: "o" 30 }, { 31 re: /[\xD9-\xDC]/g, 32 ch: "U" 33 }, { 34 re: /[\xF9-\xFC]/g, 35 ch: "u" 36 }, { 37 re: /[\xC7-\xE7]/g, 38 ch: "c" 39 }, { 40 re: /[\xD1]/g, 41 ch: "N" 42 }, { 43 re: /[\xF1]/g, 44 ch: "n" 45 }], function () { 46 t = t.replace(this.re, this.ch) 47 }), t 48 } 49 50 function a(e) { 51 var t = { 52 "&": "&", 53 "<": "<", 54 ">": ">", 55 '"': """, 56 "'": "'", 57 "`": "`" 58 }, 59 i = "(?:" + Object.keys(t).join("|") + ")", 60 n = new RegExp(i), 61 s = new RegExp(i, "g"), 62 o = null == e ? "" : "" + e; 63 return n.test(o) ? o.replace(s, function (e) { 64 return t[e] 65 }) : o 66 } 67 String.prototype.includes || (t = {}.toString, i = function () { 68 try { 69 var e = {}, 70 t = Object.defineProperty, 71 i = t(e, e, e) && t 72 } catch (e) {} 73 return i 74 }(), n = "".indexOf, s = function (e) { 75 if (null == this) throw new TypeError; 76 var i = String(this); 77 if (e && "[object RegExp]" == t.call(e)) throw new TypeError; 78 var s = i.length, 79 o = String(e), 80 a = o.length, 81 l = arguments.length > 1 ? arguments[1] : void 0, 82 r = l ? Number(l) : 0; 83 return r != r && (r = 0), !(a + Math.min(Math.max(r, 0), s) > s) && -1 != n.call(i, o, r) 84 }, i ? i(String.prototype, "includes", { 85 value: s, 86 configurable: !0, 87 writable: !0 88 }) : String.prototype.includes = s), String.prototype.startsWith || function () { 89 var e = function () { 90 try { 91 var e = {}, 92 t = Object.defineProperty, 93 i = t(e, e, e) && t 94 } catch (e) {} 95 return i 96 }(), 97 t = {}.toString, 98 i = function (e) { 99 if (null == this) throw new TypeError; 100 var i = String(this); 101 if (e && "[object RegExp]" == t.call(e)) throw new TypeError; 102 var n = i.length, 103 s = String(e), 104 o = s.length, 105 a = arguments.length > 1 ? arguments[1] : void 0, 106 l = a ? Number(a) : 0; 107 l != l && (l = 0); 108 var r = Math.min(Math.max(l, 0), n); 109 if (o + r > n) return !1; 110 for (var d = -1; ++d < o;) 111 if (i.charCodeAt(r + d) != s.charCodeAt(d)) return !1; 112 return !0 113 }; 114 e ? e(String.prototype, "startsWith", { 115 value: i, 116 configurable: !0, 117 writable: !0 118 }) : String.prototype.startsWith = i 119 }(), Object.keys || (Object.keys = function (e, t, i) { 120 for (t in i = [], e) i.hasOwnProperty.call(e, t) && i.push(t); 121 return i 122 }), e.fn.triggerNative = function (e) { 123 var t, i = this[0]; 124 i.dispatchEvent ? ("function" == typeof Event ? t = new Event(e, { 125 bubbles: !0 126 }) : (t = document.createEvent("Event")).initEvent(e, !0, !1), i.dispatchEvent(t)) : (i.fireEvent && ((t = document.createEventObject()).eventType = e, i.fireEvent("on" + e, t)), this.trigger(e)) 127 }, e.expr[":"].icontains = function (t, i, n) { 128 var s = e(t); 129 return (s.data("tokens") || s.text()).toUpperCase().includes(n[3].toUpperCase()) 130 }, e.expr[":"].ibegins = function (t, i, n) { 131 var s = e(t); 132 return (s.data("tokens") || s.text()).toUpperCase().startsWith(n[3].toUpperCase()) 133 }, e.expr[":"].aicontains = function (t, i, n) { 134 var s = e(t); 135 return (s.data("tokens") || s.data("normalizedText") || s.text()).toUpperCase().includes(n[3].toUpperCase()) 136 }, e.expr[":"].aibegins = function (t, i, n) { 137 var s = e(t); 138 return (s.data("tokens") || s.data("normalizedText") || s.text()).toUpperCase().startsWith(n[3].toUpperCase()) 139 }; 140 var l = function (t, i, n) { 141 n && (n.stopPropagation(), n.preventDefault()), this.$element = e(t), this.$newElement = null, this.$button = null, this.$menu = null, this.$lis = null, this.options = i, null === this.options.title && (this.options.title = this.$element.attr("title")), this.val = l.prototype.val, this.render = l.prototype.render, this.refresh = l.prototype.refresh, this.setStyle = l.prototype.setStyle, this.selectAll = l.prototype.selectAll, this.deselectAll = l.prototype.deselectAll, this.destroy = l.prototype.destroy, this.remove = l.prototype.remove, this.show = l.prototype.show, this.hide = l.prototype.hide, this.init() 142 }; 143 144 function r(t, i) { 145 var n, s = arguments, 146 o = t, 147 a = i; 148 [].shift.apply(s); 149 var r = this.each(function () { 150 var t = e(this); 151 if (t.is("select")) { 152 var i = t.data("selectpicker"), 153 r = "object" == typeof o && o; 154 if (i) { 155 if (r) 156 for (var d in r) r.hasOwnProperty(d) && (i.options[d] = r[d]) 157 } else { 158 var h = e.extend({}, l.DEFAULTS, e.fn.selectpicker.defaults || {}, t.data(), r); 159 h.template = e.extend({}, l.DEFAULTS.template, e.fn.selectpicker.defaults ? e.fn.selectpicker.defaults.template : {}, t.data().template, r.template), t.data("selectpicker", i = new l(this, h, a)) 160 } 161 "string" == typeof o && (n = i[o] instanceof Function ? i[o].apply(i, s) : i.options[o]) 162 } 163 }); 164 return void 0 !== n ? n : r 165 } 166 l.VERSION = "1.10.0", l.DEFAULTS = { 167 noneSelectedText: "Nothing selected", 168 noneResultsText: "No results matched {0}", 169 countSelectedText: function (e, t) { 170 return 1 == e ? "{0} item selected" : "{0} items selected" 171 }, 172 maxOptionsText: function (e, t) { 173 return [1 == e ? "Limit reached ({n} item max)" : "Limit reached ({n} items max)", 1 == t ? "Group limit reached ({n} item max)" : "Group limit reached ({n} items max)"] 174 }, 175 selectAllText: "Select All", 176 deselectAllText: "Deselect All", 177 doneButton: !1, 178 doneButtonText: "Close", 179 multipleSeparator: ", ", 180 styleBase: "btn", 181 style: "btn-default", 182 size: "auto", 183 title: null, 184 selectedTextFormat: "values", 185 width: !1, 186 container: !1, 187 hideDisabled: !1, 188 showSubtext: !1, 189 showIcon: !0, 190 showContent: !0, 191 dropupAuto: !0, 192 header: !1, 193 liveSearch: !1, 194 liveSearchPlaceholder: null, 195 liveSearchNormalize: !1, 196 liveSearchStyle: "contains", 197 actionsBox: !1, 198 iconBase: "glyphicon", 199 tickIcon: "glyphicon-ok", 200 showTick: !1, 201 template: { 202 caret: '<span class="caret"></span>' 203 }, 204 maxOptions: !1, 205 mobile: !1, 206 selectOnTab: !1, 207 dropdownAlignRight: !1 208 }, l.prototype = { 209 constructor: l, 210 init: function () { 211 var t = this, 212 i = this.$element.attr("id"); 213 this.$element.addClass("bs-select-hidden"), this.liObj = {}, this.multiple = this.$element.prop("multiple"), this.autofocus = this.$element.prop("autofocus"), this.$newElement = this.createView(), this.$element.after(this.$newElement).appendTo(this.$newElement), this.$button = this.$newElement.children("button"), this.$menu = this.$newElement.children(".dropdown-menu"), this.$menuInner = this.$menu.children(".inner"), this.$searchbox = this.$menu.find("input"), this.$element.removeClass("bs-select-hidden"), this.options.dropdownAlignRight && this.$menu.addClass("dropdown-menu-right"), void 0 !== i && (this.$button.attr("data-id", i), e('label[for="' + i + '"]').click(function (e) { 214 e.preventDefault(), t.$button.focus() 215 })), this.checkDisabled(), this.clickListener(), this.options.liveSearch && this.liveSearchListener(), this.render(), this.setStyle(), this.setWidth(), this.options.container && this.selectPosition(), this.$menu.data("this", this), this.$newElement.data("this", this), this.options.mobile && this.mobile(), this.$newElement.on({ 216 "hide.bs.dropdown": function (e) { 217 t.$element.trigger("hide.bs.select", e) 218 }, 219 "hidden.bs.dropdown": function (e) { 220 t.$element.trigger("hidden.bs.select", e) 221 }, 222 "show.bs.dropdown": function (e) { 223 t.$element.trigger("show.bs.select", e) 224 }, 225 "shown.bs.dropdown": function (e) { 226 t.$element.trigger("shown.bs.select", e) 227 } 228 }), t.$element[0].hasAttribute("required") && this.$element.on("invalid", function () { 229 t.$button.addClass("bs-invalid").focus(), t.$element.on({ 230 "focus.bs.select": function () { 231 t.$button.focus(), t.$element.off("focus.bs.select") 232 }, 233 "shown.bs.select": function () { 234 t.$element.val(t.$element.val()).off("shown.bs.select") 235 }, 236 "rendered.bs.select": function () { 237 this.validity.valid && t.$button.removeClass("bs-invalid"), t.$element.off("rendered.bs.select") 238 } 239 }) 240 }), setTimeout(function () { 241 t.$element.trigger("loaded.bs.select") 242 }) 243 }, 244 createDropdown: function () { 245 var t = this.multiple || this.options.showTick ? " show-tick" : "", 246 i = this.$element.parent().hasClass("input-group") ? " input-group-btn" : "", 247 n = this.autofocus ? " autofocus" : "", 248 s = this.options.header ? '<div class="popover-title"><button type="button" class="close" aria-hidden="true">×</button>' + this.options.header + "</div>" : "", 249 o = this.options.liveSearch ? '<div class="bs-searchbox"><!--<input type="text" class="form-control" autocomplete="off"' + (null === this.options.liveSearchPlaceholder ? "" : ' placeholder="' + a(this.options.liveSearchPlaceholder) + '"') + ">--></div>" : "", 250 l = this.multiple && this.options.actionsBox ? '<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn btn-default">' + this.options.selectAllText + '</button><button type="button" class="actions-btn bs-deselect-all btn btn-default">' + this.options.deselectAllText + "</button></div></div>" : "", 251 r = this.multiple && this.options.doneButton ? '<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm btn-default">' + this.options.doneButtonText + "</button></div></div>" : "", 252 d = '<div class="btn-group bootstrap-select' + t + i + '"><button type="button" class="' + this.options.styleBase + ' dropdown-toggle" data-toggle="dropdown"' + n + '><span class="filter-option pull-left"></span> <span class="bs-caret">' + this.options.template.caret + '</span></button><div class="dropdown-menu open">' + s + o + l + '<ul class="dropdown-menu inner" role="menu"></ul>' + r + "</div></div>"; 253 return e(d) 254 }, 255 createView: function () { 256 var e = this.createDropdown(), 257 t = this.createLi(); 258 return e.find("ul")[0].innerHTML = t, e 259 }, 260 reloadLi: function () { 261 this.destroyLi(); 262 var e = this.createLi(); 263 this.$menuInner[0].innerHTML = e 264 }, 265 destroyLi: function () { 266 this.$menu.find("li").remove() 267 }, 268 createLi: function () { 269 var t = this, 270 i = [], 271 n = 0, 272 s = document.createElement("option"), 273 l = -1, 274 r = function (e, t, i, n) { 275 return "<li" + (void 0 !== i & "" !== i ? ' class="' + i + '"' : "") + (void 0 !== t & null !== t ? ' data-original-index="' + t + '"' : "") + (void 0 !== n & null !== n ? 'data-optgroup="' + n + '"' : "") + ">" + e + "</li>" 276 }, 277 d = function (e, i, n, s) { 278 return '<a tabindex="0"' + (void 0 !== i ? ' class="' + i + '"' : "") + (void 0 !== n ? ' style="' + n + '"' : "") + (t.options.liveSearchNormalize ? ' data-normalized-text="' + o(a(e)) + '"' : "") + (void 0 !== s || null !== s ? ' data-tokens="' + s + '"' : "") + ">" + e + '<span class="' + t.options.iconBase + " " + t.options.tickIcon + ' check-mark"></span></a>' 279 }; 280 if (this.options.title && !this.multiple && (l--, !this.$element.find(".bs-title-option").length)) { 281 var h = this.$element[0]; 282 s.className = "bs-title-option", s.appendChild(document.createTextNode(this.options.title)), s.value = "", h.insertBefore(s, h.firstChild), void 0 === e(h.options[h.selectedIndex]).attr("selected") && (s.selected = !0) 283 } 284 return this.$element.find("option").each(function (s) { 285 var o = e(this); 286 if (l++, !o.hasClass("bs-title-option")) { 287 var a = this.className || "", 288 h = this.style.cssText,
289 c = o.data("content") ? o.data("content") : o.html(), 290 p = o.data("tokens") ? o.data("tokens") : null, 291 u = void 0 !== o.data("subtext") ? '<small class="text-muted">' + o.data("subtext") + "</small>" : "", 292 m = void 0 !== o.data("icon") ? '<span class="' + t.options.iconBase + " " + o.data("icon") + '"></span> ' : "", 293 f = "OPTGROUP" === this.parentNode.tagName, 294 v = this.disabled || f && this.parentNode.disabled; 295 if ("" !== m && v && (m = "<span>" + m + "</span>"), t.options.hideDisabled && v && !f) l--; 296 else { 297 if (o.data("content") || (c = m + '<span class="text">' + c + u + "</span>"), f && !0 !== o.data("divider")) { 298 var b = " " + this.parentNode.className || ""; 299 if (0 === o.index()) { 300 n += 1; 301 var g = this.parentNode.label, 302 $ = void 0 !== o.parent().data("subtext") ? '<small class="text-muted">' + o.parent().data("subtext") + "</small>" : ""; 303 g = (o.parent().data("icon") ? '<span class="' + t.options.iconBase + " " + o.parent().data("icon") + '"></span> ' : "") + '<span class="text">' + g + $ + "</span>", 0 !== s && i.length > 0 && (l++, i.push(r("", null, "divider", n + "div"))), l++, i.push(r(g, null, "dropdown-header" + b, n)) 304 } 305 if (t.options.hideDisabled && v) return void l--;
306 i.push(r(d(c, "opt " + a + b, h, p), s, "", n)) 307 } else !0 === o.data("divider") ? i.push(r("", s, "divider")) : !0 === o.data("hidden") ? i.push(r(d(c, a, h, p), s, "hidden is-hidden")) : (this.previousElementSibling && "OPTGROUP" === this.previousElementSibling.tagName && (l++, i.push(r("", null, "divider", n + "div"))), i.push(r(d(c, a, h, p), s))); 308 t.liObj[s] = l 309 } 310 } 311 }), this.multiple || 0 !== this.$element.find("option:selected").length || this.options.title || this.$element.find("option").eq(0).prop("selected", !0).attr("selected", "selected"), i.join("") 312 }, 313 findLis: function () { 314 return null == this.$lis && (this.$lis = this.$menu.find("li")), this.$lis 315 }, 316 render: function (t) { 317 var i, n = this; 318 !1 !== t && this.$element.find("option").each(function (e) { 319 var t = n.findLis().eq(n.liObj[e]); 320 n.setDisabled(e, this.disabled || "OPTGROUP" === this.parentNode.tagName && this.parentNode.disabled, t), n.setSelected(e, this.selected, t) 321 }), this.tabIndex(); 322 var s = this.$element.find("option").map(function () { 323 if (this.selected) { 324 if (n.options.hideDisabled && (this.disabled || "OPTGROUP" === this.parentNode.tagName && this.parentNode.disabled)) return; 325 var t, i = e(this), 326 s = i.data("icon") && n.options.showIcon ? '<i class="' + n.options.iconBase + " " + i.data("icon") + '"></i> ' : ""; 327 return t = n.options.showSubtext && i.data("subtext") && !n.multiple ? ' <small class="text-muted">' + i.data("subtext") + "</small>" : "", void 0 !== i.attr("title") ? i.attr("title") : i.data("content") && n.options.showContent ? i.data("content") : s + i.html() + t 328 } 329 }).toArray(), 330 o = this.multiple ? s.join(this.options.multipleSeparator) : s[0]; 331 if (this.multiple && this.options.selectedTextFormat.indexOf("count") > -1) { 332 var a = this.options.selectedTextFormat.split(">"); 333 if (a.length > 1 && s.length > a[1] || 1 == a.length && s.length >= 2) { 334 i = this.options.hideDisabled ? ", [disabled]" : ""; 335 var l = this.$element.find("option").not('[data-divider="true"], [data-hidden="true"]' + i).length; 336 o = ("function" == typeof this.options.countSelectedText ? this.options.countSelectedText(s.length, l) : this.options.countSelectedText).replace("{0}", s.length.toString()).replace("{1}", l.toString()) 337 } 338 } 339 null == this.options.title && (this.options.title = this.$element.attr("title")), "static" == this.options.selectedTextFormat && (o = this.options.title), o || (o = void 0 !== this.options.title ? this.options.title : this.options.noneSelectedText), this.$button.attr("title", e.trim(o.replace(/<[^>]*>?/g, ""))), this.$button.children(".filter-option").html(o), this.$element.trigger("rendered.bs.select") 340 }, 341 setStyle: function (e, t) { 342 this.$element.attr("class") && this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi, "")); 343 var i = e || this.options.style; 344 "add" == t ? this.$button.addClass(i) : "remove" == t ? this.$button.removeClass(i) : (this.$button.removeClass(this.options.style), this.$button.addClass(i)) 345 }, 346 liHeight: function (t) { 347 if (t || !1 !== this.options.size && !this.sizeInfo) { 348 var i = document.createElement("div"), 349 n = document.createElement("div"), 350 s = document.createElement("ul"), 351 o = document.createElement("li"), 352 a = document.createElement("li"), 353 l = document.createElement("a"), 354 r = document.createElement("span"), 355 d = this.options.header && this.$menu.find(".popover-title").length > 0 ? this.$menu.find(".popover-title")[0].cloneNode(!0) : null, 356 h = this.options.liveSearch ? document.createElement("div") : null, 357 c = this.options.actionsBox && this.multiple && this.$menu.find(".bs-actionsbox").length > 0 ? this.$menu.find(".bs-actionsbox")[0].cloneNode(!0) : null, 358 p = this.options.doneButton && this.multiple && this.$menu.find(".bs-donebutton").length > 0 ? this.$menu.find(".bs-donebutton")[0].cloneNode(!0) : null; 359 if (r.className = "text", i.className = this.$menu[0].parentNode.className + " open", n.className = "dropdown-menu open", s.className = "dropdown-menu inner", o.className = "divider", r.appendChild(document.createTextNode("Inner text")), l.appendChild(r), a.appendChild(l), s.appendChild(a), s.appendChild(o), d && n.appendChild(d), h) { 360 var u = document.createElement("span"); 361 h.className = "bs-searchbox", u.className = "form-control", h.appendChild(u), n.appendChild(h) 362 } 363 c && n.appendChild(c), n.appendChild(s), p && n.appendChild(p), i.appendChild(n), document.body.appendChild(i); 364 var m = l.offsetHeight, 365 f = d ? d.offsetHeight : 0, 366 v = h ? h.offsetHeight : 0, 367 b = c ? c.offsetHeight : 0, 368 g = p ? p.offsetHeight : 0, 369 $ = e(o).outerHeight(!0), 370 x = "function" == typeof getComputedStyle && getComputedStyle(n), 371 w = x ? null : e(n), 372 C = parseInt(x ? x.paddingTop : w.css("paddingTop")) + parseInt(x ? x.paddingBottom : w.css("paddingBottom")) + parseInt(x ? x.borderTopWidth : w.css("borderTopWidth")) + parseInt(x ? x.borderBottomWidth : w.css("borderBottomWidth")), 373 y = C + parseInt(x ? x.marginTop : w.css("marginTop")) + parseInt(x ? x.marginBottom : w.css("marginBottom")) + 2; 374 document.body.removeChild(i), this.sizeInfo = { 375 liHeight: m, 376 headerHeight: f, 377 searchHeight: v, 378 actionsHeight: b, 379 doneButtonHeight: g, 380 dividerHeight: $, 381 menuPadding: C, 382 menuExtras: y 383 } 384 } 385 }, 386 setSize: function () { 387 if (this.findLis(), this.liHeight(), this.options.header && this.$menu.css("padding-top", 0), !1 !== this.options.size) { 388 var t, i, n, s, o = this, 389 a = this.$menu, 390 l = this.$menuInner, 391 r = e(window), 392 d = this.$newElement[0].offsetHeight, 393 h = this.sizeInfo.liHeight, 394 c = this.sizeInfo.headerHeight, 395 p = this.sizeInfo.searchHeight, 396 u = this.sizeInfo.actionsHeight, 397 m = this.sizeInfo.doneButtonHeight, 398 f = this.sizeInfo.dividerHeight, 399 v = this.sizeInfo.menuPadding, 400 b = this.sizeInfo.menuExtras, 401 g = this.options.hideDisabled ? ".disabled" : "", 402 $ = function () { 403 n = o.$newElement.offset().top - r.scrollTop(), s = r.height() - n - d 404 }; 405 if ($(), "auto" === this.options.size) { 406 var x = function () { 407 var r, d = function (t, i) { 408 return function (n) { 409 return i ? n.classList ? n.classList.contains(t) : e(n).hasClass(t) : !(n.classList ? n.classList.contains(t) : e(n).hasClass(t)) 410 } 411 }, 412 f = o.$menuInner[0].getElementsByTagName("li"), 413 g = Array.prototype.filter ? Array.prototype.filter.call(f, d("hidden", !1)) : o.$lis.not(".hidden"), 414 x = Array.prototype.filter ? Array.prototype.filter.call(g, d("dropdown-header", !0)) : g.f
414ilter(".dropdown-header"); 415 $(), t = s - b, o.options.container ? (a.data("height") || a.data("height", a.height()), i = a.data("height")) : i = a.height(), o.options.dropupAuto && o.$newElement.toggleClass("dropup", n > s && t - b < i), o.$newElement.hasClass("dropup") && (t = n - b), r = g.length + x.length > 3 ? 3 * h + b - 2 : 0, a.css({ 416 "max-height": t + "px", 417 overflow: "hidden", 418 "min-height": r + c + p + u + m + "px" 419 }), l.css({ 420 "max-height": t - c - p - u - m - v + "px", 421 "overflow-y": "auto", 422 "min-height": Math.max(r - v, 0) + "px" 423 }) 424 }; 425 x(), this.$searchbox.off("input.getSize propertychange.getSize").on("input.getSize propertychange.getSize", x), r.off("resize.getSize scroll.getSize").on("resize.getSize scroll.getSize", x) 426 } else if (this.options.size && "auto" != this.options.size && this.$lis.not(g).length > this.options.size) { 427 var w = this.$lis.not(".divider").not(g).children().slice(0, this.options.size).last().parent().index(), 428 C = this.$lis.slice(0, w + 1).filter(".divider").length; 429 t = h * this.options.size + C * f + v, o.options.container ? (a.data("height") || a.data("height", a.height()), i = a.data("height")) : i = a.height(), o.options.dropupAuto && this.$newElement.toggleClass("dropup", n > s && t - b < i), a.css({ 430 "max-height": t + c + p + u + m + "px", 431 overflow: "hidden", 432 "min-height": "" 433 }), l.css({ 434 "max-height": t - v + "px", 435 "overflow-y": "auto", 436 "min-height": "" 437 }) 438 } 439 } 440 }, 441 setWidth: function () { 442 if ("auto" === this.options.width) { 443 this.$menu.css("min-width", "0"); 444 var e = this.$menu.parent().clone().appendTo("body"), 445 t = this.options.container ? this.$newElement.clone().appendTo("body") : e, 446 i = e.children(".dropdown-menu").outerWidth(), 447 n = t.css("width", "auto").children("button").outerWidth(); 448 e.remove(), t.remove(), this.$newElement.css("width", Math.max(i, n) + "px") 449 } else "fit" === this.options.width ? (this.$menu.css("min-width", ""), this.$newElement.css("width", "").addClass("fit-width")) : this.options.width ? (this.$menu.css("min-width", ""), this.$newElement.css("width", this.options.width)) : (this.$menu.css("min-width", ""), this.$newElement.css("width", "")); 450 this.$newElement.hasClass("fit-width") && "fit" !== this.options.width && this.$newElement.removeClass("fit-width") 451 }, 452 selectPosition: function () { 453 this.$bsContainer = e('<div class="bs-container" />'); 454 var t, i, n = this, 455 s = function (e) { 456 n.$bsContainer.addClass(e.attr("class").replace(/form-control|fit-width/gi, "")).toggleClass("dropup", e.hasClass("dropup")), t = e.offset(), i = e.hasClass("dropup") ? 0 : e[0].offsetHeight, n.$bsContainer.css({ 457 top: t.top + i, 458 left: t.left, 459 width: e[0].offsetWidth 460 }) 461 }; 462 this.$button.on("click", function () { 463 var t = e(this); 464 n.isDisabled() || (s(n.$newElement), n.$bsContainer.appendTo(n.options.container).toggleClass("open", !t.hasClass("open")).append(n.$menu)) 465 }), e(window).on("resize scroll", function () { 466 s(n.$newElement) 467 }), this.$element.on("hide.bs.select", function () { 468 n.$menu.data("height", n.$menu.height()), n.$bsContainer.detach() 469 }) 470 }, 471 setSelected: function (e, t, i) { 472 i || (i = this.findLis().eq(this.liObj[e])), i.toggleClass("selected", t) 473 }, 474 setDisabled: function (e, t, i) { 475 i || (i = this.findLis().eq(this.liObj[e])), t ? i.addClass("disabled").children("a").attr("href", "#").attr("tabindex", -1) : i.removeClass("disabled").children("a").removeAttr("href").attr("tabindex", 0) 476 }, 477 isDisabled: function () { 478 return this.$element[0].disabled 479 }, 480 checkDisabled: function () { 481 var e = this; 482 this.isDisabled() ? (this.$newElement.addClass("disabled"), this.$button.addClass("disabled").attr("tabindex", -1)) : (this.$button.hasClass("disabled") && (this.$newElement.removeClass("disabled"), this.$button.removeClass("disabled")), -1 != this.$button.attr("tabindex") || this.$element.data("tabindex") || this.$button.removeAttr("tabindex")), this.$button.click(function () { 483 return !e.isDisabled() 484 }) 485 }, 486 tabIndex: function () { 487 this.$element.data("tabindex") !== this.$element.attr("tabindex") && -98 !== this.$element.attr("tabindex") && "-98" !== this.$element.attr("tabindex") && (this.$element.data("tabindex", this.$element.attr("tabindex")), this.$button.attr("tabindex", this.$element.data("tabindex"))), this.$element.attr("tabindex", -98) 488 }, 489 clickListener: function () { 490 var t = this, 491 i = e(document); 492 this.$newElement.on("touchstart.dropdown", ".dropdown-menu", function (e) { 493 e.stopPropagation() 494 }), i.data("spaceSelect", !1), this.$button.on("keyup", function (e) { 495 /(32)/.test(e.keyCode.toString(10)) && i.data("spaceSelect") && (e.preventDefault(), i.data("spaceSelect", !1)) 496 }), this.$button.on("click", function () { 497 t.setSize() 498 }), this.$element.on("shown.bs.select", function () { 499 if (t.options.liveSearch || t.multiple) { 500 if (!t.multiple) { 501 var e = t.liObj[t.$element[0].selectedIndex]; 502 if ("number" != typeof e || !1 === t.options.size) return; 503 var i = t.$lis.eq(e)[0].offsetTop - t.$menuInner[0].offsetTop;
504 i = i - t.$menuInner[0].offsetHeight / 2 + t.sizeInfo.liHeight / 2, t.$menuInner[0].scrollTop = i 505 } 506 } else t.$menuInner.find(".selected a").focus() 507 }), this.$menuInner.on("click", "li a", function (i) { 508 var n = e(this), 509 s = n.parent().data("originalIndex"), 510 o = t.$element.val(), 511 a = t.$element.prop("selectedIndex"); 512 if (t.multiple && i.stopPropagation(), i.preventDefault(), !t.isDisabled() && !n.parent().hasClass("disabled")) { 513 var l = t.$element.find("option"), 514 r = l.eq(s), 515 d = r.prop("selected"), 516 h = r.parent("optgroup"), 517 c = t.options.maxOptions, 518 p = h.data("maxOptions") || !1; 519 if (t.multiple) { 520 if (r.prop("selected", !d), t.setSelected(s, !d), n.blur(), !1 !== c || !1 !== p) { 521 var u = c < l.filter(":selected").length, 522 m = p < h.find("option:selected").length; 523 if (c && u || p && m) 524 if (c && 1 == c) l.prop("selected", !1), r.prop("selected", !0), t.$menuInner.find(".selected").removeClass("selected"), t.setSelected(s, !0); 525 else if (p && 1 == p) { 526 h.find("option:selected").prop("selected", !1), r.prop("selected", !0); 527 var f = n.parent().data("optgroup"); 528 t.$menuInner.find('[data-optgroup="' + f + '"]').removeClass("selected"), t.setSelected(s, !0) 529 } else { 530 var v = "function" == typeof t.options.maxOptionsText ? t.options.maxOptionsText(c, p) : t.options.maxOptionsText, 531 b = v[0].replace("{n}", c), 532 g = v[1].replace("{n}", p), 533 $ = e('<div class="notify"></div>'); 534 v[2] && (b = b.replace("{var}", v[2][c > 1 ? 0 : 1]), g = g.replace("{var}", v[2][p > 1 ? 0 : 1])), r.prop("selected", !1), t.$menu.append($), c && u && ($.append(e("<div>" + b + "</div>")), t.$element.trigger("maxReached.bs.select")), p && m && ($.append(e("<div>" + g + "</div>")), t.$element.trigger("maxReachedGrp.bs.select")), setTimeout(function () { 535 t.setSelected(s, !1) 536 }, 10), $.delay(750).fadeOut(300, function () { 537 e(this).remove() 538 }) 539 } 540 } 541 } else l.prop("selected", !1), r.prop("selected", !0), t.$menuInner.find(".selected").removeClass("selected"), t.setSelected(s, !0); 542 t.multiple ? t.options.liveSearch && t.$searchbox.focus() : t.$button.focus(), (o != t.$element.val() && t.multiple || a != t.$element.prop("selectedIndex") && !t.multiple) && t.$element.trigger("changed.bs.select", [s, r.prop("selected"), d]).triggerNative("change") 543 } 544 }), this.$menu.on("click", "li.disabled a, .popover-title, .popover-title :not(.close)", function (i) { 545 i.currentTarget == this && (i.preventDefault(), i.stopPropagation(), t.options.liveSearch && !e(i.target).hasClass("close") ? t.$searchbox.focus() : t.$button.focus()) 546 }), this.$menuInner.on("click", ".divider, .dropdown-header", function (e) { 547 e.preventDefault(), e.stopPropagation(), t.options.liveSearch ? t.$searchbox.focus() : t.$button.focus() 548 }), this.$menu.on("click", ".popover-title .close", function () { 549 t.$button.click() 550 }), this.$searchbox.on("click", function (e) { 551 e.stopPropagation() 552 }), this.$menu.on("click", ".actions-btn", function (i) { 553 t.options.liveSearch ? t.$searchbox.focus() : t.$button.focus(), i.preventDefault(), i.stopPropagation(), e(this).hasClass("bs-select-all") ? t.selectAll() : t.deselectAll() 554 }), this.$element.change(function () { 555 t.render(!1) 556 }) 557 }, 558 liveSearchListener: function () { 559 var t = this, 560 i = e('<li class="no-results"></li>'); 561 this.$button.on("click.dropdown.data-api touchstart.dropdown.data-api", function () { 562 t.$menuInner.find(".active").removeClass("active"), t.$searchbox.val() && (t.$searchbox.val(""), t.$lis.not(".is-hidden").removeClass("hidden"), i.parent().length && i.remove()), t.multiple || t.$menuInner.find(".selected").addClass("active"), setTimeout(function () { 563 t.$searchbox.focus() 564 }, 10) 565 }), this.$searchbox.on("click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api", function (e) { 566 e.stopPropagation() 567 }), this.$searchbox.on("input propertychange", function () { 568 if (t.$searchbox.val()) { 569 var n = t.$lis.not(".is-hidden").removeClass("hidden").children("a"); 570 (n = t.options.liveSearchNormalize ? n.not(":a" + t._searchStyle() + '("' + o(t.$searchbox.val()) + '")') : n.not(":" + t._searchStyle() + '("' + t.$searchbox.val() + '")')).parent().addClass("hidden"), t.$lis.filter(".dropdown-header").each(function () { 571 var i = e(this), 572 n = i.data("optgroup"); 573 0 === t.$lis.filter("[data-optgroup=" + n + "]").not(i).not(".hidden").length && (i.addClass("hidden"), t.$lis.filter("[data-optgroup=" + n + "div]").addClass("hidden")) 574 }); 575 var s = t.$lis.not(".hidden"); 576 s.each(function (t) { 577 var i = e(this); 578 i.hasClass("divider") && (i.index() === s.first().index() || i.index() === s.last().index() || s.eq(t + 1).hasClass("divider")) && i.addClass("hidden") 579 }), t.$lis.not(".hidden, .no-results").length ? i.parent().length && i.remove() : (i.parent().length && i.remove(), i.html(t.options.noneResultsText.replace("{0}", '"' + a(t.$searchbox.val()) + '"')).show(), t.$menuInner.append(i)) 580 } else t.$lis.not(".is-hidden").removeClass("hidden"), i.parent().length && i.remove(); 581 t.$lis.filter(".active").removeClass("active"), t.$searchbox.val() && t.$lis.not(".hidden, .divider, .dropdown-header").eq(0).addClass("active").children("a").focus(), e(this).focus() 582 }) 583 }, 584 _searchStyle: function () { 585 return { 586 begins: "ibegins", 587 startsWith: "ibegins" 588 } [this.options.liveSearchStyle] || "icontains" 589 }, 590 val: function (e) { 591 return void 0 !== e ? (this.$element.val(e), this.render(), this.$element) : this.$element.val() 592 }, 593 changeAll: function (t) { 594 void 0 === t && (t = !0), this.findLis(); 595 for (var i = this.$element.find("option"), n = this.$lis.not(".divider, .dropdown-header, .disabled, .hidden").toggleClass("selected", t), s = n.length, o = [], a = 0; a < s; a++) { 596 var l = n[a].getAttribute("data-original-index"); 597 o[o.length] = i.eq(l)[0] 598 } 599 e(o).prop("selected", t), this.render(!1), this.$element.trigger("changed.bs.select").triggerNative("change") 600 }, 601 selectAll: function () { 602 return this.changeAll(!0) 603 }, 604 deselectAll: function () { 605 return this.changeAll(!1) 606 }, 607 toggle: function (e) { 608 (e = e || window.event) && e.stopPropagation(), this.$button.trigger("click") 609 }, 610 keydown: function (t) { 611 var i, n, s, a, l, r, d, h, c, p = e(this), 612 u = p.is("input") ? p.parent().parent() : p.parent(), 613 m = u.data("this"), 614 f = ":not(.disabled, .hidden, .dropdown-header, .divider)", 615 v = { 616 32: " ", 617 48: "0", 618 49: "1", 619 50: "2", 620 51: "3", 621 52: "4", 622 53: "5", 623 54: "6", 624 55: "7", 625 56: "8", 626 57: "9", 627 59: ";", 628 65: "a", 629 66: "b", 630 67: "c", 631 68: "d", 632 69: "e", 633 70: "f", 634 71: "g", 635 72: "h", 636 73: "i", 637 74: "j", 638 75: "k", 639 76: "l", 640 77: "m", 641 78: "n", 642 79: "o", 643 80: "p", 644 81: "q", 645 82: "r", 646 83: "s", 647 84: "t", 648 85: "u", 649 86: "v", 650 87: "w", 651 88: "x", 652 89: "y", 653 90: "z", 654 96: "0", 655 97: "1", 656 98: "2", 657 99: "3", 658 100: "4", 659 101: "5", 660 102: "6", 661 103: "7", 662 104: "8", 663 105: "9" 664 }; 665 if (m.options.liveSearch && (u = p.parent().parent()), m.options.container && (u = m.$menu), i = e("[role=menu] li", u), !(c = m.$newElement.hasClass("open")) && (t.keyCode >= 48 && t.keyCode <= 57 || t.keyCode >= 96 && t.keyCode <= 105 || t.keyCode >= 65 && t.keyCode <= 90) && (m.options.container ? m.$button.trigger("click") : (m.setSize(), m.$menu.parent().addClass("open"), c = !0), m.$searchbox.focus()), m.options.liveSearch && (/(^9$|27)/.test(t.keyCode.toString(10)) && c && 0 === m.$menu.find(".active").length && (t.preventDefault(), m.$menu.parent().removeClass("open"), m.options.container && m.$newElement.removeClass("open"), m.$button.focus()), i = e("[role=menu] li" + f, u), p.val() || /(38|40)/.test(t.keyCode.toString(10)) || 0 === i.filter(".active").length && (i = m.$menuInner.find("li"), i = m.options.liveSearchNormalize ? i.filter(":a" + m._searchStyle() + "(" + o(v[t.keyCode]) + ")") : i.filter(":" + m._searchStyle() + "(" + v[t.keyCode] + ")"))), i.length) { 666 if (/(38|40)/.test(t.keyCode.toString(10))) n = i.index(i.find("a").filter(":focus").parent()), a = i.filter(f).first().index(), l = i.filter(f).last().index(), s = i.eq(n).nextAll(f).eq(0).index(), r = i.eq(n).prevAll(f).eq(0).index(), d = i.eq(s).prevAll(f).eq(0).index(), m.options.liveSearch && (i.each(function (t) { 667 e(this).hasClass("disabled") || e(this).data("index", t) 668 }), n = i.index(i.filter(".active")), a = i.first().data("index"), l = i.last().data("index"), s = i.eq(n).nextAll().eq(0).data("index"), r = i.eq(n).prevAll().eq(0).data("index"), d = i.eq(s).prevAll().eq(0).data("index")), h = p.data("prevIndex"), 38 == t.keyCode ? (m.options.liveSearch && n--, n != d && n > r && (n = r), n < a && (n = a), n == h && (n = l)) : 40 == t.keyCode && (m.options.liveSearch && n++, -1 == n && (n = 0), n != d && n < s && (n = s), n > l && (n = l), n == h && (n = a)), p.data("prevIndex", n), m.options.liveSearch ? (t.preventDefault(), p.hasClass("dropdown-toggle") || (i.removeClass("active").eq(n).addClass("active").children("a").focus(), p.focus())) : i.eq(n).children("a").focus(); 669 else if (!p.is("input")) { 670 var b, g = []; 671 i.each(function () { 672 e(this).hasClass("disabled") || e.trim(e(this).children("a").text().toLowerCase()).substring(0, 1) == v[t.ke
672yCode] && g.push(e(this).index()) 673 }), b = e(document).data("keycount"), b++, e(document).data("keycount", b), e.trim(e(":focus").text().toLowerCase()).substring(0, 1) != v[t.keyCode] ? (b = 1, e(document).data("keycount", b)) : b >= g.length && (e(document).data("keycount", 0), b > g.length && (b = 1)), i.eq(g[b - 1]).children("a").focus() 674 } 675 if ((/(13|32)/.test(t.keyCode.toString(10)) || /(^9$)/.test(t.keyCode.toString(10)) && m.options.selectOnTab) && c) { 676 if (/(32)/.test(t.keyCode.toString(10)) || t.preventDefault(), m.options.liveSearch) /(32)/.test(t.keyCode.toString(10)) || (m.$menuInner.find(".active a").click(), p.focus()); 677 else { 678 var $ = e(":focus"); 679 $.click(), $.focus(), t.preventDefault(), e(document).data("spaceSelect", !0) 680 } 681 e(document).data("keycount", 0) 682 }(/(^9$|27)/.test(t.keyCode.toString(10)) && c && (m.multiple || m.options.liveSearch) || /(27)/.test(t.keyCode.toString(10)) && !c) && (m.$menu.parent().removeClass("open"), m.options.container && m.$newElement.removeClass("open"), m.$button.focus()) 683 } 684 }, 685 mobile: function () { 686 this.$element.addClass("mobile-device") 687 }, 688 refresh: function () { 689 this.$lis = null, this.liObj = {}, this.reloadLi(), this.render(), this.checkDisabled(), this.liHeight(!0), this.setStyle(), this.setWidth(), this.$lis && this.$searchbox.trigger("propertychange"), this.$element.trigger("refreshed.bs.select") 690 }, 691 hide: function () { 692 this.$newElement.hide() 693 }, 694 show: function () { 695 this.$newElement.show() 696 }, 697 remove: function () { 698 this.$newElement.remove(), this.$element.remove() 699 }, 700 destroy: function () { 701 this.$newElement.before(this.$element).remove(), this.$bsContainer ? this.$bsContainer.remove() : this.$menu.remove(), this.$element.off(".bs.select").removeData("selectpicker").removeClass("bs-select-hidden selectpicker") 702 } 703 }; 704 var d = e.fn.selectpicker; 705 e.fn.selectpicker = r, e.fn.selectpicker.Constructor = l, e.fn.selectpicker.noConflict = function () { 706 return e.fn.selectpicker = d, this 707 }, e(document).data("keycount", 0).on("keydown.bs.select", '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input', l.prototype.keydown).on("focusin.modal", '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input', function (e) { 708 e.stopPropagation() 709 }), e(window).on("load.bs.select.data-api", function () { 710 e(".selectpicker").each(function () { 711 var t = e(this); 712 r.call(t, t.data()) 713 }) 714 }) 715}(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.