/* Minification failed. Returning unminified contents.
(660,317-324): run-time error JS1019: Can't have 'break' outside of loop: break a
 */
window.Modernizr = (function(r, d, i) {
	var e,
		o,
		a,
		c = {},
		f = d.documentElement,
		m = 'modernizr',
		t = d.createElement(m),
		s = t.style,
		u = d.createElement('input'),
		l = ':)',
		n = {}.toString,
		p = ' -webkit- -moz- -o- -ms- '.split(' '),
		h = 'Webkit Moz O ms',
		g = h.split(' '),
		v = h.toLowerCase().split(' '),
		y = 'http://www.w3.org/2000/svg',
		b = {},
		E = {},
		x = {},
		w = [],
		S = w.slice,
		C = function(e, t, n, r) {
			var o,
				a,
				i,
				c,
				s = d.createElement('div'),
				u = d.body,
				l = u || d.createElement('body');
			if (parseInt(n, 10)) for (; n--; ) ((i = d.createElement('div')).id = r ? r[n] : m + (n + 1)), s.appendChild(i);
			return (
				(o = ['&#173;', '<style id="s', m, '">', e, '</style>'].join('')),
				(s.id = m),
				((u ? s : l).innerHTML += o),
				l.appendChild(s),
				u || ((l.style.background = ''), (l.style.overflow = 'hidden'), (c = f.style.overflow), (f.style.overflow = 'hidden'), f.appendChild(l)),
				(a = t(s, e)),
				u ? s.parentNode.removeChild(s) : (l.parentNode.removeChild(l), (f.style.overflow = c)),
				!!a
			);
		},
		k = ((a = { select: 'input', change: 'input', submit: 'form', reset: 'form', error: 'img', load: 'img', abort: 'img' }),
		function(e, t) {
			t = t || d.createElement(a[e] || 'div');
			var n = (e = 'on' + e) in t;
			return (
				n ||
					(t.setAttribute || (t = d.createElement('div')),
					t.setAttribute &&
						t.removeAttribute &&
						(t.setAttribute(e, ''), (n = M(t[e], 'function')), M(t[e], 'undefined') || (t[e] = i), t.removeAttribute(e))),
				(t = null),
				n
			);
		}),
		T = {}.hasOwnProperty;
	function N(e) {
		s.cssText = e;
	}
	function M(e, t) {
		return typeof e === t;
	}
	function P(e, t) {
		return !!~('' + e).indexOf(t);
	}
	function j(e, t) {
		for (var n in e) {
			var r = e[n];
			if (!P(r, '-') && s[r] !== i) return 'pfx' != t || r;
		}
		return !1;
	}
	function $(e, t, n) {
		var r = e.charAt(0).toUpperCase() + e.slice(1),
			o = (e + ' ' + g.join(r + ' ') + r).split(' ');
		return M(t, 'string') || M(t, 'undefined')
			? j(o, t)
			: (function(e, t, n) {
					for (var r in e) {
						var o = t[e[r]];
						if (o !== i) return !1 === n ? e[r] : M(o, 'function') ? o.bind(n || t) : o;
					}
					return !1;
			  })((o = (e + ' ' + v.join(r + ' ') + r).split(' ')), t, n);
	}
	for (var D in ((o =
		M(T, 'undefined') || M(T.call, 'undefined')
			? function(e, t) {
					return t in e && M(e.constructor.prototype[t], 'undefined');
			  }
			: function(e, t) {
					return T.call(e, t);
			  }),
	Function.prototype.bind ||
		(Function.prototype.bind = function(r) {
			var o = this;
			if ('function' != typeof o) throw new TypeError();
			var a = S.call(arguments, 1),
				i = function() {
					if (this instanceof i) {
						var e = function() {};
						e.prototype = o.prototype;
						var t = new e(),
							n = o.apply(t, a.concat(S.call(arguments)));
						return Object(n) === n ? n : t;
					}
					return o.apply(r, a.concat(S.call(arguments)));
				};
			return i;
		}),
	(b.flexbox = function() {
		return $('flexWrap');
	}),
	(b.flexboxlegacy = function() {
		return $('boxDirection');
	}),
	(b.canvas = function() {
		var e = d.createElement('canvas');
		return !(!e.getContext || !e.getContext('2d'));
	}),
	(b.canvastext = function() {
		return !(!c.canvas || !M(d.createElement('canvas').getContext('2d').fillText, 'function'));
	}),
	(b.webgl = function() {
		return !!r.WebGLRenderingContext;
	}),
	(b.touch = function() {
		var t;
		return (
			'ontouchstart' in r || (r.DocumentTouch && d instanceof DocumentTouch)
				? (t = !0)
				: C(['@media (', p.join('touch-enabled),('), m, ')', '{#modernizr{top:9px;position:absolute}}'].join(''), function(e) {
						t = 9 === e.offsetTop;
				  }),
			t
		);
	}),
	(b.geolocation = function() {
		return 'geolocation' in navigator;
	}),
	(b.postmessage = function() {
		return !!r.postMessage;
	}),
	(b.websqldatabase = function() {
		return !!r.openDatabase;
	}),
	(b.indexedDB = function() {
		return !!$('indexedDB', r);
	}),
	(b.hashchange = function() {
		return k('hashchange', r) && (d.documentMode === i || 7 < d.documentMode);
	}),
	(b.history = function() {
		return !(!r.history || !history.pushState);
	}),
	(b.draganddrop = function() {
		var e = d.createElement('div');
		return 'draggable' in e || ('ondragstart' in e && 'ondrop' in e);
	}),
	(b.websockets = function() {
		return 'WebSocket' in r || 'MozWebSocket' in r;
	}),
	(b.rgba = function() {
		return N('background-color:rgba(150,255,150,.5)'), P(s.backgroundColor, 'rgba');
	}),
	(b.hsla = function() {
		return N('background-color:hsla(120,40%,100%,.5)'), P(s.backgroundColor, 'rgba') || P(s.backgroundColor, 'hsla');
	}),
	(b.multiplebgs = function() {
		return N('background:url(https://),url(https://),red url(https://)'), /(url\s*\(.*?){3}/.test(s.background);
	}),
	(b.backgroundsize = function() {
		return $('backgroundSize');
	}),
	(b.borderimage = function() {
		return $('borderImage');
	}),
	(b.borderradius = function() {
		return $('borderRadius');
	}),
	(b.boxshadow = function() {
		return $('boxShadow');
	}),
	(b.textshadow = function() {
		return '' === d.createElement('div').style.textShadow;
	}),
	(b.opacity = function() {
		var e, t;
		return (e = 'opacity:.55'), N(p.join(e + ';') + (t || '')), /^0.55$/.test(s.opacity);
	}),
	(b.cssanimations = function() {
		return $('animationName');
	}),
	(b.csscolumns = function() {
		return $('columnCount');
	}),
	(b.cssgradients = function() {
		var e = 'background-image:';
		return (
			N(
				(
					e +
					'-webkit- '.split(' ').join('gradient(linear,left top,right bottom,from(#9f9),to(white));' + e) +
					p.join('linear-gradient(left top,#9f9, white);' + e)
				).slice(0, -e.length)
			),
			P(s.backgroundImage, 'gradient')
		);
	}),
	(b.cssreflections = function() {
		return $('boxReflect');
	}),
	(b.csstransforms = function() {
		return !!$('transform');
	}),
	(b.csstransforms3d = function() {
		var n = !!$('perspective');
		return (
			n &&
				'webkitPerspective' in f.style &&
				C('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function(e, t) {
					n = 9 === e.offsetLeft && 3 === e.offsetHeight;
				}),
			n
		);
	}),
	(b.csstransitions = function() {
		return $('transition');
	}),
	(b.fontface = function() {
		var a;
		return (
			C('@font-face {font-family:"font";src:url("https://")}', function(e, t) {
				var n = d.getElementById('smodernizr'),
					r = n.sheet || n.styleSheet,
					o = r ? (r.cssRules && r.cssRules[0] ? r.cssRules[0].cssText : r.cssText || '') : '';
				a = /src/i.test(o) && 0 === o.indexOf(t.split(' ')[0]);
			}),
			a
		);
	}),
	(b.generatedcontent = function() {
		var t;
		return (
			C(['#', m, '{font:0/0 a}#', m, ':after{content:"', l, '";visibility:hidden;font:3px/1 a}'].join(''), function(e) {
				t = 3 <= e.offsetHeight;
			}),
			t
		);
	}),
	(b.video = function() {
		var e = d.createElement('video'),
			t = !1;
		try {
			(t = !!e.canPlayType) &&
				(((t = new Boolean(t)).ogg = e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, '')),
				(t.h264 = e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, '')),
				(t.webm = e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, '')));
		} catch (e) {}
		return t;
	}),
	(b.audio = function() {
		var e = d.createElement('audio'),
			t = !1;
		try {
			(t = !!e.canPlayType) &&
				(((t = new Boolean(t)).ogg = e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, '')),
				(t.mp3 = e.canPlayType('audio/mpeg;').replace(/^no$/, '')),
				(t.wav = e.canPlayType('audio/wav; codecs="1"').replace(/^no$/, '')),
				(t.m4a = (e.canPlayType('audio/x-m4a;') || e.canPlayType('audio/aac;')).replace(/^no$/, '')));
		} catch (e) {}
		return t;
	}),
	(b.localstorage = function() {
		try {
			return localStorage.setItem(m, m), localStorage.removeItem(m), !0;
		} catch (e) {
			return !1;
		}
	}),
	(b.sessionstorage = function() {
		try {
			return sessionStorage.setItem(m, m), sessionStorage.removeItem(m), !0;
		} catch (e) {
			return !1;
		}
	}),
	(b.webworkers = function() {
		return !!r.Worker;
	}),
	(b.applicationcache = function() {
		return !!r.applicationCache;
	}),
	(b.svg = function() {
		return !!d.createElementNS && !!d.createElementNS(y, 'svg').createSVGRect;
	}),
	(b.inlinesvg = function() {
		var e = d.createElement('div');
		return (e.innerHTML = '<svg/>'), (e.firstChild && e.firstChild.namespaceURI) == y;
	}),
	(b.smil = function() {
		return !!d.createElementNS && /SVGAnimate/.test(n.call(d.createElementNS(y, 'animate')));
	}),
	(b.svgclippaths = function() {
		return !!d.createElementNS && /SVGClipPath/.test(n.call(d.createElementNS(y, 'clipPath')));
	}),
	b))
		o(b, D) && ((e = D.toLowerCase()), (c[e] = b[D]()), w.push((c[e] ? '' : 'no-') + e));
	return (
		c.input ||
			((c.input = (function(e) {
				for (var t = 0, n = e.length; t < n; t++) x[e[t]] = !!(e[t] in u);
				return x.list && (x.list = !(!d.createElement('datalist') || !r.HTMLDataListElement)), x;
			})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '))),
			(c.inputtypes = (function(e) {
				for (var t, n, r, o = 0, a = e.length; o < a; o++)
					u.setAttribute('type', (n = e[o])),
						(t = 'text' !== u.type) &&
							((u.value = l),
							(u.style.cssText = 'position:absolute;visibility:hidden;'),
							/^range$/.test(n) && u.style.WebkitAppearance !== i
								? (f.appendChild(u),
								  (t =
										(r = d.defaultView).getComputedStyle &&
										'textfield' !== r.getComputedStyle(u, null).WebkitAppearance &&
										0 !== u.offsetHeight),
								  f.removeChild(u))
								: /^(search|tel)$/.test(n) || (t = /^(url|email)$/.test(n) ? u.checkValidity && !1 === u.checkValidity() : u.value != l)),
						(E[e[o]] = !!t);
				return E;
			})('search tel url email datetime date month week time datetime-local number range color'.split(' ')))),
		(c.addTest = function(e, t) {
			if ('object' == typeof e) for (var n in e) o(e, n) && c.addTest(n, e[n]);
			else {
				if (((e = e.toLowerCase()), c[e] !== i)) return c;
				(t = 'function' == typeof t ? t() : t), (f.className += ' ' + (t ? '' : 'no-') + e), (c[e] = t);
			}
			return c;
		}),
		N(''),
		(t = u = null),
		(function(e, s) {
			var u,
				l,
				t = e.html5 || {},
				o = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,
				a = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,
				n = '_html5shiv',
				r = 0,
				i = {};
			function d() {
				var e = p.elements;
				return 'string' == typeof e ? e.split(' ') : e;
			}
			function f(e) {
				var t = i[e[n]];
				return t || ((t = {}), r++, (e[n] = r), (i[r] = t)), t;
			}
			function m(e, t, n) {
				return (
					t || (t = s),
					l
						? t.createElement(e)
						: (n || (n = f(t)),
						  !(r = n.cache[e] ? n.cache[e].cloneNode() : a.test(e) ? (n.cache[e] = n.createElem(e)).cloneNode() : n.createElem(e))
								.canHaveChildren ||
						  o.test(e) ||
						  r.tagUrn
								? r
								: n.frag.appendChild(r))
				);
				var r;
			}
			function c(e) {
				e || (e = s);
				var t,
					n,
					r,
					o,
					a,
					i,
					c = f(e);
				return (
					!p.shivCSS ||
						u ||
						c.hasCSS ||
						(c.hasCSS = ((n =
							'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}'),
						(r = (t = e).createElement('p')),
						(o = t.getElementsByTagName('head')[0] || t.documentElement),
						(r.innerHTML = 'x<style>' + n + '</style>'),
						!!o.insertBefore(r.lastChild, o.firstChild))),
					l ||
						((a = e),
						(i = c).cache ||
							((i.cache = {}), (i.createElem = a.createElement), (i.createFrag = a.createDocumentFragment), (i.frag = i.createFrag())),
						(a.createElement = function(e) {
							return p.shivMethods ? m(e, a, i) : i.createElem(e);
						}),
						(a.createDocumentFragment = Function(
							'h,f',
							'return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(' +
								d()
									.join()
									.replace(/[\w\-]+/g, function(e) {
										return i.createElem(e), i.frag.createElement(e), 'c("' + e + '")';
									}) +
								');return n}'
						)(p, i.frag))),
					e
				);
			}
			!(function() {
				try {
					var e = s.createElement('a');
					(e.innerHTML = '<xyz></xyz>'),
						(u = 'hidden' in e),
						(l =
							1 == e.childNodes.length ||
							(function() {
								s.createElement('a');
								var e = s.createDocumentFragment();
								return void 0 === e.cloneNode || void 0 === e.createDocumentFragment || void 0 === e.createElement;
							})());
				} catch (e) {
					l = u = !0;
				}
			})();
			var p = {
				elements:
					t.elements ||
					'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',
				version: '3.7.0',
				shivCSS: !1 !== t.shivCSS,
				supportsUnknownElements: l,
				shivMethods: !1 !== t.shivMethods,
				type: 'default',
				shivDocument: c,
				createElement: m,
				createDocumentFragment: function(e, t) {
					if ((e || (e = s), l)) return e.createDocumentFragment();
					for (var n = (t = t || f(e)).frag.cloneNode(), r = 0, o = d(), a = o.length; r < a; r++) n.createElement(o[r]);
					return n;
				}
			};
			(e.html5 = p), c(s);
		})(this, d),
		(c._version = '2.8.3'),
		(c._prefixes = p),
		(c._domPrefixes = v),
		(c._cssomPrefixes = g),
		(c.mq = function(e) {
			var t,
				n = r.matchMedia || r.msMatchMedia;
			return n
				? (n(e) && n(e).matches) || !1
				: (C('@media ' + e + ' { #' + m + ' { position: absolute; } }', function(e) {
						t = 'absolute' == (r.getComputedStyle ? getComputedStyle(e, null) : e.currentStyle).position;
				  }),
				  t);
		}),
		(c.hasEvent = k),
		(c.testProp = function(e) {
			return j([e]);
		}),
		(c.testAllProps = $),
		(c.testStyles = C),
		(c.prefixed = function(e, t, n) {
			return t ? $(e, t, n) : $(e, 'pfx');
		}),
		(f.className = f.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') + ' js ' + w.join(' ')),
		c
	);
})(this, this.document);
;
/*
 AngularJS v1.7.8
 (c) 2010-2018 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(C){'use strict';function re(a){if(D(a))w(a.objectMaxDepth)&&(Wb.objectMaxDepth=Xb(a.objectMaxDepth)?a.objectMaxDepth:NaN),w(a.urlErrorParamsEnabled)&&Ga(a.urlErrorParamsEnabled)&&(Wb.urlErrorParamsEnabled=a.urlErrorParamsEnabled);else return Wb}function Xb(a){return W(a)&&0<a}function F(a,b){b=b||Error;return function(){var d=arguments[0],c;c="["+(a?a+":":"")+d+"] http://errors.angularjs.org/1.7.8/"+(a?a+"/":"")+d;for(d=1;d<arguments.length;d++){c=c+(1==d?"?":"&")+"p"+(d-1)+"=";var e=encodeURIComponent,
f;f=arguments[d];f="function"==typeof f?f.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof f?"undefined":"string"!=typeof f?JSON.stringify(f):f;c+=e(f)}return new b(c)}}function ya(a){if(null==a||$a(a))return!1;if(H(a)||A(a)||x&&a instanceof x)return!0;var b="length"in Object(a)&&a.length;return W(b)&&(0<=b&&b-1 in a||"function"===typeof a.item)}function r(a,b,d){var c,e;if(a)if(B(a))for(c in a)"prototype"!==c&&"length"!==c&&"name"!==c&&a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else if(H(a)||
ya(a)){var f="object"!==typeof a;c=0;for(e=a.length;c<e;c++)(f||c in a)&&b.call(d,a[c],c,a)}else if(a.forEach&&a.forEach!==r)a.forEach(b,d,a);else if(Nc(a))for(c in a)b.call(d,a[c],c,a);else if("function"===typeof a.hasOwnProperty)for(c in a)a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else for(c in a)ta.call(a,c)&&b.call(d,a[c],c,a);return a}function Oc(a,b,d){for(var c=Object.keys(a).sort(),e=0;e<c.length;e++)b.call(d,a[c[e]],c[e]);return c}function Yb(a){return function(b,d){a(d,b)}}function se(){return++pb}
function Zb(a,b,d){for(var c=a.$$hashKey,e=0,f=b.length;e<f;++e){var g=b[e];if(D(g)||B(g))for(var k=Object.keys(g),h=0,l=k.length;h<l;h++){var m=k[h],p=g[m];d&&D(p)?ha(p)?a[m]=new Date(p.valueOf()):ab(p)?a[m]=new RegExp(p):p.nodeName?a[m]=p.cloneNode(!0):$b(p)?a[m]=p.clone():(D(a[m])||(a[m]=H(p)?[]:{}),Zb(a[m],[p],!0)):a[m]=p}}c?a.$$hashKey=c:delete a.$$hashKey;return a}function S(a){return Zb(a,Ha.call(arguments,1),!1)}function te(a){return Zb(a,Ha.call(arguments,1),!0)}function fa(a){return parseInt(a,
10)}function ac(a,b){return S(Object.create(a),b)}function E(){}function Ta(a){return a}function ia(a){return function(){return a}}function bc(a){return B(a.toString)&&a.toString!==la}function z(a){return"undefined"===typeof a}function w(a){return"undefined"!==typeof a}function D(a){return null!==a&&"object"===typeof a}function Nc(a){return null!==a&&"object"===typeof a&&!Pc(a)}function A(a){return"string"===typeof a}function W(a){return"number"===typeof a}function ha(a){return"[object Date]"===la.call(a)}
function H(a){return Array.isArray(a)||a instanceof Array}function cc(a){switch(la.call(a)){case "[object Error]":return!0;case "[object Exception]":return!0;case "[object DOMException]":return!0;default:return a instanceof Error}}function B(a){return"function"===typeof a}function ab(a){return"[object RegExp]"===la.call(a)}function $a(a){return a&&a.window===a}function bb(a){return a&&a.$evalAsync&&a.$watch}function Ga(a){return"boolean"===typeof a}function ue(a){return a&&W(a.length)&&ve.test(la.call(a))}
function $b(a){return!(!a||!(a.nodeName||a.prop&&a.attr&&a.find))}function we(a){var b={};a=a.split(",");var d;for(d=0;d<a.length;d++)b[a[d]]=!0;return b}function ua(a){return K(a.nodeName||a[0]&&a[0].nodeName)}function cb(a,b){var d=a.indexOf(b);0<=d&&a.splice(d,1);return d}function Ia(a,b,d){function c(a,b,c){c--;if(0>c)return"...";var d=b.$$hashKey,f;if(H(a)){f=0;for(var g=a.length;f<g;f++)b.push(e(a[f],c))}else if(Nc(a))for(f in a)b[f]=e(a[f],c);else if(a&&"function"===typeof a.hasOwnProperty)for(f in a)a.hasOwnProperty(f)&&
(b[f]=e(a[f],c));else for(f in a)ta.call(a,f)&&(b[f]=e(a[f],c));d?b.$$hashKey=d:delete b.$$hashKey;return b}function e(a,b){if(!D(a))return a;var d=g.indexOf(a);if(-1!==d)return k[d];if($a(a)||bb(a))throw pa("cpws");var d=!1,e=f(a);void 0===e&&(e=H(a)?[]:Object.create(Pc(a)),d=!0);g.push(a);k.push(e);return d?c(a,e,b):e}function f(a){switch(la.call(a)){case "[object Int8Array]":case "[object Int16Array]":case "[object Int32Array]":case "[object Float32Array]":case "[object Float64Array]":case "[object Uint8Array]":case "[object Uint8ClampedArray]":case "[object Uint16Array]":case "[object Uint32Array]":return new a.constructor(e(a.buffer),
a.byteOffset,a.length);case "[object ArrayBuffer]":if(!a.slice){var b=new ArrayBuffer(a.byteLength);(new Uint8Array(b)).set(new Uint8Array(a));return b}return a.slice(0);case "[object Boolean]":case "[object Number]":case "[object String]":case "[object Date]":return new a.constructor(a.valueOf());case "[object RegExp]":return b=new RegExp(a.source,a.toString().match(/[^/]*$/)[0]),b.lastIndex=a.lastIndex,b;case "[object Blob]":return new a.constructor([a],{type:a.type})}if(B(a.cloneNode))return a.cloneNode(!0)}
var g=[],k=[];d=Xb(d)?d:NaN;if(b){if(ue(b)||"[object ArrayBuffer]"===la.call(b))throw pa("cpta");if(a===b)throw pa("cpi");H(b)?b.length=0:r(b,function(a,c){"$$hashKey"!==c&&delete b[c]});g.push(a);k.push(b);return c(a,b,d)}return e(a,d)}function dc(a,b){return a===b||a!==a&&b!==b}function va(a,b){if(a===b)return!0;if(null===a||null===b)return!1;if(a!==a&&b!==b)return!0;var d=typeof a,c;if(d===typeof b&&"object"===d)if(H(a)){if(!H(b))return!1;if((d=a.length)===b.length){for(c=0;c<d;c++)if(!va(a[c],
b[c]))return!1;return!0}}else{if(ha(a))return ha(b)?dc(a.getTime(),b.getTime()):!1;if(ab(a))return ab(b)?a.toString()===b.toString():!1;if(bb(a)||bb(b)||$a(a)||$a(b)||H(b)||ha(b)||ab(b))return!1;d=T();for(c in a)if("$"!==c.charAt(0)&&!B(a[c])){if(!va(a[c],b[c]))return!1;d[c]=!0}for(c in b)if(!(c in d)&&"$"!==c.charAt(0)&&w(b[c])&&!B(b[c]))return!1;return!0}return!1}function db(a,b,d){return a.concat(Ha.call(b,d))}function Va(a,b){var d=2<arguments.length?Ha.call(arguments,2):[];return!B(b)||b instanceof
RegExp?b:d.length?function(){return arguments.length?b.apply(a,db(d,arguments,0)):b.apply(a,d)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function Qc(a,b){var d=b;"string"===typeof a&&"$"===a.charAt(0)&&"$"===a.charAt(1)?d=void 0:$a(b)?d="$WINDOW":b&&C.document===b?d="$DOCUMENT":bb(b)&&(d="$SCOPE");return d}function eb(a,b){if(!z(a))return W(b)||(b=b?2:null),JSON.stringify(a,Qc,b)}function Rc(a){return A(a)?JSON.parse(a):a}function ec(a,b){a=a.replace(xe,"");var d=Date.parse("Jan 01, 1970 00:00:00 "+
a)/6E4;return X(d)?b:d}function Sc(a,b){a=new Date(a.getTime());a.setMinutes(a.getMinutes()+b);return a}function fc(a,b,d){d=d?-1:1;var c=a.getTimezoneOffset();b=ec(b,c);return Sc(a,d*(b-c))}function za(a){a=x(a).clone().empty();var b=x("<div></div>").append(a).html();try{return a[0].nodeType===Pa?K(b):b.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(a,b){return"<"+K(b)})}catch(d){return K(b)}}function Tc(a){try{return decodeURIComponent(a)}catch(b){}}function gc(a){var b={};r((a||"").split("&"),
function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=Tc(e),w(e)&&(f=w(f)?Tc(f):!0,ta.call(b,e)?H(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function ye(a){var b=[];r(a,function(a,c){H(a)?r(a,function(a){b.push(ba(c,!0)+(!0===a?"":"="+ba(a,!0)))}):b.push(ba(c,!0)+(!0===a?"":"="+ba(a,!0)))});return b.length?b.join("&"):""}function hc(a){return ba(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ba(a,
b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function ze(a,b){var d,c,e=Qa.length;for(c=0;c<e;++c)if(d=Qa[c]+b,A(d=a.getAttribute(d)))return d;return null}function Ae(a,b){var d,c,e={};r(Qa,function(b){b+="app";!d&&a.hasAttribute&&a.hasAttribute(b)&&(d=a,c=a.getAttribute(b))});r(Qa,function(b){b+="app";var e;!d&&(e=a.querySelector("["+b.replace(":","\\:")+"]"))&&(d=e,c=e.getAttribute(b))});
d&&(Be?(e.strictDi=null!==ze(d,"strict-di"),b(d,c?[c]:[],e)):C.console.error("AngularJS: disabling automatic bootstrap. <script> protocol indicates an extension, document.location.href does not match."))}function Uc(a,b,d){D(d)||(d={});d=S({strictDi:!1},d);var c=function(){a=x(a);if(a.injector()){var c=a[0]===C.document?"document":za(a);throw pa("btstrpd",c.replace(/</,"&lt;").replace(/>/,"&gt;"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",
function(a){a.debugInfoEnabled(!0)}]);b.unshift("ng");c=fb(b,d.strictDi);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;C&&e.test(C.name)&&(d.debugInfoEnabled=!0,C.name=C.name.replace(e,""));if(C&&!f.test(C.name))return c();C.name=C.name.replace(f,"");ca.resumeBootstrap=function(a){r(a,function(a){b.push(a)});return c()};B(ca.resumeDeferredBootstrap)&&
ca.resumeDeferredBootstrap()}function Ce(){C.name="NG_ENABLE_DEBUG_INFO!"+C.name;C.location.reload()}function De(a){a=ca.element(a).injector();if(!a)throw pa("test");return a.get("$$testability")}function Vc(a,b){b=b||"_";return a.replace(Ee,function(a,c){return(c?b:"")+a.toLowerCase()})}function Fe(){var a;if(!Wc){var b=qb();(rb=z(b)?C.jQuery:b?C[b]:void 0)&&rb.fn.on?(x=rb,S(rb.fn,{scope:Wa.scope,isolateScope:Wa.isolateScope,controller:Wa.controller,injector:Wa.injector,inheritedData:Wa.inheritedData})):
x=Y;a=x.cleanData;x.cleanData=function(b){for(var c,e=0,f;null!=(f=b[e]);e++)(c=(x._data(f)||{}).events)&&c.$destroy&&x(f).triggerHandler("$destroy");a(b)};ca.element=x;Wc=!0}}function gb(a,b,d){if(!a)throw pa("areq",b||"?",d||"required");return a}function sb(a,b,d){d&&H(a)&&(a=a[a.length-1]);gb(B(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Ja(a,b){if("hasOwnProperty"===a)throw pa("badname",b);}function Ge(a,b,d){if(!b)return a;b=b.split(".");
for(var c,e=a,f=b.length,g=0;g<f;g++)c=b[g],a&&(a=(e=a)[c]);return!d&&B(a)?Va(e,a):a}function tb(a){for(var b=a[0],d=a[a.length-1],c,e=1;b!==d&&(b=b.nextSibling);e++)if(c||a[e]!==b)c||(c=x(Ha.call(a,0,e))),c.push(b);return c||a}function T(){return Object.create(null)}function ic(a){if(null==a)return"";switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=!bc(a)||H(a)||ha(a)?eb(a):a.toString()}return a}function He(a){function b(a,b,c){return a[b]||(a[b]=c())}var d=F("$injector"),
c=F("ng");a=b(a,"angular",Object);a.$$minErr=a.$$minErr||F;return b(a,"module",function(){var a={};return function(f,g,k){var h={};if("hasOwnProperty"===f)throw c("badname","module");g&&a.hasOwnProperty(f)&&(a[f]=null);return b(a,f,function(){function a(b,c,d,f){f||(f=e);return function(){f[d||"push"]([b,c,arguments]);return t}}function b(a,c,d){d||(d=e);return function(b,e){e&&B(e)&&(e.$$moduleName=f);d.push([a,c,arguments]);return t}}if(!g)throw d("nomod",f);var e=[],n=[],s=[],G=a("$injector","invoke",
"push",n),t={_invokeQueue:e,_configBlocks:n,_runBlocks:s,info:function(a){if(w(a)){if(!D(a))throw c("aobj","value");h=a;return this}return h},requires:g,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:b("$provide","decorator",n),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider",
"directive"),component:b("$compileProvider","component"),config:G,run:function(a){s.push(a);return this}};k&&G(k);return t})}})}function ja(a,b){if(H(a)){b=b||[];for(var d=0,c=a.length;d<c;d++)b[d]=a[d]}else if(D(a))for(d in b=b||{},a)if("$"!==d.charAt(0)||"$"!==d.charAt(1))b[d]=a[d];return b||a}function Ie(a,b){var d=[];Xb(b)&&(a=ca.copy(a,null,b));return JSON.stringify(a,function(a,b){b=Qc(a,b);if(D(b)){if(0<=d.indexOf(b))return"...";d.push(b)}return b})}function Je(a){S(a,{errorHandlingConfig:re,
bootstrap:Uc,copy:Ia,extend:S,merge:te,equals:va,element:x,forEach:r,injector:fb,noop:E,bind:Va,toJson:eb,fromJson:Rc,identity:Ta,isUndefined:z,isDefined:w,isString:A,isFunction:B,isObject:D,isNumber:W,isElement:$b,isArray:H,version:Ke,isDate:ha,callbacks:{$$counter:0},getTestability:De,reloadWithDebugInfo:Ce,$$minErr:F,$$csp:Aa,$$encodeUriSegment:hc,$$encodeUriQuery:ba,$$lowercase:K,$$stringify:ic,$$uppercase:ub});kc=He(C);kc("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:Le});
a.provider("$compile",Xc).directive({a:Me,input:Yc,textarea:Yc,form:Ne,script:Oe,select:Pe,option:Qe,ngBind:Re,ngBindHtml:Se,ngBindTemplate:Te,ngClass:Ue,ngClassEven:Ve,ngClassOdd:We,ngCloak:Xe,ngController:Ye,ngForm:Ze,ngHide:$e,ngIf:af,ngInclude:bf,ngInit:cf,ngNonBindable:df,ngPluralize:ef,ngRef:ff,ngRepeat:gf,ngShow:hf,ngStyle:jf,ngSwitch:kf,ngSwitchWhen:lf,ngSwitchDefault:mf,ngOptions:nf,ngTransclude:of,ngModel:pf,ngList:qf,ngChange:rf,pattern:Zc,ngPattern:Zc,required:$c,ngRequired:$c,minlength:ad,
ngMinlength:ad,maxlength:bd,ngMaxlength:bd,ngValue:sf,ngModelOptions:tf}).directive({ngInclude:uf,input:vf}).directive(vb).directive(cd);a.provider({$anchorScroll:wf,$animate:xf,$animateCss:yf,$$animateJs:zf,$$animateQueue:Af,$$AnimateRunner:Bf,$$animateAsyncRun:Cf,$browser:Df,$cacheFactory:Ef,$controller:Ff,$document:Gf,$$isDocumentHidden:Hf,$exceptionHandler:If,$filter:dd,$$forceReflow:Jf,$interpolate:Kf,$interval:Lf,$$intervalFactory:Mf,$http:Nf,$httpParamSerializer:Of,$httpParamSerializerJQLike:Pf,
$httpBackend:Qf,$xhrFactory:Rf,$jsonpCallbacks:Sf,$location:Tf,$log:Uf,$parse:Vf,$rootScope:Wf,$q:Xf,$$q:Yf,$sce:Zf,$sceDelegate:$f,$sniffer:ag,$$taskTrackerFactory:bg,$templateCache:cg,$templateRequest:dg,$$testability:eg,$timeout:fg,$window:gg,$$rAF:hg,$$jqLite:ig,$$Map:jg,$$cookieReader:kg})}]).info({angularVersion:"1.7.8"})}function wb(a,b){return b.toUpperCase()}function xb(a){return a.replace(lg,wb)}function lc(a){a=a.nodeType;return 1===a||!a||9===a}function ed(a,b){var d,c,e=b.createDocumentFragment(),
f=[];if(mc.test(a)){d=e.appendChild(b.createElement("div"));c=(mg.exec(a)||["",""])[1].toLowerCase();c=oa[c]||oa._default;d.innerHTML=c[1]+a.replace(ng,"<$1></$2>")+c[2];for(c=c[0];c--;)d=d.lastChild;f=db(f,d.childNodes);d=e.firstChild;d.textContent=""}else f.push(b.createTextNode(a));e.textContent="";e.innerHTML="";r(f,function(a){e.appendChild(a)});return e}function Y(a){if(a instanceof Y)return a;var b;A(a)&&(a=U(a),b=!0);if(!(this instanceof Y)){if(b&&"<"!==a.charAt(0))throw nc("nosel");return new Y(a)}if(b){b=
C.document;var d;a=(d=og.exec(a))?[b.createElement(d[1])]:(d=ed(a,b))?d.childNodes:[];oc(this,a)}else B(a)?fd(a):oc(this,a)}function pc(a){return a.cloneNode(!0)}function yb(a,b){!b&&lc(a)&&x.cleanData([a]);a.querySelectorAll&&x.cleanData(a.querySelectorAll("*"))}function gd(a){for(var b in a)return!1;return!0}function hd(a){var b=a.ng339,d=b&&Ka[b],c=d&&d.events,d=d&&d.data;d&&!gd(d)||c&&!gd(c)||(delete Ka[b],a.ng339=void 0)}function id(a,b,d,c){if(w(c))throw nc("offargs");var e=(c=zb(a))&&c.events,
f=c&&c.handle;if(f){if(b){var g=function(b){var c=e[b];w(d)&&cb(c||[],d);w(d)&&c&&0<c.length||(a.removeEventListener(b,f),delete e[b])};r(b.split(" "),function(a){g(a);Ab[a]&&g(Ab[a])})}else for(b in e)"$destroy"!==b&&a.removeEventListener(b,f),delete e[b];hd(a)}}function qc(a,b){var d=a.ng339;if(d=d&&Ka[d])b?delete d.data[b]:d.data={},hd(a)}function zb(a,b){var d=a.ng339,d=d&&Ka[d];b&&!d&&(a.ng339=d=++pg,d=Ka[d]={events:{},data:{},handle:void 0});return d}function rc(a,b,d){if(lc(a)){var c,e=w(d),
f=!e&&b&&!D(b),g=!b;a=(a=zb(a,!f))&&a.data;if(e)a[xb(b)]=d;else{if(g)return a;if(f)return a&&a[xb(b)];for(c in b)a[xb(c)]=b[c]}}}function Bb(a,b){return a.getAttribute?-1<(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+b+" "):!1}function Cb(a,b){if(b&&a.setAttribute){var d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),c=d;r(b.split(" "),function(a){a=U(a);c=c.replace(" "+a+" "," ")});c!==d&&a.setAttribute("class",U(c))}}function Db(a,b){if(b&&a.setAttribute){var d=
(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),c=d;r(b.split(" "),function(a){a=U(a);-1===c.indexOf(" "+a+" ")&&(c+=a+" ")});c!==d&&a.setAttribute("class",U(c))}}function oc(a,b){if(b)if(b.nodeType)a[a.length++]=b;else{var d=b.length;if("number"===typeof d&&b.window!==b){if(d)for(var c=0;c<d;c++)a[a.length++]=b[c]}else a[a.length++]=b}}function jd(a,b){return Eb(a,"$"+(b||"ngController")+"Controller")}function Eb(a,b,d){9===a.nodeType&&(a=a.documentElement);for(b=H(b)?b:[b];a;){for(var c=
0,e=b.length;c<e;c++)if(w(d=x.data(a,b[c])))return d;a=a.parentNode||11===a.nodeType&&a.host}}function kd(a){for(yb(a,!0);a.firstChild;)a.removeChild(a.firstChild)}function Fb(a,b){b||yb(a);var d=a.parentNode;d&&d.removeChild(a)}function qg(a,b){b=b||C;if("complete"===b.document.readyState)b.setTimeout(a);else x(b).on("load",a)}function fd(a){function b(){C.document.removeEventListener("DOMContentLoaded",b);C.removeEventListener("load",b);a()}"complete"===C.document.readyState?C.setTimeout(a):(C.document.addEventListener("DOMContentLoaded",
b),C.addEventListener("load",b))}function ld(a,b){var d=Gb[b.toLowerCase()];return d&&md[ua(a)]&&d}function rg(a,b){var d=function(c,d){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=b[d||c.type],g=f?f.length:0;if(g){if(z(c.immediatePropagationStopped)){var k=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();k&&k.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};
var h=f.specialHandlerWrapper||sg;1<g&&(f=ja(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||h(a,c,f[l])}};d.elem=a;return d}function sg(a,b,d){d.call(a,b)}function tg(a,b,d){var c=b.relatedTarget;c&&(c===a||ug.call(a,c))||d.call(a,b)}function ig(){this.$get=function(){return S(Y,{hasClass:function(a,b){a.attr&&(a=a[0]);return Bb(a,b)},addClass:function(a,b){a.attr&&(a=a[0]);return Db(a,b)},removeClass:function(a,b){a.attr&&(a=a[0]);return Cb(a,b)}})}}function La(a,b){var d=a&&a.$$hashKey;
if(d)return"function"===typeof d&&(d=a.$$hashKey()),d;d=typeof a;return d="function"===d||"object"===d&&null!==a?a.$$hashKey=d+":"+(b||se)():d+":"+a}function nd(){this._keys=[];this._values=[];this._lastKey=NaN;this._lastIndex=-1}function od(a){a=Function.prototype.toString.call(a).replace(vg,"");return a.match(wg)||a.match(xg)}function yg(a){return(a=od(a))?"function("+(a[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function fb(a,b){function d(a){return function(b,c){if(D(b))r(b,Yb(a));else return a(b,
c)}}function c(a,b){Ja(a,"service");if(B(b)||H(b))b=n.instantiate(b);if(!b.$get)throw Ba("pget",a);return p[a+"Provider"]=b}function e(a,b){return function(){var c=t.invoke(b,this);if(z(c))throw Ba("undef",a);return c}}function f(a,b,d){return c(a,{$get:!1!==d?e(a,b):b})}function g(a){gb(z(a)||H(a),"modulesToLoad","not an array");var b=[],c;r(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=n.get(e[0]);f[e[1]].apply(f,e[2])}}if(!m.get(a)){m.set(a,!0);try{A(a)?(c=kc(a),
t.modules[a]=c,b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):B(a)?b.push(n.invoke(a)):H(a)?b.push(n.invoke(a)):sb(a,"module")}catch(e){throw H(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1===e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ba("modulerr",a,e.stack||e.message||e);}}});return b}function k(a,c){function d(b,e){if(a.hasOwnProperty(b)){if(a[b]===h)throw Ba("cdep",b+" <- "+l.join(" <- "));return a[b]}try{return l.unshift(b),a[b]=h,a[b]=c(b,e),
a[b]}catch(f){throw a[b]===h&&delete a[b],f;}finally{l.shift()}}function e(a,c,f){var g=[];a=fb.$$annotate(a,b,f);for(var h=0,k=a.length;h<k;h++){var l=a[h];if("string"!==typeof l)throw Ba("itkn",l);g.push(c&&c.hasOwnProperty(l)?c[l]:d(l,f))}return g}return{invoke:function(a,b,c,d){"string"===typeof c&&(d=c,c=null);c=e(a,c,d);H(a)&&(a=a[a.length-1]);d=a;if(Ca||"function"!==typeof d)d=!1;else{var f=d.$$ngIsClass;Ga(f)||(f=d.$$ngIsClass=/^class\b/.test(Function.prototype.toString.call(d)));d=f}return d?
(c.unshift(null),new (Function.prototype.bind.apply(a,c))):a.apply(b,c)},instantiate:function(a,b,c){var d=H(a)?a[a.length-1]:a;a=e(a,b,c);a.unshift(null);return new (Function.prototype.bind.apply(d,a))},get:d,annotate:fb.$$annotate,has:function(b){return p.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}b=!0===b;var h={},l=[],m=new Hb,p={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,
ia(b),!1)}),constant:d(function(a,b){Ja(a,"constant");p[a]=b;s[a]=b}),decorator:function(a,b){var c=n.get(a+"Provider"),d=c.$get;c.$get=function(){var a=t.invoke(d,c);return t.invoke(b,null,{$delegate:a})}}}},n=p.$injector=k(p,function(a,b){ca.isString(b)&&l.push(b);throw Ba("unpr",l.join(" <- "));}),s={},G=k(s,function(a,b){var c=n.get(a+"Provider",b);return t.invoke(c.$get,c,void 0,a)}),t=G;p.$injectorProvider={$get:ia(G)};t.modules=n.modules=T();var N=g(a),t=G.get("$injector");t.strictDi=b;r(N,
function(a){a&&t.invoke(a)});t.loadNewModules=function(a){r(g(a),function(a){a&&t.invoke(a)})};return t}function wf(){var a=!0;this.disableAutoScrolling=function(){a=!1};this.$get=["$window","$location","$rootScope",function(b,d,c){function e(a){var b=null;Array.prototype.some.call(a,function(a){if("a"===ua(a))return b=a,!0});return b}function f(a){if(a){a.scrollIntoView();var c;c=g.yOffset;B(c)?c=c():$b(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):W(c)||
(c=0);c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))}else b.scrollTo(0,0)}function g(a){a=A(a)?a:W(a)?a.toString():d.hash();var b;a?(b=k.getElementById(a))?f(b):(b=e(k.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var k=b.document;a&&c.$watch(function(){return d.hash()},function(a,b){a===b&&""===a||qg(function(){c.$evalAsync(g)})});return g}]}function hb(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;H(a)&&(a=a.join(" "));H(b)&&(b=b.join(" "));return a+" "+b}function zg(a){A(a)&&
(a=a.split(" "));var b=T();r(a,function(a){a.length&&(b[a]=!0)});return b}function ra(a){return D(a)?a:{}}function Ag(a,b,d,c,e){function f(){qa=null;k()}function g(){t=y();t=z(t)?null:t;va(t,P)&&(t=P);N=P=t}function k(){var a=N;g();if(v!==h.url()||a!==t)v=h.url(),N=t,r(J,function(a){a(h.url(),t)})}var h=this,l=a.location,m=a.history,p=a.setTimeout,n=a.clearTimeout,s={},G=e(d);h.isMock=!1;h.$$completeOutstandingRequest=G.completeTask;h.$$incOutstandingRequestCount=G.incTaskCount;h.notifyWhenNoOutstandingRequests=
G.notifyWhenNoPendingTasks;var t,N,v=l.href,jc=b.find("base"),qa=null,y=c.history?function(){try{return m.state}catch(a){}}:E;g();h.url=function(b,d,e){z(e)&&(e=null);l!==a.location&&(l=a.location);m!==a.history&&(m=a.history);if(b){var f=N===e;b=ga(b).href;if(v===b&&(!c.history||f))return h;var k=v&&Da(v)===Da(b);v=b;N=e;!c.history||k&&f?(k||(qa=b),d?l.replace(b):k?(d=l,e=b,f=e.indexOf("#"),e=-1===f?"":e.substr(f),d.hash=e):l.href=b,l.href!==b&&(qa=b)):(m[d?"replaceState":"pushState"](e,"",b),g());
qa&&(qa=b);return h}return(qa||l.href).replace(/#$/,"")};h.state=function(){return t};var J=[],I=!1,P=null;h.onUrlChange=function(b){if(!I){if(c.history)x(a).on("popstate",f);x(a).on("hashchange",f);I=!0}J.push(b);return b};h.$$applicationDestroyed=function(){x(a).off("hashchange popstate",f)};h.$$checkUrlChange=k;h.baseHref=function(){var a=jc.attr("href");return a?a.replace(/^(https?:)?\/\/[^/]*/,""):""};h.defer=function(a,b,c){var d;b=b||0;c=c||G.DEFAULT_TASK_TYPE;G.incTaskCount(c);d=p(function(){delete s[d];
G.completeTask(a,c)},b);s[d]=c;return d};h.defer.cancel=function(a){if(s.hasOwnProperty(a)){var b=s[a];delete s[a];n(a);G.completeTask(E,b);return!0}return!1}}function Df(){this.$get=["$window","$log","$sniffer","$document","$$taskTrackerFactory",function(a,b,d,c,e){return new Ag(a,c,b,d,e)}]}function Ef(){this.$get=function(){function a(a,c){function e(a){a!==p&&(n?n===a&&(n=a.n):n=a,f(a.n,a.p),f(a,p),p=a,p.n=null)}function f(a,b){a!==b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw F("$cacheFactory")("iid",
a);var g=0,k=S({},c,{id:a}),h=T(),l=c&&c.capacity||Number.MAX_VALUE,m=T(),p=null,n=null;return b[a]={put:function(a,b){if(!z(b)){if(l<Number.MAX_VALUE){var c=m[a]||(m[a]={key:a});e(c)}a in h||g++;h[a]=b;g>l&&this.remove(n.key);return b}},get:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;e(b)}return h[a]},remove:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;b===p&&(p=b.p);b===n&&(n=b.n);f(b.n,b.p);delete m[a]}a in h&&(delete h[a],g--)},removeAll:function(){h=T();g=0;m=T();
p=n=null},destroy:function(){m=k=h=null;delete b[a]},info:function(){return S({},k,{size:g})}}}var b={};a.info=function(){var a={};r(b,function(b,e){a[e]=b.info()});return a};a.get=function(a){return b[a]};return a}}function cg(){this.$get=["$cacheFactory",function(a){return a("templates")}]}function Xc(a,b){function d(a,b,c){var d=/^([@&]|[=<](\*?))(\??)\s*([\w$]*)$/,e=T();r(a,function(a,f){a=a.trim();if(a in p)e[f]=p[a];else{var g=a.match(d);if(!g)throw $("iscp",b,f,a,c?"controller bindings definition":
"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f};g[4]&&(p[a]=e[f])}});return e}function c(a){var b=a.charAt(0);if(!b||b!==K(b))throw $("baddir",a);if(a!==a.trim())throw $("baddir",a);}function e(a){var b=a.require||a.controller&&a.name;!H(b)&&D(b)&&r(b,function(a,c){var d=a.match(l);a.substring(d[0].length)||(b[c]=d[0]+c)});return b}var f={},g=/^\s*directive:\s*([\w-]+)\s+(.*)$/,k=/(([\w-]+)(?::([^;]+))?;?)/,h=we("ngSrc,ngSrcset,src,srcset"),
l=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,m=/^(on[a-z]+|formaction)$/,p=T();this.directive=function qa(b,d){gb(b,"name");Ja(b,"directive");A(b)?(c(b),gb(d,"directiveFactory"),f.hasOwnProperty(b)||(f[b]=[],a.factory(b+"Directive",["$injector","$exceptionHandler",function(a,c){var d=[];r(f[b],function(f,g){try{var h=a.invoke(f);B(h)?h={compile:ia(h)}:!h.compile&&h.link&&(h.compile=ia(h.link));h.priority=h.priority||0;h.index=g;h.name=h.name||b;h.require=e(h);var k=h,l=h.restrict;if(l&&(!A(l)||!/[EACM]/.test(l)))throw $("badrestrict",
l,b);k.restrict=l||"EA";h.$$moduleName=f.$$moduleName;d.push(h)}catch(m){c(m)}});return d}])),f[b].push(d)):r(b,Yb(qa));return this};this.component=function y(a,b){function c(a){function e(b){return B(b)||H(b)?function(c,d){return a.invoke(b,this,{$element:c,$attrs:d})}:b}var f=b.template||b.templateUrl?b.template:"",g={controller:d,controllerAs:Bg(b.controller)||b.controllerAs||"$ctrl",template:e(f),templateUrl:e(b.templateUrl),transclude:b.transclude,scope:{},bindToController:b.bindings||{},restrict:"E",
require:b.require};r(b,function(a,b){"$"===b.charAt(0)&&(g[b]=a)});return g}if(!A(a))return r(a,Yb(Va(this,y))),this;var d=b.controller||function(){};r(b,function(a,b){"$"===b.charAt(0)&&(c[b]=a,B(d)&&(d[b]=a))});c.$inject=["$injector"];return this.directive(a,c)};this.aHrefSanitizationWhitelist=function(a){return w(a)?(b.aHrefSanitizationWhitelist(a),this):b.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(a){return w(a)?(b.imgSrcSanitizationWhitelist(a),this):b.imgSrcSanitizationWhitelist()};
var n=!0;this.debugInfoEnabled=function(a){return w(a)?(n=a,this):n};var s=!1;this.strictComponentBindingsEnabled=function(a){return w(a)?(s=a,this):s};var G=10;this.onChangesTtl=function(a){return arguments.length?(G=a,this):G};var t=!0;this.commentDirectivesEnabled=function(a){return arguments.length?(t=a,this):t};var N=!0;this.cssClassDirectivesEnabled=function(a){return arguments.length?(N=a,this):N};var v=T();this.addPropertySecurityContext=function(a,b,c){var d=a.toLowerCase()+"|"+b.toLowerCase();
if(d in v&&v[d]!==c)throw $("ctxoverride",a,b,v[d],c);v[d]=c;return this};(function(){function a(b,c){r(c,function(a){v[a.toLowerCase()]=b})}a(V.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]);a(V.CSS,["*|style"]);a(V.URL,"area|href area|ping a|href a|ping blockquote|cite body|background del|cite input|src ins|cite q|cite".split(" "));a(V.MEDIA_URL,"audio|src img|src img|srcset source|src source|srcset track|src video|src video|poster".split(" "));a(V.RESOURCE_URL,"*|formAction applet|code applet|codebase base|href embed|src frame|src form|action head|profile html|manifest iframe|src link|href media|src object|codebase object|data script|src".split(" "))})();
this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate",function(a,b,c,e,p,M,L,u,R){function q(){try{if(!--Ja)throw Ua=void 0,$("infchng",G);L.$apply(function(){for(var a=0,b=Ua.length;a<b;++a)try{Ua[a]()}catch(d){c(d)}Ua=void 0})}finally{Ja++}}function ma(a,b){if(!a)return a;if(!A(a))throw $("srcset",b,a.toString());for(var c="",d=U(a),e=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,e=/\s/.test(d)?e:/(,)/,d=d.split(e),e=Math.floor(d.length/
2),f=0;f<e;f++)var g=2*f,c=c+u.getTrustedMediaUrl(U(d[g])),c=c+(" "+U(d[g+1]));d=U(d[2*f]).split(/\s/);c+=u.getTrustedMediaUrl(U(d[0]));2===d.length&&(c+=" "+U(d[1]));return c}function w(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=a}function O(a,b,c){Fa.innerHTML="<span "+b+">";b=Fa.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name);d.value=c;a.attributes.setNamedItem(d)}function sa(a,b){try{a.addClass(b)}catch(c){}}
function da(a,b,c,d,e){a instanceof x||(a=x(a));var f=Xa(a,b,a,c,d,e);da.$$addScopeClass(a);var g=null;return function(b,c,d){if(!a)throw $("multilink");gb(b,"scope");e&&e.needsNewScope&&(b=b.$parent.$new());d=d||{};var h=d.parentBoundTranscludeFn,k=d.transcludeControllers;d=d.futureParentElement;h&&h.$$boundTransclude&&(h=h.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==ua(d)&&la.call(d).match(/SVG/)?"svg":"html":"html");d="html"!==g?x(ja(g,x("<div></div>").append(a).html())):c?Wa.clone.call(a):
a;if(k)for(var l in k)d.data("$"+l+"Controller",k[l].instance);da.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,h);c||(a=f=null);return d}}function Xa(a,b,c,d,e,f){function g(a,c,d,e){var f,k,l,m,p,I,t;if(n)for(t=Array(c.length),m=0;m<h.length;m+=3)f=h[m],t[f]=c[f];else t=c;m=0;for(p=h.length;m<p;)k=t[h[m++]],c=h[m++],f=h[m++],c?(c.scope?(l=a.$new(),da.$$addScopeInfo(x(k),l)):l=a,I=c.transcludeOnThisElement?ka(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?ka(a,b):null,c(f,l,k,d,I)):f&&f(a,k.childNodes,
void 0,e)}for(var h=[],k=H(a)||a instanceof x,l,m,p,I,n,t=0;t<a.length;t++){l=new w;11===Ca&&ib(a,t,k);m=sc(a[t],[],l,0===t?d:void 0,e);(f=m.length?aa(m,a[t],l,b,c,null,[],[],f):null)&&f.scope&&da.$$addScopeClass(l.$$element);l=f&&f.terminal||!(p=a[t].childNodes)||!p.length?null:Xa(p,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||l)h.push(t,f,l),I=!0,n=n||f;f=null}return I?g:null}function ib(a,b,c){var d=a[b],e=d.parentNode,f;if(d.nodeType===Pa)for(;;){f=e?d.nextSibling:
a[b+1];if(!f||f.nodeType!==Pa)break;d.nodeValue+=f.nodeValue;f.parentNode&&f.parentNode.removeChild(f);c&&f===a[b+1]&&a.splice(b+1,1)}}function ka(a,b,c){function d(e,f,g,h,k){e||(e=a.$new(!1,k),e.$$transcluded=!0);return b(e,f,{parentBoundTranscludeFn:c,transcludeControllers:g,futureParentElement:h})}var e=d.$$slots=T(),f;for(f in b.$$slots)e[f]=b.$$slots[f]?ka(a,b.$$slots[f],c):null;return d}function sc(a,b,d,e,f){var g=d.$attr,h;switch(a.nodeType){case 1:h=ua(a);X(b,wa(h),"E",e,f);for(var l,m,
n,t,J,s=a.attributes,v=0,G=s&&s.length;v<G;v++){var P=!1,N=!1,r=!1,y=!1,u=!1,M;l=s[v];m=l.name;t=l.value;n=wa(m.toLowerCase());(J=n.match(Ra))?(r="Attr"===J[1],y="Prop"===J[1],u="On"===J[1],m=m.replace(pd,"").toLowerCase().substr(4+J[1].length).replace(/_(.)/g,function(a,b){return b.toUpperCase()})):(M=n.match(Sa))&&ca(M[1])&&(P=m,N=m.substr(0,m.length-5)+"end",m=m.substr(0,m.length-6));if(y||u)d[n]=t,g[n]=l.name,y?Ea(a,b,n,m):b.push(qd(p,L,c,n,m,!1));else{n=wa(m.toLowerCase());g[n]=m;if(r||!d.hasOwnProperty(n))d[n]=
t,ld(a,n)&&(d[n]=!0);Ia(a,b,t,n,r);X(b,n,"A",e,f,P,N)}}"input"===h&&"hidden"===a.getAttribute("type")&&a.setAttribute("autocomplete","off");if(!Qa)break;g=a.className;D(g)&&(g=g.animVal);if(A(g)&&""!==g)for(;a=k.exec(g);)n=wa(a[2]),X(b,n,"C",e,f)&&(d[n]=U(a[3])),g=g.substr(a.index+a[0].length);break;case Pa:na(b,a.nodeValue);break;case 8:if(!Oa)break;F(a,b,d,e,f)}b.sort(ia);return b}function F(a,b,c,d,e){try{var f=g.exec(a.nodeValue);if(f){var h=wa(f[1]);X(b,h,"M",d,e)&&(c[h]=U(f[2]))}}catch(k){}}
function V(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw $("uterdir",b,c);1===a.nodeType&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return x(d)}function Y(a,b,c){return function(d,e,f,g,h){e=V(e[0],b,c);return a(d,e,f,g,h)}}function Z(a,b,c,d,e,f){var g;return a?da(b,c,d,e,f):function(){g||(g=da(b,c,d,e,f),b=c=f=null);return g.apply(this,arguments)}}function aa(a,b,d,e,f,g,h,k,l){function m(a,b,c,d){if(a){c&&(a=
Y(a,c,d));a.require=u.require;a.directiveName=Q;if(s===u||u.$$isolateScope)a=Aa(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=Y(b,c,d));b.require=u.require;b.directiveName=Q;if(s===u||u.$$isolateScope)b=Aa(b,{isolateScope:!0});k.push(b)}}function p(a,e,f,g,l){function m(a,b,c,d){var e;bb(a)||(d=c,c=b,b=a,a=void 0);N&&(e=P);c||(c=N?Q.parent():Q);if(d){var f=l.$$slots[d];if(f)return f(a,b,e,c,R);if(z(f))throw $("noslot",d,za(Q));}else return l(a,b,e,c,R)}var n,u,L,y,G,P,M,Q;b===f?(g=d,Q=d.$$element):(Q=
x(f),g=new w(Q,d));G=e;s?y=e.$new(!0):t&&(G=e.$parent);l&&(M=m,M.$$boundTransclude=l,M.isSlotFilled=function(a){return!!l.$$slots[a]});J&&(P=ea(Q,g,M,J,y,e,s));s&&(da.$$addScopeInfo(Q,y,!0,!(v&&(v===s||v===s.$$originalDirective))),da.$$addScopeClass(Q,!0),y.$$isolateBindings=s.$$isolateBindings,u=Da(e,g,y,y.$$isolateBindings,s),u.removeWatches&&y.$on("$destroy",u.removeWatches));for(n in P){u=J[n];L=P[n];var Cg=u.$$bindings.bindToController;L.instance=L();Q.data("$"+u.name+"Controller",L.instance);
L.bindingInfo=Da(G,g,L.instance,Cg,u)}r(J,function(a,b){var c=a.require;a.bindToController&&!H(c)&&D(c)&&S(P[b].instance,W(b,c,Q,P))});r(P,function(a){var b=a.instance;if(B(b.$onChanges))try{b.$onChanges(a.bindingInfo.initialChanges)}catch(d){c(d)}if(B(b.$onInit))try{b.$onInit()}catch(e){c(e)}B(b.$doCheck)&&(G.$watch(function(){b.$doCheck()}),b.$doCheck());B(b.$onDestroy)&&G.$on("$destroy",function(){b.$onDestroy()})});n=0;for(u=h.length;n<u;n++)L=h[n],Ba(L,L.isolateScope?y:e,Q,g,L.require&&W(L.directiveName,
L.require,Q,P),M);var R=e;s&&(s.template||null===s.templateUrl)&&(R=y);a&&a(R,f.childNodes,void 0,l);for(n=k.length-1;0<=n;n--)L=k[n],Ba(L,L.isolateScope?y:e,Q,g,L.require&&W(L.directiveName,L.require,Q,P),M);r(P,function(a){a=a.instance;B(a.$postLink)&&a.$postLink()})}l=l||{};for(var n=-Number.MAX_VALUE,t=l.newScopeDirective,J=l.controllerDirectives,s=l.newIsolateScopeDirective,v=l.templateDirective,L=l.nonTlbTranscludeDirective,G=!1,P=!1,N=l.hasElementTranscludeDirective,y=d.$$element=x(b),u,Q,
M,R=e,q,ma=!1,Ib=!1,O,sa=0,A=a.length;sa<A;sa++){u=a[sa];var E=u.$$start,ib=u.$$end;E&&(y=V(b,E,ib));M=void 0;if(n>u.priority)break;if(O=u.scope)u.templateUrl||(D(O)?(ba("new/isolated scope",s||t,u,y),s=u):ba("new/isolated scope",s,u,y)),t=t||u;Q=u.name;if(!ma&&(u.replace&&(u.templateUrl||u.template)||u.transclude&&!u.$$tlb)){for(O=sa+1;ma=a[O++];)if(ma.transclude&&!ma.$$tlb||ma.replace&&(ma.templateUrl||ma.template)){Ib=!0;break}ma=!0}!u.templateUrl&&u.controller&&(J=J||T(),ba("'"+Q+"' controller",
J[Q],u,y),J[Q]=u);if(O=u.transclude)if(G=!0,u.$$tlb||(ba("transclusion",L,u,y),L=u),"element"===O)N=!0,n=u.priority,M=y,y=d.$$element=x(da.$$createComment(Q,d[Q])),b=y[0],pa(f,Ha.call(M,0),b),R=Z(Ib,M,e,n,g&&g.name,{nonTlbTranscludeDirective:L});else{var ka=T();if(D(O)){M=C.document.createDocumentFragment();var Xa=T(),F=T();r(O,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a;Xa[a]=b;ka[b]=null;F[b]=c});r(y.contents(),function(a){var b=Xa[wa(ua(a))];b?(F[b]=!0,ka[b]=ka[b]||C.document.createDocumentFragment(),
ka[b].appendChild(a)):M.appendChild(a)});r(F,function(a,b){if(!a)throw $("reqslot",b);});for(var K in ka)ka[K]&&(R=x(ka[K].childNodes),ka[K]=Z(Ib,R,e));M=x(M.childNodes)}else M=x(pc(b)).contents();y.empty();R=Z(Ib,M,e,void 0,void 0,{needsNewScope:u.$$isolateScope||u.$$newScope});R.$$slots=ka}if(u.template)if(P=!0,ba("template",v,u,y),v=u,O=B(u.template)?u.template(y,d):u.template,O=Na(O),u.replace){g=u;M=mc.test(O)?rd(ja(u.templateNamespace,U(O))):[];b=M[0];if(1!==M.length||1!==b.nodeType)throw $("tplrt",
Q,"");pa(f,y,b);A={$attr:{}};O=sc(b,[],A);var Dg=a.splice(sa+1,a.length-(sa+1));(s||t)&&fa(O,s,t);a=a.concat(O).concat(Dg);ga(d,A);A=a.length}else y.html(O);if(u.templateUrl)P=!0,ba("template",v,u,y),v=u,u.replace&&(g=u),p=ha(a.splice(sa,a.length-sa),y,d,f,G&&R,h,k,{controllerDirectives:J,newScopeDirective:t!==u&&t,newIsolateScopeDirective:s,templateDirective:v,nonTlbTranscludeDirective:L}),A=a.length;else if(u.compile)try{q=u.compile(y,d,R);var X=u.$$originalDirective||u;B(q)?m(null,Va(X,q),E,ib):
q&&m(Va(X,q.pre),Va(X,q.post),E,ib)}catch(ca){c(ca,za(y))}u.terminal&&(p.terminal=!0,n=Math.max(n,u.priority))}p.scope=t&&!0===t.scope;p.transcludeOnThisElement=G;p.templateOnThisElement=P;p.transclude=R;l.hasElementTranscludeDirective=N;return p}function W(a,b,c,d){var e;if(A(b)){var f=b.match(l);b=b.substring(f[0].length);var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance;if(!e){var h="$"+b+"Controller";e="^^"===g&&c[0]&&9===c[0].nodeType?null:g?c.inheritedData(h):c.data(h)}if(!e&&
!f)throw $("ctreq",b,a);}else if(H(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=W(a,b[g],c,d);else D(b)&&(e={},r(b,function(b,f){e[f]=W(a,b,c,d)}));return e||null}function ea(a,b,c,d,e,f,g){var h=T(),k;for(k in d){var l=d[k],m={$scope:l===g||l.$$isolateScope?e:f,$element:a,$attrs:b,$transclude:c},p=l.controller;"@"===p&&(p=b[l.name]);m=M(p,m,!0,l.controllerAs);h[l.name]=m;a.data("$"+l.name+"Controller",m.instance)}return h}function fa(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d]=ac(a[d],{$$isolateScope:b,
$$newScope:c})}function X(b,c,e,g,h,k,l){if(c===h)return null;var m=null;if(f.hasOwnProperty(c)){h=a.get(c+"Directive");for(var p=0,n=h.length;p<n;p++)if(c=h[p],(z(g)||g>c.priority)&&-1!==c.restrict.indexOf(e)){k&&(c=ac(c,{$$start:k,$$end:l}));if(!c.$$bindings){var I=m=c,t=c.name,u={isolateScope:null,bindToController:null};D(I.scope)&&(!0===I.bindToController?(u.bindToController=d(I.scope,t,!0),u.isolateScope={}):u.isolateScope=d(I.scope,t,!1));D(I.bindToController)&&(u.bindToController=d(I.bindToController,
t,!0));if(u.bindToController&&!I.controller)throw $("noctrl",t);m=m.$$bindings=u;D(m.isolateScope)&&(c.$$isolateBindings=m.isolateScope)}b.push(c);m=c}}return m}function ca(b){if(f.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,e=c.length;d<e;d++)if(b=c[d],b.multiElement)return!0;return!1}function ga(a,b){var c=b.$attr,d=a.$attr;r(a,function(d,e){"$"!==e.charAt(0)&&(b[e]&&b[e]!==d&&(d=d.length?d+(("style"===e?";":" ")+b[e]):b[e]),a.$set(e,d,!0,c[e]))});r(b,function(b,e){a.hasOwnProperty(e)||
"$"===e.charAt(0)||(a[e]=b,"class"!==e&&"style"!==e&&(d[e]=c[e]))})}function ha(a,b,d,f,g,h,k,l){var m=[],p,n,t=b[0],u=a.shift(),J=ac(u,{templateUrl:null,transclude:null,replace:null,$$originalDirective:u}),s=B(u.templateUrl)?u.templateUrl(b,d):u.templateUrl,L=u.templateNamespace;b.empty();e(s).then(function(c){var e,I;c=Na(c);if(u.replace){c=mc.test(c)?rd(ja(L,U(c))):[];e=c[0];if(1!==c.length||1!==e.nodeType)throw $("tplrt",u.name,s);c={$attr:{}};pa(f,b,e);var v=sc(e,[],c);D(u.scope)&&fa(v,!0);a=
v.concat(a);ga(d,c)}else e=t,b.html(c);a.unshift(J);p=aa(a,e,d,g,b,u,h,k,l);r(f,function(a,c){a===e&&(f[c]=b[0])});for(n=Xa(b[0].childNodes,g);m.length;){c=m.shift();I=m.shift();var y=m.shift(),P=m.shift(),v=b[0];if(!c.$$destroyed){if(I!==t){var G=I.className;l.hasElementTranscludeDirective&&u.replace||(v=pc(e));pa(y,x(I),v);sa(x(v),G)}I=p.transcludeOnThisElement?ka(c,p.transclude,P):P;p(n,c,v,f,I)}}m=null}).catch(function(a){cc(a)&&c(a)});return function(a,b,c,d,e){a=e;b.$$destroyed||(m?m.push(b,
c,d,a):(p.transcludeOnThisElement&&(a=ka(b,p.transclude,e)),p(n,b,c,d,a)))}}function ia(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function ba(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw $("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,za(d));}function na(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=a.parent();var b=!!a.length;b&&da.$$addBindingClass(a);return function(a,c){var e=c.parent();
b||da.$$addBindingClass(e);da.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function ja(a,b){a=K(a||"html");switch(a){case "svg":case "math":var c=C.document.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function oa(a,b){if("srcdoc"===b)return u.HTML;if("src"===b||"ngSrc"===b)return-1===["img","video","audio","source","track"].indexOf(a)?u.RESOURCE_URL:u.MEDIA_URL;if("xlinkHref"===b)return"image"===a?u.MEDIA_URL:
"a"===a?u.URL:u.RESOURCE_URL;if("form"===a&&"action"===b||"base"===a&&"href"===b||"link"===a&&"href"===b)return u.RESOURCE_URL;if("a"===a&&("href"===b||"ngHref"===b))return u.URL}function xa(a,b){var c=b.toLowerCase();return v[a+"|"+c]||v["*|"+c]}function ya(a){return ma(u.valueOf(a),"ng-prop-srcset")}function Ea(a,b,c,d){if(m.test(d))throw $("nodomevents");a=ua(a);var e=xa(a,d),f=Ta;"srcset"!==d||"img"!==a&&"source"!==a?e&&(f=u.getTrusted.bind(u,e)):f=ya;b.push({priority:100,compile:function(a,b){var e=
p(b[c]),g=p(b[c],function(a){return u.valueOf(a)});return{pre:function(a,b){function c(){var g=e(a);b[0][d]=f(g)}c();a.$watch(g,c)}}}})}function Ia(a,c,d,e,f){var g=ua(a),k=oa(g,e),l=h[e]||f,p=b(d,!f,k,l);if(p){if("multiple"===e&&"select"===g)throw $("selmulti",za(a));if(m.test(e))throw $("nodomevents");c.push({priority:100,compile:function(){return{pre:function(a,c,f){c=f.$$observers||(f.$$observers=T());var g=f[e];g!==d&&(p=g&&b(g,!0,k,l),d=g);p&&(f[e]=p(a),(c[e]||(c[e]=[])).$$inter=!0,(f.$$observers&&
f.$$observers[e].$$scope||a).$watch(p,function(a,b){"class"===e&&a!==b?f.$updateClass(a,b):f.$set(e,a)}))}}}})}}function pa(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]===d){a[g++]=c;h=g+e-1;for(var k=a.length;g<k;g++,h++)h<k?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&(a.context=c);break}f&&f.replaceChild(c,d);a=C.document.createDocumentFragment();for(g=0;g<e;g++)a.appendChild(b[g]);x.hasData(d)&&(x.data(c,x.data(d)),x(d).off("$destroy"));x.cleanData(a.querySelectorAll("*"));
for(g=1;g<e;g++)delete b[g];b[0]=c;b.length=1}function Aa(a,b){return S(function(){return a.apply(null,arguments)},a,b)}function Ba(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,za(d))}}function ra(a,b){if(s)throw $("missingattr",a,b);}function Da(a,c,d,e,f){function g(b,c,e){B(d.$onChanges)&&!dc(c,e)&&(Ua||(a.$$postDigest(q),Ua=[]),m||(m={},Ua.push(h)),m[b]&&(e=m[b].previousValue),m[b]=new Jb(e,c))}function h(){d.$onChanges(m);m=void 0}var k=[],l={},m;r(e,function(e,h){var m=e.attrName,n=e.optional,
I,t,u,s;switch(e.mode){case "@":n||ta.call(c,m)||(ra(m,f.name),d[h]=c[m]=void 0);n=c.$observe(m,function(a){if(A(a)||Ga(a))g(h,a,d[h]),d[h]=a});c.$$observers[m].$$scope=a;I=c[m];A(I)?d[h]=b(I)(a):Ga(I)&&(d[h]=I);l[h]=new Jb(tc,d[h]);k.push(n);break;case "=":if(!ta.call(c,m)){if(n)break;ra(m,f.name);c[m]=void 0}if(n&&!c[m])break;t=p(c[m]);s=t.literal?va:dc;u=t.assign||function(){I=d[h]=t(a);throw $("nonassign",c[m],m,f.name);};I=d[h]=t(a);n=function(b){s(b,d[h])||(s(b,I)?u(a,b=d[h]):d[h]=b);return I=
b};n.$stateful=!0;n=e.collection?a.$watchCollection(c[m],n):a.$watch(p(c[m],n),null,t.literal);k.push(n);break;case "<":if(!ta.call(c,m)){if(n)break;ra(m,f.name);c[m]=void 0}if(n&&!c[m])break;t=p(c[m]);var v=t.literal,L=d[h]=t(a);l[h]=new Jb(tc,d[h]);n=a[e.collection?"$watchCollection":"$watch"](t,function(a,b){if(b===a){if(b===L||v&&va(b,L))return;b=L}g(h,a,b);d[h]=a});k.push(n);break;case "&":n||ta.call(c,m)||ra(m,f.name);t=c.hasOwnProperty(m)?p(c[m]):E;if(t===E&&n)break;d[h]=function(b){return t(a,
b)}}});return{initialChanges:l,removeWatches:k.length&&function(){for(var a=0,b=k.length;a<b;++a)k[a]()}}}var Ma=/^\w/,Fa=C.document.createElement("div"),Oa=t,Qa=N,Ja=G,Ua;w.prototype={$normalize:wa,$addClass:function(a){a&&0<a.length&&R.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&R.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=sd(a,b);c&&c.length&&R.addClass(this.$$element,c);(c=sd(b,a))&&c.length&&R.removeClass(this.$$element,c)},$set:function(a,b,d,e){var f=
ld(this.$$element[0],a),g=td[a],h=a;f?(this.$$element.prop(a,b),e=f):g&&(this[g]=b,h=g);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=Vc(a,"-"));"img"===ua(this.$$element)&&"srcset"===a&&(this[a]=b=ma(b,"$set('srcset', value)"));!1!==d&&(null===b||z(b)?this.$$element.removeAttr(e):Ma.test(e)?f&&!1===b?this.$$element.removeAttr(e):this.$$element.attr(e,b):O(this.$$element[0],e,b));(a=this.$$observers)&&r(a[h],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,
d=c.$$observers||(c.$$observers=T()),e=d[a]||(d[a]=[]);e.push(b);L.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||z(c[a])||b(c[a])});return function(){cb(e,b)}}};var Ka=b.startSymbol(),La=b.endSymbol(),Na="{{"===Ka&&"}}"===La?Ta:function(a){return a.replace(/\{\{/g,Ka).replace(/}}/g,La)},Ra=/^ng(Attr|Prop|On)([A-Z].*)$/,Sa=/^(.+)Start$/;da.$$addBindingInfo=n?function(a,b){var c=a.data("$binding")||[];H(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:E;da.$$addBindingClass=n?function(a){sa(a,
"ng-binding")}:E;da.$$addScopeInfo=n?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:E;da.$$addScopeClass=n?function(a,b){sa(a,b?"ng-isolate-scope":"ng-scope")}:E;da.$$createComment=function(a,b){var c="";n&&(c=" "+(a||"")+": ",b&&(c+=b+" "));return C.document.createComment(c)};return da}]}function Jb(a,b){this.previousValue=a;this.currentValue=b}function wa(a){return a.replace(pd,"").replace(Eg,function(a,d,c){return c?d.toUpperCase():d})}function sd(a,b){var d=
"",c=a.split(/\s+/),e=b.split(/\s+/),f=0;a:for(;f<c.length;f++){for(var g=c[f],k=0;k<e.length;k++)if(g===e[k])continue a;d+=(0<d.length?" ":"")+g}return d}function rd(a){a=x(a);var b=a.length;if(1>=b)return a;for(;b--;){var d=a[b];(8===d.nodeType||d.nodeType===Pa&&""===d.nodeValue.trim())&&Fg.call(a,b,1)}return a}function Bg(a,b){if(b&&A(b))return b;if(A(a)){var d=ud.exec(a);if(d)return d[3]}}function Ff(){var a={};this.has=function(b){return a.hasOwnProperty(b)};this.register=function(b,d){Ja(b,
"controller");D(b)?S(a,b):a[b]=d};this.$get=["$injector",function(b){function d(a,b,d,g){if(!a||!D(a.$scope))throw F("$controller")("noscp",g,b);a.$scope[b]=d}return function(c,e,f,g){var k,h,l;f=!0===f;g&&A(g)&&(l=g);if(A(c)){g=c.match(ud);if(!g)throw vd("ctrlfmt",c);h=g[1];l=l||g[3];c=a.hasOwnProperty(h)?a[h]:Ge(e.$scope,h,!0);if(!c)throw vd("ctrlreg",h);sb(c,h,!0)}if(f)return f=(H(c)?c[c.length-1]:c).prototype,k=Object.create(f||null),l&&d(e,l,k,h||c.name),S(function(){var a=b.invoke(c,k,e,h);
a!==k&&(D(a)||B(a))&&(k=a,l&&d(e,l,k,h||c.name));return k},{instance:k,identifier:l});k=b.instantiate(c,e,h);l&&d(e,l,k,h||c.name);return k}}]}function Gf(){this.$get=["$window",function(a){return x(a.document)}]}function Hf(){this.$get=["$document","$rootScope",function(a,b){function d(){e=c.hidden}var c=a[0],e=c&&c.hidden;a.on("visibilitychange",d);b.$on("$destroy",function(){a.off("visibilitychange",d)});return function(){return e}}]}function If(){this.$get=["$log",function(a){return function(b,
d){a.error.apply(a,arguments)}}]}function uc(a){return D(a)?ha(a)?a.toISOString():eb(a):a}function Of(){this.$get=function(){return function(a){if(!a)return"";var b=[];Oc(a,function(a,c){null===a||z(a)||B(a)||(H(a)?r(a,function(a){b.push(ba(c)+"="+ba(uc(a)))}):b.push(ba(c)+"="+ba(uc(a))))});return b.join("&")}}}function Pf(){this.$get=function(){return function(a){function b(a,e,f){H(a)?r(a,function(a,c){b(a,e+"["+(D(a)?c:"")+"]")}):D(a)&&!ha(a)?Oc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):
(B(a)&&(a=a()),d.push(ba(e)+"="+(null==a?"":ba(uc(a)))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}}function vc(a,b){if(A(a)){var d=a.replace(Gg,"").trim();if(d){var c=b("Content-Type"),c=c&&0===c.indexOf(wd),e;(e=c)||(e=(e=d.match(Hg))&&Ig[e[0]].test(d));if(e)try{a=Rc(d)}catch(f){if(!c)return a;throw Kb("baddata",a,f);}}}return a}function xd(a){var b=T(),d;A(a)?r(a.split("\n"),function(a){d=a.indexOf(":");var e=K(U(a.substr(0,d)));a=U(a.substr(d+1));e&&(b[e]=b[e]?b[e]+", "+a:a)}):D(a)&&
r(a,function(a,d){var f=K(d),g=U(a);f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function yd(a){var b;return function(d){b||(b=xd(a));return d?(d=b[K(d)],void 0===d&&(d=null),d):b}}function zd(a,b,d,c){if(B(c))return c(a,b,d);r(c,function(c){a=c(a,b,d)});return a}function Nf(){var a=this.defaults={transformResponse:[vc],transformRequest:[function(a){return D(a)&&"[object File]"!==la.call(a)&&"[object Blob]"!==la.call(a)&&"[object FormData]"!==la.call(a)?eb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},
post:ja(wc),put:ja(wc),patch:ja(wc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer",jsonpCallbackParam:"callback"},b=!1;this.useApplyAsync=function(a){return w(a)?(b=!!a,this):b};var d=this.interceptors=[],c=this.xsrfWhitelistedOrigins=[];this.$get=["$browser","$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector","$sce",function(e,f,g,k,h,l,m,p){function n(b){function c(a,b){for(var d=0,e=b.length;d<e;){var f=b[d++],g=b[d++];
a=a.then(f,g)}b.length=0;return a}function d(a,b){var c,e={};r(a,function(a,d){B(a)?(c=a(b),null!=c&&(e[d]=c)):e[d]=a});return e}function f(a){var b=S({},a);b.data=zd(a.data,a.headers,a.status,g.transformResponse);a=a.status;return 200<=a&&300>a?b:l.reject(b)}if(!D(b))throw F("$http")("badreq",b);if(!A(p.valueOf(b.url)))throw F("$http")("badreq",b.url);var g=S({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer,jsonpCallbackParam:a.jsonpCallbackParam},
b);g.headers=function(b){var c=a.headers,e=S({},b.headers),f,g,h,c=S({},c.common,c[K(b.method)]);a:for(f in c){g=K(f);for(h in e)if(K(h)===g)continue a;e[f]=c[f]}return d(e,ja(b))}(b);g.method=ub(g.method);g.paramSerializer=A(g.paramSerializer)?m.get(g.paramSerializer):g.paramSerializer;e.$$incOutstandingRequestCount("$http");var h=[],k=[];b=l.resolve(g);r(v,function(a){(a.request||a.requestError)&&h.unshift(a.request,a.requestError);(a.response||a.responseError)&&k.push(a.response,a.responseError)});
b=c(b,h);b=b.then(function(b){var c=b.headers,d=zd(b.data,yd(c),void 0,b.transformRequest);z(d)&&r(c,function(a,b){"content-type"===K(b)&&delete c[b]});z(b.withCredentials)&&!z(a.withCredentials)&&(b.withCredentials=a.withCredentials);return s(b,d).then(f,f)});b=c(b,k);return b=b.finally(function(){e.$$completeOutstandingRequest(E,"$http")})}function s(c,d){function e(a){if(a){var c={};r(a,function(a,d){c[d]=function(c){function d(){a(c)}b?h.$applyAsync(d):h.$$phase?d():h.$apply(d)}});return c}}function k(a,
c,d,e,f){function g(){m(c,a,d,e,f)}R&&(200<=a&&300>a?R.put(O,[a,c,xd(d),e,f]):R.remove(O));b?h.$applyAsync(g):(g(),h.$$phase||h.$apply())}function m(a,b,d,e,f){b=-1<=b?b:0;(200<=b&&300>b?L.resolve:L.reject)({data:a,status:b,headers:yd(d),config:c,statusText:e,xhrStatus:f})}function s(a){m(a.data,a.status,ja(a.headers()),a.statusText,a.xhrStatus)}function v(){var a=n.pendingRequests.indexOf(c);-1!==a&&n.pendingRequests.splice(a,1)}var L=l.defer(),u=L.promise,R,q,ma=c.headers,x="jsonp"===K(c.method),
O=c.url;x?O=p.getTrustedResourceUrl(O):A(O)||(O=p.valueOf(O));O=G(O,c.paramSerializer(c.params));x&&(O=t(O,c.jsonpCallbackParam));n.pendingRequests.push(c);u.then(v,v);!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(R=D(c.cache)?c.cache:D(a.cache)?a.cache:N);R&&(q=R.get(O),w(q)?q&&B(q.then)?q.then(s,s):H(q)?m(q[1],q[0],ja(q[2]),q[3],q[4]):m(q,200,{},"OK","complete"):R.put(O,u));z(q)&&((q=jc(c.url)?g()[c.xsrfCookieName||a.xsrfCookieName]:void 0)&&(ma[c.xsrfHeaderName||a.xsrfHeaderName]=
q),f(c.method,O,d,k,ma,c.timeout,c.withCredentials,c.responseType,e(c.eventHandlers),e(c.uploadEventHandlers)));return u}function G(a,b){0<b.length&&(a+=(-1===a.indexOf("?")?"?":"&")+b);return a}function t(a,b){var c=a.split("?");if(2<c.length)throw Kb("badjsonp",a);c=gc(c[1]);r(c,function(c,d){if("JSON_CALLBACK"===c)throw Kb("badjsonp",a);if(d===b)throw Kb("badjsonp",b,a);});return a+=(-1===a.indexOf("?")?"?":"&")+b+"=JSON_CALLBACK"}var N=k("$http");a.paramSerializer=A(a.paramSerializer)?m.get(a.paramSerializer):
a.paramSerializer;var v=[];r(d,function(a){v.unshift(A(a)?m.get(a):m.invoke(a))});var jc=Jg(c);n.pendingRequests=[];(function(a){r(arguments,function(a){n[a]=function(b,c){return n(S({},c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){r(arguments,function(a){n[a]=function(b,c,d){return n(S({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");n.defaults=a;return n}]}function Rf(){this.$get=function(){return function(){return new C.XMLHttpRequest}}}function Qf(){this.$get=
["$browser","$jsonpCallbacks","$document","$xhrFactory",function(a,b,d,c){return Kg(a,c,a.defer,b,d[0])}]}function Kg(a,b,d,c,e){function f(a,b,d){a=a.replace("JSON_CALLBACK",b);var f=e.createElement("script"),m=null;f.type="text/javascript";f.src=a;f.async=!0;m=function(a){f.removeEventListener("load",m);f.removeEventListener("error",m);e.body.removeChild(f);f=null;var g=-1,s="unknown";a&&("load"!==a.type||c.wasCalled(b)||(a={type:"error"}),s=a.type,g="error"===a.type?404:200);d&&d(g,s)};f.addEventListener("load",
m);f.addEventListener("error",m);e.body.appendChild(f);return m}return function(e,k,h,l,m,p,n,s,G,t){function N(a){J="timeout"===a;qa&&qa();y&&y.abort()}function v(a,b,c,e,f,g){w(P)&&d.cancel(P);qa=y=null;a(b,c,e,f,g)}k=k||a.url();if("jsonp"===K(e))var q=c.createCallback(k),qa=f(k,q,function(a,b){var d=200===a&&c.getResponse(q);v(l,a,d,"",b,"complete");c.removeCallback(q)});else{var y=b(e,k),J=!1;y.open(e,k,!0);r(m,function(a,b){w(a)&&y.setRequestHeader(b,a)});y.onload=function(){var a=y.statusText||
"",b="response"in y?y.response:y.responseText,c=1223===y.status?204:y.status;0===c&&(c=b?200:"file"===ga(k).protocol?404:0);v(l,c,b,y.getAllResponseHeaders(),a,"complete")};y.onerror=function(){v(l,-1,null,null,"","error")};y.ontimeout=function(){v(l,-1,null,null,"","timeout")};y.onabort=function(){v(l,-1,null,null,"",J?"timeout":"abort")};r(G,function(a,b){y.addEventListener(b,a)});r(t,function(a,b){y.upload.addEventListener(b,a)});n&&(y.withCredentials=!0);if(s)try{y.responseType=s}catch(I){if("json"!==
s)throw I;}y.send(z(h)?null:h)}if(0<p)var P=d(function(){N("timeout")},p);else p&&B(p.then)&&p.then(function(){N(w(p.$$timeoutId)?"timeout":"abort")})}}function Kf(){var a="{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a};this.endSymbol=function(a){return a?(b=a,this):b};this.$get=["$parse","$exceptionHandler","$sce",function(d,c,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(p,a).replace(n,b)}function k(a,b,c,d){var e=a.$watch(function(a){e();return d(a)},b,c);return e}
function h(f,h,n,p){function v(a){try{return a=n&&!r?e.getTrusted(n,a):e.valueOf(a),p&&!w(a)?a:ic(a)}catch(b){c(Ma.interr(f,b))}}var r=n===e.URL||n===e.MEDIA_URL;if(!f.length||-1===f.indexOf(a)){if(h)return;h=g(f);r&&(h=e.getTrusted(n,h));h=ia(h);h.exp=f;h.expressions=[];h.$$watchDelegate=k;return h}p=!!p;for(var q,y,J=0,I=[],P,Q=f.length,M=[],L=[],u;J<Q;)if(-1!==(q=f.indexOf(a,J))&&-1!==(y=f.indexOf(b,q+l)))J!==q&&M.push(g(f.substring(J,q))),J=f.substring(q+l,y),I.push(J),J=y+m,L.push(M.length),
M.push("");else{J!==Q&&M.push(g(f.substring(J)));break}u=1===M.length&&1===L.length;var R=r&&u?void 0:v;P=I.map(function(a){return d(a,R)});if(!h||I.length){var x=function(a){for(var b=0,c=I.length;b<c;b++){if(p&&z(a[b]))return;M[L[b]]=a[b]}if(r)return e.getTrusted(n,u?M[0]:M.join(""));n&&1<M.length&&Ma.throwNoconcat(f);return M.join("")};return S(function(a){var b=0,d=I.length,e=Array(d);try{for(;b<d;b++)e[b]=P[b](a);return x(e)}catch(g){c(Ma.interr(f,g))}},{exp:f,expressions:I,$$watchDelegate:function(a,
b){var c;return a.$watchGroup(P,function(d,e){var f=x(d);b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=a.length,m=b.length,p=new RegExp(a.replace(/./g,f),"g"),n=new RegExp(b.replace(/./g,f),"g");h.startSymbol=function(){return a};h.endSymbol=function(){return b};return h}]}function Lf(){this.$get=["$$intervalFactory","$window",function(a,b){var d={},c=function(a){b.clearInterval(a);delete d[a]},e=a(function(a,c,e){a=b.setInterval(a,c);d[a]=e;return a},c);e.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$intervalId"))throw Lg("badprom");
if(!d.hasOwnProperty(a.$$intervalId))return!1;a=a.$$intervalId;var b=d[a],e=b.promise;e.$$state&&(e.$$state.pur=!0);b.reject("canceled");c(a);return!0};return e}]}function Mf(){this.$get=["$browser","$q","$$q","$rootScope",function(a,b,d,c){return function(e,f){return function(g,k,h,l){function m(){p?g.apply(null,n):g(s)}var p=4<arguments.length,n=p?Ha.call(arguments,4):[],s=0,G=w(l)&&!l,t=(G?d:b).defer(),r=t.promise;h=w(h)?h:0;r.$$intervalId=e(function(){G?a.defer(m):c.$evalAsync(m);t.notify(s++);
0<h&&s>=h&&(t.resolve(s),f(r.$$intervalId));G||c.$apply()},k,t,G);return r}}}]}function Ad(a,b){var d=ga(a);b.$$protocol=d.protocol;b.$$host=d.hostname;b.$$port=fa(d.port)||Mg[d.protocol]||null}function Bd(a,b,d){if(Ng.test(a))throw jb("badpath",a);var c="/"!==a.charAt(0);c&&(a="/"+a);a=ga(a);for(var c=(c&&"/"===a.pathname.charAt(0)?a.pathname.substring(1):a.pathname).split("/"),e=c.length;e--;)c[e]=decodeURIComponent(c[e]),d&&(c[e]=c[e].replace(/\//g,"%2F"));d=c.join("/");b.$$path=d;b.$$search=gc(a.search);
b.$$hash=decodeURIComponent(a.hash);b.$$path&&"/"!==b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function xc(a,b){return a.slice(0,b.length)===b}function xa(a,b){if(xc(b,a))return b.substr(a.length)}function Da(a){var b=a.indexOf("#");return-1===b?a:a.substr(0,b)}function yc(a,b,d){this.$$html5=!0;d=d||"";Ad(a,this);this.$$parse=function(a){var d=xa(b,a);if(!A(d))throw jb("ipthprfx",a,b);Bd(d,this,!0);this.$$path||(this.$$path="/");this.$$compose()};this.$$normalizeUrl=function(a){return b+a.substr(1)};
this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;w(f=xa(a,c))?(g=f,g=d&&w(f=xa(d,f))?b+(xa("/",f)||f):a+g):w(f=xa(b,c))?g=b+f:b===c+"/"&&(g=b);g&&this.$$parse(g);return!!g}}function zc(a,b,d){Ad(a,this);this.$$parse=function(c){var e=xa(a,c)||xa(b,c),f;z(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",z(e)&&(a=c,this.replace())):(f=xa(d,e),z(f)&&(f=e));Bd(f,this,!1);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;xc(f,e)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?
f[1]:c);this.$$path=c;this.$$compose()};this.$$normalizeUrl=function(b){return a+(b?d+b:"")};this.$$parseLinkUrl=function(b,d){return Da(a)===Da(b)?(this.$$parse(b),!0):!1}}function Cd(a,b,d){this.$$html5=!0;zc.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a===Da(c)?f=c:(g=xa(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$normalizeUrl=function(b){return a+d+b}}function Lb(a){return function(){return this[a]}}function Dd(a,
b){return function(d){if(z(d))return this[a];this[a]=b(d);this.$$compose();return this}}function Tf(){var a="!",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return w(b)?(a=b,this):a};this.html5Mode=function(a){if(Ga(a))return b.enabled=a,this;if(D(a)){Ga(a.enabled)&&(b.enabled=a.enabled);Ga(a.requireBase)&&(b.requireBase=a.requireBase);if(Ga(a.rewriteLinks)||A(a.rewriteLinks))b.rewriteLinks=a.rewriteLinks;return this}return b};this.$get=["$rootScope","$browser","$sniffer",
"$rootElement","$window",function(d,c,e,f,g){function k(a,b){return a===b||ga(a).href===ga(b).href}function h(a,b,d){var e=m.url(),f=m.$$state;try{c.url(a,b,d),m.$$state=c.state()}catch(g){throw m.url(e),m.$$state=f,g;}}function l(a,b){d.$broadcast("$locationChangeSuccess",m.absUrl(),a,m.$$state,b)}var m,p;p=c.baseHref();var n=c.url(),s;if(b.enabled){if(!p&&b.requireBase)throw jb("nobase");s=n.substring(0,n.indexOf("/",n.indexOf("//")+2))+(p||"/");p=e.history?yc:Cd}else s=Da(n),p=zc;var r=s.substr(0,
Da(s).lastIndexOf("/")+1);m=new p(s,r,"#"+a);m.$$parseLinkUrl(n,n);m.$$state=c.state();var t=/^\s*(javascript|mailto):/i;f.on("click",function(a){var e=b.rewriteLinks;if(e&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!==a.which&&2!==a.button){for(var g=x(a.target);"a"!==ua(g[0]);)if(g[0]===f[0]||!(g=g.parent())[0])return;if(!A(e)||!z(g.attr(e))){var e=g.prop("href"),h=g.attr("href")||g.attr("xlink:href");D(e)&&"[object SVGAnimatedString]"===e.toString()&&(e=ga(e.animVal).href);t.test(e)||!e||g.attr("target")||
a.isDefaultPrevented()||!m.$$parseLinkUrl(e,h)||(a.preventDefault(),m.absUrl()!==c.url()&&d.$apply())}}});m.absUrl()!==n&&c.url(m.absUrl(),!0);var N=!0;c.onUrlChange(function(a,b){xc(a,r)?(d.$evalAsync(function(){var c=m.absUrl(),e=m.$$state,f;m.$$parse(a);m.$$state=b;f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented;m.absUrl()===a&&(f?(m.$$parse(c),m.$$state=e,h(c,!1,e)):(N=!1,l(c,e)))}),d.$$phase||d.$digest()):g.location.href=a});d.$watch(function(){if(N||m.$$urlUpdatedByLocation){m.$$urlUpdatedByLocation=
!1;var a=c.url(),b=m.absUrl(),f=c.state(),g=m.$$replace,n=!k(a,b)||m.$$html5&&e.history&&f!==m.$$state;if(N||n)N=!1,d.$evalAsync(function(){var b=m.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,m.$$state,f).defaultPrevented;m.absUrl()===b&&(c?(m.$$parse(a),m.$$state=f):(n&&h(b,g,f===m.$$state?null:m.$$state),l(a,f)))})}m.$$replace=!1});return m}]}function Uf(){var a=!0,b=this;this.debugEnabled=function(b){return w(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){cc(a)&&(a.stack&&
f?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console||{},e=b[a]||b.log||E;return function(){var a=[];r(arguments,function(b){a.push(c(b))});return Function.prototype.apply.call(e,b,a)}}var f=Ca||/\bEdge\//.test(d.navigator&&d.navigator.userAgent);return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,
arguments)}}()}}]}function Og(a){return a+""}function Pg(a,b){return"undefined"!==typeof a?a:b}function Ed(a,b){return"undefined"===typeof a?b:"undefined"===typeof b?a:a+b}function Qg(a,b){switch(a.type){case q.MemberExpression:if(a.computed)return!1;break;case q.UnaryExpression:return 1;case q.BinaryExpression:return"+"!==a.operator?1:!1;case q.CallExpression:return!1}return void 0===b?Fd:b}function Z(a,b,d){var c,e,f=a.isPure=Qg(a,d);switch(a.type){case q.Program:c=!0;r(a.body,function(a){Z(a.expression,
b,f);c=c&&a.expression.constant});a.constant=c;break;case q.Literal:a.constant=!0;a.toWatch=[];break;case q.UnaryExpression:Z(a.argument,b,f);a.constant=a.argument.constant;a.toWatch=a.argument.toWatch;break;case q.BinaryExpression:Z(a.left,b,f);Z(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case q.LogicalExpression:Z(a.left,b,f);Z(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case q.ConditionalExpression:Z(a.test,
b,f);Z(a.alternate,b,f);Z(a.consequent,b,f);a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case q.Identifier:a.constant=!1;a.toWatch=[a];break;case q.MemberExpression:Z(a.object,b,f);a.computed&&Z(a.property,b,f);a.constant=a.object.constant&&(!a.computed||a.property.constant);a.toWatch=a.constant?[]:[a];break;case q.CallExpression:c=d=a.filter?!b(a.callee.name).$stateful:!1;e=[];r(a.arguments,function(a){Z(a,b,f);c=c&&a.constant;e.push.apply(e,
a.toWatch)});a.constant=c;a.toWatch=d?e:[a];break;case q.AssignmentExpression:Z(a.left,b,f);Z(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=[a];break;case q.ArrayExpression:c=!0;e=[];r(a.elements,function(a){Z(a,b,f);c=c&&a.constant;e.push.apply(e,a.toWatch)});a.constant=c;a.toWatch=e;break;case q.ObjectExpression:c=!0;e=[];r(a.properties,function(a){Z(a.value,b,f);c=c&&a.value.constant;e.push.apply(e,a.value.toWatch);a.computed&&(Z(a.key,b,!1),c=c&&a.key.constant,e.push.apply(e,
a.key.toWatch))});a.constant=c;a.toWatch=e;break;case q.ThisExpression:a.constant=!1;a.toWatch=[];break;case q.LocalsExpression:a.constant=!1,a.toWatch=[]}}function Gd(a){if(1===a.length){a=a[0].expression;var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:void 0}}function Hd(a){return a.type===q.Identifier||a.type===q.MemberExpression}function Id(a){if(1===a.body.length&&Hd(a.body[0].expression))return{type:q.AssignmentExpression,left:a.body[0].expression,right:{type:q.NGValueParameter},operator:"="}}
function Jd(a){this.$filter=a}function Kd(a){this.$filter=a}function Mb(a,b,d){this.ast=new q(a,d);this.astCompiler=d.csp?new Kd(b):new Jd(b)}function Ac(a){return B(a.valueOf)?a.valueOf():Rg.call(a)}function Vf(){var a=T(),b={"true":!0,"false":!1,"null":null,undefined:void 0},d,c;this.addLiteral=function(a,c){b[a]=c};this.setIdentifierFns=function(a,b){d=a;c=b;return this};this.$get=["$filter",function(e){function f(b,c){var d,f;switch(typeof b){case "string":return f=b=b.trim(),d=a[f],d||(d=new Nb(G),
d=(new Mb(d,e,G)).parse(b),a[f]=p(d)),s(d,c);case "function":return s(b,c);default:return s(E,c)}}function g(a,b,c){return null==a||null==b?a===b:"object"!==typeof a||(a=Ac(a),"object"!==typeof a||c)?a===b||a!==a&&b!==b:!1}function k(a,b,c,d,e){var f=d.inputs,h;if(1===f.length){var k=g,f=f[0];return a.$watch(function(a){var b=f(a);g(b,k,f.isPure)||(h=d(a,void 0,void 0,[b]),k=b&&Ac(b));return h},b,c,e)}for(var l=[],m=[],n=0,p=f.length;n<p;n++)l[n]=g,m[n]=null;return a.$watch(function(a){for(var b=
!1,c=0,e=f.length;c<e;c++){var k=f[c](a);if(b||(b=!g(k,l[c],f[c].isPure)))m[c]=k,l[c]=k&&Ac(k)}b&&(h=d(a,void 0,void 0,m));return h},b,c,e)}function h(a,b,c,d,e){function f(){h(m)&&k()}function g(a,b,c,d){m=u&&d?d[0]:n(a,b,c,d);h(m)&&a.$$postDigest(f);return s(m)}var h=d.literal?l:w,k,m,n=d.$$intercepted||d,s=d.$$interceptor||Ta,u=d.inputs&&!n.inputs;g.literal=d.literal;g.constant=d.constant;g.inputs=d.inputs;p(g);return k=a.$watch(g,b,c,e)}function l(a){var b=!0;r(a,function(a){w(a)||(b=!1)});return b}
function m(a,b,c,d){var e=a.$watch(function(a){e();return d(a)},b,c);return e}function p(a){a.constant?a.$$watchDelegate=m:a.oneTime?a.$$watchDelegate=h:a.inputs&&(a.$$watchDelegate=k);return a}function n(a,b){function c(d){return b(a(d))}c.$stateful=a.$stateful||b.$stateful;c.$$pure=a.$$pure&&b.$$pure;return c}function s(a,b){if(!b)return a;a.$$interceptor&&(b=n(a.$$interceptor,b),a=a.$$intercepted);var c=!1,d=function(d,e,f,g){d=c&&g?g[0]:a(d,e,f,g);return b(d)};d.$$intercepted=a;d.$$interceptor=
b;d.literal=a.literal;d.oneTime=a.oneTime;d.constant=a.constant;b.$stateful||(c=!a.inputs,d.inputs=a.inputs?a.inputs:[a],b.$$pure||(d.inputs=d.inputs.map(function(a){return a.isPure===Fd?function(b){return a(b)}:a})));return p(d)}var G={csp:Aa().noUnsafeEval,literals:Ia(b),isIdentifierStart:B(d)&&d,isIdentifierContinue:B(c)&&c};f.$$getAst=function(a){var b=new Nb(G);return(new Mb(b,e,G)).getAst(a).ast};return f}]}function Xf(){var a=!0;this.$get=["$rootScope","$exceptionHandler",function(b,d){return Ld(function(a){b.$evalAsync(a)},
d,a)}];this.errorOnUnhandledRejections=function(b){return w(b)?(a=b,this):a}}function Yf(){var a=!0;this.$get=["$browser","$exceptionHandler",function(b,d){return Ld(function(a){b.defer(a)},d,a)}];this.errorOnUnhandledRejections=function(b){return w(b)?(a=b,this):a}}function Ld(a,b,d){function c(){return new e}function e(){var a=this.promise=new f;this.resolve=function(b){h(a,b)};this.reject=function(b){m(a,b)};this.notify=function(b){n(a,b)}}function f(){this.$$state={status:0}}function g(){for(;!w&&
x.length;){var a=x.shift();if(!a.pur){a.pur=!0;var c=a.value,c="Possibly unhandled rejection: "+("function"===typeof c?c.toString().replace(/ \{[\s\S]*$/,""):z(c)?"undefined":"string"!==typeof c?Ie(c,void 0):c);cc(a.value)?b(a.value,c):b(c)}}}function k(c){!d||c.pending||2!==c.status||c.pur||(0===w&&0===x.length&&a(g),x.push(c));!c.processScheduled&&c.pending&&(c.processScheduled=!0,++w,a(function(){var e,f,k;k=c.pending;c.processScheduled=!1;c.pending=void 0;try{for(var l=0,n=k.length;l<n;++l){c.pur=
!0;f=k[l][0];e=k[l][c.status];try{B(e)?h(f,e(c.value)):1===c.status?h(f,c.value):m(f,c.value)}catch(p){m(f,p),p&&!0===p.$$passToExceptionHandler&&b(p)}}}finally{--w,d&&0===w&&a(g)}}))}function h(a,b){a.$$state.status||(b===a?p(a,v("qcycle",b)):l(a,b))}function l(a,b){function c(b){g||(g=!0,l(a,b))}function d(b){g||(g=!0,p(a,b))}function e(b){n(a,b)}var f,g=!1;try{if(D(b)||B(b))f=b.then;B(f)?(a.$$state.status=-1,f.call(b,c,d,e)):(a.$$state.value=b,a.$$state.status=1,k(a.$$state))}catch(h){d(h)}}function m(a,
b){a.$$state.status||p(a,b)}function p(a,b){a.$$state.value=b;a.$$state.status=2;k(a.$$state)}function n(c,d){var e=c.$$state.pending;0>=c.$$state.status&&e&&e.length&&a(function(){for(var a,c,f=0,g=e.length;f<g;f++){c=e[f][0];a=e[f][3];try{n(c,B(a)?a(d):d)}catch(h){b(h)}}})}function s(a){var b=new f;m(b,a);return b}function G(a,b,c){var d=null;try{B(c)&&(d=c())}catch(e){return s(e)}return d&&B(d.then)?d.then(function(){return b(a)},s):b(a)}function t(a,b,c,d){var e=new f;h(e,a);return e.then(b,c,
d)}function q(a){if(!B(a))throw v("norslvr",a);var b=new f;a(function(a){h(b,a)},function(a){m(b,a)});return b}var v=F("$q",TypeError),w=0,x=[];S(f.prototype,{then:function(a,b,c){if(z(a)&&z(b)&&z(c))return this;var d=new f;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,a,b,c]);0<this.$$state.status&&k(this.$$state);return d},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return G(b,y,a)},function(b){return G(b,s,a)},
b)}});var y=t;q.prototype=f.prototype;q.defer=c;q.reject=s;q.when=t;q.resolve=y;q.all=function(a){var b=new f,c=0,d=H(a)?[]:{};r(a,function(a,e){c++;t(a).then(function(a){d[e]=a;--c||h(b,d)},function(a){m(b,a)})});0===c&&h(b,d);return b};q.race=function(a){var b=c();r(a,function(a){t(a).then(b.resolve,b.reject)});return b.promise};return q}function hg(){this.$get=["$window","$timeout",function(a,b){var d=a.requestAnimationFrame||a.webkitRequestAnimationFrame,c=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||
a.webkitCancelRequestAnimationFrame,e=!!d,f=e?function(a){var b=d(a);return function(){c(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};f.supported=e;return f}]}function Wf(){function a(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++pb;this.$$ChildScope=null;this.$$suspended=!1}b.prototype=a;return b}var b=10,d=F("$rootScope"),c=null,e=null;this.digestTtl=
function(a){arguments.length&&(b=a);return b};this.$get=["$exceptionHandler","$parse","$browser",function(f,g,k){function h(a){a.currentScope.$$destroyed=!0}function l(a){9===Ca&&(a.$$childHead&&l(a.$$childHead),a.$$nextSibling&&l(a.$$nextSibling));a.$parent=a.$$nextSibling=a.$$prevSibling=a.$$childHead=a.$$childTail=a.$root=a.$$watchers=null}function m(){this.$id=++pb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=
this;this.$$suspended=this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function p(a){if(v.$$phase)throw d("inprog",v.$$phase);v.$$phase=a}function n(a,b){do a.$$watchersCount+=b;while(a=a.$parent)}function s(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function G(){}function t(){for(;y.length;)try{y.shift()()}catch(a){f(a)}e=null}function q(){null===e&&(e=k.defer(function(){v.$apply(t)},
null,"$applyAsync"))}m.prototype={constructor:m,$new:function(b,c){var d;c=c||this;b?(d=new m,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=a(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(b||c!==this)&&d.$on("$destroy",h);return d},$watch:function(a,b,d,e){var f=g(a);b=B(b)?b:E;if(f.$$watchDelegate)return f.$$watchDelegate(this,b,d,f,a);var h=this,k=h.$$watchers,l=
{fn:b,last:G,get:f,exp:e||a,eq:!!d};c=null;k||(k=h.$$watchers=[],k.$$digestWatchIndex=-1);k.unshift(l);k.$$digestWatchIndex++;n(this,1);return function(){var a=cb(k,l);0<=a&&(n(h,-1),a<k.$$digestWatchIndex&&k.$$digestWatchIndex--);c=null}},$watchGroup:function(a,b){function c(){h=!1;try{k?(k=!1,b(e,e,g)):b(e,d,g)}finally{for(var f=0;f<a.length;f++)d[f]=e[f]}}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,k=!0;if(!a.length){var l=!0;g.$evalAsync(function(){l&&b(e,e,g)});return function(){l=
!1}}if(1===a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});r(a,function(a,b){var d=g.$watch(a,function(a){e[b]=a;h||(h=!0,g.$evalAsync(c))});f.push(d)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!z(e)){if(D(e))if(ya(e))for(f!==n&&(f=n,t=f.length=0,l++),a=e.length,t!==a&&(l++,f.length=t=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(l++,f[b]=g);else{f!==p&&(f=p={},t=0,l++);a=0;for(b in e)ta.call(e,
b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(l++,f[b]=g)):(t++,f[b]=g,l++));if(t>a)for(b in l++,f)ta.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$$pure=g(a).literal;c.$stateful=!c.$$pure;var d=this,e,f,h,k=1<b.length,l=0,m=g(a,c),n=[],p={},s=!0,t=0;return this.$watch(m,function(){s?(s=!1,b(e,e,d)):b(e,h,d);if(k)if(D(e))if(ya(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h={},e)ta.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var a,
g,h,l,m,n,s,r=b,q,y=w.length?v:this,N=[],z,A;p("$digest");k.$$checkUrlChange();this===v&&null!==e&&(k.defer.cancel(e),t());c=null;do{s=!1;q=y;for(n=0;n<w.length;n++){try{A=w[n],l=A.fn,l(A.scope,A.locals)}catch(C){f(C)}c=null}w.length=0;a:do{if(n=!q.$$suspended&&q.$$watchers)for(n.$$digestWatchIndex=n.length;n.$$digestWatchIndex--;)try{if(a=n[n.$$digestWatchIndex])if(m=a.get,(g=m(q))!==(h=a.last)&&!(a.eq?va(g,h):X(g)&&X(h)))s=!0,c=a,a.last=a.eq?Ia(g,null):g,l=a.fn,l(g,h===G?g:h,q),5>r&&(z=4-r,N[z]||
(N[z]=[]),N[z].push({msg:B(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:g,oldVal:h}));else if(a===c){s=!1;break a}}catch(E){f(E)}if(!(n=!q.$$suspended&&q.$$watchersCount&&q.$$childHead||q!==y&&q.$$nextSibling))for(;q!==y&&!(n=q.$$nextSibling);)q=q.$parent}while(q=n);if((s||w.length)&&!r--)throw v.$$phase=null,d("infdig",b,N);}while(s||w.length);for(v.$$phase=null;J<x.length;)try{x[J++]()}catch(D){f(D)}x.length=J=0;k.$$checkUrlChange()},$suspend:function(){this.$$suspended=!0},$isSuspended:function(){return this.$$suspended},
$resume:function(){this.$$suspended=!1},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===v&&k.$$applicationDestroyed();n(this,-this.$$watchersCount);for(var b in this.$$listenerCount)s(this,this.$$listenerCount[b],b);a&&a.$$childHead===this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail===this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=
this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=E;this.$on=this.$watch=this.$watchGroup=function(){return E};this.$$listeners={};this.$$nextSibling=null;l(this)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){v.$$phase||w.length||k.defer(function(){w.length&&v.$digest()},null,"$evalAsync");w.push({scope:this,fn:g(a),locals:b})},$$postDigest:function(a){x.push(a)},$apply:function(a){try{p("$apply");try{return this.$eval(a)}finally{v.$$phase=
null}}catch(b){f(b)}finally{try{v.$digest()}catch(c){throw f(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&y.push(b);a=g(a);q()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(delete c[d],s(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=
!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=db([h],arguments,1),l,m;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(m=d.length;l<m;l++)if(d[l])try{d[l].apply(null,k)}catch(n){f(n)}else d.splice(l,1),l--,m--;if(g)break;e=e.$parent}while(e);h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var g=db([e],arguments,
1),h,k;c=d;){e.currentScope=c;d=c.$$listeners[a]||[];h=0;for(k=d.length;h<k;h++)if(d[h])try{d[h].apply(null,g)}catch(l){f(l)}else d.splice(h,1),h--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=null;return e}};var v=new m,w=v.$$asyncQueue=[],x=v.$$postDigestQueue=[],y=v.$$applyAsyncQueue=[],J=0;return v}]}function Le(){var a=/^\s*(https?|s?ftp|mailto|tel|file):/,b=/^\s*((https?|ftp|file|blob):|data:image\/)/;
this.aHrefSanitizationWhitelist=function(b){return w(b)?(a=b,this):a};this.imgSrcSanitizationWhitelist=function(a){return w(a)?(b=a,this):b};this.$get=function(){return function(d,c){var e=c?b:a,f=ga(d&&d.trim()).href;return""===f||f.match(e)?d:"unsafe:"+f}}}function Sg(a){if("self"===a)return a;if(A(a)){if(-1<a.indexOf("***"))throw Ea("iwcard",a);a=Md(a).replace(/\\\*\\\*/g,".*").replace(/\\\*/g,"[^:/.?&;]*");return new RegExp("^"+a+"$")}if(ab(a))return new RegExp("^"+a.source+"$");throw Ea("imatcher");
}function Nd(a){var b=[];w(a)&&r(a,function(a){b.push(Sg(a))});return b}function $f(){this.SCE_CONTEXTS=V;var a=["self"],b=[];this.resourceUrlWhitelist=function(b){arguments.length&&(a=Nd(b));return a};this.resourceUrlBlacklist=function(a){arguments.length&&(b=Nd(a));return b};this.$get=["$injector","$$sanitizeUri",function(d,c){function e(a,b){var c;"self"===a?(c=Bc(b,Od))||(C.document.baseURI?c=C.document.baseURI:(Na||(Na=C.document.createElement("a"),Na.href=".",Na=Na.cloneNode(!1)),c=Na.href),
c=Bc(b,c)):c=!!a.exec(b.href);return c}function f(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var g=function(a){throw Ea("unsafe");};d.has("$sanitize")&&(g=d.get("$sanitize"));var k=f(),h={};h[V.HTML]=f(k);h[V.CSS]=f(k);h[V.MEDIA_URL]=f(k);h[V.URL]=f(h[V.MEDIA_URL]);h[V.JS]=f(k);h[V.RESOURCE_URL]=
f(h[V.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw Ea("icontext",a,b);if(null===b||z(b)||""===b)return b;if("string"!==typeof b)throw Ea("itype",a);return new c(b)},getTrusted:function(d,f){if(null===f||z(f)||""===f)return f;var k=h.hasOwnProperty(d)?h[d]:null;if(k&&f instanceof k)return f.$$unwrapTrustedValue();B(f.$$unwrapTrustedValue)&&(f=f.$$unwrapTrustedValue());if(d===V.MEDIA_URL||d===V.URL)return c(f.toString(),d===V.MEDIA_URL);if(d===V.RESOURCE_URL){var k=
ga(f.toString()),n,s,r=!1;n=0;for(s=a.length;n<s;n++)if(e(a[n],k)){r=!0;break}if(r)for(n=0,s=b.length;n<s;n++)if(e(b[n],k)){r=!1;break}if(r)return f;throw Ea("insecurl",f.toString());}if(d===V.HTML)return g(f);throw Ea("unsafe");},valueOf:function(a){return a instanceof k?a.$$unwrapTrustedValue():a}}}]}function Zf(){var a=!0;this.enabled=function(b){arguments.length&&(a=!!b);return a};this.$get=["$parse","$sceDelegate",function(b,d){if(a&&8>Ca)throw Ea("iequirks");var c=ja(V);c.isEnabled=function(){return a};
c.trustAs=d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},c.valueOf=Ta);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;r(V,function(a,b){var d=K(b);c[("parse_as_"+d).replace(Cc,wb)]=function(b){return e(a,b)};c[("get_trusted_"+d).replace(Cc,wb)]=function(b){return f(a,b)};c[("trust_as_"+d).replace(Cc,wb)]=function(b){return g(a,b)}});
return c}]}function ag(){this.$get=["$window","$document",function(a,b){var d={},c=!((!a.nw||!a.nw.process)&&a.chrome&&(a.chrome.app&&a.chrome.app.runtime||!a.chrome.app&&a.chrome.runtime&&a.chrome.runtime.id))&&a.history&&a.history.pushState,e=fa((/android (\d+)/.exec(K((a.navigator||{}).userAgent))||[])[1]),f=/Boxee/i.test((a.navigator||{}).userAgent),g=b[0]||{},k=g.body&&g.body.style,h=!1,l=!1;k&&(h=!!("transition"in k||"webkitTransition"in k),l=!!("animation"in k||"webkitAnimation"in k));return{history:!(!c||
4>e||f),hasEvent:function(a){if("input"===a&&Ca)return!1;if(z(d[a])){var b=g.createElement("div");d[a]="on"+a in b}return d[a]},csp:Aa(),transitions:h,animations:l,android:e}}]}function bg(){this.$get=ia(function(a){return new Tg(a)})}function Tg(a){function b(){var a=e.pop();return a&&a.cb}function d(a){for(var b=e.length-1;0<=b;--b){var c=e[b];if(c.type===a)return e.splice(b,1),c.cb}}var c={},e=[],f=this.ALL_TASKS_TYPE="$$all$$",g=this.DEFAULT_TASK_TYPE="$$default$$";this.completeTask=function(e,
h){h=h||g;try{e()}finally{var l;l=h||g;c[l]&&(c[l]--,c[f]--);l=c[h];var m=c[f];if(!m||!l)for(l=m?d:b;m=l(h);)try{m()}catch(p){a.error(p)}}};this.incTaskCount=function(a){a=a||g;c[a]=(c[a]||0)+1;c[f]=(c[f]||0)+1};this.notifyWhenNoPendingTasks=function(a,b){b=b||f;c[b]?e.push({type:b,cb:a}):a()}}function dg(){var a;this.httpOptions=function(b){return b?(a=b,this):a};this.$get=["$exceptionHandler","$templateCache","$http","$q","$sce",function(b,d,c,e,f){function g(k,h){g.totalPendingRequests++;if(!A(k)||
z(d.get(k)))k=f.getTrustedResourceUrl(k);var l=c.defaults&&c.defaults.transformResponse;H(l)?l=l.filter(function(a){return a!==vc}):l===vc&&(l=null);return c.get(k,S({cache:d,transformResponse:l},a)).finally(function(){g.totalPendingRequests--}).then(function(a){return d.put(k,a.data)},function(a){h||(a=Ug("tpload",k,a.status,a.statusText),b(a));return e.reject(a)})}g.totalPendingRequests=0;return g}]}function eg(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,
b,d){a=a.getElementsByClassName("ng-binding");var g=[];r(a,function(a){var c=ca.element(a).data("$binding");c&&r(c,function(c){d?(new RegExp("(^|\\s)"+Md(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!==c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],k=0;k<g.length;++k){var h=a.querySelectorAll("["+g[k]+"model"+(d?"=":"*=")+'"'+b+'"]');if(h.length)return h}},getLocation:function(){return d.url()},setLocation:function(b){b!==d.url()&&(d.url(b),a.$digest())},
whenStable:function(a){b.notifyWhenNoOutstandingRequests(a)}}}]}function fg(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(a,b,d,c,e){function f(f,h,l){B(f)||(l=h,h=f,f=E);var m=Ha.call(arguments,3),p=w(l)&&!l,n=(p?c:d).defer(),s=n.promise,r;r=b.defer(function(){try{n.resolve(f.apply(null,m))}catch(b){n.reject(b),e(b)}finally{delete g[s.$$timeoutId]}p||a.$apply()},h,"$timeout");s.$$timeoutId=r;g[r]=n;return s}var g={};f.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$timeoutId"))throw Vg("badprom");
if(!g.hasOwnProperty(a.$$timeoutId))return!1;a=a.$$timeoutId;var c=g[a],d=c.promise;d.$$state&&(d.$$state.pur=!0);c.reject("canceled");delete g[a];return b.defer.cancel(a)};return f}]}function ga(a){if(!A(a))return a;Ca&&(aa.setAttribute("href",a),a=aa.href);aa.setAttribute("href",a);a=aa.hostname;!Wg&&-1<a.indexOf(":")&&(a="["+a+"]");return{href:aa.href,protocol:aa.protocol?aa.protocol.replace(/:$/,""):"",host:aa.host,search:aa.search?aa.search.replace(/^\?/,""):"",hash:aa.hash?aa.hash.replace(/^#/,
""):"",hostname:a,port:aa.port,pathname:"/"===aa.pathname.charAt(0)?aa.pathname:"/"+aa.pathname}}function Jg(a){var b=[Od].concat(a.map(ga));return function(a){a=ga(a);return b.some(Bc.bind(null,a))}}function Bc(a,b){a=ga(a);b=ga(b);return a.protocol===b.protocol&&a.host===b.host}function gg(){this.$get=ia(C)}function Pd(a){function b(a){try{return decodeURIComponent(a)}catch(b){return a}}var d=a[0]||{},c={},e="";return function(){var a,g,k,h,l;try{a=d.cookie||""}catch(m){a=""}if(a!==e)for(e=a,a=
e.split("; "),c={},k=0;k<a.length;k++)g=a[k],h=g.indexOf("="),0<h&&(l=b(g.substring(0,h)),z(c[l])&&(c[l]=b(g.substring(h+1))));return c}}function kg(){this.$get=Pd}function dd(a){function b(d,c){if(D(d)){var e={};r(d,function(a,c){e[c]=b(c,a)});return e}return a.factory(d+"Filter",c)}this.register=b;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];b("currency",Qd);b("date",Rd);b("filter",Xg);b("json",Yg);b("limitTo",Zg);b("lowercase",$g);b("number",Sd);b("orderBy",
Td);b("uppercase",ah)}function Xg(){return function(a,b,d,c){if(!ya(a)){if(null==a)return a;throw F("filter")("notarray",a);}c=c||"$";var e;switch(Dc(b)){case "function":break;case "boolean":case "null":case "number":case "string":e=!0;case "object":b=bh(b,d,c,e);break;default:return a}return Array.prototype.filter.call(a,b)}}function bh(a,b,d,c){var e=D(a)&&d in a;!0===b?b=va:B(b)||(b=function(a,b){if(z(a))return!1;if(null===a||null===b)return a===b;if(D(b)||D(a)&&!bc(a))return!1;a=K(""+a);b=K(""+
b);return-1!==a.indexOf(b)});return function(f){return e&&!D(f)?Fa(f,a[d],b,d,!1):Fa(f,a,b,d,c)}}function Fa(a,b,d,c,e,f){var g=Dc(a),k=Dc(b);if("string"===k&&"!"===b.charAt(0))return!Fa(a,b.substring(1),d,c,e);if(H(a))return a.some(function(a){return Fa(a,b,d,c,e)});switch(g){case "object":var h;if(e){for(h in a)if(h.charAt&&"$"!==h.charAt(0)&&Fa(a[h],b,d,c,!0))return!0;return f?!1:Fa(a,b,d,c,!1)}if("object"===k){for(h in b)if(f=b[h],!B(f)&&!z(f)&&(g=h===c,!Fa(g?a:a[h],f,d,c,g,g)))return!1;return!0}return d(a,
b);case "function":return!1;default:return d(a,b)}}function Dc(a){return null===a?"null":typeof a}function Qd(a){var b=a.NUMBER_FORMATS;return function(a,c,e){z(c)&&(c=b.CURRENCY_SYM);z(e)&&(e=b.PATTERNS[1].maxFrac);var f=c?/\u00A4/g:/\s*\u00A4\s*/g;return null==a?a:Ud(a,b.PATTERNS[1],b.GROUP_SEP,b.DECIMAL_SEP,e).replace(f,c)}}function Sd(a){var b=a.NUMBER_FORMATS;return function(a,c){return null==a?a:Ud(a,b.PATTERNS[0],b.GROUP_SEP,b.DECIMAL_SEP,c)}}function ch(a){var b=0,d,c,e,f,g;-1<(c=a.indexOf(Vd))&&
(a=a.replace(Vd,""));0<(e=a.search(/e/i))?(0>c&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length);for(e=0;a.charAt(e)===Ec;e++);if(e===(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)===Ec;)g--;c-=e;d=[];for(f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}c>Wd&&(d=d.splice(0,Wd-1),b=c-1,c=1);return{d:d,e:b,i:c}}function dh(a,b,d,c){var e=a.d,f=e.length-a.i;b=z(b)?Math.min(Math.max(d,f),c):+b;d=b+a.i;c=e[d];if(0<d){e.splice(Math.max(a.i,d));for(var g=d;g<e.length;g++)e[g]=0}else for(f=Math.max(0,f),a.i=
1,e.length=Math.max(1,d=b+1),e[0]=0,g=1;g<d;g++)e[g]=0;if(5<=c)if(0>d-1){for(c=0;c>d;c--)e.unshift(0),a.i++;e.unshift(1);a.i++}else e[d-1]++;for(;f<Math.max(0,b);f++)e.push(0);if(b=e.reduceRight(function(a,b,c,d){b+=a;d[c]=b%10;return Math.floor(b/10)},0))e.unshift(b),a.i++}function Ud(a,b,d,c,e){if(!A(a)&&!W(a)||isNaN(a))return"";var f=!isFinite(a),g=!1,k=Math.abs(a)+"",h="";if(f)h="\u221e";else{g=ch(k);dh(g,e,b.minFrac,b.maxFrac);h=g.d;k=g.i;e=g.e;f=[];for(g=h.reduce(function(a,b){return a&&!b},
!0);0>k;)h.unshift(0),k++;0<k?f=h.splice(k,h.length):(f=h,h=[0]);k=[];for(h.length>=b.lgSize&&k.unshift(h.splice(-b.lgSize,h.length).join(""));h.length>b.gSize;)k.unshift(h.splice(-b.gSize,h.length).join(""));h.length&&k.unshift(h.join(""));h=k.join(d);f.length&&(h+=c+f.join(""));e&&(h+="e+"+e)}return 0>a&&!g?b.negPre+h+b.negSuf:b.posPre+h+b.posSuf}function Ob(a,b,d,c){var e="";if(0>a||c&&0>=a)c?a=-a+1:(a=-a,e="-");for(a=""+a;a.length<b;)a=Ec+a;d&&(a=a.substr(a.length-b));return e+a}function ea(a,
b,d,c,e){d=d||0;return function(f){f=f["get"+a]();if(0<d||f>-d)f+=d;0===f&&-12===d&&(f=12);return Ob(f,b,c,e)}}function kb(a,b,d){return function(c,e){var f=c["get"+a](),g=ub((d?"STANDALONE":"")+(b?"SHORT":"")+a);return e[g][f]}}function Xd(a){var b=(new Date(a,0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Yd(a){return function(b){var d=Xd(b.getFullYear());b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d;b=1+Math.round(b/6048E5);return Ob(b,a)}}function Fc(a,b){return 0>=
a.getFullYear()?b.ERAS[0]:b.ERAS[1]}function Rd(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,k=b[8]?a.setUTCFullYear:a.setFullYear,h=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=fa(b[9]+b[10]),g=fa(b[9]+b[11]));k.call(a,fa(b[1]),fa(b[2])-1,fa(b[3]));f=fa(b[4]||0)-f;g=fa(b[5]||0)-g;k=fa(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));h.call(a,f,g,k,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,
d,f){var g="",k=[],h,l;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;A(c)&&(c=eh.test(c)?fa(c):b(c));W(c)&&(c=new Date(c));if(!ha(c)||!isFinite(c.getTime()))return c;for(;d;)(l=fh.exec(d))?(k=db(k,l,1),d=k.pop()):(k.push(d),d=null);var m=c.getTimezoneOffset();f&&(m=ec(f,m),c=fc(c,f,!0));r(k,function(b){h=gh[b];g+=h?h(c,a.DATETIME_FORMATS,m):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function Yg(){return function(a,b){z(b)&&(b=2);return eb(a,b)}}function Zg(){return function(a,
b,d){b=Infinity===Math.abs(Number(b))?Number(b):fa(b);if(X(b))return a;W(a)&&(a=a.toString());if(!ya(a))return a;d=!d||isNaN(d)?0:fa(d);d=0>d?Math.max(0,a.length+d):d;return 0<=b?Gc(a,d,d+b):0===d?Gc(a,b,a.length):Gc(a,Math.max(0,d+b),d)}}function Gc(a,b,d){return A(a)?a.slice(b,d):Ha.call(a,b,d)}function Td(a){function b(b){return b.map(function(b){var c=1,d=Ta;if(B(b))d=b;else if(A(b)){if("+"===b.charAt(0)||"-"===b.charAt(0))c="-"===b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(d=a(b),d.constant))var e=
d(),d=function(a){return a[e]}}return{get:d,descending:c}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}function c(a,b){var c=0,d=a.type,h=b.type;if(d===h){var h=a.value,l=b.value;"string"===d?(h=h.toLowerCase(),l=l.toLowerCase()):"object"===d&&(D(h)&&(h=a.index),D(l)&&(l=b.index));h!==l&&(c=h<l?-1:1)}else c="undefined"===d?1:"undefined"===h?-1:"null"===d?1:"null"===h?-1:d<h?-1:1;return c}return function(a,f,g,k){if(null==a)return a;if(!ya(a))throw F("orderBy")("notarray",
a);H(f)||(f=[f]);0===f.length&&(f=["+"]);var h=b(f),l=g?-1:1,m=B(k)?k:c;a=Array.prototype.map.call(a,function(a,b){return{value:a,tieBreaker:{value:b,type:"number",index:b},predicateValues:h.map(function(c){var e=c.get(a);c=typeof e;if(null===e)c="null";else if("object"===c)a:{if(B(e.valueOf)&&(e=e.valueOf(),d(e)))break a;bc(e)&&(e=e.toString(),d(e))}return{value:e,type:c,index:b}})}});a.sort(function(a,b){for(var d=0,e=h.length;d<e;d++){var f=m(a.predicateValues[d],b.predicateValues[d]);if(f)return f*
h[d].descending*l}return(m(a.tieBreaker,b.tieBreaker)||c(a.tieBreaker,b.tieBreaker))*l});return a=a.map(function(a){return a.value})}}function Ra(a){B(a)&&(a={link:a});a.restrict=a.restrict||"AC";return ia(a)}function Pb(a,b,d,c,e){this.$$controls=[];this.$error={};this.$$success={};this.$pending=void 0;this.$name=e(b.name||b.ngForm||"")(d);this.$dirty=!1;this.$valid=this.$pristine=!0;this.$submitted=this.$invalid=!1;this.$$parentForm=lb;this.$$element=a;this.$$animate=c;Zd(this)}function Zd(a){a.$$classCache=
{};a.$$classCache[$d]=!(a.$$classCache[mb]=a.$$element.hasClass(mb))}function ae(a){function b(a,b,c){c&&!a.$$classCache[b]?(a.$$animate.addClass(a.$$element,b),a.$$classCache[b]=!0):!c&&a.$$classCache[b]&&(a.$$animate.removeClass(a.$$element,b),a.$$classCache[b]=!1)}function d(a,c,d){c=c?"-"+Vc(c,"-"):"";b(a,mb+c,!0===d);b(a,$d+c,!1===d)}var c=a.set,e=a.unset;a.clazz.prototype.$setValidity=function(a,g,k){z(g)?(this.$pending||(this.$pending={}),c(this.$pending,a,k)):(this.$pending&&e(this.$pending,
a,k),be(this.$pending)&&(this.$pending=void 0));Ga(g)?g?(e(this.$error,a,k),c(this.$$success,a,k)):(c(this.$error,a,k),e(this.$$success,a,k)):(e(this.$error,a,k),e(this.$$success,a,k));this.$pending?(b(this,"ng-pending",!0),this.$valid=this.$invalid=void 0,d(this,"",null)):(b(this,"ng-pending",!1),this.$valid=be(this.$error),this.$invalid=!this.$valid,d(this,"",this.$valid));g=this.$pending&&this.$pending[a]?void 0:this.$error[a]?!1:this.$$success[a]?!0:null;d(this,a,g);this.$$parentForm.$setValidity(a,
g,this)}}function be(a){if(a)for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}function Hc(a){a.$formatters.push(function(b){return a.$isEmpty(b)?b:b.toString()})}function Sa(a,b,d,c,e,f){var g=K(b[0].type);if(!e.android){var k=!1;b.on("compositionstart",function(){k=!0});b.on("compositionupdate",function(a){if(z(a.data)||""===a.data)k=!1});b.on("compositionend",function(){k=!1;l()})}var h,l=function(a){h&&(f.defer.cancel(h),h=null);if(!k){var e=b.val();a=a&&a.type;"password"===g||d.ngTrim&&
"false"===d.ngTrim||(e=U(e));(c.$viewValue!==e||""===e&&c.$$hasNativeValidators)&&c.$setViewValue(e,a)}};if(e.hasEvent("input"))b.on("input",l);else{var m=function(a,b,c){h||(h=f.defer(function(){h=null;b&&b.value===c||l(a)}))};b.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&19>b||37<=b&&40>=b||m(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut drop",m)}b.on("change",l);if(ce[g]&&c.$$hasNativeValidators&&g===d.type)b.on("keydown wheel mousedown",function(a){if(!h){var b=this.validity,
c=b.badInput,d=b.typeMismatch;h=f.defer(function(){h=null;b.badInput===c&&b.typeMismatch===d||l(a)})}});c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Qb(a,b){return function(d,c){var e,f;if(ha(d))return d;if(A(d)){'"'===d.charAt(0)&&'"'===d.charAt(d.length-1)&&(d=d.substring(1,d.length-1));if(hh.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),
ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},r(e,function(a,c){c<b.length&&(f[b[c]]=+a)}),e=new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0),100>f.yyyy&&e.setFullYear(f.yyyy),e}return NaN}}function nb(a,b,d,c){return function(e,f,g,k,h,l,m,p){function n(a){return a&&!(a.getTime&&a.getTime()!==a.getTime())}function s(a){return w(a)&&!ha(a)?r(a)||void 0:a}function r(a,b){var c=k.$options.getOption("timezone");v&&v!==c&&(b=Sc(b,ec(v)));var e=d(a,
b);!isNaN(e)&&c&&(e=fc(e,c));return e}Ic(e,f,g,k,a);Sa(e,f,g,k,h,l);var t="time"===a||"datetimelocal"===a,q,v;k.$parsers.push(function(c){if(k.$isEmpty(c))return null;if(b.test(c))return r(c,q);k.$$parserName=a});k.$formatters.push(function(a){if(a&&!ha(a))throw ob("datefmt",a);if(n(a)){q=a;var b=k.$options.getOption("timezone");b&&(v=b,q=fc(q,b,!0));var d=c;t&&A(k.$options.getOption("timeSecondsFormat"))&&(d=c.replace("ss.sss",k.$options.getOption("timeSecondsFormat")).replace(/:$/,""));a=m("date")(a,
d,b);t&&k.$options.getOption("timeStripZeroSeconds")&&(a=a.replace(/(?::00)?(?:\.000)?$/,""));return a}v=q=null;return""});if(w(g.min)||g.ngMin){var x=g.min||p(g.ngMin)(e),B=s(x);k.$validators.min=function(a){return!n(a)||z(B)||d(a)>=B};g.$observe("min",function(a){a!==x&&(B=s(a),x=a,k.$validate())})}if(w(g.max)||g.ngMax){var y=g.max||p(g.ngMax)(e),J=s(y);k.$validators.max=function(a){return!n(a)||z(J)||d(a)<=J};g.$observe("max",function(a){a!==y&&(J=s(a),y=a,k.$validate())})}}}function Ic(a,b,d,
c,e){(c.$$hasNativeValidators=D(b[0].validity))&&c.$parsers.push(function(a){var d=b.prop("validity")||{};if(d.badInput||d.typeMismatch)c.$$parserName=e;else return a})}function de(a){a.$parsers.push(function(b){if(a.$isEmpty(b))return null;if(ih.test(b))return parseFloat(b);a.$$parserName="number"});a.$formatters.push(function(b){if(!a.$isEmpty(b)){if(!W(b))throw ob("numfmt",b);b=b.toString()}return b})}function na(a){w(a)&&!W(a)&&(a=parseFloat(a));return X(a)?void 0:a}function Jc(a){var b=a.toString(),
d=b.indexOf(".");return-1===d?-1<a&&1>a&&(a=/e-(\d+)$/.exec(b))?Number(a[1]):0:b.length-d-1}function ee(a,b,d){a=Number(a);var c=(a|0)!==a,e=(b|0)!==b,f=(d|0)!==d;if(c||e||f){var g=c?Jc(a):0,k=e?Jc(b):0,h=f?Jc(d):0,g=Math.max(g,k,h),g=Math.pow(10,g);a*=g;b*=g;d*=g;c&&(a=Math.round(a));e&&(b=Math.round(b));f&&(d=Math.round(d))}return 0===(a-b)%d}function fe(a,b,d,c,e){if(w(c)){a=a(c);if(!a.constant)throw ob("constexpr",d,c);return a(b)}return e}function Kc(a,b){function d(a,b){if(!a||!a.length)return[];
if(!b||!b.length)return a;var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],m=0;m<b.length;m++)if(e===b[m])continue a;c.push(e)}return c}function c(a){if(!a)return a;var b=a;H(a)?b=a.map(c).join(" "):D(a)?b=Object.keys(a).filter(function(b){return a[b]}).join(" "):A(a)||(b=a+"");return b}a="ngClass"+a;var e;return["$parse",function(f){return{restrict:"AC",link:function(g,k,h){function l(a,b){var c=[];r(a,function(a){if(0<b||p[a])p[a]=(p[a]||0)+b,p[a]===+(0<b)&&c.push(a)});return c.join(" ")}function m(a){if(a===
b){var c=s,c=l(c&&c.split(" "),1);h.$addClass(c)}else c=s,c=l(c&&c.split(" "),-1),h.$removeClass(c);n=a}var p=k.data("$classCounts"),n=!0,s;p||(p=T(),k.data("$classCounts",p));"ngClass"!==a&&(e||(e=f("$index",function(a){return a&1})),g.$watch(e,m));g.$watch(f(h[a],c),function(a){if(n===b){var c=s&&s.split(" "),e=a&&a.split(" "),f=d(c,e),c=d(e,c),f=l(f,-1),c=l(c,1);h.$addClass(c);h.$removeClass(f)}s=a})}}}]}function qd(a,b,d,c,e,f){return{restrict:"A",compile:function(g,k){var h=a(k[c]);return function(a,
c){c.on(e,function(c){var e=function(){h(a,{$event:c})};if(b.$$phase)if(f)a.$evalAsync(e);else try{e()}catch(g){d(g)}else a.$apply(e)})}}}}function Rb(a,b,d,c,e,f,g,k,h){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=void 0;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=
void 0;this.$name=h(d.name||"",!1)(a);this.$$parentForm=lb;this.$options=Sb;this.$$updateEvents="";this.$$updateEventHandler=this.$$updateEventHandler.bind(this);this.$$parsedNgModel=e(d.ngModel);this.$$parsedNgModelAssign=this.$$parsedNgModel.assign;this.$$ngModelGet=this.$$parsedNgModel;this.$$ngModelSet=this.$$parsedNgModelAssign;this.$$pendingDebounce=null;this.$$parserValid=void 0;this.$$parserName="parse";this.$$currentValidationRunId=0;this.$$scope=a;this.$$rootScope=a.$root;this.$$attr=d;
this.$$element=c;this.$$animate=f;this.$$timeout=g;this.$$parse=e;this.$$q=k;this.$$exceptionHandler=b;Zd(this);jh(this)}function jh(a){a.$$scope.$watch(function(b){b=a.$$ngModelGet(b);b===a.$modelValue||a.$modelValue!==a.$modelValue&&b!==b||a.$$setModelValue(b);return b})}function Lc(a){this.$$options=a}function ge(a,b){r(b,function(b,c){w(a[c])||(a[c]=b)})}function Oa(a,b){a.prop("selected",b);a.attr("selected",b)}function he(a,b,d){if(a){A(a)&&(a=new RegExp("^"+a+"$"));if(!a.test)throw F("ngPattern")("noregexp",
b,a,za(d));return a}}function Tb(a){a=fa(a);return X(a)?-1:a}var Wb={objectMaxDepth:5,urlErrorParamsEnabled:!0},ie=/^\/(.+)\/([a-z]*)$/,ta=Object.prototype.hasOwnProperty,K=function(a){return A(a)?a.toLowerCase():a},ub=function(a){return A(a)?a.toUpperCase():a},Ca,x,rb,Ha=[].slice,Fg=[].splice,kh=[].push,la=Object.prototype.toString,Pc=Object.getPrototypeOf,pa=F("ng"),ca=C.angular||(C.angular={}),kc,pb=0;Ca=C.document.documentMode;var X=Number.isNaN||function(a){return a!==a};E.$inject=[];Ta.$inject=
[];var ve=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/,U=function(a){return A(a)?a.trim():a},Md=function(a){return a.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Aa=function(){if(!w(Aa.rules)){var a=C.document.querySelector("[ng-csp]")||C.document.querySelector("[data-ng-csp]");if(a){var b=a.getAttribute("ng-csp")||a.getAttribute("data-ng-csp");Aa.rules={noUnsafeEval:!b||-1!==b.indexOf("no-unsafe-eval"),noInlineStyle:!b||-1!==
b.indexOf("no-inline-style")}}else{a=Aa;try{new Function(""),b=!1}catch(d){b=!0}a.rules={noUnsafeEval:b,noInlineStyle:!1}}}return Aa.rules},qb=function(){if(w(qb.name_))return qb.name_;var a,b,d=Qa.length,c,e;for(b=0;b<d;++b)if(c=Qa[b],a=C.document.querySelector("["+c.replace(":","\\:")+"jq]")){e=a.getAttribute(c+"jq");break}return qb.name_=e},xe=/:/g,Qa=["ng-","data-ng-","ng:","x-ng-"],Be=function(a){var b=a.currentScript;if(!b)return!0;if(!(b instanceof C.HTMLScriptElement||b instanceof C.SVGScriptElement))return!1;
b=b.attributes;return[b.getNamedItem("src"),b.getNamedItem("href"),b.getNamedItem("xlink:href")].every(function(b){if(!b)return!0;if(!b.value)return!1;var c=a.createElement("a");c.href=b.value;if(a.location.origin===c.origin)return!0;switch(c.protocol){case "http:":case "https:":case "ftp:":case "blob:":case "file:":case "data:":return!0;default:return!1}})}(C.document),Ee=/[A-Z]/g,Wc=!1,Pa=3,Ke={full:"1.7.8",major:1,minor:7,dot:8,codeName:"enthusiastic-oblation"};Y.expando="ng339";var Ka=Y.cache=
{},pg=1;Y._data=function(a){return this.cache[a[this.expando]]||{}};var lg=/-([a-z])/g,lh=/^-ms-/,Ab={mouseleave:"mouseout",mouseenter:"mouseover"},nc=F("jqLite"),og=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,mc=/<|&#?\w+;/,mg=/<([\w:-]+)/,ng=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,oa={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>",
"</tr></tbody></table>"],_default:[0,"",""]};oa.optgroup=oa.option;oa.tbody=oa.tfoot=oa.colgroup=oa.caption=oa.thead;oa.th=oa.td;var ug=C.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)},Wa=Y.prototype={ready:fd,toString:function(){var a=[];r(this,function(b){a.push(""+b)});return"["+a.join(", ")+"]"},eq:function(a){return 0<=a?x(this[a]):x(this[this.length+a])},length:0,push:kh,sort:[].sort,splice:[].splice},Gb={};r("multiple selected checked disabled readOnly required open".split(" "),
function(a){Gb[K(a)]=a});var md={};r("input select option textarea button form details".split(" "),function(a){md[a]=!0});var td={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern",ngStep:"step"};r({data:rc,removeData:qc,hasData:function(a){for(var b in Ka[a.ng339])return!0;return!1},cleanData:function(a){for(var b=0,d=a.length;b<d;b++)qc(a[b]),id(a[b])}},function(a,b){Y[b]=a});r({data:rc,inheritedData:Eb,scope:function(a){return x.data(a,"$scope")||Eb(a.parentNode||
a,["$isolateScope","$scope"])},isolateScope:function(a){return x.data(a,"$isolateScope")||x.data(a,"$isolateScopeNoTemplate")},controller:jd,injector:function(a){return Eb(a,"$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:Bb,css:function(a,b,d){b=xb(b.replace(lh,"ms-"));if(w(d))a.style[b]=d;else return a.style[b]},attr:function(a,b,d){var c=a.nodeType;if(c!==Pa&&2!==c&&8!==c&&a.getAttribute){var c=K(b),e=Gb[c];if(w(d))null===d||!1===d&&e?a.removeAttribute(b):a.setAttribute(b,
e?c:d);else return a=a.getAttribute(b),e&&null!==a&&(a=c),null===a?void 0:a}},prop:function(a,b,d){if(w(d))a[b]=d;else return a[b]},text:function(){function a(a,d){if(z(d)){var c=a.nodeType;return 1===c||c===Pa?a.textContent:""}a.textContent=d}a.$dv="";return a}(),val:function(a,b){if(z(b)){if(a.multiple&&"select"===ua(a)){var d=[];r(a.options,function(a){a.selected&&d.push(a.value||a.text)});return d}return a.value}a.value=b},html:function(a,b){if(z(b))return a.innerHTML;yb(a,!0);a.innerHTML=b},
empty:kd},function(a,b){Y.prototype[b]=function(b,c){var e,f,g=this.length;if(a!==kd&&z(2===a.length&&a!==Bb&&a!==jd?b:c)){if(D(b)){for(e=0;e<g;e++)if(a===rc)a(this[e],b);else for(f in b)a(this[e],f,b[f]);return this}e=a.$dv;g=z(e)?Math.min(g,1):g;for(f=0;f<g;f++){var k=a(this[f],b,c);e=e?e+k:k}return e}for(e=0;e<g;e++)a(this[e],b,c);return this}});r({removeData:qc,on:function(a,b,d,c){if(w(c))throw nc("onargs");if(lc(a)){c=zb(a,!0);var e=c.events,f=c.handle;f||(f=c.handle=rg(a,e));c=0<=b.indexOf(" ")?
b.split(" "):[b];for(var g=c.length,k=function(b,c,g){var k=e[b];k||(k=e[b]=[],k.specialHandlerWrapper=c,"$destroy"===b||g||a.addEventListener(b,f));k.push(d)};g--;)b=c[g],Ab[b]?(k(Ab[b],tg),k(b,void 0,!0)):k(b)}},off:id,one:function(a,b,d){a=x(a);a.on(b,function e(){a.off(b,d);a.off(b,e)});a.on(b,d)},replaceWith:function(a,b){var d,c=a.parentNode;yb(a);r(new Y(b),function(b){d?c.insertBefore(b,d.nextSibling):c.replaceChild(b,a);d=b})},children:function(a){var b=[];r(a.childNodes,function(a){1===
a.nodeType&&b.push(a)});return b},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,b){var d=a.nodeType;if(1===d||11===d){b=new Y(b);for(var d=0,c=b.length;d<c;d++)a.appendChild(b[d])}},prepend:function(a,b){if(1===a.nodeType){var d=a.firstChild;r(new Y(b),function(b){a.insertBefore(b,d)})}},wrap:function(a,b){var d=x(b).eq(0).clone()[0],c=a.parentNode;c&&c.replaceChild(d,a);d.appendChild(a)},remove:Fb,detach:function(a){Fb(a,!0)},after:function(a,b){var d=a,c=a.parentNode;
if(c){b=new Y(b);for(var e=0,f=b.length;e<f;e++){var g=b[e];c.insertBefore(g,d.nextSibling);d=g}}},addClass:Db,removeClass:Cb,toggleClass:function(a,b,d){b&&r(b.split(" "),function(b){var e=d;z(e)&&(e=!Bb(a,b));(e?Db:Cb)(a,b)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,b){return a.getElementsByTagName?a.getElementsByTagName(b):[]},clone:pc,triggerHandler:function(a,b,d){var c,e,f=b.type||b,g=zb(a);if(g=(g=g&&g.events)&&
g[f])c={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:E,type:f,target:a},b.type&&(c=S(c,b)),b=ja(g),e=d?[c].concat(d):[c],r(b,function(b){c.isImmediatePropagationStopped()||b.apply(a,e)})}},function(a,b){Y.prototype[b]=function(b,c,e){for(var f,g=0,k=this.length;g<
k;g++)z(f)?(f=a(this[g],b,c,e),w(f)&&(f=x(f))):oc(f,a(this[g],b,c,e));return w(f)?f:this}});Y.prototype.bind=Y.prototype.on;Y.prototype.unbind=Y.prototype.off;var mh=Object.create(null);nd.prototype={_idx:function(a){a!==this._lastKey&&(this._lastKey=a,this._lastIndex=this._keys.indexOf(a));return this._lastIndex},_transformKey:function(a){return X(a)?mh:a},get:function(a){a=this._transformKey(a);a=this._idx(a);if(-1!==a)return this._values[a]},has:function(a){a=this._transformKey(a);return-1!==this._idx(a)},
set:function(a,b){a=this._transformKey(a);var d=this._idx(a);-1===d&&(d=this._lastIndex=this._keys.length);this._keys[d]=a;this._values[d]=b},delete:function(a){a=this._transformKey(a);a=this._idx(a);if(-1===a)return!1;this._keys.splice(a,1);this._values.splice(a,1);this._lastKey=NaN;this._lastIndex=-1;return!0}};var Hb=nd,jg=[function(){this.$get=[function(){return Hb}]}],wg=/^([^(]+?)=>/,xg=/^[^(]*\(\s*([^)]*)\)/m,nh=/,/,oh=/^\s*(_?)(\S+?)\1\s*$/,vg=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ba=F("$injector");
fb.$$annotate=function(a,b,d){var c;if("function"===typeof a){if(!(c=a.$inject)){c=[];if(a.length){if(b)throw A(d)&&d||(d=a.name||yg(a)),Ba("strictdi",d);b=od(a);r(b[1].split(nh),function(a){a.replace(oh,function(a,b,d){c.push(d)})})}a.$inject=c}}else H(a)?(b=a.length-1,sb(a[b],"fn"),c=a.slice(0,b)):sb(a,"fn",!0);return c};var je=F("$animate"),zf=function(){this.$get=E},Af=function(){var a=new Hb,b=[];this.$get=["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;b&&(b=A(b)?b.split(" "):
H(b)?b:[],r(b,function(b){b&&(d=!0,a[b]=c)}));return d}function f(){r(b,function(b){var c=a.get(b);if(c){var d=zg(b.attr("class")),e="",f="";r(c,function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)});r(b,function(a){e&&Db(a,e);f&&Cb(a,f)});a.delete(b)}});b.length=0}return{enabled:E,on:E,off:E,pin:E,push:function(g,k,h,l){l&&l();h=h||{};h.from&&g.css(h.from);h.to&&g.css(h.to);if(h.addClass||h.removeClass)if(k=h.addClass,l=h.removeClass,h=a.get(g)||{},k=e(h,k,!0),l=e(h,l,!1),
k||l)a.set(g,h),b.push(g),1===b.length&&c.$$postDigest(f);g=new d;g.complete();return g}}}]},xf=["$provide",function(a){var b=this,d=null,c=null;this.$$registeredAnimations=Object.create(null);this.register=function(c,d){if(c&&"."!==c.charAt(0))throw je("notcsel",c);var g=c+"-animation";b.$$registeredAnimations[c.substr(1)]=g;a.factory(g,d)};this.customFilter=function(a){1===arguments.length&&(c=B(a)?a:null);return c};this.classNameFilter=function(a){if(1===arguments.length&&(d=a instanceof RegExp?
a:null)&&/[(\s|\/)]ng-animate[(\s|\/)]/.test(d.toString()))throw d=null,je("nongcls","ng-animate");return d};this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var e;a:{for(e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){e=f;break a}}e=void 0}!e||e.parentNode||e.previousElementSibling||(d=null)}d?d.after(a):c.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.cancel&&a.cancel()},enter:function(c,d,h,l){d=d&&x(d);h=h&&x(h);d=d||h.parent();b(c,d,h);return a.push(c,
"enter",ra(l))},move:function(c,d,h,l){d=d&&x(d);h=h&&x(h);d=d||h.parent();b(c,d,h);return a.push(c,"move",ra(l))},leave:function(b,c){return a.push(b,"leave",ra(c),function(){b.remove()})},addClass:function(b,c,d){d=ra(d);d.addClass=hb(d.addclass,c);return a.push(b,"addClass",d)},removeClass:function(b,c,d){d=ra(d);d.removeClass=hb(d.removeClass,c);return a.push(b,"removeClass",d)},setClass:function(b,c,d,f){f=ra(f);f.addClass=hb(f.addClass,c);f.removeClass=hb(f.removeClass,d);return a.push(b,"setClass",
f)},animate:function(b,c,d,f,m){m=ra(m);m.from=m.from?S(m.from,c):c;m.to=m.to?S(m.to,d):d;m.tempClasses=hb(m.tempClasses,f||"ng-inline-animate");return a.push(b,"animate",m)}}}]}],Cf=function(){this.$get=["$$rAF",function(a){function b(b){d.push(b);1<d.length||a(function(){for(var a=0;a<d.length;a++)d[a]();d=[]})}var d=[];return function(){var a=!1;b(function(){a=!0});return function(d){a?d():b(d)}}}]},Bf=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$$isDocumentHidden","$timeout",function(a,
b,d,c,e){function f(a){this.setHost(a);var b=d();this._doneCallbacks=[];this._tick=function(a){c()?e(a,0,!1):b(a)};this._state=0}f.chain=function(a,b){function c(){if(d===a.length)b(!0);else a[d](function(a){!1===a?b(!1):(d++,c())})}var d=0;c()};f.all=function(a,b){function c(f){e=e&&f;++d===a.length&&b(e)}var d=0,e=!0;r(a,function(a){a.done(c)})};f.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?a():this._doneCallbacks.push(a)},progress:E,getPromise:function(){if(!this.promise){var b=
this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},"catch":function(a){return this.getPromise()["catch"](a)},"finally":function(a){return this.getPromise()["finally"](a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end();this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel();this._resolve(!1)},
complete:function(a){var b=this;0===b._state&&(b._state=1,b._tick(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(r(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=0,this._state=2)}};return f}]},yf=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(a,b,d){return function(b,e){function f(){a(function(){g.addClass&&(b.addClass(g.addClass),g.addClass=null);g.removeClass&&(b.removeClass(g.removeClass),g.removeClass=null);g.to&&(b.css(g.to),g.to=null);k||
h.complete();k=!0});return h}var g=e||{};g.$$prepared||(g=Ia(g));g.cleanupStyles&&(g.from=g.to=null);g.from&&(b.css(g.from),g.from=null);var k,h=new d;return{start:f,end:f}}}]},$=F("$compile"),tc=new function(){};Xc.$inject=["$provide","$$sanitizeUriProvider"];Jb.prototype.isFirstChange=function(){return this.previousValue===tc};var pd=/^((?:x|data)[:\-_])/i,Eg=/[:\-_]+(.)/g,vd=F("$controller"),ud=/^(\S+)(\s+as\s+([\w$]+))?$/,Jf=function(){this.$get=["$document",function(a){return function(b){b?!b.nodeType&&
b instanceof x&&(b=b[0]):b=a[0].body;return b.offsetWidth+1}}]},wd="application/json",wc={"Content-Type":wd+";charset=utf-8"},Hg=/^\[|^\{(?!\{)/,Ig={"[":/]$/,"{":/}$/},Gg=/^\)]\}',?\n/,Kb=F("$http"),Ma=ca.$interpolateMinErr=F("$interpolate");Ma.throwNoconcat=function(a){throw Ma("noconcat",a);};Ma.interr=function(a,b){return Ma("interr",a,b.toString())};var Lg=F("$interval"),Sf=function(){this.$get=function(){function a(a){var b=function(a){b.data=a;b.called=!0};b.id=a;return b}var b=ca.callbacks,
d={};return{createCallback:function(c){c="_"+(b.$$counter++).toString(36);var e="angular.callbacks."+c,f=a(c);d[e]=b[c]=f;return e},wasCalled:function(a){return d[a].called},getResponse:function(a){return d[a].data},removeCallback:function(a){delete b[d[a].id];delete d[a]}}}},ph=/^([^?#]*)(\?([^#]*))?(#(.*))?$/,Mg={http:80,https:443,ftp:21},jb=F("$location"),Ng=/^\s*[\\/]{2,}/,qh={$$absUrl:"",$$html5:!1,$$replace:!1,$$compose:function(){for(var a=this.$$path,b=this.$$hash,d=ye(this.$$search),b=b?
"#"+hc(b):"",a=a.split("/"),c=a.length;c--;)a[c]=hc(a[c].replace(/%2F/g,"/"));this.$$url=a.join("/")+(d?"?"+d:"")+b;this.$$absUrl=this.$$normalizeUrl(this.$$url);this.$$urlUpdatedByLocation=!0},absUrl:Lb("$$absUrl"),url:function(a){if(z(a))return this.$$url;var b=ph.exec(a);(b[1]||""===a)&&this.path(decodeURIComponent(b[1]));(b[2]||b[1]||""===a)&&this.search(b[3]||"");this.hash(b[5]||"");return this},protocol:Lb("$$protocol"),host:Lb("$$host"),port:Lb("$$port"),path:Dd("$$path",function(a){a=null!==
a?a.toString():"";return"/"===a.charAt(0)?a:"/"+a}),search:function(a,b){switch(arguments.length){case 0:return this.$$search;case 1:if(A(a)||W(a))a=a.toString(),this.$$search=gc(a);else if(D(a))a=Ia(a,{}),r(a,function(b,c){null==b&&delete a[c]}),this.$$search=a;else throw jb("isrcharg");break;default:z(b)||null===b?delete this.$$search[a]:this.$$search[a]=b}this.$$compose();return this},hash:Dd("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};
r([Cd,zc,yc],function(a){a.prototype=Object.create(qh);a.prototype.state=function(b){if(!arguments.length)return this.$$state;if(a!==yc||!this.$$html5)throw jb("nostate");this.$$state=z(b)?null:b;this.$$urlUpdatedByLocation=!0;return this}});var Ya=F("$parse"),Rg={}.constructor.prototype.valueOf,Ub=T();r("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Ub[a]=!0});var rh={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Nb=function(a){this.options=a};Nb.prototype={constructor:Nb,
lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;else{var b=a+this.peek(),d=b+this.peek(2),c=Ub[b],e=Ub[d];Ub[a]||
c||e?(a=e?d:c?b:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?
this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):
(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var d=a.charCodeAt(0),c=b.charCodeAt(0);return 55296<=d&&56319>=d&&56320<=c&&57343>=c?a+b:a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=w(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw Ya("lexerr",a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index<
this.text.length;){var d=K(this.text.charAt(this.index));if("."===d||this.isNumber(d))a+=d;else{var c=this.peek();if("e"===d&&this.isExpOperator(c))a+=d;else if(this.isExpOperator(d)&&c&&this.isNumber(c)&&"e"===a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||c&&this.isNumber(c)||"e"!==a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<
this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++;for(var d="",c=a,e=!1;this.index<this.text.length;){var f=this.text.charAt(this.index),c=c+f;if(e)"u"===f?(e=this.text.substring(this.index+1,this.index+5),e.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+e+"]"),this.index+=4,d+=String.fromCharCode(parseInt(e,
16))):d+=rh[f]||f,e=!1;else if("\\"===f)e=!0;else{if(f===a){this.index++;this.tokens.push({index:b,text:c,constant:!0,value:d});return}d+=f}this.index++}this.throwError("Unterminated quote",b)}};var q=function(a,b){this.lexer=a;this.options=b};q.Program="Program";q.ExpressionStatement="ExpressionStatement";q.AssignmentExpression="AssignmentExpression";q.ConditionalExpression="ConditionalExpression";q.LogicalExpression="LogicalExpression";q.BinaryExpression="BinaryExpression";q.UnaryExpression="UnaryExpression";
q.CallExpression="CallExpression";q.MemberExpression="MemberExpression";q.Identifier="Identifier";q.Literal="Literal";q.ArrayExpression="ArrayExpression";q.Property="Property";q.ObjectExpression="ObjectExpression";q.ThisExpression="ThisExpression";q.LocalsExpression="LocalsExpression";q.NGValueParameter="NGValueParameter";q.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);a=this.program();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);return a},
program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:q.Program,body:a}},expressionStatement:function(){return{type:q.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary();if(this.expect("=")){if(!Hd(a))throw Ya("lval");
a={type:q.AssignmentExpression,left:a,right:this.assignment(),operator:"="}}return a},ternary:function(){var a=this.logicalOR(),b,d;return this.expect("?")&&(b=this.expression(),this.consume(":"))?(d=this.expression(),{type:q.ConditionalExpression,test:a,alternate:b,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:q.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=this.equality();this.expect("&&");)a=
{type:q.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),b;b=this.expect("==","!=","===","!==");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),b;b=this.expect("<",">","<=",">=");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),b;b=this.expect("+","-");)a={type:q.BinaryExpression,
operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),b;b=this.expect("*","/","%");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:q.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?
a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=Ia(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:q.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:q.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):
"["===b.text?(a={type:q.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:q.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:q.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.filterChain());while(this.expect(","))
}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:q.Identifier,name:a.text}},constant:function(){return{type:q.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:q.ArrayExpression,elements:a}},object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;
b={type:q.Property,kind:"init"};this.peek().constant?(b.key=this.constant(),b.computed=!1,this.consume(":"),b.value=this.expression()):this.peek().identifier?(b.key=this.identifier(),b.computed=!1,this.peek(":")?(this.consume(":"),b.value=this.expression()):b.value=b.key):this.peek("[")?(this.consume("["),b.key=this.expression(),this.consume("]"),b.computed=!0,this.consume(":"),b.value=this.expression()):this.throwError("invalid key",this.peek());a.push(b)}while(this.expect(","))}this.consume("}");
return{type:q.ObjectExpression,properties:a}},throwError:function(a,b){throw Ya("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index));},consume:function(a){if(0===this.tokens.length)throw Ya("ueoe",this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw Ya("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,
e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?(this.tokens.shift(),a):!1},selfReferential:{"this":{type:q.ThisExpression},$locals:{type:q.LocalsExpression}}};var Fd=2;Jd.prototype={compile:function(a){var b=this;this.state={nextId:0,filters:{},fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};Z(a,b.$filter);var d="",c;this.stage="assign";if(c=Id(a))this.state.computing=
"assign",d=this.nextId(),this.recurse(c,d),this.return_(d),d="fn.assign="+this.generateFunction("assign","s,v,l");c=Gd(a.body);b.stage="inputs";r(c,function(a,c){var d="fn"+c;b.state[d]={vars:[],body:[],own:{}};b.state.computing=d;var k=b.nextId();b.recurse(a,k);b.return_(k);b.state.inputs.push({name:d,isPure:a.isPure});a.watchId=c});this.state.computing="fn";this.stage="main";this.recurse(a);a='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+
d+this.watchFns()+"return fn;";a=(new Function("$filter","getStringValue","ifDefined","plus",a))(this.$filter,Og,Pg,Ed);this.state=this.stage=void 0;return a},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;r(b,function(b){a.push("var "+b.name+"="+d.generateFunction(b.name,"s"));b.isPure&&a.push(b.name,".isPure="+JSON.stringify(b.isPure)+";")});b.length&&a.push("fn.inputs=["+b.map(function(a){return a.name}).join(",")+"];");return a.join("")},generateFunction:function(a,
b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;r(this.state.filters,function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,k,h=this,l,m,p;c=c||E;if(!f&&w(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,
this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case q.Program:r(a.body,function(b,c){h.recurse(b.expression,void 0,void 0,function(a){k=a});c!==a.body.length-1?h.current().body.push(k,";"):h.return_(k)});break;case q.Literal:m=this.escape(a.value);this.assign(b,m);c(b||m);break;case q.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){k=a});m=a.operator+"("+this.ifDefined(k,0)+")";this.assign(b,m);c(m);break;case q.BinaryExpression:this.recurse(a.left,
void 0,void 0,function(a){g=a});this.recurse(a.right,void 0,void 0,function(a){k=a});m="+"===a.operator?this.plus(g,k):"-"===a.operator?this.ifDefined(g,0)+a.operator+this.ifDefined(k,0):"("+g+")"+a.operator+"("+k+")";this.assign(b,m);c(m);break;case q.LogicalExpression:b=b||this.nextId();h.recurse(a.left,b);h.if_("&&"===a.operator?b:h.not(b),h.lazyRecurse(a.right,b));c(b);break;case q.ConditionalExpression:b=b||this.nextId();h.recurse(a.test,b);h.if_(b,h.lazyRecurse(a.alternate,b),h.lazyRecurse(a.consequent,
b));c(b);break;case q.Identifier:b=b||this.nextId();d&&(d.context="inputs"===h.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name);h.if_("inputs"===h.stage||h.not(h.getHasOwnProperty("l",a.name)),function(){h.if_("inputs"===h.stage||"s",function(){e&&1!==e&&h.if_(h.isNull(h.nonComputedMember("s",a.name)),h.lazyAssign(h.nonComputedMember("s",a.name),"{}"));h.assign(b,h.nonComputedMember("s",a.name))})},b&&h.lazyAssign(b,h.nonComputedMember("l",
a.name)));c(b);break;case q.MemberExpression:g=d&&(d.context=this.nextId())||this.nextId();b=b||this.nextId();h.recurse(a.object,g,void 0,function(){h.if_(h.notNull(g),function(){a.computed?(k=h.nextId(),h.recurse(a.property,k),h.getStringValue(k),e&&1!==e&&h.if_(h.not(h.computedMember(g,k)),h.lazyAssign(h.computedMember(g,k),"{}")),m=h.computedMember(g,k),h.assign(b,m),d&&(d.computed=!0,d.name=k)):(e&&1!==e&&h.if_(h.isNull(h.nonComputedMember(g,a.property.name)),h.lazyAssign(h.nonComputedMember(g,
a.property.name),"{}")),m=h.nonComputedMember(g,a.property.name),h.assign(b,m),d&&(d.computed=!1,d.name=a.property.name))},function(){h.assign(b,"undefined")});c(b)},!!e);break;case q.CallExpression:b=b||this.nextId();a.filter?(k=h.filter(a.callee.name),l=[],r(a.arguments,function(a){var b=h.nextId();h.recurse(a,b);l.push(b)}),m=k+"("+l.join(",")+")",h.assign(b,m),c(b)):(k=h.nextId(),g={},l=[],h.recurse(a.callee,k,g,function(){h.if_(h.notNull(k),function(){r(a.arguments,function(b){h.recurse(b,a.constant?
void 0:h.nextId(),void 0,function(a){l.push(a)})});m=g.name?h.member(g.context,g.name,g.computed)+"("+l.join(",")+")":k+"("+l.join(",")+")";h.assign(b,m)},function(){h.assign(b,"undefined")});c(b)}));break;case q.AssignmentExpression:k=this.nextId();g={};this.recurse(a.left,void 0,g,function(){h.if_(h.notNull(g.context),function(){h.recurse(a.right,k);m=h.member(g.context,g.name,g.computed)+a.operator+k;h.assign(b,m);c(b||m)})},1);break;case q.ArrayExpression:l=[];r(a.elements,function(b){h.recurse(b,
a.constant?void 0:h.nextId(),void 0,function(a){l.push(a)})});m="["+l.join(",")+"]";this.assign(b,m);c(b||m);break;case q.ObjectExpression:l=[];p=!1;r(a.properties,function(a){a.computed&&(p=!0)});p?(b=b||this.nextId(),this.assign(b,"{}"),r(a.properties,function(a){a.computed?(g=h.nextId(),h.recurse(a.key,g)):g=a.key.type===q.Identifier?a.key.name:""+a.key.value;k=h.nextId();h.recurse(a.value,k);h.assign(h.member(b,g,a.computed),k)})):(r(a.properties,function(b){h.recurse(b.value,a.constant?void 0:
h.nextId(),void 0,function(a){l.push(h.escape(b.key.type===q.Identifier?b.key.name:""+b.key.value)+":"+a)})}),m="{"+l.join(",")+"}",this.assign(b,m));c(b||m);break;case q.ThisExpression:this.assign(b,"s");c(b||"s");break;case q.LocalsExpression:this.assign(b,"l");c(b||"l");break;case q.NGValueParameter:this.assign(b,"v"),c(b||"v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")"));return c[d]},assign:function(a,
b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){");b();c.push("}");d&&(c.push("else{"),d(),c.push("}"))}},
not:function(a){return"!("+a+")"},isNull:function(a){return a+"==null"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){var d=/[^$_a-zA-Z0-9]/g;return/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},lazyRecurse:function(a,b,d,c,e,f){var g=
this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(A(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(W(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw Ya("esc");},nextId:function(a,
b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};Kd.prototype={compile:function(a){var b=this;Z(a,b.$filter);var d,c;if(d=Id(a))c=this.recurse(d);d=Gd(a.body);var e;d&&(e=[],r(d,function(a,c){var d=b.recurse(a);d.isPure=a.isPure;a.input=d;e.push(d);a.watchId=c}));var f=[];r(a.body,function(a){f.push(b.recurse(a.expression))});a=0===a.body.length?E:1===a.body.length?f[0]:function(a,b){var c;r(f,function(d){c=
d(a,b)});return c};c&&(a.assign=function(a,b,d){return c(a,d,b)});e&&(a.inputs=e);return a},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case q.Literal:return this.value(a.value,b);case q.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case q.BinaryExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case q.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),
this["binary"+a.operator](c,e,b);case q.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case q.Identifier:return f.identifier(a.name,b,d);case q.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d):this.nonComputedMember(c,e,b,d);case q.CallExpression:return g=[],r(a.arguments,function(a){g.push(f.recurse(a))}),
a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var p=[],n=0;n<g.length;++n)p.push(g[n](a,c,d,f));a=e.apply(void 0,p,f);return b?{context:void 0,name:void 0,value:a}:a}:function(a,c,d,f){var p=e(a,c,d,f),n;if(null!=p.value){n=[];for(var s=0;s<g.length;++s)n.push(g[s](a,c,d,f));n=p.value.apply(p.context,n)}return b?{value:n}:n};case q.AssignmentExpression:return c=this.recurse(a.left,!0,1),e=this.recurse(a.right),function(a,d,f,g){var p=
c(a,d,f,g);a=e(a,d,f,g);p.context[p.name]=a;return b?{value:a}:a};case q.ArrayExpression:return g=[],r(a.elements,function(a){g.push(f.recurse(a))}),function(a,c,d,e){for(var f=[],n=0;n<g.length;++n)f.push(g[n](a,c,d,e));return b?{value:f}:f};case q.ObjectExpression:return g=[],r(a.properties,function(a){a.computed?g.push({key:f.recurse(a.key),computed:!0,value:f.recurse(a.value)}):g.push({key:a.key.type===q.Identifier?a.key.name:""+a.key.value,computed:!1,value:f.recurse(a.value)})}),function(a,
c,d,e){for(var f={},n=0;n<g.length;++n)g[n].computed?f[g[n].key(a,c,d,e)]=g[n].value(a,c,d,e):f[g[n].key]=g[n].value(a,c,d,e);return b?{value:f}:f};case q.ThisExpression:return function(a){return b?{value:a}:a};case q.LocalsExpression:return function(a,c){return b?{value:c}:c};case q.NGValueParameter:return function(a,c,d){return b?{value:d}:d}}},"unary+":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=w(d)?+d:0;return b?{value:d}:d}},"unary-":function(a,b){return function(d,c,e,f){d=a(d,c,
e,f);d=w(d)?-d:-0;return b?{value:d}:d}},"unary!":function(a,b){return function(d,c,e,f){d=!a(d,c,e,f);return b?{value:d}:d}},"binary+":function(a,b,d){return function(c,e,f,g){var k=a(c,e,f,g);c=b(c,e,f,g);k=Ed(k,c);return d?{value:k}:k}},"binary-":function(a,b,d){return function(c,e,f,g){var k=a(c,e,f,g);c=b(c,e,f,g);k=(w(k)?k:0)-(w(c)?c:0);return d?{value:k}:k}},"binary*":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)*b(c,e,f,g);return d?{value:c}:c}},"binary/":function(a,b,d){return function(c,
e,f,g){c=a(c,e,f,g)/b(c,e,f,g);return d?{value:c}:c}},"binary%":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)%b(c,e,f,g);return d?{value:c}:c}},"binary===":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)===b(c,e,f,g);return d?{value:c}:c}},"binary!==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)!==b(c,e,f,g);return d?{value:c}:c}},"binary==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)==b(c,e,f,g);return d?{value:c}:c}},"binary!=":function(a,b,d){return function(c,
e,f,g){c=a(c,e,f,g)!=b(c,e,f,g);return d?{value:c}:c}},"binary<":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<b(c,e,f,g);return d?{value:c}:c}},"binary>":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=
a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)||b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,k){e=a(e,f,g,k)?b(e,f,g,k):d(e,f,g,k);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:void 0,name:void 0,value:a}:a}},identifier:function(a,b,d){return function(c,e,f,g){c=e&&a in e?e:c;d&&1!==d&&c&&null==c[a]&&(c[a]={});e=c?c[a]:void 0;return b?{context:c,name:a,value:e}:
e}},computedMember:function(a,b,d,c){return function(e,f,g,k){var h=a(e,f,g,k),l,m;null!=h&&(l=b(e,f,g,k),l+="",c&&1!==c&&h&&!h[l]&&(h[l]={}),m=h[l]);return d?{context:h,name:l,value:m}:m}},nonComputedMember:function(a,b,d,c){return function(e,f,g,k){e=a(e,f,g,k);c&&1!==c&&e&&null==e[b]&&(e[b]={});f=null!=e?e[b]:void 0;return d?{context:e,name:b,value:f}:f}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};Mb.prototype={constructor:Mb,parse:function(a){a=this.getAst(a);var b=
this.astCompiler.compile(a.ast),d=a.ast;b.literal=0===d.body.length||1===d.body.length&&(d.body[0].expression.type===q.Literal||d.body[0].expression.type===q.ArrayExpression||d.body[0].expression.type===q.ObjectExpression);b.constant=a.ast.constant;b.oneTime=a.oneTime;return b},getAst:function(a){var b=!1;a=a.trim();":"===a.charAt(0)&&":"===a.charAt(1)&&(b=!0,a=a.substring(2));return{ast:this.ast.ast(a),oneTime:b}}};var Ea=F("$sce"),V={HTML:"html",CSS:"css",MEDIA_URL:"mediaUrl",URL:"url",RESOURCE_URL:"resourceUrl",
JS:"js"},Cc=/_([a-z])/g,Ug=F("$templateRequest"),Vg=F("$timeout"),aa=C.document.createElement("a"),Od=ga(C.location.href),Na;aa.href="http://[::1]";var Wg="[::1]"===aa.hostname;Pd.$inject=["$document"];dd.$inject=["$provide"];var Wd=22,Vd=".",Ec="0";Qd.$inject=["$locale"];Sd.$inject=["$locale"];var gh={yyyy:ea("FullYear",4,0,!1,!0),yy:ea("FullYear",2,0,!0,!0),y:ea("FullYear",1,0,!1,!0),MMMM:kb("Month"),MMM:kb("Month",!0),MM:ea("Month",2,1),M:ea("Month",1,1),LLLL:kb("Month",!1,!0),dd:ea("Date",2),
d:ea("Date",1),HH:ea("Hours",2),H:ea("Hours",1),hh:ea("Hours",2,-12),h:ea("Hours",1,-12),mm:ea("Minutes",2),m:ea("Minutes",1),ss:ea("Seconds",2),s:ea("Seconds",1),sss:ea("Milliseconds",3),EEEE:kb("Day"),EEE:kb("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Ob(Math[0<a?"floor":"ceil"](a/60),2)+Ob(Math.abs(a%60),2))},ww:Yd(2),w:Yd(1),G:Fc,GG:Fc,GGG:Fc,GGGG:function(a,b){return 0>=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},
fh=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,eh=/^-?\d+$/;Rd.$inject=["$locale"];var $g=ia(K),ah=ia(ub);Td.$inject=["$parse"];var Me=ia({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===la.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),vb={};r(Gb,function(a,b){function d(a,d,e){a.$watch(e[c],
function(a){e.$set(b,!!a)})}if("multiple"!==a){var c=wa("ng-"+b),e=d;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[c]&&d(a,b,e)});vb[c]=function(){return{restrict:"A",priority:100,link:e}}}});r(td,function(a,b){vb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"===e.ngPattern.charAt(0)&&(c=e.ngPattern.match(ie))){e.$set("ngPattern",new RegExp(c[1],c[2]));return}a.$watch(e[b],function(a){e.$set(b,a)})}}}});r(["src","srcset","href"],function(a){var b=wa("ng-"+a);vb[b]=
["$sce",function(d){return{priority:99,link:function(c,e,f){var g=a,k=a;"href"===a&&"[object SVGAnimatedString]"===la.call(e.prop("href"))&&(k="xlinkHref",f.$attr[k]="xlink:href",g=null);f.$set(b,d.getTrustedMediaUrl(f[b]));f.$observe(b,function(b){b?(f.$set(k,b),Ca&&g&&e.prop(g,f[k])):"href"===a&&f.$set(k,null)})}}}]});var lb={$addControl:E,$getControls:ia([]),$$renameControl:function(a,b){a.$name=b},$removeControl:E,$setValidity:E,$setDirty:E,$setPristine:E,$setSubmitted:E,$$setSubmitted:E};Pb.$inject=
["$element","$attrs","$scope","$animate","$interpolate"];Pb.prototype={$rollbackViewValue:function(){r(this.$$controls,function(a){a.$rollbackViewValue()})},$commitViewValue:function(){r(this.$$controls,function(a){a.$commitViewValue()})},$addControl:function(a){Ja(a.$name,"input");this.$$controls.push(a);a.$name&&(this[a.$name]=a);a.$$parentForm=this},$getControls:function(){return ja(this.$$controls)},$$renameControl:function(a,b){var d=a.$name;this[d]===a&&delete this[d];this[b]=a;a.$name=b},$removeControl:function(a){a.$name&&
this[a.$name]===a&&delete this[a.$name];r(this.$pending,function(b,d){this.$setValidity(d,null,a)},this);r(this.$error,function(b,d){this.$setValidity(d,null,a)},this);r(this.$$success,function(b,d){this.$setValidity(d,null,a)},this);cb(this.$$controls,a);a.$$parentForm=lb},$setDirty:function(){this.$$animate.removeClass(this.$$element,Za);this.$$animate.addClass(this.$$element,Vb);this.$dirty=!0;this.$pristine=!1;this.$$parentForm.$setDirty()},$setPristine:function(){this.$$animate.setClass(this.$$element,
Za,Vb+" ng-submitted");this.$dirty=!1;this.$pristine=!0;this.$submitted=!1;r(this.$$controls,function(a){a.$setPristine()})},$setUntouched:function(){r(this.$$controls,function(a){a.$setUntouched()})},$setSubmitted:function(){for(var a=this;a.$$parentForm&&a.$$parentForm!==lb;)a=a.$$parentForm;a.$$setSubmitted()},$$setSubmitted:function(){this.$$animate.addClass(this.$$element,"ng-submitted");this.$submitted=!0;r(this.$$controls,function(a){a.$$setSubmitted&&a.$$setSubmitted()})}};ae({clazz:Pb,set:function(a,
b,d){var c=a[b];c?-1===c.indexOf(d)&&c.push(d):a[b]=[d]},unset:function(a,b,d){var c=a[b];c&&(cb(c,d),0===c.length&&delete a[b])}});var ke=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||E}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Pb,compile:function(d,f){d.addClass(Za).addClass(mb);var g=f.name?"name":a&&f.ngForm?"ngForm":!1;return{pre:function(a,d,e,f){var p=f[0];if(!("action"in e)){var n=function(b){a.$apply(function(){p.$commitViewValue();
p.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",n);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",n)},0,!1)})}(f[1]||p.$$parentForm).$addControl(p);var s=g?c(p.$name):E;g&&(s(a,p),e.$observe(g,function(b){p.$name!==b&&(s(a,void 0),p.$$parentForm.$$renameControl(p,b),s=c(p.$name),s(a,p))}));d.on("$destroy",function(){p.$$parentForm.$removeControl(p);s(a,void 0);S(p,lb)})}}}}}]},Ne=ke(),Ze=ke(!0),hh=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,
sh=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,th=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,ih=/^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,le=/^(\d{4,})-(\d{2})-(\d{2})$/,me=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Mc=/^(\d{4,})-W(\d\d)$/,ne=/^(\d{4,})-(\d\d)$/,
oe=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,ce=T();r(["date","datetime-local","month","time","week"],function(a){ce[a]=!0});var pe={text:function(a,b,d,c,e,f){Sa(a,b,d,c,e,f);Hc(c)},date:nb("date",le,Qb(le,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":nb("datetimelocal",me,Qb(me,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:nb("time",oe,Qb(oe,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:nb("week",Mc,function(a,b){if(ha(a))return a;if(A(a)){Mc.lastIndex=0;var d=Mc.exec(a);
if(d){var c=+d[1],e=+d[2],f=d=0,g=0,k=0,h=Xd(c),e=7*(e-1);b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),k=b.getMilliseconds());return new Date(c,0,h.getDate()+e,d,f,g,k)}}return NaN},"yyyy-Www"),month:nb("month",ne,Qb(ne,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f,g,k){Ic(a,b,d,c,"number");de(c);Sa(a,b,d,c,e,f);var h;if(w(d.min)||d.ngMin){var l=d.min||k(d.ngMin)(a);h=na(l);c.$validators.min=function(a,b){return c.$isEmpty(b)||z(h)||b>=h};d.$observe("min",function(a){a!==l&&(h=na(a),
l=a,c.$validate())})}if(w(d.max)||d.ngMax){var m=d.max||k(d.ngMax)(a),p=na(m);c.$validators.max=function(a,b){return c.$isEmpty(b)||z(p)||b<=p};d.$observe("max",function(a){a!==m&&(p=na(a),m=a,c.$validate())})}if(w(d.step)||d.ngStep){var n=d.step||k(d.ngStep)(a),s=na(n);c.$validators.step=function(a,b){return c.$isEmpty(b)||z(s)||ee(b,h||0,s)};d.$observe("step",function(a){a!==n&&(s=na(a),n=a,c.$validate())})}},url:function(a,b,d,c,e,f){Sa(a,b,d,c,e,f);Hc(c);c.$validators.url=function(a,b){var d=
a||b;return c.$isEmpty(d)||sh.test(d)}},email:function(a,b,d,c,e,f){Sa(a,b,d,c,e,f);Hc(c);c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||th.test(d)}},radio:function(a,b,d,c){var e=!d.ngTrim||"false"!==U(d.ngTrim);z(d.name)&&b.attr("name",++pb);b.on("change",function(a){var g;b[0].checked&&(g=d.value,e&&(g=U(g)),c.$setViewValue(g,a&&a.type))});c.$render=function(){var a=d.value;e&&(a=U(a));b[0].checked=a===c.$viewValue};d.$observe("value",c.$render)},range:function(a,b,d,c,e,f){function g(a,
c){b.attr(a,d[a]);var e=d[a];d.$observe(a,function(a){a!==e&&(e=a,c(a))})}function k(a){p=na(a);X(c.$modelValue)||(m?(a=b.val(),p>a&&(a=p,b.val(a)),c.$setViewValue(a)):c.$validate())}function h(a){n=na(a);X(c.$modelValue)||(m?(a=b.val(),n<a&&(b.val(n),a=n<p?p:n),c.$setViewValue(a)):c.$validate())}function l(a){s=na(a);X(c.$modelValue)||(m?c.$viewValue!==b.val()&&c.$setViewValue(b.val()):c.$validate())}Ic(a,b,d,c,"range");de(c);Sa(a,b,d,c,e,f);var m=c.$$hasNativeValidators&&"range"===b[0].type,p=m?
0:void 0,n=m?100:void 0,s=m?1:void 0,r=b[0].validity;a=w(d.min);e=w(d.max);f=w(d.step);var q=c.$render;c.$render=m&&w(r.rangeUnderflow)&&w(r.rangeOverflow)?function(){q();c.$setViewValue(b.val())}:q;a&&(p=na(d.min),c.$validators.min=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||z(p)||b>=p},g("min",k));e&&(n=na(d.max),c.$validators.max=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||z(n)||b<=n},g("max",h));f&&(s=na(d.step),c.$validators.step=m?function(){return!r.stepMismatch}:
function(a,b){return c.$isEmpty(b)||z(s)||ee(b,p||0,s)},g("step",l))},checkbox:function(a,b,d,c,e,f,g,k){var h=fe(k,a,"ngTrueValue",d.ngTrueValue,!0),l=fe(k,a,"ngFalseValue",d.ngFalseValue,!1);b.on("change",function(a){c.$setViewValue(b[0].checked,a&&a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=function(a){return!1===a};c.$formatters.push(function(a){return va(a,h)});c.$parsers.push(function(a){return a?h:l})},hidden:E,button:E,submit:E,reset:E,file:E},Yc=["$browser","$sniffer",
"$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,k){k[0]&&(pe[K(g.type)]||pe.text)(e,f,g,k[0],b,a,d,c)}}}}],vf=function(){var a={configurable:!0,enumerable:!1,get:function(){return this.getAttribute("value")||""},set:function(a){this.setAttribute("value",a)}};return{restrict:"E",priority:200,compile:function(b,d){if("hidden"===K(d.type))return{pre:function(b,d,f,g){b=d[0];b.parentNode&&b.parentNode.insertBefore(b,b.nextSibling);Object.defineProperty&&
Object.defineProperty(b,"value",a)}}}}},uh=/^(true|false|\d+)$/,sf=function(){function a(a,d,c){var e=w(c)?c:9===Ca?"":null;a.prop("value",e);d.$set("value",c)}return{restrict:"A",priority:100,compile:function(b,d){return uh.test(d.ngValue)?function(b,d,f){b=b.$eval(f.ngValue);a(d,f,b)}:function(b,d,f){b.$watch(f.ngValue,function(b){a(d,f,b)})}}}},Re=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);return function(b,c,e){a.$$addBindingInfo(c,e.ngBind);c=c[0];
b.$watch(e.ngBind,function(a){c.textContent=ic(a)})}}}}],Te=["$interpolate","$compile",function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate));b.$$addBindingInfo(d,c.expressions);d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=z(a)?"":a})}}}}],Se=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(b){return a.valueOf(b)});d.$$addBindingClass(c);
return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){var d=f(b);c.html(a.getTrustedHtml(d)||"")})}}}}],rf=ia({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),Ue=Kc("",!0),We=Kc("Odd",0),Ve=Kc("Even",1),Xe=Ra({compile:function(a,b){b.$set("ngCloak",void 0);a.removeClass("ng-cloak")}}),Ye=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],cd={},vh={blur:!0,focus:!0};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),
function(a){var b=wa("ng-"+a);cd[b]=["$parse","$rootScope","$exceptionHandler",function(d,c,e){return qd(d,c,e,b,a,vh[a])}]});var af=["$animate","$compile",function(a,b){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(d,c,e,f,g){var k,h,l;d.$watch(e.ngIf,function(d){d?h||g(function(d,f){h=f;d[d.length++]=b.$$createComment("end ngIf",e.ngIf);k={clone:d};a.enter(d,c.parent(),c)}):(l&&(l.remove(),l=null),h&&(h.$destroy(),h=null),k&&(l=tb(k.clone),
a.leave(l).done(function(a){!1!==a&&(l=null)}),k=null))})}}}],bf=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:ca.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",k=e.autoscroll;return function(c,e,m,p,n){var r=0,q,t,x,v=function(){t&&(t.remove(),t=null);q&&(q.$destroy(),q=null);x&&(d.leave(x).done(function(a){!1!==a&&(t=null)}),t=x,x=null)};c.$watch(f,function(f){var m=function(a){!1===
a||!w(k)||k&&!c.$eval(k)||b()},t=++r;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&t===r){var b=c.$new();p.template=a;a=n(b,function(a){v();d.enter(a,null,e).done(m)});q=b;x=a;q.$emit("$includeContentLoaded",f);c.$eval(g)}},function(){c.$$destroyed||t!==r||(v(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(v(),p.template=null)})}}}}],uf=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){la.call(d[0]).match(/SVG/)?
(d.empty(),a(ed(e.template,C.document).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],cf=Ra({priority:450,compile:function(){return{pre:function(a,b,d){a.$eval(d.ngInit)}}}}),qf=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=d.ngList||", ",f="false"!==d.ngTrim,g=f?U(e):e;c.$parsers.push(function(a){if(!z(a)){var b=[];a&&r(a.split(g),function(a){a&&b.push(f?U(a):a)});return b}});c.$formatters.push(function(a){if(H(a))return a.join(e)});
c.$isEmpty=function(a){return!a||!a.length}}}},mb="ng-valid",$d="ng-invalid",Za="ng-pristine",Vb="ng-dirty",ob=F("ngModel");Rb.$inject="$scope $exceptionHandler $attrs $element $parse $animate $timeout $q $interpolate".split(" ");Rb.prototype={$$initGetterSetters:function(){if(this.$options.getOption("getterSetter")){var a=this.$$parse(this.$$attr.ngModel+"()"),b=this.$$parse(this.$$attr.ngModel+"($$$p)");this.$$ngModelGet=function(b){var c=this.$$parsedNgModel(b);B(c)&&(c=a(b));return c};this.$$ngModelSet=
function(a,c){B(this.$$parsedNgModel(a))?b(a,{$$$p:c}):this.$$parsedNgModelAssign(a,c)}}else if(!this.$$parsedNgModel.assign)throw ob("nonassign",this.$$attr.ngModel,za(this.$$element));},$render:E,$isEmpty:function(a){return z(a)||""===a||null===a||a!==a},$$updateEmptyClasses:function(a){this.$isEmpty(a)?(this.$$animate.removeClass(this.$$element,"ng-not-empty"),this.$$animate.addClass(this.$$element,"ng-empty")):(this.$$animate.removeClass(this.$$element,"ng-empty"),this.$$animate.addClass(this.$$element,
"ng-not-empty"))},$setPristine:function(){this.$dirty=!1;this.$pristine=!0;this.$$animate.removeClass(this.$$element,Vb);this.$$animate.addClass(this.$$element,Za)},$setDirty:function(){this.$dirty=!0;this.$pristine=!1;this.$$animate.removeClass(this.$$element,Za);this.$$animate.addClass(this.$$element,Vb);this.$$parentForm.$setDirty()},$setUntouched:function(){this.$touched=!1;this.$untouched=!0;this.$$animate.setClass(this.$$element,"ng-untouched","ng-touched")},$setTouched:function(){this.$touched=
!0;this.$untouched=!1;this.$$animate.setClass(this.$$element,"ng-touched","ng-untouched")},$rollbackViewValue:function(){this.$$timeout.cancel(this.$$pendingDebounce);this.$viewValue=this.$$lastCommittedViewValue;this.$render()},$validate:function(){if(!X(this.$modelValue)){var a=this.$$lastCommittedViewValue,b=this.$$rawModelValue,d=this.$valid,c=this.$modelValue,e=this.$options.getOption("allowInvalid"),f=this;this.$$runValidators(b,a,function(a){e||d===a||(f.$modelValue=a?b:void 0,f.$modelValue!==
c&&f.$$writeModelToScope())})}},$$runValidators:function(a,b,d){function c(){var c=!0;r(h.$validators,function(d,e){var g=Boolean(d(a,b));c=c&&g;f(e,g)});return c?!0:(r(h.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;r(h.$asyncValidators,function(e,g){var h=e(a,b);if(!h||!B(h.then))throw ob("nopromise",h);f(g,void 0);c.push(h.then(function(){f(g,!0)},function(){d=!1;f(g,!1)}))});c.length?h.$$q.all(c).then(function(){g(d)},E):g(!0)}function f(a,b){k===h.$$currentValidationRunId&&
h.$setValidity(a,b)}function g(a){k===h.$$currentValidationRunId&&d(a)}this.$$currentValidationRunId++;var k=this.$$currentValidationRunId,h=this;(function(){var a=h.$$parserName;if(z(h.$$parserValid))f(a,null);else return h.$$parserValid||(r(h.$validators,function(a,b){f(b,null)}),r(h.$asyncValidators,function(a,b){f(b,null)})),f(a,h.$$parserValid),h.$$parserValid;return!0})()?c()?e():g(!1):g(!1)},$commitViewValue:function(){var a=this.$viewValue;this.$$timeout.cancel(this.$$pendingDebounce);if(this.$$lastCommittedViewValue!==
a||""===a&&this.$$hasNativeValidators)this.$$updateEmptyClasses(a),this.$$lastCommittedViewValue=a,this.$pristine&&this.$setDirty(),this.$$parseAndValidate()},$$parseAndValidate:function(){var a=this.$$lastCommittedViewValue,b=this;this.$$parserValid=z(a)?void 0:!0;this.$setValidity(this.$$parserName,null);this.$$parserName="parse";if(this.$$parserValid)for(var d=0;d<this.$parsers.length;d++)if(a=this.$parsers[d](a),z(a)){this.$$parserValid=!1;break}X(this.$modelValue)&&(this.$modelValue=this.$$ngModelGet(this.$$scope));
var c=this.$modelValue,e=this.$options.getOption("allowInvalid");this.$$rawModelValue=a;e&&(this.$modelValue=a,b.$modelValue!==c&&b.$$writeModelToScope());this.$$runValidators(a,this.$$lastCommittedViewValue,function(d){e||(b.$modelValue=d?a:void 0,b.$modelValue!==c&&b.$$writeModelToScope())})},$$writeModelToScope:function(){this.$$ngModelSet(this.$$scope,this.$modelValue);r(this.$viewChangeListeners,function(a){try{a()}catch(b){this.$$exceptionHandler(b)}},this)},$setViewValue:function(a,b){this.$viewValue=
a;this.$options.getOption("updateOnDefault")&&this.$$debounceViewValueCommit(b)},$$debounceViewValueCommit:function(a){var b=this.$options.getOption("debounce");W(b[a])?b=b[a]:W(b["default"])&&-1===this.$options.getOption("updateOn").indexOf(a)?b=b["default"]:W(b["*"])&&(b=b["*"]);this.$$timeout.cancel(this.$$pendingDebounce);var d=this;0<b?this.$$pendingDebounce=this.$$timeout(function(){d.$commitViewValue()},b):this.$$rootScope.$$phase?this.$commitViewValue():this.$$scope.$apply(function(){d.$commitViewValue()})},
$overrideModelOptions:function(a){this.$options=this.$options.createChild(a);this.$$setUpdateOnEvents()},$processModelValue:function(){var a=this.$$format();this.$viewValue!==a&&(this.$$updateEmptyClasses(a),this.$viewValue=this.$$lastCommittedViewValue=a,this.$render(),this.$$runValidators(this.$modelValue,this.$viewValue,E))},$$format:function(){for(var a=this.$formatters,b=a.length,d=this.$modelValue;b--;)d=a[b](d);return d},$$setModelValue:function(a){this.$modelValue=this.$$rawModelValue=a;this.$$parserValid=
void 0;this.$processModelValue()},$$setUpdateOnEvents:function(){this.$$updateEvents&&this.$$element.off(this.$$updateEvents,this.$$updateEventHandler);if(this.$$updateEvents=this.$options.getOption("updateOn"))this.$$element.on(this.$$updateEvents,this.$$updateEventHandler)},$$updateEventHandler:function(a){this.$$debounceViewValueCommit(a&&a.type)}};ae({clazz:Rb,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]}});var pf=["$rootScope",function(a){return{restrict:"A",require:["ngModel",
"^?form","^?ngModelOptions"],controller:Rb,priority:1,compile:function(b){b.addClass(Za).addClass("ng-untouched").addClass(mb);return{pre:function(a,b,e,f){var g=f[0];b=f[1]||g.$$parentForm;if(f=f[2])g.$options=f.$options;g.$$initGetterSetters();b.$addControl(g);e.$observe("name",function(a){g.$name!==a&&g.$$parentForm.$$renameControl(g,a)});a.$on("$destroy",function(){g.$$parentForm.$removeControl(g)})},post:function(b,c,e,f){function g(){k.$setTouched()}var k=f[0];k.$$setUpdateOnEvents();c.on("blur",
function(){k.$touched||(a.$$phase?b.$evalAsync(g):b.$apply(g))})}}}}}],Sb,wh=/(\s+|^)default(\s+|$)/;Lc.prototype={getOption:function(a){return this.$$options[a]},createChild:function(a){var b=!1;a=S({},a);r(a,function(d,c){"$inherit"===d?"*"===c?b=!0:(a[c]=this.$$options[c],"updateOn"===c&&(a.updateOnDefault=this.$$options.updateOnDefault)):"updateOn"===c&&(a.updateOnDefault=!1,a[c]=U(d.replace(wh,function(){a.updateOnDefault=!0;return" "})))},this);b&&(delete a["*"],ge(a,this.$$options));ge(a,Sb.$$options);
return new Lc(a)}};Sb=new Lc({updateOn:"",updateOnDefault:!0,debounce:0,getterSetter:!1,allowInvalid:!1,timezone:null});var tf=function(){function a(a,d){this.$$attrs=a;this.$$scope=d}a.$inject=["$attrs","$scope"];a.prototype={$onInit:function(){var a=this.parentCtrl?this.parentCtrl.$options:Sb,d=this.$$scope.$eval(this.$$attrs.ngModelOptions);this.$options=a.createChild(d)}};return{restrict:"A",priority:10,require:{parentCtrl:"?^^ngModelOptions"},bindToController:!0,controller:a}},df=Ra({terminal:!0,
priority:1E3}),xh=F("ngOptions"),yh=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,nf=["$compile","$document","$parse",function(a,b,d){function c(a,b,c){function e(a,b,c,d,f){this.selectValue=a;this.viewValue=b;this.label=c;this.group=d;this.disabled=f}function f(a){var b;if(!r&&ya(a))b=a;else{b=[];for(var c in a)a.hasOwnProperty(c)&&
"$"!==c.charAt(0)&&b.push(c)}return b}var p=a.match(yh);if(!p)throw xh("iexp",a,za(b));var n=p[5]||p[7],r=p[6];a=/ as /.test(p[0])&&p[1];var q=p[9];b=d(p[2]?p[1]:n);var t=a&&d(a)||b,w=q&&d(q),v=q?function(a,b){return w(c,b)}:function(a){return La(a)},x=function(a,b){return v(a,A(a,b))},z=d(p[2]||p[1]),y=d(p[3]||""),J=d(p[4]||""),I=d(p[8]),B={},A=r?function(a,b){B[r]=b;B[n]=a;return B}:function(a){B[n]=a;return B};return{trackBy:q,getTrackByValue:x,getWatchables:d(I,function(a){var b=[];a=a||[];for(var d=
f(a),e=d.length,g=0;g<e;g++){var k=a===d?g:d[g],l=a[k],k=A(l,k),l=v(l,k);b.push(l);if(p[2]||p[1])l=z(c,k),b.push(l);p[4]&&(k=J(c,k),b.push(k))}return b}),getOptions:function(){for(var a=[],b={},d=I(c)||[],g=f(d),k=g.length,n=0;n<k;n++){var p=d===g?n:g[n],r=A(d[p],p),s=t(c,r),p=v(s,r),w=z(c,r),B=y(c,r),r=J(c,r),s=new e(p,s,w,B,r);a.push(s);b[p]=s}return{items:a,selectValueMap:b,getOptionFromViewValue:function(a){return b[x(a)]},getViewValueFromOption:function(a){return q?Ia(a.viewValue):a.viewValue}}}}}
var e=C.document.createElement("option"),f=C.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(a,b,c,d){d[0].registerOption=E},post:function(d,k,h,l){function m(a){var b=(a=v.getOptionFromViewValue(a))&&a.element;b&&!b.selected&&(b.selected=!0);return a}function p(a,b){a.element=b;b.disabled=a.disabled;a.label!==b.label&&(b.label=a.label,b.textContent=a.label);b.value=a.selectValue}var n=l[0],q=l[1],z=h.multiple;l=0;for(var t=k.children(),
B=t.length;l<B;l++)if(""===t[l].value){n.hasEmptyOption=!0;n.emptyOption=t.eq(l);break}k.empty();l=!!n.emptyOption;x(e.cloneNode(!1)).val("?");var v,A=c(h.ngOptions,k,d),C=b[0].createDocumentFragment();n.generateUnknownOptionValue=function(a){return"?"};z?(n.writeValue=function(a){if(v){var b=a&&a.map(m)||[];v.items.forEach(function(a){a.element.selected&&-1===Array.prototype.indexOf.call(b,a)&&(a.element.selected=!1)})}},n.readValue=function(){var a=k.val()||[],b=[];r(a,function(a){(a=v.selectValueMap[a])&&
!a.disabled&&b.push(v.getViewValueFromOption(a))});return b},A.trackBy&&d.$watchCollection(function(){if(H(q.$viewValue))return q.$viewValue.map(function(a){return A.getTrackByValue(a)})},function(){q.$render()})):(n.writeValue=function(a){if(v){var b=k[0].options[k[0].selectedIndex],c=v.getOptionFromViewValue(a);b&&b.removeAttribute("selected");c?(k[0].value!==c.selectValue&&(n.removeUnknownOption(),k[0].value=c.selectValue,c.element.selected=!0),c.element.setAttribute("selected","selected")):n.selectUnknownOrEmptyOption(a)}},
n.readValue=function(){var a=v.selectValueMap[k.val()];return a&&!a.disabled?(n.unselectEmptyOption(),n.removeUnknownOption(),v.getViewValueFromOption(a)):null},A.trackBy&&d.$watch(function(){return A.getTrackByValue(q.$viewValue)},function(){q.$render()}));l&&(a(n.emptyOption)(d),k.prepend(n.emptyOption),8===n.emptyOption[0].nodeType?(n.hasEmptyOption=!1,n.registerOption=function(a,b){""===b.val()&&(n.hasEmptyOption=!0,n.emptyOption=b,n.emptyOption.removeClass("ng-scope"),q.$render(),b.on("$destroy",
function(){var a=n.$isEmptyOptionSelected();n.hasEmptyOption=!1;n.emptyOption=void 0;a&&q.$render()}))}):n.emptyOption.removeClass("ng-scope"));d.$watchCollection(A.getWatchables,function(){var a=v&&n.readValue();if(v)for(var b=v.items.length-1;0<=b;b--){var c=v.items[b];w(c.group)?Fb(c.element.parentNode):Fb(c.element)}v=A.getOptions();var d={};v.items.forEach(function(a){var b;if(w(a.group)){b=d[a.group];b||(b=f.cloneNode(!1),C.appendChild(b),b.label=null===a.group?"null":a.group,d[a.group]=b);
var c=e.cloneNode(!1);b.appendChild(c);p(a,c)}else b=e.cloneNode(!1),C.appendChild(b),p(a,b)});k[0].appendChild(C);q.$render();q.$isEmpty(a)||(b=n.readValue(),(A.trackBy||z?va(a,b):a===b)||(q.$setViewValue(b),q.$render()))})}}}}],ef=["$locale","$interpolate","$log",function(a,b,d){var c=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(f,g,k){function h(a){g.text(a||"")}var l=k.count,m=k.$attr.when&&g.attr(k.$attr.when),p=k.offset||0,n=f.$eval(m)||{},q={},w=b.startSymbol(),t=b.endSymbol(),x=w+l+"-"+
p+t,v=ca.noop,A;r(k,function(a,b){var c=e.exec(b);c&&(c=(c[1]?"-":"")+K(c[2]),n[c]=g.attr(k.$attr[b]))});r(n,function(a,d){q[d]=b(a.replace(c,x))});f.$watch(l,function(b){var c=parseFloat(b),e=X(c);e||c in n||(c=a.pluralCat(c-p));c===A||e&&X(A)||(v(),e=q[c],z(e)?(null!=b&&d.debug("ngPluralize: no rule defined for '"+c+"' in "+m),v=E,h()):v=f.$watch(e,h),A=c)})}}}],qe=F("ngRef"),ff=["$parse",function(a){return{priority:-1,restrict:"A",compile:function(b,d){var c=wa(ua(b)),e=a(d.ngRef),f=e.assign||
function(){throw qe("nonassign",d.ngRef);};return function(a,b,h){var l;if(h.hasOwnProperty("ngRefRead"))if("$element"===h.ngRefRead)l=b;else{if(l=b.data("$"+h.ngRefRead+"Controller"),!l)throw qe("noctrl",h.ngRefRead,d.ngRef);}else l=b.data("$"+c+"Controller");l=l||b;f(a,l);b.on("$destroy",function(){e(a)===l&&f(a,null)})}}}}],gf=["$parse","$animate","$compile",function(a,b,d){var c=F("ngRepeat"),e=function(a,b,c,d,e,f,g){a[c]=d;e&&(a[e]=f);a.$index=b;a.$first=0===b;a.$last=b===g-1;a.$middle=!(a.$first||
a.$last);a.$odd=!(a.$even=0===(b&1))},f=function(a,b,c){return La(c)},g=function(a,b){return b};return{restrict:"A",multiElement:!0,transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,compile:function(k,h){var l=h.ngRepeat,m=d.$$createComment("end ngRepeat",l),p=l.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!p)throw c("iexp",l);var n=p[1],q=p[2],w=p[3],t=p[4],p=n.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/);if(!p)throw c("iidexp",
n);var x=p[3]||p[1],v=p[2];if(w&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(w)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(w)))throw c("badident",w);var z;if(t){var A={$id:La},y=a(t);z=function(a,b,c,d){v&&(A[v]=b);A[x]=c;A.$index=d;return y(a,A)}}return function(a,d,h,k,n){var p=T();a.$watchCollection(q,function(h){var k,q,t=d[0],s,y=T(),B,C,E,D,H,F,K;w&&(a[w]=h);if(ya(h))H=h,q=z||f;else for(K in q=z||g,H=[],h)ta.call(h,K)&&"$"!==K.charAt(0)&&H.push(K);
B=H.length;K=Array(B);for(k=0;k<B;k++)if(C=h===H?k:H[k],E=h[C],D=q(a,C,E,k),p[D])F=p[D],delete p[D],y[D]=F,K[k]=F;else{if(y[D])throw r(K,function(a){a&&a.scope&&(p[a.id]=a)}),c("dupes",l,D,E);K[k]={id:D,scope:void 0,clone:void 0};y[D]=!0}A&&(A[x]=void 0);for(s in p){F=p[s];D=tb(F.clone);b.leave(D);if(D[0].parentNode)for(k=0,q=D.length;k<q;k++)D[k].$$NG_REMOVED=!0;F.scope.$destroy()}for(k=0;k<B;k++)if(C=h===H?k:H[k],E=h[C],F=K[k],F.scope){s=t;do s=s.nextSibling;while(s&&s.$$NG_REMOVED);F.clone[0]!==
s&&b.move(tb(F.clone),null,t);t=F.clone[F.clone.length-1];e(F.scope,k,x,E,v,C,B)}else n(function(a,c){F.scope=c;var d=m.cloneNode(!1);a[a.length++]=d;b.enter(a,null,t);t=d;F.clone=a;y[F.id]=F;e(F.scope,k,x,E,v,C,B)});p=y})}}}}],hf=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngShow,function(b){a[b?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],$e=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,
d,c){b.$watch(c.ngHide,function(b){a[b?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],jf=Ra(function(a,b,d){a.$watchCollection(d.ngStyle,function(a,d){d&&a!==d&&(a||(a={}),r(d,function(b,d){null==a[d]&&(a[d]="")}));a&&b.css(a)})}),kf=["$animate","$compile",function(a,b){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(d,c,e,f){var g=[],k=[],h=[],l=[],m=function(a,b){return function(c){!1!==c&&a.splice(b,1)}};d.$watch(e.ngSwitch||
e.on,function(c){for(var d,e;h.length;)a.cancel(h.pop());d=0;for(e=l.length;d<e;++d){var q=tb(k[d].clone);l[d].$destroy();(h[d]=a.leave(q)).done(m(h,d))}k.length=0;l.length=0;(g=f.cases["!"+c]||f.cases["?"])&&r(g,function(c){c.transclude(function(d,e){l.push(e);var f=c.element;d[d.length++]=b.$$createComment("end ngSwitchWhen");k.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],lf=Ra({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){a=d.ngSwitchWhen.split(d.ngSwitchWhenSeparator).sort().filter(function(a,
b,c){return c[b-1]!==a});r(a,function(a){c.cases["!"+a]=c.cases["!"+a]||[];c.cases["!"+a].push({transclude:e,element:b})})}}),mf=Ra({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){c.cases["?"]=c.cases["?"]||[];c.cases["?"].push({transclude:e,element:b})}}),zh=F("ngTransclude"),of=["$compile",function(a){return{restrict:"EAC",compile:function(b){var d=a(b.contents());b.empty();return function(a,b,f,g,k){function h(){d(a,function(a){b.append(a)})}if(!k)throw zh("orphan",
za(b));f.ngTransclude===f.$attr.ngTransclude&&(f.ngTransclude="");f=f.ngTransclude||f.ngTranscludeSlot;k(function(a,c){var d;if(d=a.length)a:{d=0;for(var f=a.length;d<f;d++){var g=a[d];if(g.nodeType!==Pa||g.nodeValue.trim()){d=!0;break a}}d=void 0}d?b.append(a):(h(),c.$destroy())},null,f);f&&!k.isSlotFilled(f)&&h()}}}}],Oe=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,d){"text/ng-template"===d.type&&a.put(d.id,b[0].text)}}}],Ah={$setViewValue:E,$render:E},Bh=["$element",
"$scope",function(a,b){function d(){g||(g=!0,b.$$postDigest(function(){g=!1;e.ngModelCtrl.$render()}))}function c(a){k||(k=!0,b.$$postDigest(function(){b.$$destroyed||(k=!1,e.ngModelCtrl.$setViewValue(e.readValue()),a&&e.ngModelCtrl.$render())}))}var e=this,f=new Hb;e.selectValueMap={};e.ngModelCtrl=Ah;e.multiple=!1;e.unknownOption=x(C.document.createElement("option"));e.hasEmptyOption=!1;e.emptyOption=void 0;e.renderUnknownOption=function(b){b=e.generateUnknownOptionValue(b);e.unknownOption.val(b);
a.prepend(e.unknownOption);Oa(e.unknownOption,!0);a.val(b)};e.updateUnknownOption=function(b){b=e.generateUnknownOptionValue(b);e.unknownOption.val(b);Oa(e.unknownOption,!0);a.val(b)};e.generateUnknownOptionValue=function(a){return"? "+La(a)+" ?"};e.removeUnknownOption=function(){e.unknownOption.parent()&&e.unknownOption.remove()};e.selectEmptyOption=function(){e.emptyOption&&(a.val(""),Oa(e.emptyOption,!0))};e.unselectEmptyOption=function(){e.hasEmptyOption&&Oa(e.emptyOption,!1)};b.$on("$destroy",
function(){e.renderUnknownOption=E});e.readValue=function(){var b=a.val(),b=b in e.selectValueMap?e.selectValueMap[b]:b;return e.hasOption(b)?b:null};e.writeValue=function(b){var c=a[0].options[a[0].selectedIndex];c&&Oa(x(c),!1);e.hasOption(b)?(e.removeUnknownOption(),c=La(b),a.val(c in e.selectValueMap?c:b),Oa(x(a[0].options[a[0].selectedIndex]),!0)):e.selectUnknownOrEmptyOption(b)};e.addOption=function(a,b){if(8!==b[0].nodeType){Ja(a,'"option value"');""===a&&(e.hasEmptyOption=!0,e.emptyOption=
b);var c=f.get(a)||0;f.set(a,c+1);d()}};e.removeOption=function(a){var b=f.get(a);b&&(1===b?(f.delete(a),""===a&&(e.hasEmptyOption=!1,e.emptyOption=void 0)):f.set(a,b-1))};e.hasOption=function(a){return!!f.get(a)};e.$hasEmptyOption=function(){return e.hasEmptyOption};e.$isUnknownOptionSelected=function(){return a[0].options[0]===e.unknownOption[0]};e.$isEmptyOptionSelected=function(){return e.hasEmptyOption&&a[0].options[a[0].selectedIndex]===e.emptyOption[0]};e.selectUnknownOrEmptyOption=function(a){null==
a&&e.emptyOption?(e.removeUnknownOption(),e.selectEmptyOption()):e.unknownOption.parent().length?e.updateUnknownOption(a):e.renderUnknownOption(a)};var g=!1,k=!1;e.registerOption=function(a,b,f,g,k){if(f.$attr.ngValue){var q,r;f.$observe("value",function(a){var d,f=b.prop("selected");w(r)&&(e.removeOption(q),delete e.selectValueMap[r],d=!0);r=La(a);q=a;e.selectValueMap[r]=a;e.addOption(a,b);b.attr("value",r);d&&f&&c()})}else g?f.$observe("value",function(a){e.readValue();var d,f=b.prop("selected");
w(q)&&(e.removeOption(q),d=!0);q=a;e.addOption(a,b);d&&f&&c()}):k?a.$watch(k,function(a,d){f.$set("value",a);var g=b.prop("selected");d!==a&&e.removeOption(d);e.addOption(a,b);d&&g&&c()}):e.addOption(f.value,b);f.$observe("disabled",function(a){if("true"===a||a&&b.prop("selected"))e.multiple?c(!0):(e.ngModelCtrl.$setViewValue(null),e.ngModelCtrl.$render())});b.on("$destroy",function(){var a=e.readValue(),b=f.value;e.removeOption(b);d();(e.multiple&&a&&-1!==a.indexOf(b)||a===b)&&c(!0)})}}],Pe=function(){return{restrict:"E",
require:["select","?ngModel"],controller:Bh,priority:1,link:{pre:function(a,b,d,c){var e=c[0],f=c[1];if(f){if(e.ngModelCtrl=f,b.on("change",function(){e.removeUnknownOption();a.$apply(function(){f.$setViewValue(e.readValue())})}),d.multiple){e.multiple=!0;e.readValue=function(){var a=[];r(b.find("option"),function(b){b.selected&&!b.disabled&&(b=b.value,a.push(b in e.selectValueMap?e.selectValueMap[b]:b))});return a};e.writeValue=function(a){r(b.find("option"),function(b){var c=!!a&&(-1!==Array.prototype.indexOf.call(a,
b.value)||-1!==Array.prototype.indexOf.call(a,e.selectValueMap[b.value]));c!==b.selected&&Oa(x(b),c)})};var g,k=NaN;a.$watch(function(){k!==f.$viewValue||va(g,f.$viewValue)||(g=ja(f.$viewValue),f.$render());k=f.$viewValue});f.$isEmpty=function(a){return!a||0===a.length}}}else e.registerOption=E},post:function(a,b,d,c){var e=c[1];if(e){var f=c[0];e.$render=function(){f.writeValue(e.$viewValue)}}}}}},Qe=["$interpolate",function(a){return{restrict:"E",priority:100,compile:function(b,d){var c,e;w(d.ngValue)||
(w(d.value)?c=a(d.value,!0):(e=a(b.text(),!0))||d.$set("value",b.text()));return function(a,b,d){var h=b.parent();(h=h.data("$selectController")||h.parent().data("$selectController"))&&h.registerOption(a,b,d,c,e)}}}}],$c=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){if(e){var f=c.hasOwnProperty("required")||a(c.ngRequired)(b);c.ngRequired||(c.required=!0);e.$validators.required=function(a,b){return!f||!e.$isEmpty(b)};c.$observe("required",function(a){f!==a&&(f=
a,e.$validate())})}}}}],Zc=["$parse",function(a){return{restrict:"A",require:"?ngModel",compile:function(b,d){var c,e;d.ngPattern&&(c=d.ngPattern,e="/"===d.ngPattern.charAt(0)&&ie.test(d.ngPattern)?function(){return d.ngPattern}:a(d.ngPattern));return function(a,b,d,h){if(h){var l=d.pattern;d.ngPattern?l=e(a):c=d.pattern;var m=he(l,c,b);d.$observe("pattern",function(a){var d=m;m=he(a,c,b);(d&&d.toString())!==(m&&m.toString())&&h.$validate()});h.$validators.pattern=function(a,b){return h.$isEmpty(b)||
z(m)||m.test(b)}}}}}}],bd=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){if(e){var f=c.maxlength||a(c.ngMaxlength)(b),g=Tb(f);c.$observe("maxlength",function(a){f!==a&&(g=Tb(a),f=a,e.$validate())});e.$validators.maxlength=function(a,b){return 0>g||e.$isEmpty(b)||b.length<=g}}}}}],ad=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){if(e){var f=c.minlength||a(c.ngMinlength)(b),g=Tb(f)||-1;c.$observe("minlength",function(a){f!==
a&&(g=Tb(a)||-1,f=a,e.$validate())});e.$validators.minlength=function(a,b){return e.$isEmpty(b)||b.length>=g}}}}}];C.angular.bootstrap?C.console&&console.log("WARNING: Tried to load AngularJS more than once."):(Fe(),Je(ca),ca.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],
ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a",
"short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,c){var e=a|0,f=c;void 0===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),x(function(){Ae(C.document,
Uc)}))})(window);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
//# sourceMappingURL=angular.min.js.map
;
/*
 * Pointer Events Polyfill: Adds support for the style attribute "pointer-events: none" to browsers without this feature (namely, IE).
 * (c) 2013, Kent Mewhort, licensed under BSD. See LICENSE.txt for details.
 */

// constructor
function PointerEventsPolyfill(options){
    // set defaults
    this.options = {
        selector: '*',
        mouseEvents: ['click','dblclick','mousedown','mouseup'],
        usePolyfillIf: function(){
            if(navigator.appName == 'Microsoft Internet Explorer')
            {
                var agent = navigator.userAgent;
                if (agent.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/) != null){
                    var version = parseFloat( RegExp.$1 );
                    if(version < 11)
                        return true;
                }
            }
            return false;
        }
    };
    if(options){
        var obj = this;
        $.each(options, function(k,v){
            obj.options[k] = v;
        });
    }

    if(this.options.usePolyfillIf())
        this.register_mouse_events();
}

// singleton initializer
PointerEventsPolyfill.initialize = function(options){
    if(PointerEventsPolyfill.singleton == null)
        PointerEventsPolyfill.singleton = new PointerEventsPolyfill(options);
    return PointerEventsPolyfill.singleton;
};

// handle mouse events w/ support for pointer-events: none
PointerEventsPolyfill.prototype.register_mouse_events = function(){
    // register on all elements (and all future elements) matching the selector
    $(document).on(this.options.mouseEvents.join(" "), this.options.selector, function(e){
        if($(this).css('pointer-events') == 'none'){
            // peak at the element below
            var origDisplayAttribute = $(this).css('display');
            $(this).css('display','none');

            var underneathElem = document.elementFromPoint(e.clientX, e.clientY);

            if(origDisplayAttribute)
                $(this)
                    .css('display', origDisplayAttribute);
            else
                $(this).css('display','');

            // fire the mouse event on the element below
            e.target = underneathElem;
            $(underneathElem).trigger(e).trigger('focus');

            return false;
        }
        return true;
    });
};;
// IE console.log disable errors
if (typeof console === "undefined" || typeof console.log === "undefined") {
	console = {};
	console.log = function() {};
}

// Initialize pointer-events polyfill
$(document).ready(function() {
	PointerEventsPolyfill.initialize({});
	$("a.help-centre-view-more-link.show-for-small-only").on(
		"click",
		function() {
			$(this)
				.prev("ol")
				.find("li.hide-for-small-only")
				.each(function() {
					$(this).removeClass("hide-for-small-only");
				});
			$(this).removeClass("show-for-small-only");
			$(this).hide();
		}
	);

	// init zurb foundation js
	$(document).foundation();

	$(".pl01-header-mobile-login a").on("click", function() {
		var IS_IPAD = navigator.userAgent.match(/iPad/i) != null,
			IS_IPHONE =
				!IS_IPAD &&
				(navigator.userAgent.match(/iPhone/i) != null ||
					navigator.userAgent.match(/iPod/i) != null),
			IS_IOS = IS_IPAD || IS_IPHONE,
			IS_ANDROID =
				!IS_IOS && navigator.userAgent.match(/android/i) != null;

		var ele = $(this);

		//schema of the app
		var deepLink = ele.data("deep_link");

		// Market address for android and iphone
		var market_a = ele.data("market_link_android");
		var market_i = ele.data("market_link_apple");

		if (IS_ANDROID) {
			setTimeout(function() {
				location.href = market_a;
			}, 1000);

			location.href = deepLink;
		} else if (IS_IOS) {
			location.href = market_i;
		} else {
			alert("android and iOS only");
		}

		event.preventDefault();
	});
	$(".pl75-videoplaylist-thumb").on("click", function() {
		// stop all video
		$(".video-iframe").each(function() {
			this.contentWindow.postMessage(
				'{"event":"command","func":"stopVideo","args":""}',
				"*"
			);
		});
		// hide all video frames
		$(".video-iframe").hide();
	});
	// Add empty alt text to all images with no alt text
	$("img:not([alt])").attr("alt", "");

	$("#jsSidenav").each(function(index, val) {
		var $root = $(val);

		$(val)
			.find(".has-navdropdown")
			.on("click", function(event) {
				window.location.href = $(event.target)
					.closest("a")
					.attr("href");
			});

		var $active = $(val).find(".is-active");
		// desktop sidenav
		if ($(window).width() >= 897) {
			while (
				typeof $active[0] !== "undefined" &&
				$active[0] !== $root[0]
			) {
				if ($active.hasClass("has-navdropdown")) {
					$active.addClass("is-visible");
				}
				$active = $active.parent();
			}
		}
	});

	$(".jsLoginBtn").on("click", function() {
		$("body").toggleClass("loginBtn--active");
	});

	$(window).on("resize", function() {
		$(".pl01-header-secondary-nav .has-navdropdown").removeClass(
			"hover, moved"
		);
	});
});

$(window).ready(function() {
	//----------------------------------------------------------------------------
	//this function uses built in foundation conditional code at top of page to check for Internet Explorer versions less than IE10
	//it then adds the automplete off attribute to the form tag
	if ($(".lt-ie10").length) {
		$("form").attr("autocomplete", "off");
	}
});

// set a cookie
// Example: setCookie('cookie1','testcookie',7); (7days)
// Example: setCookie('cookie1','testcookie',Number.MAX_VALUE); (forever)
function setCookie(cname, cvalue, exdays) {
	var d = new Date();
	d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
	var expires = "expires=" + d.toUTCString();
	document.cookie = cname + "=" + cvalue + "; " + expires;
}
// get a cookie
// Example: getCookie('cookie1')
function getCookie(cname) {
	var name = cname + "=";
	var ca = document.cookie.split(";");
	for (var i = 0; i < ca.length; i++) {
		var c = ca[i];
		while (c.charAt(0) == " ") c = c.substring(1);
		if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
	}
	return "";
}
// erase a cookie
// Example: eraseCookie('cookie1')
function eraseCookie(name) {
	setCookie(name, "", -1);
}
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Toggle a class on any element, put "data-toggle-target" attribute on any element
 * Example: <a href="" data-toggle-target=".search-input" data-toggle-class="is-active" data-toggle-hide="menu">Show Search</a>
 *
 * data-toggle-target = the reference to the element to apply the class to
 * data-toggle-class = class to toggle on or off
 * data-toggle-hide = target(s) of other elements to hide
 * data-toggle-hide-outside = (boolean) hide if clicking outside
 * data-toggle-focus = focus an element after applying toggle class
 * data-toggle-clickthrough = allows click through if true, blocks all by default
 */
;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'genericToggle',
        defaults = {
            data_target : "toggle-target",
            data_class : "toggle-class",
            data_hide : "toggle-hide",
            data_hide_outside : "toggle-hide-outside",
            data_focus : "toggle-focus",
            data_clickthrough : "toggle-clickthrough"
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;
        //init events
        scope.setupEvents(scope);
    };

    // add events to items
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        var data_target = $el.data(scope.options.data_target);
        var data_class = $el.data(scope.options.data_class);
        var data_hide = $el.data(scope.options.data_hide);
        var data_hide_outside = $el.data(scope.options.data_hide_outside);
        var data_focus = $el.data(scope.options.data_focus);
        var data_clickthrough = $el.data(scope.options.clickthrough);
        $el.click(function(e){
            $(data_target).toggleClass(data_class);
            // if hide is set hide other elements afterwards (data-toggle-hide=".pl01-header-search-container")
            if (data_hide){
                var targets = data_hide.split(',');
                for (var i in targets){
                    var target_reference = targets[i];
                    var $target = $("[data-toggle-target='"+target_reference+"']");
                    var target_class = $target.data(scope.options.data_class);
                    $(target_reference).removeClass(target_class);
                }
            }
            if (data_focus) {
                setTimeout(function(){
                    $(data_focus).focus();
                }, 10);
            }
            if (data_clickthrough !== true){
                e.preventDefault();
                e.stopPropagation();
            }
            // trigger a window resize event to refresh the layout if needed
            $(window).trigger('resize');

            // fix issue with menu not showing on mobile when at the top of page
			if ($("body").scrollTop() === 0) {
				if ($("body").hasClass("is-navigation-toggled")) {
					$("body").addClass("is-header-stuck");
				}else{
					$("body").removeClass("is-header-stuck");
				}
			}
        });

        // hide when clicking outside
        if (data_hide_outside === true){
            $('html').click(function(e) {
                //Hide the menus if visible
                scope.hideOutside(scope, data_target, data_class, e);
            });
        }
    };

    // hide if clicking outside container
    Plugin.prototype.hideOutside = function(scope, data_target, data_class, e) {
        // dont do anything if clicking on data-toggle-target
        if ($(e.target).parents(data_target)){
            $(data_target).removeClass(data_class);
            // trigger a window resize event to refresh the layout if needed
            $(window).trigger('resize');
        }
    };

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load',function() {
        $("[data-toggle-target]").genericToggle();
    });

})( jQuery, window, document );
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Collapsible Menu Jquery Plugin
 *
 * Manages Open and close the menu panels, attach to the outer panel element "menu-tab"
 * any .menu-item will be automatically wired up to receive the click on .menu-link
 * if "menu-mobile-content" exists then the content will be copied to the "menu-desktop-content" element
 * passing in options menu_opened_initially: false will not open the first item initially
 *
 *  On init we remove the href from all menu-link's so that we dont trigger a hash change
 *  when clicked, we can then use the title to update the hash and trigger navigation
 *
 *  If data-collapsible-disable="true" then we dont instantiate the menu as back end will do everything required
 *  to initialise it, the links on the menu are not stripped and no content is copied to the desktop view,
 *  exverything will be managed by back end
 *  Example: <div class="menu-tab" role="navigation" aria-label="page sub menu" data-collapsible-disable="true">
 *
 * Note: Content copied from mobile to desktop will have the id's stripped off input elements and any choice made within the desktop view will also be made on mobile to maintain state
 *
 * Note: If a collapsible menu occurs within a tab such as pl03-icon-expander we only initialise after tab is constructed and content displayed. Also the hash update will not occur within tabs.
 *
 * Structure:
 * .menu-tab > .menu-sub-menu > .menu-list > .menu-item > .menu-link
 * .menu-tab > .menu-sub-menu > .menu-list > .menu-item > .menu-mobile-content
 * .menu-tab > .menu-desktop-content
 *
 * Example structure of markup (menu-tab):
 * <div class="menu-tab">
        <div class="menu-sub-menu">
            <ul class="menu-list">
                <li class="menu-item is-active">
                    <a id="uid1" href="#uid1" class="menu-link">
                        <h2>Menu Item 1<span class="menu-link-chevron"></span></h2>
                    </a>
                    <div class="menu-mobile-content" aria-label="menu content">
                        <p>content 1</p>
                    </div>
                </li>
                <li class="menu-item">
                    <a id="uid2" href="#uid2" class="menu-link">
                        <h2>Menu Item 2<span class="menu-link-chevron"></span></h2>
                    </a>
                    <div class="menu-mobile-content" aria-label="menu content">
                        <p>content 2</p>
                    </div>
                </li>
            </ul>
        </div>
         <div class="row menu-desktop-content" aria-hidden="true">
             <!-- dynamic content injected from menu -->
             <p>
             Desktop Content
             </p>
         </div>
 </div>
 *
 * Example structure of markup (menu-footer-tab):
 * <div class="menu-footer-tab row" role="navigation" aria-label="footer links">

 <!-- Products -->
 <div class="medium-4 large-2 columns menu-footer-item">
     <div class="menu-link-wrapper">
         <a id="footer-products" href="#footer-products" class="menu-footer-link">
         <h3 class="menu-footer-title">Products</h3>
         </a>
     </div>
         <div class="menu-footer-content" aria-label="section links">
             <ul>
                 <li>
                 <a href="#" class="pl08-footer-nav-link" title="Accounts">Accounts</a>
                 </li>
                 <li>
                 <a href="#" class="pl08-footer-nav-link" title="Credit card">Credit card</a>
                 </li>
             </ul>
         </div>
     </div>
 </div>
 *
 * Example Usage:
 * $(".menu-tab").collapsibleMenu();
 * $(".menu-footer-tab").collapsibleMenu({   menu_tab: ".menu-footer-tab",
                                             menu_item: ".menu-footer-item",
                                             menu_link: ".menu-footer-link",
                                             menu_opened_initially: false
                                             });
 */

;(function ( $, window, document, undefined ) {

    //Global variables

    // Create the defaults once
    var pluginName = 'collapsibleMenu',
        defaults = {
            menu_tab : ".menu-tab", // top level menu container, contains the menu items
            menu_item : ".menu-item", // menu list item (gets the is-active applied after menu-link clicked)
            menu_link : ".menu-link-anchor", // menu link (a href)
            menu_mobile_content : ".menu-mobile-content", // menu items mobile content
            menu_desktop_content : ".menu-desktop-content", // desktop content container filled with mobile-content
            menu_opened_initially: true, // if menu is initially open, send false will open no menu items
            tab_container : ".tab-container" // name of tab container
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = element;
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;

        // a different menu type can be created which is constructed entirely by the back end, this means
        // no setup is required from front end, so when the menu is disabled we no longer strip
        // hrefs and load content as this is all done by back end and the links for the menu simply act as urls
        // and dont load the content of the mobile menu
        var menu_disable = $(this.element).data("collapsible-disable");
        if (menu_disable !== true) {
            // don't instantiate events if within a tab structure
            // as we need to do this after the tab content is rendered
            var withinTabContainer = $(this.element).closest(this.options.tab_container).length;
            if (!withinTabContainer || this.options.loadTabContentContainer){
                this.init();
            }
        }

    }

    Plugin.prototype.init = function () {
        var scope = this;

        //init events
        scope.setupEvents(scope);

        // strip href from each item so we don't navigate to element via hashtag anchor placement
        scope.removeHrefs(scope);

        // setup each menu-tab to open the first item if no location.hash required
        scope.initTab(scope);

        // add hash change monitoring to update the menu item when going back in the browser
        $(window).on("hashchange", $.proxy(scope.hashChanged, scope));

        // expose trigger event to inform all tabs when we have click on one
        // prevents hashchange from firing when clicking
        $(scope.element).bind("menuTabClicked", $.proxy(scope.menuTabClicked, scope));
        $(scope.element).bind("menuTabClickedDisabled", $.proxy(scope.menuTabClickedDisabled, scope));

    };

    // setup each menu-tab to open the first item if no location.hash required
    Plugin.prototype.initTab = function(scope) {
        var $menu_tab = $(scope.element); // menu-tab
        // check if location hash set and navigate to menu item if it is
        if (!scope.hasHash(scope, $menu_tab)){
            // only open if menu_opened_initially = true
            if (scope.options.menu_opened_initially) {
                // trigger first menu item if not navigating to a hash
                scope.triggerFirstMenuItem(scope, $menu_tab);
            }
        }
    };

    // add events to items
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        // wire up all general panels open/close
        var $menu_links = $el.find(scope.options.menu_link);
        $.each($menu_links, function(i, el) {
            $(el).click($.proxy(scope.menuClicked, scope));
        });
    };

    // strip href from all links
    Plugin.prototype.removeHrefs = function(scope) {
        var $el = $(scope.element);
        var $menu_links = $el.find(scope.options.menu_link);
        $.each($menu_links, function(i, el) {
            $(el).attr("href", "");
        });
    };

    // show menu item when clicked, adds is-active and copies mobile-content to desktop content
    Plugin.prototype.menuClicked = function(e) {
        var scope = this;
        var $menu_clicked = $(e.currentTarget);

        // prevent hashchange from triggering when clicking on a menu item
        $menu_tabs = $(scope.options.menu_tab);
        $.each($menu_tabs, function(i, menu_tab) {
            $(menu_tab).trigger("menuTabClicked");
        });

        // current menu tab
        $active_menu_tab = $menu_clicked.closest(scope.options.menu_tab);

        // current menu item
        $menu_item = $menu_clicked.parents(scope.options.menu_item);

        if (!$menu_item.hasClass("is-active")){

            // put the mobile content into the desktop view
            $menu_mobile_content = $menu_item.find(scope.options.menu_mobile_content);
            if ($menu_mobile_content.length){
                $menu_desktop_content = $(scope.element).find(scope.options.menu_desktop_content);

                // clear existing desktop content to flush events and bindings (manages garbage collection)
                $menu_desktop_content.find(".menu-desktop-inner").remove();
                $menu_desktop_content.html("<div class='menu-desktop-inner'></div>");
                $menu_desktop_content.find(".menu-desktop-inner").html($menu_mobile_content.html());

                // As the desktop content is copied from the mobile content their will be
                // situations when we need to instantiate content once the desktop view is rendered
                scope.bindInputsAndMaintainState(scope, $menu_mobile_content, $menu_desktop_content);
                scope.instantiateDesktopControllers(scope, $menu_mobile_content, $menu_desktop_content);
            }

            // remove all is-active's from other menus
            scope.deselectAllMenus(scope, $active_menu_tab);

            // add is-active to clicked menu
            $menu_item.addClass("is-active");

        }else{
            // if already active and on mobile allow menu to collapse
            if ($( window ).width() < 898) {
                // remove all is-active's from other menus
                scope.deselectAllMenus(scope, $active_menu_tab);
                e.preventDefault();
                e.stopPropagation();
                return;
            }
        }

        // only trigger scroll for menu-item clicked not for default triggered menu
        // and only update hash when collapsible menu is not within a tab
        var $tab_container = $menu_clicked.parents(scope.options.tab_container);
        if (scope.triggeredFirstMenuItem !== true && $tab_container.length === 0){
            // scroll to menu-item clicked
            var scrollTop = $("body").scrollTop();
            scope.scrollMenuItem(scope, $menu_item);
            window.location.hash = $menu_item.title;
            // on desktop don't scroll to hash clicked
            if ($( window ).width() >= 704) {
                $("body").scrollTop(scrollTop);
            }
        }
        scope.triggeredFirstMenuItem = false;

        // stop event propagation so that the hashchange does not trigger a page navigation
        e.preventDefault();
        e.stopPropagation();

        // reset menuItemClicked flag so that hash can respond to events if changed
        setTimeout(function(){
             $menu_tabs = $(scope.options.menu_tab);
             $.each($menu_tabs, function(i, menu_tab) {
                $(menu_tab).trigger("menuTabClickedDisabled");
             });
        },100);
    };

    // Handle maintaining input state in mobile and desktop views
    // anytime inputs change on desktop the mobile view is updated and the post back
    // uses the mobile name/value pairs as name is stripped from the desktop view
    // so as to not have duplicate form values
    Plugin.prototype.bindInputsAndMaintainState = function(scope, $menu_mobile_content, $menu_desktop_content) {

        // copy mobile input values to desktop view so state is maintained
        var $mobileInputs = $menu_mobile_content.find("input");
        if ($mobileInputs.length){
            $.each($mobileInputs, function(i, input) {
                var $this = $(this);
                $desktopInput = $($menu_desktop_content.find("input")[i]);
                var isCheckable = $this.is(':radio,:checkbox');
                if (isCheckable) {
                    $desktopInput.prop('checked', this.checked);
                } else {
                    $desktopInput.val($this.val());
                }
            });

            // when inputs change on desktop update the mobile view
            var $inputs = $menu_desktop_content.find("input");
            $.each($inputs, function(i, input) {
                // strip off id for desktop view
                $(input).attr("id", "");
                /* ":input" selector includes all form controls*/
                $(input).on("change", function(e){
                    // keep original form elements bound to desktop versions
                    var $this = $(this);
                    var bindingName = $this.attr("name");
                    var $bindingEl = $menu_mobile_content.find("[name='"+bindingName+"']");
                    var isCheckable = $this.is(':radio,:checkbox');
                    if (isCheckable) {
                        $bindingEl.prop('checked', this.checked);
                    } else {
                        $bindingEl.val($this.val());
                    }
                });
            });
        }

    };

    // instantiate interactive controllers (tabs, toggle-class, carousel, etc) within desktop view after being rendered
    Plugin.prototype.instantiateDesktopControllers = function(scope, $menu_mobile_content, $menu_desktop_content) {
        // re-activate the apply button and compare loans on desktop module
        $menu_desktop_content.find(".pl57-apply").applyButton({loadFromCollapsibleMenuDesktopView:true});
        $menu_desktop_content.find(".pl13-product-module").compareLoans({loadFromCollapsibleMenuDesktopView:true});
        // re-activate tabs
        $menu_desktop_content.find(".tab-container").tabMenu({loadFromCollapsibleMenuDesktopView:true});
        // re-activate toggles
        $menu_desktop_content.find("[data-toggle-target]").genericToggle({loadFromCollapsibleMenuDesktopView:true});
    };

    // scroll to menu-item clicked
    Plugin.prototype.scrollMenuItem = function(scope, $menu_item) {
        // scroll to menu item for mobile only
        if ($( window ).width() < 704) {
            setTimeout(function(){
                $("body").animate({scrollTop: $menu_item.offset().top}, 0);
            }, 0);
        }
    };

    // open the first menu-item
    Plugin.prototype.triggerFirstMenuItem = function(scope, $menu_tab) {
        // trigger first menu item
        scope.triggeredFirstMenuItem = true;
        $menu_tab.find(scope.options.menu_item + ":first-child " + scope.options.menu_link).trigger("click");
    };

    // Remove is-active from all menu-item's in menu-tab
    Plugin.prototype.deselectAllMenus = function(scope, $active_menu_tab) {
        $active_menu_tab.find(scope.options.menu_item).removeClass("is-active");
    };

    // check if returning to a particular location in a menu
    // Example www.url.com/#uid3
    Plugin.prototype.hasHash = function(scope, $menu_tab) {
        var $el = $(scope.element);
        // remove location # from hash string
        var locationTitle = window.location.hash.replace("#", "");
        $menu_link = $menu_tab.find(scope.options.menu_link+"[title='" + locationTitle + "']");
        if ($menu_link.length){
            var $menu_item = $menu_link.parents(scope.options.menu_item);
            if (!$menu_item.hasClass("is-active")){
                // open menu
                $menu_link.trigger("click");
            }else{
                // scroll to menu
                scope.scrollMenuItem(scope, $menu_item);
            }
            return true;
        }else{
            return false;
        }
    };

    // The hash has changed by either going back or manually changing it
    // Example www.url.com/#uid4
    Plugin.prototype.hashChanged = function() {
        scope = this;
        if (scope.menuItemClicked !== true){
            // confirm hash exists in menu (title)
            var locationTitle = window.location.hash.replace("#", "");
            $menu_link = $(this.element).find(scope.options.menu_link+"[title='" + locationTitle + "']");
            if ($menu_link.length) {
                scope.initTab(scope);
            }
        }
        scope.menuItemClicked = false;
    };

    /*****************************/
    // Public triggers
    /*****************************/

    // trigger menuTabClicked, informs all menu-tab that we have a click not a hashchange
    Plugin.prototype.menuTabClicked = function(e) {
        scope = this;
        scope.menuItemClicked = true;
    };
    // trigger menuTabClickedDisabled, reset menItemClicked
    Plugin.prototype.menuTabClickedDisabled = function(e) {
        scope = this;
        scope.menuItemClicked = false;
    };

    /*****************************/

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).ready(function() {
        //init on page automatically
        //$(".menu-tab").collapsibleMenu(); // Disabled for v1.3.14 - pl11 Tabs Update. Now uses jquery.jtabs.js
        $(".menu-footer-tab").collapsibleMenu({ menu_tab: ".menu-footer-tab",
            menu_item: ".menu-footer-item",
            menu_link: ".menu-footer-link",
            menu_opened_initially: false
        });
    });


})( jQuery, window, document );
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Carousel Menu Jquery Plugin
 *
 * Manages attaching the owl carousel to elements
 * owlOptions - can be passed in to setup the owl options
 * disableAfter - if set to false the owl carousel wont disable, else pass in a number,
 * example - 768 to disable the carousel above screen sizes of 768
 *
 * Dependencies:
 * Owl Carousel 1.3.2
 * http://owlgraphic.com/owlcarousel
 *
 */

;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'carousel',
        defaults = {
            owlOptions : { owlOptions:{
                                afterInit : function(elem){
                                    var that = this;
                                    that.owlControls.appendTo(elem);
                                },
                                stagePadding: 30,
                                loop:false,
                                margin:10,
                                navigation:false,
                                items : false, //0 items above 1113px browser width
                                itemsDesktop : [1113,3], //3 items between 1113px and 898px
                                itemsDesktopSmall : [897,2], // 2 items betweem 897px and 601px
                                itemsTablet: [600,1], //1 item between 600 and 0
                                itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
                            }},
            disableAfter : 897 // disable carousel after a a certain screen size, re-enables when reduced
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = element;
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.owlInstance = false;

        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;

        // window resize listener
        if (!(scope.options.disableAfter === undefined || scope.options.disableAfter === false)){
            if ($(window).width()<=scope.options.disableAfter){
                //create owl
                scope.createOwl(scope);
            }
            $(window).on("resize", $.proxy(scope.windowResize, scope));
        }else{
            //create owl
            scope.createOwl(scope);
        }

        // on resize adjust height to largest carousel item
        $(window).on("resize", scope.debounce($.proxy(scope.adjustHeight, scope)));

    };

    // adjust height based of maximum .owl-item height
    Plugin.prototype.adjustHeight = function(cat) {
    	var scope = this;
    	var $el = $(scope.element);
    	$el.find(".owl-wrapper-outer").css("height", "");
    	$el.find(".owl-item .pl09-hero-banner-carousel").css("height", "");
		var maxHeightOwlItem = 0;
		$el.find(".owl-item").each(function(i, el) {
			var itemHeight = $(el).height();
			if (itemHeight > maxHeightOwlItem) {
				maxHeightOwlItem = itemHeight;
			}
		});
		$el.find(".owl-wrapper-outer").height(maxHeightOwlItem);
		$el.find(".owl-item .pl09-hero-banner-carousel").height(maxHeightOwlItem);
	}

    // create owl
    Plugin.prototype.createOwl = function(scope) {
        var $el = $(scope.element);
        if (!scope.owlInstance){
            scope.owlInstance = $el.owlCarousel(scope.options.owlOptions).data('owlCarousel');
        }
    };

    // destroy owl
    Plugin.prototype.destroyOwl = function(scope) {
        if (scope.owlInstance){
            scope.owlInstance.destroy();
            scope.owlInstance = false;
        }
    };

    // Check if we owl carousel needs to be created or destroyed based on disableAfter breakpoint
    Plugin.prototype.windowResize = function() {
        scope = this;
        if ($(window).width()>scope.options.disableAfter){
            scope.destroyOwl(scope);
        }
        if ($(window).width()<=scope.options.disableAfter){
            scope.createOwl(scope);
        }
    };

    /**
	 * Debounce
	 * @param func
	 * @param duration
	 * @param timeout
	 * @returns {function}
	 */
	Plugin.prototype.debounce = function(func, duration, timeout) {
		return function() {
			var args = arguments;
			clearTimeout(timeout);
			timeout = setTimeout(function() {
				func.apply(null , args);
			}, duration || 200);
		};
	};

    /*****************************/
    // Public triggers
    /*****************************/

    // trigger menuTabClicked, informs all menu-tab that we have a click not a hashchange
    Plugin.prototype.menuTabClicked = function(e) {
        scope = this;
        scope.menuItemClicked = true;
    };
    // trigger menuTabClickedDisabled, reset menItemClicked
    Plugin.prototype.menuTabClickedDisabled = function(e) {
        scope = this;
        scope.menuItemClicked = false;
    };

    /*****************************/

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load',function() {
        //init on page automatically

        $(".pl18-portrait:not([class*=pl18-portrait-with-quote])").find(".pl18-portrait-carousel").carousel(
            { owlOptions:{
                afterInit : function(elem){
                    var that = this;
                    that.owlControls.appendTo(elem);
                },
                stagePadding: 30,
                loop:false,
                margin:10,
                navigation:false,
                items : false, //0 items above 1113px browser width
                itemsDesktop : [1113,3], //3 items between 1113px and 898px
                itemsDesktopSmall : [897,2], // 2 items betweem 897px and 601px
                itemsTablet: [600,1], //1 item between 600 and 0
                itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
            },
                disableAfter: 897
            }
        );

        $(".pl18-portrait-with-quote").find(".pl18-portrait-carousel").carousel(
            { owlOptions:{
                afterInit : function(elem){
                    var that = this;
                    that.owlControls.appendTo(elem);
                },
                stagePadding: 30,
                loop:false,
                margin:10,
                navigation:false,
                items : false, //0 items above 1113px browser width
                itemsDesktop : [1113,3], //3 items between 1113px and 898px
                itemsDesktopSmall : [897,2], // 2 items betweem 897px and 601px
                itemsTablet: [600,1], //1 item between 600 and 0
                itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
            },
                disableAfter: 897
            }
        );

        $('.pl55-3-column-text-carousel').carousel(
            { owlOptions:{
                afterInit : function(elem){
                    var that = this;
                    that.owlControls.appendTo(elem);
                },
                stagePadding: 30,
                loop:false,
                margin:10,
                navigation:false,
                items : false, //0 items above 1113px browser width
                itemsDesktop : [1113,3], //3 items between 1113px and 898px
                itemsDesktopSmall : [897,2], // 2 items betweem 897px and 601px
                itemsTablet: [600,1], //1 item between 600 and 0
                itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
            },
                disableAfter: 897
            }
        );

        $('.pl02-carousel-carousel').carousel(
            { owlOptions:{
                stagePadding: 30,
                margin:10,
                navigation:false, // Display "next" and "prev" buttons.
                singleItem:true,
                addClassActive: true, // Add "active" classes on visible items. Works with any numbers of items on screen
                autoPlay: true, // If you set autoPlay: true default speed will be 5 seconds.
                stopOnHover: true, // Stop autoplay on mouse hover
                autoHeight: false // Add height to owl-wrapper-outer so you can use diffrent heights on slides. Use it only for one item per page setting.
            },
                disableAfter: false // don't disable at certain breakpoints, so always show carousel
            }
        );

        /* Removed News Ticker Carousel
        $('.pl58-news-ticker-list').carousel(
            { owlOptions:{
                stagePadding: 30,
                loop:false,
                margin:10,
                navigation:false,
                pagination: false,
                addClassActive: true, // Add "active" classes on visible items. Works with any numbers of items on screen
                autoPlay: 8000, // If you set autoPlay: true default speed will be 5 seconds.
                stopOnHover: true, // Stop autoplay on mouse hover
                items : 2, //0 items above 1113px browser width
                itemsDesktop : [1113,2], //3 items between 1113px and 898px
                itemsDesktopSmall : [897,2], // 2 items betweem 897px and 601px
                itemsTablet: [600,1], //1 item between 600 and 0
                itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
            },
                disableAfter: false
            }
        );*/

        //Simple test to determine how many list items are present and whether or not owl carousel is added/removed accordingly
        //Rule is that if there is less than or equal to three items then there is no need to have owl carousel.
        var requiredListItems = $('li .pl04-icon-carousel-img');

        var testOutcome = "";

        (function(inputs){

            if(inputs.length > 3){
                testOutcome = false;

            } else {
                requiredListItems.parent().addClass('pl04-icon-carousel-limited-number');
                testOutcome = 897;
            }
        })(requiredListItems);

        $('.pl04-icon-carousel-container').carousel(
            { owlOptions:{
                stagePadding: 30,
                loop:false,
                margin:10,
                navigation:true,
                pagination: false,
                addClassActive: true, // Add "active" classes on visible items. Works with any numbers of items on screen
                stopOnHover: true, // Stop autoplay on mouse hover
                items : 4, //x items above 1113px browser width
                itemsDesktop : [1113,4], //x items between 1113px and 898px
                itemsDesktopSmall : [897,3], // x items betweem 897px and 601px
                itemsTablet: [600,2], //x item between 600 and 0
                itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
            },
                disableAfter: testOutcome,
                afterInit: (function () {
                    $('.pl04-icon-carousel-loading').hide();
                    $('.pl04-icon-carousel-wrapper').css("visibility", "visible");
                })()
            }
        );
    });

})( jQuery, window, document );
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Search Header, handles clicking on the search icon
 * focusing and resizing the field and submitting
 * attaches class "is-expand" to extend the search bar
 */
;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'searchHeader',
        defaults = {
            search_form_button: '.search-form-button',
            search_field : ".search-field"
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;
        //init events
        scope.setupEvents(scope);
    };

    // add events to items
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        var $search_form_button = $el.find(scope.options.search_form_button);
        $search_form_button.click(function(e){
            var $search_field = $el.find(scope.options.search_field);
            if ($search_field.val()===""){
                if ($el.hasClass("is-expand-search")) {
                    $el.removeClass("is-expand-search");
                }else{
                    $search_field.focus();
                    $el.addClass("is-expand-search");
                }
                e.preventDefault();
                e.stopPropagation();
            }
        });
        var $search_field = $el.find(scope.options.search_field);
        $search_field.focus(function(e){
            if (!$el.hasClass("is-expand-search")) {
                $el.addClass("is-expand-search");
            }
        });
        // hide search if clicking away after being active
        $search_field.blur(function(e){
            $el.removeClass("is-expand-search");
        });
    };

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load',function() {
        $(".pl01-header").searchHeader();
    });

})( jQuery, window, document );
;
/*
Version: 2.1.8
Date:2017-09-11
 */
!function(a,b,c,d){"use strict";function e(a){return("string"==typeof a||a instanceof String)&&(a=a.replace(/^['\\/"]+|(;\s?})+|['\\/"]+$/g,"")),a}var f=function(b){for(var c=b.length,d=a("head");c--;)0===d.has("."+b[c]).length&&d.append('<meta class="'+b[c]+'" />')};f(["foundation-mq-small","foundation-mq-medium","foundation-mq-large","foundation-mq-xlarge","foundation-mq-xxlarge","foundation-data-attribute-namespace"]),a(function(){"undefined"!=typeof FastClick&&"undefined"!=typeof c.body&&FastClick.attach(c.body)});var g=function(b,d){if("string"==typeof b){if(d){var e;if(d.jquery){if(e=d[0],!e)return d}else e=d;return a(e.querySelectorAll(b))}return a(c.querySelectorAll(b))}return a(b,d)},h=function(a){var b=[];return a||b.push("data"),this.namespace.length>0&&b.push(this.namespace),b.push(this.name),b.join("-")},i=function(a){for(var b=a.split("-"),c=b.length,d=[];c--;)0!==c?d.push(b[c]):this.namespace.length>0?d.push(this.namespace,b[c]):d.push(b[c]);return d.reverse().join("-")},j=function(b,c){var d=this,e=!g(this).data(this.attr_name(!0));return g(this.scope).is("["+this.attr_name()+"]")?(g(this.scope).data(this.attr_name(!0)+"-init",a.extend({},this.settings,c||b,this.data_options(g(this.scope)))),e&&this.events(this.scope)):g("["+this.attr_name()+"]",this.scope).each(function(){var e=!g(this).data(d.attr_name(!0)+"-init");g(this).data(d.attr_name(!0)+"-init",a.extend({},d.settings,c||b,d.data_options(g(this)))),e&&d.events(this)}),"string"==typeof b?this[b].call(this,c):void 0},k=function(a,b){function c(){b(a[0])}function d(){if(this.one("load",c),/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var a=this.attr("src"),b=a.match(/\?/)?"&":"?";b+="random="+(new Date).getTime(),this.attr("src",a+b)}}return a.attr("src")?void(a[0].complete||4===a[0].readyState?c():d.call(a)):void c()};b.matchMedia=b.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='&shy;<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(c),function(){function a(){c&&(f(a),h&&jQuery.fx.tick())}for(var c,d=0,e=["webkit","moz"],f=b.requestAnimationFrame,g=b.cancelAnimationFrame,h="undefined"!=typeof jQuery.fx;d<e.length&&!f;d++)f=b[e[d]+"RequestAnimationFrame"],g=g||b[e[d]+"CancelAnimationFrame"]||b[e[d]+"CancelRequestAnimationFrame"];f?(b.requestAnimationFrame=f,b.cancelAnimationFrame=g,h&&(jQuery.fx.timer=function(b){b()&&jQuery.timers.push(b)&&!c&&(c=!0,a())},jQuery.fx.stop=function(){c=!1})):(b.requestAnimationFrame=function(a){var c=(new Date).getTime(),e=Math.max(0,16-(c-d)),f=b.setTimeout(function(){a(c+e)},e);return d=c+e,f},b.cancelAnimationFrame=function(a){clearTimeout(a)})}(jQuery),b.Foundation={name:"Foundation",version:"5.3.1",media_queries:{small:g(".foundation-mq-small").css("font-family").replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g,""),medium:g(".foundation-mq-medium").css("font-family").replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g,""),large:g(".foundation-mq-large").css("font-family").replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g,""),xlarge:g(".foundation-mq-xlarge").css("font-family").replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g,""),xxlarge:g(".foundation-mq-xxlarge").css("font-family").replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g,"")},stylesheet:a("<style></style>").appendTo("head")[0].sheet,global:{namespace:d},init:function(a,b,c,d,e){var f=[a,c,d,e],h=[];if(this.rtl=/rtl/i.test(g("html").attr("dir")),this.scope=a||this.scope,this.set_namespace(),b&&"string"==typeof b&&!/reflow/i.test(b))this.libs.hasOwnProperty(b)&&h.push(this.init_lib(b,f));else for(var i in this.libs)h.push(this.init_lib(i,b));return a},init_lib:function(b,c){return this.libs.hasOwnProperty(b)?(this.patch(this.libs[b]),c&&c.hasOwnProperty(b)?("undefined"!=typeof this.libs[b].settings?a.extend(!0,this.libs[b].settings,c[b]):"undefined"!=typeof this.libs[b].defaults&&a.extend(!0,this.libs[b].defaults,c[b]),this.libs[b].init.apply(this.libs[b],[this.scope,c[b]])):(c=c instanceof Array?c:new Array(c),this.libs[b].init.apply(this.libs[b],c))):function(){}},patch:function(a){a.scope=this.scope,a.namespace=this.global.namespace,a.rtl=this.rtl,a.data_options=this.utils.data_options,a.attr_name=h,a.add_namespace=i,a.bindings=j,a.S=this.utils.S},inherit:function(a,b){for(var c=b.split(" "),d=c.length;d--;)this.utils.hasOwnProperty(c[d])&&(a[c[d]]=this.utils[c[d]])},set_namespace:function(){var b=this.global.namespace===d?a(".foundation-data-attribute-namespace").css("font-family"):this.global.namespace;this.global.namespace=b===d||/false/i.test(b)?"":b},libs:{},utils:{S:g,throttle:function(a,b){var c=null;return function(){var d=this,e=arguments;null==c&&(c=setTimeout(function(){a.apply(d,e),c=null},b))}},debounce:function(a,b,c){var d,e;return function(){var f=this,g=arguments,h=function(){d=null,c||(e=a.apply(f,g))},i=c&&!d;return clearTimeout(d),d=setTimeout(h,b),i&&(e=a.apply(f,g)),e}},data_options:function(b,c){function d(a){return!isNaN(a-0)&&null!==a&&""!==a&&a!==!1&&a!==!0}function e(b){return"string"==typeof b?a.trim(b):b}c=c||"options";var f,g,h,i={},j=function(a){var b=Foundation.global.namespace;return a.data(b.length>0?b+"-"+c:c)},k=j(b);if("object"==typeof k)return k;for(h=(k||":").split(";"),f=h.length;f--;)g=h[f].split(":"),g=[g[0],g.slice(1).join(":")],/true/i.test(g[1])&&(g[1]=!0),/false/i.test(g[1])&&(g[1]=!1),d(g[1])&&(g[1]=-1===g[1].indexOf(".")?parseInt(g[1],10):parseFloat(g[1])),2===g.length&&g[0].length>0&&(i[e(g[0])]=e(g[1]));return i},register_media:function(b,c){Foundation.media_queries[b]===d&&(a("head").append('<meta class="'+c+'"/>'),Foundation.media_queries[b]=e(a("."+c).css("font-family")))},add_custom_rule:function(a,b){if(b===d&&Foundation.stylesheet)Foundation.stylesheet.insertRule(a,Foundation.stylesheet.cssRules.length);else{var c=Foundation.media_queries[b];c!==d&&Foundation.stylesheet.insertRule("@media "+Foundation.media_queries[b]+"{ "+a+" }")}},image_loaded:function(a,b){var c=this,d=a.length;0===d&&b(a),a.each(function(){k(c.S(this),function(){d-=1,0===d&&b(a)})})},random_str:function(){return this.fidx||(this.fidx=0),this.prefix=this.prefix||[this.name||"F",(+new Date).toString(36)].join("-"),this.prefix+(this.fidx++).toString(36)}}},a.fn.foundation=function(){var a=Array.prototype.slice.call(arguments,0);return this.each(function(){return Foundation.init.apply(Foundation,[this].concat(a)),this})}}(jQuery,window,window.document),function(a,b,c){"use strict";Foundation.libs.abide={name:"abide",version:"5.3.3",settings:{live_validate:!0,focus_on_invalid:!0,error_labels:!0,timeout:1e3,patterns:{alpha:/^[a-zA-Z]+$/,alpha_numeric:/^[a-zA-Z0-9]+$/,integer:/^[-+]?\d+$/,number:/^[-+]?\d*(?:[\.\,]\d+)?$/,card:/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,cvv:/^([0-9]){3,4}$/,email:/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,url:/^(https?|ftp|file|ssh):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/,domain:/^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$/,datetime:/^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/,date:/(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/,time:/^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,dateISO:/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,month_day_year:/^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/,color:/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/},validators:{equalTo:function(a){var b=c.getElementById(a.getAttribute(this.add_namespace("data-equalto"))).value,d=a.value,e=b===d;return e}}},timer:null,init:function(a,b,c){this.bindings(b,c)},events:function(b){var c=this,d=c.S(b).attr("novalidate","novalidate"),e=d.data(this.attr_name(!0)+"-init")||{};this.invalid_attr=this.add_namespace("data-invalid"),d.off(".abide").on("submit.fndtn.abide validate.fndtn.abide",function(a){var b=/ajax/i.test(c.S(this).attr(c.attr_name()));return c.validate(c.S(this).find("input, textarea, select").get(),a,b)}).on("reset",function(){return c.reset(a(this))}).find("input, textarea, select").off(".abide").on("blur.fndtn.abide change.fndtn.abide",function(a){c.validate([this],a)}).on("keydown.fndtn.abide",function(a){e.live_validate===!0&&(clearTimeout(c.timer),c.timer=setTimeout(function(){c.validate([this],a)}.bind(this),e.timeout))})},reset:function(b){b.removeAttr(this.invalid_attr),a(this.invalid_attr,b).removeAttr(this.invalid_attr),a(".error",b).not("small").removeClass("error")},validate:function(a,b,c){for(var d=this.parse_patterns(a),e=d.length,f=this.S(a[0]).closest("form"),g=/submit/.test(b.type),h=0;e>h;h++)if(!d[h]&&(g||c))return this.settings.focus_on_invalid&&a[h].focus(),f.trigger("invalid"),this.S(a[h]).closest("form").attr(this.invalid_attr,""),!1;return(g||c)&&f.trigger("valid"),f.removeAttr(this.invalid_attr),c?!1:!0},parse_patterns:function(a){for(var b=a.length,c=[];b--;)c.push(this.pattern(a[b]));return this.check_validation_and_apply_styles(c)},pattern:function(a){var b=a.getAttribute("type"),c="string"==typeof a.getAttribute("required"),d=a.getAttribute("pattern")||"";return this.settings.patterns.hasOwnProperty(d)&&d.length>0?[a,this.settings.patterns[d],c]:d.length>0?[a,new RegExp(d),c]:this.settings.patterns.hasOwnProperty(b)?[a,this.settings.patterns[b],c]:(d=/.*/,[a,d,c])},check_validation_and_apply_styles:function(b){var c=b.length,d=[],e=this.S(b[0][0]).closest("[data-"+this.attr_name(!0)+"]");for(e.data(this.attr_name(!0)+"-init")||{};c--;){var f,g,h=b[c][0],i=b[c][2],j=h.value.trim(),k=this.S(h).parent(),l=h.getAttribute(this.add_namespace("data-abide-validator")),m="radio"===h.type,n="checkbox"===h.type,o=this.S('label[for="'+h.getAttribute("id")+'"]'),p=i?h.value.length>0:!0;h.getAttribute(this.add_namespace("data-equalto"))&&(l="equalTo"),f=k.is("label")?k.parent():k,m&&i?d.push(this.valid_radio(h,i)):n&&i?d.push(this.valid_checkbox(h,i)):(l&&(g=this.settings.validators[l].apply(this,[h,i,f]),d.push(g)),d.push(b[c][1].test(j)&&p||!i&&h.value.length<1||a(h).attr("disabled")?!0:!1),d=[d.every(function(a){return a})],d[0]?(this.S(h).removeAttr(this.invalid_attr),f.removeClass("error"),o.length>0&&this.settings.error_labels&&o.removeClass("error"),a(h).triggerHandler("valid")):(f.addClass("error"),this.S(h).attr(this.invalid_attr,""),o.length>0&&this.settings.error_labels&&o.addClass("error"),a(h).triggerHandler("invalid")))}return d},valid_checkbox:function(a,b){var a=this.S(a),c=a.is(":checked")||!b;return c?a.removeAttr(this.invalid_attr).parent().removeClass("error"):a.attr(this.invalid_attr,"").parent().addClass("error"),c},valid_radio:function(a){for(var b=a.getAttribute("name"),c=this.S(a).closest("[data-"+this.attr_name(!0)+"]").find("[name='"+b+"']"),d=c.length,e=!1,f=0;d>f;f++)c[f].checked&&(e=!0);for(var f=0;d>f;f++)e?this.S(c[f]).removeAttr(this.invalid_attr).parent().removeClass("error"):this.S(c[f]).attr(this.invalid_attr,"").parent().addClass("error");return e},valid_equal:function(a,b,d){var e=c.getElementById(a.getAttribute(this.add_namespace("data-equalto"))).value,f=a.value,g=e===f;return g?(this.S(a).removeAttr(this.invalid_attr),d.removeClass("error")):(this.S(a).attr(this.invalid_attr,""),d.addClass("error")),g},valid_oneof:function(a,b,c,d){var a=this.S(a),e=this.S("["+this.add_namespace("data-oneof")+"]"),f=e.filter(":checked").length>0;if(f?a.removeAttr(this.invalid_attr).parent().removeClass("error"):a.attr(this.invalid_attr,"").parent().addClass("error"),!d){var g=this;e.each(function(){g.valid_oneof.call(g,this,null,null,!0)})}return f}}}(jQuery,window,window.document),function(a){"use strict";Foundation.libs.accordion={name:"accordion",version:"5.3.3",settings:{active_class:"active",multi_expand:!1,toggleable:!0,callback:function(){}},init:function(a,b,c){this.bindings(b,c)},events:function(){var b=this,c=this.S;c(this.scope).off(".fndtn.accordion").on("click.fndtn.accordion","["+this.attr_name()+"] > dd > a",function(d){var e=c(this).closest("["+b.attr_name()+"]"),f=b.attr_name()+"="+e.attr(b.attr_name()),g=e.data(b.attr_name(!0)+"-init"),h=c("#"+this.href.split("#")[1]),i=a("> dd",e),j=i.children(".content"),k=j.filter("."+g.active_class);return d.preventDefault(),e.attr(b.attr_name())&&(j=j.add("["+f+"] dd > .content"),i=i.add("["+f+"] dd")),g.toggleable&&h.is(k)?(h.parent("dd").toggleClass(g.active_class,!1),h.toggleClass(g.active_class,!1),g.callback(h),h.triggerHandler("toggled",[e]),void e.triggerHandler("toggled",[h])):(g.multi_expand||(j.removeClass(g.active_class),i.removeClass(g.active_class)),h.addClass(g.active_class).parent().addClass(g.active_class),g.callback(h),h.triggerHandler("toggled",[e]),void e.triggerHandler("toggled",[h]))})},off:function(){},reflow:function(){}}}(jQuery,window,window.document),function(a){"use strict";Foundation.libs.alert={name:"alert",version:"5.3.3",settings:{callback:function(){}},init:function(a,b,c){this.bindings(b,c)},events:function(){var b=this,c=this.S;a(this.scope).off(".alert").on("click.fndtn.alert","["+this.attr_name()+"] a.close",function(a){var d=c(this).closest("["+b.attr_name()+"]"),e=d.data(b.attr_name(!0)+"-init")||b.settings;a.preventDefault(),Modernizr.csstransitions?(d.addClass("alert-close"),d.on("transitionend webkitTransitionEnd oTransitionEnd",function(){c(this).trigger("close").trigger("close.fndtn.alert").remove(),e.callback()})):d.fadeOut(300,function(){c(this).trigger("close").trigger("close.fndtn.alert").remove(),e.callback()})})},reflow:function(){}}}(jQuery,window,window.document),function(a,b,c,d){"use strict";Foundation.libs.clearing={name:"clearing",version:"5.3.3",settings:{templates:{viewing:'<a href="#" class="clearing-close">&times;</a><div class="visible-img" style="display: none"><div class="clearing-touch-label"></div><img src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D" alt="" /><p class="clearing-caption"></p><a href="#" class="clearing-main-prev"><span></span></a><a href="#" class="clearing-main-next"><span></span></a></div>'},close_selectors:".clearing-close, div.clearing-blackout",open_selectors:"",skip_selector:"",touch_label:"",init:!1,locked:!1},init:function(a,b,c){var d=this;Foundation.inherit(this,"throttle image_loaded"),this.bindings(b,c),d.S(this.scope).is("["+this.attr_name()+"]")?this.assemble(d.S("li",this.scope)):d.S("["+this.attr_name()+"]",this.scope).each(function(){d.assemble(d.S("li",this))})},events:function(d){var e=this,f=e.S,g=a(".scroll-container");g.length>0&&(this.scope=g),f(this.scope).off(".clearing").on("click.fndtn.clearing","ul["+this.attr_name()+"] li "+this.settings.open_selectors,function(a,b,c){var b=b||f(this),c=c||b,d=b.next("li"),g=b.closest("["+e.attr_name()+"]").data(e.attr_name(!0)+"-init"),h=f(a.target);a.preventDefault(),g||(e.init(),g=b.closest("["+e.attr_name()+"]").data(e.attr_name(!0)+"-init")),c.hasClass("visible")&&b[0]===c[0]&&d.length>0&&e.is_open(b)&&(c=d,h=f("img",c)),e.open(h,b,c),e.update_paddles(c)}).on("click.fndtn.clearing",".clearing-main-next",function(a){e.nav(a,"next")}).on("click.fndtn.clearing",".clearing-main-prev",function(a){e.nav(a,"prev")}).on("click.fndtn.clearing",this.settings.close_selectors,function(a){Foundation.libs.clearing.close(a,this)}),a(c).on("keydown.fndtn.clearing",function(a){e.keydown(a)}),f(b).off(".clearing").on("resize.fndtn.clearing",function(){e.resize()}),this.swipe_events(d)},swipe_events:function(){var a=this,b=a.S;b(this.scope).on("touchstart.fndtn.clearing",".visible-img",function(a){a.touches||(a=a.originalEvent);var c={start_page_x:a.touches[0].pageX,start_page_y:a.touches[0].pageY,start_time:(new Date).getTime(),delta_x:0,is_scrolling:d};b(this).data("swipe-transition",c),a.stopPropagation()}).on("touchmove.fndtn.clearing",".visible-img",function(c){if(c.touches||(c=c.originalEvent),!(c.touches.length>1||c.scale&&1!==c.scale)){var d=b(this).data("swipe-transition");if("undefined"==typeof d&&(d={}),d.delta_x=c.touches[0].pageX-d.start_page_x,Foundation.rtl&&(d.delta_x=-d.delta_x),"undefined"==typeof d.is_scrolling&&(d.is_scrolling=!!(d.is_scrolling||Math.abs(d.delta_x)<Math.abs(c.touches[0].pageY-d.start_page_y))),!d.is_scrolling&&!d.active){c.preventDefault();var e=d.delta_x<0?"next":"prev";d.active=!0,a.nav(c,e)}}}).on("touchend.fndtn.clearing",".visible-img",function(a){b(this).data("swipe-transition",{}),a.stopPropagation()})},assemble:function(b){var c=b.parent();if(!c.parent().hasClass("carousel")){c.after('<div id="foundationClearingHolder"></div>');var d=c.detach(),e="";if(null!=d[0]){e=d[0].outerHTML;var f=this.S("#foundationClearingHolder"),g=c.data(this.attr_name(!0)+"-init"),h={grid:'<div class="carousel">'+e+"</div>",viewing:g.templates.viewing},i='<div class="clearing-assembled"><div>'+h.viewing+h.grid+"</div></div>",j=this.settings.touch_label;Modernizr.touch&&(i=a(i).find(".clearing-touch-label").html(j).end()),f.after(i).remove()}}},open:function(b,d,e){function f(){setTimeout(function(){this.image_loaded(m,function(){1!==m.outerWidth()||o?g.call(this,m):f.call(this)}.bind(this))}.bind(this),100)}function g(b){var c=a(b);c.css("visibility","visible"),i.css("overflow","hidden"),j.addClass("clearing-blackout"),k.addClass("clearing-container"),l.show(),this.fix_height(e).caption(h.S(".clearing-caption",l),h.S("img",e)).center_and_label(b,n).shift(d,e,function(){e.closest("li").siblings().removeClass("visible"),e.closest("li").addClass("visible")}),l.trigger("opened.fndtn.clearing")}var h=this,i=a(c.body),j=e.closest(".clearing-assembled"),k=h.S("div",j).first(),l=h.S(".visible-img",k),m=h.S("img",l).not(b),n=h.S(".clearing-touch-label",k),o=!1;a("body").on("touchmove",function(a){a.preventDefault()}),m.error(function(){o=!0}),this.locked()||(l.trigger("open.fndtn.clearing"),m.attr("src",this.load(b)).css("visibility","hidden"),f.call(this))},close:function(b,d){b.preventDefault();var e,f,g=function(a){return/blackout/.test(a.selector)?a:a.closest(".clearing-blackout")}(a(d)),h=a(c.body);return d===b.target&&g&&(h.css("overflow",""),e=a("div",g).first(),f=a(".visible-img",e),f.trigger("close.fndtn.clearing"),this.settings.prev_index=0,a("ul["+this.attr_name()+"]",g).attr("style","").closest(".clearing-blackout").removeClass("clearing-blackout"),e.removeClass("clearing-container"),f.hide(),f.trigger("closed.fndtn.clearing")),a("body").off("touchmove"),!1},is_open:function(a){return a.parent().prop("style").length>0},keydown:function(b){var c=a(".clearing-blackout ul["+this.attr_name()+"]"),d=this.rtl?37:39,e=this.rtl?39:37,f=27;b.which===d&&this.go(c,"next"),b.which===e&&this.go(c,"prev"),b.which===f&&this.S("a.clearing-close").trigger("click").trigger("click.fndtn.clearing")},nav:function(b,c){var d=a("ul["+this.attr_name()+"]",".clearing-blackout");b.preventDefault(),this.go(d,c)},resize:function(){var b=a("img",".clearing-blackout .visible-img"),c=a(".clearing-touch-label",".clearing-blackout");b.length&&(this.center_and_label(b,c),b.trigger("resized.fndtn.clearing"))},fix_height:function(a){var b=a.parent().children(),c=this;return b.each(function(){var a=c.S(this),b=a.find("img");a.height()>b.outerHeight()&&a.addClass("fix-height")}).closest("ul").width(100*b.length+"%"),this},update_paddles:function(a){a=a.closest("li");var b=a.closest(".carousel").siblings(".visible-img");a.next().length>0?this.S(".clearing-main-next",b).removeClass("disabled"):this.S(".clearing-main-next",b).addClass("disabled"),a.prev().length>0?this.S(".clearing-main-prev",b).removeClass("disabled"):this.S(".clearing-main-prev",b).addClass("disabled")},center_and_label:function(a,b){return this.rtl?(a.css({marginRight:-(a.outerWidth()/2),marginTop:-(a.outerHeight()/2),left:"auto",right:"50%"}),b.length>0&&b.css({marginRight:-(b.outerWidth()/2),marginTop:-(a.outerHeight()/2)-b.outerHeight()-10,left:"auto",right:"50%"})):(a.css({marginLeft:-(a.outerWidth()/2),marginTop:-(a.outerHeight()/2)}),b.length>0&&b.css({marginLeft:-(b.outerWidth()/2),marginTop:-(a.outerHeight()/2)-b.outerHeight()-10})),this},load:function(a){var b;return b="A"===a[0].nodeName?a.attr("href"):a.parent().attr("href"),this.preload(a),b?b:a.attr("src")},preload:function(a){this.img(a.closest("li").next()).img(a.closest("li").prev())},img:function(a){if(a.length){var b=new Image,c=this.S("a",a);b.src=c.length?c.attr("href"):this.S("img",a).attr("src")}return this},caption:function(a,b){var c=b.attr("data-caption");return c?a.html(c).show():a.text("").hide(),this},go:function(a,b){var c=this.S(".visible",a),d=c[b]();this.settings.skip_selector&&0!=d.find(this.settings.skip_selector).length&&(d=d[b]()),d.length&&this.S("img",d).trigger("click",[c,d]).trigger("click.fndtn.clearing",[c,d]).trigger("change.fndtn.clearing")},shift:function(a,b,c){var d,e=b.parent(),f=this.settings.prev_index||b.index(),g=this.direction(e,a,b),h=this.rtl?"right":"left",i=parseInt(e.css("left"),10),j=b.outerWidth(),k={};b.index()===f||/skip/.test(g)?/skip/.test(g)&&(d=b.index()-this.settings.up_count,this.lock(),d>0?(k[h]=-(d*j),e.animate(k,300,this.unlock())):(k[h]=0,e.animate(k,300,this.unlock()))):/left/.test(g)?(this.lock(),k[h]=i+j,e.animate(k,300,this.unlock())):/right/.test(g)&&(this.lock(),k[h]=i-j,e.animate(k,300,this.unlock())),c()},direction:function(a,b,c){var d,e=this.S("li",a),f=e.outerWidth()+e.outerWidth()/4,g=Math.floor(this.S(".clearing-container").outerWidth()/f)-1,h=e.index(c);return this.settings.up_count=g,d=this.adjacent(this.settings.prev_index,h)?h>g&&h>this.settings.prev_index?"right":h>g-1&&h<=this.settings.prev_index?"left":!1:"skip",this.settings.prev_index=h,d},adjacent:function(a,b){for(var c=b+1;c>=b-1;c--)if(c===a)return!0;return!1},lock:function(){this.settings.locked=!0},unlock:function(){this.settings.locked=!1},locked:function(){return this.settings.locked},off:function(){this.S(this.scope).off(".fndtn.clearing"),this.S(b).off(".fndtn.clearing")},reflow:function(){this.init()}}}(jQuery,window,window.document),function(a,b){"use strict";Foundation.libs.dropdown={name:"dropdown",version:"5.3.3",settings:{active_class:"open",align:"bottom",is_hover:!1,opened:function(){},closed:function(){}},init:function(a,b,c){Foundation.inherit(this,"throttle"),this.bindings(b,c)},events:function(){var c=this,d=c.S;d(this.scope).off(".dropdown").on("click.fndtn.dropdown","["+this.attr_name()+"]",function(b){var e=d(this).data(c.attr_name(!0)+"-init")||c.settings;(!e.is_hover||Modernizr.touch)&&(b.preventDefault(),c.toggle(a(this)))}).on("mouseenter.fndtn.dropdown","["+this.attr_name()+"], ["+this.attr_name()+"-content]",function(a){var b,e,f=d(this);clearTimeout(c.timeout),f.data(c.data_attr())?(b=d("#"+f.data(c.data_attr())),e=f):(b=f,e=d("["+c.attr_name()+"='"+b.attr("id")+"']"));var g=e.data(c.attr_name(!0)+"-init")||c.settings;d(a.target).data(c.data_attr())&&g.is_hover&&c.closeall.call(c),g.is_hover&&c.open.apply(c,[b,e])}).on("mouseleave.fndtn.dropdown","["+this.attr_name()+"], ["+this.attr_name()+"-content]",function(){var a=d(this);c.timeout=setTimeout(function(){if(a.data(c.data_attr())){var b=a.data(c.data_attr(!0)+"-init")||c.settings;b.is_hover&&c.close.call(c,d("#"+a.data(c.data_attr())))}else{var e=d("["+c.attr_name()+'="'+d(this).attr("id")+'"]'),b=e.data(c.attr_name(!0)+"-init")||c.settings;b.is_hover&&c.close.call(c,a)}}.bind(this),150)}).on("click.fndtn.dropdown",function(b){var e=d(b.target).closest("["+c.attr_name()+"-content]");if(!(d(b.target).closest("["+c.attr_name()+"]").length>0))return!d(b.target).data("revealId")&&e.length>0&&(d(b.target).is("["+c.attr_name()+"-content]")||a.contains(e.first()[0],b.target))?void b.stopPropagation():void c.close.call(c,d("["+c.attr_name()+"-content]"))}).on("opened.fndtn.dropdown","["+c.attr_name()+"-content]",function(){c.settings.opened.call(this)}).on("closed.fndtn.dropdown","["+c.attr_name()+"-content]",function(){c.settings.closed.call(this)}),d(b).off(".dropdown").on("resize.fndtn.dropdown",c.throttle(function(){c.resize.call(c)},50)),this.resize()},close:function(a){var b=this;a.each(function(){b.S(this).hasClass(b.settings.active_class)&&(b.S(this).css(Foundation.rtl?"right":"left","-99999px").removeClass(b.settings.active_class).prev("["+b.attr_name()+"]").removeClass(b.settings.active_class).removeData("target"),b.S(this).trigger("closed").trigger("closed.fndtn.dropdown",[a]))})},closeall:function(){var b=this;a.each(b.S("["+this.attr_name()+"-content]"),function(){b.close.call(b,b.S(this))})},open:function(a,b){this.css(a.addClass(this.settings.active_class),b),a.prev("["+this.attr_name()+"]").addClass(this.settings.active_class),a.data("target",b.get(0)).trigger("opened").trigger("opened.fndtn.dropdown",[a,b])},data_attr:function(){return this.namespace.length>0?this.namespace+"-"+this.name:this.name},toggle:function(a){var b=this.S("#"+a.data(this.data_attr()));0!==b.length&&(this.close.call(this,this.S("["+this.attr_name()+"-content]").not(b)),b.hasClass(this.settings.active_class)?(this.close.call(this,b),b.data("target")!==a.get(0)&&this.open.call(this,b,a)):this.open.call(this,b,a))},resize:function(){var a=this.S("["+this.attr_name()+"-content].open"),b=this.S("["+this.attr_name()+"='"+a.attr("id")+"']");a.length&&b.length&&this.css(a,b)},css:function(a,b){var c=Math.max((b.width()-a.width())/2,8);if(this.clear_idx(),this.small()){var d=this.dirs.bottom.call(a,b);a.attr("style","").removeClass("drop-left drop-right drop-top").css({position:"absolute",width:"95%","max-width":"none",top:d.top}),a.css(Foundation.rtl?"right":"left",c)}else{var e=b.data(this.attr_name(!0)+"-init")||this.settings;this.style(a,b,e)}return a},style:function(b,c,d){var e=a.extend({position:"absolute"},this.dirs[d.align].call(b,c,d));b.attr("style","").css(e)},dirs:{_base:function(a){var b=this.offsetParent(),c=b.offset(),d=a.offset();return d.top-=c.top,d.left-=c.left,d},top:function(a){var b=Foundation.libs.dropdown,c=b.dirs._base.call(this,a),d=8;return this.addClass("drop-top"),(a.outerWidth()<this.outerWidth()||b.small())&&b.adjust_pip(d,c),Foundation.rtl?{left:c.left-this.outerWidth()+a.outerWidth(),top:c.top-this.outerHeight()}:{left:c.left,top:c.top-this.outerHeight()}},bottom:function(a){var b=Foundation.libs.dropdown,c=b.dirs._base.call(this,a),d=8;return(a.outerWidth()<this.outerWidth()||b.small())&&b.adjust_pip(d,c),b.rtl?{left:c.left-this.outerWidth()+a.outerWidth(),top:c.top+a.outerHeight()}:{left:c.left,top:c.top+a.outerHeight()}},left:function(a){var b=Foundation.libs.dropdown.dirs._base.call(this,a);return this.addClass("drop-left"),{left:b.left-this.outerWidth(),top:b.top}},right:function(a){var b=Foundation.libs.dropdown.dirs._base.call(this,a);return this.addClass("drop-right"),{left:b.left+a.outerWidth(),top:b.top}}},adjust_pip:function(a,b){var c=Foundation.stylesheet;this.small()&&(a+=b.left-8),this.rule_idx=c.cssRules.length;var d=".f-dropdown.open:before",e=".f-dropdown.open:after",f="left: "+a+"px;",g="left: "+(a-1)+"px;";c.insertRule?(c.insertRule([d,"{",f,"}"].join(" "),this.rule_idx),c.insertRule([e,"{",g,"}"].join(" "),this.rule_idx+1)):(c.addRule(d,f,this.rule_idx),c.addRule(e,g,this.rule_idx+1))},clear_idx:function(){var a=Foundation.stylesheet;this.rule_idx&&(a.deleteRule(this.rule_idx),a.deleteRule(this.rule_idx),delete this.rule_idx)},small:function(){return matchMedia(Foundation.media_queries.small).matches&&!matchMedia(Foundation.media_queries.medium).matches},off:function(){this.S(this.scope).off(".fndtn.dropdown"),this.S("html, body").off(".fndtn.dropdown"),this.S(b).off(".fndtn.dropdown"),this.S("[data-dropdown-content]").off(".fndtn.dropdown")},reflow:function(){}}}(jQuery,window,window.document),function(a,b){"use strict";Foundation.libs.equalizer={name:"equalizer",version:"5.3.3",settings:{use_tallest:!0,before_height_change:a.noop,after_height_change:a.noop,equalize_on_stack:!1},init:function(a,b,c){Foundation.inherit(this,"image_loaded"),this.bindings(b,c),this.reflow()},events:function(){this.S(b).off(".equalizer").on("resize.fndtn.equalizer",function(){this.reflow()}.bind(this))},equalize:function(b){var c=!1,d=b.find("["+this.attr_name()+"-watch]:visible"),e=b.data(this.attr_name(!0)+"-init");if(0!==d.length){var f=d.first().offset().top;if(e.before_height_change(),b.trigger("before-height-change").trigger("before-height-change.fndth.equalizer"),d.height("inherit"),d.each(function(){var b=a(this);b.offset().top!==f&&(c=!0)}),e.equalize_on_stack!==!1||!c){var g=d.map(function(){return a(this).outerHeight(!1)}).get();if(e.use_tallest){var h=Math.max.apply(null,g);d.css("height",h)}else{var i=Math.min.apply(null,g);d.css("height",i)}e.after_height_change(),b.trigger("after-height-change").trigger("after-height-change.fndtn.equalizer")}}},reflow:function(){var b=this;this.S("["+this.attr_name()+"]",this.scope).each(function(){var c=a(this);b.image_loaded(b.S("img",this),function(){b.equalize(c)})})}}}(jQuery,window,window.document),function(a,b){"use strict";Foundation.libs.interchange={name:"interchange",version:"5.3.3",cache:{},images_loaded:!1,nodes_loaded:!1,settings:{load_attr:"interchange",named_queries:{"default":"only screen",small:Foundation.media_queries.small,medium:Foundation.media_queries.medium,large:Foundation.media_queries.large,xlarge:Foundation.media_queries.xlarge,xxlarge:Foundation.media_queries.xxlarge,landscape:"only screen and (orientation: landscape)",portrait:"only screen and (orientation: portrait)",retina:"only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx)"},directives:{replace:function(b,c,d){if(/IMG/.test(b[0].nodeName)){var e=b[0].src;if(new RegExp(c,"i").test(e))return;return b[0].src=c,d(b[0].src)}var f=b.data(this.data_attr+"-last-path"),g=this;if(f!=c)return/\.(gif|jpg|jpeg|tiff|png)([?#].*)?/i.test(c)?(a(b).css("background-image","url("+c+")"),b.data("interchange-last-path",c),d(c)):a.get(c,function(a){b.html(a),b.data(g.data_attr+"-last-path",c),d()})}}},init:function(b,c,d){Foundation.inherit(this,"throttle random_str"),this.data_attr=this.set_data_attr(),a.extend(!0,this.settings,c,d),this.bindings(c,d),this.load("images"),this.load("nodes")},get_media_hash:function(){var a="";for(var b in this.settings.named_queries)a+=matchMedia(this.settings.named_queries[b]).matches.toString();return a},events:function(){var c,d=this;return a(b).off(".interchange").on("resize.fndtn.interchange",d.throttle(function(){var a=d.get_media_hash();
a!==c&&d.resize(),c=a},50)),this},resize:function(){var b=this.cache;if(!this.images_loaded||!this.nodes_loaded)return void setTimeout(a.proxy(this.resize,this),50);for(var c in b)if(b.hasOwnProperty(c)){var d=this.results(c,b[c]);d&&this.settings.directives[d.scenario[1]].call(this,d.el,d.scenario[0],function(){if(arguments[0]instanceof Array)var a=arguments[0];else var a=Array.prototype.slice.call(arguments,0);d.el.trigger(d.scenario[1],a)})}},results:function(a,b){var c=b.length;if(c>0)for(var d=this.S("["+this.add_namespace("data-uuid")+'="'+a+'"]');c--;){var e,f=b[c][2];if(e=matchMedia(this.settings.named_queries.hasOwnProperty(f)?this.settings.named_queries[f]:f),e.matches)return{el:d,scenario:b[c]}}return!1},load:function(a,b){return("undefined"==typeof this["cached_"+a]||b)&&this["update_"+a](),this["cached_"+a]},update_images:function(){var a=this.S("img["+this.data_attr+"]"),b=a.length,c=b,d=0,e=this.data_attr;for(this.cache={},this.cached_images=[],this.images_loaded=0===b;c--;){if(d++,a[c]){var f=a[c].getAttribute(e)||"";f.length>0&&this.cached_images.push(a[c])}d===b&&(this.images_loaded=!0,this.enhance("images"))}return this},update_nodes:function(){var a=this.S("["+this.data_attr+"]").not("img"),b=a.length,c=b,d=0,e=this.data_attr;for(this.cached_nodes=[],this.nodes_loaded=0===b;c--;){d++;var f=a[c].getAttribute(e)||"";f.length>0&&this.cached_nodes.push(a[c]),d===b&&(this.nodes_loaded=!0,this.enhance("nodes"))}return this},enhance:function(c){for(var d=this["cached_"+c].length;d--;)this.object(a(this["cached_"+c][d]));return a(b).trigger("resize").trigger("resize.fndtn.interchange")},convert_directive:function(a){var b=this.trim(a);return b.length>0?b:"replace"},parse_scenario:function(a){var b=a[0].match(/(.+),\s*(\w+)\s*$/),c=a[1];if(b)var d=b[1],e=b[2];else var f=a[0].split(/,\s*$/),d=f[0],e="";return[this.trim(d),this.convert_directive(e),this.trim(c)]},object:function(a){var b=this.parse_data_attr(a),c=[],d=b.length;if(d>0)for(;d--;){var e=b[d].split(/\((.*?)(\))$/);if(e.length>1){var f=this.parse_scenario(e);c.push(f)}}return this.store(a,c)},store:function(a,b){var c=this.random_str(),d=a.data(this.add_namespace("uuid",!0));return this.cache[d]?this.cache[d]:(a.attr(this.add_namespace("data-uuid"),c),this.cache[c]=b)},trim:function(b){return"string"==typeof b?a.trim(b):b},set_data_attr:function(a){return a?this.namespace.length>0?this.namespace+"-"+this.settings.load_attr:this.settings.load_attr:this.namespace.length>0?"data-"+this.namespace+"-"+this.settings.load_attr:"data-"+this.settings.load_attr},parse_data_attr:function(a){for(var b=a.attr(this.attr_name()).split(/\[(.*?)\]/),c=b.length,d=[];c--;)b[c].replace(/[\W\d]+/,"").length>4&&d.push(b[c]);return d},reflow:function(){this.load("images",!0),this.load("nodes",!0)}}}(jQuery,window,window.document),function(a,b,c,d){"use strict";Foundation.libs.joyride={name:"joyride",version:"5.3.3",defaults:{expose:!1,modal:!0,tip_location:"bottom",nub_position:"auto",scroll_speed:1500,scroll_animation:"linear",timer:0,start_timer_on_click:!0,start_offset:0,next_button:!0,prev_button:!0,tip_animation:"fade",pause_after:[],exposed:[],tip_animation_fade_speed:300,cookie_monster:!1,cookie_name:"joyride",cookie_domain:!1,cookie_expires:365,tip_container:"body",abort_on_close:!0,tip_location_patterns:{top:["bottom"],bottom:[],left:["right","top","bottom"],right:["left","top","bottom"]},post_ride_callback:function(){},post_step_callback:function(){},pre_step_callback:function(){},pre_ride_callback:function(){},post_expose_callback:function(){},template:{link:'<a href="#close" class="joyride-close-tip">&times;</a>',timer:'<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',tip:'<div class="joyride-tip-guide"><span class="joyride-nub"></span></div>',wrapper:'<div class="joyride-content-wrapper"></div>',button:'<a href="#" class="small button joyride-next-tip"></a>',prev_button:'<a href="#" class="small button joyride-prev-tip"></a>',modal:'<div class="joyride-modal-bg"></div>',expose:'<div class="joyride-expose-wrapper"></div>',expose_cover:'<div class="joyride-expose-cover"></div>'},expose_add_class:""},init:function(b,c,d){Foundation.inherit(this,"throttle random_str"),this.settings=this.settings||a.extend({},this.defaults,d||c),this.bindings(c,d)},events:function(){var c=this;a(this.scope).off(".joyride").on("click.fndtn.joyride",".joyride-next-tip, .joyride-modal-bg",function(a){a.preventDefault(),this.settings.$li.next().length<1?this.end():this.settings.timer>0?(clearTimeout(this.settings.automate),this.hide(),this.show(),this.startTimer()):(this.hide(),this.show())}.bind(this)).on("click.fndtn.joyride",".joyride-prev-tip",function(a){a.preventDefault(),this.settings.$li.prev().length<1||(this.settings.timer>0?(clearTimeout(this.settings.automate),this.hide(),this.show(null,!0),this.startTimer()):(this.hide(),this.show(null,!0)))}.bind(this)).on("click.fndtn.joyride",".joyride-close-tip",function(a){a.preventDefault(),this.end(this.settings.abort_on_close)}.bind(this)),a(b).off(".joyride").on("resize.fndtn.joyride",c.throttle(function(){if(a("["+c.attr_name()+"]").length>0&&c.settings.$next_tip){if(c.settings.exposed.length>0){var b=a(c.settings.exposed);b.each(function(){var b=a(this);c.un_expose(b),c.expose(b)})}c.is_phone()?c.pos_phone():c.pos_default(!1)}},100))},start:function(){var b=this,c=a("["+this.attr_name()+"]",this.scope),d=["timer","scrollSpeed","startOffset","tipAnimationFadeSpeed","cookieExpires"],e=d.length;!c.length>0||(this.settings.init||this.events(),this.settings=c.data(this.attr_name(!0)+"-init"),this.settings.$content_el=c,this.settings.$body=a(this.settings.tip_container),this.settings.body_offset=a(this.settings.tip_container).position(),this.settings.$tip_content=this.settings.$content_el.find("> li"),this.settings.paused=!1,this.settings.attempts=0,"function"!=typeof a.cookie&&(this.settings.cookie_monster=!1),(!this.settings.cookie_monster||this.settings.cookie_monster&&!a.cookie(this.settings.cookie_name))&&(this.settings.$tip_content.each(function(c){var f=a(this);this.settings=a.extend({},b.defaults,b.data_options(f));for(var g=e;g--;)b.settings[d[g]]=parseInt(b.settings[d[g]],10);b.create({$li:f,index:c})}),!this.settings.start_timer_on_click&&this.settings.timer>0?(this.show("init"),this.startTimer()):this.show("init")))},resume:function(){this.set_li(),this.show()},tip_template:function(b){var c,d;return b.tip_class=b.tip_class||"",c=a(this.settings.template.tip).addClass(b.tip_class),d=a.trim(a(b.li).html())+this.prev_button_text(b.prev_button_text,b.index)+this.button_text(b.button_text)+this.settings.template.link+this.timer_instance(b.index),c.append(a(this.settings.template.wrapper)),c.first().attr(this.add_namespace("data-index"),b.index),a(".joyride-content-wrapper",c).append(d),c[0]},timer_instance:function(b){var c;return c=0===b&&this.settings.start_timer_on_click&&this.settings.timer>0||0===this.settings.timer?"":a(this.settings.template.timer)[0].outerHTML},button_text:function(b){return this.settings.tip_settings.next_button?(b=a.trim(b)||"Next",b=a(this.settings.template.button).append(b)[0].outerHTML):b="",b},prev_button_text:function(b,c){return this.settings.tip_settings.prev_button?(b=a.trim(b)||"Previous",b=0==c?a(this.settings.template.prev_button).append(b).addClass("disabled")[0].outerHTML:a(this.settings.template.prev_button).append(b)[0].outerHTML):b="",b},create:function(b){this.settings.tip_settings=a.extend({},this.settings,this.data_options(b.$li));var c=b.$li.attr(this.add_namespace("data-button"))||b.$li.attr(this.add_namespace("data-text")),d=b.$li.attr(this.add_namespace("data-button-prev"))||b.$li.attr(this.add_namespace("data-prev-text")),e=b.$li.attr("class"),f=a(this.tip_template({tip_class:e,index:b.index,button_text:c,prev_button_text:d,li:b.$li}));a(this.settings.tip_container).append(f)},show:function(b,c){var e=null;this.settings.$li===d||-1===a.inArray(this.settings.$li.index(),this.settings.pause_after)?(this.settings.paused?this.settings.paused=!1:this.set_li(b,c),this.settings.attempts=0,this.settings.$li.length&&this.settings.$target.length>0?(b&&(this.settings.pre_ride_callback(this.settings.$li.index(),this.settings.$next_tip),this.settings.modal&&this.show_modal()),this.settings.pre_step_callback(this.settings.$li.index(),this.settings.$next_tip),this.settings.modal&&this.settings.expose&&this.expose(),this.settings.tip_settings=a.extend({},this.settings,this.data_options(this.settings.$li)),this.settings.timer=parseInt(this.settings.timer,10),this.settings.tip_settings.tip_location_pattern=this.settings.tip_location_patterns[this.settings.tip_settings.tip_location],/body/i.test(this.settings.$target.selector)||this.scroll_to(),this.is_phone()?this.pos_phone(!0):this.pos_default(!0),e=this.settings.$next_tip.find(".joyride-timer-indicator"),/pop/i.test(this.settings.tip_animation)?(e.width(0),this.settings.timer>0?(this.settings.$next_tip.show(),setTimeout(function(){e.animate({width:e.parent().width()},this.settings.timer,"linear")}.bind(this),this.settings.tip_animation_fade_speed)):this.settings.$next_tip.show()):/fade/i.test(this.settings.tip_animation)&&(e.width(0),this.settings.timer>0?(this.settings.$next_tip.fadeIn(this.settings.tip_animation_fade_speed).show(),setTimeout(function(){e.animate({width:e.parent().width()},this.settings.timer,"linear")}.bind(this),this.settings.tip_animation_fade_speed)):this.settings.$next_tip.fadeIn(this.settings.tip_animation_fade_speed)),this.settings.$current_tip=this.settings.$next_tip):this.settings.$li&&this.settings.$target.length<1?this.show():this.end()):this.settings.paused=!0},is_phone:function(){return matchMedia(Foundation.media_queries.small).matches&&!matchMedia(Foundation.media_queries.medium).matches},hide:function(){this.settings.modal&&this.settings.expose&&this.un_expose(),this.settings.modal||a(".joyride-modal-bg").hide(),this.settings.$current_tip.css("visibility","hidden"),setTimeout(a.proxy(function(){this.hide(),this.css("visibility","visible")},this.settings.$current_tip),0),this.settings.post_step_callback(this.settings.$li.index(),this.settings.$current_tip)},set_li:function(a,b){a?(this.settings.$li=this.settings.$tip_content.eq(this.settings.start_offset),this.set_next_tip(),this.settings.$current_tip=this.settings.$next_tip):(this.settings.$li=b?this.settings.$li.prev():this.settings.$li.next(),this.set_next_tip()),this.set_target()},set_next_tip:function(){this.settings.$next_tip=a(".joyride-tip-guide").eq(this.settings.$li.index()),this.settings.$next_tip.data("closed","")},set_target:function(){var b=this.settings.$li.attr(this.add_namespace("data-class")),d=this.settings.$li.attr(this.add_namespace("data-id")),e=function(){return d?a(c.getElementById(d)):b?a("."+b).first():a("body")};this.settings.$target=e()},scroll_to:function(){var c,d;c=a(b).height()/2,d=Math.ceil(this.settings.$target.offset().top-c+this.settings.$next_tip.outerHeight()),0!=d&&a("html, body").stop().animate({scrollTop:d},this.settings.scroll_speed,"swing")},paused:function(){return-1===a.inArray(this.settings.$li.index()+1,this.settings.pause_after)},restart:function(){this.hide(),this.settings.$li=d,this.show("init")},pos_default:function(a){var b=this.settings.$next_tip.find(".joyride-nub"),c=Math.ceil(b.outerWidth()/2),d=Math.ceil(b.outerHeight()/2),e=a||!1;if(e&&(this.settings.$next_tip.css("visibility","hidden"),this.settings.$next_tip.show()),/body/i.test(this.settings.$target.selector))this.settings.$li.length&&this.pos_modal(b);else{var f=this.settings.tip_settings.tipAdjustmentY?parseInt(this.settings.tip_settings.tipAdjustmentY):0,g=this.settings.tip_settings.tipAdjustmentX?parseInt(this.settings.tip_settings.tipAdjustmentX):0;this.bottom()?(this.settings.$next_tip.css(this.rtl?{top:this.settings.$target.offset().top+d+this.settings.$target.outerHeight()+f,left:this.settings.$target.offset().left+this.settings.$target.outerWidth()-this.settings.$next_tip.outerWidth()+g}:{top:this.settings.$target.offset().top+d+this.settings.$target.outerHeight()+f,left:this.settings.$target.offset().left+g}),this.nub_position(b,this.settings.tip_settings.nub_position,"top")):this.top()?(this.settings.$next_tip.css(this.rtl?{top:this.settings.$target.offset().top-this.settings.$next_tip.outerHeight()-d+f,left:this.settings.$target.offset().left+this.settings.$target.outerWidth()-this.settings.$next_tip.outerWidth()}:{top:this.settings.$target.offset().top-this.settings.$next_tip.outerHeight()-d+f,left:this.settings.$target.offset().left+g}),this.nub_position(b,this.settings.tip_settings.nub_position,"bottom")):this.right()?(this.settings.$next_tip.css({top:this.settings.$target.offset().top+f,left:this.settings.$target.outerWidth()+this.settings.$target.offset().left+c+g}),this.nub_position(b,this.settings.tip_settings.nub_position,"left")):this.left()&&(this.settings.$next_tip.css({top:this.settings.$target.offset().top+f,left:this.settings.$target.offset().left-this.settings.$next_tip.outerWidth()-c+g}),this.nub_position(b,this.settings.tip_settings.nub_position,"right")),!this.visible(this.corners(this.settings.$next_tip))&&this.settings.attempts<this.settings.tip_settings.tip_location_pattern.length&&(b.removeClass("bottom").removeClass("top").removeClass("right").removeClass("left"),this.settings.tip_settings.tip_location=this.settings.tip_settings.tip_location_pattern[this.settings.attempts],this.settings.attempts++,this.pos_default())}e&&(this.settings.$next_tip.hide(),this.settings.$next_tip.css("visibility","visible"))},pos_phone:function(b){var c=this.settings.$next_tip.outerHeight(),d=(this.settings.$next_tip.offset(),this.settings.$target.outerHeight()),e=a(".joyride-nub",this.settings.$next_tip),f=Math.ceil(e.outerHeight()/2),g=b||!1;e.removeClass("bottom").removeClass("top").removeClass("right").removeClass("left"),g&&(this.settings.$next_tip.css("visibility","hidden"),this.settings.$next_tip.show()),/body/i.test(this.settings.$target.selector)?this.settings.$li.length&&this.pos_modal(e):this.top()?(this.settings.$next_tip.offset({top:this.settings.$target.offset().top-c-f}),e.addClass("bottom")):(this.settings.$next_tip.offset({top:this.settings.$target.offset().top+d+f}),e.addClass("top")),g&&(this.settings.$next_tip.hide(),this.settings.$next_tip.css("visibility","visible"))},pos_modal:function(a){this.center(),a.hide(),this.show_modal()},show_modal:function(){if(!this.settings.$next_tip.data("closed")){var b=a(".joyride-modal-bg");b.length<1&&a("body").append(this.settings.template.modal).show(),/pop/i.test(this.settings.tip_animation)?b.show():b.fadeIn(this.settings.tip_animation_fade_speed)}},expose:function(){var c,d,e,f,g,h="expose-"+this.random_str(6);if(arguments.length>0&&arguments[0]instanceof a)e=arguments[0];else{if(!this.settings.$target||/body/i.test(this.settings.$target.selector))return!1;e=this.settings.$target}return e.length<1?(b.console&&console.error("element not valid",e),!1):(c=a(this.settings.template.expose),this.settings.$body.append(c),c.css({top:e.offset().top,left:e.offset().left,width:e.outerWidth(!0),height:e.outerHeight(!0)}),d=a(this.settings.template.expose_cover),f={zIndex:e.css("z-index"),position:e.css("position")},g=null==e.attr("class")?"":e.attr("class"),e.css("z-index",parseInt(c.css("z-index"))+1),"static"==f.position&&e.css("position","relative"),e.data("expose-css",f),e.data("orig-class",g),e.attr("class",g+" "+this.settings.expose_add_class),d.css({top:e.offset().top,left:e.offset().left,width:e.outerWidth(!0),height:e.outerHeight(!0)}),this.settings.modal&&this.show_modal(),this.settings.$body.append(d),c.addClass(h),d.addClass(h),e.data("expose",h),this.settings.post_expose_callback(this.settings.$li.index(),this.settings.$next_tip,e),void this.add_exposed(e))},un_expose:function(){var c,d,e,f,g,h=!1;if(arguments.length>0&&arguments[0]instanceof a)d=arguments[0];else{if(!this.settings.$target||/body/i.test(this.settings.$target.selector))return!1;d=this.settings.$target}return d.length<1?(b.console&&console.error("element not valid",d),!1):(c=d.data("expose"),e=a("."+c),arguments.length>1&&(h=arguments[1]),h===!0?a(".joyride-expose-wrapper,.joyride-expose-cover").remove():e.remove(),f=d.data("expose-css"),"auto"==f.zIndex?d.css("z-index",""):d.css("z-index",f.zIndex),f.position!=d.css("position")&&("static"==f.position?d.css("position",""):d.css("position",f.position)),g=d.data("orig-class"),d.attr("class",g),d.removeData("orig-classes"),d.removeData("expose"),d.removeData("expose-z-index"),void this.remove_exposed(d))},add_exposed:function(b){this.settings.exposed=this.settings.exposed||[],b instanceof a||"object"==typeof b?this.settings.exposed.push(b[0]):"string"==typeof b&&this.settings.exposed.push(b)},remove_exposed:function(b){var c,d;for(b instanceof a?c=b[0]:"string"==typeof b&&(c=b),this.settings.exposed=this.settings.exposed||[],d=this.settings.exposed.length;d--;)if(this.settings.exposed[d]==c)return void this.settings.exposed.splice(d,1)},center:function(){var c=a(b);return this.settings.$next_tip.css({top:(c.height()-this.settings.$next_tip.outerHeight())/2+c.scrollTop(),left:(c.width()-this.settings.$next_tip.outerWidth())/2+c.scrollLeft()}),!0},bottom:function(){return/bottom/i.test(this.settings.tip_settings.tip_location)},top:function(){return/top/i.test(this.settings.tip_settings.tip_location)},right:function(){return/right/i.test(this.settings.tip_settings.tip_location)},left:function(){return/left/i.test(this.settings.tip_settings.tip_location)},corners:function(c){var d=a(b),e=d.height()/2,f=Math.ceil(this.settings.$target.offset().top-e+this.settings.$next_tip.outerHeight()),g=d.width()+d.scrollLeft(),h=d.height()+f,i=d.height()+d.scrollTop(),j=d.scrollTop();return j>f&&(j=0>f?0:f),h>i&&(i=h),[c.offset().top<j,g<c.offset().left+c.outerWidth(),i<c.offset().top+c.outerHeight(),d.scrollLeft()>c.offset().left]},visible:function(a){for(var b=a.length;b--;)if(a[b])return!1;return!0},nub_position:function(a,b,c){a.addClass("auto"===b?c:b)},startTimer:function(){this.settings.$li.length?this.settings.automate=setTimeout(function(){this.hide(),this.show(),this.startTimer()}.bind(this),this.settings.timer):clearTimeout(this.settings.automate)},end:function(b){this.settings.cookie_monster&&a.cookie(this.settings.cookie_name,"ridden",{expires:this.settings.cookie_expires,domain:this.settings.cookie_domain}),this.settings.timer>0&&clearTimeout(this.settings.automate),this.settings.modal&&this.settings.expose&&this.un_expose(),this.settings.$next_tip.data("closed",!0),a(".joyride-modal-bg").hide(),this.settings.$current_tip.hide(),("undefined"==typeof b||b===!1)&&(this.settings.post_step_callback(this.settings.$li.index(),this.settings.$current_tip),this.settings.post_ride_callback(this.settings.$li.index(),this.settings.$current_tip)),a(".joyride-tip-guide").remove()},off:function(){a(this.scope).off(".joyride"),a(b).off(".joyride"),a(".joyride-close-tip, .joyride-next-tip, .joyride-modal-bg").off(".joyride"),a(".joyride-tip-guide, .joyride-modal-bg").remove(),clearTimeout(this.settings.automate),this.settings={}},reflow:function(){}}}(jQuery,window,window.document),function(a,b){"use strict";Foundation.libs["magellan-expedition"]={name:"magellan-expedition",version:"5.3.3",settings:{active_class:"active",threshold:0,destination_threshold:20,throttle_delay:30,fixed_top:0},init:function(a,b,c){Foundation.inherit(this,"throttle"),this.bindings(b,c)},events:function(){var c=this,d=c.S,e=c.settings;c.set_expedition_position(),d(c.scope).off(".magellan").on("click.fndtn.magellan","["+c.add_namespace("data-magellan-arrival")+'] a[href^="#"]',function(b){b.preventDefault();var d=a(this).closest("["+c.attr_name()+"]"),e=d.data("magellan-expedition-init"),f=this.hash.split("#").join(""),g=a("a[name='"+f+"']");0===g.length&&(g=a("#"+f));var h=g.offset().top-e.destination_threshold+1;h-=d.outerHeight(),a("html, body").stop().animate({scrollTop:h},700,"swing",function(){history.pushState?history.pushState(null,null,"#"+f):location.hash="#"+f})}).on("scroll.fndtn.magellan",c.throttle(this.check_for_arrivals.bind(this),e.throttle_delay)),a(b).on("resize.fndtn.magellan",c.throttle(this.set_expedition_position.bind(this),e.throttle_delay))},check_for_arrivals:function(){var a=this;a.update_arrivals(),a.update_expedition_positions()},set_expedition_position:function(){var b=this;a("["+this.attr_name()+"=fixed]",b.scope).each(function(){var c,d,e=a(this),f=e.data("magellan-expedition-init"),g=e.attr("styles");e.attr("style",""),c=e.offset().top+f.threshold,d=parseInt(e.data("magellan-fixed-top")),isNaN(d)||(b.settings.fixed_top=d),e.data(b.data_attr("magellan-top-offset"),c),e.attr("style",g)})},update_expedition_positions:function(){var c=this,d=a(b).scrollTop();a("["+this.attr_name()+"=fixed]",c.scope).each(function(){var b=a(this),e=b.data("magellan-expedition-init"),f=b.attr("style"),g=b.data("magellan-top-offset");if(d+c.settings.fixed_top>=g){var h=b.prev("["+c.add_namespace("data-magellan-expedition-clone")+"]");0===h.length&&(h=b.clone(),h.removeAttr(c.attr_name()),h.attr(c.add_namespace("data-magellan-expedition-clone"),""),b.before(h)),b.css({position:"fixed",top:e.fixed_top})}else b.prev("["+c.add_namespace("data-magellan-expedition-clone")+"]").remove(),b.attr("style",f).css("position","").css("top","").removeClass("fixed")})},update_arrivals:function(){var c=this,d=a(b).scrollTop();a("["+this.attr_name()+"]",c.scope).each(function(){var b=a(this),e=b.data(c.attr_name(!0)+"-init"),f=c.offsets(b,d),g=b.find("["+c.add_namespace("data-magellan-arrival")+"]"),h=!1;f.each(function(a,d){if(d.viewport_offset>=d.top_offset){var f=b.find("["+c.add_namespace("data-magellan-arrival")+"]");return f.not(d.arrival).removeClass(e.active_class),d.arrival.addClass(e.active_class),h=!0,!0}}),h||g.removeClass(e.active_class)})},offsets:function(b,c){var d=this,e=b.data(d.attr_name(!0)+"-init"),f=c;return b.find("["+d.add_namespace("data-magellan-arrival")+"]").map(function(){var c=a(this).data(d.data_attr("magellan-arrival")),g=a("["+d.add_namespace("data-magellan-destination")+"="+c+"]");if(g.length>0){var h=Math.floor(g.offset().top-e.destination_threshold-b.outerHeight());return{destination:g,arrival:a(this),top_offset:h,viewport_offset:f}}}).sort(function(a,b){return a.top_offset<b.top_offset?-1:a.top_offset>b.top_offset?1:0})},data_attr:function(a){return this.namespace.length>0?this.namespace+"-"+a:a},off:function(){this.S(this.scope).off(".magellan"),this.S(b).off(".magellan")},reflow:function(){var b=this;a("["+b.add_namespace("data-magellan-expedition-clone")+"]",b.scope).remove()}}}(jQuery,window,window.document),function(){"use strict";Foundation.libs.offcanvas={name:"offcanvas",version:"5.3.3",settings:{open_method:"move",close_on_click:!1},init:function(a,b,c){this.bindings(b,c)},events:function(){var a=this,b=a.S,c="",d="",e="";"move"===this.settings.open_method?(c="move-",d="right",e="left"):"overlap"===this.settings.open_method&&(c="offcanvas-overlap"),b(this.scope).off(".offcanvas").on("click.fndtn.offcanvas",".left-off-canvas-toggle",function(b){a.click_toggle_class(b,c+d)}).on("click.fndtn.offcanvas",".left-off-canvas-menu a",function(b){var e=a.get_settings(b);e.close_on_click&&a.hide.call(a,c+d,a.get_wrapper(b))}).on("click.fndtn.offcanvas",".right-off-canvas-toggle",function(b){a.click_toggle_class(b,c+e)}).on("click.fndtn.offcanvas",".right-off-canvas-menu a",function(b){var d=a.get_settings(b);d.close_on_click&&a.hide.call(a,c+e,a.get_wrapper(b))}).on("click.fndtn.offcanvas",".exit-off-canvas",function(b){a.click_remove_class(b,c+e),d&&a.click_remove_class(b,c+d)})},toggle:function(a,b){b=b||this.get_wrapper(),b.is("."+a)?this.hide(a,b):this.show(a,b)},show:function(a,b){b=b||this.get_wrapper(),b.trigger("open").trigger("open.fndtn.offcanvas"),b.addClass(a)},hide:function(a,b){b=b||this.get_wrapper(),b.trigger("close").trigger("close.fndtn.offcanvas"),b.removeClass(a)},click_toggle_class:function(a,b){a.preventDefault();var c=this.get_wrapper(a);this.toggle(b,c)},click_remove_class:function(a,b){a.preventDefault();var c=this.get_wrapper(a);this.hide(b,c)},get_settings:function(a){var b=this.S(a.target).closest("["+this.attr_name()+"]");return b.data(this.attr_name(!0)+"-init")||this.settings},get_wrapper:function(a){var b=this.S(a?a.target:this.scope).closest(".off-canvas-wrap");return 0===b.length&&(b=this.S(".off-canvas-wrap")),b},reflow:function(){}}}(jQuery,window,window.document),function(a,b,c,d){"use strict";var e=function(){},f=function(e,f){if(e.hasClass(f.slides_container_class))return this;var j,k,l,m,n,o,p=this,q=e,r=0,s=!1;p.slides=function(){return q.children(f.slide_selector)},p.slides().first().addClass(f.active_slide_class),p.update_slide_number=function(b){f.slide_number&&(k.find("span:first").text(parseInt(b)+1),k.find("span:last").text(p.slides().length)),f.bullets&&(l.children().removeClass(f.bullets_active_class),a(l.children().get(b)).addClass(f.bullets_active_class))},p.update_active_link=function(b){var c=a('[data-orbit-link="'+p.slides().eq(b).attr("data-orbit-slide")+'"]');c.siblings().removeClass(f.bullets_active_class),c.addClass(f.bullets_active_class)},p.build_markup=function(){q.wrap('<div class="'+f.container_class+'"></div>'),j=q.parent(),q.addClass(f.slides_container_class),f.stack_on_small&&j.addClass(f.stack_on_small_class),f.navigation_arrows&&(j.append(a('<a href="#"><span></span></a>').addClass(f.prev_class)),j.append(a('<a href="#"><span></span></a>').addClass(f.next_class))),f.timer&&(m=a("<div>").addClass(f.timer_container_class),m.append("<span>"),m.append(a("<div>").addClass(f.timer_progress_class)),m.addClass(f.timer_paused_class),j.append(m)),f.slide_number&&(k=a("<div>").addClass(f.slide_number_class),k.append("<span></span> "+f.slide_number_text+" <span></span>"),j.append(k)),f.bullets&&(l=a("<ol>").addClass(f.bullets_container_class),j.append(l),l.wrap('<div class="orbit-bullets-container"></div>'),p.slides().each(function(b){var c=a("<li>").attr("data-orbit-slide",b).on("click",p.link_bullet);l.append(c)}))},p._goto=function(b,c){if(b===r)return!1;"object"==typeof o&&o.restart();var d=p.slides(),e="next";if(s=!0,r>b&&(e="prev"),b>=d.length){if(!f.circular)return!1;b=0}else if(0>b){if(!f.circular)return!1;b=d.length-1}var g=a(d.get(r)),h=a(d.get(b));g.css("zIndex",2),g.removeClass(f.active_slide_class),h.css("zIndex",4).addClass(f.active_slide_class),q.trigger("before-slide-change.fndtn.orbit"),f.before_slide_change(),p.update_active_link(b);var i=function(){var a=function(){r=b,s=!1,c===!0&&(o=p.create_timer(),o.start()),p.update_slide_number(r),q.trigger("after-slide-change.fndtn.orbit",[{slide_number:r,total_slides:d.length}]),f.after_slide_change(r,d.length)};q.height()!=h.height()&&f.variable_height?q.animate({height:h.height()},250,"linear",a):a()};if(1===d.length)return i(),!1;var j=function(){"next"===e&&n.next(g,h,i),"prev"===e&&n.prev(g,h,i)};h.height()>q.height()&&f.variable_height?q.animate({height:h.height()},250,"linear",j):j()},p.next=function(a){a.stopImmediatePropagation(),a.preventDefault(),p._goto(r+1)},p.prev=function(a){a.stopImmediatePropagation(),a.preventDefault(),p._goto(r-1)},p.link_custom=function(b){b.preventDefault();var c=a(this).attr("data-orbit-link");if("string"==typeof c&&""!=(c=a.trim(c))){var d=j.find("[data-orbit-slide="+c+"]");-1!=d.index()&&p._goto(d.index())}},p.link_bullet=function(){var b=a(this).attr("data-orbit-slide");if("string"==typeof b&&""!=(b=a.trim(b)))if(isNaN(parseInt(b))){var c=j.find("[data-orbit-slide="+b+"]");-1!=c.index()&&p._goto(c.index()+1)}else p._goto(parseInt(b))},p.timer_callback=function(){p._goto(r+1,!0)},p.compute_dimensions=function(){var b=a(p.slides().get(r)),c=b.height();f.variable_height||p.slides().each(function(){a(this).height()>c&&(c=a(this).height())}),q.height(c)},p.create_timer=function(){var a=new g(j.find("."+f.timer_container_class),f,p.timer_callback);return a},p.stop_timer=function(){"object"==typeof o&&o.stop()},p.toggle_timer=function(){var a=j.find("."+f.timer_container_class);a.hasClass(f.timer_paused_class)?("undefined"==typeof o&&(o=p.create_timer()),o.start()):"object"==typeof o&&o.stop()},p.init=function(){p.build_markup(),f.timer&&(o=p.create_timer(),Foundation.utils.image_loaded(this.slides().children("img"),o.start)),n=new i(f,q),"slide"===f.animation&&(n=new h(f,q)),j.on("click","."+f.next_class,p.next),j.on("click","."+f.prev_class,p.prev),f.next_on_click&&j.on("click","."+f.slides_container_class+" [data-orbit-slide]",p.link_bullet),j.on("click",p.toggle_timer),f.swipe&&j.on("touchstart.fndtn.orbit",function(a){a.touches||(a=a.originalEvent);var b={start_page_x:a.touches[0].pageX,start_page_y:a.touches[0].pageY,start_time:(new Date).getTime(),delta_x:0,is_scrolling:d};j.data("swipe-transition",b),a.stopPropagation()}).on("touchmove.fndtn.orbit",function(a){if(a.touches||(a=a.originalEvent),!(a.touches.length>1||a.scale&&1!==a.scale)){var b=j.data("swipe-transition");if("undefined"==typeof b&&(b={}),b.delta_x=a.touches[0].pageX-b.start_page_x,"undefined"==typeof b.is_scrolling&&(b.is_scrolling=!!(b.is_scrolling||Math.abs(b.delta_x)<Math.abs(a.touches[0].pageY-b.start_page_y))),!b.is_scrolling&&!b.active){a.preventDefault();var c=b.delta_x<0?r+1:r-1;b.active=!0,p._goto(c)}}}).on("touchend.fndtn.orbit",function(a){j.data("swipe-transition",{}),a.stopPropagation()}),j.on("mouseenter.fndtn.orbit",function(){f.timer&&f.pause_on_hover&&p.stop_timer()}).on("mouseleave.fndtn.orbit",function(){f.timer&&f.resume_on_mouseout&&o.start()}),a(c).on("click","[data-orbit-link]",p.link_custom),a(b).on("load resize",p.compute_dimensions),Foundation.utils.image_loaded(this.slides().children("img"),p.compute_dimensions),Foundation.utils.image_loaded(this.slides().children("img"),function(){j.prev("."+f.preloader_class).css("display","none"),p.update_slide_number(0),p.update_active_link(0),q.trigger("ready.fndtn.orbit")})},p.init()},g=function(a,b,c){var d,e,f=this,g=b.timer_speed,h=a.find("."+b.timer_progress_class),i=-1;this.update_progress=function(a){var b=h.clone();b.attr("style",""),b.css("width",a+"%"),h.replaceWith(b),h=b},this.restart=function(){clearTimeout(e),a.addClass(b.timer_paused_class),i=-1,f.update_progress(0)},this.start=function(){return a.hasClass(b.timer_paused_class)?(i=-1===i?g:i,a.removeClass(b.timer_paused_class),d=(new Date).getTime(),h.animate({width:"100%"},i,"linear"),e=setTimeout(function(){f.restart(),c()},i),void a.trigger("timer-started.fndtn.orbit")):!0},this.stop=function(){if(a.hasClass(b.timer_paused_class))return!0;clearTimeout(e),a.addClass(b.timer_paused_class);var c=(new Date).getTime();i-=c-d;var h=100-i/g*100;f.update_progress(h),a.trigger("timer-stopped.fndtn.orbit")}},h=function(b){var c=b.animation_speed,d=1===a("html[dir=rtl]").length,e=d?"marginRight":"marginLeft",f={};f[e]="0%",this.next=function(a,b,d){a.animate({marginLeft:"-100%"},c),b.animate(f,c,function(){a.css(e,"100%"),d()})},this.prev=function(a,b,d){a.animate({marginLeft:"100%"},c),b.css(e,"-100%"),b.animate(f,c,function(){a.css(e,"100%"),d()})}},i=function(b){{var c=b.animation_speed;1===a("html[dir=rtl]").length}this.next=function(a,b,d){b.css({margin:"0%",opacity:"0.01"}),b.animate({opacity:"1"},c,"linear",function(){a.css("margin","100%"),d()})},this.prev=function(a,b,d){b.css({margin:"0%",opacity:"0.01"}),b.animate({opacity:"1"},c,"linear",function(){a.css("margin","100%"),d()})}};Foundation.libs=Foundation.libs||{},Foundation.libs.orbit={name:"orbit",version:"5.3.1",settings:{animation:"slide",timer_speed:1e4,pause_on_hover:!0,resume_on_mouseout:!1,next_on_click:!0,animation_speed:500,stack_on_small:!1,navigation_arrows:!0,slide_number:!0,slide_number_text:"of",container_class:"orbit-container",stack_on_small_class:"orbit-stack-on-small",next_class:"orbit-next",prev_class:"orbit-prev",timer_container_class:"orbit-timer",timer_paused_class:"paused",timer_progress_class:"orbit-progress",slides_container_class:"orbit-slides-container",preloader_class:"preloader",slide_selector:"*",bullets_container_class:"orbit-bullets",bullets_active_class:"active",slide_number_class:"orbit-slide-number",caption_class:"orbit-caption",active_slide_class:"active",orbit_transition_class:"orbit-transitioning",bullets:!0,circular:!0,timer:!0,variable_height:!1,swipe:!0,before_slide_change:e,after_slide_change:e},init:function(a,b,c){this.bindings(b,c)
},events:function(a){var b=new f(this.S(a),this.S(a).data("orbit-init"));this.S(a).data(this.name+"-instance",b)},reflow:function(){var a=this;if(a.S(a.scope).is("[data-orbit]")){var b=a.S(a.scope),c=b.data(a.name+"-instance");c.compute_dimensions()}else a.S("[data-orbit]",a.scope).each(function(b,c){var d=a.S(c),e=(a.data_options(d),d.data(a.name+"-instance"));e.compute_dimensions()})}}}(jQuery,window,window.document),function(a,b,c,d){"use strict";function e(a){var b=/fade/i.test(a),c=/pop/i.test(a);return{animate:b||c,pop:c,fade:b}}Foundation.libs.reveal={name:"reveal",version:"5.3.3",locked:!1,settings:{animation:"fadeAndPop",animation_speed:250,close_on_background_click:!0,close_on_esc:!0,dismiss_modal_class:"close-reveal-modal",bg_class:"reveal-modal-bg",root_element:"body",open:function(){},opened:function(){},close:function(){},closed:function(){},bg:a(".reveal-modal-bg"),css:{open:{opacity:0,visibility:"visible",display:"block"},close:{opacity:1,visibility:"hidden",display:"none"}}},init:function(b,c,d){a.extend(!0,this.settings,c,d),this.bindings(c,d)},events:function(){var a=this,b=a.S;return b(this.scope).off(".reveal").on("click.fndtn.reveal","["+this.add_namespace("data-reveal-id")+"]:not([disabled])",function(c){if(c.preventDefault(),!a.locked){var d=b(this),e=d.data(a.data_attr("reveal-ajax"));if(a.locked=!0,"undefined"==typeof e)a.open.call(a,d);else{var f=e===!0?d.attr("href"):e;a.open.call(a,d,{url:f})}}}),b(c).on("click.fndtn.reveal",this.close_targets(),function(c){if(c.preventDefault(),!a.locked){var d=b("["+a.attr_name()+"].open").data(a.attr_name(!0)+"-init"),e=b(c.target)[0]===b("."+d.bg_class)[0];if(e){if(!d.close_on_background_click)return;c.stopPropagation()}a.locked=!0,a.close.call(a,e?b("["+a.attr_name()+"].open"):b(this).closest("["+a.attr_name()+"]"))}}),b("["+a.attr_name()+"]",this.scope).length>0?b(this.scope).on("open.fndtn.reveal",this.settings.open).on("opened.fndtn.reveal",this.settings.opened).on("opened.fndtn.reveal",this.open_video).on("close.fndtn.reveal",this.settings.close).on("closed.fndtn.reveal",this.settings.closed).on("closed.fndtn.reveal",this.close_video):b(this.scope).on("open.fndtn.reveal","["+a.attr_name()+"]",this.settings.open).on("opened.fndtn.reveal","["+a.attr_name()+"]",this.settings.opened).on("opened.fndtn.reveal","["+a.attr_name()+"]",this.open_video).on("close.fndtn.reveal","["+a.attr_name()+"]",this.settings.close).on("closed.fndtn.reveal","["+a.attr_name()+"]",this.settings.closed).on("closed.fndtn.reveal","["+a.attr_name()+"]",this.close_video),!0},key_up_on:function(){var a=this;return a.S("body").off("keyup.fndtn.reveal").on("keyup.fndtn.reveal",function(b){var c=a.S("["+a.attr_name()+"].open"),d=c.data(a.attr_name(!0)+"-init")||a.settings;d&&27===b.which&&d.close_on_esc&&!a.locked&&a.close.call(a,c)}),!0},key_up_off:function(){return this.S("body").off("keyup.fndtn.reveal"),!0},open:function(b,c){var d,e=this;b?"undefined"!=typeof b.selector?d=e.S("#"+b.data(e.data_attr("reveal-id"))).first():(d=e.S(this.scope),c=b):d=e.S(this.scope);var f=d.data(e.attr_name(!0)+"-init");if(f=f||this.settings,d.hasClass("open")&&b.attr("data-reveal-id")==d.attr("id"))return e.close(d);if(!d.hasClass("open")){var g=e.S("["+e.attr_name()+"].open");if("undefined"==typeof d.data("css-top")&&d.data("css-top",parseInt(d.css("top"),10)).data("offset",this.cache_offset(d)),this.key_up_on(d),d.trigger("open").trigger("open.fndtn.reveal"),g.length<1&&this.toggle_bg(d,!0),"string"==typeof c&&(c={url:c}),"undefined"!=typeof c&&c.url){var h="undefined"!=typeof c.success?c.success:null;a.extend(c,{success:function(b,c,i){a.isFunction(h)&&h(b,c,i),d.html(b),e.S(d).foundation("section","reflow"),e.S(d).children().foundation(),g.length>0&&e.hide(g,f.css.close),e.show(d,f.css.open)}}),a.ajax(c)}else g.length>0&&this.hide(g,f.css.close),this.show(d,f.css.open)}},close:function(a){var a=a&&a.length?a:this.S(this.scope),b=this.S("["+this.attr_name()+"].open"),c=a.data(this.attr_name(!0)+"-init")||this.settings;b.length>0&&(this.locked=!0,this.key_up_off(a),a.trigger("close").trigger("close.fndtn.reveal"),this.toggle_bg(a,!1),this.hide(b,c.css.close,c))},close_targets:function(){var a="."+this.settings.dismiss_modal_class;return this.settings.close_on_background_click?a+", ."+this.settings.bg_class:a},toggle_bg:function(b,c){0===this.S("."+this.settings.bg_class).length&&(this.settings.bg=a("<div />",{"class":this.settings.bg_class}).appendTo("body").hide());var e=this.settings.bg.filter(":visible").length>0;c!=e&&((c==d?e:!c)?this.hide(this.settings.bg):this.show(this.settings.bg))},show:function(c,d){if(d){var f=c.data(this.attr_name(!0)+"-init")||this.settings,g=f.root_element;if(0===c.parent(g).length){var h=c.wrap('<div style="display: none;" />').parent();c.on("closed.fndtn.reveal.wrapped",function(){c.detach().appendTo(h),c.unwrap().unbind("closed.fndtn.reveal.wrapped")}),c.detach().appendTo(g)}var i=e(f.animation);if(i.animate||(this.locked=!1),i.pop){d.top=a(b).scrollTop()-c.data("offset")+"px";var j={top:a(b).scrollTop()+c.data("css-top")+"px",opacity:1};return setTimeout(function(){return c.css(d).animate(j,f.animation_speed,"linear",function(){this.locked=!1,c.trigger("opened").trigger("opened.fndtn.reveal")}.bind(this)).addClass("open")}.bind(this),f.animation_speed/2)}if(i.fade){d.top=a(b).scrollTop()+c.data("css-top")+"px";var j={opacity:1};return setTimeout(function(){return c.css(d).animate(j,f.animation_speed,"linear",function(){this.locked=!1,c.trigger("opened").trigger("opened.fndtn.reveal")}.bind(this)).addClass("open")}.bind(this),f.animation_speed/2)}return c.css(d).show().css({opacity:1}).addClass("open").trigger("opened").trigger("opened.fndtn.reveal")}var f=this.settings;return e(f.animation).fade?c.fadeIn(f.animation_speed/2):(this.locked=!1,c.show())},hide:function(c,d){if(d){var f=c.data(this.attr_name(!0)+"-init");f=f||this.settings;var g=e(f.animation);if(g.animate||(this.locked=!1),g.pop){var h={top:-a(b).scrollTop()-c.data("offset")+"px",opacity:0};return setTimeout(function(){return c.animate(h,f.animation_speed,"linear",function(){this.locked=!1,c.css(d).trigger("closed").trigger("closed.fndtn.reveal")}.bind(this)).removeClass("open")}.bind(this),f.animation_speed/2)}if(g.fade){var h={opacity:0};return setTimeout(function(){return c.animate(h,f.animation_speed,"linear",function(){this.locked=!1,c.css(d).trigger("closed").trigger("closed.fndtn.reveal")}.bind(this)).removeClass("open")}.bind(this),f.animation_speed/2)}return c.hide().css(d).removeClass("open").trigger("closed").trigger("closed.fndtn.reveal")}var f=this.settings;return e(f.animation).fade?c.fadeOut(f.animation_speed/2):c.hide()},close_video:function(b){var c=a(".flex-video",b.target),d=a("iframe",c);d.length>0&&(d.attr("data-src",d[0].src),d.attr("src",d.attr("src")),c.hide())},open_video:function(b){var c=a(".flex-video",b.target),e=c.find("iframe");if(e.length>0){var f=e.attr("data-src");if("string"==typeof f)e[0].src=e.attr("data-src");else{var g=e[0].src;e[0].src=d,e[0].src=g}c.show()}},data_attr:function(a){return this.namespace.length>0?this.namespace+"-"+a:a},cache_offset:function(a){var b=a.show().height()+parseInt(a.css("top"),10);return a.hide(),b},off:function(){a(this.scope).off(".fndtn.reveal")},reflow:function(){}}}(jQuery,window,window.document),function(a,b){"use strict";Foundation.libs.slider={name:"slider",version:"5.3.3",settings:{start:0,end:100,step:1,initial:null,display_selector:"",vertical:!1,on_change:function(){}},cache:{},init:function(a,b,c){Foundation.inherit(this,"throttle"),this.bindings(b,c),this.reflow()},events:function(){var c=this;a(this.scope).off(".slider").on("mousedown.fndtn.slider touchstart.fndtn.slider pointerdown.fndtn.slider","["+c.attr_name()+"]:not(.disabled, [disabled]) .range-slider-handle",function(b){c.cache.active||(b.preventDefault(),c.set_active_slider(a(b.target)))}).on("mousemove.fndtn.slider touchmove.fndtn.slider pointermove.fndtn.slider",function(d){if(c.cache.active)if(d.preventDefault(),a.data(c.cache.active[0],"settings").vertical){var e=0;d.pageY||(e=b.scrollY),c.calculate_position(c.cache.active,(d.pageY||d.originalEvent.clientY||d.originalEvent.touches[0].clientY||d.currentPoint.y)+e)}else c.calculate_position(c.cache.active,d.pageX||d.originalEvent.clientX||d.originalEvent.touches[0].clientX||d.currentPoint.x)}).on("mouseup.fndtn.slider touchend.fndtn.slider pointerup.fndtn.slider",function(){c.remove_active_slider()}).on("change.fndtn.slider",function(){c.settings.on_change()}),c.S(b).on("resize.fndtn.slider",c.throttle(function(){c.reflow()},300))},set_active_slider:function(a){this.cache.active=a},remove_active_slider:function(){this.cache.active=null},calculate_position:function(b,c){var d=this,e=a.data(b[0],"settings"),f=(a.data(b[0],"handle_l"),a.data(b[0],"handle_o"),a.data(b[0],"bar_l")),g=a.data(b[0],"bar_o");requestAnimationFrame(function(){var a;a=Foundation.rtl&&!e.vertical?d.limit_to((g+f-c)/f,0,1):d.limit_to((c-g)/f,0,1),a=e.vertical?1-a:a;var h=d.normalized_value(a,e.start,e.end,e.step);d.set_ui(b,h)})},set_ui:function(b,c){var d=a.data(b[0],"settings"),e=a.data(b[0],"handle_l"),f=a.data(b[0],"bar_l"),g=this.normalized_percentage(c,d.start,d.end),h=g*(f-e)-1,i=100*g;Foundation.rtl&&!d.vertical&&(h=-h),h=d.vertical?-h+f-e+1:h,this.set_translate(b,h,d.vertical),d.vertical?b.siblings(".range-slider-active-segment").css("height",i+"%"):b.siblings(".range-slider-active-segment").css("width",i+"%"),b.parent().attr(this.attr_name(),c).trigger("change").trigger("change.fndtn.slider"),b.parent().children("input[type=hidden]").val(c),""!=d.input_id&&a(d.display_selector).each(function(){this.hasOwnProperty("value")?a(this).val(c):a(this).text(c)})},normalized_percentage:function(a,b,c){return(a-b)/(c-b)},normalized_value:function(a,b,c,d){var e=c-b,f=a*e,g=(f-f%d)/d,h=f%d,i=h>=.5*d?d:0;return g*d+i+b},set_translate:function(b,c,d){d?a(b).css("-webkit-transform","translateY("+c+"px)").css("-moz-transform","translateY("+c+"px)").css("-ms-transform","translateY("+c+"px)").css("-o-transform","translateY("+c+"px)").css("transform","translateY("+c+"px)"):a(b).css("-webkit-transform","translateX("+c+"px)").css("-moz-transform","translateX("+c+"px)").css("-ms-transform","translateX("+c+"px)").css("-o-transform","translateX("+c+"px)").css("transform","translateX("+c+"px)")},limit_to:function(a,b,c){return Math.min(Math.max(a,b),c)},initialize_settings:function(b){var c=a.extend({},this.settings,this.data_options(a(b).parent()));c.vertical?(a.data(b,"bar_o",a(b).parent().offset().top),a.data(b,"bar_l",a(b).parent().outerHeight()),a.data(b,"handle_o",a(b).offset().top),a.data(b,"handle_l",a(b).outerHeight())):(a.data(b,"bar_o",a(b).parent().offset().left),a.data(b,"bar_l",a(b).parent().outerWidth()),a.data(b,"handle_o",a(b).offset().left),a.data(b,"handle_l",a(b).outerWidth())),a.data(b,"bar",a(b).parent()),a.data(b,"settings",c)},set_initial_position:function(b){var c=a.data(b.children(".range-slider-handle")[0],"settings"),d=c.initial?c.initial:Math.floor(.5*(c.end-c.start)/c.step)*c.step+c.start,e=b.children(".range-slider-handle");this.set_ui(e,d)},set_value:function(b){var c=this;a("["+c.attr_name()+"]",this.scope).each(function(){a(this).attr(c.attr_name(),b)}),a(this.scope).attr(c.attr_name())&&a(this.scope).attr(c.attr_name(),b),c.reflow()},reflow:function(){var b=this;b.S("["+this.attr_name()+"]").each(function(){var c=a(this).children(".range-slider-handle")[0],d=a(this).attr(b.attr_name());b.initialize_settings(c),d?b.set_ui(a(c),parseFloat(d)):b.set_initial_position(a(this))})}}}(jQuery,window,window.document),function(a,b,c,d){"use strict";Foundation.libs.tab={name:"tab",version:"5.3.3",settings:{active_class:"active",callback:function(){},deep_linking:!1,scroll_to_content:!0,is_hover:!1},default_tab_hashes:[],init:function(a,b,c){var d=this,e=this.S;this.bindings(b,c),this.handle_location_hash_change(),e("["+this.attr_name()+"] > .active > a",this.scope).each(function(){d.default_tab_hashes.push(this.hash)})},events:function(){var a=this,c=this.S;c(this.scope).off(".tab").on("click.fndtn.tab","["+this.attr_name()+"] > * > a",function(b){var d=c(this).closest("["+a.attr_name()+"]").data(a.attr_name(!0)+"-init");(!d.is_hover||Modernizr.touch)&&(b.preventDefault(),b.stopPropagation(),a.toggle_active_tab(c(this).parent()))}).on("mouseenter.fndtn.tab","["+this.attr_name()+"] > * > a",function(){var b=c(this).closest("["+a.attr_name()+"]").data(a.attr_name(!0)+"-init");b.is_hover&&a.toggle_active_tab(c(this).parent())}),c(b).on("hashchange.fndtn.tab",function(b){b.preventDefault(),a.handle_location_hash_change()})},handle_location_hash_change:function(){var b=this,c=this.S;c("["+this.attr_name()+"]",this.scope).each(function(){var e=c(this).data(b.attr_name(!0)+"-init");if(e.deep_linking){var f=b.scope.location.hash;if(""!=f){var g=c(f);if(g.hasClass("content")&&g.parent().hasClass("tab-content"))b.toggle_active_tab(a("["+b.attr_name()+"] > * > a[href="+f+"]").parent());else{var h=g.closest(".content").attr("id");h!=d&&b.toggle_active_tab(a("["+b.attr_name()+"] > * > a[href=#"+h+"]").parent(),f)}}else for(var i in b.default_tab_hashes)b.toggle_active_tab(a("["+b.attr_name()+"] > * > a[href="+b.default_tab_hashes[i]+"]").parent())}})},toggle_active_tab:function(c,e){var f=this.S,g=c.closest("["+this.attr_name()+"]"),h=c.children("a").first(),i="#"+h.attr("href").split("#")[1],j=f(i),k=c.siblings(),l=g.data(this.attr_name(!0)+"-init");if(f(this).data(this.data_attr("tab-content"))&&(i="#"+f(this).data(this.data_attr("tab-content")).split("#")[1],j=f(i)),l.deep_linking){var m=a("body,html").scrollTop();b.location.hash=e!=d?e:i,l.scroll_to_content?e==d||e==i?c.parent()[0].scrollIntoView():f(i)[0].scrollIntoView():(e==d||e==i)&&a("body,html").scrollTop(m)}c.addClass(l.active_class).triggerHandler("opened"),k.removeClass(l.active_class),j.siblings().removeClass(l.active_class).end().addClass(l.active_class),l.callback(c),j.triggerHandler("toggled",[c]),g.triggerHandler("toggled",[j])},data_attr:function(a){return this.namespace.length>0?this.namespace+"-"+a:a},off:function(){},reflow:function(){}}}(jQuery,window,window.document),function(a,b){"use strict";Foundation.libs.tooltip={name:"tooltip",version:"5.3.3",settings:{additional_inheritable_classes:[],tooltip_class:".tooltip",append_to:"body",touch_close_text:"Tap To Close",disable_for_touch:!1,hover_delay:200,show_on:"all",tip_template:function(a,b){return'<span data-selector="'+a+'" class="'+Foundation.libs.tooltip.settings.tooltip_class.substring(1)+'">'+b+'<span class="nub"></span></span>'}},cache:{},init:function(a,b,c){Foundation.inherit(this,"random_str"),this.bindings(b,c)},should_show:function(b){var c=a.extend({},this.settings,this.data_options(b));return"all"===c.show_on?!0:this.small()&&"small"===c.show_on?!0:this.medium()&&"medium"===c.show_on?!0:this.large()&&"large"===c.show_on?!0:!1},medium:function(){return matchMedia(Foundation.media_queries.medium).matches},large:function(){return matchMedia(Foundation.media_queries.large).matches},events:function(b){var c=this,d=c.S;c.create(this.S(b)),a(this.scope).off(".tooltip").on("mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip","["+this.attr_name()+"]",function(b){var e=d(this),f=a.extend({},c.settings,c.data_options(e)),g=!1;if(Modernizr.touch&&/touchstart|MSPointerDown/i.test(b.type)&&d(b.target).is("a"))return!1;if(/mouse/i.test(b.type)&&c.ie_touch(b))return!1;if(e.hasClass("open"))Modernizr.touch&&/touchstart|MSPointerDown/i.test(b.type)&&b.preventDefault(),c.hide(e);else{if(f.disable_for_touch&&Modernizr.touch&&/touchstart|MSPointerDown/i.test(b.type))return;!f.disable_for_touch&&Modernizr.touch&&/touchstart|MSPointerDown/i.test(b.type)&&(b.preventDefault(),d(f.tooltip_class+".open").hide(),g=!0),/enter|over/i.test(b.type)?this.timer=setTimeout(function(){c.showTip(e)}.bind(this),c.settings.hover_delay):"mouseout"===b.type||"mouseleave"===b.type?(clearTimeout(this.timer),c.hide(e)):c.showTip(e)}}).on("mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip","["+this.attr_name()+"].open",function(b){return/mouse/i.test(b.type)&&c.ie_touch(b)?!1:void(("touch"!=a(this).data("tooltip-open-event-type")||"mouseleave"!=b.type)&&("mouse"==a(this).data("tooltip-open-event-type")&&/MSPointerDown|touchstart/i.test(b.type)?c.convert_to_touch(a(this)):c.hide(a(this))))}).on("DOMNodeRemoved DOMAttrModified","["+this.attr_name()+"]:not(a)",function(){c.hide(d(this))})},ie_touch:function(){return!1},showTip:function(a){var b=this.getTip(a);return this.should_show(a,b)?this.show(a):void 0},getTip:function(b){var c=this.selector(b),d=a.extend({},this.settings,this.data_options(b)),e=null;return c&&(e=this.S('span[data-selector="'+c+'"]'+d.tooltip_class)),"object"==typeof e?e:!1},selector:function(a){var b=a.attr("id"),c=a.attr(this.attr_name())||a.attr("data-selector");return(b&&b.length<1||!b)&&"string"!=typeof c&&(c=this.random_str(6),a.attr("data-selector",c)),b&&b.length>0?b:c},create:function(c){var d=this,e=a.extend({},this.settings,this.data_options(c)),f=this.settings.tip_template;"string"==typeof e.tip_template&&b.hasOwnProperty(e.tip_template)&&(f=b[e.tip_template]);var g=a(f(this.selector(c),a("<div></div>").html(c.attr("title")).html())),h=this.inheritable_classes(c);g.addClass(h).appendTo(e.append_to),Modernizr.touch&&(g.append('<span class="tap-to-close">'+e.touch_close_text+"</span>"),g.on("touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip",function(){d.hide(c)})),c.removeAttr("title").attr("title","")},reposition:function(b,c,d){var e,f,g,h,i;if(c.css("visibility","hidden").show(),e=b.data("width"),f=c.children(".nub"),g=f.outerHeight(),h=f.outerHeight(),c.css(this.small()?{width:"100%"}:{width:e?e:"auto"}),i=function(a,b,c,d,e){return a.css({top:b?b:"auto",bottom:d?d:"auto",left:e?e:"auto",right:c?c:"auto"}).end()},i(c,b.offset().top+b.outerHeight()+10,"auto","auto",b.offset().left),this.small())i(c,b.offset().top+b.outerHeight()+10,"auto","auto",12.5,a(this.scope).width()),c.addClass("tip-override"),i(f,-g,"auto","auto",b.offset().left);else{var j=b.offset().left;Foundation.rtl&&(f.addClass("rtl"),j=b.offset().left+b.outerWidth()-c.outerWidth()),i(c,b.offset().top+b.outerHeight()+10,"auto","auto",j),c.removeClass("tip-override"),d&&d.indexOf("tip-top")>-1?(Foundation.rtl&&f.addClass("rtl"),i(c,b.offset().top-c.outerHeight(),"auto","auto",j).removeClass("tip-override")):d&&d.indexOf("tip-left")>-1?(i(c,b.offset().top+b.outerHeight()/2-c.outerHeight()/2,"auto","auto",b.offset().left-c.outerWidth()-g).removeClass("tip-override"),f.removeClass("rtl")):d&&d.indexOf("tip-right")>-1&&(i(c,b.offset().top+b.outerHeight()/2-c.outerHeight()/2,"auto","auto",b.offset().left+b.outerWidth()+g).removeClass("tip-override"),f.removeClass("rtl"))}c.css("visibility","visible").hide()},small:function(){return matchMedia(Foundation.media_queries.small).matches&&!matchMedia(Foundation.media_queries.medium).matches},inheritable_classes:function(b){var c=a.extend({},this.settings,this.data_options(b)),d=["tip-top","tip-left","tip-bottom","tip-right","radius","round"].concat(c.additional_inheritable_classes),e=b.attr("class"),f=e?a.map(e.split(" "),function(b){return-1!==a.inArray(b,d)?b:void 0}).join(" "):"";return a.trim(f)},convert_to_touch:function(b){var c=this,d=c.getTip(b),e=a.extend({},c.settings,c.data_options(b));0===d.find(".tap-to-close").length&&(d.append('<span class="tap-to-close">'+e.touch_close_text+"</span>"),d.on("click.fndtn.tooltip.tapclose touchstart.fndtn.tooltip.tapclose MSPointerDown.fndtn.tooltip.tapclose",function(){c.hide(b)})),b.data("tooltip-open-event-type","touch")},show:function(a){var b=this.getTip(a);"touch"==a.data("tooltip-open-event-type")&&this.convert_to_touch(a),this.reposition(a,b,a.attr("class")),a.addClass("open"),b.fadeIn(150)},hide:function(a){var b=this.getTip(a);b.fadeOut(150,function(){b.find(".tap-to-close").remove(),b.off("click.fndtn.tooltip.tapclose MSPointerDown.fndtn.tapclose"),a.removeClass("open")})},off:function(){var b=this;this.S(this.scope).off(".fndtn.tooltip"),this.S(this.settings.tooltip_class).each(function(c){a("["+b.attr_name()+"]").eq(c).attr("title",a(this).text())}).remove()},reflow:function(){}}}(jQuery,window,window.document),function(a,b,c){"use strict";Foundation.libs.topbar={name:"topbar",version:"5.3.3",settings:{index:0,sticky_class:"sticky",custom_back_text:!0,back_text:"Back",mobile_show_parent_link:!0,is_hover:!0,scrolltop:!0,sticky_on:"all"},init:function(b,c,d){Foundation.inherit(this,"add_custom_rule register_media throttle");var e=this;e.register_media("topbar","foundation-mq-topbar"),this.bindings(c,d),e.S("["+this.attr_name()+"]",this.scope).each(function(){{var b=a(this),c=b.data(e.attr_name(!0)+"-init");e.S("section",this)}b.data("index",0);var d=b.parent();d.hasClass("fixed")||e.is_sticky(b,d,c)?(e.settings.sticky_class=c.sticky_class,e.settings.sticky_topbar=b,b.data("height",d.outerHeight()),b.data("stickyoffset",d.offset().top)):b.data("height",b.outerHeight()),c.assembled||e.assemble(b),c.is_hover?e.S(".has-dropdown",b).addClass("not-click"):e.S(".has-dropdown",b).removeClass("not-click"),e.add_custom_rule(".f-topbar-fixed { padding-top: "+b.data("height")+"px }"),d.hasClass("fixed")&&e.S("body").addClass("f-topbar-fixed")})},is_sticky:function(a,b,c){var d=b.hasClass(c.sticky_class);return d&&"all"===c.sticky_on?!0:d&&this.small()&&"small"===c.sticky_on?matchMedia(Foundation.media_queries.small).matches&&!matchMedia(Foundation.media_queries.medium).matches&&!matchMedia(Foundation.media_queries.large).matches:d&&this.medium()&&"medium"===c.sticky_on?matchMedia(Foundation.media_queries.small).matches&&matchMedia(Foundation.media_queries.medium).matches&&!matchMedia(Foundation.media_queries.large).matches:d&&this.large()&&"large"===c.sticky_on?matchMedia(Foundation.media_queries.small).matches&&matchMedia(Foundation.media_queries.medium).matches&&matchMedia(Foundation.media_queries.large).matches:!1},toggle:function(c){var d,e=this;d=c?e.S(c).closest("["+this.attr_name()+"]"):e.S("["+this.attr_name()+"]");var f=d.data(this.attr_name(!0)+"-init"),g=e.S("section, .section",d);e.breakpoint()&&(e.rtl?(g.css({right:"0%"}),a(">.name",g).css({right:"100%"})):(g.css({left:"0%"}),a(">.name",g).css({left:"100%"})),e.S("li.moved",g).removeClass("moved"),d.data("index",0),d.toggleClass("expanded").css("height","")),f.scrolltop?d.hasClass("expanded")?d.parent().hasClass("fixed")&&(f.scrolltop?(d.parent().removeClass("fixed"),d.addClass("fixed"),e.S("body").removeClass("f-topbar-fixed"),b.scrollTo(0,0)):d.parent().removeClass("expanded")):d.hasClass("fixed")&&(d.parent().addClass("fixed"),d.removeClass("fixed"),e.S("body").addClass("f-topbar-fixed")):(e.is_sticky(d,d.parent(),f)&&d.parent().addClass("fixed"),d.parent().hasClass("fixed")&&(d.hasClass("expanded")?(d.addClass("fixed"),d.parent().addClass("expanded"),e.S("body").addClass("f-topbar-fixed")):(d.removeClass("fixed"),d.parent().removeClass("expanded"),e.update_sticky_positioning())))},timer:null,events:function(){var c=this,d=this.S;d(this.scope).off(".topbar").on("click.fndtn.topbar","["+this.attr_name()+"] .toggle-topbar",function(a){a.preventDefault(),c.toggle(this)}).on("click.fndtn.topbar",'.top-bar .top-bar-section li a[href^="#"],['+this.attr_name()+'] .top-bar-section li a[href^="#"]',function(){var b=a(this).closest("li");!c.breakpoint()||b.hasClass("back")||b.hasClass("has-dropdown")||c.toggle()}).on("click.fndtn.topbar","["+this.attr_name()+"] li.has-dropdown",function(b){var e=d(this),f=d(b.target),g=e.closest("["+c.attr_name()+"]"),h=g.data(c.attr_name(!0)+"-init");return f.data("revealId")?void c.toggle():void(c.breakpoint()||(!h.is_hover||Modernizr.touch)&&(b.stopImmediatePropagation(),e.hasClass("hover")?(e.removeClass("hover").find("li").removeClass("hover"),e.parents("li.hover").removeClass("hover")):(e.addClass("hover"),a(e).siblings().removeClass("hover"),"A"===f[0].nodeName&&f.parent().hasClass("has-dropdown")&&b.preventDefault())))}).on("click.fndtn.topbar","["+this.attr_name()+"] .has-dropdown>a",function(a){if(c.breakpoint()){a.preventDefault();var b=d(this),e=b.closest("["+c.attr_name()+"]"),f=e.find("section, .section"),g=(b.next(".dropdown").outerHeight(),b.closest("li"));e.data("index",e.data("index")+1),g.addClass("moved"),c.rtl?(f.css({right:-(100*e.data("index"))+"%"}),f.find(">.name").css({right:100*e.data("index")+"%"})):(f.css({left:-(100*e.data("index"))+"%"}),f.find(">.name").css({left:100*e.data("index")+"%"})),e.css("height",b.siblings("ul").outerHeight(!0)+e.data("height"))}}),d(b).off(".topbar").on("resize.fndtn.topbar",c.throttle(function(){c.resize.call(c)},50)).trigger("resize").trigger("resize.fndtn.topbar"),d("body").off(".topbar").on("click.fndtn.topbar",function(a){var b=d(a.target).closest("li").closest("li.hover");b.length>0||d("["+c.attr_name()+"] li.hover").removeClass("hover")}),d(this.scope).on("click.fndtn.topbar","["+this.attr_name()+"] .has-dropdown .back",function(a){a.preventDefault();var b=d(this),e=b.closest("["+c.attr_name()+"]"),f=e.find("section, .section"),g=(e.data(c.attr_name(!0)+"-init"),b.closest("li.moved")),h=g.parent();e.data("index",e.data("index")-1),c.rtl?(f.css({right:-(100*e.data("index"))+"%"}),f.find(">.name").css({right:100*e.data("index")+"%"})):(f.css({left:-(100*e.data("index"))+"%"}),f.find(">.name").css({left:100*e.data("index")+"%"})),0===e.data("index")?e.css("height",""):e.css("height",h.outerHeight(!0)+e.data("height")),setTimeout(function(){g.removeClass("moved")},300)})},resize:function(){var a=this;a.S("["+this.attr_name()+"]").each(function(){var b,d=a.S(this),e=d.data(a.attr_name(!0)+"-init"),f=d.parent("."+a.settings.sticky_class);if(!a.breakpoint()){var g=d.hasClass("expanded");d.css("height","").removeClass("expanded").find("li").removeClass("hover"),g&&a.toggle(d)}a.is_sticky(d,f,e)&&(f.hasClass("fixed")?(f.removeClass("fixed"),b=f.offset().top,a.S(c.body).hasClass("f-topbar-fixed")&&(b-=d.data("height")),d.data("stickyoffset",b),f.addClass("fixed")):(b=f.offset().top,d.data("stickyoffset",b)))})},breakpoint:function(){return!matchMedia(Foundation.media_queries.topbar).matches},small:function(){return matchMedia(Foundation.media_queries.small).matches},medium:function(){return matchMedia(Foundation.media_queries.medium).matches},large:function(){return matchMedia(Foundation.media_queries.large).matches},assemble:function(b){var c=this,d=b.data(this.attr_name(!0)+"-init"),e=c.S("section",b);e.detach(),c.S(".has-dropdown>a",e).each(function(){var b,e=c.S(this),f=e.siblings(".dropdown"),g=e.attr("href");f.find(".title.back").length||(b=a(1==d.mobile_show_parent_link&&g?'<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li><li class="parent-link show-for-small"><a class="parent-link js-generated" href="'+g+'">'+e.html()+"</a></li>":'<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5>'),a("h5>a",b).html(1==d.custom_back_text?d.back_text:"&laquo; "+e.html()),f.prepend(b))}),e.appendTo(b),this.sticky(),this.assembled(b)},assembled:function(b){b.data(this.attr_name(!0),a.extend({},b.data(this.attr_name(!0)),{assembled:!0}))},height:function(b){var c=0,d=this;return a("> li",b).each(function(){c+=d.S(this).outerHeight(!0)}),c},sticky:function(){var a=this;this.S(b).on("scroll",function(){a.update_sticky_positioning()})},update_sticky_positioning:function(){var a="."+this.settings.sticky_class,c=this.S(b),d=this;if(d.settings.sticky_topbar&&d.is_sticky(this.settings.sticky_topbar,this.settings.sticky_topbar.parent(),this.settings)){var e=this.settings.sticky_topbar.data("stickyoffset");d.S(a).hasClass("expanded")||(c.scrollTop()>e?d.S(a).hasClass("fixed")||(d.S(a).addClass("fixed"),d.S("body").addClass("f-topbar-fixed")):c.scrollTop()<=e&&d.S(a).hasClass("fixed")&&(d.S(a).removeClass("fixed"),d.S("body").removeClass("f-topbar-fixed")))}},off:function(){this.S(this.scope).off(".fndtn.topbar"),this.S(b).off(".fndtn.topbar")},reflow:function(){}}}(jQuery,this,this.document);;
'function' != typeof Object.create &&
	(Object.create = function(t) {
		function e() {}
		return (e.prototype = t), new e();
	}),
	(function(l, p, m) {
		var o = {
			init: function(t, e) {
				var o = this;
				(o.$elem = l(e)), (o.options = l.extend({}, l.fn.owlCarousel.options, o.$elem.data(), t)), (o.userOptions = t), o.loadContent();
			},
			loadContent: function() {
				var t,
					i = this;
				'function' == typeof i.options.beforeInit && i.options.beforeInit.apply(this, [i.$elem]),
					'string' == typeof i.options.jsonPath
						? ((t = i.options.jsonPath),
						  l.getJSON(t, function(t) {
								var e,
									o = '';
								if ('function' == typeof i.options.jsonSuccess) i.options.jsonSuccess.apply(this, [t]);
								else {
									for (e in t.owl) t.owl.hasOwnProperty(e) && (o += t.owl[e].item);
									i.$elem.html(o);
								}
								i.logIn();
						  }))
						: i.logIn();
			},
			logIn: function() {
				var t = this;
				t.$elem.data('owl-originalStyles', t.$elem.attr('style')).data('owl-originalClasses', t.$elem.attr('class')),
					t.$elem.css({ opacity: 0 }),
					(t.orignalItems = t.options.items),
					t.checkBrowser(),
					(t.wrapperWidth = 0),
					(t.checkVisible = null),
					t.setVars();
			},
			setVars: function() {
				var t = this;
				if (0 === t.$elem.children().length) return !1;
				t.baseClass(),
					t.eventTypes(),
					(t.$userItems = t.$elem.children()),
					(t.itemsAmount = t.$userItems.length),
					t.wrapItems(),
					(t.$owlItems = t.$elem.find('.owl-item')),
					(t.$owlWrapper = t.$elem.find('.owl-wrapper')),
					(t.playDirection = 'next'),
					(t.prevItem = 0),
					(t.prevArr = [0]),
					(t.currentItem = 0),
					t.customEvents(),
					t.onStartup();
			},
			onStartup: function() {
				var t = this;
				t.updateItems(),
					t.calculateAll(),
					t.buildControls(),
					t.updateControls(),
					t.response(),
					t.moveEvents(),
					t.stopOnHover(),
					t.owlStatus(),
					!1 !== t.options.transitionStyle && t.transitionTypes(t.options.transitionStyle),
					!0 === t.options.autoPlay && (t.options.autoPlay = 5e3),
					t.play(),
					t.$elem.find('.owl-wrapper').css('display', 'block'),
					t.$elem.is(':visible') ? t.$elem.css('opacity', 1) : t.watchVisibility(),
					(t.onstartup = !1),
					t.eachMoveUpdate(),
					'function' == typeof t.options.afterInit && t.options.afterInit.apply(this, [t.$elem]);
			},
			eachMoveUpdate: function() {
				var t = this;
				!0 === t.options.lazyLoad && t.lazyLoad(),
					!0 === t.options.autoHeight && t.autoHeight(),
					t.onVisibleItems(),
					'function' == typeof t.options.afterAction && t.options.afterAction.apply(this, [t.$elem]);
			},
			updateVars: function() {
				var t = this;
				'function' == typeof t.options.beforeUpdate && t.options.beforeUpdate.apply(this, [t.$elem]),
					t.watchVisibility(),
					t.updateItems(),
					t.calculateAll(),
					t.updatePosition(),
					t.updateControls(),
					t.eachMoveUpdate(),
					'function' == typeof t.options.afterUpdate && t.options.afterUpdate.apply(this, [t.$elem]);
			},
			reload: function() {
				var t = this;
				p.setTimeout(function() {
					t.updateVars();
				}, 0);
			},
			watchVisibility: function() {
				var t = this;
				if (!1 !== t.$elem.is(':visible')) return !1;
				t.$elem.css({ opacity: 0 }),
					p.clearInterval(t.autoPlayInterval),
					p.clearInterval(t.checkVisible),
					(t.checkVisible = p.setInterval(function() {
						t.$elem.is(':visible') && (t.reload(), t.$elem.animate({ opacity: 1 }, 200), p.clearInterval(t.checkVisible));
					}, 500));
			},
			wrapItems: function() {
				var t = this;
				t.$userItems.wrapAll('<div class="owl-wrapper">').wrap('<div class="owl-item"></div>'),
					t.$elem.find('.owl-wrapper').wrap('<div class="owl-wrapper-outer">'),
					(t.wrapperOuter = t.$elem.find('.owl-wrapper-outer')),
					t.$elem.css('display', 'block');
			},
			baseClass: function() {
				var t = this,
					e = t.$elem.hasClass(t.options.baseClass),
					o = t.$elem.hasClass(t.options.theme);
				e || t.$elem.addClass(t.options.baseClass), o || t.$elem.addClass(t.options.theme);
			},
			updateItems: function() {
				var t,
					e,
					o = this;
				if (!1 === o.options.responsive) return !1;
				if (!0 === o.options.singleItem)
					return (
						(o.options.items = o.orignalItems = 1),
						(o.options.itemsCustom = !1),
						(o.options.itemsDesktop = !1),
						(o.options.itemsDesktopSmall = !1),
						(o.options.itemsTablet = !1),
						(o.options.itemsTabletSmall = !1),
						(o.options.itemsMobile = !1)
					);
				if (
					((t = l(o.options.responsiveBaseWidth).width()) > (o.options.itemsDesktop[0] || o.orignalItems) && (o.options.items = o.orignalItems),
					!1 !== o.options.itemsCustom)
				)
					for (
						o.options.itemsCustom.sort(function(t, e) {
							return t[0] - e[0];
						}),
							e = 0;
						e < o.options.itemsCustom.length;
						e += 1
					)
						o.options.itemsCustom[e][0] <= t && (o.options.items = o.options.itemsCustom[e][1]);
				else
					t <= o.options.itemsDesktop[0] && !1 !== o.options.itemsDesktop && (o.options.items = o.options.itemsDesktop[1]),
						t <= o.options.itemsDesktopSmall[0] && !1 !== o.options.itemsDesktopSmall && (o.options.items = o.options.itemsDesktopSmall[1]),
						t <= o.options.itemsTablet[0] && !1 !== o.options.itemsTablet && (o.options.items = o.options.itemsTablet[1]),
						t <= o.options.itemsTabletSmall[0] && !1 !== o.options.itemsTabletSmall && (o.options.items = o.options.itemsTabletSmall[1]),
						t <= o.options.itemsMobile[0] && !1 !== o.options.itemsMobile && (o.options.items = o.options.itemsMobile[1]);
				o.options.items > o.itemsAmount && !0 === o.options.itemsScaleUp && (o.options.items = o.itemsAmount);
			},
			response: function() {
				var t,
					e,
					o = this;
				if (!0 !== o.options.responsive) return !1;
				(e = l(p).width()),
					(o.resizer = function() {
						l(p).width() !== e &&
							(!1 !== o.options.autoPlay && p.clearInterval(o.autoPlayInterval),
							p.clearTimeout(t),
							(t = p.setTimeout(function() {
								(e = l(p).width()), o.updateVars();
							}, o.options.responsiveRefreshRate)));
					}),
					l(p).resize(o.resizer);
			},
			updatePosition: function() {
				var t = this;
				t.jumpTo(t.currentItem), !1 !== t.options.autoPlay && t.checkAp();
			},
			appendItemsSizes: function() {
				var o = this,
					i = 0,
					s = o.itemsAmount - o.options.items;
				o.$owlItems.each(function(t) {
					var e = l(this);
					e.css({ width: o.itemWidth }).data('owl-item', Number(t)),
						(t % o.options.items != 0 && t !== s) || s < t || (i += 1),
						e.data('owl-roundPages', i);
				});
			},
			appendWrapperSizes: function() {
				var t = this,
					e = t.$owlItems.length * t.itemWidth;
				t.$owlWrapper.css({ width: 2 * e, left: 0 }), t.appendItemsSizes();
			},
			calculateAll: function() {
				var t = this;
				t.calculateWidth(), t.appendWrapperSizes(), t.loops(), t.max();
			},
			calculateWidth: function() {
				var t = this;
				t.itemWidth = Math.round(t.$elem.width() / t.options.items);
			},
			max: function() {
				var t = this,
					e = -1 * (t.itemsAmount * t.itemWidth - t.options.items * t.itemWidth);
				return (
					t.options.items > t.itemsAmount
						? ((e = t.maximumItem = 0), (t.maximumPixels = 0))
						: ((t.maximumItem = t.itemsAmount - t.options.items), (t.maximumPixels = e)),
					e
				);
			},
			min: function() {
				return 0;
			},
			loops: function() {
				var t,
					e,
					o = this,
					i = 0,
					s = 0;
				for (o.positionsInArray = [0], o.pagesInArray = [], t = 0; t < o.itemsAmount; t += 1)
					(s += o.itemWidth),
						o.positionsInArray.push(-s),
						!0 === o.options.scrollPerPage &&
							(e = l(o.$owlItems[t]).data('owl-roundPages')) !== i &&
							((o.pagesInArray[i] = o.positionsInArray[t]), (i = e));
			},
			buildControls: function() {
				var t = this;
				(!0 !== t.options.navigation && !0 !== t.options.pagination) ||
					(t.owlControls = l('<div class="owl-controls"/>')
						.toggleClass('clickable', !t.browser.isTouch)
						.appendTo(t.$elem)),
					!0 === t.options.pagination && (t.buildPagination(), t.buildPause()),
					!0 === t.options.navigation && t.buildButtons();
			},
			buildButtons: function() {
				var e = this,
					t = l('<div class="owl-buttons"/>');
				e.owlControls.append(t),
					(e.buttonPrev = l('<div/>', { class: 'owl-prev', html: e.options.navigationText[0] || '' })),
					(e.buttonNext = l('<div/>', { class: 'owl-next', html: e.options.navigationText[1] || '' })),
					t.append(e.buttonPrev).append(e.buttonNext),
					t.on('touchstart.owlControls mousedown.owlControls', 'div[class^="owl"]', function(t) {
						t.preventDefault();
					}),
					t.on('touchend.owlControls mouseup.owlControls', 'div[class^="owl"]', function(t) {
						t.preventDefault(), l(this).hasClass('owl-next') ? e.next() : e.prev();
					});
			},
			buildPause: function() {
				var t = this;
				(t.ctrlBtn = l('<div class="owl-ctrl owl-pause"></div>')),
					t.owlControls.prepend(t.ctrlBtn),
					t.ctrlBtn.on('click', function() {
						t.ctrlBtn.hasClass('owl-pause')
							? (t.ctrlBtn.trigger('owl.stop'), t.ctrlBtn.removeClass('owl-pause').addClass('owl-play'))
							: (t.ctrlBtn.trigger('owl.play', t.options.autoPlay), t.ctrlBtn.removeClass('owl-play').addClass('owl-pause'));
					});
			},
			buildPagination: function() {
				var e = this;
				(e.paginationWrapper = l('<div class="owl-pagination"/>')),
					e.owlControls.append(e.paginationWrapper),
					e.paginationWrapper.on('touchend.owlControls mouseup.owlControls', '.owl-page', function(t) {
						t.preventDefault(), Number(l(this).data('owl-page')) !== e.currentItem && e.goTo(Number(l(this).data('owl-page')), !0);
					});
			},
			updatePagination: function() {
				var t,
					e,
					o,
					i,
					s,
					n,
					a = this;
				if (!1 === a.options.pagination) return !1;
				for (a.paginationWrapper.html(''), t = 0, e = a.itemsAmount - (a.itemsAmount % a.options.items), i = 0; i < a.itemsAmount; i += 1)
					i % a.options.items == 0 &&
						((t += 1),
						e === i && (o = a.itemsAmount - a.options.items),
						(s = l('<div/>', { class: 'owl-page' })),
						(n = l('<span></span>', {
							text: !0 === a.options.paginationNumbers ? t : '',
							class: !0 === a.options.paginationNumbers ? 'owl-numbers' : ''
						})),
						s.append(n),
						s.data('owl-page', e === i ? o : i),
						s.data('owl-roundPages', t),
						a.paginationWrapper.append(s));
				a.checkPagination();
			},
			checkPagination: function() {
				var t = this;
				if (!1 === t.options.pagination) return !1;
				t.paginationWrapper.find('.owl-page').each(function() {
					l(this).data('owl-roundPages') === l(t.$owlItems[t.currentItem]).data('owl-roundPages') &&
						(t.paginationWrapper.find('.owl-page').removeClass('active'), l(this).addClass('active'));
				});
			},
			checkNavigation: function() {
				var t = this;
				if (!1 === t.options.navigation) return !1;
				!1 === t.options.rewindNav &&
					(0 === t.currentItem && 0 === t.maximumItem
						? (t.buttonPrev.addClass('disabled'), t.buttonNext.addClass('disabled'))
						: 0 === t.currentItem && 0 !== t.maximumItem
							? (t.buttonPrev.addClass('disabled'), t.buttonNext.removeClass('disabled'))
							: t.currentItem === t.maximumItem
								? (t.buttonPrev.removeClass('disabled'), t.buttonNext.addClass('disabled'))
								: 0 !== t.currentItem &&
								  t.currentItem !== t.maximumItem &&
								  (t.buttonPrev.removeClass('disabled'), t.buttonNext.removeClass('disabled')));
			},
			updateControls: function() {
				var t = this;
				t.updatePagination(), t.checkNavigation(), t.owlControls && (t.options.items >= t.itemsAmount ? t.owlControls.hide() : t.owlControls.show());
			},
			destroyControls: function() {
				this.owlControls && this.owlControls.remove();
			},
			next: function(t) {
				var e = this;
				if (e.isTransition) return !1;
				if (
					((e.currentItem += !0 === e.options.scrollPerPage ? e.options.items : 1),
					e.currentItem > e.maximumItem + (!0 === e.options.scrollPerPage ? e.options.items - 1 : 0))
				) {
					if (!0 !== e.options.rewindNav) return (e.currentItem = e.maximumItem), !1;
					(e.currentItem = 0), (t = 'rewind');
				}
				e.goTo(e.currentItem, t);
			},
			prev: function(t) {
				var e = this;
				if (e.isTransition) return !1;
				if (
					(!0 === e.options.scrollPerPage && 0 < e.currentItem && e.currentItem < e.options.items
						? (e.currentItem = 0)
						: (e.currentItem -= !0 === e.options.scrollPerPage ? e.options.items : 1),
					e.currentItem < 0)
				) {
					if (!0 !== e.options.rewindNav) return (e.currentItem = 0), !1;
					(e.currentItem = e.maximumItem), (t = 'rewind');
				}
				e.goTo(e.currentItem, t);
			},
			goTo: function(t, e, o) {
				var i,
					s = this;
				return (
					!s.isTransition &&
					('function' == typeof s.options.beforeMove && s.options.beforeMove.apply(this, [s.$elem]),
					t >= s.maximumItem ? (t = s.maximumItem) : t <= 0 && (t = 0),
					(s.currentItem = s.owl.currentItem = t),
					!1 !== s.options.transitionStyle && 'drag' !== o && 1 === s.options.items && !0 === s.browser.support3d
						? (s.swapSpeed(0),
						  !0 === s.browser.support3d ? s.transition3d(s.positionsInArray[t]) : s.css2slide(s.positionsInArray[t], 1),
						  s.afterGo(),
						  s.singleItemTransition(),
						  !1)
						: ((i = s.positionsInArray[t]),
						  !0 === s.browser.support3d
								? (!(s.isCss3Finish = !1) === e
										? (s.swapSpeed('paginationSpeed'),
										  p.setTimeout(function() {
												s.isCss3Finish = !0;
										  }, s.options.paginationSpeed))
										: 'rewind' === e
											? (s.swapSpeed(s.options.rewindSpeed),
											  p.setTimeout(function() {
													s.isCss3Finish = !0;
											  }, s.options.rewindSpeed))
											: (s.swapSpeed('slideSpeed'),
											  p.setTimeout(function() {
													s.isCss3Finish = !0;
											  }, s.options.slideSpeed)),
								  s.transition3d(i))
								: !0 === e
									? s.css2slide(i, s.options.paginationSpeed)
									: 'rewind' === e
										? s.css2slide(i, s.options.rewindSpeed)
										: s.css2slide(i, s.options.slideSpeed),
						  void s.afterGo()))
				);
			},
			jumpTo: function(t) {
				var e = this;
				'function' == typeof e.options.beforeMove && e.options.beforeMove.apply(this, [e.$elem]),
					t >= e.maximumItem || -1 === t ? (t = e.maximumItem) : t <= 0 && (t = 0),
					e.swapSpeed(0),
					!0 === e.browser.support3d ? e.transition3d(e.positionsInArray[t]) : e.css2slide(e.positionsInArray[t], 1),
					(e.currentItem = e.owl.currentItem = t),
					e.afterGo();
			},
			afterGo: function() {
				var t = this;
				t.prevArr.push(t.currentItem),
					(t.prevItem = t.owl.prevItem = t.prevArr[t.prevArr.length - 2]),
					t.prevArr.shift(0),
					t.prevItem !== t.currentItem && (t.checkPagination(), t.checkNavigation(), t.eachMoveUpdate(), !1 !== t.options.autoPlay && t.checkAp()),
					'function' == typeof t.options.afterMove && t.prevItem !== t.currentItem && t.options.afterMove.apply(this, [t.$elem]);
			},
			stop: function() {
				(this.apStatus = 'stop'), p.clearInterval(this.autoPlayInterval);
			},
			checkAp: function() {
				'stop' !== this.apStatus && this.play();
			},
			play: function() {
				var t = this;
				if (!(t.apStatus = 'play') === t.options.autoPlay) return !1;
				p.clearInterval(t.autoPlayInterval),
					(t.autoPlayInterval = p.setInterval(function() {
						t.next(!0);
					}, t.options.autoPlay));
			},
			swapSpeed: function(t) {
				var e = this;
				'slideSpeed' === t
					? e.$owlWrapper.css(e.addCssSpeed(e.options.slideSpeed))
					: 'paginationSpeed' === t
						? e.$owlWrapper.css(e.addCssSpeed(e.options.paginationSpeed))
						: 'string' != typeof t && e.$owlWrapper.css(e.addCssSpeed(t));
			},
			addCssSpeed: function(t) {
				return {
					'-webkit-transition': 'all ' + t + 'ms ease',
					'-moz-transition': 'all ' + t + 'ms ease',
					'-o-transition': 'all ' + t + 'ms ease',
					transition: 'all ' + t + 'ms ease'
				};
			},
			removeTransition: function() {
				return { '-webkit-transition': '', '-moz-transition': '', '-o-transition': '', transition: '' };
			},
			doTranslate: function(t) {
				return {
					'-webkit-transform': 'translate3d(' + t + 'px, 0px, 0px)',
					'-moz-transform': 'translate3d(' + t + 'px, 0px, 0px)',
					'-o-transform': 'translate3d(' + t + 'px, 0px, 0px)',
					'-ms-transform': 'translate3d(' + t + 'px, 0px, 0px)',
					transform: 'translate3d(' + t + 'px, 0px,0px)'
				};
			},
			transition3d: function(t) {
				this.$owlWrapper.css(this.doTranslate(t));
			},
			css2move: function(t) {
				this.$owlWrapper.css({ left: t });
			},
			css2slide: function(t, e) {
				var o = this;
				(o.isCssFinish = !1),
					o.$owlWrapper.stop(!0, !0).animate(
						{ left: t },
						{
							duration: e || o.options.slideSpeed,
							complete: function() {
								o.isCssFinish = !0;
							}
						}
					);
			},
			checkBrowser: function() {
				var t,
					e,
					o,
					i,
					s = 'translate3d(0px, 0px, 0px)',
					n = m.createElement('div');
				(n.style.cssText = '  -moz-transform:' + s + '; -ms-transform:' + s + '; -o-transform:' + s + '; -webkit-transform:' + s + '; transform:' + s),
					(t = /translate3d\(0px, 0px, 0px\)/g),
					(o = null !== (e = n.style.cssText.match(t)) && 1 === e.length),
					(i = 'ontouchstart' in p || p.navigator.msMaxTouchPoints),
					(this.browser = { support3d: o, isTouch: i });
			},
			moveEvents: function() {
				(!1 === this.options.mouseDrag && !1 === this.options.touchDrag) || (this.gestures(), this.disabledEvents());
			},
			eventTypes: function() {
				var t = this,
					e = ['s', 'e', 'x'];
				(t.ev_types = {}),
					!0 === t.options.mouseDrag && !0 === t.options.touchDrag
						? (e = ['touchstart.owl mousedown.owl', 'touchmove.owl mousemove.owl', 'touchend.owl touchcancel.owl mouseup.owl'])
						: !1 === t.options.mouseDrag && !0 === t.options.touchDrag
							? (e = ['touchstart.owl', 'touchmove.owl', 'touchend.owl touchcancel.owl'])
							: !0 === t.options.mouseDrag && !1 === t.options.touchDrag && (e = ['mousedown.owl', 'mousemove.owl', 'mouseup.owl']),
					(t.ev_types.start = e[0]),
					(t.ev_types.move = e[1]),
					(t.ev_types.end = e[2]);
			},
			disabledEvents: function() {
				this.$elem.on('dragstart.owl', function(t) {
					t.preventDefault();
				}),
					this.$elem.on('mousedown.disableTextSelect', function(t) {
						return l(t.target).is('input, textarea, select, option');
					});
			},
			gestures: function() {
				var n = this,
					a = {
						offsetX: 0,
						offsetY: 0,
						baseElWidth: 0,
						relativePos: 0,
						position: null,
						minSwipe: null,
						maxSwipe: null,
						sliding: null,
						dargging: null,
						targetElement: null
					};
				function s(t) {
					if (void 0 !== t.touches) return { x: t.touches[0].pageX, y: t.touches[0].pageY };
					if (void 0 === t.touches) {
						if (void 0 !== t.pageX) return { x: t.pageX, y: t.pageY };
						if (void 0 === t.pageX) return { x: t.clientX, y: t.clientY };
					}
				}
				function r(t) {
					'on' === t
						? (l(m).on(n.ev_types.move, e), l(m).on(n.ev_types.end, o))
						: 'off' === t && (l(m).off(n.ev_types.move), l(m).off(n.ev_types.end));
				}
				function e(t) {
					var e,
						o,
						i = t.originalEvent || t || p.event;
					(n.newPosX = s(i).x - a.offsetX),
						(n.newPosY = s(i).y - a.offsetY),
						(n.newRelativeX = n.newPosX - a.relativePos),
						'function' == typeof n.options.startDragging &&
							!0 !== a.dragging &&
							0 !== n.newRelativeX &&
							((a.dragging = !0), n.options.startDragging.apply(n, [n.$elem])),
						(8 < n.newRelativeX || n.newRelativeX < -8) &&
							!0 === n.browser.isTouch &&
							(void 0 !== i.preventDefault ? i.preventDefault() : (i.returnValue = !1), (a.sliding = !0)),
						(10 < n.newPosY || n.newPosY < -10) && !1 === a.sliding && l(m).off('touchmove.owl'),
						(e = function() {
							return n.newRelativeX / 5;
						}),
						(o = function() {
							return n.maximumPixels + n.newRelativeX / 5;
						}),
						(n.newPosX = Math.max(Math.min(n.newPosX, e()), o())),
						!0 === n.browser.support3d ? n.transition3d(n.newPosX) : n.css2move(n.newPosX);
				}
				function o(t) {
					var e,
						o,
						i,
						s = t.originalEvent || t || p.event;
					(s.target = s.target || s.srcElement),
						!(a.dragging = !1) !== n.browser.isTouch && n.$owlWrapper.removeClass('grabbing'),
						n.newRelativeX < 0 ? (n.dragDirection = n.owl.dragDirection = 'left') : (n.dragDirection = n.owl.dragDirection = 'right'),
						0 !== n.newRelativeX &&
							((e = n.getNewPosition()),
							n.goTo(e, !1, 'drag'),
							a.targetElement === s.target &&
								!0 !== n.browser.isTouch &&
								(l(s.target).on('click.disable', function(t) {
									t.stopImmediatePropagation(), t.stopPropagation(), t.preventDefault(), l(t.target).off('click.disable');
								}),
								(i = (o = l._data(s.target, 'events').click).pop()),
								o.splice(0, 0, i))),
						r('off');
				}
				(n.isCssFinish = !0),
					n.$elem.on(n.ev_types.start, '.owl-wrapper', function(t) {
						var e,
							o = t.originalEvent || t || p.event;
						if (3 === o.which) return !1;
						if (!(n.itemsAmount <= n.options.items)) {
							if (!1 === n.isCssFinish && !n.options.dragBeforeAnimFinish) return !1;
							if (!1 === n.isCss3Finish && !n.options.dragBeforeAnimFinish) return !1;
							!1 !== n.options.autoPlay && p.clearInterval(n.autoPlayInterval),
								!0 === n.browser.isTouch || n.$owlWrapper.hasClass('grabbing') || n.$owlWrapper.addClass('grabbing'),
								(n.newPosX = 0),
								(n.newRelativeX = 0),
								l(this).css(n.removeTransition()),
								(e = l(this).position()),
								(a.relativePos = e.left),
								(a.offsetX = s(o).x - e.left),
								(a.offsetY = s(o).y - e.top),
								r('on'),
								(a.sliding = !1),
								(a.targetElement = o.target || o.srcElement);
						}
					});
			},
			getNewPosition: function() {
				var t = this,
					e = t.closestItem();
				return e > t.maximumItem ? ((t.currentItem = t.maximumItem), (e = t.maximumItem)) : 0 <= t.newPosX && ((e = 0), (t.currentItem = 0)), e;
			},
			closestItem: function() {
				var o = this,
					i = !0 === o.options.scrollPerPage ? o.pagesInArray : o.positionsInArray,
					s = o.newPosX,
					n = null;
				return (
					l.each(i, function(t, e) {
						s - o.itemWidth / 20 > i[t + 1] && s - o.itemWidth / 20 < e && 'left' === o.moveDirection()
							? ((n = e), !0 === o.options.scrollPerPage ? (o.currentItem = l.inArray(n, o.positionsInArray)) : (o.currentItem = t))
							: s + o.itemWidth / 20 < e &&
							  s + o.itemWidth / 20 > (i[t + 1] || i[t] - o.itemWidth) &&
							  'right' === o.moveDirection() &&
							  (!0 === o.options.scrollPerPage
									? ((n = i[t + 1] || i[i.length - 1]), (o.currentItem = l.inArray(n, o.positionsInArray)))
									: ((n = i[t + 1]), (o.currentItem = t + 1)));
					}),
					o.currentItem
				);
			},
			moveDirection: function() {
				var t;
				return this.newRelativeX < 0 ? ((t = 'right'), (this.playDirection = 'next')) : ((t = 'left'), (this.playDirection = 'prev')), t;
			},
			customEvents: function() {
				var o = this;
				o.$elem.on('owl.next', function() {
					o.next();
				}),
					o.$elem.on('owl.prev', function() {
						o.prev();
					}),
					o.$elem.on('owl.play', function(t, e) {
						(o.options.autoPlay = e), o.play(), (o.hoverStatus = 'play');
					}),
					o.$elem.on('owl.stop', function() {
						o.stop(), (o.hoverStatus = 'stop');
					}),
					o.$elem.on('owl.goTo', function(t, e) {
						o.goTo(e);
					}),
					o.$elem.on('owl.jumpTo', function(t, e) {
						o.jumpTo(e);
					});
			},
			stopOnHover: function() {
				var t = this;
				!0 === t.options.stopOnHover &&
					!0 !== t.browser.isTouch &&
					!1 !== t.options.autoPlay &&
					(t.$elem.on('mouseover', function() {
						t.stop();
					}),
					t.$elem.on('mouseout', function() {
						'stop' !== t.hoverStatus && t.play();
					}));
			},
			lazyLoad: function() {
				var t,
					e,
					o,
					i,
					s = this;
				if (!1 === s.options.lazyLoad) return !1;
				for (t = 0; t < s.itemsAmount; t += 1)
					'loaded' !== (e = l(s.$owlItems[t])).data('owl-loaded') &&
						((o = e.data('owl-item')),
						'string' == typeof (i = e.find('.lazyOwl')).data('src')
							? (void 0 === e.data('owl-loaded') && (i.hide(), e.addClass('loading').data('owl-loaded', 'checked')),
							  (!0 !== s.options.lazyFollow || o >= s.currentItem) && o < s.currentItem + s.options.items && i.length && s.lazyPreload(e, i))
							: e.data('owl-loaded', 'loaded'));
			},
			lazyPreload: function(t, e) {
				var o,
					i = this,
					s = 0;
				function n() {
					t.data('owl-loaded', 'loaded').removeClass('loading'),
						e.removeAttr('data-src'),
						'fade' === i.options.lazyEffect ? e.fadeIn(400) : e.show(),
						'function' == typeof i.options.afterLazyLoad && i.options.afterLazyLoad.apply(this, [i.$elem]);
				}
				'DIV' === e.prop('tagName') ? (e.css('background-image', 'url(' + e.data('src') + ')'), (o = !0)) : (e[0].src = e.data('src')),
					(function t() {
						(s += 1), i.completeImg(e.get(0)) || !0 === o ? n() : s <= 100 ? p.setTimeout(t, 100) : n();
					})();
			},
			autoHeight: function() {
				var e,
					o = this,
					i = l(o.$owlItems[o.currentItem]).find('img');
				function s() {
					var t = l(o.$owlItems[o.currentItem]).height();
					o.wrapperOuter.css('height', t + 'px'),
						o.wrapperOuter.hasClass('autoHeight') ||
							p.setTimeout(function() {
								o.wrapperOuter.addClass('autoHeight');
							}, 0);
				}
				void 0 !== i.get(0)
					? ((e = 0),
					  (function t() {
							(e += 1), o.completeImg(i.get(0)) ? s() : e <= 100 ? p.setTimeout(t, 100) : o.wrapperOuter.css('height', '');
					  })())
					: s();
			},
			completeImg: function(t) {
				return !!t.complete && ('undefined' === typeof t.naturalWidth || 0 !== t.naturalWidth);
			},
			onVisibleItems: function() {
				var t,
					e = this;
				for (
					!0 === e.options.addClassActive && e.$owlItems.removeClass('active'), e.visibleItems = [], t = e.currentItem;
					t < e.currentItem + e.options.items;
					t += 1
				)
					e.visibleItems.push(t), !0 === e.options.addClassActive && l(e.$owlItems[t]).addClass('active');
				e.owl.visibleItems = e.visibleItems;
			},
			transitionTypes: function(t) {
				(this.outClass = 'owl-' + t + '-out'), (this.inClass = 'owl-' + t + '-in');
			},
			singleItemTransition: function() {
				var t,
					e = this,
					o = e.outClass,
					i = e.inClass,
					s = e.$owlItems.eq(e.currentItem),
					n = e.$owlItems.eq(e.prevItem),
					a = Math.abs(e.positionsInArray[e.currentItem]) + e.positionsInArray[e.prevItem],
					r = Math.abs(e.positionsInArray[e.currentItem]) + e.itemWidth / 2,
					l = 'webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend';
				(e.isTransition = !0),
					e.$owlWrapper
						.addClass('owl-origin')
						.css({ '-webkit-transform-origin': r + 'px', '-moz-perspective-origin': r + 'px', 'perspective-origin': r + 'px' }),
					n
						.css(((t = a), { position: 'relative', left: t + 'px' }))
						.addClass(o)
						.on(l, function() {
							(e.endPrev = !0), n.off(l), e.clearTransStyle(n, o);
						}),
					s.addClass(i).on(l, function() {
						(e.endCurrent = !0), s.off(l), e.clearTransStyle(s, i);
					});
			},
			clearTransStyle: function(t, e) {
				var o = this;
				t.css({ position: '', left: '' }).removeClass(e),
					o.endPrev && o.endCurrent && (o.$owlWrapper.removeClass('owl-origin'), (o.endPrev = !1), (o.endCurrent = !1), (o.isTransition = !1));
			},
			owlStatus: function() {
				var t = this;
				t.owl = {
					userOptions: t.userOptions,
					baseElement: t.$elem,
					userItems: t.$userItems,
					owlItems: t.$owlItems,
					currentItem: t.currentItem,
					prevItem: t.prevItem,
					visibleItems: t.visibleItems,
					isTouch: t.browser.isTouch,
					browser: t.browser,
					dragDirection: t.dragDirection
				};
			},
			clearEvents: function() {
				this.$elem.off('.owl owl mousedown.disableTextSelect'), l(m).off('.owl owl'), l(p).off('resize', this.resizer);
			},
			unWrap: function() {
				var t = this;
				0 !== t.$elem.children().length && (t.$owlWrapper.unwrap(), t.$userItems.unwrap().unwrap(), t.owlControls && t.owlControls.remove()),
					t.clearEvents(),
					t.$elem.attr('style', t.$elem.data('owl-originalStyles') || '').attr('class', t.$elem.data('owl-originalClasses'));
			},
			destroy: function() {
				this.stop(), p.clearInterval(this.checkVisible), this.unWrap(), this.$elem.removeData();
			},
			reinit: function(t) {
				var e = l.extend({}, this.userOptions, t);
				this.unWrap(), this.init(e, this.$elem);
			},
			addItem: function(t, e) {
				var o,
					i = this;
				return (
					!!t &&
					(0 === i.$elem.children().length
						? (i.$elem.append(t), i.setVars(), !1)
						: (i.unWrap(),
						  (o = void 0 === e || -1 === e ? -1 : e) >= i.$userItems.length || -1 === o
								? i.$userItems.eq(-1).after(t)
								: i.$userItems.eq(o).before(t),
						  void i.setVars()))
				);
			},
			removeItem: function(t) {
				var e;
				if (0 === this.$elem.children().length) return !1;
				(e = void 0 === t || -1 === t ? -1 : t), this.unWrap(), this.$userItems.eq(e).remove(), this.setVars();
			}
		};
		(l.fn.owlCarousel = function(e) {
			return this.each(function() {
				if (!0 === l(this).data('owl-init')) return !1;
				l(this).data('owl-init', !0);
				var t = Object.create(o);
				t.init(e, this), l.data(this, 'owlCarousel', t);
			});
		}),
			(l.fn.owlCarousel.options = {
				items: 5,
				itemsCustom: !1,
				itemsDesktop: [1199, 4],
				itemsDesktopSmall: [979, 3],
				itemsTablet: [768, 2],
				itemsTabletSmall: !1,
				itemsMobile: [479, 1],
				singleItem: !1,
				itemsScaleUp: !1,
				slideSpeed: 200,
				paginationSpeed: 800,
				rewindSpeed: 1e3,
				autoPlay: !1,
				stopOnHover: !1,
				navigation: !1,
				navigationText: ['prev', 'next'],
				rewindNav: !0,
				scrollPerPage: !1,
				pagination: !0,
				paginationNumbers: !1,
				responsive: !0,
				responsiveRefreshRate: 200,
				responsiveBaseWidth: p,
				baseClass: 'owl-carousel',
				theme: 'owl-theme',
				lazyLoad: !1,
				lazyFollow: !0,
				lazyEffect: 'fade',
				autoHeight: !1,
				jsonPath: !1,
				jsonSuccess: !1,
				dragBeforeAnimFinish: !0,
				mouseDrag: !0,
				touchDrag: !0,
				addClassActive: !1,
				transitionStyle: !1,
				beforeUpdate: !1,
				afterUpdate: !1,
				beforeInit: !1,
				afterInit: !1,
				beforeMove: !1,
				afterMove: !1,
				afterAction: !1,
				startDragging: !1,
				afterLazyLoad: !1
			});
	})(jQuery, window, document);
;
/*
Version: 2.1.8
Date:2017-09-11
 */
var StringMask = (function() {
	var tokens = {
		'0': {pattern: /\d/, _default: '0'},
		'9': {pattern: /\d/, optional: true},
		'#': {pattern: /\d/, optional: true, recursive: true},
		'S': {pattern: /[a-zA-Z]/},
		'$': {escape: true} 
	};
	var isEscaped = function(pattern, pos) {
		var count = 0;
		var i = pos - 1;
		var token = {escape: true};
		while (i >= 0 && token && token.escape) {
			token = tokens[pattern.charAt(i)];
			count += token && token.escape ? 1 : 0;
			i--;
		}
		return count > 0 && count%2 === 1;	
	};
	var calcOptionalNumbersToUse = function(pattern, value) {
		var numbersInP = pattern.replace(/[^0]/g,'').length;
		var numbersInV = value.replace(/[^\d]/g,'').length;
		return numbersInV - numbersInP;
	};
	var concatChar = function(text, character, options) {
		if (options.reverse) return character + text;
		return text + character;
	};
	var hasMoreTokens = function(pattern, pos, inc) {
		var pc = pattern.charAt(pos);
		var token = tokens[pc];
		if (pc === '') return false;
		return token && !token.escape ? true : hasMoreTokens(pattern, pos + inc, inc);
	};
	var insertChar = function(text, char, position) {
		var t = text.split('');
		t.splice(position >= 0 ? position: 0, 0, char);
		return t.join('');
	};
	var StringMask = function(pattern, opt) {
		this.options = opt || {};
		this.options = {
			reverse: this.options.reverse || false,
			usedefaults: this.options.usedefaults || this.options.reverse
		};
		this.pattern = pattern;

		StringMask.prototype.process = function proccess(value) {
			if (!value) return '';
			value = value + '';
			var pattern2 = this.pattern;
			var valid = true;
			var formatted = '';
			var valuePos = this.options.reverse ? value.length - 1 : 0;
			var optionalNumbersToUse = calcOptionalNumbersToUse(pattern2, value);
			var escapeNext = false;
			var recursive = [];
			var inRecursiveMode = false;

			var steps = {
				start: this.options.reverse ? pattern2.length - 1 : 0,
				end: this.options.reverse ? -1 : pattern2.length,
				inc: this.options.reverse ? -1 : 1
			};

			var continueCondition = function(options) {
				if (!inRecursiveMode && hasMoreTokens(pattern2, i, steps.inc)) {
					return true;
				} else if (!inRecursiveMode) {
					inRecursiveMode = recursive.length > 0;
				}

				if (inRecursiveMode) {
					var pc = recursive.shift();
					recursive.push(pc);
					if (options.reverse && valuePos >= 0) {
						i++;
						pattern2 = insertChar(pattern2, pc, i);
						return true;
					} else if (!options.reverse && valuePos < value.length) {
						pattern2 = insertChar(pattern2, pc, i);
						return true;
					}
				}
				return i < pattern2.length && i >= 0;
			};

			for (var i = steps.start; continueCondition(this.options); i = i + steps.inc) {
				var pc = pattern2.charAt(i);
				var vc = value.charAt(valuePos);
				var token = tokens[pc];
				if (!inRecursiveMode || vc) {
					if (this.options.reverse && isEscaped(pattern2, i)) {
						formatted = concatChar(formatted, pc, this.options);
						i = i + steps.inc;
						continue;
					} else if (!this.options.reverse && escapeNext) {
						formatted = concatChar(formatted, pc, this.options);
						escapeNext = false;
						continue;
					} else if (!this.options.reverse && token && token.escape) {
						escapeNext = true;
						continue;
					}
				}

				if (!inRecursiveMode && token && token.recursive) {
					recursive.push(pc);
				} else if (inRecursiveMode && !vc) {
					if (!token || !token.recursive) formatted = concatChar(formatted, pc, this.options);
					continue;
				} else if (recursive.length > 0 && token && !token.recursive) {
					// Recursive tokens most be the last tokens of the pattern
					valid = false;
					continue;
				} else if (!inRecursiveMode && recursive.length > 0 && !vc) {
					continue;
				}

				if (!token) {
					formatted = concatChar(formatted, pc, this.options);
					if (!inRecursiveMode && recursive.length) {
						recursive.push(pc);
					}
				} else if (token.optional) {
					if (token.pattern.test(vc) && optionalNumbersToUse) {
						formatted = concatChar(formatted, vc, this.options);
						valuePos = valuePos + steps.inc;
						optionalNumbersToUse--;
					} else if (recursive.length > 0 && vc) {
						valid = false;
						break;
					}
				} else if (token.pattern.test(vc)) {
					formatted = concatChar(formatted, vc, this.options);
					valuePos = valuePos + steps.inc;
				} else if (!vc && token._default && this.options.usedefaults) {
					formatted = concatChar(formatted, token._default, this.options);
				} else {
					valid = false;
					break;
				}
			}

			return {result: formatted, valid: valid};
		};

		StringMask.prototype.apply = function(value) {
			return this.process(value).result;
		};

		StringMask.prototype.validate = function(value) {
			return this.process(value).valid;
		};
	};

	StringMask.process = function(value, pattern, options) {
		return new StringMask(pattern, options).process(value);
	};

	StringMask.apply = function(value, pattern, options) {
		return new StringMask(pattern, options).apply(value);
	};

	StringMask.validate = function(value, pattern, options) {
		return new StringMask(pattern, options).validate(value);
	};

	return StringMask;
}());

/** Used to determine if values are of the language type Object */
var objectTypes = {
	'boolean': false,
	'function': true,
	'object': true,
	'number': false,
	'string': false,
	'undefined': false
};

if (objectTypes[typeof module]) {
	module.exports = StringMask;	
}
;
/*
Version: 2.1.8
Date:2017-09-11
 */
/**
 * angular-mask
 * Personalized input masks for AngularJS
 * @version v1.2.5
 * @link http://github.com/assisrafael/angular-input-masks
 * @license MIT
 */
(function (angular) {

var StringMask = (function() {
	var tokens = {
		'0': {pattern: /\d/, _default: '0'},
		'9': {pattern: /\d/, optional: true},
		'#': {pattern: /\d/, optional: true, recursive: true},
		'S': {pattern: /[a-zA-Z]/},
		'$': {escape: true}
	};
	var isEscaped = function(pattern, pos) {
		var count = 0;
		var i = pos - 1;
		var token = {escape: true};
		while (i >= 0 && token && token.escape) {
			token = tokens[pattern.charAt(i)];
			count += token && token.escape ? 1 : 0;
			i--;
		}
		return count > 0 && count%2 === 1;
	};
	var calcOptionalNumbersToUse = function(pattern, value) {
		var numbersInP = pattern.replace(/[^0]/g,'').length;
		var numbersInV = value.replace(/[^\d]/g,'').length;
		return numbersInV - numbersInP;
	};
	var concatChar = function(text, character, options) {
		if (options.reverse) return character + text;
		return text + character;
	};
	var hasMoreTokens = function(pattern, pos, inc) {
		var pc = pattern.charAt(pos);
		var token = tokens[pc];
		if (pc === '') return false;
		return token && !token.escape ? true : hasMoreTokens(pattern, pos + inc, inc);
	};
	var insertChar = function(text, char, position) {
		var t = text.split('');
		t.splice(position >= 0 ? position: 0, 0, char);
		return t.join('');
	};
	var StringMask = function(pattern, opt) {
		this.options = opt || {};
		this.options = {
			reverse: this.options.reverse || false,
			usedefaults: this.options.usedefaults || this.options.reverse
		};
		this.pattern = pattern;

		StringMask.prototype.process = function proccess(value) {
			if (!value) return '';
			value = value + '';
			var pattern2 = this.pattern;
			var valid = true;
			var formatted = '';
			var valuePos = this.options.reverse ? value.length - 1 : 0;
			var optionalNumbersToUse = calcOptionalNumbersToUse(pattern2, value);
			var escapeNext = false;
			var recursive = [];
			var inRecursiveMode = false;

			var steps = {
				start: this.options.reverse ? pattern2.length - 1 : 0,
				end: this.options.reverse ? -1 : pattern2.length,
				inc: this.options.reverse ? -1 : 1
			};

			var continueCondition = function(options) {
				if (!inRecursiveMode && hasMoreTokens(pattern2, i, steps.inc)) {
					return true;
				} else if (!inRecursiveMode) {
					inRecursiveMode = recursive.length > 0;
				}

				if (inRecursiveMode) {
					var pc = recursive.shift();
					recursive.push(pc);
					if (options.reverse && valuePos >= 0) {
						i++;
						pattern2 = insertChar(pattern2, pc, i);
						return true;
					} else if (!options.reverse && valuePos < value.length) {
						pattern2 = insertChar(pattern2, pc, i);
						return true;
					}
				}
				return i < pattern2.length && i >= 0;
			};

			for (var i = steps.start; continueCondition(this.options); i = i + steps.inc) {
				var pc = pattern2.charAt(i);
				var vc = value.charAt(valuePos);
				var token = tokens[pc];
				if (!inRecursiveMode || vc) {
					if (this.options.reverse && isEscaped(pattern2, i)) {
						formatted = concatChar(formatted, pc, this.options);
						i = i + steps.inc;
						continue;
					} else if (!this.options.reverse && escapeNext) {
						formatted = concatChar(formatted, pc, this.options);
						escapeNext = false;
						continue;
					} else if (!this.options.reverse && token && token.escape) {
						escapeNext = true;
						continue;
					}
				}

				if (!inRecursiveMode && token && token.recursive) {
					recursive.push(pc);
				} else if (inRecursiveMode && !vc) {
					if (!token || !token.recursive) formatted = concatChar(formatted, pc, this.options);
					continue;
				} else if (recursive.length > 0 && token && !token.recursive) {
					// Recursive tokens most be the last tokens of the pattern
					valid = false;
					continue;
				} else if (!inRecursiveMode && recursive.length > 0 && !vc) {
					continue;
				}

				if (!token) {
					formatted = concatChar(formatted, pc, this.options);
					if (!inRecursiveMode && recursive.length) {
						recursive.push(pc);
					}
				} else if (token.optional) {
					if (token.pattern.test(vc) && optionalNumbersToUse) {
						formatted = concatChar(formatted, vc, this.options);
						valuePos = valuePos + steps.inc;
						optionalNumbersToUse--;
					} else if (recursive.length > 0 && vc) {
						valid = false;
						break;
					}
				} else if (token.pattern.test(vc)) {
					formatted = concatChar(formatted, vc, this.options);
					valuePos = valuePos + steps.inc;
				} else if (!vc && token._default && this.options.usedefaults) {
					formatted = concatChar(formatted, token._default, this.options);
				} else {
					valid = false;
					break;
				}
			}

			return {result: formatted, valid: valid};
		};

		StringMask.prototype.apply = function(value) {
			return this.process(value).result;
		};

		StringMask.prototype.validate = function(value) {
			return this.process(value).valid;
		};
	};

	StringMask.process = function(value, pattern, options) {
		return new StringMask(pattern, options).process(value);
	};

	StringMask.apply = function(value, pattern, options) {
		return new StringMask(pattern, options).apply(value);
	};

	StringMask.validate = function(value, pattern, options) {
		return new StringMask(pattern, options).validate(value);
	};

	return StringMask;
}());

/** Used to determine if values are of the language type Object */
var objectTypes = {
	'boolean': false,
	'function': true,
	'object': true,
	'number': false,
	'string': false,
	'undefined': false
};

if (objectTypes[typeof module]) {
	module.exports = StringMask;
}

/**
 * br-validations
 * A library of validations applicable to several Brazilian data like I.E., CNPJ, CPF and others
 * @version v0.2.2
 * @link http://github.com/the-darc/br-validations
 * @license MIT
 */
(function () {
  var root = this;
var CNPJ = {};

CNPJ.validate = function(c) {
	var b = [6,5,4,3,2,9,8,7,6,5,4,3,2];
	c = c.replace(/[^\d]/g,'');

	var r = /^(0{14}|1{14}|2{14}|3{14}|4{14}|5{14}|6{14}|7{14}|8{14}|9{14})$/;
	if (!c || c.length !== 14 || r.test(c)) {
		return false;
	}
	c = c.split('');

	for (var i = 0, n = 0; i < 12; i++) {
		n += c[i] * b[i+1];
	}
	n = 11 - n%11;
	n = n >= 10 ? 0 : n;
	if (parseInt(c[12]) !== n)  {
		return false;
	}

	for (i = 0, n = 0; i <= 12; i++) {
		n += c[i] * b[i];
	}
	n = 11 - n%11;
	n = n >= 10 ? 0 : n;
	if (parseInt(c[13]) !== n)  {
		return false;
	}
	return true;
};


var CPF = {};

CPF.validate = function(cpf) {
	cpf = cpf.replace(/[^\d]+/g,'');
	var r = /^(0{11}|1{11}|2{11}|3{11}|4{11}|5{11}|6{11}|7{11}|8{11}|9{11})$/;
	if (!cpf || cpf.length !== 11 || r.test(cpf)) {
		return false;
	}
	function validateDigit(digit) {
		var add = 0;
		var init = digit - 9;
		for (var i = 0; i < 9; i ++) {
			add += parseInt(cpf.charAt(i + init)) * (i+1);
		}
		return (add%11)%10 === parseInt(cpf.charAt(digit));
	}
	return validateDigit(9) && validateDigit(10);
};

var IE = function(uf) {
	if (!(this instanceof IE)) {
		return new IE(uf);
	}

	this.rules = IErules[uf] || [];
	this.rule;
	IE.prototype._defineRule = function(value) {
		this.rule = undefined;
		for (var r = 0; r < this.rules.length && this.rule === undefined; r++) {
			var str = value.replace(/[^\d]/g,'');
			var ruleCandidate = this.rules[r];
			if (str.length === ruleCandidate.chars && (!ruleCandidate.match || ruleCandidate.match.test(value))) {
				this.rule = ruleCandidate;
			}
		}
		return !!this.rule;
	};

	IE.prototype.validate = function(value) {
		if (!value || !this._defineRule(value)) {
			return false;
		}
		return this.rule.validate(value);
	};
};

var IErules = {};

var algorithmSteps = {
	handleStr: {
		onlyNumbers: function(str) {
			return str.replace(/[^\d]/g,'').split('');
		},
		mgSpec: function(str) {
			var s = str.replace(/[^\d]/g,'');
			s = s.substr(0,3)+'0'+s.substr(3, s.length);
			return s.split('');
		}
	},
	sum: {
		normalSum: function(handledStr, pesos) {
			var nums = handledStr;
			var sum = 0;
			for (var i = 0; i < pesos.length; i++) {
				sum += parseInt(nums[i]) * pesos[i];
			}
			return sum;
		},
		individualSum: function(handledStr, pesos) {
			var nums = handledStr;
			var sum = 0;
			for (var i = 0; i < pesos.length; i++) {
				var mult = parseInt(nums[i]) * pesos[i];
				sum += mult%10 + parseInt(mult/10);
			}
			return sum;
		},
		apSpec: function(handledStr, pesos) {
			var sum = this.normalSum(handledStr, pesos);
			var ref = handledStr.join('');
			if (ref >= '030000010' && ref <= '030170009') {
				return sum + 5;
			}
			if (ref >= '030170010' && ref <= '030190229') {
				return sum + 9;
			}
			return sum;
		}
	},
	rest: {
		mod11: function(sum) {
			return sum%11;
		},
		mod10: function(sum) {
			return sum%10;
		},
		mod9: function(sum) {
			return sum%9;
		}
	},
	expectedDV: {
		minusRestOf11: function(rest) {
			return rest < 2 ? 0 : 11 - rest;
		},
		minusRestOf11v2: function(rest) {
			return rest < 2 ? 11 - rest - 10 : 11 - rest;
		},
		minusRestOf10: function(rest) {
			return rest < 1 ? 0 : 10 - rest;
		},
		mod10: function(rest) {
			return rest%10;
		},
		goSpec: function(rest, handledStr) {
			var ref = handledStr.join('');
			if (rest === 1) {
				return ref >= '101031050' && ref <= '101199979' ? 1 : 0;
			}
			return rest === 0 ? 0 : 11 - rest;
		},
		apSpec: function(rest, handledStr) {
			var ref = handledStr.join('');
			if (rest === 0) {
				return ref >= '030170010' && ref <= '030190229' ? 1 : 0;
			}
			return rest === 1 ? 0 : 11 - rest;
		},
		voidFn: function(rest) {
			return rest;
		}
	}
};


/**
 * options {
 *     pesos: Array of values used to operate in sum step
 *     dvPos: Position of the DV to validate considering the handledStr
 *     algorithmSteps: The four DV's validation algorithm steps names
 * }
 */
function validateDV(value, options) {
	var steps = options.algorithmSteps;

	// Step 01: Handle String
	var handledStr = algorithmSteps.handleStr[steps[0]](value);

	// Step 02: Sum chars
	var sum = algorithmSteps.sum[steps[1]](handledStr, options.pesos);

	// Step 03: Rest calculation
	var rest = algorithmSteps.rest[steps[2]](sum);

	// Fixed Step: Get current DV
	var currentDV = parseInt(handledStr[options.dvpos]);

	// Step 04: Expected DV calculation
	var expectedDV = algorithmSteps.expectedDV[steps[3]](rest, handledStr);

	// Fixed step: DV verification
	return currentDV === expectedDV;
}

function validateIE(value, rule) {
	if (rule.match && !rule.match.test(value)) {
		return false;
	}
	for (var i = 0; i < rule.dvs.length; i++) {
		// console.log('>> >> dv'+i);
		if (!validateDV(value, rule.dvs[i])) {
			return false;
		}
	}
	return true;
}

IErules.PE = [{
	//mask: new StringMask('0000000-00'),
	chars: 9,
	dvs: [{
		dvpos: 7,
		pesos: [8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	},{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
},{
	// mask: new StringMask('00.0.000.0000000-0'),
	chars: 14,
	pesos: [[1,2,3,4,5,9,8,7,6,5,4,3,2]],
	dvs: [{
		dvpos: 13,
		pesos: [5,4,3,2,1,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11v2']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.RS = [{
	// mask: new StringMask('000/0000000'),
	chars: 10,
	dvs: [{
		dvpos: 9,
		pesos: [2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.AC = [{
	// mask: new StringMask('00.000.000/000-00'),
	chars: 13,
	match: /^01/,
	dvs: [{
		dvpos: 11,
		pesos: [4,3,2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	},{
		dvpos: 12,
		pesos: [5,4,3,2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.MG = [{
	// mask: new StringMask('000.000.000/0000'),
	chars: 13,
	dvs: [{
		dvpos: 12,
		pesos: [1,2,1,2,1,2,1,2,1,2,1,2],
		algorithmSteps: ['mgSpec', 'individualSum', 'mod10', 'minusRestOf10']
	},{
		dvpos: 12,
		pesos: [3,2,11,10,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.SP = [{
	// mask: new StringMask('000.000.000.000'),
	chars: 12,
	match: /^[0-9]/,
	dvs: [{
		dvpos: 8,
		pesos: [1,3,4,5,6,7,8,10],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'mod10']
	},{
		dvpos: 11,
		pesos: [3,2,10,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'mod10']
	}],
	validate: function(value) { return validateIE(value, this); }
},{
	// mask: new StringMask('P-00000000.0/000')
	chars: 12,
	match: /^P/i,
	dvs: [{
		dvpos: 8,
		pesos: [1,3,4,5,6,7,8,10],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'mod10']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.DF = [{
	// mask: new StringMask('00000000000-00'),
	chars: 13,
	dvs: [{
		dvpos: 11,
		pesos: [4,3,2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	},{
		dvpos: 12,
		pesos: [5,4,3,2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.ES = [{
	// mask: new StringMask('000.000.00-0')
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.BA = [{
	// mask: new StringMask('000000-00')
	chars: 8,
	match: /^[0123458]/,
	dvs: [{
		dvpos: 7,
		pesos: [7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod10', 'minusRestOf10']
	},{
		dvpos: 6,
		pesos: [8,7,6,5,4,3,0,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod10', 'minusRestOf10']
	}],
	validate: function(value) { return validateIE(value, this); }
},{
	chars: 8,
	match: /^[679]/,
	dvs: [{
		dvpos: 7,
		pesos: [7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	},{
		dvpos: 6,
		pesos: [8,7,6,5,4,3,0,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
},{
	// mask: new StringMask('0000000-00')
	chars: 9,
	match: /^[0-9][0123458]/,
	dvs: [{
		dvpos: 8,
		pesos: [8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod10', 'minusRestOf10']
	},{
		dvpos: 7,
		pesos: [9,8,7,6,5,4,3,0,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod10', 'minusRestOf10']
	}],
	validate: function(value) { return validateIE(value, this); }
},{
	chars: 9,
	match: /^[0-9][679]/,
	dvs: [{
		dvpos: 8,
		pesos: [8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	},{
		dvpos: 7,
		pesos: [9,8,7,6,5,4,3,0,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.AM = [{
	//mask: new StringMask('00.000.000-0')
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.RN = [{
	// {mask: new StringMask('00.000.000-0')
	chars: 9,
	match: /^20/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
},{
	// {mask: new StringMask('00.0.000.000-0'), chars: 10}
	chars: 10,
	match: /^20/,
	dvs: [{
		dvpos: 8,
		pesos: [10,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.RO = [{
	// mask: new StringMask('0000000000000-0')
	chars: 14,
	dvs: [{
		dvpos: 13,
		pesos: [6,5,4,3,2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.PR = [{
	// mask: new StringMask('00000000-00')
	chars: 10,
	dvs: [{
		dvpos: 8,
		pesos: [3,2,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	},{
		dvpos: 9,
		pesos: [4,3,2,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.SC = [{
	// {mask: new StringMask('000.000.000'), uf: 'SANTA CATARINA'}
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.RJ = [{
	// {mask: new StringMask('00.000.00-0'), uf: 'RIO DE JANEIRO'}
	chars: 8,
	dvs: [{
		dvpos: 7,
		pesos: [2,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.PA = [{
	// {mask: new StringMask('00-000000-0')
	chars: 9,
	match: /^15/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.SE = [{
	// {mask: new StringMask('00000000-0')
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.PB = [{
	// {mask: new StringMask('00000000-0')
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.CE = [{
	// {mask: new StringMask('00000000-0')
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.PI = [{
	// {mask: new StringMask('000000000')
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.MA = [{
	// {mask: new StringMask('000000000')
	chars: 9,
	match: /^12/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.MT = [{
	// {mask: new StringMask('0000000000-0')
	chars: 11,
	dvs: [{
		dvpos: 10,
		pesos: [3,2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.MS = [{
	// {mask: new StringMask('000000000')
	chars: 9,
	match: /^28/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.TO = [{
	// {mask: new StringMask('00000000000'),
	chars: 11,
	match: /^[0-9]{2}((0[123])|(99))/,
	dvs: [{
		dvpos: 10,
		pesos: [9,8,0,0,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.AL = [{
	// {mask: new StringMask('000000000')
	chars: 9,
	match: /^24[03578]/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.RR = [{
	// {mask: new StringMask('00000000-0')
	chars: 9,
	match: /^24/,
	dvs: [{
		dvpos: 8,
		pesos: [1,2,3,4,5,6,7,8],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod9', 'voidFn']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.GO = [{
	// {mask: new StringMask('00.000.000-0')
	chars: 9,
	match: /^1[015]/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'goSpec']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.AP = [{
	// {mask: new StringMask('000000000')
	chars: 9,
	match: /^03/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'apSpec', 'mod11', 'apSpec']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

var BrV = {
   ie: IE,
   cpf: CPF,
   cnpj: CNPJ
};
var objectTypes = {
	'function': true,
	'object': true
};
if (objectTypes[typeof module]) {
	module.exports = BrV;
} else {
	root.BrV = BrV;
}
}.call(this));
(function() {
	'use strict';

	function maxValidator(ctrl, value, limit) {
		var max = parseFloat(limit);
		var validity = ctrl.$isEmpty(value) || isNaN(max)|| value <= max;
		ctrl.$setValidity('max', validity);
		return value;
	}

	function minValidator(ctrl, value, limit) {
		var min = parseFloat(limit);
		var validity = ctrl.$isEmpty(value) || isNaN(min) || value >= min;
		ctrl.$setValidity('min', validity);
		return value;
	}

	var cnpjPattern = new StringMask('00.000.000\/0000-00');
	var cpfPattern = new StringMask('000.000.000-00');

	function numberViewMask (decimals, decimalDelimiter, thousandsDelimiter) {
		var mask = '#' + thousandsDelimiter + '##0';

		if(decimals > 0) {
			mask += decimalDelimiter;
			for (var i = 0; i < decimals; i++) {
				mask += '0';
			}
		}

		return new StringMask(mask, {
			reverse:true
		});
	}

	function numberModelMask (decimals) {
		var mask = '###0';

		if(decimals > 0) {
			mask += '.';
			for (var i = 0; i < decimals; i++) {
				mask += '0';
			}
		}

		return new StringMask(mask, {
			reverse:true
		});
	}

	function clearDelimitersAndLeadingZeros (value) {
		var cleanValue = value.replace(/^-/,'').replace(/^0*/, '');
		cleanValue = cleanValue.replace(/[^0-9]/g, '');
		return cleanValue;
	}

	function preparePercentageToFormatter (value, decimals) {
		return clearDelimitersAndLeadingZeros((parseFloat(value)*100).toFixed(decimals));
	}

	function prepareNumberToFormatter (value, decimals) {
		return clearDelimitersAndLeadingZeros((parseFloat(value)).toFixed(decimals));
	}

	function validateBrPhoneNumber (ctrl, value) {
		var valid = ctrl.$isEmpty(value) || value.length === 10 || value.length === 11;
		ctrl.$setValidity('br-phone-number', valid);
		return value;
	}

	function validateCPF (ctrl, value) {
		var valid = ctrl.$isEmpty(value) || BrV.cpf.validate(value);
		ctrl.$setValidity('cpf', valid);
		return value;
	}

	function validateCNPJ (ctrl, value) {
		var valid = ctrl.$isEmpty(value) || BrV.cnpj.validate(value);
		ctrl.$setValidity('cnpj', valid);
		return value;
	}

	function validateCPForCNPJ (ctrl, value) {
		if(!value || value.length <= 11) {
			validateCNPJ(ctrl, '');
			return validateCPF(ctrl, value);
		}else {
			validateCPF(ctrl, '');
			return validateCNPJ(ctrl, value);
		}
	}

	function uiBrCpfMask() {
		function applyCpfMask (value) {
			if(!value) {
				return value;
			}
			var formatedValue = cpfPattern.apply(value);
			return formatedValue.trim().replace(/[^0-9]$/, '');
		}

		return {
			restrict: 'A',
			require: '?ngModel',
			link: function (scope, element, attrs, ctrl) {
				if (!ctrl) {
					return;
				}

				ctrl.$formatters.push(function(value) {
					return applyCpfMask(validateCPF(ctrl, value));
				});

				ctrl.$parsers.push(function(value) {
					if(!value) {
						return value;
					}

					var actualNumber = value.replace(/[^\d]/g,'');
					var formatedValue = applyCpfMask(actualNumber);

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return formatedValue.replace(/[^\d]+/g,'');
				});

				ctrl.$parsers.push(function(value) {
					return validateCPF(ctrl, value);
				});
			}
		};
	}

	function uiBrCnpjMask() {
		function applyCnpjMask (value) {
			if(!value) {
				return value;
			}
			var formatedValue = cnpjPattern.apply(value);
			return formatedValue.trim().replace(/[^0-9]$/, '');
		}
		return {
			restrict: 'A',
			require: '?ngModel',
			link: function (scope, element, attrs, ctrl) {
				if (!ctrl) {
					return;
				}

				ctrl.$formatters.push(function(value) {
					return applyCnpjMask(validateCNPJ(ctrl, value));
				});

				ctrl.$parsers.push(function(value) {
					if(!value) {
						return value;
					}

					var actualNumber = value.replace(/[^\d]+/g,'');
					var formatedValue = applyCnpjMask(actualNumber);

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return formatedValue.replace(/[^\d]+/g,'');
				});

				ctrl.$parsers.push(function(value) {
					return validateCNPJ(ctrl, value);
				});
			}
		};
	}

	function uiBrCpfCnpjMask() {
		function applyCpfCnpjMask (value) {
			if(!value) {
				return value;
			}
			var formatedValue;
			if (value.length > 11) {
				formatedValue = cnpjPattern.apply(value);
			} else {
				formatedValue = cpfPattern.apply(value);
			}
			return formatedValue.trim().replace(/[^0-9]$/, '');
		}
		return {
			restrict: 'A',
			require: '?ngModel',
			link: function (scope, element, attrs, ctrl) {
				if (!ctrl) {
					return;
				}

				ctrl.$formatters.push(function(value) {
					return applyCpfCnpjMask(validateCPForCNPJ(ctrl, value));
				});

				ctrl.$parsers.push(function(value) {
					if(!value) {
						return value;
					}

					var actualNumber = value.replace(/[^\d]+/g,'');
					var formatedValue = applyCpfCnpjMask(actualNumber);

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return formatedValue.replace(/[^\d]+/g,'');
				});

				ctrl.$parsers.push(function(value) {
					return validateCPForCNPJ(ctrl, value);
				});
			}
		};
	}

	angular.module('ui.utils.masks', [])
	.directive('uiPercentageMask', ['$locale', '$parse', function ($locale, $parse) {
		return {
			restrict: 'A',
			require: '?ngModel',
			link: function (scope, element, attrs, ctrl) {
				var decimalDelimiter = $locale.NUMBER_FORMATS.DECIMAL_SEP,
					thousandsDelimiter = $locale.NUMBER_FORMATS.GROUP_SEP,
					decimals = parseInt(attrs.uiPercentageMask);

				if (!ctrl) {
					return;
				}

				if (angular.isDefined(attrs.uiHideGroupSep)){
					thousandsDelimiter = '';
				}

				if(isNaN(decimals)) {
					decimals = 2;
				}
				var numberDecimals = decimals + 2;
				var viewMask = numberViewMask(decimals, decimalDelimiter, thousandsDelimiter),
					modelMask = numberModelMask(numberDecimals);

				ctrl.$formatters.push(function(value) {
					if(!value) {
						return value;
					}

					var valueToFormat = preparePercentageToFormatter(value, decimals);
					return viewMask.apply(valueToFormat) + ' %';
				});

				function parse(value) {
					if(!value) {
						return value;
					}

					var valueToFormat = clearDelimitersAndLeadingZeros(value) || '0';
					if(value.length > 1 && value.indexOf('%') === -1) {
						valueToFormat = valueToFormat.slice(0,valueToFormat.length-1);
					}
					var formatedValue = viewMask.apply(valueToFormat) + ' %';
					var actualNumber = parseFloat(modelMask.apply(valueToFormat));

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return actualNumber;
				}

				ctrl.$parsers.push(parse);

				if (attrs.uiPercentageMask) {
					scope.$watch(attrs.uiPercentageMask, function(decimals) {
						if(isNaN(decimals)) {
							decimals = 2;
						}
						numberDecimals = decimals + 2;
						viewMask = numberViewMask(decimals, decimalDelimiter, thousandsDelimiter);
						modelMask = numberModelMask(numberDecimals);

						parse(ctrl.$viewValue || '');
					});
				}

				if(attrs.min){
					ctrl.$parsers.push(function(value) {
						var min = $parse(attrs.min)(scope);
						return minValidator(ctrl, value, min);
					});

					scope.$watch('min', function(value) {
						minValidator(ctrl, ctrl.$modelValue, value);
					});
				}

				if(attrs.max) {
					ctrl.$parsers.push(function(value) {
						var max = $parse(attrs.max)(scope);
						return maxValidator(ctrl, value, max);
					});

					scope.$watch('max', function(value) {
						maxValidator(ctrl, ctrl.$modelValue, value);
					});
				}
			}
		};
	}])
	.directive('uiNumberMask', ['$locale', '$parse', function ($locale, $parse) {
		return {
			restrict: 'A',
			require: '?ngModel',
			link: function (scope, element, attrs, ctrl) {
				var decimalDelimiter = $locale.NUMBER_FORMATS.DECIMAL_SEP,
					thousandsDelimiter = $locale.NUMBER_FORMATS.GROUP_SEP,
					decimals = $parse(attrs.uiNumberMask)(scope);

				if (!ctrl) {
					return;
				}

				if (angular.isDefined(attrs.uiHideGroupSep)){
					thousandsDelimiter = '';
				}

				if(isNaN(decimals)) {
					decimals = 2;
				}
				var viewMask = numberViewMask(decimals, decimalDelimiter, thousandsDelimiter),
					modelMask = numberModelMask(decimals);

				function parse(value) {
					if(!value) {
						return value;
					}

					var valueToFormat = clearDelimitersAndLeadingZeros(value) || '0';
					var formatedValue = viewMask.apply(valueToFormat);
					var actualNumber = parseFloat(modelMask.apply(valueToFormat));

					if(angular.isDefined(attrs.uiNegativeNumber)){
						var isNegative = (value[0] === '-'),
							needsToInvertSign = (value.slice(-1) === '-');

						//only apply the minus sign if it is negative or(exclusive) needs to be negative and the number is different from zero
						if(needsToInvertSign ^ isNegative && !!actualNumber) {
							actualNumber *= -1;
							formatedValue = '-' + formatedValue;
						}
					}

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return actualNumber;
				}

				ctrl.$formatters.push(function(value) {
					var prefix = '';
					if(angular.isDefined(attrs.uiNegativeNumber) && value < 0){
						prefix = '-';
					}

					if(!value) {
						return value;
					}

					var valueToFormat = prepareNumberToFormatter(value, decimals);
					return prefix + viewMask.apply(valueToFormat);
				});

				ctrl.$parsers.push(parse);

				if (attrs.uiNumberMask) {
					scope.$watch(attrs.uiNumberMask, function(decimals) {
						if(isNaN(decimals)) {
							decimals = 2;
						}
						viewMask = numberViewMask(decimals, decimalDelimiter, thousandsDelimiter);
						modelMask = numberModelMask(decimals);

						parse(ctrl.$viewValue || '');
					});
				}

				if(attrs.min){
					ctrl.$parsers.push(function(value) {
						var min = $parse(attrs.min)(scope);
						return minValidator(ctrl, value, min);
					});

					scope.$watch(attrs.min, function(value) {
						minValidator(ctrl, ctrl.$modelValue, value);
					});
				}

				if(attrs.max) {
					ctrl.$parsers.push(function(value) {
						var max = $parse(attrs.max)(scope);
						return maxValidator(ctrl, value, max);
					});

					scope.$watch(attrs.max, function(value) {
						maxValidator(ctrl, ctrl.$modelValue, value);
					});
				}
			}
		};
	}])
	.directive('uiBrCpfMask', [uiBrCpfMask])
	.directive('uiBrCnpjMask', [uiBrCnpjMask])
	.directive('uiBrCpfcnpjMask', [uiBrCpfCnpjMask])
	// deprecated: will be removed in the next major version
	.directive('uiCpfMask', [uiBrCpfMask])
	// deprecated: will be removed in the next major version
	.directive('uiCnpjMask', [uiBrCnpjMask])
	// deprecated: will be removed in the next major version
	.directive('uiCpfcnpjMask', [uiBrCpfCnpjMask])
	.directive('uiMoneyMask', ['$locale', '$parse', function ($locale, $parse) {
		return {
			restrict: 'A',
			require: '?ngModel',
			link: function (scope, element, attrs, ctrl) {
				var decimalDelimiter = $locale.NUMBER_FORMATS.DECIMAL_SEP,
					thousandsDelimiter = $locale.NUMBER_FORMATS.GROUP_SEP,
					currencySym = $locale.NUMBER_FORMATS.CURRENCY_SYM,
					decimals = parseInt(attrs.uiMoneyMask);

				if (!ctrl) {
					return;
				}

				if (angular.isDefined(attrs.uiHideGroupSep)){
					thousandsDelimiter = '';
				}

				if(isNaN(decimals)) {
					decimals = 2;
				}
				var decimalsPattern = decimals > 0 ? decimalDelimiter + new Array(decimals + 1).join('0') : '';
				var maskPattern = currencySym+' #'+thousandsDelimiter+'##0'+decimalsPattern;
				var moneyMask = new StringMask(maskPattern, {reverse: true});

				ctrl.$formatters.push(function(value) {
					if(angular.isUndefined(value)) {
						return value;
					}

					var valueToFormat = prepareNumberToFormatter(value, decimals);
					return moneyMask.apply(valueToFormat);
				});

				function parse(value) {
					if (!value) {
						return value;
					}

					var actualNumber = value.replace(/[^\d]+/g,'');
					actualNumber = actualNumber.replace(/^[0]+([1-9])/,'$1');
					var formatedValue = moneyMask.apply(actualNumber);

					if (value !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return formatedValue ? parseInt(formatedValue.replace(/[^\d]+/g,''))/Math.pow(10,decimals) : null;
				}

				ctrl.$parsers.push(parse);

				if (attrs.uiMoneyMask) {
					scope.$watch(attrs.uiMoneyMask, function(decimals) {
						if(isNaN(decimals)) {
							decimals = 2;
						}
						decimalsPattern = decimals > 0 ? decimalDelimiter + new Array(decimals + 1).join('0') : '';
						maskPattern = currencySym+' #'+thousandsDelimiter+'##0'+decimalsPattern;
						moneyMask = new StringMask(maskPattern, {reverse: true});

						parse(ctrl.$viewValue || '');
					});
				}

				if(attrs.min){
					ctrl.$parsers.push(function(value) {
						var min = $parse(attrs.min)(scope);
						return minValidator(ctrl, value, min);
					});

					scope.$watch(attrs.min, function(value) {
						minValidator(ctrl, ctrl.$modelValue, value);
					});
				}

				if(attrs.max) {
					ctrl.$parsers.push(function(value) {
						var max = $parse(attrs.max)(scope);
						return maxValidator(ctrl, value, max);
					});

					scope.$watch(attrs.max, function(value) {
						maxValidator(ctrl, ctrl.$modelValue, value);
					});
				}
			}
		};
	}])
	.directive('uiBrPhoneNumber',function() {
		/**
		 * FIXME: all numbers will have 9 digits after 2016.
		 * see http://portal.embratel.com.br/embratel/9-digito/
		 */
		var phoneMask8D = new StringMask('(00) 0000-0000'),
			phoneMask9D = new StringMask('(00) 00000-0000');

		function clearValue (value) {
			if(!value) {
				return value;
			}

			return value.replace(/[^0-9]/g, '');
		}

		function applyPhoneMask (value) {
			if(!value) {
				return value;
			}

			var formatedValue;
			if(value.length < 11){
				formatedValue = phoneMask8D.apply(value);
			}else{
				formatedValue = phoneMask9D.apply(value);
			}

			return formatedValue.trim().replace(/[^0-9]$/, '');
		}

		return {
			restrict: 'A',
			require: '?ngModel',
			link: function(scope, element, attrs, ctrl) {
				if (!ctrl) {
					return;
				}

				ctrl.$formatters.push(function(value) {
					return applyPhoneMask(validateBrPhoneNumber(ctrl, value));
				});

				ctrl.$parsers.push(function(value) {
					if (!value) {
						return value;
					}

					var cleanValue = clearValue(value);
					var formatedValue = applyPhoneMask(cleanValue);

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return clearValue(formatedValue);
				});

				ctrl.$parsers.push(function(value) {
					return validateBrPhoneNumber(ctrl, value);
				});
			}
		};
	})
	.directive('uiBrCepMask',function() {
		var cepMask = new StringMask('00000-000');

		function clearValue (value) {
			if(!value) {
				return value;
			}

			return value.replace(/[^0-9]/g, '');
		}

		function applyCepMask (value, ctrl) {
			if(!value) {
				ctrl.$setValidity('cep', true);
				return value;
			}
			var processed = cepMask.process(value);
			ctrl.$setValidity('cep', processed.valid);
			var formatedValue = processed.result;
			return formatedValue.trim().replace(/[^0-9]$/, '');
		}

		return {
			restrict: 'A',
			require: '?ngModel',
			link: function(scope, element, attrs, ctrl) {
				if (!ctrl) {
					return;
				}

				ctrl.$formatters.push(function(value) {
					return applyCepMask(value, ctrl);
				});

				ctrl.$parsers.push(function(value) {
					if (!value) {
						return applyCepMask(value, ctrl);
					}

					var cleanValue = clearValue(value);
					var formatedValue = applyCepMask(cleanValue, ctrl);

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return clearValue(formatedValue);
				});
			}
		};
	})
	.directive('uiBrIeMask', ['$parse', function($parse) {

		var ieMasks = {
			'AC': [{mask: new StringMask('00.000.000/000-00')}],
			'AL': [{mask: new StringMask('000000000')}],
			'AM': [{mask: new StringMask('00.000.000-0')}],
			'AP': [{mask: new StringMask('000000000')}],
			'BA': [{chars: 8, mask: new StringMask('000000-00')},
				   {mask: new StringMask('0000000-00')}],
			'CE': [{mask: new StringMask('00000000-0')}],
			'DF': [{mask: new StringMask('00000000000-00')}],
			'ES': [{mask: new StringMask('00000000-0')}],
			'GO': [{mask: new StringMask('00.000.000-0')}],
			'MA': [{mask: new StringMask('000000000')}],
			'MG': [{mask: new StringMask('000.000.000/0000')}],
			'MS': [{mask: new StringMask('000000000')}],
			'MT': [{mask: new StringMask('0000000000-0')}],
			'PA': [{mask: new StringMask('00-000000-0')}],
			'PB': [{mask: new StringMask('00000000-0')}],
			'PE': [{chars: 9, mask: new StringMask('0000000-00')},
				   {mask: new StringMask('00.0.000.0000000-0')}],
			'PI': [{mask: new StringMask('000000000')}],
			'PR': [{mask: new StringMask('000.00000-00')}],
			'RJ': [{mask: new StringMask('00.000.00-0')}],
			'RN': [{chars: 9, mask: new StringMask('00.000.000-0')},
				   {mask: new StringMask('00.0.000.000-0')}],
			'RO': [{mask: new StringMask('0000000000000-0')}],
			'RR': [{mask: new StringMask('00000000-0')}],
			'RS': [{mask: new StringMask('000/0000000')}],
			'SC': [{mask: new StringMask('000.000.000')}],
			'SE': [{mask: new StringMask('00000000-0')}],
			'SP': [{mask: new StringMask('000.000.000.000')},
				   {mask: new StringMask('-00000000.0/000')}],
			'TO': [{mask: new StringMask('00000000000')}]
		};

		function clearValue (value) {
			if(!value) {
				return value;
			}
			return value.replace(/[^0-9]/g, '');
		}

		function getMask(uf, value) {
			if(!uf || !ieMasks[uf]) {
				return undefined;
			}
			var _uf = uf.toUpperCase();
			if (_uf === 'SP' && /^P/i.test(value)) {
				return ieMasks.SP[1].mask;
			}
			var masks = ieMasks[uf];
			var i = 0;
			while(masks[i].chars && masks[i].chars < clearValue(value).length && i < masks.length - 1) {
				i++;
			}
			return masks[i].mask;
		}

		function applyIEMask (value, uf, ctrl) {
			var mask = getMask(uf, value);
			if(!value || !mask) {
				ctrl.$setValidity('ie', true);
				return value;
			}
			var processed = mask.process(clearValue(value));
			ctrl.$setValidity('ie', BrV.ie(uf).validate(value));
			var formatedValue = processed.result;
			if (uf && uf.toUpperCase() === 'SP' && /^p/i.test(value)) {
				return 'P'+(formatedValue ? formatedValue.trim().replace(/[^0-9]$/, '') : '');
			}
			if(!formatedValue) {
				return formatedValue;
			}
			return formatedValue.trim().replace(/[^0-9]$/, '');
		}

		return {
			restrict: 'A',
			require: '?ngModel',
			link: function(scope, element, attrs, ctrl) {
				var state = $parse(attrs.uiBrIeMask)(scope);

				if (!ctrl) {
					return;
				}

				scope.$watch(attrs.uiBrIeMask, function(newState) {
					state = newState;
					applyIEMask(ctrl.$viewValue, state, ctrl);
				});

				ctrl.$formatters.push(function(value) {
					return applyIEMask(value, state, ctrl);
				});

				ctrl.$parsers.push(function(value) {
					if (!value) {
						return applyIEMask(value, state, ctrl);
					}

					var formatedValue = applyIEMask(value, state, ctrl);

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					if (state && state.toUpperCase() === 'SP' && /^p/i.test(value)) {
						return 'P'+clearValue(formatedValue);
					}
					return clearValue(formatedValue);
				});
			}
		};
	}]);
})();

})(angular);
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 */


// the semi-colon before the function invocation is a safety
// net against concatenated scripts and/or other plugins
// that are not closed properly.
;(function ( $, window, document, undefined ) {

    // undefined is used here as the undefined global
    // variable in ECMAScript 3 and is mutable (i.e. it can
    // be changed by someone else). undefined isn't really
    // being passed in so we can ensure that its value is
    // truly undefined. In ES5, undefined can no longer be
    // modified.

    // window and document are passed through as local
    // variables rather than as globals, because this (slightly)
    // quickens the resolution process and can be more
    // efficiently minified (especially when both are
    // regularly referenced in your plugin).

    // Create the defaults once
    var pluginName = 'imageload',
        defaults = {
            propertyName: "value"
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);

        // jQuery has an extend method that merges the
        // contents of two or more objects, storing the
        // result in the first object. The first object
        // is generally empty because we don't want to alter
        // the default options for future instances of the plugin
        this.options = $.extend( {}, defaults, options) ;

        this._defaults = defaults;
        this._name = pluginName;

        this.init();
    }

    Plugin.prototype.init = function () {
        // Place initialization logic here
        // You already have access to the DOM element and
        // the options via the instance, e.g. this.element
        // and this.options
        this.eventInitiate();
    };

    /**
     * Intiaite Event listener
     */
    Plugin.prototype.eventInitiate = function () {
        var scope = this;
        this.element.one('load', function() {
            scope.setState();
        }).each(function() {
                if(this.complete) $(this).load();
        });
    };


    /**
     * Apply active state to module
     */
    Plugin.prototype.setState = function () {
        this.element.addClass("is-active");
    };





    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

})( jQuery, window, document );;
$( document ).ready(function() {

    // load header images from data-src
    // get the data-src for all inject-images so we can set the background image
    $(".inject-image").each(function(v,k){
        var sourceimg = $(k).find(".source-image").data("src");
        $(k).css('background-image', 'url(' + sourceimg + ')');

        //extra code if we want to do a picturefill type of fix to replace images
        //var windowWidth = $(window).width() ;
        //var loadImageStr = "";
        //if (windowWidth < 560) {
        //    loadImageStr = "w=700";
        //}else if (windowWidth < 897) {
        //    loadImageStr = "w=1000";
        //}else if (windowWidth < 1100) {
        //    loadImageStr = "w=1200";
        //}else{
        //    loadImageStr = "w=1600";
        //}
        // $(k).css('background-image', 'url(' + sourceimg +  "?" + loadImageStr + ')');

    });

});;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Manages the Apply button which has the following states:
 * The following 2 classes will be applied by BAD to .pl57-apply
 * can-show-one - have already logged in and have a cookie so when clicking on Apply we don't show 2 buttons
 * can-show-two - have not logged in so we show the 2 buttons
 */
;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'applyButton',
        defaults = {
            step2_target : ".pl57-apply-step-two",
            button_apply : ".button-apply"
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;
        var $el = $(scope.element);

        // check if we should show two buttons when apply is clicked
        if ($el.hasClass("can-show-two")) {
            //init events
            scope.setupEvents(scope);
        }
    };

    // add managing events on apply button
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        var $button_apply = $el.find(scope.options.button_apply);
        var id = '#' + $button_apply.attr('id');

        $(id).on('click', function(e) {
            e.preventDefault();

            $el.addClass("show-step2");

            $(window).trigger('resize');
        });
    };

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load',function() {
        $(".pl57-apply").applyButton();
    });

})( jQuery, window, document );


$(window).on('load',function() {
    $(document).on('click', '#pl53-reset-btn1', function(){
         location.reload();
    });
});

;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Manages the Compare Loans Button on the Product Family Page
 * As the user selects the compare tick for each loan the compare loan button will update with the number of loans selected
 * When no loans are selected the compare loan button is disabled
 *
 * Note: Mobile view and desktop view will be kept in sync to show the Compare text
 */
;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'compareLoans',
        defaults = {
            compare_loans_button : ".compare-loans-button",
            compare_loan_check : ".compare-loan-check",
            data_compare_text : "compare-text", // data holds text string to replace
            data_replace_compare_text : "|0|" // match text and replace with number of loans selected
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;
        var $el = $(scope.element);
        scope.setupEvents(scope);
        $.proxy(scope.updateCompareButton, scope)();
    };

    // update on change to any checkboxes
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        // wire change to input
        var compare_loan_checks = $el.find(scope.options.compare_loan_check + " input");
        $.each(compare_loan_checks, function(i, el) {
            $(el).on("change", $.proxy(scope.updateCompareButton, scope));
        });
        // wire blocking of compare button if nothing checked
        var $compare_loans_button = $el.find(scope.options.compare_loans_button);
        $compare_loans_button.on("click", function(e){
            if ($compare_loans_button.hasClass("disabled")){
                e.preventDefault();
            }
        });
    };

    // update the copy of the compare button
    Plugin.prototype.updateCompareButton = function() {
        scope = this;
        var $el = $(scope.element);
        var numberChecked = 0;
        // determine which buttons have been checked
        var compare_loan_checks = $el.find(scope.options.compare_loan_check);
        $.each(compare_loan_checks, function(i, el) {
            var isChecked = $(el).find("input").is(":checked");
            if (isChecked){
                numberChecked++;
            }
        });
        // update the compare button text with the number of checkboxes selected
        var $compare_loans_button = $el.find(scope.options.compare_loans_button);
        var data_compare_text = $compare_loans_button.data(scope.options.data_compare_text);
        if (data_compare_text == undefined) {
            data_compare_text = "Compare |0| Loans";
        }
        if (numberChecked < 2){
            data_compare_text = data_compare_text.replace(scope.options.data_replace_compare_text, "");
            $compare_loans_button.val(data_compare_text); // "Compare loans"
            $compare_loans_button.addClass("disabled");
        }else{
            data_compare_text = data_compare_text.replace(scope.options.data_replace_compare_text, numberChecked);
            $compare_loans_button.val(data_compare_text); // "Compare " + numberChecked + " loans"
            $compare_loans_button.removeClass("disabled");
        }
    };

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load',function() {
        $(".pl13-product-module").compareLoans();
    });

})( jQuery, window, document );
;
/*
Version: 2.1.3
Date:2016-11-21
 */
/*
Version: 2.1.3
Date:2016-11-21
 */
/*
Version: 2.1.3
Date:2016-11-09
 */
/*
Version: 1.4.1
Date:2014-10-16
 */
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Tabs Menu Jquery Plugin
 *
 * Manages showing the tab content for each tab menu item, attach to the outer panel element "tab-container"
 * any .tab-menu-item will be automatically wired up to receive the click on .tab-menu-link
 * if "tab-menu-content" exists then the content will be copied to the "tab-content-container" element
 *
 * On init we remove the href from all tab-menu-link's so that we don't trigger a hash change on page,
 * we can then use the title to update the hash and trigger navigation off the title text,
 * currently hash base navigation is disabled as we have menu hashes already on collapsible menus
 *
 * Structure:
 * .tab-container > .tab-menu > ul > .tab-menu-item > div > .tab-menu-link
 * .tab-container > .tab-menu > ul > .tab-menu-item > .tab-menu-content
 * .tab-container > .tab-content-container
 *
 * Because we can have tabs within a collapsible menu within a tab container we need to specify the depth we go down so we don't go too deep.
 *
 * The .tab-content-container is always shown unlike on the collapsible menu where the mobile and desktop view are swapped in and out as the view port changes. With tabs the .tab-menu-content is just to keep the document outline valid and content is copied from here to the .tab-content-container when the .tab-menu-link is clicked.
 *
 * All wiring of events is only done after content is moved to .tab-content-container, this occurs initially due to triggerFirstMenuItem,
 * and after that everytime a tab is clicked. There is no need to bind events to the .tab-menu-content as this is never used and never seen visually.
 *
 * Example structure of markup (tab-container):
 * <div class="tab-container">
     <div class="tab-menu">
         <ul>
             <li class="tab-menu-item is-active">
                <div>
                     <a href="uid1" class="tab-menu-link" title="Board of directors">
                         <img class="tab-menu-img-active" src="assets/primary/imgs/placeholder/responsiveimages/button-our-people-rol.png"/>
                         <img class="tab-menu-img-standard" src="assets/primary/imgs/placeholder/responsiveimages/button-our-people-std.png"/>
                         <h4 class="tab-menu-title" aria-label="Board of directors">Board of directors</h4>
                     </a>
                 </div>
                 <!-- tab menu content start -->
                 <div class="tab-menu-content">

                 </div>
                 <!-- tab menu content end -->
             </li>
             <li class="tab-menu-item">
                <div>
                     <a href="uid2" class="tab-menu-link" title="Management">
                         <img class="tab-menu-img-active" src="assets/primary/imgs/placeholder/responsiveimages/button-our-people-rol.png"/>
                         <img class="tab-menu-img-standard" src="assets/primary/imgs/placeholder/responsiveimages/button-our-people-std.png"/>
                         <h4 class="tab-menu-title" aria-label="Board of directors">Management</h4>
                     </a>
                </div>
                 <div class="tab-menu-content">

                 </div>
             </li>
         </ul>
     </div>
     <!-- Content for Tabs Injected Here -->
     <div class="tab-content-container">

     </div>
 </div>
 *
 * Example Usage:
 * $(".tab-container").tabMenu();
 */

;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'tabMenu',
        defaults = {
            tabs : ".tab-container", // top level menu container, contains the menu items
            tab_menu : ".tab-menu", // contains all tab menu items (not the ".tab-content-container" container)
            tab_menu_item : ".tab-menu-item", // menu list item (gets the is-active applied after menu-link clicked)
            tab_menu_link : ".tab-menu-link", // menu link (a href)
            tab_menu_content : ".tab-menu-content", // menu items content
            tab_content_container : ".tab-content-container", // content container filled with tab-menu-content
            menu_tab : ".menu-tab", // top level menu container, contains the menu items
            menu_mobile_content : ".menu-mobile-content", // menu items mobile content
            menu_desktop_content : ".menu-desktop-content" // desktop content container filled with mobile-content
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = element;
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;

        // Only initialise tabs, desktop view (".tab-content-container") is initialised after content is loaded in view
        // other events for tabs within tabs or collapsible menus will be instantiated after loading content into desktop view.
        // If the tab contains a collapsible menu we don't initialise tabs as this will be called when
        // the collapsible menu content is loaded "loadFromCollapsibleMenuDesktopView" will be sent as an
        // option by the collapsible menu to initiate the tab.
        var withinTabMenuContent = $(this.element).closest(this.options.tab_menu_content).length;
        var withinTabContentContainer = $(this.element).closest(this.options.tab_content_container).length;
        if ((!withinTabMenuContent && !withinTabContentContainer) || this.options.loadFromCollapsibleMenuDesktopView || this.options.loadTabContentContainer) {
            this.init();
        }

    }

    Plugin.prototype.init = function () {
        var scope = this;

        //init events
        scope.setupEvents(scope);

        // strip href from each item so we don't navigate to element via hashtag anchor placement
        scope.removeHrefs(scope);

        // setup each menu-tab to open the first item if no location.hash required
        scope.initTab(scope);

    };

    // setup each menu-tab to open the first item if no location.hash required
    Plugin.prototype.initTab = function(scope) {
        var $menu_tab = $(scope.element); // menu-tab
        // check if location hash set and navigate to menu item if it is
        if (!scope.hasHash(scope, $menu_tab)){
            // trigger first menu item if not navigating to a hash
            scope.triggerFirstMenuItem(scope, $menu_tab);
        }
    };

    // add events to items
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        // wire up all general panels open/close
        var $tab_menu_links = $el.find("> " + scope.options.tab_menu + " > ul > " + scope.options.tab_menu_item + " > div > " + scope.options.tab_menu_link);
        $.each($tab_menu_links, function(i, el) {
            $(el).click($.proxy(scope.menuClicked, scope));
        });
    };

    // strip href from all links
    Plugin.prototype.removeHrefs = function(scope) {
        var $el = $(scope.element);
        var $tab_menu_links = $el.find("> " + scope.options.tab_menu + " > ul > " + scope.options.tab_menu_item + " > div > " + scope.options.tab_menu_link);
        $.each($tab_menu_links, function(i, el) {
            $(el).attr("href", "");
        });
    };

    // show menu item when clicked, adds is-active and copies mobile-content to desktop content
    Plugin.prototype.menuClicked = function(e) {
        var scope = this;
        var $menu_clicked = $(e.currentTarget);

        // current menu tab
        $menu_tab = $menu_clicked.closest(scope.options.tabs);

        // current menu item
        $tab_menu_item = $menu_clicked.closest(scope.options.tab_menu_item);

        if (!$tab_menu_item.hasClass("is-active")){
            // put the menu content into the tab view
            $tab_menu_content = $tab_menu_item.find("> " + scope.options.tab_menu_content);

            // remove all is-active's from other menus
            scope.deselectAllMenus(scope, $menu_tab);

            // add is-active to clicked menu
            $tab_menu_item.addClass("is-active");

            // copy content to desktop view
            if ($tab_menu_content.length){
                $tab_content_container = $(scope.element).find("> " + scope.options.tab_content_container);
                $tab_content_container.html($tab_menu_content.html());

                // load controllers in tab-content-container, their are
                // situations when we need to instantiate content once the desktop view is rendered
                //setTimeout(function(){
                scope.instantiateDesktopControllers(scope, $tab_content_container);
                //},0);
            }
        }

        // only trigger scroll for menu-item clicked not for default triggered menu
        /*if (scope.triggeredFirstMenuItem !== true){
            // scroll to menu-item clicked
            var scrollTop = $("body").scrollTop();
            scope.scrollMenuItem(scope, $tab_menu_item);
            window.location.hash = $tab_menu_item.context.title;
            // on desktop don't scroll to hash clicked
            if ($( window ).width() >= 704) {
                $("body").scrollTop(scrollTop);
            }
        }
        scope.triggeredFirstMenuItem = false;*/

        // keep mobile and desktop collapsible view in sync if within a collapsible menu
        scope.keepMobileDesktopTabsInSync(scope, $menu_tab, $menu_clicked);
        
        scope.triggeredFirstMenuItem = false;

        // stop event propagation so that the hashchange does not trigger a page navigation
        e.preventDefault();
        e.stopPropagation();

    };

    // keep mobile and desktop collapsible view in sync if within a collapsible menu
    Plugin.prototype.keepMobileDesktopTabsInSync = function(scope, $menu_tab, $menu_clicked) {
        var $collapsible_menu_tab = $menu_clicked.closest(scope.options.menu_tab);
        if ($collapsible_menu_tab.length){
            var withinMobile = $menu_clicked.closest(scope.options.menu_mobile_content).length;
            var withinDesktop = $menu_clicked.closest(scope.options.menu_desktop_content).length;
            if (!scope.triggeredFirstMenuItem){
                var locationTitle = $menu_clicked.attr("title");
                if (withinMobile){
                    // trigger desktop click
                    var $desktopRef = $collapsible_menu_tab.find(scope.options.menu_desktop_content);
                    var $tab_menu_item_desktop = $desktopRef.find(scope.options.tab_menu_link+"[title='" + locationTitle + "']");
                    if ($tab_menu_item_desktop.length){
                        scope.triggeredFirstMenuItem = true;
                        $tab_menu_item_desktop.trigger("click");
                    }
                }
                if (withinDesktop){
                    // trigger desktop click
                    var $mobileRef = $collapsible_menu_tab.find(scope.options.menu_mobile_content);
                    var $tab_menu_item_mobile = $mobileRef.find(scope.options.tab_menu_link+"[title='" + locationTitle + "']");
                    if ($tab_menu_item_mobile.length){
                        scope.triggeredFirstMenuItem = true;
                        $tab_menu_item_mobile.trigger("click");
                    }
                }
            }
        }
    };

    // instantiate interactive controllers (tabs, toggle-class, carousel, etc) within desktop view after being rendered
    Plugin.prototype.instantiateDesktopControllers = function(scope, $tab_content_container) {
        // re-activate the apply button and compare loans on desktop module
        //$tab_content_container.find(".pl57-apply").applyButton({loadFromCollapsibleMenuDesktopView:true});
        //$tab_content_container.find(".pl13-product-module").compareLoans({loadFromCollapsibleMenuDesktopView:true});
        // re-activate collapsible menus
        $tab_content_container.find(".menu-tab").collapsibleMenu({loadTabContentContainer:true});
        // re-activate tabs (load tabs in tab-content-container)
        $tab_content_container.find(".tab-container").tabMenu({loadTabContentContainer:true});
        // re-activate toggles
        $tab_content_container.find("[data-toggle-target]").genericToggle({loadTabContentContainer:true});
    };

    // scroll to menu-item clicked
    Plugin.prototype.scrollMenuItem = function(scope, $tab_menu_item) {
        // scroll to menu item for mobile only
        if ($( window ).width() < 704) {
            setTimeout(function(){
                $("body").animate({scrollTop: $tab_menu_item.offset().top}, 0);
            }, 0);
        }
    };

    // open the first menu-item
    Plugin.prototype.triggerFirstMenuItem = function(scope, $menu_tabs) {
        // trigger first menu item
        scope.triggeredFirstMenuItem = true;
        $.each($menu_tabs, function(i, el) {
            $(el).find(" > " + scope.options.tab_menu + " > ul > " + scope.options.tab_menu_item + ":first-child " + " > div > " +scope.options.tab_menu_link).trigger("click");
        });
    };

    // Remove is-active from all menu-item's in menu-tab
    Plugin.prototype.deselectAllMenus = function(scope, $menu_tab) {
        var $tab_menu_items = $menu_tab.find("> " + scope.options.tab_menu + " > ul > " + scope.options.tab_menu_item);
        $.each($tab_menu_items, function(i, el) {
            $(el).removeClass("is-active");
        });
    };

    // check if returning to a particular location in a menu
    // Example www.url.com/#uid3
    Plugin.prototype.hasHash = function(scope, $menu_tab) {
        var $el = $(scope.element);
        // remove location # from hash string
        var locationTitle = window.location.hash.replace("#", "");
        $tab_menu_link = $menu_tab.find("> " + scope.options.tab_menu + " > ul > " + scope.options.tab_menu_item + " > div > " + scope.options.tab_menu_link+"[title='" + locationTitle + "']");
        if ($tab_menu_link.length){
            var $menu_item = $tab_menu_link.closest(scope.options.tab_menu_item);
            if (!$menu_item.hasClass("is-active")){
                // open menu
                $tab_menu_link.trigger("click");
            }else{
                // scroll to menu
                scope.scrollMenuItem(scope, $menu_item);
            }
            return true;
        }else{
            return false;
        }
    };

    /*****************************/

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).ready(function() {
        //init on page automatically
        $(".tab-container").tabMenu();
    });


})( jQuery, window, document );
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Manage closing of a notification and setting the cookie value for the notification
 * Example: <div class="pl68-notification" data-cookie="cookie1">
 *
 * data-cookie = name of cookie to set when close clicked
 */
;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'notification',
        defaults = {
            data_cookie : "cookie",
            link_close : ".pl68-notification-close"
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;
        var $el = $(scope.element);

        // set cookie value
        scope._cookie_name = $el.data(scope.options.data_cookie);

        //init events
        scope.setupEvents(scope);

    };

    // add events to items
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        var $link_close = $el.find(scope.options.link_close);
        $link_close.click($.proxy(scope.closeClicked, scope));
    };

    // remove notification and set cookie
    Plugin.prototype.closeClicked = function(e) {
        var scope = this;
        var $link_clicked = $(e.currentTarget);
        setCookie(scope._cookie_name,'true',Number.MAX_VALUE);
        $(scope.element).remove();
        $("body").hide(0).show(); // fixes bug on ie9/10 where page height is not being rendered correctly after notification being removed
        e.preventDefault();
        e.stopPropagation();
    }

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load',function() {
        $(".pl68-notification").notification();
    });

})( jQuery, window, document );
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Floating Social, fixes the social bar below the left-hand-tabs
 *
 */
;
(function ($, window, document, undefined) {

    // Create the defaults once
    var pluginName = 'floatingSocial',
        defaults = {
            floating_element: ".pl54-floating-social",  // The Element we want to float
            floating_container: ".pl11-tabs",           // The Element container that defines the floating state bounds
            mobile_social_target: "#main-content"       // The Element to target when inserting the social mobile content
        };

    // Constructor
    function Plugin(element, options) {
        this.element = $(element);
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {

        var scope = this;

        // Element we need to fix
        scope.floatingElm = $(scope.element);

        // Element container
        scope.floatingCtr = scope.floatingElm.closest(scope.options.floating_container);

        // Set up window scroll and resize event listener and trigger on init
        $(window).on('scroll resize', function () {

            // Update the state
            scope.updateFixedState(scope);

        }).trigger('scroll');

	    // add social replicator so mobile version has a copy of the social buttons
	    scope.socialReplicator(scope);

    };

	//make a copy of the HTML content for mobile view

	Plugin.prototype.socialReplicator = function (scope) {
		var exists = $(scope.options.mobile_social_target + " .pl54-floating-social-copy").length;
		if (!exists) {
			$($(scope.options.floating_element)[0]).clone().appendTo(scope.options.mobile_social_target).addClass("pl54-floating-social-copy");
		}
	}

    // Update fixed element state
    Plugin.prototype.updateFixedState = function (scope, dims) {

        if (scope.floatingCtr.offset() == undefined){
            return;
        }

        // get some dimensions
        var elmH = scope.floatingElm.outerHeight(),
            ctrH = scope.floatingCtr.outerHeight(),
            winTop = $(window).scrollTop(),
            ctrTop = scope.floatingCtr.offset().top + elmH,
            ctrBot = ctrTop + (ctrH - elmH);

        // Toggle the is-fixed state
        if (winTop > ctrTop && winTop < ctrBot) {

            // Add is-fixed state and remove is-absolute state
            // if the viewport is between the top and bottom of the container
            scope.floatingElm.addClass('is-fixed').removeClass('is-absolute');

	        if (winTop > (ctrBot - elmH)) {

                // Add is-absolute state and remove is-fixed state
                // if the base of our sticky element hits the base of the container
                scope.floatingElm.addClass('is-absolute').removeClass('is-fixed');
            }

        } else {

            // Remove is-fixed and is-absolute states if the viewport is not focused over the container
            scope.floatingElm.removeClass('is-fixed is-absolute');

        }

	    // mobile view (stick element when tab within view)
	    if ($(window).width() < 897) {
		    // make sure footer is not in view
		    var footerIsInView = this.inView($("#main-footer")[0]);
		    if (footerIsInView) {
			    $(scope.options.floating_element + "-copy").removeClass("is-fixed");
		    } else {
			    this.checkWithinView(scope, $(scope.options.floating_container));
		    }
	    }
    };

	// check if element is within view and if so add is-fixed
	Plugin.prototype.checkWithinView = function (scope, $el) {
		var isInView = this.inView($el[0]);
		if (isInView) {
			$(scope.options.floating_element + "-copy").addClass("is-fixed"); // .pl54-floating-social-copy
		}else{
			$(scope.options.floating_element + "-copy").removeClass("is-fixed");
		}
	}

	// get window size
	Plugin.prototype.getWindowSize = function () {
		var winW,WinH = 0;
		if (document.body && document.body.offsetWidth) {
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
		if (document.compatMode == 'CSS1Compat' &&
				document.documentElement &&
				document.documentElement.offsetWidth) {
			winW = document.documentElement.offsetWidth;
			winH = document.documentElement.offsetHeight;
		}
		if (window.innerWidth && window.innerHeight) {
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		return {w:winW, h:winH};
	}

	// Calculate if element in view
	Plugin.prototype.inView = function (element) {
    if (element) {
      var winSize = this.getWindowSize();
      var box = element.getBoundingClientRect();
      if ((box.bottom < 0) || (box.top > winSize.h)){
        return false;
      }
      return true;
    }else{
      return false;
    }

	}

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin(this, options));
            }
        });
    };

})(jQuery, window, document);



//Social Sharing Pop up script

(function ($) {

	$.fn.socialpop = function(url, h, w) {

		var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;
		var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;

		width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
		height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;

		var left = ((width / 2) - (w / 2)) + dualScreenLeft;
		var top = ((height / 2) - (h / 2)) + dualScreenTop;

		var newwindow = window.open(url,'Share','height=' + h + ',width=' + w + ',top=' + top + ',left=' + left);

		if (window.focus) {
			newwindow.focus();
		}
	};

	$('.social-share-pop').on('click', function(e) {
		e.preventDefault();
		var url = $(this).attr('href');
		$(this).socialpop(url, 400, 600);
	});

}(jQuery));


$(window).on('load',function () {

	$(".pl54-floating-social").floatingSocial();

});


;
/*!
 * jStuck v1.0.3
 */

(function ($, window, document, undefined) {
	"use strict";

	// Defaults
	var pluginName = 'jStuck', defaults = {
		base:   undefined,     // the containing element (bounds)
		state:  undefined,     // the state to apply
		clone:  false,         // should we be cloned to maintain document integrity?
		self:   false,         // should we offset by our own height?
		above:  false,         // element list eg: .element, .element-two, #el
		buffer: {              // top and bottom buffer in pixels
			top:0,
			bottom:0
		},
		align:  false,         // do we need to be aligned?
		desktopBreakpoint: 897 // Breakpoint for desktop screen (same as the CSS @media query)
	};

	// Constructor
	function Plugin(element, options) {
		this.element = element;
		this.options = $.extend({}, defaults, options);
		this._defaults = defaults;
		this.stuck = {};
		this.dims = {};
		this._name = pluginName;
		this.init();
	}

	// Initialize...
	Plugin.prototype.init = function () {
		var scope = this;

		// Reference the element once only
		scope.options.element = $(scope.element);

		// Is touch enabled?
		scope.options.isTouchEnabled = typeof Modernizr !== 'undefined' && Modernizr.touch;

		// Get the settings from the data-jstuck attributes
		var data = scope.options.element.data();
		scope.options.base          = data.jstuckContainer;
		scope.options.state         = data.jstuckState;
		scope.options.clone         = data.jstuckClone || false;
		scope.options.selfType      = data.jstuckOffsetSelf;
		scope.options.self          = data.jstuckOffsetSelf || false;
		scope.options.above         = data.jstuckOffsetTop || false;
		scope.options.align         = data.jstuckAlign || false;
		scope.options.fixiOS        = data.jstuckFixios || false;
		scope.options.scrollBack    = data.jstuckScrollBack || false;
		scope.options.disableDesktop = data.jstuckDisableDesktop;

		// Set some flags for the scrollback option
		scope.options.isInit        = true;  // Initializing phase
		scope.options.touching      = true;  // User is touching the screen
		scope.options.animated      = false; // jQuery animation in action

		// get buffer
		if (data.jstuckOffsetBuffer) {
			scope.options.buffer.top    = $.isNumeric(data.jstuckOffsetBuffer.top) ? data.jstuckOffsetBuffer.top : scope.calculateHeight(scope, data.jstuckOffsetBuffer.top) || 0;
			scope.options.buffer.bottom = $.isNumeric(data.jstuckOffsetBuffer.bottom) ? data.jstuckOffsetBuffer.bottom : scope.calculateHeight(scope, data.jstuckOffsetBuffer.bottom) || 0;
		}

		// Get the base element where we apply the states
		scope.stuck.base = $(scope.options.base);

		// Setup
		scope.setup(scope);

		// Set up clone if required
		if (scope.options.clone) {
			scope.setUpClone(scope);
		}

		// Stuckify
		scope.stuckify(scope);

		// Force apply
		$(window).trigger('scroll');
	};

	/**
	 * Stuck Setup
	 * @param scope
	 */
	Plugin.prototype.setup = function(scope) {

		// Get dims
		scope.dims.offsetTop       = $(window).scrollTop();
		scope.dims.stuckHeight     = scope.options.element.outerHeight();
		scope.dims.containerHeight = scope.stuck.base.outerHeight();
		scope.dims.heightAbove     = scope.getHeightAbove(scope);
		scope.dims.lastScrollPos   = scope.dims.offsetTop;

		// Update is_desktop global
		scope.dims.is_desktop = scope.isDesktop(scope);

	};

	/**
	 * Set alignment if needed
	 * @param scope
	 * @param cleanup
	 */
	Plugin.prototype.setAlignment = function(scope, cleanup) {

		// only apply if ne need to
		if (!$(scope.options.base).is(':visible')) {
			cleanup = true;
		}

		// Update the alignment if we have set it...
		if (scope.options.align && scope.dims.is_desktop) {

			// cleanup by default
			scope.options.element.removeAttr('style');

			if (!cleanup) {
				if (scope.options.align === 'right') {
					// right is tricky
					scope.options.element.css({right: $(window).width() - (scope.stuck.base.offset().left + scope.stuck.base.outerWidth()) + 'px'});
				}

				if (scope.options.align === 'left') {
					// left is easy
					scope.options.element.css({left: scope.stuck.base.offset().left + 'px'});
				}
			}

		}
	};

	/**
	 * Set up clone if we need one
	 * @param scope
	 */
	Plugin.prototype.setUpClone = function(scope) {

		// If we're not already stuck
		if (!scope.stuck.base.is('.' + scope.options.state)) {

			// Create a clone of our element
			scope.stuck.clone = scope.options.element.clone();

			// Empty it, set it's height, insert it into the dom, class it and hide it
			scope.stuck.clone
				.css({'height': scope.dims.stuckHeight})
				.insertBefore(scope.options.element)
				.removeClass('jstuck')
				.addClass('is-stuck-clone')
				.empty();
		}

	};

	/**
	 * Get Height Above
	 * @param scope
	 * @returns {number}
	 */
	Plugin.prototype.getHeightAbove = function(scope) {

		// by default zero it out
		var height = 0;

		// if we have a height to calculate
		if (scope.options.above !== false) {
			height = scope.calculateHeight(scope, scope.options.above);
		}

		// return the height
		return height;
	};

	/**
	 * Calculate Height of x elements
	 */
	Plugin.prototype.calculateHeight = function(scope, selectors) {
		var height = 0;

		// Get all of the elements in the elementsAbove array that are visible
		var $els = $(selectors).filter(function () {
			return $(this).is(':visible');
		});

		// Loop through them and add up their heights
		$els.each(function () {
			height = height + $(this).outerHeight();
		});

		return height;
	};

	/**
	 * Detect touch for its duration
	 */
	Plugin.prototype.checkTouching = function(scope) {

		// Requires modernizr touch test because we don't want this on a non-touch enabled device
		if ( scope.options.isTouchEnabled ) {

			// On Click or TouchStart we are touching
			$(window).on('click touchstart', function(e) {

				// Set the global option to true
				scope.options.touching = true;

			// On TouchEnd we are no longer touching
			}).on('touchend', function() {

				// Set the global option to false
				scope.options.touching = false;

			});
		}

	};

	/**
	 * Stuck Events
	 * @param scope
	 */
	Plugin.prototype.stuckify = function (scope) {

		// Set up the test for touch events
		scope.checkTouching(scope);

		// Window resize event
		$(window).on('resize', scope.debounce( function () {

			// Update is_desktop global
			scope.dims.is_desktop = scope.isDesktop(scope);

      // if switching from mobile with menu open to desktop we have to close the menu
      if (scope.dims.is_desktop && ($("body").hasClass("is-navigation-toggled") || $("body").hasClass("is-header-stuck"))){
        $("body").removeClass("is-navigation-toggled");
        $("body").removeClass("is-header-stuck");
      }

			// Get dims
			scope.dims.offsetTop       = $(window).scrollTop();
			scope.dims.stuckHeight     = scope.options.element.outerHeight();
			scope.dims.containerHeight = scope.stuck.base.outerHeight();
			scope.dims.heightAbove     = scope.getHeightAbove(scope);
			scope.dims.lastScrollPos   = scope.dims.offsetTop;

			// we need to trigger a scroll but only on touch enabled devices
			if ( scope.options.isTouchEnabled ) {
				$(window).trigger('scroll');
			}

			// adjust the clone height if there is one
			if (scope.options.clone) {
				scope.stuck.clone.css({'height': scope.dims.stuckHeight});
			}

		})).trigger('resize');

		// Define some properties
		var elmH = 0, ctrH, winTop, ctrTop, ctrBot, to, isAnimated;

		// On scroll
		$(window).on('scroll', function () {

			// unstick when on desktop
			if (scope.dims.is_desktop && scope.options.disableDesktop) {
				scope.unstick(scope);
				return;
			}

			// Responsive self offset checking...
			scope.options.self = (scope.options.selfType === 'desktop' && scope.dims.is_desktop) || false;

			// Update dims
			scope.dims.offsetTop = scope.options.self !== false ? $(window).scrollTop() - scope.dims.stuckHeight: $(window).scrollTop();

			// if we just started scrolling check the height above again
			if (scope.dims.offsetTop < 1) {
				scope.dims.heightAbove = scope.getHeightAbove(scope);
			}

			// get some dimensions
			elmH   = scope.dims.stuckHeight;
			ctrH   = scope.dims.containerHeight;
			winTop = scope.dims.offsetTop;
			ctrTop = scope.stuck.base.offset().top + elmH;
			ctrBot = ctrTop + (ctrH - elmH);

			// adjust the clone height if there is one
			if (scope.options.clone) {
				scope.stuck.clone.css({'height': elmH});
			}

			// if the element height zero's we should void the result
			if (elmH <= 0) {
				return;
			}

			// Adjust for non-self offsetting elements
			if (scope.options.self === false) {
				ctrTop = ctrTop - elmH;
			}

			// adjust top buffer
			if (scope.options.buffer.top > 0) {
				ctrTop = (ctrTop - scope.options.buffer.top);
			}

			// adjust bottom buffer
			if (scope.options.buffer.bottom > 0) {
				ctrBot = (ctrBot - scope.options.buffer.bottom);
			}

			// adjust top buffer for height above
			if (scope.dims.heightAbove > 0) {
				ctrTop = scope.dims.heightAbove;
			}

			// are we scrolling down
			if (winTop < ctrTop) {
				scope.outsideAbove(scope);
			}

			// or up?
			if (winTop > ctrBot) {
				scope.outsideBelow(scope);
			}

			// Toggle states
			if (winTop > ctrTop && winTop < ctrBot) {

				// only apply if ne need to
				if (!$(scope.options.base).is(':visible')) {
					return;
				}

				// Add stuck state and remove stopped state
				// if the viewport is between the top and bottom of the container
				scope.stick(scope);

				// Do the scrollBack
				scope.doScrollBack(scope, winTop, elmH, to, isAnimated);


				if (winTop > (ctrBot - elmH)) {
					// Add stopped state and remove stuck state
					// if the base of our sticky element hits the base of the container
					scope.stop(scope);
				}

			} else {

				// Remove stuck and stopped states if the viewport is not focused over the container
				scope.unstick(scope);

				// if scrolling to top from say a #top we update to make sure menu is shown when scrollTop equals 0
				if (winTop === 0) {
					scope.show();
				}

			}

		});

		// fix iOS (because it's very silly) if we have asked for it...
		if (scope.options.fixiOS !== false) {
			scope.fixSillyPhones(scope);
		}

	};

	/**
	 * doScrollBack, shows and hides the element depending on the scroll position
	 * @param scope
	 * @param winTop
	 * @param elmH
	 * @param to
	 * @param isAnimated
	 */
	Plugin.prototype.doScrollBack = function(scope, winTop, elmH, to, isAnimated) {

		// If we have set the option but only if we're not in the initialization phase
		if (!scope.options.is_desktop && scope.options.scrollBack && !scope.options.isInit) {

			// Check if the scroll event is being triggered by a jquery animation event (i.e. you clicked on a tab on mobile)
			isAnimated = $("html, body").is(':animated');

			// If it is animated
			if (isAnimated) {

				scope.dims.lastScrollPos = 0;

				// We don't know which way the scroll is going to go so hide the element regardless
				scope.hide();

			}

			// If the screen is not being touched (default is true for non-touch devices)
			// And the scroll event is not a jquery animation event
			// Basically this cancels excess updates fiering while the screen is freescrolling
			if (scope.options.touching && !isAnimated)  {

				// Set an internal watcher to let us know when the scroll has stopped
				clearTimeout(to);
				to = setTimeout(function() {

					// Otherwise this is an upscroll so show the element
					scope.show();

					// If we have moved below the bottom of the element
					if (winTop >= elmH && winTop >= scope.dims.lastScrollPos){

						// This is a downscroll so hide the element
						scope.hide();
					}

					// Update the last scroll position
					scope.dims.lastScrollPos = winTop;

				}, 20);

			}

		}

		// This is no longer the initialization phase
		scope.options.isInit = false;

	};

	/**
	 * Fix Silly Phones (i.e. iOS)
	 */
	Plugin.prototype.fixSillyPhones = function(scope) {

		// For iOS devices we need to obscure the fixed header when the keyboard is toggled
		// due to the many problems with the way the position:fixed property is handled on these devices!
		// We can't simply reset the position though because it is not possible to calculate it after
		// a programmatic scroll is triggered, so we can only hide it and show it again on blur.

		// Yucky sniffing...
		var iOS = /(iPad|iPhone|iPod)/g.test( navigator.userAgent );

		// If it is not a silly phone just stop here...
		if (!iOS) {
			return;
		}

		// If it is a silly phone we need to do some work
		var $element = $(scope.options.fixiOS);

		// Whatch all inputs and textareas on focus and blur
		$(document).on('focus', 'input, textarea', function (e) {

			// Avoid this action within stuck elements
			if ($(e.target).closest(scope.options.fixiOS).length) {
				return;
			}

			// Hide the header
			$element.hide();

			// If we scoll again show the header but that's it
			$(window).on('scroll', function() {
				$element.show();
			});

		}).on('blur', 'input, textarea', function (e) {

			// Avoid this action within stuck elements
			if ($(e.target).closest(scope.options.fixiOS).length) {
				return;
			}

			// Show the header
			$element.show();
		});
	};

	// Above or Below?
	Plugin.prototype.outsideAbove = function(scope) {
		scope.stuck.base.addClass('is-outside-above').removeClass('is-outside-below');
	};

	Plugin.prototype.outsideBelow = function(scope) {
		scope.stuck.base.addClass('is-outside-below').removeClass('is-outside-above');
	};

	// Stick the Element
	Plugin.prototype.stick = function (scope) {
		// update states
		scope.stuck.base.addClass(scope.options.state).removeClass(scope.options.state + '-stopped');

		// update alignment
		scope.setAlignment(scope, false);
	};

	// Stop the Element
	Plugin.prototype.stop = function (scope) {
		// update states
		scope.stuck.base.addClass(scope.options.state + '-stopped').removeClass(scope.options.state);

		// update alignment
		scope.setAlignment(scope, true);
	};

	// Un-stick the Element
	Plugin.prototype.unstick = function (scope) {
		// update states
		scope.stuck.base.removeClass(scope.options.state).removeClass(scope.options.state + '-stopped');

		// update alignment
		scope.setAlignment(scope, true);
	};

	// Hide on scroll back
	Plugin.prototype.hide = function() {
		var scope = this;
		scope.stuck.base.addClass(scope.options.state + '-obscured');
	};

	// show
	Plugin.prototype.show = function() {
		var scope = this;
		scope.stuck.base.removeClass(scope.options.state + '-obscured');
	};

	/**
	 * Viewport Dimensions for CSS breakpoint Sync
	 * @returns {{width: *, height: *}}
	 */
	Plugin.prototype.viewport = function () {

		// http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript

		var e = window,
			a = 'inner';

		if (!('innerWidth' in window )) {

			a = 'client';
			e = document.documentElement || document.body;

		}

		// Return the viewport width that matches CSS @media queries
		return {width: e[a + 'Width'], height: e[a + 'Height']};

	};

	/**
	 * Check for desktop
	 * @param scope
	 * @returns {boolean}
	 */
	Plugin.prototype.isDesktop = function (scope) {

		// Return true/false based on screen width
		return (scope.viewport().width >= scope.options.desktopBreakpoint);

	};

	/**
	 * Debounce
	 * @param func
	 * @param duration
	 * @param timeout
	 * @returns {function}
	 */
	Plugin.prototype.debounce = function(func, duration, timeout) {
		return function() {
			var args = arguments;
			clearTimeout(timeout);
			timeout = setTimeout(function() {
				func.apply(null , args);
			}, duration || 25);
		};
	};

	// Constructor Wrapper
	$.fn[pluginName] = function (options) {
		return this.each(function () {
			if (!$.data(this, 'plugin_' + pluginName)) {
				$.data(this, 'plugin_' + pluginName, new Plugin(this, options));
			}
		});
	};

	// Init
	$(window).on('load',function () {
	// $(document).ready(function() {
		$('.jstuck').jStuck();
	});

})(jQuery, window, document);
;
/*
Version: 2.1.8
Date:2017-09-11
 */
/*! rangeslider.js - v0.3.9 | (c) 2015 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){"use strict";function b(){var a=document.createElement("input");return a.setAttribute("type","range"),"text"!==a.type}function c(a,b){var c=Array.prototype.slice.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)}function d(a,b){return b=b||100,function(){if(!a.debouncing){var c=Array.prototype.slice.apply(arguments);a.lastReturnVal=a.apply(window,c),a.debouncing=!0}return clearTimeout(a.debounceTimeout),a.debounceTimeout=setTimeout(function(){a.debouncing=!1},b),a.lastReturnVal}}function e(a){return 0===a.offsetWidth||0===a.offsetHeight||a.open===!1?!0:!1}function f(a){for(var b=[],c=a.parentNode;e(c);)b.push(c),c=c.parentNode;return b}function g(a,b){function c(a){"undefined"!=typeof a.open&&(a.open=a.open?!1:!0)}var d=f(a),e=d.length,g=[],h=a[b];if(e){for(var i=0;e>i;i++)g[i]=d[i].style.display,d[i].style.display="block",d[i].style.height="0",d[i].style.overflow="hidden",d[i].style.visibility="hidden",c(d[i]);h=a[b];for(var j=0;e>j;j++)c(d[j]),d[j].style.display=g[j],d[j].style.height="",d[j].style.overflow="",d[j].style.visibility=""}return h}function h(b,e){if(this.$window=a(window),this.$document=a(document),this.$element=a(b),this.options=a.extend({},l,e),this.polyfill=this.options.polyfill,this.onInit=this.options.onInit,this.onSlide=this.options.onSlide,this.onSlideEnd=this.options.onSlideEnd,this.polyfill&&k)return!1;this.identifier="js-"+i+"-"+j++,this.startEvent=this.options.startEvent.join("."+this.identifier+" ")+"."+this.identifier,this.moveEvent=this.options.moveEvent.join("."+this.identifier+" ")+"."+this.identifier,this.endEvent=this.options.endEvent.join("."+this.identifier+" ")+"."+this.identifier,this.min=parseFloat(this.$element[0].getAttribute("min")||0),this.max=parseFloat(this.$element[0].getAttribute("max")||100),this.value=parseFloat(this.$element[0].value||this.min+(this.max-this.min)/2),this.step=parseFloat(this.$element[0].getAttribute("step")||1),this.toFixed=(this.step+"").replace(".","").length-1,this.$fill=a('<div class="'+this.options.fillClass+'" />'),this.$handle=a('<div class="'+this.options.handleClass+'" />'),this.$range=a('<div class="'+this.options.rangeClass+'" id="'+this.identifier+'" />').insertAfter(this.$element).prepend(this.$fill,this.$handle),this.$element.css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",opacity:"0"}),this.handleDown=a.proxy(this.handleDown,this),this.handleMove=a.proxy(this.handleMove,this),this.handleEnd=a.proxy(this.handleEnd,this),this.init();var f=this;this.$window.on("resize."+this.identifier,d(function(){c(function(){f.update()},300)},20)),this.$document.on(this.startEvent,"#"+this.identifier+":not(."+this.options.disabledClass+")",this.handleDown),this.$element.on("change."+this.identifier,function(a,b){if(!b||b.origin!==f.identifier){var c=a.target.value,d=f.getPositionFromValue(c);f.setPosition(d)}})}var i="rangeslider",j=0,k=b(),l={polyfill:!0,rangeClass:"rangeslider",disabledClass:"rangeslider--disabled",fillClass:"rangeslider__fill",handleClass:"rangeslider__handle",startEvent:["mousedown","touchstart","pointerdown"],moveEvent:["mousemove","touchmove","pointermove"],endEvent:["mouseup","touchend","pointerup"]};h.prototype.init=function(){this.onInit&&"function"==typeof this.onInit&&this.onInit(),this.update()},h.prototype.update=function(){this.handleWidth=g(this.$handle[0],"offsetWidth"),this.rangeWidth=g(this.$range[0],"offsetWidth"),this.maxHandleX=this.rangeWidth-this.handleWidth,this.grabX=this.handleWidth/2,this.position=this.getPositionFromValue(this.value),this.$element[0].disabled?this.$range.addClass(this.options.disabledClass):this.$range.removeClass(this.options.disabledClass),this.setPosition(this.position)},h.prototype.handleDown=function(a){if(a.preventDefault(),this.$document.on(this.moveEvent,this.handleMove),this.$document.on(this.endEvent,this.handleEnd),!((" "+a.target.className+" ").replace(/[\n\t]/g," ").indexOf(this.options.handleClass)>-1)){var b=this.getRelativePosition(a),c=this.$range[0].getBoundingClientRect().left,d=this.getPositionFromNode(this.$handle[0])-c;this.setPosition(b-this.grabX),b>=d&&b<d+this.handleWidth&&(this.grabX=b-d)}},h.prototype.handleMove=function(a){a.preventDefault();var b=this.getRelativePosition(a);this.setPosition(b-this.grabX)},h.prototype.handleEnd=function(a){a.preventDefault(),this.$document.off(this.moveEvent,this.handleMove),this.$document.off(this.endEvent,this.handleEnd),this.onSlideEnd&&"function"==typeof this.onSlideEnd&&this.onSlideEnd(this.position,this.value)},h.prototype.cap=function(a,b,c){return b>a?b:a>c?c:a},h.prototype.setPosition=function(a){var b,c;b=this.getValueFromPosition(this.cap(a,0,this.maxHandleX)),c=this.getPositionFromValue(b),this.$fill[0].style.width=c+this.grabX+"px",this.$handle[0].style.left=c+"px",this.setValue(b),this.position=c,this.value=b,this.onSlide&&"function"==typeof this.onSlide&&this.onSlide(c,b)},h.prototype.getPositionFromNode=function(a){for(var b=0;null!==a;)b+=a.offsetLeft,a=a.offsetParent;return b},h.prototype.getRelativePosition=function(a){var b=this.$range[0].getBoundingClientRect().left,c=0;return"undefined"!=typeof a.pageX?c=a.pageX:"undefined"!=typeof a.originalEvent.clientX?c=a.originalEvent.clientX:a.originalEvent.touches&&a.originalEvent.touches[0]&&"undefined"!=typeof a.originalEvent.touches[0].clientX?c=a.originalEvent.touches[0].clientX:a.currentPoint&&"undefined"!=typeof a.currentPoint.x&&(c=a.currentPoint.x),c-b},h.prototype.getPositionFromValue=function(a){var b,c;return b=(a-this.min)/(this.max-this.min),c=b*this.maxHandleX},h.prototype.getValueFromPosition=function(a){var b,c;return b=a/(this.maxHandleX||1),c=this.step*Math.round(b*(this.max-this.min)/this.step)+this.min,Number(c.toFixed(this.toFixed))},h.prototype.setValue=function(a){a!==this.value&&this.$element.val(a).trigger("change",{origin:this.identifier})},h.prototype.destroy=function(){this.$document.off("."+this.identifier),this.$window.off("."+this.identifier),this.$element.off("."+this.identifier).removeAttr("style").removeData("plugin_"+i),this.$range&&this.$range.length&&this.$range[0].parentNode.removeChild(this.$range[0])},a.fn[i]=function(b){return this.each(function(){var c=a(this),d=c.data("plugin_"+i);d||c.data("plugin_"+i,d=new h(this,b)),"string"==typeof b&&d[b]()})}});;
/*!
 * Range Slider GUI
 *
 * Dependencies:
 * rangeslider.js - v0.3.5 | https://github.com/andreruffert/rangeslider.js
 *
 */

;
(function ($, window, document, undefined) {

    // Defaults
    var pluginName = 'rangeSlider', defaults = {

        // Base elements
        rangeContainer: '.form-field-range',                    // The range input container element

        // Range Type
        rangeType: 'number',                                    // The type of range [number/duration]

        // Range Step Markers
        rangeStepMarkers: true,                                 // Show the step markers for ranges with a step value defined (override with data-show-steps="true/false")
        rangeStepMarkersMax: 25,                                // The maximum number of step markers to generate, try to keep things in perspective :) (set to 25 due to sub-pixel layout issues in safari)
        rangeStepsClass: 'rangeslider-steps',                   // The steps container class
        rangeStepsOffsetClass: 'rangeslider-steps-offsetter',   // The steps offsetter class (used to align markers tot he handle)
        rangeStepClass: 'rangeslider-step',                     // The step marker class

        // Range Output
        rangeNumberOutput: true,                                // Do we add a number input element to display the current value? (override with data-show-number="true/false")
        rangeNumberClass: 'form-range-number-input',            // The number input classname to apply

        // RangeSlider.js options
        rangeSliderOptions: {                                   // The options to pass to rangeslider.js

            // Feature detection the default is `true`.
            // Set this to `false` if you want to use
            // the polyfill also in Browsers which support
            // the native <input type="range"> element.
            polyfill: false,

            // Default CSS classes
            rangeClass: 'rangeslider-bar',
            fillClass: 'rangeslider-fill',
            handleClass: 'rangeslider-handle'

            // Callback functions
            //onInit: function() {},
            //onSlide: function(position, value) {},
            //onSlideEnd: function(position, value) {}
        }
    };

    // Constructor
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {

        var scope = this;

        // The range input element
        scope.rangeSlider = $(scope.element);

        // The type of range we're working with (number or duration?)
        scope.rangeType = typeof scope.rangeSlider.data("range-type") !== 'undefined' ? scope.rangeSlider.data("range-type") : scope.options.rangeType;

        // The range container element
        scope.rangeContainer = scope.rangeSlider.closest(scope.options.rangeContainer);

        // Check if we are overriding the show range number default from the markup
        scope.rangeShowNumber = typeof scope.rangeSlider.data("show-number") !== 'undefined' ? scope.rangeSlider.data("show-number") : scope.options.rangeNumberOutput;

        // Set up the number input
        !scope.rangeShowNumber || scope.buildRangeNumber(scope);

        // If this input has a step attribute
        if (typeof scope.rangeSlider.attr('step') !== 'undefined') {

            // Check if we are overriding the show range steps default from the markup
            scope.rangeShowSteps = typeof scope.rangeSlider.data("show-markers") !== 'undefined' ? scope.rangeSlider.data("show-markers") : scope.options.rangeStepMarkers;

            // Set up step markers
            !scope.rangeShowSteps || scope.buildStepMarkers(scope);

        }

        // If this is a duration type we need to do some extra work so lets set up a callback to help us out
        scope.options.rangeSliderOptions.onSlide = function(position, value) {

            scope.rangeType !== 'duration' || scope.updateDurationData(scope, value);

        };

        // Initialize rangeslider.js with options
        scope.rangeSlider.rangeslider(scope.options.rangeSliderOptions);

        // Find the range slider bar
        scope.rangeBar = scope.rangeContainer.find('.' + scope.options.rangeSliderOptions.rangeClass);

        // Listen to mouse events on the bar
        scope.rangeBarEvents(scope);

    };

    // Build the number input
    Plugin.prototype.buildRangeNumber = function (scope) {

        // Create a number input that we can use to display our current value
        // We can simply clone our range input an make some minor adjustments
        // because we want both elements to mirror min, max and step values...
        scope.rangeNumber = $('<input />')
            .attr('class', scope.options.rangeNumberClass)
            .attr('type', 'number')
            .attr('id', scope.rangeSlider.attr('name') + '-number')
            .attr('name', '') // We don't want the extra input to post data
            .removeAttr('data-ng-model');

        // Place the number input before the range input
        scope.rangeSlider.before(scope.rangeNumber);

        // store the default max in data because we may need to adjust it at some stage
        scope.rangeNumber.data('max', scope.rangeNumber.attr('max'));

        // if this is a duration range we need to do a little more scaffolding
        if (scope.rangeType === 'duration' ) {

            // wrap the range number to give us some structure
            scope.rangeNumber.wrap('<div class="' + scope.options.rangeNumberClass + '-wrap">');

            // Set up our duration output
            scope.rangeTypeOutput = $('<span class="rangeslider-' + scope.rangeType + '" />');

            // Place the range type output after the number field
            scope.rangeNumber.after(scope.rangeTypeOutput);

            // disallow text selection for IE8
            scope.rangeTypeOutput.unselectable = "on";
        }

        // IE11 needs some help pre-populating the number element so we trigger the change event right away
        // FireFox 33.0 (32.0.3 and presumably lower) fails to set the value to the actual value in favour of the min value
        scope.rangeNumber.val(scope.rangeSlider.val()).trigger('keyup');

        // Set up event listeners
        scope.rangeChangeEvents(scope);

    };

    // Update the duration data and output
    Plugin.prototype.updateDurationData = function(scope, value) {

        // make sure the min value is 0
        scope.rangeSlider.attr('min', 0).val(value);

        // Set the output text
        scope.rangeTypeOutputText = value > 1 ? 'years' : 'year';

        // Reset the max to it's original value
        scope.rangeNumber.attr('max', scope.rangeNumber.data('max'));

        // if we are at the minimum value this is 6 months!
        if (value < 1) {

            // reset the min value before we submit
            scope.rangeSlider.attr('min', 0.5).val(0.5);

            // adjust the output
            scope.rangeNumber.val(6);

            // Set the output text
            scope.rangeTypeOutputText = 'months';

            // If the max is less than or equal to 6
            if ( scope.rangeNumber.data('max') <= 6 ) {

                // Temporarily increment the max to allow us to increase the number from 6 months again
                scope.rangeNumber.attr('max', 7);

            }
        }

        scope.rangeTypeOutput.text(scope.rangeTypeOutputText);

    };

    // Build step markers
    Plugin.prototype.buildStepMarkers = function (scope) {

        // Create elements
        var $steps = $('<div/>').addClass(scope.options.rangeStepsClass);

        // Get the range max and divide it by step
        var min = parseInt(scope.rangeSlider.attr('min')),
            max = parseInt(scope.rangeSlider.attr('max')),
            step = parseInt(scope.rangeSlider.attr('step')),
            steps = max / step;

        // Set the maximum steps if it exceeds out Max Markers setting
        steps = steps > scope.options.rangeStepMarkersMax ? scope.options.rangeStepMarkersMax : steps;

        // Get percentage width of step elements
        var percent = 100 / steps;

        // Create an element for offsetting the steps from the edges
        var $offsetter = $('<div/>').addClass(scope.options.rangeStepsOffsetClass);

        // Append the offsetter
        $steps.append($offsetter);

        // Apply offset
        $offsetter.css({
            'margin-left': '-' + (percent / 2) + '%',
            'margin-right': '-' + (percent / 2) + '%'
        });

        // Adjust for less than 10 steps by adding an additional marker and re-calculating percent
        //if (steps < 10) {
        if(min <= 0) {
            steps++;
            percent = 100 / steps;
        }

        // Append steps
        for (var i = 0; i < steps; i++) {
            $offsetter.append($('<div/>').addClass(scope.options.rangeStepClass).css({width: percent + '%'}));
        }

        // Insert the step markers before the range slider
        scope.rangeSlider.before($steps);

    };

    // Listen to events on the rangeslider bar
    Plugin.prototype.rangeBarEvents = function(scope) {

        // Capture mouse events on the rangeslider bar
        scope.rangeBar.on('mousedown', function(e) {

            // apply focus to the range input
            scope.rangeSlider.trigger('focus');

        }).on('mouseup', function(e) {

            // Blur the range slider input
            scope.rangeSlider.trigger('blur');

        });

    };

    // Range change event listeners
    Plugin.prototype.rangeChangeEvents = function (scope) {

        // Range input change listener
        scope.rangeSlider.on('change', function (e) {

            var value = parseInt($(this).val());

            // Set the value
            scope.rangeNumber.val(value);

        });

        // Range input change listener
        scope.rangeNumber.on('change', function (e) {

            // Get the value
            var value = parseInt($(this).val());

            // If this is a duration range type
            if (scope.rangeType === 'duration') {

                // And we're currently displaying 6 months
                if (scope.oldValue === 6 && scope.rangeTypeOutputText === 'months') {

                    // And the slider value is 0 (or 0.5 for 6 months)
                    if (scope.rangeSlider.val() < 1) {

                        // If we're going down
                        if (value < 6) {

                            // Preset the value to 6
                            $(this).val(6);

                            // And leave it at that
                            return false;

                        }

                        // Preset the value to 6
                        $(this).val(1);

                        // Set the value to 0
                        value = 0;
                    }
                }
            }

            // Set the value
            scope.rangeSlider.val(value).trigger('change');

        });

        // Number input value trap
        scope.rangeNumber.on('mousedown keydown', function(e) {

            // Store the old value
            scope.oldValue =  parseInt($(this).val());

        });

        // Number input mousewheel event
        scope.rangeNumber.on('mousewheel', function() {

            // Get the value
            scope.oldValue = parseInt($(this).val());

            // Get this
            var _self = this;

            // Do this in a time out so the event has time to register
            setTimeout(function(){

                // Update input value
                var value = parseInt($(_self).val());

                // Trigger the change
                $(_self).val(value).trigger('change');

            }, 0);

        });

    };

    // Constructor Wrapper
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName, new Plugin(this, options));
            }
        });
    };

    // Init
    // Removed as this is now managed by the angular directive formRangeSlider
    /*$(window).on('load',function () {
        $(".form-range-slider").each(function (index, element) {
            $(this).rangeSlider();
        });
    });*/

})(jQuery, window, document);
;
/*!
 * Plugin Name
 *
 * Plugin Description
 *
 */

;
(function ($, window, document, undefined) {

    // Defaults
    var pluginName = 'prettyFileStyle', defaults = {

        prettyLabelClass:   '.form-file-label',                                 // The label
        prettyInputClass:   '.form-file-input',                                 // The input
        prettyButtonClass:  'button button-primary form-button-file-upload',    // The class to append to the generated button
        prettyButtonText:   'Browse...',                                        // The button text
        prettyStatusClass:  'form-input',                                       // The class to append to the generated status element
        prettyStatusText:   'No file selected.'                                 // The status text
    };

    // Constructor
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {

        var scope = this;

        // The input container
        scope.prettyFile = $(scope.element);

        // The label and input elements
        scope.prettyLabel = scope.prettyFile.find(scope.options.prettyLabelClass);
        scope.prettyInput = scope.prettyFile.find(scope.options.prettyInputClass);

        // First check if this is IE8 or lower
        try {

            // If this is IE8 < it will fail to change the type attribute on an input
            scope.prettyInput.clone().attr('type', 'text');

        } catch (e) {

            // That failed so call it a day!
            return false;

        }

        // Build and modify
        scope.buildPrettyBits(scope);

    };

    // Build pretty bits
    Plugin.prototype.buildPrettyBits = function (scope) {

        // Add some new classes
        scope.prettyLabel.addClass('pretty-filestyle-label');
        scope.prettyInput.addClass('pretty-filestyle-input');

        // Build some new elements
        scope.prettyWrap = $('<div class="pretty-filestyle-wrap"/>');
        scope.prettyStatus = $('<div class="' + scope.options.prettyStatusClass + ' pretty-filestyle-status">' + scope.options.prettyStatusText + '</div>');
        scope.prettyButton = $('<button class="' + scope.options.prettyButtonClass + ' pretty-filestyle-button" type="button" tabindex="-1">' + scope.options.prettyButtonText + '</button>');

        // Wrap the input and insert the dummy controls
        scope.prettyInput
            .wrap(scope.prettyWrap)
            .after(scope.prettyButton)
            .after(scope.prettyStatus);

        // Set up event listeners
        scope.prettyFileEvents(scope);

    };

    // Set up event listeners
    Plugin.prototype.prettyFileEvents = function(scope) {

        // Start listening
         scope.prettyInput.on('change', function (e) {

             // Get the input value
             var $input = $(this),
                 value = $input.val().split('\\'),
                 val = value[value.length - 1] || scope.options.prettyStatusText;

             scope.prettyStatus.text(val);

         }).trigger('change');

        /*

         $parent = $input.closest('.pretty-filestyle')
         $status = $parent.find('.pretty-filestyle-status');

         $parent.addClass('is-empty');
         $status.text($status.attr('data-originaltext'));

         if (val !== '') {
         $status.text(val);
         $parent.find('.button-upload').show();
         } else {
         $parent.find('input[type=submit]').hide();
         }

         if ($parent.find('img').attr('src') !== '') {
         $parent.removeClass('is-empty');
         //$parent.find('.button-upload').hide();
         $parent.find('.button-save').show();
         }

         }

         */
    };

    // Constructor Wrapper
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName, new Plugin(this, options));
            }
        });
    };

    // Init
    $(window).on('load',function () {
        $('.pretty-filestyle').each(function (index, element) {
            $(this).prettyFileStyle();
        });
    });

})(jQuery, window, document);
;
/*!
 * Number Input Replacer
 *
 * Plugin Description
 * Modifies the behaviour of the standard HTML5 number input
 *
 */

;
(function ($, window, document, undefined) {

    // Defaults'.
    var pluginName = 'prettyNumberStyle', defaults = {

        prettyLabelClass:       '.form-input-label',    // The label
        prettyInputClass:       '.form-input',          // The input
        prettyNumberMin:        0,                      // Min allowed value, can be set by min attribute
        prettyNumberMax:        99,                     // Max allowed value, can be set by max attribute
        prettyNumberStep:       1,                      // Steps for each value update
        prettyNumberDelay:      500,                    // The delay to apply on mousedown + hold
        prettyNumberInterval:   50,                     // The interval to apply on mousedown + hold after delay
        prettyNumberButtons: {
            inc: {
                className: 'button button-primary form-button-number-toggle',
                text: '+'
            },
            dec: {
                className: 'button button-primary form-button-number-toggle',
                text: '-'
            }
        }
    };

    // Constructor
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {

        var scope = this;

        // The Element
        scope.prettyNumber = $(scope.element);

        // The input
        scope.prettyNumberInput = scope.prettyNumber.find(scope.options.prettyInputClass);

        // The label
        scope.prettyNumberLabel = scope.prettyNumber.find(scope.options.prettyLabelClass);

        // Add some classes
        scope.prettyNumberInput.addClass('pretty-numberstyle-input');
        scope.prettyNumberLabel.addClass('pretty-numberstyle-label');

        // Change it to a text input so we don't have to deal with the browser controls, we're taking care of the behaviour
        try {
            
            scope.prettyNumberInput.attr('type', 'text');
            
        } catch (e) {
            
            // IE8 will fail to change the type but that's ok because it doesn't have a default UI to manage...
            
        }

        // Build buttons
        scope.prettyNumberInc = $('<button class="' + scope.options.prettyNumberButtons.inc.className + ' pretty-numberstyle-button inc" type="button">' + scope.options.prettyNumberButtons.inc.text + '</button>').prop('inc', true);
        scope.prettyNumberDec = $('<button class="' + scope.options.prettyNumberButtons.dec.className + ' pretty-numberstyle-button dec" type="button">' + scope.options.prettyNumberButtons.dec.text + '</button>').prop('inc', false);

        // Place the buttons either side of the input
        scope.prettyNumberInput.before(scope.prettyNumberDec);
        scope.prettyNumberInput.after(scope.prettyNumberInc);

        // See if we have min and max defaults
        scope.prettyNumberMin = typeof scope.prettyNumberInput.attr('min') !== 'undefined' ? scope.prettyNumberInput.attr('min') : scope.options.prettyNumberMin;
        scope.prettyNumberMax = typeof scope.prettyNumberInput.attr('max') !== 'undefined' ? scope.prettyNumberInput.attr('max') : scope.options.prettyNumberMax;

        // See if we have a step default
        scope.prettyNumberStep = typeof scope.prettyNumberInput.attr('step') !== 'undefined' ? Number(scope.prettyNumberInput.attr('step')) : Number(scope.options.prettyNumberStep);

        // Listen to toggle events
        scope.toggleEvents(scope);

        // Listen to the input
        scope.inputEvents(scope);

    };

    // Toggle event listeners
    Plugin.prototype.toggleEvents = function (scope, i) {

        // Listen to clicks and mouse down
        scope.prettyNumber.find('.button').on('click mousedown', function (e) {

            // Prevent the default action
            e.preventDefault();

            // Find the direction (-/+)
            var dir = $(this).prop('inc');

            // Get the current value
            var v = scope.prettyNumberInput.val();

            // If this is a click do nothing because it will fire a double update, only update on mouse down
            if (e.type !== 'click') {

                // Set the value once
                scope.setValue(scope, dir, v);

                // Set interval with a delay so we can update repeatedly on mouse hold while mimicking browser behaviour
                var time = scope.options.prettyNumberDelay,
                    interval = function () {

                        // Clear the interval
                        clearInterval(i);

                        // Get the current value
                        var v = scope.prettyNumberInput.val();

                        // Set the value
                        scope.setValue(scope, dir, v);

                        // Adjust the interval after the first run
                        time = time === scope.options.prettyNumberDelay ? scope.options.prettyNumberInterval : time;

                        // Reset the interval with the new time
                        i = setInterval(interval, time);

                    };

                // Set the initial interval
                i = setInterval(interval, time);

            }

            // Listen to mouse up and leave
        }).on('mouseup mouseleave', function () {

            // Clear the interval
            clearInterval(i);

        });

    };

    // Set value
    Plugin.prototype.setValue = function (scope, dir, v) {

        // Make sure we're working with a number and strip leading zero's
        v = parseInt(v, 10);

        // Do the increment/decrement dir === true = up, dir !== true = down
        if (dir) {

            // Increment if < max
            if (v < scope.prettyNumberMax) {
                v += scope.prettyNumberStep;
                v = Math.min(v, scope.prettyNumberMax);
            }

        } else {

            // Decrement if > min
            if (v > scope.prettyNumberMin) {
                v -= scope.prettyNumberStep;
                v = Math.max(v, scope.prettyNumberMin);
            }

        }

        // Make sure we never allow anything but numbers
        if (isNaN(v) || v === '') {

            // Set to min if we have empty value or NaN
            v = scope.prettyNumberMin;

        }

        /*
         * TODO: need to get step rounding working...

         // Round the value according to step
         var rounded = Math.round(v / scope.prettyNumberStep) * scope.prettyNumberStep;

         console.log('val ' + v);
         console.log('rnd ' + rounded);

         */

        // Update the input value
        scope.prettyNumberInput.val(v).trigger('change');

    };

    // Input events
    Plugin.prototype.inputEvents = function (scope, i) {

        // Listen for key down
        scope.prettyNumberInput.on('keydown', function (e) {

            // Get the current value
            var v = parseInt(scope.prettyNumberInput.val());

            // If this is an up or down key we should increment
            scope.keyboardNav(scope, e, v);

            // Listen for click and key up
        }).on('click keyup', function (e) {

            // Get the current value
            var v = scope.prettyNumberInput.val();

            // Enforce numeric input
            if (isNaN(v)) {

                // Not a number so try to extract a number
                v = parseInt(v);

                // If still not a number default to min
                v = isNaN(v) ? scope.prettyNumberMin : v;

                // Update the value if it's not a number
                scope.prettyNumberInput.val(v).trigger('change');

            }

            // Make sure the value is in range
            if (!isNaN(v) && parseInt(v) > scope.prettyNumberMax) {

                // Set to max if it's a number higher than max
                scope.prettyNumberInput.val(scope.prettyNumberMax).trigger('change');

            }

            // Listen for blur
        }).on('blur', function () {

            // Get the current value
            var v = scope.prettyNumberInput.val();

            // Enforce numeric input
            if (v === '') {

                // Update the value if it's not a number
                scope.prettyNumberInput.val(scope.prettyNumberMin).trigger('change');

            }

        });

    };

    // Key up/down...
    Plugin.prototype.keyboardNav = function (scope, e, v, dir) {

        // Get the key code for the current keydown
        var key = (e.keyCode ? e.keyCode : e.which);

        // If it's the up or down key we can set the value
        if (key === 38 || key === 40) {

            // Prevent default action
            e.preventDefault();

            // 38 = up, 40 = down
            dir = key === 38;

            // Set the value
            scope.setValue(scope, dir, v);

        }

    };

    // Constructor Wrapper
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName, new Plugin(this, options));
            }
        });
    };

    // Init
    $(window).on('load',function () {
        $(".pretty-numberstyle").each(function (index, element) {
            $(this).prettyNumberStyle();
        });
    });

})(jQuery, window, document);
;
/*
Version: 2.1.3
Date:2016-11-21
 */
/*
Version: 2.1.3
Date:2016-11-21
 */
/*
Version: 2.1.3
Date:2016-11-09
 */
/*
Version: 1.4.20
Date:2014-11-14
 */
/*!
 * Plugin Name Query Address Service
 *
 */
;
(function ($, window, document, undefined) {

    // Defaults
    var pluginName = 'queryAddressService', defaults = {

        qasMethod:              'GET',          // AJAX request method
        emptyOnFocus:           true,           // Should the input be emptied on focus?
        qasInputParentClass:    'form-field'    // The class name of the elements surrounding inputs

    };

    // Constructor
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {
        var scope = this;

        // The Input
        scope.qasInput = $(scope.element);

        // The input container
        scope.qasContainer = scope.qasInput.closest('.form-qas-container');

        // The output container
        scope.qasOutput = $('<div/>').addClass('form-qas-output');

        // Append the output container
        scope.qasInput.after(scope.qasOutput);

        // The request URI
        scope.qasRequestURI = typeof scope.qasInput.data('requesturi') !== 'undefined' ? scope.qasInput.data('requesturi') : false;
        scope.qasMonikerURI = typeof scope.qasInput.data('monikeruri') !== 'undefined' ? scope.qasInput.data('monikeruri') : false;

        // If the URI does't exist we can stop now... we can't do any more!
        if (!scope.qasRequestURI) return false;

        // Force auto complete off...
        scope.qasInput.attr('autocomplete', 'off');

        // Create the manual entry element
        scope.qasManual = $('<li/>').append($('<a/>').attr('href', '#').text('Enter manually'));

        // Set up our inputs
        scope.qasInputs = {
            unitNumber: $('*[ng-model=' + scope.qasInput.data('unit-number') + ']'),
            streetNumber: $('*[ng-model=' + scope.qasInput.data('street-number') + ']'),
            streetName: $('*[ng-model=' + scope.qasInput.data('street-name') + ']'),
            streetType: $('*[ng-model=' + scope.qasInput.data('street-type') + ']'),
            suburb: $('*[ng-model=' + scope.qasInput.data('suburb') + ']'),
            state: $('*[ng-model=' + scope.qasInput.data('state') + ']'),
            postcode: $('*[ng-model=' + scope.qasInput.data('postcode') + ']')
        };

        // Hide/Show the inputs
        scope.hideShowInputs(scope, false);

        // Build an address lookup link
        scope.addressLookupLink(scope);

        // Input focus event listener
        scope.focusEvent(scope);

        // Input mouse event listener
        scope.mouseEvent(scope);

        // Input change listener
        scope.watchInput(scope);

    };

    // Hide and show the inputs
    Plugin.prototype.hideShowInputs = function(scope, show) {

        // Set up a simple toggle
        function vis($el) {
            show ? $el.show() : $el.hide();
        }

        // Hide/Show our inputs
        vis(scope.qasInputs.unitNumber.closest('.' + scope.options.qasInputParentClass));
        vis(scope.qasInputs.streetNumber.closest('.' + scope.options.qasInputParentClass));
        vis(scope.qasInputs.streetName.closest('.' + scope.options.qasInputParentClass));
        vis(scope.qasInputs.streetType.closest('.' + scope.options.qasInputParentClass));
        vis(scope.qasInputs.suburb.closest('.' + scope.options.qasInputParentClass));
        vis(scope.qasInputs.state.closest('.' + scope.options.qasInputParentClass));
        vis(scope.qasInputs.postcode.closest('.' + scope.options.qasInputParentClass));

    };

    // Update input values
    Plugin.prototype.updateInputVals = function(scope, result) {

        scope.qasInputs.unitNumber.val(result.UnitNumber || '');
        scope.qasInputs.streetNumber.val(result.StreetNumber || '');
        scope.qasInputs.streetName.val(result.StreetName || '');
        scope.qasInputs.streetType.val(result.StreetType || '');
        scope.qasInputs.suburb.val(result.Suburb || '');
        scope.qasInputs.state.val(result.State || '');
        scope.qasInputs.postcode.val(result.Postcode || '');

    };

    // Build a show search link and wire it up
    Plugin.prototype.addressLookupLink = function(scope) {

        // Create a new form field
        scope.qasShowSearchField = $('<div class="' + scope.options.qasInputParentClass + '"/>');

        // Create the link
        scope.qasShowSearch = $('<a href="#">Lookup Address</a>');

        // Append the link to the field
        scope.qasShowSearchField.append(scope.qasShowSearch);

        // Hide the link
        scope.qasShowSearchField.hide();

        // Wire it up
        scope.qasShowSearch.on('click', function(e) {

            // show the container
            scope.qasContainer.show();

            // Hide this
            scope.qasShowSearchField.hide();

            // Deactivate input
            scope.qasInput.removeClass('is-activated');

            // Update the values
            scope.updateInputVals(scope, []);

            // Hide inputs
            scope.hideShowInputs(scope, false);

        });

        // Insert the link
        scope.qasContainer.before(scope.qasShowSearchField);

    };

    // Input focus event listener
    Plugin.prototype.focusEvent = function (scope) {

        scope.qasInput.on('focus', function (e) {

            // Should we empty the field on focus
            !scope.options.emptyOnFocus || $(this).val('');

            $(this).trigger('keyup');

        }).on('blur', function(e) {

            // This kills everything!!!

            //setTimeout(function(){

                //scope.qasInput.val('').trigger('keyup');

            //},100);

        });

    };

    // Input mouse event listener
    Plugin.prototype.mouseEvent = function (scope) {

        scope.qasContainer.on('mouseover', function (e) {

            // Mouse in use
            $(this).removeClass('is-keyboard');

        })
            .on('mouseout', function (e) {

                // Mouse not in use
                scope.qasContainer.find('.is-active').removeClass('is-active');
                $(this).addClass('is-keyboard');

            });

    };

    // Input keyboard event listeners
    Plugin.prototype.watchInput = function (scope) {

        // By default treat the key as any
        scope.isNav = false;

        // On keydown check to see if this is a navigation key (up/down)
        scope.qasInput.on('keydown', function (event) {

            // Check keys
            scope.keyboardNav(scope, event);

        })

            // On keyup we need to request or data and update the input and list
            .on('keyup', function (event) {

                if (scope.isNav !== true) {

                    // The current term
                    var term = $(this).val();

                    // Store the initial value before we update the input...
                    scope.initialValue = term;

                    // Do the request
                    if (term && term != '') {
                        $.ajax({
                            type: scope.options.qasMethod,
                            dataType: 'json',
                            contentType: 'application/json;charset=UTF-8',
                            url: scope.qasRequestURI,
                            data: JSON.stringify({ address: term }),
                            success: function (data) {

                                // Parse the result
                                var result = JSON.parse(data);

                                // Create the output list
                                scope.qasList = $('<ul/>');

                                // Create the result items
                                $.each(result.data, function (index, value) {

                                    // Create item
                                    var $item = $('<li/>');

                                    // Attach event listeners to the item
                                    $item.data('moniker', value.moniker).text(value.text).on('click', function (e) {

                                        scope.qasInput.val(value.text);
                                        scope.qasOutput.empty();

                                        scope.getFormattedAddress(scope, value.moniker);

                                    });

                                    // Append the item to the list
                                    scope.qasList.append($item);

                                    // Add mouse listener to the item
                                    $item.on('mouseover', function (e) {

                                        // Mouse in use
                                        scope.qasContainer.find('.is-active').removeClass('is-active');
                                        $(this).addClass('is-active');

                                    });

                                });

                                // Apply activated class to input
                                scope.qasInput.addClass('is-activated');

                                // Append the manual entry item
                                scope.qasList.append(scope.qasManual);

                                // Listen to clicks on the Manual entry link
                                scope.qasManual.on('click', function (e) {

                                    // No going back from here
                                    scope.qasContainer.hide();

                                    // Show the address lookup link
                                    scope.qasShowSearchField.show();

                                    // Empty the output
                                    scope.qasOutput.empty();

                                    // Deactivate input
                                    scope.qasInput.removeClass('is-activated');

                                    // Show the inputs
                                    scope.hideShowInputs(scope, true);

                                });

                                // Empty the output and re-append the new data
                                scope.qasOutput.empty().append(scope.qasList);

                            }
                        });

                    } else {

                        // Remove activated class from the input
                        scope.qasInput.removeClass('is-activated');

                        // Empty the output
                        scope.qasOutput.empty();
                    }
                }
            });

    };

    // Get formatted address
    Plugin.prototype.getFormattedAddress = function (scope, value) {

        // Do the request
        $.ajax({
            type: scope.options.qasMethod,
            dataType: 'json',
            contentType: 'application/json;charset=UTF-8',
            url: scope.qasMonikerURI,
            data: JSON.stringify({ moniker: value }),
            success: function (data) {

                // Parse the data
                var result = JSON.parse(data);

                if (result) {

                    // Populate the inputs
                    scope.updateInputVals(scope, result);

                    // Remove the search input, no going back from here!
                    scope.qasContainer.hide();

                    // Show the address lookup link
                    scope.qasShowSearchField.show();

                    // Show the inputs
                    scope.hideShowInputs(scope, true);
                }
            }
        });

    };

    // key up/down...
    Plugin.prototype.keyboardNav = function (scope, e) {

        var key = (e.keyCode ? e.keyCode : e.which);

        scope.isNav = false;

        if (key === 38 || key === 40) {

            scope.qasContainer.addClass('is-keyboard');

            // down
            if (key === 40) {
                scope.nextItem(scope);
            }

            // up
            if (key === 38) {
                scope.prevItem(scope);
            }

            // set isNav true...
            scope.isNav = true;

        }

        // enter/return should trigger the same action as a click (mousedown)
        if (key === 13) {

            // Trigger the mousedown event on the selected item
            scope.qasOutput.find('.is-active').trigger('click');

        }
    };

    // move down...
    Plugin.prototype.nextItem = function (scope, first) {

        var $active = scope.qasContainer.find('.is-active');

        if (!$active.length) {
            scope.currentItem = scope.qasList.find('li:first-child');
        } else {
            scope.currentItem = $active.next().length ? $active.next() : scope.qasList.find('li:first-child');
        }

        $active.removeClass('is-active');
        $(scope.currentItem).addClass('is-active');
        scope.updateValue(scope, false);
    };

    // move up...
    Plugin.prototype.prevItem = function (scope) {

        var $active = scope.qasContainer.find('.is-active'),
            reset = false;

        if (!$active.prev().length) {
            reset = true;
            scope.currentItem = undefined;
        } else {
            scope.currentItem = $active.prev();
        }

        if (typeof scope.currentItem !== 'undefined') {
            $active.removeClass('is-active');
            $(scope.currentItem).addClass('is-active');
        }

        // update the value...
        scope.updateValue(scope, reset);

    };

    // update value
    Plugin.prototype.updateValue = function (scope, reset) {
        if (reset === true) {
            // restore the initial value...
            $(scope.input).val(scope.initialValue);
        } else {
            // update the value...
            $(scope.input).val($(scope.currentItem).text());
        }
    };

    // Constructor Wrapper
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName, new Plugin(this, options));
            }
        });
    };

    // Init
    //$(window).load(function () {
    //    $(".form-qas-input").each(function (index, element) {
    //        $(this).queryAddressService();
    //    });
    //});

})(jQuery, window, document);
;
/*
Version: 2.1.3
Date:2016-11-21
 */
/*
Version: 2.1.3
Date:2016-11-21
 */
/*
Version: 2.1.3
Date:2016-11-09
 */
/*
Version: 1.4.4
Date:2014-10-23
 */
/*!
 * Number Input Replacer
 *
 * Plugin Description
 * Modifies the behaviour of the standard HTML5 number input
 *
 */

;
(function ($, window, document, undefined) {

    // Defaults
    var pluginName = 'counter_toggle', defaults = {

    };

    // Constructor
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {
        var scope = this;

        scope.doSomething(scope);
    };

    // Do Something...
    Plugin.prototype.doSomething = function (scope) {

    };

    // Constructor Wrapper
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName, new Plugin(this, options));
            }
        });
    };

    // Init
    $(window).on('load', function () {
        $(".form-input-counter-toggle").each(function (index, element) {
            $(this).counter_toggle();
        });
    });

})(jQuery, window, document);
;
/*!
 * jTabs v1.0.2 (v1.3.14 - Tabs Update).
 */

;
(function ($, window, document, undefined) {

	// Defaults
	var pluginName = 'tabsMenuSimplified', defaults = {
		tabMain: '.jtabs',                  // Main Tabs Element $(this)
		tabInpt: '.jtabs-is-active-id',     // Hidden input used for sending current tab id to the server on post
		tabMenu: '.jtab-menu',              // Mobile Menu
		tabList: '.jtab-list',              // Desktop Content
		tabItem: '.jtab-menu-item',         // Mobile Menu Tab Element
		tabTabs: '.jtab-menu-link',         // Tab Link Container
		tabLink: '.jtab-menu-link-anchor',  // Tab Anchor (<a href="">)
		tabScrl: '.pl11-tabs',              // Nested tab set types that require scrollTop adjustments
		tabCtnr: '.tab-content-container',  // The tab container (the element that has the tab ID)
		desktopBreakpoint: 897              // Breakpoint for desktop screen (same as the CSS @media query)
	};

	// Constructor
	function Plugin(element, options) {

		this.element = element;
		this.options = $.extend({}, defaults, options);
		this._defaults = defaults;
		this._name = pluginName;
		this.init();

	}

	// Initialize...
	Plugin.prototype.init = function () {

		var scope = this;

		// Make the tabs element a little easier to reference
		scope.tabs = $(scope.element);

		// Is this set of tabs nested?
		scope.tabs.is_nested = scope.tabs.parents(scope.options.tabMain).length ? true : false;

		// Check if this tab set should update the scrollTop when nested
		scope.tabs.is_scrollto = !scope.tabs.is_nested || scope.tabs.is(scope.options.tabScrl);

		// Get the hidden input element used to sent current tab id to the server
		scope.tabs.input = scope.tabs.find(scope.options.tabInpt).filter(function () {
			return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
		});

		// Get the mobile tab menu element, filter by depth
		scope.tabs.menu = scope.tabs.find(scope.options.tabMenu).filter(function () {
			return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
		});

		// Get the main tab list (content) element, filter by depth
		scope.tabs.list = scope.tabs.find(scope.options.tabList).filter(function () {
			return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
		});

		// Get the tab links, filter by depth
		scope.tabs.links = scope.tabs.find(scope.options.tabLink).filter(function () {
			return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
		});

		// Check to se if we've manually set the is-active state
		scope.tabs.active = scope.tabs.find('.is-active').filter(function () {
			return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
		}).find(scope.options.tabLink).attr('href');

		// Set up tab click event
		scope.tabMenuEvents(scope);

		// Activate the first tab
		scope.initActiveTab(scope);

		//Restore position of page if a form submit button has been hit and .NET initiates function
		if (typeof WebForm_RestoreScrollPosition !== 'undefined'){
			WebForm_RestoreScrollPosition();
		}


	};

	// Initialize the active tab
	Plugin.prototype.initActiveTab = function (scope) {

		// If there is a target_id Check if it has a match
		var target_id = scope.checkLocationHash(scope);

		// Get the hash of the is-active tab
		target_id = target_id || scope.tabs.active;

		// If there is no hash match set target_id to the first tab in scope unless this is jtabs-pages
		if (!$(scope.element).is('.jtabs-pages')) {
			if (scope.tabs.is_hash_match === false && !scope.tabs.active) {
				target_id = scope.tabs.links.first().attr('href');
			}
		}

		// If there is no target set target_id to the first tab in scope
		target_id = target_id || scope.tabs.links.first().attr('href');

		// Collect toggles and targets
		var collection = scope.collectToggles(scope, target_id);

		// Toggle the active state
		scope.toggleActiveTab(scope, collection.toggles, collection.target);

	};

	// Check the location hash for an existing tab ID
	Plugin.prototype.checkLocationHash = function (scope) {

		// Check if the window contains a hash
		var target_id = window.location.hash;

		// Check if we are linking to an anchor within a tab
		target_id = scope.findAnchors(scope, target_id) || target_id;

		// Check if there is a matching anchor with the same hash
		scope.findMatches(scope, target_id);

		// On load we should avoid scrolling if we have a hash
		// BUG - PL11 - Left Hand tabs
		// http://jira.dt.com.au/browse/TMBSC-487
		// if (scope.tabs.is_desktop) {
		//
		//     // Force no scroll
		//     !scope.tabs.is_hash_match || $(window).scrollTop(0);
		//
		// }

		// Return the target_id
		return target_id;

	};

	// Find anchors within tabs
	Plugin.prototype.findAnchors = function(scope, target_id) {

		// Sanitize the target_id
		var tid = target_id.replace('#', '');

		// If there is a hash
		if ( tid !== '' ) {

			// Get any elements with either a name or id matching the target_id
			scope.tabs.anchors = scope.tabs.find('*[id="' + tid + '"], *[name="' + tid + '"]').filter(function () {

				// As long as they are not part of the tabs interface
				return !$(this).is(scope.options.tabCtnr);

			});

			// Then look for the tab in which the element was found so we can activate it
			target_id = '#' + $(scope.tabs.anchors[0]).closest(scope.options.tabCtnr).attr('id');

			// Return the Hash
			return target_id;

		}

		// Or return nothing
		return false;

	};

	// Find toggles that match the hash
	Plugin.prototype.findMatches = function (scope, target_id) {

		// Collect links with a href that matches the current hash
		var $matches = scope.tabs.find(scope.options.tabLink + '[href="' + target_id + '"]');

		// Define a is_hash_match global that we can access later
		scope.tabs.is_hash_match = $matches.length ? true : false;

	};

	// Set up tab menu events
	Plugin.prototype.tabMenuEvents = function (scope) {

		// Window resize
		$(window).on('resize', function () {

			// Update is_desktop global
			scope.tabs.is_desktop = scope.isDesktop(scope);

			// Handle hash change
			scope.desktopHashChangeHandler(scope);

		}).trigger('resize');

		// Listen to click on all tab links
		scope.tabs.links.on('click', function (event) {

			// handle page tabs which send a url and an id
			// href="product-family-new-menu1/#menu-item-1"
			if ($(scope.element).is('.jtabs-pages')) {
				console.log('go');
				window.location.href = $(this).attr('href');
			}

			var menuTop = ($('.jtab-menu').offset().top)-($(window).scrollTop()); //get the offset top of the element

			//Get the current vertical  position on the page
			var currentPosition = $(document).scrollTop();

			// Get the target ID
			var target_id = $(this).attr('href');

			var animationTime = 300;

			// If we've activated a nested tab we don't want to update the hash
			if (scope.tabs.is_nested) {
				// Prevent default action
				event.preventDefault();

				// Update the is-active states
				scope.refreshToggles(scope, target_id);

				// Update Scroll Top if we're not on desktop
				scope.tabs.is_desktop || (!scope.tabs.is_scrollto || $(window).scrollTop($(this).offset().top));
			} else {

				if (target_id.indexOf("#") == -1) {
					var $isActive = $(this).closest('.menu-item.is-active');
					var $isDeactive = $(this).closest('.menu-item.is-deactive');
					if ($isActive.length) {
						// deactive
						if (!scope.tabs.is_desktop) {
							$isActive.removeClass("is-active");
							$isActive.addClass("is-deactive");
						}
						event.preventDefault();
					}
					if ($isDeactive.length) {
						// deactive
						if (!scope.tabs.is_desktop) {
							$isDeactive.addClass("is-active");
							$isDeactive.removeClass("is-deactive");
						}
						event.preventDefault();
					}
					return;
				}

				// If we're on desktop and we're not nested, we want to update the location.hash without scrolling
				if (scope.tabs.is_desktop) {

					// Get the window top
					// BUG - PL11 - Left Hand tabs
					// http://jira.dt.com.au/browse/TMBSC-487
					//var top = $(window).scrollTop();
					var top = scope.tabs.offset().top;

					// handle page tabs which send a url and an id
					// href="product-family-new-menu1/#menu-item-1"
					if (target_id.charAt(0) === "#") {

						// Update the window.location.hash
						window.location.hash = target_id.replace('#', '');

						event.preventDefault();
					}

					// What happens now is a bit of a back and forth in that
					// Page goes to anchor tag then immediately goes back to original
					//position on the page, then over animationTime amount of miliseconds
					//scrolls back to element positon including offset height
					if(menuTop > 1) {

						$(window).scrollTop(currentPosition);

						setTimeout(function () {
							$('html,body').animate({
								scrollTop: top
							}, animationTime);
						}, 10);
					}
					else {

						$(window).scrollTop(top);
					}


				} else {

					// handle page tabs which send a url and an id
					// href="product-family-new-menu1/#menu-item-1"
					if (target_id.charAt(0) === "#") {

						// Update the window.location.hash
						window.location.hash = target_id.replace('#', '');

						event.preventDefault();
					}

					setTimeout(function(){
						$('html, body').animate({
							scrollTop: $("#" + target_id.split("#")[1]).offset().top
						}, 500);
					},10);

					// Update the is-active states
					scope.refreshToggles(scope, target_id);

				}

			}

		});

	};

	// Viewport Dimensions for CSS breakpoint Sync
	Plugin.prototype.viewport = function () {

		// http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript

		var e = window,
			a = 'inner';

		if (!('innerWidth' in window )) {

			a = 'client';
			e = document.documentElement || document.body;

		}

		// Return the viewport width that matches CSS @media queries
		return { width: e[ a + 'Width' ], height: e[ a + 'Height' ] };

	};

	// Check for desktop
	Plugin.prototype.isDesktop = function (scope) {

		// Return true/false based on screen width
		return (scope.viewport().width >= scope.options.desktopBreakpoint);

	};

	// Manual hash change handler for desktop only
	Plugin.prototype.desktopHashChangeHandler = function (scope) {

		// Handle the change
		$(window).on('hashchange', function (e) {

			// If we've clicked on an anchor we need to update the target tab, otherwise just send the hash
			var target_id = scope.findAnchors(scope, window.location.hash) || window.location.hash;

			// Update the is-active states on desktop, do nothing for mobile
			!scope.tabs.is_desktop || scope.refreshToggles(scope, target_id);

		});

	};

	// Refresh toggle states
	Plugin.prototype.refreshToggles = function (scope, target_id) {

		// Check if there is a matching anchor with the same hash
		scope.findMatches(scope, target_id);

		// Collect toggles and targets
		var collection = scope.collectToggles(scope, target_id);

		// page tabs
		if (target_id.charAt(0) === "#") {
			// Toggle the active state
			scope.toggleActiveTab(scope, collection.toggles, collection.target);
		}else{
			// Toggle the active state
			scope.toggleActivePageTab(scope, collection.toggles, collection.target);
		}

	};

	// Build a collection of associated toggles and their target element
	Plugin.prototype.collectToggles = function (scope, target_id) {

		// Get the target element
		var $target = $("#" + target_id.split("#")[1]);

		// Bind the tab menu link to the tab list link
		var $toggles = scope.tabs.find(scope.options.tabLink + '[href="' + target_id + '"]');

		// Return our collection object
		return {
			"toggles": $toggles,
			"target": $target
		}

	};

	// Toggle active state
	Plugin.prototype.toggleActiveTab = function (scope, $toggles, $target) {

		// Remove active states, filter by depth
		!scope.tabs.is_hash_match || scope.tabs.find('.jtab-menu-item.is-active').filter(function () {
			return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
		}).removeClass('is-active');

		// Apply is active state to the required elements
		$toggles.closest(scope.options.tabItem).addClass('is-active');

		// If the current tab is clicked
		if ($target.attr('id') === scope.tabs.input.val()) {

			// And we're in the mobile device layout
			if (!scope.tabs.is_desktop) {

				// Deactivate the tab
				scope.tabs.find('.jtab-menu-item.is-active').filter(function () {
					return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
				}).removeClass('is-active');

				// Update the hidden input used to send the current tab id to the server on post
				scope.tabs.input.val('');
			}

		} else {

			// Update the hidden input used to send the current tab id to the server on post
			scope.tabs.input.val($target.attr('id'));

		}

		// Get the current target
		var $innerTarget = $('*:target');

		// If it's not a tab
		if (typeof $innerTarget.offset() !== 'undefined' && !$innerTarget.is(scope.options.tabCtnr)) {

			// Scroll to it
			$(window).scrollTop($innerTarget.offset().top);
			setTimeout(function(){
				$(window).scrollTop($innerTarget.offset().top);
			}, 1);

		}

		// if pages tab navigation and on mobile the scroll to tab
		if (scope.tabs.hasClass("jtabs-pages")) {
			setTimeout(function(){
				$innerTarget = $('*:target');
				if ($innerTarget.length && scope.tabs.find(".pl11-tabs-nav").is(':hidden')){
		            $(window).scrollTop($innerTarget.offset().top);
		            $innerTarget.parents(".jtab-menu-item").addClass("is-active");
		        }

		        // if page tabs and we have the pl14 list with icon module (pl14-list-with-icons) previous then we activate the list item that matches the url path
		        // there are 2 matching scenarios, 1 will be an actual page match and another will be a parent match
		        var pl14ModulesPrevious = scope.tabs.prevAll(".pl14-list-with-icons");
	        	if (pl14ModulesPrevious.length) {
	        		var origin = window.location.origin,
	        			pathname = window.location.pathname,
		        		$el,
		        		href,
		        		wholeUrlMatch = false;
		        	// check if matching with whole url
	        		$(pl14ModulesPrevious[0]).find("a").each(function(i, v) {
		        		$el = $(v);
		        		href = $(v).attr("href");
		        		// normalise (strip origin http://www.tmbank.com.au)
						href = href.replace(origin, "");
		        		if (href !== "" && href === pathname) {
		        			$el.addClass("is-active");
		        			wholeUrlMatch = true;
		        		}
		        	});
		        	// check if matching with parent url
		        	if (!wholeUrlMatch) {
		        		$(pl14ModulesPrevious[0]).find("a").each(function(i, v) {
			        		$el = $(v);
			        		href = $(v).attr("href");
			        		// normalise (strip origin http://www.tmbank.com.au)
							href = href.replace(origin, "");
			        		var currentSection = href.substr(0, href.lastIndexOf("/"));
			        		var currentLocationSection = pathname.substr(0, pathname.lastIndexOf("/"));
			        		if (currentSection !== ""  && currentSection === currentLocationSection) {
			        			$el.addClass("is-active");
			        		}
			        	});
		        	}
	        	}
			}, 1);
		}

	};

	// Toggle active state for page tabs
	Plugin.prototype.toggleActivePageTab = function (scope, $toggles, $target) {

		// If the current tab is clicked
		if ($target.attr('id') === scope.tabs.input.val()) {

			$toggles.closest(scope.options.tabItem).toggleClass('is-active');

		}else{
			return;
		}

		//$toggles.closest(scope.options.tabItem).addClass('is-active');
	  
		// Get the current target
		var $innerTarget = $('*:target');

		// If it's not a tab
		if (typeof $innerTarget.offset() !== 'undefined' && !$innerTarget.is(scope.options.tabCtnr)) {

			// Scroll to it
			$(window).scrollTop($innerTarget.offset().top);
			setTimeout(function(){
				$(window).scrollTop($innerTarget.offset().top);
			}, 1);

		}

	};

	// Constructor Wrapper
	$.fn[pluginName] = function (options) {

		return this.each(function () {
			if (!$.data(this, 'plugin_' + pluginName)) {
				$.data(this, 'plugin_' + pluginName, new Plugin(this, options));
			}
		});

	};

	// Init
	$(window).on('load', function () {

		// Only initialize for the pl11 & pl03 module based tabs
		$(".jtabs").each(function (index, element) {
			$(this).tabsMenuSimplified();
		});

	});

})(jQuery, window, document);
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Help Centre View More Jquery Plugin
 *
 * Manages hiding more that the set number of questions on mobile and showing them
 * Also expand and collapse on mobile
 */

;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'helpCentreViewMore',
        defaults = {
            sel_question_items : "li", // question item
            sel_mobile_count: "help-centre-mobile-count",
            sel_add_class_to_more: "help-centre-add-class",
            sel_view_more: ".help-centre-view-more-link",
            sel_mobile_expand: ".help-centre-expand",
            sel_show_content_on_desktop: "help-centre-show-content-on-desktop",
            sel_allow_expanding: "help-centre-allow-expanding",
            collapsedClass: "is-collapsed-mobile"
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = element;
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;
        // Reference the element once only
		scope.options.element = $(scope.element);

        var $el = $(scope.options.element);
        scope.addClassToMore = $el.data(scope.options.sel_add_class_to_more) || "hide";
		scope.popularMobileCount = $el.data(scope.options.sel_mobile_count) || 5;
		scope.allowExpanding = $el.data(scope.options.sel_allow_expanding) || false;

        // all questions
		scope.questions = $el.find(scope.options.sel_question_items);

        // if more questions than counter ("data-help-centre-mobile-count") then hide those
        if (scope.questions.length > scope.popularMobileCount) {
        	this.initQuestionsViewPopular(scope);
        }

        //init events
        scope.setupEvents(scope);

    };

    Plugin.prototype.initQuestionsViewPopular = function (scope) {
    	var $el = $(scope.options.element);
    	$.each(scope.questions, function(i, v){
    		if (i >= scope.popularMobileCount) {
    			$(v).addClass(scope.addClassToMore);
    		}
    	});
    }

    Plugin.prototype.setupEvents = function (scope) {
    	var $el = $(scope.options.element);

    	if (scope.allowExpanding) {
    		//view more (expand other items)
    		var $viewMore = $el.find(scope.options.sel_view_more);
    		$viewMore.on("click", function(){
    			$(this).removeClass("show-for-small-only").hide();
    			scope.questions.removeClass(scope.addClassToMore);
    		});
    	}


    	// expand mobile
    	var showOnDesktop = $el.hasClass(scope.options.sel_show_content_on_desktop);
    	var $expandLink = $el.find(scope.options.sel_mobile_expand);
    	$expandLink.on("click", function(e){
    		if ($(window).width() < 689 || !showOnDesktop) {
    			if ($el.hasClass(scope.options.collapsedClass)) {
	    			$el.removeClass(scope.options.collapsedClass);
	    		}else{
	    			$el.addClass(scope.options.collapsedClass);
	    		}
	    		e.preventDefault();
	    		e.stopPropagation();
    		}
    	});
    }


    /*****************************/

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).ready(function() {
        //init on page automatically
        $(".help-centre-view-more").helpCentreViewMore();
    });


})( jQuery, window, document );
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 *
 *
 * Dependencies:
 * jquery.autocomplete.min.js - https://github.com/devbridge/jQuery-Autocomplete
 *
 */

;(function ($, window, document, undefined) {
    var pluginName = 'fieldAutocomplete', defaults = {

    autocompleteOptions:   {
        serviceUrl: false,
        maxHeight: 300,
        noSuggestionNotice: "No results"
    }
    };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {

        var scope = this;

        // The input element
        scope.autocompleteInput = $(scope.element);

        // Save request Uri
        scope.requestUri = scope.autocompleteInput.attr('data-request-uri') || false;
        scope.options.autocompleteOptions.serviceUrl = scope.requestUri;

        // Save no suggestions text
        scope.options.autocompleteOptions.noSuggestionNotice = scope.autocompleteInput.attr('data-noresults-text') || scope.options.autocompleteOptions.noSuggestionNotice;

        // Setup onSelect action
        scope.options.autocompleteOptions.onSelect = function (suggestion) {
            scope.autocompleteInput.val(suggestion.value).trigger('input');
        };

        // Initialize jquery.autocomplete.min.js with options
        scope.autocompleteInput.autocomplete(scope.options.autocompleteOptions);

    };



    // Constructor Wrapper
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    // Init
    // Removed - Initialised with Angular
    // $(window).on('load',function() {
    //     $(".form-field-autocomplete > .form-input").each(function (index, element) {
    //         $(this).fieldAutocomplete();
    //     });
    // });

})(jQuery, window, document);;
/*!
 * Table Sticky Bits (header/left column)
 */

;
(function ($, window, document, undefined) {

    // Defaults
    var pluginName = 'tableStickyBits', defaults = {
        tableStickyHeader: true,
        tableStickyColumn: true,
        tableStickyScrollX: false, // TODO: build a better scrollbar for this...
        tableMinColumns: 3
    };

    // Constructor
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {
        var scope = this;
        if ($(scope.element).find('thead').length > 0 && $(scope.element).find('th').length > 0) {
            scope.setUpStickyBits(scope);
        }
    };

    // Set up the Sticky Bits
    Plugin.prototype.setUpStickyBits = function (scope) {
        scope.options.table = $(scope.element);
        scope.options.header = scope.options.table.find('thead').clone();
        scope.options.column = scope.options.table.find('thead, tbody').clone();
        scope.options.container = scope.options.table.closest('.table-sticky-bits-container');

        // Get the top left cell, we'll need its dimensions later
        scope.options.topLeft = scope.options.table.find('tr:eq(0) th:eq(0)');

        // Not yet ready to build header and column
        scope.options.headerReady = false;
        scope.options.columnReady = false;

        // Set up Header and Column components if required
        !scope.options.tableStickyColumn || scope.setUpColumn(scope);
        !scope.options.tableStickyHeader || scope.setUpHeader(scope);

        scope.buildStickyBits(scope);
    };

    // Set up Header
    Plugin.prototype.setUpHeader = function (scope) {

        // Build Header Clone & Wrapper
        scope.options.stH = $('<table class="table-sticky-bits-header" />');
        scope.options.stHw = $('<div class="table-sticky-bits-header-wrapper" />');

        scope.options.headerReady = true;
    };

    // Set up Column
    Plugin.prototype.setUpColumn = function (scope) {

        // Build Column Clone & Wrapper
        scope.options.stC = $('<table class="table-sticky-bits-column" />');
        scope.options.stCw = $('<div class="table-sticky-bits-column-wrapper" />');

        // Build Intersect Element & Wrapper
        scope.options.stI = $('<table class="table-sticky-bits-intersect" />');
        scope.options.stI.append(scope.options.intersect);
        scope.options.stIw = $('<div class="table-sticky-bits-intersect-wrapper" />');

        scope.options.columnReady = true;
    };

    // Build Sticky Bits
    Plugin.prototype.buildStickyBits = function (scope) {

        // Wrap the table
        scope.options.table.wrap('<div class="table-sticky-bits-wrapper" />');
        scope.options.stW = scope.options.table.parent('.table-sticky-bits-wrapper');

        !scope.options.columnReady || scope.buildColumn(scope);
        !scope.options.headerReady || scope.buildHeader(scope);


        // Place the Sticky Column & Intersect after the Sticky Table Wrapper
        if (scope.options.columnReady === true) {
            // order is important here
            scope.options.container.append(scope.options.stIw);
            scope.options.container.append(scope.options.stCw);
        }

        // Place the Sticky Table Header after the Sticky Table Wrapper
        if (scope.options.headerReady === true) {
            // order is important here
            scope.options.container.append(scope.options.stHw);
        }

        // Set up Scrollbar X if required
        if (scope.options.tableStickyScrollX && scope.options.columnReady) {
            scope.setUpScrollbar(scope);
        }

        // Init apply buttons
        scope.applyButton(scope);

        // Start watching events
        scope.stickyEvents(scope);

    };

    // Init apply buttons
    Plugin.prototype.applyButton = function(scope) {

        // Some seriously funky binding needed here due to the cloned header
        scope.options.header.find(".pl57-apply").each( function(el) {
            var $button_apply = $(this).find('.button-apply');
            var id = '#' + $button_apply.attr('id');

            $button_apply.on('click', function(e) {
                e.preventDefault();
                $(id).trigger('click');
            });

        }).applyButton();

    };

    Plugin.prototype.stickyEvents = function(scope) {

        // Remove selected columns
        $('.table-sticky-bits-remove-column').on('click', function(event) {
            event.preventDefault();
            scope.removeColumn(scope, event);
        });

        // Toggle sections
        $('.table-sticky-bits-toggle-rows').find('th:eq(0)').on('click', function(event) {
            event.preventDefault();
            scope.toggleSection(scope, event)
        });

        // Watch Scrolling on the table wrapper
        //if (scope.options.tableStickyScrollX === true) {
            scope.options.table.parent('.table-sticky-bits-wrapper').scroll(function () {
                !scope.options.headerReady || scope.repositionStickyHeader(scope);
                !scope.options.columnReady || scope.repositionStickyColumn(scope);
            });
        //}

        // Watch the window
        $(window).resize(function () {
            scope.adjustDimensions(scope);
            !scope.options.headerReady || scope.repositionStickyHeader(scope);
            !scope.options.columnReady || scope.repositionStickyColumn(scope);
        })
        .scroll(function () {
            !scope.options.headerReady || scope.repositionStickyHeader(scope);
            !scope.options.columnReady || scope.repositionStickyColumn(scope);
        })
        .trigger('resize');

        // Set widths
        //scope.adjustDimensions(scope);

    };

    // Build Header
    Plugin.prototype.buildHeader = function(scope) {

        // Append the Cloned Header to it's table and append the table to it's Wrapper
        scope.options.stHw.append(scope.options.stH.append(scope.options.header));

    };

    // Build Column
    Plugin.prototype.buildColumn = function(scope) {
        // Append the Column wrapper to the table Wrapper
        scope.options.stC.append(scope.options.column)
            .find('thead th:gt(0)').css({visibility: 'hidden'})
            .end()
            .find('tbody td').css({visibility: 'hidden'});

        // Append the Cloned Column to it's Wrapper
        scope.options.stCw.append(scope.options.stC);

        // Append the Intersecting Cell (top left corner cell) to the Sticky Column
        //scope.options.stIw.append(scope.options.stI);
        scope.options.stIw.append(scope.options.stI.html('<thead><tr><th>' + scope.options.topLeft.html() + '</th></tr></thead>'));

    };

    // Set up Scrollbar
    Plugin.prototype.setUpScrollbar = function(scope) {
        // If we need scrollbars we should custom build a sticky footer scroll solution with a div and scroller

        /*
        // This has been removed.
        // at the moment we're using perfect scrollbar...
        scope.options.stW.perfectScrollbar({
            suppressScrollY: true
        });
        */
    };

    // Reposition Header
    Plugin.prototype.repositionStickyHeader = function(scope) {

        var winBot = $(window).scrollTop() + $(window).height(),
            header = scope.options.stH.outerHeight() + 10,
            tabTop = scope.options.table.offset().top + header,
            tabBot = tabTop + (scope.options.table.outerHeight() - header);


        // move to scroll bar function
        if (tabBot > winBot && tabTop < winBot) {
            $('.table-sticky-bits-wrapper').addClass('is-scrollbar-fixed');
        } else {
            $('.table-sticky-bits-wrapper').removeClass('is-scrollbar-fixed');
        }

        var lOffset = scope.options.table.position().left;

        if ($(window).scrollTop() > scope.options.table.offset().top && $(window).scrollTop() < ( tabBot - header*2 )) {

            scope.options.container.addClass('is-header-fixed').removeClass('is-header-abs');

            scope.options.stH.css({
                left: lOffset
            });

        } else {

            if ($(window).scrollTop() < tabBot) {

                scope.options.container.addClass('is-header-abs').removeClass('is-header-fixed');

                // if the table fits inside the window we don't need to position the header
                if (scope.options.table.outerHeight() < winBot && $(window).scrollTop() < tabTop ) {
                    scope.options.container.removeClass('is-header-abs');
                }

                scope.options.stH.css({
                    left: (scope.options.container.width() < scope.options.table.outerWidth()) ? lOffset : 'auto'
                });

                scope.options.stHw.css({
                    bottom: header + 14
                });

                scope.options.stI.css({
                    bottom: header + 14 + 10
                });

            } else {

                scope.options.container.removeClass('is-header-fixed is-header-abs');

            }
        }
    };

    // Reposition Column
    Plugin.prototype.repositionStickyColumn = function(scope) {
        if (scope.options.container.width() < scope.options.table.outerWidth()) {
            scope.options.container.addClass('is-column-fixed');
        } else {
            scope.options.container.removeClass('is-column-fixed');
        }
    };

    // Adjust Dimensions
    Plugin.prototype.adjustDimensions = function(scope) {

        // Set the width's and heights of the cells, this is fine if we weren't responsive
        // FIXME: but it doesn't work as intended on a responsive page!
        scope.options.table.find('thead th')
            .each(function (i) {
                scope.options.stH.find('th').eq(i).width($(this).width());
            })
            .end()
            .find('tr').each(function (i) {
                // scope.options.stC.find('tr').eq(i).height($(this).height());
                // scope.options.stI.find('tr').eq(i).height($(this).height());
            });

        // Set height of Sticky Header Wrapper
        scope.options.stHw.css({
            height: scope.options.header.height() + 10,
            width: scope.options.container.width(),
            left: scope.options.container.offset().left
        });

        // Set width of sticky table head
        // scope.options.stH.width(scope.options.table.width());

        // Set width of sticky table col
        scope.options.stCw.width(scope.options.topLeft.outerWidth());

        // set the intersect height
        scope.options.stI.css({
                height: scope.options.header.height(),
                width: scope.options.topLeft.outerWidth() + 5,
                left: scope.options.container.offset().left
            })
            .find('th:eq(0)')
            .css({
                height: scope.options.header.height(),
                width: scope.options.topLeft.outerWidth()
            })
    };

    // Remove Column
    Plugin.prototype.removeColumn = function(scope, event) {
        // Get the index of the column we clicked in
        var idx = $(event.target).closest('th').index(),
            rmv = $(event.target).closest('tr').find('.table-sticky-bits-remove-column');

        // Then run through the table and remove the unwanted cells
        scope.options.container.find("table tr").each(function (index) {

            // on the first iteration look for the number of columns left
            if (index < 1) {

                // if there is less than the min columns to show, remove the remove buttons
                if (rmv.length <= scope.options.tableMinColumns) {
                    rmv.remove();
                    $( '.pl53-comparison-table-column-title' ).css( "padding-top", "1.5em" );
                }
            }

            // remove the column
            $(this).find("td, th").eq(idx).remove();

        });

        // Trigger window resize to adjust the table if needed
        $(window).trigger('resize');
    };

    // Toggle Sections
    Plugin.prototype.toggleSection = function(scope, event) {
        // Get the index of the tbody we're toggling
        // NOTE: we're not toggling thead but we need to include it in the search so our indexes match up
        var idx = $(event.target).closest('thead, tbody').index();

        // Then run through the table and hide the selected tbody
        scope.options.container.find('table').each( function() {
            $(this).find('thead, tbody').eq(idx).toggleClass('is-section-hidden');
        });

        // Trigger window resize to adjust the table if needed
        $(window).trigger('resize');
    };

    // Constructor Wrapper
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName, new Plugin(this, options));
            }
        });
    };

    // Init
    $(window).on('load', function () {
        $('.table-sticky-bits').tableStickyBits();
    });

})(jQuery, window, document);
;
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return m(t,"toString")&&(e.toString=t.toString),m(t,"valueOf")&&(e.valueOf=t.valueOf),e}function y(e,t,n,s){return Ot(e,t,n,s,!0).utc()}function g(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function p(e){if(null==e._isValid){var t=g(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function v(e){var t=y(NaN);return null!=e?_(g(t),e):g(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var r=c.momentProperties=[];function w(e,t){var n,s,i;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=g(t)),l(t._locale)||(e._locale=t._locale),0<r.length)for(n=0;n<r.length;n++)l(i=t[s=r[n]])||(e[s]=i);return e}var t=!1;function M(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,c.updateOffset(this),t=!1)}function S(e){return e instanceof M||null!=e&&null!=e._isAMomentObject}function D(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=D(t)),n}function a(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&k(e[s])!==k(t[s]))&&a++;return a+r}function Y(e){!1===c.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,r){var a=!0;return _(function(){if(null!=c.deprecationHandler&&c.deprecationHandler(null,i),a){for(var e,t=[],n=0;n<arguments.length;n++){if(e="","object"==typeof arguments[n]){for(var s in e+="\n["+n+"] ",arguments[0])e+=s+": "+arguments[0][s]+", ";e=e.slice(0,-2)}else e=arguments[n];t.push(e)}Y(i+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var s,O={};function T(e,t){null!=c.deprecationHandler&&c.deprecationHandler(e,t),O[e]||(Y(t),O[e]=!0)}function x(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function b(e,t){var n,s=_({},e);for(n in t)m(t,n)&&(u(e[n])&&u(t[n])?(s[n]={},_(s[n],e[n]),_(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)m(e,n)&&!m(t,n)&&u(e[n])&&(s[n]=_({},s[n]));return s}function P(e){null!=e&&this.set(e)}c.suppressDeprecationWarnings=!1,c.deprecationHandler=null,s=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)m(e,t)&&n.push(t);return n};var W={};function H(e,t){var n=e.toLowerCase();W[n]=W[n+"s"]=W[t]=e}function R(e){return"string"==typeof e?W[e]||W[e.toLowerCase()]:void 0}function C(e){var t,n,s={};for(n in e)m(e,n)&&(t=R(n))&&(s[t]=e[n]);return s}var F={};function L(e,t){F[e]=t}function U(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var N=/(\[[^\[]*\])|(\\)?([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,G=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},E={};function I(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(E[e]=i),t&&(E[t[0]]=function(){return U(i.apply(this,arguments),t[1],t[2])}),n&&(E[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=j(t,e.localeData()),V[t]=V[t]||function(s){var e,i,t,r=s.match(N);for(e=0,i=r.length;e<i;e++)E[r[e]]?r[e]=E[r[e]]:r[e]=(t=r[e]).match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"");return function(e){var t,n="";for(t=0;t<i;t++)n+=x(r[t])?r[t].call(e,s):r[t];return n}}(t),V[t](e)):e.localeData().invalidDate()}function j(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(G.lastIndex=0;0<=n&&G.test(e);)e=e.replace(G,s),G.lastIndex=0,n-=1;return e}var Z=/\d/,z=/\d\d/,$=/\d{3}/,q=/\d{4}/,J=/[+-]?\d{6}/,B=/\d\d?/,Q=/\d\d\d\d?/,X=/\d\d\d\d\d\d?/,K=/\d{1,3}/,ee=/\d{1,4}/,te=/[+-]?\d{1,6}/,ne=/\d+/,se=/[+-]?\d+/,ie=/Z|[+-]\d\d:?\d\d/gi,re=/Z|[+-]\d\d(?::?\d\d)?/gi,ae=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,oe={};function ue(e,n,s){oe[e]=x(n)?n:function(e,t){return e&&s?s:n}}function le(e,t){return m(oe,e)?oe[e](t._strict,t._locale):new RegExp(de(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function de(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var he={};function ce(e,n){var t,s=n;for("string"==typeof e&&(e=[e]),d(n)&&(s=function(e,t){t[n]=k(e)}),t=0;t<e.length;t++)he[e[t]]=s}function fe(e,i){ce(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var me=0,_e=1,ye=2,ge=3,pe=4,ve=5,we=6,Me=7,Se=8;function De(e){return ke(e)?366:365}function ke(e){return e%4==0&&e%100!=0||e%400==0}I("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),H("year","y"),L("year",1),ue("Y",se),ue("YY",B,z),ue("YYYY",ee,q),ue("YYYYY",te,J),ue("YYYYYY",te,J),ce(["YYYYY","YYYYYY"],me),ce("YYYY",function(e,t){t[me]=2===e.length?c.parseTwoDigitYear(e):k(e)}),ce("YY",function(e,t){t[me]=c.parseTwoDigitYear(e)}),ce("Y",function(e,t){t[me]=parseInt(e,10)}),c.parseTwoDigitYear=function(e){return k(e)+(68<k(e)?1900:2e3)};var Ye,Oe=Te("FullYear",!0);function Te(t,n){return function(e){return null!=e?(be(this,t,e),c.updateOffset(this,n),this):xe(this,t)}}function xe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function be(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&ke(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Pe(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Pe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?ke(e)?29:28:31-s%7%2}Ye=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),I("MMMM",0,0,function(e){return this.localeData().months(this,e)}),H("month","M"),L("month",8),ue("M",B),ue("MM",B,z),ue("MMM",function(e,t){return t.monthsShortRegex(e)}),ue("MMMM",function(e,t){return t.monthsRegex(e)}),ce(["M","MM"],function(e,t){t[_e]=k(e)-1}),ce(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[_e]=i:g(n).invalidMonth=e});var We=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,He="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Re="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Ce(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(!d(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Pe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Fe(e){return null!=e?(Ce(this,e),c.updateOffset(this,!0),this):xe(this,"Month")}var Le=ae;var Ue=ae;function Ne(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=y([2e3,t]),s.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=de(s[t]),i[t]=de(i[t]);for(t=0;t<24;t++)r[t]=de(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ge(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&0<=e&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ve(e,t,n){var s=7+t-n;return-((7+Ge(e,0,s).getUTCDay()-t)%7)+s-1}function Ee(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Ve(e,s,i);return o<=0?a=De(r=e-1)+o:o>De(e)?(r=e+1,a=o-De(e)):(r=e,a=o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(De(e)-s+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),H("week","w"),H("isoWeek","W"),L("week",5),L("isoWeek",5),ue("w",B),ue("ww",B,z),ue("W",B),ue("WW",B,z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=k(e)});I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),H("day","d"),H("weekday","e"),H("isoWeekday","E"),L("day",11),L("weekday",11),L("isoWeekday",11),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=k(e)});var je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var $e=ae;var qe=ae;var Je=ae;function Be(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=de(o[t]),u[t]=de(u[t]),l[t]=de(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Qe(){return this.hours()%12||12}function Xe(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ke(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Qe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)}),I("hmmss",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+U(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),Xe("a",!0),Xe("A",!1),H("hour","h"),L("hour",13),ue("a",Ke),ue("A",Ke),ue("H",B),ue("h",B),ue("k",B),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",Q),ue("hmmss",X),ue("Hmm",Q),ue("Hmmss",X),ce(["H","HH"],ge),ce(["k","kk"],function(e,t,n){var s=k(e);t[ge]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ge]=k(e),g(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s)),g(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i)),g(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i))});var et,tt=Te("Hours",!0),nt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{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"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:He,monthsShort:Re,week:{dow:0,doy:6},weekdays:je,weekdaysMin:ze,weekdaysShort:Ze,meridiemParse:/[ap]\.?m?\.?/i},st={},it={};function rt(e){return e?e.toLowerCase().replace("_","-"):e}function at(e){var t=null;if(!st[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=et._abbr,require("./locale/"+e),ot(t)}catch(e){}return st[e]}function ot(e,t){var n;return e&&((n=l(t)?lt(e):ut(e,t))?et=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),et._abbr}function ut(e,t){if(null!==t){var n,s=nt;if(t.abbr=e,null!=st[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=st[e]._config;else if(null!=t.parentLocale)if(null!=st[t.parentLocale])s=st[t.parentLocale]._config;else{if(null==(n=at(t.parentLocale)))return it[t.parentLocale]||(it[t.parentLocale]=[]),it[t.parentLocale].push({name:e,config:t}),null;s=n._config}return st[e]=new P(b(s,t)),it[e]&&it[e].forEach(function(e){ut(e.name,e.config)}),ot(e),st[e]}return delete st[e],null}function lt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return et;if(!o(e)){if(t=at(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=rt(e[r]).split("-")).length,n=(n=rt(e[r+1]))?n.split("-"):null;0<t;){if(s=at(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&a(i,n,!0)>=t-1)break;t--}r++}return et}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11<n[_e]?_e:n[ye]<1||n[ye]>Pe(n[me],n[_e])?ye:n[ge]<0||24<n[ge]||24===n[ge]&&(0!==n[pe]||0!==n[ve]||0!==n[we])?ge:n[pe]<0||59<n[pe]?pe:n[ve]<0||59<n[ve]?ve:n[we]<0||999<n[we]?we:-1,g(e)._overflowDayOfYear&&(t<me||ye<t)&&(t=ye),g(e)._overflowWeeks&&-1===t&&(t=Me),g(e)._overflowWeekday&&-1===t&&(t=Se),g(e).overflow=t),e}function ht(e,t,n){return null!=e?e:null!=t?t:n}function ct(e){var t,n,s,i,r,a=[];if(!e._d){var o,u;for(o=e,u=new Date(c.now()),s=o._useUTC?[u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()]:[u.getFullYear(),u.getMonth(),u.getDate()],e._w&&null==e._a[ye]&&null==e._a[_e]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ht(t.GG,e._a[me],Ie(Tt(),1,4).year),s=ht(t.W,1),((i=ht(t.E,1))<1||7<i)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Ie(Tt(),r,a);n=ht(t.gg,e._a[me],l.year),s=ht(t.w,l.week),null!=t.d?((i=t.d)<0||6<i)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(u=!0)):i=r}s<1||s>Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ht(e._a[me],s[me]),(e._dayOfYear>De(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[pe]&&0===e._a[ve]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&0<=e&&isFinite(o.getFullYear())&&o.setFullYear(e),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var ft=/^\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)?)?$/,mt=/^\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)?)?$/,_t=/Z|[+-]\d\d(?::?\d\d)?/,yt=[["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}/]],gt=[["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/]],pt=/^\/?Date\((\-?\d+)/i;function vt(e){var t,n,s,i,r,a,o=e._i,u=ft.exec(o)||mt.exec(o);if(u){for(g(e).iso=!0,t=0,n=yt.length;t<n;t++)if(yt[t][1].exec(u[1])){i=yt[t][0],s=!1!==yt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[3])){r=(u[2]||" ")+gt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!_t.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),kt(e)}else e._isValid=!1}var wt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function Mt(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),Re.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Dt(e){var t,n,s,i=wt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(i){var r=Mt(i[4],i[3],i[2],i[5],i[6],i[7]);if(t=i[1],n=r,s=e,t&&Ze.indexOf(t)!==new Date(n[0],n[1],n[2]).getDay()&&(g(s).weekdayMismatch=!0,!(s._isValid=!1)))return;e._a=r,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(i[8],i[9],i[10]),e._d=Ge.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function kt(e){if(e._f!==c.ISO_8601)if(e._f!==c.RFC_2822){e._a=[],g(e).empty=!0;var t,n,s,i,r,a,o,u,l=""+e._i,d=l.length,h=0;for(s=j(e._f,e._locale).match(N)||[],t=0;t<s.length;t++)i=s[t],(n=(l.match(le(i,e))||[])[0])&&(0<(r=l.substr(0,l.indexOf(n))).length&&g(e).unusedInput.push(r),l=l.slice(l.indexOf(n)+n.length),h+=n.length),E[i]?(n?g(e).empty=!1:g(e).unusedTokens.push(i),a=i,u=e,null!=(o=n)&&m(he,a)&&he[a](o,u._a,u,a)):e._strict&&!n&&g(e).unusedTokens.push(i);g(e).charsLeftOver=d-h,0<l.length&&g(e).unusedInput.push(l),e._a[ge]<=12&&!0===g(e).bigHour&&0<e._a[ge]&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[ge]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0)),t)}(e._locale,e._a[ge],e._meridiem),ct(e),dt(e)}else Dt(e);else vt(e)}function Yt(e){var t,n,s,i,r=e._i,a=e._f;return e._locale=e._locale||lt(e._l),null===r||void 0===a&&""===r?v({nullInput:!0}):("string"==typeof r&&(e._i=r=e._locale.preparse(r)),S(r)?new M(dt(r)):(h(r)?e._d=r:o(a)?function(e){var t,n,s,i,r;if(0===e._f.length)return g(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],kt(t),p(t)&&(r+=g(t).charsLeftOver,r+=10*g(t).unusedTokens.length,g(t).score=r,(null==s||r<s)&&(s=r,n=t));_(e,n||t)}(e):a?kt(e):l(n=(t=e)._i)?t._d=new Date(c.now()):h(n)?t._d=new Date(n.valueOf()):"string"==typeof n?(s=t,null===(i=pt.exec(s._i))?(vt(s),!1===s._isValid&&(delete s._isValid,Dt(s),!1===s._isValid&&(delete s._isValid,c.createFromInputFallback(s)))):s._d=new Date(+i[1])):o(n)?(t._a=f(n.slice(0),function(e){return parseInt(e,10)}),ct(t)):u(n)?function(e){if(!e._d){var t=C(e._i);e._a=f([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ct(e)}}(t):d(n)?t._d=new Date(n):c.createFromInputFallback(t),p(e)||(e._d=null),e))}function Ot(e,t,n,s,i){var r,a={};return!0!==n&&!1!==n||(s=n,n=void 0),(u(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||o(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=s,(r=new M(dt(Yt(a))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function Tt(e,t,n,s){return Ot(e,t,n,s,!1)}c.createFromInputFallback=n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),c.ISO_8601=function(){},c.RFC_2822=function(){};var xt=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:v()}),bt=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:v()});function Pt(e,t){var n,s;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Tt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Wt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ht(e){var t=C(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,d=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ye.call(Wt,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,s=0;s<Wt.length;++s)if(e[Wt[s]]){if(n)return!1;parseFloat(e[Wt[s]])!==k(e[Wt[s]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=lt(),this._bubble()}function Rt(e){return e instanceof Ht}function Ct(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){I(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+U(~~(e/60),2)+n+U(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),ue("Z",re),ue("ZZ",re),ce(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ut(re,e)});var Lt=/([\+\-]|\d\d)/gi;function Ut(e,t){var n=(t||"").match(e);if(null===n)return null;var s=((n[n.length-1]||[])+"").match(Lt)||["-",0,0],i=60*s[1]+k(s[2]);return 0===i?0:"+"===s[0]?i:-i}function Nt(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(S(e)||h(e)?e.valueOf():Tt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),c.updateOffset(n,!1),n):Tt(e).local()}function Gt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Vt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}c.updateOffset=function(){};var Et=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,It=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function At(e,t){var n,s,i,r=e,a=null;return Rt(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:d(e)?(r={},t?r[t]=e:r.milliseconds=e):(a=Et.exec(e))?(n="-"===a[1]?-1:1,r={y:0,d:k(a[ye])*n,h:k(a[ge])*n,m:k(a[pe])*n,s:k(a[ve])*n,ms:k(Ct(1e3*a[we]))*n}):(a=It.exec(e))?(n="-"===a[1]?-1:(a[1],1),r={y:jt(a[2],n),M:jt(a[3],n),w:jt(a[4],n),d:jt(a[5],n),h:jt(a[6],n),m:jt(a[7],n),s:jt(a[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Nt(t,e),e.isBefore(t)?n=Zt(e,t):((n=Zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Tt(r.from),Tt(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new Ht(r),Rt(e)&&m(e,"_locale")&&(s._locale=e._locale),s}function jt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Zt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function zt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(T(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),$t(this,At(e="string"==typeof e?+e:e,t),s),this}}function $t(e,t,n,s){var i=t._milliseconds,r=Ct(t._days),a=Ct(t._months);e.isValid()&&(s=null==s||s,a&&Ce(e,xe(e,"Month")+a*n),r&&be(e,"Date",xe(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&c.updateOffset(e,r||a))}At.fn=Ht.prototype,At.invalid=function(){return At(NaN)};var qt=zt(1,"add"),Jt=zt(-1,"subtract");function Bt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(n+1,"months")-s)))||0}function Qt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=lt(e))&&(this._locale=t),this)}c.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",c.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Xt=n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function Kt(){return this._locale}function en(e,t){I(0,[e,e.length],0,t)}function tn(e,t,n,s,i){var r;return null==e?Ie(this,s,i).year:((r=Ae(e,s,i))<t&&(t=r),function(e,t,n,s,i){var r=Ee(e,t,n,s,i),a=Ge(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),en("gggg","weekYear"),en("ggggg","weekYear"),en("GGGG","isoWeekYear"),en("GGGGG","isoWeekYear"),H("weekYear","gg"),H("isoWeekYear","GG"),L("weekYear",1),L("isoWeekYear",1),ue("G",se),ue("g",se),ue("GG",B,z),ue("gg",B,z),ue("GGGG",ee,q),ue("gggg",ee,q),ue("GGGGG",te,J),ue("ggggg",te,J),fe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=k(e)}),fe(["gg","GG"],function(e,t,n,s){t[s]=c.parseTwoDigitYear(e)}),I("Q",0,"Qo","quarter"),H("quarter","Q"),L("quarter",7),ue("Q",Z),ce("Q",function(e,t){t[_e]=3*(k(e)-1)}),I("D",["DD",2],"Do","date"),H("date","D"),L("date",9),ue("D",B),ue("DD",B,z),ue("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ce(["D","DD"],ye),ce("Do",function(e,t){t[ye]=k(e.match(B)[0])});var nn=Te("Date",!0);I("DDD",["DDDD",3],"DDDo","dayOfYear"),H("dayOfYear","DDD"),L("dayOfYear",4),ue("DDD",K),ue("DDDD",$),ce(["DDD","DDDD"],function(e,t,n){n._dayOfYear=k(e)}),I("m",["mm",2],0,"minute"),H("minute","m"),L("minute",14),ue("m",B),ue("mm",B,z),ce(["m","mm"],pe);var sn=Te("Minutes",!1);I("s",["ss",2],0,"second"),H("second","s"),L("second",15),ue("s",B),ue("ss",B,z),ce(["s","ss"],ve);var rn,an=Te("Seconds",!1);for(I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),H("millisecond","ms"),L("millisecond",16),ue("S",K,Z),ue("SS",K,z),ue("SSS",K,$),rn="SSSS";rn.length<=9;rn+="S")ue(rn,ne);function on(e,t){t[we]=k(1e3*("0."+e))}for(rn="S";rn.length<=9;rn+="S")ce(rn,on);var un=Te("Milliseconds",!1);I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var ln=M.prototype;function dn(e){return e}ln.add=qt,ln.calendar=function(e,t){var n=e||Tt(),s=Nt(n,this).startOf("day"),i=c.calendarFormat(this,s)||"sameElse",r=t&&(x(t[i])?t[i].call(this,n):t[i]);return this.format(r||this.localeData().calendar(i,this,Tt(n)))},ln.clone=function(){return new M(this)},ln.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Nt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=R(t)){case"year":r=Bt(this,s)/12;break;case"month":r=Bt(this,s);break;case"quarter":r=Bt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:D(r)},ln.endOf=function(e){return void 0===(e=R(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},ln.format=function(e){e||(e=this.isUtc()?c.defaultFormatUtc:c.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},ln.from=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.fromNow=function(e){return this.from(Tt(),e)},ln.to=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.toNow=function(e){return this.to(Tt(),e)},ln.get=function(e){return x(this[e=R(e)])?this[e]():this},ln.invalidAt=function(){return g(this).overflow},ln.isAfter=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=R(l(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},ln.isBefore=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=R(l(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},ln.isBetween=function(e,t,n,s){return("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},ln.isSame=function(e,t){var n,s=S(e)?e:Tt(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=R(t||"millisecond"))?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},ln.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},ln.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},ln.isValid=function(){return p(this)},ln.lang=Xt,ln.locale=Qt,ln.localeData=Kt,ln.max=bt,ln.min=xt,ln.parsingFlags=function(){return _({},g(this))},ln.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:F[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=C(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(x(this[e=R(e)]))return this[e](t);return this},ln.startOf=function(e){switch(e=R(e)){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"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},ln.subtract=Jt,ln.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},ln.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},ln.toDate=function(){return new Date(this.valueOf())},ln.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?A(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):x(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",A(n,"Z")):A(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},ln.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+s+"-MM-DD[T]HH:mm:ss.SSS"+i)},ln.toJSON=function(){return this.isValid()?this.toISOString():null},ln.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},ln.unix=function(){return Math.floor(this.valueOf()/1e3)},ln.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},ln.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},ln.year=Oe,ln.isLeapYear=function(){return ke(this.year())},ln.weekYear=function(e){return tn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},ln.isoWeekYear=function(e){return tn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},ln.quarter=ln.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},ln.month=Fe,ln.daysInMonth=function(){return Pe(this.year(),this.month())},ln.week=ln.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},ln.isoWeek=ln.isoWeeks=function(e){var t=Ie(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},ln.weeksInYear=function(){var e=this.localeData()._week;return Ae(this.year(),e.dow,e.doy)},ln.isoWeeksInYear=function(){return Ae(this.year(),1,4)},ln.date=nn,ln.day=ln.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},ln.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},ln.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=(n=e,s=this.localeData(),"string"==typeof n?s.weekdaysParse(n)%7||7:isNaN(n)?null:n);return this.day(this.day()%7?t:t-7)}return this.day()||7;var n,s},ln.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},ln.hour=ln.hours=tt,ln.minute=ln.minutes=sn,ln.second=ln.seconds=an,ln.millisecond=ln.milliseconds=un,ln.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Ut(re,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Gt(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?$t(this,At(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Gt(this)},ln.utc=function(e){return this.utcOffset(0,e)},ln.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Gt(this),"m")),this},ln.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Ut(ie,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},ln.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Tt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},ln.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Vt,ln.isUTC=Vt,ln.zoneAbbr=function(){return this._isUTC?"UTC":""},ln.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ln.dates=n("dates accessor is deprecated. Use date instead.",nn),ln.months=n("months accessor is deprecated. Use month instead",Fe),ln.years=n("years accessor is deprecated. Use year instead",Oe),ln.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),ln.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Yt(e))._a){var t=e._isUTC?y(e._a):Tt(e._a);this._isDSTShifted=this.isValid()&&0<a(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var hn=P.prototype;function cn(e,t,n,s){var i=lt(),r=y().set(s,t);return i[n](r,e)}function fn(e,t,n){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=cn(e,s,n,"month");return i}function mn(e,t,n,s){"boolean"==typeof e?d(t)&&(n=t,t=void 0):(t=e,e=!1,d(n=t)&&(n=t,t=void 0)),t=t||"";var i,r=lt(),a=e?r._week.dow:0;if(null!=n)return cn(t,(n+a)%7,s,"day");var o=[];for(i=0;i<7;i++)o[i]=cn(t,(i+a)%7,s,"day");return o}hn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return x(s)?s.call(t,n):s},hn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},hn.invalidDate=function(){return this._invalidDate},hn.ordinal=function(e){return this._ordinal.replace("%d",e)},hn.preparse=dn,hn.postformat=dn,hn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return x(i)?i(e,t,n,s):i.replace(/%d/i,e)},hn.pastFuture=function(e,t){var n=this._relativeTime[0<e?"future":"past"];return x(n)?n(t):n.replace(/%s/i,t)},hn.set=function(e){var t,n;for(n in e)x(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},hn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||We).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},hn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[We.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},hn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=y([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=y([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},hn.monthsRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(m(this,"_monthsRegex")||(this._monthsRegex=Ue),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},hn.monthsShortRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(m(this,"_monthsShortRegex")||(this._monthsShortRegex=Le),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},hn.week=function(e){return Ie(e,this._week.dow,this._week.doy).week},hn.firstDayOfYear=function(){return this._week.doy},hn.firstDayOfWeek=function(){return this._week.dow},hn.weekdays=function(e,t){return e?o(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:o(this._weekdays)?this._weekdays:this._weekdays.standalone},hn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},hn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},hn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=y([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=y([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},hn.weekdaysRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,"_weekdaysRegex")||(this._weekdaysRegex=$e),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},hn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=qe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},hn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Je),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},hn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},hn.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ot("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===k(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),c.lang=n("moment.lang is deprecated. Use moment.locale instead.",ot),c.langData=n("moment.langData is deprecated. Use moment.localeData instead.",lt);var _n=Math.abs;function yn(e,t,n,s){var i=At(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function gn(e){return e<0?Math.floor(e):Math.ceil(e)}function pn(e){return 4800*e/146097}function vn(e){return 146097*e/4800}function wn(e){return function(){return this.as(e)}}var Mn=wn("ms"),Sn=wn("s"),Dn=wn("m"),kn=wn("h"),Yn=wn("d"),On=wn("w"),Tn=wn("M"),xn=wn("y");function bn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Pn=bn("milliseconds"),Wn=bn("seconds"),Hn=bn("minutes"),Rn=bn("hours"),Cn=bn("days"),Fn=bn("months"),Ln=bn("years");var Un=Math.round,Nn={ss:44,s:45,m:45,h:22,d:26,M:11};var Gn=Math.abs;function Vn(e){return(0<e)-(e<0)||+e}function En(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Gn(this._milliseconds)/1e3,s=Gn(this._days),i=Gn(this._months);t=D((e=D(n/60))/60),n%=60,e%=60;var r=D(i/12),a=i%=12,o=s,u=t,l=e,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=Vn(this._months)!==Vn(h)?"-":"",m=Vn(this._days)!==Vn(h)?"-":"",_=Vn(this._milliseconds)!==Vn(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(a?f+a+"M":"")+(o?m+o+"D":"")+(u||l||d?"T":"")+(u?_+u+"H":"")+(l?_+l+"M":"")+(d?_+d+"S":"")}var In=Ht.prototype;return In.isValid=function(){return this._isValid},In.abs=function(){var e=this._data;return this._milliseconds=_n(this._milliseconds),this._days=_n(this._days),this._months=_n(this._months),e.milliseconds=_n(e.milliseconds),e.seconds=_n(e.seconds),e.minutes=_n(e.minutes),e.hours=_n(e.hours),e.months=_n(e.months),e.years=_n(e.years),this},In.add=function(e,t){return yn(this,e,t,1)},In.subtract=function(e,t){return yn(this,e,t,-1)},In.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=R(e))||"year"===e)return t=this._days+s/864e5,n=this._months+pn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(vn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},In.asMilliseconds=Mn,In.asSeconds=Sn,In.asMinutes=Dn,In.asHours=kn,In.asDays=Yn,In.asWeeks=On,In.asMonths=Tn,In.asYears=xn,In.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},In._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return 0<=r&&0<=a&&0<=o||r<=0&&a<=0&&o<=0||(r+=864e5*gn(vn(o)+a),o=a=0),u.milliseconds=r%1e3,e=D(r/1e3),u.seconds=e%60,t=D(e/60),u.minutes=t%60,n=D(t/60),u.hours=n%24,o+=i=D(pn(a+=D(n/24))),a-=gn(vn(i)),s=D(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},In.clone=function(){return At(this)},In.get=function(e){return e=R(e),this.isValid()?this[e+"s"]():NaN},In.milliseconds=Pn,In.seconds=Wn,In.minutes=Hn,In.hours=Rn,In.days=Cn,In.weeks=function(){return D(this.days()/7)},In.months=Fn,In.years=Ln,In.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t,n,s,i,r,a,o,u,l,d,h,c=this.localeData(),f=(n=!e,s=c,i=At(t=this).abs(),r=Un(i.as("s")),a=Un(i.as("m")),o=Un(i.as("h")),u=Un(i.as("d")),l=Un(i.as("M")),d=Un(i.as("y")),(h=r<=Nn.ss&&["s",r]||r<Nn.s&&["ss",r]||a<=1&&["m"]||a<Nn.m&&["mm",a]||o<=1&&["h"]||o<Nn.h&&["hh",o]||u<=1&&["d"]||u<Nn.d&&["dd",u]||l<=1&&["M"]||l<Nn.M&&["MM",l]||d<=1&&["y"]||["yy",d])[2]=n,h[3]=0<+t,h[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,h));return e&&(f=c.pastFuture(+this,f)),c.postformat(f)},In.toISOString=En,In.toString=En,In.toJSON=En,In.locale=Qt,In.localeData=Kt,In.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",En),In.lang=Xt,I("X",0,0,"unix"),I("x",0,0,"valueOf"),ue("x",se),ue("X",/[+-]?\d+(\.\d{1,3})?/),ce("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ce("x",function(e,t,n){n._d=new Date(k(e))}),c.version="2.22.2",e=Tt,c.fn=ln,c.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},c.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},c.now=function(){return Date.now?Date.now():+new Date},c.utc=y,c.unix=function(e){return Tt(1e3*e)},c.months=function(e,t){return fn(e,t,"months")},c.isDate=h,c.locale=ot,c.invalid=v,c.duration=At,c.isMoment=S,c.weekdays=function(e,t,n){return mn(e,t,n,"weekdays")},c.parseZone=function(){return Tt.apply(null,arguments).parseZone()},c.localeData=lt,c.isDuration=Rt,c.monthsShort=function(e,t){return fn(e,t,"monthsShort")},c.weekdaysMin=function(e,t,n){return mn(e,t,n,"weekdaysMin")},c.defineLocale=ut,c.updateLocale=function(e,t){if(null!=t){var n,s,i=nt;null!=(s=at(e))&&(i=s._config),(n=new P(t=b(i,t))).parentLocale=st[e],st[e]=n,ot(e)}else null!=st[e]&&(null!=st[e].parentLocale?st[e]=st[e].parentLocale:null!=st[e]&&delete st[e]);return st[e]},c.locales=function(){return s(st)},c.weekdaysShort=function(e,t,n){return mn(e,t,n,"weekdaysShort")},c.normalizeUnits=R,c.relativeTimeRounding=function(e){return void 0===e?Un:"function"==typeof e&&(Un=e,!0)},c.relativeTimeThreshold=function(e,t){return void 0!==Nn[e]&&(void 0===t?Nn[e]:(Nn[e]=t,"s"===e&&(Nn.ss=t-1),!0))},c.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},c.prototype=ln,c.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},c});;
/*!
 * Pikaday
 *
 * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
 */

(function (root, factory)
{
    'use strict';

    var moment;
    if (typeof exports === 'object') {
        // CommonJS module
        // Load moment.js as an optional dependency
        try { moment = require('moment'); } catch (e) {}
        module.exports = factory(moment);
    } else if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(function (req)
        {
            // Load moment.js as an optional dependency
            var id = 'moment';
            moment = req.defined && req.defined(id) ? req(id) : undefined;
            return factory(moment);
        });
    } else {
        root.Pikaday = factory(root.moment);
    }
}(this, function (moment)
{
    'use strict';

    /**
     * feature detection and helper functions
     */
    var hasMoment = typeof moment === 'function',

    hasEventListeners = !!window.addEventListener,

    document = window.document,

    sto = window.setTimeout,

    addEvent = function(el, e, callback, capture)
    {
        if (hasEventListeners) {
            el.addEventListener(e, callback, !!capture);
        } else {
            el.attachEvent('on' + e, callback);
        }
    },

    removeEvent = function(el, e, callback, capture)
    {
        if (hasEventListeners) {
            el.removeEventListener(e, callback, !!capture);
        } else {
            el.detachEvent('on' + e, callback);
        }
    },

    fireEvent = function(el, eventName, data)
    {
        var ev;

        if (document.createEvent) {
            ev = document.createEvent('HTMLEvents');
            ev.initEvent(eventName, true, false);
            ev = extend(ev, data);
            el.dispatchEvent(ev);
        } else if (document.createEventObject) {
            ev = document.createEventObject();
            ev = extend(ev, data);
            el.fireEvent('on' + eventName, ev);
        }
    },

    trim = function(str)
    {
        return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g,'');
    },

    hasClass = function(el, cn)
    {
        return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1;
    },

    addClass = function(el, cn)
    {
        if (!hasClass(el, cn)) {
            el.className = (el.className === '') ? cn : el.className + ' ' + cn;
        }
    },

    removeClass = function(el, cn)
    {
        el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' '));
    },

    isArray = function(obj)
    {
        return (/Array/).test(Object.prototype.toString.call(obj));
    },

    isDate = function(obj)
    {
        return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime());
    },

    isLeapYear = function(year)
    {
        // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951
        return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
    },

    getDaysInMonth = function(year, month)
    {
        return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
    },

    setToStartOfDay = function(date)
    {
        if (isDate(date)) date.setHours(0,0,0,0);
    },

    compareDates = function(a,b)
    {
        // weak date comparison (use setToStartOfDay(date) to ensure correct result)
        return a.getTime() === b.getTime();
    },

    extend = function(to, from, overwrite)
    {
        var prop, hasProp;
        for (prop in from) {
            hasProp = to[prop] !== undefined;
            if (hasProp && typeof from[prop] === 'object' && from[prop].nodeName === undefined) {
                if (isDate(from[prop])) {
                    if (overwrite) {
                        to[prop] = new Date(from[prop].getTime());
                    }
                }
                else if (isArray(from[prop])) {
                    if (overwrite) {
                        to[prop] = from[prop].slice(0);
                    }
                } else {
                    to[prop] = extend({}, from[prop], overwrite);
                }
            } else if (overwrite || !hasProp) {
                to[prop] = from[prop];
            }
        }
        return to;
    },

    adjustCalendar = function(calendar) {
        if (calendar.month < 0) {
            calendar.year -= Math.ceil(Math.abs(calendar.month)/12);
            calendar.month += 12;
        }
        if (calendar.month > 11) {
            calendar.year += Math.floor(Math.abs(calendar.month)/12);
            calendar.month -= 12;
        }
        return calendar;
    },

    /**
     * defaults and localisation
     */
    defaults = {

        // bind the picker to a form field
        field: null,

        // automatically show/hide the picker on `field` focus (default `true` if `field` is set)
        bound: undefined,

        // position of the datepicker, relative to the field (default to bottom & left)
        // ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position)
        position: 'bottom left',

        // the default output format for `.toString()` and `field` value
        format: 'YYYY-MM-DD',

        // the initial date to view when first opened
        defaultDate: null,

        // make the `defaultDate` the initial selected value
        setDefaultDate: false,

        // first day of week (0: Sunday, 1: Monday etc)
        firstDay: 0,

        // the minimum/earliest date that can be selected
        minDate: null,
        // the maximum/latest date that can be selected
        maxDate: null,

        // number of years either side, or array of upper/lower range
        yearRange: 10,

        // show week numbers at head of row
        showWeekNumber: false,

        // used internally (don't config outside)
        minYear: 0,
        maxYear: 9999,
        minMonth: undefined,
        maxMonth: undefined,

        isRTL: false,

        // Additional text to append to the year in the calendar title
        yearSuffix: '',

        // Render the month after year in the calendar title
        showMonthAfterYear: false,

        // how many months are visible
        numberOfMonths: 1,

        // when numberOfMonths is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`)
        // only used for the first display or when a selected date is not visible
        mainCalendar: 'left',

        // Specify a DOM element to render the calendar in
        container: undefined,

        // internationalization
        i18n: {
            previousMonth : 'Previous Month',
            nextMonth     : 'Next Month',
            months        : ['January','February','March','April','May','June','July','August','September','October','November','December'],
            weekdays      : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
            weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
        },

        // callback function
        onSelect: null,
        onOpen: null,
        onClose: null,
        onDraw: null
    },


    /**
     * templating functions to abstract HTML rendering
     */
    renderDayName = function(opts, day, abbr)
    {
        day += opts.firstDay;
        while (day >= 7) {
            day -= 7;
        }
        return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
    },

    renderDay = function(d, m, y, isSelected, isToday, isDisabled, isEmpty)
    {
        if (isEmpty) {
            return '<td class="is-empty"></td>';
        }
        var arr = [];
        if (isDisabled) {
            arr.push('is-disabled');
        }
        if (isToday) {
            arr.push('is-today');
        }
        if (isSelected) {
            arr.push('is-selected');
        }
        return '<td data-day="' + d + '" class="' + arr.join(' ') + '">' +
                 '<button class="pika-button pika-day" type="button" ' +
                    'data-pika-year="' + y + '" data-pika-month="' + m + '" data-pika-day="' + d + '">' +
                        d +
                 '</button>' +
               '</td>';
    },

    renderWeek = function (d, m, y) {
        // Lifted from http://javascript.about.com/library/blweekyear.htm, lightly modified.
        var onejan = new Date(y, 0, 1),
            weekNum = Math.ceil((((new Date(y, m, d) - onejan) / 86400000) + onejan.getDay()+1)/7);
        return '<td class="pika-week">' + weekNum + '</td>';
    },

    renderRow = function(days, isRTL)
    {
        return '<tr>' + (isRTL ? days.reverse() : days).join('') + '</tr>';
    },

    renderBody = function(rows)
    {
        return '<tbody>' + rows.join('') + '</tbody>';
    },

    renderHead = function(opts)
    {
        var i, arr = [];
        if (opts.showWeekNumber) {
            arr.push('<th></th>');
        }
        for (i = 0; i < 7; i++) {
            arr.push('<th scope="col"><abbr title="' + renderDayName(opts, i) + '">' + renderDayName(opts, i, true) + '</abbr></th>');
        }
        return '<thead>' + (opts.isRTL ? arr.reverse() : arr).join('') + '</thead>';
    },

    renderTitle = function(instance, c, year, month, refYear)
    {
        var i, j, arr,
            opts = instance._o,
            isMinYear = year === opts.minYear,
            isMaxYear = year === opts.maxYear,
            html = '<div class="pika-title">',
            monthHtml,
            yearHtml,
            prev = true,
            next = true;

        for (arr = [], i = 0; i < 12; i++) {
            arr.push('<option value="' + (year === refYear ? i - c : 12 + i - c) + '"' +
                (i === month ? ' selected': '') +
                ((isMinYear && i < opts.minMonth) || (isMaxYear && i > opts.maxMonth) ? 'disabled' : '') + '>' +
                opts.i18n.months[i] + '</option>');
        }
        monthHtml = '<div class="pika-label">' + opts.i18n.months[month] + '<select class="pika-select pika-select-month">' + arr.join('') + '</select></div>';

        if (isArray(opts.yearRange)) {
            i = opts.yearRange[0];
            j = opts.yearRange[1] + 1;
        } else {
            i = year - opts.yearRange;
            j = 1 + year + opts.yearRange;
        }

        for (arr = []; i < j && i <= opts.maxYear; i++) {
            if (i >= opts.minYear) {
                arr.push('<option value="' + i + '"' + (i === year ? ' selected': '') + '>' + (i) + '</option>');
            }
        }
        yearHtml = '<div class="pika-label">' + year + opts.yearSuffix + '<select class="pika-select pika-select-year">' + arr.join('') + '</select></div>';

        if (opts.showMonthAfterYear) {
            html += yearHtml + monthHtml;
        } else {
            html += monthHtml + yearHtml;
        }

        if (isMinYear && (month === 0 || opts.minMonth >= month)) {
            prev = false;
        }

        if (isMaxYear && (month === 11 || opts.maxMonth <= month)) {
            next = false;
        }

        if (c === 0) {
            html += '<button class="pika-prev' + (prev ? '' : ' is-disabled') + '" type="button">' + opts.i18n.previousMonth + '</button>';
        }
        if (c === (instance._o.numberOfMonths - 1) ) {
            html += '<button class="pika-next' + (next ? '' : ' is-disabled') + '" type="button">' + opts.i18n.nextMonth + '</button>';
        }

        return html += '</div>';
    },

    renderTable = function(opts, data)
    {
        return '<table cellpadding="0" cellspacing="0" class="pika-table">' + renderHead(opts) + renderBody(data) + '</table>';
    },


    /**
     * Pikaday constructor
     */
    Pikaday = function(options)
    {
        var self = this,
            opts = self.config(options);

        self._onMouseDown = function(e)
        {
            if (!self._v) {
                return;
            }
            e = e || window.event;
            var target = e.target || e.srcElement;
            if (!target) {
                return;
            }

            if (!hasClass(target, 'is-disabled')) {
                if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty')) {
                    self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day')));
                    if (opts.bound) {
                        sto(function() {
                            self.hide();
                            if (opts.field) {
                                opts.field.blur();
                            }
                        }, 100);
                    }
                    return;
                }
                else if (hasClass(target, 'pika-prev')) {
                    self.prevMonth();
                }
                else if (hasClass(target, 'pika-next')) {
                    self.nextMonth();
                }
            }
            if (!hasClass(target, 'pika-select')) {
                if (e.preventDefault) {
                    e.preventDefault();
                } else {
                    e.returnValue = false;
                    return false;
                }
            } else {
                self._c = true;
            }
        };

        self._onChange = function(e)
        {
            e = e || window.event;
            var target = e.target || e.srcElement;
            if (!target) {
                return;
            }
            if (hasClass(target, 'pika-select-month')) {
                self.gotoMonth(target.value);
            }
            else if (hasClass(target, 'pika-select-year')) {
                self.gotoYear(target.value);
            }
        };

        self._onInputChange = function(e)
        {
            var date;

            if (e.firedBy === self) {
                return;
            }
            if (hasMoment) {
                date = moment(opts.field.value, opts.format);
                date = (date && date.isValid()) ? date.toDate() : null;
            }
            else {
                date = new Date(Date.parse(opts.field.value));
            }
            self.setDate(isDate(date) ? date : null);
            if (!self._v) {
                self.show();
            }
        };

        self._onInputFocus = function()
        {
            self.show();
        };

        self._onInputClick = function()
        {
            self.show();
        };

        self._onInputBlur = function()
        {
            if (!self._c) {
                self._b = sto(function() {
                    self.hide();
                }, 50);
            }
            self._c = false;
        };

        self._onClick = function(e)
        {
            e = e || window.event;
            var target = e.target || e.srcElement,
                pEl = target;
            if (!target) {
                return;
            }
            if (!hasEventListeners && hasClass(target, 'pika-select')) {
                if (!target.onchange) {
                    target.setAttribute('onchange', 'return;');
                    addEvent(target, 'change', self._onChange);
                }
            }
            do {
                if (hasClass(pEl, 'pika-single')) {
                    return;
                }
            }
            while ((pEl = pEl.parentNode));
            if (self._v && target !== opts.trigger) {
                self.hide();
            }
        };

        self.el = document.createElement('div');
        self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '');

        addEvent(self.el, 'mousedown', self._onMouseDown, true);
        addEvent(self.el, 'change', self._onChange);

        if (opts.field) {
            if (opts.container) {
                opts.container.appendChild(self.el);
            } else if (opts.bound) {
                document.body.appendChild(self.el);
            } else {
                opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling);
            }
            addEvent(opts.field, 'change', self._onInputChange);

            if (!opts.defaultDate) {
                if (hasMoment && opts.field.value) {
                    opts.defaultDate = moment(opts.field.value, opts.format).toDate();
                } else {
                    opts.defaultDate = new Date(Date.parse(opts.field.value));
                }
                opts.setDefaultDate = true;
            }
        }

        var defDate = opts.defaultDate;

        if (isDate(defDate)) {
            if (opts.setDefaultDate) {
                self.setDate(defDate, true);
            } else {
                self.gotoDate(defDate);
            }
        } else {
            self.gotoDate(new Date());
        }

        if (opts.bound) {
            this.hide();
            self.el.className += ' is-bound';
            addEvent(opts.trigger, 'click', self._onInputClick);
            addEvent(opts.trigger, 'focus', self._onInputFocus);
            addEvent(opts.trigger, 'blur', self._onInputBlur);
        } else {
            this.show();
        }
    };


    /**
     * public Pikaday API
     */
    Pikaday.prototype = {


        /**
         * configure functionality
         */
        config: function(options)
        {
            if (!this._o) {
                this._o = extend({}, defaults, true);
            }

            var opts = extend(this._o, options, true);

            opts.isRTL = !!opts.isRTL;

            opts.field = (opts.field && opts.field.nodeName) ? opts.field : null;

            opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field);

            opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field;

            var nom = parseInt(opts.numberOfMonths, 10) || 1;
            opts.numberOfMonths = nom > 4 ? 4 : nom;

            if (!isDate(opts.minDate)) {
                opts.minDate = false;
            }
            if (!isDate(opts.maxDate)) {
                opts.maxDate = false;
            }
            if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) {
                opts.maxDate = opts.minDate = false;
            }
            if (opts.minDate) {
                setToStartOfDay(opts.minDate);
                opts.minYear  = opts.minDate.getFullYear();
                opts.minMonth = opts.minDate.getMonth();
            }
            if (opts.maxDate) {
                setToStartOfDay(opts.maxDate);
                opts.maxYear  = opts.maxDate.getFullYear();
                opts.maxMonth = opts.maxDate.getMonth();
            }

            if (isArray(opts.yearRange)) {
                var fallback = new Date().getFullYear() - 10;
                opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback;
                opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback;
            } else {
                opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange;
                if (opts.yearRange > 100) {
                    opts.yearRange = 100;
                }
            }

            return opts;
        },

        /**
         * return a formatted string of the current selection (using Moment.js if available)
         */
        toString: function(format)
        {
            return !isDate(this._d) ? '' : hasMoment ? moment(this._d).format(format || this._o.format) : this._d.toDateString();
        },

        /**
         * return a Moment.js object of the current selection (if available)
         */
        getMoment: function()
        {
            return hasMoment ? moment(this._d) : null;
        },

        /**
         * set the current selection from a Moment.js object (if available)
         */
        setMoment: function(date, preventOnSelect)
        {
            if (hasMoment && moment.isMoment(date)) {
                this.setDate(date.toDate(), preventOnSelect);
            }
        },

        /**
         * return a Date object of the current selection
         */
        getDate: function()
        {
            return isDate(this._d) ? new Date(this._d.getTime()) : null;
        },

        /**
         * set the current selection
         */
        setDate: function(date, preventOnSelect)
        {
            if (!date) {
                this._d = null;
                return this.draw();
            }
            if (typeof date === 'string') {
                date = new Date(Date.parse(date));
            }
            if (!isDate(date)) {
                return;
            }

            var min = this._o.minDate,
                max = this._o.maxDate;

            if (isDate(min) && date < min) {
                date = min;
            } else if (isDate(max) && date > max) {
                date = max;
            }

            this._d = new Date(date.getTime());
            setToStartOfDay(this._d);
            this.gotoDate(this._d);

            if (this._o.field) {
                this._o.field.value = this.toString();
                fireEvent(this._o.field, 'change', { firedBy: this });
            }
            if (!preventOnSelect && typeof this._o.onSelect === 'function') {
                this._o.onSelect.call(this, this.getDate());
            }
        },

        /**
         * change view to a specific date
         */
        gotoDate: function(date)
        {
            var newCalendar = true;

            if (!isDate(date)) {
                return;
            }

            if (this.calendars) {
                var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1),
                    lastVisibleDate = new Date(this.calendars[this.calendars.length-1].year, this.calendars[this.calendars.length-1].month, 1),
                    visibleDate = date.getTime();
                // get the end of the month
                lastVisibleDate.setMonth(lastVisibleDate.getMonth()+1);
                lastVisibleDate.setDate(lastVisibleDate.getDate()-1);
                newCalendar = (visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate);
            }

            if (newCalendar) {
                this.calendars = [{
                    month: date.getMonth(),
                    year: date.getFullYear()
                }];
                if (this._o.mainCalendar === 'right') {
                    this.calendars[0].month += 1 - this._o.numberOfMonths;
                }
            }

            this.adjustCalendars();
        },

        adjustCalendars: function() {
            this.calendars[0] = adjustCalendar(this.calendars[0]);
            for (var c = 1; c < this._o.numberOfMonths; c++) {
                this.calendars[c] = adjustCalendar({
                    month: this.calendars[0].month + c,
                    year: this.calendars[0].year
                });
            }
            this.draw();
        },

        gotoToday: function()
        {
            this.gotoDate(new Date());
        },

        /**
         * change view to a specific month (zero-index, e.g. 0: January)
         */
        gotoMonth: function(month)
        {
            if (!isNaN(month)) {
                this.calendars[0].month = parseInt(month, 10);
                this.adjustCalendars();
            }
        },

        nextMonth: function()
        {
            this.calendars[0].month++;
            this.adjustCalendars();
        },

        prevMonth: function()
        {
            this.calendars[0].month--;
            this.adjustCalendars();
        },

        /**
         * change view to a specific full year (e.g. "2012")
         */
        gotoYear: function(year)
        {
            if (!isNaN(year)) {
                this.calendars[0].year = parseInt(year, 10);
                this.adjustCalendars();
            }
        },

        /**
         * change the minDate
         */
        setMinDate: function(value)
        {
            this._o.minDate = value;
        },

        /**
         * change the maxDate
         */
        setMaxDate: function(value)
        {
            this._o.maxDate = value;
        },

        /**
         * refresh the HTML
         */
        draw: function(force)
        {
            if (!this._v && !force) {
                return;
            }
            var opts = this._o,
                minYear = opts.minYear,
                maxYear = opts.maxYear,
                minMonth = opts.minMonth,
                maxMonth = opts.maxMonth,
                html = '';

            if (this._y <= minYear) {
                this._y = minYear;
                if (!isNaN(minMonth) && this._m < minMonth) {
                    this._m = minMonth;
                }
            }
            if (this._y >= maxYear) {
                this._y = maxYear;
                if (!isNaN(maxMonth) && this._m > maxMonth) {
                    this._m = maxMonth;
                }
            }

            for (var c = 0; c < opts.numberOfMonths; c++) {
                html += '<div class="pika-lendar">' + renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year) + this.render(this.calendars[c].year, this.calendars[c].month) + '</div>';
            }

            this.el.innerHTML = html;

            if (opts.bound) {
                if(opts.field.type !== 'hidden') {
                    sto(function() {
                        opts.trigger.focus();
                    }, 1);
                }
            }

            if (typeof this._o.onDraw === 'function') {
                var self = this;
                sto(function() {
                    self._o.onDraw.call(self);
                }, 0);
            }
        },

        adjustPosition: function()
        {
            if (this._o.container) return;
            var field = this._o.trigger, pEl = field,
            width = this.el.offsetWidth, height = this.el.offsetHeight,
            viewportWidth = window.innerWidth || document.documentElement.clientWidth,
            viewportHeight = window.innerHeight || document.documentElement.clientHeight,
            scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop,
            left, top, clientRect;

            if (typeof field.getBoundingClientRect === 'function') {
                clientRect = field.getBoundingClientRect();
                left = clientRect.left + window.pageXOffset;
                top = clientRect.bottom + window.pageYOffset;
            } else {
                left = pEl.offsetLeft;
                top  = pEl.offsetTop + pEl.offsetHeight;
                while((pEl = pEl.offsetParent)) {
                    left += pEl.offsetLeft;
                    top  += pEl.offsetTop;
                }
            }

            // default position is bottom & left
            if (left + width > viewportWidth ||
                (
                    this._o.position.indexOf('right') > -1 &&
                    left - width + field.offsetWidth > 0
                )
            ) {
                left = left - width + field.offsetWidth;
            }
            if (top + height > viewportHeight + scrollTop ||
                (
                    this._o.position.indexOf('top') > -1 &&
                    top - height - field.offsetHeight > 0
                )
            ) {
                top = top - height - field.offsetHeight;
            }
            this.el.style.cssText = [
                'position: absolute',
                'left: ' + left + 'px',
                'top: ' + top + 'px'
            ].join(';');
        },

        /**
         * render HTML for a particular month
         */
        render: function(year, month)
        {
            var opts   = this._o,
                now    = new Date(),
                days   = getDaysInMonth(year, month),
                before = new Date(year, month, 1).getDay(),
                data   = [],
                row    = [];
            setToStartOfDay(now);
            if (opts.firstDay > 0) {
                before -= opts.firstDay;
                if (before < 0) {
                    before += 7;
                }
            }
            var cells = days + before,
                after = cells;
            while(after > 7) {
                after -= 7;
            }
            cells += 7 - after;
            for (var i = 0, r = 0; i < cells; i++)
            {
                var day = new Date(year, month, 1 + (i - before)),
                    isDisabled = (opts.minDate && day < opts.minDate) || (opts.maxDate && day > opts.maxDate),
                    isSelected = isDate(this._d) ? compareDates(day, this._d) : false,
                    isToday = compareDates(day, now),
                    isEmpty = i < before || i >= (days + before);

                row.push(renderDay(1 + (i - before), month, year, isSelected, isToday, isDisabled, isEmpty));

                if (++r === 7) {
                    if (opts.showWeekNumber) {
                        row.unshift(renderWeek(i - before, month, year));
                    }
                    data.push(renderRow(row, opts.isRTL));
                    row = [];
                    r = 0;
                }
            }
            return renderTable(opts, data);
        },

        isVisible: function()
        {
            return this._v;
        },

        show: function()
        {
            if (!this._v) {
                removeClass(this.el, 'is-hidden');
                this._v = true;
                this.draw();
                if (this._o.bound) {
                    addEvent(document, 'click', this._onClick);
                    this.adjustPosition();
                }
                if (typeof this._o.onOpen === 'function') {
                    this._o.onOpen.call(this);
                }
            }
        },

        hide: function()
        {
            var v = this._v;
            if (v !== false) {
                if (this._o.bound) {
                    removeEvent(document, 'click', this._onClick);
                }
                this.el.style.cssText = '';
                addClass(this.el, 'is-hidden');
                this._v = false;
                if (v !== undefined && typeof this._o.onClose === 'function') {
                    this._o.onClose.call(this);
                }
            }
        },

        /**
         * GAME OVER
         */
        destroy: function()
        {
            this.hide();
            removeEvent(this.el, 'mousedown', this._onMouseDown, true);
            removeEvent(this.el, 'change', this._onChange);
            if (this._o.field) {
                removeEvent(this._o.field, 'change', this._onInputChange);
                if (this._o.bound) {
                    removeEvent(this._o.trigger, 'click', this._onInputClick);
                    removeEvent(this._o.trigger, 'focus', this._onInputFocus);
                    removeEvent(this._o.trigger, 'blur', this._onInputBlur);
                }
            }
            if (this.el.parentNode) {
                this.el.parentNode.removeChild(this.el);
            }
        }

    };

    return Pikaday;

}));
;
'use strict';

angular.module('angularPikaday', [])
  .directive('pikaday', function() {
  return {
    restrict: 'A',
    scope: {
      pikaday: '='
    },
    link: function (scope, elem, attrs) {

      var picker = new Pikaday({

        field: elem[0],
        trigger: document.getElementById(attrs.triggerId),
        bound: attrs.bound !== 'false',
        position: attrs.position || '',
        format: attrs.format || 'ddd MMM D YYYY', // Requires Moment.js for custom formatting
        defaultDate: !attrs.defaultDate || moment(attrs.defaultDate, attrs.format).toDate(),
        setDefaultDate: attrs.setDefaultDate === 'true',
        firstDay: attrs.firstDay ? parseInt(attrs.firstDay) : 0,
        minDate: !attrs.minDate || moment(attrs.minDate, attrs.format).toDate(),
        maxDate: !attrs.maxDate || moment(attrs.maxDate, attrs.format).toDate(),
        yearRange: attrs.yearRange ? JSON.parse(attrs.yearRange) : [1930, new Date().getFullYear() + 84], // Accepts int (10) or 2 elem array ([1992, 1998]) as strings
        isRTL: attrs.isRTL === 'true',
        i18n: {
          previousMonth : 'Previous Month',
          nextMonth     : 'Next Month',
          months        : ['January','February','March','April','May','June','July','August','September','October','November','December'],
          weekdays      : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
          weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
        },
        yearSuffix: attrs.yearSuffix || '',
        showMonthAfterYear: attrs.showMonthAfterYear === 'true',

        onSelect: function () {
          setTimeout(function(){
            scope.$apply();
          });
        }
      });
      scope.pikaday = picker;

      scope.$on('$destroy', function () {
        picker.destroy();
      });

      // re-adjust position after change
      $( window ).on( "orientationchange", function( event ) {
          setTimeout(function(){
              picker.adjustPosition();
          },500);
      });

    }
  };
});
;
/*
Version: 2.1.5
Date:2017-01-06
 */
/**
 Bootstrap
**/
(function (exports) {
    var ns = 'app';
    exports[ns] = angular.module(ns, ['angularPikaday', 'ui.utils.masks', 'ngResource', 'ngSanitize', 'webchatApp.callback', 'webchatApp.webchat']);
}((typeof exports === 'undefined') ? window : exports));


/**
 *  change angular from {{ to [[
 */
(function (exports) {
    (function (exports) {
        exports.config(['$interpolateProvider', function ($interpolateProvider) {
            $interpolateProvider.startSymbol('[[').endSymbol(']]');
        }]);
    })((typeof exports === 'undefined') ? window : exports);
})(app);







;
/**
 * FACTORY - Dt Readi Map Factory
 * Map model managing data to all readi directives gets request marker data from service.
 */
(function(module) {
    module.factory('dtRediMapFactory', ['$q', '$http', 'EventService', '$timeout',  function($q, $http, EventService, $timeout) {

        /**
         * Properties
         * @type {Array}
         * @private
         */
        var _mapCallback,
        	_markers = {data: {
                "GetAtmsByLocationResult": [

                    {
                        "Latitude": "-33.8592593",
                        "Longitude": "151.207865",
                        "ShopName": "Clocktower Shopping Centre",
                        "Name": "The Rocks",
                        "Address": "35 Harrington Street",
                        "Suburb": "The Rocks",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Distance": "164 meters",
                        "DepositCapability": "No",
						"OpeningClosingTimes": "Business Hours"
                    },
                    {
                        "Latitude": "-33.86162",
                        "Longitude": "151.2111",
                        "ShopName": "Circular Quay 2",
                        "Name": "Sydney",
                        "Address": "Alfred Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "Westpac",
                        "Distance": "200 kms",
                        "DepositCapability": "Yes",
						"OpeningClosingTimes": "SetHours/ 24/7"
                    },
                    {
                        "Latitude": "-33.86162",
                        "Longitude": "151.2111",
                        "ShopName": "Circular Quay 1",
                        "Name": "Sydney",
                        "Address": "Alfred Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Distance": 239.13851509658264
                    },
                    {
                        "Latitude": "-33.86259",
                        "Longitude": "151.21154",
                        "ShopName": "AMP Plaza",
                        "Name": "Sydney",
                        "Address": "50 Bridge Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 349.56588382192228
                    },
                    {
                        "Latitude": "-33.8643145",
                        "Longitude": "151.2115936",
                        "ShopName": "Governor Phillip Tower",
                        "Name": "Sydney",
                        "Address": "1 Farrer Place",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 521.20348952916481
                    },
                    {
                        "Latitude": "-33.8645483",
                        "Longitude": "151.2073834",
                        "ShopName": "Australia Square",
                        "Name": "Sydney",
                        "Address": "264 George Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 539.4008904828554
                    },
                    {
                        "Latitude": "-33.864861",
                        "Longitude": "151.20905",
                        "ShopName": "10 Spring Street",
                        "Name": "Sydney",
                        "Address": "10 Spring Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 541.95122090793711
                    },
                    {
                        "Latitude": "-33.86473",
                        "Longitude": "151.20676",
                        "ShopName": "Metcentre",
                        "Name": "Sydney",
                        "Address": "273 George Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 580.19444828640542
                    },
                    {
                        "Latitude": "-33.85753338",
                        "Longitude": "151.21494054",
                        "ShopName": "Sydney Opera House",
                        "Name": "Sydney",
                        "Address": "Macquarie Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 580.98607453074032
                    },
                    {
                        "Latitude": "-33.8648987",
                        "Longitude": "151.2070098",
                        "ShopName": "Metcentre2",
                        "Name": "Sydney",
                        "Address": "273 George Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 588.22876697028653
                    }
                ]
            }
            };


        /**
         * Events for dispatching
         * @type {{ON_DATA_UPDATE: string, ON_MAP_POSITION_UPDATE: string}}
         */
        var events = {
            ON_DATA_UPDATE: 'dt.redi.map.factory.on.data.update',
            ON_MAP_POSITION_UPDATE: 'dt.redi.map.factory.on.map.position.update'
        };

        /**
         * Return markers
         * @returns {Array}
         */
        function getMakers() {
            return _markers.data;
        };

        /**
         * Set map to specific location
         * @param obj
         */
        function showDirection(obj) {
            if(angular.isUndefined(obj)) return;
            EventService.dispatch(events.ON_MAP_POSITION_UPDATE, obj);
            // when a item in the menu is clicked we also open the infoWindow for the marker
            if (obj.marker) {
            	new google.maps.event.trigger(obj.marker, 'click');
            	obj.marker.setZIndex(google.maps.Marker.MAX_ZINDEX + 1);
            }
        };

        /**
         * Ajax request for new location dataset
         */
        function requestLocation(obj, apiURL) {
            if(angular.isUndefined(apiURL)) throw  'Require apiURL';
            if(angular.isUndefined(obj)) throw 'Request object required';

           $http({
                method: 'POST',
                url: apiURL,
                data: JSON.stringify(obj),
                responseType: 'JSON'
           }).then(
                function (data) {
                  var result =  angular.fromJson(JSON.parse(data.data));
                   EventService.dispatch(events.ON_DATA_UPDATE, { status: 'success', result: result});
               },
               function(e) {
                   EventService.dispatch(events.ON_DATA_UPDATE, { status: 'error', result: {}});
               }
           );
        };

        /**
         * Public accessor
         */
        return {
            getMakers: getMakers,
            showDirection: showDirection,
            requestLocation: requestLocation,
            events: events
        };
    }]);
} (app));







/**
 * DIRECTIVE - DT Readi Search -
 */
(function(module) {
    module.directive('dtRediSearch', ['dtRediMapFactory','GeoService', function(dtReadiMapFactory, GeoService) {
        return {
            restrict: 'A',
            scope: true,
            controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                //Todo - need validation requirements.

                /**
                 * Search field model
                 * @type {string}
                 */
                $scope.searchResult;

                /**
                 * HTML5 Lat long - applied here due to be the core component for all location request to api.
                 * (OPTIONAL FEATURE)
                 */
                GeoService().then(function(position) {
                    if(angular.isUndefined(position)) return;
                    makeRequestByLatLon(position);
                });

                /**
                 * Provide lat lon this would occur from geoservice.
                 * @param latlon
                 */
                function makeRequestByLatLon(latlon) {
                    if(angular.isUndefined(latlon)) throw 'Lat Lon required';
                    dtReadiMapFactory.requestLocation(latlon, $attrs.apiLatlonUrl);
                };


                /*
                Initiate Google place insert reference from the input element.
                 */
                if(angular.isUndefined($attrs.inputEl)) throw 'Please specify Input element';
                var inputEl = $element.find($attrs.inputEl);


                var opt = {
                    componentRestrictions: {country: "au"}
                };
                var autocomplete = new google.maps.places.Autocomplete(inputEl[0], opt);

                // over ride event listeners on input so we can detect enter key and select first item from dropdown
                (function pacSelectFirst(input) {
                    // store the original event binding function
                    var _addEventListener = (input.addEventListener) ? input.addEventListener : input.attachEvent;

                    function addEventListenerWrapper(type, listener) {
                        // Simulate a 'down arrow' keypress on hitting 'return' when no pac suggestion is selected,
                        // and then trigger the original listener.
                        if (type == "keydown") {
                            var orig_listener = listener;
                            listener = function(event) {
                                var suggestion_selected = $(".pac-item-selected").length > 0;
                                if (event.which == 13 && !suggestion_selected) {
                                    var simulated_downarrow = $.Event("keydown", {
                                        keyCode: 40,
                                        which: 40
                                    });
                                    orig_listener.apply(input, [simulated_downarrow]);
                                }

                                orig_listener.apply(input, [event]);
                            };
                        }

                        _addEventListener.apply(input, [type, listener]);
                    }

                    input.addEventListener = addEventListenerWrapper;
                    input.attachEvent = addEventListenerWrapper;
                    autocomplete = new google.maps.places.Autocomplete(input, opt);

                })(inputEl[0]);

                /**
                 * Reset the input value on focus
                 */
                inputEl.attr("data-previous-value","");
                inputEl.on("focus", function() {
                    var $el = $(this);
                    $el.attr("data-previous-value", $el.val()).val("");
                }).on("blur", function() {
                    var $el = $(this);
                    $el.val($el.attr("data-previous-value")).attr("data-previous-value","");
                });

                /**
                 * Event - User enters location
                 */
                google.maps.event.addListener(autocomplete, 'place_changed', function() {

                    var place = autocomplete.getPlace();
                    // console.log('place', place);
                    if (!place.geometry) {
                		return;
                    }

                    //Todo - validate if this is the correct lat, lng
                    var obj = {
                        lat:    place.geometry.location.lat(),
                        lng:    place.geometry.location.lng()
                    };

                    makeRequestByLatLon(obj);
                });






                $scope.isInputInvalid = function(type, requirement) {
                    return $scope.formSearch[type].$error[requirement] && !$scope.formSearch[type].$pristine;
                };

                /**
                 * Return ture if the form is invalid
                 * @returns {boolean|Oc.$invalid|*|Ue.$invalid|Ue.$setValidity.$invalid|FormController.$invalid}
                 */
                $scope.isSearchInvalid = function() {
                    return $scope.formSearch.$invalid;
                };

            }]
        };
    }]);
} (app));




/**
 * DIRECTIVE - DT Readi Map - Display google map with locations of Readi ATM's.
 * Display custom pins.
 */
(function(module) {
    module.directive('dtRediMap', ['dtRediMapFactory',  function(dtReadiMapFactory) {
        return {
            restrict: 'A',
            scope: { markerIcon: '@', mapZoom: '@' },
            controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                //Todo - 2. Suburb / Postcode request field / create service to make request with required param

                var _isInit = true;

                /**
                 * Generate map instance
                 * @type {exports.ecmaIdentifiers.Map}
                 * @private
                 */
                var _mapInstance = _getMapInstance($element[0]), _markerCollection;


                // marker arrays, used to store marker points so we can clear when re-drawing data
                var markersArray = [];
                // array of info windows for each marker
                var infoWindowArray = [];


                /**
                 * EVENT - ON DATA UPDATE
                 */
                $scope.$on(dtReadiMapFactory.events.ON_DATA_UPDATE, function(e, value) {
                	if(value.status === 'success') {
                        if(angular.isUndefined(value.result.data)) return;

                        _markerCollection = value.result.data;

                        // Apply markers onto map based on request, this needs to be hooked up to a service.
                        _applyMarkers(_mapInstance, _markerCollection, $scope.markerIcon);

                    } else {
                		/*// console.log("Test Data", dtReadiMapFactory.getMakers().GetAtmsByLocationResult);
                		_markerCollection = dtReadiMapFactory.getMakers();
                		_applyMarkers(_mapInstance, _markerCollection.GetAtmsByLocationResult, $scope.markerIcon);*/
                    }
                });




                /**
                 * Event - Map position update
                 */
                $scope.$on(dtReadiMapFactory.events.ON_MAP_POSITION_UPDATE, function(e, value) {
                    var lat = value.Latitude, lon = value.Longitude;
                    _setMapPosition(_mapInstance, lat, lon);
                    _setMapZoom(_mapInstance, parseInt($scope.mapZoom));
                });




                /**
                 * Return instance of map
                 * @param element
                 * @param options
                 * @returns {exports.ecmaIdentifiers.Map}
                 * @private
                 */
                function _getMapInstance(element, options) {
                    if(typeof google === 'undefined') return;
                    var currentOptions,
                        defaultOptions = {
                            zoom: 4,
                            center: new google.maps.LatLng( -28, 134),
                            panControl: true,
                            zoomControl: true,
                            mapTypeControl: false,
                            scaleControl: false,
                            streetViewControl: false,
                            overviewMapControl: false
                        };
                    options = options || {};
                    currentOptions = angular.extend(defaultOptions, options);
                    return  new google.maps.Map(element, currentOptions);
                };



                /**
                 * Set position of map
                 * @param map
                 * @param lat
                 * @param lon
                 * @private
                 */
                function _setMapPosition(map,lat, lon) {
                    if(angular.isUndefined(map)) throw 'Map instance required';
                    if(angular.isUndefined(lat)) throw 'Require Lat value';
                    if(angular.isUndefined(lon)) throw 'Require Lon Value';
                    map.setCenter(new google.maps.LatLng( lat, lon ));
                };


                /**
                 * Set zoom position from 0 - 20
                 * @param map
                 * @param zoom
                 * @private
                 */
                function _setMapZoom(map, zoom) {
                    if(angular.isUndefined(map)) throw 'Map instance required';
                    if(angular.isUndefined(zoom)) throw 'Require Map zoom value';
                    map.setZoom(zoom);
                };


                /**
                 * Apply markers to map,
                 * @param map
                 * @param collection
                 * @param icon
                 * @private
                 */
                function _applyMarkers(map, collection, icon, shadow) {
                    if(angular.isUndefined(collection)) throw 'Marker collection required';

                    // clear markers already added to the map
                    _clearOverlays();

                    angular.forEach(collection, function(item, index) {
                        var latLon = getGoogleLatLon(item.Latitude, item.Longitude);
                        // icon name replaces <number> with the index value
                        var iconName = icon.replace("<number>", (index+1));
                        var marker = _addIcon(map, latLon, iconName, item);
                        markersArray.push(marker);
                        item.marker = marker;
                    });

                };

                /**
                 * Apply map icon to map
                 * @param map
                 * @param obj
                 * @private
                 */
                function _addIcon (map, latlon, icon, item) {
                    if(angular.isUndefined(latlon)) throw 'Google LatLon Instance required';
                    if(angular.isUndefined(map)) throw 'Map instance required';
                    if(angular.isUndefined(google)) throw 'Google library required';

                    // shape of clickable region
                    var shape = {
						coords: [0,21,22,0,42,22,22,46],
						type: 'poly'
					};
					// marker information
                    var marker = new google.maps.Marker({
                        position: latlon,
                        map: map,
                        icon: icon,
      					shape: shape
                    });

                    //console.log('item', item);

                    var contentStringRdr,
                    	openningAndDeposit = "",
                    	_depositCapability = (item.DepositCapability) ? '<b>Accepts Deposits:</b> ' + item.DepositCapability + '<br>' : "",
                    	_openningClosingTimes = (item.OpeningClosingTimes) ? '<b>Opening Times:</b> ' + item.OpeningClosingTimes + '<br>' : "",
                        _source = (item.Source) ? 'This ATM is operated by ' + item.Source + '<br>' : "";

                     if (_depositCapability || _openningClosingTimes) {
                     	openningAndDeposit = '<p>' +
		                	_depositCapability+
		                	_openningClosingTimes+
		                	'</p>';
                     }
                	contentStringRdr = '<div class="pl26-redi-marker">'+
		                '<h2 class="pl26-redi-marker-shopname">' + item.ShopName + '</h2>'+
		                '<div class="pl26-redi-marker-content">'+
		                	'<p>' + item.Address + '<br>'+
		                	item.Suburb + ' ' + item.State + ' ' + item.ZipCode + '</p>'+
		                	'<p>' + item.Distance + '</p>'+
		                	openningAndDeposit +
		                	'<p>' +
		                	_source+
		                	'</p>'+
		                '</div>'+
	                '</div>';

                    // console.log(_source, _depositCapability, _openningClosingTimes);

		            var infowindow = new google.maps.InfoWindow({
		                content: contentStringRdr
		            });
		            infoWindowArray.push(infowindow);

                    // marker click
                    google.maps.event.addListener(marker, 'click', function() {
	                       // console.log('marker', marker);
	                       // map.setCenter(marker.getPosition());
						   _closeInfoWindows();
						   infowindow.open(map, marker);
						   // var markerPosition = marker.getPosition();
						   // 	var location = new google.maps.LatLng(markerPosition.lat(), markerPosition.lng() - .0001);
						   // 	map.panTo(location);
						   //
	                });
	                // marker hover
	                google.maps.event.addListener(marker, 'mouseover', function() {
	                       marker.setZIndex(google.maps.Marker.MAX_ZINDEX + 1);
	                });
                    return marker;

                };

                function _closeInfoWindows() {
                  for (var i=0; i<infoWindowArray.length; i++) {
                     infoWindowArray[i].close();
                  }
                }

                /**
                 * Clear map markers
                 * @param map
                 * @param obj
                 * @private
                 */
                function _clearOverlays () {
                    for (var i = 0; i < markersArray.length; i++ ) {
                        markersArray[i].setMap(null);
                    }
                    markersArray.length = 0;
                };

                /**
                 * Return google readable lat lon / May not need this.
                 * @param lat
                 * @param lon
                 * @returns {google.maps.LatLng}
                 */
                function getGoogleLatLon(lat, lon) {
                    if(angular.isUndefined(google)) throw 'Google library required';
                    return  new google.maps.LatLng(lat, lon);
                }


            }]
        };
    }]);
} (app));





/**
 * DIRECTIVE - DT Read List - Display list of locations
 * User can select list item and map will update to reflect location.
 */
(function(module) {
    module.directive('dtRediList', ['dtRediMapFactory', '$timeout',  function(dtReadiMapFactory, $timeout) {
        return {
            restrict: 'A',
            scope:false,
            controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                // Number of address per view
                $scope.itemsPerView = 3;

                // View state for more button
                $scope.isMore = true;
                $scope.isActive = false;

                $scope.markers = [];




                /**
                 * EVENT - ON DATA UPDATE
                 */
                $scope.$on(dtReadiMapFactory.events.ON_DATA_UPDATE, function(e, value) {
                    if(value.status === 'success') {

                        if(angular.isUndefined(value.result.data)) return;

                        $scope.markers = value.result.data;

                        //Make list visible when results are available.
                        $scope.isActive = true;

                        _determineLimitRange();
                        _setDefaultLocation();
                    } else {
                		/*// console.log("Test Data", dtReadiMapFactory.getMakers().GetAtmsByLocationResult);

                		$scope.markers = dtReadiMapFactory.getMakers().GetAtmsByLocationResult;

                		//Make list visible when results are available.
                		$scope.isActive = true;

                		_determineLimitRange();
                		_setDefaultLocation();*/
                    }
                });



                /**
                 * Show directions on map
                 */
                $scope.showDirections = function(e) {
                    dtReadiMapFactory.showDirection(this.item);
                    e.preventDefault();
                };


                /**
                 * Show more results
                 */
                $scope.showMore = function(event) {
                    _incrementLimitRange();
                    event.preventDefault();
                };

                /**
                 * In
                 * @returns {number}
                 */
                $scope.limit = function() {
                    var totalAmount = $scope.currentViews * $scope.totalViews;
                    return totalAmount;
                };

                /**
                 * Show default location, being the first in the marker index.
                 */
                function _setDefaultLocation() {
                    dtReadiMapFactory.showDirection( $scope.markers[0]);
                };

                /**
                 * Determine limit ragne
                 */
                function _determineLimitRange() {
                    // Total amount of views to manage
                    $scope.totalViews = Math.ceil($scope.markers.length / $scope.itemsPerView);
                    $scope.currentViews = 1;
                };

                /**
                 * Incremenet range.
                 */
                function _incrementLimitRange() {
                    //Increment the view count
                    $scope.currentViews += 1;

                    //Check if views has reached limit, minus one to prevent the more option to appear on final.
                    if($scope.currentViews >= ($scope.totalViews - 1)) {
                        //Set currentViews to total views
                        $scope.currentViews = $scope.totalViews;
                        //Hide show more button
                        $scope.isMore = false;
                    }
                };


            }]
        };
    }]);
} (app));


/**
 * Levarege HTML5 is supported to get position
 */
(function(module) {
    module.factory('GeoService', ['$q',function($q) {

        var _deferred = $q.defer();

        return function() {
            if (Modernizr.geolocation) {

                //Todo - determine if prefix is required for browser that are supported.
                navigator.geolocation.getCurrentPosition(function(position) {
                    var obj = {
                        lat: position.coords.latitude,
                        lng: position.coords.longitude
                    };

                    _deferred.resolve(obj);
                });
            } else {
                // no native support; maybe try a fallback?
                _deferred.reject();
            }
            return _deferred.promise;
        }
    }]);
} (app));
;


(function(module) {
    module.directive('calendarEvent', ['$compile', function($compile) {
        return {
            restrict: 'A',
            scope: false,
            terminal: true,
            priority: 1000,
            link: function($scope, $element, $attrs) {

                var targetPikadayEl = $element.find('[data-pikaday]'),
                    defaultDaysBetween = parseInt($attrs.defaultDays) || 30,
                    dateFormat = 'D/M/YYYY';

                //From Date
                angular.element(targetPikadayEl[0]).attr('data-default-date', moment().format(dateFormat));

                //To Date
                angular.element(targetPikadayEl[1]).attr('data-default-date', moment().add(defaultDaysBetween, 'days').format(dateFormat));
                $attrs.$set('data-ng-controller' , 'CalendarEventCtrl');
                $element.removeAttr('data-calendar-event');
                $compile($element)($scope);
            }
        }
    }]);
} (app));


/**
 * Directive to manage event list
 */
(function(module) {
    module.directive('calendarEventList', ['CalendarEventService', function(CalendarEventService) {
        return {
            restrict: 'A',
            scope: false,
            link: function($scope) {

                /**
                 * Event - on data update
                 */
                $scope.$on(CalendarEventService.events.ON_DATA_UPDATE, function(e, data) {
                    $scope.collection = data.result;
                });
            }
        }
    }]);
} (app));







/**
 * Filter for custom dates
 */
(function(module) {
    module.filter('event', [function() {
        return function(input, format) {
            if(angular.isUndefined(moment)) throw 'Moment.js required';
            var formatDate = moment(input.substr(0,input.search('T'))).format(format);
            return formatDate;
        }
    }]);
} (app));




//Controller
(function(module) {
   module.controller('CalendarEventCtrl', ['$scope', '$attrs', 'CalendarEventService', function($scope, $attrs,  CalendarEventService) {


       if(angular.isUndefined($attrs.apiUrl)) throw 'Define Events API To make request';

       /**
        * Models to capture dates
        * @type {string}
        */
       $scope.eventSelectModel = '';
       $scope.eventStateRegionsModel = '';

       /**
        * Event - on submit
        * @param e
        */
        $scope.onRequestEvents = function(e) {
            var obj = {
                type:  $scope.eventSelectModel,
                state:  $scope.eventStateRegionsModel,
                from: '\/Date(' + new Date( $scope.fromDatePicker._d).getTime() + ')\/' ,
                to: '\/Date(' + new Date( $scope.toDatePicker._d).getTime() + ')\/'
            };
            CalendarEventService.getEvents(obj, $attrs.apiUrl);
            if(angular.isUndefined(e)) return;
            e.preventDefault();
        };

       /**
        * Listen for date picker to be instantiated the initiate requst as default.
        */
        var unbindWatch = $scope.$watch('fromDatePicker._d', function(value) {
            if(angular.isUndefined(value)) return;
            setTimeout(function() {
                // only trigger the watch for the first occurence
                unbindWatch();
            }, 10);
            $scope.onRequestEvents();

        }, true);


   }]);

} (app));



//Directive
(function(module) {
    module.directive('calendarEventSelect', ['$timeout', function($timeout) {
        return {
            restrict: 'A',
            require: 'select',
            scope: {
                calendarEventSelect: '='
            },
            link: function($scope, $element) {
                if(angular.isUndefined($scope.calendarEventSelect)) throw 'Please define model';


                $scope.calendarEventSelect = $element[0].value;
                /**
                 * Native event for select change.
                 * @param e
                 */
                $element[0].onchange = function(e) {
                    var scope = this;
                    $timeout(function() {
                        $scope.calendarEventSelect  = scope.value;
                    });
                };
            }

        }
    }]);
} (app));






//CalendarEventService
(function(module) {

    module.factory('CalendarEventService', ['$http', 'EventService',  '$timeout', function($http, EventService, $timeout) {

        /**
         * Events
         * @type {{ON_DATA_UPDATE: string}}
         */
        var events = {
          ON_DATA_UPDATE: 'dt.calender.event.service.on.data.update'
        };


//        var _dummyData = {
//            "data":[
//                {
//                    "EventType":"Mobile Office",
//                    "Date":"2014-09-24T01:00:00",
//                    "TimeRange":"1.00 - 7.30 pm",
//                    "Address1":"Kareela Golf and Social Club",
//                    "Address2":"Bates Drive, Kareela, New South Wales, Australia",
//                    "LinkUrl":"",
//                    "LinkTitle":"Find out more"
//                },
//                {
//                    "EventType":"Community Event",
//                    "Date":"2014-09-25T02:00:00",
//                    "TimeRange":"2.00 - 11.00 pm",
//                    "Address1":"C.ex Coff's1",
//                    "Address2":"Vernon StCoffs Harbour NSW 2450Australia",
//                    "LinkUrl":"https://www.google.com/maps/place/C.ex+Coff's/@-30.295556,153.114912,17z/data=!3m1!4b1!4m2!3m1!1s0x6b9c0db4ab75e0f5:0x9f1c207992ede243",
//                    "LinkTitle":"Find out more"
//                },
//                {
//                    "EventType":"Business Centre",
//                    "Date":"2014-09-23T12:37:00",
//                    "TimeRange":"12.37 - 7.00 am",
//                    "Address1":"Nambucca Heads Rsl Club",
//                    "Address2":"Nelson Street, Nambucca Heads, New South Wales, Australia",
//                    "LinkUrl":"https://www.google.com/maps/place/Nambucca+Heads+Rsl+Club/@-30.645302,153.003182,17z/data=!3m1!4b1!4m2!3m1!1s0x6b9c2ff9d6890ee3:0x8e051993bfdfa670",
//                    "LinkTitle":"Find out more"
//                }
//            ]
//        };

        /**
         * Retreive events from http;
         * @param from
         * @param to
         */
        function getEvents(obj, apiURL) {

            if(angular.isUndefined(apiURL)) throw  'Require apiURL';
            if(angular.isUndefined(obj)) throw 'Request object required';


//            $timeout(function() {
//                EventService.dispatch(events.ON_DATA_UPDATE, { status: 'succss', result: _dummyData.data});
//            }, 500);

            $http({
                method: 'POST',
                url: apiURL,
                data: JSON.stringify(obj),
                responseType: 'JSON'
            }).then(
                function(data) {
                    var result = angular.fromJson(JSON.parse(data.data));
                    EventService.dispatch(events.ON_DATA_UPDATE, { status: 'success', result: result.data});
                    setTimeout(function(){
                    var currentTop = $(window).scrollTop(); // Fixes the fix below, which was causing IE10 to scroll to the up after clicking submit
                    $("body").hide(0).show(); // fixes bug on ie9/10 where page height is not being rendered correctly after new events loaded
                    $(window).scrollTop(currentTop);
                    },10);
                },
                function(e) {
                    EventService.dispatch(events.ON_DATA_UPDATE, { status: 'error', result: {}});
                }
            );
        };



        /**
         * Public accessor
         */
        return {
            events:events,
            getEvents: getEvents,
        }
    }]);
} (app));;


(function(module) {
    module.factory('EventService', ['$rootScope', function($rootScope) {
        return {
            dispatch: function(type, value) {
                if(angular.isUndefined(type)) throw 'Namespace required';
                return $rootScope.$broadcast(type, value);
            }
        }
    }]);
} (app));



(function(module) {
    module.directive('dtEnter', [function() {
        return {
            restrict: 'A',
            scope: false,
            link: function($scope, $element, $attrs) {
                $element.bind("keydown keypress", function(event) {

                    if(event.which === 13) {
                        $scope.$apply(function () {
                            $scope.$eval($attrs.dtEnter);
                        });
                        event.preventDefault();
                    }
                });
            }
        }
    }]);
} (app));;
/**
 * Manages the scope of the form.
 */
(function (module) {
    module.controller('FormCtrl', ['$scope', '$element', '$timeout',  function ($scope, $element, $timeout) {

        /**
         * Return false if the entire form group is invalid.
         * @returns {boolean}
         */
        $scope.isInvalid = function () {
            return $scope.formGroup.$invalid;
        };


        /**
         *  Force validation of all form elements.
         */
        $scope.validateForm = function(e) {

            setAllInputsDirty($scope);

            if($scope.formGroup.$invalid) {
                // Focus on the first field that is invalid, and scroll to
                focusOnFirstInvalid();
                e.preventDefault();
            }
        };

        /**
         * Reset form for all information in the model.
         */
        $scope.reset = function(e) {
            e.preventDefault();
                var collectionEl = $element.find('[name]');
                angular.forEach(collectionEl, function(el) {
                    el = angular.element(el);
                    el.val('');
                });
        };


        /**
         *
         */
        function initiateKeyPressListener() {
            $element.keypress(function(e) {
                if(e.which == 13) {
                    $timeout(function() {
                        $scope.validateForm(e);
                    });
                }
            });
        }



        // Focus on the first field that is invalid, and scroll to
        function focusOnFirstInvalid() {
            // Focus on the first field that is invalid, and scroll to
            var $firstInvalidEl = $element.find('.ng-invalid').first();
            if ($firstInvalidEl.length){
                $(window).scrollTop($firstInvalidEl.offset().top - 40);
                $firstInvalidEl.focus();
            }
        }

        function setAllInputsDirty(scope) {

            angular.forEach(scope, function(value, key) {

                // We skip non-form and non-inputs
                if (!value || value.$dirty === undefined) {
                    return;
                }

                // Recursively applying same method on all forms included in the form
                if (value.$addControl) {
                    return setAllInputsDirty(value);
                }
                // Setting inputs to $dirty, but re-applying its content in itself
                if (value.$setViewValue) {
                    value.$setDirty();
                    return value.$setViewValue(value.$viewValue);
                }
            });
        }



        initiateKeyPressListener();

    }]);
}(app));

/**
 * data-form-date-duration directive manages display if with 2 years of current date.
 * Example: <div    data-form-date-Duration
 *                  data-form-date-begin="input_1Model"
 *                  data-form-date-end=""
 *                  data-form-date-result="dateModel">
 *         </div>
 */
(function(module) {
    module.directive('formDateDuration', [function() {
        return {
            restrict: 'A',
            scope: {formDateBegin: '=', formDateEnd: '=', formDateResult: '='},
            controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                /**
                 * Event - start date update
                 */
                $scope.$watch('formDateBegin', function(newVal) {
                    getDuration();
                });

                /**
                 * Event - end date update
                 */
                $scope.$watch('end', function(newVal) {
                    getDuration();
                });


                /**
                 * Get begin and end date determine the difference in years
                 */
                function getDuration() {
                    var dateFormat = 'DD/MM/YYYY';
                    var startDate = $scope.formDateBegin || "";
                    var endDate = $scope.formDateEnd || moment().format(dateFormat);

                    var startM = moment(startDate, dateFormat),
                        endM = moment(endDate, dateFormat);

                    if(startM > endM) {
                        $scope.formDateResult = 0;
                        return;
                    }else{
                        $scope.formDateResult = Math.ceil(endM.diff(startM, 'years', true));
                    }

                }
            }]
    }
}]);
} (app));


/**
 * Dynamically apply 'data-ng-form', 'name="formGroup" and 'data-ng-controller='FormCtrl'
 * Keeps it clean and re-usable for integration
 */
(function(module) {
    module.directive('formController', ['$compile',
        function($compile) {
            return {
                restrict: 'A',
                terminal: true,
                priority: 1000,
                link: function link(scope,element, attrs) {
                    //Apply required attributes for from to work
                    attrs.$set('dataNgForm', '');
                    attrs.$set('name', 'formGroup');
                    attrs.$set('dataNgController', 'FormCtrl');
                    //Remove directive
                    element.removeAttr('data-form-controller');
                    //Compplie
                    $compile(element)(scope);
                }
            }
        }
    ]);
}(app));





/*
 * QAS Address Lookup directive
 */
(function(module) {
    module.directive('formInputQasController', ['qasService', function(qasService) {
        return {
            restrict: 'A',
            scope: true,
            controller: ['$scope', '$element', '$attrs', '$timeout', function($scope, $element, $attrs, $timeout) {

                $scope.isQASActive = true;
                $scope.isQASPOBoxActive = false;
                $scope.isQASResultsActive = false;


                if($attrs.formInputQasController.length > 0) {
                    //Convert from json to array
                    $scope[$attrs.qasAddressModel] = JSON.parse($attrs.formInputQasController);
                }


                /*
                 * Pre-populated address should be expanded by default but
                 * we need to check the QAS model field for the value.
                 */
                var targetEl = $element.find('[name]');
                if (targetEl.val() !== '' ) {
                    $scope.isQASActive = false;
                }

                /**
                 * Watch model update
                 */
                $scope.$watch('qasModel', function(newVal) {

                    if(angular.isUndefined(newVal)) return;
                    if ( newVal.length >= 4 ) {
                        $scope.initialValue = newVal;
                        // timeout removed because it was breaking functionality...

                        qasLookup($attrs.qasRequesturi, { address: newVal, includePobox: ($attrs.qasIncludePoBox === 'true') });

                    } else {
                        // if there is no search hide the output and clear the result
                        $scope.qasResult = '';
                        $scope.isQASResultsActive = false;
                    }

                });


                /**
                 * PO Box form will show if specified targetAttr is defined.
                 *
                 * @param targetAttr
                 * @param e
                 */
                $scope.qasAddAttr = function(targetAttr, e) {
                    $scope[$attrs.qasAddressModel] = $scope[$attrs.qasAddressModel] || {};
                    $scope[$attrs.qasAddressModel][targetAttr] = '';
                    clearObject();
                    e.preventDefault();
                };

                /**
                 * Street address will show if PO Box attribute is undefined.
                 *
                 * @param targetAttr
                 * @param e
                 */
                $scope.qasRemoveAttr = function(targetAttr, e) {
                    delete $scope[$attrs.qasAddressModel][targetAttr];
                    clearObject();
                    e.preventDefault();
                };


                /**
                 * Clear details in object when switching between Street address and Po Box to keep a consistent experience.
                 * By deleting the PO-Box attribute user will receive in concistent experience all other form elements would have in formation apart from PO -Box
                 */
                function clearObject() {
                    if(angular.isUndefined( $scope[$attrs.qasAddressModel])) return;
                    var obj = $scope[$attrs.qasAddressModel],
                        newObj = {};

                    for(var item in obj) {
                        var attr = obj[item];
                        newObj[item] = '';
                    }
                    $scope[$attrs.qasAddressModel] = angular.extend(obj, newObj)
                };


                /**
                 * Return true or false if Attribute on object is defined.
                 */
                $scope.qasAttrActive = function(targetAttr) {
                    if(angular.isUndefined($scope[$attrs.qasAddressModel])) return false;
                    if(angular.isUndefined($scope[$attrs.qasAddressModel][targetAttr])) return false;
                    return true;
                };



                /**
                 * Request address
                 */
                $scope.qasRequestAddress = function(e) {
                    var value = this.item.moniker,
                        valueText = this.item.text;
                    qasAddressDetail($attrs.qasMonikeruri, { moniker: value, text: valueText });
                    e.preventDefault();
                };

                /*
                 * Enter address manually
                 */
                $scope.qasManualAddress = function(e) {
                    $scope[$attrs.qasAddressModel] = {};
                    $scope.isQASActive = false;
                    e.preventDefault();
                };

                /*
                 * Address Lookup
                 */
                $scope.qasAddressLookup = function(e) {
                    $scope.isQASActive = true;
                    $scope.isQASResultsActive = false;
                    e.preventDefault();
                };

                /*
                 * Keyboard navigation
                 */
                $scope.qasKeyboard = function(e) {
                    $scope.keyPressed = (e.keyCode ? e.keyCode : e.which);
                    if ($scope.keyPressed === 38 || $scope.keyPressed === 40) {
                        if ($scope.keyPressed === 40) {
                            nextItem();
                        }
                        if ($scope.keyPressed === 38) {
                            prevItem();
                        }
                    }

                    if ($scope.keyPressed === 13) {
                        $timeout(function() {
                            $scope.currentItem.triggerHandler('click');
                        });
                    }
                };

                /*
                 * Keyboard navigation - move down...
                 */
                function nextItem(first) {
                    var $active = $element.find('ul li.is-active');
                    if (!$active.length) {
                        $scope.currentItem = $element.find('ul li:first-child');
                    } else {
                        $scope.currentItem = $active.next().length ? $active.next() : $element.find('ul li:first-child');
                    }
                    $active.removeClass('is-active');
                    $scope.currentItem.addClass('is-active');
                    targetEl.val($scope.currentItem.text());
                }

                /*
                 * Keyboard navigation - move up...
                 */
                function prevItem() {
                    var $active = $element.find('ul li.is-active'),
                        reset = false;
                    if (!$active.prev().length) {
                        reset = true;
                        $scope.currentItem = undefined;
                    } else {
                        $scope.currentItem = $active.prev();
                    }
                    if (typeof $scope.currentItem !== 'undefined') {
                        $active.removeClass('is-active');
                        $scope.currentItem.addClass('is-active');
                    }
                    if (reset === true) {
                        targetEl.val($scope.initialValue);
                    } else {
                        targetEl.val($scope.currentItem.text());
                    }
                }


                //Todo - Timeout to reduce amount of request occuring.
                //Todo - Error Handling Should do somekthing here.
                function qasLookup(url, value) {
                    qasService.request(url, value).then(
                        function (data, status) {
                            var result = angular.fromJson(JSON.parse(data.data));
                            $scope.qasResult = result.data;
                            $scope.isQASResultsActive = true;
                        },
                        function (data, status) {

                        }
                   );
                }


                //Todo - Error Handling Should do somekthing here.
                function qasAddressDetail(url, value) {
                    qasService.request(url, value).then(
                        function (data, status) {
                            var result = angular.fromJson(JSON.parse(data.data));
                            $scope[$attrs.qasAddressModel] = result;
                            $scope.isQASResultsActive = false;
                            $scope.isQASActive = false;
                        }, function (data, status) {

                        }
                    );
                }

            }]

        }
    }]);
} (app));


/**
 * Manage service request to qas
 */
(function(module) {
    module.factory('qasService', ['$http',function($http) {

        /**
         * Service to manage request to QAS
         * @param url
         * @returns {HttpPromise}
         */
        function request(url, obj) {

            return $http({
                method: 'POST',
                url: url,
                dataType: 'JSON',
                data: JSON.stringify(obj),
                headers: {
                    "Content-Type": "application/json;charset=UTF-8"
                }
            });

            // for testing
            //return $http.get(url);
        }

        return {
            request: request
        }

    }]);
} (app));

/**
 * Keep reference of name in scope for the 'formInputValidation' directive to validate against.
 */
(function(module) {
   module.directive('formInputController', ['$timeout',function($timeout) {
       return {
           restrict: 'A',
           controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

               var _inputEl = $element.find('[name]');
               this.inputName = _inputEl.attr('name');


               angular.forEach(_inputEl, function(item) {
                   var targetEl = angular.element(item),
                       elType = targetEl.attr('ui-money-mask') ? "number" : targetEl.attr('type'),
                       modelName = targetEl.attr('ng-model') || targetEl.attr('data-ng-model');

                   switch(elType) {
                       case 'checkbox':
                           $scope[modelName] = targetEl.is(':checked');
                           break;
                       case 'radio':
                           if(targetEl.is(':checked')) {
                               $scope[modelName] = targetEl.val();
                           }
                           break;
                       case 'number':
                           $scope[modelName] = parseInt(targetEl.val());
                           break;
                       default: {
                           $scope[modelName] = targetEl.val();
                       }
                   }

               });

               /*
                * If IE 9 or lower we need to re-apply placeholder text
                */
               if ($('.lt-ie10').length) {
                   $scope.$watch( function() {
                       return this.inputName;
                   }, function(newValue, oldValue) {
                       $timeout(function(){
                           _inputEl.placeholder();
                       }, 0);
                   });
               }

               if(angular.isUndefined($attrs.formInputDirty) || $attrs.formInputDirty !== 'true') {
                   this.isPristine = true;
               } else {
                   this.isPristine = false;
               }

           }]
       };
   }]);
} (app));

/**
 * Show Error message based on validation requirements on input element.
 */
(function(module) {
    module.directive('formInputValidation', [function() {
        return {
            restrict: 'A',
            require: '^formInputController',
            scope: true,
            link: function($scope, $element, $attrs, ctrl) {

                // Event - value has been added, manage async issue
                $scope.$watch('ctrl.isPristine', function() {
                    //Validate on page load
                    if(!ctrl.isPristine) {
                        $scope.isInputError();
                    }
                });


                /**
                 * View Event - validate form element
                 * @returns {*|boolean}
                 */
                $scope.isInputError = function() {

                    if(angular.isUndefined($scope.formGroup[ctrl.inputName])) return;

                    if(ctrl.isPristine) {
                        //Validate only when form element is not prestine
                        return $scope.formGroup[ctrl.inputName].$error[$attrs.formInputValidation] && !$scope.formGroup[ctrl.inputName].$pristine;
                    } else {
                        //Validate pristine or not
                        return $scope.formGroup[ctrl.inputName].$error[$attrs.formInputValidation];
                    }
                };
            }
        }
    }]);
} (app));



/**
 * Directive will modify the name attribute on input field.
 * - This will only effect form elements that are in the 'form-adder' directive.
 */
(function(module) {
    module.directive('formInput', ['$compile', function($compile) {


        /**
         * Generate a unique id
         * @returns {string}
         */
        function getUniqueID() {
            return Math.floor((1 + Math.random()) * 0x10000)
                .toString(16)
                .substring(1);
        };

        return {
            restrict: 'A',
            terminal: true,
            priority: 1000,
            link: function($scope, $element, $attrs) {

                //Apply directive 'data-form-input-controller' to main element.
                $attrs.$set('dataFormInputController', '');

                //Add data-ng-show to the 'data-form-input-validation' element
                $element.find('[data-form-input-validation]').attr('data-ng-show', 'isInputError()');

                //If in a ng-repeat then update name tag with the counter and a unique id
                if(!angular.isUndefined($scope.$index)) {

                    //var targetElName = targetEl.attr('name') + '-' + $scope.$parent.counter + '-' + getUniqueID();
                    // Removed the random identifier as requested by backend...

                    var targetEl = $element.find('[name]');

                    if($scope.$index !== 0) {
                        var targetElName = targetEl.attr('name') + '-' + $scope.$parent.counter;
                        targetEl.attr('name', targetElName);
                    }

                };

                //Remove 'data-form-input' directive before compling
                $element.removeAttr('data-form-input');

                //Compile changes.
                $compile($element)($scope);
            }
        }
    }]);
} (app));




/**
 * Dupliate form group elements
 */
(function(module) {
  module.directive('formDuplicator', ['$timeout', function($timeout) {
        return {
            restrict: 'A',
            scope: true,
            controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                //Default empty array
                $scope.formGroupCollection = [];
                // Add a persistent repeat counter
                $scope.counter = 0;

                //Define limit of duplication
                var _duplicatorLimit = parseInt($attrs.formDuplicatorLimit) || 20;


                /**
                 * Increase amount in group
                 */
                $scope.groupAdd = function(e) {
                    $scope._addToFormGroupCollection();
                    e.preventDefault();
                };

                /**
                 * View event - to remove item from index
                 * @param e
                 */
                $scope.groupRemove = function(e) {
                    $scope._removeFromFormGroupCollection(this.$index);
                    e.preventDefault();
                };


                /**
                 * Show remove button if there's more than 1
                 */
                $scope.showRemove = function() {
                    if($scope.formGroupCollection.length > 1) {
                        return true;
                    } else {
                        return false;
                    }
                };

                /**
                 * Have reached limit make button disabled.
                 */
                $scope.isAddLimit = function() {
                    return !($scope.formGroupCollection.length <= (_duplicatorLimit - 1));
                };


                /**
                 * Increase array by one
                 * @private
                 */
                $scope._addToFormGroupCollection = function(data) {
                    //If there is no data then push an empty object.
                    data = data || {};

                    //If reached limit do not proceed
                    if($scope.isAddLimit()) return;

                    // increment the counter, to update increment the name id, using $index is not persistent.
                    $scope.counter++;
                    $scope.formGroupCollection.push(data);
                };

                /**
                 * Remove from index based on index
                 * @param index
                 * @private
                 */
                $scope._removeFromFormGroupCollection = function(index) {
                    $scope.formGroupCollection.splice(index, 1);
                };





                ////IF JSON has been added then this is default content
                if($attrs.formDuplicator.length > 0) {
                    //Convert from json to array
                    var jsonCollection = JSON.parse($attrs.formDuplicator);
                    //Loop through and add to collection, need to call '_addToFormGroupCollection' to ensure the name attribute increments correctly.
                    angular.forEach(jsonCollection, function(item) {
                        $timeout(function() {
                            $scope._addToFormGroupCollection(item);
                        }, 0);
                    });
                } else {
                    //No default content then push empty
                    $scope._addToFormGroupCollection();
                }





            }]
        }
  }]);
} (app));





/**
 * Range Slider jQuery Instantiate, added as we need to have angular manage instantiating when range is added to the DOM
 */
(function(module) {
    module.directive('formRangeSlider', [function() {
        return {
            restrict: 'A',
            link: function(scope,element,attrs){
                element.rangeSlider();
            }
        }
    }]);
} (app));

/**
 * jQuery-Autocomplete Instantiate
  */
 (function(module) {
     module.directive('formAutocomplete', [function() {
         return {
             restrict: 'A',
             link: function(scope,element,attrs){
                 element.fieldAutocomplete();
             }
         };
     }]);
 } (app));

/**
 * data-form-loan-calculator directive manages updating the loan amount
 * Example: <div    data-form-loan-calculator
 *                  data-form-purchase-price="purchasePriceModel"
 *                  data-form-deposit-saved="depositSavedModel"
 *                  data-form-additional-borrowing="additionalBorrowingModel"
 *                  data-form-loan-amount-valid="loanAmountValidModel"
 *                  data-form-loan-result="loanModel"
 *                  data-form-loan-result-formatted="loanModelFormatted">
 *         </div>
 */
(function(module) {
    module.directive('formLoanCalculator', [function() {
        return {
            restrict: 'A',
            scope: {formPurchasePrice: '=', formDepositSaved: '=', formAdditionalBorrowing: '=', formLoanAmountValid: '=', formLoanResult: '=', formLoanResultFormatted: '='},
            controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                /**
                 * Event - purchase price update
                 */
                $scope.$watch('formPurchasePrice', function(newVal) {
                    if (newVal <=0) {
                        $element.find('[name=purchasePrice]').val("$ 0");
                    }
                    updateLoanAmount();
                });

                /**
                 * Event - deposit saved update
                 */
                $scope.$watch('formDepositSaved', function(newVal) {
                    if (newVal <=0) {
                        $element.find('[name=depositSaved]').val("$ 0");
                    }
                    updateLoanAmount();
                });

                /**
                 * Event - additional borrowing update
                 */
                $scope.$watch('formAdditionalBorrowing', function(newVal) {
                    if (newVal <=0) {
                        $element.find('[name=additionalBorrowing]').val("$ 0");
                    }
                    updateLoanAmount();
                });

                /**
                 * Update loan amount
                 */
                function updateLoanAmount() {
                    var purchase_price = ($scope.formPurchasePrice >= 0) ? $scope.formPurchasePrice: 0;
                    var deposit_saved = ($scope.formDepositSaved >= 0) ? $scope.formDepositSaved: 0;
                    var additional_borrowing = ($scope.formAdditionalBorrowing >= 0) ? $scope.formAdditionalBorrowing: 0;
                    var loanAmount = Number(purchase_price) - Number(deposit_saved) + Number(additional_borrowing);
                    $scope.formLoanAmountValid = (loanAmount > 0) ? "Your loan is valid": "";
                    $scope.formLoanResult = loanAmount;
                    $scope.formLoanResultFormatted = numberWithCommas(loanAmount);
                }

                function numberWithCommas(x) {
                    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
                }

            }]
        }
    }]);
} (app));



(function(module) {
    module.filter('isEmpty', function() {
        return function(input) {
            if(angular.isUndefined(input)) {
                return true;
            }
            if(input.length === 0) {
                return true;
            } else {
                return false;
            }
        }
    });
}(app));


(function(module) {
    module.filter('or', function() {
        return function(input1, input2) {
            if(input1 || input2) {
                return true;
            } else {
                return false;
            }
        }
    });
}(app));
;
(function(exports) {
    (function(exports) {

        // simple directive to keep scope to form
        exports.directive('dtForm', [function() {
            return {
                restrict: 'A',
                scope: true,
                link: function(scope, element, attributes) {
                    // when submit on group clicked we dirty all inputs and block if group not valid
                    var $element = angular.element(element);

                    var $scopeSubmit = $element.find("[type='submit']");
                    $scopeSubmit.bind('click', function(e) {
                        // Remove the class pristine from all form elements.
                        $element.find('.ng-pristine').removeClass('ng-pristine');

                        // Get the form object.
                        var form = scope[attributes.name];
                        // Set all the fields to dirty and apply the changes on the scope so that
                        // validation errors are shown on submit only.
                        angular.forEach(form, function(formElement, fieldName) {
                            // If the fieldname starts with a '$' sign, it means it's an Angular
                            // property or function. Skip those items.
                            if (fieldName[0] === '$') return;

                            formElement.$pristine = false;
                            formElement.$dirty = true;
                        });

                        // Do not continue if the form is invalid.
                        if (form.$invalid) {
                            e.preventDefault();
                            // Focus on the first field that is invalid.
                            $element.find('.ng-invalid').first().focus();
                            return false;
                        }else{
                            // allow submit
                        }
                    });
                },

                controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                }]
            };
        }]);

    } ((typeof exports === 'undefined')? window : exports));
} (app));
;
$(document).ready(function() {
  var switched = false;
  var updateTables = function() {
    if (($(window).width() < 780) && !switched ){
      switched = true;
      $("table.responsive").each(function(i, element) {
        splitTable($(element));
      });
      return true;
    }
    else if (switched && ($(window).width() > 780)) {
      switched = false;
      $("table.responsive").each(function(i, element) {
        unsplitTable($(element));
      });
    }
  };
   
  $(window).on('load', updateTables);
  $(window).on("redraw",function(){switched=false;updateTables();}); // An event to listen for
  $(window).on("resize", updateTables);
   
	
	function splitTable(original)
	{
		original.wrap("<div class='table-wrapper' />");
		
		var copy = original.clone();
		copy.find("td:not(:first-child), th:not(:first-child)").css("display", "none");
		copy.removeClass("responsive");
		
		original.closest(".table-wrapper").append(copy);
		copy.wrap("<div class='pinned' />");
		original.wrap("<div class='scrollable' />");

    setCellHeights(original, copy);
	}
	
	function unsplitTable(original) {
    original.closest(".table-wrapper").find(".pinned").remove();
    original.unwrap();
    original.unwrap();
	}

  function setCellHeights(original, copy) {
    var tr = original.find('tr'),
        tr_copy = copy.find('tr'),
        heights = [];

    tr.each(function (index) {
      var self = $(this),
          tx = self.find('th, td');

      tx.each(function () {
        var height = $(this).outerHeight(true);
        heights[index] = heights[index] || 0;
        if (height > heights[index]) heights[index] = height;
      });

    });

    tr_copy.each(function (index) {
      $(this).height(heights[index]);
    });
  }

});
;
(function ($, window, document, undefined) {
	var pluginName = 'timeline';

	// The actual plugin constructor
	function Plugin( element, options ) {
		this.element = $(element);
		this._name = pluginName;
		this.init();
	};

	Plugin.prototype.init = function () {
		var scope = this;
		var $el = $(scope.element);

		var	offset = .93;
		var timelineBlocks = $('.pl74-timeline-block'),
			offset = .93;
		// on scrolling, show/animate timeline blocks when enter the viewport
		$(window).on('scroll', function(){
			(!window.requestAnimationFrame)
				? setTimeout(function(){ showBlocks(timelineBlocks, offset); }, 100)
				: window.requestAnimationFrame(function(){ showBlocks(timelineBlocks, offset); });
		});
		collapseBlocks(scope);
		// hide timeline blocks which are outside the viewport
    	hideBlocks(timelineBlocks, offset);
	};


    // hide each timeline block when off screen
	function hideBlocks(blocks, offset) {
		var scope = this;
		var $el = $(scope.element);
		blocks.each(function(){
				( $(this).offset().top > $(window).scrollTop()+$(window).height()*offset ) && $(this).find('.pl74-timeline-content-icon, .pl74-timeline-content, .pl74-timeline-date').addClass('is-hidden');
			});
	}

	// show each timeline block when on screen
	function showBlocks(blocks, offset) {
		blocks.each(function(){
				( $(this).offset().top <= $(window).scrollTop()+$(window).height()*offset && $(this).find('.pl74-timeline-content-icon').hasClass('is-hidden') ) && $(this).find('.pl74-timeline-content-icon, .pl74-timeline-content, .pl74-timeline-date').removeClass('is-hidden').addClass('bounce-in');
			});
	}

	function collapseBlocks() {
		// all for non collapsible content 'content-noncollapsible'
	    $('.content-noncollapsible .pl74-timeline-content-dropdown').css('display','none');

	    // hide initially set collapsible content 'content-collapsible'
	    $('.content-collapsible .pl74-timeline-content-inner').css('display', 'none');

	    // expand collabsible content
		$('.content-collapsible .pl74-timeline-toggle').click(function(e){
			e.preventDefault();
			$(this).find('.pl74-timeline-content-dropdown').toggleClass('icon-arrow-up icon-arrow-down');
			$(this).parent().siblings('.pl74-timeline-content-inner').slideToggle('slow');
		});
	}


	$.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

	$(window).on('load', function () {
        $(".pl74-timeline-container").timeline();
    });

})(jQuery, window, document);
;
;
(function ($, window, document, undefined) {

	// Create the defaults once
	var pluginName = 'videoPlaylist',
		defaults = {
			vid_list_container : ".pl75-videoplaylist-container",
			arrow_left : ".pl75-videoplaylist-arrow-left",
			arrow_right : ".pl75-videoplaylist-arrow-right",
			vid_item : ".pl75-videoplaylist-item",
			vid_list : ".pl75-videoplaylist-list"
		};

	// The actual plugin constructor
	function Plugin( element, options ) {
		this.element = $(element);
		this.options = $.extend({}, defaults, options);
		this._defaults = defaults;
		this._name = pluginName;
		this.init();
	};

	Plugin.prototype.init = function () {
		var scope = this;
		var $el = $(scope.element);
		scope.buildVideoList(scope);
		scope.navVideoList(scope);
	};

	Plugin.prototype.navVideoList = function(scope) {
		var $el = $(scope.element);
		$el.find(scope.options.arrow_right).bind("click", function (event) {
	        event.preventDefault();
	        $el.find(scope.options.vid_list_container).stop().animate({
	            scrollLeft: "+=265"
	        }, 750);
	    });
	    $el.find(scope.options.arrow_left).bind("click", function (event) {
	        event.preventDefault();
	        $el.find(scope.options.vid_list_container).stop().animate({
	            scrollLeft: "-=265"
	        }, 750);
	    });
	};

	Plugin.prototype.buildVideoList = function(scope) {
		var $el = $(scope.element);
		var $vidItemWidth = $el.find(scope.options.vid_item).width();
	    var $vidItemNum = $el.find(scope.options.vid_item).length;

	    var $vidListWidth = $vidItemWidth*($vidItemNum+1);
	    $el.find(scope.options.vid_list).width($vidListWidth);

	    if ($vidItemNum <= 1) {
	    	$('.pl75-videoplaylist-arrows').addClass('hide-pl75-videoplaylist-arrows-mobile hide-pl75-videoplaylist-arrows-desktop');
	    }

	    else if ($vidItemNum == 2) {
	    	$('.pl75-videoplaylist-arrows').addClass('hide-pl75-videoplaylist-arrows-desktop');
	    }
	};

	// A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load', function () {
        $(".pl75-videoplaylist").videoPlaylist();
    });


})(jQuery, window, document);;
/**
*  Ajax Autocomplete for jQuery, version 1.2.26
*  (c) 2014 Tomas Kirda
*
*  Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
*  For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete
*/
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports&&"function"==typeof require?require("jquery"):jQuery)}(function(a){"use strict";function b(c,d){var e=a.noop,f=this,g={ajaxSettings:{},autoSelectFirst:!1,appendTo:document.body,serviceUrl:null,lookup:null,onSelect:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:b.formatResult,delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:e,onSearchComplete:e,onSearchError:e,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(a,b,c){return-1!==a.value.toLowerCase().indexOf(c)},paramName:"query",transformResult:function(b){return"string"==typeof b?a.parseJSON(b):b},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1};f.element=c,f.el=a(c),f.suggestions=[],f.badQueries=[],f.selectedIndex=-1,f.currentValue=f.element.value,f.intervalId=0,f.cachedResponse={},f.onChangeInterval=null,f.onChange=null,f.isLocal=!1,f.suggestionsContainer=null,f.noSuggestionsContainer=null,f.options=a.extend({},g,d),f.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},f.hint=null,f.hintValue="",f.selection=null,f.initialize(),f.setOptions(d)}var c=function(){return{escapeRegExChars:function(a){return a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(a){var b=document.createElement("div");return b.className=a,b.style.position="absolute",b.style.display="none",b}}}(),d={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40};b.utils=c,a.Autocomplete=b,b.formatResult=function(a,b){if(!b)return a.value;var d="("+c.escapeRegExChars(b)+")";return a.value.replace(new RegExp(d,"gi"),"<strong>$1</strong>").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/&lt;(\/?strong)&gt;/g,"<$1>")},b.prototype={killerFn:null,initialize:function(){var c,d=this,e="."+d.classes.suggestion,f=d.classes.selected,g=d.options;d.element.setAttribute("autocomplete","off"),d.killerFn=function(b){a(b.target).closest("."+d.options.containerClass).length||(d.killSuggestions(),d.disableKillerFn())},d.noSuggestionsContainer=a('<div class="autocomplete-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),d.suggestionsContainer=b.utils.createNode(g.containerClass),c=a(d.suggestionsContainer),c.appendTo(g.appendTo),"auto"!==g.width&&c.css("width",g.width),c.on("mouseover.autocomplete",e,function(){d.activate(a(this).data("index"))}),c.on("mouseout.autocomplete",function(){d.selectedIndex=-1,c.children("."+f).removeClass(f)}),c.on("click.autocomplete",e,function(){return d.select(a(this).data("index")),!1}),d.fixPositionCapture=function(){d.visible&&d.fixPosition()},a(window).on("resize.autocomplete",d.fixPositionCapture),d.el.on("keydown.autocomplete",function(a){d.onKeyPress(a)}),d.el.on("keyup.autocomplete",function(a){d.onKeyUp(a)}),d.el.on("blur.autocomplete",function(){d.onBlur()}),d.el.on("focus.autocomplete",function(){d.onFocus()}),d.el.on("change.autocomplete",function(a){d.onKeyUp(a)}),d.el.on("input.autocomplete",function(a){d.onKeyUp(a)})},onFocus:function(){var a=this;a.fixPosition(),a.el.val().length>=a.options.minChars&&a.onValueChange()},onBlur:function(){this.enableKillerFn()},abortAjax:function(){var a=this;a.currentRequest&&(a.currentRequest.abort(),a.currentRequest=null)},setOptions:function(b){var c=this,d=c.options;a.extend(d,b),c.isLocal=a.isArray(d.lookup),c.isLocal&&(d.lookup=c.verifySuggestionsFormat(d.lookup)),d.orientation=c.validateOrientation(d.orientation,"bottom"),a(c.suggestionsContainer).css({"max-height":d.maxHeight+"px",width:d.width+"px","z-index":d.zIndex})},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var a=this;a.disabled=!0,clearInterval(a.onChangeInterval),a.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var b=this,c=a(b.suggestionsContainer),d=c.parent().get(0);if(d===document.body||b.options.forceFixPosition){var e=b.options.orientation,f=c.outerHeight(),g=b.el.outerHeight(),h=b.el.offset(),i={top:h.top,left:h.left};if("auto"===e){var j=a(window).height(),k=a(window).scrollTop(),l=-k+h.top-f,m=k+j-(h.top+g+f);e=Math.max(l,m)===l?"top":"bottom"}if("top"===e?i.top+=-f:i.top+=g,d!==document.body){var n,o=c.css("opacity");b.visible||c.css("opacity",0).show(),n=c.offsetParent().offset(),i.top-=n.top,i.left-=n.left,b.visible||c.css("opacity",o).hide()}"auto"===b.options.width&&(i.width=b.el.outerWidth()+"px"),c.css(i)}},enableKillerFn:function(){var b=this;a(document).on("click.autocomplete",b.killerFn)},disableKillerFn:function(){var b=this;a(document).off("click.autocomplete",b.killerFn)},killSuggestions:function(){var a=this;a.stopKillSuggestions(),a.intervalId=window.setInterval(function(){a.visible&&(a.options.preserveInput||a.el.val(a.currentValue),a.hide()),a.stopKillSuggestions()},50)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},isCursorAtEnd:function(){var a,b=this,c=b.el.val().length,d=b.element.selectionStart;return"number"==typeof d?d===c:document.selection?(a=document.selection.createRange(),a.moveStart("character",-c),c===a.text.length):!0},onKeyPress:function(a){var b=this;if(!b.disabled&&!b.visible&&a.which===d.DOWN&&b.currentValue)return void b.suggest();if(!b.disabled&&b.visible){switch(a.which){case d.ESC:b.el.val(b.currentValue),b.hide();break;case d.RIGHT:if(b.hint&&b.options.onHint&&b.isCursorAtEnd()){b.selectHint();break}return;case d.TAB:if(b.hint&&b.options.onHint)return void b.selectHint();if(-1===b.selectedIndex)return void b.hide();if(b.select(b.selectedIndex),b.options.tabDisabled===!1)return;break;case d.RETURN:if(-1===b.selectedIndex)return void b.hide();b.select(b.selectedIndex);break;case d.UP:b.moveUp();break;case d.DOWN:b.moveDown();break;default:return}a.stopImmediatePropagation(),a.preventDefault()}},onKeyUp:function(a){var b=this;if(!b.disabled){switch(a.which){case d.UP:case d.DOWN:return}clearInterval(b.onChangeInterval),b.currentValue!==b.el.val()&&(b.findBestHint(),b.options.deferRequestBy>0?b.onChangeInterval=setInterval(function(){b.onValueChange()},b.options.deferRequestBy):b.onValueChange())}},onValueChange:function(){var b=this,c=b.options,d=b.el.val(),e=b.getQuery(d);return b.selection&&b.currentValue!==e&&(b.selection=null,(c.onInvalidateSelection||a.noop).call(b.element)),clearInterval(b.onChangeInterval),b.currentValue=d,b.selectedIndex=-1,c.triggerSelectOnValidInput&&b.isExactMatch(e)?void b.select(0):void(e.length<c.minChars?b.hide():b.getSuggestions(e))},isExactMatch:function(a){var b=this.suggestions;return 1===b.length&&b[0].value.toLowerCase()===a.toLowerCase()},getQuery:function(b){var c,d=this.options.delimiter;return d?(c=b.split(d),a.trim(c[c.length-1])):b},getSuggestionsLocal:function(b){var c,d=this,e=d.options,f=b.toLowerCase(),g=e.lookupFilter,h=parseInt(e.lookupLimit,10);return c={suggestions:a.grep(e.lookup,function(a){return g(a,b,f)})},h&&c.suggestions.length>h&&(c.suggestions=c.suggestions.slice(0,h)),c},getSuggestions:function(b){var c,d,e,f,g=this,h=g.options,i=h.serviceUrl;if(h.params[h.paramName]=b,d=h.ignoreParams?null:h.params,h.onSearchStart.call(g.element,h.params)!==!1){if(a.isFunction(h.lookup))return void h.lookup(b,function(a){g.suggestions=a.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,a.suggestions)});g.isLocal?c=g.getSuggestionsLocal(b):(a.isFunction(i)&&(i=i.call(g.element,b)),e=i+"?"+a.param(d||{}),c=g.cachedResponse[e]),c&&a.isArray(c.suggestions)?(g.suggestions=c.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,c.suggestions)):g.isBadQuery(b)?h.onSearchComplete.call(g.element,b,[]):(g.abortAjax(),f={url:i,data:d,type:h.type,dataType:h.dataType},a.extend(f,h.ajaxSettings),g.currentRequest=a.ajax(f).done(function(a){var c;g.currentRequest=null,c=h.transformResult(a,b),g.processResponse(c,b,e),h.onSearchComplete.call(g.element,b,c.suggestions)}).fail(function(a,c,d){h.onSearchError.call(g.element,b,a,c,d)}))}},isBadQuery:function(a){if(!this.options.preventBadQueries)return!1;for(var b=this.badQueries,c=b.length;c--;)if(0===a.indexOf(b[c]))return!0;return!1},hide:function(){var b=this,c=a(b.suggestionsContainer);a.isFunction(b.options.onHide)&&b.visible&&b.options.onHide.call(b.element,c),b.visible=!1,b.selectedIndex=-1,clearInterval(b.onChangeInterval),a(b.suggestionsContainer).hide(),b.signalHint(null)},suggest:function(){if(!this.suggestions.length)return void(this.options.showNoSuggestionNotice?this.noSuggestions():this.hide());var b,c=this,d=c.options,e=d.groupBy,f=d.formatResult,g=c.getQuery(c.currentValue),h=c.classes.suggestion,i=c.classes.selected,j=a(c.suggestionsContainer),k=a(c.noSuggestionsContainer),l=d.beforeRender,m="",n=function(a,c){var d=a.data[e];return b===d?"":(b=d,'<div class="autocomplete-group"><strong>'+b+"</strong></div>")};return d.triggerSelectOnValidInput&&c.isExactMatch(g)?void c.select(0):(a.each(c.suggestions,function(a,b){e&&(m+=n(b,g,a)),m+='<div class="'+h+'" data-index="'+a+'">'+f(b,g,a)+"</div>"}),this.adjustContainerWidth(),k.detach(),j.html(m),a.isFunction(l)&&l.call(c.element,j,c.suggestions),c.fixPosition(),j.show(),d.autoSelectFirst&&(c.selectedIndex=0,j.scrollTop(0),j.children("."+h).first().addClass(i)),c.visible=!0,void c.findBestHint())},noSuggestions:function(){var b=this,c=a(b.suggestionsContainer),d=a(b.noSuggestionsContainer);this.adjustContainerWidth(),d.detach(),c.empty(),c.append(d),b.fixPosition(),c.show(),b.visible=!0},adjustContainerWidth:function(){var b,c=this,d=c.options,e=a(c.suggestionsContainer);"auto"===d.width&&(b=c.el.outerWidth(),e.css("width",b>0?b:300))},findBestHint:function(){var b=this,c=b.el.val().toLowerCase(),d=null;c&&(a.each(b.suggestions,function(a,b){var e=0===b.value.toLowerCase().indexOf(c);return e&&(d=b),!e}),b.signalHint(d))},signalHint:function(b){var c="",d=this;b&&(c=d.currentValue+b.value.substr(d.currentValue.length)),d.hintValue!==c&&(d.hintValue=c,d.hint=b,(this.options.onHint||a.noop)(c))},verifySuggestionsFormat:function(b){return b.length&&"string"==typeof b[0]?a.map(b,function(a){return{value:a,data:null}}):b},validateOrientation:function(b,c){return b=a.trim(b||"").toLowerCase(),-1===a.inArray(b,["auto","bottom","top"])&&(b=c),b},processResponse:function(a,b,c){var d=this,e=d.options;a.suggestions=d.verifySuggestionsFormat(a.suggestions),e.noCache||(d.cachedResponse[c]=a,e.preventBadQueries&&!a.suggestions.length&&d.badQueries.push(b)),b===d.getQuery(d.currentValue)&&(d.suggestions=a.suggestions,d.suggest())},activate:function(b){var c,d=this,e=d.classes.selected,f=a(d.suggestionsContainer),g=f.find("."+d.classes.suggestion);return f.find("."+e).removeClass(e),d.selectedIndex=b,-1!==d.selectedIndex&&g.length>d.selectedIndex?(c=g.get(d.selectedIndex),a(c).addClass(e),c):null},selectHint:function(){var b=this,c=a.inArray(b.hint,b.suggestions);b.select(c)},select:function(a){var b=this;b.hide(),b.onSelect(a)},moveUp:function(){var b=this;if(-1!==b.selectedIndex)return 0===b.selectedIndex?(a(b.suggestionsContainer).children().first().removeClass(b.classes.selected),b.selectedIndex=-1,b.el.val(b.currentValue),void b.findBestHint()):void b.adjustScroll(b.selectedIndex-1)},moveDown:function(){var a=this;a.selectedIndex!==a.suggestions.length-1&&a.adjustScroll(a.selectedIndex+1)},adjustScroll:function(b){var c=this,d=c.activate(b);if(d){var e,f,g,h=a(d).outerHeight();e=d.offsetTop,f=a(c.suggestionsContainer).scrollTop(),g=f+c.options.maxHeight-h,f>e?a(c.suggestionsContainer).scrollTop(e):e>g&&a(c.suggestionsContainer).scrollTop(e-c.options.maxHeight+h),c.options.preserveInput||c.el.val(c.getValue(c.suggestions[b].value)),c.signalHint(null)}},onSelect:function(b){var c=this,d=c.options.onSelect,e=c.suggestions[b];c.currentValue=c.getValue(e.value),c.currentValue===c.el.val()||c.options.preserveInput||c.el.val(c.currentValue),c.signalHint(null),c.suggestions=[],c.selection=e,a.isFunction(d)&&d.call(c.element,e)},getValue:function(a){var b,c,d=this,e=d.options.delimiter;return e?(b=d.currentValue,c=b.split(e),1===c.length?a:b.substr(0,b.length-c[c.length-1].length)+a):a},dispose:function(){var b=this;b.el.off(".autocomplete").removeData("autocomplete"),b.disableKillerFn(),a(window).off("resize.autocomplete",b.fixPositionCapture),a(b.suggestionsContainer).remove()}},a.fn.autocomplete=a.fn.devbridgeAutocomplete=function(c,d){var e="autocomplete";return arguments.length?this.each(function(){var f=a(this),g=f.data(e);"string"==typeof c?g&&"function"==typeof g[c]&&g[c](d):(g&&g.dispose&&g.dispose(),g=new b(this,c),f.data(e,g))}):this.first().data(e)}});;
/*
 AngularJS v1.7.8
 (c) 2010-2018 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(T,a){'use strict';function M(m,f){f=f||{};a.forEach(f,function(a,d){delete f[d]});for(var d in m)!m.hasOwnProperty(d)||"$"===d.charAt(0)&&"$"===d.charAt(1)||(f[d]=m[d]);return f}var B=a.$$minErr("$resource"),H=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;a.module("ngResource",["ng"]).info({angularVersion:"1.7.8"}).provider("$resource",function(){var m=/^https?:\/\/\[[^\]]*][^/]*/,f=this;this.defaults={stripTrailingSlashes:!0,cancellable:!1,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",
isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}};this.$get=["$http","$log","$q","$timeout",function(d,F,G,N){function C(a,d){this.template=a;this.defaults=n({},f.defaults,d);this.urlParams={}}var O=a.noop,r=a.forEach,n=a.extend,R=a.copy,P=a.isArray,D=a.isDefined,x=a.isFunction,I=a.isNumber,y=a.$$encodeUriQuery,S=a.$$encodeUriSegment;C.prototype={setUrlParams:function(a,d,f){var g=this,c=f||g.template,s,h,n="",b=g.urlParams=Object.create(null);r(c.split(/\W/),function(a){if("hasOwnProperty"===
a)throw B("badname");!/^\d+$/.test(a)&&a&&(new RegExp("(^|[^\\\\]):"+a+"(\\W|$)")).test(c)&&(b[a]={isQueryParamValue:(new RegExp("\\?.*=:"+a+"(?:\\W|$)")).test(c)})});c=c.replace(/\\:/g,":");c=c.replace(m,function(b){n=b;return""});d=d||{};r(g.urlParams,function(b,a){s=d.hasOwnProperty(a)?d[a]:g.defaults[a];D(s)&&null!==s?(h=b.isQueryParamValue?y(s,!0):S(s),c=c.replace(new RegExp(":"+a+"(\\W|$)","g"),function(b,a){return h+a})):c=c.replace(new RegExp("(/?):"+a+"(\\W|$)","g"),function(b,a,e){return"/"===
e.charAt(0)?e:a+e})});g.defaults.stripTrailingSlashes&&(c=c.replace(/\/+$/,"")||"/");c=c.replace(/\/\.(?=\w+($|\?))/,".");a.url=n+c.replace(/\/(\\|%5C)\./,"/.");r(d,function(b,c){g.urlParams[c]||(a.params=a.params||{},a.params[c]=b)})}};return function(m,y,z,g){function c(b,c){var d={};c=n({},y,c);r(c,function(c,f){x(c)&&(c=c(b));var e;if(c&&c.charAt&&"@"===c.charAt(0)){e=b;var k=c.substr(1);if(null==k||""===k||"hasOwnProperty"===k||!H.test("."+k))throw B("badmember",k);for(var k=k.split("."),h=0,
n=k.length;h<n&&a.isDefined(e);h++){var g=k[h];e=null!==e?e[g]:void 0}}else e=c;d[f]=e});return d}function s(b){return b.resource}function h(b){M(b||{},this)}var Q=new C(m,g);z=n({},f.defaults.actions,z);h.prototype.toJSON=function(){var b=n({},this);delete b.$promise;delete b.$resolved;delete b.$cancelRequest;return b};r(z,function(b,a){var f=!0===b.hasBody||!1!==b.hasBody&&/^(POST|PUT|PATCH)$/i.test(b.method),g=b.timeout,m=D(b.cancellable)?b.cancellable:Q.defaults.cancellable;g&&!I(g)&&(F.debug("ngResource:\n  Only numeric values are allowed as `timeout`.\n  Promises are not supported in $resource, because the same value would be used for multiple requests. If you are looking for a way to cancel requests, you should use the `cancellable` option."),
delete b.timeout,g=null);h[a]=function(e,k,J,y){function z(a){p.catch(O);null!==u&&u.resolve(a)}var K={},v,t,w;switch(arguments.length){case 4:w=y,t=J;case 3:case 2:if(x(k)){if(x(e)){t=e;w=k;break}t=k;w=J}else{K=e;v=k;t=J;break}case 1:x(e)?t=e:f?v=e:K=e;break;case 0:break;default:throw B("badargs",arguments.length);}var E=this instanceof h,l=E?v:b.isArray?[]:new h(v),q={},C=b.interceptor&&b.interceptor.request||void 0,D=b.interceptor&&b.interceptor.requestError||void 0,F=b.interceptor&&b.interceptor.response||
s,H=b.interceptor&&b.interceptor.responseError||G.reject,I=t?function(a){t(a,A.headers,A.status,A.statusText)}:void 0;w=w||void 0;var u,L,A;r(b,function(a,b){switch(b){default:q[b]=R(a);case "params":case "isArray":case "interceptor":case "cancellable":}});!E&&m&&(u=G.defer(),q.timeout=u.promise,g&&(L=N(u.resolve,g)));f&&(q.data=v);Q.setUrlParams(q,n({},c(v,b.params||{}),K),b.url);var p=G.resolve(q).then(C).catch(D).then(d),p=p.then(function(c){var e=c.data;if(e){if(P(e)!==!!b.isArray)throw B("badcfg",
a,b.isArray?"array":"object",P(e)?"array":"object",q.method,q.url);if(b.isArray)l.length=0,r(e,function(a){"object"===typeof a?l.push(new h(a)):l.push(a)});else{var d=l.$promise;M(e,l);l.$promise=d}}c.resource=l;A=c;return F(c)},function(a){a.resource=l;A=a;return H(a)}),p=p["finally"](function(){l.$resolved=!0;!E&&m&&(l.$cancelRequest=O,N.cancel(L),u=L=q.timeout=null)});p.then(I,w);return E?p:(l.$promise=p,l.$resolved=!1,m&&(l.$cancelRequest=z),l)};h.prototype["$"+a]=function(b,c,d){x(b)&&(d=c,c=
b,b={});b=h[a].call(this,b,this,c,d);return b.$promise||b}});return h}}]})})(window,window.angular);
//# sourceMappingURL=angular-resource.min.js.map
;
/*
 AngularJS v1.7.8
 (c) 2010-2018 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(s,c){'use strict';function P(c){var h=[];C(h,E).chars(c);return h.join("")}var D=c.$$minErr("$sanitize"),F,h,G,H,I,q,E,J,K,C;c.module("ngSanitize",[]).provider("$sanitize",function(){function f(a,e){return B(a.split(","),e)}function B(a,e){var d={},b;for(b=0;b<a.length;b++)d[e?q(a[b]):a[b]]=!0;return d}function t(a,e){e&&e.length&&h(a,B(e))}function Q(a){for(var e={},d=0,b=a.length;d<b;d++){var k=a[d];e[k.name]=k.value}return e}function L(a){return a.replace(/&/g,"&amp;").replace(z,function(a){var d=
a.charCodeAt(0);a=a.charCodeAt(1);return"&#"+(1024*(d-55296)+(a-56320)+65536)+";"}).replace(u,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function A(a){for(;a;){if(a.nodeType===s.Node.ELEMENT_NODE)for(var e=a.attributes,d=0,b=e.length;d<b;d++){var k=e[d],g=k.name.toLowerCase();if("xmlns:ns1"===g||0===g.lastIndexOf("ns1:",0))a.removeAttributeNode(k),d--,b--}(e=a.firstChild)&&A(e);a=v("nextSibling",a)}}function v(a,e){var d=e[a];if(d&&J.call(e,d))throw D("elclob",
e.outerHTML||e.outerText);return d}var y=!1,g=!1;this.$get=["$$sanitizeUri",function(a){y=!0;g&&h(m,l);return function(e){var d=[];K(e,C(d,function(b,d){return!/^unsafe:/.test(a(b,d))}));return d.join("")}}];this.enableSvg=function(a){return I(a)?(g=a,this):g};this.addValidElements=function(a){y||(H(a)&&(a={htmlElements:a}),t(l,a.svgElements),t(r,a.htmlVoidElements),t(m,a.htmlVoidElements),t(m,a.htmlElements));return this};this.addValidAttrs=function(a){y||h(M,B(a,!0));return this};F=c.bind;h=c.extend;
G=c.forEach;H=c.isArray;I=c.isDefined;q=c.$$lowercase;E=c.noop;K=function(a,e){null===a||void 0===a?a="":"string"!==typeof a&&(a=""+a);var d=N(a);if(!d)return"";var b=5;do{if(0===b)throw D("uinput");b--;a=d.innerHTML;d=N(a)}while(a!==d.innerHTML);for(b=d.firstChild;b;){switch(b.nodeType){case 1:e.start(b.nodeName.toLowerCase(),Q(b.attributes));break;case 3:e.chars(b.textContent)}var k;if(!(k=b.firstChild)&&(1===b.nodeType&&e.end(b.nodeName.toLowerCase()),k=v("nextSibling",b),!k))for(;null==k;){b=
v("parentNode",b);if(b===d)break;k=v("nextSibling",b);1===b.nodeType&&e.end(b.nodeName.toLowerCase())}b=k}for(;b=d.firstChild;)d.removeChild(b)};C=function(a,e){var d=!1,b=F(a,a.push);return{start:function(a,g){a=q(a);!d&&w[a]&&(d=a);d||!0!==m[a]||(b("<"),b(a),G(g,function(d,g){var c=q(g),f="img"===a&&"src"===c||"background"===c;!0!==M[c]||!0===O[c]&&!e(d,f)||(b(" "),b(g),b('="'),b(L(d)),b('"'))}),b(">"))},end:function(a){a=q(a);d||!0!==m[a]||!0===r[a]||(b("</"),b(a),b(">"));a==d&&(d=!1)},chars:function(a){d||
b(L(a))}}};J=s.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)};var z=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=/([^#-~ |!])/g,r=f("area,br,col,hr,img,wbr"),x=f("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),p=f("rp,rt"),n=h({},p,x),x=h({},x,f("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),p=h({},p,f("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),
l=f("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),w=f("script,style"),m=h({},r,x,p,n),O=f("background,cite,href,longdesc,src,xlink:href,xml:base"),n=f("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),
p=f("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",
!0),M=h({},O,p,n),N=function(a,e){function d(b){b="<remove></remove>"+b;try{var d=(new a.DOMParser).parseFromString(b,"text/html").body;d.firstChild.remove();return d}catch(e){}}function b(a){c.innerHTML=a;e.documentMode&&A(c);return c}var g;if(e&&e.implementation)g=e.implementation.createHTMLDocument("inert");else throw D("noinert");var c=(g.documentElement||g.getDocumentElement()).querySelector("body");c.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>';return c.querySelector("svg")?
(c.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',c.querySelector("svg img")?d:b):function(b){b="<remove></remove>"+b;try{b=encodeURI(b)}catch(d){return}var e=new a.XMLHttpRequest;e.responseType="document";e.open("GET","data:text/html;charset=utf-8,"+b,!1);e.send(null);b=e.response.body;b.firstChild.remove();return b}}(s,s.document)}).info({angularVersion:"1.7.8"});c.module("ngSanitize").filter("linky",["$sanitize",function(f){var h=/((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,
t=/^mailto:/i,q=c.$$minErr("linky"),s=c.isDefined,A=c.isFunction,v=c.isObject,y=c.isString;return function(c,z,u){function r(c){c&&l.push(P(c))}function x(c,g){var f,a=p(c);l.push("<a ");for(f in a)l.push(f+'="'+a[f]+'" ');!s(z)||"target"in a||l.push('target="',z,'" ');l.push('href="',c.replace(/"/g,"&quot;"),'">');r(g);l.push("</a>")}if(null==c||""===c)return c;if(!y(c))throw q("notstring",c);for(var p=A(u)?u:v(u)?function(){return u}:function(){return{}},n=c,l=[],w,m;c=n.match(h);)w=c[0],c[2]||
c[4]||(w=(c[3]?"http://":"mailto:")+w),m=c.index,r(n.substr(0,m)),x(w,c[0].replace(t,"")),n=n.substring(m+c[0].length);r(n);return f(l.join(""))}}])})(window,window.angular);
//# sourceMappingURL=angular-sanitize.min.js.map
;
(function() {

'use strict';

/*
 * Callback Controller
 */
angular.module('webchatApp.callback', []).
  controller('CallbackFormController', ['$scope','$resource','$sanitize', '$location', function($scope, $resource, $sanitize,$location) {
    $scope.name = '';
    $scope.phone = '';
    $scope.state = '';
    $scope.errNameReq = false;
    $scope.errPhoneReq = false;
    $scope.errStateReq = false;
    $scope.submitable = false;
    $scope.nameRegex = /\D{2,80}/;
    $scope.phoneRegex = /\d{6,10}/;
    $scope.open = true; 
    
    /*
     * validateUI()
     */
    $scope.validateUI = function () {
      var nameValid =  ($scope.name !== undefined) && $scope.nameRegex.test($scope.name),
          phoneValid = ($scope.phone !== undefined) && $scope.phoneRegex.test($scope.phone),
          stateValid = ($scope.state !== undefined) && ($scope.state !== '');
      
     if (nameValid && phoneValid && stateValid) {
        $scope.submitable = true;
        $scope.errPhoneReq = false;
        $scope.errNameReq = false;
        $scope.errStateReq = false;
        return;
      }
      
      if (!nameValid) {
        $scope.errNameReq = true;
        $scope.submitable = false;
      } else {
        $scope.errNameReq = false;
      }
      if (!phoneValid) {
        $scope.errPhoneReq = true;
        $scope.submitable = false;        
      } else {
        $scope.errPhoneReq = false;
      }
      if (!stateValid) {
          $scope.errStateReq = true;
          $scope.submitable = false;
      } else {
          $scope.errStateReq = false;
      }
    };
    
    /*
     * requestCallback()
     */
    $scope.requestCallback = function () {
      event.preventDefault();
      $scope.loading = true;
      var inin = $resource('/services/CicService.svc/RequestCallBack');

      var callbackRequest = {
        MemberName: $sanitize($scope.name),
        MemberPhone: $sanitize($scope.phone),
        MemberState: $sanitize($scope.state),
        FcSessionId: '', 
        FcFormId: 0
      };

      if (typeof(fc) !== 'undefined') {
        callbackRequest.FcSessionId = fc.sessionId;
        callbackRequest.FcFormId = parseInt(fc.formId);  
      }
      
      var saveRes = inin.save(callbackRequest, function(response) {
        $scope.showConfirmation = response.Success;
        $scope.error = !response.Success;
        $scope.loading = false;
      }, function(err) {
        $scope.loading = false;
        $scope.error = true;
      }); 
      $scope.callbackFormVisible = false;
    };
    /* * */
    
  }]);
  
}());;
(function() {

'use strict';

/* 
 * WebchatController
 */  
angular.module('webchatApp.webchat', []).
  controller('WebchatController', ['$scope', '$resource', '$window', '$location', '$sanitize', function ($scope, $resource, $window, $location, $sanitize) {
    $scope.chatFormVisible = false;
    $scope.name = '';
    $scope.memberNumber = '';
    $scope.phone = '';
    $scope.email = '';
    $scope.submitable = false;
    $scope.errNameReq = false;
    $scope.errEmailReq = false;
    $scope.nameRegex = /\D{2,80}/;
    $scope.emailRegex = /([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})/;
    
    var open = $resource('/services/CicService.svc/WebchatStatus');
    open.get(function(WebchatStatus) {
      $scope.open = WebchatStatus.success;
      $scope.chatFormVisible = false;
    });
    
    /*
     * validateUI() 
     */
    $scope.validateUI = function () {
      var nameValid =  ($scope.name !== undefined) && $scope.nameRegex.test($scope.name),
          emailValid = ($scope.email !== undefined) && $scope.emailRegex.test($scope.email);

      if (nameValid && emailValid) {
        $scope.submitable = true;
        $scope.errNameReq = false;
        $scope.errEmailReq = false;
        return;
      }
      
      if (!nameValid) {
        $scope.errNameReq = true;
        $scope.submitable = false;
      } else {
        $scope.errNameReq = false;
      }
      if (!emailValid) {
        $scope.errEmailReq = true;
        $scope.submitable = false;
      } else {
        $scope.errEmailReq = false;
      }
    };
    
    /*
     * startChat()
     */
    $scope.startChat = function (chatFrm) {
      event.preventDefault();
      var params = {
        'interactionType': 'Chat',
        'targetType': 'Workgroup',
        'memberName': $sanitize($scope.name),
        'memberEmail': $sanitize($scope.email),
        'target': 'General+enquiry',
        'memberEnquiry': 'Web chat enquiry initiated from web form page.'
      };
      
      if ($scope.phone !== undefined && /\d{6,10}/.exec($scope.phone)) {
        params.memberPhone = $scope.phone;
      }
      if ($scope.memberNumber !== undefined && /\d{2,6}/.exec($scope.memberNumber)) {
        params.memberNo = $scope.memberNumber;  
      }

      var popup = {
        opts: 'width=800,height=550,dependent=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes',
        name: 'TMBL Web Chat'
      };
      
      $window.open("https://webchat.tmbank.com.au/I3Root/index2.html?" + jQuery.param(params), popup.name, popup.ops);
      $scope.chatFormVisible = false;
      $scope.message = 'A web chat session has been started in a new window.';
    };

  }]);
    
}());
;
(function () {
    'use strict';
    var affixing = false,
        affixEnabled = false,
        mainFooter = {},
        pl19 = {},
        footerTop = 0;

    function afixBanner() {
        if (!affixEnabled) {
            return;
        }
        if (window.scrollY > (557-100)) {
            var origW = $('.pl19-text-banner').outerWidth();
            var newTop = 100;
            
            var footerDx = $('#main-footer').position().top - (window.scrollY + $('.pl19-text-banner').height() + 250);
            var footerAvoid = (footerDx <= 0);
            if (footerAvoid) {
                newTop = newTop + footerDx;
            }
            $('.pl19-text-banner').addClass('pl19-affix').attr('style', 'width:' + origW + 'px;top:' + newTop + 'px;');
        } else {
            pl19.removeClass('pl19-affix').attr('style', '');
        }        
    }
    
    function respond() {
        var currentWidth = $(document).width();
        
        if (currentWidth < 880) {
            affixEnabled = false;
            pl19.removeClass('pl19-affix').attr('style', '');
        } else {
            affixEnabled = document.affixPl19;
        }
    };
    
    function setupAffix() {
        $(window).on('scroll', afixBanner);
        $(window).on('resize', respond);
        
        affixEnabled = document.affixPl19; // set default state
        
        mainFooter = $('#main-footer');
        pl19 = $('.pl19-text-banner');

        footerTop = mainFooter.position().top;
                
        respond();
    };
    
    $(document).ready(function () {
        if (document.affixPl19) {
            setupAffix();
        }
        jQuery('.pl19-text-banner .hide-prejs').removeClass('hide-prejs');
    });

})();
;
