materialize-sass 1.0.0.beta → 1.0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -0
  3. data/README.md +2 -2
  4. data/Rakefile +1 -1
  5. data/assets/javascripts/materialize/autocomplete.js +94 -37
  6. data/assets/javascripts/materialize/buttons.js +4 -6
  7. data/assets/javascripts/materialize/carousel.js +9 -9
  8. data/assets/javascripts/materialize/chips.js +2 -2
  9. data/assets/javascripts/materialize/collapsible.js +13 -10
  10. data/assets/javascripts/materialize/datepicker.js +27 -44
  11. data/assets/javascripts/materialize/dropdown.js +38 -15
  12. data/assets/javascripts/materialize/extras/nouislider.js +1 -1
  13. data/assets/javascripts/materialize/extras/nouislider.min.js +1 -1
  14. data/assets/javascripts/materialize/forms.js +7 -8
  15. data/assets/javascripts/materialize/global.js +28 -11
  16. data/assets/javascripts/materialize/materialbox.js +12 -7
  17. data/assets/javascripts/materialize/modal.js +8 -4
  18. data/assets/javascripts/materialize/parallax.js +1 -1
  19. data/assets/javascripts/materialize/pushpin.js +8 -3
  20. data/assets/javascripts/materialize/range.js +2 -19
  21. data/assets/javascripts/materialize/select.js +57 -33
  22. data/assets/javascripts/materialize/sidenav.js +5 -3
  23. data/assets/javascripts/materialize/slider.js +2 -1
  24. data/assets/javascripts/materialize/tabs.js +13 -8
  25. data/assets/javascripts/materialize/timepicker.js +22 -5
  26. data/assets/javascripts/materialize/toasts.js +4 -3
  27. data/assets/javascripts/materialize/tooltip.js +14 -8
  28. data/assets/javascripts/materialize.js +804 -685
  29. data/assets/stylesheets/materialize/components/_buttons.scss +2 -1
  30. data/assets/stylesheets/materialize/components/_collapsible.scss +8 -1
  31. data/assets/stylesheets/materialize/components/_datepicker.scss +5 -1
  32. data/assets/stylesheets/materialize/components/_dropdown.scss +10 -1
  33. data/assets/stylesheets/materialize/components/_global.scss +2 -0
  34. data/assets/stylesheets/materialize/components/_modal.scss +4 -0
  35. data/assets/stylesheets/materialize/components/_sidenav.scss +9 -17
  36. data/assets/stylesheets/materialize/components/_toast.scss +0 -1
  37. data/assets/stylesheets/materialize/components/_variables.scss +1 -0
  38. data/assets/stylesheets/materialize/components/forms/_input-fields.scss +2 -0
  39. data/assets/stylesheets/materialize/components/forms/_range.scss +3 -3
  40. data/assets/stylesheets/materialize/components/forms/_select.scss +19 -7
  41. data/assets/stylesheets/materialize/extras/nouislider.css +1 -1
  42. data/lib/materialize-sass/engine.rb +4 -1
  43. data/lib/materialize-sass/version.rb +1 -1
  44. data/lib/materialize-sass.rb +3 -8
  45. data/materialize-sass.gemspec +4 -5
  46. metadata +18 -32
@@ -12,6 +12,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
12
12
  'use strict';
13
13
 
14
14
  var _defaults = {
15
+ // Close when date is selected
16
+ autoClose: false,
15
17
 
16
18
  // the default output format for the input field value
17
19
  format: 'mmm dd, yyyy',
@@ -129,14 +131,13 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
129
131
 
130
132
  if (!_this.options.defaultDate) {
131
133
  _this.options.defaultDate = new Date(Date.parse(_this.el.value));
132
- _this.options.setDefaultDate = true;
133
134
  }
134
135
 
135
136
  var defDate = _this.options.defaultDate;
136
-
137
137
  if (Datepicker._isDate(defDate)) {
138
138
  if (_this.options.setDefaultDate) {
139
139
  _this.setDate(defDate, true);
140
+ _this.setInputValue();
140
141
  } else {
141
142
  _this.gotoDate(defDate);
142
143
  }
@@ -149,7 +150,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
149
150
  * @type {Boolean}
150
151
  */
151
152
  _this.isOpen = false;
152
-
153
153
  return _this;
154
154
  }
155
155
 
@@ -170,11 +170,11 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
170
170
  }, {
171
171
  key: 'destroySelects',
172
172
  value: function destroySelects() {
173
- var oldYearSelect = this.calendarEl.querySelector('.pika-select-year');
173
+ var oldYearSelect = this.calendarEl.querySelector('.orig-select-year');
174
174
  if (oldYearSelect) {
175
175
  M.FormSelect.getInstance(oldYearSelect).destroy();
176
176
  }
177
- var oldMonthSelect = this.calendarEl.querySelector('.pika-select-month');
177
+ var oldMonthSelect = this.calendarEl.querySelector('.orig-select-month');
178
178
  if (oldMonthSelect) {
179
179
  M.FormSelect.getInstance(oldMonthSelect).destroy();
180
180
  }
@@ -309,9 +309,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
309
309
  month: date.getMonth(),
310
310
  year: date.getFullYear()
311
311
  }];
312
- // if (this.options.mainCalendar === 'right') {
313
- // this.calendars[0].month += 1 - this.options.numberOfMonths;
314
- // }
315
312
  }
316
313
 
317
314
  this.adjustCalendars();
@@ -320,12 +317,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
320
317
  key: 'adjustCalendars',
321
318
  value: function adjustCalendars() {
322
319
  this.calendars[0] = this.adjustCalendar(this.calendars[0]);
323
- // for (let c = 1; c < this.options.numberOfMonths; c++) {
324
- // this.calendars[c] = this.adjustCalendar({
325
- // month: this.calendars[0].month + c,
326
- // year: this.calendars[0].year
327
- // });
328
- // }
329
320
  this.draw();
330
321
  }
