vendor: 4,865 bytes, lines 1-128
1/*! RESOURCE: /scripts/heisenberg/bootstrap/affix.js */ 2+function ($) { 3 'use strict'; 4 var Affix = function (element, options) { 5 this.options = $.extend({}, Affix.DEFAULTS, options) 6 var target = this.options.target === Affix.DEFAULTS.target ? $(this.options.target) : $(document).find(this.options.target === '#' ? [] : this.options.target) 7 this.$target = target 8 .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) 9 .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) 10 this.$element = $(element) 11 this.affixed = 12 this.unpin = 13 this.pinnedOffset = null 14 this.checkPosition() 15 } 16 Affix.VERSION = '3.2.0' 17 Affix.RESET = 'affix affix-top affix-bottom' 18 Affix.DEFAULTS = { 19 offset: 0, 20 target: window 21 } 22 Affix.prototype.getPinnedOffset = function () { 23 if (this.pinnedOffset) return this.pinnedOffset 24 this.$element.removeClass(Affix.RESET).addClass('affix') 25 var scrollTop = this.$target.scrollTop() 26 var position = this.$element.offset() 27 return (this.pinnedOffset = position.top - scrollTop) 28 } 29 Affix.prototype.checkPositionWithEventLoop = function () { 30 setTimeout($.proxy(this.checkPosition, this), 1) 31 } 32 Affix.prototype.checkPosition = function () { 33 if (!this.$element.is(':visible')) return 34 var scrollHeight = $(document).height() 35 var scrollTop = this.$target.scrollTop() 36 var position = this.$element.offset() 37 var offset = this.options.offset 38 var offsetTop = offset.top 39 var offsetBottom = offset.bottom 40 if (typeof offset != 'object') offsetBottom = offsetTop = offset 41 if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) 42 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) 43 var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : 44 offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : 45 offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false 46 if (this.affixed === affix) return 47 if (this.unpin != null) this.$element.css('top', '') 48 var affixType = 'affix' + (affix ? '-' + affix : '') 49 var e = $.Event(affixType + '.bs.affix') 50 this.$element.trigger(e) 51 if (e.isDefaultPrevented()) return 52 this.affixed = affix 53 this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null 54 this.$element 55 .removeClass(Affix.RESET) 56 .addClass(affixType) 57 .trigger($.Event(affixType.replace('affix', 'affixed'))) 58 if (affix == 'bottom') { 59 this.$element.offset({ 60 top: scrollHeight - this.$element.height() - offsetBottom 61 }) 62 } 63 } 64 function Plugin(option) { 65 return this.each(function () { 66 var $this = $(this) 67 var data = $this.data('bs.affix') 68 var options = typeof option == 'object' && option 69 if (!data) $this.data('bs.affix', (data = new Affix(this, options))) 70 if (typeof option == 'string') data[option]() 71 }) 72 } 73 var old = $.fn.affix 74 $.fn.affix = Plugin 75 $.fn.affix.Constructor = Affix 76 $.fn.affix.noConflict = function () { 77 $.fn.affix = old 78 return this 79 } 80 $(window).on('load', function () { 81 $('[data-spy="affix"]').each(function () { 82 var $spy = $(this) 83 var data = $spy.data() 84 data.offset = data.offset || {} 85 if (data.offsetBottom) data.offset.bottom = data.offsetBottom 86 if (data.offsetTop) data.offset.top = data.offsetTop 87 Plugin.call($spy, data) 88 }) 89 }) 90}(jQuery); 91; 92/*! RESOURCE: /scripts/heisenberg/bootstrap/alert.js */ 93+function ($) { 94 'use strict'; 95 var dismiss = '[data-dismiss="alert"]' 96 var Alert = function (el) { 97 $(el).on('click', dismiss, this.close) 98 } 99 Alert.VERSION = '3.2.0' 100 Alert.prototype.close = function (e) { 101 var $this = $(this) 102 var selector = $this.attr('data-target') 103 if (!selector) { 104 selector = $this.attr('href') 105selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') 106 } 107 selector = selector === '#' ? [] : selector 108 var $parent = $(document).find(selector) 109 if (e) e.preventDefault() 110 if (!$parent.length) { 111 $parent = $this.hasClass('alert') ? $this : $this.parent() 112 } 113 $parent.trigger(e = $.Event('close.bs.alert')) 114 if (e.isDefaultPrevented()) return 115 $parent.removeClass('in') 116 function removeElement() { 117 $parent.detach().trigger('closed.bs.alert').remove() 118 } 119 $.support.transition && $parent.hasClass('fade') ? 120 $parent 121 .one('bsTransitionEnd', removeElement) 122 .emulateTransitionEnd(150) : 123 removeElement() 124 } 125 function Plugin(option) { 126 return this.each(function () { 127 var $this = $(this) 128 var data = $this.data('bs.alert')
vendor: 6,193 bytes, lines 129-304
129 if (!data) $this.data('bs.alert', (data = new Alert(this))) 130 if (typeof option == 'string') data[option].call($this) 131 }) 132 } 133 var old = $.fn.alert 134 $.fn.alert = Plugin 135 $.fn.alert.Constructor = Alert 136 $.fn.alert.noConflict = function () { 137 $.fn.alert = old 138 return this 139 } 140 $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) 141}(jQuery); 142; 143/*! RESOURCE: /scripts/heisenberg/bootstrap/button.js */ 144+function ($) { 145 'use strict'; 146 var Button = function (element, options) { 147 this.$element = $(element) 148 this.options = $.extend({}, Button.DEFAULTS, options) 149 this.isLoading = false 150 } 151 Button.VERSION = '3.2.0' 152 Button.DEFAULTS = { 153 loadingText: 'loading...' 154 } 155 Button.prototype.setState = function (state) { 156 var d = 'disabled' 157 var $el = this.$element 158 var val = $el.is('input') ? 'val' : 'html' 159 var data = $el.data() 160 state = state + 'Text' 161 if (data.resetText == null) $el.data('resetText', $el[val]()) 162 $el[val](data[state] == null ? this.options[state] : data[state]) 163 setTimeout($.proxy(function () { 164 if (state == 'loadingText') { 165 this.isLoading = true 166 $el.addClass(d).attr(d, d) 167 } else if (this.isLoading) { 168 this.isLoading = false 169 $el.removeClass(d).removeAttr(d) 170 } 171 }, this), 0) 172 } 173 Button.prototype.toggle = function () { 174 var changed = true 175 var $parent = this.$element.closest('[data-toggle="buttons"]') 176 if ($parent.length) { 177 var $input = this.$element.find('input') 178 if ($input.prop('type') == 'radio') { 179 if ($input.prop('checked') && this.$element.hasClass('active')) changed = false 180 else $parent.find('.active').removeClass('active') 181 } 182 if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') 183 } 184 if (changed) this.$element.toggleClass('active') 185 } 186 function Plugin(option) { 187 return this.each(function () { 188 var $this = $(this) 189 var data = $this.data('bs.button') 190 var options = typeof option == 'object' && option 191 if (!data) $this.data('bs.button', (data = new Button(this, options))) 192 if (option == 'toggle') data.toggle() 193 else if (option) data.setState(option) 194 }) 195 } 196 var old = $.fn.button 197 $.fn.button = Plugin 198 $.fn.button.Constructor = Button 199 $.fn.button.noConflict = function () { 200 $.fn.button = old 201 return this 202 } 203 $(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { 204 var $btn = $(e.target) 205 if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') 206 Plugin.call($btn, 'toggle') 207 e.preventDefault() 208 }) 209}(jQuery); 210; 211/*! RESOURCE: /scripts/heisenberg/bootstrap/carousel.js */ 212+function ($) { 213 'use strict'; 214 var Carousel = function (element, options) { 215 this.$element = $(element).on('keydown.bs.carousel', $.proxy(this.keydown, this)) 216 this.$indicators = this.$element.find('.carousel-indicators') 217 this.options = options 218 this.paused = 219 this.sliding = 220 this.interval = 221 this.$active = 222 this.$items = null 223 this.options.pause == 'hover' && this.$element 224 .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) 225 .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) 226 } 227 Carousel.VERSION = '3.2.0' 228 Carousel.DEFAULTS = { 229 interval: 5000, 230 pause: 'hover', 231 wrap: true 232 } 233 Carousel.prototype.keydown = function (e) { 234 switch (e.which) { 235 case 37: this.prev(); break 236 case 39: this.next(); break 237 default: return 238 } 239 e.preventDefault() 240 } 241 Carousel.prototype.cycle = function (e) { 242 e || (this.paused = false) 243 this.interval && clearInterval(this.interval) 244 this.options.interval 245 && !this.paused 246 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) 247 return this 248 } 249 Carousel.prototype.getItemIndex = function (item) { 250 this.$items = item.parent().children('.item') 251 return this.$items.index(item || this.$active) 252 } 253 Carousel.prototype.to = function (pos) { 254 var that = this 255 var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) 256 if (pos > (this.$items.length - 1) || pos < 0) return 257if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) 258 if (activeIndex == pos) return this.pause().cycle() 259 return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) 260 } 261 Carousel.prototype.pause = function (e) { 262 e || (this.paused = true) 263 if (this.$element.find('.next, .prev').length && $.support.transition) { 264 this.$element.trigger($.support.transition.end) 265 this.cycle(true) 266 } 267 this.interval = clearInterval(this.interval) 268 return this 269 } 270 Carousel.prototype.next = function () { 271 if (this.sliding) return 272 return this.slide('next') 273 } 274 Carousel.prototype.prev = function () { 275 if (this.sliding) return 276 return this.slide('prev') 277 } 278 Carousel.prototype.slide = function (type, next) { 279 var $active = this.$element.find('.item.active') 280 var $next = next || $active[type]() 281 var isCycling = this.interval 282 var direction = type == 'next' ? 'left' : 'right' 283 var fallback = type == 'next' ? 'first' : 'last' 284 var that = this 285 if (!$next.length) { 286 if (!this.options.wrap) return 287 $next = this.$element.find('.item')[fallback]() 288 } 289 if ($next.hasClass('active')) return (this.sliding = false) 290 var relatedTarget = $next[0] 291 var slideEvent = $.Event('slide.bs.carousel', { 292 relatedTarget: relatedTarget, 293 direction: direction 294 }) 295 this.$element.trigger(slideEvent) 296 if (slideEvent.isDefaultPrevented()) return 297 this.sliding = true 298 isCycling && this.pause() 299 if (this.$indicators.length) { 300 this.$indicators.find('.active').removeClass('active') 301 var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) 302 $nextIndicator && $nextIndicator.addClass('active') 303 } 304var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction })
305 if ($.support.transition && this.$element.hasClass('slide')) { 306 $next.addClass(type) 307$next[0].offsetWidth 308 $active.addClass(direction) 309 $next.addClass(direction) 310 $active 311 .one('bsTransitionEnd', function () { 312 $next.removeClass([type, direction].join(' ')).addClass('active') 313 $active.removeClass(['active', direction].join(' ')) 314 that.sliding = false 315 setTimeout(function () { 316 that.$element.trigger(slidEvent) 317 }, 0) 318 }) 319 .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) 320 } else { 321 $active.removeClass('active') 322 $next.addClass('active') 323 this.sliding = false 324 this.$element.trigger(slidEvent) 325 } 326 isCycling && this.cycle() 327 return this 328 } 329 function Plugin(option) { 330 return this.each(function () { 331 var $this = $(this) 332 var data = $this.data('bs.carousel') 333 var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) 334 var action = typeof option == 'string' ? option : options.slide 335 if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) 336 if (typeof option == 'number') data.to(option) 337 else if (action) data[action]() 338 else if (options.interval) data.pause().cycle() 339 }) 340 } 341 var old = $.fn.carousel 342 $.fn.carousel = Plugin 343 $.fn.carousel.Constructor = Carousel 344 $.fn.carousel.noConflict = function () { 345 $.fn.carousel = old 346 return this 347 } 348 $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { 349 var $this = $(this) 350 var href = $this.attr('href') 351 if (href) { 352href = href.replace(/.*(?=#[^\s]+$)/, '') 353 } 354 var target = $this.attr('data-target') || href 355 target = target === '#' ? [] : target 356 var $target = $(document).find(target) 357 if (!$target.hasClass('carousel')) return 358 var options = $.extend({}, $target.data(), $this.data()) 359 var slideIndex = $this.attr('data-slide-to') 360 if (slideIndex) options.interval = false 361 Plugin.call($target, options) 362 if (slideIndex) { 363 $target.data('bs.carousel').to(slideIndex) 364 } 365 e.preventDefault() 366 }) 367 $(window).on('load', function () { 368 $('[data-ride="carousel"]').each(function () { 369 var $carousel = $(this) 370 Plugin.call($carousel, $carousel.data()) 371 }) 372 }) 373}(jQuery); 374; 375/*! RESOURCE: /scripts/heisenberg/bootstrap/collapse.js */ 376+function ($) { 377 'use strict'; 378 var Collapse = function (element, options) { 379 this.$element = $(element) 380 this.options = $.extend({}, Collapse.DEFAULTS, options) 381 this.transitioning = null 382 if (this.options.parent) this.$parent = $(document).find(this.options.parent === '#' ? [] : this.options.parent) 383 if (this.options.toggle) this.toggle() 384 } 385 Collapse.VERSION = '3.2.0' 386 Collapse.DEFAULTS = { 387 toggle: true 388 } 389 Collapse.prototype.dimension = function () { 390 var hasWidth = this.$element.hasClass('width') 391 return hasWidth ? 'width' : 'height' 392 } 393 Collapse.prototype.show = function () { 394 if (this.transitioning || this.$element.hasClass('in')) return 395 var startEvent = $.Event('show.bs.collapse') 396 this.$element.trigger(startEvent) 397 if (startEvent.isDefaultPrevented()) return 398 var actives = this.$parent && this.$parent.find('> .panel > .in') 399 if (actives && actives.length) { 400 var hasData = actives.data('bs.collapse') 401 if (hasData && hasData.transitioning) return 402 Plugin.call(actives, 'hide') 403 hasData || actives.data('bs.collapse', null) 404 } 405 var dimension = this.dimension() 406 this.$element 407 .removeClass('collapse') 408 .addClass('collapsing')[dimension](0) 409 this.transitioning = 1 410 var complete = function () { 411 this.$element 412 .removeClass('collapsing') 413 .addClass('collapse in')[dimension]('') 414 this.transitioning = 0 415 this.$element 416 .trigger('shown.bs.collapse') 417 } 418 if (!$.support.transition) return complete.call(this) 419 var scrollSize = $.camelCase(['scroll', dimension].join('-')) 420 this.$element 421 .one('bsTransitionEnd', $.proxy(complete, this)) 422 .emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize]) 423 } 424 Collapse.prototype.hide = function () { 425 if (this.transitioning || !this.$element.hasClass('in')) return 426 var startEvent = $.Event('hide.bs.collapse') 427 this.$element.trigger(startEvent) 428 if (startEvent.isDefaultPrevented()) return 429 var dimension = this.dimension() 430 this.$element[dimension](this.$element[dimension]())[0].offsetHeight 431 this.$element 432 .addClass('collapsing') 433 .removeClass('collapse') 434 .removeClass('in') 435 this.transitioning = 1 436 var complete = function () { 437 this.transitioning = 0 438 this.$element 439 .trigger('hidden.bs.collapse') 440 .removeClass('collapsing') 441 .addClass('collapse') 442 } 443 if (!$.support.transition) return complete.call(this) 444 this.$element 445 [dimension](0) 446 .one('bsTransitionEnd', $.proxy(complete, this)) 447 .emulateTransitionEnd(350) 448 } 449 Collapse.prototype.toggle = function () { 450 this[this.$element.hasClass('in') ? 'hide' : 'show']() 451 } 452 function Plugin(option) { 453 return this.each(function () { 454 var $this = $(this) 455 var data = $this.data('bs.collapse') 456 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) 457 if (!data && options.toggle && option == 'show') option = !option 458 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) 459 if (typeof option == 'string') data[option]() 460 }) 461 } 462 var old = $.fn.collapse 463 $.fn.collapse = Plugin 464 $.fn.collapse.Constructor = Collapse 465 $.fn.collapse.noConflict = function () { 466 $.fn.collapse = old 467 return this 468 } 469 $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { 470 var href 471 var $this = $(this) 472 var target = $this.attr('data-target') 473 || e.preventDefault() 474|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') 475 target = target === '#' ? [] : target 476 var $target = $(document).find(target) 477 var data = $target.data('bs.collapse') 478 var option = data ? 'toggle' : $this.data() 479 var parent = $this.attr('data-parent') 480 var $parent = parent && $(parent) 481 if (!data || !data.transitioning) { 482 if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed') 483 $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') 484 } 485 Plugin.call($target, option) 486 }) 487}(jQuery); 488; 489/*! RESOURCE: /scripts/heisenberg/bootstrap/dropdown.js */ 490+function ($) { 491 'use strict'; 492 var backdrop = '.dropdown-backdrop' 493 var toggle = '[data-toggle="dropdown"]' 494 var Dropdown = function (element) { 495 $(element).on('click.bs.dropdown', this.toggle) 496 } 497 Dropdown.VERSION = '3.2.0' 498 Dropdown.prototype.toggle = function (e) { 499 var $this = $(this) 500 if ($this.is('.disabled, :disabled')) return 501 var $parent = getParent($this) 502 var isActive = $parent.hasClass('open') 503 clearMenus() 504 if (!isActive) { 505 if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { 506$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus) 507 } 508 var relatedTarget = { relatedTarget: this } 509 $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) 510 if (e.isDefaultPrevented()) return 511 $this 512 .trigger('focus') 513 .attr('aria-expanded', 'true') 514 $parent 515 .toggleClass('open') 516 .trigger('shown.bs.dropdown', relatedTarget) 517 } 518 return false 519 } 520 Dropdown.prototype.keydown = function (e) { 521if (!/(38|40|27|32|9)/.test(e.keyCode) || /input|textarea/i.test(e.target.tagName)) return 522 if (e.keyCode == 9) { 523 clearMenus() 524 return 525 } 526 var $this = $(this) 527 e.preventDefault() 528 e.stopPropagation() 529 if ($this.is('.disabled, :disabled')) return 530 var $parent = getParent($this) 531 var isActive = $parent.hasClass('open') 532 if ((!isActive && e.keyCode != 27) || (isActive && e.keyCode == 27)) { 533 if (e.which == 27) $parent.find(toggle).trigger('focus') 534 return $this.trigger('click'); 535 } 536 var desc = ' li:not(.divider):visible a' 537 var $items = $parent.find('.dropdown-menu' + desc) 538 if (!$items.length) return 539 var index = $items.index($items.filter(':focus')) 540if (e.keyCode == 38) { 541 if(index > 0) index-- 542 else if(index == 0) index = $items.length - 1 543 } 544if (e.keyCode == 40) { 545 if(index < $items.length - 1) index++ 546 else if(index == $items.length - 1) index = 0 547 } 548 if (!~index) index = 0 549 $items.eq(index).trigger('focus') 550 } 551 function clearMenus(e) { 552 if (e && e.which === 3) return 553 $(backdrop).remove() 554 $(toggle).each(function () { 555 var $this = $(this) 556 var $parent = getParent($this) 557 var relatedTarget = { relatedTarget: this } 558 if (!$parent.hasClass('open')) return 559 $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) 560 if (e.isDefaultPrevented()) return 561 $this.attr('aria-expanded', 'false') 562 $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget) 563 }) 564 } 565 function getParent($this) { 566 var selector = $this.attr('data-target') 567 if (!selector) { 568 selector = $this.attr('href') 569selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') 570 } 571 selector = selector === '#' ? [] : selector 572 var $parent = selector && $(document).find(selector) 573 return $parent && $parent.length ? $parent : $this.parent() 574 } 575 function Plugin(option) { 576 return this.each(function () { 577 var $this = $(this) 578 var data = $this.data('bs.dropdown') 579 if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) 580 if (typeof option == 'string') data[option].call($this) 581 }) 582 } 583 var old = $.fn.dropdown 584 $.fn.dropdown = Plugin 585 $.fn.dropdown.Constructor = Dropdown 586 $.fn.dropdown.noConflict = function () { 587 $.fn.dropdown = old 588 return this 589 } 590 $(document) 591 .on('click.bs.dropdown.data-api', clearMenus) 592 .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) 593 .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) 594 .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) 595 .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) 596}(jQuery); 597; 598/*! RESOURCE: /scripts/heisenberg/bootstrap/tooltip.js */ 599+function ($) { 600 'use strict'; 601 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'] 602 var uriAttrs = [ 603 'background', 604 'cite', 605 'href', 606 'itemtype', 607 'longdesc', 608 'poster', 609 'src', 610 'xlink:href' 611 ] 612var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i 613 var DefaultWhitelist = { 614 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 615 a: ['target', 'href', 'title', 'rel'], 616 area: [], 617 b: [], 618 br: [], 619 col: [], 620 code: [], 621 div: [], 622 em: [], 623 hr: [], 624 h1: [], 625 h2: [],
626 h3: [], 627 h4: [], 628 h5: [], 629 h6: [], 630 i: [], 631 img: ['src', 'alt', 'title', 'width', 'height'], 632 li: [], 633 ol: [], 634 p: [], 635 pre: [], 636 s: [], 637 small: [], 638 span: [], 639 sub: [], 640 sup: [], 641 strong: [], 642 u: [], 643 ul: [] 644 } 645var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi 646var 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 647 function allowedAttribute(attr, allowedAttributeList) { 648 var attrName = attr.nodeName.toLowerCase() 649 if ($.inArray(attrName, allowedAttributeList) !== -1) { 650 if ($.inArray(attrName, uriAttrs) !== -1) { 651 return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)) 652 } 653 return true 654 } 655 var regExp = $(allowedAttributeList).filter(function (index, value) { 656 return value instanceof RegExp 657 }) 658 for (var i = 0, l = regExp.length; i < l; i++) { 659 if (attrName.match(regExp[i])) { 660 return true 661 } 662 } 663 return false 664 } 665 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 666 if (unsafeHtml.length === 0) { 667 return unsafeHtml 668 } 669 if (sanitizeFn && typeof sanitizeFn === 'function') { 670 return sanitizeFn(unsafeHtml) 671 } 672 if (!document.implementation || !document.implementation.createHTMLDocument) { 673 return unsafeHtml 674 } 675 var createdDocument = document.implementation.createHTMLDocument('sanitization') 676 createdDocument.body.innerHTML = unsafeHtml 677 var whitelistKeys = $.map(whiteList, function (el, i) { return i }) 678 var elements = $(createdDocument.body).find('*') 679 for (var i = 0, len = elements.length; i < len; i++) { 680 var el = elements[i] 681 var elName = el.nodeName.toLowerCase() 682 if ($.inArray(elName, whitelistKeys) === -1) { 683 el.parentNode.removeChild(el) 684 continue 685 } 686 var attributeList = $.map(el.attributes, function (el) { return el }) 687 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []) 688 for (var j = 0, len2 = attributeList.length; j < len2; j++) { 689 if (!allowedAttribute(attributeList[j], whitelistedAttributes)) { 690 el.removeAttribute(attributeList[j].nodeName) 691 } 692 } 693 } 694 return createdDocument.body.innerHTML 695 } 696 var Tooltip = function (element, options) { 697 this.type = 698 this.options = 699 this.enabled = 700 this.timeout = 701 this.hoverState = 702 this.orphanCheck= 703 this.$element = null 704 this.init('tooltip', element, options) 705 } 706 Tooltip.VERSION = '3.2.0' 707 Tooltip.DEFAULTS = { 708 animation: true, 709 placement: 'top', 710 selector: false, 711template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', 712 trigger: 'hover focus', 713 title: '', 714 delay: 0, 715 html: false, 716 container: false, 717 viewport: { 718 selector: 'body', 719 padding: 0 720 }, 721 sanitize : false, 722 sanitizeFn : null, 723 whiteList : DefaultWhitelist 724 } 725 Tooltip.prototype.init = function (type, element, options) { 726 this.enabled = true 727 this.type = type 728 this.$element = $(element) 729 this.options = this.getOptions(options) 730 var viewport = this.options.viewport && (this.options.viewport.selector || this.options.viewport) 731 viewport = viewport === '#' ? [] : viewport; 732 this.$viewport = this.options.viewport && $(document).find(viewport) 733 var triggers = this.options.trigger.split(' ') 734 for (var i = triggers.length; i--;) { 735 var trigger = triggers[i] 736 if (trigger == 'click') { 737 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) 738 } else if (trigger != 'manual') { 739 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' 740 var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' 741 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) 742 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) 743 } 744 } 745 this.options.selector ? 746 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : 747 this.fixTitle() 748 } 749 Tooltip.prototype.getDefaults = function () { 750 return Tooltip.DEFAULTS 751 } 752 Tooltip.prototype.getOptions = function (options) { 753 options = $.extend({}, this.getDefaults(), this.$element.data(), options) 754 var dataAttributes = this.$element.data() 755 for (var dataAttr in dataAttributes) { 756 if (dataAttributes.hasOwnProperty(dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) { 757 delete dataAttributes[dataAttr] 758 } 759 } 760 options = $.extend({}, this.getDefaults(), dataAttributes, options) 761 if (options.delay && typeof options.delay == 'number') { 762 options.delay = { 763 show: options.delay, 764 hide: options.delay 765 } 766 } 767 if (options.sanitize) { 768 options.template = sanitizeHtml(options.template, options.whiteList, options.sanitizeFn) 769 } 770 return options 771 } 772 Tooltip.prototype.getDelegateOptions = function () { 773 var options = {} 774 var defaults = this.getDefaults() 775 this._options && $.each(this._options, function (key, value) { 776 if (defaults[key] != value) options[key] = value 777 }) 778 return options 779 } 780 Tooltip.prototype.clearOrphanCheckInterval = function(self) { 781 if (typeof self.orphanCheck !== 'number') 782 return; 783 clearInterval(self.orphanCheck); 784 self.orphanCheck = undefined; 785 } 786 Tooltip.prototype.addOrphanCheck = function(self) { 787 this.clearOrphanCheckInterval(self); 788 self.orphanCheck = setInterval(function () { 789 if (self.$element && !self.$element.is(':visible')) { 790 this.clearOrphanCheckInterval(self); 791 self.hide(); 792 } 793 }.bind(this), 1000); 794 } 795 Tooltip.prototype.enter = function (obj) { 796 var self = obj instanceof this.constructor ? 797 obj : $(obj.currentTarget).data('bs.' + this.type) 798 if (!self) { 799 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 800 $(obj.currentTarget).data('bs.' + this.type, self) 801 } 802 clearTimeout(self.timeout) 803 this.clearOrphanCheckInterval(self); 804 self.hoverState = 'in' 805 if (!self.options.delay || !self.options.delay.show) return self.show() 806 self.timeout = setTimeout(function () { 807 if (self.hoverState == 'in') self.show() 808 }, self.options.delay.show) 809 this.addOrphanCheck(self); 810 } 811 Tooltip.prototype.leave = function (obj) { 812 var self = obj instanceof this.constructor ? 813 obj : $(obj.currentTarget).data('bs.' + this.type) 814 if (!self) { 815 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 816 $(obj.currentTarget).data('bs.' + this.type, self) 817 } 818 clearTimeout(self.timeout) 819 this.clearOrphanCheckInterval(self); 820 self.hoverState = 'out' 821 if (!self.options.delay || !self.options.delay.hide) return self.hide() 822 function setSelfTimeout() { 823 self.timeout = setTimeout(function () { 824 if (self.hoverState == 'out') self.hide() 825 }, self.options.delay.hide); 826 } 827 if (this.$element.hasClass('icon-help')) { 828 var $tip = this.tip(); 829 $tip.one('mouseenter', function() { 830 clearTimeout(self.timeout); 831 $tip.one('mouseleave', function() { 832 setSelfTimeout(); 833 }) 834 }); 835 } 836 setSelfTimeout(); 837 } 838 Tooltip.prototype.show = function () { 839 var e = $.Event('show.bs.' + this.type) 840 if (this.hasContent() && this.enabled) { 841 this.$element.trigger(e) 842 var inDom = $.contains(document.documentElement, this.$element[0]) 843 if (e.isDefaultPrevented() || !inDom) return 844 var that = this 845 var $tip = this.tip() 846 var tipId = this.getUID(this.type) 847 this.setContent()
848 $tip.attr('id', tipId) 849 if (this.options.omitAriaDescribedby !== true) 850 this.$element.attr('aria-describedby', tipId) 851 if (this.options.animation) $tip.addClass('fade') 852 var placement = typeof this.options.placement == 'function' ? 853 this.options.placement.call(this, $tip[0], this.$element[0]) : 854 this.options.placement 855var autoToken = /\s?auto?\s?/i 856 var autoPlace = autoToken.test(placement) 857 if (autoPlace) placement = placement.replace(autoToken, '') || 'top' 858 $tip 859 .detach() 860 .css({ width: '', top: 0, left: 0, display: 'block' }) 861 .addClass(placement) 862 .data('bs.' + this.type, this) 863 this.options.container ? $tip.appendTo($(document).find(this.options.container === '#' ? [] : this.options.container)) : $tip.insertAfter(this.$element) 864 var pos = this.getPosition() 865 var actualWidth = $tip[0].offsetWidth 866 var actualHeight = $tip[0].offsetHeight 867 if (autoPlace) { 868 var orgPlacement = placement 869 var $container = this.options.container ? $($(document).find(this.options.container === '#' ? [] : this.options.container)) : this.$element.parent() 870 var containerDim = this.getPosition($container) 871 placement = placement == 'bottom' && pos.top + pos.height + actualHeight - containerDim.scroll > containerDim.height ? 'top' : 872 placement == 'top' && pos.top - containerDim.scroll - actualHeight < containerDim.top ? 'bottom' : 873 placement == 'right' && pos.right + actualWidth > containerDim.width ? 'left' : 874 placement == 'left' && pos.left - actualWidth < containerDim.left ? 'right' : 875 placement 876 $tip 877 .removeClass(orgPlacement) 878 .addClass(placement) 879 } 880 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) 881 this.applyPlacement(calculatedOffset, placement) 882 var complete = function () { 883 var prevHoverState = that.hoverState 884 that.$element.trigger('shown.bs.' + that.type) 885 that.hoverState = null 886 if (prevHoverState == 'out') that.leave(that) 887 } 888 $.support.transition && this.$tip.hasClass('fade') ? 889 $tip 890 .one('bsTransitionEnd', complete) 891 .emulateTransitionEnd(150) : 892 complete() 893 this.addOrphanCheck(this); 894 } 895 } 896 Tooltip.prototype.applyPlacement = function (offset, placement) { 897 var $tip = this.tip() 898 var width = $tip[0].offsetWidth 899 var height = $tip[0].offsetHeight 900 var marginTop = parseInt($tip.css('margin-top'), 10) 901 var marginLeft = parseInt($tip.css('margin-left'), 10) 902 if (isNaN(marginTop)) marginTop = 0 903 if (isNaN(marginLeft)) marginLeft = 0 904 offset.top = offset.top + marginTop 905 offset.left = offset.left + marginLeft 906 var viewportDimensions = this.getPosition(this.$viewport); 907 var innerTip = $tip.find('.tooltip-inner'); 908 var innerTipPadding = innerTip ? parseInt(innerTip.css('padding'), 10) : 1; 909 $.offset.setOffset($tip[0], $.extend({ 910 using: function (props) { 911 $tip.css({ 912 top: Math.round(props.top), 913 left: Math.round(props.left), 914width: width+innerTipPadding 915 }) 916 } 917 }, offset), 0) 918 $tip.addClass('in') 919 var actualWidth = $tip[0].offsetWidth 920 var actualHeight = $tip[0].offsetHeight 921 if (placement == 'top' && actualHeight != height) { 922 offset.top = offset.top + height - actualHeight 923 } 924 var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight, viewportDimensions) 925var isVertical = /top|bottom/.test(placement) 926 if(isVertical && this.options && this.options.container) { 927 var $container = this.$element.closest(this.options.container) 928 const isContainerSameAsViewport = this.$viewport && this.$viewport[0] === $container[0] 929 if($container.length && !isContainerSameAsViewport) { 930 var containerDim = this.getPosition($container) 931var tooltipExtraLengthAfterThisEle = (actualWidth - this.getPosition().width)/2 932 var deltaRWithRespectToContainer = (this.getPosition().right + tooltipExtraLengthAfterThisEle) - (containerDim.left + containerDim.width) 933 var deltaLWithRespectToContainer = (containerDim.left) - (this.getPosition().left - tooltipExtraLengthAfterThisEle) 934 if(deltaRWithRespectToContainer > 0) { 935 if(delta.left <= 0) { 936 if(Math.abs(delta.left) < deltaRWithRespectToContainer) { 937 delta.left = -deltaRWithRespectToContainer 938 } 939} 940 } 941 if(deltaLWithRespectToContainer > 0) { 942 if(delta.left >= 0) { 943 if(Math.abs(delta.left) < deltaLWithRespectToContainer) { 944 delta.left = deltaLWithRespectToContainer 945 } 946} 947 } 948 } 949 } 950 if (delta.left) offset.left += delta.left 951 else offset.top += delta.top 952 var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight 953 var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' 954 $tip.offset(offset) 955 this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical, viewportDimensions) 956 } 957 Tooltip.prototype.replaceArrow = function (delta, dimension, isHorizontal, viewportDimensions) { 958 var $arrow = this.arrow(); 959 if ($arrow.length === 0) 960 return; 961 $arrow 962.css(isHorizontal ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') 963 .css(isHorizontal ? 'right' : 'bottom', 'auto') 964 .css(isHorizontal ? 'top' : 'left', ''); 965 if (!viewportDimensions) return ; 966 var arrPostion = $arrow.position(); 967 var arrowLeft = arrPostion.left; 968 var arrowTop = arrPostion.right; 969 var tipWidth = this.$tip[0].offsetWidth; 970 var arrowWidth = $arrow[0].offsetWidth;; 971 var arrowMarginLeft = parseInt($arrow.css("margin-left"), 10); 972 var tipBorderRadius = parseInt(this.$tip.css("border-radius"), 10); 973 var arrowRight = arrowLeft + arrowWidth + arrowMarginLeft; 974 var scrollBarWidth = viewportDimensions.scrollbarWidth; 975 if (isHorizontal && tipWidth > arrowWidth) { 976if (arrowLeft < arrowWidth/2 + tipBorderRadius) 977arrowLeft = arrowWidth/2 + tipBorderRadius; 978else if (arrowRight > tipWidth) 979arrowLeft = tipWidth - arrowWidth/2 - tipBorderRadius; 980arrowLeft = arrowLeft - (arrowMarginLeft + arrowWidth / 2); 981 $arrow 982 .css('right', 'auto') 983 .css('left', arrowLeft) 984 .css('top', arrowTop); 985 } else if(isHorizontal && tipWidth < arrowWidth) { 986 $arrow 987 .css('margin-bottom', tipBorderRadius); 988 } 989 } 990 Tooltip.prototype.setContent = function () { 991 var $tip = this.tip() 992 var title = this.getTitle() 993 if (this.options.html) { 994 if (this.options.sanitize) { 995 title = sanitizeHtml(title, this.options.whiteList, this.options.sanitizeFn) 996 } 997 $tip.find('.tooltip-inner').html(title) 998 } else { 999 $tip.find('.tooltip-inner').text(title) 1000 } 1001 $tip.removeClass('fade in top bottom left right') 1002 } 1003 Tooltip.prototype.hide = function (callback) { 1004 var that = this 1005 var $tip = this.tip() 1006 var e = $.Event('hide.bs.' + this.type) 1007 function complete() { 1008 if (that.hoverState != 'in') $tip.detach() 1009 that.$element 1010 .removeAttr('aria-describedby') 1011 .trigger('hidden.bs.' + that.type) 1012 callback && callback() 1013 } 1014 this.$element.trigger(e) 1015 if (e.isDefaultPrevented()) return 1016 $tip.removeClass('in') 1017 $.support.transition && this.$tip.hasClass('fade') ? 1018 $tip 1019 .one('bsTransitionEnd', complete) 1020 .emulateTransitionEnd(150) : 1021 complete() 1022 this.hoverState = null 1023 return this 1024 } 1025 Tooltip.prototype.fixTitle = function () { 1026 var $e = this.$element 1027 if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') { 1028 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') 1029 } 1030 } 1031 Tooltip.prototype.hasContent = function () { 1032 return this.getTitle() 1033 } 1034 Tooltip.prototype.getPosition = function ($element) { 1035 $element = $element || this.$element 1036 var el = $element[0] 1037 var isBody = el.tagName == 'BODY' 1038 var viewPortScrollOffset = document.viewport ? document.viewport.getScrollOffsets() : {left:0, right: 0}; 1039 return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : null, { 1040 scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(), 1041 width: isBody ? document.documentElement.scrollWidth : $element.outerWidth(), 1042 height: isBody ? $(window).height() : $element.outerHeight() 1043 }, isBody ? { top: 0, left: 0 } : $element.offset(), {viewPortScrollOffset:viewPortScrollOffset}, { scrollbarWidth: window.innerWidth - document.documentElement.clientWidth}
1043) 1044 } 1045 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { 1046return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : 1047placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : 1048placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : 1049{ top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } 1050 } 1051 Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight, viewportDimensions) { 1052 var delta = { top: 0, left: 0 } 1053 if (!this.$viewport) return delta 1054 var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 1055 var scrollBarWidth = viewportDimensions.scrollbarWidth; 1056if (/right|left/.test(placement)) { 1057 var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll 1058 var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight 1059if (topEdgeOffset < viewportDimensions.top) { 1060 delta.top = viewportDimensions.top - topEdgeOffset 1061} else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { 1062 delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset 1063 } 1064 } else { 1065 var leftEdgeOffset = pos.left; 1066 var rightEdgeOffset = pos.left + actualWidth; 1067 var scrollLeft = viewportDimensions.x !== undefined && viewportDimensions.viewPortScrollOffset.left === 0 ? viewportDimensions.x : viewportDimensions.viewPortScrollOffset.left; 1068 var docWidth = document.documentElement.offsetWidth; 1069 var scrollbarWidthForRTL = document.dir === 'rtl' ? scrollBarWidth : 0; 1070 var viewportScrollWidth = 0; 1071 if(this.$viewport && this.$viewport[0]) { 1072 viewportScrollWidth = this.$viewport[0].offsetWidth - this.$viewport[0].clientWidth; 1073 } 1074if (leftEdgeOffset < scrollLeft) { 1075 delta.left = scrollbarWidthForRTL + scrollLeft - leftEdgeOffset; 1076 if(document.dir === 'rtl') { 1077 delta.left += viewportScrollWidth; 1078 } 1079} else if (rightEdgeOffset > docWidth + scrollLeft) { 1080 delta.left = docWidth + scrollLeft - rightEdgeOffset + scrollbarWidthForRTL 1081 if(document.dir === 'ltr') { 1082 delta.left -= viewportScrollWidth; 1083 } 1084 } 1085 } 1086 return delta 1087 } 1088 Tooltip.prototype.getTitle = function () { 1089 var title 1090 var $e = this.$element 1091 var o = this.options 1092 title = $e.attr('data-original-title') 1093 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) 1094 return title 1095 } 1096 Tooltip.prototype.getUID = function (prefix) { 1097 do prefix += ~~(Math.random() * 1000000) 1098 while (document.getElementById(prefix)) 1099 return prefix 1100 } 1101 Tooltip.prototype.tip = function () { 1102 return (this.$tip = this.$tip || $(this.options.template)) 1103 } 1104 Tooltip.prototype.arrow = function () { 1105 return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) 1106 } 1107 Tooltip.prototype.validate = function () { 1108 if (!this.$element[0].parentNode) { 1109 this.hide() 1110 this.$element = null 1111 this.options = null 1112 } 1113 } 1114 Tooltip.prototype.enable = function () { 1115 this.enabled = true 1116 } 1117 Tooltip.prototype.disable = function () { 1118 this.enabled = false 1119 } 1120 Tooltip.prototype.toggleEnabled = function () { 1121 this.enabled = !this.enabled 1122 } 1123 Tooltip.prototype.toggle = function (e) { 1124 var self = this 1125 if (e) { 1126 self = $(e.currentTarget).data('bs.' + this.type) 1127 if (!self) { 1128 self = new this.constructor(e.currentTarget, this.getDelegateOptions()) 1129 $(e.currentTarget).data('bs.' + this.type, self) 1130 } 1131 } 1132 self.tip().hasClass('in') ? self.leave(self) : self.enter(self) 1133 } 1134 Tooltip.prototype.destroy = function () { 1135 var that = this 1136 clearTimeout(this.timeout) 1137 this.hide(function () { 1138 that.$element.off('.' + that.type).removeData('bs.' + that.type) 1139 }) 1140 } 1141 Tooltip.prototype.sanitizeHtml = function (unsafeHtml) { 1142 return sanitizeHtml(unsafeHtml, this.options.whiteList, this.options.sanitizeFn) 1143 } 1144 function Plugin(option) { 1145 return this.each(function () { 1146 var $this = $(this) 1147 var data = $this.data('bs.tooltip') 1148 var options = typeof option == 'object' && option 1149 if (!data && option == 'destroy') return 1150 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) 1151 if (typeof option == 'string') data[option]() 1152 }) 1153 } 1154 var old = $.fn.tooltip 1155 $.fn.tooltip = Plugin 1156 $.fn.tooltip.Constructor = Tooltip 1157 $.fn.bsTooltip = Plugin; 1158 $.fn.bsTooltip.Constructor = Tooltip; 1159 $.fn.tooltip.noConflict = function () { 1160 $.fn.tooltip = old 1161 return this 1162 } 1163}(jQuery); 1164; 1165/*! RESOURCE: /scripts/heisenberg/bootstrap/modal.js */ 1166+function ($) { 1167 'use strict'; 1168 var Modal = function (element, options) { 1169 this.options = options 1170 this.$body = $(document.body) 1171 this.$element = $(element) 1172 this.$backdrop = 1173 this.isShown = null 1174 this.scrollbarWidth = 0 1175 if (this.options.remote) { 1176 this.$element
vendor: 10,782 bytes, lines 1177-1479
1177 .find('.modal-content') 1178 .load(this.options.remote, $.proxy(function () { 1179 this.$element.trigger('loaded.bs.modal') 1180 }, this)) 1181 } 1182 } 1183 Modal.VERSION = '3.2.0' 1184 Modal.DEFAULTS = { 1185 backdrop: true, 1186 keyboard: true, 1187 show: true 1188 } 1189 Modal.prototype.toggle = function (_relatedTarget) { 1190 return this.isShown ? this.hide() : this.show(_relatedTarget) 1191 } 1192 Modal.prototype.show = function (_relatedTarget) { 1193 var that = this 1194 var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) 1195 this.$element.trigger(e) 1196 if (this.isShown || e.isDefaultPrevented()) return 1197 this.isShown = true 1198 this.checkScrollbar() 1199 this.$body.addClass('modal-open') 1200 this.setScrollbar() 1201 this.escape() 1202 this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) 1203 this.backdrop(function () { 1204 var transition = $.support.transition && that.$element.hasClass('fade') 1205 if (!that.$element.parent().length) { 1206that.$element.appendTo(that.$body) 1207 } 1208 that.$element 1209 .show() 1210 .scrollTop(0) 1211 if (transition) { 1212that.$element[0].offsetWidth 1213 } 1214 that.$element 1215 .addClass('in') 1216 .attr('aria-hidden', false) 1217 that.enforceFocus() 1218 var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) 1219 transition ? 1220that.$element.find('.modal-dialog') 1221 .one('bsTransitionEnd', function () { 1222 that.$element.trigger('focus').trigger(e) 1223 }) 1224 .emulateTransitionEnd(300) : 1225 that.$element.trigger('focus').trigger(e) 1226 }) 1227 } 1228 Modal.prototype.hide = function (e) { 1229 if (e) e.preventDefault() 1230 e = $.Event('hide.bs.modal') 1231 this.$element.trigger(e) 1232 if (!this.isShown || e.isDefaultPrevented()) return 1233 this.isShown = false 1234 this.$body.removeClass('modal-open') 1235 this.resetScrollbar() 1236 this.escape() 1237 $(document).off('focusin.bs.modal') 1238 this.$element 1239 .removeClass('in') 1240 .attr('aria-hidden', true) 1241 .off('click.dismiss.bs.modal') 1242 $.support.transition && this.$element.hasClass('fade') ? 1243 this.$element 1244 .one('bsTransitionEnd', $.proxy(this.hideModal, this)) 1245 .emulateTransitionEnd(300) : 1246 this.hideModal() 1247 } 1248 Modal.prototype.enforceFocus = function () { 1249 $(document) 1250.off('focusin.bs.modal') 1251 .on('focusin.bs.modal', $.proxy(function (e) { 1252 if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { 1253 this.$element.trigger('focus') 1254 } 1255 }, this)) 1256 } 1257 Modal.prototype.escape = function () { 1258 if (this.isShown && this.options.keyboard) { 1259 this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { 1260 e.which == 27 && this.hide() 1261 }, this)) 1262 } else if (!this.isShown) { 1263 this.$element.off('keydown.dismiss.bs.modal') 1264 } 1265 } 1266 Modal.prototype.hideModal = function () { 1267 var that = this 1268 this.$element.hide() 1269 this.backdrop(function () { 1270 that.$element.trigger('hidden.bs.modal') 1271 }) 1272 } 1273 Modal.prototype.removeBackdrop = function () { 1274 this.$backdrop && this.$backdrop.remove() 1275 this.$backdrop = null 1276 } 1277 Modal.prototype.backdrop = function (callback) { 1278 var that = this 1279 var animate = this.$element.hasClass('fade') ? 'fade' : '' 1280 if (this.isShown && this.options.backdrop) { 1281 var doAnimate = $.support.transition && animate 1282this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') 1283 .appendTo(this.$body) 1284 this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { 1285 if (e.target !== e.currentTarget) return 1286 this.options.backdrop == 'static' 1287 ? this.$element[0].focus.call(this.$element[0]) 1288 : this.hide.call(this) 1289 }, this)) 1290if (doAnimate) this.$backdrop[0].offsetWidth 1291 this.$backdrop.addClass('in') 1292 if (!callback) return 1293 doAnimate ? 1294 this.$backdrop 1295 .one('bsTransitionEnd', callback) 1296 .emulateTransitionEnd(150) : 1297 callback() 1298 } else if (!this.isShown && this.$backdrop) { 1299 this.$backdrop.removeClass('in') 1300 var callbackRemove = function () { 1301 that.removeBackdrop() 1302 callback && callback() 1303 } 1304 $.support.transition && this.$element.hasClass('fade') ? 1305 this.$backdrop 1306 .one('bsTransitionEnd', callbackRemove) 1307 .emulateTransitionEnd(150) : 1308 callbackRemove() 1309 } else if (callback) { 1310 callback() 1311 } 1312 } 1313 Modal.prototype.checkScrollbar = function () { 1314 if (document.body.clientWidth >= window.innerWidth) return 1315 this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar() 1316 } 1317 Modal.prototype.setScrollbar = function () { 1318 var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) 1319 if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) 1320 } 1321 Modal.prototype.resetScrollbar = function () { 1322 this.$body.css('padding-right', '') 1323 } 1324Modal.prototype.measureScrollbar = function () { 1325 var scrollDiv = document.createElement('div') 1326 scrollDiv.className = 'modal-scrollbar-measure' 1327 this.$body.append(scrollDiv) 1328 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth 1329 this.$body[0].removeChild(scrollDiv) 1330 return scrollbarWidth 1331 } 1332 function Plugin(option, _relatedTarget) { 1333 return this.each(function () { 1334 var $this = $(this) 1335 var data = $this.data('bs.modal') 1336 var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) 1337 if (!data) $this.data('bs.modal', (data = new Modal(this, options))) 1338 if (typeof option == 'string') data[option](_relatedTarget) 1339 else if (options.show) data.show(_relatedTarget) 1340 }) 1341 } 1342 var old = $.fn.modal 1343 $.fn.modal = Plugin 1344 $.fn.modal.Constructor = Modal 1345 $.fn.modal.noConflict = function () { 1346 $.fn.modal = old 1347 return this 1348 } 1349 $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { 1350 var $this = $(this) 1351 var href = $this.attr('href') 1352 var target = $this.attr('data-target') || 1353(href && href.replace(/.*(?=#[^\s]+$)/, '')) 1354 target = target === '#' ? [] : target 1355 var $target = $(document).find(target) 1356var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) 1357 if ($this.is('a')) e.preventDefault() 1358 $target.one('show.bs.modal', function (showEvent) { 1359if (showEvent.isDefaultPrevented()) return 1360 $target.one('hidden.bs.modal', function () { 1361 $this.is(':visible') && $this.trigger('focus') 1362 }) 1363 }) 1364 Plugin.call($target, option, this) 1365 }) 1366}(jQuery); 1367; 1368/*! RESOURCE: /scripts/heisenberg/bootstrap/popover.js */ 1369+function ($) { 1370 'use strict'; 1371 var Popover = function (element, options) { 1372 this.init('popover', element, options) 1373 } 1374 if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') 1375 Popover.VERSION = '3.2.0' 1376 Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { 1377 placement: 'right', 1378 trigger: 'click', 1379 content: '', 1380template: '<div class="popover" role="dialog" aria-labelledby="popover-title"><div class="arrow"></div><h3 class="popover-title" id="popover-title"></h3><div class="popover-content"></div></div>' 1381 }) 1382 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) 1383 Popover.prototype.constructor = Popover 1384 Popover.prototype.getDefaults = function () { 1385 return Popover.DEFAULTS 1386 } 1387 Popover.prototype.setContent = function () { 1388 var $tip = this.tip() 1389 var title = ((this.options.title) ? this.options.title : this.getTitle()); 1390 var content = this.getContent() 1391 if (this.options.html) { 1392 var typeContent = typeof content 1393 if (this.options.sanitize) { 1394 title = this.sanitizeHtml(title) 1395 if (typeContent === 'string') { 1396 content = this.sanitizeHtml(content) 1397 } 1398 } 1399 $tip.find('.popover-title').html(title) 1400 $tip.find('.popover-content').children().detach().end()[ 1401 typeContent === 'string' ? 'html' : 'append' 1402 ](content) 1403 } else { 1404 $tip.find('.popover-title').text(title) 1405 $tip.find('.popover-content').children().detach().end().text(content) 1406 } 1407 $tip.removeClass('fade top bottom left right in') 1408 if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() 1409 } 1410 Popover.prototype.hasContent = function () { 1411 return this.getTitle() || this.getContent() 1412 } 1413 Popover.prototype.getContent = function () { 1414 var $e = this.$element 1415 var o = this.options 1416 return $e.attr('data-content') 1417 || (typeof o.content == 'function' ? 1418 o.content.call($e[0]) : 1419 o.content) 1420 } 1421 Popover.prototype.arrow = function () { 1422 return (this.$arrow = this.$arrow || this.tip().find('.arrow')) 1423 } 1424 Popover.prototype.tip = function () { 1425 if (!this.$tip) this.$tip = $(this.options.template) 1426 return this.$tip 1427 } 1428 function Plugin(option) { 1429 return this.each(function () { 1430 var $this = $(this) 1431 var data = $this.data('bs.popover') 1432 var options = typeof option == 'object' && option 1433 if (!data && option == 'destroy') return 1434 if (!data) $this.data('bs.popover', (data = new Popover(this, options))) 1435 if (typeof option == 'string') data[option]() 1436 }) 1437 } 1438 var old = $.fn.popover 1439 $.fn.popover = Plugin 1440 $.fn.popover.Constructor = Popover 1441 $.fn.popover.noConflict = function () { 1442 $.fn.popover = old 1443 return this 1444 } 1445}(jQuery); 1446; 1447/*! RESOURCE: /scripts/heisenberg/bootstrap/scrollspy.js */ 1448+function ($) { 1449 'use strict'; 1450 function ScrollSpy(element, options) { 1451 var process = $.proxy(this.process, this) 1452 this.$body = $('body') 1453 this.$scrollElement = $(element).is('body') ? $(window) : $(element) 1454 this.options = $.extend({}, ScrollSpy.DEFAULTS, options) 1455 this.selector = (this.options.target || '') + ' .nav li > a' 1456 this.offsets = [] 1457 this.targets = [] 1458 this.activeTarget = null 1459 this.scrollHeight = 0 1460 this.$scrollElement.on('scroll.bs.scrollspy', process) 1461 this.refresh() 1462 this.process() 1463 } 1464 ScrollSpy.VERSION = '3.2.0' 1465 ScrollSpy.DEFAULTS = { 1466 offset: 10 1467 } 1468 ScrollSpy.prototype.getScrollHeight = function () { 1469 return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) 1470 } 1471 ScrollSpy.prototype.refresh = function () { 1472 var offsetMethod = 'offset' 1473 var offsetBase = 0 1474 if (!$.isWindow(this.$scrollElement[0])) { 1475 offsetMethod = 'position' 1476 offsetBase = this.$scrollElement.scrollTop() 1477 } 1478 this.offsets = [] 1479 this.targets = []
1480 this.scrollHeight = this.getScrollHeight() 1481 var self = this 1482 this.$body 1483 .find(this.selector) 1484 .map(function () { 1485 var $el = $(this) 1486 var href = $el.data('target') || $el.attr('href') 1487var $href = /^#./.test(href) && $(href) 1488 return ($href 1489 && $href.length 1490 && $href.is(':visible') 1491 && [[$href[offsetMethod]().top + offsetBase, href]]) || null 1492 }) 1493 .sort(function (a, b) { return a[0] - b[0] }) 1494 .each(function () { 1495 self.offsets.push(this[0]) 1496 self.targets.push(this[1]) 1497 }) 1498 } 1499 ScrollSpy.prototype.process = function () { 1500 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset 1501 var scrollHeight = this.getScrollHeight() 1502 var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height() 1503 var offsets = this.offsets 1504 var targets = this.targets 1505 var activeTarget = this.activeTarget 1506 var i 1507 if (this.scrollHeight != scrollHeight) { 1508 this.refresh() 1509 } 1510 if (scrollTop >= maxScroll) { 1511 return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) 1512 } 1513 if (activeTarget && scrollTop <= offsets[0]) { 1514 return activeTarget != (i = targets[0]) && this.activate(i) 1515 } 1516 for (i = offsets.length; i--;) { 1517 activeTarget != targets[i] 1518 && scrollTop >= offsets[i] 1519 && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) 1520 && this.activate(targets[i]) 1521 } 1522 } 1523 ScrollSpy.prototype.activate = function (target) { 1524 this.activeTarget = target 1525 $(this.selector) 1526 .parentsUntil(this.options.target, '.active') 1527 .removeClass('active') 1528 var selector = this.selector + 1529 '[data-target="' + target + '"],' + 1530 this.selector + '[href="' + target + '"]' 1531 var active = $(selector) 1532 .parents('li') 1533 .addClass('active') 1534 if (active.parent('.dropdown-menu').length) { 1535 active = active 1536 .closest('li.dropdown') 1537 .addClass('active') 1538 } 1539 active.trigger('activate.bs.scrollspy') 1540 } 1541 function Plugin(option) { 1542 return this.each(function () { 1543 var $this = $(this) 1544 var data = $this.data('bs.scrollspy') 1545 var options = typeof option == 'object' && option 1546 if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) 1547 if (typeof option == 'string') data[option]() 1548 }) 1549 } 1550 var old = $.fn.scrollspy 1551 $.fn.scrollspy = Plugin 1552 $.fn.scrollspy.Constructor = ScrollSpy 1553 $.fn.scrollspy.noConflict = function () { 1554 $.fn.scrollspy = old 1555 return this 1556 } 1557 $(window).on('load.bs.scrollspy.data-api', function () { 1558 $('[data-spy="scroll"]').each(function () { 1559 var $spy = $(this) 1560 Plugin.call($spy, $spy.data()) 1561 }) 1562 }) 1563}(jQuery); 1564; 1565/*! RESOURCE: /scripts/heisenberg/bootstrap/transition.js */ 1566+function ($) { 1567 'use strict'; 1568 function transitionEnd() { 1569 var el = document.createElement('bootstrap') 1570 var transEndEventNames = { 1571 WebkitTransition : 'webkitTransitionEnd', 1572 MozTransition : 'transitionend', 1573 OTransition : 'oTransitionEnd otransitionend', 1574 transition : 'transitionend' 1575 } 1576 for (var name in transEndEventNames) { 1577 if (el.style[name] !== undefined) { 1578 return { end: transEndEventNames[name] } 1579 } 1580 } 1581return false 1582 } 1583 $.fn.emulateTransitionEnd = function (duration) { 1584 var called = false 1585 var $el = this 1586 $(this).one('bsTransitionEnd', function () { called = true }) 1587 var callback = function () { if (!called) $($el).trigger($.support.transition.end) } 1588 setTimeout(callback, duration) 1589 return this 1590 } 1591 $(function () { 1592 $.support.transition = transitionEnd() 1593 if (!$.support.transition) return 1594 $.event.special.bsTransitionEnd = { 1595 bindType: $.support.transition.end, 1596 delegateType: $.support.transition.end, 1597 handle: function (e) { 1598 if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) 1599 } 1600 } 1601 }) 1602}(jQuery); 1603; 1604/*! RESOURCE: /scripts/heisenberg/custom/prototype.hidefix.js */ 1605(function($) { 1606 "use strict"; 1607 $.fn.hideFix = function() { 1608 return this.each(function() { 1609 if (!window.Prototype) 1610 return this; 1611 this.hide = function() { 1612 if (!jQuery.event.triggered) 1613 Element.hide(this); 1614 } 1615 this.show = function() { 1616 if (!jQuery.event.triggered) 1617 Element.show(this); 1618 } 1619 return this; 1620 }) 1621 } 1622}
1622)(jQuery); 1623; 1624/*! RESOURCE: /scripts/heisenberg/custom/collapse.js */ 1625(function($) { 1626 "use strict"; 1627 var bsCollapse = $.fn.collapse; 1628 $.fn.collapse = function(options) { 1629 var $this = this; 1630 $this.hideFix(); 1631 return bsCollapse.call($this, options); 1632 }; 1633 $(document).on('click.bs.collapse.data-api', '[data-sn-toggle="collapse"]', function(e) { 1634 var href 1635 var $this = $(this) 1636 var target = $this.attr('data-target') 1637 || e.preventDefault() 1638|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') 1639 var $target = $(target) 1640 var data = $target.data('bs.collapse') 1641 var option = data ? 'toggle' : $this.data() 1642 var parent = $this.attr('data-parent') 1643 var $parent = parent && $(parent) 1644 if (!data || !data.transitioning) { 1645 if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed') 1646 $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') 1647 } 1648 $.fn.collapse.call($target, option) 1649 }); 1650})(jQuery); 1651; 1652/*! RESOURCE: /scripts/heisenberg/custom/dropdowns.js */ 1653(function($) { 1654 "use strict"; 1655 $(document).on('show.bs.dropdown', function(evt) { 1656 $(evt.relatedTarget).hideFix() 1657 .parent().hideFix() 1658 .closest('.dropup, .dropdown').hideFix(); 1659 $('.dropdown-menu', evt.target).data('menu-trigger', evt.relatedTarget); 1660 }); 1661})(jQuery); 1662; 1663/*! RESOURCE: /scripts/heisenberg/custom/modals.js */ 1664(function($) { 1665 "use strict"; 1666 var bsModal = $.fn.modal.Constructor; 1667 var bsModalShow = bsModal.prototype.show; 1668 var bsModalHide = bsModal.prototype.hide; 1669 var visibleModalStack = []; 1670 var $document = $(document); 1671 function isMobileSafari() { 1672return navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i); 1673 } 1674 function forceRedraw(element) { 1675 return element.offsetLeft; 1676 } 1677 function getFirstTabbableElement(container, depth) { 1678 if (typeof depth === 'undefined') 1679 depth = 1; 1680 if (depth === 3) 1681 return null; 1682 var elements = window.tabbable(container, 'input, select, a[href], textarea, button, [tabindex]:not(.focus-trap-boundary-south), iframe'); 1683 if (elements.length === 0) return null; 1684 var result = null; 1685 if (elements[0].tagName !== 'IFRAME') 1686 return elements[0]; 1687 for (var i = 0; i <= elements.length - 1 && result === null; i++) { 1688 result = elements[i]; 1689 if (result.tagName === 'IFRAME') 1690 result = getFirstTabbableElement(result.contentDocument, depth + 1); 1691 } 1692 return result; 1693 } 1694 function getLastTabbableElement(container, depth) { 1695 if (typeof depth === 'undefined') 1696 depth = 1; 1697 if (depth === 3) 1698 return null; 1699 var elements = window.tabbable(container, 'input, select, a[href], textarea, button, [tabindex]:not(.focus-trap-boundary-south), iframe'); 1700 if (elements.length === 0) return null; 1701 if (elements[elements.length - 1].tagName !== 'IFRAME') 1702 return elements[elements.length - 1]; 1703 var result = null; 1704 for (var i = elements.length - 1; i >= 0 && result === null; i--) { 1705 result = elements[i]; 1706 if (result.tagName === 'IFRAME') 1707 result = getLastTabbableElement(result.contentDocument, depth + 1); 1708 } 1709 return result; 1710 } 1711 function visibleModalFocusInHandler(event) { 1712 var $modal = visibleModalStack[visibleModalStack.length - 1]; 1713 if (!$modal || !$modal.$element) 1714 return; 1715 $modal = $modal.$element; 1716 if ($modal.attr('focus-escape') === 'true') 1717 return; 1718 var modal = $modal[0]; 1719 var targetIsModal = modal === event.target; 1720 var modalContainsTarget = $modal.has(event.target).length > 0; 1721 var targetIsSouthernBoundary = event.target.classList.contains('focus-trap-boundary-south'); 1722 var targetIsIframe = event.target.tagName === "IFRAME"; 1723 var isVTBLoadedForm = modal.classList.contains('vtb-classic-form-modal'); 1724 if (!targetIsModal && !isVTBLoadedForm) { 1725 if (!modalContainsTarget) { 1726 var lastTabbableElement = getLastTabbableElement(modal); 1727 if (lastTabbableElement && typeof lastTabbableElement.focus === 'function') 1728 lastTabbableElement.focus(); 1729 else 1730 $modal.trigger('focus'); 1731 } 1732 else if (targetIsSouthernBoundary){ 1733 var firstTabbableElement = getFirstTabbableElement(modal); 1734 if (firstTabbableElement && typeof firstTabbableElement.focus === 'function') 1735 firstTabbableElement.focus(); 1736 else 1737 $modal.trigger('focus'); 1738 } 1739 else if (targetIsIframe) { 1740 var firstTabbableElement = getFirstTabbableElement(event.target.contentDocument); 1741 if (firstTabbableElement && typeof firstTabbableElement.focus === 'function') 1742 firstTabbableElement.focus(); 1743 } 1744 } 1745 } 1746 bsModal.prototype.show = function() { 1747 bsModalShow.apply(this, arguments); 1748 visibleModalStack.push(this);
1749 var $backdrop = $('body').find('.modal-backdrop').not('.stacked'); 1750 var zmodal = this.$element.css('z-index'); 1751 var zbackdrop = $backdrop.css('z-index'); 1752 this.$element.css('z-index', (~~zmodal) + (10 * visibleModalStack.length)); 1753 $backdrop.css('z-index', (~~zbackdrop) + (10 * visibleModalStack.length)); 1754 $backdrop.addClass('stacked'); 1755 this.$element[0].setAttribute('tabindex', '-1'); 1756 forceRedraw(this.$element[0]); 1757 }; 1758 bsModal.prototype.hide = function(e) { 1759 bsModalHide.apply(this, arguments); 1760 var modalPosition = visibleModalStack.indexOf(this); 1761 if (modalPosition !== -1) 1762 visibleModalStack.splice(modalPosition, 1); 1763 if (this.isShown) return; 1764 if (visibleModalStack.length > 0) 1765 $document.on('focusin.bs.modal', visibleModalFocusInHandler) 1766 this.$element.css('z-index', ''); 1767 forceRedraw(this.$element[0]); 1768 }; 1769 $document.on('shown.bs.modal hidden.bs.modal', function() { 1770 if (window._frameChanged) 1771 _frameChanged(); 1772 }) 1773 $document.on('shown.bs.modal', function(event) { 1774 $document.off('focusin.bs.modal'); 1775 $document.on('focusin.bs.modal', visibleModalFocusInHandler); 1776 var modal = event.target; 1777 var autoFocus = true; 1778 if (modal.getAttribute('data-auto-focus') === 'false') { 1779 autoFocus = false; 1780 } 1781 if (autoFocus && window.tabbable) { 1782 var tabbableElements = window.tabbable(modal); 1783 if ( 1784 tabbableElements 1785 && tabbableElements.length 1786 && tabbableElements[0] 1787 ) { 1788 tabbableElements[0].focus(); 1789 } 1790 } 1791 }); 1792})(jQuery); 1793; 1794/*! RESOURCE: /scripts/heisenberg/custom/tooltips.js */ 1795(function($) { 1796 "use strict"; 1797 var bsTooltip = $.fn.tooltip.Constructor; 1798 bsTooltip.DEFAULTS.placement = 'auto'; 1799 bsTooltip.DEFAULTS.delay = { 1800 'show': 500, 1801 'hide': 100 1802 }; 1803 var SN_TOOLTIP_SELECTOR = '.sn-tooltip-basic, *[title]:not(.accessibility_no_tooltip), *[data-dynamic-title]:not(.accessibility_no_tooltip), [data-tooltip-overflow-only="true"]'; 1804 $(function() { 1805 if ('ontouchstart' in document.documentElement) 1806 return; 1807 var $tooltips = $(SN_TOOLTIP_SELECTOR); 1808 (function setupTooltips() { 1809 $tooltips.each(function() { 1810 var $this = $(this); 1811 $this.hideFix(); 1812 if (this.hasAttribute('title') && !this.hasAttribute('data-original-title')) 1813 this.setAttribute('data-original-title', this.getAttribute('title')); 1814 }) 1815 })(); 1816 $(document.body).on('mouseenter focus', SN_TOOLTIP_SELECTOR, function(evt) { 1817 if (this.tagName == 'IFRAME' || this.tagName == 'OPTION') 1818 return; 1819 var $this = $(this); 1820 $this.hideFix(); 1821 var $target = $(evt.target); 1822 if ($this.data('bs.tooltip')) 1823 return; 1824 if (this.getAttribute('data-tooltip-overflow-only') === 'true' && !this.hasAttribute('title')) { 1825 var text = $this.find('[data-tooltip-overflow-only-text="true"]')[0]; 1826 if (text && text.offsetWidth < text.scrollWidth) { 1827 this.setAttribute('title', text.textContent); 1828 } 1829 } 1830 1831 if (this.hasAttribute('title') && !this.hasAttribute('data-original-title')) 1832 this.setAttribute('data-original-title', this.getAttribute('title')); 1833 1834 $this.tooltip({ 1835 container: $this.attr('data-container') || 'body', 1836 title: function() { 1837 return $(this).attr('data-dynamic-title'); 1838 }, 1839 omitAriaDescribedby: $target.data('omit-aria-describedby') 1840 }); 1841 $this.on('click', function() { 1842 $this.tooltip('hide'); 1843 }); 1844 if ($this.hasClass('icon-help')) { 1845 $this.on('keyup', function(e) { 1846 if (e.which === 27) 1847 $this.tooltip('hide'); 1848 }); 1849 } 1850 var tooltipDuration = 10; 1851 if (window.g_accessibility && typeof g_accessibility_tooltip_duration !== 'undefined') 1852 tooltipDuration = g_accessibility_tooltip_duration; 1853 if (tooltipDuration !== 0) { 1854 $this.on('shown.bs.tooltip', function() { 1855 setTimeout(function() { 1856 $this.tooltip('hide'); 1857 }, tooltipDuration * 1000); 1858 }); 1859 } 1860 $this.data('hover', setTimeout(function() { 1861 $this.tooltip('show'); 1862 }, bsTooltip.DEFAULTS.delay.show)); 1863 }); 1864 $(document.body).on('mouseleave blur', SN_TOOLTIP_SELECTOR, function() { 1865 var $this = $(this); 1866 var hover = $this.data('hover'); 1867 if (hover) { 1868 clearTimeout($this.data('hover')); 1869 $this.removeData('hover') 1870 } 1871 }); 1872 $(document).bind('mouseleave', function(evt) { 1873 if ($('.tooltip').length === 0) 1874 return; 1875 $('.sn-tooltip-basic, *[title]').each(function() { 1876 if (this.tagName == 'IFRAME') 1877 return; 1878 var $this = $(this); 1879 if ($this.data('bs.tooltip')) 1880 $this.tooltip('hide'); 1881 }) 1882 }) 1883 }); 1884})(jQuery); 1885; 1886/*! RESOURCE: /scripts/heisenberg/custom/snPopover.js */ 1887(function($) { 1888 "use strict"; 1889 var Popover = $.fn.popover.Constructor; 1890 var popoverCount = 0; 1891 var bsPopoverInit = Popover.prototype.init; 1892 var bsPopoverShow = Popover.prototype.show; 1893 var bsPopoverHide = Popover.prototype.hide; 1894 var bsPopoverFixTitle = Popover.prototype.fixTitle; 1895 Popover.prototype.init = function (type, element, options) { 1896 var $e = $(element); 1897 var $target = $($e.data('target')); 1898 var popoverId = popoverCount++; 1899 var wide = !!$e.data('wide'); 1900 $e.hideFix(); 1901 this.$target = $target; 1902 this.$target.hide(); 1903 this.popoverId = popoverId; 1904 options = $.extend({}, { 1905 html: true, 1906 content: function () { 1907 if (wide) 1908 this.tip().addClass('wide'); 1909 var placeholderId = 'popover-placeholder-' + popoverId; 1910 if (!document.getElementById(placeholderId)) 1911$target.before('<div id="' + placeholderId + '" class="popover-placeholder" />'); 1912 $target.show(); 1913 return $target; 1914 }.bind(this) 1915 }, options); 1916 bsPopoverInit.call(this, type, element, options); 1917 }; 1918 Popover.prototype.fixTitle = function() { 1919 var trigger = this.options.trigger; 1920if (typeof trigger === "undefined" || trigger === "" || /hover/.test(trigger)) 1921 bsPopoverFixTitle.apply(this, arguments); 1922 }; 1923 Popover.prototype.show = function () { 1924 var $e = this.$element; 1925 bsPopoverShow.apply(this, arguments); 1926 $e.addClass('active'); 1927 this.tip().one('click', '[data-dismiss=popover]', function () { 1928 $e.popover('hide'); 1929 $e[0].focus(); 1930 }); 1931 }; 1932 Popover.prototype.hide = function () { 1933 var $e = this.$element; 1934 var $target = this.$target; 1935 var $popover = $target.closest('.popover'); 1936 var popoverId = this.popoverId; 1937 function saveOffContent() { 1938 $e.removeClass('active'); 1939 var $placeholder = $('#popover-placeholder-' + popoverId); 1940 if (!$placeholder.length || !$target.length) 1941 return; 1942 var $innerContent = $target.detach(); 1943 if ($innerContent.length === 0) 1944 return; 1945 $innerContent.hide(); 1946 $placeholder.replaceWith($innerContent); 1947 }
1948 if ($.support.transition && $popover.hasClass('fade')) 1949 $popover.one('bsTransitionEnd', saveOffContent); 1950 else 1951 saveOffContent(); 1952 bsPopoverHide.apply(this, arguments); 1953 }; 1954 Popover.prototype.getTitle = function() { 1955 var $e = this.$element; 1956 var title = $e.data('popover-title'); 1957 var expectingHtml = this.options && this.options.html; 1958 var isHtml = typeof $e.data('popover-title-is-html') !== 'undefined' ? $e.data('popover-title-is-html') : expectingHtml; 1959 if (expectingHtml && !isHtml) { 1960title = $('<div />').text(title).html(); 1961 } 1962 return title || $.fn.tooltip.Constructor.prototype.getTitle.call(this); 1963 } 1964})(jQuery); 1965; 1966/*! RESOURCE: /scripts/heisenberg/custom/popovers.js */ 1967(function($) { 1968 "use strict"; 1969 $(function() { 1970 $('.sn-popover-basic').each(function() { 1971 var $this = $(this); 1972 if (!$this.data('bs.popover')) 1973 $(this).popover(); 1974 }); 1975 function hideOpenPopovers() { 1976 $('.sn-popover-basic').each(function() { 1977 var $this = $(this); 1978 if ($this.attr('aria-describedby') !== undefined) 1979 $this.popover('hide'); 1980 }); 1981 } 1982 function resetContainer() { 1983 $('.sn-popover-basic').each(function() { 1984 var $this = $(this); 1985 $this.popover({container: $this.data('container')}); 1986 }); 1987 } 1988 1989 function debounce(fn, threshold, fireOnStart) { 1990 var timeout; 1991 return function() { 1992 var obj = this, 1993 args = arguments; 1994 threshold = (threshold !== undefined) ? threshold : 500; 1995 function delayed() { 1996 if (!fireOnStart) 1997 fn.apply(obj, args); 1998 timeout = null; 1999 } 2000 if (timeout) 2001 clearTimeout(timeout); 2002 else if (fireOnStart) 2003 fn.apply(obj, args); 2004 timeout = setTimeout(delayed, threshold); 2005 }; 2006 } 2007 function closeOnBlur(e) { 2008 function eventTargetInElement(elem) { 2009 return elem.is(e.target) || elem.has(e.target).length !== 0 2010 } 2011 $('.sn-popover-basic').each(function() { 2012 var $popoverButton = $(this); 2013 var $popoverContent = $($popoverButton.data('target')); 2014 if (!$popoverButton.hasClass('active')) 2015 return; 2016 if (e.target.closest("#tag_form")) 2017 return; 2018 if (eventTargetInElement($popoverButton) || eventTargetInElement($popoverContent)) 2019 return; 2020 if ($popoverButton.data('auto-close') === false && !$(e.target).is('.sn-popover-basic')) 2021 return; 2022 $popoverButton.popover('hide'); 2023 }); 2024 } 2025 var debouncedResetContainer = debounce(resetContainer); 2026 var debouncedHideOpenPopovers = debounce(hideOpenPopovers, 0, true); 2027 var debouncedCloseOnBlur = debounce(closeOnBlur, 10); 2028 $(window).on('resize', function() { 2029 if ('ontouchstart' in document.documentElement && document.activeElement.type === 'text') 2030 return; 2031debouncedHideOpenPopovers(); 2032debouncedResetContainer(); 2033 }); 2034 $('html').on('click', function(e) { 2035 debouncedCloseOnBlur(e); 2036 }); 2037 if (CustomEvent && CustomEvent.observe) { 2038 CustomEvent.observe('body_clicked', function(e) { 2039 debouncedCloseOnBlur(e); 2040 }); 2041 } 2042 }); 2043 $(document).on('show.bs.popover hide.bs.popover', function() { 2044 if (window._frameChanged) 2045 _frameChanged(); 2046 }) 2047})(jQuery); 2048; 2049/*! RESOURCE: /scripts/select2_doctype/select2.min.js */ 2050!function($){void 0===$.fn.each2&&$.extend($.fn,{each2:function(c){for(var j=$([0]),i=-1,l=this.length;++i<l&&(j.context=j[0]=this[i])&&!1!==c.call(j[0],i,j););return this}})}(jQuery),function($,undefined){"use strict";var AbstractSelect2,SingleSelect2,MultiSelect2,nextUid,sizer,lastMousePosition,scrollBarDimensions,KEY,DIACRITICS,counter,$document;function reinsertElement(element){var placeholder=$(document.createTextNode(""));element.before(placeholder),placeholder.before(element),placeholder.remove()}
2050function stripDiacritics(str){return str.replace(/[^\u0000-\u007E]/g,function(a){return DIACRITICS[a]||a})}function indexOf(value,array){for(var i=0,l=array.length;i<l;i+=1)if(equal(value,array[i]))return i;return-1}function equal(a,b){return a===b||a!==undefined&&b!==undefined&&null!==a&&null!==b&&(a.constructor===String?a+""==b+"":b.constructor===String&&b+""==a+"")}function splitVal(string,separator){var val,i,l;if(null===string||string.length<1)return[];for(i=0,l=(val=string.split(separator)).length;i<l;i+=1)val[i]=$.trim(val[i]);return val}function getSideBorderPadding(element){return element.outerWidth(!1)-element.width()}function installKeyUpChangeEvent(element){var key="keyup-change-value";element.on("keydown",function(){$.data(element,key)===undefined&&$.data(element,key,element.val())}),element.on("keyup",function(){var val=$.data(element,key);val!==undefined&&element.val()!==val&&($.removeData(element,key),element.trigger("keyup-change"))})}function debounce(quietMillis,fn,ctx){var timeout;return ctx=ctx||undefined,function(){var args=arguments;window.clearTimeout(timeout),timeout=window.setTimeout(function(){fn.apply(ctx,args)},quietMillis)}}function killEvent(event){event.preventDefault(),event.stopPropagation()}function syncCssClasses(dest,src,adapter){var adapted,replacements=[],classes=$.trim(dest.attr("class"));classes&&$((classes=""+classes).split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&replacements.push(this)}),(classes=$.trim(src.attr("class")))&&$((classes=""+classes).split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(adapted=adapter(this))&&replacements.push(adapted)}),dest.attr("class",replacements.join(" ")),-1<replacements.indexOf("hidden-select2")&&dest.attr("aria-hidden","true")}function markMatch(text,term,markup,escapeMarkup){var match=stripDiacritics(text.toUpperCase()).indexOf(stripDiacritics(term.toUpperCase())),term=term.length;match<0?markup.push(escapeMarkup(text)):(markup.push(escapeMarkup(text.substring(0,match))),markup.push("<span class='select2-match'>"),markup.push(escapeMarkup(text.substring(match,match+term))),markup.push("</span>"),markup.push(escapeMarkup(text.substring(match+term,text.length))))}function defaultEscapeMarkup(markup){var replace_map={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(markup).replace(/[&<>"'\/\\]/g,function(match){return replace_map[match]})}function ajax(options){var timeout,handler=null,quietMillis=options.quietMillis||100,ajaxUrl=options.url,self=this;return function(query){window.clearTimeout(timeout),timeout=window.setTimeout(function(){var data=options.data,url=ajaxUrl,transport=options.transport||$.fn.select2.ajaxDefaults.transport,deprecated={type:options.type||"GET",cache:options.cache||!1,jsonpCallback:options.jsonpCallback||undefined,dataType:options.dataType||"json"},deprecated=$.extend({},$.fn.select2.ajaxDefaults.params,deprecated),data=data?data.call(self,query.term,query.page,query.context):null,url="function"==typeof url?url.call(self,query.term,query.page,query.context):url;handler&&"function"==typeof handler.abort&&handler.abort(),options.params&&($.isFunction(options.params)?$.extend(deprecated,options.params.call(self)):$.extend(deprecated,options.params)),$.extend(deprecated,{url:url,dataType:options.dataType,data:data,success:function(data){data=options.results(data,query.page,query);query.callback(data)},error:function(jqXHR,textStatus,errorThrown){query.callback({hasError:!0,jqXHR:jqXHR,textStatus:textStatus,errorThrown:errorThrown})}}),handler=transport.call(self,deprecated)},quietMillis)}}function local(options){var dataText,tmp,data=options,text=function(item){return""+item.text},options=($.isArray(data)&&(data={results:tmp=data}),!1===$.isFunction(data)&&(tmp=data,data=function(){return tmp}),data());return options.text&&(text=options.text,$.isFunction(text)||(dataText=options.text,text=function(item){return item[dataText]})),function(query){var process,t=query.term,filtered={results:[]};""===t?query.callback(data()):(process=function(datum,collection){var group,attr;if((datum=datum[0]).children){for(attr in group={},datum)datum.hasOwnProperty(attr)&&(group[attr]=datum[attr]);group.children=[],$(datum.children).each2(function(i,childDatum){process(childDatum,group.children)}),(group.children.length||query.matcher(t,text(group),datum))&&collection.push(group)}else query.matcher(t,text(datum),datum)&&collection.push(datum)}
2050,$(data().results).each2(function(i,datum){process(datum,filtered.results)}),query.callback(filtered))}}function tags(data){var isFunc=$.isFunction(data);return function(query){var t=query.term,filtered={results:[]},result=isFunc?data(query):data;$.isArray(result)&&($(result).each(function(){var isObject=this.text!==undefined,text=isObject?this.text:this;""!==t&&!query.matcher(t,text)||filtered.results.push(isObject?this:{id:this,text:this})}),query.callback(filtered))}}function checkFormatter(formatter,formatterName){if($.isFunction(formatter))return 1;if(formatter){if("string"==typeof formatter)return 1;throw new Error(formatterName+" must be a string, function, or falsy value")}}function evaluate(val,context){var args;return $.isFunction(val)?(args=Array.prototype.slice.call(arguments,2),val.apply(context,args)):val}function cleanupJQueryElements(){var self=this;$.each(arguments,function(i,element){self[element].remove(),self[element]=null})}function clazz(SuperClass,methods){function constructor(){}return((constructor.prototype=new SuperClass).constructor=constructor).prototype.parent=SuperClass.prototype,constructor.prototype=$.extend(constructor.prototype,methods),constructor}window.Select2===undefined&&(lastMousePosition={x:0,y:0},KEY={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(k){switch(k=k.which||k){case KEY.LEFT:case KEY.RIGHT:case KEY.UP:case KEY.DOWN:return!0}return!1},isControl:function(e){switch(e.which){case KEY.SHIFT:case KEY.CTRL:case KEY.ALT:return!0}return!!e.metaKey},isFunctionKey:function(k){return 112<=(k=k.which||k)&&k<=123}},DIACRITICS={"â¶":"A","A":"A","Ã":"A","Ã":"A","Ã":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ä":"A","Ä":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ç ":"A","Ã":"A","Ç":"A","Ả":"A","Ã
":"A","Ǻ":"A","Ç":"A","È":"A","È":"A","Ạ":"A","Ậ":"A","Ặ":"A","á¸":"A","Ä":"A","Ⱥ":"A","Ɐ":"A","ê²":"AA","Ã":"AE","Ǽ":"AE","Ç¢":"AE","ê´":"AO","ê¶":"AU","ê¸":"AV","êº":"AV","ê¼":"AY","â·":"B","ï¼¢":"B","á¸":"B","á¸":"B","á¸":"B","É":"B","Æ":"B","Æ":"B","â¸":"C","ï¼£":"C","Ä":"C","Ä":"C","Ä":"C","Ä":"C","Ã":"C","á¸":"C","Æ":"C","È»":"C","ê¾":"C","â¹":"D","D":"D","á¸":"D","Ä":"D","á¸":"D","á¸":"D","á¸":"D","á¸":"D","Ä":"D","Æ":"D","Æ":"D","Æ":"D","ê¹":"D","DZ":"DZ","Ç":"DZ","Dz":"Dz","Ç
":"Dz","âº":"E","ï¼¥":"E","Ã":"E","Ã":"E","Ã":"E","á»":"E","Ế":"E","á»":"E","á»":"E","Ẽ":"E","Ä":"E","á¸":"E","á¸":"E","Ä":"E","Ä":"E","Ã":"E","Ẻ":"E","Ä":"E","È":"E","È":"E","Ẹ":"E","á»":"E","Ȩ":"E","á¸":"E","Ä":"E","á¸":"E","á¸":"E","Æ":"E","Æ":"E","â»":"F","F":"F","á¸":"F","Æ":"F","ê»":"F","â¼":"G","ï¼§":"G","Ç´":"G","Ä":"G","Ḡ":"G","Ä":"G","Ä ":"G","Ǧ":"G","Ä¢":"G","Ǥ":"G","Æ":"G","ê ":"G","ê½":"G","ê¾":"G","â½":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","È":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","â±§":"H","â±µ":"H","ê":"H","â¾":"I","I":"I","Ã":"I","Ã":"I","Ã":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ã":"I","Ḯ":"I","á»":"I","Ç":"I","È":"I","È":"I","á»":"I","Ä®":"I","Ḭ":"I","Æ":"I","â¿":"J","J":"J","Ä´":"J","É":"J","â":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Æ":"K","Ⱪ":"K","ê":"K","ê":"K","ê":"K","ê¢":"K","â":"L","L":"L","Ä¿":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ä»":"L","Ḽ":"L","Ḻ":"L","Å":"L","Ƚ":"L","â±¢":"L","â± ":"L","ê":"L","ê":"L","ê":"L","Ç":"LJ","Ç":"Lj","â":"M","ï¼":"M","Ḿ":"M","á¹":"M","á¹":"M","â±®":"M","Æ":"M","â":"N","ï¼®":"N","Ǹ":"N","Å":"N","Ã":"N","á¹":"N","Å":"N","á¹":"N","Å
":"N","á¹":"N","á¹":"N","È ":"N","Æ":"N","ê":"N","ê¤":"N","Ç":"NJ","Ç":"Nj","â":"O","O":"O","Ã":"O","Ã":"O","Ã":"O","á»":"O","á»":"O","á»":"O","á»":"O","Ã":"O","á¹":"O","Ȭ":"O","á¹":"O","Å":"O","á¹":"O","á¹":"O","Å":"O","È®":"O","Ȱ":"O","Ã":"O","Ȫ":"O","á»":"O","Å":"O","Ç":"O","È":"O","È":"O","Æ ":"O","á»":"O","á»":"O","á» ":"O","á»":"O","Ợ":"O","á»":"O","á»":"O","Ǫ":"O","Ǭ":"O","Ã":"O","Ǿ":"O","Æ":"O","Æ":"O","ê":"O","ê":"O","Æ¢":"OI","ê":"OO","È¢":"OU","â
":"P","ï¼°":"P","á¹":"P","á¹":"P","Ƥ":"P","â±£":"P","ê":"P","ê":"P","ê":"P","â":"Q","ï¼±":"Q","ê":"Q","ê":"Q","É":"Q","â":"R","ï¼²":"R","Å":"R","á¹":"R","Å":"R","È":"R","È":"R","á¹":"R","á¹":"R","Å":"R","á¹":"R","É":"R","Ɽ":"R","ê":"R","ê¦":"R","ê":"R","â":"S","ï¼³":"S","áº":"S","Å":"S","Ṥ":"S","Å":"S","á¹ ":"S","Å ":"S","Ṧ":"S","á¹¢":"S","Ṩ":"S","È":"S","Å":"S","â±¾":"S","ê¨":"S","ê":"S","â":"T","ï¼´":"T","Ṫ":"T","Ť":"T","Ṭ":"T","È":"T","Å¢":"T","á¹°":"T","á¹®":"T","Ŧ":"T","Ƭ":"T","Æ®":"T","Ⱦ":"T","ê":"T","ê¨":"TZ","â":"U","ï¼µ":"U","Ã":"U","Ã":"U","Ã":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ã":"U","Ç":"U","Ç":"U","Ç":"U","Ç":"U","Ủ":"U","Å®":"U","Ű":"U","Ç":"U","È":"U","È":"U","Ư":"U","Ừ":"U","Ứ":"U","á»®":"U","Ử":"U","á»°":"U","Ụ":"U","á¹²":"U","Ų":"U","á¹¶":"U","á¹´":"U","É":"U","â":"V","ï¼¶":"V","á¹¼":"V","á¹¾":"V","Ʋ":"
2050V","ê":"V","É
":"V","ê ":"VY","â":"W","ï¼·":"W","áº":"W","áº":"W","Å´":"W","áº":"W","áº":"W","áº":"W","â±²":"W","â":"X","X":"X","áº":"X","áº":"X","â":"Y","ï¼¹":"Y","Ỳ":"Y","Ã":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","áº":"Y","Ÿ":"Y","á»¶":"Y","á»´":"Y","Ƴ":"Y","É":"Y","Ỿ":"Y","â":"Z","Z":"Z","Ź":"Z","áº":"Z","Å»":"Z","Ž":"Z","áº":"Z","áº":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","ê¢":"Z","â":"a","ï½":"a","áº":"a","à ":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","Ä":"a","Ä":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","Ç¡":"a","ä":"a","Ç":"a","ả":"a","Ã¥":"a","Ç»":"a","Ç":"a","È":"a","È":"a","ạ":"a","áº":"a","ặ":"a","á¸":"a","Ä
":"a","â±¥":"a","É":"a","ê³":"aa","æ":"ae","ǽ":"ae","Ç£":"ae","êµ":"ao","ê·":"au","ê¹":"av","ê»":"av","ê½":"ay","â":"b","ï½":"b","á¸":"b","á¸
":"b","á¸":"b","Æ":"b","Æ":"b","É":"b","â":"c","ï½":"c","Ä":"c","Ä":"c","Ä":"c","Ä":"c","ç":"c","á¸":"c","Æ":"c","ȼ":"c","ê¿":"c","â":"c","â":"d","ï½":"d","á¸":"d","Ä":"d","á¸":"d","á¸":"d","á¸":"d","á¸":"d","Ä":"d","Æ":"d","É":"d","É":"d","êº":"d","dz":"dz","Ç":"dz","â":"e","ï½
":"e","è":"e","é":"e","ê":"e","á»":"e","ế":"e","á»
":"e","á»":"e","ẽ":"e","Ä":"e","á¸":"e","á¸":"e","Ä":"e","Ä":"e","ë":"e","ẻ":"e","Ä":"e","È
":"e","È":"e","ẹ":"e","á»":"e","È©":"e","á¸":"e","Ä":"e","á¸":"e","á¸":"e","É":"e","É":"e","Ç":"e","â":"f","ï½":"f","á¸":"f","Æ":"f","ê¼":"f","â":"g","ï½":"g","ǵ":"g","Ä":"g","ḡ":"g","Ä":"g","Ä¡":"g","ǧ":"g","Ä£":"g","Ç¥":"g","É ":"g","ê¡":"g","áµ¹":"g","ê¿":"g","â":"h","ï½":"h","Ä¥":"h","ḣ":"h","ḧ":"h","È":"h","ḥ":"h","ḩ":"h","ḫ":"h","áº":"h","ħ":"h","ⱨ":"h","â±¶":"h","É¥":"h","Æ":"hv","â":"i","ï½":"i","ì":"i","Ã":"i","î":"i","Ä©":"i","Ä«":"i","Ä":"i","ï":"i","ḯ":"i","á»":"i","Ç":"i","È":"i","È":"i","á»":"i","į":"i","á¸":"i","ɨ":"i","ı":"i","â":"j","ï½":"j","ĵ":"j","ǰ":"j","É":"j","â":"k","ï½":"k","ḱ":"k","Ç©":"k","ḳ":"k","Ä·":"k","ḵ":"k","Æ":"k","ⱪ":"k","ê":"k","ê":"k","ê
":"k","ê£":"k","â":"l","ï½":"l","Å":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","Å¿":"l","Å":"l","Æ":"l","É«":"l","ⱡ":"l","ê":"l","ê":"l","ê":"l","Ç":"lj","â":"m","ï½":"m","ḿ":"m","á¹":"m","á¹":"m","ɱ":"m","ɯ":"m","â":"n","ï½":"n","ǹ":"n","Å":"n","ñ":"n","á¹
":"n","Å":"n","á¹":"n","Å":"n","á¹":"n","á¹":"n","Æ":"n","ɲ":"n","Å":"n","ê":"n","ê¥":"n","Ç":"nj","â":"o","ï½":"o","ò":"o","ó":"o","ô":"o","á»":"o","á»":"o","á»":"o","á»":"o","õ":"o","á¹":"o","È":"o","á¹":"o","Å":"o","á¹":"o","á¹":"o","Å":"o","ȯ":"o","ȱ":"o","ö":"o","È«":"o","á»":"o","Å":"o","Ç":"o","È":"o","È":"o","Æ¡":"o","á»":"o","á»":"o","ỡ":"o","á»":"o","ợ":"o","á»":"o","á»":"o","Ç«":"o","Ç":"o","ø":"o","Ç¿":"o","É":"o","ê":"o","ê":"o","ɵ":"o","Æ£":"oi","È£":"ou","ê":"oo","â":"p","ï½":"p","á¹":"p","á¹":"p","Æ¥":"p","áµ½":"p","ê":"p","ê":"p","ê":"p","â ":"q","ï½":"q","É":"q","ê":"q","ê":"q","â¡":"r","ï½":"r","Å":"r","á¹":"r","Å":"r","È":"r","È":"r","á¹":"r","á¹":"r","Å":"r","á¹":"r","É":"r","ɽ":"r","ê":"r","ê§":"r","ê":"r","â¢":"s","ï½":"s","Ã":"s","Å":"s","á¹¥":"s","Å":"s","ṡ":"s","Å¡":"s","á¹§":"s","á¹£":"s","ṩ":"s","È":"s","Å":"s","È¿":"s","ê©":"s","ê
":"s","áº":"s","â£":"t","ï½":"t","ṫ":"t","áº":"t","Å¥":"t","á¹":"t","È":"t","Å£":"t","á¹±":"t","ṯ":"t","ŧ":"t","Æ":"t","Ê":"t","ⱦ":"t","ê":"t","ê©":"tz","â¤":"u","ï½":"u","ù":"u","ú":"u","û":"u","Å©":"u","á¹¹":"u","Å«":"u","á¹»":"u","Å":"u","ü":"u","Ç":"u","Ç":"u","Ç":"u","Ç":"u","á»§":"u","ů":"u","ű":"u","Ç":"u","È":"u","È":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","á»":"u","á»±":"u","ụ":"u","á¹³":"u","ų":"u","á¹·":"u","á¹µ":"u","Ê":"u","â¥":"v","ï½":"v","á¹½":"v","ṿ":"v","Ê":"v","ê":"v","Ê":"v","ê¡":"vy","â¦":"w","ï½":"w","áº":"w","áº":"w","ŵ":"w","áº":"w","áº
":"w","áº":"w","áº":"w","â±³":"w","â§":"x","ï½":"x","áº":"x","áº":"x","â¨":"y","ï½":"y","ỳ":"y","ý":"y","Å·":"y","ỹ":"y","ȳ":"y","áº":"y","ÿ":"y","á»·":"y","áº":"y","ỵ":"y","Æ´":"y","É":"y","ỿ":"y","â©":"z","ï½":"z","ź":"z","áº":"z","ż":"z","ž":"z","áº":"z","áº":"z","ƶ":"z","È¥":"z","É":"z","ⱬ":"z","ê£":"z","Î":"Î","Î":"Î","Î":"Î","Î":"Î","Ϊ":"Î","Î":"Î","Î":"Î¥","Ϋ":"Î¥","Î":"Ω","ά":"α","Î":"ε","ή":"η","ί":"ι","Ï":"ι","Î":"ι","Ï":"ο","Ï":"Ï
","Ï":"Ï
","ΰ":"Ï
","Ï":"Ï","Ï":"Ï"},$document=$(document),counter=1,nextUid=function(){return counter++},AbstractSelect2=clazz(Object,{bind:function(func){var self=this;return function(){func.apply(self,arguments)}},init:function(opts){this.opts=opts=this.prepareOpts(opts),this.id=opts.id,opts.element.data("select2")!==undefined&&null!==opts.element.data("select2")&&opts.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=$("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body),this.containerId="s2id_"+(opts.element.attr("id")||"autogen"+nextUid()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",opts.element.attr("title")),this.body=$("body"),syncCssClasse
2050s(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",opts.element.attr("style")),this.container.css(evaluate(opts.containerCss,this.opts.element)),this.container.addClass(evaluate(opts.containerCssClass,this.opts.element)),this.container.attr("role","none"),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",killEvent),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),syncCssClasses(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(evaluate(opts.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",killEvent),this.results=results=this.container.find(".select2-results"),this.search=search=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",killEvent),this.results.on("mousemove",function(e){var lastpos=lastMousePosition;lastpos!==undefined&&lastpos.x===e.pageX&&lastpos.y===e.pageY||$(e.target).trigger("mousemove-filtered",e)}),this.dropdown.on("mousemove-filtered",".select2-results",this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",".select2-results",this.bind(function(event){this._touchEvent=!0,this.highlightUnderEvent(event)})),this.dropdown.on("touchmove",".select2-results",this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",".select2-results",this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(event){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),function(threshold,element){var notify=debounce(threshold,function(e){element.trigger("scroll-debounced",e)});element.on("scroll",function(e){0<=indexOf(e.target,element.get())&¬ify(e)})}(80,this.results),this.dropdown.on("scroll-debounced",".select2-results",this.bind(this.loadMoreIfNeeded)),$(this.container).on("change",".select2-input",function(e){e.stopPropagation()}),$(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()}),$.fn.mousewheel&&results.mousewheel(function(e,delta,deltaX,deltaY){var top=results.scrollTop();0<deltaY&&top-deltaY<=0?(results.scrollTop(0),killEvent(e)):deltaY<0&&results.get(0).scrollHeight-results.scrollTop()+deltaY<=results.height()&&(results.scrollTop(results.get(0).scrollHeight-results.height()),killEvent(e))}),installKeyUpChangeEvent(search),search.on("keyup-change input paste",this.bind(this.updateResults)),search.on("focus",function(){search.addClass("select2-focused")}),search.on("blur",function(){search.removeClass("select2-focused")}),this.dropdown.on("mouseup",".select2-results",this.bind(function(e){0<$(e.target).closest(".select2-result-selectable").length&&(this.highlightUnderEvent(e),this.selectHighlighted(e))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(e){e.stopPropagation()}),this.nextSearchTerm=undefined,$.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==opts.maximumInputLength&&this.search.attr("maxlength",opts.maximumInputLength);var results,search,dim,disabled=opts.element.prop("disabled"),disabled=(this.enable(!(disabled=disabled===undefined?!1:disabled)),opts.element.prop("readonly"));this.readonly(disabled=disabled===undefined?!1:disabled),scrollBarDimensions=scrollBarDimensions||((disabled=$("<div class='select2-measure-scrollbar'></div>")).appendTo("body"),dim={width:disabled.width()-disabled[0].clientWidth,height:disabled.height()-disabled[0].clientHeight},disabled.remove(),dim),this.autofocus=opts.element.prop("autofocus"),opts.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",opts.searchInputPlaceholder)},destroy:function(){var element=this.opts.element,select2=element.data("select2"),self=this;this.close(),element.length&&element[0].detachEvent&&element.each(function(){this.detachEvent("onpropertychange",self._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,select2!==undefined&&(select2.container.remove(),select2.liveRegion.remove(),select2.dropdown.remove(),element.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?element.attr({tabindex:this.elementTabIndex}):element.removeAttr("tabindex"),element.show()),cleanupJQueryElements.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(element){return element.is("option")?{id:element.prop("value"),text:element.text(),element:element.get(),css:element.attr("class"),disabled:element.prop("disabled"),locked:equal(element.attr("locked"),"locked")||equal(element.data("locked"),!0)}:element.is("optgroup")?{text:element.attr("label"),children:[],element:element.get(),css:element.attr("class")}:void 0},sanitizeHtml:function(text){if(!text||"string"!=typeof text)return text;
2050var validAttrs=["","background,cite,href,longdesc,src,xlink:href","accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode
2050-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan".toLowerCase(),"abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,style,summary,tabindex,target,title,type,valign,value,vspace,width",""].join(",");function sanitizeElement(elem){if(elem&&elem.nodeType===Node.ELEMENT_NODE){for(var invalidAttrs=[],i=0;i<elem.attributes.length;i++){var attr=elem.attributes[i].nodeName;validAttrs.indexOf(","+attr.toLowerCase()+",")<0&&invalidAttrs.push(attr)}for(i=0;i<invalidAttrs.length;i++)elem.removeAttribute(invalidAttrs[i]);for(i=0;i<elem.childNodes.length;i++)sanitizeElement(elem.childNodes[i])}}text=text.replace(/(<script\b[^>]*>[\s\S]*?<\/script>)/gim,"");for(var text=(new DOMParser).parseFromString(text,"text/html"),nodes=text.documentElement.childNodes,i=0;i<nodes.length;i++)sanitizeElement(nodes[i]);return text.getElementsByTagName("body")[0].innerHTML},prepareOpts:function(opts){var idKey,select,self=this,element=opts.element;if("select"===element.get(0).tagName.toLowerCase()&&(this.select=select=opts.element),select&&$.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in opts)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),"function"!=typeof(opts=$.extend({},{populateResults:function(container,results,query){var id=this.opts.id,liveRegion=this.liveRegion,populate=function(results,container,depth){for(var result,compound,node,selectable,disabled,nodes=[],i=0,l=(results=opts.sortResults(results,container,query)).length;i<l;i+=1)selectable=!(disabled=!0===(result=results[i]).disabled)&&id(result)!==undefined,compound=result.children&&0<result.children.length,(node=$("<li></li>")).addClass("select2-results-dept-"+depth),node.addClass("select2-result"),node.addClass(selectable?"select2-result-selectable":"select2-result-unselectable"),disabled&&node.addClass("select2-disabled"),compound&&node.addClass("select2-result-with-children"),node.addClass(self.opts.formatResultCssClass(result)),node.attr("role","presentation"),(selectable=$(document.createElement("div"))).addClass("select2-result-label"),selectable.attr("id","select2-result-label-"+nextUid()),selectable.attr("role","option"),(disabled=opts.formatResult(result,selectable,query,self.opts.escapeMarkup))!==undefined&&(selectable.html(self.sanitizeHtml(disabled)),node.append(selectable)),compound&&((disabled=$("<ul></ul>")).attr("role","presentation"),disabled.addClass("select2-result-sub"),populate(result.children,disabled,depth+1),node.append(disabled)),node.data("select2-data",result),nodes.push(node[0]);container.append(nodes),liveRegion.text(opts.formatMatches(results.length))};populate(results,container,0)}},$.fn.select2.defaults,opts)).id&&(idKey=opts.id,opts.id=function(e){return e[idKey]}
2050),$.isArray(opts.element.data("select2Tags"))){if("tags"in opts)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+opts.element.attr("id");opts.tags=opts.element.data("select2Tags")}if(select?(opts.query=this.bind(function(query){var placeholderOption,data={results:[],more:!1},term=query.term,process=function(element,collection){var group;element.is("option")?query.matcher(term,element.text(),element)&&collection.push(self.optionToData(element)):element.is("optgroup")&&(group=self.optionToData(element),element.children().each2(function(i,elm){process(elm,group.children)}),0<group.children.length)&&collection.push(group)},children=element.children();(children=this.getPlaceholder()!==undefined&&0<children.length&&(placeholderOption=this.getPlaceholderOption())?children.not(placeholderOption):children).each2(function(i,elm){process(elm,data.results)}),query.callback(data)}),opts.id=function(e){return e.id}):"query"in opts||("ajax"in opts?((select=opts.element.data("ajax-url"))&&0<select.length&&(opts.ajax.url=select),opts.query=ajax.call(opts.element,opts.ajax)):"data"in opts?opts.query=local(opts.data):"tags"in opts&&(opts.query=tags(opts.tags),opts.createSearchChoice===undefined&&(opts.createSearchChoice=function(term){return{id:$.trim(term),text:$.trim(term)}}),opts.initSelection===undefined)&&(opts.initSelection=function(element,callback){var data=[];$(splitVal(element.val(),opts.separator)).each(function(){var obj={id:this,text:this},tags=opts.tags;$.isFunction(tags)&&(tags=tags()),$(tags).each(function(){if(equal(this.id,obj.id))return obj=this,!1}),data.push(obj)}),callback(data)})),"function"!=typeof opts.query)throw"query function not defined for Select2 "+opts.element.attr("id");if("top"===opts.createSearchChoicePosition)opts.createSearchChoicePosition=function(list,item){list.unshift(item)};else if("bottom"===opts.createSearchChoicePosition)opts.createSearchChoicePosition=function(list,item){list.push(item)};else if("function"!=typeof opts.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return opts},monitorSource:function(){var observer,el=this.opts.element,self=this;el.on("change.select2",this.bind(function(e){!0!==this.opts.element.data("select2-change-triggered")&&this.initSelection()})),this._sync=this.bind(function(){var disabled=el.prop("disabled"),disabled=(this.enable(!(disabled=disabled===undefined?!1:disabled)),el.prop("readonly"));this.readonly(disabled=disabled===undefined?!1:disabled),syncCssClasses(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(evaluate(this.opts.containerCssClass,this.opts.element)),syncCssClasses(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(evaluate(this.opts.dropdownCssClass,this.opts.element))}),el.length&&el[0].attachEvent&&el.each(function(){this.attachEvent("onpropertychange",self._sync)}),(observer=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver)!==undefined&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new observer(function(mutations){$.each(mutations,self._sync)}),this.propertyObserver.observe(el.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(data){data=$.Event("select2-selecting",{val:this.id(data),object:data,choice:data});return this.opts.element.trigger(data),!data.isDefaultPrevented()},triggerChange:function(details){details=$.extend({},details=details||{},{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(details),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return!0===this.enabledInterface},enableInterface:function(){var enabled=this._enabled&&!this._readonly;return enabled!==this.enabledInterface&&(this.container.toggleClass("select2-container-disabled",!enabled),this.close(),this.enabledInterface=enabled,!0)},enable:function(enabled){this._enabled!==(enabled=enabled===undefined||enabled)&&(this._enabled=enabled,this.opts.element.prop("disabled",!enabled),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(enabled){this._readonly!==(enabled=enabled!==undefined&&enabled)&&(this._readonly=enabled,this.opts.element.prop("readonly",enabled),this.enableInterface())},opened:function(){return!!this.container&&this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var above,changeDirection,$dropdown=this.dropdown,offset=this.container.offset(),height=this.container.outerHeight(!1),width=this.container.outerWidth(!1),dropHeight=$dropdown.outerHeight(!1),$window=$(window),windowWidth=$window.width(),windowHeight=$window.height(),viewPortRight=$window.scrollLeft()+windowWidth,windowHeight=$window.scrollTop()+windowHeight,dropTop=offset.top+height,dropLeft=offset.left,windowHeight=dropTop+dropHeight<=windowHeight,enoughRoomAbove=offset.top-dropHeight>=$window.scrollTop(),dropWidth=$dropdown.outerWidth(!1),enoughRoomOnRight=dropLeft+dropWidth<=viewPortRight;$dropdown.hasClass("select2-drop-above")?(above=!0,!enoughRoomAbove&&windowHeight&&(above=!(changeDirection=!0))):(above=!1,!windowHeight&&enoughRoomAbove&&(above=changeDirection=!0)),changeDirection&&($dropdown.hide(),offset=this.container.offset(),height=this.container.outerHeight(!1),width=this.container.outerWidth(!1),dropHeight=$dropdown.outerHeight(!1),viewPortRight=$window.scrollLeft()+windowWidth,$window.scrollTop(),dropTop=offset.top+height,enoughRoomOnRight=(dropLeft=offset.left)+(dropWidth=$dropdown.outerWidth(!1))<=viewPortRight,$dropdown.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(windowHeight=$(".select2-results",$dropdown)[0],$dropdown.addClass("select2-drop-auto-width"),$dropdown.css("width",""),width<(dropWidth=$dropdown.outerWidth(!1)+(windowHeight.scrollHeight===windowHeight.clientHeight?0:scrollBarDimensions.width))?width=dropWidth:dropWidth=width,dropHeight=$dropdown.outerHeight(!1),enoughRoomOnRight=dropLeft+dropWidth<=viewPortRight):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(dropTop-=(enoughRoomAbove=this.body.offset()).top,dropLeft-=enoughRoomAbove.left),changeDirection={left:dropLeft=enoughRoomOnRight?dropLeft:offset.left+this.container.outerWidth(!1)-dropWidth,width:width},above?(changeDirection.top=offset.top-dropHeight,changeDirection.top<5&&($window=(windowWidth=$dropdown.find(".select2-results")).height()+changeDirection.top-5,windowWidth.css("max-height",$window+"px"),changeDirection.top=5),changeDirection.bottom="auto",this.container.addClass("select2-drop-above"),$dropdown.addClass("select2-drop-above")):(changeDirection.top=dropTop,changeDirection.bottom="auto",this.container.removeClass("select2-drop-above"),$dropdown.removeClass("select2-drop-above")),changeDirection=$.extend(changeDirection,evaluate(this.opts.dropdownCss,this.opts.element)),$dropdown.css(changeDirection)},shouldOpen:function(){var event;return!this.opened()&&!1!==this._enabled&&!0!==this._readonly&&(event=$.Event("select2-opening"),this.opts.element.trigger(event),!event.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return!!this.shouldOpen()&&(this.opening(),$document.on("mousemove.select2Event",function(e){lastMousePosition.x=e.pageX,lastMousePosition.y=e.pageY}),!0)},opening:function(){var mask,cid=this.containerEventName,scroll="scroll."+cid,resize="resize."+cid,orient="orientationchange."+cid,that=(this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last(
2050)[0]&&this.dropdown.detach().appendTo(this.body),0==(mask=$("#select2-drop-mask")).length&&((mask=$(document.createElement("div"))).attr("id","select2-drop-mask").attr("class","select2-drop-mask"),mask.hide(),mask.appendTo(this.body),mask.on("mousedown touchstart click",function(e){reinsertElement(mask);var dropdown=$("#select2-drop");0<dropdown.length&&((dropdown=dropdown.data("select2")).opts.selectOnBlur&&dropdown.selectHighlighted({noFocus:!0}),dropdown.close(),e.preventDefault(),e.stopPropagation())})),this.dropdown.prev()[0]!==mask[0]&&this.dropdown.before(mask),$("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),mask.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),this);this.container.parents().add(window).each(function(){$(this).on(resize+" "+scroll+" "+orient,function(e){that.opened()&&that.positionDropdown()})})},close:function(){var cid,scroll,resize,orient;this.opened()&&(cid=this.containerEventName,scroll="scroll."+cid,resize="resize."+cid,orient="orientationchange."+cid,this.container.parents().add(window).each(function(){$(this).off(scroll).off(resize).off(orient)}),this.clearDropdownAlignmentPreference(),$("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),$document.off("mousemove.select2Event"),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger($.Event("select2-close")))},externalSearch:function(term){this.open(),this.search.val(term),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return evaluate(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var child,hb,children,topOffset,results=this.results,index=this.highlight();index<0||(0==index?results.scrollTop(0):(children=this.findHighlightableChoices().find(".select2-result-label"),hb=(topOffset=((child=$(children[index])).offset()||{}).top||0)+child.outerHeight(!0),index===children.length-1&&0<(index=results.find("li.select2-more-results")).length&&(hb=index.offset().top+index.outerHeight(!0)),(children=results.offset().top+results.outerHeight(!0))<hb&&results.scrollTop(results.scrollTop()+(hb-children)),(index=topOffset-results.offset().top)<0&&"none"!=child.css("display")&&results.scrollTop(results.scrollTop()+index)))},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(delta){for(var choices=this.findHighlightableChoices(),index=this.highlight();-1<index&&index<choices.length;){var choice=$(choices[index+=delta]);if(choice.hasClass("select2-result-selectable")&&!choice.hasClass("select2-disabled")&&!choice.hasClass("select2-selected")){this.highlight(index);break}}},highlight:function(index){var choices=this.findHighlightableChoices();if(0===arguments.length)return indexOf(choices.filter(".select2-highlighted")[0],choices.get());(index=index>=choices.length?choices.length-1:index)<0&&(index=0),this.removeHighlight(),(choices=$(choices[index])).addClass("select2-highlighted"),this.search.attr("aria-activedescendant",choices.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(""),(index=choices.data("select2-data"))&&this.opts.element.trigger({type:"select2-highlight",val:this.id(index),choice:index})},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(event){var choices,event=$(event.target).closest(".select2-result-selectable");0<event.length&&!event.is(".select2-highlighted")?(choices=this.findHighlightableChoices(),this.highlight(choices.index(event))):0==event.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var results=this.results,more=results.find("li.select2-more-results"),page=this.resultsPage+1,self=this,term=this.search.val(),context=this.context;0!==more.length&&more.offset().top-results.offset().top-results.height()<=this.opts.loadMorePadding&&(more.addClass("select2-active"),this.opts.query({element:this.opts.element,term:term,page:page,context:context,matcher:this.opts.matcher,callback:this.bind(function(data){self.opened()&&(self.opts.populateResults.call(this,results,data.results,{term:term,page:page,context:context}),self.postprocessResults(data,!1,!1),!0===data.more?(more.detach().appendTo(results).text(evaluate(self.opts.formatLoadMore,self.opts.element,page+1)),window.setTimeout(function(){self.loadMoreIfNeeded()},10)):more.remove(),self.positionDropdown(),self.resultsPage=page,self.context=data.context,this.opts.element.trigger({type:"select2-loaded",items:data}))})}))},tokenize:function(){},updateResults:function(initial){var queryNumber,search=this.search,results=this.results,opts=this.opts,self=this,term=search.val(),lastTerm=$.data(this.container,"select2-last-term");function postRender(){search.removeClass("select2-active"),self.positionDropdown(),results.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?self.liveRegion.text(results.text()):self.liveRegion.text(self.opts.formatMatches(results.find(".select2-result-selectable").length))}function render(html){results.html(html),postRender()}!0!==initial&&lastTerm&&equal(term,lastTerm)||($.data(this.container,"select2-last-term",term),(!0===initial||!1!==this.showSearchInput&&this.opened())&&(queryNumber=++this.queryCount,1<=(lastTerm=this.getMaximumSelectionSize())&&(term=this.data(),$.isArray(term))&&term.length>=lastTerm&&checkFormatter(opts.formatSelectionTooBig,"formatSelectionTooBig")?render("
2050<li class='select2-selection-limit'>"+evaluate(opts.formatSelectionTooBig,opts.element,lastTerm)+"</li>"):search.val().length<opts.minimumInputLength?(checkFormatter(opts.formatInputTooShort,"formatInputTooShort")?render("<li class='select2-no-results'>"+evaluate(opts.formatInputTooShort,opts.element,search.val(),opts.minimumInputLength)+"</li>"):render(""),initial&&this.showSearch&&this.showSearch(!0)):opts.maximumInputLength&&search.val().length>opts.maximumInputLength?checkFormatter(opts.formatInputTooLong,"formatInputTooLong")?render("<li class='select2-no-results'>"+evaluate(opts.formatInputTooLong,opts.element,search.val(),opts.maximumInputLength)+"</li>"):render(""):(opts.formatSearching&&0===this.findHighlightableChoices().length&&render("<li class='select2-searching'>"+evaluate(opts.formatSearching,opts.element)+"</li>"),search.addClass("select2-active"),this.removeHighlight(),(term=this.tokenize())!=undefined&&null!=term&&search.val(term),this.resultsPage=1,opts.query({element:opts.element,term:search.val(),page:this.resultsPage,context:null,matcher:opts.matcher,callback:this.bind(function(data){var def;queryNumber==this.queryCount&&(this.opened()?data.hasError!==undefined&&checkFormatter(opts.formatAjaxError,"formatAjaxError")?render("<li class='select2-ajax-error'>"+evaluate(opts.formatAjaxError,opts.element,data.jqXHR,data.textStatus,data.errorThrown)+"</li>"):(this.context=data.context===undefined?null:data.context,this.opts.createSearchChoice&&""!==search.val()&&(def=this.opts.createSearchChoice.call(self,search.val(),data.results))!==undefined&&null!==def&&self.id(def)!==undefined&&null!==self.id(def)&&0===$(data.results).filter(function(){return equal(self.id(this),self.id(def))}).length&&this.opts.createSearchChoicePosition(data.results,def),0===data.results.length&&checkFormatter(opts.formatNoMatches,"formatNoMatches")?render("<li class='select2-no-results'>"+evaluate(opts.formatNoMatches,opts.element,search.val())+"</li>"):(results.empty(),self.opts.populateResults.call(this,results,data.results,{term:search.val(),page:this.resultsPage,context:null}),!0===data.more&&checkFormatter(opts.formatLoadMore,"formatLoadMore")&&(results.append("<li class='select2-more-results'>"+opts.escapeMarkup(evaluate(opts.formatLoadMore,opts.element,this.resultsPage))+"</li>"),window.setTimeout(function(){self.loadMoreIfNeeded()},10)),this.postprocessResults(data,initial),postRender(),this.opts.element.trigger({type:"select2-loaded",items:data}))):this.search.removeClass("select2-active"))})}))))},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){var $el;($el=this.search)[0]!==document.activeElement&&window.setTimeout(function(){var el=$el[0],pos=$el.val().length;$el.focus(),(0<el.offsetWidth||0<el.offsetHeight)&&el===document.activeElement&&(el.setSelectionRange?el.setSelectionRange(pos,pos):el.createTextRange&&((pos=el.createTextRange()).collapse(!1),pos.select()))},0)},selectHighlighted:function(options){var index,data;this._touchMoved?this.clearTouchMoved():(index=this.highlight(),(data=this.results.find(".select2-highlighted").closest(".select2-result").data("select2-data"))?(this.highlight(index),this.onSelect(data,options)):options&&options.noFocus&&this.close())},getPlaceholder:function(){var placeholderOption;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((placeholderOption=this.getPlaceholderOption())!==undefined?placeholderOption.text():undefined)},getPlaceholderOption:function(){var firstOption;if(this.select)return firstOption=this.select.children("option").first(),this.opts.placeholderOption!==undefined?"first"===this.opts.placeholderOption&&firstOption||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select):""===$.trim(firstOption.text())&&""===firstOption.val()?firstOption:void 0},initContainerWidth:function(){var width=function(){var style,attrs,matches,i,l;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"!==this.opts.width&&"resolve"!==this.opts.width)return $.isFunction(this.opts.width)?this.opts.width():this.opts.width;if((style=this.opts.element.attr("style"))!==undefined)for(i=0,l=(attrs=style.split(";")).length;i<l;i+=1)if(null!==(matches=attrs[i].replace(/\s/g,"").match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i))&&1<=matches.length)return matches[1];return"resolve"===this.opts.width?0<(style=this.opts.element.css("width")).indexOf("%")?style:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px":null}.call(this);null!==width&&this.container.css("width",width)}}),SingleSelect2=clazz(AbstractSelect2,{createContainer:function(){var labelAriaLabel=this.opts.element.attr("aria-label");return $(document.createElement("div")).attr({class:"select2-container"}).html(["<input class='select2-focusser select2-offscreen' type='text' role='combobox' aria-expanded='false' aria-controls='select2-drop'/>","<a href='javascript:void(0)' class='select2-choice' tabindex='-1' aria-hidden='true' role='button'>"," <span class='select2-chosen'> </span>"," <span class='select2-arrow' aria-hidden='true'><b></b></span>","</a>","<abbr role='button' class='select2-search-choice-close' tabindex='0' "+(this.opts.clearAriaLabel?"aria-label='"+this.opts.clearAriaLabel+"'":"")+"></abbr>","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'",labelAriaLabel?"aria-label='"+labelAriaLabel+"'":"","></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox' aria-label='select2-results'>"," </ul>","</div>"].join(""))},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var el,range;0<=this.opts.minimumResultsForSearch&&this.showSearch(!0),this.parent.opening.apply(this,arguments),!1!==this.showSearchInput&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),(el=this.search.get(0)).createTextRange?((range=el.createTextRange()).collapse(!1),range.select()):el.
2050setSelectionRange&&(range=this.search.val().length,el.setSelectionRange(range,range))),""===this.search.val()&&this.nextSearchTerm!=undefined&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger($.Event("select2-open")),this.container.find("input")[0].ariaExpanded=!0},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus(),this.container.find("input")[0].ariaExpanded=!1)},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){$("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),cleanupJQueryElements.call(this,"selection","focusser")},initContainer:function(){var selection,container=this.container,dropdown=this.dropdown,idSuffix=nextUid(),idSuffix=(this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=selection=container.find(".select2-choice"),this.focusser=container.find(".select2-focusser"),selection.find(".select2-chosen").attr("id","select2-chosen-"+idSuffix),this.focusser.attr("aria-labelledby","select2-chosen-"+idSuffix),this.results.attr("id","select2-results-"+idSuffix),this.search.attr("aria-owns","select2-results-"+idSuffix),this.opts.element.attr("aria-required")&&this.focusser.attr("aria-required",this.opts.element.attr("aria-required")),this.focusser.attr("id","s2id_autogen"+idSuffix),this.originalLabel=$("label[for='"+this.opts.element.attr("id")+"']"),this.originalLabel.length&&(this.originalLabel.attr("for",this.focusser.attr("id")),idSuffix=this.originalLabel.attr("id")||this.focusser.attr("id")+"-label",this.originalLabel.attr("id",idSuffix),this.focusser.attr("aria-labelledby",this.focusser.attr("aria-labelledby")+" "+this.originalLabel.attr("id"))),this.opts.element.attr("title")),clearValue=(this.opts.element.attr("title",idSuffix||this.originalLabel.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text($("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&229!=e.keyCode)if(e.which===KEY.PAGE_UP||e.which===KEY.PAGE_DOWN)killEvent(e);else switch(e.which){case KEY.UP:case KEY.DOWN:return this.moveHighlight(e.which===KEY.UP?-1:1),void killEvent(e);case KEY.ENTER:return this.selectHighlighted(),void killEvent(e);case KEY.TAB:return void this.selectHighlighted({noFocus:!0});case KEY.ESC:return this.cancel(e),void killEvent(e)}})),this.search.on("blur",this.bind(function(e){document.activeElement===this.body.get(0)&&e.relatedTarget&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==KEY.TAB&&!KEY.isControl(e)&&!KEY.isFunctionKey(e)&&e.which!==KEY.ESC){if(!1!==this.opts.openOnEnter||e.which!==KEY.ENTER)return e.which==KEY.DOWN||e.which==KEY.ENTER&&this.opts.openOnEnter?e.altKey||e.ctrlKey||e.shiftKey||e.metaKey?void 0:(this.open(),void killEvent(e)):void(e.which!=KEY.DELETE&&e.which!=KEY.BACKSPACE||(this.opts.allowClear&&this.clear(),killEvent(e)));killEvent(e)}})),installKeyUpChangeEvent(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){0<=this.opts.minimumResultsForSearch&&(e.stopPropagation(),this.opened()||this.open())})),this.bind(function(e){this.isInterfaceEnabled()&&(this.clear(),(e=e).preventDefault(),e.stopImmediatePropagation(),this.close(),this.selection.focus())}));container.on("mousedown touchstart","abbr",clearValue).on("keydown","abbr",function(e){switch(e.which){case KEY.ENTER:case KEY.SPACE:clearValue(e)}}),selection.on("mousedown touchstart",this.bind(function(e){reinsertElement(selection),this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),killEvent(e)})),dropdown.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),selection.on("focus",this.bind(function(e){killEvent(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger($.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.opts.element.attr("aria-hidden","true"),this.setPlaceholder()},clear:function(triggerChange){var evt,data=this.selection.data("select2-data");data&&(evt=$.Event("select2-clearing"),this.opts.element.trigger(evt),evt.isDefaultPrevented()||(evt=this.getPlaceholderOption(),this.opts.element.val(evt?evt.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),!1!==triggerChange&&(this.opts.element.trigger({type:"select2-removed",val:this.id(data),choice:data}),this.triggerChange({removed:data}))))},initSelection:function(){var self;this.isPlaceholderOptionSelected()?(this.updateSelection(null),this.close(),this.setPlaceholder()):(self=this).opts.initSelection.call(null,this.opts.element,function(selected){selected!==undefined&&null!==selected&&(self.updateSelection(selected),self.close(),self.setPlaceholder(),self.nextSearchTerm=self.opts.nextSearchTerm(selected,self.search.val()))})},isPlaceholderOptionSelected:function(){var placeholderOption;return this.getPlaceholder()!==undefined&&((placeholderOption=this.getPlaceholderOption())!==undefined&&placeholderOption.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===undefined||null===this.opts.element.val())},prepareOpts:function(){var opts=this.parent.prepareOpts.apply(this,arguments),self=this;return"select"===opts.element.get(0).tagName.toLowerCase()?opts.initSelection=function(element,callback){element=element.find("option").filter(function(){return this.selected&&!this.disabled});callback(self.optionToData(element))}
2050:"data"in opts&&(opts.initSelection=opts.initSelection||function(element,callback){var id=element.val(),match=null;opts.query({matcher:function(term,text,el){var is_match=equal(id,opts.id(el));return is_match&&(match=el),is_match},callback:$.isFunction(callback)?function(){callback(match)}:$.noop})}),opts},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===undefined?undefined:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var placeholder=this.getPlaceholder();!this.isPlaceholderOptionSelected()||placeholder===undefined||this.select&&this.getPlaceholderOption()===undefined||(this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(placeholder)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear"))},postprocessResults:function(data,initial,noHighlightUpdate){var selected=0,self=this;this.findHighlightableChoices().each2(function(i,elm){if(equal(self.id(elm.data("select2-data")),self.opts.element.val()))return selected=i,!1}),!1!==noHighlightUpdate&&(!0===initial&&0<=selected?this.highlight(selected):this.highlight(0)),!0===initial&&0<=(noHighlightUpdate=this.opts.minimumResultsForSearch)&&this.showSearch(function countResults(results){var count=0;return $.each(results,function(i,item){item.children?count+=countResults(item.children):count++}),count}(data.results)>=noHighlightUpdate)},showSearch:function(showSearchInput){this.showSearchInput!==showSearchInput&&(this.showSearchInput=showSearchInput,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!showSearchInput),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!showSearchInput),$(this.dropdown,this.container).toggleClass("select2-with-searchbox",showSearchInput))},onSelect:function(data,options){var old,oldData;this.triggerSelect(data)&&(old=this.opts.element.val(),oldData=this.data(),this.opts.element.val(this.id(data)),this.updateSelection(data),this.opts.element.trigger({type:"select2-selected",val:this.id(data),choice:data}),this.nextSearchTerm=this.opts.nextSearchTerm(data,this.search.val()),this.close(),options&&options.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),equal(old,this.id(data))||this.triggerChange({added:data,removed:oldData}))},updateSelection:function(data){var formatted,container=this.selection.find(".select2-chosen");this.selection.data("select2-data",data),container.empty(),(formatted=null!==data?this.opts.formatSelection(data,container,this.opts.escapeMarkup):formatted)!==undefined&&container.append(formatted),(formatted=this.opts.formatSelectionCssClass(data,container))!==undefined&&container.addClass(formatted),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==undefined&&this.container.addClass("select2-allowclear")},val:function(){var val,triggerChange=!1,data=null,self=this,oldData=this.data();if(0===arguments.length)return this.opts.element.val();if(val=arguments[0],1<arguments.length&&(triggerChange=arguments[1]),this.select)this.select.val(val).find("option").filter(function(){return this.selected}).each2(function(i,elm){return data=self.optionToData(elm),!1}),this.updateSelection(data),this.setPlaceholder(),triggerChange&&this.triggerChange({added:data,removed:oldData});else if(val||0===val){if(this.opts.initSelection===undefined)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(val),this.opts.initSelection(this.opts.element,function(data){self.opts.element.val(data?self.id(data):""),self.updateSelection(data),self.setPlaceholder(),triggerChange&&self.triggerChange({added:data,removed:oldData})})}else this.clear(triggerChange)},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(value){var data,triggerChange=!1;if(0===arguments.length)return data=(data=this.selection.data("select2-data"))==undefined?null:data;1<arguments.length&&(triggerChange=arguments[1]),value?(data=this.data(),this.opts.element.val(value?this.id(value):""),this.updateSelection(value),triggerChange&&this.triggerChange({added:value,removed:data})):this.clear(triggerChange)}}),MultiSelect2=clazz(AbstractSelect2,{createContainer:function(){var labelAriaLabel=this.opts.element.attr("aria-label");return $(document.createElement("div")).attr({class:"select2-container select2-container-multi"}).html(["<ul class='select2-choices' role='presentation'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen' ",labelAriaLabel?"aria-label='"+labelAriaLabel+"'":"","></label>"," <input type='text' role='combobox' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' aria-autocomplete='list' aria-controls='select2-drop'/>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results' role='listbox' aria-label='select2-results'>"," </ul>","</div>"].join(""))},prepareOpts:function(){var opts=this.parent.prepareOpts.apply(this,arguments),self=this;return"select"===opts.element.get(0).tagName.toLowerCase()?opts.initSelection=function(element,callback){var data=[];element.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(i,elm){data.push(self.optionToData(elm))}),callback(data)}
2050:"data"in opts&&(opts.initSelection=opts.initSelection||function(element,callback){var ids=splitVal(element.val(),opts.separator),matches=[];opts.query({matcher:function(term,text,el){var is_match=$.grep(ids,function(id){return equal(id,opts.id(el))}).length;return is_match&&matches.push(el),is_match},callback:$.isFunction(callback)?function(){for(var ordered=[],i=0;i<ids.length;i++)for(var id=ids[i],j=0;j<matches.length;j++){var match=matches[j];if(equal(id,opts.id(match))){ordered.push(match),matches.splice(j,1);break}}callback(ordered)}:$.noop})}),opts},selectChoice:function(choice){var selected=this.container.find(".select2-search-choice-focus");selected.length&&choice&&choice[0]==selected[0]||(selected.length&&this.opts.element.trigger("choice-deselected",selected),selected.removeClass("select2-search-choice-focus"),choice&&choice.length&&(this.close(),choice.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",choice),this.liveRegion.text(choice.text())))},destroy:function(){$("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),cleanupJQueryElements.call(this,"searchContainer","selection")},initContainer:function(){var selection,selector=".select2-choices",_this=(this.searchContainer=this.container.find(".select2-search-field"),this.selection=selection=this.container.find(selector),this);this.selection.on("click",".select2-search-choice:not(.select2-locked)",function(e){_this.search[0].focus(),_this.selectChoice($(this))}),this.search.attr("id","s2id_autogen"+nextUid()),this.results.attr("id",this.search.attr("id")+"_results"),this.search.attr("aria-owns",this.results.attr("id")),this.originalLabel=$("label[for='"+this.opts.element.attr("id")+"']"),this.originalLabel.length&&this.originalLabel.attr("for",this.search.attr("id")),this.opts.element.attr("aria-required")&&this.search.attr("aria-required",this.opts.element.attr("aria-required")),this.search.on("input paste",this.bind(function(){this.search.attr("placeholder")&&0==this.search.val().length||!this.isInterfaceEnabled()||this.opened()||this.open()})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){++this.keydowns;var offset,length,sel,selected=selection.find(".select2-search-choice-focus"),prev=selected.prev(".select2-search-choice:not(.select2-locked)"),next=selected.next(".select2-search-choice:not(.select2-locked)"),el=(el=this.search,length=offset=0,"selectionStart"in(el=$(el)[0])?(offset=el.selectionStart,length=el.selectionEnd-offset):"selection"in document&&(el.focus(),sel=document.selection.createRange(),length=document.selection.createRange().text.length,sel.moveStart("character",-el.value.length),offset=sel.text.length-length),{offset:offset,length:length});if(!selected.length||e.which!=KEY.LEFT&&e.which!=KEY.RIGHT&&e.which!=KEY.BACKSPACE&&e.which!=KEY.DELETE&&e.which!=KEY.ENTER)if((e.which!==KEY.BACKSPACE||1!=this.keydowns)&&e.which!=KEY.LEFT||0!=el.offset||el.length){if(this.selectChoice(null),this.opened())switch(e.which){case KEY.UP:case KEY.DOWN:return this.moveHighlight(e.which===KEY.UP?-1:1),void killEvent(e);case KEY.ENTER:return this.selectHighlighted(),void killEvent(e);case KEY.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case KEY.ESC:return this.cancel(e),void killEvent(e)}if(e.which!==KEY.TAB&&!KEY.isControl(e)&&!KEY.isFunctionKey(e)&&e.which!==KEY.BACKSPACE&&e.which!==KEY.ESC){if(e.which===KEY.ENTER){if(!1===this.opts.openOnEnter)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),e.which!==KEY.PAGE_UP&&e.which!==KEY.PAGE_DOWN||killEvent(e),e.which===KEY.ENTER&&killEvent(e)}}else this.selectChoice(selection.find(".select2-search-choice:not(.select2-locked)").last()),killEvent(e);else sel=selected,e.which==KEY.LEFT&&prev.length?sel=prev:e.which==KEY.RIGHT?sel=next.length?next:null:e.which===KEY.BACKSPACE?this.unselect(selected.first())&&(this.search.width(10),sel=prev.length?prev:next):e.which==KEY.DELETE?this.unselect(selected.first())&&(this.search.width(10),sel=next.length?next:null):e.which==KEY.ENTER&&(sel=null),this.selectChoice(sel),killEvent(e),sel&&sel.length||this.open()}})),this.search.on("keyup",this.bind(function(e){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),e.stopImmediatePropagation(),this.opts.element.trigger($.Event("select2-blur"))}
2050)),this.container.on("click",selector,this.bind(function(e){!this.isInterfaceEnabled()||0<$(e.target).closest(".select2-search-choice").length||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.open(),this.focusSearch(),e.preventDefault())})),this.container.on("focus",selector,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){var self;""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),!this.select&&""===this.opts.element.val()||(self=this).opts.initSelection.call(null,this.opts.element,function(data){data!==undefined&&null!==data&&(self.updateSelection(data),self.close(),self.clearSearch())})},clearSearch:function(){var placeholder=this.getPlaceholder(),maxWidth=this.getMaxSearchWidth();placeholder!==undefined&&0===this.getVal().length&&!1===this.search.hasClass("select2-focused")?(this.search.val(placeholder).addClass("select2-default"),this.search.width(0<maxWidth?maxWidth:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=undefined&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger($.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(data){var ids=[],filtered=[],self=this;$(data).each(function(){indexOf(self.id(this),ids)<0&&(ids.push(self.id(this)),filtered.push(this))}),data=filtered,this.selection.find(".select2-search-choice").remove(),$(data).each(function(){self.addSelectedChoice(this)}),self.postprocessResults()},tokenize:function(){var input=this.search.val();null!=(input=this.opts.tokenizer.call(this,input,this.data(),this.bind(this.onSelect),this.opts))&&input!=undefined&&(this.search.val(input),0<input.length)&&this.open()},onSelect:function(data,options){var describedString;this.triggerSelect(data)&&""!==data.text&&(this.addSelectedChoice(data),this.opts.element.trigger({type:"selected",val:this.id(data),choice:data}),this.nextSearchTerm=this.opts.nextSearchTerm(data,this.search.val()),this.clearSearch(),this.updateResults(),describedString=this.getVal().map(function(val){return this.search.attr("id")+"_choice_"+val},this).join(" "),this.search.attr("aria-describedby",describedString),!this.select&&this.opts.closeOnSelect||this.postprocessResults(data,!1,!0===this.opts.closeOnSelect),!this.opts.closeOnSelect&&0<this.countSelectableResults()?(this.search.width(10),this.resizeSearch(),0<this.getMaximumSelectionSize()&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=undefined&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:data}),options&&options.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(data){var formatted,enableChoice=!data.locked,enabledItem=$("<li class='select2-search-choice'> <div></div> <a href='#' role='button' class='select2-search-choice-close' tabindex='-1'></a></li>"),disabledItem=$("<li class='select2-search-choice select2-locked'><div></div></li>"),enabledItem=enableChoice?enabledItem:disabledItem,disabledItem=this.id(data),val=this.getVal();enabledItem.attr("id",this.search.attr("id")+"_choice_"+disabledItem),(formatted=this.opts.formatSelection(data,enabledItem.find("div"),this.opts.escapeMarkup))!=undefined&&enabledItem.find("div").replaceWith("<div>"+formatted+"</div>"),(formatted=this.opts.formatSelectionCssClass(data,enabledItem.find("div")))!=undefined&&enabledItem.addClass(formatted),enableChoice&&enabledItem.find(".select2-search-choice-close").on("mousedown",killEvent).on("click dblclick",this.bind(function(e){this.isInterfaceEnabled()&&(this.unselect($(e.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),killEvent(e),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),enabledItem.data("select2-data",data),enabledItem.insertBefore(this.searchContainer),val.push(disabledItem),this.setVal(val)},unselect:function(selected){var data,index,val=this.getVal();if(0===(selected=selected.closest(".select2-search-choice")).length)throw"Invalid argument: "+selected+". Must be .select2-search-choice";if(data=selected.data("select2-data")){var evt=$.Event("select2-removing");if(evt.val=this.id(data),evt.choice=data,this.opts.element.trigger(evt),evt.isDefaultPrevented())return!1;for(;0<=(index=indexOf(this.id(data),val));)val.splice(index,1),this.setVal(val),this.select&&this.postprocessResults();return selected.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(data),choice:data}),this.triggerChange({removed:data}),!0}},postprocessResults:function(data,initial,noHighlightUpdate){var val=this.getVal(),choices=this.results.find(".select2-result"),compound=this.results.find(".select2-result-with-children"),self=this;choices.each2(function(i,choice){0<=indexOf(self.id(choice.data("select2-data")),val)&&(choice.addClass("select2-selected"),choice.find(".select2-result-selectable").addClass("select2-selected"))}),compound.each2(function(i,choice){choice.is(".select2-result-selectable")||0!==choice.f
2050ind(".select2-result-selectable:not(.select2-selected)").length||choice.addClass("select2-selected")}),-1==this.highlight()&&!1!==noHighlightUpdate&&self.highlight(0),!this.opts.createSearchChoice&&0<!choices.filter(".select2-result:not(.select2-selected)").length&&(data&&(data.more||0!==this.results.find(".select2-no-results").length)||checkFormatter(self.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+evaluate(self.opts.formatNoMatches,self.opts.element,self.search.val())+"</li>"))},getMaxSearchWidth:function(){return this.selection.width()-getSideBorderPadding(this.search)},resizeSearch:function(){var maxWidth,e,style,sideBorderPadding=getSideBorderPadding(this.search);e=this.search,sizer||(style=e[0].currentStyle||window.getComputedStyle(e[0],null),(sizer=$(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:style.fontSize,fontFamily:style.fontFamily,fontStyle:style.fontStyle,fontWeight:style.fontWeight,letterSpacing:style.letterSpacing,textTransform:style.textTransform,whiteSpace:"nowrap"})).attr("class","select2-sizer"),$("body").append(sizer)),sizer.text(e.val()),style=sizer.width()+10,e=this.search.offset().left,(e=(e=(e=(maxWidth=this.selection.width())-(e-this.selection.offset().left)-sideBorderPadding)<style?maxWidth-sideBorderPadding:e)<40?maxWidth-sideBorderPadding:e)<=0&&(e=style),this.search.width(Math.floor(e))},getVal:function(){var val;return this.select?null===(val=this.select.val())?[]:val:splitVal(val=this.opts.element.val(),this.opts.separator)},setVal:function(val){var unique;this.select?this.select.val(val):(unique=[],$(val).each(function(){indexOf(this,unique)<0&&unique.push(this)}),this.opts.element.val(0===unique.length?"":unique.join(this.opts.separator)))},buildChangeDetails:function(old,current){for(var current=current.slice(0),old=old.slice(0),i=0;i<current.length;i++)for(var j=0;j<old.length;j++)equal(this.opts.id(current[i]),this.opts.id(old[j]))&&(current.splice(i,1),0<i&&i--,old.splice(j,1),j--);return{added:current,removed:old}},val:function(val,triggerChange){var oldData,self=this;if(0===arguments.length)return this.getVal();if((oldData=this.data()).length||(oldData=[]),val||0===val){if(this.setVal(val),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),triggerChange&&this.triggerChange(this.buildChangeDetails(oldData,this.data()));else{if(this.opts.initSelection===undefined)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(data){var ids=$.map(data,self.id);self.setVal(ids),self.updateSelection(data),self.clearSearch(),triggerChange&&self.triggerChange(self.buildChangeDetails(oldData,self.data()))})}this.clearSearch()}else this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),triggerChange&&this.triggerChange({added:this.data(),removed:oldData})},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var val=[],self=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){val.push(self.opts.id($(this).data("select2-data")))}),this.setVal(val),this.triggerChange()},data:function(values,triggerChange){var ids,old,self=this;if(0===arguments.length)return this.selection.children(".select2-search-choice").map(function(){return $(this).data("select2-data")}).get();old=this.data(),ids=$.map(values=values||[],function(e){return self.opts.id(e)}),this.setVal(ids),this.updateSelection(values),this.clearSearch(),triggerChange&&this.triggerChange(this.buildChangeDetails(old,this.data()))}}),$.fn.select2=function(){var select2,opts,value,multiple,args=Array.prototype.slice.call(arguments,0),allowedMethods=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],valueMethods=["opened","is
2050Focused","container","dropdown"],propertyMethods=["val","data"],methodsMap={search:"externalSearch"};return this.each(function(){if(0===args.length||"object"==typeof args[0])(opts=0===args.length?{}:$.extend({},args[0])).element=$(this),"select"===opts.element.get(0).tagName.toLowerCase()?multiple=opts.element.prop("multiple"):(multiple=opts.multiple||!1,"tags"in opts&&(opts.multiple=multiple=!0)),(select2=new(multiple?window.Select2.class.multi:window.Select2.class.single)).init(opts);else{if("string"!=typeof args[0])throw"Invalid arguments to select2 plugin: "+args;if(indexOf(args[0],allowedMethods)<0)throw"Unknown method: "+args[0];if(value=undefined,(select2=$(this).data("select2"))!==undefined)return opts=args[0],value="container"===opts?select2.container:"dropdown"===opts?select2.dropdown:select2[opts=methodsMap[opts]?methodsMap[opts]:opts].apply(select2,args.slice(1)),!(0<=indexOf(args[0],valueMethods)||0<=indexOf(args[0],propertyMethods)&&1==args.length)&&void 0}}),value===undefined?this:value},$.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(result,container,query,escapeMarkup){var markup=[];return markMatch(result.text,query.term,markup,escapeMarkup),markup.join("")},formatSelection:function(data,container,escapeMarkup){return data?escapeMarkup(data.text):undefined},sortResults:function(results,container,query){return results},formatResultCssClass:function(data){return data.css},formatSelectionCssClass:function(data,container){return undefined},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==undefined?null:e.id},matcher:function(term,text){return 0<=stripDiacritics(""+text).toUpperCase().indexOf(stripDiacritics(""+term).toUpperCase())},separator:",",tokenSeparators:[],tokenizer:function(input,selection,selectCallback,opts){var token,index,i,l,separator,original=input,dupe=!1;if(!opts.createSearchChoice||!opts.tokenSeparators||opts.tokenSeparators.length<1)return undefined;for(;;){for(index=-1,i=0,l=opts.tokenSeparators.length;i<l&&(separator=opts.tokenSeparators[i],!(0<=(index=input.indexOf(separator))));i++);if(index<0)break;if(token=input.substring(0,index),input=input.substring(index+separator.length),0<token.length&&(token=opts.createSearchChoice.call(this,token,selection))!==undefined&&null!==token&&opts.id(token)!==undefined&&null!==opts.id(token)){for(dupe=!1,i=0,l=selection.length;i<l;i++)if(equal(opts.id(token),opts.id(selection[i]))){dupe=!0;break}dupe||selectCallback(token)}}
2050return original!==input?input:void 0},escapeMarkup:defaultEscapeMarkup,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(c){return c},adaptDropdownCssClass:function(c){return null},nextSearchTerm:function(selectedObject,currentSearchTerm){return undefined},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(instance){return!(("ontouchstart"in window||0<navigator.msMaxTouchPoints)&&instance.opts.minimumResultsForSearch<0)}},$.fn.select2.locales=[],$.fn.select2.locales.en={formatMatches:function(matches){return 1===matches?"One result is available, press enter to select it.":matches+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(jqXHR,textStatus,errorThrown){return"Loading failed"},formatInputTooShort:function(input,min){min-=input.length;return"Please enter "+min+" or more character"+(1==min?"":"s")},formatInputTooLong:function(input,max){input=input.length-max;return"Please delete "+input+" character"+(1==input?"":"s")},formatSelectionTooBig:function(limit){return"You can only select "+limit+" item"+(1==limit?"":"s")},formatLoadMore:function(pageNumber){return"Loading more resultsâ¦"},formatSearching:function(){return"Searchingâ¦"}},$.extend($.fn.select2.defaults,$.fn.select2.locales.en),$.fn.select2.ajaxDefaults={transport:$.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:ajax,local:local,tags:tags},util:{debounce:debounce,markMatch:markMatch,escapeMarkup:defaultEscapeMarkup,stripDiacritics:stripDiacritics},class:{abstract:AbstractSelect2,single:SingleSelect2,multi:MultiSelect2}})}(jQuery); 2051/*! RESOURCE: /scripts/select2_translations.js */ 2052(function($) { 2053 if (!$ || !window.GwtMessage) { 2054 return; 2055 } 2056 function getMessage() { 2057 var gwt = new GwtMessage(); 2058 return gwt.getMessage.apply(gwt, arguments); 2059 } 2060 $.extend($.fn.select2.defaults, { 2061 formatMatches: function(matches) { 2062 return getMessage("{0} result(s) available, use up and down arrow keys to navigate and enter to select", matches); 2063 }, 2064 formatNoMatches: function() { 2065 return getMessage("No matches found"); 2066 }, 2067 formatAjaxError: function(jqXHR, textStatus, errorThrown) { 2068 return getMessage("Loading failed"); 2069 }, 2070 formatInputTooShort: function(input, min) { 2071 var n = min - input.length; 2072 return getMessage("Please enter {0} or more character(s)", n); 2073 }, 2074 formatInputTooLong: function(input, max) { 2075 var n = input.length - max; 2076 return getMessage("Please delete {0} character(s)", n); 2077 }, 2078 formatSelectionTooBig: function(limit) { 2079 return getMessage("You can only select {0} item(s)", limit); 2080 }, 2081 formatLoadMore: function(pageNumber) { 2082 return getMessage("Loading more resultsâ¦"); 2083 }, 2084 formatSearching: function() { 2085 return getMessage("Searchingâ¦"); 2086 } 2087 }); 2088})(jQuery); 2089; 2090/*! RESOURCE: /scripts/heisenberg/custom/selects.js */ 2091jQuery(function($) { 2092 "use strict"; 2093 window.NOW = window.NOW || {}; 2094 var $select2 = $('select.select2, select.sn-select-basic').not('select[readonly]'); 2095 $select2 2096 .each(function() { 2097 var required = $(this).prop('required'); 2098 if (required) 2099 $(this).addClass('required'); 2100 }) 2101 .select2(); 2102 $(window).bind('blur', function() { 2103 $select2.select2('close'); 2104 }); 2105}); 2106; 2107/*! RESOURCE: /scripts/heisenberg/custom/tabs.js */ 2108(function($) { 2109 "use strict"; 2110 $.fn.tabs = (function() { 2111 return function() { 2112 var $elem = this; 2113 var api = {}; 2114 $elem.data('sn.tabs', api); 2115 attachTabClickHandler($elem); 2116 attachFocusHandler($elem); 2117 attachKeyboardHandler($elem); 2118 }; 2119 function attachTabClickHandler($elem) { 2120 $elem.on('click', 'li, [data-toggle=tab], [data-toggle=segmented]', function (e) { 2121 var $el = $(this); 2122 var $tabLi, $tabTrigger; 2123 if ($el.is('li')) { 2124 $tabLi = $el; 2125 $tabTrigger = $el.find('[data-toggle]').first(); 2126 } else { 2127 $tabTrigger = $el; 2128 $tabLi = $el.closest('li'); 2129 } 2130 if ($tabLi.hasClass('disabled')) 2131 return; 2132 var $selectedTab = $tabLi.siblings('.active'); 2133 var $selectedTabTrigger = $selectedTab.find('[data-toggle]').first(); 2134 setTabDisplay($selectedTab, $selectedTabTrigger, false); 2135 setTabDisplay($tabLi, $tabTrigger, true); 2136 e.preventDefault(); 2137 }) 2138 } 2139 function attachFocusHandler($elem) { 2140 $elem.on('focusin focusout', '[data-toggle=tab], [data-toggle=segmented]', function(e) { 2141 var $el = $(this).closest('li'); 2142 switch (e.type) { 2143 case 'focusin': 2144 $el.addClass('focus'); 2145 break; 2146 case 'focusout': 2147 $el.removeClass('focus'); 2148 break; 2149 } 2150 }) 2151 } 2152 function attachKeyboardHandler($elem) { 2153 if ($elem.attr('aria-orientation') !== 'vertical') return; 2154 $elem.on('keydown', '[data-toggle=tab], [data-toggle=segmented]', function(e) { 2155 if (e.keyCode === 38 || e.keyCode === 40) { 2156 var $currTab = $(this).closest('li'); 2157 var $newTab = e.keyCode === 38 ? $currTab.prev() : $currTab.next(); 2158 if (!$newTab.length) return; 2159 var $newTabTrigger = $newTab.find('[data-toggle]').first(); 2160 var $selectedTab = $newTab.siblings('.active'); 2161 var $selectedTabTrigger = $selectedTab.find('[data-toggle]').first(); 2162 $newTabTrigger.focus(); 2163 setTabDisplay($selectedTab, $selectedTabTrigger, false); 2164 setTabDisplay($newTab, $newTabTrigger, true); 2165 e.preventDefault(); 2166 } 2167 }) 2168 } 2169 function setTabDisplay($tabLi, $tabTrigger, display) { 2170 $tabTrigger.attr('aria-selected', display ? 'true' : 'false'); 2171 var selector = $tabTrigger.data('tab-target') || $tabTrigger.attr('href'); 2172selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ''); 2173 var $tabpanel = $(selector); 2174 $tabpanel.attr('aria-hidden', display ? 'false' : 'true'); 2175 if (display) { 2176 $tabLi.addClass('active justselected'); 2177 $tabpanel.addClass('active'); 2178 $tabLi.one('focusout', function () { 2179 $tabLi.removeClass('justselected'); 2180 }) 2181 } else { 2182 $tabLi.removeClass('active'); 2183 $tabpanel.removeClass('active'); 2184 } 2185 } 2186 })(); 2187 $(function() { 2188 $('.sn-tabs-basic').each(function() { 2189 var $this = $(this); 2190 if (!$this.data('sn.tabs')) 2191 $this.tabs(); 2192 }); 2193 }); 2194})(jQuery); 2195; 2196/*! RESOURCE: /scripts/heisenberg/custom/tables.js */ 2197(function($) { 2198 "use strict"; 2199 $.fn.tableDetailRowHover = function() { 2200 this.each(function() { 2201 $(this) 2202 .on('mouseenter mouseleave', 'tr', function(evt) { 2203 var row = getTargetAdjRow($(this)); 2204 evt.type == 'mouseenter' 2205 ? row.addClass('hover') : row.removeClass('hover'); 2206 }); 2207 }) 2208 } 2209 function getTargetAdjRow(row) { 2210 return row.hasClass('detail-row') ? row.prev() : row.next(); 2211 } 2212})(jQuery); 2213jQuery(function($) { 2214 "use strict"; 2215 $('.detail-row:nth-child(2)').closest('table.table').addClass('table-detail-row'); 2216 $('.table-hover.table-detail-row').tableDetailRowHover(); 2217}); 2218; 2219/*! RESOURCE: /scripts/lib/tabbable/tabbable.js */ 2220(function() { 2221 window.tabbable = function(el, selectorList) { 2222 var basicTabbables = []; 2223 var orderedTabbables = []; 2224 var isHidden = createIsHidden(); 2225 var candidates = el.querySelectorAll(selectorList || 'input, select, a[href], textarea, button, [tabindex], [contenteditable]:not([contenteditable="false"])'); 2226 var candidate, candidateIndex; 2227 for (var i = 0, l = candidates.length; i < l; i++) { 2228 candidate = candidates[i]; 2229 candidateIndex = getTabindex(candidate); 2230 if ( 2231 candidateIndex < 0 2232 || (candidate.tagName === 'INPUT' && candidate.type === 'hidden') 2233 || candidate.disabled 2234 || isHidden(candidate) 2235 ) { 2236 continue; 2237 } 2238 if (candidateIndex === 0) { 2239 basicTabbables.push(candidate); 2240 } else { 2241 orderedTabbables.push({ 2242 tabIndex: candidateIndex, 2243 node: candidate, 2244 }); 2245 } 2246 } 2247 var tabbableNodes = orderedTabbables 2248 .sort(function(a, b) { 2249 return a.tabIndex - b.tabIndex; 2250 }) 2251 .map(function(a) { 2252 return a.node 2253 }); 2254 Array.prototype.push.apply(tabbableNodes, basicTabbables); 2255 return tabbableNodes; 2256 } 2257 function isContentEditable(node) { 2258 return node.contentEditable === "true"; 2259 } 2260 function getTabindex(node) { 2261 var tabindexAttr = parseInt(node.getAttribute('tabindex'), 10); 2262 if (!isNaN(tabindexAttr)) return tabindexAttr; 2263 if (isContentEditable(node)) return 0; 2264 return node.tabIndex; 2265 } 2266 function createIsHidden() { 2267 var nodeCache = []; 2268 return function isHidden(node) { 2269 if (node === document.documentElement || !node.tagName) return false;
2270 for (var i = 0, length = nodeCache.length; i < length; i++) { 2271 if (nodeCache[i][0] === node) return nodeCache[i][1]; 2272 } 2273 var result = false; 2274 var style = window.getComputedStyle(node); 2275 if (style.visibility === 'hidden' || style.display === 'none') { 2276 result = true; 2277 } else if (node.parentNode) { 2278 result = isHidden(node.parentNode); 2279 } 2280 nodeCache.push([node, result]); 2281 return result; 2282 } 2283 } 2284})(); 2285; 2286/*! RESOURCE: /scripts/lib/focus-trap/focus-trap.js */ 2287(function() { 2288 var listeningFocusTrap = null; 2289 function focusTrap(element, userOptions) { 2290 var tabbableNodes = []; 2291 var nodeFocusedBeforeActivation = null; 2292 var active = false; 2293 var container = (typeof element === 'string') 2294 ? document.querySelector(element) 2295 : element; 2296 var config = userOptions || {}; 2297 config.returnFocusOnDeactivate = (userOptions && userOptions.returnFocusOnDeactivate != undefined) 2298 ? userOptions.returnFocusOnDeactivate 2299 : true; 2300 config.escapeDeactivates = (userOptions && userOptions.escapeDeactivates != undefined) 2301 ? userOptions.escapeDeactivates 2302 : true; 2303 var trap = { 2304 activate: activate, 2305 deactivate: deactivate, 2306 pause: removeListeners, 2307 unpause: addListeners 2308 }; 2309 return trap; 2310 function activate(activateOptions) { 2311 var defaultedActivateOptions = { 2312 onActivate: (activateOptions && activateOptions.onActivate !== undefined) 2313 ? activateOptions.onActivate 2314 : config.onActivate, 2315 }; 2316 active = true; 2317 nodeFocusedBeforeActivation = getFocusedElement(); 2318 if (defaultedActivateOptions.onActivate) { 2319 defaultedActivateOptions.onActivate(); 2320 } 2321 addListeners(); 2322 return trap; 2323 } 2324 function deactivate(deactivateOptions) { 2325 var defaultedDeactivateOptions = { 2326 returnFocus: (deactivateOptions && deactivateOptions.returnFocus != undefined) 2327 ? deactivateOptions.returnFocus 2328 : config.returnFocusOnDeactivate, 2329 returnFocusTo: deactivateOptions && deactivateOptions.returnFocusTo, 2330 onDeactivate: (deactivateOptions && deactivateOptions.onDeactivate !== undefined) 2331 ? deactivateOptions.onDeactivate 2332 : config.onDeactivate, 2333 }; 2334 removeListeners(); 2335 if (defaultedDeactivateOptions.onDeactivate) { 2336 defaultedDeactivateOptions.onDeactivate(); 2337 } 2338 if (defaultedDeactivateOptions.returnFocus) { 2339 setTimeout(function() { 2340 tryFocus(defaultedDeactivateOptions.returnFocusTo || nodeFocusedBeforeActivation); 2341 }, 0); 2342 } 2343 active = false; 2344 return this; 2345 } 2346 function addListeners() { 2347 if (!active) return; 2348 if (listeningFocusTrap) { 2349 listeningFocusTrap.pause(); 2350 } 2351 listeningFocusTrap = trap; 2352 updateTabbableNodes(); 2353 tryFocus(firstFocusNode()); 2354 document.addEventListener('focus', checkFocus, true); 2355 document.addEventListener('click', checkClick, true); 2356 document.addEventListener('mousedown', checkPointerDown, true); 2357 document.addEventListener('touchstart', checkPointerDown, true); 2358 document.addEventListener('keydown', checkKey, true); 2359 return trap; 2360 } 2361 function removeListeners() { 2362 if (!active || !listeningFocusTrap) return; 2363 document.removeEventListener('focus', checkFocus, true); 2364 document.removeEventListener('click', checkClick, true); 2365 document.removeEventListener('mousedown', checkPointerDown, true); 2366 document.removeEventListener('touchstart', checkPointerDown, true); 2367 document.removeEventListener('keydown', checkKey, true); 2368 listeningFocusTrap = null; 2369 return trap; 2370 } 2371 function firstFocusNode() { 2372 var node; 2373 if (!config.initialFocus) { 2374 node = tabbableNodes[0]; 2375 if (!node) { 2376 throw new Error('You can\'t have a focus-trap without at least one focusable element'); 2377 } 2378 return node; 2379 } 2380 node = (typeof config.initialFocus === 'string') 2381 ? document.querySelector(config.initialFocus) 2382 : config.initialFocus; 2383 if (!node) { 2384 throw new Error('`initialFocus` refers to no known node'); 2385 } 2386 return node; 2387 } 2388 function checkPointerDown(e) { 2389 if (config.clickOutsideDeactivates) { 2390 deactivate({ returnFocus: false }); 2391 } 2392 } 2393 function checkClick(e) { 2394 if (config.clickOutsideDeactivates) return; 2395 var composedPath = getEventPath(e); 2396 if (composedPath.indexOf(container) >= 0) return; 2397 e.preventDefault(); 2398 e.stopImmediatePropagation(); 2399 } 2400 function checkFocus(e) { 2401 if (config.focusOutsideDeactivates === false) return; 2402 var composedPath = getEventPath(e); 2403 var target = composedPath[0]; 2404 if (composedPath.indexOf(container) >= 0) return; 2405 e.preventDefault(); 2406 e.stopImmediatePropagation(); 2407 target.blur(); 2408 } 2409 function checkKey(e) { 2410 if (e.key === 'Tab' || e.keyCode === 9) { 2411 handleTab(e); 2412 } 2413 if (config.escapeDeactivates !== false && isEscapeEvent(e)) { 2414 deactivate(); 2415 } 2416 } 2417 function handleTab(e) { 2418 e.preventDefault(); 2419 updateTabbableNodes(); 2420 var target = getEventPath(e)[0]; 2421 var currentFocusIndex = tabbableNodes.indexOf(target); 2422 var lastTabbableNode = tabbableNodes[tabbableNodes.length - 1]; 2423 var firstTabbableNode = tabbableNodes[0]; 2424 if (e.shiftKey) { 2425 if (target === firstTabbableNode || tabbableNodes.indexOf(target) === -1) { 2426 return tryFocus(lastTabbableNode); 2427 } 2428 return tryFocus(tabbableNodes[currentFocusIndex - 1]); 2429 } 2430 if (target === lastTabbableNode) return tryFocus(firstTabbableNode); 2431 tryFocus(tabbableNodes[currentFocusIndex + 1]); 2432 } 2433 function updateTabbableNodes() { 2434 tabbableNodes = tabbable(container); 2435 } 2436 } 2437 function isEscapeEvent(e) { 2438 return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27; 2439 } 2440 function tryFocus(node) { 2441 if (!node || !node.focus) return; 2442 node.focus(); 2443 if (node.tagName.toLowerCase() === 'input') { 2444 node.select(); 2445 } 2446 } 2447 function getFocusedElement() { 2448 var activeElement = document.activeElement; 2449 if (!activeElement || activeElement === document.body) { 2450 return; 2451 } 2452 var getShadowActiveElement = function(element) { 2453 if (element.shadowRoot && element.shadowRoot.activeElement) { 2454 element = getShadowActiveElement(element.shadowRoot.activeElement); 2455 } 2456 return element; 2457 }; 2458 return getShadowActiveElement(activeElement); 2459 } 2460 function getEventPath(evt) { 2461 return evt.path || (evt.composedPath && evt.composedPath()) || composedPath(evt.target); 2462 } 2463 2464 function composedPath(el) { 2465 var path = []; 2466 while (el) { 2467 if (el.shadowRoot) { 2468 if (el.shadowRoot.activeElement) { 2469 path.push(el.shadowRoot.activeElement); 2470 } 2471 path.push(el.shadowRoot); 2472 } 2473 path.push(el); 2474 if (el.tagName === 'HTML') { 2475 path.push(document); 2476 path.push(window); 2477 break; 2478 } 2479 el = el.parentElement; 2480 } 2481 return path; 2482 }
2483 window.focusTrap = focusTrap; 2484})(); 2485; 2486/*! RESOURCE: /scripts/heisenberg/custom/accessibility.js */ 2487jQuery(function($) { 2488 if (!window.WeakMap) 2489 return; 2490 window.NOW = window.NOW || {}; 2491 if (window.NOW.accessibilityJSLoaded) { 2492 return; 2493 } 2494 window.NOW.accessibilityJSLoaded = true; 2495 var $document = $(document), 2496 store = new WeakMap(); 2497 $document.on('show.bs.modal', function(evt) { 2498 var modal = evt.target, 2499 previouslyFocusedElement = document.activeElement; 2500 if (hasOptions(modal)) 2501 return; 2502 createOptions(modal); 2503 rememberTrigger(modal, previouslyFocusedElement); 2504 }); 2505 $document.on('hidden.bs.modal', function(evt) { 2506 var modal = evt.target; 2507 restoreTriggerFocus(modal); 2508 destroyOptions(modal); 2509 }); 2510 function createOptions(modal) { 2511 store.set(modal, {}); 2512 } 2513 function hasOptions(modal) { 2514 return !!store.get(modal); 2515 } 2516 function destroyOptions(modal) { 2517 store.delete(modal); 2518 } 2519 function getOption(modal, key) { 2520 var options = store.get(modal); 2521 return options && options[key]; 2522 } 2523 function setOption(modal, key, value) { 2524 var options = store.get(modal); 2525 if (options) { 2526 options[key] = value; 2527 } 2528 } 2529 function rememberTrigger(modal, triggerElement) { 2530 setOption(modal, 'trigger-element', triggerElement); 2531 } 2532 function restoreTriggerFocus(modal) { 2533 var $target = $(getOption(modal, 'trigger-element')); 2534 var isFocusable = function($el) { 2535 if ($el.filter(':visible').length > 0) { 2536 return $el[0].tabIndex > -1; 2537 } 2538 return false; 2539 } 2540 var tryFocus = function(el) { 2541 var $el = $(el); 2542 if (isFocusable($el)) { 2543 $el.focus(); 2544 return true; 2545 } 2546 return false; 2547 } 2548 do { 2549 if (tryFocus($target) || tryFocus($target.data('menu-trigger'))) { 2550 return; 2551 } 2552 $target = $target.parent(); 2553 } while ($target.length > 0); 2554 } 2555}); 2556; 2557; 2558/*! RESOURCE: /scripts/heisenberg/heisenberg_all.js */
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.