materialize-sass 0.99.0 → 0.100.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +2 -2
  3. data/app/assets/javascripts/materialize.js +6015 -5060
  4. data/app/assets/javascripts/materialize/animation.js +4 -5
  5. data/app/assets/javascripts/materialize/buttons.js +24 -38
  6. data/app/assets/javascripts/materialize/cards.js +13 -21
  7. data/app/assets/javascripts/materialize/carousel.js +122 -110
  8. data/app/assets/javascripts/materialize/character_counter.js +14 -22
  9. data/app/assets/javascripts/materialize/chips.js +41 -44
  10. data/app/assets/javascripts/materialize/collapsible.js +41 -46
  11. data/app/assets/javascripts/materialize/date_picker/picker.date.js +965 -1167
  12. data/app/assets/javascripts/materialize/date_picker/picker.js +546 -634
  13. data/app/assets/javascripts/materialize/date_picker/picker.time.js +166 -212
  14. data/app/assets/javascripts/materialize/dropdown.js +53 -68
  15. data/app/assets/javascripts/materialize/extras/nouislider.js +3 -1
  16. data/app/assets/javascripts/materialize/extras/nouislider.min.js +1 -1
  17. data/app/assets/javascripts/materialize/forms.js +156 -154
  18. data/app/assets/javascripts/materialize/global.js +34 -43
  19. data/app/assets/javascripts/materialize/hammer.min.js +424 -1
  20. data/app/assets/javascripts/materialize/initial.js +3 -3
  21. data/app/assets/javascripts/materialize/jquery.easing.1.4.js +120 -142
  22. data/app/assets/javascripts/materialize/jquery.hammer.js +9 -9
  23. data/app/assets/javascripts/materialize/materialbox.js +81 -107
  24. data/app/assets/javascripts/materialize/modal.js +373 -162
  25. data/app/assets/javascripts/materialize/parallax.js +11 -15
  26. data/app/assets/javascripts/materialize/pushpin.js +2 -5
  27. data/app/assets/javascripts/materialize/scrollFire.js +9 -11
  28. data/app/assets/javascripts/materialize/scrollspy.js +84 -92
  29. data/app/assets/javascripts/materialize/sideNav.js +128 -139
  30. data/app/assets/javascripts/materialize/slider.js +83 -112
  31. data/app/assets/javascripts/materialize/tabs.js +196 -196
  32. data/app/assets/javascripts/materialize/tapTarget.js +170 -173
  33. data/app/assets/javascripts/materialize/toasts.js +330 -112
  34. data/app/assets/javascripts/materialize/tooltip.js +134 -145
  35. data/app/assets/javascripts/materialize/transitions.js +43 -49
  36. data/app/assets/javascripts/materialize/velocity.min.js +623 -2
  37. data/app/assets/javascripts/materialize/waves.js +42 -47
  38. data/app/assets/stylesheets/materialize/components/_buttons.scss +1 -1
  39. data/app/assets/stylesheets/materialize/components/_carousel.scss +4 -5
  40. data/app/assets/stylesheets/materialize/components/_chips.scss +1 -0
  41. data/app/assets/stylesheets/materialize/components/_collapsible.scss +4 -7
  42. data/app/assets/stylesheets/materialize/components/_color.scss +1 -1
  43. data/app/assets/stylesheets/materialize/components/_global.scss +8 -14
  44. data/app/assets/stylesheets/materialize/components/_navbar.scss +0 -1
  45. data/app/assets/stylesheets/materialize/components/_tabs.scss +1 -7
  46. data/app/assets/stylesheets/materialize/components/_toast.scss +6 -12
  47. data/app/assets/stylesheets/materialize/components/_variables.scss +55 -43
  48. data/app/assets/stylesheets/materialize/components/date_picker/_default.scss +1 -0
  49. data/app/assets/stylesheets/materialize/components/forms/_checkboxes.scss +2 -12
  50. data/app/assets/stylesheets/materialize/components/forms/_file-input.scss +6 -0
  51. data/app/assets/stylesheets/materialize/components/forms/_input-fields.scss +67 -37
  52. data/app/assets/stylesheets/materialize/components/forms/_radio-buttons.scss +1 -3
  53. data/app/assets/stylesheets/materialize/components/forms/_select.scss +72 -11
  54. data/app/assets/stylesheets/materialize/components/forms/_switches.scss +2 -4
  55. data/app/assets/stylesheets/materialize/extras/nouislider.css +8 -1
  56. data/lib/materialize-sass/version.rb +1 -1
  57. metadata +2 -5
  58. data/app/assets/javascripts/materialize/init.js +0 -214
  59. data/app/assets/javascripts/materialize/jquery.timeago.min.js +0 -1
  60. data/app/assets/javascripts/materialize/prism.js +0 -8
@@ -2,7 +2,7 @@
2
2
 
3
3
  // Add posibility to scroll to selected option
4
4
  // usefull for select for example
