apx-docs-theme 0.1.7 → 0.1.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/footer.html +8 -9
  3. data/_includes/head.html +20 -9
  4. data/_includes/js_files.html +21 -3
  5. data/_includes/navbar.html +28 -0
  6. data/_includes/sidebar.html +43 -0
  7. data/_layouts/default.html +10 -10
  8. data/_layouts/docs.html +12 -20
  9. data/_sass/bootstrap/_alert.scss +51 -0
  10. data/_sass/bootstrap/_badge.scss +53 -0
  11. data/_sass/bootstrap/_breadcrumb.scss +41 -0
  12. data/_sass/bootstrap/_button-group.scss +163 -0
  13. data/_sass/bootstrap/_buttons.scss +73 -101
  14. data/_sass/bootstrap/_card.scss +310 -0
  15. data/_sass/bootstrap/_carousel.scss +130 -202
  16. data/_sass/bootstrap/_close.scss +23 -15
  17. data/_sass/bootstrap/_code.scss +15 -36
  18. data/_sass/bootstrap/_custom-forms.scss +507 -0
  19. data/_sass/bootstrap/_dropdown.scss +191 -0
  20. data/_sass/bootstrap/_forms.scss +215 -498
  21. data/_sass/bootstrap/_functions.scss +86 -0
  22. data/_sass/bootstrap/_grid.scss +29 -61
  23. data/_sass/bootstrap/_images.scss +42 -0
  24. data/_sass/bootstrap/_input-group.scss +193 -0
  25. data/_sass/bootstrap/_jumbotron.scss +9 -47
  26. data/_sass/bootstrap/_list-group.scss +70 -79
  27. data/_sass/bootstrap/_media.scss +3 -61
  28. data/_sass/bootstrap/_mixins.scss +19 -18
  29. data/_sass/bootstrap/_modal.scss +186 -0
  30. data/_sass/bootstrap/_nav.scss +120 -0
  31. data/_sass/bootstrap/_navbar.scss +192 -555
  32. data/_sass/bootstrap/_pagination.scss +59 -70
  33. data/_sass/bootstrap/_popover.scss +183 -0
  34. data/_sass/bootstrap/_print.scss +89 -49
  35. data/_sass/bootstrap/_progress.scss +34 -0
  36. data/_sass/bootstrap/_reboot.scss +462 -0
  37. data/_sass/bootstrap/_root.scss +19 -0
  38. data/_sass/bootstrap/_spinners.scss +53 -0
  39. data/_sass/bootstrap/_tables.scss +119 -166
  40. data/_sass/bootstrap/_toasts.scss +43 -0
  41. data/_sass/bootstrap/_tooltip.scss +93 -79
  42. data/_sass/bootstrap/_transitions.scss +22 -0
  43. data/_sass/bootstrap/_type.scss +66 -239
  44. data/_sass/bootstrap/_utilities.scss +16 -55
  45. data/_sass/bootstrap/_variables.scss +926 -709
  46. data/_sass/bootstrap/bootstrap-grid.scss +29 -0
  47. data/_sass/bootstrap/bootstrap-reboot.scss +12 -0
  48. data/_sass/bootstrap/bootstrap.scss +44 -0
  49. data/_sass/bootstrap/mixins/_alert.scss +13 -0
  50. data/_sass/bootstrap/mixins/_background-variant.scss +14 -5
  51. data/_sass/bootstrap/mixins/_badge.scss +11 -0
  52. data/_sass/bootstrap/mixins/_border-radius.scss +25 -8
  53. data/_sass/bootstrap/mixins/_box-shadow.scss +5 -0
  54. data/_sass/bootstrap/mixins/_breakpoints.scss +123 -0
  55. data/_sass/bootstrap/mixins/_buttons.scss +86 -40
  56. data/_sass/bootstrap/mixins/_caret.scss +62 -0
  57. data/_sass/bootstrap/mixins/_clearfix.scss +3 -18
  58. data/_sass/bootstrap/mixins/_float.scss +11 -0
  59. data/_sass/bootstrap/mixins/_forms.scss +176 -66
  60. data/_sass/bootstrap/mixins/_gradients.scss +17 -30
  61. data/_sass/bootstrap/mixins/_grid-framework.scss +51 -66
  62. data/_sass/bootstrap/mixins/_grid.scss +34 -105
  63. data/_sass/bootstrap/mixins/_hover.scss +37 -0
  64. data/_sass/bootstrap/mixins/_image.scss +18 -15
  65. data/_sass/bootstrap/mixins/_list-group.scss +10 -21
  66. data/_sass/bootstrap/mixins/_lists.scss +7 -0
  67. data/_sass/bootstrap/mixins/_nav-divider.scss +4 -4
  68. data/_sass/bootstrap/mixins/_pagination.scss +10 -12
  69. data/_sass/bootstrap/mixins/_reset-text.scss +7 -8
  70. data/_sass/bootstrap/mixins/_resize.scss +1 -1
  71. data/_sass/bootstrap/mixins/_screen-reader.scss +33 -0
  72. data/_sass/bootstrap/mixins/_size.scss +1 -5
  73. data/_sass/bootstrap/mixins/_table-row.scss +26 -15
  74. data/_sass/bootstrap/mixins/_text-emphasis.scss +7 -5
  75. data/_sass/bootstrap/mixins/_text-hide.scss +13 -0
  76. data/_sass/bootstrap/mixins/{_text-overflow.scss → _text-truncate.scss} +2 -2
  77. data/_sass/bootstrap/mixins/_transition.scss +16 -0
  78. data/_sass/bootstrap/mixins/_visibility.scss +7 -0
  79. data/_sass/bootstrap/utilities/_align.scss +8 -0
  80. data/_sass/bootstrap/utilities/_background.scss +19 -0
  81. data/_sass/bootstrap/utilities/_borders.scss +63 -0
  82. data/_sass/bootstrap/utilities/_clearfix.scss +3 -0
  83. data/_sass/bootstrap/utilities/_display.scss +38 -0
  84. data/_sass/bootstrap/utilities/_embed.scss +39 -0
  85. data/_sass/bootstrap/utilities/_flex.scss +51 -0
  86. data/_sass/bootstrap/utilities/_float.scss +9 -0
  87. data/_sass/bootstrap/utilities/_overflow.scss +5 -0
  88. data/_sass/bootstrap/utilities/_position.scss +32 -0
  89. data/_sass/bootstrap/utilities/_screenreaders.scss +11 -0
  90. data/_sass/bootstrap/utilities/_shadows.scss +6 -0
  91. data/_sass/bootstrap/utilities/_sizing.scss +20 -0
  92. data/_sass/bootstrap/utilities/_spacing.scss +73 -0
  93. data/_sass/bootstrap/utilities/_text.scss +67 -0
  94. data/_sass/bootstrap/utilities/_visibility.scss +11 -0
  95. data/_sass/markdown/code.scss +65 -0
  96. data/_sass/markdown/color-system.scss +114 -0
  97. data/_sass/markdown/images.scss +119 -0
  98. data/_sass/markdown/markdown-body.scss +103 -0
  99. data/_sass/markdown/markdown.scss +15 -0
  100. data/_sass/rouge.scss +209 -0
  101. data/_sass/theme.scss +35 -0
  102. data/_sass/{_typeahead.scss → typeahead.scss} +0 -0
  103. data/assets/css/main.scss +1 -90
  104. data/assets/img/{bg.jpg → jumbotron.jpg} +0 -0
  105. data/assets/js/bootstrap.min.js +6 -6
  106. data/assets/js/jquery-3.3.1.min.js +2 -0
  107. data/assets/js/main.js +2 -1
  108. data/assets/js/search.json +11 -0
  109. data/assets/js/typeahead.bundle.js +2621 -0
  110. data/assets/js/typeahead.bundle.min.js +4 -4
  111. metadata +81 -50
  112. data/_includes/pages_nav.html +0 -40
  113. data/_includes/topnav.html +0 -37
  114. data/_sass/_bootstrap.scss +0 -56
  115. data/_sass/_syntax-highlighting.scss +0 -71
  116. data/_sass/bootstrap/_alerts.scss +0 -73
  117. data/_sass/bootstrap/_badges.scss +0 -68
  118. data/_sass/bootstrap/_breadcrumbs.scss +0 -28
  119. data/_sass/bootstrap/_button-groups.scss +0 -244
  120. data/_sass/bootstrap/_component-animations.scss +0 -37
  121. data/_sass/bootstrap/_dropdowns.scss +0 -216
  122. data/_sass/bootstrap/_glyphicons.scss +0 -307
  123. data/_sass/bootstrap/_input-groups.scss +0 -171
  124. data/_sass/bootstrap/_labels.scss +0 -66
  125. data/_sass/bootstrap/_modals.scss +0 -150
  126. data/_sass/bootstrap/_navs.scss +0 -242
  127. data/_sass/bootstrap/_normalize.scss +0 -424
  128. data/_sass/bootstrap/_pager.scss +0 -54
  129. data/_sass/bootstrap/_panels.scss +0 -271
  130. data/_sass/bootstrap/_popovers.scss +0 -131
  131. data/_sass/bootstrap/_progress-bars.scss +0 -87
  132. data/_sass/bootstrap/_responsive-embed.scss +0 -35
  133. data/_sass/bootstrap/_responsive-utilities.scss +0 -179
  134. data/_sass/bootstrap/_scaffolding.scss +0 -161
  135. data/_sass/bootstrap/_theme.scss +0 -291
  136. data/_sass/bootstrap/_thumbnails.scss +0 -38
  137. data/_sass/bootstrap/_wells.scss +0 -29
  138. data/_sass/bootstrap/mixins/_alerts.scss +0 -14
  139. data/_sass/bootstrap/mixins/_center-block.scss +0 -7
  140. data/_sass/bootstrap/mixins/_hide-text.scss +0 -21
  141. data/_sass/bootstrap/mixins/_labels.scss +0 -12
  142. data/_sass/bootstrap/mixins/_nav-vertical-align.scss +0 -9
  143. data/_sass/bootstrap/mixins/_opacity.scss +0 -8
  144. data/_sass/bootstrap/mixins/_panels.scss +0 -24
  145. data/_sass/bootstrap/mixins/_progress-bar.scss +0 -10
  146. data/_sass/bootstrap/mixins/_reset-filter.scss +0 -8
  147. data/_sass/bootstrap/mixins/_responsive-visibility.scss +0 -21
  148. data/_sass/bootstrap/mixins/_tab-focus.scss +0 -9
  149. data/_sass/bootstrap/mixins/_vendor-prefixes.scss +0 -222
  150. data/assets/css/font-awesome.min.css +0 -4
  151. data/assets/fonts/FontAwesome.otf +0 -0
  152. data/assets/fonts/fontawesome-webfont.eot +0 -0
  153. data/assets/fonts/fontawesome-webfont.svg +0 -2671
  154. data/assets/fonts/fontawesome-webfont.ttf +0 -0
  155. data/assets/fonts/fontawesome-webfont.woff +0 -0
  156. data/assets/fonts/fontawesome-webfont.woff2 +0 -0
@@ -0,0 +1,15 @@
1
+ $spacer-1: 4px;
2
+ $spacer-3: 16px;
3
+ $spacer-4: 24px;
4
+ $em-spacer-3: 0.25em !default; // 1/4
5
+
6
+ $bg-white: $white;
7
+ $text-gray-dark: gray-900;
8
+ $lh-condensed-ultra: 1 !default;
9
+
10
+
11
+ @import "color-system.scss";
12
+ // @import "layout.scss";
13
+ @import "code.scss";
14
+ @import "images.scss";
15
+ @import "markdown-body.scss";
@@ -0,0 +1,209 @@
1
+ .highlight table td { padding: 5px; }
2
+ .highlight table pre { margin: 0; }
3
+ .highlight .cm {
4
+ color: #999988;
5
+ font-style: italic;
6
+ }
7
+ .highlight .cp {
8
+ color: #999999;
9
+ font-weight: bold;
10
+ }
11
+ .highlight .c1 {
12
+ color: #999988;
13
+ font-style: italic;
14
+ }
15
+ .highlight .cs {
16
+ color: #999999;
17
+ font-weight: bold;
18
+ font-style: italic;
19
+ }
20
+ .highlight .c, .highlight .cd {
21
+ color: #999988;
22
+ font-style: italic;
23
+ }
24
+ .highlight .err {
25
+ color: #a61717;
26
+ background-color: #e3d2d2;
27
+ }
28
+ .highlight .gd {
29
+ color: #000000;
30
+ background-color: #ffdddd;
31
+ }
32
+ .highlight .ge {
33
+ color: #000000;
34
+ font-style: italic;
35
+ }
36
+ .highlight .gr {
37
+ color: #aa0000;
38
+ }
39
+ .highlight .gh {
40
+ color: #999999;
41
+ }
42
+ .highlight .gi {
43
+ color: #000000;
44
+ background-color: #ddffdd;
45
+ }
46
+ .highlight .go {
47
+ color: #888888;
48
+ }
49
+ .highlight .gp {
50
+ color: #555555;
51
+ }
52
+ .highlight .gs {
53
+ font-weight: bold;
54
+ }
55
+ .highlight .gu {
56
+ color: #aaaaaa;
57
+ }
58
+ .highlight .gt {
59
+ color: #aa0000;
60
+ }
61
+ .highlight .kc {
62
+ color: #000000;
63
+ font-weight: bold;
64
+ }
65
+ .highlight .kd {
66
+ color: #000000;
67
+ font-weight: bold;
68
+ }
69
+ .highlight .kn {
70
+ color: #000000;
71
+ font-weight: bold;
72
+ }
73
+ .highlight .kp {
74
+ color: #000000;
75
+ font-weight: bold;
76
+ }
77
+ .highlight .kr {
78
+ color: #000000;
79
+ font-weight: bold;
80
+ }
81
+ .highlight .kt {
82
+ color: #445588;
83
+ font-weight: bold;
84
+ }
85
+ .highlight .k, .highlight .kv {
86
+ color: #000000;
87
+ font-weight: bold;
88
+ }
89
+ .highlight .mf {
90
+ color: #009999;
91
+ }
92
+ .highlight .mh {
93
+ color: #009999;
94
+ }
95
+ .highlight .il {
96
+ color: #009999;
97
+ }
98
+ .highlight .mi {
99
+ color: #009999;
100
+ }
101
+ .highlight .mo {
102
+ color: #009999;
103
+ }
104
+ .highlight .m, .highlight .mb, .highlight .mx {
105
+ color: #009999;
106
+ }
107
+ .highlight .sb {
108
+ color: #d14;
109
+ }
110
+ .highlight .sc {
111
+ color: #d14;
112
+ }
113
+ .highlight .sd {
114
+ color: #d14;
115
+ }
116
+ .highlight .s2 {
117
+ color: #d14;
118
+ }
119
+ .highlight .se {
120
+ color: #d14;
121
+ }
122
+ .highlight .sh {
123
+ color: #d14;
124
+ }
125
+ .highlight .si {
126
+ color: #d14;
127
+ }
128
+ .highlight .sx {
129
+ color: #d14;
130
+ }
131
+ .highlight .sr {
132
+ color: #009926;
133
+ }
134
+ .highlight .s1 {
135
+ color: #d14;
136
+ }
137
+ .highlight .ss {
138
+ color: #990073;
139
+ }
140
+ .highlight .s {
141
+ color: #d14;
142
+ }
143
+ .highlight .na {
144
+ color: #008080;
145
+ }
146
+ .highlight .bp {
147
+ color: #999999;
148
+ }
149
+ .highlight .nb {
150
+ color: #0086B3;
151
+ }
152
+ .highlight .nc {
153
+ color: #445588;
154
+ font-weight: bold;
155
+ }
156
+ .highlight .no {
157
+ color: #008080;
158
+ }
159
+ .highlight .nd {
160
+ color: #3c5d5d;
161
+ font-weight: bold;
162
+ }
163
+ .highlight .ni {
164
+ color: #800080;
165
+ }
166
+ .highlight .ne {
167
+ color: #990000;
168
+ font-weight: bold;
169
+ }
170
+ .highlight .nf {
171
+ color: #990000;
172
+ font-weight: bold;
173
+ }
174
+ .highlight .nl {
175
+ color: #990000;
176
+ font-weight: bold;
177
+ }
178
+ .highlight .nn {
179
+ color: #555555;
180
+ }
181
+ .highlight .nt {
182
+ color: #000080;
183
+ }
184
+ .highlight .vc {
185
+ color: #008080;
186
+ }
187
+ .highlight .vg {
188
+ color: #008080;
189
+ }
190
+ .highlight .vi {
191
+ color: #008080;
192
+ }
193
+ .highlight .nv {
194
+ color: #008080;
195
+ }
196
+ .highlight .ow {
197
+ color: #000000;
198
+ font-weight: bold;
199
+ }
200
+ .highlight .o {
201
+ color: #000000;
202
+ font-weight: bold;
203
+ }
204
+ .highlight .w {
205
+ color: #bbbbbb;
206
+ }
207
+ .highlight {
208
+ background-color: #f8f8f8;
209
+ }
@@ -0,0 +1,35 @@
1
+ // $font-family-sans-serif: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
2
+ // $font-weight-base: 400;
3
+
4
+ @import "bootstrap/bootstrap";
5
+
6
+ @import "rouge";
7
+ @import "typeahead";
8
+ @import "markdown/markdown";
9
+
10
+
11
+
12
+
13
+
14
+ html {
15
+ position: relative;
16
+ min-height: 100%;
17
+ }
18
+ body {
19
+ padding-top: $nav-link-height + $nav-link-padding-y * 2;
20
+ }
21
+
22
+ main {
23
+ padding-bottom: 20px;
24
+ }
25
+
26
+ .jumbotron {
27
+ background: url("../img/jumbotron.jpg") no-repeat 50% 0;
28
+ background-size: cover;
29
+ color: #fff;
30
+ background-position: center 36%;
31
+ margin-top: -37px;
32
+ h1 {
33
+ color: #fff;
34
+ }
35
+ }
@@ -2,93 +2,4 @@
2
2
  # Only the main Sass file needs front matter (the dashes are enough)
3
3
  ---
4
4
  @charset "utf-8";
