summaryrefslogtreecommitdiff
path: root/public/js/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/plugins')
-rw-r--r--public/js/plugins/bootstrap-datetimepicker.min.js37
-rw-r--r--public/js/plugins/bootstrap-selectpicker.js1914
-rw-r--r--public/js/plugins/bootstrap-switch.js744
-rw-r--r--public/js/plugins/bootstrap-tagsinput.js685
-rw-r--r--public/js/plugins/jasny-bootstrap.min.js6
-rw-r--r--public/js/plugins/moment.min.js7
-rw-r--r--public/js/plugins/nouislider.min.js3
-rw-r--r--public/js/plugins/presentation-page/jquery.sharrre.js619
-rw-r--r--public/js/plugins/presentation-page/rellax.min.js5
9 files changed, 4020 insertions, 0 deletions
diff --git a/public/js/plugins/bootstrap-datetimepicker.min.js b/public/js/plugins/bootstrap-datetimepicker.min.js
new file mode 100644
index 0000000..4e13fdd
--- /dev/null
+++ b/public/js/plugins/bootstrap-datetimepicker.min.js
@@ -0,0 +1,37 @@
+/*! version : 4.17.47
+ =========================================================
+ bootstrap-datetimejs
+ https://github.com/Eonasdan/bootstrap-datetimepicker
+ Copyright (c) 2015 Jonathan Peterson
+ =========================================================
+ */
+/*
+ The MIT License (MIT)
+
+ Copyright (c) 2015 Jonathan Peterson
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+/*global define:false */
+/*global exports:false */
+/*global require:false */
+/*global jQuery:false */
+/*global moment:false */
+
+!function(e){"use strict";if("function"==typeof define&&define.amd)define(["jquery","moment"],e);else if("object"==typeof exports)module.exports=e(require("jquery"),require("moment"));else{if("undefined"==typeof jQuery)throw"bootstrap-datetimepicker requires jQuery to be loaded first";if("undefined"==typeof moment)throw"bootstrap-datetimepicker requires Moment.js to be loaded first";e(jQuery,moment)}}(function(e,t){"use strict";if(!t)throw new Error("bootstrap-datetimepicker requires Moment.js to be loaded first");var n=function(n,a){var r,i,o,s,d,l,p,c={},u=!0,f=!1,h=!1,m=0,y=[{clsName:"days",navFnc:"M",navStep:1},{clsName:"months",navFnc:"y",navStep:1},{clsName:"years",navFnc:"y",navStep:10},{clsName:"decades",navFnc:"y",navStep:100}],b=["days","months","years","decades"],g=["top","bottom","auto"],w=["left","right","auto"],v=["default","top","bottom"],k={up:38,38:"up",down:40,40:"down",left:37,37:"left",right:39,39:"right",tab:9,9:"tab",escape:27,27:"escape",enter:13,13:"enter",pageUp:33,33:"pageUp",pageDown:34,34:"pageDown",shift:16,16:"shift",control:17,17:"control",space:32,32:"space",t:84,84:"t",delete:46,46:"delete"},D={},C=function(){return void 0!==t.tz&&void 0!==a.timeZone&&null!==a.timeZone&&""!==a.timeZone},x=function(e){var n;return n=void 0===e||null===e?t():t.isDate(e)||t.isMoment(e)?t(e):C()?t.tz(e,l,a.useStrict,a.timeZone):t(e,l,a.useStrict),C()&&n.tz(a.timeZone),n},T=function(e){if("string"!=typeof e||e.length>1)throw new TypeError("isEnabled expects a single character string parameter");switch(e){case"y":return-1!==d.indexOf("Y");case"M":return-1!==d.indexOf("M");case"d":return-1!==d.toLowerCase().indexOf("d");case"h":case"H":return-1!==d.toLowerCase().indexOf("h");case"m":return-1!==d.indexOf("m");case"s":return-1!==d.indexOf("s");default:return!1}},M=function(){return T("h")||T("m")||T("s")},S=function(){return T("y")||T("M")||T("d")},O=function(){var t=e("<thead>").append(e("<tr>").append(e("<th>").addClass("prev").attr("data-action","previous").append(e("<span>").addClass(a.icons.previous))).append(e("<th>").addClass("picker-switch").attr("data-action","pickerSwitch").attr("colspan",a.calendarWeeks?"6":"5")).append(e("<th>").addClass("next").attr("data-action","next").append(e("<span>").addClass(a.icons.next)))),n=e("<tbody>").append(e("<tr>").append(e("<td>").attr("colspan",a.calendarWeeks?"8":"7")));return[e("<div>").addClass("datepicker-days").append(e("<table>").addClass("table-condensed").append(t).append(e("<tbody>"))),e("<div>").addClass("datepicker-months").append(e("<table>").addClass("table-condensed").append(t.clone()).append(n.clone())),e("<div>").addClass("datepicker-years").append(e("<table>").addClass("table-condensed").append(t.clone()).append(n.clone())),e("<div>").addClass("datepicker-decades").append(e("<table>").addClass("table-condensed").append(t.clone()).append(n.clone()))]},P=function(){var t=e("<tr>"),n=e("<tr>"),r=e("<tr>");return T("h")&&(t.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:a.tooltips.incrementHour}).addClass("btn").attr("data-action","incrementHours").append(e("<span>").addClass(a.icons.up)))),n.append(e("<td>").append(e("<span>").addClass("timepicker-hour").attr({"data-time-component":"hours",title:a.tooltips.pickHour}).attr("data-action","showHours"))),r.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:a.tooltips.decrementHour}).addClass("btn").attr("data-action","decrementHours").append(e("<span>").addClass(a.icons.down))))),T("m")&&(T("h")&&(t.append(e("<td>").addClass("separator")),n.append(e("<td>").addClass("separator").html(":")),r.append(e("<td>").addClass("separator"))),t.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:a.tooltips.incrementMinute}).addClass("btn").attr("data-action","incrementMinutes").append(e("<span>").addClass(a.icons.up)))),n.append(e("<td>").append(e("<span>").addClass("timepicker-minute").attr({"data-time-component":"minutes",title:a.tooltips.pickMinute}).attr("data-action","showMinutes"))),r.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:a.tooltips.decrementMinute}).addClass("btn").attr("data-action","decrementMinutes").append(e("<span>").addClass(a.icons.down))))),T("s")&&(T("m")&&(t.append(e("<td>").addClass("separator")),n.append(e("<td>").addClass("separator").html(":")),r.append(e("<td>").addClass("separator"))),t.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:a.tooltips.incrementSecond}).addClass("btn btn-link").attr("data-action","incrementSeconds").append(e("<span>").addClass(a.icons.up)))),n.append(e("<td>").append(e("<span>").addClass("timepicker-second").attr({"data-time-component":"seconds",title:a.tooltips.pickSecond}).attr("data-action","showSeconds"))),r.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:a.tooltips.decrementSecond}).addClass("btn btn-link").attr("data-action","decrementSeconds").append(e("<span>").addClass(a.icons.down))))),s||(t.append(e("<td>").addClass("separator")),n.append(e("<td>").append(e("<button>").addClass("btn btn-outline-primary btn-round").attr({"data-action":"togglePeriod",tabindex:"-1",title:a.tooltips.togglePeriod}))),r.append(e("<td>").addClass("separator"))),e("<div>").addClass("timepicker-picker").append(e("<table>").addClass("table-condensed").append([t,n,r]))},E=function(){var t=e("<div>").addClass("timepicker-hours").append(e("<table>").addClass("table-condensed")),n=e("<div>").addClass("timepicker-minutes").append(e("<table>").addClass("table-condensed")),a=e("<div>").addClass("timepicker-seconds").append(e("<table>").addClass("table-condensed")),r=[P()];return T("h")&&r.push(t),T("m")&&r.push(n),T("s")&&r.push(a),r},H=function(){var t=[];return a.showTodayButton&&t.push(e("<td>").append(e("<a>").attr({"data-action":"today",title:a.tooltips.today}).append(e("<span>").addClass(a.icons.today)))),!a.sideBySide&&S()&&M()&&t.push(e("<td>").append(e("<a>").attr({"data-action":"togglePicker",title:a.tooltips.selectTime}).append(e("<span>").addClass(a.icons.time)))),a.showClear&&t.push(e("<td>").append(e("<a>").attr({"data-action":"clear",title:a.tooltips.clear}).append(e("<span>").addClass(a.icons.clear)))),a.showClose&&t.push(e("<td>").append(e("<a>").attr({"data-action":"close",title:a.tooltips.close}).append(e("<span>").addClass(a.icons.close)))),e("<table>").addClass("table-condensed").append(e("<tbody>").append(e("<tr>").append(t)))},I=function(){var t=e("<div>").addClass("bootstrap-datetimepicker-widget dropdown-menu"),n=e("<div>").addClass("datepicker").append(O()),r=e("<div>").addClass("timepicker").append(E()),i=e("<ul>").addClass("list-unstyled"),o=e("<li>").addClass("picker-switch"+(a.collapse?" accordion-toggle":"")).append(H());return a.inline&&t.removeClass("dropdown-menu"),s&&t.addClass("usetwentyfour"),T("s")&&!s&&t.addClass("wider"),a.sideBySide&&S()&&M()?(t.addClass("timepicker-sbs"),"top"===a.toolbarPlacement&&t.append(o),t.append(e("<div>").addClass("row").append(n.addClass("col-md-6")).append(r.addClass("col-md-6"))),"bottom"===a.toolbarPlacement&&t.append(o),t):("top"===a.toolbarPlacement&&i.append(o),S()&&i.append(e("<li>").addClass(a.collapse&&M()?"collapse show":"").append(n)),"default"===a.toolbarPlacement&&i.append(o),M()&&i.append(e("<li>").addClass(a.collapse&&S()?"collapse":"").append(r)),"bottom"===a.toolbarPlacement&&i.append(o),t.append(i))},Y=function(){var t,r=(f||n).position(),i=(f||n).offset(),o=a.widgetPositioning.vertical,s=a.widgetPositioning.horizontal;if(a.widgetParent)t=a.widgetParent.append(h);else if(n.is("input"))t=n.after(h).parent();else{if(a.inline)return void(t=n.append(h));t=n,n.children().first().after(h)}if("auto"===o&&(o=i.top+1.5*h.height()>=e(window).height()+e(window).scrollTop()&&h.height()+n.outerHeight()<i.top?"top":"bottom"),"auto"===s&&(s=t.width()<i.left+h.outerWidth()/2&&i.left+h.outerWidth()>e(window).width()?"right":"left"),"top"===o?h.addClass("top").removeClass("bottom"):h.addClass("bottom").removeClass("top"),"right"===s?h.addClass("pull-right"):h.removeClass("pull-right"),"static"===t.css("position")&&(t=t.parents().filter(function(){return"static"!==e(this).css("position")}).first()),0===t.length)throw new Error("datetimepicker component should be placed within a non-static positioned container");h.css({top:"top"===o?"auto":r.top+n.outerHeight(),bottom:"top"===o?t.outerHeight()-(t===n?0:r.top):"auto",left:"left"===s?t===n?0:r.left:"auto",right:"left"===s?"auto":t.outerWidth()-n.outerWidth()-(t===n?0:r.left)}),setTimeout(function(){h.addClass("open")},180)},q=function(e){"dp.change"===e.type&&(e.date&&e.date.isSame(e.oldDate)||!e.date&&!e.oldDate)||n.trigger(e)},B=function(e){"y"===e&&(e="YYYY"),q({type:"dp.update",change:e,viewDate:i.clone()})},j=function(e){h&&(e&&(p=Math.max(m,Math.min(3,p+e))),h.find(".datepicker > div").hide().filter(".datepicker-"+y[p].clsName).show())},A=function(){var t=e("<tr>"),n=i.clone().startOf("w").startOf("d");for(!0===a.calendarWeeks&&t.append(e("<th>").addClass("cw").text("#"));n.isBefore(i.clone().endOf("w"));)t.append(e("<th>").addClass("dow").text(n.format("dd"))),n.add(1,"d");h.find(".datepicker-days thead").append(t)},F=function(e){return!0===a.disabledDates[e.format("YYYY-MM-DD")]},L=function(e){return!0===a.enabledDates[e.format("YYYY-MM-DD")]},W=function(e){return!0===a.disabledHours[e.format("H")]},z=function(e){return!0===a.enabledHours[e.format("H")]},N=function(t,n){if(!t.isValid())return!1;if(a.disabledDates&&"d"===n&&F(t))return!1;if(a.enabledDates&&"d"===n&&!L(t))return!1;if(a.minDate&&t.isBefore(a.minDate,n))return!1;if(a.maxDate&&t.isAfter(a.maxDate,n))return!1;if(a.daysOfWeekDisabled&&"d"===n&&-1!==a.daysOfWeekDisabled.indexOf(t.day()))return!1;if(a.disabledHours&&("h"===n||"m"===n||"s"===n)&&W(t))return!1;if(a.enabledHours&&("h"===n||"m"===n||"s"===n)&&!z(t))return!1;if(a.disabledTimeIntervals&&("h"===n||"m"===n||"s"===n)){var r=!1;if(e.each(a.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return r=!0,!1}),r)return!1}return!0},V=function(){for(var t=[],n=i.clone().startOf("y").startOf("d");n.isSame(i,"y");)t.push(e("<span>").attr("data-action","selectMonth").addClass("month").text(n.format("MMM"))),n.add(1,"M");h.find(".datepicker-months td").empty().append(t)},Z=function(){var t=h.find(".datepicker-months"),n=t.find("th"),o=t.find("tbody").find("span");n.eq(0).find("span").attr("title",a.tooltips.prevYear),n.eq(1).attr("title",a.tooltips.selectYear),n.eq(2).find("span").attr("title",a.tooltips.nextYear),t.find(".disabled").removeClass("disabled"),N(i.clone().subtract(1,"y"),"y")||n.eq(0).addClass("disabled"),n.eq(1).text(i.year()),N(i.clone().add(1,"y"),"y")||n.eq(2).addClass("disabled"),o.removeClass("active"),r.isSame(i,"y")&&!u&&o.eq(r.month()).addClass("active"),o.each(function(t){N(i.clone().month(t),"M")||e(this).addClass("disabled")})},R=function(){var e=h.find(".datepicker-years"),t=e.find("th"),n=i.clone().subtract(5,"y"),o=i.clone().add(6,"y"),s="";for(t.eq(0).find("span").attr("title",a.tooltips.prevDecade),t.eq(1).attr("title",a.tooltips.selectDecade),t.eq(2).find("span").attr("title",a.tooltips.nextDecade),e.find(".disabled").removeClass("disabled"),a.minDate&&a.minDate.isAfter(n,"y")&&t.eq(0).addClass("disabled"),t.eq(1).text(n.year()+"-"+o.year()),a.maxDate&&a.maxDate.isBefore(o,"y")&&t.eq(2).addClass("disabled");!n.isAfter(o,"y");)s+='<span data-action="selectYear" class="year'+(n.isSame(r,"y")&&!u?" active":"")+(N(n,"y")?"":" disabled")+'">'+n.year()+"</span>",n.add(1,"y");e.find("td").html(s)},Q=function(){var e,n=h.find(".datepicker-decades"),o=n.find("th"),s=t({y:i.year()-i.year()%100-1}),d=s.clone().add(100,"y"),l=s.clone(),p=!1,c=!1,u="";for(o.eq(0).find("span").attr("title",a.tooltips.prevCentury),o.eq(2).find("span").attr("title",a.tooltips.nextCentury),n.find(".disabled").removeClass("disabled"),(s.isSame(t({y:1900}))||a.minDate&&a.minDate.isAfter(s,"y"))&&o.eq(0).addClass("disabled"),o.eq(1).text(s.year()+"-"+d.year()),(s.isSame(t({y:2e3}))||a.maxDate&&a.maxDate.isBefore(d,"y"))&&o.eq(2).addClass("disabled");!s.isAfter(d,"y");)e=s.year()+12,p=a.minDate&&a.minDate.isAfter(s,"y")&&a.minDate.year()<=e,c=a.maxDate&&a.maxDate.isAfter(s,"y")&&a.maxDate.year()<=e,u+='<span data-action="selectDecade" class="decade'+(r.isAfter(s)&&r.year()<=e?" active":"")+(N(s,"y")||p||c?"":" disabled")+'" data-selection="'+(s.year()+6)+'">'+(s.year()+1)+" - "+(s.year()+12)+"</span>",s.add(12,"y");u+="<span></span><span></span><span></span>",n.find("td").html(u),o.eq(1).text(l.year()+1+"-"+s.year())},U=function(){var t,n,o,s=h.find(".datepicker-days"),d=s.find("th"),l=[],p=[];if(S()){for(d.eq(0).find("span").attr("title",a.tooltips.prevMonth),d.eq(1).attr("title",a.tooltips.selectMonth),d.eq(2).find("span").attr("title",a.tooltips.nextMonth),s.find(".disabled").removeClass("disabled"),d.eq(1).text(i.format(a.dayViewHeaderFormat)),N(i.clone().subtract(1,"M"),"M")||d.eq(0).addClass("disabled"),N(i.clone().add(1,"M"),"M")||d.eq(2).addClass("disabled"),t=i.clone().startOf("M").startOf("w").startOf("d"),o=0;o<42;o++)0===t.weekday()&&(n=e("<tr>"),a.calendarWeeks&&n.append('<td class="cw">'+t.week()+"</td>"),l.push(n)),p=["day"],t.isBefore(i,"M")&&p.push("old"),t.isAfter(i,"M")&&p.push("new"),t.isSame(r,"d")&&!u&&p.push("active"),N(t,"d")||p.push("disabled"),t.isSame(x(),"d")&&p.push("today"),0!==t.day()&&6!==t.day()||p.push("weekend"),q({type:"dp.classify",date:t,classNames:p}),n.append('<td data-action="selectDay" data-day="'+t.format("L")+'" class="'+p.join(" ")+'"><div>'+t.date()+"</div></td>"),t.add(1,"d");s.find("tbody").empty().append(l),Z(),R(),Q()}},G=function(){var t=h.find(".timepicker-hours table"),n=i.clone().startOf("d"),a=[],r=e("<tr>");for(i.hour()>11&&!s&&n.hour(12);n.isSame(i,"d")&&(s||i.hour()<12&&n.hour()<12||i.hour()>11);)n.hour()%4==0&&(r=e("<tr>"),a.push(r)),r.append('<td data-action="selectHour" class="hour'+(N(n,"h")?"":" disabled")+'"><div>'+n.format(s?"HH":"hh")+"</div></td>"),n.add(1,"h");t.empty().append(a)},J=function(){for(var t=h.find(".timepicker-minutes table"),n=i.clone().startOf("h"),r=[],o=e("<tr>"),s=1===a.stepping?5:a.stepping;i.isSame(n,"h");)n.minute()%(4*s)==0&&(o=e("<tr>"),r.push(o)),o.append('<td data-action="selectMinute" class="minute'+(N(n,"m")?"":" disabled")+'"><div>'+n.format("mm")+"</div></td>"),n.add(s,"m");t.empty().append(r)},K=function(){for(var t=h.find(".timepicker-seconds table"),n=i.clone().startOf("m"),a=[],r=e("<tr>");i.isSame(n,"m");)n.second()%20==0&&(r=e("<tr>"),a.push(r)),r.append('<td data-action="selectSecond" class="second'+(N(n,"s")?"":" disabled")+'"><div>'+n.format("ss")+"</div></td>"),n.add(5,"s");t.empty().append(a)},X=function(){var e,t,n=h.find(".timepicker span[data-time-component]");s||(e=h.find(".timepicker [data-action=togglePeriod]"),t=r.clone().add(r.hours()>=12?-12:12,"h"),e.text(r.format("A")),N(t,"h")?e.removeClass("disabled"):e.addClass("disabled")),n.filter("[data-time-component=hours]").text(r.format(s?"HH":"hh")),n.filter("[data-time-component=minutes]").text(r.format("mm")),n.filter("[data-time-component=seconds]").text(r.format("ss")),G(),J(),K()},$=function(){h&&(U(),X())},_=function(e){var t=u?null:r;if(!e)return u=!0,o.val(""),n.data("date",""),q({type:"dp.change",date:!1,oldDate:t}),void $();if(e=e.clone().locale(a.locale),C()&&e.tz(a.timeZone),1!==a.stepping)for(e.minutes(Math.round(e.minutes()/a.stepping)*a.stepping).seconds(0);a.minDate&&e.isBefore(a.minDate);)e.add(a.stepping,"minutes");N(e)?(i=(r=e).clone(),o.val(r.format(d)),n.data("date",r.format(d)),u=!1,$(),q({type:"dp.change",date:r.clone(),oldDate:t})):(a.keepInvalid?q({type:"dp.change",date:e,oldDate:t}):o.val(u?"":r.format(d)),q({type:"dp.error",date:e,oldDate:t}))},ee=function(){var t=!1;return h?(h.find(".collapse").each(function(){var n=e(this).data("collapse");return!n||!n.transitioning||(t=!0,!1)}),t?c:(f&&f.hasClass("btn")&&f.toggleClass("active"),e(window).off("resize",Y),h.off("click","[data-action]"),h.off("mousedown",!1),h.removeClass("open"),void setTimeout(function(){return h.remove(),h.hide(),h=!1,q({type:"dp.hide",date:r.clone()}),o.blur(),p=0,i=r.clone(),c},400))):c},te=function(){_(null)},ne=function(e){return void 0===a.parseInputDate?(!t.isMoment(e)||e instanceof Date)&&(e=x(e)):e=a.parseInputDate(e),e},ae={next:function(){var e=y[p].navFnc;i.add(y[p].navStep,e),U(),B(e)},previous:function(){var e=y[p].navFnc;i.subtract(y[p].navStep,e),U(),B(e)},pickerSwitch:function(){j(1)},selectMonth:function(t){var n=e(t.target).closest("tbody").find("span").index(e(t.target));i.month(n),p===m?(_(r.clone().year(i.year()).month(i.month())),a.inline||ee()):(j(-1),U()),B("M")},selectYear:function(t){var n=parseInt(e(t.target).text(),10)||0;i.year(n),p===m?(_(r.clone().year(i.year())),a.inline||ee()):(j(-1),U()),B("YYYY")},selectDecade:function(t){var n=parseInt(e(t.target).data("selection"),10)||0;i.year(n),p===m?(_(r.clone().year(i.year())),a.inline||ee()):(j(-1),U()),B("YYYY")},selectDay:function(t){var n=i.clone();e(t.target).is(".old")&&n.subtract(1,"M"),e(t.target).is(".new")&&n.add(1,"M"),_(n.date(parseInt(e(t.target).text(),10))),M()||a.keepOpen||a.inline||ee()},incrementHours:function(){var e=r.clone().add(1,"h");N(e,"h")&&_(e)},incrementMinutes:function(){var e=r.clone().add(a.stepping,"m");N(e,"m")&&_(e)},incrementSeconds:function(){var e=r.clone().add(1,"s");N(e,"s")&&_(e)},decrementHours:function(){var e=r.clone().subtract(1,"h");N(e,"h")&&_(e)},decrementMinutes:function(){var e=r.clone().subtract(a.stepping,"m");N(e,"m")&&_(e)},decrementSeconds:function(){var e=r.clone().subtract(1,"s");N(e,"s")&&_(e)},togglePeriod:function(){_(r.clone().add(r.hours()>=12?-12:12,"h"))},togglePicker:function(t){var n,r=e(t.target),i=r.closest("ul"),o=i.find(".show"),s=i.find(".collapse:not(.show)");if(o&&o.length){if((n=o.data("collapse"))&&n.transitioning)return;o.collapse?(o.collapse("hide"),s.collapse("show")):(o.removeClass("show"),s.addClass("show")),r.is("span")?r.toggleClass(a.icons.time+" "+a.icons.date):r.find("span").toggleClass(a.icons.time+" "+a.icons.date)}},showPicker:function(){h.find(".timepicker > div:not(.timepicker-picker)").hide(),h.find(".timepicker .timepicker-picker").show()},showHours:function(){h.find(".timepicker .timepicker-picker").hide(),h.find(".timepicker .timepicker-hours").show()},showMinutes:function(){h.find(".timepicker .timepicker-picker").hide(),h.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){h.find(".timepicker .timepicker-picker").hide(),h.find(".timepicker .timepicker-seconds").show()},selectHour:function(t){var n=parseInt(e(t.target).text(),10);s||(r.hours()>=12?12!==n&&(n+=12):12===n&&(n=0)),_(r.clone().hours(n)),ae.showPicker.call(c)},selectMinute:function(t){_(r.clone().minutes(parseInt(e(t.target).text(),10))),ae.showPicker.call(c)},selectSecond:function(t){_(r.clone().seconds(parseInt(e(t.target).text(),10))),ae.showPicker.call(c)},clear:te,today:function(){var e=x();N(e,"d")&&_(e)},close:ee},re=function(t){return!e(t.currentTarget).is(".disabled")&&(ae[e(t.currentTarget).data("action")].apply(c,arguments),!1)},ie=function(){var t,n={year:function(e){return e.month(0).date(1).hours(0).seconds(0).minutes(0)},month:function(e){return e.date(1).hours(0).seconds(0).minutes(0)},day:function(e){return e.hours(0).seconds(0).minutes(0)},hour:function(e){return e.seconds(0).minutes(0)},minute:function(e){return e.seconds(0)}};return o.prop("disabled")||!a.ignoreReadonly&&o.prop("readonly")||h?c:(void 0!==o.val()&&0!==o.val().trim().length?_(ne(o.val().trim())):u&&a.useCurrent&&(a.inline||o.is("input")&&0===o.val().trim().length)&&(t=x(),"string"==typeof a.useCurrent&&(t=n[a.useCurrent](t)),_(t)),h=I(),A(),V(),h.find(".timepicker-hours").hide(),h.find(".timepicker-minutes").hide(),h.find(".timepicker-seconds").hide(),$(),j(),e(window).on("resize",Y),h.on("click","[data-action]",re),h.on("mousedown",!1),f&&f.hasClass("btn")&&f.toggleClass("active"),Y(),h.show(),a.focusOnShow&&!o.is(":focus")&&o.focus(),q({type:"dp.show"}),c)},oe=function(){return h?ee():ie()},se=function(e){var t,n,r,i,o=null,s=[],d={},l=e.which;D[l]="p";for(t in D)D.hasOwnProperty(t)&&"p"===D[t]&&(s.push(t),parseInt(t,10)!==l&&(d[t]=!0));for(t in a.keyBinds)if(a.keyBinds.hasOwnProperty(t)&&"function"==typeof a.keyBinds[t]&&(r=t.split(" ")).length===s.length&&k[l]===r[r.length-1]){for(i=!0,n=r.length-2;n>=0;n--)if(!(k[r[n]]in d)){i=!1;break}if(i){o=a.keyBinds[t];break}}o&&(o.call(c,h),e.stopPropagation(),e.preventDefault())},de=function(e){D[e.which]="r",e.stopPropagation(),e.preventDefault()},le=function(t){var n=e(t.target).val().trim(),a=n?ne(n):null;return _(a),t.stopImmediatePropagation(),!1},pe=function(){o.off({change:le,blur:blur,keydown:se,keyup:de,focus:a.allowInputToggle?ee:""}),n.is("input")?o.off({focus:ie}):f&&(f.off("click",oe),f.off("mousedown",!1))},ce=function(t){var n={};return e.each(t,function(){var e=ne(this);e.isValid()&&(n[e.format("YYYY-MM-DD")]=!0)}),!!Object.keys(n).length&&n},ue=function(t){var n={};return e.each(t,function(){n[this]=!0}),!!Object.keys(n).length&&n},fe=function(){var e=a.format||"L LT";d=e.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(e){return(r.localeData().longDateFormat(e)||e).replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(e){return r.localeData().longDateFormat(e)||e})}),(l=a.extraFormats?a.extraFormats.slice():[]).indexOf(e)<0&&l.indexOf(d)<0&&l.push(d),s=d.toLowerCase().indexOf("a")<1&&d.replace(/\[.*?\]/g,"").indexOf("h")<1,T("y")&&(m=2),T("M")&&(m=1),T("d")&&(m=0),p=Math.max(m,p),u||_(r)};if(c.destroy=function(){ee(),pe(),n.removeData("DateTimePicker"),n.removeData("date")},c.toggle=oe,c.show=ie,c.hide=ee,c.disable=function(){return ee(),f&&f.hasClass("btn")&&f.addClass("disabled"),o.prop("disabled",!0),c},c.enable=function(){return f&&f.hasClass("btn")&&f.removeClass("disabled"),o.prop("disabled",!1),c},c.ignoreReadonly=function(e){if(0===arguments.length)return a.ignoreReadonly;if("boolean"!=typeof e)throw new TypeError("ignoreReadonly () expects a boolean parameter");return a.ignoreReadonly=e,c},c.options=function(t){if(0===arguments.length)return e.extend(!0,{},a);if(!(t instanceof Object))throw new TypeError("options() options parameter should be an object");return e.extend(!0,a,t),e.each(a,function(e,t){if(void 0===c[e])throw new TypeError("option "+e+" is not recognized!");c[e](t)}),c},c.date=function(e){if(0===arguments.length)return u?null:r.clone();if(!(null===e||"string"==typeof e||t.isMoment(e)||e instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");return _(null===e?null:ne(e)),c},c.format=function(e){if(0===arguments.length)return a.format;if("string"!=typeof e&&("boolean"!=typeof e||!1!==e))throw new TypeError("format() expects a string or boolean:false parameter "+e);return a.format=e,d&&fe(),c},c.timeZone=function(e){if(0===arguments.length)return a.timeZone;if("string"!=typeof e)throw new TypeError("newZone() expects a string parameter");return a.timeZone=e,c},c.dayViewHeaderFormat=function(e){if(0===arguments.length)return a.dayViewHeaderFormat;if("string"!=typeof e)throw new TypeError("dayViewHeaderFormat() expects a string parameter");return a.dayViewHeaderFormat=e,c},c.extraFormats=function(e){if(0===arguments.length)return a.extraFormats;if(!1!==e&&!(e instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");return a.extraFormats=e,l&&fe(),c},c.disabledDates=function(t){if(0===arguments.length)return a.disabledDates?e.extend({},a.disabledDates):a.disabledDates;if(!t)return a.disabledDates=!1,$(),c;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");return a.disabledDates=ce(t),a.enabledDates=!1,$(),c},c.enabledDates=function(t){if(0===arguments.length)return a.enabledDates?e.extend({},a.enabledDates):a.enabledDates;if(!t)return a.enabledDates=!1,$(),c;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");return a.enabledDates=ce(t),a.disabledDates=!1,$(),c},c.daysOfWeekDisabled=function(e){if(0===arguments.length)return a.daysOfWeekDisabled.splice(0);if("boolean"==typeof e&&!e)return a.daysOfWeekDisabled=!1,$(),c;if(!(e instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(a.daysOfWeekDisabled=e.reduce(function(e,t){return(t=parseInt(t,10))>6||t<0||isNaN(t)?e:(-1===e.indexOf(t)&&e.push(t),e)},[]).sort(),a.useCurrent&&!a.keepInvalid){for(var t=0;!N(r,"d");){if(r.add(1,"d"),31===t)throw"Tried 31 times to find a valid date";t++}_(r)}return $(),c},c.maxDate=function(e){if(0===arguments.length)return a.maxDate?a.maxDate.clone():a.maxDate;if("boolean"==typeof e&&!1===e)return a.maxDate=!1,$(),c;"string"==typeof e&&("now"!==e&&"moment"!==e||(e=x()));var t=ne(e);if(!t.isValid())throw new TypeError("maxDate() Could not parse date parameter: "+e);if(a.minDate&&t.isBefore(a.minDate))throw new TypeError("maxDate() date parameter is before options.minDate: "+t.format(d));return a.maxDate=t,a.useCurrent&&!a.keepInvalid&&r.isAfter(e)&&_(a.maxDate),i.isAfter(t)&&(i=t.clone().subtract(a.stepping,"m")),$(),c},c.minDate=function(e){if(0===arguments.length)return a.minDate?a.minDate.clone():a.minDate;if("boolean"==typeof e&&!1===e)return a.minDate=!1,$(),c;"string"==typeof e&&("now"!==e&&"moment"!==e||(e=x()));var t=ne(e);if(!t.isValid())throw new TypeError("minDate() Could not parse date parameter: "+e);if(a.maxDate&&t.isAfter(a.maxDate))throw new TypeError("minDate() date parameter is after options.maxDate: "+t.format(d));return a.minDate=t,a.useCurrent&&!a.keepInvalid&&r.isBefore(e)&&_(a.minDate),i.isBefore(t)&&(i=t.clone().add(a.stepping,"m")),$(),c},c.defaultDate=function(e){if(0===arguments.length)return a.defaultDate?a.defaultDate.clone():a.defaultDate;if(!e)return a.defaultDate=!1,c;"string"==typeof e&&(e="now"===e||"moment"===e?x():x(e));var t=ne(e);if(!t.isValid())throw new TypeError("defaultDate() Could not parse date parameter: "+e);if(!N(t))throw new TypeError("defaultDate() date passed is invalid according to component setup validations");return a.defaultDate=t,(a.defaultDate&&a.inline||""===o.val().trim())&&_(a.defaultDate),c},c.locale=function(e){if(0===arguments.length)return a.locale;if(!t.localeData(e))throw new TypeError("locale() locale "+e+" is not loaded from moment locales!");return a.locale=e,r.locale(a.locale),i.locale(a.locale),d&&fe(),h&&(ee(),ie()),c},c.stepping=function(e){return 0===arguments.length?a.stepping:(e=parseInt(e,10),(isNaN(e)||e<1)&&(e=1),a.stepping=e,c)},c.useCurrent=function(e){var t=["year","month","day","hour","minute"];if(0===arguments.length)return a.useCurrent;if("boolean"!=typeof e&&"string"!=typeof e)throw new TypeError("useCurrent() expects a boolean or string parameter");if("string"==typeof e&&-1===t.indexOf(e.toLowerCase()))throw new TypeError("useCurrent() expects a string parameter of "+t.join(", "));return a.useCurrent=e,c},c.collapse=function(e){if(0===arguments.length)return a.collapse;if("boolean"!=typeof e)throw new TypeError("collapse() expects a boolean parameter");return a.collapse===e?c:(a.collapse=e,h&&(ee(),ie()),c)},c.icons=function(t){if(0===arguments.length)return e.extend({},a.icons);if(!(t instanceof Object))throw new TypeError("icons() expects parameter to be an Object");return e.extend(a.icons,t),h&&(ee(),ie()),c},c.tooltips=function(t){if(0===arguments.length)return e.extend({},a.tooltips);if(!(t instanceof Object))throw new TypeError("tooltips() expects parameter to be an Object");return e.extend(a.tooltips,t),h&&(ee(),ie()),c},c.useStrict=function(e){if(0===arguments.length)return a.useStrict;if("boolean"!=typeof e)throw new TypeError("useStrict() expects a boolean parameter");return a.useStrict=e,c},c.sideBySide=function(e){if(0===arguments.length)return a.sideBySide;if("boolean"!=typeof e)throw new TypeError("sideBySide() expects a boolean parameter");return a.sideBySide=e,h&&(ee(),ie()),c},c.viewMode=function(e){if(0===arguments.length)return a.viewMode;if("string"!=typeof e)throw new TypeError("viewMode() expects a string parameter");if(-1===b.indexOf(e))throw new TypeError("viewMode() parameter must be one of ("+b.join(", ")+") value");return a.viewMode=e,p=Math.max(b.indexOf(e),m),j(),c},c.toolbarPlacement=function(e){if(0===arguments.length)return a.toolbarPlacement;if("string"!=typeof e)throw new TypeError("toolbarPlacement() expects a string parameter");if(-1===v.indexOf(e))throw new TypeError("toolbarPlacement() parameter must be one of ("+v.join(", ")+") value");return a.toolbarPlacement=e,h&&(ee(),ie()),c},c.widgetPositioning=function(t){if(0===arguments.length)return e.extend({},a.widgetPositioning);if("[object Object]"!=={}.toString.call(t))throw new TypeError("widgetPositioning() expects an object variable");if(t.horizontal){if("string"!=typeof t.horizontal)throw new TypeError("widgetPositioning() horizontal variable must be a string");if(t.horizontal=t.horizontal.toLowerCase(),-1===w.indexOf(t.horizontal))throw new TypeError("widgetPositioning() expects horizontal parameter to be one of ("+w.join(", ")+")");a.widgetPositioning.horizontal=t.horizontal}if(t.vertical){if("string"!=typeof t.vertical)throw new TypeError("widgetPositioning() vertical variable must be a string");if(t.vertical=t.vertical.toLowerCase(),-1===g.indexOf(t.vertical))throw new TypeError("widgetPositioning() expects vertical parameter to be one of ("+g.join(", ")+")");a.widgetPositioning.vertical=t.vertical}return $(),c},c.calendarWeeks=function(e){if(0===arguments.length)return a.calendarWeeks;if("boolean"!=typeof e)throw new TypeError("calendarWeeks() expects parameter to be a boolean value");return a.calendarWeeks=e,$(),c},c.showTodayButton=function(e){if(0===arguments.length)return a.showTodayButton;if("boolean"!=typeof e)throw new TypeError("showTodayButton() expects a boolean parameter");return a.showTodayButton=e,h&&(ee(),ie()),c},c.showClear=function(e){if(0===arguments.length)return a.showClear;if("boolean"!=typeof e)throw new TypeError("showClear() expects a boolean parameter");return a.showClear=e,h&&(ee(),ie()),c},c.widgetParent=function(t){if(0===arguments.length)return a.widgetParent;if("string"==typeof t&&(t=e(t)),null!==t&&"string"!=typeof t&&!(t instanceof e))throw new TypeError("widgetParent() expects a string or a jQuery object parameter");return a.widgetParent=t,h&&(ee(),ie()),c},c.keepOpen=function(e){if(0===arguments.length)return a.keepOpen;if("boolean"!=typeof e)throw new TypeError("keepOpen() expects a boolean parameter");return a.keepOpen=e,c},c.focusOnShow=function(e){if(0===arguments.length)return a.focusOnShow;if("boolean"!=typeof e)throw new TypeError("focusOnShow() expects a boolean parameter");return a.focusOnShow=e,c},c.inline=function(e){if(0===arguments.length)return a.inline;if("boolean"!=typeof e)throw new TypeError("inline() expects a boolean parameter");return a.inline=e,c},c.clear=function(){return te(),c},c.keyBinds=function(e){return 0===arguments.length?a.keyBinds:(a.keyBinds=e,c)},c.getMoment=function(e){return x(e)},c.debug=function(e){if("boolean"!=typeof e)throw new TypeError("debug() expects a boolean parameter");return a.debug=e,c},c.allowInputToggle=function(e){if(0===arguments.length)return a.allowInputToggle;if("boolean"!=typeof e)throw new TypeError("allowInputToggle() expects a boolean parameter");return a.allowInputToggle=e,c},c.showClose=function(e){if(0===arguments.length)return a.showClose;if("boolean"!=typeof e)throw new TypeError("showClose() expects a boolean parameter");return a.showClose=e,c},c.keepInvalid=function(e){if(0===arguments.length)return a.keepInvalid;if("boolean"!=typeof e)throw new TypeError("keepInvalid() expects a boolean parameter");return a.keepInvalid=e,c},c.datepickerInput=function(e){if(0===arguments.length)return a.datepickerInput;if("string"!=typeof e)throw new TypeError("datepickerInput() expects a string parameter");return a.datepickerInput=e,c},c.parseInputDate=function(e){if(0===arguments.length)return a.parseInputDate;if("function"!=typeof e)throw new TypeError("parseInputDate() sholud be as function");return a.parseInputDate=e,c},c.disabledTimeIntervals=function(t){if(0===arguments.length)return a.disabledTimeIntervals?e.extend({},a.disabledTimeIntervals):a.disabledTimeIntervals;if(!t)return a.disabledTimeIntervals=!1,$(),c;if(!(t instanceof Array))throw new TypeError("disabledTimeIntervals() expects an array parameter");return a.disabledTimeIntervals=t,$(),c},c.disabledHours=function(t){if(0===arguments.length)return a.disabledHours?e.extend({},a.disabledHours):a.disabledHours;if(!t)return a.disabledHours=!1,$(),c;if(!(t instanceof Array))throw new TypeError("disabledHours() expects an array parameter");if(a.disabledHours=ue(t),a.enabledHours=!1,a.useCurrent&&!a.keepInvalid){for(var n=0;!N(r,"h");){if(r.add(1,"h"),24===n)throw"Tried 24 times to find a valid date";n++}_(r)}return $(),c},c.enabledHours=function(t){if(0===arguments.length)return a.enabledHours?e.extend({},a.enabledHours):a.enabledHours;if(!t)return a.enabledHours=!1,$(),c;if(!(t instanceof Array))throw new TypeError("enabledHours() expects an array parameter");if(a.enabledHours=ue(t),a.disabledHours=!1,a.useCurrent&&!a.keepInvalid){for(var n=0;!N(r,"h");){if(r.add(1,"h"),24===n)throw"Tried 24 times to find a valid date";n++}_(r)}return $(),c},c.viewDate=function(e){if(0===arguments.length)return i.clone();if(!e)return i=r.clone(),c;if(!("string"==typeof e||t.isMoment(e)||e instanceof Date))throw new TypeError("viewDate() parameter must be one of [string, moment or Date]");return i=ne(e),B(),c},n.is("input"))o=n;else if(0===(o=n.find(a.datepickerInput)).length)o=n.find("input");else if(!o.is("input"))throw new Error('CSS class "'+a.datepickerInput+'" cannot be applied to non input element');if(n.hasClass("input-group")&&(f=0===n.find(".datepickerbutton").length?n.find(".input-group-addon"):n.find(".datepickerbutton")),!a.inline&&!o.is("input"))throw new Error("Could not initialize DateTimePicker without an input element");return r=x(),i=r.clone(),e.extend(!0,a,function(){var t,r={};return(t=n.is("input")||a.inline?n.data():n.find("input").data()).dateOptions&&t.dateOptions instanceof Object&&(r=e.extend(!0,r,t.dateOptions)),e.each(a,function(e){var n="date"+e.charAt(0).toUpperCase()+e.slice(1);void 0!==t[n]&&(r[e]=t[n])}),r}()),c.options(a),fe(),o.on({change:le,blur:a.debug?"":ee,keydown:se,keyup:de,focus:a.allowInputToggle?ie:""}),n.is("input")?o.on({focus:ie}):f&&(f.on("click",oe),f.on("mousedown",!1)),o.prop("disabled")&&c.disable(),o.is("input")&&0!==o.val().trim().length?_(ne(o.val().trim())):a.defaultDate&&void 0===o.attr("placeholder")&&_(a.defaultDate),a.inline&&ie(),c};return e.fn.datetimepicker=function(t){t=t||{};var a,r=Array.prototype.slice.call(arguments,1),i=!0,o=["destroy","hide","show","toggle"];if("object"==typeof t)return this.each(function(){var a,r=e(this);r.data("DateTimePicker")||(a=e.extend(!0,{},e.fn.datetimepicker.defaults,t),r.data("DateTimePicker",n(r,a)))});if("string"==typeof t)return this.each(function(){var n=e(this).data("DateTimePicker");if(!n)throw new Error('bootstrap-datetimepicker("'+t+'") method was called on an element that is not using DateTimePicker');a=n[t].apply(n,r),i=a===n}),i||e.inArray(t,o)>-1?this:a;throw new TypeError("Invalid arguments for DateTimePicker: "+t)},e.fn.datetimepicker.defaults={timeZone:"",format:!1,dayViewHeaderFormat:"MMMM YYYY",extraFormats:!1,stepping:1,minDate:!1,maxDate:!1,useCurrent:!0,collapse:!0,locale:t.locale(),defaultDate:!1,disabledDates:!1,enabledDates:!1,icons:{time:"glyphicon glyphicon-time",date:"glyphicon glyphicon-calendar",up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down",previous:"glyphicon glyphicon-chevron-left",next:"glyphicon glyphicon-chevron-right",today:"glyphicon glyphicon-screenshot",clear:"glyphicon glyphicon-trash",close:"glyphicon glyphicon-remove"},tooltips:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",prevMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",prevYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",togglePeriod:"Toggle Period",selectTime:"Select Time"},useStrict:!1,sideBySide:!1,daysOfWeekDisabled:!1,calendarWeeks:!1,viewMode:"days",toolbarPlacement:"default",showTodayButton:!1,showClear:!1,showClose:!1,widgetPositioning:{horizontal:"auto",vertical:"auto"},widgetParent:null,ignoreReadonly:!1,keepOpen:!1,focusOnShow:!0,inline:!1,keepInvalid:!1,datepickerInput:".datepickerinput",keyBinds:{up:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().subtract(7,"d")):this.date(t.clone().add(this.stepping(),"m"))}},down:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().add(7,"d")):this.date(t.clone().subtract(this.stepping(),"m"))}else this.show()},"control up":function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().subtract(1,"y")):this.date(t.clone().add(1,"h"))}},"control down":function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().add(1,"y")):this.date(t.clone().subtract(1,"h"))}},left:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().subtract(1,"d"))}},right:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().add(1,"d"))}},pageUp:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().subtract(1,"M"))}},pageDown:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().add(1,"M"))}},enter:function(){this.hide()},escape:function(){this.hide()},"control space":function(e){e&&e.find(".timepicker").is(":visible")&&e.find('.btn[data-action="togglePeriod"]').click()},t:function(){this.date(this.getMoment())},delete:function(){this.clear()}},debug:!1,allowInputToggle:!1,disabledTimeIntervals:!1,disabledHours:!1,enabledHours:!1,viewDate:!1},e.fn.datetimepicker});
diff --git a/public/js/plugins/bootstrap-selectpicker.js b/public/js/plugins/bootstrap-selectpicker.js
new file mode 100644
index 0000000..d0cdf3e
--- /dev/null
+++ b/public/js/plugins/bootstrap-selectpicker.js
@@ -0,0 +1,1914 @@
+/*!
+ * Bootstrap-select v1.12.4 (http://silviomoreto.github.io/bootstrap-select)
+ *
+ * Copyright 2013-2017 bootstrap-select
+ * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
+ */
+
+(function(root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module unless amdModuleId is set
+ define(["jquery"], function(a0) {
+ return (factory(a0));
+ });
+ } else if (typeof module === 'object' && module.exports) {
+ // Node. Does not work with strict CommonJS, but
+ // only CommonJS-like environments that support module.exports,
+ // like Node.
+ module.exports = factory(require("jquery"));
+ } else {
+ factory(root["jQuery"]);
+ }
+}(this, function(jQuery) {
+
+ (function($) {
+ 'use strict';
+
+ //<editor-fold desc="Shims">
+ if (!String.prototype.includes) {
+ (function() {
+ 'use strict'; // needed to support `apply`/`call` with `undefined`/`null`
+ var toString = {}.toString;
+ var defineProperty = (function() {
+ // IE 8 only supports `Object.defineProperty` on DOM elements
+ try {
+ var object = {};
+ var $defineProperty = Object.defineProperty;
+ var result = $defineProperty(object, object, object) && $defineProperty;
+ } catch (error) {}
+ return result;
+ }());
+ var indexOf = ''.indexOf;
+ var includes = function(search) {
+ if (this == null) {
+ throw new TypeError();
+ }
+ var string = String(this);
+ if (search && toString.call(search) == '[object RegExp]') {
+ throw new TypeError();
+ }
+ var stringLength = string.length;
+ var searchString = String(search);
+ var searchLength = searchString.length;
+ var position = arguments.length > 1 ? arguments[1] : undefined;
+ // `ToInteger`
+ var pos = position ? Number(position) : 0;
+ if (pos != pos) { // better `isNaN`
+ pos = 0;
+ }
+ var start = Math.min(Math.max(pos, 0), stringLength);
+ // Avoid the `indexOf` call if no match is possible
+ if (searchLength + start > stringLength) {
+ return false;
+ }
+ return indexOf.call(string, searchString, pos) != -1;
+ };
+ if (defineProperty) {
+ defineProperty(String.prototype, 'includes', {
+ 'value': includes,
+ 'configurable': true,
+ 'writable': true
+ });
+ } else {
+ String.prototype.includes = includes;
+ }
+ }());
+ }
+
+ if (!String.prototype.startsWith) {
+ (function() {
+ 'use strict'; // needed to support `apply`/`call` with `undefined`/`null`
+ var defineProperty = (function() {
+ // IE 8 only supports `Object.defineProperty` on DOM elements
+ try {
+ var object = {};
+ var $defineProperty = Object.defineProperty;
+ var result = $defineProperty(object, object, object) && $defineProperty;
+ } catch (error) {}
+ return result;
+ }());
+ var toString = {}.toString;
+ var startsWith = function(search) {
+ if (this == null) {
+ throw new TypeError();
+ }
+ var string = String(this);
+ if (search && toString.call(search) == '[object RegExp]') {
+ throw new TypeError();
+ }
+ var stringLength = string.length;
+ var searchString = String(search);
+ var searchLength = searchString.length;
+ var position = arguments.length > 1 ? arguments[1] : undefined;
+ // `ToInteger`
+ var pos = position ? Number(position) : 0;
+ if (pos != pos) { // better `isNaN`
+ pos = 0;
+ }
+ var start = Math.min(Math.max(pos, 0), stringLength);
+ // Avoid the `indexOf` call if no match is possible
+ if (searchLength + start > stringLength) {
+ return false;
+ }
+ var index = -1;
+ while (++index < searchLength) {
+ if (string.charCodeAt(start + index) != searchString.charCodeAt(index)) {
+ return false;
+ }
+ }
+ return true;
+ };
+ if (defineProperty) {
+ defineProperty(String.prototype, 'startsWith', {
+ 'value': startsWith,
+ 'configurable': true,
+ 'writable': true
+ });
+ } else {
+ String.prototype.startsWith = startsWith;
+ }
+ }());
+ }
+
+ if (!Object.keys) {
+ Object.keys = function(
+ o, // object
+ k, // key
+ r // result array
+ ) {
+ // initialize object and result
+ r = [];
+ // iterate over object keys
+ for (k in o)
+ // fill result array with non-prototypical keys
+ r.hasOwnProperty.call(o, k) && r.push(k);
+ // return result
+ return r;
+ };
+ }
+
+ // set data-selected on select element if the value has been programmatically selected
+ // prior to initialization of bootstrap-select
+ // * consider removing or replacing an alternative method *
+ var valHooks = {
+ useDefault: false,
+ _set: $.valHooks.select.set
+ };
+
+ $.valHooks.select.set = function(elem, value) {
+ if (value && !valHooks.useDefault) $(elem).data('selected', true);
+
+ return valHooks._set.apply(this, arguments);
+ };
+
+ var changed_arguments = null;
+
+ var EventIsSupported = (function() {
+ try {
+ new Event('change');
+ return true;
+ } catch (e) {
+ return false;
+ }
+ })();
+
+ $.fn.triggerNative = function(eventName) {
+ var el = this[0],
+ event;
+
+ if (el.dispatchEvent) { // for modern browsers & IE9+
+ if (EventIsSupported) {
+ // For modern browsers
+ event = new Event(eventName, {
+ bubbles: true
+ });
+ } else {
+ // For IE since it doesn't support Event constructor
+ event = document.createEvent('Event');
+ event.initEvent(eventName, true, false);
+ }
+
+ el.dispatchEvent(event);
+ } else if (el.fireEvent) { // for IE8
+ event = document.createEventObject();
+ event.eventType = eventName;
+ el.fireEvent('on' + eventName, event);
+ } else {
+ // fall back to jQuery.trigger
+ this.trigger(eventName);
+ }
+ };
+ //</editor-fold>
+
+ // Case insensitive contains search
+ $.expr.pseudos.icontains = function(obj, index, meta) {
+ var $obj = $(obj).find('a');
+ var haystack = ($obj.data('tokens') || $obj.text()).toString().toUpperCase();
+ return haystack.includes(meta[3].toUpperCase());
+ };
+
+ // Case insensitive begins search
+ $.expr.pseudos.ibegins = function(obj, index, meta) {
+ var $obj = $(obj).find('a');
+ var haystack = ($obj.data('tokens') || $obj.text()).toString().toUpperCase();
+ return haystack.startsWith(meta[3].toUpperCase());
+ };
+
+ // Case and accent insensitive contains search
+ $.expr.pseudos.aicontains = function(obj, index, meta) {
+ var $obj = $(obj).find('a');
+ var haystack = ($obj.data('tokens') || $obj.data('normalizedText') || $obj.text()).toString().toUpperCase();
+ return haystack.includes(meta[3].toUpperCase());
+ };
+
+ // Case and accent insensitive begins search
+ $.expr.pseudos.aibegins = function(obj, index, meta) {
+ var $obj = $(obj).find('a');
+ var haystack = ($obj.data('tokens') || $obj.data('normalizedText') || $obj.text()).toString().toUpperCase();
+ return haystack.startsWith(meta[3].toUpperCase());
+ };
+
+ /**
+ * Remove all diatrics from the given text.
+ * @access private
+ * @param {String} text
+ * @returns {String}
+ */
+ function normalizeToBase(text) {
+ var rExps = [{
+ re: /[\xC0-\xC6]/g,
+ ch: "A"
+ },
+ {
+ re: /[\xE0-\xE6]/g,
+ ch: "a"
+ },
+ {
+ re: /[\xC8-\xCB]/g,
+ ch: "E"
+ },
+ {
+ re: /[\xE8-\xEB]/g,
+ ch: "e"
+ },
+ {
+ re: /[\xCC-\xCF]/g,
+ ch: "I"
+ },
+ {
+ re: /[\xEC-\xEF]/g,
+ ch: "i"
+ },
+ {
+ re: /[\xD2-\xD6]/g,
+ ch: "O"
+ },
+ {
+ re: /[\xF2-\xF6]/g,
+ ch: "o"
+ },
+ {
+ re: /[\xD9-\xDC]/g,
+ ch: "U"
+ },
+ {
+ re: /[\xF9-\xFC]/g,
+ ch: "u"
+ },
+ {
+ re: /[\xC7-\xE7]/g,
+ ch: "c"
+ },
+ {
+ re: /[\xD1]/g,
+ ch: "N"
+ },
+ {
+ re: /[\xF1]/g,
+ ch: "n"
+ }
+ ];
+ $.each(rExps, function() {
+ text = text ? text.replace(this.re, this.ch) : '';
+ });
+ return text;
+ }
+
+
+ // List of HTML entities for escaping.
+ var escapeMap = {
+ '&': '&amp;',
+ '<': '&lt;',
+ '>': '&gt;',
+ '"': '&quot;',
+ "'": '&#x27;',
+ '`': '&#x60;'
+ };
+
+ var unescapeMap = {
+ '&amp;': '&',
+ '&lt;': '<',
+ '&gt;': '>',
+ '&quot;': '"',
+ '&#x27;': "'",
+ '&#x60;': '`'
+ };
+
+ // Functions for escaping and unescaping strings to/from HTML interpolation.
+ var createEscaper = function(map) {
+ var escaper = function(match) {
+ return map[match];
+ };
+ // Regexes for identifying a key that needs to be escaped.
+ var source = '(?:' + Object.keys(map).join('|') + ')';
+ var testRegexp = RegExp(source);
+ var replaceRegexp = RegExp(source, 'g');
+ return function(string) {
+ string = string == null ? '' : '' + string;
+ return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
+ };
+ };
+
+ var htmlEscape = createEscaper(escapeMap);
+ var htmlUnescape = createEscaper(unescapeMap);
+
+ var Selectpicker = function(element, options) {
+ // bootstrap-select has been initialized - revert valHooks.select.set back to its original function
+ if (!valHooks.useDefault) {
+ $.valHooks.select.set = valHooks._set;
+ valHooks.useDefault = true;
+ }
+
+ this.$element = $(element);
+ this.$newElement = null;
+ this.$button = null;
+ this.$menu = null;
+ this.$lis = null;
+ this.options = options;
+
+ // If we have no title yet, try to pull it from the html title attribute (jQuery doesnt' pick it up as it's not a
+ // data-attribute)
+ if (this.options.title === null) {
+ this.options.title = this.$element.attr('title');
+ }
+
+ // Format window padding
+ var winPad = this.options.windowPadding;
+ if (typeof winPad === 'number') {
+ this.options.windowPadding = [winPad, winPad, winPad, winPad];
+ }
+
+ //Expose public methods
+ this.val = Selectpicker.prototype.val;
+ this.render = Selectpicker.prototype.render;
+ this.refresh = Selectpicker.prototype.refresh;
+ this.setStyle = Selectpicker.prototype.setStyle;
+ this.selectAll = Selectpicker.prototype.selectAll;
+ this.deselectAll = Selectpicker.prototype.deselectAll;
+ this.destroy = Selectpicker.prototype.destroy;
+ this.remove = Selectpicker.prototype.remove;
+ this.show = Selectpicker.prototype.show;
+ this.hide = Selectpicker.prototype.hide;
+
+ this.init();
+ };
+
+ Selectpicker.VERSION = '1.12.4';
+
+ // part of this is duplicated in i18n/defaults-en_US.js. Make sure to update both.
+ Selectpicker.DEFAULTS = {
+ noneSelectedText: 'Nothing selected',
+ noneResultsText: 'No results matched {0}',
+ countSelectedText: function(numSelected, numTotal) {
+ return (numSelected == 1) ? "{0} item selected" : "{0} items selected";
+ },
+ maxOptionsText: function(numAll, numGroup) {
+ return [
+ (numAll == 1) ? 'Limit reached ({n} item max)' : 'Limit reached ({n} items max)',
+ (numGroup == 1) ? 'Group limit reached ({n} item max)' : 'Group limit reached ({n} items max)'
+ ];
+ },
+ selectAllText: 'Select All',
+ deselectAllText: 'Deselect All',
+ doneButton: false,
+ doneButtonText: 'Close',
+ multipleSeparator: ', ',
+ styleBase: 'btn',
+ style: 'btn-default',
+ size: 'auto',
+ title: null,
+ selectedTextFormat: 'values',
+ width: false,
+ container: false,
+ hideDisabled: false,
+ showSubtext: false,
+ showIcon: true,
+ showContent: true,
+ dropupAuto: true,
+ header: false,
+ liveSearch: false,
+ liveSearchPlaceholder: null,
+ liveSearchNormalize: false,
+ liveSearchStyle: 'contains',
+ actionsBox: false,
+ iconBase: 'glyphicon',
+ tickIcon: 'glyphicon-ok',
+ showTick: false,
+ template: {
+ caret: '<span class="caret"></span>'
+ },
+ maxOptions: false,
+ mobile: false,
+ selectOnTab: false,
+ dropdownAlignRight: false,
+ windowPadding: 0
+ };
+
+ Selectpicker.prototype = {
+
+ constructor: Selectpicker,
+
+ init: function() {
+ var that = this,
+ id = this.$element.attr('id');
+
+ this.$element.addClass('bs-select-hidden');
+
+ // store originalIndex (key) and newIndex (value) in this.liObj for fast accessibility
+ // allows us to do this.$lis.eq(that.liObj[index]) instead of this.$lis.filter('[data-original-index="' + index + '"]')
+ this.liObj = {};
+ this.multiple = this.$element.prop('multiple');
+ this.autofocus = this.$element.prop('autofocus');
+ this.$newElement = this.createView();
+ this.$element
+ .after(this.$newElement)
+ .appendTo(this.$newElement);
+ this.$button = this.$newElement.children('button');
+ this.$menu = this.$newElement.children('.dropdown-menu');
+ this.$menuInner = this.$menu.children('.inner');
+ this.$searchbox = this.$menu.find('input');
+
+ this.$element.removeClass('bs-select-hidden');
+
+ if (this.options.dropdownAlignRight === true) this.$menu.addClass('dropdown-menu-right');
+
+ if (typeof id !== 'undefined') {
+ this.$button.attr('data-id', id);
+ $('label[for="' + id + '"]').click(function(e) {
+ e.preventDefault();
+ that.$button.focus();
+ });
+ }
+
+ this.checkDisabled();
+ this.clickListener();
+ if (this.options.liveSearch) this.liveSearchListener();
+ this.render();
+ this.setStyle();
+ this.setWidth();
+ if (this.options.container) this.selectPosition();
+ this.$menu.data('this', this);
+ this.$newElement.data('this', this);
+ if (this.options.mobile) this.mobile();
+
+ this.$newElement.on({
+ 'hide.bs.dropdown': function(e) {
+ that.$menuInner.attr('aria-expanded', false);
+ that.$element.trigger('hide.bs.select', e);
+ },
+ 'hidden.bs.dropdown': function(e) {
+ that.$element.trigger('hidden.bs.select', e);
+ },
+ 'show.bs.dropdown': function(e) {
+ that.$menuInner.attr('aria-expanded', true);
+ that.$element.trigger('show.bs.select', e);
+ },
+ 'shown.bs.dropdown': function(e) {
+ that.$element.trigger('shown.bs.select', e);
+ }
+ });
+
+ if (that.$element[0].hasAttribute('required')) {
+ this.$element.on('invalid', function() {
+ that.$button.addClass('bs-invalid');
+
+ that.$element.on({
+ 'focus.bs.select': function() {
+ that.$button.focus();
+ that.$element.off('focus.bs.select');
+ },
+ 'shown.bs.select': function() {
+ that.$element
+ .val(that.$element.val()) // set the value to hide the validation message in Chrome when menu is opened
+ .off('shown.bs.select');
+ },
+ 'rendered.bs.select': function() {
+ // if select is no longer invalid, remove the bs-invalid class
+ if (this.validity.valid) that.$button.removeClass('bs-invalid');
+ that.$element.off('rendered.bs.select');
+ }
+ });
+
+ that.$button.on('blur.bs.select', function() {
+ that.$element.focus().blur();
+ that.$button.off('blur.bs.select');
+ });
+ });
+ }
+
+ setTimeout(function() {
+ that.$element.trigger('loaded.bs.select');
+ });
+ },
+
+ createDropdown: function() {
+ // Options
+ // If we are multiple or showTick option is set, then add the show-tick class
+ var showTick = (this.multiple || this.options.showTick) ? ' show-tick' : '',
+ inputGroup = this.$element.parent().hasClass('input-group') ? ' input-group-btn' : '',
+ autofocus = this.autofocus ? ' autofocus' : '';
+ // Elements
+ var header = this.options.header ? '<div class="popover-title"><button type="button" class="close" aria-hidden="true">&times;</button>' + this.options.header + '</div>' : '';
+ var searchbox = this.options.liveSearch ?
+ '<div class="bs-searchbox">' +
+ '<input type="text" class="form-control" autocomplete="off"' +
+ (null === this.options.liveSearchPlaceholder ? '' : ' placeholder="' + htmlEscape(this.options.liveSearchPlaceholder) + '"') + ' role="textbox" aria-label="Search">' +
+ '</div>' :
+ '';
+ var actionsbox = this.multiple && this.options.actionsBox ?
+ '<div class="bs-actionsbox">' +
+ '<div class="btn-group btn-group-sm btn-block">' +
+ '<button type="button" class="actions-btn bs-select-all btn btn-default">' +
+ this.options.selectAllText +
+ '</button>' +
+ '<button type="button" class="actions-btn bs-deselect-all btn btn-default">' +
+ this.options.deselectAllText +
+ '</button>' +
+ '</div>' +
+ '</div>' :
+ '';
+ var donebutton = this.multiple && this.options.doneButton ?
+ '<div class="bs-donebutton">' +
+ '<div class="btn-group btn-block">' +
+ '<button type="button" class="btn btn-sm btn-default">' +
+ this.options.doneButtonText +
+ '</button>' +
+ '</div>' +
+ '</div>' :
+ '';
+ var drop =
+ '<div class="btn-group bootstrap-select' + showTick + inputGroup + '">' +
+ '<button type="button" class="' + this.options.styleBase + ' dropdown-toggle" data-toggle="dropdown"' + autofocus + ' role="button">' +
+ '<span class="filter-option pull-left"></span>&nbsp;' +
+ '<span class="bs-caret">' +
+ this.options.template.caret +
+ '</span>' +
+ '</button>' +
+ '<div class="dropdown-menu open" role="combobox">' +
+ header +
+ searchbox +
+ actionsbox +
+ '<ul class="dropdown-menu inner" role="listbox" aria-expanded="false">' +
+ '</ul>' +
+ donebutton +
+ '</div>' +
+ '</div>';
+
+ return $(drop);
+ },
+
+ createView: function() {
+ var $drop = this.createDropdown(),
+ li = this.createLi();
+
+ $drop.find('ul')[0].innerHTML = li;
+ return $drop;
+ },
+
+ reloadLi: function() {
+ // rebuild
+ var li = this.createLi();
+ this.$menuInner[0].innerHTML = li;
+ },
+
+ createLi: function() {
+ var that = this,
+ _li = [],
+ optID = 0,
+ titleOption = document.createElement('option'),
+ liIndex = -1; // increment liIndex whenever a new <li> element is created to ensure liObj is correct
+
+ // Helper functions
+ /**
+ * @param content
+ * @param [index]
+ * @param [classes]
+ * @param [optgroup]
+ * @returns {string}
+ */
+ var generateLI = function(content, index, classes, optgroup) {
+ return '<li' +
+ ((typeof classes !== 'undefined' && '' !== classes) ? ' class="' + classes + '"' : '') +
+ ((typeof index !== 'undefined' && null !== index) ? ' data-original-index="' + index + '"' : '') +
+ ((typeof optgroup !== 'undefined' && null !== optgroup) ? 'data-optgroup="' + optgroup + '"' : '') +
+ '>' + content + '</li>';
+ };
+
+ /**
+ * @param text
+ * @param [classes]
+ * @param [inline]
+ * @param [tokens]
+ * @returns {string}
+ */
+ var generateA = function(text, classes, inline, tokens) {
+ return '<a tabindex="0"' +
+ (typeof classes !== 'undefined' ? ' class="' + classes + '"' : '') +
+ (inline ? ' style="' + inline + '"' : '') +
+ (that.options.liveSearchNormalize ? ' data-normalized-text="' + normalizeToBase(htmlEscape($(text).html())) + '"' : '') +
+ (typeof tokens !== 'undefined' || tokens !== null ? ' data-tokens="' + tokens + '"' : '') +
+ ' role="option">' + text +
+ '<span class="' + that.options.iconBase + ' ' + that.options.tickIcon + ' check-mark"></span>' +
+ '</a>';
+ };
+
+ if (this.options.title && !this.multiple) {
+ // this option doesn't create a new <li> element, but does add a new option, so liIndex is decreased
+ // since liObj is recalculated on every refresh, liIndex needs to be decreased even if the titleOption is already appended
+ liIndex--;
+
+ if (!this.$element.find('.bs-title-option').length) {
+ // Use native JS to prepend option (faster)
+ var element = this.$element[0];
+ titleOption.className = 'bs-title-option';
+ titleOption.innerHTML = this.options.title;
+ titleOption.value = '';
+ element.insertBefore(titleOption, element.firstChild);
+ // Check if selected or data-selected attribute is already set on an option. If not, select the titleOption option.
+ // the selected item may have been changed by user or programmatically before the bootstrap select plugin runs,
+ // if so, the select will have the data-selected attribute
+ var $opt = $(element.options[element.selectedIndex]);
+ if ($opt.attr('selected') === undefined && this.$element.data('selected') === undefined) {
+ titleOption.selected = true;
+ }
+ }
+ }
+
+ var $selectOptions = this.$element.find('option');
+
+ $selectOptions.each(function(index) {
+ var $this = $(this);
+
+ liIndex++;
+
+ if ($this.hasClass('bs-title-option')) return;
+
+ // Get the class and text for the option
+ var optionClass = this.className || '',
+ inline = htmlEscape(this.style.cssText),
+ text = $this.data('content') ? $this.data('content') : $this.html(),
+ tokens = $this.data('tokens') ? $this.data('tokens') : null,
+ subtext = typeof $this.data('subtext') !== 'undefined' ? '<small class="text-muted">' + $this.data('subtext') + '</small>' : '',
+ icon = typeof $this.data('icon') !== 'undefined' ? '<span class="' + that.options.iconBase + ' ' + $this.data('icon') + '"></span> ' : '',
+ $parent = $this.parent(),
+ isOptgroup = $parent[0].tagName === 'OPTGROUP',
+ isOptgroupDisabled = isOptgroup && $parent[0].disabled,
+ isDisabled = this.disabled || isOptgroupDisabled,
+ prevHiddenIndex;
+
+ if (icon !== '' && isDisabled) {
+ icon = '<span>' + icon + '</span>';
+ }
+
+ if (that.options.hideDisabled && (isDisabled && !isOptgroup || isOptgroupDisabled)) {
+ // set prevHiddenIndex - the index of the first hidden option in a group of hidden options
+ // used to determine whether or not a divider should be placed after an optgroup if there are
+ // hidden options between the optgroup and the first visible option
+ prevHiddenIndex = $this.data('prevHiddenIndex');
+ $this.next().data('prevHiddenIndex', (prevHiddenIndex !== undefined ? prevHiddenIndex : index));
+
+ liIndex--;
+ return;
+ }
+
+ if (!$this.data('content')) {
+ // Prepend any icon and append any subtext to the main text.
+ text = icon + '<span class="text">' + text + subtext + '</span>';
+ }
+
+ if (isOptgroup && $this.data('divider') !== true) {
+ if (that.options.hideDisabled && isDisabled) {
+ if ($parent.data('allOptionsDisabled') === undefined) {
+ var $options = $parent.children();
+ $parent.data('allOptionsDisabled', $options.filter(':disabled').length === $options.length);
+ }
+
+ if ($parent.data('allOptionsDisabled')) {
+ liIndex--;
+ return;
+ }
+ }
+
+ var optGroupClass = ' ' + $parent[0].className || '';
+
+ if ($this.index() === 0) { // Is it the first option of the optgroup?
+ optID += 1;
+
+ // Get the opt group label
+ var label = $parent[0].label,
+ labelSubtext = typeof $parent.data('subtext') !== 'undefined' ? '<small class="text-muted">' + $parent.data('subtext') + '</small>' : '',
+ labelIcon = $parent.data('icon') ? '<span class="' + that.options.iconBase + ' ' + $parent.data('icon') + '"></span> ' : '';
+
+ label = labelIcon + '<span class="text">' + htmlEscape(label) + labelSubtext + '</span>';
+
+ if (index !== 0 && _li.length > 0) { // Is it NOT the first option of the select && are there elements in the dropdown?
+ liIndex++;
+ _li.push(generateLI('', null, 'divider', optID + 'div'));
+ }
+ liIndex++;
+ _li.push(generateLI(label, null, 'dropdown-header' + optGroupClass, optID));
+ }
+
+ if (that.options.hideDisabled && isDisabled) {
+ liIndex--;
+ return;
+ }
+
+ _li.push(generateLI(generateA(text, 'opt ' + optionClass + optGroupClass, inline, tokens), index, '', optID));
+ } else if ($this.data('divider') === true) {
+ _li.push(generateLI('', index, 'divider'));
+ } else if ($this.data('hidden') === true) {
+ // set prevHiddenIndex - the index of the first hidden option in a group of hidden options
+ // used to determine whether or not a divider should be placed after an optgroup if there are
+ // hidden options between the optgroup and the first visible option
+ prevHiddenIndex = $this.data('prevHiddenIndex');
+ $this.next().data('prevHiddenIndex', (prevHiddenIndex !== undefined ? prevHiddenIndex : index));
+
+ _li.push(generateLI(generateA(text, optionClass, inline, tokens), index, 'hidden is-hidden'));
+ } else {
+ var showDivider = this.previousElementSibling && this.previousElementSibling.tagName === 'OPTGROUP';
+
+ // if previous element is not an optgroup and hideDisabled is true
+ if (!showDivider && that.options.hideDisabled) {
+ prevHiddenIndex = $this.data('prevHiddenIndex');
+
+ if (prevHiddenIndex !== undefined) {
+ // select the element **before** the first hidden element in the group
+ var prevHidden = $selectOptions.eq(prevHiddenIndex)[0].previousElementSibling;
+
+ if (prevHidden && prevHidden.tagName === 'OPTGROUP' && !prevHidden.disabled) {
+ showDivider = true;
+ }
+ }
+ }
+
+ if (showDivider) {
+ liIndex++;
+ _li.push(generateLI('', null, 'divider', optID + 'div'));
+ }
+ _li.push(generateLI(generateA(text, optionClass, inline, tokens), index));
+ }
+
+ that.liObj[index] = liIndex;
+ });
+
+ //If we are not multiple, we don't have a selected item, and we don't have a title, select the first element so something is set in the button
+ if (!this.multiple && this.$element.find('option:selected').length === 0 && !this.options.title) {
+ this.$element.find('option').eq(0).prop('selected', true).attr('selected', 'selected');
+ }
+
+ return _li.join('');
+ },
+
+ findLis: function() {
+ if (this.$lis == null) this.$lis = this.$menu.find('li');
+ return this.$lis;
+ },
+
+ /**
+ * @param [updateLi] defaults to true
+ */
+ render: function(updateLi) {
+ var that = this,
+ notDisabled,
+ $selectOptions = this.$element.find('option');
+
+ //Update the LI to match the SELECT
+ if (updateLi !== false) {
+ $selectOptions.each(function(index) {
+ var $lis = that.findLis().eq(that.liObj[index]);
+
+ that.setDisabled(index, this.disabled || this.parentNode.tagName === 'OPTGROUP' && this.parentNode.disabled, $lis);
+ that.setSelected(index, this.selected, $lis);
+ });
+ }
+
+ this.togglePlaceholder();
+
+ this.tabIndex();
+
+ var selectedItems = $selectOptions.map(function() {
+ if (this.selected) {
+ if (that.options.hideDisabled && (this.disabled || this.parentNode.tagName === 'OPTGROUP' && this.parentNode.disabled)) return;
+
+ var $this = $(this),
+ icon = $this.data('icon') && that.options.showIcon ? '<i class="' + that.options.iconBase + ' ' + $this.data('icon') + '"></i> ' : '',
+ subtext;
+
+ if (that.options.showSubtext && $this.data('subtext') && !that.multiple) {
+ subtext = ' <small class="text-muted">' + $this.data('subtext') + '</small>';
+ } else {
+ subtext = '';
+ }
+ if (typeof $this.attr('title') !== 'undefined') {
+ return $this.attr('title');
+ } else if ($this.data('content') && that.options.showContent) {
+ return $this.data('content').toString();
+ } else {
+ return icon + $this.html() + subtext;
+ }
+ }
+ }).toArray();
+
+ //Fixes issue in IE10 occurring when no default option is selected and at least one option is disabled
+ //Convert all the values into a comma delimited string
+ var title = !this.multiple ? selectedItems[0] : selectedItems.join(this.options.multipleSeparator);
+
+ //If this is multi select, and the selectText type is count, the show 1 of 2 selected etc..
+ if (this.multiple && this.options.selectedTextFormat.indexOf('count') > -1) {
+ var max = this.options.selectedTextFormat.split('>');
+ if ((max.length > 1 && selectedItems.length > max[1]) || (max.length == 1 && selectedItems.length >= 2)) {
+ notDisabled = this.options.hideDisabled ? ', [disabled]' : '';
+ var totalCount = $selectOptions.not('[data-divider="true"], [data-hidden="true"]' + notDisabled).length,
+ tr8nText = (typeof this.options.countSelectedText === 'function') ? this.options.countSelectedText(selectedItems.length, totalCount) : this.options.countSelectedText;
+ title = tr8nText.replace('{0}', selectedItems.length.toString()).replace('{1}', totalCount.toString());
+ }
+ }
+
+ if (this.options.title == undefined) {
+ this.options.title = this.$element.attr('title');
+ }
+
+ if (this.options.selectedTextFormat == 'static') {
+ title = this.options.title;
+ }
+
+ //If we dont have a title, then use the default, or if nothing is set at all, use the not selected text
+ if (!title) {
+ title = typeof this.options.title !== 'undefined' ? this.options.title : this.options.noneSelectedText;
+ }
+
+ //strip all HTML tags and trim the result, then unescape any escaped tags
+ this.$button.attr('title', htmlUnescape($.trim(title.replace(/<[^>]*>?/g, ''))));
+ this.$button.children('.filter-option').html(title);
+
+ this.$element.trigger('rendered.bs.select');
+ },
+
+ /**
+ * @param [style]
+ * @param [status]
+ */
+ setStyle: function(style, status) {
+ if (this.$element.attr('class')) {
+ this.$newElement.addClass(this.$element.attr('class').replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi, ''));
+ }
+
+ var buttonClass = style ? style : this.options.style;
+
+ if (status == 'add') {
+ this.$button.addClass(buttonClass);
+ } else if (status == 'remove') {
+ this.$button.removeClass(buttonClass);
+ } else {
+ this.$button.removeClass(this.options.style);
+ this.$button.addClass(buttonClass);
+ }
+ },
+
+ liHeight: function(refresh) {
+ if (!refresh && (this.options.size === false || this.sizeInfo)) return;
+
+ var newElement = document.createElement('div'),
+ menu = document.createElement('div'),
+ menuInner = document.createElement('ul'),
+ divider = document.createElement('li'),
+ li = document.createElement('li'),
+ a = document.createElement('a'),
+ text = document.createElement('span'),
+ header = this.options.header && this.$menu.find('.popover-title').length > 0 ? this.$menu.find('.popover-title')[0].cloneNode(true) : null,
+ search = this.options.liveSearch ? document.createElement('div') : null,
+ actions = this.options.actionsBox && this.multiple && this.$menu.find('.bs-actionsbox').length > 0 ? this.$menu.find('.bs-actionsbox')[0].cloneNode(true) : null,
+ doneButton = this.options.doneButton && this.multiple && this.$menu.find('.bs-donebutton').length > 0 ? this.$menu.find('.bs-donebutton')[0].cloneNode(true) : null;
+
+ text.className = 'text';
+ newElement.className = this.$menu[0].parentNode.className + ' open';
+ menu.className = 'dropdown-menu open';
+ menuInner.className = 'dropdown-menu inner';
+ divider.className = 'divider';
+
+ text.appendChild(document.createTextNode('Inner text'));
+ a.appendChild(text);
+ li.appendChild(a);
+ menuInner.appendChild(li);
+ menuInner.appendChild(divider);
+ if (header) menu.appendChild(header);
+ if (search) {
+ var input = document.createElement('input');
+ search.className = 'bs-searchbox';
+ input.className = 'form-control';
+ search.appendChild(input);
+ menu.appendChild(search);
+ }
+ if (actions) menu.appendChild(actions);
+ menu.appendChild(menuInner);
+ if (doneButton) menu.appendChild(doneButton);
+ newElement.appendChild(menu);
+
+ document.body.appendChild(newElement);
+
+ var liHeight = a.offsetHeight,
+ headerHeight = header ? header.offsetHeight : 0,
+ searchHeight = search ? search.offsetHeight : 0,
+ actionsHeight = actions ? actions.offsetHeight : 0,
+ doneButtonHeight = doneButton ? doneButton.offsetHeight : 0,
+ dividerHeight = $(divider).outerHeight(true),
+ // fall back to jQuery if getComputedStyle is not supported
+ menuStyle = typeof getComputedStyle === 'function' ? getComputedStyle(menu) : false,
+ $menu = menuStyle ? null : $(menu),
+ menuPadding = {
+ vert: parseInt(menuStyle ? menuStyle.paddingTop : $menu.css('paddingTop')) +
+ parseInt(menuStyle ? menuStyle.paddingBottom : $menu.css('paddingBottom')) +
+ parseInt(menuStyle ? menuStyle.borderTopWidth : $menu.css('borderTopWidth')) +
+ parseInt(menuStyle ? menuStyle.borderBottomWidth : $menu.css('borderBottomWidth')),
+ horiz: parseInt(menuStyle ? menuStyle.paddingLeft : $menu.css('paddingLeft')) +
+ parseInt(menuStyle ? menuStyle.paddingRight : $menu.css('paddingRight')) +
+ parseInt(menuStyle ? menuStyle.borderLeftWidth : $menu.css('borderLeftWidth')) +
+ parseInt(menuStyle ? menuStyle.borderRightWidth : $menu.css('borderRightWidth'))
+ },
+ menuExtras = {
+ vert: menuPadding.vert +
+ parseInt(menuStyle ? menuStyle.marginTop : $menu.css('marginTop')) +
+ parseInt(menuStyle ? menuStyle.marginBottom : $menu.css('marginBottom')) + 2,
+ horiz: menuPadding.horiz +
+ parseInt(menuStyle ? menuStyle.marginLeft : $menu.css('marginLeft')) +
+ parseInt(menuStyle ? menuStyle.marginRight : $menu.css('marginRight')) + 2
+ }
+
+ document.body.removeChild(newElement);
+
+ this.sizeInfo = {
+ liHeight: liHeight,
+ headerHeight: headerHeight,
+ searchHeight: searchHeight,
+ actionsHeight: actionsHeight,
+ doneButtonHeight: doneButtonHeight,
+ dividerHeight: dividerHeight,
+ menuPadding: menuPadding,
+ menuExtras: menuExtras
+ };
+ },
+
+ setSize: function() {
+ this.findLis();
+ this.liHeight();
+
+ if (this.options.header) this.$menu.css('padding-top', 0);
+ if (this.options.size === false) return;
+
+ var that = this,
+ $menu = this.$menu,
+ $menuInner = this.$menuInner,
+ $window = $(window),
+ selectHeight = this.$newElement[0].offsetHeight,
+ selectWidth = this.$newElement[0].offsetWidth,
+ liHeight = this.sizeInfo['liHeight'],
+ headerHeight = this.sizeInfo['headerHeight'],
+ searchHeight = this.sizeInfo['searchHeight'],
+ actionsHeight = this.sizeInfo['actionsHeight'],
+ doneButtonHeight = this.sizeInfo['doneButtonHeight'],
+ divHeight = this.sizeInfo['dividerHeight'],
+ menuPadding = this.sizeInfo['menuPadding'],
+ menuExtras = this.sizeInfo['menuExtras'],
+ notDisabled = this.options.hideDisabled ? '.disabled' : '',
+ menuHeight,
+ menuWidth,
+ getHeight,
+ getWidth,
+ selectOffsetTop,
+ selectOffsetBot,
+ selectOffsetLeft,
+ selectOffsetRight,
+ getPos = function() {
+ var pos = that.$newElement.offset(),
+ $container = $(that.options.container),
+ containerPos;
+
+ if (that.options.container && !$container.is('body')) {
+ containerPos = $container.offset();
+ containerPos.top += parseInt($container.css('borderTopWidth'));
+ containerPos.left += parseInt($container.css('borderLeftWidth'));
+ } else {
+ containerPos = {
+ top: 0,
+ left: 0
+ };
+ }
+
+ var winPad = that.options.windowPadding;
+ selectOffsetTop = pos.top - containerPos.top - $window.scrollTop();
+ selectOffsetBot = $window.height() - selectOffsetTop - selectHeight - containerPos.top - winPad[2];
+ selectOffsetLeft = pos.left - containerPos.left - $window.scrollLeft();
+ selectOffsetRight = $window.width() - selectOffsetLeft - selectWidth - containerPos.left - winPad[1];
+ selectOffsetTop -= winPad[0];
+ selectOffsetLeft -= winPad[3];
+ };
+
+ getPos();
+
+ if (this.options.size === 'auto') {
+ var getSize = function() {
+ var minHeight,
+ hasClass = function(className, include) {
+ return function(element) {
+ if (include) {
+ return (element.classList ? element.classList.contains(className) : $(element).hasClass(className));
+ } else {
+ return !(element.classList ? element.classList.contains(className) : $(element).hasClass(className));
+ }
+ };
+ },
+ lis = that.$menuInner[0].getElementsByTagName('li'),
+ lisVisible = Array.prototype.filter ? Array.prototype.filter.call(lis, hasClass('hidden', false)) : that.$lis.not('.hidden'),
+ optGroup = Array.prototype.filter ? Array.prototype.filter.call(lisVisible, hasClass('dropdown-header', true)) : lisVisible.filter('.dropdown-header');
+
+ getPos();
+ menuHeight = selectOffsetBot - menuExtras.vert;
+ menuWidth = selectOffsetRight - menuExtras.horiz;
+
+ if (that.options.container) {
+ if (!$menu.data('height')) $menu.data('height', $menu.height());
+ getHeight = $menu.data('height');
+
+ if (!$menu.data('width')) $menu.data('width', $menu.width());
+ getWidth = $menu.data('width');
+ } else {
+ getHeight = $menu.height();
+ getWidth = $menu.width();
+ }
+
+ if (that.options.dropupAuto) {
+ that.$newElement.toggleClass('dropup', selectOffsetTop > selectOffsetBot && (menuHeight - menuExtras.vert) < getHeight);
+ }
+
+ if (that.$newElement.hasClass('dropup')) {
+ menuHeight = selectOffsetTop - menuExtras.vert;
+ }
+
+ if (that.options.dropdownAlignRight === 'auto') {
+ $menu.toggleClass('dropdown-menu-right', selectOffsetLeft > selectOffsetRight && (menuWidth - menuExtras.horiz) < (getWidth - selectWidth));
+ }
+
+ if ((lisVisible.length + optGroup.length) > 3) {
+ minHeight = liHeight * 3 + menuExtras.vert - 2;
+ } else {
+ minHeight = 0;
+ }
+
+ $menu.css({
+ 'max-height': menuHeight + 'px',
+ 'overflow': 'hidden',
+ 'min-height': minHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight + 'px'
+ });
+ $menuInner.css({
+ 'max-height': menuHeight - headerHeight - searchHeight - actionsHeight - doneButtonHeight - menuPadding.vert + 'px',
+ 'overflow-y': 'auto',
+ 'min-height': Math.max(minHeight - menuPadding.vert, 0) + 'px'
+ });
+ };
+ getSize();
+ this.$searchbox.off('input.getSize propertychange.getSize').on('input.getSize propertychange.getSize', getSize);
+ $window.off('resize.getSize scroll.getSize').on('resize.getSize scroll.getSize', getSize);
+ } else if (this.options.size && this.options.size != 'auto' && this.$lis.not(notDisabled).length > this.options.size) {
+ var optIndex = this.$lis.not('.divider').not(notDisabled).children().slice(0, this.options.size).last().parent().index(),
+ divLength = this.$lis.slice(0, optIndex + 1).filter('.divider').length;
+ menuHeight = liHeight * this.options.size + divLength * divHeight + menuPadding.vert;
+
+ if (that.options.container) {
+ if (!$menu.data('height')) $menu.data('height', $menu.height());
+ getHeight = $menu.data('height');
+ } else {
+ getHeight = $menu.height();
+ }
+
+ if (that.options.dropupAuto) {
+ //noinspection JSUnusedAssignment
+ this.$newElement.toggleClass('dropup', selectOffsetTop > selectOffsetBot && (menuHeight - menuExtras.vert) < getHeight);
+ }
+ $menu.css({
+ 'max-height': menuHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight + 'px',
+ 'overflow': 'hidden',
+ 'min-height': ''
+ });
+ $menuInner.css({
+ 'max-height': menuHeight - menuPadding.vert + 'px',
+ 'overflow-y': 'auto',
+ 'min-height': ''
+ });
+ }
+ },
+
+ setWidth: function() {
+ if (this.options.width === 'auto') {
+ this.$menu.css('min-width', '0');
+
+ // Get correct width if element is hidden
+ var $selectClone = this.$menu.parent().clone().appendTo('body'),
+ $selectClone2 = this.options.container ? this.$newElement.clone().appendTo('body') : $selectClone,
+ ulWidth = $selectClone.children('.dropdown-menu').outerWidth(),
+ btnWidth = $selectClone2.css('width', 'auto').children('button').outerWidth();
+
+ $selectClone.remove();
+ $selectClone2.remove();
+
+ // Set width to whatever's larger, button title or longest option
+ this.$newElement.css('width', Math.max(ulWidth, btnWidth) + 'px');
+ } else if (this.options.width === 'fit') {
+ // Remove inline min-width so width can be changed from 'auto'
+ this.$menu.css('min-width', '');
+ this.$newElement.css('width', '').addClass('fit-width');
+ } else if (this.options.width) {
+ // Remove inline min-width so width can be changed from 'auto'
+ this.$menu.css('min-width', '');
+ this.$newElement.css('width', this.options.width);
+ } else {
+ // Remove inline min-width/width so width can be changed
+ this.$menu.css('min-width', '');
+ this.$newElement.css('width', '');
+ }
+ // Remove fit-width class if width is changed programmatically
+ if (this.$newElement.hasClass('fit-width') && this.options.width !== 'fit') {
+ this.$newElement.removeClass('fit-width');
+ }
+ },
+
+ selectPosition: function() {
+ this.$bsContainer = $('<div class="bs-container" />');
+
+ var that = this,
+ $container = $(this.options.container),
+ pos,
+ containerPos,
+ actualHeight,
+ getPlacement = function($element) {
+ that.$bsContainer.addClass($element.attr('class').replace(/form-control|fit-width/gi, '')).toggleClass('dropup', $element.hasClass('dropup'));
+ pos = $element.offset();
+
+ if (!$container.is('body')) {
+ containerPos = $container.offset();
+ containerPos.top += parseInt($container.css('borderTopWidth')) - $container.scrollTop();
+ containerPos.left += parseInt($container.css('borderLeftWidth')) - $container.scrollLeft();
+ } else {
+ containerPos = {
+ top: 0,
+ left: 0
+ };
+ }
+
+ actualHeight = $element.hasClass('dropup') ? 0 : $element[0].offsetHeight;
+
+ that.$bsContainer.css({
+ 'top': pos.top - containerPos.top + actualHeight,
+ 'left': pos.left - containerPos.left,
+ 'width': $element[0].offsetWidth
+ });
+ };
+
+ this.$button.on('click', function() {
+ var $this = $(this);
+
+ if (that.isDisabled()) {
+ return;
+ }
+
+ getPlacement(that.$newElement);
+
+ that.$bsContainer
+ .appendTo(that.options.container)
+ .toggleClass('open', !$this.hasClass('open'))
+ .append(that.$menu);
+ });
+
+ $(window).on('resize scroll', function() {
+ getPlacement(that.$newElement);
+ });
+
+ this.$element.on('hide.bs.select', function() {
+ that.$menu.data('height', that.$menu.height());
+ that.$bsContainer.detach();
+ });
+ },
+
+ /**
+ * @param {number} index - the index of the option that is being changed
+ * @param {boolean} selected - true if the option is being selected, false if being deselected
+ * @param {JQuery} $lis - the 'li' element that is being modified
+ */
+ setSelected: function(index, selected, $lis) {
+ if (!$lis) {
+ this.togglePlaceholder(); // check if setSelected is being called by changing the value of the select
+ $lis = this.findLis().eq(this.liObj[index]);
+ }
+
+ $lis.toggleClass('selected', selected).find('a').attr('aria-selected', selected);
+ },
+
+ /**
+ * @param {number} index - the index of the option that is being disabled
+ * @param {boolean} disabled - true if the option is being disabled, false if being enabled
+ * @param {JQuery} $lis - the 'li' element that is being modified
+ */
+ setDisabled: function(index, disabled, $lis) {
+ if (!$lis) {
+ $lis = this.findLis().eq(this.liObj[index]);
+ }
+
+ if (disabled) {
+ $lis.addClass('disabled').children('a').attr('href', '#').attr('tabindex', -1).attr('aria-disabled', true);
+ } else {
+ $lis.removeClass('disabled').children('a').removeAttr('href').attr('tabindex', 0).attr('aria-disabled', false);
+ }
+ },
+
+ isDisabled: function() {
+ return this.$element[0].disabled;
+ },
+
+ checkDisabled: function() {
+ var that = this;
+
+ if (this.isDisabled()) {
+ this.$newElement.addClass('disabled');
+ this.$button.addClass('disabled').attr('tabindex', -1).attr('aria-disabled', true);
+ } else {
+ if (this.$button.hasClass('disabled')) {
+ this.$newElement.removeClass('disabled');
+ this.$button.removeClass('disabled').attr('aria-disabled', false);
+ }
+
+ if (this.$button.attr('tabindex') == -1 && !this.$element.data('tabindex')) {
+ this.$button.removeAttr('tabindex');
+ }
+ }
+
+ this.$button.click(function() {
+ return !that.isDisabled();
+ });
+ },
+
+ togglePlaceholder: function() {
+ var value = this.$element.val();
+ this.$button.toggleClass('bs-placeholder', value === null || value === '' || (value.constructor === Array && value.length === 0));
+ },
+
+ tabIndex: function() {
+ if (this.$element.data('tabindex') !== this.$element.attr('tabindex') &&
+ (this.$element.attr('tabindex') !== -98 && this.$element.attr('tabindex') !== '-98')) {
+ this.$element.data('tabindex', this.$element.attr('tabindex'));
+ this.$button.attr('tabindex', this.$element.data('tabindex'));
+ }
+
+ this.$element.attr('tabindex', -98);
+ },
+
+ clickListener: function() {
+ var that = this,
+ $document = $(document);
+
+ $document.data('spaceSelect', false);
+
+ this.$button.on('keyup', function(e) {
+ if (/(32)/.test(e.keyCode.toString(10)) && $document.data('spaceSelect')) {
+ e.preventDefault();
+ $document.data('spaceSelect', false);
+ }
+ });
+
+ this.$button.on('click', function() {
+ that.setSize();
+ });
+
+ this.$element.on('shown.bs.select', function() {
+ if (!that.options.liveSearch && !that.multiple) {
+ that.$menuInner.find('.selected a').focus();
+ } else if (!that.multiple) {
+ var selectedIndex = that.liObj[that.$element[0].selectedIndex];
+
+ if (typeof selectedIndex !== 'number' || that.options.size === false) return;
+
+ // scroll to selected option
+ var offset = that.$lis.eq(selectedIndex)[0].offsetTop - that.$menuInner[0].offsetTop;
+ offset = offset - that.$menuInner[0].offsetHeight / 2 + that.sizeInfo.liHeight / 2;
+ that.$menuInner[0].scrollTop = offset;
+ }
+ });
+
+ this.$menuInner.on('click', 'li a', function(e) {
+ var $this = $(this),
+ clickedIndex = $this.parent().data('originalIndex'),
+ prevValue = that.$element.val(),
+ prevIndex = that.$element.prop('selectedIndex'),
+ triggerChange = true;
+
+ // Don't close on multi choice menu
+ if (that.multiple && that.options.maxOptions !== 1) {
+ e.stopPropagation();
+ }
+
+ e.preventDefault();
+
+ //Don't run if we have been disabled
+ if (!that.isDisabled() && !$this.parent().hasClass('disabled')) {
+ var $options = that.$element.find('option'),
+ $option = $options.eq(clickedIndex),
+ state = $option.prop('selected'),
+ $optgroup = $option.parent('optgroup'),
+ maxOptions = that.options.maxOptions,
+ maxOptionsGrp = $optgroup.data('maxOptions') || false;
+
+ if (!that.multiple) { // Deselect all others if not multi select box
+ $options.prop('selected', false);
+ $option.prop('selected', true);
+ that.$menuInner.find('.selected').removeClass('selected').find('a').attr('aria-selected', false);
+ that.setSelected(clickedIndex, true);
+ } else { // Toggle the one we have chosen if we are multi select.
+ $option.prop('selected', !state);
+ that.setSelected(clickedIndex, !state);
+ $this.blur();
+
+ if (maxOptions !== false || maxOptionsGrp !== false) {
+ var maxReached = maxOptions < $options.filter(':selected').length,
+ maxReachedGrp = maxOptionsGrp < $optgroup.find('option:selected').length;
+
+ if ((maxOptions && maxReached) || (maxOptionsGrp && maxReachedGrp)) {
+ if (maxOptions && maxOptions == 1) {
+ $options.prop('selected', false);
+ $option.prop('selected', true);
+ that.$menuInner.find('.selected').removeClass('selected');
+ that.setSelected(clickedIndex, true);
+ } else if (maxOptionsGrp && maxOptionsGrp == 1) {
+ $optgroup.find('option:selected').prop('selected', false);
+ $option.prop('selected', true);
+ var optgroupID = $this.parent().data('optgroup');
+ that.$menuInner.find('[data-optgroup="' + optgroupID + '"]').removeClass('selected');
+ that.setSelected(clickedIndex, true);
+ } else {
+ var maxOptionsText = typeof that.options.maxOptionsText === 'string' ? [that.options.maxOptionsText, that.options.maxOptionsText] : that.options.maxOptionsText,
+ maxOptionsArr = typeof maxOptionsText === 'function' ? maxOptionsText(maxOptions, maxOptionsGrp) : maxOptionsText,
+ maxTxt = maxOptionsArr[0].replace('{n}', maxOptions),
+ maxTxtGrp = maxOptionsArr[1].replace('{n}', maxOptionsGrp),
+ $notify = $('<div class="notify"></div>');
+ // If {var} is set in array, replace it
+ /** @deprecated */
+ if (maxOptionsArr[2]) {
+ maxTxt = maxTxt.replace('{var}', maxOptionsArr[2][maxOptions > 1 ? 0 : 1]);
+ maxTxtGrp = maxTxtGrp.replace('{var}', maxOptionsArr[2][maxOptionsGrp > 1 ? 0 : 1]);
+ }
+
+ $option.prop('selected', false);
+
+ that.$menu.append($notify);
+
+ if (maxOptions && maxReached) {
+ $notify.append($('<div>' + maxTxt + '</div>'));
+ triggerChange = false;
+ that.$element.trigger('maxReached.bs.select');
+ }
+
+ if (maxOptionsGrp && maxReachedGrp) {
+ $notify.append($('<div>' + maxTxtGrp + '</div>'));
+ triggerChange = false;
+ that.$element.trigger('maxReachedGrp.bs.select');
+ }
+
+ setTimeout(function() {
+ that.setSelected(clickedIndex, false);
+ }, 10);
+
+ $notify.delay(750).fadeOut(300, function() {
+ $(this).remove();
+ });
+ }
+ }
+ }
+ }
+
+ if (!that.multiple || (that.multiple && that.options.maxOptions === 1)) {
+ that.$button.focus();
+ } else if (that.options.liveSearch) {
+ that.$searchbox.focus();
+ }
+
+ // Trigger select 'change'
+ if (triggerChange) {
+ if ((prevValue != that.$element.val() && that.multiple) || (prevIndex != that.$element.prop('selectedIndex') && !that.multiple)) {
+ // $option.prop('selected') is current option state (selected/unselected). state is previous option state.
+ changed_arguments = [clickedIndex, $option.prop('selected'), state];
+ that.$element
+ .triggerNative('change');
+ }
+ }
+ }
+ });
+
+ this.$menu.on('click', 'li.disabled a, .popover-title, .popover-title :not(.close)', function(e) {
+ if (e.currentTarget == this) {
+ e.preventDefault();
+ e.stopPropagation();
+ if (that.options.liveSearch && !$(e.target).hasClass('close')) {
+ that.$searchbox.focus();
+ } else {
+ that.$button.focus();
+ }
+ }
+ });
+
+ this.$menuInner.on('click', '.divider, .dropdown-header', function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ if (that.options.liveSearch) {
+ that.$searchbox.focus();
+ } else {
+ that.$button.focus();
+ }
+ });
+
+ this.$menu.on('click', '.popover-title .close', function() {
+ that.$button.click();
+ });
+
+ this.$searchbox.on('click', function(e) {
+ e.stopPropagation();
+ });
+
+ this.$menu.on('click', '.actions-btn', function(e) {
+ if (that.options.liveSearch) {
+ that.$searchbox.focus();
+ } else {
+ that.$button.focus();
+ }
+
+ e.preventDefault();
+ e.stopPropagation();
+
+ if ($(this).hasClass('bs-select-all')) {
+ that.selectAll();
+ } else {
+ that.deselectAll();
+ }
+ });
+
+ this.$element.change(function() {
+ that.render(false);
+ that.$element.trigger('changed.bs.select', changed_arguments);
+ changed_arguments = null;
+ });
+ },
+
+ liveSearchListener: function() {
+ var that = this,
+ $no_results = $('<li class="no-results"></li>');
+
+ this.$button.on('click.dropdown.data-api', function() {
+ that.$menuInner.find('.active').removeClass('active');
+ if (!!that.$searchbox.val()) {
+ that.$searchbox.val('');
+ that.$lis.not('.is-hidden').removeClass('hidden');
+ if (!!$no_results.parent().length) $no_results.remove();
+ }
+ if (!that.multiple) that.$menuInner.find('.selected').addClass('active');
+ setTimeout(function() {
+ that.$searchbox.focus();
+ }, 10);
+ });
+
+ this.$searchbox.on('click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api', function(e) {
+ e.stopPropagation();
+ });
+
+ this.$searchbox.on('input propertychange', function() {
+ that.$lis.not('.is-hidden').removeClass('hidden');
+ that.$lis.filter('.active').removeClass('active');
+ $no_results.remove();
+
+ if (that.$searchbox.val()) {
+ var $searchBase = that.$lis.not('.is-hidden, .divider, .dropdown-header'),
+ $hideItems;
+ if (that.options.liveSearchNormalize) {
+ $hideItems = $searchBase.not(':a' + that._searchStyle() + '("' + normalizeToBase(that.$searchbox.val()) + '")');
+ } else {
+ $hideItems = $searchBase.not(':' + that._searchStyle() + '("' + that.$searchbox.val() + '")');
+ }
+
+ if ($hideItems.length === $searchBase.length) {
+ $no_results.html(that.options.noneResultsText.replace('{0}', '"' + htmlEscape(that.$searchbox.val()) + '"'));
+ that.$menuInner.append($no_results);
+ that.$lis.addClass('hidden');
+ } else {
+ $hideItems.addClass('hidden');
+
+ var $lisVisible = that.$lis.not('.hidden'),
+ $foundDiv;
+
+ // hide divider if first or last visible, or if followed by another divider
+ $lisVisible.each(function(index) {
+ var $this = $(this);
+
+ if ($this.hasClass('divider')) {
+ if ($foundDiv === undefined) {
+ $this.addClass('hidden');
+ } else {
+ if ($foundDiv) $foundDiv.addClass('hidden');
+ $foundDiv = $this;
+ }
+ } else if ($this.hasClass('dropdown-header') && $lisVisible.eq(index + 1).data('optgroup') !== $this.data('optgroup')) {
+ $this.addClass('hidden');
+ } else {
+ $foundDiv = null;
+ }
+ });
+ if ($foundDiv) $foundDiv.addClass('hidden');
+
+ $searchBase.not('.hidden').first().addClass('active');
+ that.$menuInner.scrollTop(0);
+ }
+ }
+ });
+ },
+
+ _searchStyle: function() {
+ var styles = {
+ begins: 'ibegins',
+ startsWith: 'ibegins'
+ };
+
+ return styles[this.options.liveSearchStyle] || 'icontains';
+ },
+
+ val: function(value) {
+ if (typeof value !== 'undefined') {
+ this.$element.val(value);
+ this.render();
+
+ return this.$element;
+ } else {
+ return this.$element.val();
+ }
+ },
+
+ changeAll: function(status) {
+ if (!this.multiple) return;
+ if (typeof status === 'undefined') status = true;
+
+ this.findLis();
+
+ var $options = this.$element.find('option'),
+ $lisVisible = this.$lis.not('.divider, .dropdown-header, .disabled, .hidden'),
+ lisVisLen = $lisVisible.length,
+ selectedOptions = [];
+
+ if (status) {
+ if ($lisVisible.filter('.selected').length === $lisVisible.length) return;
+ } else {
+ if ($lisVisible.filter('.selected').length === 0) return;
+ }
+
+ $lisVisible.toggleClass('selected', status);
+
+ for (var i = 0; i < lisVisLen; i++) {
+ var origIndex = $lisVisible[i].getAttribute('data-original-index');
+ selectedOptions[selectedOptions.length] = $options.eq(origIndex)[0];
+ }
+
+ $(selectedOptions).prop('selected', status);
+
+ this.render(false);
+
+ this.togglePlaceholder();
+
+ this.$element
+ .triggerNative('change');
+ },
+
+ selectAll: function() {
+ return this.changeAll(true);
+ },
+
+ deselectAll: function() {
+ return this.changeAll(false);
+ },
+
+ toggle: function(e) {
+ e = e || window.event;
+
+ if (e) e.stopPropagation();
+
+ this.$button.trigger('click');
+ },
+
+ keydown: function(e) {
+ var $this = $(this),
+ $parent = $this.is('input') ? $this.parent().parent() : $this.parent(),
+ $items,
+ that = $parent.data('this'),
+ index,
+ prevIndex,
+ isActive,
+ selector = ':not(.disabled, .hidden, .dropdown-header, .divider)',
+ keyCodeMap = {
+ 32: ' ',
+ 48: '0',
+ 49: '1',
+ 50: '2',
+ 51: '3',
+ 52: '4',
+ 53: '5',
+ 54: '6',
+ 55: '7',
+ 56: '8',
+ 57: '9',
+ 59: ';',
+ 65: 'a',
+ 66: 'b',
+ 67: 'c',
+ 68: 'd',
+ 69: 'e',
+ 70: 'f',
+ 71: 'g',
+ 72: 'h',
+ 73: 'i',
+ 74: 'j',
+ 75: 'k',
+ 76: 'l',
+ 77: 'm',
+ 78: 'n',
+ 79: 'o',
+ 80: 'p',
+ 81: 'q',
+ 82: 'r',
+ 83: 's',
+ 84: 't',
+ 85: 'u',
+ 86: 'v',
+ 87: 'w',
+ 88: 'x',
+ 89: 'y',
+ 90: 'z',
+ 96: '0',
+ 97: '1',
+ 98: '2',
+ 99: '3',
+ 100: '4',
+ 101: '5',
+ 102: '6',
+ 103: '7',
+ 104: '8',
+ 105: '9'
+ };
+
+
+ isActive = that.$newElement.hasClass('open');
+
+ if (!isActive && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105 || e.keyCode >= 65 && e.keyCode <= 90)) {
+ if (!that.options.container) {
+ that.setSize();
+ that.$menu.parent().addClass('open');
+ isActive = true;
+ } else {
+ that.$button.trigger('click');
+ }
+ that.$searchbox.focus();
+ return;
+ }
+
+ if (that.options.liveSearch) {
+ if (/(^9$|27)/.test(e.keyCode.toString(10)) && isActive) {
+ e.preventDefault();
+ e.stopPropagation();
+ that.$menuInner.click();
+ that.$button.focus();
+ }
+ }
+
+ if (/(38|40)/.test(e.keyCode.toString(10))) {
+ $items = that.$lis.filter(selector);
+ if (!$items.length) return;
+
+ if (!that.options.liveSearch) {
+ index = $items.index($items.find('a').filter(':focus').parent());
+ } else {
+ index = $items.index($items.filter('.active'));
+ }
+
+ prevIndex = that.$menuInner.data('prevIndex');
+
+ if (e.keyCode == 38) {
+ if ((that.options.liveSearch || index == prevIndex) && index != -1) index--;
+ if (index < 0) index += $items.length;
+ } else if (e.keyCode == 40) {
+ if (that.options.liveSearch || index == prevIndex) index++;
+ index = index % $items.length;
+ }
+
+ that.$menuInner.data('prevIndex', index);
+
+ if (!that.options.liveSearch) {
+ $items.eq(index).children('a').focus();
+ } else {
+ e.preventDefault();
+ if (!$this.hasClass('dropdown-toggle')) {
+ $items.removeClass('active').eq(index).addClass('active').children('a').focus();
+ $this.focus();
+ }
+ }
+
+ } else if (!$this.is('input')) {
+ var keyIndex = [],
+ count,
+ prevKey;
+
+ $items = that.$lis.filter(selector);
+ $items.each(function(i) {
+ if ($.trim($(this).children('a').text().toLowerCase()).substring(0, 1) == keyCodeMap[e.keyCode]) {
+ keyIndex.push(i);
+ }
+ });
+
+ count = $(document).data('keycount');
+ count++;
+ $(document).data('keycount', count);
+
+ prevKey = $.trim($(':focus').text().toLowerCase()).substring(0, 1);
+
+ if (prevKey != keyCodeMap[e.keyCode]) {
+ count = 1;
+ $(document).data('keycount', count);
+ } else if (count >= keyIndex.length) {
+ $(document).data('keycount', 0);
+ if (count > keyIndex.length) count = 1;
+ }
+
+ $items.eq(keyIndex[count - 1]).children('a').focus();
+ }
+
+ // Select focused option if "Enter", "Spacebar" or "Tab" (when selectOnTab is true) are pressed inside the menu.
+ if ((/(13|32)/.test(e.keyCode.toString(10)) || (/(^9$)/.test(e.keyCode.toString(10)) && that.options.selectOnTab)) && isActive) {
+ if (!/(32)/.test(e.keyCode.toString(10))) e.preventDefault();
+ if (!that.options.liveSearch) {
+ var elem = $(':focus');
+ elem.click();
+ // Bring back focus for multiselects
+ elem.focus();
+ // Prevent screen from scrolling if the user hit the spacebar
+ e.preventDefault();
+ // Fixes spacebar selection of dropdown items in FF & IE
+ $(document).data('spaceSelect', true);
+ } else if (!/(32)/.test(e.keyCode.toString(10))) {
+ that.$menuInner.find('.active a').click();
+ $this.focus();
+ }
+ $(document).data('keycount', 0);
+ }
+
+ if ((/(^9$|27)/.test(e.keyCode.toString(10)) && isActive && (that.multiple || that.options.liveSearch)) || (/(27)/.test(e.keyCode.toString(10)) && !isActive)) {
+ that.$menu.parent().removeClass('open');
+ if (that.options.container) that.$newElement.removeClass('open');
+ that.$button.focus();
+ }
+ },
+
+ mobile: function() {
+ this.$element.addClass('mobile-device');
+ },
+
+ refresh: function() {
+ this.$lis = null;
+ this.liObj = {};
+ this.reloadLi();
+ this.render();
+ this.checkDisabled();
+ this.liHeight(true);
+ this.setStyle();
+ this.setWidth();
+ if (this.$lis) this.$searchbox.trigger('propertychange');
+
+ this.$element.trigger('refreshed.bs.select');
+ },
+
+ hide: function() {
+ this.$newElement.hide();
+ },
+
+ show: function() {
+ this.$newElement.show();
+ },
+
+ remove: function() {
+ this.$newElement.remove();
+ this.$element.remove();
+ },
+
+ destroy: function() {
+ this.$newElement.before(this.$element).remove();
+
+ if (this.$bsContainer) {
+ this.$bsContainer.remove();
+ } else {
+ this.$menu.remove();
+ }
+
+ this.$element
+ .off('.bs.select')
+ .removeData('selectpicker')
+ .removeClass('bs-select-hidden selectpicker');
+ }
+ };
+
+ // SELECTPICKER PLUGIN DEFINITION
+ // ==============================
+ function Plugin(option) {
+ // get the args of the outer function..
+ var args = arguments;
+ // The arguments of the function are explicitly re-defined from the argument list, because the shift causes them
+ // to get lost/corrupted in android 2.3 and IE9 #715 #775
+ var _option = option;
+
+ [].shift.apply(args);
+
+ var value;
+ var chain = this.each(function() {
+ var $this = $(this);
+ if ($this.is('select')) {
+ var data = $this.data('selectpicker'),
+ options = typeof _option == 'object' && _option;
+
+ if (!data) {
+ var config = $.extend({}, Selectpicker.DEFAULTS, $.fn.selectpicker.defaults || {}, $this.data(), options);
+ config.template = $.extend({}, Selectpicker.DEFAULTS.template, ($.fn.selectpicker.defaults ? $.fn.selectpicker.defaults.template : {}), $this.data().template, options.template);
+ $this.data('selectpicker', (data = new Selectpicker(this, config)));
+ } else if (options) {
+ for (var i in options) {
+ if (options.hasOwnProperty(i)) {
+ data.options[i] = options[i];
+ }
+ }
+ }
+
+ if (typeof _option == 'string') {
+ if (data[_option] instanceof Function) {
+ value = data[_option].apply(data, args);
+ } else {
+ value = data.options[_option];
+ }
+ }
+ }
+ });
+
+ if (typeof value !== 'undefined') {
+ //noinspection JSUnusedAssignment
+ return value;
+ } else {
+ return chain;
+ }
+ }
+
+ var old = $.fn.selectpicker;
+ $.fn.selectpicker = Plugin;
+ $.fn.selectpicker.Constructor = Selectpicker;
+
+ // SELECTPICKER NO CONFLICT
+ // ========================
+ $.fn.selectpicker.noConflict = function() {
+ $.fn.selectpicker = old;
+ return this;
+ };
+
+ $(document)
+ .data('keycount', 0)
+ .on('keydown.bs.select', '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input', Selectpicker.prototype.keydown)
+ .on('focusin.modal', '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input', function(e) {
+ e.stopPropagation();
+ });
+
+ // SELECTPICKER DATA-API
+ // =====================
+ $(window).on('load.bs.select.data-api', function() {
+ $('.selectpicker').each(function() {
+ var $selectpicker = $(this);
+ Plugin.call($selectpicker, $selectpicker.data());
+ })
+ });
+ })(jQuery);
+
+
+})); \ No newline at end of file
diff --git a/public/js/plugins/bootstrap-switch.js b/public/js/plugins/bootstrap-switch.js
new file mode 100644
index 0000000..0c1782b
--- /dev/null
+++ b/public/js/plugins/bootstrap-switch.js
@@ -0,0 +1,744 @@
+/* ========================================================================
+ * bootstrap-switch - v3.3.2
+ * http://www.bootstrap-switch.org
+ * ========================================================================
+ * Copyright 2012-2013 Mattia Larentis
+ *
+ * ========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================================
+ */
+
+(function() {
+ var slice = [].slice;
+
+ (function($, window) {
+ "use strict";
+ var BootstrapSwitch;
+ BootstrapSwitch = (function() {
+ function BootstrapSwitch(element, options) {
+ if (options == null) {
+ options = {};
+ }
+ this.$element = $(element);
+ this.options = $.extend({}, $.fn.bootstrapSwitch.defaults, {
+ state: this.$element.is(":checked"),
+ size: this.$element.data("size"),
+ animate: this.$element.data("animate"),
+ disabled: this.$element.is(":disabled"),
+ readonly: this.$element.is("[readonly]"),
+ indeterminate: this.$element.data("indeterminate"),
+ inverse: this.$element.data("inverse"),
+ radioAllOff: this.$element.data("radio-all-off"),
+ onColor: this.$element.data("on-color"),
+ offColor: this.$element.data("off-color"),
+ onText: this.$element.data("on-text"),
+ offText: this.$element.data("off-text"),
+ labelText: this.$element.data("label-text"),
+ handleWidth: this.$element.data("handle-width"),
+ labelWidth: this.$element.data("label-width"),
+ baseClass: this.$element.data("base-class"),
+ wrapperClass: this.$element.data("wrapper-class")
+ }, options);
+ this.prevOptions = {};
+ this.$wrapper = $("<div>", {
+ "class": (function(_this) {
+ return function() {
+ var classes;
+ classes = ["" + _this.options.baseClass].concat(_this._getClasses(_this.options.wrapperClass));
+ classes.push(_this.options.state ? _this.options.baseClass + "-on" : _this.options.baseClass + "-off");
+ if (_this.options.size != null) {
+ classes.push(_this.options.baseClass + "-" + _this.options.size);
+ }
+ if (_this.options.disabled) {
+ classes.push(_this.options.baseClass + "-disabled");
+ }
+ if (_this.options.readonly) {
+ classes.push(_this.options.baseClass + "-readonly");
+ }
+ if (_this.options.indeterminate) {
+ classes.push(_this.options.baseClass + "-indeterminate");
+ }
+ if (_this.options.inverse) {
+ classes.push(_this.options.baseClass + "-inverse");
+ }
+ if (_this.$element.attr("id")) {
+ classes.push(_this.options.baseClass + "-id-" + (_this.$element.attr("id")));
+ }
+ return classes.join(" ");
+ };
+ })(this)()
+ });
+ this.$container = $("<div>", {
+ "class": this.options.baseClass + "-container"
+ });
+ this.$on = $("<span>", {
+ html: this.options.onText,
+ "class": this.options.baseClass + "-handle-on " + this.options.baseClass + "-" + this.options.onColor
+ });
+ this.$off = $("<span>", {
+ html: this.options.offText,
+ "class": this.options.baseClass + "-handle-off " + this.options.baseClass + "-" + this.options.offColor
+ });
+ this.$label = $("<span>", {
+ html: this.options.labelText,
+ "class": this.options.baseClass + "-label"
+ });
+ this.$element.on("init.bootstrapSwitch", (function(_this) {
+ return function() {
+ return _this.options.onInit.apply(element, arguments);
+ };
+ })(this));
+ this.$element.on("switchChange.bootstrapSwitch", (function(_this) {
+ return function(e) {
+ if (false === _this.options.onSwitchChange.apply(element, arguments)) {
+ if (_this.$element.is(":radio")) {
+ return $("[name='" + (_this.$element.attr('name')) + "']").trigger("previousState.bootstrapSwitch", true);
+ } else {
+ return _this.$element.trigger("previousState.bootstrapSwitch", true);
+ }
+ }
+ };
+ })(this));
+ this.$container = this.$element.wrap(this.$container).parent();
+ this.$wrapper = this.$container.wrap(this.$wrapper).parent();
+ this.$element.before(this.options.inverse ? this.$off : this.$on).before(this.$label).before(this.options.inverse ? this.$on : this.$off);
+ if (this.options.indeterminate) {
+ this.$element.prop("indeterminate", true);
+ }
+ this._init();
+ this._elementHandlers();
+ this._handleHandlers();
+ this._labelHandlers();
+ this._formHandler();
+ this._externalLabelHandler();
+ this.$element.trigger("init.bootstrapSwitch", this.options.state);
+ }
+
+ BootstrapSwitch.prototype._constructor = BootstrapSwitch;
+
+ BootstrapSwitch.prototype.setPrevOptions = function() {
+ return this.prevOptions = $.extend(true, {}, this.options);
+ };
+
+ BootstrapSwitch.prototype.state = function(value, skip) {
+ if (typeof value === "undefined") {
+ return this.options.state;
+ }
+ if (this.options.disabled || this.options.readonly) {
+ return this.$element;
+ }
+ if (this.options.state && !this.options.radioAllOff && this.$element.is(":radio")) {
+ return this.$element;
+ }
+ if (this.$element.is(":radio")) {
+ $("[name='" + (this.$element.attr('name')) + "']").trigger("setPreviousOptions.bootstrapSwitch");
+ } else {
+ this.$element.trigger("setPreviousOptions.bootstrapSwitch");
+ }
+ if (this.options.indeterminate) {
+ this.indeterminate(false);
+ }
+ value = !!value;
+ this.$element.prop("checked", value).trigger("change.bootstrapSwitch", skip);
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.toggleState = function(skip) {
+ if (this.options.disabled || this.options.readonly) {
+ return this.$element;
+ }
+ if (this.options.indeterminate) {
+ this.indeterminate(false);
+ return this.state(true);
+ } else {
+ return this.$element.prop("checked", !this.options.state).trigger("change.bootstrapSwitch", skip);
+ }
+ };
+
+ BootstrapSwitch.prototype.size = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.size;
+ }
+ if (this.options.size != null) {
+ this.$wrapper.removeClass(this.options.baseClass + "-" + this.options.size);
+ }
+ if (value) {
+ this.$wrapper.addClass(this.options.baseClass + "-" + value);
+ }
+ this._width();
+ this._containerPosition();
+ this.options.size = value;
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.animate = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.animate;
+ }
+ value = !!value;
+ if (value === this.options.animate) {
+ return this.$element;
+ }
+ return this.toggleAnimate();
+ };
+
+ BootstrapSwitch.prototype.toggleAnimate = function() {
+ this.options.animate = !this.options.animate;
+ this.$wrapper.toggleClass(this.options.baseClass + "-animate");
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.disabled = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.disabled;
+ }
+ value = !!value;
+ if (value === this.options.disabled) {
+ return this.$element;
+ }
+ return this.toggleDisabled();
+ };
+
+ BootstrapSwitch.prototype.toggleDisabled = function() {
+ this.options.disabled = !this.options.disabled;
+ this.$element.prop("disabled", this.options.disabled);
+ this.$wrapper.toggleClass(this.options.baseClass + "-disabled");
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.readonly = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.readonly;
+ }
+ value = !!value;
+ if (value === this.options.readonly) {
+ return this.$element;
+ }
+ return this.toggleReadonly();
+ };
+
+ BootstrapSwitch.prototype.toggleReadonly = function() {
+ this.options.readonly = !this.options.readonly;
+ this.$element.prop("readonly", this.options.readonly);
+ this.$wrapper.toggleClass(this.options.baseClass + "-readonly");
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.indeterminate = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.indeterminate;
+ }
+ value = !!value;
+ if (value === this.options.indeterminate) {
+ return this.$element;
+ }
+ return this.toggleIndeterminate();
+ };
+
+ BootstrapSwitch.prototype.toggleIndeterminate = function() {
+ this.options.indeterminate = !this.options.indeterminate;
+ this.$element.prop("indeterminate", this.options.indeterminate);
+ this.$wrapper.toggleClass(this.options.baseClass + "-indeterminate");
+ this._containerPosition();
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.inverse = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.inverse;
+ }
+ value = !!value;
+ if (value === this.options.inverse) {
+ return this.$element;
+ }
+ return this.toggleInverse();
+ };
+
+ BootstrapSwitch.prototype.toggleInverse = function() {
+ var $off, $on;
+ this.$wrapper.toggleClass(this.options.baseClass + "-inverse");
+ $on = this.$on.clone(true);
+ $off = this.$off.clone(true);
+ this.$on.replaceWith($off);
+ this.$off.replaceWith($on);
+ this.$on = $off;
+ this.$off = $on;
+ this.options.inverse = !this.options.inverse;
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.onColor = function(value) {
+ var color;
+ color = this.options.onColor;
+ if (typeof value === "undefined") {
+ return color;
+ }
+ if (color != null) {
+ this.$on.removeClass(this.options.baseClass + "-" + color);
+ }
+ this.$on.addClass(this.options.baseClass + "-" + value);
+ this.options.onColor = value;
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.offColor = function(value) {
+ var color;
+ color = this.options.offColor;
+ if (typeof value === "undefined") {
+ return color;
+ }
+ if (color != null) {
+ this.$off.removeClass(this.options.baseClass + "-" + color);
+ }
+ this.$off.addClass(this.options.baseClass + "-" + value);
+ this.options.offColor = value;
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.onText = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.onText;
+ }
+ this.$on.html(value);
+ this._width();
+ this._containerPosition();
+ this.options.onText = value;
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.offText = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.offText;
+ }
+ this.$off.html(value);
+ this._width();
+ this._containerPosition();
+ this.options.offText = value;
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.labelText = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.labelText;
+ }
+ this.$label.html(value);
+ this._width();
+ this.options.labelText = value;
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.handleWidth = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.handleWidth;
+ }
+ this.options.handleWidth = value;
+ this._width();
+ this._containerPosition();
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.labelWidth = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.labelWidth;
+ }
+ this.options.labelWidth = value;
+ this._width();
+ this._containerPosition();
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.baseClass = function(value) {
+ return this.options.baseClass;
+ };
+
+ BootstrapSwitch.prototype.wrapperClass = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.wrapperClass;
+ }
+ if (!value) {
+ value = $.fn.bootstrapSwitch.defaults.wrapperClass;
+ }
+ this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(" "));
+ this.$wrapper.addClass(this._getClasses(value).join(" "));
+ this.options.wrapperClass = value;
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.radioAllOff = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.radioAllOff;
+ }
+ value = !!value;
+ if (value === this.options.radioAllOff) {
+ return this.$element;
+ }
+ this.options.radioAllOff = value;
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.onInit = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.onInit;
+ }
+ if (!value) {
+ value = $.fn.bootstrapSwitch.defaults.onInit;
+ }
+ this.options.onInit = value;
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.onSwitchChange = function(value) {
+ if (typeof value === "undefined") {
+ return this.options.onSwitchChange;
+ }
+ if (!value) {
+ value = $.fn.bootstrapSwitch.defaults.onSwitchChange;
+ }
+ this.options.onSwitchChange = value;
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype.destroy = function() {
+ var $form;
+ $form = this.$element.closest("form");
+ if ($form.length) {
+ $form.off("reset.bootstrapSwitch").removeData("bootstrap-switch");
+ }
+ this.$container.children().not(this.$element).remove();
+ this.$element.unwrap().unwrap().off(".bootstrapSwitch").removeData("bootstrap-switch");
+ return this.$element;
+ };
+
+ BootstrapSwitch.prototype._width = function() {
+ var $handles, handleWidth;
+ $handles = this.$on.add(this.$off);
+ $handles.add(this.$label).css("width", "");
+ handleWidth = this.options.handleWidth === "auto" ? Math.max(this.$on.width(), this.$off.width()) : this.options.handleWidth;
+ $handles.width(handleWidth);
+ this.$label.width((function(_this) {
+ return function(index, width) {
+ if (_this.options.labelWidth !== "auto") {
+ return _this.options.labelWidth;
+ }
+ if (width < handleWidth) {
+ return handleWidth;
+ } else {
+ return width;
+ }
+ };
+ })(this));
+ this._handleWidth = this.$on.outerWidth();
+ this._labelWidth = this.$label.outerWidth();
+ this.$container.width((this._handleWidth * 2) + this._labelWidth);
+ return this.$wrapper.width(this._handleWidth + this._labelWidth);
+ };
+
+ BootstrapSwitch.prototype._containerPosition = function(state, callback) {
+ if (state == null) {
+ state = this.options.state;
+ }
+ this.$container.css("margin-left", (function(_this) {
+ return function() {
+ var values;
+ values = [0, "-" + _this._handleWidth + "px"];
+ if (_this.options.indeterminate) {
+ return "-" + (_this._handleWidth / 2) + "px";
+ }
+ if (state) {
+ if (_this.options.inverse) {
+ return values[1];
+ } else {
+ return values[0];
+ }
+ } else {
+ if (_this.options.inverse) {
+ return values[0];
+ } else {
+ return values[1];
+ }
+ }
+ };
+ })(this));
+ if (!callback) {
+ return;
+ }
+ return setTimeout(function() {
+ return callback();
+ }, 50);
+ };
+
+ BootstrapSwitch.prototype._init = function() {
+ var init, initInterval;
+ init = (function(_this) {
+ return function() {
+ _this.setPrevOptions();
+ _this._width();
+ return _this._containerPosition(null, function() {
+ if (_this.options.animate) {
+ return _this.$wrapper.addClass(_this.options.baseClass + "-animate");
+ }
+ });
+ };
+ })(this);
+ if (this.$wrapper.is(":visible")) {
+ return init();
+ }
+ return initInterval = window.setInterval((function(_this) {
+ return function() {
+ if (_this.$wrapper.is(":visible")) {
+ init();
+ return window.clearInterval(initInterval);
+ }
+ };
+ })(this), 50);
+ };
+
+ BootstrapSwitch.prototype._elementHandlers = function() {
+ return this.$element.on({
+ "setPreviousOptions.bootstrapSwitch": (function(_this) {
+ return function(e) {
+ return _this.setPrevOptions();
+ };
+ })(this),
+ "previousState.bootstrapSwitch": (function(_this) {
+ return function(e) {
+ _this.options = _this.prevOptions;
+ if (_this.options.indeterminate) {
+ _this.$wrapper.addClass(_this.options.baseClass + "-indeterminate");
+ }
+ return _this.$element.prop("checked", _this.options.state).trigger("change.bootstrapSwitch", true);
+ };
+ })(this),
+ "change.bootstrapSwitch": (function(_this) {
+ return function(e, skip) {
+ var state;
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ state = _this.$element.is(":checked");
+ _this._containerPosition(state);
+ if (state === _this.options.state) {
+ return;
+ }
+ _this.options.state = state;
+ _this.$wrapper.toggleClass(_this.options.baseClass + "-off").toggleClass(_this.options.baseClass + "-on");
+ if (!skip) {
+ if (_this.$element.is(":radio")) {
+ $("[name='" + (_this.$element.attr('name')) + "']").not(_this.$element).prop("checked", false).trigger("change.bootstrapSwitch", true);
+ }
+ return _this.$element.trigger("switchChange.bootstrapSwitch", [state]);
+ }
+ };
+ })(this),
+ "focus.bootstrapSwitch": (function(_this) {
+ return function(e) {
+ e.preventDefault();
+ return _this.$wrapper.addClass(_this.options.baseClass + "-focused");
+ };
+ })(this),
+ "blur.bootstrapSwitch": (function(_this) {
+ return function(e) {
+ e.preventDefault();
+ return _this.$wrapper.removeClass(_this.options.baseClass + "-focused");
+ };
+ })(this),
+ "keydown.bootstrapSwitch": (function(_this) {
+ return function(e) {
+ if (!e.which || _this.options.disabled || _this.options.readonly) {
+ return;
+ }
+ switch (e.which) {
+ case 37:
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ return _this.state(false);
+ case 39:
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ return _this.state(true);
+ }
+ };
+ })(this)
+ });
+ };
+
+ BootstrapSwitch.prototype._handleHandlers = function() {
+ this.$on.on("click.bootstrapSwitch", (function(_this) {
+ return function(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ _this.state(false);
+ return _this.$element.trigger("focus.bootstrapSwitch");
+ };
+ })(this));
+ return this.$off.on("click.bootstrapSwitch", (function(_this) {
+ return function(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ _this.state(true);
+ return _this.$element.trigger("focus.bootstrapSwitch");
+ };
+ })(this));
+ };
+
+ BootstrapSwitch.prototype._labelHandlers = function() {
+ return this.$label.on({
+ "click": function(e) {
+ return e.stopPropagation();
+ },
+ "mousedown.bootstrapSwitch touchstart.bootstrapSwitch": (function(_this) {
+ return function(e) {
+ if (_this._dragStart || _this.options.disabled || _this.options.readonly) {
+ return;
+ }
+ e.preventDefault();
+ e.stopPropagation();
+ _this._dragStart = (e.pageX || e.originalEvent.touches[0].pageX) - parseInt(_this.$container.css("margin-left"), 10);
+ if (_this.options.animate) {
+ _this.$wrapper.removeClass(_this.options.baseClass + "-animate");
+ }
+ return _this.$element.trigger("focus.bootstrapSwitch");
+ };
+ })(this),
+ "mousemove.bootstrapSwitch touchmove.bootstrapSwitch": (function(_this) {
+ return function(e) {
+ var difference;
+ if (_this._dragStart == null) {
+ return;
+ }
+ e.preventDefault();
+ difference = (e.pageX || e.originalEvent.touches[0].pageX) - _this._dragStart;
+ if (difference < -_this._handleWidth || difference > 0) {
+ return;
+ }
+ _this._dragEnd = difference;
+ return _this.$container.css("margin-left", _this._dragEnd + "px");
+ };
+ })(this),
+ "mouseup.bootstrapSwitch touchend.bootstrapSwitch": (function(_this) {
+ return function(e) {
+ var state;
+ if (!_this._dragStart) {
+ return;
+ }
+ e.preventDefault();
+ if (_this.options.animate) {
+ _this.$wrapper.addClass(_this.options.baseClass + "-animate");
+ }
+ if (_this._dragEnd) {
+ state = _this._dragEnd > -(_this._handleWidth / 2);
+ _this._dragEnd = false;
+ _this.state(_this.options.inverse ? !state : state);
+ } else {
+ _this.state(!_this.options.state);
+ }
+ return _this._dragStart = false;
+ };
+ })(this),
+ "mouseleave.bootstrapSwitch": (function(_this) {
+ return function(e) {
+ return _this.$label.trigger("mouseup.bootstrapSwitch");
+ };
+ })(this)
+ });
+ };
+
+ BootstrapSwitch.prototype._externalLabelHandler = function() {
+ var $externalLabel;
+ $externalLabel = this.$element.closest("label");
+ return $externalLabel.on("click", (function(_this) {
+ return function(event) {
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ if (event.target === $externalLabel[0]) {
+ return _this.toggleState();
+ }
+ };
+ })(this));
+ };
+
+ BootstrapSwitch.prototype._formHandler = function() {
+ var $form;
+ $form = this.$element.closest("form");
+ if ($form.data("bootstrap-switch")) {
+ return;
+ }
+ return $form.on("reset.bootstrapSwitch", function() {
+ return window.setTimeout(function() {
+ return $form.find("input").filter(function() {
+ return $(this).data("bootstrap-switch");
+ }).each(function() {
+ return $(this).bootstrapSwitch("state", this.checked);
+ });
+ }, 1);
+ }).data("bootstrap-switch", true);
+ };
+
+ BootstrapSwitch.prototype._getClasses = function(classes) {
+ var c, cls, i, len;
+ if (!$.isArray(classes)) {
+ return [this.options.baseClass + "-" + classes];
+ }
+ cls = [];
+ for (i = 0, len = classes.length; i < len; i++) {
+ c = classes[i];
+ cls.push(this.options.baseClass + "-" + c);
+ }
+ return cls;
+ };
+
+ return BootstrapSwitch;
+
+ })();
+ $.fn.bootstrapSwitch = function() {
+ var args, option, ret;
+ option = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : [];
+ ret = this;
+ this.each(function() {
+ var $this, data;
+ $this = $(this);
+ data = $this.data("bootstrap-switch");
+ if (!data) {
+ $this.data("bootstrap-switch", data = new BootstrapSwitch(this, option));
+ }
+ if (typeof option === "string") {
+ return ret = data[option].apply(data, args);
+ }
+ });
+ return ret;
+ };
+ $.fn.bootstrapSwitch.Constructor = BootstrapSwitch;
+ return $.fn.bootstrapSwitch.defaults = {
+ state: true,
+ size: null,
+ animate: true,
+ disabled: false,
+ readonly: false,
+ indeterminate: false,
+ inverse: false,
+ radioAllOff: false,
+ onColor: "primary",
+ offColor: "default",
+ onText: "ON",
+ offText: "OFF",
+ labelText: "&nbsp;",
+ handleWidth: "auto",
+ labelWidth: "auto",
+ baseClass: "bootstrap-switch",
+ wrapperClass: "wrapper",
+ onInit: function() {},
+ onSwitchChange: function() {}
+ };
+ })(window.jQuery, window);
+
+}).call(this); \ No newline at end of file
diff --git a/public/js/plugins/bootstrap-tagsinput.js b/public/js/plugins/bootstrap-tagsinput.js
new file mode 100644
index 0000000..c7bbd19
--- /dev/null
+++ b/public/js/plugins/bootstrap-tagsinput.js
@@ -0,0 +1,685 @@
+/*
+ * bootstrap-tagsinput v0.8.0
+ *
+ */
+
+(function($) {
+ "use strict";
+
+ var defaultOptions = {
+ tagClass: function(item) {
+ return 'badge badge-danger';
+ },
+ itemValue: function(item) {
+ return item ? item.toString() : item;
+ },
+ itemText: function(item) {
+ return this.itemValue(item);
+ },
+ itemTitle: function(item) {
+ return null;
+ },
+ freeInput: true,
+ addOnBlur: true,
+ maxTags: undefined,
+ maxChars: undefined,
+ confirmKeys: [13, 44],
+ delimiter: ',',
+ delimiterRegex: null,
+ cancelConfirmKeysOnEmpty: true,
+ onTagExists: function(item, $tag) {
+ $tag.hide().fadeIn();
+ },
+ trimValue: false,
+ allowDuplicates: false
+ };
+
+ /**
+ * Constructor function
+ */
+ function TagsInput(element, options) {
+ this.itemsArray = [];
+
+ this.$element = $(element);
+ this.$element.hide();
+
+ this.isSelect = (element.tagName === 'SELECT');
+ this.multiple = (this.isSelect && element.hasAttribute('multiple'));
+ this.objectItems = options && options.itemValue;
+ this.placeholderText = element.hasAttribute('placeholder') ? this.$element.attr('placeholder') : '';
+ this.inputSize = Math.max(1, this.placeholderText.length);
+
+ this.$container = $('<div class="bootstrap-tagsinput"></div>');
+ this.$input = $('<input type="text" placeholder="' + this.placeholderText + '"/>').appendTo(this.$container);
+
+ this.$element.before(this.$container);
+
+ this.build(options);
+ }
+
+ TagsInput.prototype = {
+ constructor: TagsInput,
+
+ /**
+ * Adds the given item as a new tag. Pass true to dontPushVal to prevent
+ * updating the elements val()
+ */
+ add: function(item, dontPushVal, options) {
+ var self = this;
+
+ if (self.options.maxTags && self.itemsArray.length >= self.options.maxTags)
+ return;
+
+ // Ignore falsey values, except false
+ if (item !== false && !item)
+ return;
+
+ // Trim value
+ if (typeof item === "string" && self.options.trimValue) {
+ item = $.trim(item);
+ }
+
+ // Throw an error when trying to add an object while the itemValue option was not set
+ if (typeof item === "object" && !self.objectItems)
+ throw ("Can't add objects when itemValue option is not set");
+
+ // Ignore strings only containg whitespace
+ if (item.toString().match(/^\s*$/))
+ return;
+
+ // If SELECT but not multiple, remove current tag
+ if (self.isSelect && !self.multiple && self.itemsArray.length > 0)
+ self.remove(self.itemsArray[0]);
+
+ if (typeof item === "string" && this.$element[0].tagName === 'INPUT') {
+ var delimiter = (self.options.delimiterRegex) ? self.options.delimiterRegex : self.options.delimiter;
+ var items = item.split(delimiter);
+ if (items.length > 1) {
+ for (var i = 0; i < items.length; i++) {
+ this.add(items[i], true);
+ }
+
+ if (!dontPushVal)
+ self.pushVal();
+ return;
+ }
+ }
+
+ var itemValue = self.options.itemValue(item),
+ itemText = self.options.itemText(item),
+ tagClass = self.options.tagClass(item),
+ itemTitle = self.options.itemTitle(item);
+
+ // Ignore items allready added
+ var existing = $.grep(self.itemsArray, function(item) {
+ return self.options.itemValue(item) === itemValue;
+ })[0];
+ if (existing && !self.options.allowDuplicates) {
+ // Invoke onTagExists
+ if (self.options.onTagExists) {
+ var $existingTag = $(".tag", self.$container).filter(function() {
+ return $(this).data("item") === existing;
+ });
+ self.options.onTagExists(item, $existingTag);
+ }
+ return;
+ }
+
+ // if length greater than limit
+ if (self.items().toString().length + item.length + 1 > self.options.maxInputLength)
+ return;
+
+ // raise beforeItemAdd arg
+ var beforeItemAddEvent = $.Event('beforeItemAdd', {
+ item: item,
+ cancel: false,
+ options: options
+ });
+ self.$element.trigger(beforeItemAddEvent);
+ if (beforeItemAddEvent.cancel)
+ return;
+
+ // register item in internal array and map
+ self.itemsArray.push(item);
+
+ // add a tag element
+
+ var $tag = $('<span class="tag ' + htmlEncode(tagClass) + (itemTitle !== null ? ('" title="' + itemTitle) : '') + '">' + htmlEncode(itemText) + '<span data-role="remove"></span></span>');
+ $tag.data('item', item);
+ self.findInputWrapper().before($tag);
+ $tag.after(' ');
+
+ // add <option /> if item represents a value not present in one of the <select />'s options
+ if (self.isSelect && !$('option[value="' + encodeURIComponent(itemValue) + '"]', self.$element)[0]) {
+ var $option = $('<option selected>' + htmlEncode(itemText) + '</option>');
+ $option.data('item', item);
+ $option.attr('value', itemValue);
+ self.$element.append($option);
+ }
+
+ if (!dontPushVal)
+ self.pushVal();
+
+ // Add class when reached maxTags
+ if (self.options.maxTags === self.itemsArray.length || self.items().toString().length === self.options.maxInputLength)
+ self.$container.addClass('bootstrap-tagsinput-max');
+
+ self.$element.trigger($.Event('itemAdded', {
+ item: item,
+ options: options
+ }));
+ },
+
+ /**
+ * Removes the given item. Pass true to dontPushVal to prevent updating the
+ * elements val()
+ */
+ remove: function(item, dontPushVal, options) {
+ var self = this;
+
+ if (self.objectItems) {
+ if (typeof item === "object")
+ item = $.grep(self.itemsArray, function(other) {
+ return self.options.itemValue(other) == self.options.itemValue(item);
+ });
+ else
+ item = $.grep(self.itemsArray, function(other) {
+ return self.options.itemValue(other) == item;
+ });
+
+ item = item[item.length - 1];
+ }
+
+ if (item) {
+ var beforeItemRemoveEvent = $.Event('beforeItemRemove', {
+ item: item,
+ cancel: false,
+ options: options
+ });
+ self.$element.trigger(beforeItemRemoveEvent);
+ if (beforeItemRemoveEvent.cancel)
+ return;
+
+ $('.tag', self.$container).filter(function() {
+ return $(this).data('item') === item;
+ }).remove();
+ $('option', self.$element).filter(function() {
+ return $(this).data('item') === item;
+ }).remove();
+ if ($.inArray(item, self.itemsArray) !== -1)
+ self.itemsArray.splice($.inArray(item, self.itemsArray), 1);
+ }
+
+ if (!dontPushVal)
+ self.pushVal();
+
+ // Remove class when reached maxTags
+ if (self.options.maxTags > self.itemsArray.length)
+ self.$container.removeClass('bootstrap-tagsinput-max');
+
+ self.$element.trigger($.Event('itemRemoved', {
+ item: item,
+ options: options
+ }));
+ },
+
+ /**
+ * Removes all items
+ */
+ removeAll: function() {
+ var self = this;
+
+ $('.tag', self.$container).remove();
+ $('option', self.$element).remove();
+
+ while (self.itemsArray.length > 0)
+ self.itemsArray.pop();
+
+ self.pushVal();
+ },
+
+ /**
+ * Refreshes the tags so they match the text/value of their corresponding
+ * item.
+ */
+ refresh: function() {
+ var self = this;
+ $('.tag', self.$container).each(function() {
+ var $tag = $(this),
+ item = $tag.data('item'),
+ itemValue = self.options.itemValue(item),
+ itemText = self.options.itemText(item),
+ tagClass = self.options.tagClass(item);
+
+ // Update tag's class and inner text
+ $tag.attr('class', null);
+ $tag.addClass('tag ' + htmlEncode(tagClass));
+ $tag.contents().filter(function() {
+ return this.nodeType == 3;
+ })[0].nodeValue = htmlEncode(itemText);
+
+ if (self.isSelect) {
+ var option = $('option', self.$element).filter(function() {
+ return $(this).data('item') === item;
+ });
+ option.attr('value', itemValue);
+ }
+ });
+ },
+
+ /**
+ * Returns the items added as tags
+ */
+ items: function() {
+ return this.itemsArray;
+ },
+
+ /**
+ * Assembly value by retrieving the value of each item, and set it on the
+ * element.
+ */
+ pushVal: function() {
+ var self = this,
+ val = $.map(self.items(), function(item) {
+ return self.options.itemValue(item).toString();
+ });
+
+ self.$element.val(val, true).trigger('change');
+ },
+
+ /**
+ * Initializes the tags input behaviour on the element
+ */
+ build: function(options) {
+ var self = this;
+
+ self.options = $.extend({}, defaultOptions, options);
+ // When itemValue is set, freeInput should always be false
+ if (self.objectItems)
+ self.options.freeInput = false;
+
+ makeOptionItemFunction(self.options, 'itemValue');
+ makeOptionItemFunction(self.options, 'itemText');
+ makeOptionFunction(self.options, 'tagClass');
+
+ // Typeahead Bootstrap version 2.3.2
+ if (self.options.typeahead) {
+ var typeahead = self.options.typeahead || {};
+
+ makeOptionFunction(typeahead, 'source');
+
+ self.$input.typeahead($.extend({}, typeahead, {
+ source: function(query, process) {
+ function processItems(items) {
+ var texts = [];
+
+ for (var i = 0; i < items.length; i++) {
+ var text = self.options.itemText(items[i]);
+ map[text] = items[i];
+ texts.push(text);
+ }
+ process(texts);
+ }
+
+ this.map = {};
+ var map = this.map,
+ data = typeahead.source(query);
+
+ if ($.isFunction(data.success)) {
+ // support for Angular callbacks
+ data.success(processItems);
+ } else if ($.isFunction(data.then)) {
+ // support for Angular promises
+ data.then(processItems);
+ } else {
+ // support for functions and jquery promises
+ $.when(data)
+ .then(processItems);
+ }
+ },
+ updater: function(text) {
+ self.add(this.map[text]);
+ return this.map[text];
+ },
+ matcher: function(text) {
+ return (text.toLowerCase().indexOf(this.query.trim().toLowerCase()) !== -1);
+ },
+ sorter: function(texts) {
+ return texts.sort();
+ },
+ highlighter: function(text) {
+ var regex = new RegExp('(' + this.query + ')', 'gi');
+ return text.replace(regex, "<strong>$1</strong>");
+ }
+ }));
+ }
+
+ // typeahead.js
+ if (self.options.typeaheadjs) {
+ var typeaheadConfig = null;
+ var typeaheadDatasets = {};
+
+ // Determine if main configurations were passed or simply a dataset
+ var typeaheadjs = self.options.typeaheadjs;
+ if ($.isArray(typeaheadjs)) {
+ typeaheadConfig = typeaheadjs[0];
+ typeaheadDatasets = typeaheadjs[1];
+ } else {
+ typeaheadDatasets = typeaheadjs;
+ }
+
+ self.$input.typeahead(typeaheadConfig, typeaheadDatasets).on('typeahead:selected', $.proxy(function(obj, datum) {
+ if (typeaheadDatasets.valueKey)
+ self.add(datum[typeaheadDatasets.valueKey]);
+ else
+ self.add(datum);
+ self.$input.typeahead('val', '');
+ }, self));
+ }
+
+ self.$container.on('click', $.proxy(function(event) {
+ if (!self.$element.attr('disabled')) {
+ self.$input.removeAttr('disabled');
+ }
+ self.$input.focus();
+ }, self));
+
+ if (self.options.addOnBlur && self.options.freeInput) {
+ self.$input.on('focusout', $.proxy(function(event) {
+ // HACK: only process on focusout when no typeahead opened, to
+ // avoid adding the typeahead text as tag
+ if ($('.typeahead, .twitter-typeahead', self.$container).length === 0) {
+ self.add(self.$input.val());
+ self.$input.val('');
+ }
+ }, self));
+ }
+
+
+ self.$container.on('keydown', 'input', $.proxy(function(event) {
+ var $input = $(event.target),
+ $inputWrapper = self.findInputWrapper();
+
+ if (self.$element.attr('disabled')) {
+ self.$input.attr('disabled', 'disabled');
+ return;
+ }
+
+ switch (event.which) {
+ // BACKSPACE
+ case 8:
+ if (doGetCaretPosition($input[0]) === 0) {
+ var prev = $inputWrapper.prev();
+ if (prev.length) {
+ self.remove(prev.data('item'));
+ }
+ }
+ break;
+
+ // DELETE
+ case 46:
+ if (doGetCaretPosition($input[0]) === 0) {
+ var next = $inputWrapper.next();
+ if (next.length) {
+ self.remove(next.data('item'));
+ }
+ }
+ break;
+
+ // LEFT ARROW
+ case 37:
+ // Try to move the input before the previous tag
+ var $prevTag = $inputWrapper.prev();
+ if ($input.val().length === 0 && $prevTag[0]) {
+ $prevTag.before($inputWrapper);
+ $input.focus();
+ }
+ break;
+ // RIGHT ARROW
+ case 39:
+ // Try to move the input after the next tag
+ var $nextTag = $inputWrapper.next();
+ if ($input.val().length === 0 && $nextTag[0]) {
+ $nextTag.after($inputWrapper);
+ $input.focus();
+ }
+ break;
+ default:
+ // ignore
+ }
+
+ // Reset internal input's size
+ var textLength = $input.val().length,
+ wordSpace = Math.ceil(textLength / 5),
+ size = textLength + wordSpace + 1;
+ $input.attr('size', Math.max(this.inputSize, $input.val().length));
+ }, self));
+
+ self.$container.on('keypress', 'input', $.proxy(function(event) {
+ var $input = $(event.target);
+
+ if (self.$element.attr('disabled')) {
+ self.$input.attr('disabled', 'disabled');
+ return;
+ }
+
+ var text = $input.val(),
+ maxLengthReached = self.options.maxChars && text.length >= self.options.maxChars;
+ if (self.options.freeInput && (keyCombinationInList(event, self.options.confirmKeys) || maxLengthReached)) {
+ // Only attempt to add a tag if there is data in the field
+ if (text.length !== 0) {
+ self.add(maxLengthReached ? text.substr(0, self.options.maxChars) : text);
+ $input.val('');
+ }
+
+ // If the field is empty, let the event triggered fire as usual
+ if (self.options.cancelConfirmKeysOnEmpty === false) {
+ event.preventDefault();
+ }
+ }
+
+ // Reset internal input's size
+ var textLength = $input.val().length,
+ wordSpace = Math.ceil(textLength / 5),
+ size = textLength + wordSpace + 1;
+ $input.attr('size', Math.max(this.inputSize, $input.val().length));
+ }, self));
+
+ // Remove icon clicked
+ self.$container.on('click', '[data-role=remove]', $.proxy(function(event) {
+ if (self.$element.attr('disabled')) {
+ return;
+ }
+ self.remove($(event.target).closest('.tag').data('item'));
+ }, self));
+
+ // Only add existing value as tags when using strings as tags
+ if (self.options.itemValue === defaultOptions.itemValue) {
+ if (self.$element[0].tagName === 'INPUT') {
+ self.add(self.$element.val());
+ } else {
+ $('option', self.$element).each(function() {
+ self.add($(this).attr('value'), true);
+ });
+ }
+ }
+ },
+
+ /**
+ * Removes all tagsinput behaviour and unregsiter all event handlers
+ */
+ destroy: function() {
+ var self = this;
+
+ // Unbind events
+ self.$container.off('keypress', 'input');
+ self.$container.off('click', '[role=remove]');
+
+ self.$container.remove();
+ self.$element.removeData('tagsinput');
+ self.$element.show();
+ },
+
+ /**
+ * Sets focus on the tagsinput
+ */
+ focus: function() {
+ this.$input.focus();
+ },
+
+ /**
+ * Returns the internal input element
+ */
+ input: function() {
+ return this.$input;
+ },
+
+ /**
+ * Returns the element which is wrapped around the internal input. This
+ * is normally the $container, but typeahead.js moves the $input element.
+ */
+ findInputWrapper: function() {
+ var elt = this.$input[0],
+ container = this.$container[0];
+ while (elt && elt.parentNode !== container)
+ elt = elt.parentNode;
+
+ return $(elt);
+ }
+ };
+
+ /**
+ * Register JQuery plugin
+ */
+ $.fn.tagsinput = function(arg1, arg2, arg3) {
+ var results = [];
+
+ this.each(function() {
+ var tagsinput = $(this).data('tagsinput');
+ // Initialize a new tags input
+ if (!tagsinput) {
+ tagsinput = new TagsInput(this, arg1);
+ $(this).data('tagsinput', tagsinput);
+ results.push(tagsinput);
+
+ if (this.tagName === 'SELECT') {
+ $('option', $(this)).attr('selected', 'selected');
+ }
+
+ // Init tags from $(this).val()
+ $(this).val($(this).val());
+ } else if (!arg1 && !arg2) {
+ // tagsinput already exists
+ // no function, trying to init
+ results.push(tagsinput);
+ } else if (tagsinput[arg1] !== undefined) {
+ // Invoke function on existing tags input
+ if (tagsinput[arg1].length === 3 && arg3 !== undefined) {
+ var retVal = tagsinput[arg1](arg2, null, arg3);
+ } else {
+ var retVal = tagsinput[arg1](arg2);
+ }
+ if (retVal !== undefined)
+ results.push(retVal);
+ }
+ });
+
+ if (typeof arg1 == 'string') {
+ // Return the results from the invoked function calls
+ return results.length > 1 ? results : results[0];
+ } else {
+ return results;
+ }
+ };
+
+ $.fn.tagsinput.Constructor = TagsInput;
+
+ /**
+ * Most options support both a string or number as well as a function as
+ * option value. This function makes sure that the option with the given
+ * key in the given options is wrapped in a function
+ */
+ function makeOptionItemFunction(options, key) {
+ if (typeof options[key] !== 'function') {
+ var propertyName = options[key];
+ options[key] = function(item) {
+ return item[propertyName];
+ };
+ }
+ }
+
+ function makeOptionFunction(options, key) {
+ if (typeof options[key] !== 'function') {
+ var value = options[key];
+ options[key] = function() {
+ return value;
+ };
+ }
+ }
+ /**
+ * HtmlEncodes the given value
+ */
+ var htmlEncodeContainer = $('<div />');
+
+ function htmlEncode(value) {
+ if (value) {
+ return htmlEncodeContainer.text(value).html();
+ } else {
+ return '';
+ }
+ }
+
+ /**
+ * Returns the position of the caret in the given input field
+ * http://flightschool.acylt.com/devnotes/caret-position-woes/
+ */
+ function doGetCaretPosition(oField) {
+ var iCaretPos = 0;
+ if (document.selection) {
+ oField.focus();
+ var oSel = document.selection.createRange();
+ oSel.moveStart('character', -oField.value.length);
+ iCaretPos = oSel.text.length;
+ } else if (oField.selectionStart || oField.selectionStart == '0') {
+ iCaretPos = oField.selectionStart;
+ }
+ return (iCaretPos);
+ }
+
+ /**
+ * Returns boolean indicates whether user has pressed an expected key combination.
+ * @param object keyPressEvent: JavaScript event object, refer
+ * http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+ * @param object lookupList: expected key combinations, as in:
+ * [13, {which: 188, shiftKey: true}]
+ */
+ function keyCombinationInList(keyPressEvent, lookupList) {
+ var found = false;
+ $.each(lookupList, function(index, keyCombination) {
+ if (typeof(keyCombination) === 'number' && keyPressEvent.which === keyCombination) {
+ found = true;
+ return false;
+ }
+
+ if (keyPressEvent.which === keyCombination.which) {
+ var alt = !keyCombination.hasOwnProperty('altKey') || keyPressEvent.altKey === keyCombination.altKey,
+ shift = !keyCombination.hasOwnProperty('shiftKey') || keyPressEvent.shiftKey === keyCombination.shiftKey,
+ ctrl = !keyCombination.hasOwnProperty('ctrlKey') || keyPressEvent.ctrlKey === keyCombination.ctrlKey;
+ if (alt && shift && ctrl) {
+ found = true;
+ return false;
+ }
+ }
+ });
+
+ return found;
+ }
+
+ /**
+ * Initialize tagsinput behaviour on inputs and selects which have
+ * data-role=tagsinput
+ */
+ $(function() {
+ $("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput();
+ });
+})(window.jQuery); \ No newline at end of file
diff --git a/public/js/plugins/jasny-bootstrap.min.js b/public/js/plugins/jasny-bootstrap.min.js
new file mode 100644
index 0000000..6eb1756
--- /dev/null
+++ b/public/js/plugins/jasny-bootstrap.min.js
@@ -0,0 +1,6 @@
+/*!
+ * Jasny Bootstrap v3.1.3 (http://jasny.github.io/bootstrap)
+ * Copyright 2012-2014 Arnold Daniels
+ * Licensed under Apache-2.0 (https://github.com/jasny/bootstrap/blob/master/LICENSE)
+ */
+if("undefined"==typeof jQuery)throw new Error("Jasny Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}void 0===a.support.transition&&(a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()}))}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.state=null,this.placement=null,this.options.recalc&&(this.calcClone(),a(window).on("resize",a.proxy(this.recalc,this))),this.options.autohide&&a(document).on("click",a.proxy(this.autohide,this)),this.options.toggle&&this.toggle(),this.options.disablescrolling&&(this.options.disableScrolling=this.options.disablescrolling,delete this.options.disablescrolling)};b.DEFAULTS={toggle:!0,placement:"auto",autohide:!0,recalc:!0,disableScrolling:!0},b.prototype.offset=function(){switch(this.placement){case"left":case"right":return this.$element.outerWidth();case"top":case"bottom":return this.$element.outerHeight()}},b.prototype.calcPlacement=function(){function b(a,b){if("auto"===e.css(b))return a;if("auto"===e.css(a))return b;var c=parseInt(e.css(a),10),d=parseInt(e.css(b),10);return c>d?b:a}if("auto"!==this.options.placement)return void(this.placement=this.options.placement);this.$element.hasClass("in")||this.$element.css("visiblity","hidden !important").addClass("in");var c=a(window).width()/this.$element.width(),d=a(window).height()/this.$element.height(),e=this.$element;this.placement=c>=d?b("left","right"):b("top","bottom"),"hidden !important"===this.$element.css("visibility")&&this.$element.removeClass("in").css("visiblity","")},b.prototype.opposite=function(a){switch(a){case"top":return"bottom";case"left":return"right";case"bottom":return"top";case"right":return"left"}},b.prototype.getCanvasElements=function(){var b=this.options.canvas?a(this.options.canvas):this.$element,c=b.find("*").filter(function(){return"fixed"===a(this).css("position")}).not(this.options.exclude);return b.add(c)},b.prototype.slide=function(b,c,d){if(!a.support.transition){var e={};return e[this.placement]="+="+c,b.animate(e,350,d)}var f=this.placement,g=this.opposite(f);b.each(function(){"auto"!==a(this).css(f)&&a(this).css(f,(parseInt(a(this).css(f),10)||0)+c),"auto"!==a(this).css(g)&&a(this).css(g,(parseInt(a(this).css(g),10)||0)-c)}),this.$element.one(a.support.transition.end,d).emulateTransitionEnd(350)},b.prototype.disableScrolling=function(){var b=a("body").width(),c="padding-"+this.opposite(this.placement);if(void 0===a("body").data("offcanvas-style")&&a("body").data("offcanvas-style",a("body").attr("style")||""),a("body").css("overflow","hidden"),a("body").width()>b){var d=parseInt(a("body").css(c),10)+a("body").width()-b;setTimeout(function(){a("body").css(c,d)},1)}},b.prototype.show=function(){if(!this.state){var b=a.Event("show.bs.offcanvas");if(this.$element.trigger(b),!b.isDefaultPrevented()){this.state="slide-in",this.calcPlacement();var c=this.getCanvasElements(),d=this.placement,e=this.opposite(d),f=this.offset();-1!==c.index(this.$element)&&(a(this.$element).data("offcanvas-style",a(this.$element).attr("style")||""),this.$element.css(d,-1*f),this.$element.css(d)),c.addClass("canvas-sliding").each(function(){void 0===a(this).data("offcanvas-style")&&a(this).data("offcanvas-style",a(this).attr("style")||""),"static"===a(this).css("position")&&a(this).css("position","relative"),"auto"!==a(this).css(d)&&"0px"!==a(this).css(d)||"auto"!==a(this).css(e)&&"0px"!==a(this).css(e)||a(this).css(d,0)}),this.options.disableScrolling&&this.disableScrolling();var g=function(){"slide-in"==this.state&&(this.state="slid",c.removeClass("canvas-sliding").addClass("canvas-slid"),this.$element.trigger("shown.bs.offcanvas"))};setTimeout(a.proxy(function(){this.$element.addClass("in"),this.slide(c,f,a.proxy(g,this))},this),1)}}},b.prototype.hide=function(){if("slid"===this.state){var b=a.Event("hide.bs.offcanvas");if(this.$element.trigger(b),!b.isDefaultPrevented()){this.state="slide-out";var c=a(".canvas-slid"),d=(this.placement,-1*this.offset()),e=function(){"slide-out"==this.state&&(this.state=null,this.placement=null,this.$element.removeClass("in"),c.removeClass("canvas-sliding"),c.add(this.$element).add("body").each(function(){a(this).attr("style",a(this).data("offcanvas-style")).removeData("offcanvas-style")}),this.$element.trigger("hidden.bs.offcanvas"))};c.removeClass("canvas-slid").addClass("canvas-sliding"),setTimeout(a.proxy(function(){this.slide(c,d,a.proxy(e,this))},this),1)}}},b.prototype.toggle=function(){"slide-in"!==this.state&&"slide-out"!==this.state&&this["slid"===this.state?"hide":"show"]()},b.prototype.calcClone=function(){this.$calcClone=this.$element.clone().html("").addClass("offcanvas-clone").removeClass("in").appendTo(a("body"))},b.prototype.recalc=function(){if("none"!==this.$calcClone.css("display")&&("slid"===this.state||"slide-in"===this.state)){this.state=null,this.placement=null;var b=this.getCanvasElements();this.$element.removeClass("in"),b.removeClass("canvas-slid"),b.add(this.$element).add("body").each(function(){a(this).attr("style",a(this).data("offcanvas-style")).removeData("offcanvas-style")})}},b.prototype.autohide=function(b){0===a(b.target).closest(this.$element).length&&this.hide()};var c=a.fn.offcanvas;a.fn.offcanvas=function(c){return this.each(function(){var d=a(this),e=d.data("bs.offcanvas"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.offcanvas",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.offcanvas.Constructor=b,a.fn.offcanvas.noConflict=function(){return a.fn.offcanvas=c,this},a(document).on("click.bs.offcanvas.data-api","[data-toggle=offcanvas]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.offcanvas"),h=g?"toggle":d.data();b.stopPropagation(),g?g.toggle():f.offcanvas(h)})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.$element.on("click.bs.rowlink","td:not(.rowlink-skip)",a.proxy(this.click,this))};b.DEFAULTS={target:"a"},b.prototype.click=function(b){var c=a(b.currentTarget).closest("tr").find(this.options.target)[0];if(a(b.target)[0]!==c)if(b.preventDefault(),c.click)c.click();else if(document.createEvent){var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),c.dispatchEvent(d)}};var c=a.fn.rowlink;a.fn.rowlink=function(c){return this.each(function(){var d=a(this),e=d.data("bs.rowlink");e||d.data("bs.rowlink",e=new b(this,c))})},a.fn.rowlink.Constructor=b,a.fn.rowlink.noConflict=function(){return a.fn.rowlink=c,this},a(document).on("click.bs.rowlink.data-api",'[data-link="row"]',function(b){if(0===a(b.target).closest(".rowlink-skip").length){var c=a(this);c.data("bs.rowlink")||(c.rowlink(c.data()),a(b.target).trigger("click.bs.rowlink"))}})}(window.jQuery),+function(a){"use strict";var b=void 0!==window.orientation,c=navigator.userAgent.toLowerCase().indexOf("android")>-1,d="Microsoft Internet Explorer"==window.navigator.appName,e=function(b,d){c||(this.$element=a(b),this.options=a.extend({},e.DEFAULTS,d),this.mask=String(this.options.mask),this.init(),this.listen(),this.checkVal())};e.DEFAULTS={mask:"",placeholder:"_",definitions:{9:"[0-9]",a:"[A-Za-z]",w:"[A-Za-z0-9]","*":"."}},e.prototype.init=function(){var b=this.options.definitions,c=this.mask.length;this.tests=[],this.partialPosition=this.mask.length,this.firstNonMaskPos=null,a.each(this.mask.split(""),a.proxy(function(a,d){"?"==d?(c--,this.partialPosition=a):b[d]?(this.tests.push(new RegExp(b[d])),null===this.firstNonMaskPos&&(this.firstNonMaskPos=this.tests.length-1)):this.tests.push(null)},this)),this.buffer=a.map(this.mask.split(""),a.proxy(function(a){return"?"!=a?b[a]?this.options.placeholder:a:void 0},this)),this.focusText=this.$element.val(),this.$element.data("rawMaskFn",a.proxy(function(){return a.map(this.buffer,function(a,b){return this.tests[b]&&a!=this.options.placeholder?a:null}).join("")},this))},e.prototype.listen=function(){if(!this.$element.attr("readonly")){var b=(d?"paste":"input")+".mask";this.$element.on("unmask.bs.inputmask",a.proxy(this.unmask,this)).on("focus.bs.inputmask",a.proxy(this.focusEvent,this)).on("blur.bs.inputmask",a.proxy(this.blurEvent,this)).on("keydown.bs.inputmask",a.proxy(this.keydownEvent,this)).on("keypress.bs.inputmask",a.proxy(this.keypressEvent,this)).on(b,a.proxy(this.pasteEvent,this))}},e.prototype.caret=function(a,b){if(0!==this.$element.length){if("number"==typeof a)return b="number"==typeof b?b:a,this.$element.each(function(){if(this.setSelectionRange)this.setSelectionRange(a,b);else if(this.createTextRange){var c=this.createTextRange();c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",a),c.select()}});if(this.$element[0].setSelectionRange)a=this.$element[0].selectionStart,b=this.$element[0].selectionEnd;else if(document.selection&&document.selection.createRange){var c=document.selection.createRange();a=0-c.duplicate().moveStart("character",-1e5),b=a+c.text.length}return{begin:a,end:b}}},e.prototype.seekNext=function(a){for(var b=this.mask.length;++a<=b&&!this.tests[a];);return a},e.prototype.seekPrev=function(a){for(;--a>=0&&!this.tests[a];);return a},e.prototype.shiftL=function(a,b){var c=this.mask.length;if(!(0>a)){for(var d=a,e=this.seekNext(b);c>d;d++)if(this.tests[d]){if(!(c>e&&this.tests[d].test(this.buffer[e])))break;this.buffer[d]=this.buffer[e],this.buffer[e]=this.options.placeholder,e=this.seekNext(e)}this.writeBuffer(),this.caret(Math.max(this.firstNonMaskPos,a))}},e.prototype.shiftR=function(a){for(var b=this.mask.length,c=a,d=this.options.placeholder;b>c;c++)if(this.tests[c]){var e=this.seekNext(c),f=this.buffer[c];if(this.buffer[c]=d,!(b>e&&this.tests[e].test(f)))break;d=f}},e.prototype.unmask=function(){this.$element.unbind(".mask").removeData("inputmask")},e.prototype.focusEvent=function(){this.focusText=this.$element.val();var a=this.mask.length,b=this.checkVal();this.writeBuffer();var c=this,d=function(){b==a?c.caret(0,b):c.caret(b)};d(),setTimeout(d,50)},e.prototype.blurEvent=function(){this.checkVal(),this.$element.val()!==this.focusText&&this.$element.trigger("change")},e.prototype.keydownEvent=function(a){var c=a.which;if(8==c||46==c||b&&127==c){var d=this.caret(),e=d.begin,f=d.end;return f-e===0&&(e=46!=c?this.seekPrev(e):f=this.seekNext(e-1),f=46==c?this.seekNext(f):f),this.clearBuffer(e,f),this.shiftL(e,f-1),!1}return 27==c?(this.$element.val(this.focusText),this.caret(0,this.checkVal()),!1):void 0},e.prototype.keypressEvent=function(a){var b=this.mask.length,c=a.which,d=this.caret();if(a.ctrlKey||a.altKey||a.metaKey||32>c)return!0;if(c){d.end-d.begin!==0&&(this.clearBuffer(d.begin,d.end),this.shiftL(d.begin,d.end-1));var e=this.seekNext(d.begin-1);if(b>e){var f=String.fromCharCode(c);if(this.tests[e].test(f)){this.shiftR(e),this.buffer[e]=f,this.writeBuffer();var g=this.seekNext(e);this.caret(g)}}return!1}},e.prototype.pasteEvent=function(){var a=this;setTimeout(function(){a.caret(a.checkVal(!0))},0)},e.prototype.clearBuffer=function(a,b){for(var c=this.mask.length,d=a;b>d&&c>d;d++)this.tests[d]&&(this.buffer[d]=this.options.placeholder)},e.prototype.writeBuffer=function(){return this.$element.val(this.buffer.join("")).val()},e.prototype.checkVal=function(a){for(var b=this.mask.length,c=this.$element.val(),d=-1,e=0,f=0;b>e;e++)if(this.tests[e]){for(this.buffer[e]=this.options.placeholder;f++<c.length;){var g=c.charAt(f-1);if(this.tests[e].test(g)){this.buffer[e]=g,d=e;break}}if(f>c.length)break}else this.buffer[e]==c.charAt(f)&&e!=this.partialPosition&&(f++,d=e);return!a&&d+1<this.partialPosition?(this.$element.val(""),this.clearBuffer(0,b)):(a||d+1>=this.partialPosition)&&(this.writeBuffer(),a||this.$element.val(this.$element.val().substring(0,d+1))),this.partialPosition?e:this.firstNonMaskPos};var f=a.fn.inputmask;a.fn.inputmask=function(b){return this.each(function(){var c=a(this),d=c.data("bs.inputmask");d||c.data("bs.inputmask",d=new e(this,b))})},a.fn.inputmask.Constructor=e,a.fn.inputmask.noConflict=function(){return a.fn.inputmask=f,this},a(document).on("focus.bs.inputmask.data-api","[data-mask]",function(){var b=a(this);b.data("bs.inputmask")||b.inputmask(b.data())})}(window.jQuery),+function(a){"use strict";var b="Microsoft Internet Explorer"==window.navigator.appName,c=function(b,c){if(this.$element=a(b),this.$input=this.$element.find(":file"),0!==this.$input.length){this.name=this.$input.attr("name")||c.name,this.$hidden=this.$element.find('input[type=hidden][name="'+this.name+'"]'),0===this.$hidden.length&&(this.$hidden=a('<input type="hidden">').insertBefore(this.$input)),this.$preview=this.$element.find(".fileinput-preview");var d=this.$preview.css("height");"inline"!==this.$preview.css("display")&&"0px"!==d&&"none"!==d&&this.$preview.css("line-height",d),this.original={exists:this.$element.hasClass("fileinput-exists"),preview:this.$preview.html(),hiddenVal:this.$hidden.val()},this.listen()}};c.prototype.listen=function(){this.$input.on("change.bs.fileinput",a.proxy(this.change,this)),a(this.$input[0].form).on("reset.bs.fileinput",a.proxy(this.reset,this)),this.$element.find('[data-trigger="fileinput"]').on("click.bs.fileinput",a.proxy(this.trigger,this)),this.$element.find('[data-dismiss="fileinput"]').on("click.bs.fileinput",a.proxy(this.clear,this))},c.prototype.change=function(b){var c=void 0===b.target.files?b.target&&b.target.value?[{name:b.target.value.replace(/^.+\\/,"")}]:[]:b.target.files;if(b.stopPropagation(),0===c.length)return void this.clear();this.$hidden.val(""),this.$hidden.attr("name",""),this.$input.attr("name",this.name);var d=c[0];if(this.$preview.length>0&&("undefined"!=typeof d.type?d.type.match(/^image\/(gif|png|jpeg)$/):d.name.match(/\.(gif|png|jpe?g)$/i))&&"undefined"!=typeof FileReader){var e=new FileReader,f=this.$preview,g=this.$element;e.onload=function(b){var e=a("<img>");e[0].src=b.target.result,c[0].result=b.target.result,g.find(".fileinput-filename").text(d.name),"none"!=f.css("max-height")&&e.css("max-height",parseInt(f.css("max-height"),10)-parseInt(f.css("padding-top"),10)-parseInt(f.css("padding-bottom"),10)-parseInt(f.css("border-top"),10)-parseInt(f.css("border-bottom"),10)),f.html(e),g.addClass("fileinput-exists").removeClass("fileinput-new"),g.trigger("change.bs.fileinput",c)},e.readAsDataURL(d)}else this.$element.find(".fileinput-filename").text(d.name),this.$preview.text(d.name),this.$element.addClass("fileinput-exists").removeClass("fileinput-new"),this.$element.trigger("change.bs.fileinput")},c.prototype.clear=function(a){if(a&&a.preventDefault(),this.$hidden.val(""),this.$hidden.attr("name",this.name),this.$input.attr("name",""),b){var c=this.$input.clone(!0);this.$input.after(c),this.$input.remove(),this.$input=c}else this.$input.val("");this.$preview.html(""),this.$element.find(".fileinput-filename").text(""),this.$element.addClass("fileinput-new").removeClass("fileinput-exists"),void 0!==a&&(this.$input.trigger("change"),this.$element.trigger("clear.bs.fileinput"))},c.prototype.reset=function(){this.clear(),this.$hidden.val(this.original.hiddenVal),this.$preview.html(this.original.preview),this.$element.find(".fileinput-filename").text(""),this.original.exists?this.$element.addClass("fileinput-exists").removeClass("fileinput-new"):this.$element.addClass("fileinput-new").removeClass("fileinput-exists"),this.$element.trigger("reset.bs.fileinput")},c.prototype.trigger=function(a){this.$input.trigger("click"),a.preventDefault()};var d=a.fn.fileinput;a.fn.fileinput=function(b){return this.each(function(){var d=a(this),e=d.data("bs.fileinput");e||d.data("bs.fileinput",e=new c(this,b)),"string"==typeof b&&e[b]()})},a.fn.fileinput.Constructor=c,a.fn.fileinput.noConflict=function(){return a.fn.fileinput=d,this},a(document).on("click.fileinput.data-api",'[data-provides="fileinput"]',function(b){var c=a(this);if(!c.data("bs.fileinput")){c.fileinput(c.data());var d=a(b.target).closest('[data-dismiss="fileinput"],[data-trigger="fileinput"]');d.length>0&&(b.preventDefault(),d.trigger("click.bs.fileinput"))}})}(window.jQuery); \ No newline at end of file
diff --git a/public/js/plugins/moment.min.js b/public/js/plugins/moment.min.js
new file mode 100644
index 0000000..25fa625
--- /dev/null
+++ b/public/js/plugins/moment.min.js
@@ -0,0 +1,7 @@
+//! moment.js
+//! version : 2.18.1
+//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
+//! license : MIT
+//! momentjs.com
+!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return sd.apply(null,arguments)}function b(a){sd=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){return null!=a&&"[object Object]"===Object.prototype.toString.call(a)}function e(a){var b;for(b in a)return!1;return!0}function f(a){return void 0===a}function g(a){return"number"==typeof a||"[object Number]"===Object.prototype.toString.call(a)}function h(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function i(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function j(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function k(a,b){for(var c in b)j(b,c)&&(a[c]=b[c]);return j(b,"toString")&&(a.toString=b.toString),j(b,"valueOf")&&(a.valueOf=b.valueOf),a}function l(a,b,c,d){return sb(a,b,c,d,!0).utc()}function m(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function n(a){return null==a._pf&&(a._pf=m()),a._pf}function o(a){if(null==a._isValid){var b=n(a),c=ud.call(b.parsedDateParts,function(a){return null!=a}),d=!isNaN(a._d.getTime())&&b.overflow<0&&!b.empty&&!b.invalidMonth&&!b.invalidWeekday&&!b.nullInput&&!b.invalidFormat&&!b.userInvalidated&&(!b.meridiem||b.meridiem&&c);if(a._strict&&(d=d&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour),null!=Object.isFrozen&&Object.isFrozen(a))return d;a._isValid=d}return a._isValid}function p(a){var b=l(NaN);return null!=a?k(n(b),a):n(b).userInvalidated=!0,b}function q(a,b){var c,d,e;if(f(b._isAMomentObject)||(a._isAMomentObject=b._isAMomentObject),f(b._i)||(a._i=b._i),f(b._f)||(a._f=b._f),f(b._l)||(a._l=b._l),f(b._strict)||(a._strict=b._strict),f(b._tzm)||(a._tzm=b._tzm),f(b._isUTC)||(a._isUTC=b._isUTC),f(b._offset)||(a._offset=b._offset),f(b._pf)||(a._pf=n(b)),f(b._locale)||(a._locale=b._locale),vd.length>0)for(c=0;c<vd.length;c++)d=vd[c],e=b[d],f(e)||(a[d]=e);return a}function r(b){q(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),wd===!1&&(wd=!0,a.updateOffset(this),wd=!1)}function s(a){return a instanceof r||null!=a&&null!=a._isAMomentObject}function t(a){return a<0?Math.ceil(a)||0:Math.floor(a)}function u(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=t(b)),c}function v(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;d<e;d++)(c&&a[d]!==b[d]||!c&&u(a[d])!==u(b[d]))&&g++;return g+f}function w(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function x(b,c){var d=!0;return k(function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,b),d){for(var e,f=[],g=0;g<arguments.length;g++){if(e="","object"==typeof arguments[g]){e+="\n["+g+"] ";for(var h in arguments[0])e+=h+": "+arguments[0][h]+", ";e=e.slice(0,-2)}else e=arguments[g];f.push(e)}w(b+"\nArguments: "+Array.prototype.slice.call(f).join("")+"\n"+(new Error).stack),d=!1}return c.apply(this,arguments)},c)}function y(b,c){null!=a.deprecationHandler&&a.deprecationHandler(b,c),xd[b]||(w(c),xd[b]=!0)}function z(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function A(a){var b,c;for(c in a)b=a[c],z(b)?this[c]=b:this["_"+c]=b;this._config=a,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function B(a,b){var c,e=k({},a);for(c in b)j(b,c)&&(d(a[c])&&d(b[c])?(e[c]={},k(e[c],a[c]),k(e[c],b[c])):null!=b[c]?e[c]=b[c]:delete e[c]);for(c in a)j(a,c)&&!j(b,c)&&d(a[c])&&(e[c]=k({},e[c]));return e}function C(a){null!=a&&this.set(a)}function D(a,b,c){var d=this._calendar[a]||this._calendar.sameElse;return z(d)?d.call(b,c):d}function E(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function F(){return this._invalidDate}function G(a){return this._ordinal.replace("%d",a)}function H(a,b,c,d){var e=this._relativeTime[c];return z(e)?e(a,b,c,d):e.replace(/%d/i,a)}function I(a,b){var c=this._relativeTime[a>0?"future":"past"];return z(c)?c(b):c.replace(/%s/i,b)}function J(a,b){var c=a.toLowerCase();Hd[c]=Hd[c+"s"]=Hd[b]=a}function K(a){return"string"==typeof a?Hd[a]||Hd[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)j(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(a,b){Id[a]=b}function N(a){var b=[];for(var c in a)b.push({unit:c,priority:Id[c]});return b.sort(function(a,b){return a.priority-b.priority}),b}function O(b,c){return function(d){return null!=d?(Q(this,b,d),a.updateOffset(this,c),this):P(this,b)}}function P(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function Q(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function R(a){return a=K(a),z(this[a])?this[a]():this}function S(a,b){if("object"==typeof a){a=L(a);for(var c=N(a),d=0;d<c.length;d++)this[c[d].unit](a[c[d].unit])}else if(a=K(a),z(this[a]))return this[a](b);return this}function T(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function U(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Md[a]=e),b&&(Md[b[0]]=function(){return T(e.apply(this,arguments),b[1],b[2])}),c&&(Md[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function V(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function W(a){var b,c,d=a.match(Jd);for(b=0,c=d.length;b<c;b++)Md[d[b]]?d[b]=Md[d[b]]:d[b]=V(d[b]);return function(b){var e,f="";for(e=0;e<c;e++)f+=z(d[e])?d[e].call(b,a):d[e];return f}}function X(a,b){return a.isValid()?(b=Y(b,a.localeData()),Ld[b]=Ld[b]||W(b),Ld[b](a)):a.localeData().invalidDate()}function Y(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Kd.lastIndex=0;d>=0&&Kd.test(a);)a=a.replace(Kd,c),Kd.lastIndex=0,d-=1;return a}function Z(a,b,c){ce[a]=z(b)?b:function(a,d){return a&&c?c:b}}function $(a,b){return j(ce,a)?ce[a](b._strict,b._locale):new RegExp(_(a))}function _(a){return aa(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function aa(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ba(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),g(b)&&(d=function(a,c){c[b]=u(a)}),c=0;c<a.length;c++)de[a[c]]=d}function ca(a,b){ba(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function da(a,b,c){null!=b&&j(de,a)&&de[a](b,c._a,c,a)}function ea(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function fa(a,b){return a?c(this._months)?this._months[a.month()]:this._months[(this._months.isFormat||oe).test(b)?"format":"standalone"][a.month()]:c(this._months)?this._months:this._months.standalone}function ga(a,b){return a?c(this._monthsShort)?this._monthsShort[a.month()]:this._monthsShort[oe.test(b)?"format":"standalone"][a.month()]:c(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ha(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],d=0;d<12;++d)f=l([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(f,"").toLocaleLowerCase(),this._longMonthsParse[d]=this.months(f,"").toLocaleLowerCase();return c?"MMM"===b?(e=ne.call(this._shortMonthsParse,g),e!==-1?e:null):(e=ne.call(this._longMonthsParse,g),e!==-1?e:null):"MMM"===b?(e=ne.call(this._shortMonthsParse,g),e!==-1?e:(e=ne.call(this._longMonthsParse,g),e!==-1?e:null)):(e=ne.call(this._longMonthsParse,g),e!==-1?e:(e=ne.call(this._shortMonthsParse,g),e!==-1?e:null))}function ia(a,b,c){var d,e,f;if(this._monthsParseExact)return ha.call(this,a,b,c);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;d<12;d++){if(e=l([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function ja(a,b){var c;if(!a.isValid())return a;if("string"==typeof b)if(/^\d+$/.test(b))b=u(b);else if(b=a.localeData().monthsParse(b),!g(b))return a;return c=Math.min(a.date(),ea(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a}function ka(b){return null!=b?(ja(this,b),a.updateOffset(this,!0),this):P(this,"Month")}function la(){return ea(this.year(),this.month())}function ma(a){return this._monthsParseExact?(j(this,"_monthsRegex")||oa.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):(j(this,"_monthsShortRegex")||(this._monthsShortRegex=re),this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex)}function na(a){return this._monthsParseExact?(j(this,"_monthsRegex")||oa.call(this),a?this._monthsStrictRegex:this._monthsRegex):(j(this,"_monthsRegex")||(this._monthsRegex=se),this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex)}function oa(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;b<12;b++)c=l([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;b<12;b++)d[b]=aa(d[b]),e[b]=aa(e[b]);for(b=0;b<24;b++)f[b]=aa(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")","i")}function pa(a){return qa(a)?366:365}function qa(a){return a%4===0&&a%100!==0||a%400===0}function ra(){return qa(this.year())}function sa(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return a<100&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ta(a){var b=new Date(Date.UTC.apply(null,arguments));return a<100&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function ua(a,b,c){var d=7+b-c,e=(7+ta(a,0,d).getUTCDay()-b)%7;return-e+d-1}function va(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ua(a,d,e),j=1+7*(b-1)+h+i;return j<=0?(f=a-1,g=pa(f)+j):j>pa(a)?(f=a+1,g=j-pa(a)):(f=a,g=j),{year:f,dayOfYear:g}}function wa(a,b,c){var d,e,f=ua(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return g<1?(e=a.year()-1,d=g+xa(e,b,c)):g>xa(a.year(),b,c)?(d=g-xa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function xa(a,b,c){var d=ua(a,b,c),e=ua(a+1,b,c);return(pa(a)-d+e)/7}function ya(a){return wa(a,this._week.dow,this._week.doy).week}function za(){return this._week.dow}function Aa(){return this._week.doy}function Ba(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ca(a){var b=wa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function Da(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Ea(a,b){return"string"==typeof a?b.weekdaysParse(a)%7||7:isNaN(a)?null:a}function Fa(a,b){return a?c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]:c(this._weekdays)?this._weekdays:this._weekdays.standalone}function Ga(a){return a?this._weekdaysShort[a.day()]:this._weekdaysShort}function Ha(a){return a?this._weekdaysMin[a.day()]:this._weekdaysMin}function Ia(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)f=l([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(f,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(f,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(f,"").toLocaleLowerCase();return c?"dddd"===b?(e=ne.call(this._weekdaysParse,g),e!==-1?e:null):"ddd"===b?(e=ne.call(this._shortWeekdaysParse,g),e!==-1?e:null):(e=ne.call(this._minWeekdaysParse,g),e!==-1?e:null):"dddd"===b?(e=ne.call(this._weekdaysParse,g),e!==-1?e:(e=ne.call(this._shortWeekdaysParse,g),e!==-1?e:(e=ne.call(this._minWeekdaysParse,g),e!==-1?e:null))):"ddd"===b?(e=ne.call(this._shortWeekdaysParse,g),e!==-1?e:(e=ne.call(this._weekdaysParse,g),e!==-1?e:(e=ne.call(this._minWeekdaysParse,g),e!==-1?e:null))):(e=ne.call(this._minWeekdaysParse,g),e!==-1?e:(e=ne.call(this._weekdaysParse,g),e!==-1?e:(e=ne.call(this._shortWeekdaysParse,g),e!==-1?e:null)))}function Ja(a,b,c){var d,e,f;if(this._weekdaysParseExact)return Ia.call(this,a,b,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;d<7;d++){if(e=l([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function Ka(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Da(a,this.localeData()),this.add(a-b,"d")):b}function La(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Ma(a){if(!this.isValid())return null!=a?this:NaN;if(null!=a){var b=Ea(a,this.localeData());return this.day(this.day()%7?b:b-7)}return this.day()||7}function Na(a){return this._weekdaysParseExact?(j(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysStrictRegex:this._weekdaysRegex):(j(this,"_weekdaysRegex")||(this._weekdaysRegex=ye),this._weekdaysStrictRegex&&a?this._weekdaysStrictRegex:this._weekdaysRegex)}function Oa(a){return this._weekdaysParseExact?(j(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(j(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ze),this._weekdaysShortStrictRegex&&a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Pa(a){return this._weekdaysParseExact?(j(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(j(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ae),this._weekdaysMinStrictRegex&&a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Qa(){function a(a,b){return b.length-a.length}var b,c,d,e,f,g=[],h=[],i=[],j=[];for(b=0;b<7;b++)c=l([2e3,1]).day(b),d=this.weekdaysMin(c,""),e=this.weekdaysShort(c,""),f=this.weekdays(c,""),g.push(d),h.push(e),i.push(f),j.push(d),j.push(e),j.push(f);for(g.sort(a),h.sort(a),i.sort(a),j.sort(a),b=0;b<7;b++)h[b]=aa(h[b]),i[b]=aa(i[b]),j[b]=aa(j[b]);this._weekdaysRegex=new RegExp("^("+j.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")}function Ra(){return this.hours()%12||12}function Sa(){return this.hours()||24}function Ta(a,b){U(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function Ua(a,b){return b._meridiemParse}function Va(a){return"p"===(a+"").toLowerCase().charAt(0)}function Wa(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Xa(a){return a?a.toLowerCase().replace("_","-"):a}function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split("-"),b=e.length,c=Xa(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=Za(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)break;b--}f++}return null}function Za(a){var b=null;if(!Fe[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Be._abbr,require("./locale/"+a),$a(b)}catch(a){}return Fe[a]}function $a(a,b){var c;return a&&(c=f(b)?bb(a):_a(a,b),c&&(Be=c)),Be._abbr}function _a(a,b){if(null!==b){var c=Ee;if(b.abbr=a,null!=Fe[a])y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),c=Fe[a]._config;else if(null!=b.parentLocale){if(null==Fe[b.parentLocale])return Ge[b.parentLocale]||(Ge[b.parentLocale]=[]),Ge[b.parentLocale].push({name:a,config:b}),null;c=Fe[b.parentLocale]._config}return Fe[a]=new C(B(c,b)),Ge[a]&&Ge[a].forEach(function(a){_a(a.name,a.config)}),$a(a),Fe[a]}return delete Fe[a],null}function ab(a,b){if(null!=b){var c,d=Ee;null!=Fe[a]&&(d=Fe[a]._config),b=B(d,b),c=new C(b),c.parentLocale=Fe[a],Fe[a]=c,$a(a)}else null!=Fe[a]&&(null!=Fe[a].parentLocale?Fe[a]=Fe[a].parentLocale:null!=Fe[a]&&delete Fe[a]);return Fe[a]}function bb(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Be;if(!c(a)){if(b=Za(a))return b;a=[a]}return Ya(a)}function cb(){return Ad(Fe)}function db(a){var b,c=a._a;return c&&n(a).overflow===-2&&(b=c[fe]<0||c[fe]>11?fe:c[ge]<1||c[ge]>ea(c[ee],c[fe])?ge:c[he]<0||c[he]>24||24===c[he]&&(0!==c[ie]||0!==c[je]||0!==c[ke])?he:c[ie]<0||c[ie]>59?ie:c[je]<0||c[je]>59?je:c[ke]<0||c[ke]>999?ke:-1,n(a)._overflowDayOfYear&&(b<ee||b>ge)&&(b=ge),n(a)._overflowWeeks&&b===-1&&(b=le),n(a)._overflowWeekday&&b===-1&&(b=me),n(a).overflow=b),a}function eb(a){var b,c,d,e,f,g,h=a._i,i=He.exec(h)||Ie.exec(h);if(i){for(n(a).iso=!0,b=0,c=Ke.length;b<c;b++)if(Ke[b][1].exec(i[1])){e=Ke[b][0],d=Ke[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=Le.length;b<c;b++)if(Le[b][1].exec(i[3])){f=(i[2]||" ")+Le[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Je.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),lb(a)}else a._isValid=!1}function fb(a){var b,c,d,e,f,g,h,i,j={" GMT":" +0000"," EDT":" -0400"," EST":" -0500"," CDT":" -0500"," CST":" -0600"," MDT":" -0600"," MST":" -0700"," PDT":" -0700"," PST":" -0800"},k="YXWVUTSRQPONZABCDEFGHIKLM";if(b=a._i.replace(/\([^\)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s|\s$/g,""),c=Ne.exec(b)){if(d=c[1]?"ddd"+(5===c[1].length?", ":" "):"",e="D MMM "+(c[2].length>10?"YYYY ":"YY "),f="HH:mm"+(c[4]?":ss":""),c[1]){var l=new Date(c[2]),m=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][l.getDay()];if(c[1].substr(0,3)!==m)return n(a).weekdayMismatch=!0,void(a._isValid=!1)}switch(c[5].length){case 2:0===i?h=" +0000":(i=k.indexOf(c[5][1].toUpperCase())-12,h=(i<0?" -":" +")+(""+i).replace(/^-?/,"0").match(/..$/)[0]+"00");break;case 4:h=j[c[5]];break;default:h=j[" GMT"]}c[5]=h,a._i=c.splice(1).join(""),g=" ZZ",a._f=d+e+f+g,lb(a),n(a).rfc2822=!0}else a._isValid=!1}function gb(b){var c=Me.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,fb(b),b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b)))))}function hb(a,b,c){return null!=a?a:null!=b?b:c}function ib(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function jb(a){var b,c,d,e,f=[];if(!a._d){for(d=ib(a),a._w&&null==a._a[ge]&&null==a._a[fe]&&kb(a),null!=a._dayOfYear&&(e=hb(a._a[ee],d[ee]),(a._dayOfYear>pa(e)||0===a._dayOfYear)&&(n(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[fe]=c.getUTCMonth(),a._a[ge]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[he]&&0===a._a[ie]&&0===a._a[je]&&0===a._a[ke]&&(a._nextDay=!0,a._a[he]=0),a._d=(a._useUTC?ta:sa).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[he]=24)}}function kb(a){var b,c,d,e,f,g,h,i;if(b=a._w,null!=b.GG||null!=b.W||null!=b.E)f=1,g=4,c=hb(b.GG,a._a[ee],wa(tb(),1,4).year),d=hb(b.W,1),e=hb(b.E,1),(e<1||e>7)&&(i=!0);else{f=a._locale._week.dow,g=a._locale._week.doy;var j=wa(tb(),f,g);c=hb(b.gg,a._a[ee],j.year),d=hb(b.w,j.week),null!=b.d?(e=b.d,(e<0||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f}d<1||d>xa(c,f,g)?n(a)._overflowWeeks=!0:null!=i?n(a)._overflowWeekday=!0:(h=va(c,d,e,f,g),a._a[ee]=h.year,a._dayOfYear=h.dayOfYear)}function lb(b){if(b._f===a.ISO_8601)return void eb(b);if(b._f===a.RFC_2822)return void fb(b);b._a=[],n(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,j=0;for(e=Y(b._f,b._locale).match(Jd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match($(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&n(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),Md[f]?(d?n(b).empty=!1:n(b).unusedTokens.push(f),da(f,d,b)):b._strict&&!d&&n(b).unusedTokens.push(f);n(b).charsLeftOver=i-j,h.length>0&&n(b).unusedInput.push(h),b._a[he]<=12&&n(b).bigHour===!0&&b._a[he]>0&&(n(b).bigHour=void 0),n(b).parsedDateParts=b._a.slice(0),n(b).meridiem=b._meridiem,b._a[he]=mb(b._locale,b._a[he],b._meridiem),jb(b),db(b)}function mb(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&b<12&&(b+=12),d||12!==b||(b=0),b):b}function nb(a){var b,c,d,e,f;if(0===a._f.length)return n(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;e<a._f.length;e++)f=0,b=q({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],lb(b),o(b)&&(f+=n(b).charsLeftOver,f+=10*n(b).unusedTokens.length,n(b).score=f,(null==d||f<d)&&(d=f,c=b));k(a,c||b)}function ob(a){if(!a._d){var b=L(a._i);a._a=i([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),jb(a)}}function pb(a){var b=new r(db(qb(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function qb(a){var b=a._i,d=a._f;return a._locale=a._locale||bb(a._l),null===b||void 0===d&&""===b?p({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),s(b)?new r(db(b)):(h(b)?a._d=b:c(d)?nb(a):d?lb(a):rb(a),o(a)||(a._d=null),a))}function rb(b){var e=b._i;f(e)?b._d=new Date(a.now()):h(e)?b._d=new Date(e.valueOf()):"string"==typeof e?gb(b):c(e)?(b._a=i(e.slice(0),function(a){return parseInt(a,10)}),jb(b)):d(e)?ob(b):g(e)?b._d=new Date(e):a.createFromInputFallback(b)}function sb(a,b,f,g,h){var i={};return f!==!0&&f!==!1||(g=f,f=void 0),(d(a)&&e(a)||c(a)&&0===a.length)&&(a=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=h,i._l=f,i._i=a,i._f=b,i._strict=g,pb(i)}function tb(a,b,c,d){return sb(a,b,c,d,!1)}function ub(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return tb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}function vb(){var a=[].slice.call(arguments,0);return ub("isBefore",a)}function wb(){var a=[].slice.call(arguments,0);return ub("isAfter",a)}function xb(a){for(var b in a)if(Re.indexOf(b)===-1||null!=a[b]&&isNaN(a[b]))return!1;for(var c=!1,d=0;d<Re.length;++d)if(a[Re[d]]){if(c)return!1;parseFloat(a[Re[d]])!==u(a[Re[d]])&&(c=!0)}return!0}function yb(){return this._isValid}function zb(){return Sb(NaN)}function Ab(a){var b=L(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._isValid=xb(b),this._milliseconds=+k+1e3*j+6e4*i+1e3*h*60*60,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=bb(),this._bubble()}function Bb(a){return a instanceof Ab}function Cb(a){return a<0?Math.round(-1*a)*-1:Math.round(a)}function Db(a,b){U(a,0,0,function(){var a=this.utcOffset(),c="+";return a<0&&(a=-a,c="-"),c+T(~~(a/60),2)+b+T(~~a%60,2)})}function Eb(a,b){var c=(b||"").match(a);if(null===c)return null;var d=c[c.length-1]||[],e=(d+"").match(Se)||["-",0,0],f=+(60*e[1])+u(e[2]);return 0===f?0:"+"===e[0]?f:-f}function Fb(b,c){var d,e;return c._isUTC?(d=c.clone(),e=(s(b)||h(b)?b.valueOf():tb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):tb(b).local()}function Gb(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Hb(b,c,d){var e,f=this._offset||0;if(!this.isValid())return null!=b?this:NaN;if(null!=b){if("string"==typeof b){if(b=Eb(_d,b),null===b)return this}else Math.abs(b)<16&&!d&&(b=60*b);return!this._isUTC&&c&&(e=Gb(this)),this._offset=b,this._isUTC=!0,null!=e&&this.add(e,"m"),f!==b&&(!c||this._changeInProgress?Xb(this,Sb(b-f,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?f:Gb(this)}function Ib(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Jb(a){return this.utcOffset(0,a)}function Kb(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Gb(this),"m")),this}function Lb(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var a=Eb($d,this._i);null!=a?this.utcOffset(a):this.utcOffset(0,!0)}return this}function Mb(a){return!!this.isValid()&&(a=a?tb(a).utcOffset():0,(this.utcOffset()-a)%60===0)}function Nb(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ob(){if(!f(this._isDSTShifted))return this._isDSTShifted;var a={};if(q(a,this),a=qb(a),a._a){var b=a._isUTC?l(a._a):tb(a._a);this._isDSTShifted=this.isValid()&&v(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Pb(){return!!this.isValid()&&!this._isUTC}function Qb(){return!!this.isValid()&&this._isUTC}function Rb(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Sb(a,b){var c,d,e,f=a,h=null;return Bb(a)?f={ms:a._milliseconds,d:a._days,M:a._months}:g(a)?(f={},b?f[b]=a:f.milliseconds=a):(h=Te.exec(a))?(c="-"===h[1]?-1:1,f={y:0,d:u(h[ge])*c,h:u(h[he])*c,m:u(h[ie])*c,s:u(h[je])*c,ms:u(Cb(1e3*h[ke]))*c}):(h=Ue.exec(a))?(c="-"===h[1]?-1:1,f={y:Tb(h[2],c),M:Tb(h[3],c),w:Tb(h[4],c),d:Tb(h[5],c),h:Tb(h[6],c),m:Tb(h[7],c),s:Tb(h[8],c)}):null==f?f={}:"object"==typeof f&&("from"in f||"to"in f)&&(e=Vb(tb(f.from),tb(f.to)),f={},f.ms=e.milliseconds,f.M=e.months),d=new Ab(f),Bb(a)&&j(a,"_locale")&&(d._locale=a._locale),d}function Tb(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function Ub(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function Vb(a,b){var c;return a.isValid()&&b.isValid()?(b=Fb(b,a),a.isBefore(b)?c=Ub(a,b):(c=Ub(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function Wb(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(y(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Sb(c,d),Xb(this,e,a),this}}function Xb(b,c,d,e){var f=c._milliseconds,g=Cb(c._days),h=Cb(c._months);b.isValid()&&(e=null==e||e,f&&b._d.setTime(b._d.valueOf()+f*d),g&&Q(b,"Date",P(b,"Date")+g*d),h&&ja(b,P(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function Yb(a,b){var c=a.diff(b,"days",!0);return c<-6?"sameElse":c<-1?"lastWeek":c<0?"lastDay":c<1?"sameDay":c<2?"nextDay":c<7?"nextWeek":"sameElse"}function Zb(b,c){var d=b||tb(),e=Fb(d,this).startOf("day"),f=a.calendarFormat(this,e)||"sameElse",g=c&&(z(c[f])?c[f].call(this,d):c[f]);return this.format(g||this.localeData().calendar(f,this,tb(d)))}function $b(){return new r(this)}function _b(a,b){var c=s(a)?a:tb(a);return!(!this.isValid()||!c.isValid())&&(b=K(f(b)?"millisecond":b),"millisecond"===b?this.valueOf()>c.valueOf():c.valueOf()<this.clone().startOf(b).valueOf())}function ac(a,b){var c=s(a)?a:tb(a);return!(!this.isValid()||!c.isValid())&&(b=K(f(b)?"millisecond":b),"millisecond"===b?this.valueOf()<c.valueOf():this.clone().endOf(b).valueOf()<c.valueOf())}function bc(a,b,c,d){return d=d||"()",("("===d[0]?this.isAfter(a,c):!this.isBefore(a,c))&&(")"===d[1]?this.isBefore(b,c):!this.isAfter(b,c))}function cc(a,b){var c,d=s(a)?a:tb(a);return!(!this.isValid()||!d.isValid())&&(b=K(b||"millisecond"),"millisecond"===b?this.valueOf()===d.valueOf():(c=d.valueOf(),this.clone().startOf(b).valueOf()<=c&&c<=this.clone().endOf(b).valueOf()))}function dc(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function ec(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function fc(a,b,c){var d,e,f,g;return this.isValid()?(d=Fb(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=K(b),"year"===b||"month"===b||"quarter"===b?(g=gc(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:t(g)):NaN):NaN}function gc(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return b-f<0?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)||0}function hc(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ic(){if(!this.isValid())return null;var a=this.clone().utc();return a.year()<0||a.year()>9999?X(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):z(Date.prototype.toISOString)?this.toDate().toISOString():X(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function jc(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var a="moment",b="";this.isLocal()||(a=0===this.utcOffset()?"moment.utc":"moment.parseZone",b="Z");var c="["+a+'("]',d=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",e="-MM-DD[T]HH:mm:ss.SSS",f=b+'[")]';return this.format(c+d+e+f)}function kc(b){b||(b=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var c=X(this,b);return this.localeData().postformat(c)}function lc(a,b){return this.isValid()&&(s(a)&&a.isValid()||tb(a).isValid())?Sb({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function mc(a){return this.from(tb(),a)}function nc(a,b){return this.isValid()&&(s(a)&&a.isValid()||tb(a).isValid())?Sb({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function oc(a){return this.to(tb(),a)}function pc(a){var b;return void 0===a?this._locale._abbr:(b=bb(a),null!=b&&(this._locale=b),this)}function qc(){return this._locale}function rc(a){switch(a=K(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function sc(a){return a=K(a),void 0===a||"millisecond"===a?this:("date"===a&&(a="day"),this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms"))}function tc(){return this._d.valueOf()-6e4*(this._offset||0)}function uc(){return Math.floor(this.valueOf()/1e3)}function vc(){return new Date(this.valueOf())}function wc(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function xc(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function yc(){return this.isValid()?this.toISOString():null}function zc(){return o(this)}function Ac(){
+return k({},n(this))}function Bc(){return n(this).overflow}function Cc(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Dc(a,b){U(0,[a,a.length],0,b)}function Ec(a){return Ic.call(this,a,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Fc(a){return Ic.call(this,a,this.isoWeek(),this.isoWeekday(),1,4)}function Gc(){return xa(this.year(),1,4)}function Hc(){var a=this.localeData()._week;return xa(this.year(),a.dow,a.doy)}function Ic(a,b,c,d,e){var f;return null==a?wa(this,d,e).year:(f=xa(a,d,e),b>f&&(b=f),Jc.call(this,a,b,c,d,e))}function Jc(a,b,c,d,e){var f=va(a,b,c,d,e),g=ta(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Kc(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Lc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function Mc(a,b){b[ke]=u(1e3*("0."+a))}function Nc(){return this._isUTC?"UTC":""}function Oc(){return this._isUTC?"Coordinated Universal Time":""}function Pc(a){return tb(1e3*a)}function Qc(){return tb.apply(null,arguments).parseZone()}function Rc(a){return a}function Sc(a,b,c,d){var e=bb(),f=l().set(d,b);return e[c](f,a)}function Tc(a,b,c){if(g(a)&&(b=a,a=void 0),a=a||"",null!=b)return Sc(a,b,c,"month");var d,e=[];for(d=0;d<12;d++)e[d]=Sc(a,d,c,"month");return e}function Uc(a,b,c,d){"boolean"==typeof a?(g(b)&&(c=b,b=void 0),b=b||""):(b=a,c=b,a=!1,g(b)&&(c=b,b=void 0),b=b||"");var e=bb(),f=a?e._week.dow:0;if(null!=c)return Sc(b,(c+f)%7,d,"day");var h,i=[];for(h=0;h<7;h++)i[h]=Sc(b,(h+f)%7,d,"day");return i}function Vc(a,b){return Tc(a,b,"months")}function Wc(a,b){return Tc(a,b,"monthsShort")}function Xc(a,b,c){return Uc(a,b,c,"weekdays")}function Yc(a,b,c){return Uc(a,b,c,"weekdaysShort")}function Zc(a,b,c){return Uc(a,b,c,"weekdaysMin")}function $c(){var a=this._data;return this._milliseconds=df(this._milliseconds),this._days=df(this._days),this._months=df(this._months),a.milliseconds=df(a.milliseconds),a.seconds=df(a.seconds),a.minutes=df(a.minutes),a.hours=df(a.hours),a.months=df(a.months),a.years=df(a.years),this}function _c(a,b,c,d){var e=Sb(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function ad(a,b){return _c(this,a,b,1)}function bd(a,b){return _c(this,a,b,-1)}function cd(a){return a<0?Math.floor(a):Math.ceil(a)}function dd(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||f<=0&&g<=0&&h<=0||(f+=864e5*cd(fd(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=t(f/1e3),i.seconds=a%60,b=t(a/60),i.minutes=b%60,c=t(b/60),i.hours=c%24,g+=t(c/24),e=t(ed(g)),h+=e,g-=cd(fd(e)),d=t(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function ed(a){return 4800*a/146097}function fd(a){return 146097*a/4800}function gd(a){if(!this.isValid())return NaN;var b,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+ed(b),"month"===a?c:c/12;switch(b=this._days+Math.round(fd(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function hd(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*u(this._months/12):NaN}function id(a){return function(){return this.as(a)}}function jd(a){return a=K(a),this.isValid()?this[a+"s"]():NaN}function kd(a){return function(){return this.isValid()?this._data[a]:NaN}}function ld(){return t(this.days()/7)}function md(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function nd(a,b,c){var d=Sb(a).abs(),e=uf(d.as("s")),f=uf(d.as("m")),g=uf(d.as("h")),h=uf(d.as("d")),i=uf(d.as("M")),j=uf(d.as("y")),k=e<=vf.ss&&["s",e]||e<vf.s&&["ss",e]||f<=1&&["m"]||f<vf.m&&["mm",f]||g<=1&&["h"]||g<vf.h&&["hh",g]||h<=1&&["d"]||h<vf.d&&["dd",h]||i<=1&&["M"]||i<vf.M&&["MM",i]||j<=1&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,md.apply(null,k)}function od(a){return void 0===a?uf:"function"==typeof a&&(uf=a,!0)}function pd(a,b){return void 0!==vf[a]&&(void 0===b?vf[a]:(vf[a]=b,"s"===a&&(vf.ss=b-1),!0))}function qd(a){if(!this.isValid())return this.localeData().invalidDate();var b=this.localeData(),c=nd(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function rd(){if(!this.isValid())return this.localeData().invalidDate();var a,b,c,d=wf(this._milliseconds)/1e3,e=wf(this._days),f=wf(this._months);a=t(d/60),b=t(a/60),d%=60,a%=60,c=t(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(m<0?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var sd,td;td=Array.prototype.some?Array.prototype.some:function(a){for(var b=Object(this),c=b.length>>>0,d=0;d<c;d++)if(d in b&&a.call(this,b[d],d,b))return!0;return!1};var ud=td,vd=a.momentProperties=[],wd=!1,xd={};a.suppressDeprecationWarnings=!1,a.deprecationHandler=null;var yd;yd=Object.keys?Object.keys:function(a){var b,c=[];for(b in a)j(a,b)&&c.push(b);return c};var zd,Ad=yd,Bd={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Cd={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Dd="Invalid date",Ed="%d",Fd=/\d{1,2}/,Gd={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Hd={},Id={},Jd=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Kd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ld={},Md={},Nd=/\d/,Od=/\d\d/,Pd=/\d{3}/,Qd=/\d{4}/,Rd=/[+-]?\d{6}/,Sd=/\d\d?/,Td=/\d\d\d\d?/,Ud=/\d\d\d\d\d\d?/,Vd=/\d{1,3}/,Wd=/\d{1,4}/,Xd=/[+-]?\d{1,6}/,Yd=/\d+/,Zd=/[+-]?\d+/,$d=/Z|[+-]\d\d:?\d\d/gi,_d=/Z|[+-]\d\d(?::?\d\d)?/gi,ae=/[+-]?\d+(\.\d{1,3})?/,be=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ce={},de={},ee=0,fe=1,ge=2,he=3,ie=4,je=5,ke=6,le=7,me=8;zd=Array.prototype.indexOf?Array.prototype.indexOf:function(a){var b;for(b=0;b<this.length;++b)if(this[b]===a)return b;return-1};var ne=zd;U("M",["MM",2],"Mo",function(){return this.month()+1}),U("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),U("MMMM",0,0,function(a){return this.localeData().months(this,a)}),J("month","M"),M("month",8),Z("M",Sd),Z("MM",Sd,Od),Z("MMM",function(a,b){return b.monthsShortRegex(a)}),Z("MMMM",function(a,b){return b.monthsRegex(a)}),ba(["M","MM"],function(a,b){b[fe]=u(a)-1}),ba(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[fe]=e:n(c).invalidMonth=a});var oe=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,pe="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),qe="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),re=be,se=be;U("Y",0,0,function(){var a=this.year();return a<=9999?""+a:"+"+a}),U(0,["YY",2],0,function(){return this.year()%100}),U(0,["YYYY",4],0,"year"),U(0,["YYYYY",5],0,"year"),U(0,["YYYYYY",6,!0],0,"year"),J("year","y"),M("year",1),Z("Y",Zd),Z("YY",Sd,Od),Z("YYYY",Wd,Qd),Z("YYYYY",Xd,Rd),Z("YYYYYY",Xd,Rd),ba(["YYYYY","YYYYYY"],ee),ba("YYYY",function(b,c){c[ee]=2===b.length?a.parseTwoDigitYear(b):u(b)}),ba("YY",function(b,c){c[ee]=a.parseTwoDigitYear(b)}),ba("Y",function(a,b){b[ee]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return u(a)+(u(a)>68?1900:2e3)};var te=O("FullYear",!0);U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),J("week","w"),J("isoWeek","W"),M("week",5),M("isoWeek",5),Z("w",Sd),Z("ww",Sd,Od),Z("W",Sd),Z("WW",Sd,Od),ca(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=u(a)});var ue={dow:0,doy:6};U("d",0,"do","day"),U("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),U("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),U("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),J("day","d"),J("weekday","e"),J("isoWeekday","E"),M("day",11),M("weekday",11),M("isoWeekday",11),Z("d",Sd),Z("e",Sd),Z("E",Sd),Z("dd",function(a,b){return b.weekdaysMinRegex(a)}),Z("ddd",function(a,b){return b.weekdaysShortRegex(a)}),Z("dddd",function(a,b){return b.weekdaysRegex(a)}),ca(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:n(c).invalidWeekday=a}),ca(["d","e","E"],function(a,b,c,d){b[d]=u(a)});var ve="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),we="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),xe="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ye=be,ze=be,Ae=be;U("H",["HH",2],0,"hour"),U("h",["hh",2],0,Ra),U("k",["kk",2],0,Sa),U("hmm",0,0,function(){return""+Ra.apply(this)+T(this.minutes(),2)}),U("hmmss",0,0,function(){return""+Ra.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),U("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),U("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),Ta("a",!0),Ta("A",!1),J("hour","h"),M("hour",13),Z("a",Ua),Z("A",Ua),Z("H",Sd),Z("h",Sd),Z("k",Sd),Z("HH",Sd,Od),Z("hh",Sd,Od),Z("kk",Sd,Od),Z("hmm",Td),Z("hmmss",Ud),Z("Hmm",Td),Z("Hmmss",Ud),ba(["H","HH"],he),ba(["k","kk"],function(a,b,c){var d=u(a);b[he]=24===d?0:d}),ba(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),ba(["h","hh"],function(a,b,c){b[he]=u(a),n(c).bigHour=!0}),ba("hmm",function(a,b,c){var d=a.length-2;b[he]=u(a.substr(0,d)),b[ie]=u(a.substr(d)),n(c).bigHour=!0}),ba("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[he]=u(a.substr(0,d)),b[ie]=u(a.substr(d,2)),b[je]=u(a.substr(e)),n(c).bigHour=!0}),ba("Hmm",function(a,b,c){var d=a.length-2;b[he]=u(a.substr(0,d)),b[ie]=u(a.substr(d))}),ba("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[he]=u(a.substr(0,d)),b[ie]=u(a.substr(d,2)),b[je]=u(a.substr(e))});var Be,Ce=/[ap]\.?m?\.?/i,De=O("Hours",!0),Ee={calendar:Bd,longDateFormat:Cd,invalidDate:Dd,ordinal:Ed,dayOfMonthOrdinalParse:Fd,relativeTime:Gd,months:pe,monthsShort:qe,week:ue,weekdays:ve,weekdaysMin:xe,weekdaysShort:we,meridiemParse:Ce},Fe={},Ge={},He=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ie=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Je=/Z|[+-]\d\d(?::?\d\d)?/,Ke=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Le=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Me=/^\/?Date\((\-?\d+)/i,Ne=/^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d?\d\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(?:\d\d)?\d\d\s)(\d\d:\d\d)(\:\d\d)?(\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\d{4}))$/;a.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),a.ISO_8601=function(){},a.RFC_2822=function(){};var Oe=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var a=tb.apply(null,arguments);return this.isValid()&&a.isValid()?a<this?this:a:p()}),Pe=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var a=tb.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:p()}),Qe=function(){return Date.now?Date.now():+new Date},Re=["year","quarter","month","week","day","hour","minute","second","millisecond"];Db("Z",":"),Db("ZZ",""),Z("Z",_d),Z("ZZ",_d),ba(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Eb(_d,a)});var Se=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var Te=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ue=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Sb.fn=Ab.prototype,Sb.invalid=zb;var Ve=Wb(1,"add"),We=Wb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Xe=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Dc("gggg","weekYear"),Dc("ggggg","weekYear"),Dc("GGGG","isoWeekYear"),Dc("GGGGG","isoWeekYear"),J("weekYear","gg"),J("isoWeekYear","GG"),M("weekYear",1),M("isoWeekYear",1),Z("G",Zd),Z("g",Zd),Z("GG",Sd,Od),Z("gg",Sd,Od),Z("GGGG",Wd,Qd),Z("gggg",Wd,Qd),Z("GGGGG",Xd,Rd),Z("ggggg",Xd,Rd),ca(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=u(a)}),ca(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),U("Q",0,"Qo","quarter"),J("quarter","Q"),M("quarter",7),Z("Q",Nd),ba("Q",function(a,b){b[fe]=3*(u(a)-1)}),U("D",["DD",2],"Do","date"),J("date","D"),M("date",9),Z("D",Sd),Z("DD",Sd,Od),Z("Do",function(a,b){return a?b._dayOfMonthOrdinalParse||b._ordinalParse:b._dayOfMonthOrdinalParseLenient}),ba(["D","DD"],ge),ba("Do",function(a,b){b[ge]=u(a.match(Sd)[0],10)});var Ye=O("Date",!0);U("DDD",["DDDD",3],"DDDo","dayOfYear"),J("dayOfYear","DDD"),M("dayOfYear",4),Z("DDD",Vd),Z("DDDD",Pd),ba(["DDD","DDDD"],function(a,b,c){c._dayOfYear=u(a)}),U("m",["mm",2],0,"minute"),J("minute","m"),M("minute",14),Z("m",Sd),Z("mm",Sd,Od),ba(["m","mm"],ie);var Ze=O("Minutes",!1);U("s",["ss",2],0,"second"),J("second","s"),M("second",15),Z("s",Sd),Z("ss",Sd,Od),ba(["s","ss"],je);var $e=O("Seconds",!1);U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return 10*this.millisecond()}),U(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),U(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),U(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),U(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),U(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),J("millisecond","ms"),M("millisecond",16),Z("S",Vd,Nd),Z("SS",Vd,Od),Z("SSS",Vd,Pd);var _e;for(_e="SSSS";_e.length<=9;_e+="S")Z(_e,Yd);for(_e="S";_e.length<=9;_e+="S")ba(_e,Mc);var af=O("Milliseconds",!1);U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var bf=r.prototype;bf.add=Ve,bf.calendar=Zb,bf.clone=$b,bf.diff=fc,bf.endOf=sc,bf.format=kc,bf.from=lc,bf.fromNow=mc,bf.to=nc,bf.toNow=oc,bf.get=R,bf.invalidAt=Bc,bf.isAfter=_b,bf.isBefore=ac,bf.isBetween=bc,bf.isSame=cc,bf.isSameOrAfter=dc,bf.isSameOrBefore=ec,bf.isValid=zc,bf.lang=Xe,bf.locale=pc,bf.localeData=qc,bf.max=Pe,bf.min=Oe,bf.parsingFlags=Ac,bf.set=S,bf.startOf=rc,bf.subtract=We,bf.toArray=wc,bf.toObject=xc,bf.toDate=vc,bf.toISOString=ic,bf.inspect=jc,bf.toJSON=yc,bf.toString=hc,bf.unix=uc,bf.valueOf=tc,bf.creationData=Cc,bf.year=te,bf.isLeapYear=ra,bf.weekYear=Ec,bf.isoWeekYear=Fc,bf.quarter=bf.quarters=Kc,bf.month=ka,bf.daysInMonth=la,bf.week=bf.weeks=Ba,bf.isoWeek=bf.isoWeeks=Ca,bf.weeksInYear=Hc,bf.isoWeeksInYear=Gc,bf.date=Ye,bf.day=bf.days=Ka,bf.weekday=La,bf.isoWeekday=Ma,bf.dayOfYear=Lc,bf.hour=bf.hours=De,bf.minute=bf.minutes=Ze,bf.second=bf.seconds=$e,bf.millisecond=bf.milliseconds=af,bf.utcOffset=Hb,bf.utc=Jb,bf.local=Kb,bf.parseZone=Lb,bf.hasAlignedHourOffset=Mb,bf.isDST=Nb,bf.isLocal=Pb,bf.isUtcOffset=Qb,bf.isUtc=Rb,bf.isUTC=Rb,bf.zoneAbbr=Nc,bf.zoneName=Oc,bf.dates=x("dates accessor is deprecated. Use date instead.",Ye),bf.months=x("months accessor is deprecated. Use month instead",ka),bf.years=x("years accessor is deprecated. Use year instead",te),bf.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ib),bf.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ob);var cf=C.prototype;cf.calendar=D,cf.longDateFormat=E,cf.invalidDate=F,cf.ordinal=G,cf.preparse=Rc,cf.postformat=Rc,cf.relativeTime=H,cf.pastFuture=I,cf.set=A,cf.months=fa,cf.monthsShort=ga,cf.monthsParse=ia,cf.monthsRegex=na,cf.monthsShortRegex=ma,cf.week=ya,cf.firstDayOfYear=Aa,cf.firstDayOfWeek=za,cf.weekdays=Fa,cf.weekdaysMin=Ha,cf.weekdaysShort=Ga,cf.weekdaysParse=Ja,cf.weekdaysRegex=Na,cf.weekdaysShortRegex=Oa,cf.weekdaysMinRegex=Pa,cf.isPM=Va,cf.meridiem=Wa,$a("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===u(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=x("moment.lang is deprecated. Use moment.locale instead.",$a),a.langData=x("moment.langData is deprecated. Use moment.localeData instead.",bb);var df=Math.abs,ef=id("ms"),ff=id("s"),gf=id("m"),hf=id("h"),jf=id("d"),kf=id("w"),lf=id("M"),mf=id("y"),nf=kd("milliseconds"),of=kd("seconds"),pf=kd("minutes"),qf=kd("hours"),rf=kd("days"),sf=kd("months"),tf=kd("years"),uf=Math.round,vf={ss:44,s:45,m:45,h:22,d:26,M:11},wf=Math.abs,xf=Ab.prototype;return xf.isValid=yb,xf.abs=$c,xf.add=ad,xf.subtract=bd,xf.as=gd,xf.asMilliseconds=ef,xf.asSeconds=ff,xf.asMinutes=gf,xf.asHours=hf,xf.asDays=jf,xf.asWeeks=kf,xf.asMonths=lf,xf.asYears=mf,xf.valueOf=hd,xf._bubble=dd,xf.get=jd,xf.milliseconds=nf,xf.seconds=of,xf.minutes=pf,xf.hours=qf,xf.days=rf,xf.weeks=ld,xf.months=sf,xf.years=tf,xf.humanize=qd,xf.toISOString=rd,xf.toString=rd,xf.toJSON=rd,xf.locale=pc,xf.localeData=qc,xf.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",rd),xf.lang=Xe,U("X",0,0,"unix"),U("x",0,0,"valueOf"),Z("x",Zd),Z("X",ae),ba("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),ba("x",function(a,b,c){c._d=new Date(u(a))}),a.version="2.18.1",b(tb),a.fn=bf,a.min=vb,a.max=wb,a.now=Qe,a.utc=l,a.unix=Pc,a.months=Vc,a.isDate=h,a.locale=$a,a.invalid=p,a.duration=Sb,a.isMoment=s,a.weekdays=Xc,a.parseZone=Qc,a.localeData=bb,a.isDuration=Bb,a.monthsShort=Wc,a.weekdaysMin=Zc,a.defineLocale=_a,a.updateLocale=ab,a.locales=cb,a.weekdaysShort=Yc,a.normalizeUnits=K,a.relativeTimeRounding=od,a.relativeTimeThreshold=pd,a.calendarFormat=Yb,a.prototype=bf,a});
diff --git a/public/js/plugins/nouislider.min.js b/public/js/plugins/nouislider.min.js
new file mode 100644
index 0000000..4da0912
--- /dev/null
+++ b/public/js/plugins/nouislider.min.js
@@ -0,0 +1,3 @@
+/*! nouislider - 9.1.0 - 2016-12-10 16:00:32 */
+
+!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||""),c=a?window.pageXOffset:b?document.documentElement.scrollLeft:document.body.scrollLeft,d=a?window.pageYOffset:b?document.documentElement.scrollTop:document.body.scrollTop;return{x:c,y:d}}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]),b===!0||b===!1){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(b!==!1)if(b===!0){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&&b!==!1)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(b!==!0&&b!==!1)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(a,b){ba=[],ca=[],ca.push(p(b,a[0]));for(var c=0;c<e.handles;c++)ba.push(o(b,c)),ha[c]=c,ca.push(p(b,a[c+1]))}function r(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),aa=a(b,e.cssClasses.base)}function s(b,c){return!!e.tooltips[c]&&a(b.firstChild,e.cssClasses.tooltip)}function t(){var a=ba.map(s);Z("update",function(b,c,d){if(a[c]){var f=b[c];e.tooltips[c]!==!0&&(f=e.tooltips[c].to(d[c])),a[c].innerHTML=f}})}function u(a,b,c){if("range"===a||"steps"===a)return ja.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 ja.fromStepping(c?ja.getStep(a):a)}):"values"===a?c?b.map(function(a){return ja.fromStepping(ja.getStep(ja.toStepping(a)))}):b:void 0}function v(a,c,d){function e(a,b){return(a+b).toFixed(7)/1}var f={},g=ja.xVal[0],h=ja.xVal[ja.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=ja.xNumSteps[g]),h||(h=v-u),u!==!1&&void 0!==v)for(h=Math.max(h,1e-7),l=u;l<=v;l=e(l,h)){for(n=ja.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 w(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 x(a){var b=a.mode,c=a.density||1,d=a.filter||!1,e=a.values||!1,f=a.stepped||!1,g=u(b,e,f),h=v(c,b,g),i=a.format||{to:Math.round};return fa.appendChild(w(h,d,i))}function y(){var a=aa.getBoundingClientRect(),b="offset"+["Width","Height"][e.ort];return 0===e.ort?a.width||aa[b]:a.height||aa[b]}function z(a,b,c,d){var f=function(b){return!fa.hasAttribute("disabled")&&(!l(fa,e.cssClasses.tap)&&(!!(b=A(b,d.pageOffset))&&(!(a===ea.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 A(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 B(a){var b=a-d(aa,e.ort),c=100*b/y();return e.dir?100-c:c}function C(a){var b=100,c=!1;return ba.forEach(function(d,e){if(!d.hasAttribute("disabled")){var f=Math.abs(ga[e]-a);f<b&&(c=e,b=f)}}),c}function D(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=M(e,a,e[a]+b,f[c],g[c]);d===!1?b=0:(b=d-e[a],e[a]=d)}):f=g=[!0];var h=!1;d.forEach(function(a,d){h=Q(a,c[a]+b,f[d],g[d])||h}),h&&d.forEach(function(a){E("update",a),E("slide",a)})}function E(a,b,c){Object.keys(la).forEach(function(d){var f=d.split(".")[0];a===f&&la[d].forEach(function(a){a.call(da,ka.map(e.format.to),b,ka.slice(),c||!1,ga.slice())})})}function F(a,b){"mouseout"===a.type&&"HTML"===a.target.nodeName&&null===a.relatedTarget&&H(a,b)}function G(a,b){if(navigator.appVersion.indexOf("MSIE 9")===-1&&0===a.buttons&&0!==b.buttonsProperty)return H(a,b);var c=(e.dir?-1:1)*(a.calcPoint-b.startCalcPoint),d=100*c/b.baseSize;D(c>0,d,b.locations,b.handleNumbers)}function H(a,b){ia&&(k(ia,e.cssClasses.active),ia=!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(fa,e.cssClasses.drag),P(),b.handleNumbers.forEach(function(a){E("set",a),E("change",a),E("end",a)})}function I(a,b){if(1===b.handleNumbers.length){var c=ba[b.handleNumbers[0]];if(c.hasAttribute("disabled"))return!1;ia=c.children[0],j(ia,e.cssClasses.active)}a.preventDefault(),a.stopPropagation();var d=z(ea.move,document.documentElement,G,{startCalcPoint:a.calcPoint,baseSize:y(),pageOffset:a.pageOffset,handleNumbers:b.handleNumbers,buttonsProperty:a.buttons,locations:ga.slice()}),f=z(ea.end,document.documentElement,H,{handleNumbers:b.handleNumbers}),g=z("mouseout",document.documentElement,F,{handleNumbers:b.handleNumbers});if(document.documentElement.noUiListeners=d.concat(f,g),a.cursor){document.body.style.cursor=getComputedStyle(a.target).cursor,ba.length>1&&j(fa,e.cssClasses.drag);var h=function(){return!1};document.body.noUiListener=h,document.body.addEventListener("selectstart",h,!1)}b.handleNumbers.forEach(function(a){E("start",a)})}function J(a){a.stopPropagation();var b=B(a.calcPoint),c=C(b);return c!==!1&&(e.events.snap||f(fa,e.cssClasses.tap,e.animationDuration),Q(c,b,!0,!0),P(),E("slide",c,!0),E("set",c,!0),E("change",c,!0),E("update",c,!0),void(e.events.snap&&I(a,{handleNumbers:[c]})))}function K(a){var b=B(a.calcPoint),c=ja.getStep(b),d=ja.fromStepping(c);Object.keys(la).forEach(function(a){"hover"===a.split(".")[0]&&la[a].forEach(function(a){a.call(da,d)})})}function L(a){a.fixed||ba.forEach(function(a,b){z(ea.start,a.children[0],I,{handleNumbers:[b]})}),a.tap&&z(ea.start,aa,J,{}),a.hover&&z(ea.move,aa,K,{hover:!0}),a.drag&&ca.forEach(function(b,c){if(b!==!1&&0!==c&&c!==ca.length-1){var d=ba[c-1],f=ba[c],g=[b];j(b,e.cssClasses.draggable),a.fixed&&(g.push(d.children[0]),g.push(f.children[0])),g.forEach(function(a){z(ea.start,a,I,{handles:[d,f],handleNumbers:[c-1,c]})})}})}function M(a,b,c,d,f){return ba.length>1&&(d&&b>0&&(c=Math.max(c,a[b-1]+e.margin)),f&&b<ba.length-1&&(c=Math.min(c,a[b+1]-e.margin))),ba.length>1&&e.limit&&(d&&b>0&&(c=Math.min(c,a[b-1]+e.limit)),f&&b<ba.length-1&&(c=Math.max(c,a[b+1]-e.limit))),e.padding&&(0===b&&(c=Math.max(c,e.padding)),b===ba.length-1&&(c=Math.min(c,100-e.padding))),c=ja.getStep(c),c=g(c),c!==a[b]&&c}function N(a){return a+"%"}function O(a,b){ga[a]=b,ka[a]=ja.fromStepping(b);var c=function(){ba[a].style[e.style]=N(b),S(a),S(a+1)};window.requestAnimationFrame&&e.useRequestAnimationFrame?window.requestAnimationFrame(c):c()}function P(){ha.forEach(function(a){var b=ga[a]>50?-1:1,c=3+(ba.length+b*a);ba[a].childNodes[0].style.zIndex=c})}function Q(a,b,c,d){return b=M(ga,a,b,c,d),b!==!1&&(O(a,b),!0)}function S(a){if(ca[a]){var b=0,c=100;0!==a&&(b=ga[a-1]),a!==ca.length-1&&(c=ga[a]),ca[a].style[e.style]=N(b),ca[a].style[e.styleOposite]=N(100-c)}}function T(a,b){null!==a&&a!==!1&&("number"==typeof a&&(a=String(a)),a=e.format.from(a),a===!1||isNaN(a)||Q(b,ja.toStepping(a),!1,!1))}function U(a,b){var c=h(a),d=void 0===ga[0];b=void 0===b||!!b,c.forEach(T),e.animate&&!d&&f(fa,e.cssClasses.tap,e.animationDuration),ha.forEach(function(a){Q(a,ga[a],!0,!1)}),P(),ha.forEach(function(a){E("update",a),null!==c[a]&&b&&E("set",a)})}function V(a){U(e.start,a)}function W(){var a=ka.map(e.format.to);return 1===a.length?a[0]:a}function X(){for(var a in e.cssClasses)e.cssClasses.hasOwnProperty(a)&&k(fa,e.cssClasses[a]);for(;fa.firstChild;)fa.removeChild(fa.firstChild);delete fa.noUiSlider}function Y(){return ga.map(function(a,b){var c=ja.getNearbySteps(a),d=ka[b],e=c.thisStep.step,f=null;e!==!1&&d+e>c.stepAfter.startValue&&(e=c.stepAfter.startValue-d),f=d>c.thisStep.startValue?c.thisStep.step:c.stepBefore.step!==!1&&d-c.stepBefore.highestStep,100===a?e=null:0===a&&(f=null);var g=ja.countStepDecimals();return null!==e&&e!==!1&&(e=Number(e.toFixed(g))),null!==f&&f!==!1&&(f=Number(f.toFixed(g))),[f,e]})}function Z(a,b){la[a]=la[a]||[],la[a].push(b),"update"===a.split(".")[0]&&ba.forEach(function(a,b){E("update",b)})}function $(a){var b=a&&a.split(".")[0],c=b&&a.substring(b.length);Object.keys(la).forEach(function(a){var d=a.split(".")[0],e=a.substring(d.length);b&&b!==d||c&&c!==e||delete la[a]})}function _(a,b){var c=W(),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=ja.direction,ja=f.spectrum,e.margin=f.margin,e.limit=f.limit,e.padding=f.padding,ga=[],U(a.start||c,b)}var aa,ba,ca,da,ea=n(),fa=c,ga=[],ha=[],ia=!1,ja=e.spectrum,ka=[],la={};if(fa.noUiSlider)throw new Error("Slider was already initialized.");return r(fa),q(e.connect,aa),da={destroy:X,steps:Y,on:Z,off:$,get:W,set:U,reset:V,__moveHandles:function(a,b,c){D(a,b,ga,c)},options:i,updateOptions:_,target:fa,pips:x},L(e.events),U(e.start),e.pips&&x(e.pips),e.tooltips&&t(),da}function T(a,b){if(!a.nodeName)throw new Error("noUiSlider.create requires a single element.");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}}); \ No newline at end of file
diff --git a/public/js/plugins/presentation-page/jquery.sharrre.js b/public/js/plugins/presentation-page/jquery.sharrre.js
new file mode 100644
index 0000000..6a2f8a5
--- /dev/null
+++ b/public/js/plugins/presentation-page/jquery.sharrre.js
@@ -0,0 +1,619 @@
+/*!
+ * Sharrre.com - Make your sharing widget!
+ * Version: beta 1.3.5
+ * Author: Julien Hany
+ * License: MIT http://en.wikipedia.org/wiki/MIT_License or GPLv2 http://en.wikipedia.org/wiki/GNU_General_Public_License
+ */
+
+;
+(function($, window, document, undefined) {
+
+ /* Defaults
+ ================================================== */
+ var pluginName = 'sharrre',
+ defaults = {
+ className: 'sharrre',
+ share: {
+ googlePlus: false,
+ facebook: false,
+ twitter: false,
+ digg: false,
+ delicious: false,
+ stumbleupon: false,
+ linkedin: false,
+ pinterest: false
+ },
+ shareTotal: 0,
+ template: '',
+ title: '',
+ url: document.location.href,
+ text: document.title,
+ urlCurl: 'sharrre.php', //PHP script for google plus...
+ count: {}, //counter by social network
+ total: 0, //total of sharing
+ shorterTotal: true, //show total by k or M when number is to big
+ enableHover: true, //disable if you want to personalize hover event with callback
+ enableCounter: true, //disable if you just want use buttons
+ enableTracking: false, //tracking with google analitycs
+ hover: function() {}, //personalize hover event with this callback function
+ hide: function() {}, //personalize hide event with this callback function
+ click: function() {}, //personalize click event with this callback function
+ render: function() {}, //personalize render event with this callback function
+ buttons: { //settings for buttons
+ googlePlus: { //http://www.google.com/webmasters/+1/button/
+ url: '', //if you need to personnalize button url
+ urlCount: false, //if you want to use personnalize button url on global counter
+ size: 'medium',
+ lang: 'en-US',
+ annotation: ''
+ },
+ facebook: { //http://developers.facebook.com/docs/reference/plugins/like/
+ url: '', //if you need to personalize url button
+ urlCount: false, //if you want to use personnalize button url on global counter
+ action: 'like',
+ layout: 'button_count',
+ width: '',
+ send: 'false',
+ faces: 'false',
+ colorscheme: '',
+ font: '',
+ lang: 'en_US'
+ },
+ twitter: { //http://twitter.com/about/resources/tweetbutton
+ url: '', //if you need to personalize url button
+ urlCount: false, //if you want to use personnalize button url on global counter
+ count: 'horizontal',
+ hashtags: '',
+ via: '',
+ related: '',
+ lang: 'en'
+ },
+ digg: { //http://about.digg.com/downloads/button/smart
+ url: '', //if you need to personalize url button
+ urlCount: false, //if you want to use personnalize button url on global counter
+ type: 'DiggCompact'
+ },
+ delicious: {
+ url: '', //if you need to personalize url button
+ urlCount: false, //if you want to use personnalize button url on global counter
+ size: 'medium' //medium or tall
+ },
+ stumbleupon: { //http://www.stumbleupon.com/badges/
+ url: '', //if you need to personalize url button
+ urlCount: false, //if you want to use personnalize button url on global counter
+ layout: '1'
+ },
+ linkedin: { //http://developer.linkedin.com/plugins/share-button
+ url: '', //if you need to personalize url button
+ urlCount: false, //if you want to use personnalize button url on global counter
+ counter: ''
+ },
+ pinterest: { //http://pinterest.com/about/goodies/
+ url: '', //if you need to personalize url button
+ media: '',
+ description: '',
+ layout: 'horizontal'
+ }
+ }
+ },
+ /* Json URL to get count number
+ ================================================== */
+ urlJson = {
+ googlePlus: "",
+
+ //new FQL method by Sire
+ facebook: "https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url=%27{url}%27&callback=?",
+ //old method facebook: "http://graph.facebook.com/?id={url}&callback=?",
+ //facebook : "http://api.ak.facebook.com/restserver.php?v=1.0&method=links.getStats&urls={url}&format=json"
+
+ twitter: "http://cdn.api.twitter.com/1/urls/count.json?url={url}&callback=?",
+ digg: "http://services.digg.com/2.0/story.getInfo?links={url}&type=javascript&callback=?",
+ delicious: 'http://feeds.delicious.com/v2/json/urlinfo/data?url={url}&callback=?',
+ //stumbleupon: "http://www.stumbleupon.com/services/1.01/badge.getinfo?url={url}&format=jsonp&callback=?",
+ stumbleupon: "",
+ linkedin: "http://www.linkedin.com/countserv/count/share?format=jsonp&url={url}&callback=?",
+ pinterest: "http://api.pinterest.com/v1/urls/count.json?url={url}&callback=?"
+ },
+ /* Load share buttons asynchronously
+ ================================================== */
+ loadButton = {
+ googlePlus: function(self) {
+ var sett = self.options.buttons.googlePlus;
+ //$(self.element).find('.buttons').append('<div class="button googleplus"><g:plusone size="'+self.options.buttons.googlePlus.size+'" href="'+self.options.url+'"></g:plusone></div>');
+ $(self.element).find('.buttons').append('<div class="button googleplus"><div class="g-plusone" data-size="' + sett.size + '" data-href="' + (sett.url !== '' ? sett.url : self.options.url) + '" data-annotation="' + sett.annotation + '"></div></div>');
+ window.___gcfg = {
+ lang: self.options.buttons.googlePlus.lang
+ };
+ var loading = 0;
+ if (typeof gapi === 'undefined' && loading == 0) {
+ loading = 1;
+ (function() {
+ var po = document.createElement('script');
+ po.type = 'text/javascript';
+ po.async = true;
+ po.src = '//apis.google.com/js/plusone.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(po, s);
+ })();
+ } else {
+ gapi.plusone.go();
+ }
+ },
+ facebook: function(self) {
+ var sett = self.options.buttons.facebook;
+ $(self.element).find('.buttons').append('<div class="button facebook"><div id="fb-root"></div><div class="fb-like" data-href="' + (sett.url !== '' ? sett.url : self.options.url) + '" data-send="' + sett.send + '" data-layout="' + sett.layout + '" data-width="' + sett.width + '" data-show-faces="' + sett.faces + '" data-action="' + sett.action + '" data-colorscheme="' + sett.colorscheme + '" data-font="' + sett.font + '" data-via="' + sett.via + '"></div></div>');
+ var loading = 0;
+ if (typeof FB === 'undefined' && loading == 0) {
+ loading = 1;
+ (function(d, s, id) {
+ var js, fjs = d.getElementsByTagName(s)[0];
+ if (d.getElementById(id)) {
+ return;
+ }
+ js = d.createElement(s);
+ js.id = id;
+ js.src = '//connect.facebook.net/' + sett.lang + '/all.js#xfbml=1';
+ fjs.parentNode.insertBefore(js, fjs);
+ }(document, 'script', 'facebook-jssdk'));
+ } else {
+ FB.XFBML.parse();
+ }
+ },
+ twitter: function(self) {
+ var sett = self.options.buttons.twitter;
+ $(self.element).find('.buttons').append('<div class="button twitter"><a href="https://twitter.com/share" class="twitter-share-button" data-url="' + (sett.url !== '' ? sett.url : self.options.url) + '" data-count="' + sett.count + '" data-text="' + self.options.text + '" data-via="' + sett.via + '" data-hashtags="' + sett.hashtags + '" data-related="' + sett.related + '" data-lang="' + sett.lang + '">Tweet</a></div>');
+ var loading = 0;
+ if (typeof twttr === 'undefined' && loading == 0) {
+ loading = 1;
+ (function() {
+ var twitterScriptTag = document.createElement('script');
+ twitterScriptTag.type = 'text/javascript';
+ twitterScriptTag.async = true;
+ twitterScriptTag.src = '//platform.twitter.com/widgets.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(twitterScriptTag, s);
+ })();
+ } else {
+ $.ajax({
+ url: '//platform.twitter.com/widgets.js',
+ dataType: 'script',
+ cache: true
+ }); //http://stackoverflow.com/q/6536108
+ }
+ },
+ digg: function(self) {
+ var sett = self.options.buttons.digg;
+ $(self.element).find('.buttons').append('<div class="button digg"><a class="DiggThisButton ' + sett.type + '" rel="nofollow external" href="http://digg.com/submit?url=' + encodeURIComponent((sett.url !== '' ? sett.url : self.options.url)) + '"></a></div>');
+ var loading = 0;
+ if (typeof __DBW === 'undefined' && loading == 0) {
+ loading = 1;
+ (function() {
+ var s = document.createElement('SCRIPT'),
+ s1 = document.getElementsByTagName('SCRIPT')[0];
+ s.type = 'text/javascript';
+ s.async = true;
+ s.src = '//widgets.digg.com/buttons.js';
+ s1.parentNode.insertBefore(s, s1);
+ })();
+ }
+ },
+ delicious: function(self) {
+ if (self.options.buttons.delicious.size == 'tall') { //tall
+ var css = 'width:50px;',
+ cssCount = 'height:35px;width:50px;font-size:15px;line-height:35px;',
+ cssShare = 'height:18px;line-height:18px;margin-top:3px;';
+ } else { //medium
+ var css = 'width:93px;',
+ cssCount = 'float:right;padding:0 3px;height:20px;width:26px;line-height:20px;',
+ cssShare = 'float:left;height:20px;line-height:20px;';
+ }
+ var count = self.shorterTotal(self.options.count.delicious);
+ if (typeof count === "undefined") {
+ count = 0;
+ }
+ $(self.element).find('.buttons').append(
+ '<div class="button delicious"><div style="' + css + 'font:12px Arial,Helvetica,sans-serif;cursor:pointer;color:#666666;display:inline-block;float:none;height:20px;line-height:normal;margin:0;padding:0;text-indent:0;vertical-align:baseline;">' +
+ '<div style="' + cssCount + 'background-color:#fff;margin-bottom:5px;overflow:hidden;text-align:center;border:1px solid #ccc;border-radius:3px;">' + count + '</div>' +
+ '<div style="' + cssShare + 'display:block;padding:0;text-align:center;text-decoration:none;width:50px;background-color:#7EACEE;border:1px solid #40679C;border-radius:3px;color:#fff;">' +
+ '<img src="http://www.delicious.com/static/img/delicious.small.gif" height="10" width="10" alt="Delicious" /> Add</div></div></div>');
+
+ $(self.element).find('.delicious').on('click', function() {
+ self.openPopup('delicious');
+ });
+ },
+ stumbleupon: function(self) {
+ var sett = self.options.buttons.stumbleupon;
+ $(self.element).find('.buttons').append('<div class="button stumbleupon"><su:badge layout="' + sett.layout + '" location="' + (sett.url !== '' ? sett.url : self.options.url) + '"></su:badge></div>');
+ var loading = 0;
+ if (typeof STMBLPN === 'undefined' && loading == 0) {
+ loading = 1;
+ (function() {
+ var li = document.createElement('script');
+ li.type = 'text/javascript';
+ li.async = true;
+ li.src = '//platform.stumbleupon.com/1/widgets.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(li, s);
+ })();
+ s = window.setTimeout(function() {
+ if (typeof STMBLPN !== 'undefined') {
+ STMBLPN.processWidgets();
+ clearInterval(s);
+ }
+ }, 500);
+ } else {
+ STMBLPN.processWidgets();
+ }
+ },
+ linkedin: function(self) {
+ var sett = self.options.buttons.linkedin;
+ $(self.element).find('.buttons').append('<div class="button linkedin"><script type="in/share" data-url="' + (sett.url !== '' ? sett.url : self.options.url) + '" data-counter="' + sett.counter + '"></script></div>');
+ var loading = 0;
+ if (typeof window.IN === 'undefined' && loading == 0) {
+ loading = 1;
+ (function() {
+ var li = document.createElement('script');
+ li.type = 'text/javascript';
+ li.async = true;
+ li.src = '//platform.linkedin.com/in.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(li, s);
+ })();
+ } else {
+ window.IN.init();
+ }
+ },
+ pinterest: function(self) {
+ var sett = self.options.buttons.pinterest;
+ $(self.element).find('.buttons').append('<div class="button pinterest"><a href="http://pinterest.com/pin/create/button/?url=' + (sett.url !== '' ? sett.url : self.options.url) + '&media=' + sett.media + '&description=' + sett.description + '" class="pin-it-button" count-layout="' + sett.layout + '">Pin It</a></div>');
+
+ (function() {
+ var li = document.createElement('script');
+ li.type = 'text/javascript';
+ li.async = true;
+ li.src = '//assets.pinterest.com/js/pinit.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(li, s);
+ })();
+ }
+ },
+ /* Tracking for Google Analytics
+ ================================================== */
+ tracking = {
+ googlePlus: function() {},
+ facebook: function() {
+ //console.log('facebook');
+ fb = window.setInterval(function() {
+ if (typeof FB !== 'undefined') {
+ FB.Event.subscribe('edge.create', function(targetUrl) {
+ _gaq.push(['_trackSocial', 'facebook', 'like', targetUrl]);
+ });
+ FB.Event.subscribe('edge.remove', function(targetUrl) {
+ _gaq.push(['_trackSocial', 'facebook', 'unlike', targetUrl]);
+ });
+ FB.Event.subscribe('message.send', function(targetUrl) {
+ _gaq.push(['_trackSocial', 'facebook', 'send', targetUrl]);
+ });
+ //console.log('ok');
+ clearInterval(fb);
+ }
+ }, 1000);
+ },
+ twitter: function() {
+ //console.log('twitter');
+ tw = window.setInterval(function() {
+ if (typeof twttr !== 'undefined') {
+ twttr.events.bind('tweet', function(event) {
+ if (event) {
+ _gaq.push(['_trackSocial', 'twitter', 'tweet']);
+ }
+ });
+ //console.log('ok');
+ clearInterval(tw);
+ }
+ }, 1000);
+ },
+ digg: function() {
+ //if somenone find a solution, mail me !
+ /*$(this.element).find('.digg').on('click', function(){
+ _gaq.push(['_trackSocial', 'digg', 'add']);
+ });*/
+ },
+ delicious: function() {},
+ stumbleupon: function() {},
+ linkedin: function() {
+ function LinkedInShare() {
+ _gaq.push(['_trackSocial', 'linkedin', 'share']);
+ }
+ },
+ pinterest: function() {
+ //if somenone find a solution, mail me !
+ }
+ },
+ /* Popup for each social network
+ ================================================== */
+ popup = {
+ googlePlus: function(opt) {
+ window.open("https://plus.google.com/share?hl=" + opt.buttons.googlePlus.lang + "&url=" + encodeURIComponent((opt.buttons.googlePlus.url !== '' ? opt.buttons.googlePlus.url : opt.url)), "", "toolbar=0, status=0, width=900, height=500");
+ },
+ facebook: function(opt) {
+ window.open("http://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent((opt.buttons.facebook.url !== '' ? opt.buttons.facebook.url : opt.url)) + "&t=" + opt.text + "", "", "toolbar=0, status=0, width=900, height=500");
+ },
+ twitter: function(opt) {
+ window.open("https://twitter.com/intent/tweet?text=" + encodeURIComponent(opt.text) + "&url=" + encodeURIComponent((opt.buttons.twitter.url !== '' ? opt.buttons.twitter.url : opt.url)) + (opt.buttons.twitter.via !== '' ? '&via=' + opt.buttons.twitter.via : ''), "", "toolbar=0, status=0, width=650, height=360");
+ },
+ digg: function(opt) {
+ window.open("http://digg.com/tools/diggthis/submit?url=" + encodeURIComponent((opt.buttons.digg.url !== '' ? opt.buttons.digg.url : opt.url)) + "&title=" + opt.text + "&related=true&style=true", "", "toolbar=0, status=0, width=650, height=360");
+ },
+ delicious: function(opt) {
+ window.open('http://www.delicious.com/save?v=5&noui&jump=close&url=' + encodeURIComponent((opt.buttons.delicious.url !== '' ? opt.buttons.delicious.url : opt.url)) + '&title=' + opt.text, 'delicious', 'toolbar=no,width=550,height=550');
+ },
+ stumbleupon: function(opt) {
+ window.open('http://www.stumbleupon.com/badge/?url=' + encodeURIComponent((opt.buttons.stumbleupon.url !== '' ? opt.buttons.stumbleupon.url : opt.url)), 'stumbleupon', 'toolbar=no,width=550,height=550');
+ },
+ linkedin: function(opt) {
+ window.open('https://www.linkedin.com/cws/share?url=' + encodeURIComponent((opt.buttons.linkedin.url !== '' ? opt.buttons.linkedin.url : opt.url)) + '&token=&isFramed=true', 'linkedin', 'toolbar=no,width=550,height=550');
+ },
+ pinterest: function(opt) {
+ window.open('http://pinterest.com/pin/create/button/?url=' + encodeURIComponent((opt.buttons.pinterest.url !== '' ? opt.buttons.pinterest.url : opt.url)) + '&media=' + encodeURIComponent(opt.buttons.pinterest.media) + '&description=' + opt.buttons.pinterest.description, 'pinterest', 'toolbar=no,width=700,height=300');
+ }
+ };
+
+ /* Plugin constructor
+ ================================================== */
+ function Plugin(element, options) {
+ this.element = element;
+
+ this.options = $.extend(true, {}, defaults, options);
+ this.options.share = options.share; //simple solution to allow order of buttons
+
+ this._defaults = defaults;
+ this._name = pluginName;
+
+ this.init();
+ };
+
+ /* Initialization method
+ ================================================== */
+ Plugin.prototype.init = function() {
+ var self = this;
+ if (this.options.urlCurl !== '') {
+ urlJson.googlePlus = this.options.urlCurl + '?url={url}&type=googlePlus'; // PHP script for GooglePlus...
+ urlJson.stumbleupon = this.options.urlCurl + '?url={url}&type=stumbleupon'; // PHP script for Stumbleupon...
+ }
+ $(this.element).addClass(this.options.className); //add class
+
+ //HTML5 Custom data
+ if (typeof $(this.element).data('title') !== 'undefined') {
+ this.options.title = $(this.element).attr('data-title');
+ }
+ if (typeof $(this.element).data('url') !== 'undefined') {
+ this.options.url = $(this.element).data('url');
+ }
+ if (typeof $(this.element).data('text') !== 'undefined') {
+ this.options.text = $(this.element).data('text');
+ }
+
+ //how many social website have been selected
+ $.each(this.options.share, function(name, val) {
+ if (val === true) {
+ self.options.shareTotal++;
+ }
+ });
+
+ if (self.options.enableCounter === true) { //if for some reason you don't need counter
+ //get count of social share that have been selected
+ $.each(this.options.share, function(name, val) {
+ if (val === true) {
+ //self.getSocialJson(name);
+ try {
+ self.getSocialJson(name);
+ } catch (e) {}
+ }
+ });
+ } else if (self.options.template !== '') { //for personalized button (with template)
+ this.options.render(this, this.options);
+ } else { // if you want to use official button like example 3 or 5
+ this.loadButtons();
+ }
+
+ //add hover event
+ $(this.element).hover(function() {
+ //load social button if enable and 1 time
+ if ($(this).find('.buttons').length === 0 && self.options.enableHover === true) {
+ self.loadButtons();
+ }
+ self.options.hover(self, self.options);
+ }, function() {
+ self.options.hide(self, self.options);
+ });
+
+ //click event
+ $(this.element).click(function() {
+ self.options.click(self, self.options);
+ return false;
+ });
+ };
+
+ /* loadButtons methode
+ ================================================== */
+ Plugin.prototype.loadButtons = function() {
+ var self = this;
+ $(this.element).append('<div class="buttons"></div>');
+ $.each(self.options.share, function(name, val) {
+ if (val == true) {
+ loadButton[name](self);
+ if (self.options.enableTracking === true) { //add tracking
+ tracking[name]();
+ }
+ }
+ });
+ };
+
+ /* getSocialJson methode
+ ================================================== */
+ Plugin.prototype.getSocialJson = function(name) {
+ var self = this,
+ count = 0,
+ url = urlJson[name].replace('{url}', encodeURIComponent(this.options.url));
+ if (this.options.buttons[name].urlCount === true && this.options.buttons[name].url !== '') {
+ url = urlJson[name].replace('{url}', this.options.buttons[name].url);
+ }
+ //console.log('name : ' + name + ' - url : '+url); //debug
+ if (url != '' && self.options.urlCurl !== '') { //urlCurl = '' if you don't want to used PHP script but used social button
+ $.getJSON(url, function(json) {
+ if (typeof json.count !== "undefined") { //GooglePlus, Stumbleupon, Twitter, Pinterest and Digg
+ var temp = json.count + '';
+ temp = temp.replace('\u00c2\u00a0', ''); //remove google plus special chars
+ count += parseInt(temp, 10);
+ }
+ //get the FB total count (shares, likes and more)
+ else if (json.data && json.data.length > 0 && typeof json.data[0].total_count !== "undefined") { //Facebook total count
+ count += parseInt(json.data[0].total_count, 10);
+ } else if (typeof json[0] !== "undefined") { //Delicious
+ count += parseInt(json[0].total_posts, 10);
+ } else if (typeof json[0] !== "undefined") { //Stumbleupon
+ }
+ self.options.count[name] = count;
+ self.options.total += count;
+ self.renderer();
+ self.rendererPerso();
+ //console.log(json); //debug
+ })
+ .error(function() {
+ self.options.count[name] = 0;
+ self.rendererPerso();
+ });
+ } else {
+ self.renderer();
+ self.options.count[name] = 0;
+ self.rendererPerso();
+ }
+ };
+
+ /* launch render methode
+ ================================================== */
+ Plugin.prototype.rendererPerso = function() {
+ //check if this is the last social website to launch render
+ var shareCount = 0;
+ for (e in this.options.count) {
+ shareCount++;
+ }
+ if (shareCount === this.options.shareTotal) {
+ this.options.render(this, this.options);
+ }
+ };
+
+ /* render methode
+ ================================================== */
+ Plugin.prototype.renderer = function() {
+ var total = this.options.total,
+ template = this.options.template;
+ if (this.options.shorterTotal === true) { //format number like 1.2k or 5M
+ total = this.shorterTotal(total);
+ }
+
+ if (template !== '') { //if there is a template
+ template = template.replace('{total}', total);
+ $(this.element).html(template);
+ } else { //template by defaults
+ $(this.element).html(
+ '<div class="box"><a class="count" href="#">' + total + '</a>' +
+ (this.options.title !== '' ? '<a class="share" href="#">' + this.options.title + '</a>' : '') +
+ '</div>'
+ );
+ }
+ };
+
+ /* format total numbers like 1.2k or 5M
+ ================================================== */
+ Plugin.prototype.shorterTotal = function(num) {
+ if (num >= 1e6) {
+ num = (num / 1e6).toFixed(2) + "M"
+ } else if (num >= 1e3) {
+ num = (num / 1e3).toFixed(1) + "k"
+ }
+ return num;
+ };
+
+ /* Methode for open popup
+ ================================================== */
+ Plugin.prototype.openPopup = function(site) {
+ popup[site](this.options); //open
+ if (this.options.enableTracking === true) { //tracking!
+ var tracking = {
+ googlePlus: {
+ site: 'Google',
+ action: '+1'
+ },
+ facebook: {
+ site: 'facebook',
+ action: 'like'
+ },
+ twitter: {
+ site: 'twitter',
+ action: 'tweet'
+ },
+ digg: {
+ site: 'digg',
+ action: 'add'
+ },
+ delicious: {
+ site: 'delicious',
+ action: 'add'
+ },
+ stumbleupon: {
+ site: 'stumbleupon',
+ action: 'add'
+ },
+ linkedin: {
+ site: 'linkedin',
+ action: 'share'
+ },
+ pinterest: {
+ site: 'pinterest',
+ action: 'pin'
+ }
+ };
+ _gaq.push(['_trackSocial', tracking[site].site, tracking[site].action]);
+ }
+ };
+
+ /* Methode for add +1 to a counter
+ ================================================== */
+ Plugin.prototype.simulateClick = function() {
+ var html = $(this.element).html();
+ $(this.element).html(html.replace(this.options.total, this.options.total + 1));
+ };
+
+ /* Methode for add +1 to a counter
+ ================================================== */
+ Plugin.prototype.update = function(url, text) {
+ if (url !== '') {
+ this.options.url = url;
+ }
+ if (text !== '') {
+ this.options.text = text;
+ }
+ };
+
+ /* A really lightweight plugin wrapper around the constructor, preventing against multiple instantiations
+ ================================================== */
+ $.fn[pluginName] = function(options) {
+ var args = arguments;
+ if (options === undefined || typeof options === 'object') {
+ return this.each(function() {
+ if (!$.data(this, 'plugin_' + pluginName)) {
+ $.data(this, 'plugin_' + pluginName, new Plugin(this, options));
+ }
+ });
+ } else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
+ return this.each(function() {
+ var instance = $.data(this, 'plugin_' + pluginName);
+ if (instance instanceof Plugin && typeof instance[options] === 'function') {
+ instance[options].apply(instance, Array.prototype.slice.call(args, 1));
+ }
+ });
+ }
+ };
+})(jQuery, window, document); \ No newline at end of file
diff --git a/public/js/plugins/presentation-page/rellax.min.js b/public/js/plugins/presentation-page/rellax.min.js
new file mode 100644
index 0000000..8991198
--- /dev/null
+++ b/public/js/plugins/presentation-page/rellax.min.js
@@ -0,0 +1,5 @@
+(function(h,f){"function"===typeof define&&define.amd?define([],f):"object"===typeof module&&module.exports?module.exports=f():h.Rellax=f()})(this,function(){var h=function(f,l){var b=Object.create(h.prototype),g=0,k=0,c=[],p=!1,u=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(a){setTimeout(a,1E3/60)},m=function(a,b,d){return a<=b?b:a>=d?d:a};b.options={speed:-2,center:!1};l&&
+Object.keys(l).forEach(function(a){b.options[a]=l[a]});b.options.speed=m(b.options.speed,-10,10);f||(f=".rellax");var q=document.querySelectorAll(f);if(0<q.length)b.elems=q;else throw Error("The elements you're trying to select don't exist.");var v=function(a){var e=a.getAttribute("data-rellax-percentage"),d=a.getAttribute("data-rellax-speed"),c=e||b.options.center?window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop:0,f=c+a.getBoundingClientRect().top,h=a.clientHeight||
+a.offsetHeight||a.scrollHeight,g=e?e:(c-f+k)/(h+k);b.options.center&&(g=.5);c=d?m(d,-10,10):b.options.speed;if(e||b.options.center)c=m(d||b.options.speed,-5,5);e=Math.round(100*c*(1-g));a=a.style.cssText;d="";0<=a.indexOf("transform")&&(d=a.indexOf("transform"),d=a.slice(d),d=(g=d.indexOf(";"))?" "+d.slice(11,g).replace(/\s/g,""):" "+d.slice(11).replace(/\s/g,""));return{base:e,top:f,height:h,speed:c,style:a,transform:d}},r=function(){var a=g;g=void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||
+document.body.parentNode||document.body).scrollTop;return a!=g?!0:!1},t=function(){r()&&!1===p&&n();u(t)},n=function(){for(var a=0;a<b.elems.length;a++){var e=" translate3d(0,"+(Math.round(100*c[a].speed*(1-(g-c[a].top+k)/(c[a].height+k)))-c[a].base)+"px,0)"+c[a].transform;b.elems[a].style.cssText=c[a].style+"-webkit-transform:"+e+";-moz-transform:"+e+";transform:"+e+";"}};b.destroy=function(){for(var a=0;a<b.elems.length;a++)b.elems[a].style.cssText=c[a].style;p=!0};(function(){k=window.innerHeight;
+r();for(var a=0;a<b.elems.length;a++){var e=v(b.elems[a]);c.push(e)}window.addEventListener("resize",function(){n()});t();n()})();return b};return h});