PageSourceSearch

https://gresna-gorica.hr/wp-content/themes/rosa/assets/js/plugins.js?ver=2.9.0

js gresna-gorica.hr collected 2026-10-04 11:06:44 UTC 164,965 bytes, 4,154 lines download raw bytes

1/* --- $DEBOUNCES RESIZE --- */
2
3/* debouncedresize: special jQuery event that happens once after a window resize
4 * https://github.com/louisremi/jquery-smartresize
5 * Copyright 2012 @louis_remi
6 * MIT License
7 */
8(function ($) {
9	var $event = $.event, $special, resizeTimeout;
10	$special = $event.special.debouncedresize = {
11		setup: function () {
12			$(this).on("resize", $special.handler);
13		}, teardown: function () {
14			$(this).off("resize", $special.handler);
15		}, handler: function (event, execAsap) {
16			var context = this, args = arguments, dispatch = function () {
17				event.type = "debouncedresize";
18				$event.dispatch.apply(context, args);
19			};
20			if (resizeTimeout) {
21				clearTimeout(resizeTimeout);
22			}
23			execAsap ? dispatch() : resizeTimeout = setTimeout(dispatch, $special.threshold);
24		}, threshold: 150
25	};
26})(jQuery);
27
28/* --- $HOVERINTENT --- */
29
30/* hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+
31 * http://cherne.net/brian/resources/jquery.hoverIntent.html
32 *
33 * You may use hoverIntent under the terms of the MIT license.
34 * Copyright 2007, 2013 Brian Cherne
35 */
36(function (e) {
37	e.fn.hoverIntent = function (t, n, r) {
38		var i = {interval: 100, sensitivity: 7, timeout: 0};
39		if (typeof t === "object") {
40			i = e.extend(i, t)
41		} else if (e.isFunction(n)) {
42			i = e.extend(i, {over: t, out: n, selector: r})
43		} else {
44			i = e.extend(i, {over: t, out: t, selector: n})
45		}
46		var s, o, u, a;
47		var f = function (e) {
48			s = e.pageX;
49			o = e.pageY
50		};
51		var l = function (t, n) {
52			n.hoverIntent_t = clearTimeout(n.hoverIntent_t);
53			if (Math.abs(u - s) + Math.abs(a - o) < i.sensitivity) {
54				e(n).off("mousemove.hoverIntent", f);
55				n.hoverIntent_s = 1;
56				return i.over.apply(n, [t])
57			} else {
58				u = s;
59				a = o;
60				n.hoverIntent_t = setTimeout(function () {
61					l(t, n)
62				}, i.interval)
63			}
64		};
65		var c = function (e, t) {
66			t.hoverIntent_t = clearTimeout(t.hoverIntent_t);
67			t.hoverIntent_s = 0;
68			return i.out.apply(t, [e])
69		};
70		var h = function (t) {
71			var n = jQuery.extend({}, t);
72			var r = this;
73			if (r.hoverIntent_t) {
74				r.hoverIntent_t = clearTimeout(r.hoverIntent_t)
75			}
76			if (t.type == "mouseenter") {
77				u = n.pageX;
78				a = n.pageY;
79				e(r).on("mousemove.hoverIntent", f);
80				if (r.hoverIntent_s != 1) {
81					r.hoverIntent_t = setTimeout(function () {
82						l(n, r)
83					}, i.interval)
84				}
85			} else {
86				e(r).off("mousemove.hoverIntent", f);
87				if (r.hoverIntent_s == 1) {
88					r.hoverIntent_t = setTimeout(function () {
89						c(n, r)
90					}, i.timeout)
91				}
92			}
93		};
94		return this.on({"mouseenter.hoverIntent": h, "mouseleave.hoverIntent": h}, i.selector)
95	}
96})(jQuery);
97
98/*!
99 * imagesLoaded PACKAGED v3.1.4
100 * JavaScript is all like "You images are done yet or what?"
101 * MIT License
102 */
103
104(function () {
105	function e() {
106	}
107
108	function t(e, t) {
109		for (var n = e.length; n--;)if (e[n].listener === t)return n;
110		return-1
111	}
112
113	function n(e) {
114		return function () {
115			return this[e].apply(this, arguments)
116		}
117	}
118
119	var i = e.prototype, r = this, o = r.EventEmitter;
120	i.getListeners = function (e) {
121		var t, n, i = this._getEvents();
122		if ("object" == typeof e) {
123			t = {};
124			for (n in i)i.hasOwnProperty(n) && e.test(n) && (t[n] = i[n])
125		} else t = i[e] || (i[e] = []);
126		return t
127	}, i.flattenListeners = function (e) {
128		var t, n = [];
129		for (t = 0; e.length > t; t += 1)n.push(e[t].listener);
130		return n
131	}, i.getListenersAsObject = function (e) {
132		var t, n = this.getListeners(e);
133		return n instanceof Array && (t = {}, t[e] = n), t || n
134	}, i.addListener = function (e, n) {
135		var i, r = this.getListenersAsObject(e), o = "object" == typeof n;
136		for (i in r)r.hasOwnProperty(i) && -1 === t(r[i], n) && r[i].push(o ? n : {listener: n, once: !1});
137		return this
138	}, i.on = n("addListener"), i.addOnceListener = function (e, t) {
139		return this.addListener(e, {listener: t, once: !0})
140	}, i.once = n("addOnceListener"), i.defineEvent = function (e) {
141		return this.getListeners(e), this
142	}, i.defineEvents = function (e) {
143		for (var t = 0; e.length > t; t += 1)this.defineEvent(e[t]);
144		return this
145	}, i.removeListener = function (e, n) {
146		var i, r, o = this.getListenersAsObject(e);
147		for (r in o)o.hasOwnProperty(r) && (i = t(o[r], n), -1 !== i && o[r].splice(i, 1));
148		return this
149	}, i.off = n("removeListener"), i.addListeners = function (e, t) {
150		return this.manipulateListeners(!1, e, t)
151	}, i.removeListeners = function (e, t) {
152		return this.manipulateListeners(!0, e, t)
153	}, i.manipulateListeners = function (e, t, n) {
154		var i, r, o = e ? this.removeListener : this.addListener, s = e ? this.removeListeners : this.addListeners;
155		if ("object" != typeof t || t instanceof RegExp)for (i = n.length; i--;)o.call(this, t, n[i]); else for (i in t)t.hasOwnProperty(i) && (r = t[i]) && ("function" == typeof r ? o.call(this, i, r) : s.call(this, i, r));
156		return this
157	}, i.removeEvent = function (e) {
158		var t, n = typeof e, i = this._getEvents();
159		if ("string" === n)delete i[e]; else if ("object" === n)for (t in i)i.hasOwnProperty(t) && e.test(t) && delete i[t]; else delete this._events;
160		return this
161	}, i.removeAllListeners = n("removeEvent"), i.emitEvent = function (e, t) {
162		var n, i, r, o, s = this.getListenersAsObject(e);
163		for (r in s)if (s.hasOwnProperty(r))for (i = s[r].length; i--;)n = s[r][i], n.once === !0 && this.removeListener(e, n.listener), o = n.listener.apply(this, t || []), o === this._getOnceReturnValue() && this.removeListener(e, n.listener);
164		return this
165	}, i.trigger = n("emitEvent"), i.emit = function (e) {
166		var t = Array.prototype.slice.call(arguments, 1);
167		return this.emitEvent(e, t)
168	}, i.setOnceReturnValue = function (e) {
169		return this._onceReturnValue = e, this
170	}, i._getOnceReturnValue = function () {
171		return this.hasOwnProperty("_onceReturnValue") ? this._onceReturnValue : !0
172	}, i._getEvents = function () {
173		return this._events || (this._events = {})
174	}, e.noConflict = function () {
175		return r.EventEmitter = o, e
176	}, "function" == typeof define && define.amd ? define("eventEmitter/EventEmitter", [], function () {
177		return e
178	}) : "object" == typeof module && module.exports ? module.exports = e : this.EventEmitter = e
179}).call(this), function (e) {
180	function t(t) {
181		var n = e.event;
182		return n.target = n.target || n.srcElement || t, n
183	}
184
185	var n = document.documentElement, i = function () {
186	};
187	n.addEventListener ? i = function (e, t, n) {
188		e.addEventListener(t, n, !1)
189	} : n.attachEvent && (i = function (e, n, i) {
190		e[n + i] = i.handleEvent ? function () {
191			var n = t(e);
192			i.handleEvent.call(i, n)
193		} : function () {
194			var n = t(e);
195			i.call(e, n)
196		}, e.attachEvent("on" + n, e[n + i])
197	});
198	var r = function () {
199	};
200	n.removeEventListener ? r = function (e, t, n) {
201		e.removeEventListener(t, n, !1)
202	} : n.detachEvent && (r = function (e, t, n) {
203		e.detachEvent("on" + t, e[t + n]);
204		try {
205			delete e[t + n]
206		} catch (i) {
207			e[t + n] = void 0
208		}
209	});
210	var o = {bind: i, unbind: r};
211	"function" == typeof define && define.amd ? define("eventie/eventie", o) : e.eventie = o
212}(this), function (e, t) {
213	"function" == typeof define && define.amd ? define(["eventEmitter/EventEmitter", "eventie/eventie"], function (n, i) {
214		return t(e, n, i)
215	}) : "object" == typeof exports ? module.exports = t(e, require("eventEmitter"), require("eventie")) : e.imagesLoaded = t(e, e.EventEmitter, e.eventie)
216}(this, function (e, t, n) {
217	function i(e, t) {
218		for (var n in t)e[n] = t[n];
219		return e
220	}
221
222	function r(e) {
223		return"[object Array]" === d.call(e)
224	}
225
226	function o(e) {
227		var t = [];
228		if (r(e))t = e; else if ("number" == typeof e.length)for (var n = 0, i = e.length; i > n; n++)t.push(e[n]); else t.push(e);
229		return t
230	}
231
232	function s(e, t, n) {
233		if (!(this instanceof s))return new s(e, t);
234		"string" == typeof e && (e = document.querySelectorAll(e)), this.elements = o(e), this.options = i({}, this.options), "function" == typeof t ? n = t : i(this.options, t), n && this.on("always", n), this.getImages(), a && (this.jqDeferred = new a.Deferred);
235		var r = this;
236		setTimeout(function () {
237			r.check()
238		})
239	}
240
241	function c(e) {
242		this.img = e
243	}
244
245	function f(e) {
246		this.src = e, v[e] = this
247	}
248
249	var a = e.jQuery, u = e.console, h = u !== void 0, d = Object.prototype.toString;
250	s.prototype = new t, s.prototype.options = {}, s.prototype.getImages = function () {
251		this.images = [];
252		for (var e = 0, t = this.elements.length; t > e; e++) {
253			var n = this.elements[e];
254			"IMG" === n.nodeName && this.addImage(n);
255			for (var i = n.querySelectorAll("img"), r = 0, o = i.length; o > r; r++) {
256				var s = i[r];
257				this.addImage(s)
258			}
259		}
260	}, s.prototype.addImage = function (e) {
261		var t = new c(e);
262		this.images.push(t)
263	}, s.prototype.check = function () {
264		function e(e, r) {
265			return t.options.debug && h && u.log("confirm", e, r), t.progress(e), n++, n === i && t.complete(), !0
266		}
267
268		var t = this, n = 0, i = this.images.length;
269		if (this.hasAnyBroken = !1, !i)return this.complete(), void 0;
270		for (var r = 0; i > r; r++) {
271			var o = this.images[r];
272			o.on("confirm", e), o.check()
273		}
274	}, s.prototype.progress = function (e) {
275		this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded;
276		var t = this;
277		setTimeout(function () {
278			t.emit("progress", t, e), t.jqDeferred && t.jqDeferred.notify && t.jqDeferred.notify(t, e)
279		})
280	}, s.prototype.complete = function () {
281		var e = this.hasAnyBroken ? "fail" : "done";
282		this.isComplete = !0;
283		var t = this;
284		setTimeout(function () {
285			if (t.emit(e, t), t.emit("always", t), t.jqDeferred) {
286				var n = t.hasAnyBroken ? "reject" : "resolve";
287				t.jqDeferred[n](t)
288			}
289		})
290	}, a && (a.fn.imagesLoaded = function (e, t) {
291		var n = new s(this, e, t);
292		return n.jqDeferred.promise(a(this))
293	}), c.prototype = new t, c.prototype.check = function () {
294		var e = v[this.img.src] || new f(this.img.src);
295		if (e.isConfirmed)return this.confirm(e.isLoaded, "cached was confirmed"), void 0;
296		if (this.img.complete && void 0 !== this.img.naturalWidth)return this.confirm(0 !== this.img.naturalWidth, "naturalWidth"), void 0;
297		var t = this;
298		e.on("confirm", function (e, n) {
299			return t.confirm(e.isLoaded, n), !0
300		}), e.check()
301	}, c.prototype.confirm = function (e, t) {
302		this.isLoaded = e, this.emit("confirm", this, t)
303	};
304	var v = {};
305	return f.prototype = new t, f.prototype.check = function () {
306		if (!this.isChecked) {
307			var e = new Image;
308			n.bind(e, "load", this), n.bind(e, "error", this), e.src = this.src, this.isChecked = !0
309		}
310	}, f.prototype.handleEvent = function (e) {
311		var t = "on" + e.type;
312		this[t] && this[t](e)
313	}, f.prototype.onload = function (e) {
314		this.confirm(!0, "onload"), this.unbindProxyEvents(e)
315	}, f.prototype.onerror = function (e) {
316		this.confirm(!1, "onerror"), this.unbindProxyEvents(e)
317	}, f.prototype.confirm = function (e, t) {
318		this.isConfirmed = !0, this.isLoaded = e, this.emit("confirm", this, t)
319	}, f.prototype.unbindProxyEvents = function (e) {
320		n.unbind(e.target, "load", this), n.unbind(e.target, "error", this)
321	}, s
322});
323/*!
324 * jQuery Bully Plugin v0.1.4
325 * Examples and documentation at http://pixelgrade.github.io/rellax/
326 * Copyright (c) 2016 Pixelgrade https://pixelgrade.com
327 * Licensed under MIT http://www.opensource.org/licenses/mit-license.php/
328 */
329;(
330	function( $, window, document, undefined ) {
331
332		var $window = $( window ),
333			windowHeight = $window.height(),
334			elements = [],
335			$bully,
336			$current,
337			lastScrollY = (window.pageYOffset || document.documentElement.scrollTop)  - (document.documentElement.clientTop || 0),
338			current = 0,
339			inversed = false,
340			frameRendered = true;
341
342		$bully = $( '<div class="c-bully">' ).appendTo( 'body' );
343		$current = $( '<div class="c-bully__bullet c-bully__bullet--active">' ).appendTo( $bully );
344
345		function update() {
346			if ( frameRendered !== true ) {
347
348				var count = 0,
349					inverse = false;
350
351				$.each( elements, function( i, element ) {
352					if ( lastScrollY >= element.offset.top - windowHeight / 2 ) {
353						count = count + 1;
354						inverse = lastScrollY < element.offset.top + element.height - windowHeight / 2;
355					}
356				} );
357
358				if ( inversed !== inverse ) {
359					inversed = inverse;
360					$bully.toggleClass( 'c-bully--inversed', inversed );
361				}
362
363				if ( count !== current ) {
364					var offset = $bully.children( '.c-bully__bullet' ).not( '.c-bully__bullet--active' ).first().outerHeight( true ) * (
365							count - 1
366						);
367					$current.removeClass( 'c-bully__bullet--squash' );
368					setTimeout( function() {
369						$current.addClass( 'c-bully__bullet--squash' );
370					} );
371					$current.css( 'top', offset );
372					current = count;
373				}
374			}
375
376			window.requestAnimationFrame( update );
377			frameRendered = true;
378		}
379
380		update();
381
382		function reloadAll() {
383			$.each( elements, function( i, element ) {
384				element._reloadElement();
385			} );
386		}
387
388		function staggerClass( $elements, classname, timeout ) {
389
390			$.each( $elements, function( i, obj ) {
391
392				var stagger = i * timeout;
393
394				setTimeout( function() {
395					obj.$bullet.addClass( classname );
396				}, stagger );
397			} );
398		}
399
400		$window.on( 'load', function( e ) {
401			staggerClass( elements, 'c-bully__bullet--pop', 400 );
402			frameRendered = false;
403		} );
404
405		$window.on( 'scroll', function( e ) {
406			if ( frameRendered === true ) {
407				lastScrollY = (window.pageYOffset || document.documentElement.scrollTop)  - (document.documentElement.clientTop || 0);
408			}
409			frameRendered = false;
410		} );
411
412		$window.on( 'load resize', function() {
413			reloadAll();
414		} );
415
416		function Bully( element, options ) {
417			this.element = element;
418			this.options = $.extend( {}, $.fn.bully.defaults, options );
419
420			var self = this,
421				$bullet = $( '<div class="c-bully__bullet">' );
422
423			$bullet.data( 'bully-data', self ).appendTo( $bully );
424			$bullet.on( 'click', function( event ) {
425				event.preventDefault();
426				event.stopPropagation();
427
428				self.onClick();
429			} );
430
431			this.$bullet = $bullet;
432
433			self._reloadElement();
434			elements.push( self );
435			current = 0;
436		}
437
438		Bully.prototype.constructor = Bully;
439
440		Bully.prototype._reloadElement = function() {
441			// for some strange reason Customizer reload makes jQuery's .offset() to fail
442			var self = this,
443				box = {
444					top: 0,
445					left: 0
446				};
447
448			// quickfix: replicate .offset() logic here
449			if ( typeof self.element.getBoundingClientRect !== "undefined" ) {
450				box = self.element.getBoundingClientRect();
451			}
452
453			self.offset = {
454				top: box.top + (window.pageYOffset || self.element.scrollTop) - (self.element.clientTop || 0),
455				left: box.left + (window.pageXOffset || self.element.scrollLeft) - (self.element.clientLeft || 0)
456			};
457			self.height = $( self.element ).outerHeight();
458		};
459
460		Bully.prototype.onClick = function() {
461
462			var self = this,
463				$target = $( 'html, body' );
464
465			if ( self.options.scrollDuration == 0 ) {
466				$target.scrollTop( self.offset.top );
467				return;
468			}
469
470			if ( self.options.scrollDuration === 'auto' ) {
471				var duration = Math.abs( lastScrollY - self.offset.top ) / (
472				               self.options.scrollPerSecond / 1000
473					);
474				$target.animate( {scrollTop: self.offset.top}, duration );
475				return;
476			}
477
478			$target.animate( {scrollTop: self.offset.top}, self.options.scrollDuration );
479		};
480
481		$.fn.bully = function( options ) {
482			return this.each( function() {
483				if ( ! $.data( this, "plugin_" + Bully ) ) {
484					$.data( this, "plugin_" + Bully, new Bully( this, options ) );
485				}
486			} );
487		};
488
489		$.fn.bully.defaults = {
490			scrollDuration: 'auto',
491			scrollPerSecond: 4000
492		};
493
494		$window.on( 'rellax rellax:restart load', reloadAll );
495
496
497	}
498)( jQuery, window, document );
499
500/*! Magnific Popup - v1.1.0 - 2016-02-20
501 * http://dimsemenov.com/plugins/magnific-popup/
502 * Copyright (c) 2016 Dmitry Semenov; */
503;(function (factory) {
504	if (typeof define === 'function' && define.amd) {
505		// AMD. Register as an anonymous module.
506		define(['jquery'], factory);
507	} else if (typeof exports === 'object') {
508		// Node/CommonJS
509		factory(require('jquery'));
510	} else {
511		// Browser globals
512		factory(window.jQuery || window.Zepto);
513	}
514}(function($) {
515
516	/*>>core*/
517	/**
518	 *
519	 * Magnific Popup Core JS file
520	 *
521	 */
522
523
524	/**
525	 * Private static constants
526	 */
527	var CLOSE_EVENT = 'Close',
528		BEFORE_CLOSE_EVENT = 'BeforeClose',
529		AFTER_CLOSE_EVENT = 'AfterClose',
530		BEFORE_APPEND_EVENT = 'BeforeAppend',
531		MARKUP_PARSE_EVENT = 'MarkupParse',
532		OPEN_EVENT = 'Open',
533		CHANGE_EVENT = 'Change',
534		NS = 'mfp',
535		EVENT_NS = '.' + NS,
536		READY_CLASS = 'mfp-ready',
537		REMOVING_CLASS = 'mfp-removing',
538		PREVENT_CLOSE_CLASS = 'mfp-prevent-close';
539
540
541	/**
542	 * Private vars
543	 */
544	/*jshint -W079 */
545	var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
546		MagnificPopup = function(){},
547		_isJQ = !!(window.jQuery),
548		_prevStatus,
549		_window = $(window),
550		_document,
551		_prevContentType,
552		_wrapClasses,
553		_currPopupType;
554
555
556	/**
557	 * Private functions
558	 */
559	var _mfpOn = function(name, f) {
560			mfp.ev.on(NS + name + EVENT_NS, f);
561		},
562		_getEl = function(className, appendTo, html, raw) {
563			var el = document.createElement('div');
564			el.className = 'mfp-'+className;
565			if(html) {
566				el.innerHTML = html;
567			}
568			if(!raw) {
569				el = $(el);
570				if(appendTo) {
571					el.appendTo(appendTo);
572				}
573			} else if(appendTo) {
574				appendTo.appendChild(el);
575			}
576			return el;
577		},
578		_mfpTrigger = function(e, data) {
579			mfp.ev.triggerHandler(NS + e, data);
580
581			if(mfp.st.callbacks) {
582				// converts "mfpEventName" to "eventName" callback and triggers it if it's present
583				e = e.charAt(0).toLowerCase() + e.slice(1);
584				if(mfp.st.callbacks[e]) {
585					mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
586				}
587			}
588		},
589		_getCloseBtn = function(type) {
590			if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
591				mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
592				_currPopupType = type;
593			}
594			return mfp.currTemplate.closeBtn;
595		},
596		// Initialize Magnific Popup only when called at least once
597		_checkInstance = function() {
598			if(!$.magnificPopup.instance) {
599				/*jshint -W020 */
600				mfp = new MagnificPopup();
601				mfp.init();
602				$.magnificPopup.instance = mfp;
603			}
604		},
605		// CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
606		supportsTransitions = function() {
607			var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
608				v = ['ms','O','Moz','Webkit']; // 'v' for vendor
609
610			if( s['transition'] !== undefined ) {
611				return true;
612			}
613
614			while( v.length ) {
615				if( v.pop() + 'Transition' in s ) {
616					return true;
617				}
618			}
619
620			return false;
vendor: 40,046 bytes, lines 621-2359
621		};
622
623
624
625	/**
626	 * Public functions
627	 */
628	MagnificPopup.prototype = {
629
630		constructor: MagnificPopup,
631
632		/**
633		 * Initializes Magnific Popup plugin.
634		 * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
635		 */
636		init: function() {
637			var appVersion = navigator.appVersion;
638			mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;
639			mfp.isAndroid = (/android/gi).test(appVersion);
640			mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
641			mfp.supportsTransition = supportsTransitions();
642
643			// We disable fixed positioned lightbox on devices that don't handle it nicely.
644			// If you know a better way of detecting this - let me know.
645			mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
646			_document = $(document);
647
648			mfp.popupsCache = {};
649		},
650
651		/**
652		 * Opens popup
653		 * @param  data [description]
654		 */
655		open: function(data) {
656
657			var i;
658
659			if(data.isObj === false) {
660				// convert jQuery collection to array to avoid conflicts later
661				mfp.items = data.items.toArray();
662
663				mfp.index = 0;
664				var items = data.items,
665					item;
666				for(i = 0; i < items.length; i++) {
667					item = items[i];
668					if(item.parsed) {
669						item = item.el[0];
670					}
671					if(item === data.el[0]) {
672						mfp.index = i;
673						break;
674					}
675				}
676			} else {
677				mfp.items = $.isArray(data.items) ? data.items : [data.items];
678				mfp.index = data.index || 0;
679			}
680
681			// if popup is already opened - we just update the content
682			if(mfp.isOpen) {
683				mfp.updateItemHTML();
684				return;
685			}
686
687			mfp.types = [];
688			_wrapClasses = '';
689			if(data.mainEl && data.mainEl.length) {
690				mfp.ev = data.mainEl.eq(0);
691			} else {
692				mfp.ev = _document;
693			}
694
695			if(data.key) {
696				if(!mfp.popupsCache[data.key]) {
697					mfp.popupsCache[data.key] = {};
698				}
699				mfp.currTemplate = mfp.popupsCache[data.key];
700			} else {
701				mfp.currTemplate = {};
702			}
703
704
705
706			mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
707			mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
708
709			if(mfp.st.modal) {
710				mfp.st.closeOnContentClick = false;
711				mfp.st.closeOnBgClick = false;
712				mfp.st.showCloseBtn = false;
713				mfp.st.enableEscapeKey = false;
714			}
715
716
717			// Building markup
718			// main containers are created only once
719			if(!mfp.bgOverlay) {
720
721				// Dark overlay
722				mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
723					mfp.close();
724				});
725
726				mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
727					if(mfp._checkIfClose(e.target)) {
728						mfp.close();
729					}
730				});
731
732				mfp.container = _getEl('container', mfp.wrap);
733			}
734
735			mfp.contentContainer = _getEl('content');
736			if(mfp.st.preloader) {
737				mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
738			}
739
740
741			// Initializing modules
742			var modules = $.magnificPopup.modules;
743			for(i = 0; i < modules.length; i++) {
744				var n = modules[i];
745				n = n.charAt(0).toUpperCase() + n.slice(1);
746				mfp['init'+n].call(mfp);
747			}
748			_mfpTrigger('BeforeOpen');
749
750
751			if(mfp.st.showCloseBtn) {
752				// Close button
753				if(!mfp.st.closeBtnInside) {
754					mfp.wrap.append( _getCloseBtn() );
755				} else {
756					_mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
757						values.close_replaceWith = _getCloseBtn(item.type);
758					});
759					_wrapClasses += ' mfp-close-btn-in';
760				}
761			}
762
763			if(mfp.st.alignTop) {
764				_wrapClasses += ' mfp-align-top';
765			}
766
767
768
769			if(mfp.fixedContentPos) {
770				mfp.wrap.css({
771					overflow: mfp.st.overflowY,
772					overflowX: 'hidden',
773					overflowY: mfp.st.overflowY
774				});
775			} else {
776				mfp.wrap.css({
777					top: _window.scrollTop(),
778					position: 'absolute'
779				});
780			}
781			if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
782				mfp.bgOverlay.css({
783					height: _document.height(),
784					position: 'absolute'
785				});
786			}
787
788
789
790			if(mfp.st.enableEscapeKey) {
791				// Close on ESC key
792				_document.on('keyup' + EVENT_NS, function(e) {
793					if(e.keyCode === 27) {
794						mfp.close();
795					}
796				});
797			}
798
799			_window.on('resize' + EVENT_NS, function() {
800				mfp.updateSize();
801			});
802
803
804			if(!mfp.st.closeOnContentClick) {
805				_wrapClasses += ' mfp-auto-cursor';
806			}
807
808			if(_wrapClasses)
809				mfp.wrap.addClass(_wrapClasses);
810
811
812			// this triggers recalculation of layout, so we get it once to not to trigger twice
813			var windowHeight = mfp.wH = _window.height();
814
815
816			var windowStyles = {};
817
818			if( mfp.fixedContentPos ) {
819				if(mfp._hasScrollBar(windowHeight)){
820					var s = mfp._getScrollbarSize();
821					if(s) {
822						windowStyles.marginRight = s;
823					}
824				}
825			}
826
827			if(mfp.fixedContentPos) {
828				if(!mfp.isIE7) {
829					windowStyles.overflow = 'hidden';
830				} else {
831					// ie7 double-scroll bug
832					$('body, html').css('overflow', 'hidden');
833				}
834			}
835
836
837
838			var classesToadd = mfp.st.mainClass;
839			if(mfp.isIE7) {
840				classesToadd += ' mfp-ie7';
841			}
842			if(classesToadd) {
843				mfp._addClassToMFP( classesToadd );
844			}
845
846			// add content
847			mfp.updateItemHTML();
848
849			_mfpTrigger('BuildControls');
850
851			// remove scrollbar, add margin e.t.c
852			$('html').css(windowStyles);
853
854			// add everything to DOM
855			mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );
856
857			// Save last focused element
858			mfp._lastFocusedEl = document.activeElement;
859
860			// Wait for next cycle to allow CSS transition
861			setTimeout(function() {
862
863				if(mfp.content) {
864					mfp._addClassToMFP(READY_CLASS);
865					mfp._setFocus();
866				} else {
867					// if content is not defined (not loaded e.t.c) we add class only for BG
868					mfp.bgOverlay.addClass(READY_CLASS);
869				}
870
871				// Trap the focus in popup
872				_document.on('focusin' + EVENT_NS, mfp._onFocusIn);
873
874			}, 16);
875
876			mfp.isOpen = true;
877			mfp.updateSize(windowHeight);
878			_mfpTrigger(OPEN_EVENT);
879
880			return data;
881		},
882
883		/**
884		 * Closes the popup
885		 */
886		close: function() {
887			if(!mfp.isOpen) return;
888			_mfpTrigger(BEFORE_CLOSE_EVENT);
889
890			mfp.isOpen = false;
891			// for CSS3 animation
892			if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition )  {
893				mfp._addClassToMFP(REMOVING_CLASS);
894				setTimeout(function() {
895					mfp._close();
896				}, mfp.st.removalDelay);
897			} else {
898				mfp._close();
899			}
900		},
901
902		/**
903		 * Helper for close() function
904		 */
905		_close: function() {
906			_mfpTrigger(CLOSE_EVENT);
907
908			var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
909
910			mfp.bgOverlay.detach();
911			mfp.wrap.detach();
912			mfp.container.empty();
913
914			if(mfp.st.mainClass) {
915				classesToRemove += mfp.st.mainClass + ' ';
916			}
917
918			mfp._removeClassFromMFP(classesToRemove);
919
920			if(mfp.fixedContentPos) {
921				var windowStyles = {marginRight: ''};
922				if(mfp.isIE7) {
923					$('body, html').css('overflow', '');
924				} else {
925					windowStyles.overflow = '';
926				}
927				$('html').css(windowStyles);
928			}
929
930			_document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
931			mfp.ev.off(EVENT_NS);
932
933			// clean up DOM elements that aren't removed
934			mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
935			mfp.bgOverlay.attr('class', 'mfp-bg');
936			mfp.container.attr('class', 'mfp-container');
937
938			// remove close button from target element
939			if(mfp.st.showCloseBtn &&
940			   (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
941				if(mfp.currTemplate.closeBtn)
942					mfp.currTemplate.closeBtn.detach();
943			}
944
945
946			if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
947				$(mfp._lastFocusedEl).focus(); // put tab focus back
948			}
949			mfp.currItem = null;
950			mfp.content = null;
951			mfp.currTemplate = null;
952			mfp.prevHeight = 0;
953
954			_mfpTrigger(AFTER_CLOSE_EVENT);
955		},
956
957		updateSize: function(winHeight) {
958
959			if(mfp.isIOS) {
960				// fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
961				var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
962				var height = window.innerHeight * zoomLevel;
963				mfp.wrap.css('height', height);
964				mfp.wH = height;
965			} else {
966				mfp.wH = winHeight || _window.height();
967			}
968			// Fixes #84: popup incorrectly positioned with position:relative on body
969			if(!mfp.fixedContentPos) {
970				mfp.wrap.css('height', mfp.wH);
971			}
972
973			_mfpTrigger('Resize');
974
975		},
976
977		/**
978		 * Set content of popup based on current index
979		 */
980		updateItemHTML: function() {
981			var item = mfp.items[mfp.index];
982
983			// Detach and perform modifications
984			mfp.contentContainer.detach();
985
986			if(mfp.content)
987				mfp.content.detach();
988
989			if(!item.parsed) {
990				item = mfp.parseEl( mfp.index );
991			}
992
993			var type = item.type;
994
995			_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
996			// BeforeChange event works like so:
997			// _mfpOn('BeforeChange', function(e, prevType, newType) { });
998
999			mfp.currItem = item;
1000
1001			if(!mfp.currTemplate[type]) {
1002				var markup = mfp.st[type] ? mfp.st[type].markup : false;
1003
1004				// allows to modify markup
1005				_mfpTrigger('FirstMarkupParse', markup);
1006
1007				if(markup) {
1008					mfp.currTemplate[type] = $(markup);
1009				} else {
1010					// if there is no markup found we just define that template is parsed
1011					mfp.currTemplate[type] = true;
1012				}
1013			}
1014
1015			if(_prevContentType && _prevContentType !== item.type) {
1016				mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
1017			}
1018
1019			var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
1020			mfp.appendContent(newContent, type);
1021
1022			item.preloaded = true;
1023
1024			_mfpTrigger(CHANGE_EVENT, item);
1025			_prevContentType = item.type;
1026
1027			// Append container back after its content changed
1028			mfp.container.prepend(mfp.contentContainer);
1029
1030			_mfpTrigger('AfterChange');
1031		},
1032
1033
1034		/**
1035		 * Set HTML content of popup
1036		 */
1037		appendContent: function(newContent, type) {
1038			mfp.content = newContent;
1039
1040			if(newContent) {
1041				if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
1042				   mfp.currTemplate[type] === true) {
1043					// if there is no markup, we just append close button element inside
1044					if(!mfp.content.find('.mfp-close').length) {
1045						mfp.content.append(_getCloseBtn());
1046					}
1047				} else {
1048					mfp.content = newContent;
1049				}
1050			} else {
1051				mfp.content = '';
1052			}
1053
1054			_mfpTrigger(BEFORE_APPEND_EVENT);
1055			mfp.container.addClass('mfp-'+type+'-holder');
1056
1057			mfp.contentContainer.append(mfp.content);
1058		},
1059
1060
1061		/**
1062		 * Creates Magnific Popup data object based on given data
1063		 * @param  {int} index Index of item to parse
1064		 */
1065		parseEl: function(index) {
1066			var item = mfp.items[index],
1067				type;
1068
1069			if(item.tagName) {
1070				item = { el: $(item) };
1071			} else {
1072				type = item.type;
1073				item = { data: item, src: item.src };
1074			}
1075
1076			if(item.el) {
1077				var types = mfp.types;
1078
1079				// check for 'mfp-TYPE' class
1080				for(var i = 0; i < types.length; i++) {
1081					if( item.el.hasClass('mfp-'+types[i]) ) {
1082						type = types[i];
1083						break;
1084					}
1085				}
1086
1087				item.src = item.el.attr('data-mfp-src');
1088				if(!item.src) {
1089					item.src = item.el.attr('href');
1090				}
1091			}
1092
1093			item.type = type || mfp.st.type || 'inline';
1094			item.index = index;
1095			item.parsed = true;
1096			mfp.items[index] = item;
1097			_mfpTrigger('ElementParse', item);
1098
1099			return mfp.items[index];
1100		},
1101
1102
1103		/**
1104		 * Initializes single popup or a group of popups
1105		 */
1106		addGroup: function(el, options) {
1107			var eHandler = function(e) {
1108				e.mfpEl = this;
1109				mfp._openClick(e, el, options);
1110			};
1111
1112			if(!options) {
1113				options = {};
1114			}
1115
1116			var eName = 'click.magnificPopup';
1117			options.mainEl = el;
1118
1119			if(options.items) {
1120				options.isObj = true;
1121				el.off(eName).on(eName, eHandler);
1122			} else {
1123				options.isObj = false;
1124				if(options.delegate) {
1125					el.off(eName).on(eName, options.delegate , eHandler);
1126				} else {
1127					options.items = el;
1128					el.off(eName).on(eName, eHandler);
1129				}
1130			}
1131		},
1132		_openClick: function(e, el, options) {
1133			var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
1134
1135
1136			if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
1137				return;
1138			}
1139
1140			var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
1141
1142			if(disableOn) {
1143				if($.isFunction(disableOn)) {
1144					if( !disableOn.call(mfp) ) {
1145						return true;
1146					}
1147				} else { // else it's number
1148					if( _window.width() < disableOn ) {
1149						return true;
1150					}
1151				}
1152			}
1153
1154			if(e.type) {
1155				e.preventDefault();
1156
1157				// This will prevent popup from closing if element is inside and popup is already opened
1158				if(mfp.isOpen) {
1159					e.stopPropagation();
1160				}
1161			}
1162
1163			options.el = $(e.mfpEl);
1164			if(options.delegate) {
1165				options.items = el.find(options.delegate);
1166			}
1167			mfp.open(options);
1168		},
1169
1170
1171		/**
1172		 * Updates text on preloader
1173		 */
1174		updateStatus: function(status, text) {
1175
1176			if(mfp.preloader) {
1177				if(_prevStatus !== status) {
1178					mfp.container.removeClass('mfp-s-'+_prevStatus);
1179				}
1180
1181				if(!text && status === 'loading') {
1182					text = mfp.st.tLoading;
1183				}
1184
1185				var data = {
1186					status: status,
1187					text: text
1188				};
1189				// allows to modify status
1190				_mfpTrigger('UpdateStatus', data);
1191
1192				status = data.status;
1193				text = data.text;
1194
1195				mfp.preloader.html(text);
1196
1197				mfp.preloader.find('a').on('click', function(e) {
1198					e.stopImmediatePropagation();
1199				});
1200
1201				mfp.container.addClass('mfp-s-'+status);
1202				_prevStatus = status;
1203			}
1204		},
1205
1206
1207		/*
1208		 "Private" helpers that aren't private at all
1209		 */
1210		// Check to close popup or not
1211		// "target" is an element that was clicked
1212		_checkIfClose: function(target) {
1213
1214			if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
1215				return;
1216			}
1217
1218			var closeOnContent = mfp.st.closeOnContentClick;
1219			var closeOnBg = mfp.st.closeOnBgClick;
1220
1221			if(closeOnContent && closeOnBg) {
1222				return true;
1223			} else {
1224
1225				// We close the popup if click is on close button or on preloader. Or if there is no content.
1226				if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {
1227					return true;
1228				}
1229
1230				// if click is outside the content
1231				if(  (target !== mfp.content[0] && !$.contains(mfp.content[0], target))  ) {
1232					if(closeOnBg) {
1233						// last check, if the clicked element is in DOM, (in case it's removed onclick)
1234						if( $.contains(document, target) ) {
1235							return true;
1236						}
1237					}
1238				} else if(closeOnContent) {
1239					return true;
1240				}
1241
1242			}
1243			return false;
1244		},
1245		_addClassToMFP: function(cName) {
1246			mfp.bgOverlay.addClass(cName);
1247			mfp.wrap.addClass(cName);
1248		},
1249		_removeClassFromMFP: function(cName) {
1250			this.bgOverlay.removeClass(cName);
1251			mfp.wrap.removeClass(cName);
1252		},
1253		_hasScrollBar: function(winHeight) {
1254			return (  (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
1255		},
1256		_setFocus: function() {
1257			(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
1258		},
1259		_onFocusIn: function(e) {
1260			if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
1261				mfp._setFocus();
1262				return false;
1263			}
1264		},
1265		_parseMarkup: function(template, values, item) {
1266			var arr;
1267			if(item.data) {
1268				values = $.extend(item.data, values);
1269			}
1270			_mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );
1271
1272			$.each(values, function(key, value) {
1273				if(value === undefined || value === false) {
1274					return true;
1275				}
1276				arr = key.split('_');
1277				if(arr.length > 1) {
1278					var el = template.find(EVENT_NS + '-'+arr[0]);
1279
1280					if(el.length > 0) {
1281						var attr = arr[1];
1282						if(attr === 'replaceWith') {
1283							if(el[0] !== value[0]) {
1284								el.replaceWith(value);
1285							}
1286						} else if(attr === 'img') {
1287							if(el.is('img')) {
1288								el.attr('src', value);
1289							} else {
1290								el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
1291							}
1292						} else {
1293							el.attr(arr[1], value);
1294						}
1295					}
1296
1297				} else {
1298					template.find(EVENT_NS + '-'+key).html(value);
1299				}
1300			});
1301		},
1302
1303		_getScrollbarSize: function() {
1304			// thx David
1305			if(mfp.scrollbarSize === undefined) {
1306				var scrollDiv = document.createElement("div");
1307				scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
1308				document.body.appendChild(scrollDiv);
1309				mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
1310				document.body.removeChild(scrollDiv);
1311			}
1312			return mfp.scrollbarSize;
1313		}
1314
1315	}; /* MagnificPopup core prototype end */
1316
1317
1318
1319
1320	/**
1321	 * Public static functions
1322	 */
1323	$.magnificPopup = {
1324		instance: null,
1325		proto: MagnificPopup.prototype,
1326		modules: [],
1327
1328		open: function(options, index) {
1329			_checkInstance();
1330
1331			if(!options) {
1332				options = {};
1333			} else {
1334				options = $.extend(true, {}, options);
1335			}
1336
1337			options.isObj = true;
1338			options.index = index || 0;
1339			return this.instance.open(options);
1340		},
1341
1342		close: function() {
1343			return $.magnificPopup.instance && $.magnificPopup.instance.close();
1344		},
1345
1346		registerModule: function(name, module) {
1347			if(module.options) {
1348				$.magnificPopup.defaults[name] = module.options;
1349			}
1350			$.extend(this.proto, module.proto);
1351			this.modules.push(name);
1352		},
1353
1354		defaults: {
1355
1356			// Info about options is in docs:
1357			// http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
1358
1359			disableOn: 0,
1360
1361			key: null,
1362
1363			midClick: false,
1364
1365			mainClass: '',
1366
1367			preloader: true,
1368
1369			focus: '', // CSS selector of input to focus after popup is opened
1370
1371			closeOnContentClick: false,
1372
1373			closeOnBgClick: true,
1374
1375			closeBtnInside: true,
1376
1377			showCloseBtn: true,
1378
1379			enableEscapeKey: true,
1380
1381			modal: false,
1382
1383			alignTop: false,
1384
1385			removalDelay: 0,
1386
1387			prependTo: null,
1388
1389			fixedContentPos: 'auto',
1390
1391			fixedBgPos: 'auto',
1392
1393			overflowY: 'auto',
1394
1395			closeMarkup: '<button title="%title%" type="button" class="mfp-close">&#215;</button>',
1396
1397			tClose: 'Close (Esc)',
1398
1399			tLoading: 'Loading...',
1400
1401			autoFocusLast: true
1402
1403		}
1404	};
1405
1406
1407
1408	$.fn.magnificPopup = function(options) {
1409		_checkInstance();
1410
1411		var jqEl = $(this);
1412
1413		// We call some API method of first param is a string
1414		if (typeof options === "string" ) {
1415
1416			if(options === 'open') {
1417				var items,
1418					itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,
1419					index = parseInt(arguments[1], 10) || 0;
1420
1421				if(itemOpts.items) {
1422					items = itemOpts.items[index];
1423				} else {
1424					items = jqEl;
1425					if(itemOpts.delegate) {
1426						items = items.find(itemOpts.delegate);
1427					}
1428					items = items.eq( index );
1429				}
1430				mfp._openClick({mfpEl:items}, jqEl, itemOpts);
1431			} else {
1432				if(mfp.isOpen)
1433					mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
1434			}
1435
1436		} else {
1437			// clone options obj
1438			options = $.extend(true, {}, options);
1439
1440			/*
1441			 * As Zepto doesn't support .data() method for objects
1442			 * and it works only in normal browsers
1443			 * we assign "options" object directly to the DOM element. FTW!
1444			 */
1445			if(_isJQ) {
1446				jqEl.data('magnificPopup', options);
1447			} else {
1448				jqEl[0].magnificPopup = options;
1449			}
1450
1451			mfp.addGroup(jqEl, options);
1452
1453		}
1454		return jqEl;
1455	};
1456
1457	/*>>core*/
1458
1459	/*>>inline*/
1460
1461	var INLINE_NS = 'inline',
1462		_hiddenClass,
1463		_inlinePlaceholder,
1464		_lastInlineElement,
1465		_putInlineElementsBack = function() {
1466			if(_lastInlineElement) {
1467				_inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();
1468				_lastInlineElement = null;
1469			}
1470		};
1471
1472	$.magnificPopup.registerModule(INLINE_NS, {
1473		options: {
1474			hiddenClass: 'hide', // will be appended with `mfp-` prefix
1475			markup: '',
1476			tNotFound: 'Content not found'
1477		},
1478		proto: {
1479
1480			initInline: function() {
1481				mfp.types.push(INLINE_NS);
1482
1483				_mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
1484					_putInlineElementsBack();
1485				});
1486			},
1487
1488			getInline: function(item, template) {
1489
1490				_putInlineElementsBack();
1491
1492				if(item.src) {
1493					var inlineSt = mfp.st.inline,
1494						el = $(item.src);
1495
1496					if(el.length) {
1497
1498						// If target element has parent - we replace it with placeholder and put it back after popup is closed
1499						var parent = el[0].parentNode;
1500						if(parent && parent.tagName) {
1501							if(!_inlinePlaceholder) {
1502								_hiddenClass = inlineSt.hiddenClass;
1503								_inlinePlaceholder = _getEl(_hiddenClass);
1504								_hiddenClass = 'mfp-'+_hiddenClass;
1505							}
1506							// replace target inline element with placeholder
1507							_lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
1508						}
1509
1510						mfp.updateStatus('ready');
1511					} else {
1512						mfp.updateStatus('error', inlineSt.tNotFound);
1513						el = $('<div>');
1514					}
1515
1516					item.inlineElement = el;
1517					return el;
1518				}
1519
1520				mfp.updateStatus('ready');
1521				mfp._parseMarkup(template, {}, item);
1522				return template;
1523			}
1524		}
1525	});
1526
1527	/*>>inline*/
1528
1529	/*>>ajax*/
1530	var AJAX_NS = 'ajax',
1531		_ajaxCur,
1532		_removeAjaxCursor = function() {
1533			if(_ajaxCur) {
1534				$(document.body).removeClass(_ajaxCur);
1535			}
1536		},
1537		_destroyAjaxRequest = function() {
1538			_removeAjaxCursor();
1539			if(mfp.req) {
1540				mfp.req.abort();
1541			}
1542		};
1543
1544	$.magnificPopup.registerModule(AJAX_NS, {
1545
1546		options: {
1547			settings: null,
1548			cursor: 'mfp-ajax-cur',
1549			tError: '<a href="%url%">The content</a> could not be loaded.'
1550		},
1551
1552		proto: {
1553			initAjax: function() {
1554				mfp.types.push(AJAX_NS);
1555				_ajaxCur = mfp.st.ajax.cursor;
1556
1557				_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
1558				_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
1559			},
1560			getAjax: function(item) {
1561
1562				if(_ajaxCur) {
1563					$(document.body).addClass(_ajaxCur);
1564				}
1565
1566				mfp.updateStatus('loading');
1567
1568				var opts = $.extend({
1569					url: item.src,
1570					success: function(data, textStatus, jqXHR) {
1571						var temp = {
1572							data:data,
1573							xhr:jqXHR
1574						};
1575
1576						_mfpTrigger('ParseAjax', temp);
1577
1578						mfp.appendContent( $(temp.data), AJAX_NS );
1579
1580						item.finished = true;
1581
1582						_removeAjaxCursor();
1583
1584						mfp._setFocus();
1585
1586						setTimeout(function() {
1587							mfp.wrap.addClass(READY_CLASS);
1588						}, 16);
1589
1590						mfp.updateStatus('ready');
1591
1592						_mfpTrigger('AjaxContentAdded');
1593					},
1594					error: function() {
1595						_removeAjaxCursor();
1596						item.finished = item.loadError = true;
1597						mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
1598					}
1599				}, mfp.st.ajax.settings);
1600
1601				mfp.req = $.ajax(opts);
1602
1603				return '';
1604			}
1605		}
1606	});
1607
1608	/*>>ajax*/
1609
1610	/*>>image*/
1611	var _imgInterval,
1612		_getTitle = function(item) {
1613			if(item.data && item.data.title !== undefined)
1614				return item.data.title;
1615
1616			var src = mfp.st.image.titleSrc;
1617
1618			if(src) {
1619				if($.isFunction(src)) {
1620					return src.call(mfp, item);
1621				} else if(item.el) {
1622					return item.el.attr(src) || '';
1623				}
1624			}
1625			return '';
1626		};
1627
1628	$.magnificPopup.registerModule('image', {
1629
1630		options: {
1631			markup: '<div class="mfp-figure">'+
1632			        '<div class="mfp-close"></div>'+
1633			        '<figure>'+
1634			        '<div class="mfp-img"></div>'+
1635			        '<figcaption>'+
1636			        '<div class="mfp-bottom-bar">'+
1637			        '<div class="mfp-title"></div>'+
1638			        '<div class="mfp-counter"></div>'+
1639			        '</div>'+
1640			        '</figcaption>'+
1641			        '</figure>'+
1642			        '</div>',
1643			cursor: 'mfp-zoom-out-cur',
1644			titleSrc: 'title',
1645			verticalFit: true,
1646			tError: '<a href="%url%">The image</a> could not be loaded.'
1647		},
1648
1649		proto: {
1650			initImage: function() {
1651				var imgSt = mfp.st.image,
1652					ns = '.image';
1653
1654				mfp.types.push('image');
1655
1656				_mfpOn(OPEN_EVENT+ns, function() {
1657					if(mfp.currItem.type === 'image' && imgSt.cursor) {
1658						$(document.body).addClass(imgSt.cursor);
1659					}
1660				});
1661
1662				_mfpOn(CLOSE_EVENT+ns, function() {
1663					if(imgSt.cursor) {
1664						$(document.body).removeClass(imgSt.cursor);
1665					}
1666					_window.off('resize' + EVENT_NS);
1667				});
1668
1669				_mfpOn('Resize'+ns, mfp.resizeImage);
1670				if(mfp.isLowIE) {
1671					_mfpOn('AfterChange', mfp.resizeImage);
1672				}
1673			},
1674			resizeImage: function() {
1675				var item = mfp.currItem;
1676				if(!item || !item.img) return;
1677
1678				if(mfp.st.image.verticalFit) {
1679					var decr = 0;
1680					// fix box-sizing in ie7/8
1681					if(mfp.isLowIE) {
1682						decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
1683					}
1684					item.img.css('max-height', mfp.wH-decr);
1685				}
1686			},
1687			_onImageHasSize: function(item) {
1688				if(item.img) {
1689
1690					item.hasSize = true;
1691
1692					if(_imgInterval) {
1693						clearInterval(_imgInterval);
1694					}
1695
1696					item.isCheckingImgSize = false;
1697
1698					_mfpTrigger('ImageHasSize', item);
1699
1700					if(item.imgHidden) {
1701						if(mfp.content)
1702							mfp.content.removeClass('mfp-loading');
1703
1704						item.imgHidden = false;
1705					}
1706
1707				}
1708			},
1709
1710			/**
1711			 * Function that loops until the image has size to display elements that rely on it asap
1712			 */
1713			findImageSize: function(item) {
1714
1715				var counter = 0,
1716					img = item.img[0],
1717					mfpSetInterval = function(delay) {
1718
1719						if(_imgInterval) {
1720							clearInterval(_imgInterval);
1721						}
1722						// decelerating interval that checks for size of an image
1723						_imgInterval = setInterval(function() {
1724							if(img.naturalWidth > 0) {
1725								mfp._onImageHasSize(item);
1726								return;
1727							}
1728
1729							if(counter > 200) {
1730								clearInterval(_imgInterval);
1731							}
1732
1733							counter++;
1734							if(counter === 3) {
1735								mfpSetInterval(10);
1736							} else if(counter === 40) {
1737								mfpSetInterval(50);
1738							} else if(counter === 100) {
1739								mfpSetInterval(500);
1740							}
1741						}, delay);
1742					};
1743
1744				mfpSetInterval(1);
1745			},
1746
1747			getImage: function(item, template) {
1748
1749				var guard = 0,
1750
1751					// image load complete handler
1752					onLoadComplete = function() {
1753						if(item) {
1754							if (item.img[0].complete) {
1755								item.img.off('.mfploader');
1756
1757								if(item === mfp.currItem){
1758									mfp._onImageHasSize(item);
1759
1760									mfp.updateStatus('ready');
1761								}
1762
1763								item.hasSize = true;
1764								item.loaded = true;
1765
1766								_mfpTrigger('ImageLoadComplete');
1767
1768							}
1769							else {
1770								// if image complete check fails 200 times (20 sec), we assume that there was an error.
1771								guard++;
1772								if(guard < 200) {
1773									setTimeout(onLoadComplete,100);
1774								} else {
1775									onLoadError();
1776								}
1777							}
1778						}
1779					},
1780
1781					// image error handler
1782					onLoadError = function() {
1783						if(item) {
1784							item.img.off('.mfploader');
1785							if(item === mfp.currItem){
1786								mfp._onImageHasSize(item);
1787								mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1788							}
1789
1790							item.hasSize = true;
1791							item.loaded = true;
1792							item.loadError = true;
1793						}
1794					},
1795					imgSt = mfp.st.image;
1796
1797
1798				var el = template.find('.mfp-img');
1799				if(el.length) {
1800					var img = document.createElement('img');
1801					img.className = 'mfp-img';
1802					if(item.el && item.el.find('img').length) {
1803						img.alt = item.el.find('img').attr('alt');
1804					}
1805					item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
1806					img.src = item.src;
1807
1808					// without clone() "error" event is not firing when IMG is replaced by new IMG
1809					// TODO: find a way to avoid such cloning
1810					if(el.is('img')) {
1811						item.img = item.img.clone();
1812					}
1813
1814					img = item.img[0];
1815					if(img.naturalWidth > 0) {
1816						item.hasSize = true;
1817					} else if(!img.width) {
1818						item.hasSize = false;
1819					}
1820				}
1821
1822				mfp._parseMarkup(template, {
1823					title: _getTitle(item),
1824					img_replaceWith: item.img
1825				}, item);
1826
1827				mfp.resizeImage();
1828
1829				if(item.hasSize) {
1830					if(_imgInterval) clearInterval(_imgInterval);
1831
1832					if(item.loadError) {
1833						template.addClass('mfp-loading');
1834						mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1835					} else {
1836						template.removeClass('mfp-loading');
1837						mfp.updateStatus('ready');
1838					}
1839					return template;
1840				}
1841
1842				mfp.updateStatus('loading');
1843				item.loading = true;
1844
1845				if(!item.hasSize) {
1846					item.imgHidden = true;
1847					template.addClass('mfp-loading');
1848					mfp.findImageSize(item);
1849				}
1850
1851				return template;
1852			}
1853		}
1854	});
1855
1856	/*>>image*/
1857
1858	/*>>zoom*/
1859	var hasMozTransform,
1860		getHasMozTransform = function() {
1861			if(hasMozTransform === undefined) {
1862				hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
1863			}
1864			return hasMozTransform;
1865		};
1866
1867	$.magnificPopup.registerModule('zoom', {
1868
1869		options: {
1870			enabled: false,
1871			easing: 'ease-in-out',
1872			duration: 300,
1873			opener: function(element) {
1874				return element.is('img') ? element : element.find('img');
1875			}
1876		},
1877
1878		proto: {
1879
1880			initZoom: function() {
1881				var zoomSt = mfp.st.zoom,
1882					ns = '.zoom',
1883					image;
1884
1885				if(!zoomSt.enabled || !mfp.supportsTransition) {
1886					return;
1887				}
1888
1889				var duration = zoomSt.duration,
1890					getElToAnimate = function(image) {
1891						var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
1892							transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
1893							cssObj = {
1894								position: 'fixed',
1895								zIndex: 9999,
1896								left: 0,
1897								top: 0,
1898								'-webkit-backface-visibility': 'hidden'
1899							},
1900							t = 'transition';
1901
1902						cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;
1903
1904						newImg.css(cssObj);
1905						return newImg;
1906					},
1907					showMainContent = function() {
1908						mfp.content.css('visibility', 'visible');
1909					},
1910					openTimeout,
1911					animatedImg;
1912
1913				_mfpOn('BuildControls'+ns, function() {
1914					if(mfp._allowZoom()) {
1915
1916						clearTimeout(openTimeout);
1917						mfp.content.css('visibility', 'hidden');
1918
1919						// Basically, all code below does is clones existing image, puts in on top of the current one and animated it
1920
1921						image = mfp._getItemToZoom();
1922
1923						if(!image) {
1924							showMainContent();
1925							return;
1926						}
1927
1928						animatedImg = getElToAnimate(image);
1929
1930						animatedImg.css( mfp._getOffset() );
1931
1932						mfp.wrap.append(animatedImg);
1933
1934						openTimeout = setTimeout(function() {
1935							animatedImg.css( mfp._getOffset( true ) );
1936							openTimeout = setTimeout(function() {
1937
1938								showMainContent();
1939
1940								setTimeout(function() {
1941									animatedImg.remove();
1942									image = animatedImg = null;
1943									_mfpTrigger('ZoomAnimationEnded');
1944								}, 16); // avoid blink when switching images
1945
1946							}, duration); // this timeout equals animation duration
1947
1948						}, 16); // by adding this timeout we avoid short glitch at the beginning of animation
1949
1950
1951						// Lots of timeouts...
1952					}
1953				});
1954				_mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
1955					if(mfp._allowZoom()) {
1956
1957						clearTimeout(openTimeout);
1958
1959						mfp.st.removalDelay = duration;
1960
1961						if(!image) {
1962							image = mfp._getItemToZoom();
1963							if(!image) {
1964								return;
1965							}
1966							animatedImg = getElToAnimate(image);
1967						}
1968
1969						animatedImg.css( mfp._getOffset(true) );
1970						mfp.wrap.append(animatedImg);
1971						mfp.content.css('visibility', 'hidden');
1972
1973						setTimeout(function() {
1974							animatedImg.css( mfp._getOffset() );
1975						}, 16);
1976					}
1977
1978				});
1979
1980				_mfpOn(CLOSE_EVENT+ns, function() {
1981					if(mfp._allowZoom()) {
1982						showMainContent();
1983						if(animatedImg) {
1984							animatedImg.remove();
1985						}
1986						image = null;
1987					}
1988				});
1989			},
1990
1991			_allowZoom: function() {
1992				return mfp.currItem.type === 'image';
1993			},
1994
1995			_getItemToZoom: function() {
1996				if(mfp.currItem.hasSize) {
1997					return mfp.currItem.img;
1998				} else {
1999					return false;
2000				}
2001			},
2002
2003			// Get element postion relative to viewport
2004			_getOffset: function(isLarge) {
2005				var el;
2006				if(isLarge) {
2007					el = mfp.currItem.img;
2008				} else {
2009					el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
2010				}
2011
2012				var offset = el.offset();
2013				var paddingTop = parseInt(el.css('padding-top'),10);
2014				var paddingBottom = parseInt(el.css('padding-bottom'),10);
2015				offset.top -= ( $(window).scrollTop() - paddingTop );
2016
2017
2018				/*
2019
2020				 Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
2021
2022				 */
2023				var obj = {
2024					width: el.width(),
2025					// fix Zepto height+padding issue
2026					height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
2027				};
2028
2029				// I hate to do this, but there is no another option
2030				if( getHasMozTransform() ) {
2031					obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
2032				} else {
2033					obj.left = offset.left;
2034					obj.top = offset.top;
2035				}
2036				return obj;
2037			}
2038
2039		}
2040	});
2041
2042
2043
2044	/*>>zoom*/
2045
2046	/*>>iframe*/
2047
2048	var IFRAME_NS = 'iframe',
2049		_emptyPage = '//about:blank',
2050
2051		_fixIframeBugs = function(isShowing) {
2052			if(mfp.currTemplate[IFRAME_NS]) {
2053				var el = mfp.currTemplate[IFRAME_NS].find('iframe');
2054				if(el.length) {
2055					// reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
2056					if(!isShowing) {
2057						el[0].src = _emptyPage;
2058					}
2059
2060					// IE8 black screen bug fix
2061					if(mfp.isIE8) {
2062						el.css('display', isShowing ? 'block' : 'none');
2063					}
2064				}
2065			}
2066		};
2067
2068	$.magnificPopup.registerModule(IFRAME_NS, {
2069
2070		options: {
2071			markup: '<div class="mfp-iframe-scaler">'+
2072			        '<div class="mfp-close"></div>'+
2073			        '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
2074			        '</div>',
2075
2076			srcAction: 'iframe_src',
2077
2078			// we don't care and support only one default type of URL by default
2079			patterns: {
2080				youtube: {
2081					index: 'youtube.com',
2082					id: 'v=',
2083					src: '//www.youtube.com/embed/%id%?autoplay=1'
2084				},
2085				vimeo: {
2086					index: 'vimeo.com/',
2087					id: '/',
2088					src: '//player.vimeo.com/video/%id%?autoplay=1'
2089				},
2090				gmaps: {
2091					index: '//maps.google.',
2092					src: '%id%&output=embed'
2093				}
2094			}
2095		},
2096
2097		proto: {
2098			initIframe: function() {
2099				mfp.types.push(IFRAME_NS);
2100
2101				_mfpOn('BeforeChange', function(e, prevType, newType) {
2102					if(prevType !== newType) {
2103						if(prevType === IFRAME_NS) {
2104							_fixIframeBugs(); // iframe if removed
2105						} else if(newType === IFRAME_NS) {
2106							_fixIframeBugs(true); // iframe is showing
2107						}
2108					}// else {
2109					// iframe source is switched, don't do anything
2110					//}
2111				});
2112
2113				_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
2114					_fixIframeBugs();
2115				});
2116			},
2117
2118			getIframe: function(item, template) {
2119				var embedSrc = item.src;
2120				var iframeSt = mfp.st.iframe;
2121
2122				$.each(iframeSt.patterns, function() {
2123					if(embedSrc.indexOf( this.index ) > -1) {
2124						if(this.id) {
2125							if(typeof this.id === 'string') {
2126								embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
2127							} else {
2128								embedSrc = this.id.call( this, embedSrc );
2129							}
2130						}
2131						embedSrc = this.src.replace('%id%', embedSrc );
2132						return false; // break;
2133					}
2134				});
2135
2136				var dataObj = {};
2137				if(iframeSt.srcAction) {
2138					dataObj[iframeSt.srcAction] = embedSrc;
2139				}
2140				mfp._parseMarkup(template, dataObj, item);
2141
2142				mfp.updateStatus('ready');
2143
2144				return template;
2145			}
2146		}
2147	});
2148
2149
2150
2151	/*>>iframe*/
2152
2153	/*>>gallery*/
2154	/**
2155	 * Get looped index depending on number of slides
2156	 */
2157	var _getLoopedId = function(index) {
2158			var numSlides = mfp.items.length;
2159			if(index > numSlides - 1) {
2160				return index - numSlides;
2161			} else  if(index < 0) {
2162				return numSlides + index;
2163			}
2164			return index;
2165		},
2166		_replaceCurrTotal = function(text, curr, total) {
2167			return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
2168		};
2169
2170	$.magnificPopup.registerModule('gallery', {
2171
2172		options: {
2173			enabled: false,
2174			arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
2175			preload: [0,2],
2176			navigateByImgClick: true,
2177			arrows: true,
2178
2179			tPrev: 'Previous (Left arrow key)',
2180			tNext: 'Next (Right arrow key)',
2181			tCounter: '%curr% of %total%'
2182		},
2183
2184		proto: {
2185			initGallery: function() {
2186
2187				var gSt = mfp.st.gallery,
2188					ns = '.mfp-gallery';
2189
2190				mfp.direction = true; // true - next, false - prev
2191
2192				if(!gSt || !gSt.enabled ) return false;
2193
2194				_wrapClasses += ' mfp-gallery';
2195
2196				_mfpOn(OPEN_EVENT+ns, function() {
2197
2198					if(gSt.navigateByImgClick) {
2199						mfp.wrap.on('click'+ns, '.mfp-img', function() {
2200							if(mfp.items.length > 1) {
2201								mfp.next();
2202								return false;
2203							}
2204						});
2205					}
2206
2207					_document.on('keydown'+ns, function(e) {
2208						if (e.keyCode === 37) {
2209							mfp.prev();
2210						} else if (e.keyCode === 39) {
2211							mfp.next();
2212						}
2213					});
2214				});
2215
2216				_mfpOn('UpdateStatus'+ns, function(e, data) {
2217					if(data.text) {
2218						data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
2219					}
2220				});
2221
2222				_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
2223					var l = mfp.items.length;
2224					values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
2225				});
2226
2227				_mfpOn('BuildControls' + ns, function() {
2228					if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
2229						var markup = gSt.arrowMarkup,
2230							arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
2231							arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
2232
2233						arrowLeft.click(function() {
2234							mfp.prev();
2235						});
2236						arrowRight.click(function() {
2237							mfp.next();
2238						});
2239
2240						mfp.container.append(arrowLeft.add(arrowRight));
2241					}
2242				});
2243
2244				_mfpOn(CHANGE_EVENT+ns, function() {
2245					if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
2246
2247					mfp._preloadTimeout = setTimeout(function() {
2248						mfp.preloadNearbyImages();
2249						mfp._preloadTimeout = null;
2250					}, 16);
2251				});
2252
2253
2254				_mfpOn(CLOSE_EVENT+ns, function() {
2255					_document.off(ns);
2256					mfp.wrap.off('click'+ns);
2257					mfp.arrowRight = mfp.arrowLeft = null;
2258				});
2259
2260			},
2261			next: function() {
2262				mfp.direction = true;
2263				mfp.index = _getLoopedId(mfp.index + 1);
2264				mfp.updateItemHTML();
2265			},
2266			prev: function() {
2267				mfp.direction = false;
2268				mfp.index = _getLoopedId(mfp.index - 1);
2269				mfp.updateItemHTML();
2270			},
2271			goTo: function(newIndex) {
2272				mfp.direction = (newIndex >= mfp.index);
2273				mfp.index = newIndex;
2274				mfp.updateItemHTML();
2275			},
2276			preloadNearbyImages: function() {
2277				var p = mfp.st.gallery.preload,
2278					preloadBefore = Math.min(p[0], mfp.items.length),
2279					preloadAfter = Math.min(p[1], mfp.items.length),
2280					i;
2281
2282				for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
2283					mfp._preloadItem(mfp.index+i);
2284				}
2285				for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
2286					mfp._preloadItem(mfp.index-i);
2287				}
2288			},
2289			_preloadItem: function(index) {
2290				index = _getLoopedId(index);
2291
2292				if(mfp.items[index].preloaded) {
2293					return;
2294				}
2295
2296				var item = mfp.items[index];
2297				if(!item.parsed) {
2298					item = mfp.parseEl( index );
2299				}
2300
2301				_mfpTrigger('LazyLoad', item);
2302
2303				if(item.type === 'image') {
2304					item.img = $('<img class="mfp-img" />').on('load.mfploader', function() {
2305						item.hasSize = true;
2306					}).on('error.mfploader', function() {
2307						item.hasSize = true;
2308						item.loadError = true;
2309						_mfpTrigger('LazyLoadError', item);
2310					}).attr('src', item.src);
2311				}
2312
2313
2314				item.preloaded = true;
2315			}
2316		}
2317	});
2318
2319	/*>>gallery*/
2320
2321	/*>>retina*/
2322
2323	var RETINA_NS = 'retina';
2324
2325	$.magnificPopup.registerModule(RETINA_NS, {
2326		options: {
2327			replaceSrc: function(item) {
2328				return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
2329			},
2330			ratio: 1 // Function or number.  Set to 1 to disable.
2331		},
2332		proto: {
2333			initRetina: function() {
2334				if(window.devicePixelRatio > 1) {
2335
2336					var st = mfp.st.retina,
2337						ratio = st.ratio;
2338
2339					ratio = !isNaN(ratio) ? ratio : ratio();
2340
2341					if(ratio > 1) {
2342						_mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
2343							item.img.css({
2344								'max-width': item.img[0].naturalWidth / ratio,
2345								'width': '100%'
2346							});
2347						});
2348						_mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
2349							item.src = st.replaceSrc(item, ratio);
2350						});
2351					}
2352				}
2353
2354			}
2355		}
2356	});
2357
2358	/*>>retina*/
2359	_checkInstance(); }));
vendor: 32,144 bytes, lines 2360-2365
2360//! moment.js
2361//! version : 2.13.0
2362//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
2363//! license : MIT
2364//! momentjs.com
2365!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return fd.apply(null,arguments)}function b(a){fd=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function f(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function g(a,b){for(var c in b)f(b,c)&&(a[c]=b[c]);return f(b,"toString")&&(a.toString=b.toString),f(b,"valueOf")&&(a.valueOf=b.valueOf),a}function h(a,b,c,d){return Ja(a,b,c,d,!0).utc()}function i(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function j(a){return null==a._pf&&(a._pf=i()),a._pf}function k(a){if(null==a._isValid){var b=j(a),c=gd.call(b.parsedDateParts,function(a){return null!=a});a._isValid=!isNaN(a._d.getTime())&&b.overflow<0&&!b.empty&&!b.invalidMonth&&!b.invalidWeekday&&!b.nullInput&&!b.invalidFormat&&!b.userInvalidated&&(!b.meridiem||b.meridiem&&c),a._strict&&(a._isValid=a._isValid&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour)}return a._isValid}function l(a){var b=h(NaN);return null!=a?g(j(b),a):j(b).userInvalidated=!0,b}function m(a){return void 0===a}function n(a,b){var c,d,e;if(m(b._isAMomentObject)||(a._isAMomentObject=b._isAMomentObject),m(b._i)||(a._i=b._i),m(b._f)||(a._f=b._f),m(b._l)||(a._l=b._l),m(b._strict)||(a._strict=b._strict),m(b._tzm)||(a._tzm=b._tzm),m(b._isUTC)||(a._isUTC=b._isUTC),m(b._offset)||(a._offset=b._offset),m(b._pf)||(a._pf=j(b)),m(b._locale)||(a._locale=b._locale),hd.length>0)for(c in hd)d=hd[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),id===!1&&(id=!0,a.updateOffset(this),id=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function u(b,c){var d=!0;return g(function(){return null!=a.deprecationHandler&&a.deprecationHandler(null,b),d&&(t(b+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),d=!1),c.apply(this,arguments)},c)}function v(b,c){null!=a.deprecationHandler&&a.deprecationHandler(b,c),jd[b]||(t(c),jd[b]=!0)}function w(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function x(a){return"[object Object]"===Object.prototype.toString.call(a)}function y(a){var b,c;for(c in a)b=a[c],w(b)?this[c]=b:this["_"+c]=b;this._config=a,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function z(a,b){var c,d=g({},a);for(c in b)f(b,c)&&(x(a[c])&&x(b[c])?(d[c]={},g(d[c],a[c]),g(d[c],b[c])):null!=b[c]?d[c]=b[c]:delete d[c]);return d}function A(a){null!=a&&this.set(a)}function B(a){return a?a.toLowerCase().replace("_","-"):a}function C(a){for(var b,c,d,e,f=0;f<a.length;){for(e=B(a[f]).split("-"),b=e.length,c=B(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=D(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function D(a){var b=null;if(!nd[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=ld._abbr,require("./locale/"+a),E(b)}catch(c){}return nd[a]}function E(a,b){var c;return a&&(c=m(b)?H(a):F(a,b),c&&(ld=c)),ld._abbr}function F(a,b){return null!==b?(b.abbr=a,null!=nd[a]?(v("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),b=z(nd[a]._config,b)):null!=b.parentLocale&&(null!=nd[b.parentLocale]?b=z(nd[b.parentLocale]._config,b):v("parentLocaleUndefined","specified parentLocale is not defined yet")),nd[a]=new A(b),E(a),nd[a]):(delete nd[a],null)}function G(a,b){if(null!=b){var c;null!=nd[a]&&(b=z(nd[a]._config,b)),c=new A(b),c.parentLocale=nd[a],nd[a]=c,E(a)}else null!=nd[a]&&(null!=nd[a].parentLocale?nd[a]=nd[a].parentLocale:null!=nd[a]&&delete nd[a]);return nd[a]}function H(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return ld;if(!c(a)){if(b=D(a))return b;a=[a]}return C(a)}function I(){return kd(nd)}function J(a,b){var c=a.toLowerCase();od[c]=od[c+"s"]=od[b]=a}function K(a){return"string"==typeof a?od[a]||od[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)f(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(b,c){return function(d){return null!=d?(O(this,b,d),a.updateOffset(this,c),this):N(this,b)}}function N(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function O(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function P(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=K(a),w(this[a]))return this[a](b);return this}function Q(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function R(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(sd[a]=e),b&&(sd[b[0]]=function(){return Q(e.apply(this,arguments),b[1],b[2])}),c&&(sd[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function S(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function T(a){var b,c,d=a.match(pd);for(b=0,c=d.length;c>b;b++)sd[d[b]]?d[b]=sd[d[b]]:d[b]=S(d[b]);return function(b){var e,f="";for(e=0;c>e;e++)f+=d[e]instanceof Function?d[e].call(b,a):d[e];return f}}function U(a,b){return a.isValid()?(b=V(b,a.localeData()),rd[b]=rd[b]||T(b),rd[b](a)):a.localeData().invalidDate()}function V(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(qd.lastIndex=0;d>=0&&qd.test(a);)a=a.replace(qd,c),qd.lastIndex=0,d-=1;return a}function W(a,b,c){Kd[a]=w(b)?b:function(a,d){return a&&c?c:b}}function X(a,b){return f(Kd,a)?Kd[a](b._strict,b._locale):new RegExp(Y(a))}function Y(a){return Z(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function Z(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;c<a.length;c++)Ld[a[c]]=d}function _(a,b){$(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function aa(a,b,c){null!=b&&f(Ld,a)&&Ld[a](b,c._a,c,a)}function ba(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function ca(a,b){return c(this._months)?this._months[a.month()]:this._months[Vd.test(b)?"format":"standalone"][a.month()]}function da(a,b){return c(this._monthsShort)?this._monthsShort[a.month()]:this._monthsShort[Vd.test(b)?"format":"standalone"][a.month()]}function ea(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],d=0;12>d;++d)f=h([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(f,"").toLocaleLowerCase(),this._longMonthsParse[d]=this.months(f,"").toLocaleLowerCase();return c?"MMM"===b?(e=md.call(this._shortMonthsParse,g),-1!==e?e:null):(e=md.call(this._longMonthsParse,g),-1!==e?e:null):"MMM"===b?(e=md.call(this._shortMonthsParse,g),-1!==e?e:(e=md.call(this._longMonthsParse,g),-1!==e?e:null)):(e=md.call(this._longMonthsParse,g),-1!==e?e:(e=md.call(this._shortMonthsParse,g),-1!==e?e:null))}function fa(a,b,c){var d,e,f;if(this._monthsParseExact)return ea.call(this,a,b,c);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function ga(a,b){var c;if(!a.isValid())return a;if("string"==typeof b)if(/^\d+$/.test(b))b=r(b);else if(b=a.localeData().monthsParse(b),"number"!=typeof b)return a;return c=Math.min(a.date(),ba(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a}function ha(b){return null!=b?(ga(this,b),a.updateOffset(this,!0),this):N(this,"Month")}function ia(){return ba(this.year(),this.month())}function ja(a){return this._monthsParseExact?(f(this,"_monthsRegex")||la.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ka(a){return this._monthsParseExact?(f(this,"_monthsRegex")||la.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function la(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=Z(d[b]),e[b]=Z(e[b]),f[b]=Z(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")","i")}function ma(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[Nd]<0||c[Nd]>11?Nd:c[Od]<1||c[Od]>ba(c[Md],c[Nd])?Od:c[Pd]<0||c[Pd]>24||24===c[Pd]&&(0!==c[Qd]||0!==c[Rd]||0!==c[Sd])?Pd:c[Qd]<0||c[Qd]>59?Qd:c[Rd]<0||c[Rd]>59?Rd:c[Sd]<0||c[Sd]>999?Sd:-1,j(a)._overflowDayOfYear&&(Md>b||b>Od)&&(b=Od),j(a)._overflowWeeks&&-1===b&&(b=Td),j(a)._overflowWeekday&&-1===b&&(b=Ud),j(a).overflow=b),a}function na(a){var b,c,d,e,f,g,h=a._i,i=$d.exec(h)||_d.exec(h);if(i){for(j(a).iso=!0,b=0,c=be.length;c>b;b++)if(be[b][1].exec(i[1])){e=be[b][0],d=be[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=ce.length;c>b;b++)if(ce[b][1].exec(i[3])){f=(i[2]||" ")+ce[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!ae.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),Ca(a)}else a._isValid=!1}function oa(b){var c=de.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(na(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function pa(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function qa(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function ra(a){return sa(a)?366:365}function sa(a){return a%4===0&&a%100!==0||a%400===0}function ta(){return sa(this.year())}function ua(a,b,c){var d=7+b-c,e=(7+qa(a,0,d).getUTCDay()-b)%7;return-e+d-1}function va(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ua(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=ra(f)+j):j>ra(a)?(f=a+1,g=j-ra(a)):(f=a,g=j),{year:f,dayOfYear:g}}function wa(a,b,c){var d,e,f=ua(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+xa(e,b,c)):g>xa(a.year(),b,c)?(d=g-xa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function xa(a,b,c){var d=ua(a,b,c),e=ua(a+1,b,c);return(ra(a)-d+e)/7}function ya(a,b,c){return null!=a?a:null!=b?b:c}function za(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function Aa(a){var b,c,d,e,f=[];if(!a._d){for(d=za(a),a._w&&null==a._a[Od]&&null==a._a[Nd]&&Ba(a),a._dayOfYear&&(e=ya(a._a[Md],d[Md]),a._dayOfYear>ra(e)&&(j(a)._overflowDayOfYear=!0),c=qa(e,0,a._dayOfYear),a._a[Nd]=c.getUTCMonth(),a._a[Od]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[Pd]&&0===a._a[Qd]&&0===a._a[Rd]&&0===a._a[Sd]&&(a._nextDay=!0,a._a[Pd]=0),a._d=(a._useUTC?qa:pa).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Pd]=24)}}function Ba(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=ya(b.GG,a._a[Md],wa(Ka(),1,4).year),d=ya(b.W,1),e=ya(b.E,1),(1>e||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=ya(b.gg,a._a[Md],wa(Ka(),f,g).year),d=ya(b.w,1),null!=b.d?(e=b.d,(0>e||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>xa(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=va(c,d,e,f,g),a._a[Md]=h.year,a._dayOfYear=h.dayOfYear)}function Ca(b){if(b._f===a.ISO_8601)return void na(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=V(b._f,b._locale).match(pd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(X(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),sd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),aa(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[Pd]<=12&&b._a[Pd]>0&&(j(b).bigHour=void 0),j(b).parsedDateParts=b._a.slice(0),j(b).meridiem=b._meridiem,b._a[Pd]=Da(b._locale,b._a[Pd],b._meridiem),Aa(b),ma(b)}function Da(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function Ea(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;e<a._f.length;e++)f=0,b=n({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],Ca(b),k(b)&&(f+=j(b).charsLeftOver,f+=10*j(b).unusedTokens.length,j(b).score=f,(null==d||d>f)&&(d=f,c=b));g(a,c||b)}function Fa(a){if(!a._d){var b=L(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),Aa(a)}}function Ga(a){var b=new o(ma(Ha(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ha(a){var b=a._i,e=a._f;return a._locale=a._locale||H(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(ma(b)):(c(e)?Ea(a):e?Ca(a):d(b)?a._d=b:Ia(a),k(a)||(a._d=null),a))}function Ia(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(f.valueOf()):"string"==typeof f?oa(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),Aa(b)):"object"==typeof f?Fa(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ja(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Ga(f)}function Ka(a,b,c,d){return Ja(a,b,c,d,!1)}function La(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ka();for(d=b[0],e=1;e<b.length;++e)(!b[e].isValid()||b[e][a](d))&&(d=b[e]);return d}function Ma(){var a=[].slice.call(arguments,0);return La("isBefore",a)}function Na(){var a=[].slice.call(arguments,0);return La("isAfter",a)}function Oa(a){var b=L(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+1e3*h*60*60,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=H(),this._bubble()}function Pa(a){return a instanceof Oa}function Qa(a,b){R(a,0,0,function(){var a=this.utcOffset(),c="+";return 0>a&&(a=-a,c="-"),c+Q(~~(a/60),2)+b+Q(~~a%60,2)})}function Ra(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(ie)||["-",0,0],f=+(60*e[1])+r(e[2]);return"+"===e[0]?f:-f}function Sa(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?b.valueOf():Ka(b).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+f),a.updateOffset(e,!1),e):Ka(b).local()}function Ta(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Ua(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=Ra(Hd,b):Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ta(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?jb(this,db(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ta(this):null!=b?this:NaN}function Va(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Wa(a){return this.utcOffset(0,a)}function Xa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ta(this),"m")),this}function Ya(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ra(Gd,this._i)),this}function Za(a){return this.isValid()?(a=a?Ka(a).utcOffset():0,(this.utcOffset()-a)%60===0):!1}function $a(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _a(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ha(a),a._a){var b=a._isUTC?h(a._a):Ka(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ab(){return this.isValid()?!this._isUTC:!1}function bb(){return this.isValid()?this._isUTC:!1}function cb(){return this.isValid()?this._isUTC&&0===this._offset:!1}function db(a,b){var c,d,e,g=a,h=null;return Pa(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=je.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[Od])*c,h:r(h[Pd])*c,m:r(h[Qd])*c,s:r(h[Rd])*c,ms:r(h[Sd])*c}):(h=ke.exec(a))?(c="-"===h[1]?-1:1,g={y:eb(h[2],c),M:eb(h[3],c),w:eb(h[4],c),d:eb(h[5],c),h:eb(h[6],c),m:eb(h[7],c),s:eb(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=gb(Ka(g.from),Ka(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Oa(g),Pa(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function eb(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function fb(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function gb(a,b){var c;return a.isValid()&&b.isValid()?(b=Sa(b,a),a.isBefore(b)?c=fb(a,b):(c=fb(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function hb(a){return 0>a?-1*Math.round(-1*a):Math.round(a)}function ib(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(v(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=db(c,d),jb(this,e,a),this}}function jb(b,c,d,e){var f=c._milliseconds,g=hb(c._days),h=hb(c._months);b.isValid()&&(e=null==e?!0:e,f&&b._d.setTime(b._d.valueOf()+f*d),g&&O(b,"Date",N(b,"Date")+g*d),h&&ga(b,N(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function kb(a,b){var c=a||Ka(),d=Sa(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(w(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ka(c)))}function lb(){return new o(this)}function mb(a,b){var c=p(a)?a:Ka(a);return this.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?this.valueOf()>c.valueOf():c.valueOf()<this.clone().startOf(b).valueOf()):!1}function nb(a,b){var c=p(a)?a:Ka(a);return this.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?this.valueOf()<c.valueOf():this.clone().endOf(b).valueOf()<c.valueOf()):!1}function ob(a,b,c,d){return d=d||"()",("("===d[0]?this.isAfter(a,c):!this.isBefore(a,c))&&(")"===d[1]?this.isBefore(b,c):!this.isAfter(b,c))}function pb(a,b){var c,d=p(a)?a:Ka(a);return this.isValid()&&d.isValid()?(b=K(b||"millisecond"),"millisecond"===b?this.valueOf()===d.valueOf():(c=d.valueOf(),this.clone().startOf(b).valueOf()<=c&&c<=this.clone().endOf(b).valueOf())):!1}function qb(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function rb(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function sb(a,b,c){var d,e,f,g;return this.isValid()?(d=Sa(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=K(b),"year"===b||"month"===b||"quarter"===b?(g=tb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}function tb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)||0}function ub(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function vb(){var a=this.clone().utc();return 0<a.year()&&a.year()<=9999?w(Date.prototype.toISOString)?this.toDate().toISOString():U(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):U(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function wb(b){b||(b=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var c=U(this,b);return this.localeData().postformat(c)}function xb(a,b){return this.isValid()&&(p(a)&&a.isValid()||Ka(a).isValid())?db({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function yb(a){return this.from(Ka(),a)}function zb(a,b){return this.isValid()&&(p(a)&&a.isValid()||Ka(a).isValid())?db({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function Ab(a){return this.to(Ka(),a)}function Bb(a){var b;return void 0===a?this._locale._abbr:(b=H(a),null!=b&&(this._locale=b),this)}function Cb(){return this._locale}function Db(a){switch(a=K(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function Eb(a){return a=K(a),void 0===a||"millisecond"===a?this:("date"===a&&(a="day"),this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms"))}function Fb(){return this._d.valueOf()-6e4*(this._offset||0)}function Gb(){return Math.floor(this.valueOf()/1e3)}function Hb(){return this._offset?new Date(this.valueOf()):this._d}function Ib(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function Jb(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function Kb(){return this.isValid()?this.toISOString():null}function Lb(){return k(this)}function Mb(){return g({},j(this))}function Nb(){return j(this).overflow}function Ob(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Pb(a,b){R(0,[a,a.length],0,b)}function Qb(a){return Ub.call(this,a,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Rb(a){return Ub.call(this,a,this.isoWeek(),this.isoWeekday(),1,4)}function Sb(){return xa(this.year(),1,4)}function Tb(){var a=this.localeData()._week;return xa(this.year(),a.dow,a.doy)}function Ub(a,b,c,d,e){var f;return null==a?wa(this,d,e).year:(f=xa(a,d,e),b>f&&(b=f),Vb.call(this,a,b,c,d,e))}function Vb(a,b,c,d,e){var f=va(a,b,c,d,e),g=qa(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Wb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Xb(a){return wa(a,this._week.dow,this._week.doy).week}function Yb(){return this._week.dow}function Zb(){return this._week.doy}function $b(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function _b(a){var b=wa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function ac(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function bc(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function cc(a){return this._weekdaysShort[a.day()]}function dc(a){return this._weekdaysMin[a.day()]}function ec(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;7>d;++d)f=h([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(f,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(f,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(f,"").toLocaleLowerCase();return c?"dddd"===b?(e=md.call(this._weekdaysParse,g),-1!==e?e:null):"ddd"===b?(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:null):(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null):"dddd"===b?(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null))):"ddd"===b?(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null))):(e=md.call(this._minWeekdaysParse,g),-1!==e?e:(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:null)))}function fc(a,b,c){var d,e,f;if(this._weekdaysParseExact)return ec.call(this,a,b,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=h([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function gc(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=ac(a,this.localeData()),this.add(a-b,"d")):b}function hc(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function ic(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function jc(a){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&a?this._weekdaysStrictRegex:this._weekdaysRegex}function kc(a){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function lc(a){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function mc(){function a(a,b){return b.length-a.length}var b,c,d,e,f,g=[],i=[],j=[],k=[];for(b=0;7>b;b++)c=h([2e3,1]).day(b),d=this.weekdaysMin(c,""),e=this.weekdaysShort(c,""),f=this.weekdays(c,""),g.push(d),i.push(e),j.push(f),k.push(d),k.push(e),k.push(f);for(g.sort(a),i.sort(a),j.sort(a),k.sort(a),b=0;7>b;b++)i[b]=Z(i[b]),j[b]=Z(j[b]),k[b]=Z(k[b]);this._weekdaysRegex=new RegExp("^("+k.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+j.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")}function nc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function oc(){return this.hours()%12||12}function pc(){return this.hours()||24}function qc(a,b){R(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function rc(a,b){return b._meridiemParse}function sc(a){return"p"===(a+"").toLowerCase().charAt(0)}function tc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function uc(a,b){b[Sd]=r(1e3*("0."+a))}function vc(){return this._isUTC?"UTC":""}function wc(){return this._isUTC?"Coordinated Universal Time":""}function xc(a){return Ka(1e3*a)}function yc(){return Ka.apply(null,arguments).parseZone()}function zc(a,b,c){var d=this._calendar[a];return w(d)?d.call(b,c):d}function Ac(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function Bc(){return this._invalidDate}function Cc(a){return this._ordinal.replace("%d",a)}function Dc(a){return a}function Ec(a,b,c,d){var e=this._relativeTime[c];return w(e)?e(a,b,c,d):e.replace(/%d/i,a)}function Fc(a,b){var c=this._relativeTime[a>0?"future":"past"];return w(c)?c(b):c.replace(/%s/i,b)}function Gc(a,b,c,d){var e=H(),f=h().set(d,b);return e[c](f,a)}function Hc(a,b,c){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return Gc(a,b,c,"month");var d,e=[];for(d=0;12>d;d++)e[d]=Gc(a,d,c,"month");return e}function Ic(a,b,c,d){"boolean"==typeof a?("number"==typeof b&&(c=b,b=void 0),b=b||""):(b=a,c=b,a=!1,"number"==typeof b&&(c=b,b=void 0),b=b||"");var e=H(),f=a?e._week.dow:0;if(null!=c)return Gc(b,(c+f)%7,d,"day");var g,h=[];for(g=0;7>g;g++)h[g]=Gc(b,(g+f)%7,d,"day");return h}function Jc(a,b){return Hc(a,b,"months")}function Kc(a,b){return Hc(a,b,"monthsShort")}function Lc(a,b,c){return Ic(a,b,c,"weekdays")}function Mc(a,b,c){return Ic(a,b,c,"weekdaysShort")}function Nc(a,b,c){return Ic(a,b,c,"weekdaysMin")}function Oc(){var a=this._data;return this._milliseconds=Le(this._milliseconds),this._days=Le(this._days),this._months=Le(this._months),a.milliseconds=Le(a.milliseconds),a.seconds=Le(a.seconds),a.minutes=Le(a.minutes),a.hours=Le(a.hours),a.months=Le(a.months),a.years=Le(a.years),this}function Pc(a,b,c,d){var e=db(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Qc(a,b){return Pc(this,a,b,1)}function Rc(a,b){return Pc(this,a,b,-1)}function Sc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Tc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Sc(Vc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Uc(g)),h+=e,g-=Sc(Vc(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Uc(a){return 4800*a/146097}function Vc(a){return 146097*a/4800}function Wc(a){var b,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+Uc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Vc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Xc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Yc(a){return function(){return this.as(a)}}function Zc(a){
vendor: 8,080 bytes, line 2366
2366    return a=K(a),this[a+"s"]()}function $c(a){return function(){return this._data[a]}}function _c(){return q(this.days()/7)}function ad(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function bd(a,b,c){var d=db(a).abs(),e=_e(d.as("s")),f=_e(d.as("m")),g=_e(d.as("h")),h=_e(d.as("d")),i=_e(d.as("M")),j=_e(d.as("y")),k=e<af.s&&["s",e]||1>=f&&["m"]||f<af.m&&["mm",f]||1>=g&&["h"]||g<af.h&&["hh",g]||1>=h&&["d"]||h<af.d&&["dd",h]||1>=i&&["M"]||i<af.M&&["MM",i]||1>=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,ad.apply(null,k)}function cd(a,b){return void 0===af[a]?!1:void 0===b?af[a]:(af[a]=b,!0)}function dd(a){var b=this.localeData(),c=bd(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function ed(){var a,b,c,d=bf(this._milliseconds)/1e3,e=bf(this._days),f=bf(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var fd,gd;gd=Array.prototype.some?Array.prototype.some:function(a){for(var b=Object(this),c=b.length>>>0,d=0;c>d;d++)if(d in b&&a.call(this,b[d],d,b))return!0;return!1};var hd=a.momentProperties=[],id=!1,jd={};a.suppressDeprecationWarnings=!1,a.deprecationHandler=null;var kd;kd=Object.keys?Object.keys:function(a){var b,c=[];for(b in a)f(a,b)&&c.push(b);return c};var ld,md,nd={},od={},pd=/(\[[^\[]*\])|(\\)?([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,qd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,rd={},sd={},td=/\d/,ud=/\d\d/,vd=/\d{3}/,wd=/\d{4}/,xd=/[+-]?\d{6}/,yd=/\d\d?/,zd=/\d\d\d\d?/,Ad=/\d\d\d\d\d\d?/,Bd=/\d{1,3}/,Cd=/\d{1,4}/,Dd=/[+-]?\d{1,6}/,Ed=/\d+/,Fd=/[+-]?\d+/,Gd=/Z|[+-]\d\d:?\d\d/gi,Hd=/Z|[+-]\d\d(?::?\d\d)?/gi,Id=/[+-]?\d+(\.\d{1,3})?/,Jd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Kd={},Ld={},Md=0,Nd=1,Od=2,Pd=3,Qd=4,Rd=5,Sd=6,Td=7,Ud=8;md=Array.prototype.indexOf?Array.prototype.indexOf:function(a){var b;for(b=0;b<this.length;++b)if(this[b]===a)return b;return-1},R("M",["MM",2],"Mo",function(){return this.month()+1}),R("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),R("MMMM",0,0,function(a){return this.localeData().months(this,a)}),J("month","M"),W("M",yd),W("MM",yd,ud),W("MMM",function(a,b){return b.monthsShortRegex(a)}),W("MMMM",function(a,b){return b.monthsRegex(a)}),$(["M","MM"],function(a,b){b[Nd]=r(a)-1}),$(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[Nd]=e:j(c).invalidMonth=a});var Vd=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Wd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Xd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Yd=Jd,Zd=Jd,$d=/^\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)?)?/,_d=/^\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)?)?/,ae=/Z|[+-]\d\d(?::?\d\d)?/,be=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],ce=[["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/]],de=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=u("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),R("Y",0,0,function(){var a=this.year();return 9999>=a?""+a:"+"+a}),R(0,["YY",2],0,function(){return this.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),J("year","y"),W("Y",Fd),W("YY",yd,ud),W("YYYY",Cd,wd),W("YYYYY",Dd,xd),W("YYYYYY",Dd,xd),$(["YYYYY","YYYYYY"],Md),$("YYYY",function(b,c){c[Md]=2===b.length?a.parseTwoDigitYear(b):r(b)}),$("YY",function(b,c){c[Md]=a.parseTwoDigitYear(b)}),$("Y",function(a,b){b[Md]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var ee=M("FullYear",!0);a.ISO_8601=function(){};var fe=u("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ka.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),ge=u("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ka.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),he=function(){return Date.now?Date.now():+new Date};Qa("Z",":"),Qa("ZZ",""),W("Z",Hd),W("ZZ",Hd),$(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ra(Hd,a)});var ie=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var je=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,ke=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;db.fn=Oa.prototype;var le=ib(1,"add"),me=ib(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ne=u("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Pb("gggg","weekYear"),Pb("ggggg","weekYear"),Pb("GGGG","isoWeekYear"),Pb("GGGGG","isoWeekYear"),J("weekYear","gg"),J("isoWeekYear","GG"),W("G",Fd),W("g",Fd),W("GG",yd,ud),W("gg",yd,ud),W("GGGG",Cd,wd),W("gggg",Cd,wd),W("GGGGG",Dd,xd),W("ggggg",Dd,xd),_(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),_(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),R("Q",0,"Qo","quarter"),J("quarter","Q"),W("Q",td),$("Q",function(a,b){b[Nd]=3*(r(a)-1)}),R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),J("week","w"),J("isoWeek","W"),W("w",yd),W("ww",yd,ud),W("W",yd),W("WW",yd,ud),_(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var oe={dow:0,doy:6};R("D",["DD",2],"Do","date"),J("date","D"),W("D",yd),W("DD",yd,ud),W("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),$(["D","DD"],Od),$("Do",function(a,b){b[Od]=r(a.match(yd)[0],10)});var pe=M("Date",!0);R("d",0,"do","day"),R("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),R("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),R("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),J("day","d"),J("weekday","e"),J("isoWeekday","E"),W("d",yd),W("e",yd),W("E",yd),W("dd",function(a,b){return b.weekdaysMinRegex(a)}),W("ddd",function(a,b){return b.weekdaysShortRegex(a)}),W("dddd",function(a,b){return b.weekdaysRegex(a)}),_(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),_(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var qe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),re="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),se="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),te=Jd,ue=Jd,ve=Jd;R("DDD",["DDDD",3],"DDDo","dayOfYear"),J("dayOfYear","DDD"),W("DDD",Bd),W("DDDD",vd),$(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),R("H",["HH",2],0,"hour"),R("h",["hh",2],0,oc),R("k",["kk",2],0,pc),R("hmm",0,0,function(){return""+oc.apply(this)+Q(this.minutes(),2)}
2366),R("hmmss",0,0,function(){return""+oc.apply(this)+Q(this.minutes(),2)+Q(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+Q(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+Q(this.minutes(),2)+Q(this.seconds(),2)}),qc("a",!0),qc("A",!1),J("hour","h"),W("a",rc),W("A",rc),W("H",yd),W("h",yd),W("HH",yd,ud),W("hh",yd,ud),W("hmm",zd),W("hmmss",Ad),W("Hmm",zd),W("Hmmss",Ad),$(["H","HH"],Pd),$(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),$(["h","hh"],function(a,b,c){b[Pd]=r(a),j(c).bigHour=!0}),$("hmm",function(a,b,c){var d=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d)),j(c).bigHour=!0}),$("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d,2)),b[Rd]=r(a.substr(e)),j(c).bigHour=!0}),$("Hmm",function(a,b,c){var d=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d))}),$("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d,2)),b[Rd]=r(a.substr(e))});var we=/[ap]\.?m?\.?/i,xe=M("Hours",!0);R("m",["mm",2],0,"minute"),J("minute","m"),W("m",yd),W("mm",yd,ud),$(["m","mm"],Qd);var ye=M("Minutes",!1);R("s",["ss",2],0,"second"),J("second","s"),W("s",yd),W("ss",yd,ud),$(["s","ss"],Rd);var ze=M("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),J("millisecond","ms"),W("S",Bd,td),W("SS",Bd,ud),W("SSS",Bd,vd);var Ae;for(Ae="SSSS";Ae.length<=9;Ae+="S")W(Ae,Ed);for(Ae="S";Ae.length<=9;Ae+="S")$(Ae,uc);var Be=M("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var Ce=o.prototype;Ce.add=le,Ce.calendar=kb,Ce.clone=lb,Ce.diff=sb,Ce.endOf=Eb,Ce.format=wb,Ce.from=xb,Ce.fromNow=yb,Ce.to=zb,Ce.toNow=Ab,Ce.get=P,Ce.invalidAt=Nb,Ce.isAfter=mb,Ce.isBefore=nb,Ce.isBetween=ob,Ce.isSame=pb,Ce.isSameOrAfter=qb,Ce.isSameOrBefore=rb,Ce.isValid=Lb,Ce.lang=ne,Ce.locale=Bb,Ce.localeData=Cb,Ce.max=ge,Ce.min=fe,Ce.parsingFlags=Mb,Ce.set=P,Ce.startOf=Db,Ce.subtract=me,Ce.toArray=Ib,Ce.toObject=Jb,Ce.toDate=Hb,Ce.toISOString=vb,Ce.toJSON=Kb,Ce.toString=ub,Ce.unix=Gb,Ce.valueOf=Fb,Ce.creationData=Ob,Ce.year=ee,Ce.isLeapYear=ta,Ce.weekYear=Qb,Ce.isoWeekYear=Rb,Ce.quarter=Ce.quarters=Wb,Ce.month=ha,Ce.daysInMonth=ia,Ce.week=Ce.weeks=$b,Ce.isoWeek=Ce.isoWeeks=_b,Ce.weeksInYear=Tb,Ce.isoWeeksInYear=Sb,Ce.date=pe,Ce.day=Ce.days=gc,Ce.weekday=hc,Ce.isoWeekday=ic,Ce.dayOfYear=nc,Ce.hour=Ce.hours=xe,Ce.minute=Ce.minutes=ye,Ce.second=Ce.seconds=ze,Ce.millisecond=Ce.milliseconds=Be,Ce.utcOffset=Ua,Ce.utc=Wa,Ce.local=Xa,Ce.parseZone=Ya,Ce.hasAlignedHourOffset=Za,Ce.isDST=$a,Ce.isDSTShifted=_a,Ce.isLocal=ab,Ce.isUtcOffset=bb,Ce.isUtc=cb,Ce.isUTC=cb,Ce.zoneAbbr=vc,Ce.zoneName=wc,Ce.dates=u("dates accessor is deprecated. Use date instead.",pe),Ce.months=u("months accessor is deprecated. Use month instead",ha),Ce.years=u("years accessor is deprecated. Use year instead",ee),Ce.zone=u("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Va);var De=Ce,Ee={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Fe={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"},Ge="Invalid date",He="%d",Ie=/\d{1,2}/,Je={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"},Ke=A.prototype;Ke._calendar=Ee,Ke.calendar=zc,Ke._longDateFormat=Fe,Ke.longDateFormat=Ac,Ke._invalidDate=Ge,Ke.invalidDate=Bc,Ke._ordinal=He,Ke.ordinal=Cc,Ke._ordinalParse=Ie,Ke.preparse=Dc,Ke.postformat=Dc,Ke._relativeTime=Je,Ke.relativeTime=Ec,Ke.pastFuture=Fc,Ke.set=y,Ke.months=ca,Ke._months=Wd,Ke.monthsShort=da,Ke._monthsShort=Xd,Ke.monthsParse=fa,Ke._monthsRegex=Zd,Ke.monthsRegex=ka,Ke._monthsShortRegex=Yd,Ke.monthsShortRegex=ja,Ke.week=Xb,Ke._week=oe,Ke.firstDayOfYear=Zb,Ke.firstDayOfWeek=Yb,Ke.weekdays=bc,Ke._weekdays=qe,Ke.weekdaysMin=dc,Ke._weekdaysMin=se,Ke.weekdaysShort=cc,Ke._weekdaysShort=re,Ke.weekdaysParse=fc,Ke._weekdaysRegex=te,Ke.weekdaysRegex=jc,Ke._weekdaysShortRegex=ue,Ke.weekdaysShortRegex=kc,Ke._weekdaysMinRegex=ve,Ke.weekdaysMinRegex=lc,Ke.isPM=sc,Ke._meridiemParse=we,Ke.meridiem=tc,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=u("moment.lang is deprecated. Use moment.locale instead.",E),a.langData=u("moment.langData is deprecated. Use moment.localeData instead.",H);var Le=Math.abs,Me=Yc("ms"),Ne=Yc("s"),Oe=Yc("m"),Pe=Yc("h"),Qe=Yc("d"),Re=Yc("w"),Se=Yc("M"),Te=Yc("y"),Ue=$c("milliseconds"),Ve=$c("seconds"),We=$c("minutes"),Xe=$c("hours"),Ye=$c("days"),Ze=$c("months"),$e=$c("years"),_e=Math.round,af={s:45,m:45,h:22,d:26,M:11},bf=Math.abs,cf=Oa.prototype;cf.abs=Oc,cf.add=Qc,cf.subtract=Rc,cf.as=Wc,cf.asMilliseconds=Me,cf.asSeconds=Ne,cf.asMinutes=Oe,cf.asHours=Pe,cf.asDays=Qe,cf.asWeeks=Re,cf.asMonths=Se,cf.asYears=Te,cf.valueOf=Xc,cf._bubble=Tc,cf.get=Zc,cf.milliseconds=Ue,cf.seconds=Ve,cf.minutes=We,cf.hours=Xe,cf.days=Ye,cf.weeks=_c,cf.months=Ze,cf.years=$e,cf.humanize=dd,cf.toISOString=ed,cf.toString=ed,cf.toJSON=ed,cf.locale=Bb,cf.localeData=Cb,cf.toIsoString=u("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ed),cf.lang=ne,R("X",0,0,"unix"),R("x",0,0,"valueOf"),W("x",Fd),W("X",Id),$("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),$("x",function(a,b,c){c._d=new Date(r(a))}),a.version="2.13.0",b(Ka),a.fn=De,a.min=Ma,a.max=Na,a.now=he,a.utc=h,a.unix=xc,a.months=Jc,a.isDate=d,a.locale=E,a.invalid=l,a.duration=db,a.isMoment=p,a.weekdays=Lc,a.parseZone=yc,a.localeData=H,a.isDuration=Pa,a.monthsShort=Kc,a.weekdaysMin=Nc,a.defineLocale=F,a.updateLocale=G,a.locales=I,a.weekdaysShort=Mc,a.normalizeUnits=K,a.relativeTimeThreshold=cd,a.prototype=De;var df=a;return df});
2367/* --- ORGANIC TABS --- */
2368
2369// --- MODIFIED
2370// https://github.com/CSS-Tricks/jQuery-Organic-Tabs
2371(function ($) {
2372
2373	$.organicTabs = function (el, options) {
2374		var base = this;
2375		base.$el = $(el);
2376		base.$nav = base.$el.find(".tabs__nav");
2377		base.init = function () {
2378			base.options = $.extend({}, $.organicTabs.defaultOptions, options);
2379			var $allListWrap = base.$el.find(".tabs__content"),
2380				curList = base.$el.find("a.current").attr("href").substring(1);
2381			$allListWrap.height(base.$el.find("#" + curList).height());
2382			base.$nav.find("li > a").off('click');
2383			base.$nav.find("li > a").click(function (event) {
2384
2385				var curList = base.$el.find("a.current").attr("href").substring(1),
2386					$newList = $(this),
2387					listID = $newList.attr("href").substring(1);
2388				if ((listID != curList) && (base.$el.find(":animated").length == 0)) {
2389					base.$el.find("#" + curList).css({
2390						opacity: 0,
2391						"z-index": 10,
2392						"pointer-events": "none"
2393					});
2394					var newHeight = base.$el.find("#" + listID).height();
2395					$allListWrap.css({
2396						height: newHeight
2397					});
2398					setTimeout(function () {
2399						base.$el.find("#" + curList);
2400						base.$el.find("#" + listID).css({
2401							opacity: 1,
2402							"z-index": 100,
2403							"pointer-events": "auto"
2404						});
2405						base.$el.find(".tabs__nav li a").removeClass("current");
2406						$newList.addClass("current");
2407					}, 250);
2408				}
2409
2410				setTimeout(function () {
2411					$(window).trigger('organicTabsChange');
2412				}, 250);
2413				event.preventDefault();
2414			});
2415		};
2416		base.init();
2417	};
2418	$.organicTabs.defaultOptions = {
2419		speed: 300
2420	};
2421	$.fn.organicTabs = function (options) {
2422		return this.each(function () {
2423			(new $.organicTabs(this, options));
2424		});
2425	};
2426
2427})(jQuery);
2428/*!
2429 * Pikaday
2430 *
2431 * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
2432 */
2433
2434(function (root, factory)
2435{
2436    'use strict';
2437
2438    var moment;
2439    if (typeof exports === 'object') {
2440        // CommonJS module
2441        // Load moment.js as an optional dependency
2442        try { moment = require('moment'); } catch (e) {}
2443        module.exports = factory(moment);
2444    } else if (typeof define === 'function' && define.amd) {
2445        // AMD. Register as an anonymous module.
2446        define(function (req)
2447        {
2448            // Load moment.js as an optional dependency
2449            var id = 'moment';
2450            try { moment = req(id); } catch (e) {}
2451            return factory(moment);
2452        });
2453    } else {
2454        root.Pikaday = factory(root.moment);
2455    }
2456}(this, function (moment)
2457{
2458    'use strict';
2459
2460    /**
2461     * feature detection and helper functions
2462     */
2463    var hasMoment = typeof moment === 'function',
2464
2465    hasEventListeners = !!window.addEventListener,
2466
2467    document = window.document,
2468
2469    sto = window.setTimeout,
2470
2471    addEvent = function(el, e, callback, capture)
2472    {
2473        if (hasEventListeners) {
2474            el.addEventListener(e, callback, !!capture);
2475        } else {
2476            el.attachEvent('on' + e, callback);
2477        }
2478    },
2479
2480    removeEvent = function(el, e, callback, capture)
2481    {
2482        if (hasEventListeners) {
2483            el.removeEventListener(e, callback, !!capture);
2484        } else {
2485            el.detachEvent('on' + e, callback);
2486        }
2487    },
2488
2489    trim = function(str)
2490    {
2491        return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g,'');
2492    },
2493
2494    hasClass = function(el, cn)
2495    {
2496        return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1;
2497    },
2498
2499    addClass = function(el, cn)
2500    {
2501        if (!hasClass(el, cn)) {
2502            el.className = (el.className === '') ? cn : el.className + ' ' + cn;
2503        }
2504    },
2505
2506    removeClass = function(el, cn)
2507    {
2508        el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' '));
2509    },
2510
2511    isArray = function(obj)
2512    {
2513        return (/Array/).test(Object.prototype.toString.call(obj));
2514    },
2515
2516    isDate = function(obj)
2517    {
2518        return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime());
2519    },
2520
2521    isWeekend = function(date)
2522    {
2523        var day = date.getDay();
2524        return day === 0 || day === 6;
2525    },
2526
2527    isLeapYear = function(year)
2528    {
2529        // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951
2530        return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
2531    },
2532
2533    getDaysInMonth = function(year, month)
2534    {
2535        return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
2536    },
2537
2538    setToStartOfDay = function(date)
2539    {
2540        if (isDate(date)) date.setHours(0,0,0,0);
2541    },
2542
2543    compareDates = function(a,b)
2544    {
2545        // weak date comparison (use setToStartOfDay(date) to ensure correct result)
2546        return a.getTime() === b.getTime();
2547    },
2548
2549    extend = function(to, from, overwrite)
2550    {
2551        var prop, hasProp;
2552        for (prop in from) {
2553            hasProp = to[prop] !== undefined;
2554            if (hasProp && typeof from[prop] === 'object' && from[prop] !== null && from[prop].nodeName === undefined) {
2555                if (isDate(from[prop])) {
2556                    if (overwrite) {
2557                        to[prop] = new Date(from[prop].getTime());
2558                    }
2559                }
2560                else if (isArray(from[prop])) {
2561                    if (overwrite) {
2562                        to[prop] = from[prop].slice(0);
2563                    }
2564                } else {
2565                    to[prop] = extend({}, from[prop], overwrite);
2566                }
2567            } else if (overwrite || !hasProp) {
2568                to[prop] = from[prop];
2569            }
2570        }
2571        return to;
2572    },
2573
2574    fireEvent = function(el, eventName, data)
2575    {
2576        var ev;
2577
2578        if (document.createEvent) {
2579            ev = document.createEvent('HTMLEvents');
2580            ev.initEvent(eventName, true, false);
2581            ev = extend(ev, data);
2582            el.dispatchEvent(ev);
2583        } else if (document.createEventObject) {
2584            ev = document.createEventObject();
2585            ev = extend(ev, data);
2586            el.fireEvent('on' + eventName, ev);
2587        }
2588    },
2589
2590    adjustCalendar = function(calendar) {
2591        if (calendar.month < 0) {
2592            calendar.year -= Math.ceil(Math.abs(calendar.month)/12);
2593            calendar.month += 12;
2594        }
2595        if (calendar.month > 11) {
2596            calendar.year += Math.floor(Math.abs(calendar.month)/12);
2597            calendar.month -= 12;
2598        }
2599        return calendar;
2600    },
2601
2602    /**
2603     * defaults and localisation
2604     */
2605    defaults = {
2606
2607        // bind the picker to a form field
2608        field: null,
2609
2610        // automatically show/hide the picker on `field` focus (default `true` if `field` is set)
2611        bound: undefined,
2612
2613        // data-attribute on the input field with an aria assistance tekst (only applied when `bound` is set)
2614        ariaLabel: 'Use the arrow keys to pick a date',
2615
2616        // position of the datepicker, relative to the field (default to bottom & left)
2617        // ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position)
2618        position: 'bottom left',
2619
2620        // automatically fit in the viewport even if it means repositioning from the position option
2621        reposition: true,
2622
2623        // the default output format for `.toString()` and `field` value
2624        format: 'YYYY-MM-DD',
2625
2626        // the toString function which gets passed a current date object and format
2627        // and returns a string
2628        toString: null,
2629
2630        // used to create date object from current input string
2631        parse: null,
2632
2633        // the initial date to view when first opened
2634        defaultDate: null,
2635
2636        // make the `defaultDate` the initial selected value
2637        setDefaultDate: false,
2638
2639        // first day of week (0: Sunday, 1: Monday etc)
2640        firstDay: 0,
2641
2642        // the default flag for moment's strict date parsing
2643        formatStrict: false,
2644
2645        // the minimum/earliest date that can be selected
2646        minDate: null,
2647        // the maximum/latest date that can be selected
2648        maxDate: null,
2649
2650        // number of years either side, or array of upper/lower range
2651        yearRange: 10,
2652
2653        // show week numbers at head of row
2654        showWeekNumber: false,
2655
2656        // Week picker mode
2657        pickWholeWeek: false,
2658
2659        // used internally (don't config outside)
2660        minYear: 0,
2661        maxYear: 9999,
2662        minMonth: undefined,
2663        maxMonth: undefined,
2664
2665        startRange: null,
2666        endRange: null,
2667
2668        isRTL: false,
2669
2670        // Additional text to append to the year in the calendar title
2671        yearSuffix: '',
2672
2673        // Render the month after year in the calendar title
2674        showMonthAfterYear: false,
2675
2676        // Render days of the calendar grid that fall in the next or previous month
vendor: 24,249 bytes, lines 2677-3436
2677        showDaysInNextAndPreviousMonths: false,
2678
2679        // Allows user to select days that fall in the next or previous month
2680        enableSelectionDaysInNextAndPreviousMonths: false,
2681
2682        // how many months are visible
2683        numberOfMonths: 1,
2684
2685        // when numberOfMonths is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`)
2686        // only used for the first display or when a selected date is not visible
2687        mainCalendar: 'left',
2688
2689        // Specify a DOM element to render the calendar in
2690        container: undefined,
2691
2692        // Blur field when date is selected
2693        blurFieldOnSelect : true,
2694
2695        // internationalization
2696        i18n: {
2697            previousMonth : 'Previous Month',
2698            nextMonth     : 'Next Month',
2699            months        : ['January','February','March','April','May','June','July','August','September','October','November','December'],
2700            weekdays      : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
2701            weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
2702        },
2703
2704        // Theme Classname
2705        theme: null,
2706
2707        // events array
2708        events: [],
2709
2710        // callback function
2711        onSelect: null,
2712        onOpen: null,
2713        onClose: null,
2714        onDraw: null,
2715
2716        // Enable keyboard input
2717        keyboardInput: true
2718    },
2719
2720
2721    /**
2722     * templating functions to abstract HTML rendering
2723     */
2724    renderDayName = function(opts, day, abbr)
2725    {
2726        day += opts.firstDay;
2727        while (day >= 7) {
2728            day -= 7;
2729        }
2730        return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
2731    },
2732
2733    renderDay = function(opts)
2734    {
2735        var arr = [];
2736        var ariaSelected = 'false';
2737        if (opts.isEmpty) {
2738            if (opts.showDaysInNextAndPreviousMonths) {
2739                arr.push('is-outside-current-month');
2740
2741                if(!opts.enableSelectionDaysInNextAndPreviousMonths) {
2742                    arr.push('is-selection-disabled');
2743                }
2744
2745            } else {
2746                return '<td class="is-empty"></td>';
2747            }
2748        }
2749        if (opts.isDisabled) {
2750            arr.push('is-disabled');
2751        }
2752        if (opts.isToday) {
2753            arr.push('is-today');
2754        }
2755        if (opts.isSelected) {
2756            arr.push('is-selected');
2757            ariaSelected = 'true';
2758        }
2759        if (opts.hasEvent) {
2760            arr.push('has-event');
2761        }
2762        if (opts.isInRange) {
2763            arr.push('is-inrange');
2764        }
2765        if (opts.isStartRange) {
2766            arr.push('is-startrange');
2767        }
2768        if (opts.isEndRange) {
2769            arr.push('is-endrange');
2770        }
2771        return '<td data-day="' + opts.day + '" class="' + arr.join(' ') + '" aria-selected="' + ariaSelected + '">' +
2772                 '<button class="pika-button pika-day" type="button" ' +
2773                    'data-pika-year="' + opts.year + '" data-pika-month="' + opts.month + '" data-pika-day="' + opts.day + '">' +
2774                        opts.day +
2775                 '</button>' +
2776               '</td>';
2777    },
2778
2779    renderWeek = function (d, m, y) {
2780        // Lifted from http://javascript.about.com/library/blweekyear.htm, lightly modified.
2781        var onejan = new Date(y, 0, 1),
2782            weekNum = Math.ceil((((new Date(y, m, d) - onejan) / 86400000) + onejan.getDay()+1)/7);
2783        return '<td class="pika-week">' + weekNum + '</td>';
2784    },
2785
2786    renderRow = function(days, isRTL, pickWholeWeek, isRowSelected)
2787    {
2788        return '<tr class="pika-row' + (pickWholeWeek ? ' pick-whole-week' : '') + (isRowSelected ? ' is-selected' : '') + '">' + (isRTL ? days.reverse() : days).join('') + '</tr>';
2789    },
2790
2791    renderBody = function(rows)
2792    {
2793        return '<tbody>' + rows.join('') + '</tbody>';
2794    },
2795
2796    renderHead = function(opts)
2797    {
2798        var i, arr = [];
2799        if (opts.showWeekNumber) {
2800            arr.push('<th></th>');
2801        }
2802        for (i = 0; i < 7; i++) {
2803            arr.push('<th scope="col"><abbr title="' + renderDayName(opts, i) + '">' + renderDayName(opts, i, true) + '</abbr></th>');
2804        }
2805        return '<thead><tr>' + (opts.isRTL ? arr.reverse() : arr).join('') + '</tr></thead>';
2806    },
2807
2808    renderTitle = function(instance, c, year, month, refYear, randId)
2809    {
2810        var i, j, arr,
2811            opts = instance._o,
2812            isMinYear = year === opts.minYear,
2813            isMaxYear = year === opts.maxYear,
2814            html = '<div id="' + randId + '" class="pika-title" role="heading" aria-live="assertive">',
2815            monthHtml,
2816            yearHtml,
2817            prev = true,
2818            next = true;
2819
2820        for (arr = [], i = 0; i < 12; i++) {
2821            arr.push('<option value="' + (year === refYear ? i - c : 12 + i - c) + '"' +
2822                (i === month ? ' selected="selected"': '') +
2823                ((isMinYear && i < opts.minMonth) || (isMaxYear && i > opts.maxMonth) ? 'disabled="disabled"' : '') + '>' +
2824                opts.i18n.months[i] + '</option>');
2825        }
2826
2827        monthHtml = '<div class="pika-label">' + opts.i18n.months[month] + '<select class="pika-select pika-select-month" tabindex="-1">' + arr.join('') + '</select></div>';
2828
2829        if (isArray(opts.yearRange)) {
2830            i = opts.yearRange[0];
2831            j = opts.yearRange[1] + 1;
2832        } else {
2833            i = year - opts.yearRange;
2834            j = 1 + year + opts.yearRange;
2835        }
2836
2837        for (arr = []; i < j && i <= opts.maxYear; i++) {
2838            if (i >= opts.minYear) {
2839                arr.push('<option value="' + i + '"' + (i === year ? ' selected="selected"': '') + '>' + (i) + '</option>');
2840            }
2841        }
2842        yearHtml = '<div class="pika-label">' + year + opts.yearSuffix + '<select class="pika-select pika-select-year" tabindex="-1">' + arr.join('') + '</select></div>';
2843
2844        if (opts.showMonthAfterYear) {
2845            html += yearHtml + monthHtml;
2846        } else {
2847            html += monthHtml + yearHtml;
2848        }
2849
2850        if (isMinYear && (month === 0 || opts.minMonth >= month)) {
2851            prev = false;
2852        }
2853
2854        if (isMaxYear && (month === 11 || opts.maxMonth <= month)) {
2855            next = false;
2856        }
2857
2858        if (c === 0) {
2859            html += '<button class="pika-prev' + (prev ? '' : ' is-disabled') + '" type="button">' + opts.i18n.previousMonth + '</button>';
2860        }
2861        if (c === (instance._o.numberOfMonths - 1) ) {
2862            html += '<button class="pika-next' + (next ? '' : ' is-disabled') + '" type="button">' + opts.i18n.nextMonth + '</button>';
2863        }
2864
2865        return html += '</div>';
2866    },
2867
2868    renderTable = function(opts, data, randId)
2869    {
2870        return '<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="' + randId + '">' + renderHead(opts) + renderBody(data) + '</table>';
2871    },
2872
2873
2874    /**
2875     * Pikaday constructor
2876     */
2877    Pikaday = function(options)
2878    {
2879        var self = this,
2880            opts = self.config(options);
2881
2882        self._onMouseDown = function(e)
2883        {
2884            if (!self._v) {
2885                return;
2886            }
2887            e = e || window.event;
2888            var target = e.target || e.srcElement;
2889            if (!target) {
2890                return;
2891            }
2892
2893            if (!hasClass(target, 'is-disabled')) {
2894                if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty') && !hasClass(target.parentNode, 'is-disabled')) {
2895                    self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day')));
2896                    if (opts.bound) {
2897                        sto(function() {
2898                            self.hide();
2899                            if (opts.blurFieldOnSelect && opts.field) {
2900                                opts.field.blur();
2901                            }
2902                        }, 100);
2903                    }
2904                }
2905                else if (hasClass(target, 'pika-prev')) {
2906                    self.prevMonth();
2907                }
2908                else if (hasClass(target, 'pika-next')) {
2909                    self.nextMonth();
2910                }
2911            }
2912            if (!hasClass(target, 'pika-select')) {
2913                // if this is touch event prevent mouse events emulation
2914                if (e.preventDefault) {
2915                    e.preventDefault();
2916                } else {
2917                    e.returnValue = false;
2918                    return false;
2919                }
2920            } else {
2921                self._c = true;
2922            }
2923        };
2924
2925        self._onChange = function(e)
2926        {
2927            e = e || window.event;
2928            var target = e.target || e.srcElement;
2929            if (!target) {
2930                return;
2931            }
2932            if (hasClass(target, 'pika-select-month')) {
2933                self.gotoMonth(target.value);
2934            }
2935            else if (hasClass(target, 'pika-select-year')) {
2936                self.gotoYear(target.value);
2937            }
2938        };
2939
2940        self._onKeyChange = function(e)
2941        {
2942            e = e || window.event;
2943
2944            if (self.isVisible()) {
2945
2946                switch(e.keyCode){
2947                    case 13:
2948                    case 27:
2949                        if (opts.field) {
2950                            opts.field.blur();
2951                        }
2952                        break;
2953                    case 37:
2954                        e.preventDefault();
2955                        self.adjustDate('subtract', 1);
2956                        break;
2957                    case 38:
2958                        self.adjustDate('subtract', 7);
2959                        break;
2960                    case 39:
2961                        self.adjustDate('add', 1);
2962                        break;
2963                    case 40:
2964                        self.adjustDate('add', 7);
2965                        break;
2966                }
2967            }
2968        };
2969
2970        self._onInputChange = function(e)
2971        {
2972            var date;
2973
2974            if (e.firedBy === self) {
2975                return;
2976            }
2977            if (opts.parse) {
2978                date = opts.parse(opts.field.value, opts.format);
2979            } else if (hasMoment) {
2980                date = moment(opts.field.value, opts.format, opts.formatStrict);
2981                date = (date && date.isValid()) ? date.toDate() : null;
2982            }
2983            else {
2984                date = new Date(Date.parse(opts.field.value));
2985            }
2986            if (isDate(date)) {
2987              self.setDate(date);
2988            }
2989            if (!self._v) {
2990                self.show();
2991            }
2992        };
2993
2994        self._onInputFocus = function()
2995        {
2996            self.show();
2997        };
2998
2999        self._onInputClick = function()
3000        {
3001            self.show();
3002        };
3003
3004        self._onInputBlur = function()
3005        {
3006            // IE allows pika div to gain focus; catch blur the input field
3007            var pEl = document.activeElement;
3008            do {
3009                if (hasClass(pEl, 'pika-single')) {
3010                    return;
3011                }
3012            }
3013            while ((pEl = pEl.parentNode));
3014
3015            if (!self._c) {
3016                self._b = sto(function() {
3017                    self.hide();
3018                }, 50);
3019            }
3020            self._c = false;
3021        };
3022
3023        self._onClick = function(e)
3024        {
3025            e = e || window.event;
3026            var target = e.target || e.srcElement,
3027                pEl = target;
3028            if (!target) {
3029                return;
3030            }
3031            if (!hasEventListeners && hasClass(target, 'pika-select')) {
3032                if (!target.onchange) {
3033                    target.setAttribute('onchange', 'return;');
3034                    addEvent(target, 'change', self._onChange);
3035                }
3036            }
3037            do {
3038                if (hasClass(pEl, 'pika-single') || pEl === opts.trigger) {
3039                    return;
3040                }
3041            }
3042            while ((pEl = pEl.parentNode));
3043            if (self._v && target !== opts.trigger && pEl !== opts.trigger) {
3044                self.hide();
3045            }
3046        };
3047
3048        self.el = document.createElement('div');
3049        self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.theme ? ' ' + opts.theme : '');
3050
3051        addEvent(self.el, 'mousedown', self._onMouseDown, true);
3052        addEvent(self.el, 'touchend', self._onMouseDown, true);
3053        addEvent(self.el, 'change', self._onChange);
3054
3055        if (opts.keyboardInput) {
3056            addEvent(document, 'keydown', self._onKeyChange);
3057        }
3058
3059        if (opts.field) {
3060            if (opts.container) {
3061                opts.container.appendChild(self.el);
3062            } else if (opts.bound) {
3063                document.body.appendChild(self.el);
3064            } else {
3065                opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling);
3066            }
3067            addEvent(opts.field, 'change', self._onInputChange);
3068
3069            if (!opts.defaultDate) {
3070                if (hasMoment && opts.field.value) {
3071                    opts.defaultDate = moment(opts.field.value, opts.format).toDate();
3072                } else {
3073                    opts.defaultDate = new Date(Date.parse(opts.field.value));
3074                }
3075                opts.setDefaultDate = true;
3076            }
3077        }
3078
3079        var defDate = opts.defaultDate;
3080
3081        if (isDate(defDate)) {
3082            if (opts.setDefaultDate) {
3083                self.setDate(defDate, true);
3084            } else {
3085                self.gotoDate(defDate);
3086            }
3087        } else {
3088            self.gotoDate(new Date());
3089        }
3090
3091        if (opts.bound) {
3092            this.hide();
3093            self.el.className += ' is-bound';
3094            addEvent(opts.trigger, 'click', self._onInputClick);
3095            addEvent(opts.trigger, 'focus', self._onInputFocus);
3096            addEvent(opts.trigger, 'blur', self._onInputBlur);
3097        } else {
3098            this.show();
3099        }
3100    };
3101
3102
3103    /**
3104     * public Pikaday API
3105     */
3106    Pikaday.prototype = {
3107
3108
3109        /**
3110         * configure functionality
3111         */
3112        config: function(options)
3113        {
3114            if (!this._o) {
3115                this._o = extend({}, defaults, true);
3116            }
3117
3118            var opts = extend(this._o, options, true);
3119
3120            opts.isRTL = !!opts.isRTL;
3121
3122            opts.field = (opts.field && opts.field.nodeName) ? opts.field : null;
3123
3124            opts.theme = (typeof opts.theme) === 'string' && opts.theme ? opts.theme : null;
3125
3126            opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field);
3127
3128            opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field;
3129
3130            opts.disableWeekends = !!opts.disableWeekends;
3131
3132            opts.disableDayFn = (typeof opts.disableDayFn) === 'function' ? opts.disableDayFn : null;
3133
3134            var nom = parseInt(opts.numberOfMonths, 10) || 1;
3135            opts.numberOfMonths = nom > 4 ? 4 : nom;
3136
3137            if (!isDate(opts.minDate)) {
3138                opts.minDate = false;
3139            }
3140            if (!isDate(opts.maxDate)) {
3141                opts.maxDate = false;
3142            }
3143            if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) {
3144                opts.maxDate = opts.minDate = false;
3145            }
3146            if (opts.minDate) {
3147                this.setMinDate(opts.minDate);
3148            }
3149            if (opts.maxDate) {
3150                this.setMaxDate(opts.maxDate);
3151            }
3152
3153            if (isArray(opts.yearRange)) {
3154                var fallback = new Date().getFullYear() - 10;
3155                opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback;
3156                opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback;
3157            } else {
3158                opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange;
3159                if (opts.yearRange > 100) {
3160                    opts.yearRange = 100;
3161                }
3162            }
3163
3164            return opts;
3165        },
3166
3167        /**
3168         * return a formatted string of the current selection (using Moment.js if available)
3169         */
3170        toString: function(format)
3171        {
3172            format = format || this._o.format;
3173            if (!isDate(this._d)) {
3174                return '';
3175            }
3176            if (this._o.toString) {
3177              return this._o.toString(this._d, format);
3178            }
3179            if (hasMoment) {
3180              return moment(this._d).format(format);
3181            }
3182            return this._d.toDateString();
3183        },
3184
3185        /**
3186         * return a Moment.js object of the current selection (if available)
3187         */
3188        getMoment: function()
3189        {
3190            return hasMoment ? moment(this._d) : null;
3191        },
3192
3193        /**
3194         * set the current selection from a Moment.js object (if available)
3195         */
3196        setMoment: function(date, preventOnSelect)
3197        {
3198            if (hasMoment && moment.isMoment(date)) {
3199                this.setDate(date.toDate(), preventOnSelect);
3200            }
3201        },
3202
3203        /**
3204         * return a Date object of the current selection
3205         */
3206        getDate: function()
3207        {
3208            return isDate(this._d) ? new Date(this._d.getTime()) : null;
3209        },
3210
3211        /**
3212         * set the current selection
3213         */
3214        setDate: function(date, preventOnSelect)
3215        {
3216            if (!date) {
3217                this._d = null;
3218
3219                if (this._o.field) {
3220                    this._o.field.value = '';
3221                    fireEvent(this._o.field, 'change', { firedBy: this });
3222                }
3223
3224                return this.draw();
3225            }
3226            if (typeof date === 'string') {
3227                date = new Date(Date.parse(date));
3228            }
3229            if (!isDate(date)) {
3230                return;
3231            }
3232
3233            var min = this._o.minDate,
3234                max = this._o.maxDate;
3235
3236            if (isDate(min) && date < min) {
3237                date = min;
3238            } else if (isDate(max) && date > max) {
3239                date = max;
3240            }
3241
3242            this._d = new Date(date.getTime());
3243            setToStartOfDay(this._d);
3244            this.gotoDate(this._d);
3245
3246            if (this._o.field) {
3247                this._o.field.value = this.toString();
3248                fireEvent(this._o.field, 'change', { firedBy: this });
3249            }
3250            if (!preventOnSelect && typeof this._o.onSelect === 'function') {
3251                this._o.onSelect.call(this, this.getDate());
3252            }
3253        },
3254
3255        /**
3256         * change view to a specific date
3257         */
3258        gotoDate: function(date)
3259        {
3260            var newCalendar = true;
3261
3262            if (!isDate(date)) {
3263                return;
3264            }
3265
3266            if (this.calendars) {
3267                var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1),
3268                    lastVisibleDate = new Date(this.calendars[this.calendars.length-1].year, this.calendars[this.calendars.length-1].month, 1),
3269                    visibleDate = date.getTime();
3270                // get the end of the month
3271                lastVisibleDate.setMonth(lastVisibleDate.getMonth()+1);
3272                lastVisibleDate.setDate(lastVisibleDate.getDate()-1);
3273                newCalendar = (visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate);
3274            }
3275
3276            if (newCalendar) {
3277                this.calendars = [{
3278                    month: date.getMonth(),
3279                    year: date.getFullYear()
3280                }];
3281                if (this._o.mainCalendar === 'right') {
3282                    this.calendars[0].month += 1 - this._o.numberOfMonths;
3283                }
3284            }
3285
3286            this.adjustCalendars();
3287        },
3288
3289        adjustDate: function(sign, days) {
3290
3291            var day = this.getDate() || new Date();
3292            var difference = parseInt(days)*24*60*60*1000;
3293
3294            var newDay;
3295
3296            if (sign === 'add') {
3297                newDay = new Date(day.valueOf() + difference);
3298            } else if (sign === 'subtract') {
3299                newDay = new Date(day.valueOf() - difference);
3300            }
3301
3302            this.setDate(newDay);
3303        },
3304
3305        adjustCalendars: function() {
3306            this.calendars[0] = adjustCalendar(this.calendars[0]);
3307            for (var c = 1; c < this._o.numberOfMonths; c++) {
3308                this.calendars[c] = adjustCalendar({
3309                    month: this.calendars[0].month + c,
3310                    year: this.calendars[0].year
3311                });
3312            }
3313            this.draw();
3314        },
3315
3316        gotoToday: function()
3317        {
3318            this.gotoDate(new Date());
3319        },
3320
3321        /**
3322         * change view to a specific month (zero-index, e.g. 0: January)
3323         */
3324        gotoMonth: function(month)
3325        {
3326            if (!isNaN(month)) {
3327                this.calendars[0].month = parseInt(month, 10);
3328                this.adjustCalendars();
3329            }
3330        },
3331
3332        nextMonth: function()
3333        {
3334            this.calendars[0].month++;
3335            this.adjustCalendars();
3336        },
3337
3338        prevMonth: function()
3339        {
3340            this.calendars[0].month--;
3341            this.adjustCalendars();
3342        },
3343
3344        /**
3345         * change view to a specific full year (e.g. "2012")
3346         */
3347        gotoYear: function(year)
3348        {
3349            if (!isNaN(year)) {
3350                this.calendars[0].year = parseInt(year, 10);
3351                this.adjustCalendars();
3352            }
3353        },
3354
3355        /**
3356         * change the minDate
3357         */
3358        setMinDate: function(value)
3359        {
3360            if(value instanceof Date) {
3361                setToStartOfDay(value);
3362                this._o.minDate = value;
3363                this._o.minYear  = value.getFullYear();
3364                this._o.minMonth = value.getMonth();
3365            } else {
3366                this._o.minDate = defaults.minDate;
3367                this._o.minYear  = defaults.minYear;
3368                this._o.minMonth = defaults.minMonth;
3369                this._o.startRange = defaults.startRange;
3370            }
3371
3372            this.draw();
3373        },
3374
3375        /**
3376         * change the maxDate
3377         */
3378        setMaxDate: function(value)
3379        {
3380            if(value instanceof Date) {
3381                setToStartOfDay(value);
3382                this._o.maxDate = value;
3383                this._o.maxYear = value.getFullYear();
3384                this._o.maxMonth = value.getMonth();
3385            } else {
3386                this._o.maxDate = defaults.maxDate;
3387                this._o.maxYear = defaults.maxYear;
3388                this._o.maxMonth = defaults.maxMonth;
3389                this._o.endRange = defaults.endRange;
3390            }
3391
3392            this.draw();
3393        },
3394
3395        setStartRange: function(value)
3396        {
3397            this._o.startRange = value;
3398        },
3399
3400        setEndRange: function(value)
3401        {
3402            this._o.endRange = value;
3403        },
3404
3405        /**
3406         * refresh the HTML
3407         */
3408        draw: function(force)
3409        {
3410            if (!this._v && !force) {
3411                return;
3412            }
3413            var opts = this._o,
3414                minYear = opts.minYear,
3415                maxYear = opts.maxYear,
3416                minMonth = opts.minMonth,
3417                maxMonth = opts.maxMonth,
3418                html = '',
3419                randId;
3420
3421            if (this._y <= minYear) {
3422                this._y = minYear;
3423                if (!isNaN(minMonth) && this._m < minMonth) {
3424                    this._m = minMonth;
3425                }
3426            }
3427            if (this._y >= maxYear) {
3428                this._y = maxYear;
3429                if (!isNaN(maxMonth) && this._m > maxMonth) {
3430                    this._m = maxMonth;
3431                }
3432            }
3433
3434            randId = 'pika-title-' + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 2);
3435
3436            for (var c = 0; c < opts.numberOfMonths; c++) {
vendor: 7,187 bytes, lines 3436-3604
3436
3437                html += '<div class="pika-lendar">' + renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year, randId) + this.render(this.calendars[c].year, this.calendars[c].month, randId) + '</div>';
3438            }
3439
3440            this.el.innerHTML = html;
3441
3442            if (opts.bound) {
3443                if(opts.field.type !== 'hidden') {
3444                    sto(function() {
3445                        opts.trigger.focus();
3446                    }, 1);
3447                }
3448            }
3449
3450            if (typeof this._o.onDraw === 'function') {
3451                this._o.onDraw(this);
3452            }
3453
3454            if (opts.bound) {
3455                // let the screen reader user know to use arrow keys
3456                opts.field.setAttribute('aria-label', opts.ariaLabel);
3457            }
3458        },
3459
3460        adjustPosition: function()
3461        {
3462            var field, pEl, width, height, viewportWidth, viewportHeight, scrollTop, left, top, clientRect, leftAligned, bottomAligned;
3463
3464            if (this._o.container) return;
3465
3466            this.el.style.position = 'absolute';
3467
3468            field = this._o.trigger;
3469            pEl = field;
3470            width = this.el.offsetWidth;
3471            height = this.el.offsetHeight;
3472            viewportWidth = window.innerWidth || document.documentElement.clientWidth;
3473            viewportHeight = window.innerHeight || document.documentElement.clientHeight;
3474            scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
3475            leftAligned = true;
3476            bottomAligned = true;
3477
3478            if (typeof field.getBoundingClientRect === 'function') {
3479                clientRect = field.getBoundingClientRect();
3480                left = clientRect.left + window.pageXOffset;
3481                top = clientRect.bottom + window.pageYOffset;
3482            } else {
3483                left = pEl.offsetLeft;
3484                top  = pEl.offsetTop + pEl.offsetHeight;
3485                while((pEl = pEl.offsetParent)) {
3486                    left += pEl.offsetLeft;
3487                    top  += pEl.offsetTop;
3488                }
3489            }
3490
3491            // default position is bottom & left
3492            if ((this._o.reposition && left + width > viewportWidth) ||
3493                (
3494                    this._o.position.indexOf('right') > -1 &&
3495                    left - width + field.offsetWidth > 0
3496                )
3497            ) {
3498                left = left - width + field.offsetWidth;
3499                leftAligned = false;
3500            }
3501            if ((this._o.reposition && top + height > viewportHeight + scrollTop) ||
3502                (
3503                    this._o.position.indexOf('top') > -1 &&
3504                    top - height - field.offsetHeight > 0
3505                )
3506            ) {
3507                top = top - height - field.offsetHeight;
3508                bottomAligned = false;
3509            }
3510
3511            this.el.style.left = left + 'px';
3512            this.el.style.top = top + 'px';
3513
3514            addClass(this.el, leftAligned ? 'left-aligned' : 'right-aligned');
3515            addClass(this.el, bottomAligned ? 'bottom-aligned' : 'top-aligned');
3516            removeClass(this.el, !leftAligned ? 'left-aligned' : 'right-aligned');
3517            removeClass(this.el, !bottomAligned ? 'bottom-aligned' : 'top-aligned');
3518        },
3519
3520        /**
3521         * render HTML for a particular month
3522         */
3523        render: function(year, month, randId)
3524        {
3525            var opts   = this._o,
3526                now    = new Date(),
3527                days   = getDaysInMonth(year, month),
3528                before = new Date(year, month, 1).getDay(),
3529                data   = [],
3530                row    = [];
3531            setToStartOfDay(now);
3532            if (opts.firstDay > 0) {
3533                before -= opts.firstDay;
3534                if (before < 0) {
3535                    before += 7;
3536                }
3537            }
3538            var previousMonth = month === 0 ? 11 : month - 1,
3539                nextMonth = month === 11 ? 0 : month + 1,
3540                yearOfPreviousMonth = month === 0 ? year - 1 : year,
3541                yearOfNextMonth = month === 11 ? year + 1 : year,
3542                daysInPreviousMonth = getDaysInMonth(yearOfPreviousMonth, previousMonth);
3543            var cells = days + before,
3544                after = cells;
3545            while(after > 7) {
3546                after -= 7;
3547            }
3548            cells += 7 - after;
3549            var isWeekSelected = false;
3550            for (var i = 0, r = 0; i < cells; i++)
3551            {
3552                var day = new Date(year, month, 1 + (i - before)),
3553                    isSelected = isDate(this._d) ? compareDates(day, this._d) : false,
3554                    isToday = compareDates(day, now),
3555                    hasEvent = opts.events.indexOf(day.toDateString()) !== -1 ? true : false,
3556                    isEmpty = i < before || i >= (days + before),
3557                    dayNumber = 1 + (i - before),
3558                    monthNumber = month,
3559                    yearNumber = year,
3560                    isStartRange = opts.startRange && compareDates(opts.startRange, day),
3561                    isEndRange = opts.endRange && compareDates(opts.endRange, day),
3562                    isInRange = opts.startRange && opts.endRange && opts.startRange < day && day < opts.endRange,
3563                    isDisabled = (opts.minDate && day < opts.minDate) ||
3564                                 (opts.maxDate && day > opts.maxDate) ||
3565                                 (opts.disableWeekends && isWeekend(day)) ||
3566                                 (opts.disableDayFn && opts.disableDayFn(day));
3567
3568                if (isEmpty) {
3569                    if (i < before) {
3570                        dayNumber = daysInPreviousMonth + dayNumber;
3571                        monthNumber = previousMonth;
3572                        yearNumber = yearOfPreviousMonth;
3573                    } else {
3574                        dayNumber = dayNumber - days;
3575                        monthNumber = nextMonth;
3576                        yearNumber = yearOfNextMonth;
3577                    }
3578                }
3579
3580                var dayConfig = {
3581                        day: dayNumber,
3582                        month: monthNumber,
3583                        year: yearNumber,
3584                        hasEvent: hasEvent,
3585                        isSelected: isSelected,
3586                        isToday: isToday,
3587                        isDisabled: isDisabled,
3588                        isEmpty: isEmpty,
3589                        isStartRange: isStartRange,
3590                        isEndRange: isEndRange,
3591                        isInRange: isInRange,
3592                        showDaysInNextAndPreviousMonths: opts.showDaysInNextAndPreviousMonths,
3593                        enableSelectionDaysInNextAndPreviousMonths: opts.enableSelectionDaysInNextAndPreviousMonths
3594                    };
3595
3596                if (opts.pickWholeWeek && isSelected) {
3597                    isWeekSelected = true;
3598                }
3599
3600                row.push(renderDay(dayConfig));
3601
3602                if (++r === 7) {
3603                    if (opts.showWeekNumber) {
3604                        row.unshift(renderWeek(i - before, month, year
vendor: 2,564 bytes, lines 3604-3687
3604));
3605                    }
3606                    data.push(renderRow(row, opts.isRTL, opts.pickWholeWeek, isWeekSelected));
3607                    row = [];
3608                    r = 0;
3609                    isWeekSelected = false;
3610                }
3611            }
3612            return renderTable(opts, data, randId);
3613        },
3614
3615        isVisible: function()
3616        {
3617            return this._v;
3618        },
3619
3620        show: function()
3621        {
3622            if (!this.isVisible()) {
3623                this._v = true;
3624                this.draw();
3625                removeClass(this.el, 'is-hidden');
3626                if (this._o.bound) {
3627                    addEvent(document, 'click', this._onClick);
3628                    this.adjustPosition();
3629                }
3630                if (typeof this._o.onOpen === 'function') {
3631                    this._o.onOpen.call(this);
3632                }
3633            }
3634        },
3635
3636        hide: function()
3637        {
3638            var v = this._v;
3639            if (v !== false) {
3640                if (this._o.bound) {
3641                    removeEvent(document, 'click', this._onClick);
3642                }
3643                this.el.style.position = 'static'; // reset
3644                this.el.style.left = 'auto';
3645                this.el.style.top = 'auto';
3646                addClass(this.el, 'is-hidden');
3647                this._v = false;
3648                if (v !== undefined && typeof this._o.onClose === 'function') {
3649                    this._o.onClose.call(this);
3650                }
3651            }
3652        },
3653
3654        /**
3655         * GAME OVER
3656         */
3657        destroy: function()
3658        {
3659            var opts = this._o;
3660
3661            this.hide();
3662            removeEvent(this.el, 'mousedown', this._onMouseDown, true);
3663            removeEvent(this.el, 'touchend', this._onMouseDown, true);
3664            removeEvent(this.el, 'change', this._onChange);
3665            if (opts.keyboardInput) {
3666                removeEvent(document, 'keydown', this._onKeyChange);
3667            }
3668            if (opts.field) {
3669                removeEvent(opts.field, 'change', this._onInputChange);
3670                if (opts.bound) {
3671                    removeEvent(opts.trigger, 'click', this._onInputClick);
3672                    removeEvent(opts.trigger, 'focus', this._onInputFocus);
3673                    removeEvent(opts.trigger, 'blur', this._onInputBlur);
3674                }
3675            }
3676            if (this.el.parentNode) {
3677                this.el.parentNode.removeChild(this.el);
3678            }
3679        }
3680
3681    };
3682
3683    return Pikaday;
3684}));
3685
3686/*!
3687 * jQuery Rellax Plugin v0.3.7.1
3688 * Examples and documentation at http://pixelgrade.github.io/rellax/
3689 * Copyright (c) 2016-2020 Pixelgrade https://pixelgrade.com
3690 * Licensed under MIT http://www.opensource.org/licenses/mit-license.php/
3691 */
3692;(
3693	function( $, window, document, undefined ) {
3694
3695		if ( ! window.requestAnimationFrame ) {
3696			return;
3697		}
3698
3699		function Rellax( element, options ) {
3700			this.$el = $( element );
3701			this.ready = false;
3702			this.options = $.extend( $.fn.rellax.defaults, options );
3703			this.$parent = this.$el.parent().closest( this.options.container );
3704			this.parent = this.$parent.data( "plugin_" + Rellax );
3705
3706			var $el = this.$el,
3707				amount = $el.data( 'rellax-amount' ),
3708				bleed = $el.data( 'rellax-bleed' ),
3709				fill = $el.data( 'rellax-fill' ),
3710				scale = $el.data( 'rellax-scale' );
3711
3712			this.options.amount = amount !== undefined ? parseFloat( amount ) : this.options.amount;
3713			this.options.bleed = bleed !== undefined ? parseFloat( bleed ) : this.options.bleed;
3714			this.options.scale = scale !== undefined ? parseFloat( scale ) : this.options.scale;
3715			this.options.fill = fill !== undefined;
3716
3717			if ( this.options.amount === 0 ) {
3718				return;
3719			}
3720
3721			this._setParentHeight();
3722			this._resetElement();
3723			this._reloadElement();
3724			this._prepareElement();
3725			this._updatePosition();
3726
3727			elements.push( this );
3728		}
3729
3730		$.extend( Rellax.prototype, {
3731			constructor: Rellax,
3732			_resetElement: function() {
3733				this.$el.css({
3734					position: '',
3735					top: '',
3736					left: '',
3737					width: '',
3738					height: '',
3739					transform: ''
3740				});
3741			},
3742			_reloadElement: function() {
3743				this.$el.css({
3744					position: '',
3745					top: '',
3746					left: '',
3747					width: '',
3748					height: ''
3749				});
3750				this.offset = this.$el.offset();
3751				this.height = this.$el.outerHeight();
3752				this.width = this.$el.outerWidth();
3753
3754				if ( this.parent === undefined ) {
3755					this.offset.top -= this.options.bleed;
3756					this.height += 2 * this.options.bleed;
3757				}
3758
3759				this.ready = true;
3760			},
3761			_scaleElement: function() {
3762				var parentHeight = this.$parent.outerHeight(),
3763					parentWidth = this.$parent.outerWidth(),
3764					scaleY = ( parentHeight + ( windowHeight - parentHeight ) * ( 1 - this.options.amount ) ) / this.height,
3765					scaleX = parentWidth / this.width,
3766					scale = Math.max(scaleX, scaleY);
3767
3768				this.width = this.width * scale;
3769				this.height = this.height * scale;
3770
3771				this.offset.top = ( parentHeight - this.height ) / 2;
3772				this.offset.left = ( parentWidth - this.width ) / 2;
3773			},
3774			_prepareElement: function() {
3775				if ( this.parent === undefined ) {
3776					this.$el.addClass( 'rellax-element' );
3777					this.$el.css({
3778						position: 'fixed',
3779						top: this.offset.top,
3780						left: this.offset.left,
3781						width: this.width,
3782						height: this.height
3783					});
3784				} else {
3785					this._scaleElement();
3786					this.$el.css({
3787						position: 'absolute',
3788						top: this.offset.top,
3789						left: this.offset.left,
3790						width: this.width,
3791						height: this.height
3792					});
3793				}
3794			},
3795			_setParentHeight: function() {
3796				if ( this.parent == undefined ) {
3797					var $parent = this.$el.parent(),
3798						parentHeight = $parent.css( 'minHeight', '' ).outerHeight();
3799
3800					parentHeight = windowHeight < parentHeight ? windowHeight : parentHeight;
3801					$parent.css( 'minHeight', parentHeight );
3802				}
3803			},
3804			_updatePosition: function( forced ) {
3805
3806				if ( this.ready !== true ) return;
3807
3808				var progress = this._getProgress(),
3809					height = this.parent !== undefined ? this.parent.height : this.height,
3810					move = ( windowHeight + height ) * ( progress - 0.5 ) * this.options.amount,
3811					scale = 1 + ( this.options.scale - 1 ) * progress,
3812					scaleTransform = scale >= 1 ? 'scale(' + scale + ')' : '';
3813
3814				if ( this.parent === undefined ) {
3815					move *= -1;
3816				}
3817
3818				if ( forced !== true && ( progress < 0 || progress > 1 ) ) {
3819					this.$el.addClass( 'rellax-hidden' );
3820					return;
3821				}
3822
3823				this.$el.removeClass( 'rellax-hidden' );
3824
3825				this.$el.data( 'progress', progress );
3826
3827				if ( this.$el.is( this.options.container ) ) {
3828					this.$el.css( 'transform', 'translate3d(0,' + ( - lastScrollY ) + 'px,0)' );
3829				} else {
3830					this.$el.css( 'transform', 'translate3d(0,' + move + 'px,0) ' + scaleTransform );
3831				}
3832			},
3833			_getProgress: function() {
3834				if ( this.parent !== undefined ) {
3835					return parseFloat( this.$parent.data( 'progress' ) );
3836				} else {
3837					return ( ( lastScrollY - this.offset.top + windowHeight ) / ( windowHeight + this.height ) );
3838				}
3839			}
3840		} );
3841
3842		$.fn.rellax = function( options ) {
3843			return this.each( function() {
3844				var element = $.data( this, "plugin_" + Rellax ),
3845					idx;
3846
3847				if ( typeof options !== "string" && typeof element === "undefined" ) {
3848					$.data( this, "plugin_" + Rellax, new Rellax( this, options ) );
3849				} else {
3850					if ( options === "destroy" ) {
3851						idx = elements.indexOf( element );
3852						if ( idx > - 1 ) {
3853							elements[idx]._resetElement();
3854							elements[idx].$el.removeClass( 'rellax-element rellax-hidden' );
3855							$.removeData( this, "plugin_" + Rellax );
3856							elements.splice( idx, 1 );
3857						}
3858					}
3859				}
3860			} );
3861		};
3862
3863		$.fn.rellax.defaults = {
3864			amount: 0.5,
3865			bleed: 0,
3866			scale: 1,
3867			container: "[data-rellax-container]"
3868		};
3869
3870		var $window = $( window ),
3871			windowWidth = window.screen.width || window.innerWidth,
3872			windowHeight = window.screen.height || window.innerHeight ,
3873			lastScrollY = (window.pageYOffset || document.documentElement.scrollTop)  - (document.documentElement.clientTop || 0),
3874			frameRendered = true,
3875			elements = [];
3876
3877		function render() {
3878			if ( frameRendered !== true ) {
3879				updateAll();
3880			}
3881			window.requestAnimationFrame( render );
3882			frameRendered = true;
3883		}
3884
3885		function updateAll( forced ) {
3886			$.each(elements, function(i, element) {
3887				element._updatePosition( forced );
3888			});
3889		}
3890
3891		function resetAll() {
3892			$.each(elements, function(i, element) {
3893				element._resetElement();
3894			});
3895		}
3896
3897		function reloadAll() {
3898			$.each(elements, function(i, element) {
3899				element._reloadElement();
3900			});
3901		}
3902
3903		function prepareAll() {
3904			$.each(elements, function(i, element) {
3905				element._prepareElement();
3906			});
3907		}
3908
3909		function setHeights() {
3910			$.each(elements, function(i, element) {
3911				element._setParentHeight();
3912			});
3913		}
3914
3915		function badRestart() {
3916			windowWidth = window.innerWidth;
3917			windowHeight = window.innerHeight;
3918			setHeights();
3919			resetAll();
3920			reloadAll();
3921			prepareAll();
3922			updateAll( true );
3923			$( window ).trigger( 'rellax:restart' );
3924		}
3925
3926
3927		function debounce(func, wait, immediate) {
3928			var timeout;
3929			return function() {
3930				var context = this, args = arguments;
3931				var later = function() {
3932					timeout = null;
3933					if (!immediate) func.apply(context, args);
3934				};
3935				var callNow = immediate && !timeout;
3936				clearTimeout(timeout);
3937				timeout = setTimeout(later, wait);
3938				if (callNow) func.apply(context, args);
3939			};
3940		}
3941
3942		function bindEvents() {
3943			var restart = debounce( badRestart, 300 );
3944
3945			$( document ).ready( render );
3946
3947			$window.on( 'scroll', function() {
3948				if ( frameRendered === true ) {
3949					lastScrollY = (window.pageYOffset || document.documentElement.scrollTop) - (document.documentElement.clientTop || 0);
3950				}
3951				frameRendered = false;
3952			});
3953
3954			$window.on( 'rellax', restart );
3955		}
3956
3957		bindEvents();
3958	}
3959)( jQuery, window, document );
3960
3961/* ==== RESPOND JS ==== */
3962
3963/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
3964/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
3965window.matchMedia = window.matchMedia || function (a) {
3966	"use strict";
3967	var c, d = a.documentElement, e = d.firstElementChild || d.firstChild, f = a.createElement("body"), g = a.createElement("div");
3968	return g.id = "mq-test-1", g.style.cssText = "position:absolute;top:-100em", f.style.background = "none", f.appendChild(g), function (a) {
3969		return g.innerHTML = '&shy;<style media="' + a + '"> #mq-test-1 { width: 42px; }</style>', d.insertBefore(f, e), c = 42 === g.offsetWidth, d.removeChild(f), {
3970			matches: c,
3971			media: a
3972		}
3973	}
3974}(document);
3975
3976/*! Respond.js v1.3.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs  */
3977(function (a) {
3978	"use strict";
3979	function x() {
3980		u(!0)
3981	}
3982
3983	var b = {};
3984	if (a.respond = b, b.update = function () {
3985		}, b.mediaQueriesSupported = a.matchMedia && a.matchMedia("only all").matches, !b.mediaQueriesSupported) {
3986		var q, r, t, c = a.document, d = c.documentElement, e = [], f = [], g = [], h = {}, i = 30, j = c.getElementsByTagName("head")[0] || d, k = c.getElementsByTagName("base")[0], l = j.getElementsByTagName("link"), m = [], n = function () {
3987			for (var b = 0; l.length > b; b++) {
3988				var c = l[b], d = c.href, e = c.media, f = c.rel && "stylesheet" === c.rel.toLowerCase();
3989				d && f && !h[d] && (c.styleSheet && c.styleSheet.rawCssText ? (p(c.styleSheet.rawCssText, d, e), h[d] = !0) : (!/^([a-zA-Z:]*\/\/)/.test(d) && !k || d.replace(RegExp.$1, "").split("/")[0] === a.location.host) && m.push({
3990					href: d,
3991					media: e
3992				}))
3993			}
3994			o()
3995		}, o = function () {
3996			if (m.length) {
3997				var b = m.shift();
3998				v(b.href, function (c) {
3999					p(c, b.href, b.media), h[b.href] = !0, a.setTimeout(function () {
4000						o()
4001					}, 0)
4002				})
4003			}
4004		}, p = function (a, b, c) {
4005			var d = a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi), g = d && d.length || 0;
4006			b = b.substring(0, b.lastIndexOf("/"));
4007			var h = function (a) {
4008				return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, "$1" + b + "$2$3")
4009			}, i = !g && c;
4010			b.length && (b += "/"), i && (g = 1);
4011			for (var j = 0; g > j; j++) {
4012				var k, l, m, n;
4013				i ? (k = c, f.push(h(a))) : (k = d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/) && RegExp.$1, f.push(RegExp.$2 && h(RegExp.$2))), m = k.split(","), n = m.length;
4014				for (var o = 0; n > o; o++)l = m[o], e.push({
4015					media: l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/) && RegExp.$2 || "all",
4016					rules: f.length - 1,
4017					hasquery: l.indexOf("(") > -1,
4018					minw: l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/) && parseFloat(RegExp.$1) + (RegExp.$2 || ""),
4019					maxw: l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/) && parseFloat(RegExp.$1) + (RegExp.$2 || "")
4020				})
4021			}
4022			u()
4023		}, s = function () {
4024			var a, b = c.createElement("div"), e = c.body, f = !1;
4025			return b.style.cssText = "position:absolute;font-size:1em;width:1em", e || (e = f = c.createElement("body"), e.style.background = "none"), e.appendChild(b), d.insertBefore(e, d.firstChild), a = b.offsetWidth, f ? d.removeChild(e) : e.removeChild(b), a = t = parseFloat(a)
4026		}, u = function (b) {
4027			var h = "clientWidth", k = d[h], m = "CSS1Compat" === c.compatMode && k || c.body[h] || k, n = {}, o = l[l.length - 1], p = (new Date).getTime();
4028			if (b && q && i > p - q)return a.clearTimeout(r), r = a.setTimeout(u, i), void 0;
4029			q = p;
4030			for (var v in e)if (e.hasOwnProperty(v)) {
4031				var w = e[v], x = w.minw, y = w.maxw, z = null === x, A = null === y, B = "em";
4032				x && (x = parseFloat(x) * (x.indexOf(B) > -1 ? t || s() : 1)), y && (y = parseFloat(y) * (y.indexOf(B) > -1 ? t || s() : 1)), w.hasquery && (z && A || !(z || m >= x) || !(A || y >= m)) || (n[w.media] || (n[w.media] = []), n[w.media].push(f[w.rules]))
4033			}
4034			for (var C in g)g.hasOwnProperty(C) && g[C] && g[C].parentNode === j && j.removeChild(g[C]);
4035			for (var D in n)if (n.hasOwnProperty(D)) {
4036				var E = c.createElement("style"), F = n[D].join("\n");
4037				E.type = "text/css", E.media = D, j.insertBefore(E, o.nextSibling), E.styleSheet ? E.styleSheet.cssText = F : E.appendChild(c.createTextNode(F)), g.push(E)
4038			}
4039		}, v = function (a, b) {
4040			var c = w();
4041			c && (c.open("GET", a, !0), c.onreadystatechange = function () {
4042				4 !== c.readyState || 200 !== c.status && 304 !== c.status || b(c.responseText)
4043			}, 4 !== c.readyState && c.send(null))
4044		}, w = function () {
4045			var b = !1;
4046			try {
4047				b = new a.XMLHttpRequest
4048			} catch (c) {
4049				b = new a.ActiveXObject("Microsoft.XMLHTTP")
4050			}
4051			return function () {
4052				return b
4053			}
4054		}();
4055		n(), b.update = n, a.addEventListener ? a.addEventListener("resize", x, !1) : a.attachEvent && a.attachEvent("onresize", x)
4056	}
4057})(this);
4058
4059// Avoid `console` errors in browsers that lack a console.
4060(function () {
4061	var method;
4062	var noop = function () {
4063	};
4064	var methods = [
4065		'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
4066		'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
4067		'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
4068		'timeStamp', 'trace', 'warn'
4069	];
4070	var length = methods.length;
4071	var console = (window.console = window.console || {});
4072
4073	while (length--) {
4074		method = methods[length];
4075
4076		// Only stub undefined methods.
4077		if (!console[method]) {
4078			console[method] = noop;
4079		}
4080	}
4081}());
4082
4083/*!
4084 Autosize v1.17.8 - 2013-09-07
4085 Automatically adjust textarea height based on user input.
4086 (c) 2013 Jack Moore - http://www.jacklmoore.com/autosize
4087 license: http://www.opensource.org/licenses/mit-license.php
4088 */
4089(function (e) {
4090	"function" == typeof define && define.amd ? define(["jquery"], e) : e(window.jQuery || window.$)
4091})(function (e) {
4092	var t, o = {
4093		className: "autosizejs",
4094		append: "",
4095		callback: !1,
4096		resizeDelay: 10
4097	}, i = '<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>', n = ["fontFamily", "fontSize", "fontWeight", "fontStyle", "letterSpacing", "textTransform", "wordSpacing", "textIndent"], s = e(i).data("autosize", !0)[0];
4098	s.style.lineHeight = "99px", "99px" === e(s).css("lineHeight") && n.push("lineHeight"), s.style.lineHeight = "", e.fn.autosize = function (i) {
4099		return this.length ? (i = e.extend({}, o, i || {}), s.parentNode !== document.body && e(document.body).append(s), this.each(function () {
4100			function o() {
4101				var t, o;
4102				"getComputedStyle"in window ? (t = window.getComputedStyle(u), o = u.getBoundingClientRect().width, e.each(["paddingLeft", "paddingRight", "borderLeftWidth", "borderRightWidth"], function (e, i) {
4103					o -= parseInt(t[i], 10)
4104				}), s.style.width = o + "px") : s.style.width = Math.max(p.width(), 0) + "px"
4105			}
4106
4107			function a() {
4108				var a = {};
4109				if (t = u, s.className = i.className, d = parseInt(p.css("maxHeight"), 10), e.each(n, function (e, t) {
4110						a[t] = p.css(t)
4111					}), e(s).css(a), o(), window.chrome) {
4112					var r = u.style.width;
4113					u.style.width = "0px", u.offsetWidth, u.style.width = r
4114				}
4115			}
4116
4117			function r() {
4118				var e, n;
4119				t !== u ? a() : o(), s.value = u.value + i.append, s.style.overflowY = u.style.overflowY, n = parseInt(u.style.height, 10), s.scrollTop = 0, s.scrollTop = 9e4, e = s.scrollTop, d && e > d ? (u.style.overflowY = "scroll", e = d) : (u.style.overflowY = "hidden", c > e && (e = c)), e += f, n !== e && (u.style.height = e + "px", w && i.callback.call(u, u))
4120			}
4121
4122			function l() {
4123				clearTimeout(h), h = setTimeout(function () {
4124					var e = p.width();
4125					e !== g && (g = e, r())
4126				}, parseInt(i.resizeDelay, 10))
4127			}
4128
4129			var d, c, h, u = this, p = e(u), f = 0, w = e.isFunction(i.callback), z = {
4130				height: u.style.height,
4131				overflow: u.style.overflow,
4132				overflowY: u.style.overflowY,
4133				wordWrap: u.style.wordWrap,
4134				resize: u.style.resize
4135			}, g = p.width();
4136			p.data("autosize") || (p.data("autosize", !0), ("border-box" === p.css("box-sizing") || "border-box" === p.css("-moz-box-sizing") || "border-box" === p.css("-webkit-box-sizing")) && (f = p.outerHeight() - p.height()), c = Math.max(parseInt(p.css("minHeight"), 10) - f || 0, p.height()), p.css({
4137				overflow: "hidden",
4138				overflowY: "hidden",
4139				wordWrap: "break-word",
4140				resize: "none" === p.css("resize") || "vertical" === p.css("resize") ? "none" : "horizontal"
4141			}), "onpropertychange"in u ? "oninput"in u ? p.on("input.autosize keyup.autosize", r) : p.on("propertychange.autosize", function () {
4142				"value" === event.propertyName && r()
4143			}) : p.on("input.autosize", r), i.resizeDelay !== !1 && e(window).on("resize.autosize", l), p.on("autosize.resize", r), p.on("autosize.resizeIncludeStyle", function () {
4144				t = null, r()
4145			}), p.on("autosize.destroy", function () {
4146				t = null, clearTimeout(h), e(window).off("resize", l), p.off("autosize").off(".autosize").css(z).removeData("autosize")
4147			}
4147), r())
4148		})) : this
4149	}
4150});
4151
4152// Place any jQuery/helper plugins in here.
4153
4154

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.