5
-
6
- // Import partials from `sass_dir` (defaults to `_sass`)
7
-
8
-
9
-
10
- @import
11
- {% if site.bootwatch %}
12
- "bootswatch/{{site.bootwatch | downcase}}/variables",
13
- {% endif %}
14
-
15
- "bootstrap",
16
-
17
- {% if site.bootwatch %}
18
- "bootswatch/{{site.bootwatch | downcase}}/bootswatch",
19
- {% endif %}
20
-
21
- "syntax-highlighting",
22
- "typeahead"
23
- ;
24
-
25
- html {
26
- position: relative;
27
- min-height: 100%;
28
- }
29
- body {
30
- padding-top: $navbar-height + $navbar-margin-bottom;
31
- margin-bottom: 46px;
32
- }
33
-
34
- .navbar-brand{
35
- img{
36
- margin: -$navbar-padding-vertical 0;
37
- height: $navbar-height;
38
- padding: 7px 0;
39
- }
40
- }
41
-
42
- .navbar {
43
- -webkit-box-shadow: 0 8px 6px -6px rgba(0,0,0,0.4);
44
- -moz-box-shadow: 0 8px 6px -6px rgba(0,0,0,0.4);
45
- box-shadow: 0 8px 6px -6px rgba(0,0,0,0.4);
46
- }
47
-
48
-
49
-
50
-
51
- .header-container {
52
- background-color: black;
53
- background: url('../img/bg.jpg') no-repeat 50% 0;
54
- color: #fff;
55
-
56
- h1 {
57
- color: #fff;
58
- }
59
- // background-attachment: fixed;
60
- background-size: cover;
61
- background-position: center 36%;
62
- margin-top: -37px;
63
- }
64
- .navbar-container {
65
- font-size: 16px;
66
- }
67
- .page-content {
68
- padding-bottom: 20px;
69
- }
70
- .footer {
71
- position: absolute;
72
- bottom: 0;
73
- width: 100%;
74
- height: 46px;
75
- padding-top: 10px;
76
- background-color: $gray-lighter;
77
- color: $gray-dark;
78
- }
79
-
80
- .post-list-container {
81
- li a.active {
82
- font-weight: bold;
83
- }
84
- }
85
- *[id]:before {
86
- display: block;
87
- content: " ";
88
- margin-top: -75px;
89
- height: 75px;
90
- visibility: hidden;
91
- }
92
- .navbar-form .has-feedback .form-control-feedback{
93
- top:10px
94
- }
5
+ @import "theme";
File without changes
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * Bootstrap v3.3.7 (http://getbootstrap.com)
3
- * Copyright 2011-2016 Twitter, Inc.
4
- * Licensed under the MIT license
5
- */
6
- if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){document===a.target||this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.7",c.TRANSITION_DURATION=150,c.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}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},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!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);if(this.$element.trigger(g),!g.isDefaultPrevented())return f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=window.SVGElement&&c instanceof window.SVGElement,g=d?{top:0,left:0}:f?null:b.offset(),h={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},i=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,h,i,g)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.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>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){
7
- this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.7",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e<c&&"top";if("bottom"==this.affixed)return null!=c?!(e+this.unpin<=f.top)&&"bottom":!(e+g<=a-d)&&"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&e<=c?"top":null!=d&&i+j>=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
2
+ * Bootstrap v4.2.1 (https://getbootstrap.com/)
3
+ * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
+ */
6
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("popper.js"),require("jquery")):"function"==typeof define&&define.amd?define(["exports","popper.js","jquery"],e):e(t.bootstrap={},t.Popper,t.jQuery)}(this,function(t,u,g){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function l(o){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},e=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.forEach(function(t){var e,n,i;e=o,i=r[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i})}return o}u=u&&u.hasOwnProperty("default")?u.default:u,g=g&&g.hasOwnProperty("default")?g.default:g;var e="transitionend";function n(t){var e=this,n=!1;return g(this).one(_.TRANSITION_END,function(){n=!0}),setTimeout(function(){n||_.triggerTransitionEnd(e)},t),this}var _={TRANSITION_END:"bsTransitionEnd",getUID:function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}return e&&document.querySelector(e)?e:null},getTransitionDurationFromElement:function(t){if(!t)return 0;var e=g(t).css("transition-duration"),n=g(t).css("transition-delay"),i=parseFloat(e),o=parseFloat(n);return i||o?(e=e.split(",")[0],n=n.split(",")[0],1e3*(parseFloat(e)+parseFloat(n))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){g(t).trigger(e)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],r=e[i],s=r&&_.isElement(r)?"element":(a=r,{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase());if(!new RegExp(o).test(s))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+s+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"!=typeof t.getRootNode)return t instanceof ShadowRoot?t:t.parentNode?_.findShadowRoot(t.parentNode):null;var e=t.getRootNode();return e instanceof ShadowRoot?e:null}};g.fn.emulateTransitionEnd=n,g.event.special[_.TRANSITION_END]={bindType:e,delegateType:e,handle:function(t){if(g(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var o="alert",r="bs.alert",a="."+r,c=g.fn[o],h={CLOSE:"close"+a,CLOSED:"closed"+a,CLICK_DATA_API:"click"+a+".data-api"},f="alert",d="fade",m="show",p=function(){function i(t){this._element=t}var t=i.prototype;return t.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},t.dispose=function(){g.removeData(this._element,r),this._element=null},t._getRootElement=function(t){var e=_.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=g(t).closest("."+f)[0]),n},t._triggerCloseEvent=function(t){var e=g.Event(h.CLOSE);return g(t).trigger(e),e},t._removeElement=function(e){var n=this;if(g(e).removeClass(m),g(e).hasClass(d)){var t=_.getTransitionDurationFromElement(e);g(e).one(_.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(t)}else this._destroyElement(e)},t._destroyElement=function(t){g(t).detach().trigger(h.CLOSED).remove()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(r);e||(e=new i(this),t.data(r,e)),"close"===n&&e[n](this)})},i._handleDismiss=function(e){return function(t){t&&t.preventDefault(),e.close(this)}},s(i,null,[{key:"VERSION",get:function(){return"4.2.1"}}]),i}();g(document).on(h.CLICK_DATA_API,'[data-dismiss="alert"]',p._handleDismiss(new p)),g.fn[o]=p._jQueryInterface,g.fn[o].Constructor=p,g.fn[o].noConflict=function(){return g.fn[o]=c,p._jQueryInterface};var v="button",E="bs.button",y="."+E,C=".data-api",T=g.fn[v],S="active",b="btn",I="focus",D='[data-toggle^="button"]',w='[data-toggle="buttons"]',A='input:not([type="hidden"])',N=".active",O=".btn",k={CLICK_DATA_API:"click"+y+C,FOCUS_BLUR_DATA_API:"focus"+y+C+" blur"+y+C},P=function(){function n(t){this._element=t}var t=n.prototype;return t.toggle=function(){var t=!0,e=!0,n=g(this._element).closest(w)[0];if(n){var i=this._element.querySelector(A);if(i){if("radio"===i.type)if(i.checked&&this._element.classList.contains(S))t=!1;else{var o=n.querySelector(N);o&&g(o).removeClass(S)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!this._element.classList.contains(S),g(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!this._element.classList.contains(S)),t&&g(this._element).toggleClass(S)},t.dispose=function(){g.removeData(this._element,E),this._element=null},n._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(E);t||(t=new n(this),g(this).data(E,t)),"toggle"===e&&t[e]()})},s(n,null,[{key:"VERSION",get:function(){return"4.2.1"}}]),n}();g(document).on(k.CLICK_DATA_API,D,function(t){t.preventDefault();var e=t.target;g(e).hasClass(b)||(e=g(e).closest(O)),P._jQueryInterface.call(g(e),"toggle")}).on(k.FOCUS_BLUR_DATA_API,D,function(t){var e=g(t.target).closest(O)[0];g(e).toggleClass(I,/^focus(in)?$/.test(t.type))}),g.fn[v]=P._jQueryInterface,g.fn[v].Constructor=P,g.fn[v].noConflict=function(){return g.fn[v]=T,P._jQueryInterface};var L="carousel",j="bs.carousel",H="."+j,R=".data-api",U=g.fn[L],W={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},x={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},F="next",q="prev",M="left",K="right",Q={SLIDE:"slide"+H,SLID:"slid"+H,KEYDOWN:"keydown"+H,MOUSEENTER:"mouseenter"+H,MOUSELEAVE:"mouseleave"+H,TOUCHSTART:"touchstart"+H,TOUCHMOVE:"touchmove"+H,TOUCHEND:"touchend"+H,POINTERDOWN:"pointerdown"+H,POINTERUP:"pointerup"+H,DRAG_START:"dragstart"+H,LOAD_DATA_API:"load"+H+R,CLICK_DATA_API:"click"+H+R},B="carousel",V="active",Y="slide",X="carousel-item-right",z="carousel-item-left",G="carousel-item-next",J="carousel-item-prev",Z="pointer-event",$=".active",tt=".active.carousel-item",et=".carousel-item",nt=".carousel-item img",it=".carousel-item-next, .carousel-item-prev",ot=".carousel-indicators",rt="[data-slide], [data-slide-to]",st='[data-ride="carousel"]',at={TOUCH:"touch",PEN:"pen"},lt=function(){function r(t,e){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._element=t,this._indicatorsElement=this._element.querySelector(ot),this._touchSupported="ontouchstart"in document.documentElement||0<navigator.maxTouchPoints,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var t=r.prototype;return t.next=function(){this._isSliding||this._slide(F)},t.nextWhenVisible=function(){!document.hidden&&g(this._element).is(":visible")&&"hidden"!==g(this._element).css("visibility")&&this.next()},t.prev=function(){this._isSliding||this._slide(q)},t.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(it)&&(_.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},t.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},t.to=function(t){var e=this;this._activeElement=this._element.querySelector(tt);var n=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=n<t?F:q;this._slide(i,this._items[t])}},t.dispose=function(){g(this._element).off(H),g.removeData(this._element,j),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},t._getConfig=function(t){return t=l({},W,t),_.typeCheckConfig(L,t,x),t},t._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;0<e&&this.prev(),e<0&&this.next()}},t._addEventListeners=function(){var e=this;this._config.keyboard&&g(this._element).on(Q.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&g(this._element).on(Q.MOUSEENTER,function(t){return e.pause(t)}).on(Q.MOUSELEAVE,function(t){return e.cycle(t)}),this._addTouchEventListeners()},t._addTouchEventListeners=function(){var n=this;if(this._touchSupported){var e=function(t){n._pointerEvent&&at[t.originalEvent.pointerType.toUpperCase()]?n.touchStartX=t.originalEvent.clientX:n._pointerEvent||(n.touchStartX=t.originalEvent.touches[0].clientX)},i=function(t){n._pointerEvent&&at[t.originalEvent.pointerType.toUpperCase()]&&(n.touchDeltaX=t.originalEvent.clientX-n.touchStartX),n._handleSwipe(),"hover"===n._config.pause&&(n.pause(),n.touchTimeout&&clearTimeout(n.touchTimeout),n.touchTimeout=setTimeout(function(t){return n.cycle(t)},500+n._config.interval))};g(this._element.querySelectorAll(nt)).on(Q.DRAG_START,function(t){return t.preventDefault()}),this._pointerEvent?(g(this._element).on(Q.POINTERDOWN,function(t){return e(t)}),g(this._element).on(Q.POINTERUP,function(t){return i(t)}),this._element.classList.add(Z)):(g(this._element).on(Q.TOUCHSTART,function(t){return e(t)}),g(this._element).on(Q.TOUCHMOVE,function(t){var e;(e=t).originalEvent.touches&&1<e.originalEvent.touches.length?n.touchDeltaX=0:n.touchDeltaX=e.originalEvent.touches[0].clientX-n.touchStartX}),g(this._element).on(Q.TOUCHEND,function(t){return i(t)}))}},t._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},t._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(et)):[],this._items.indexOf(t)},t._getItemByDirection=function(t,e){var n=t===F,i=t===q,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var s=(o+(t===q?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},t._triggerSlideEvent=function(t,e){var n=this._getItemIndex(t),i=this._getItemIndex(this._element.querySelector(tt)),o=g.Event(Q.SLIDE,{relatedTarget:t,direction:e,from:i,to:n});return g(this._element).trigger(o),o},t._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var e=[].slice.call(this._indicatorsElement.querySelectorAll($));g(e).removeClass(V);var n=this._indicatorsElement.children[this._getItemIndex(t)];n&&g(n).addClass(V)}},t._slide=function(t,e){var n,i,o,r=this,s=this._element.querySelector(tt),a=this._getItemIndex(s),l=e||s&&this._getItemByDirection(t,s),c=this._getItemIndex(l),h=Boolean(this._interval);if(o=t===F?(n=z,i=G,M):(n=X,i=J,K),l&&g(l).hasClass(V))this._isSliding=!1;else if(!this._triggerSlideEvent(l,o).isDefaultPrevented()&&s&&l){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(l);var u=g.Event(Q.SLID,{relatedTarget:l,direction:o,from:a,to:c});if(g(this._element).hasClass(Y)){g(l).addClass(i),_.reflow(l),g(s).addClass(n),g(l).addClass(n);var f=parseInt(l.getAttribute("data-interval"),10);this._config.interval=f?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,f):this._config.defaultInterval||this._config.interval;var d=_.getTransitionDurationFromElement(s);g(s).one(_.TRANSITION_END,function(){g(l).removeClass(n+" "+i).addClass(V),g(s).removeClass(V+" "+i+" "+n),r._isSliding=!1,setTimeout(function(){return g(r._element).trigger(u)},0)}).emulateTransitionEnd(d)}else g(s).removeClass(V),g(l).addClass(V),this._isSliding=!1,g(this._element).trigger(u);h&&this.cycle()}},r._jQueryInterface=function(i){return this.each(function(){var t=g(this).data(j),e=l({},W,g(this).data());"object"==typeof i&&(e=l({},e,i));var n="string"==typeof i?i:e.slide;if(t||(t=new r(this,e),g(this).data(j,t)),"number"==typeof i)t.to(i);else if("string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}else e.interval&&(t.pause(),t.cycle())})},r._dataApiClickHandler=function(t){var e=_.getSelectorFromElement(this);if(e){var n=g(e)[0];if(n&&g(n).hasClass(B)){var i=l({},g(n).data(),g(this).data()),o=this.getAttribute("data-slide-to");o&&(i.interval=!1),r._jQueryInterface.call(g(n),i),o&&g(n).data(j).to(o),t.preventDefault()}}},s(r,null,[{key:"VERSION",get:function(){return"4.2.1"}},{key:"Default",get:function(){return W}}]),r}();g(document).on(Q.CLICK_DATA_API,rt,lt._dataApiClickHandler),g(window).on(Q.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(st)),e=0,n=t.length;e<n;e++){var i=g(t[e]);lt._jQueryInterface.call(i,i.data())}}),g.fn[L]=lt._jQueryInterface,g.fn[L].Constructor=lt,g.fn[L].noConflict=function(){return g.fn[L]=U,lt._jQueryInterface};var ct="collapse",ht="bs.collapse",ut="."+ht,ft=g.fn[ct],dt={toggle:!0,parent:""},gt={toggle:"boolean",parent:"(string|element)"},_t={SHOW:"show"+ut,SHOWN:"shown"+ut,HIDE:"hide"+ut,HIDDEN:"hidden"+ut,CLICK_DATA_API:"click"+ut+".data-api"},mt="show",pt="collapse",vt="collapsing",Et="collapsed",yt="width",Ct="height",Tt=".show, .collapsing",St='[data-toggle="collapse"]',bt=function(){function a(e,t){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(t),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var n=[].slice.call(document.querySelectorAll(St)),i=0,o=n.length;i<o;i++){var r=n[i],s=_.getSelectorFromElement(r),a=[].slice.call(document.querySelectorAll(s)).filter(function(t){return t===e});null!==s&&0<a.length&&(this._selector=s,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var t=a.prototype;return t.toggle=function(){g(this._element).hasClass(mt)?this.hide():this.show()},t.show=function(){var t,e,n=this;if(!this._isTransitioning&&!g(this._element).hasClass(mt)&&(this._parent&&0===(t=[].slice.call(this._parent.querySelectorAll(Tt)).filter(function(t){return"string"==typeof n._config.parent?t.getAttribute("data-parent")===n._config.parent:t.classList.contains(pt)})).length&&(t=null),!(t&&(e=g(t).not(this._selector).data(ht))&&e._isTransitioning))){var i=g.Event(_t.SHOW);if(g(this._element).trigger(i),!i.isDefaultPrevented()){t&&(a._jQueryInterface.call(g(t).not(this._selector),"hide"),e||g(t).data(ht,null));var o=this._getDimension();g(this._element).removeClass(pt).addClass(vt),this._element.style[o]=0,this._triggerArray.length&&g(this._triggerArray).removeClass(Et).attr("aria-expanded",!0),this.setTransitioning(!0);var r="scroll"+(o[0].toUpperCase()+o.slice(1)),s=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(){g(n._element).removeClass(vt).addClass(pt).addClass(mt),n._element.style[o]="",n.setTransitioning(!1),g(n._element).trigger(_t.SHOWN)}).emulateTransitionEnd(s),this._element.style[o]=this._element[r]+"px"}}},t.hide=function(){var t=this;if(!this._isTransitioning&&g(this._element).hasClass(mt)){var e=g.Event(_t.HIDE);if(g(this._element).trigger(e),!e.isDefaultPrevented()){var n=this._getDimension();this._element.style[n]=this._element.getBoundingClientRect()[n]+"px",_.reflow(this._element),g(this._element).addClass(vt).removeClass(pt).removeClass(mt);var i=this._triggerArray.length;if(0<i)for(var o=0;o<i;o++){var r=this._triggerArray[o],s=_.getSelectorFromElement(r);if(null!==s)g([].slice.call(document.querySelectorAll(s))).hasClass(mt)||g(r).addClass(Et).attr("aria-expanded",!1)}this.setTransitioning(!0);this._element.style[n]="";var a=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(){t.setTransitioning(!1),g(t._element).removeClass(vt).addClass(pt).trigger(_t.HIDDEN)}).emulateTransitionEnd(a)}}},t.setTransitioning=function(t){this._isTransitioning=t},t.dispose=function(){g.removeData(this._element,ht),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},t._getConfig=function(t){return(t=l({},dt,t)).toggle=Boolean(t.toggle),_.typeCheckConfig(ct,t,gt),t},t._getDimension=function(){return g(this._element).hasClass(yt)?yt:Ct},t._getParent=function(){var t,n=this;_.isElement(this._config.parent)?(t=this._config.parent,"undefined"!=typeof this._config.parent.jquery&&(t=this._config.parent[0])):t=document.querySelector(this._config.parent);var e='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',i=[].slice.call(t.querySelectorAll(e));return g(i).each(function(t,e){n._addAriaAndCollapsedClass(a._getTargetFromElement(e),[e])}),t},t._addAriaAndCollapsedClass=function(t,e){var n=g(t).hasClass(mt);e.length&&g(e).toggleClass(Et,!n).attr("aria-expanded",n)},a._getTargetFromElement=function(t){var e=_.getSelectorFromElement(t);return e?document.querySelector(e):null},a._jQueryInterface=function(i){return this.each(function(){var t=g(this),e=t.data(ht),n=l({},dt,t.data(),"object"==typeof i&&i?i:{});if(!e&&n.toggle&&/show|hide/.test(i)&&(n.toggle=!1),e||(e=new a(this,n),t.data(ht,e)),"string"==typeof i){if("undefined"==typeof e[i])throw new TypeError('No method named "'+i+'"');e[i]()}})},s(a,null,[{key:"VERSION",get:function(){return"4.2.1"}},{key:"Default",get:function(){return dt}}]),a}();g(document).on(_t.CLICK_DATA_API,St,function(t){"A"===t.currentTarget.tagName&&t.preventDefault();var n=g(this),e=_.getSelectorFromElement(this),i=[].slice.call(document.querySelectorAll(e));g(i).each(function(){var t=g(this),e=t.data(ht)?"toggle":n.data();bt._jQueryInterface.call(t,e)})}),g.fn[ct]=bt._jQueryInterface,g.fn[ct].Constructor=bt,g.fn[ct].noConflict=function(){return g.fn[ct]=ft,bt._jQueryInterface};var It="dropdown",Dt="bs.dropdown",wt="."+Dt,At=".data-api",Nt=g.fn[It],Ot=new RegExp("38|40|27"),kt={HIDE:"hide"+wt,HIDDEN:"hidden"+wt,SHOW:"show"+wt,SHOWN:"shown"+wt,CLICK:"click"+wt,CLICK_DATA_API:"click"+wt+At,KEYDOWN_DATA_API:"keydown"+wt+At,KEYUP_DATA_API:"keyup"+wt+At},Pt="disabled",Lt="show",jt="dropup",Ht="dropright",Rt="dropleft",Ut="dropdown-menu-right",Wt="position-static",xt='[data-toggle="dropdown"]',Ft=".dropdown form",qt=".dropdown-menu",Mt=".navbar-nav",Kt=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",Qt="top-start",Bt="top-end",Vt="bottom-start",Yt="bottom-end",Xt="right-start",zt="left-start",Gt={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic"},Jt={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string"},Zt=function(){function c(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var t=c.prototype;return t.toggle=function(){if(!this._element.disabled&&!g(this._element).hasClass(Pt)){var t=c._getParentFromElement(this._element),e=g(this._menu).hasClass(Lt);if(c._clearMenus(),!e){var n={relatedTarget:this._element},i=g.Event(kt.SHOW,n);if(g(t).trigger(i),!i.isDefaultPrevented()){if(!this._inNavbar){if("undefined"==typeof u)throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)");var o=this._element;"parent"===this._config.reference?o=t:_.isElement(this._config.reference)&&(o=this._config.reference,"undefined"!=typeof this._config.reference.jquery&&(o=this._config.reference[0])),"scrollParent"!==this._config.boundary&&g(t).addClass(Wt),this._popper=new u(o,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===g(t).closest(Mt).length&&g(document.body).children().on("mouseover",null,g.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),g(this._menu).toggleClass(Lt),g(t).toggleClass(Lt).trigger(g.Event(kt.SHOWN,n))}}}},t.show=function(){if(!(this._element.disabled||g(this._element).hasClass(Pt)||g(this._menu).hasClass(Lt))){var t={relatedTarget:this._element},e=g.Event(kt.SHOW,t),n=c._getParentFromElement(this._element);g(n).trigger(e),e.isDefaultPrevented()||(g(this._menu).toggleClass(Lt),g(n).toggleClass(Lt).trigger(g.Event(kt.SHOWN,t)))}},t.hide=function(){if(!this._element.disabled&&!g(this._element).hasClass(Pt)&&g(this._menu).hasClass(Lt)){var t={relatedTarget:this._element},e=g.Event(kt.HIDE,t),n=c._getParentFromElement(this._element);g(n).trigger(e),e.isDefaultPrevented()||(g(this._menu).toggleClass(Lt),g(n).toggleClass(Lt).trigger(g.Event(kt.HIDDEN,t)))}},t.dispose=function(){g.removeData(this._element,Dt),g(this._element).off(wt),this._element=null,(this._menu=null)!==this._popper&&(this._popper.destroy(),this._popper=null)},t.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},t._addEventListeners=function(){var e=this;g(this._element).on(kt.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},t._getConfig=function(t){return t=l({},this.constructor.Default,g(this._element).data(),t),_.typeCheckConfig(It,t,this.constructor.DefaultType),t},t._getMenuElement=function(){if(!this._menu){var t=c._getParentFromElement(this._element);t&&(this._menu=t.querySelector(qt))}return this._menu},t._getPlacement=function(){var t=g(this._element.parentNode),e=Vt;return t.hasClass(jt)?(e=Qt,g(this._menu).hasClass(Ut)&&(e=Bt)):t.hasClass(Ht)?e=Xt:t.hasClass(Rt)?e=zt:g(this._menu).hasClass(Ut)&&(e=Yt),e},t._detectNavbar=function(){return 0<g(this._element).closest(".navbar").length},t._getPopperConfig=function(){var e=this,t={};"function"==typeof this._config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e._config.offset(t.offsets)||{}),t}:t.offset=this._config.offset;var n={placement:this._getPlacement(),modifiers:{offset:t,flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(n.modifiers.applyStyle={enabled:!1}),n},c._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(Dt);if(t||(t=new c(this,"object"==typeof e?e:null),g(this).data(Dt,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},c._clearMenus=function(t){if(!t||3!==t.which&&("keyup"!==t.type||9===t.which))for(var e=[].slice.call(document.querySelectorAll(xt)),n=0,i=e.length;n<i;n++){var o=c._getParentFromElement(e[n]),r=g(e[n]).data(Dt),s={relatedTarget:e[n]};if(t&&"click"===t.type&&(s.clickEvent=t),r){var a=r._menu;if(g(o).hasClass(Lt)&&!(t&&("click"===t.type&&/input|textarea/i.test(t.target.tagName)||"keyup"===t.type&&9===t.which)&&g.contains(o,t.target))){var l=g.Event(kt.HIDE,s);g(o).trigger(l),l.isDefaultPrevented()||("ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),e[n].setAttribute("aria-expanded","false"),g(a).removeClass(Lt),g(o).removeClass(Lt).trigger(g.Event(kt.HIDDEN,s)))}}}},c._getParentFromElement=function(t){var e,n=_.getSelectorFromElement(t);return n&&(e=document.querySelector(n)),e||t.parentNode},c._dataApiKeydownHandler=function(t){if((/input|textarea/i.test(t.target.tagName)?!(32===t.which||27!==t.which&&(40!==t.which&&38!==t.which||g(t.target).closest(qt).length)):Ot.test(t.which))&&(t.preventDefault(),t.stopPropagation(),!this.disabled&&!g(this).hasClass(Pt))){var e=c._getParentFromElement(this),n=g(e).hasClass(Lt);if(n&&(!n||27!==t.which&&32!==t.which)){var i=[].slice.call(e.querySelectorAll(Kt));if(0!==i.length){var o=i.indexOf(t.target);38===t.which&&0<o&&o--,40===t.which&&o<i.length-1&&o++,o<0&&(o=0),i[o].focus()}}else{if(27===t.which){var r=e.querySelector(xt);g(r).trigger("focus")}g(this).trigger("click")}}},s(c,null,[{key:"VERSION",get:function(){return"4.2.1"}},{key:"Default",get:function(){return Gt}},{key:"DefaultType",get:function(){return Jt}}]),c}();g(document).on(kt.KEYDOWN_DATA_API,xt,Zt._dataApiKeydownHandler).on(kt.KEYDOWN_DATA_API,qt,Zt._dataApiKeydownHandler).on(kt.CLICK_DATA_API+" "+kt.KEYUP_DATA_API,Zt._clearMenus).on(kt.CLICK_DATA_API,xt,function(t){t.preventDefault(),t.stopPropagation(),Zt._jQueryInterface.call(g(this),"toggle")}).on(kt.CLICK_DATA_API,Ft,function(t){t.stopPropagation()}),g.fn[It]=Zt._jQueryInterface,g.fn[It].Constructor=Zt,g.fn[It].noConflict=function(){return g.fn[It]=Nt,Zt._jQueryInterface};var $t="modal",te="bs.modal",ee="."+te,ne=g.fn[$t],ie={backdrop:!0,keyboard:!0,focus:!0,show:!0},oe={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},re={HIDE:"hide"+ee,HIDDEN:"hidden"+ee,SHOW:"show"+ee,SHOWN:"shown"+ee,FOCUSIN:"focusin"+ee,RESIZE:"resize"+ee,CLICK_DISMISS:"click.dismiss"+ee,KEYDOWN_DISMISS:"keydown.dismiss"+ee,MOUSEUP_DISMISS:"mouseup.dismiss"+ee,MOUSEDOWN_DISMISS:"mousedown.dismiss"+ee,CLICK_DATA_API:"click"+ee+".data-api"},se="modal-scrollbar-measure",ae="modal-backdrop",le="modal-open",ce="fade",he="show",ue=".modal-dialog",fe='[data-toggle="modal"]',de='[data-dismiss="modal"]',ge=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",_e=".sticky-top",me=function(){function o(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(ue),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var t=o.prototype;return t.toggle=function(t){return this._isShown?this.hide():this.show(t)},t.show=function(t){var e=this;if(!this._isShown&&!this._isTransitioning){g(this._element).hasClass(ce)&&(this._isTransitioning=!0);var n=g.Event(re.SHOW,{relatedTarget:t});g(this._element).trigger(n),this._isShown||n.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),g(this._element).on(re.CLICK_DISMISS,de,function(t){return e.hide(t)}),g(this._dialog).on(re.MOUSEDOWN_DISMISS,function(){g(e._element).one(re.MOUSEUP_DISMISS,function(t){g(t.target).is(e._element)&&(e._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return e._showElement(t)}))}},t.hide=function(t){var e=this;if(t&&t.preventDefault(),this._isShown&&!this._isTransitioning){var n=g.Event(re.HIDE);if(g(this._element).trigger(n),this._isShown&&!n.isDefaultPrevented()){this._isShown=!1;var i=g(this._element).hasClass(ce);if(i&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),g(document).off(re.FOCUSIN),g(this._element).removeClass(he),g(this._element).off(re.CLICK_DISMISS),g(this._dialog).off(re.MOUSEDOWN_DISMISS),i){var o=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(t){return e._hideModal(t)}).emulateTransitionEnd(o)}else this._hideModal()}}},t.dispose=function(){[window,this._element,this._dialog].forEach(function(t){return g(t).off(ee)}),g(document).off(re.FOCUSIN),g.removeData(this._element,te),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},t.handleUpdate=function(){this._adjustDialog()},t._getConfig=function(t){return t=l({},ie,t),_.typeCheckConfig($t,t,oe),t},t._showElement=function(t){var e=this,n=g(this._element).hasClass(ce);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.scrollTop=0,n&&_.reflow(this._element),g(this._element).addClass(he),this._config.focus&&this._enforceFocus();var i=g.Event(re.SHOWN,{relatedTarget:t}),o=function(){e._config.focus&&e._element.focus(),e._isTransitioning=!1,g(e._element).trigger(i)};if(n){var r=_.getTransitionDurationFromElement(this._dialog);g(this._dialog).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o()},t._enforceFocus=function(){var e=this;g(document).off(re.FOCUSIN).on(re.FOCUSIN,function(t){document!==t.target&&e._element!==t.target&&0===g(e._element).has(t.target).length&&e._element.focus()})},t._setEscapeEvent=function(){var e=this;this._isShown&&this._config.keyboard?g(this._element).on(re.KEYDOWN_DISMISS,function(t){27===t.which&&(t.preventDefault(),e.hide())}):this._isShown||g(this._element).off(re.KEYDOWN_DISMISS)},t._setResizeEvent=function(){var e=this;this._isShown?g(window).on(re.RESIZE,function(t){return e.handleUpdate(t)}):g(window).off(re.RESIZE)},t._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._isTransitioning=!1,this._showBackdrop(function(){g(document.body).removeClass(le),t._resetAdjustments(),t._resetScrollbar(),g(t._element).trigger(re.HIDDEN)})},t._removeBackdrop=function(){this._backdrop&&(g(this._backdrop).remove(),this._backdrop=null)},t._showBackdrop=function(t){var e=this,n=g(this._element).hasClass(ce)?ce:"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className=ae,n&&this._backdrop.classList.add(n),g(this._backdrop).appendTo(document.body),g(this._element).on(re.CLICK_DISMISS,function(t){e._ignoreBackdropClick?e._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===e._config.backdrop?e._element.focus():e.hide())}),n&&_.reflow(this._backdrop),g(this._backdrop).addClass(he),!t)return;if(!n)return void t();var i=_.getTransitionDurationFromElement(this._backdrop);g(this._backdrop).one(_.TRANSITION_END,t).emulateTransitionEnd(i)}else if(!this._isShown&&this._backdrop){g(this._backdrop).removeClass(he);var o=function(){e._removeBackdrop(),t&&t()};if(g(this._element).hasClass(ce)){var r=_.getTransitionDurationFromElement(this._backdrop);g(this._backdrop).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o()}else t&&t()},t._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},t._setScrollbar=function(){var o=this;if(this._isBodyOverflowing){var t=[].slice.call(document.querySelectorAll(ge)),e=[].slice.call(document.querySelectorAll(_e));g(t).each(function(t,e){var n=e.style.paddingRight,i=g(e).css("padding-right");g(e).data("padding-right",n).css("padding-right",parseFloat(i)+o._scrollbarWidth+"px")}),g(e).each(function(t,e){var n=e.style.marginRight,i=g(e).css("margin-right");g(e).data("margin-right",n).css("margin-right",parseFloat(i)-o._scrollbarWidth+"px")});var n=document.body.style.paddingRight,i=g(document.body).css("padding-right");g(document.body).data("padding-right",n).css("padding-right",parseFloat(i)+this._scrollbarWidth+"px")}g(document.body).addClass(le)},t._resetScrollbar=function(){var t=[].slice.call(document.querySelectorAll(ge));g(t).each(function(t,e){var n=g(e).data("padding-right");g(e).removeData("padding-right"),e.style.paddingRight=n||""});var e=[].slice.call(document.querySelectorAll(""+_e));g(e).each(function(t,e){var n=g(e).data("margin-right");"undefined"!=typeof n&&g(e).css("margin-right",n).removeData("margin-right")});var n=g(document.body).data("padding-right");g(document.body).removeData("padding-right"),document.body.style.paddingRight=n||""},t._getScrollbarWidth=function(){var t=document.createElement("div");t.className=se,document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},o._jQueryInterface=function(n,i){return this.each(function(){var t=g(this).data(te),e=l({},ie,g(this).data(),"object"==typeof n&&n?n:{});if(t||(t=new o(this,e),g(this).data(te,t)),"string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n](i)}else e.show&&t.show(i)})},s(o,null,[{key:"VERSION",get:function(){return"4.2.1"}},{key:"Default",get:function(){return ie}}]),o}();g(document).on(re.CLICK_DATA_API,fe,function(t){var e,n=this,i=_.getSelectorFromElement(this);i&&(e=document.querySelector(i));var o=g(e).data(te)?"toggle":l({},g(e).data(),g(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault();var r=g(e).one(re.SHOW,function(t){t.isDefaultPrevented()||r.one(re.HIDDEN,function(){g(n).is(":visible")&&n.focus()})});me._jQueryInterface.call(g(e),o,this)}),g.fn[$t]=me._jQueryInterface,g.fn[$t].Constructor=me,g.fn[$t].noConflict=function(){return g.fn[$t]=ne,me._jQueryInterface};var pe="tooltip",ve="bs.tooltip",Ee="."+ve,ye=g.fn[pe],Ce="bs-tooltip",Te=new RegExp("(^|\\s)"+Ce+"\\S+","g"),Se={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)"},be={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},Ie={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent"},De="show",we="out",Ae={HIDE:"hide"+Ee,HIDDEN:"hidden"+Ee,SHOW:"show"+Ee,SHOWN:"shown"+Ee,INSERTED:"inserted"+Ee,CLICK:"click"+Ee,FOCUSIN:"focusin"+Ee,FOCUSOUT:"focusout"+Ee,MOUSEENTER:"mouseenter"+Ee,MOUSELEAVE:"mouseleave"+Ee},Ne="fade",Oe="show",ke=".tooltip-inner",Pe=".arrow",Le="hover",je="focus",He="click",Re="manual",Ue=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Oe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(Ne);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:Pe},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Oe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===we&&e._leave(null,e)};if(g(this.tip).hasClass(Ne)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==De&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Oe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[He]=!1,this._activeTrigger[je]=!1,this._activeTrigger[Le]=!1,g(this.tip).hasClass(Ne)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ce+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(ke)),this.getTitle()),g(t).removeClass(Ne+" "+Oe)},t.setElementContent=function(t,e){var n=this.config.html;"object"==typeof e&&(e.nodeType||e.jquery)?n?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text()):t[n?"html":"text"](e)},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return be[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Re){var e=t===Le?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===Le?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?je:Le]=!0),g(e.getTipElement()).hasClass(Oe)||e._hoverState===De?e._hoverState=De:(clearTimeout(e._timeout),e._hoverState=De,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===De&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?je:Le]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=we,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===we&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){return"number"==typeof(t=l({},this.constructor.Default,g(this.element).data(),"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(pe,t,this.constructor.DefaultType),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Te);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(Ne),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(ve),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(ve,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.2.1"}},{key:"Default",get:function(){return Ie}},{key:"NAME",get:function(){return pe}},{key:"DATA_KEY",get:function(){return ve}},{key:"Event",get:function(){return Ae}},{key:"EVENT_KEY",get:function(){return Ee}},{key:"DefaultType",get:function(){return Se}}]),i}();g.fn[pe]=Ue._jQueryInterface,g.fn[pe].Constructor=Ue,g.fn[pe].noConflict=function(){return g.fn[pe]=ye,Ue._jQueryInterface};var We="popover",xe="bs.popover",Fe="."+xe,qe=g.fn[We],Me="bs-popover",Ke=new RegExp("(^|\\s)"+Me+"\\S+","g"),Qe=l({},Ue.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),Be=l({},Ue.DefaultType,{content:"(string|element|function)"}),Ve="fade",Ye="show",Xe=".popover-header",ze=".popover-body",Ge={HIDE:"hide"+Fe,HIDDEN:"hidden"+Fe,SHOW:"show"+Fe,SHOWN:"shown"+Fe,INSERTED:"inserted"+Fe,CLICK:"click"+Fe,FOCUSIN:"focusin"+Fe,FOCUSOUT:"focusout"+Fe,MOUSEENTER:"mouseenter"+Fe,MOUSELEAVE:"mouseleave"+Fe},Je=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Me+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(Xe),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(ze),e),t.removeClass(Ve+" "+Ye)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ke);null!==e&&0<e.length&&t.removeClass(e.join(""))},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(xe),e="object"==typeof n?n:null;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(xe,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.2.1"}},{key:"Default",get:function(){return Qe}},{key:"NAME",get:function(){return We}},{key:"DATA_KEY",get:function(){return xe}},{key:"Event",get:function(){return Ge}},{key:"EVENT_KEY",get:function(){return Fe}},{key:"DefaultType",get:function(){return Be}}]),i}(Ue);g.fn[We]=Je._jQueryInterface,g.fn[We].Constructor=Je,g.fn[We].noConflict=function(){return g.fn[We]=qe,Je._jQueryInterface};var Ze="scrollspy",$e="bs.scrollspy",tn="."+$e,en=g.fn[Ze],nn={offset:10,method:"auto",target:""},on={offset:"number",method:"string",target:"(string|element)"},rn={ACTIVATE:"activate"+tn,SCROLL:"scroll"+tn,LOAD_DATA_API:"load"+tn+".data-api"},sn="dropdown-item",an="active",ln='[data-spy="scroll"]',cn=".nav, .list-group",hn=".nav-link",un=".nav-item",fn=".list-group-item",dn=".dropdown",gn=".dropdown-item",_n=".dropdown-toggle",mn="offset",pn="position",vn=function(){function n(t,e){var n=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(e),this._selector=this._config.target+" "+hn+","+this._config.target+" "+fn+","+this._config.target+" "+gn,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,g(this._scrollElement).on(rn.SCROLL,function(t){return n._process(t)}),this.refresh(),this._process()}var t=n.prototype;return t.refresh=function(){var e=this,t=this._scrollElement===this._scrollElement.window?mn:pn,o="auto"===this._config.method?t:this._config.method,r=o===pn?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map(function(t){var e,n=_.getSelectorFromElement(t);if(n&&(e=document.querySelector(n)),e){var i=e.getBoundingClientRect();if(i.width||i.height)return[g(e)[o]().top+r,n]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},t.dispose=function(){g.removeData(this._element,$e),g(this._scrollElement).off(tn),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},t._getConfig=function(t){if("string"!=typeof(t=l({},nn,"object"==typeof t&&t?t:{})).target){var e=g(t.target).attr("id");e||(e=_.getUID(Ze),g(t.target).attr("id",e)),t.target="#"+e}return _.typeCheckConfig(Ze,t,on),t},t._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},t._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},t._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},t._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),n<=t){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&0<this._offsets[0])return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}}},t._activate=function(e){this._activeTarget=e,this._clear();var t=this._selector.split(",").map(function(t){return t+'[data-target="'+e+'"],'+t+'[href="'+e+'"]'}),n=g([].slice.call(document.querySelectorAll(t.join(","))));n.hasClass(sn)?(n.closest(dn).find(_n).addClass(an),n.addClass(an)):(n.addClass(an),n.parents(cn).prev(hn+", "+fn).addClass(an),n.parents(cn).prev(un).children(hn).addClass(an)),g(this._scrollElement).trigger(rn.ACTIVATE,{relatedTarget:e})},t._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter(function(t){return t.classList.contains(an)}).forEach(function(t){return t.classList.remove(an)})},n._jQueryInterface=function(e){return this.each(function(){var t=g(this).data($e);if(t||(t=new n(this,"object"==typeof e&&e),g(this).data($e,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},s(n,null,[{key:"VERSION",get:function(){return"4.2.1"}},{key:"Default",get:function(){return nn}}]),n}();g(window).on(rn.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(ln)),e=t.length;e--;){var n=g(t[e]);vn._jQueryInterface.call(n,n.data())}}),g.fn[Ze]=vn._jQueryInterface,g.fn[Ze].Constructor=vn,g.fn[Ze].noConflict=function(){return g.fn[Ze]=en,vn._jQueryInterface};var En="bs.tab",yn="."+En,Cn=g.fn.tab,Tn={HIDE:"hide"+yn,HIDDEN:"hidden"+yn,SHOW:"show"+yn,SHOWN:"shown"+yn,CLICK_DATA_API:"click"+yn+".data-api"},Sn="dropdown-menu",bn="active",In="disabled",Dn="fade",wn="show",An=".dropdown",Nn=".nav, .list-group",On=".active",kn="> li > .active",Pn='[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',Ln=".dropdown-toggle",jn="> .dropdown-menu .active",Hn=function(){function i(t){this._element=t}var t=i.prototype;return t.show=function(){var n=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&g(this._element).hasClass(bn)||g(this._element).hasClass(In))){var t,i,e=g(this._element).closest(Nn)[0],o=_.getSelectorFromElement(this._element);if(e){var r="UL"===e.nodeName||"OL"===e.nodeName?kn:On;i=(i=g.makeArray(g(e).find(r)))[i.length-1]}var s=g.Event(Tn.HIDE,{relatedTarget:this._element}),a=g.Event(Tn.SHOW,{relatedTarget:i});if(i&&g(i).trigger(s),g(this._element).trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){o&&(t=document.querySelector(o)),this._activate(this._element,e);var l=function(){var t=g.Event(Tn.HIDDEN,{relatedTarget:n._element}),e=g.Event(Tn.SHOWN,{relatedTarget:i});g(i).trigger(t),g(n._element).trigger(e)};t?this._activate(t,t.parentNode,l):l()}}},t.dispose=function(){g.removeData(this._element,En),this._element=null},t._activate=function(t,e,n){var i=this,o=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?g(e).children(On):g(e).find(kn))[0],r=n&&o&&g(o).hasClass(Dn),s=function(){return i._transitionComplete(t,o,n)};if(o&&r){var a=_.getTransitionDurationFromElement(o);g(o).removeClass(wn).one(_.TRANSITION_END,s).emulateTransitionEnd(a)}else s()},t._transitionComplete=function(t,e,n){if(e){g(e).removeClass(bn);var i=g(e.parentNode).find(jn)[0];i&&g(i).removeClass(bn),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}if(g(t).addClass(bn),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),_.reflow(t),g(t).addClass(wn),t.parentNode&&g(t.parentNode).hasClass(Sn)){var o=g(t).closest(An)[0];if(o){var r=[].slice.call(o.querySelectorAll(Ln));g(r).addClass(bn)}t.setAttribute("aria-expanded",!0)}n&&n()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(En);if(e||(e=new i(this),t.data(En,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method named "'+n+'"');e[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.2.1"}}]),i}();g(document).on(Tn.CLICK_DATA_API,Pn,function(t){t.preventDefault(),Hn._jQueryInterface.call(g(this),"show")}),g.fn.tab=Hn._jQueryInterface,g.fn.tab.Constructor=Hn,g.fn.tab.noConflict=function(){return g.fn.tab=Cn,Hn._jQueryInterface};var Rn="toast",Un="bs.toast",Wn="."+Un,xn=g.fn[Rn],Fn={CLICK_DISMISS:"click.dismiss"+Wn,HIDE:"hide"+Wn,HIDDEN:"hidden"+Wn,SHOW:"show"+Wn,SHOWN:"shown"+Wn},qn="fade",Mn="hide",Kn="show",Qn="showing",Bn={animation:"boolean",autohide:"boolean",delay:"number"},Vn={animation:!0,autohide:!0,delay:500},Yn='[data-dismiss="toast"]',Xn=function(){function i(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var t=i.prototype;return t.show=function(){var t=this;g(this._element).trigger(Fn.SHOW),this._config.animation&&this._element.classList.add(qn);var e=function(){t._element.classList.remove(Qn),t._element.classList.add(Kn),g(t._element).trigger(Fn.SHOWN),t._config.autohide&&t.hide()};if(this._element.classList.remove(Mn),this._element.classList.add(Qn),this._config.animation){var n=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},t.hide=function(t){var e=this;this._element.classList.contains(Kn)&&(g(this._element).trigger(Fn.HIDE),t?this._close():this._timeout=setTimeout(function(){e._close()},this._config.delay))},t.dispose=function(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains(Kn)&&this._element.classList.remove(Kn),g(this._element).off(Fn.CLICK_DISMISS),g.removeData(this._element,Un),this._element=null,this._config=null},t._getConfig=function(t){return t=l({},Vn,g(this._element).data(),"object"==typeof t&&t?t:{}),_.typeCheckConfig(Rn,t,this.constructor.DefaultType),t},t._setListeners=function(){var t=this;g(this._element).on(Fn.CLICK_DISMISS,Yn,function(){return t.hide(!0)})},t._close=function(){var t=this,e=function(){t._element.classList.add(Mn),g(t._element).trigger(Fn.HIDDEN)};if(this._element.classList.remove(Kn),this._config.animation){var n=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(Un);if(e||(e=new i(this,"object"==typeof n&&n),t.data(Un,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method named "'+n+'"');e[n](this)}})},s(i,null,[{key:"VERSION",get:function(){return"4.2.1"}},{key:"DefaultType",get:function(){return Bn}}]),i}();g.fn[Rn]=Xn._jQueryInterface,g.fn[Rn].Constructor=Xn,g.fn[Rn].noConflict=function(){return g.fn[Rn]=xn,Xn._jQueryInterface},function(){if("undefined"==typeof g)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=g.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||4<=t[0])throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(),t.Util=_,t.Alert=p,t.Button=P,t.Carousel=lt,t.Collapse=bt,t.Dropdown=Zt,t.Modal=me,t.Popover=Je,t.Scrollspy=vn,t.Tab=Hn,t.Toast=Xn,t.Tooltip=Ue,Object.defineProperty(t,"__esModule",{value:!0})});
7
+ //# sourceMappingURL=bootstrap.min.js.map
@@ -0,0 +1,2 @@
1
+ /*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */
2
+ !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],a!==(r=e[t])&&(l&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&w.isPlainObject(n)?n:{},a[t]=w.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},w.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){m(e)},each:function(e,t){var n,r=0;if(C(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(C(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],o=0,a=e.length,s=!n;o<a;o++)(r=!t(e[o],o))!==s&&i.push(e[o]);return i},map:function(e,t,n){var r,i,o=0,s=[];if(C(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,support:h}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function C(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",I="\\["+M+"*("+R+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+M+"*\\]",W=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+I+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),F=new RegExp("^"+M+"*,"+M+"*"),_=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pe(t);function ye(){}ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,a=oe.tokenize=function(e,t){var n,i,o,a,s,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=r.preFilter;while(s){n&&!(i=F.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),n=!1,(i=_.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(B," ")}),s=s.slice(n.length));for(a in r.filter)!(i=V[a].exec(s))||l[a]&&!(i=l[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?oe.error(e):k(e,u).slice(0)};function ve(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function me(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,p=[T,s];if(u){while(t=t[r])if((1===t.nodeType||a)&&e(t,n,u))return!0}else while(t=t[r])if(1===t.nodeType||a)if(f=t[b]||(t[b]={}),c=f[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===T&&l[1]===s)return p[2]=l[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function xe(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r<i;r++)oe(e,t[r],n);return n}function we(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Te(e,t,n,r,i,o){return r&&!r[b]&&(r=Te(r)),i&&!i[b]&&(i=Te(i,o)),se(function(o,a,s,u){var l,c,f,p=[],d=[],h=a.length,g=o||be(t||"*",s.nodeType?[s]:s,[]),y=!e||!o&&t?g:we(g,p,e,s,u),v=n?i||(o?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r){l=we(v,d),r(l,[],s,u),c=l.length;while(c--)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f))}if(o){if(i||e){if(i){l=[],c=v.length;while(c--)(f=v[c])&&l.push(y[c]=f);i(null,v=[],l,u)}c=v.length;while(c--)(f=v[c])&&(l=i?O(o,f):p[c])>-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])p=[me(xe(p),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[b]){for(i=++u;i<o;i++)if(r.relative[e[i].type])break;return Te(u>1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u<i&&Ce(e.slice(u,i)),i<o&&Ce(e=e.slice(i)),i<o&&ve(e))}p.push(n)}return xe(p)}function Ee(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t<r;t++)if(w.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)w.find(e,i[t],n);return r>1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&w(e);if(!D.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s<o.length)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1)}e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){w.each(n,function(n,r){g(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==x(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return w.each(arguments,function(e,t){var n;while((n=w.inArray(t,o,n))>-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t<o)){if((e=r.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");l=e&&("object"==typeof e||"function"==typeof e)&&e.then,g(l)?i?l.call(e,a(o,n,I,i),a(o,n,W,i)):(o++,l.call(e,a(o,n,I,i),a(o,n,W,i),a(o,n,I,n.notifyWith))):(r!==I&&(s=void 0,u=[e]),(i||n.resolveWith)(s,u))}},c=i?l:function(){try{l()}catch(e){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},X=/^-ms-/,U=/-([a-z])/g;function V(e,t){return t.toUpperCase()}function G(e){return e.replace(X,"ms-").replace(U,V)}var Y=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Q(){this.expando=w.expando+Q.uid++}Q.uid=1,Q.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Y(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[G(t)]=n;else for(r in t)i[G(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][G(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(G):(t=G(t))in r?[t]:t.match(M)||[]).length;while(n--)delete r[t[n]]}(void 0===t||w.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!w.isEmptyObject(t)}};var J=new Q,K=new Q,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ee=/[A-Z]/g;function te(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Z.test(e)?JSON.parse(e):e)}function ne(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ee,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=te(n)}catch(e){}K.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return K.hasData(e)||J.hasData(e)},data:function(e,t,n){return K.access(e,t,n)},removeData:function(e,t){K.remove(e,t)},_data:function(e,t,n){return J.access(e,t,n)},_removeData:function(e,t){J.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=K.get(o),1===o.nodeType&&!J.get(o,"hasDataAttrs"))){n=a.length;while(n--)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=G(r.slice(5)),ne(o,r,i[r]));J.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){K.set(this,e)}):z(this,function(t){var n;if(o&&void 0===t){if(void 0!==(n=K.get(o,e)))return n;if(void 0!==(n=ne(o,e)))return n}else this.each(function(){K.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each(function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)})},dequeue:function(e){return this.each(function(){w.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=w.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=J.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var re=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ie=new RegExp("^(?:([+-])=|)("+re+")([a-z%]*)$","i"),oe=["Top","Right","Bottom","Left"],ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&w.contains(e.ownerDocument,e)&&"none"===w.css(e,"display")},se=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};function ue(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return w.css(e,t,"")},u=s(),l=n&&n[3]||(w.cssNumber[t]?"":"px"),c=(w.cssNumber[t]||"px"!==l&&+u)&&ie.exec(w.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)w.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,w.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var le={};function ce(e){var t,n=e.ownerDocument,r=e.nodeName,i=le[r];return i||(t=n.body.appendChild(n.createElement(r)),i=w.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),le[r]=i,i)}function fe(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=J.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[o]=ce(r))):"none"!==n&&(i[o]="none",J.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}w.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?w(this).show():w(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)J.set(e[n],"globalEval",!t||J.get(t[n],"globalEval"))}var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))w.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+w.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;w.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&w.inArray(o,r)>-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n<arguments.length;n++)u[n]=arguments[n];if(t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){s=w.event.handlers.call(this,t,l),n=0;while((o=s[n++])&&!t.isPropagationStopped()){t.currentTarget=o.elem,r=0;while((a=o.handlers[r++])&&!t.isImmediatePropagationStopped())t.rnamespace&&!t.rnamespace.test(a.namespace)||(t.handleObj=a,t.data=a.data,void 0!==(i=((w.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u))&&!1===(t.result=i)&&(t.preventDefault(),t.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?w(i,this).index(l)>-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:g(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Se()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===Se()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&N(this,"input"))return this.click(),!1},_default:function(e){return N(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ee:ke,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:ke,isPropagationStopped:ke,isImmediatePropagationStopped:ke,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ee,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ee,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ee,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&we.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Te.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},w.event.addProp),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||w.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),w.fn.extend({on:function(e,t,n,r){return De(this,e,t,n,r)},one:function(e,t,n,r){return De(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,w(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=ke),this.each(function(){w.event.remove(this,e,n,t)})}});var Ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/<script|<style|<link/i,je=/checked\s*(?:[^=]|=\s*.checked.)/i,qe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n<r;n++)w.event.add(t,i,l[i][n])}K.hasData(e)&&(s=K.access(e),u=w.extend({},s),K.set(t,u))}}function Me(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Re(e,t,n,r){t=a.apply([],t);var i,o,s,u,l,c,f=0,p=e.length,d=p-1,y=t[0],v=g(y);if(v||p>1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f<p;f++)l=i,f!==d&&(l=w.clone(l,!0,!0),u&&w.merge(s,ye(l,"script"))),n.call(e[f],l,f);if(u)for(c=s[s.length-1].ownerDocument,w.map(s,Oe),f=0;f<u;f++)l=s[f],he.test(l.type||"")&&!J.access(l,"globalEval")&&w.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?w._evalUrl&&w._evalUrl(l.src):m(l.textContent.replace(qe,""),c,l))}return e}function Ie(e,t,n){for(var r,i=t?w.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||w.cleanData(ye(r)),r.parentNode&&(n&&w.contains(r.ownerDocument,r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}w.extend({htmlPrefilter:function(e){return e.replace(Ne,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r<i;r++)Me(o[r],a[r]);if(t)if(n)for(o=o||ye(e),a=a||ye(s),r=0,i=o.length;r<i;r++)Pe(o[r],a[r]);else Pe(e,s);return(a=ye(s,"script")).length>0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(ye(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),w(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}});var We=new RegExp("^("+re+")(?!px)[a-z%]+$","i"),$e=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Be=new RegExp(oe.join("|"),"i");!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",be.appendChild(l).appendChild(c);var t=e.getComputedStyle(c);i="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",s=36===n(t.right),o=36===n(t.width),c.style.position="absolute",a=36===c.offsetWidth||"absolute",be.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var i,o,a,s,u,l=r.createElement("div"),c=r.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(h,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),a}}))}();function Fe(e,t,n){var r,i,o,a,s=e.style;return(n=n||$e(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||w.contains(e.ownerDocument,e)||(a=w.style(e,t)),!h.pixelBoxStyles()&&We.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}var ze=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ue={position:"absolute",visibility:"hidden",display:"block"},Ve={letterSpacing:"0",fontWeight:"400"},Ge=["Webkit","Moz","ms"],Ye=r.createElement("div").style;function Qe(e){if(e in Ye)return e;var t=e[0].toUpperCase()+e.slice(1),n=Ge.length;while(n--)if((e=Ge[n]+t)in Ye)return e}function Je(e){var t=w.cssProps[e];return t||(t=w.cssProps[e]=Qe(e)||e),t}function Ke(e,t,n){var r=ie.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ze(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=w.css(e,n+oe[a],!0,i)),r?("content"===n&&(u-=w.css(e,"padding"+oe[a],!0,i)),"margin"!==n&&(u-=w.css(e,"border"+oe[a]+"Width",!0,i))):(u+=w.css(e,"padding"+oe[a],!0,i),"padding"!==n?u+=w.css(e,"border"+oe[a]+"Width",!0,i):s+=w.css(e,"border"+oe[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a<i;a++)o[t[a]]=w.css(e,t[a],!1,r);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)},e,t,arguments.length>1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ct(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),y=J.get(e,"fxshow");n.queue||(null==(a=w._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,w.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(i=t[r],it.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0}d[r]=y&&y[r]||w.style(e,r)}if((u=!w.isEmptyObject(t))||!w.isEmptyObject(d)){f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=y&&y.display)&&(l=J.get(e,"display")),"none"===(c=w.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=w.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===w.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1;for(r in d)u||(y?"hidden"in y&&(g=y.hidden):y=J.access(e,"fxshow",{display:l}),o&&(y.hidden=!g),g&&fe([e],!0),p.done(function(){g||fe([e]),J.remove(e,"fxshow");for(r in d)w.style(e,r,d[r])})),u=lt(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}}function ft(e,t){var n,r,i,o,a;for(n in e)if(r=G(n),i=t[r],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=w.cssHooks[r])&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function pt(e,t,n){var r,i,o=0,a=pt.prefilters.length,s=w.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=nt||st(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,a=l.tweens.length;o<a;o++)l.tweens[o].run(r);return s.notifyWith(e,[l,r,n]),r<1&&a?n:(a||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:nt||st(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(ft(c,l.opts.specialEasing);o<a;o++)if(r=pt.prefilters[o].call(l,e,c,l.opts))return g(r.stop)&&(w._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,lt,l),g(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),w.fx.timer(w.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}w.Animation=w.extend(pt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ue(n.elem,e,ie.exec(t),n),n}]},tweener:function(e,t){g(e)?(t=e,e=["*"]):e=e.match(M);for(var n,r=0,i=e.length;r<i;r++)n=e[r],pt.tweeners[n]=pt.tweeners[n]||[],pt.tweeners[n].unshift(t)},prefilters:[ct],prefilter:function(e,t){t?pt.prefilters.unshift(e):pt.prefilters.push(e)}}),w.speed=function(e,t,n){var r=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||g(e)&&e,duration:e,easing:n&&t||t&&!g(t)&&t};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){g(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),o=w.speed(t,n,r),a=function(){var t=pt(this,w.extend({},e),o);(i||J.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=w.timers,a=J.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&ot.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||w.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=J.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=w.timers,a=r?r.length:0;for(n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),w.each(["toggle","show","hide"],function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ut(t,!0),e,r,i)}}),w.each({slideDown:ut("show"),slideUp:ut("hide"),slideToggle:ut("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(nt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),nt=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){rt||(rt=!0,at())},w.fx.stop=function(){rt=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(t,n){return t=w.fx?w.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=r.createElement("input"),t=r.createElement("select").appendChild(r.createElement("option"));e.type="checkbox",h.checkOn=""!==e.value,h.optSelected=t.selected,(e=r.createElement("input")).value="t",e.type="radio",h.radioValue="t"===e.value}();var dt,ht=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return z(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!N(n.parentNode,"optgroup"))){if(t=w(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=w.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=w.inArray(w.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Yt=[],Qt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Yt.pop()||w.expando+"_"+Et++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(Qt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=g(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Qt,"$1"+i):!1!==t.jsonp&&(t.url+=(kt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Yt.push(i)),a&&g(o)&&o(a[0]),a=o=void 0}),"script"}),h.createHTMLDocument=function(){var e=r.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),w.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var i,o,a;return t||(h.createHTMLDocument?((i=(t=r.implementation.createHTMLDocument("")).createElement("base")).href=r.location.href,t.head.appendChild(i)):t=r),o=A.exec(e),a=!n&&[],o?[t.createElement(o[1])]:(o=xe([e],t,a),a&&a.length&&w(a).remove(),w.merge([],o.childNodes))},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=vt(e.slice(s)),e=e.slice(0,s)),g(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&w.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?w("<div>").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=w.css(e,"position"),f=w(e),p={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=w.css(e,"top"),u=w.css(e,"left"),(l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1)?(a=(r=f.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),g(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):f.css(p)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];if(r)return r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===w.css(e,"position"))e=e.offsetParent;return e||be})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return z(this,function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=_e(h.pixelPosition,function(e,n){if(n)return n=Fe(e,t),We.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return z(this,function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),w.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),g(e))return r=o.call(arguments,2),i=function(){return e.apply(t||this,r.concat(o.call(arguments)))},i.guid=e.guid=e.guid||w.guid++,i},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=N,w.isFunction=g,w.isWindow=y,w.camelCase=G,w.type=x,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return w});var Jt=e.jQuery,Kt=e.$;return w.noConflict=function(t){return e.$===w&&(e.$=Kt),t&&e.jQuery===w&&(e.jQuery=Jt),w},t||(e.jQuery=e.$=w),w});
@@ -9,7 +9,8 @@ $(function() {
9
9
  // datumTokenizer: Bloodhound.tokenizers.whitespace,
10
10
  queryTokenizer: Bloodhound.tokenizers.whitespace,
11
11
 
12
- prefetch: 'search.json'
12
+ prefetch: 'assets/js/search.json',
13
+ cache: false,
13
14
  });