5
- $.fn.scrollTo = function(elem) {
5
+ $.fn.scrollTo = function (elem) {
6
6
  $(this).scrollTop($(this).scrollTop() - $(this).offset().top + $(elem).offset().top);
7
7
  return this;
8
8
  };
@@ -21,7 +21,7 @@
21
21
 
22
22
  // Open dropdown.
23
23
  if (options === "open") {
24
- this.each(function() {
24
+ this.each(function () {
25
25
  $(this).trigger('open');
26
26
  });
27
27
  return false;
@@ -29,37 +29,29 @@
29
29
 
30
30
  // Close dropdown.
31
31
  if (options === "close") {
32
- this.each(function() {
32
+ this.each(function () {
33
33
  $(this).trigger('close');
34
34
  });
35
35
  return false;
36
36
  }
37
37
 
38
- this.each(function(){
38
+ this.each(function () {
39
39
  var origin = $(this);
40
40
  var curr_options = $.extend({}, defaults, options);
41
41
  var isFocused = false;
42
42
 
43
43
  // Dropdown menu
44
- var activates = $("#"+ origin.attr('data-activates'));
44
+ var activates = $("#" + origin.attr('data-activates'));
45
45
 
46
46
  function updateOptions() {
47
- if (origin.data('induration') !== undefined)
48
- curr_options.inDuration = origin.data('induration');
49
- if (origin.data('outduration') !== undefined)
50
- curr_options.outDuration = origin.data('outduration');
51
- if (origin.data('constrainwidth') !== undefined)
52
- curr_options.constrainWidth = origin.data('constrainwidth');
53
- if (origin.data('hover') !== undefined)
54
- curr_options.hover = origin.data('hover');
55
- if (origin.data('gutter') !== undefined)
56
- curr_options.gutter = origin.data('gutter');
57
- if (origin.data('beloworigin') !== undefined)
58
- curr_options.belowOrigin = origin.data('beloworigin');
59
- if (origin.data('alignment') !== undefined)
60
- curr_options.alignment = origin.data('alignment');
61
- if (origin.data('stoppropagation') !== undefined)
62
- curr_options.stopPropagation = origin.data('stoppropagation');
47
+ if (origin.data('induration') !== undefined) curr_options.inDuration = origin.data('induration');
48
+ if (origin.data('outduration') !== undefined) curr_options.outDuration = origin.data('outduration');
49
+ if (origin.data('constrainwidth') !== undefined) curr_options.constrainWidth = origin.data('constrainwidth');
50
+ if (origin.data('hover') !== undefined) curr_options.hover = origin.data('hover');
51
+ if (origin.data('gutter') !== undefined) curr_options.gutter = origin.data('gutter');
52
+ if (origin.data('beloworigin') !== undefined) curr_options.belowOrigin = origin.data('beloworigin');
53
+ if (origin.data('alignment') !== undefined) curr_options.alignment = origin.data('alignment');
54
+ if (origin.data('stoppropagation') !== undefined) curr_options.stopPropagation = origin.data('stoppropagation');
63
55
  }
64
56
 
65
57
  updateOptions();
@@ -84,10 +76,11 @@
84
76
  activates.addClass('active');
85
77
  origin.addClass('active');
86
78
 
79
+ var originWidth = origin[0].getBoundingClientRect().width;
80
+
87
81
  // Constrain width
88
82
  if (curr_options.constrainWidth === true) {
89
- activates.css('width', origin.outerWidth());
90
-
83
+ activates.css('width', originWidth);
91
84
  } else {
92
85
  activates.css('white-space', 'nowrap');
93
86
  }
@@ -120,11 +113,9 @@
120
113
  }
121
114
  }
122
115
 
123
-
124
116
  if (offsetLeft + activates.innerWidth() > $(window).width()) {
125
117
  // Dropdown goes past screen on right, force right alignment
126
118
  currAlignment = 'right';
127
-
128
119
  } else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {
129
120
  // Dropdown goes past screen on left, force left alignment
130
121
  currAlignment = 'left';
@@ -148,19 +139,16 @@
148
139
  if (currAlignment === 'left') {
149
140
  gutterSpacing = curr_options.gutter;
150
141
  leftPosition = origin.position().left + gutterSpacing;
151
- }
152
- else if (currAlignment === 'right') {
142
+ } else if (currAlignment === 'right') {
153
143
  // Material icons fix
154
- activates
155
- .stop(true, true)
156
- .css({
157
- opacity: 0,
158
- left: 0
159
- })
144
+ activates.stop(true, true).css({
145
+ opacity: 0,
146
+ left: 0
147
+ });
160
148
 
161
- var offsetRight = origin.position().left + origin.outerWidth() - activates.outerWidth();
149
+ var offsetRight = origin.position().left + originWidth - activates.width();
162
150
  gutterSpacing = -curr_options.gutter;
163
- leftPosition = offsetRight + gutterSpacing;
151
+ leftPosition = offsetRight + gutterSpacing;
164
152
  }
165
153
 
166
154
  // Position dropdown
@@ -171,22 +159,20 @@
171
159
  });
172
160
 
173
161
  // Show dropdown
174
- activates
175
- .slideDown({
176
- queue: false,
177
- duration: curr_options.inDuration,
178
- easing: 'easeOutCubic',
179
- complete: function() {
180
- $(this).css('height', '');
181
- }
182
- })
183
- .animate( {opacity: 1}, {queue: false, duration: curr_options.inDuration, easing: 'easeOutSine'});
162
+ activates.slideDown({
163
+ queue: false,
164
+ duration: curr_options.inDuration,
165
+ easing: 'easeOutCubic',
166
+ complete: function () {
167
+ $(this).css('height', '');
168
+ }
169
+ }).animate({ opacity: 1 }, { queue: false, duration: curr_options.inDuration, easing: 'easeOutSine' });
184
170
 
185
171
  // Add click close handler to document
186
- setTimeout(function() {
187
- $(document).on('click.'+ activates.attr('id'), function (e) {
172
+ setTimeout(function () {
173
+ $(document).on('click.' + activates.attr('id'), function (e) {
188
174
  hideDropdown();
189
- $(document).off('click.'+ activates.attr('id'));
175
+ $(document).off('click.' + activates.attr('id'));
190
176
  });
191
177
  }, 0);
192
178
  }
@@ -197,8 +183,10 @@
197
183
  activates.fadeOut(curr_options.outDuration);
198
184
  activates.removeClass('active');
199
185
  origin.removeClass('active');
200
- $(document).off('click.'+ activates.attr('id'));
201
- setTimeout(function() { activates.css('max-height', ''); }, curr_options.outDuration);
186
+ $(document).off('click.' + activates.attr('id'));
187
+ setTimeout(function () {
188
+ activates.css('max-height', '');
189
+ }, curr_options.outDuration);
202
190
  }
203
191
 
204
192
  // Hover
@@ -206,25 +194,27 @@
206
194
  var open = false;
207
195
  origin.off('click.' + origin.attr('id'));
208
196
  // Hover handler to show dropdown
209
- origin.on('mouseenter', function(e){ // Mouse over
197
+ origin.on('mouseenter', function (e) {
198
+ // Mouse over
210
199
  if (open === false) {
211
200
  placeDropdown();
212
201
  open = true;
213
202
  }
214
203
  });
215
- origin.on('mouseleave', function(e){
204
+ origin.on('mouseleave', function (e) {
216
205
  // If hover on origin then to something other than dropdown content, then close
217
206
  var toEl = e.toElement || e.relatedTarget; // added browser compatibility for target element
218
- if(!$(toEl).closest('.dropdown-content').is(activates)) {
207
+ if (!$(toEl).closest('.dropdown-content').is(activates)) {
219
208
  activates.stop(true, true);
220
209
  hideDropdown();
221
210
  open = false;
222
211
  }
223
212
  });
224
213
 
225
- activates.on('mouseleave', function(e){ // Mouse out
214
+ activates.on('mouseleave', function (e) {
215
+ // Mouse out
226
216
  var toEl = e.toElement || e.relatedTarget;
227
- if(!$(toEl).closest('.dropdown-button').is(origin)) {
217
+ if (!$(toEl).closest('.dropdown-button').is(origin)) {
228
218
  activates.stop(true, true);
229
219
  hideDropdown();
230
220
  open = false;
@@ -235,11 +225,9 @@
235
225
  } else {
236
226
  // Click handler to show dropdown
237
227
  origin.off('click.' + origin.attr('id'));
238
- origin.on('click.'+origin.attr('id'), function(e){
228
+ origin.on('click.' + origin.attr('id'), function (e) {
239
229
  if (!isFocused) {
240
- if ( origin[0] == e.currentTarget &&
241
- !origin.hasClass('active') &&
242
- ($(e.target).closest('.dropdown-content').length === 0)) {
230
+ if (origin[0] == e.currentTarget && !origin.hasClass('active') && $(e.target).closest('.dropdown-content').length === 0) {
243
231
  e.preventDefault(); // Prevents button click from moving window
244
232
  if (curr_options.stopPropagation) {
245
233
  e.stopPropagation();
@@ -248,25 +236,22 @@
248
236
  }
249
237
  // If origin is clicked and menu is open, close menu
250
238
  else if (origin.hasClass('active')) {
251
- hideDropdown();
252
- $(document).off('click.'+ activates.attr('id'));
253
- }
239
+ hideDropdown();
240
+ $(document).off('click.' + activates.attr('id'));
241
+ }
254
242
  }
255
243
  });
256
-
257
244
  } // End else
258
245
 
259
246
  // Listen to open and close event - useful for select component
260
- origin.on('open', function(e, eventType) {
247
+ origin.on('open', function (e, eventType) {
261
248
  placeDropdown(eventType);
262
249
  });
263
250
  origin.on('close', hideDropdown);
264
-
265
-
266
251
  });
267
252
  }; // End dropdown plugin
268
253
 
269
- $(document).on('ready turbolinks:load', function(){
254
+ $(document).on('ready turbolinks:load', function () {
270
255
  $('.dropdown-button').dropdown();
271
256
  });
272
- }( jQuery ));
257
+ })(jQuery);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Materialize v0.99.0 (http://materializecss.com)
2
+ * Materialize v0.100.0 (http://materializecss.com)
3
3
  * Copyright 2014-2015 Materialize
4
4
  * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
5
5
  */
@@ -825,6 +825,7 @@ typeof b&&isFinite(b)?b:!1}function x(b){var f,c,d,e={};for(f=0;f<h.length;f+=1)
825
825
  base: 'base',
826
826
  origin: 'origin',
827
827
  handle: 'handle',
828
+ handleTouchArea: 'handle-touch-area',
828
829
  handleLower: 'handle-lower',
829
830
  handleUpper: 'handle-upper',
830
831
  horizontal: 'horizontal',
@@ -911,6 +912,7 @@ typeof b&&isFinite(b)?b:!1}function x(b){var f,c,d,e={};for(f=0;f<h.length;f+=1)
911
912
 
912
913
  var origin = addNodeTo(base, options.cssClasses.origin);
913
914
  var handle = addNodeTo(origin, options.cssClasses.handle);
915
+ addNodeTo(handle, options.cssClasses.handleTouchArea);
914
916
 
915
917
  handle.setAttribute('data-handle', handleNumber);
916
918
 
@@ -1 +1 @@
1
- !function(){function a(a){return a.split("").reverse().join("")}function b(a,b,c){if((a[b]||a[c])&&a[b]===a[c])throw Error(b)}function c(b,c,d,e,f,g,h,i,j,k,l,m){h=m;var n,o=l="";return g&&(m=g(m)),!("number"!=typeof m||!isFinite(m))&&(b&&0===parseFloat(m.toFixed(b))&&(m=0),0>m&&(n=!0,m=Math.abs(m)),b&&(g=Math.pow(10,b),m=(Math.round(m*g)/g).toFixed(b)),m=m.toString(),-1!==m.indexOf(".")&&(b=m.split("."),m=b[0],d&&(l=d+b[1])),c&&(m=a(m).match(/.{1,3}/g),m=a(m.join(a(c)))),n&&i&&(o+=i),e&&(o+=e),n&&j&&(o+=j),o=o+m+l,f&&(o+=f),k&&(o=k(o,h)),o)}function d(a,b,c,d,e,f,g,h,i,j,k,l){var m;return a="",k&&(l=k(l)),!(!l||"string"!=typeof l)&&(h&&l.substring(0,h.length)===h&&(l=l.replace(h,""),m=!0),d&&l.substring(0,d.length)===d&&(l=l.replace(d,"")),i&&l.substring(0,i.length)===i&&(l=l.replace(i,""),m=!0),e&&l.slice(-1*e.length)===e&&(l=l.slice(0,-1*e.length)),b&&(l=l.split(b).join("")),c&&(l=l.replace(c,".")),m&&(a+="-"),a=Number((a+l).replace(/[^0-9\.\-.]/g,"")),g&&(a=g(a)),!("number"!=typeof a||!isFinite(a))&&a)}function e(a){var c,d,e,f={};for(c=0;c<h.length;c+=1)d=h[c],e=a[d],void 0===e?f[d]="negative"!==d||f.negativeBefore?"mark"===d&&"."!==f.thousand&&".":"-":"decimals"===d?0<e&&8>e&&(f[d]=e):"encoder"===d||"decoder"===d||"edit"===d||"undo"===d?"function"==typeof e&&(f[d]=e):"string"==typeof e&&(f[d]=e);return b(f,"mark","thousand"),b(f,"prefix","negative"),b(f,"prefix","negativeBefore"),f}function f(a,b,c){var d,e=[];for(d=0;d<h.length;d+=1)e.push(a[h[d]]);return e.push(c),b.apply("",e)}function g(a){if(!(this instanceof g))return new g(a);"object"==typeof a&&(a=e(a),this.to=function(b){return f(a,c,b)},this.from=function(b){return f(a,d,b)})}var h="decimals thousand mark prefix postfix encoder decoder negativeBefore negative edit undo".split(" ");window.wNumb=g}(),function(a){"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?module.exports=a():window.noUiSlider=a()}(function(){"use strict";function a(a,b){var c=document.createElement("div");return j(c,b),a.appendChild(c),c}function b(a){return a.filter(function(a){return!this[a]&&(this[a]=!0)},{})}function c(a,b){return Math.round(a/b)*b}function d(a,b){var c=a.getBoundingClientRect(),d=a.ownerDocument,e=d.documentElement,f=m();return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(f.x=0),b?c.top+f.y-e.clientTop:c.left+f.x-e.clientLeft}function e(a){return"number"==typeof a&&!isNaN(a)&&isFinite(a)}function f(a,b,c){c>0&&(j(a,b),setTimeout(function(){k(a,b)},c))}function g(a){return Math.max(Math.min(a,100),0)}function h(a){return Array.isArray(a)?a:[a]}function i(a){a=String(a);var b=a.split(".");return b.length>1?b[1].length:0}function j(a,b){a.classList?a.classList.add(b):a.className+=" "+b}function k(a,b){a.classList?a.classList.remove(b):a.className=a.className.replace(new RegExp("(^|\\b)"+b.split(" ").join("|")+"(\\b|$)","gi")," ")}function l(a,b){return a.classList?a.classList.contains(b):new RegExp("\\b"+b+"\\b").test(a.className)}function m(){var a=void 0!==window.pageXOffset,b="CSS1Compat"===(document.compatMode||"");return{x:a?window.pageXOffset:b?document.documentElement.scrollLeft:document.body.scrollLeft,y:a?window.pageYOffset:b?document.documentElement.scrollTop:document.body.scrollTop}}function n(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function o(a,b){return 100/(b-a)}function p(a,b){return 100*b/(a[1]-a[0])}function q(a,b){return p(a,a[0]<0?b+Math.abs(a[0]):b-a[0])}function r(a,b){return b*(a[1]-a[0])/100+a[0]}function s(a,b){for(var c=1;a>=b[c];)c+=1;return c}function t(a,b,c){if(c>=a.slice(-1)[0])return 100;var d,e,f,g,h=s(c,a);return d=a[h-1],e=a[h],f=b[h-1],g=b[h],f+q([d,e],c)/o(f,g)}function u(a,b,c){if(c>=100)return a.slice(-1)[0];var d,e,f,g,h=s(c,b);return d=a[h-1],e=a[h],f=b[h-1],g=b[h],r([d,e],(c-f)*o(f,g))}function v(a,b,d,e){if(100===e)return e;var f,g,h=s(e,a);return d?(f=a[h-1],g=a[h],e-f>(g-f)/2?g:f):b[h-1]?a[h-1]+c(e-a[h-1],b[h-1]):e}function w(a,b,c){var d;if("number"==typeof b&&(b=[b]),"[object Array]"!==Object.prototype.toString.call(b))throw new Error("noUiSlider: 'range' contains invalid value.");if(d="min"===a?0:"max"===a?100:parseFloat(a),!e(d)||!e(b[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");c.xPct.push(d),c.xVal.push(b[0]),d?c.xSteps.push(!isNaN(b[1])&&b[1]):isNaN(b[1])||(c.xSteps[0]=b[1]),c.xHighestCompleteStep.push(0)}function x(a,b,c){if(!b)return!0;c.xSteps[a]=p([c.xVal[a],c.xVal[a+1]],b)/o(c.xPct[a],c.xPct[a+1]);var d=(c.xVal[a+1]-c.xVal[a])/c.xNumSteps[a],e=Math.ceil(Number(d.toFixed(3))-1),f=c.xVal[a]+c.xNumSteps[a]*e;c.xHighestCompleteStep[a]=f}function y(a,b,c,d){this.xPct=[],this.xVal=[],this.xSteps=[d||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=b,this.direction=c;var e,f=[];for(e in a)a.hasOwnProperty(e)&&f.push([a[e],e]);for(f.length&&"object"==typeof f[0][0]?f.sort(function(a,b){return a[0][0]-b[0][0]}):f.sort(function(a,b){return a[0]-b[0]}),e=0;e<f.length;e++)w(f[e][1],f[e][0],this);for(this.xNumSteps=this.xSteps.slice(0),e=0;e<this.xNumSteps.length;e++)x(e,this.xNumSteps[e],this)}function z(a,b){if(!e(b))throw new Error("noUiSlider: 'step' is not numeric.");a.singleStep=b}function A(a,b){if("object"!=typeof b||Array.isArray(b))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===b.min||void 0===b.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");if(b.min===b.max)throw new Error("noUiSlider: 'range' 'min' and 'max' cannot be equal.");a.spectrum=new y(b,a.snap,a.dir,a.singleStep)}function B(a,b){if(b=h(b),!Array.isArray(b)||!b.length)throw new Error("noUiSlider: 'start' option is incorrect.");a.handles=b.length,a.start=b}function C(a,b){if(a.snap=b,"boolean"!=typeof b)throw new Error("noUiSlider: 'snap' option must be a boolean.")}function D(a,b){if(a.animate=b,"boolean"!=typeof b)throw new Error("noUiSlider: 'animate' option must be a boolean.")}function E(a,b){if(a.animationDuration=b,"number"!=typeof b)throw new Error("noUiSlider: 'animationDuration' option must be a number.")}function F(a,b){var c,d=[!1];if("lower"===b?b=[!0,!1]:"upper"===b&&(b=[!1,!0]),!0===b||!1===b){for(c=1;c<a.handles;c++)d.push(b);d.push(!1)}else{if(!Array.isArray(b)||!b.length||b.length!==a.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");d=b}a.connect=d}function G(a,b){switch(b){case"horizontal":a.ort=0;break;case"vertical":a.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function H(a,b){if(!e(b))throw new Error("noUiSlider: 'margin' option must be numeric.");if(0!==b&&(a.margin=a.spectrum.getMargin(b),!a.margin))throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.")}function I(a,b){if(!e(b))throw new Error("noUiSlider: 'limit' option must be numeric.");if(a.limit=a.spectrum.getMargin(b),!a.limit||a.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function J(a,b){if(!e(b))throw new Error("noUiSlider: 'padding' option must be numeric.");if(0!==b){if(a.padding=a.spectrum.getMargin(b),!a.padding)throw new Error("noUiSlider: 'padding' option is only supported on linear sliders.");if(a.padding<0)throw new Error("noUiSlider: 'padding' option must be a positive number.");if(a.padding>=50)throw new Error("noUiSlider: 'padding' option must be less than half the range.")}}function K(a,b){switch(b){case"ltr":a.dir=0;break;case"rtl":a.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function L(a,b){if("string"!=typeof b)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var c=b.indexOf("tap")>=0,d=b.indexOf("drag")>=0,e=b.indexOf("fixed")>=0,f=b.indexOf("snap")>=0,g=b.indexOf("hover")>=0;if(e){if(2!==a.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");H(a,a.start[1]-a.start[0])}a.events={tap:c||f,drag:d,fixed:e,snap:f,hover:g}}function M(a,b){if(!1!==b)if(!0===b){a.tooltips=[];for(var c=0;c<a.handles;c++)a.tooltips.push(!0)}else{if(a.tooltips=h(b),a.tooltips.length!==a.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");a.tooltips.forEach(function(a){if("boolean"!=typeof a&&("object"!=typeof a||"function"!=typeof a.to))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")})}}function N(a,b){if(a.format=b,"function"==typeof b.to&&"function"==typeof b.from)return!0;throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.")}function O(a,b){if(void 0!==b&&"string"!=typeof b&&!1!==b)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");a.cssPrefix=b}function P(a,b){if(void 0!==b&&"object"!=typeof b)throw new Error("noUiSlider: 'cssClasses' must be an object.");if("string"==typeof a.cssPrefix){a.cssClasses={};for(var c in b)b.hasOwnProperty(c)&&(a.cssClasses[c]=a.cssPrefix+b[c])}else a.cssClasses=b}function Q(a,b){if(!0!==b&&!1!==b)throw new Error("noUiSlider: 'useRequestAnimationFrame' option should be true (default) or false.");a.useRequestAnimationFrame=b}function R(a){var b={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,format:U},c={step:{r:!1,t:z},start:{r:!0,t:B},connect:{r:!0,t:F},direction:{r:!0,t:K},snap:{r:!1,t:C},animate:{r:!1,t:D},animationDuration:{r:!1,t:E},range:{r:!0,t:A},orientation:{r:!1,t:G},margin:{r:!1,t:H},limit:{r:!1,t:I},padding:{r:!1,t:J},behaviour:{r:!0,t:L},format:{r:!1,t:N},tooltips:{r:!1,t:M},cssPrefix:{r:!1,t:O},cssClasses:{r:!1,t:P},useRequestAnimationFrame:{r:!1,t:Q}},d={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",cssPrefix:"noUi-",cssClasses:{target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",ltr:"ltr",rtl:"rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},useRequestAnimationFrame:!0};Object.keys(c).forEach(function(e){if(void 0===a[e]&&void 0===d[e]){if(c[e].r)throw new Error("noUiSlider: '"+e+"' is required.");return!0}c[e].t(b,void 0===a[e]?d[e]:a[e])}),b.pips=a.pips;var e=[["left","top"],["right","bottom"]];return b.style=e[b.dir][b.ort],b.styleOposite=e[b.dir?0:1][b.ort],b}function S(c,e,i){function o(b,c){var d=a(b,e.cssClasses.origin),f=a(d,e.cssClasses.handle);return f.setAttribute("data-handle",c),0===c?j(f,e.cssClasses.handleLower):c===e.handles-1&&j(f,e.cssClasses.handleUpper),d}function p(b,c){return!!c&&a(b,e.cssClasses.connect)}function q(b,c){return!!e.tooltips[c]&&a(b.firstChild,e.cssClasses.tooltip)}function r(a,b,c){if("range"===a||"steps"===a)return fa.xVal;if("count"===a){var d,e=100/(b-1),f=0;for(b=[];(d=f++*e)<=100;)b.push(d);a="positions"}return"positions"===a?b.map(function(a){return fa.fromStepping(c?fa.getStep(a):a)}):"values"===a?c?b.map(function(a){return fa.fromStepping(fa.getStep(fa.toStepping(a)))}):b:void 0}function s(a,c,d){function e(a,b){return(a+b).toFixed(7)/1}var f={},g=fa.xVal[0],h=fa.xVal[fa.xVal.length-1],i=!1,j=!1,k=0;return d=b(d.slice().sort(function(a,b){return a-b})),d[0]!==g&&(d.unshift(g),i=!0),d[d.length-1]!==h&&(d.push(h),j=!0),d.forEach(function(b,g){var h,l,m,n,o,p,q,r,s,t,u=b,v=d[g+1];if("steps"===c&&(h=fa.xNumSteps[g]),h||(h=v-u),!1!==u&&void 0!==v)for(h=Math.max(h,1e-7),l=u;l<=v;l=e(l,h)){for(n=fa.toStepping(l),o=n-k,r=o/a,s=Math.round(r),t=o/s,m=1;m<=s;m+=1)p=k+m*t,f[p.toFixed(5)]=["x",0];q=d.indexOf(l)>-1?1:"steps"===c?2:0,!g&&i&&(q=0),l===v&&j||(f[n.toFixed(5)]=[l,q]),k=n}}),f}function t(a,b,c){function d(a,b){var c=b===e.cssClasses.value,d=c?m:n,f=c?k:l;return b+" "+d[e.ort]+" "+f[a]}function f(a,b,c){return'class="'+d(c[1],b)+'" style="'+e.style+": "+a+'%"'}function g(a,d){d[1]=d[1]&&b?b(d[0],d[1]):d[1],i+="<div "+f(a,e.cssClasses.marker,d)+"></div>",d[1]&&(i+="<div "+f(a,e.cssClasses.value,d)+">"+c.to(d[0])+"</div>")}var h=document.createElement("div"),i="",k=[e.cssClasses.valueNormal,e.cssClasses.valueLarge,e.cssClasses.valueSub],l=[e.cssClasses.markerNormal,e.cssClasses.markerLarge,e.cssClasses.markerSub],m=[e.cssClasses.valueHorizontal,e.cssClasses.valueVertical],n=[e.cssClasses.markerHorizontal,e.cssClasses.markerVertical];return j(h,e.cssClasses.pips),j(h,0===e.ort?e.cssClasses.pipsHorizontal:e.cssClasses.pipsVertical),Object.keys(a).forEach(function(b){g(b,a[b])}),h.innerHTML=i,h}function u(a){var b=a.mode,c=a.density||1,d=a.filter||!1,e=a.values||!1,f=a.stepped||!1,g=r(b,e,f),h=s(c,b,g),i=a.format||{to:Math.round};return ba.appendChild(t(h,d,i))}function v(){var a=Y.getBoundingClientRect(),b="offset"+["Width","Height"][e.ort];return 0===e.ort?a.width||Y[b]:a.height||Y[b]}function w(a,b,c,d){var f=function(b){return!ba.hasAttribute("disabled")&&(!l(ba,e.cssClasses.tap)&&(!!(b=x(b,d.pageOffset))&&(!(a===aa.start&&void 0!==b.buttons&&b.buttons>1)&&((!d.hover||!b.buttons)&&(b.calcPoint=b.points[e.ort],void c(b,d))))))},g=[];return a.split(" ").forEach(function(a){b.addEventListener(a,f,!1),g.push([a,f])}),g}function x(a,b){a.preventDefault();var c,d,e=0===a.type.indexOf("touch"),f=0===a.type.indexOf("mouse"),g=0===a.type.indexOf("pointer");if(0===a.type.indexOf("MSPointer")&&(g=!0),e){if(a.touches.length>1)return!1;c=a.changedTouches[0].pageX,d=a.changedTouches[0].pageY}return b=b||m(),(f||g)&&(c=a.clientX+b.x,d=a.clientY+b.y),a.pageOffset=b,a.points=[c,d],a.cursor=f||g,a}function y(a){var b=a-d(Y,e.ort),c=100*b/v();return e.dir?100-c:c}function z(a){var b=100,c=!1;return Z.forEach(function(d,e){if(!d.hasAttribute("disabled")){var f=Math.abs(ca[e]-a);f<b&&(c=e,b=f)}}),c}function A(a,b,c,d){var e=c.slice(),f=[!a,a],g=[a,!a];d=d.slice(),a&&d.reverse(),d.length>1?d.forEach(function(a,c){var d=I(e,a,e[a]+b,f[c],g[c]);!1===d?b=0:(b=d-e[a],e[a]=d)}):f=g=[!0];var h=!1;d.forEach(function(a,d){h=M(a,c[a]+b,f[d],g[d])||h}),h&&d.forEach(function(a){B("update",a),B("slide",a)})}function B(a,b,c){Object.keys(ha).forEach(function(d){var f=d.split(".")[0];a===f&&ha[d].forEach(function(a){a.call(_,ga.map(e.format.to),b,ga.slice(),c||!1,ca.slice())})})}function C(a,b){"mouseout"===a.type&&"HTML"===a.target.nodeName&&null===a.relatedTarget&&E(a,b)}function D(a,b){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===a.buttons&&0!==b.buttonsProperty)return E(a,b);var c=(e.dir?-1:1)*(a.calcPoint-b.startCalcPoint);A(c>0,100*c/b.baseSize,b.locations,b.handleNumbers)}function E(a,b){ea&&(k(ea,e.cssClasses.active),ea=!1),a.cursor&&(document.body.style.cursor="",document.body.removeEventListener("selectstart",document.body.noUiListener)),document.documentElement.noUiListeners.forEach(function(a){document.documentElement.removeEventListener(a[0],a[1])}),k(ba,e.cssClasses.drag),L(),b.handleNumbers.forEach(function(a){B("set",a),B("change",a),B("end",a)})}function F(a,b){if(1===b.handleNumbers.length){var c=Z[b.handleNumbers[0]];if(c.hasAttribute("disabled"))return!1;ea=c.children[0],j(ea,e.cssClasses.active)}a.preventDefault(),a.stopPropagation();var d=w(aa.move,document.documentElement,D,{startCalcPoint:a.calcPoint,baseSize:v(),pageOffset:a.pageOffset,handleNumbers:b.handleNumbers,buttonsProperty:a.buttons,locations:ca.slice()}),f=w(aa.end,document.documentElement,E,{handleNumbers:b.handleNumbers}),g=w("mouseout",document.documentElement,C,{handleNumbers:b.handleNumbers});if(document.documentElement.noUiListeners=d.concat(f,g),a.cursor){document.body.style.cursor=getComputedStyle(a.target).cursor,Z.length>1&&j(ba,e.cssClasses.drag);var h=function(){return!1};document.body.noUiListener=h,document.body.addEventListener("selectstart",h,!1)}b.handleNumbers.forEach(function(a){B("start",a)})}function G(a){a.stopPropagation();var b=y(a.calcPoint),c=z(b);if(!1===c)return!1;e.events.snap||f(ba,e.cssClasses.tap,e.animationDuration),M(c,b,!0,!0),L(),B("slide",c,!0),B("set",c,!0),B("change",c,!0),B("update",c,!0),e.events.snap&&F(a,{handleNumbers:[c]})}function H(a){var b=y(a.calcPoint),c=fa.getStep(b),d=fa.fromStepping(c);Object.keys(ha).forEach(function(a){"hover"===a.split(".")[0]&&ha[a].forEach(function(a){a.call(_,d)})})}function I(a,b,c,d,f){return Z.length>1&&(d&&b>0&&(c=Math.max(c,a[b-1]+e.margin)),f&&b<Z.length-1&&(c=Math.min(c,a[b+1]-e.margin))),Z.length>1&&e.limit&&(d&&b>0&&(c=Math.min(c,a[b-1]+e.limit)),f&&b<Z.length-1&&(c=Math.max(c,a[b+1]-e.limit))),e.padding&&(0===b&&(c=Math.max(c,e.padding)),b===Z.length-1&&(c=Math.min(c,100-e.padding))),c=fa.getStep(c),(c=g(c))!==a[b]&&c}function J(a){return a+"%"}function K(a,b){ca[a]=b,ga[a]=fa.fromStepping(b);var c=function(){Z[a].style[e.style]=J(b),N(a),N(a+1)};window.requestAnimationFrame&&e.useRequestAnimationFrame?window.requestAnimationFrame(c):c()}function L(){da.forEach(function(a){var b=ca[a]>50?-1:1,c=3+(Z.length+b*a);Z[a].childNodes[0].style.zIndex=c})}function M(a,b,c,d){return!1!==(b=I(ca,a,b,c,d))&&(K(a,b),!0)}function N(a){if($[a]){var b=0,c=100;0!==a&&(b=ca[a-1]),a!==$.length-1&&(c=ca[a]),$[a].style[e.style]=J(b),$[a].style[e.styleOposite]=J(100-c)}}function O(a,b){null!==a&&!1!==a&&("number"==typeof a&&(a=String(a)),!1===(a=e.format.from(a))||isNaN(a)||M(b,fa.toStepping(a),!1,!1))}function P(a,b){var c=h(a),d=void 0===ca[0];b=void 0===b||!!b,c.forEach(O),e.animate&&!d&&f(ba,e.cssClasses.tap,e.animationDuration),da.forEach(function(a){M(a,ca[a],!0,!1)}),L(),da.forEach(function(a){B("update",a),null!==c[a]&&b&&B("set",a)})}function Q(a){P(e.start,a)}function S(){var a=ga.map(e.format.to);return 1===a.length?a[0]:a}function T(){for(var a in e.cssClasses)e.cssClasses.hasOwnProperty(a)&&k(ba,e.cssClasses[a]);for(;ba.firstChild;)ba.removeChild(ba.firstChild);delete ba.noUiSlider}function U(){return ca.map(function(a,b){var c=fa.getNearbySteps(a),d=ga[b],e=c.thisStep.step,f=null;!1!==e&&d+e>c.stepAfter.startValue&&(e=c.stepAfter.startValue-d),f=d>c.thisStep.startValue?c.thisStep.step:!1!==c.stepBefore.step&&d-c.stepBefore.highestStep,100===a?e=null:0===a&&(f=null);var g=fa.countStepDecimals();return null!==e&&!1!==e&&(e=Number(e.toFixed(g))),null!==f&&!1!==f&&(f=Number(f.toFixed(g))),[f,e]})}function V(a,b){ha[a]=ha[a]||[],ha[a].push(b),"update"===a.split(".")[0]&&Z.forEach(function(a,b){B("update",b)})}function W(a){var b=a&&a.split(".")[0],c=b&&a.substring(b.length);Object.keys(ha).forEach(function(a){var d=a.split(".")[0],e=a.substring(d.length);b&&b!==d||c&&c!==e||delete ha[a]})}function X(a,b){var c=S(),d=["margin","limit","padding","range","animate","snap","step","format"];d.forEach(function(b){void 0!==a[b]&&(i[b]=a[b])});var f=R(i);d.forEach(function(b){void 0!==a[b]&&(e[b]=f[b])}),f.spectrum.direction=fa.direction,fa=f.spectrum,e.margin=f.margin,e.limit=f.limit,e.padding=f.padding,ca=[],P(a.start||c,b)}var Y,Z,$,_,aa=n(),ba=c,ca=[],da=[],ea=!1,fa=e.spectrum,ga=[],ha={};if(ba.noUiSlider)throw new Error("Slider was already initialized.");return function(b){j(b,e.cssClasses.target),0===e.dir?j(b,e.cssClasses.ltr):j(b,e.cssClasses.rtl),0===e.ort?j(b,e.cssClasses.horizontal):j(b,e.cssClasses.vertical),Y=a(b,e.cssClasses.base)}(ba),function(a,b){Z=[],$=[],$.push(p(b,a[0]));for(var c=0;c<e.handles;c++)Z.push(o(b,c)),da[c]=c,$.push(p(b,a[c+1]))}(e.connect,Y),_={destroy:T,steps:U,on:V,off:W,get:S,set:P,reset:Q,__moveHandles:function(a,b,c){A(a,b,ca,c)},options:i,updateOptions:X,target:ba,pips:u},function(a){a.fixed||Z.forEach(function(a,b){w(aa.start,a.children[0],F,{handleNumbers:[b]})}),a.tap&&w(aa.start,Y,G,{}),a.hover&&w(aa.move,Y,H,{hover:!0}),a.drag&&$.forEach(function(b,c){if(!1!==b&&0!==c&&c!==$.length-1){var d=Z[c-1],f=Z[c],g=[b];j(b,e.cssClasses.draggable),a.fixed&&(g.push(d.children[0]),g.push(f.children[0])),g.forEach(function(a){w(aa.start,a,F,{handles:[d,f],handleNumbers:[c-1,c]})})}})}(e.events),P(e.start),e.pips&&u(e.pips),e.tooltips&&function(){var a=Z.map(q);V("update",function(b,c,d){if(a[c]){var f=b[c];!0!==e.tooltips[c]&&(f=e.tooltips[c].to(d[c])),a[c].innerHTML="<span>"+f+"</span>"}})}(),_}function T(a,b){if(!a.nodeName)throw new Error("noUiSlider.create requires a single element.");void 0===b.tooltips&&(b.tooltips=!0);var c=R(b,a),d=S(a,c,b);return a.noUiSlider=d,d}y.prototype.getMargin=function(a){var b=this.xNumSteps[0];if(b&&a/b%1!=0)throw new Error("noUiSlider: 'limit', 'margin' and 'padding' must be divisible by step.");return 2===this.xPct.length&&p(this.xVal,a)},y.prototype.toStepping=function(a){return a=t(this.xVal,this.xPct,a)},y.prototype.fromStepping=function(a){return u(this.xVal,this.xPct,a)},y.prototype.getStep=function(a){return a=v(this.xPct,this.xSteps,this.snap,a)},y.prototype.getNearbySteps=function(a){var b=s(a,this.xPct);return{stepBefore:{startValue:this.xVal[b-2],step:this.xNumSteps[b-2],highestStep:this.xHighestCompleteStep[b-2]},thisStep:{startValue:this.xVal[b-1],step:this.xNumSteps[b-1],highestStep:this.xHighestCompleteStep[b-1]},stepAfter:{startValue:this.xVal[b-0],step:this.xNumSteps[b-0],highestStep:this.xHighestCompleteStep[b-0]}}},y.prototype.countStepDecimals=function(){var a=this.xNumSteps.map(i);return Math.max.apply(null,a)},y.prototype.convert=function(a){return this.getStep(this.toStepping(a))};var U={to:function(a){return void 0!==a&&a.toFixed(2)},from:Number};return{create:T}});
1
+ !function(){function t(t){return t.split("").reverse().join("")}function e(t,e,n){if((t[e]||t[n])&&t[e]===t[n])throw Error(e)}function n(e,n,r,i,o,s,a,u,l,c,f,p){a=p;var d,h=f="";return s&&(p=s(p)),!("number"!=typeof p||!isFinite(p))&&(e&&0===parseFloat(p.toFixed(e))&&(p=0),0>p&&(d=!0,p=Math.abs(p)),e&&(s=Math.pow(10,e),p=(Math.round(p*s)/s).toFixed(e)),-1!==(p=p.toString()).indexOf(".")&&(e=p.split("."),p=e[0],r&&(f=r+e[1])),n&&(p=t(p).match(/.{1,3}/g),p=t(p.join(t(n)))),d&&u&&(h+=u),i&&(h+=i),d&&l&&(h+=l),h=h+p+f,o&&(h+=o),c&&(h=c(h,a)),h)}function r(t,e,n,r,i,o,s,a,u,l,c,f){var p;return t="",c&&(f=c(f)),!(!f||"string"!=typeof f)&&(a&&f.substring(0,a.length)===a&&(f=f.replace(a,""),p=!0),r&&f.substring(0,r.length)===r&&(f=f.replace(r,"")),u&&f.substring(0,u.length)===u&&(f=f.replace(u,""),p=!0),i&&f.slice(-1*i.length)===i&&(f=f.slice(0,-1*i.length)),e&&(f=f.split(e).join("")),n&&(f=f.replace(n,".")),p&&(t+="-"),t=Number((t+f).replace(/[^0-9\.\-.]/g,"")),s&&(t=s(t)),!("number"!=typeof t||!isFinite(t))&&t)}function i(t){var n,r,i,o={};for(n=0;n<a.length;n+=1)r=a[n],i=t[r],void 0===i?o[r]="negative"!==r||o.negativeBefore?"mark"===r&&"."!==o.thousand&&".":"-":"decimals"===r?0<i&&8>i&&(o[r]=i):"encoder"===r||"decoder"===r||"edit"===r||"undo"===r?"function"==typeof i&&(o[r]=i):"string"==typeof i&&(o[r]=i);return e(o,"mark","thousand"),e(o,"prefix","negative"),e(o,"prefix","negativeBefore"),o}function o(t,e,n){var r,i=[];for(r=0;r<a.length;r+=1)i.push(t[a[r]]);return i.push(n),e.apply("",i)}function s(t){if(!(this instanceof s))return new s(t);"object"==typeof t&&(t=i(t),this.to=function(e){return o(t,n,e)},this.from=function(e){return o(t,r,e)})}var a="decimals thousand mark prefix postfix encoder decoder negativeBefore negative edit undo".split(" ");window.wNumb=s}(),function(t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():window.noUiSlider=t()}(function(){"use strict";function t(t,e){var n=document.createElement("div");return l(n,e),t.appendChild(n),n}function e(t){return t.filter(function(t){return!this[t]&&(this[t]=!0)},{})}function n(t,e){return Math.round(t/e)*e}function r(t,e){var n=t.getBoundingClientRect(),r=t.ownerDocument.documentElement,i=p();return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(i.x=0),e?n.top+i.y-r.clientTop:n.left+i.x-r.clientLeft}function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function o(t,e,n){n>0&&(l(t,e),setTimeout(function(){c(t,e)},n))}function s(t){return Math.max(Math.min(t,100),0)}function a(t){return Array.isArray(t)?t:[t]}function u(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function l(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function c(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function f(t,e){return t.classList?t.classList.contains(e):new RegExp("\\b"+e+"\\b").test(t.className)}function p(){var t=void 0!==window.pageXOffset,e="CSS1Compat"===(document.compatMode||"");return{x:t?window.pageXOffset:e?document.documentElement.scrollLeft:document.body.scrollLeft,y:t?window.pageYOffset:e?document.documentElement.scrollTop:document.body.scrollTop}}function d(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function h(t,e){return 100/(e-t)}function m(t,e){return 100*e/(t[1]-t[0])}function g(t,e){return m(t,t[0]<0?e+Math.abs(t[0]):e-t[0])}function v(t,e){return e*(t[1]-t[0])/100+t[0]}function b(t,e){for(var n=1;t>=e[n];)n+=1;return n}function w(t,e,n){if(n>=t.slice(-1)[0])return 100;var r,i,o,s,a=b(n,t);return r=t[a-1],i=t[a],o=e[a-1],s=e[a],o+g([r,i],n)/h(o,s)}function S(t,e,n){if(n>=100)return t.slice(-1)[0];var r,i,o,s,a=b(n,e);return r=t[a-1],i=t[a],o=e[a-1],s=e[a],v([r,i],(n-o)*h(o,s))}function x(t,e,r,i){if(100===i)return i;var o,s,a=b(i,t);return r?(o=t[a-1],s=t[a],i-o>(s-o)/2?s:o):e[a-1]?t[a-1]+n(i-t[a-1],e[a-1]):i}function y(t,e,n){var r;if("number"==typeof e&&(e=[e]),"[object Array]"!==Object.prototype.toString.call(e))throw new Error("noUiSlider: 'range' contains invalid value.");if(r="min"===t?0:"max"===t?100:parseFloat(t),!i(r)||!i(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");n.xPct.push(r),n.xVal.push(e[0]),r?n.xSteps.push(!isNaN(e[1])&&e[1]):isNaN(e[1])||(n.xSteps[0]=e[1]),n.xHighestCompleteStep.push(0)}function E(t,e,n){if(!e)return!0;n.xSteps[t]=m([n.xVal[t],n.xVal[t+1]],e)/h(n.xPct[t],n.xPct[t+1]);var r=(n.xVal[t+1]-n.xVal[t])/n.xNumSteps[t],i=Math.ceil(Number(r.toFixed(3))-1),o=n.xVal[t]+n.xNumSteps[t]*i;n.xHighestCompleteStep[t]=o}function C(t,e,n,r){this.xPct=[],this.xVal=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=e,this.direction=n;var i,o=[];for(i in t)t.hasOwnProperty(i)&&o.push([t[i],i]);for(o.length&&"object"==typeof o[0][0]?o.sort(function(t,e){return t[0][0]-e[0][0]}):o.sort(function(t,e){return t[0]-e[0]}),i=0;i<o.length;i++)y(o[i][1],o[i][0],this);for(this.xNumSteps=this.xSteps.slice(0),i=0;i<this.xNumSteps.length;i++)E(i,this.xNumSteps[i],this)}function N(t,e){if(!i(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function U(t,e){if("object"!=typeof e||Array.isArray(e))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===e.min||void 0===e.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");if(e.min===e.max)throw new Error("noUiSlider: 'range' 'min' and 'max' cannot be equal.");t.spectrum=new C(e,t.snap,t.dir,t.singleStep)}function M(t,e){if(e=a(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function P(t,e){if(t.snap=e,"boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.")}function k(t,e){if(t.animate=e,"boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.")}function O(t,e){if(t.animationDuration=e,"number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.")}function V(t,e){var n,r=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(n=1;n<t.handles;n++)r.push(e);r.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");r=e}t.connect=r}function A(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function L(t,e){if(!i(e))throw new Error("noUiSlider: 'margin' option must be numeric.");if(0!==e&&(t.margin=t.spectrum.getMargin(e),!t.margin))throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.")}function F(t,e){if(!i(e))throw new Error("noUiSlider: 'limit' option must be numeric.");if(t.limit=t.spectrum.getMargin(e),!t.limit||t.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function j(t,e){if(!i(e))throw new Error("noUiSlider: 'padding' option must be numeric.");if(0!==e){if(t.padding=t.spectrum.getMargin(e),!t.padding)throw new Error("noUiSlider: 'padding' option is only supported on linear sliders.");if(t.padding<0)throw new Error("noUiSlider: 'padding' option must be a positive number.");if(t.padding>=50)throw new Error("noUiSlider: 'padding' option must be less than half the range.")}}function z(t,e){switch(e){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function H(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var n=e.indexOf("tap")>=0,r=e.indexOf("drag")>=0,i=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,s=e.indexOf("hover")>=0;if(i){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");L(t,t.start[1]-t.start[0])}t.events={tap:n||o,drag:r,fixed:i,snap:o,hover:s}}function D(t,e){if(!1!==e)if(!0===e){t.tooltips=[];for(var n=0;n<t.handles;n++)t.tooltips.push(!0)}else{if(t.tooltips=a(e),t.tooltips.length!==t.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");t.tooltips.forEach(function(t){if("boolean"!=typeof t&&("object"!=typeof t||"function"!=typeof t.to))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")})}}function T(t,e){if(t.format=e,"function"==typeof e.to&&"function"==typeof e.from)return!0;throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.")}function q(t,e){if(void 0!==e&&"string"!=typeof e&&!1!==e)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function R(t,e){if(void 0!==e&&"object"!=typeof e)throw new Error("noUiSlider: 'cssClasses' must be an object.");if("string"==typeof t.cssPrefix){t.cssClasses={};for(var n in e)e.hasOwnProperty(n)&&(t.cssClasses[n]=t.cssPrefix+e[n])}else t.cssClasses=e}function B(t,e){if(!0!==e&&!1!==e)throw new Error("noUiSlider: 'useRequestAnimationFrame' option should be true (default) or false.");t.useRequestAnimationFrame=e}function X(t){var e={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,format:I},n={step:{r:!1,t:N},start:{r:!0,t:M},connect:{r:!0,t:V},direction:{r:!0,t:z},snap:{r:!1,t:P},animate:{r:!1,t:k},animationDuration:{r:!1,t:O},range:{r:!0,t:U},orientation:{r:!1,t:A},margin:{r:!1,t:L},limit:{r:!1,t:F},padding:{r:!1,t:j},behaviour:{r:!0,t:H},format:{r:!1,t:T},tooltips:{r:!1,t:D},cssPrefix:{r:!1,t:q},cssClasses:{r:!1,t:R},useRequestAnimationFrame:{r:!1,t:B}},r={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",cssPrefix:"noUi-",cssClasses:{target:"target",base:"base",origin:"origin",handle:"handle",handleTouchArea:"handle-touch-area",handleLower:"handle-lower",handleUpper:"handle-upper",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",ltr:"ltr",rtl:"rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},useRequestAnimationFrame:!0};Object.keys(n).forEach(function(i){if(void 0===t[i]&&void 0===r[i]){if(n[i].r)throw new Error("noUiSlider: '"+i+"' is required.");return!0}n[i].t(e,void 0===t[i]?r[i]:t[i])}),e.pips=t.pips;var i=[["left","top"],["right","bottom"]];return e.style=i[e.dir][e.ort],e.styleOposite=i[e.dir?0:1][e.ort],e}function Y(n,i,u){function h(e,n){var r=t(e,i.cssClasses.origin),o=t(r,i.cssClasses.handle);return t(o,i.cssClasses.handleTouchArea),o.setAttribute("data-handle",n),0===n?l(o,i.cssClasses.handleLower):n===i.handles-1&&l(o,i.cssClasses.handleUpper),r}function m(e,n){return!!n&&t(e,i.cssClasses.connect)}function g(e,n){return!!i.tooltips[n]&&t(e.firstChild,i.cssClasses.tooltip)}function v(t,e,n){if("range"===t||"steps"===t)return tt.xVal;if("count"===t){var r,i=100/(e-1),o=0;for(e=[];(r=o++*i)<=100;)e.push(r);t="positions"}return"positions"===t?e.map(function(t){return tt.fromStepping(n?tt.getStep(t):t)}):"values"===t?n?e.map(function(t){return tt.fromStepping(tt.getStep(tt.toStepping(t)))}):e:void 0}function b(t,n,r){function i(t,e){return(t+e).toFixed(7)/1}var o={},s=tt.xVal[0],a=tt.xVal[tt.xVal.length-1],u=!1,l=!1,c=0;return(r=e(r.slice().sort(function(t,e){return t-e})))[0]!==s&&(r.unshift(s),u=!0),r[r.length-1]!==a&&(r.push(a),l=!0),r.forEach(function(e,s){var a,f,p,d,h,m,g,v,b,w=e,S=r[s+1];if("steps"===n&&(a=tt.xNumSteps[s]),a||(a=S-w),!1!==w&&void 0!==S)for(a=Math.max(a,1e-7),f=w;f<=S;f=i(f,a)){for(g=(h=(d=tt.toStepping(f))-c)/t,b=h/(v=Math.round(g)),p=1;p<=v;p+=1)o[(c+p*b).toFixed(5)]=["x",0];m=r.indexOf(f)>-1?1:"steps"===n?2:0,!s&&u&&(m=0),f===S&&l||(o[d.toFixed(5)]=[f,m]),c=d}}),o}function w(t,e,n){function r(t,e){var n=e===i.cssClasses.value,r=n?p:d,o=n?c:f;return e+" "+r[i.ort]+" "+o[t]}function o(t,e,n){return'class="'+r(n[1],e)+'" style="'+i.style+": "+t+'%"'}function s(t,r){r[1]=r[1]&&e?e(r[0],r[1]):r[1],u+="<div "+o(t,i.cssClasses.marker,r)+"></div>",r[1]&&(u+="<div "+o(t,i.cssClasses.value,r)+">"+n.to(r[0])+"</div>")}var a=document.createElement("div"),u="",c=[i.cssClasses.valueNormal,i.cssClasses.valueLarge,i.cssClasses.valueSub],f=[i.cssClasses.markerNormal,i.cssClasses.markerLarge,i.cssClasses.markerSub],p=[i.cssClasses.valueHorizontal,i.cssClasses.valueVertical],d=[i.cssClasses.markerHorizontal,i.cssClasses.markerVertical];return l(a,i.cssClasses.pips),l(a,0===i.ort?i.cssClasses.pipsHorizontal:i.cssClasses.pipsVertical),Object.keys(t).forEach(function(e){s(e,t[e])}),a.innerHTML=u,a}function S(t){var e=t.mode,n=t.density||1,r=t.filter||!1,i=b(n,e,v(e,t.values||!1,t.stepped||!1)),o=t.format||{to:Math.round};return J.appendChild(w(i,r,o))}function x(){var t=I.getBoundingClientRect(),e="offset"+["Width","Height"][i.ort];return 0===i.ort?t.width||I[e]:t.height||I[e]}function y(t,e,n,r){var o=function(e){return!J.hasAttribute("disabled")&&(!f(J,i.cssClasses.tap)&&(!!(e=E(e,r.pageOffset))&&(!(t===G.start&&void 0!==e.buttons&&e.buttons>1)&&((!r.hover||!e.buttons)&&(e.calcPoint=e.points[i.ort],void n(e,r))))))},s=[];return t.split(" ").forEach(function(t){e.addEventListener(t,o,!1),s.push([t,o])}),s}function E(t,e){t.preventDefault();var n,r,i=0===t.type.indexOf("touch"),o=0===t.type.indexOf("mouse"),s=0===t.type.indexOf("pointer");if(0===t.type.indexOf("MSPointer")&&(s=!0),i){if(t.touches.length>1)return!1;n=t.changedTouches[0].pageX,r=t.changedTouches[0].pageY}return e=e||p(),(o||s)&&(n=t.clientX+e.x,r=t.clientY+e.y),t.pageOffset=e,t.points=[n,r],t.cursor=o||s,t}function C(t){var e=100*(t-r(I,i.ort))/x();return i.dir?100-e:e}function N(t){var e=100,n=!1;return _.forEach(function(r,i){if(!r.hasAttribute("disabled")){var o=Math.abs(K[i]-t);o<e&&(n=i,e=o)}}),n}function U(t,e,n,r){var i=n.slice(),o=[!t,t],s=[t,!t];r=r.slice(),t&&r.reverse(),r.length>1?r.forEach(function(t,n){var r=F(i,t,i[t]+e,o[n],s[n]);!1===r?e=0:(e=r-i[t],i[t]=r)}):o=s=[!0];var a=!1;r.forEach(function(t,r){a=D(t,n[t]+e,o[r],s[r])||a}),a&&r.forEach(function(t){M("update",t),M("slide",t)})}function M(t,e,n){Object.keys(nt).forEach(function(r){var o=r.split(".")[0];t===o&&nt[r].forEach(function(t){t.call($,et.map(i.format.to),e,et.slice(),n||!1,K.slice())})})}function P(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&O(t,e)}function k(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return O(t,e);var n=(i.dir?-1:1)*(t.calcPoint-e.startCalcPoint);U(n>0,100*n/e.baseSize,e.locations,e.handleNumbers)}function O(t,e){Z&&(c(Z,i.cssClasses.active),Z=!1),t.cursor&&(document.body.style.cursor="",document.body.removeEventListener("selectstart",document.body.noUiListener)),document.documentElement.noUiListeners.forEach(function(t){document.documentElement.removeEventListener(t[0],t[1])}),c(J,i.cssClasses.drag),H(),e.handleNumbers.forEach(function(t){M("set",t),M("change",t),M("end",t)})}function V(t,e){if(1===e.handleNumbers.length){var n=_[e.handleNumbers[0]];if(n.hasAttribute("disabled"))return!1;l(Z=n.children[0],i.cssClasses.active)}t.preventDefault(),t.stopPropagation();var r=y(G.move,document.documentElement,k,{startCalcPoint:t.calcPoint,baseSize:x(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:K.slice()}),o=y(G.end,document.documentElement,O,{handleNumbers:e.handleNumbers}),s=y("mouseout",document.documentElement,P,{handleNumbers:e.handleNumbers});if(document.documentElement.noUiListeners=r.concat(o,s),t.cursor){document.body.style.cursor=getComputedStyle(t.target).cursor,_.length>1&&l(J,i.cssClasses.drag);var a=function(){return!1};document.body.noUiListener=a,document.body.addEventListener("selectstart",a,!1)}e.handleNumbers.forEach(function(t){M("start",t)})}function A(t){t.stopPropagation();var e=C(t.calcPoint),n=N(e);if(!1===n)return!1;i.events.snap||o(J,i.cssClasses.tap,i.animationDuration),D(n,e,!0,!0),H(),M("slide",n,!0),M("set",n,!0),M("change",n,!0),M("update",n,!0),i.events.snap&&V(t,{handleNumbers:[n]})}function L(t){var e=C(t.calcPoint),n=tt.getStep(e),r=tt.fromStepping(n);Object.keys(nt).forEach(function(t){"hover"===t.split(".")[0]&&nt[t].forEach(function(t){t.call($,r)})})}function F(t,e,n,r,o){return _.length>1&&(r&&e>0&&(n=Math.max(n,t[e-1]+i.margin)),o&&e<_.length-1&&(n=Math.min(n,t[e+1]-i.margin))),_.length>1&&i.limit&&(r&&e>0&&(n=Math.min(n,t[e-1]+i.limit)),o&&e<_.length-1&&(n=Math.max(n,t[e+1]-i.limit))),i.padding&&(0===e&&(n=Math.max(n,i.padding)),e===_.length-1&&(n=Math.min(n,100-i.padding))),n=tt.getStep(n),(n=s(n))!==t[e]&&n}function j(t){return t+"%"}function z(t,e){K[t]=e,et[t]=tt.fromStepping(e);var n=function(){_[t].style[i.style]=j(e),T(t),T(t+1)};window.requestAnimationFrame&&i.useRequestAnimationFrame?window.requestAnimationFrame(n):n()}function H(){Q.forEach(function(t){var e=K[t]>50?-1:1,n=3+(_.length+e*t);_[t].childNodes[0].style.zIndex=n})}function D(t,e,n,r){return!1!==(e=F(K,t,e,n,r))&&(z(t,e),!0)}function T(t){if(W[t]){var e=0,n=100;0!==t&&(e=K[t-1]),t!==W.length-1&&(n=K[t]),W[t].style[i.style]=j(e),W[t].style[i.styleOposite]=j(100-n)}}function q(t,e){null!==t&&!1!==t&&("number"==typeof t&&(t=String(t)),!1===(t=i.format.from(t))||isNaN(t)||D(e,tt.toStepping(t),!1,!1))}function R(t,e){var n=a(t),r=void 0===K[0];e=void 0===e||!!e,n.forEach(q),i.animate&&!r&&o(J,i.cssClasses.tap,i.animationDuration),Q.forEach(function(t){D(t,K[t],!0,!1)}),H(),Q.forEach(function(t){M("update",t),null!==n[t]&&e&&M("set",t)})}function B(){var t=et.map(i.format.to);return 1===t.length?t[0]:t}function Y(t,e){nt[t]=nt[t]||[],nt[t].push(e),"update"===t.split(".")[0]&&_.forEach(function(t,e){M("update",e)})}var I,_,W,$,G=d(),J=n,K=[],Q=[],Z=!1,tt=i.spectrum,et=[],nt={};if(J.noUiSlider)throw new Error("Slider was already initialized.");return function(e){l(e,i.cssClasses.target),0===i.dir?l(e,i.cssClasses.ltr):l(e,i.cssClasses.rtl),0===i.ort?l(e,i.cssClasses.horizontal):l(e,i.cssClasses.vertical),I=t(e,i.cssClasses.base)}(J),function(t,e){_=[],(W=[]).push(m(e,t[0]));for(var n=0;n<i.handles;n++)_.push(h(e,n)),Q[n]=n,W.push(m(e,t[n+1]))}(i.connect,I),$={destroy:function(){for(var t in i.cssClasses)i.cssClasses.hasOwnProperty(t)&&c(J,i.cssClasses[t]);for(;J.firstChild;)J.removeChild(J.firstChild);delete J.noUiSlider},steps:function(){return K.map(function(t,e){var n=tt.getNearbySteps(t),r=et[e],i=n.thisStep.step,o=null;!1!==i&&r+i>n.stepAfter.startValue&&(i=n.stepAfter.startValue-r),o=r>n.thisStep.startValue?n.thisStep.step:!1!==n.stepBefore.step&&r-n.stepBefore.highestStep,100===t?i=null:0===t&&(o=null);var s=tt.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(s))),null!==o&&!1!==o&&(o=Number(o.toFixed(s))),[o,i]})},on:Y,off:function(t){var e=t&&t.split(".")[0],n=e&&t.substring(e.length);Object.keys(nt).forEach(function(t){var r=t.split(".")[0],i=t.substring(r.length);e&&e!==r||n&&n!==i||delete nt[t]})},get:B,set:R,reset:function(t){R(i.start,t)},__moveHandles:function(t,e,n){U(t,e,K,n)},options:u,updateOptions:function(t,e){var n=B(),r=["margin","limit","padding","range","animate","snap","step","format"];r.forEach(function(e){void 0!==t[e]&&(u[e]=t[e])});var o=X(u);r.forEach(function(e){void 0!==t[e]&&(i[e]=o[e])}),o.spectrum.direction=tt.direction,tt=o.spectrum,i.margin=o.margin,i.limit=o.limit,i.padding=o.padding,K=[],R(t.start||n,e)},target:J,pips:S},function(t){t.fixed||_.forEach(function(t,e){y(G.start,t.children[0],V,{handleNumbers:[e]})}),t.tap&&y(G.start,I,A,{}),t.hover&&y(G.move,I,L,{hover:!0}),t.drag&&W.forEach(function(e,n){if(!1!==e&&0!==n&&n!==W.length-1){var r=_[n-1],o=_[n],s=[e];l(e,i.cssClasses.draggable),t.fixed&&(s.push(r.children[0]),s.push(o.children[0])),s.forEach(function(t){y(G.start,t,V,{handles:[r,o],handleNumbers:[n-1,n]})})}})}(i.events),R(i.start),i.pips&&S(i.pips),i.tooltips&&function(){var t=_.map(g);Y("update",function(e,n,r){if(t[n]){var o=e[n];!0!==i.tooltips[n]&&(o=i.tooltips[n].to(r[n])),t[n].innerHTML="<span>"+o+"</span>"}})}(),$}C.prototype.getMargin=function(t){var e=this.xNumSteps[0];if(e&&t/e%1!=0)throw new Error("noUiSlider: 'limit', 'margin' and 'padding' must be divisible by step.");return 2===this.xPct.length&&m(this.xVal,t)},C.prototype.toStepping=function(t){return t=w(this.xVal,this.xPct,t)},C.prototype.fromStepping=function(t){return S(this.xVal,this.xPct,t)},C.prototype.getStep=function(t){return t=x(this.xPct,this.xSteps,this.snap,t)},C.prototype.getNearbySteps=function(t){var e=b(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e-0],step:this.xNumSteps[e-0],highestStep:this.xHighestCompleteStep[e-0]}}},C.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(u);return Math.max.apply(null,t)},C.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var I={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};return{create:function(t,e){if(!t.nodeName)throw new Error("noUiSlider.create requires a single element.");void 0===e.tooltips&&(e.tooltips=!0);var n=Y(t,X(e,t),e);return t.noUiSlider=n,n}}});
@@ -1,10 +1,10 @@
1
1
  (function ($) {
2
- $(document).on('ready turbolinks:load', function() {
2
+ $(document).on('ready turbolinks:load', function () {
3
3
 
4
4
  // Function to update labels of text fields
5
- Materialize.updateTextFields = function() {
5
+ Materialize.updateTextFields = function () {
6
6
  var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
7
- $(input_selector).each(function(index, element) {
7
+ $(input_selector).each(function (index, element) {
8
8
  var $this = $(this);
9
9
  if ($(element).val().length > 0 || $(element).is(':focus') || element.autofocus || $this.attr('placeholder') !== undefined) {
10
10
  $this.siblings('label').addClass('active');
@@ -21,19 +21,19 @@
21
21
 
22
22
  // Add active if form auto complete
23
23
  $(document).on('change', input_selector, function () {
24
- if($(this).val().length !== 0 || $(this).attr('placeholder') !== undefined) {
24
+ if ($(this).val().length !== 0 || $(this).attr('placeholder') !== undefined) {
25
25
  $(this).siblings('label').addClass('active');
26
26
  }
27
27
  validate_field($(this));
28
28
  });
29
29
 
30
30
  // Add active if input element has been pre-populated on document ready
31
- $(document).on('ready turbolinks:load', function() {
31
+ $(document).on('ready turbolinks:load', function () {
32
32
  Materialize.updateTextFields();
33
33
  });
34
34
 
35
35
  // HTML DOM FORM RESET handling
36
- $(document).on('reset', function(e) {
36
+ $(document).on('reset', function (e) {
37
37
  var formReset = $(e.target);
38
38
  if (formReset.is('form')) {
39
39
  formReset.find(input_selector).removeClass('valid').removeClass('invalid');
@@ -69,25 +69,23 @@
69
69
  validate_field($inputElement);
70
70
  });
71
71
 
72
- window.validate_field = function(object) {
72
+ window.validate_field = function (object) {
73
73
  var hasLength = object.attr('data-length') !== undefined;
74
74
  var lenAttr = parseInt(object.attr('data-length'));
75
75
  var len = object.val().length;
76
76
 
77
- if (object.val().length === 0 && object[0].validity.badInput === false) {
77
+ if (object.val().length === 0 && object[0].validity.badInput === false && !object.is(':required')) {
78
78
  if (object.hasClass('validate')) {
79
79
  object.removeClass('valid');
80
80
  object.removeClass('invalid');
81
81
  }
82
- }
83
- else {
82
+ } else {
84
83
  if (object.hasClass('validate')) {
85
84
  // Check for character counter attributes
86
- if ((object.is(':valid') && hasLength && (len <= lenAttr)) || (object.is(':valid') && !hasLength)) {
85
+ if (object.is(':valid') && hasLength && len <= lenAttr || object.is(':valid') && !hasLength) {
87
86
  object.removeClass('invalid');
88
87
  object.addClass('valid');
89
- }
90
- else {
88
+ } else {
91
89
  object.removeClass('valid');
92
90
  object.addClass('invalid');
93
91
  }
@@ -97,12 +95,12 @@
97
95
 
98
96
  // Radio and Checkbox focus class
99
97
  var radio_checkbox = 'input[type=radio], input[type=checkbox]';
100
- $(document).on('keyup.radio', radio_checkbox, function(e) {
98
+ $(document).on('keyup.radio', radio_checkbox, function (e) {
101
99
  // TAB, check if tabbing to radio or checkbox.
102
100
  if (e.which === 9) {
103
101
  $(this).addClass('tabbed');
104
102
  var $this = $(this);
105
- $this.one('blur', function(e) {
103
+ $this.one('blur', function (e) {
106
104
 
107
105
  $(this).removeClass('tabbed');
108
106
  });
@@ -124,10 +122,20 @@
124
122
  var fontFamily = $textarea.css('font-family');
125
123
  var fontSize = $textarea.css('font-size');
126
124
  var lineHeight = $textarea.css('line-height');
125
+ var padding = $textarea.css('padding');
127
126
 
128
- if (fontSize) { hiddenDiv.css('font-size', fontSize); }
129
- if (fontFamily) { hiddenDiv.css('font-family', fontFamily); }
130
- if (lineHeight) { hiddenDiv.css('line-height', lineHeight); }
127
+ if (fontSize) {
128
+ hiddenDiv.css('font-size', fontSize);
129
+ }
130
+ if (fontFamily) {
131
+ hiddenDiv.css('font-family', fontFamily);
132
+ }
133
+ if (lineHeight) {
134
+ hiddenDiv.css('line-height', lineHeight);
135
+ }
136
+ if (padding) {
137
+ hiddenDiv.css('padding', padding);
138
+ }
131
139
 
132
140
  // Set original-height, if none
133
141
  if (!$textarea.data('original-height')) {
@@ -135,25 +143,21 @@
135
143
  }
136
144
 
137
145
  if ($textarea.attr('wrap') === 'off') {
138
- hiddenDiv.css('overflow-wrap', 'normal')
139
- .css('white-space', 'pre');
146
+ hiddenDiv.css('overflow-wrap', 'normal').css('white-space', 'pre');
140
147
  }
141
148
 
142
149
  hiddenDiv.text($textarea.val() + '\n');
143
150
  var content = hiddenDiv.html().replace(/\n/g, '<br>');
144
151
  hiddenDiv.html(content);
145
152
 
146
-
147
153
  // When textarea is hidden, width goes crazy.
148
154
  // Approximate with half of window size
149
155
 
150
156
  if ($textarea.is(':visible')) {
151
157
  hiddenDiv.css('width', $textarea.width());
158
+ } else {
159
+ hiddenDiv.css('width', $(window).width() / 2);
152
160
  }
153
- else {
154
- hiddenDiv.css('width', $(window).width()/2);
155
- }
156
-
157
161
 
158
162
  /**
159
163
  * Resize if the new height is greater than the
@@ -190,7 +194,7 @@
190
194
  $(document).on('change', '.file-field input[type="file"]', function () {
191
195
  var file_field = $(this).closest('.file-field');
192
196
  var path_input = file_field.find('input.file-path');
193
- var files = $(this)[0].files;
197
+ var files = $(this)[0].files;
194
198
  var file_names = [];
195
199
  for (var i = 0; i < files.length; i++) {
196
200
  file_names.push(files[i].name);
@@ -212,22 +216,22 @@
212
216
  $(this).after(thumb);
213
217
  });
214
218
 
215
- var showRangeBubble = function(thumb) {
219
+ var showRangeBubble = function (thumb) {
216
220
  var paddingLeft = parseInt(thumb.parent().css('padding-left'));
217
- var marginLeft = (-7 + paddingLeft) + 'px';
218
- thumb.velocity({ height: "30px", width: "30px", top: "-30px", marginLeft: marginLeft}, { duration: 300, easing: 'easeOutExpo' });
221
+ var marginLeft = -7 + paddingLeft + 'px';
222
+ thumb.velocity({ height: "30px", width: "30px", top: "-30px", marginLeft: marginLeft }, { duration: 300, easing: 'easeOutExpo' });
219
223
  };
220
224
 
221
- var calcRangeOffset = function(range) {
225
+ var calcRangeOffset = function (range) {
222
226
  var width = range.width() - 15;
223
227
  var max = parseFloat(range.attr('max'));
224
228
  var min = parseFloat(range.attr('min'));
225
229
  var percent = (parseFloat(range.val()) - min) / (max - min);
226
230
  return percent * width;
227
- }
231
+ };
228
232
 
229
233
  var range_wrapper = '.range-field';
230
- $(document).on('change', range_type, function(e) {
234
+ $(document).on('change', range_type, function (e) {
231
235
  var thumb = $(this).siblings('.thumb');
232
236
  thumb.find('.value').html($(this).val());
233
237
 
@@ -239,7 +243,7 @@
239
243
  thumb.addClass('active').css('left', offsetLeft);
240
244
  });
241
245
 
242
- $(document).on('mousedown touchstart', range_type, function(e) {
246
+ $(document).on('mousedown touchstart', range_type, function (e) {
243
247
  var thumb = $(this).siblings('.thumb');
244
248
 
245
249
  // If thumb indicator does not exist yet, create it
@@ -264,12 +268,12 @@
264
268
  }
265
269
  });
266
270
 
267
- $(document).on('mouseup touchend', range_wrapper, function() {
271
+ $(document).on('mouseup touchend', range_wrapper, function () {
268
272
  range_mousedown = false;
269
273
  $(this).removeClass('active');
270
274
  });
271
275
 
272
- $(document).on('input mousemove touchmove', range_wrapper, function(e) {
276
+ $(document).on('input mousemove touchmove', range_wrapper, function (e) {
273
277
  var thumb = $(this).children('.thumb');
274
278
  var left;
275
279
  var input = $(this).find(range_type);
@@ -285,15 +289,15 @@
285
289
  }
286
290
  });
287
291
 
288
- $(document).on('mouseout touchleave', range_wrapper, function() {
292
+ $(document).on('mouseout touchleave', range_wrapper, function () {
289
293
  if (!range_mousedown) {
290
294
 
291
295
  var thumb = $(this).children('.thumb');
292
296
  var paddingLeft = parseInt($(this).css('padding-left'));
293
- var marginLeft = (7 + paddingLeft) + 'px';
297
+ var marginLeft = 7 + paddingLeft + 'px';
294
298
 
295
299
  if (thumb.hasClass('active')) {
296
- thumb.velocity({ height: '0', width: '0', top: '10px', marginLeft: marginLeft}, { duration: 100 });
300
+ thumb.velocity({ height: '0', width: '0', top: '10px', marginLeft: marginLeft }, { duration: 100 });
297
301
  }
298
302
  thumb.removeClass('active');
299
303
  }
@@ -313,7 +317,7 @@
313
317
 
314
318
  options = $.extend(defaults, options);
315
319
 
316
- return this.each(function() {
320
+ return this.each(function () {
317
321
  var $input = $(this);
318
322
  var data = options.data,
319
323
  count = 0,
@@ -344,7 +348,7 @@
344
348
  }
345
349
 
346
350
  // Highlight partial match.
347
- var highlight = function(string, $el) {
351
+ var highlight = function (string, $el) {
348
352
  var img = $el.find('img');
349
353
  var matchStart = $el.text().toLowerCase().indexOf("" + string.toLowerCase() + ""),
350
354
  matchEnd = matchStart + string.length - 1,
@@ -358,19 +362,19 @@
358
362
  };
359
363
 
360
364
  // Reset current element position
361
- var resetCurrentElement = function() {
365
+ var resetCurrentElement = function () {
362
366
  activeIndex = -1;
363
367
  $autocomplete.find('.active').removeClass('active');
364
- }
368
+ };
365
369
 
366
370
  // Remove autocomplete elements
367
- var removeAutocomplete = function() {
371
+ var removeAutocomplete = function () {
368
372
  $autocomplete.empty();
369
373
  resetCurrentElement();
370
374
  oldVal = undefined;
371
375
  };
372
376
 
373
- $input.off('blur.autocomplete').on('blur.autocomplete', function() {
377
+ $input.off('blur.autocomplete').on('blur.autocomplete', function () {
374
378
  removeAutocomplete();
375
379
  });
376
380
 
@@ -381,22 +385,17 @@
381
385
  var val = $input.val().toLowerCase();
382
386
 
383
387
  // Don't capture enter or arrow key usage.
384
- if (e.which === 13 ||
385
- e.which === 38 ||
386
- e.which === 40) {
388
+ if (e.which === 13 || e.which === 38 || e.which === 40) {
387
389
  return;
388
390
  }
389
391
 
390
-
391
392
  // Check if the input isn't empty
392
393
  if (oldVal !== val) {
393
394
  removeAutocomplete();
394
395
 
395
396
  if (val.length >= options.minLength) {
396
- for(var key in data) {
397
- if (data.hasOwnProperty(key) &&
398
- key.toLowerCase().indexOf(val) !== -1 &&
399
- key.toLowerCase() !== val) {
397
+ for (var key in data) {
398
+ if (data.hasOwnProperty(key) && key.toLowerCase().indexOf(val) !== -1) {
400
399
  // Break if past limit
401
400
  if (count >= options.limit) {
402
401
  break;
@@ -404,9 +403,9 @@
404
403
 
405
404
  var autocompleteOption = $('<li></li>');
406
405
  if (!!data[key]) {
407
- autocompleteOption.append('<img src="'+ data[key] +'" class="right circle"><span>'+ key +'</span>');
406
+ autocompleteOption.append('<img src="' + data[key] + '" class="right circle"><span>' + key + '</span>');
408
407
  } else {
409
- autocompleteOption.append('<span>'+ key +'</span>');
408
+ autocompleteOption.append('<span>' + key + '</span>');
410
409
  }
411
410
 
412
411
  $autocomplete.append(autocompleteOption);
@@ -439,16 +438,14 @@
439
438
  }
440
439
 
441
440
  // Capture up and down key
442
- if ( keyCode === 38 || keyCode === 40 ) {
441
+ if (keyCode === 38 || keyCode === 40) {
443
442
  e.preventDefault();
444
443
 
445
- if (keyCode === 38 &&
446
- activeIndex > 0) {
444
+ if (keyCode === 38 && activeIndex > 0) {
447
445
  activeIndex--;
448
446
  }
449
447
 
450
- if (keyCode === 40 &&
451
- activeIndex < (numItems - 1)) {
448
+ if (keyCode === 40 && activeIndex < numItems - 1) {
452
449
  activeIndex++;
453
450
  }
454
451
 
@@ -460,28 +457,31 @@
460
457
  });
461
458
 
462
459
  // Set input value
463
- $autocomplete.on('mousedown.autocomplete touchstart.autocomplete', 'li', function () {
460
+ $autocomplete.off('mousedown.autocomplete touchstart.autocomplete').on('mousedown.autocomplete touchstart.autocomplete', 'li', function () {
464
461
  var text = $(this).text().trim();
465
462
  $input.val(text);
466
463
  $input.trigger('change');
467
464
  removeAutocomplete();
468
465
 
469
466
  // Handle onAutocomplete callback.
470
- if (typeof(options.onAutocomplete) === "function") {
467
+ if (typeof options.onAutocomplete === "function") {
471
468
  options.onAutocomplete.call(this, text);
472
469
  }
473
470
  });
471
+
472
+ // Empty data
473
+ } else {
474
+ $input.off('keyup.autocomplete focus.autocomplete');
474
475
  }
475
476
  });
476
477
  };
477
-
478
478
  }); // End of $(document).ready
479
479
 
480
480
  /*******************
481
481
  * Select Plugin *
482
482
  ******************/
483
483
  $.fn.material_select = function (callback) {
484
- $(this).each(function(){
484
+ $(this).each(function () {
485
485
  var $select = $(this);
486
486
 
487
487
  if ($select.hasClass('browser-default')) {
@@ -489,27 +489,29 @@
489
489
  }
490
490
 
491
491
  var multiple = $select.attr('multiple') ? true : false,
492
- lastID = $select.data('select-id'); // Tear down structure if Select needs to be rebuilt
492
+ lastID = $select.attr('data-select-id'); // Tear down structure if Select needs to be rebuilt
493
493
 
494
494
  if (lastID) {
495
495
  $select.parent().find('span.caret').remove();
496
496
  $select.parent().find('input').remove();
497
497
 
498
498
  $select.unwrap();
499
- $('ul#select-options-'+lastID).remove();
499
+ $('ul#select-options-' + lastID).remove();
500
500
  }
501
501
 
502
502
  // If destroying the select, remove the selelct-id and reset it to it's uninitialized state.
503
- if(callback === 'destroy') {
504
- $select.data('select-id', null).removeClass('initialized');
503
+ if (callback === 'destroy') {
504
+ $select.removeAttr('data-select-id').removeClass('initialized');
505
+ $(window).off('click.select');
505
506
  return;
506
507
  }
507
508
 
508
509
  var uniqueID = Materialize.guid();
509
- $select.data('select-id', uniqueID);
510
+ $select.attr('data-select-id', uniqueID);
510
511
  var wrapper = $('<div class="select-wrapper"></div>');
511
512
  wrapper.addClass($select.attr('class'));
512
- var options = $('<ul id="select-options-' + uniqueID +'" class="dropdown-content select-dropdown ' + (multiple ? 'multiple-select-dropdown' : '') + '"></ul>'),
513
+ if ($select.is(':disabled')) wrapper.addClass('disabled');
514
+ var options = $('<ul id="select-options-' + uniqueID + '" class="dropdown-content select-dropdown ' + (multiple ? 'multiple-select-dropdown' : '') + '"></ul>'),
513
515
  selectChildren = $select.children('option, optgroup'),
514
516
  valuesSelected = [],
515
517
  optionsHover = false;
@@ -518,10 +520,10 @@
518
520
 
519
521
  // Function that renders and appends the option taking into
520
522
  // account type and possible image icon.
521
- var appendOptionWithIcon = function(select, option, type) {
523
+ var appendOptionWithIcon = function (select, option, type) {
522
524
  // Add disabled attr if disabled
523
- var disabledClass = (option.is(':disabled')) ? 'disabled ' : '';
524
- var optgroupClass = (type === 'optgroup-option') ? 'optgroup-option ' : '';
525
+ var disabledClass = option.is(':disabled') ? 'disabled ' : '';
526
+ var optgroupClass = type === 'optgroup-option' ? 'optgroup-option ' : '';
525
527
  var multipleCheckbox = multiple ? '<input type="checkbox"' + disabledClass + '/><label></label>' : '';
526
528
 
527
529
  // add icons
@@ -542,12 +544,11 @@
542
544
 
543
545
  /* Create dropdown structure. */
544
546
  if (selectChildren.length) {
545
- selectChildren.each(function() {
547
+ selectChildren.each(function () {
546
548
  if ($(this).is('option')) {
547
549
  // Direct descendant option.
548
550
  if (multiple) {
549
551
  appendOptionWithIcon($select, $(this), 'multiple');
550
-
551
552
  } else {
552
553
  appendOptionWithIcon($select, $(this));
553
554
  }
@@ -556,7 +557,7 @@
556
557
  var selectOptions = $(this).children('option');
557
558
  options.append($('<li class="optgroup"><span>' + $(this).attr('label') + '</span></li>'));
558
559
 
559
- selectOptions.each(function() {
560
+ selectOptions.each(function () {
560
561
  appendOptionWithIcon($select, $(this), 'optgroup-option');
561
562
  });
562
563
  }
@@ -570,7 +571,9 @@
570
571
  var selected = true;
571
572
 
572
573
  if (multiple) {
573
- $('input[type="checkbox"]', this).prop('checked', function(i, v) { return !v; });
574
+ $('input[type="checkbox"]', this).prop('checked', function (i, v) {
575
+ return !v;
576
+ });
574
577
  selected = toggleEntryFromArray(valuesSelected, i, $select);
575
578
  $newSelect.trigger('focus');
576
579
  } else {
@@ -594,20 +597,18 @@
594
597
  $select.wrap(wrapper);
595
598
  // Add Select Display Element
596
599
  var dropdownIcon = $('<span class="caret">&#9660;</span>');
597
- if ($select.is(':disabled'))
598
- dropdownIcon.addClass('disabled');
599
600
 
600
601
  // escape double quotes
601
602
  var sanitizedLabelHtml = label.replace(/"/g, '&quot;');
602
603
 
603
- var $newSelect = $('<input type="text" class="select-dropdown" readonly="true" ' + (($select.is(':disabled')) ? 'disabled' : '') + ' data-activates="select-options-' + uniqueID +'" value="'+ sanitizedLabelHtml +'"/>');
604
+ var $newSelect = $('<input type="text" class="select-dropdown" readonly="true" ' + ($select.is(':disabled') ? 'disabled' : '') + ' data-activates="select-options-' + uniqueID + '" value="' + sanitizedLabelHtml + '"/>');
604
605
  $select.before($newSelect);
605
606
  $newSelect.before(dropdownIcon);
606
607
 
607
608
  $newSelect.after(options);
608
609
  // Check if section element is disabled
609
610
  if (!$select.is(':disabled')) {
610
- $newSelect.dropdown({'hover': false});
611
+ $newSelect.dropdown({ 'hover': false });
611
612
  }
612
613
 
613
614
  // Copy tabindex
@@ -618,9 +619,10 @@
618
619
  $select.addClass('initialized');
619
620
 
620
621
  $newSelect.on({
621
- 'focus': function (){
622
+ 'focus': function () {
622
623
  if ($('ul.select-dropdown').not(options[0]).is(':visible')) {
623
624
  $('input.select-dropdown').trigger('close');
625
+ $(window).off('click.select');
624
626
  }
625
627
  if (!options.is(':visible')) {
626
628
  $(this).trigger('open', ['focus']);
@@ -629,36 +631,36 @@
629
631
  label = label.split(',')[0];
630
632
  }
631
633
 
632
- var selectedOption = options.find('li').filter(function() {
634
+ var selectedOption = options.find('li').filter(function () {
633
635
  return $(this).text().toLowerCase() === label.toLowerCase();
634
636
  })[0];
635
637
  activateOption(options, selectedOption, true);
638
+
639
+ $(window).off('click.select').on('click.select', function () {
640
+ multiple && (optionsHover || $newSelect.trigger('close'));
641
+ $(window).off('click.select');
642
+ });
636
643
  }
637
644
  },
638
- 'click': function (e){
645
+ 'click': function (e) {
639
646
  e.stopPropagation();
640
647
  }
641
648
  });
642
649
 
643
- $newSelect.on('blur', function() {
650
+ $newSelect.on('blur', function () {
644
651
  if (!multiple) {
645
652
  $(this).trigger('close');
653
+ $(window).off('click.select');
646
654
  }
647
655
  options.find('li.selected').removeClass('selected');
648
656
  });
649
657
 
650
- options.hover(function() {
658
+ options.hover(function () {
651
659
  optionsHover = true;
652
660
  }, function () {
653
661
  optionsHover = false;
654
662
  });
655
663
 
656
- $(window).on({
657
- 'click': function () {
658
- multiple && (optionsHover || $newSelect.trigger('close'));
659
- }
660
- });
661
-
662
664
  // Add initial multiple selections.
663
665
  if (multiple) {
664
666
  $select.find("option:selected:not(:disabled)").each(function () {
@@ -675,7 +677,7 @@
675
677
  * @param {Element} newOption element of the new option
676
678
  * @param {Boolean} firstActivation If on first activation of select
677
679
  */
678
- var activateOption = function(collection, newOption, firstActivation) {
680
+ var activateOption = function (collection, newOption, firstActivation) {
679
681
  if (newOption) {
680
682
  collection.find('li.selected').removeClass('selected');
681
683
  var option = $(newOption);
@@ -689,78 +691,79 @@
689
691
  // Allow user to search by typing
690
692
  // this array is cleared after 1 second
691
693
  var filterQuery = [],
692
- onKeyDown = function(e){
693
- // TAB - switch to another input
694
- if(e.which == 9){
695
- $newSelect.trigger('close');
696
- return;
697
- }
694
+ onKeyDown = function (e) {
695
+ // TAB - switch to another input
696
+ if (e.which == 9) {
697
+ $newSelect.trigger('close');
698
+ return;
699
+ }
698
700
 
699
- // ARROW DOWN WHEN SELECT IS CLOSED - open select options
700
- if(e.which == 40 && !options.is(':visible')){
701
- $newSelect.trigger('open');
702
- return;
703
- }
701
+ // ARROW DOWN WHEN SELECT IS CLOSED - open select options
702
+ if (e.which == 40 && !options.is(':visible')) {
703
+ $newSelect.trigger('open');
704
+ return;
705
+ }
704
706
 
705
- // ENTER WHEN SELECT IS CLOSED - submit form
706
- if(e.which == 13 && !options.is(':visible')){
707
- return;
708
- }
707
+ // ENTER WHEN SELECT IS CLOSED - submit form
708
+ if (e.which == 13 && !options.is(':visible')) {
709
+ return;
710
+ }
709
711
 
710
- e.preventDefault();
712
+ e.preventDefault();
711
713
 
712
- // CASE WHEN USER TYPE LETTERS
713
- var letter = String.fromCharCode(e.which).toLowerCase(),
714
- nonLetters = [9,13,27,38,40];
715
- if (letter && (nonLetters.indexOf(e.which) === -1)) {
716
- filterQuery.push(letter);
714
+ // CASE WHEN USER TYPE LETTERS
715
+ var letter = String.fromCharCode(e.which).toLowerCase(),
716
+ nonLetters = [9, 13, 27, 38, 40];
717
+ if (letter && nonLetters.indexOf(e.which) === -1) {
718
+ filterQuery.push(letter);
717
719
 
718
- var string = filterQuery.join(''),
719
- newOption = options.find('li').filter(function() {
720
- return $(this).text().toLowerCase().indexOf(string) === 0;
721
- })[0];
720
+ var string = filterQuery.join(''),
721
+ newOption = options.find('li').filter(function () {
722
+ return $(this).text().toLowerCase().indexOf(string) === 0;
723
+ })[0];
722
724
 
723
- if (newOption) {
724
- activateOption(options, newOption);
725
- }
726
- }
725
+ if (newOption) {
726
+ activateOption(options, newOption);
727
+ }
728
+ }
727
729
 
728
- // ENTER - select option and close when select options are opened
729
- if (e.which == 13) {
730
- var activeOption = options.find('li.selected:not(.disabled)')[0];
731
- if(activeOption){
732
- $(activeOption).trigger('click');
733
- if (!multiple) {
734
- $newSelect.trigger('close');
735
- }
736
- }
730
+ // ENTER - select option and close when select options are opened
731
+ if (e.which == 13) {
732
+ var activeOption = options.find('li.selected:not(.disabled)')[0];
733
+ if (activeOption) {
734
+ $(activeOption).trigger('click');
735
+ if (!multiple) {
736
+ $newSelect.trigger('close');
737
737
  }
738
+ }
739
+ }
738
740
 
739
- // ARROW DOWN - move to next not disabled option
740
- if (e.which == 40) {
741
- if (options.find('li.selected').length) {
742
- newOption = options.find('li.selected').next('li:not(.disabled)')[0];
743
- } else {
744
- newOption = options.find('li:not(.disabled)')[0];
745
- }
746
- activateOption(options, newOption);
747
- }
741
+ // ARROW DOWN - move to next not disabled option
742
+ if (e.which == 40) {
743
+ if (options.find('li.selected').length) {
744
+ newOption = options.find('li.selected').next('li:not(.disabled)')[0];
745
+ } else {
746
+ newOption = options.find('li:not(.disabled)')[0];
747
+ }
748
+ activateOption(options, newOption);
749
+ }
748
750
 
749
- // ESC - close options
750
- if (e.which == 27) {
751
- $newSelect.trigger('close');
752
- }
751
+ // ESC - close options
752
+ if (e.which == 27) {
753
+ $newSelect.trigger('close');
754
+ }
753
755
 
754
- // ARROW UP - move to previous not disabled option
755
- if (e.which == 38) {
756
- newOption = options.find('li.selected').prev('li:not(.disabled)')[0];
757
- if(newOption)
758
- activateOption(options, newOption);
759
- }
756
+ // ARROW UP - move to previous not disabled option
757
+ if (e.which == 38) {
758
+ newOption = options.find('li.selected').prev('li:not(.disabled)')[0];
759
+ if (newOption) activateOption(options, newOption);
760
+ }
760
761
 
761
- // Automaticaly clean filter query so user can search again by starting letters
762
- setTimeout(function(){ filterQuery = []; }, 1000);
763
- };
762
+ // Automaticaly clean filter query so user can search again by starting letters
763
+ setTimeout(function () {
764
+ filterQuery = [];
765
+ }, 1000);
766
+ };
764
767
 
765
768
  $newSelect.on('keydown', onKeyDown);
766
769
  });
@@ -800,5 +803,4 @@
800
803
  select.siblings('input.select-dropdown').val(value);
801
804
  }
802
805
  };
803
-
804
- }( jQuery ));
806
+ })(jQuery);