331
322
  }, {
@@ -469,12 +460,12 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
469
460
  if (opts.isEndRange) {
470
461
  arr.push('is-endrange');
471
462
  }
472
- return '<td data-day="' + opts.day + '" class="' + arr.join(' ') + '" aria-selected="' + ariaSelected + '">' + '<button class="datepicker-day-button" type="button" ' + 'data-pika-year="' + opts.year + '" data-pika-month="' + opts.month + '" data-pika-day="' + opts.day + '">' + opts.day + '</button>' + '</td>';
463
+ return '<td data-day="' + opts.day + '" class="' + arr.join(' ') + '" aria-selected="' + ariaSelected + '">' + ('<button class="datepicker-day-button" type="button" data-year="' + opts.year + '" data-month="' + opts.month + '" data-day="' + opts.day + '">' + opts.day + '</button>') + '</td>';
473
464
  }
474
465
  }, {
475
466
  key: 'renderRow',
476
467
  value: function renderRow(days, isRTL, isRowSelected) {
477
- return '<tr class="pika-row' + (isRowSelected ? ' is-selected' : '') + '">' + (isRTL ? days.reverse() : days).join('') + '</tr>';
468
+ return '<tr class="datepicker-row' + (isRowSelected ? ' is-selected' : '') + '">' + (isRTL ? days.reverse() : days).join('') + '</tr>';
478
469
  }
479
470
  }, {
480
471
  key: 'renderTable',
@@ -515,7 +506,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
515
506
  arr.push('<option value="' + (year === refYear ? i - c : 12 + i - c) + '"' + (i === month ? ' selected="selected"' : '') + (isMinYear && i < opts.minMonth || isMaxYear && i > opts.maxMonth ? 'disabled="disabled"' : '') + '>' + opts.i18n.months[i] + '</option>');
516
507
  }
517
508
 
518
- monthHtml = '<select class="pika-select pika-select-month" tabindex="-1">' + arr.join('') + '</select>';
509
+ monthHtml = '<select class="datepicker-select orig-select-month" tabindex="-1">' + arr.join('') + '</select>';
519
510
 
520
511
  if ($.isArray(opts.yearRange)) {
521
512
  i = opts.yearRange[0];
@@ -527,11 +518,11 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
527
518
 
528
519
  for (arr = []; i < j && i <= opts.maxYear; i++) {
529
520
  if (i >= opts.minYear) {
530
- arr.push('<option value="' + i + '"' + (i === year ? ' selected="selected"' : '') + '>' + i + '</option>');
521
+ arr.push('<option value="' + i + '" ' + (i === year ? 'selected="selected"' : '') + '>' + i + '</option>');
531
522
  }
532
523
  }
533
524
 
534
- yearHtml = '<select class="pika-select pika-select-year" tabindex="-1">' + arr.join('') + '</select>';
525
+ yearHtml = '<select class="datepicker-select orig-select-year" tabindex="-1">' + arr.join('') + '</select>';
535
526
 
536
527
  var leftArrow = '<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg>';
537
528
  html += '<button class="month-prev' + (prev ? '' : ' is-disabled') + '" type="button">' + leftArrow + '</button>';
@@ -552,10 +543,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
552
543
  next = false;
553
544
  }
554
545
 
555
- // if (c === (this.options.numberOfMonths - 1) ) {
556
546
  var rightArrow = '<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"/><path d="M0-.25h24v24H0z" fill="none"/></svg>';
557
547
  html += '<button class="month-next' + (next ? '' : ' is-disabled') + '" type="button">' + rightArrow + '</button>';
558
- // }
559
548
 
560
549
  return html += '</div>';
561
550
  }
@@ -591,7 +580,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
591
580
  }
592
581
  }
593
582
 
594
- randId = 'pika-title-' + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 2);
583
+ randId = 'datepicker-title-' + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 2);
595
584
 
596
585
  for (var c = 0; c < 1; c++) {
597
586
  this._renderDateDisplay();
@@ -603,10 +592,16 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
603
592
  this.calendarEl.innerHTML = html;
604
593
 
605
594
  // Init Materialize Select
606
- var yearSelect = this.calendarEl.querySelector('.pika-select-year');
607
- var monthSelect = this.calendarEl.querySelector('.pika-select-month');
608
- M.FormSelect.init(yearSelect, { classes: 'select-year', dropdownOptions: { container: document.body, constrainWidth: false } });
609
- M.FormSelect.init(monthSelect, { classes: 'select-month', dropdownOptions: { container: document.body, constrainWidth: false } });
595
+ var yearSelect = this.calendarEl.querySelector('.orig-select-year');
596
+ var monthSelect = this.calendarEl.querySelector('.orig-select-month');
597
+ M.FormSelect.init(yearSelect, {
598
+ classes: 'select-year',
599
+ dropdownOptions: { container: document.body, constrainWidth: false }
600
+ });
601
+ M.FormSelect.init(monthSelect, {
602
+ classes: 'select-month',
603
+ dropdownOptions: { container: document.body, constrainWidth: false }
604
+ });
610
605
 
611
606
  // Add change handlers for select
612
607
  yearSelect.addEventListener('change', this._handleYearChange.bind(this));
@@ -652,7 +647,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
652
647
  this.$modalEl = $(Datepicker._template);
653
648
  this.modalEl = this.$modalEl[0];
654
649
 
655
- this.calendarEl = this.modalEl.querySelector('.pika-single');
650
+ this.calendarEl = this.modalEl.querySelector('.datepicker-calendar');
656
651
 
657
652
  this.yearTextEl = this.modalEl.querySelector('.year-text');
658
653
  this.dateTextEl = this.modalEl.querySelector('.date-text');
@@ -663,7 +658,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
663
658
  this.cancelBtn = this.modalEl.querySelector('.datepicker-cancel');
664
659
 
665
660
  this.formats = {
666
-
667
661
  d: function () {
668
662
  return _this4.date.getDate();
669
663
  },
@@ -734,24 +728,16 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
734
728
  var $target = $(e.target);
735
729
  if (!$target.hasClass('is-disabled')) {
736
730
  if ($target.hasClass('datepicker-day-button') && !$target.hasClass('is-empty') && !$target.parent().hasClass('is-disabled')) {
737
- this.setDate(new Date(e.target.getAttribute('data-pika-year'), e.target.getAttribute('data-pika-month'), e.target.getAttribute('data-pika-day')));
731
+ this.setDate(new Date(e.target.getAttribute('data-year'), e.target.getAttribute('data-month'), e.target.getAttribute('data-day')));
732
+ if (this.options.autoClose) {
733
+ this._finishSelection();
734
+ }
738
735
  } else if ($target.closest('.month-prev').length) {
739
736
  this.prevMonth();
740
737
  } else if ($target.closest('.month-next').length) {
741
738
  this.nextMonth();
742
739
  }
743
740
  }
744
- // if (!$target.hasClass('pika-select')) {
745
- // // if this is touch event prevent mouse events emulation
746
- // // if (e.preventDefault) {
747
- // // e.preventDefault();
748
- // // } else {
749
- // // e.returnValue = false;
750
- // // return false;
751
- // // }
752
- // } else {
753
- // this._c = true;
754
- // }
755
741
  }
756
742
  }, {
757
743
  key: '_handleClearClick',
@@ -814,9 +800,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
814
800
  if (Datepicker._isDate(date)) {
815
801
  this.setDate(date);
816
802
  }
817
- // if (!self._v) {
818
- // self.show();
819
- // }
820
803
  }
