PageSourceSearch

https://www.biodiversidad.gob.ec/wp-content/themes/Sitio-32/js/bootstrap.js

js biodiversidad.gob.ec collected 2026-09-25 04:39:04 UTC 68,931 bytes, 2,364 lines download raw bytes

vendor: 23,243 bytes, lines 1-810
1/*!
2 * Bootstrap v3.3.5 (http://getbootstrap.com)
3 * Copyright 2011-2015 Twitter, Inc.
4 * Licensed under the MIT license
5 */
6
7if (typeof jQuery === 'undefined') {
8  throw new Error('Bootstrap\'s JavaScript requires jQuery')
9}
10
11+function ($) {
12  'use strict';
13  var version = $.fn.jquery.split(' ')[0].split('.')
14  if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
15    throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
16  }
17}(jQuery);
18
19/* ========================================================================
20 * Bootstrap: transition.js v3.3.5
21 * http://getbootstrap.com/javascript/#transitions
22 * ========================================================================
23 * Copyright 2011-2015 Twitter, Inc.
24 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
25 * ======================================================================== */
26
27
28+function ($) {
29  'use strict';
30
31  // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
32  // ============================================================
33
34  function transitionEnd() {
35    var el = document.createElement('bootstrap')
36
37    var transEndEventNames = {
38      WebkitTransition : 'webkitTransitionEnd',
39      MozTransition    : 'transitionend',
40      OTransition      : 'oTransitionEnd otransitionend',
41      transition       : 'transitionend'
42    }
43
44    for (var name in transEndEventNames) {
45      if (el.style[name] !== undefined) {
46        return { end: transEndEventNames[name] }
47      }
48    }
49
50    return false // explicit for ie8 (  ._.)
51  }
52
53  // http://blog.alexmaccaw.com/css-transitions
54  $.fn.emulateTransitionEnd = function (duration) {
55    var called = false
56    var $el = this
57    $(this).one('bsTransitionEnd', function () { called = true })
58    var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
59    setTimeout(callback, duration)
60    return this
61  }
62
63  $(function () {
64    $.support.transition = transitionEnd()
65
66    if (!$.support.transition) return
67
68    $.event.special.bsTransitionEnd = {
69      bindType: $.support.transition.end,
70      delegateType: $.support.transition.end,
71      handle: function (e) {
72        if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
73      }
74    }
75  })
76
77}(jQuery);
78
79/* ========================================================================
80 * Bootstrap: alert.js v3.3.5
81 * http://getbootstrap.com/javascript/#alerts
82 * ========================================================================
83 * Copyright 2011-2015 Twitter, Inc.
84 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
85 * ======================================================================== */
86
87
88+function ($) {
89  'use strict';
90
91  // ALERT CLASS DEFINITION
92  // ======================
93
94  var dismiss = '[data-dismiss="alert"]'
95  var Alert   = function (el) {
96    $(el).on('click', dismiss, this.close)
97  }
98
99  Alert.VERSION = '3.3.5'
100
101  Alert.TRANSITION_DURATION = 150
102
103  Alert.prototype.close = function (e) {
104    var $this    = $(this)
105    var selector = $this.attr('data-target')
106
107    if (!selector) {
108      selector = $this.attr('href')
109      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
110    }
111
112    var $parent = $(selector)
113
114    if (e) e.preventDefault()
115
116    if (!$parent.length) {
117      $parent = $this.closest('.alert')
118    }
119
120    $parent.trigger(e = $.Event('close.bs.alert'))
121
122    if (e.isDefaultPrevented()) return
123
124    $parent.removeClass('in')
125
126    function removeElement() {
127      // detach from parent, fire event then clean up data
128      $parent.detach().trigger('closed.bs.alert').remove()
129    }
130
131    $.support.transition && $parent.hasClass('fade') ?
132      $parent
133        .one('bsTransitionEnd', removeElement)
134        .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
135      removeElement()
136  }
137
138
139  // ALERT PLUGIN DEFINITION
140  // =======================
141
142  function Plugin(option) {
143    return this.each(function () {
144      var $this = $(this)
145      var data  = $this.data('bs.alert')
146
147      if (!data) $this.data('bs.alert', (data = new Alert(this)))
148      if (typeof option == 'string') data[option].call($this)
149    })
150  }
151
152  var old = $.fn.alert
153
154  $.fn.alert             = Plugin
155  $.fn.alert.Constructor = Alert
156
157
158  // ALERT NO CONFLICT
159  // =================
160
161  $.fn.alert.noConflict = function () {
162    $.fn.alert = old
163    return this
164  }
165
166
167  // ALERT DATA-API
168  // ==============
169
170  $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
171
172}(jQuery);
173
174/* ========================================================================
175 * Bootstrap: button.js v3.3.5
176 * http://getbootstrap.com/javascript/#buttons
177 * ========================================================================
178 * Copyright 2011-2015 Twitter, Inc.
179 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
180 * ======================================================================== */
181
182
183+function ($) {
184  'use strict';
185
186  // BUTTON PUBLIC CLASS DEFINITION
187  // ==============================
188
189  var Button = function (element, options) {
190    this.$element  = $(element)
191    this.options   = $.extend({}, Button.DEFAULTS, options)
192    this.isLoading = false
193  }
194
195  Button.VERSION  = '3.3.5'
196
197  Button.DEFAULTS = {
198    loadingText: 'loading...'
199  }
200
201  Button.prototype.setState = function (state) {
202    var d    = 'disabled'
203    var $el  = this.$element
204    var val  = $el.is('input') ? 'val' : 'html'
205    var data = $el.data()
206
207    state += 'Text'
208
209    if (data.resetText == null) $el.data('resetText', $el[val]())
210
211    // push to event loop to allow forms to submit
212    setTimeout($.proxy(function () {
213      $el[val](data[state] == null ? this.options[state] : data[state])
214
215      if (state == 'loadingText') {
216        this.isLoading = true
217        $el.addClass(d).attr(d, d)
218      } else if (this.isLoading) {
219        this.isLoading = false
220        $el.removeClass(d).removeAttr(d)
221      }
222    }, this), 0)
223  }
224
225  Button.prototype.toggle = function () {
226    var changed = true
227    var $parent = this.$element.closest('[data-toggle="buttons"]')
228
229    if ($parent.length) {
230      var $input = this.$element.find('input')
231      if ($input.prop('type') == 'radio') {
232        if ($input.prop('checked')) changed = false
233        $parent.find('.active').removeClass('active')
234        this.$element.addClass('active')
235      } else if ($input.prop('type') == 'checkbox') {
236        if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
237        this.$element.toggleClass('active')
238      }
239      $input.prop('checked', this.$element.hasClass('active'))
240      if (changed) $input.trigger('change')
241    } else {
242      this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
243      this.$element.toggleClass('active')
244    }
245  }
246
247
248  // BUTTON PLUGIN DEFINITION
249  // ========================
250
251  function Plugin(option) {
252    return this.each(function () {
253      var $this   = $(this)
254      var data    = $this.data('bs.button')
255      var options = typeof option == 'object' && option
256
257      if (!data) $this.data('bs.button', (data = new Button(this, options)))
258
259      if (option == 'toggle') data.toggle()
260      else if (option) data.setState(option)
261    })
262  }
263
264  var old = $.fn.button
265
266  $.fn.button             = Plugin
267  $.fn.button.Constructor = Button
268
269
270  // BUTTON NO CONFLICT
271  // ==================
272
273  $.fn.button.noConflict = function () {
274    $.fn.button = old
275    return this
276  }
277
278
279  // BUTTON DATA-API
280  // ===============
281
282  $(document)
283    .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
284      var $btn = $(e.target)
285      if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
286      Plugin.call($btn, 'toggle')
287      if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()
288    })
289    .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
290      $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
291    })
292
293}(jQuery);
294
295/* ========================================================================
296 * Bootstrap: carousel.js v3.3.5
297 * http://getbootstrap.com/javascript/#carousel
298 * ========================================================================
299 * Copyright 2011-2015 Twitter, Inc.
300 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
301 * ======================================================================== */
302
303
304+function ($) {
305  'use strict';
306
307  // CAROUSEL CLASS DEFINITION
308  // =========================
309
310  var Carousel = function (element, options) {
311    this.$element    = $(element)
312    this.$indicators = this.$element.find('.carousel-indicators')
313    this.options     = options
314    this.paused      = null
315    this.sliding     = null
316    this.interval    = null
317    this.$active     = null
318    this.$items      = null
319
320    this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
321
322    this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
323      .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
324      .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
325  }
326
327  Carousel.VERSION  = '3.3.5'
328
329  Carousel.TRANSITION_DURATION = 600
330
331  Carousel.DEFAULTS = {
332    interval: 5000,
333    pause: 'hover',
334    wrap: true,
335    keyboard: true
336  }
337
338  Carousel.prototype.keydown = function (e) {
339    if (/input|textarea/i.test(e.target.tagName)) return
340    switch (e.which) {
341      case 37: this.prev(); break
342      case 39: this.next(); break
343      default: return
344    }
345
346    e.preventDefault()
347  }
348
349  Carousel.prototype.cycle = function (e) {
350    e || (this.paused = false)
351
352    this.interval && clearInterval(this.interval)
353
354    this.options.interval
355      && !this.paused
356      && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
357
358    return this
359  }
360
361  Carousel.prototype.getItemIndex = function (item) {
362    this.$items = item.parent().children('.item')
363    return this.$items.index(item || this.$active)
364  }
365
366  Carousel.prototype.getItemForDirection = function (direction, active) {
367    var activeIndex = this.getItemIndex(active)
368    var willWrap = (direction == 'prev' && activeIndex === 0)
369                || (direction == 'next' && activeIndex == (this.$items.length - 1))
370    if (willWrap && !this.options.wrap) return active
371    var delta = direction == 'prev' ? -1 : 1
372    var itemIndex = (activeIndex + delta) % this.$items.length
373    return this.$items.eq(itemIndex)
374  }
375
376  Carousel.prototype.to = function (pos) {
377    var that        = this
378    var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
379
380    if (pos > (this.$items.length - 1) || pos < 0) return
381
382    if (this.sliding)       return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
383    if (activeIndex == pos) return this.pause().cycle()
384
385    return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
386  }
387
388  Carousel.prototype.pause = function (e) {
389    e || (this.paused = true)
390
391    if (this.$element.find('.next, .prev').length && $.support.transition) {
392      this.$element.trigger($.support.transition.end)
393      this.cycle(true)
394    }
395
396    this.interval = clearInterval(this.interval)
397
398    return this
399  }
400
401  Carousel.prototype.next = function () {
402    if (this.sliding) return
403    return this.slide('next')
404  }
405
406  Carousel.prototype.prev = function () {
407    if (this.sliding) return
408    return this.slide('prev')
409  }
410
411  Carousel.prototype.slide = function (type, next) {
412    var $active   = this.$element.find('.item.active')
413    var $next     = next || this.getItemForDirection(type, $active)
414    var isCycling = this.interval
415    var direction = type == 'next' ? 'left' : 'right'
416    var that      = this
417
418    if ($next.hasClass('active')) return (this.sliding = false)
419
420    var relatedTarget = $next[0]
421    var slideEvent = $.Event('slide.bs.carousel', {
422      relatedTarget: relatedTarget,
423      direction: direction
424    })
425    this.$element.trigger(slideEvent)
426    if (slideEvent.isDefaultPrevented()) return
427
428    this.sliding = true
429
430    isCycling && this.pause()
431
432    if (this.$indicators.length) {
433      this.$indicators.find('.active').removeClass('active')
434      var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
435      $nextIndicator && $nextIndicator.addClass('active')
436    }
437
438    var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
439    if ($.support.transition && this.$element.hasClass('slide')) {
440      $next.addClass(type)
441      $next[0].offsetWidth // force reflow
442      $active.addClass(direction)
443      $next.addClass(direction)
444      $active
445        .one('bsTransitionEnd', function () {
446          $next.removeClass([type, direction].join(' ')).addClass('active')
447          $active.removeClass(['active', direction].join(' '))
448          that.sliding = false
449          setTimeout(function () {
450            that.$element.trigger(slidEvent)
451          }, 0)
452        })
453        .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
454    } else {
455      $active.removeClass('active')
456      $next.addClass('active')
457      this.sliding = false
458      this.$element.trigger(slidEvent)
459    }
460
461    isCycling && this.cycle()
462
463    return this
464  }
465
466
467  // CAROUSEL PLUGIN DEFINITION
468  // ==========================
469
470  function Plugin(option) {
471    return this.each(function () {
472      var $this   = $(this)
473      var data    = $this.data('bs.carousel')
474      var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
475      var action  = typeof option == 'string' ? option : options.slide
476
477      if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
478      if (typeof option == 'number') data.to(option)
479      else if (action) data[action]()
480      else if (options.interval) data.pause().cycle()
481    })
482  }
483
484  var old = $.fn.carousel
485
486  $.fn.carousel             = Plugin
487  $.fn.carousel.Constructor = Carousel
488
489
490  // CAROUSEL NO CONFLICT
491  // ====================
492
493  $.fn.carousel.noConflict = function () {
494    $.fn.carousel = old
495    return this
496  }
497
498
499  // CAROUSEL DATA-API
500  // =================
501
502  var clickHandler = function (e) {
503    var href
504    var $this   = $(this)
505    var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
506    if (!$target.hasClass('carousel')) return
507    var options = $.extend({}, $target.data(), $this.data())
508    var slideIndex = $this.attr('data-slide-to')
509    if (slideIndex) options.interval = false
510
511    Plugin.call($target, options)
512
513    if (slideIndex) {
514      $target.data('bs.carousel').to(slideIndex)
515    }
516
517    e.preventDefault()
518  }
519
520  $(document)
521    .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
522    .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
523
524  $(window).on('load', function () {
525    $('[data-ride="carousel"]').each(function () {
526      var $carousel = $(this)
527      Plugin.call($carousel, $carousel.data())
528    })
529  })
530
531}(jQuery);
532
533/* ========================================================================
534 * Bootstrap: collapse.js v3.3.5
535 * http://getbootstrap.com/javascript/#collapse
536 * ========================================================================
537 * Copyright 2011-2015 Twitter, Inc.
538 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
539 * ======================================================================== */
540
541
542+function ($) {
543  'use strict';
544
545  // COLLAPSE PUBLIC CLASS DEFINITION
546  // ================================
547
548  var Collapse = function (element, options) {
549    this.$element      = $(element)
550    this.options       = $.extend({}, Collapse.DEFAULTS, options)
551    this.$trigger      = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
552                           '[data-toggle="collapse"][data-target="#' + element.id + '"]')
553    this.transitioning = null
554
555    if (this.options.parent) {
556      this.$parent = this.getParent()
557    } else {
558      this.addAriaAndCollapsedClass(this.$element, this.$trigger)
559    }
560
561    if (this.options.toggle) this.toggle()
562  }
563
564  Collapse.VERSION  = '3.3.5'
565
566  Collapse.TRANSITION_DURATION = 350
567
568  Collapse.DEFAULTS = {
569    toggle: true
570  }
571
572  Collapse.prototype.dimension = function () {
573    var hasWidth = this.$element.hasClass('width')
574    return hasWidth ? 'width' : 'height'
575  }
576
577  Collapse.prototype.show = function () {
578    if (this.transitioning || this.$element.hasClass('in')) return
579
580    var activesData
581    var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
582
583    if (actives && actives.length) {
584      activesData = actives.data('bs.collapse')
585      if (activesData && activesData.transitioning) return
586    }
587
588    var startEvent = $.Event('show.bs.collapse')
589    this.$element.trigger(startEvent)
590    if (startEvent.isDefaultPrevented()) return
591
592    if (actives && actives.length) {
593      Plugin.call(actives, 'hide')
594      activesData || actives.data('bs.collapse', null)
595    }
596
597    var dimension = this.dimension()
598
599    this.$element
600      .removeClass('collapse')
601      .addClass('collapsing')[dimension](0)
602      .attr('aria-expanded', true)
603
604    this.$trigger
605      .removeClass('collapsed')
606      .attr('aria-expanded', true)
607
608    this.transitioning = 1
609
610    var complete = function () {
611      this.$element
612        .removeClass('collapsing')
613        .addClass('collapse in')[dimension]('')
614      this.transitioning = 0
615      this.$element
616        .trigger('shown.bs.collapse')
617    }
618
619    if (!$.support.transition) return complete.call(this)
620
621    var scrollSize = $.camelCase(['scroll', dimension].join('-'))
622
623    this.$element
624      .one('bsTransitionEnd', $.proxy(complete, this))
625      .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
626  }
627
628  Collapse.prototype.hide = function () {
629    if (this.transitioning || !this.$element.hasClass('in')) return
630
631    var startEvent = $.Event('hide.bs.collapse')
632    this.$element.trigger(startEvent)
633    if (startEvent.isDefaultPrevented()) return
634
635    var dimension = this.dimension()
636
637    this.$element[dimension](this.$element[dimension]())[0].offsetHeight
638
639    this.$element
640      .addClass('collapsing')
641      .removeClass('collapse in')
642      .attr('aria-expanded', false)
643
644    this.$trigger
645      .addClass('collapsed')
646      .attr('aria-expanded', false)
647
648    this.transitioning = 1
649
650    var complete = function () {
651      this.transitioning = 0
652      this.$element
653        .removeClass('collapsing')
654        .addClass('collapse')
655        .trigger('hidden.bs.collapse')
656    }
657
658    if (!$.support.transition) return complete.call(this)
659
660    this.$element
661      [dimension](0)
662      .one('bsTransitionEnd', $.proxy(complete, this))
663      .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
664  }
665
666  Collapse.prototype.toggle = function () {
667    this[this.$element.hasClass('in') ? 'hide' : 'show']()
668  }
669
670  Collapse.prototype.getParent = function () {
671    return $(this.options.parent)
672      .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
673      .each($.proxy(function (i, element) {
674        var $element = $(element)
675        this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
676      }, this))
677      .end()
678  }
679
680  Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
681    var isOpen = $element.hasClass('in')
682
683    $element.attr('aria-expanded', isOpen)
684    $trigger
685      .toggleClass('collapsed', !isOpen)
686      .attr('aria-expanded', isOpen)
687  }
688
689  function getTargetFromTrigger($trigger) {
690    var href
691    var target = $trigger.attr('data-target')
692      || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
693
694    return $(target)
695  }
696
697
698  // COLLAPSE PLUGIN DEFINITION
699  // ==========================
700
701  function Plugin(option) {
702    return this.each(function () {
703      var $this   = $(this)
704      var data    = $this.data('bs.collapse')
705      var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
706
707      if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
708      if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
709      if (typeof option == 'string') data[option]()
710    })
711  }
712
713  var old = $.fn.collapse
714
715  $.fn.collapse             = Plugin
716  $.fn.collapse.Constructor = Collapse
717
718
719  // COLLAPSE NO CONFLICT
720  // ====================
721
722  $.fn.collapse.noConflict = function () {
723    $.fn.collapse = old
724    return this
725  }
726
727
728  // COLLAPSE DATA-API
729  // =================
730
731  $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
732    var $this   = $(this)
733
734    if (!$this.attr('data-target')) e.preventDefault()
735
736    var $target = getTargetFromTrigger($this)
737    var data    = $target.data('bs.collapse')
738    var option  = data ? 'toggle' : $this.data()
739
740    Plugin.call($target, option)
741  })
742
743}(jQuery);
744
745/* ========================================================================
746 * Bootstrap: dropdown.js v3.3.5
747 * http://getbootstrap.com/javascript/#dropdowns
748 * ========================================================================
749 * Copyright 2011-2015 Twitter, Inc.
750 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
751 * ======================================================================== */
752
753
754+function ($) {
755  'use strict';
756
757  // DROPDOWN CLASS DEFINITION
758  // =========================
759
760  var backdrop = '.dropdown-backdrop'
761  var toggle   = '[data-toggle="dropdown"]'
762  var Dropdown = function (element) {
763    $(element).on('click.bs.dropdown', this.toggle)
764  }
765
766  Dropdown.VERSION = '3.3.5'
767
768  function getParent($this) {
769    var selector = $this.attr('data-target')
770
771    if (!selector) {
772      selector = $this.attr('href')
773      selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
774    }
775
776    var $parent = selector && $(selector)
777
778    return $parent && $parent.length ? $parent : $this.parent()
779  }
780
781  function clearMenus(e) {
782    if (e && e.which === 3) return
783    $(backdrop).remove()
784    $(toggle).each(function () {
785      var $this         = $(this)
786      var $parent       = getParent($this)
787      var relatedTarget = { relatedTarget: this }
788
789      if (!$parent.hasClass('open')) return
790
791      if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
792
793      $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
794
795      if (e.isDefaultPrevented()) return
796
797      $this.attr('aria-expanded', 'false')
798      $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
799    })
800  }
801
802  Dropdown.prototype.toggle = function (e) {
803    var $this = $(this)
804
805    if ($this.is('.disabled, :disabled')) return
806
807    var $parent  = getParent($this)
808    var isActive = $parent.hasClass('open')
809
810    clearMenus()
811    $('#menu').getNiceScroll().resize();
vendor: 45,648 bytes, lines 811-2364
811
812
813    if (!isActive) {
814      if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
815        // if mobile we use a backdrop because click events don't delegate
816        $(document.createElement('div'))
817          .addClass('dropdown-backdrop')
818          .insertAfter($(this))
819          .on('click', clearMenus)
820      }
821
822      var relatedTarget = { relatedTarget: this }
823      $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
824
825      if (e.isDefaultPrevented()) return
826
827      $this
828        .trigger('focus')
829        .attr('aria-expanded', 'true')
830
831      $parent
832        .toggleClass('open')
833        .trigger('shown.bs.dropdown', relatedTarget)
834    }
835
836    return false
837  }
838
839  Dropdown.prototype.keydown = function (e) {
840    if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
841
842    var $this = $(this)
843
844    e.preventDefault()
845    e.stopPropagation()
846
847    if ($this.is('.disabled, :disabled')) return
848
849    var $parent  = getParent($this)
850    var isActive = $parent.hasClass('open')
851
852    if (!isActive && e.which != 27 || isActive && e.which == 27) {
853      if (e.which == 27) $parent.find(toggle).trigger('focus')
854      return $this.trigger('click')
855    }
856
857    var desc = ' li:not(.disabled):visible a'
858    var $items = $parent.find('.dropdown-menu' + desc)
859
860    if (!$items.length) return
861
862    var index = $items.index(e.target)
863
864    if (e.which == 38 && index > 0)                 index--         // up
865    if (e.which == 40 && index < $items.length - 1) index++         // down
866    if (!~index)                                    index = 0
867
868    $items.eq(index).trigger('focus')
869  }
870
871
872  // DROPDOWN PLUGIN DEFINITION
873  // ==========================
874
875  function Plugin(option) {
876    return this.each(function () {
877      var $this = $(this)
878      var data  = $this.data('bs.dropdown')
879
880      if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
881      if (typeof option == 'string') data[option].call($this)
882    })
883  }
884
885  var old = $.fn.dropdown
886
887  $.fn.dropdown             = Plugin
888  $.fn.dropdown.Constructor = Dropdown
889
890
891  // DROPDOWN NO CONFLICT
892  // ====================
893
894  $.fn.dropdown.noConflict = function () {
895    $.fn.dropdown = old
896    return this
897  }
898
899
900  // APPLY TO STANDARD DROPDOWN ELEMENTS
901  // ===================================
902
903  $(document)
904    .on('click.bs.dropdown.data-api', clearMenus)
905    .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
906    .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
907    .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
908    .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
909
910}(jQuery);
911
912/* ========================================================================
913 * Bootstrap: modal.js v3.3.5
914 * http://getbootstrap.com/javascript/#modals
915 * ========================================================================
916 * Copyright 2011-2015 Twitter, Inc.
917 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
918 * ======================================================================== */
919
920
921+function ($) {
922  'use strict';
923
924  // MODAL CLASS DEFINITION
925  // ======================
926
927  var Modal = function (element, options) {
928    this.options             = options
929    this.$body               = $(document.body)
930    this.$element            = $(element)
931    this.$dialog             = this.$element.find('.modal-dialog')
932    this.$backdrop           = null
933    this.isShown             = null
934    this.originalBodyPad     = null
935    this.scrollbarWidth      = 0
936    this.ignoreBackdropClick = false
937
938    if (this.options.remote) {
939      this.$element
940        .find('.modal-content')
941        .load(this.options.remote, $.proxy(function () {
942          this.$element.trigger('loaded.bs.modal')
943        }, this))
944    }
945  }
946
947  Modal.VERSION  = '3.3.5'
948
949  Modal.TRANSITION_DURATION = 300
950  Modal.BACKDROP_TRANSITION_DURATION = 150
951
952  Modal.DEFAULTS = {
953    backdrop: true,
954    keyboard: true,
955    show: true
956  }
957
958  Modal.prototype.toggle = function (_relatedTarget) {
959    return this.isShown ? this.hide() : this.show(_relatedTarget)
960  }
961
962  Modal.prototype.show = function (_relatedTarget) {
963    var that = this
964    var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
965
966    this.$element.trigger(e)
967
968    if (this.isShown || e.isDefaultPrevented()) return
969
970    this.isShown = true
971
972    this.checkScrollbar()
973    this.setScrollbar()
974    this.$body.addClass('modal-open')
975
976    this.escape()
977    this.resize()
978
979    this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
980
981    this.$dialog.on('mousedown.dismiss.bs.modal', function () {
982      that.$element.one('mouseup.dismiss.bs.modal', function (e) {
983        if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
984      })
985    })
986
987    this.backdrop(function () {
988      var transition = $.support.transition && that.$element.hasClass('fade')
989
990      if (!that.$element.parent().length) {
991        that.$element.appendTo(that.$body) // don't move modals dom position
992      }
993
994      that.$element
995        .show()
996        .scrollTop(0)
997
998      that.adjustDialog()
999
1000      if (transition) {
1001        that.$element[0].offsetWidth // force reflow
1002      }
1003
1004      that.$element.addClass('in')
1005
1006      that.enforceFocus()
1007
1008      var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
1009
1010      transition ?
1011        that.$dialog // wait for modal to slide in
1012          .one('bsTransitionEnd', function () {
1013            that.$element.trigger('focus').trigger(e)
1014          })
1015          .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
1016        that.$element.trigger('focus').trigger(e)
1017    })
1018  }
1019
1020  Modal.prototype.hide = function (e) {
1021    if (e) e.preventDefault()
1022
1023    e = $.Event('hide.bs.modal')
1024
1025    this.$element.trigger(e)
1026
1027    if (!this.isShown || e.isDefaultPrevented()) return
1028
1029    this.isShown = false
1030
1031    this.escape()
1032    this.resize()
1033
1034    $(document).off('focusin.bs.modal')
1035
1036    this.$element
1037      .removeClass('in')
1038      .off('click.dismiss.bs.modal')
1039      .off('mouseup.dismiss.bs.modal')
1040
1041    this.$dialog.off('mousedown.dismiss.bs.modal')
1042
1043    $.support.transition && this.$element.hasClass('fade') ?
1044      this.$element
1045        .one('bsTransitionEnd', $.proxy(this.hideModal, this))
1046        .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
1047      this.hideModal()
1048  }
1049
1050  Modal.prototype.enforceFocus = function () {
1051    $(document)
1052      .off('focusin.bs.modal') // guard against infinite focus loop
1053      .on('focusin.bs.modal', $.proxy(function (e) {
1054        if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
1055          this.$element.trigger('focus')
1056        }
1057      }, this))
1058  }
1059
1060  Modal.prototype.escape = function () {
1061    if (this.isShown && this.options.keyboard) {
1062      this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
1063        e.which == 27 && this.hide()
1064      }, this))
1065    } else if (!this.isShown) {
1066      this.$element.off('keydown.dismiss.bs.modal')
1067    }
1068  }
1069
1070  Modal.prototype.resize = function () {
1071    if (this.isShown) {
1072      $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
1073    } else {
1074      $(window).off('resize.bs.modal')
1075    }
1076  }
1077
1078  Modal.prototype.hideModal = function () {
1079    var that = this
1080    this.$element.hide()
1081    this.backdrop(function () {
1082      that.$body.removeClass('modal-open')
1083      that.resetAdjustments()
1084      that.resetScrollbar()
1085      that.$element.trigger('hidden.bs.modal')
1086    })
1087  }
1088
1089  Modal.prototype.removeBackdrop = function () {
1090    this.$backdrop && this.$backdrop.remove()
1091    this.$backdrop = null
1092  }
1093
1094  Modal.prototype.backdrop = function (callback) {
1095    var that = this
1096    var animate = this.$element.hasClass('fade') ? 'fade' : ''
1097
1098    if (this.isShown && this.options.backdrop) {
1099      var doAnimate = $.support.transition && animate
1100
1101      this.$backdrop = $(document.createElement('div'))
1102        .addClass('modal-backdrop ' + animate)
1103        .appendTo(this.$body)
1104
1105      this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
1106        if (this.ignoreBackdropClick) {
1107          this.ignoreBackdropClick = false
1108          return
1109        }
1110        if (e.target !== e.currentTarget) return
1111        this.options.backdrop == 'static'
1112          ? this.$element[0].focus()
1113          : this.hide()
1114      }, this))
1115
1116      if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
1117
1118      this.$backdrop.addClass('in')
1119
1120      if (!callback) return
1121
1122      doAnimate ?
1123        this.$backdrop
1124          .one('bsTransitionEnd', callback)
1125          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
1126        callback()
1127
1128    } else if (!this.isShown && this.$backdrop) {
1129      this.$backdrop.removeClass('in')
1130
1131      var callbackRemove = function () {
1132        that.removeBackdrop()
1133        callback && callback()
1134      }
1135      $.support.transition && this.$element.hasClass('fade') ?
1136        this.$backdrop
1137          .one('bsTransitionEnd', callbackRemove)
1138          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
1139        callbackRemove()
1140
1141    } else if (callback) {
1142      callback()
1143    }
1144  }
1145
1146  // these following methods are used to handle overflowing modals
1147
1148  Modal.prototype.handleUpdate = function () {
1149    this.adjustDialog()
1150  }
1151
1152  Modal.prototype.adjustDialog = function () {
1153    var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
1154
1155    this.$element.css({
1156      paddingLeft:  !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
1157      paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
1158    })
1159  }
1160
1161  Modal.prototype.resetAdjustments = function () {
1162    this.$element.css({
1163      paddingLeft: '',
1164      paddingRight: ''
1165    })
1166  }
1167
1168  Modal.prototype.checkScrollbar = function () {
1169    var fullWindowWidth = window.innerWidth
1170    if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
1171      var documentElementRect = document.documentElement.getBoundingClientRect()
1172      fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
1173    }
1174    this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
1175    this.scrollbarWidth = this.measureScrollbar()
1176  }
1177
1178  Modal.prototype.setScrollbar = function () {
1179    var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
1180    this.originalBodyPad = document.body.style.paddingRight || ''
1181    if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
1182  }
1183
1184  Modal.prototype.resetScrollbar = function () {
1185    this.$body.css('padding-right', this.originalBodyPad)
1186  }
1187
1188  Modal.prototype.measureScrollbar = function () { // thx walsh
1189    var scrollDiv = document.createElement('div')
1190    scrollDiv.className = 'modal-scrollbar-measure'
1191    this.$body.append(scrollDiv)
1192    var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
1193    this.$body[0].removeChild(scrollDiv)
1194    return scrollbarWidth
1195  }
1196
1197
1198  // MODAL PLUGIN DEFINITION
1199  // =======================
1200
1201  function Plugin(option, _relatedTarget) {
1202    return this.each(function () {
1203      var $this   = $(this)
1204      var data    = $this.data('bs.modal')
1205      var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
1206
1207      if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
1208      if (typeof option == 'string') data[option](_relatedTarget)
1209      else if (options.show) data.show(_relatedTarget)
1210    })
1211  }
1212
1213  var old = $.fn.modal
1214
1215  $.fn.modal             = Plugin
1216  $.fn.modal.Constructor = Modal
1217
1218
1219  // MODAL NO CONFLICT
1220  // =================
1221
1222  $.fn.modal.noConflict = function () {
1223    $.fn.modal = old
1224    return this
1225  }
1226
1227
1228  // MODAL DATA-API
1229  // ==============
1230
1231  $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
1232    var $this   = $(this)
1233    var href    = $this.attr('href')
1234    var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
1235    var option  = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
1236
1237    if ($this.is('a')) e.preventDefault()
1238
1239    $target.one('show.bs.modal', function (showEvent) {
1240      if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
1241      $target.one('hidden.bs.modal', function () {
1242        $this.is(':visible') && $this.trigger('focus')
1243      })
1244    })
1245    Plugin.call($target, option, this)
1246  })
1247
1248}(jQuery);
1249
1250/* ========================================================================
1251 * Bootstrap: tooltip.js v3.3.5
1252 * http://getbootstrap.com/javascript/#tooltip
1253 * Inspired by the original jQuery.tipsy by Jason Frame
1254 * ========================================================================
1255 * Copyright 2011-2015 Twitter, Inc.
1256 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1257 * ======================================================================== */
1258
1259
1260+function ($) {
1261  'use strict';
1262
1263  // TOOLTIP PUBLIC CLASS DEFINITION
1264  // ===============================
1265
1266  var Tooltip = function (element, options) {
1267    this.type       = null
1268    this.options    = null
1269    this.enabled    = null
1270    this.timeout    = null
1271    this.hoverState = null
1272    this.$element   = null
1273    this.inState    = null
1274
1275    this.init('tooltip', element, options)
1276  }
1277
1278  Tooltip.VERSION  = '3.3.5'
1279
1280  Tooltip.TRANSITION_DURATION = 150
1281
1282  Tooltip.DEFAULTS = {
1283    animation: true,
1284    placement: 'top',
1285    selector: false,
1286    template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
1287    trigger: 'hover focus',
1288    title: '',
1289    delay: 0,
1290    html: false,
1291    container: false,
1292    viewport: {
1293      selector: 'body',
1294      padding: 0
1295    }
1296  }
1297
1298  Tooltip.prototype.init = function (type, element, options) {
1299    this.enabled   = true
1300    this.type      = type
1301    this.$element  = $(element)
1302    this.options   = this.getOptions(options)
1303    this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
1304    this.inState   = { click: false, hover: false, focus: false }
1305
1306    if (this.$element[0] instanceof document.constructor && !this.options.selector) {
1307      throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
1308    }
1309
1310    var triggers = this.options.trigger.split(' ')
1311
1312    for (var i = triggers.length; i--;) {
1313      var trigger = triggers[i]
1314
1315      if (trigger == 'click') {
1316        this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1317      } else if (trigger != 'manual') {
1318        var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin'
1319        var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
1320
1321        this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1322        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1323      }
1324    }
1325
1326    this.options.selector ?
1327      (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1328      this.fixTitle()
1329  }
1330
1331  Tooltip.prototype.getDefaults = function () {
1332    return Tooltip.DEFAULTS
1333  }
1334
1335  Tooltip.prototype.getOptions = function (options) {
1336    options = $.extend({}, this.getDefaults(), this.$element.data(), options)
1337
1338    if (options.delay && typeof options.delay == 'number') {
1339      options.delay = {
1340        show: options.delay,
1341        hide: options.delay
1342      }
1343    }
1344
1345    return options
1346  }
1347
1348  Tooltip.prototype.getDelegateOptions = function () {
1349    var options  = {}
1350    var defaults = this.getDefaults()
1351
1352    this._options && $.each(this._options, function (key, value) {
1353      if (defaults[key] != value) options[key] = value
1354    })
1355
1356    return options
1357  }
1358
1359  Tooltip.prototype.enter = function (obj) {
1360    var self = obj instanceof this.constructor ?
1361      obj : $(obj.currentTarget).data('bs.' + this.type)
1362
1363    if (!self) {
1364      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1365      $(obj.currentTarget).data('bs.' + this.type, self)
1366    }
1367
1368    if (obj instanceof $.Event) {
1369      self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
1370    }
1371
1372    if (self.tip().hasClass('in') || self.hoverState == 'in') {
1373      self.hoverState = 'in'
1374      return
1375    }
1376
1377    clearTimeout(self.timeout)
1378
1379    self.hoverState = 'in'
1380
1381    if (!self.options.delay || !self.options.delay.show) return self.show()
1382
1383    self.timeout = setTimeout(function () {
1384      if (self.hoverState == 'in') self.show()
1385    }, self.options.delay.show)
1386  }
1387
1388  Tooltip.prototype.isInStateTrue = function () {
1389    for (var key in this.inState) {
1390      if (this.inState[key]) return true
1391    }
1392
1393    return false
1394  }
1395
1396  Tooltip.prototype.leave = function (obj) {
1397    var self = obj instanceof this.constructor ?
1398      obj : $(obj.currentTarget).data('bs.' + this.type)
1399
1400    if (!self) {
1401      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1402      $(obj.currentTarget).data('bs.' + this.type, self)
1403    }
1404
1405    if (obj instanceof $.Event) {
1406      self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
1407    }
1408
1409    if (self.isInStateTrue()) return
1410
1411    clearTimeout(self.timeout)
1412
1413    self.hoverState = 'out'
1414
1415    if (!self.options.delay || !self.options.delay.hide) return self.hide()
1416
1417    self.timeout = setTimeout(function () {
1418      if (self.hoverState == 'out') self.hide()
1419    }, self.options.delay.hide)
1420  }
1421
1422  Tooltip.prototype.show = function () {
1423    var e = $.Event('show.bs.' + this.type)
1424
1425    if (this.hasContent() && this.enabled) {
1426      this.$element.trigger(e)
1427
1428      var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
1429      if (e.isDefaultPrevented() || !inDom) return
1430      var that = this
1431
1432      var $tip = this.tip()
1433
1434      var tipId = this.getUID(this.type)
1435
1436      this.setContent()
1437      $tip.attr('id', tipId)
1438      this.$element.attr('aria-describedby', tipId)
1439
1440      if (this.options.animation) $tip.addClass('fade')
1441
1442      var placement = typeof this.options.placement == 'function' ?
1443        this.options.placement.call(this, $tip[0], this.$element[0]) :
1444        this.options.placement
1445
1446      var autoToken = /\s?auto?\s?/i
1447      var autoPlace = autoToken.test(placement)
1448      if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
1449
1450      $tip
1451        .detach()
1452        .css({ top: 0, left: 0, display: 'block' })
1453        .addClass(placement)
1454        .data('bs.' + this.type, this)
1455
1456      this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1457      this.$element.trigger('inserted.bs.' + this.type)
1458
1459      var pos          = this.getPosition()
1460      var actualWidth  = $tip[0].offsetWidth
1461      var actualHeight = $tip[0].offsetHeight
1462
1463      if (autoPlace) {
1464        var orgPlacement = placement
1465        var viewportDim = this.getPosition(this.$viewport)
1466
1467        placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top'    :
1468                    placement == 'top'    && pos.top    - actualHeight < viewportDim.top    ? 'bottom' :
1469                    placement == 'right'  && pos.right  + actualWidth  > viewportDim.width  ? 'left'   :
1470                    placement == 'left'   && pos.left   - actualWidth  < viewportDim.left   ? 'right'  :
1471                    placement
1472
1473        $tip
1474          .removeClass(orgPlacement)
1475          .addClass(placement)
1476      }
1477
1478      var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
1479
1480      this.applyPlacement(calculatedOffset, placement)
1481
1482      var complete = function () {
1483        var prevHoverState = that.hoverState
1484        that.$element.trigger('shown.bs.' + that.type)
1485        that.hoverState = null
1486
1487        if (prevHoverState == 'out') that.leave(that)
1488      }
1489
1490      $.support.transition && this.$tip.hasClass('fade') ?
1491        $tip
1492          .one('bsTransitionEnd', complete)
1493          .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
1494        complete()
1495    }
1496  }
1497
1498  Tooltip.prototype.applyPlacement = function (offset, placement) {
1499    var $tip   = this.tip()
1500    var width  = $tip[0].offsetWidth
1501    var height = $tip[0].offsetHeight
1502
1503    // manually read margins because getBoundingClientRect includes difference
1504    var marginTop = parseInt($tip.css('margin-top'), 10)
1505    var marginLeft = parseInt($tip.css('margin-left'), 10)
1506
1507    // we must check for NaN for ie 8/9
1508    if (isNaN(marginTop))  marginTop  = 0
1509    if (isNaN(marginLeft)) marginLeft = 0
1510
1511    offset.top  += marginTop
1512    offset.left += marginLeft
1513
1514    // $.fn.offset doesn't round pixel values
1515    // so we use setOffset directly with our own function B-0
1516    $.offset.setOffset($tip[0], $.extend({
1517      using: function (props) {
1518        $tip.css({
1519          top: Math.round(props.top),
1520          left: Math.round(props.left)
1521        })
1522      }
1523    }, offset), 0)
1524
1525    $tip.addClass('in')
1526
1527    // check to see if placing tip in new offset caused the tip to resize itself
1528    var actualWidth  = $tip[0].offsetWidth
1529    var actualHeight = $tip[0].offsetHeight
1530
1531    if (placement == 'top' && actualHeight != height) {
1532      offset.top = offset.top + height - actualHeight
1533    }
1534
1535    var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
1536
1537    if (delta.left) offset.left += delta.left
1538    else offset.top += delta.top
1539
1540    var isVertical          = /top|bottom/.test(placement)
1541    var arrowDelta          = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
1542    var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
1543
1544    $tip.offset(offset)
1545    this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
1546  }
1547
1548  Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
1549    this.arrow()
1550      .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
1551      .css(isVertical ? 'top' : 'left', '')
1552  }
1553
1554  Tooltip.prototype.setContent = function () {
1555    var $tip  = this.tip()
1556    var title = this.getTitle()
1557
1558    $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1559    $tip.removeClass('fade in top bottom left right')
1560  }
1561
1562  Tooltip.prototype.hide = function (callback) {
1563    var that = this
1564    var $tip = $(this.$tip)
1565    var e    = $.Event('hide.bs.' + this.type)
1566
1567    function complete() {
1568      if (that.hoverState != 'in') $tip.detach()
1569      that.$element
1570        .removeAttr('aria-describedby')
1571        .trigger('hidden.bs.' + that.type)
1572      callback && callback()
1573    }
1574
1575    this.$element.trigger(e)
1576
1577    if (e.isDefaultPrevented()) return
1578
1579    $tip.removeClass('in')
1580
1581    $.support.transition && $tip.hasClass('fade') ?
1582      $tip
1583        .one('bsTransitionEnd', complete)
1584        .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
1585      complete()
1586
1587    this.hoverState = null
1588
1589    return this
1590  }
1591
1592  Tooltip.prototype.fixTitle = function () {
1593    var $e = this.$element
1594    if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
1595      $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
1596    }
1597  }
1598
1599  Tooltip.prototype.hasContent = function () {
1600    return this.getTitle()
1601  }
1602
1603  Tooltip.prototype.getPosition = function ($element) {
1604    $element   = $element || this.$element
1605
1606    var el     = $element[0]
1607    var isBody = el.tagName == 'BODY'
1608
1609    var elRect    = el.getBoundingClientRect()
1610    if (elRect.width == null) {
1611      // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
1612      elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
1613    }
1614    var elOffset  = isBody ? { top: 0, left: 0 } : $element.offset()
1615    var scroll    = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
1616    var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
1617
1618    return $.extend({}, elRect, scroll, outerDims, elOffset)
1619  }
1620
1621  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
1622    return placement == 'bottom' ? { top: pos.top + pos.height,   left: pos.left + pos.width / 2 - actualWidth / 2 } :
1623           placement == 'top'    ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
1624           placement == 'left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
1625        /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
1626
1627  }
1628
1629  Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
1630    var delta = { top: 0, left: 0 }
1631    if (!this.$viewport) return delta
1632
1633    var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
1634    var viewportDimensions = this.getPosition(this.$viewport)
1635
1636    if (/right|left/.test(placement)) {
1637      var topEdgeOffset    = pos.top - viewportPadding - viewportDimensions.scroll
1638      var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
1639      if (topEdgeOffset < viewportDimensions.top) { // top overflow
1640        delta.top = viewportDimensions.top - topEdgeOffset
1641      } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
1642        delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
1643      }
1644    } else {
1645      var leftEdgeOffset  = pos.left - viewportPadding
1646      var rightEdgeOffset = pos.left + viewportPadding + actualWidth
1647      if (leftEdgeOffset < viewportDimensions.left) { // left overflow
1648        delta.left = viewportDimensions.left - leftEdgeOffset
1649      } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
1650        delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
1651      }
1652    }
1653
1654    return delta
1655  }
1656
1657  Tooltip.prototype.getTitle = function () {
1658    var title
1659    var $e = this.$element
1660    var o  = this.options
1661
1662    title = $e.attr('data-original-title')
1663      || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
1664
1665    return title
1666  }
1667
1668  Tooltip.prototype.getUID = function (prefix) {
1669    do prefix += ~~(Math.random() * 1000000)
1670    while (document.getElementById(prefix))
1671    return prefix
1672  }
1673
1674  Tooltip.prototype.tip = function () {
1675    if (!this.$tip) {
1676      this.$tip = $(this.options.template)
1677      if (this.$tip.length != 1) {
1678        throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
1679      }
1680    }
1681    return this.$tip
1682  }
1683
1684  Tooltip.prototype.arrow = function () {
1685    return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
1686  }
1687
1688  Tooltip.prototype.enable = function () {
1689    this.enabled = true
1690  }
1691
1692  Tooltip.prototype.disable = function () {
1693    this.enabled = false
1694  }
1695
1696  Tooltip.prototype.toggleEnabled = function () {
1697    this.enabled = !this.enabled
1698  }
1699
1700  Tooltip.prototype.toggle = function (e) {
1701    var self = this
1702    if (e) {
1703      self = $(e.currentTarget).data('bs.' + this.type)
1704      if (!self) {
1705        self = new this.constructor(e.currentTarget, this.getDelegateOptions())
1706        $(e.currentTarget).data('bs.' + this.type, self)
1707      }
1708    }
1709
1710    if (e) {
1711      self.inState.click = !self.inState.click
1712      if (self.isInStateTrue()) self.enter(self)
1713      else self.leave(self)
1714    } else {
1715      self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
1716    }
1717  }
1718
1719  Tooltip.prototype.destroy = function () {
1720    var that = this
1721    clearTimeout(this.timeout)
1722    this.hide(function () {
1723      that.$element.off('.' + that.type).removeData('bs.' + that.type)
1724      if (that.$tip) {
1725        that.$tip.detach()
1726      }
1727      that.$tip = null
1728      that.$arrow = null
1729      that.$viewport = null
1730    })
1731  }
1732
1733
1734  // TOOLTIP PLUGIN DEFINITION
1735  // =========================
1736
1737  function Plugin(option) {
1738    return this.each(function () {
1739      var $this   = $(this)
1740      var data    = $this.data('bs.tooltip')
1741      var options = typeof option == 'object' && option
1742
1743      if (!data && /destroy|hide/.test(option)) return
1744      if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
1745      if (typeof option == 'string') data[option]()
1746    })
1747  }
1748
1749  var old = $.fn.tooltip
1750
1751  $.fn.tooltip             = Plugin
1752  $.fn.tooltip.Constructor = Tooltip
1753
1754
1755  // TOOLTIP NO CONFLICT
1756  // ===================
1757
1758  $.fn.tooltip.noConflict = function () {
1759    $.fn.tooltip = old
1760    return this
1761  }
1762
1763}(jQuery);
1764
1765/* ========================================================================
1766 * Bootstrap: popover.js v3.3.5
1767 * http://getbootstrap.com/javascript/#popovers
1768 * ========================================================================
1769 * Copyright 2011-2015 Twitter, Inc.
1770 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1771 * ======================================================================== */
1772
1773
1774+function ($) {
1775  'use strict';
1776
1777  // POPOVER PUBLIC CLASS DEFINITION
1778  // ===============================
1779
1780  var Popover = function (element, options) {
1781    this.init('popover', element, options)
1782  }
1783
1784  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1785
1786  Popover.VERSION  = '3.3.5'
1787
1788  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
1789    placement: 'right',
1790    trigger: 'click',
1791    content: '',
1792    template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1793  })
1794
1795
1796  // NOTE: POPOVER EXTENDS tooltip.js
1797  // ================================
1798
1799  Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
1800
1801  Popover.prototype.constructor = Popover
1802
1803  Popover.prototype.getDefaults = function () {
1804    return Popover.DEFAULTS
1805  }
1806
1807  Popover.prototype.setContent = function () {
1808    var $tip    = this.tip()
1809    var title   = this.getTitle()
1810    var content = this.getContent()
1811
1812    $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1813    $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
1814      this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
1815    ](content)
1816
1817    $tip.removeClass('fade top bottom left right in')
1818
1819    // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
1820    // this manually by checking the contents.
1821    if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
1822  }
1823
1824  Popover.prototype.hasContent = function () {
1825    return this.getTitle() || this.getContent()
1826  }
1827
1828  Popover.prototype.getContent = function () {
1829    var $e = this.$element
1830    var o  = this.options
1831
1832    return $e.attr('data-content')
1833      || (typeof o.content == 'function' ?
1834            o.content.call($e[0]) :
1835            o.content)
1836  }
1837
1838  Popover.prototype.arrow = function () {
1839    return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
1840  }
1841
1842
1843  // POPOVER PLUGIN DEFINITION
1844  // =========================
1845
1846  function Plugin(option) {
1847    return this.each(function () {
1848      var $this   = $(this)
1849      var data    = $this.data('bs.popover')
1850      var options = typeof option == 'object' && option
1851
1852      if (!data && /destroy|hide/.test(option)) return
1853      if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
1854      if (typeof option == 'string') data[option]()
1855    })
1856  }
1857
1858  var old = $.fn.popover
1859
1860  $.fn.popover             = Plugin
1861  $.fn.popover.Constructor = Popover
1862
1863
1864  // POPOVER NO CONFLICT
1865  // ===================
1866
1867  $.fn.popover.noConflict = function () {
1868    $.fn.popover = old
1869    return this
1870  }
1871
1872}(jQuery);
1873
1874/* ========================================================================
1875 * Bootstrap: scrollspy.js v3.3.5
1876 * http://getbootstrap.com/javascript/#scrollspy
1877 * ========================================================================
1878 * Copyright 2011-2015 Twitter, Inc.
1879 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1880 * ======================================================================== */
1881
1882
1883+function ($) {
1884  'use strict';
1885
1886  // SCROLLSPY CLASS DEFINITION
1887  // ==========================
1888
1889  function ScrollSpy(element, options) {
1890    this.$body          = $(document.body)
1891    this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
1892    this.options        = $.extend({}, ScrollSpy.DEFAULTS, options)
1893    this.selector       = (this.options.target || '') + ' .nav li > a'
1894    this.offsets        = []
1895    this.targets        = []
1896    this.activeTarget   = null
1897    this.scrollHeight   = 0
1898
1899    this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
1900    this.refresh()
1901    this.process()
1902  }
1903
1904  ScrollSpy.VERSION  = '3.3.5'
1905
1906  ScrollSpy.DEFAULTS = {
1907    offset: 10
1908  }
1909
1910  ScrollSpy.prototype.getScrollHeight = function () {
1911    return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
1912  }
1913
1914  ScrollSpy.prototype.refresh = function () {
1915    var that          = this
1916    var offsetMethod  = 'offset'
1917    var offsetBase    = 0
1918
1919    this.offsets      = []
1920    this.targets      = []
1921    this.scrollHeight = this.getScrollHeight()
1922
1923    if (!$.isWindow(this.$scrollElement[0])) {
1924      offsetMethod = 'position'
1925      offsetBase   = this.$scrollElement.scrollTop()
1926    }
1927
1928    this.$body
1929      .find(this.selector)
1930      .map(function () {
1931        var $el   = $(this)
1932        var href  = $el.data('target') || $el.attr('href')
1933        var $href = /^#./.test(href) && $(href)
1934
1935        return ($href
1936          && $href.length
1937          && $href.is(':visible')
1938          && [[$href[offsetMethod]().top + offsetBase, href]]) || null
1939      })
1940      .sort(function (a, b) { return a[0] - b[0] })
1941      .each(function () {
1942        that.offsets.push(this[0])
1943        that.targets.push(this[1])
1944      })
1945  }
1946
1947  ScrollSpy.prototype.process = function () {
1948    var scrollTop    = this.$scrollElement.scrollTop() + this.options.offset
1949    var scrollHeight = this.getScrollHeight()
1950    var maxScroll    = this.options.offset + scrollHeight - this.$scrollElement.height()
1951    var offsets      = this.offsets
1952    var targets      = this.targets
1953    var activeTarget = this.activeTarget
1954    var i
1955
1956    if (this.scrollHeight != scrollHeight) {
1957      this.refresh()
1958    }
1959
1960    if (scrollTop >= maxScroll) {
1961      return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
1962    }
1963
1964    if (activeTarget && scrollTop < offsets[0]) {
1965      this.activeTarget = null
1966      return this.clear()
1967    }
1968
1969    for (i = offsets.length; i--;) {
1970      activeTarget != targets[i]
1971        && scrollTop >= offsets[i]
1972        && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
1973        && this.activate(targets[i])
1974    }
1975  }
1976
1977  ScrollSpy.prototype.activate = function (target) {
1978    this.activeTarget = target
1979
1980    this.clear()
1981
1982    var selector = this.selector +
1983      '[data-target="' + target + '"],' +
1984      this.selector + '[href="' + target + '"]'
1985
1986    var active = $(selector)
1987      .parents('li')
1988      .addClass('active')
1989
1990    if (active.parent('.dropdown-menu').length) {
1991      active = active
1992        .closest('li.dropdown')
1993        .addClass('active')
1994    }
1995
1996    active.trigger('activate.bs.scrollspy')
1997  }
1998
1999  ScrollSpy.prototype.clear = function () {
2000    $(this.selector)
2001      .parentsUntil(this.options.target, '.active')
2002      .removeClass('active')
2003  }
2004
2005
2006  // SCROLLSPY PLUGIN DEFINITION
2007  // ===========================
2008
2009  function Plugin(option) {
2010    return this.each(function () {
2011      var $this   = $(this)
2012      var data    = $this.data('bs.scrollspy')
2013      var options = typeof option == 'object' && option
2014
2015      if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
2016      if (typeof option == 'string') data[option]()
2017    })
2018  }
2019
2020  var old = $.fn.scrollspy
2021
2022  $.fn.scrollspy             = Plugin
2023  $.fn.scrollspy.Constructor = ScrollSpy
2024
2025
2026  // SCROLLSPY NO CONFLICT
2027  // =====================
2028
2029  $.fn.scrollspy.noConflict = function () {
2030    $.fn.scrollspy = old
2031    return this
2032  }
2033
2034
2035  // SCROLLSPY DATA-API
2036  // ==================
2037
2038  $(window).on('load.bs.scrollspy.data-api', function () {
2039    $('[data-spy="scroll"]').each(function () {
2040      var $spy = $(this)
2041      Plugin.call($spy, $spy.data())
2042    })
2043  })
2044
2045}(jQuery);
2046
2047/* ========================================================================
2048 * Bootstrap: tab.js v3.3.5
2049 * http://getbootstrap.com/javascript/#tabs
2050 * ========================================================================
2051 * Copyright 2011-2015 Twitter, Inc.
2052 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2053 * ======================================================================== */
2054
2055
2056+function ($) {
2057  'use strict';
2058
2059  // TAB CLASS DEFINITION
2060  // ====================
2061
2062  var Tab = function (element) {
2063    // jscs:disable requireDollarBeforejQueryAssignment
2064    this.element = $(element)
2065    // jscs:enable requireDollarBeforejQueryAssignment
2066  }
2067
2068  Tab.VERSION = '3.3.5'
2069
2070  Tab.TRANSITION_DURATION = 150
2071
2072  Tab.prototype.show = function () {
2073    var $this    = this.element
2074    var $ul      = $this.closest('ul:not(.dropdown-menu)')
2075    var selector = $this.data('target')
2076
2077    if (!selector) {
2078      selector = $this.attr('href')
2079      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
2080    }
2081
2082    if ($this.parent('li').hasClass('active')) return
2083
2084    var $previous = $ul.find('.active:last a')
2085    var hideEvent = $.Event('hide.bs.tab', {
2086      relatedTarget: $this[0]
2087    })
2088    var showEvent = $.Event('show.bs.tab', {
2089      relatedTarget: $previous[0]
2090    })
2091
2092    $previous.trigger(hideEvent)
2093    $this.trigger(showEvent)
2094
2095    if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
2096
2097    var $target = $(selector)
2098
2099    this.activate($this.closest('li'), $ul)
2100    this.activate($target, $target.parent(), function () {
2101      $previous.trigger({
2102        type: 'hidden.bs.tab',
2103        relatedTarget: $this[0]
2104      })
2105      $this.trigger({
2106        type: 'shown.bs.tab',
2107        relatedTarget: $previous[0]
2108      })
2109    })
2110  }
2111
2112  Tab.prototype.activate = function (element, container, callback) {
2113    var $active    = container.find('> .active')
2114    var transition = callback
2115      && $.support.transition
2116      && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
2117
2118    function next() {
2119      $active
2120        .removeClass('active')
2121        .find('> .dropdown-menu > .active')
2122          .removeClass('active')
2123        .end()
2124        .find('[data-toggle="tab"]')
2125          .attr('aria-expanded', false)
2126
2127      element
2128        .addClass('active')
2129        .find('[data-toggle="tab"]')
2130          .attr('aria-expanded', true)
2131
2132      if (transition) {
2133        element[0].offsetWidth // reflow for transition
2134        element.addClass('in')
2135      } else {
2136        element.removeClass('fade')
2137      }
2138
2139      if (element.parent('.dropdown-menu').length) {
2140        element
2141          .closest('li.dropdown')
2142            .addClass('active')
2143          .end()
2144          .find('[data-toggle="tab"]')
2145            .attr('aria-expanded', true)
2146      }
2147
2148      callback && callback()
2149    }
2150
2151    $active.length && transition ?
2152      $active
2153        .one('bsTransitionEnd', next)
2154        .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
2155      next()
2156
2157    $active.removeClass('in')
2158  }
2159
2160
2161  // TAB PLUGIN DEFINITION
2162  // =====================
2163
2164  function Plugin(option) {
2165    return this.each(function () {
2166      var $this = $(this)
2167      var data  = $this.data('bs.tab')
2168
2169      if (!data) $this.data('bs.tab', (data = new Tab(this)))
2170      if (typeof option == 'string') data[option]()
2171    })
2172  }
2173
2174  var old = $.fn.tab
2175
2176  $.fn.tab             = Plugin
2177  $.fn.tab.Constructor = Tab
2178
2179
2180  // TAB NO CONFLICT
2181  // ===============
2182
2183  $.fn.tab.noConflict = function () {
2184    $.fn.tab = old
2185    return this
2186  }
2187
2188
2189  // TAB DATA-API
2190  // ============
2191
2192  var clickHandler = function (e) {
2193    e.preventDefault()
2194    Plugin.call($(this), 'show')
2195  }
2196
2197  $(document)
2198    .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
2199    .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
2200
2201}(jQuery);
2202
2203/* ========================================================================
2204 * Bootstrap: affix.js v3.3.5
2205 * http://getbootstrap.com/javascript/#affix
2206 * ========================================================================
2207 * Copyright 2011-2015 Twitter, Inc.
2208 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2209 * ======================================================================== */
2210
2211
2212+function ($) {
2213  'use strict';
2214
2215  // AFFIX CLASS DEFINITION
2216  // ======================
2217
2218  var Affix = function (element, options) {
2219    this.options = $.extend({}, Affix.DEFAULTS, options)
2220
2221    this.$target = $(this.options.target)
2222      .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
2223      .on('click.bs.affix.data-api',  $.proxy(this.checkPositionWithEventLoop, this))
2224
2225    this.$element     = $(element)
2226    this.affixed      = null
2227    this.unpin        = null
2228    this.pinnedOffset = null
2229
2230    this.checkPosition()
2231  }
2232
2233  Affix.VERSION  = '3.3.5'
2234
2235  Affix.RESET    = 'affix affix-top affix-bottom'
2236
2237  Affix.DEFAULTS = {
2238    offset: 0,
2239    target: window
2240  }
2241
2242  Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
2243    var scrollTop    = this.$target.scrollTop()
2244    var position     = this.$element.offset()
2245    var targetHeight = this.$target.height()
2246
2247    if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
2248
2249    if (this.affixed == 'bottom') {
2250      if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
2251      return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
2252    }
2253
2254    var initializing   = this.affixed == null
2255    var colliderTop    = initializing ? scrollTop : position.top
2256    var colliderHeight = initializing ? targetHeight : height
2257
2258    if (offsetTop != null && scrollTop <= offsetTop) return 'top'
2259    if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
2260
2261    return false
2262  }
2263
2264  Affix.prototype.getPinnedOffset = function () {
2265    if (this.pinnedOffset) return this.pinnedOffset
2266    this.$element.removeClass(Affix.RESET).addClass('affix')
2267    var scrollTop = this.$target.scrollTop()
2268    var position  = this.$element.offset()
2269    return (this.pinnedOffset = position.top - scrollTop)
2270  }
2271
2272  Affix.prototype.checkPositionWithEventLoop = function () {
2273    setTimeout($.proxy(this.checkPosition, this), 1)
2274  }
2275
2276  Affix.prototype.checkPosition = function () {
2277    if (!this.$element.is(':visible')) return
2278
2279    var height       = this.$element.height()
2280    var offset       = this.options.offset
2281    var offsetTop    = offset.top
2282    var offsetBottom = offset.bottom
2283    var scrollHeight = Math.max($(document).height(), $(document.body).height())
2284
2285    if (typeof offset != 'object')         offsetBottom = offsetTop = offset
2286    if (typeof offsetTop == 'function')    offsetTop    = offset.top(this.$element)
2287    if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
2288
2289    var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
2290
2291    if (this.affixed != affix) {
2292      if (this.unpin != null) this.$element.css('top', '')
2293
2294      var affixType = 'affix' + (affix ? '-' + affix : '')
2295      var e         = $.Event(affixType + '.bs.affix')
2296
2297      this.$element.trigger(e)
2298
2299      if (e.isDefaultPrevented()) return
2300
2301      this.affixed = affix
2302      this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
2303
2304      this.$element
2305        .removeClass(Affix.RESET)
2306        .addClass(affixType)
2307        .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
2308    }
2309
2310    if (affix == 'bottom') {
2311      this.$element.offset({
2312        top: scrollHeight - height - offsetBottom
2313      })
2314    }
2315  }
2316
2317
2318  // AFFIX PLUGIN DEFINITION
2319  // =======================
2320
2321  function Plugin(option) {
2322    return this.each(function () {
2323      var $this   = $(this)
2324      var data    = $this.data('bs.affix')
2325      var options = typeof option == 'object' && option
2326
2327      if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
2328      if (typeof option == 'string') data[option]()
2329    })
2330  }
2331
2332  var old = $.fn.affix
2333
2334  $.fn.affix             = Plugin
2335  $.fn.affix.Constructor = Affix
2336
2337
2338  // AFFIX NO CONFLICT
2339  // =================
2340
2341  $.fn.affix.noConflict = function () {
2342    $.fn.affix = old
2343    return this
2344  }
2345
2346
2347  // AFFIX DATA-API
2348  // ==============
2349
2350  $(window).on('load', function () {
2351    $('[data-spy="affix"]').each(function () {
2352      var $spy = $(this)
2353      var data = $spy.data()
2354
2355      data.offset = data.offset || {}
2356
2357      if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
2358      if (data.offsetTop    != null) data.offset.top    = data.offsetTop
2359
2360      Plugin.call($spy, data)
2361    })
2362  })
2363
2364}(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.