14
15
 
15
16
  $('#search-box').typeahead({
@@ -0,0 +1,11 @@
1
+ ---
2
+ ---
3
+ [
4
+ {% for doc in site.docs %}
5
+ {
6
+ "title": "{{ doc.title }}",
7
+ "url": "{{ doc.url | prepend: site.baseurl }}"
8
+
9
+ }{% unless forloop.last %},{% endunless %}
10
+ {% endfor %}
11
+ ]
@@ -0,0 +1,2621 @@
1
+ /*!
2
+ * typeahead.js 1.2.0
3
+ * https://github.com/twitter/typeahead.js
4
+ * Copyright 2013-2017 Twitter, Inc. and other contributors; Licensed MIT
5
+ */
6
+
7
+ (function(root, factory) {
8
+ if (typeof define === "function" && define.amd) {
9
+ define([ "jquery" ], function(a0) {
10
+ return root["Bloodhound"] = factory(a0);
11
+ });
12
+ } else if (typeof exports === "object") {
13
+ module.exports = factory(require("jquery"));
14
+ } else {
15
+ root["Bloodhound"] = factory(root["jQuery"]);
16
+ }
17
+ })(this, function($) {
18
+ var _ = function() {
19
+ "use strict";
20
+ return {
21
+ isMsie: function() {
22
+ return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false;
23
+ },
24
+ isBlankString: function(str) {
25
+ return !str || /^\s*$/.test(str);
26
+ },
27
+ escapeRegExChars: function(str) {
28
+ return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
29
+ },
30
+ isString: function(obj) {
31
+ return typeof obj === "string";
32
+ },
33
+ isNumber: function(obj) {
34
+ return typeof obj === "number";
35
+ },
36
+ isArray: $.isArray,
37
+ isFunction: $.isFunction,
38
+ isObject: $.isPlainObject,
39
+ isUndefined: function(obj) {
40
+ return typeof obj === "undefined";
41
+ },
42
+ isElement: function(obj) {
43
+ return !!(obj && obj.nodeType === 1);
44
+ },
45
+ isJQuery: function(obj) {
46
+ return obj instanceof $;
47
+ },
48
+ toStr: function toStr(s) {
49
+ return _.isUndefined(s) || s === null ? "" : s + "";
50
+ },
51
+ bind: $.proxy,
52
+ each: function(collection, cb) {
53
+ $.each(collection, reverseArgs);
54
+ function reverseArgs(index, value) {
55
+ return cb(value, index);
56
+ }
57
+ },
58
+ map: $.map,
59
+ filter: $.grep,
60
+ every: function(obj, test) {
61
+ var result = true;
62
+ if (!obj) {
63
+ return result;
64
+ }
65
+ $.each(obj, function(key, val) {
66
+ if (!(result = test.call(null, val, key, obj))) {
67
+ return false;
68
+ }
69
+ });
70
+ return !!result;
71
+ },
72
+ some: function(obj, test) {
73
+ var result = false;
74
+ if (!obj) {
75
+ return result;
76
+ }
77
+ $.each(obj, function(key, val) {
78
+ if (result = test.call(null, val, key, obj)) {
79
+ return false;
80
+ }
81
+ });
82
+ return !!result;
83
+ },
84
+ mixin: $.extend,
85
+ identity: function(x) {
86
+ return x;
87
+ },
88
+ clone: function(obj) {
89
+ return $.extend(true, {}, obj);
90
+ },
91
+ getIdGenerator: function() {
92
+ var counter = 0;
93
+ return function() {
94
+ return counter++;
95
+ };
96
+ },
97
+ templatify: function templatify(obj) {
98
+ return $.isFunction(obj) ? obj : template;
99
+ function template() {
100
+ return String(obj);
101
+ }
102
+ },
103
+ defer: function(fn) {
104
+ setTimeout(fn, 0);
105
+ },
106
+ debounce: function(func, wait, immediate) {
107
+ var timeout, result;
108
+ return function() {
109
+ var context = this, args = arguments, later, callNow;
110
+ later = function() {
111
+ timeout = null;
112
+ if (!immediate) {
113
+ result = func.apply(context, args);
114
+ }
115
+ };
116
+ callNow = immediate && !timeout;
117
+ clearTimeout(timeout);
118
+ timeout = setTimeout(later, wait);
119
+ if (callNow) {
120
+ result = func.apply(context, args);
121
+ }
122
+ return result;
123
+ };
124
+ },
125
+ throttle: function(func, wait) {
126
+ var context, args, timeout, result, previous, later;
127
+ previous = 0;
128
+ later = function() {
129
+ previous = new Date();
130
+ timeout = null;
131
+ result = func.apply(context, args);
132
+ };
133
+ return function() {
134
+ var now = new Date(), remaining = wait - (now - previous);
135
+ context = this;
136
+ args = arguments;
137
+ if (remaining <= 0) {
138
+ clearTimeout(timeout);
139
+ timeout = null;
140
+ previous = now;
141
+ result = func.apply(context, args);
142
+ } else if (!timeout) {
143
+ timeout = setTimeout(later, remaining);
144
+ }
145
+ return result;
146
+ };
147
+ },
148
+ stringify: function(val) {
149
+ return _.isString(val) ? val : JSON.stringify(val);
150
+ },
151
+ guid: function() {
152
+ function _p8(s) {
153
+ var p = (Math.random().toString(16) + "000000000").substr(2, 8);
154
+ return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p;
155
+ }
156
+ return "tt-" + _p8() + _p8(true) + _p8(true) + _p8();
157
+ },
158
+ noop: function() {}
159
+ };
160
+ }();
161
+ var VERSION = "1.2.0";
162
+ var tokenizers = function() {
163
+ "use strict";
164
+ return {
165
+ nonword: nonword,
166
+ whitespace: whitespace,
167
+ ngram: ngram,
168
+ obj: {
169
+ nonword: getObjTokenizer(nonword),
170
+ whitespace: getObjTokenizer(whitespace),
171
+ ngram: getObjTokenizer(ngram)
172
+ }
173
+ };
174
+ function whitespace(str) {
175
+ str = _.toStr(str);
176
+ return str ? str.split(/\s+/) : [];
177
+ }
178
+ function nonword(str) {
179
+ str = _.toStr(str);
180
+ return str ? str.split(/\W+/) : [];
181
+ }
182
+ function ngram(str) {
183
+ str = _.toStr(str);
184
+ var tokens = [], word = "";
185
+ _.each(str.split(""), function(char) {
186
+ if (char.match(/\s+/)) {
187
+ word = "";
188
+ } else {
189
+ tokens.push(word + char);
190
+ word += char;
191
+ }
192
+ });
193
+ return tokens;
194
+ }
195
+ function getObjTokenizer(tokenizer) {
196
+ return function setKey(keys) {
197
+ keys = _.isArray(keys) ? keys : [].slice.call(arguments, 0);
198
+ return function tokenize(o) {
199
+ var tokens = [];
200
+ _.each(keys, function(k) {
201
+ tokens = tokens.concat(tokenizer(_.toStr(o[k])));
202
+ });
203
+ return tokens;
204
+ };
205
+ };
206
+ }
207
+ }();
208
+ var LruCache = function() {
209
+ "use strict";
210
+ function LruCache(maxSize) {
211
+ this.maxSize = _.isNumber(maxSize) ? maxSize : 100;
212
+ this.reset();
213
+ if (this.maxSize <= 0) {
214
+ this.set = this.get = $.noop;
215
+ }
216
+ }
217
+ _.mixin(LruCache.prototype, {
218
+ set: function set(key, val) {
219
+ var tailItem = this.list.tail, node;
220
+ if (this.size >= this.maxSize) {
221
+ this.list.remove(tailItem);
222
+ delete this.hash[tailItem.key];
223
+ this.size--;
224
+ }
225
+ if (node = this.hash[key]) {
226
+ node.val = val;
227
+ this.list.moveToFront(node);
228
+ } else {
229
+ node = new Node(key, val);
230
+ this.list.add(node);
231
+ this.hash[key] = node;
232
+ this.size++;
233
+ }
234
+ },
235
+ get: function get(key) {
236
+ var node = this.hash[key];
237
+ if (node) {
238
+ this.list.moveToFront(node);
239
+ return node.val;
240
+ }
241
+ },
242
+ reset: function reset() {
243
+ this.size = 0;
244
+ this.hash = {};
245
+ this.list = new List();
246
+ }
247
+ });
248
+ function List() {
249
+ this.head = this.tail = null;
250
+ }
251
+ _.mixin(List.prototype, {
252
+ add: function add(node) {
253
+ if (this.head) {
254
+ node.next = this.head;
255
+ this.head.prev = node;
256
+ }
257
+ this.head = node;
258
+ this.tail = this.tail || node;
259
+ },
260
+ remove: function remove(node) {
261
+ node.prev ? node.prev.next = node.next : this.head = node.next;
262
+ node.next ? node.next.prev = node.prev : this.tail = node.prev;
263
+ },
264
+ moveToFront: function(node) {
265
+ this.remove(node);
266
+ this.add(node);
267
+ }
268
+ });
269
+ function Node(key, val) {
270
+ this.key = key;
271
+ this.val = val;
272
+ this.prev = this.next = null;
273
+ }
274
+ return LruCache;
275
+ }();
276
+ var PersistentStorage = function() {
277
+ "use strict";
278
+ var LOCAL_STORAGE;
279
+ try {
280
+ LOCAL_STORAGE = window.localStorage;
281
+ LOCAL_STORAGE.setItem("~~~", "!");
282
+ LOCAL_STORAGE.removeItem("~~~");
283
+ } catch (err) {
284
+ LOCAL_STORAGE = null;
285
+ }
286
+ function PersistentStorage(namespace, override) {
287
+ this.prefix = [ "__", namespace, "__" ].join("");
288
+ this.ttlKey = "__ttl__";
289
+ this.keyMatcher = new RegExp("^" + _.escapeRegExChars(this.prefix));
290
+ this.ls = override || LOCAL_STORAGE;
291
+ !this.ls && this._noop();
292
+ }
293
+ _.mixin(PersistentStorage.prototype, {
294
+ _prefix: function(key) {
295
+ return this.prefix + key;
296
+ },
297
+ _ttlKey: function(key) {
298
+ return this._prefix(key) + this.ttlKey;
299
+ },
300
+ _noop: function() {
301
+ this.get = this.set = this.remove = this.clear = this.isExpired = _.noop;
302
+ },
303
+ _safeSet: function(key, val) {
304
+ try {
305
+ this.ls.setItem(key, val);
306
+ } catch (err) {
307
+ if (err.name === "QuotaExceededError") {
308
+ this.clear();
309
+ this._noop();
310
+ }
311
+ }
312
+ },
313
+ get: function(key) {
314
+ if (this.isExpired(key)) {
315
+ this.remove(key);
316
+ }
317
+ return decode(this.ls.getItem(this._prefix(key)));
318
+ },
319
+ set: function(key, val, ttl) {
320
+ if (_.isNumber(ttl)) {
321
+ this._safeSet(this._ttlKey(key), encode(now() + ttl));
322
+ } else {
323
+ this.ls.removeItem(this._ttlKey(key));
324
+ }
325
+ return this._safeSet(this._prefix(key), encode(val));
326
+ },
327
+ remove: function(key) {
328
+ this.ls.removeItem(this._ttlKey(key));
329
+ this.ls.removeItem(this._prefix(key));
330
+ return this;
331
+ },
332
+ clear: function() {
333
+ var i, keys = gatherMatchingKeys(this.keyMatcher);
334
+ for (i = keys.length; i--; ) {
335
+ this.remove(keys[i]);
336
+ }
337
+ return this;
338
+ },
339
+ isExpired: function(key) {
340
+ var ttl = decode(this.ls.getItem(this._ttlKey(key)));
341
+ return _.isNumber(ttl) && now() > ttl ? true : false;
342
+ }
343
+ });
344
+ return PersistentStorage;
345
+ function now() {
346
+ return new Date().getTime();
347
+ }
348
+ function encode(val) {
349
+ return JSON.stringify(_.isUndefined(val) ? null : val);
350
+ }
351
+ function decode(val) {
352
+ return $.parseJSON(val);
353
+ }
354
+ function gatherMatchingKeys(keyMatcher) {
355
+ var i, key, keys = [], len = LOCAL_STORAGE.length;
356
+ for (i = 0; i < len; i++) {
357
+ if ((key = LOCAL_STORAGE.key(i)).match(keyMatcher)) {
358
+ keys.push(key.replace(keyMatcher, ""));
359
+ }
360
+ }
361
+ return keys;
362
+ }
363
+ }();
364
+ var Transport = function() {
365
+ "use strict";
366
+ var pendingRequestsCount = 0, pendingRequests = {}, sharedCache = new LruCache(10);
367
+ function Transport(o) {
368
+ o = o || {};
369
+ this.maxPendingRequests = o.maxPendingRequests || 6;
370
+ this.cancelled = false;
371
+ this.lastReq = null;
372
+ this._send = o.transport;
373
+ this._get = o.limiter ? o.limiter(this._get) : this._get;
374
+ this._cache = o.cache === false ? new LruCache(0) : sharedCache;
375
+ }
376
+ Transport.setMaxPendingRequests = function setMaxPendingRequests(num) {
377
+ this.maxPendingRequests = num;
378
+ };
379
+ Transport.resetCache = function resetCache() {
380
+ sharedCache.reset();
381
+ };
382
+ _.mixin(Transport.prototype, {
383
+ _fingerprint: function fingerprint(o) {
384
+ o = o || {};
385
+ return o.url + o.type + $.param(o.data || {});
386
+ },
387
+ _get: function(o, cb) {
388
+ var that = this, fingerprint, jqXhr;
389
+ fingerprint = this._fingerprint(o);
390
+ if (this.cancelled || fingerprint !== this.lastReq) {
391
+ return;
392
+ }
393
+ if (jqXhr = pendingRequests[fingerprint]) {
394
+ jqXhr.done(done).fail(fail);
395
+ } else if (pendingRequestsCount < this.maxPendingRequests) {
396
+ pendingRequestsCount++;
397
+ pendingRequests[fingerprint] = this._send(o).done(done).fail(fail).always(always);
398
+ } else {
399
+ this.onDeckRequestArgs = [].slice.call(arguments, 0);
400
+ }
401
+ function done(resp) {
402
+ cb(null, resp);
403
+ that._cache.set(fingerprint, resp);
404
+ }
405
+ function fail() {
406
+ cb(true);
407
+ }
408
+ function always() {
409
+ pendingRequestsCount--;
410
+ delete pendingRequests[fingerprint];
411
+ if (that.onDeckRequestArgs) {
412
+ that._get.apply(that, that.onDeckRequestArgs);
413
+ that.onDeckRequestArgs = null;
414
+ }
415
+ }
416
+ },
417
+ get: function(o, cb) {
418
+ var resp, fingerprint;
419
+ cb = cb || $.noop;
420
+ o = _.isString(o) ? {
421
+ url: o
422
+ } : o || {};
423
+ fingerprint = this._fingerprint(o);
424
+ this.cancelled = false;
425
+ this.lastReq = fingerprint;
426
+ if (resp = this._cache.get(fingerprint)) {
427
+ cb(null, resp);
428
+ } else {
429
+ this._get(o, cb);
430
+ }
431
+ },
432
+ cancel: function() {
433
+ this.cancelled = true;
434
+ }
435
+ });
436
+ return Transport;
437
+ }();
438
+ var SearchIndex = window.SearchIndex = function() {
439
+ "use strict";
440
+ var CHILDREN = "c", IDS = "i";
441
+ function SearchIndex(o) {
442
+ o = o || {};
443
+ if (!o.datumTokenizer || !o.queryTokenizer) {
444
+ $.error("datumTokenizer and queryTokenizer are both required");
445
+ }
446
+ this.identify = o.identify || _.stringify;
447
+ this.datumTokenizer = o.datumTokenizer;
448
+ this.queryTokenizer = o.queryTokenizer;
449
+ this.matchAnyQueryToken = o.matchAnyQueryToken;
450
+ this.reset();
451
+ }
452
+ _.mixin(SearchIndex.prototype, {
453
+ bootstrap: function bootstrap(o) {
454
+ this.datums = o.datums;
455
+ this.trie = o.trie;
456
+ },
457
+ add: function(data) {
458
+ var that = this;
459
+ data = _.isArray(data) ? data : [ data ];
460
+ _.each(data, function(datum) {
461
+ var id, tokens;
462
+ that.datums[id = that.identify(datum)] = datum;
463
+ tokens = normalizeTokens(that.datumTokenizer(datum));
464
+ _.each(tokens, function(token) {
465
+ var node, chars, ch;
466
+ node = that.trie;
467
+ chars = token.split("");
468
+ while (ch = chars.shift()) {
469
+ node = node[CHILDREN][ch] || (node[CHILDREN][ch] = newNode());
470
+ node[IDS].push(id);
471
+ }
472
+ });
473
+ });
474
+ },
475
+ get: function get(ids) {
476
+ var that = this;
477
+ return _.map(ids, function(id) {
478
+ return that.datums[id];
479
+ });
480
+ },
481
+ search: function search(query) {
482
+ var that = this, tokens, matches;
483
+ tokens = normalizeTokens(this.queryTokenizer(query));
484
+ _.each(tokens, function(token) {
485
+ var node, chars, ch, ids;
486
+ if (matches && matches.length === 0 && !that.matchAnyQueryToken) {
487
+ return false;
488
+ }
489
+ node = that.trie;
490
+ chars = token.split("");
491
+ while (node && (ch = chars.shift())) {
492
+ node = node[CHILDREN][ch];
493
+ }
494
+ if (node && chars.length === 0) {
495
+ ids = node[IDS].slice(0);
496
+ matches = matches ? getIntersection(matches, ids) : ids;
497
+ } else {
498
+ if (!that.matchAnyQueryToken) {
499
+ matches = [];
500
+ return false;
501
+ }
502
+ }
503
+ });
504
+ return matches ? _.map(unique(matches), function(id) {
505
+ return that.datums[id];
506
+ }) : [];
507
+ },
508
+ all: function all() {
509
+ var values = [];
510
+ for (var key in this.datums) {
511
+ values.push(this.datums[key]);
512
+ }
513
+ return values;
514
+ },
515
+ reset: function reset() {
516
+ this.datums = {};
517
+ this.trie = newNode();
518
+ },
519
+ serialize: function serialize() {
520
+ return {
521
+ datums: this.datums,
522
+ trie: this.trie
523
+ };
524
+ }
525
+ });
526
+ return SearchIndex;
527
+ function normalizeTokens(tokens) {
528
+ tokens = _.filter(tokens, function(token) {
529
+ return !!token;
530
+ });
531
+ tokens = _.map(tokens, function(token) {
532
+ return token.toLowerCase();
533
+ });
534
+ return tokens;
535
+ }
536
+ function newNode() {
537
+ var node = {};
538
+ node[IDS] = [];
539
+ node[CHILDREN] = {};
540
+ return node;
541
+ }
542
+ function unique(array) {
543
+ var seen = {}, uniques = [];
544
+ for (var i = 0, len = array.length; i < len; i++) {
545
+ if (!seen[array[i]]) {
546
+ seen[array[i]] = true;
547
+ uniques.push(array[i]);
548
+ }
549
+ }
550
+ return uniques;
551
+ }
552
+ function getIntersection(arrayA, arrayB) {
553
+ var ai = 0, bi = 0, intersection = [];
554
+ arrayA = arrayA.sort();
555
+ arrayB = arrayB.sort();
556
+ var lenArrayA = arrayA.length, lenArrayB = arrayB.length;
557
+ while (ai < lenArrayA && bi < lenArrayB) {
558
+ if (arrayA[ai] < arrayB[bi]) {
559
+ ai++;
560
+ } else if (arrayA[ai] > arrayB[bi]) {
561
+ bi++;
562
+ } else {
563
+ intersection.push(arrayA[ai]);
564
+ ai++;
565
+ bi++;
566
+ }
567
+ }
568
+ return intersection;
569
+ }
570
+ }();
571
+ var Prefetch = function() {
572
+ "use strict";
573
+ var keys;
574
+ keys = {
575
+ data: "data",
576
+ protocol: "protocol",
577
+ thumbprint: "thumbprint"
578
+ };
579
+ function Prefetch(o) {
580
+ this.url = o.url;
581
+ this.ttl = o.ttl;
582
+ this.cache = o.cache;
583
+ this.prepare = o.prepare;
584
+ this.transform = o.transform;
585
+ this.transport = o.transport;
586
+ this.thumbprint = o.thumbprint;
587
+ this.storage = new PersistentStorage(o.cacheKey);
588
+ }
589
+ _.mixin(Prefetch.prototype, {
590
+ _settings: function settings() {
591
+ return {
592
+ url: this.url,
593
+ type: "GET",
594
+ dataType: "json"
595
+ };
596
+ },
597
+ store: function store(data) {
598
+ if (!this.cache) {
599
+ return;
600
+ }
601
+ this.storage.set(keys.data, data, this.ttl);
602
+ this.storage.set(keys.protocol, location.protocol, this.ttl);
603
+ this.storage.set(keys.thumbprint, this.thumbprint, this.ttl);
604
+ },
605
+ fromCache: function fromCache() {
606
+ var stored = {}, isExpired;
607
+ if (!this.cache) {
608
+ return null;
609
+ }
610
+ stored.data = this.storage.get(keys.data);
611
+ stored.protocol = this.storage.get(keys.protocol);
612
+ stored.thumbprint = this.storage.get(keys.thumbprint);
613
+ isExpired = stored.thumbprint !== this.thumbprint || stored.protocol !== location.protocol;
614
+ return stored.data && !isExpired ? stored.data : null;
615
+ },
616
+ fromNetwork: function(cb) {
617
+ var that = this, settings;
618
+ if (!cb) {
619
+ return;
620
+ }
621
+ settings = this.prepare(this._settings());
622
+ this.transport(settings).fail(onError).done(onResponse);
623
+ function onError() {
624
+ cb(true);
625
+ }
626
+ function onResponse(resp) {
627
+ cb(null, that.transform(resp));
628
+ }
629
+ },
630
+ clear: function clear() {
631
+ this.storage.clear();
632
+ return this;
633
+ }
634
+ });
635
+ return Prefetch;
636
+ }();
637
+ var Remote = function() {
638
+ "use strict";
639
+ function Remote(o) {
640
+ this.url = o.url;
641
+ this.prepare = o.prepare;
642
+ this.transform = o.transform;
643
+ this.indexResponse = o.indexResponse;
644
+ this.transport = new Transport({
645
+ cache: o.cache,
646
+ limiter: o.limiter,
647
+ transport: o.transport,
648
+ maxPendingRequests: o.maxPendingRequests
649
+ });
650
+ }
651
+ _.mixin(Remote.prototype, {
652
+ _settings: function settings() {
653
+ return {
654
+ url: this.url,
655
+ type: "GET",
656
+ dataType: "json"
657
+ };
658
+ },
659
+ get: function get(query, cb) {
660
+ var that = this, settings;
661
+ if (!cb) {
662
+ return;
663
+ }
664
+ query = query || "";
665
+ settings = this.prepare(query, this._settings());
666
+ return this.transport.get(settings, onResponse);
667
+ function onResponse(err, resp) {
668
+ err ? cb([]) : cb(that.transform(resp));
669
+ }
670
+ },
671
+ cancelLastRequest: function cancelLastRequest() {
672
+ this.transport.cancel();
673
+ }
674
+ });
675
+ return Remote;
676
+ }();
677
+ var oParser = function() {
678
+ "use strict";
679
+ return function parse(o) {
680
+ var defaults, sorter;
681
+ defaults = {
682
+ initialize: true,
683
+ identify: _.stringify,
684
+ datumTokenizer: null,
685
+ queryTokenizer: null,
686
+ matchAnyQueryToken: false,
687
+ sufficient: 5,
688
+ indexRemote: false,
689
+ sorter: null,
690
+ local: [],
691
+ prefetch: null,
692
+ remote: null
693
+ };
694
+ o = _.mixin(defaults, o || {});
695
+ !o.datumTokenizer && $.error("datumTokenizer is required");
696
+ !o.queryTokenizer && $.error("queryTokenizer is required");
697
+ sorter = o.sorter;
698
+ o.sorter = sorter ? function(x) {
699
+ return x.sort(sorter);
700
+ } : _.identity;
701
+ o.local = _.isFunction(o.local) ? o.local() : o.local;
702
+ o.prefetch = parsePrefetch(o.prefetch);
703
+ o.remote = parseRemote(o.remote);
704
+ return o;
705
+ };
706
+ function parsePrefetch(o) {
707
+ var defaults;
708
+ if (!o) {
709
+ return null;
710
+ }
711
+ defaults = {
712
+ url: null,
713
+ ttl: 24 * 60 * 60 * 1e3,
714
+ cache: true,
715
+ cacheKey: null,
716
+ thumbprint: "",
717
+ prepare: _.identity,
718
+ transform: _.identity,
719
+ transport: null
720
+ };
721
+ o = _.isString(o) ? {
722
+ url: o
723
+ } : o;
724
+ o = _.mixin(defaults, o);
725
+ !o.url && $.error("prefetch requires url to be set");
726
+ o.transform = o.filter || o.transform;
727
+ o.cacheKey = o.cacheKey || o.url;
728
+ o.thumbprint = VERSION + o.thumbprint;
729
+ o.transport = o.transport ? callbackToDeferred(o.transport) : $.ajax;
730
+ return o;
731
+ }
732
+ function parseRemote(o) {
733
+ var defaults;
734
+ if (!o) {
735
+ return;
736
+ }
737
+ defaults = {
738
+ url: null,
739
+ cache: true,
740
+ prepare: null,
741
+ replace: null,
742
+ wildcard: null,
743
+ limiter: null,
744
+ rateLimitBy: "debounce",
745
+ rateLimitWait: 300,
746
+ transform: _.identity,
747
+ transport: null
748
+ };
749
+ o = _.isString(o) ? {
750
+ url: o
751
+ } : o;
752
+ o = _.mixin(defaults, o);
753
+ !o.url && $.error("remote requires url to be set");
754
+ o.transform = o.filter || o.transform;
755
+ o.prepare = toRemotePrepare(o);
756
+ o.limiter = toLimiter(o);
757
+ o.transport = o.transport ? callbackToDeferred(o.transport) : $.ajax;
758
+ delete o.replace;
759
+ delete o.wildcard;
760
+ delete o.rateLimitBy;
761
+ delete o.rateLimitWait;
762
+ return o;
763
+ }
764
+ function toRemotePrepare(o) {
765
+ var prepare, replace, wildcard;
766
+ prepare = o.prepare;
767
+ replace = o.replace;
768
+ wildcard = o.wildcard;
769
+ if (prepare) {
770
+ return prepare;
771
+ }
772
+ if (replace) {
773
+ prepare = prepareByReplace;
774
+ } else if (o.wildcard) {
775
+ prepare = prepareByWildcard;
776
+ } else {
777
+ prepare = identityPrepare;
778
+ }
779
+ return prepare;
780
+ function prepareByReplace(query, settings) {
781
+ settings.url = replace(settings.url, query);
782
+ return settings;
783
+ }
784
+ function prepareByWildcard(query, settings) {
785
+ settings.url = settings.url.replace(wildcard, encodeURIComponent(query));
786
+ return settings;
787
+ }
788
+ function identityPrepare(query, settings) {
789
+ return settings;
790
+ }
791
+ }
792
+ function toLimiter(o) {
793
+ var limiter, method, wait;
794
+ limiter = o.limiter;
795
+ method = o.rateLimitBy;
796
+ wait = o.rateLimitWait;
797
+ if (!limiter) {
798
+ limiter = /^throttle$/i.test(method) ? throttle(wait) : debounce(wait);
799
+ }
800
+ return limiter;
801
+ function debounce(wait) {
802
+ return function debounce(fn) {
803
+ return _.debounce(fn, wait);
804
+ };
805
+ }
806
+ function throttle(wait) {
807
+ return function throttle(fn) {
808
+ return _.throttle(fn, wait);
809
+ };
810
+ }
811
+ }
812
+ function callbackToDeferred(fn) {
813
+ return function wrapper(o) {
814
+ var deferred = $.Deferred();
815
+ fn(o, onSuccess, onError);
816
+ return deferred;
817
+ function onSuccess(resp) {
818
+ _.defer(function() {
819
+ deferred.resolve(resp);
820
+ });
821
+ }
822
+ function onError(err) {
823
+ _.defer(function() {
824
+ deferred.reject(err);
825
+ });
826
+ }
827
+ };
828
+ }
829
+ }();
830
+ var Bloodhound = function() {
831
+ "use strict";
832
+ var old;
833
+ old = window && window.Bloodhound;
834
+ function Bloodhound(o) {
835
+ o = oParser(o);
836
+ this.sorter = o.sorter;
837
+ this.identify = o.identify;
838
+ this.sufficient = o.sufficient;
839
+ this.indexRemote = o.indexRemote;
840
+ this.local = o.local;
841
+ this.remote = o.remote ? new Remote(o.remote) : null;
842
+ this.prefetch = o.prefetch ? new Prefetch(o.prefetch) : null;
843
+ this.index = new SearchIndex({
844
+ identify: this.identify,
845
+ datumTokenizer: o.datumTokenizer,
846
+ queryTokenizer: o.queryTokenizer
847
+ });
848
+ o.initialize !== false && this.initialize();
849
+ }
850
+ Bloodhound.noConflict = function noConflict() {
851
+ window && (window.Bloodhound = old);
852
+ return Bloodhound;
853
+ };
854
+ Bloodhound.tokenizers = tokenizers;
855
+ _.mixin(Bloodhound.prototype, {
856
+ __ttAdapter: function ttAdapter() {
857
+ var that = this;
858
+ return this.remote ? withAsync : withoutAsync;
859
+ function withAsync(query, sync, async) {
860
+ return that.search(query, sync, async);
861
+ }
862
+ function withoutAsync(query, sync) {
863
+ return that.search(query, sync);
864
+ }
865
+ },
866
+ _loadPrefetch: function loadPrefetch() {
867
+ var that = this, deferred, serialized;
868
+ deferred = $.Deferred();
869
+ if (!this.prefetch) {
870
+ deferred.resolve();
871
+ } else if (serialized = this.prefetch.fromCache()) {
872
+ this.index.bootstrap(serialized);
873
+ deferred.resolve();
874
+ } else {
875
+ this.prefetch.fromNetwork(done);
876
+ }
877
+ return deferred.promise();
878
+ function done(err, data) {
879
+ if (err) {
880
+ return deferred.reject();
881
+ }
882
+ that.add(data);
883
+ that.prefetch.store(that.index.serialize());
884
+ deferred.resolve();
885
+ }
886
+ },
887
+ _initialize: function initialize() {
888
+ var that = this, deferred;
889
+ this.clear();
890
+ (this.initPromise = this._loadPrefetch()).done(addLocalToIndex);
891
+ return this.initPromise;
892
+ function addLocalToIndex() {
893
+ that.add(that.local);
894
+ }
895
+ },
896
+ initialize: function initialize(force) {
897
+ return !this.initPromise || force ? this._initialize() : this.initPromise;
898
+ },
899
+ add: function add(data) {
900
+ this.index.add(data);
901
+ return this;
902
+ },
903
+ get: function get(ids) {
904
+ ids = _.isArray(ids) ? ids : [].slice.call(arguments);
905
+ return this.index.get(ids);
906
+ },
907
+ search: function search(query, sync, async) {
908
+ var that = this, local;
909
+ sync = sync || _.noop;
910
+ async = async || _.noop;
911
+ local = this.sorter(this.index.search(query));
912
+ sync(this.remote ? local.slice() : local);
913
+ if (this.remote && local.length < this.sufficient) {
914
+ this.remote.get(query, processRemote);
915
+ } else if (this.remote) {
916
+ this.remote.cancelLastRequest();
917
+ }
918
+ return this;
919
+ function processRemote(remote) {
920
+ var nonDuplicates = [];
921
+ _.each(remote, function(r) {
922
+ !_.some(local, function(l) {
923
+ return that.identify(r) === that.identify(l);
924
+ }) && nonDuplicates.push(r);
925
+ });
926
+ that.indexRemote && that.add(nonDuplicates);
927
+ async(nonDuplicates);
928
+ }
929
+ },
930
+ all: function all() {
931
+ return this.index.all();
932
+ },
933
+ clear: function clear() {
934
+ this.index.reset();
935
+ return this;
936
+ },
937
+ clearPrefetchCache: function clearPrefetchCache() {
938
+ this.prefetch && this.prefetch.clear();
939
+ return this;
940
+ },
941
+ clearRemoteCache: function clearRemoteCache() {
942
+ Transport.resetCache();
943
+ return this;
944
+ },
945
+ ttAdapter: function ttAdapter() {
946
+ return this.__ttAdapter();
947
+ }
948
+ });
949
+ return Bloodhound;
950
+ }();
951
+ return Bloodhound;
952
+ });
953
+
954
+ (function(root, factory) {
955
+ if (typeof define === "function" && define.amd) {
956
+ define([ "jquery" ], function(a0) {
957
+ return factory(a0);
958
+ });
959
+ } else if (typeof exports === "object") {
960
+ module.exports = factory(require("jquery"));
961
+ } else {
962
+ factory(root["jQuery"]);
963
+ }
964
+ })(this, function($) {
965
+ var _ = function() {
966
+ "use strict";
967
+ return {
968
+ isMsie: function() {
969
+ return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false;
970
+ },
971
+ isBlankString: function(str) {
972
+ return !str || /^\s*$/.test(str);
973
+ },
974
+ escapeRegExChars: function(str) {
975
+ return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
976
+ },
977
+ isString: function(obj) {
978
+ return typeof obj === "string";
979
+ },
980
+ isNumber: function(obj) {
981
+ return typeof obj === "number";
982
+ },
983
+ isArray: $.isArray,
984
+ isFunction: $.isFunction,
985
+ isObject: $.isPlainObject,
986
+ isUndefined: function(obj) {
987
+ return typeof obj === "undefined";
988
+ },
989
+ isElement: function(obj) {
990
+ return !!(obj && obj.nodeType === 1);
991
+ },
992
+ isJQuery: function(obj) {
993
+ return obj instanceof $;
994
+ },
995
+ toStr: function toStr(s) {
996
+ return _.isUndefined(s) || s === null ? "" : s + "";
997
+ },
998
+ bind: $.proxy,
999
+ each: function(collection, cb) {
1000
+ $.each(collection, reverseArgs);
1001
+ function reverseArgs(index, value) {
1002
+ return cb(value, index);
1003
+ }
1004
+ },
1005
+ map: $.map,
1006
+ filter: $.grep,
1007
+ every: function(obj, test) {
1008
+ var result = true;
1009
+ if (!obj) {
1010
+ return result;
1011
+ }
1012
+ $.each(obj, function(key, val) {
1013
+ if (!(result = test.call(null, val, key, obj))) {
1014
+ return false;
1015
+ }
1016
+ });
1017
+ return !!result;
1018
+ },
1019
+ some: function(obj, test) {
1020
+ var result = false;
1021
+ if (!obj) {
1022
+ return result;
1023
+ }
1024
+ $.each(obj, function(key, val) {
1025
+ if (result = test.call(null, val, key, obj)) {
1026
+ return false;
1027
+ }
1028
+ });
1029
+ return !!result;
1030
+ },
1031
+ mixin: $.extend,
1032
+ identity: function(x) {
1033
+ return x;
1034
+ },
1035
+ clone: function(obj) {
1036
+ return $.extend(true, {}, obj);
1037
+ },
1038
+ getIdGenerator: function() {
1039
+ var counter = 0;
1040
+ return function() {
1041
+ return counter++;
1042
+ };
1043
+ },
1044
+ templatify: function templatify(obj) {
1045
+ return $.isFunction(obj) ? obj : template;
1046
+ function template() {
1047
+ return String(obj);
1048
+ }
1049
+ },
1050
+ defer: function(fn) {
1051
+ setTimeout(fn, 0);
1052
+ },
1053
+ debounce: function(func, wait, immediate) {
1054
+ var timeout, result;
1055
+ return function() {
1056
+ var context = this, args = arguments, later, callNow;
1057
+ later = function() {
1058
+ timeout = null;
1059
+ if (!immediate) {
1060
+ result = func.apply(context, args);
1061
+ }
1062
+ };
1063
+ callNow = immediate && !timeout;
1064
+ clearTimeout(timeout);
1065
+ timeout = setTimeout(later, wait);
1066
+ if (callNow) {
1067
+ result = func.apply(context, args);
1068
+ }
1069
+ return result;
1070
+ };
1071
+ },
1072
+ throttle: function(func, wait) {
1073
+ var context, args, timeout, result, previous, later;
1074
+ previous = 0;
1075
+ later = function() {
1076
+ previous = new Date();
1077
+ timeout = null;
1078
+ result = func.apply(context, args);
1079
+ };
1080
+ return function() {
1081
+ var now = new Date(), remaining = wait - (now - previous);
1082
+ context = this;
1083
+ args = arguments;
1084
+ if (remaining <= 0) {
1085
+ clearTimeout(timeout);
1086
+ timeout = null;
1087
+ previous = now;
1088
+ result = func.apply(context, args);
1089
+ } else if (!timeout) {
1090
+ timeout = setTimeout(later, remaining);
1091
+ }
1092
+ return result;
1093
+ };
1094
+ },
1095
+ stringify: function(val) {
1096
+ return _.isString(val) ? val : JSON.stringify(val);
1097
+ },
1098
+ guid: function() {
1099
+ function _p8(s) {
1100
+ var p = (Math.random().toString(16) + "000000000").substr(2, 8);
1101
+ return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p;
1102
+ }
1103
+ return "tt-" + _p8() + _p8(true) + _p8(true) + _p8();
1104
+ },
1105
+ noop: function() {}
1106
+ };
1107
+ }();
1108
+ var WWW = function() {
1109
+ "use strict";
1110
+ var defaultClassNames = {
1111
+ wrapper: "twitter-typeahead",
1112
+ input: "tt-input",
1113
+ hint: "tt-hint",
1114
+ menu: "tt-menu",
1115
+ dataset: "tt-dataset",
1116
+ suggestion: "tt-suggestion",
1117
+ selectable: "tt-selectable",
1118
+ empty: "tt-empty",
1119
+ open: "tt-open",
1120
+ cursor: "tt-cursor",
1121
+ highlight: "tt-highlight"
1122
+ };
1123
+ return build;
1124
+ function build(o) {
1125
+ var www, classes;
1126
+ classes = _.mixin({}, defaultClassNames, o);
1127
+ www = {
1128
+ css: buildCss(),
1129
+ classes: classes,
1130
+ html: buildHtml(classes),
1131
+ selectors: buildSelectors(classes)
1132
+ };
1133
+ return {
1134
+ css: www.css,
1135
+ html: www.html,
1136
+ classes: www.classes,
1137
+ selectors: www.selectors,
1138
+ mixin: function(o) {
1139
+ _.mixin(o, www);
1140
+ }
1141
+ };
1142
+ }
1143
+ function buildHtml(c) {
1144
+ return {
1145
+ wrapper: '<span class="' + c.wrapper + '"></span>',
1146
+ menu: '<div role="listbox" class="' + c.menu + '"></div>'
1147
+ };
1148
+ }
1149
+ function buildSelectors(classes) {
1150
+ var selectors = {};
1151
+ _.each(classes, function(v, k) {
1152
+ selectors[k] = "." + v;
1153
+ });
1154
+ return selectors;
1155
+ }
1156
+ function buildCss() {
1157
+ var css = {
1158
+ wrapper: {
1159
+ position: "relative",
1160
+ display: "inline-block"
1161
+ },
1162
+ hint: {
1163
+ position: "absolute",
1164
+ top: "0",
1165
+ left: "0",
1166
+ borderColor: "transparent",
1167
+ boxShadow: "none",
1168
+ opacity: "1"
1169
+ },
1170
+ input: {
1171
+ position: "relative",
1172
+ verticalAlign: "top",
1173
+ backgroundColor: "transparent"
1174
+ },
1175
+ inputWithNoHint: {
1176
+ position: "relative",
1177
+ verticalAlign: "top"
1178
+ },
1179
+ menu: {
1180
+ position: "absolute",
1181
+ top: "100%",
1182
+ left: "0",
1183
+ zIndex: "100",
1184
+ display: "none"
1185
+ },
1186
+ ltr: {
1187
+ left: "0",
1188
+ right: "auto"
1189
+ },
1190
+ rtl: {
1191
+ left: "auto",
1192
+ right: " 0"
1193
+ }
1194
+ };
1195
+ if (_.isMsie()) {
1196
+ _.mixin(css.input, {
1197
+ backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"
1198
+ });
1199
+ }
1200
+ return css;
1201
+ }
1202
+ }();
1203
+ var EventBus = function() {
1204
+ "use strict";
1205
+ var namespace, deprecationMap;
1206
+ namespace = "typeahead:";
1207
+ deprecationMap = {
1208
+ render: "rendered",
1209
+ cursorchange: "cursorchanged",
1210
+ select: "selected",
1211
+ autocomplete: "autocompleted"
1212
+ };
1213
+ function EventBus(o) {
1214
+ if (!o || !o.el) {
1215
+ $.error("EventBus initialized without el");
1216
+ }
1217
+ this.$el = $(o.el);
1218
+ }
1219
+ _.mixin(EventBus.prototype, {
1220
+ _trigger: function(type, args) {
1221
+ var $e = $.Event(namespace + type);
1222
+ this.$el.trigger.call(this.$el, $e, args || []);
1223
+ return $e;
1224
+ },
1225
+ before: function(type) {
1226
+ var args, $e;
1227
+ args = [].slice.call(arguments, 1);
1228
+ $e = this._trigger("before" + type, args);
1229
+ return $e.isDefaultPrevented();
1230
+ },
1231
+ trigger: function(type) {
1232
+ var deprecatedType;
1233
+ this._trigger(type, [].slice.call(arguments, 1));
1234
+ if (deprecatedType = deprecationMap[type]) {
1235
+ this._trigger(deprecatedType, [].slice.call(arguments, 1));
1236
+ }
1237
+ }
1238
+ });
1239
+ return EventBus;
1240
+ }();
1241
+ var EventEmitter = function() {
1242
+ "use strict";
1243
+ var splitter = /\s+/, nextTick = getNextTick();
1244
+ return {
1245
+ onSync: onSync,
1246
+ onAsync: onAsync,
1247
+ off: off,
1248
+ trigger: trigger
1249
+ };
1250
+ function on(method, types, cb, context) {
1251
+ var type;
1252
+ if (!cb) {
1253
+ return this;
1254
+ }
1255
+ types = types.split(splitter);
1256
+ cb = context ? bindContext(cb, context) : cb;
1257
+ this._callbacks = this._callbacks || {};
1258
+ while (type = types.shift()) {
1259
+ this._callbacks[type] = this._callbacks[type] || {
1260
+ sync: [],
1261
+ async: []
1262
+ };
1263
+ this._callbacks[type][method].push(cb);
1264
+ }
1265
+ return this;
1266
+ }
1267
+ function onAsync(types, cb, context) {
1268
+ return on.call(this, "async", types, cb, context);
1269
+ }
1270
+ function onSync(types, cb, context) {
1271
+ return on.call(this, "sync", types, cb, context);
1272
+ }
1273
+ function off(types) {
1274
+ var type;
1275
+ if (!this._callbacks) {
1276
+ return this;
1277
+ }
1278
+ types = types.split(splitter);
1279
+ while (type = types.shift()) {
1280
+ delete this._callbacks[type];
1281
+ }
1282
+ return this;
1283
+ }
1284
+ function trigger(types) {
1285
+ var type, callbacks, args, syncFlush, asyncFlush;
1286
+ if (!this._callbacks) {
1287
+ return this;
1288
+ }
1289
+ types = types.split(splitter);
1290
+ args = [].slice.call(arguments, 1);
1291
+ while ((type = types.shift()) && (callbacks = this._callbacks[type])) {
1292
+ syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args));
1293
+ asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args));
1294
+ syncFlush() && nextTick(asyncFlush);
1295
+ }
1296
+ return this;
1297
+ }
1298
+ function getFlush(callbacks, context, args) {
1299
+ return flush;
1300
+ function flush() {
1301
+ var cancelled;
1302
+ for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) {
1303
+ cancelled = callbacks[i].apply(context, args) === false;
1304
+ }
1305
+ return !cancelled;
1306
+ }
1307
+ }
1308
+ function getNextTick() {
1309
+ var nextTickFn;
1310
+ if (window.setImmediate) {
1311
+ nextTickFn = function nextTickSetImmediate(fn) {
1312
+ setImmediate(function() {
1313
+ fn();
1314
+ });
1315
+ };
1316
+ } else {
1317
+ nextTickFn = function nextTickSetTimeout(fn) {
1318
+ setTimeout(function() {
1319
+ fn();
1320
+ }, 0);
1321
+ };
1322
+ }
1323
+ return nextTickFn;
1324
+ }
1325
+ function bindContext(fn, context) {
1326
+ return fn.bind ? fn.bind(context) : function() {
1327
+ fn.apply(context, [].slice.call(arguments, 0));
1328
+ };
1329
+ }
1330
+ }();
1331
+ var highlight = function(doc) {
1332
+ "use strict";
1333
+ var defaults = {
1334
+ node: null,
1335
+ pattern: null,
1336
+ tagName: "strong",
1337
+ className: null,
1338
+ wordsOnly: false,
1339
+ caseSensitive: false,
1340
+ diacriticInsensitive: false
1341
+ };
1342
+ var accented = {
1343
+ A: "[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]",
1344
+ B: "[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]",
1345
+ C: "[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]",
1346
+ D: "[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]",
1347
+ E: "[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]",
1348
+ F: "[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]",
1349
+ G: "[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]",
1350
+ H: "[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]",
1351
+ I: "[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]",
1352
+ J: "[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]",
1353
+ K: "[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]",
1354
+ L: "[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]",
1355
+ M: "[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]",
1356
+ N: "[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]",
1357
+ O: "[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]",
1358
+ P: "[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]",
1359
+ Q: "[Qqℚ⒬Ⓠⓠ㏃Qq]",
1360
+ R: "[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]",
1361
+ S: "[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]",
1362
+ T: "[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]",
1363
+ U: "[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]",
1364
+ V: "[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]",
1365
+ W: "[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]",
1366
+ X: "[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]",
1367
+ Y: "[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]",
1368
+ Z: "[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]"
1369
+ };
1370
+ return function hightlight(o) {
1371
+ var regex;
1372
+ o = _.mixin({}, defaults, o);
1373
+ if (!o.node || !o.pattern) {
1374
+ return;
1375
+ }
1376
+ o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ];
1377
+ regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly, o.diacriticInsensitive);
1378
+ traverse(o.node, hightlightTextNode);
1379
+ function hightlightTextNode(textNode) {
1380
+ var match, patternNode, wrapperNode;
1381
+ if (match = regex.exec(textNode.data)) {
1382
+ wrapperNode = doc.createElement(o.tagName);
1383
+ o.className && (wrapperNode.className = o.className);
1384
+ patternNode = textNode.splitText(match.index);
1385
+ patternNode.splitText(match[0].length);
1386
+ wrapperNode.appendChild(patternNode.cloneNode(true));
1387
+ textNode.parentNode.replaceChild(wrapperNode, patternNode);
1388
+ }
1389
+ return !!match;
1390
+ }
1391
+ function traverse(el, hightlightTextNode) {
1392
+ var childNode, TEXT_NODE_TYPE = 3;
1393
+ for (var i = 0; i < el.childNodes.length; i++) {
1394
+ childNode = el.childNodes[i];
1395
+ if (childNode.nodeType === TEXT_NODE_TYPE) {
1396
+ i += hightlightTextNode(childNode) ? 1 : 0;
1397
+ } else {
1398
+ traverse(childNode, hightlightTextNode);
1399
+ }
1400
+ }
1401
+ }
1402
+ };
1403
+ function accent_replacer(chr) {
1404
+ return accented[chr.toUpperCase()] || chr;
1405
+ }
1406
+ function getRegex(patterns, caseSensitive, wordsOnly, diacriticInsensitive) {
1407
+ var escapedPatterns = [], regexStr;
1408
+ for (var i = 0, len = patterns.length; i < len; i++) {
1409
+ var escapedWord = _.escapeRegExChars(patterns[i]);
1410
+ if (diacriticInsensitive) {
1411
+ escapedWord = escapedWord.replace(/\S/g, accent_replacer);
1412
+ }
1413
+ escapedPatterns.push(escapedWord);
1414
+ }
1415
+ regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")";
1416
+ return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i");
1417
+ }
1418
+ }(window.document);
1419
+ var Input = function() {
1420
+ "use strict";
1421
+ var specialKeyCodeMap;
1422
+ specialKeyCodeMap = {
1423
+ 9: "tab",
1424
+ 27: "esc",
1425
+ 37: "left",
1426
+ 39: "right",
1427
+ 13: "enter",
1428
+ 38: "up",
1429
+ 40: "down"
1430
+ };
1431
+ function Input(o, www) {
1432
+ o = o || {};
1433
+ if (!o.input) {
1434
+ $.error("input is missing");
1435
+ }
1436
+ www.mixin(this);
1437
+ this.$hint = $(o.hint);
1438
+ this.$input = $(o.input);
1439
+ this.$input.attr({
1440
+ "aria-activedescendant": "",
1441
+ "aria-owns": this.$input.attr("id") + "_listbox",
1442
+ role: "combobox",
1443
+ "aria-readonly": "true",
1444
+ "aria-autocomplete": "list"
1445
+ });
1446
+ $(www.menu).attr("id", this.$input.attr("id") + "_listbox");
1447
+ this.query = this.$input.val();
1448
+ this.queryWhenFocused = this.hasFocus() ? this.query : null;
1449
+ this.$overflowHelper = buildOverflowHelper(this.$input);
1450
+ this._checkLanguageDirection();
1451
+ if (this.$hint.length === 0) {
1452
+ this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop;
1453
+ }
1454
+ this.onSync("cursorchange", this._updateDescendent);
1455
+ }
1456
+ Input.normalizeQuery = function(str) {
1457
+ return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " ");
1458
+ };
1459
+ _.mixin(Input.prototype, EventEmitter, {
1460
+ _onBlur: function onBlur() {
1461
+ this.resetInputValue();
1462
+ this.trigger("blurred");
1463
+ },
1464
+ _onFocus: function onFocus() {
1465
+ this.queryWhenFocused = this.query;
1466
+ this.trigger("focused");
1467
+ },
1468
+ _onKeydown: function onKeydown($e) {
1469
+ var keyName = specialKeyCodeMap[$e.which || $e.keyCode];
1470
+ this._managePreventDefault(keyName, $e);
1471
+ if (keyName && this._shouldTrigger(keyName, $e)) {
1472
+ this.trigger(keyName + "Keyed", $e);
1473
+ }
1474
+ },
1475
+ _onInput: function onInput() {
1476
+ this._setQuery(this.getInputValue());
1477
+ this.clearHintIfInvalid();
1478
+ this._checkLanguageDirection();
1479
+ },
1480
+ _managePreventDefault: function managePreventDefault(keyName, $e) {
1481
+ var preventDefault;
1482
+ switch (keyName) {
1483
+ case "up":
1484
+ case "down":
1485
+ preventDefault = !withModifier($e);
1486
+ break;
1487
+
1488
+ default:
1489
+ preventDefault = false;
1490
+ }
1491
+ preventDefault && $e.preventDefault();
1492
+ },
1493
+ _shouldTrigger: function shouldTrigger(keyName, $e) {
1494
+ var trigger;
1495
+ switch (keyName) {
1496
+ case "tab":
1497
+ trigger = !withModifier($e);
1498
+ break;
1499
+
1500
+ default:
1501
+ trigger = true;
1502
+ }
1503
+ return trigger;
1504
+ },
1505
+ _checkLanguageDirection: function checkLanguageDirection() {
1506
+ var dir = (this.$input.css("direction") || "ltr").toLowerCase();
1507
+ if (this.dir !== dir) {
1508
+ this.dir = dir;
1509
+ this.$hint.attr("dir", dir);
1510
+ this.trigger("langDirChanged", dir);
1511
+ }
1512
+ },
1513
+ _setQuery: function setQuery(val, silent) {
1514
+ var areEquivalent, hasDifferentWhitespace;
1515
+ areEquivalent = areQueriesEquivalent(val, this.query);
1516
+ hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false;
1517
+ this.query = val;
1518
+ if (!silent && !areEquivalent) {
1519
+ this.trigger("queryChanged", this.query);
1520
+ } else if (!silent && hasDifferentWhitespace) {
1521
+ this.trigger("whitespaceChanged", this.query);
1522
+ }
1523
+ },
1524
+ _updateDescendent: function updateDescendent(event, id) {
1525
+ this.$input.attr("aria-activedescendant", id);
1526
+ },
1527
+ bind: function() {
1528
+ var that = this, onBlur, onFocus, onKeydown, onInput;
1529
+ onBlur = _.bind(this._onBlur, this);
1530
+ onFocus = _.bind(this._onFocus, this);
1531
+ onKeydown = _.bind(this._onKeydown, this);
1532
+ onInput = _.bind(this._onInput, this);
1533
+ this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown);
1534
+ if (!_.isMsie() || _.isMsie() > 9) {
1535
+ this.$input.on("input.tt", onInput);
1536
+ } else {
1537
+ this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) {
1538
+ if (specialKeyCodeMap[$e.which || $e.keyCode]) {
1539
+ return;
1540
+ }
1541
+ _.defer(_.bind(that._onInput, that, $e));
1542
+ });
1543
+ }
1544
+ return this;
1545
+ },
1546
+ focus: function focus() {
1547
+ this.$input.focus();
1548
+ },
1549
+ blur: function blur() {
1550
+ this.$input.blur();
1551
+ },
1552
+ getLangDir: function getLangDir() {
1553
+ return this.dir;
1554
+ },
1555
+ getQuery: function getQuery() {
1556
+ return this.query || "";
1557
+ },
1558
+ setQuery: function setQuery(val, silent) {
1559
+ this.setInputValue(val);
1560
+ this._setQuery(val, silent);
1561
+ },
1562
+ hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() {
1563
+ return this.query !== this.queryWhenFocused;
1564
+ },
1565
+ getInputValue: function getInputValue() {
1566
+ return this.$input.val();
1567
+ },
1568
+ setInputValue: function setInputValue(value) {
1569
+ this.$input.val(value);
1570
+ this.clearHintIfInvalid();
1571
+ this._checkLanguageDirection();
1572
+ },
1573
+ resetInputValue: function resetInputValue() {
1574
+ this.setInputValue(this.query);
1575
+ },
1576
+ getHint: function getHint() {
1577
+ return this.$hint.val();
1578
+ },
1579
+ setHint: function setHint(value) {
1580
+ this.$hint.val(value);
1581
+ },
1582
+ clearHint: function clearHint() {
1583
+ this.setHint("");
1584
+ },
1585
+ clearHintIfInvalid: function clearHintIfInvalid() {
1586
+ var val, hint, valIsPrefixOfHint, isValid;
1587
+ val = this.getInputValue();
1588
+ hint = this.getHint();
1589
+ valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0;
1590
+ isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow();
1591
+ !isValid && this.clearHint();
1592
+ },
1593
+ hasFocus: function hasFocus() {
1594
+ return this.$input.is(":focus");
1595
+ },
1596
+ hasOverflow: function hasOverflow() {
1597
+ var constraint = this.$input.width() - 2;
1598
+ this.$overflowHelper.text(this.getInputValue());
1599
+ return this.$overflowHelper.width() >= constraint;
1600
+ },
1601
+ isCursorAtEnd: function() {
1602
+ var valueLength, selectionStart, range;
1603
+ valueLength = this.$input.val().length;
1604
+ selectionStart = this.$input[0].selectionStart;
1605
+ if (_.isNumber(selectionStart)) {
1606
+ return selectionStart === valueLength;
1607
+ } else if (document.selection) {
1608
+ range = document.selection.createRange();
1609
+ range.moveStart("character", -valueLength);
1610
+ return valueLength === range.text.length;
1611
+ }
1612
+ return true;
1613
+ },
1614
+ destroy: function destroy() {
1615
+ this.$hint.off(".tt");
1616
+ this.$input.off(".tt");
1617
+ this.$overflowHelper.remove();
1618
+ this.$hint = this.$input = this.$overflowHelper = $("<div>");
1619
+ }
1620
+ });
1621
+ return Input;
1622
+ function buildOverflowHelper($input) {
1623
+ return $('<pre aria-hidden="true"></pre>').css({
1624
+ position: "absolute",
1625
+ visibility: "hidden",
1626
+ whiteSpace: "pre",
1627
+ fontFamily: $input.css("font-family"),
1628
+ fontSize: $input.css("font-size"),
1629
+ fontStyle: $input.css("font-style"),
1630
+ fontVariant: $input.css("font-variant"),
1631
+ fontWeight: $input.css("font-weight"),
1632
+ wordSpacing: $input.css("word-spacing"),
1633
+ letterSpacing: $input.css("letter-spacing"),
1634
+ textIndent: $input.css("text-indent"),
1635
+ textRendering: $input.css("text-rendering"),
1636
+ textTransform: $input.css("text-transform")
1637
+ }).insertAfter($input);
1638
+ }
1639
+ function areQueriesEquivalent(a, b) {
1640
+ return Input.normalizeQuery(a) === Input.normalizeQuery(b);
1641
+ }
1642
+ function withModifier($e) {
1643
+ return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey;
1644
+ }
1645
+ }();
1646
+ var Dataset = function() {
1647
+ "use strict";
1648
+ var keys, nameGenerator;
1649
+ keys = {
1650
+ dataset: "tt-selectable-dataset",
1651
+ val: "tt-selectable-display",
1652
+ obj: "tt-selectable-object"
1653
+ };
1654
+ nameGenerator = _.getIdGenerator();
1655
+ function Dataset(o, www) {
1656
+ o = o || {};
1657
+ o.templates = o.templates || {};
1658
+ o.templates.notFound = o.templates.notFound || o.templates.empty;
1659
+ if (!o.source) {
1660
+ $.error("missing source");
1661
+ }
1662
+ if (!o.node) {
1663
+ $.error("missing node");
1664
+ }
1665
+ if (o.name && !isValidName(o.name)) {
1666
+ $.error("invalid dataset name: " + o.name);
1667
+ }
1668
+ www.mixin(this);
1669
+ this.highlight = !!o.highlight;
1670
+ this.name = _.toStr(o.name || nameGenerator());
1671
+ this.limit = o.limit || 5;
1672
+ this.displayFn = getDisplayFn(o.display || o.displayKey);
1673
+ this.templates = getTemplates(o.templates, this.displayFn);
1674
+ this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source;
1675
+ this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async;
1676
+ this._resetLastSuggestion();
1677
+ this.$el = $(o.node).attr("role", "presentation").addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name);
1678
+ }
1679
+ Dataset.extractData = function extractData(el) {
1680
+ var $el = $(el);
1681
+ if ($el.data(keys.obj)) {
1682
+ return {
1683
+ dataset: $el.data(keys.dataset) || "",
1684
+ val: $el.data(keys.val) || "",
1685
+ obj: $el.data(keys.obj) || null
1686
+ };
1687
+ }
1688
+ return null;
1689
+ };
1690
+ _.mixin(Dataset.prototype, EventEmitter, {
1691
+ _overwrite: function overwrite(query, suggestions) {
1692
+ suggestions = suggestions || [];
1693
+ if (suggestions.length) {
1694
+ this._renderSuggestions(query, suggestions);
1695
+ } else if (this.async && this.templates.pending) {
1696
+ this._renderPending(query);
1697
+ } else if (!this.async && this.templates.notFound) {
1698
+ this._renderNotFound(query);
1699
+ } else {
1700
+ this._empty();
1701
+ }
1702
+ this.trigger("rendered", suggestions, false, this.name);
1703
+ },
1704
+ _append: function append(query, suggestions) {
1705
+ suggestions = suggestions || [];
1706
+ if (suggestions.length && this.$lastSuggestion.length) {
1707
+ this._appendSuggestions(query, suggestions);
1708
+ } else if (suggestions.length) {
1709
+ this._renderSuggestions(query, suggestions);
1710
+ } else if (!this.$lastSuggestion.length && this.templates.notFound) {
1711
+ this._renderNotFound(query);
1712
+ }
1713
+ this.trigger("rendered", suggestions, true, this.name);
1714
+ },
1715
+ _renderSuggestions: function renderSuggestions(query, suggestions) {
1716
+ var $fragment;
1717
+ $fragment = this._getSuggestionsFragment(query, suggestions);
1718
+ this.$lastSuggestion = $fragment.children().last();
1719
+ this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions));
1720
+ },
1721
+ _appendSuggestions: function appendSuggestions(query, suggestions) {
1722
+ var $fragment, $lastSuggestion;
1723
+ $fragment = this._getSuggestionsFragment(query, suggestions);
1724
+ $lastSuggestion = $fragment.children().last();
1725
+ this.$lastSuggestion.after($fragment);
1726
+ this.$lastSuggestion = $lastSuggestion;
1727
+ },
1728
+ _renderPending: function renderPending(query) {
1729
+ var template = this.templates.pending;
1730
+ this._resetLastSuggestion();
1731
+ template && this.$el.html(template({
1732
+ query: query,
1733
+ dataset: this.name
1734
+ }));
1735
+ },
1736
+ _renderNotFound: function renderNotFound(query) {
1737
+ var template = this.templates.notFound;
1738
+ this._resetLastSuggestion();
1739
+ template && this.$el.html(template({
1740
+ query: query,
1741
+ dataset: this.name
1742
+ }));
1743
+ },
1744
+ _empty: function empty() {
1745
+ this.$el.empty();
1746
+ this._resetLastSuggestion();
1747
+ },
1748
+ _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) {
1749
+ var that = this, fragment;
1750
+ fragment = document.createDocumentFragment();
1751
+ _.each(suggestions, function getSuggestionNode(suggestion) {
1752
+ var $el, context;
1753
+ context = that._injectQuery(query, suggestion);
1754
+ $el = $(that.templates.suggestion(context)).data(keys.dataset, that.name).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable);
1755
+ fragment.appendChild($el[0]);
1756
+ });
1757
+ this.highlight && highlight({
1758
+ className: this.classes.highlight,
1759
+ node: fragment,
1760
+ pattern: query
1761
+ });
1762
+ return $(fragment);
1763
+ },
1764
+ _getFooter: function getFooter(query, suggestions) {
1765
+ return this.templates.footer ? this.templates.footer({
1766
+ query: query,
1767
+ suggestions: suggestions,
1768
+ dataset: this.name
1769
+ }) : null;
1770
+ },
1771
+ _getHeader: function getHeader(query, suggestions) {
1772
+ return this.templates.header ? this.templates.header({
1773
+ query: query,
1774
+ suggestions: suggestions,
1775
+ dataset: this.name
1776
+ }) : null;
1777
+ },
1778
+ _resetLastSuggestion: function resetLastSuggestion() {
1779
+ this.$lastSuggestion = $();
1780
+ },
1781
+ _injectQuery: function injectQuery(query, obj) {
1782
+ return _.isObject(obj) ? _.mixin({
1783
+ _query: query
1784
+ }, obj) : obj;
1785
+ },
1786
+ update: function update(query) {
1787
+ var that = this, canceled = false, syncCalled = false, rendered = 0;
1788
+ this.cancel();
1789
+ this.cancel = function cancel() {
1790
+ canceled = true;
1791
+ that.cancel = $.noop;
1792
+ that.async && that.trigger("asyncCanceled", query, that.name);
1793
+ };
1794
+ this.source(query, sync, async);
1795
+ !syncCalled && sync([]);
1796
+ function sync(suggestions) {
1797
+ if (syncCalled) {
1798
+ return;
1799
+ }
1800
+ syncCalled = true;
1801
+ suggestions = (suggestions || []).slice(0, that.limit);
1802
+ rendered = suggestions.length;
1803
+ that._overwrite(query, suggestions);
1804
+ if (rendered < that.limit && that.async) {
1805
+ that.trigger("asyncRequested", query, that.name);
1806
+ }
1807
+ }
1808
+ function async(suggestions) {
1809
+ suggestions = suggestions || [];
1810
+ if (!canceled && rendered < that.limit) {
1811
+ that.cancel = $.noop;
1812
+ var idx = Math.abs(rendered - that.limit);
1813
+ rendered += idx;
1814
+ that._append(query, suggestions.slice(0, idx));
1815
+ that.async && that.trigger("asyncReceived", query, that.name);
1816
+ }
1817
+ }
1818
+ },
1819
+ cancel: $.noop,
1820
+ clear: function clear() {
1821
+ this._empty();
1822
+ this.cancel();
1823
+ this.trigger("cleared");
1824
+ },
1825
+ isEmpty: function isEmpty() {
1826
+ return this.$el.is(":empty");
1827
+ },
1828
+ destroy: function destroy() {
1829
+ this.$el = $("<div>");
1830
+ }
1831
+ });
1832
+ return Dataset;
1833
+ function getDisplayFn(display) {
1834
+ display = display || _.stringify;
1835
+ return _.isFunction(display) ? display : displayFn;
1836
+ function displayFn(obj) {
1837
+ return obj[display];
1838
+ }
1839
+ }
1840
+ function getTemplates(templates, displayFn) {
1841
+ return {
1842
+ notFound: templates.notFound && _.templatify(templates.notFound),
1843
+ pending: templates.pending && _.templatify(templates.pending),
1844
+ header: templates.header && _.templatify(templates.header),
1845
+ footer: templates.footer && _.templatify(templates.footer),
1846
+ suggestion: templates.suggestion || suggestionTemplate
1847
+ };
1848
+ function suggestionTemplate(context) {
1849
+ return $('<div role="option">').attr("id", _.guid()).text(displayFn(context));
1850
+ }
1851
+ }
1852
+ function isValidName(str) {
1853
+ return /^[_a-zA-Z0-9-]+$/.test(str);
1854
+ }
1855
+ }();
1856
+ var Menu = function() {
1857
+ "use strict";
1858
+ function Menu(o, www) {
1859
+ var that = this;
1860
+ o = o || {};
1861
+ if (!o.node) {
1862
+ $.error("node is required");
1863
+ }
1864
+ www.mixin(this);
1865
+ this.$node = $(o.node);
1866
+ this.query = null;
1867
+ this.datasets = _.map(o.datasets, initializeDataset);
1868
+ function initializeDataset(oDataset) {
1869
+ var node = that.$node.find(oDataset.node).first();
1870
+ oDataset.node = node.length ? node : $("<div>").appendTo(that.$node);
1871
+ return new Dataset(oDataset, www);
1872
+ }
1873
+ }
1874
+ _.mixin(Menu.prototype, EventEmitter, {
1875
+ _onSelectableClick: function onSelectableClick($e) {
1876
+ this.trigger("selectableClicked", $($e.currentTarget));
1877
+ },
1878
+ _onRendered: function onRendered(type, dataset, suggestions, async) {
1879
+ this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty());
1880
+ this.trigger("datasetRendered", dataset, suggestions, async);
1881
+ },
1882
+ _onCleared: function onCleared() {
1883
+ this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty());
1884
+ this.trigger("datasetCleared");
1885
+ },
1886
+ _propagate: function propagate() {
1887
+ this.trigger.apply(this, arguments);
1888
+ },
1889
+ _allDatasetsEmpty: function allDatasetsEmpty() {
1890
+ return _.every(this.datasets, _.bind(function isDatasetEmpty(dataset) {
1891
+ var isEmpty = dataset.isEmpty();
1892
+ this.$node.attr("aria-expanded", !isEmpty);
1893
+ return isEmpty;
1894
+ }, this));
1895
+ },
1896
+ _getSelectables: function getSelectables() {
1897
+ return this.$node.find(this.selectors.selectable);
1898
+ },
1899
+ _removeCursor: function _removeCursor() {
1900
+ var $selectable = this.getActiveSelectable();
1901
+ $selectable && $selectable.removeClass(this.classes.cursor);
1902
+ },
1903
+ _ensureVisible: function ensureVisible($el) {
1904
+ var elTop, elBottom, nodeScrollTop, nodeHeight;
1905
+ elTop = $el.position().top;
1906
+ elBottom = elTop + $el.outerHeight(true);
1907
+ nodeScrollTop = this.$node.scrollTop();
1908
+ nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10);
1909
+ if (elTop < 0) {
1910
+ this.$node.scrollTop(nodeScrollTop + elTop);
1911
+ } else if (nodeHeight < elBottom) {
1912
+ this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight));
1913
+ }
1914
+ },
1915
+ bind: function() {
1916
+ var that = this, onSelectableClick;
1917
+ onSelectableClick = _.bind(this._onSelectableClick, this);
1918
+ this.$node.on("click.tt", this.selectors.selectable, onSelectableClick);
1919
+ this.$node.on("mouseover", this.selectors.selectable, function() {
1920
+ that.setCursor($(this));
1921
+ });
1922
+ this.$node.on("mouseleave", function() {
1923
+ that._removeCursor();
1924
+ });
1925
+ _.each(this.datasets, function(dataset) {
1926
+ dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that);
1927
+ });
1928
+ return this;
1929
+ },
1930
+ isOpen: function isOpen() {
1931
+ return this.$node.hasClass(this.classes.open);
1932
+ },
1933
+ open: function open() {
1934
+ this.$node.scrollTop(0);
1935
+ this.$node.addClass(this.classes.open);
1936
+ },
1937
+ close: function close() {
1938
+ this.$node.attr("aria-expanded", false);
1939
+ this.$node.removeClass(this.classes.open);
1940
+ this._removeCursor();
1941
+ },
1942
+ setLanguageDirection: function setLanguageDirection(dir) {
1943
+ this.$node.attr("dir", dir);
1944
+ },
1945
+ selectableRelativeToCursor: function selectableRelativeToCursor(delta) {
1946
+ var $selectables, $oldCursor, oldIndex, newIndex;
1947
+ $oldCursor = this.getActiveSelectable();
1948
+ $selectables = this._getSelectables();
1949
+ oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1;
1950
+ newIndex = oldIndex + delta;
1951
+ newIndex = (newIndex + 1) % ($selectables.length + 1) - 1;
1952
+ newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex;
1953
+ return newIndex === -1 ? null : $selectables.eq(newIndex);
1954
+ },
1955
+ setCursor: function setCursor($selectable) {
1956
+ this._removeCursor();
1957
+ if ($selectable = $selectable && $selectable.first()) {
1958
+ $selectable.addClass(this.classes.cursor);
1959
+ this._ensureVisible($selectable);
1960
+ }
1961
+ },
1962
+ getSelectableData: function getSelectableData($el) {
1963
+ return $el && $el.length ? Dataset.extractData($el) : null;
1964
+ },
1965
+ getActiveSelectable: function getActiveSelectable() {
1966
+ var $selectable = this._getSelectables().filter(this.selectors.cursor).first();
1967
+ return $selectable.length ? $selectable : null;
1968
+ },
1969
+ getTopSelectable: function getTopSelectable() {
1970
+ var $selectable = this._getSelectables().first();
1971
+ return $selectable.length ? $selectable : null;
1972
+ },
1973
+ update: function update(query) {
1974
+ var isValidUpdate = query !== this.query;
1975
+ if (isValidUpdate) {
1976
+ this.query = query;
1977
+ _.each(this.datasets, updateDataset);
1978
+ }
1979
+ return isValidUpdate;
1980
+ function updateDataset(dataset) {
1981
+ dataset.update(query);
1982
+ }
1983
+ },
1984
+ empty: function empty() {
1985
+ _.each(this.datasets, clearDataset);
1986
+ this.query = null;
1987
+ this.$node.addClass(this.classes.empty);
1988
+ function clearDataset(dataset) {
1989
+ dataset.clear();
1990
+ }
1991
+ },
1992
+ destroy: function destroy() {
1993
+ this.$node.off(".tt");
1994
+ this.$node = $("<div>");
1995
+ _.each(this.datasets, destroyDataset);
1996
+ function destroyDataset(dataset) {
1997
+ dataset.destroy();
1998
+ }
1999
+ }
2000
+ });
2001
+ return Menu;
2002
+ }();
2003
+ var Status = function() {
2004
+ "use strict";
2005
+ function Status(options) {
2006
+ this.$el = $("<span></span>", {
2007
+ role: "status",
2008
+ "aria-live": "polite"
2009
+ }).css({
2010
+ position: "absolute",
2011
+ padding: "0",
2012
+ border: "0",
2013
+ height: "1px",
2014
+ width: "1px",
2015
+ "margin-bottom": "-1px",
2016
+ "margin-right": "-1px",
2017
+ overflow: "hidden",
2018
+ clip: "rect(0 0 0 0)",
2019
+ "white-space": "nowrap"
2020
+ });
2021
+ options.$input.after(this.$el);
2022
+ _.each(options.menu.datasets, _.bind(function(dataset) {
2023
+ if (dataset.onSync) {
2024
+ dataset.onSync("rendered", _.bind(this.update, this));
2025
+ dataset.onSync("cleared", _.bind(this.cleared, this));
2026
+ }
2027
+ }, this));
2028
+ }
2029
+ _.mixin(Status.prototype, {
2030
+ update: function update(event, suggestions) {
2031
+ var length = suggestions.length;
2032
+ var words;
2033
+ if (length === 1) {
2034
+ words = {
2035
+ result: "result",
2036
+ is: "is"
2037
+ };
2038
+ } else {
2039
+ words = {
2040
+ result: "results",
2041
+ is: "are"
2042
+ };
2043
+ }
2044
+ this.$el.text(length + " " + words.result + " " + words.is + " available, use up and down arrow keys to navigate.");
2045
+ },
2046
+ cleared: function() {
2047
+ this.$el.text("");
2048
+ }
2049
+ });
2050
+ return Status;
2051
+ }();
2052
+ var DefaultMenu = function() {
2053
+ "use strict";
2054
+ var s = Menu.prototype;
2055
+ function DefaultMenu() {
2056
+ Menu.apply(this, [].slice.call(arguments, 0));
2057
+ }
2058
+ _.mixin(DefaultMenu.prototype, Menu.prototype, {
2059
+ open: function open() {
2060
+ !this._allDatasetsEmpty() && this._show();
2061
+ return s.open.apply(this, [].slice.call(arguments, 0));
2062
+ },
2063
+ close: function close() {
2064
+ this._hide();
2065
+ return s.close.apply(this, [].slice.call(arguments, 0));
2066
+ },
2067
+ _onRendered: function onRendered() {
2068
+ if (this._allDatasetsEmpty()) {
2069
+ this._hide();
2070
+ } else {
2071
+ this.isOpen() && this._show();
2072
+ }
2073
+ return s._onRendered.apply(this, [].slice.call(arguments, 0));
2074
+ },
2075
+ _onCleared: function onCleared() {
2076
+ if (this._allDatasetsEmpty()) {
2077
+ this._hide();
2078
+ } else {
2079
+ this.isOpen() && this._show();
2080
+ }
2081
+ return s._onCleared.apply(this, [].slice.call(arguments, 0));
2082
+ },
2083
+ setLanguageDirection: function setLanguageDirection(dir) {
2084
+ this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl);
2085
+ return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0));
2086
+ },
2087
+ _hide: function hide() {
2088
+ this.$node.hide();
2089
+ },
2090
+ _show: function show() {
2091
+ this.$node.css("display", "block");
2092
+ }
2093
+ });
2094
+ return DefaultMenu;
2095
+ }();
2096
+ var Typeahead = function() {
2097
+ "use strict";
2098
+ function Typeahead(o, www) {
2099
+ var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged;
2100
+ o = o || {};
2101
+ if (!o.input) {
2102
+ $.error("missing input");
2103
+ }
2104
+ if (!o.menu) {
2105
+ $.error("missing menu");
2106
+ }
2107
+ if (!o.eventBus) {
2108
+ $.error("missing event bus");
2109
+ }
2110
+ www.mixin(this);
2111
+ this.eventBus = o.eventBus;
2112
+ this.minLength = _.isNumber(o.minLength) ? o.minLength : 1;
2113
+ this.input = o.input;
2114
+ this.menu = o.menu;
2115
+ this.enabled = true;
2116
+ this.autoselect = !!o.autoselect;
2117
+ this.active = false;
2118
+ this.input.hasFocus() && this.activate();
2119
+ this.dir = this.input.getLangDir();
2120
+ this._hacks();
2121
+ this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this);
2122
+ onFocused = c(this, "activate", "open", "_onFocused");
2123
+ onBlurred = c(this, "deactivate", "_onBlurred");
2124
+ onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed");
2125
+ onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed");
2126
+ onEscKeyed = c(this, "isActive", "_onEscKeyed");
2127
+ onUpKeyed = c(this, "isActive", "open", "_onUpKeyed");
2128
+ onDownKeyed = c(this, "isActive", "open", "_onDownKeyed");
2129
+ onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed");
2130
+ onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed");
2131
+ onQueryChanged = c(this, "_openIfActive", "_onQueryChanged");
2132
+ onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged");
2133
+ this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this);
2134
+ }
2135
+ _.mixin(Typeahead.prototype, {
2136
+ _hacks: function hacks() {
2137
+ var $input, $menu;
2138
+ $input = this.input.$input || $("<div>");
2139
+ $menu = this.menu.$node || $("<div>");
2140
+ $input.on("blur.tt", function($e) {
2141
+ var active, isActive, hasActive;
2142
+ active = document.activeElement;
2143
+ isActive = $menu.is(active);
2144
+ hasActive = $menu.has(active).length > 0;
2145
+ if (_.isMsie() && (isActive || hasActive)) {
2146
+ $e.preventDefault();
2147
+ $e.stopImmediatePropagation();
2148
+ _.defer(function() {
2149
+ $input.focus();
2150
+ });
2151
+ }
2152
+ });
2153
+ $menu.on("mousedown.tt", function($e) {
2154
+ $e.preventDefault();
2155
+ });
2156
+ },
2157
+ _onSelectableClicked: function onSelectableClicked(type, $el) {
2158
+ this.select($el);
2159
+ },
2160
+ _onDatasetCleared: function onDatasetCleared() {
2161
+ this._updateHint();
2162
+ },
2163
+ _onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) {
2164
+ this._updateHint();
2165
+ if (this.autoselect) {
2166
+ var cursorClass = this.selectors.cursor.substr(1);
2167
+ this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass);
2168
+ }
2169
+ this.eventBus.trigger("render", suggestions, async, dataset);
2170
+ },
2171
+ _onAsyncRequested: function onAsyncRequested(type, dataset, query) {
2172
+ this.eventBus.trigger("asyncrequest", query, dataset);
2173
+ },
2174
+ _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) {
2175
+ this.eventBus.trigger("asynccancel", query, dataset);
2176
+ },
2177
+ _onAsyncReceived: function onAsyncReceived(type, dataset, query) {
2178
+ this.eventBus.trigger("asyncreceive", query, dataset);
2179
+ },
2180
+ _onFocused: function onFocused() {
2181
+ this._minLengthMet() && this.menu.update(this.input.getQuery());
2182
+ },
2183
+ _onBlurred: function onBlurred() {
2184
+ if (this.input.hasQueryChangedSinceLastFocus()) {
2185
+ this.eventBus.trigger("change", this.input.getQuery());
2186
+ }
2187
+ },
2188
+ _onEnterKeyed: function onEnterKeyed(type, $e) {
2189
+ var $selectable;
2190
+ if ($selectable = this.menu.getActiveSelectable()) {
2191
+ if (this.select($selectable)) {
2192
+ $e.preventDefault();
2193
+ $e.stopPropagation();
2194
+ }
2195
+ } else if (this.autoselect) {
2196
+ if (this.select(this.menu.getTopSelectable())) {
2197
+ $e.preventDefault();
2198
+ $e.stopPropagation();
2199
+ }
2200
+ }
2201
+ },
2202
+ _onTabKeyed: function onTabKeyed(type, $e) {
2203
+ var $selectable;
2204
+ if ($selectable = this.menu.getActiveSelectable()) {
2205
+ this.select($selectable) && $e.preventDefault();
2206
+ } else if ($selectable = this.menu.getTopSelectable()) {
2207
+ this.autocomplete($selectable) && $e.preventDefault();
2208
+ }
2209
+ },
2210
+ _onEscKeyed: function onEscKeyed() {
2211
+ this.close();
2212
+ },
2213
+ _onUpKeyed: function onUpKeyed() {
2214
+ this.moveCursor(-1);
2215
+ },
2216
+ _onDownKeyed: function onDownKeyed() {
2217
+ this.moveCursor(+1);
2218
+ },
2219
+ _onLeftKeyed: function onLeftKeyed() {
2220
+ if (this.dir === "rtl" && this.input.isCursorAtEnd()) {
2221
+ this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable());
2222
+ }
2223
+ },
2224
+ _onRightKeyed: function onRightKeyed() {
2225
+ if (this.dir === "ltr" && this.input.isCursorAtEnd()) {
2226
+ this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable());
2227
+ }
2228
+ },
2229
+ _onQueryChanged: function onQueryChanged(e, query) {
2230
+ this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty();
2231
+ },
2232
+ _onWhitespaceChanged: function onWhitespaceChanged() {
2233
+ this._updateHint();
2234
+ },
2235
+ _onLangDirChanged: function onLangDirChanged(e, dir) {
2236
+ if (this.dir !== dir) {
2237
+ this.dir = dir;
2238
+ this.menu.setLanguageDirection(dir);
2239
+ }
2240
+ },
2241
+ _openIfActive: function openIfActive() {
2242
+ this.isActive() && this.open();
2243
+ },
2244
+ _minLengthMet: function minLengthMet(query) {
2245
+ query = _.isString(query) ? query : this.input.getQuery() || "";
2246
+ return query.length >= this.minLength;
2247
+ },
2248
+ _updateHint: function updateHint() {
2249
+ var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match;
2250
+ $selectable = this.menu.getTopSelectable();
2251
+ data = this.menu.getSelectableData($selectable);
2252
+ val = this.input.getInputValue();
2253
+ if (data && !_.isBlankString(val) && !this.input.hasOverflow()) {
2254
+ query = Input.normalizeQuery(val);
2255
+ escapedQuery = _.escapeRegExChars(query);
2256
+ frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i");
2257
+ match = frontMatchRegEx.exec(data.val);
2258
+ match && this.input.setHint(val + match[1]);
2259
+ } else {
2260
+ this.input.clearHint();
2261
+ }
2262
+ },
2263
+ isEnabled: function isEnabled() {
2264
+ return this.enabled;
2265
+ },
2266
+ enable: function enable() {
2267
+ this.enabled = true;
2268
+ },
2269
+ disable: function disable() {
2270
+ this.enabled = false;
2271
+ },
2272
+ isActive: function isActive() {
2273
+ return this.active;
2274
+ },
2275
+ activate: function activate() {
2276
+ if (this.isActive()) {
2277
+ return true;
2278
+ } else if (!this.isEnabled() || this.eventBus.before("active")) {
2279
+ return false;
2280
+ } else {
2281
+ this.active = true;
2282
+ this.eventBus.trigger("active");
2283
+ return true;
2284
+ }
2285
+ },
2286
+ deactivate: function deactivate() {
2287
+ if (!this.isActive()) {
2288
+ return true;
2289
+ } else if (this.eventBus.before("idle")) {
2290
+ return false;
2291
+ } else {
2292
+ this.active = false;
2293
+ this.close();
2294
+ this.eventBus.trigger("idle");
2295
+ return true;
2296
+ }
2297
+ },
2298
+ isOpen: function isOpen() {
2299
+ return this.menu.isOpen();
2300
+ },
2301
+ open: function open() {
2302
+ if (!this.isOpen() && !this.eventBus.before("open")) {
2303
+ this.menu.open();
2304
+ this._updateHint();
2305
+ this.eventBus.trigger("open");
2306
+ }
2307
+ return this.isOpen();
2308
+ },
2309
+ close: function close() {
2310
+ if (this.isOpen() && !this.eventBus.before("close")) {
2311
+ this.menu.close();
2312
+ this.input.clearHint();
2313
+ this.input.resetInputValue();
2314
+ this.eventBus.trigger("close");
2315
+ }
2316
+ return !this.isOpen();
2317
+ },
2318
+ setVal: function setVal(val) {
2319
+ this.input.setQuery(_.toStr(val));
2320
+ },
2321
+ getVal: function getVal() {
2322
+ return this.input.getQuery();
2323
+ },
2324
+ select: function select($selectable) {
2325
+ var data = this.menu.getSelectableData($selectable);
2326
+ if (data && !this.eventBus.before("select", data.obj, data.dataset)) {
2327
+ this.input.setQuery(data.val, true);
2328
+ this.eventBus.trigger("select", data.obj, data.dataset);
2329
+ this.close();
2330
+ return true;
2331
+ }
2332
+ return false;
2333
+ },
2334
+ autocomplete: function autocomplete($selectable) {
2335
+ var query, data, isValid;
2336
+ query = this.input.getQuery();
2337
+ data = this.menu.getSelectableData($selectable);
2338
+ isValid = data && query !== data.val;
2339
+ if (isValid && !this.eventBus.before("autocomplete", data.obj, data.dataset)) {
2340
+ this.input.setQuery(data.val);
2341
+ this.eventBus.trigger("autocomplete", data.obj, data.dataset);
2342
+ return true;
2343
+ }
2344
+ return false;
2345
+ },
2346
+ moveCursor: function moveCursor(delta) {
2347
+ var query, $candidate, data, suggestion, datasetName, cancelMove, id;
2348
+ query = this.input.getQuery();
2349
+ $candidate = this.menu.selectableRelativeToCursor(delta);
2350
+ data = this.menu.getSelectableData($candidate);
2351
+ suggestion = data ? data.obj : null;
2352
+ datasetName = data ? data.dataset : null;
2353
+ id = $candidate ? $candidate.attr("id") : null;
2354
+ this.input.trigger("cursorchange", id);
2355
+ cancelMove = this._minLengthMet() && this.menu.update(query);
2356
+ if (!cancelMove && !this.eventBus.before("cursorchange", suggestion, datasetName)) {
2357
+ this.menu.setCursor($candidate);
2358
+ if (data) {
2359
+ this.input.setInputValue(data.val);
2360
+ } else {
2361
+ this.input.resetInputValue();
2362
+ this._updateHint();
2363
+ }
2364
+ this.eventBus.trigger("cursorchange", suggestion, datasetName);
2365
+ return true;
2366
+ }
2367
+ return false;
2368
+ },
2369
+ destroy: function destroy() {
2370
+ this.input.destroy();
2371
+ this.menu.destroy();
2372
+ }
2373
+ });
2374
+ return Typeahead;
2375
+ function c(ctx) {
2376
+ var methods = [].slice.call(arguments, 1);
2377
+ return function() {
2378
+ var args = [].slice.call(arguments);
2379
+ _.each(methods, function(method) {
2380
+ return ctx[method].apply(ctx, args);
2381
+ });
2382
+ };
2383
+ }
2384
+ }();
2385
+ (function() {
2386
+ "use strict";
2387
+ var old, keys, methods;
2388
+ old = $.fn.typeahead;
2389
+ keys = {
2390
+ www: "tt-www",
2391
+ attrs: "tt-attrs",
2392
+ typeahead: "tt-typeahead"
2393
+ };
2394
+ methods = {
2395
+ initialize: function initialize(o, datasets) {
2396
+ var www;
2397
+ datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1);
2398
+ o = o || {};
2399
+ www = WWW(o.classNames);
2400
+ return this.each(attach);
2401
+ function attach() {
2402
+ var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor;
2403
+ _.each(datasets, function(d) {
2404
+ d.highlight = !!o.highlight;
2405
+ });
2406
+ $input = $(this);
2407
+ $wrapper = $(www.html.wrapper);
2408
+ $hint = $elOrNull(o.hint);
2409
+ $menu = $elOrNull(o.menu);
2410
+ defaultHint = o.hint !== false && !$hint;
2411
+ defaultMenu = o.menu !== false && !$menu;
2412
+ defaultHint && ($hint = buildHintFromInput($input, www));
2413
+ defaultMenu && ($menu = $(www.html.menu).css(www.css.menu));
2414
+ $hint && $hint.val("");
2415
+ $input = prepInput($input, www);
2416
+ if (defaultHint || defaultMenu) {
2417
+ $wrapper.css(www.css.wrapper);
2418
+ $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint);
2419
+ $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null);
2420
+ }
2421
+ MenuConstructor = defaultMenu ? DefaultMenu : Menu;
2422
+ eventBus = new EventBus({
2423
+ el: $input
2424
+ });
2425
+ input = new Input({
2426
+ hint: $hint,
2427
+ input: $input
2428
+ }, www);
2429
+ menu = new MenuConstructor({
2430
+ node: $menu,
2431
+ datasets: datasets
2432
+ }, www);
2433
+ status = new Status({
2434
+ $input: $input,
2435
+ menu: menu
2436
+ });
2437
+ typeahead = new Typeahead({
2438
+ input: input,
2439
+ menu: menu,
2440
+ eventBus: eventBus,
2441
+ minLength: o.minLength,
2442
+ autoselect: o.autoselect
2443
+ }, www);
2444
+ $input.data(keys.www, www);
2445
+ $input.data(keys.typeahead, typeahead);
2446
+ }
2447
+ },
2448
+ isEnabled: function isEnabled() {
2449
+ var enabled;
2450
+ ttEach(this.first(), function(t) {
2451
+ enabled = t.isEnabled();
2452
+ });
2453
+ return enabled;
2454
+ },
2455
+ enable: function enable() {
2456
+ ttEach(this, function(t) {
2457
+ t.enable();
2458
+ });
2459
+ return this;
2460
+ },
2461
+ disable: function disable() {
2462
+ ttEach(this, function(t) {
2463
+ t.disable();
2464
+ });
2465
+ return this;
2466
+ },
2467
+ isActive: function isActive() {
2468
+ var active;
2469
+ ttEach(this.first(), function(t) {
2470
+ active = t.isActive();
2471
+ });
2472
+ return active;
2473
+ },
2474
+ activate: function activate() {
2475
+ ttEach(this, function(t) {
2476
+ t.activate();
2477
+ });
2478
+ return this;
2479
+ },
2480
+ deactivate: function deactivate() {
2481
+ ttEach(this, function(t) {
2482
+ t.deactivate();
2483
+ });
2484
+ return this;
2485
+ },
2486
+ isOpen: function isOpen() {
2487
+ var open;
2488
+ ttEach(this.first(), function(t) {
2489
+ open = t.isOpen();
2490
+ });
2491
+ return open;
2492
+ },
2493
+ open: function open() {
2494
+ ttEach(this, function(t) {
2495
+ t.open();
2496
+ });
2497
+ return this;
2498
+ },
2499
+ close: function close() {
2500
+ ttEach(this, function(t) {
2501
+ t.close();
2502
+ });
2503
+ return this;
2504
+ },
2505
+ select: function select(el) {
2506
+ var success = false, $el = $(el);
2507
+ ttEach(this.first(), function(t) {
2508
+ success = t.select($el);
2509
+ });
2510
+ return success;
2511
+ },
2512
+ autocomplete: function autocomplete(el) {
2513
+ var success = false, $el = $(el);
2514
+ ttEach(this.first(), function(t) {
2515
+ success = t.autocomplete($el);
2516
+ });
2517
+ return success;
2518
+ },
2519
+ moveCursor: function moveCursoe(delta) {
2520
+ var success = false;
2521
+ ttEach(this.first(), function(t) {
2522
+ success = t.moveCursor(delta);
2523
+ });
2524
+ return success;
2525
+ },
2526
+ val: function val(newVal) {
2527
+ var query;
2528
+ if (!arguments.length) {
2529
+ ttEach(this.first(), function(t) {
2530
+ query = t.getVal();
2531
+ });
2532
+ return query;
2533
+ } else {
2534
+ ttEach(this, function(t) {
2535
+ t.setVal(_.toStr(newVal));
2536
+ });
2537
+ return this;
2538
+ }
2539
+ },
2540
+ destroy: function destroy() {
2541
+ ttEach(this, function(typeahead, $input) {
2542
+ revert($input);
2543
+ typeahead.destroy();
2544
+ });
2545
+ return this;
2546
+ }
2547
+ };
2548
+ $.fn.typeahead = function(method) {
2549
+ if (methods[method]) {
2550
+ return methods[method].apply(this, [].slice.call(arguments, 1));
2551
+ } else {
2552
+ return methods.initialize.apply(this, arguments);
2553
+ }
2554
+ };
2555
+ $.fn.typeahead.noConflict = function noConflict() {
2556
+ $.fn.typeahead = old;
2557
+ return this;
2558
+ };
2559
+ function ttEach($els, fn) {
2560
+ $els.each(function() {
2561
+ var $input = $(this), typeahead;
2562
+ (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input);
2563
+ });
2564
+ }
2565
+ function buildHintFromInput($input, www) {
2566
+ return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({
2567
+ readonly: true,
2568
+ required: false
2569
+ }).removeAttr("id name placeholder").removeClass("required").attr({
2570
+ spellcheck: "false",
2571
+ tabindex: -1
2572
+ });
2573
+ }
2574
+ function prepInput($input, www) {
2575
+ $input.data(keys.attrs, {
2576
+ dir: $input.attr("dir"),
2577
+ autocomplete: $input.attr("autocomplete"),
2578
+ spellcheck: $input.attr("spellcheck"),
2579
+ style: $input.attr("style")
2580
+ });
2581
+ $input.addClass(www.classes.input).attr({
2582
+ spellcheck: false
2583
+ });
2584
+ try {
2585
+ !$input.attr("dir") && $input.attr("dir", "auto");
2586
+ } catch (e) {}
2587
+ return $input;
2588
+ }
2589
+ function getBackgroundStyles($el) {
2590
+ return {
2591
+ backgroundAttachment: $el.css("background-attachment"),
2592
+ backgroundClip: $el.css("background-clip"),
2593
+ backgroundColor: $el.css("background-color"),
2594
+ backgroundImage: $el.css("background-image"),
2595
+ backgroundOrigin: $el.css("background-origin"),
2596
+ backgroundPosition: $el.css("background-position"),
2597
+ backgroundRepeat: $el.css("background-repeat"),
2598
+ backgroundSize: $el.css("background-size")
2599
+ };
2600
+ }
2601
+ function revert($input) {
2602
+ var www, $wrapper;
2603
+ www = $input.data(keys.www);
2604
+ $wrapper = $input.parent().filter(www.selectors.wrapper);
2605
+ _.each($input.data(keys.attrs), function(val, key) {
2606
+ _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val);
2607
+ });
2608
+ $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input);
2609
+ if ($wrapper.length) {
2610
+ $input.detach().insertAfter($wrapper);
2611
+ $wrapper.remove();
2612
+ }
2613
+ }
2614
+ function $elOrNull(obj) {
2615
+ var isValid, $el;
2616
+ isValid = _.isJQuery(obj) || _.isElement(obj);
2617
+ $el = isValid ? $(obj).first() : [];
2618
+ return $el.length ? $el : null;
2619
+ }
2620
+ })();
2621
+ });