821
804
  }, {
822
805
  key: 'renderDayName',
@@ -942,7 +925,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
942
925
  return Datepicker;
943
926
  }(Component);
944
927
 
945
- Datepicker._template = ['<div class= "modal datepicker-modal">', '<div class="modal-content datepicker-container">', '<div class="datepicker-date-display">', '<span class="year-text"></span>', '<span class="date-text"></span>', '</div>', '<div class="datepicker-calendar-container">', '<div class="pika-single"></div>', '<div class="datepicker-footer">', '<button class="btn-flat datepicker-clear waves-effect" style="visibility: hidden;" type="button"></button>', '<div class="confirmation-btns">', '<button class="btn-flat datepicker-cancel waves-effect" type="button"></button>', '<button class="btn-flat datepicker-done waves-effect" type="button"></button>', '</div>', '</div>', '</div>', '</div>', '</div>'].join('');
928
+ Datepicker._template = ['<div class= "modal datepicker-modal">', '<div class="modal-content datepicker-container">', '<div class="datepicker-date-display">', '<span class="year-text"></span>', '<span class="date-text"></span>', '</div>', '<div class="datepicker-calendar-container">', '<div class="datepicker-calendar"></div>', '<div class="datepicker-footer">', '<button class="btn-flat datepicker-clear waves-effect" style="visibility: hidden;" type="button"></button>', '<div class="confirmation-btns">', '<button class="btn-flat datepicker-cancel waves-effect" type="button"></button>', '<button class="btn-flat datepicker-done waves-effect" type="button"></button>', '</div>', '</div>', '</div>', '</div>', '</div>'].join('');
946
929
 
947
930
  M.Datepicker = Datepicker;
948
931
 
@@ -24,7 +24,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
24
24
  onOpenStart: null,
25
25
  onOpenEnd: null,
26
26
  onCloseStart: null,
27
- onCloseEnd: null
27
+ onCloseEnd: null,
28
+ onItemClick: null
28
29
  };
29
30
 
