/* * # Semantic UI - 2.3.0 * https://github.com/Semantic-Org/Semantic-UI * http://www.semantic-ui.com/ * * Copyright 2014 Contributors * Released under the MIT license * http://opensource.org/licenses/MIT * */ //! moment.js //! version : 2.14.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";function e(){return hi.apply(null,arguments)} // This is done to register the method called with moment() // without creating circular dependencies. function t(e){hi=e}function n(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return"[object Object]"===Object.prototype.toString.call(e)}function o(e){var t;for(t in e) // even if its not own property I'd still call it non-empty return!1;return!0}function a(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function r(e,t){var n,i=[];for(n=0;n0)for(n in gi)i=gi[n],o=t[i],m(o)||(e[i]=o);return e} // Moment prototype object function p(t){g(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),pi===!1&&(pi=!0,e.updateOffset(this),pi=!1)}function v(e){return e instanceof p||null!=e&&null!=e._isAMomentObject}function b(e){return 0>e?Math.ceil(e)||0:Math.floor(e)}function y(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=b(t)),n} // compare two arrays, return the number of differences function x(e,t,n){var i,o=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),r=0;for(i=0;o>i;i++)(n&&e[i]!==t[i]||!n&&y(e[i])!==y(t[i]))&&r++;return r+a}function w(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function C(t,n){var i=!0;return l(function(){return null!=e.deprecationHandler&&e.deprecationHandler(null,t),i&&(w(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),i=!1),n.apply(this,arguments)},n)}function k(t,n){null!=e.deprecationHandler&&e.deprecationHandler(t,n),vi[t]||(w(n),vi[t]=!0)}function S(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function D(e){var t,n;for(n in e)t=e[n],S(t)?this[n]=t:this["_"+n]=t;this._config=e, // Lenient ordinal parsing accepts just a number in addition to // number + (possibly) stuff coming from _ordinalParseLenient. this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function T(e,t){var n,o=l({},e);for(n in t)s(t,n)&&(i(e[n])&&i(t[n])?(o[n]={},l(o[n],e[n]),l(o[n],t[n])):null!=t[n]?o[n]=t[n]:delete o[n]);for(n in e)s(e,n)&&!s(t,n)&&i(e[n])&&( // make sure changes to properties don't modify parent config o[n]=l({},o[n]));return o}function P(e){null!=e&&this.set(e)}function _(e,t,n){var i=this._calendar[e]||this._calendar.sameElse;return S(i)?i.call(t,n):i}function A(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function M(){return this._invalidDate}function R(e){return this._ordinal.replace("%d",e)}function O(e,t,n,i){var o=this._relativeTime[n];return S(o)?o(e,t,n,i):o.replace(/%d/i,e)}function E(e,t){var n=this._relativeTime[e>0?"future":"past"];return S(n)?n(t):n.replace(/%s/i,t)}function F(e,t){var n=e.toLowerCase();Ti[n]=Ti[n+"s"]=Ti[t]=e}function Y(e){return"string"==typeof e?Ti[e]||Ti[e.toLowerCase()]:void 0}function L(e){var t,n,i={};for(n in e)s(e,n)&&(t=Y(n),t&&(i[t]=e[n]));return i}function j(e,t){Pi[e]=t}function I(e){var t=[];for(var n in e)t.push({unit:n,priority:Pi[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}function q(t,n){return function(i){return null!=i?(V(this,t,i),e.updateOffset(this,n),this):z(this,t)}}function z(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function V(e,t,n){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](n)} // MOMENTS function N(e){return e=Y(e),S(this[e])?this[e]():this}function H(e,t){if("object"==typeof e){e=L(e);for(var n=I(e),i=0;i=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+i} // token: 'M' // padded: ['MM', 2] // ordinal: 'Mo' // callback: function () { this.month() + 1 } function W(e,t,n,i){var o=i;"string"==typeof i&&(o=function(){return this[i]()}),e&&(Ri[e]=o),t&&(Ri[t[0]]=function(){return U(o.apply(this,arguments),t[1],t[2])}),n&&(Ri[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function B(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function G(e){var t,n,i=e.match(_i);for(t=0,n=i.length;n>t;t++)Ri[i[t]]?i[t]=Ri[i[t]]:i[t]=B(i[t]);return function(t){var o,a="";for(o=0;n>o;o++)a+=i[o]instanceof Function?i[o].call(t,e):i[o];return a}} // format date using native date object function Z(e,t){return e.isValid()?(t=Q(t,e.localeData()),Mi[t]=Mi[t]||G(t),Mi[t](e)):e.localeData().invalidDate()}function Q(e,t){function n(e){return t.longDateFormat(e)||e}var i=5;for(Ai.lastIndex=0;i>=0&&Ai.test(e);)e=e.replace(Ai,n),Ai.lastIndex=0,i-=1;return e}function $(e,t,n){Qi[e]=S(t)?t:function(e,i){return e&&n?n:t}}function X(e,t){return s(Qi,e)?Qi[e](t._strict,t._locale):new RegExp(J(e))} // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function J(e){return K(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,i,o){return t||n||i||o}))}function K(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ee(e,t){var n,i=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(i=function(e,n){n[t]=y(e)}),n=0;ni;++i)a=c([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(a,"").toLocaleLowerCase();return n?"MMM"===t?(o=yi.call(this._shortMonthsParse,r),-1!==o?o:null):(o=yi.call(this._longMonthsParse,r),-1!==o?o:null):"MMM"===t?(o=yi.call(this._shortMonthsParse,r),-1!==o?o:(o=yi.call(this._longMonthsParse,r),-1!==o?o:null)):(o=yi.call(this._longMonthsParse,r),-1!==o?o:(o=yi.call(this._shortMonthsParse,r),-1!==o?o:null))}function se(e,t,n){var i,o,a;if(this._monthsParseExact)return re.call(this,e,t,n); // TODO: add sorting // Sorting makes sure if one month (or abbr) is a prefix of another // see sorting in computeMonthsParse for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;12>i;i++){ // test the regex if(o=c([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(a="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[i]=new RegExp(a.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[i].test(e))return i;if(n&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}} // MOMENTS function le(e,t){var n;if(!e.isValid()) // No op return e;if("string"==typeof t)if(/^\d+$/.test(t))t=y(t);else // TODO: Another silent failure? if(t=e.localeData().monthsParse(t),"number"!=typeof t)return e;return n=Math.min(e.date(),ie(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function ce(t){return null!=t?(le(this,t),e.updateOffset(this,!0),this):z(this,"Month")}function ue(){return ie(this.year(),this.month())}function de(e){return this._monthsParseExact?(s(this,"_monthsRegex")||he.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=co),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function fe(e){return this._monthsParseExact?(s(this,"_monthsRegex")||he.call(this),e?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=uo),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function he(){function e(e,t){return t.length-e.length}var t,n,i=[],o=[],a=[];for(t=0;12>t;t++)n=c([2e3,t]),i.push(this.monthsShort(n,"")),o.push(this.months(n,"")),a.push(this.months(n,"")),a.push(this.monthsShort(n,""));for( // Sorting makes sure if one month (or abbr) is a prefix of another it // will match the longer piece. i.sort(e),o.sort(e),a.sort(e),t=0;12>t;t++)i[t]=K(i[t]),o[t]=K(o[t]);for(t=0;24>t;t++)a[t]=K(a[t]);this._monthsRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")} // HELPERS function me(e){return ge(e)?366:365}function ge(e){return e%4===0&&e%100!==0||e%400===0}function pe(){return ge(this.year())}function ve(e,t,n,i,o,a,r){ //can't just apply() to create a date: //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var s=new Date(e,t,n,i,o,a,r); //the date constructor remaps years 0-99 to 1900-1999 return 100>e&&e>=0&&isFinite(s.getFullYear())&&s.setFullYear(e),s}function be(e){var t=new Date(Date.UTC.apply(null,arguments)); //the Date.UTC function remaps years 0-99 to 1900-1999 return 100>e&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t} // start-of-first-week - start-of-year function ye(e,t,n){var// first-week day -- which january is always in the first week (4 for iso, 1 for other) i=7+t-n, // first-week day local weekday -- which local weekday is fwd o=(7+be(e,0,i).getUTCDay()-t)%7;return-o+i-1} //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday function xe(e,t,n,i,o){var a,r,s=(7+n-i)%7,l=ye(e,i,o),c=1+7*(t-1)+s+l;return 0>=c?(a=e-1,r=me(a)+c):c>me(e)?(a=e+1,r=c-me(e)):(a=e,r=c),{year:a,dayOfYear:r}}function we(e,t,n){var i,o,a=ye(e.year(),t,n),r=Math.floor((e.dayOfYear()-a-1)/7)+1;return 1>r?(o=e.year()-1,i=r+Ce(o,t,n)):r>Ce(e.year(),t,n)?(i=r-Ce(e.year(),t,n),o=e.year()+1):(o=e.year(),i=r),{week:i,year:o}}function Ce(e,t,n){var i=ye(e,t,n),o=ye(e+1,t,n);return(me(e)-i+o)/7} // HELPERS // LOCALES function ke(e){return we(e,this._week.dow,this._week.doy).week}function Se(){return this._week.dow}function De(){return this._week.doy} // MOMENTS function Te(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Pe(e){var t=we(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")} // HELPERS function _e(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function Ae(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Me(e,t){return n(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]}function Re(e){return this._weekdaysShort[e.day()]}function Oe(e){return this._weekdaysMin[e.day()]}function Ee(e,t,n){var i,o,a,r=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;7>i;++i)a=c([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(a,"").toLocaleLowerCase();return n?"dddd"===t?(o=yi.call(this._weekdaysParse,r),-1!==o?o:null):"ddd"===t?(o=yi.call(this._shortWeekdaysParse,r),-1!==o?o:null):(o=yi.call(this._minWeekdaysParse,r),-1!==o?o:null):"dddd"===t?(o=yi.call(this._weekdaysParse,r),-1!==o?o:(o=yi.call(this._shortWeekdaysParse,r),-1!==o?o:(o=yi.call(this._minWeekdaysParse,r),-1!==o?o:null))):"ddd"===t?(o=yi.call(this._shortWeekdaysParse,r),-1!==o?o:(o=yi.call(this._weekdaysParse,r),-1!==o?o:(o=yi.call(this._minWeekdaysParse,r),-1!==o?o:null))):(o=yi.call(this._minWeekdaysParse,r),-1!==o?o:(o=yi.call(this._weekdaysParse,r),-1!==o?o:(o=yi.call(this._shortWeekdaysParse,r),-1!==o?o:null)))}function Fe(e,t,n){var i,o,a;if(this._weekdaysParseExact)return Ee.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;7>i;i++){ // test the regex if(o=c([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(o,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(o,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(o,"").replace(".",".?")+"$","i")),this._weekdaysParse[i]||(a="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[i]=new RegExp(a.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[i].test(e))return i;if(n&&"ddd"===t&&this._shortWeekdaysParse[i].test(e))return i;if(n&&"dd"===t&&this._minWeekdaysParse[i].test(e))return i;if(!n&&this._weekdaysParse[i].test(e))return i}} // MOMENTS function Ye(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=_e(e,this.localeData()),this.add(e-t,"d")):t}function Le(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function je(e){if(!this.isValid())return null!=e?this:NaN; // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. if(null!=e){var t=Ae(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Ie(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ve.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=vo),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function qe(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ve.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=bo),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function ze(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ve.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=yo),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ve(){function e(e,t){return t.length-e.length}var t,n,i,o,a,r=[],s=[],l=[],u=[];for(t=0;7>t;t++)n=c([2e3,1]).day(t),i=this.weekdaysMin(n,""),o=this.weekdaysShort(n,""),a=this.weekdays(n,""),r.push(i),s.push(o),l.push(a),u.push(i),u.push(o),u.push(a);for( // Sorting makes sure if one weekday (or abbr) is a prefix of another it // will match the longer piece. r.sort(e),s.sort(e),l.sort(e),u.sort(e),t=0;7>t;t++)s[t]=K(s[t]),l[t]=K(l[t]),u[t]=K(u[t]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")} // FORMATTING function Ne(){return this.hours()%12||12}function He(){return this.hours()||24}function Ue(e,t){W(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})} // PARSING function We(e,t){return t._meridiemParse} // LOCALES function Be(e){ // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays // Using charAt should be more compatible. return"p"===(e+"").toLowerCase().charAt(0)}function Ge(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function Ze(e){return e?e.toLowerCase().replace("_","-"):e} // pick the locale from the array // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root function Qe(e){for(var t,n,i,o,a=0;a0;){if(i=$e(o.slice(0,t).join("-")))return i;if(n&&n.length>=t&&x(o,n,!0)>=t-1) //the next array item is better than a shallower substring of this one break;t--}a++}return null}function $e(e){var t=null; // TODO: Find a better way to register and load all the locales in Node if(!So[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=xo._abbr,require("./locale/"+e), // because defineLocale currently also sets the global locale, we // want to undo that for lazy loaded locales Xe(t)}catch(n){}return So[e]} // This function will load locale and then set the global locale. If // no arguments are passed in, it will simply return the current global // locale key. function Xe(e,t){var n; // moment.duration._locale = moment._locale = data; return e&&(n=m(t)?et(e):Je(e,t),n&&(xo=n)),xo._abbr}function Je(e,t){if(null!==t){var n=ko; // treat as if there is no base config // backwards compat for now: also set the locale return t.abbr=e,null!=So[e]?(k("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."),n=So[e]._config):null!=t.parentLocale&&(null!=So[t.parentLocale]?n=So[t.parentLocale]._config:k("parentLocaleUndefined","specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/")),So[e]=new P(T(n,t)),Xe(e),So[e]} // useful for testing return delete So[e],null}function Ke(e,t){if(null!=t){var n,i=ko; // MERGE null!=So[e]&&(i=So[e]._config),t=T(i,t),n=new P(t),n.parentLocale=So[e],So[e]=n, // backwards compat for now: also set the locale Xe(e)}else // pass null for config to unupdate, useful for tests null!=So[e]&&(null!=So[e].parentLocale?So[e]=So[e].parentLocale:null!=So[e]&&delete So[e]);return So[e]} // returns locale data function et(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return xo;if(!n(e)){if(t=$e(e))return t;e=[e]}return Qe(e)}function tt(){return bi(So)}function nt(e){var t,n=e._a;return n&&-2===d(e).overflow&&(t=n[Ji]<0||n[Ji]>11?Ji:n[Ki]<1||n[Ki]>ie(n[Xi],n[Ji])?Ki:n[eo]<0||n[eo]>24||24===n[eo]&&(0!==n[to]||0!==n[no]||0!==n[io])?eo:n[to]<0||n[to]>59?to:n[no]<0||n[no]>59?no:n[io]<0||n[io]>999?io:-1,d(e)._overflowDayOfYear&&(Xi>t||t>Ki)&&(t=Ki),d(e)._overflowWeeks&&-1===t&&(t=oo),d(e)._overflowWeekday&&-1===t&&(t=ao),d(e).overflow=t),e} // date from iso format function it(e){var t,n,i,o,a,r,s=e._i,l=Do.exec(s)||To.exec(s);if(l){for(d(e).iso=!0,t=0,n=_o.length;n>t;t++)if(_o[t][1].exec(l[1])){o=_o[t][0],i=_o[t][2]!==!1;break}if(null==o)return void(e._isValid=!1);if(l[3]){for(t=0,n=Ao.length;n>t;t++)if(Ao[t][1].exec(l[3])){ // match[2] should be 'T' or space a=(l[2]||" ")+Ao[t][0];break}if(null==a)return void(e._isValid=!1)}if(!i&&null!=a)return void(e._isValid=!1);if(l[4]){if(!Po.exec(l[4]))return void(e._isValid=!1);r="Z"}e._f=o+(a||"")+(r||""),ct(e)}else e._isValid=!1} // date from iso format or fallback function ot(t){var n=Mo.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(it(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))} // Pick the first defined of two or three arguments. function at(e,t,n){return null!=e?e:null!=t?t:n}function rt(t){ // hooks is actually the exported moment object var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]} // convert an array to a date. // the array should mirror the parameters below // note: all values past the year are optional and will default to the lowest possible value. // [year, month, day , hour, minute, second, millisecond] function st(e){var t,n,i,o,a=[];if(!e._d){ // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for(i=rt(e),e._w&&null==e._a[Ki]&&null==e._a[Ji]&<(e),e._dayOfYear&&(o=at(e._a[Xi],i[Xi]),e._dayOfYear>me(o)&&(d(e)._overflowDayOfYear=!0),n=be(o,0,e._dayOfYear),e._a[Ji]=n.getUTCMonth(),e._a[Ki]=n.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=a[t]=i[t]; // Zero out whatever was not defaulted, including time for(;7>t;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t]; // Check for 24:00:00.000 24===e._a[eo]&&0===e._a[to]&&0===e._a[no]&&0===e._a[io]&&(e._nextDay=!0,e._a[eo]=0),e._d=(e._useUTC?be:ve).apply(null,a), // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[eo]=24)}}function lt(e){var t,n,i,o,a,r,s,l;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(a=1,r=4,n=at(t.GG,e._a[Xi],we(vt(),1,4).year),i=at(t.W,1),o=at(t.E,1),(1>o||o>7)&&(l=!0)):(a=e._locale._week.dow,r=e._locale._week.doy,n=at(t.gg,e._a[Xi],we(vt(),a,r).year),i=at(t.w,1),null!=t.d?(o=t.d,(0>o||o>6)&&(l=!0)):null!=t.e?(o=t.e+a,(t.e<0||t.e>6)&&(l=!0)):o=a),1>i||i>Ce(n,a,r)?d(e)._overflowWeeks=!0:null!=l?d(e)._overflowWeekday=!0:(s=xe(n,i,o,a,r),e._a[Xi]=s.year,e._dayOfYear=s.dayOfYear)} // date from string and format string function ct(t){ // TODO: Move this to another part of the creation flow to prevent circular deps if(t._f===e.ISO_8601)return void it(t);t._a=[],d(t).empty=!0; // This array is used to make a Date, either with `new Date` or `Date.UTC` var n,i,o,a,r,s=""+t._i,l=s.length,c=0;for(o=Q(t._f,t._locale).match(_i)||[],n=0;n0&&d(t).unusedInput.push(r),s=s.slice(s.indexOf(i)+i.length),c+=i.length),Ri[a]?(i?d(t).empty=!1:d(t).unusedTokens.push(a),ne(a,i,t)):t._strict&&!i&&d(t).unusedTokens.push(a); // add remaining unparsed input length to the string d(t).charsLeftOver=l-c,s.length>0&&d(t).unusedInput.push(s), // clear _12h flag if hour is <= 12 t._a[eo]<=12&&d(t).bigHour===!0&&t._a[eo]>0&&(d(t).bigHour=void 0),d(t).parsedDateParts=t._a.slice(0),d(t).meridiem=t._meridiem, // handle meridiem t._a[eo]=ut(t._locale,t._a[eo],t._meridiem),st(t),nt(t)}function ut(e,t,n){var i; // Fallback return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(i=e.isPM(n),i&&12>t&&(t+=12),i||12!==t||(t=0),t):t} // date from string and array of format strings function dt(e){var t,n,i,o,a;if(0===e._f.length)return d(e).invalidFormat=!0,void(e._d=new Date(NaN));for(o=0;oa)&&(i=a,n=t));l(e,n||t)}function ft(e){if(!e._d){var t=L(e._i);e._a=r([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),st(e)}}function ht(e){var t=new p(nt(mt(e))); // Adding is smart enough around DST return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function mt(e){var t=e._i,i=e._f;return e._locale=e._locale||et(e._l),null===t||void 0===i&&""===t?h({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),v(t)?new p(nt(t)):(n(i)?dt(e):a(t)?e._d=t:i?ct(e):gt(e),f(e)||(e._d=null),e))}function gt(t){var i=t._i;void 0===i?t._d=new Date(e.now()):a(i)?t._d=new Date(i.valueOf()):"string"==typeof i?ot(t):n(i)?(t._a=r(i.slice(0),function(e){return parseInt(e,10)}),st(t)):"object"==typeof i?ft(t):"number"==typeof i? // from milliseconds t._d=new Date(i):e.createFromInputFallback(t)}function pt(e,t,a,r,s){var l={}; // object construction must be done this way. // https://github.com/moment/moment/issues/1423 return"boolean"==typeof a&&(r=a,a=void 0),(i(e)&&o(e)||n(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=s,l._l=a,l._i=e,l._f=t,l._strict=r,ht(l)}function vt(e,t,n,i){return pt(e,t,n,i,!1)} // Pick a moment m from moments so that m[fn](other) is true for all // other. This relies on the function fn to be transitive. // // moments should either be an array of moment objects or an array, whose // first element is an array of moment objects. function bt(e,t){var i,o;if(1===t.length&&n(t[0])&&(t=t[0]),!t.length)return vt();for(i=t[0],o=1;oe&&(e=-e,n="-"),n+U(~~(e/60),2)+t+U(~~e%60,2)})}function St(e,t){var n=(t||"").match(e)||[],i=n[n.length-1]||[],o=(i+"").match(Fo)||["-",0,0],a=+(60*o[1])+y(o[2]);return"+"===o[0]?a:-a} // Return a moment from input, that is local/utc/zone equivalent to model. function Dt(t,n){var i,o; // Use low-level api, because this fn is low-level api. return n._isUTC?(i=n.clone(),o=(v(t)||a(t)?t.valueOf():vt(t).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+o),e.updateOffset(i,!1),i):vt(t).local()}function Tt(e){ // On Firefox.24 Date#getTimezoneOffset returns a floating point. // https://github.com/moment/moment/pull/1871 return 15*-Math.round(e._d.getTimezoneOffset()/15)} // MOMENTS // keepLocalTime = true means only change the timezone, without // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset // +0200, so we adjust the time as needed, to be valid. // // Keeping the time actually adds/subtracts (one hour) // from the actual represented time. That is why we call updateOffset // a second time. In case it wants us to change the offset again // _changeInProgress == true case, then we have to adjust, because // there is no such time in the given timezone. function Pt(t,n){var i,o=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=St(Bi,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&n&&(i=Tt(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),o!==t&&(!n||this._changeInProgress?Ut(this,It(t-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?o:Tt(this):null!=t?this:NaN}function _t(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function At(e){return this.utcOffset(0,e)}function Mt(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Tt(this),"m")),this}function Rt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(St(Wi,this._i)),this}function Ot(e){return this.isValid()?(e=e?vt(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function Et(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ft(){if(!m(this._isDSTShifted))return this._isDSTShifted;var e={};if(g(e,this),e=mt(e),e._a){var t=e._isUTC?c(e._a):vt(e._a);this._isDSTShifted=this.isValid()&&x(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Yt(){return this.isValid()?!this._isUTC:!1}function Lt(){return this.isValid()?this._isUTC:!1}function jt(){return this.isValid()?this._isUTC&&0===this._offset:!1}function It(e,t){var n,i,o,a=e, // matching against regexp is expensive, do it on demand r=null;// checks for null or undefined return Ct(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(a={},t?a[t]=e:a.milliseconds=e):(r=Yo.exec(e))?(n="-"===r[1]?-1:1,a={y:0,d:y(r[Ki])*n,h:y(r[eo])*n,m:y(r[to])*n,s:y(r[no])*n,ms:y(r[io])*n}):(r=Lo.exec(e))?(n="-"===r[1]?-1:1,a={y:qt(r[2],n),M:qt(r[3],n),w:qt(r[4],n),d:qt(r[5],n),h:qt(r[6],n),m:qt(r[7],n),s:qt(r[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(o=Vt(vt(a.from),vt(a.to)),a={},a.ms=o.milliseconds,a.M=o.months),i=new wt(a),Ct(e)&&s(e,"_locale")&&(i._locale=e._locale),i}function qt(e,t){ // We'd normally use ~~inp for this, but unfortunately it also // converts floats to ints. // inp may be undefined, so careful calling replace on it. var n=e&&parseFloat(e.replace(",",".")); // apply sign while we're at it return(isNaN(n)?0:n)*t}function zt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Vt(e,t){var n;return e.isValid()&&t.isValid()?(t=Dt(t,e),e.isBefore(t)?n=zt(e,t):(n=zt(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Nt(e){return 0>e?-1*Math.round(-1*e):Math.round(e)} // TODO: remove 'name' arg after deprecation is removed function Ht(e,t){return function(n,i){var o,a; //invert the arguments, but complain about it return null===i||isNaN(+i)||(k(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=i,i=a),n="string"==typeof n?+n:n,o=It(n,i),Ut(this,o,e),this}}function Ut(t,n,i,o){var a=n._milliseconds,r=Nt(n._days),s=Nt(n._months);t.isValid()&&(o=null==o?!0:o,a&&t._d.setTime(t._d.valueOf()+a*i),r&&V(t,"Date",z(t,"Date")+r*i),s&&le(t,z(t,"Month")+s*i),o&&e.updateOffset(t,r||s))}function Wt(e,t){var n=e.diff(t,"days",!0);return-6>n?"sameElse":-1>n?"lastWeek":0>n?"lastDay":1>n?"sameDay":2>n?"nextDay":7>n?"nextWeek":"sameElse"}function Bt(t,n){ // We want to compare the start of today, vs this. // Getting start-of-today depends on whether we're local/utc/offset or not. var i=t||vt(),o=Dt(i,this).startOf("day"),a=e.calendarFormat(this,o)||"sameElse",r=n&&(S(n[a])?n[a].call(this,i):n[a]);return this.format(r||this.localeData().calendar(a,this,vt(i)))}function Gt(){return new p(this)}function Zt(e,t){var n=v(e)?e:vt(e);return this.isValid()&&n.isValid()?(t=Y(m(t)?"millisecond":t),"millisecond"===t?this.valueOf()>n.valueOf():n.valueOf()t-a?(n=e.clone().add(o-1,"months"),i=(t-a)/(a-n)):(n=e.clone().add(o+1,"months"),i=(t-a)/(n-a)),-(o+i)||0}function nn(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function on(){var e=this.clone().utc();return 0a&&(t=a),Mn.call(this,e,t,n,i,o))}function Mn(e,t,n,i,o){var a=xe(e,t,n,i,o),r=be(a.year,0,a.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this} // MOMENTS function Rn(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)} // HELPERS // MOMENTS function On(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function En(e,t){t[io]=y(1e3*("0."+e))} // MOMENTS function Fn(){return this._isUTC?"UTC":""}function Yn(){return this._isUTC?"Coordinated Universal Time":""}function Ln(e){return vt(1e3*e)}function jn(){return vt.apply(null,arguments).parseZone()}function In(e){return e}function qn(e,t,n,i){var o=et(),a=c().set(i,t);return o[n](a,e)}function zn(e,t,n){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return qn(e,t,n,"month");var i,o=[];for(i=0;12>i;i++)o[i]=qn(e,i,n,"month");return o} // () // (5) // (fmt, 5) // (fmt) // (true) // (true, 5) // (true, fmt, 5) // (true, fmt) function Vn(e,t,n,i){"boolean"==typeof e?("number"==typeof t&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,"number"==typeof t&&(n=t,t=void 0),t=t||"");var o=et(),a=e?o._week.dow:0;if(null!=n)return qn(t,(n+a)%7,i,"day");var r,s=[];for(r=0;7>r;r++)s[r]=qn(t,(r+a)%7,i,"day");return s}function Nn(e,t){return zn(e,t,"months")}function Hn(e,t){return zn(e,t,"monthsShort")}function Un(e,t,n){return Vn(e,t,n,"weekdays")}function Wn(e,t,n){return Vn(e,t,n,"weekdaysShort")}function Bn(e,t,n){return Vn(e,t,n,"weekdaysMin")}function Gn(){var e=this._data;return this._milliseconds=Zo(this._milliseconds),this._days=Zo(this._days),this._months=Zo(this._months),e.milliseconds=Zo(e.milliseconds),e.seconds=Zo(e.seconds),e.minutes=Zo(e.minutes),e.hours=Zo(e.hours),e.months=Zo(e.months),e.years=Zo(e.years),this}function Zn(e,t,n,i){var o=It(t,n);return e._milliseconds+=i*o._milliseconds,e._days+=i*o._days,e._months+=i*o._months,e._bubble()} // supports only 2.0-style add(1, 's') or add(duration) function Qn(e,t){return Zn(this,e,t,1)} // supports only 2.0-style subtract(1, 's') or subtract(duration) function $n(e,t){return Zn(this,e,t,-1)}function Xn(e){return 0>e?Math.floor(e):Math.ceil(e)}function Jn(){var e,t,n,i,o,a=this._milliseconds,r=this._days,s=this._months,l=this._data; // if we have a mix of positive and negative values, bubble down first // check: https://github.com/moment/moment/issues/2166 // The following code bubbles up values, see the tests for // examples of what that means. // convert days to months // 12 months -> 1 year return a>=0&&r>=0&&s>=0||0>=a&&0>=r&&0>=s||(a+=864e5*Xn(ei(s)+r),r=0,s=0),l.milliseconds=a%1e3,e=b(a/1e3),l.seconds=e%60,t=b(e/60),l.minutes=t%60,n=b(t/60),l.hours=n%24,r+=b(n/24),o=b(Kn(r)),s+=o,r-=Xn(ei(o)),i=b(s/12),s%=12,l.days=r,l.months=s,l.years=i,this}function Kn(e){ // 400 years have 146097 days (taking into account leap year rules) // 400 years have 12 months === 4800 return 4800*e/146097}function ei(e){ // the reverse of daysToMonths return 146097*e/4800}function ti(e){var t,n,i=this._milliseconds;if(e=Y(e),"month"===e||"year"===e)return t=this._days+i/864e5,n=this._months+Kn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(ei(this._months)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3; // Math.floor prevents floating point math errors here case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+e)}} // TODO: Use this.as('ms')? function ni(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*y(this._months/12)}function ii(e){return function(){return this.as(e)}}function oi(e){return e=Y(e),this[e+"s"]()}function ai(e){return function(){return this._data[e]}}function ri(){return b(this.days()/7)} // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize function si(e,t,n,i,o){return o.relativeTime(t||1,!!n,e,i)}function li(e,t,n){var i=It(e).abs(),o=ua(i.as("s")),a=ua(i.as("m")),r=ua(i.as("h")),s=ua(i.as("d")),l=ua(i.as("M")),c=ua(i.as("y")),u=o=a&&["m"]||a=r&&["h"]||r=s&&["d"]||s=l&&["M"]||l=c&&["y"]||["yy",c];return u[2]=t,u[3]=+e>0,u[4]=n,si.apply(null,u)} // This function allows you to set the rounding function for relative time strings function ci(e){return void 0===e?ua:"function"==typeof e?(ua=e,!0):!1} // This function allows you to set a threshold for relative time strings function ui(e,t){return void 0===da[e]?!1:void 0===t?da[e]:(da[e]=t,!0)}function di(e){var t=this.localeData(),n=li(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function fi(){ // for ISO strings we do not use the normal bubbling rules: // * milliseconds bubble up until they become hours // * days do not bubble at all // * months bubble up until they become years // This is because there is no context-free conversion between hours and days // (think of clock changes) // and also not between days and months (28-31 days per month) var e,t,n,i=fa(this._milliseconds)/1e3,o=fa(this._days),a=fa(this._months);e=b(i/60),t=b(e/60),i%=60,e%=60,n=b(a/12),a%=12; // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js var r=n,s=a,l=o,c=t,u=e,d=i,f=this.asSeconds();return f?(0>f?"-":"")+"P"+(r?r+"Y":"")+(s?s+"M":"")+(l?l+"D":"")+(c||u||d?"T":"")+(c?c+"H":"")+(u?u+"M":"")+(d?d+"S":""):"P0D"}var hi,mi;mi=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,i=0;n>i;i++)if(i in t&&e.call(this,t[i],i,t))return!0;return!1}; // Plugins that add properties should also add the key here (null value), // so we can properly clone ourselves. var gi=e.momentProperties=[],pi=!1,vi={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var bi;bi=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)s(e,t)&&n.push(t);return n};var yi,xi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},wi={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"},Ci="Invalid date",ki="%d",Si=/\d{1,2}/,Di={future:"in %s",past:"%s ago",s:"a few 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"},Ti={},Pi={},_i=/(\[[^\[]*\])|(\\)?([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,Ai=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Mi={},Ri={},Oi=/\d/,Ei=/\d\d/,Fi=/\d{3}/,Yi=/\d{4}/,Li=/[+-]?\d{6}/,ji=/\d\d?/,Ii=/\d\d\d\d?/,qi=/\d\d\d\d\d\d?/,zi=/\d{1,3}/,Vi=/\d{1,4}/,Ni=/[+-]?\d{1,6}/,Hi=/\d+/,Ui=/[+-]?\d+/,Wi=/Z|[+-]\d\d:?\d\d/gi,Bi=/Z|[+-]\d\d(?::?\d\d)?/gi,Gi=/[+-]?\d+(\.\d{1,3})?/,Zi=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Qi={},$i={},Xi=0,Ji=1,Ki=2,eo=3,to=4,no=5,io=6,oo=7,ao=8;yi=Array.prototype.indexOf?Array.prototype.indexOf:function(e){ // I know var t;for(t=0;t=e?""+e:"+"+e}),W(0,["YY",2],0,function(){return this.year()%100}),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"), // ALIASES F("year","y"), // PRIORITIES j("year",1), // PARSING $("Y",Ui),$("YY",ji,Ei),$("YYYY",Vi,Yi),$("YYYYY",Ni,Li),$("YYYYYY",Ni,Li),ee(["YYYYY","YYYYYY"],Xi),ee("YYYY",function(t,n){n[Xi]=2===t.length?e.parseTwoDigitYear(t):y(t)}),ee("YY",function(t,n){n[Xi]=e.parseTwoDigitYear(t)}),ee("Y",function(e,t){t[Xi]=parseInt(e,10)}), // HOOKS e.parseTwoDigitYear=function(e){return y(e)+(y(e)>68?1900:2e3)}; // MOMENTS var fo=q("FullYear",!0); // FORMATTING W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"), // ALIASES F("week","w"),F("isoWeek","W"), // PRIORITIES j("week",5),j("isoWeek",5), // PARSING $("w",ji),$("ww",ji,Ei),$("W",ji),$("WW",ji,Ei),te(["w","ww","W","WW"],function(e,t,n,i){t[i.substr(0,1)]=y(e)});var ho={dow:0,// Sunday is the first day of the week. doy:6}; // FORMATTING W("d",0,"do","day"),W("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),W("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),W("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"), // ALIASES F("day","d"),F("weekday","e"),F("isoWeekday","E"), // PRIORITY j("day",11),j("weekday",11),j("isoWeekday",11), // PARSING $("d",ji),$("e",ji),$("E",ji),$("dd",function(e,t){return t.weekdaysMinRegex(e)}),$("ddd",function(e,t){return t.weekdaysShortRegex(e)}),$("dddd",function(e,t){return t.weekdaysRegex(e)}),te(["dd","ddd","dddd"],function(e,t,n,i){var o=n._locale.weekdaysParse(e,i,n._strict); // if we didn't get a weekday name, mark the date as invalid null!=o?t.d=o:d(n).invalidWeekday=e}),te(["d","e","E"],function(e,t,n,i){t[i]=y(e)}); // LOCALES var mo="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),go="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),po="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),vo=Zi,bo=Zi,yo=Zi;W("H",["HH",2],0,"hour"),W("h",["hh",2],0,Ne),W("k",["kk",2],0,He),W("hmm",0,0,function(){return""+Ne.apply(this)+U(this.minutes(),2)}),W("hmmss",0,0,function(){return""+Ne.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+U(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),Ue("a",!0),Ue("A",!1), // ALIASES F("hour","h"), // PRIORITY j("hour",13),$("a",We),$("A",We),$("H",ji),$("h",ji),$("HH",ji,Ei),$("hh",ji,Ei),$("hmm",Ii),$("hmmss",qi),$("Hmm",Ii),$("Hmmss",qi),ee(["H","HH"],eo),ee(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ee(["h","hh"],function(e,t,n){t[eo]=y(e),d(n).bigHour=!0}),ee("hmm",function(e,t,n){var i=e.length-2;t[eo]=y(e.substr(0,i)),t[to]=y(e.substr(i)),d(n).bigHour=!0}),ee("hmmss",function(e,t,n){var i=e.length-4,o=e.length-2;t[eo]=y(e.substr(0,i)),t[to]=y(e.substr(i,2)),t[no]=y(e.substr(o)),d(n).bigHour=!0}),ee("Hmm",function(e,t,n){var i=e.length-2;t[eo]=y(e.substr(0,i)),t[to]=y(e.substr(i))}),ee("Hmmss",function(e,t,n){var i=e.length-4,o=e.length-2;t[eo]=y(e.substr(0,i)),t[to]=y(e.substr(i,2)),t[no]=y(e.substr(o))});var xo,wo=/[ap]\.?m?\.?/i,Co=q("Hours",!0),ko={calendar:xi,longDateFormat:wi,invalidDate:Ci,ordinal:ki,ordinalParse:Si,relativeTime:Di,months:so,monthsShort:lo,week:ho,weekdays:mo,weekdaysMin:po,weekdaysShort:go,meridiemParse:wo},So={},Do=/^\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)?)?/,To=/^\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)?)?/,Po=/Z|[+-]\d\d(?::?\d\d)?/,_o=[["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}/], // YYYYMM is NOT allowed by the standard ["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Ao=[["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/]],Mo=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=C("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}), // constant that refers to the ISO standard e.ISO_8601=function(){};var Ro=C("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=vt.apply(null,arguments);return this.isValid()&&e.isValid()?this>e?this:e:h()}),Oo=C("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=vt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:h()}),Eo=function(){return Date.now?Date.now():+new Date};kt("Z",":"),kt("ZZ",""), // PARSING $("Z",Bi),$("ZZ",Bi),ee(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=St(Bi,e)}); // HELPERS // timezone chunker // '+10:00' > ['10', '00'] // '-1530' > ['-15', '30'] var Fo=/([\+\-]|\d\d)/gi; // HOOKS // This function will be called whenever a moment is mutated. // It is intended to keep the offset in sync with the timezone. e.updateOffset=function(){}; // ASP.NET json date format regex var Yo=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,Lo=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;It.fn=wt.prototype;var jo=Ht(1,"add"),Io=Ht(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var qo=C("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)}); // FORMATTING W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Sn("gggg","weekYear"),Sn("ggggg","weekYear"),Sn("GGGG","isoWeekYear"),Sn("GGGGG","isoWeekYear"), // ALIASES F("weekYear","gg"),F("isoWeekYear","GG"), // PRIORITY j("weekYear",1),j("isoWeekYear",1), // PARSING $("G",Ui),$("g",Ui),$("GG",ji,Ei),$("gg",ji,Ei),$("GGGG",Vi,Yi),$("gggg",Vi,Yi),$("GGGGG",Ni,Li),$("ggggg",Ni,Li),te(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,i){t[i.substr(0,2)]=y(e)}),te(["gg","GG"],function(t,n,i,o){n[o]=e.parseTwoDigitYear(t)}), // FORMATTING W("Q",0,"Qo","quarter"), // ALIASES F("quarter","Q"), // PRIORITY j("quarter",7), // PARSING $("Q",Oi),ee("Q",function(e,t){t[Ji]=3*(y(e)-1)}), // FORMATTING W("D",["DD",2],"Do","date"), // ALIASES F("date","D"), // PRIOROITY j("date",9), // PARSING $("D",ji),$("DD",ji,Ei),$("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),ee(["D","DD"],Ki),ee("Do",function(e,t){t[Ki]=y(e.match(ji)[0],10)}); // MOMENTS var zo=q("Date",!0); // FORMATTING W("DDD",["DDDD",3],"DDDo","dayOfYear"), // ALIASES F("dayOfYear","DDD"), // PRIORITY j("dayOfYear",4), // PARSING $("DDD",zi),$("DDDD",Fi),ee(["DDD","DDDD"],function(e,t,n){n._dayOfYear=y(e)}), // FORMATTING W("m",["mm",2],0,"minute"), // ALIASES F("minute","m"), // PRIORITY j("minute",14), // PARSING $("m",ji),$("mm",ji,Ei),ee(["m","mm"],to); // MOMENTS var Vo=q("Minutes",!1); // FORMATTING W("s",["ss",2],0,"second"), // ALIASES F("second","s"), // PRIORITY j("second",15), // PARSING $("s",ji),$("ss",ji,Ei),ee(["s","ss"],no); // MOMENTS var No=q("Seconds",!1); // FORMATTING W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return 10*this.millisecond()}),W(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),W(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),W(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),W(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),W(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}), // ALIASES F("millisecond","ms"), // PRIORITY j("millisecond",16), // PARSING $("S",zi,Oi),$("SS",zi,Ei),$("SSS",zi,Fi);var Ho;for(Ho="SSSS";Ho.length<=9;Ho+="S")$(Ho,Hi);for(Ho="S";Ho.length<=9;Ho+="S")ee(Ho,En); // MOMENTS var Uo=q("Milliseconds",!1); // FORMATTING W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var Wo=p.prototype;Wo.add=jo,Wo.calendar=Bt,Wo.clone=Gt,Wo.diff=en,Wo.endOf=hn,Wo.format=an,Wo.from=rn,Wo.fromNow=sn,Wo.to=ln,Wo.toNow=cn,Wo.get=N,Wo.invalidAt=Cn,Wo.isAfter=Zt,Wo.isBefore=Qt,Wo.isBetween=$t,Wo.isSame=Xt,Wo.isSameOrAfter=Jt,Wo.isSameOrBefore=Kt,Wo.isValid=xn,Wo.lang=qo,Wo.locale=un,Wo.localeData=dn,Wo.max=Oo,Wo.min=Ro,Wo.parsingFlags=wn,Wo.set=H,Wo.startOf=fn,Wo.subtract=Io,Wo.toArray=vn,Wo.toObject=bn,Wo.toDate=pn,Wo.toISOString=on,Wo.toJSON=yn,Wo.toString=nn,Wo.unix=gn,Wo.valueOf=mn,Wo.creationData=kn, // Year Wo.year=fo,Wo.isLeapYear=pe, // Week Year Wo.weekYear=Dn,Wo.isoWeekYear=Tn, // Quarter Wo.quarter=Wo.quarters=Rn, // Month Wo.month=ce,Wo.daysInMonth=ue, // Week Wo.week=Wo.weeks=Te,Wo.isoWeek=Wo.isoWeeks=Pe,Wo.weeksInYear=_n,Wo.isoWeeksInYear=Pn, // Day Wo.date=zo,Wo.day=Wo.days=Ye,Wo.weekday=Le,Wo.isoWeekday=je,Wo.dayOfYear=On, // Hour Wo.hour=Wo.hours=Co, // Minute Wo.minute=Wo.minutes=Vo, // Second Wo.second=Wo.seconds=No, // Millisecond Wo.millisecond=Wo.milliseconds=Uo, // Offset Wo.utcOffset=Pt,Wo.utc=At,Wo.local=Mt,Wo.parseZone=Rt,Wo.hasAlignedHourOffset=Ot,Wo.isDST=Et,Wo.isLocal=Yt,Wo.isUtcOffset=Lt,Wo.isUtc=jt,Wo.isUTC=jt, // Timezone Wo.zoneAbbr=Fn,Wo.zoneName=Yn, // Deprecations Wo.dates=C("dates accessor is deprecated. Use date instead.",zo),Wo.months=C("months accessor is deprecated. Use month instead",ce),Wo.years=C("years accessor is deprecated. Use year instead",fo),Wo.zone=C("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",_t),Wo.isDSTShifted=C("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ft);var Bo=Wo,Go=P.prototype;Go.calendar=_,Go.longDateFormat=A,Go.invalidDate=M,Go.ordinal=R,Go.preparse=In,Go.postformat=In,Go.relativeTime=O,Go.pastFuture=E,Go.set=D, // Month Go.months=oe,Go.monthsShort=ae,Go.monthsParse=se,Go.monthsRegex=fe,Go.monthsShortRegex=de, // Week Go.week=ke,Go.firstDayOfYear=De,Go.firstDayOfWeek=Se, // Day of Week Go.weekdays=Me,Go.weekdaysMin=Oe,Go.weekdaysShort=Re,Go.weekdaysParse=Fe,Go.weekdaysRegex=Ie,Go.weekdaysShortRegex=qe,Go.weekdaysMinRegex=ze, // Hours Go.isPM=Be,Go.meridiem=Ge,Xe("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===y(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}), // Side effect imports e.lang=C("moment.lang is deprecated. Use moment.locale instead.",Xe),e.langData=C("moment.langData is deprecated. Use moment.localeData instead.",et);var Zo=Math.abs,Qo=ii("ms"),$o=ii("s"),Xo=ii("m"),Jo=ii("h"),Ko=ii("d"),ea=ii("w"),ta=ii("M"),na=ii("y"),ia=ai("milliseconds"),oa=ai("seconds"),aa=ai("minutes"),ra=ai("hours"),sa=ai("days"),la=ai("months"),ca=ai("years"),ua=Math.round,da={s:45,// seconds to minute m:45,// minutes to hour h:22,// hours to day d:26,// days to month M:11},fa=Math.abs,ha=wt.prototype;ha.abs=Gn,ha.add=Qn,ha.subtract=$n,ha.as=ti,ha.asMilliseconds=Qo,ha.asSeconds=$o,ha.asMinutes=Xo,ha.asHours=Jo,ha.asDays=Ko,ha.asWeeks=ea,ha.asMonths=ta,ha.asYears=na,ha.valueOf=ni,ha._bubble=Jn,ha.get=oi,ha.milliseconds=ia,ha.seconds=oa,ha.minutes=aa,ha.hours=ra,ha.days=sa,ha.weeks=ri,ha.months=la,ha.years=ca,ha.humanize=di,ha.toISOString=fi,ha.toString=fi,ha.toJSON=fi,ha.locale=un,ha.localeData=dn, // Deprecations ha.toIsoString=C("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",fi),ha.lang=qo, // Side effect imports // FORMATTING W("X",0,0,"unix"),W("x",0,0,"valueOf"), // PARSING $("x",Ui),$("X",Gi),ee("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ee("x",function(e,t,n){n._d=new Date(y(e))}), // Side effect imports e.version="2.14.1",t(vt),e.fn=Bo,e.min=yt,e.max=xt,e.now=Eo,e.utc=c,e.unix=Ln,e.months=Nn,e.isDate=a,e.locale=Xe,e.invalid=h,e.duration=It,e.isMoment=v,e.weekdays=Un,e.parseZone=jn,e.localeData=et,e.isDuration=Ct,e.monthsShort=Hn,e.weekdaysMin=Bn,e.defineLocale=Je,e.updateLocale=Ke,e.locales=tt,e.weekdaysShort=Wn,e.normalizeUnits=Y,e.relativeTimeRounding=ci,e.relativeTimeThreshold=ui,e.calendarFormat=Wt,e.prototype=Bo;var ma=e;return ma}),/** * @version: 1.3.21 * @author: Dan Grossman http://www.dangrossman.info/ * @copyright: Copyright (c) 2012-2015 Dan Grossman. All rights reserved. * @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php * @website: https://www.improvely.com/ */ function(e,t){if("function"==typeof define&&define.amd)define(["moment","jquery","exports"],function(n,i,o){e.daterangepicker=t(e,o,n,i)});else if("undefined"!=typeof exports){var n,i=require("moment");try{n=require("jquery")}catch(o){if(n=window.jQuery,!n)throw new Error("jQuery dependency not found")}t(e,exports,i,n)}else e.daterangepicker=t(e,{},e.moment,e.jQuery||e.Zepto||e.ender||e.$)}(this,function(e,t,n,i){var o=function(e,t,n){ // by default, the daterangepicker element is placed at the bottom of HTML body this.parentEl="body", //element that triggered the date range picker this.element=i(e), //tracks visible state this.isShowing=!1; //create the picker HTML object var o=''; //custom options "object"==typeof t&&null!==t||(t={}),this.parentEl=i("object"==typeof t&&t.parentEl&&i(t.parentEl).length?t.parentEl:this.parentEl),this.container=i(o).appendTo(this.parentEl),this.setOptions(t,n), //event listeners this.container.find(".calendar").on("click.daterangepicker",".prev",i.proxy(this.clickPrev,this)).on("click.daterangepicker",".next",i.proxy(this.clickNext,this)).on("click.daterangepicker","td.available",i.proxy(this.clickDate,this)).on("mouseenter.daterangepicker","td.available",i.proxy(this.hoverDate,this)).on("mouseleave.daterangepicker","td.available",i.proxy(this.updateFormInputs,this)).on("change.daterangepicker","select.yearselect",i.proxy(this.updateMonthYear,this)).on("change.daterangepicker","select.monthselect",i.proxy(this.updateMonthYear,this)).on("change.daterangepicker","select.hourselect,select.minuteselect,select.secondselect,select.ampmselect",i.proxy(this.updateTime,this)),this.container.find(".ranges").on("click.daterangepicker","button.applyBtn",i.proxy(this.clickApply,this)).on("click.daterangepicker","button.cancelBtn",i.proxy(this.clickCancel,this)).on("click.daterangepicker",".daterangepicker_start_input,.daterangepicker_end_input",i.proxy(this.showCalendars,this)).on("change.daterangepicker",".daterangepicker_start_input,.daterangepicker_end_input",i.proxy(this.inputsChanged,this)).on("keydown.daterangepicker",".daterangepicker_start_input,.daterangepicker_end_input",i.proxy(this.inputsKeydown,this)).on("click.daterangepicker","li",i.proxy(this.clickRange,this)).on("mouseenter.daterangepicker","li",i.proxy(this.enterRange,this)).on("mouseleave.daterangepicker","li",i.proxy(this.updateFormInputs,this)),this.element.is("input")?this.element.on({"click.daterangepicker":i.proxy(this.show,this),"focus.daterangepicker":i.proxy(this.show,this),"keyup.daterangepicker":i.proxy(this.updateFromControl,this),"keydown.daterangepicker":i.proxy(this.keydown,this)}):this.element.on("click.daterangepicker",i.proxy(this.toggle,this))};o.prototype={constructor:o,setOptions:function(e,t){ // update day names order to firstDay if(this.startDate=n().startOf("day"),this.endDate=n().endOf("day"),this.timeZone=n().utcOffset(),this.minDate=!1,this.maxDate=!1,this.dateLimit=!1,this.showDropdowns=!1,this.showWeekNumbers=!1,this.timePicker=!1,this.timePickerSeconds=!1,this.timePickerIncrement=30,this.timePicker12Hour=!0,this.singleDatePicker=!1,this.ranges={},this.opens="right",this.element.hasClass("pull-right")&&(this.opens="left"),this.drops="down",this.element.hasClass("dropup")&&(this.drops="up"),this.buttonClasses=["ui","compact","small","button"],this.applyClass="primary",this.cancelClass="secondary",this.format="MM/DD/YYYY",this.separator=" - ",this.locale={applyLabel:"Apply",cancelLabel:"Cancel",fromLabel:"From",toLabel:"To",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:n.weekdaysMin(),monthNames:n.monthsShort(),firstDay:n.localeData()._week.dow},this.cb=function(){},"string"==typeof e.format&&(this.format=e.format),"string"==typeof e.separator&&(this.separator=e.separator),"string"==typeof e.startDate&&(this.startDate=n(e.startDate,this.format)),"string"==typeof e.endDate&&(this.endDate=n(e.endDate,this.format)),"string"==typeof e.minDate&&(this.minDate=n(e.minDate,this.format)),"string"==typeof e.maxDate&&(this.maxDate=n(e.maxDate,this.format)),"object"==typeof e.startDate&&(this.startDate=n(e.startDate)),"object"==typeof e.endDate&&(this.endDate=n(e.endDate)),"object"==typeof e.minDate&&(this.minDate=n(e.minDate)),"object"==typeof e.maxDate&&(this.maxDate=n(e.maxDate)),"string"==typeof e.applyClass&&(this.applyClass=e.applyClass),"string"==typeof e.cancelClass&&(this.cancelClass=e.cancelClass),"object"==typeof e.dateLimit&&(this.dateLimit=e.dateLimit),"object"==typeof e.locale&&("object"==typeof e.locale.daysOfWeek&&( // Create a copy of daysOfWeek to avoid modification of original // options object for reusability in multiple daterangepicker instances this.locale.daysOfWeek=e.locale.daysOfWeek.slice()),"object"==typeof e.locale.monthNames&&(this.locale.monthNames=e.locale.monthNames.slice()),"number"==typeof e.locale.firstDay&&(this.locale.firstDay=e.locale.firstDay),"string"==typeof e.locale.applyLabel&&(this.locale.applyLabel=e.locale.applyLabel),"string"==typeof e.locale.cancelLabel&&(this.locale.cancelLabel=e.locale.cancelLabel),"string"==typeof e.locale.fromLabel&&(this.locale.fromLabel=e.locale.fromLabel),"string"==typeof e.locale.toLabel&&(this.locale.toLabel=e.locale.toLabel),"string"==typeof e.locale.weekLabel&&(this.locale.weekLabel=e.locale.weekLabel),"string"==typeof e.locale.customRangeLabel&&(this.locale.customRangeLabel=e.locale.customRangeLabel)),"string"==typeof e.opens&&(this.opens=e.opens),"string"==typeof e.drops&&(this.drops=e.drops),"boolean"==typeof e.showWeekNumbers&&(this.showWeekNumbers=e.showWeekNumbers),"string"==typeof e.buttonClasses&&(this.buttonClasses=[e.buttonClasses]),"object"==typeof e.buttonClasses&&(this.buttonClasses=e.buttonClasses),"boolean"==typeof e.showDropdowns&&(this.showDropdowns=e.showDropdowns),"boolean"==typeof e.singleDatePicker&&(this.singleDatePicker=e.singleDatePicker,this.singleDatePicker&&(this.endDate=this.startDate.clone())),"boolean"==typeof e.timePicker&&(this.timePicker=e.timePicker),"boolean"==typeof e.timePickerSeconds&&(this.timePickerSeconds=e.timePickerSeconds),"number"==typeof e.timePickerIncrement&&(this.timePickerIncrement=e.timePickerIncrement),"boolean"==typeof e.timePicker12Hour&&(this.timePicker12Hour=e.timePicker12Hour),0!==this.locale.firstDay)for(var o=this.locale.firstDay;o>0;)this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()),o--;var a,r,s; //if no start/end dates set, check if an input element contains initial values if("undefined"==typeof e.startDate&&"undefined"==typeof e.endDate&&i(this.element).is("input[type=text]")){var l=i(this.element).val(),c=l.split(this.separator);a=r=null,2==c.length?(a=n(c[0],this.format),r=n(c[1],this.format)):this.singleDatePicker&&""!==l&&(a=n(l,this.format),r=n(l,this.format)),null!==a&&null!==r&&(this.startDate=a,this.endDate=r)}if( // bind the time zone used to build the calendar to either the // timeZone passed in through the options or the zone of the // startDate (which will be the local time zone by default) "string"==typeof e.timeZone||"number"==typeof e.timeZone?("string"==typeof e.timeZone&&"undefined"!=typeof n.tz?this.timeZone=-1*n.tz.zone(e.timeZone).parse(new Date):this.timeZone=e.timeZone,this.startDate.utcOffset(this.timeZone),this.endDate.utcOffset(this.timeZone)):this.timeZone=n(this.startDate).utcOffset(),"object"==typeof e.ranges){for(s in e.ranges)a="string"==typeof e.ranges[s][0]?n(e.ranges[s][0],this.format):n(e.ranges[s][0]),r="string"==typeof e.ranges[s][1]?n(e.ranges[s][1],this.format):n(e.ranges[s][1]),this.minDate&&a.isBefore(this.minDate)&&(a=n(this.minDate)),this.maxDate&&r.isAfter(this.maxDate)&&(r=n(this.maxDate)),this.minDate&&r.isBefore(this.minDate)||this.maxDate&&a.isAfter(this.maxDate)||(this.ranges[s]=[a,r]);var u="
    ";for(s in this.ranges)u+="
  • "+s+"
  • ";u+="
  • "+this.locale.customRangeLabel+"
  • ",u+="
