PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.5
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.5
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / matthiasmullie / minify / tests / js / sample / minified / bootstrap.js

bootstrap.js in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.2.5, at vendor/matthiasmullie/minify/tests/js/sample/minified/bootstrap.js

792 lines 45.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 return jQuery});if(typeof jQuery==='undefined'){throw new Error('Bootstrap\'s JavaScript requires jQuery')}+function($){'use strict';var version=$.fn.jquery.split(' ')[0].split('.')
2 if((version[0]<2&&version[1]<9)||(version[0]==1&&version[1]==9&&version[2]<1)||(version[0]>3)){throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')}}(jQuery);+function($){'use strict';function transitionEnd(){var el=document.createElement('bootstrap')
3 var transEndEventNames={WebkitTransition:'webkitTransitionEnd',MozTransition:'transitionend',OTransition:'oTransitionEnd otransitionend',transition:'transitionend'}
4 for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]}}}
5 return!1}
6 $.fn.emulateTransitionEnd=function(duration){var called=!1
7 var $el=this
8 $(this).one('bsTransitionEnd',function(){called=!0})
9 var callback=function(){if(!called)$($el).trigger($.support.transition.end)}
10 setTimeout(callback,duration)
11 return this}
12 $(function(){$.support.transition=transitionEnd()
13 if(!$.support.transition)return
14 $.event.special.bsTransitionEnd={bindType:$.support.transition.end,delegateType:$.support.transition.end,handle:function(e){if($(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}})}(jQuery);+function($){'use strict';var dismiss='[data-dismiss="alert"]'
15 var Alert=function(el){$(el).on('click',dismiss,this.close)}
16 Alert.VERSION='3.3.7'
17 Alert.TRANSITION_DURATION=150
18 Alert.prototype.close=function(e){var $this=$(this)
19 var selector=$this.attr('data-target')
20 if(!selector){selector=$this.attr('href')
21 selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
22 var $parent=$(selector==='#'?[]:selector)
23 if(e)e.preventDefault()
24 if(!$parent.length){$parent=$this.closest('.alert')}
25 $parent.trigger(e=$.Event('close.bs.alert'))
26 if(e.isDefaultPrevented())return
27 $parent.removeClass('in')
28 function removeElement(){$parent.detach().trigger('closed.bs.alert').remove()}
29 $.support.transition&&$parent.hasClass('fade')?$parent.one('bsTransitionEnd',removeElement).emulateTransitionEnd(Alert.TRANSITION_DURATION):removeElement()}
30 function Plugin(option){return this.each(function(){var $this=$(this)
31 var data=$this.data('bs.alert')
32 if(!data)$this.data('bs.alert',(data=new Alert(this)))
33 if(typeof option=='string')data[option].call($this)})}
34 var old=$.fn.alert
35 $.fn.alert=Plugin
36 $.fn.alert.Constructor=Alert
37 $.fn.alert.noConflict=function(){$.fn.alert=old
38 return this}
39 $(document).on('click.bs.alert.data-api',dismiss,Alert.prototype.close)}(jQuery);+function($){'use strict';var Button=function(element,options){this.$element=$(element)
40 this.options=$.extend({},Button.DEFAULTS,options)
41 this.isLoading=!1}
42 Button.VERSION='3.3.7'
43 Button.DEFAULTS={loadingText:'loading...'}
44 Button.prototype.setState=function(state){var d='disabled'
45 var $el=this.$element
46 var val=$el.is('input')?'val':'html'
47 var data=$el.data()
48 state+='Text'
49 if(data.resetText==null)$el.data('resetText',$el[val]())
50 setTimeout($.proxy(function(){$el[val](data[state]==null?this.options[state]:data[state])
51 if(state=='loadingText'){this.isLoading=!0
52 $el.addClass(d).attr(d,d).prop(d,!0)}else if(this.isLoading){this.isLoading=!1
53 $el.removeClass(d).removeAttr(d).prop(d,!1)}},this),0)}
54 Button.prototype.toggle=function(){var changed=!0
55 var $parent=this.$element.closest('[data-toggle="buttons"]')
56 if($parent.length){var $input=this.$element.find('input')
57 if($input.prop('type')=='radio'){if($input.prop('checked'))changed=!1
58 $parent.find('.active').removeClass('active')
59 this.$element.addClass('active')}else if($input.prop('type')=='checkbox'){if(($input.prop('checked'))!==this.$element.hasClass('active'))changed=!1
60 this.$element.toggleClass('active')}
61 $input.prop('checked',this.$element.hasClass('active'))
62 if(changed)$input.trigger('change')}else{this.$element.attr('aria-pressed',!this.$element.hasClass('active'))
63 this.$element.toggleClass('active')}}
64 function Plugin(option){return this.each(function(){var $this=$(this)
65 var data=$this.data('bs.button')
66 var options=typeof option=='object'&&option
67 if(!data)$this.data('bs.button',(data=new Button(this,options)))
68 if(option=='toggle')data.toggle()
69 else if(option)data.setState(option)})}
70 var old=$.fn.button
71 $.fn.button=Plugin
72 $.fn.button.Constructor=Button
73 $.fn.button.noConflict=function(){$.fn.button=old
74 return this}
75 $(document).on('click.bs.button.data-api','[data-toggle^="button"]',function(e){var $btn=$(e.target).closest('.btn')
76 Plugin.call($btn,'toggle')
77 if(!($(e.target).is('input[type="radio"], input[type="checkbox"]'))){e.preventDefault()
78 if($btn.is('input,button'))$btn.trigger('focus')
79 else $btn.find('input:visible,button:visible').first().trigger('focus')}}).on('focus.bs.button.data-api blur.bs.button.data-api','[data-toggle^="button"]',function(e){$(e.target).closest('.btn').toggleClass('focus',/^focus(in)?$/.test(e.type))})}(jQuery);+function($){'use strict';var Carousel=function(element,options){this.$element=$(element)
80 this.$indicators=this.$element.find('.carousel-indicators')
81 this.options=options
82 this.paused=null
83 this.sliding=null
84 this.interval=null
85 this.$active=null
86 this.$items=null
87 this.options.keyboard&&this.$element.on('keydown.bs.carousel',$.proxy(this.keydown,this))
88 this.options.pause=='hover'&&!('ontouchstart' in document.documentElement)&&this.$element.on('mouseenter.bs.carousel',$.proxy(this.pause,this)).on('mouseleave.bs.carousel',$.proxy(this.cycle,this))}
89 Carousel.VERSION='3.3.7'
90 Carousel.TRANSITION_DURATION=600
91 Carousel.DEFAULTS={interval:5000,pause:'hover',wrap:!0,keyboard:!0}
92 Carousel.prototype.keydown=function(e){if(/input|textarea/i.test(e.target.tagName))return
93 switch(e.which){case 37:this.prev();break
94 case 39:this.next();break
95 default:return}
96 e.preventDefault()}
97 Carousel.prototype.cycle=function(e){e||(this.paused=!1)
98 this.interval&&clearInterval(this.interval)
99 this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval))
100 return this}
101 Carousel.prototype.getItemIndex=function(item){this.$items=item.parent().children('.item')
102 return this.$items.index(item||this.$active)}
103 Carousel.prototype.getItemForDirection=function(direction,active){var activeIndex=this.getItemIndex(active)
104 var willWrap=(direction=='prev'&&activeIndex===0)||(direction=='next'&&activeIndex==(this.$items.length-1))
105 if(willWrap&&!this.options.wrap)return active
106 var delta=direction=='prev'?-1:1
107 var itemIndex=(activeIndex+delta)%this.$items.length
108 return this.$items.eq(itemIndex)}
109 Carousel.prototype.to=function(pos){var that=this
110 var activeIndex=this.getItemIndex(this.$active=this.$element.find('.item.active'))
111 if(pos>(this.$items.length-1)||pos<0)return
112 if(this.sliding)return this.$element.one('slid.bs.carousel',function(){that.to(pos)})
113 if(activeIndex==pos)return this.pause().cycle()
114 return this.slide(pos>activeIndex?'next':'prev',this.$items.eq(pos))}
115 Carousel.prototype.pause=function(e){e||(this.paused=!0)
116 if(this.$element.find('.next, .prev').length&&$.support.transition){this.$element.trigger($.support.transition.end)
117 this.cycle(!0)}
118 this.interval=clearInterval(this.interval)
119 return this}
120 Carousel.prototype.next=function(){if(this.sliding)return
121 return this.slide('next')}
122 Carousel.prototype.prev=function(){if(this.sliding)return
123 return this.slide('prev')}
124 Carousel.prototype.slide=function(type,next){var $active=this.$element.find('.item.active')
125 var $next=next||this.getItemForDirection(type,$active)
126 var isCycling=this.interval
127 var direction=type=='next'?'left':'right'
128 var that=this
129 if($next.hasClass('active'))return(this.sliding=!1)
130 var relatedTarget=$next[0]
131 var slideEvent=$.Event('slide.bs.carousel',{relatedTarget:relatedTarget,direction:direction})
132 this.$element.trigger(slideEvent)
133 if(slideEvent.isDefaultPrevented())return
134 this.sliding=!0
135 isCycling&&this.pause()
136 if(this.$indicators.length){this.$indicators.find('.active').removeClass('active')
137 var $nextIndicator=$(this.$indicators.children()[this.getItemIndex($next)])
138 $nextIndicator&&$nextIndicator.addClass('active')}
139 var slidEvent=$.Event('slid.bs.carousel',{relatedTarget:relatedTarget,direction:direction})
140 if($.support.transition&&this.$element.hasClass('slide')){$next.addClass(type)
141 $next[0].offsetWidth
142 $active.addClass(direction)
143 $next.addClass(direction)
144 $active.one('bsTransitionEnd',function(){$next.removeClass([type,direction].join(' ')).addClass('active')
145 $active.removeClass(['active',direction].join(' '))
146 that.sliding=!1
147 setTimeout(function(){that.$element.trigger(slidEvent)},0)}).emulateTransitionEnd(Carousel.TRANSITION_DURATION)}else{$active.removeClass('active')
148 $next.addClass('active')
149 this.sliding=!1
150 this.$element.trigger(slidEvent)}
151 isCycling&&this.cycle()
152 return this}
153 function Plugin(option){return this.each(function(){var $this=$(this)
154 var data=$this.data('bs.carousel')
155 var options=$.extend({},Carousel.DEFAULTS,$this.data(),typeof option=='object'&&option)
156 var action=typeof option=='string'?option:options.slide
157 if(!data)$this.data('bs.carousel',(data=new Carousel(this,options)))
158 if(typeof option=='number')data.to(option)
159 else if(action)data[action]()
160 else if(options.interval)data.pause().cycle()})}
161 var old=$.fn.carousel
162 $.fn.carousel=Plugin
163 $.fn.carousel.Constructor=Carousel
164 $.fn.carousel.noConflict=function(){$.fn.carousel=old
165 return this}
166 var clickHandler=function(e){var href
167 var $this=$(this)
168 var $target=$($this.attr('data-target')||(href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,''))
169 if(!$target.hasClass('carousel'))return
170 var options=$.extend({},$target.data(),$this.data())
171 var slideIndex=$this.attr('data-slide-to')
172 if(slideIndex)options.interval=!1
173 Plugin.call($target,options)
174 if(slideIndex){$target.data('bs.carousel').to(slideIndex)}
175 e.preventDefault()}
176 $(document).on('click.bs.carousel.data-api','[data-slide]',clickHandler).on('click.bs.carousel.data-api','[data-slide-to]',clickHandler)
177 $(window).on('load',function(){$('[data-ride="carousel"]').each(function(){var $carousel=$(this)
178 Plugin.call($carousel,$carousel.data())})})}(jQuery);+function($){'use strict';var Collapse=function(element,options){this.$element=$(element)
179 this.options=$.extend({},Collapse.DEFAULTS,options)
180 this.$trigger=$('[data-toggle="collapse"][href="#'+element.id+'"],'+'[data-toggle="collapse"][data-target="#'+element.id+'"]')
181 this.transitioning=null
182 if(this.options.parent){this.$parent=this.getParent()}else{this.addAriaAndCollapsedClass(this.$element,this.$trigger)}
183 if(this.options.toggle)this.toggle()}
184 Collapse.VERSION='3.3.7'
185 Collapse.TRANSITION_DURATION=350
186 Collapse.DEFAULTS={toggle:!0}
187 Collapse.prototype.dimension=function(){var hasWidth=this.$element.hasClass('width')
188 return hasWidth?'width':'height'}
189 Collapse.prototype.show=function(){if(this.transitioning||this.$element.hasClass('in'))return
190 var activesData
191 var actives=this.$parent&&this.$parent.children('.panel').children('.in, .collapsing')
192 if(actives&&actives.length){activesData=actives.data('bs.collapse')
193 if(activesData&&activesData.transitioning)return}
194 var startEvent=$.Event('show.bs.collapse')
195 this.$element.trigger(startEvent)
196 if(startEvent.isDefaultPrevented())return
197 if(actives&&actives.length){Plugin.call(actives,'hide')
198 activesData||actives.data('bs.collapse',null)}
199 var dimension=this.dimension()
200 this.$element.removeClass('collapse').addClass('collapsing')[dimension](0).attr('aria-expanded',!0)
201 this.$trigger.removeClass('collapsed').attr('aria-expanded',!0)
202 this.transitioning=1
203 var complete=function(){this.$element.removeClass('collapsing').addClass('collapse in')[dimension]('')
204 this.transitioning=0
205 this.$element.trigger('shown.bs.collapse')}
206 if(!$.support.transition)return complete.call(this)
207 var scrollSize=$.camelCase(['scroll',dimension].join('-'))
208 this.$element.one('bsTransitionEnd',$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])}
209 Collapse.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass('in'))return
210 var startEvent=$.Event('hide.bs.collapse')
211 this.$element.trigger(startEvent)
212 if(startEvent.isDefaultPrevented())return
213 var dimension=this.dimension()
214 this.$element[dimension](this.$element[dimension]())[0].offsetHeight
215 this.$element.addClass('collapsing').removeClass('collapse in').attr('aria-expanded',!1)
216 this.$trigger.addClass('collapsed').attr('aria-expanded',!1)
217 this.transitioning=1
218 var complete=function(){this.transitioning=0
219 this.$element.removeClass('collapsing').addClass('collapse').trigger('hidden.bs.collapse')}
220 if(!$.support.transition)return complete.call(this)
221 this.$element[dimension](0).one('bsTransitionEnd',$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)}
222 Collapse.prototype.toggle=function(){this[this.$element.hasClass('in')?'hide':'show']()}
223 Collapse.prototype.getParent=function(){return $(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each($.proxy(function(i,element){var $element=$(element)
224 this.addAriaAndCollapsedClass(getTargetFromTrigger($element),$element)},this)).end()}
225 Collapse.prototype.addAriaAndCollapsedClass=function($element,$trigger){var isOpen=$element.hasClass('in')
226 $element.attr('aria-expanded',isOpen)
227 $trigger.toggleClass('collapsed',!isOpen).attr('aria-expanded',isOpen)}
228 function getTargetFromTrigger($trigger){var href
229 var target=$trigger.attr('data-target')||(href=$trigger.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,'')
230 return $(target)}
231 function Plugin(option){return this.each(function(){var $this=$(this)
232 var data=$this.data('bs.collapse')
233 var options=$.extend({},Collapse.DEFAULTS,$this.data(),typeof option=='object'&&option)
234 if(!data&&options.toggle&&/show|hide/.test(option))options.toggle=!1
235 if(!data)$this.data('bs.collapse',(data=new Collapse(this,options)))
236 if(typeof option=='string')data[option]()})}
237 var old=$.fn.collapse
238 $.fn.collapse=Plugin
239 $.fn.collapse.Constructor=Collapse
240 $.fn.collapse.noConflict=function(){$.fn.collapse=old
241 return this}
242 $(document).on('click.bs.collapse.data-api','[data-toggle="collapse"]',function(e){var $this=$(this)
243 if(!$this.attr('data-target'))e.preventDefault()
244 var $target=getTargetFromTrigger($this)
245 var data=$target.data('bs.collapse')
246 var option=data?'toggle':$this.data()
247 Plugin.call($target,option)})}(jQuery);+function($){'use strict';var backdrop='.dropdown-backdrop'
248 var toggle='[data-toggle="dropdown"]'
249 var Dropdown=function(element){$(element).on('click.bs.dropdown',this.toggle)}
250 Dropdown.VERSION='3.3.7'
251 function getParent($this){var selector=$this.attr('data-target')
252 if(!selector){selector=$this.attr('href')
253 selector=selector&&/#[A-Za-z]/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,'')}
254 var $parent=selector&&$(selector)
255 return $parent&&$parent.length?$parent:$this.parent()}
256 function clearMenus(e){if(e&&e.which===3)return
257 $(backdrop).remove()
258 $(toggle).each(function(){var $this=$(this)
259 var $parent=getParent($this)
260 var relatedTarget={relatedTarget:this}
261 if(!$parent.hasClass('open'))return
262 if(e&&e.type=='click'&&/input|textarea/i.test(e.target.tagName)&&$.contains($parent[0],e.target))return
263 $parent.trigger(e=$.Event('hide.bs.dropdown',relatedTarget))
264 if(e.isDefaultPrevented())return
265 $this.attr('aria-expanded','false')
266 $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown',relatedTarget))})}
267 Dropdown.prototype.toggle=function(e){var $this=$(this)
268 if($this.is('.disabled, :disabled'))return
269 var $parent=getParent($this)
270 var isActive=$parent.hasClass('open')
271 clearMenus()
272 if(!isActive){if('ontouchstart' in document.documentElement&&!$parent.closest('.navbar-nav').length){$(document.createElement('div')).addClass('dropdown-backdrop').insertAfter($(this)).on('click',clearMenus)}
273 var relatedTarget={relatedTarget:this}
274 $parent.trigger(e=$.Event('show.bs.dropdown',relatedTarget))
275 if(e.isDefaultPrevented())return
276 $this.trigger('focus').attr('aria-expanded','true')
277 $parent.toggleClass('open').trigger($.Event('shown.bs.dropdown',relatedTarget))}
278 return!1}
279 Dropdown.prototype.keydown=function(e){if(!/(38|40|27|32)/.test(e.which)||/input|textarea/i.test(e.target.tagName))return
280 var $this=$(this)
281 e.preventDefault()
282 e.stopPropagation()
283 if($this.is('.disabled, :disabled'))return
284 var $parent=getParent($this)
285 var isActive=$parent.hasClass('open')
286 if(!isActive&&e.which!=27||isActive&&e.which==27){if(e.which==27)$parent.find(toggle).trigger('focus')
287 return $this.trigger('click')}
288 var desc=' li:not(.disabled):visible a'
289 var $items=$parent.find('.dropdown-menu'+desc)
290 if(!$items.length)return
291 var index=$items.index(e.target)
292 if(e.which==38&&index>0)index--
293 if(e.which==40&&index<$items.length-1)index++
294 if(!~index)index=0
295 $items.eq(index).trigger('focus')}
296 function Plugin(option){return this.each(function(){var $this=$(this)
297 var data=$this.data('bs.dropdown')
298 if(!data)$this.data('bs.dropdown',(data=new Dropdown(this)))
299 if(typeof option=='string')data[option].call($this)})}
300 var old=$.fn.dropdown
301 $.fn.dropdown=Plugin
302 $.fn.dropdown.Constructor=Dropdown
303 $.fn.dropdown.noConflict=function(){$.fn.dropdown=old
304 return this}
305 $(document).on('click.bs.dropdown.data-api',clearMenus).on('click.bs.dropdown.data-api','.dropdown form',function(e){e.stopPropagation()}).on('click.bs.dropdown.data-api',toggle,Dropdown.prototype.toggle).on('keydown.bs.dropdown.data-api',toggle,Dropdown.prototype.keydown).on('keydown.bs.dropdown.data-api','.dropdown-menu',Dropdown.prototype.keydown)}(jQuery);+function($){'use strict';var Modal=function(element,options){this.options=options
306 this.$body=$(document.body)
307 this.$element=$(element)
308 this.$dialog=this.$element.find('.modal-dialog')
309 this.$backdrop=null
310 this.isShown=null
311 this.originalBodyPad=null
312 this.scrollbarWidth=0
313 this.ignoreBackdropClick=!1
314 if(this.options.remote){this.$element.find('.modal-content').load(this.options.remote,$.proxy(function(){this.$element.trigger('loaded.bs.modal')},this))}}
315 Modal.VERSION='3.3.7'
316 Modal.TRANSITION_DURATION=300
317 Modal.BACKDROP_TRANSITION_DURATION=150
318 Modal.DEFAULTS={backdrop:!0,keyboard:!0,show:!0}
319 Modal.prototype.toggle=function(_relatedTarget){return this.isShown?this.hide():this.show(_relatedTarget)}
320 Modal.prototype.show=function(_relatedTarget){var that=this
321 var e=$.Event('show.bs.modal',{relatedTarget:_relatedTarget})
322 this.$element.trigger(e)
323 if(this.isShown||e.isDefaultPrevented())return
324 this.isShown=!0
325 this.checkScrollbar()
326 this.setScrollbar()
327 this.$body.addClass('modal-open')
328 this.escape()
329 this.resize()
330 this.$element.on('click.dismiss.bs.modal','[data-dismiss="modal"]',$.proxy(this.hide,this))
331 this.$dialog.on('mousedown.dismiss.bs.modal',function(){that.$element.one('mouseup.dismiss.bs.modal',function(e){if($(e.target).is(that.$element))that.ignoreBackdropClick=!0})})
332 this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass('fade')
333 if(!that.$element.parent().length){that.$element.appendTo(that.$body)}
334 that.$element.show().scrollTop(0)
335 that.adjustDialog()
336 if(transition){that.$element[0].offsetWidth}
337 that.$element.addClass('in')
338 that.enforceFocus()
339 var e=$.Event('shown.bs.modal',{relatedTarget:_relatedTarget})
340 transition?that.$dialog.one('bsTransitionEnd',function(){that.$element.trigger('focus').trigger(e)}).emulateTransitionEnd(Modal.TRANSITION_DURATION):that.$element.trigger('focus').trigger(e)})}
341 Modal.prototype.hide=function(e){if(e)e.preventDefault()
342 e=$.Event('hide.bs.modal')
343 this.$element.trigger(e)
344 if(!this.isShown||e.isDefaultPrevented())return
345 this.isShown=!1
346 this.escape()
347 this.resize()
348 $(document).off('focusin.bs.modal')
349 this.$element.removeClass('in').off('click.dismiss.bs.modal').off('mouseup.dismiss.bs.modal')
350 this.$dialog.off('mousedown.dismiss.bs.modal')
351 $.support.transition&&this.$element.hasClass('fade')?this.$element.one('bsTransitionEnd',$.proxy(this.hideModal,this)).emulateTransitionEnd(Modal.TRANSITION_DURATION):this.hideModal()}
352 Modal.prototype.enforceFocus=function(){$(document).off('focusin.bs.modal').on('focusin.bs.modal',$.proxy(function(e){if(document!==e.target&&this.$element[0]!==e.target&&!this.$element.has(e.target).length){this.$element.trigger('focus')}},this))}
353 Modal.prototype.escape=function(){if(this.isShown&&this.options.keyboard){this.$element.on('keydown.dismiss.bs.modal',$.proxy(function(e){e.which==27&&this.hide()},this))}else if(!this.isShown){this.$element.off('keydown.dismiss.bs.modal')}}
354 Modal.prototype.resize=function(){if(this.isShown){$(window).on('resize.bs.modal',$.proxy(this.handleUpdate,this))}else{$(window).off('resize.bs.modal')}}
355 Modal.prototype.hideModal=function(){var that=this
356 this.$element.hide()
357 this.backdrop(function(){that.$body.removeClass('modal-open')
358 that.resetAdjustments()
359 that.resetScrollbar()
360 that.$element.trigger('hidden.bs.modal')})}
361 Modal.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove()
362 this.$backdrop=null}
363 Modal.prototype.backdrop=function(callback){var that=this
364 var animate=this.$element.hasClass('fade')?'fade':''
365 if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate
366 this.$backdrop=$(document.createElement('div')).addClass('modal-backdrop '+animate).appendTo(this.$body)
367 this.$element.on('click.dismiss.bs.modal',$.proxy(function(e){if(this.ignoreBackdropClick){this.ignoreBackdropClick=!1
368 return}
369 if(e.target!==e.currentTarget)return
370 this.options.backdrop=='static'?this.$element[0].focus():this.hide()},this))
371 if(doAnimate)this.$backdrop[0].offsetWidth
372 this.$backdrop.addClass('in')
373 if(!callback)return
374 doAnimate?this.$backdrop.one('bsTransitionEnd',callback).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callback()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass('in')
375 var callbackRemove=function(){that.removeBackdrop()
376 callback&&callback()}
377 $.support.transition&&this.$element.hasClass('fade')?this.$backdrop.one('bsTransitionEnd',callbackRemove).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callbackRemove()}else if(callback){callback()}}
378 Modal.prototype.handleUpdate=function(){this.adjustDialog()}
379 Modal.prototype.adjustDialog=function(){var modalIsOverflowing=this.$element[0].scrollHeight>document.documentElement.clientHeight
380 this.$element.css({paddingLeft:!this.bodyIsOverflowing&&modalIsOverflowing?this.scrollbarWidth:'',paddingRight:this.bodyIsOverflowing&&!modalIsOverflowing?this.scrollbarWidth:''})}
381 Modal.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:'',paddingRight:''})}
382 Modal.prototype.checkScrollbar=function(){var fullWindowWidth=window.innerWidth
383 if(!fullWindowWidth){var documentElementRect=document.documentElement.getBoundingClientRect()
384 fullWindowWidth=documentElementRect.right-Math.abs(documentElementRect.left)}
385 this.bodyIsOverflowing=document.body.clientWidth<fullWindowWidth
386 this.scrollbarWidth=this.measureScrollbar()}
387 Modal.prototype.setScrollbar=function(){var bodyPad=parseInt((this.$body.css('padding-right')||0),10)
388 this.originalBodyPad=document.body.style.paddingRight||''
389 if(this.bodyIsOverflowing)this.$body.css('padding-right',bodyPad+this.scrollbarWidth)}
390 Modal.prototype.resetScrollbar=function(){this.$body.css('padding-right',this.originalBodyPad)}
391 Modal.prototype.measureScrollbar=function(){var scrollDiv=document.createElement('div')
392 scrollDiv.className='modal-scrollbar-measure'
393 this.$body.append(scrollDiv)
394 var scrollbarWidth=scrollDiv.offsetWidth-scrollDiv.clientWidth
395 this.$body[0].removeChild(scrollDiv)
396 return scrollbarWidth}
397 function Plugin(option,_relatedTarget){return this.each(function(){var $this=$(this)
398 var data=$this.data('bs.modal')
399 var options=$.extend({},Modal.DEFAULTS,$this.data(),typeof option=='object'&&option)
400 if(!data)$this.data('bs.modal',(data=new Modal(this,options)))
401 if(typeof option=='string')data[option](_relatedTarget)
402 else if(options.show)data.show(_relatedTarget)})}
403 var old=$.fn.modal
404 $.fn.modal=Plugin
405 $.fn.modal.Constructor=Modal
406 $.fn.modal.noConflict=function(){$.fn.modal=old
407 return this}
408 $(document).on('click.bs.modal.data-api','[data-toggle="modal"]',function(e){var $this=$(this)
409 var href=$this.attr('href')
410 var $target=$($this.attr('data-target')||(href&&href.replace(/.*(?=#[^\s]+$)/,'')))
411 var option=$target.data('bs.modal')?'toggle':$.extend({remote:!/#/.test(href)&&href},$target.data(),$this.data())
412 if($this.is('a'))e.preventDefault()
413 $target.one('show.bs.modal',function(showEvent){if(showEvent.isDefaultPrevented())return
414 $target.one('hidden.bs.modal',function(){$this.is(':visible')&&$this.trigger('focus')})})
415 Plugin.call($target,option,this)})}(jQuery);+function($){'use strict';var Tooltip=function(element,options){this.type=null
416 this.options=null
417 this.enabled=null
418 this.timeout=null
419 this.hoverState=null
420 this.$element=null
421 this.inState=null
422 this.init('tooltip',element,options)}
423 Tooltip.VERSION='3.3.7'
424 Tooltip.TRANSITION_DURATION=150
425 Tooltip.DEFAULTS={animation:!0,placement:'top',selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:'hover focus',title:'',delay:0,html:!1,container:!1,viewport:{selector:'body',padding:0}}
426 Tooltip.prototype.init=function(type,element,options){this.enabled=!0
427 this.type=type
428 this.$element=$(element)
429 this.options=this.getOptions(options)
430 this.$viewport=this.options.viewport&&$($.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):(this.options.viewport.selector||this.options.viewport))
431 this.inState={click:!1,hover:!1,focus:!1}
432 if(this.$element[0]instanceof document.constructor&&!this.options.selector){throw new Error('`selector` option must be specified when initializing '+this.type+' on the window.document object!')}
433 var triggers=this.options.trigger.split(' ')
434 for(var i=triggers.length;i--;){var trigger=triggers[i]
435 if(trigger=='click'){this.$element.on('click.'+this.type,this.options.selector,$.proxy(this.toggle,this))}else if(trigger!='manual'){var eventIn=trigger=='hover'?'mouseenter':'focusin'
436 var eventOut=trigger=='hover'?'mouseleave':'focusout'
437 this.$element.on(eventIn+'.'+this.type,this.options.selector,$.proxy(this.enter,this))
438 this.$element.on(eventOut+'.'+this.type,this.options.selector,$.proxy(this.leave,this))}}
439 this.options.selector?(this._options=$.extend({},this.options,{trigger:'manual',selector:''})):this.fixTitle()}
440 Tooltip.prototype.getDefaults=function(){return Tooltip.DEFAULTS}
441 Tooltip.prototype.getOptions=function(options){options=$.extend({},this.getDefaults(),this.$element.data(),options)
442 if(options.delay&&typeof options.delay=='number'){options.delay={show:options.delay,hide:options.delay}}
443 return options}
444 Tooltip.prototype.getDelegateOptions=function(){var options={}
445 var defaults=this.getDefaults()
446 this._options&&$.each(this._options,function(key,value){if(defaults[key]!=value)options[key]=value})
447 return options}
448 Tooltip.prototype.enter=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type)
449 if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions())
450 $(obj.currentTarget).data('bs.'+this.type,self)}
451 if(obj instanceof $.Event){self.inState[obj.type=='focusin'?'focus':'hover']=!0}
452 if(self.tip().hasClass('in')||self.hoverState=='in'){self.hoverState='in'
453 return}
454 clearTimeout(self.timeout)
455 self.hoverState='in'
456 if(!self.options.delay||!self.options.delay.show)return self.show()
457 self.timeout=setTimeout(function(){if(self.hoverState=='in')self.show()},self.options.delay.show)}
458 Tooltip.prototype.isInStateTrue=function(){for(var key in this.inState){if(this.inState[key])return!0}
459 return!1}
460 Tooltip.prototype.leave=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type)
461 if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions())
462 $(obj.currentTarget).data('bs.'+this.type,self)}
463 if(obj instanceof $.Event){self.inState[obj.type=='focusout'?'focus':'hover']=!1}
464 if(self.isInStateTrue())return
465 clearTimeout(self.timeout)
466 self.hoverState='out'
467 if(!self.options.delay||!self.options.delay.hide)return self.hide()
468 self.timeout=setTimeout(function(){if(self.hoverState=='out')self.hide()},self.options.delay.hide)}
469 Tooltip.prototype.show=function(){var e=$.Event('show.bs.'+this.type)
470 if(this.hasContent()&&this.enabled){this.$element.trigger(e)
471 var inDom=$.contains(this.$element[0].ownerDocument.documentElement,this.$element[0])
472 if(e.isDefaultPrevented()||!inDom)return
473 var that=this
474 var $tip=this.tip()
475 var tipId=this.getUID(this.type)
476 this.setContent()
477 $tip.attr('id',tipId)
478 this.$element.attr('aria-describedby',tipId)
479 if(this.options.animation)$tip.addClass('fade')
480 var placement=typeof this.options.placement=='function'?this.options.placement.call(this,$tip[0],this.$element[0]):this.options.placement
481 var autoToken=/\s?auto?\s?/i
482 var autoPlace=autoToken.test(placement)
483 if(autoPlace)placement=placement.replace(autoToken,'')||'top'
484 $tip.detach().css({top:0,left:0,display:'block'}).addClass(placement).data('bs.'+this.type,this)
485 this.options.container?$tip.appendTo(this.options.container):$tip.insertAfter(this.$element)
486 this.$element.trigger('inserted.bs.'+this.type)
487 var pos=this.getPosition()
488 var actualWidth=$tip[0].offsetWidth
489 var actualHeight=$tip[0].offsetHeight
490 if(autoPlace){var orgPlacement=placement
491 var viewportDim=this.getPosition(this.$viewport)
492 placement=placement=='bottom'&&pos.bottom+actualHeight>viewportDim.bottom?'top':placement=='top'&&pos.top-actualHeight<viewportDim.top?'bottom':placement=='right'&&pos.right+actualWidth>viewportDim.width?'left':placement=='left'&&pos.left-actualWidth<viewportDim.left?'right':placement
493 $tip.removeClass(orgPlacement).addClass(placement)}
494 var calculatedOffset=this.getCalculatedOffset(placement,pos,actualWidth,actualHeight)
495 this.applyPlacement(calculatedOffset,placement)
496 var complete=function(){var prevHoverState=that.hoverState
497 that.$element.trigger('shown.bs.'+that.type)
498 that.hoverState=null
499 if(prevHoverState=='out')that.leave(that)}
500 $.support.transition&&this.$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete()}}
501 Tooltip.prototype.applyPlacement=function(offset,placement){var $tip=this.tip()
502 var width=$tip[0].offsetWidth
503 var height=$tip[0].offsetHeight
504 var marginTop=parseInt($tip.css('margin-top'),10)
505 var marginLeft=parseInt($tip.css('margin-left'),10)
506 if(isNaN(marginTop))marginTop=0
507 if(isNaN(marginLeft))marginLeft=0
508 offset.top+=marginTop
509 offset.left+=marginLeft
510 $.offset.setOffset($tip[0],$.extend({using:function(props){$tip.css({top:Math.round(props.top),left:Math.round(props.left)})}},offset),0)
511 $tip.addClass('in')
512 var actualWidth=$tip[0].offsetWidth
513 var actualHeight=$tip[0].offsetHeight
514 if(placement=='top'&&actualHeight!=height){offset.top=offset.top+height-actualHeight}
515 var delta=this.getViewportAdjustedDelta(placement,offset,actualWidth,actualHeight)
516 if(delta.left)offset.left+=delta.left
517 else offset.top+=delta.top
518 var isVertical=/top|bottom/.test(placement)
519 var arrowDelta=isVertical?delta.left*2-width+actualWidth:delta.top*2-height+actualHeight
520 var arrowOffsetPosition=isVertical?'offsetWidth':'offsetHeight'
521 $tip.offset(offset)
522 this.replaceArrow(arrowDelta,$tip[0][arrowOffsetPosition],isVertical)}
523 Tooltip.prototype.replaceArrow=function(delta,dimension,isVertical){this.arrow().css(isVertical?'left':'top',50*(1-delta/dimension)+'%').css(isVertical?'top':'left','')}
524 Tooltip.prototype.setContent=function(){var $tip=this.tip()
525 var title=this.getTitle()
526 $tip.find('.tooltip-inner')[this.options.html?'html':'text'](title)
527 $tip.removeClass('fade in top bottom left right')}
528 Tooltip.prototype.hide=function(callback){var that=this
529 var $tip=$(this.$tip)
530 var e=$.Event('hide.bs.'+this.type)
531 function complete(){if(that.hoverState!='in')$tip.detach()
532 if(that.$element){that.$element.removeAttr('aria-describedby').trigger('hidden.bs.'+that.type)}
533 callback&&callback()}
534 this.$element.trigger(e)
535 if(e.isDefaultPrevented())return
536 $tip.removeClass('in')
537 $.support.transition&&$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete()
538 this.hoverState=null
539 return this}
540 Tooltip.prototype.fixTitle=function(){var $e=this.$element
541 if($e.attr('title')||typeof $e.attr('data-original-title')!='string'){$e.attr('data-original-title',$e.attr('title')||'').attr('title','')}}
542 Tooltip.prototype.hasContent=function(){return this.getTitle()}
543 Tooltip.prototype.getPosition=function($element){$element=$element||this.$element
544 var el=$element[0]
545 var isBody=el.tagName=='BODY'
546 var elRect=el.getBoundingClientRect()
547 if(elRect.width==null){elRect=$.extend({},elRect,{width:elRect.right-elRect.left,height:elRect.bottom-elRect.top})}
548 var isSvg=window.SVGElement&&el instanceof window.SVGElement
549 var elOffset=isBody?{top:0,left:0}:(isSvg?null:$element.offset())
550 var scroll={scroll:isBody?document.documentElement.scrollTop||document.body.scrollTop:$element.scrollTop()}
551 var outerDims=isBody?{width:$(window).width(),height:$(window).height()}:null
552 return $.extend({},elRect,scroll,outerDims,elOffset)}
553 Tooltip.prototype.getCalculatedOffset=function(placement,pos,actualWidth,actualHeight){return placement=='bottom'?{top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}:placement=='top'?{top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2}:placement=='left'?{top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth}:{top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width}}
554 Tooltip.prototype.getViewportAdjustedDelta=function(placement,pos,actualWidth,actualHeight){var delta={top:0,left:0}
555 if(!this.$viewport)return delta
556 var viewportPadding=this.options.viewport&&this.options.viewport.padding||0
557 var viewportDimensions=this.getPosition(this.$viewport)
558 if(/right|left/.test(placement)){var topEdgeOffset=pos.top-viewportPadding-viewportDimensions.scroll
559 var bottomEdgeOffset=pos.top+viewportPadding-viewportDimensions.scroll+actualHeight
560 if(topEdgeOffset<viewportDimensions.top){delta.top=viewportDimensions.top-topEdgeOffset}else if(bottomEdgeOffset>viewportDimensions.top+viewportDimensions.height){delta.top=viewportDimensions.top+viewportDimensions.height-bottomEdgeOffset}}else{var leftEdgeOffset=pos.left-viewportPadding
561 var rightEdgeOffset=pos.left+viewportPadding+actualWidth
562 if(leftEdgeOffset<viewportDimensions.left){delta.left=viewportDimensions.left-leftEdgeOffset}else if(rightEdgeOffset>viewportDimensions.right){delta.left=viewportDimensions.left+viewportDimensions.width-rightEdgeOffset}}
563 return delta}
564 Tooltip.prototype.getTitle=function(){var title
565 var $e=this.$element
566 var o=this.options
567 title=$e.attr('data-original-title')||(typeof o.title=='function'?o.title.call($e[0]):o.title)
568 return title}
569 Tooltip.prototype.getUID=function(prefix){do prefix+=~~(Math.random()*1000000)
570 while(document.getElementById(prefix))
571 return prefix}
572 Tooltip.prototype.tip=function(){if(!this.$tip){this.$tip=$(this.options.template)
573 if(this.$tip.length!=1){throw new Error(this.type+' `template` option must consist of exactly 1 top-level element!')}}
574 return this.$tip}
575 Tooltip.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.tooltip-arrow'))}
576 Tooltip.prototype.enable=function(){this.enabled=!0}
577 Tooltip.prototype.disable=function(){this.enabled=!1}
578 Tooltip.prototype.toggleEnabled=function(){this.enabled=!this.enabled}
579 Tooltip.prototype.toggle=function(e){var self=this
580 if(e){self=$(e.currentTarget).data('bs.'+this.type)
581 if(!self){self=new this.constructor(e.currentTarget,this.getDelegateOptions())
582 $(e.currentTarget).data('bs.'+this.type,self)}}
583 if(e){self.inState.click=!self.inState.click
584 if(self.isInStateTrue())self.enter(self)
585 else self.leave(self)}else{self.tip().hasClass('in')?self.leave(self):self.enter(self)}}
586 Tooltip.prototype.destroy=function(){var that=this
587 clearTimeout(this.timeout)
588 this.hide(function(){that.$element.off('.'+that.type).removeData('bs.'+that.type)
589 if(that.$tip){that.$tip.detach()}
590 that.$tip=null
591 that.$arrow=null
592 that.$viewport=null
593 that.$element=null})}
594 function Plugin(option){return this.each(function(){var $this=$(this)
595 var data=$this.data('bs.tooltip')
596 var options=typeof option=='object'&&option
597 if(!data&&/destroy|hide/.test(option))return
598 if(!data)$this.data('bs.tooltip',(data=new Tooltip(this,options)))
599 if(typeof option=='string')data[option]()})}
600 var old=$.fn.tooltip
601 $.fn.tooltip=Plugin
602 $.fn.tooltip.Constructor=Tooltip
603 $.fn.tooltip.noConflict=function(){$.fn.tooltip=old
604 return this}}(jQuery);+function($){'use strict';var Popover=function(element,options){this.init('popover',element,options)}
605 if(!$.fn.tooltip)throw new Error('Popover requires tooltip.js')
606 Popover.VERSION='3.3.7'
607 Popover.DEFAULTS=$.extend({},$.fn.tooltip.Constructor.DEFAULTS,{placement:'right',trigger:'click',content:'',template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'})
608 Popover.prototype=$.extend({},$.fn.tooltip.Constructor.prototype)
609 Popover.prototype.constructor=Popover
610 Popover.prototype.getDefaults=function(){return Popover.DEFAULTS}
611 Popover.prototype.setContent=function(){var $tip=this.tip()
612 var title=this.getTitle()
613 var content=this.getContent()
614 $tip.find('.popover-title')[this.options.html?'html':'text'](title)
615 $tip.find('.popover-content').children().detach().end()[this.options.html?(typeof content=='string'?'html':'append'):'text'](content)
616 $tip.removeClass('fade top bottom left right in')
617 if(!$tip.find('.popover-title').html())$tip.find('.popover-title').hide()}
618 Popover.prototype.hasContent=function(){return this.getTitle()||this.getContent()}
619 Popover.prototype.getContent=function(){var $e=this.$element
620 var o=this.options
621 return $e.attr('data-content')||(typeof o.content=='function'?o.content.call($e[0]):o.content)}
622 Popover.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.arrow'))}
623 function Plugin(option){return this.each(function(){var $this=$(this)
624 var data=$this.data('bs.popover')
625 var options=typeof option=='object'&&option
626 if(!data&&/destroy|hide/.test(option))return
627 if(!data)$this.data('bs.popover',(data=new Popover(this,options)))
628 if(typeof option=='string')data[option]()})}
629 var old=$.fn.popover
630 $.fn.popover=Plugin
631 $.fn.popover.Constructor=Popover
632 $.fn.popover.noConflict=function(){$.fn.popover=old
633 return this}}(jQuery);+function($){'use strict';function ScrollSpy(element,options){this.$body=$(document.body)
634 this.$scrollElement=$(element).is(document.body)?$(window):$(element)
635 this.options=$.extend({},ScrollSpy.DEFAULTS,options)
636 this.selector=(this.options.target||'')+' .nav li > a'
637 this.offsets=[]
638 this.targets=[]
639 this.activeTarget=null
640 this.scrollHeight=0
641 this.$scrollElement.on('scroll.bs.scrollspy',$.proxy(this.process,this))
642 this.refresh()
643 this.process()}
644 ScrollSpy.VERSION='3.3.7'
645 ScrollSpy.DEFAULTS={offset:10}
646 ScrollSpy.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)}
647 ScrollSpy.prototype.refresh=function(){var that=this
648 var offsetMethod='offset'
649 var offsetBase=0
650 this.offsets=[]
651 this.targets=[]
652 this.scrollHeight=this.getScrollHeight()
653 if(!$.isWindow(this.$scrollElement[0])){offsetMethod='position'
654 offsetBase=this.$scrollElement.scrollTop()}
655 this.$body.find(this.selector).map(function(){var $el=$(this)
656 var href=$el.data('target')||$el.attr('href')
657 var $href=/^#./.test(href)&&$(href)
658 return($href&&$href.length&&$href.is(':visible')&&[[$href[offsetMethod]().top+offsetBase,href]])||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){that.offsets.push(this[0])
659 that.targets.push(this[1])})}
660 ScrollSpy.prototype.process=function(){var scrollTop=this.$scrollElement.scrollTop()+this.options.offset
661 var scrollHeight=this.getScrollHeight()
662 var maxScroll=this.options.offset+scrollHeight-this.$scrollElement.height()
663 var offsets=this.offsets
664 var targets=this.targets
665 var activeTarget=this.activeTarget
666 var i
667 if(this.scrollHeight!=scrollHeight){this.refresh()}
668 if(scrollTop>=maxScroll){return activeTarget!=(i=targets[targets.length-1])&&this.activate(i)}
669 if(activeTarget&&scrollTop<offsets[0]){this.activeTarget=null
670 return this.clear()}
671 for(i=offsets.length;i--;){activeTarget!=targets[i]&&scrollTop>=offsets[i]&&(offsets[i+1]===undefined||scrollTop<offsets[i+1])&&this.activate(targets[i])}}
672 ScrollSpy.prototype.activate=function(target){this.activeTarget=target
673 this.clear()
674 var selector=this.selector+'[data-target="'+target+'"],'+this.selector+'[href="'+target+'"]'
675 var active=$(selector).parents('li').addClass('active')
676 if(active.parent('.dropdown-menu').length){active=active.closest('li.dropdown').addClass('active')}
677 active.trigger('activate.bs.scrollspy')}
678 ScrollSpy.prototype.clear=function(){$(this.selector).parentsUntil(this.options.target,'.active').removeClass('active')}
679 function Plugin(option){return this.each(function(){var $this=$(this)
680 var data=$this.data('bs.scrollspy')
681 var options=typeof option=='object'&&option
682 if(!data)$this.data('bs.scrollspy',(data=new ScrollSpy(this,options)))
683 if(typeof option=='string')data[option]()})}
684 var old=$.fn.scrollspy
685 $.fn.scrollspy=Plugin
686 $.fn.scrollspy.Constructor=ScrollSpy
687 $.fn.scrollspy.noConflict=function(){$.fn.scrollspy=old
688 return this}
689 $(window).on('load.bs.scrollspy.data-api',function(){$('[data-spy="scroll"]').each(function(){var $spy=$(this)
690 Plugin.call($spy,$spy.data())})})}(jQuery);+function($){'use strict';var Tab=function(element){this.element=$(element)}
691 Tab.VERSION='3.3.7'
692 Tab.TRANSITION_DURATION=150
693 Tab.prototype.show=function(){var $this=this.element
694 var $ul=$this.closest('ul:not(.dropdown-menu)')
695 var selector=$this.data('target')
696 if(!selector){selector=$this.attr('href')
697 selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
698 if($this.parent('li').hasClass('active'))return
699 var $previous=$ul.find('.active:last a')
700 var hideEvent=$.Event('hide.bs.tab',{relatedTarget:$this[0]})
701 var showEvent=$.Event('show.bs.tab',{relatedTarget:$previous[0]})
702 $previous.trigger(hideEvent)
703 $this.trigger(showEvent)
704 if(showEvent.isDefaultPrevented()||hideEvent.isDefaultPrevented())return
705 var $target=$(selector)
706 this.activate($this.closest('li'),$ul)
707 this.activate($target,$target.parent(),function(){$previous.trigger({type:'hidden.bs.tab',relatedTarget:$this[0]})
708 $this.trigger({type:'shown.bs.tab',relatedTarget:$previous[0]})})}
709 Tab.prototype.activate=function(element,container,callback){var $active=container.find('> .active')
710 var transition=callback&&$.support.transition&&($active.length&&$active.hasClass('fade')||!!container.find('> .fade').length)
711 function next(){$active.removeClass('active').find('> .dropdown-menu > .active').removeClass('active').end().find('[data-toggle="tab"]').attr('aria-expanded',!1)
712 element.addClass('active').find('[data-toggle="tab"]').attr('aria-expanded',!0)
713 if(transition){element[0].offsetWidth
714 element.addClass('in')}else{element.removeClass('fade')}
715 if(element.parent('.dropdown-menu').length){element.closest('li.dropdown').addClass('active').end().find('[data-toggle="tab"]').attr('aria-expanded',!0)}
716 callback&&callback()}
717 $active.length&&transition?$active.one('bsTransitionEnd',next).emulateTransitionEnd(Tab.TRANSITION_DURATION):next()
718 $active.removeClass('in')}
719 function Plugin(option){return this.each(function(){var $this=$(this)
720 var data=$this.data('bs.tab')
721 if(!data)$this.data('bs.tab',(data=new Tab(this)))
722 if(typeof option=='string')data[option]()})}
723 var old=$.fn.tab
724 $.fn.tab=Plugin
725 $.fn.tab.Constructor=Tab
726 $.fn.tab.noConflict=function(){$.fn.tab=old
727 return this}
728 var clickHandler=function(e){e.preventDefault()
729 Plugin.call($(this),'show')}
730 $(document).on('click.bs.tab.data-api','[data-toggle="tab"]',clickHandler).on('click.bs.tab.data-api','[data-toggle="pill"]',clickHandler)}(jQuery);+function($){'use strict';var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options)
731 this.$target=$(this.options.target).on('scroll.bs.affix.data-api',$.proxy(this.checkPosition,this)).on('click.bs.affix.data-api',$.proxy(this.checkPositionWithEventLoop,this))
732 this.$element=$(element)
733 this.affixed=null
734 this.unpin=null
735 this.pinnedOffset=null
736 this.checkPosition()}
737 Affix.VERSION='3.3.7'
738 Affix.RESET='affix affix-top affix-bottom'
739 Affix.DEFAULTS={offset:0,target:window}
740 Affix.prototype.getState=function(scrollHeight,height,offsetTop,offsetBottom){var scrollTop=this.$target.scrollTop()
741 var position=this.$element.offset()
742 var targetHeight=this.$target.height()
743 if(offsetTop!=null&&this.affixed=='top')return scrollTop<offsetTop?'top':!1
744 if(this.affixed=='bottom'){if(offsetTop!=null)return(scrollTop+this.unpin<=position.top)?!1:'bottom'
745 return(scrollTop+targetHeight<=scrollHeight-offsetBottom)?!1:'bottom'}
746 var initializing=this.affixed==null
747 var colliderTop=initializing?scrollTop:position.top
748 var colliderHeight=initializing?targetHeight:height
749 if(offsetTop!=null&&scrollTop<=offsetTop)return'top'
750 if(offsetBottom!=null&&(colliderTop+colliderHeight>=scrollHeight-offsetBottom))return'bottom'
751 return!1}
752 Affix.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset
753 this.$element.removeClass(Affix.RESET).addClass('affix')
754 var scrollTop=this.$target.scrollTop()
755 var position=this.$element.offset()
756 return(this.pinnedOffset=position.top-scrollTop)}
757 Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)}
758 Affix.prototype.checkPosition=function(){if(!this.$element.is(':visible'))return
759 var height=this.$element.height()
760 var offset=this.options.offset
761 var offsetTop=offset.top
762 var offsetBottom=offset.bottom
763 var scrollHeight=Math.max($(document).height(),$(document.body).height())
764 if(typeof offset!='object')offsetBottom=offsetTop=offset
765 if(typeof offsetTop=='function')offsetTop=offset.top(this.$element)
766 if(typeof offsetBottom=='function')offsetBottom=offset.bottom(this.$element)
767 var affix=this.getState(scrollHeight,height,offsetTop,offsetBottom)
768 if(this.affixed!=affix){if(this.unpin!=null)this.$element.css('top','')
769 var affixType='affix'+(affix?'-'+affix:'')
770 var e=$.Event(affixType+'.bs.affix')
771 this.$element.trigger(e)
772 if(e.isDefaultPrevented())return
773 this.affixed=affix
774 this.unpin=affix=='bottom'?this.getPinnedOffset():null
775 this.$element.removeClass(Affix.RESET).addClass(affixType).trigger(affixType.replace('affix','affixed')+'.bs.affix')}
776 if(affix=='bottom'){this.$element.offset({top:scrollHeight-height-offsetBottom})}}
777 function Plugin(option){return this.each(function(){var $this=$(this)
778 var data=$this.data('bs.affix')
779 var options=typeof option=='object'&&option
780 if(!data)$this.data('bs.affix',(data=new Affix(this,options)))
781 if(typeof option=='string')data[option]()})}
782 var old=$.fn.affix
783 $.fn.affix=Plugin
784 $.fn.affix.Constructor=Affix
785 $.fn.affix.noConflict=function(){$.fn.affix=old
786 return this}
787 $(window).on('load',function(){$('[data-spy="affix"]').each(function(){var $spy=$(this)
788 var data=$spy.data()
789 data.offset=data.offset||{}
790 if(data.offsetBottom!=null)data.offset.bottom=data.offsetBottom
791 if(data.offsetTop!=null)data.offset.top=data.offsetTop
792 Plugin.call($spy,data)})})}(jQuery)