30
31
  /**
@@ -97,6 +98,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
97
98
  _this._resetFilterQueryBound = _this._resetFilterQuery.bind(_this);
98
99
  _this._handleDocumentClickBound = _this._handleDocumentClick.bind(_this);
99
100
  _this._handleDocumentTouchmoveBound = _this._handleDocumentTouchmove.bind(_this);
101
+ _this._handleDropdownClickBound = _this._handleDropdownClick.bind(_this);
100
102
  _this._handleDropdownKeydownBound = _this._handleDropdownKeydown.bind(_this);
101
103
  _this._handleTriggerKeydownBound = _this._handleTriggerKeydown.bind(_this);
102
104
  _this._setupEventHandlers();
@@ -127,6 +129,9 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
127
129
  // Trigger keydown handler
128
130
  this.el.addEventListener('keydown', this._handleTriggerKeydownBound);
129
131
 
132
+ // Item click handler
133
+ this.dropdownEl.addEventListener('click', this._handleDropdownClickBound);
134
+
130
135
  // Hover event handlers
131
136
  if (this.options.hover) {
132
137
  this._handleMouseEnterBound = this._handleMouseEnter.bind(this);
@@ -149,13 +154,13 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
149
154
  }, {
150
155
  key: '_removeEventHandlers',
151
156
  value: function _removeEventHandlers() {
152
- // Trigger keydown handler
153
157
  this.el.removeEventListener('keydown', this._handleTriggerKeydownBound);
158
+ this.dropdownEl.removeEventListener('click', this._handleDropdownClickBound);
154
159
 
155
160
  if (this.options.hover) {
156
- this.el.removeEventHandlers('mouseenter', this._handleMouseEnterBound);
157
- this.el.removeEventHandlers('mouseleave', this._handleMouseLeaveBound);
158
- this.dropdownEl.removeEventHandlers('mouseleave', this._handleMouseLeaveBound);
161
+ this.el.removeEventListener('mouseenter', this._handleMouseEnterBound);
162
+ this.el.removeEventListener('mouseleave', this._handleMouseLeaveBound);
163
+ this.dropdownEl.removeEventListener('mouseleave', this._handleMouseLeaveBound);
159
164
  } else {
160
165
  this.el.removeEventListener('click', this._handleClickBound);
161
166
  }
@@ -248,6 +253,21 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
248
253
  }
249
254
  }
250
255
 
256
+ /**
257
+ * Handle Dropdown Click
258
+ * @param {Event} e
259
+ */
260
+
261
+ }, {
262
+ key: '_handleDropdownClick',
263
+ value: function _handleDropdownClick(e) {
264
+ // onItemClick callback
265
+ if (typeof this.options.onItemClick === 'function') {
266
+ var itemEl = $(e.target).closest('li')[0];
267
+ this.options.onItemClick.call(this, itemEl);
268
+ }
269
+ }
270
+
251
271
  /**
252
272
  * Handle Dropdown Keydown
253
273
  * @param {Event} e
@@ -287,7 +307,11 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
287
307
  var $activatableElement = $(focusedElement).find('a, button').first();
288
308
 
289
309
  // Click a or button tag if exists, otherwise click li tag
290
- !!$activatableElement.length ? $activatableElement[0].click() : focusedElement.click();
310
+ if (!!$activatableElement.length) {
311
+ $activatableElement[0].click();
312
+ } else if (!!focusedElement) {
313
+ focusedElement.click();
314
+ }
291
315
 
292
316
  // Close dropdown on ESC
293
317
  } else if (e.which === M.keys.ESC && this.isOpen) {
@@ -378,7 +402,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
378
402
  };
379
403
 
380
404
  // Countainer here will be closest ancestor with overflow: hidden
381
- var closestOverflowParent = this.dropdownEl.offsetParent;
405
+ var closestOverflowParent = !!this.dropdownEl.offsetParent ? this.dropdownEl.offsetParent : this.dropdownEl.parentNode;
406
+
382
407
  var alignments = M.checkPossibleAlignments(this.el, closestOverflowParent, dropdownBounds, this.options.coverTrigger ? 0 : triggerBRect.height);
383
408
 
384
409
  var verticalAlignment = 'top';
@@ -455,8 +480,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
455
480
  value: [0, 1],
456
481
  easing: 'easeOutQuad'
457
482
  },
458
- scaleX: [.3, 1],
459
- scaleY: [.3, 1],
483
+ scaleX: [0.3, 1],
484
+ scaleY: [0.3, 1],
460
485
  duration: this.options.inDuration,
461
486
  easing: 'easeOutQuint',
462
487
  complete: function (anim) {
@@ -466,8 +491,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
466
491
 
467
492
  // onOpenEnd callback
468
493
  if (typeof _this3.options.onOpenEnd === 'function') {
469
- var elem = anim.animatables[0].target;
470
- _this3.options.onOpenEnd.call(elem, _this3.el);
494
+ _this3.options.onOpenEnd.call(_this3, _this3.el);
471
495
  }
472
496
  }
473
497
  });
@@ -489,8 +513,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
489
513
  value: 0,
490
514
  easing: 'easeOutQuint'
491
515
  },
492
- scaleX: .3,
493
- scaleY: .3,
516
+ scaleX: 0.3,
517
+ scaleY: 0.3,
494
518
  duration: this.options.outDuration,
495
519
  easing: 'easeOutQuint',
496
520
  complete: function (anim) {
@@ -498,7 +522,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
498
522
 
499
523
  // onCloseEnd callback
500
524
  if (typeof _this4.options.onCloseEnd === 'function') {
501
- var elem = anim.animatables[0].target;
502
525
  _this4.options.onCloseEnd.call(_this4, _this4.el);
503
526
  }
504
527
  }
@@ -628,7 +651,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
628
651
 
629
652
  Dropdown._dropdowns = [];
630
653
 
631
- window.M.Dropdown = Dropdown;
654
+ M.Dropdown = Dropdown;
632
655
 
633
656
  if (M.jQueryLoaded) {
634
657
  M.initializeJqueryWrapper(Dropdown, 'dropdown', 'M_Dropdown');
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Materialize v1.0.0-alpha.4 (http://materializecss.com)
2
+ * Materialize 1.0.0 (http://materializecss.com)
3
3
  * Copyright 2014-2015 Materialize
4
4
  * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
5
5
  */
@@ -1 +1 @@
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],void 0===(i=t[r])?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
+ !function(){function h(t){return t.split("").reverse().join("")}function o(t,e,n){if((t[e]||t[n])&&t[e]===t[n])throw Error(e)}function n(t,e,n,r,i,o,s,a,l,u,c,p){s=p;var f,d=c="";return o&&(p=o(p)),!("number"!=typeof p||!isFinite(p))&&(t&&0===parseFloat(p.toFixed(t))&&(p=0),p<0&&(f=!0,p=Math.abs(p)),t&&(o=Math.pow(10,t),p=(Math.round(p*o)/o).toFixed(t)),-1!==(p=p.toString()).indexOf(".")&&(p=(t=p.split("."))[0],n&&(c=n+t[1])),e&&(p=h((p=h(p).match(/.{1,3}/g)).join(h(e)))),f&&a&&(d+=a),r&&(d+=r),f&&l&&(d+=l),d=d+p+c,i&&(d+=i),u&&(d=u(d,s)),d)}function r(t,e,n,r,i,o,s,a,l,u,c,p){var f;return t="",c&&(p=c(p)),!(!p||"string"!=typeof p)&&(a&&p.substring(0,a.length)===a&&(p=p.replace(a,""),f=!0),r&&p.substring(0,r.length)===r&&(p=p.replace(r,"")),l&&p.substring(0,l.length)===l&&(p=p.replace(l,""),f=!0),i&&p.slice(-1*i.length)===i&&(p=p.slice(0,-1*i.length)),e&&(p=p.split(e).join("")),n&&(p=p.replace(n,".")),f&&(t+="-"),t=Number((t+p).replace(/[^0-9\.\-.]/g,"")),s&&(t=s(t)),!("number"!=typeof t||!isFinite(t))&&t)}function i(t,e,n){var r,i=[];for(r=0;r<s.length;r+=1)i.push(t[s[r]]);return i.push(n),e.apply("",i)}var s="decimals thousand mark prefix postfix encoder decoder negativeBefore negative edit undo".split(" ");window.wNumb=function t(e){if(!(this instanceof t))return new t(e);"object"==typeof e&&(e=function(t){var e,n,r,i={};for(e=0;e<s.length;e+=1)void 0===(r=t[n=s[e]])?i[n]="negative"!==n||i.negativeBefore?"mark"===n&&"."!==i.thousand&&".":"-":"decimals"===n?0<r&&r<8&&(i[n]=r):"encoder"===n||"decoder"===n||"edit"===n||"undo"===n?"function"==typeof r&&(i[n]=r):"string"==typeof r&&(i[n]=r);return o(i,"mark","thousand"),o(i,"prefix","negative"),o(i,"prefix","negativeBefore"),i}(e),this.to=function(t){return i(e,n,t)},this.from=function(t){return i(e,r,t)})}}(),function(t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():window.noUiSlider=t()}(function(){"use strict";function B(t,e){var n=document.createElement("div");return I(n,e),t.appendChild(n),n}function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function X(t,e,n){0<n&&(I(t,e),setTimeout(function(){_(t,e)},n))}function Y(t){return Array.isArray(t)?t:[t]}function e(t){var e=(t=String(t)).split(".");return 1<e.length?e[1].length:0}function I(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function _(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function W(){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 c(t,e){return 100/(e-t)}function p(t,e){return 100*e/(t[1]-t[0])}function f(t,e){for(var n=1;t>=e[n];)n+=1;return n}function n(t,e,n){if(n>=t.slice(-1)[0])return 100;var r,i,o,s,a,l,u=f(n,t);return r=t[u-1],i=t[u],o=e[u-1],s=e[u],o+(l=n,p(a=[r,i],a[0]<0?l+Math.abs(a[0]):l-a[0])/c(o,s))}function r(t,e,n,r){if(100===r)return r;var i,o,s,a,l=f(r,t);return n?(i=t[l-1],((o=t[l])-i)/2<r-i?o:i):e[l-1]?t[l-1]+(s=r-t[l-1],a=e[l-1],Math.round(s/a)*a):r}function s(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(!i(r="min"===t?0:"max"===t?100:parseFloat(t))||!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 a(t,e,n){if(!e)return!0;n.xSteps[t]=p([n.xVal[t],n.xVal[t+1]],e)/c(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 o(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++)s(o[i][1],o[i][0],this);for(this.xNumSteps=this.xSteps.slice(0),i=0;i<this.xNumSteps.length;i++)a(i,this.xNumSteps[i],this)}o.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&&p(this.xVal,t)},o.prototype.toStepping=function(t){return t=n(this.xVal,this.xPct,t)},o.prototype.fromStepping=function(t){return function(t,e,n){if(100<=n)return t.slice(-1)[0];var r,i,o,s,a,l=f(n,e);return r=t[l-1],i=t[l],o=e[l-1],s=e[l],a=[r,i],(n-o)*c(o,s)*(a[1]-a[0])/100+a[0]}(this.xVal,this.xPct,t)},o.prototype.getStep=function(t){return t=r(this.xPct,this.xSteps,this.snap,t)},o.prototype.getNearbySteps=function(t){var e=f(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]}}},o.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(e);return Math.max.apply(null,t)},o.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var l={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};function u(t,e){if(!i(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function d(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 o(e,t.snap,t.dir,t.singleStep)}function h(t,e){if(e=Y(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function m(t,e){if("boolean"!=typeof(t.snap=e))throw new Error("noUiSlider: 'snap' option must be a boolean.")}function g(t,e){if("boolean"!=typeof(t.animate=e))throw new Error("noUiSlider: 'animate' option must be a boolean.")}function v(t,e){if("number"!=typeof(t.animationDuration=e))throw new Error("noUiSlider: 'animationDuration' option must be a number.")}function b(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 w(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 S(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 x(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 y(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(50<=t.padding)throw new Error("noUiSlider: 'padding' option must be less than half the range.")}}function E(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 C(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var n=0<=e.indexOf("tap"),r=0<=e.indexOf("drag"),i=0<=e.indexOf("fixed"),o=0<=e.indexOf("snap"),s=0<=e.indexOf("hover");if(i){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");S(t,t.start[1]-t.start[0])}t.events={tap:n||o,drag:r,fixed:i,snap:o,hover:s}}function N(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=Y(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 U(t,e){if("function"==typeof(t.format=e).to&&"function"==typeof e.from)return!0;throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.")}function M(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 P(t,e){if(void 0!==e&&"object"!=typeof e)throw new Error("noUiSlider: 'cssClasses' must be an object.");if("string"==typeof t.cssPrefix)for(var n in t.cssClasses={},e)e.hasOwnProperty(n)&&(t.cssClasses[n]=t.cssPrefix+e[n]);else t.cssClasses=e}function k(t,e){if(!0!==e&&!1!==e)throw new Error("noUiSlider: 'useRequestAnimationFrame' option should be true (default) or false.");t.useRequestAnimationFrame=e}function $(e){var n={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,format:l},r={step:{r:!1,t:u},start:{r:!0,t:h},connect:{r:!0,t:b},direction:{r:!0,t:E},snap:{r:!1,t:m},animate:{r:!1,t:g},animationDuration:{r:!1,t:v},range:{r:!0,t:d},orientation:{r:!1,t:w},margin:{r:!1,t:S},limit:{r:!1,t:x},padding:{r:!1,t:y},behaviour:{r:!0,t:C},format:{r:!1,t:U},tooltips:{r:!1,t:N},cssPrefix:{r:!1,t:M},cssClasses:{r:!1,t:P},useRequestAnimationFrame:{r:!1,t:k}},i={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(r).forEach(function(t){if(void 0===e[t]&&void 0===i[t]){if(r[t].r)throw new Error("noUiSlider: '"+t+"' is required.");return!0}r[t].t(n,void 0===e[t]?i[t]:e[t])}),n.pips=e.pips;var t=[["left","top"],["right","bottom"]];return n.style=t[n.dir][n.ort],n.styleOposite=t[n.dir?0:1][n.ort],n}function O(t,f,o){var a,l,s,u,e,c,i,p=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"},S=t,d=[],h=[],m=!1,x=f.spectrum,g=[],v={};function b(t,e){return!!e&&B(t,f.cssClasses.connect)}function n(t,e){return!!f.tooltips[e]&&B(t.firstChild,f.cssClasses.tooltip)}function y(r,i,o){var t=document.createElement("div"),s="",a=[f.cssClasses.valueNormal,f.cssClasses.valueLarge,f.cssClasses.valueSub],l=[f.cssClasses.markerNormal,f.cssClasses.markerLarge,f.cssClasses.markerSub],u=[f.cssClasses.valueHorizontal,f.cssClasses.valueVertical],c=[f.cssClasses.markerHorizontal,f.cssClasses.markerVertical];function p(t,e,n){return'class="'+(r=n[1],o=(i=e)===f.cssClasses.value,s=o?a:l,i+" "+(o?u:c)[f.ort]+" "+s[r])+'" style="'+f.style+": "+t+'%"';var r,i,o,s}return I(t,f.cssClasses.pips),I(t,0===f.ort?f.cssClasses.pipsHorizontal:f.cssClasses.pipsVertical),Object.keys(r).forEach(function(t){var e,n;(n=r[e=t])[1]=n[1]&&i?i(n[0],n[1]):n[1],s+="<div "+p(e,f.cssClasses.marker,n)+"></div>",n[1]&&(s+="<div "+p(e,f.cssClasses.value,n)+">"+o.to(n[0])+"</div>")}),t.innerHTML=s,t}function r(t){var d,h,m,g,e,n,v,b,w,r=t.mode,i=t.density||1,o=t.filter||!1,s=function(t,e,n){if("range"===t||"steps"===t)return x.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 x.fromStepping(n?x.getStep(t):t)}):"values"===t?n?e.map(function(t){return x.fromStepping(x.getStep(x.toStepping(t)))}):e:void 0}(r,t.values||!1,t.stepped||!1),a=(d=i,h=r,m=s,g={},e=x.xVal[0],n=x.xVal[x.xVal.length-1],b=v=!1,w=0,(m=m.slice().sort(function(t,e){return t-e}).filter(function(t){return!this[t]&&(this[t]=!0)},{}))[0]!==e&&(m.unshift(e),v=!0),m[m.length-1]!==n&&(m.push(n),b=!0),m.forEach(function(t,e){var n,r,i,o,s,a,l,u,c,p=t,f=m[e+1];if("steps"===h&&(n=x.xNumSteps[e]),n||(n=f-p),!1!==p&&void 0!==f)for(n=Math.max(n,1e-7),r=p;r<=f;r=(r+n).toFixed(7)/1){for(l=(s=(o=x.toStepping(r))-w)/d,c=s/(u=Math.round(l)),i=1;i<=u;i+=1)g[(w+i*c).toFixed(5)]=["x",0];a=-1<m.indexOf(r)?1:"steps"===h?2:0,!e&&v&&(a=0),r===f&&b||(g[o.toFixed(5)]=[r,a]),w=o}}),g),l=t.format||{to:Math.round};return S.appendChild(y(a,o,l))}function w(){var t=a.getBoundingClientRect(),e="offset"+["Width","Height"][f.ort];return 0===f.ort?t.width||a[e]:t.height||a[e]}function E(r,e,i,o){var n=function(t){return!S.hasAttribute("disabled")&&(e=S,n=f.cssClasses.tap,(e.classList?!e.classList.contains(n):!new RegExp("\\b"+n+"\\b").test(e.className))&&(!!(t=function(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");0===t.type.indexOf("MSPointer")&&(s=!0);if(i){if(1<t.touches.length)return!1;n=t.changedTouches[0].pageX,r=t.changedTouches[0].pageY}e=e||W(),(o||s)&&(n=t.clientX+e.x,r=t.clientY+e.y);return t.pageOffset=e,t.points=[n,r],t.cursor=o||s,t}(t,o.pageOffset))&&(!(r===p.start&&void 0!==t.buttons&&1<t.buttons)&&((!o.hover||!t.buttons)&&(t.calcPoint=t.points[f.ort],void i(t,o))))));var e,n},s=[];return r.split(" ").forEach(function(t){e.addEventListener(t,n,!1),s.push([t,n])}),s}function C(t){var e,n,r,i,o,s=100*(t-(e=a,n=f.ort,r=e.getBoundingClientRect(),i=e.ownerDocument.documentElement,o=W(),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(o.x=0),n?r.top+o.y-i.clientTop:r.left+o.x-i.clientLeft))/w();return f.dir?100-s:s}function N(t,r,n,e){var i=n.slice(),o=[!t,t],s=[t,!t];e=e.slice(),t&&e.reverse(),1<e.length?e.forEach(function(t,e){var n=L(i,t,i[t]+r,o[e],s[e]);!1===n?r=0:(r=n-i[t],i[t]=n)}):o=s=[!0];var a=!1;e.forEach(function(t,e){a=z(t,n[t]+r,o[e],s[e])||a}),a&&e.forEach(function(t){U("update",t),U("slide",t)})}function U(n,r,i){Object.keys(v).forEach(function(t){var e=t.split(".")[0];n===e&&v[t].forEach(function(t){t.call(u,g.map(f.format.to),r,g.slice(),i||!1,d.slice())})})}function M(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&k(t,e)}function P(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return k(t,e);var n=(f.dir?-1:1)*(t.calcPoint-e.startCalcPoint);N(0<n,100*n/e.baseSize,e.locations,e.handleNumbers)}function k(t,e){m&&(_(m,f.cssClasses.active),m=!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])}),_(S,f.cssClasses.drag),j(),e.handleNumbers.forEach(function(t){U("set",t),U("change",t),U("end",t)})}function O(t,e){if(1===e.handleNumbers.length){var n=l[e.handleNumbers[0]];if(n.hasAttribute("disabled"))return!1;I(m=n.children[0],f.cssClasses.active)}t.preventDefault(),t.stopPropagation();var r=E(p.move,document.documentElement,P,{startCalcPoint:t.calcPoint,baseSize:w(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:d.slice()}),i=E(p.end,document.documentElement,k,{handleNumbers:e.handleNumbers}),o=E("mouseout",document.documentElement,M,{handleNumbers:e.handleNumbers});if(document.documentElement.noUiListeners=r.concat(i,o),t.cursor){document.body.style.cursor=getComputedStyle(t.target).cursor,1<l.length&&I(S,f.cssClasses.drag);var s=function(){return!1};document.body.noUiListener=s,document.body.addEventListener("selectstart",s,!1)}e.handleNumbers.forEach(function(t){U("start",t)})}function V(t){t.stopPropagation();var r,i,o,e=C(t.calcPoint),n=(r=e,o=!(i=100),l.forEach(function(t,e){if(!t.hasAttribute("disabled")){var n=Math.abs(d[e]-r);n<i&&(o=e,i=n)}}),o);if(!1===n)return!1;f.events.snap||X(S,f.cssClasses.tap,f.animationDuration),z(n,e,!0,!0),j(),U("slide",n,!0),U("set",n,!0),U("change",n,!0),U("update",n,!0),f.events.snap&&O(t,{handleNumbers:[n]})}function A(t){var e=C(t.calcPoint),n=x.getStep(e),r=x.fromStepping(n);Object.keys(v).forEach(function(t){"hover"===t.split(".")[0]&&v[t].forEach(function(t){t.call(u,r)})})}function L(t,e,n,r,i){var o;return 1<l.length&&(r&&0<e&&(n=Math.max(n,t[e-1]+f.margin)),i&&e<l.length-1&&(n=Math.min(n,t[e+1]-f.margin))),1<l.length&&f.limit&&(r&&0<e&&(n=Math.min(n,t[e-1]+f.limit)),i&&e<l.length-1&&(n=Math.max(n,t[e+1]-f.limit))),f.padding&&(0===e&&(n=Math.max(n,f.padding)),e===l.length-1&&(n=Math.min(n,100-f.padding))),n=x.getStep(n),o=n,(n=Math.max(Math.min(o,100),0))!==t[e]&&n}function F(t){return t+"%"}function j(){h.forEach(function(t){var e=50<d[t]?-1:1,n=3+(l.length+e*t);l[t].childNodes[0].style.zIndex=n})}function z(t,e,n,r){return!1!==(e=L(d,t,e,n,r))&&(function(t,e){d[t]=e,g[t]=x.fromStepping(e);var n=function(){l[t].style[f.style]=F(e),H(t),H(t+1)};window.requestAnimationFrame&&f.useRequestAnimationFrame?window.requestAnimationFrame(n):n()}(t,e),!0)}function H(t){if(s[t]){var e=0,n=100;0!==t&&(e=d[t-1]),t!==s.length-1&&(n=d[t]),s[t].style[f.style]=F(e),s[t].style[f.styleOposite]=F(100-n)}}function D(t,e){null!==t&&!1!==t&&("number"==typeof t&&(t=String(t)),!1===(t=f.format.from(t))||isNaN(t)||z(e,x.toStepping(t),!1,!1))}function T(t,e){var n=Y(t),r=void 0===d[0];e=void 0===e||!!e,n.forEach(D),f.animate&&!r&&X(S,f.cssClasses.tap,f.animationDuration),h.forEach(function(t){z(t,d[t],!0,!1)}),j(),h.forEach(function(t){U("update",t),null!==n[t]&&e&&U("set",t)})}function q(){var t=g.map(f.format.to);return 1===t.length?t[0]:t}function R(t,e){v[t]=v[t]||[],v[t].push(e),"update"===t.split(".")[0]&&l.forEach(function(t,e){U("update",e)})}if(S.noUiSlider)throw new Error("Slider was already initialized.");return I(e=S,f.cssClasses.target),0===f.dir?I(e,f.cssClasses.ltr):I(e,f.cssClasses.rtl),0===f.ort?I(e,f.cssClasses.horizontal):I(e,f.cssClasses.vertical),a=B(e,f.cssClasses.base),function(t,e){l=[],(s=[]).push(b(e,t[0]));for(var n=0;n<f.handles;n++)l.push((r=n,o=void 0,i=B(e,f.cssClasses.origin),B(o=B(i,f.cssClasses.handle),f.cssClasses.handleTouchArea),o.setAttribute("data-handle",r),0===r?I(o,f.cssClasses.handleLower):r===f.handles-1&&I(o,f.cssClasses.handleUpper),i)),h[n]=n,s.push(b(e,t[n+1]));var r,i,o}(f.connect,a),u={destroy:function(){for(var t in f.cssClasses)f.cssClasses.hasOwnProperty(t)&&_(S,f.cssClasses[t]);for(;S.firstChild;)S.removeChild(S.firstChild);delete S.noUiSlider},steps:function(){return d.map(function(t,e){var n=x.getNearbySteps(t),r=g[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=x.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(s))),null!==o&&!1!==o&&(o=Number(o.toFixed(s))),[o,i]})},on:R,off:function(t){var r=t&&t.split(".")[0],i=r&&t.substring(r.length);Object.keys(v).forEach(function(t){var e=t.split(".")[0],n=t.substring(e.length);r&&r!==e||i&&i!==n||delete v[t]})},get:q,set:T,reset:function(t){T(f.start,t)},__moveHandles:function(t,e,n){N(t,e,d,n)},options:o,updateOptions:function(e,t){var n=q(),r=["margin","limit","padding","range","animate","snap","step","format"];r.forEach(function(t){void 0!==e[t]&&(o[t]=e[t])});var i=$(o);r.forEach(function(t){void 0!==e[t]&&(f[t]=i[t])}),i.spectrum.direction=x.direction,x=i.spectrum,f.margin=i.margin,f.limit=i.limit,f.padding=i.padding,d=[],T(e.start||n,t)},target:S,pips:r},(c=f.events).fixed||l.forEach(function(t,e){E(p.start,t.children[0],O,{handleNumbers:[e]})}),c.tap&&E(p.start,a,V,{}),c.hover&&E(p.move,a,A,{hover:!0}),c.drag&&s.forEach(function(t,e){if(!1!==t&&0!==e&&e!==s.length-1){var n=l[e-1],r=l[e],i=[t];I(t,f.cssClasses.draggable),c.fixed&&(i.push(n.children[0]),i.push(r.children[0])),i.forEach(function(t){E(p.start,t,O,{handles:[n,r],handleNumbers:[e-1,e]})})}}),T(f.start),f.pips&&r(f.pips),f.tooltips&&(i=l.map(n),R("update",function(t,e,n){if(i[e]){var r=t[e];!0!==f.tooltips[e]&&(r=f.tooltips[e].to(n[e])),i[e].innerHTML="<span>"+r+"</span>"}})),u}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=O(t,$(e),e);return t.noUiSlider=n}}});
@@ -45,7 +45,7 @@
45
45
  }
46
46
 
47
47
  if (!$textarea.length) {
48
- console.error("No textarea element found");
48
+ console.error('No textarea element found');
49
49
  return;
50
50
  }
51
51
 
@@ -128,7 +128,7 @@
128
128
  $textarea.data('previous-length', $textarea[0].value.length);
129
129
  };