",this.container.find(".ranges ul").remove(),this.container.find(".ranges").prepend(u)}if("function"==typeof t&&(this.cb=t),this.timePicker||(this.startDate=this.startDate.startOf("day"),this.endDate=this.endDate.endOf("day")),this.singleDatePicker?(this.opens="right",this.container.addClass("single"),this.container.find(".calendar.right").show(),this.container.find(".calendar.left").hide(),this.timePicker?this.container.find(".ranges .daterangepicker_start_input, .ranges .daterangepicker_end_input").hide():this.container.find(".ranges").hide(),this.container.find(".calendar.right").hasClass("single")||this.container.find(".calendar.right").addClass("single")):(this.container.removeClass("single"),this.container.find(".calendar.right").removeClass("single"),this.container.find(".ranges").show()),this.oldStartDate=this.startDate.clone(),this.oldEndDate=this.endDate.clone(),this.oldChosenLabel=this.chosenLabel,this.leftCalendar={month:n([this.startDate.year(),this.startDate.month(),1,this.startDate.hour(),this.startDate.minute(),this.startDate.second()]),calendar:[]},this.rightCalendar={month:n([this.endDate.year(),this.endDate.month(),1,this.endDate.hour(),this.endDate.minute(),this.endDate.second()]),calendar:[]},"right"==this.opens||"center"==this.opens){ //swap calendar positions var d=this.container.find(".calendar.first"),f=this.container.find(".calendar.second");f.hasClass("single")&&(f.removeClass("single"),d.addClass("single")),d.removeClass("left").addClass("right"),f.removeClass("right").addClass("left"),this.singleDatePicker&&(d.show(),f.hide())}"undefined"!=typeof e.ranges||this.singleDatePicker||this.container.addClass("show-calendar"),this.container.removeClass("opensleft opensright").addClass("opens"+this.opens),this.updateView(),this.updateCalendars(); //apply CSS classes and labels to buttons var h=this.container;i.each(this.buttonClasses,function(e,t){h.find("button").addClass(t)}),this.container.find(".daterangepicker_start_input label").html(this.locale.fromLabel),this.container.find(".daterangepicker_end_input label").html(this.locale.toLabel),this.applyClass.length&&this.container.find(".applyBtn").addClass(this.applyClass),this.cancelClass.length&&this.container.find(".cancelBtn").addClass(this.cancelClass),this.container.find(".applyBtn").html(this.locale.applyLabel),this.container.find(".cancelBtn").html(this.locale.cancelLabel)},setStartDate:function(e){"string"==typeof e&&(this.startDate=n(e,this.format).utcOffset(this.timeZone)),"object"==typeof e&&(this.startDate=n(e)),this.timePicker||(this.startDate=this.startDate.startOf("day")),this.oldStartDate=this.startDate.clone(),this.updateView(),this.updateCalendars(),this.updateInputText()},setEndDate:function(e){"string"==typeof e&&(this.endDate=n(e,this.format).utcOffset(this.timeZone)),"object"==typeof e&&(this.endDate=n(e)),this.timePicker||(this.endDate=this.endDate.endOf("day")),this.oldEndDate=this.endDate.clone(),this.updateView(),this.updateCalendars(),this.updateInputText()},updateView:function(){this.leftCalendar.month.month(this.startDate.month()).year(this.startDate.year()).hour(this.startDate.hour()).minute(this.startDate.minute()),this.rightCalendar.month.month(this.endDate.month()).year(this.endDate.year()).hour(this.endDate.hour()).minute(this.endDate.minute()),this.updateFormInputs()},updateFormInputs:function(){this.container.find("input[name=daterangepicker_start]").val(this.startDate.format(this.format)),this.container.find("input[name=daterangepicker_end]").val(this.endDate.format(this.format)),this.startDate.isSame(this.endDate)||this.startDate.isBefore(this.endDate)?this.container.find("button.applyBtn").removeAttr("disabled"):this.container.find("button.applyBtn").attr("disabled","disabled")},updateFromControl:function(){if(this.element.is("input")&&this.element.val().length){var e=this.element.val().split(this.separator),t=null,i=null;2===e.length&&(t=n(e[0],this.format).utcOffset(this.timeZone),i=n(e[1],this.format).utcOffset(this.timeZone)),(this.singleDatePicker||null===t||null===i)&&(t=n(this.element.val(),this.format).utcOffset(this.timeZone),i=t),i.isBefore(t)||(this.oldStartDate=this.startDate.clone(),this.oldEndDate=this.endDate.clone(),this.startDate=t,this.endDate=i,this.startDate.isSame(this.oldStartDate)&&this.endDate.isSame(this.oldEndDate)||this.notify(),this.updateCalendars())}},keydown:function(e){ //hide on tab or enter 9!==e.keyCode&&13!==e.keyCode||this.hide()},notify:function(){this.updateView(),this.cb(this.startDate,this.endDate,this.chosenLabel)},move:function(){var e,t={top:0,left:0},n=i(window).width();this.parentEl.is("body")||(t={top:this.parentEl.offset().top-this.parentEl.scrollTop(),left:this.parentEl.offset().left-this.parentEl.scrollLeft()},n=this.parentEl[0].clientWidth+this.parentEl.offset().left),e="up"==this.drops?this.element.offset().top-this.container.outerHeight()-t.top:this.element.offset().top+this.element.outerHeight()-t.top,this.container["up"==this.drops?"addClass":"removeClass"]("dropup"),"left"==this.opens?(this.container.css({top:e,right:n-this.element.offset().left-this.element.outerWidth(),left:"auto"}),this.container.offset().left<0&&this.container.css({right:"auto",left:9})):"center"==this.opens?(this.container.css({top:e,left:this.element.offset().left-t.left+this.element.outerWidth()/2-this.container.outerWidth()/2,right:"auto"}),this.container.offset().left<0&&this.container.css({right:"auto",left:9})):(this.container.css({top:e,left:this.element.offset().left-t.left,right:"auto"}),this.container.offset().left+this.container.outerWidth()>i(window).width()&&this.container.css({left:"auto",right:0}))},toggle:function(e){this.element.hasClass("active")?this.hide():this.show()},show:function(e){this.isShowing||(this.element.addClass("active"),this.container.show(),this.move(), // Create a click proxy that is private to this instance of datepicker, for unbinding this._outsideClickProxy=i.proxy(function(e){this.outsideClick(e)},this), // Bind global datepicker mousedown for hiding and i(document).on("mousedown.daterangepicker",this._outsideClickProxy).on("touchend.daterangepicker",this._outsideClickProxy).on("click.daterangepicker","[data-toggle=dropdown]",this._outsideClickProxy).on("focusin.daterangepicker",this._outsideClickProxy),this.isShowing=!0,this.element.trigger("show.daterangepicker",this))},outsideClick:function(e){var t=i(e.target); // if the page is clicked anywhere except within the daterangerpicker/button // itself then call this.hide() "focusin"==e.type||t.closest(this.element).length||t.closest(this.container).length||t.closest(".calendar-date").length||this.hide()},hide:function(e){this.isShowing&&(i(document).off(".daterangepicker"),this.element.removeClass("active"),this.container.hide(),this.startDate.isSame(this.oldStartDate)&&this.endDate.isSame(this.oldEndDate)||this.notify(),this.oldStartDate=this.startDate.clone(),this.oldEndDate=this.endDate.clone(),this.isShowing=!1,this.element.trigger("hide.daterangepicker",this))},enterRange:function(e){ // mouse pointer has entered a range label var t=e.target.innerHTML;if(t==this.locale.customRangeLabel)this.updateView();else{var n=this.ranges[t];this.container.find("input[name=daterangepicker_start]").val(n[0].format(this.format)),this.container.find("input[name=daterangepicker_end]").val(n[1].format(this.format))}},showCalendars:function(){this.container.addClass("show-calendar"),this.move(),this.element.trigger("showCalendar.daterangepicker",this)},hideCalendars:function(){this.container.removeClass("show-calendar"),this.element.trigger("hideCalendar.daterangepicker",this)}, // when a date is typed into the start to end date textboxes inputsChanged:function(e){var t=i(e.target),o=n(t.val(),this.format);if(o.isValid()){var a,r;"daterangepicker_start"===t.attr("name")?(a=!1!==this.minDate&&o.isBefore(this.minDate)?this.minDate:o,r=this.endDate):(a=this.startDate,r=!1!==this.maxDate&&o.isAfter(this.maxDate)?this.maxDate:o),this.setCustomDates(a,r)}},inputsKeydown:function(e){13===e.keyCode&&(this.inputsChanged(e),this.notify())},updateInputText:function(){this.element.is("input")&&!this.singleDatePicker?(this.element.val(this.startDate.format(this.format)+this.separator+this.endDate.format(this.format)),this.element.trigger("change")):this.element.is("input")&&(this.element.val(this.endDate.format(this.format)),this.element.trigger("change"))},clickRange:function(e){var t=e.target.innerHTML;if(this.chosenLabel=t,t==this.locale.customRangeLabel)this.showCalendars();else{var n=this.ranges[t];this.startDate=n[0],this.endDate=n[1],this.timePicker||(this.startDate.startOf("day"),this.endDate.endOf("day")),this.leftCalendar.month.month(this.startDate.month()).year(this.startDate.year()).hour(this.startDate.hour()).minute(this.startDate.minute()),this.rightCalendar.month.month(this.endDate.month()).year(this.endDate.year()).hour(this.endDate.hour()).minute(this.endDate.minute()),this.updateCalendars(),this.updateInputText(),this.hideCalendars(),this.hide(),this.element.trigger("apply.daterangepicker",this)}},clickPrev:function(e){var t=i(e.target).parents(".calendar");t.hasClass("left")?this.leftCalendar.month.subtract(1,"month"):this.rightCalendar.month.subtract(1,"month"),this.updateCalendars()},clickNext:function(e){var t=i(e.target).parents(".calendar");t.hasClass("left")?this.leftCalendar.month.add(1,"month"):this.rightCalendar.month.add(1,"month"),this.updateCalendars()},hoverDate:function(e){var t=i(e.target).attr("data-title"),n=t.substr(1,1),o=t.substr(3,1),a=i(e.target).parents(".calendar");a.hasClass("left")?this.container.find("input[name=daterangepicker_start]").val(this.leftCalendar.calendar[n][o].format(this.format)):this.container.find("input[name=daterangepicker_end]").val(this.rightCalendar.calendar[n][o].format(this.format))},setCustomDates:function(e,t){if(this.chosenLabel=this.locale.customRangeLabel,e.isAfter(t)){var i=this.endDate.diff(this.startDate);t=n(e).add(i,"ms"),this.maxDate&&t.isAfter(this.maxDate)&&(t=this.maxDate.clone())}this.startDate=e,this.endDate=t,this.updateView(),this.updateCalendars()},clickDate:function(e){var t,o,a=i(e.target).attr("data-title"),r=a.substr(1,1),s=a.substr(3,1),l=i(e.target).parents(".calendar");if(l.hasClass("left")){if(t=this.leftCalendar.calendar[r][s],o=this.endDate,"object"==typeof this.dateLimit){var c=n(t).add(this.dateLimit).startOf("day");o.isAfter(c)&&(o=c)}}else if(t=this.startDate,o=this.rightCalendar.calendar[r][s],"object"==typeof this.dateLimit){var u=n(o).subtract(this.dateLimit).startOf("day");t.isBefore(u)&&(t=u)}this.singleDatePicker&&l.hasClass("left")?o=t.clone():this.singleDatePicker&&l.hasClass("right")&&(t=o.clone()),l.find("td").removeClass("active"),i(e.target).addClass("active"),this.setCustomDates(t,o),this.timePicker||o.endOf("day"),this.singleDatePicker&&!this.timePicker&&this.clickApply()},clickApply:function(e){this.updateInputText(),this.hide(),this.element.trigger("apply.daterangepicker",this)},clickCancel:function(e){this.startDate=this.oldStartDate,this.endDate=this.oldEndDate,this.chosenLabel=this.oldChosenLabel,this.updateView(),this.updateCalendars(),this.hide(),this.element.trigger("cancel.daterangepicker",this)},updateMonthYear:function(e){var t=i(e.target).closest(".calendar").hasClass("left"),n=t?"left":"right",o=this.container.find(".calendar."+n),a=parseInt(o.find(".monthselect").val(),10),r=o.find(".yearselect").val();t||this.singleDatePicker||(rthis.maxDate.year()||r==this.maxDate.year()&&a>this.maxDate.month())&&(a=this.maxDate.month(),r=this.maxDate.year()),this[n+"Calendar"].month.month(a).year(r),this.updateCalendars()},updateTime:function(e){var t=i(e.target).closest(".calendar"),n=t.hasClass("left"),o=parseInt(t.find(".hourselect").val(),10),a=parseInt(t.find(".minuteselect").val(),10),r=0;if(this.timePickerSeconds&&(r=parseInt(t.find(".secondselect").val(),10)),this.timePicker12Hour){var s=t.find(".ampmselect").val();"PM"===s&&12>o&&(o+=12),"AM"===s&&12===o&&(o=0)}if(n){var l=this.startDate.clone();l.hour(o),l.minute(a),l.second(r),this.startDate=l,this.leftCalendar.month.hour(o).minute(a).second(r),this.singleDatePicker&&(this.endDate=l.clone())}else{var c=this.endDate.clone();c.hour(o),c.minute(a),c.second(r),this.endDate=c,this.singleDatePicker&&(this.startDate=c.clone()),this.rightCalendar.month.hour(o).minute(a).second(r)}this.updateView(),this.updateCalendars()},updateCalendars:function(){this.leftCalendar.calendar=this.buildCalendar(this.leftCalendar.month.month(),this.leftCalendar.month.year(),this.leftCalendar.month.hour(),this.leftCalendar.month.minute(),this.leftCalendar.month.second(),"left"),this.rightCalendar.calendar=this.buildCalendar(this.rightCalendar.month.month(),this.rightCalendar.month.year(),this.rightCalendar.month.hour(),this.rightCalendar.month.minute(),this.rightCalendar.month.second(),"right"),this.container.find(".calendar.left").empty().html(this.renderCalendar(this.leftCalendar.calendar,this.startDate,this.minDate,this.maxDate,"left")),this.container.find(".calendar.right").empty().html(this.renderCalendar(this.rightCalendar.calendar,this.endDate,this.singleDatePicker?this.minDate:this.startDate,this.maxDate,"right")),this.container.find(".ranges li").removeClass("active");var e=!0,t=0;for(var n in this.ranges)this.timePicker?this.startDate.isSame(this.ranges[n][0])&&this.endDate.isSame(this.ranges[n][1])&&(e=!1,this.chosenLabel=this.container.find(".ranges li:eq("+t+")").addClass("active").html()): //ignore times when comparing dates if time picker is not enabled this.startDate.format("YYYY-MM-DD")==this.ranges[n][0].format("YYYY-MM-DD")&&this.endDate.format("YYYY-MM-DD")==this.ranges[n][1].format("YYYY-MM-DD")&&(e=!1,this.chosenLabel=this.container.find(".ranges li:eq("+t+")").addClass("active").html()),t++;e&&(this.chosenLabel=this.container.find(".ranges li:last").addClass("active").html(),this.showCalendars())},buildCalendar:function(e,t,i,o,a,r){var s,l=n([t,e]).daysInMonth(),c=n([t,e,1]),u=n([t,e,l]),d=n(c).subtract(1,"month").month(),f=n(c).subtract(1,"month").year(),h=n([f,d]).daysInMonth(),m=c.day(),g=[];for(g.firstDay=c,g.lastDay=u,s=0;6>s;s++)g[s]=[]; //populate the calendar with date objects var p=h-m+this.locale.firstDay+1;p>h&&(p-=7),m==this.locale.firstDay&&(p=h-6);var v,b,y=n([f,d,p,12,o,a]).utcOffset(this.timeZone);for(s=0,v=0,b=0;42>s;s++,v++,y=n(y).add(24,"hour"))s>0&&v%7===0&&(v=0,b++),g[b][v]=y.clone().hour(i),y.hour(12),this.minDate&&g[b][v].format("YYYY-MM-DD")==this.minDate.format("YYYY-MM-DD")&&g[b][v].isBefore(this.minDate)&&"left"==r&&(g[b][v]=this.minDate.clone()),this.maxDate&&g[b][v].format("YYYY-MM-DD")==this.maxDate.format("YYYY-MM-DD")&&g[b][v].isAfter(this.maxDate)&&"right"==r&&(g[b][v]=this.maxDate.clone());return g},renderDropdowns:function(e,t,n){for(var i=e.month(),o=e.year(),a=n&&n.year()||o+5,r=t&&t.year()||o-50,s='";for(var d='",s+d},renderCalendar:function(e,t,n,o,a){var r='
';r+='',r+="",r+="",this.showWeekNumbers&&(r+=""),r+=!n||n.isBefore(e.firstDay)?'':"";var s=this.locale.monthNames[e[1][1].month()]+e[1][1].format(" YYYY");this.showDropdowns&&(s=this.renderDropdowns(e[1][1],n,o)),r+='",r+=!o||o.isAfter(e.lastDay)?'':"",r+="",r+="",this.showWeekNumbers&&(r+='"),i.each(this.locale.daysOfWeek,function(e,t){r+=""}),r+="",r+="",r+="";for(var l=0;6>l;l++){r+="", // add week number this.showWeekNumbers&&(r+='");for(var c=0;7>c;c++){var u="available ";u+=e[l][c].month()==e[1][1].month()?"":"off",n&&e[l][c].isBefore(n,"day")||o&&e[l][c].isAfter(o,"day")?u=" off disabled ":e[l][c].format("YYYY-MM-DD")==t.format("YYYY-MM-DD")?(u+=" active ",e[l][c].format("YYYY-MM-DD")==this.startDate.format("YYYY-MM-DD")&&(u+=" start-date "),e[l][c].format("YYYY-MM-DD")==this.endDate.format("YYYY-MM-DD")&&(u+=" end-date ")):e[l][c]>=this.startDate&&e[l][c]<=this.endDate&&(u+=" in-range ",e[l][c].isSame(this.startDate)&&(u+=" start-date "),e[l][c].isSame(this.endDate)&&(u+=" end-date "));var d="r"+l+"c"+c;r+='"}r+=""}r+="",r+="
'+s+"
'+this.locale.weekLabel+""+t+"
'+e[l][0].week()+"'+e[l][c].date()+"
",r+="
";var f;if(this.timePicker){r+='
',r+=' : ",r+=' ",this.timePickerSeconds){for(r+=': "}if(this.timePicker12Hour){r+='"}r+="
"}return r},remove:function(){this.container.remove(),this.element.off(".daterangepicker"),this.element.removeData("daterangepicker")}},i.fn.daterangepicker=function(e,t){return this.each(function(){var n=i(this);n.data("daterangepicker")&&n.data("daterangepicker").remove(),n.data("daterangepicker",new o(n,e,t))}),this}}),function(e,t,n,i){e.site=e.fn.site=function(o){var a,r,s=(new Date).getTime(),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1),f=e.isPlainObject(o)?e.extend(!0,{},e.site.settings,o):e.extend({},e.site.settings),h=f.namespace,m=f.error,g="module-"+h,p=e(n),v=p,b=this,y=v.data(g);return a={initialize:function(){a.instantiate()},instantiate:function(){a.verbose("Storing instance of site",a),y=a,v.data(g,a)},normalize:function(){a.fix.console(),a.fix.requestAnimationFrame()},fix:{console:function(){a.debug("Normalizing window.console"),console!==i&&console.log!==i||(a.verbose("Console not available, normalizing events"),a.disable.console()),"undefined"!=typeof console.group&&"undefined"!=typeof console.groupEnd&&"undefined"!=typeof console.groupCollapsed||(a.verbose("Console group not available, normalizing events"),t.console.group=function(){},t.console.groupEnd=function(){},t.console.groupCollapsed=function(){}),"undefined"==typeof console.markTimeline&&(a.verbose("Mark timeline not available, normalizing events"),t.console.markTimeline=function(){})},consoleClear:function(){a.debug("Disabling programmatic console clearing"),t.console.clear=function(){}},requestAnimationFrame:function(){a.debug("Normalizing requestAnimationFrame"),t.requestAnimationFrame===i&&(a.debug("RequestAnimationFrame not available, normalizing event"),t.requestAnimationFrame=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)})}},moduleExists:function(t){return e.fn[t]!==i&&e.fn[t].settings!==i},enabled:{modules:function(t){var n=[];return t=t||f.modules,e.each(t,function(e,t){a.moduleExists(t)&&n.push(t)}),n}},disabled:{modules:function(t){var n=[];return t=t||f.modules,e.each(t,function(e,t){a.moduleExists(t)||n.push(t)}),n}},change:{setting:function(t,n,o,r){o="string"==typeof o?"all"===o?f.modules:[o]:o||f.modules,r=r!==i?r:!0,e.each(o,function(i,o){var s,l=a.moduleExists(o)?e.fn[o].settings.namespace||!1:!0;a.moduleExists(o)&&(a.verbose("Changing default setting",t,n,o),e.fn[o].settings[t]=n,r&&l&&(s=e(":data(module-"+l+")"),s.length>0&&(a.verbose("Modifying existing settings",s),s[o]("setting",t,n))))})},settings:function(t,n,o){n="string"==typeof n?[n]:n||f.modules,o=o!==i?o:!0,e.each(n,function(n,i){var r;a.moduleExists(i)&&(a.verbose("Changing default setting",t,i),e.extend(!0,e.fn[i].settings,t),o&&h&&(r=e(":data(module-"+h+")"),r.length>0&&(a.verbose("Modifying existing settings",r),r[i]("setting",t))))})}},enable:{console:function(){a.console(!0)},debug:function(e,t){e=e||f.modules,a.debug("Enabling debug for modules",e),a.change.setting("debug",!0,e,t)},verbose:function(e,t){e=e||f.modules,a.debug("Enabling verbose debug for modules",e),a.change.setting("verbose",!0,e,t)}},disable:{console:function(){a.console(!1)},debug:function(e,t){e=e||f.modules,a.debug("Disabling debug for modules",e),a.change.setting("debug",!1,e,t)},verbose:function(e,t){e=e||f.modules,a.debug("Disabling verbose debug for modules",e),a.change.setting("verbose",!1,e,t)}},console:function(e){if(e){if(y.cache.console===i)return void a.error(m.console);a.debug("Restoring console function"),t.console=y.cache.console}else a.debug("Disabling console function"),y.cache.console=t.console,t.console={clear:function(){},error:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},info:function(){},log:function(){},markTimeline:function(){},warn:function(){}}},destroy:function(){a.verbose("Destroying previous site for",v),v.removeData(g)},cache:{},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,a,t);else{if(n===i)return a[t];a[t]=n}},debug:function(){f.debug&&(f.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,f.name+":"),a.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),a.verbose.apply(console,arguments)))},error:function(){a.error=Function.prototype.bind.call(console.error,console,f.name+":"),a.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;f.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,l.push({Element:b,Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(a.performance.timer),a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=f.name+":",n=0;s=!1,clearTimeout(a.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,o){var s,l,c,u=y;return n=n||d,o=b||o,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,o){var r=n!=s?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(u[r])&&n!=s)u=u[r];else{if(u[r]!==i)return l=u[r],!1;if(!e.isPlainObject(u[o])||n==s)return u[o]!==i?(l=u[o],!1):(a.error(m.method,t),!1);u=u[o]}})),e.isFunction(l)?c=l.apply(o,n):l!==i&&(c=l),e.isArray(r)?r.push(c):r!==i?r=[r,c]:c!==i&&(r=c),l}},u?(y===i&&a.initialize(),a.invoke(c)):(y!==i&&a.destroy(),a.initialize()),r!==i?r:this},e.site.settings={name:"Site",namespace:"site",error:{console:"Console cannot be restored, most likely it was overwritten outside of module",method:"The method you called is not defined."},debug:!1,verbose:!1,performance:!0,modules:["accordion","api","checkbox","dimmer","dropdown","embed","form","modal","nag","popup","rating","shape","sidebar","state","sticky","tab","transition","visit","visibility"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}}, // allows for selection of elements with data attributes e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,i){ // support: jQuery < 1.8 return!!e.data(t,i[3])}})}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.form=function(t){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u=arguments[1],d="string"==typeof c,f=[].slice.call(arguments,1);return a.each(function(){var h,m,g,p,v,b,y,x,w,C,k,S,D,T,P,_,A,M,R,O=e(this),E=this,F=[],Y=!1;R={initialize:function(){R.get.settings(),d?(M===i&&R.instantiate(),R.invoke(c)):(M!==i&&M.invoke("destroy"),R.verbose("Initializing form validation",O,x),R.bindEvents(),R.set.defaults(),R.instantiate())},instantiate:function(){R.verbose("Storing instance of module",R),M=R,O.data(_,R)},destroy:function(){R.verbose("Destroying previous module",M),R.removeEvents(),O.removeData(_)},refresh:function(){R.verbose("Refreshing selector cache"),h=O.find(k.field),m=O.find(k.group),g=O.find(k.message),p=O.find(k.prompt),v=O.find(k.submit),b=O.find(k.clear),y=O.find(k.reset)},submit:function(){R.verbose("Submitting form",O),O.submit()},attachEvents:function(t,n){n=n||"submit",e(t).on("click"+A,function(e){R[n](),e.preventDefault()})},bindEvents:function(){R.verbose("Attaching form events"),O.on("submit"+A,R.validate.form).on("blur"+A,k.field,R.event.field.blur).on("click"+A,k.submit,R.submit).on("click"+A,k.reset,R.reset).on("click"+A,k.clear,R.clear),x.keyboardShortcuts&&O.on("keydown"+A,k.field,R.event.field.keydown),h.each(function(){var t=e(this),n=t.prop("type"),i=R.get.changeEvent(n,t);e(this).on(i+A,R.event.field.change)})},clear:function(){h.each(function(){var t=e(this),n=t.parent(),i=t.closest(m),o=i.find(k.prompt),a=t.data(C.defaultValue)||"",r=n.is(k.uiCheckbox),s=n.is(k.uiDropdown),l=i.hasClass(S.error);l&&(R.verbose("Resetting error on field",i),i.removeClass(S.error),o.remove()),s?(R.verbose("Resetting dropdown value",n,a),n.dropdown("clear")):r?t.prop("checked",!1):(R.verbose("Resetting field value",t,a),t.val(""))})},reset:function(){h.each(function(){var t=e(this),n=t.parent(),o=t.closest(m),a=o.find(k.prompt),r=t.data(C.defaultValue),s=n.is(k.uiCheckbox),l=n.is(k.uiDropdown),c=o.hasClass(S.error);r!==i&&(c&&(R.verbose("Resetting error on field",o),o.removeClass(S.error),a.remove()),l?(R.verbose("Resetting dropdown value",n,r),n.dropdown("restore defaults")):s?(R.verbose("Resetting checkbox value",n,r),t.prop("checked",r)):(R.verbose("Resetting field value",t,r),t.val(r)))})},determine:{isValid:function(){var t=!0;return e.each(w,function(e,n){R.validate.field(n,e,!0)||(t=!1)}),t}},is:{bracketedRule:function(e){return e.type&&e.type.match(x.regExp.bracket)},shorthandFields:function(e){var t=Object.keys(e),n=e[t[0]];return R.is.shorthandRules(n)},shorthandRules:function(t){return"string"==typeof t||e.isArray(t)},empty:function(e){return e&&0!==e.length?e.is('input[type="checkbox"]')?!e.is(":checked"):R.is.blank(e):!0},blank:function(t){return""===e.trim(t.val())},valid:function(t){var n=!0;return t?(R.verbose("Checking if field is valid",t),R.validate.field(w[t],t,!1)):(R.verbose("Checking if form is valid"),e.each(w,function(e,t){R.is.valid(e)||(n=!1)}),n)}},removeEvents:function(){O.off(A),h.off(A),v.off(A),h.off(A)},event:{field:{keydown:function(t){var n=e(this),i=t.which,o=n.is(k.input),a=n.is(k.checkbox),r=n.closest(k.uiDropdown).length>0,s={enter:13,escape:27};i==s.escape&&(R.verbose("Escape key pressed blurring field"),n.blur()),t.ctrlKey||i!=s.enter||!o||r||a||(Y||(n.one("keyup"+A,R.event.field.keyup),R.submit(),R.debug("Enter pressed on input submitting form")),Y=!0)},keyup:function(){Y=!1},blur:function(t){var n=e(this),i=n.closest(m),o=R.get.validation(n);i.hasClass(S.error)?(R.debug("Revalidating field",n,o),o&&R.validate.field(o)):"blur"==x.on&&o&&R.validate.field(o)},change:function(t){var n=e(this),i=n.closest(m),o=R.get.validation(n);o&&("change"==x.on||i.hasClass(S.error)&&x.revalidate)&&(clearTimeout(R.timer),R.timer=setTimeout(function(){R.debug("Revalidating field",n,R.get.validation(n)),R.validate.field(o)},x.delay))}}},get:{ancillaryValue:function(e){return e.type&&(e.value||R.is.bracketedRule(e))?e.value!==i?e.value:e.type.match(x.regExp.bracket)[1]+"":!1},ruleName:function(e){return R.is.bracketedRule(e)?e.type.replace(e.type.match(x.regExp.bracket)[0],""):e.type},changeEvent:function(e,t){return"checkbox"==e||"radio"==e||"hidden"==e||t.is("select")?"change":R.get.inputEvent()},inputEvent:function(){return n.createElement("input").oninput!==i?"input":n.createElement("input").onpropertychange!==i?"propertychange":"keyup"},fieldsFromShorthand:function(t){var n={};return e.each(t,function(t,i){"string"==typeof i&&(i=[i]),n[t]={rules:[]},e.each(i,function(e,i){n[t].rules.push({type:i})})}),n},prompt:function(e,t){var n,i,o,a=R.get.ruleName(e),r=R.get.ancillaryValue(e),s=e.prompt||x.prompt[a]||x.text.unspecifiedRule,l=-1!==s.search("{value}"),c=-1!==s.search("{name}");return(c||l)&&(i=R.get.field(t.identifier)),l&&(s=s.replace("{value}",i.val())),c&&(n=i.closest(k.group).find("label").eq(0),o=1==n.length?n.text():i.prop("placeholder")||x.text.unspecifiedField,s=s.replace("{name}",o)),s=s.replace("{identifier}",t.identifier),s=s.replace("{ruleValue}",r),e.prompt||R.verbose("Using default validation prompt for type",s,a),s},settings:function(){if(e.isPlainObject(t)){var n=Object.keys(t),o=n.length>0?t[n[0]].identifier!==i&&t[n[0]].rules!==i:!1;o?(x=e.extend(!0,{},e.fn.form.settings,u),w=e.extend({},e.fn.form.settings.defaults,t),R.error(x.error.oldSyntax,E),R.verbose("Extending settings from legacy parameters",w,x)):(t.fields&&R.is.shorthandFields(t.fields)&&(t.fields=R.get.fieldsFromShorthand(t.fields)),x=e.extend(!0,{},e.fn.form.settings,t),w=e.extend({},e.fn.form.settings.defaults,x.fields),R.verbose("Extending settings",w,x))}else x=e.fn.form.settings,w=e.fn.form.settings.defaults,R.verbose("Using default form validation",w,x);P=x.namespace,C=x.metadata,k=x.selector,S=x.className,D=x.regExp,T=x.error,_="module-"+P,A="."+P,M=O.data(_),R.refresh()},field:function(t){return R.verbose("Finding field with identifier",t),t=R.escape.string(t),h.filter("#"+t).length>0?h.filter("#"+t):h.filter('[name="'+t+'"]').length>0?h.filter('[name="'+t+'"]'):h.filter('[name="'+t+'[]"]').length>0?h.filter('[name="'+t+'[]"]'):h.filter("[data-"+C.validate+'="'+t+'"]').length>0?h.filter("[data-"+C.validate+'="'+t+'"]'):e("")},fields:function(t){var n=e();return e.each(t,function(e,t){n=n.add(R.get.field(t))}),n},validation:function(t){var n,i;return w?(e.each(w,function(e,o){i=o.identifier||e,R.get.field(i)[0]==t[0]&&(o.identifier=i,n=o)}),n||!1):!1},value:function(e){var t,n=[];return n.push(e),t=R.get.values.call(E,n),t[e]},values:function(t){var n=e.isArray(t)?R.get.fields(t):h,o={};return n.each(function(t,n){var a=e(n),r=(a.prop("type"),a.prop("name")),s=a.val(),l=a.is(k.checkbox),c=a.is(k.radio),u=-1!==r.indexOf("[]"),d=l?a.is(":checked"):!1;r&&(u?(r=r.replace("[]",""),o[r]||(o[r]=[]),l?d?o[r].push(s||!0):o[r].push(!1):o[r].push(s)):c?o[r]!==i&&0!=o[r]||(o[r]=d?s||!0:!1):l?d?o[r]=s||!0:o[r]=!1:o[r]=s)}),o}},has:{field:function(e){return R.verbose("Checking for existence of a field with identifier",e),e=R.escape.string(e),"string"!=typeof e&&R.error(T.identifier,e),h.filter("#"+e).length>0?!0:h.filter('[name="'+e+'"]').length>0?!0:h.filter("[data-"+C.validate+'="'+e+'"]').length>0}},escape:{string:function(e){return e=String(e),e.replace(D.escape,"\\$&")}},add:{rule:function(e,t){R.add.field(e,t)},field:function(t,n){var i={};R.is.shorthandRules(n)?(n=e.isArray(n)?n:[n],i[t]={rules:[]},e.each(n,function(e,n){i[t].rules.push({type:n})})):i[t]=n,w=e.extend({},w,i),R.debug("Adding rules",i,w)},fields:function(t){var n;n=t&&R.is.shorthandFields(t)?R.get.fieldsFromShorthand(t):t,w=e.extend({},w,n)},prompt:function(t,n){var o=R.get.field(t),a=o.closest(m),r=a.children(k.prompt),s=0!==r.length;n="string"==typeof n?[n]:n,R.verbose("Adding field error state",t),a.addClass(S.error),x.inline&&(s||(r=x.templates.prompt(n),r.appendTo(a)),r.html(n[0]),s?R.verbose("Inline errors are disabled, no inline error added",t):x.transition&&e.fn.transition!==i&&O.transition("is supported")?(R.verbose("Displaying error with css transition",x.transition),r.transition(x.transition+" in",x.duration)):(R.verbose("Displaying error with fallback javascript animation"),r.fadeIn(x.duration)))},errors:function(e){R.debug("Adding form error messages",e),R.set.error(),g.html(x.templates.error(e))}},remove:{rule:function(t,n){var o=e.isArray(n)?n:[n];return n==i?(R.debug("Removed all rules"),void(w[t].rules=[])):void(w[t]!=i&&e.isArray(w[t].rules)&&e.each(w[t].rules,function(e,n){-1!==o.indexOf(n.type)&&(R.debug("Removed rule",n.type),w[t].rules.splice(e,1))}))},field:function(t){var n=e.isArray(t)?t:[t];e.each(n,function(e,t){R.remove.rule(t)})},rules:function(t,n){e.isArray(t)?e.each(fields,function(e,t){R.remove.rule(t,n)}):R.remove.rule(t,n)},fields:function(e){R.remove.field(e)},prompt:function(t){var n=R.get.field(t),o=n.closest(m),a=o.children(k.prompt);o.removeClass(S.error),x.inline&&a.is(":visible")&&(R.verbose("Removing prompt for field",t),x.transition&&e.fn.transition!==i&&O.transition("is supported")?a.transition(x.transition+" out",x.duration,function(){a.remove()}):a.fadeOut(x.duration,function(){a.remove()}))}},set:{success:function(){O.removeClass(S.error).addClass(S.success)},defaults:function(){h.each(function(){var t=e(this),n=t.filter(k.checkbox).length>0,i=n?t.is(":checked"):t.val();t.data(C.defaultValue,i)})},error:function(){O.removeClass(S.success).addClass(S.error)},value:function(e,t){var n={};return n[e]=t,R.set.values.call(E,n)},values:function(t){e.isEmptyObject(t)||e.each(t,function(t,n){var i,o=R.get.field(t),a=o.parent(),r=e.isArray(n),s=a.is(k.uiCheckbox),l=a.is(k.uiDropdown),c=o.is(k.radio)&&s,u=o.length>0;u&&(r&&s?(R.verbose("Selecting multiple",n,o),a.checkbox("uncheck"),e.each(n,function(e,t){i=o.filter('[value="'+t+'"]'),a=i.parent(),i.length>0&&a.checkbox("check")})):c?(R.verbose("Selecting radio value",n,o),o.filter('[value="'+n+'"]').parent(k.uiCheckbox).checkbox("check")):s?(R.verbose("Setting checkbox value",n,a),n===!0?a.checkbox("check"):a.checkbox("uncheck")):l?(R.verbose("Setting dropdown value",n,a),a.dropdown("set selected",n)):(R.verbose("Setting field value",n,o),o.val(n)))})}},validate:{form:function(e,t){var n=R.get.values();if(Y)return!1;if(F=[],R.determine.isValid()){if(R.debug("Form has no validation errors, submitting"),R.set.success(),t!==!0)return x.onSuccess.call(E,e,n)}else if(R.debug("Form has errors"),R.set.error(),x.inline||R.add.errors(F),O.data("moduleApi")!==i&&e.stopImmediatePropagation(),t!==!0)return x.onFailure.call(E,F,n)},field:function(t,n,o){o=o!==i?o:!0,"string"==typeof t&&(R.verbose("Validating field",t),n=t,t=w[t]);var a=t.identifier||n,r=R.get.field(a),s=t.depends?R.get.field(t.depends):!1,l=!0,c=[];return t.identifier||(R.debug("Using field name as identifier",a),t.identifier=a),r.prop("disabled")?(R.debug("Field is disabled. Skipping",a),l=!0):t.optional&&R.is.blank(r)?(R.debug("Field is optional and blank. Skipping",a),l=!0):t.depends&&R.is.empty(s)?(R.debug("Field depends on another value that is not present or empty. Skipping",s),l=!0):t.rules!==i&&e.each(t.rules,function(e,n){R.has.field(a)&&!R.validate.rule(t,n)&&(R.debug("Field is invalid",a,n.type),c.push(R.get.prompt(n,t)),l=!1)}),l?(o&&(R.remove.prompt(a,c),x.onValid.call(r)),!0):(o&&(F=F.concat(c),R.add.prompt(a,c),x.onInvalid.call(r,c)),!1)},rule:function(t,n){var o=R.get.field(t.identifier),a=(n.type,o.val()),r=R.get.ancillaryValue(n),s=R.get.ruleName(n),l=x.rules[s];return e.isFunction(l)?(a=a===i||""===a||null===a?"":e.trim(a+""),l.call(o,a,r)):void R.error(T.noRule,s)}},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,x,t);else{if(n===i)return x[t];x[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,R,t);else{if(n===i)return R[t];R[t]=n}},debug:function(){!x.silent&&x.debug&&(x.performance?R.performance.log(arguments):(R.debug=Function.prototype.bind.call(console.info,console,x.name+":"),R.debug.apply(console,arguments)))},verbose:function(){!x.silent&&x.verbose&&x.debug&&(x.performance?R.performance.log(arguments):(R.verbose=Function.prototype.bind.call(console.info,console,x.name+":"),R.verbose.apply(console,arguments)))},error:function(){x.silent||(R.error=Function.prototype.bind.call(console.error,console,x.name+":"),R.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;x.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:E,"Execution Time":n})),clearTimeout(R.performance.timer),R.performance.timer=setTimeout(R.performance.display,500)},display:function(){var t=x.name+":",n=0;s=!1,clearTimeout(R.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),a.length>1&&(t+=" ("+a.length+")"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,a){var r,s,l,c=M;return n=n||f,a=E||a,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):!1;c=c[o]}})),e.isFunction(s)?l=s.apply(a,n):s!==i&&(l=s),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),s}},R.initialize()}),o!==i?o:this},e.fn.form.settings={name:"Form",namespace:"form",debug:!1,verbose:!1,performance:!0,fields:!1,keyboardShortcuts:!0,on:"submit",inline:!1,delay:200,revalidate:!0,transition:"scale",duration:200,onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{defaultValue:"default",validate:"validate"},regExp:{htmlID:/^[a-zA-Z][\w:.-]*$/g,bracket:/\[(.*)\]/i,decimal:/^\d+\.?\d*$/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,flags:/^\/(.*)\/(.*)?/,integer:/^\-?\d+$/,number:/^\-?\d*(\.\d+)?$/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},text:{unspecifiedRule:"Please enter a valid value",unspecifiedField:"This field"},prompt:{empty:"{name} must have a value",checked:"{name} must be checked",email:"{name} must be a valid e-mail",url:"{name} must be a valid url",regExp:"{name} is not formatted correctly",integer:"{name} must be an integer",decimal:"{name} must be a decimal number",number:"{name} must be set to a number",is:'{name} must be "{ruleValue}"',isExactly:'{name} must be exactly "{ruleValue}"',not:'{name} cannot be set to "{ruleValue}"',notExactly:'{name} cannot be set to exactly "{ruleValue}"',contain:'{name} must contain "{ruleValue}"',containExactly:'{name} must contain exactly "{ruleValue}"',doesntContain:'{name} cannot contain "{ruleValue}"',doesntContainExactly:'{name} cannot contain exactly "{ruleValue}"',minLength:"{name} must be at least {ruleValue} characters",length:"{name} must be at least {ruleValue} characters",exactLength:"{name} must be exactly {ruleValue} characters",maxLength:"{name} cannot be longer than {ruleValue} characters",match:"{name} must match {ruleValue} field",different:"{name} must have a different value than {ruleValue} field",creditCard:"{name} must be a valid credit card number",minCount:"{name} must have at least {ruleValue} choices",exactCount:"{name} must have exactly {ruleValue} choices",maxCount:"{name} must have {ruleValue} or less choices"},selector:{checkbox:'input[type="checkbox"], input[type="radio"]',clear:".clear",field:"input, textarea, select",group:".field",input:"input",message:".error.message",prompt:".prompt.label",radio:'input[type="radio"]',reset:'.reset:not([type="reset"])',submit:'.submit:not([type="submit"])',uiCheckbox:".ui.checkbox",uiDropdown:".ui.dropdown"},className:{error:"error",label:"ui prompt label",pressed:"down",success:"success"},error:{identifier:"You must specify a string identifier for each field",method:"The method you called is not defined.",noRule:"There is no rule matching the one you specified",oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically."},templates:{error:function(t){var n='
    ';return e.each(t,function(e,t){n+="
  • "+t+"
  • "}),n+="
",e(n)},prompt:function(t){return e("
").addClass("ui basic red pointing prompt label").html(t[0])}},rules:{empty:function(t){return!(t===i||""===t||e.isArray(t)&&0===t.length)},checked:function(){return e(this).filter(":checked").length>0},email:function(t){return e.fn.form.settings.regExp.email.test(t)},url:function(t){return e.fn.form.settings.regExp.url.test(t)},regExp:function(t,n){if(n instanceof RegExp)return t.match(n);var i,o=n.match(e.fn.form.settings.regExp.flags);return o&&(n=o.length>=2?o[1]:n,i=o.length>=3?o[2]:""),t.match(new RegExp(n,i))},integer:function(t,n){var o,a,r,s=e.fn.form.settings.regExp.integer;return n&&-1===["",".."].indexOf(n)&&(-1==n.indexOf("..")?s.test(n)&&(o=a=n-0):(r=n.split("..",2),s.test(r[0])&&(o=r[0]-0),s.test(r[1])&&(a=r[1]-0))),s.test(t)&&(o===i||t>=o)&&(a===i||a>=t)},decimal:function(t){return e.fn.form.settings.regExp.decimal.test(t)},number:function(t){return e.fn.form.settings.regExp.number.test(t)},is:function(e,t){return t="string"==typeof t?t.toLowerCase():t,e="string"==typeof e?e.toLowerCase():e,e==t},isExactly:function(e,t){return e==t},not:function(e,t){return e="string"==typeof e?e.toLowerCase():e,t="string"==typeof t?t.toLowerCase():t,e!=t},notExactly:function(e,t){return e!=t},contains:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n,"i"))},containsExactly:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n))},doesntContain:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(n,"i"))},doesntContainExactly:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(n))},minLength:function(e,t){return e!==i?e.length>=t:!1},length:function(e,t){return e!==i?e.length>=t:!1},exactLength:function(e,t){return e!==i?e.length==t:!1},maxLength:function(e,t){return e!==i?e.length<=t:!1},match:function(t,n){var o;e(this);return e('[data-validate="'+n+'"]').length>0?o=e('[data-validate="'+n+'"]').val():e("#"+n).length>0?o=e("#"+n).val():e('[name="'+n+'"]').length>0?o=e('[name="'+n+'"]').val():e('[name="'+n+'[]"]').length>0&&(o=e('[name="'+n+'[]"]')),o!==i?t.toString()==o.toString():!1},different:function(t,n){var o;e(this);return e('[data-validate="'+n+'"]').length>0?o=e('[data-validate="'+n+'"]').val():e("#"+n).length>0?o=e("#"+n).val():e('[name="'+n+'"]').length>0?o=e('[name="'+n+'"]').val():e('[name="'+n+'[]"]').length>0&&(o=e('[name="'+n+'[]"]')),o!==i?t.toString()!==o.toString():!1},creditCard:function(t,n){var i,o,a={visa:{pattern:/^4/,length:[16]},amex:{pattern:/^3[47]/,length:[15]},mastercard:{pattern:/^5[1-5]/,length:[16]},discover:{pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,length:[16]},unionPay:{pattern:/^(62|88)/,length:[16,17,18,19]},jcb:{pattern:/^35(2[89]|[3-8][0-9])/,length:[16]},maestro:{pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,length:[12,13,14,15,16,17,18,19]},dinersClub:{pattern:/^(30[0-5]|^36)/,length:[14]},laser:{pattern:/^(6304|670[69]|6771)/,length:[16,17,18,19]},visaElectron:{pattern:/^(4026|417500|4508|4844|491(3|7))/,length:[16]}},r={},s=!1,l="string"==typeof n?n.split(","):!1;if("string"==typeof t&&0!==t.length){if(t=t.replace(/[\-]/g,""),l&&(e.each(l,function(n,i){o=a[i],o&&(r={length:-1!==e.inArray(t.length,o.length),pattern:-1!==t.search(o.pattern)},r.length&&r.pattern&&(s=!0))}),!s))return!1;if(i={number:-1!==e.inArray(t.length,a.unionPay.length),pattern:-1!==t.search(a.unionPay.pattern)},i.number&&i.pattern)return!0;for(var c=t.length,u=0,d=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],f=0;c--;)f+=d[u][parseInt(t.charAt(c),10)],u^=1;return f%10===0&&f>0}},minCount:function(e,t){return 0==t?!0:1==t?""!==e:e.split(",").length>=t},exactCount:function(e,t){return 0==t?""===e:1==t?""!==e&&-1===e.search(","):e.split(",").length==t},maxCount:function(e,t){return 0==t?!1:1==t?-1===e.search(","):e.split(",").length<=t}}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.accordion=function(n){var o,a=e(this),r=(new Date).getTime(),s=[],l=arguments[0],c="string"==typeof l,u=[].slice.call(arguments,1);t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return a.each(function(){var d,f,h=e.isPlainObject(n)?e.extend(!0,{},e.fn.accordion.settings,n):e.extend({},e.fn.accordion.settings),m=h.className,g=h.namespace,p=h.selector,v=h.error,b="."+g,y="module-"+g,x=a.selector||"",w=e(this),C=w.find(p.title),k=w.find(p.content),S=this,D=w.data(y);f={initialize:function(){f.debug("Initializing",w),f.bind.events(),h.observeChanges&&f.observeChanges(),f.instantiate()},instantiate:function(){D=f,w.data(y,f)},destroy:function(){f.debug("Destroying previous instance",w),w.off(b).removeData(y)},refresh:function(){C=w.find(p.title),k=w.find(p.content)},observeChanges:function(){"MutationObserver"in t&&(d=new MutationObserver(function(e){f.debug("DOM tree modified, updating selector cache"),f.refresh()}),d.observe(S,{childList:!0,subtree:!0}),f.debug("Setting up mutation observer",d))},bind:{events:function(){f.debug("Binding delegated events"),w.on(h.on+b,p.trigger,f.event.click)}},event:{click:function(){f.toggle.call(this)}},toggle:function(t){var n=t!==i?"number"==typeof t?C.eq(t):e(t).closest(p.title):e(this).closest(p.title),o=n.next(k),a=o.hasClass(m.animating),r=o.hasClass(m.active),s=r&&!a,l=!r&&a;f.debug("Toggling visibility of content",n),s||l?h.collapsible?f.close.call(n):f.debug("Cannot close accordion content collapsing is disabled"):f.open.call(n)},open:function(t){var n=t!==i?"number"==typeof t?C.eq(t):e(t).closest(p.title):e(this).closest(p.title),o=n.next(k),a=o.hasClass(m.animating),r=o.hasClass(m.active),s=r||a;return s?void f.debug("Accordion already open, skipping",o):(f.debug("Opening accordion content",n),h.onOpening.call(o),h.onChanging.call(o),h.exclusive&&f.closeOthers.call(n),n.addClass(m.active),o.stop(!0,!0).addClass(m.animating),h.animateChildren&&(e.fn.transition!==i&&w.transition("is supported")?o.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:h.debug,verbose:h.verbose,duration:h.duration}):o.children().stop(!0,!0).animate({opacity:1},h.duration,f.resetOpacity)),void o.slideDown(h.duration,h.easing,function(){o.removeClass(m.animating).addClass(m.active),f.reset.display.call(this),h.onOpen.call(this),h.onChange.call(this)}))},close:function(t){var n=t!==i?"number"==typeof t?C.eq(t):e(t).closest(p.title):e(this).closest(p.title),o=n.next(k),a=o.hasClass(m.animating),r=o.hasClass(m.active),s=!r&&a,l=r&&a;!r&&!s||l||(f.debug("Closing accordion content",o),h.onClosing.call(o),h.onChanging.call(o),n.removeClass(m.active),o.stop(!0,!0).addClass(m.animating),h.animateChildren&&(e.fn.transition!==i&&w.transition("is supported")?o.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:h.debug,verbose:h.verbose,duration:h.duration}):o.children().stop(!0,!0).animate({opacity:0},h.duration,f.resetOpacity)),o.slideUp(h.duration,h.easing,function(){o.removeClass(m.animating).removeClass(m.active),f.reset.display.call(this),h.onClose.call(this),h.onChange.call(this)}))},closeOthers:function(t){var n,o,a,r=t!==i?C.eq(t):e(this).closest(p.title),s=r.parents(p.content).prev(p.title),l=r.closest(p.accordion),c=p.title+"."+m.active+":visible",u=p.content+"."+m.active+":visible";h.closeNested?(n=l.find(c).not(s),a=n.next(k)):(n=l.find(c).not(s),o=l.find(u).find(c).not(s),n=n.not(o),a=n.next(k)),n.length>0&&(f.debug("Exclusive enabled, closing other content",n),n.removeClass(m.active),a.removeClass(m.animating).stop(!0,!0),h.animateChildren&&(e.fn.transition!==i&&w.transition("is supported")?a.children().transition({animation:"fade out",useFailSafe:!0,debug:h.debug,verbose:h.verbose,duration:h.duration}):a.children().stop(!0,!0).animate({opacity:0},h.duration,f.resetOpacity)),a.slideUp(h.duration,h.easing,function(){e(this).removeClass(m.active),f.reset.display.call(this)}))},reset:{display:function(){f.verbose("Removing inline display from element",this),e(this).css("display",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")},opacity:function(){f.verbose("Removing inline opacity from element",this),e(this).css("opacity",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")}},setting:function(t,n){if(f.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,h,t);else{if(n===i)return h[t];e.isPlainObject(h[t])?e.extend(!0,h[t],n):h[t]=n}},internal:function(t,n){return f.debug("Changing internal",t,n),n===i?f[t]:void(e.isPlainObject(t)?e.extend(!0,f,t):f[t]=n)},debug:function(){!h.silent&&h.debug&&(h.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,h.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!h.silent&&h.verbose&&h.debug&&(h.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),f.verbose.apply(console,arguments)))},error:function(){h.silent||(f.error=Function.prototype.bind.call(console.error,console,h.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;h.performance&&(t=(new Date).getTime(),i=r||t,n=t-i,r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=h.name+":",n=0;r=!1,clearTimeout(f.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",x&&(t+=" '"+x+"'"),(console.group!==i||console.table!==i)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,a){var r,s,l,c=D;return n=n||u,a=S||a,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):(f.error(v.method,t),!1);c=c[o]}})),e.isFunction(s)?l=s.apply(a,n):s!==i&&(l=s),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),s}},c?(D===i&&f.initialize(),f.invoke(l)):(D!==i&&D.invoke("destroy"),f.initialize())}),o!==i?o:this},e.fn.accordion.settings={name:"Accordion",namespace:"accordion",silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",observeChanges:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",onOpening:function(){},onClosing:function(){},onChanging:function(){},onOpen:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active",animating:"animating"},selector:{accordion:".accordion",title:".title",trigger:".title",content:".content"}},e.extend(e.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.checkbox=function(o){var a,r=e(this),s=r.selector||"",l=(new Date).getTime(),c=[],u=arguments[0],d="string"==typeof u,f=[].slice.call(arguments,1);return r.each(function(){var r,h,m=e.extend(!0,{},e.fn.checkbox.settings,o),g=m.className,p=m.namespace,v=m.selector,b=m.error,y="."+p,x="module-"+p,w=e(this),C=e(this).children(v.label),k=e(this).children(v.input),S=k[0],D=!1,T=!1,P=w.data(x),_=this;h={initialize:function(){h.verbose("Initializing checkbox",m),h.create.label(),h.bind.events(),h.set.tabbable(),h.hide.input(),h.observeChanges(),h.instantiate(),h.setup()},instantiate:function(){h.verbose("Storing instance of module",h),P=h,w.data(x,h)},destroy:function(){h.verbose("Destroying module"),h.unbind.events(),h.show.input(),w.removeData(x)},fix:{reference:function(){w.is(v.input)&&(h.debug("Behavior called on adjusting invoked element"),w=w.closest(v.checkbox),h.refresh())}},setup:function(){h.set.initialLoad(),h.is.indeterminate()?(h.debug("Initial value is indeterminate"),h.indeterminate()):h.is.checked()?(h.debug("Initial value is checked"),h.check()):(h.debug("Initial value is unchecked"),h.uncheck()),h.remove.initialLoad()},refresh:function(){C=w.children(v.label),k=w.children(v.input),S=k[0]},hide:{input:function(){h.verbose("Modifying z-index to be unselectable"),k.addClass(g.hidden)}},show:{input:function(){h.verbose("Modifying z-index to be selectable"),k.removeClass(g.hidden)}},observeChanges:function(){"MutationObserver"in t&&(r=new MutationObserver(function(e){h.debug("DOM tree modified, updating selector cache"),h.refresh()}),r.observe(_,{childList:!0,subtree:!0}),h.debug("Setting up mutation observer",r))},attachEvents:function(t,n){var i=e(t);n=e.isFunction(h[n])?h[n]:h.toggle,i.length>0?(h.debug("Attaching checkbox events to element",t,n),i.on("click"+y,n)):h.error(b.notFound)},event:{click:function(t){var n=e(t.target);return n.is(v.input)?void h.verbose("Using default check action on initialized checkbox"):n.is(v.link)?void h.debug("Clicking link inside checkbox, skipping toggle"):(h.toggle(),k.focus(),void t.preventDefault())},keydown:function(e){var t=e.which,n={enter:13,space:32,escape:27};t==n.escape?(h.verbose("Escape key pressed blurring field"),k.blur(),T=!0):e.ctrlKey||t!=n.space&&t!=n.enter?T=!1:(h.verbose("Enter/space key pressed, toggling checkbox"),h.toggle(),T=!0)},keyup:function(e){T&&e.preventDefault()}},check:function(){h.should.allowCheck()&&(h.debug("Checking checkbox",k),h.set.checked(),h.should.ignoreCallbacks()||(m.onChecked.call(S),m.onChange.call(S)))},uncheck:function(){h.should.allowUncheck()&&(h.debug("Unchecking checkbox"),h.set.unchecked(),h.should.ignoreCallbacks()||(m.onUnchecked.call(S),m.onChange.call(S)))},indeterminate:function(){return h.should.allowIndeterminate()?void h.debug("Checkbox is already indeterminate"):(h.debug("Making checkbox indeterminate"),h.set.indeterminate(),void(h.should.ignoreCallbacks()||(m.onIndeterminate.call(S),m.onChange.call(S))))},determinate:function(){return h.should.allowDeterminate()?void h.debug("Checkbox is already determinate"):(h.debug("Making checkbox determinate"),h.set.determinate(),void(h.should.ignoreCallbacks()||(m.onDeterminate.call(S),m.onChange.call(S))))},enable:function(){return h.is.enabled()?void h.debug("Checkbox is already enabled"):(h.debug("Enabling checkbox"),h.set.enabled(),m.onEnable.call(S),void m.onEnabled.call(S))},disable:function(){return h.is.disabled()?void h.debug("Checkbox is already disabled"):(h.debug("Disabling checkbox"),h.set.disabled(),m.onDisable.call(S),void m.onDisabled.call(S))},get:{radios:function(){var t=h.get.name();return e('input[name="'+t+'"]').closest(v.checkbox)},otherRadios:function(){return h.get.radios().not(w)},name:function(){return k.attr("name")}},is:{initialLoad:function(){return D},radio:function(){return k.hasClass(g.radio)||"radio"==k.attr("type")},indeterminate:function(){return k.prop("indeterminate")!==i&&k.prop("indeterminate")},checked:function(){return k.prop("checked")!==i&&k.prop("checked"); },disabled:function(){return k.prop("disabled")!==i&&k.prop("disabled")},enabled:function(){return!h.is.disabled()},determinate:function(){return!h.is.indeterminate()},unchecked:function(){return!h.is.checked()}},should:{allowCheck:function(){return h.is.determinate()&&h.is.checked()&&!h.should.forceCallbacks()?(h.debug("Should not allow check, checkbox is already checked"),!1):m.beforeChecked.apply(S)===!1?(h.debug("Should not allow check, beforeChecked cancelled"),!1):!0},allowUncheck:function(){return h.is.determinate()&&h.is.unchecked()&&!h.should.forceCallbacks()?(h.debug("Should not allow uncheck, checkbox is already unchecked"),!1):m.beforeUnchecked.apply(S)===!1?(h.debug("Should not allow uncheck, beforeUnchecked cancelled"),!1):!0},allowIndeterminate:function(){return h.is.indeterminate()&&!h.should.forceCallbacks()?(h.debug("Should not allow indeterminate, checkbox is already indeterminate"),!1):m.beforeIndeterminate.apply(S)===!1?(h.debug("Should not allow indeterminate, beforeIndeterminate cancelled"),!1):!0},allowDeterminate:function(){return h.is.determinate()&&!h.should.forceCallbacks()?(h.debug("Should not allow determinate, checkbox is already determinate"),!1):m.beforeDeterminate.apply(S)===!1?(h.debug("Should not allow determinate, beforeDeterminate cancelled"),!1):!0},forceCallbacks:function(){return h.is.initialLoad()&&m.fireOnInit},ignoreCallbacks:function(){return D&&!m.fireOnInit}},can:{change:function(){return!(w.hasClass(g.disabled)||w.hasClass(g.readOnly)||k.prop("disabled")||k.prop("readonly"))},uncheck:function(){return"boolean"==typeof m.uncheckable?m.uncheckable:!h.is.radio()}},set:{initialLoad:function(){D=!0},checked:function(){return h.verbose("Setting class to checked"),w.removeClass(g.indeterminate).addClass(g.checked),h.is.radio()&&h.uncheckOthers(),!h.is.indeterminate()&&h.is.checked()?void h.debug("Input is already checked, skipping input property change"):(h.verbose("Setting state to checked",S),k.prop("indeterminate",!1).prop("checked",!0),void h.trigger.change())},unchecked:function(){return h.verbose("Removing checked class"),w.removeClass(g.indeterminate).removeClass(g.checked),!h.is.indeterminate()&&h.is.unchecked()?void h.debug("Input is already unchecked"):(h.debug("Setting state to unchecked"),k.prop("indeterminate",!1).prop("checked",!1),void h.trigger.change())},indeterminate:function(){return h.verbose("Setting class to indeterminate"),w.addClass(g.indeterminate),h.is.indeterminate()?void h.debug("Input is already indeterminate, skipping input property change"):(h.debug("Setting state to indeterminate"),k.prop("indeterminate",!0),void h.trigger.change())},determinate:function(){return h.verbose("Removing indeterminate class"),w.removeClass(g.indeterminate),h.is.determinate()?void h.debug("Input is already determinate, skipping input property change"):(h.debug("Setting state to determinate"),void k.prop("indeterminate",!1))},disabled:function(){return h.verbose("Setting class to disabled"),w.addClass(g.disabled),h.is.disabled()?void h.debug("Input is already disabled, skipping input property change"):(h.debug("Setting state to disabled"),k.prop("disabled","disabled"),void h.trigger.change())},enabled:function(){return h.verbose("Removing disabled class"),w.removeClass(g.disabled),h.is.enabled()?void h.debug("Input is already enabled, skipping input property change"):(h.debug("Setting state to enabled"),k.prop("disabled",!1),void h.trigger.change())},tabbable:function(){h.verbose("Adding tabindex to checkbox"),k.attr("tabindex")===i&&k.attr("tabindex",0)}},remove:{initialLoad:function(){D=!1}},trigger:{change:function(){var e=n.createEvent("HTMLEvents"),t=k[0];t&&(h.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},create:{label:function(){k.prevAll(v.label).length>0?(k.prev(v.label).detach().insertAfter(k),h.debug("Moving existing label",C)):h.has.label()||(C=e("