130
130
 
131
- $(document).on('ready turbolinks:load', function () {
131
+ $(document).ready(function () {
132
132
  // Text based inputs
133
133
  var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], input[type=date], input[type=time], textarea';
134
134
 
@@ -141,7 +141,7 @@
141
141
  });
142
142
 
143
143
  // Add active if input element has been pre-populated on document ready
144
- $(document).on('ready turbolinks:load', function () {
144
+ $(document).ready(function () {
145
145
  M.updateTextFields();
146
146
  });
147
147
 
@@ -161,8 +161,7 @@
161
161
  formReset.find('select').each(function () {
162
162
  // check if initialized
163
163
  if (this.M_FormSelect) {
164
- var reset_text = $(this).find('option[selected]').text();
165
- $(this).siblings('input.select-dropdown')[0].value = reset_text;
164
+ $(this).trigger('change');
166
165
  }
167
166
  });
168
167
  }, 0);
@@ -186,10 +185,10 @@
186
185
  document.addEventListener('blur', function (e) {
187
186
  var $inputElement = $(e.target);
188
187
  if ($inputElement.is(input_selector)) {
189
- var selector = ".prefix";
188
+ var selector = '.prefix';
190
189
 
191
190
  if ($inputElement[0].value.length === 0 && $inputElement[0].validity.badInput !== true && $inputElement.attr('placeholder') === null) {
192
- selector += ", label";
191
+ selector += ', label';
193
192
  }
194
193
  $inputElement.siblings(selector).removeClass('active');
195
194
  M.validate_field($inputElement);
@@ -238,7 +237,7 @@
238
237
  for (var i = 0; i < files.length; i++) {
239
238
  file_names.push(files[i].name);
240
239
  }
241
- path_input[0].value = file_names.join(", ");
240
+ path_input[0].value = file_names.join(', ');
242
241
  path_input.trigger('change');
243
242
  });
244
243
  }); // End of $(document).ready
@@ -11,8 +11,8 @@
11
11
  })(window);
12
12
 
13
13
  // AMD
14
- if (typeof define === "function" && define.amd) {
15
- define("M", [], function () {
14
+ if (typeof define === 'function' && define.amd) {
15
+ define('M', [], function () {
16
16
  return M;
17
17
  });
18
18
 
@@ -24,6 +24,8 @@ if (typeof define === "function" && define.amd) {
24
24
  exports.default = M;
25
25
  }
26
26
 
27
+ M.version = '1.0.0';
28
+
27
29
  M.keys = {
28
30
  TAB: 9,
29
31
  ENTER: 13,
@@ -36,18 +38,31 @@ M.keys = {
36
38
  * TabPress Keydown handler
37
39
  */
38
40
  M.tabPressed = false;
41
+ M.keyDown = false;
39
42
  var docHandleKeydown = function (e) {
40
- if (e.which === M.keys.TAB) {
43
+ M.keyDown = true;
44
+ if (e.which === M.keys.TAB || e.which === M.keys.ARROW_DOWN || e.which === M.keys.ARROW_UP) {
41
45
  M.tabPressed = true;
42
46
  }
43
47
  };
44
48
  var docHandleKeyup = function (e) {
45
- if (e.which === M.keys.TAB) {
49
+ M.keyDown = false;
50
+ if (e.which === M.keys.TAB || e.which === M.keys.ARROW_DOWN || e.which === M.keys.ARROW_UP) {
46
51
  M.tabPressed = false;
47
52
  }
48
53
  };
49
- document.addEventListener('keydown', docHandleKeydown);
50
- document.addEventListener('keyup', docHandleKeyup);
54
+ var docHandleFocus = function (e) {
55
+ if (M.keyDown) {
56
+ document.body.classList.add('keyboard-focused');
57
+ }
58
+ };
59
+ var docHandleBlur = function (e) {
60
+ document.body.classList.remove('keyboard-focused');
61
+ };
62
+ document.addEventListener('keydown', docHandleKeydown, true);
63
+ document.addEventListener('keyup', docHandleKeyup, true);
64
+ document.addEventListener('focus', docHandleFocus, true);
65
+ document.addEventListener('blur', docHandleBlur, true);
51
66
 
52
67
  /**
53
68
  * Initialize jQuery wrapper for plugin
@@ -80,7 +95,7 @@ M.initializeJqueryWrapper = function (plugin, pluginName, classRef) {
80
95
  }
81
96
 
82
97
  // Return error if an unrecognized method name is passed in
83
- jQuery.error("Method " + methodOrOptions + " does not exist on jQuery." + pluginName);
98
+ jQuery.error('Method ' + methodOrOptions + ' does not exist on jQuery.' + pluginName);
84
99
  };
85
100
  };
86
101
 
@@ -147,7 +162,7 @@ M.guid = function () {
147
162
  * @returns {string}
148
163
  */
149
164
  M.escapeHash = function (hash) {
150
- return hash.replace(/(:|\.|\[|\]|,|=|\/)/g, "\\$1");
165
+ return hash.replace(/(:|\.|\[|\]|,|=|\/)/g, '\\$1');
151
166
  };
152
167
 
153
168
  M.elementOrParentIsFixed = function (element) {
@@ -155,7 +170,7 @@ M.elementOrParentIsFixed = function (element) {
155
170
  var $checkElements = $element.add($element.parents());
156
171
  var isFixed = false;
157
172
  $checkElements.each(function () {
158
- if ($(this).css("position") === "fixed") {
173
+ if ($(this).css('position') === 'fixed') {
159
174
  isFixed = true;
160
175
  return false;
161
176
  }
@@ -195,6 +210,8 @@ M.checkWithinContainer = function (container, bounding, offset) {
195
210
  };
196
211
 
197
212
  var containerRect = container.getBoundingClientRect();
213
+ // If body element is smaller than viewport, use viewport height instead.
214
+ var containerBottom = container === document.body ? Math.max(containerRect.bottom, window.innerHeight) : containerRect.bottom;
198
215
 
199
216
  var scrollLeft = container.scrollLeft;
200
217
  var scrollTop = container.scrollTop;
@@ -215,7 +232,7 @@ M.checkWithinContainer = function (container, bounding, offset) {
215
232
  edges.top = true;
216
233
  }
217
234
 
218
- if (scrolledY + bounding.height > containerRect.bottom - offset || scrolledY + bounding.height > window.innerHeight - offset) {
235
+ if (scrolledY + bounding.height > containerBottom - offset || scrolledY + bounding.height > window.innerHeight - offset) {
219
236
  edges.bottom = true;
220
237
  }
221
238
 
@@ -298,7 +315,7 @@ M.getIdFromTrigger = function (trigger) {
298
315
  if (id) {
299
316
  id = id.slice(1);
300
317
  } else {
301
- id = "";
318
+ id = '';
302
319
  }
303
320
  }
304
321
  return id;