/* Minification failed. Returning unminified contents.
(23197,51-52): run-time error JS1013: Syntax error in regular expression: ;
 */
/*!
 * jQuery JavaScript Library v1.9.1
 * http://jquery.com/
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 *
 * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2013-2-4
 */
(function( window, undefined ) {

// Can't do this because several apps including ASP.NET trace
// the stack via arguments.caller.callee and Firefox dies if
// you try to trace through "use strict" call chains. (#13335)
// Support: Firefox 18+
//"use strict";
var
	// The deferred used on DOM ready
	readyList,

	// A central reference to the root jQuery(document)
	rootjQuery,

	// Support: IE<9
	// For `typeof node.method` instead of `node.method !== undefined`
	core_strundefined = typeof undefined,

	// Use the correct document accordingly with window argument (sandbox)
	document = window.document,
	location = window.location,

	// Map over jQuery in case of overwrite
	_jQuery = window.jQuery,

	// Map over the $ in case of overwrite
	_$ = window.$,

	// [[Class]] -> type pairs
	class2type = {},

	// List of deleted data cache ids, so we can reuse them
	core_deletedIds = [],

	core_version = "1.9.1",

	// Save a reference to some core methods
	core_concat = core_deletedIds.concat,
	core_push = core_deletedIds.push,
	core_slice = core_deletedIds.slice,
	core_indexOf = core_deletedIds.indexOf,
	core_toString = class2type.toString,
	core_hasOwn = class2type.hasOwnProperty,
	core_trim = core_version.trim,

	// Define a local copy of jQuery
	jQuery = function( selector, context ) {
		// The jQuery object is actually just the init constructor 'enhanced'
		return new jQuery.fn.init( selector, context, rootjQuery );
	},

	// Used for matching numbers
	core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,

	// Used for splitting on whitespace
	core_rnotwhite = /\S+/g,

	// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
	rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,

	// A simple way to check for HTML strings
	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
	// Strict HTML recognition (#11290: must start with <)
	rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,

	// Match a standalone tag
	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,

	// JSON RegExp
	rvalidchars = /^[\],:{}\s]*$/,
	rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
	rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
	rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,

	// Matches dashed string for camelizing
	rmsPrefix = /^-ms-/,
	rdashAlpha = /-([\da-z])/gi,

	// Used by jQuery.camelCase as callback to replace()
	fcamelCase = function( all, letter ) {
		return letter.toUpperCase();
	},

	// The ready event handler
	completed = function( event ) {

		// readyState === "complete" is good enough for us to call the dom ready in oldIE
		if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
			detach();
			jQuery.ready();
		}
	},
	// Clean-up method for dom ready events
	detach = function() {
		if ( document.addEventListener ) {
			document.removeEventListener( "DOMContentLoaded", completed, false );
			window.removeEventListener( "load", completed, false );

		} else {
			document.detachEvent( "onreadystatechange", completed );
			window.detachEvent( "onload", completed );
		}
	};

jQuery.fn = jQuery.prototype = {
	// The current version of jQuery being used
	jquery: core_version,

	constructor: jQuery,
	init: function( selector, context, rootjQuery ) {
		var match, elem;

		// HANDLE: $(""), $(null), $(undefined), $(false)
		if ( !selector ) {
			return this;
		}

		// Handle HTML strings
		if ( typeof selector === "string" ) {
			if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
				// Assume that strings that start and end with <> are HTML and skip the regex check
				match = [ null, selector, null ];

			} else {
				match = rquickExpr.exec( selector );
			}

			// Match html or make sure no context is specified for #id
			if ( match && (match[1] || !context) ) {

				// HANDLE: $(html) -> $(array)
				if ( match[1] ) {
					context = context instanceof jQuery ? context[0] : context;

					// scripts is true for back-compat
					jQuery.merge( this, jQuery.parseHTML(
						match[1],
						context && context.nodeType ? context.ownerDocument || context : document,
						true
					) );

					// HANDLE: $(html, props)
					if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
						for ( match in context ) {
							// Properties of context are called as methods if possible
							if ( jQuery.isFunction( this[ match ] ) ) {
								this[ match ]( context[ match ] );

							// ...and otherwise set as attributes
							} else {
								this.attr( match, context[ match ] );
							}
						}
					}

					return this;

				// HANDLE: $(#id)
				} else {
					elem = document.getElementById( match[2] );

					// Check parentNode to catch when Blackberry 4.6 returns
					// nodes that are no longer in the document #6963
					if ( elem && elem.parentNode ) {
						// Handle the case where IE and Opera return items
						// by name instead of ID
						if ( elem.id !== match[2] ) {
							return rootjQuery.find( selector );
						}

						// Otherwise, we inject the element directly into the jQuery object
						this.length = 1;
						this[0] = elem;
					}

					this.context = document;
					this.selector = selector;
					return this;
				}

			// HANDLE: $(expr, $(...))
			} else if ( !context || context.jquery ) {
				return ( context || rootjQuery ).find( selector );

			// HANDLE: $(expr, context)
			// (which is just equivalent to: $(context).find(expr)
			} else {
				return this.constructor( context ).find( selector );
			}

		// HANDLE: $(DOMElement)
		} else if ( selector.nodeType ) {
			this.context = this[0] = selector;
			this.length = 1;
			return this;

		// HANDLE: $(function)
		// Shortcut for document ready
		} else if ( jQuery.isFunction( selector ) ) {
			return rootjQuery.ready( selector );
		}

		if ( selector.selector !== undefined ) {
			this.selector = selector.selector;
			this.context = selector.context;
		}

		return jQuery.makeArray( selector, this );
	},

	// Start with an empty selector
	selector: "",

	// The default length of a jQuery object is 0
	length: 0,

	// The number of elements contained in the matched element set
	size: function() {
		return this.length;
	},

	toArray: function() {
		return core_slice.call( this );
	},

	// Get the Nth element in the matched element set OR
	// Get the whole matched element set as a clean array
	get: function( num ) {
		return num == null ?

			// Return a 'clean' array
			this.toArray() :

			// Return just the object
			( num < 0 ? this[ this.length + num ] : this[ num ] );
	},

	// Take an array of elements and push it onto the stack
	// (returning the new matched element set)
	pushStack: function( elems ) {

		// Build a new jQuery matched element set
		var ret = jQuery.merge( this.constructor(), elems );

		// Add the old object onto the stack (as a reference)
		ret.prevObject = this;
		ret.context = this.context;

		// Return the newly-formed element set
		return ret;
	},

	// Execute a callback for every element in the matched set.
	// (You can seed the arguments with an array of args, but this is
	// only used internally.)
	each: function( callback, args ) {
		return jQuery.each( this, callback, args );
	},

	ready: function( fn ) {
		// Add the callback
		jQuery.ready.promise().done( fn );

		return this;
	},

	slice: function() {
		return this.pushStack( core_slice.apply( this, arguments ) );
	},

	first: function() {
		return this.eq( 0 );
	},

	last: function() {
		return this.eq( -1 );
	},

	eq: function( i ) {
		var len = this.length,
			j = +i + ( i < 0 ? len : 0 );
		return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
	},

	map: function( callback ) {
		return this.pushStack( jQuery.map(this, function( elem, i ) {
			return callback.call( elem, i, elem );
		}));
	},

	end: function() {
		return this.prevObject || this.constructor(null);
	},

	// For internal use only.
	// Behaves like an Array's method, not like a jQuery method.
	push: core_push,
	sort: [].sort,
	splice: [].splice
};

// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;

jQuery.extend = jQuery.fn.extend = function() {
	var src, copyIsArray, copy, name, options, clone,
		target = arguments[0] || {},
		i = 1,
		length = arguments.length,
		deep = false;

	// Handle a deep copy situation
	if ( typeof target === "boolean" ) {
		deep = target;
		target = arguments[1] || {};
		// skip the boolean and the target
		i = 2;
	}

	// Handle case when target is a string or something (possible in deep copy)
	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
		target = {};
	}

	// extend jQuery itself if only one argument is passed
	if ( length === i ) {
		target = this;
		--i;
	}

	for ( ; i < length; i++ ) {
		// Only deal with non-null/undefined values
		if ( (options = arguments[ i ]) != null ) {
			// Extend the base object
			for ( name in options ) {
				src = target[ name ];
				copy = options[ name ];

				// Prevent never-ending loop
				if ( target === copy ) {
					continue;
				}

				// Recurse if we're merging plain objects or arrays
				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
					if ( copyIsArray ) {
						copyIsArray = false;
						clone = src && jQuery.isArray(src) ? src : [];

					} else {
						clone = src && jQuery.isPlainObject(src) ? src : {};
					}

					// Never move original objects, clone them
					target[ name ] = jQuery.extend( deep, clone, copy );

				// Don't bring in undefined values
				} else if ( copy !== undefined ) {
					target[ name ] = copy;
				}
			}
		}
	}

	// Return the modified object
	return target;
};

jQuery.extend({
	noConflict: function( deep ) {
		if ( window.$ === jQuery ) {
			window.$ = _$;
		}

		if ( deep && window.jQuery === jQuery ) {
			window.jQuery = _jQuery;
		}

		return jQuery;
	},

	// Is the DOM ready to be used? Set to true once it occurs.
	isReady: false,

	// A counter to track how many items to wait for before
	// the ready event fires. See #6781
	readyWait: 1,

	// Hold (or release) the ready event
	holdReady: function( hold ) {
		if ( hold ) {
			jQuery.readyWait++;
		} else {
			jQuery.ready( true );
		}
	},

	// Handle when the DOM is ready
	ready: function( wait ) {

		// Abort if there are pending holds or we're already ready
		if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
			return;
		}

		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
		if ( !document.body ) {
			return setTimeout( jQuery.ready );
		}

		// Remember that the DOM is ready
		jQuery.isReady = true;

		// If a normal DOM Ready event fired, decrement, and wait if need be
		if ( wait !== true && --jQuery.readyWait > 0 ) {
			return;
		}

		// If there are functions bound, to execute
		readyList.resolveWith( document, [ jQuery ] );

		// Trigger any bound ready events
		if ( jQuery.fn.trigger ) {
			jQuery( document ).trigger("ready").off("ready");
		}
	},

	// See test/unit/core.js for details concerning isFunction.
	// Since version 1.3, DOM methods and functions like alert
	// aren't supported. They return false on IE (#2968).
	isFunction: function( obj ) {
		return jQuery.type(obj) === "function";
	},

	isArray: Array.isArray || function( obj ) {
		return jQuery.type(obj) === "array";
	},

	isWindow: function( obj ) {
		return obj != null && obj == obj.window;
	},

	isNumeric: function( obj ) {
		return !isNaN( parseFloat(obj) ) && isFinite( obj );
	},

	type: function( obj ) {
		if ( obj == null ) {
			return String( obj );
		}
		return typeof obj === "object" || typeof obj === "function" ?
			class2type[ core_toString.call(obj) ] || "object" :
			typeof obj;
	},

	isPlainObject: function( obj ) {
		// Must be an Object.
		// Because of IE, we also have to check the presence of the constructor property.
		// Make sure that DOM nodes and window objects don't pass through, as well
		if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
			return false;
		}

		try {
			// Not own constructor property must be Object
			if ( obj.constructor &&
				!core_hasOwn.call(obj, "constructor") &&
				!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
				return false;
			}
		} catch ( e ) {
			// IE8,9 Will throw exceptions on certain host objects #9897
			return false;
		}

		// Own properties are enumerated firstly, so to speed up,
		// if last one is own, then all properties are own.

		var key;
		for ( key in obj ) {}

		return key === undefined || core_hasOwn.call( obj, key );
	},

	isEmptyObject: function( obj ) {
		var name;
		for ( name in obj ) {
			return false;
		}
		return true;
	},

	error: function( msg ) {
		throw new Error( msg );
	},

	// data: string of html
	// context (optional): If specified, the fragment will be created in this context, defaults to document
	// keepScripts (optional): If true, will include scripts passed in the html string
	parseHTML: function( data, context, keepScripts ) {
		if ( !data || typeof data !== "string" ) {
			return null;
		}
		if ( typeof context === "boolean" ) {
			keepScripts = context;
			context = false;
		}
		context = context || document;

		var parsed = rsingleTag.exec( data ),
			scripts = !keepScripts && [];

		// Single tag
		if ( parsed ) {
			return [ context.createElement( parsed[1] ) ];
		}

		parsed = jQuery.buildFragment( [ data ], context, scripts );
		if ( scripts ) {
			jQuery( scripts ).remove();
		}
		return jQuery.merge( [], parsed.childNodes );
	},

	parseJSON: function( data ) {
		// Attempt to parse using the native JSON parser first
		if ( window.JSON && window.JSON.parse ) {
			return window.JSON.parse( data );
		}

		if ( data === null ) {
			return data;
		}

		if ( typeof data === "string" ) {

			// Make sure leading/trailing whitespace is removed (IE can't handle it)
			data = jQuery.trim( data );

			if ( data ) {
				// Make sure the incoming data is actual JSON
				// Logic borrowed from http://json.org/json2.js
				if ( rvalidchars.test( data.replace( rvalidescape, "@" )
					.replace( rvalidtokens, "]" )
					.replace( rvalidbraces, "")) ) {

					return ( new Function( "return " + data ) )();
				}
			}
		}

		jQuery.error( "Invalid JSON: " + data );
	},

	// Cross-browser xml parsing
	parseXML: function( data ) {
		var xml, tmp;
		if ( !data || typeof data !== "string" ) {
			return null;
		}
		try {
			if ( window.DOMParser ) { // Standard
				tmp = new DOMParser();
				xml = tmp.parseFromString( data , "text/xml" );
			} else { // IE
				xml = new ActiveXObject( "Microsoft.XMLDOM" );
				xml.async = "false";
				xml.loadXML( data );
			}
		} catch( e ) {
			xml = undefined;
		}
		if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
			jQuery.error( "Invalid XML: " + data );
		}
		return xml;
	},

	noop: function() {},

	// Evaluates a script in a global context
	// Workarounds based on findings by Jim Driscoll
	// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
	globalEval: function( data ) {
		if ( data && jQuery.trim( data ) ) {
			// We use execScript on Internet Explorer
			// We use an anonymous function so that context is window
			// rather than jQuery in Firefox
			( window.execScript || function( data ) {
				window[ "eval" ].call( window, data );
			} )( data );
		}
	},

	// Convert dashed to camelCase; used by the css and data modules
	// Microsoft forgot to hump their vendor prefix (#9572)
	camelCase: function( string ) {
		return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
	},

	nodeName: function( elem, name ) {
		return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
	},

	// args is for internal usage only
	each: function( obj, callback, args ) {
		var value,
			i = 0,
			length = obj.length,
			isArray = isArraylike( obj );

		if ( args ) {
			if ( isArray ) {
				for ( ; i < length; i++ ) {
					value = callback.apply( obj[ i ], args );

					if ( value === false ) {
						break;
					}
				}
			} else {
				for ( i in obj ) {
					value = callback.apply( obj[ i ], args );

					if ( value === false ) {
						break;
					}
				}
			}

		// A special, fast, case for the most common use of each
		} else {
			if ( isArray ) {
				for ( ; i < length; i++ ) {
					value = callback.call( obj[ i ], i, obj[ i ] );

					if ( value === false ) {
						break;
					}
				}
			} else {
				for ( i in obj ) {
					value = callback.call( obj[ i ], i, obj[ i ] );

					if ( value === false ) {
						break;
					}
				}
			}
		}

		return obj;
	},

	// Use native String.trim function wherever possible
	trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
		function( text ) {
			return text == null ?
				"" :
				core_trim.call( text );
		} :

		// Otherwise use our own trimming functionality
		function( text ) {
			return text == null ?
				"" :
				( text + "" ).replace( rtrim, "" );
		},

	// results is for internal usage only
	makeArray: function( arr, results ) {
		var ret = results || [];

		if ( arr != null ) {
			if ( isArraylike( Object(arr) ) ) {
				jQuery.merge( ret,
					typeof arr === "string" ?
					[ arr ] : arr
				);
			} else {
				core_push.call( ret, arr );
			}
		}

		return ret;
	},

	inArray: function( elem, arr, i ) {
		var len;

		if ( arr ) {
			if ( core_indexOf ) {
				return core_indexOf.call( arr, elem, i );
			}

			len = arr.length;
			i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;

			for ( ; i < len; i++ ) {
				// Skip accessing in sparse arrays
				if ( i in arr && arr[ i ] === elem ) {
					return i;
				}
			}
		}

		return -1;
	},

	merge: function( first, second ) {
		var l = second.length,
			i = first.length,
			j = 0;

		if ( typeof l === "number" ) {
			for ( ; j < l; j++ ) {
				first[ i++ ] = second[ j ];
			}
		} else {
			while ( second[j] !== undefined ) {
				first[ i++ ] = second[ j++ ];
			}
		}

		first.length = i;

		return first;
	},

	grep: function( elems, callback, inv ) {
		var retVal,
			ret = [],
			i = 0,
			length = elems.length;
		inv = !!inv;

		// Go through the array, only saving the items
		// that pass the validator function
		for ( ; i < length; i++ ) {
			retVal = !!callback( elems[ i ], i );
			if ( inv !== retVal ) {
				ret.push( elems[ i ] );
			}
		}

		return ret;
	},

	// arg is for internal usage only
	map: function( elems, callback, arg ) {
		var value,
			i = 0,
			length = elems.length,
			isArray = isArraylike( elems ),
			ret = [];

		// Go through the array, translating each of the items to their
		if ( isArray ) {
			for ( ; i < length; i++ ) {
				value = callback( elems[ i ], i, arg );

				if ( value != null ) {
					ret[ ret.length ] = value;
				}
			}

		// Go through every key on the object,
		} else {
			for ( i in elems ) {
				value = callback( elems[ i ], i, arg );

				if ( value != null ) {
					ret[ ret.length ] = value;
				}
			}
		}

		// Flatten any nested arrays
		return core_concat.apply( [], ret );
	},

	// A global GUID counter for objects
	guid: 1,

	// Bind a function to a context, optionally partially applying any
	// arguments.
	proxy: function( fn, context ) {
		var args, proxy, tmp;

		if ( typeof context === "string" ) {
			tmp = fn[ context ];
			context = fn;
			fn = tmp;
		}

		// Quick check to determine if target is callable, in the spec
		// this throws a TypeError, but we will just return undefined.
		if ( !jQuery.isFunction( fn ) ) {
			return undefined;
		}

		// Simulated bind
		args = core_slice.call( arguments, 2 );
		proxy = function() {
			return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
		};

		// Set the guid of unique handler to the same of original handler, so it can be removed
		proxy.guid = fn.guid = fn.guid || jQuery.guid++;

		return proxy;
	},

	// Multifunctional method to get and set values of a collection
	// The value/s can optionally be executed if it's a function
	access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
		var i = 0,
			length = elems.length,
			bulk = key == null;

		// Sets many values
		if ( jQuery.type( key ) === "object" ) {
			chainable = true;
			for ( i in key ) {
				jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
			}

		// Sets one value
		} else if ( value !== undefined ) {
			chainable = true;

			if ( !jQuery.isFunction( value ) ) {
				raw = true;
			}

			if ( bulk ) {
				// Bulk operations run against the entire set
				if ( raw ) {
					fn.call( elems, value );
					fn = null;

				// ...except when executing function values
				} else {
					bulk = fn;
					fn = function( elem, key, value ) {
						return bulk.call( jQuery( elem ), value );
					};
				}
			}

			if ( fn ) {
				for ( ; i < length; i++ ) {
					fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
				}
			}
		}

		return chainable ?
			elems :

			// Gets
			bulk ?
				fn.call( elems ) :
				length ? fn( elems[0], key ) : emptyGet;
	},

	now: function() {
		return ( new Date() ).getTime();
	}
});

jQuery.ready.promise = function( obj ) {
	if ( !readyList ) {

		readyList = jQuery.Deferred();

		// Catch cases where $(document).ready() is called after the browser event has already occurred.
		// we once tried to use readyState "interactive" here, but it caused issues like the one
		// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
		if ( document.readyState === "complete" ) {
			// Handle it asynchronously to allow scripts the opportunity to delay ready
			setTimeout( jQuery.ready );

		// Standards-based browsers support DOMContentLoaded
		} else if ( document.addEventListener ) {
			// Use the handy event callback
			document.addEventListener( "DOMContentLoaded", completed, false );

			// A fallback to window.onload, that will always work
			window.addEventListener( "load", completed, false );

		// If IE event model is used
		} else {
			// Ensure firing before onload, maybe late but safe also for iframes
			document.attachEvent( "onreadystatechange", completed );

			// A fallback to window.onload, that will always work
			window.attachEvent( "onload", completed );

			// If IE and not a frame
			// continually check to see if the document is ready
			var top = false;

			try {
				top = window.frameElement == null && document.documentElement;
			} catch(e) {}

			if ( top && top.doScroll ) {
				(function doScrollCheck() {
					if ( !jQuery.isReady ) {

						try {
							// Use the trick by Diego Perini
							// http://javascript.nwbox.com/IEContentLoaded/
							top.doScroll("left");
						} catch(e) {
							return setTimeout( doScrollCheck, 50 );
						}

						// detach all dom ready events
						detach();

						// and execute any waiting functions
						jQuery.ready();
					}
				})();
			}
		}
	}
	return readyList.promise( obj );
};

// Populate the class2type map
jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
	class2type[ "[object " + name + "]" ] = name.toLowerCase();
});

function isArraylike( obj ) {
	var length = obj.length,
		type = jQuery.type( obj );

	if ( jQuery.isWindow( obj ) ) {
		return false;
	}

	if ( obj.nodeType === 1 && length ) {
		return true;
	}

	return type === "array" || type !== "function" &&
		( length === 0 ||
		typeof length === "number" && length > 0 && ( length - 1 ) in obj );
}

// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// String to Object options format cache
var optionsCache = {};

// Convert String-formatted options into Object-formatted ones and store in cache
function createOptions( options ) {
	var object = optionsCache[ options ] = {};
	jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
		object[ flag ] = true;
	});
	return object;
}

/*
 * Create a callback list using the following parameters:
 *
 *	options: an optional list of space-separated options that will change how
 *			the callback list behaves or a more traditional option object
 *
 * By default a callback list will act like an event callback list and can be
 * "fired" multiple times.
 *
 * Possible options:
 *
 *	once:			will ensure the callback list can only be fired once (like a Deferred)
 *
 *	memory:			will keep track of previous values and will call any callback added
 *					after the list has been fired right away with the latest "memorized"
 *					values (like a Deferred)
 *
 *	unique:			will ensure a callback can only be added once (no duplicate in the list)
 *
 *	stopOnFalse:	interrupt callings when a callback returns false
 *
 */
jQuery.Callbacks = function( options ) {

	// Convert options from String-formatted to Object-formatted if needed
	// (we check in cache first)
	options = typeof options === "string" ?
		( optionsCache[ options ] || createOptions( options ) ) :
		jQuery.extend( {}, options );

	var // Flag to know if list is currently firing
		firing,
		// Last fire value (for non-forgettable lists)
		memory,
		// Flag to know if list was already fired
		fired,
		// End of the loop when firing
		firingLength,
		// Index of currently firing callback (modified by remove if needed)
		firingIndex,
		// First callback to fire (used internally by add and fireWith)
		firingStart,
		// Actual callback list
		list = [],
		// Stack of fire calls for repeatable lists
		stack = !options.once && [],
		// Fire callbacks
		fire = function( data ) {
			memory = options.memory && data;
			fired = true;
			firingIndex = firingStart || 0;
			firingStart = 0;
			firingLength = list.length;
			firing = true;
			for ( ; list && firingIndex < firingLength; firingIndex++ ) {
				if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
					memory = false; // To prevent further calls using add
					break;
				}
			}
			firing = false;
			if ( list ) {
				if ( stack ) {
					if ( stack.length ) {
						fire( stack.shift() );
					}
				} else if ( memory ) {
					list = [];
				} else {
					self.disable();
				}
			}
		},
		// Actual Callbacks object
		self = {
			// Add a callback or a collection of callbacks to the list
			add: function() {
				if ( list ) {
					// First, we save the current length
					var start = list.length;
					(function add( args ) {
						jQuery.each( args, function( _, arg ) {
							var type = jQuery.type( arg );
							if ( type === "function" ) {
								if ( !options.unique || !self.has( arg ) ) {
									list.push( arg );
								}
							} else if ( arg && arg.length && type !== "string" ) {
								// Inspect recursively
								add( arg );
							}
						});
					})( arguments );
					// Do we need to add the callbacks to the
					// current firing batch?
					if ( firing ) {
						firingLength = list.length;
					// With memory, if we're not firing then
					// we should call right away
					} else if ( memory ) {
						firingStart = start;
						fire( memory );
					}
				}
				return this;
			},
			// Remove a callback from the list
			remove: function() {
				if ( list ) {
					jQuery.each( arguments, function( _, arg ) {
						var index;
						while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
							list.splice( index, 1 );
							// Handle firing indexes
							if ( firing ) {
								if ( index <= firingLength ) {
									firingLength--;
								}
								if ( index <= firingIndex ) {
									firingIndex--;
								}
							}
						}
					});
				}
				return this;
			},
			// Check if a given callback is in the list.
			// If no argument is given, return whether or not list has callbacks attached.
			has: function( fn ) {
				return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
			},
			// Remove all callbacks from the list
			empty: function() {
				list = [];
				return this;
			},
			// Have the list do nothing anymore
			disable: function() {
				list = stack = memory = undefined;
				return this;
			},
			// Is it disabled?
			disabled: function() {
				return !list;
			},
			// Lock the list in its current state
			lock: function() {
				stack = undefined;
				if ( !memory ) {
					self.disable();
				}
				return this;
			},
			// Is it locked?
			locked: function() {
				return !stack;
			},
			// Call all callbacks with the given context and arguments
			fireWith: function( context, args ) {
				args = args || [];
				args = [ context, args.slice ? args.slice() : args ];
				if ( list && ( !fired || stack ) ) {
					if ( firing ) {
						stack.push( args );
					} else {
						fire( args );
					}
				}
				return this;
			},
			// Call all the callbacks with the given arguments
			fire: function() {
				self.fireWith( this, arguments );
				return this;
			},
			// To know if the callbacks have already been called at least once
			fired: function() {
				return !!fired;
			}
		};

	return self;
};
jQuery.extend({

	Deferred: function( func ) {
		var tuples = [
				// action, add listener, listener list, final state
				[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
				[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
				[ "notify", "progress", jQuery.Callbacks("memory") ]
			],
			state = "pending",
			promise = {
				state: function() {
					return state;
				},
				always: function() {
					deferred.done( arguments ).fail( arguments );
					return this;
				},
				then: function( /* fnDone, fnFail, fnProgress */ ) {
					var fns = arguments;
					return jQuery.Deferred(function( newDefer ) {
						jQuery.each( tuples, function( i, tuple ) {
							var action = tuple[ 0 ],
								fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
							// deferred[ done | fail | progress ] for forwarding actions to newDefer
							deferred[ tuple[1] ](function() {
								var returned = fn && fn.apply( this, arguments );
								if ( returned && jQuery.isFunction( returned.promise ) ) {
									returned.promise()
										.done( newDefer.resolve )
										.fail( newDefer.reject )
										.progress( newDefer.notify );
								} else {
									newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
								}
							});
						});
						fns = null;
					}).promise();
				},
				// Get a promise for this deferred
				// If obj is provided, the promise aspect is added to the object
				promise: function( obj ) {
					return obj != null ? jQuery.extend( obj, promise ) : promise;
				}
			},
			deferred = {};

		// Keep pipe for back-compat
		promise.pipe = promise.then;

		// Add list-specific methods
		jQuery.each( tuples, function( i, tuple ) {
			var list = tuple[ 2 ],
				stateString = tuple[ 3 ];

			// promise[ done | fail | progress ] = list.add
			promise[ tuple[1] ] = list.add;

			// Handle state
			if ( stateString ) {
				list.add(function() {
					// state = [ resolved | rejected ]
					state = stateString;

				// [ reject_list | resolve_list ].disable; progress_list.lock
				}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
			}

			// deferred[ resolve | reject | notify ]
			deferred[ tuple[0] ] = function() {
				deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
				return this;
			};
			deferred[ tuple[0] + "With" ] = list.fireWith;
		});

		// Make the deferred a promise
		promise.promise( deferred );

		// Call given func if any
		if ( func ) {
			func.call( deferred, deferred );
		}

		// All done!
		return deferred;
	},

	// Deferred helper
	when: function( subordinate /* , ..., subordinateN */ ) {
		var i = 0,
			resolveValues = core_slice.call( arguments ),
			length = resolveValues.length,

			// the count of uncompleted subordinates
			remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,

			// the master Deferred. If resolveValues consist of only a single Deferred, just use that.
			deferred = remaining === 1 ? subordinate : jQuery.Deferred(),

			// Update function for both resolve and progress values
			updateFunc = function( i, contexts, values ) {
				return function( value ) {
					contexts[ i ] = this;
					values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
					if( values === progressValues ) {
						deferred.notifyWith( contexts, values );
					} else if ( !( --remaining ) ) {
						deferred.resolveWith( contexts, values );
					}
				};
			},

			progressValues, progressContexts, resolveContexts;

		// add listeners to Deferred subordinates; treat others as resolved
		if ( length > 1 ) {
			progressValues = new Array( length );
			progressContexts = new Array( length );
			resolveContexts = new Array( length );
			for ( ; i < length; i++ ) {
				if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
					resolveValues[ i ].promise()
						.done( updateFunc( i, resolveContexts, resolveValues ) )
						.fail( deferred.reject )
						.progress( updateFunc( i, progressContexts, progressValues ) );
				} else {
					--remaining;
				}
			}
		}

		// if we're not waiting on anything, resolve the master
		if ( !remaining ) {
			deferred.resolveWith( resolveContexts, resolveValues );
		}

		return deferred.promise();
	}
});
jQuery.support = (function() {

	var support, all, a,
		input, select, fragment,
		opt, eventName, isSupported, i,
		div = document.createElement("div");

	// Setup
	div.setAttribute( "className", "t" );
	div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";

	// Support tests won't run in some limited or non-browser environments
	all = div.getElementsByTagName("*");
	a = div.getElementsByTagName("a")[ 0 ];
	if ( !all || !a || !all.length ) {
		return {};
	}

	// First batch of tests
	select = document.createElement("select");
	opt = select.appendChild( document.createElement("option") );
	input = div.getElementsByTagName("input")[ 0 ];

	a.style.cssText = "top:1px;float:left;opacity:.5";
	support = {
		// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
		getSetAttribute: div.className !== "t",

		// IE strips leading whitespace when .innerHTML is used
		leadingWhitespace: div.firstChild.nodeType === 3,

		// Make sure that tbody elements aren't automatically inserted
		// IE will insert them into empty tables
		tbody: !div.getElementsByTagName("tbody").length,

		// Make sure that link elements get serialized correctly by innerHTML
		// This requires a wrapper element in IE
		htmlSerialize: !!div.getElementsByTagName("link").length,

		// Get the style information from getAttribute
		// (IE uses .cssText instead)
		style: /top/.test( a.getAttribute("style") ),

		// Make sure that URLs aren't manipulated
		// (IE normalizes it by default)
		hrefNormalized: a.getAttribute("href") === "/a",

		// Make sure that element opacity exists
		// (IE uses filter instead)
		// Use a regex to work around a WebKit issue. See #5145
		opacity: /^0.5/.test( a.style.opacity ),

		// Verify style float existence
		// (IE uses styleFloat instead of cssFloat)
		cssFloat: !!a.style.cssFloat,

		// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
		checkOn: !!input.value,

		// Make sure that a selected-by-default option has a working selected property.
		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
		optSelected: opt.selected,

		// Tests for enctype support on a form (#6743)
		enctype: !!document.createElement("form").enctype,

		// Makes sure cloning an html5 element does not cause problems
		// Where outerHTML is undefined, this still works
		html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",

		// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
		boxModel: document.compatMode === "CSS1Compat",

		// Will be defined later
		deleteExpando: true,
		noCloneEvent: true,
		inlineBlockNeedsLayout: false,
		shrinkWrapBlocks: false,
		reliableMarginRight: true,
		boxSizingReliable: true,
		pixelPosition: false
	};

	// Make sure checked status is properly cloned
	input.checked = true;
	support.noCloneChecked = input.cloneNode( true ).checked;

	// Make sure that the options inside disabled selects aren't marked as disabled
	// (WebKit marks them as disabled)
	select.disabled = true;
	support.optDisabled = !opt.disabled;

	// Support: IE<9
	try {
		delete div.test;
	} catch( e ) {
		support.deleteExpando = false;
	}

	// Check if we can trust getAttribute("value")
	input = document.createElement("input");
	input.setAttribute( "value", "" );
	support.input = input.getAttribute( "value" ) === "";

	// Check if an input maintains its value after becoming a radio
	input.value = "t";
	input.setAttribute( "type", "radio" );
	support.radioValue = input.value === "t";

	// #11217 - WebKit loses check when the name is after the checked attribute
	input.setAttribute( "checked", "t" );
	input.setAttribute( "name", "t" );

	fragment = document.createDocumentFragment();
	fragment.appendChild( input );

	// Check if a disconnected checkbox will retain its checked
	// value of true after appended to the DOM (IE6/7)
	support.appendChecked = input.checked;

	// WebKit doesn't clone checked state correctly in fragments
	support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;

	// Support: IE<9
	// Opera does not clone events (and typeof div.attachEvent === undefined).
	// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
	if ( div.attachEvent ) {
		div.attachEvent( "onclick", function() {
			support.noCloneEvent = false;
		});

		div.cloneNode( true ).click();
	}

	// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
	// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
	for ( i in { submit: true, change: true, focusin: true }) {
		div.setAttribute( eventName = "on" + i, "t" );

		support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
	}

	div.style.backgroundClip = "content-box";
	div.cloneNode( true ).style.backgroundClip = "";
	support.clearCloneStyle = div.style.backgroundClip === "content-box";

	// Run tests that need a body at doc ready
	jQuery(function() {
		var container, marginDiv, tds,
			divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
			body = document.getElementsByTagName("body")[0];

		if ( !body ) {
			// Return for frameset docs that don't have a body
			return;
		}

		container = document.createElement("div");
		container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";

		body.appendChild( container ).appendChild( div );

		// Support: IE8
		// Check if table cells still have offsetWidth/Height when they are set
		// to display:none and there are still other visible table cells in a
		// table row; if so, offsetWidth/Height are not reliable for use when
		// determining if an element has been hidden directly using
		// display:none (it is still safe to use offsets if a parent element is
		// hidden; don safety goggles and see bug #4512 for more information).
		div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
		tds = div.getElementsByTagName("td");
		tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
		isSupported = ( tds[ 0 ].offsetHeight === 0 );

		tds[ 0 ].style.display = "";
		tds[ 1 ].style.display = "none";

		// Support: IE8
		// Check if empty table cells still have offsetWidth/Height
		support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );

		// Check box-sizing and margin behavior
		div.innerHTML = "";
		div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
		support.boxSizing = ( div.offsetWidth === 4 );
		support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );

		// Use window.getComputedStyle because jsdom on node.js will break without it.
		if ( window.getComputedStyle ) {
			support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
			support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";

			// Check if div with explicit width and no margin-right incorrectly
			// gets computed margin-right based on width of container. (#3333)
			// Fails in WebKit before Feb 2011 nightlies
			// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
			marginDiv = div.appendChild( document.createElement("div") );
			marginDiv.style.cssText = div.style.cssText = divReset;
			marginDiv.style.marginRight = marginDiv.style.width = "0";
			div.style.width = "1px";

			support.reliableMarginRight =
				!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
		}

		if ( typeof div.style.zoom !== core_strundefined ) {
			// Support: IE<8
			// Check if natively block-level elements act like inline-block
			// elements when setting their display to 'inline' and giving
			// them layout
			div.innerHTML = "";
			div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
			support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );

			// Support: IE6
			// Check if elements with layout shrink-wrap their children
			div.style.display = "block";
			div.innerHTML = "<div></div>";
			div.firstChild.style.width = "5px";
			support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );

			if ( support.inlineBlockNeedsLayout ) {
				// Prevent IE 6 from affecting layout for positioned elements #11048
				// Prevent IE from shrinking the body in IE 7 mode #12869
				// Support: IE<8
				body.style.zoom = 1;
			}
		}

		body.removeChild( container );

		// Null elements to avoid leaks in IE
		container = div = tds = marginDiv = null;
	});

	// Null elements to avoid leaks in IE
	all = select = fragment = opt = a = input = null;

	return support;
})();

var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
	rmultiDash = /([A-Z])/g;

function internalData( elem, name, data, pvt /* Internal Use Only */ ){
	if ( !jQuery.acceptData( elem ) ) {
		return;
	}

	var thisCache, ret,
		internalKey = jQuery.expando,
		getByName = typeof name === "string",

		// We have to handle DOM nodes and JS objects differently because IE6-7
		// can't GC object references properly across the DOM-JS boundary
		isNode = elem.nodeType,

		// Only DOM nodes need the global jQuery cache; JS object data is
		// attached directly to the object so GC can occur automatically
		cache = isNode ? jQuery.cache : elem,

		// Only defining an ID for JS objects if its cache already exists allows
		// the code to shortcut on the same path as a DOM node with no cache
		id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;

	// Avoid doing any more work than we need to when trying to get data on an
	// object that has no data at all
	if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
		return;
	}

	if ( !id ) {
		// Only DOM nodes need a new unique ID for each element since their data
		// ends up in the global cache
		if ( isNode ) {
			elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
		} else {
			id = internalKey;
		}
	}

	if ( !cache[ id ] ) {
		cache[ id ] = {};

		// Avoids exposing jQuery metadata on plain JS objects when the object
		// is serialized using JSON.stringify
		if ( !isNode ) {
			cache[ id ].toJSON = jQuery.noop;
		}
	}

	// An object can be passed to jQuery.data instead of a key/value pair; this gets
	// shallow copied over onto the existing cache
	if ( typeof name === "object" || typeof name === "function" ) {
		if ( pvt ) {
			cache[ id ] = jQuery.extend( cache[ id ], name );
		} else {
			cache[ id ].data = jQuery.extend( cache[ id ].data, name );
		}
	}

	thisCache = cache[ id ];

	// jQuery data() is stored in a separate object inside the object's internal data
	// cache in order to avoid key collisions between internal data and user-defined
	// data.
	if ( !pvt ) {
		if ( !thisCache.data ) {
			thisCache.data = {};
		}

		thisCache = thisCache.data;
	}

	if ( data !== undefined ) {
		thisCache[ jQuery.camelCase( name ) ] = data;
	}

	// Check for both converted-to-camel and non-converted data property names
	// If a data property was specified
	if ( getByName ) {

		// First Try to find as-is property data
		ret = thisCache[ name ];

		// Test for null|undefined property data
		if ( ret == null ) {

			// Try to find the camelCased property
			ret = thisCache[ jQuery.camelCase( name ) ];
		}
	} else {
		ret = thisCache;
	}

	return ret;
}

function internalRemoveData( elem, name, pvt ) {
	if ( !jQuery.acceptData( elem ) ) {
		return;
	}

	var i, l, thisCache,
		isNode = elem.nodeType,

		// See jQuery.data for more information
		cache = isNode ? jQuery.cache : elem,
		id = isNode ? elem[ jQuery.expando ] : jQuery.expando;

	// If there is already no cache entry for this object, there is no
	// purpose in continuing
	if ( !cache[ id ] ) {
		return;
	}

	if ( name ) {

		thisCache = pvt ? cache[ id ] : cache[ id ].data;

		if ( thisCache ) {

			// Support array or space separated string names for data keys
			if ( !jQuery.isArray( name ) ) {

				// try the string as a key before any manipulation
				if ( name in thisCache ) {
					name = [ name ];
				} else {

					// split the camel cased version by spaces unless a key with the spaces exists
					name = jQuery.camelCase( name );
					if ( name in thisCache ) {
						name = [ name ];
					} else {
						name = name.split(" ");
					}
				}
			} else {
				// If "name" is an array of keys...
				// When data is initially created, via ("key", "val") signature,
				// keys will be converted to camelCase.
				// Since there is no way to tell _how_ a key was added, remove
				// both plain key and camelCase key. #12786
				// This will only penalize the array argument path.
				name = name.concat( jQuery.map( name, jQuery.camelCase ) );
			}

			for ( i = 0, l = name.length; i < l; i++ ) {
				delete thisCache[ name[i] ];
			}

			// If there is no data left in the cache, we want to continue
			// and let the cache object itself get destroyed
			if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
				return;
			}
		}
	}

	// See jQuery.data for more information
	if ( !pvt ) {
		delete cache[ id ].data;

		// Don't destroy the parent cache unless the internal data object
		// had been the only thing left in it
		if ( !isEmptyDataObject( cache[ id ] ) ) {
			return;
		}
	}

	// Destroy the cache
	if ( isNode ) {
		jQuery.cleanData( [ elem ], true );

	// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
	} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
		delete cache[ id ];

	// When all else fails, null
	} else {
		cache[ id ] = null;
	}
}

jQuery.extend({
	cache: {},

	// Unique for each copy of jQuery on the page
	// Non-digits removed to match rinlinejQuery
	expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),

	// The following elements throw uncatchable exceptions if you
	// attempt to add expando properties to them.
	noData: {
		"embed": true,
		// Ban all objects except for Flash (which handle expandos)
		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
		"applet": true
	},

	hasData: function( elem ) {
		elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
		return !!elem && !isEmptyDataObject( elem );
	},

	data: function( elem, name, data ) {
		return internalData( elem, name, data );
	},

	removeData: function( elem, name ) {
		return internalRemoveData( elem, name );
	},

	// For internal use only.
	_data: function( elem, name, data ) {
		return internalData( elem, name, data, true );
	},

	_removeData: function( elem, name ) {
		return internalRemoveData( elem, name, true );
	},

	// A method for determining if a DOM node can handle the data expando
	acceptData: function( elem ) {
		// Do not set data on non-element because it will not be cleared (#8335).
		if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
			return false;
		}

		var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];

		// nodes accept data unless otherwise specified; rejection can be conditional
		return !noData || noData !== true && elem.getAttribute("classid") === noData;
	}
});

jQuery.fn.extend({
	data: function( key, value ) {
		var attrs, name,
			elem = this[0],
			i = 0,
			data = null;

		// Gets all values
		if ( key === undefined ) {
			if ( this.length ) {
				data = jQuery.data( elem );

				if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
					attrs = elem.attributes;
					for ( ; i < attrs.length; i++ ) {
						name = attrs[i].name;

						if ( !name.indexOf( "data-" ) ) {
							name = jQuery.camelCase( name.slice(5) );

							dataAttr( elem, name, data[ name ] );
						}
					}
					jQuery._data( elem, "parsedAttrs", true );
				}
			}

			return data;
		}

		// Sets multiple values
		if ( typeof key === "object" ) {
			return this.each(function() {
				jQuery.data( this, key );
			});
		}

		return jQuery.access( this, function( value ) {

			if ( value === undefined ) {
				// Try to fetch any internally stored data first
				return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
			}

			this.each(function() {
				jQuery.data( this, key, value );
			});
		}, null, value, arguments.length > 1, null, true );
	},

	removeData: function( key ) {
		return this.each(function() {
			jQuery.removeData( this, key );
		});
	}
});

function dataAttr( elem, key, data ) {
	// If nothing was found internally, try to fetch any
	// data from the HTML5 data-* attribute
	if ( data === undefined && elem.nodeType === 1 ) {

		var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();

		data = elem.getAttribute( name );

		if ( typeof data === "string" ) {
			try {
				data = data === "true" ? true :
					data === "false" ? false :
					data === "null" ? null :
					// Only convert to a number if it doesn't change the string
					+data + "" === data ? +data :
					rbrace.test( data ) ? jQuery.parseJSON( data ) :
						data;
			} catch( e ) {}

			// Make sure we set the data so it isn't changed later
			jQuery.data( elem, key, data );

		} else {
			data = undefined;
		}
	}

	return data;
}

// checks a cache object for emptiness
function isEmptyDataObject( obj ) {
	var name;
	for ( name in obj ) {

		// if the public data object is empty, the private is still empty
		if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
			continue;
		}
		if ( name !== "toJSON" ) {
			return false;
		}
	}

	return true;
}
jQuery.extend({
	queue: function( elem, type, data ) {
		var queue;

		if ( elem ) {
			type = ( type || "fx" ) + "queue";
			queue = jQuery._data( elem, type );

			// Speed up dequeue by getting out quickly if this is just a lookup
			if ( data ) {
				if ( !queue || jQuery.isArray(data) ) {
					queue = jQuery._data( elem, type, jQuery.makeArray(data) );
				} else {
					queue.push( data );
				}
			}
			return queue || [];
		}
	},

	dequeue: function( elem, type ) {
		type = type || "fx";

		var queue = jQuery.queue( elem, type ),
			startLength = queue.length,
			fn = queue.shift(),
			hooks = jQuery._queueHooks( elem, type ),
			next = function() {
				jQuery.dequeue( elem, type );
			};

		// If the fx queue is dequeued, always remove the progress sentinel
		if ( fn === "inprogress" ) {
			fn = queue.shift();
			startLength--;
		}

		hooks.cur = fn;
		if ( fn ) {

			// Add a progress sentinel to prevent the fx queue from being
			// automatically dequeued
			if ( type === "fx" ) {
				queue.unshift( "inprogress" );
			}

			// clear up the last queue stop function
			delete hooks.stop;
			fn.call( elem, next, hooks );
		}

		if ( !startLength && hooks ) {
			hooks.empty.fire();
		}
	},

	// not intended for public consumption - generates a queueHooks object, or returns the current one
	_queueHooks: function( elem, type ) {
		var key = type + "queueHooks";
		return jQuery._data( elem, key ) || jQuery._data( elem, key, {
			empty: jQuery.Callbacks("once memory").add(function() {
				jQuery._removeData( elem, type + "queue" );
				jQuery._removeData( elem, key );
			})
		});
	}
});

jQuery.fn.extend({
	queue: function( type, data ) {
		var setter = 2;

		if ( typeof type !== "string" ) {
			data = type;
			type = "fx";
			setter--;
		}

		if ( arguments.length < setter ) {
			return jQuery.queue( this[0], type );
		}

		return data === undefined ?
			this :
			this.each(function() {
				var queue = jQuery.queue( this, type, data );

				// ensure a hooks for this queue
				jQuery._queueHooks( this, type );

				if ( type === "fx" && queue[0] !== "inprogress" ) {
					jQuery.dequeue( this, type );
				}
			});
	},
	dequeue: function( type ) {
		return this.each(function() {
			jQuery.dequeue( this, type );
		});
	},
	// Based off of the plugin by Clint Helfers, with permission.
	// http://blindsignals.com/index.php/2009/07/jquery-delay/
	delay: function( time, type ) {
		time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
		type = type || "fx";

		return this.queue( type, function( next, hooks ) {
			var timeout = setTimeout( next, time );
			hooks.stop = function() {
				clearTimeout( timeout );
			};
		});
	},
	clearQueue: function( type ) {
		return this.queue( type || "fx", [] );
	},
	// Get a promise resolved when queues of a certain type
	// are emptied (fx is the type by default)
	promise: function( type, obj ) {
		var tmp,
			count = 1,
			defer = jQuery.Deferred(),
			elements = this,
			i = this.length,
			resolve = function() {
				if ( !( --count ) ) {
					defer.resolveWith( elements, [ elements ] );
				}
			};

		if ( typeof type !== "string" ) {
			obj = type;
			type = undefined;
		}
		type = type || "fx";

		while( i-- ) {
			tmp = jQuery._data( elements[ i ], type + "queueHooks" );
			if ( tmp && tmp.empty ) {
				count++;
				tmp.empty.add( resolve );
			}
		}
		resolve();
		return defer.promise( obj );
	}
});
var nodeHook, boolHook,
	rclass = /[\t\r\n]/g,
	rreturn = /\r/g,
	rfocusable = /^(?:input|select|textarea|button|object)$/i,
	rclickable = /^(?:a|area)$/i,
	rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
	ruseDefault = /^(?:checked|selected)$/i,
	getSetAttribute = jQuery.support.getSetAttribute,
	getSetInput = jQuery.support.input;

jQuery.fn.extend({
	attr: function( name, value ) {
		return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
	},

	removeAttr: function( name ) {
		return this.each(function() {
			jQuery.removeAttr( this, name );
		});
	},

	prop: function( name, value ) {
		return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
	},

	removeProp: function( name ) {
		name = jQuery.propFix[ name ] || name;
		return this.each(function() {
			// try/catch handles cases where IE balks (such as removing a property on window)
			try {
				this[ name ] = undefined;
				delete this[ name ];
			} catch( e ) {}
		});
	},

	addClass: function( value ) {
		var classes, elem, cur, clazz, j,
			i = 0,
			len = this.length,
			proceed = typeof value === "string" && value;

		if ( jQuery.isFunction( value ) ) {
			return this.each(function( j ) {
				jQuery( this ).addClass( value.call( this, j, this.className ) );
			});
		}

		if ( proceed ) {
			// The disjunction here is for better compressibility (see removeClass)
			classes = ( value || "" ).match( core_rnotwhite ) || [];

			for ( ; i < len; i++ ) {
				elem = this[ i ];
				cur = elem.nodeType === 1 && ( elem.className ?
					( " " + elem.className + " " ).replace( rclass, " " ) :
					" "
				);

				if ( cur ) {
					j = 0;
					while ( (clazz = classes[j++]) ) {
						if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
							cur += clazz + " ";
						}
					}
					elem.className = jQuery.trim( cur );

				}
			}
		}

		return this;
	},

	removeClass: function( value ) {
		var classes, elem, cur, clazz, j,
			i = 0,
			len = this.length,
			proceed = arguments.length === 0 || typeof value === "string" && value;

		if ( jQuery.isFunction( value ) ) {
			return this.each(function( j ) {
				jQuery( this ).removeClass( value.call( this, j, this.className ) );
			});
		}
		if ( proceed ) {
			classes = ( value || "" ).match( core_rnotwhite ) || [];

			for ( ; i < len; i++ ) {
				elem = this[ i ];
				// This expression is here for better compressibility (see addClass)
				cur = elem.nodeType === 1 && ( elem.className ?
					( " " + elem.className + " " ).replace( rclass, " " ) :
					""
				);

				if ( cur ) {
					j = 0;
					while ( (clazz = classes[j++]) ) {
						// Remove *all* instances
						while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
							cur = cur.replace( " " + clazz + " ", " " );
						}
					}
					elem.className = value ? jQuery.trim( cur ) : "";
				}
			}
		}

		return this;
	},

	toggleClass: function( value, stateVal ) {
		var type = typeof value,
			isBool = typeof stateVal === "boolean";

		if ( jQuery.isFunction( value ) ) {
			return this.each(function( i ) {
				jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
			});
		}

		return this.each(function() {
			if ( type === "string" ) {
				// toggle individual class names
				var className,
					i = 0,
					self = jQuery( this ),
					state = stateVal,
					classNames = value.match( core_rnotwhite ) || [];

				while ( (className = classNames[ i++ ]) ) {
					// check each className given, space separated list
					state = isBool ? state : !self.hasClass( className );
					self[ state ? "addClass" : "removeClass" ]( className );
				}

			// Toggle whole class name
			} else if ( type === core_strundefined || type === "boolean" ) {
				if ( this.className ) {
					// store className if set
					jQuery._data( this, "__className__", this.className );
				}

				// If the element has a class name or if we're passed "false",
				// then remove the whole classname (if there was one, the above saved it).
				// Otherwise bring back whatever was previously saved (if anything),
				// falling back to the empty string if nothing was stored.
				this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
			}
		});
	},

	hasClass: function( selector ) {
		var className = " " + selector + " ",
			i = 0,
			l = this.length;
		for ( ; i < l; i++ ) {
			if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
				return true;
			}
		}

		return false;
	},

	val: function( value ) {
		var ret, hooks, isFunction,
			elem = this[0];

		if ( !arguments.length ) {
			if ( elem ) {
				hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];

				if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
					return ret;
				}

				ret = elem.value;

				return typeof ret === "string" ?
					// handle most common string cases
					ret.replace(rreturn, "") :
					// handle cases where value is null/undef or number
					ret == null ? "" : ret;
			}

			return;
		}

		isFunction = jQuery.isFunction( value );

		return this.each(function( i ) {
			var val,
				self = jQuery(this);

			if ( this.nodeType !== 1 ) {
				return;
			}

			if ( isFunction ) {
				val = value.call( this, i, self.val() );
			} else {
				val = value;
			}

			// Treat null/undefined as ""; convert numbers to string
			if ( val == null ) {
				val = "";
			} else if ( typeof val === "number" ) {
				val += "";
			} else if ( jQuery.isArray( val ) ) {
				val = jQuery.map(val, function ( value ) {
					return value == null ? "" : value + "";
				});
			}

			hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];

			// If set returns undefined, fall back to normal setting
			if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
				this.value = val;
			}
		});
	}
});

jQuery.extend({
	valHooks: {
		option: {
			get: function( elem ) {
				// attributes.value is undefined in Blackberry 4.7 but
				// uses .value. See #6932
				var val = elem.attributes.value;
				return !val || val.specified ? elem.value : elem.text;
			}
		},
		select: {
			get: function( elem ) {
				var value, option,
					options = elem.options,
					index = elem.selectedIndex,
					one = elem.type === "select-one" || index < 0,
					values = one ? null : [],
					max = one ? index + 1 : options.length,
					i = index < 0 ?
						max :
						one ? index : 0;

				// Loop through all the selected options
				for ( ; i < max; i++ ) {
					option = options[ i ];

					// oldIE doesn't update selected after form reset (#2551)
					if ( ( option.selected || i === index ) &&
							// Don't return options that are disabled or in a disabled optgroup
							( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
							( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {

						// Get the specific value for the option
						value = jQuery( option ).val();

						// We don't need an array for one selects
						if ( one ) {
							return value;
						}

						// Multi-Selects return an array
						values.push( value );
					}
				}

				return values;
			},

			set: function( elem, value ) {
				var values = jQuery.makeArray( value );

				jQuery(elem).find("option").each(function() {
					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
				});

				if ( !values.length ) {
					elem.selectedIndex = -1;
				}
				return values;
			}
		}
	},

	attr: function( elem, name, value ) {
		var hooks, notxml, ret,
			nType = elem.nodeType;

		// don't get/set attributes on text, comment and attribute nodes
		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
			return;
		}

		// Fallback to prop when attributes are not supported
		if ( typeof elem.getAttribute === core_strundefined ) {
			return jQuery.prop( elem, name, value );
		}

		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );

		// All attributes are lowercase
		// Grab necessary hook if one is defined
		if ( notxml ) {
			name = name.toLowerCase();
			hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
		}

		if ( value !== undefined ) {

			if ( value === null ) {
				jQuery.removeAttr( elem, name );

			} else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
				return ret;

			} else {
				elem.setAttribute( name, value + "" );
				return value;
			}

		} else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
			return ret;

		} else {

			// In IE9+, Flash objects don't have .getAttribute (#12945)
			// Support: IE9+
			if ( typeof elem.getAttribute !== core_strundefined ) {
				ret =  elem.getAttribute( name );
			}

			// Non-existent attributes return null, we normalize to undefined
			return ret == null ?
				undefined :
				ret;
		}
	},

	removeAttr: function( elem, value ) {
		var name, propName,
			i = 0,
			attrNames = value && value.match( core_rnotwhite );

		if ( attrNames && elem.nodeType === 1 ) {
			while ( (name = attrNames[i++]) ) {
				propName = jQuery.propFix[ name ] || name;

				// Boolean attributes get special treatment (#10870)
				if ( rboolean.test( name ) ) {
					// Set corresponding property to false for boolean attributes
					// Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
					if ( !getSetAttribute && ruseDefault.test( name ) ) {
						elem[ jQuery.camelCase( "default-" + name ) ] =
							elem[ propName ] = false;
					} else {
						elem[ propName ] = false;
					}

				// See #9699 for explanation of this approach (setting first, then removal)
				} else {
					jQuery.attr( elem, name, "" );
				}

				elem.removeAttribute( getSetAttribute ? name : propName );
			}
		}
	},

	attrHooks: {
		type: {
			set: function( elem, value ) {
				if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
					// Setting the type on a radio button after the value resets the value in IE6-9
					// Reset value to default in case type is set after value during creation
					var val = elem.value;
					elem.setAttribute( "type", value );
					if ( val ) {
						elem.value = val;
					}
					return value;
				}
			}
		}
	},

	propFix: {
		tabindex: "tabIndex",
		readonly: "readOnly",
		"for": "htmlFor",
		"class": "className",
		maxlength: "maxLength",
		cellspacing: "cellSpacing",
		cellpadding: "cellPadding",
		rowspan: "rowSpan",
		colspan: "colSpan",
		usemap: "useMap",
		frameborder: "frameBorder",
		contenteditable: "contentEditable"
	},

	prop: function( elem, name, value ) {
		var ret, hooks, notxml,
			nType = elem.nodeType;

		// don't get/set properties on text, comment and attribute nodes
		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
			return;
		}

		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );

		if ( notxml ) {
			// Fix name and attach hooks
			name = jQuery.propFix[ name ] || name;
			hooks = jQuery.propHooks[ name ];
		}

		if ( value !== undefined ) {
			if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
				return ret;

			} else {
				return ( elem[ name ] = value );
			}

		} else {
			if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
				return ret;

			} else {
				return elem[ name ];
			}
		}
	},

	propHooks: {
		tabIndex: {
			get: function( elem ) {
				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
				var attributeNode = elem.getAttributeNode("tabindex");

				return attributeNode && attributeNode.specified ?
					parseInt( attributeNode.value, 10 ) :
					rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
						0 :
						undefined;
			}
		}
	}
});

// Hook for boolean attributes
boolHook = {
	get: function( elem, name ) {
		var
			// Use .prop to determine if this attribute is understood as boolean
			prop = jQuery.prop( elem, name ),

			// Fetch it accordingly
			attr = typeof prop === "boolean" && elem.getAttribute( name ),
			detail = typeof prop === "boolean" ?

				getSetInput && getSetAttribute ?
					attr != null :
					// oldIE fabricates an empty string for missing boolean attributes
					// and conflates checked/selected into attroperties
					ruseDefault.test( name ) ?
						elem[ jQuery.camelCase( "default-" + name ) ] :
						!!attr :

				// fetch an attribute node for properties not recognized as boolean
				elem.getAttributeNode( name );

		return detail && detail.value !== false ?
			name.toLowerCase() :
			undefined;
	},
	set: function( elem, value, name ) {
		if ( value === false ) {
			// Remove boolean attributes when set to false
			jQuery.removeAttr( elem, name );
		} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
			// IE<8 needs the *property* name
			elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );

		// Use defaultChecked and defaultSelected for oldIE
		} else {
			elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
		}

		return name;
	}
};

// fix oldIE value attroperty
if ( !getSetInput || !getSetAttribute ) {
	jQuery.attrHooks.value = {
		get: function( elem, name ) {
			var ret = elem.getAttributeNode( name );
			return jQuery.nodeName( elem, "input" ) ?

				// Ignore the value *property* by using defaultValue
				elem.defaultValue :

				ret && ret.specified ? ret.value : undefined;
		},
		set: function( elem, value, name ) {
			if ( jQuery.nodeName( elem, "input" ) ) {
				// Does not return so that setAttribute is also used
				elem.defaultValue = value;
			} else {
				// Use nodeHook if defined (#1954); otherwise setAttribute is fine
				return nodeHook && nodeHook.set( elem, value, name );
			}
		}
	};
}

// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !getSetAttribute ) {

	// Use this for any attribute in IE6/7
	// This fixes almost every IE6/7 issue
	nodeHook = jQuery.valHooks.button = {
		get: function( elem, name ) {
			var ret = elem.getAttributeNode( name );
			return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
				ret.value :
				undefined;
		},
		set: function( elem, value, name ) {
			// Set the existing or create a new attribute node
			var ret = elem.getAttributeNode( name );
			if ( !ret ) {
				elem.setAttributeNode(
					(ret = elem.ownerDocument.createAttribute( name ))
				);
			}

			ret.value = value += "";

			// Break association with cloned elements by also using setAttribute (#9646)
			return name === "value" || value === elem.getAttribute( name ) ?
				value :
				undefined;
		}
	};

	// Set contenteditable to false on removals(#10429)
	// Setting to empty string throws an error as an invalid value
	jQuery.attrHooks.contenteditable = {
		get: nodeHook.get,
		set: function( elem, value, name ) {
			nodeHook.set( elem, value === "" ? false : value, name );
		}
	};

	// Set width and height to auto instead of 0 on empty string( Bug #8150 )
	// This is for removals
	jQuery.each([ "width", "height" ], function( i, name ) {
		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
			set: function( elem, value ) {
				if ( value === "" ) {
					elem.setAttribute( name, "auto" );
					return value;
				}
			}
		});
	});
}


// Some attributes require a special call on IE
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !jQuery.support.hrefNormalized ) {
	jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
			get: function( elem ) {
				var ret = elem.getAttribute( name, 2 );
				return ret == null ? undefined : ret;
			}
		});
	});

	// href/src property should get the full normalized URL (#10299/#12915)
	jQuery.each([ "href", "src" ], function( i, name ) {
		jQuery.propHooks[ name ] = {
			get: function( elem ) {
				return elem.getAttribute( name, 4 );
			}
		};
	});
}

if ( !jQuery.support.style ) {
	jQuery.attrHooks.style = {
		get: function( elem ) {
			// Return undefined in the case of empty string
			// Note: IE uppercases css property names, but if we were to .toLowerCase()
			// .cssText, that would destroy case senstitivity in URL's, like in "background"
			return elem.style.cssText || undefined;
		},
		set: function( elem, value ) {
			return ( elem.style.cssText = value + "" );
		}
	};
}

// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( !jQuery.support.optSelected ) {
	jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
		get: function( elem ) {
			var parent = elem.parentNode;

			if ( parent ) {
				parent.selectedIndex;

				// Make sure that it also works with optgroups, see #5701
				if ( parent.parentNode ) {
					parent.parentNode.selectedIndex;
				}
			}
			return null;
		}
	});
}

// IE6/7 call enctype encoding
if ( !jQuery.support.enctype ) {
	jQuery.propFix.enctype = "encoding";
}

// Radios and checkboxes getter/setter
if ( !jQuery.support.checkOn ) {
	jQuery.each([ "radio", "checkbox" ], function() {
		jQuery.valHooks[ this ] = {
			get: function( elem ) {
				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
				return elem.getAttribute("value") === null ? "on" : elem.value;
			}
		};
	});
}
jQuery.each([ "radio", "checkbox" ], function() {
	jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
		set: function( elem, value ) {
			if ( jQuery.isArray( value ) ) {
				return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
			}
		}
	});
});
var rformElems = /^(?:input|select|textarea)$/i,
	rkeyEvent = /^key/,
	rmouseEvent = /^(?:mouse|contextmenu)|click/,
	rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
	rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;

function returnTrue() {
	return true;
}

function returnFalse() {
	return false;
}

/*
 * Helper functions for managing events -- not part of the public interface.
 * Props to Dean Edwards' addEvent library for many of the ideas.
 */
jQuery.event = {

	global: {},

	add: function( elem, types, handler, data, selector ) {
		var tmp, events, t, handleObjIn,
			special, eventHandle, handleObj,
			handlers, type, namespaces, origType,
			elemData = jQuery._data( elem );

		// Don't attach events to noData or text/comment nodes (but allow plain objects)
		if ( !elemData ) {
			return;
		}

		// Caller can pass in an object of custom data in lieu of the handler
		if ( handler.handler ) {
			handleObjIn = handler;
			handler = handleObjIn.handler;
			selector = handleObjIn.selector;
		}

		// Make sure that the handler has a unique ID, used to find/remove it later
		if ( !handler.guid ) {
			handler.guid = jQuery.guid++;
		}

		// Init the element's event structure and main handler, if this is the first
		if ( !(events = elemData.events) ) {
			events = elemData.events = {};
		}
		if ( !(eventHandle = elemData.handle) ) {
			eventHandle = elemData.handle = function( e ) {
				// Discard the second event of a jQuery.event.trigger() and
				// when an event is called after a page has unloaded
				return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
					jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
					undefined;
			};
			// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
			eventHandle.elem = elem;
		}

		// Handle multiple events separated by a space
		// jQuery(...).bind("mouseover mouseout", fn);
		types = ( types || "" ).match( core_rnotwhite ) || [""];
		t = types.length;
		while ( t-- ) {
			tmp = rtypenamespace.exec( types[t] ) || [];
			type = origType = tmp[1];
			namespaces = ( tmp[2] || "" ).split( "." ).sort();

			// If event changes its type, use the special event handlers for the changed type
			special = jQuery.event.special[ type ] || {};

			// If selector defined, determine special event api type, otherwise given type
			type = ( selector ? special.delegateType : special.bindType ) || type;

			// Update special based on newly reset type
			special = jQuery.event.special[ type ] || {};

			// handleObj is passed to all event handlers
			handleObj = jQuery.extend({
				type: type,
				origType: origType,
				data: data,
				handler: handler,
				guid: handler.guid,
				selector: selector,
				needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
				namespace: namespaces.join(".")
			}, handleObjIn );

			// Init the event handler queue if we're the first
			if ( !(handlers = events[ type ]) ) {
				handlers = events[ type ] = [];
				handlers.delegateCount = 0;

				// Only use addEventListener/attachEvent if the special events handler returns false
				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
					// Bind the global event handler to the element
					if ( elem.addEventListener ) {
						elem.addEventListener( type, eventHandle, false );

					} else if ( elem.attachEvent ) {
						elem.attachEvent( "on" + type, eventHandle );
					}
				}
			}

			if ( special.add ) {
				special.add.call( elem, handleObj );

				if ( !handleObj.handler.guid ) {
					handleObj.handler.guid = handler.guid;
				}
			}

			// Add to the element's handler list, delegates in front
			if ( selector ) {
				handlers.splice( handlers.delegateCount++, 0, handleObj );
			} else {
				handlers.push( handleObj );
			}

			// Keep track of which events have ever been used, for event optimization
			jQuery.event.global[ type ] = true;
		}

		// Nullify elem to prevent memory leaks in IE
		elem = null;
	},

	// Detach an event or set of events from an element
	remove: function( elem, types, handler, selector, mappedTypes ) {
		var j, handleObj, tmp,
			origCount, t, events,
			special, handlers, type,
			namespaces, origType,
			elemData = jQuery.hasData( elem ) && jQuery._data( elem );

		if ( !elemData || !(events = elemData.events) ) {
			return;
		}

		// Once for each type.namespace in types; type may be omitted
		types = ( types || "" ).match( core_rnotwhite ) || [""];
		t = types.length;
		while ( t-- ) {
			tmp = rtypenamespace.exec( types[t] ) || [];
			type = origType = tmp[1];
			namespaces = ( tmp[2] || "" ).split( "." ).sort();

			// Unbind all events (on this namespace, if provided) for the element
			if ( !type ) {
				for ( type in events ) {
					jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
				}
				continue;
			}

			special = jQuery.event.special[ type ] || {};
			type = ( selector ? special.delegateType : special.bindType ) || type;
			handlers = events[ type ] || [];
			tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );

			// Remove matching events
			origCount = j = handlers.length;
			while ( j-- ) {
				handleObj = handlers[ j ];

				if ( ( mappedTypes || origType === handleObj.origType ) &&
					( !handler || handler.guid === handleObj.guid ) &&
					( !tmp || tmp.test( handleObj.namespace ) ) &&
					( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
					handlers.splice( j, 1 );

					if ( handleObj.selector ) {
						handlers.delegateCount--;
					}
					if ( special.remove ) {
						special.remove.call( elem, handleObj );
					}
				}
			}

			// Remove generic event handler if we removed something and no more handlers exist
			// (avoids potential for endless recursion during removal of special event handlers)
			if ( origCount && !handlers.length ) {
				if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
					jQuery.removeEvent( elem, type, elemData.handle );
				}

				delete events[ type ];
			}
		}

		// Remove the expando if it's no longer used
		if ( jQuery.isEmptyObject( events ) ) {
			delete elemData.handle;

			// removeData also checks for emptiness and clears the expando if empty
			// so use it instead of delete
			jQuery._removeData( elem, "events" );
		}
	},

	trigger: function( event, data, elem, onlyHandlers ) {
		var handle, ontype, cur,
			bubbleType, special, tmp, i,
			eventPath = [ elem || document ],
			type = core_hasOwn.call( event, "type" ) ? event.type : event,
			namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];

		cur = tmp = elem = elem || document;

		// Don't do events on text and comment nodes
		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
			return;
		}

		// focus/blur morphs to focusin/out; ensure we're not firing them right now
		if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
			return;
		}

		if ( type.indexOf(".") >= 0 ) {
			// Namespaced trigger; create a regexp to match event type in handle()
			namespaces = type.split(".");
			type = namespaces.shift();
			namespaces.sort();
		}
		ontype = type.indexOf(":") < 0 && "on" + type;

		// Caller can pass in a jQuery.Event object, Object, or just an event type string
		event = event[ jQuery.expando ] ?
			event :
			new jQuery.Event( type, typeof event === "object" && event );

		event.isTrigger = true;
		event.namespace = namespaces.join(".");
		event.namespace_re = event.namespace ?
			new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
			null;

		// Clean up the event in case it is being reused
		event.result = undefined;
		if ( !event.target ) {
			event.target = elem;
		}

		// Clone any incoming data and prepend the event, creating the handler arg list
		data = data == null ?
			[ event ] :
			jQuery.makeArray( data, [ event ] );

		// Allow special events to draw outside the lines
		special = jQuery.event.special[ type ] || {};
		if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
			return;
		}

		// Determine event propagation path in advance, per W3C events spec (#9951)
		// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
		if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {

			bubbleType = special.delegateType || type;
			if ( !rfocusMorph.test( bubbleType + type ) ) {
				cur = cur.parentNode;
			}
			for ( ; cur; cur = cur.parentNode ) {
				eventPath.push( cur );
				tmp = cur;
			}

			// Only add window if we got to document (e.g., not plain obj or detached DOM)
			if ( tmp === (elem.ownerDocument || document) ) {
				eventPath.push( tmp.defaultView || tmp.parentWindow || window );
			}
		}

		// Fire handlers on the event path
		i = 0;
		while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {

			event.type = i > 1 ?
				bubbleType :
				special.bindType || type;

			// jQuery handler
			handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
			if ( handle ) {
				handle.apply( cur, data );
			}

			// Native handler
			handle = ontype && cur[ ontype ];
			if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
				event.preventDefault();
			}
		}
		event.type = type;

		// If nobody prevented the default action, do it now
		if ( !onlyHandlers && !event.isDefaultPrevented() ) {

			if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
				!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {

				// Call a native DOM method on the target with the same name name as the event.
				// Can't use an .isFunction() check here because IE6/7 fails that test.
				// Don't do default actions on window, that's where global variables be (#6170)
				if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {

					// Don't re-trigger an onFOO event when we call its FOO() method
					tmp = elem[ ontype ];

					if ( tmp ) {
						elem[ ontype ] = null;
					}

					// Prevent re-triggering of the same event, since we already bubbled it above
					jQuery.event.triggered = type;
					try {
						elem[ type ]();
					} catch ( e ) {
						// IE<9 dies on focus/blur to hidden element (#1486,#12518)
						// only reproducible on winXP IE8 native, not IE9 in IE8 mode
					}
					jQuery.event.triggered = undefined;

					if ( tmp ) {
						elem[ ontype ] = tmp;
					}
				}
			}
		}

		return event.result;
	},

	dispatch: function( event ) {

		// Make a writable jQuery.Event from the native event object
		event = jQuery.event.fix( event );

		var i, ret, handleObj, matched, j,
			handlerQueue = [],
			args = core_slice.call( arguments ),
			handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
			special = jQuery.event.special[ event.type ] || {};

		// Use the fix-ed jQuery.Event rather than the (read-only) native event
		args[0] = event;
		event.delegateTarget = this;

		// Call the preDispatch hook for the mapped type, and let it bail if desired
		if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
			return;
		}

		// Determine handlers
		handlerQueue = jQuery.event.handlers.call( this, event, handlers );

		// Run delegates first; they may want to stop propagation beneath us
		i = 0;
		while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
			event.currentTarget = matched.elem;

			j = 0;
			while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {

				// Triggered event must either 1) have no namespace, or
				// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
				if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {

					event.handleObj = handleObj;
					event.data = handleObj.data;

					ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
							.apply( matched.elem, args );

					if ( ret !== undefined ) {
						if ( (event.result = ret) === false ) {
							event.preventDefault();
							event.stopPropagation();
						}
					}
				}
			}
		}

		// Call the postDispatch hook for the mapped type
		if ( special.postDispatch ) {
			special.postDispatch.call( this, event );
		}

		return event.result;
	},

	handlers: function( event, handlers ) {
		var sel, handleObj, matches, i,
			handlerQueue = [],
			delegateCount = handlers.delegateCount,
			cur = event.target;

		// Find delegate handlers
		// Black-hole SVG <use> instance trees (#13180)
		// Avoid non-left-click bubbling in Firefox (#3861)
		if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {

			for ( ; cur != this; cur = cur.parentNode || this ) {

				// Don't check non-elements (#13208)
				// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
				if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
					matches = [];
					for ( i = 0; i < delegateCount; i++ ) {
						handleObj = handlers[ i ];

						// Don't conflict with Object.prototype properties (#13203)
						sel = handleObj.selector + " ";

						if ( matches[ sel ] === undefined ) {
							matches[ sel ] = handleObj.needsContext ?
								jQuery( sel, this ).index( cur ) >= 0 :
								jQuery.find( sel, this, null, [ cur ] ).length;
						}
						if ( matches[ sel ] ) {
							matches.push( handleObj );
						}
					}
					if ( matches.length ) {
						handlerQueue.push({ elem: cur, handlers: matches });
					}
				}
			}
		}

		// Add the remaining (directly-bound) handlers
		if ( delegateCount < handlers.length ) {
			handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
		}

		return handlerQueue;
	},

	fix: function( event ) {
		if ( event[ jQuery.expando ] ) {
			return event;
		}

		// Create a writable copy of the event object and normalize some properties
		var i, prop, copy,
			type = event.type,
			originalEvent = event,
			fixHook = this.fixHooks[ type ];

		if ( !fixHook ) {
			this.fixHooks[ type ] = fixHook =
				rmouseEvent.test( type ) ? this.mouseHooks :
				rkeyEvent.test( type ) ? this.keyHooks :
				{};
		}
		copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;

		event = new jQuery.Event( originalEvent );

		i = copy.length;
		while ( i-- ) {
			prop = copy[ i ];
			event[ prop ] = originalEvent[ prop ];
		}

		// Support: IE<9
		// Fix target property (#1925)
		if ( !event.target ) {
			event.target = originalEvent.srcElement || document;
		}

		// Support: Chrome 23+, Safari?
		// Target should not be a text node (#504, #13143)
		if ( event.target.nodeType === 3 ) {
			event.target = event.target.parentNode;
		}

		// Support: IE<9
		// For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
		event.metaKey = !!event.metaKey;

		return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
	},

	// Includes some event props shared by KeyEvent and MouseEvent
	props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),

	fixHooks: {},

	keyHooks: {
		props: "char charCode key keyCode".split(" "),
		filter: function( event, original ) {

			// Add which for key events
			if ( event.which == null ) {
				event.which = original.charCode != null ? original.charCode : original.keyCode;
			}

			return event;
		}
	},

	mouseHooks: {
		props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
		filter: function( event, original ) {
			var body, eventDoc, doc,
				button = original.button,
				fromElement = original.fromElement;

			// Calculate pageX/Y if missing and clientX/Y available
			if ( event.pageX == null && original.clientX != null ) {
				eventDoc = event.target.ownerDocument || document;
				doc = eventDoc.documentElement;
				body = eventDoc.body;

				event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
				event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
			}

			// Add relatedTarget, if necessary
			if ( !event.relatedTarget && fromElement ) {
				event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
			}

			// Add which for click: 1 === left; 2 === middle; 3 === right
			// Note: button is not normalized, so don't use it
			if ( !event.which && button !== undefined ) {
				event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
			}

			return event;
		}
	},

	special: {
		load: {
			// Prevent triggered image.load events from bubbling to window.load
			noBubble: true
		},
		click: {
			// For checkbox, fire native event so checked state will be right
			trigger: function() {
				if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
					this.click();
					return false;
				}
			}
		},
		focus: {
			// Fire native event if possible so blur/focus sequence is correct
			trigger: function() {
				if ( this !== document.activeElement && this.focus ) {
					try {
						this.focus();
						return false;
					} catch ( e ) {
						// Support: IE<9
						// If we error on focus to hidden element (#1486, #12518),
						// let .trigger() run the handlers
					}
				}
			},
			delegateType: "focusin"
		},
		blur: {
			trigger: function() {
				if ( this === document.activeElement && this.blur ) {
					this.blur();
					return false;
				}
			},
			delegateType: "focusout"
		},

		beforeunload: {
			postDispatch: function( event ) {

				// Even when returnValue equals to undefined Firefox will still show alert
				if ( event.result !== undefined ) {
					event.originalEvent.returnValue = event.result;
				}
			}
		}
	},

	simulate: function( type, elem, event, bubble ) {
		// Piggyback on a donor event to simulate a different one.
		// Fake originalEvent to avoid donor's stopPropagation, but if the
		// simulated event prevents default then we do the same on the donor.
		var e = jQuery.extend(
			new jQuery.Event(),
			event,
			{ type: type,
				isSimulated: true,
				originalEvent: {}
			}
		);
		if ( bubble ) {
			jQuery.event.trigger( e, null, elem );
		} else {
			jQuery.event.dispatch.call( elem, e );
		}
		if ( e.isDefaultPrevented() ) {
			event.preventDefault();
		}
	}
};

jQuery.removeEvent = document.removeEventListener ?
	function( elem, type, handle ) {
		if ( elem.removeEventListener ) {
			elem.removeEventListener( type, handle, false );
		}
	} :
	function( elem, type, handle ) {
		var name = "on" + type;

		if ( elem.detachEvent ) {

			// #8545, #7054, preventing memory leaks for custom events in IE6-8
			// detachEvent needed property on element, by name of that event, to properly expose it to GC
			if ( typeof elem[ name ] === core_strundefined ) {
				elem[ name ] = null;
			}

			elem.detachEvent( name, handle );
		}
	};

jQuery.Event = function( src, props ) {
	// Allow instantiation without the 'new' keyword
	if ( !(this instanceof jQuery.Event) ) {
		return new jQuery.Event( src, props );
	}

	// Event object
	if ( src && src.type ) {
		this.originalEvent = src;
		this.type = src.type;

		// Events bubbling up the document may have been marked as prevented
		// by a handler lower down the tree; reflect the correct value.
		this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
			src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;

	// Event type
	} else {
		this.type = src;
	}

	// Put explicitly provided properties onto the event object
	if ( props ) {
		jQuery.extend( this, props );
	}

	// Create a timestamp if incoming event doesn't have one
	this.timeStamp = src && src.timeStamp || jQuery.now();

	// Mark it as fixed
	this[ jQuery.expando ] = true;
};

// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
	isDefaultPrevented: returnFalse,
	isPropagationStopped: returnFalse,
	isImmediatePropagationStopped: returnFalse,

	preventDefault: function() {
		var e = this.originalEvent;

		this.isDefaultPrevented = returnTrue;
		if ( !e ) {
			return;
		}

		// If preventDefault exists, run it on the original event
		if ( e.preventDefault ) {
			e.preventDefault();

		// Support: IE
		// Otherwise set the returnValue property of the original event to false
		} else {
			e.returnValue = false;
		}
	},
	stopPropagation: function() {
		var e = this.originalEvent;

		this.isPropagationStopped = returnTrue;
		if ( !e ) {
			return;
		}
		// If stopPropagation exists, run it on the original event
		if ( e.stopPropagation ) {
			e.stopPropagation();
		}

		// Support: IE
		// Set the cancelBubble property of the original event to true
		e.cancelBubble = true;
	},
	stopImmediatePropagation: function() {
		this.isImmediatePropagationStopped = returnTrue;
		this.stopPropagation();
	}
};

// Create mouseenter/leave events using mouseover/out and event-time checks
jQuery.each({
	mouseenter: "mouseover",
	mouseleave: "mouseout"
}, function( orig, fix ) {
	jQuery.event.special[ orig ] = {
		delegateType: fix,
		bindType: fix,

		handle: function( event ) {
			var ret,
				target = this,
				related = event.relatedTarget,
				handleObj = event.handleObj;

			// For mousenter/leave call the handler if related is outside the target.
			// NB: No relatedTarget if the mouse left/entered the browser window
			if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
				event.type = handleObj.origType;
				ret = handleObj.handler.apply( this, arguments );
				event.type = fix;
			}
			return ret;
		}
	};
});

// IE submit delegation
if ( !jQuery.support.submitBubbles ) {

	jQuery.event.special.submit = {
		setup: function() {
			// Only need this for delegated form submit events
			if ( jQuery.nodeName( this, "form" ) ) {
				return false;
			}

			// Lazy-add a submit handler when a descendant form may potentially be submitted
			jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
				// Node name check avoids a VML-related crash in IE (#9807)
				var elem = e.target,
					form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
				if ( form && !jQuery._data( form, "submitBubbles" ) ) {
					jQuery.event.add( form, "submit._submit", function( event ) {
						event._submit_bubble = true;
					});
					jQuery._data( form, "submitBubbles", true );
				}
			});
			// return undefined since we don't need an event listener
		},

		postDispatch: function( event ) {
			// If form was submitted by the user, bubble the event up the tree
			if ( event._submit_bubble ) {
				delete event._submit_bubble;
				if ( this.parentNode && !event.isTrigger ) {
					jQuery.event.simulate( "submit", this.parentNode, event, true );
				}
			}
		},

		teardown: function() {
			// Only need this for delegated form submit events
			if ( jQuery.nodeName( this, "form" ) ) {
				return false;
			}

			// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
			jQuery.event.remove( this, "._submit" );
		}
	};
}

// IE change delegation and checkbox/radio fix
if ( !jQuery.support.changeBubbles ) {

	jQuery.event.special.change = {

		setup: function() {

			if ( rformElems.test( this.nodeName ) ) {
				// IE doesn't fire change on a check/radio until blur; trigger it on click
				// after a propertychange. Eat the blur-change in special.change.handle.
				// This still fires onchange a second time for check/radio after blur.
				if ( this.type === "checkbox" || this.type === "radio" ) {
					jQuery.event.add( this, "propertychange._change", function( event ) {
						if ( event.originalEvent.propertyName === "checked" ) {
							this._just_changed = true;
						}
					});
					jQuery.event.add( this, "click._change", function( event ) {
						if ( this._just_changed && !event.isTrigger ) {
							this._just_changed = false;
						}
						// Allow triggered, simulated change events (#11500)
						jQuery.event.simulate( "change", this, event, true );
					});
				}
				return false;
			}
			// Delegated event; lazy-add a change handler on descendant inputs
			jQuery.event.add( this, "beforeactivate._change", function( e ) {
				var elem = e.target;

				if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
					jQuery.event.add( elem, "change._change", function( event ) {
						if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
							jQuery.event.simulate( "change", this.parentNode, event, true );
						}
					});
					jQuery._data( elem, "changeBubbles", true );
				}
			});
		},

		handle: function( event ) {
			var elem = event.target;

			// Swallow native change events from checkbox/radio, we already triggered them above
			if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
				return event.handleObj.handler.apply( this, arguments );
			}
		},

		teardown: function() {
			jQuery.event.remove( this, "._change" );

			return !rformElems.test( this.nodeName );
		}
	};
}

// Create "bubbling" focus and blur events
if ( !jQuery.support.focusinBubbles ) {
	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {

		// Attach a single capturing handler while someone wants focusin/focusout
		var attaches = 0,
			handler = function( event ) {
				jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
			};

		jQuery.event.special[ fix ] = {
			setup: function() {
				if ( attaches++ === 0 ) {
					document.addEventListener( orig, handler, true );
				}
			},
			teardown: function() {
				if ( --attaches === 0 ) {
					document.removeEventListener( orig, handler, true );
				}
			}
		};
	});
}

jQuery.fn.extend({

	on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
		var type, origFn;

		// Types can be a map of types/handlers
		if ( typeof types === "object" ) {
			// ( types-Object, selector, data )
			if ( typeof selector !== "string" ) {
				// ( types-Object, data )
				data = data || selector;
				selector = undefined;
			}
			for ( type in types ) {
				this.on( type, selector, data, types[ type ], one );
			}
			return this;
		}

		if ( data == null && fn == null ) {
			// ( types, fn )
			fn = selector;
			data = selector = undefined;
		} else if ( fn == null ) {
			if ( typeof selector === "string" ) {
				// ( types, selector, fn )
				fn = data;
				data = undefined;
			} else {
				// ( types, data, fn )
				fn = data;
				data = selector;
				selector = undefined;
			}
		}
		if ( fn === false ) {
			fn = returnFalse;
		} else if ( !fn ) {
			return this;
		}

		if ( one === 1 ) {
			origFn = fn;
			fn = function( event ) {
				// Can use an empty set, since event contains the info
				jQuery().off( event );
				return origFn.apply( this, arguments );
			};
			// Use same guid so caller can remove using origFn
			fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
		}
		return this.each( function() {
			jQuery.event.add( this, types, fn, data, selector );
		});
	},
	one: function( types, selector, data, fn ) {
		return this.on( types, selector, data, fn, 1 );
	},
	off: function( types, selector, fn ) {
		var handleObj, type;
		if ( types && types.preventDefault && types.handleObj ) {
			// ( event )  dispatched jQuery.Event
			handleObj = types.handleObj;
			jQuery( types.delegateTarget ).off(
				handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
				handleObj.selector,
				handleObj.handler
			);
			return this;
		}
		if ( typeof types === "object" ) {
			// ( types-object [, selector] )
			for ( type in types ) {
				this.off( type, selector, types[ type ] );
			}
			return this;
		}
		if ( selector === false || typeof selector === "function" ) {
			// ( types [, fn] )
			fn = selector;
			selector = undefined;
		}
		if ( fn === false ) {
			fn = returnFalse;
		}
		return this.each(function() {
			jQuery.event.remove( this, types, fn, selector );
		});
	},

	bind: function( types, data, fn ) {
		return this.on( types, null, data, fn );
	},
	unbind: function( types, fn ) {
		return this.off( types, null, fn );
	},

	delegate: function( selector, types, data, fn ) {
		return this.on( types, selector, data, fn );
	},
	undelegate: function( selector, types, fn ) {
		// ( namespace ) or ( selector, types [, fn] )
		return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
	},

	trigger: function( type, data ) {
		return this.each(function() {
			jQuery.event.trigger( type, data, this );
		});
	},
	triggerHandler: function( type, data ) {
		var elem = this[0];
		if ( elem ) {
			return jQuery.event.trigger( type, data, elem, true );
		}
	}
});
/*!
 * Sizzle CSS Selector Engine
 * Copyright 2012 jQuery Foundation and other contributors
 * Released under the MIT license
 * http://sizzlejs.com/
 */
(function( window, undefined ) {

var i,
	cachedruns,
	Expr,
	getText,
	isXML,
	compile,
	hasDuplicate,
	outermostContext,

	// Local document vars
	setDocument,
	document,
	docElem,
	documentIsXML,
	rbuggyQSA,
	rbuggyMatches,
	matches,
	contains,
	sortOrder,

	// Instance-specific data
	expando = "sizzle" + -(new Date()),
	preferredDoc = window.document,
	support = {},
	dirruns = 0,
	done = 0,
	classCache = createCache(),
	tokenCache = createCache(),
	compilerCache = createCache(),

	// General-purpose constants
	strundefined = typeof undefined,
	MAX_NEGATIVE = 1 << 31,

	// Array methods
	arr = [],
	pop = arr.pop,
	push = arr.push,
	slice = arr.slice,
	// Use a stripped-down indexOf if we can't use a native one
	indexOf = arr.indexOf || function( elem ) {
		var i = 0,
			len = this.length;
		for ( ; i < len; i++ ) {
			if ( this[i] === elem ) {
				return i;
			}
		}
		return -1;
	},


	// Regular expressions

	// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
	whitespace = "[\\x20\\t\\r\\n\\f]",
	// http://www.w3.org/TR/css3-syntax/#characters
	characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",

	// Loosely modeled on CSS identifier characters
	// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
	// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
	identifier = characterEncoding.replace( "w", "w#" ),

	// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
	operators = "([*^$|!~]?=)",
	attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
		"*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",

	// Prefer arguments quoted,
	//   then not containing pseudos/brackets,
	//   then attribute selectors/non-parenthetical expressions,
	//   then anything else
	// These preferences are here to reduce the number of selectors
	//   needing tokenize in the PSEUDO preFilter
	pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",

	// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
	rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),

	rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
	rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
	rpseudo = new RegExp( pseudos ),
	ridentifier = new RegExp( "^" + identifier + "$" ),

	matchExpr = {
		"ID": new RegExp( "^#(" + characterEncoding + ")" ),
		"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
		"NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
		"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
		"ATTR": new RegExp( "^" + attributes ),
		"PSEUDO": new RegExp( "^" + pseudos ),
		"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
			"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
			"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
		// For use in libraries implementing .is()
		// We use this for POS matching in `select`
		"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
			whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
	},

	rsibling = /[\x20\t\r\n\f]*[+~]/,

	rnative = /^[^{]+\{\s*\[native code/,

	// Easily-parseable/retrievable ID or TAG or CLASS selectors
	rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,

	rinputs = /^(?:input|select|textarea|button)$/i,
	rheader = /^h\d$/i,

	rescape = /'|\\/g,
	rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,

	// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
	runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
	funescape = function( _, escaped ) {
		var high = "0x" + escaped - 0x10000;
		// NaN means non-codepoint
		return high !== high ?
			escaped :
			// BMP codepoint
			high < 0 ?
				String.fromCharCode( high + 0x10000 ) :
				// Supplemental Plane codepoint (surrogate pair)
				String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
	};

// Use a stripped-down slice if we can't use a native one
try {
	slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;
} catch ( e ) {
	slice = function( i ) {
		var elem,
			results = [];
		while ( (elem = this[i++]) ) {
			results.push( elem );
		}
		return results;
	};
}

/**
 * For feature detection
 * @param {Function} fn The function to test for native support
 */
function isNative( fn ) {
	return rnative.test( fn + "" );
}

/**
 * Create key-value caches of limited size
 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
 *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
 *	deleting the oldest entry
 */
function createCache() {
	var cache,
		keys = [];

	return (cache = function( key, value ) {
		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
		if ( keys.push( key += " " ) > Expr.cacheLength ) {
			// Only keep the most recent entries
			delete cache[ keys.shift() ];
		}
		return (cache[ key ] = value);
	});
}

/**
 * Mark a function for special use by Sizzle
 * @param {Function} fn The function to mark
 */
function markFunction( fn ) {
	fn[ expando ] = true;
	return fn;
}

/**
 * Support testing using an element
 * @param {Function} fn Passed the created div and expects a boolean result
 */
function assert( fn ) {
	var div = document.createElement("div");

	try {
		return fn( div );
	} catch (e) {
		return false;
	} finally {
		// release memory in IE
		div = null;
	}
}

function Sizzle( selector, context, results, seed ) {
	var match, elem, m, nodeType,
		// QSA vars
		i, groups, old, nid, newContext, newSelector;

	if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
		setDocument( context );
	}

	context = context || document;
	results = results || [];

	if ( !selector || typeof selector !== "string" ) {
		return results;
	}

	if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
		return [];
	}

	if ( !documentIsXML && !seed ) {

		// Shortcuts
		if ( (match = rquickExpr.exec( selector )) ) {
			// Speed-up: Sizzle("#ID")
			if ( (m = match[1]) ) {
				if ( nodeType === 9 ) {
					elem = context.getElementById( m );
					// Check parentNode to catch when Blackberry 4.6 returns
					// nodes that are no longer in the document #6963
					if ( elem && elem.parentNode ) {
						// Handle the case where IE, Opera, and Webkit return items
						// by name instead of ID
						if ( elem.id === m ) {
							results.push( elem );
							return results;
						}
					} else {
						return results;
					}
				} else {
					// Context is not a document
					if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
						contains( context, elem ) && elem.id === m ) {
						results.push( elem );
						return results;
					}
				}

			// Speed-up: Sizzle("TAG")
			} else if ( match[2] ) {
				push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
				return results;

			// Speed-up: Sizzle(".CLASS")
			} else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {
				push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
				return results;
			}
		}

		// QSA path
		if ( support.qsa && !rbuggyQSA.test(selector) ) {
			old = true;
			nid = expando;
			newContext = context;
			newSelector = nodeType === 9 && selector;

			// qSA works strangely on Element-rooted queries
			// We can work around this by specifying an extra ID on the root
			// and working up from there (Thanks to Andrew Dupont for the technique)
			// IE 8 doesn't work on object elements
			if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
				groups = tokenize( selector );

				if ( (old = context.getAttribute("id")) ) {
					nid = old.replace( rescape, "\\$&" );
				} else {
					context.setAttribute( "id", nid );
				}
				nid = "[id='" + nid + "'] ";

				i = groups.length;
				while ( i-- ) {
					groups[i] = nid + toSelector( groups[i] );
				}
				newContext = rsibling.test( selector ) && context.parentNode || context;
				newSelector = groups.join(",");
			}

			if ( newSelector ) {
				try {
					push.apply( results, slice.call( newContext.querySelectorAll(
						newSelector
					), 0 ) );
					return results;
				} catch(qsaError) {
				} finally {
					if ( !old ) {
						context.removeAttribute("id");
					}
				}
			}
		}
	}

	// All others
	return select( selector.replace( rtrim, "$1" ), context, results, seed );
}

/**
 * Detect xml
 * @param {Element|Object} elem An element or a document
 */
isXML = Sizzle.isXML = function( elem ) {
	// documentElement is verified for cases where it doesn't yet exist
	// (such as loading iframes in IE - #4833)
	var documentElement = elem && (elem.ownerDocument || elem).documentElement;
	return documentElement ? documentElement.nodeName !== "HTML" : false;
};

/**
 * Sets document-related variables once based on the current document
 * @param {Element|Object} [doc] An element or document object to use to set the document
 * @returns {Object} Returns the current document
 */
setDocument = Sizzle.setDocument = function( node ) {
	var doc = node ? node.ownerDocument || node : preferredDoc;

	// If no document and documentElement is available, return
	if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
		return document;
	}

	// Set our document
	document = doc;
	docElem = doc.documentElement;

	// Support tests
	documentIsXML = isXML( doc );

	// Check if getElementsByTagName("*") returns only elements
	support.tagNameNoComments = assert(function( div ) {
		div.appendChild( doc.createComment("") );
		return !div.getElementsByTagName("*").length;
	});

	// Check if attributes should be retrieved by attribute nodes
	support.attributes = assert(function( div ) {
		div.innerHTML = "<select></select>";
		var type = typeof div.lastChild.getAttribute("multiple");
		// IE8 returns a string for some attributes even when not present
		return type !== "boolean" && type !== "string";
	});

	// Check if getElementsByClassName can be trusted
	support.getByClassName = assert(function( div ) {
		// Opera can't find a second classname (in 9.6)
		div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
		if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
			return false;
		}

		// Safari 3.2 caches class attributes and doesn't catch changes
		div.lastChild.className = "e";
		return div.getElementsByClassName("e").length === 2;
	});

	// Check if getElementById returns elements by name
	// Check if getElementsByName privileges form controls or returns elements by ID
	support.getByName = assert(function( div ) {
		// Inject content
		div.id = expando + 0;
		div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
		docElem.insertBefore( div, docElem.firstChild );

		// Test
		var pass = doc.getElementsByName &&
			// buggy browsers will return fewer than the correct 2
			doc.getElementsByName( expando ).length === 2 +
			// buggy browsers will return more than the correct 0
			doc.getElementsByName( expando + 0 ).length;
		support.getIdNotName = !doc.getElementById( expando );

		// Cleanup
		docElem.removeChild( div );

		return pass;
	});

	// IE6/7 return modified attributes
	Expr.attrHandle = assert(function( div ) {
		div.innerHTML = "<a href='#'></a>";
		return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
			div.firstChild.getAttribute("href") === "#";
	}) ?
		{} :
		{
			"href": function( elem ) {
				return elem.getAttribute( "href", 2 );
			},
			"type": function( elem ) {
				return elem.getAttribute("type");
			}
		};

	// ID find and filter
	if ( support.getIdNotName ) {
		Expr.find["ID"] = function( id, context ) {
			if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
				var m = context.getElementById( id );
				// Check parentNode to catch when Blackberry 4.6 returns
				// nodes that are no longer in the document #6963
				return m && m.parentNode ? [m] : [];
			}
		};
		Expr.filter["ID"] = function( id ) {
			var attrId = id.replace( runescape, funescape );
			return function( elem ) {
				return elem.getAttribute("id") === attrId;
			};
		};
	} else {
		Expr.find["ID"] = function( id, context ) {
			if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
				var m = context.getElementById( id );

				return m ?
					m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
						[m] :
						undefined :
					[];
			}
		};
		Expr.filter["ID"] =  function( id ) {
			var attrId = id.replace( runescape, funescape );
			return function( elem ) {
				var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
				return node && node.value === attrId;
			};
		};
	}

	// Tag
	Expr.find["TAG"] = support.tagNameNoComments ?
		function( tag, context ) {
			if ( typeof context.getElementsByTagName !== strundefined ) {
				return context.getElementsByTagName( tag );
			}
		} :
		function( tag, context ) {
			var elem,
				tmp = [],
				i = 0,
				results = context.getElementsByTagName( tag );

			// Filter out possible comments
			if ( tag === "*" ) {
				while ( (elem = results[i++]) ) {
					if ( elem.nodeType === 1 ) {
						tmp.push( elem );
					}
				}

				return tmp;
			}
			return results;
		};

	// Name
	Expr.find["NAME"] = support.getByName && function( tag, context ) {
		if ( typeof context.getElementsByName !== strundefined ) {
			return context.getElementsByName( name );
		}
	};

	// Class
	Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
		if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
			return context.getElementsByClassName( className );
		}
	};

	// QSA and matchesSelector support

	// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
	rbuggyMatches = [];

	// qSa(:focus) reports false when true (Chrome 21),
	// no need to also add to buggyMatches since matches checks buggyQSA
	// A support test would require too much code (would include document ready)
	rbuggyQSA = [ ":focus" ];

	if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
		// Build QSA regex
		// Regex strategy adopted from Diego Perini
		assert(function( div ) {
			// Select is set to empty string on purpose
			// This is to test IE's treatment of not explictly
			// setting a boolean content attribute,
			// since its presence should be enough
			// http://bugs.jquery.com/ticket/12359
			div.innerHTML = "<select><option selected=''></option></select>";

			// IE8 - Some boolean attributes are not treated correctly
			if ( !div.querySelectorAll("[selected]").length ) {
				rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
			}

			// Webkit/Opera - :checked should return selected option elements
			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
			// IE8 throws error here and will not see later tests
			if ( !div.querySelectorAll(":checked").length ) {
				rbuggyQSA.push(":checked");
			}
		});

		assert(function( div ) {

			// Opera 10-12/IE8 - ^= $= *= and empty values
			// Should not select anything
			div.innerHTML = "<input type='hidden' i=''/>";
			if ( div.querySelectorAll("[i^='']").length ) {
				rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
			}

			// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
			// IE8 throws error here and will not see later tests
			if ( !div.querySelectorAll(":enabled").length ) {
				rbuggyQSA.push( ":enabled", ":disabled" );
			}

			// Opera 10-11 does not throw on post-comma invalid pseudos
			div.querySelectorAll("*,:x");
			rbuggyQSA.push(",.*:");
		});
	}

	if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||
		docElem.mozMatchesSelector ||
		docElem.webkitMatchesSelector ||
		docElem.oMatchesSelector ||
		docElem.msMatchesSelector) )) ) {

		assert(function( div ) {
			// Check to see if it's possible to do matchesSelector
			// on a disconnected node (IE 9)
			support.disconnectedMatch = matches.call( div, "div" );

			// This should fail with an exception
			// Gecko does not error, returns false instead
			matches.call( div, "[s!='']:x" );
			rbuggyMatches.push( "!=", pseudos );
		});
	}

	rbuggyQSA = new RegExp( rbuggyQSA.join("|") );
	rbuggyMatches = new RegExp( rbuggyMatches.join("|") );

	// Element contains another
	// Purposefully does not implement inclusive descendent
	// As in, an element does not contain itself
	contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
		function( a, b ) {
			var adown = a.nodeType === 9 ? a.documentElement : a,
				bup = b && b.parentNode;
			return a === bup || !!( bup && bup.nodeType === 1 && (
				adown.contains ?
					adown.contains( bup ) :
					a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
			));
		} :
		function( a, b ) {
			if ( b ) {
				while ( (b = b.parentNode) ) {
					if ( b === a ) {
						return true;
					}
				}
			}
			return false;
		};

	// Document order sorting
	sortOrder = docElem.compareDocumentPosition ?
	function( a, b ) {
		var compare;

		if ( a === b ) {
			hasDuplicate = true;
			return 0;
		}

		if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
			if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
				if ( a === doc || contains( preferredDoc, a ) ) {
					return -1;
				}
				if ( b === doc || contains( preferredDoc, b ) ) {
					return 1;
				}
				return 0;
			}
			return compare & 4 ? -1 : 1;
		}

		return a.compareDocumentPosition ? -1 : 1;
	} :
	function( a, b ) {
		var cur,
			i = 0,
			aup = a.parentNode,
			bup = b.parentNode,
			ap = [ a ],
			bp = [ b ];

		// Exit early if the nodes are identical
		if ( a === b ) {
			hasDuplicate = true;
			return 0;

		// Parentless nodes are either documents or disconnected
		} else if ( !aup || !bup ) {
			return a === doc ? -1 :
				b === doc ? 1 :
				aup ? -1 :
				bup ? 1 :
				0;

		// If the nodes are siblings, we can do a quick check
		} else if ( aup === bup ) {
			return siblingCheck( a, b );
		}

		// Otherwise we need full lists of their ancestors for comparison
		cur = a;
		while ( (cur = cur.parentNode) ) {
			ap.unshift( cur );
		}
		cur = b;
		while ( (cur = cur.parentNode) ) {
			bp.unshift( cur );
		}

		// Walk down the tree looking for a discrepancy
		while ( ap[i] === bp[i] ) {
			i++;
		}

		return i ?
			// Do a sibling check if the nodes have a common ancestor
			siblingCheck( ap[i], bp[i] ) :

			// Otherwise nodes in our document sort first
			ap[i] === preferredDoc ? -1 :
			bp[i] === preferredDoc ? 1 :
			0;
	};

	// Always assume the presence of duplicates if sort doesn't
	// pass them to our comparison function (as in Google Chrome).
	hasDuplicate = false;
	[0, 0].sort( sortOrder );
	support.detectDuplicates = hasDuplicate;

	return document;
};

Sizzle.matches = function( expr, elements ) {
	return Sizzle( expr, null, null, elements );
};

Sizzle.matchesSelector = function( elem, expr ) {
	// Set document vars if needed
	if ( ( elem.ownerDocument || elem ) !== document ) {
		setDocument( elem );
	}

	// Make sure that attribute selectors are quoted
	expr = expr.replace( rattributeQuotes, "='$1']" );

	// rbuggyQSA always contains :focus, so no need for an existence check
	if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {
		try {
			var ret = matches.call( elem, expr );

			// IE 9's matchesSelector returns false on disconnected nodes
			if ( ret || support.disconnectedMatch ||
					// As well, disconnected nodes are said to be in a document
					// fragment in IE 9
					elem.document && elem.document.nodeType !== 11 ) {
				return ret;
			}
		} catch(e) {}
	}

	return Sizzle( expr, document, null, [elem] ).length > 0;
};

Sizzle.contains = function( context, elem ) {
	// Set document vars if needed
	if ( ( context.ownerDocument || context ) !== document ) {
		setDocument( context );
	}
	return contains( context, elem );
};

Sizzle.attr = function( elem, name ) {
	var val;

	// Set document vars if needed
	if ( ( elem.ownerDocument || elem ) !== document ) {
		setDocument( elem );
	}

	if ( !documentIsXML ) {
		name = name.toLowerCase();
	}
	if ( (val = Expr.attrHandle[ name ]) ) {
		return val( elem );
	}
	if ( documentIsXML || support.attributes ) {
		return elem.getAttribute( name );
	}
	return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
		name :
		val && val.specified ? val.value : null;
};

Sizzle.error = function( msg ) {
	throw new Error( "Syntax error, unrecognized expression: " + msg );
};

// Document sorting and removing duplicates
Sizzle.uniqueSort = function( results ) {
	var elem,
		duplicates = [],
		i = 1,
		j = 0;

	// Unless we *know* we can detect duplicates, assume their presence
	hasDuplicate = !support.detectDuplicates;
	results.sort( sortOrder );

	if ( hasDuplicate ) {
		for ( ; (elem = results[i]); i++ ) {
			if ( elem === results[ i - 1 ] ) {
				j = duplicates.push( i );
			}
		}
		while ( j-- ) {
			results.splice( duplicates[ j ], 1 );
		}
	}

	return results;
};

function siblingCheck( a, b ) {
	var cur = b && a,
		diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );

	// Use IE sourceIndex if available on both nodes
	if ( diff ) {
		return diff;
	}

	// Check if b follows a
	if ( cur ) {
		while ( (cur = cur.nextSibling) ) {
			if ( cur === b ) {
				return -1;
			}
		}
	}

	return a ? 1 : -1;
}

// Returns a function to use in pseudos for input types
function createInputPseudo( type ) {
	return function( elem ) {
		var name = elem.nodeName.toLowerCase();
		return name === "input" && elem.type === type;
	};
}

// Returns a function to use in pseudos for buttons
function createButtonPseudo( type ) {
	return function( elem ) {
		var name = elem.nodeName.toLowerCase();
		return (name === "input" || name === "button") && elem.type === type;
	};
}

// Returns a function to use in pseudos for positionals
function createPositionalPseudo( fn ) {
	return markFunction(function( argument ) {
		argument = +argument;
		return markFunction(function( seed, matches ) {
			var j,
				matchIndexes = fn( [], seed.length, argument ),
				i = matchIndexes.length;

			// Match elements found at the specified indexes
			while ( i-- ) {
				if ( seed[ (j = matchIndexes[i]) ] ) {
					seed[j] = !(matches[j] = seed[j]);
				}
			}
		});
	});
}

/**
 * Utility function for retrieving the text value of an array of DOM nodes
 * @param {Array|Element} elem
 */
getText = Sizzle.getText = function( elem ) {
	var node,
		ret = "",
		i = 0,
		nodeType = elem.nodeType;

	if ( !nodeType ) {
		// If no nodeType, this is expected to be an array
		for ( ; (node = elem[i]); i++ ) {
			// Do not traverse comment nodes
			ret += getText( node );
		}
	} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
		// Use textContent for elements
		// innerText usage removed for consistency of new lines (see #11153)
		if ( typeof elem.textContent === "string" ) {
			return elem.textContent;
		} else {
			// Traverse its children
			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
				ret += getText( elem );
			}
		}
	} else if ( nodeType === 3 || nodeType === 4 ) {
		return elem.nodeValue;
	}
	// Do not include comment or processing instruction nodes

	return ret;
};

Expr = Sizzle.selectors = {

	// Can be adjusted by the user
	cacheLength: 50,

	createPseudo: markFunction,

	match: matchExpr,

	find: {},

	relative: {
		">": { dir: "parentNode", first: true },
		" ": { dir: "parentNode" },
		"+": { dir: "previousSibling", first: true },
		"~": { dir: "previousSibling" }
	},

	preFilter: {
		"ATTR": function( match ) {
			match[1] = match[1].replace( runescape, funescape );

			// Move the given value to match[3] whether quoted or unquoted
			match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );

			if ( match[2] === "~=" ) {
				match[3] = " " + match[3] + " ";
			}

			return match.slice( 0, 4 );
		},

		"CHILD": function( match ) {
			/* matches from matchExpr["CHILD"]
				1 type (only|nth|...)
				2 what (child|of-type)
				3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
				4 xn-component of xn+y argument ([+-]?\d*n|)
				5 sign of xn-component
				6 x of xn-component
				7 sign of y-component
				8 y of y-component
			*/
			match[1] = match[1].toLowerCase();

			if ( match[1].slice( 0, 3 ) === "nth" ) {
				// nth-* requires argument
				if ( !match[3] ) {
					Sizzle.error( match[0] );
				}

				// numeric x and y parameters for Expr.filter.CHILD
				// remember that false/true cast respectively to 0/1
				match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
				match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );

			// other types prohibit arguments
			} else if ( match[3] ) {
				Sizzle.error( match[0] );
			}

			return match;
		},

		"PSEUDO": function( match ) {
			var excess,
				unquoted = !match[5] && match[2];

			if ( matchExpr["CHILD"].test( match[0] ) ) {
				return null;
			}

			// Accept quoted arguments as-is
			if ( match[4] ) {
				match[2] = match[4];

			// Strip excess characters from unquoted arguments
			} else if ( unquoted && rpseudo.test( unquoted ) &&
				// Get excess from tokenize (recursively)
				(excess = tokenize( unquoted, true )) &&
				// advance to the next closing parenthesis
				(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {

				// excess is a negative index
				match[0] = match[0].slice( 0, excess );
				match[2] = unquoted.slice( 0, excess );
			}

			// Return only captures needed by the pseudo filter method (type and argument)
			return match.slice( 0, 3 );
		}
	},

	filter: {

		"TAG": function( nodeName ) {
			if ( nodeName === "*" ) {
				return function() { return true; };
			}

			nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
			return function( elem ) {
				return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
			};
		},

		"CLASS": function( className ) {
			var pattern = classCache[ className + " " ];

			return pattern ||
				(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
				classCache( className, function( elem ) {
					return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
				});
		},

		"ATTR": function( name, operator, check ) {
			return function( elem ) {
				var result = Sizzle.attr( elem, name );

				if ( result == null ) {
					return operator === "!=";
				}
				if ( !operator ) {
					return true;
				}

				result += "";

				return operator === "=" ? result === check :
					operator === "!=" ? result !== check :
					operator === "^=" ? check && result.indexOf( check ) === 0 :
					operator === "*=" ? check && result.indexOf( check ) > -1 :
					operator === "$=" ? check && result.slice( -check.length ) === check :
					operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
					operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
					false;
			};
		},

		"CHILD": function( type, what, argument, first, last ) {
			var simple = type.slice( 0, 3 ) !== "nth",
				forward = type.slice( -4 ) !== "last",
				ofType = what === "of-type";

			return first === 1 && last === 0 ?

				// Shortcut for :nth-*(n)
				function( elem ) {
					return !!elem.parentNode;
				} :

				function( elem, context, xml ) {
					var cache, outerCache, node, diff, nodeIndex, start,
						dir = simple !== forward ? "nextSibling" : "previousSibling",
						parent = elem.parentNode,
						name = ofType && elem.nodeName.toLowerCase(),
						useCache = !xml && !ofType;

					if ( parent ) {

						// :(first|last|only)-(child|of-type)
						if ( simple ) {
							while ( dir ) {
								node = elem;
								while ( (node = node[ dir ]) ) {
									if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
										return false;
									}
								}
								// Reverse direction for :only-* (if we haven't yet done so)
								start = dir = type === "only" && !start && "nextSibling";
							}
							return true;
						}

						start = [ forward ? parent.firstChild : parent.lastChild ];

						// non-xml :nth-child(...) stores cache data on `parent`
						if ( forward && useCache ) {
							// Seek `elem` from a previously-cached index
							outerCache = parent[ expando ] || (parent[ expando ] = {});
							cache = outerCache[ type ] || [];
							nodeIndex = cache[0] === dirruns && cache[1];
							diff = cache[0] === dirruns && cache[2];
							node = nodeIndex && parent.childNodes[ nodeIndex ];

							while ( (node = ++nodeIndex && node && node[ dir ] ||

								// Fallback to seeking `elem` from the start
								(diff = nodeIndex = 0) || start.pop()) ) {

								// When found, cache indexes on `parent` and break
								if ( node.nodeType === 1 && ++diff && node === elem ) {
									outerCache[ type ] = [ dirruns, nodeIndex, diff ];
									break;
								}
							}

						// Use previously-cached element index if available
						} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
							diff = cache[1];

						// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
						} else {
							// Use the same loop as above to seek `elem` from the start
							while ( (node = ++nodeIndex && node && node[ dir ] ||
								(diff = nodeIndex = 0) || start.pop()) ) {

								if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
									// Cache the index of each encountered element
									if ( useCache ) {
										(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
									}

									if ( node === elem ) {
										break;
									}
								}
							}
						}

						// Incorporate the offset, then check against cycle size
						diff -= last;
						return diff === first || ( diff % first === 0 && diff / first >= 0 );
					}
				};
		},

		"PSEUDO": function( pseudo, argument ) {
			// pseudo-class names are case-insensitive
			// http://www.w3.org/TR/selectors/#pseudo-classes
			// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
			// Remember that setFilters inherits from pseudos
			var args,
				fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
					Sizzle.error( "unsupported pseudo: " + pseudo );

			// The user may use createPseudo to indicate that
			// arguments are needed to create the filter function
			// just as Sizzle does
			if ( fn[ expando ] ) {
				return fn( argument );
			}

			// But maintain support for old signatures
			if ( fn.length > 1 ) {
				args = [ pseudo, pseudo, "", argument ];
				return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
					markFunction(function( seed, matches ) {
						var idx,
							matched = fn( seed, argument ),
							i = matched.length;
						while ( i-- ) {
							idx = indexOf.call( seed, matched[i] );
							seed[ idx ] = !( matches[ idx ] = matched[i] );
						}
					}) :
					function( elem ) {
						return fn( elem, 0, args );
					};
			}

			return fn;
		}
	},

	pseudos: {
		// Potentially complex pseudos
		"not": markFunction(function( selector ) {
			// Trim the selector passed to compile
			// to avoid treating leading and trailing
			// spaces as combinators
			var input = [],
				results = [],
				matcher = compile( selector.replace( rtrim, "$1" ) );

			return matcher[ expando ] ?
				markFunction(function( seed, matches, context, xml ) {
					var elem,
						unmatched = matcher( seed, null, xml, [] ),
						i = seed.length;

					// Match elements unmatched by `matcher`
					while ( i-- ) {
						if ( (elem = unmatched[i]) ) {
							seed[i] = !(matches[i] = elem);
						}
					}
				}) :
				function( elem, context, xml ) {
					input[0] = elem;
					matcher( input, null, xml, results );
					return !results.pop();
				};
		}),

		"has": markFunction(function( selector ) {
			return function( elem ) {
				return Sizzle( selector, elem ).length > 0;
			};
		}),

		"contains": markFunction(function( text ) {
			return function( elem ) {
				return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
			};
		}),

		// "Whether an element is represented by a :lang() selector
		// is based solely on the element's language value
		// being equal to the identifier C,
		// or beginning with the identifier C immediately followed by "-".
		// The matching of C against the element's language value is performed case-insensitively.
		// The identifier C does not have to be a valid language name."
		// http://www.w3.org/TR/selectors/#lang-pseudo
		"lang": markFunction( function( lang ) {
			// lang value must be a valid identifider
			if ( !ridentifier.test(lang || "") ) {
				Sizzle.error( "unsupported lang: " + lang );
			}
			lang = lang.replace( runescape, funescape ).toLowerCase();
			return function( elem ) {
				var elemLang;
				do {
					if ( (elemLang = documentIsXML ?
						elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
						elem.lang) ) {

						elemLang = elemLang.toLowerCase();
						return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
					}
				} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
				return false;
			};
		}),

		// Miscellaneous
		"target": function( elem ) {
			var hash = window.location && window.location.hash;
			return hash && hash.slice( 1 ) === elem.id;
		},

		"root": function( elem ) {
			return elem === docElem;
		},

		"focus": function( elem ) {
			return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
		},

		// Boolean properties
		"enabled": function( elem ) {
			return elem.disabled === false;
		},

		"disabled": function( elem ) {
			return elem.disabled === true;
		},

		"checked": function( elem ) {
			// In CSS3, :checked should return both checked and selected elements
			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
			var nodeName = elem.nodeName.toLowerCase();
			return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
		},

		"selected": function( elem ) {
			// Accessing this property makes selected-by-default
			// options in Safari work properly
			if ( elem.parentNode ) {
				elem.parentNode.selectedIndex;
			}

			return elem.selected === true;
		},

		// Contents
		"empty": function( elem ) {
			// http://www.w3.org/TR/selectors/#empty-pseudo
			// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
			//   not comment, processing instructions, or others
			// Thanks to Diego Perini for the nodeName shortcut
			//   Greater than "@" means alpha characters (specifically not starting with "#" or "?")
			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
				if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
					return false;
				}
			}
			return true;
		},

		"parent": function( elem ) {
			return !Expr.pseudos["empty"]( elem );
		},

		// Element/input types
		"header": function( elem ) {
			return rheader.test( elem.nodeName );
		},

		"input": function( elem ) {
			return rinputs.test( elem.nodeName );
		},

		"button": function( elem ) {
			var name = elem.nodeName.toLowerCase();
			return name === "input" && elem.type === "button" || name === "button";
		},

		"text": function( elem ) {
			var attr;
			// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
			// use getAttribute instead to test this case
			return elem.nodeName.toLowerCase() === "input" &&
				elem.type === "text" &&
				( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
		},

		// Position-in-collection
		"first": createPositionalPseudo(function() {
			return [ 0 ];
		}),

		"last": createPositionalPseudo(function( matchIndexes, length ) {
			return [ length - 1 ];
		}),

		"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
			return [ argument < 0 ? argument + length : argument ];
		}),

		"even": createPositionalPseudo(function( matchIndexes, length ) {
			var i = 0;
			for ( ; i < length; i += 2 ) {
				matchIndexes.push( i );
			}
			return matchIndexes;
		}),

		"odd": createPositionalPseudo(function( matchIndexes, length ) {
			var i = 1;
			for ( ; i < length; i += 2 ) {
				matchIndexes.push( i );
			}
			return matchIndexes;
		}),

		"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
			var i = argument < 0 ? argument + length : argument;
			for ( ; --i >= 0; ) {
				matchIndexes.push( i );
			}
			return matchIndexes;
		}),

		"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
			var i = argument < 0 ? argument + length : argument;
			for ( ; ++i < length; ) {
				matchIndexes.push( i );
			}
			return matchIndexes;
		})
	}
};

// Add button/input type pseudos
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
	Expr.pseudos[ i ] = createInputPseudo( i );
}
for ( i in { submit: true, reset: true } ) {
	Expr.pseudos[ i ] = createButtonPseudo( i );
}

function tokenize( selector, parseOnly ) {
	var matched, match, tokens, type,
		soFar, groups, preFilters,
		cached = tokenCache[ selector + " " ];

	if ( cached ) {
		return parseOnly ? 0 : cached.slice( 0 );
	}

	soFar = selector;
	groups = [];
	preFilters = Expr.preFilter;

	while ( soFar ) {

		// Comma and first run
		if ( !matched || (match = rcomma.exec( soFar )) ) {
			if ( match ) {
				// Don't consume trailing commas as valid
				soFar = soFar.slice( match[0].length ) || soFar;
			}
			groups.push( tokens = [] );
		}

		matched = false;

		// Combinators
		if ( (match = rcombinators.exec( soFar )) ) {
			matched = match.shift();
			tokens.push( {
				value: matched,
				// Cast descendant combinators to space
				type: match[0].replace( rtrim, " " )
			} );
			soFar = soFar.slice( matched.length );
		}

		// Filters
		for ( type in Expr.filter ) {
			if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
				(match = preFilters[ type ]( match ))) ) {
				matched = match.shift();
				tokens.push( {
					value: matched,
					type: type,
					matches: match
				} );
				soFar = soFar.slice( matched.length );
			}
		}

		if ( !matched ) {
			break;
		}
	}

	// Return the length of the invalid excess
	// if we're just parsing
	// Otherwise, throw an error or return tokens
	return parseOnly ?
		soFar.length :
		soFar ?
			Sizzle.error( selector ) :
			// Cache the tokens
			tokenCache( selector, groups ).slice( 0 );
}

function toSelector( tokens ) {
	var i = 0,
		len = tokens.length,
		selector = "";
	for ( ; i < len; i++ ) {
		selector += tokens[i].value;
	}
	return selector;
}

function addCombinator( matcher, combinator, base ) {
	var dir = combinator.dir,
		checkNonElements = base && dir === "parentNode",
		doneName = done++;

	return combinator.first ?
		// Check against closest ancestor/preceding element
		function( elem, context, xml ) {
			while ( (elem = elem[ dir ]) ) {
				if ( elem.nodeType === 1 || checkNonElements ) {
					return matcher( elem, context, xml );
				}
			}
		} :

		// Check against all ancestor/preceding elements
		function( elem, context, xml ) {
			var data, cache, outerCache,
				dirkey = dirruns + " " + doneName;

			// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
			if ( xml ) {
				while ( (elem = elem[ dir ]) ) {
					if ( elem.nodeType === 1 || checkNonElements ) {
						if ( matcher( elem, context, xml ) ) {
							return true;
						}
					}
				}
			} else {
				while ( (elem = elem[ dir ]) ) {
					if ( elem.nodeType === 1 || checkNonElements ) {
						outerCache = elem[ expando ] || (elem[ expando ] = {});
						if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
							if ( (data = cache[1]) === true || data === cachedruns ) {
								return data === true;
							}
						} else {
							cache = outerCache[ dir ] = [ dirkey ];
							cache[1] = matcher( elem, context, xml ) || cachedruns;
							if ( cache[1] === true ) {
								return true;
							}
						}
					}
				}
			}
		};
}

function elementMatcher( matchers ) {
	return matchers.length > 1 ?
		function( elem, context, xml ) {
			var i = matchers.length;
			while ( i-- ) {
				if ( !matchers[i]( elem, context, xml ) ) {
					return false;
				}
			}
			return true;
		} :
		matchers[0];
}

function condense( unmatched, map, filter, context, xml ) {
	var elem,
		newUnmatched = [],
		i = 0,
		len = unmatched.length,
		mapped = map != null;

	for ( ; i < len; i++ ) {
		if ( (elem = unmatched[i]) ) {
			if ( !filter || filter( elem, context, xml ) ) {
				newUnmatched.push( elem );
				if ( mapped ) {
					map.push( i );
				}
			}
		}
	}

	return newUnmatched;
}

function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
	if ( postFilter && !postFilter[ expando ] ) {
		postFilter = setMatcher( postFilter );
	}
	if ( postFinder && !postFinder[ expando ] ) {
		postFinder = setMatcher( postFinder, postSelector );
	}
	return markFunction(function( seed, results, context, xml ) {
		var temp, i, elem,
			preMap = [],
			postMap = [],
			preexisting = results.length,

			// Get initial elements from seed or context
			elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),

			// Prefilter to get matcher input, preserving a map for seed-results synchronization
			matcherIn = preFilter && ( seed || !selector ) ?
				condense( elems, preMap, preFilter, context, xml ) :
				elems,

			matcherOut = matcher ?
				// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
				postFinder || ( seed ? preFilter : preexisting || postFilter ) ?

					// ...intermediate processing is necessary
					[] :

					// ...otherwise use results directly
					results :
				matcherIn;

		// Find primary matches
		if ( matcher ) {
			matcher( matcherIn, matcherOut, context, xml );
		}

		// Apply postFilter
		if ( postFilter ) {
			temp = condense( matcherOut, postMap );
			postFilter( temp, [], context, xml );

			// Un-match failing elements by moving them back to matcherIn
			i = temp.length;
			while ( i-- ) {
				if ( (elem = temp[i]) ) {
					matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
				}
			}
		}

		if ( seed ) {
			if ( postFinder || preFilter ) {
				if ( postFinder ) {
					// Get the final matcherOut by condensing this intermediate into postFinder contexts
					temp = [];
					i = matcherOut.length;
					while ( i-- ) {
						if ( (elem = matcherOut[i]) ) {
							// Restore matcherIn since elem is not yet a final match
							temp.push( (matcherIn[i] = elem) );
						}
					}
					postFinder( null, (matcherOut = []), temp, xml );
				}

				// Move matched elements from seed to results to keep them synchronized
				i = matcherOut.length;
				while ( i-- ) {
					if ( (elem = matcherOut[i]) &&
						(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {

						seed[temp] = !(results[temp] = elem);
					}
				}
			}

		// Add elements to results, through postFinder if defined
		} else {
			matcherOut = condense(
				matcherOut === results ?
					matcherOut.splice( preexisting, matcherOut.length ) :
					matcherOut
			);
			if ( postFinder ) {
				postFinder( null, results, matcherOut, xml );
			} else {
				push.apply( results, matcherOut );
			}
		}
	});
}

function matcherFromTokens( tokens ) {
	var checkContext, matcher, j,
		len = tokens.length,
		leadingRelative = Expr.relative[ tokens[0].type ],
		implicitRelative = leadingRelative || Expr.relative[" "],
		i = leadingRelative ? 1 : 0,

		// The foundational matcher ensures that elements are reachable from top-level context(s)
		matchContext = addCombinator( function( elem ) {
			return elem === checkContext;
		}, implicitRelative, true ),
		matchAnyContext = addCombinator( function( elem ) {
			return indexOf.call( checkContext, elem ) > -1;
		}, implicitRelative, true ),
		matchers = [ function( elem, context, xml ) {
			return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
				(checkContext = context).nodeType ?
					matchContext( elem, context, xml ) :
					matchAnyContext( elem, context, xml ) );
		} ];

	for ( ; i < len; i++ ) {
		if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
			matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
		} else {
			matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );

			// Return special upon seeing a positional matcher
			if ( matcher[ expando ] ) {
				// Find the next relative operator (if any) for proper handling
				j = ++i;
				for ( ; j < len; j++ ) {
					if ( Expr.relative[ tokens[j].type ] ) {
						break;
					}
				}
				return setMatcher(
					i > 1 && elementMatcher( matchers ),
					i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
					matcher,
					i < j && matcherFromTokens( tokens.slice( i, j ) ),
					j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
					j < len && toSelector( tokens )
				);
			}
			matchers.push( matcher );
		}
	}

	return elementMatcher( matchers );
}

function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
	// A counter to specify which element is currently being matched
	var matcherCachedRuns = 0,
		bySet = setMatchers.length > 0,
		byElement = elementMatchers.length > 0,
		superMatcher = function( seed, context, xml, results, expandContext ) {
			var elem, j, matcher,
				setMatched = [],
				matchedCount = 0,
				i = "0",
				unmatched = seed && [],
				outermost = expandContext != null,
				contextBackup = outermostContext,
				// We must always have either seed elements or context
				elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
				// Use integer dirruns iff this is the outermost matcher
				dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);

			if ( outermost ) {
				outermostContext = context !== document && context;
				cachedruns = matcherCachedRuns;
			}

			// Add elements passing elementMatchers directly to results
			// Keep `i` a string if there are no elements so `matchedCount` will be "00" below
			for ( ; (elem = elems[i]) != null; i++ ) {
				if ( byElement && elem ) {
					j = 0;
					while ( (matcher = elementMatchers[j++]) ) {
						if ( matcher( elem, context, xml ) ) {
							results.push( elem );
							break;
						}
					}
					if ( outermost ) {
						dirruns = dirrunsUnique;
						cachedruns = ++matcherCachedRuns;
					}
				}

				// Track unmatched elements for set filters
				if ( bySet ) {
					// They will have gone through all possible matchers
					if ( (elem = !matcher && elem) ) {
						matchedCount--;
					}

					// Lengthen the array for every element, matched or not
					if ( seed ) {
						unmatched.push( elem );
					}
				}
			}

			// Apply set filters to unmatched elements
			matchedCount += i;
			if ( bySet && i !== matchedCount ) {
				j = 0;
				while ( (matcher = setMatchers[j++]) ) {
					matcher( unmatched, setMatched, context, xml );
				}

				if ( seed ) {
					// Reintegrate element matches to eliminate the need for sorting
					if ( matchedCount > 0 ) {
						while ( i-- ) {
							if ( !(unmatched[i] || setMatched[i]) ) {
								setMatched[i] = pop.call( results );
							}
						}
					}

					// Discard index placeholder values to get only actual matches
					setMatched = condense( setMatched );
				}

				// Add matches to results
				push.apply( results, setMatched );

				// Seedless set matches succeeding multiple successful matchers stipulate sorting
				if ( outermost && !seed && setMatched.length > 0 &&
					( matchedCount + setMatchers.length ) > 1 ) {

					Sizzle.uniqueSort( results );
				}
			}

			// Override manipulation of globals by nested matchers
			if ( outermost ) {
				dirruns = dirrunsUnique;
				outermostContext = contextBackup;
			}

			return unmatched;
		};

	return bySet ?
		markFunction( superMatcher ) :
		superMatcher;
}

compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
	var i,
		setMatchers = [],
		elementMatchers = [],
		cached = compilerCache[ selector + " " ];

	if ( !cached ) {
		// Generate a function of recursive functions that can be used to check each element
		if ( !group ) {
			group = tokenize( selector );
		}
		i = group.length;
		while ( i-- ) {
			cached = matcherFromTokens( group[i] );
			if ( cached[ expando ] ) {
				setMatchers.push( cached );
			} else {
				elementMatchers.push( cached );
			}
		}

		// Cache the compiled function
		cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
	}
	return cached;
};

function multipleContexts( selector, contexts, results ) {
	var i = 0,
		len = contexts.length;
	for ( ; i < len; i++ ) {
		Sizzle( selector, contexts[i], results );
	}
	return results;
}

function select( selector, context, results, seed ) {
	var i, tokens, token, type, find,
		match = tokenize( selector );

	if ( !seed ) {
		// Try to minimize operations if there is only one group
		if ( match.length === 1 ) {

			// Take a shortcut and set the context if the root selector is an ID
			tokens = match[0] = match[0].slice( 0 );
			if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
					context.nodeType === 9 && !documentIsXML &&
					Expr.relative[ tokens[1].type ] ) {

				context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
				if ( !context ) {
					return results;
				}

				selector = selector.slice( tokens.shift().value.length );
			}

			// Fetch a seed set for right-to-left matching
			i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
			while ( i-- ) {
				token = tokens[i];

				// Abort if we hit a combinator
				if ( Expr.relative[ (type = token.type) ] ) {
					break;
				}
				if ( (find = Expr.find[ type ]) ) {
					// Search, expanding context for leading sibling combinators
					if ( (seed = find(
						token.matches[0].replace( runescape, funescape ),
						rsibling.test( tokens[0].type ) && context.parentNode || context
					)) ) {

						// If seed is empty or no tokens remain, we can return early
						tokens.splice( i, 1 );
						selector = seed.length && toSelector( tokens );
						if ( !selector ) {
							push.apply( results, slice.call( seed, 0 ) );
							return results;
						}

						break;
					}
				}
			}
		}
	}

	// Compile and execute a filtering function
	// Provide `match` to avoid retokenization if we modified the selector above
	compile( selector, match )(
		seed,
		context,
		documentIsXML,
		results,
		rsibling.test( selector )
	);
	return results;
}

// Deprecated
Expr.pseudos["nth"] = Expr.pseudos["eq"];

// Easy API for creating new setFilters
function setFilters() {}
Expr.filters = setFilters.prototype = Expr.pseudos;
Expr.setFilters = new setFilters();

// Initialize with the default document
setDocument();

// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.pseudos;
jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;


})( window );
var runtil = /Until$/,
	rparentsprev = /^(?:parents|prev(?:Until|All))/,
	isSimple = /^.[^:#\[\.,]*$/,
	rneedsContext = jQuery.expr.match.needsContext,
	// methods guaranteed to produce a unique set when starting from a unique set
	guaranteedUnique = {
		children: true,
		contents: true,
		next: true,
		prev: true
	};

jQuery.fn.extend({
	find: function( selector ) {
		var i, ret, self,
			len = this.length;

		if ( typeof selector !== "string" ) {
			self = this;
			return this.pushStack( jQuery( selector ).filter(function() {
				for ( i = 0; i < len; i++ ) {
					if ( jQuery.contains( self[ i ], this ) ) {
						return true;
					}
				}
			}) );
		}

		ret = [];
		for ( i = 0; i < len; i++ ) {
			jQuery.find( selector, this[ i ], ret );
		}

		// Needed because $( selector, context ) becomes $( context ).find( selector )
		ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
		ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
		return ret;
	},

	has: function( target ) {
		var i,
			targets = jQuery( target, this ),
			len = targets.length;

		return this.filter(function() {
			for ( i = 0; i < len; i++ ) {
				if ( jQuery.contains( this, targets[i] ) ) {
					return true;
				}
			}
		});
	},

	not: function( selector ) {
		return this.pushStack( winnow(this, selector, false) );
	},

	filter: function( selector ) {
		return this.pushStack( winnow(this, selector, true) );
	},

	is: function( selector ) {
		return !!selector && (
			typeof selector === "string" ?
				// If this is a positional/relative selector, check membership in the returned set
				// so $("p:first").is("p:last") won't return true for a doc with two "p".
				rneedsContext.test( selector ) ?
					jQuery( selector, this.context ).index( this[0] ) >= 0 :
					jQuery.filter( selector, this ).length > 0 :
				this.filter( selector ).length > 0 );
	},

	closest: function( selectors, context ) {
		var cur,
			i = 0,
			l = this.length,
			ret = [],
			pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
				jQuery( selectors, context || this.context ) :
				0;

		for ( ; i < l; i++ ) {
			cur = this[i];

			while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
				if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
					ret.push( cur );
					break;
				}
				cur = cur.parentNode;
			}
		}

		return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
	},

	// Determine the position of an element within
	// the matched set of elements
	index: function( elem ) {

		// No argument, return index in parent
		if ( !elem ) {
			return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
		}

		// index in selector
		if ( typeof elem === "string" ) {
			return jQuery.inArray( this[0], jQuery( elem ) );
		}

		// Locate the position of the desired element
		return jQuery.inArray(
			// If it receives a jQuery object, the first element is used
			elem.jquery ? elem[0] : elem, this );
	},

	add: function( selector, context ) {
		var set = typeof selector === "string" ?
				jQuery( selector, context ) :
				jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
			all = jQuery.merge( this.get(), set );

		return this.pushStack( jQuery.unique(all) );
	},

	addBack: function( selector ) {
		return this.add( selector == null ?
			this.prevObject : this.prevObject.filter(selector)
		);
	}
});

jQuery.fn.andSelf = jQuery.fn.addBack;

function sibling( cur, dir ) {
	do {
		cur = cur[ dir ];
	} while ( cur && cur.nodeType !== 1 );

	return cur;
}

jQuery.each({
	parent: function( elem ) {
		var parent = elem.parentNode;
		return parent && parent.nodeType !== 11 ? parent : null;
	},
	parents: function( elem ) {
		return jQuery.dir( elem, "parentNode" );
	},
	parentsUntil: function( elem, i, until ) {
		return jQuery.dir( elem, "parentNode", until );
	},
	next: function( elem ) {
		return sibling( elem, "nextSibling" );
	},
	prev: function( elem ) {
		return sibling( elem, "previousSibling" );
	},
	nextAll: function( elem ) {
		return jQuery.dir( elem, "nextSibling" );
	},
	prevAll: function( elem ) {
		return jQuery.dir( elem, "previousSibling" );
	},
	nextUntil: function( elem, i, until ) {
		return jQuery.dir( elem, "nextSibling", until );
	},
	prevUntil: function( elem, i, until ) {
		return jQuery.dir( elem, "previousSibling", until );
	},
	siblings: function( elem ) {
		return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
	},
	children: function( elem ) {
		return jQuery.sibling( elem.firstChild );
	},
	contents: function( elem ) {
		return jQuery.nodeName( elem, "iframe" ) ?
			elem.contentDocument || elem.contentWindow.document :
			jQuery.merge( [], elem.childNodes );
	}
}, function( name, fn ) {
	jQuery.fn[ name ] = function( until, selector ) {
		var ret = jQuery.map( this, fn, until );

		if ( !runtil.test( name ) ) {
			selector = until;
		}

		if ( selector && typeof selector === "string" ) {
			ret = jQuery.filter( selector, ret );
		}

		ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;

		if ( this.length > 1 && rparentsprev.test( name ) ) {
			ret = ret.reverse();
		}

		return this.pushStack( ret );
	};
});

jQuery.extend({
	filter: function( expr, elems, not ) {
		if ( not ) {
			expr = ":not(" + expr + ")";
		}

		return elems.length === 1 ?
			jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
			jQuery.find.matches(expr, elems);
	},

	dir: function( elem, dir, until ) {
		var matched = [],
			cur = elem[ dir ];

		while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
			if ( cur.nodeType === 1 ) {
				matched.push( cur );
			}
			cur = cur[dir];
		}
		return matched;
	},

	sibling: function( n, elem ) {
		var r = [];

		for ( ; n; n = n.nextSibling ) {
			if ( n.nodeType === 1 && n !== elem ) {
				r.push( n );
			}
		}

		return r;
	}
});

// Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) {

	// Can't pass null or undefined to indexOf in Firefox 4
	// Set to 0 to skip string check
	qualifier = qualifier || 0;

	if ( jQuery.isFunction( qualifier ) ) {
		return jQuery.grep(elements, function( elem, i ) {
			var retVal = !!qualifier.call( elem, i, elem );
			return retVal === keep;
		});

	} else if ( qualifier.nodeType ) {
		return jQuery.grep(elements, function( elem ) {
			return ( elem === qualifier ) === keep;
		});

	} else if ( typeof qualifier === "string" ) {
		var filtered = jQuery.grep(elements, function( elem ) {
			return elem.nodeType === 1;
		});

		if ( isSimple.test( qualifier ) ) {
			return jQuery.filter(qualifier, filtered, !keep);
		} else {
			qualifier = jQuery.filter( qualifier, filtered );
		}
	}

	return jQuery.grep(elements, function( elem ) {
		return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
	});
}
function createSafeFragment( document ) {
	var list = nodeNames.split( "|" ),
		safeFrag = document.createDocumentFragment();

	if ( safeFrag.createElement ) {
		while ( list.length ) {
			safeFrag.createElement(
				list.pop()
			);
		}
	}
	return safeFrag;
}

var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
		"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
	rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
	rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
	rleadingWhitespace = /^\s+/,
	rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
	rtagName = /<([\w:]+)/,
	rtbody = /<tbody/i,
	rhtml = /<|&#?\w+;/,
	rnoInnerhtml = /<(?:script|style|link)/i,
	manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
	// checked="checked" or checked
	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
	rscriptType = /^$|\/(?:java|ecma)script/i,
	rscriptTypeMasked = /^true\/(.*)/,
	rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,

	// We have to close these tags to support XHTML (#13200)
	wrapMap = {
		option: [ 1, "<select multiple='multiple'>", "</select>" ],
		legend: [ 1, "<fieldset>", "</fieldset>" ],
		area: [ 1, "<map>", "</map>" ],
		param: [ 1, "<object>", "</object>" ],
		thead: [ 1, "<table>", "</table>" ],
		tr: [ 2, "<table><tbody>", "</tbody></table>" ],
		col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
		td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],

		// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
		// unless wrapped in a div with non-breaking characters in front of it.
		_default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>"  ]
	},
	safeFragment = createSafeFragment( document ),
	fragmentDiv = safeFragment.appendChild( document.createElement("div") );

wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;

jQuery.fn.extend({
	text: function( value ) {
		return jQuery.access( this, function( value ) {
			return value === undefined ?
				jQuery.text( this ) :
				this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
		}, null, value, arguments.length );
	},

	wrapAll: function( html ) {
		if ( jQuery.isFunction( html ) ) {
			return this.each(function(i) {
				jQuery(this).wrapAll( html.call(this, i) );
			});
		}

		if ( this[0] ) {
			// The elements to wrap the target around
			var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);

			if ( this[0].parentNode ) {
				wrap.insertBefore( this[0] );
			}

			wrap.map(function() {
				var elem = this;

				while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
					elem = elem.firstChild;
				}

				return elem;
			}).append( this );
		}

		return this;
	},

	wrapInner: function( html ) {
		if ( jQuery.isFunction( html ) ) {
			return this.each(function(i) {
				jQuery(this).wrapInner( html.call(this, i) );
			});
		}

		return this.each(function() {
			var self = jQuery( this ),
				contents = self.contents();

			if ( contents.length ) {
				contents.wrapAll( html );

			} else {
				self.append( html );
			}
		});
	},

	wrap: function( html ) {
		var isFunction = jQuery.isFunction( html );

		return this.each(function(i) {
			jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
		});
	},

	unwrap: function() {
		return this.parent().each(function() {
			if ( !jQuery.nodeName( this, "body" ) ) {
				jQuery( this ).replaceWith( this.childNodes );
			}
		}).end();
	},

	append: function() {
		return this.domManip(arguments, true, function( elem ) {
			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
				this.appendChild( elem );
			}
		});
	},

	prepend: function() {
		return this.domManip(arguments, true, function( elem ) {
			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
				this.insertBefore( elem, this.firstChild );
			}
		});
	},

	before: function() {
		return this.domManip( arguments, false, function( elem ) {
			if ( this.parentNode ) {
				this.parentNode.insertBefore( elem, this );
			}
		});
	},

	after: function() {
		return this.domManip( arguments, false, function( elem ) {
			if ( this.parentNode ) {
				this.parentNode.insertBefore( elem, this.nextSibling );
			}
		});
	},

	// keepData is for internal use only--do not document
	remove: function( selector, keepData ) {
		var elem,
			i = 0;

		for ( ; (elem = this[i]) != null; i++ ) {
			if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
				if ( !keepData && elem.nodeType === 1 ) {
					jQuery.cleanData( getAll( elem ) );
				}

				if ( elem.parentNode ) {
					if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
						setGlobalEval( getAll( elem, "script" ) );
					}
					elem.parentNode.removeChild( elem );
				}
			}
		}

		return this;
	},

	empty: function() {
		var elem,
			i = 0;

		for ( ; (elem = this[i]) != null; i++ ) {
			// Remove element nodes and prevent memory leaks
			if ( elem.nodeType === 1 ) {
				jQuery.cleanData( getAll( elem, false ) );
			}

			// Remove any remaining nodes
			while ( elem.firstChild ) {
				elem.removeChild( elem.firstChild );
			}

			// If this is a select, ensure that it displays empty (#12336)
			// Support: IE<9
			if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
				elem.options.length = 0;
			}
		}

		return this;
	},

	clone: function( dataAndEvents, deepDataAndEvents ) {
		dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
		deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;

		return this.map( function () {
			return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
		});
	},

	html: function( value ) {
		return jQuery.access( this, function( value ) {
			var elem = this[0] || {},
				i = 0,
				l = this.length;

			if ( value === undefined ) {
				return elem.nodeType === 1 ?
					elem.innerHTML.replace( rinlinejQuery, "" ) :
					undefined;
			}

			// See if we can take a shortcut and just use innerHTML
			if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
				( jQuery.support.htmlSerialize || !rnoshimcache.test( value )  ) &&
				( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
				!wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {

				value = value.replace( rxhtmlTag, "<$1></$2>" );

				try {
					for (; i < l; i++ ) {
						// Remove element nodes and prevent memory leaks
						elem = this[i] || {};
						if ( elem.nodeType === 1 ) {
							jQuery.cleanData( getAll( elem, false ) );
							elem.innerHTML = value;
						}
					}

					elem = 0;

				// If using innerHTML throws an exception, use the fallback method
				} catch(e) {}
			}

			if ( elem ) {
				this.empty().append( value );
			}
		}, null, value, arguments.length );
	},

	replaceWith: function( value ) {
		var isFunc = jQuery.isFunction( value );

		// Make sure that the elements are removed from the DOM before they are inserted
		// this can help fix replacing a parent with child elements
		if ( !isFunc && typeof value !== "string" ) {
			value = jQuery( value ).not( this ).detach();
		}

		return this.domManip( [ value ], true, function( elem ) {
			var next = this.nextSibling,
				parent = this.parentNode;

			if ( parent ) {
				jQuery( this ).remove();
				parent.insertBefore( elem, next );
			}
		});
	},

	detach: function( selector ) {
		return this.remove( selector, true );
	},

	domManip: function( args, table, callback ) {

		// Flatten any nested arrays
		args = core_concat.apply( [], args );

		var first, node, hasScripts,
			scripts, doc, fragment,
			i = 0,
			l = this.length,
			set = this,
			iNoClone = l - 1,
			value = args[0],
			isFunction = jQuery.isFunction( value );

		// We can't cloneNode fragments that contain checked, in WebKit
		if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
			return this.each(function( index ) {
				var self = set.eq( index );
				if ( isFunction ) {
					args[0] = value.call( this, index, table ? self.html() : undefined );
				}
				self.domManip( args, table, callback );
			});
		}

		if ( l ) {
			fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
			first = fragment.firstChild;

			if ( fragment.childNodes.length === 1 ) {
				fragment = first;
			}

			if ( first ) {
				table = table && jQuery.nodeName( first, "tr" );
				scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
				hasScripts = scripts.length;

				// Use the original fragment for the last item instead of the first because it can end up
				// being emptied incorrectly in certain situations (#8070).
				for ( ; i < l; i++ ) {
					node = fragment;

					if ( i !== iNoClone ) {
						node = jQuery.clone( node, true, true );

						// Keep references to cloned scripts for later restoration
						if ( hasScripts ) {
							jQuery.merge( scripts, getAll( node, "script" ) );
						}
					}

					callback.call(
						table && jQuery.nodeName( this[i], "table" ) ?
							findOrAppend( this[i], "tbody" ) :
							this[i],
						node,
						i
					);
				}

				if ( hasScripts ) {
					doc = scripts[ scripts.length - 1 ].ownerDocument;

					// Reenable scripts
					jQuery.map( scripts, restoreScript );

					// Evaluate executable scripts on first document insertion
					for ( i = 0; i < hasScripts; i++ ) {
						node = scripts[ i ];
						if ( rscriptType.test( node.type || "" ) &&
							!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {

							if ( node.src ) {
								// Hope ajax is available...
								jQuery.ajax({
									url: node.src,
									type: "GET",
									dataType: "script",
									async: false,
									global: false,
									"throws": true
								});
							} else {
								jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
							}
						}
					}
				}

				// Fix #11809: Avoid leaking memory
				fragment = first = null;
			}
		}

		return this;
	}
});

function findOrAppend( elem, tag ) {
	return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
}

// Replace/restore the type attribute of script elements for safe DOM manipulation
function disableScript( elem ) {
	var attr = elem.getAttributeNode("type");
	elem.type = ( attr && attr.specified ) + "/" + elem.type;
	return elem;
}
function restoreScript( elem ) {
	var match = rscriptTypeMasked.exec( elem.type );
	if ( match ) {
		elem.type = match[1];
	} else {
		elem.removeAttribute("type");
	}
	return elem;
}

// Mark scripts as having already been evaluated
function setGlobalEval( elems, refElements ) {
	var elem,
		i = 0;
	for ( ; (elem = elems[i]) != null; i++ ) {
		jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
	}
}

function cloneCopyEvent( src, dest ) {

	if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
		return;
	}

	var type, i, l,
		oldData = jQuery._data( src ),
		curData = jQuery._data( dest, oldData ),
		events = oldData.events;

	if ( events ) {
		delete curData.handle;
		curData.events = {};

		for ( type in events ) {
			for ( i = 0, l = events[ type ].length; i < l; i++ ) {
				jQuery.event.add( dest, type, events[ type ][ i ] );
			}
		}
	}

	// make the cloned public data object a copy from the original
	if ( curData.data ) {
		curData.data = jQuery.extend( {}, curData.data );
	}
}

function fixCloneNodeIssues( src, dest ) {
	var nodeName, e, data;

	// We do not need to do anything for non-Elements
	if ( dest.nodeType !== 1 ) {
		return;
	}

	nodeName = dest.nodeName.toLowerCase();

	// IE6-8 copies events bound via attachEvent when using cloneNode.
	if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
		data = jQuery._data( dest );

		for ( e in data.events ) {
			jQuery.removeEvent( dest, e, data.handle );
		}

		// Event data gets referenced instead of copied if the expando gets copied too
		dest.removeAttribute( jQuery.expando );
	}

	// IE blanks contents when cloning scripts, and tries to evaluate newly-set text
	if ( nodeName === "script" && dest.text !== src.text ) {
		disableScript( dest ).text = src.text;
		restoreScript( dest );

	// IE6-10 improperly clones children of object elements using classid.
	// IE10 throws NoModificationAllowedError if parent is null, #12132.
	} else if ( nodeName === "object" ) {
		if ( dest.parentNode ) {
			dest.outerHTML = src.outerHTML;
		}

		// This path appears unavoidable for IE9. When cloning an object
		// element in IE9, the outerHTML strategy above is not sufficient.
		// If the src has innerHTML and the destination does not,
		// copy the src.innerHTML into the dest.innerHTML. #10324
		if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
			dest.innerHTML = src.innerHTML;
		}

	} else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
		// IE6-8 fails to persist the checked state of a cloned checkbox
		// or radio button. Worse, IE6-7 fail to give the cloned element
		// a checked appearance if the defaultChecked value isn't also set

		dest.defaultChecked = dest.checked = src.checked;

		// IE6-7 get confused and end up setting the value of a cloned
		// checkbox/radio button to an empty string instead of "on"
		if ( dest.value !== src.value ) {
			dest.value = src.value;
		}

	// IE6-8 fails to return the selected option to the default selected
	// state when cloning options
	} else if ( nodeName === "option" ) {
		dest.defaultSelected = dest.selected = src.defaultSelected;

	// IE6-8 fails to set the defaultValue to the correct value when
	// cloning other types of input fields
	} else if ( nodeName === "input" || nodeName === "textarea" ) {
		dest.defaultValue = src.defaultValue;
	}
}

jQuery.each({
	appendTo: "append",
	prependTo: "prepend",
	insertBefore: "before",
	insertAfter: "after",
	replaceAll: "replaceWith"
}, function( name, original ) {
	jQuery.fn[ name ] = function( selector ) {
		var elems,
			i = 0,
			ret = [],
			insert = jQuery( selector ),
			last = insert.length - 1;

		for ( ; i <= last; i++ ) {
			elems = i === last ? this : this.clone(true);
			jQuery( insert[i] )[ original ]( elems );

			// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
			core_push.apply( ret, elems.get() );
		}

		return this.pushStack( ret );
	};
});

function getAll( context, tag ) {
	var elems, elem,
		i = 0,
		found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
			typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
			undefined;

	if ( !found ) {
		for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
			if ( !tag || jQuery.nodeName( elem, tag ) ) {
				found.push( elem );
			} else {
				jQuery.merge( found, getAll( elem, tag ) );
			}
		}
	}

	return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
		jQuery.merge( [ context ], found ) :
		found;
}

// Used in buildFragment, fixes the defaultChecked property
function fixDefaultChecked( elem ) {
	if ( manipulation_rcheckableType.test( elem.type ) ) {
		elem.defaultChecked = elem.checked;
	}
}

jQuery.extend({
	clone: function( elem, dataAndEvents, deepDataAndEvents ) {
		var destElements, node, clone, i, srcElements,
			inPage = jQuery.contains( elem.ownerDocument, elem );

		if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
			clone = elem.cloneNode( true );

		// IE<=8 does not properly clone detached, unknown element nodes
		} else {
			fragmentDiv.innerHTML = elem.outerHTML;
			fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
		}

		if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
				(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {

			// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
			destElements = getAll( clone );
			srcElements = getAll( elem );

			// Fix all IE cloning issues
			for ( i = 0; (node = srcElements[i]) != null; ++i ) {
				// Ensure that the destination node is not null; Fixes #9587
				if ( destElements[i] ) {
					fixCloneNodeIssues( node, destElements[i] );
				}
			}
		}

		// Copy the events from the original to the clone
		if ( dataAndEvents ) {
			if ( deepDataAndEvents ) {
				srcElements = srcElements || getAll( elem );
				destElements = destElements || getAll( clone );

				for ( i = 0; (node = srcElements[i]) != null; i++ ) {
					cloneCopyEvent( node, destElements[i] );
				}
			} else {
				cloneCopyEvent( elem, clone );
			}
		}

		// Preserve script evaluation history
		destElements = getAll( clone, "script" );
		if ( destElements.length > 0 ) {
			setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
		}

		destElements = srcElements = node = null;

		// Return the cloned set
		return clone;
	},

	buildFragment: function( elems, context, scripts, selection ) {
		var j, elem, contains,
			tmp, tag, tbody, wrap,
			l = elems.length,

			// Ensure a safe fragment
			safe = createSafeFragment( context ),

			nodes = [],
			i = 0;

		for ( ; i < l; i++ ) {
			elem = elems[ i ];

			if ( elem || elem === 0 ) {

				// Add nodes directly
				if ( jQuery.type( elem ) === "object" ) {
					jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );

				// Convert non-html into a text node
				} else if ( !rhtml.test( elem ) ) {
					nodes.push( context.createTextNode( elem ) );

				// Convert html into DOM nodes
				} else {
					tmp = tmp || safe.appendChild( context.createElement("div") );

					// Deserialize a standard representation
					tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
					wrap = wrapMap[ tag ] || wrapMap._default;

					tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];

					// Descend through wrappers to the right content
					j = wrap[0];
					while ( j-- ) {
						tmp = tmp.lastChild;
					}

					// Manually add leading whitespace removed by IE
					if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
						nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
					}

					// Remove IE's autoinserted <tbody> from table fragments
					if ( !jQuery.support.tbody ) {

						// String was a <table>, *may* have spurious <tbody>
						elem = tag === "table" && !rtbody.test( elem ) ?
							tmp.firstChild :

							// String was a bare <thead> or <tfoot>
							wrap[1] === "<table>" && !rtbody.test( elem ) ?
								tmp :
								0;

						j = elem && elem.childNodes.length;
						while ( j-- ) {
							if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
								elem.removeChild( tbody );
							}
						}
					}

					jQuery.merge( nodes, tmp.childNodes );

					// Fix #12392 for WebKit and IE > 9
					tmp.textContent = "";

					// Fix #12392 for oldIE
					while ( tmp.firstChild ) {
						tmp.removeChild( tmp.firstChild );
					}

					// Remember the top-level container for proper cleanup
					tmp = safe.lastChild;
				}
			}
		}

		// Fix #11356: Clear elements from fragment
		if ( tmp ) {
			safe.removeChild( tmp );
		}

		// Reset defaultChecked for any radios and checkboxes
		// about to be appended to the DOM in IE 6/7 (#8060)
		if ( !jQuery.support.appendChecked ) {
			jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
		}

		i = 0;
		while ( (elem = nodes[ i++ ]) ) {

			// #4087 - If origin and destination elements are the same, and this is
			// that element, do not do anything
			if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
				continue;
			}

			contains = jQuery.contains( elem.ownerDocument, elem );

			// Append to fragment
			tmp = getAll( safe.appendChild( elem ), "script" );

			// Preserve script evaluation history
			if ( contains ) {
				setGlobalEval( tmp );
			}

			// Capture executables
			if ( scripts ) {
				j = 0;
				while ( (elem = tmp[ j++ ]) ) {
					if ( rscriptType.test( elem.type || "" ) ) {
						scripts.push( elem );
					}
				}
			}
		}

		tmp = null;

		return safe;
	},

	cleanData: function( elems, /* internal */ acceptData ) {
		var elem, type, id, data,
			i = 0,
			internalKey = jQuery.expando,
			cache = jQuery.cache,
			deleteExpando = jQuery.support.deleteExpando,
			special = jQuery.event.special;

		for ( ; (elem = elems[i]) != null; i++ ) {

			if ( acceptData || jQuery.acceptData( elem ) ) {

				id = elem[ internalKey ];
				data = id && cache[ id ];

				if ( data ) {
					if ( data.events ) {
						for ( type in data.events ) {
							if ( special[ type ] ) {
								jQuery.event.remove( elem, type );

							// This is a shortcut to avoid jQuery.event.remove's overhead
							} else {
								jQuery.removeEvent( elem, type, data.handle );
							}
						}
					}

					// Remove cache only if it was not already removed by jQuery.event.remove
					if ( cache[ id ] ) {

						delete cache[ id ];

						// IE does not allow us to delete expando properties from nodes,
						// nor does it have a removeAttribute function on Document nodes;
						// we must handle all of these cases
						if ( deleteExpando ) {
							delete elem[ internalKey ];

						} else if ( typeof elem.removeAttribute !== core_strundefined ) {
							elem.removeAttribute( internalKey );

						} else {
							elem[ internalKey ] = null;
						}

						core_deletedIds.push( id );
					}
				}
			}
		}
	}
});
var iframe, getStyles, curCSS,
	ralpha = /alpha\([^)]*\)/i,
	ropacity = /opacity\s*=\s*([^)]*)/,
	rposition = /^(top|right|bottom|left)$/,
	// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
	// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
	rdisplayswap = /^(none|table(?!-c[ea]).+)/,
	rmargin = /^margin/,
	rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
	rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
	rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
	elemdisplay = { BODY: "block" },

	cssShow = { position: "absolute", visibility: "hidden", display: "block" },
	cssNormalTransform = {
		letterSpacing: 0,
		fontWeight: 400
	},

	cssExpand = [ "Top", "Right", "Bottom", "Left" ],
	cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];

// return a css property mapped to a potentially vendor prefixed property
function vendorPropName( style, name ) {

	// shortcut for names that are not vendor prefixed
	if ( name in style ) {
		return name;
	}

	// check for vendor prefixed names
	var capName = name.charAt(0).toUpperCase() + name.slice(1),
		origName = name,
		i = cssPrefixes.length;

	while ( i-- ) {
		name = cssPrefixes[ i ] + capName;
		if ( name in style ) {
			return name;
		}
	}

	return origName;
}

function isHidden( elem, el ) {
	// isHidden might be called from jQuery#filter function;
	// in that case, element will be second argument
	elem = el || elem;
	return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
}

function showHide( elements, show ) {
	var display, elem, hidden,
		values = [],
		index = 0,
		length = elements.length;

	for ( ; index < length; index++ ) {
		elem = elements[ index ];
		if ( !elem.style ) {
			continue;
		}

		values[ index ] = jQuery._data( elem, "olddisplay" );
		display = elem.style.display;
		if ( show ) {
			// Reset the inline display of this element to learn if it is
			// being hidden by cascaded rules or not
			if ( !values[ index ] && display === "none" ) {
				elem.style.display = "";
			}

			// Set elements which have been overridden with display: none
			// in a stylesheet to whatever the default browser style is
			// for such an element
			if ( elem.style.display === "" && isHidden( elem ) ) {
				values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
			}
		} else {

			if ( !values[ index ] ) {
				hidden = isHidden( elem );

				if ( display && display !== "none" || !hidden ) {
					jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
				}
			}
		}
	}

	// Set the display of most of the elements in a second loop
	// to avoid the constant reflow
	for ( index = 0; index < length; index++ ) {
		elem = elements[ index ];
		if ( !elem.style ) {
			continue;
		}
		if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
			elem.style.display = show ? values[ index ] || "" : "none";
		}
	}

	return elements;
}

jQuery.fn.extend({
	css: function( name, value ) {
		return jQuery.access( this, function( elem, name, value ) {
			var len, styles,
				map = {},
				i = 0;

			if ( jQuery.isArray( name ) ) {
				styles = getStyles( elem );
				len = name.length;

				for ( ; i < len; i++ ) {
					map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
				}

				return map;
			}

			return value !== undefined ?
				jQuery.style( elem, name, value ) :
				jQuery.css( elem, name );
		}, name, value, arguments.length > 1 );
	},
	show: function() {
		return showHide( this, true );
	},
	hide: function() {
		return showHide( this );
	},
	toggle: function( state ) {
		var bool = typeof state === "boolean";

		return this.each(function() {
			if ( bool ? state : isHidden( this ) ) {
				jQuery( this ).show();
			} else {
				jQuery( this ).hide();
			}
		});
	}
});

jQuery.extend({
	// Add in style property hooks for overriding the default
	// behavior of getting and setting a style property
	cssHooks: {
		opacity: {
			get: function( elem, computed ) {
				if ( computed ) {
					// We should always get a number back from opacity
					var ret = curCSS( elem, "opacity" );
					return ret === "" ? "1" : ret;
				}
			}
		}
	},

	// Exclude the following css properties to add px
	cssNumber: {
		"columnCount": true,
		"fillOpacity": true,
		"fontWeight": true,
		"lineHeight": true,
		"opacity": true,
		"orphans": true,
		"widows": true,
		"zIndex": true,
		"zoom": true
	},

	// Add in properties whose names you wish to fix before
	// setting or getting the value
	cssProps: {
		// normalize float css property
		"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
	},

	// Get and set the style property on a DOM Node
	style: function( elem, name, value, extra ) {
		// Don't set styles on text and comment nodes
		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
			return;
		}

		// Make sure that we're working with the right name
		var ret, type, hooks,
			origName = jQuery.camelCase( name ),
			style = elem.style;

		name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );

		// gets hook for the prefixed version
		// followed by the unprefixed version
		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];

		// Check if we're setting a value
		if ( value !== undefined ) {
			type = typeof value;

			// convert relative number strings (+= or -=) to relative numbers. #7345
			if ( type === "string" && (ret = rrelNum.exec( value )) ) {
				value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
				// Fixes bug #9237
				type = "number";
			}

			// Make sure that NaN and null values aren't set. See: #7116
			if ( value == null || type === "number" && isNaN( value ) ) {
				return;
			}

			// If a number was passed in, add 'px' to the (except for certain CSS properties)
			if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
				value += "px";
			}

			// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
			// but it would mean to define eight (for every problematic property) identical functions
			if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
				style[ name ] = "inherit";
			}

			// If a hook was provided, use that value, otherwise just set the specified value
			if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {

				// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
				// Fixes bug #5509
				try {
					style[ name ] = value;
				} catch(e) {}
			}

		} else {
			// If a hook was provided get the non-computed value from there
			if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
				return ret;
			}

			// Otherwise just get the value from the style object
			return style[ name ];
		}
	},

	css: function( elem, name, extra, styles ) {
		var num, val, hooks,
			origName = jQuery.camelCase( name );

		// Make sure that we're working with the right name
		name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );

		// gets hook for the prefixed version
		// followed by the unprefixed version
		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];

		// If a hook was provided get the computed value from there
		if ( hooks && "get" in hooks ) {
			val = hooks.get( elem, true, extra );
		}

		// Otherwise, if a way to get the computed value exists, use that
		if ( val === undefined ) {
			val = curCSS( elem, name, styles );
		}

		//convert "normal" to computed value
		if ( val === "normal" && name in cssNormalTransform ) {
			val = cssNormalTransform[ name ];
		}

		// Return, converting to number if forced or a qualifier was provided and val looks numeric
		if ( extra === "" || extra ) {
			num = parseFloat( val );
			return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
		}
		return val;
	},

	// A method for quickly swapping in/out CSS properties to get correct calculations
	swap: function( elem, options, callback, args ) {
		var ret, name,
			old = {};

		// Remember the old values, and insert the new ones
		for ( name in options ) {
			old[ name ] = elem.style[ name ];
			elem.style[ name ] = options[ name ];
		}

		ret = callback.apply( elem, args || [] );

		// Revert the old values
		for ( name in options ) {
			elem.style[ name ] = old[ name ];
		}

		return ret;
	}
});

// NOTE: we've included the "window" in window.getComputedStyle
// because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
	getStyles = function( elem ) {
		return window.getComputedStyle( elem, null );
	};

	curCSS = function( elem, name, _computed ) {
		var width, minWidth, maxWidth,
			computed = _computed || getStyles( elem ),

			// getPropertyValue is only needed for .css('filter') in IE9, see #12537
			ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
			style = elem.style;

		if ( computed ) {

			if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
				ret = jQuery.style( elem, name );
			}

			// A tribute to the "awesome hack by Dean Edwards"
			// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
			// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
			// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
			if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {

				// Remember the original values
				width = style.width;
				minWidth = style.minWidth;
				maxWidth = style.maxWidth;

				// Put in the new values to get a computed value out
				style.minWidth = style.maxWidth = style.width = ret;
				ret = computed.width;

				// Revert the changed values
				style.width = width;
				style.minWidth = minWidth;
				style.maxWidth = maxWidth;
			}
		}

		return ret;
	};
} else if ( document.documentElement.currentStyle ) {
	getStyles = function( elem ) {
		return elem.currentStyle;
	};

	curCSS = function( elem, name, _computed ) {
		var left, rs, rsLeft,
			computed = _computed || getStyles( elem ),
			ret = computed ? computed[ name ] : undefined,
			style = elem.style;

		// Avoid setting ret to empty string here
		// so we don't default to auto
		if ( ret == null && style && style[ name ] ) {
			ret = style[ name ];
		}

		// From the awesome hack by Dean Edwards
		// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291

		// If we're not dealing with a regular pixel number
		// but a number that has a weird ending, we need to convert it to pixels
		// but not position css attributes, as those are proportional to the parent element instead
		// and we can't measure the parent instead because it might trigger a "stacking dolls" problem
		if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {

			// Remember the original values
			left = style.left;
			rs = elem.runtimeStyle;
			rsLeft = rs && rs.left;

			// Put in the new values to get a computed value out
			if ( rsLeft ) {
				rs.left = elem.currentStyle.left;
			}
			style.left = name === "fontSize" ? "1em" : ret;
			ret = style.pixelLeft + "px";

			// Revert the changed values
			style.left = left;
			if ( rsLeft ) {
				rs.left = rsLeft;
			}
		}

		return ret === "" ? "auto" : ret;
	};
}

function setPositiveNumber( elem, value, subtract ) {
	var matches = rnumsplit.exec( value );
	return matches ?
		// Guard against undefined "subtract", e.g., when used as in cssHooks
		Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
		value;
}

function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
	var i = extra === ( isBorderBox ? "border" : "content" ) ?
		// If we already have the right measurement, avoid augmentation
		4 :
		// Otherwise initialize for horizontal or vertical properties
		name === "width" ? 1 : 0,

		val = 0;

	for ( ; i < 4; i += 2 ) {
		// both box models exclude margin, so add it if we want it
		if ( extra === "margin" ) {
			val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
		}

		if ( isBorderBox ) {
			// border-box includes padding, so remove it if we want content
			if ( extra === "content" ) {
				val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
			}

			// at this point, extra isn't border nor margin, so remove border
			if ( extra !== "margin" ) {
				val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
			}
		} else {
			// at this point, extra isn't content, so add padding
			val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );

			// at this point, extra isn't content nor padding, so add border
			if ( extra !== "padding" ) {
				val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
			}
		}
	}

	return val;
}

function getWidthOrHeight( elem, name, extra ) {

	// Start with offset property, which is equivalent to the border-box value
	var valueIsBorderBox = true,
		val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
		styles = getStyles( elem ),
		isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";

	// some non-html elements return undefined for offsetWidth, so check for null/undefined
	// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
	// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
	if ( val <= 0 || val == null ) {
		// Fall back to computed then uncomputed css if necessary
		val = curCSS( elem, name, styles );
		if ( val < 0 || val == null ) {
			val = elem.style[ name ];
		}

		// Computed unit is not pixels. Stop here and return.
		if ( rnumnonpx.test(val) ) {
			return val;
		}

		// we need the check for style in case a browser which returns unreliable values
		// for getComputedStyle silently falls back to the reliable elem.style
		valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );

		// Normalize "", auto, and prepare for extra
		val = parseFloat( val ) || 0;
	}

	// use the active box-sizing model to add/subtract irrelevant styles
	return ( val +
		augmentWidthOrHeight(
			elem,
			name,
			extra || ( isBorderBox ? "border" : "content" ),
			valueIsBorderBox,
			styles
		)
	) + "px";
}

// Try to determine the default display value of an element
function css_defaultDisplay( nodeName ) {
	var doc = document,
		display = elemdisplay[ nodeName ];

	if ( !display ) {
		display = actualDisplay( nodeName, doc );

		// If the simple way fails, read from inside an iframe
		if ( display === "none" || !display ) {
			// Use the already-created iframe if possible
			iframe = ( iframe ||
				jQuery("<iframe frameborder='0' width='0' height='0'/>")
				.css( "cssText", "display:block !important" )
			).appendTo( doc.documentElement );

			// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
			doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
			doc.write("<!doctype html><html><body>");
			doc.close();

			display = actualDisplay( nodeName, doc );
			iframe.detach();
		}

		// Store the correct default display
		elemdisplay[ nodeName ] = display;
	}

	return display;
}

// Called ONLY from within css_defaultDisplay
function actualDisplay( name, doc ) {
	var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
		display = jQuery.css( elem[0], "display" );
	elem.remove();
	return display;
}

jQuery.each([ "height", "width" ], function( i, name ) {
	jQuery.cssHooks[ name ] = {
		get: function( elem, computed, extra ) {
			if ( computed ) {
				// certain elements can have dimension info if we invisibly show them
				// however, it must have a current display style that would benefit from this
				return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
					jQuery.swap( elem, cssShow, function() {
						return getWidthOrHeight( elem, name, extra );
					}) :
					getWidthOrHeight( elem, name, extra );
			}
		},

		set: function( elem, value, extra ) {
			var styles = extra && getStyles( elem );
			return setPositiveNumber( elem, value, extra ?
				augmentWidthOrHeight(
					elem,
					name,
					extra,
					jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
					styles
				) : 0
			);
		}
	};
});

if ( !jQuery.support.opacity ) {
	jQuery.cssHooks.opacity = {
		get: function( elem, computed ) {
			// IE uses filters for opacity
			return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
				( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
				computed ? "1" : "";
		},

		set: function( elem, value ) {
			var style = elem.style,
				currentStyle = elem.currentStyle,
				opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
				filter = currentStyle && currentStyle.filter || style.filter || "";

			// IE has trouble with opacity if it does not have layout
			// Force it by setting the zoom level
			style.zoom = 1;

			// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
			// if value === "", then remove inline opacity #12685
			if ( ( value >= 1 || value === "" ) &&
					jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
					style.removeAttribute ) {

				// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
				// if "filter:" is present at all, clearType is disabled, we want to avoid this
				// style.removeAttribute is IE Only, but so apparently is this code path...
				style.removeAttribute( "filter" );

				// if there is no filter style applied in a css rule or unset inline opacity, we are done
				if ( value === "" || currentStyle && !currentStyle.filter ) {
					return;
				}
			}

			// otherwise, set new filter values
			style.filter = ralpha.test( filter ) ?
				filter.replace( ralpha, opacity ) :
				filter + " " + opacity;
		}
	};
}

// These hooks cannot be added until DOM ready because the support test
// for it is not run until after DOM ready
jQuery(function() {
	if ( !jQuery.support.reliableMarginRight ) {
		jQuery.cssHooks.marginRight = {
			get: function( elem, computed ) {
				if ( computed ) {
					// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
					// Work around by temporarily setting element display to inline-block
					return jQuery.swap( elem, { "display": "inline-block" },
						curCSS, [ elem, "marginRight" ] );
				}
			}
		};
	}

	// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
	// getComputedStyle returns percent when specified for top/left/bottom/right
	// rather than make the css module depend on the offset module, we just check for it here
	if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
		jQuery.each( [ "top", "left" ], function( i, prop ) {
			jQuery.cssHooks[ prop ] = {
				get: function( elem, computed ) {
					if ( computed ) {
						computed = curCSS( elem, prop );
						// if curCSS returns percentage, fallback to offset
						return rnumnonpx.test( computed ) ?
							jQuery( elem ).position()[ prop ] + "px" :
							computed;
					}
				}
			};
		});
	}

});

if ( jQuery.expr && jQuery.expr.filters ) {
	jQuery.expr.filters.hidden = function( elem ) {
		// Support: Opera <= 12.12
		// Opera reports offsetWidths and offsetHeights less than zero on some elements
		return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
			(!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
	};

	jQuery.expr.filters.visible = function( elem ) {
		return !jQuery.expr.filters.hidden( elem );
	};
}

// These hooks are used by animate to expand properties
jQuery.each({
	margin: "",
	padding: "",
	border: "Width"
}, function( prefix, suffix ) {
	jQuery.cssHooks[ prefix + suffix ] = {
		expand: function( value ) {
			var i = 0,
				expanded = {},

				// assumes a single number if not a string
				parts = typeof value === "string" ? value.split(" ") : [ value ];

			for ( ; i < 4; i++ ) {
				expanded[ prefix + cssExpand[ i ] + suffix ] =
					parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
			}

			return expanded;
		}
	};

	if ( !rmargin.test( prefix ) ) {
		jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
	}
});
var r20 = /%20/g,
	rbracket = /\[\]$/,
	rCRLF = /\r?\n/g,
	rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
	rsubmittable = /^(?:input|select|textarea|keygen)/i;

jQuery.fn.extend({
	serialize: function() {
		return jQuery.param( this.serializeArray() );
	},
	serializeArray: function() {
		return this.map(function(){
			// Can add propHook for "elements" to filter or add form elements
			var elements = jQuery.prop( this, "elements" );
			return elements ? jQuery.makeArray( elements ) : this;
		})
		.filter(function(){
			var type = this.type;
			// Use .is(":disabled") so that fieldset[disabled] works
			return this.name && !jQuery( this ).is( ":disabled" ) &&
				rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
				( this.checked || !manipulation_rcheckableType.test( type ) );
		})
		.map(function( i, elem ){
			var val = jQuery( this ).val();

			return val == null ?
				null :
				jQuery.isArray( val ) ?
					jQuery.map( val, function( val ){
						return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
					}) :
					{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
		}).get();
	}
});

//Serialize an array of form elements or a set of
//key/values into a query string
jQuery.param = function( a, traditional ) {
	var prefix,
		s = [],
		add = function( key, value ) {
			// If value is a function, invoke it and return its value
			value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
			s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
		};

	// Set traditional to true for jQuery <= 1.3.2 behavior.
	if ( traditional === undefined ) {
		traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
	}

	// If an array was passed in, assume that it is an array of form elements.
	if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
		// Serialize the form elements
		jQuery.each( a, function() {
			add( this.name, this.value );
		});

	} else {
		// If traditional, encode the "old" way (the way 1.3.2 or older
		// did it), otherwise encode params recursively.
		for ( prefix in a ) {
			buildParams( prefix, a[ prefix ], traditional, add );
		}
	}

	// Return the resulting serialization
	return s.join( "&" ).replace( r20, "+" );
};

function buildParams( prefix, obj, traditional, add ) {
	var name;

	if ( jQuery.isArray( obj ) ) {
		// Serialize array item.
		jQuery.each( obj, function( i, v ) {
			if ( traditional || rbracket.test( prefix ) ) {
				// Treat each array item as a scalar.
				add( prefix, v );

			} else {
				// Item is non-scalar (array or object), encode its numeric index.
				buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
			}
		});

	} else if ( !traditional && jQuery.type( obj ) === "object" ) {
		// Serialize object item.
		for ( name in obj ) {
			buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
		}

	} else {
		// Serialize scalar item.
		add( prefix, obj );
	}
}
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
	"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {

	// Handle event binding
	jQuery.fn[ name ] = function( data, fn ) {
		return arguments.length > 0 ?
			this.on( name, null, data, fn ) :
			this.trigger( name );
	};
});

jQuery.fn.hover = function( fnOver, fnOut ) {
	return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
};
var
	// Document location
	ajaxLocParts,
	ajaxLocation,
	ajax_nonce = jQuery.now(),

	ajax_rquery = /\?/,
	rhash = /#.*$/,
	rts = /([?&])_=[^&]*/,
	rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
	// #7653, #8125, #8152: local protocol detection
	rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
	rnoContent = /^(?:GET|HEAD)$/,
	rprotocol = /^\/\//,
	rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,

	// Keep a copy of the old load method
	_load = jQuery.fn.load,

	/* Prefilters
	 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
	 * 2) These are called:
	 *    - BEFORE asking for a transport
	 *    - AFTER param serialization (s.data is a string if s.processData is true)
	 * 3) key is the dataType
	 * 4) the catchall symbol "*" can be used
	 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
	 */
	prefilters = {},

	/* Transports bindings
	 * 1) key is the dataType
	 * 2) the catchall symbol "*" can be used
	 * 3) selection will start with transport dataType and THEN go to "*" if needed
	 */
	transports = {},

	// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
	allTypes = "*/".concat("*");

// #8138, IE may throw an exception when accessing
// a field from window.location if document.domain has been set
try {
	ajaxLocation = location.href;
} catch( e ) {
	// Use the href attribute of an A element
	// since IE will modify it given document.location
	ajaxLocation = document.createElement( "a" );
	ajaxLocation.href = "";
	ajaxLocation = ajaxLocation.href;
}

// Segment location into parts
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];

// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
function addToPrefiltersOrTransports( structure ) {

	// dataTypeExpression is optional and defaults to "*"
	return function( dataTypeExpression, func ) {

		if ( typeof dataTypeExpression !== "string" ) {
			func = dataTypeExpression;
			dataTypeExpression = "*";
		}

		var dataType,
			i = 0,
			dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];

		if ( jQuery.isFunction( func ) ) {
			// For each dataType in the dataTypeExpression
			while ( (dataType = dataTypes[i++]) ) {
				// Prepend if requested
				if ( dataType[0] === "+" ) {
					dataType = dataType.slice( 1 ) || "*";
					(structure[ dataType ] = structure[ dataType ] || []).unshift( func );

				// Otherwise append
				} else {
					(structure[ dataType ] = structure[ dataType ] || []).push( func );
				}
			}
		}
	};
}

// Base inspection function for prefilters and transports
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {

	var inspected = {},
		seekingTransport = ( structure === transports );

	function inspect( dataType ) {
		var selected;
		inspected[ dataType ] = true;
		jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
			var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
			if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
				options.dataTypes.unshift( dataTypeOrTransport );
				inspect( dataTypeOrTransport );
				return false;
			} else if ( seekingTransport ) {
				return !( selected = dataTypeOrTransport );
			}
		});
		return selected;
	}

	return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
}

// A special extend for ajax options
// that takes "flat" options (not to be deep extended)
// Fixes #9887
function ajaxExtend( target, src ) {
	var deep, key,
		flatOptions = jQuery.ajaxSettings.flatOptions || {};

	for ( key in src ) {
		if ( src[ key ] !== undefined ) {
			( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
		}
	}
	if ( deep ) {
		jQuery.extend( true, target, deep );
	}

	return target;
}

jQuery.fn.load = function( url, params, callback ) {
	if ( typeof url !== "string" && _load ) {
		return _load.apply( this, arguments );
	}

	var selector, response, type,
		self = this,
		off = url.indexOf(" ");

	if ( off >= 0 ) {
		selector = url.slice( off, url.length );
		url = url.slice( 0, off );
	}

	// If it's a function
	if ( jQuery.isFunction( params ) ) {

		// We assume that it's the callback
		callback = params;
		params = undefined;

	// Otherwise, build a param string
	} else if ( params && typeof params === "object" ) {
		type = "POST";
	}

	// If we have elements to modify, make the request
	if ( self.length > 0 ) {
		jQuery.ajax({
			url: url,

			// if "type" variable is undefined, then "GET" method will be used
			type: type,
			dataType: "html",
			data: params
		}).done(function( responseText ) {

			// Save response for use in complete callback
			response = arguments;

			self.html( selector ?

				// If a selector was specified, locate the right elements in a dummy div
				// Exclude scripts to avoid IE 'Permission Denied' errors
				jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :

				// Otherwise use the full result
				responseText );

		}).complete( callback && function( jqXHR, status ) {
			self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
		});
	}

	return this;
};

// Attach a bunch of functions for handling common AJAX events
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
	jQuery.fn[ type ] = function( fn ){
		return this.on( type, fn );
	};
});

jQuery.each( [ "get", "post" ], function( i, method ) {
	jQuery[ method ] = function( url, data, callback, type ) {
		// shift arguments if data argument was omitted
		if ( jQuery.isFunction( data ) ) {
			type = type || callback;
			callback = data;
			data = undefined;
		}

		return jQuery.ajax({
			url: url,
			type: method,
			dataType: type,
			data: data,
			success: callback
		});
	};
});

jQuery.extend({

	// Counter for holding the number of active queries
	active: 0,

	// Last-Modified header cache for next request
	lastModified: {},
	etag: {},

	ajaxSettings: {
		url: ajaxLocation,
		type: "GET",
		isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
		global: true,
		processData: true,
		async: true,
		contentType: "application/x-www-form-urlencoded; charset=UTF-8",
		/*
		timeout: 0,
		data: null,
		dataType: null,
		username: null,
		password: null,
		cache: null,
		throws: false,
		traditional: false,
		headers: {},
		*/

		accepts: {
			"*": allTypes,
			text: "text/plain",
			html: "text/html",
			xml: "application/xml, text/xml",
			json: "application/json, text/javascript"
		},

		contents: {
			xml: /xml/,
			html: /html/,
			json: /json/
		},

		responseFields: {
			xml: "responseXML",
			text: "responseText"
		},

		// Data converters
		// Keys separate source (or catchall "*") and destination types with a single space
		converters: {

			// Convert anything to text
			"* text": window.String,

			// Text to html (true = no transformation)
			"text html": true,

			// Evaluate text as a json expression
			"text json": jQuery.parseJSON,

			// Parse text as xml
			"text xml": jQuery.parseXML
		},

		// For options that shouldn't be deep extended:
		// you can add your own custom options here if
		// and when you create one that shouldn't be
		// deep extended (see ajaxExtend)
		flatOptions: {
			url: true,
			context: true
		}
	},

	// Creates a full fledged settings object into target
	// with both ajaxSettings and settings fields.
	// If target is omitted, writes into ajaxSettings.
	ajaxSetup: function( target, settings ) {
		return settings ?

			// Building a settings object
			ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :

			// Extending ajaxSettings
			ajaxExtend( jQuery.ajaxSettings, target );
	},

	ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
	ajaxTransport: addToPrefiltersOrTransports( transports ),

	// Main method
	ajax: function( url, options ) {

		// If url is an object, simulate pre-1.5 signature
		if ( typeof url === "object" ) {
			options = url;
			url = undefined;
		}

		// Force options to be an object
		options = options || {};

		var // Cross-domain detection vars
			parts,
			// Loop variable
			i,
			// URL without anti-cache param
			cacheURL,
			// Response headers as string
			responseHeadersString,
			// timeout handle
			timeoutTimer,

			// To know if global events are to be dispatched
			fireGlobals,

			transport,
			// Response headers
			responseHeaders,
			// Create the final options object
			s = jQuery.ajaxSetup( {}, options ),
			// Callbacks context
			callbackContext = s.context || s,
			// Context for global events is callbackContext if it is a DOM node or jQuery collection
			globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
				jQuery( callbackContext ) :
				jQuery.event,
			// Deferreds
			deferred = jQuery.Deferred(),
			completeDeferred = jQuery.Callbacks("once memory"),
			// Status-dependent callbacks
			statusCode = s.statusCode || {},
			// Headers (they are sent all at once)
			requestHeaders = {},
			requestHeadersNames = {},
			// The jqXHR state
			state = 0,
			// Default abort message
			strAbort = "canceled",
			// Fake xhr
			jqXHR = {
				readyState: 0,

				// Builds headers hashtable if needed
				getResponseHeader: function( key ) {
					var match;
					if ( state === 2 ) {
						if ( !responseHeaders ) {
							responseHeaders = {};
							while ( (match = rheaders.exec( responseHeadersString )) ) {
								responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
							}
						}
						match = responseHeaders[ key.toLowerCase() ];
					}
					return match == null ? null : match;
				},

				// Raw string
				getAllResponseHeaders: function() {
					return state === 2 ? responseHeadersString : null;
				},

				// Caches the header
				setRequestHeader: function( name, value ) {
					var lname = name.toLowerCase();
					if ( !state ) {
						name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
						requestHeaders[ name ] = value;
					}
					return this;
				},

				// Overrides response content-type header
				overrideMimeType: function( type ) {
					if ( !state ) {
						s.mimeType = type;
					}
					return this;
				},

				// Status-dependent callbacks
				statusCode: function( map ) {
					var code;
					if ( map ) {
						if ( state < 2 ) {
							for ( code in map ) {
								// Lazy-add the new callback in a way that preserves old ones
								statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
							}
						} else {
							// Execute the appropriate callbacks
							jqXHR.always( map[ jqXHR.status ] );
						}
					}
					return this;
				},

				// Cancel the request
				abort: function( statusText ) {
					var finalText = statusText || strAbort;
					if ( transport ) {
						transport.abort( finalText );
					}
					done( 0, finalText );
					return this;
				}
			};

		// Attach deferreds
		deferred.promise( jqXHR ).complete = completeDeferred.add;
		jqXHR.success = jqXHR.done;
		jqXHR.error = jqXHR.fail;

		// Remove hash character (#7531: and string promotion)
		// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
		// Handle falsy url in the settings object (#10093: consistency with old signature)
		// We also use the url parameter if available
		s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );

		// Alias method option to type as per ticket #12004
		s.type = options.method || options.type || s.method || s.type;

		// Extract dataTypes list
		s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];

		// A cross-domain request is in order when we have a protocol:host:port mismatch
		if ( s.crossDomain == null ) {
			parts = rurl.exec( s.url.toLowerCase() );
			s.crossDomain = !!( parts &&
				( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
					( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
						( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
			);
		}

		// Convert data if not already a string
		if ( s.data && s.processData && typeof s.data !== "string" ) {
			s.data = jQuery.param( s.data, s.traditional );
		}

		// Apply prefilters
		inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );

		// If request was aborted inside a prefilter, stop there
		if ( state === 2 ) {
			return jqXHR;
		}

		// We can fire global events as of now if asked to
		fireGlobals = s.global;

		// Watch for a new set of requests
		if ( fireGlobals && jQuery.active++ === 0 ) {
			jQuery.event.trigger("ajaxStart");
		}

		// Uppercase the type
		s.type = s.type.toUpperCase();

		// Determine if request has content
		s.hasContent = !rnoContent.test( s.type );

		// Save the URL in case we're toying with the If-Modified-Since
		// and/or If-None-Match header later on
		cacheURL = s.url;

		// More options handling for requests with no content
		if ( !s.hasContent ) {

			// If data is available, append data to url
			if ( s.data ) {
				cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
				// #9682: remove data so that it's not used in an eventual retry
				delete s.data;
			}

			// Add anti-cache in url if needed
			if ( s.cache === false ) {
				s.url = rts.test( cacheURL ) ?

					// If there is already a '_' parameter, set its value
					cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :

					// Otherwise add one to the end
					cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
			}
		}

		// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
		if ( s.ifModified ) {
			if ( jQuery.lastModified[ cacheURL ] ) {
				jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
			}
			if ( jQuery.etag[ cacheURL ] ) {
				jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
			}
		}

		// Set the correct header, if data is being sent
		if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
			jqXHR.setRequestHeader( "Content-Type", s.contentType );
		}

		// Set the Accepts header for the server, depending on the dataType
		jqXHR.setRequestHeader(
			"Accept",
			s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
				s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
				s.accepts[ "*" ]
		);

		// Check for headers option
		for ( i in s.headers ) {
			jqXHR.setRequestHeader( i, s.headers[ i ] );
		}

		// Allow custom headers/mimetypes and early abort
		if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
			// Abort if not done already and return
			return jqXHR.abort();
		}

		// aborting is no longer a cancellation
		strAbort = "abort";

		// Install callbacks on deferreds
		for ( i in { success: 1, error: 1, complete: 1 } ) {
			jqXHR[ i ]( s[ i ] );
		}

		// Get transport
		transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );

		// If no transport, we auto-abort
		if ( !transport ) {
			done( -1, "No Transport" );
		} else {
			jqXHR.readyState = 1;

			// Send global event
			if ( fireGlobals ) {
				globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
			}
			// Timeout
			if ( s.async && s.timeout > 0 ) {
				timeoutTimer = setTimeout(function() {
					jqXHR.abort("timeout");
				}, s.timeout );
			}

			try {
				state = 1;
				transport.send( requestHeaders, done );
			} catch ( e ) {
				// Propagate exception as error if not done
				if ( state < 2 ) {
					done( -1, e );
				// Simply rethrow otherwise
				} else {
					throw e;
				}
			}
		}

		// Callback for when everything is done
		function done( status, nativeStatusText, responses, headers ) {
			var isSuccess, success, error, response, modified,
				statusText = nativeStatusText;

			// Called once
			if ( state === 2 ) {
				return;
			}

			// State is "done" now
			state = 2;

			// Clear timeout if it exists
			if ( timeoutTimer ) {
				clearTimeout( timeoutTimer );
			}

			// Dereference transport for early garbage collection
			// (no matter how long the jqXHR object will be used)
			transport = undefined;

			// Cache response headers
			responseHeadersString = headers || "";

			// Set readyState
			jqXHR.readyState = status > 0 ? 4 : 0;

			// Get response data
			if ( responses ) {
				response = ajaxHandleResponses( s, jqXHR, responses );
			}

			// If successful, handle type chaining
			if ( status >= 200 && status < 300 || status === 304 ) {

				// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
				if ( s.ifModified ) {
					modified = jqXHR.getResponseHeader("Last-Modified");
					if ( modified ) {
						jQuery.lastModified[ cacheURL ] = modified;
					}
					modified = jqXHR.getResponseHeader("etag");
					if ( modified ) {
						jQuery.etag[ cacheURL ] = modified;
					}
				}

				// if no content
				if ( status === 204 ) {
					isSuccess = true;
					statusText = "nocontent";

				// if not modified
				} else if ( status === 304 ) {
					isSuccess = true;
					statusText = "notmodified";

				// If we have data, let's convert it
				} else {
					isSuccess = ajaxConvert( s, response );
					statusText = isSuccess.state;
					success = isSuccess.data;
					error = isSuccess.error;
					isSuccess = !error;
				}
			} else {
				// We extract error from statusText
				// then normalize statusText and status for non-aborts
				error = statusText;
				if ( status || !statusText ) {
					statusText = "error";
					if ( status < 0 ) {
						status = 0;
					}
				}
			}

			// Set data for the fake xhr object
			jqXHR.status = status;
			jqXHR.statusText = ( nativeStatusText || statusText ) + "";

			// Success/Error
			if ( isSuccess ) {
				deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
			} else {
				deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
			}

			// Status-dependent callbacks
			jqXHR.statusCode( statusCode );
			statusCode = undefined;

			if ( fireGlobals ) {
				globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
					[ jqXHR, s, isSuccess ? success : error ] );
			}

			// Complete
			completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );

			if ( fireGlobals ) {
				globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
				// Handle the global AJAX counter
				if ( !( --jQuery.active ) ) {
					jQuery.event.trigger("ajaxStop");
				}
			}
		}

		return jqXHR;
	},

	getScript: function( url, callback ) {
		return jQuery.get( url, undefined, callback, "script" );
	},

	getJSON: function( url, data, callback ) {
		return jQuery.get( url, data, callback, "json" );
	}
});

/* Handles responses to an ajax request:
 * - sets all responseXXX fields accordingly
 * - finds the right dataType (mediates between content-type and expected dataType)
 * - returns the corresponding response
 */
function ajaxHandleResponses( s, jqXHR, responses ) {
	var firstDataType, ct, finalDataType, type,
		contents = s.contents,
		dataTypes = s.dataTypes,
		responseFields = s.responseFields;

	// Fill responseXXX fields
	for ( type in responseFields ) {
		if ( type in responses ) {
			jqXHR[ responseFields[type] ] = responses[ type ];
		}
	}

	// Remove auto dataType and get content-type in the process
	while( dataTypes[ 0 ] === "*" ) {
		dataTypes.shift();
		if ( ct === undefined ) {
			ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
		}
	}

	// Check if we're dealing with a known content-type
	if ( ct ) {
		for ( type in contents ) {
			if ( contents[ type ] && contents[ type ].test( ct ) ) {
				dataTypes.unshift( type );
				break;
			}
		}
	}

	// Check to see if we have a response for the expected dataType
	if ( dataTypes[ 0 ] in responses ) {
		finalDataType = dataTypes[ 0 ];
	} else {
		// Try convertible dataTypes
		for ( type in responses ) {
			if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
				finalDataType = type;
				break;
			}
			if ( !firstDataType ) {
				firstDataType = type;
			}
		}
		// Or just use first one
		finalDataType = finalDataType || firstDataType;
	}

	// If we found a dataType
	// We add the dataType to the list if needed
	// and return the corresponding response
	if ( finalDataType ) {
		if ( finalDataType !== dataTypes[ 0 ] ) {
			dataTypes.unshift( finalDataType );
		}
		return responses[ finalDataType ];
	}
}

// Chain conversions given the request and the original response
function ajaxConvert( s, response ) {
	var conv2, current, conv, tmp,
		converters = {},
		i = 0,
		// Work with a copy of dataTypes in case we need to modify it for conversion
		dataTypes = s.dataTypes.slice(),
		prev = dataTypes[ 0 ];

	// Apply the dataFilter if provided
	if ( s.dataFilter ) {
		response = s.dataFilter( response, s.dataType );
	}

	// Create converters map with lowercased keys
	if ( dataTypes[ 1 ] ) {
		for ( conv in s.converters ) {
			converters[ conv.toLowerCase() ] = s.converters[ conv ];
		}
	}

	// Convert to each sequential dataType, tolerating list modification
	for ( ; (current = dataTypes[++i]); ) {

		// There's only work to do if current dataType is non-auto
		if ( current !== "*" ) {

			// Convert response if prev dataType is non-auto and differs from current
			if ( prev !== "*" && prev !== current ) {

				// Seek a direct converter
				conv = converters[ prev + " " + current ] || converters[ "* " + current ];

				// If none found, seek a pair
				if ( !conv ) {
					for ( conv2 in converters ) {

						// If conv2 outputs current
						tmp = conv2.split(" ");
						if ( tmp[ 1 ] === current ) {

							// If prev can be converted to accepted input
							conv = converters[ prev + " " + tmp[ 0 ] ] ||
								converters[ "* " + tmp[ 0 ] ];
							if ( conv ) {
								// Condense equivalence converters
								if ( conv === true ) {
									conv = converters[ conv2 ];

								// Otherwise, insert the intermediate dataType
								} else if ( converters[ conv2 ] !== true ) {
									current = tmp[ 0 ];
									dataTypes.splice( i--, 0, current );
								}

								break;
							}
						}
					}
				}

				// Apply converter (if not an equivalence)
				if ( conv !== true ) {

					// Unless errors are allowed to bubble, catch and return them
					if ( conv && s["throws"] ) {
						response = conv( response );
					} else {
						try {
							response = conv( response );
						} catch ( e ) {
							return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
						}
					}
				}
			}

			// Update prev for next iteration
			prev = current;
		}
	}

	return { state: "success", data: response };
}
// Install script dataType
jQuery.ajaxSetup({
	accepts: {
		script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
	},
	contents: {
		script: /(?:java|ecma)script/
	},
	converters: {
		"text script": function( text ) {
			jQuery.globalEval( text );
			return text;
		}
	}
});

// Handle cache's special case and global
jQuery.ajaxPrefilter( "script", function( s ) {
	if ( s.cache === undefined ) {
		s.cache = false;
	}
	if ( s.crossDomain ) {
		s.type = "GET";
		s.global = false;
	}
});

// Bind script tag hack transport
jQuery.ajaxTransport( "script", function(s) {

	// This transport only deals with cross domain requests
	if ( s.crossDomain ) {

		var script,
			head = document.head || jQuery("head")[0] || document.documentElement;

		return {

			send: function( _, callback ) {

				script = document.createElement("script");

				script.async = true;

				if ( s.scriptCharset ) {
					script.charset = s.scriptCharset;
				}

				script.src = s.url;

				// Attach handlers for all browsers
				script.onload = script.onreadystatechange = function( _, isAbort ) {

					if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {

						// Handle memory leak in IE
						script.onload = script.onreadystatechange = null;

						// Remove the script
						if ( script.parentNode ) {
							script.parentNode.removeChild( script );
						}

						// Dereference the script
						script = null;

						// Callback if not abort
						if ( !isAbort ) {
							callback( 200, "success" );
						}
					}
				};

				// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
				// Use native DOM manipulation to avoid our domManip AJAX trickery
				head.insertBefore( script, head.firstChild );
			},

			abort: function() {
				if ( script ) {
					script.onload( undefined, true );
				}
			}
		};
	}
});
var oldCallbacks = [],
	rjsonp = /(=)\?(?=&|$)|\?\?/;

// Default jsonp settings
jQuery.ajaxSetup({
	jsonp: "callback",
	jsonpCallback: function() {
		var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
		this[ callback ] = true;
		return callback;
	}
});

// Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {

	var callbackName, overwritten, responseContainer,
		jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
			"url" :
			typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
		);

	// Handle iff the expected data type is "jsonp" or we have a parameter to set
	if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {

		// Get callback name, remembering preexisting value associated with it
		callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
			s.jsonpCallback() :
			s.jsonpCallback;

		// Insert callback into url or form data
		if ( jsonProp ) {
			s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
		} else if ( s.jsonp !== false ) {
			s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
		}

		// Use data converter to retrieve json after script execution
		s.converters["script json"] = function() {
			if ( !responseContainer ) {
				jQuery.error( callbackName + " was not called" );
			}
			return responseContainer[ 0 ];
		};

		// force json dataType
		s.dataTypes[ 0 ] = "json";

		// Install callback
		overwritten = window[ callbackName ];
		window[ callbackName ] = function() {
			responseContainer = arguments;
		};

		// Clean-up function (fires after converters)
		jqXHR.always(function() {
			// Restore preexisting value
			window[ callbackName ] = overwritten;

			// Save back as free
			if ( s[ callbackName ] ) {
				// make sure that re-using the options doesn't screw things around
				s.jsonpCallback = originalSettings.jsonpCallback;

				// save the callback name for future use
				oldCallbacks.push( callbackName );
			}

			// Call if it was a function and we have a response
			if ( responseContainer && jQuery.isFunction( overwritten ) ) {
				overwritten( responseContainer[ 0 ] );
			}

			responseContainer = overwritten = undefined;
		});

		// Delegate to script
		return "script";
	}
});
var xhrCallbacks, xhrSupported,
	xhrId = 0,
	// #5280: Internet Explorer will keep connections alive if we don't abort on unload
	xhrOnUnloadAbort = window.ActiveXObject && function() {
		// Abort all pending requests
		var key;
		for ( key in xhrCallbacks ) {
			xhrCallbacks[ key ]( undefined, true );
		}
	};

// Functions to create xhrs
function createStandardXHR() {
	try {
		return new window.XMLHttpRequest();
	} catch( e ) {}
}

function createActiveXHR() {
	try {
		return new window.ActiveXObject("Microsoft.XMLHTTP");
	} catch( e ) {}
}

// Create the request object
// (This is still attached to ajaxSettings for backward compatibility)
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
	/* Microsoft failed to properly
	 * implement the XMLHttpRequest in IE7 (can't request local files),
	 * so we use the ActiveXObject when it is available
	 * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
	 * we need a fallback.
	 */
	function() {
		return !this.isLocal && createStandardXHR() || createActiveXHR();
	} :
	// For all other browsers, use the standard XMLHttpRequest object
	createStandardXHR;

// Determine support properties
xhrSupported = jQuery.ajaxSettings.xhr();
jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
xhrSupported = jQuery.support.ajax = !!xhrSupported;

// Create transport if the browser can provide an xhr
if ( xhrSupported ) {

	jQuery.ajaxTransport(function( s ) {
		// Cross domain only allowed if supported through XMLHttpRequest
		if ( !s.crossDomain || jQuery.support.cors ) {

			var callback;

			return {
				send: function( headers, complete ) {

					// Get a new xhr
					var handle, i,
						xhr = s.xhr();

					// Open the socket
					// Passing null username, generates a login popup on Opera (#2865)
					if ( s.username ) {
						xhr.open( s.type, s.url, s.async, s.username, s.password );
					} else {
						xhr.open( s.type, s.url, s.async );
					}

					// Apply custom fields if provided
					if ( s.xhrFields ) {
						for ( i in s.xhrFields ) {
							xhr[ i ] = s.xhrFields[ i ];
						}
					}

					// Override mime type if needed
					if ( s.mimeType && xhr.overrideMimeType ) {
						xhr.overrideMimeType( s.mimeType );
					}

					// X-Requested-With header
					// For cross-domain requests, seeing as conditions for a preflight are
					// akin to a jigsaw puzzle, we simply never set it to be sure.
					// (it can always be set on a per-request basis or even using ajaxSetup)
					// For same-domain requests, won't change header if already provided.
					if ( !s.crossDomain && !headers["X-Requested-With"] ) {
						headers["X-Requested-With"] = "XMLHttpRequest";
					}

					// Need an extra try/catch for cross domain requests in Firefox 3
					try {
						for ( i in headers ) {
							xhr.setRequestHeader( i, headers[ i ] );
						}
					} catch( err ) {}

					// Do send the request
					// This may raise an exception which is actually
					// handled in jQuery.ajax (so no try/catch here)
					xhr.send( ( s.hasContent && s.data ) || null );

					// Listener
					callback = function( _, isAbort ) {
						var status, responseHeaders, statusText, responses;

						// Firefox throws exceptions when accessing properties
						// of an xhr when a network error occurred
						// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
						try {

							// Was never called and is aborted or complete
							if ( callback && ( isAbort || xhr.readyState === 4 ) ) {

								// Only called once
								callback = undefined;

								// Do not keep as active anymore
								if ( handle ) {
									xhr.onreadystatechange = jQuery.noop;
									if ( xhrOnUnloadAbort ) {
										delete xhrCallbacks[ handle ];
									}
								}

								// If it's an abort
								if ( isAbort ) {
									// Abort it manually if needed
									if ( xhr.readyState !== 4 ) {
										xhr.abort();
									}
								} else {
									responses = {};
									status = xhr.status;
									responseHeaders = xhr.getAllResponseHeaders();

									// When requesting binary data, IE6-9 will throw an exception
									// on any attempt to access responseText (#11426)
									if ( typeof xhr.responseText === "string" ) {
										responses.text = xhr.responseText;
									}

									// Firefox throws an exception when accessing
									// statusText for faulty cross-domain requests
									try {
										statusText = xhr.statusText;
									} catch( e ) {
										// We normalize with Webkit giving an empty statusText
										statusText = "";
									}

									// Filter status for non standard behaviors

									// If the request is local and we have data: assume a success
									// (success with no data won't get notified, that's the best we
									// can do given current implementations)
									if ( !status && s.isLocal && !s.crossDomain ) {
										status = responses.text ? 200 : 404;
									// IE - #1450: sometimes returns 1223 when it should be 204
									} else if ( status === 1223 ) {
										status = 204;
									}
								}
							}
						} catch( firefoxAccessException ) {
							if ( !isAbort ) {
								complete( -1, firefoxAccessException );
							}
						}

						// Call complete if needed
						if ( responses ) {
							complete( status, statusText, responses, responseHeaders );
						}
					};

					if ( !s.async ) {
						// if we're in sync mode we fire the callback
						callback();
					} else if ( xhr.readyState === 4 ) {
						// (IE6 & IE7) if it's in cache and has been
						// retrieved directly we need to fire the callback
						setTimeout( callback );
					} else {
						handle = ++xhrId;
						if ( xhrOnUnloadAbort ) {
							// Create the active xhrs callbacks list if needed
							// and attach the unload handler
							if ( !xhrCallbacks ) {
								xhrCallbacks = {};
								jQuery( window ).unload( xhrOnUnloadAbort );
							}
							// Add to list of active xhrs callbacks
							xhrCallbacks[ handle ] = callback;
						}
						xhr.onreadystatechange = callback;
					}
				},

				abort: function() {
					if ( callback ) {
						callback( undefined, true );
					}
				}
			};
		}
	});
}
var fxNow, timerId,
	rfxtypes = /^(?:toggle|show|hide)$/,
	rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
	rrun = /queueHooks$/,
	animationPrefilters = [ defaultPrefilter ],
	tweeners = {
		"*": [function( prop, value ) {
			var end, unit,
				tween = this.createTween( prop, value ),
				parts = rfxnum.exec( value ),
				target = tween.cur(),
				start = +target || 0,
				scale = 1,
				maxIterations = 20;

			if ( parts ) {
				end = +parts[2];
				unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );

				// We need to compute starting value
				if ( unit !== "px" && start ) {
					// Iteratively approximate from a nonzero starting point
					// Prefer the current property, because this process will be trivial if it uses the same units
					// Fallback to end or a simple constant
					start = jQuery.css( tween.elem, prop, true ) || end || 1;

					do {
						// If previous iteration zeroed out, double until we get *something*
						// Use a string for doubling factor so we don't accidentally see scale as unchanged below
						scale = scale || ".5";

						// Adjust and apply
						start = start / scale;
						jQuery.style( tween.elem, prop, start + unit );

					// Update scale, tolerating zero or NaN from tween.cur()
					// And breaking the loop if scale is unchanged or perfect, or if we've just had enough
					} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
				}

				tween.unit = unit;
				tween.start = start;
				// If a +=/-= token was provided, we're doing a relative animation
				tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
			}
			return tween;
		}]
	};

// Animations created synchronously will run synchronously
function createFxNow() {
	setTimeout(function() {
		fxNow = undefined;
	});
	return ( fxNow = jQuery.now() );
}

function createTweens( animation, props ) {
	jQuery.each( props, function( prop, value ) {
		var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
			index = 0,
			length = collection.length;
		for ( ; index < length; index++ ) {
			if ( collection[ index ].call( animation, prop, value ) ) {

				// we're done with this property
				return;
			}
		}
	});
}

function Animation( elem, properties, options ) {
	var result,
		stopped,
		index = 0,
		length = animationPrefilters.length,
		deferred = jQuery.Deferred().always( function() {
			// don't match elem in the :animated selector
			delete tick.elem;
		}),
		tick = function() {
			if ( stopped ) {
				return false;
			}
			var currentTime = fxNow || createFxNow(),
				remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
				// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
				temp = remaining / animation.duration || 0,
				percent = 1 - temp,
				index = 0,
				length = animation.tweens.length;

			for ( ; index < length ; index++ ) {
				animation.tweens[ index ].run( percent );
			}

			deferred.notifyWith( elem, [ animation, percent, remaining ]);

			if ( percent < 1 && length ) {
				return remaining;
			} else {
				deferred.resolveWith( elem, [ animation ] );
				return false;
			}
		},
		animation = deferred.promise({
			elem: elem,
			props: jQuery.extend( {}, properties ),
			opts: jQuery.extend( true, { specialEasing: {} }, options ),
			originalProperties: properties,
			originalOptions: options,
			startTime: fxNow || createFxNow(),
			duration: options.duration,
			tweens: [],
			createTween: function( prop, end ) {
				var tween = jQuery.Tween( elem, animation.opts, prop, end,
						animation.opts.specialEasing[ prop ] || animation.opts.easing );
				animation.tweens.push( tween );
				return tween;
			},
			stop: function( gotoEnd ) {
				var index = 0,
					// if we are going to the end, we want to run all the tweens
					// otherwise we skip this part
					length = gotoEnd ? animation.tweens.length : 0;
				if ( stopped ) {
					return this;
				}
				stopped = true;
				for ( ; index < length ; index++ ) {
					animation.tweens[ index ].run( 1 );
				}

				// resolve when we played the last frame
				// otherwise, reject
				if ( gotoEnd ) {
					deferred.resolveWith( elem, [ animation, gotoEnd ] );
				} else {
					deferred.rejectWith( elem, [ animation, gotoEnd ] );
				}
				return this;
			}
		}),
		props = animation.props;

	propFilter( props, animation.opts.specialEasing );

	for ( ; index < length ; index++ ) {
		result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
		if ( result ) {
			return result;
		}
	}

	createTweens( animation, props );

	if ( jQuery.isFunction( animation.opts.start ) ) {
		animation.opts.start.call( elem, animation );
	}

	jQuery.fx.timer(
		jQuery.extend( tick, {
			elem: elem,
			anim: animation,
			queue: animation.opts.queue
		})
	);

	// attach callbacks from options
	return animation.progress( animation.opts.progress )
		.done( animation.opts.done, animation.opts.complete )
		.fail( animation.opts.fail )
		.always( animation.opts.always );
}

function propFilter( props, specialEasing ) {
	var value, name, index, easing, hooks;

	// camelCase, specialEasing and expand cssHook pass
	for ( index in props ) {
		name = jQuery.camelCase( index );
		easing = specialEasing[ name ];
		value = props[ index ];
		if ( jQuery.isArray( value ) ) {
			easing = value[ 1 ];
			value = props[ index ] = value[ 0 ];
		}

		if ( index !== name ) {
			props[ name ] = value;
			delete props[ index ];
		}

		hooks = jQuery.cssHooks[ name ];
		if ( hooks && "expand" in hooks ) {
			value = hooks.expand( value );
			delete props[ name ];

			// not quite $.extend, this wont overwrite keys already present.
			// also - reusing 'index' from above because we have the correct "name"
			for ( index in value ) {
				if ( !( index in props ) ) {
					props[ index ] = value[ index ];
					specialEasing[ index ] = easing;
				}
			}
		} else {
			specialEasing[ name ] = easing;
		}
	}
}

jQuery.Animation = jQuery.extend( Animation, {

	tweener: function( props, callback ) {
		if ( jQuery.isFunction( props ) ) {
			callback = props;
			props = [ "*" ];
		} else {
			props = props.split(" ");
		}

		var prop,
			index = 0,
			length = props.length;

		for ( ; index < length ; index++ ) {
			prop = props[ index ];
			tweeners[ prop ] = tweeners[ prop ] || [];
			tweeners[ prop ].unshift( callback );
		}
	},

	prefilter: function( callback, prepend ) {
		if ( prepend ) {
			animationPrefilters.unshift( callback );
		} else {
			animationPrefilters.push( callback );
		}
	}
});

function defaultPrefilter( elem, props, opts ) {
	/*jshint validthis:true */
	var prop, index, length,
		value, dataShow, toggle,
		tween, hooks, oldfire,
		anim = this,
		style = elem.style,
		orig = {},
		handled = [],
		hidden = elem.nodeType && isHidden( elem );

	// handle queue: false promises
	if ( !opts.queue ) {
		hooks = jQuery._queueHooks( elem, "fx" );
		if ( hooks.unqueued == null ) {
			hooks.unqueued = 0;
			oldfire = hooks.empty.fire;
			hooks.empty.fire = function() {
				if ( !hooks.unqueued ) {
					oldfire();
				}
			};
		}
		hooks.unqueued++;

		anim.always(function() {
			// doing this makes sure that the complete handler will be called
			// before this completes
			anim.always(function() {
				hooks.unqueued--;
				if ( !jQuery.queue( elem, "fx" ).length ) {
					hooks.empty.fire();
				}
			});
		});
	}

	// height/width overflow pass
	if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
		// Make sure that nothing sneaks out
		// Record all 3 overflow attributes because IE does not
		// change the overflow attribute when overflowX and
		// overflowY are set to the same value
		opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];

		// Set display property to inline-block for height/width
		// animations on inline elements that are having width/height animated
		if ( jQuery.css( elem, "display" ) === "inline" &&
				jQuery.css( elem, "float" ) === "none" ) {

			// inline-level elements accept inline-block;
			// block-level elements need to be inline with layout
			if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
				style.display = "inline-block";

			} else {
				style.zoom = 1;
			}
		}
	}

	if ( opts.overflow ) {
		style.overflow = "hidden";
		if ( !jQuery.support.shrinkWrapBlocks ) {
			anim.always(function() {
				style.overflow = opts.overflow[ 0 ];
				style.overflowX = opts.overflow[ 1 ];
				style.overflowY = opts.overflow[ 2 ];
			});
		}
	}


	// show/hide pass
	for ( index in props ) {
		value = props[ index ];
		if ( rfxtypes.exec( value ) ) {
			delete props[ index ];
			toggle = toggle || value === "toggle";
			if ( value === ( hidden ? "hide" : "show" ) ) {
				continue;
			}
			handled.push( index );
		}
	}

	length = handled.length;
	if ( length ) {
		dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
		if ( "hidden" in dataShow ) {
			hidden = dataShow.hidden;
		}

		// store state if its toggle - enables .stop().toggle() to "reverse"
		if ( toggle ) {
			dataShow.hidden = !hidden;
		}
		if ( hidden ) {
			jQuery( elem ).show();
		} else {
			anim.done(function() {
				jQuery( elem ).hide();
			});
		}
		anim.done(function() {
			var prop;
			jQuery._removeData( elem, "fxshow" );
			for ( prop in orig ) {
				jQuery.style( elem, prop, orig[ prop ] );
			}
		});
		for ( index = 0 ; index < length ; index++ ) {
			prop = handled[ index ];
			tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
			orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );

			if ( !( prop in dataShow ) ) {
				dataShow[ prop ] = tween.start;
				if ( hidden ) {
					tween.end = tween.start;
					tween.start = prop === "width" || prop === "height" ? 1 : 0;
				}
			}
		}
	}
}

function Tween( elem, options, prop, end, easing ) {
	return new Tween.prototype.init( elem, options, prop, end, easing );
}
jQuery.Tween = Tween;

Tween.prototype = {
	constructor: Tween,
	init: function( elem, options, prop, end, easing, unit ) {
		this.elem = elem;
		this.prop = prop;
		this.easing = easing || "swing";
		this.options = options;
		this.start = this.now = this.cur();
		this.end = end;
		this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
	},
	cur: function() {
		var hooks = Tween.propHooks[ this.prop ];

		return hooks && hooks.get ?
			hooks.get( this ) :
			Tween.propHooks._default.get( this );
	},
	run: function( percent ) {
		var eased,
			hooks = Tween.propHooks[ this.prop ];

		if ( this.options.duration ) {
			this.pos = eased = jQuery.easing[ this.easing ](
				percent, this.options.duration * percent, 0, 1, this.options.duration
			);
		} else {
			this.pos = eased = percent;
		}
		this.now = ( this.end - this.start ) * eased + this.start;

		if ( this.options.step ) {
			this.options.step.call( this.elem, this.now, this );
		}

		if ( hooks && hooks.set ) {
			hooks.set( this );
		} else {
			Tween.propHooks._default.set( this );
		}
		return this;
	}
};

Tween.prototype.init.prototype = Tween.prototype;

Tween.propHooks = {
	_default: {
		get: function( tween ) {
			var result;

			if ( tween.elem[ tween.prop ] != null &&
				(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
				return tween.elem[ tween.prop ];
			}

			// passing an empty string as a 3rd parameter to .css will automatically
			// attempt a parseFloat and fallback to a string if the parse fails
			// so, simple values such as "10px" are parsed to Float.
			// complex values such as "rotate(1rad)" are returned as is.
			result = jQuery.css( tween.elem, tween.prop, "" );
			// Empty strings, null, undefined and "auto" are converted to 0.
			return !result || result === "auto" ? 0 : result;
		},
		set: function( tween ) {
			// use step hook for back compat - use cssHook if its there - use .style if its
			// available and use plain properties where available
			if ( jQuery.fx.step[ tween.prop ] ) {
				jQuery.fx.step[ tween.prop ]( tween );
			} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
				jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
			} else {
				tween.elem[ tween.prop ] = tween.now;
			}
		}
	}
};

// Remove in 2.0 - this supports IE8's panic based approach
// to setting things on disconnected nodes

Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
	set: function( tween ) {
		if ( tween.elem.nodeType && tween.elem.parentNode ) {
			tween.elem[ tween.prop ] = tween.now;
		}
	}
};

jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
	var cssFn = jQuery.fn[ name ];
	jQuery.fn[ name ] = function( speed, easing, callback ) {
		return speed == null || typeof speed === "boolean" ?
			cssFn.apply( this, arguments ) :
			this.animate( genFx( name, true ), speed, easing, callback );
	};
});

jQuery.fn.extend({
	fadeTo: function( speed, to, easing, callback ) {

		// show any hidden elements after setting opacity to 0
		return this.filter( isHidden ).css( "opacity", 0 ).show()

			// animate to the value specified
			.end().animate({ opacity: to }, speed, easing, callback );
	},
	animate: function( prop, speed, easing, callback ) {
		var empty = jQuery.isEmptyObject( prop ),
			optall = jQuery.speed( speed, easing, callback ),
			doAnimation = function() {
				// Operate on a copy of prop so per-property easing won't be lost
				var anim = Animation( this, jQuery.extend( {}, prop ), optall );
				doAnimation.finish = function() {
					anim.stop( true );
				};
				// Empty animations, or finishing resolves immediately
				if ( empty || jQuery._data( this, "finish" ) ) {
					anim.stop( true );
				}
			};
			doAnimation.finish = doAnimation;

		return empty || optall.queue === false ?
			this.each( doAnimation ) :
			this.queue( optall.queue, doAnimation );
	},
	stop: function( type, clearQueue, gotoEnd ) {
		var stopQueue = function( hooks ) {
			var stop = hooks.stop;
			delete hooks.stop;
			stop( gotoEnd );
		};

		if ( typeof type !== "string" ) {
			gotoEnd = clearQueue;
			clearQueue = type;
			type = undefined;
		}
		if ( clearQueue && type !== false ) {
			this.queue( type || "fx", [] );
		}

		return this.each(function() {
			var dequeue = true,
				index = type != null && type + "queueHooks",
				timers = jQuery.timers,
				data = jQuery._data( this );

			if ( index ) {
				if ( data[ index ] && data[ index ].stop ) {
					stopQueue( data[ index ] );
				}
			} else {
				for ( index in data ) {
					if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
						stopQueue( data[ index ] );
					}
				}
			}

			for ( index = timers.length; index--; ) {
				if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
					timers[ index ].anim.stop( gotoEnd );
					dequeue = false;
					timers.splice( index, 1 );
				}
			}

			// start the next in the queue if the last step wasn't forced
			// timers currently will call their complete callbacks, which will dequeue
			// but only if they were gotoEnd
			if ( dequeue || !gotoEnd ) {
				jQuery.dequeue( this, type );
			}
		});
	},
	finish: function( type ) {
		if ( type !== false ) {
			type = type || "fx";
		}
		return this.each(function() {
			var index,
				data = jQuery._data( this ),
				queue = data[ type + "queue" ],
				hooks = data[ type + "queueHooks" ],
				timers = jQuery.timers,
				length = queue ? queue.length : 0;

			// enable finishing flag on private data
			data.finish = true;

			// empty the queue first
			jQuery.queue( this, type, [] );

			if ( hooks && hooks.cur && hooks.cur.finish ) {
				hooks.cur.finish.call( this );
			}

			// look for any active animations, and finish them
			for ( index = timers.length; index--; ) {
				if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
					timers[ index ].anim.stop( true );
					timers.splice( index, 1 );
				}
			}

			// look for any animations in the old queue and finish them
			for ( index = 0; index < length; index++ ) {
				if ( queue[ index ] && queue[ index ].finish ) {
					queue[ index ].finish.call( this );
				}
			}

			// turn off finishing flag
			delete data.finish;
		});
	}
});

// Generate parameters to create a standard animation
function genFx( type, includeWidth ) {
	var which,
		attrs = { height: type },
		i = 0;

	// if we include width, step value is 1 to do all cssExpand values,
	// if we don't include width, step value is 2 to skip over Left and Right
	includeWidth = includeWidth? 1 : 0;
	for( ; i < 4 ; i += 2 - includeWidth ) {
		which = cssExpand[ i ];
		attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
	}

	if ( includeWidth ) {
		attrs.opacity = attrs.width = type;
	}

	return attrs;
}

// Generate shortcuts for custom animations
jQuery.each({
	slideDown: genFx("show"),
	slideUp: genFx("hide"),
	slideToggle: genFx("toggle"),
	fadeIn: { opacity: "show" },
	fadeOut: { opacity: "hide" },
	fadeToggle: { opacity: "toggle" }
}, function( name, props ) {
	jQuery.fn[ name ] = function( speed, easing, callback ) {
		return this.animate( props, speed, easing, callback );
	};
});

jQuery.speed = function( speed, easing, fn ) {
	var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
		complete: fn || !fn && easing ||
			jQuery.isFunction( speed ) && speed,
		duration: speed,
		easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
	};

	opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
		opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;

	// normalize opt.queue - true/undefined/null -> "fx"
	if ( opt.queue == null || opt.queue === true ) {
		opt.queue = "fx";
	}

	// Queueing
	opt.old = opt.complete;

	opt.complete = function() {
		if ( jQuery.isFunction( opt.old ) ) {
			opt.old.call( this );
		}

		if ( opt.queue ) {
			jQuery.dequeue( this, opt.queue );
		}
	};

	return opt;
};

jQuery.easing = {
	linear: function( p ) {
		return p;
	},
	swing: function( p ) {
		return 0.5 - Math.cos( p*Math.PI ) / 2;
	}
};

jQuery.timers = [];
jQuery.fx = Tween.prototype.init;
jQuery.fx.tick = function() {
	var timer,
		timers = jQuery.timers,
		i = 0;

	fxNow = jQuery.now();

	for ( ; i < timers.length; i++ ) {
		timer = timers[ i ];
		// Checks the timer has not already been removed
		if ( !timer() && timers[ i ] === timer ) {
			timers.splice( i--, 1 );
		}
	}

	if ( !timers.length ) {
		jQuery.fx.stop();
	}
	fxNow = undefined;
};

jQuery.fx.timer = function( timer ) {
	if ( timer() && jQuery.timers.push( timer ) ) {
		jQuery.fx.start();
	}
};

jQuery.fx.interval = 13;

jQuery.fx.start = function() {
	if ( !timerId ) {
		timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
	}
};

jQuery.fx.stop = function() {
	clearInterval( timerId );
	timerId = null;
};

jQuery.fx.speeds = {
	slow: 600,
	fast: 200,
	// Default speed
	_default: 400
};

// Back Compat <1.8 extension point
jQuery.fx.step = {};

if ( jQuery.expr && jQuery.expr.filters ) {
	jQuery.expr.filters.animated = function( elem ) {
		return jQuery.grep(jQuery.timers, function( fn ) {
			return elem === fn.elem;
		}).length;
	};
}
jQuery.fn.offset = function( options ) {
	if ( arguments.length ) {
		return options === undefined ?
			this :
			this.each(function( i ) {
				jQuery.offset.setOffset( this, options, i );
			});
	}

	var docElem, win,
		box = { top: 0, left: 0 },
		elem = this[ 0 ],
		doc = elem && elem.ownerDocument;

	if ( !doc ) {
		return;
	}

	docElem = doc.documentElement;

	// Make sure it's not a disconnected DOM node
	if ( !jQuery.contains( docElem, elem ) ) {
		return box;
	}

	// If we don't have gBCR, just use 0,0 rather than error
	// BlackBerry 5, iOS 3 (original iPhone)
	if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
		box = elem.getBoundingClientRect();
	}
	win = getWindow( doc );
	return {
		top: box.top  + ( win.pageYOffset || docElem.scrollTop )  - ( docElem.clientTop  || 0 ),
		left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
	};
};

jQuery.offset = {

	setOffset: function( elem, options, i ) {
		var position = jQuery.css( elem, "position" );

		// set position first, in-case top/left are set even on static elem
		if ( position === "static" ) {
			elem.style.position = "relative";
		}

		var curElem = jQuery( elem ),
			curOffset = curElem.offset(),
			curCSSTop = jQuery.css( elem, "top" ),
			curCSSLeft = jQuery.css( elem, "left" ),
			calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
			props = {}, curPosition = {}, curTop, curLeft;

		// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
		if ( calculatePosition ) {
			curPosition = curElem.position();
			curTop = curPosition.top;
			curLeft = curPosition.left;
		} else {
			curTop = parseFloat( curCSSTop ) || 0;
			curLeft = parseFloat( curCSSLeft ) || 0;
		}

		if ( jQuery.isFunction( options ) ) {
			options = options.call( elem, i, curOffset );
		}

		if ( options.top != null ) {
			props.top = ( options.top - curOffset.top ) + curTop;
		}
		if ( options.left != null ) {
			props.left = ( options.left - curOffset.left ) + curLeft;
		}

		if ( "using" in options ) {
			options.using.call( elem, props );
		} else {
			curElem.css( props );
		}
	}
};


jQuery.fn.extend({

	position: function() {
		if ( !this[ 0 ] ) {
			return;
		}

		var offsetParent, offset,
			parentOffset = { top: 0, left: 0 },
			elem = this[ 0 ];

		// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
		if ( jQuery.css( elem, "position" ) === "fixed" ) {
			// we assume that getBoundingClientRect is available when computed position is fixed
			offset = elem.getBoundingClientRect();
		} else {
			// Get *real* offsetParent
			offsetParent = this.offsetParent();

			// Get correct offsets
			offset = this.offset();
			if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
				parentOffset = offsetParent.offset();
			}

			// Add offsetParent borders
			parentOffset.top  += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
			parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
		}

		// Subtract parent offsets and element margins
		// note: when an element has margin: auto the offsetLeft and marginLeft
		// are the same in Safari causing offset.left to incorrectly be 0
		return {
			top:  offset.top  - parentOffset.top - jQuery.css( elem, "marginTop", true ),
			left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
		};
	},

	offsetParent: function() {
		return this.map(function() {
			var offsetParent = this.offsetParent || document.documentElement;
			while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
				offsetParent = offsetParent.offsetParent;
			}
			return offsetParent || document.documentElement;
		});
	}
});


// Create scrollLeft and scrollTop methods
jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
	var top = /Y/.test( prop );

	jQuery.fn[ method ] = function( val ) {
		return jQuery.access( this, function( elem, method, val ) {
			var win = getWindow( elem );

			if ( val === undefined ) {
				return win ? (prop in win) ? win[ prop ] :
					win.document.documentElement[ method ] :
					elem[ method ];
			}

			if ( win ) {
				win.scrollTo(
					!top ? val : jQuery( win ).scrollLeft(),
					top ? val : jQuery( win ).scrollTop()
				);

			} else {
				elem[ method ] = val;
			}
		}, method, val, arguments.length, null );
	};
});

function getWindow( elem ) {
	return jQuery.isWindow( elem ) ?
		elem :
		elem.nodeType === 9 ?
			elem.defaultView || elem.parentWindow :
			false;
}
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
	jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
		// margin is only for outerHeight, outerWidth
		jQuery.fn[ funcName ] = function( margin, value ) {
			var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
				extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );

			return jQuery.access( this, function( elem, type, value ) {
				var doc;

				if ( jQuery.isWindow( elem ) ) {
					// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
					// isn't a whole lot we can do. See pull request at this URL for discussion:
					// https://github.com/jquery/jquery/pull/764
					return elem.document.documentElement[ "client" + name ];
				}

				// Get document width or height
				if ( elem.nodeType === 9 ) {
					doc = elem.documentElement;

					// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
					// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
					return Math.max(
						elem.body[ "scroll" + name ], doc[ "scroll" + name ],
						elem.body[ "offset" + name ], doc[ "offset" + name ],
						doc[ "client" + name ]
					);
				}

				return value === undefined ?
					// Get width or height on the element, requesting but not forcing parseFloat
					jQuery.css( elem, type, extra ) :

					// Set width or height on the element
					jQuery.style( elem, type, value, extra );
			}, type, chainable ? margin : undefined, chainable, null );
		};
	});
});
// Limit scope pollution from any deprecated API
// (function() {

// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;

// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
// in a page that all might call define(). The loader will indicate
// they have special allowances for multiple jQuery versions by
// specifying define.amd.jQuery = true. Register as a named module,
// since jQuery can be concatenated with other files that may use define,
// but not use a proper concatenation script that understands anonymous
// AMD modules. A named AMD is safest and most robust way to register.
// Lowercase jquery is used because AMD module names are derived from
// file names, and jQuery is normally delivered in a lowercase file name.
// Do this after creating the global so that if an AMD module wants to call
// noConflict to hide this version of jQuery, it will work.
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
	define( "jquery", [], function () { return jQuery; } );
}

})( window );
;
//*!
// * jQuery toDictionary() plugin
// *
// * Version 1.2 (11 Apr 2011)
// *
// * Copyright (c) 2011 Robert Koritnik
// * Licensed under the terms of the MIT license
// * http://www.opensource.org/licenses/mit-license.php
// */
 
(function ($) {
 
    // #region String.prototype.format
    // add String prototype format function if it doesn't yet exist
    if ($.isFunction(String.prototype.format) === false)
    {
        String.prototype.format = function () {
            var s = this;
            var i = arguments.length;
            while (i--)
            {
                s = s.replace(new RegExp("\\{" + i + "\\}", "gim"), arguments[i]);
            }
            return s;
        };
    }
    // #endregion
 
    // #region Date.prototype.toISOString
    // add Date prototype toISOString function if it doesn't yet exist
    if ($.isFunction(Date.prototype.toISOString) === false)
    {
        Date.prototype.toISOString = function () {
            var pad = function (n, places) {
                n = n.toString();
                for (var i = n.length; i < places; i++)
                {
                    n = "0" + n;
                }
                return n;
            };
            var d = this;
            return "{0}-{1}-{2}T{3}:{4}:{5}.{6}Z".format(
                d.getUTCFullYear(),
                pad(d.getUTCMonth() + 1, 2),
                pad(d.getUTCDate(), 2),
                pad(d.getUTCHours(), 2),
                pad(d.getUTCMinutes(), 2),
                pad(d.getUTCSeconds(), 2),
                pad(d.getUTCMilliseconds(), 3)
            );
        };
    }
    // #endregion
 
    var _flatten = function (input, output, prefix, includeNulls) {
        if ($.isPlainObject(input))
        {
            for (var p in input)
            {
                if (includeNulls === true || typeof (input[p]) !== "undefined" && input[p] !== null)
                {
                    _flatten(input[p], output, prefix.length > 0 ? prefix + "." + p : p, includeNulls);
                }
            }
        }
        else
        {
            if ($.isArray(input))
            {
                $.each(input, function (index, value) {
                    _flatten(value, output, "{0}[{1}]".format(prefix, index));
                });
                return;
            }
            if (!$.isFunction(input))
            {
                if (input instanceof Date)
                {
                    output.push({ name: prefix, value: input.toISOString() });
                }
                else
                {
                    var val = typeof (input);
                    switch (val)
                    {
                        case "boolean":
                        case "number":
                            val = input;
                            break;
                        case "object":
                            // this property is null, because non-null objects are evaluated in first if branch
                            if (includeNulls !== true)
                            {
                                return;
                            }
                        default:
                            val = input || "";
                    }
                    output.push({ name: prefix, value: val });
                }
            }
        }
    };
 
    $.extend({
        toViewModel: function (data, prefix, includeNulls) {
            /// <summary>Flattens an arbitrary JSON object to a dictionary that Asp.net MVC default model binder understands.</summary>
            /// <param name="data" type="Object">Can either be a JSON object or a function that returns one.</data>
            /// <param name="prefix" type="String" Optional="true">Provide this parameter when you want the output names to be prefixed by something (ie. when flattening simple values).</param>
            /// <param name="includeNulls" type="Boolean" Optional="true">Set this to 'true' when you want null valued properties to be included in result (default is 'false').</param>
 
            // get data first if provided parameter is a function
            data = $.isFunction(data) ? data.call() : data;
 
            // is second argument "prefix" or "includeNulls"
            if (arguments.length === 2 && typeof (prefix) === "boolean")
            {
                includeNulls = prefix;
                prefix = "";
            }
 
            // set "includeNulls" default
            includeNulls = typeof (includeNulls) === "boolean" ? includeNulls : false;
 
            var result = [];
            _flatten(data, result, prefix || "", includeNulls);
 
            return result;
        }
    });
})(jQuery);;
/*! jQuery UI - v1.11.3 - 2015-02-19
* http://jqueryui.com
* Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, resizable.js, selectable.js, sortable.js, accordion.js, autocomplete.js, menu.js, effect.js, effect-highlight.js, effect-slide.js
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */

(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var s=0,n=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,a=n.call(arguments,1),o=0,r=a.length;r>o;o++)for(i in a[o])s=a[o][i],a[o].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(a){var o="string"==typeof a,r=n.call(arguments,1),h=this;return o?this.each(function(){var i,n=e.data(this,s);return"instance"===a?(h=n,!1):n?e.isFunction(n[a])&&"_"!==a.charAt(0)?(i=n[a].apply(n,r),i!==n&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+a+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+a+"'")}):(r.length&&(a=e.widget.extend.apply(null,[a].concat(r))),this.each(function(){var t=e.data(this,s);t?(t.option(a||{}),t._init&&t._init()):e.data(this,s,new i(a,this))})),h}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var a=!1;e(document).mouseup(function(){a=!1}),e.widget("ui.mouse",{version:"1.11.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!a){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),a=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),a=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,N=e.extend({},y),M=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?N.left-=d:"center"===n.my[0]&&(N.left-=d/2),"bottom"===n.my[1]?N.top-=c:"center"===n.my[1]&&(N.top-=c/2),N.left+=M[0],N.top+=M[1],a||(N.left=h(N.left),N.top=h(N.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](N,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+M[0],p[1]+M[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-N.left,i=t+m-d,s=v.top-N.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:N.left,top:N.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(N,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.3",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n
})),n?(a.isOver||(a.isOver=1,a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.droppable",{version:"1.11.3",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=this.element.children(this.handles[i]).first().show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,n=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(t,s){e(t).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):e.each(n.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=l-t.width,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.selectable",e.ui.mouse,{version:"1.11.3",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;
i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.11.3",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===e.axis||this._isFloating(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s],this.document[0]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i],this.document[0]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?t.currentItem.children().each(function(){e("<td>&#160;</td>",t.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.accordion",{version:"1.11.3",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))
},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},u=h&&l.down||l,d=function(){o._toggleComplete(i)};return"number"==typeof u&&(a=u),"string"==typeof u&&(n=u),n=n||u.easing||l.easing,a=a||u.duration||l.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:d,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?r+=i.now:"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,d):e.animate(this.showProps,a,n,d)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.3",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget);i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.3",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var o="ui-effects-",r=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(r),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(r.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.3",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(o+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(o+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()
}})},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})}});;
/* NUGET: BEGIN LICENSE TEXT
 *
 * Microsoft grants you the right to use these script files for the sole
 * purpose of either: (i) interacting through your browser with the Microsoft
 * website or online service, subject to the applicable licensing or use
 * terms; or (ii) using the files as included with a Microsoft product subject
 * to that product's license terms. Microsoft reserves all other rights to the
 * files not expressly granted by Microsoft, whether by implication, estoppel
 * or otherwise. Insofar as a script file is dual licensed under GPL,
 * Microsoft neither took the code under GPL nor distributes it thereunder but
 * under the terms set out in this paragraph. All notices and licenses
 * below are for informational purposes only.
 *
 * NUGET: END LICENSE TEXT */
/*!
** Unobtrusive Ajax support library for jQuery
** Copyright (C) Microsoft Corporation. All rights reserved.
*/

/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
/*global window: false, jQuery: false */

(function ($) {
    var data_click = "unobtrusiveAjaxClick",
        data_target = "unobtrusiveAjaxClickTarget",
        data_validation = "unobtrusiveValidation";

    function getFunction(code, argNames) {
        var fn = window, parts = (code || "").split(".");
        while (fn && parts.length) {
            fn = fn[parts.shift()];
        }
        if (typeof (fn) === "function") {
            return fn;
        }
        argNames.push(code);
        return Function.constructor.apply(null, argNames);
    }

    function isMethodProxySafe(method) {
        return method === "GET" || method === "POST";
    }

    function asyncOnBeforeSend(xhr, method) {
        if (!isMethodProxySafe(method)) {
            xhr.setRequestHeader("X-HTTP-Method-Override", method);
        }
    }

    function asyncOnSuccess(element, data, contentType) {
        var mode;

        if (contentType.indexOf("application/x-javascript") !== -1) {  // jQuery already executes JavaScript for us
            return;
        }

        mode = (element.getAttribute("data-ajax-mode") || "").toUpperCase();
        $(element.getAttribute("data-ajax-update")).each(function (i, update) {
            var top;

            switch (mode) {
            case "BEFORE":
                top = update.firstChild;
                $("<div />").html(data).contents().each(function () {
                    update.insertBefore(this, top);
                });
                break;
            case "AFTER":
                $("<div />").html(data).contents().each(function () {
                    update.appendChild(this);
                });
                break;
            case "REPLACE-WITH":
                $(update).replaceWith(data);
                break;
            default:
                $(update).html(data);
                break;
            }
        });
    }

    function asyncRequest(element, options) {
        var confirm, loading, method, duration;

        confirm = element.getAttribute("data-ajax-confirm");
        if (confirm && !window.confirm(confirm)) {
            return;
        }

        loading = $(element.getAttribute("data-ajax-loading"));
        duration = parseInt(element.getAttribute("data-ajax-loading-duration"), 10) || 0;

        $.extend(options, {
            type: element.getAttribute("data-ajax-method") || undefined,
            url: element.getAttribute("data-ajax-url") || undefined,
            cache: !!element.getAttribute("data-ajax-cache"),
            beforeSend: function (xhr) {
                var result;
                asyncOnBeforeSend(xhr, method);
                result = getFunction(element.getAttribute("data-ajax-begin"), ["xhr"]).apply(element, arguments);
                if (result !== false) {
                    loading.show(duration);
                }
                return result;
            },
            complete: function () {
                loading.hide(duration);
                getFunction(element.getAttribute("data-ajax-complete"), ["xhr", "status"]).apply(element, arguments);
            },
            success: function (data, status, xhr) {
                asyncOnSuccess(element, data, xhr.getResponseHeader("Content-Type") || "text/html");
                getFunction(element.getAttribute("data-ajax-success"), ["data", "status", "xhr"]).apply(element, arguments);
            },
            error: function () {
                getFunction(element.getAttribute("data-ajax-failure"), ["xhr", "status", "error"]).apply(element, arguments);
            }
        });

        options.data.push({ name: "X-Requested-With", value: "XMLHttpRequest" });

        method = options.type.toUpperCase();
        if (!isMethodProxySafe(method)) {
            options.type = "POST";
            options.data.push({ name: "X-HTTP-Method-Override", value: method });
        }

        $.ajax(options);
    }

    function validate(form) {
        var validationInfo = $(form).data(data_validation);
        return !validationInfo || !validationInfo.validate || validationInfo.validate();
    }

    $(document).on("click", "a[data-ajax=true]", function (evt) {
        evt.preventDefault();
        asyncRequest(this, {
            url: this.href,
            type: "GET",
            data: []
        });
    });

    $(document).on("click", "form[data-ajax=true] input[type=image]", function (evt) {
        var name = evt.target.name,
            target = $(evt.target),
            form = $(target.parents("form")[0]),
            offset = target.offset();

        form.data(data_click, [
            { name: name + ".x", value: Math.round(evt.pageX - offset.left) },
            { name: name + ".y", value: Math.round(evt.pageY - offset.top) }
        ]);

        setTimeout(function () {
            form.removeData(data_click);
        }, 0);
    });

    $(document).on("click", "form[data-ajax=true] :submit", function (evt) {
        var name = evt.currentTarget.name,
            target = $(evt.target),
            form = $(target.parents("form")[0]);

        form.data(data_click, name ? [{ name: name, value: evt.currentTarget.value }] : []);
        form.data(data_target, target);

        setTimeout(function () {
            form.removeData(data_click);
            form.removeData(data_target);
        }, 0);
    });

    $(document).on("submit", "form[data-ajax=true]", function (evt) {
        var clickInfo = $(this).data(data_click) || [],
            clickTarget = $(this).data(data_target),
            isCancel = clickTarget && clickTarget.hasClass("cancel");
        evt.preventDefault();
        if (!isCancel && !validate(this)) {
            return;
        }
        asyncRequest(this, {
            url: this.action,
            type: this.method || "GET",
            data: clickInfo.concat($(this).serializeArray())
        });
    });
}(jQuery));;
/*!
 * jQuery Validation Plugin v1.13.0
 *
 * http://jqueryvalidation.org/
 *
 * Copyright (c) 2014 Jörn Zaefferer
 * Released under the MIT license
 */
(function( factory ) {
	if ( typeof define === "function" && define.amd ) {
		define( ["jquery"], factory );
	} else {
		factory( jQuery );
	}
}(function( $ ) {

$.extend($.fn, {
	// http://jqueryvalidation.org/validate/
	validate: function( options ) {

		// if nothing is selected, return nothing; can't chain anyway
		if ( !this.length ) {
			if ( options && options.debug && window.console ) {
				console.warn( "Nothing selected, can't validate, returning nothing." );
			}
			return;
		}

		// check if a validator for this form was already created
		var validator = $.data( this[ 0 ], "validator" );
		if ( validator ) {
			return validator;
		}

		// Add novalidate tag if HTML5.
		this.attr( "novalidate", "novalidate" );

		validator = new $.validator( options, this[ 0 ] );
		$.data( this[ 0 ], "validator", validator );

		if ( validator.settings.onsubmit ) {

			this.validateDelegate( ":submit", "click", function( event ) {
				if ( validator.settings.submitHandler ) {
					validator.submitButton = event.target;
				}
				// allow suppressing validation by adding a cancel class to the submit button
				if ( $( event.target ).hasClass( "cancel" ) ) {
					validator.cancelSubmit = true;
				}

				// allow suppressing validation by adding the html5 formnovalidate attribute to the submit button
				if ( $( event.target ).attr( "formnovalidate" ) !== undefined ) {
					validator.cancelSubmit = true;
				}
			});

			// validate the form on submit
			this.submit( function( event ) {
				if ( validator.settings.debug ) {
					// prevent form submit to be able to see console output
					event.preventDefault();
				}
				function handle() {
					var hidden;
					if ( validator.settings.submitHandler ) {
						if ( validator.submitButton ) {
							// insert a hidden input as a replacement for the missing submit button
							hidden = $( "<input type='hidden'/>" )
								.attr( "name", validator.submitButton.name )
								.val( $( validator.submitButton ).val() )
								.appendTo( validator.currentForm );
						}
						validator.settings.submitHandler.call( validator, validator.currentForm, event );
						if ( validator.submitButton ) {
							// and clean up afterwards; thanks to no-block-scope, hidden can be referenced
							hidden.remove();
						}
						return false;
					}
					return true;
				}

				// prevent submit for invalid forms or custom submit handlers
				if ( validator.cancelSubmit ) {
					validator.cancelSubmit = false;
					return handle();
				}
				if ( validator.form() ) {
					if ( validator.pendingRequest ) {
						validator.formSubmitted = true;
						return false;
					}
					return handle();
				} else {
					validator.focusInvalid();
					return false;
				}
			});
		}

		return validator;
	},
	// http://jqueryvalidation.org/valid/
	valid: function() {
		var valid, validator;

		if ( $( this[ 0 ] ).is( "form" ) ) {
			valid = this.validate().form();
		} else {
			valid = true;
			validator = $( this[ 0 ].form ).validate();
			this.each( function() {
				valid = validator.element( this ) && valid;
			});
		}
		return valid;
	},
	// attributes: space separated list of attributes to retrieve and remove
	removeAttrs: function( attributes ) {
		var result = {},
			$element = this;
		$.each( attributes.split( /\s/ ), function( index, value ) {
			result[ value ] = $element.attr( value );
			$element.removeAttr( value );
		});
		return result;
	},
	// http://jqueryvalidation.org/rules/
	rules: function( command, argument ) {
		var element = this[ 0 ],
			settings, staticRules, existingRules, data, param, filtered;

		if ( command ) {
			settings = $.data( element.form, "validator" ).settings;
			staticRules = settings.rules;
			existingRules = $.validator.staticRules( element );
			switch ( command ) {
			case "add":
				$.extend( existingRules, $.validator.normalizeRule( argument ) );
				// remove messages from rules, but allow them to be set separately
				delete existingRules.messages;
				staticRules[ element.name ] = existingRules;
				if ( argument.messages ) {
					settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages );
				}
				break;
			case "remove":
				if ( !argument ) {
					delete staticRules[ element.name ];
					return existingRules;
				}
				filtered = {};
				$.each( argument.split( /\s/ ), function( index, method ) {
					filtered[ method ] = existingRules[ method ];
					delete existingRules[ method ];
					if ( method === "required" ) {
						$( element ).removeAttr( "aria-required" );
					}
				});
				return filtered;
			}
		}

		data = $.validator.normalizeRules(
		$.extend(
			{},
			$.validator.classRules( element ),
			$.validator.attributeRules( element ),
			$.validator.dataRules( element ),
			$.validator.staticRules( element )
		), element );

		// make sure required is at front
		if ( data.required ) {
			param = data.required;
			delete data.required;
			data = $.extend( { required: param }, data );
			$( element ).attr( "aria-required", "true" );
		}

		// make sure remote is at back
		if ( data.remote ) {
			param = data.remote;
			delete data.remote;
			data = $.extend( data, { remote: param });
		}

		return data;
	}
});

// Custom selectors
$.extend( $.expr[ ":" ], {
	// http://jqueryvalidation.org/blank-selector/
	blank: function( a ) {
		return !$.trim( "" + $( a ).val() );
	},
	// http://jqueryvalidation.org/filled-selector/
	filled: function( a ) {
		return !!$.trim( "" + $( a ).val() );
	},
	// http://jqueryvalidation.org/unchecked-selector/
	unchecked: function( a ) {
		return !$( a ).prop( "checked" );
	}
});

// constructor for validator
$.validator = function( options, form ) {
	this.settings = $.extend( true, {}, $.validator.defaults, options );
	this.currentForm = form;
	this.init();
};

// http://jqueryvalidation.org/jQuery.validator.format/
$.validator.format = function( source, params ) {
	if ( arguments.length === 1 ) {
		return function() {
			var args = $.makeArray( arguments );
			args.unshift( source );
			return $.validator.format.apply( this, args );
		};
	}
	if ( arguments.length > 2 && params.constructor !== Array  ) {
		params = $.makeArray( arguments ).slice( 1 );
	}
	if ( params.constructor !== Array ) {
		params = [ params ];
	}
	$.each( params, function( i, n ) {
		source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() {
			return n;
		});
	});
	return source;
};

$.extend( $.validator, {

	defaults: {
		messages: {},
		groups: {},
		rules: {},
		errorClass: "error",
		validClass: "valid",
		errorElement: "label",
		focusInvalid: true,
		errorContainer: $( [] ),
		errorLabelContainer: $( [] ),
		onsubmit: true,
		ignore: ":hidden",
		ignoreTitle: false,
		onfocusin: function( element ) {
			this.lastActive = element;

			// hide error label and remove error class on focus if enabled
			if ( this.settings.focusCleanup && !this.blockFocusCleanup ) {
				if ( this.settings.unhighlight ) {
					this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );
				}
				this.hideThese( this.errorsFor( element ) );
			}
		},
		onfocusout: function( element ) {
			if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) {
				this.element( element );
			}
		},
		onkeyup: function( element, event ) {
			if ( event.which === 9 && this.elementValue( element ) === "" ) {
				return;
			} else if ( element.name in this.submitted || element === this.lastElement ) {
				this.element( element );
			}
		},
		onclick: function( element ) {
			// click on selects, radiobuttons and checkboxes
			if ( element.name in this.submitted ) {
				this.element( element );

			// or option elements, check parent select in that case
			} else if ( element.parentNode.name in this.submitted ) {
				this.element( element.parentNode );
			}
		},
		highlight: function( element, errorClass, validClass ) {
			if ( element.type === "radio" ) {
				this.findByName( element.name ).addClass( errorClass ).removeClass( validClass );
			} else {
				$( element ).addClass( errorClass ).removeClass( validClass );
			}
		},
		unhighlight: function( element, errorClass, validClass ) {
			if ( element.type === "radio" ) {
				this.findByName( element.name ).removeClass( errorClass ).addClass( validClass );
			} else {
				$( element ).removeClass( errorClass ).addClass( validClass );
			}
		}
	},

	// http://jqueryvalidation.org/jQuery.validator.setDefaults/
	setDefaults: function( settings ) {
		$.extend( $.validator.defaults, settings );
	},

	messages: {
		required: "This field is required.",
		remote: "Please fix this field.",
		email: "Please enter a valid email address.",
		url: "Please enter a valid URL.",
		date: "Please enter a valid date.",
		dateISO: "Please enter a valid date ( ISO ).",
		number: "Please enter a valid number.",
		digits: "Please enter only digits.",
		creditcard: "Please enter a valid credit card number.",
		equalTo: "Please enter the same value again.",
		maxlength: $.validator.format( "Please enter no more than {0} characters." ),
		minlength: $.validator.format( "Please enter at least {0} characters." ),
		rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ),
		range: $.validator.format( "Please enter a value between {0} and {1}." ),
		max: $.validator.format( "Please enter a value less than or equal to {0}." ),
		min: $.validator.format( "Please enter a value greater than or equal to {0}." )
	},

	autoCreateRanges: false,

	prototype: {

		init: function() {
			this.labelContainer = $( this.settings.errorLabelContainer );
			this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm );
			this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer );
			this.submitted = {};
			this.valueCache = {};
			this.pendingRequest = 0;
			this.pending = {};
			this.invalid = {};
			this.reset();

			var groups = ( this.groups = {} ),
				rules;
			$.each( this.settings.groups, function( key, value ) {
				if ( typeof value === "string" ) {
					value = value.split( /\s/ );
				}
				$.each( value, function( index, name ) {
					groups[ name ] = key;
				});
			});
			rules = this.settings.rules;
			$.each( rules, function( key, value ) {
				rules[ key ] = $.validator.normalizeRule( value );
			});

			function delegate( event ) {
				var validator = $.data( this[ 0 ].form, "validator" ),
					eventType = "on" + event.type.replace( /^validate/, "" ),
					settings = validator.settings;
				if ( settings[ eventType ] && !this.is( settings.ignore ) ) {
					settings[ eventType ].call( validator, this[ 0 ], event );
				}
			}
			$( this.currentForm )
				.validateDelegate( ":text, [type='password'], [type='file'], select, textarea, " +
					"[type='number'], [type='search'] ,[type='tel'], [type='url'], " +
					"[type='email'], [type='datetime'], [type='date'], [type='month'], " +
					"[type='week'], [type='time'], [type='datetime-local'], " +
					"[type='range'], [type='color'], [type='radio'], [type='checkbox']",
					"focusin focusout keyup", delegate)
				// Support: Chrome, oldIE
				// "select" is provided as event.target when clicking a option
				.validateDelegate("select, option, [type='radio'], [type='checkbox']", "click", delegate);

			if ( this.settings.invalidHandler ) {
				$( this.currentForm ).bind( "invalid-form.validate", this.settings.invalidHandler );
			}

			// Add aria-required to any Static/Data/Class required fields before first validation
			// Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html
			$( this.currentForm ).find( "[required], [data-rule-required], .required" ).attr( "aria-required", "true" );
		},

		// http://jqueryvalidation.org/Validator.form/
		form: function() {
			this.checkForm();
			$.extend( this.submitted, this.errorMap );
			this.invalid = $.extend({}, this.errorMap );
			if ( !this.valid() ) {
				$( this.currentForm ).triggerHandler( "invalid-form", [ this ]);
			}
			this.showErrors();
			return this.valid();
		},

		checkForm: function() {
			this.prepareForm();
			for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) {
				this.check( elements[ i ] );
			}
			return this.valid();
		},

		// http://jqueryvalidation.org/Validator.element/
		element: function( element ) {
			var cleanElement = this.clean( element ),
				checkElement = this.validationTargetFor( cleanElement ),
				result = true;

			this.lastElement = checkElement;

			if ( checkElement === undefined ) {
				delete this.invalid[ cleanElement.name ];
			} else {
				this.prepareElement( checkElement );
				this.currentElements = $( checkElement );

				result = this.check( checkElement ) !== false;
				if ( result ) {
					delete this.invalid[ checkElement.name ];
				} else {
					this.invalid[ checkElement.name ] = true;
				}
			}
			// Add aria-invalid status for screen readers
			$( element ).attr( "aria-invalid", !result );

			if ( !this.numberOfInvalids() ) {
				// Hide error containers on last error
				this.toHide = this.toHide.add( this.containers );
			}
			this.showErrors();
			return result;
		},

		// http://jqueryvalidation.org/Validator.showErrors/
		showErrors: function( errors ) {
			if ( errors ) {
				// add items to error list and map
				$.extend( this.errorMap, errors );
				this.errorList = [];
				for ( var name in errors ) {
					this.errorList.push({
						message: errors[ name ],
						element: this.findByName( name )[ 0 ]
					});
				}
				// remove items from success list
				this.successList = $.grep( this.successList, function( element ) {
					return !( element.name in errors );
				});
			}
			if ( this.settings.showErrors ) {
				this.settings.showErrors.call( this, this.errorMap, this.errorList );
			} else {
				this.defaultShowErrors();
			}
		},

		// http://jqueryvalidation.org/Validator.resetForm/
		resetForm: function() {
			if ( $.fn.resetForm ) {
				$( this.currentForm ).resetForm();
			}
			this.submitted = {};
			this.lastElement = null;
			this.prepareForm();
			this.hideErrors();
			this.elements()
					.removeClass( this.settings.errorClass )
					.removeData( "previousValue" )
					.removeAttr( "aria-invalid" );
		},

		numberOfInvalids: function() {
			return this.objectLength( this.invalid );
		},

		objectLength: function( obj ) {
			/* jshint unused: false */
			var count = 0,
				i;
			for ( i in obj ) {
				count++;
			}
			return count;
		},

		hideErrors: function() {
			this.hideThese( this.toHide );
		},

		hideThese: function( errors ) {
			errors.not( this.containers ).text( "" );
			this.addWrapper( errors ).hide();
		},

		valid: function() {
			return this.size() === 0;
		},

		size: function() {
			return this.errorList.length;
		},

		focusInvalid: function() {
			if ( this.settings.focusInvalid ) {
				try {
					$( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [])
					.filter( ":visible" )
					.focus()
					// manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find
					.trigger( "focusin" );
				} catch ( e ) {
					// ignore IE throwing errors when focusing hidden elements
				}
			}
		},

		findLastActive: function() {
			var lastActive = this.lastActive;
			return lastActive && $.grep( this.errorList, function( n ) {
				return n.element.name === lastActive.name;
			}).length === 1 && lastActive;
		},

		elements: function() {
			var validator = this,
				rulesCache = {};

			// select all valid inputs inside the form (no submit or reset buttons)
			return $( this.currentForm )
			.find( "input, select, textarea" )
			.not( ":submit, :reset, :image, [disabled]" )
			.not( this.settings.ignore )
			.filter( function() {
				if ( !this.name && validator.settings.debug && window.console ) {
					console.error( "%o has no name assigned", this );
				}

				// select only the first element for each name, and only those with rules specified
				if ( this.name in rulesCache || !validator.objectLength( $( this ).rules() ) ) {
					return false;
				}

				rulesCache[ this.name ] = true;
				return true;
			});
		},

		clean: function( selector ) {
			return $( selector )[ 0 ];
		},

		errors: function() {
			var errorClass = this.settings.errorClass.split( " " ).join( "." );
			return $( this.settings.errorElement + "." + errorClass, this.errorContext );
		},

		reset: function() {
			this.successList = [];
			this.errorList = [];
			this.errorMap = {};
			this.toShow = $( [] );
			this.toHide = $( [] );
			this.currentElements = $( [] );
		},

		prepareForm: function() {
			this.reset();
			this.toHide = this.errors().add( this.containers );
		},

		prepareElement: function( element ) {
			this.reset();
			this.toHide = this.errorsFor( element );
		},

		elementValue: function( element ) {
			var val,
				$element = $( element ),
				type = element.type;

			if ( type === "radio" || type === "checkbox" ) {
				return $( "input[name='" + element.name + "']:checked" ).val();
			} else if ( type === "number" && typeof element.validity !== "undefined" ) {
				return element.validity.badInput ? false : $element.val();
			}

			val = $element.val();
			if ( typeof val === "string" ) {
				return val.replace(/\r/g, "" );
			}
			return val;
		},

		check: function( element ) {
			element = this.validationTargetFor( this.clean( element ) );

			var rules = $( element ).rules(),
				rulesCount = $.map( rules, function( n, i ) {
					return i;
				}).length,
				dependencyMismatch = false,
				val = this.elementValue( element ),
				result, method, rule;

			for ( method in rules ) {
				rule = { method: method, parameters: rules[ method ] };
				try {

					result = $.validator.methods[ method ].call( this, val, element, rule.parameters );

					// if a method indicates that the field is optional and therefore valid,
					// don't mark it as valid when there are no other rules
					if ( result === "dependency-mismatch" && rulesCount === 1 ) {
						dependencyMismatch = true;
						continue;
					}
					dependencyMismatch = false;

					if ( result === "pending" ) {
						this.toHide = this.toHide.not( this.errorsFor( element ) );
						return;
					}

					if ( !result ) {
						this.formatAndAdd( element, rule );
						return false;
					}
				} catch ( e ) {
					if ( this.settings.debug && window.console ) {
						console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e );
					}
					throw e;
				}
			}
			if ( dependencyMismatch ) {
				return;
			}
			if ( this.objectLength( rules ) ) {
				this.successList.push( element );
			}
			return true;
		},

		// return the custom message for the given element and validation method
		// specified in the element's HTML5 data attribute
		// return the generic message if present and no method specific message is present
		customDataMessage: function( element, method ) {
			return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() +
				method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" );
		},

		// return the custom message for the given element name and validation method
		customMessage: function( name, method ) {
			var m = this.settings.messages[ name ];
			return m && ( m.constructor === String ? m : m[ method ]);
		},

		// return the first defined argument, allowing empty strings
		findDefined: function() {
			for ( var i = 0; i < arguments.length; i++) {
				if ( arguments[ i ] !== undefined ) {
					return arguments[ i ];
				}
			}
			return undefined;
		},

		defaultMessage: function( element, method ) {
			return this.findDefined(
				this.customMessage( element.name, method ),
				this.customDataMessage( element, method ),
				// title is never undefined, so handle empty string as undefined
				!this.settings.ignoreTitle && element.title || undefined,
				$.validator.messages[ method ],
				"<strong>Warning: No message defined for " + element.name + "</strong>"
			);
		},

		formatAndAdd: function( element, rule ) {
			var message = this.defaultMessage( element, rule.method ),
				theregex = /\$?\{(\d+)\}/g;
			if ( typeof message === "function" ) {
				message = message.call( this, rule.parameters, element );
			} else if ( theregex.test( message ) ) {
				message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters );
			}
			this.errorList.push({
				message: message,
				element: element,
				method: rule.method
			});

			this.errorMap[ element.name ] = message;
			this.submitted[ element.name ] = message;
		},

		addWrapper: function( toToggle ) {
			if ( this.settings.wrapper ) {
				toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) );
			}
			return toToggle;
		},

		defaultShowErrors: function() {
			var i, elements, error;
			for ( i = 0; this.errorList[ i ]; i++ ) {
				error = this.errorList[ i ];
				if ( this.settings.highlight ) {
					this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass );
				}
				this.showLabel( error.element, error.message );
			}
			if ( this.errorList.length ) {
				this.toShow = this.toShow.add( this.containers );
			}
			if ( this.settings.success ) {
				for ( i = 0; this.successList[ i ]; i++ ) {
					this.showLabel( this.successList[ i ] );
				}
			}
			if ( this.settings.unhighlight ) {
				for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) {
					this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass );
				}
			}
			this.toHide = this.toHide.not( this.toShow );
			this.hideErrors();
			this.addWrapper( this.toShow ).show();
		},

		validElements: function() {
			return this.currentElements.not( this.invalidElements() );
		},

		invalidElements: function() {
			return $( this.errorList ).map(function() {
				return this.element;
			});
		},

		showLabel: function( element, message ) {
			var place, group, errorID,
				error = this.errorsFor( element ),
				elementID = this.idOrName( element ),
				describedBy = $( element ).attr( "aria-describedby" );
			if ( error.length ) {
				// refresh error/success class
				error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass );
				// replace message on existing label
				error.html( message );
			} else {
				// create error element
				error = $( "<" + this.settings.errorElement + ">" )
					.attr( "id", elementID + "-error" )
					.addClass( this.settings.errorClass )
					.html( message || "" );

				// Maintain reference to the element to be placed into the DOM
				place = error;
				if ( this.settings.wrapper ) {
					// make sure the element is visible, even in IE
					// actually showing the wrapped element is handled elsewhere
					place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent();
				}
				if ( this.labelContainer.length ) {
					this.labelContainer.append( place );
				} else if ( this.settings.errorPlacement ) {
					this.settings.errorPlacement( place, $( element ) );
				} else {
					place.insertAfter( element );
				}

				// Link error back to the element
				if ( error.is( "label" ) ) {
					// If the error is a label, then associate using 'for'
					error.attr( "for", elementID );
				} else if ( error.parents( "label[for='" + elementID + "']" ).length === 0 ) {
					// If the element is not a child of an associated label, then it's necessary
					// to explicitly apply aria-describedby

					errorID = error.attr( "id" );
					// Respect existing non-error aria-describedby
					if ( !describedBy ) {
						describedBy = errorID;
					} else if ( !describedBy.match( new RegExp( "\b" + errorID + "\b" ) ) ) {
						// Add to end of list if not already present
						describedBy += " " + errorID;
					}
					$( element ).attr( "aria-describedby", describedBy );

					// If this element is grouped, then assign to all elements in the same group
					group = this.groups[ element.name ];
					if ( group ) {
						$.each( this.groups, function( name, testgroup ) {
							if ( testgroup === group ) {
								$( "[name='" + name + "']", this.currentForm )
									.attr( "aria-describedby", error.attr( "id" ) );
							}
						});
					}
				}
			}
			if ( !message && this.settings.success ) {
				error.text( "" );
				if ( typeof this.settings.success === "string" ) {
					error.addClass( this.settings.success );
				} else {
					this.settings.success( error, element );
				}
			}
			this.toShow = this.toShow.add( error );
		},

		errorsFor: function( element ) {
			var name = this.idOrName( element ),
				describer = $( element ).attr( "aria-describedby" ),
				selector = "label[for='" + name + "'], label[for='" + name + "'] *";
			// aria-describedby should directly reference the error element
			if ( describer ) {
				selector = selector + ", #" + describer.replace( /\s+/g, ", #" );
			}
			return this
				.errors()
				.filter( selector );
		},

		idOrName: function( element ) {
			return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name );
		},

		validationTargetFor: function( element ) {
			// if radio/checkbox, validate first element in group instead
			if ( this.checkable( element ) ) {
				element = this.findByName( element.name ).not( this.settings.ignore )[ 0 ];
			}
			return element;
		},

		checkable: function( element ) {
			return ( /radio|checkbox/i ).test( element.type );
		},

		findByName: function( name ) {
			return $( this.currentForm ).find( "[name='" + name + "']" );
		},

		getLength: function( value, element ) {
			switch ( element.nodeName.toLowerCase() ) {
			case "select":
				return $( "option:selected", element ).length;
			case "input":
				if ( this.checkable( element ) ) {
					return this.findByName( element.name ).filter( ":checked" ).length;
				}
			}
			return value.length;
		},

		depend: function( param, element ) {
			return this.dependTypes[typeof param] ? this.dependTypes[typeof param]( param, element ) : true;
		},

		dependTypes: {
			"boolean": function( param ) {
				return param;
			},
			"string": function( param, element ) {
				return !!$( param, element.form ).length;
			},
			"function": function( param, element ) {
				return param( element );
			}
		},

		optional: function( element ) {
			var val = this.elementValue( element );
			return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch";
		},

		startRequest: function( element ) {
			if ( !this.pending[ element.name ] ) {
				this.pendingRequest++;
				this.pending[ element.name ] = true;
			}
		},

		stopRequest: function( element, valid ) {
			this.pendingRequest--;
			// sometimes synchronization fails, make sure pendingRequest is never < 0
			if ( this.pendingRequest < 0 ) {
				this.pendingRequest = 0;
			}
			delete this.pending[ element.name ];
			if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {
				$( this.currentForm ).submit();
				this.formSubmitted = false;
			} else if (!valid && this.pendingRequest === 0 && this.formSubmitted ) {
				$( this.currentForm ).triggerHandler( "invalid-form", [ this ]);
				this.formSubmitted = false;
			}
		},

		previousValue: function( element ) {
			return $.data( element, "previousValue" ) || $.data( element, "previousValue", {
				old: null,
				valid: true,
				message: this.defaultMessage( element, "remote" )
			});
		}

	},

	classRuleSettings: {
		required: { required: true },
		email: { email: true },
		url: { url: true },
		date: { date: true },
		dateISO: { dateISO: true },
		number: { number: true },
		digits: { digits: true },
		creditcard: { creditcard: true }
	},

	addClassRules: function( className, rules ) {
		if ( className.constructor === String ) {
			this.classRuleSettings[ className ] = rules;
		} else {
			$.extend( this.classRuleSettings, className );
		}
	},

	classRules: function( element ) {
		var rules = {},
			classes = $( element ).attr( "class" );

		if ( classes ) {
			$.each( classes.split( " " ), function() {
				if ( this in $.validator.classRuleSettings ) {
					$.extend( rules, $.validator.classRuleSettings[ this ]);
				}
			});
		}
		return rules;
	},

	attributeRules: function( element ) {
		var rules = {},
			$element = $( element ),
			type = element.getAttribute( "type" ),
			method, value;

		for ( method in $.validator.methods ) {

			// support for <input required> in both html5 and older browsers
			if ( method === "required" ) {
				value = element.getAttribute( method );
				// Some browsers return an empty string for the required attribute
				// and non-HTML5 browsers might have required="" markup
				if ( value === "" ) {
					value = true;
				}
				// force non-HTML5 browsers to return bool
				value = !!value;
			} else {
				value = $element.attr( method );
			}

			// convert the value to a number for number inputs, and for text for backwards compability
			// allows type="date" and others to be compared as strings
			if ( /min|max/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) {
				value = Number( value );
			}

			if ( value || value === 0 ) {
				rules[ method ] = value;
			} else if ( type === method && type !== "range" ) {
				// exception: the jquery validate 'range' method
				// does not test for the html5 'range' type
				rules[ method ] = true;
			}
		}

		// maxlength may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs
		if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) {
			delete rules.maxlength;
		}

		return rules;
	},

	dataRules: function( element ) {
		var method, value,
			rules = {}, $element = $( element );
		for ( method in $.validator.methods ) {
			value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() );
			if ( value !== undefined ) {
				rules[ method ] = value;
			}
		}
		return rules;
	},

	staticRules: function( element ) {
		var rules = {},
			validator = $.data( element.form, "validator" );

		if ( validator.settings.rules ) {
			rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {};
		}
		return rules;
	},

	normalizeRules: function( rules, element ) {
		// handle dependency check
		$.each( rules, function( prop, val ) {
			// ignore rule when param is explicitly false, eg. required:false
			if ( val === false ) {
				delete rules[ prop ];
				return;
			}
			if ( val.param || val.depends ) {
				var keepRule = true;
				switch ( typeof val.depends ) {
				case "string":
					keepRule = !!$( val.depends, element.form ).length;
					break;
				case "function":
					keepRule = val.depends.call( element, element );
					break;
				}
				if ( keepRule ) {
					rules[ prop ] = val.param !== undefined ? val.param : true;
				} else {
					delete rules[ prop ];
				}
			}
		});

		// evaluate parameters
		$.each( rules, function( rule, parameter ) {
			rules[ rule ] = $.isFunction( parameter ) ? parameter( element ) : parameter;
		});

		// clean number parameters
		$.each([ "minlength", "maxlength" ], function() {
			if ( rules[ this ] ) {
				rules[ this ] = Number( rules[ this ] );
			}
		});
		$.each([ "rangelength", "range" ], function() {
			var parts;
			if ( rules[ this ] ) {
				if ( $.isArray( rules[ this ] ) ) {
					rules[ this ] = [ Number( rules[ this ][ 0 ]), Number( rules[ this ][ 1 ] ) ];
				} else if ( typeof rules[ this ] === "string" ) {
					parts = rules[ this ].replace(/[\[\]]/g, "" ).split( /[\s,]+/ );
					rules[ this ] = [ Number( parts[ 0 ]), Number( parts[ 1 ] ) ];
				}
			}
		});

		if ( $.validator.autoCreateRanges ) {
			// auto-create ranges
			if ( rules.min && rules.max ) {
				rules.range = [ rules.min, rules.max ];
				delete rules.min;
				delete rules.max;
			}
			if ( rules.minlength && rules.maxlength ) {
				rules.rangelength = [ rules.minlength, rules.maxlength ];
				delete rules.minlength;
				delete rules.maxlength;
			}
		}

		return rules;
	},

	// Converts a simple string to a {string: true} rule, e.g., "required" to {required:true}
	normalizeRule: function( data ) {
		if ( typeof data === "string" ) {
			var transformed = {};
			$.each( data.split( /\s/ ), function() {
				transformed[ this ] = true;
			});
			data = transformed;
		}
		return data;
	},

	// http://jqueryvalidation.org/jQuery.validator.addMethod/
	addMethod: function( name, method, message ) {
		$.validator.methods[ name ] = method;
		$.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ];
		if ( method.length < 3 ) {
			$.validator.addClassRules( name, $.validator.normalizeRule( name ) );
		}
	},

	methods: {

		// http://jqueryvalidation.org/required-method/
		required: function( value, element, param ) {
			// check if dependency is met
			if ( !this.depend( param, element ) ) {
				return "dependency-mismatch";
			}
			if ( element.nodeName.toLowerCase() === "select" ) {
				// could be an array for select-multiple or a string, both are fine this way
				var val = $( element ).val();
				return val && val.length > 0;
			}
			if ( this.checkable( element ) ) {
				return this.getLength( value, element ) > 0;
			}
			return $.trim( value ).length > 0;
		},

		// http://jqueryvalidation.org/email-method/
		email: function( value, element ) {
			// From http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state-%28type=email%29
			// Retrieved 2014-01-14
			// If you have a problem with this implementation, report a bug against the above spec
			// Or use custom methods to implement your own email validation
			return this.optional( element ) || /^[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])?)*$/.test( value );
		},

		// http://jqueryvalidation.org/url-method/
		url: function( value, element ) {
			// contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/
			return this.optional( element ) || /^(https?|s?ftp):\/\/(((([a-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-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test( value );
		},

		// http://jqueryvalidation.org/date-method/
		date: function( value, element ) {
			return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );
		},

		// http://jqueryvalidation.org/dateISO-method/
		dateISO: function( value, element ) {
			return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value );
		},

		// http://jqueryvalidation.org/number-method/
		number: function( value, element ) {
			return this.optional( element ) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value );
		},

		// http://jqueryvalidation.org/digits-method/
		digits: function( value, element ) {
			return this.optional( element ) || /^\d+$/.test( value );
		},

		// http://jqueryvalidation.org/creditcard-method/
		// based on http://en.wikipedia.org/wiki/Luhn/
		creditcard: function( value, element ) {
			if ( this.optional( element ) ) {
				return "dependency-mismatch";
			}
			// accept only spaces, digits and dashes
			if ( /[^0-9 \-]+/.test( value ) ) {
				return false;
			}
			var nCheck = 0,
				nDigit = 0,
				bEven = false,
				n, cDigit;

			value = value.replace( /\D/g, "" );

			// Basing min and max length on
			// http://developer.ean.com/general_info/Valid_Credit_Card_Types
			if ( value.length < 13 || value.length > 19 ) {
				return false;
			}

			for ( n = value.length - 1; n >= 0; n--) {
				cDigit = value.charAt( n );
				nDigit = parseInt( cDigit, 10 );
				if ( bEven ) {
					if ( ( nDigit *= 2 ) > 9 ) {
						nDigit -= 9;
					}
				}
				nCheck += nDigit;
				bEven = !bEven;
			}

			return ( nCheck % 10 ) === 0;
		},

		// http://jqueryvalidation.org/minlength-method/
		minlength: function( value, element, param ) {
			var length = $.isArray( value ) ? value.length : this.getLength( $.trim( value ), element );
			return this.optional( element ) || length >= param;
		},

		// http://jqueryvalidation.org/maxlength-method/
		maxlength: function( value, element, param ) {
			var length = $.isArray( value ) ? value.length : this.getLength( $.trim( value ), element );
			return this.optional( element ) || length <= param;
		},

		// http://jqueryvalidation.org/rangelength-method/
		rangelength: function( value, element, param ) {
			var length = $.isArray( value ) ? value.length : this.getLength( $.trim( value ), element );
			return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] );
		},

		// http://jqueryvalidation.org/min-method/
		min: function( value, element, param ) {
			return this.optional( element ) || value >= param;
		},

		// http://jqueryvalidation.org/max-method/
		max: function( value, element, param ) {
			return this.optional( element ) || value <= param;
		},

		// http://jqueryvalidation.org/range-method/
		range: function( value, element, param ) {
			return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] );
		},

		// http://jqueryvalidation.org/equalTo-method/
		equalTo: function( value, element, param ) {
			// bind to the blur event of the target in order to revalidate whenever the target field is updated
			// TODO find a way to bind the event just once, avoiding the unbind-rebind overhead
			var target = $( param );
			if ( this.settings.onfocusout ) {
				target.unbind( ".validate-equalTo" ).bind( "blur.validate-equalTo", function() {
					$( element ).valid();
				});
			}
			return value === target.val();
		},

		// http://jqueryvalidation.org/remote-method/
		remote: function( value, element, param ) {
			if ( this.optional( element ) ) {
				return "dependency-mismatch";
			}

			var previous = this.previousValue( element ),
				validator, data;

			if (!this.settings.messages[ element.name ] ) {
				this.settings.messages[ element.name ] = {};
			}
			previous.originalMessage = this.settings.messages[ element.name ].remote;
			this.settings.messages[ element.name ].remote = previous.message;

			param = typeof param === "string" && { url: param } || param;

			if ( previous.old === value ) {
				return previous.valid;
			}

			previous.old = value;
			validator = this;
			this.startRequest( element );
			data = {};
			data[ element.name ] = value;
			$.ajax( $.extend( true, {
				url: param,
				mode: "abort",
				port: "validate" + element.name,
				dataType: "json",
				data: data,
				context: validator.currentForm,
				success: function( response ) {
					var valid = response === true || response === "true",
						errors, message, submitted;

					validator.settings.messages[ element.name ].remote = previous.originalMessage;
					if ( valid ) {
						submitted = validator.formSubmitted;
						validator.prepareElement( element );
						validator.formSubmitted = submitted;
						validator.successList.push( element );
						delete validator.invalid[ element.name ];
						validator.showErrors();
					} else {
						errors = {};
						message = response || validator.defaultMessage( element, "remote" );
						errors[ element.name ] = previous.message = $.isFunction( message ) ? message( value ) : message;
						validator.invalid[ element.name ] = true;
						validator.showErrors( errors );
					}
					previous.valid = valid;
					validator.stopRequest( element, valid );
				}
			}, param ) );
			return "pending";
		}

	}

});

$.format = function deprecated() {
	throw "$.format has been deprecated. Please use $.validator.format instead.";
};

// ajax mode: abort
// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()

var pendingRequests = {},
	ajax;
// Use a prefilter if available (1.5+)
if ( $.ajaxPrefilter ) {
	$.ajaxPrefilter(function( settings, _, xhr ) {
		var port = settings.port;
		if ( settings.mode === "abort" ) {
			if ( pendingRequests[port] ) {
				pendingRequests[port].abort();
			}
			pendingRequests[port] = xhr;
		}
	});
} else {
	// Proxy ajax
	ajax = $.ajax;
	$.ajax = function( settings ) {
		var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode,
			port = ( "port" in settings ? settings : $.ajaxSettings ).port;
		if ( mode === "abort" ) {
			if ( pendingRequests[port] ) {
				pendingRequests[port].abort();
			}
			pendingRequests[port] = ajax.apply(this, arguments);
			return pendingRequests[port];
		}
		return ajax.apply(this, arguments);
	};
}

// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation
// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target

$.extend($.fn, {
	validateDelegate: function( delegate, type, handler ) {
		return this.bind(type, function( event ) {
			var target = $(event.target);
			if ( target.is(delegate) ) {
				return handler.apply(target, arguments);
			}
		});
	}
});

}));;
/* NUGET: BEGIN LICENSE TEXT
 *
 * Microsoft grants you the right to use these script files for the sole
 * purpose of either: (i) interacting through your browser with the Microsoft
 * website or online service, subject to the applicable licensing or use
 * terms; or (ii) using the files as included with a Microsoft product subject
 * to that product's license terms. Microsoft reserves all other rights to the
 * files not expressly granted by Microsoft, whether by implication, estoppel
 * or otherwise. Insofar as a script file is dual licensed under GPL,
 * Microsoft neither took the code under GPL nor distributes it thereunder but
 * under the terms set out in this paragraph. All notices and licenses
 * below are for informational purposes only.
 *
 * NUGET: END LICENSE TEXT */
/*!
** Unobtrusive validation support library for jQuery and jQuery Validate
** Copyright (C) Microsoft Corporation. All rights reserved.
*/

/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
/*global document: false, jQuery: false */

(function ($) {
    var $jQval = $.validator,
        adapters,
        data_validation = "unobtrusiveValidation";

    function setValidationValues(options, ruleName, value) {
        options.rules[ruleName] = value;
        if (options.message) {
            options.messages[ruleName] = options.message;
        }
    }

    function splitAndTrim(value) {
        return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g);
    }

    function escapeAttributeValue(value) {
        // As mentioned on http://api.jquery.com/category/selectors/
        return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1");
    }

    function getModelPrefix(fieldName) {
        return fieldName.substr(0, fieldName.lastIndexOf(".") + 1);
    }

    function appendModelPrefix(value, prefix) {
        if (value.indexOf("*.") === 0) {
            value = value.replace("*.", prefix);
        }
        return value;
    }

    function onError(error, inputElement) {  // 'this' is the form element
        var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"),
            replaceAttrValue = container.attr("data-valmsg-replace"),
            replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null;

        container.removeClass("field-validation-valid").addClass("field-validation-error");
        error.data("unobtrusiveContainer", container);

        if (replace) {
            container.empty();
            error.removeClass("input-validation-error").appendTo(container);
        }
        else {
            error.hide();
        }
    }

    function onErrors(event, validator) {  // 'this' is the form element
        var container = $(this).find("[data-valmsg-summary=true]"),
            list = container.find("ul");

        if (list && list.length && validator.errorList.length) {
            list.empty();
            container.addClass("validation-summary-errors").removeClass("validation-summary-valid");

            $.each(validator.errorList, function () {
                $("<li />").html(this.message).appendTo(list);
            });
        }
    }

    function onSuccess(error) {  // 'this' is the form element
        var container = error.data("unobtrusiveContainer"),
            replaceAttrValue = container.attr("data-valmsg-replace"),
            replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null;

        if (container) {
            container.addClass("field-validation-valid").removeClass("field-validation-error");
            error.removeData("unobtrusiveContainer");

            if (replace) {
                container.empty();
            }
        }
    }

    function onReset(event) {  // 'this' is the form element
        var $form = $(this);
        $form.data("validator").resetForm();
        $form.find(".validation-summary-errors")
            .addClass("validation-summary-valid")
            .removeClass("validation-summary-errors");
        $form.find(".field-validation-error")
            .addClass("field-validation-valid")
            .removeClass("field-validation-error")
            .removeData("unobtrusiveContainer")
            .find(">*")  // If we were using valmsg-replace, get the underlying error
                .removeData("unobtrusiveContainer");
    }

    function validationInfo(form) {
        var $form = $(form),
            result = $form.data(data_validation),
            onResetProxy = $.proxy(onReset, form),
            defaultOptions = $jQval.unobtrusive.options || {},
            execInContext = function (name, args) {
                var func = defaultOptions[name];
                func && $.isFunction(func) && func.apply(form, args);
            }

        if (!result) {
            result = {
                options: {  // options structure passed to jQuery Validate's validate() method
                    errorClass: defaultOptions.errorClass || "input-validation-error",
                    errorElement: defaultOptions.errorElement || "span",
                    errorPlacement: function () {
                        onError.apply(form, arguments);
                        execInContext("errorPlacement", arguments);
                    },
                    invalidHandler: function () {
                        onErrors.apply(form, arguments);
                        execInContext("invalidHandler", arguments);
                    },
                    messages: {},
                    rules: {},
                    success: function () {
                        onSuccess.apply(form, arguments);
                        execInContext("success", arguments);
                    }
                },
                attachValidation: function () {
                    $form
                        .off("reset." + data_validation, onResetProxy)
                        .on("reset." + data_validation, onResetProxy)
                        .validate(this.options);
                },
                validate: function () {  // a validation function that is called by unobtrusive Ajax
                    $form.validate();
                    return $form.valid();
                }
            };
            $form.data(data_validation, result);
        }

        return result;
    }

    $jQval.unobtrusive = {
        adapters: [],

        parseElement: function (element, skipAttach) {
            /// <summary>
            /// Parses a single HTML element for unobtrusive validation attributes.
            /// </summary>
            /// <param name="element" domElement="true">The HTML element to be parsed.</param>
            /// <param name="skipAttach" type="Boolean">[Optional] true to skip attaching the
            /// validation to the form. If parsing just this single element, you should specify true.
            /// If parsing several elements, you should specify false, and manually attach the validation
            /// to the form when you are finished. The default is false.</param>
            var $element = $(element),
                form = $element.parents("form")[0],
                valInfo, rules, messages;

            if (!form) {  // Cannot do client-side validation without a form
                return;
            }

            valInfo = validationInfo(form);
            valInfo.options.rules[element.name] = rules = {};
            valInfo.options.messages[element.name] = messages = {};

            $.each(this.adapters, function () {
                var prefix = "data-val-" + this.name,
                    message = $element.attr(prefix),
                    paramValues = {};

                if (message !== undefined) {  // Compare against undefined, because an empty message is legal (and falsy)
                    prefix += "-";

                    $.each(this.params, function () {
                        paramValues[this] = $element.attr(prefix + this);
                    });

                    this.adapt({
                        element: element,
                        form: form,
                        message: message,
                        params: paramValues,
                        rules: rules,
                        messages: messages
                    });
                }
            });

            $.extend(rules, { "__dummy__": true });

            if (!skipAttach) {
                valInfo.attachValidation();
            }
        },

        parse: function (selector) {
            /// <summary>
            /// Parses all the HTML elements in the specified selector. It looks for input elements decorated
            /// with the [data-val=true] attribute value and enables validation according to the data-val-*
            /// attribute values.
            /// </summary>
            /// <param name="selector" type="String">Any valid jQuery selector.</param>

            // $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one
            // element with data-val=true
            var $selector = $(selector),
                $forms = $selector.parents()
                                  .addBack()
                                  .filter("form")
                                  .add($selector.find("form"))
                                  .has("[data-val=true]");

            $selector.find("[data-val=true]").each(function () {
                $jQval.unobtrusive.parseElement(this, true);
            });

            $forms.each(function () {
                var info = validationInfo(this);
                if (info) {
                    info.attachValidation();
                }
            });
        }
    };

    adapters = $jQval.unobtrusive.adapters;

    adapters.add = function (adapterName, params, fn) {
        /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary>
        /// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
        /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
        /// <param name="params" type="Array" optional="true">[Optional] An array of parameter names (strings) that will
        /// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and
        /// mmmm is the parameter name).</param>
        /// <param name="fn" type="Function">The function to call, which adapts the values from the HTML
        /// attributes into jQuery Validate rules and/or messages.</param>
        /// <returns type="jQuery.validator.unobtrusive.adapters" />
        if (!fn) {  // Called with no params, just a function
            fn = params;
            params = [];
        }
        this.push({ name: adapterName, params: params, adapt: fn });
        return this;
    };

    adapters.addBool = function (adapterName, ruleName) {
        /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
        /// the jQuery Validate validation rule has no parameter values.</summary>
        /// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
        /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
        /// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
        /// of adapterName will be used instead.</param>
        /// <returns type="jQuery.validator.unobtrusive.adapters" />
        return this.add(adapterName, function (options) {
            setValidationValues(options, ruleName || adapterName, true);
        });
    };

    adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) {
        /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
        /// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and
        /// one for min-and-max). The HTML parameters are expected to be named -min and -max.</summary>
        /// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
        /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
        /// <param name="minRuleName" type="String">The name of the jQuery Validate rule to be used when you only
        /// have a minimum value.</param>
        /// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only
        /// have a maximum value.</param>
        /// <param name="minMaxRuleName" type="String">The name of the jQuery Validate rule to be used when you
        /// have both a minimum and maximum value.</param>
        /// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
        /// contains the minimum value. The default is "min".</param>
        /// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
        /// contains the maximum value. The default is "max".</param>
        /// <returns type="jQuery.validator.unobtrusive.adapters" />
        return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) {
            var min = options.params.min,
                max = options.params.max;

            if (min && max) {
                setValidationValues(options, minMaxRuleName, [min, max]);
            }
            else if (min) {
                setValidationValues(options, minRuleName, min);
            }
            else if (max) {
                setValidationValues(options, maxRuleName, max);
            }
        });
    };

    adapters.addSingleVal = function (adapterName, attribute, ruleName) {
        /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
        /// the jQuery Validate validation rule has a single value.</summary>
        /// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
        /// in the data-val-nnnn HTML attribute(where nnnn is the adapter name).</param>
        /// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value.
        /// The default is "val".</param>
        /// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
        /// of adapterName will be used instead.</param>
        /// <returns type="jQuery.validator.unobtrusive.adapters" />
        return this.add(adapterName, [attribute || "val"], function (options) {
            setValidationValues(options, ruleName || adapterName, options.params[attribute]);
        });
    };

    $jQval.addMethod("__dummy__", function (value, element, params) {
        return true;
    });

    $jQval.addMethod("regex", function (value, element, params) {
        var match;
        if (this.optional(element)) {
            return true;
        }

        match = new RegExp(params).exec(value);
        return (match && (match.index === 0) && (match[0].length === value.length));
    });

    $jQval.addMethod("nonalphamin", function (value, element, nonalphamin) {
        var match;
        if (nonalphamin) {
            match = value.match(/\W/g);
            match = match && match.length >= nonalphamin;
        }
        return match;
    });

    if ($jQval.methods.extension) {
        adapters.addSingleVal("accept", "mimtype");
        adapters.addSingleVal("extension", "extension");
    } else {
        // for backward compatibility, when the 'extension' validation method does not exist, such as with versions
        // of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for
        // validating the extension, and ignore mime-type validations as they are not supported.
        adapters.addSingleVal("extension", "extension", "accept");
    }

    adapters.addSingleVal("regex", "pattern");
    adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");
    adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range");
    adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength");
    adapters.add("equalto", ["other"], function (options) {
        var prefix = getModelPrefix(options.element.name),
            other = options.params.other,
            fullOtherName = appendModelPrefix(other, prefix),
            element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0];

        setValidationValues(options, "equalTo", element);
    });
    adapters.add("required", function (options) {
        // jQuery Validate equates "required" with "mandatory" for checkbox elements
        if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") {
            setValidationValues(options, "required", true);
        }
    });
    adapters.add("remote", ["url", "type", "additionalfields"], function (options) {
        var value = {
            url: options.params.url,
            type: options.params.type || "GET",
            data: {}
        },
            prefix = getModelPrefix(options.element.name);

        $.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) {
            var paramName = appendModelPrefix(fieldName, prefix);
            value.data[paramName] = function () {
                return $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']").val();
            };
        });

        setValidationValues(options, "remote", value);
    });
    adapters.add("password", ["min", "nonalphamin", "regex"], function (options) {
        if (options.params.min) {
            setValidationValues(options, "minlength", options.params.min);
        }
        if (options.params.nonalphamin) {
            setValidationValues(options, "nonalphamin", options.params.nonalphamin);
        }
        if (options.params.regex) {
            setValidationValues(options, "regex", options.params.regex);
        }
    });

    $(function () {
        $jQval.unobtrusive.parse(document);
    });
}(jQuery));;
/*	
	Watermark plugin for jQuery
	Version: 3.1.4
	http://jquery-watermark.googlecode.com/

	Copyright (c) 2009-2012 Todd Northrop
	http://www.speednet.biz/
	
	August 13, 2012

	Requires:  jQuery 1.2.3+
	
	Dual licensed under the MIT or GPL Version 2 licenses.
	See mit-license.txt and gpl2-license.txt in the project root for details.
------------------------------------------------------*/

( function ( $, window, undefined ) {

var
	// String constants for data names
	dataFlag = "watermark",
	dataClass = "watermarkClass",
	dataFocus = "watermarkFocus",
	dataFormSubmit = "watermarkSubmit",
	dataMaxLen = "watermarkMaxLength",
	dataPassword = "watermarkPassword",
	dataText = "watermarkText",
	
	// Copy of native jQuery regex use to strip return characters from element value
	rreturn = /\r/g,
	
	// Used to determine if type attribute of input element is a non-text type (invalid)
	rInvalidType = /^(button|checkbox|hidden|image|radio|range|reset|submit)$/i,

	// Includes only elements with watermark defined
	selWatermarkDefined = "input:data(" + dataFlag + "),textarea:data(" + dataFlag + ")",

	// Includes only elements capable of having watermark
	selWatermarkAble = ":watermarkable",
	
	// triggerFns:
	// Array of function names to look for in the global namespace.
	// Any such functions found will be hijacked to trigger a call to
	// hideAll() any time they are called.  The default value is the
	// ASP.NET function that validates the controls on the page
	// prior to a postback.
	// 
	// Am I missing other important trigger function(s) to look for?
	// Please leave me feedback:
	// http://code.google.com/p/jquery-watermark/issues/list
	triggerFns = [
		"Page_ClientValidate"
	],
	
	// Holds a value of true if a watermark was displayed since the last
	// hideAll() was executed. Avoids repeatedly calling hideAll().
	pageDirty = false,
	
	// Detects if the browser can handle native placeholders
	hasNativePlaceholder = ( "placeholder" in document.createElement( "input" ) );

// Best practice: this plugin adds only one method to the jQuery object.
// Also ensures that the watermark code is only added once.
$.watermark = $.watermark || {

	// Current version number of the plugin
	version: "3.1.4",
		
	runOnce: true,
	
	// Default options used when watermarks are instantiated.
	// Can be changed to affect the default behavior for all
	// new or updated watermarks.
	options: {
		
		// Default class name for all watermarks
		className: "watermark",
		
		// If true, plugin will detect and use native browser support for
		// watermarks, if available. (e.g., WebKit's placeholder attribute.)
		useNative: true,
		
		// If true, all watermarks will be hidden during the window's
		// beforeunload event. This is done mainly because WebKit
		// browsers remember the watermark text during navigation
		// and try to restore the watermark text after the user clicks
		// the Back button. We can avoid this by hiding the text before
		// the browser has a chance to save it. The regular unload event
		// was tried, but it seems the browser saves the text before
		// that event kicks off, because it didn't work.
		hideBeforeUnload: true
	},
	
	// Hide one or more watermarks by specifying any selector type
	// i.e., DOM element, string selector, jQuery matched set, etc.
	hide: function ( selector ) {
		$( selector ).filter( selWatermarkDefined ).each(
			function () {
				$.watermark._hide( $( this ) );
			}
		);
	},
	
	// Internal use only.
	_hide: function ( $input, focus ) {
		var elem = $input[ 0 ],
			inputVal = ( elem.value || "" ).replace( rreturn, "" ),
			inputWm = $input.data( dataText ) || "",
			maxLen = $input.data( dataMaxLen ) || 0,
			className = $input.data( dataClass );
	
		if ( ( inputWm.length ) && ( inputVal == inputWm ) ) {
			elem.value = "";
			
			// Password type?
			if ( $input.data( dataPassword ) ) {
				
				if ( ( $input.attr( "type" ) || "" ) === "text" ) {
					var $pwd = $input.data( dataPassword ) || [], 
						$wrap = $input.parent() || [];
						
					if ( ( $pwd.length ) && ( $wrap.length ) ) {
						$wrap[ 0 ].removeChild( $input[ 0 ] ); // Can't use jQuery methods, because they destroy data
						$wrap[ 0 ].appendChild( $pwd[ 0 ] );
						$input = $pwd;
					}
				}
			}
			
			if ( maxLen ) {
				$input.attr( "maxLength", maxLen );
				$input.removeData( dataMaxLen );
			}
		
			if ( focus ) {
				$input.attr( "autocomplete", "off" );  // Avoid NS_ERROR_XPC_JS_THREW_STRING error in Firefox
				
				window.setTimeout(
					function () {
						$input.select();  // Fix missing cursor in IE
					}
				, 1 );
			}
		}
		
		className && $input.removeClass( className );
	},
	
	// Display one or more watermarks by specifying any selector type
	// i.e., DOM element, string selector, jQuery matched set, etc.
	// If conditions are not right for displaying a watermark, ensures that watermark is not shown.
	show: function ( selector ) {
		$( selector ).filter( selWatermarkDefined ).each(
			function () {
				$.watermark._show( $( this ) );
			}
		);
	},
	
	// Internal use only.
	_show: function ( $input ) {
		var elem = $input[ 0 ],
			val = ( elem.value || "" ).replace( rreturn, "" ),
			text = $input.data( dataText ) || "",
			type = $input.attr( "type" ) || "",
			className = $input.data( dataClass );

		if ( ( ( val.length == 0 ) || ( val == text ) ) && ( !$input.data( dataFocus ) ) ) {
			pageDirty = true;
		
			// Password type?
			if ( $input.data( dataPassword ) ) {
				
				if ( type === "password" ) {
					var $pwd = $input.data( dataPassword ) || [],
						$wrap = $input.parent() || [];
						
					if ( ( $pwd.length ) && ( $wrap.length ) ) {
						$wrap[ 0 ].removeChild( $input[ 0 ] ); // Can't use jQuery methods, because they destroy data
						$wrap[ 0 ].appendChild( $pwd[ 0 ] );
						$input = $pwd;
						$input.attr( "maxLength", text.length );
						elem = $input[ 0 ];
					}
				}
			}
		
			// Ensure maxLength big enough to hold watermark (input of type="text" or type="search" only)
			if ( ( type === "text" ) || ( type === "search" ) ) {
				var maxLen = $input.attr( "maxLength" ) || 0;
				
				if ( ( maxLen > 0 ) && ( text.length > maxLen ) ) {
					$input.data( dataMaxLen, maxLen );
					$input.attr( "maxLength", text.length );
				}
			}
            
			className && $input.addClass( className );
			elem.value = text;
		}
		else {
			$.watermark._hide( $input );
		}
	},
	
	// Hides all watermarks on the current page.
	hideAll: function () {
		if ( pageDirty ) {
			$.watermark.hide( selWatermarkAble );
			pageDirty = false;
		}
	},
	
	// Displays all watermarks on the current page.
	showAll: function () {
		$.watermark.show( selWatermarkAble );
	}
};

$.fn.watermark = $.fn.watermark || function ( text, options ) {
	///	<summary>
	///		Set watermark text and class name on all input elements of type="text/password/search" and
	/// 	textareas within the matched set. If className is not specified in options, the default is
	/// 	"watermark". Within the matched set, only input elements with type="text/password/search"
	/// 	and textareas are affected; all other elements are ignored.
	///	</summary>
	///	<returns type="jQuery">
	///		Returns the original jQuery matched set (not just the input and texarea elements).
	/// </returns>
	///	<param name="text" type="String">
	///		Text to display as a watermark when the input or textarea element has an empty value and does not
	/// 	have focus. The first time watermark() is called on an element, if this argument is empty (or not
	/// 	a String type), then the watermark will have the net effect of only changing the class name when
	/// 	the input or textarea element's value is empty and it does not have focus.
	///	</param>
	///	<param name="options" type="Object" optional="true">
	///		Provides the ability to override the default watermark options ($.watermark.options). For backward
	/// 	compatibility, if a string value is supplied, it is used as the class name that overrides the class
	/// 	name in $.watermark.options.className. Properties include:
	/// 		className: When the watermark is visible, the element will be styled using this class name.
	/// 		useNative (Boolean or Function): Specifies if native browser support for watermarks will supersede
	/// 			plugin functionality. If useNative is a function, the return value from the function will
	/// 			determine if native support is used. The function is passed one argument -- a jQuery object
	/// 			containing the element being tested as the only element in its matched set -- and the DOM
	/// 			element being tested is the object on which the function is invoked (the value of "this").
	///	</param>
	/// <remarks>
	///		The effect of changing the text and class name on an input element is called a watermark because
	///		typically light gray text is used to provide a hint as to what type of input is required. However,
	///		the appearance of the watermark can be something completely different: simply change the CSS style
	///		pertaining to the supplied class name.
	///		
	///		The first time watermark() is called on an element, the watermark text and class name are initialized,
	///		and the focus and blur events are hooked in order to control the display of the watermark.  Also, as
	/// 	of version 3.0, drag and drop events are hooked to guard against dropped text being appended to the
	/// 	watermark.  If native watermark support is provided by the browser, it is detected and used, unless
	/// 	the useNative option is set to false.
	///		
	///		Subsequently, watermark() can be called again on an element in order to change the watermark text
	///		and/or class name, and it can also be called without any arguments in order to refresh the display.
	///		
	///		For example, after changing the value of the input or textarea element programmatically, watermark()
	/// 	should be called without any arguments to refresh the display, because the change event is only
	/// 	triggered by user actions, not by programmatic changes to an input or textarea element's value.
	/// 	
	/// 	The one exception to programmatic updates is for password input elements:  you are strongly cautioned
	/// 	against changing the value of a password input element programmatically (after the page loads).
	/// 	The reason is that some fairly hairy code is required behind the scenes to make the watermarks bypass
	/// 	IE security and switch back and forth between clear text (for watermarks) and obscured text (for
	/// 	passwords).  It is *possible* to make programmatic changes, but it must be done in a certain way, and
	/// 	overall it is not recommended.
	/// </remarks>
	
	if ( !this.length ) {
		return this;
	}
	
	var hasClass = false,
		hasText = ( typeof( text ) === "string" );
	
	if ( hasText ) {
		text = text.replace( rreturn, "" );
	}
	
	if ( typeof( options ) === "object" ) {
		hasClass = ( typeof( options.className ) === "string" );
		options = $.extend( {}, $.watermark.options, options );
	}
	else if ( typeof( options ) === "string" ) {
		hasClass = true;
		options = $.extend( {}, $.watermark.options, { className: options } );
	}
	else {
		options = $.watermark.options;
	}
	
	if ( typeof( options.useNative ) !== "function" ) {
		options.useNative = options.useNative? function () { return true; } : function () { return false; };
	}
	
	return this.each(
		function () {
			var $input = $( this );
			
			if ( !$input.is( selWatermarkAble ) ) {
				return;
			}
			
			// Watermark already initialized?
			if ( $input.data( dataFlag ) ) {
			
				// If re-defining text or class, first remove existing watermark, then make changes
				if ( hasText || hasClass ) {
					$.watermark._hide( $input );
			
					if ( hasText ) {
						$input.data( dataText, text );
					}
					
					if ( hasClass ) {
						$input.data( dataClass, options.className );
					}
				}
			}
			else {
			
				// Detect and use native browser support, if enabled in options
				if (
					( hasNativePlaceholder )
					&& ( options.useNative.call( this, $input ) )
					&& ( ( $input.attr( "tagName" ) || "" ) !== "TEXTAREA" )
				) {
					// className is not set because current placeholder standard doesn't
					// have a separate class name property for placeholders (watermarks).
					if ( hasText ) {
						$input.attr( "placeholder", text );
					}
					
					// Only set data flag for non-native watermarks
					// [purposely commented-out] -> $input.data(dataFlag, 1);
					return;
				}
				
				$input.data( dataText, hasText? text : "" );
				$input.data( dataClass, options.className );
				$input.data( dataFlag, 1 ); // Flag indicates watermark was initialized
				
				// Special processing for password type
				if ( ( $input.attr( "type" ) || "" ) === "password" ) {
					var $wrap = $input.wrap( "<span>" ).parent(),
						$wm = $( $wrap.html().replace( /type=["']?password["']?/i, 'type="text"' ) );
					
					$wm.data( dataText, $input.data( dataText ) );
					$wm.data( dataClass, $input.data( dataClass ) );
					$wm.data( dataFlag, 1 );
					$wm.attr( "maxLength", text.length );
					
					$wm.focus(
						function () {
							$.watermark._hide( $wm, true );
						}
					).bind( "dragenter",
						function () {
							$.watermark._hide( $wm );
						}
					).bind( "dragend",
						function () {
							window.setTimeout( function () { $wm.blur(); }, 1 );
						}
					);
					
					$input.blur(
						function () {
							$.watermark._show( $input );
						}
					).bind( "dragleave",
						function () {
							$.watermark._show( $input );
						}
					);
					
					$wm.data( dataPassword, $input );
					$input.data( dataPassword, $wm );
				}
				else {
					
					$input.focus(
						function () {
							$input.data( dataFocus, 1 );
							$.watermark._hide( $input, true );
						}
					).blur(
						function () {
							$input.data( dataFocus, 0 );
							$.watermark._show( $input );
						}
					).bind( "dragenter",
						function () {
							$.watermark._hide( $input );
						}
					).bind( "dragleave",
						function () {
							$.watermark._show( $input );
						}
					).bind( "dragend",
						function () {
							window.setTimeout( function () { $.watermark._show($input); }, 1 );
						}
					).bind( "drop",
						// Firefox makes this lovely function necessary because the dropped text
						// is merged with the watermark before the drop event is called.
						function ( evt ) {
							var elem = $input[ 0 ],
								dropText = evt.originalEvent.dataTransfer.getData( "Text" );
							
							if ( ( elem.value || "" ).replace( rreturn, "" ).replace( dropText, "" ) === $input.data( dataText ) ) {
								elem.value = dropText;
							}
							
							$input.focus();
						}
					);
				}
				
				// In order to reliably clear all watermarks before form submission,
				// we need to replace the form's submit function with our own
				// function.  Otherwise watermarks won't be cleared when the form
				// is submitted programmatically.
				if ( this.form ) {
					var form = this.form,
						$form = $( form );
					
					if ( !$form.data( dataFormSubmit ) ) {
						$form.submit( $.watermark.hideAll );
						
						// form.submit exists for all browsers except Google Chrome
						// (see "else" below for explanation)
						if ( form.submit ) {
							$form.data( dataFormSubmit, form.submit );
							
							form.submit = ( function ( f, $f ) {
								return function () {
									var nativeSubmit = $f.data( dataFormSubmit );
									
									$.watermark.hideAll();
									
									if ( nativeSubmit.apply ) {
										nativeSubmit.apply( f, Array.prototype.slice.call( arguments ) );
									}
									else {
										nativeSubmit();
									}
								};
							})( form, $form );
						}
						else {
							$form.data( dataFormSubmit, 1 );
							
							// This strangeness is due to the fact that Google Chrome's
							// form.submit function is not visible to JavaScript (identifies
							// as "undefined").  I had to invent a solution here because hours
							// of Googling (ironically) for an answer did not turn up anything
							// useful.  Within my own form.submit function I delete the form's
							// submit function, and then call the non-existent function --
							// which, in the world of Google Chrome, still exists.
							form.submit = ( function ( f ) {
								return function () {
									$.watermark.hideAll();
									delete f.submit;
									f.submit();
								};
							})( form );
						}
					}
				}
			}
			
			$.watermark._show( $input );
		}
	);
};

// The code included within the following if structure is guaranteed to only run once,
// even if the watermark script file is included multiple times in the page.
if ( $.watermark.runOnce ) {
	$.watermark.runOnce = false;

	$.extend( $.expr[ ":" ], {

		// Extends jQuery with a custom selector - ":data(...)"
		// :data(<name>)  Includes elements that have a specific name defined in the jQuery data
		// collection. (Only the existence of the name is checked; the value is ignored.)
		// A more sophisticated version of the :data() custom selector originally part of this plugin
		// was removed for compatibility with jQuery UI. The original code can be found in the SVN
		// source listing in the file, "jquery.data.js".
		data: $.expr.createPseudo ?
			$.expr.createPseudo( function( dataName ) {
				return function( elem ) {
					return !!$.data( elem, dataName );
				};
			}) :
			// support: jQuery <1.8
			function( elem, i, match ) {
				return !!$.data( elem, match[ 3 ] );
			},

		// Extends jQuery with a custom selector - ":watermarkable"
		// Includes elements that can be watermarked, including textareas and most input elements
		// that accept text input.  It uses a "negative" test (i.e., testing for input types that DON'T
		// work) because the HTML spec states that you can basically use any type, and if it doesn't
		// recognize the type it will default to type=text.  So if we only looked for certain type attributes
		// we would fail to recognize non-standard types, which are still valid and watermarkable.
		watermarkable: function ( elem ) {
			var type,
				name = elem.nodeName;
			
			if ( name === "TEXTAREA" ) {
				return true;
			}
			
			if ( name !== "INPUT" ) {
				return false;
			}
			
			type = elem.getAttribute( "type" );
			
			return ( ( !type ) || ( !rInvalidType.test( type ) ) );
		}
	});

	// Overloads the jQuery .val() function to return the underlying input value on
	// watermarked input elements.  When .val() is being used to set values, this
	// function ensures watermarks are properly set/removed after the values are set.
	// Uses self-executing function to override the default jQuery function.
	( function ( valOld ) {

		$.fn.val = function () {
			var args = Array.prototype.slice.call( arguments );
			
			// Best practice: return immediately if empty matched set
			if ( !this.length ) {
				return args.length? this : undefined;
			}

			// If no args, then we're getting the value of the first element;
			// else we're setting values for all elements in matched set
			if ( !args.length ) {

				// If element is watermarked, get the underlying value;
				// else use native jQuery .val()
				if ( this.data( dataFlag ) ) {
					var v = ( this[ 0 ].value || "" ).replace( rreturn, "" );
					return ( v === ( this.data( dataText ) || "" ) )? "" : v;
				}
				else {
					return valOld.apply( this );
				}
			}
			else {
				valOld.apply( this, args );
				$.watermark.show( this );
				return this;
			}
		};

	})( $.fn.val );
	
	// Hijack any functions found in the triggerFns list
	if ( triggerFns.length ) {

		// Wait until DOM is ready before searching
		$( function () {
			var i, name, fn;
		
			for ( i = triggerFns.length - 1; i >= 0; i-- ) {
				name = triggerFns[ i ];
				fn = window[ name ];
				
				if ( typeof( fn ) === "function" ) {
					window[ name ] = ( function ( origFn ) {
						return function () {
							$.watermark.hideAll();
							return origFn.apply( null, Array.prototype.slice.call( arguments ) );
						};
					})( fn );
				}
			}
		});
	}

	$( window ).bind( "beforeunload", function () {
		if ( $.watermark.options.hideBeforeUnload ) {
			$.watermark.hideAll();
		}
	});
}

})( jQuery, window );
;
/*!
 * jQuery Cookie Plugin v1.3.1
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2013 Klaus Hartl
 * Released under the MIT license
 */
(function ($, document, undefined) {

	var pluses = /\+/g;

	function raw(s) {
		return s;
	}

	function decoded(s) {
		return unRfc2068(decodeURIComponent(s.replace(pluses, ' ')));
	}

	function unRfc2068(value) {
		if (value.indexOf('"') === 0) {
			// This is a quoted cookie as according to RFC2068, unescape
			value = value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
		}
		return value;
	}

	function fromJSON(value) {
		return config.json ? JSON.parse(value) : value;
	}

	var config = $.cookie = function (key, value, options) {

		// write
		if (value !== undefined) {
			options = $.extend({}, config.defaults, options);

			if (value === null) {
				options.expires = -1;
			}

			if (typeof options.expires === 'number') {
				var days = options.expires, t = options.expires = new Date();
				t.setDate(t.getDate() + days);
			}

			value = config.json ? JSON.stringify(value) : String(value);

			return (document.cookie = [
				encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
				options.path    ? '; path=' + options.path : '',
				options.domain  ? '; domain=' + options.domain : '',
				options.secure  ? '; secure' : ''
			].join(''));
		}

		// read
		var decode = config.raw ? raw : decoded;
		var cookies = document.cookie.split('; ');
		var result = key ? null : {};
		for (var i = 0, l = cookies.length; i < l; i++) {
			var parts = cookies[i].split('=');
			var name = decode(parts.shift());
			var cookie = decode(parts.join('='));

			if (key && key === name) {
				result = fromJSON(cookie);
				break;
			}

			if (!key) {
				result[name] = fromJSON(cookie);
			}
		}

		return result;
	};

	config.defaults = {};

	$.removeCookie = function (key, options) {
		if ($.cookie(key) !== null) {
			$.cookie(key, null, options);
			return true;
		}
		return false;
	};

})(jQuery, document);
;
/*
* jQuery File Download Plugin v1.4.2 
*
* http://www.johnculviner.com
*
* Copyright (c) 2013 - John Culviner
*
* Licensed under the MIT license:
*   http://www.opensource.org/licenses/mit-license.php
*
* !!!!NOTE!!!!
* You must also write a cookie in conjunction with using this plugin as mentioned in the orignal post:
* http://johnculviner.com/jquery-file-download-plugin-for-ajax-like-feature-rich-file-downloads/
* !!!!NOTE!!!!
*/

(function ($, window) {
    // i'll just put them here to get evaluated on script load
    var htmlSpecialCharsRegEx = /[<>&\r\n"']/gm;
    var htmlSpecialCharsPlaceHolders = {
        '<': 'lt;',
        '>': 'gt;',
        '&': 'amp;',
        '\r': "#13;",
        '\n': "#10;",
        '"': 'quot;',
        "'": 'apos;' /*single quotes just to be safe*/
    };

    $.extend({
        //
        //$.fileDownload('/path/to/url/', options)
        //  see directly below for possible 'options'
        fileDownload: function (fileUrl, options) {

            //provide some reasonable defaults to any unspecified options below
            var settings = $.extend({

                //
                //Requires jQuery UI: provide a message to display to the user when the file download is being prepared before the browser's dialog appears
                //
                preparingMessageHtml: null,

                //
                //Requires jQuery UI: provide a message to display to the user when a file download fails
                //
                failMessageHtml: null,

                //
                //the stock android browser straight up doesn't support file downloads initiated by a non GET: http://code.google.com/p/android/issues/detail?id=1780
                //specify a message here to display if a user tries with an android browser
                //if jQuery UI is installed this will be a dialog, otherwise it will be an alert
                //
                androidPostUnsupportedMessageHtml: "Unfortunately your Android browser doesn't support this type of file download. Please try again with a different browser.",

                //
                //Requires jQuery UI: options to pass into jQuery UI Dialog
                //
                dialogOptions: { modal: true },

                //
                //a function to call while the dowload is being prepared before the browser's dialog appears
                //Args:
                //  url - the original url attempted
                //
                prepareCallback: function (url) { },

                //
                //a function to call after a file download dialog/ribbon has appeared
                //Args:
                //  url - the original url attempted
                //
                successCallback: function (url) { },

                //
                //a function to call after a file download dialog/ribbon has appeared
                //Args:
                //  responseHtml    - the html that came back in response to the file download. this won't necessarily come back depending on the browser.
                //                      in less than IE9 a cross domain error occurs because 500+ errors cause a cross domain issue due to IE subbing out the
                //                      server's error message with a "helpful" IE built in message
                //  url             - the original url attempted
                //
                failCallback: function (responseHtml, url) { },

                //
                // the HTTP method to use. Defaults to "GET".
                //
                httpMethod: "GET",

                //
                // if specified will perform a "httpMethod" request to the specified 'fileUrl' using the specified data.
                // data must be an object (which will be $.param serialized) or already a key=value param string
                //
                data: null,

                //
                //a period in milliseconds to poll to determine if a successful file download has occured or not
                //
                checkInterval: 100,

                //
                //the cookie name to indicate if a file download has occured
                //
                cookieName: "fileDownload",

                //
                //the cookie value for the above name to indicate that a file download has occured
                //
                cookieValue: "true",

                //
                //the cookie path for above name value pair
                //
                cookiePath: "/",

                //
                //the title for the popup second window as a download is processing in the case of a mobile browser
                //
                popupWindowTitle: "Initiating file download...",

                //
                //Functionality to encode HTML entities for a POST, need this if data is an object with properties whose values contains strings with quotation marks.
                //HTML entity encoding is done by replacing all &,<,>,',",\r,\n characters.
                //Note that some browsers will POST the string htmlentity-encoded whilst others will decode it before POSTing.
                //It is recommended that on the server, htmlentity decoding is done irrespective.
                //
                encodeHTMLEntities: true

            }, options);

            var deferred = new $.Deferred();

            //Setup mobile browser detection: Partial credit: http://detectmobilebrowser.com/
            var userAgent = (navigator.userAgent || navigator.vendor || window.opera).toLowerCase();

            var isIos;                  //has full support of features in iOS 4.0+, uses a new window to accomplish this.
            var isAndroid;              //has full support of GET features in 4.0+ by using a new window. Non-GET is completely unsupported by the browser. See above for specifying a message.
            var isOtherMobileBrowser;   //there is no way to reliably guess here so all other mobile devices will GET and POST to the current window.

            if (/ip(ad|hone|od)/.test(userAgent)) {

                isIos = true;

            } else if (userAgent.indexOf('android') !== -1) {

                isAndroid = true;

            } else {

                isOtherMobileBrowser = /avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|playbook|silk|iemobile|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(userAgent.substr(0, 4));

            }

            var httpMethodUpper = settings.httpMethod.toUpperCase();

            if (isAndroid && httpMethodUpper !== "GET") {
                //the stock android browser straight up doesn't support file downloads initiated by non GET requests: http://code.google.com/p/android/issues/detail?id=1780

                if ($().dialog) {
                    $("<div>").html(settings.androidPostUnsupportedMessageHtml).dialog(settings.dialogOptions);
                } else {
                    alert(settings.androidPostUnsupportedMessageHtml);
                }

                return deferred.reject();
            }

            var $preparingDialog = null;

            var internalCallbacks = {

                onPrepare: function (url) {

                    //wire up a jquery dialog to display the preparing message if specified
                    if (settings.preparingMessageHtml) {

                        $preparingDialog = $("<div>").html(settings.preparingMessageHtml).dialog(settings.dialogOptions);

                    } else if (settings.prepareCallback) {

                        settings.prepareCallback(url);

                    }

                },

                onSuccess: function (url) {

                    //remove the perparing message if it was specified
                    if ($preparingDialog) {
                        $preparingDialog.dialog('close');
                    };

                    settings.successCallback(url);

                    deferred.resolve(url);
                },

                onFail: function (responseHtml, url) {

                    //remove the perparing message if it was specified
                    if ($preparingDialog) {
                        $preparingDialog.dialog('close');
                    };

                    //wire up a jquery dialog to display the fail message if specified
                    if (settings.failMessageHtml) {
                        $("<div>").html(settings.failMessageHtml).dialog(settings.dialogOptions);
                    }

                    settings.failCallback(responseHtml, url);

                    deferred.reject(responseHtml, url);
                }
            };

            internalCallbacks.onPrepare(fileUrl);

            //make settings.data a param string if it exists and isn't already
            if (settings.data !== null && typeof settings.data !== "string") {
                settings.data = $.param(settings.data);
            }


            var $iframe,
                downloadWindow,
                formDoc,
                $form;

            if (httpMethodUpper === "GET") {

                if (settings.data !== null) {
                    //need to merge any fileUrl params with the data object

                    var qsStart = fileUrl.indexOf('?');

                    if (qsStart !== -1) {
                        //we have a querystring in the url

                        if (fileUrl.substring(fileUrl.length - 1) !== "&") {
                            fileUrl = fileUrl + "&";
                        }
                    } else {

                        fileUrl = fileUrl + "?";
                    }

                    fileUrl = fileUrl + settings.data;
                }

                if (isIos || isAndroid) {

                    downloadWindow = window.open(fileUrl);
                    downloadWindow.document.title = settings.popupWindowTitle;
                    window.focus();

                } else if (isOtherMobileBrowser) {

                    window.location(fileUrl);

                } else {

                    //create a temporary iframe that is used to request the fileUrl as a GET request
                    $iframe = $("<iframe>")
                        .hide()
                        .prop("src", fileUrl)
                        .appendTo("body");
                }

            } else {

                var formInnerHtml = "";

                if (settings.data !== null) {

                    $.each(settings.data.replace(/\+/g, ' ').split("&"), function () {

                        var kvp = this.split("=");

                        var key = settings.encodeHTMLEntities ? htmlSpecialCharsEntityEncode(decodeURIComponent(kvp[0])) : decodeURIComponent(kvp[0]);
                        if (key) {
                            var value = settings.encodeHTMLEntities ? htmlSpecialCharsEntityEncode(decodeURIComponent(kvp[1])) : decodeURIComponent(kvp[1]);
                            formInnerHtml += '<input type="hidden" name="' + key + '" value="' + value + '" />';
                        }
                    });
                }

                if (isOtherMobileBrowser) {

                    $form = $("<form>").appendTo("body");
                    $form.hide()
                        .prop('method', settings.httpMethod)
                        .prop('action', fileUrl)
                        .html(formInnerHtml);

                } else {

                    if (isIos) {

                        downloadWindow = window.open("about:blank");
                        downloadWindow.document.title = settings.popupWindowTitle;
                        formDoc = downloadWindow.document;
                        window.focus();

                    } else {

                        $iframe = $("<iframe style='display: none' src='about:blank'></iframe>").appendTo("body");
                        formDoc = getiframeDocument($iframe);
                    }

                    formDoc.write("<html><head></head><body><form method='" + settings.httpMethod + "' action='" + fileUrl + "'>" + formInnerHtml + "</form>" + settings.popupWindowTitle + "</body></html>");
                    $form = $(formDoc).find('form');
                }

                $form.submit();
            }


            //check if the file download has completed every checkInterval ms
            setTimeout(checkFileDownloadComplete, settings.checkInterval);


            function checkFileDownloadComplete() {

                //has the cookie been written due to a file download occuring?
                if (document.cookie.indexOf(settings.cookieName + "=" + settings.cookieValue) != -1) {

                    //execute specified callback
                    internalCallbacks.onSuccess(fileUrl);

                    //remove the cookie and iframe
                    document.cookie = settings.cookieName + "=; expires=" + new Date(1000).toUTCString() + "; path=" + settings.cookiePath;

                    cleanUp(false);

                    return;
                }

                //has an error occured?
                //if neither containers exist below then the file download is occuring on the current window
                if (downloadWindow || $iframe) {

                    //has an error occured?
                    try {

                        var formDoc = downloadWindow ? downloadWindow.document : getiframeDocument($iframe);

                        if (formDoc && formDoc.body != null && formDoc.body.innerHTML.length) {

                            var isFailure = true;

                            if ($form && $form.length) {
                                var $contents = $(formDoc.body).contents().first();

                                if ($contents.length && $contents[0] === $form[0]) {
                                    isFailure = false;
                                }
                            }

                            if (isFailure) {
                                internalCallbacks.onFail(formDoc.body.innerHTML, fileUrl);

                                cleanUp(true);

                                return;
                            }
                        }
                    }
                    catch (err) {

                        //500 error less than IE9
                        internalCallbacks.onFail('', fileUrl);

                        cleanUp(true);

                        return;
                    }
                }


                //keep checking...
                setTimeout(checkFileDownloadComplete, settings.checkInterval);
            }

            //gets an iframes document in a cross browser compatible manner
            function getiframeDocument($iframe) {
                var iframeDoc = $iframe[0].contentWindow || $iframe[0].contentDocument;
                if (iframeDoc.document) {
                    iframeDoc = iframeDoc.document;
                }
                return iframeDoc;
            }

            function cleanUp(isFailure) {

                setTimeout(function () {

                    if (downloadWindow) {

                        if (isAndroid) {
                            downloadWindow.close();
                        }

                        if (isIos) {
                            downloadWindow.focus(); //ios safari bug doesn't allow a window to be closed unless it is focused
                            if (isFailure) {
                                downloadWindow.close();
                            }
                        }
                    }

                    //iframe cleanup appears to randomly cause the download to fail
                    //not doing it seems better than failure...
                    //if ($iframe) {
                    //    $iframe.remove();
                    //}

                }, 0);
            }


            function htmlSpecialCharsEntityEncode(str) {
                return str.replace(htmlSpecialCharsRegEx, function (match) {
                    return '&' + htmlSpecialCharsPlaceHolders[match];
                });
            }

            return deferred.promise();
        }
    });

})(jQuery, this);;
!function(e,define){define("kendo.core.min",["jquery"],e)}(function(){return function(e,t,n){function r(){}function o(e,t){if(t)return"'"+e.split("'").join("\\'").split('\\"').join('\\\\\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")+"'";var n=e.charAt(0),r=e.substring(1);return"="===n?"+("+r+")+":":"===n?"+$kendoHtmlEncode("+r+")+":";"+e+";$kendoOutput+="}function i(e,t,n){return e+="",t=t||2,n=t-e.length,n?W[t].substring(0,n)+e:e}function a(e){var t=e.css(ye.support.transitions.css+"box-shadow")||e.css("box-shadow"),n=t?t.match(De)||[0,0,0,0,0]:[0,0,0,0,0],r=Te.max(+n[3],+(n[4]||0));return{left:-n[1]+r,right:+n[1]+r,bottom:+n[2]+r}}function s(t,n){var r,o,i,s,u,l,c,d,f=ke.browser,m="rtl"==t.css("direction");return t.parent().hasClass("k-animation-container")?(c=t.parent(".k-animation-container"),d=c[0].style,c.is(":hidden")&&c.show(),r=Oe.test(d.width)||Oe.test(d.height),r||c.css({width:t.outerWidth(),height:t.outerHeight(),boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"})):(o=a(t),i=t[0].style.width,s=t[0].style.height,u=Oe.test(i),l=Oe.test(s),f.opera&&(o.left=o.right=o.bottom=5),r=u||l,!u&&(!n||n&&i)&&(i=t.outerWidth()),!l&&(!n||n&&s)&&(s=t.outerHeight()),t.wrap(e("<div/>").addClass("k-animation-container").css({width:i,height:s,marginLeft:o.left*(m?1:-1),paddingLeft:o.left,paddingRight:o.right,paddingBottom:o.bottom})),r&&t.css({width:"100%",height:"100%",boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"})),f.msie&&Te.floor(f.version)<=7&&(t.css({zoom:1}),t.children(".k-menu").width(t.width())),t.parent()}function u(e){var t=1,n=arguments.length;for(t=1;n>t;t++)l(e,arguments[t]);return e}function l(e,t){var n,r,o,i,a,s=ye.data.ObservableArray,u=ye.data.LazyObservableArray,c=ye.data.DataSource,d=ye.data.HierarchicalDataSource;for(n in t)r=t[n],o=typeof r,i=o===_e&&null!==r?r.constructor:null,i&&i!==Array&&i!==s&&i!==u&&i!==c&&i!==d?r instanceof Date?e[n]=new Date(r.getTime()):A(r.clone)?e[n]=r.clone():(a=e[n],e[n]=typeof a===_e?a||{}:{},l(e[n],r)):o!==Fe&&(e[n]=r);return e}function c(e,t,r){for(var o in t)if(t.hasOwnProperty(o)&&t[o].test(e))return o;return r!==n?r:e}function d(e){return e.replace(/([a-z][A-Z])/g,function(e){return e.charAt(0)+"-"+e.charAt(1).toLowerCase()})}function f(e){return e.replace(/\-(\w)/g,function(e,t){return t.toUpperCase()})}function m(t,n){var r,o={};return document.defaultView&&document.defaultView.getComputedStyle?(r=document.defaultView.getComputedStyle(t,""),n&&e.each(n,function(e,t){o[t]=r.getPropertyValue(t)})):(r=t.currentStyle,n&&e.each(n,function(e,t){o[t]=r[f(t)]})),ye.size(o)||(o=r),o}function p(e){if(e&&e.className&&"string"==typeof e.className&&e.className.indexOf("k-auto-scrollable")>-1)return!0;var t=m(e,["overflow"]).overflow;return"auto"==t||"scroll"==t}function h(t,r){var o,i=ke.browser.webkit,a=ke.browser.mozilla,s=t instanceof e?t[0]:t;if(t)return o=ke.isRtl(t),r===n?o&&i?s.scrollWidth-s.clientWidth-s.scrollLeft:Math.abs(s.scrollLeft):(s.scrollLeft=o&&i?s.scrollWidth-s.clientWidth-r:o&&a?-r:r,n)}function g(e){var t,n=0;for(t in e)e.hasOwnProperty(t)&&"toJSON"!=t&&n++;return n}function y(e,n,r){n||(n="offset");var o=e[n]();return ke.browser.msie&&(ke.pointers||ke.msPointers)&&!r&&(o.top-=t.pageYOffset-document.documentElement.scrollTop,o.left-=t.pageXOffset-document.documentElement.scrollLeft),o}function v(e){var t={};return be("string"==typeof e?e.split(" "):e,function(e){t[e]=this}),t}function b(e){return new ye.effects.Element(e)}function w(e,t,n,r){return typeof e===He&&(A(t)&&(r=t,t=400,n=!1),A(n)&&(r=n,n=!1),typeof t===Pe&&(n=t,t=400),e={effects:e,duration:t,reverse:n,complete:r}),ve({effects:{},duration:400,reverse:!1,init:Se,teardown:Se,hide:!1},e,{completeCallback:e.complete,complete:Se})}function M(t,n,r,o,i){for(var a,s=0,u=t.length;u>s;s++)a=e(t[s]),a.queue(function(){j.promise(a,w(n,r,o,i))});return t}function S(e,t,n,r){return t&&(t=t.split(" "),be(t,function(t,n){e.toggleClass(n,r)})),e}function T(e){return(""+e).replace(J,"&amp;").replace(Y,"&lt;").replace(G,"&gt;").replace(q,"&quot;").replace(V,"&#39;")}function x(e,t){var r;return 0===t.indexOf("data")&&(t=t.substring(4),t=t.charAt(0).toLowerCase()+t.substring(1)),t=t.replace(oe,"-$1"),r=e.getAttribute("data-"+ye.ns+t),null===r?r=n:"null"===r?r=null:"true"===r?r=!0:"false"===r?r=!1:Ce.test(r)?r=parseFloat(r):ne.test(r)&&!re.test(r)&&(r=Function("return ("+r+")")()),r}function k(t,r){var o,i,a={};for(o in r)i=x(t,o),i!==n&&(te.test(o)&&(i=ye.template(e("#"+i).html())),a[o]=i);return a}function O(t,n){return e.contains(t,n)?-1:1}function z(){var t=e(this);return e.inArray(t.attr("data-"+ye.ns+"role"),["slider","rangeslider"])>-1||t.is(":visible")}function D(e,t){var n=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(n)?!e.disabled:"a"===n?e.href||t:t)&&C(e)}function C(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function E(e,t){return new E.fn.init(e,t)}var H,A,_,N,P,F,R,I,U,$,L,W,B,j,J,Y,q,V,G,K,Q,Z,X,ee,te,ne,re,oe,ie,ae,se,ue,le,ce,de,fe,me,pe,he,ge,ye=t.kendo=t.kendo||{cultures:{}},ve=e.extend,be=e.each,we=e.isArray,Me=e.proxy,Se=e.noop,Te=Math,xe=t.JSON||{},ke={},Oe=/%/,ze=/\{(\d+)(:[^\}]+)?\}/g,De=/(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+)?/i,Ce=/^(\+|-?)\d+(\.?)\d*$/,Ee="function",He="string",Ae="number",_e="object",Ne="null",Pe="boolean",Fe="undefined",Re={},Ie={},Ue=[].slice;ye.version="2016.1.226".replace(/^\s+|\s+$/g,""),r.extend=function(e){var t,n,r=function(){},o=this,i=e&&e.init?e.init:function(){o.apply(this,arguments)};r.prototype=o.prototype,n=i.fn=i.prototype=new r;for(t in e)n[t]=null!=e[t]&&e[t].constructor===Object?ve(!0,{},r.prototype[t],e[t]):e[t];return n.constructor=i,i.extend=o.extend,i},r.prototype._initOptions=function(e){this.options=u({},this.options,e)},A=ye.isFunction=function(e){return"function"==typeof e},_=function(){this._defaultPrevented=!0},N=function(){return this._defaultPrevented===!0},P=r.extend({init:function(){this._events={}},bind:function(e,t,r){var o,i,a,s,u,l=this,c=typeof e===He?[e]:e,d=typeof t===Ee;if(t===n){for(o in e)l.bind(o,e[o]);return l}for(o=0,i=c.length;i>o;o++)e=c[o],s=d?t:t[e],s&&(r&&(a=s,s=function(){l.unbind(e,s),a.apply(l,arguments)},s.original=a),u=l._events[e]=l._events[e]||[],u.push(s));return l},one:function(e,t){return this.bind(e,t,!0)},first:function(e,t){var n,r,o,i,a=this,s=typeof e===He?[e]:e,u=typeof t===Ee;for(n=0,r=s.length;r>n;n++)e=s[n],o=u?t:t[e],o&&(i=a._events[e]=a._events[e]||[],i.unshift(o));return a},trigger:function(e,t){var n,r,o=this,i=o._events[e];if(i){for(t=t||{},t.sender=o,t._defaultPrevented=!1,t.preventDefault=_,t.isDefaultPrevented=N,i=i.slice(),n=0,r=i.length;r>n;n++)i[n].call(o,t);return t._defaultPrevented===!0}return!1},unbind:function(e,t){var r,o=this,i=o._events[e];if(e===n)o._events={};else if(i)if(t)for(r=i.length-1;r>=0;r--)(i[r]===t||i[r].original===t)&&i.splice(r,1);else o._events[e]=[];return o}}),F=/^\w+/,R=/\$\{([^}]*)\}/g,I=/\\\}/g,U=/__CURLY__/g,$=/\\#/g,L=/__SHARP__/g,W=["","0","00","000","0000"],H={paramName:"data",useWithBlock:!0,render:function(e,t){var n,r,o="";for(n=0,r=t.length;r>n;n++)o+=e(t[n]);return o},compile:function(e,t){var n,r,i,a=ve({},this,t),s=a.paramName,u=s.match(F)[0],l=a.useWithBlock,c="var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;";if(A(e))return e;for(c+=l?"with("+s+"){":"",c+="$kendoOutput=",r=e.replace(I,"__CURLY__").replace(R,"#=$kendoHtmlEncode($1)#").replace(U,"}").replace($,"__SHARP__").split("#"),i=0;r.length>i;i++)c+=o(r[i],i%2===0);c+=l?";}":";",c+="return $kendoOutput;",c=c.replace(L,"#");try{return n=Function(u,c),n._slotCount=Math.floor(r.length/2),n}catch(d){throw Error(ye.format("Invalid template:'{0}' Generated code:'{1}'",e,c))}}},function(){function e(e){return a.lastIndex=0,a.test(e)?'"'+e.replace(a,function(e){var t=s[e];return typeof t===He?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function t(i,a){var s,l,c,d,f,m,p=n,h=a[i];if(h&&typeof h===_e&&typeof h.toJSON===Ee&&(h=h.toJSON(i)),typeof o===Ee&&(h=o.call(a,i,h)),m=typeof h,m===He)return e(h);if(m===Ae)return isFinite(h)?h+"":Ne;if(m===Pe||m===Ne)return h+"";if(m===_e){if(!h)return Ne;if(n+=r,f=[],"[object Array]"===u.apply(h)){for(d=h.length,s=0;d>s;s++)f[s]=t(s,h)||Ne;return c=0===f.length?"[]":n?"[\n"+n+f.join(",\n"+n)+"\n"+p+"]":"["+f.join(",")+"]",n=p,c}if(o&&typeof o===_e)for(d=o.length,s=0;d>s;s++)typeof o[s]===He&&(l=o[s],c=t(l,h),c&&f.push(e(l)+(n?": ":":")+c));else for(l in h)Object.hasOwnProperty.call(h,l)&&(c=t(l,h),c&&f.push(e(l)+(n?": ":":")+c));return c=0===f.length?"{}":n?"{\n"+n+f.join(",\n"+n)+"\n"+p+"}":"{"+f.join(",")+"}",n=p,c}}var n,r,o,a=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},u={}.toString;typeof Date.prototype.toJSON!==Ee&&(Date.prototype.toJSON=function(){var e=this;return isFinite(e.valueOf())?i(e.getUTCFullYear(),4)+"-"+i(e.getUTCMonth()+1)+"-"+i(e.getUTCDate())+"T"+i(e.getUTCHours())+":"+i(e.getUTCMinutes())+":"+i(e.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}),typeof xe.stringify!==Ee&&(xe.stringify=function(e,i,a){var s;if(n="",r="",typeof a===Ae)for(s=0;a>s;s+=1)r+=" ";else typeof a===He&&(r=a);if(o=i,i&&typeof i!==Ee&&(typeof i!==_e||typeof i.length!==Ae))throw Error("JSON.stringify");return t("",{"":e})})}(),function(){function e(e){if(e){if(e.numberFormat)return e;if(typeof e===He){var t=ye.cultures;return t[e]||t[e.split("-")[0]]||null}return null}return null}function t(t){return t&&(t=e(t)),t||ye.cultures.current}function r(e,r,o){o=t(o);var a=o.calendars.standard,s=a.days,u=a.months;return r=a.patterns[r]||r,r.replace(l,function(t){var r,o,l;return"d"===t?o=e.getDate():"dd"===t?o=i(e.getDate()):"ddd"===t?o=s.namesAbbr[e.getDay()]:"dddd"===t?o=s.names[e.getDay()]:"M"===t?o=e.getMonth()+1:"MM"===t?o=i(e.getMonth()+1):"MMM"===t?o=u.namesAbbr[e.getMonth()]:"MMMM"===t?o=u.names[e.getMonth()]:"yy"===t?o=i(e.getFullYear()%100):"yyyy"===t?o=i(e.getFullYear(),4):"h"===t?o=e.getHours()%12||12:"hh"===t?o=i(e.getHours()%12||12):"H"===t?o=e.getHours():"HH"===t?o=i(e.getHours()):"m"===t?o=e.getMinutes():"mm"===t?o=i(e.getMinutes()):"s"===t?o=e.getSeconds():"ss"===t?o=i(e.getSeconds()):"f"===t?o=Te.floor(e.getMilliseconds()/100):"ff"===t?(o=e.getMilliseconds(),o>99&&(o=Te.floor(o/10)),o=i(o)):"fff"===t?o=i(e.getMilliseconds(),3):"tt"===t?o=e.getHours()<12?a.AM[0]:a.PM[0]:"zzz"===t?(r=e.getTimezoneOffset(),l=0>r,o=(""+Te.abs(r/60)).split(".")[0],r=Te.abs(r)-60*o,o=(l?"+":"-")+i(o),o+=":"+i(r)):("zz"===t||"z"===t)&&(o=e.getTimezoneOffset()/60,l=0>o,o=(""+Te.abs(o)).split(".")[0],o=(l?"+":"-")+("zz"===t?i(o):o)),o!==n?o:t.slice(1,t.length-1)})}function o(e,r,o){o=t(o);var i,u,l,b,w,M,S,T,x,k,O,z,D,C,E,H,A,_,N,P,F,R,I,U=o.numberFormat,$=U[p],L=U.decimals,W=U.pattern[0],B=[],j=0>e,J=m,Y=m,q=-1;if(e===n)return m;if(!isFinite(e))return e;if(!r)return o.name.length?e.toLocaleString():""+e;if(w=c.exec(r)){if(r=w[1].toLowerCase(),u="c"===r,l="p"===r,(u||l)&&(U=u?U.currency:U.percent,$=U[p],L=U.decimals,i=U.symbol,W=U.pattern[j?0:1]),b=w[2],b&&(L=+b),"e"===r)return b?e.toExponential(L):e.toExponential();if(l&&(e*=100),e=s(e,L),j=0>e,e=e.split(p),M=e[0],S=e[1],j&&(M=M.substring(1)),Y=a(M,0,M.length,U),S&&(Y+=$+S),"n"===r&&!j)return Y;for(e=m,k=0,O=W.length;O>k;k++)z=W.charAt(k),e+="n"===z?Y:"$"===z||"%"===z?i:z;return e}if(j&&(e=-e),(r.indexOf("'")>-1||r.indexOf('"')>-1||r.indexOf("\\")>-1)&&(r=r.replace(d,function(e){var t=e.charAt(0).replace("\\",""),n=e.slice(1).replace(t,"");return B.push(n),v})),r=r.split(";"),j&&r[1])r=r[1],C=!0;else if(0===e){if(r=r[2]||r[0],-1==r.indexOf(g)&&-1==r.indexOf(y))return r}else r=r[0];if(P=r.indexOf("%"),F=r.indexOf("$"),l=-1!=P,u=-1!=F,l&&(e*=100),u&&"\\"===r[F-1]&&(r=r.split("\\").join(""),u=!1),(u||l)&&(U=u?U.currency:U.percent,$=U[p],L=U.decimals,i=U.symbol),D=r.indexOf(h)>-1,D&&(r=r.replace(f,m)),E=r.indexOf(p),O=r.length,-1!=E?(S=(""+e).split("e"),S=S[1]?s(e,Math.abs(S[1])):S[0],S=S.split(p)[1]||m,A=r.lastIndexOf(y)-E,H=r.lastIndexOf(g)-E,_=A>-1,N=H>-1,k=S.length,_||N||(r=r.substring(0,E)+r.substring(E+1),O=r.length,E=-1,k=0),_&&A>H?k=A:H>A&&(N&&k>H?k=H:_&&A>k&&(k=A)),k>-1&&(e=s(e,k))):e=s(e),H=r.indexOf(g),R=A=r.indexOf(y),q=-1==H&&-1!=A?A:-1!=H&&-1==A?H:H>A?A:H,H=r.lastIndexOf(g),A=r.lastIndexOf(y),I=-1==H&&-1!=A?A:-1!=H&&-1==A?H:H>A?H:A,q==O&&(I=q),-1!=q){for(Y=(""+e).split(p),M=Y[0],S=Y[1]||m,T=M.length,x=S.length,j&&-1*e>=0&&(j=!1),e=r.substring(0,q),j&&!C&&(e+="-"),k=q;O>k;k++){if(z=r.charAt(k),-1==E){if(T>I-k){e+=M;break}}else if(-1!=A&&k>A&&(J=m),T>=E-k&&E-k>-1&&(e+=M,k=E),E===k){e+=(S?$:m)+S,k+=I-E+1;continue}z===y?(e+=z,J=z):z===g&&(e+=J)}if(D&&(e=a(e,q,I,U)),I>=q&&(e+=r.substring(I+1)),u||l){for(Y=m,k=0,O=e.length;O>k;k++)z=e.charAt(k),Y+="$"===z||"%"===z?i:z;e=Y}if(O=B.length)for(k=0;O>k;k++)e=e.replace(v,B[k])}return e}var a,s,u,l=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|HH|H|hh|h|mm|m|fff|ff|f|tt|ss|s|zzz|zz|z|"[^"]*"|'[^']*'/g,c=/^(n|c|p|e)(\d*)$/i,d=/(\\.)|(['][^']*[']?)|(["][^"]*["]?)/g,f=/\,/g,m="",p=".",h=",",g="#",y="0",v="??",b="en-US",w={}.toString;ye.cultures["en-US"]={name:b,numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSize:[3],percent:{pattern:["-n %","n %"],decimals:2,",":",",".":".",groupSize:[3],symbol:"%"},currency:{name:"US Dollar",abbr:"USD",pattern:["($n)","$n"],decimals:2,",":",",".":".",groupSize:[3],symbol:"$"}},calendars:{standard:{days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December"],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},AM:["AM","am","AM"],PM:["PM","pm","PM"],patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",F:"dddd, MMMM dd, yyyy h:mm:ss tt",g:"M/d/yyyy h:mm tt",G:"M/d/yyyy h:mm:ss tt",m:"MMMM dd",M:"MMMM dd",s:"yyyy'-'MM'-'ddTHH':'mm':'ss",t:"h:mm tt",T:"h:mm:ss tt",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM, yyyy",Y:"MMMM, yyyy"},"/":"/",":":":",firstDay:0,twoDigitYearMax:2029}}},ye.culture=function(t){var r,o=ye.cultures;return t===n?o.current:(r=e(t)||o[b],r.calendar=r.calendars.standard,o.current=r,n)},ye.findCulture=e,ye.getCulture=t,ye.culture(b),a=function(e,t,r,o){var i,a,s,u,l,c,d=e.indexOf(o[p]),f=o.groupSize.slice(),m=f.shift();if(r=-1!==d?d:r+1,i=e.substring(t,r),a=i.length,a>=m){for(s=a,u=[];s>-1;)if(l=i.substring(s-m,s),l&&u.push(l),s-=m,c=f.shift(),m=c!==n?c:m,0===m){u.push(i.substring(0,s));break}i=u.reverse().join(o[h]),e=e.substring(0,t)+i+e.substring(r)}return e},s=function(e,t){return t=t||0,e=(""+e).split("e"),e=Math.round(+(e[0]+"e"+(e[1]?+e[1]+t:t))),e=(""+e).split("e"),e=+(e[0]+"e"+(e[1]?+e[1]-t:-t)),e.toFixed(t)},u=function(e,t,i){if(t){if("[object Date]"===w.call(e))return r(e,t,i);if(typeof e===Ae)return o(e,t,i)}return e!==n?e:""},ye.format=function(e){var t=arguments;return e.replace(ze,function(e,n,r){var o=t[parseInt(n,10)+1];return u(o,r?r.substring(1):"")})},ye._extractFormat=function(e){return"{0:"===e.slice(0,3)&&(e=e.slice(3,e.length-1)),e},ye._activeElement=function(){try{return document.activeElement}catch(e){return document.documentElement.activeElement}},ye._round=s,ye.toString=u}(),function(){function t(e,t,n){return!(e>=t&&n>=e)}function r(e){return e.charAt(0)}function o(t){return e.map(t,r)}function i(e,t){t||23!==e.getHours()||e.setHours(e.getHours()+2)}function a(e){for(var t=0,n=e.length,r=[];n>t;t++)r[t]=(e[t]+"").toLowerCase();return r}function s(e){var t,n={};for(t in e)n[t]=a(e[t]);return n}function u(e,r,a){if(!e)return null;var u,l,c,d,p,h,g,v,b,w,M,S,T,x=function(e){for(var t=0;r[F]===e;)t++,F++;return t>0&&(F-=1),t},k=function(t){var n=y[t]||RegExp("^\\d{1,"+t+"}"),r=e.substr(R,t).match(n);return r?(r=r[0],R+=r.length,parseInt(r,10)):null},O=function(t,n){for(var r,o,i,a=0,s=t.length,u=0,l=0;s>a;a++)r=t[a],o=r.length,i=e.substr(R,o),n&&(i=i.toLowerCase()),i==r&&o>u&&(u=o,l=a);return u?(R+=u,l+1):null},z=function(){var t=!1;return e.charAt(R)===r[F]&&(R++,t=!0),t},D=a.calendars.standard,C=null,E=null,H=null,A=null,_=null,N=null,P=null,F=0,R=0,I=!1,U=new Date,$=D.twoDigitYearMax||2029,L=U.getFullYear();for(r||(r="d"),d=D.patterns[r],d&&(r=d),r=r.split(""),c=r.length;c>F;F++)if(u=r[F],I)"'"===u?I=!1:z();else if("d"===u){if(l=x("d"),D._lowerDays||(D._lowerDays=s(D.days)),null!==H&&l>2)continue;if(H=3>l?k(2):O(D._lowerDays[3==l?"namesAbbr":"names"],!0),null===H||t(H,1,31))return null}else if("M"===u){if(l=x("M"),D._lowerMonths||(D._lowerMonths=s(D.months)),E=3>l?k(2):O(D._lowerMonths[3==l?"namesAbbr":"names"],!0),null===E||t(E,1,12))return null;E-=1}else if("y"===u){if(l=x("y"),C=k(l),null===C)return null;2==l&&("string"==typeof $&&($=L+parseInt($,10)),C=L-L%100+C,C>$&&(C-=100))}else if("h"===u){if(x("h"),A=k(2),12==A&&(A=0),null===A||t(A,0,11))return null}else if("H"===u){if(x("H"),A=k(2),null===A||t(A,0,23))return null}else if("m"===u){if(x("m"),_=k(2),null===_||t(_,0,59))return null}else if("s"===u){if(x("s"),N=k(2),null===N||t(N,0,59))return null}else if("f"===u){if(l=x("f"),T=e.substr(R,l).match(y[3]),P=k(l),null!==P&&(P=parseFloat("0."+T[0],10),P=ye._round(P,3),P*=1e3),null===P||t(P,0,999))return null}else if("t"===u){if(l=x("t"),v=D.AM,b=D.PM,1===l&&(v=o(v),b=o(b)),p=O(b),!p&&!O(v))return null}else if("z"===u){if(h=!0,l=x("z"),"Z"===e.substr(R,1)){z();continue}if(g=e.substr(R,6).match(l>2?m:f),!g)return null;if(g=g[0].split(":"),w=g[0],M=g[1],!M&&w.length>3&&(R=w.length-2,M=w.substring(R),w=w.substring(0,R)),w=parseInt(w,10),t(w,-12,13))return null;if(l>2&&(M=parseInt(M,10),isNaN(M)||t(M,0,59)))return null}else if("'"===u)I=!0,z();else if(!z())return null;return S=null!==A||null!==_||N||null,null===C&&null===E&&null===H&&S?(C=L,E=U.getMonth(),H=U.getDate()):(null===C&&(C=L),null===H&&(H=1)),p&&12>A&&(A+=12),h?(w&&(A+=-w),M&&(_+=-M),e=new Date(Date.UTC(C,E,H,A,_,N,P))):(e=new Date(C,E,H,A,_,N,P),i(e,A)),100>C&&e.setFullYear(C),e.getDate()!==H&&h===n?null:e}function l(e){var t="-"===e.substr(0,1)?-1:1;return e=e.substring(1),e=60*parseInt(e.substr(0,2),10)+parseInt(e.substring(2),10),t*e}var c=/\u00A0/g,d=/[eE][\-+]?[0-9]+/,f=/[+|\-]\d{1,2}/,m=/[+|\-]\d{1,2}:?\d{2}/,p=/^\/Date\((.*?)\)\/$/,h=/[+-]\d*/,g=["G","g","d","F","D","y","m","T","t"],y={2:/^\d{1,2}/,3:/^\d{1,3}/,4:/^\d{4}/},v={}.toString;ye.parseDate=function(e,t,n){var r,o,i,a,s;if("[object Date]"===v.call(e))return e;if(r=0,o=null,e&&0===e.indexOf("/D")&&(o=p.exec(e)))return o=o[1],s=h.exec(o.substring(1)),o=new Date(parseInt(o,10)),s&&(s=l(s[0]),o=ye.timezone.apply(o,0),o=ye.timezone.convert(o,0,-1*s)),o;if(n=ye.getCulture(n),!t){for(t=[],a=n.calendar.patterns,i=g.length;i>r;r++)t[r]=a[g[r]];r=0,t=["yyyy/MM/dd HH:mm:ss","yyyy/MM/dd HH:mm","yyyy/MM/dd","ddd MMM dd yyyy HH:mm:ss","yyyy-MM-ddTHH:mm:ss.fffffffzzz","yyyy-MM-ddTHH:mm:ss.fffzzz","yyyy-MM-ddTHH:mm:sszzz","yyyy-MM-ddTHH:mm:ss.fffffff","yyyy-MM-ddTHH:mm:ss.fff","yyyy-MM-ddTHH:mmzzz","yyyy-MM-ddTHH:mmzz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","yyyy-MM-dd","HH:mm:ss","HH:mm"].concat(t)}for(t=we(t)?t:[t],i=t.length;i>r;r++)if(o=u(e,t[r],n))return o;return o},ye.parseInt=function(e,t){var n=ye.parseFloat(e,t);return n&&(n=0|n),n},ye.parseFloat=function(e,t,n){if(!e&&0!==e)return null;if(typeof e===Ae)return e;e=""+e,t=ye.getCulture(t);var r,o,i=t.numberFormat,a=i.percent,s=i.currency,u=s.symbol,l=a.symbol,f=e.indexOf("-");return d.test(e)?(e=parseFloat(e.replace(i["."],".")),isNaN(e)&&(e=null),e):f>0?null:(f=f>-1,e.indexOf(u)>-1||n&&n.toLowerCase().indexOf("c")>-1?(i=s,r=i.pattern[0].replace("$",u).split("n"),e.indexOf(r[0])>-1&&e.indexOf(r[1])>-1&&(e=e.replace(r[0],"").replace(r[1],""),f=!0)):e.indexOf(l)>-1&&(o=!0,i=a,u=l),e=e.replace("-","").replace(u,"").replace(c," ").split(i[","].replace(c," ")).join("").replace(i["."],"."),e=parseFloat(e),isNaN(e)?e=null:f&&(e*=-1),e&&o&&(e/=100),e)}}(),function(){var r,o,i,a,s,u,l;ke._scrollbar=n,ke.scrollbar=function(e){if(isNaN(ke._scrollbar)||e){var t,n=document.createElement("div");return n.style.cssText="overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block",n.innerHTML="&nbsp;",document.body.appendChild(n),ke._scrollbar=t=n.offsetWidth-n.scrollWidth,document.body.removeChild(n),t}return ke._scrollbar},ke.isRtl=function(t){return e(t).closest(".k-rtl").length>0},r=document.createElement("table");try{r.innerHTML="<tr><td></td></tr>",ke.tbodyInnerHtml=!0}catch(d){ke.tbodyInnerHtml=!1}ke.touch="ontouchstart"in t,ke.msPointers=t.MSPointerEvent,ke.pointers=t.PointerEvent,o=ke.transitions=!1,i=ke.transforms=!1,a="HTMLElement"in t?HTMLElement.prototype:[],ke.hasHW3D="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix||"MozPerspective"in document.documentElement.style||"msPerspective"in document.documentElement.style,be(["Moz","webkit","O","ms"],function(){var e,t=""+this,a=typeof r.style[t+"Transition"]===He;return a||typeof r.style[t+"Transform"]===He?(e=t.toLowerCase(),i={css:"ms"!=e?"-"+e+"-":"",prefix:t,event:"o"===e||"webkit"===e?e:""},a&&(o=i,o.event=o.event?o.event+"TransitionEnd":"transitionend"),!1):n}),r=null,ke.transforms=i,ke.transitions=o,ke.devicePixelRatio=t.devicePixelRatio===n?1:t.devicePixelRatio;try{ke.screenWidth=t.outerWidth||t.screen?t.screen.availWidth:t.innerWidth,ke.screenHeight=t.outerHeight||t.screen?t.screen.availHeight:t.innerHeight}catch(d){ke.screenWidth=t.screen.availWidth,ke.screenHeight=t.screen.availHeight}ke.detectOS=function(e){var n,r,o=!1,i=[],a=!/mobile safari/i.test(e),s={wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)\.(\d+(\.\d+)?)/,iphone:/(iPhone|iPod).*OS\s+(\d+)[\._]([\d\._]+)/,ipad:/(iPad).*OS\s+(\d+)[\._]([\d_]+)/,meego:/(MeeGo).+NokiaBrowser\/(\d+)\.([\d\._]+)/,webos:/(webOS)\/(\d+)\.(\d+(\.\d+)?)/,blackberry:/(BlackBerry|BB10).*?Version\/(\d+)\.(\d+(\.\d+)?)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i,ffos:/(Mobile).*rv:(\d+)\.(\d+(\.\d+)?).*Firefox/},u={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,blackberry:/^blackberry|playbook/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i,meego:/meego/},l={tablet:/playbook|ipad|fire/i},d={omini:/Opera\sMini/i,omobile:/Opera\sMobi/i,firefox:/Firefox|Fennec/i,mobilesafari:/version\/.*safari/i,ie:/MSIE|Windows\sPhone/i,chrome:/chrome|crios/i,webkit:/webkit/i};for(r in s)if(s.hasOwnProperty(r)&&(i=e.match(s[r]))){if("windows"==r&&"plugins"in navigator)return!1;o={},o.device=r,o.tablet=c(r,l,!1),o.browser=c(e,d,"default"),o.name=c(r,u),o[o.name]=!0,o.majorVersion=i[2],o.minorVersion=i[3].replace("_","."),n=o.minorVersion.replace(".","").substr(0,2),o.flatVersion=o.majorVersion+n+Array(3-(3>n.length?n.length:2)).join("0"),o.cordova=typeof t.PhoneGap!==Fe||typeof t.cordova!==Fe,o.appMode=t.navigator.standalone||/file|local|wmapp/.test(t.location.protocol)||o.cordova,o.android&&(1.5>ke.devicePixelRatio&&400>o.flatVersion||a)&&(ke.screenWidth>800||ke.screenHeight>800)&&(o.tablet=r);break}return o},s=ke.mobileOS=ke.detectOS(navigator.userAgent),ke.wpDevicePixelRatio=s.wp?screen.width/320:0,ke.kineticScrollNeeded=s&&(ke.touch||ke.msPointers||ke.pointers),ke.hasNativeScrolling=!1,(s.ios||s.android&&s.majorVersion>2||s.wp)&&(ke.hasNativeScrolling=s),ke.delayedClick=function(){if(ke.touch){if(s.ios)return!0;if(s.android)return ke.browser.chrome?32>ke.browser.version?!1:!(e("meta[name=viewport]").attr("content")||"").match(/user-scalable=no/i):!0}return!1},ke.mouseAndTouchPresent=ke.touch&&!(ke.mobileOS.ios||ke.mobileOS.android),ke.detectBrowser=function(e){var t,n=!1,r=[],o={edge:/(edge)[ \/]([\w.]+)/i,webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+)|)/i};for(t in o)if(o.hasOwnProperty(t)&&(r=e.match(o[t]))){n={},n[t]=!0,n[r[1].toLowerCase().split(" ")[0].split("/")[0]]=!0,n.version=parseInt(document.documentMode||r[2],10);break}return n},ke.browser=ke.detectBrowser(navigator.userAgent),ke.detectClipboardAccess=function(){var e={copy:document.queryCommandSupported?document.queryCommandSupported("copy"):!1,cut:document.queryCommandSupported?document.queryCommandSupported("cut"):!1,paste:document.queryCommandSupported?document.queryCommandSupported("paste"):!1};return ke.browser.chrome&&ke.browser.version>=43&&(e.copy=!0,e.cut=!0),e},ke.clipboard=ke.detectClipboardAccess(),ke.zoomLevel=function(){var e,n,r;try{return e=ke.browser,n=0,r=document.documentElement,e.msie&&11==e.version&&r.scrollHeight>r.clientHeight&&!ke.touch&&(n=ke.scrollbar()),ke.touch?r.clientWidth/t.innerWidth:e.msie&&e.version>=10?((top||t).document.documentElement.offsetWidth+n)/(top||t).innerWidth:1}catch(o){return 1}},ke.cssBorderSpacing=n!==document.documentElement.style.borderSpacing&&!(ke.browser.msie&&8>ke.browser.version),function(t){var n="",r=e(document.documentElement),o=parseInt(t.version,10);t.msie?n="ie":t.mozilla?n="ff":t.safari?n="safari":t.webkit?n="webkit":t.opera?n="opera":t.edge&&(n="edge"),n&&(n="k-"+n+" k-"+n+o),ke.mobileOS&&(n+=" k-mobile"),r.addClass(n)}(ke.browser),ke.eventCapture=document.documentElement.addEventListener,u=document.createElement("input"),ke.placeholder="placeholder"in u,ke.propertyChangeEvent="onpropertychange"in u,ke.input=function(){for(var e,t=["number","date","time","month","week","datetime","datetime-local"],n=t.length,r="test",o={},i=0;n>i;i++)e=t[i],u.setAttribute("type",e),u.value=r,o[e.replace("-","")]="text"!==u.type&&u.value!==r;return o}(),u.style.cssText="float:left;",ke.cssFloat=!!u.style.cssFloat,u=null,ke.stableSort=function(){var e,t=513,n=[{index:0,field:"b"}];for(e=1;t>e;e++)n.push({index:e,field:"a"});return n.sort(function(e,t){return e.field>t.field?1:t.field>e.field?-1:0}),1===n[0].index}(),ke.matchesSelector=a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.matchesSelector||a.matches||function(t){for(var n=document.querySelectorAll?(this.parentNode||document).querySelectorAll(t)||[]:e(t),r=n.length;r--;)if(n[r]==this)return!0;return!1},ke.pushState=t.history&&t.history.pushState,l=document.documentMode,ke.hashChange="onhashchange"in t&&!(ke.browser.msie&&(!l||8>=l)),ke.customElements="registerElement"in t.document}(),B={left:{reverse:"right"},right:{reverse:"left"},down:{reverse:"up"},up:{reverse:"down"},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out"},out:{reverse:"in"}},j={},e.extend(j,{enabled:!0,Element:function(t){this.element=e(t)},promise:function(e,t){e.is(":visible")||e.css({display:e.data("olddisplay")||"block"}).css("display"),t.hide&&e.data("olddisplay",e.css("display")).hide(),t.init&&t.init(),t.completeCallback&&t.completeCallback(e),e.dequeue()},disable:function(){this.enabled=!1,this.promise=this.promiseShim},enable:function(){this.enabled=!0,this.promise=this.animatedPromise}}),j.promiseShim=j.promise,"kendoAnimate"in e.fn||ve(e.fn,{kendoStop:function(e,t){return this.stop(e,t)},kendoAnimate:function(e,t,n,r){return M(this,e,t,n,r)},kendoAddClass:function(e,t){return ye.toggleClass(this,e,t,!0)},kendoRemoveClass:function(e,t){return ye.toggleClass(this,e,t,!1)},kendoToggleClass:function(e,t,n){return ye.toggleClass(this,e,t,n)}}),J=/&/g,Y=/</g,q=/"/g,V=/'/g,G=/>/g,K=function(e){return e.target},ke.touch&&(K=function(e){var t="originalEvent"in e?e.originalEvent.changedTouches:"changedTouches"in e?e.changedTouches:null;return t?document.elementFromPoint(t[0].clientX,t[0].clientY):e.target},be(["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap"],function(t,n){e.fn[n]=function(e){return this.bind(n,e)}})),ke.touch?ke.mobileOS?(ke.mousedown="touchstart",ke.mouseup="touchend",ke.mousemove="touchmove",ke.mousecancel="touchcancel",ke.click="touchend",ke.resize="orientationchange"):(ke.mousedown="mousedown touchstart",ke.mouseup="mouseup touchend",ke.mousemove="mousemove touchmove",ke.mousecancel="mouseleave touchcancel",ke.click="click",ke.resize="resize"):ke.pointers?(ke.mousemove="pointermove",ke.mousedown="pointerdown",ke.mouseup="pointerup",ke.mousecancel="pointercancel",ke.click="pointerup",ke.resize="orientationchange resize"):ke.msPointers?(ke.mousemove="MSPointerMove",ke.mousedown="MSPointerDown",ke.mouseup="MSPointerUp",ke.mousecancel="MSPointerCancel",ke.click="MSPointerUp",ke.resize="orientationchange resize"):(ke.mousemove="mousemove",ke.mousedown="mousedown",ke.mouseup="mouseup",ke.mousecancel="mouseleave",ke.click="click",ke.resize="resize"),Q=function(e,t){var n,r,o,i,a=t||"d",s=1;for(r=0,o=e.length;o>r;r++)i=e[r],""!==i&&(n=i.indexOf("["),0!==n&&(-1==n?i="."+i:(s++,i="."+i.substring(0,n)+" || {})"+i.substring(n))),s++,a+=i+(o-1>r?" || {})":")"));return Array(s).join("(")+a},Z=/^([a-z]+:)?\/\//i,ve(ye,{widgets:[],_widgetRegisteredCallbacks:[],ui:ye.ui||{},fx:ye.fx||b,effects:ye.effects||j,mobile:ye.mobile||{},data:ye.data||{},dataviz:ye.dataviz||{},drawing:ye.drawing||{},spreadsheet:{messages:{}},keys:{INSERT:45,DELETE:46,BACKSPACE:8,TAB:9,ENTER:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,END:35,HOME:36,SPACEBAR:32,PAGEUP:33,PAGEDOWN:34,F2:113,F10:121,F12:123,NUMPAD_PLUS:107,NUMPAD_MINUS:109,NUMPAD_DOT:110},support:ye.support||ke,animate:ye.animate||M,ns:"",attr:function(e){return"data-"+ye.ns+e},getShadows:a,wrap:s,deepExtend:u,getComputedStyles:m,webComponents:ye.webComponents||[],isScrollable:p,scrollLeft:h,size:g,toCamelCase:f,toHyphens:d,getOffset:ye.getOffset||y,parseEffects:ye.parseEffects||v,toggleClass:ye.toggleClass||S,directions:ye.directions||B,Observable:P,Class:r,Template:H,template:Me(H.compile,H),render:Me(H.render,H),stringify:Me(xe.stringify,xe),eventTarget:K,htmlEncode:T,isLocalUrl:function(e){return e&&!Z.test(e)},expr:function(e,t,n){return e=e||"",typeof t==He&&(n=t,t=!1),n=n||"d",e&&"["!==e.charAt(0)&&(e="."+e),t?(e=e.replace(/"([^.]*)\.([^"]*)"/g,'"$1_$DOT$_$2"'),e=e.replace(/'([^.]*)\.([^']*)'/g,"'$1_$DOT$_$2'"),e=Q(e.split("."),n),e=e.replace(/_\$DOT\$_/g,".")):e=n+e,e},getter:function(e,t){var n=e+t;return Re[n]=Re[n]||Function("d","return "+ye.expr(e,t))},setter:function(e){return Ie[e]=Ie[e]||Function("d,value",ye.expr(e)+"=value")},accessor:function(e){return{get:ye.getter(e),set:ye.setter(e)}},guid:function(){var e,t,n="";for(e=0;32>e;e++)t=16*Te.random()|0,(8==e||12==e||16==e||20==e)&&(n+="-"),n+=(12==e?4:16==e?3&t|8:t).toString(16);return n},roleSelector:function(e){return e.replace(/(\S+)/g,"["+ye.attr("role")+"=$1],").slice(0,-1)},directiveSelector:function(e){var t,n=e.split(" ");if(n)for(t=0;n.length>t;t++)"view"!=n[t]&&(n[t]=n[t].replace(/(\w*)(view|bar|strip|over)$/,"$1-$2"));return n.join(" ").replace(/(\S+)/g,"kendo-mobile-$1,").slice(0,-1)},triggeredByInput:function(e){return/^(label|input|textarea|select)$/i.test(e.target.tagName)},onWidgetRegistered:function(e){for(var t=0,n=ye.widgets.length;n>t;t++)e(ye.widgets[t]);ye._widgetRegisteredCallbacks.push(e)},logToConsole:function(e,r){var o=t.console;!ye.suppressLog&&n!==o&&o.log&&o[r||"log"](e)}}),X=P.extend({init:function(e,t){var n,r=this;r.element=ye.jQuery(e).handler(r),r.angular("init",t),P.fn.init.call(r),n=t?t.dataSource:null,n&&(t=ve({},t,{dataSource:{}})),t=r.options=ve(!0,{},r.options,t),n&&(t.dataSource=n),r.element.attr(ye.attr("role"))||r.element.attr(ye.attr("role"),(t.name||"").toLowerCase()),r.element.data("kendo"+t.prefix+t.name,r),r.bind(r.events,t)},events:[],options:{prefix:""
},_hasBindingTarget:function(){return!!this.element[0].kendoBindingTarget},_tabindex:function(e){e=e||this.wrapper;var t=this.element,n="tabindex",r=e.attr(n)||t.attr(n);t.removeAttr(n),e.attr(n,isNaN(r)?0:r)},setOptions:function(t){this._setEvents(t),e.extend(this.options,t)},_setEvents:function(e){for(var t,n=this,r=0,o=n.events.length;o>r;r++)t=n.events[r],n.options[t]&&e[t]&&n.unbind(t,n.options[t]);n.bind(n.events,e)},resize:function(e){var t=this.getSize(),n=this._size;(e||(t.width>0||t.height>0)&&(!n||t.width!==n.width||t.height!==n.height))&&(this._size=t,this._resize(t,e),this.trigger("resize",t))},getSize:function(){return ye.dimensions(this.element)},size:function(e){return e?(this.setSize(e),n):this.getSize()},setSize:e.noop,_resize:e.noop,destroy:function(){var e=this;e.element.removeData("kendo"+e.options.prefix+e.options.name),e.element.removeData("handler"),e.unbind()},_destroy:function(){this.destroy()},angular:function(){},_muteAngularRebind:function(e){this._muteRebind=!0,e.call(this),this._muteRebind=!1}}),ee=X.extend({dataItems:function(){return this.dataSource.flatView()},_angularItems:function(t){var n=this;n.angular(t,function(){return{elements:n.items(),data:e.map(n.dataItems(),function(e){return{dataItem:e}})}})}}),ye.dimensions=function(e,t){var n=e[0];return t&&e.css(t),{width:n.offsetWidth,height:n.offsetHeight}},ye.notify=Se,te=/template$/i,ne=/^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/,re=/^\{(\d+)(:[^\}]+)?\}|^\[[A-Za-z_]*\]$/,oe=/([A-Z])/g,ye.initWidget=function(r,o,i){var a,s,u,l,c,d,f,m,p,h,g,y,v;if(i?i.roles&&(i=i.roles):i=ye.ui.roles,r=r.nodeType?r:r[0],d=r.getAttribute("data-"+ye.ns+"role")){p=-1===d.indexOf("."),u=p?i[d]:ye.getter(d)(t),g=e(r).data(),y=u?"kendo"+u.fn.options.prefix+u.fn.options.name:"",h=p?RegExp("^kendo.*"+d+"$","i"):RegExp("^"+y+"$","i");for(v in g)if(v.match(h)){if(v!==y)return g[v];a=g[v]}if(u){for(m=x(r,"dataSource"),o=e.extend({},k(r,u.fn.options),o),m&&(o.dataSource=typeof m===He?ye.getter(m)(t):m),l=0,c=u.fn.events.length;c>l;l++)s=u.fn.events[l],f=x(r,s),f!==n&&(o[s]=ye.getter(f)(t));return a?e.isEmptyObject(o)||a.setOptions(o):a=new u(r,o),a}}},ye.rolesFromNamespaces=function(e){var t,n,r=[];for(e[0]||(e=[ye.ui,ye.dataviz.ui]),t=0,n=e.length;n>t;t++)r[t]=e[t].roles;return ve.apply(null,[{}].concat(r.reverse()))},ye.init=function(t){var n=ye.rolesFromNamespaces(Ue.call(arguments,1));e(t).find("[data-"+ye.ns+"role]").addBack().each(function(){ye.initWidget(this,{},n)})},ye.destroy=function(t){e(t).find("[data-"+ye.ns+"role]").addBack().each(function(){var t,n=e(this).data();for(t in n)0===t.indexOf("kendo")&&typeof n[t].destroy===Ee&&n[t].destroy()})},ye.resize=function(t,n){var r,o=e(t).find("[data-"+ye.ns+"role]").addBack().filter(z);o.length&&(r=e.makeArray(o),r.sort(O),e.each(r,function(){var t=ye.widgetInstance(e(this));t&&t.resize(n)}))},ye.parseOptions=k,ve(ye.ui,{Widget:X,DataBoundWidget:ee,roles:{},progress:function(t,n){var r,o,i,a,s=t.find(".k-loading-mask"),u=ye.support,l=u.browser;n?s.length||(r=u.isRtl(t),o=r?"right":"left",a=t.scrollLeft(),i=l.webkit&&r?t[0].scrollWidth-t.width()-2*a:0,s=e("<div class='k-loading-mask'><span class='k-loading-text'>Loading...</span><div class='k-loading-image'/><div class='k-loading-color'/></div>").width("100%").height("100%").css("top",t.scrollTop()).css(o,Math.abs(a)+i).prependTo(t)):s&&s.remove()},plugin:function(t,r,o){var i,a,s,u,l=t.fn.options.name;for(r=r||ye.ui,o=o||"",r[l]=t,r.roles[l.toLowerCase()]=t,i="getKendo"+o+l,l="kendo"+o+l,a={name:l,widget:t,prefix:o||""},ye.widgets.push(a),s=0,u=ye._widgetRegisteredCallbacks.length;u>s;s++)ye._widgetRegisteredCallbacks[s](a);e.fn[l]=function(r){var o,i=this;return typeof r===He?(o=Ue.call(arguments,1),this.each(function(){var t,a,s=e.data(this,l);if(!s)throw Error(ye.format("Cannot call method '{0}' of {1} before it is initialized",r,l));if(t=s[r],typeof t!==Ee)throw Error(ye.format("Cannot find method '{0}' of {1}",r,l));return a=t.apply(s,o),a!==n?(i=a,!1):n})):this.each(function(){return new t(this,r)}),i},e.fn[l].widget=t,e.fn[i]=function(){return this.data(l)}}}),ie={bind:function(){return this},nullObject:!0,options:{}},ae=X.extend({init:function(e,t){X.fn.init.call(this,e,t),this.element.autoApplyNS(),this.wrapper=this.element,this.element.addClass("km-widget")},destroy:function(){X.fn.destroy.call(this),this.element.kendoDestroy()},options:{prefix:"Mobile"},events:[],view:function(){var e=this.element.closest(ye.roleSelector("view splitview modalview drawer"));return ye.widgetInstance(e,ye.mobile.ui)||ie},viewHasNativeScrolling:function(){var e=this.view();return e&&e.options.useNativeScrolling},container:function(){var e=this.element.closest(ye.roleSelector("view layout modalview drawer splitview"));return ye.widgetInstance(e.eq(0),ye.mobile.ui)||ie}}),ve(ye.mobile,{init:function(e){ye.init(e,ye.mobile.ui,ye.ui,ye.dataviz.ui)},appLevelNativeScrolling:function(){return ye.mobile.application&&ye.mobile.application.options&&ye.mobile.application.options.useNativeScrolling},roles:{},ui:{Widget:ae,DataBoundWidget:ee.extend(ae.prototype),roles:{},plugin:function(e){ye.ui.plugin(e,ye.mobile.ui,"Mobile")}}}),u(ye.dataviz,{init:function(e){ye.init(e,ye.dataviz.ui)},ui:{roles:{},themes:{},views:[],plugin:function(e){ye.ui.plugin(e,ye.dataviz.ui)}},roles:{}}),ye.touchScroller=function(t,n){return n||(n={}),n.useNative=!0,e(t).map(function(t,r){return r=e(r),ke.kineticScrollNeeded&&ye.mobile.ui.Scroller&&!r.data("kendoMobileScroller")?(r.kendoMobileScroller(n),r.data("kendoMobileScroller")):!1})[0]},ye.preventDefault=function(e){e.preventDefault()},ye.widgetInstance=function(e,n){var r,o,i,a,s=e.data(ye.ns+"role"),u=[];if(s){if("content"===s&&(s="scroller"),n)if(n[0])for(r=0,o=n.length;o>r;r++)u.push(n[r].roles[s]);else u.push(n.roles[s]);else u=[ye.ui.roles[s],ye.dataviz.ui.roles[s],ye.mobile.ui.roles[s]];for(s.indexOf(".")>=0&&(u=[ye.getter(s)(t)]),r=0,o=u.length;o>r;r++)if(i=u[r],i&&(a=e.data("kendo"+i.fn.options.prefix+i.fn.options.name)))return a}},ye.onResize=function(n){var r=n;return ke.mobileOS.android&&(r=function(){setTimeout(n,600)}),e(t).on(ke.resize,r),r},ye.unbindResize=function(n){e(t).off(ke.resize,n)},ye.attrValue=function(e,t){return e.data(ye.ns+t)},ye.days={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6},e.extend(e.expr[":"],{kendoFocusable:function(t){var n=e.attr(t,"tabindex");return D(t,!isNaN(n)&&n>-1)}}),se=["mousedown","mousemove","mouseenter","mouseleave","mouseover","mouseout","mouseup","click"],ue="label, input, [data-rel=external]",le={setupMouseMute:function(){var t,n=0,r=se.length,o=document.documentElement;if(!le.mouseTrap&&ke.eventCapture)for(le.mouseTrap=!0,le.bustClick=!1,le.captureMouse=!1,t=function(t){le.captureMouse&&("click"===t.type?le.bustClick&&!e(t.target).is(ue)&&(t.preventDefault(),t.stopPropagation()):t.stopPropagation())};r>n;n++)o.addEventListener(se[n],t,!0)},muteMouse:function(e){le.captureMouse=!0,e.data.bustClick&&(le.bustClick=!0),clearTimeout(le.mouseTrapTimeoutID)},unMuteMouse:function(){clearTimeout(le.mouseTrapTimeoutID),le.mouseTrapTimeoutID=setTimeout(function(){le.captureMouse=!1,le.bustClick=!1},400)}},ce={down:"touchstart mousedown",move:"mousemove touchmove",up:"mouseup touchend touchcancel",cancel:"mouseleave touchcancel"},ke.touch&&(ke.mobileOS.ios||ke.mobileOS.android)?ce={down:"touchstart",move:"touchmove",up:"touchend touchcancel",cancel:"touchcancel"}:ke.pointers?ce={down:"pointerdown",move:"pointermove",up:"pointerup",cancel:"pointercancel pointerleave"}:ke.msPointers&&(ce={down:"MSPointerDown",move:"MSPointerMove",up:"MSPointerUp",cancel:"MSPointerCancel MSPointerLeave"}),!ke.msPointers||"onmspointerenter"in t||e.each({MSPointerEnter:"MSPointerOver",MSPointerLeave:"MSPointerOut"},function(t,n){e.event.special[t]={delegateType:n,bindType:n,handle:function(t){var r,o=this,i=t.relatedTarget,a=t.handleObj;return(!i||i!==o&&!e.contains(o,i))&&(t.type=a.origType,r=a.handler.apply(this,arguments),t.type=n),r}}}),de=function(e){return ce[e]||e},fe=/([^ ]+)/g,ye.applyEventMap=function(e,t){return e=e.replace(fe,de),t&&(e=e.replace(fe,"$1."+t)),e},me=e.fn.on,ve(!0,E,e),E.fn=E.prototype=new e,E.fn.constructor=E,E.fn.init=function(t,n){return n&&n instanceof e&&!(n instanceof E)&&(n=E(n)),e.fn.init.call(this,t,n,pe)},E.fn.init.prototype=E.fn,pe=E(document),ve(E.fn,{handler:function(e){return this.data("handler",e),this},autoApplyNS:function(e){return this.data("kendoNS",e||ye.guid()),this},on:function(){var e,t,n,r,o,i,a=this,s=a.data("kendoNS");return 1===arguments.length?me.call(a,arguments[0]):(e=a,t=Ue.call(arguments),typeof t[t.length-1]===Fe&&t.pop(),n=t[t.length-1],r=ye.applyEventMap(t[0],s),ke.mouseAndTouchPresent&&r.search(/mouse|click/)>-1&&this[0]!==document.documentElement&&(le.setupMouseMute(),o=2===t.length?null:t[1],i=r.indexOf("click")>-1&&r.indexOf("touchend")>-1,me.call(this,{touchstart:le.muteMouse,touchend:le.unMuteMouse},o,{bustClick:i})),typeof n===He&&(e=a.data("handler"),n=e[n],t[t.length-1]=function(t){n.call(e,t)}),t[0]=r,me.apply(a,t),a)},kendoDestroy:function(e){return e=e||this.data("kendoNS"),e&&this.off("."+e),this}}),ye.jQuery=E,ye.eventMap=ce,ye.timezone=function(){function e(e,t){var n,r,o,i=t[3],a=t[4],s=t[5],u=t[8];return u||(t[8]=u={}),u[e]?u[e]:(isNaN(a)?0===a.indexOf("last")?(n=new Date(Date.UTC(e,c[i]+1,1,s[0]-24,s[1],s[2],0)),r=d[a.substr(4,3)],o=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+r-o-(r>o?7:0))):a.indexOf(">=")>=0&&(n=new Date(Date.UTC(e,c[i],a.substr(5),s[0],s[1],s[2],0)),r=d[a.substr(0,3)],o=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+r-o+(o>r?7:0))):n=new Date(Date.UTC(e,c[i],a,s[0],s[1],s[2],0)),u[e]=n)}function t(t,n,r){var o,i,a,s;return(n=n[r])?(a=new Date(t).getUTCFullYear(),n=jQuery.grep(n,function(e){var t=e[0],n=e[1];return a>=t&&(n>=a||t==a&&"only"==n||"max"==n)}),n.push(t),n.sort(function(t,n){return"number"!=typeof t&&(t=+e(a,t)),"number"!=typeof n&&(n=+e(a,n)),t-n}),s=n[jQuery.inArray(t,n)-1]||n[n.length-1],isNaN(s)?s:null):(o=r.split(":"),i=0,o.length>1&&(i=60*o[0]+ +o[1]),[-1e6,"max","-","Jan",1,[0,0,0],i,"-"])}function n(e,t,n){var r,o,i,a=t[n];if("string"==typeof a&&(a=t[a]),!a)throw Error('Timezone "'+n+'" is either incorrect, or kendo.timezones.min.js is not included.');for(r=a.length-1;r>=0&&(o=a[r][3],!(o&&e>o));r--);if(i=a[r+1],!i)throw Error('Timezone "'+n+'" not found on '+e+".");return i}function r(e,r,o,i){typeof e!=Ae&&(e=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));var a=n(e,r,i);return{zone:a,rule:t(e,o,a[1])}}function o(e,t){var n,o,i;return"Etc/UTC"==t||"Etc/GMT"==t?0:(n=r(e,this.zones,this.rules,t),o=n.zone,i=n.rule,ye.parseFloat(i?o[0]-i[6]:o[0]))}function i(e,t){var n=r(e,this.zones,this.rules,t),o=n.zone,i=n.rule,a=o[2];return a.indexOf("/")>=0?a.split("/")[i&&+i[6]?1:0]:a.indexOf("%s")>=0?a.replace("%s",i&&"-"!=i[7]?i[7]:""):a}function a(e,t,n){var r,o;return typeof t==He&&(t=this.offset(e,t)),typeof n==He&&(n=this.offset(e,n)),r=e.getTimezoneOffset(),e=new Date(e.getTime()+6e4*(t-n)),o=e.getTimezoneOffset(),new Date(e.getTime()+6e4*(o-r))}function s(e,t){return this.convert(e,e.getTimezoneOffset(),t)}function u(e,t){return this.convert(e,t,e.getTimezoneOffset())}function l(e){return this.apply(new Date(e),"Etc/UTC")}var c={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},d={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};return{zones:{},rules:{},offset:o,convert:a,apply:s,remove:u,abbr:i,toLocalDate:l}}(),ye.date=function(){function e(e,t){return 0===t&&23===e.getHours()?(e.setHours(e.getHours()+2),!0):!1}function t(t,n,r){var o=t.getHours();r=r||1,n=(n-t.getDay()+7*r)%7,t.setDate(t.getDate()+n),e(t,o)}function n(e,n,r){return e=new Date(e),t(e,n,r),e}function r(e){return new Date(e.getFullYear(),e.getMonth(),1)}function o(e){var t=new Date(e.getFullYear(),e.getMonth()+1,0),n=r(e),o=Math.abs(t.getTimezoneOffset()-n.getTimezoneOffset());return o&&t.setHours(n.getHours()+o/60),t}function i(t){return t=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),e(t,0),t}function a(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function s(e){return e.getTime()-i(e)}function u(e,t,n){var r,o=s(t),i=s(n);return e&&o!=i?(t>=n&&(n+=y),r=s(e),o>r&&(r+=y),o>i&&(i+=y),r>=o&&i>=r):!0}function l(e,t,n){var r,o=t.getTime(),i=n.getTime();return o>=i&&(i+=y),r=e.getTime(),r>=o&&i>=r}function c(t,n){var r=t.getHours();return t=new Date(t),d(t,n*y),e(t,r),t}function d(e,t,n){var r,o=e.getTimezoneOffset();e.setTime(e.getTime()+t),n||(r=e.getTimezoneOffset()-o,e.setTime(e.getTime()+r*g))}function f(t,n){return t=new Date(ye.date.getDate(t).getTime()+ye.date.getMilliseconds(n)),e(t,n.getHours()),t}function m(){return i(new Date)}function p(e){return i(e).getTime()==m().getTime()}function h(e){var t=new Date(1980,1,1,0,0,0);return e&&t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t}var g=6e4,y=864e5;return{adjustDST:e,dayOfWeek:n,setDayOfWeek:t,getDate:i,isInDateRange:l,isInTimeRange:u,isToday:p,nextDay:function(e){return c(e,1)},previousDay:function(e){return c(e,-1)},toUtcTime:a,MS_PER_DAY:y,MS_PER_HOUR:60*g,MS_PER_MINUTE:g,setTime:d,setHours:f,addDays:c,today:m,toInvariantTime:h,firstDayOfMonth:r,lastDayOfMonth:o,getMilliseconds:s}}(),ye.stripWhitespace=function(e){var t,n,r;if(document.createNodeIterator)for(t=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,function(t){return t.parentNode==e?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT},!1);t.nextNode();)t.referenceNode&&!t.referenceNode.textContent.trim()&&t.referenceNode.parentNode.removeChild(t.referenceNode);else for(n=0;e.childNodes.length>n;n++)r=e.childNodes[n],3!=r.nodeType||/\S/.test(r.nodeValue)||(e.removeChild(r),n--),1==r.nodeType&&ye.stripWhitespace(r)},he=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},ye.animationFrame=function(e){he.call(t,e)},ge=[],ye.queueAnimation=function(e){ge[ge.length]=e,1===ge.length&&ye.runNextAnimation()},ye.runNextAnimation=function(){ye.animationFrame(function(){ge[0]&&(ge.shift()(),ge[0]&&ye.runNextAnimation())})},ye.parseQueryStringParams=function(e){for(var t=e.split("?")[1]||"",n={},r=t.split(/&|=/),o=r.length,i=0;o>i;i+=2)""!==r[i]&&(n[decodeURIComponent(r[i])]=decodeURIComponent(r[i+1]));return n},ye.elementUnderCursor=function(e){return n!==e.x.client?document.elementFromPoint(e.x.client,e.y.client):n},ye.wheelDeltaY=function(e){var t,r=e.originalEvent,o=r.wheelDeltaY;return r.wheelDelta?(o===n||o)&&(t=r.wheelDelta):r.detail&&r.axis===r.VERTICAL_AXIS&&(t=10*-r.detail),t},ye.throttle=function(e,t){var r,o,i=0;return!t||0>=t?e:(o=function(){function o(){e.apply(a,u),i=+new Date}var a=this,s=+new Date-i,u=arguments;return i?(r&&clearTimeout(r),s>t?o():r=setTimeout(o,t-s),n):o()},o.cancel=function(){clearTimeout(r)},o)},ye.caret=function(t,r,o){var i,a,s,u,l=r!==n;if(o===n&&(o=r),t[0]&&(t=t[0]),!l||!t.disabled){try{t.selectionStart!==n?l?(t.focus(),t.setSelectionRange(r,o)):r=[t.selectionStart,t.selectionEnd]:document.selection&&(e(t).is(":visible")&&t.focus(),i=t.createTextRange(),l?(i.collapse(!0),i.moveStart("character",r),i.moveEnd("character",o-r),i.select()):(a=i.duplicate(),i.moveToBookmark(document.selection.createRange().getBookmark()),a.setEndPoint("EndToStart",i),s=a.text.length,u=s+i.text.length,r=[s,u]))}catch(c){r=[]}return r}},ye.compileMobileDirective=function(e,n){var r=t.angular;return e.attr("data-"+ye.ns+"role",e[0].tagName.toLowerCase().replace("kendo-mobile-","").replace("-","")),r.element(e).injector().invoke(["$compile",function(t){t(e)(n),/^\$(digest|apply)$/.test(n.$$phase)||n.$digest()}]),ye.widgetInstance(e,ye.mobile.ui)},ye.antiForgeryTokens=function(){var t={},r=e("meta[name=csrf-token],meta[name=_csrf]").attr("content"),o=e("meta[name=csrf-param],meta[name=_csrf_header]").attr("content");return e("input[name^='__RequestVerificationToken']").each(function(){t[this.name]=this.value}),o!==n&&r!==n&&(t[o]=r),t},ye.cycleForm=function(e){function t(e){var t=ye.widgetInstance(e);t&&t.focus?t.focus():e.focus()}var n=e.find("input, .k-widget").first(),r=e.find("button, .k-button").last();r.on("keydown",function(e){e.keyCode!=ye.keys.TAB||e.shiftKey||(e.preventDefault(),t(n))}),n.on("keydown",function(e){e.keyCode==ye.keys.TAB&&e.shiftKey&&(e.preventDefault(),t(r))})},function(){function n(t,n,r,o){var i,a,s=e("<form>").attr({action:r,method:"POST",target:o}),u=ye.antiForgeryTokens();u.fileName=n,i=t.split(";base64,"),u.contentType=i[0].replace("data:",""),u.base64=i[1];for(a in u)u.hasOwnProperty(a)&&e("<input>").attr({value:u[a],name:a,type:"hidden"}).appendTo(s);s.appendTo("body").submit().remove()}function r(e,t){var n,r,o,i,a,s=e;if("string"==typeof e){for(n=e.split(";base64,"),r=n[0],o=atob(n[1]),i=new Uint8Array(o.length),a=0;o.length>a;a++)i[a]=o.charCodeAt(a);s=new Blob([i.buffer],{type:r})}navigator.msSaveBlob(s,t)}function o(e,n){t.Blob&&e instanceof Blob&&(e=URL.createObjectURL(e)),i.download=n,i.href=e;var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),i.dispatchEvent(r)}var i=document.createElement("a"),a="download"in i&&!ye.support.browser.edge;ye.saveAs=function(e){var t=n;e.forceProxy||(a?t=o:navigator.msSaveBlob&&(t=r)),t(e.dataURI,e.fileName,e.proxyURL,e.proxyTarget)}}(),ye.proxyModelSetters=function(e){var t={};return Object.keys(e||{}).forEach(function(n){Object.defineProperty(t,n,{get:function(){return e[n]},set:function(t){e[n]=t,e.dirty=!0}})}),t}}(jQuery,window),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});;!function(t,define){define("kendo.data.odata.min",["kendo.core.min"],t)}(function(){return function(t,e){function n(a,r){var d,p,c,l,u,f,y,j,m=[],T=a.logic||"and",g=a.filters;for(d=0,p=g.length;p>d;d++)a=g[d],c=a.field,y=a.value,f=a.operator,a.filters?a=n(a,r):(j=a.ignoreCase,c=c.replace(/\./g,"/"),a=i[f],r&&(a=s[f]),"isnull"===f||"isnotnull"===f?a=o.format("{0} {1} null",c,a):"isempty"===f||"isnotempty"===f?a=o.format("{0} {1} ''",c,a):a&&y!==e&&(l=t.type(y),"string"===l?(u="'{1}'",y=y.replace(/'/g,"''"),j===!0&&(c="tolower("+c+")")):u="date"===l?r?"{1:yyyy-MM-ddTHH:mm:ss+00:00}":"datetime'{1:yyyy-MM-ddTHH:mm:ss}'":"{1}",a.length>3?"substringof"!==a?u="{0}({2},"+u+")":(u="{0}("+u+",{2})","doesnotcontain"===f&&(r?(u="{0}({2},'{1}') eq -1",a="indexof"):u+=" eq false")):u="{2} {0} "+u,a=o.format(u,a,y,c))),m.push(a);return a=m.join(" "+T+" "),m.length>1&&(a="("+a+")"),a}function a(t){for(var e in t)0===e.indexOf("@odata")&&delete t[e]}var o=window.kendo,r=t.extend,i={eq:"eq",neq:"ne",gt:"gt",gte:"ge",lt:"lt",lte:"le",contains:"substringof",doesnotcontain:"substringof",endswith:"endswith",startswith:"startswith",isnull:"eq",isnotnull:"ne",isempty:"eq",isnotempty:"ne"},s=r({},i,{contains:"contains"}),d={pageSize:t.noop,page:t.noop,filter:function(t,e,a){e&&(e=n(e,a),e&&(t.$filter=e))},sort:function(e,n){var a=t.map(n,function(t){var e=t.field.replace(/\./g,"/");return"desc"===t.dir&&(e+=" desc"),e}).join(",");a&&(e.$orderby=a)},skip:function(t,e){e&&(t.$skip=e)},take:function(t,e){e&&(t.$top=e)}},p={read:{dataType:"jsonp"}};r(!0,o.data,{schemas:{odata:{type:"json",data:function(t){return t.d.results||[t.d]},total:"d.__count"}},transports:{odata:{read:{cache:!0,dataType:"jsonp",jsonp:"$callback"},update:{cache:!0,dataType:"json",contentType:"application/json",type:"PUT"},create:{cache:!0,dataType:"json",contentType:"application/json",type:"POST"},destroy:{cache:!0,dataType:"json",type:"DELETE"},parameterMap:function(t,e,n){var a,r,i,s;if(t=t||{},e=e||"read",s=(this.options||p)[e],s=s?s.dataType:"json","read"===e){a={$inlinecount:"allpages"},"json"!=s&&(a.$format="json");for(i in t)d[i]?d[i](a,t[i],n):a[i]=t[i]}else{if("json"!==s)throw Error("Only json dataType can be used for "+e+" operation.");if("destroy"!==e){for(i in t)r=t[i],"number"==typeof r&&(t[i]=r+"");a=o.stringify(t)}}return a}}}}),r(!0,o.data,{schemas:{"odata-v4":{type:"json",data:function(e){return e=t.extend({},e),a(e),e.value?e.value:[e]},total:function(t){return t["@odata.count"]}}},transports:{"odata-v4":{read:{cache:!0,dataType:"json"},update:{cache:!0,dataType:"json",contentType:"application/json;IEEE754Compatible=true",type:"PUT"},create:{cache:!0,dataType:"json",contentType:"application/json;IEEE754Compatible=true",type:"POST"},destroy:{cache:!0,dataType:"json",type:"DELETE"},parameterMap:function(t,e){var n=o.data.transports.odata.parameterMap(t,e,!0);return"read"==e&&(n.$count=!0,delete n.$inlinecount),n}}}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()});;!function(e,define){define("kendo.data.min",["kendo.core.min","kendo.data.odata.min","kendo.data.xml.min"],e)}(function(){return function(e,t){function r(e,t,r,n){return function(i){var a,s={};for(a in i)s[a]=i[a];s.field=n?r+"."+i.field:r,t==ke&&e._notifyChange&&e._notifyChange(s),e.trigger(t,s)}}function n(t,r){if(t===r)return!0;var i,a=e.type(t),s=e.type(r);if(a!==s)return!1;if("date"===a)return t.getTime()===r.getTime();if("object"!==a&&"array"!==a)return!1;for(i in t)if(!n(t[i],r[i]))return!1;return!0}function i(e,t){var r,n;for(n in e){if(r=e[n],se(r)&&r.field&&r.field===t)return r;if(r===t)return r}return null}function a(e){this.data=e||[]}function s(e,r){if(e){var n=typeof e===ve?{field:e,dir:r}:e,i=ue(n)?n:n!==t?[n]:[];return le(i,function(e){return!!e.dir})}}function o(e){var t,r,n,i,a=e.filters;if(a)for(t=0,r=a.length;r>t;t++)n=a[t],i=n.operator,i&&typeof i===ve&&(n.operator=V[i.toLowerCase()]||i),o(n)}function u(e){return e&&!oe(e)?((ue(e)||!e.filters)&&(e={logic:"and",filters:ue(e)?e:[e]}),o(e),e):t}function l(e,t){return e.logic||t.logic?!1:e.field===t.field&&e.value===t.value&&e.operator===t.operator}function d(e){return e=e||{},oe(e)?{logic:"and",filters:[]}:u(e)}function h(e,t){return t.logic||e.field>t.field?1:t.field>e.field?-1:0}function f(e,t){var r,n,i,a,s;if(e=d(e),t=d(t),e.logic!==t.logic)return!1;if(i=(e.filters||[]).slice(),a=(t.filters||[]).slice(),i.length!==a.length)return!1;for(i=i.sort(h),a=a.sort(h),s=0;i.length>s;s++)if(r=i[s],n=a[s],r.logic&&n.logic){if(!f(r,n))return!1}else if(!l(r,n))return!1;return!0}function c(e){return ue(e)?e:[e]}function g(e,r){var n=typeof e===ve?{field:e,dir:r}:e,i=ue(n)?n:n!==t?[n]:[];return B(i,function(e){return{field:e.field,dir:e.dir||"asc",aggregates:e.aggregates}})}function p(e,t){return e&&e.getTime&&t&&t.getTime?e.getTime()===t.getTime():e===t}function _(e,t,r,n,i,a){var s,o,u,l,d;for(t=t||[],l=t.length,s=0;l>s;s++)o=t[s],u=o.aggregate,d=o.field,e[d]=e[d]||{},a[d]=a[d]||{},a[d][u]=a[d][u]||{},e[d][u]=W[u.toLowerCase()](e[d][u],r,ce.accessor(d),n,i,a[d][u])}function v(e){return"number"==typeof e&&!isNaN(e)}function m(e){return e&&e.getTime}function y(e){var t,r=e.length,n=Array(r);for(t=0;r>t;t++)n[t]=e[t].toJSON();return n}function S(e,t,r,n,i){var a,s,o,u,l,d={};for(u=0,l=e.length;l>u;u++){a=e[u];for(s in t)o=i[s],o&&o!==s&&(d[o]||(d[o]=ce.setter(o)),d[o](a,t[s](a)),delete a[s])}}function b(e,t,r,n,i){var a,s,o,u,l;for(u=0,l=e.length;l>u;u++){a=e[u];for(s in t)a[s]=r._parse(s,t[s](a)),o=i[s],o&&o!==s&&delete a[o]}}function w(e,t,r,n,i){var a,s,o,u;for(s=0,u=e.length;u>s;s++)a=e[s],o=n[a.field],o&&o!=a.field&&(a.field=o),a.value=r._parse(a.field,a.value),a.hasSubgroups?w(a.items,t,r,n,i):b(a.items,t,r,n,i)}function k(e,t,r,n,i,a){return function(s){return s=e(s),s&&!oe(n)&&("[object Array]"===Be.call(s)||s instanceof We||(s=[s]),r(s,n,new t,i,a)),s||[]}}function x(e,t,r,n){for(var i,a,s,o=0;t.length&&n&&(i=t[o],a=i.items,s=a.length,e&&e.field===i.field&&e.value===i.value?(e.hasSubgroups&&e.items.length?x(e.items[e.items.length-1],i.items,r,n):(a=a.slice(r,r+n),e.items=e.items.concat(a)),t.splice(o--,1)):i.hasSubgroups&&a.length?(x(i,a,r,n),i.items.length||t.splice(o--,1)):(a=a.slice(r,r+n),i.items=a,i.items.length||t.splice(o--,1)),0===a.length?r-=s:(r=0,n-=a.length),!(++o>=t.length)););t.length>o&&t.splice(o,t.length-o)}function q(e){var t,r,n,i,a,s=[];for(t=0,r=e.length;r>t;t++)if(a=e.at(t),a.hasSubgroups)s=s.concat(q(a.items));else for(n=a.items,i=0;n.length>i;i++)s.push(n.at(i));return s}function C(e,t){var r,n,i;if(t)for(r=0,n=e.length;n>r;r++)i=e.at(r),i.hasSubgroups?C(i.items,t):i.items=new Qe(i.items,t)}function D(e,t){for(var r=0,n=e.length;n>r;r++)if(e[r].hasSubgroups){if(D(e[r].items,t))return!0}else if(t(e[r].items,e[r]))return!0}function O(e,t,r,n){for(var i=0;e.length>i&&e[i].data!==t&&!z(e[i].data,r,n);i++);}function z(e,t,r){for(var n=0,i=e.length;i>n;n++){if(e[n]&&e[n].hasSubgroups)return z(e[n].items,t,r);if(e[n]===t||e[n]===r)return e[n]=r,!0}}function R(e,r,n,i,a){var s,o,u,l;for(s=0,o=e.length;o>s;s++)if(u=e[s],u&&!(u instanceof i))if(u.hasSubgroups===t||a){for(l=0;r.length>l;l++)if(r[l]===u){e[s]=r.at(l),O(n,r,u,e[s]);break}}else R(u.items,r,n,i,a)}function P(e,t){var r,n,i;for(r=0,n=e.length;n>r;r++)if(i=e.at(r),i.uid==t.uid)return e.splice(r,1),i}function T(e,t){return t?A(e,function(e){return e.uid&&e.uid==t.uid||e[t.idField]===t.id&&t.id!==t._defaultId}):-1}function F(e,t){return t?A(e,function(e){return e.uid==t.uid}):-1}function A(e,t){var r,n;for(r=0,n=e.length;n>r;r++)if(t(e[r]))return r;return-1}function I(e,t){var r,n;return e&&!oe(e)?(r=e[t],n=se(r)?r.from||r.field||t:e[t]||t,ge(n)?t:n):t}function N(e,t){var r,n,i,a={};for(i in e)"filters"!==i&&(a[i]=e[i]);if(e.filters)for(a.filters=[],r=0,n=e.filters.length;n>r;r++)a.filters[r]=N(e.filters[r],t);else a.field=I(t.fields,a.field);return a}function M(e,t){var r,n,i,a,s,o=[];for(r=0,n=e.length;n>r;r++){i={},a=e[r];for(s in a)i[s]=a[s];i.field=I(t.fields,i.field),i.aggregates&&ue(i.aggregates)&&(i.aggregates=M(i.aggregates,t)),o.push(i)}return o}function j(t,r){var n,i,a,s,o,u,l,d,h,f;for(t=e(t)[0],n=t.options,i=r[0],a=r[1],s=[],o=0,u=n.length;u>o;o++)h={},d=n[o],l=d.parentNode,l===t&&(l=null),d.disabled||l&&l.disabled||(l&&(h.optgroup=l.label),h[i.field]=d.text,f=d.attributes.value,f=f&&f.specified?d.value:d.text,h[a.field]=f,s.push(h));return s}function L(t,r){var n,i,a,s,o,u,l,d=e(t)[0].tBodies[0],h=d?d.rows:[],f=r.length,c=[];for(n=0,i=h.length;i>n;n++){for(o={},l=!0,s=h[n].cells,a=0;f>a;a++)u=s[a],"th"!==u.nodeName.toLowerCase()&&(l=!1,o[r[a].field]=u.innerHTML);l||c.push(o)}return c}function G(e){return function(){var t=this._data,r=Y.fn[e].apply(this,Ge.call(arguments));return this._data!=t&&this._attachBubbleHandlers(),r}}function E(t,r){function n(e,t){return e.filter(t).add(e.find(t))}var i,a,s,o,u,l,d,h,f=e(t).children(),c=[],g=r[0].field,p=r[1]&&r[1].field,_=r[2]&&r[2].field,v=r[3]&&r[3].field;for(i=0,a=f.length;a>i;i++)s={_loaded:!0},o=f.eq(i),l=o[0].firstChild,h=o.children(),t=h.filter("ul"),h=h.filter(":not(ul)"),u=o.attr("data-id"),u&&(s.id=u),l&&(s[g]=3==l.nodeType?l.nodeValue:h.text()),p&&(s[p]=n(h,"a").attr("href")),v&&(s[v]=n(h,"img").attr("src")),_&&(d=n(h,".k-sprite").prop("className"),s[_]=d&&e.trim(d.replace("k-sprite",""))),t.length&&(s.items=E(t.eq(0),r)),"true"==o.attr("data-hasChildren")&&(s.hasChildren=!0),c.push(s);return c}var B,U,H,J,V,W,Q,K,$,X,Y,Z,ee,te,re,ne,ie=e.extend,ae=e.proxy,se=e.isPlainObject,oe=e.isEmptyObject,ue=e.isArray,le=e.grep,de=e.ajax,he=e.each,fe=e.noop,ce=window.kendo,ge=ce.isFunction,pe=ce.Observable,_e=ce.Class,ve="string",me="function",ye="create",Se="read",be="update",we="destroy",ke="change",xe="sync",qe="get",Ce="error",De="requestStart",Oe="progress",ze="requestEnd",Re=[ye,Se,be,we],Pe=function(e){return e},Te=ce.getter,Fe=ce.stringify,Ae=Math,Ie=[].push,Ne=[].join,Me=[].pop,je=[].splice,Le=[].shift,Ge=[].slice,Ee=[].unshift,Be={}.toString,Ue=ce.support.stableSort,He=/^\/Date\((.*?)\)\/$/,Je=/(\r+|\n+)/g,Ve=/(?=['\\])/g,We=pe.extend({init:function(e,t){var r=this;r.type=t||Ke,pe.fn.init.call(r),r.length=e.length,r.wrapAll(e,r)},at:function(e){return this[e]},toJSON:function(){var e,t,r=this.length,n=Array(r);for(e=0;r>e;e++)t=this[e],t instanceof Ke&&(t=t.toJSON()),n[e]=t;return n},parent:fe,wrapAll:function(e,t){var r,n,i=this,a=function(){return i};for(t=t||[],r=0,n=e.length;n>r;r++)t[r]=i.wrap(e[r],a);return t},wrap:function(e,t){var r,n=this;return null!==e&&"[object Object]"===Be.call(e)&&(r=e instanceof n.type||e instanceof Ye,r||(e=e instanceof Ke?e.toJSON():e,e=new n.type(e)),e.parent=t,e.bind(ke,function(e){n.trigger(ke,{field:e.field,node:e.node,index:e.index,items:e.items||[this],action:e.node?e.action||"itemloaded":"itemchange"})})),e},push:function(){var e,t=this.length,r=this.wrapAll(arguments);return e=Ie.apply(this,r),this.trigger(ke,{action:"add",index:t,items:r}),e},slice:Ge,sort:[].sort,join:Ne,pop:function(){var e=this.length,t=Me.apply(this);return e&&this.trigger(ke,{action:"remove",index:e-1,items:[t]}),t},splice:function(e,t,r){var n,i,a,s=this.wrapAll(Ge.call(arguments,2));if(n=je.apply(this,[e,t].concat(s)),n.length)for(this.trigger(ke,{action:"remove",index:e,items:n}),i=0,a=n.length;a>i;i++)n[i]&&n[i].children&&n[i].unbind(ke);return r&&this.trigger(ke,{action:"add",index:e,items:s}),n},shift:function(){var e=this.length,t=Le.apply(this);return e&&this.trigger(ke,{action:"remove",index:0,items:[t]}),t},unshift:function(){var e,t=this.wrapAll(arguments);return e=Ee.apply(this,t),this.trigger(ke,{action:"add",index:0,items:t}),e},indexOf:function(e){var t,r,n=this;for(t=0,r=n.length;r>t;t++)if(n[t]===e)return t;return-1},forEach:function(e){for(var t=0,r=this.length;r>t;t++)e(this[t],t,this)},map:function(e){for(var t=0,r=[],n=this.length;n>t;t++)r[t]=e(this[t],t,this);return r},reduce:function(e){var t,r=0,n=this.length;for(2==arguments.length?t=arguments[1]:n>r&&(t=this[r++]);n>r;r++)t=e(t,this[r],r,this);return t},reduceRight:function(e){var t,r=this.length-1;for(2==arguments.length?t=arguments[1]:r>0&&(t=this[r--]);r>=0;r--)t=e(t,this[r],r,this);return t},filter:function(e){for(var t,r=0,n=[],i=this.length;i>r;r++)t=this[r],e(t,r,this)&&(n[n.length]=t);return n},find:function(e){for(var t,r=0,n=this.length;n>r;r++)if(t=this[r],e(t,r,this))return t},every:function(e){for(var t,r=0,n=this.length;n>r;r++)if(t=this[r],!e(t,r,this))return!1;return!0},some:function(e){for(var t,r=0,n=this.length;n>r;r++)if(t=this[r],e(t,r,this))return!0;return!1},remove:function(e){var t=this.indexOf(e);-1!==t&&this.splice(t,1)},empty:function(){this.splice(0,this.length)}}),Qe=We.extend({init:function(e,t){pe.fn.init.call(this),this.type=t||Ke;for(var r=0;e.length>r;r++)this[r]=e[r];this.length=r,this._parent=ae(function(){return this},this)},at:function(e){var t=this[e];return t instanceof this.type?t.parent=this._parent:t=this[e]=this.wrap(t,this._parent),t}}),Ke=pe.extend({init:function(e){var t,r,n=this,i=function(){return n};pe.fn.init.call(this),this._handlers={};for(r in e)t=e[r],"object"==typeof t&&t&&!t.getTime&&"_"!=r.charAt(0)&&(t=n.wrap(t,r,i)),n[r]=t;n.uid=ce.guid()},shouldSerialize:function(e){return this.hasOwnProperty(e)&&"_handlers"!==e&&"_events"!==e&&typeof this[e]!==me&&"uid"!==e},forEach:function(e){for(var t in this)this.shouldSerialize(t)&&e(this[t],t)},toJSON:function(){var e,t,r={};for(t in this)this.shouldSerialize(t)&&(e=this[t],(e instanceof Ke||e instanceof We)&&(e=e.toJSON()),r[t]=e);return r},get:function(e){var t,r=this;return r.trigger(qe,{field:e}),t="this"===e?r:ce.getter(e,!0)(r)},_set:function(e,t){var r,n,i,a=this,s=e.indexOf(".")>=0;if(s)for(r=e.split("."),n="";r.length>1;){if(n+=r.shift(),i=ce.getter(n,!0)(a),i instanceof Ke)return i.set(r.join("."),t),s;n+="."}return ce.setter(e)(a,t),s},set:function(e,t){var r=this,n=!1,i=e.indexOf(".")>=0,a=ce.getter(e,!0)(r);return a!==t&&(a instanceof pe&&this._handlers[e]&&(this._handlers[e].get&&a.unbind(qe,this._handlers[e].get),a.unbind(ke,this._handlers[e].change)),n=r.trigger("set",{field:e,value:t}),n||(i||(t=r.wrap(t,e,function(){return r})),(!r._set(e,t)||e.indexOf("(")>=0||e.indexOf("[")>=0)&&r.trigger(ke,{field:e}))),n},parent:fe,wrap:function(e,t,n){var i,a,s,o,u=this,l=Be.call(e);return null==e||"[object Object]"!==l&&"[object Array]"!==l||(s=e instanceof We,o=e instanceof Y,"[object Object]"!==l||o||s?("[object Array]"===l||s||o)&&(s||o||(e=new We(e)),a=r(u,ke,t,!1),e.bind(ke,a),u._handlers[t]={change:a}):(e instanceof Ke||(e=new Ke(e)),i=r(u,qe,t,!0),e.bind(qe,i),a=r(u,ke,t,!0),e.bind(ke,a),u._handlers[t]={get:i,change:a}),e.parent=n),e}}),$e={number:function(e){return ce.parseFloat(e)},date:function(e){return ce.parseDate(e)},"boolean":function(e){return typeof e===ve?"true"===e.toLowerCase():null!=e?!!e:e},string:function(e){return null!=e?e+"":e},"default":function(e){return e}},Xe={string:"",number:0,date:new Date,"boolean":!1,"default":""},Ye=Ke.extend({init:function(r){var n,i,a=this;if((!r||e.isEmptyObject(r))&&(r=e.extend({},a.defaults,r),a._initializers))for(n=0;a._initializers.length>n;n++)i=a._initializers[n],r[i]=a.defaults[i]();Ke.fn.init.call(a,r),a.dirty=!1,a.idField&&(a.id=a.get(a.idField),a.id===t&&(a.id=a._defaultId))},shouldSerialize:function(e){return Ke.fn.shouldSerialize.call(this,e)&&"uid"!==e&&!("id"!==this.idField&&"id"===e)&&"dirty"!==e&&"_accessors"!==e},_parse:function(e,t){var r,n=this,a=e,s=n.fields||{};return e=s[e],e||(e=i(s,a)),e&&(r=e.parse,!r&&e.type&&(r=$e[e.type.toLowerCase()])),r?r(t):t},_notifyChange:function(e){var t=e.action;("add"==t||"remove"==t)&&(this.dirty=!0)},editable:function(e){return e=(this.fields||{})[e],e?e.editable!==!1:!0},set:function(e,t,r){var i=this,a=i.dirty;i.editable(e)&&(t=i._parse(e,t),n(t,i.get(e))||(i.dirty=!0,Ke.fn.set.call(i,e,t,r)&&!a&&(i.dirty=a)))},accept:function(e){var t,r,n=this,i=function(){return n};for(t in e)r=e[t],"_"!=t.charAt(0)&&(r=n.wrap(e[t],t,i)),n._set(t,r);n.idField&&(n.id=n.get(n.idField)),n.dirty=!1},isNew:function(){return this.id===this._defaultId}});Ye.define=function(e,r){r===t&&(r=e,e=Ye);var n,i,a,s,o,u,l,d,h=ie({defaults:{}},r),f={},c=h.id,g=[];if(c&&(h.idField=c),h.id&&delete h.id,c&&(h.defaults[c]=h._defaultId=""),"[object Array]"===Be.call(h.fields)){for(u=0,l=h.fields.length;l>u;u++)a=h.fields[u],typeof a===ve?f[a]={}:a.field&&(f[a.field]=a);h.fields=f}for(i in h.fields)a=h.fields[i],s=a.type||"default",o=null,d=i,i=typeof a.field===ve?a.field:i,a.nullable||(o=h.defaults[d!==i?d:i]=a.defaultValue!==t?a.defaultValue:Xe[s.toLowerCase()],"function"==typeof o&&g.push(i)),r.id===i&&(h._defaultId=o),h.defaults[d!==i?d:i]=o,a.parse=a.parse||$e[s];return g.length>0&&(h._initializers=g),n=e.extend(h),n.define=function(e){return Ye.define(n,e)},h.fields&&(n.fields=h.fields,n.idField=h.idField),n},U={selector:function(e){return ge(e)?e:Te(e)},compare:function(e){var t=this.selector(e);return function(e,r){return e=t(e),r=t(r),null==e&&null==r?0:null==e?-1:null==r?1:e.localeCompare?e.localeCompare(r):e>r?1:r>e?-1:0}},create:function(e){var t=e.compare||this.compare(e.field);return"desc"==e.dir?function(e,r){return t(r,e,!0)}:t},combine:function(e){return function(t,r){var n,i,a=e[0](t,r);for(n=1,i=e.length;i>n;n++)a=a||e[n](t,r);return a}}},H=ie({},U,{asc:function(e){var t=this.selector(e);return function(e,r){var n=t(e),i=t(r);return n&&n.getTime&&i&&i.getTime&&(n=n.getTime(),i=i.getTime()),n===i?e.__position-r.__position:null==n?-1:null==i?1:n.localeCompare?n.localeCompare(i):n>i?1:-1}},desc:function(e){var t=this.selector(e);return function(e,r){var n=t(e),i=t(r);return n&&n.getTime&&i&&i.getTime&&(n=n.getTime(),i=i.getTime()),n===i?e.__position-r.__position:null==n?1:null==i?-1:i.localeCompare?i.localeCompare(n):i>n?1:-1}},create:function(e){return this[e.dir](e.field)}}),B=function(e,t){var r,n=e.length,i=Array(n);for(r=0;n>r;r++)i[r]=t(e[r],r,e);return i},J=function(){function e(e){return e.replace(Ve,"\\").replace(Je,"")}function t(t,r,n,i){var a;return null!=n&&(typeof n===ve&&(n=e(n),a=He.exec(n),a?n=new Date(+a[1]):i?(n="'"+n.toLowerCase()+"'",r="(("+r+" || '')+'').toLowerCase()"):n="'"+n+"'"),n.getTime&&(r="("+r+"&&"+r+".getTime?"+r+".getTime():"+r+")",n=n.getTime())),r+" "+t+" "+n}return{quote:function(t){return t&&t.getTime?"new Date("+t.getTime()+")":"string"==typeof t?"'"+e(t)+"'":""+t},eq:function(e,r,n){return t("==",e,r,n)},neq:function(e,r,n){return t("!=",e,r,n)},gt:function(e,r,n){return t(">",e,r,n)},gte:function(e,r,n){return t(">=",e,r,n)},lt:function(e,r,n){return t("<",e,r,n)},lte:function(e,r,n){return t("<=",e,r,n)},startswith:function(t,r,n){return n&&(t="("+t+" || '').toLowerCase()",r&&(r=r.toLowerCase())),r&&(r=e(r)),t+".lastIndexOf('"+r+"', 0) == 0"},doesnotstartwith:function(t,r,n){return n&&(t="("+t+" || '').toLowerCase()",r&&(r=r.toLowerCase())),r&&(r=e(r)),t+".lastIndexOf('"+r+"', 0) == -1"},endswith:function(t,r,n){return n&&(t="("+t+" || '').toLowerCase()",r&&(r=r.toLowerCase())),r&&(r=e(r)),t+".indexOf('"+r+"', "+t+".length - "+(r||"").length+") >= 0"},doesnotendwith:function(t,r,n){return n&&(t="("+t+" || '').toLowerCase()",r&&(r=r.toLowerCase())),r&&(r=e(r)),t+".indexOf('"+r+"', "+t+".length - "+(r||"").length+") < 0"},contains:function(t,r,n){return n&&(t="("+t+" || '').toLowerCase()",r&&(r=r.toLowerCase())),r&&(r=e(r)),t+".indexOf('"+r+"') >= 0"},doesnotcontain:function(t,r,n){return n&&(t="("+t+" || '').toLowerCase()",r&&(r=r.toLowerCase())),r&&(r=e(r)),t+".indexOf('"+r+"') == -1"},isempty:function(e){return e+" === ''"},isnotempty:function(e){return e+" !== ''"},isnull:function(e){return e+" === null || "+e+" === undefined"},isnotnull:function(e){return e+" !== null && "+e+" !== undefined"}}}(),a.filterExpr=function(e){var r,n,i,s,o,u,l=[],d={and:" && ",or:" || "},h=[],f=[],c=e.filters;for(r=0,n=c.length;n>r;r++)i=c[r],o=i.field,u=i.operator,i.filters?(s=a.filterExpr(i),i=s.expression.replace(/__o\[(\d+)\]/g,function(e,t){return t=+t,"__o["+(f.length+t)+"]"}).replace(/__f\[(\d+)\]/g,function(e,t){return t=+t,"__f["+(h.length+t)+"]"}),f.push.apply(f,s.operators),h.push.apply(h,s.fields)):(typeof o===me?(s="__f["+h.length+"](d)",h.push(o)):s=ce.expr(o),typeof u===me?(i="__o["+f.length+"]("+s+", "+J.quote(i.value)+")",f.push(u)):i=J[(u||"eq").toLowerCase()](s,i.value,i.ignoreCase!==t?i.ignoreCase:!0)),l.push(i);return{expression:"("+l.join(d[e.logic])+")",fields:h,operators:f}},V={"==":"eq",equals:"eq",isequalto:"eq",equalto:"eq",equal:"eq","!=":"neq",ne:"neq",notequals:"neq",isnotequalto:"neq",notequalto:"neq",notequal:"neq","<":"lt",islessthan:"lt",lessthan:"lt",less:"lt","<=":"lte",le:"lte",islessthanorequalto:"lte",lessthanequal:"lte",">":"gt",isgreaterthan:"gt",greaterthan:"gt",greater:"gt",">=":"gte",isgreaterthanorequalto:"gte",greaterthanequal:"gte",ge:"gte",notsubstringof:"doesnotcontain",isnull:"isnull",isempty:"isempty",isnotempty:"isnotempty"},a.normalizeFilter=u,a.compareFilters=f,a.prototype={toArray:function(){return this.data},range:function(e,t){return new a(this.data.slice(e,e+t))},skip:function(e){return new a(this.data.slice(e))},take:function(e){return new a(this.data.slice(0,e))},select:function(e){return new a(B(this.data,e))},order:function(e,t){var r={dir:t};return e&&(e.compare?r.compare=e.compare:r.field=e),new a(this.data.slice(0).sort(U.create(r)))},orderBy:function(e){return this.order(e,"asc")},orderByDescending:function(e){return this.order(e,"desc")},sort:function(e,t,r){var n,i,a=s(e,t),o=[];if(r=r||U,a.length){for(n=0,i=a.length;i>n;n++)o.push(r.create(a[n]));return this.orderBy({compare:r.combine(o)})}return this},filter:function(e){var t,r,n,i,s,o,l,d,h=this.data,f=[];if(e=u(e),!e||0===e.filters.length)return this;for(i=a.filterExpr(e),o=i.fields,l=i.operators,s=d=Function("d, __f, __o","return "+i.expression),(o.length||l.length)&&(d=function(e){return s(e,o,l)}),t=0,n=h.length;n>t;t++)r=h[t],d(r)&&f.push(r);return new a(f)},group:function(e,t){e=g(e||[]),t=t||this.data;var r,n=this,i=new a(n.data);return e.length>0&&(r=e[0],i=i.groupBy(r).select(function(n){var i=new a(t).filter([{field:n.field,operator:"eq",value:n.value,ignoreCase:!1}]);return{field:n.field,value:n.value,items:e.length>1?new a(n.items).group(e.slice(1),i.toArray()).toArray():n.items,hasSubgroups:e.length>1,aggregates:i.aggregate(r.aggregates)}})),i},groupBy:function(e){if(oe(e)||!this.data.length)return new a([]);var t,r,n,i,s=e.field,o=this._sortForGrouping(s,e.dir||"asc"),u=ce.accessor(s),l=u.get(o[0],s),d={field:s,value:l,items:[]},h=[d];for(n=0,i=o.length;i>n;n++)t=o[n],r=u.get(t,s),p(l,r)||(l=r,d={field:s,value:l,items:[]},h.push(d)),d.items.push(t);return new a(h)},_sortForGrouping:function(e,t){var r,n,i=this.data;if(!Ue){for(r=0,n=i.length;n>r;r++)i[r].__position=r;for(i=new a(i).sort(e,t,H).toArray(),r=0,n=i.length;n>r;r++)delete i[r].__position;return i}return this.sort(e,t).toArray()},aggregate:function(e){var t,r,n={},i={};if(e&&e.length)for(t=0,r=this.data.length;r>t;t++)_(n,e,this.data[t],t,r,i);return n}},W={sum:function(e,t,r){var n=r.get(t);return v(e)?v(n)&&(e+=n):e=n,e},count:function(e){return(e||0)+1},average:function(e,r,n,i,a,s){var o=n.get(r);return s.count===t&&(s.count=0),v(e)?v(o)&&(e+=o):e=o,v(o)&&s.count++,i==a-1&&v(e)&&(e/=s.count),e},max:function(e,t,r){var n=r.get(t);return v(e)||m(e)||(e=n),n>e&&(v(n)||m(n))&&(e=n),e},min:function(e,t,r){var n=r.get(t);return v(e)||m(e)||(e=n),e>n&&(v(n)||m(n))&&(e=n),e}},a.process=function(e,r){r=r||{};var n,i=new a(e),o=r.group,u=g(o||[]).concat(s(r.sort||[])),l=r.filterCallback,d=r.filter,h=r.skip,f=r.take;return d&&(i=i.filter(d),l&&(i=l(i)),n=i.toArray().length),u&&(i=i.sort(u),o&&(e=i.toArray())),h!==t&&f!==t&&(i=i.range(h,f)),o&&(i=i.group(o,e)),{total:n,data:i.toArray()}},Q=_e.extend({init:function(e){this.data=e.data},read:function(e){e.success(this.data)},update:function(e){e.success(e.data)},create:function(e){e.success(e.data)},destroy:function(e){e.success(e.data)}}),K=_e.extend({init:function(e){var t,r=this;e=r.options=ie({},r.options,e),he(Re,function(t,r){typeof e[r]===ve&&(e[r]={url:e[r]})}),r.cache=e.cache?$.create(e.cache):{find:fe,add:fe},t=e.parameterMap,ge(e.push)&&(r.push=e.push),r.push||(r.push=Pe),r.parameterMap=ge(t)?t:function(e){var r={};return he(e,function(e,n){e in t&&(e=t[e],se(e)&&(n=e.value(n),e=e.key)),r[e]=n}),r}},options:{parameterMap:Pe},create:function(e){return de(this.setup(e,ye))},read:function(r){var n,i,a,s=this,o=s.cache;r=s.setup(r,Se),n=r.success||fe,i=r.error||fe,a=o.find(r.data),a!==t?n(a):(r.success=function(e){o.add(r.data,e),n(e)},e.ajax(r))},update:function(e){return de(this.setup(e,be))},destroy:function(e){return de(this.setup(e,we))},setup:function(e,t){e=e||{};var r,n=this,i=n.options[t],a=ge(i.data)?i.data(e.data):i.data;return e=ie(!0,{},i,e),r=ie(!0,{},a,e.data),e.data=n.parameterMap(r,t),ge(e.url)&&(e.url=e.url(r)),e}}),$=_e.extend({init:function(){this._store={}},add:function(e,r){e!==t&&(this._store[Fe(e)]=r)},find:function(e){return this._store[Fe(e)]},clear:function(){this._store={}},remove:function(e){delete this._store[Fe(e)]}}),$.create=function(e){var t={inmemory:function(){return new $}};return se(e)&&ge(e.find)?e:e===!0?new $:t[e]()},X=_e.extend({init:function(e){var t,r,n,i,a,s,o,u,l,d,h,f,c,g=this;e=e||{};for(t in e)r=e[t],g[t]=typeof r===ve?Te(r):r;i=e.modelBase||Ye,se(g.model)&&(g.model=n=i.define(g.model)),a=ae(g.data,g),g._dataAccessFunction=a,g.model&&(s=ae(g.groups,g),o=ae(g.serialize,g),u={},l={},d={},h={},f=!1,n=g.model,n.fields&&(he(n.fields,function(e,t){var r;c=e,se(t)&&t.field?c=t.field:typeof t===ve&&(c=t),se(t)&&t.from&&(r=t.from),f=f||r&&r!==e||c!==e,l[e]=Te(r||c),d[e]=Te(e),u[r||c]=e,h[e]=r||c}),!e.serialize&&f&&(g.serialize=k(o,n,S,d,u,h))),g._dataAccessFunction=a,g.data=k(a,n,b,l,u,h),g.groups=k(s,n,w,l,u,h))},errors:function(e){return e?e.errors:null},parse:Pe,data:Pe,total:function(e){return e.length},groups:Pe,aggregates:function(){return{}},serialize:function(e){return e}}),Y=pe.extend({init:function(e){var r,n,i,a=this;e&&(n=e.data),e=a.options=ie({},a.options,e),a._map={},a._prefetch={},a._data=[],a._pristineData=[],a._ranges=[],a._view=[],a._pristineTotal=0,a._destroyed=[],a._pageSize=e.pageSize,a._page=e.page||(e.pageSize?1:t),a._sort=s(e.sort),a._filter=u(e.filter),a._group=g(e.group),a._aggregate=e.aggregate,a._total=e.total,a._shouldDetachObservableParents=!0,pe.fn.init.call(a),a.transport=Z.create(e,n,a),ge(a.transport.push)&&a.transport.push({pushCreate:ae(a._pushCreate,a),pushUpdate:ae(a._pushUpdate,a),pushDestroy:ae(a._pushDestroy,a)}),null!=e.offlineStorage&&("string"==typeof e.offlineStorage?(i=e.offlineStorage,a._storage={getItem:function(){return JSON.parse(localStorage.getItem(i))},setItem:function(e){localStorage.setItem(i,Fe(a.reader.serialize(e)))}}):a._storage=e.offlineStorage),a.reader=new ce.data.readers[e.schema.type||"json"](e.schema),r=a.reader.model||{},a._detachObservableParents(),a._data=a._observe(a._data),a._online=!0,a.bind(["push",Ce,ke,De,xe,ze,Oe],e)},options:{data:null,schema:{modelBase:Ye},offlineStorage:null,serverSorting:!1,serverPaging:!1,serverFiltering:!1,serverGrouping:!1,serverAggregates:!1,batch:!1},clone:function(){return this},online:function(r){return r!==t?this._online!=r&&(this._online=r,r)?this.sync():e.Deferred().resolve().promise():this._online},offlineData:function(e){return null==this.options.offlineStorage?null:e!==t?this._storage.setItem(e):this._storage.getItem()||[]},_isServerGrouped:function(){var e=this.group()||[];return this.options.serverGrouping&&e.length},_pushCreate:function(e){this._push(e,"pushCreate")},_pushUpdate:function(e){this._push(e,"pushUpdate")},_pushDestroy:function(e){this._push(e,"pushDestroy")},_push:function(e,t){var r=this._readData(e);r||(r=e),this[t](r)},_flatData:function(e,t){if(e){if(this._isServerGrouped())return q(e);if(!t)for(var r=0;e.length>r;r++)e.at(r)}return e},parent:fe,get:function(e){var t,r,n=this._flatData(this._data);for(t=0,r=n.length;r>t;t++)if(n[t].id==e)return n[t]},getByUid:function(e){var t,r,n=this._flatData(this._data);if(n)for(t=0,r=n.length;r>t;t++)if(n[t].uid==e)return n[t]},indexOf:function(e){return F(this._data,e)},at:function(e){return this._data.at(e)},data:function(e){var r,n=this;if(e===t){if(n._data)for(r=0;n._data.length>r;r++)n._data.at(r);return n._data}n._detachObservableParents(),n._data=this._observe(e),n._pristineData=e.slice(0),n._storeData(),n._ranges=[],n.trigger("reset"),n._addRange(n._data),n._total=n._data.length,n._pristineTotal=n._total,n._process(n._data)},view:function(e){return e===t?this._view:(this._view=this._observeView(e),t)},_observeView:function(e){var t,r=this;return R(e,r._data,r._ranges,r.reader.model||Ke,r._isServerGrouped()),t=new Qe(e,r.reader.model),t.parent=function(){return r.parent()},t},flatView:function(){var e=this.group()||[];return e.length?q(this._view):this._view},add:function(e){return this.insert(this._data.length,e)},_createNewModel:function(e){return this.reader.model?new this.reader.model(e):e instanceof Ke?e:new Ke(e)},insert:function(e,t){return t||(t=e,e=0),t instanceof Ye||(t=this._createNewModel(t)),this._isServerGrouped()?this._data.splice(e,0,this._wrapInEmptyGroup(t)):this._data.splice(e,0,t),t},pushCreate:function(e){var t,r,n,i,a,s;ue(e)||(e=[e]),t=[],r=this.options.autoSync,this.options.autoSync=!1;try{for(n=0;e.length>n;n++)i=e[n],a=this.add(i),t.push(a),s=a.toJSON(),this._isServerGrouped()&&(s=this._wrapInEmptyGroup(s)),this._pristineData.push(s)}finally{this.options.autoSync=r}t.length&&this.trigger("push",{type:"create",items:t})},pushUpdate:function(e){var t,r,n,i,a;for(ue(e)||(e=[e]),t=[],r=0;e.length>r;r++)n=e[r],i=this._createNewModel(n),a=this.get(i.id),a?(t.push(a),a.accept(n),a.trigger(ke),this._updatePristineForModel(a,n)):this.pushCreate(n);t.length&&this.trigger("push",{type:"update",items:t})},pushDestroy:function(e){var t=this._removeItems(e);t.length&&this.trigger("push",{type:"destroy",items:t})},_removeItems:function(e){var t,r,n,i,a,s;ue(e)||(e=[e]),t=[],r=this.options.autoSync,this.options.autoSync=!1;try{for(n=0;e.length>n;n++)i=e[n],a=this._createNewModel(i),s=!1,this._eachItem(this._data,function(e){var r,n;for(r=0;e.length>r;r++)if(n=e.at(r),n.id===a.id){t.push(n),e.splice(r,1),s=!0;break}}),s&&(this._removePristineForModel(a),this._destroyed.pop())}finally{this.options.autoSync=r}return t},remove:function(e){var r,n=this,i=n._isServerGrouped();return this._eachItem(n._data,function(a){return r=P(a,e),r&&i?(r.isNew&&r.isNew()||n._destroyed.push(r),!0):t}),this._removeModelFromRanges(e),this._updateRangesLength(),e},destroyed:function(){return this._destroyed},created:function(){var e,t,r=[],n=this._flatData(this._data);for(e=0,t=n.length;t>e;e++)n[e].isNew&&n[e].isNew()&&r.push(n[e]);return r},updated:function(){var e,t,r=[],n=this._flatData(this._data);for(e=0,t=n.length;t>e;e++)n[e].isNew&&!n[e].isNew()&&n[e].dirty&&r.push(n[e]);return r},sync:function(){var t,r=this,n=[],i=[],a=r._destroyed,s=e.Deferred().resolve().promise();if(r.online()){if(!r.reader.model)return s;n=r.created(),i=r.updated(),t=[],r.options.batch&&r.transport.submit?t=r._sendSubmit(n,i,a):(t.push.apply(t,r._send("create",n)),t.push.apply(t,r._send("update",i)),t.push.apply(t,r._send("destroy",a))),s=e.when.apply(null,t).then(function(){var e,t;for(e=0,t=arguments.length;t>e;e++)r._accept(arguments[e]);r._storeData(!0),r._change({action:"sync"}),r.trigger(xe)})}else r._storeData(!0),r._change({action:"sync"});return s},cancelChanges:function(e){var t=this;e instanceof ce.data.Model?t._cancelModel(e):(t._destroyed=[],t._detachObservableParents(),t._data=t._observe(t._pristineData),t.options.serverPaging&&(t._total=t._pristineTotal),t._ranges=[],t._addRange(t._data),t._change())},hasChanges:function(){var e,t,r=this._flatData(this._data);if(this._destroyed.length)return!0;for(e=0,t=r.length;t>e;e++)if(r[e].isNew&&r[e].isNew()||r[e].dirty)return!0;return!1},_accept:function(t){var r,n=this,i=t.models,a=t.response,s=0,o=n._isServerGrouped(),u=n._pristineData,l=t.type;if(n.trigger(ze,{response:a,type:l}),a&&!oe(a)){if(a=n.reader.parse(a),n._handleCustomErrors(a))return;a=n.reader.data(a),ue(a)||(a=[a])}else a=e.map(i,function(e){return e.toJSON()});for("destroy"===l&&(n._destroyed=[]),s=0,r=i.length;r>s;s++)"destroy"!==l?(i[s].accept(a[s]),"create"===l?u.push(o?n._wrapInEmptyGroup(i[s]):a[s]):"update"===l&&n._updatePristineForModel(i[s],a[s])):n._removePristineForModel(i[s])},_updatePristineForModel:function(e,t){this._executeOnPristineForModel(e,function(e,r){ce.deepExtend(r[e],t)})},_executeOnPristineForModel:function(e,r){this._eachPristineItem(function(n){var i=T(n,e);return i>-1?(r(i,n),!0):t})},_removePristineForModel:function(e){this._executeOnPristineForModel(e,function(e,t){t.splice(e,1)})},_readData:function(e){var t=this._isServerGrouped()?this.reader.groups:this.reader.data;return t.call(this.reader,e)},_eachPristineItem:function(e){this._eachItem(this._pristineData,e)},_eachItem:function(e,t){e&&e.length&&(this._isServerGrouped()?D(e,t):t(e))},_pristineForModel:function(e){var r,n,i=function(i){return n=T(i,e),n>-1?(r=i[n],!0):t};return this._eachPristineItem(i),r},_cancelModel:function(e){var t=this._pristineForModel(e);this._eachItem(this._data,function(r){var n=F(r,e);n>=0&&(!t||e.isNew()&&!t.__state__?r.splice(n,1):r[n].accept(t))})},_submit:function(t,r){var n=this;n.trigger(De,{type:"submit"}),n.transport.submit(ie({success:function(r,n){var i=e.grep(t,function(e){return e.type==n})[0];i&&i.resolve({response:r,models:i.models,type:n})},error:function(e,r,i){for(var a=0;t.length>a;a++)t[a].reject(e);n.error(e,r,i)}},r))},_sendSubmit:function(t,r,n){var i=this,a=[];return i.options.batch&&(t.length&&a.push(e.Deferred(function(e){e.type="create",e.models=t})),r.length&&a.push(e.Deferred(function(e){e.type="update",e.models=r})),n.length&&a.push(e.Deferred(function(e){e.type="destroy",e.models=n})),i._submit(a,{data:{created:i.reader.serialize(y(t)),updated:i.reader.serialize(y(r)),destroyed:i.reader.serialize(y(n))}})),a},_promise:function(t,r,n){var i=this;return e.Deferred(function(e){i.trigger(De,{type:n}),i.transport[n].call(i.transport,ie({success:function(t){e.resolve({response:t,models:r,type:n})},error:function(t,r,n){e.reject(t),i.error(t,r,n)}},t))}).promise()},_send:function(e,t){var r,n,i=this,a=[],s=i.reader.serialize(y(t));if(i.options.batch)t.length&&a.push(i._promise({data:{models:s}},t,e));else for(r=0,n=t.length;n>r;r++)a.push(i._promise({data:s[r]},[t[r]],e));return a},read:function(t){var r=this,n=r._params(t),i=e.Deferred();return r._queueRequest(n,function(){var e=r.trigger(De,{type:"read"});e?(r._dequeueRequest(),i.resolve(e)):(r.trigger(Oe),r._ranges=[],r.trigger("reset"),r.online()?r.transport.read({data:n,success:function(e){r.success(e,n),i.resolve()},error:function(){var e=Ge.call(arguments);r.error.apply(r,e),i.reject.apply(i,e)}}):null!=r.options.offlineStorage&&(r.success(r.offlineData(),n),
i.resolve()))}),i.promise()},_readAggregates:function(e){return this.reader.aggregates(e)},success:function(e){var r,n,i,a,s,o,u,l,d=this,h=d.options;if(d.trigger(ze,{response:e,type:"read"}),d.online()){if(e=d.reader.parse(e),d._handleCustomErrors(e))return d._dequeueRequest(),t;d._total=d.reader.total(e),d._aggregate&&h.serverAggregates&&(d._aggregateResult=d._readAggregates(e)),e=d._readData(e)}else{for(e=d._readData(e),r=[],n={},i=d.reader.model,a=i?i.idField:"id",s=0;this._destroyed.length>s;s++)o=this._destroyed[s][a],n[o]=o;for(s=0;e.length>s;s++)u=e[s],l=u.__state__,"destroy"==l?n[u[a]]||this._destroyed.push(this._createNewModel(u)):r.push(u);e=r,d._total=e.length}d._pristineTotal=d._total,d._pristineData=e.slice(0),d._detachObservableParents(),d._data=d._observe(e),null!=d.options.offlineStorage&&d._eachItem(d._data,function(e){var t,r;for(t=0;e.length>t;t++)r=e.at(t),"update"==r.__state__&&(r.dirty=!0)}),d._storeData(),d._addRange(d._data),d._process(d._data),d._dequeueRequest()},_detachObservableParents:function(){if(this._data&&this._shouldDetachObservableParents)for(var e=0;this._data.length>e;e++)this._data[e].parent&&(this._data[e].parent=fe)},_storeData:function(e){function t(e){var r,n,i,a=[];for(r=0;e.length>r;r++)n=e.at(r),i=n.toJSON(),s&&n.items?i.items=t(n.items):(i.uid=n.uid,o&&(n.isNew()?i.__state__="create":n.dirty&&(i.__state__="update"))),a.push(i);return a}var r,n,i,a,s=this._isServerGrouped(),o=this.reader.model;if(null!=this.options.offlineStorage){for(r=t(this._data),n=[],i=0;this._destroyed.length>i;i++)a=this._destroyed[i].toJSON(),a.__state__="destroy",n.push(a);this.offlineData(r.concat(n)),e&&(this._pristineData=this._readData(r))}},_addRange:function(e){var t=this,r=t._skip||0,n=r+t._flatData(e,!0).length;t._ranges.push({start:r,end:n,data:e,timestamp:(new Date).getTime()}),t._ranges.sort(function(e,t){return e.start-t.start})},error:function(e,t,r){this._dequeueRequest(),this.trigger(ze,{}),this.trigger(Ce,{xhr:e,status:t,errorThrown:r})},_params:function(e){var t=this,r=ie({take:t.take(),skip:t.skip(),page:t.page(),pageSize:t.pageSize(),sort:t._sort,filter:t._filter,group:t._group,aggregate:t._aggregate},e);return t.options.serverPaging||(delete r.take,delete r.skip,delete r.page,delete r.pageSize),t.options.serverGrouping?t.reader.model&&r.group&&(r.group=M(r.group,t.reader.model)):delete r.group,t.options.serverFiltering?t.reader.model&&r.filter&&(r.filter=N(r.filter,t.reader.model)):delete r.filter,t.options.serverSorting?t.reader.model&&r.sort&&(r.sort=M(r.sort,t.reader.model)):delete r.sort,t.options.serverAggregates?t.reader.model&&r.aggregate&&(r.aggregate=M(r.aggregate,t.reader.model)):delete r.aggregate,r},_queueRequest:function(e,r){var n=this;n._requestInProgress?n._pending={callback:ae(r,n),options:e}:(n._requestInProgress=!0,n._pending=t,r())},_dequeueRequest:function(){var e=this;e._requestInProgress=!1,e._pending&&e._queueRequest(e._pending.options,e._pending.callback)},_handleCustomErrors:function(e){if(this.reader.errors){var t=this.reader.errors(e);if(t)return this.trigger(Ce,{xhr:null,status:"customerror",errorThrown:"custom error",errors:t}),!0}return!1},_shouldWrap:function(e){var t=this.reader.model;return t&&e.length?!(e[0]instanceof t):!1},_observe:function(e){var t,r=this,n=r.reader.model;return r._shouldDetachObservableParents=!0,e instanceof We?(r._shouldDetachObservableParents=!1,r._shouldWrap(e)&&(e.type=r.reader.model,e.wrapAll(e,e))):(t=r.pageSize()&&!r.options.serverPaging?Qe:We,e=new t(e,r.reader.model),e.parent=function(){return r.parent()}),r._isServerGrouped()&&C(e,n),r._changeHandler&&r._data&&r._data instanceof We?r._data.unbind(ke,r._changeHandler):r._changeHandler=ae(r._change,r),e.bind(ke,r._changeHandler)},_updateTotalForAction:function(e,t){var r=this,n=parseInt(r._total,10);v(r._total)||(n=parseInt(r._pristineTotal,10)),"add"===e?n+=t.length:"remove"===e?n-=t.length:"itemchange"===e||"sync"===e||r.options.serverPaging?"sync"===e&&(n=r._pristineTotal=parseInt(r._total,10)):n=r._pristineTotal,r._total=n},_change:function(e){var t,r,n,i=this,a=e?e.action:"";if("remove"===a)for(t=0,r=e.items.length;r>t;t++)e.items[t].isNew&&e.items[t].isNew()||i._destroyed.push(e.items[t]);!i.options.autoSync||"add"!==a&&"remove"!==a&&"itemchange"!==a?(i._updateTotalForAction(a,e?e.items:[]),i._process(i._data,e)):(n=function(t){"sync"===t.action&&(i.unbind("change",n),i._updateTotalForAction(a,e.items))},i.first("change",n),i.sync())},_calculateAggregates:function(e,t){t=t||{};var r=new a(e),n=t.aggregate,i=t.filter;return i&&(r=r.filter(i)),r.aggregate(n)},_process:function(e,r){var n,i=this,a={};i.options.serverPaging!==!0&&(a.skip=i._skip,a.take=i._take||i._pageSize,a.skip===t&&i._page!==t&&i._pageSize!==t&&(a.skip=(i._page-1)*i._pageSize)),i.options.serverSorting!==!0&&(a.sort=i._sort),i.options.serverFiltering!==!0&&(a.filter=i._filter),i.options.serverGrouping!==!0&&(a.group=i._group),i.options.serverAggregates!==!0&&(a.aggregate=i._aggregate,i._aggregateResult=i._calculateAggregates(e,a)),n=i._queryProcess(e,a),i.view(n.data),n.total===t||i.options.serverFiltering||(i._total=n.total),r=r||{},r.items=r.items||i._view,i.trigger(ke,r)},_queryProcess:function(e,t){return a.process(e,t)},_mergeState:function(e){var r=this;return e!==t&&(r._pageSize=e.pageSize,r._page=e.page,r._sort=e.sort,r._filter=e.filter,r._group=e.group,r._aggregate=e.aggregate,r._skip=r._currentRangeStart=e.skip,r._take=e.take,r._skip===t&&(r._skip=r._currentRangeStart=r.skip(),e.skip=r.skip()),r._take===t&&r._pageSize!==t&&(r._take=r._pageSize,e.take=r._take),e.sort&&(r._sort=e.sort=s(e.sort)),e.filter&&(r._filter=e.filter=u(e.filter)),e.group&&(r._group=e.group=g(e.group)),e.aggregate&&(r._aggregate=e.aggregate=c(e.aggregate))),e},query:function(r){var n,i,a=this.options.serverSorting||this.options.serverPaging||this.options.serverFiltering||this.options.serverGrouping||this.options.serverAggregates;return a||(this._data===t||0===this._data.length)&&!this._destroyed.length?this.read(this._mergeState(r)):(i=this.trigger(De,{type:"read"}),i||(this.trigger(Oe),n=this._queryProcess(this._data,this._mergeState(r)),this.options.serverFiltering||(this._total=n.total!==t?n.total:this._data.length),this._aggregateResult=this._calculateAggregates(this._data,r),this.view(n.data),this.trigger(ze,{type:"read"}),this.trigger(ke,{items:n.data})),e.Deferred().resolve(i).promise())},fetch:function(e){var t=this,r=function(r){r!==!0&&ge(e)&&e.call(t)};return this._query().then(r)},_query:function(e){var t=this;return t.query(ie({},{page:t.page(),pageSize:t.pageSize(),sort:t.sort(),filter:t.filter(),group:t.group(),aggregate:t.aggregate()},e))},next:function(e){var r=this,n=r.page(),i=r.total();return e=e||{},!n||i&&n+1>r.totalPages()?t:(r._skip=r._currentRangeStart=n*r.take(),n+=1,e.page=n,r._query(e),n)},prev:function(e){var r=this,n=r.page();return e=e||{},n&&1!==n?(r._skip=r._currentRangeStart=r._skip-r.take(),n-=1,e.page=n,r._query(e),n):t},page:function(e){var r,n=this;return e!==t?(e=Ae.max(Ae.min(Ae.max(e,1),n.totalPages()),1),n._query({page:e}),t):(r=n.skip(),r!==t?Ae.round((r||0)/(n.take()||1))+1:t)},pageSize:function(e){var r=this;return e!==t?(r._query({pageSize:e,page:1}),t):r.take()},sort:function(e){var r=this;return e!==t?(r._query({sort:e}),t):r._sort},filter:function(e){var r=this;return e===t?r._filter:(r.trigger("reset"),r._query({filter:e,page:1}),t)},group:function(e){var r=this;return e!==t?(r._query({group:e}),t):r._group},total:function(){return parseInt(this._total||0,10)},aggregate:function(e){var r=this;return e!==t?(r._query({aggregate:e}),t):r._aggregate},aggregates:function(){var e=this._aggregateResult;return oe(e)&&(e=this._emptyAggregates(this.aggregate())),e},_emptyAggregates:function(e){var t,r,n={};if(!oe(e))for(t={},ue(e)||(e=[e]),r=0;e.length>r;r++)t[e[r].aggregate]=0,n[e[r].field]=t;return n},_wrapInEmptyGroup:function(e){var t,r,n,i,a=this.group();for(n=a.length-1,i=0;n>=i;n--)r=a[n],t={value:e.get(r.field),field:r.field,items:t?[t]:[e],hasSubgroups:!!t,aggregates:this._emptyAggregates(r.aggregates)};return t},totalPages:function(){var e=this,t=e.pageSize()||e.total();return Ae.ceil((e.total()||0)/t)},inRange:function(e,t){var r=this,n=Ae.min(e+t,r.total());return!r.options.serverPaging&&r._data.length>0?!0:r._findRange(e,n).length>0},lastRange:function(){var e=this._ranges;return e[e.length-1]||{start:0,end:0,data:[]}},firstItemUid:function(){var e=this._ranges;return e.length&&e[0].data.length&&e[0].data[0].uid},enableRequestsInProgress:function(){this._skipRequestsInProgress=!1},_timeStamp:function(){return(new Date).getTime()},range:function(e,r){var n,i,a,s,o,u,l,d;if(this._currentRequestTimeStamp=this._timeStamp(),this._skipRequestsInProgress=!0,e=Ae.min(e||0,this.total()),n=this,i=Ae.max(Ae.floor(e/r),0)*r,a=Ae.min(i+r,n.total()),s=n._findRange(e,Ae.min(e+r,n.total())),s.length){n._pending=t,n._skip=e>n.skip()?Ae.min(a,(n.totalPages()-1)*n.take()):i,n._currentRangeStart=e,n._take=r,o=n.options.serverPaging,u=n.options.serverSorting,l=n.options.serverFiltering,d=n.options.serverAggregates;try{n.options.serverPaging=!0,n._isServerGrouped()||n.group()&&n.group().length||(n.options.serverSorting=!0),n.options.serverFiltering=!0,n.options.serverPaging=!0,n.options.serverAggregates=!0,o&&(n._detachObservableParents(),n._data=s=n._observe(s)),n._process(s)}finally{n.options.serverPaging=o,n.options.serverSorting=u,n.options.serverFiltering=l,n.options.serverAggregates=d}}else r!==t&&(n._rangeExists(i,a)?e>i&&n.prefetch(a,r,function(){n.range(e,r)}):n.prefetch(i,r,function(){e>i&&a<n.total()&&!n._rangeExists(a,Ae.min(a+r,n.total()))?n.prefetch(a,r,function(){n.range(e,r)}):n.range(e,r)}))},_findRange:function(e,r){var n,i,a,o,u,l,d,h,f,c,p,_,v=this,m=v._ranges,y=[],S=v.options,b=S.serverSorting||S.serverPaging||S.serverFiltering||S.serverGrouping||S.serverAggregates;for(i=0,p=m.length;p>i;i++)if(n=m[i],e>=n.start&&n.end>=e){for(c=0,a=i;p>a;a++)if(n=m[a],f=v._flatData(n.data,!0),f.length&&e+c>=n.start&&(l=n.data,d=n.end,b||(_=g(v.group()||[]).concat(s(v.sort()||[])),h=v._queryProcess(n.data,{sort:_,filter:v.filter()}),f=l=h.data,h.total!==t&&(d=h.total)),o=0,e+c>n.start&&(o=e+c-n.start),u=f.length,d>r&&(u-=d-r),c+=u-o,y=v._mergeGroups(y,l,o,u),n.end>=r&&c==r-e))return y;break}return[]},_mergeGroups:function(e,t,r,n){if(this._isServerGrouped()){var i,a=t.toJSON();return e.length&&(i=e[e.length-1]),x(i,a,r,n),e.concat(a)}return e.concat(t.slice(r,n))},skip:function(){var e=this;return e._skip===t?e._page!==t?(e._page-1)*(e.take()||1):t:e._skip},currentRangeStart:function(){return this._currentRangeStart||0},take:function(){return this._take||this._pageSize},_prefetchSuccessHandler:function(e,t,r,n){var i=this,a=i._timeStamp();return function(s){var o,u,l,d=!1,h={start:e,end:t,data:[],timestamp:i._timeStamp()};if(i._dequeueRequest(),i.trigger(ze,{response:s,type:"read"}),s=i.reader.parse(s),l=i._readData(s),l.length){for(o=0,u=i._ranges.length;u>o;o++)if(i._ranges[o].start===e){d=!0,h=i._ranges[o];break}d||i._ranges.push(h)}h.data=i._observe(l),h.end=h.start+i._flatData(h.data,!0).length,i._ranges.sort(function(e,t){return e.start-t.start}),i._total=i.reader.total(s),(n||a>=i._currentRequestTimeStamp||!i._skipRequestsInProgress)&&(r&&l.length?r():i.trigger(ke,{}))}},prefetch:function(e,t,r){var n=this,i=Ae.min(e+t,n.total()),a={take:t,skip:e,page:e/t+1,pageSize:t,sort:n._sort,filter:n._filter,group:n._group,aggregate:n._aggregate};n._rangeExists(e,i)?r&&r():(clearTimeout(n._timeout),n._timeout=setTimeout(function(){n._queueRequest(a,function(){n.trigger(De,{type:"read"})?n._dequeueRequest():n.transport.read({data:n._params(a),success:n._prefetchSuccessHandler(e,i,r),error:function(){var e=Ge.call(arguments);n.error.apply(n,e)}})})},100))},_multiplePrefetch:function(e,t,r){var n=this,i=Ae.min(e+t,n.total()),a={take:t,skip:e,page:e/t+1,pageSize:t,sort:n._sort,filter:n._filter,group:n._group,aggregate:n._aggregate};n._rangeExists(e,i)?r&&r():n.trigger(De,{type:"read"})||n.transport.read({data:n._params(a),success:n._prefetchSuccessHandler(e,i,r,!0)})},_rangeExists:function(e,t){var r,n,i=this,a=i._ranges;for(r=0,n=a.length;n>r;r++)if(e>=a[r].start&&a[r].end>=t)return!0;return!1},_removeModelFromRanges:function(e){var t,r,n,i,a;for(i=0,a=this._ranges.length;a>i&&(n=this._ranges[i],this._eachItem(n.data,function(n){t=P(n,e),t&&(r=!0)}),!r);i++);},_updateRangesLength:function(){var e,t,r,n,i=0;for(r=0,n=this._ranges.length;n>r;r++)e=this._ranges[r],e.start=e.start-i,t=this._flatData(e.data,!0).length,i=e.end-t,e.end=e.start+t}}),Z={},Z.create=function(t,r,n){var i,a=t.transport?e.extend({},t.transport):null;return a?(a.read=typeof a.read===ve?{url:a.read}:a.read,"jsdo"===t.type&&(a.dataSource=n),t.type&&(ce.data.transports=ce.data.transports||{},ce.data.schemas=ce.data.schemas||{},ce.data.transports[t.type]?se(ce.data.transports[t.type])?a=ie(!0,{},ce.data.transports[t.type],a):i=new ce.data.transports[t.type](ie(a,{data:r})):ce.logToConsole("Unknown DataSource transport type '"+t.type+"'.\nVerify that registration scripts for this type are included after Kendo UI on the page.","warn"),t.schema=ie(!0,{},ce.data.schemas[t.type],t.schema)),i||(i=ge(a.read)?a:new K(a))):i=new Q({data:t.data||[]}),i},Y.create=function(e){(ue(e)||e instanceof We)&&(e={data:e});var r,n,i,a=e||{},s=a.data,o=a.fields,u=a.table,l=a.select,d={};if(s||!o||a.transport||(u?s=L(u,o):l&&(s=j(l,o),a.group===t&&s[0]&&s[0].optgroup!==t&&(a.group="optgroup"))),ce.data.Model&&o&&(!a.schema||!a.schema.model)){for(r=0,n=o.length;n>r;r++)i=o[r],i.type&&(d[i.field]=i);oe(d)||(a.schema=ie(!0,a.schema,{model:{fields:d}}))}return a.data=s,l=null,a.select=null,u=null,a.table=null,a instanceof Y?a:new Y(a)},ee=Ye.define({idField:"id",init:function(e){var t=this,r=t.hasChildren||e&&e.hasChildren,n="items",i={};ce.data.Model.fn.init.call(t,e),typeof t.children===ve&&(n=t.children),i={schema:{data:n,model:{hasChildren:r,id:t.idField,fields:t.fields}}},typeof t.children!==ve&&ie(i,t.children),i.data=e,r||(r=i.schema.data),typeof r===ve&&(r=ce.getter(r)),ge(r)&&(t.hasChildren=!!r.call(t,t)),t._childrenOptions=i,t.hasChildren&&t._initChildren(),t._loaded=!(!e||!e._loaded)},_initChildren:function(){var e,t,r,n=this;n.children instanceof te||(e=n.children=new te(n._childrenOptions),t=e.transport,r=t.parameterMap,t.parameterMap=function(e,t){return e[n.idField||"id"]=n.id,r&&(e=r(e,t)),e},e.parent=function(){return n},e.bind(ke,function(e){e.node=e.node||n,n.trigger(ke,e)}),e.bind(Ce,function(e){var t=n.parent();t&&(e.node=e.node||n,t.trigger(Ce,e))}),n._updateChildrenField())},append:function(e){this._initChildren(),this.loaded(!0),this.children.add(e)},hasChildren:!1,level:function(){for(var e=this.parentNode(),t=0;e&&e.parentNode;)t++,e=e.parentNode?e.parentNode():null;return t},_updateChildrenField:function(){var e=this._childrenOptions.schema.data;this[e||"items"]=this.children.data()},_childrenLoaded:function(){this._loaded=!0,this._updateChildrenField()},load:function(){var r,n,i={},a="_query";return this.hasChildren?(this._initChildren(),r=this.children,i[this.idField||"id"]=this.id,this._loaded||(r._data=t,a="read"),r.one(ke,ae(this._childrenLoaded,this)),n=r[a](i)):this.loaded(!0),n||e.Deferred().resolve().promise()},parentNode:function(){var e=this.parent();return e.parent()},loaded:function(e){return e===t?this._loaded:(this._loaded=e,t)},shouldSerialize:function(e){return Ye.fn.shouldSerialize.call(this,e)&&"children"!==e&&"_loaded"!==e&&"hasChildren"!==e&&"_childrenOptions"!==e}}),te=Y.extend({init:function(e){var t=ee.define({children:e});Y.fn.init.call(this,ie(!0,{},{schema:{modelBase:t,model:t}},e)),this._attachBubbleHandlers()},_attachBubbleHandlers:function(){var e=this;e._data.bind(Ce,function(t){e.trigger(Ce,t)})},remove:function(e){var t,r=e.parentNode(),n=this;return r&&r._initChildren&&(n=r.children),t=Y.fn.remove.call(n,e),r&&!n.data().length&&(r.hasChildren=!1),t},success:G("success"),data:G("data"),insert:function(e,t){var r=this.parent();return r&&r._initChildren&&(r.hasChildren=!0,r._initChildren()),Y.fn.insert.call(this,e,t)},_find:function(e,t){var r,n,i,a,s=this._data;if(s){if(i=Y.fn[e].call(this,t))return i;for(s=this._flatData(this._data),r=0,n=s.length;n>r;r++)if(a=s[r].children,a instanceof te&&(i=a[e](t)))return i}},get:function(e){return this._find("get",e)},getByUid:function(e){return this._find("getByUid",e)}}),te.create=function(e){e=e&&e.push?{data:e}:e;var t=e||{},r=t.data,n=t.fields,i=t.list;return r&&r._dataSource?r._dataSource:(r||!n||t.transport||i&&(r=E(i,n)),t.data=r,t instanceof te?t:new te(t))},re=ce.Observable.extend({init:function(e,t,r){ce.Observable.fn.init.call(this),this._prefetching=!1,this.dataSource=e,this.prefetch=!r;var n=this;e.bind("change",function(){n._change()}),e.bind("reset",function(){n._reset()}),this._syncWithDataSource(),this.setViewSize(t)},setViewSize:function(e){this.viewSize=e,this._recalculate()},at:function(e){var r=this.pageSize,n=!0;return e>=this.total()?(this.trigger("endreached",{index:e}),null):this.useRanges?this.useRanges?((this.dataOffset>e||e>=this.skip+r)&&(n=this.range(Math.floor(e/r)*r)),e===this.prefetchThreshold&&this._prefetch(),e===this.midPageThreshold?this.range(this.nextMidRange,!0):e===this.nextPageThreshold?this.range(this.nextFullRange):e===this.pullBackThreshold&&this.range(this.offset===this.skip?this.previousMidRange:this.previousFullRange),n?this.dataSource.at(e-this.dataOffset):(this.trigger("endreached",{index:e}),null)):t:this.dataSource.view()[e]},indexOf:function(e){return this.dataSource.data().indexOf(e)+this.dataOffset},total:function(){return parseInt(this.dataSource.total(),10)},next:function(){var e=this,t=e.pageSize,r=e.skip-e.viewSize+t,n=Ae.max(Ae.floor(r/t),0)*t;this.offset=r,this.dataSource.prefetch(n,t,function(){e._goToRange(r,!0)})},range:function(e,t){if(this.offset===e)return!0;var r=this,n=this.pageSize,i=Ae.max(Ae.floor(e/n),0)*n,a=this.dataSource;return t&&(i+=n),a.inRange(e,n)?(this.offset=e,this._recalculate(),this._goToRange(e),!0):this.prefetch?(a.prefetch(i,n,function(){r.offset=e,r._recalculate(),r._goToRange(e,!0)}),!1):!0},syncDataSource:function(){var e=this.offset;this.offset=null,this.range(e)},destroy:function(){this.unbind()},_prefetch:function(){var e=this,t=this.pageSize,r=this.skip+t,n=this.dataSource;n.inRange(r,t)||this._prefetching||!this.prefetch||(this._prefetching=!0,this.trigger("prefetching",{skip:r,take:t}),n.prefetch(r,t,function(){e._prefetching=!1,e.trigger("prefetched",{skip:r,take:t})}))},_goToRange:function(e,t){this.offset===e&&(this.dataOffset=e,this._expanding=t,this.dataSource.range(e,this.pageSize),this.dataSource.enableRequestsInProgress())},_reset:function(){this._syncPending=!0},_change:function(){var e=this.dataSource;this.length=this.useRanges?e.lastRange().end:e.view().length,this._syncPending&&(this._syncWithDataSource(),this._recalculate(),this._syncPending=!1,this.trigger("reset",{offset:this.offset})),this.trigger("resize"),this._expanding&&this.trigger("expand"),delete this._expanding},_syncWithDataSource:function(){var e=this.dataSource;this._firstItemUid=e.firstItemUid(),this.dataOffset=this.offset=e.skip()||0,this.pageSize=e.pageSize(),this.useRanges=e.options.serverPaging},_recalculate:function(){var e=this.pageSize,t=this.offset,r=this.viewSize,n=Math.ceil(t/e)*e;this.skip=n,this.midPageThreshold=n+e-1,this.nextPageThreshold=n+r-1,this.prefetchThreshold=n+Math.floor(e/3*2),this.pullBackThreshold=this.offset-1,this.nextMidRange=n+e-r,this.nextFullRange=n,this.previousMidRange=t-r,this.previousFullRange=n-e}}),ne=ce.Observable.extend({init:function(e,t){var r=this;ce.Observable.fn.init.call(r),this.dataSource=e,this.batchSize=t,this._total=0,this.buffer=new re(e,3*t),this.buffer.bind({endreached:function(e){r.trigger("endreached",{index:e.index})},prefetching:function(e){r.trigger("prefetching",{skip:e.skip,take:e.take})},prefetched:function(e){r.trigger("prefetched",{skip:e.skip,take:e.take})},reset:function(){r._total=0,r.trigger("reset")},resize:function(){r._total=Math.ceil(this.length/r.batchSize),r.trigger("resize",{total:r.total(),offset:this.offset})}})},syncDataSource:function(){this.buffer.syncDataSource()},at:function(e){var t,r,n=this.buffer,i=e*this.batchSize,a=this.batchSize,s=[];for(n.offset>i&&n.at(n.offset-1),r=0;a>r&&(t=n.at(i+r),null!==t);r++)s.push(t);return s},total:function(){return this._total},destroy:function(){this.buffer.destroy(),this.unbind()}}),ie(!0,ce.data,{readers:{json:X},Query:a,DataSource:Y,HierarchicalDataSource:te,Node:ee,ObservableObject:Ke,ObservableArray:We,LazyObservableArray:Qe,LocalTransport:Q,RemoteTransport:K,Cache:$,DataReader:X,Model:Ye,Buffer:re,BatchBuffer:ne})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,r){(r||t)()});;!function(t,define){define("kendo.data.signalr.min",["kendo.data.min"],t)}(function(){return function(t){var o=kendo.data.RemoteTransport.extend({init:function(t){var o,e=t&&t.signalr?t.signalr:{},n=e.promise;if(!n)throw Error('The "promise" option must be set.');if("function"!=typeof n.done||"function"!=typeof n.fail)throw Error('The "promise" option must be a Promise.');if(this.promise=n,o=e.hub,!o)throw Error('The "hub" option must be set.');if("function"!=typeof o.on||"function"!=typeof o.invoke)throw Error('The "hub" option is not a valid SignalR hub proxy.');this.hub=o,kendo.data.RemoteTransport.fn.init.call(this,t)},push:function(t){var o=this.options.signalr.client||{};o.create&&this.hub.on(o.create,t.pushCreate),o.update&&this.hub.on(o.update,t.pushUpdate),o.destroy&&this.hub.on(o.destroy,t.pushDestroy)},_crud:function(o,e){var n,i,r=this.hub,s=this.options.signalr.server;if(!s||!s[e])throw Error(kendo.format('The "server.{0}" option must be set.',e));n=[s[e]],i=this.parameterMap(o.data,e),t.isEmptyObject(i)||n.push(i),this.promise.done(function(){r.invoke.apply(r,n).done(o.success).fail(o.error)})},read:function(t){this._crud(t,"read")},create:function(t){this._crud(t,"create")},update:function(t){this._crud(t,"update")},destroy:function(t){this._crud(t,"destroy")}});t.extend(!0,kendo.data,{transports:{signalr:o}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,o,e){(e||o)()});;!function(e,define){define("kendo.data.xml.min",["kendo.core.min"],e)}(function(){return function(e,t){var n=window.kendo,r=e.isArray,i=e.isPlainObject,o=e.map,a=e.each,f=e.extend,d=n.getter,l=n.Class,u=l.extend({init:function(t){var d,l,u,s,c=this,p=t.total,m=t.model,h=t.parse,x=t.errors,g=t.serialize,y=t.data;m&&(i(m)&&(d=t.modelBase||n.data.Model,m.fields&&a(m.fields,function(t,n){i(n)&&n.field?e.isFunction(n.field)||(n=f(n,{field:c.getter(n.field)})):n={field:c.getter(n)},m.fields[t]=n}),l=m.id,l&&(u={},u[c.xpathToMember(l,!0)]={field:c.getter(l)},m.fields=f(u,m.fields),m.id=c.xpathToMember(l)),m=d.define(m)),c.model=m),p&&("string"==typeof p?(p=c.getter(p),c.total=function(e){return parseInt(p(e),10)}):"function"==typeof p&&(c.total=p)),x&&("string"==typeof x?(x=c.getter(x),c.errors=function(e){return x(e)||null}):"function"==typeof x&&(c.errors=x)),y&&("string"==typeof y?(y=c.xpathToMember(y),c.data=function(e){var t,n=c.evaluate(e,y);return n=r(n)?n:[n],c.model&&m.fields?(t=new c.model,o(n,function(e){if(e){var n,r={};for(n in m.fields)r[n]=t._parse(n,m.fields[n].field(e));return r}})):n}):"function"==typeof y&&(c.data=y)),"function"==typeof h&&(s=c.parse,c.parse=function(e){var t=h.call(c,e);return s.call(c,t)}),"function"==typeof g&&(c.serialize=g)},total:function(e){return this.data(e).length},errors:function(e){return e?e.errors:null},serialize:function(e){return e},parseDOM:function(e){var n,i,o,a,f,d,l,u={},s=e.attributes,c=s.length;for(l=0;c>l;l++)d=s[l],u["@"+d.nodeName]=d.nodeValue;for(i=e.firstChild;i;i=i.nextSibling)o=i.nodeType,3===o||4===o?u["#text"]=i.nodeValue:1===o&&(n=this.parseDOM(i),a=i.nodeName,f=u[a],r(f)?f.push(n):f=f!==t?[f,n]:n,u[a]=f);return u},evaluate:function(e,t){for(var n,i,o,a,f,d=t.split(".");n=d.shift();)if(e=e[n],r(e)){for(i=[],t=d.join("."),f=0,o=e.length;o>f;f++)a=this.evaluate(e[f],t),a=r(a)?a:[a],i.push.apply(i,a);return i}return e},parse:function(t){var n,r,i={};return n=t.documentElement||e.parseXML(t).documentElement,r=this.parseDOM(n),i[n.nodeName]=r,i},xpathToMember:function(e,t){return e?(e=e.replace(/^\//,"").replace(/\//g,"."),e.indexOf("@")>=0?e.replace(/\.?(@.*)/,t?"$1":'["$1"]'):e.indexOf("text()")>=0?e.replace(/(\.?text\(\))/,t?"#text":'["#text"]'):e):""},getter:function(e){return d(this.xpathToMember(e),!0)}});e.extend(!0,n.data,{XmlDataReader:u,readers:{xml:u}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});;!function(t,define){define("kendo.fx.min",["kendo.core.min"],t)}(function(){return function(t,e){function i(t){return parseInt(t,10)}function r(t,e){return i(t.css(e))}function n(t){var e,i=[];for(e in t)i.push(e);return i}function s(t){for(var e in t)-1!=L.indexOf(e)&&-1==Q.indexOf(e)&&delete t[e];return t}function o(t,e){var i,r,n,s,o=[],a={};for(r in e)i=r.toLowerCase(),s=H&&-1!=L.indexOf(i),!E.hasHW3D&&s&&-1==Q.indexOf(i)?delete e[r]:(n=e[r],s?o.push(r+"("+n+")"):a[r]=n);return o.length&&(a[at]=o.join(" ")),a}function a(t,e){var r,n,s;return H?(r=t.css(at),r==J?"scale"==e?1:0:(n=r.match(RegExp(e+"\\s*\\(([\\d\\w\\.]+)")),s=0,n?s=i(n[1]):(n=r.match(S)||[0,0,0,0,0],e=e.toLowerCase(),V.test(e)?s=parseFloat(n[3]/n[2]):"translatey"==e?s=parseFloat(n[4]/n[2]):"scale"==e?s=parseFloat(n[2]):"rotate"==e&&(s=parseFloat(Math.atan2(n[2],n[1])))),s)):parseFloat(t.css(e))}function c(t){return t.charAt(0).toUpperCase()+t.substring(1)}function l(t,e){var i=h.extend(e),r=i.prototype.directions;T[c(t)]=i,T.Element.prototype[t]=function(t,e,r,n){return new i(this.element,t,e,r,n)},N(r,function(e,r){T.Element.prototype[t+c(r)]=function(t,e,n){return new i(this.element,r,t,e,n)}})}function d(t,i,r,n){l(t,{directions:v,startValue:function(t){return this._startValue=t,this},endValue:function(t){return this._endValue=t,this},shouldHide:function(){return this._shouldHide},prepare:function(t,s){var o,a,c=this,l="out"===this._direction,d=c.element.data(i),u=!(isNaN(d)||d==r);o=u?d:e!==this._startValue?this._startValue:l?r:n,a=e!==this._endValue?this._endValue:l?n:r,this._reverse?(t[i]=a,s[i]=o):(t[i]=o,s[i]=a),c._shouldHide=s[i]===n}})}function u(t,e){var i=C.directions[e].vertical,r=t[i?Y:X]()/2+"px";return g[e].replace("$size",r)}var f,p,h,m,v,x,g,_,y,k,b,w,C=window.kendo,T=C.effects,N=t.each,P=t.extend,z=t.proxy,E=C.support,R=E.browser,H=E.transforms,D=E.transitions,O={scale:0,scalex:0,scaley:0,scale3d:0},F={translate:0,translatex:0,translatey:0,translate3d:0},I=e!==document.documentElement.style.zoom&&!H,S=/matrix3?d?\s*\(.*,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?/i,A=/^(-?[\d\.\-]+)?[\w\s]*,?\s*(-?[\d\.\-]+)?[\w\s]*/i,V=/translatex?$/i,q=/(zoom|fade|expand)(\w+)/,M=/(zoom|fade|expand)/,$=/[xy]$/i,L=["perspective","rotate","rotatex","rotatey","rotatez","rotate3d","scale","scalex","scaley","scalez","scale3d","skew","skewx","skewy","translate","translatex","translatey","translatez","translate3d","matrix","matrix3d"],Q=["rotate","scale","scalex","scaley","skew","skewx","skewy","translate","translatex","translatey","matrix"],W={rotate:"deg",scale:"",skew:"px",translate:"px"},j=H.css,B=Math.round,U="",G="px",J="none",K="auto",X="width",Y="height",Z="hidden",tt="origin",et="abortId",it="overflow",rt="translate",nt="position",st="completeCallback",ot=j+"transition",at=j+"transform",ct=j+"backface-visibility",lt=j+"perspective",dt="1500px",ut="perspective("+dt+")",ft={left:{reverse:"right",property:"left",transition:"translatex",vertical:!1,modifier:-1},right:{reverse:"left",property:"left",transition:"translatex",vertical:!1,modifier:1},down:{reverse:"up",property:"top",transition:"translatey",vertical:!0,modifier:1},up:{reverse:"down",property:"top",transition:"translatey",vertical:!0,modifier:-1},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out",modifier:-1},out:{reverse:"in",modifier:1},vertical:{reverse:"vertical"},horizontal:{reverse:"horizontal"}};C.directions=ft,P(t.fn,{kendoStop:function(t,e){return D?T.stopQueue(this,t||!1,e||!1):this.stop(t,e)}}),H&&!D&&(N(Q,function(i,r){t.fn[r]=function(i){if(e===i)return a(this,r);var n=t(this)[0],s=r+"("+i+W[r.replace($,"")]+")";return-1==n.style.cssText.indexOf(at)?t(this).css(at,s):n.style.cssText=n.style.cssText.replace(RegExp(r+"\\(.*?\\)","i"),s),this},t.fx.step[r]=function(e){t(e.elem)[r](e.now)}}),f=t.fx.prototype.cur,t.fx.prototype.cur=function(){return-1!=Q.indexOf(this.prop)?parseFloat(t(this.elem)[this.prop]()):f.apply(this,arguments)}),C.toggleClass=function(t,e,i,r){return e&&(e=e.split(" "),D&&(i=P({exclusive:"all",duration:400,ease:"ease-out"},i),t.css(ot,i.exclusive+" "+i.duration+"ms "+i.ease),setTimeout(function(){t.css(ot,"").css(Y)},i.duration)),N(e,function(e,i){t.toggleClass(i,r)})),t},C.parseEffects=function(t,e){var i={};return"string"==typeof t?N(t.split(" "),function(t,r){var n=!M.test(r),s=r.replace(q,function(t,e,i){return e+":"+i.toLowerCase()}),o=s.split(":"),a=o[1],c={};o.length>1&&(c.direction=e&&n?ft[a].reverse:a),i[o[0]]=c}):N(t,function(t){var r=this.direction;r&&e&&!M.test(t)&&(this.direction=ft[r].reverse),i[t]=this}),i},D&&P(T,{transition:function(e,i,r){var s,a,c,l,d=0,u=e.data("keys")||[];r=P({duration:200,ease:"ease-out",complete:null,exclusive:"all"},r),c=!1,l=function(){c||(c=!0,a&&(clearTimeout(a),a=null),e.removeData(et).dequeue().css(ot,"").css(ot),r.complete.call(e))},r.duration=t.fx?t.fx.speeds[r.duration]||r.duration:r.duration,s=o(e,i),t.merge(u,n(s)),e.data("keys",t.unique(u)).height(),e.css(ot,r.exclusive+" "+r.duration+"ms "+r.ease).css(ot),e.css(s).css(at),D.event&&(e.one(D.event,l),0!==r.duration&&(d=500)),a=setTimeout(l,r.duration+d),e.data(et,a),e.data(st,l)},stopQueue:function(t,e,i){var r,n=t.data("keys"),s=!i&&n,o=t.data(st);return s&&(r=C.getComputedStyles(t[0],n)),o&&o(),s&&t.css(r),t.removeData("keys").stop(e)}}),p=C.Class.extend({init:function(t,e){var i=this;i.element=t,i.effects=[],i.options=e,i.restore=[]},run:function(e){var i,r,n,a,c,l,d,u=this,f=e.length,p=u.element,h=u.options,m=t.Deferred(),v={},x={};for(u.effects=e,m.then(t.proxy(u,"complete")),p.data("animating",!0),r=0;f>r;r++)for(i=e[r],i.setReverse(h.reverse),i.setOptions(h),u.addRestoreProperties(i.restore),i.prepare(v,x),c=i.children(),n=0,l=c.length;l>n;n++)c[n].duration(h.duration).run();for(d in h.effects)P(x,h.effects[d].properties);for(p.is(":visible")||P(v,{display:p.data("olddisplay")||"block"}),H&&!h.reset&&(a=p.data("targetTransform"),a&&(v=P(a,v))),v=o(p,v),H&&!D&&(v=s(v)),p.css(v).css(at),r=0;f>r;r++)e[r].setup();return h.init&&h.init(),p.data("targetTransform",x),T.animate(p,x,P({},h,{complete:m.resolve})),m.promise()},stop:function(){t(this.element).kendoStop(!0,!0)},addRestoreProperties:function(t){for(var e,i=this.element,r=0,n=t.length;n>r;r++)e=t[r],this.restore.push(e),i.data(e)||i.data(e,i.css(e))},restoreCallback:function(){var t,e,i,r=this.element;for(t=0,e=this.restore.length;e>t;t++)i=this.restore[t],r.css(i,r.data(i))},complete:function(){var e=this,i=0,r=e.element,n=e.options,s=e.effects,o=s.length;for(r.removeData("animating").dequeue(),n.hide&&r.data("olddisplay",r.css("display")).hide(),this.restoreCallback(),I&&!H&&setTimeout(t.proxy(this,"restoreCallback"),0);o>i;i++)s[i].teardown();n.completeCallback&&n.completeCallback(r)}}),T.promise=function(t,e){var i,r,n,s=[],o=new p(t,e),a=C.parseEffects(e.effects);e.effects=a;for(n in a)i=T[c(n)],i&&(r=new i(t,a[n].direction),s.push(r));s[0]?o.run(s):(t.is(":visible")||t.css({display:t.data("olddisplay")||"block"}).css("display"),e.init&&e.init(),t.dequeue(),o.complete())},P(T,{animate:function(i,n,o){var a=o.transition!==!1;delete o.transition,D&&"transition"in T&&a?T.transition(i,n,o):H?i.animate(s(n),{queue:!1,show:!1,hide:!1,duration:o.duration,complete:o.complete}):i.each(function(){var i=t(this),s={};N(L,function(t,o){var a,c,l,d,u,f,p,h=n?n[o]+" ":null;h&&(c=n,o in O&&n[o]!==e?(a=h.match(A),H&&P(c,{scale:+a[0]})):o in F&&n[o]!==e&&(l=i.css(nt),d="absolute"==l||"fixed"==l,i.data(rt)||(d?i.data(rt,{top:r(i,"top")||0,left:r(i,"left")||0,bottom:r(i,"bottom"),right:r(i,"right")}):i.data(rt,{top:r(i,"marginTop")||0,left:r(i,"marginLeft")||0})),u=i.data(rt),a=h.match(A),a&&(f=o==rt+"y"?0:+a[1],p=o==rt+"y"?+a[1]:+a[2],d?(isNaN(u.right)?isNaN(f)||P(c,{left:u.left+f}):isNaN(f)||P(c,{right:u.right-f}),isNaN(u.bottom)?isNaN(p)||P(c,{top:u.top+p}):isNaN(p)||P(c,{bottom:u.bottom-p})):(isNaN(f)||P(c,{marginLeft:u.left+f}),isNaN(p)||P(c,{marginTop:u.top+p})))),!H&&"scale"!=o&&o in c&&delete c[o],c&&P(s,c))}),R.msie&&delete s.scale,i.animate(s,{queue:!1,show:!1,hide:!1,duration:o.duration,complete:o.complete})})}}),T.animatedPromise=T.promise,h=C.Class.extend({init:function(t,e){var i=this;i.element=t,i._direction=e,i.options={},i._additionalEffects=[],i.restore||(i.restore=[])},reverse:function(){return this._reverse=!0,this.run()},play:function(){return this._reverse=!1,this.run()},add:function(t){return this._additionalEffects.push(t),this},direction:function(t){return this._direction=t,this},duration:function(t){return this._duration=t,this},compositeRun:function(){var t=this,e=new p(t.element,{reverse:t._reverse,duration:t._duration}),i=t._additionalEffects.concat([t]);return e.run(i)},run:function(){if(this._additionalEffects&&this._additionalEffects[0])return this.compositeRun();var e,i,r=this,n=r.element,a=0,c=r.restore,l=c.length,d=t.Deferred(),u={},f={},p=r.children(),h=p.length;for(d.then(t.proxy(r,"_complete")),n.data("animating",!0),a=0;l>a;a++)e=c[a],n.data(e)||n.data(e,n.css(e));for(a=0;h>a;a++)p[a].duration(r._duration).run();return r.prepare(u,f),n.is(":visible")||P(u,{display:n.data("olddisplay")||"block"}),H&&(i=n.data("targetTransform"),i&&(u=P(i,u))),u=o(n,u),H&&!D&&(u=s(u)),n.css(u).css(at),r.setup(),n.data("targetTransform",f),T.animate(n,f,{duration:r._duration,complete:d.resolve}),d.promise()},stop:function(){var e=0,i=this.children(),r=i.length;for(e=0;r>e;e++)i[e].stop();return t(this.element).kendoStop(!0,!0),this},restoreCallback:function(){var t,e,i,r=this.element;for(t=0,e=this.restore.length;e>t;t++)i=this.restore[t],r.css(i,r.data(i))},_complete:function(){var e=this,i=e.element;i.removeData("animating").dequeue(),e.restoreCallback(),e.shouldHide()&&i.data("olddisplay",i.css("display")).hide(),I&&!H&&setTimeout(t.proxy(e,"restoreCallback"),0),e.teardown()},setOptions:function(t){P(!0,this.options,t)},children:function(){return[]},shouldHide:t.noop,setup:t.noop,prepare:t.noop,teardown:t.noop,directions:[],setReverse:function(t){return this._reverse=t,this}}),m=["left","right","up","down"],v=["in","out"],l("slideIn",{directions:m,divisor:function(t){return this.options.divisor=t,this},prepare:function(t,e){var i,r=this,n=r.element,s=ft[r._direction],o=-s.modifier*(s.vertical?n.outerHeight():n.outerWidth()),a=o/(r.options&&r.options.divisor||1)+G,c="0px";r._reverse&&(i=t,t=e,e=i),H?(t[s.transition]=a,e[s.transition]=c):(t[s.property]=a,e[s.property]=c)}}),l("tile",{directions:m,init:function(t,e,i){h.prototype.init.call(this,t,e),this.options={previous:i}},previousDivisor:function(t){return this.options.previousDivisor=t,this},children:function(){var t=this,e=t._reverse,i=t.options.previous,r=t.options.previousDivisor||1,n=t._direction,s=[C.fx(t.element).slideIn(n).setReverse(e)];return i&&s.push(C.fx(i).slideIn(ft[n].reverse).divisor(r).setReverse(!e)),s}}),d("fade","opacity",1,0),d("zoom","scale",1,.01),l("slideMargin",{prepare:function(t,e){var i,r=this,n=r.element,s=r.options,o=n.data(tt),a=s.offset,c=r._reverse;c||null!==o||n.data(tt,parseFloat(n.css("margin-"+s.axis))),i=n.data(tt)||0,e["margin-"+s.axis]=c?i:i+a}}),l("slideTo",{prepare:function(t,e){var i=this,r=i.element,n=i.options,s=n.offset.split(","),o=i._reverse;H?(e.translatex=o?0:s[0],e.translatey=o?0:s[1]):(e.left=o?0:s[0],e.top=o?0:s[1]),r.css("left")}}),l("expand",{directions:["horizontal","vertical"],restore:[it],prepare:function(t,i){var r=this,n=r.element,s=r.options,o=r._reverse,a="vertical"===r._direction?Y:X,c=n[0].style[a],l=n.data(a),d=parseFloat(l||c),u=B(n.css(a,K)[a]());t.overflow=Z,d=s&&s.reset?u||d:d||u,i[a]=(o?0:d)+G,t[a]=(o?d:0)+G,l===e&&n.data(a,c)},shouldHide:function(){return this._reverse},teardown:function(){var t=this,e=t.element,i="vertical"===t._direction?Y:X,r=e.data(i);(r==K||r===U)&&setTimeout(function(){e.css(i,K).css(i)},0)}}),x={position:"absolute",marginLeft:0,marginTop:0,scale:1},l("transfer",{init:function(t,e){this.element=t,this.options={target:e},this.restore=[]},setup:function(){this.element.appendTo(document.body)},prepare:function(t,e){var i=this,r=i.element,n=T.box(r),s=T.box(i.options.target),o=a(r,"scale"),c=T.fillScale(s,n),l=T.transformOrigin(s,n);P(t,x),e.scale=1,r.css(at,"scale(1)").css(at),r.css(at,"scale("+o+")"),t.top=n.top,t.left=n.left,t.transformOrigin=l.x+G+" "+l.y+G,i._reverse?t.scale=c:e.scale=c}}),g={top:"rect(auto auto $size auto)",bottom:"rect($size auto auto auto)",left:"rect(auto $size auto auto)",right:"rect(auto auto auto $size)"},_={top:{start:"rotatex(0deg)",end:"rotatex(180deg)"},bottom:{start:"rotatex(-180deg)",end:"rotatex(0deg)"},left:{start:"rotatey(0deg)",end:"rotatey(-180deg)"},right:{start:"rotatey(180deg)",end:"rotatey(0deg)"}},l("turningPage",{directions:m,init:function(t,e,i){h.prototype.init.call(this,t,e),this._container=i},prepare:function(t,e){var i=this,r=i._reverse,n=r?ft[i._direction].reverse:i._direction,s=_[n];t.zIndex=1,i._clipInHalf&&(t.clip=u(i._container,C.directions[n].reverse)),t[ct]=Z,e[at]=ut+(r?s.start:s.end),t[at]=ut+(r?s.end:s.start)},setup:function(){this._container.append(this.element)},face:function(t){return this._face=t,this},shouldHide:function(){var t=this,e=t._reverse,i=t._face;return e&&!i||!e&&i},clipInHalf:function(t){return this._clipInHalf=t,this},temporary:function(){return this.element.addClass("temp-page"),this}}),l("staticPage",{directions:m,init:function(t,e,i){h.prototype.init.call(this,t,e),this._container=i},restore:["clip"],prepare:function(t,e){var i=this,r=i._reverse?ft[i._direction].reverse:i._direction;t.clip=u(i._container,r),t.opacity=.999,e.opacity=1},shouldHide:function(){var t=this,e=t._reverse,i=t._face;return e&&!i||!e&&i},face:function(t){return this._face=t,this}}),l("pageturn",{directions:["horizontal","vertical"],init:function(t,e,i,r){h.prototype.init.call(this,t,e),this.options={},this.options.face=i,this.options.back=r},children:function(){var t,e=this,i=e.options,r="horizontal"===e._direction?"left":"top",n=C.directions[r].reverse,s=e._reverse,o=i.face.clone(!0).removeAttr("id"),a=i.back.clone(!0).removeAttr("id"),c=e.element;return s&&(t=r,r=n,n=t),[C.fx(i.face).staticPage(r,c).face(!0).setReverse(s),C.fx(i.back).staticPage(n,c).setReverse(s),C.fx(o).turningPage(r,c).face(!0).clipInHalf(!0).temporary().setReverse(s),C.fx(a).turningPage(n,c).clipInHalf(!0).temporary().setReverse(s)]},prepare:function(t,e){t[lt]=dt,t.transformStyle="preserve-3d",t.opacity=.999,e.opacity=1},teardown:function(){this.element.find(".temp-page").remove()}}),l("flip",{directions:["horizontal","vertical"],init:function(t,e,i,r){h.prototype.init.call(this,t,e),this.options={},this.options.face=i,this.options.back=r},children:function(){var t,e=this,i=e.options,r="horizontal"===e._direction?"left":"top",n=C.directions[r].reverse,s=e._reverse,o=e.element;return s&&(t=r,r=n,n=t),[C.fx(i.face).turningPage(r,o).face(!0).setReverse(s),C.fx(i.back).turningPage(n,o).setReverse(s)]},prepare:function(t){t[lt]=dt,t.transformStyle="preserve-3d"}}),y=!E.mobileOS.android,k=".km-touch-scrollbar, .km-actionsheet-wrapper",l("replace",{_before:t.noop,_after:t.noop,init:function(e,i,r){h.prototype.init.call(this,e),this._previous=t(i),this._transitionClass=r},duration:function(){throw Error("The replace effect does not support duration setting; the effect duration may be customized through the transition class rule")},beforeTransition:function(t){return this._before=t,this},afterTransition:function(t){return this._after=t,this},_both:function(){return t().add(this._element).add(this._previous)},_containerClass:function(){var t=this._direction,e="k-fx k-fx-start k-fx-"+this._transitionClass;return t&&(e+=" k-fx-"+t),this._reverse&&(e+=" k-fx-reverse"),e},complete:function(e){if(!(!this.deferred||e&&t(e.target).is(k))){var i=this.container;i.removeClass("k-fx-end").removeClass(this._containerClass()).off(D.event,this.completeProxy),this._previous.hide().removeClass("k-fx-current"),this.element.removeClass("k-fx-next"),y&&i.css(it,""),this.isAbsolute||this._both().css(nt,""),this.deferred.resolve(),delete this.deferred}},run:function(){if(this._additionalEffects&&this._additionalEffects[0])return this.compositeRun();var e,i=this,r=i.element,n=i._previous,s=r.parents().filter(n.parents()).first(),o=i._both(),a=t.Deferred(),c=r.css(nt);return s.length||(s=r.parent()),this.container=s,this.deferred=a,this.isAbsolute="absolute"==c,this.isAbsolute||o.css(nt,"absolute"),y&&(e=s.css(it),s.css(it,"hidden")),D?(r.addClass("k-fx-hidden"),s.addClass(this._containerClass()),this.completeProxy=t.proxy(this,"complete"),s.on(D.event,this.completeProxy),C.animationFrame(function(){r.removeClass("k-fx-hidden").addClass("k-fx-next"),n.css("display","").addClass("k-fx-current"),i._before(n,r),C.animationFrame(function(){s.removeClass("k-fx-start").addClass("k-fx-end"),i._after(n,r)})})):this.complete(),a.promise()},stop:function(){this.complete()}}),b=C.Class.extend({init:function(){var t=this;t._tickProxy=z(t._tick,t),t._started=!1},tick:t.noop,done:t.noop,onEnd:t.noop,onCancel:t.noop,start:function(){this.enabled()&&(this.done()?this.onEnd():(this._started=!0,C.animationFrame(this._tickProxy)))},enabled:function(){return!0},cancel:function(){this._started=!1,this.onCancel()},_tick:function(){var t=this;t._started&&(t.tick(),t.done()?(t._started=!1,t.onEnd()):C.animationFrame(t._tickProxy))}}),w=b.extend({init:function(t){var e=this;P(e,t),b.fn.init.call(e)},done:function(){return this.timePassed()>=this.duration},timePassed:function(){return Math.min(this.duration,new Date-this.startDate)},moveTo:function(t){var e=this,i=e.movable;e.initial=i[e.axis],e.delta=t.location-e.initial,e.duration="number"==typeof t.duration?t.duration:300,e.tick=e._easeProxy(t.ease),e.startDate=new Date,e.start()},_easeProxy:function(t){var e=this;return function(){e.movable.moveAxis(e.axis,t(e.timePassed(),e.initial,e.delta,e.duration))}}}),P(w,{easeOutExpo:function(t,e,i,r){return t==r?e+i:i*(-Math.pow(2,-10*t/r)+1)+e},easeOutBack:function(t,e,i,r,n){return n=1.70158,i*((t=t/r-1)*t*((n+1)*t+n)+1)+e}}),T.Animation=b,T.Transition=w,T.createEffect=l,T.box=function(e){e=t(e);var i=e.offset();return i.width=e.outerWidth(),i.height=e.outerHeight(),i},T.transformOrigin=function(t,e){var i=(t.left-e.left)*e.width/(e.width-t.width),r=(t.top-e.top)*e.height/(e.height-t.height);return{x:isNaN(i)?0:i,y:isNaN(r)?0:r}},T.fillScale=function(t,e){return Math.min(t.width/e.width,t.height/e.height)},T.fitScale=function(t,e){return Math.max(t.width/e.width,t.height/e.height)}}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,i){(i||e)()});;!function(e,define){define("kendo.userevents.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(e,t){var n=e.x.location,i=e.y.location,o=t.x.location,r=t.y.location,s=n-o,a=i-r;return{center:{x:(n+o)/2,y:(i+r)/2},distance:Math.sqrt(s*s+a*a)}}function i(e){var t,n,i,o=[],r=e.originalEvent,a=e.currentTarget,c=0;if(e.api)o.push({id:2,event:e,target:e.target,currentTarget:e.target,location:e,type:"api"});else if(e.type.match(/touch/))for(n=r?r.changedTouches:[],t=n.length;t>c;c++)i=n[c],o.push({location:i,event:e,target:i.target,currentTarget:a,id:i.identifier,type:"touch"});else o.push(s.pointers||s.msPointers?{location:r,event:e,target:e.target,currentTarget:a,id:r.pointerId,type:"pointer"}:{id:1,event:e,target:e.target,currentTarget:a,location:e,type:"mouse"});return o}function o(e){for(var t=r.eventMap.up.split(" "),n=0,i=t.length;i>n;n++)e(t[n])}var r=window.kendo,s=r.support,a=window.document,c=r.Class,u=r.Observable,h=e.now,l=e.extend,p=s.mobileOS,d=p&&p.android,f=800,v=s.browser.msie?5:0,g="press",m="hold",_="select",T="start",y="move",x="end",w="cancel",M="tap",E="release",k="gesturestart",D="gesturechange",C="gestureend",b="gesturetap",A={api:0,touch:0,mouse:9,pointer:9},I=!s.touch||s.mouseAndTouchPresent,S=c.extend({init:function(e,t){var n=this;n.axis=e,n._updateLocationData(t),n.startLocation=n.location,n.velocity=n.delta=0,n.timeStamp=h()},move:function(e){var t=this,n=e["page"+t.axis],i=h(),o=i-t.timeStamp||1;(n||!d)&&(t.delta=n-t.location,t._updateLocationData(e),t.initialDelta=n-t.startLocation,t.velocity=t.delta/o,t.timeStamp=i)},_updateLocationData:function(e){var t=this,n=t.axis;t.location=e["page"+n],t.client=e["client"+n],t.screen=e["screen"+n]}}),P=c.extend({init:function(e,t,n){l(this,{x:new S("X",n.location),y:new S("Y",n.location),type:n.type,useClickAsTap:e.useClickAsTap,threshold:e.threshold||A[n.type],userEvents:e,target:t,currentTarget:n.currentTarget,initialTouch:n.target,id:n.id,pressEvent:n,_moved:!1,_finished:!1})},press:function(){this._holdTimeout=setTimeout(e.proxy(this,"_hold"),this.userEvents.minHold),this._trigger(g,this.pressEvent)},_hold:function(){this._trigger(m,this.pressEvent)},move:function(e){var t=this;if(!t._finished){if(t.x.move(e.location),t.y.move(e.location),!t._moved){if(t._withinIgnoreThreshold())return;if(L.current&&L.current!==t.userEvents)return t.dispose();t._start(e)}t._finished||t._trigger(y,e)}},end:function(e){this.endTime=h(),this._finished||(this._finished=!0,this._trigger(E,e),this._moved?this._trigger(x,e):this.useClickAsTap||this._trigger(M,e),clearTimeout(this._holdTimeout),this.dispose())},dispose:function(){var t=this.userEvents,n=t.touches;this._finished=!0,this.pressEvent=null,clearTimeout(this._holdTimeout),n.splice(e.inArray(this,n),1)},skip:function(){this.dispose()},cancel:function(){this.dispose()},isMoved:function(){return this._moved},_start:function(e){clearTimeout(this._holdTimeout),this.startTime=h(),this._moved=!0,this._trigger(T,e)},_trigger:function(e,t){var n=this,i=t.event,o={touch:n,x:n.x,y:n.y,target:n.target,event:i};n.userEvents.notify(e,o)&&i.preventDefault()},_withinIgnoreThreshold:function(){var e=this.x.initialDelta,t=this.y.initialDelta;return Math.sqrt(e*e+t*t)<=this.threshold}}),L=u.extend({init:function(t,n){var i,c,h,p=this,d=r.guid();n=n||{},i=p.filter=n.filter,p.threshold=n.threshold||v,p.minHold=n.minHold||f,p.touches=[],p._maxTouches=n.multiTouch?2:1,p.allowSelection=n.allowSelection,p.captureUpIfMoved=n.captureUpIfMoved,p.useClickAsTap=!n.fastTap&&!s.delayedClick(),p.eventNS=d,t=e(t).handler(p),u.fn.init.call(p),l(p,{element:t,surface:e(n.global&&I?a.documentElement:n.surface||t),stopPropagation:n.stopPropagation,pressed:!1}),p.surface.handler(p).on(r.applyEventMap("move",d),"_move").on(r.applyEventMap("up cancel",d),"_end"),t.on(r.applyEventMap("down",d),i,"_start"),p.useClickAsTap&&t.on(r.applyEventMap("click",d),i,"_click"),(s.pointers||s.msPointers)&&(11>s.browser.version?t.css("-ms-touch-action","pinch-zoom double-tap-zoom"):t.css("touch-action","pan-y")),n.preventDragEvent&&t.on(r.applyEventMap("dragstart",d),r.preventDefault),t.on(r.applyEventMap("mousedown",d),i,{root:t},"_select"),p.captureUpIfMoved&&s.eventCapture&&(c=p.surface[0],h=e.proxy(p.preventIfMoving,p),o(function(e){c.addEventListener(e,h,!0)})),p.bind([g,m,M,T,y,x,E,w,k,D,C,b,_],n)},preventIfMoving:function(e){this._isMoved()&&e.preventDefault()},destroy:function(){var e,t=this;t._destroyed||(t._destroyed=!0,t.captureUpIfMoved&&s.eventCapture&&(e=t.surface[0],o(function(n){e.removeEventListener(n,t.preventIfMoving)})),t.element.kendoDestroy(t.eventNS),t.surface.kendoDestroy(t.eventNS),t.element.removeData("handler"),t.surface.removeData("handler"),t._disposeAll(),t.unbind(),delete t.surface,delete t.element,delete t.currentTarget)},capture:function(){L.current=this},cancel:function(){this._disposeAll(),this.trigger(w)},notify:function(e,t){var i=this,o=i.touches;if(this._isMultiTouch()){switch(e){case y:e=D;break;case x:e=C;break;case M:e=b}l(t,{touches:o},n(o[0],o[1]))}return this.trigger(e,l(t,{type:e}))},press:function(e,t,n){this._apiCall("_start",e,t,n)},move:function(e,t){this._apiCall("_move",e,t)},end:function(e,t){this._apiCall("_end",e,t)},_isMultiTouch:function(){return this.touches.length>1},_maxTouchesReached:function(){return this.touches.length>=this._maxTouches},_disposeAll:function(){for(var e=this.touches;e.length>0;)e.pop().dispose()},_isMoved:function(){return e.grep(this.touches,function(e){return e.isMoved()}).length},_select:function(e){(!this.allowSelection||this.trigger(_,{event:e}))&&e.preventDefault()},_start:function(t){var n,o,r=this,s=0,a=r.filter,c=i(t),u=c.length,h=t.which;if(!(h&&h>1||r._maxTouchesReached()))for(L.current=null,r.currentTarget=t.currentTarget,r.stopPropagation&&t.stopPropagation();u>s&&!r._maxTouchesReached();s++)o=c[s],n=a?e(o.currentTarget):r.element,n.length&&(o=new P(r,n,o),r.touches.push(o),o.press(),r._isMultiTouch()&&r.notify("gesturestart",{}))},_move:function(e){this._eachTouch("move",e)},_end:function(e){this._eachTouch("end",e)},_click:function(t){var n={touch:{initialTouch:t.target,target:e(t.currentTarget),endTime:h(),x:{location:t.pageX,client:t.clientX},y:{location:t.pageY,client:t.clientY}},x:t.pageX,y:t.pageY,target:e(t.currentTarget),event:t,type:"tap"};this.trigger("tap",n)&&t.preventDefault()},_eachTouch:function(e,t){var n,o,r,s,a=this,c={},u=i(t),h=a.touches;for(n=0;h.length>n;n++)o=h[n],c[o.id]=o;for(n=0;u.length>n;n++)r=u[n],s=c[r.id],s&&s[e](r)},_apiCall:function(t,n,i,o){this[t]({api:!0,pageX:n,pageY:i,clientX:n,clientY:i,target:e(o||this.element)[0],stopPropagation:e.noop,preventDefault:e.noop})}});L.defaultThreshold=function(e){v=e},L.minHold=function(e){f=e},r.getTouches=i,r.touchDelta=n,r.UserEvents=L}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});;!function(t,define){define("kendo.draganddrop.min",["kendo.core.min","kendo.userevents.min"],t)}(function(){return function(t,e){function n(e,n){try{return t.contains(e,n)||e==n}catch(r){return!1}}function r(t,e){return parseInt(t.css(e),10)||0}function i(t,e){return Math.min(Math.max(t,e.min),e.max)}function o(t,e){var n=D(t),i=n.left+r(t,"borderLeftWidth")+r(t,"paddingLeft"),o=n.top+r(t,"borderTopWidth")+r(t,"paddingTop"),a=i+t.width()-e.outerWidth(!0),s=o+t.height()-e.outerHeight(!0);return{x:{min:i,max:a},y:{min:o,max:s}}}function a(n,r,i){for(var o,a,s=0,l=r&&r.length,c=i&&i.length;n&&n.parentNode;){for(s=0;l>s;s++)if(o=r[s],o.element[0]===n)return{target:o,targetElement:n};for(s=0;c>s;s++)if(a=i[s],t.contains(a.element[0],n)&&x.matchesSelector.call(n,a.options.filter))return{target:a,targetElement:n};n=n.parentNode}return e}function s(t,e){var n,r=e.options.group,i=t[r];if(T.fn.destroy.call(e),i.length>1){for(n=0;i.length>n;n++)if(i[n]==e){i.splice(n,1);break}}else i.length=0,delete t[r]}function l(t){var e,n,r,i=c()[0];return t[0]===i?(n=i.scrollTop,r=i.scrollLeft,{top:n,left:r,bottom:n+b.height(),right:r+b.width()}):(e=t.offset(),e.bottom=e.top+t.height(),e.right=e.left+t.width(),e)}function c(){return t(_.support.browser.chrome?y.body:y.documentElement)}function u(e){var n,r=c();if(!e||e===y.body||e===y.documentElement)return r;for(n=t(e)[0];n&&!_.isScrollable(n)&&n!==y.body;)n=n.parentNode;return n===y.body?r:t(n)}function h(t,e,n){var r={x:0,y:0},i=50;return i>t-n.left?r.x=-(i-(t-n.left)):i>n.right-t&&(r.x=i-(n.right-t)),i>e-n.top?r.y=-(i-(e-n.top)):i>n.bottom-e&&(r.y=i-(n.bottom-e)),r}var d,f,p,g,v,m,_=window.kendo,x=_.support,y=window.document,b=t(window),E=_.Class,T=_.ui.Widget,M=_.Observable,S=_.UserEvents,w=t.proxy,C=t.extend,D=_.getOffset,O={},k={},I={},H=_.elementUnderCursor,W="keyup",z="change",P="dragstart",U="hold",L="drag",A="dragend",N="dragcancel",V="hintDestroyed",B="dragenter",$="dragleave",F="drop",j=M.extend({init:function(e,n){var r=this,i=e[0];r.capture=!1,i.addEventListener?(t.each(_.eventMap.down.split(" "),function(){i.addEventListener(this,w(r._press,r),!0)}),t.each(_.eventMap.up.split(" "),function(){i.addEventListener(this,w(r._release,r),!0)})):(t.each(_.eventMap.down.split(" "),function(){i.attachEvent(this,w(r._press,r))}),t.each(_.eventMap.up.split(" "),function(){i.attachEvent(this,w(r._release,r))})),M.fn.init.call(r),r.bind(["press","release"],n||{})},captureNext:function(){this.capture=!0},cancelCapture:function(){this.capture=!1},_press:function(t){var e=this;e.trigger("press"),e.capture&&t.preventDefault()},_release:function(t){var e=this;e.trigger("release"),e.capture&&(t.preventDefault(),e.cancelCapture())}}),G=M.extend({init:function(e){var n=this;M.fn.init.call(n),n.forcedEnabled=!1,t.extend(n,e),n.scale=1,n.horizontal?(n.measure="offsetWidth",n.scrollSize="scrollWidth",n.axis="x"):(n.measure="offsetHeight",n.scrollSize="scrollHeight",n.axis="y")},makeVirtual:function(){t.extend(this,{virtual:!0,forcedEnabled:!0,_virtualMin:0,_virtualMax:0})},virtualSize:function(t,e){(this._virtualMin!==t||this._virtualMax!==e)&&(this._virtualMin=t,this._virtualMax=e,this.update())},outOfBounds:function(t){return t>this.max||this.min>t},forceEnabled:function(){this.forcedEnabled=!0},getSize:function(){return this.container[0][this.measure]},getTotal:function(){return this.element[0][this.scrollSize]},rescale:function(t){this.scale=t},update:function(t){var e=this,n=e.virtual?e._virtualMax:e.getTotal(),r=n*e.scale,i=e.getSize();(0!==n||e.forcedEnabled)&&(e.max=e.virtual?-e._virtualMin:0,e.size=i,e.total=r,e.min=Math.min(e.max,i-r),e.minScale=i/n,e.centerOffset=(r-i)/2,e.enabled=e.forcedEnabled||r>i,t||e.trigger(z,e))}}),Q=M.extend({init:function(t){var e=this;M.fn.init.call(e),e.x=new G(C({horizontal:!0},t)),e.y=new G(C({horizontal:!1},t)),e.container=t.container,e.forcedMinScale=t.minScale,e.maxScale=t.maxScale||100,e.bind(z,t)},rescale:function(t){this.x.rescale(t),this.y.rescale(t),this.refresh()},centerCoordinates:function(){return{x:Math.min(0,-this.x.centerOffset),y:Math.min(0,-this.y.centerOffset)}},refresh:function(){var t=this;t.x.update(),t.y.update(),t.enabled=t.x.enabled||t.y.enabled,t.minScale=t.forcedMinScale||Math.min(t.x.minScale,t.y.minScale),t.fitScale=Math.max(t.x.minScale,t.y.minScale),t.trigger(z)}}),q=M.extend({init:function(t){var e=this;C(e,t),M.fn.init.call(e)},outOfBounds:function(){return this.dimension.outOfBounds(this.movable[this.axis])},dragMove:function(t){var e=this,n=e.dimension,r=e.axis,i=e.movable,o=i[r]+t;n.enabled&&((n.min>o&&0>t||o>n.max&&t>0)&&(t*=e.resistance),i.translateAxis(r,t),e.trigger(z,e))}}),J=E.extend({init:function(e){var n,r,i,o,a=this;C(a,{elastic:!0},e),i=a.elastic?.5:0,o=a.movable,a.x=n=new q({axis:"x",dimension:a.dimensions.x,resistance:i,movable:o}),a.y=r=new q({axis:"y",dimension:a.dimensions.y,resistance:i,movable:o}),a.userEvents.bind(["press","move","end","gesturestart","gesturechange"],{gesturestart:function(t){a.gesture=t,a.offset=a.dimensions.container.offset()},press:function(e){t(e.event.target).closest("a").is("[data-navigate-on-press=true]")&&e.sender.cancel()},gesturechange:function(t){var e,i,s,l=a.gesture,c=l.center,u=t.center,h=t.distance/l.distance,d=a.dimensions.minScale,f=a.dimensions.maxScale;d>=o.scale&&1>h&&(h+=.8*(1-h)),o.scale*h>=f&&(h=f/o.scale),i=o.x+a.offset.left,s=o.y+a.offset.top,e={x:(i-c.x)*h+u.x-i,y:(s-c.y)*h+u.y-s},o.scaleWith(h),n.dragMove(e.x),r.dragMove(e.y),a.dimensions.rescale(o.scale),a.gesture=t,t.preventDefault()},move:function(t){t.event.target.tagName.match(/textarea|input/i)||(n.dimension.enabled||r.dimension.enabled?(n.dragMove(t.x.delta),r.dragMove(t.y.delta),t.preventDefault()):t.touch.skip())},end:function(t){t.preventDefault()}})}}),K=x.transitions.prefix+"Transform";f=x.hasHW3D?function(t,e,n){return"translate3d("+t+"px,"+e+"px,0) scale("+n+")"}:function(t,e,n){return"translate("+t+"px,"+e+"px) scale("+n+")"},p=M.extend({init:function(e){var n=this;M.fn.init.call(n),n.element=t(e),n.element[0].style.webkitTransformOrigin="left top",n.x=0,n.y=0,n.scale=1,n._saveCoordinates(f(n.x,n.y,n.scale))},translateAxis:function(t,e){this[t]+=e,this.refresh()},scaleTo:function(t){this.scale=t,this.refresh()},scaleWith:function(t){this.scale*=t,this.refresh()},translate:function(t){this.x+=t.x,this.y+=t.y,this.refresh()},moveAxis:function(t,e){this[t]=e,this.refresh()},moveTo:function(t){C(this,t),this.refresh()},refresh:function(){var t,e=this,n=e.x,r=e.y;e.round&&(n=Math.round(n),r=Math.round(r)),t=f(n,r,e.scale),t!=e.coordinates&&(_.support.browser.msie&&10>_.support.browser.version?(e.element[0].style.position="absolute",e.element[0].style.left=e.x+"px",e.element[0].style.top=e.y+"px"):e.element[0].style[K]=t,e._saveCoordinates(t),e.trigger(z))},_saveCoordinates:function(t){this.coordinates=t}}),g=T.extend({init:function(t,e){var n,r=this;T.fn.init.call(r,t,e),n=r.options.group,n in k?k[n].push(r):k[n]=[r]},events:[B,$,F],options:{name:"DropTarget",group:"default"},destroy:function(){s(k,this)},_trigger:function(t,n){var r=this,i=O[r.options.group];return i?r.trigger(t,C({},n.event,{draggable:i,dropTarget:n.dropTarget})):e},_over:function(t){this._trigger(B,t)},_out:function(t){this._trigger($,t)},_drop:function(t){var e=this,n=O[e.options.group];n&&(n.dropped=!e._trigger(F,t))}}),g.destroyGroup=function(t){var e,n=k[t]||I[t];if(n){for(e=0;n.length>e;e++)T.fn.destroy.call(n[e]);n.length=0,delete k[t],delete I[t]}},g._cache=k,v=g.extend({init:function(t,e){var n,r=this;T.fn.init.call(r,t,e),n=r.options.group,n in I?I[n].push(r):I[n]=[r]},destroy:function(){s(I,this)},options:{name:"DropTargetArea",group:"default",filter:null}}),m=T.extend({init:function(t,e){var n=this;T.fn.init.call(n,t,e),n._activated=!1,n.userEvents=new S(n.element,{global:!0,allowSelection:!0,filter:n.options.filter,threshold:n.options.distance,start:w(n._start,n),hold:w(n._hold,n),move:w(n._drag,n),end:w(n._end,n),cancel:w(n._cancel,n),select:w(n._select,n)}),n._afterEndHandler=w(n._afterEnd,n),n._captureEscape=w(n._captureEscape,n)},events:[U,P,L,A,N,V],options:{name:"Draggable",distance:_.support.touch?0:5,group:"default",cursorOffset:null,axis:null,container:null,filter:null,ignore:null,holdToDrag:!1,autoScroll:!1,dropped:!1},cancelHold:function(){this._activated=!1},_captureEscape:function(t){var e=this;t.keyCode===_.keys.ESC&&(e._trigger(N,{event:t}),e.userEvents.cancel())},_updateHint:function(e){var n,r=this,o=r.options,a=r.boundaries,s=o.axis,l=r.options.cursorOffset;l?n={left:e.x.location+l.left,top:e.y.location+l.top}:(r.hintOffset.left+=e.x.delta,r.hintOffset.top+=e.y.delta,n=t.extend({},r.hintOffset)),a&&(n.top=i(n.top,a.y),n.left=i(n.left,a.x)),"x"===s?delete n.top:"y"===s&&delete n.left,r.hint.css(n)},_shouldIgnoreTarget:function(e){var n=this.options.ignore;return n&&t(e).is(n)},_select:function(t){this._shouldIgnoreTarget(t.event.target)||t.preventDefault()},_start:function(n){var r,i=this,a=i.options,s=a.container,l=a.hint;return this._shouldIgnoreTarget(n.touch.initialTouch)||a.holdToDrag&&!i._activated?(i.userEvents.cancel(),e):(i.currentTarget=n.target,i.currentTargetOffset=D(i.currentTarget),l&&(i.hint&&i.hint.stop(!0,!0).remove(),i.hint=_.isFunction(l)?t(l.call(i,i.currentTarget)):l,r=D(i.currentTarget),i.hintOffset=r,i.hint.css({position:"absolute",zIndex:2e4,left:r.left,top:r.top}).appendTo(y.body),i.angular("compile",function(){i.hint.removeAttr("ng-repeat");for(var e=t(n.target);!e.data("$$kendoScope")&&e.length;)e=e.parent();return{elements:i.hint.get(),scopeFrom:e.data("$$kendoScope")}})),O[a.group]=i,i.dropped=!1,s&&(i.boundaries=o(s,i.hint)),t(y).on(W,i._captureEscape),i._trigger(P,n)&&(i.userEvents.cancel(),i._afterEnd()),i.userEvents.capture(),e)},_hold:function(t){this.currentTarget=t.target,this._trigger(U,t)?this.userEvents.cancel():this._activated=!0},_drag:function(e){var n,r;e.preventDefault(),n=this._elementUnderCursor(e),this._lastEvent=e,this._processMovement(e,n),this.options.autoScroll&&(this._cursorElement!==n&&(this._scrollableParent=u(n),this._cursorElement=n),this._scrollableParent[0]&&(r=h(e.x.location,e.y.location,l(this._scrollableParent)),this._scrollCompenstation=t.extend({},this.hintOffset),this._scrollVelocity=r,0===r.y&&0===r.x?(clearInterval(this._scrollInterval),this._scrollInterval=null):this._scrollInterval||(this._scrollInterval=setInterval(t.proxy(this,"_autoScroll"),50)))),this.hint&&this._updateHint(e)},_processMovement:function(n,r){this._withDropTarget(r,function(r,i){if(!r)return d&&(d._trigger($,C(n,{dropTarget:t(d.targetElement)})),d=null),e;if(d){if(i===d.targetElement)return;d._trigger($,C(n,{dropTarget:t(d.targetElement)}))}r._trigger(B,C(n,{dropTarget:t(i)})),d=C(r,{targetElement:i})}),this._trigger(L,C(n,{dropTarget:d,elementUnderCursor:r}))},_autoScroll:function(){var t,e,n,r,i,o,a,s,l=this._scrollableParent[0],u=this._scrollVelocity,h=this._scrollCompenstation;l&&(t=this._elementUnderCursor(this._lastEvent),this._processMovement(this._lastEvent,t),r=l===c()[0],r?(e=y.body.scrollHeight>b.height(),n=y.body.scrollWidth>b.width()):(e=l.scrollHeight>=l.offsetHeight,n=l.scrollWidth>=l.offsetWidth),i=l.scrollTop+u.y,o=e&&i>0&&l.scrollHeight>i,a=l.scrollLeft+u.x,s=n&&a>0&&l.scrollWidth>a,o&&(l.scrollTop+=u.y),s&&(l.scrollLeft+=u.x),r&&(s||o)&&(o&&(h.top+=u.y),s&&(h.left+=u.x),this.hint.css(h)))},_end:function(e){this._withDropTarget(this._elementUnderCursor(e),function(n,r){n&&(n._drop(C({},e,{dropTarget:t(r)})),d=null)}),this._cancel(this._trigger(A,e))},_cancel:function(t){var e=this;e._scrollableParent=null,this._cursorElement=null,clearInterval(this._scrollInterval),e._activated=!1,e.hint&&!e.dropped?setTimeout(function(){e.hint.stop(!0,!0),t?e._afterEndHandler():e.hint.animate(e.currentTargetOffset,"fast",e._afterEndHandler)},0):e._afterEnd()},_trigger:function(t,e){var n=this;return n.trigger(t,C({},e.event,{x:e.x,y:e.y,currentTarget:n.currentTarget,initialTarget:e.touch?e.touch.initialTouch:null,dropTarget:e.dropTarget,elementUnderCursor:e.elementUnderCursor}))},_elementUnderCursor:function(t){var e=H(t),r=this.hint;return r&&n(r[0],e)&&(r.hide(),e=H(t),e||(e=H(t)),r.show()),e},_withDropTarget:function(t,e){var n,r=this.options.group,i=k[r],o=I[r];(i&&i.length||o&&o.length)&&(n=a(t,i,o),n?e(n.target,n.targetElement):e())},destroy:function(){var t=this;T.fn.destroy.call(t),t._afterEnd(),t.userEvents.destroy(),this._scrollableParent=null,this._cursorElement=null,clearInterval(this._scrollInterval),t.currentTarget=null},_afterEnd:function(){var e=this;e.hint&&e.hint.remove(),delete O[e.options.group],e.trigger("destroy"),e.trigger(V),t(y).off(W,e._captureEscape)}}),_.ui.plugin(g),_.ui.plugin(v),_.ui.plugin(m),_.TapCapture=j,_.containerBoundaries=o,C(_.ui,{Pane:J,PaneDimensions:Q,Movable:p}),_.ui.Draggable.utils={autoScrollVelocity:h,scrollableViewPort:l,findScrollableParent:u}}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()});;!function(e,define){define("kendo.mobile.scroller.min",["kendo.fx.min","kendo.draganddrop.min"],e)}(function(){return function(e,i){var n=window.kendo,t=n.mobile,s=n.effects,o=t.ui,l=e.proxy,a=e.extend,r=o.Widget,c=n.Class,h=n.ui.Movable,u=n.ui.Pane,d=n.ui.PaneDimensions,m=s.Transition,f=s.Animation,p=Math.abs,v=500,b=.7,x=.96,y=10,T=55,w=.5,g=5,_="km-scroller-release",E="km-scroller-refresh",C="pull",k="change",S="resize",z="scroll",M=2,O=f.extend({init:function(e){var i=this;f.fn.init.call(i),a(i,e),i.userEvents.bind("gestureend",l(i.start,i)),i.tapCapture.bind("press",l(i.cancel,i))},enabled:function(){return this.dimensions.minScale>this.movable.scale},done:function(){return.01>this.dimensions.minScale-this.movable.scale},tick:function(){var e=this.movable;e.scaleWith(1.1),this.dimensions.rescale(e.scale)},onEnd:function(){var e=this.movable;e.scaleTo(this.dimensions.minScale),this.dimensions.rescale(e.scale)}}),A=f.extend({init:function(e){var i=this;f.fn.init.call(i),a(i,e,{transition:new m({axis:e.axis,movable:e.movable,onEnd:function(){i._end()}})}),i.tapCapture.bind("press",function(){i.cancel()}),i.userEvents.bind("end",l(i.start,i)),i.userEvents.bind("gestureend",l(i.start,i)),i.userEvents.bind("tap",l(i.onEnd,i))},onCancel:function(){this.transition.cancel()},freeze:function(e){var i=this;i.cancel(),i._moveTo(e)},onEnd:function(){var e=this;e.paneAxis.outOfBounds()?e._snapBack():e._end()},done:function(){return p(this.velocity)<1},start:function(e){var i,n=this;n.dimension.enabled&&(n.paneAxis.outOfBounds()?n._snapBack():(i=e.touch.id===M?0:e.touch[n.axis].velocity,n.velocity=Math.max(Math.min(i*n.velocityMultiplier,T),-T),n.tapCapture.captureNext(),f.fn.start.call(n)))},tick:function(){var e=this,i=e.dimension,n=e.paneAxis.outOfBounds()?w:e.friction,t=e.velocity*=n,s=e.movable[e.axis]+t;!e.elastic&&i.outOfBounds(s)&&(s=Math.max(Math.min(s,i.max),i.min),e.velocity=0),e.movable.moveAxis(e.axis,s)},_end:function(){this.tapCapture.cancelCapture(),this.end()},_snapBack:function(){var e=this,i=e.dimension,n=e.movable[e.axis]>i.max?i.max:i.min;e._moveTo(n)},_moveTo:function(e){this.transition.moveTo({location:e,duration:v,ease:m.easeOutExpo})}}),H=f.extend({init:function(e){var i=this;n.effects.Animation.fn.init.call(this),a(i,e,{origin:{},destination:{},offset:{}})},tick:function(){this._updateCoordinates(),this.moveTo(this.origin)},done:function(){return p(this.offset.y)<g&&p(this.offset.x)<g},onEnd:function(){this.moveTo(this.destination),this.callback&&this.callback.call()},setCoordinates:function(e,i){this.offset={},this.origin=e,this.destination=i},setCallback:function(e){e&&n.isFunction(e)?this.callback=e:e=i},_updateCoordinates:function(){this.offset={x:(this.destination.x-this.origin.x)/4,y:(this.destination.y-this.origin.y)/4},this.origin={y:this.origin.y+this.offset.y,x:this.origin.x+this.offset.x}}}),B=c.extend({init:function(i){var n=this,t="x"===i.axis,s=e('<div class="km-touch-scrollbar km-'+(t?"horizontal":"vertical")+'-scrollbar" />');a(n,i,{element:s,elementSize:0,movable:new h(s),scrollMovable:i.movable,alwaysVisible:i.alwaysVisible,size:t?"width":"height"}),n.scrollMovable.bind(k,l(n.refresh,n)),n.container.append(s),i.alwaysVisible&&n.show()},refresh:function(){var e=this,i=e.axis,n=e.dimension,t=n.size,s=e.scrollMovable,o=t/n.total,l=Math.round(-s[i]*o),a=Math.round(t*o);o>=1?this.element.css("display","none"):this.element.css("display",""),l+a>t?a=t-l:0>l&&(a+=l,l=0),e.elementSize!=a&&(e.element.css(e.size,a+"px"),e.elementSize=a),e.movable.moveAxis(i,l)},show:function(){this.element.css({opacity:b,visibility:"visible"})},hide:function(){this.alwaysVisible||this.element.css({opacity:0})}}),R=r.extend({init:function(t,s){var o,c,m,f,v,b,x,y,T,w=this;return r.fn.init.call(w,t,s),t=w.element,(w._native=w.options.useNative&&n.support.hasNativeScrolling)?(t.addClass("km-native-scroller").prepend('<div class="km-scroll-header"/>'),a(w,{scrollElement:t,fixedContainer:t.children().first()}),i):(t.css("overflow","hidden").addClass("km-scroll-wrapper").wrapInner('<div class="km-scroll-container"/>').prepend('<div class="km-scroll-header"/>'),o=t.children().eq(1),c=new n.TapCapture(t),m=new h(o),f=new d({element:o,container:t,forcedEnabled:w.options.zoom}),v=this.options.avoidScrolling,b=new n.UserEvents(t,{fastTap:!0,allowSelection:!0,preventDragEvent:!0,captureUpIfMoved:!0,multiTouch:w.options.zoom,start:function(i){f.refresh();var n=p(i.x.velocity),t=p(i.y.velocity),s=2*n>=t,o=e.contains(w.fixedContainer[0],i.event.target),l=2*t>=n;!o&&!v(i)&&w.enabled&&(f.x.enabled&&s||f.y.enabled&&l)?b.capture():b.cancel()}}),x=new u({movable:m,dimensions:f,userEvents:b,elastic:w.options.elastic}),y=new O({movable:m,dimensions:f,userEvents:b,tapCapture:c}),T=new H({moveTo:function(e){w.scrollTo(e.x,e.y)}}),m.bind(k,function(){w.scrollTop=-m.y,w.scrollLeft=-m.x,w.trigger(z,{scrollTop:w.scrollTop,scrollLeft:w.scrollLeft})}),w.options.mousewheelScrolling&&t.on("DOMMouseScroll mousewheel",l(this,"_wheelScroll")),a(w,{movable:m,dimensions:f,zoomSnapBack:y,animatedScroller:T,userEvents:b,pane:x,tapCapture:c,pulled:!1,enabled:!0,scrollElement:o,scrollTop:0,scrollLeft:0,fixedContainer:t.children().first()}),w._initAxis("x"),w._initAxis("y"),w._wheelEnd=function(){w._wheel=!1,w.userEvents.end(0,w._wheelY)},f.refresh(),w.options.pullToRefresh&&w._initPullToRefresh(),i)},_wheelScroll:function(e){this._wheel||(this._wheel=!0,this._wheelY=0,this.userEvents.press(0,this._wheelY)),clearTimeout(this._wheelTimeout),this._wheelTimeout=setTimeout(this._wheelEnd,50);var i=n.wheelDeltaY(e);i&&(this._wheelY+=i,this.userEvents.move(0,this._wheelY)),e.preventDefault()},makeVirtual:function(){this.dimensions.y.makeVirtual()},virtualSize:function(e,i){this.dimensions.y.virtualSize(e,i)},height:function(){return this.dimensions.y.size},scrollHeight:function(){return this.scrollElement[0].scrollHeight},scrollWidth:function(){return this.scrollElement[0].scrollWidth},options:{name:"Scroller",zoom:!1,pullOffset:140,visibleScrollHints:!1,elastic:!0,useNative:!1,mousewheelScrolling:!0,avoidScrolling:function(){return!1},pullToRefresh:!1,messages:{pullTemplate:"Pull to refresh",releaseTemplate:"Release to refresh",refreshTemplate:"Refreshing"}},events:[C,z,S],_resize:function(){this._native||this.contentResized()},setOptions:function(e){var i=this;r.fn.setOptions.call(i,e),e.pullToRefresh&&i._initPullToRefresh()},reset:function(){this._native?this.scrollElement.scrollTop(0):(this.movable.moveTo({x:0,y:0}),this._scale(1))},contentResized:function(){this.dimensions.refresh(),this.pane.x.outOfBounds()&&this.movable.moveAxis("x",this.dimensions.x.min),this.pane.y.outOfBounds()&&this.movable.moveAxis("y",this.dimensions.y.min)},zoomOut:function(){var e=this.dimensions;e.refresh(),this._scale(e.fitScale),this.movable.moveTo(e.centerCoordinates())},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},scrollTo:function(e,i){this._native?(this.scrollElement.scrollLeft(p(e)),this.scrollElement.scrollTop(p(i))):(this.dimensions.refresh(),this.movable.moveTo({x:e,y:i}))},animatedScrollTo:function(e,i,n){var t,s;this._native?this.scrollTo(e,i):(t={x:this.movable.x,y:this.movable.y},s={x:e,y:i},this.animatedScroller.setCoordinates(t,s),this.animatedScroller.setCallback(n),this.animatedScroller.start())},pullHandled:function(){var e=this;e.refreshHint.removeClass(E),e.hintContainer.html(e.pullTemplate({})),e.yinertia.onEnd(),e.xinertia.onEnd(),e.userEvents.cancel()},destroy:function(){r.fn.destroy.call(this),this.userEvents&&this.userEvents.destroy()},_scale:function(e){this.dimensions.rescale(e),this.movable.scaleTo(e)},_initPullToRefresh:function(){var e=this;e.dimensions.y.forceEnabled(),e.pullTemplate=n.template(e.options.messages.pullTemplate),e.releaseTemplate=n.template(e.options.messages.releaseTemplate),e.refreshTemplate=n.template(e.options.messages.refreshTemplate),e.scrollElement.prepend('<span class="km-scroller-pull"><span class="km-icon"></span><span class="km-loading-left"></span><span class="km-loading-right"></span><span class="km-template">'+e.pullTemplate({})+"</span></span>"),e.refreshHint=e.scrollElement.children().first(),e.hintContainer=e.refreshHint.children(".km-template"),e.pane.y.bind("change",l(e._paneChange,e)),e.userEvents.bind("end",l(e._dragEnd,e))},_dragEnd:function(){var e=this;e.pulled&&(e.pulled=!1,e.refreshHint.removeClass(_).addClass(E),e.hintContainer.html(e.refreshTemplate({})),e.yinertia.freeze(e.options.pullOffset/2),e.trigger("pull"))},_paneChange:function(){var e=this;e.movable.y/w>e.options.pullOffset?e.pulled||(e.pulled=!0,e.refreshHint.removeClass(E).addClass(_),e.hintContainer.html(e.releaseTemplate({}))):e.pulled&&(e.pulled=!1,e.refreshHint.removeClass(_),e.hintContainer.html(e.pullTemplate({})))},_initAxis:function(e){var i=this,n=i.movable,t=i.dimensions[e],s=i.tapCapture,o=i.pane[e],l=new B({axis:e,movable:n,dimension:t,container:i.element,alwaysVisible:i.options.visibleScrollHints});t.bind(k,function(){l.refresh()}),o.bind(k,function(){l.show()}),i[e+"inertia"]=new A({axis:e,paneAxis:o,movable:n,tapCapture:s,userEvents:i.userEvents,dimension:t,elastic:i.options.elastic,friction:i.options.friction||x,velocityMultiplier:i.options.velocityMultiplier||y,end:function(){l.hide(),i.trigger("scrollEnd",{axis:e,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft})}})}});o.plugin(R)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,i,n){(n||i)()});;!function(e,define){define("kendo.virtuallist.min",["kendo.data.min"],e)}(function(){return function(e,t){function i(e){return e[e.length-1]}function n(e){return e instanceof Array?e:[e]}function s(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}function r(e,t,i){return Math.ceil(e*t/i)}function o(e,t,i){var n=document.createElement(i||"div");return t&&(n.className=t),e.appendChild(n),n}function a(){var t,i=e('<div class="k-popup"><ul class="k-list"><li class="k-item"><li></ul></div>');return i.css({position:"absolute",left:"-200000px",visibility:"hidden"}),i.appendTo(document.body),t=parseFloat(m.getComputedStyles(i.find(".k-item")[0],["line-height"])["line-height"]),i.remove(),t}function l(e,t,i){return{down:e*i,up:e*(t-1-i)}}function u(e,t){var i=(e.listScreens-1-e.threshold)*t,n=e.threshold*t;return function(e,t,s){return t>s?i>t-e.top:0===e.top||t-e.top>n}}function h(e,t){return function(i){return t(e.scrollTop,i)}}function c(e){return function(t,i){return e(t.items,t.index,i),t}}function d(e,t){m.support.browser.msie&&10>m.support.browser.version?e.style.top=t+"px":(e.style.webkitTransform="translateY("+t+"px)",e.style.transform="translateY("+t+"px)")}function f(t,i){return function(n,s){for(var r=0,o=n.length;o>r;r++)t(n[r],s[r],i),s[r].item&&this.trigger(N,{item:e(n[r]),data:s[r].item,ns:m.ui})}}function p(e,t){var i;return t>0?(i=e.splice(0,t),e.push.apply(e,i)):(i=e.splice(t,-t),e.unshift.apply(e,i)),i}function g(i,n,s){var r=s.template;i=e(i),n.item||(r=s.placeholderTemplate),this.angular("cleanup",function(){return{elements:[i]}}),i.attr("data-uid",n.item?n.item.uid:"").attr("data-offset-index",n.index).html(r(n.item||{})),i.toggleClass(G,n.current),i.toggleClass(V,n.selected),i.toggleClass("k-first",n.newGroup),i.toggleClass("k-loading-item",!n.item),0!==n.index&&n.newGroup&&e("<div class="+L+"></div>").appendTo(i).html(s.groupTemplate(n.group)),n.top!==t&&d(i[0],n.top),this.angular("compile",function(){return{elements:[i],data:[{dataItem:n.item,group:n.group,newGroup:n.newGroup}]}})}function _(e,t){var i,n,s,r,o=t.length,a=e.length,l=[],u=[];if(a)for(s=0;a>s;s++){for(i=e[s],n=!1,r=0;o>r;r++)if(i===t[r]){n=!0,l.push({index:s,item:i});break}n||u.push(i)}return{changed:l,unchanged:u}}var m=window.kendo,v=m.ui,x=v.Widget,I=v.DataBoundWidget,y=e.proxy,b="k-virtual-wrap",D="k-virtual-list",C="k-virtual-content",S="k-list",k="k-group-header",w="k-virtual-item",H="k-item",T="k-height-container",L="k-group",V="k-state-selected",G="k-state-focused",B="k-state-hover",M="change",F="click",E="listBound",N="itemChange",P="activate",A="deactivate",R=".VirtualList",z=I.extend({init:function(t,i){var s=this;s.bound(!1),s._fetching=!1,x.fn.init.call(s,t,i),s.options.itemHeight||(s.options.itemHeight=a()),i=s.options,s.element.addClass(S+" "+D).attr("role","listbox"),s.content=s.element.wrap("<div unselectable='on' class='"+C+"'></div>").parent(),s.wrapper=s.content.wrap("<div class='"+b+"'></div>").parent(),s.header=s.content.before("<div class='"+k+"'></div>").prev(),s.element.on("mouseenter"+R,"li:not(.k-loading-item)",function(){e(this).addClass(B)}).on("mouseleave"+R,"li",function(){e(this).removeClass(B)}),s._values=n(s.options.value),s._selectedDataItems=[],s._selectedIndexes=[],s._rangesList={},s._activeDeferred=null,s._promisesList=[],s._optionID=m.guid(),s.setDataSource(i.dataSource),s.content.on("scroll"+R,m.throttle(function(){s._renderItems(),s._triggerListBound()},i.delay)),s._selectable()},options:{name:"VirtualList",autoBind:!0,delay:100,height:null,listScreens:4,threshold:.5,itemHeight:null,oppositeBuffer:1,type:"flat",selectable:!1,value:[],dataValueField:null,template:"#:data#",placeholderTemplate:"loading...",groupTemplate:"#:data#",fixedGroupTemplate:"fixed header template",valueMapper:null},events:[M,F,E,N,P,A],setOptions:function(e){x.fn.setOptions.call(this,e),this._selectProxy&&this.options.selectable===!1?this.element.off(F,"."+w,this._selectProxy):!this._selectProxy&&this.options.selectable&&this._selectable(),this.refresh()},items:function(){return e(this._items)},destroy:function(){this.wrapper.off(R),this.dataSource.unbind(M,this._refreshHandler),x.fn.destroy.call(this)},setDataSource:function(t){var i,n=this,s=t||{};s=e.isArray(s)?{data:s}:s,s=m.data.DataSource.create(s),n.dataSource?(n.dataSource.unbind(M,n._refreshHandler),n._clean(),n.bound(!1),n._deferValueSet=!0,i=n.value(),n.value([]),n.mute(function(){n.value(i)})):n._refreshHandler=e.proxy(n.refresh,n),n.dataSource=s.bind(M,n._refreshHandler),n.setDSFilter(s.filter()),0!==s.view().length?n.refresh():n.options.autoBind&&s.fetch()},skip:function(){return this.dataSource.currentRangeStart()},_triggerListBound:function(){var e=this,t=e.skip();e.bound()&&!e._selectingValue&&e._skip!==t&&(e._skip=t,e.trigger(E))},_getValues:function(t){var i=this._valueGetter;return e.map(t,function(e){return i(e)})},refresh:function(e){var t,i=this,n=e&&e.action,s="itemchange"===n,r=this.isFiltered();i._mute||(i._deferValueSet=!1,i._fetching?(i._renderItems&&i._renderItems(!0),i._triggerListBound()):(r&&i.focus(0),i._createList(),n||!i._values.length||r||i.options.skipUpdateOnBind?(i.bound(!0),i._triggerListBound()):(i._selectingValue=!0,i.value(i._values,!0).done(function(){i.bound(!0),i._selectingValue=!1,i._triggerListBound()}))),(s||"remove"===n)&&(t=_(i._selectedDataItems,e.items),t.changed.length&&(s?i.trigger("selectedItemChange",{items:t.changed}):i.value(i._getValues(t.unchanged)))),i._fetching=!1)},removeAt:function(e){return this._selectedIndexes.splice(e,1),this._values.splice(e,1),{position:e,dataItem:this._selectedDataItems.splice(e,1)[0]}},setValue:function(e){this._values=n(e)},value:function(i,s){var r=this;return i===t?r._values.slice():(null===i&&(i=[]),i=n(i),"multiple"===r.options.selectable&&r.select().length&&i.length&&r.select(-1),r._valueDeferred&&"resolved"!==r._valueDeferred.state()||(r._valueDeferred=e.Deferred()),i.length||r.select(-1),r._values=i,(r.bound()&&!r._mute&&!r._deferValueSet||s)&&r._prefetchByValue(i),r._valueDeferred)},_prefetchByValue:function(e){var i,r,o,a=this,l=a._dataView,u=a._valueGetter,h=!1,c=[];for(r=0;e.length>r;r++)for(o=0;l.length>o;o++)i=l[o].item,i&&(h=s(i)?e[r]===i:e[r]===u(i),h&&c.push(l[o].index));if(c.length===e.length)return a._values=[],a.select(c),t;if("function"!=typeof a.options.valueMapper)throw Error("valueMapper is not provided");a.options.valueMapper({value:"multiple"===this.options.selectable?e:e[0],success:function(e){a._values=[],a._selectedIndexes=[],a._selectedDataItems=[],e=n(e),e.length||(e=[-1]),a.select(e)}})},deferredRange:function(t){var i=this.dataSource,n=this.itemCount,s=this._rangesList,r=e.Deferred(),o=[],a=Math.floor(t/n)*n,l=Math.ceil(t/n)*n,u=l===a?[l]:[a,l];return e.each(u,function(t,r){var a,l=r+n,u=s[r];u&&u.end===l?a=u.deferred:(a=e.Deferred(),s[r]={end:l,deferred:a},i._multiplePrefetch(r,n,function(){a.resolve()})),o.push(a)}),e.when.apply(e,o).then(function(){r.resolve()}),r},prefetch:function(t){var i=this,n=this.itemCount,s=!i._promisesList.length;return i._activeDeferred||(i._activeDeferred=e.Deferred(),i._promisesList=[]),e.each(t,function(e,t){var s=Math.floor(t/n)*n;i._promisesList.push(i.deferredRange(s))}),s&&e.when.apply(e,i._promisesList).done(function(){i._activeDeferred.resolve(),i._activeDeferred=null,i._promisesList=[]}),i._activeDeferred},_findDataItem:function(e){var t,i,n=this.dataSource.view();if("group"===this.options.type)for(i=0;n.length>i;i++){if(t=n[i].items,!(e>=t.length))return t[e];e-=t.length}return n[e]},selectedDataItems:function(){return this._selectedDataItems.slice()},scrollTo:function(e){this.content.scrollTop(e)},scrollToIndex:function(e){this.scrollTo(e*this.options.itemHeight)},focus:function(n){var s,r,o,a,l,u,h=this.options.itemHeight,c=this._optionID,d=!0;if(n===t)return a=this.element.find("."+G),a.length?a:null;if("function"==typeof n)for(o=this.dataSource.flatView(),l=0;o.length>l;l++)if(n(o[l])){n=l;break}return n instanceof Array&&(n=i(n)),isNaN(n)?(s=e(n),r=parseInt(e(s).attr("data-offset-index"),10)):(r=n,s=this._getElementByIndex(r)),-1===r?(this.element.find("."+G).removeClass(G),this._focusedIndex=t,t):(s.length?(s.hasClass(G)&&(d=!1),this._focusedIndex!==t&&(a=this._getElementByIndex(this._focusedIndex),a.removeClass(G).removeAttr("id"),d&&this.trigger(A)),this._focusedIndex=r,s.addClass(G).attr("id",c),u=this._getElementLocation(r),"top"===u?this.scrollTo(r*h):"bottom"===u?this.scrollTo(r*h+h-this.screenHeight):"outScreen"===u&&this.scrollTo(r*h),d&&this.trigger(P)):(this._focusedIndex=r,this.items().removeClass(G),this.scrollToIndex(r)),t)},focusIndex:function(){return this._focusedIndex},focusFirst:function(){this.scrollTo(0),this.focus(0)},focusLast:function(){var e=this.dataSource.total();this.scrollTo(this.heightContainer.offsetHeight),this.focus(e)},focusPrev:function(){var e,t=this._focusedIndex;return!isNaN(t)&&t>0?(t-=1,this.focus(t),e=this.focus(),e&&e.hasClass("k-loading-item")&&(t+=1,this.focus(t)),t):(t=this.dataSource.total()-1,this.focus(t),t)},focusNext:function(){var e,t=this._focusedIndex,i=this.dataSource.total()-1;return!isNaN(t)&&i>t?(t+=1,this.focus(t),e=this.focus(),e&&e.hasClass("k-loading-item")&&(t-=1,this.focus(t)),t):(t=0,this.focus(t),t)},_triggerChange:function(e,t){e=e||[],t=t||[],(e.length||t.length)&&this.trigger(M,{removed:e,added:t})},select:function(e){var n,s,r,o,a,l=this,u="multiple"!==l.options.selectable,h=!!l._activeDeferred,c=this.isFiltered(),d=[];return e===t?l._selectedIndexes.slice():(n=l._getIndecies(e),s=u&&!c&&i(n)===i(this._selectedIndexes),d=l._deselectCurrentValues(n),d.length||!n.length||s?(l._triggerChange(d),l._valueDeferred&&l._valueDeferred.resolve(),t):(1===n.length&&-1===n[0]&&(n=[]),o=l._deselect(n),d=o.removed,n=o.indices,u&&(l._activeDeferred=null,h=!1,n.length&&(n=[i(n)])),a=function(){var e=l._select(n);l.focus(n),l._triggerChange(d,e),l._valueDeferred&&l._valueDeferred.resolve()},r=l.prefetch(n),h||(r?r.done(a):a()),t))},bound:function(e){return e===t?this._listCreated:(this._listCreated=e,t)},mute:function(e){this._mute=!0,y(e(),this),this._mute=!1},setDSFilter:function(t){this._lastDSFilter=e.extend({},t)},isFiltered:function(){return this._lastDSFilter||this.setDSFilter(this.dataSource.filter()),!m.data.Query.compareFilters(this.dataSource.filter(),this._lastDSFilter)},skipUpdate:e.noop,_getElementByIndex:function(t){return this.items().filter(function(i,n){return t===parseInt(e(n).attr("data-offset-index"),10)})},_clean:function(){this.result=t,this._lastScrollTop=t,this._skip=t,e(this.heightContainer).remove(),this.heightContainer=t,this.element.empty()},_height:function(){var e=!!this.dataSource.view().length,t=this.options.height,i=this.options.itemHeight,n=this.dataSource.total();return e?t/i>n&&(t=n*i):t=0,t},_screenHeight:function(){var e=this._height(),t=this.content;t.height(e),this.screenHeight=e},_getElementLocation:function(e){var t,i=this.content.scrollTop(),n=this.screenHeight,s=this.options.itemHeight,r=e*s,o=r+s,a=i+n;return t=r===i-s||o>i&&i>r?"top":r===a||a>r&&o>a?"bottom":r>=i&&i+(n-s)>=r?"inScreen":"outScreen"},_templates:function(){var e,t={template:this.options.template,placeholderTemplate:this.options.placeholderTemplate,groupTemplate:this.options.groupTemplate,fixedGroupTemplate:this.options.fixedGroupTemplate};for(e in t)"function"!=typeof t[e]&&(t[e]=m.template(t[e]));this.templates=t},_generateItems:function(e,t){for(var i,n=[],s=this.options.itemHeight+"px";t-- >0;)i=document.createElement("li"),i.tabIndex=-1,i.className=w+" "+H,i.setAttribute("role","option"),i.style.height=s,i.style.minHeight=s,e.appendChild(i),n.push(i);return n},_saveInitialRanges:function(){var t,i=this.dataSource._ranges,n=e.Deferred();for(n.resolve(),this._rangesList={},t=0;i.length>t;t++)this._rangesList[i[t].start]={end:i[t].end,deferred:n}},_createList:function(){var t=this,i=t.content.get(0),n=t.options,s=t.dataSource;t.bound()&&t._clean(),t._saveInitialRanges(),t._screenHeight(),t._buildValueGetter(),t.itemCount=r(t.screenHeight,n.listScreens,n.itemHeight),t.itemCount>s.total()&&(t.itemCount=s.total()),t._templates(),t._items=t._generateItems(t.element[0],t.itemCount),t._setHeight(n.itemHeight*s.total()),t.options.type=(s.group()||[]).length?"group":"flat","flat"===t.options.type?t.header.hide():t.header.show(),t.getter=t._getter(function(){t._renderItems(!0)}),t._onScroll=function(e,i){var n=t._listItems(t.getter);return t._fixedHeader(e,n(e,i))},t._renderItems=t._whenChanged(h(i,t._onScroll),c(t._reorderList(t._items,e.proxy(g,t)))),t._renderItems(),t._calculateGroupPadding(t.screenHeight)},_setHeight:function(e){var t,i,n=this.heightContainer;if(n?t=n.offsetHeight:n=this.heightContainer=o(this.content[0],T),e!==t)for(n.innerHTML="";e>0;)i=Math.min(e,25e4),o(n).style.height=i+"px",e-=i},_getter:function(){var e=null,t=this.dataSource,i=t.skip(),n=this.options.type,s=this.itemCount,r={};return t.pageSize()<s&&this.mute(function(){t.pageSize(s)}),function(o,a){var l,u,h,c,d,f,p,g,_=this;if(t.inRange(a,s)){if(i!==a&&this.mute(function(){t.range(a,s),i=a}),"group"===n){if(!r[a])for(u=r[a]=[],h=t.view(),c=0,d=h.length;d>c;c++)for(f=h[c],p=0,g=f.items.length;g>p;p++)u.push({item:f.items[p],group:f.value});l=r[a][o-a]}else l=t.view()[o-a];return l}return e!==a&&(e=a,i=a,_._getterDeferred&&_._getterDeferred.reject(),_._getterDeferred=_.deferredRange(a),_._getterDeferred.then(function(){var e=_._indexConstraint(_.content[0].scrollTop);_._getterDeferred=null,e>=a&&a+s>=e&&(_._fetching=!0,t.range(a,s))})),null}},_fixedHeader:function(e,t){var i,n=this.currentVisibleGroup,s=this.options.itemHeight,r=Math.floor((e-t.top)/s),o=t.items[r];return o&&o.item&&(i=o.group,i!==n&&(this.header[0].innerHTML=i||"",this.currentVisibleGroup=i)),t},_itemMapper:function(e,t,i){var n,r=this.options.type,o=this.options.itemHeight,a=this._focusedIndex,l=!1,u=!1,h=!1,c=null,d=!1,f=this._valueGetter;if("group"===r&&(e&&(h=0===t||this._currentGroup&&this._currentGroup!==e.group,this._currentGroup=e.group),c=e?e.group:null,e=e?e.item:null),!this.isFiltered()&&i.length&&e)for(n=0;i.length>n;n++)if(d=s(e)?i[n]===e:i[n]===f(e)){i.splice(n,1),l=!0;break}return a===t&&(u=!0),{item:e?e:null,group:c,newGroup:h,selected:l,current:u,index:t,top:t*o}},_range:function(e){var t,i,n,s=this.itemCount,r=this._values.slice(),o=[];for(this._view={},this._currentGroup=null,i=e,n=e+s;n>i;i++)t=this._itemMapper(this.getter(i,e),i,r),o.push(t),this._view[t.index]=t;return this._dataView=o,o},_getDataItemsCollection:function(e,t){var i=this._range(this._listIndex(e,t));return{index:i.length?i[0].index:0,top:i.length?i[0].top:0,items:i}},_listItems:function(){var t=this.screenHeight,i=this.options,n=u(i,t);return e.proxy(function(e,t){var i=this.result,s=this._lastScrollTop;return!t&&i&&n(i,e,s)||(i=this._getDataItemsCollection(e,s)),this._lastScrollTop=e,this.result=i,i},this)},_whenChanged:function(e,t){var i;return function(n){var s=e(n);s!==i&&(i=s,t(s,n))}},_reorderList:function(t,i){var n=this,s=t.length,r=-(1/0);return i=e.proxy(f(i,this.templates),this),function(e,o,a){var l,u,h=o-r;a||Math.abs(h)>=s?(l=t,u=e):(l=p(t,h),u=h>0?e.slice(-h):e.slice(0,-h)),i(l,u,n.bound()),r=o}},_bufferSizes:function(){var e=this.options;return l(this.screenHeight,e.listScreens,e.oppositeBuffer)},_indexConstraint:function(e){var t=this.itemCount,i=this.options.itemHeight,n=this.dataSource.total();return Math.min(Math.max(n-t,0),Math.max(0,Math.floor(e/i)))},_listIndex:function(e,t){var i,n=this._bufferSizes();return i=e-(e>t?n.down:n.up),this._indexConstraint(i)},_selectable:function(){this.options.selectable&&(this._selectProxy=e.proxy(this,"_clickHandler"),this.element.on(F+R,"."+w,this._selectProxy))},_getIndecies:function(e){var t,i,n=[];if("function"==typeof e)for(t=this.dataSource.flatView(),i=0;t.length>i;i++)if(e(t[i])){n.push(i);break}return"number"==typeof e&&n.push(e),e instanceof jQuery&&(e=parseInt(e.attr("data-offset-index"),10),isNaN(e)||n.push(e)),e instanceof Array&&(n=e),n},_deselect:function(i){var n,s,r,o,a,l=[],u=this._selectedIndexes,h=0,c=this.options.selectable,d=0;if(i=i.slice(),c!==!0&&i.length){if("multiple"===c)for(a=0;i.length>a;a++)if(h=e.inArray(i[a],u),n=u[h],n!==t){if(r=this._getElementByIndex(n),!r.hasClass("k-state-selected"))continue;r.removeClass(V),this._values.splice(h,1),this._selectedIndexes.splice(h,1),s=this._selectedDataItems.splice(h,1)[0],i.splice(a,1),l.push({index:n,position:h+d,dataItem:s}),d++,a--}}else{for(o=0;u.length>o;o++)u[o]!==t&&(this._getElementByIndex(u[o]).removeClass(V),l.push({index:u[o],position:o,dataItem:this._selectedDataItems[o]}));this._values=[],this._selectedDataItems=[],this._selectedIndexes=[]}return{indices:i,removed:l}},_deselectCurrentValues:function(t){var i,n,s,r,o=this.element[0].children,a=this._values,l=[],u=0;if("multiple"!==this.options.selectable||!this.isFiltered())return[];for(;t.length>u;u++){for(s=-1,n=t[u],i=this._valueGetter(this._view[n].item),r=0;a.length>r;r++)if(i==a[r]){s=r;break}s>-1&&(l.push(this.removeAt(s)),e(o[n]).removeClass("k-state-selected"))}return l},_select:function(t){var i,n,r=this,o="multiple"!==this.options.selectable,a=this.dataSource,l=this.itemCount,u=this._valueGetter,h=[];return o&&(r._selectedIndexes=[],r._selectedDataItems=[],r._values=[]),n=a.skip(),e.each(t,function(e,t){var o=l>t?1:Math.floor(t/l)+1,c=(o-1)*l;r.mute(function(){a.range(c,l),i=r._findDataItem([t-c]),r._selectedIndexes.push(t),r._selectedDataItems.push(i),r._values.push(s(i)?i:u(i)),h.push({index:t,dataItem:i}),r._getElementByIndex(t).addClass(V),a.range(n,l)})}),h},_clickHandler:function(t){var i=e(t.currentTarget);!t.isDefaultPrevented()&&i.attr("data-uid")&&this.trigger(F,{item:i})},_buildValueGetter:function(){this._valueGetter=m.getter(this.options.dataValueField)},_calculateGroupPadding:function(e){var t=this.items().first(),i=this.header,n=0;i[0]&&"none"!==i[0].style.display&&("auto"!==e&&(n=m.support.scrollbar()),n+=parseFloat(t.css("border-right-width"),10)+parseFloat(t.children(".k-group").css("right"),10),i.css("padding-right",n))}});m.ui.VirtualList=z,m.ui.plugin(z)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()});;!function(e,define){define("kendo.popup.min",["kendo.core.min"],e)}(function(){return function(e,t){function o(t,o){return t===o||e.contains(t,o)}var i=window.kendo,n=i.ui,s=n.Widget,r=i.support,a=i.getOffset,l="open",p="close",d="deactivate",c="activate",f="center",u="left",h="right",g="top",m="bottom",w="absolute",v="hidden",_="body",k="location",y="position",z="visible",b="effects",x="k-state-active",C="k-state-border",T=/k-state-border-(\w+)/,P=".k-picker-wrap, .k-dropdown-wrap, .k-link",E="down",S=e(document.documentElement),H=e(window),W="scroll",O=r.transitions.css,R=O+"transform",I=e.extend,A=".kendoPopup",D=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],L=s.extend({init:function(t,o){var n,a=this;o=o||{},o.isRtl&&(o.origin=o.origin||m+" "+h,o.position=o.position||g+" "+h),s.fn.init.call(a,t,o),t=a.element,o=a.options,a.collisions=o.collision?o.collision.split(" "):[],a.downEvent=i.applyEventMap(E,i.guid()),1===a.collisions.length&&a.collisions.push(a.collisions[0]),n=e(a.options.anchor).closest(".k-popup,.k-group").filter(":not([class^=km-])"),o.appendTo=e(e(o.appendTo)[0]||n[0]||_),a.element.hide().addClass("k-popup k-group k-reset").toggleClass("k-rtl",!!o.isRtl).css({position:w}).appendTo(o.appendTo).on("mouseenter"+A,function(){a._hovered=!0}).on("mouseleave"+A,function(){a._hovered=!1}),a.wrapper=e(),o.animation===!1&&(o.animation={open:{effects:{}},close:{hide:!0,effects:{}}}),I(o.animation.open,{complete:function(){a.wrapper.css({overflow:z}),a._activated=!0,a._trigger(c)}}),I(o.animation.close,{complete:function(){a._animationClose()}}),a._mousedownProxy=function(e){a._mousedown(e)},a._resizeProxy=r.mobileOS.android?function(e){setTimeout(function(){a._resize(e)},600)}:function(e){a._resize(e)},o.toggleTarget&&e(o.toggleTarget).on(o.toggleEvent+A,e.proxy(a.toggle,a))},events:[l,c,p,d],options:{name:"Popup",toggleEvent:"click",origin:m+" "+u,position:g+" "+u,anchor:_,appendTo:null,collision:"flip fit",viewport:window,copyAnchorStyles:!0,autosize:!1,modal:!1,adjustSize:{width:0,height:0},animation:{open:{effects:"slideIn:down",transition:!0,duration:200},close:{duration:100,hide:!0}}},_animationClose:function(){var e=this,t=e.wrapper.data(k);e.wrapper.hide(),t&&e.wrapper.css(t),e.options.anchor!=_&&e._hideDirClass(),e._closing=!1,e._trigger(d)},destroy:function(){var t,o=this,n=o.options,r=o.element.off(A);s.fn.destroy.call(o),n.toggleTarget&&e(n.toggleTarget).off(A),n.modal||(S.unbind(o.downEvent,o._mousedownProxy),o._toggleResize(!1)),i.destroy(o.element.children()),r.removeData(),n.appendTo[0]===document.body&&(t=r.parent(".k-animation-container"),t[0]?t.remove():r.remove())},open:function(t,o){var n,s,a=this,p={isFixed:!isNaN(parseInt(o,10)),x:t,y:o},d=a.element,c=a.options,f=e(c.anchor),u=d[0]&&d.hasClass("km-widget");if(!a.visible()){if(c.copyAnchorStyles&&(u&&"font-size"==D[0]&&D.shift(),d.css(i.getComputedStyles(f[0],D))),d.data("animating")||a._trigger(l))return;a._activated=!1,c.modal||(S.unbind(a.downEvent,a._mousedownProxy).bind(a.downEvent,a._mousedownProxy),a._toggleResize(!1),a._toggleResize(!0)),a.wrapper=s=i.wrap(d,c.autosize).css({overflow:v,display:"block",position:w}),r.mobileOS.android&&s.css(R,"translatez(0)"),s.css(y),e(c.appendTo)[0]==document.body&&s.css(g,"-10000px"),a.flipped=a._position(p),n=a._openAnimation(),c.anchor!=_&&a._showDirClass(n),d.data(b,n.effects).kendoStop(!0).kendoAnimate(n)}},_openAnimation:function(){var e=I(!0,{},this.options.animation.open);return e.effects=i.parseEffects(e.effects,this.flipped),e},_hideDirClass:function(){var t=e(this.options.anchor),o=((t.attr("class")||"").match(T)||["","down"])[1],n=C+"-"+o;t.removeClass(n).children(P).removeClass(x).removeClass(n),this.element.removeClass(C+"-"+i.directions[o].reverse)},_showDirClass:function(t){var o=t.effects.slideIn?t.effects.slideIn.direction:"down",n=C+"-"+o;e(this.options.anchor).addClass(n).children(P).addClass(x).addClass(n),this.element.addClass(C+"-"+i.directions[o].reverse)},position:function(){this.visible()&&(this.flipped=this._position())},toggle:function(){var e=this;e[e.visible()?p:l]()},visible:function(){return this.element.is(":"+z)},close:function(o){var n,s,r,a,l=this,d=l.options;if(l.visible()){if(n=l.wrapper[0]?l.wrapper:i.wrap(l.element).hide(),l._toggleResize(!1),l._closing||l._trigger(p))return l._toggleResize(!0),t;l.element.find(".k-popup").each(function(){var t=e(this),i=t.data("kendoPopup");i&&i.close(o)}),S.unbind(l.downEvent,l._mousedownProxy),o?s={hide:!0,effects:{}}:(s=I(!0,{},d.animation.close),r=l.element.data(b),a=s.effects,!a&&!i.size(a)&&r&&i.size(r)&&(s.effects=r,s.reverse=!0),l._closing=!0),l.element.kendoStop(!0),n.css({overflow:v}),l.element.kendoAnimate(s)}},_trigger:function(e){return this.trigger(e,{type:e})},_resize:function(e){var t=this;-1!==r.resize.indexOf(e.type)?(clearTimeout(t._resizeTimeout),t._resizeTimeout=setTimeout(function(){t._position(),t._resizeTimeout=null},50)):(!t._hovered||t._activated&&t.element.hasClass("k-list-container"))&&t.close()},_toggleResize:function(e){var t=e?"on":"off",o=r.resize;r.mobileOS.ios||r.mobileOS.android||(o+=" "+W),this._scrollableParents()[t](W,this._resizeProxy),H[t](o,this._resizeProxy)},_mousedown:function(t){var n=this,s=n.element[0],r=n.options,a=e(r.anchor)[0],l=r.toggleTarget,p=i.eventTarget(t),d=e(p).closest(".k-popup"),c=d.parent().parent(".km-shim").length;d=d[0],(c||!d||d===n.element[0])&&"popover"!==e(t.target).closest("a").data("rel")&&(o(s,p)||o(a,p)||l&&o(e(l)[0],p)||n.close())},_fit:function(e,t,o){var i=0;return e+t>o&&(i=o-(e+t)),0>e&&(i=-e),i},_flip:function(e,t,o,i,n,s,r){var a=0;return r=r||t,s!==n&&s!==f&&n!==f&&(e+r>i&&(a+=-(o+t)),0>e+a&&(a+=o+t)),a},_scrollableParents:function(){return e(this.options.anchor).parentsUntil("body").filter(function(e,t){return i.isScrollable(t)})},_position:function(t){var o,n,s,l,p,d,c,f,u,h,g,m,v,_=this,z=_.element,b=_.wrapper,x=_.options,C=e(x.viewport),T=C.offset(),P=e(x.anchor),E=x.origin.toLowerCase().split(" "),S=x.position.toLowerCase().split(" "),H=_.collisions,W=r.zoomLevel(),O=10002,R=!!(C[0]==window&&window.innerWidth&&1.02>=W),A=0,D=document.documentElement,L=R?window.innerWidth:C.width(),j=R?window.innerHeight:C.height();if(R&&D.scrollHeight-D.clientHeight>0&&(L-=i.support.scrollbar()),o=P.parents().filter(b.siblings()),o[0])if(s=Math.max(+o.css("zIndex"),0))O=s+10;else for(n=P.parentsUntil(o),l=n.length;l>A;A++)s=+e(n[A]).css("zIndex"),s&&s>O&&(O=s+10);return b.css("zIndex",O),b.css(t&&t.isFixed?{left:t.x,top:t.y}:_._align(E,S)),p=a(b,y,P[0]===b.offsetParent()[0]),d=a(b),c=P.offsetParent().parent(".k-animation-container,.k-popup,.k-group"),c.length&&(p=a(b,y,!0),d=a(b)),C[0]===window?(d.top-=window.pageYOffset||document.documentElement.scrollTop||0,d.left-=window.pageXOffset||document.documentElement.scrollLeft||0):(d.top-=T.top,d.left-=T.left),_.wrapper.data(k)||b.data(k,I({},p)),f=I({},d),u=I({},p),h=x.adjustSize,"fit"===H[0]&&(u.top+=_._fit(f.top,b.outerHeight()+h.height,j/W)),"fit"===H[1]&&(u.left+=_._fit(f.left,b.outerWidth()+h.width,L/W)),g=I({},u),m=z.outerHeight(),v=b.outerHeight(),!b.height()&&m&&(v+=m),"flip"===H[0]&&(u.top+=_._flip(f.top,m,P.outerHeight(),j/W,E[0],S[0],v)),"flip"===H[1]&&(u.left+=_._flip(f.left,z.outerWidth(),P.outerWidth(),L/W,E[1],S[1],b.outerWidth())),z.css(y,w),b.css(u),u.left!=g.left||u.top!=g.top},_align:function(t,o){var i,n=this,s=n.wrapper,r=e(n.options.anchor),l=t[0],p=t[1],d=o[0],c=o[1],u=a(r),g=e(n.options.appendTo),w=s.outerWidth(),v=s.outerHeight(),_=r.outerWidth(),k=r.outerHeight(),y=u.top,z=u.left,b=Math.round;return g[0]!=document.body&&(i=a(g),y-=i.top,z-=i.left),l===m&&(y+=k),l===f&&(y+=b(k/2)),d===m&&(y-=v),d===f&&(y-=b(v/2)),p===h&&(z+=_),p===f&&(z+=b(_/2)),c===h&&(z-=w),c===f&&(z-=b(w/2)),{top:y,left:z}}});n.plugin(L)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,o){(o||t)()});;!function(e,define){define("kendo.list.min",["kendo.data.min","kendo.popup.min"],e)}(function(){return function(e,t){function i(e,i){return e!==t&&""!==e&&null!==e&&("boolean"===i?e=!!e:"number"===i?e=+e:"string"===i&&(e=""+e)),e}function n(e,t){var i,n,s,a,r=t.length,l=e.length,o=[],u=[];if(l)for(s=0;l>s;s++){for(i=e[s],n=!1,a=0;r>a;a++)if(i===t[a]){n=!0,o.push({index:s,item:i});break}n||u.push(i)}return{changed:o,unchanged:u}}function s(t,i){var n,a=!1;return t.filters&&(n=e.grep(t.filters,function(e){return a=s(e,i),e.filters?e.filters.length:e.field!=i}),a||t.filters.length===n.length||(a=!0),t.filters=n),a}var a,r,l=window.kendo,o=l.ui,u=o.Widget,d=l.keys,c=l.support,h=l.htmlEncode,f=l._activeElement,p=l.data.ObservableArray,_="id",v="change",g="k-state-focused",m="k-state-hover",b="k-loading",x="open",S="close",I="cascade",w="select",y="selected",T="requestStart",k="requestEnd",F="width",V=e.extend,C=e.proxy,D=e.isArray,H=c.browser,B=H.msie&&9>H.version,A=/"/g,G={ComboBox:"DropDownList",DropDownList:"ComboBox"},L=l.ui.DataBoundWidget.extend({init:function(t,i){var n,s=this,a=s.ns;u.fn.init.call(s,t,i),t=s.element,i=s.options,s._isSelect=t.is(w),s._isSelect&&s.element[0].length&&(i.dataSource||(i.dataTextField=i.dataTextField||"text",i.dataValueField=i.dataValueField||"value")),s.ul=e('<ul unselectable="on" class="k-list k-reset"/>').attr({tabIndex:-1,"aria-hidden":!0}),s.list=e("<div class='k-list-container'/>").append(s.ul).on("mousedown"+a,C(s._listMousedown,s)),n=t.attr(_),n&&(s.list.attr(_,n+"-list"),s.ul.attr(_,n+"_listbox")),s._header(),s._accessors(),s._initValue()},options:{valuePrimitive:!1,headerTemplate:""},setOptions:function(e){u.fn.setOptions.call(this,e),e&&e.enable!==t&&(e.enabled=e.enable)},focus:function(){this._focused.focus()},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},_listOptions:function(t){var i=this,n=i.options,s=n.virtual,a=C(i._listBound,i);return s="object"==typeof s?s:{},t=e.extend({autoBind:!1,selectable:!0,dataSource:i.dataSource,click:C(i._click,i),change:C(i._listChange,i),activate:C(i._activateItem,i),deactivate:C(i._deactivateItem,i),dataBinding:function(){i.trigger("dataBinding"),i._angularItems("cleanup")},dataBound:a,listBound:a,height:n.height,dataValueField:n.dataValueField,dataTextField:n.dataTextField,groupTemplate:n.groupTemplate,fixedGroupTemplate:n.fixedGroupTemplate,template:n.template},t,s),t.template||(t.template="#:"+l.expr(t.dataTextField,"data")+"#"),t},_initList:function(){var e=this,t=e._listOptions({selectedItemChange:C(e._listChange,e)});e.listView=e.options.virtual?new l.ui.VirtualList(e.ul,t):new l.ui.StaticList(e.ul,t),e._setListValue()},_setListValue:function(e){e=e||this.options.value,e!==t&&this.listView.value(e).done(C(this._updateSelectionState,this))},_updateSelectionState:e.noop,_listMousedown:function(e){this.filterInput&&this.filterInput[0]===e.target||e.preventDefault()},_isFilterEnabled:function(){var e=this.options.filter;return e&&"none"!==e},_filterSource:function(e,t){var i=this,n=i.options,a=i.dataSource,r=V({},a.filter()||{}),l=s(r,n.dataTextField);(e||l)&&i.trigger("filtering",{filter:e})||(r={filters:r.filters||[],logic:"and"},e&&r.filters.push(e),i._cascading&&this.listView.setDSFilter(r),t?a.read({filter:r}):a.filter(r))},_header:function(){var t,i=this,n=i.options.headerTemplate;e.isFunction(n)&&(n=n({})),n&&(i.list.prepend(n),t=i.ul.prev(),i.header=t[0]?t:null,i.header&&i.angular("compile",function(){return{elements:i.header}}))},_initValue:function(){var e=this,t=e.options.value;null!==t?e.element.val(t):(t=e._accessor(),e.options.value=t),e._old=t},_ignoreCase:function(){var e,t=this,i=t.dataSource.reader.model;i&&i.fields&&(e=i.fields[t.options.dataTextField],e&&e.type&&"string"!==e.type&&(t.options.ignoreCase=!1))},_focus:function(e){return this.listView.focus(e)},current:function(e){return this._focus(e)},items:function(){return this.ul[0].children},destroy:function(){var e=this,t=e.ns;u.fn.destroy.call(e),e._unbindDataSource(),e.listView.destroy(),e.list.off(t),e.popup.destroy(),e._form&&e._form.off("reset",e._resetHandler)},dataItem:function(i){var n=this;if(i===t)return n.listView.selectedDataItems()[0];if("number"!=typeof i){if(n.options.virtual)return n.dataSource.getByUid(e(i).data("uid"));i=e(n.items()).index(i)}return n.dataSource.flatView()[i]},_activateItem:function(){var e=this.listView.focus();e&&this._focused.add(this.filterInput).attr("aria-activedescendant",e.attr("id"))},_deactivateItem:function(){this._focused.add(this.filterInput).removeAttr("aria-activedescendant")},_accessors:function(){var e=this,t=e.element,i=e.options,n=l.getter,s=t.attr(l.attr("text-field")),a=t.attr(l.attr("value-field"));!i.dataTextField&&s&&(i.dataTextField=s),!i.dataValueField&&a&&(i.dataValueField=a),e._text=n(i.dataTextField),e._value=n(i.dataValueField)},_aria:function(e){var i=this,n=i.options,s=i._focused.add(i.filterInput);n.suggest!==t&&s.attr("aria-autocomplete",n.suggest?"both":"list"),e=e?e+" "+i.ul[0].id:i.ul[0].id,s.attr("aria-owns",e),i.ul.attr("aria-live",i._isFilterEnabled()?"polite":"off")},_blur:function(){var e=this;e._change(),e.close()},_change:function(){var e,n=this,s=n.selectedIndex,a=n.options.value,r=n.value();n._isSelect&&!n.listView.bound()&&a&&(r=a),r!==i(n._old,typeof r)?e=!0:s!==t&&s!==n._oldIndex&&(e=!0),e&&(n._old=r,n._oldIndex=s,n._typing||n.element.trigger(v),n.trigger(v)),n.typing=!1},_data:function(){return this.dataSource.view()},_enable:function(){var e=this,i=e.options,n=e.element.is("[disabled]");i.enable!==t&&(i.enabled=i.enable),!i.enabled||n?e.enable(!1):e.readonly(e.element.is("[readonly]"))},_dataValue:function(e){var i=this._value(e);return i===t&&(i=this._text(e)),i},_offsetHeight:function(){var t=0,i=this.listView.content.prevAll(":visible");return i.each(function(){var i=e(this);t+=i.hasClass("k-list-filter")?i.children().outerHeight():i.outerHeight()}),t},_height:function(e){var i,n,s=this,a=s.list,r=s.options.height,l=s.popup.visible();if(e){if(n=a.add(a.parent(".k-animation-container")).show(),!a.is(":visible"))return n.hide(),t;r=s.listView.content[0].scrollHeight>r?r:"auto",n.height(r),"auto"!==r&&(i=s._offsetHeight(),i&&(r-=i)),s.listView.content.height(r),l||n.hide()}return r},_adjustListWidth:function(){var e,t,i=this.list,n=i[0].style.width,s=this.wrapper;if(i.data(F)||!n)return e=window.getComputedStyle?window.getComputedStyle(s[0],null):0,t=parseFloat(e&&e.width)||s.outerWidth(),e&&H.msie&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),n="border-box"!==i.css("box-sizing")?t-(i.outerWidth()-i.width()):t,i.css({fontFamily:s.css("font-family"),width:n}).data(F,n),!0},_openHandler:function(e){this._adjustListWidth(),this.trigger(x)?e.preventDefault():(this._focused.attr("aria-expanded",!0),this.ul.attr("aria-hidden",!1))},_closeHandler:function(e){this.trigger(S)?e.preventDefault():(this._focused.attr("aria-expanded",!1),this.ul.attr("aria-hidden",!0))},_focusItem:function(){var e=this.listView,i=e.focus(),n=e.select();n=n[n.length-1],n===t&&this.options.highlightFirst&&!i&&(n=0),n!==t?e.focus(n):e.scrollToIndex(0)},_calculateGroupPadding:function(e){var t=this.ul.children(".k-first:first"),i=this.listView.content.prev(".k-group-header"),n=0;i[0]&&"none"!==i[0].style.display&&("auto"!==e&&(n=l.support.scrollbar()),n+=parseFloat(t.css("border-right-width"),10)+parseFloat(t.children(".k-group").css("padding-right"),10),i.css("padding-right",n))},_calculatePopupHeight:function(e){var t=this._height(this.dataSource.flatView().length||e);this._calculateGroupPadding(t)},_resizePopup:function(e){this.options.virtual||(this.popup.element.is(":visible")?this._calculatePopupHeight(e):this.popup.one("open",function(e){return C(function(){this._calculatePopupHeight(e)},this)}.call(this,e)))},_popup:function(){var e=this;e.popup=new o.Popup(e.list,V({},e.options.popup,{anchor:e.wrapper,open:C(e._openHandler,e),close:C(e._closeHandler,e),animation:e.options.animation,isRtl:c.isRtl(e.wrapper)}))},_makeUnselectable:function(){B&&this.list.find("*").not(".k-textbox").attr("unselectable","on")},_toggleHover:function(t){e(t.currentTarget).toggleClass(m,"mouseenter"===t.type)},_toggle:function(e,i){var n=this,s=c.mobileOS&&(c.touch||c.MSPointers||c.pointers);e=e!==t?e:!n.popup.visible(),i||s||n._focused[0]===f()||(n._prevent=!0,n._focused.focus(),n._prevent=!1),n[e?x:S]()},_triggerCascade:function(){var e=this;e._cascadeTriggered&&e._old===e.value()&&e._oldIndex===e.selectedIndex||(e._cascadeTriggered=!0,e.trigger(I,{userTriggered:e._userTriggered}))},_triggerChange:function(){this._valueBeforeCascade!==this.value()&&this.trigger(v)},_unbindDataSource:function(){var e=this;e.dataSource.unbind(T,e._requestStartHandler).unbind(k,e._requestEndHandler).unbind("error",e._errorHandler)}});V(L,{inArray:function(e,t){var i,n,s=t.children;if(!e||e.parentNode!==t)return-1;for(i=0,n=s.length;n>i;i++)if(e===s[i])return i;return-1},unifyType:i}),l.ui.List=L,o.Select=L.extend({init:function(e,t){L.fn.init.call(this,e,t),this._initial=this.element.val()},setDataSource:function(e){var t,i=this;i.options.dataSource=e,i._dataSource(),i.listView.bound()&&(i._initialIndex=null),i.listView.setDataSource(i.dataSource),i.options.autoBind&&i.dataSource.fetch(),t=i._parentWidget(),t&&i._cascadeSelect(t)},close:function(){this.popup.close()},select:function(e){var i=this;return e===t?i.selectedIndex:(i._select(e),i._old=i._accessor(),i._oldIndex=i.selectedIndex,t)},search:function(e){var t,i,n,s,a;e="string"==typeof e?e:this.text(),t=this,i=e.length,n=t.options,s=n.ignoreCase,a=n.dataTextField,clearTimeout(t._typingTimeout),(!i||i>=n.minLength)&&(t._state="filter",t._isFilterEnabled()?(t._open=!0,t._filterSource({value:s?e.toLowerCase():e,field:a,operator:n.filter,ignoreCase:s})):t._filter(e))},_accessor:function(e,t){return this[this._isSelect?"_accessorSelect":"_accessorInput"](e,t)},_accessorInput:function(e){var i=this.element[0];return e===t?i.value:(null===e&&(e=""),i.value=e,t)},_accessorSelect:function(e,i){var n,s=this.element[0],a=s.selectedIndex;return e===t?(a>-1&&(n=s.options[a]),n&&(e=n.value),e||""):(a>-1&&(s.options[a].removeAttribute(y),s.options[a].selected=!1),i===t&&(i=-1),null!==e&&""!==e&&-1==i?this._custom(e):(e?s.value=e:s.selectedIndex=i,s.selectedIndex>-1&&(n=s.options[s.selectedIndex]),n&&n.setAttribute(y,y)),t)},_custom:function(t){var i=this,n=i.element,s=i._customOption;s||(s=e("<option/>"),i._customOption=s,n.append(s)),s.text(t),s[0].setAttribute(y,y),s[0].selected=!0},_hideBusy:function(){var e=this;clearTimeout(e._busy),e._arrow.removeClass(b),e._focused.attr("aria-busy",!1),e._busy=null},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(function(){e._arrow&&(e._focused.attr("aria-busy",!0),e._arrow.addClass(b))},100))},_requestEnd:function(){this._request=!1,this._hideBusy()},_dataSource:function(){var t,i=this,n=i.element,s=i.options,a=s.dataSource||{};a=e.isArray(a)?{data:a}:a,i._isSelect&&(t=n[0].selectedIndex,t>-1&&(s.index=t),a.select=n,a.fields=[{field:s.dataTextField},{field:s.dataValueField}]),i.dataSource?i._unbindDataSource():(i._requestStartHandler=C(i._showBusy,i),i._requestEndHandler=C(i._requestEnd,i),i._errorHandler=C(i._hideBusy,i)),i.dataSource=l.data.DataSource.create(a).bind(T,i._requestStartHandler).bind(k,i._requestEndHandler).bind("error",i._errorHandler)},_firstItem:function(){this.listView.focusFirst()},_lastItem:function(){this.listView.focusLast()},_nextItem:function(){this.listView.focusNext()},_prevItem:function(){this.listView.focusPrev()},_move:function(e){var i,n,s,a,r=this,l=e.keyCode,o=l===d.DOWN;if(l===d.UP||o){if(e.altKey)r.toggle(o);else{if(!r.listView.bound())return r._fetch||(r.dataSource.one(v,function(){r._fetch=!1,r._move(e)}),r._fetch=!0,r._filterSource()),e.preventDefault(),!0;if(s=r._focus(),r._fetch||s&&!s.hasClass("k-state-selected")||(o?(r._nextItem(),r._focus()||r._lastItem()):(r._prevItem(),r._focus()||r._firstItem())),r.trigger(w,{item:r._focus()}))return r._focus(s),t;r._select(r._focus(),!0),r.popup.visible()||r._blur()}e.preventDefault(),n=!0}else if(l===d.ENTER||l===d.TAB){if(r.popup.visible()&&e.preventDefault(),s=r._focus(),i=r.dataItem(),r.popup.visible()||i&&r.text()===r._text(i)||(s=null),a=r.filterInput&&r.filterInput[0]===f(),s){if(r.trigger(w,{item:s}))return;r._select(s)}else r.input&&(r._accessor(r.input.val()),r.listView.value(r.input.val()));r._focusElement&&r._focusElement(r.wrapper),a&&l===d.TAB?r.wrapper.focusout():r._blur(),r.close(),n=!0}else l===d.ESC&&(r.popup.visible()&&e.preventDefault(),r.close(),n=!0);return n},_fetchData:function(){var e=this,t=!!e.dataSource.view().length;e._request||e.options.cascadeFrom||e.listView.bound()||e._fetch||t||(e._fetch=!0,e.dataSource.fetch().done(function(){e._fetch=!1}))},_options:function(e,i,n){var s,a,r,l,o=this,u=o.element,d=e.length,c="",f=0;for(i&&(c=i);d>f;f++)s="<option",a=e[f],r=o._text(a),l=o._value(a),l!==t&&(l+="",-1!==l.indexOf('"')&&(l=l.replace(A,"&quot;")),s+=' value="'+l+'"'),s+=">",r!==t&&(s+=h(r)),s+="</option>",c+=s;u.html(c),n!==t&&(u[0].value=n,u[0].value&&!n&&(u[0].selectedIndex=-1))},_reset:function(){var t=this,i=t.element,n=i.attr("form"),s=n?e("#"+n):i.closest("form");s[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initial)})},t._form=s.on("reset",t._resetHandler))},_parentWidget:function(){var t=this.options.name,i=e("#"+this.options.cascadeFrom),n=i.data("kendo"+t);return n||(n=i.data("kendo"+G[t])),n},_cascade:function(){var e,t,i=this,n=i.options,s=n.cascadeFrom;if(s){if(t=i._parentWidget(),!t)return;t.bind("set",function(){i.one("set",function(e){i._selectedValue=e.value})}),n.autoBind=!1,e=C(function(e){var i=this.value();this._userTriggered=e.userTriggered,this.listView.bound()&&this._clearSelection(t,!0),this._cascadeSelect(t,i)},i),t.first(I,e),t._focused.bind("focus",function(){t.unbind(I,e),t.first(v,e)}),t._focused.bind("focusout",function(){t.unbind(v,e),t.first(I,e)}),t.listView.bound()?i._cascadeSelect(t):t.value()||i.enable(!1)}},_cascadeChange:function(e){var t=this,i=t._accessor()||t._selectedValue;t._selectedValue=null,t._userTriggered?t._clearSelection(e,!0):i?(i!==t.listView.value()[0]&&t.value(i),t.dataSource.view()[0]&&-1!==t.selectedIndex||t._clearSelection(e,!0)):t.dataSource.flatView().length&&t.select(t.options.index),t.enable(),t._triggerCascade(),t._triggerChange(),t._userTriggered=!1},_cascadeSelect:function(e,i){var n,a,r,l=this,o=e.dataItem(),u=o?e._value(o):null,d=l.options.cascadeFromField||e.options.dataValueField;l._valueBeforeCascade=i!==t?i:l.value(),u||0===u?(n=l.dataSource.filter()||{},s(n,d),a=(n.filters||[]).slice(0),a.push({field:d,operator:"eq",value:u}),r=function(){l.unbind("dataBound",r),l._cascadeChange(e)},l.first("dataBound",r),l._cascading=!0,l._filterSource({field:d,operator:"eq",value:u}),l._cascading=!1):(l.enable(!1),l._clearSelection(e),l._triggerCascade(),l._triggerChange(),l._userTriggered=!1)}}),a=".StaticList",r=l.ui.DataBoundWidget.extend({init:function(t,i){u.fn.init.call(this,t,i),this.element.attr("role","listbox").on("click"+a,"li",C(this._click,this)).on("mouseenter"+a,"li",function(){e(this).addClass(m)}).on("mouseleave"+a,"li",function(){e(this).removeClass(m)}),this.content=this.element.wrap("<div class='k-list-scroller' unselectable='on'></div>").parent(),this.header=this.content.before('<div class="k-group-header" style="display:none"></div>').prev(),this.bound(!1),this._optionID=l.guid(),this._selectedIndices=[],this._view=[],this._dataItems=[],this._values=[];var n=this.options.value;n&&(this._values=e.isArray(n)?n.slice(0):[n]),this._getter(),this._templates(),this.setDataSource(this.options.dataSource),this._onScroll=C(function(){var e=this;clearTimeout(e._scrollId),e._scrollId=setTimeout(function(){e._renderHeader()},50)},this)},options:{name:"StaticList",dataValueField:null,valuePrimitive:!1,selectable:!0,template:null,groupTemplate:null,fixedGroupTemplate:null},events:["click",v,"activate","deactivate","dataBinding","dataBound","selectedItemChange"],setDataSource:function(t){var i,n=this,s=t||{};s=e.isArray(s)?{data:s}:s,s=l.data.DataSource.create(s),n.dataSource?(n.dataSource.unbind(v,n._refreshHandler),i=n.value(),n.value([]),n.bound(!1),n.value(i)):n._refreshHandler=C(n.refresh,n),n.setDSFilter(s.filter()),n.dataSource=s.bind(v,n._refreshHandler),n._fixedHeader()},skip:function(){return this.dataSource.skip()},setOptions:function(e){u.fn.setOptions.call(this,e),this._getter(),this._templates(),this._render()},destroy:function(){this.element.off(a),this._refreshHandler&&this.dataSource.unbind(v,this._refreshHandler),clearTimeout(this._scrollId),u.fn.destroy.call(this)},scrollToIndex:function(e){var t=this.element[0].children[e];t&&this.scroll(t)},scroll:function(e){if(e){e[0]&&(e=e[0]);var t=this.content[0],i=e.offsetTop,n=e.offsetHeight,s=t.scrollTop,a=t.clientHeight,r=i+n;s>i?s=i:r>s+a&&(s=r-a),t.scrollTop=s}},selectedDataItems:function(e){return e===t?this._dataItems.slice():(this._dataItems=e,this._values=this._getValues(e),t)},_getValues:function(t){var i=this._valueGetter;return e.map(t,function(e){return i(e)})},focusNext:function(){var e=this.focus();e=e?e.next():0,this.focus(e)},focusPrev:function(){var e=this.focus();e=e?e.prev():this.element[0].children.length-1,this.focus(e)},focusFirst:function(){this.focus(this.element[0].children[0])},focusLast:function(){this.focus(this.element[0].children[this.element[0].children.length-1])},focus:function(i){var n,s=this,a=s._optionID;return i===t?s._current:(i=s._get(i),i=i[i.length-1],i=e(this.element[0].children[i]),s._current&&(s._current.removeClass(g).removeAttr("aria-selected").removeAttr(_),s.trigger("deactivate")),n=!!i[0],n&&(i.addClass(g),s.scroll(i),i.attr("id",a)),s._current=n?i:null,s.trigger("activate"),t)},focusIndex:function(){return this.focus()?this.focus().index():t},skipUpdate:function(e){this._skipUpdate=e},select:function(i){var n,s,a=this,r=a.options.selectable,l="multiple"!==r&&r!==!1,o=a._selectedIndices,u=[],d=[];if(i===t)return o.slice();if(i=a._get(i),1===i.length&&-1===i[0]&&(i=[]),s=a.isFiltered(),!s||l||!a._deselectFiltered(i)){if(l&&!s&&-1!==e.inArray(i[i.length-1],o))return a._dataItems.length&&a._view.length&&(a._dataItems=[a._view[o[0]].item]),t;n=a._deselect(i),d=n.removed,i=n.indices,i.length&&(l&&(i=[i[i.length-1]]),u=a._select(i)),(u.length||d.length)&&(a._valueComparer=null,a.trigger(v,{added:u,removed:d}))}},removeAt:function(e){return this._selectedIndices.splice(e,1),this._values.splice(e,1),this._valueComparer=null,{position:e,dataItem:this._dataItems.splice(e,1)[0]}},setValue:function(t){t=e.isArray(t)||t instanceof p?t.slice(0):[t],this._values=t,this._valueComparer=null},value:function(i){var n,s=this,a=s._valueDeferred;return i===t?s._values.slice():(s.setValue(i),a&&"resolved"!==a.state()||(s._valueDeferred=a=e.Deferred()),s.bound()&&(n=s._valueIndices(s._values),"multiple"===s.options.selectable&&s.select(-1),s.select(n),a.resolve()),s._skipUpdate=!1,a)},items:function(){return this.element.children(".k-item")},_click:function(t){t.isDefaultPrevented()||this.trigger("click",{item:e(t.currentTarget)})||this.select(t.currentTarget)},_valueExpr:function(e,t){var n,s,a=this,r=0,l=[];if(!a._valueComparer||a._valueType!==e){for(a._valueType=e;t.length>r;r++)l.push(i(t[r],e));n="for (var idx = 0; idx < "+l.length+"; idx++) { if (current === values[idx]) {   return idx; }} return -1;",s=Function("current","values",n),a._valueComparer=function(e){return s(e,l)}}return a._valueComparer},_dataItemPosition:function(e,t){var i=this._valueGetter(e),n=this._valueExpr(typeof i,t);return n(i)},_getter:function(){this._valueGetter=l.getter(this.options.dataValueField)},_deselect:function(t){var i,n,s,a=this,r=a.element[0].children,l=a.options.selectable,o=a._selectedIndices,u=a._dataItems,d=a._values,c=[],h=0,f=0;if(t=t.slice(),l!==!0&&t.length){if("multiple"===l)for(;t.length>h;h++)if(n=t[h],e(r[n]).hasClass("k-state-selected"))for(i=0;o.length>i;i++)if(s=o[i],s===n){e(r[s]).removeClass("k-state-selected"),c.push({position:i+f,dataItem:u.splice(i,1)[0]}),o.splice(i,1),t.splice(h,1),d.splice(i,1),f+=1,h-=1,i-=1;break}}else{for(;o.length>h;h++)e(r[o[h]]).removeClass("k-state-selected"),c.push({position:h,dataItem:u[h]});a._values=[],a._dataItems=[],a._selectedIndices=[]}return{indices:t,removed:c}},_deselectFiltered:function(t){for(var i,n,s,a=this.element[0].children,r=[],l=0;t.length>l;l++)n=t[l],i=this._view[n].item,s=this._dataItemPosition(i,this._values),s>-1&&(r.push(this.removeAt(s)),e(a[n]).removeClass("k-state-selected"));return r.length?(this.trigger(v,{added:[],removed:r}),!0):!1},_select:function(t){var i,n,s=this,a=s.element[0].children,r=s._view,l=[],o=0;for(-1!==t[t.length-1]&&s.focus(t);t.length>o;o++)n=t[o],i=r[n],-1!==n&&i&&(i=i.item,s._selectedIndices.push(n),s._dataItems.push(i),s._values.push(s._valueGetter(i)),e(a[n]).addClass("k-state-selected").attr("aria-selected",!0),l.push({dataItem:i}));return l},_get:function(i){return"number"==typeof i?i=[i]:D(i)||(i=e(i).data("offset-index"),i===t&&(i=-1),i=[i]),i},_template:function(){var e=this,t=e.options,i=t.template;return i?(i=l.template(i),i=function(e){return'<li tabindex="-1" role="option" unselectable="on" class="k-item">'+i(e)+"</li>"}):i=l.template('<li tabindex="-1" role="option" unselectable="on" class="k-item">${'+l.expr(t.dataTextField,"data")+"}</li>",{useWithBlock:!1}),i},_templates:function(){var e,t,i={template:this.options.template,groupTemplate:this.options.groupTemplate,fixedGroupTemplate:this.options.fixedGroupTemplate};for(t in i)e=i[t],e&&"function"!=typeof e&&(i[t]=l.template(e));this.templates=i},_normalizeIndices:function(e){for(var i=[],n=0;e.length>n;n++)e[n]!==t&&i.push(e[n]);return i},_valueIndices:function(e,t){var i,n=this._view,s=0;if(t=t?t.slice():[],!e.length)return[];for(;n.length>s;s++)i=this._dataItemPosition(n[s].item,e),-1!==i&&(t[i]=s);return this._normalizeIndices(t)},_firstVisibleItem:function(){for(var t=this.element[0],i=this.content[0],n=i.scrollTop,s=e(t.children[0]).height(),a=Math.floor(n/s)||0,r=t.children[a]||t.lastChild,l=n>r.offsetTop;r;)if(l){if(r.offsetTop+s>n||!r.nextSibling)break;r=r.nextSibling}else{if(n>=r.offsetTop||!r.previousSibling)break;r=r.previousSibling}return this._view[e(r).data("offset-index")]},_fixedHeader:function(){this.isGrouped()&&this.templates.fixedGroupTemplate?(this.header.show(),this.content.scroll(this._onScroll)):(this.header.hide(),this.content.off("scroll",this._onScroll))},_renderHeader:function(){var e,t=this.templates.fixedGroupTemplate;t&&(e=this._firstVisibleItem(),e&&this.header.html(t(e.group)))},_renderItem:function(e){var t='<li tabindex="-1" role="option" unselectable="on" class="k-item',i=e.item,n=0!==e.index,s=e.selected;return n&&e.newGroup&&(t+=" k-first"),s&&(t+=" k-state-selected"),t+='"'+(s?' aria-selected="true"':"")+' data-offset-index="'+e.index+'">',t+=this.templates.template(i),n&&e.newGroup&&(t+='<div class="k-group">'+this.templates.groupTemplate(e.group)+"</div>"),t+"</li>"},_render:function(){var e,t,i,n,s="",a=0,r=0,l=[],o=this.dataSource.view(),u=this.value(),d=this.isGrouped();if(d)for(a=0;o.length>a;a++)for(t=o[a],i=!0,n=0;t.items.length>n;n++)e={selected:this._selected(t.items[n],u),item:t.items[n],group:t.value,newGroup:i,index:r},l[r]=e,r+=1,s+=this._renderItem(e),i=!1;else for(a=0;o.length>a;a++)e={selected:this._selected(o[a],u),item:o[a],index:a},l[a]=e,s+=this._renderItem(e);this._view=l,this.element[0].innerHTML=s,d&&l.length&&this._renderHeader()},_selected:function(e,t){var i=!this.isFiltered()||"multiple"===this.options.selectable;return i&&-1!==this._dataItemPosition(e,t)},setDSFilter:function(e){this._lastDSFilter=V({},e)},isFiltered:function(){return this._lastDSFilter||this.setDSFilter(this.dataSource.filter()),!l.data.Query.compareFilters(this.dataSource.filter(),this._lastDSFilter)},refresh:function(e){var t,i=this,s=e&&e.action,a=i.options.skipUpdateOnBind,r="itemchange"===s;i.trigger("dataBinding"),i._fixedHeader(),i._render(),i.bound(!0),r||"remove"===s?(t=n(i._dataItems,e.items),t.changed.length&&(r?i.trigger("selectedItemChange",{items:t.changed}):i.value(i._getValues(t.unchanged)))):i.isFiltered()||i._skipUpdate?(i.focus(0),i._skipUpdate&&(i._skipUpdate=!1,i._selectedIndices=i._valueIndices(i._values,i._selectedIndices))):a||s&&"add"!==s||i.value(i._values),i._valueDeferred&&i._valueDeferred.resolve(),i.trigger("dataBound")},bound:function(e){return e===t?this._bound:(this._bound=e,t)},isGrouped:function(){return(this.dataSource.group()||[]).length}}),o.plugin(r)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()});;!function(e,define){define("kendo.autocomplete.min",["kendo.list.min","kendo.mobile.scroller.min"],e)}(function(){return function(e,t){function s(e,t,s){return s?t.substring(0,e).split(s).length-1:0}function i(e,t,i){return t.split(i)[s(e,t,i)]}function a(e,t,i,a){var o=t.split(a);return o.splice(s(e,t,a),1,i),a&&""!==o[o.length-1]&&o.push(""),o.join(a)}var o=window.kendo,n=o.support,r=o.caret,l=o._activeElement,c=n.placeholder,u=o.ui,d=u.List,h=o.keys,p=o.data.DataSource,_="aria-disabled",f="aria-readonly",g="change",m="k-state-default",v="disabled",y="readonly",w="k-state-focused",k="k-state-selected",b="k-state-disabled",C="k-state-hover",T=".kendoAutoComplete",x="mouseenter"+T+" mouseleave"+T,S=e.proxy,V=d.extend({init:function(t,s){var i,a,n=this;n.ns=T,s=e.isArray(s)?{dataSource:s}:s,d.fn.init.call(n,t,s),t=n.element,s=n.options,s.placeholder=s.placeholder||t.attr("placeholder"),c&&t.attr("placeholder",s.placeholder),n._wrapper(),n._loader(),n._dataSource(),n._ignoreCase(),t[0].type="text",i=n.wrapper,n._popup(),t.addClass("k-input").on("keydown"+T,S(n._keydown,n)).on("keypress"+T,S(n._keypress,n)).on("paste"+T,S(n._search,n)).on("focus"+T,function(){n._prev=n._accessor(),n._oldText=n._prev,n._placeholder(!1),i.addClass(w)}).on("focusout"+T,function(){n._change(),n._placeholder(),i.removeClass(w)}).attr({autocomplete:"off",role:"textbox","aria-haspopup":!0}),n._enable(),n._old=n._accessor(),t[0].id&&t.attr("aria-owns",n.ul[0].id),n._aria(),n._placeholder(),n._initList(),a=e(n.element).parents("fieldset").is(":disabled"),a&&n.enable(!1),n.listView.bind("click",function(e){e.preventDefault()}),n._resetFocusItemHandler=e.proxy(n._resetFocusItem,n),o.notify(n)},options:{name:"AutoComplete",enabled:!0,suggest:!1,template:"",groupTemplate:"#:data#",fixedGroupTemplate:"#:data#",dataTextField:"",minLength:1,delay:200,height:200,filter:"startswith",ignoreCase:!0,highlightFirst:!1,separator:null,placeholder:"",animation:{},virtual:!1,value:null},_dataSource:function(){var e=this;e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._progressHandler=S(e._showBusy,e),e._errorHandler=S(e._hideBusy,e)),e.dataSource=p.create(e.options.dataSource).bind("progress",e._progressHandler).bind("error",e._errorHandler)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.listView.setDataSource(this.dataSource)},events:["open","close",g,"select","filtering","dataBinding","dataBound"],setOptions:function(e){var t=this._listOptions(e);d.fn.setOptions.call(this,e),this.listView.setOptions(t),this._accessors(),this._aria()},_listOptions:function(t){var s=d.fn._listOptions.call(this,e.extend(t,{skipUpdateOnBind:!0}));return s.dataValueField=s.dataTextField,s.selectedItemChange=null,s},_editable:function(e){var t=this,s=t.element,i=t.wrapper.off(T),a=e.readonly,o=e.disable;a||o?(i.addClass(o?b:m).removeClass(o?m:b),s.attr(v,o).attr(y,a).attr(_,o).attr(f,a)):(i.addClass(m).removeClass(b).on(x,t._toggleHover),s.removeAttr(v).removeAttr(y).attr(_,!1).attr(f,!1))},close:function(){var e=this,t=e.listView.focus();t&&t.removeClass(k),e.popup.close()},destroy:function(){var e=this;e.element.off(T),e.wrapper.off(T),d.fn.destroy.call(e)},refresh:function(){this.listView.refresh()},select:function(e){this._select(e)},search:function(e){var t,s=this,a=s.options,o=a.ignoreCase,n=a.separator;e=e||s._accessor(),clearTimeout(s._typingTimeout),n&&(e=i(r(s.element)[0],e,n)),t=e.length,(!t||t>=a.minLength)&&(s._open=!0,s._mute(function(){this.listView.value([])}),s._filterSource({value:o?e.toLowerCase():e,operator:a.filter,field:a.dataTextField,ignoreCase:o}))},suggest:function(e){var i,a=this,o=a._last,n=a._accessor(),c=a.element[0],u=r(c)[0],p=a.options.separator,_=n.split(p),f=s(u,n,p),g=u;return o==h.BACKSPACE||o==h.DELETE?(a._last=t,t):(e=e||"","string"!=typeof e&&(e[0]&&(e=a.dataSource.view()[d.inArray(e[0],a.ul[0])]),e=e?a._text(e):""),0>=u&&(u=n.toLowerCase().indexOf(e.toLowerCase())+1),i=n.substring(0,u).lastIndexOf(p),i=i>-1?u-(i+p.length):u,n=_[f].substring(0,i),e&&(e=""+e,i=e.toLowerCase().indexOf(n.toLowerCase()),i>-1&&(e=e.substring(i+n.length),g=u+e.length,n+=e),p&&""!==_[_.length-1]&&_.push("")),_[f]=n,a._accessor(_.join(p||"")),c===l()&&r(c,u,g),t)},value:function(e){return e===t?this._accessor():(this.listView.value(e),this._accessor(e),this._old=this._accessor(),this._oldText=this._accessor(),t)},_click:function(e){var s=e.item,i=this.element;return e.preventDefault(),this._active=!0,this.trigger("select",{item:s})?(this.close(),t):(this._oldText=i.val(),this._select(s),this._blur(),r(i,i.val().length),t)},_resetFocusItem:function(){var e=this.options.highlightFirst?0:-1;this.options.virtual&&this.listView.scrollTo(0),this.listView.focus(e)},_listBound:function(){var e,s=this,i=s.popup,a=s.options,o=s.dataSource.flatView(),n=o.length,r=s.element[0]===l();s._angularItems("compile"),s._resizePopup(),i.position(),n&&a.suggest&&r&&s.suggest(o[0]),s._open&&(s._open=!1,e=n?"open":"close",s._typingTimeout&&!r&&(e="close"),n&&(s._resetFocusItem(),a.virtual&&s.popup.unbind("activate",s._resetFocusItemHandler).one("activate",s._resetFocusItemHandler)),i[e](),s._typingTimeout=t),s._touchScroller&&s._touchScroller.reset(),s._hideBusy(),s._makeUnselectable(),s.trigger("dataBound")},_mute:function(e){this._muted=!0,e.call(this),this._muted=!1},_listChange:function(){var e=this._active||this.element[0]===l();e&&!this._muted&&this._selectValue(this.listView.selectedDataItems()[0])},_selectValue:function(e){var t=this.options.separator,s="";e&&(s=this._text(e)),null===s&&(s=""),t&&(s=a(r(this.element)[0],this._accessor(),s,t)),this._prev=s,this._accessor(s),this._placeholder()},_change:function(){var e=this,t=e.value(),s=t!==d.unifyType(e._old,typeof t),i=s&&!e._typing,a=e._oldText!==t;(i||a)&&e.element.trigger(g),s&&(e._old=t,e.trigger(g)),e.typing=!1},_accessor:function(e){var s=this,i=s.element[0];return e===t?(e=i.value,i.className.indexOf("k-readonly")>-1&&e===s.options.placeholder?"":e):(i.value=null===e?"":e,s._placeholder(),t)},_keydown:function(e){var t=this,s=e.keyCode,i=t.popup.visible(),a=this.listView.focus();if(t._last=s,s===h.DOWN)i&&this._move(a?"focusNext":"focusFirst"),e.preventDefault();else if(s===h.UP)i&&this._move(a?"focusPrev":"focusLast"),e.preventDefault();else if(s===h.ENTER||s===h.TAB){if(s===h.ENTER&&i&&e.preventDefault(),i&&a){if(t.trigger("select",{item:a}))return;this._select(a)}this._blur()}else s===h.ESC?(i&&e.preventDefault(),t.close()):t._search()},_keypress:function(){this._oldText=this.element.val(),this._typing=!0},_move:function(e){this.listView[e](),this.options.suggest&&this.suggest(this.listView.focus())},_hideBusy:function(){var e=this;clearTimeout(e._busy),e._loading.hide(),e.element.attr("aria-busy",!1),e._busy=null},_showBusy:function(){var e=this;e._busy||(e._busy=setTimeout(function(){e.element.attr("aria-busy",!0),e._loading.show()},100))},_placeholder:function(e){if(!c){var s,i=this,a=i.element,o=i.options.placeholder;if(o){if(s=a.val(),e===t&&(e=!s),e||(o=s!==o?s:""),s===i._old&&!e)return;a.toggleClass("k-readonly",e).val(o),o||a[0]!==document.activeElement||r(a[0],0,0)}}},_search:function(){var e=this;clearTimeout(e._typingTimeout),e._typingTimeout=setTimeout(function(){e._prev!==e._accessor()&&(e._prev=e._accessor(),e.search())},e.options.delay)},_select:function(e){this._active=!0,this.listView.select(e),this._active=!1},_loader:function(){this._loading=e('<span class="k-icon k-loading" style="display:none"></span>').insertAfter(this.element)},_toggleHover:function(t){e(t.currentTarget).toggleClass(C,"mouseenter"===t.type)},_wrapper:function(){var e,t=this,s=t.element,i=s[0];e=s.parent(),e.is("span.k-widget")||(e=s.wrap("<span />").parent()),e.attr("tabindex",-1),e.attr("role","presentation"),e[0].style.cssText=i.style.cssText,s.css({width:"100%",height:i.style.height}),t._focused=t.element,t.wrapper=e.addClass("k-widget k-autocomplete k-header").addClass(i.className)}});u.plugin(V)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,s){(s||t)()});;!function(e,define){define("kendo.combobox.min",["kendo.list.min","kendo.mobile.scroller.min"],e)}(function(){return function(e,t){var i=window.kendo,s=i.ui,n=s.List,a=s.Select,o=i.caret,l=i.support,r=l.placeholder,u=i._activeElement,c=i.keys,d=".kendoComboBox",p="click"+d,_="mousedown"+d,h="disabled",f="readonly",v="change",g="k-state-default",x="k-state-focused",m="k-state-disabled",w="aria-disabled",y="aria-readonly",b="filter",k="accept",C="rebind",I="mouseenter"+d+" mouseleave"+d,V=e.proxy,T=a.extend({init:function(t,s){var n,o,l=this;l.ns=d,s=e.isArray(s)?{dataSource:s}:s,a.fn.init.call(l,t,s),s=l.options,t=l.element.on("focus"+d,V(l._focusHandler,l)),s.placeholder=s.placeholder||t.attr("placeholder"),l._reset(),l._wrapper(),l._input(),l._tabindex(l.input),l._popup(),l._dataSource(),l._ignoreCase(),l._enable(),l._oldIndex=l.selectedIndex=-1,l._aria(),l._initialIndex=s.index,l._initList(),l._cascade(),s.autoBind?l._filterSource():(n=s.text,!n&&l._isSelect&&(n=t.children(":selected").text()),n&&l._setText(n)),n||l._placeholder(),o=e(l.element).parents("fieldset").is(":disabled"),o&&l.enable(!1),i.notify(l)},options:{name:"ComboBox",enabled:!0,index:-1,text:null,value:null,autoBind:!0,delay:200,dataTextField:"",dataValueField:"",minLength:0,height:200,highlightFirst:!0,filter:"none",placeholder:"",suggest:!1,cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{},virtual:!1,template:null,groupTemplate:"#:data#",fixedGroupTemplate:"#:data#"},events:["open","close",v,"select","filtering","dataBinding","dataBound","cascade","set"],setOptions:function(e){a.fn.setOptions.call(this,e),this.listView.setOptions(e),this._accessors(),this._aria()},destroy:function(){var e=this;e.input.off(d),e.element.off(d),e._inputWrapper.off(d),e._arrow.parent().off(p+" "+_),a.fn.destroy.call(e)},_focusHandler:function(){this.input.focus()},_arrowClick:function(){this._toggle()},_inputFocus:function(){this._inputWrapper.addClass(x),this._placeholder(!1)},_inputFocusout:function(){var e=this,i=e.value();return e._inputWrapper.removeClass(x),clearTimeout(e._typingTimeout),e._typingTimeout=null,e.text(e.text()),i!==e.value()&&e.trigger("select",{item:e._focus()})?(e.value(i),t):(e._placeholder(),e._blur(),e.element.blur(),t)},_editable:function(e){var t=this,i=e.disable,s=e.readonly,n=t._inputWrapper.off(d),a=t.element.add(t.input.off(d)),o=t._arrow.parent().off(p+" "+_);s||i?(n.addClass(i?m:g).removeClass(i?g:m),a.attr(h,i).attr(f,s).attr(w,i).attr(y,s)):(n.addClass(g).removeClass(m).on(I,t._toggleHover),a.removeAttr(h).removeAttr(f).attr(w,!1).attr(y,!1),o.on(p,V(t._arrowClick,t)).on(_,function(e){e.preventDefault()}),t.input.on("keydown"+d,V(t._keydown,t)).on("focus"+d,V(t._inputFocus,t)).on("focusout"+d,V(t._inputFocusout,t)))},open:function(){var e=this,t=e._state;e.popup.visible()||(!e.listView.bound()&&t!==b||t===k?(e._open=!0,e._state=C,e._filterSource()):(e.popup.open(),e._focusItem()))},_updateSelectionState:function(){var e=this,i=e.options.text,s=e.options.value;e.listView.isFiltered()||(-1===e.selectedIndex?((i===t||null===i)&&(i=s),e._accessor(s),e.input.val(i||e.input.val()),e._placeholder()):-1===e._oldIndex&&(e._oldIndex=e.selectedIndex))},_buildOptions:function(e){var i,s=this;s._isSelect&&(i=s._customOption,s._state===C&&(s._state=""),s._customOption=t,s._options(e,"",s.value()),i&&i[0].selected&&s._custom(i.val()))},_updateSelection:function(){var i,s=this,n=s.listView,a=s._initialIndex,o=null!==a&&a>-1,l=s._state===b;return l?(e(n.focus()).removeClass("k-state-selected"),t):(s._fetch||(n.value().length||(o?s.select(a):s._accessor()&&n.value(s._accessor())),s._initialIndex=null,i=n.selectedDataItems()[0],i&&(s._value(i)!==s.value()&&s._custom(s._value(i)),s.text()&&s.text()!==s._text(i)&&s._selectValue(i))),t)},_updateItemFocus:function(){var e=this.listView;this.options.highlightFirst?e.focus()||e.focusIndex()||e.focus(0):e.focus(-1)},_listBound:function(){var e=this,i=e.input[0]===u(),s=e.dataSource.flatView(),n=e.listView.skip(),a=n===t||0===n;e._angularItems("compile"),e._presetValue=!1,e._resizePopup(),e.popup.position(),e._buildOptions(s),e._makeUnselectable(),e._updateSelection(),s.length&&a&&(e._updateItemFocus(),e.options.suggest&&i&&e.input.val()&&e.suggest(s[0])),e._open&&(e._open=!1,e._typingTimeout&&!i?e.popup.close():e.toggle(!!s.length),e._typingTimeout=null),e._hideBusy(),e.trigger("dataBound")},_listChange:function(){this._selectValue(this.listView.selectedDataItems()[0]),this._presetValue&&(this._oldIndex=this.selectedIndex)},_get:function(e){var t,i,s;if("function"==typeof e){for(t=this.dataSource.flatView(),s=0;t.length>s;s++)if(e(t[s])){e=s,i=!0;break}i||(e=-1)}return e},_select:function(e,t){e=this._get(e),-1===e&&(this.input[0].value="",this._accessor("")),this.listView.select(e),t||this._state!==b||(this._state=k)},_selectValue:function(e){var i=this.listView.select(),s="",n="";i=i[i.length-1],i===t&&(i=-1),this.selectedIndex=i,-1===i?(s=n=this.input[0].value,this.listView.focus(-1)):(e&&(s=this._dataValue(e),n=this._text(e)),null===s&&(s="")),this._prev=this.input[0].value=n,this._accessor(s!==t?s:n,i),this._placeholder(),this._triggerCascade()},refresh:function(){this.listView.refresh()},suggest:function(e){var i,s=this,a=s.input[0],l=s.text(),r=o(a)[0],d=s._last;return d==c.BACKSPACE||d==c.DELETE?(s._last=t,t):(e=e||"","string"!=typeof e&&(e[0]&&(e=s.dataSource.view()[n.inArray(e[0],s.ul[0])]),e=e?s._text(e):""),0>=r&&(r=l.toLowerCase().indexOf(e.toLowerCase())+1),e?(e=""+e,i=e.toLowerCase().indexOf(l.toLowerCase()),i>-1&&(l+=e.substring(i+l.length))):l=l.substring(0,r),l.length===r&&e||(a.value=l,a===u()&&o(a,r,l.length)),t)},text:function(e){var i,s,a,o,l,r;return e=null===e?"":e,i=this,s=i.input[0],a=i.options.ignoreCase,o=e,e===t?s.value:i.options.autoBind!==!1||i.listView.bound()?(l=i.dataItem(),l&&i._text(l)===e&&(r=i._value(l),r===n.unifyType(i._old,typeof r))?(i._triggerCascade(),t):(a&&(o=o.toLowerCase()),i._select(function(e){return e=i._text(e),a&&(e=(e+"").toLowerCase()),e===o}),0>i.selectedIndex&&(i._accessor(e),s.value=e,i._triggerCascade()),i._prev=s.value,t)):(i._setText(e),t)},toggle:function(e){this._toggle(e,!0)},value:function(e){var i=this,s=i.options,n=i.listView;return e===t?(e=i._accessor()||i.listView.value()[0],e===t||null===e?"":e):(i.trigger("set",{value:e}),(e!==s.value||i.input.val()!==s.text)&&(i._accessor(e),i._isFilterEnabled()&&n.bound()&&n.isFiltered()?(n.bound(!1),i._filterSource()):i._fetchData(),n.value(e).done(function(){-1===i.selectedIndex&&(i._accessor(e),i.input.val(e),i._placeholder(!0)),i._old=i._accessor(),i._oldIndex=i.selectedIndex,i._prev=i.input.val(),i._state===b&&(i._state=k)})),t)},_click:function(e){var i=e.item;return e.preventDefault(),this.trigger("select",{item:i})?(this.close(),t):(this._userTriggered=!0,this._select(i),this._blur(),t)},_filter:function(e){var i,s=this,n=s.options,a=s.dataSource,o=n.ignoreCase,l=function(i){var n=s._text(i);return n!==t?(n+="",""!==n&&""===e?!1:(o&&(n=n.toLowerCase()),0===n.indexOf(e))):t};return o&&(e=e.toLowerCase()),s.ul[0].firstChild?(this.listView.focus(this._get(l)),i=this.listView.focus(),i&&(n.suggest&&s.suggest(i),this.open()),this.options.highlightFirst&&!e&&this.listView.focusFirst(),t):(a.one(v,function(){a.view()[0]&&s.search(e)}).fetch(),t)},_input:function(){var t,i=this,s=i.element.removeClass("k-input")[0],n=s.accessKey,a=i.wrapper,o="input.k-input",l=s.name||"";l&&(l='name="'+l+'_input" '),t=a.find(o),t[0]||(a.append('<span tabindex="-1" unselectable="on" class="k-dropdown-wrap k-state-default"><input '+l+'class="k-input" type="text" autocomplete="off"/><span tabindex="-1" unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select</span></span></span>').append(i.element),t=a.find(o)),t[0].style.cssText=s.style.cssText,t[0].title=s.title,s.maxLength>-1&&(t[0].maxLength=s.maxLength),t.addClass(s.className).val(this.options.text||s.value).css({width:"100%",height:s.style.height}).attr({role:"combobox","aria-expanded":!1}).show(),r&&t.attr("placeholder",i.options.placeholder),n&&(s.accessKey="",t[0].accessKey=n),i._focused=i.input=t,i._inputWrapper=e(a[0].firstChild),i._arrow=a.find(".k-icon").attr({role:"button",tabIndex:-1}),s.id&&i._arrow.attr("aria-controls",i.ul[0].id)},_keydown:function(e){var t=this,i=e.keyCode;t._last=i,clearTimeout(t._typingTimeout),t._typingTimeout=null,i==c.TAB||t._move(e)||t._search()},_placeholder:function(e){if(!r){var i,s=this,n=s.input,a=s.options.placeholder;if(a){if(i=s.value(),e===t&&(e=!i),n.toggleClass("k-readonly",e),!e){if(i)return;a=""}n.val(a),a||n[0]!==u()||o(n[0],0,0)}}},_search:function(){var e=this;e._typingTimeout=setTimeout(function(){var t=e.text();e._prev!==t&&(e._prev=t,"none"===e.options.filter&&e.listView.select(-1),e.search(t)),e._typingTimeout=null},e.options.delay)},_setText:function(e){this.input.val(e),this._prev=e},_wrapper:function(){var e=this,t=e.element,i=t.parent();i.is("span.k-widget")||(i=t.hide().wrap("<span />").parent(),i[0].style.cssText=t[0].style.cssText),e.wrapper=i.addClass("k-widget k-combobox k-header").addClass(t[0].className).css("display","")},_clearSelection:function(e,t){var i=this,s=e.value(),n=s&&-1===e.selectedIndex;-1==this.selectedIndex&&this.value()||(t||!s||n)&&(i.options.value="",i.value(""))},_preselect:function(e,t){this.input.val(t),this._accessor(e),this._old=this._accessor(),this._oldIndex=this.selectedIndex,this.listView.setValue(e),this._placeholder(),this._initialIndex=null,this._presetValue=!0}});s.plugin(T)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()});;!function(e,define){define("kendo.dropdownlist.min",["kendo.list.min","kendo.mobile.scroller.min"],e)}(function(){return function(e,t){function i(e,t,i){for(var n,s=0,o=t.length-1;o>s;++s)n=t[s],n in e||(e[n]={}),e=e[n];e[t[o]]=i}function n(e,t){return e>=t&&(e-=t),e}function s(e,t){for(var i=0;e.length>i;i++)if(e.charAt(i)!==t)return!1;return!0}var o=window.kendo,a=o.ui,l=a.List,r=a.Select,p=o.support,u=o._activeElement,c=o.data.ObservableObject,d=o.keys,f=".kendoDropDownList",_="disabled",h="readonly",m="change",b="k-state-focused",v="k-state-default",w="k-state-disabled",g="aria-disabled",x="aria-readonly",L="mouseenter"+f+" mouseleave"+f,I="tabindex",k="filter",y="accept",T="The `optionLabel` option is not valid due to missing fields. Define a custom optionLabel as shown here http://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist#configuration-optionLabel",C=e.proxy,V=r.extend({init:function(i,n){var s,a,l,p=this,u=n&&n.index;p.ns=f,n=e.isArray(n)?{dataSource:n}:n,r.fn.init.call(p,i,n),n=p.options,i=p.element.on("focus"+f,C(p._focusHandler,p)),p._focusInputHandler=e.proxy(p._focusInput,p),p.optionLabel=e(),p._optionLabel(),p._inputTemplate(),p._reset(),p._prev="",p._word="",p._wrapper(),p._tabindex(),p.wrapper.data(I,p.wrapper.attr(I)),p._span(),p._popup(),p._mobile(),p._dataSource(),p._ignoreCase(),p._filterHeader(),p._aria(),p._enable(),p._oldIndex=p.selectedIndex=-1,u!==t&&(n.index=u),p._initialIndex=n.index,p._initList(),p._cascade(),n.autoBind?p.dataSource.fetch():-1===p.selectedIndex&&(a=n.text||"",a||(s=n.optionLabel,s&&0===n.index?a=s:p._isSelect&&(a=i.children(":selected").text())),p._textAccessor(a)),l=e(p.element).parents("fieldset").is(":disabled"),l&&p.enable(!1),p.listView.bind("click",function(e){e.preventDefault()}),o.notify(p)},options:{name:"DropDownList",enabled:!0,autoBind:!0,index:0,text:null,value:null,delay:500,height:200,dataTextField:"",dataValueField:"",optionLabel:"",cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{},filter:"none",minLength:1,virtual:!1,template:null,valueTemplate:null,optionLabelTemplate:null,groupTemplate:"#:data#",fixedGroupTemplate:"#:data#"},events:["open","close",m,"select","filtering","dataBinding","dataBound","cascade","set"],setOptions:function(e){r.fn.setOptions.call(this,e),this.listView.setOptions(this._listOptions(e)),this._optionLabel(),this._inputTemplate(),this._accessors(),this._filterHeader(),this._enable(),this._aria(),!this.value()&&this.hasOptionLabel()&&this.select(0)},destroy:function(){var e=this;r.fn.destroy.call(e),e.wrapper.off(f),e.element.off(f),e._inputWrapper.off(f),e._arrow.off(),e._arrow=null,e.optionLabel.off()},open:function(){var e=this;e.popup.visible()||(e.listView.bound()&&e._state!==y?e._allowOpening()&&(e.popup.one("activate",e._focusInputHandler),e.popup.open(),e._focusItem()):(e._open=!0,e._state="rebind",e.filterInput&&(e.filterInput.val(""),e._prev=""),e._filterSource()))},_focusInput:function(){this._focusElement(this.filterInput)},_allowOpening:function(){return this.hasOptionLabel()||this.filterInput||this.dataSource.view().length},toggle:function(e){this._toggle(e,!0)},current:function(e){var i;return e===t?(i=this.listView.focus(),!i&&0===this.selectedIndex&&this.hasOptionLabel()?this.optionLabel:i):(this._focus(e),t)},dataItem:function(i){var n=this,s=null;if(null===i)return i;if(i===t)s=n.listView.selectedDataItems()[0];else{if("number"!=typeof i){if(n.options.virtual)return n.dataSource.getByUid(e(i).data("uid"));i=i.hasClass("k-list-optionlabel")?-1:e(n.items()).index(i)}else n.hasOptionLabel()&&(i-=1);s=n.dataSource.flatView()[i]}return s||(s=n._optionLabelDataItem()),s},refresh:function(){this.listView.refresh()},text:function(e){var i,n,s=this,o=s.options.ignoreCase;return e=null===e?"":e,e===t?s._textAccessor():("string"==typeof e&&(n=o?e.toLowerCase():e,s._select(function(e){return e=s._text(e),o&&(e=(e+"").toLowerCase()),e===n}),i=s.dataItem(),i&&(e=i)),s._textAccessor(e),t)},value:function(e){var i=this,n=i.listView,s=i.dataSource;return e===t?(e=i._accessor()||i.listView.value()[0],e===t||null===e?"":e):((e||!i.hasOptionLabel())&&(i._initialIndex=null),this.trigger("set",{value:e}),i._request&&i.options.cascadeFrom&&i.listView.bound()?(i._valueSetter&&s.unbind(m,i._valueSetter),i._valueSetter=C(function(){i.value(e)},i),s.one(m,i._valueSetter),t):(i._isFilterEnabled()&&n.bound()&&n.isFiltered()?(n.bound(!1),i._filterSource()):i._fetchData(),n.value(e).done(function(){-1===i.selectedIndex&&i.text()&&(i.text(""),i._accessor("",-1)),i._old=i._accessor(),i._oldIndex=i.selectedIndex}),t))},hasOptionLabel:function(){return this.optionLabel&&!!this.optionLabel[0]},_optionLabel:function(){var i=this,n=i.options,s=n.optionLabel,a=n.optionLabelTemplate;return s?(a||(a="#:",a+="string"==typeof s?"data":o.expr(n.dataTextField,"data"),a+="#"),"function"!=typeof a&&(a=o.template(a)),i.optionLabelTemplate=a,i.hasOptionLabel()||(i.optionLabel=e('<div class="k-list-optionlabel"></div>').prependTo(i.list)),i.optionLabel.html(a(s)).off().click(C(i._click,i)).on(L,i._toggleHover),i.angular("compile",function(){return{elements:i.optionLabel,data:[{dataItem:i._optionLabelDataItem()}]}}),t):(i.optionLabel.off().remove(),i.optionLabel=e(),t)},_optionLabelText:function(){var e=this.options.optionLabel;return"string"==typeof e?e:this._text(e)},_optionLabelDataItem:function(){var t=this,i=t.options.optionLabel;return t.hasOptionLabel()?e.isPlainObject(i)?new c(i):t._assignInstance(t._optionLabelText(),""):null},_buildOptions:function(e){var i,n,s=this;s._isSelect&&(i=s.listView.value()[0],n=s._optionLabelDataItem(),(i===t||null===i)&&(i=""),n&&(n='<option value="'+s._value(n)+'">'+s._text(n)+"</option>"),s._options(e,n,i),i!==l.unifyType(s._accessor(),typeof i)&&(s._customOption=null,s._custom(i)))},_listBound:function(){var e,t=this,i=t._initialIndex,n=t._state===k,s=t.dataSource.flatView();t._angularItems("compile"),t._presetValue=!1,t._resizePopup(!0),t.popup.position(),t._buildOptions(s),t._makeUnselectable(),n||(t._open&&t.toggle(t._allowOpening()),t._open=!1,t._fetch||(s.length?(!t.listView.value().length&&i>-1&&null!==i&&t.select(i),t._initialIndex=null,e=t.listView.selectedDataItems()[0],e&&t.text()!==t._text(e)&&t._selectValue(e)):t._textAccessor()!==t._optionLabelText()&&(t.listView.value(""),t._selectValue(null),t._oldIndex=t.selectedIndex))),t._hideBusy(),t.trigger("dataBound")},_listChange:function(){this._selectValue(this.listView.selectedDataItems()[0]),(this._presetValue||this._old&&-1===this._oldIndex)&&(this._oldIndex=this.selectedIndex)},_focusHandler:function(){this.wrapper.focus()},_focusinHandler:function(){this._inputWrapper.addClass(b),this._prevent=!1},_focusoutHandler:function(){var e=this,t=e._state===k,i=window.self!==window.top,n=e._focus();e._prevent||(clearTimeout(e._typingTimeout),t&&n&&!e.trigger("select",{item:n})&&e._select(n,!e.dataSource.view().length),p.mobileOS.ios&&i?e._change():e._blur(),e._inputWrapper.removeClass(b),e._prevent=!0,e._open=!1,e.element.blur())},_wrapperMousedown:function(){this._prevent=!!this.filterInput},_wrapperClick:function(e){e.preventDefault(),this.popup.unbind("activate",this._focusInputHandler),this._focused=this.wrapper,this._toggle()},_editable:function(e){var t=this,i=t.element,n=e.disable,s=e.readonly,o=t.wrapper.add(t.filterInput).off(f),a=t._inputWrapper.off(L);s||n?n?(o.removeAttr(I),a.addClass(w).removeClass(v)):(a.addClass(v).removeClass(w),o.on("focusin"+f,C(t._focusinHandler,t)).on("focusout"+f,C(t._focusoutHandler,t))):(i.removeAttr(_).removeAttr(h),a.addClass(v).removeClass(w).on(L,t._toggleHover),o.attr(I,o.data(I)).attr(g,!1).attr(x,!1).on("keydown"+f,C(t._keydown,t)).on("focusin"+f,C(t._focusinHandler,t)).on("focusout"+f,C(t._focusoutHandler,t)).on("mousedown"+f,C(t._wrapperMousedown,t)),t.wrapper.on("click"+f,C(t._wrapperClick,t)),t.filterInput||o.on("keypress"+f,C(t._keypress,t))),i.attr(_,n).attr(h,s),o.attr(g,n).attr(x,s)},_keydown:function(e){var i,n,s=this,o=e.keyCode,a=e.altKey,l=s.popup.visible();if(s.filterInput&&(i=s.filterInput[0]===u()),o===d.LEFT?(o=d.UP,n=!0):o===d.RIGHT&&(o=d.DOWN,n=!0),!n||!i){if(e.keyCode=o,(a&&o===d.UP||o===d.ESC)&&s._focusElement(s.wrapper),o===d.ENTER&&s._typingTimeout&&s.filterInput&&l)return e.preventDefault(),t;n=s._move(e),n||(l&&s.filterInput||(o===d.HOME?(n=!0,s._firstItem()):o===d.END&&(n=!0,s._lastItem()),n&&(s._select(s._focus()),e.preventDefault())),a||n||!s.filterInput||s._search())}},_matchText:function(e,i){var n=this.options.ignoreCase;return e===t||null===e?!1:(e+="",n&&(e=e.toLowerCase()),0===e.indexOf(i))},_shuffleData:function(e,t){var i=this._optionLabelDataItem();return i&&(e=[i].concat(e)),e.slice(t).concat(e.slice(0,t))},_selectNext:function(){var e,t,i,o=this,a=o.dataSource.flatView(),l=a.length+(o.hasOptionLabel()?1:0),r=s(o._word,o._last),p=o.selectedIndex;for(-1===p?p=0:(p+=r?1:0,p=n(p,l)),a=a.toJSON?a.toJSON():a.slice(),a=o._shuffleData(a,p),i=0;l>i&&(t=o._text(a[i]),!r||!o._matchText(t,o._last))&&!o._matchText(t,o._word);i++);i!==l&&(e=o._focus(),o._select(n(p+i,l)),o.trigger("select",{item:o._focus()})&&o._select(e),o.popup.visible()||o._change())},_keypress:function(e){var t,i=this;0!==e.which&&e.keyCode!==o.keys.ENTER&&(t=String.fromCharCode(e.charCode||e.keyCode),i.options.ignoreCase&&(t=t.toLowerCase())," "===t&&e.preventDefault(),i._word+=t,i._last=t,i._search())},_popupOpen:function(){var e=this.popup;e.wrapper=o.wrap(e.element),e.element.closest(".km-root")[0]&&(e.wrapper.addClass("km-popup km-widget"),this.wrapper.addClass("km-widget"))},_popup:function(){r.fn._popup.call(this),this.popup.one("open",C(this._popupOpen,this))},_click:function(i){var n=i.item||e(i.currentTarget);return i.preventDefault(),this.trigger("select",{item:n})?(this.close(),t):(this._userTriggered=!0,this._select(n),this._focusElement(this.wrapper),this._blur(),t)},_focusElement:function(e){var t=u(),i=this.wrapper,n=this.filterInput,s=e===n?i:n,o=p.mobileOS&&(p.touch||p.MSPointers||p.pointers);n&&n[0]===e[0]&&o||n&&s[0]===t&&(this._prevent=!0,this._focused=e.focus())},_filter:function(e){var t,i;e&&(t=this,i=t.options.ignoreCase,i&&(e=e.toLowerCase()),t._select(function(i){return t._matchText(t._text(i),e)}))},_search:function(){var e=this,i=e.dataSource;if(clearTimeout(e._typingTimeout),e._isFilterEnabled())e._typingTimeout=setTimeout(function(){var t=e.filterInput.val();e._prev!==t&&(e._prev=t,e.search(t)),e._typingTimeout=null},e.options.delay);else{if(e._typingTimeout=setTimeout(function(){e._word=""},e.options.delay),!e.listView.bound())return i.fetch().done(function(){e._selectNext()}),t;e._selectNext()}},_get:function(t){var i,n,s,o="function"==typeof t,a=o?e():e(t);if(this.hasOptionLabel()&&("number"==typeof t?t>-1&&(t-=1):a.hasClass("k-list-optionlabel")&&(t=-1)),o){for(i=this.dataSource.flatView(),s=0;i.length>s;s++)if(t(i[s])){t=s,n=!0;break}n||(t=-1)}return t},_firstItem:function(){this.hasOptionLabel()?this._focus(this.optionLabel):this.listView.focusFirst()},_lastItem:function(){this._resetOptionLabel(),this.listView.focusLast()},_nextItem:function(){this.optionLabel.hasClass("k-state-focused")?(this._resetOptionLabel(),this.listView.focusFirst()):this.listView.focusNext()},_prevItem:function(){this.optionLabel.hasClass("k-state-focused")||(this.listView.focusPrev(),this.listView.focus()||this._focus(this.optionLabel))},_focusItem:function(){var e=this.listView,i=e.focus(),n=e.select();n=n[n.length-1],n===t&&this.options.highlightFirst&&!i&&(n=0),n!==t?e.focus(n):this.options.optionLabel?(this._focus(this.optionLabel),this._select(this.optionLabel)):e.scrollToIndex(0)},_resetOptionLabel:function(e){this.optionLabel.removeClass("k-state-focused"+(e||"")).removeAttr("id")},_focus:function(e){var i=this.listView,n=this.optionLabel;return e===t?(e=i.focus(),!e&&n.hasClass("k-state-focused")&&(e=n),e):(this._resetOptionLabel(),e=this._get(e),i.focus(e),-1===e&&(n.addClass("k-state-focused").attr("id",i._optionID),this._focused.add(this.filterInput).removeAttr("aria-activedescendant").attr("aria-activedescendant",i._optionID)),t)},_select:function(e,t){var i=this;e=i._get(e),i.listView.select(e),t||i._state!==k||(i._state=y),-1===e&&i._selectValue(null)},_selectValue:function(e){var i=this,n=i.options.optionLabel,s=i.listView.select(),o="",a="";s=s[s.length-1],s===t&&(s=-1),this._resetOptionLabel(" k-state-selected"),e?(a=e,o=i._dataValue(e),n&&(s+=1)):n&&(i._focus(i.optionLabel.addClass("k-state-selected")),a=i._optionLabelText(),o="string"==typeof n?"":i._value(n),s=0),i.selectedIndex=s,null===o&&(o=""),i._textAccessor(a),i._accessor(o,s),i._triggerCascade()},_mobile:function(){var e=this,t=e.popup,i=p.mobileOS,n=t.element.parents(".km-root").eq(0);n.length&&i&&(t.options.animation.open.effects=i.android||i.meego?"fadeIn":i.ios||i.wp?"slideIn:up":t.options.animation.open.effects)},_filterHeader:function(){var t;this.filterInput&&(this.filterInput.off(f).parent().remove(),this.filterInput=null),this._isFilterEnabled()&&(t='<span unselectable="on" class="k-icon k-i-search">select</span>',this.filterInput=e('<input class="k-textbox"/>').attr({placeholder:this.element.attr("placeholder"),role:"listbox","aria-haspopup":!0,"aria-expanded":!1}),this.list.prepend(e('<span class="k-list-filter" />').append(this.filterInput.add(t))))},_span:function(){var t,i=this,n=i.wrapper,s="span.k-input";t=n.find(s),t[0]||(n.append('<span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input">&nbsp;</span><span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select</span></span></span>').append(i.element),t=n.find(s)),i.span=t,i._inputWrapper=e(n[0].firstChild),i._arrow=n.find(".k-icon")},_wrapper:function(){var e,t=this,i=t.element,n=i[0];e=i.parent(),e.is("span.k-widget")||(e=i.wrap("<span />").parent(),e[0].style.cssText=n.style.cssText,e[0].title=n.title),i.hide(),t._focused=t.wrapper=e.addClass("k-widget k-dropdown k-header").addClass(n.className).css("display","").attr({accesskey:i.attr("accesskey"),unselectable:"on",role:"listbox","aria-haspopup":!0,"aria-expanded":!1})},_clearSelection:function(e){this.select(e.value()?0:-1)},_inputTemplate:function(){var t=this,i=t.options.valueTemplate;if(i=i?o.template(i):e.proxy(o.template("#:this._text(data)#",{useWithBlock:!1}),t),t.valueTemplate=i,t.hasOptionLabel()&&!t.options.optionLabelTemplate)try{t.valueTemplate(t._optionLabelDataItem())}catch(n){throw Error(T)}},_textAccessor:function(i){var n,s=null,o=this.valueTemplate,a=this.options,l=a.optionLabel,r=this.span;if(i===t)return r.text();e.isPlainObject(i)||i instanceof c?s=i:l&&this._optionLabelText()===i&&(s=l,o=this.optionLabelTemplate),s||(s=this._assignInstance(i,this._accessor())),n=function(){return{elements:r.get(),data:[{dataItem:s}]}},this.angular("cleanup",n);try{r.html(o(s))}catch(p){r.html("")}this.angular("compile",n)},_preselect:function(e,t){e||t||(t=this._optionLabelText()),this._accessor(e),this._textAccessor(t),this._old=this._accessor(),this._oldIndex=this.selectedIndex,this.listView.setValue(e),this._initialIndex=null,this._presetValue=!0},_assignInstance:function(e,t){var n=this.options.dataTextField,s={};return n?(i(s,n.split("."),e),i(s,this.options.dataValueField.split("."),t),s=new c(s)):s=e,s}});a.plugin(V)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()});;!function(t,define){define("kendo.calendar.min",["kendo.core.min"],t)}(function(){return function(t,e){function n(t,e,n,a){var r,i=t.getFullYear(),o=e.getFullYear(),s=n.getFullYear();return i-=i%a,r=i+(a-1),o>i&&(i=o),r>s&&(r=s),i+"-"+r}function a(t){for(var e,n=0,a=t.min,r=t.max,i=t.start,o=t.setter,l=t.build,u=t.cells||12,c=t.perRow||4,f=t.content||H,d=t.empty||P,g=t.html||'<table tabindex="0" role="grid" class="k-content k-meta-view" cellspacing="0"><tbody><tr role="row">';u>n;n++)n>0&&n%c===0&&(g+='</tr><tr role="row">'),i=new pt(i.getFullYear(),i.getMonth(),i.getDate(),0,0,0),T(i,0),e=l(i,n,t.disableDates),g+=s(i,a,r)?f(e):d(e),o(i,1);return g+"</tr></tbody></table>"}function r(t,e,n){var a=t.getFullYear(),r=e.getFullYear(),i=r,o=0;return n&&(r-=r%n,i=r-r%n+n-1),a>i?o=1:r>a&&(o=-1),o}function i(){var t=new pt;return new pt(t.getFullYear(),t.getMonth(),t.getDate())}function o(t,e,n){var a=i();return t&&(a=new pt(+t)),e>a?a=new pt(+e):a>n&&(a=new pt(+n)),a}function s(t,e,n){return+t>=+e&&+n>=+t}function l(t,e){return t.slice(e).concat(t.slice(0,e))}function u(t,e,n){e=e instanceof pt?e.getFullYear():t.getFullYear()+n*e,t.setFullYear(e)}function c(e){var n=t(this).hasClass("k-state-disabled");n||t(this).toggleClass(J,st.indexOf(e.type)>-1||e.type==it)}function f(t){t.preventDefault()}function d(t){return A(t).calendars.standard}function g(t){var n=wt[t.start],a=wt[t.depth],r=A(t.culture);t.format=S(t.format||r.calendars.standard.patterns.d),isNaN(n)&&(n=0,t.start=L),(a===e||a>n)&&(t.depth=L),t.dates||(t.dates=[])}function v(t){z&&t.find("*").attr("unselectable","on")}function h(t,e){for(var n=0,a=e.length;a>n;n++)if(t===+e[n])return!0;return!1}function _(t,e){return t?t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate():!1}function m(t,e){return t?t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth():!1}function p(e){return F.isFunction(e)?e:t.isArray(e)?D(e):t.noop}function w(t){var e,n=[];for(e=0;t.length>e;e++)n.push(t[e].setHours(0,0,0,0));return n}function D(e){var n,a,r,i,o,s=[],l=["su","mo","tu","we","th","fr","sa"],u="if (found) { return true } else {return false}";if(e[0]instanceof pt)s=w(e),n="var found = date && $.inArray(date.setHours(0, 0, 0, 0),["+s+"]) > -1;"+u;else{for(r=0;e.length>r;r++)i=e[r].slice(0,2).toLowerCase(),o=t.inArray(i,l),o>-1&&s.push(o);n="var found = date && $.inArray(date.getDay(),["+s+"]) > -1;"+u}return a=Function("date",n)}function k(t,e){return t instanceof Date&&e instanceof Date&&(t=t.getTime(),e=e.getTime()),t===e}var b,F=window.kendo,y=F.support,x=F.ui,Y=x.Widget,C=F.keys,M=F.parseDate,T=F.date.adjustDST,S=F._extractFormat,O=F.template,A=F.getCulture,V=F.support.transitions,N=V?V.css+"transform-origin":"",H=O('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link" href="\\#" data-#=data.ns#value="#=data.dateString#">#=data.value#</a></td>',{useWithBlock:!1}),P=O('<td role="gridcell">&nbsp;</td>',{useWithBlock:!1}),E=F.support.browser,z=E.msie&&9>E.version,I=".kendoCalendar",B="click"+I,W="keydown"+I,R="id",U="min",j="left",G="slideIn",L="month",q="century",$="change",K="navigate",Q="value",J="k-state-hover",X="k-state-disabled",Z="k-state-focused",tt="k-other-month",et=' class="'+tt+'"',nt="k-nav-today",at="td:has(.k-link)",rt="blur"+I,it="focus",ot=it+I,st=y.touch?"touchstart":"mouseenter",lt=y.touch?"touchstart"+I:"mouseenter"+I,ut=y.touch?"touchend"+I+" touchmove"+I:"mouseleave"+I,ct=6e4,ft=864e5,dt="_prevArrow",gt="_nextArrow",vt="aria-disabled",ht="aria-selected",_t=t.proxy,mt=t.extend,pt=Date,wt={month:0,year:1,decade:2,century:3},Dt=Y.extend({init:function(e,n){var a,r,s=this;Y.fn.init.call(s,e,n),e=s.wrapper=s.element,n=s.options,n.url=window.unescape(n.url),s.options.disableDates=p(s.options.disableDates),s._templates(),s._header(),s._footer(s.footer),r=e.addClass("k-widget k-calendar").on(lt+" "+ut,at,c).on(W,"table.k-content",_t(s._move,s)).on(B,at,function(e){var n=e.currentTarget.firstChild,a=s._toDateObject(n);-1!=n.href.indexOf("#")&&e.preventDefault(),s.options.disableDates(a)&&"month"==s._view.name||s._click(t(n))}).on("mouseup"+I,"table.k-content, .k-footer",function(){s._focusView(s.options.focusOnNav!==!1)}).attr(R),r&&(s._cellID=r+"_cell_selected"),g(n),a=M(n.value,n.format,n.culture),s._index=wt[n.start],s._current=new pt(+o(a,n.min,n.max)),s._addClassProxy=function(){if(s._active=!0,s._cell.hasClass(X)){var t=s._view.toDateString(i());s._cell=s._cellByDate(t)}s._cell.addClass(Z)},s._removeClassProxy=function(){s._active=!1,s._cell.removeClass(Z)},s.value(a),F.notify(s)},options:{name:"Calendar",value:null,min:new pt(1900,0,1),max:new pt(2099,11,31),dates:[],url:"",culture:"",footer:"",format:"",month:{},start:L,depth:L,animation:{horizontal:{effects:G,reverse:!0,duration:500,divisor:2},vertical:{effects:"zoomIn",duration:400}}},events:[$,K],setOptions:function(t){var e=this;g(t),t.dates[0]||(t.dates=e.options.dates),t.disableDates=p(t.disableDates),Y.fn.setOptions.call(e,t),e._templates(),e._footer(e.footer),e._index=wt[e.options.start],e.navigate()},destroy:function(){var t=this,e=t._today;t.element.off(I),t._title.off(I),t[dt].off(I),t[gt].off(I),F.destroy(t._table),e&&F.destroy(e.off(I)),Y.fn.destroy.call(t)},current:function(){return this._current},view:function(){return this._view},focus:function(t){t=t||this._table,this._bindTable(t),t.focus()},min:function(t){return this._option(U,t)},max:function(t){return this._option("max",t)},navigateToPast:function(){this._navigate(dt,-1)},navigateToFuture:function(){this._navigate(gt,1)},navigateUp:function(){var t=this,e=t._index;t._title.hasClass(X)||t.navigate(t._current,++e)},navigateDown:function(t){var n=this,a=n._index,r=n.options.depth;if(t)return a===wt[r]?(k(n._value,n._current)&&k(n._value,t)||(n.value(t),n.trigger($)),e):(n.navigate(t,--a),e)},navigate:function(n,a){var r,i,s,l,u,c,f,d,g,h,_,m,p,w,D,k,F;a=isNaN(a)?wt[a]:a,r=this,i=r.options,s=i.culture,l=i.min,u=i.max,c=r._title,f=r._table,d=r._oldTable,g=r._value,h=r._current,_=n&&+n>+h,m=a!==e&&a!==r._index,n||(n=h),r._current=n=new pt(+o(n,l,u)),a===e?a=r._index:r._index=a,r._view=w=b.views[a],D=w.compare,k=a===wt[q],c.toggleClass(X,k).attr(vt,k),k=D(n,l)<1,r[dt].toggleClass(X,k).attr(vt,k),k=D(n,u)>-1,r[gt].toggleClass(X,k).attr(vt,k),f&&d&&d.data("animating")&&(d.kendoStop(!0,!0),f.kendoStop(!0,!0)),r._oldTable=f,(!f||r._changeView)&&(c.html(w.title(n,l,u,s)),r._table=p=t(w.content(mt({min:l,max:u,date:n,url:i.url,dates:i.dates,format:i.format,culture:s,disableDates:i.disableDates},r[w.name]))),v(p),F=f&&f.data("start")===p.data("start"),r._animate({from:f,to:p,vertical:m,future:_,replace:F}),r.trigger(K),r._focus(n)),a===wt[i.depth]&&g&&!r.options.disableDates(g)&&r._class("k-state-selected",g),r._class(Z,n),!f&&r._cell&&r._cell.removeClass(Z),r._changeView=!0},value:function(t){var n=this,a=n._view,r=n.options,i=n._view,o=r.min,l=r.max;return t===e?n._value:(null===t&&(n._current=new Date(n._current.getFullYear(),n._current.getMonth(),n._current.getDate())),t=M(t,r.format,r.culture),null!==t&&(t=new pt(+t),s(t,o,l)||(t=null)),n.options.disableDates(t)?n._value===e&&(n._value=null):n._value=t,i&&null===t&&n._cell?n._cell.removeClass("k-state-selected"):(n._changeView=!t||a&&0!==a.compare(t,n._current),n.navigate(t)),e)},_move:function(e){var n,a,r,i,l=this,u=l.options,c=e.keyCode,f=l._view,d=l._index,g=l.options.min,v=l.options.max,h=new pt(+l._current),_=F.support.isRtl(l.wrapper),m=l.options.disableDates;return e.target===l._table[0]&&(l._active=!0),e.ctrlKey?c==C.RIGHT&&!_||c==C.LEFT&&_?(l.navigateToFuture(),a=!0):c==C.LEFT&&!_||c==C.RIGHT&&_?(l.navigateToPast(),a=!0):c==C.UP?(l.navigateUp(),a=!0):c==C.DOWN&&(l._click(t(l._cell[0].firstChild)),a=!0):(c==C.RIGHT&&!_||c==C.LEFT&&_?(n=1,a=!0):c==C.LEFT&&!_||c==C.RIGHT&&_?(n=-1,a=!0):c==C.UP?(n=0===d?-7:-4,a=!0):c==C.DOWN?(n=0===d?7:4,a=!0):c==C.ENTER?(l._click(t(l._cell[0].firstChild)),a=!0):c==C.HOME||c==C.END?(r=c==C.HOME?"first":"last",i=f[r](h),h=new pt(i.getFullYear(),i.getMonth(),i.getDate(),h.getHours(),h.getMinutes(),h.getSeconds(),h.getMilliseconds()),a=!0):c==C.PAGEUP?(a=!0,l.navigateToPast()):c==C.PAGEDOWN&&(a=!0,l.navigateToFuture()),(n||r)&&(r||f.setDate(h,n),m(h)&&(h=l._nextNavigatable(h,n)),s(h,g,v)&&l._focus(o(h,u.min,u.max)))),a&&e.preventDefault(),l._current},_nextNavigatable:function(t,e){var n=this,a=!0,r=n._view,i=n.options.min,o=n.options.max,l=n.options.disableDates,u=new Date(t.getTime());for(r.setDate(u,-e);a;){if(r.setDate(t,e),!s(t,i,o)){t=u;break}a=l(t)}return t},_animate:function(t){var e=this,n=t.from,a=t.to,r=e._active;n?n.parent().data("animating")?(n.off(I),n.parent().kendoStop(!0,!0).remove(),n.remove(),a.insertAfter(e.element[0].firstChild),e._focusView(r)):!n.is(":visible")||e.options.animation===!1||t.replace?(a.insertAfter(n),n.off(I).remove(),e._focusView(r)):e[t.vertical?"_vertical":"_horizontal"](n,a,t.future):(a.insertAfter(e.element[0].firstChild),e._bindTable(a))},_horizontal:function(t,e,n){var a=this,r=a._active,i=a.options.animation.horizontal,o=i.effects,s=t.outerWidth();o&&-1!=o.indexOf(G)&&(t.add(e).css({width:s}),t.wrap("<div/>"),a._focusView(r,t),t.parent().css({position:"relative",width:2*s,"float":j,"margin-left":n?0:-s}),e[n?"insertAfter":"insertBefore"](t),mt(i,{effects:G+":"+(n?"right":j),complete:function(){t.off(I).remove(),a._oldTable=null,e.unwrap(),a._focusView(r)}}),t.parent().kendoStop(!0,!0).kendoAnimate(i))},_vertical:function(t,e){var n,a,r=this,i=r.options.animation.vertical,o=i.effects,s=r._active;o&&-1!=o.indexOf("zoom")&&(e.css({position:"absolute",top:t.prev().outerHeight(),left:0}).insertBefore(t),N&&(n=r._cellByDate(r._view.toDateString(r._current)),a=n.position(),a=a.left+parseInt(n.width()/2,10)+"px "+(a.top+parseInt(n.height()/2,10)+"px"),e.css(N,a)),t.kendoStop(!0,!0).kendoAnimate({effects:"fadeOut",duration:600,complete:function(){t.off(I).remove(),r._oldTable=null,e.css({position:"static",top:0,left:0}),r._focusView(s)}}),e.kendoStop(!0,!0).kendoAnimate(i))},_cellByDate:function(e){return this._table.find("td:not(."+tt+")").filter(function(){return t(this.firstChild).attr(F.attr(Q))===e})},_class:function(e,n){var a,r=this,i=r._cellID,o=r._cell,s=r._view.toDateString(n);o&&o.removeAttr(ht).removeAttr("aria-label").removeAttr(R),n&&(a=r.options.disableDates(n)),o=r._table.find("td:not(."+tt+")").removeClass(e).filter(function(){return t(this.firstChild).attr(F.attr(Q))===s}).attr(ht,!0),(e===Z&&!r._active&&r.options.focusOnNav!==!1||a)&&(e=""),o.addClass(e),o[0]&&(r._cell=o),i&&(o.attr(R,i),r._table.removeAttr("aria-activedescendant").attr("aria-activedescendant",i))},_bindTable:function(t){t.on(ot,this._addClassProxy).on(rt,this._removeClassProxy)},_click:function(t){var e=this,n=e.options,a=new Date(+e._current),r=e._toDateObject(t);T(r,0),e.options.disableDates(r)&&"month"==e._view.name&&(r=e._value),e._view.setDate(a,r),e.navigateDown(o(a,n.min,n.max))},_focus:function(t){var e=this,n=e._view;0!==n.compare(t,e._current)?e.navigate(t):(e._current=t,e._class(Z,t))},_focusView:function(t,e){t&&this.focus(e)},_footer:function(n){var a=this,r=i(),o=a.element,s=o.find(".k-footer");return n?(s[0]||(s=t('<div class="k-footer"><a href="#" class="k-link k-nav-today"></a></div>').appendTo(o)),a._today=s.show().find(".k-link").html(n(r)).attr("title",F.toString(r,"D",a.options.culture)),a._toggle(),e):(a._toggle(!1),s.hide(),e)},_header:function(){var t,e=this,n=e.element;n.find(".k-header")[0]||n.html('<div class="k-header"><a href="#" role="button" class="k-link k-nav-prev"><span class="k-icon k-i-arrow-w"></span></a><a href="#" role="button" aria-live="assertive" aria-atomic="true" class="k-link k-nav-fast"></a><a href="#" role="button" class="k-link k-nav-next"><span class="k-icon k-i-arrow-e"></span></a></div>'),t=n.find(".k-link").on(lt+" "+ut+" "+ot+" "+rt,c).click(!1),e._title=t.eq(1).on(B,function(){e._active=e.options.focusOnNav!==!1,e.navigateUp()}),e[dt]=t.eq(0).on(B,function(){e._active=e.options.focusOnNav!==!1,e.navigateToPast()}),e[gt]=t.eq(2).on(B,function(){e._active=e.options.focusOnNav!==!1,e.navigateToFuture()})},_navigate:function(t,e){var n=this,a=n._index+1,r=new pt(+n._current);t=n[t],t.hasClass(X)||(a>3?r.setFullYear(r.getFullYear()+100*e):b.views[a].setDate(r,e),n.navigate(r))},_option:function(t,n){var a,r=this,i=r.options,o=r._value||r._current;return n===e?i[t]:(n=M(n,i.format,i.culture),n&&(i[t]=new pt(+n),a=t===U?n>o:o>n,(a||m(o,n))&&(a&&(r._value=null),r._changeView=!0),r._changeView||(r._changeView=!(!i.month.content&&!i.month.empty)),r.navigate(r._value),r._toggle()),e)},_toggle:function(t){var n=this,a=n.options,r=n.options.disableDates(i()),o=n._today;t===e&&(t=s(i(),a.min,a.max)),o&&(o.off(B),t&&!r?o.addClass(nt).removeClass(X).on(B,_t(n._todayClick,n)):o.removeClass(nt).addClass(X).on(B,f))},_todayClick:function(t){var e=this,n=wt[e.options.depth],a=e.options.disableDates,r=i();t.preventDefault(),a(r)||(0===e._view.compare(e._current,r)&&e._index==n&&(e._changeView=!1),e._value=r,e.navigate(r,n),e.trigger($))},_toDateObject:function(e){var n=t(e).attr(F.attr(Q)).split("/");return n=new pt(n[0],n[1],n[2])},_templates:function(){var t=this,e=t.options,n=e.footer,a=e.month,r=a.content,i=a.empty;t.month={content:O('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link#=data.linkClass#" href="#=data.url#" '+F.attr("value")+'="#=data.dateString#" title="#=data.title#">'+(r||"#=data.value#")+"</a></td>",{useWithBlock:!!r}),empty:O('<td role="gridcell">'+(i||"&nbsp;")+"</td>",{useWithBlock:!!i})},t.footer=n!==!1?O(n||'#= kendo.toString(data,"D","'+e.culture+'") #',{useWithBlock:!1}):null}});x.plugin(Dt),b={firstDayOfMonth:function(t){return new pt(t.getFullYear(),t.getMonth(),1)},firstVisibleDay:function(t,e){e=e||F.culture().calendar;for(var n=e.firstDay,a=new pt(t.getFullYear(),t.getMonth(),0,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());a.getDay()!=n;)b.setTime(a,-1*ft);return a},setTime:function(t,e){var n=t.getTimezoneOffset(),a=new pt(t.getTime()+e),r=a.getTimezoneOffset()-n;t.setTime(a.getTime()+r*ct)},views:[{name:L,title:function(t,e,n,a){return d(a).months.names[t.getMonth()]+" "+t.getFullYear()},content:function(t){for(var e=this,n=0,r=t.min,i=t.max,o=t.date,s=t.dates,u=t.format,c=t.culture,f=t.url,g=f&&s[0],v=d(c),_=v.firstDay,m=v.days,p=l(m.names,_),w=l(m.namesShort,_),D=b.firstVisibleDay(o,v),k=e.first(o),y=e.last(o),x=e.toDateString,Y=new pt,C='<table tabindex="0" role="grid" class="k-content" cellspacing="0" data-start="'+x(D)+'"><thead><tr role="row">';7>n;n++)C+='<th scope="col" title="'+p[n]+'">'+w[n]+"</th>";return Y=new pt(Y.getFullYear(),Y.getMonth(),Y.getDate()),T(Y,0),Y=+Y,a({cells:42,perRow:7,html:C+='</tr></thead><tbody><tr role="row">',start:D,min:new pt(r.getFullYear(),r.getMonth(),r.getDate()),max:new pt(i.getFullYear(),i.getMonth(),i.getDate()),content:t.content,empty:t.empty,setter:e.setDate,disableDates:t.disableDates,build:function(t,e,n){var a=[],r=t.getDay(),i="",o="#";return(k>t||t>y)&&a.push(tt),n(t)&&a.push(X),+t===Y&&a.push("k-today"),(0===r||6===r)&&a.push("k-weekend"),g&&h(+t,s)&&(o=f.replace("{0}",F.toString(t,u,c)),i=" k-action-link"),{date:t,dates:s,ns:F.ns,title:F.toString(t,"D",c),value:t.getDate(),dateString:x(t),cssClass:a[0]?' class="'+a.join(" ")+'"':"",linkClass:i,url:o}}})},first:function(t){return b.firstDayOfMonth(t)},last:function(t){var e=new pt(t.getFullYear(),t.getMonth()+1,0),n=b.firstDayOfMonth(t),a=Math.abs(e.getTimezoneOffset()-n.getTimezoneOffset());return a&&e.setHours(n.getHours()+a/60),e},compare:function(t,e){var n,a=t.getMonth(),r=t.getFullYear(),i=e.getMonth(),o=e.getFullYear();return n=r>o?1:o>r?-1:a==i?0:a>i?1:-1},setDate:function(t,e){var n=t.getHours();e instanceof pt?t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()):b.setTime(t,e*ft),T(t,n)},toDateString:function(t){return t.getFullYear()+"/"+t.getMonth()+"/"+t.getDate()}},{name:"year",title:function(t){return t.getFullYear()},content:function(t){var e=d(t.culture).months.namesAbbr,n=this.toDateString,r=t.min,i=t.max;return a({min:new pt(r.getFullYear(),r.getMonth(),1),max:new pt(i.getFullYear(),i.getMonth(),1),start:new pt(t.date.getFullYear(),0,1),setter:this.setDate,build:function(t){return{value:e[t.getMonth()],ns:F.ns,dateString:n(t),cssClass:""}}})},first:function(t){return new pt(t.getFullYear(),0,t.getDate())},last:function(t){return new pt(t.getFullYear(),11,t.getDate())},compare:function(t,e){return r(t,e)},setDate:function(t,e){var n,a=t.getHours();e instanceof pt?(n=e.getMonth(),t.setFullYear(e.getFullYear(),n,t.getDate()),n!==t.getMonth()&&t.setDate(0)):(n=t.getMonth()+e,t.setMonth(n),n>11&&(n-=12),n>0&&t.getMonth()!=n&&t.setDate(0)),T(t,a)},toDateString:function(t){return t.getFullYear()+"/"+t.getMonth()+"/1"}},{name:"decade",title:function(t,e,a){return n(t,e,a,10)},content:function(t){var e=t.date.getFullYear(),n=this.toDateString;return a({start:new pt(e-e%10-1,0,1),min:new pt(t.min.getFullYear(),0,1),max:new pt(t.max.getFullYear(),0,1),setter:this.setDate,build:function(t,e){return{value:t.getFullYear(),ns:F.ns,dateString:n(t),cssClass:0===e||11==e?et:""}}})},first:function(t){var e=t.getFullYear();return new pt(e-e%10,t.getMonth(),t.getDate())},last:function(t){var e=t.getFullYear();return new pt(e-e%10+9,t.getMonth(),t.getDate())},compare:function(t,e){return r(t,e,10)},setDate:function(t,e){u(t,e,1)},toDateString:function(t){return t.getFullYear()+"/0/1"}},{name:q,title:function(t,e,a){return n(t,e,a,100)},content:function(t){var e=t.date.getFullYear(),n=t.min.getFullYear(),r=t.max.getFullYear(),i=this.toDateString,o=n,s=r;return o-=o%10,s-=s%10,10>s-o&&(s=o+9),a({start:new pt(e-e%100-10,0,1),min:new pt(o,0,1),max:new pt(s,0,1),setter:this.setDate,build:function(t,e){var a=t.getFullYear(),o=a+9;return n>a&&(a=n),o>r&&(o=r),{ns:F.ns,value:a+" - "+o,dateString:i(t),cssClass:0===e||11==e?et:""}}})},first:function(t){var e=t.getFullYear();return new pt(e-e%100,t.getMonth(),t.getDate())},last:function(t){var e=t.getFullYear();return new pt(e-e%100+99,t.getMonth(),t.getDate())},compare:function(t,e){return r(t,e,100)},setDate:function(t,e){u(t,e,10)},toDateString:function(t){var e=t.getFullYear();return e-e%10+"/0/1"}}]},b.isEqualDatePart=_,b.makeUnselectable=v,b.restrictValue=o,b.isInRange=s,b.normalize=g,b.viewsEnum=wt,b.disabled=p,F.calendar=b}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()});;!function(e,define){define("kendo.datepicker.min",["kendo.calendar.min","kendo.popup.min"],e)}(function(){return function(e,t){function a(t){var a=t.parseFormats,n=t.format;P.normalize(t),a=e.isArray(a)?a:[a],a.length||a.push("yyyy-MM-dd"),-1===e.inArray(n,a)&&a.splice(0,0,t.format),t.parseFormats=a}function n(e){e.preventDefault()}var i,o=window.kendo,r=o.ui,l=r.Widget,s=o.parseDate,d=o.keys,u=o.template,c=o._activeElement,p="<div />",f="<span />",m=".kendoDatePicker",_="click"+m,v="open",h="close",g="change",w="disabled",k="readonly",y="k-state-default",b="k-state-focused",x="k-state-selected",D="k-state-disabled",A="k-state-hover",V="mouseenter"+m+" mouseleave"+m,C="mousedown"+m,T="id",O="min",I="max",R="month",W="aria-disabled",E="aria-expanded",N="aria-hidden",F="aria-readonly",P=o.calendar,H=P.isInRange,S=P.restrictValue,z=P.isEqualDatePart,K=e.extend,M=e.proxy,U=Date,j=function(t){var a,n=this,i=document.body,l=e(p).attr(N,"true").addClass("k-calendar-container").appendTo(i);n.options=t=t||{},a=t.id,a&&(a+="_dateview",l.attr(T,a),n._dateViewID=a),n.popup=new r.Popup(l,K(t.popup,t,{name:"Popup",isRtl:o.support.isRtl(t.anchor)})),n.div=l,n.value(t.value)};j.prototype={_calendar:function(){var t,a=this,i=a.calendar,l=a.options;i||(t=e(p).attr(T,o.guid()).appendTo(a.popup.element).on(C,n).on(_,"td:has(.k-link)",M(a._click,a)),a.calendar=i=new r.Calendar(t),a._setOptions(l),o.calendar.makeUnselectable(i.element),i.navigate(a._value||a._current,l.start),a.value(a._value))},_setOptions:function(e){this.calendar.setOptions({focusOnNav:!1,change:e.change,culture:e.culture,dates:e.dates,depth:e.depth,footer:e.footer,format:e.format,max:e.max,min:e.min,month:e.month,start:e.start,disableDates:e.disableDates})},setOptions:function(e){var t=this.options;this.options=K(t,e,{change:t.change,close:t.close,open:t.open}),this.calendar&&this._setOptions(this.options)},destroy:function(){this.popup.destroy()},open:function(){var e=this;e._calendar(),e.popup.open()},close:function(){this.popup.close()},min:function(e){this._option(O,e)},max:function(e){this._option(I,e)},toggle:function(){var e=this;e[e.popup.visible()?h:v]()},move:function(e){var t=this,a=e.keyCode,n=t.calendar,i=e.ctrlKey&&a==d.DOWN||a==d.ENTER,o=!1;if(e.altKey)a==d.DOWN?(t.open(),e.preventDefault(),o=!0):a==d.UP&&(t.close(),e.preventDefault(),o=!0);else if(t.popup.visible()){if(a==d.ESC||i&&n._cell.hasClass(x))return t.close(),e.preventDefault(),!0;t._current=n._move(e),o=!0}return o},current:function(e){this._current=e,this.calendar._focus(e)},value:function(e){var t=this,a=t.calendar,n=t.options,i=n.disableDates;i&&i(e)&&(e=null),t._value=e,t._current=new U(+S(e,n.min,n.max)),a&&a.value(e)},_click:function(e){-1!==e.currentTarget.className.indexOf(x)&&this.close()},_option:function(e,t){var a=this,n=a.calendar;a.options[e]=t,n&&n[e](t)}},j.normalize=a,o.DateView=j,i=l.extend({init:function(t,n){var i,r,d=this;l.fn.init.call(d,t,n),t=d.element,n=d.options,n.disableDates=o.calendar.disabled(n.disableDates),n.min=s(t.attr("min"))||s(n.min),n.max=s(t.attr("max"))||s(n.max),a(n),d._initialOptions=K({},n),d._wrapper(),d.dateView=new j(K({},n,{id:t.attr(T),anchor:d.wrapper,change:function(){d._change(this.value()),d.close()},close:function(e){d.trigger(h)?e.preventDefault():(t.attr(E,!1),r.attr(N,!0))},open:function(e){var a,n=d.options;d.trigger(v)?e.preventDefault():(d.element.val()!==d._oldText&&(a=s(t.val(),n.parseFormats,n.culture),d.dateView[a?"current":"value"](a)),t.attr(E,!0),r.attr(N,!1),d._updateARIA(a))}})),r=d.dateView.div,d._icon();try{t[0].setAttribute("type","text")}catch(u){t[0].type="text"}t.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":d.dateView._dateViewID}),d._reset(),d._template(),i=t.is("[disabled]")||e(d.element).parents("fieldset").is(":disabled"),i?d.enable(!1):d.readonly(t.is("[readonly]")),d._old=d._update(n.value||d.element.val()),d._oldText=t.val(),o.notify(d)},events:[v,h,g],options:{name:"DatePicker",value:null,footer:"",format:"",culture:"",parseFormats:[],min:new Date(1900,0,1),max:new Date(2099,11,31),start:R,depth:R,animation:{},month:{},dates:[],ARIATemplate:'Current focused date is #=kendo.toString(data.current, "D")#'},setOptions:function(e){var t=this,n=t._value;l.fn.setOptions.call(t,e),e=t.options,e.min=s(e.min),e.max=s(e.max),a(e),t.dateView.setOptions(e),n&&(t.element.val(o.toString(n,e.format,e.culture)),t._updateARIA(n))},_editable:function(e){var t=this,a=t._dateIcon.off(m),i=t.element.off(m),o=t._inputWrapper.off(m),r=e.readonly,l=e.disable;r||l?(o.addClass(l?D:y).removeClass(l?y:D),i.attr(w,l).attr(k,r).attr(W,l).attr(F,r)):(o.addClass(y).removeClass(D).on(V,t._toggleHover),i.removeAttr(w).removeAttr(k).attr(W,!1).attr(F,!1).on("keydown"+m,M(t._keydown,t)).on("focusout"+m,M(t._blur,t)).on("focus"+m,function(){t._inputWrapper.addClass(b)}),a.on(_,M(t._click,t)).on(C,n))},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},destroy:function(){var e=this;l.fn.destroy.call(e),e.dateView.destroy(),e.element.off(m),e._dateIcon.off(m),e._inputWrapper.off(m),e._form&&e._form.off("reset",e._resetHandler)},open:function(){this.dateView.open()},close:function(){this.dateView.close()},min:function(e){return this._option(O,e)},max:function(e){return this._option(I,e)},value:function(e){var a=this;return e===t?a._value:(a._old=a._update(e),null===a._old&&a.element.val(""),a._oldText=a.element.val(),t)},_toggleHover:function(t){e(t.currentTarget).toggleClass(A,"mouseenter"===t.type)},_blur:function(){var e=this,t=e.element.val();e.close(),t!==e._oldText&&e._change(t),e._inputWrapper.removeClass(b)},_click:function(){var e=this,t=e.element;e.dateView.toggle(),o.support.touch||t[0]===c()||t.focus()},_change:function(e){var t,a,n,i=this,o=i.element.val();e=i._update(e),t=+i._old!=+e,a=t&&!i._typing,n=o!==i.element.val(),(a||n)&&i.element.trigger(g),t&&(i._old=e,i._oldText=i.element.val(),i.trigger(g)),i._typing=!1},_keydown:function(e){var t=this,a=t.dateView,n=t.element.val(),i=!1;a.popup.visible()||e.keyCode!=d.ENTER||n===t._oldText?(i=a.move(e),t._updateARIA(a._current),i||(t._typing=!0)):t._change(n)},_icon:function(){var t,a=this,n=a.element;t=n.next("span.k-select"),t[0]||(t=e('<span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-calendar">select</span></span>').insertAfter(n)),a._dateIcon=t.attr({role:"button","aria-controls":a.dateView._dateViewID})},_option:function(e,a){var n=this,i=n.options;return a===t?i[e]:(a=s(a,i.parseFormats,i.culture),a&&(i[e]=new U(+a),n.dateView[e](a)),t)},_update:function(e){var t,a=this,n=a.options,i=n.min,r=n.max,l=a._value,d=s(e,n.parseFormats,n.culture),u=null===d&&null===l||d instanceof Date&&l instanceof Date;return n.disableDates(d)&&(d=null,a._old||(e=null)),+d===+l&&u?(t=o.toString(d,n.format,n.culture),t!==e&&a.element.val(null===d?e:t),d):(null!==d&&z(d,i)?d=S(d,i,r):H(d,i,r)||(d=null),a._value=d,a.dateView.value(d),a.element.val(d?o.toString(d,n.format,n.culture):e),a._updateARIA(d),d)},_wrapper:function(){var t,a=this,n=a.element;t=n.parents(".k-datepicker"),t[0]||(t=n.wrap(f).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(f).parent()),t[0].style.cssText=n[0].style.cssText,n.css({width:"100%",height:n[0].style.height}),a.wrapper=t.addClass("k-widget k-datepicker k-header").addClass(n[0].className),a._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,a=t.element,n=a.attr("form"),i=n?e("#"+n):a.closest("form");i[0]&&(t._resetHandler=function(){t.value(a[0].defaultValue),t.max(t._initialOptions.max),t.min(t._initialOptions.min)},t._form=i.on("reset",t._resetHandler))},_template:function(){this._ariaTemplate=u(this.options.ARIATemplate)},_updateARIA:function(e){var t,a=this,n=a.dateView.calendar;a.element.removeAttr("aria-activedescendant"),n&&(t=n._cell,t.attr("aria-label",a._ariaTemplate({current:e||n.current()})),a.element.attr("aria-activedescendant",t.attr("id")))}}),r.plugin(i)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,a){(a||t)()});;!function(e,define){define("kendo.numerictextbox.min",["kendo.core.min","kendo.userevents.min"],e)}(function(){return function(e,t){function n(e,t){return'<span unselectable="on" class="k-link"><span unselectable="on" class="k-icon k-i-arrow-'+e+'" title="'+t+'">'+t+"</span></span>"}var r=window.kendo,a=r.caret,s=r.keys,o=r.ui,i=o.Widget,l=r._activeElement,u=r._extractFormat,p=r.parseFloat,d=r.support.placeholder,c=r.getCulture,_=r._round,f="change",m="disabled",v="readonly",x="k-input",g="spin",h=".kendoNumericTextBox",w="touchend",y="mouseleave"+h,k="mouseenter"+h+" "+y,b="k-state-default",A="k-state-focused",C="k-state-hover",T="focus",E=".",H="k-state-selected",O="k-state-disabled",R="aria-disabled",D="aria-readonly",N=/^(-)?(\d*)$/,W=null,j=e.proxy,K=e.extend,B=i.extend({init:function(n,a){var s,o,l,p,d,c=this,_=a&&a.step!==t;i.fn.init.call(c,n,a),a=c.options,n=c.element.on("focusout"+h,j(c._focusout,c)).attr("role","spinbutton"),a.placeholder=a.placeholder||n.attr("placeholder"),c._initialOptions=K({},a),c._reset(),c._wrapper(),c._arrows(),c._input(),r.support.mobileOS?c._text.on(w+h+" "+T+h,function(){c._toggleText(!1),n.focus()}):c._text.on(T+h,j(c._click,c)),s=c.min(n.attr("min")),o=c.max(n.attr("max")),l=c._parse(n.attr("step")),a.min===W&&s!==W&&(a.min=s),a.max===W&&o!==W&&(a.max=o),_||l===W||(a.step=l),n.attr("aria-valuemin",a.min).attr("aria-valuemax",a.max),a.format=u(a.format),p=a.value,c.value(p!==W?p:n.val()),d=n.is("[disabled]")||e(c.element).parents("fieldset").is(":disabled"),d?c.enable(!1):c.readonly(n.is("[readonly]")),r.notify(c)},options:{name:"NumericTextBox",decimals:W,min:W,max:W,value:W,step:1,culture:"",format:"n",spinners:!0,placeholder:"",upArrowText:"Increase value",downArrowText:"Decrease value"},events:[f,g],_editable:function(e){var t=this,n=t.element,r=e.disable,a=e.readonly,s=t._text.add(n),o=t._inputWrapper.off(k);t._toggleText(!0),t._upArrowEventHandler.unbind("press"),t._downArrowEventHandler.unbind("press"),n.off("keydown"+h).off("keypress"+h).off("paste"+h),a||r?(o.addClass(r?O:b).removeClass(r?b:O),s.attr(m,r).attr(v,a).attr(R,r).attr(D,a)):(o.addClass(b).removeClass(O).on(k,t._toggleHover),s.removeAttr(m).removeAttr(v).attr(R,!1).attr(D,!1),t._upArrowEventHandler.bind("press",function(e){e.preventDefault(),t._spin(1),t._upArrow.addClass(H)}),t._downArrowEventHandler.bind("press",function(e){e.preventDefault(),t._spin(-1),t._downArrow.addClass(H)}),t.element.on("keydown"+h,j(t._keydown,t)).on("keypress"+h,j(t._keypress,t)).on("paste"+h,j(t._paste,t)))},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},destroy:function(){var e=this;e.element.add(e._text).add(e._upArrow).add(e._downArrow).add(e._inputWrapper).off(h),e._upArrowEventHandler.destroy(),e._downArrowEventHandler.destroy(),e._form&&e._form.off("reset",e._resetHandler),i.fn.destroy.call(e)},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},step:function(e){return this._option("step",e)},value:function(e){var n,r=this;return e===t?r._value:(e=r._parse(e),n=r._adjust(e),e===n&&(r._update(e),r._old=r._value),t)},focus:function(){this._focusin()},_adjust:function(e){var t=this,n=t.options,r=n.min,a=n.max;return e===W?e:(r!==W&&r>e?e=r:a!==W&&e>a&&(e=a),e)},_arrows:function(){var t,a=this,s=function(){clearTimeout(a._spinning),t.removeClass(H)},o=a.options,i=o.spinners,l=a.element;t=l.siblings(".k-icon"),t[0]||(t=e(n("n",o.upArrowText)+n("s",o.downArrowText)).insertAfter(l),t.wrapAll('<span class="k-select"/>')),i||(t.parent().toggle(i),a._inputWrapper.addClass("k-expand-padding")),a._upArrow=t.eq(0),a._upArrowEventHandler=new r.UserEvents(a._upArrow,{release:s}),a._downArrow=t.eq(1),a._downArrowEventHandler=new r.UserEvents(a._downArrow,{release:s})},_blur:function(){var e=this;e._toggleText(!0),e._change(e.element.val())},_click:function(e){var t=this;clearTimeout(t._focusing),t._focusing=setTimeout(function(){var n,r,s,o=e.target,i=a(o)[0],l=o.value.substring(0,i),u=t._format(t.options.format),p=u[","],d=0;p&&(r=RegExp("\\"+p,"g"),s=RegExp("([\\d\\"+p+"]+)(\\"+u[E]+")?(\\d+)?")),s&&(n=s.exec(l)),n&&(d=n[0].replace(r,"").length,-1!=l.indexOf("(")&&0>t._value&&d++),t._focusin(),a(t.element[0],d)})},_change:function(e){var t=this;t._update(e),e=t._value,t._old!=e&&(t._old=e,t._typing||t.element.trigger(f),t.trigger(f)),t._typing=!1},_culture:function(e){return e||c(this.options.culture)},_focusin:function(){var e=this;e._inputWrapper.addClass(A),e._toggleText(!1),e.element[0].focus()},_focusout:function(){var e=this;clearTimeout(e._focusing),e._inputWrapper.removeClass(A).removeClass(C),e._blur()},_format:function(e,t){var n=this._culture(t).numberFormat;return e=e.toLowerCase(),e.indexOf("c")>-1?n=n.currency:e.indexOf("p")>-1&&(n=n.percent),n},_input:function(){var t,n=this,r="k-formatted-value",a=n.element.addClass(x).show()[0],s=a.accessKey,o=n.wrapper;t=o.find(E+r),t[0]||(t=e('<input type="text"/>').insertBefore(a).addClass(r));try{a.setAttribute("type","text")}catch(i){a.type="text"}t[0].tabIndex=a.tabIndex,t[0].style.cssText=a.style.cssText,t[0].title=a.title,t.prop("placeholder",n.options.placeholder),s&&(t.attr("accesskey",s),a.accessKey=""),n._text=t.addClass(a.className)},_keydown:function(e){var t=this,n=e.keyCode;t._key=n,n==s.DOWN?t._step(-1):n==s.UP?t._step(1):n==s.ENTER?t._change(t.element.val()):t._typing=!0},_keypress:function(e){var t,n,r,o,i,l,u,p,d,c,_;0===e.which||e.metaKey||e.ctrlKey||e.keyCode===s.BACKSPACE||e.keyCode===s.ENTER||(t=this,n=t.options.min,r=t.element,o=a(r),i=o[0],l=o[1],u=String.fromCharCode(e.which),p=t._format(t.options.format),d=t._key===s.NUMPAD_DOT,c=r.val(),d&&(u=p[E]),c=c.substring(0,i)+u+c.substring(l),_=t._numericRegex(p).test(c),_&&d?(r.val(c),a(r,i+u.length),e.preventDefault()):(null!==n&&n>=0&&"-"===c.charAt(0)||!_)&&e.preventDefault(),t._key=0)},_numericRegex:function(e){var t=this,n=e[E],r=t.options.decimals;return n===E&&(n="\\"+n),r===W&&(r=e.decimals),0===r?N:(t._separator!==n&&(t._separator=n,t._floatRegExp=RegExp("^(-)?(((\\d+("+n+"\\d*)?)|("+n+"\\d*)))?$")),t._floatRegExp)},_paste:function(e){var t=this,n=e.target,r=n.value;setTimeout(function(){t._parse(n.value)===W&&t._update(r)})},_option:function(e,n){var r=this,a=r.options;return n===t?a[e]:(n=r._parse(n),(n||"step"!==e)&&(a[e]=n,r.element.attr("aria-value"+e,n).attr(e,n)),t)},_spin:function(e,t){var n=this;t=t||500,clearTimeout(n._spinning),n._spinning=setTimeout(function(){n._spin(e,50)},t),n._step(e)},_step:function(e){var t=this,n=t.element,r=t._parse(n.val())||0;l()!=n[0]&&t._focusin(),r+=t.options.step*e,t._update(t._adjust(r)),t._typing=!1,t.trigger(g)},_toggleHover:function(t){e(t.currentTarget).toggleClass(C,"mouseenter"===t.type)},_toggleText:function(e){var t=this;t._text.toggle(e),t.element.toggle(!e)},_parse:function(e,t){return p(e,this._culture(t),this.options.format)},_update:function(e){var t,n=this,a=n.options,s=a.format,o=a.decimals,i=n._culture(),l=n._format(s,i);o===W&&(o=l.decimals),e=n._parse(e,i),t=e!==W,t&&(e=parseFloat(_(e,o))),n._value=e=n._adjust(e),n._placeholder(r.toString(e,s,i)),t?(e=""+e,-1!==e.indexOf("e")&&(e=_(+e,o)),e=e.replace(E,l[E])):e="",n.element.val(e).attr("aria-valuenow",e)},_placeholder:function(e){this._text.val(e),d||e||this._text.val(this.options.placeholder)},_wrapper:function(){var t,n=this,r=n.element,a=r[0];t=r.parents(".k-numerictextbox"),t.is("span.k-numerictextbox")||(t=r.hide().wrap('<span class="k-numeric-wrap k-state-default" />').parent(),t=t.wrap("<span/>").parent()),t[0].style.cssText=a.style.cssText,a.style.width="",n.wrapper=t.addClass("k-widget k-numerictextbox").addClass(a.className).css("display",""),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,r=n.attr("form"),a=r?e("#"+r):n.closest("form");a[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(n[0].value),t.max(t._initialOptions.max),t.min(t._initialOptions.min)})},t._form=a.on("reset",t._resetHandler))}});o.plugin(B)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});;!function(t,define){define("kendo.validator.min",["kendo.core.min"],t)}(function(){return function(t,e){function a(e){var a,r=l.ui.validator.ruleResolvers||{},u={};for(a in r)t.extend(!0,u,r[a].resolve(e));return u}function r(t){return t.replace(/&amp/g,"&amp;").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">")}function u(t){return t=(t+"").split("."),t.length>1?t[1].length:0}function n(e){return t(t.parseHTML?t.parseHTML(e):e)}function F(e,a){var r,u,n,F,i=t();for(n=0,F=e.length;F>n;n++)r=e[n],c.test(r.className)&&(u=r.getAttribute(l.attr("for")),u===a&&(i=i.add(r)));return i}var i,l=window.kendo,s=l.ui.Widget,o=".kendoValidator",d="k-invalid-msg",c=RegExp(d,"i"),f="k-invalid",p="k-valid",h=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,m=/^(https?|ftp):\/\/(((([a-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-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,v=":input:not(:button,[type=submit],[type=reset],[disabled],[readonly])",D=":checkbox:not([disabled],[readonly])",g="[type=number],[type=range]",x="blur",_="name",E="form",y="novalidate",C=t.proxy,k=function(t,e){return"string"==typeof e&&(e=RegExp("^(?:"+e+")$")),e.test(t)},A=function(t,e,a){var r=t.val();return t.filter(e).length&&""!==r?k(r,a):!0},b=function(t,e){return t.length?null!=t[0].attributes[e]:!1};l.ui.validator||(l.ui.validator={rules:{},messages:{}}),i=s.extend({init:function(e,r){var u=this,n=a(e),F="["+l.attr("validate")+"!=false]";r=r||{},r.rules=t.extend({},l.ui.validator.rules,n.rules,r.rules),r.messages=t.extend({},l.ui.validator.messages,n.messages,r.messages),s.fn.init.call(u,e,r),u._errorTemplate=l.template(u.options.errorTemplate),u.element.is(E)&&u.element.attr(y,y),u._inputSelector=v+F,u._checkboxSelector=D+F,u._errors={},u._attachEvents(),u._isValidated=!1},events:["validate","change"],options:{name:"Validator",errorTemplate:'<span class="k-widget k-tooltip k-tooltip-validation"><span class="k-icon k-warning"> </span> #=message#</span>',messages:{required:"{0} is required",pattern:"{0} is not valid",min:"{0} should be greater than or equal to {1}",max:"{0} should be smaller than or equal to {1}",step:"{0} is not valid",email:"{0} is not valid email",url:"{0} is not valid URL",date:"{0} is not valid date",dateCompare:"End date should be greater than or equal to the start date"},rules:{required:function(t){var e=t.filter("[type=checkbox]").length&&!t.is(":checked"),a=t.val();return!(b(t,"required")&&(""===a||!a||e))},pattern:function(t){return t.filter("[type=text],[type=email],[type=url],[type=tel],[type=search],[type=password]").filter("[pattern]").length&&""!==t.val()?k(t.val(),t.attr("pattern")):!0},min:function(t){if(t.filter(g+",["+l.attr("type")+"=number]").filter("[min]").length&&""!==t.val()){var e=parseFloat(t.attr("min"))||0,a=l.parseFloat(t.val());return a>=e}return!0},max:function(t){if(t.filter(g+",["+l.attr("type")+"=number]").filter("[max]").length&&""!==t.val()){var e=parseFloat(t.attr("max"))||0,a=l.parseFloat(t.val());return e>=a}return!0},step:function(t){if(t.filter(g+",["+l.attr("type")+"=number]").filter("[step]").length&&""!==t.val()){var e,a=parseFloat(t.attr("min"))||0,r=parseFloat(t.attr("step"))||1,n=parseFloat(t.val()),F=u(r);return F?(e=Math.pow(10,F),Math.floor((n-a)*e)%(r*e)/Math.pow(100,F)===0):(n-a)%r===0}return!0},email:function(t){return A(t,"[type=email],["+l.attr("type")+"=email]",h)},url:function(t){return A(t,"[type=url],["+l.attr("type")+"=url]",m)},date:function(t){return t.filter("[type^=date],["+l.attr("type")+"=date]").length&&""!==t.val()?null!==l.parseDate(t.val(),t.attr(l.attr("format"))):!0}},validateOnBlur:!0},destroy:function(){s.fn.destroy.call(this),this.element.off(o)},value:function(){return this._isValidated?0===this.errors().length:!1},_submit:function(t){return this.validate()?!0:(t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault(),!1)},_checkElement:function(t){var e=this.value();this.validateInput(t),this.value()!==e&&this.trigger("change")},_attachEvents:function(){var e=this;e.element.is(E)&&e.element.on("submit"+o,C(e._submit,e)),e.options.validateOnBlur&&(e.element.is(v)?(e.element.on(x+o,function(){e._checkElement(e.element)}),e.element.is(D)&&e.element.on("click"+o,function(){e._checkElement(e.element)})):(e.element.on(x+o,e._inputSelector,function(){e._checkElement(t(this))}),e.element.on("click"+o,e._checkboxSelector,function(){e._checkElement(t(this))})))},validate:function(){var t,e,a,r,u=!1,n=this.value();if(this._errors={},this.element.is(v))u=this.validateInput(this.element);else{for(r=!1,t=this.element.find(this._inputSelector),e=0,a=t.length;a>e;e++)this.validateInput(t.eq(e))||(r=!0);u=!r}return this.trigger("validate",{valid:u}),n!==u&&this.trigger("change"),u},validateInput:function(e){var a,u,F,i,s,o,c,h,m,v;return e=t(e),this._isValidated=!0,a=this,u=a._errorTemplate,F=a._checkValidity(e),i=F.valid,s="."+d,o=e.attr(_)||"",c=a._findMessageContainer(o).add(e.next(s).filter(function(){var e=t(this);return e.filter("["+l.attr("for")+"]").length?e.attr(l.attr("for"))===o:!0})).hide(),e.removeAttr("aria-invalid"),i?delete a._errors[o]:(h=a._extractMessage(e,F.key),a._errors[o]=h,m=n(u({message:r(h)})),v=c.attr("id"),a._decorateMessageContainer(m,o),v&&m.attr("id",v),c.replaceWith(m).length||m.insertAfter(e),m.show(),e.attr("aria-invalid",!0)),e.toggleClass(f,!i),e.toggleClass(p,i),i},hideMessages:function(){var t=this,e="."+d,a=t.element;a.is(v)?a.next(e).hide():a.find(e).hide()},_findMessageContainer:function(e){var a,r,u,n=l.ui.validator.messageLocators,i=t();for(r=0,u=this.element.length;u>r;r++)i=i.add(F(this.element[r].getElementsByTagName("*"),e));for(a in n)i=i.add(n[a].locate(this.element,e));return i},_decorateMessageContainer:function(t,e){var a,r=l.ui.validator.messageLocators;t.addClass(d).attr(l.attr("for"),e||"");for(a in r)r[a].decorate(t,e);t.attr("role","alert")},_extractMessage:function(t,e){var a=this,r=a.options.messages[e],u=t.attr(_);return r=l.isFunction(r)?r(t):r,l.format(t.attr(l.attr(e+"-msg"))||t.attr("validationMessage")||t.attr("title")||r||"",u,t.attr(e)||t.attr(l.attr(e)))},_checkValidity:function(t){var e,a=this.options.rules;for(e in a)if(!a[e].call(this,t))return{valid:!1,key:e};return{valid:!0}},errors:function(){var t,e=[],a=this._errors;for(t in a)e.push(a[t]);return e}}),l.ui.plugin(i)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,a){(a||e)()});;!function(e,define){define("kendo.binder.min",["kendo.core.min","kendo.data.min"],e)}(function(){return function(e,t){function i(t,i,n){return p.extend({init:function(e,t,i){var n=this;p.fn.init.call(n,e.element[0],t,i),n.widget=e,n._dataBinding=M(n.dataBinding,n),n._dataBound=M(n.dataBound,n),n._itemChange=M(n.itemChange,n)},itemChange:function(e){r(e.item[0],e.data,this._ns(e.ns),[e.data].concat(this.bindings[t]._parents()))},dataBinding:function(e){var t,i,n=this.widget,s=e.removedItems||n.items();for(t=0,i=s.length;i>t;t++)h(s[t],!1)},_ns:function(t){t=t||k.ui;var i=[k.ui,k.dataviz.ui,k.mobile.ui];return i.splice(e.inArray(t,i),1),i.unshift(t),k.rolesFromNamespaces(i)},dataBound:function(e){var n,s,a,o,d=this.widget,h=e.addedItems||d.items(),l=d[i],c=k.data.HierarchicalDataSource;if(!(c&&l instanceof c)&&h.length)for(a=e.addedDataItems||l.flatView(),o=this.bindings[t]._parents(),n=0,s=a.length;s>n;n++)r(h[n],a[n],this._ns(e.ns),[a[n]].concat(o))},refresh:function(e){var s,a,r,o=this,d=o.widget;e=e||{},e.action||(o.destroy(),d.bind("dataBinding",o._dataBinding),d.bind("dataBound",o._dataBound),d.bind("itemChange",o._itemChange),s=o.bindings[t].get(),d[i]instanceof k.data.DataSource&&d[i]!=s&&(s instanceof k.data.DataSource?d[n](s):s&&s._dataSource?d[n](s._dataSource):(d[i].data(s),a=k.ui.Select&&d instanceof k.ui.Select,r=k.ui.MultiSelect&&d instanceof k.ui.MultiSelect,o.bindings.value&&(a||r)&&d.value(f(o.bindings.value.get(),d.options.dataValueField)))))},destroy:function(){var e=this.widget;e.unbind("dataBinding",this._dataBinding),e.unbind("dataBound",this._dataBound),e.unbind("itemChange",this._itemChange)}})}function n(e,i){var n=k.initWidget(e,{},i);return n?new w(n):t}function s(e){var t,i,n,a,r,o,d,h={};for(d=e.match(x),t=0,i=d.length;i>t;t++)n=d[t],a=n.indexOf(":"),r=n.substring(0,a),o=n.substring(a+1),"{"==o.charAt(0)&&(o=s(o)),h[r]=o;return h}function a(e,t,i){var n,s={};for(n in e)s[n]=new i(t,e[n]);return s}function r(e,t,i,o){var h,l,c,u=e.getAttribute("data-"+k.ns+"role"),f=e.getAttribute("data-"+k.ns+"bind"),p=e.children,m=[],y=!0,w={};if(o=o||[t],(u||f)&&d(e,!1),u&&(c=n(e,i)),f&&(f=s(f.replace(B,"")),c||(w=k.parseOptions(e,{textField:"",valueField:"",template:"",valueUpdate:j,valuePrimitive:!1,autoBind:!0}),w.roles=i,c=new _(e,w)),c.source=t,l=a(f,o,g),w.template&&(l.template=new v(o,"",w.template)),l.click&&(f.events=f.events||{},f.events.click=f.click,l.click.destroy(),delete l.click),l.source&&(y=!1),f.attr&&(l.attr=a(f.attr,o,g)),f.style&&(l.style=a(f.style,o,g)),f.events&&(l.events=a(f.events,o,b)),f.css&&(l.css=a(f.css,o,g)),c.bind(l)),c&&(e.kendoBindingTarget=c),y&&p){for(h=0;p.length>h;h++)m[h]=p[h];for(h=0;m.length>h;h++)r(m[h],t,i,o)}}function o(t,i){var n,s,a,o=k.rolesFromNamespaces([].slice.call(arguments,2));for(i=k.observable(i),t=e(t),n=0,s=t.length;s>n;n++)a=t[n],1===a.nodeType&&r(a,i,o)}function d(t,i){var n,s=t.kendoBindingTarget;s&&(s.destroy(),L?delete t.kendoBindingTarget:t.removeAttribute?t.removeAttribute("kendoBindingTarget"):t.kendoBindingTarget=null),i&&(n=k.widgetInstance(e(t)),n&&typeof n.destroy===P&&n.destroy())}function h(e,t){d(e,t),l(e,t)}function l(e,t){var i,n,s=e.children;if(s)for(i=0,n=s.length;n>i;i++)h(s[i],t)}function c(t){var i,n;for(t=e(t),i=0,n=t.length;n>i;i++)h(t[i],!1)}function u(e,t){var i=e.element,n=i[0].kendoBindingTarget;n&&o(i,n.source,t)}function f(e,t){var i,n,s=[],a=0;if(!t)return e;if(e instanceof F){for(i=e.length;i>a;a++)n=e[a],s[a]=n.get?n.get(t):n[t];e=s}else e instanceof S&&(e=e.get(t));return e}var g,b,v,p,m,y,_,w,x,B,k=window.kendo,C=k.Observable,S=k.data.ObservableObject,F=k.data.ObservableArray,T={}.toString,D={},A=k.Class,M=e.proxy,V="value",I="source",O="events",H="checked",N="css",L=!0,P="function",j="change";!function(){var e=document.createElement("a");try{delete e.test}catch(t){L=!1}}(),g=C.extend({init:function(e,t){var i=this;C.fn.init.call(i),i.source=e[0],i.parents=e,i.path=t,i.dependencies={},i.dependencies[t]=!0,i.observable=i.source instanceof C,i._access=function(e){i.dependencies[e.field]=!0},i.observable&&(i._change=function(e){i.change(e)},i.source.bind(j,i._change))},_parents:function(){var t,i=this.parents,n=this.get();return n&&"function"==typeof n.parent&&(t=n.parent(),e.inArray(t,i)<0&&(i=[t].concat(i))),i},change:function(e){var t,i,n=e.field,s=this;if("this"===s.path)s.trigger(j,e);else for(t in s.dependencies)if(0===t.indexOf(n)&&(i=t.charAt(n.length),!i||"."===i||"["===i)){s.trigger(j,e);break}},start:function(e){e.bind("get",this._access)},stop:function(e){e.unbind("get",this._access)},get:function(){var e=this,i=e.source,n=0,s=e.path,a=i;if(!e.observable)return a;for(e.start(e.source),a=i.get(s);a===t&&i;)i=e.parents[++n],i instanceof S&&(a=i.get(s));if(a===t)for(i=e.source;a===t&&i;)i=i.parent(),i instanceof S&&(a=i.get(s));return"function"==typeof a&&(n=s.lastIndexOf("."),n>0&&(i=i.get(s.substring(0,n))),e.start(i),a=i!==e.source?a.call(i,e.source):a.call(i),e.stop(i)),i&&i!==e.source&&(e.currentSource=i,i.unbind(j,e._change).bind(j,e._change)),e.stop(e.source),a},set:function(e){var t=this.currentSource||this.source,i=k.getter(this.path)(t);"function"==typeof i?t!==this.source?i.call(t,this.source,e):i.call(t,e):t.set(this.path,e)},destroy:function(){this.observable&&(this.source.unbind(j,this._change),this.currentSource&&this.currentSource.unbind(j,this._change)),this.unbind()}}),b=g.extend({get:function(){var e,t=this.source,i=this.path,n=0;for(e=t.get(i);!e&&t;)t=this.parents[++n],t instanceof S&&(e=t.get(i));return M(e,t)}}),v=g.extend({init:function(e,t,i){var n=this;g.fn.init.call(n,e,t),n.template=i},render:function(e){var t;return this.start(this.source),t=k.render(this.template,e),this.stop(this.source),t}}),p=A.extend({init:function(e,t,i){this.element=e,this.bindings=t,this.options=i},bind:function(e,t){var i=this;e=t?e[t]:e,e.bind(j,function(e){i.refresh(t||e)}),i.refresh(t)},destroy:function(){}}),m=p.extend({dataType:function(){var e=this.element.getAttribute("data-type")||this.element.type||"text";return e.toLowerCase()},parsedValue:function(){return this._parseValue(this.element.value,this.dataType())},_parseValue:function(e,t){return"date"==t?e=k.parseDate(e,"yyyy-MM-dd"):"datetime-local"==t?e=k.parseDate(e,["yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm"]):"number"==t?e=k.parseFloat(e):"boolean"==t&&(e=e.toLowerCase(),e=null!==k.parseFloat(e)?!!k.parseFloat(e):"true"===e.toLowerCase()),e}}),D.attr=p.extend({refresh:function(e){this.element.setAttribute(e,this.bindings.attr[e].get())}}),D.css=p.extend({init:function(e,t,i){p.fn.init.call(this,e,t,i),this.classes={}},refresh:function(t){var i=e(this.element),n=this.bindings.css[t],s=this.classes[t]=n.get();s?i.addClass(t):i.removeClass(t)}}),D.style=p.extend({refresh:function(e){this.element.style[e]=this.bindings.style[e].get()||""}}),D.enabled=p.extend({refresh:function(){this.bindings.enabled.get()?this.element.removeAttribute("disabled"):this.element.setAttribute("disabled","disabled")}}),D.readonly=p.extend({refresh:function(){this.bindings.readonly.get()?this.element.setAttribute("readonly","readonly"):this.element.removeAttribute("readonly")}}),D.disabled=p.extend({refresh:function(){this.bindings.disabled.get()?this.element.setAttribute("disabled","disabled"):this.element.removeAttribute("disabled")}}),D.events=p.extend({init:function(e,t,i){p.fn.init.call(this,e,t,i),this.handlers={}},refresh:function(t){var i=e(this.element),n=this.bindings.events[t],s=this.handlers[t];s&&i.off(t,s),s=this.handlers[t]=n.get(),i.on(t,n.source,s)},destroy:function(){var t,i=e(this.element);for(t in this.handlers)i.off(t,this.handlers[t])}}),D.text=p.extend({refresh:function(){var t=this.bindings.text.get(),i=this.element.getAttribute("data-format")||"";null==t&&(t=""),e(this.element).text(k.toString(t,i))}}),D.visible=p.extend({refresh:function(){this.element.style.display=this.bindings.visible.get()?"":"none"}}),D.invisible=p.extend({refresh:function(){this.element.style.display=this.bindings.invisible.get()?"none":""}}),D.html=p.extend({refresh:function(){this.element.innerHTML=this.bindings.html.get()}}),D.value=m.extend({init:function(t,i,n){m.fn.init.call(this,t,i,n),this._change=M(this.change,this),this.eventName=n.valueUpdate||j,e(this.element).on(this.eventName,this._change),this._initChange=!1},change:function(){this._initChange=this.eventName!=j,this.bindings[V].set(this.parsedValue()),this._initChange=!1},refresh:function(){var e,t;this._initChange||(e=this.bindings[V].get(),null==e&&(e=""),t=this.dataType(),"date"==t?e=k.toString(e,"yyyy-MM-dd"):"datetime-local"==t&&(e=k.toString(e,"yyyy-MM-ddTHH:mm:ss")),this.element.value=e),this._initChange=!1},destroy:function(){e(this.element).off(this.eventName,this._change)}}),D.source=p.extend({init:function(e,t,i){p.fn.init.call(this,e,t,i);var n=this.bindings.source.get();n instanceof k.data.DataSource&&i.autoBind!==!1&&n.fetch()},refresh:function(e){var t=this,i=t.bindings.source.get();i instanceof F||i instanceof k.data.DataSource?(e=e||{},"add"==e.action?t.add(e.index,e.items):"remove"==e.action?t.remove(e.index,e.items):"itemchange"!=e.action&&t.render()):t.render()},container:function(){var e=this.element;return"table"==e.nodeName.toLowerCase()&&(e.tBodies[0]||e.appendChild(document.createElement("tbody")),e=e.tBodies[0]),e},template:function(){var e=this.options,t=e.template,i=this.container().nodeName.toLowerCase();return t||(t="select"==i?e.valueField||e.textField?k.format('<option value="#:{0}#">#:{1}#</option>',e.valueField||e.textField,e.textField||e.valueField):"<option>#:data#</option>":"tbody"==i?"<tr><td>#:data#</td></tr>":"ul"==i||"ol"==i?"<li>#:data#</li>":"#:data#",t=k.template(t)),t},add:function(t,i){var n,s,a,o,d=this.container(),h=d.cloneNode(!1),l=d.children[t];if(e(h).html(k.render(this.template(),i)),h.children.length)for(n=this.bindings.source._parents(),s=0,a=i.length;a>s;s++)o=h.children[0],d.insertBefore(o,l||null),r(o,i[s],this.options.roles,[i[s]].concat(n))},remove:function(e,t){var i,n,s=this.container();for(i=0;t.length>i;i++)n=s.children[e],h(n,!0),s.removeChild(n)},render:function(){var t,i,n,s=this.bindings.source.get(),a=this.container(),o=this.template();if(null!=s)if(s instanceof k.data.DataSource&&(s=s.view()),s instanceof F||"[object Array]"===T.call(s)||(s=[s]),this.bindings.template){if(l(a,!0),e(a).html(this.bindings.template.render(s)),a.children.length)for(t=this.bindings.source._parents(),i=0,n=s.length;n>i;i++)r(a.children[i],s[i],this.options.roles,[s[i]].concat(t))}else e(a).html(k.render(o,s))}}),D.input={checked:m.extend({init:function(t,i,n){m.fn.init.call(this,t,i,n),this._change=M(this.change,this),e(this.element).change(this._change)},change:function(){var e,t,i,n=this.element,s=this.value();if("radio"==n.type)s=this.parsedValue(),this.bindings[H].set(s);else if("checkbox"==n.type)if(e=this.bindings[H].get(),e instanceof F){if(s=this.parsedValue(),s instanceof Date){for(i=0;e.length>i;i++)if(e[i]instanceof Date&&+e[i]===+s){t=i;break}}else t=e.indexOf(s);t>-1?e.splice(t,1):e.push(s)}else this.bindings[H].set(s)},refresh:function(){var e,t,i=this.bindings[H].get(),n=i,s=this.dataType(),a=this.element;if("checkbox"==a.type)if(n instanceof F){if(e=-1,i=this.parsedValue(),i instanceof Date){for(t=0;n.length>t;t++)if(n[t]instanceof Date&&+n[t]===+i){e=t;break}}else e=n.indexOf(i);a.checked=e>=0}else a.checked=n;else"radio"==a.type&&null!=i&&("date"==s?i=k.toString(i,"yyyy-MM-dd"):"datetime-local"==s&&(i=k.toString(i,"yyyy-MM-ddTHH:mm:ss")),a.checked=a.value===""+i?!0:!1)},value:function(){var e=this.element,t=e.value;return"checkbox"==e.type&&(t=e.checked),t},destroy:function(){e(this.element).off(j,this._change)}})},D.select={source:D.source.extend({refresh:function(i){var n,s=this,a=s.bindings.source.get();a instanceof F||a instanceof k.data.DataSource?(i=i||{},"add"==i.action?s.add(i.index,i.items):"remove"==i.action?s.remove(i.index,i.items):("itemchange"==i.action||i.action===t)&&(s.render(),s.bindings.value&&s.bindings.value&&(n=f(s.bindings.value.get(),e(s.element).data("valueField")),null===n?s.element.selectedIndex=-1:s.element.value=n))):s.render()}}),value:m.extend({init:function(t,i,n){m.fn.init.call(this,t,i,n),this._change=M(this.change,this),e(this.element).change(this._change)},parsedValue:function(){var e,t,i,n,s=this.dataType(),a=[];for(i=0,n=this.element.options.length;n>i;i++)t=this.element.options[i],t.selected&&(e=t.attributes.value,e=e&&e.specified?t.value:t.text,a.push(this._parseValue(e,s)));return a},change:function(){var e,i,n,s,a,r,o,d,h=[],l=this.element,c=this.options.valueField||this.options.textField,u=this.options.valuePrimitive;for(a=0,r=l.options.length;r>a;a++)i=l.options[a],i.selected&&(s=i.attributes.value,s=s&&s.specified?i.value:i.text,h.push(this._parseValue(s,this.dataType())));if(c)for(e=this.bindings.source.get(),e instanceof k.data.DataSource&&(e=e.view()),n=0;h.length>n;n++)for(a=0,r=e.length;r>a;a++)if(o=this._parseValue(e[a].get(c),this.dataType()),d=o+""===h[n]){h[n]=e[a];break}s=this.bindings[V].get(),s instanceof F?s.splice.apply(s,[0,s.length].concat(h)):this.bindings[V].set(u||!(s instanceof S||null===s||s===t)&&c?h[0].get(c):h[0])},refresh:function(){var e,t,i,n=this.element,s=n.options,a=this.bindings[V].get(),r=a,o=this.options.valueField||this.options.textField,d=!1,h=this.dataType();for(r instanceof F||(r=new F([a])),n.selectedIndex=-1,i=0;r.length>i;i++)for(a=r[i],o&&a instanceof S&&(a=a.get(o)),"date"==h?a=k.toString(r[i],"yyyy-MM-dd"):"datetime-local"==h&&(a=k.toString(r[i],"yyyy-MM-ddTHH:mm:ss")),e=0;s.length>e;e++)t=s[e].value,""===t&&""!==a&&(t=s[e].text),null!=a&&t==""+a&&(s[e].selected=!0,d=!0)},destroy:function(){e(this.element).off(j,this._change)}})},D.widget={events:p.extend({init:function(e,t,i){p.fn.init.call(this,e.element[0],t,i),this.widget=e,this.handlers={}},refresh:function(e){var t=this.bindings.events[e],i=this.handlers[e];i&&this.widget.unbind(e,i),i=t.get(),this.handlers[e]=function(e){e.data=t.source,i(e),e.data===t.source&&delete e.data},this.widget.bind(e,this.handlers[e])},destroy:function(){var e;for(e in this.handlers)this.widget.unbind(e,this.handlers[e])}}),checked:p.extend({init:function(e,t,i){p.fn.init.call(this,e.element[0],t,i),this.widget=e,this._change=M(this.change,this),this.widget.bind(j,this._change)},change:function(){this.bindings[H].set(this.value())},refresh:function(){this.widget.check(this.bindings[H].get()===!0)},value:function(){var e=this.element,t=e.value;return("on"==t||"off"==t)&&(t=e.checked),t},destroy:function(){this.widget.unbind(j,this._change)}}),visible:p.extend({init:function(e,t,i){p.fn.init.call(this,e.element[0],t,i),this.widget=e},refresh:function(){var e=this.bindings.visible.get();this.widget.wrapper[0].style.display=e?"":"none"}}),invisible:p.extend({init:function(e,t,i){p.fn.init.call(this,e.element[0],t,i),this.widget=e},refresh:function(){var e=this.bindings.invisible.get();this.widget.wrapper[0].style.display=e?"none":""}}),enabled:p.extend({init:function(e,t,i){p.fn.init.call(this,e.element[0],t,i),this.widget=e},refresh:function(){this.widget.enable&&this.widget.enable(this.bindings.enabled.get())}}),disabled:p.extend({init:function(e,t,i){p.fn.init.call(this,e.element[0],t,i),this.widget=e},refresh:function(){this.widget.enable&&this.widget.enable(!this.bindings.disabled.get())}}),source:i("source","dataSource","setDataSource"),value:p.extend({init:function(t,i,n){p.fn.init.call(this,t.element[0],i,n),this.widget=t,this._change=e.proxy(this.change,this),this.widget.first(j,this._change);var s=this.bindings.value.get();this._valueIsObservableObject=!n.valuePrimitive&&(null==s||s instanceof S),this._valueIsObservableArray=s instanceof F,this._initChange=!1},_source:function(){var e;return this.widget.dataItem&&(e=this.widget.dataItem(),e&&e instanceof S)?[e]:(this.bindings.source&&(e=this.bindings.source.get()),(!e||e instanceof k.data.DataSource)&&(e=this.widget.dataSource.flatView()),e)},change:function(){var e,t,i,n,s,a,r,o=this.widget.value(),d=this.options.dataValueField||this.options.dataTextField,h="[object Array]"===T.call(o),l=this._valueIsObservableObject,c=[];if(this._initChange=!0,d)if(""===o&&(l||this.options.valuePrimitive))o=null;else{for(r=this._source(),h&&(t=o.length,c=o.slice(0)),s=0,a=r.length;a>s;s++)if(i=r[s],n=i.get(d),h){for(e=0;t>e;e++)if(n==c[e]){c[e]=i;break}}else if(n==o){o=l?i:n;break}c[0]&&(o=this._valueIsObservableArray?c:l||!d?c[0]:c[0].get(d))}this.bindings.value.set(o),this._initChange=!1},refresh:function(){var e,i,n,s,a,r,o,d,h;if(!this._initChange){if(e=this.widget,i=e.options,n=i.dataTextField,s=i.dataValueField||n,a=this.bindings.value.get(),r=i.text||"",o=0,h=[],a===t&&(a=null),s)if(a instanceof F){for(d=a.length;d>o;o++)h[o]=a[o].get(s);a=h}else a instanceof S&&(r=a.get(n),a=a.get(s));i.autoBind!==!1||i.cascadeFrom||!e.listView||e.listView.bound()?e.value(a):(n!==s||r||(r=a),r||!a&&0!==a||!i.valuePrimitive?e._preselect(a,r):e.value(a))}this._initChange=!1},destroy:function(){this.widget.unbind(j,this._change)}}),gantt:{dependencies:i("dependencies","dependencies","setDependenciesDataSource")},multiselect:{value:p.extend({init:function(t,i,n){p.fn.init.call(this,t.element[0],i,n),this.widget=t,this._change=e.proxy(this.change,this),this.widget.first(j,this._change),this._initChange=!1},change:function(){var e,i,n,s,a,r,o,d,h,l=this,c=l.bindings[V].get(),u=l.options.valuePrimitive,f=u?l.widget.value():l.widget.dataItems(),g=this.options.dataValueField||this.options.dataTextField;if(f=f.slice(0),l._initChange=!0,c instanceof F){for(e=[],i=f.length,n=0,s=0,a=c[n],r=!1;a!==t;){for(h=!1,s=0;i>s;s++)if(u?r=f[s]==a:(d=f[s],d=d.get?d.get(g):d,r=d==(a.get?a.get(g):a)),r){f.splice(s,1),i-=1,h=!0;break}h?n+=1:(e.push(a),y(c,n,1),o=n),a=c[n]}y(c,c.length,0,f),e.length&&c.trigger("change",{action:"remove",items:e,index:o}),f.length&&c.trigger("change",{action:"add",items:f,index:c.length-1})}else l.bindings[V].set(f);l._initChange=!1},refresh:function(){if(!this._initChange){var e,i,n=this.options,s=this.widget,a=n.dataValueField||n.dataTextField,r=this.bindings.value.get(),o=r,d=0,h=[];if(r===t&&(r=null),a)if(r instanceof F){for(e=r.length;e>d;d++)i=r[d],h[d]=i.get?i.get(a):i;r=h}else r instanceof S&&(r=r.get(a));n.autoBind!==!1||n.valuePrimitive===!0||s._isBound()?s.value(r):s._preselect(o,r)}},destroy:function(){this.widget.unbind(j,this._change)}})},scheduler:{source:i("source","dataSource","setDataSource").extend({dataBound:function(e){var t,i,n,s,a=this.widget,o=e.addedItems||a.items();if(o.length)for(n=e.addedDataItems||a.dataItems(),s=this.bindings.source._parents(),t=0,i=n.length;i>t;t++)r(o[t],n[t],this._ns(e.ns),[n[t]].concat(s))}})}},y=function(e,t,i,n){var s,a,r,o,d;if(n=n||[],i=i||0,s=n.length,a=e.length,r=[].slice.call(e,t+i),o=r.length,s){for(s=t+s,d=0;s>t;t++)e[t]=n[d],d++;e.length=s}else if(i)for(e.length=t,i+=t;i>t;)delete e[--i];if(o){for(o=t+o,d=0;o>t;t++)e[t]=r[d],d++;e.length=o}for(t=e.length;a>t;)delete e[t],t++},_=A.extend({init:function(e,t){this.target=e,this.options=t,this.toDestroy=[]},bind:function(e){var t,i,n,s,a,r,o=this instanceof w,d=this.binders();for(t in e)t==V?i=!0:t==I?n=!0:t!=O||o?t==H?a=!0:t==N?r=!0:this.applyBinding(t,e,d):s=!0;n&&this.applyBinding(I,e,d),i&&this.applyBinding(V,e,d),a&&this.applyBinding(H,e,d),s&&!o&&this.applyBinding(O,e,d),r&&!o&&this.applyBinding(N,e,d)},binders:function(){return D[this.target.nodeName.toLowerCase()]||{}},applyBinding:function(e,t,i){var n,s=i[e]||D[e],a=this.toDestroy,r=t[e];if(s)if(s=new s(this.target,t,this.options),a.push(s),r instanceof g)s.bind(r),a.push(r);else for(n in r)s.bind(r,n),a.push(r[n]);else if("template"!==e)throw Error("The "+e+" binding is not supported by the "+this.target.nodeName.toLowerCase()+" element")},destroy:function(){var e,t,i=this.toDestroy;for(e=0,t=i.length;t>e;e++)i[e].destroy()}}),w=_.extend({binders:function(){return D.widget[this.target.options.name.toLowerCase()]||{}},applyBinding:function(e,t,i){var n,s=i[e]||D.widget[e],a=this.toDestroy,r=t[e];if(!s)throw Error("The "+e+" binding is not supported by the "+this.target.options.name+" widget");if(s=new s(this.target,t,this.target.options),a.push(s),r instanceof g)s.bind(r),a.push(r);else for(n in r)s.bind(r,n),a.push(r[n])}}),x=/[A-Za-z0-9_\-]+:(\{([^}]*)\}|[^,}]+)/g,B=/\s/g,k.unbind=c,k.bind=o,k.data.binders=D,k.data.Binder=p,k.notify=u,k.observable=function(e){return e instanceof S||(e=new S(e)),e},k.observableHierarchy=function(e){function t(e){var i,n;for(i=0;e.length>i;i++)e[i]._initChildren(),n=e[i].children,n.fetch(),e[i].items=n.data(),t(e[i].items)}var i=k.data.HierarchicalDataSource.create(e);return i.fetch(),t(i.data()),i._data._dataSource=i,i._data}}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()});;!function(e,define){define("kendo.editable.min",["kendo.datepicker.min","kendo.numerictextbox.min","kendo.validator.min","kendo.binder.min"],e)}(function(){return function(e,t){function n(t){return t=null!=t?t:"",t.type||e.type(t)||"string"}function a(t){t.find(":input:not(:button, ["+l.attr("role")+"=upload], ["+l.attr("skip")+"], [type=file]), select").each(function(){var t=l.attr("bind"),n=this.getAttribute(t)||"",a="checkbox"===this.type||"radio"===this.type?"checked:":"value:",i=this.name;-1===n.indexOf(a)&&i&&(n+=(n.length?",":"")+a+i,e(this).attr(t,n))})}function i(e){var t,a,i=(e.model.fields||e.model)[e.field],o=n(i),r=i?i.validation:{},d=l.attr("type"),s=l.attr("bind"),u={name:e.field};for(t in r)a=r[t],c(t,k)>=0?u[d]=t:p(a)||(u[t]=v(a)?a.value||t:a),u[l.attr(t+"-msg")]=a.message;return c(o,k)>=0&&(u[d]=o),u[s]=("boolean"===o?"checked:":"value:")+e.field,u}function o(e){var t,n,a,i,o,r;if(e&&e.length)for(r=[],t=0,n=e.length;n>t;t++)a=e[t],o=a.text||a.value||a,i=null==a.value?a.text||a:a.value,r[t]={text:o,value:i};return r}function r(e,t){var n,a,i=e?e.validation||{}:{};for(n in i)a=i[n],v(a)&&a.value&&(a=a.value),p(a)&&(t[n]=a)}var l=window.kendo,d=l.ui,s=d.Widget,u=e.extend,f=l.support.browser.msie&&9>l.support.browser.version,p=l.isFunction,v=e.isPlainObject,c=e.inArray,m=/("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,g='<div class="k-widget k-tooltip k-tooltip-validation" style="margin:0.5em"><span class="k-icon k-warning"> </span>#=message#<div class="k-callout k-callout-n"></div></div>',b="change",k=["url","email","number","date","boolean"],h={number:function(t,n){var a=i(n);e('<input type="text"/>').attr(a).appendTo(t).kendoNumericTextBox({format:n.format}),e("<span "+l.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},date:function(t,n){var a=i(n),o=n.format;o&&(o=l._extractFormat(o)),a[l.attr("format")]=o,e('<input type="text"/>').attr(a).appendTo(t).kendoDatePicker({format:n.format}),e("<span "+l.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},string:function(t,n){var a=i(n);e('<input type="text" class="k-input k-textbox"/>').attr(a).appendTo(t)},"boolean":function(t,n){var a=i(n);e('<input type="checkbox" />').attr(a).appendTo(t)},values:function(t,n){var a=i(n),r=l.stringify(o(n.values));e("<select "+l.attr("text-field")+'="text"'+l.attr("value-field")+'="value"'+l.attr("source")+"='"+(r?r.replace(/\'/g,"&apos;"):r)+"'"+l.attr("role")+'="dropdownlist"/>').attr(a).appendTo(t),e("<span "+l.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)}},y=s.extend({init:function(t,n){var a=this;n.target&&(n.$angular=n.target.options.$angular),s.fn.init.call(a,t,n),a._validateProxy=e.proxy(a._validate,a),a.refresh()},events:[b],options:{name:"Editable",editors:h,clearContainer:!0,errorTemplate:g},editor:function(e,t){var a=this,i=a.options.editors,o=v(e),r=o?e.field:e,d=a.options.model||{},s=o&&e.values,f=s?"values":n(t),p=o&&e.editor,c=p?e.editor:i[f],g=a.element.find("["+l.attr("container-for")+"="+r.replace(m,"\\$1")+"]");c=c?c:i.string,p&&"string"==typeof e.editor&&(c=function(t){t.append(e.editor)}),g=g.length?g:a.element,c(g,u(!0,{},o?e:{field:r},{model:d}))},_validate:function(t){var n,a=this,i=t.value,o=a._validationEventInProgress,r={},d=l.attr("bind"),s=t.field.replace(m,"\\$1"),u=RegExp("(value|checked)\\s*:\\s*"+s+"\\s*(,|$)");r[t.field]=t.value,n=e(":input["+d+'*="'+s+'"]',a.element).filter("["+l.attr("validate")+"!='false']").filter(function(){return u.test(e(this).attr(d))}),n.length>1&&(n=n.filter(function(){var t=e(this);return!t.is(":radio")||t.val()==i}));try{a._validationEventInProgress=!0,(!a.validatable.validateInput(n)||!o&&a.trigger(b,{values:r}))&&t.preventDefault()}finally{a._validationEventInProgress=!1}},end:function(){return this.validatable.validate()},destroy:function(){var e=this;e.angular("cleanup",function(){return{elements:e.element}}),s.fn.destroy.call(e),e.options.model.unbind("set",e._validateProxy),l.unbind(e.element),e.validatable&&e.validatable.destroy(),l.destroy(e.element),e.element.removeData("kendoValidator"),e.element.is("["+l.attr("role")+"=editable]")&&e.element.removeAttr(l.attr("role"))},refresh:function(){var n,i,o,d,s,u,p,c,m=this,g=m.options.fields||[],b=m.options.clearContainer?m.element.empty():m.element,k=m.options.model||{},h={};for(e.isArray(g)||(g=[g]),n=0,i=g.length;i>n;n++)o=g[n],d=v(o),s=d?o.field:o,u=(k.fields||k)[s],r(u,h),m.editor(o,u);if(m.options.target&&m.angular("compile",function(){return{elements:b,data:b.map(function(){return{dataItem:k}})}}),!i){p=k.fields||k;for(s in p)r(p[s],h)}a(b),m.validatable&&m.validatable.destroy(),l.bind(b,m.options.model),m.options.model.unbind("set",m._validateProxy),m.options.model.bind("set",m._validateProxy),m.validatable=new l.ui.Validator(b,{validateOnBlur:!1,errorTemplate:m.options.errorTemplate||t,rules:h}),c=b.find(":kendoFocusable").eq(0).focus(),f&&c.focus()}});d.plugin(y)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});;!function(i,define){define("kendo.window.min",["kendo.draganddrop.min"],i)}(function(){return function(i,t){function e(i){return t!==i}function n(i,t,e){return Math.max(Math.min(parseInt(i,10),e===1/0?e:parseInt(e,10)),parseInt(t,10))}function o(){return!this.type||this.type.toLowerCase().indexOf("script")>=0}function s(i){var t=this;t.owner=i,t._draggable=new d(i.wrapper,{filter:">"+z,group:i.wrapper.id+"-resizing",dragstart:p(t.dragstart,t),drag:p(t.drag,t),dragend:p(t.dragend,t)}),t._draggable.userEvents.bind("press",p(t.addOverlay,t)),t._draggable.userEvents.bind("release",p(t.removeOverlay,t))}function r(i,t){var e=this;e.owner=i,e._draggable=new d(i.wrapper,{filter:t,group:i.wrapper.id+"-moving",dragstart:p(e.dragstart,e),drag:p(e.drag,e),dragend:p(e.dragend,e),dragcancel:p(e.dragcancel,e)}),e._draggable.userEvents.stopPropagation=!1}var a=window.kendo,l=a.ui.Widget,d=a.ui.Draggable,c=i.isPlainObject,h=a._activeElement,p=i.proxy,f=i.extend,u=i.each,g=a.template,m="body",w=".kendoWindow",v=".k-window",_=".k-window-title",k=_+"bar",b=".k-window-content",z=".k-resize-handle",x=".k-overlay",y="k-content-frame",T="k-loading",O="k-state-hover",S="k-state-focused",L="k-window-maximized",M=":visible",I="hidden",W="cursor",H="open",C="activate",P="deactivate",F="close",j="refresh",E="minimize",D="maximize",R="resize",N="resizeEnd",A="dragstart",q="dragend",G="error",U="overflow",K="zIndex",V=".k-window-actions .k-i-minimize,.k-window-actions .k-i-maximize",B=".k-i-pin",Q=".k-i-unpin",J=B+","+Q,X=".k-window-titlebar .k-window-action",Y=".k-window-titlebar .k-i-refresh",Z=a.isLocalUrl,$=l.extend({init:function(n,s){var r,d,h,f,u,g,m,z=this,x={},y=!1,T=s&&s.actions&&!s.actions.length;l.fn.init.call(z,n,s),s=z.options,f=s.position,n=z.element,u=s.content,T&&(s.actions=[]),z.appendTo=i(s.appendTo),u&&!c(u)&&(u=s.content={url:u}),n.find("script").filter(o).remove(),n.parent().is(z.appendTo)||f.top!==t&&f.left!==t||(n.is(M)?(x=n.offset(),y=!0):(d=n.css("visibility"),h=n.css("display"),n.css({visibility:I,display:""}),x=n.offset(),n.css({visibility:d,display:h})),f.top===t&&(f.top=x.top),f.left===t&&(f.left=x.left)),e(s.visible)&&null!==s.visible||(s.visible=n.is(M)),r=z.wrapper=n.closest(v),n.is(".k-content")&&r[0]||(n.addClass("k-window-content k-content"),z._createWindow(n,s),r=z.wrapper=n.closest(v),z._dimensions()),z._position(),s.pinned&&z.pin(!0),u&&z.refresh(u),s.visible&&z.toFront(),g=r.children(b),z._tabindex(g),s.visible&&s.modal&&z._overlay(r.is(M)).css({opacity:.5}),r.on("mouseenter"+w,X,p(z._buttonEnter,z)).on("mouseleave"+w,X,p(z._buttonLeave,z)).on("click"+w,"> "+X,p(z._windowActionHandler,z)),g.on("keydown"+w,p(z._keydown,z)).on("focus"+w,p(z._focus,z)).on("blur"+w,p(z._blur,z)),this._resizable(),this._draggable(),m=n.attr("id"),m&&(m+="_wnd_title",r.children(k).children(_).attr("id",m),g.attr({role:"dialog","aria-labelledby":m})),r.add(r.children(".k-resize-handle,"+k)).on("mousedown"+w,p(z.toFront,z)),z.touchScroller=a.touchScroller(n),z._resizeHandler=p(z._onDocumentResize,z),z._marker=a.guid().substring(0,8),i(window).on("resize"+w+z._marker,z._resizeHandler),s.visible&&(z.trigger(H),z.trigger(C)),a.notify(z)},_buttonEnter:function(t){i(t.currentTarget).addClass(O)},_buttonLeave:function(t){i(t.currentTarget).removeClass(O)},_focus:function(){this.wrapper.addClass(S)},_blur:function(){this.wrapper.removeClass(S)},_dimensions:function(){var i,t,e=this.wrapper,o=this.options,s=o.width,r=o.height,a=o.maxHeight,l=["minWidth","minHeight","maxWidth","maxHeight"];for(this.title(o.title),i=0;l.length>i;i++)t=o[l[i]],t&&t!=1/0&&e.css(l[i],t);a&&a!=1/0&&this.element.css("maxHeight",a),s&&e.width((""+s).indexOf("%")>0?s:n(s,o.minWidth,o.maxWidth)),r&&e.height((""+r).indexOf("%")>0?r:n(r,o.minHeight,o.maxHeight)),o.visible||e.hide()},_position:function(){var i=this.wrapper,t=this.options.position;0===t.top&&(t.top=""+t.top),0===t.left&&(t.left=""+t.left),i.css({top:t.top||"",left:t.left||""})},_animationOptions:function(i){var t=this.options.animation,e={open:{effects:{}},close:{hide:!0,effects:{}}};return t&&t[i]||e[i]},_resize:function(){a.resize(this.element.children())},_resizable:function(){var t=this.options.resizable,e=this.wrapper;this.resizing&&(e.off("dblclick"+w).children(z).remove(),this.resizing.destroy(),this.resizing=null),t&&(e.on("dblclick"+w,k,p(function(t){i(t.target).closest(".k-window-action").length||this.toggleMaximization()},this)),u("n e s w se sw ne nw".split(" "),function(i,t){e.append(ii.resizeHandle(t))}),this.resizing=new s(this)),e=null},_draggable:function(){var i=this.options.draggable;this.dragging&&(this.dragging.destroy(),this.dragging=null),i&&(this.dragging=new r(this,i.dragHandle||k))},_actions:function(){var t=this.options.actions,e=this.wrapper.children(k),n=e.find(".k-window-actions");t=i.map(t,function(i){return{name:i}}),n.html(a.render(ii.action,t))},setOptions:function(i){var e,n;l.fn.setOptions.call(this,i),e=this.options.scrollable!==!1,this.restore(),this._dimensions(),this._position(),this._resizable(),this._draggable(),this._actions(),t!==i.modal&&(n=this.options.visible!==!1,this._overlay(i.modal&&n)),this.element.css(U,e?"":"hidden")},events:[H,C,P,F,E,D,j,R,N,A,q,G],options:{name:"Window",animation:{open:{effects:{zoom:{direction:"in"},fade:{direction:"in"}},duration:350},close:{effects:{zoom:{direction:"out",properties:{scale:.7}},fade:{direction:"out"}},duration:350,hide:!0}},title:"",actions:["Close"],autoFocus:!0,modal:!1,resizable:!0,draggable:!0,minWidth:90,minHeight:50,maxWidth:1/0,maxHeight:1/0,pinned:!1,scrollable:!0,position:{},content:null,visible:null,height:null,width:null,appendTo:"body"},_closable:function(){return i.inArray("close",i.map(this.options.actions,function(i){return i.toLowerCase()}))>-1},_keydown:function(i){var t,e,o,s,r,l,d=this,c=d.options,h=a.keys,p=i.keyCode,f=d.wrapper,u=10,g=d.options.isMaximized;i.target!=i.currentTarget||d._closing||(p==h.ESC&&d._closable()&&d._close(!1),!c.draggable||i.ctrlKey||g||(t=a.getOffset(f),p==h.UP?e=f.css("top",t.top-u):p==h.DOWN?e=f.css("top",t.top+u):p==h.LEFT?e=f.css("left",t.left-u):p==h.RIGHT&&(e=f.css("left",t.left+u))),c.resizable&&i.ctrlKey&&!g&&(p==h.UP?(e=!0,s=f.height()-u):p==h.DOWN&&(e=!0,s=f.height()+u),p==h.LEFT?(e=!0,o=f.width()-u):p==h.RIGHT&&(e=!0,o=f.width()+u),e&&(r=n(o,c.minWidth,c.maxWidth),l=n(s,c.minHeight,c.maxHeight),isNaN(r)||(f.width(r),d.options.width=r+"px"),isNaN(l)||(f.height(l),d.options.height=l+"px"),d.resize())),e&&i.preventDefault())},_overlay:function(t){var e=this.appendTo.children(x),n=this.wrapper;return e.length||(e=i("<div class='k-overlay' />")),e.insertBefore(n[0]).toggle(t).css(K,parseInt(n.css(K),10)-1),e},_actionForIcon:function(i){var t=/\bk-i-\w+\b/.exec(i[0].className)[0];return{"k-i-close":"_close","k-i-maximize":"maximize","k-i-minimize":"minimize","k-i-restore":"restore","k-i-refresh":"refresh","k-i-pin":"pin","k-i-unpin":"unpin"}[t]},_windowActionHandler:function(e){var n,o;if(!this._closing)return n=i(e.target).closest(".k-window-action").find(".k-icon"),o=this._actionForIcon(n),o?(e.preventDefault(),this[o](),!1):t},_modals:function(){var t=this,e=i(v).filter(function(){var e=i(this),n=t._object(e),o=n&&n.options;return o&&o.modal&&o.visible&&o.appendTo===t.options.appendTo&&e.is(M)}).sort(function(t,e){return+i(t).css("zIndex")-+i(e).css("zIndex")});return t=null,e},_object:function(i){var e=i.children(b),n=a.widgetInstance(e);return n instanceof $?n:t},center:function(){var t,e,n=this,o=n.options.position,s=n.wrapper,r=i(window),a=0,l=0;return n.options.isMaximized?n:(n.options.pinned||(a=r.scrollTop(),l=r.scrollLeft()),e=l+Math.max(0,(r.width()-s.width())/2),t=a+Math.max(0,(r.height()-s.height()-parseInt(s.css("paddingTop"),10))/2),s.css({left:e,top:t}),o.top=t,o.left=e,n)},title:function(i){var t,e=this,n=e.wrapper,o=e.options,s=n.children(k),r=s.children(_);return arguments.length?(i===!1?(n.addClass("k-window-titleless"),s.remove()):(s.length?r.html(i):(n.prepend(ii.titlebar(o)),e._actions(),s=n.children(k)),t=s.outerHeight(),n.css("padding-top",t),s.css("margin-top",-t)),e.options.title=i,e):r.html()},content:function(i,t){var n=this.wrapper.children(b),o=n.children(".km-scroll-container");return n=o[0]?o:n,e(i)?(this.angular("cleanup",function(){return{elements:n.children()}}),a.destroy(this.element.children()),n.empty().html(i),this.angular("compile",function(){var i,e=[];for(i=n.length;--i>=0;)e.push({dataItem:t});return{elements:n.children(),data:e}}),this):n.html()},open:function(){var t,e,n=this,o=n.wrapper,s=n.options,r=this._animationOptions("open"),l=o.children(b),d=i(document);return n.trigger(H)||(n._closing&&o.kendoStop(!0,!0),n._closing=!1,n.toFront(),s.autoFocus&&n.element.focus(),s.visible=!0,s.modal&&(t=n._overlay(!1),t.kendoStop(!0,!0),r.duration&&a.effects.Fade?(e=a.fx(t).fadeIn(),e.duration(r.duration||0),e.endValue(.5),e.play()):t.css("opacity",.5),t.show()),o.is(M)||(l.css(U,I),o.show().kendoStop().kendoAnimate({effects:r.effects,duration:r.duration,complete:p(this._activate,this)}))),s.isMaximized&&(n._documentScrollTop=d.scrollTop(),n._documentScrollLeft=d.scrollLeft(),i("html, body").css(U,I)),n},_activate:function(){var i=this.options.scrollable!==!1;this.options.autoFocus&&this.element.focus(),this.element.css(U,i?"":"hidden"),this.trigger(C)},_removeOverlay:function(e){var n,o=this._modals(),s=this.options,r=s.modal&&!o.length,l=s.modal?this._overlay(!0):i(t),d=this._animationOptions("close");r?!e&&d.duration&&a.effects.Fade?(n=a.fx(l).fadeOut(),n.duration(d.duration||0),n.startValue(.5),n.play()):this._overlay(!1).remove():o.length&&this._object(o.last())._overlay(!0)},_close:function(t){var e=this,n=e.wrapper,o=e.options,s=this._animationOptions("open"),r=this._animationOptions("close"),a=i(document);if(n.is(M)&&!e.trigger(F,{userTriggered:!t})){if(e._closing)return;e._closing=!0,o.visible=!1,i(v).each(function(t,e){var o=i(e).children(b);e!=n&&o.find("> ."+y).length>0&&o.children(x).remove()}),this._removeOverlay(),n.kendoStop().kendoAnimate({effects:r.effects||s.effects,reverse:r.reverse===!0,duration:r.duration,complete:p(this._deactivate,this)})}e.options.isMaximized&&(i("html, body").css(U,""),e._documentScrollTop&&e._documentScrollTop>0&&a.scrollTop(e._documentScrollTop),e._documentScrollLeft&&e._documentScrollLeft>0&&a.scrollLeft(e._documentScrollLeft))},_deactivate:function(){var i,t=this;t.wrapper.hide().css("opacity",""),t.trigger(P),t.options.modal&&(i=t._object(t._modals().last()),i&&i.toFront())},close:function(){return this._close(!0),this},_actionable:function(t){return i(t).is(X+","+X+" .k-icon,:input,a")},_shouldFocus:function(t){var e=h(),n=this.element;return this.options.autoFocus&&!i(e).is(n)&&!this._actionable(t)&&(!n.find(e).length||!n.find(t).length)},toFront:function(t){var e,n,o=this,s=o.wrapper,r=s[0],a=+s.css(K),l=a,d=t&&t.target||null;return i(v).each(function(t,e){var n=i(e),o=n.css(K),s=n.children(b);isNaN(o)||(a=Math.max(+o,a)),e!=r&&s.find("> ."+y).length>0&&s.append(ii.overlay)}),(!s[0].style.zIndex||a>l)&&s.css(K,a+2),o.element.find("> .k-overlay").remove(),o._shouldFocus(d)&&(o.element.focus(),e=i(window).scrollTop(),n=parseInt(s.position().top,10),n>0&&e>n&&(e>0?i(window).scrollTop(n):s.css("top",e))),s=null,o},toggleMaximization:function(){return this._closing?this:this[this.options.isMaximized?"restore":"maximize"]()},restore:function(){var t=this,e=t.options,n=e.minHeight,o=t.restoreOptions,s=i(document);return e.isMaximized||e.isMinimized?(n&&n!=1/0&&t.wrapper.css("min-height",n),t.wrapper.css({position:e.pinned?"fixed":"absolute",left:o.left,top:o.top,width:o.width,height:o.height}).removeClass(L).find(".k-window-content,.k-resize-handle").show().end().find(".k-window-titlebar .k-i-restore").parent().remove().end().end().find(V).parent().show().end().end().find(J).parent().show(),t.options.width=o.width,t.options.height=o.height,i("html, body").css(U,""),this._documentScrollTop&&this._documentScrollTop>0&&s.scrollTop(this._documentScrollTop),this._documentScrollLeft&&this._documentScrollLeft>0&&s.scrollLeft(this._documentScrollLeft),e.isMaximized=e.isMinimized=!1,t.resize(),t):t},_sizingAction:function(i,t){var e=this,n=e.wrapper,o=n[0].style,s=e.options;return s.isMaximized||s.isMinimized?e:(e.restoreOptions={width:o.width,height:o.height},n.children(z).hide().end().children(k).find(V).parent().hide().eq(0).before(ii.action({name:"Restore"})),t.call(e),e.wrapper.children(k).find(J).parent().toggle("maximize"!==i),e.trigger(i),e)},maximize:function(){this._sizingAction("maximize",function(){var t=this,e=t.wrapper,n=e.position(),o=i(document);f(t.restoreOptions,{left:n.left,top:n.top}),e.css({left:0,top:0,position:"fixed"}).addClass(L),this._documentScrollTop=o.scrollTop(),this._documentScrollLeft=o.scrollLeft(),i("html, body").css(U,I),t.options.isMaximized=!0,t._onDocumentResize()})},minimize:function(){this._sizingAction("minimize",function(){var i=this;i.wrapper.css({height:"",minHeight:""}),i.element.hide(),i.options.isMinimized=!0})},pin:function(t){var e=this,n=i(window),o=e.wrapper,s=parseInt(o.css("top"),10),r=parseInt(o.css("left"),10);(t||!e.options.pinned&&!e.options.isMaximized)&&(o.css({position:"fixed",top:s-n.scrollTop(),left:r-n.scrollLeft()}),o.children(k).find(B).addClass("k-i-unpin").removeClass("k-i-pin"),e.options.pinned=!0)},unpin:function(){var t=this,e=i(window),n=t.wrapper,o=parseInt(n.css("top"),10),s=parseInt(n.css("left"),10);t.options.pinned&&!t.options.isMaximized&&(n.css({position:"",top:o+e.scrollTop(),left:s+e.scrollLeft()}),n.children(k).find(Q).addClass("k-i-pin").removeClass("k-i-unpin"),t.options.pinned=!1)},_onDocumentResize:function(){var t,e,n=this,o=n.wrapper,s=i(window),r=a.support.zoomLevel();n.options.isMaximized&&(t=s.width()/r,e=s.height()/r-parseInt(o.css("padding-top"),10),o.css({width:t,height:e}),n.options.width=t,n.options.height=e,n.resize())},refresh:function(t){var n,o,s,r=this,a=r.options,l=i(r.element);return c(t)||(t={url:t}),t=f({},a.content,t),o=e(a.iframe)?a.iframe:t.iframe,s=t.url,s?(e(o)||(o=!Z(s)),o?(n=l.find("."+y)[0],n?n.src=s||n.src:l.html(ii.contentFrame(f({},a,{content:t}))),l.find("."+y).unbind("load"+w).on("load"+w,p(this._triggerRefresh,this))):r._ajaxRequest(t)):(t.template&&r.content(g(t.template)({})),r.trigger(j)),l.toggleClass("k-window-iframecontent",!!o),r},_triggerRefresh:function(){this.trigger(j)},_ajaxComplete:function(){clearTimeout(this._loadingIconTimeout),this.wrapper.find(Y).removeClass(T)},_ajaxError:function(i,t){this.trigger(G,{status:t,xhr:i})},_ajaxSuccess:function(i){return function(t){var e=t;i&&(e=g(i)(t||{})),this.content(e,t),this.element.prop("scrollTop",0),this.trigger(j)}},_showLoading:function(){this.wrapper.find(Y).addClass(T)},_ajaxRequest:function(t){this._loadingIconTimeout=setTimeout(p(this._showLoading,this),100),i.ajax(f({type:"GET",dataType:"html",cache:!1,error:p(this._ajaxError,this),complete:p(this._ajaxComplete,this),success:p(this._ajaxSuccess(t.template),this)},t))},_destroy:function(){this.resizing&&this.resizing.destroy(),this.dragging&&this.dragging.destroy(),this.wrapper.off(w).children(b).off(w).end().find(".k-resize-handle,.k-window-titlebar").off(w),i(window).off("resize"+w+this._marker),clearTimeout(this._loadingIconTimeout),l.fn.destroy.call(this),this.unbind(t),a.destroy(this.wrapper),this._removeOverlay(!0)},destroy:function(){this._destroy(),this.wrapper.empty().remove(),this.wrapper=this.appendTo=this.element=i()},_createWindow:function(){var t,e,n=this.element,o=this.options,s=a.support.isRtl(n);o.scrollable===!1&&n.attr("style","overflow:hidden;"),e=i(ii.wrapper(o)),t=n.find("iframe:not(.k-content)").map(function(){var i=this.getAttribute("src");return this.src="",i}),e.toggleClass("k-rtl",s).appendTo(this.appendTo).append(n).find("iframe:not(.k-content)").each(function(i){this.src=t[i]}),e.find(".k-window-title").css(s?"left":"right",e.find(".k-window-actions").outerWidth()+10),n.css("visibility","").show(),n.find("[data-role=editor]").each(function(){var t=i(this).data("kendoEditor");t&&t.refresh()}),e=n=null}}),ii={wrapper:g("<div class='k-widget k-window' />"),action:g("<a role='button' href='\\#' class='k-window-action k-link'><span role='presentation' class='k-icon k-i-#= name.toLowerCase() #'>#= name #</span></a>"),titlebar:g("<div class='k-window-titlebar k-header'>&nbsp;<span class='k-window-title'>#= title #</span><div class='k-window-actions' /></div>"),overlay:"<div class='k-overlay' />",contentFrame:g("<iframe frameborder='0' title='#= title #' class='"+y+"' src='#= content.url #'>This page requires frames in order to show content</iframe>"),resizeHandle:g("<div class='k-resize-handle k-resize-#= data #'></div>")};s.prototype={addOverlay:function(){this.owner.wrapper.append(ii.overlay)},removeOverlay:function(){this.owner.wrapper.find(x).remove()},dragstart:function(t){var e=this,n=e.owner,o=n.wrapper;e.elementPadding=parseInt(o.css("padding-top"),10),e.initialPosition=a.getOffset(o,"position"),e.resizeDirection=t.currentTarget.prop("className").replace("k-resize-handle k-resize-",""),e.initialSize={width:o.width(),height:o.height()},e.containerOffset=a.getOffset(n.appendTo,"position"),o.children(z).not(t.currentTarget).hide(),i(m).css(W,t.currentTarget.css(W))},drag:function(i){var t,e,o,s,r=this,a=r.owner,l=a.wrapper,d=a.options,c=r.resizeDirection,h=r.containerOffset,p=r.initialPosition,f=r.initialSize,u=Math.max(i.x.location,h.left),g=Math.max(i.y.location,h.top);c.indexOf("e")>=0?(t=u-p.left,l.width(n(t,d.minWidth,d.maxWidth))):c.indexOf("w")>=0&&(s=p.left+f.width,t=n(s-u,d.minWidth,d.maxWidth),l.css({left:s-t-h.left,width:t})),c.indexOf("s")>=0?(e=g-p.top-r.elementPadding,l.height(n(e,d.minHeight,d.maxHeight))):c.indexOf("n")>=0&&(o=p.top+f.height,e=n(o-g,d.minHeight,d.maxHeight),l.css({top:o-e-h.top,height:e})),t&&(a.options.width=t+"px"),e&&(a.options.height=e+"px"),a.resize()},dragend:function(t){var e=this,n=e.owner,o=n.wrapper;return o.children(z).not(t.currentTarget).show(),i(m).css(W,""),n.touchScroller&&n.touchScroller.reset(),27==t.keyCode&&o.css(e.initialPosition).css(e.initialSize),n.trigger(N),!1},destroy:function(){this._draggable&&this._draggable.destroy(),this._draggable=this.owner=null}},r.prototype={dragstart:function(t){var e=this.owner,n=e.element,o=n.find(".k-window-actions"),s=a.getOffset(e.appendTo);e.trigger(A),e.initialWindowPosition=a.getOffset(e.wrapper,"position"),e.startPosition={left:t.x.client-e.initialWindowPosition.left,top:t.y.client-e.initialWindowPosition.top},e.minLeftPosition=o.length>0?o.outerWidth()+parseInt(o.css("right"),10)-n.outerWidth():20-n.outerWidth(),e.minLeftPosition-=s.left,e.minTopPosition=-s.top,e.wrapper.append(ii.overlay).children(z).hide(),i(m).css(W,t.currentTarget.css(W))},drag:function(t){var e=this.owner,n=e.options.position,o=Math.max(t.y.client-e.startPosition.top,e.minTopPosition),s=Math.max(t.x.client-e.startPosition.left,e.minLeftPosition),r={left:s,top:o};i(e.wrapper).css(r),n.top=o,n.left=s},_finishDrag:function(){var t=this.owner;t.wrapper.children(z).toggle(!t.options.isMinimized).end().find(x).remove(),i(m).css(W,"")},dragcancel:function(i){this._finishDrag(),i.currentTarget.closest(v).css(this.owner.initialWindowPosition)},dragend:function(){return this._finishDrag(),this.owner.trigger(q),!1},destroy:function(){this._draggable&&this._draggable.destroy(),this._draggable=this.owner=null}},a.ui.plugin($)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(i,t,e){(e||t)()});;!function(e,define){define("kendo.filtermenu.min",["kendo.datepicker.min","kendo.numerictextbox.min","kendo.dropdownlist.min","kendo.binder.min"],e)}(function(){return function(e,t){function i(t,s){t.filters&&(t.filters=e.grep(t.filters,function(e){return i(e,s),e.filters?e.filters.length:e.field!=s}))}function s(e){var t,i,s,l,a,n;if(e&&e.length)for(n=[],t=0,i=e.length;i>t;t++)s=e[t],a=""!==s.text?s.text||s.value||s:s.text,l=null==s.value?s.text||s:s.value,n[t]={text:a,value:l};return n}function l(t,i){return e.grep(t,function(t){return t.filters?(t.filters=e.grep(t.filters,function(e){return e.field!=i}),t.filters.length):t.field!=i})}function a(t,i){t.filters&&(t.filters=e.grep(t.filters,function(e){return a(e,i),e.filters?e.filters.length:e.field==i&&"eq"==e.operator}))}function n(i){return"and"==i.logic&&i.filters.length>1?[]:i.filters?e.map(i.filters,function(e){return n(e)}):null!==i.value&&i.value!==t?[i.value]:[]}function r(e,i){for(var s,l,a=c.getter(i,!0),n=[],r=0,o={};e.length>r;)s=e[r++],l=a(s),l===t||null===l||o.hasOwnProperty(l)||(n.push(s),o[l]=!0);return n}function o(e,t){return function(i){var s=e(i);return r(s,t)}}var c=window.kendo,u=c.ui,d=e.proxy,f="kendoPopup",h="init",p="refresh",m="change",k=".kendoFilterMenu",v="Is equal to",g="Is not equal to",b={number:"numerictextbox",date:"datepicker"},_={string:"text",number:"number",date:"date"},y=c.isFunction,x=u.Widget,S='<div><div class="k-filter-help-text">#=messages.info#</div><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label><div><button type="submit" class="k-button k-primary">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',w='<div><div class="k-filter-help-text">#=messages.info#</div><select data-#=ns#bind="value: filters[0].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[0].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#" data-#=ns#value-primitive="true"></select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}##if(extra){#<select class="k-filter-and" data-#=ns#bind="value: logic" data-#=ns#role="dropdownlist"><option value="and">#=messages.and#</option><option value="or">#=messages.or#</option></select><select data-#=ns#bind="value: filters[1].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[1].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#" data-#=ns#value-primitive="true"></select>#}else{#<input data-#=ns#bind="value: filters[1].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""#/>#}##}#<div><button type="submit" class="k-button k-primary">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',C='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=title#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[0].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[0].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#if(extra){#</ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="and" />#=messages.and#</label></li><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="or" />#=messages.or#</label></li></ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[1].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[1].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[1].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#}#</ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></div></form></div>',T='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=title#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label></li><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label></li></ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></form></div>',F=x.extend({init:function(t,i){var s,l,a,n,r=this,o="string";x.fn.init.call(r,t,i),s=r.operators=i.operators||{},t=r.element,i=r.options,i.appendToElement||(a=t.addClass("k-with-icon k-filterable").find(".k-grid-filter"),a[0]||(a=t.prepend('<a class="k-grid-filter" href="#"><span class="k-icon k-filter">'+i.messages.filter+"</span></a>").find(".k-grid-filter")),a.attr("tabindex",-1).on("click"+k,d(r._click,r))),r.link=a||e(),r.dataSource=A.create(i.dataSource),r.field=i.field||t.attr(c.attr("field")),r.model=r.dataSource.reader.model,r._parse=function(e){return null!=e?e+"":e},r.model&&r.model.fields&&(n=r.model.fields[r.field],n&&(o=n.type||"string",n.parse&&(r._parse=d(n.parse,n)))),i.values&&(o="enums"),r.type=o,s=s[o]||i.operators[o];for(l in s)break;r._defaultFilter=function(){return{field:r.field,operator:l||"eq",value:""}},r._refreshHandler=d(r.refresh,r),r.dataSource.bind(m,r._refreshHandler),i.appendToElement?r._init():r.refresh()},_init:function(){var t,i=this,s=i.options.ui,l=y(s);i.pane=i.options.pane,i.pane&&(i._isMobile=!0),l||(t=s||b[i.type]),i._isMobile?i._createMobileForm(t):i._createForm(t),i.form.on("submit"+k,d(i._submit,i)).on("reset"+k,d(i._reset,i)),l&&i.form.find(".k-textbox").removeClass("k-textbox").each(function(){s(e(this))}),i.form.find("["+c.attr("role")+"=numerictextbox]").removeClass("k-textbox").end().find("["+c.attr("role")+"=datetimepicker]").removeClass("k-textbox").end().find("["+c.attr("role")+"=timepicker]").removeClass("k-textbox").end().find("["+c.attr("role")+"=datepicker]").removeClass("k-textbox"),i.refresh(),i.trigger(h,{field:i.field,container:i.form}),c.cycleForm(i.form)},_createForm:function(t){var i=this,l=i.options,a=i.operators||{},n=i.type;a=a[n]||l.operators[n],i.form=e('<form class="k-filter-menu"/>').html(c.template("boolean"===n?S:w)({field:i.field,format:l.format,ns:c.ns,messages:l.messages,extra:l.extra,operators:a,type:n,role:t,values:s(l.values)})),l.appendToElement?(i.element.append(i.form),i.popup=i.element.closest(".k-popup").data(f)):i.popup=i.form[f]({anchor:i.link,open:d(i._open,i),activate:d(i._activate,i),close:function(){i.options.closeCallback&&i.options.closeCallback(i.element)}}).data(f),i.form.on("keydown"+k,d(i._keydown,i))},_createMobileForm:function(t){var i=this,l=i.options,a=i.operators||{},n=i.type;a=a[n]||l.operators[n],i.form=e("<div />").html(c.template("boolean"===n?T:C)({field:i.field,title:l.title||i.field,format:l.format,ns:c.ns,messages:l.messages,extra:l.extra,operators:a,type:n,role:t,useRole:!c.support.input.date&&"date"===n||"number"===n,inputType:_[n],values:s(l.values)})),i.view=i.pane.append(i.form.html()),i.form=i.view.element.find("form"),i.view.element.on("click",".k-submit",function(e){i.form.submit(),e.preventDefault()}).on("click",".k-cancel",function(e){i._closeForm(),e.preventDefault()})},refresh:function(){var e=this,t=e.dataSource.filter()||{filters:[],logic:"and"};e.filterModel=c.observable({logic:"and",filters:[e._defaultFilter(),e._defaultFilter()]}),e.form&&c.bind(e.form.children().first(),e.filterModel),e._bind(t)?e.link.addClass("k-state-active"):e.link.removeClass("k-state-active")},destroy:function(){var e=this;x.fn.destroy.call(e),e.form&&(c.unbind(e.form),c.destroy(e.form),e.form.unbind(k),e.popup&&(e.popup.destroy(),e.popup=null),e.form=null),e.view&&(e.view.purge(),e.view=null),e.link.unbind(k),e._refreshHandler&&(e.dataSource.unbind(m,e._refreshHandler),e.dataSource=null),e.element=e.link=e._refreshHandler=e.filterModel=null},_bind:function(e){var t,i,s,l,a=this,n=e.filters,r=!1,o=0,c=a.filterModel;for(t=0,i=n.length;i>t;t++)l=n[t],l.field==a.field?(c.set("logic",e.logic),s=c.filters[o],s||(c.filters.push({field:a.field}),s=c.filters[o]),s.set("value",a._parse(l.value)),s.set("operator",l.operator),o++,r=!0):l.filters&&(r=r||a._bind(l));return r},_stripFilters:function(t){return e.grep(t,function(e){return""!==e.value&&null!=e.value||"isnull"===e.operator||"isnotnull"===e.operator||"isempty"===e.operator||"isnotempty"===e.operator})},_merge:function(e){var t,s,l,a=this,n=e.logic||"and",r=this._stripFilters(e.filters),o=a.dataSource.filter()||{filters:[],logic:"and"};for(i(o,a.field),s=0,l=r.length;l>s;s++)t=r[s],t.value=a._parse(t.value);return r.length&&(o.filters.length?(e.filters=r,"and"!==o.logic&&(o.filters=[{logic:o.logic,filters:o.filters}],o.logic="and"),o.filters.push(r.length>1?e:r[0])):(o.filters=r,o.logic=n)),o},filter:function(e){e=this._merge(e),e.filters.length&&this.dataSource.filter(e)},clear:function(){var t=this,i=t.dataSource.filter()||{filters:[]};i.filters=e.grep(i.filters,function(e){return e.filters?(e.filters=l(e.filters,t.field),e.filters.length):e.field!=t.field}),i.filters.length||(i=null),t.dataSource.filter(i)},_submit:function(e){e.preventDefault(),e.stopPropagation(),this.filter(this.filterModel.toJSON()),this._closeForm()},_reset:function(){this.clear(),this._closeForm()},_closeForm:function(){this._isMobile?this.pane.navigate("",this.options.animations.right):this.popup.close()},_click:function(e){e.preventDefault(),e.stopPropagation(),this.popup||this.pane||this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle()},_open:function(){var t;e(".k-filter-menu").not(this.form).each(function(){t=e(this).data(f),t&&t.close()})},_activate:function(){this.form.find(":kendoFocusable:first").focus()},_keydown:function(e){e.keyCode==c.keys.ESC&&this.popup.close()},events:[h],options:{name:"FilterMenu",extra:!0,appendToElement:!1,type:"string",operators:{string:{eq:v,neq:g,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with",isnull:"Is null",isnotnull:"Is not null",isempty:"Is empty",isnotempty:"Is not empty"},number:{eq:v,neq:g,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than",isnull:"Is null",isnotnull:"Is not null"},date:{eq:v,neq:g,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before",isnull:"Is null",isnotnull:"Is not null"},enums:{eq:v,neq:g,isnull:"Is null",isnotnull:"Is not null"}},messages:{info:"Show items with value that:",isTrue:"is true",isFalse:"is false",filter:"Filter",clear:"Clear",and:"And",or:"Or",selectValue:"-Select value-",operator:"Operator",value:"Value",cancel:"Cancel"},animations:{left:"slide",right:"slide:right"}}}),H=".kendoFilterMultiCheck",A=c.data.DataSource,q=x.extend({init:function(t,i){var s,l;x.fn.init.call(this,t,i),i=this.options,this.element=e(t),s=this.field=this.options.field||this.element.attr(c.attr("field")),l=i.checkSource,this._foreignKeyValues()?(this.checkSource=A.create(i.values),this.checkSource.fetch()):i.forceUnique?(l=i.dataSource.options,delete l.pageSize,this.checkSource=A.create(l),this.checkSource.reader.data=o(this.checkSource.reader.data,this.field)):this.checkSource=A.create(l),this.dataSource=i.dataSource,this.model=this.dataSource.reader.model,this._parse=function(e){return e+""},this.model&&this.model.fields&&(s=this.model.fields[this.field],s&&(s.parse&&(this._parse=d(s.parse,s)),this.type=s.type||"string")),i.appendToElement?this._init():this._createLink(),this._refreshHandler=d(this.refresh,this),this.dataSource.bind(m,this._refreshHandler)},_createLink:function(){var e=this.element,t=e.addClass("k-with-icon k-filterable").find(".k-grid-filter");t[0]||(t=e.prepend('<a class="k-grid-filter" href="#"><span class="k-icon k-filter"/></a>').find(".k-grid-filter")),this._link=t.attr("tabindex",-1).on("click"+k,d(this._click,this))},_init:function(){var e=this,t=this.options.forceUnique,i=this.options;this.pane=i.pane,this.pane&&(this._isMobile=!0),this._createForm(),this._foreignKeyValues()?this.refresh():t&&!this.checkSource.options.serverPaging&&this.dataSource.data().length?(this.checkSource.data(r(this.dataSource.data(),this.field)),this.refresh()):(this._attachProgress(),this.checkSource.fetch(function(){e.refresh.call(e)})),this.options.forceUnique||(this.checkChangeHandler=function(){e.container.empty(),e.refresh()},this.checkSource.bind(m,this.checkChangeHandler)),this.form.on("keydown"+H,d(this._keydown,this)).on("submit"+H,d(this._filter,this)).on("reset"+H,d(this._reset,this)),this.trigger(h,{field:this.field,container:this.form})},_attachProgress:function(){var e=this;this._progressHandler=function(){u.progress(e.container,!0)},this._progressHideHandler=function(){u.progress(e.container,!1)},this.checkSource.bind("progress",this._progressHandler).bind("change",this._progressHideHandler)},_input:function(){var e=this;e._clearTypingTimeout(),e._typingTimeout=setTimeout(function(){e.search()},100)},_clearTypingTimeout:function(){this._typingTimeout&&(clearTimeout(this._typingTimeout),this._typingTimeout=null)},search:function(){var e,t,i,s=this.options.ignoreCase,l=this.searchTextBox[0].value,a=this.container.find("label");for(s&&(l=l.toLowerCase()),e=this.options.checkAll?1:0;a.length>e;e++)t=a[e],i=t.textContent||t.innerText,s&&(i=i.toLowerCase()),t.style.display=i.indexOf(l)>=0?"":"none"},_createForm:function(){var t,i,s=this.options,l="";!this._isMobile&&s.search&&(l+="<div class='k-textbox k-space-right'><input placeholder='"+s.messages.search+"'/><span class='k-icon k-font-icon k-i-search' /></div>"),l+="<ul class='k-reset k-multicheck-wrap'></ul><button type='submit' class='k-button k-primary'>"+s.messages.filter+"</button>",l+="<button type='reset' class='k-button'>"+s.messages.clear+"</button>",this.form=e('<form class="k-filter-menu"/>').html(l),this.container=this.form.find(".k-multicheck-wrap"),s.search&&(this.searchTextBox=this.form.find(".k-textbox > input"),this.searchTextBox.on("input",d(this._input,this))),this._isMobile?(this.view=this.pane.append(this.form.addClass("k-mobile-list").wrap("<div/>").parent().html()),t=this.view.element,this.form=t.find("form"),this.container=t.find(".k-multicheck-wrap"),i=this,t.on("click",".k-primary",function(e){i.form.submit(),e.preventDefault()}).on("click","[type=reset]",function(e){i._reset(),e.preventDefault()})):s.appendToElement?(this.popup=this.element.closest(".k-popup").data(f),this.element.append(this.form)):this.popup=this.form.kendoPopup({anchor:this._link}).data(f)},createCheckAllItem:function(){var t=this.options,i=c.template(t.itemTemplate({field:"all",mobile:this._isMobile})),s=e(i({all:t.messages.checkAll}));this.container.prepend(s),this.checkBoxAll=s.find(":checkbox").eq(0).addClass("k-check-all"),this.checkAllHandler=d(this.checkAll,this),this.checkBoxAll.on(m+H,this.checkAllHandler)},updateCheckAllState:function(){if(this.checkBoxAll){var e=this.container.find(":checkbox:not(.k-check-all)").length==this.container.find(":checked:not(.k-check-all)").length;this.checkBoxAll.prop("checked",e)}},refresh:function(e){var t=this.options.forceUnique,i=this.dataSource,s=this.getFilterArray();this._link&&this._link.toggleClass("k-state-active",0!==s.length),this.form&&(e&&t&&e.sender===i&&!i.options.serverPaging&&("itemchange"==e.action||"add"==e.action||"remove"==e.action||i.options.autoSync&&"sync"===e.action)&&!this._foreignKeyValues()&&(this.checkSource.data(r(this.dataSource.data(),this.field)),this.container.empty()),this.container.is(":empty")&&this.createCheckBoxes(),this.checkValues(s),this.trigger(p))},getFilterArray:function(){var t,i=e.extend(!0,{},{filters:[],logic:"and"},this.dataSource.filter());return a(i,this.field),t=n(i)},createCheckBoxes:function(){var e,t,i,s=this.options,l={field:this.field,format:s.format,mobile:this._isMobile,type:this.type};this.options.forceUnique?this._foreignKeyValues()?(e=this.checkSource.data(),l.valueField="value",l.field="text"):e=this.checkSource.data():e=this.checkSource.view(),t=c.template(s.itemTemplate(l)),i=c.render(t,e),s.checkAll&&(this.createCheckAllItem(),this.container.on(m+H,":checkbox",d(this.updateCheckAllState,this))),this.container.append(i)},checkAll:function(){var e=this.checkBoxAll.is(":checked");this.container.find(":checkbox").prop("checked",e)},checkValues:function(t){var i=this;e(e.grep(this.container.find(":checkbox").prop("checked",!1),function(s){var l,a,n=!1;if(!e(s).is(".k-check-all"))for(l=i._parse(e(s).val()),a=0;t.length>a;a++)if(n="date"==i.type?t[a].getTime()==l.getTime():t[a]==l)return n})).prop("checked",!0),this.updateCheckAllState()},_filter:function(t){var i,s;t.preventDefault(),t.stopPropagation(),i={logic:"or"},s=this,i.filters=e.map(this.form.find(":checkbox:checked:not(.k-check-all)"),function(t){return{value:e(t).val(),operator:"eq",field:s.field}}),i=this._merge(i),i.filters.length&&this.dataSource.filter(i),this._closeForm()},_stripFilters:function(t){return e.grep(t,function(e){return null!=e.value})},_foreignKeyValues:function(){var e=this.options;return e.values&&!e.checkSource},destroy:function(){var e=this;x.fn.destroy.call(e),e.form&&(c.unbind(e.form),c.destroy(e.form),e.form.unbind(H),e.popup&&(e.popup.destroy(),e.popup=null),e.form=null,e.container&&(e.container.unbind(H),e.container=null),e.checkBoxAll&&e.checkBoxAll.unbind(H)),e.view&&(e.view.purge(),e.view=null),e._link&&e._link.unbind(k),e._refreshHandler&&(e.dataSource.unbind(m,e._refreshHandler),e.dataSource=null),e.checkChangeHandler&&e.checkSource.unbind(m,e.checkChangeHandler),e._progressHandler&&e.checkSource.unbind("progress",e._progressHandler),e._progressHideHandler&&e.checkSource.unbind("change",e._progressHideHandler),this._clearTypingTimeout(),this.searchTextBox=null,e.element=e.checkSource=e.container=e.checkBoxAll=e._link=e._refreshHandler=e.checkAllHandler=null},options:{name:"FilterMultiCheck",itemTemplate:function(e){var i=e.field,s=e.format,l=e.valueField,a=e.mobile,n="";return l===t&&(l=i),"date"==e.type&&(n=":yyyy-MM-ddTHH:mm:sszzz"),"<li class='k-item'><label class='k-label'><input type='checkbox' class='"+(a?"k-check":"")+"'  value='#:kendo.format('{0"+n+"}',"+l+")#'/>#:kendo.format('"+(s?s:"{0}")+"', "+i+")#</label></li>"},checkAll:!0,search:!1,ignoreCase:!0,appendToElement:!1,messages:{checkAll:"Select All",clear:"Clear",filter:"Filter",search:"Search"},forceUnique:!0,animations:{left:"slide",right:"slide:right"}},events:[h,p]});e.extend(q.fn,{_click:F.fn._click,_keydown:F.fn._keydown,_reset:F.fn._reset,_closeForm:F.fn._closeForm,clear:F.fn.clear,_merge:F.fn._merge}),u.plugin(F),u.plugin(q)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()});;!function(e,define){define("kendo.menu.min",["kendo.popup.min"],e)}(function(){return function(e,t){function n(e,t){return e=e.split(" ")[!t+0]||e,e.replace("top","up").replace("bottom","down")}function i(e,t,n){e=e.split(" ")[!t+0]||e;var i={origin:["bottom",n?"right":"left"],position:["top",n?"right":"left"]},o=/left|right/.test(e);return o?(i.origin=["top",e],i.position[1]=p.directions[e].reverse):(i.origin[0]=e,i.position[0]=p.directions[e].reverse),i.origin=i.origin.join(" "),i.position=i.position.join(" "),i}function o(t,n){try{return e.contains(t,n)}catch(i){return!1}}function r(t){t=e(t),t.addClass("k-item").children(b).addClass(A),t.children("a").addClass(P).children(b).addClass(A),t.filter(":not([disabled])").addClass(V),t.filter(".k-separator:empty").append("&nbsp;"),t.filter("li[disabled]").addClass(q).removeAttr("disabled").attr("aria-disabled",!0),t.filter("[role]").length||t.attr("role","menuitem"),t.children("."+P).length||t.contents().filter(function(){return!(this.nodeName.match(w)||3==this.nodeType&&!e.trim(this.nodeValue))}).wrapAll("<span class='"+P+"'/>"),s(t),a(t)}function s(t){t=e(t),t.find("> .k-link > [class*=k-i-arrow]:not(.k-sprite)").remove(),t.filter(":has(.k-menu-group)").children(".k-link:not(:has([class*=k-i-arrow]:not(.k-sprite)))").each(function(){var t=e(this),n=t.parent().parent();t.append("<span class='k-icon "+(n.hasClass(T+"-horizontal")?"k-i-arrow-s":"k-i-arrow-e")+"'/>")})}function a(t){t=e(t),t.filter(".k-first:not(:first-child)").removeClass(O),t.filter(".k-last:not(:last-child)").removeClass(I),t.filter(":first-child").addClass(O),t.filter(":last-child").addClass(I)}var l,p=window.kendo,c=p.ui,u=p._activeElement,d=p.support.touch&&p.support.mobileOS,m="mousedown",h="click",f=e.extend,g=e.proxy,v=e.each,k=p.template,_=p.keys,C=c.Widget,w=/^(ul|a|div)$/i,y=".kendoMenu",b="img",x="open",T="k-menu",P="k-link",I="k-last",E="close",H="timer",O="k-first",A="k-image",D="select",R="zIndex",S="activate",U="deactivate",z="touchstart"+y+" MSPointerDown"+y+" pointerdown"+y,L=p.support.pointers,B=p.support.msPointers,M=B||L,G=L?"pointerover":B?"MSPointerOver":"mouseenter",N=L?"pointerout":B?"MSPointerOut":"mouseleave",W=d||M,j=e(document.documentElement),F="kendoPopup",V="k-state-default",X="k-state-hover",Y="k-state-focused",q="k-state-disabled",K=".k-menu",Z=".k-menu-group",$=Z+",.k-animation-container",Q=":not(.k-list) > .k-item",J=".k-item.k-state-disabled",ee=".k-item:not(.k-state-disabled)",te=".k-item:not(.k-state-disabled) > .k-link",ne=":not(.k-item.k-separator)",ie=ne+":eq(0)",oe=ne+":last",re="> div:not(.k-animation-container,.k-list-container)",se={2:1,touch:1},ae={content:k("<div class='k-content #= groupCssClass() #' tabindex='-1'>#= content(item) #</div>"),group:k("<ul class='#= groupCssClass(group) #'#= groupAttributes(group) # role='menu' aria-hidden='true'>#= renderItems(data) #</ul>"),itemWrapper:k("<#= tag(item) # class='#= textClass(item) #'#= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) ##= arrow(data) #</#= tag(item) #>"),item:k("<li class='#= wrapperCssClass(group, item) #' role='menuitem' #=item.items ? \"aria-haspopup='true'\": \"\"##=item.enabled === false ? \"aria-disabled='true'\" : ''#>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, menu: menu, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #</li>"),image:k("<img class='k-image' alt='' src='#= imageUrl #' />"),arrow:k("<span class='#= arrowClass(item, group) #'></span>"),sprite:k("<span class='k-sprite #= spriteCssClass #'></span>"),empty:k("")},le={wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" k-state-disabled":" k-state-default",e.firstLevel&&0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),t.cssClass&&(n+=" "+t.cssClass),n},textClass:function(){return P},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},arrowClass:function(e,t){var n="k-icon";return n+=t.horizontal?" k-i-arrow-s":" k-i-arrow-e"},text:function(e){return e.encoded===!1?e.text:p.htmlEncode(e.text)},tag:function(e){return e.url?"a":"span"},groupAttributes:function(e){return e.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group k-menu-group"},content:function(e){return e.content?e.content:"&nbsp;"}},pe=C.extend({init:function(t,n){var i=this;C.fn.init.call(i,t,n),t=i.wrapper=i.element,n=i.options,i._initData(n),i._updateClasses(),i._animations(n),i.nextItemZIndex=100,i._tabindex(),i._focusProxy=g(i._focusHandler,i),t.on(z,ee,i._focusProxy).on(h+y,J,!1).on(h+y,ee,g(i._click,i)).on("keydown"+y,g(i._keydown,i)).on("focus"+y,g(i._focus,i)).on("focus"+y,".k-content",g(i._focus,i)).on(z+" "+m+y,".k-content",g(i._preventClose,i)).on("blur"+y,g(i._removeHoverItem,i)).on("blur"+y,"[tabindex]",g(i._checkActiveElement,i)).on(G+y,ee,g(i._mouseenter,i)).on(N+y,ee,g(i._mouseleave,i)).on(G+y+" "+N+y+" "+m+y+" "+h+y,te,g(i._toggleHover,i)),n.openOnClick&&(i.clicked=!1,i._documentClickHandler=g(i._documentClick,i),e(document).click(i._documentClickHandler)),t.attr("role","menubar"),t[0].id&&(i._ariaId=p.format("{0}_mn_active",t[0].id)),p.notify(i)},events:[x,E,S,U,D],options:{name:"Menu",animation:{open:{duration:200},close:{duration:100}},orientation:"horizontal",direction:"default",openOnClick:!1,closeOnClick:!0,hoverDelay:100,popupCollision:t},_initData:function(e){var t=this;e.dataSource&&(t.angular("cleanup",function(){return{elements:t.element.children()}}),t.element.empty(),t.append(e.dataSource,t.element),t.angular("compile",function(){return{elements:t.element.children()}}))},setOptions:function(e){var t=this.options.animation;this._animations(e),e.animation=f(!0,t,e.animation),"dataSource"in e&&this._initData(e),this._updateClasses(),C.fn.setOptions.call(this,e)},destroy:function(){var t=this;C.fn.destroy.call(t),t.element.off(y),t._documentClickHandler&&e(document).unbind("click",t._documentClickHandler),p.destroy(t.element)},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this},disable:function(e){return this._toggleDisabled(e,!1),this},append:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.length?t.find("> .k-menu-group, > .k-animation-container > .k-menu-group"):null);return v(n.items,function(){n.group.append(this),s(this)}),s(t),a(n.group.find(".k-first, .k-last").add(n.items)),this},insertBefore:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return v(n.items,function(){t.before(this),s(this),a(this)}),a(t),this},insertAfter:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return v(n.items,function(){t.after(this),s(this),a(this)}),a(t),this},_insert:function(t,n,i){var o,s,a,l,p=this;return n&&n.length||(i=p.element),a=e.isPlainObject(t),l={firstLevel:i.hasClass(T),horizontal:i.hasClass(T+"-horizontal"),expanded:!0,length:i.children().length},n&&!i.length&&(i=e(pe.renderGroup({group:l})).appendTo(n)),a||e.isArray(t)?o=e(e.map(a?[t]:t,function(t,n){return"string"==typeof t?e(t).get():e(pe.renderItem({group:l,item:f(t,{index:n})})).get()})):(o="string"==typeof t&&"<"!=t.charAt(0)?p.element.find(t):e(t),s=o.find("> ul").addClass("k-menu-group").attr("role","menu"),o=o.filter("li"),o.add(s.find("> li")).each(function(){r(this)})),{items:o,group:i}},remove:function(e){var t,n,i,o;return e=this.element.find(e),t=this,n=e.parentsUntil(t.element,Q),i=e.parent("ul:not(.k-menu)"),e.remove(),i&&!i.children(Q).length&&(o=i.parent(".k-animation-container"),o.length?o.remove():i.remove()),n.length&&(n=n.eq(0),s(n),a(n)),t},open:function(o){var r=this,s=r.options,a="horizontal"==s.orientation,l=s.direction,c=p.support.isRtl(r.wrapper);return o=r.element.find(o),/^(top|bottom|default)$/.test(l)&&(l=c?a?(l+" left").replace("default","bottom"):"left":a?(l+" right").replace("default","bottom"):"right"),o.siblings().find(">.k-popup:visible,>.k-animation-container>.k-popup:visible").each(function(){var t=e(this).data("kendoPopup");t&&t.close()}),o.each(function(){var o=e(this);clearTimeout(o.data(H)),o.data(H,setTimeout(function(){var u,m,h,g,v,k,_,C,w=o.find(".k-menu-group:first:hidden");w[0]&&r._triggerEvent({item:o[0],type:x})===!1&&(!w.find(".k-menu-group")[0]&&w.children(".k-item").length>1?(m=e(window).height(),h=function(){w.css({maxHeight:m-(w.outerHeight()-w.height())-p.getShadows(w).bottom,overflow:"auto"})},p.support.browser.msie&&7>=p.support.browser.version?setTimeout(h,0):h()):w.css({maxHeight:"",overflow:""}),o.data(R,o.css(R)),o.css(R,r.nextItemZIndex++),u=w.data(F),g=o.parent().hasClass(T),v=g&&a,k=i(l,g,c),_=s.animation.open.effects,C=_!==t?_:"slideIn:"+n(l,g),u?(u=w.data(F),u.options.origin=k.origin,u.options.position=k.position,u.options.animation.open.effects=C):u=w.kendoPopup({activate:function(){r._triggerEvent({item:this.wrapper.parent(),type:S})},deactivate:function(e){e.sender.element.removeData("targetTransform").css({opacity:""}),r._triggerEvent({item:this.wrapper.parent(),type:U})},origin:k.origin,position:k.position,collision:s.popupCollision!==t?s.popupCollision:v?"fit":"fit flip",anchor:o,appendTo:o,animation:{open:f(!0,{effects:C},s.animation.open),close:s.animation.close},close:function(e){var t=e.sender.wrapper.parent();r._triggerEvent({item:t[0],type:E})?e.preventDefault():(t.css(R,t.data(R)),t.removeData(R),d&&(t.removeClass(X),r._removeHoverItem()))}}).data(F),w.removeAttr("aria-hidden"),u.open())},r.options.hoverDelay))}),r},close:function(t,n){var i=this,o=i.element;return t=o.find(t),t.length||(t=o.find(">.k-item")),t.each(function(){var t=e(this);!n&&i._isRootItem(t)&&(i.clicked=!1),clearTimeout(t.data(H)),t.data(H,setTimeout(function(){var e=t.find(".k-menu-group:not(.k-list-container):not(.k-calendar-container):first:visible").data(F);e&&(e.close(),e.element.attr("aria-hidden",!0))},i.options.hoverDelay))}),i},_toggleDisabled:function(t,n){this.element.find(t).each(function(){e(this).toggleClass(V,n).toggleClass(q,!n).attr("aria-disabled",!n)})},_toggleHover:function(t){var n=e(p.eventTarget(t)||t.target).closest(Q),i=t.type==G||-1!==m.indexOf(t.type);n.parents("li."+q).length||n.toggleClass(X,i||"mousedown"==t.type||"click"==t.type),this._removeHoverItem()},_preventClose:function(){this.options.closeOnClick||(this._closurePrevented=!0)},_checkActiveElement:function(t){var n=this,i=e(t?t.currentTarget:this._hoverItem()),r=n._findRootParent(i)[0];this._closurePrevented||setTimeout(function(){(!document.hasFocus()||!o(r,p._activeElement())&&t&&!o(r,t.currentTarget))&&n.close(r)},0),this._closurePrevented=!1},_removeHoverItem:function(){var e=this._hoverItem();e&&e.hasClass(Y)&&(e.removeClass(Y),this._oldHoverItem=null)},_updateClasses:function(){var e,t=this.element,n=".k-menu-init div ul";t.removeClass("k-menu-horizontal k-menu-vertical"),t.addClass("k-widget k-reset k-header k-menu-init "+T).addClass(T+"-"+this.options.orientation),t.find("li > ul").filter(function(){return!p.support.matchesSelector.call(this,n)}).addClass("k-group k-menu-group").attr("role","menu").attr("aria-hidden",t.is(":visible")).end().find("li > div").addClass("k-content").attr("tabindex","-1"),e=t.find("> li,.k-menu-group > li"),t.removeClass("k-menu-init"),e.each(function(){r(this)})},_mouseenter:function(t){var n=this,i=e(t.currentTarget),r=i.children(".k-animation-container").length||i.children(Z).length;t.delegateTarget==i.parents(K)[0]&&(n.options.openOnClick&&!n.clicked||d||(L||B)&&t.originalEvent.pointerType in se&&n._isRootItem(i.closest(Q))||!o(t.currentTarget,t.relatedTarget)&&r&&n.open(i),(n.options.openOnClick&&n.clicked||W)&&i.siblings().each(g(function(e,t){n.close(t,!0)},n)))},_mouseleave:function(n){var i=this,r=e(n.currentTarget),s=r.children(".k-animation-container").length||r.children(Z).length;return r.parentsUntil(".k-animation-container",".k-list-container,.k-calendar-container")[0]?(n.stopImmediatePropagation(),t):(i.options.openOnClick||d||(L||B)&&n.originalEvent.pointerType in se||o(n.currentTarget,n.relatedTarget||n.target)||!s||o(n.currentTarget,p._activeElement())||i.close(r),t)},_click:function(n){var i,o,r,s=this,a=s.options,l=e(p.eventTarget(n)),c=l[0]?l[0].nodeName.toUpperCase():"",u="INPUT"==c||"SELECT"==c||"BUTTON"==c||"LABEL"==c,d=l.closest("."+P),m=l.closest(Q),h=d.attr("href"),f=l.attr("href"),g=e("<a href='#' />").attr("href"),v=!!h&&h!==g,k=v&&!!h.match(/^#/),_=!!f&&f!==g,C=a.openOnClick&&r&&s._isRootItem(m);if(!l.closest(re,m[0]).length){if(m.hasClass(q))return n.preventDefault(),t;if(n.handled||!s._triggerEvent({item:m[0],type:D})||u||n.preventDefault(),n.handled=!0,o=m.children($),r=o.is(":visible"),a.closeOnClick&&(!v||k)&&(!o.length||C))return m.removeClass(X).css("height"),s._oldHoverItem=s._findRootParent(m),s.close(d.parentsUntil(s.element,Q)),s.clicked=!1,-1!="MSPointerUp".indexOf(n.type)&&n.preventDefault(),t;v&&n.enterKey&&d[0].click(),(s._isRootItem(m)&&a.openOnClick||p.support.touch||(L||B)&&s._isRootItem(m.closest(Q)))&&(v||u||_||n.preventDefault(),s.clicked=!0,i=o.is(":visible")?E:x,(a.closeOnClick||i!=E)&&s[i](m))}},_documentClick:function(e){o(this.element[0],e.target)||(this.clicked=!1)},_focus:function(n){var i=this,o=n.target,r=i._hoverItem(),s=u();return o==i.wrapper[0]||e(o).is(":kendoFocusable")?(s===n.currentTarget&&(r.length?i._moveHover([],r):i._oldHoverItem||i._moveHover([],i.wrapper.children().first())),t):(n.stopPropagation(),e(o).closest(".k-content").closest(".k-menu-group").closest(".k-item").addClass(Y),i.wrapper.focus(),t)},_keydown:function(e){var n,i,o,r=this,s=e.keyCode,a=r._oldHoverItem,l=p.support.isRtl(r.wrapper);if(e.target==e.currentTarget||s==_.ESC){if(a||(a=r._oldHoverItem=r._hoverItem()),i=r._itemBelongsToVertival(a),o=r._itemHasChildren(a),s==_.RIGHT)n=r[l?"_itemLeft":"_itemRight"](a,i,o);else if(s==_.LEFT)n=r[l?"_itemRight":"_itemLeft"](a,i,o);else if(s==_.DOWN)n=r._itemDown(a,i,o);else if(s==_.UP)n=r._itemUp(a,i,o);else if(s==_.ESC)n=r._itemEsc(a,i);else if(s==_.ENTER||s==_.SPACEBAR)n=a.children(".k-link"),n.length>0&&(r._click({target:n[0],preventDefault:function(){},enterKey:!0}),r._moveHover(a,r._findRootParent(a)));else if(s==_.TAB)return n=r._findRootParent(a),r._moveHover(a,n),r._checkActiveElement(),t;n&&n[0]&&(e.preventDefault(),e.stopPropagation())}},_hoverItem:function(){return this.wrapper.find(".k-item.k-state-hover,.k-item.k-state-focused").filter(":visible")},_itemBelongsToVertival:function(e){var t=this.wrapper.hasClass("k-menu-vertical");return e.length?e.parent().hasClass("k-menu-group")||t:t},_itemHasChildren:function(e){return e.length?e.children("ul.k-menu-group, div.k-animation-container").length>0:!1},_moveHover:function(t,n){var i=this,o=i._ariaId;t.length&&n.length&&t.removeClass(Y),n.length&&(n[0].id&&(o=n[0].id),n.addClass(Y),i._oldHoverItem=n,o&&(i.element.removeAttr("aria-activedescendant"),e("#"+o).removeAttr("id"),n.attr("id",o),i.element.attr("aria-activedescendant",o)))},_findRootParent:function(e){return this._isRootItem(e)?e:e.parentsUntil(K,"li.k-item").last()},_isRootItem:function(e){return e.parent().hasClass(T)},_itemRight:function(e,t,n){var i,o,r=this;if(!e.hasClass(q))return t?n?(r.open(e),i=e.find(".k-menu-group").children().first()):"horizontal"==r.options.orientation&&(o=r._findRootParent(e),r.close(o),i=o.nextAll(ie)):(i=e.nextAll(ie),i.length||(i=e.prevAll(oe))),i&&!i.length?i=r.wrapper.children(".k-item").first():i||(i=[]),r._moveHover(e,i),i},_itemLeft:function(e,t){var n,i=this;return t?(n=e.parent().closest(".k-item"),i.close(n),i._isRootItem(n)&&"horizontal"==i.options.orientation&&(n=n.prevAll(ie))):(n=e.prevAll(ie),n.length||(n=e.nextAll(oe))),n.length||(n=i.wrapper.children(".k-item").last()),i._moveHover(e,n),n},_itemDown:function(e,t,n){var i,o=this;if(t)i=e.nextAll(ie);else{if(!n||e.hasClass(q))return;o.open(e),i=e.find(".k-menu-group").children().first()}return!i.length&&e.length?i=e.parent().children().first():e.length||(i=o.wrapper.children(".k-item").first()),o._moveHover(e,i),i},_itemUp:function(e,t){var n,i=this;if(t)return n=e.prevAll(ie),!n.length&&e.length?n=e.parent().children().last():e.length||(n=i.wrapper.children(".k-item").last()),i._moveHover(e,n),n},_itemEsc:function(e,t){var n,i=this;return t?(n=e.parent().closest(".k-item"),i.close(n),i._moveHover(e,n),n):e},_triggerEvent:function(e){var t=this;return t.trigger(e.type,{type:e.type,item:e.item})},_focusHandler:function(t){var n=this,i=e(p.eventTarget(t)).closest(Q);setTimeout(function(){n._moveHover([],i),i.children(".k-content")[0]&&i.parent().closest(".k-item").removeClass(Y)},200)},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={open:{effects:{}},close:{hide:!0,effects:{}}})}});f(pe,{renderItem:function(e){e=f({menu:{},group:{}},e);var t=ae.empty,n=e.item;return ae.item(f(e,{image:n.imageUrl?ae.image:t,sprite:n.spriteCssClass?ae.sprite:t,itemWrapper:ae.itemWrapper,renderContent:pe.renderContent,arrow:n.items||n.content?ae.arrow:t,subGroup:pe.renderGroup},le))},renderGroup:function(e){return ae.group(f({renderItems:function(e){for(var t="",n=0,i=e.items,o=i?i.length:0,r=f({length:o},e.group);o>n;n++)t+=pe.renderItem(f(e,{group:r,item:f({index:n},i[n])}));return t}},e,le))},renderContent:function(e){return ae.content(f(e,le))}}),l=pe.extend({init:function(t,n){var i=this;pe.fn.init.call(i,t,n),i.target=e(i.options.target),i._popup(),i._wire()},options:{name:"ContextMenu",filter:null,showOn:"contextmenu",orientation:"vertical",alignToAnchor:!1,target:"body"},events:[x,E,S,U,D],setOptions:function(t){var n=this;pe.fn.setOptions.call(n,t),n.target.off(n.showOn+y,n._showProxy),n.userEvents&&n.userEvents.destroy(),n.target=e(n.options.target),t.orientation&&n.popup.wrapper[0]&&n.popup.element.unwrap(),n._wire(),pe.fn.setOptions.call(this,t)},destroy:function(){var e=this;e.target.off(e.options.showOn+y),j.off(p.support.mousedown+y,e._closeProxy),e.userEvents&&e.userEvents.destroy(),pe.fn.destroy.call(e)},open:function(n,i){var r=this;return n=e(n)[0],o(r.element[0],e(n)[0])?pe.fn.open.call(r,n):r._triggerEvent({item:r.element,type:x})===!1&&(r.popup.visible()&&r.options.filter&&(r.popup.close(!0),r.popup.element.kendoStop(!0)),i!==t?(r.popup.wrapper.hide(),r.popup.open(n,i)):(r.popup.options.anchor=(n?n:r.popup.anchor)||r.target,r.popup.element.kendoStop(!0),r.popup.open()),j.off(r.popup.downEvent,r.popup._mousedownProxy),j.on(p.support.mousedown+y,r._closeProxy)),r},close:function(){var t=this;o(t.element[0],e(arguments[0])[0])?pe.fn.close.call(t,arguments[0]):t.popup.visible()&&t._triggerEvent({item:t.element,type:E})===!1&&(t.popup.close(),j.off(p.support.mousedown+y,t._closeProxy),t.unbind(D,t._closeTimeoutProxy))},_showHandler:function(e){var t,n=e,i=this,r=i.options;e.event&&(n=e.event,n.pageX=e.x.location,n.pageY=e.y.location),o(i.element[0],e.relatedTarget||e.target)||(i._eventOrigin=n,n.preventDefault(),n.stopImmediatePropagation(),i.element.find("."+Y).removeClass(Y),(r.filter&&p.support.matchesSelector.call(n.currentTarget,r.filter)||!r.filter)&&(r.alignToAnchor?(i.popup.options.anchor=n.currentTarget,i.open(n.currentTarget)):(i.popup.options.anchor=n.currentTarget,i._targetChild?(t=i.target.offset(),i.open(n.pageX-t.left,n.pageY-t.top)):i.open(n.pageX,n.pageY))))},_closeHandler:function(t){var n,i=this,r=e(t.relatedTarget||t.target),s=r.closest(i.target.selector)[0]==i.target[0],a=r.closest(ee).children($),l=o(i.element[0],r[0]);i._eventOrigin=t,n=3!==t.which,i.popup.visible()&&(n&&s||!s)&&(i.options.closeOnClick&&!a[0]&&l||!l)&&(l?(this.unbind(D,this._closeTimeoutProxy),i.bind(D,i._closeTimeoutProxy)):i.close())},_wire:function(){var e=this,t=e.options,n=e.target;e._showProxy=g(e._showHandler,e),e._closeProxy=g(e._closeHandler,e),e._closeTimeoutProxy=g(e.close,e),n[0]&&(p.support.mobileOS&&"contextmenu"==t.showOn?(e.userEvents=new p.UserEvents(n,{filter:t.filter,allowSelection:!1}),n.on(t.showOn+y,!1),e.userEvents.bind("hold",e._showProxy)):t.filter?n.on(t.showOn+y,t.filter,e._showProxy):n.on(t.showOn+y,e._showProxy))},_triggerEvent:function(n){var i=this,o=e(i.popup.options.anchor)[0],r=i._eventOrigin;return i._eventOrigin=t,i.trigger(n.type,f({type:n.type,item:n.item||this.element[0],target:o},r?{event:r}:{}))},_popup:function(){var e=this;e._triggerProxy=g(e._triggerEvent,e),e.popup=e.element.addClass("k-context-menu").kendoPopup({anchor:e.target||"body",copyAnchorStyles:e.options.copyAnchorStyles,collision:e.options.popupCollision||"fit",animation:e.options.animation,activate:e._triggerProxy,deactivate:e._triggerProxy}).data("kendoPopup"),e._targetChild=o(e.target[0],e.popup.element[0])}}),c.plugin(pe),c.plugin(l)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});;!function(e,define){define("kendo.columnmenu.min",["kendo.popup.min","kendo.filtermenu.min","kendo.menu.min"],e)}(function(){return function(e,n){function s(n){return e.trim(n).replace(/&nbsp;/gi,"")}function l(e,n){var s,l,t,i={};for(s=0,l=e.length;l>s;s++)t=e[s],i[t[n]]=t;return i}function t(e){var n,s=[];for(n=0;e.length>n;n++)e[n].columns?s=s.concat(t(e[n].columns)):s.push(e[n]);return s}var i=window.kendo,o=i.ui,a=e.proxy,r=e.extend,c=e.grep,u=e.map,d=e.inArray,p="k-state-selected",k="asc",m="desc",f="change",h="init",b="select",g="kendoPopup",C="kendoFilterMenu",w="kendoMenu",v=".kendoColumnMenu",_=o.Widget,x=_.extend({init:function(n,s){var l,t=this;_.fn.init.call(t,n,s),n=t.element,s=t.options,t.owner=s.owner,t.dataSource=s.dataSource,t.field=n.attr(i.attr("field")),t.title=n.attr(i.attr("title")),l=n.find(".k-header-column-menu"),l[0]||(l=n.addClass("k-with-icon").prepend('<a class="k-header-column-menu" href="#"><span class="k-icon k-i-arrowhead-s">'+s.messages.settings+"</span></a>").find(".k-header-column-menu")),t.link=l.attr("tabindex",-1).on("click"+v,a(t._click,t)),t.wrapper=e('<div class="k-column-menu"/>'),t._refreshHandler=a(t.refresh,t),t.dataSource.bind(f,t._refreshHandler)},_init:function(){var e=this;e.pane=e.options.pane,e.pane&&(e._isMobile=!0),e._isMobile?e._createMobileMenu():e._createMenu(),e.owner._muteAngularRebind(function(){e._angularItems("compile")}),e._sort(),e._columns(),e._filter(),e._lockColumns(),e.trigger(h,{field:e.field,container:e.wrapper})},events:[h],options:{name:"ColumnMenu",messages:{sortAscending:"Sort Ascending",sortDescending:"Sort Descending",filter:"Filter",columns:"Columns",done:"Done",settings:"Column Settings",lock:"Lock",unlock:"Unlock"},filter:"",columns:!0,sortable:!0,filterable:!0,animations:{left:"slide"}},_createMenu:function(){var e=this,n=e.options;e.wrapper.html(i.template(M)({ns:i.ns,messages:n.messages,sortable:n.sortable,filterable:n.filterable,columns:e._ownerColumns(),showColumns:n.columns,lockedColumns:n.lockedColumns})),e.popup=e.wrapper[g]({anchor:e.link,open:a(e._open,e),activate:a(e._activate,e),close:function(){e.options.closeCallback&&e.options.closeCallback(e.element)}}).data(g),e.menu=e.wrapper.children()[w]({orientation:"vertical",closeOnClick:!1}).data(w)},_createMobileMenu:function(){var e=this,n=e.options,s=i.template(S)({ns:i.ns,field:e.field,title:e.title||e.field,messages:n.messages,sortable:n.sortable,filterable:n.filterable,columns:e._ownerColumns(),showColumns:n.columns,lockedColumns:n.lockedColumns});e.view=e.pane.append(s),e.wrapper=e.view.element.find(".k-column-menu"),e.menu=new y(e.wrapper.children(),{pane:e.pane}),e.view.element.on("click",".k-done",function(n){e.close(),n.preventDefault()}),e.options.lockedColumns&&e.view.bind("show",function(){e._updateLockedColumns()})},_angularItems:function(n){var s=this;s.angular(n,function(){var n=s.wrapper.find(".k-columns-item input["+i.attr("field")+"]").map(function(){return e(this).closest("li")}),l=u(s._ownerColumns(),function(e){return{column:e._originalObject}});return{elements:n,data:l}})},destroy:function(){var e=this;e._angularItems("cleanup"),_.fn.destroy.call(e),e.filterMenu&&e.filterMenu.destroy(),e._refreshHandler&&e.dataSource.unbind(f,e._refreshHandler),e.options.columns&&e.owner&&(e._updateColumnsMenuHandler&&(e.owner.unbind("columnShow",e._updateColumnsMenuHandler),e.owner.unbind("columnHide",e._updateColumnsMenuHandler)),e._updateColumnsLockedStateHandler&&(e.owner.unbind("columnLock",e._updateColumnsLockedStateHandler),e.owner.unbind("columnUnlock",e._updateColumnsLockedStateHandler))),e.menu&&(e.menu.element.off(v),e.menu.destroy()),e.wrapper.off(v),e.popup&&e.popup.destroy(),e.view&&e.view.purge(),e.link.off(v),e.owner=null,e.wrapper=null,e.element=null},close:function(){this.menu.close(),this.popup&&(this.popup.close(),this.popup.element.off("keydown"+v))},_click:function(e){e.preventDefault(),e.stopPropagation();var n=this.options;n.filter&&this.element.is(!n.filter)||(this.popup||this.pane||this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle())},_open:function(){var n=this;e(".k-column-menu").not(n.wrapper).each(function(){e(this).data(g).close()}),n.popup.element.on("keydown"+v,function(e){e.keyCode==i.keys.ESC&&n.close()}),n.options.lockedColumns&&n._updateLockedColumns()},_activate:function(){this.menu.element.focus()},_ownerColumns:function(){var e=t(this.owner.columns),n=c(e,function(e){var n=!0,l=s(e.title||"");return(e.menu===!1||!e.field&&!l.length)&&(n=!1),n});return u(n,function(n){return{originalField:n.field,field:n.field||n.title,title:n.title||n.field,hidden:n.hidden,index:d(n,e),locked:!!n.locked,_originalObject:n}})},_sort:function(){var n=this;n.options.sortable&&(n.refresh(),n.menu.bind(b,function(s){var l,t=e(s.item);t.hasClass("k-sort-asc")?l=k:t.hasClass("k-sort-desc")&&(l=m),l&&(t.parent().find(".k-sort-"+(l==k?m:k)).removeClass(p),n._sortDataSource(t,l),n.close())}))},_sortDataSource:function(e,s){var l,t,i=this,o=i.options.sortable,a=null===o.compare?n:o.compare,r=i.dataSource,c=r.sort()||[];if(e.hasClass(p)&&o&&o.allowUnsort!==!1?(e.removeClass(p),s=n):e.addClass(p),"multiple"===o.mode){for(l=0,t=c.length;t>l;l++)if(c[l].field===i.field){c.splice(l,1);break}c.push({field:i.field,dir:s,compare:a})}else c=[{field:i.field,dir:s,compare:a}];r.sort(c)},_columns:function(){var n=this;n.options.columns&&(n._updateColumnsMenu(),n._updateColumnsMenuHandler=a(n._updateColumnsMenu,n),n.owner.bind(["columnHide","columnShow"],n._updateColumnsMenuHandler),n._updateColumnsLockedStateHandler=a(n._updateColumnsLockedState,n),n.owner.bind(["columnUnlock","columnLock"],n._updateColumnsLockedStateHandler),n.menu.bind(b,function(s){var l,o,a,r=e(s.item),u=t(n.owner.columns);n._isMobile&&s.preventDefault(),r.parent().closest("li.k-columns-item")[0]&&(l=r.find(":checkbox"),l.attr("disabled")||(a=l.attr(i.attr("field")),o=c(u,function(e){return e.field==a||e.title==a})[0],o.hidden===!0?n.owner.showColumn(o):n.owner.hideColumn(o)))}))},_updateColumnsMenu:function(){var e,n,s,l,t,o,a=i.attr("field"),r=i.attr("locked"),p=c(this._ownerColumns(),function(e){return!e.hidden}),k=c(p,function(e){return e.originalField}),m=c(k,function(e){return e.locked===!0}).length,f=c(k,function(e){return e.locked!==!0}).length;for(p=u(p,function(e){return e.field}),o=this.wrapper.find(".k-columns-item input["+a+"]").prop("disabled",!1).prop("checked",!1),e=0,n=o.length;n>e;e++)s=o.eq(e),t="true"===s.attr(r),l=!1,d(s.attr(a),p)>-1&&(l=!0,s.prop("checked",l)),l&&(1==m&&t&&s.prop("disabled",!0),1!=f||t||s.prop("disabled",!0))},_updateColumnsLockedState:function(){var e,n,s,t,o=i.attr("field"),a=i.attr("locked"),r=l(this._ownerColumns(),"field"),c=this.wrapper.find(".k-columns-item input[type=checkbox]");for(e=0,n=c.length;n>e;e++)s=c.eq(e),t=r[s.attr(o)],t&&s.attr(a,t.locked);this._updateColumnsMenu()},_filter:function(){var n=this,s=C,l=n.options;l.filterable!==!1&&(l.filterable.multi&&(s="kendoFilterMultiCheck",l.filterable.dataSource&&(l.filterable.checkSource=l.filterable.dataSource,delete l.filterable.dataSource)),n.filterMenu=n.wrapper.find(".k-filterable")[s](r(!0,{},{appendToElement:!0,dataSource:l.dataSource,values:l.values,field:n.field,title:n.title},l.filterable)).data(s),n._isMobile&&n.menu.bind(b,function(s){var l=e(s.item);l.hasClass("k-filter-item")&&n.pane.navigate(n.filterMenu.view,n.options.animations.left)}))},_lockColumns:function(){var n=this;n.menu.bind(b,function(s){var l=e(s.item);l.hasClass("k-lock")?(n.owner.lockColumn(n.field),n.close()):l.hasClass("k-unlock")&&(n.owner.unlockColumn(n.field),n.close())})},_updateLockedColumns:function(){var e,n,s,l,t=this.field,i=this.owner.columns,o=c(i,function(e){return e.field==t||e.title==t})[0];o&&(e=o.locked===!0,n=c(i,function(n){return!n.hidden&&(n.locked&&e||!n.locked&&!e)}).length,s=this.wrapper.find(".k-lock").removeClass("k-state-disabled"),l=this.wrapper.find(".k-unlock").removeClass("k-state-disabled"),(e||1==n)&&s.addClass("k-state-disabled"),e&&1!=n||l.addClass("k-state-disabled"),this._updateColumnsLockedState())},refresh:function(){var e,n,s,l=this,t=l.options.dataSource.sort()||[],i=l.field;for(l.wrapper.find(".k-sort-asc, .k-sort-desc").removeClass(p),n=0,s=t.length;s>n;n++)e=t[n],i==e.field&&l.wrapper.find(".k-sort-"+e.dir).addClass(p);l.link[l._filterExist(l.dataSource.filter())?"addClass":"removeClass"]("k-state-active")},_filterExist:function(e){var n,s,l,t=!1;if(e){for(e=e.filters,s=0,l=e.length;l>s;s++)n=e[s],n.field==this.field?t=!0:n.filters&&(t=t||this._filterExist(n));return t}}}),M='<ul>#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"></span>${messages.sortDescending}</span></li>#if(showColumns || filterable){#<li class="k-separator"></li>#}##}##if(showColumns){#<li class="k-item k-columns-item"><span class="k-link"><span class="k-sprite k-i-columns"></span>${messages.columns}</span><ul>#for (var idx = 0; idx < columns.length; idx++) {#<li><input type="checkbox" data-#=ns#field="#=columns[idx].field.replace(/"/g,"&\\#34;")#" data-#=ns#index="#=columns[idx].index#" data-#=ns#locked="#=columns[idx].locked#"/>#=columns[idx].title#</li>#}#</ul></li>#if(filterable || lockedColumns){#<li class="k-separator"></li>#}##}##if(filterable){#<li class="k-item k-filter-item"><span class="k-link"><span class="k-sprite k-filter"></span>${messages.filter}</span><ul><li><div class="k-filterable"></div></li></ul></li>#if(lockedColumns){#<li class="k-separator"></li>#}##}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-sprite k-i-lock"></span>${messages.lock}</span></li><li class="k-item k-unlock"><span class="k-link"><span class="k-sprite k-i-unlock"></span>${messages.unlock}</span></li>#}#</ul>',S='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-column-menu"><div data-#=ns#role="header" class="k-header">${messages.settings}<button class="k-button k-done">#=messages.done#</button></div><div class="k-column-menu k-mobile-list"><ul><li><span class="k-link">${title}</span><ul>#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"></span>${messages.sortDescending}</span></li>#}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-sprite k-i-lock"></span>${messages.lock}</span></li><li class="k-item k-unlock"><span class="k-link"><span class="k-sprite k-i-unlock"></span>${messages.unlock}</span></li>#}##if(filterable){#<li class="k-item k-filter-item"><span class="k-link k-filterable"><span class="k-sprite k-filter"></span>${messages.filter}</span></li>#}#</ul></li>#if(showColumns){#<li class="k-columns-item"><span class="k-link">${messages.columns}</span><ul>#for (var idx = 0; idx < columns.length; idx++) {#<li class="k-item"><label class="k-label"><input type="checkbox" class="k-check" data-#=ns#field="#=columns[idx].field.replace(/"/g,"&\\#34;")#" data-#=ns#index="#=columns[idx].index#" data-#=ns#locked="#=columns[idx].locked#"/>#=columns[idx].title#</label></li>#}#</ul></li>#}#</ul></div></div>',y=_.extend({init:function(e,n){_.fn.init.call(this,e,n),this.element.on("click"+v,"li.k-item:not(.k-separator):not(.k-state-disabled)","_click")},events:[b],_click:function(n){e(n.target).is("[type=checkbox]")||n.preventDefault(),this.trigger(b,{item:n.currentTarget})},close:function(){this.options.pane.navigate("")},destroy:function(){_.fn.destroy.call(this),this.element.off(v)}});o.plugin(x)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,s){(s||n)()});;!function(t,define){define("kendo.groupable.min",["kendo.core.min","kendo.draganddrop.min"],t)}(function(){return function(t,e){function r(t){return t.position().top+3}var a=window.kendo,n=a.ui.Widget,i=t.proxy,o=!1,d=".kendoGroupable",s="change",l=a.template('<div class="k-group-indicator" data-#=data.ns#field="${data.field}" data-#=data.ns#title="${data.title || ""}" data-#=data.ns#dir="${data.dir || "asc"}"><a href="\\#" class="k-link"><span class="k-icon k-si-arrow-${(data.dir || "asc") == "asc" ? "n" : "s"}">(sorted ${(data.dir || "asc") == "asc" ? "ascending": "descending"})</span>${data.title ? data.title: data.field}</a><a class="k-button k-button-icon k-button-bare"><span class="k-icon k-group-delete"></span></a></div>',{useWithBlock:!1}),g=function(e){return t('<div class="k-header k-drag-clue" />').css({width:e.width(),paddingLeft:e.css("paddingLeft"),paddingRight:e.css("paddingRight"),lineHeight:e.height()+"px",paddingTop:e.css("paddingTop"),paddingBottom:e.css("paddingBottom")}).html(e.attr(a.attr("title"))||e.attr(a.attr("field"))).prepend('<span class="k-icon k-drag-status k-denied" />')},u=t('<div class="k-grouping-dropclue"/>'),c=n.extend({init:function(l,c){var p,f,h=this,m=a.guid(),k=i(h._intializePositions,h),v=h._dropCuePositions=[];n.fn.init.call(h,l,c),o=a.support.isRtl(l),f=o?"right":"left",h.draggable=p=h.options.draggable||new a.ui.Draggable(h.element,{filter:h.options.draggableElements,hint:g,group:m}),h.groupContainer=t(h.options.groupContainer,h.element).kendoDropTarget({group:p.options.group,dragenter:function(t){h._canDrag(t.draggable.currentTarget)&&(t.draggable.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add"),u.css("top",r(h.groupContainer)).css(f,0).appendTo(h.groupContainer))},dragleave:function(t){t.draggable.hint.find(".k-drag-status").removeClass("k-add").addClass("k-denied"),u.remove()},drop:function(e){var r,n=e.draggable.currentTarget,i=n.attr(a.attr("field")),d=n.attr(a.attr("title")),s=h.indicator(i),l=h._dropCuePositions,g=l[l.length-1];(n.hasClass("k-group-indicator")||h._canDrag(n))&&(g?(r=h._dropCuePosition(a.getOffset(u).left+parseInt(g.element.css("marginLeft"),10)*(o?-1:1)+parseInt(g.element.css("marginRight"),10)),r&&h._canDrop(t(s),r.element,r.left)&&(r.before?r.element.before(s||h.buildIndicator(i,d)):r.element.after(s||h.buildIndicator(i,d)),h._change())):(h.groupContainer.append(h.buildIndicator(i,d)),h._change()))}}).kendoDraggable({filter:"div.k-group-indicator",hint:g,group:p.options.group,dragcancel:i(h._dragCancel,h),dragstart:function(t){var e=t.currentTarget,a=parseInt(e.css("marginLeft"),10),n=e.position(),i=o?n.left-a:n.left+e.outerWidth();k(),u.css({top:r(h.groupContainer),left:i}).appendTo(h.groupContainer),this.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add")},dragend:function(){h._dragEnd(this)},drag:i(h._drag,h)}).on("click"+d,".k-button",function(e){e.preventDefault(),h._removeIndicator(t(this).parent())}).on("click"+d,".k-link",function(e){var r=t(this).parent(),n=h.buildIndicator(r.attr(a.attr("field")),r.attr(a.attr("title")),"asc"==r.attr(a.attr("dir"))?"desc":"asc");r.before(n).remove(),h._change(),e.preventDefault()}),p.bind(["dragend","dragcancel","dragstart","drag"],{dragend:function(){h._dragEnd(this)},dragcancel:i(h._dragCancel,h),dragstart:function(t){var r,a,n;return h.options.allowDrag||h._canDrag(t.currentTarget)?(k(),v.length?(r=v[v.length-1].element,a=parseInt(r.css("marginRight"),10),n=r.position().left+r.outerWidth()+a):n=0,e):(t.preventDefault(),e)},drag:i(h._drag,h)}),h.dataSource=h.options.dataSource,h.dataSource&&h._refreshHandler?h.dataSource.unbind(s,h._refreshHandler):h._refreshHandler=i(h.refresh,h),h.dataSource&&(h.dataSource.bind("change",h._refreshHandler),h.refresh())},refresh:function(){var e=this,r=e.dataSource;e.groupContainer&&e.groupContainer.empty().append(t.map(r.group()||[],function(r){var n=r.field,i=a.attr("field"),o=e.element.find(e.options.filter).filter(function(){return t(this).attr(i)===n});return e.buildIndicator(r.field,o.attr(a.attr("title")),r.dir)}).join("")),e._invalidateGroupContainer()},destroy:function(){var t=this;n.fn.destroy.call(t),t.groupContainer.off(d),t.groupContainer.data("kendoDropTarget")&&t.groupContainer.data("kendoDropTarget").destroy(),t.groupContainer.data("kendoDraggable")&&t.groupContainer.data("kendoDraggable").destroy(),t.options.draggable||t.draggable.destroy(),t.dataSource&&t._refreshHandler&&(t.dataSource.unbind("change",t._refreshHandler),t._refreshHandler=null),t.groupContainer=t.element=t.draggable=null},options:{name:"Groupable",filter:"th",draggableElements:"th",messages:{empty:"Drag a column header and drop it here to group by that column"}},indicator:function(e){var r=t(".k-group-indicator",this.groupContainer);return t.grep(r,function(r){return t(r).attr(a.attr("field"))===e})[0]},buildIndicator:function(t,e,r){return l({field:t.replace(/"/g,"'"),dir:r,title:e,ns:a.ns})},descriptors:function(){var e,r,n,i,o,d=this,s=t(".k-group-indicator",d.groupContainer);return e=d.element.find(d.options.filter).map(function(){var e=t(this),n=e.attr(a.attr("aggregates")),d=e.attr(a.attr("field"));if(n&&""!==n)for(r=n.split(","),n=[],i=0,o=r.length;o>i;i++)n.push({field:d,aggregate:r[i]});return n}).toArray(),t.map(s,function(r){return r=t(r),n=r.attr(a.attr("field")),{field:n,dir:r.attr(a.attr("dir")),aggregates:e||[]}})},_removeIndicator:function(t){var e=this;t.remove(),e._invalidateGroupContainer(),e._change()},_change:function(){var t=this;t.dataSource&&t.dataSource.group(t.descriptors())},_dropCuePosition:function(e){var r,a,n,i,d,s=this._dropCuePositions;if(u.is(":visible")&&0!==s.length)return e=Math.ceil(e),r=s[s.length-1],a=r.left,n=r.right,i=parseInt(r.element.css("marginLeft"),10),d=parseInt(r.element.css("marginRight"),10),e>=n&&!o||a>e&&o?e={left:r.element.position().left+(o?-i:r.element.outerWidth()+d),element:r.element,before:!1}:(e=t.grep(s,function(t){return e>=t.left&&t.right>=e||o&&e>t.right})[0],e&&(e={left:o?e.element.position().left+e.element.outerWidth()+d:e.element.position().left-i,element:e.element,before:!0})),e},_drag:function(t){var e=this._dropCuePosition(t.x.location);e&&u.css({left:e.left,right:"auto"})},_canDrag:function(t){var e=t.attr(a.attr("field"));return"false"!=t.attr(a.attr("groupable"))&&e&&(t.hasClass("k-group-indicator")||!this.indicator(e))},_canDrop:function(t,e,r){var a=t.next(),n=t[0]!==e[0]&&(!a[0]||e[0]!==a[0]||!o&&r>a.position().left||o&&r<a.position().left);return n},_dragEnd:function(e){var r=this,n=e.currentTarget.attr(a.attr("field")),i=r.indicator(n);e!==r.options.draggable&&!e.dropped&&i&&r._removeIndicator(t(i)),r._dragCancel()},_dragCancel:function(){u.remove(),this._dropCuePositions=[]},_intializePositions:function(){var e,r=this,n=t(".k-group-indicator",r.groupContainer);r._dropCuePositions=t.map(n,function(r){return r=t(r),e=a.getOffset(r).left,{left:parseInt(e,10),right:parseInt(e+r.outerWidth(),10),element:r}})},_invalidateGroupContainer:function(){var t=this.groupContainer;t&&t.is(":empty")&&t.html(this.options.messages.empty)}});a.ui.plugin(c)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,r){(r||e)()});;!function(e,define){define("kendo.filtercell.min",["kendo.autocomplete.min","kendo.datepicker.min","kendo.numerictextbox.min","kendo.combobox.min","kendo.dropdownlist.min"],e)}(function(){return function(e,t){function r(t){var r="string"==typeof t?t:t.operator;return e.inArray(r,v)>-1}function a(t,r){var o,n,l=[];if(e.isPlainObject(t))if(t.hasOwnProperty("filters"))l=t.filters;else if(t.field==r)return t;for(e.isArray(t)&&(l=t),o=0;l.length>o;o++)if(n=a(l[o],r))return n}function o(t,r){t.filters&&(t.filters=e.grep(t.filters,function(e){return o(e,r),e.filters?e.filters.length:e.field!=r}))}function n(e,t){var r=l.getter(t,!0);return function(t){for(var a,o,n=e(t),l=[],i=0,s={};n.length>i;)a=n[i++],o=r(a),s.hasOwnProperty(o)||(l.push(a),s[o]=!0);return l}}var l=window.kendo,i=l.ui,s=l.data.DataSource,u=i.Widget,p="change",d="boolean",c="enums",f="string",g="Is equal to",h="Is not equal to",m=e.proxy,v=["isnull","isnotnull","isempty","isnotempty"],w=u.extend({init:function(a,o){var n,i,s,g,h,v,w,y,b,I,S,D;if(a=e(a).addClass("k-filtercell"),n=this.wrapper=e("<span/>").appendTo(a),i=this,h=o,y=i.operators=o.operators||{},b=i.input=e("<input/>").attr(l.attr("bind"),"value: value").appendTo(n),u.fn.init.call(i,a[0],o),o=i.options,s=i.dataSource=o.dataSource,i.model=s.reader.model,w=o.type=f,I=l.getter("reader.model.fields",!0)(s)||{},S=I[o.field],S&&S.type&&(w=o.type=S.type),o.values&&(o.type=w=c),y=y[w]||o.operators[w],!h.operator)for(v in y){o.operator=v;break}i._parse=function(e){return null!=e?e+"":e},i.model&&i.model.fields&&(D=i.model.fields[o.field],D&&D.parse&&(i._parse=m(D.parse,D))),i.viewModel=g=l.observable({operator:o.operator,value:null,operatorVisible:function(){var e=this.get("value");return null!==e&&e!==t&&"undefined"!=e||r(this.get("operator"))&&!i._clearInProgress&&!i.manuallyUpdatingVM}}),g.bind(p,m(i.updateDsFilter,i)),w==f&&i.initSuggestDataSource(o),null!==o.inputWidth&&b.width(o.inputWidth),i._setInputType(o,w),w!=d&&o.showOperators!==!1?i._createOperatorDropDown(y):n.addClass("k-operator-hidden"),i._createClearIcon(),l.bind(this.wrapper,g),w==f&&(o.template||i.setAutoCompleteSource()),w==c&&i.setComboBoxSource(i.options.values),i._refreshUI(),i._refreshHandler=m(i._refreshUI,i),i.dataSource.bind(p,i._refreshHandler)},_setInputType:function(t,r){var a,o,n,i,s,u=this,p=u.input;"function"==typeof t.template?(t.template.call(u.viewModel,{element:u.input,dataSource:u.suggestDataSource}),u._angularItems("compile")):r==f?p.attr(l.attr("role"),"autocomplete").attr(l.attr("text-field"),t.dataTextField||t.field).attr(l.attr("filter"),t.suggestionOperator).attr(l.attr("delay"),t.delay).attr(l.attr("min-length"),t.minLength).attr(l.attr("value-primitive"),!0):"date"==r?p.attr(l.attr("role"),"datepicker"):r==d?(p.remove(),a=e("<input type='radio'/>"),o=u.wrapper,n=l.guid(),i=e("<label/>").text(t.messages.isTrue).append(a),a.attr(l.attr("bind"),"checked:value").attr("name",n).val("true"),s=i.clone().text(t.messages.isFalse),a.clone().val("false").appendTo(s),o.append([i,s])):"number"==r?p.attr(l.attr("role"),"numerictextbox"):r==c&&p.attr(l.attr("role"),"combobox").attr(l.attr("text-field"),"text").attr(l.attr("suggest"),!0).attr(l.attr("filter"),"contains").attr(l.attr("value-field"),"value").attr(l.attr("value-primitive"),!0)},_createOperatorDropDown:function(t){var r,a,o=[];for(r in t)o.push({text:t[r],value:r});a=e('<input class="k-dropdown-operator" '+l.attr("bind")+'="value: operator"/>').appendTo(this.wrapper),this.operatorDropDown=a.kendoDropDownList({dataSource:o,dataTextField:"text",dataValueField:"value",open:function(){this.popup.element.width(150)},valuePrimitive:!0}).data("kendoDropDownList"),this.operatorDropDown.wrapper.find(".k-i-arrow-s").removeClass("k-i-arrow-s").addClass("k-filter")},initSuggestDataSource:function(e){var r=e.suggestDataSource;r instanceof s||(!e.customDataSource&&r&&(r.group=t),r=this.suggestDataSource=s.create(r)),e.customDataSource||(r._pageSize=t,r.reader.data=n(r.reader.data,this.options.field)),this.suggestDataSource=r},setAutoCompleteSource:function(){var e=this.input.data("kendoAutoComplete");e&&e.setDataSource(this.suggestDataSource)},setComboBoxSource:function(e){var t=s.create({data:e}),r=this.input.data("kendoComboBox");r&&r.setDataSource(t)},_refreshUI:function(){var t=this,r=a(t.dataSource.filter(),this.options.field)||{},o=t.viewModel;t.manuallyUpdatingVM=!0,r=e.extend(!0,{},r),t.options.type==d&&o.value!==r.value&&t.wrapper.find(":radio").prop("checked",!1),r.operator&&o.set("operator",r.operator),o.set("value",r.value),t.manuallyUpdatingVM=!1},updateDsFilter:function(a){var o,n,l,i=this,s=i.viewModel;i.manuallyUpdatingVM||"operator"==a.field&&s.value===t&&!r(s)||(o=e.extend({},i.viewModel.toJSON(),{field:i.options.field}),n={logic:"and",filters:[]},(o.value!==t&&null!==o.value||r(o)&&!this._clearInProgress)&&n.filters.push(o),l=i._merge(n),i.dataSource.filter(l.filters.length?l:{}))},_merge:function(t){var a,n,l,i=this,s=t.logic||"and",u=t.filters,p=i.dataSource.filter()||{filters:[],logic:"and"};for(o(p,i.options.field),n=0,l=u.length;l>n;n++)a=u[n],a.value=i._parse(a.value);return u=e.grep(u,function(e){return""!==e.value&&null!==e.value||r(e)}),u.length&&(p.filters.length?(t.filters=u,"and"!==p.logic&&(p.filters=[{logic:p.logic,filters:p.filters}],p.logic="and"),p.filters.push(u.length>1?t:u[0])):(p.filters=u,p.logic=s)),p},_createClearIcon:function(){var t=this;e("<button type='button' class='k-button k-button-icon' title = "+t.options.messages.clear+"/>").attr(l.attr("bind"),"visible:operatorVisible").html("<span class='k-icon k-i-close'/>").click(m(t.clearFilter,t)).appendTo(t.wrapper)},clearFilter:function(){this._clearInProgress=!0,this.viewModel.set("value",null),this._clearInProgress=!1},_angularItems:function(e){var t=this.wrapper.closest("th").get(),r=this.options.column;this.angular(e,function(){return{elements:t,data:[{column:r}]}})},destroy:function(){var e=this;e.filterModel=null,e.operatorDropDown=null,e._angularItems("cleanup"),e._refreshHandler&&(e.dataSource.bind(p,e._refreshHandler),e._refreshHandler=null),l.unbind(e.element),u.fn.destroy.call(e),l.destroy(e.element)},events:[p],options:{name:"FilterCell",delay:200,minLength:1,inputWidth:null,values:t,customDataSource:!1,field:"",dataTextField:"",type:"string",suggestDataSource:null,suggestionOperator:"startswith",operator:"eq",showOperators:!0,template:null,messages:{isTrue:"is true",isFalse:"is false",filter:"Filter",clear:"Clear",operator:"Operator"},operators:{string:{eq:g,neq:h,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with",isnull:"Is null",isnotnull:"Is not null",isempty:"Is empty",isnotempty:"Is not empty"},number:{eq:g,neq:h,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than",isnull:"Is null",isnotnull:"Is not null"},date:{eq:g,neq:h,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before",isnull:"Is null",isnotnull:"Is not null"},enums:{eq:g,neq:h,isnull:"Is null",isnotnull:"Is not null"}}}});i.plugin(w)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,r){(r||t)()});;!function(e,define){define("kendo.pager.min",["kendo.data.min"],e)}(function(){return function(e,t){function a(e,t,a,n,s){return e({idx:t,text:a,ns:p.ns,numeric:n,title:s||""})}function n(e,t,a){return P({className:e.substring(1),text:t,wrapClassName:a||""})}function s(e,t,a,n){e.find(t).parent().attr(p.attr("page"),a).attr("tabindex",-1).toggleClass("k-state-disabled",n)}function i(e,t){s(e,u,1,1>=t)}function l(e,t){s(e,f,Math.max(1,t-1),1>=t)}function r(e,t,a){s(e,k,Math.min(a,t+1),t>=a)}function o(e,t,a){s(e,c,a,t>=a)}var p=window.kendo,g=p.ui,d=g.Widget,m=e.proxy,u=".k-i-seek-w",c=".k-i-seek-e",f=".k-i-arrow-w",k=".k-i-arrow-e",h="change",v=".kendoPager",x="click",S="keydown",w="disabled",P=p.template('<a href="\\#" title="#=text#" class="k-link k-pager-nav #= wrapClassName #"><span class="k-icon #= className #">#=text#</span></a>'),b=d.extend({init:function(t,a){var s,g,w,P,b=this;d.fn.init.call(b,t,a),a=b.options,b.dataSource=p.data.DataSource.create(a.dataSource),b.linkTemplate=p.template(b.options.linkTemplate),b.selectTemplate=p.template(b.options.selectTemplate),b.currentPageTemplate=p.template(b.options.currentPageTemplate),s=b.page(),g=b.totalPages(),b._refreshHandler=m(b.refresh,b),b.dataSource.bind(h,b._refreshHandler),a.previousNext&&(b.element.find(u).length||(b.element.append(n(u,a.messages.first,"k-pager-first")),i(b.element,s,g)),b.element.find(f).length||(b.element.append(n(f,a.messages.previous)),l(b.element,s,g))),a.numeric&&(b.list=b.element.find(".k-pager-numbers"),b.list.length||(b.list=e('<ul class="k-pager-numbers k-reset" />').appendTo(b.element))),a.input&&(b.element.find(".k-pager-input").length||b.element.append('<span class="k-pager-input k-label">'+a.messages.page+'<input class="k-textbox">'+p.format(a.messages.of,g)+"</span>"),b.element.on(S+v,".k-pager-input input",m(b._keydown,b))),a.previousNext&&(b.element.find(k).length||(b.element.append(n(k,a.messages.next)),r(b.element,s,g)),b.element.find(c).length||(b.element.append(n(c,a.messages.last,"k-pager-last")),o(b.element,s,g))),a.pageSizes&&(b.element.find(".k-pager-sizes").length||(w=a.pageSizes.length?a.pageSizes:["all",5,10,20],P=e.map(w,function(e){return e.toLowerCase&&"all"===e.toLowerCase()?"<option value='all'>"+a.messages.allPages+"</option>":"<option>"+e+"</option>"}),e('<span class="k-pager-sizes k-label"><select/>'+a.messages.itemsPerPage+"</span>").appendTo(b.element).find("select").html(P.join("")).end().appendTo(b.element)),b.element.find(".k-pager-sizes select").val(b.pageSize()),p.ui.DropDownList&&b.element.find(".k-pager-sizes select").show().kendoDropDownList(),b.element.on(h+v,".k-pager-sizes select",m(b._change,b))),a.refresh&&(b.element.find(".k-pager-refresh").length||b.element.append('<a href="#" class="k-pager-refresh k-link" title="'+a.messages.refresh+'"><span class="k-icon k-i-refresh">'+a.messages.refresh+"</span></a>"),b.element.on(x+v,".k-pager-refresh",m(b._refreshClick,b))),a.info&&(b.element.find(".k-pager-info").length||b.element.append('<span class="k-pager-info k-label" />')),b.element.on(x+v,"a",m(b._click,b)).addClass("k-pager-wrap k-widget k-floatwrap"),b.element.on(x+v,".k-current-page",m(b._toggleActive,b)),a.autoBind&&b.refresh(),p.notify(b)},destroy:function(){var e=this;d.fn.destroy.call(e),e.element.off(v),e.dataSource.unbind(h,e._refreshHandler),e._refreshHandler=null,p.destroy(e.element),e.element=e.list=null},events:[h],options:{name:"Pager",selectTemplate:'<li><span class="k-state-selected">#=text#</span></li>',currentPageTemplate:'<li class="k-current-page"><span class="k-link k-pager-nav">#=text#</span></li>',linkTemplate:'<li><a tabindex="-1" href="\\#" class="k-link" data-#=ns#page="#=idx#" #if (title !== "") {# title="#=title#" #}#>#=text#</a></li>',buttonCount:10,autoBind:!0,numeric:!0,info:!0,input:!1,previousNext:!0,pageSizes:!1,refresh:!1,messages:{allPages:"All",display:"{0} - {1} of {2} items",empty:"No items to display",page:"Page",of:"of {0}",itemsPerPage:"items per page",first:"Go to the first page",previous:"Go to the previous page",next:"Go to the next page",last:"Go to the last page",refresh:"Refresh",morePages:"More pages"}},setDataSource:function(e){var t=this;t.dataSource.unbind(h,t._refreshHandler),t.dataSource=t.options.dataSource=e,e.bind(h,t._refreshHandler),t.options.autoBind&&e.fetch()},refresh:function(e){var t,n,s,g,d,m,u=this,c=1,f=u.page(),k="",h=u.options,v=u.pageSize(),x=u.dataSource.total(),S=u.totalPages(),P=u.linkTemplate,b=h.buttonCount;if(!e||"itemchange"!=e.action){if(h.numeric){for(f>b&&(s=f%b,c=0===s?f-b+1:f-s+1),n=Math.min(c+b-1,S),c>1&&(k+=a(P,c-1,"...",!1,h.messages.morePages)),t=c;n>=t;t++)k+=a(t==f?u.selectTemplate:P,t,t,!0);S>n&&(k+=a(P,t,"...",!1,h.messages.morePages)),""===k&&(k=u.selectTemplate({text:0})),k=this.currentPageTemplate({text:f})+k,u.list.removeClass("k-state-expanded").html(k)}h.info&&(k=x>0?p.format(h.messages.display,(f-1)*v+1,Math.min(f*v,x),x):h.messages.empty,u.element.find(".k-pager-info").html(k)),h.input&&u.element.find(".k-pager-input").html(u.options.messages.page+'<input class="k-textbox">'+p.format(h.messages.of,S)).find("input").val(f).attr(w,1>x).toggleClass("k-state-disabled",1>x),h.previousNext&&(i(u.element,f,S),l(u.element,f,S),r(u.element,f,S),o(u.element,f,S)),h.pageSizes&&(g=u.element.find(".k-pager-sizes option[value='all']").length>0,d=g&&v===this.dataSource.total(),m=v,d&&(v="all",m=h.messages.allPages),u.element.find(".k-pager-sizes select").val(v).filter("["+p.attr("role")+"=dropdownlist]").kendoDropDownList("value",v).kendoDropDownList("text",m))}},_keydown:function(e){if(e.keyCode===p.keys.ENTER){var t=this.element.find(".k-pager-input").find("input"),a=parseInt(t.val(),10);(isNaN(a)||1>a||a>this.totalPages())&&(a=this.page()),t.val(a),this.page(a)}},_refreshClick:function(e){e.preventDefault(),this.dataSource.read()},_change:function(e){var t=e.currentTarget.value,a=parseInt(t,10),n=this.dataSource;isNaN(a)?"all"==(t+"").toLowerCase()&&n.pageSize(n.total()):n.pageSize(a)},_toggleActive:function(){this.list.toggleClass("k-state-expanded")},_click:function(t){var a=e(t.currentTarget);t.preventDefault(),a.is(".k-state-disabled")||this.page(a.attr(p.attr("page")))},totalPages:function(){return Math.ceil((this.dataSource.total()||0)/(this.pageSize()||1))},pageSize:function(){return this.dataSource.pageSize()||this.dataSource.total()},page:function(e){return e===t?this.dataSource.total()>0?this.dataSource.page():0:(this.dataSource.page(e),this.trigger(h,{index:e}),t)}});g.plugin(b)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,a){(a||t)()});;!function(e,define){define("kendo.selectable.min",["kendo.core.min","kendo.userevents.min"],e)}(function(){return function(e,t){function n(e,t){if(!e.is(":visible"))return!1;var n=l.getOffset(e),i=t.left+t.width,s=t.top+t.height;return n.right=n.left+e.outerWidth(),n.bottom=n.top+e.outerHeight(),!(n.left>i||t.left>n.right||n.top>s||t.top>n.bottom)}var i,l=window.kendo,s=l.ui.Widget,a=e.proxy,o=Math.abs,r="aria-selected",c="k-state-selected",u="k-state-selecting",d="k-selectable",f="change",v=".kendoSelectable",m="k-state-unselecting",h="input,a,textarea,.k-multiselect-wrap,select,button,a.k-button>.k-icon,button.k-button>.k-icon,span.k-icon.k-i-expand,span.k-icon.k-i-collapse",p=l.support.browser.msie,_=!1;!function(e){!function(){e('<div class="parent"><span /></div>').on("click",">*",function(){_=!0}).find("span").click().end().off()}()}(e),i=s.extend({init:function(t,n){var i,o=this;s.fn.init.call(o,t,n),o._marquee=e("<div class='k-marquee'><div class='k-marquee-color'></div></div>"),o._lastActive=null,o.element.addClass(d),o.relatedTarget=o.options.relatedTarget,i=o.options.multiple,this.options.aria&&i&&o.element.attr("aria-multiselectable",!0),o.userEvents=new l.UserEvents(o.element,{global:!0,allowSelection:!0,filter:(_?"":"."+d+" ")+o.options.filter,tap:a(o._tap,o)}),i&&o.userEvents.bind("start",a(o._start,o)).bind("move",a(o._move,o)).bind("end",a(o._end,o)).bind("select",a(o._select,o))},events:[f],options:{name:"Selectable",filter:">*",multiple:!1,relatedTarget:e.noop},_isElement:function(e){var t,n=this.element,i=n.length,l=!1;for(e=e[0],t=0;i>t;t++)if(n[t]===e){l=!0;break}return l},_tap:function(t){var n,i=e(t.target),l=this,s=t.event.ctrlKey||t.event.metaKey,a=l.options.multiple,o=a&&t.event.shiftKey,r=t.event.which,u=t.event.button;!l._isElement(i.closest("."+d))||r&&3==r||u&&2==u||this._allowSelection(t.event.target)&&(n=i.hasClass(c),a&&s||l.clear(),i=i.add(l.relatedTarget(i)),o?l.selectRange(l._firstSelectee(),i):(n&&s?(l._unselect(i),l._notify(f)):l.value(i),l._lastActive=l._downTarget=i))},_start:function(n){var i,l=this,s=e(n.target),a=s.hasClass(c),o=n.event.ctrlKey||n.event.metaKey;if(this._allowSelection(n.event.target)){if(l._downTarget=s,!l._isElement(s.closest("."+d)))return l.userEvents.cancel(),t;l.options.useAllItems?l._items=l.element.find(l.options.filter):(i=s.closest(l.element),l._items=i.find(l.options.filter)),n.sender.capture(),l._marquee.appendTo(document.body).css({left:n.x.client+1,top:n.y.client+1,width:0,height:0}),o||l.clear(),s=s.add(l.relatedTarget(s)),a&&(l._selectElement(s,!0),o&&s.addClass(m))}},_move:function(e){var t=this,n={left:e.x.startLocation>e.x.location?e.x.location:e.x.startLocation,top:e.y.startLocation>e.y.location?e.y.location:e.y.startLocation,width:o(e.x.initialDelta),height:o(e.y.initialDelta)};t._marquee.css(n),t._invalidateSelectables(n,e.event.ctrlKey||e.event.metaKey),e.preventDefault()},_end:function(){var e,t=this;t._marquee.remove(),t._unselect(t.element.find(t.options.filter+"."+m)).removeClass(m),e=t.element.find(t.options.filter+"."+u),e=e.add(t.relatedTarget(e)),t.value(e),t._lastActive=t._downTarget,t._items=null},_invalidateSelectables:function(e,t){var i,l,s,a,o=this._downTarget[0],r=this._items;for(i=0,l=r.length;l>i;i++)a=r.eq(i),s=a.add(this.relatedTarget(a)),n(a,e)?a.hasClass(c)?t&&o!==a[0]&&s.removeClass(c).addClass(m):a.hasClass(u)||a.hasClass(m)||s.addClass(u):a.hasClass(u)?s.removeClass(u):t&&a.hasClass(m)&&s.removeClass(m).addClass(c)},value:function(e){var n=this,i=a(n._selectElement,n);return e?(e.each(function(){i(this)}),n._notify(f),t):n.element.find(n.options.filter+"."+c)},_firstSelectee:function(){var e,t=this;return null!==t._lastActive?t._lastActive:(e=t.value(),e.length>0?e[0]:t.element.find(t.options.filter)[0])},_selectElement:function(t,n){var i=e(t),l=!n&&this._notify("select",{element:t});i.removeClass(u),l||(i.addClass(c),this.options.aria&&i.attr(r,!0))},_notify:function(e,t){return t=t||{},this.trigger(e,t)},_unselect:function(e){return e.removeClass(c),this.options.aria&&e.attr(r,!1),e},_select:function(t){this._allowSelection(t.event.target)&&(!p||p&&!e(l._activeElement()).is(h))&&t.preventDefault()},_allowSelection:function(t){return e(t).is(h)?(this.userEvents.cancel(),this._downTarget=null,!1):!0},resetTouchEvents:function(){this.userEvents.cancel()},clear:function(){var e=this.element.find(this.options.filter+"."+c);this._unselect(e)},selectRange:function(t,n){var i,l,s,a=this;for(a.clear(),a.element.length>1&&(s=a.options.continuousItems()),s&&s.length||(s=a.element.find(a.options.filter)),t=e.inArray(e(t)[0],s),n=e.inArray(e(n)[0],s),t>n&&(l=t,t=n,n=l),a.options.useAllItems||(n+=a.element.length-1),i=t;n>=i;i++)a._selectElement(s[i]);a._notify(f)},destroy:function(){var e=this;s.fn.destroy.call(e),e.element.off(v),e.userEvents.destroy(),e._marquee=e._lastActive=e.element=e.userEvents=null}}),i.parseOptions=function(e){var t="string"==typeof e&&e.toLowerCase();return{multiple:t&&t.indexOf("multiple")>-1,cell:t&&t.indexOf("cell")>-1}},l.ui.plugin(i)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});;!function(e,define){define("kendo.reorderable.min",["kendo.core.min","kendo.draganddrop.min"],e)}(function(){return function(e,r){function n(r,n){r=e(r),n?r.find(".k-drag-status").removeClass("k-add").addClass("k-denied"):r.find(".k-drag-status").removeClass("k-denied").addClass("k-add")}var t=window.kendo,a=t.getOffset,d=t.ui.Widget,o="change",i="k-reorderable",g=d.extend({init:function(r,g){var l,s=this,u=t.guid()+"-reorderable";d.fn.init.call(s,r,g),r=s.element.addClass(i),g=s.options,s.draggable=l=g.draggable||new t.ui.Draggable(r,{group:u,autoScroll:!0,filter:g.filter,hint:g.hint}),s.reorderDropCue=e('<div class="k-reorder-cue"><div class="k-icon k-i-arrow-s"></div><div class="k-icon k-i-arrow-n"></div></div>'),r.find(l.options.filter).kendoDropTarget({group:l.options.group,dragenter:function(e){var r,t,d,o;s._draggable&&(r=this.element,d=!s._dropTargetAllowed(r)||s._isLastDraggable(),n(e.draggable.hint,d),d||(t=a(r),o=t.left,g.inSameContainer&&!g.inSameContainer({source:r,target:s._draggable,sourceIndex:s._index(r),targetIndex:s._index(s._draggable)})?s._dropTarget=r:s._index(r)>s._index(s._draggable)&&(o+=r.outerWidth()),s.reorderDropCue.css({height:r.outerHeight(),top:t.top,left:o}).appendTo(document.body)))},dragleave:function(e){n(e.draggable.hint,!0),s.reorderDropCue.remove(),s._dropTarget=null},drop:function(){var e,r;s._dropTarget=null,s._draggable&&(e=this.element,r=s._draggable,s._dropTargetAllowed(e)&&!s._isLastDraggable()&&s.trigger(o,{element:s._draggable,target:e,oldIndex:s._index(r),newIndex:s._index(e),position:a(s.reorderDropCue).left>a(e).left?"after":"before"}))}}),l.bind(["dragcancel","dragend","dragstart","drag"],{dragcancel:function(){s.reorderDropCue.remove(),s._draggable=null,s._elements=null},dragend:function(){s.reorderDropCue.remove(),s._draggable=null,s._elements=null},dragstart:function(e){s._draggable=e.currentTarget,s._elements=s.element.find(s.draggable.options.filter)},drag:function(e){var r,n;s._dropTarget&&!this.hint.find(".k-drag-status").hasClass("k-denied")&&(r=a(s._dropTarget).left,n=s._dropTarget.outerWidth(),s.reorderDropCue.css(e.pageX>r+n/2?{left:r+n}:{left:r}))}})},options:{name:"Reorderable",filter:"*"},events:[o],_isLastDraggable:function(){var e,r=this.options.inSameContainer,n=this._draggable[0],t=this._elements.get(),a=!1;if(!r)return!1;for(;!a&&t.length>0;)e=t.pop(),a=n!==e&&r({source:n,target:e,sourceIndex:this._index(n),targetIndex:this._index(e)});return!a},_dropTargetAllowed:function(e){var r=this.options.inSameContainer,n=this.options.dragOverContainers,t=this._draggable;return t[0]===e[0]?!1:r&&n?r({source:t,target:e,sourceIndex:this._index(t),targetIndex:this._index(e)})?!0:n(this._index(t),this._index(e)):!0},_index:function(e){return this._elements.index(e)},destroy:function(){var r=this;d.fn.destroy.call(r),r.element.find(r.draggable.options.filter).each(function(){var r=e(this);r.data("kendoDropTarget")&&r.data("kendoDropTarget").destroy()}),r.draggable&&(r.draggable.destroy(),r.draggable.element=r.draggable=null),r.elements=r.reorderDropCue=r._elements=r._draggable=null}});t.ui.plugin(g)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,r,n){(n||r)()});;!function(i,define){define("kendo.resizable.min",["kendo.core.min","kendo.draganddrop.min"],i)}(function(){return function(i,t){var n=window.kendo,o=n.ui,e=o.Widget,s=i.proxy,r=n.isFunction,a=i.extend,c="horizontal",u="vertical",d="start",l="resize",p="resizeend",_=e.extend({init:function(i,t){var n=this;e.fn.init.call(n,i,t),n.orientation=n.options.orientation.toLowerCase()!=u?c:u,n._positionMouse=n.orientation==c?"x":"y",n._position=n.orientation==c?"left":"top",n._sizingDom=n.orientation==c?"outerWidth":"outerHeight",n.draggable=new o.Draggable(i,{distance:1,filter:t.handle,drag:s(n._resize,n),dragcancel:s(n._cancel,n),dragstart:s(n._start,n),dragend:s(n._stop,n)}),n.userEvents=n.draggable.userEvents},events:[l,p,d],options:{name:"Resizable",orientation:c},resize:function(){},_max:function(i){var n=this,o=n.hint?n.hint[n._sizingDom]():0,e=n.options.max;return r(e)?e(i):e!==t?n._initialElementPosition+e-o:e},_min:function(i){var n=this,o=n.options.min;return r(o)?o(i):o!==t?n._initialElementPosition+o:o},_start:function(t){var n=this,o=n.options.hint,e=i(t.currentTarget);n._initialElementPosition=e.position()[n._position],n._initialMousePosition=t[n._positionMouse].startLocation,o&&(n.hint=r(o)?i(o(e)):o,n.hint.css({position:"absolute"}).css(n._position,n._initialElementPosition).appendTo(n.element)),n.trigger(d,t),n._maxPosition=n._max(t),n._minPosition=n._min(t),i(document.body).css("cursor",e.css("cursor"))},_resize:function(i){var n,o=this,e=o._maxPosition,s=o._minPosition,r=o._initialElementPosition+(i[o._positionMouse].location-o._initialMousePosition);n=s!==t?Math.max(s,r):r,o.position=n=e!==t?Math.min(e,n):n,o.hint&&o.hint.toggleClass(o.options.invalidClass||"",n==e||n==s).css(o._position,n),o.resizing=!0,o.trigger(l,a(i,{position:n}))},_stop:function(t){var n=this;n.hint&&n.hint.remove(),n.resizing=!1,n.trigger(p,a(t,{position:n.position})),i(document.body).css("cursor","")},_cancel:function(i){var n=this;n.hint&&(n.position=t,n.hint.css(n._position,n._initialElementPosition),n._stop(i))},destroy:function(){var i=this;e.fn.destroy.call(i),i.draggable&&i.draggable.destroy()},press:function(i){if(i){var t=i.position(),n=this;n.userEvents.press(t.left,t.top,i[0]),n.targetPosition=t,n.target=i}},move:function(i){var n=this,o=n._position,e=n.targetPosition,s=n.position;s===t&&(s=e[o]),e[o]=s+i,n.userEvents.move(e.left,e.top)},end:function(){this.userEvents.end(),this.target=this.position=t}});n.ui.plugin(_)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(i,t,n){(n||t)()});;!function(e,define){define("kendo.view.min",["kendo.core.min","kendo.binder.min","kendo.fx.min"],e)}(function(){return function(e,n){function t(e){if(!e)return{};var n=e.match(v)||[];return{type:n[1],direction:n[3],reverse:"reverse"===n[5]}}var i=window.kendo,r=i.Observable,o="SCRIPT",a="init",s="show",c="hide",d="transitionStart",h="transitionEnd",f="attach",l="detach",u=/unrecognized expression/,m=r.extend({init:function(e,n){var t=this;n=n||{},r.fn.init.call(t),t.content=e,t.id=i.guid(),t.tagName=n.tagName||"div",t.model=n.model,t._wrap=n.wrap!==!1,this._evalTemplate=n.evalTemplate||!1,t._fragments={},t.bind([a,s,c,d,h],n)},render:function(n){var t=this,r=!t.element;return r&&(t.element=t._createElement()),n&&e(n).append(t.element),r&&(i.bind(t.element,t.model),t.trigger(a)),n&&(t._eachFragment(f),t.trigger(s)),t.element},clone:function(){return new g(this)},triggerBeforeShow:function(){return!0},triggerBeforeHide:function(){return!0},showStart:function(){this.element.css("display","")},showEnd:function(){},hideEnd:function(){this.hide()},beforeTransition:function(e){this.trigger(d,{type:e})},afterTransition:function(e){this.trigger(h,{type:e})},hide:function(){this._eachFragment(l),this.element.detach(),this.trigger(c)},destroy:function(){var e=this.element;e&&(i.unbind(e),i.destroy(e),e.remove())},fragments:function(n){e.extend(this._fragments,n)},_eachFragment:function(e){for(var n in this._fragments)this._fragments[n][e](this,n)},_createElement:function(){var n,t,r,a=this,s="<"+a.tagName+" />";try{t=e(document.getElementById(a.content)||a.content),t[0].tagName===o&&(t=t.html())}catch(c){u.test(c.message)&&(t=a.content)}return"string"==typeof t?(t=t.replace(/^\s+|\s+$/g,""),a._evalTemplate&&(t=i.template(t)(a.model||{})),n=e(s).append(t),a._wrap||(n=n.contents())):(n=t,a._evalTemplate&&(r=e(i.template(e("<div />").append(n.clone(!0)).html())(a.model||{})),e.contains(document,n[0])&&n.replaceWith(r),n=r),a._wrap&&(n=n.wrapAll(s).parent())),n}}),g=i.Class.extend({init:function(n){e.extend(this,{element:n.element.clone(!0),transition:n.transition,id:n.id}),n.element.parent().append(this.element)},hideEnd:function(){this.element.remove()},beforeTransition:e.noop,afterTransition:e.noop}),w=m.extend({init:function(e,n){m.fn.init.call(this,e,n),this.containers={}},container:function(e){var n=this.containers[e];return n||(n=this._createContainer(e),this.containers[e]=n),n},showIn:function(e,n,t){this.container(e).show(n,t)},_createContainer:function(e){var n,t=this.render(),i=t.find(e);if(!i.length&&t.is(e)){if(!t.is(e))throw Error("can't find a container with the specified "+e+" selector");i=t}return n=new _(i),n.bind("accepted",function(e){e.view.render(i)}),n}}),p=m.extend({attach:function(e,n){e.element.find(n).replaceWith(this.render())},detach:function(){}}),v=/^(\w+)(:(\w+))?( (\w+))?$/,_=r.extend({init:function(e){r.fn.init.call(this),this.container=e,this.history=[],this.view=null,this.running=!1},after:function(){this.running=!1,this.trigger("complete",{view:this.view}),this.trigger("after")},end:function(){this.view.showEnd(),this.previous.hideEnd(),this.after()},show:function(e,n,r){if(!e.triggerBeforeShow()||this.view&&!this.view.triggerBeforeHide())return this.trigger("after"),!1;r=r||e.id;var o=this,a=e===o.view?e.clone():o.view,s=o.history,c=s[s.length-2]||{},d=c.id===r,h=n||(d?s[s.length-1].transition:e.transition),f=t(h);return o.running&&o.effect.stop(),"none"===h&&(h=null),o.trigger("accepted",{view:e}),o.view=e,o.previous=a,o.running=!0,d?s.pop():s.push({id:r,transition:h}),a?(h&&i.effects.enabled?(e.element.addClass("k-fx-hidden"),e.showStart(),d&&!n&&(f.reverse=!f.reverse),o.effect=i.fx(e.element).replace(a.element,f.type).beforeTransition(function(){e.beforeTransition("show"),a.beforeTransition("hide")}).afterTransition(function(){e.afterTransition("show"),a.afterTransition("hide")}).direction(f.direction).setReverse(f.reverse),o.effect.run().then(function(){o.end()})):(e.showStart(),o.end()),!0):(e.showStart(),e.showEnd(),o.after(),!0)}});i.ViewContainer=_,i.Fragment=p,i.Layout=w,i.View=m,i.ViewClone=g}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,t){(t||n)()});;!function(e,define){define("kendo.mobile.view.min",["kendo.core.min","kendo.fx.min","kendo.mobile.scroller.min","kendo.view.min"],e)}(function(){return function(e,t){function i(e){var t,i,o=e.find(x("popover")),n=s.roles;for(t=0,i=o.length;i>t;t++)r.initWidget(o[t],{},n)}function o(e){r.triggeredByInput(e)||e.preventDefault()}function n(t){t.each(function(){r.initWidget(e(this),{},s.roles)})}var r=window.kendo,a=r.mobile,s=a.ui,l=r.attr,h=s.Widget,d=r.ViewClone,c="init",u='<div style="height: 100%; width: 100%; position: absolute; top: 0; left: 0; z-index: 20000; display: none" />',p="beforeShow",f="show",g="afterShow",m="beforeHide",v="transitionEnd",w="transitionStart",y="hide",_="destroy",b=r.attrValue,x=r.roleSelector,S=r.directiveSelector,k=r.compileMobileDirective,V=h.extend({init:function(t,i){h.fn.init.call(this,t,i),this.params={},e.extend(this,i),this.transition=this.transition||this.defaultTransition,this._id(),this.options.$angular?this._overlay():(this._layout(),this._overlay(),this._scroller(),this._model())},events:[c,p,f,g,m,y,_,w,v],options:{name:"View",title:"",layout:null,getLayout:e.noop,reload:!1,transition:"",defaultTransition:"",useNativeScrolling:!1,stretch:!1,zoom:!1,model:null,modelScope:window,scroller:{},initWidgets:!0},enable:function(e){t===e&&(e=!0),e?this.overlay.hide():this.overlay.show()},destroy:function(){this.layout&&this.layout.detach(this),this.trigger(_),h.fn.destroy.call(this),this.scroller&&this.scroller.destroy(),this.options.$angular&&this.element.scope().$destroy(),r.destroy(this.element)},purge:function(){this.destroy(),this.element.remove()},triggerBeforeShow:function(){return this.trigger(p,{view:this})?!1:!0},triggerBeforeHide:function(){return this.trigger(m,{view:this})?!1:!0},showStart:function(){var e=this.element;e.css("display",""),this.inited?this._invokeNgController():(this.inited=!0,this.trigger(c,{view:this})),this.layout&&this.layout.attach(this),this._padIfNativeScrolling(),this.trigger(f,{view:this}),r.resize(e)},showEnd:function(){this.trigger(g,{view:this}),this._padIfNativeScrolling()},hideEnd:function(){var e=this;e.element.hide(),e.trigger(y,{view:e}),e.layout&&e.layout.trigger(y,{view:e,layout:e.layout})},beforeTransition:function(e){this.trigger(w,{type:e})},afterTransition:function(e){this.trigger(v,{type:e})},_padIfNativeScrolling:function(){if(a.appLevelNativeScrolling()){var e=r.support.mobileOS&&r.support.mobileOS.android,t=a.application.skin()||"",i=a.application.os.android||t.indexOf("android")>-1,o="flat"===t||t.indexOf("material")>-1,n=!e&&!i||o?"header":"footer",s=!e&&!i||o?"footer":"header";this.content.css({paddingTop:this[n].height(),paddingBottom:this[s].height()})}},contentElement:function(){var e=this;return e.options.stretch?e.content:e.scrollerContent},clone:function(){return new d(this)},_scroller:function(){var t=this;a.appLevelNativeScrolling()||(t.options.stretch?t.content.addClass("km-stretched-view"):(t.content.kendoMobileScroller(e.extend(t.options.scroller,{zoom:t.options.zoom,useNative:t.options.useNativeScrolling})),t.scroller=t.content.data("kendoMobileScroller"),t.scrollerContent=t.scroller.scrollElement),r.support.kineticScrollNeeded&&(e(t.element).on("touchmove",".km-header",o),t.options.useNativeScrolling||t.options.stretch||e(t.element).on("touchmove",".km-content",o)))},_model:function(){var e=this,t=e.element,o=e.options.model;"string"==typeof o&&(o=r.getter(o)(e.options.modelScope)),e.model=o,i(t),e.element.css("display",""),e.options.initWidgets&&(o?r.bind(t,o,s,r.ui,r.dataviz.ui):a.init(t.children())),e.element.css("display","none")},_id:function(){var e=this.element,t=e.attr("id")||"";this.id=b(e,"url")||"#"+t,"#"==this.id&&(this.id=r.guid(),e.attr("id",this.id))},_layout:function(){var e=x("content"),t=this.element;t.addClass("km-view"),this.header=t.children(x("header")).addClass("km-header"),this.footer=t.children(x("footer")).addClass("km-footer"),t.children(e)[0]||t.wrapInner("<div "+l("role")+'="content"></div>'),this.content=t.children(x("content")).addClass("km-content"),this.element.prepend(this.header).append(this.footer),this.layout=this.options.getLayout(this.layout),this.layout&&this.layout.setup(this)},_overlay:function(){this.overlay=e(u).appendTo(this.element)},_invokeNgController:function(){var t,i,o;this.options.$angular&&(t=this.element.controller(),i=this.options.$angular[0],t&&(o=e.proxy(this,"_callController",t,i),/^\$(digest|apply)$/.test(i.$$phase)?o():i.$apply(o)))},_callController:function(e,t){this.element.injector().invoke(e.constructor,e,{$scope:t})}}),C=h.extend({init:function(e,t){h.fn.init.call(this,e,t),e=this.element,this.header=e.children(this._locate("header")).addClass("km-header"),this.footer=e.children(this._locate("footer")).addClass("km-footer"),this.elements=this.header.add(this.footer),i(e),this.options.$angular||r.mobile.init(this.element.children()),this.element.detach(),this.trigger(c,{layout:this})},_locate:function(e){return this.options.$angular?S(e):x(e)},options:{name:"Layout",id:null,platform:null},events:[c,f,y],setup:function(e){e.header[0]||(e.header=this.header),e.footer[0]||(e.footer=this.footer)},detach:function(e){var t=this;e.header===t.header&&t.header[0]&&e.element.prepend(t.header.detach()[0].cloneNode(!0)),e.footer===t.footer&&t.footer.length&&e.element.append(t.footer.detach()[0].cloneNode(!0))},attach:function(e){var t=this,i=t.currentView;i&&t.detach(i),e.header===t.header&&(t.header.detach(),e.element.children(x("header")).remove(),e.element.prepend(t.header)),e.footer===t.footer&&(t.footer.detach(),e.element.children(x("footer")).remove(),e.element.append(t.footer)),t.trigger(f,{layout:t,view:e}),t.currentView=e}}),$=r.Observable,L=/<body[^>]*>(([\u000a\u000d\u2028\u2029]|.)*)<\/body>/i,N="loadStart",T="loadComplete",E="showStart",I="sameViewRequested",O="viewShow",R="viewTypeDetermined",W="after",z=$.extend({init:function(t){var i,o,a,s,l=this;if($.fn.init.call(l),e.extend(l,t),l.sandbox=e("<div />"),a=l.container,i=l._hideViews(a),l.rootView=i.first(),!l.rootView[0]&&t.rootNeeded)throw o=a[0]==r.mobile.application.element[0]?'Your kendo mobile application element does not contain any direct child elements with data-role="view" attribute set. Make sure that you instantiate the mobile application using the correct container.':'Your pane element does not contain any direct child elements with data-role="view" attribute set.',Error(o);l.layouts={},l.viewContainer=new r.ViewContainer(l.container),l.viewContainer.bind("accepted",function(e){e.view.params=l.params}),l.viewContainer.bind("complete",function(e){l.trigger(O,{view:e.view})}),l.viewContainer.bind(W,function(){l.trigger(W)}),this.getLayoutProxy=e.proxy(this,"_getLayout"),l._setupLayouts(a),s=a.children(l._locate("modalview drawer")),l.$angular?(l.$angular[0].viewOptions={defaultTransition:l.transition,loader:l.loader,container:l.container,getLayout:l.getLayoutProxy},s.each(function(i,o){k(e(o),t.$angular[0])})):n(s),this.bind(this.events,t)},events:[E,W,O,N,T,I,R],destroy:function(){r.destroy(this.container);for(var e in this.layouts)this.layouts[e].destroy()},view:function(){return this.viewContainer.view},showView:function(e,t,i){if(e=e.replace(RegExp("^"+this.remoteViewURLPrefix),""),""===e&&this.remoteViewURLPrefix&&(e="/"),e.replace(/^#/,"")===this.url)return this.trigger(I),!1;this.trigger(E);var o=this,n=function(i){return o.viewContainer.show(i,t,e)},a=o._findViewElement(e),s=r.widgetInstance(a);return o.url=e.replace(/^#/,""),o.params=i,s&&s.reload&&(s.purge(),a=[]),this.trigger(R,{remote:0===a.length,url:e}),a[0]?(s||(s=o._createView(a)),n(s)):(this.serverNavigation?location.href=e:o._loadView(e,n),!0)},append:function(e,t){var i,o,r,a=this.sandbox,s=(t||"").split("?")[0],h=this.container;return L.test(e)&&(e=RegExp.$1),a[0].innerHTML=e,h.append(a.children("script, style")),i=this._hideViews(a),r=i.first(),r.length||(i=r=a.wrapInner("<div data-role=view />").children()),s&&r.hide().attr(l("url"),s),this._setupLayouts(a),o=a.children(this._locate("modalview drawer")),h.append(a.children(this._locate("layout modalview drawer")).add(i)),n(o),this._createView(r)},_locate:function(e){return this.$angular?S(e):x(e)},_findViewElement:function(e){var t,i=e.split("?")[0];return i?(t=this.container.children("["+l("url")+"='"+i+"']"),t[0]||-1!==i.indexOf("/")||(t=this.container.children("#"===i.charAt(0)?i:"#"+i)),t):this.rootView},_createView:function(e){return this.$angular?k(e,this.$angular[0]):r.initWidget(e,{defaultTransition:this.transition,loader:this.loader,container:this.container,getLayout:this.getLayoutProxy,modelScope:this.modelScope,reload:b(e,"reload")},s.roles)},_getLayout:function(e){return""===e?null:e?this.layouts[e]:this.layouts[this.layout]},_loadView:function(t,i){this._xhr&&this._xhr.abort(),this.trigger(N),this._xhr=e.get(r.absoluteURL(t,this.remoteViewURLPrefix),"html").always(e.proxy(this,"_xhrComplete",i,t))},_xhrComplete:function(e,t,i){var o=!0;if("object"==typeof i&&0===i.status){if(!(i.responseText&&i.responseText.length>0))return;o=!0,i=i.responseText}this.trigger(T),o&&e(this.append(i,t))},_hideViews:function(e){return e.children(this._locate("view splitview")).hide()},_setupLayouts:function(t){var i,o=this;t.children(o._locate("layout")).each(function(){i=o.$angular?k(e(this),o.$angular[0]):r.initWidget(e(this),{},s.roles);var t=i.options.platform;t&&t!==a.application.os.name?i.destroy():o.layouts[i.options.id]=i})}});r.mobile.ViewEngine=z,s.plugin(V),s.plugin(C)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()});;!function(n,define){define("kendo.mobile.loader.min",["kendo.core.min"],n)}(function(){return function(n,t){var e=window.kendo,i=e.mobile.ui,o=i.Widget,a=n.map(e.eventMap,function(n){return n}).join(" ").split(" "),s=o.extend({init:function(t,e){var i=this,a=n('<div class="km-loader"><span class="km-loading km-spin"></span><span class="km-loading-left"></span><span class="km-loading-right"></span></div>');o.fn.init.call(i,a,e),i.container=t,i.captureEvents=!1,i._attachCapture(),a.append(i.options.loading).hide().appendTo(t)},options:{name:"Loader",loading:"<h1>Loading...</h1>",timeout:100},show:function(){var n=this;clearTimeout(n._loading),n.options.loading!==!1&&(n.captureEvents=!0,n._loading=setTimeout(function(){n.element.show()},n.options.timeout))},hide:function(){this.captureEvents=!1,clearTimeout(this._loading),this.element.hide()},changeMessage:function(n){this.options.loading=n,this.element.find(">h1").html(n)},transition:function(){this.captureEvents=!0,this.container.css("pointer-events","none")},transitionDone:function(){this.captureEvents=!1,this.container.css("pointer-events","")},_attachCapture:function(){function n(n){e.captureEvents&&n.preventDefault()}var t,e=this;for(e.captureEvents=!1,t=0;a.length>t;t++)e.container[0].addEventListener(a[t],n,!0)}});i.plugin(s)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(n,t,e){(e||t)()});;!function(t,define){define("kendo.mobile.pane.min",["kendo.mobile.view.min","kendo.mobile.loader.min"],t)}(function(){return function(t,e){var i=window.kendo,n=i.mobile,o=i.roleSelector,a=n.ui,r=a.Widget,s=n.ViewEngine,l=a.View,u=n.ui.Loader,c="external",h="href",d="#!",p="navigate",v="viewShow",f="sameViewRequested",g=i.support.mobileOS,w=g.ios&&!g.appMode&&g.flatVersion>=700,m=/popover|actionsheet|modalview|drawer/,y="#:back",b=i.attrValue,k=r.extend({init:function(t,e){var n=this;r.fn.init.call(n,t,e),e=n.options,t=n.element,t.addClass("km-pane"),n.options.collapsible&&t.addClass("km-collapsible-pane"),this.history=[],this.historyCallback=function(t,e,i){var o=n.transition;return n.transition=null,w&&i&&(o="none"),n.viewEngine.showView(t,o,e)},this._historyNavigate=function(t){if(t===y){if(1===n.history.length)return;n.history.pop(),t=n.history[n.history.length-1]}else n.history.push(t);n.historyCallback(t,i.parseQueryStringParams(t))},this._historyReplace=function(t){var e=i.parseQueryStringParams(t);n.history[n.history.length-1]=t,n.historyCallback(t,e)},n.loader=new u(t,{loading:n.options.loading}),n.viewEngine=new s({container:t,transition:e.transition,modelScope:e.modelScope,rootNeeded:!e.initial,serverNavigation:e.serverNavigation,remoteViewURLPrefix:e.root||"",layout:e.layout,$angular:e.$angular,loader:n.loader,showStart:function(){n.loader.transition(),n.closeActiveDialogs()},after:function(){n.loader.transitionDone()},viewShow:function(t){n.trigger(v,t)},loadStart:function(){n.loader.show()},loadComplete:function(){n.loader.hide()},sameViewRequested:function(){n.trigger(f)},viewTypeDetermined:function(t){t.remote&&n.options.serverNavigation||n.trigger(p,{url:t.url})}}),this._setPortraitWidth(),i.onResize(function(){n._setPortraitWidth()}),n._setupAppLinks()},closeActiveDialogs:function(){var e=this.element.find(o("actionsheet popover modalview")).filter(":visible");e.each(function(){i.widgetInstance(t(this),a).close()})},navigateToInitial:function(){var t=this.options.initial;return t&&this.navigate(t),t},options:{name:"Pane",portraitWidth:"",transition:"",layout:"",collapsible:!1,initial:null,modelScope:window,loading:"<h1>Loading...</h1>"},events:[p,v,f],append:function(t){return this.viewEngine.append(t)},destroy:function(){r.fn.destroy.call(this),this.viewEngine.destroy(),this.userEvents.destroy()},navigate:function(t,e){t instanceof l&&(t=t.id),this.transition=e,this._historyNavigate(t)},replace:function(t,e){t instanceof l&&(t=t.id),this.transition=e,this._historyReplace(t)},bindToRouter:function(t){var e=this,n=this.history,o=this.viewEngine;t.bind("init",function(e){var a,r=e.url,s=t.pushState?r:"/";o.rootView.attr(i.attr("url"),s),a=n.length,"/"===r&&a&&(t.navigate(n[a-1],!0),e.preventDefault())}),t.bind("routeMissing",function(t){e.historyCallback(t.url,t.params,t.backButtonPressed)||t.preventDefault()}),t.bind("same",function(){e.trigger(f)}),e._historyNavigate=function(e){t.navigate(e)},e._historyReplace=function(e){t.replace(e)}},hideLoading:function(){this.loader.hide()},showLoading:function(){this.loader.show()},changeLoadingMessage:function(t){this.loader.changeMessage(t)},view:function(){return this.viewEngine.view()},_setPortraitWidth:function(){var t,e=this.options.portraitWidth;e&&(t=i.mobile.application.element.is(".km-vertical")?e:"auto",this.element.css("width",t))},_setupAppLinks:function(){var e=this,n="tab",a="[data-"+i.ns+"navigate-on-press]",r=t.map(["button","backbutton","detailbutton","listview-link"],function(t){return o(t)+":not("+a+")"}).join(",");this.element.handler(this).on("down",o(n)+","+a,"_mouseup").on("click",o(n)+","+r+","+a,"_appLinkClick"),this.userEvents=new i.UserEvents(this.element,{fastTap:!0,filter:r,tap:function(t){t.event.currentTarget=t.touch.currentTarget,e._mouseup(t.event)}}),this.element.css("-ms-touch-action","")},_appLinkClick:function(e){var i=t(e.currentTarget).attr("href"),n=i&&"#"!==i[0]&&this.options.serverNavigation;n||b(t(e.currentTarget),"rel")==c||e.preventDefault()},_mouseup:function(o){if(!(o.which>1||o.isDefaultPrevented())){var r=this,s=t(o.currentTarget),l=b(s,"transition"),u=b(s,"rel")||"",p=b(s,"target"),v=s.attr(h),f=w&&0===s[0].offsetHeight,g=v&&"#"!==v[0]&&this.options.serverNavigation;f||g||u===c||e===v||v===d||(s.attr(h,d),setTimeout(function(){s.attr(h,v)}),u.match(m)?(i.widgetInstance(t(v),a).openFor(s),("actionsheet"===u||"drawer"===u)&&o.stopPropagation()):("_top"===p?r=n.application.pane:p&&(r=t("#"+p).data("kendoMobilePane")),r.navigate(v,l)),o.preventDefault())}}});k.wrap=function(t){t.is(o("view"))||(t=t.wrap("<div data-"+i.ns+'role="view" data-stretch="true"></div>').parent());var e=t.wrap('<div class="km-pane-wrapper"><div></div></div>').parent(),n=new k(e);return n.navigate(""),n},a.plugin(k)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,i){(i||e)()});;!function(e,define){define("kendo.mobile.popover.min",["kendo.popup.min","kendo.mobile.pane.min"],e)}(function(){return function(e,o){var i=window.kendo,t=i.mobile,n=t.ui,p="hide",r="open",s="close",a='<div class="km-popup-wrapper" />',l='<div class="km-popup-arrow" />',d='<div class="km-popup-overlay" />',c="km-up km-down km-left km-right",h=n.Widget,u={down:{origin:"bottom center",position:"top center"},up:{origin:"top center",position:"bottom center"},left:{origin:"center left",position:"center right",collision:"fit flip"},right:{origin:"center right",position:"center left",collision:"fit flip"}},f={animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:400}}},w={horizontal:{offset:"top",size:"height"},vertical:{offset:"left",size:"width"}},m={up:"down",down:"up",left:"right",right:"left"},v=h.extend({init:function(o,t){var n,r,s=this,c=o.closest(".km-modalview-wrapper"),m=o.closest(".km-root").children(".km-pane").first(),v=c[0]?c:m;t.viewport?m=t.viewport:m[0]||(m=window),t.container?v=t.container:v[0]||(v=document.body),n={viewport:m,copyAnchorStyles:!1,autosize:!0,open:function(){s.overlay.show()},activate:e.proxy(s._activate,s),deactivate:function(){s.overlay.hide(),s._apiCall||s.trigger(p),s._apiCall=!1}},h.fn.init.call(s,o,t),o=s.element,t=s.options,o.wrap(a).addClass("km-popup").show(),r=s.options.direction.match(/left|right/)?"horizontal":"vertical",s.dimensions=w[r],s.wrapper=o.parent().css({width:t.width,height:t.height}).addClass("km-popup-wrapper km-"+t.direction).hide(),s.arrow=e(l).prependTo(s.wrapper).hide(),s.overlay=e(d).appendTo(v).hide(),n.appendTo=s.overlay,t.className&&s.overlay.addClass(t.className),s.popup=new i.ui.Popup(s.wrapper,e.extend(!0,n,f,u[t.direction]))},options:{name:"Popup",width:240,height:"",direction:"down",container:null,viewport:null},events:[p],show:function(o){this.popup.options.anchor=e(o),this.popup.open()},hide:function(){this._apiCall=!0,this.popup.close()},destroy:function(){h.fn.destroy.call(this),this.popup.destroy(),this.overlay.remove()},target:function(){return this.popup.options.anchor},_activate:function(){var o=this,i=o.options.direction,t=o.dimensions,n=t.offset,p=o.popup,r=p.options.anchor,s=e(r).offset(),a=e(p.element).offset(),l=p.flipped?m[i]:i,d=2*o.arrow[t.size](),h=o.element[t.size]()-o.arrow[t.size](),u=e(r)[t.size](),f=s[n]-a[n]+u/2;d>f&&(f=d),f>h&&(f=h),o.wrapper.removeClass(c).addClass("km-"+l),o.arrow.css(n,f).show()}}),g=h.extend({init:function(o,t){var p,r=this;r.initialOpen=!1,h.fn.init.call(r,o,t),p=e.extend({className:"km-popover-root",hide:function(){r.trigger(s)}},this.options.popup),r.popup=new v(r.element,p),r.popup.overlay.on("move",function(e){e.target==r.popup.overlay[0]&&e.preventDefault()}),r.pane=new n.Pane(r.element,e.extend(this.options.pane,{$angular:this.options.$angular})),i.notify(r,n)},options:{name:"PopOver",popup:{},pane:{}},events:[r,s],open:function(e){this.popup.show(e),this.initialOpen?this.pane.view()._invokeNgController():(this.pane.navigateToInitial()||this.pane.navigate(""),this.popup.popup._position(),this.initialOpen=!0)},openFor:function(e){this.open(e),this.trigger(r,{target:this.popup.target()})},close:function(){this.popup.hide()},destroy:function(){h.fn.destroy.call(this),this.pane.destroy(),this.popup.destroy(),i.destroy(this.element)}});n.plugin(v),n.plugin(g)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,o,i){(i||o)()});;!function(e,define){define("kendo.mobile.shim.min",["kendo.popup.min"],e)}(function(){return function(e,n){var i=window.kendo,o=i.mobile.ui,t=i.ui.Popup,s='<div class="km-shim"/>',a="hide",d=o.Widget,p=d.extend({init:function(n,o){var p=this,c=i.mobile.application,l=i.support.mobileOS,r=c?c.os.name:l?l.name:"ios",u="ios"===r||"wp"===r||(c?c.os.skin:!1),h="blackberry"===r,m=o.align||(u?"bottom center":h?"center right":"center center"),f=o.position||(u?"bottom center":h?"center right":"center center"),w=o.effect||(u?"slideIn:up":h?"slideIn:left":"fade:in"),g=e(s).handler(p).hide();d.fn.init.call(p,n,o),p.shim=g,n=p.element,o=p.options,o.className&&p.shim.addClass(o.className),o.modal||p.shim.on("down","_hide"),(c?c.element:e(document.body)).append(g),p.popup=new t(p.element,{anchor:g,modal:!0,appendTo:g,origin:m,position:f,animation:{open:{effects:w,duration:o.duration},close:{duration:o.duration}},close:function(e){var n=!1;p._apiCall||(n=p.trigger(a)),n&&e.preventDefault(),p._apiCall=!1},deactivate:function(){g.hide()},open:function(){g.show()}}),i.notify(p)},events:[a],options:{name:"Shim",modal:!1,align:n,position:n,effect:n,duration:200},show:function(){this.popup.open()},hide:function(){this._apiCall=!0,this.popup.close()},destroy:function(){d.fn.destroy.call(this),this.shim.kendoDestroy(),this.popup.destroy(),this.shim.remove()},_hide:function(n){n&&e.contains(this.shim.children().children(".k-popup")[0],n.target)||this.popup.close()}});o.plugin(p)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,i){(i||n)()});;!function(e,define){define("kendo.mobile.actionsheet.min",["kendo.mobile.popover.min","kendo.mobile.shim.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.support,o=n.mobile.ui,s=o.Shim,a=o.Popup,c=o.Widget,r="open",l="close",h="command",p="li>a",d="actionsheetContext",u='<div class="km-actionsheet-wrapper" />',m=n.template('<li class="km-actionsheet-cancel"><a href="\\#">#:cancel#</a></li>'),f=c.extend({init:function(t,r){var l,h,d,f=this,g=i.mobileOS;c.fn.init.call(f,t,r),r=f.options,d=r.type,t=f.element,h="auto"===d?g&&g.tablet:"tablet"===d,l=h?a:s,r.cancelTemplate&&(m=n.template(r.cancelTemplate)),t.addClass("km-actionsheet").append(m({cancel:f.options.cancel})).wrap(u).on("up",p,"_click").on("click",p,n.preventDefault),f.view().bind("destroy",function(){f.destroy()}),f.wrapper=t.parent().addClass(d?" km-actionsheet-"+d:""),f.shim=new l(f.wrapper,e.extend({modal:g.ios&&7>g.majorVersion,className:"km-actionsheet-root"},f.options.popup)),f._closeProxy=e.proxy(f,"_close"),f._shimHideProxy=e.proxy(f,"_shimHide"),f.shim.bind("hide",f._shimHideProxy),h&&n.onResize(f._closeProxy),n.notify(f,o)},events:[r,l,h],options:{name:"ActionSheet",cancel:"Cancel",type:"auto",popup:{height:"auto"}},open:function(t,n){var i=this;i.target=e(t),i.context=n,i.shim.show(t)},close:function(){this.context=this.target=null,this.shim.hide()},openFor:function(e){var t=this,n=e.data(d);t.open(e,n),t.trigger(r,{target:e,context:n})},destroy:function(){c.fn.destroy.call(this),n.unbindResize(this._closeProxy),this.shim.destroy()},_click:function(t){var i,o,s,a;t.isDefaultPrevented()||(i=e(t.currentTarget),o=i.data("action"),o&&(s={target:this.target,context:this.context},a=this.options.$angular,a?this.element.injector().get("$parse")(o)(a[0])(s):n.getter(o)(window)(s)),this.trigger(h,{target:this.target,context:this.context,currentTarget:i}),t.preventDefault(),this._close())},_shimHide:function(e){this.trigger(l)?e.preventDefault():this.context=this.target=null},_close:function(e){this.trigger(l)?e.preventDefault():this.close()}});o.plugin(f)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});;!function(e,define){define("kendo.ooxml.min",["kendo.core.min"],e)}(function(){return function(e,t){function o(e){var t=Math.floor(e/26)-1;return(t>=0?o(t):"")+String.fromCharCode(65+e%26)}function r(e,t){return o(t)+(e+1)}function i(e,t){return o(t)+"$"+(e+1)}function n(e){var t=e.frozenRows||(e.freezePane||{}).rowSplit||1;return t-1}function s(e){return(e/7*100+.5)/100}function l(e){return.75*e}function a(e){return 6>e.length&&(e=e.replace(/(\w)/g,function(e,t){return t+t})),e=e.substring(1).toUpperCase(),8>e.length&&(e="FF"+e),e}function m(e){var t="thin";return 2===e?t="medium":3===e&&(t="thick"),t}function d(e,t){var o="";return t&&t.size&&(o+="<"+e+' style="'+m(t.size)+'">',t.color&&(o+='<color rgb="'+a(t.color)+'"/>'),o+="</"+e+">"),o}function f(e){return"<border>"+d("left",e.left)+d("right",e.right)+d("top",e.top)+d("bottom",e.bottom)+"</border>"}var c='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>',p=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>${creator}</dc:creator><cp:lastModifiedBy>${lastModifiedBy}</cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">${created}</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">${modified}</dcterms:modified></cp:coreProperties>'),h=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Microsoft Excel</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>${sheets.length}</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="${sheets.length}" baseType="lpstr"># for (var idx = 0; idx < sheets.length; idx++) { ## if (sheets[idx].options.title) { #<vt:lpstr>${sheets[idx].options.title}</vt:lpstr># } else { #<vt:lpstr>Sheet${idx+1}</vt:lpstr># } ## } #</vt:vector></TitlesOfParts><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>14.0300</AppVersion></Properties>'),u=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="xml" ContentType="application/xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/># for (var idx = 1; idx <= count; idx++) { #<Override PartName="/xl/worksheets/sheet${idx}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /># } #<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /></Types>'),x=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303" /><workbookPr defaultThemeVersion="124226" /><bookViews><workbookView xWindow="240" yWindow="45" windowWidth="18195" windowHeight="7995" /></bookViews><sheets># for (var idx = 0; idx < sheets.length; idx++) { ## var options = sheets[idx].options; ## var name = options.name || options.title ## if (name) { #<sheet name="${name}" sheetId="${idx+1}" r:id="rId${idx+1}" /># } else { #<sheet name="Sheet${idx+1}" sheetId="${idx+1}" r:id="rId${idx+1}" /># } ## } #</sheets># if (definedNames.length) { #<definedNames> # for (var di = 0; di < definedNames.length; di++) { #<definedName name="_xlnm._FilterDatabase" hidden="1" localSheetId="${definedNames[di].localSheetId}">${definedNames[di].name}!$${definedNames[di].from}:$${definedNames[di].to}</definedName> # } #</definedNames># } #<calcPr calcId="145621" /></workbook>'),g=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" mc:Ignorable="x14ac"><dimension ref="A1" /><sheetViews><sheetView #if(index==0) {# tabSelected="1" #}# workbookViewId="0"># if (frozenRows || frozenColumns) { #<pane state="frozen"# if (frozenColumns) { # xSplit="${frozenColumns}"# } ## if (frozenRows) { # ySplit="${frozenRows}"# } # topLeftCell="${String.fromCharCode(65 + (frozenColumns || 0))}${(frozenRows || 0)+1}"/># } #</sheetView></sheetViews><sheetFormatPr x14ac:dyDescent="0.25" defaultRowHeight="#= defaults.rowHeight ? defaults.rowHeight * 0.75 : 15 #" # if (defaults.columnWidth) { # defaultColWidth="#= kendo.ooxml.toWidth(defaults.columnWidth) #" # } # /># if (columns && columns.length > 0) { #<cols># for (var ci = 0; ci < columns.length; ci++) { ## var column = columns[ci]; ## var columnIndex = typeof column.index === "number" ? column.index + 1 : (ci + 1); ## if (column.width) { #<col min="${columnIndex}" max="${columnIndex}" customWidth="1"# if (column.autoWidth) { # width="${((column.width*7+5)/7*256)/256}" bestFit="1"# } else { # width="#= kendo.ooxml.toWidth(column.width) #" # } #/># } ## } #</cols># } #<sheetData># for (var ri = 0; ri < data.length; ri++) { ## var row = data[ri]; ## var rowIndex = typeof row.index === "number" ? row.index + 1 : (ri + 1); #<row r="${rowIndex}" x14ac:dyDescent="0.25" # if (row.height) { # ht="#= kendo.ooxml.toHeight(row.height) #" customHeight="1" # } # ># for (var ci = 0; ci < row.data.length; ci++) { ## var cell = row.data[ci];#<c r="#=cell.ref#"# if (cell.style) { # s="#=cell.style#" # } ## if (cell.type) { # t="#=cell.type#"# } #># if (cell.formula != null) { #<f>${cell.formula}</f># } ## if (cell.value != null) { #<v>${cell.value}</v># } #</c># } #</row># } #</sheetData># if (filter) { #<autoFilter ref="${filter.from}:${filter.to}"/># } ## if (mergeCells.length) { #<mergeCells count="${mergeCells.length}"># for (var ci = 0; ci < mergeCells.length; ci++) { #<mergeCell ref="${mergeCells[ci]}"/># } #</mergeCells># } #<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3" /></worksheet>'),y=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"># for (var idx = 1; idx <= count; idx++) { #<Relationship Id="rId${idx}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${idx}.xml" /># } #<Relationship Id="rId${count+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" /><Relationship Id="rId${count+2}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml" /></Relationships>'),v=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="${count}" uniqueCount="${uniqueCount}"># for (var index in indexes) { #<si><t>${index.substring(1)}</t></si># } #</sst>'),b=t.template('<?xml version="1.0" encoding="UTF-8"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><numFmts count="${formats.length}"># for (var fi = 0; fi < formats.length; fi++) { ## var format = formats[fi]; #<numFmt formatCode="${format.format}" numFmtId="${165+fi}" /># } #</numFmts><fonts count="${fonts.length+1}" x14ac:knownFonts="1"><font><sz val="11" /><color theme="1" /><name val="Calibri" /><family val="2" /><scheme val="minor" /></font># for (var fi = 0; fi < fonts.length; fi++) { ## var font = fonts[fi]; #<font># if (font.fontSize) { #<sz val="${font.fontSize}" /># } else { #<sz val="11" /># } ## if (font.bold) { #<b/># } ## if (font.italic) { #<i/># } ## if (font.underline) { #<u/># } ## if (font.color) { #<color rgb="${font.color}" /># } else { #<color theme="1" /># } ## if (font.fontFamily) { #<name val="${font.fontFamily}" /><family val="2" /># } else { #<name val="Calibri" /><family val="2" /><scheme val="minor" /># } #</font># } #</fonts><fills count="${fills.length+2}"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill># for (var fi = 0; fi < fills.length; fi++) { ## var fill = fills[fi]; ## if (fill.background) { #<fill><patternFill patternType="solid"><fgColor rgb="${fill.background}"/></patternFill></fill># } ## } #</fills><borders count="${borders.length+1}"><border><left/><right/><top/><bottom/><diagonal/></border># for (var bi = 0; bi < borders.length; bi++) { ##= kendo.ooxml.borderTemplate(borders[bi]) ## } #</borders><cellStyleXfs count="1"><xf borderId="0" fillId="0" fontId="0" /></cellStyleXfs><cellXfs count="${styles.length+1}"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/># for (var si = 0; si < styles.length; si++) { ## var style = styles[si]; #<xf xfId="0"# if (style.fontId) { # fontId="${style.fontId}" applyFont="1"# } ## if (style.fillId) { # fillId="${style.fillId}" applyFill="1"# } ## if (style.numFmtId) { # numFmtId="${style.numFmtId}" applyNumberFormat="1"# } ## if (style.textAlign || style.verticalAlign || style.wrap) { # applyAlignment="1"# } ## if (style.borderId) { # borderId="${style.borderId}" applyBorder="1"# } #># if (style.textAlign || style.verticalAlign || style.wrap) { #<alignment# if (style.textAlign) { # horizontal="${style.textAlign}"# } ## if (style.verticalAlign) { # vertical="${style.verticalAlign}"# } ## if (style.wrap) { # wrapText="1"# } #/># } #</xf># } #</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles><dxfs count="0" /><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleMedium9" /></styleSheet>'),w=new Date(1900,0,0),k=t.Class.extend({init:function(e,t,o,r){this.options=e,this._strings=t,this._styles=o,this._borders=r},toXML:function(e){var t,o,i,s,l,a;for(this._mergeCells=this.options.mergedCells||[],this._rowsByIndex=[],t=this.options.rows||[],o=0;t.length>o;o++)i=t[o].index,"number"!=typeof i&&(i=o),t[o].index=i,this._rowsByIndex[i]=t[o];for(s=[],o=0;t.length>o;o++)s.push(this._row(t[o],o));return s.sort(function(e,t){return e.index-t.index}),l=this.options.filter,l&&"number"==typeof l.from&&"number"==typeof l.to&&(l={from:r(n(this.options),l.from),to:r(n(this.options),l.to)}),a=this.options.freezePane||{},g({frozenColumns:this.options.frozenColumns||a.colSplit,frozenRows:this.options.frozenRows||a.rowSplit,columns:this.options.columns,defaults:this.options.defaults||{},data:s,index:e,mergeCells:this._mergeCells,filter:l})},_row:function(t){var o=[],r=0,i=this,n={};return e.each(t.cells,function(s,l){var a,m;l&&("number"==typeof l.index?(a=l.index,r=a-s):a=s+r,l.colSpan&&(r+=l.colSpan-1),m=i._cell(l,t.index,a),e.each(m,function(e,t){n[t.ref]||(n[t.ref]=!0,o.push(t))}))}),{data:o,height:t.height,index:t.index}},_lookupString:function(e){var t="$"+e,o=this._strings.indexes[t];return void 0!==o?e=o:(e=this._strings.indexes[t]=this._strings.uniqueCount,this._strings.uniqueCount++),this._strings.count++,e},_lookupStyle:function(o){var r,i=t.stringify(o);return"{}"==i?0:(r=e.inArray(i,this._styles),0>r&&(r=this._styles.push(i)-1),r+1)},_lookupBorder:function(o){var r,i=t.stringify(o);if("{}"!=i)return r=e.inArray(i,this._borders),0>r&&(r=this._borders.push(i)-1),r+1},_cell:function(e,o,i){var n,s,l,a,m,d,f,c,p,h,u,x,g,y;if(!e)return[];if(n=e.value,s={},e.borderLeft&&(s.left=e.borderLeft),e.borderRight&&(s.right=e.borderRight),e.borderTop&&(s.top=e.borderTop),e.borderBottom&&(s.bottom=e.borderBottom),s=this._lookupBorder(s),l={bold:e.bold,color:e.color,background:e.background,italic:e.italic,underline:e.underline,fontFamily:e.fontFamily||e.fontName,fontSize:e.fontSize,format:e.format,textAlign:e.textAlign||e.hAlign,verticalAlign:e.verticalAlign||e.vAlign,wrap:e.wrap,borderId:s},a=this.options.columns||[],m=a[i],d=typeof n,m&&m.autoWidth&&(f=n,"number"===d&&(f=t.toString(n,e.format)),m.width=Math.max(m.width||0,(f+"").length)),"string"===d?(n=this._lookupString(n),d="s"):"number"===d?d="n":"boolean"===d?(d="b",n=+n):n&&n.getTime?(d=null,c=(n.getTimezoneOffset()-w.getTimezoneOffset())*t.date.MS_PER_MINUTE,n=(n-w-c)/t.date.MS_PER_DAY+1,l.format||(l.format="mm-dd-yy")):(d=null,n=null),l=this._lookupStyle(l),p=[],h=r(o,i),p.push({value:n,formula:e.formula,type:d,style:l,ref:h}),u=e.colSpan||1,x=e.rowSpan||1,u>1||x>1){for(this._mergeCells.push(h+":"+r(o+x-1,i+u-1)),y=o+1;o+x>y;y++)for(this._rowsByIndex[y]||(this._rowsByIndex[y]={index:y,cells:[]}),g=i;i+u>g;g++)this._rowsByIndex[y].cells.splice(g,0,{});for(g=i+1;i+u>g;g++)p.push({ref:r(o,g)})}return p}}),I={General:0,0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49,"[$-404]e/m/d":27,"m/d/yy":30,t0:59,"t0.00":60,"t#,##0":61,"t#,##0.00":62,"t0%":67,"t0.00%":68,"t# ?/?":69,"t# ??/??":70},$=t.Class.extend({init:function(t){this.options=t||{},this._strings={indexes:{},count:0,uniqueCount:0},this._styles=[],this._borders=[],this._sheets=e.map(this.options.sheets||[],e.proxy(function(e){return e.defaults=this.options,new k(e,this._strings,this._styles,this._borders)},this))},toDataURL:function(){var o,r,s,l,m,d,f,g,w,k,$,S,T,_;if("undefined"==typeof JSZip)throw Error("JSZip not found. Check http://docs.telerik.com/kendo-ui/framework/excel/introduction#requirements for more details.");for(o=new JSZip,r=o.folder("docProps"),r.file("core.xml",p({creator:this.options.creator||"Kendo UI",lastModifiedBy:this.options.creator||"Kendo UI",created:this.options.date||(new Date).toJSON(),modified:this.options.date||(new Date).toJSON()})),s=this._sheets.length,r.file("app.xml",h({sheets:this._sheets})),l=o.folder("_rels"),l.file(".rels",c),m=o.folder("xl"),d=m.folder("_rels"),d.file("workbook.xml.rels",y({count:s})),m.file("workbook.xml",x({sheets:this._sheets,definedNames:e.map(this._sheets,function(e,t){var o=e.options,r=o.filter;return r&&void 0!==r.from&&void 0!==r.to?{localSheetId:t,name:o.name||o.title||"Sheet"+(t+1),from:i(n(o),r.from),to:i(n(o),r.to)}:void 0})})),f=m.folder("worksheets"),g=0;s>g;g++)f.file(t.format("sheet{0}.xml",g+1),this._sheets[g].toXML(g));return w=e.map(this._borders,e.parseJSON),k=e.map(this._styles,e.parseJSON),$=function(e){return e.underline||e.bold||e.italic||e.color||e.fontFamily||e.fontSize},S=e.map(k,function(e){return e.color&&(e.color=a(e.color)),$(e)?e:void 0}),T=e.map(k,function(e){return e.format&&void 0===I[e.format]?e:void 0}),_=e.map(k,function(e){return e.background?(e.background=a(e.background),e):void 0}),m.file("styles.xml",b({fonts:S,fills:_,formats:T,borders:w,styles:e.map(k,function(t){var o={};return $(t)&&(o.fontId=e.inArray(t,S)+1),t.background&&(o.fillId=e.inArray(t,_)+2),o.textAlign=t.textAlign,o.verticalAlign=t.verticalAlign,o.wrap=t.wrap,o.borderId=t.borderId,t.format&&(o.numFmtId=void 0!==I[t.format]?I[t.format]:165+e.inArray(t,T)),o})})),m.file("sharedStrings.xml",v(this._strings)),o.file("[Content_Types].xml",u({count:s})),"data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"+o.generate({compression:"DEFLATE"})}});t.ooxml={Workbook:$,Worksheet:k,toWidth:s,toHeight:l,borderTemplate:f}}(kendo.jQuery,kendo),kendo},"function"==typeof define&&define.amd?define:function(e,t,o){(o||t)()});;!function(e,define){define("kendo.excel.min",["kendo.core.min","kendo.data.min","kendo.ooxml.min"],e)}(function(){return function(e,t){t.ExcelExporter=t.Class.extend({init:function(o){var r,n,a;o.columns=this._trimColumns(o.columns||[]),this.allColumns=e.map(this._leafColumns(o.columns||[]),this._prepareColumn),this.columns=e.grep(this.allColumns,function(e){return!e.hidden}),this.options=o,r=o.dataSource,r instanceof t.data.DataSource?(this.dataSource=new r.constructor(e.extend({},r.options,{page:o.allPages?0:r.page(),filter:r.filter(),pageSize:o.allPages?r.total():r.pageSize(),sort:r.sort(),group:r.group(),aggregate:r.aggregate()})),n=r.data(),n.length>0&&(this.dataSource._data=n,a=this.dataSource.transport,r._isServerGrouped()&&a.options.data&&(a.options.data=null))):this.dataSource=t.data.DataSource.create(r)},_trimColumns:function(t){var o=this;return e.grep(t,function(e){var t=!!e.field;return!t&&e.columns&&(t=o._trimColumns(e.columns).length>0),t})},_leafColumns:function(e){var t,o=[];for(t=0;e.length>t;t++)e[t].columns?o=o.concat(this._leafColumns(e[t].columns)):o.push(e[t]);return o},workbook:function(){return e.Deferred(e.proxy(function(t){this.dataSource.fetch().then(e.proxy(function(){var e={sheets:[{columns:this._columns(),rows:this._rows(),freezePane:this._freezePane(),filter:this._filter()}]};t.resolve(e,this.dataSource.view())},this))},this)).promise()},_prepareColumn:function(o){var r,n;if(o.field)return r=function(e){return e.get(o.field)},n=null,o.values&&(n={},e.each(o.values,function(){n[this.value]=this.text}),r=function(e){return n[e.get(o.field)]}),e.extend({},o,{value:r,values:n,groupHeaderTemplate:t.template(o.groupHeaderTemplate||"#= title #: #= value #"),groupFooterTemplate:o.groupFooterTemplate?t.template(o.groupFooterTemplate):null,footerTemplate:o.footerTemplate?t.template(o.footerTemplate):null})},_filter:function(){if(!this.options.filterable)return null;var e=this._depth();return{from:e,to:e+this.columns.length-1}},_dataRow:function(t,o,r){var n,a,l,i,s,u,c,h,f,d;for(this._hierarchical()&&(o=this.dataSource.level(t)+1),n=[],a=0;o>a;a++)n[a]={background:"#dfdfdf",color:"#333"};if(r&&t.items)return l=e.grep(this.allColumns,function(e){return e.field==t.field})[0],i=l&&l.title?l.title:t.field,s=l?l.groupHeaderTemplate:null,u=i+": "+t.value,c=e.extend({title:i,field:t.field,value:l&&l.values?l.values[t.value]:t.value,aggregates:t.aggregates},t.aggregates[t.field]),s&&(u=s(c)),n.push({value:u,background:"#dfdfdf",color:"#333",colSpan:this.columns.length+r-o}),h=this._dataRows(t.items,o+1),h.unshift({type:"group-header",cells:n}),h.concat(this._footer(t));for(f=[],d=0;this.columns.length>d;d++)f[d]=this._cell(t,this.columns[d]);return this._hierarchical()&&(f[0].colSpan=r-o+1),[{type:"data",cells:n.concat(f)}]},_dataRows:function(e,t){var o,r=this._depth(),n=[];for(o=0;e.length>o;o++)n.push.apply(n,this._dataRow(e[o],t,r));return n},_footer:function(t){var o=[],r=!1,n=e.map(this.columns,e.proxy(function(o){return o.groupFooterTemplate?(r=!0,{background:"#dfdfdf",color:"#333",value:o.groupFooterTemplate(e.extend({},this.dataSource.aggregates(),t.aggregates,t.aggregates[o.field]))}):{background:"#dfdfdf",color:"#333"}},this));return r&&o.push({type:"group-footer",cells:e.map(Array(this.dataSource.group().length),function(){return{background:"#dfdfdf",color:"#333"}}).concat(n)}),o},_isColumnVisible:function(e){return this._visibleColumns([e]).length>0&&(e.field||e.columns)},_visibleColumns:function(t){var o=this;return e.grep(t,function(e){var t=!e.hidden;return t&&e.columns&&(t=o._visibleColumns(e.columns).length>0),t})},_headerRow:function(t,o){var r=e.map(t.cells,function(e){return{background:"#7a7a7a",color:"#fff",value:e.title,colSpan:e.colSpan>1?e.colSpan:1,rowSpan:t.rowSpan>1&&!e.colSpan?t.rowSpan:1}});return this._hierarchical()&&(r[0].colSpan=this._depth()+1),{type:"header",cells:e.map(Array(o.length),function(){return{background:"#7a7a7a",color:"#fff"}}).concat(r)}},_prependHeaderRows:function(e){var t,o=this.dataSource.group(),r=[{rowSpan:1,cells:[],index:0}];for(this._prepareHeaderRows(r,this.options.columns),t=r.length-1;t>=0;t--)e.unshift(this._headerRow(r[t],o))},_prepareHeaderRows:function(e,t,o,r){var n,a,l,i=r||e[e.length-1],s=e[i.index+1],u=0;for(l=0;t.length>l;l++)n=t[l],this._isColumnVisible(n)&&(a={title:n.title||n.field,colSpan:0},i.cells.push(a),n.columns&&n.columns.length&&(s||(s={rowSpan:0,cells:[],index:e.length},e.push(s)),a.colSpan=this._trimColumns(this._visibleColumns(n.columns)).length,this._prepareHeaderRows(e,n.columns,a,s),u+=a.colSpan-1,i.rowSpan=e.length-i.index));o&&(o.colSpan+=u)},_rows:function(){var t,o,r=this.dataSource.group(),n=this._dataRows(this.dataSource.view(),0);return this.columns.length&&(this._prependHeaderRows(n),t=!1,o=e.map(this.columns,e.proxy(function(o){if(o.footerTemplate){t=!0;var r=this.dataSource.aggregates();return{background:"#dfdfdf",color:"#333",value:o.footerTemplate(e.extend({},r,r[o.field]))}}return{background:"#dfdfdf",color:"#333"}},this)),t&&n.push({type:"footer",cells:e.map(Array(r.length),function(){return{background:"#dfdfdf",color:"#333"}}).concat(o)})),n},_headerDepth:function(e){var t,o,r=1,n=0;for(t=0;e.length>t;t++)e[t].columns&&(o=this._headerDepth(e[t].columns),o>n&&(n=o));return r+n},_freezePane:function(){var t=this._visibleColumns(this.options.columns||[]),o=this._visibleColumns(this._trimColumns(this._leafColumns(e.grep(t,function(e){return e.locked})))).length;return{rowSplit:this._headerDepth(t),colSplit:o?o+this.dataSource.group().length:0}},_cell:function(e,t){return{value:t.value(e)}},_hierarchical:function(){return this.options.hierarchy&&this.dataSource.level},_depth:function(){var e,t,o,r=this.dataSource,n=0;if(this._hierarchical()){for(e=r.view(),t=0;e.length>t;t++)o=r.level(e[t]),o>n&&(n=o);n++}else n=r.group().length;return n},_columns:function(){var t=this._depth(),o=e.map(Array(t),function(){return{width:20}});return o.concat(e.map(this.columns,function(e){return{width:parseInt(e.width,10),autoWidth:e.width?!1:!0}}))}}),t.ExcelMixin={extend:function(t){t.events.push("excelExport"),t.options.excel=e.extend(t.options.excel,this.options),t.saveAsExcel=this.saveAsExcel},options:{proxyURL:"",allPages:!1,filterable:!1,fileName:"Export.xlsx"},saveAsExcel:function(){var o=this.options.excel||{},r=new t.ExcelExporter({columns:this.columns,dataSource:this.dataSource,allPages:o.allPages,filterable:o.filterable,hierarchy:o.hierarchy});r.workbook().then(e.proxy(function(e,r){if(!this.trigger("excelExport",{workbook:e,data:r})){var n=new t.ooxml.Workbook(e);t.saveAs({dataURI:n.toDataURL(),fileName:e.fileName||o.fileName,proxyURL:o.proxyURL,forceProxy:o.forceProxy})}},this))}}}(kendo.jQuery,kendo),kendo},"function"==typeof define&&define.amd?define:function(e,t,o){(o||t)()});;!function(e,define){define("kendo.color.min",["kendo.core.min"],e)}(function(){!function(e,t,r){function n(e,a){var f,i;if(null==e||"none"==e)return null;if(e instanceof s)return e;if(e=e.toLowerCase(),f=o.exec(e))return e="transparent"==f[1]?new u(1,1,1,0):n(h.namedColors[f[1]],a),e.match=[f[1]],e;if((f=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/i.exec(e))?i=new l(r(f[1],16),r(f[2],16),r(f[3],16),1):(f=/^#?([0-9a-f])([0-9a-f])([0-9a-f])\b/i.exec(e))?i=new l(r(f[1]+f[1],16),r(f[2]+f[2],16),r(f[3]+f[3],16),1):(f=/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(e))?i=new l(r(f[1],10),r(f[2],10),r(f[3],10),1):(f=/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(e))?i=new l(r(f[1],10),r(f[2],10),r(f[3],10),t(f[4])):(f=/^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(e))?i=new u(t(f[1])/100,t(f[2])/100,t(f[3])/100,1):(f=/^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(e))&&(i=new u(t(f[1])/100,t(f[2])/100,t(f[3])/100,t(f[4]))),i)i.match=f;else if(!a)throw Error("Cannot parse color: "+e);return i}function a(e,t,r){for(r||(r="0"),e=e.toString(16);t>e.length;)e="0"+e;return e}function f(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?e+6*(t-e)*r:.5>r?t:2/3>r?e+(t-e)*(2/3-r)*6:e}var o,i,s,u,l,d,c,h=function(e){var t,r,n,a,f,o=this,i=h.formats;if(1===arguments.length)for(e=o.resolveColor(e),a=0;i.length>a;a++)t=i[a].re,r=i[a].process,n=t.exec(e),n&&(f=r(n),o.r=f[0],o.g=f[1],o.b=f[2]);else o.r=arguments[0],o.g=arguments[1],o.b=arguments[2];o.r=o.normalizeByte(o.r),o.g=o.normalizeByte(o.g),o.b=o.normalizeByte(o.b)};h.prototype={toHex:function(){var e=this,t=e.padDigit,r=e.r.toString(16),n=e.g.toString(16),a=e.b.toString(16);return"#"+t(r)+t(n)+t(a)},resolveColor:function(e){return e=e||"black","#"==e.charAt(0)&&(e=e.substr(1,6)),e=e.replace(/ /g,""),e=e.toLowerCase(),e=h.namedColors[e]||e},normalizeByte:function(e){return 0>e||isNaN(e)?0:e>255?255:e},padDigit:function(e){return 1===e.length?"0"+e:e},brightness:function(e){var t=this,r=Math.round;return t.r=r(t.normalizeByte(t.r*e)),t.g=r(t.normalizeByte(t.g*e)),t.b=r(t.normalizeByte(t.b*e)),t},percBrightness:function(){var e=this;return Math.sqrt(.241*e.r*e.r+.691*e.g*e.g+.068*e.b*e.b)}},h.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(e){return[r(e[1],10),r(e[2],10),r(e[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(e){return[r(e[1],16),r(e[2],16),r(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(e){return[r(e[1]+e[1],16),r(e[2]+e[2],16),r(e[3]+e[3],16)]}}],h.namedColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},o=["transparent"];for(i in h.namedColors)h.namedColors.hasOwnProperty(i)&&o.push(i);o=RegExp("^("+o.join("|")+")(\\W|$)","i"),s=kendo.Class.extend({toHSV:function(){return this},toRGB:function(){return this},toHex:function(){return this.toBytes().toHex()},toBytes:function(){return this},toCss:function(){return"#"+this.toHex()},toCssRgba:function(){var e=this.toBytes();return"rgba("+e.r+", "+e.g+", "+e.b+", "+t((+this.a).toFixed(3))+")"},toDisplay:function(){return kendo.support.browser.msie&&kendo.support.browser.version<9?this.toCss():this.toCssRgba()},equals:function(e){return e===this||null!==e&&this.toCssRgba()==n(e).toCssRgba()},diff:function(e){if(null==e)return NaN;var t=this.toBytes();return e=e.toBytes(),Math.sqrt(Math.pow(.3*(t.r-e.r),2)+Math.pow(.59*(t.g-e.g),2)+Math.pow(.11*(t.b-e.b),2))},clone:function(){var e=this.toBytes();return e===this&&(e=new l(e.r,e.g,e.b,e.a)),e}}),u=s.extend({init:function(e,t,r,n){this.r=e,this.g=t,this.b=r,this.a=n},toHSV:function(){var e,t,r=this.r,n=this.g,a=this.b,f=Math.min(r,n,a),o=Math.max(r,n,a),i=o,s=o-f;return 0===s?new d(0,0,i,this.a):(0!==o?(t=s/o,e=r==o?(n-a)/s:n==o?2+(a-r)/s:4+(r-n)/s,e*=60,0>e&&(e+=360)):(t=0,e=-1),new d(e,t,i,this.a))},toHSL:function(){var e,t,r,n=this.r,a=this.g,f=this.b,o=Math.max(n,a,f),i=Math.min(n,a,f),s=(o+i)/2;if(o==i)e=t=0;else{switch(r=o-i,t=s>.5?r/(2-o-i):r/(o+i),o){case n:e=(a-f)/r+(f>a?6:0);break;case a:e=(f-n)/r+2;break;case f:e=(n-a)/r+4}e*=60,t*=100,s*=100}return new c(e,t,s,this.a)},toBytes:function(){return new l(255*this.r,255*this.g,255*this.b,this.a)}}),l=u.extend({init:function(e,t,r,n){this.r=Math.round(e),this.g=Math.round(t),this.b=Math.round(r),this.a=n},toRGB:function(){return new u(this.r/255,this.g/255,this.b/255,this.a)},toHSV:function(){return this.toRGB().toHSV()},toHSL:function(){return this.toRGB().toHSL()},toHex:function(){return a(this.r,2)+a(this.g,2)+a(this.b,2)},toBytes:function(){return this}}),d=s.extend({init:function(e,t,r,n){this.h=e,this.s=t,this.v=r,this.a=n},toRGB:function(){var e,t,r,n,a,f,o,i,s=this.h,l=this.s,d=this.v;if(0===l)t=r=n=d;else switch(s/=60,e=Math.floor(s),a=s-e,f=d*(1-l),o=d*(1-l*a),i=d*(1-l*(1-a)),e){case 0:t=d,r=i,n=f;break;case 1:t=o,r=d,n=f;break;case 2:t=f,r=d,n=i;break;case 3:t=f,r=o,n=d;break;case 4:t=i,r=f,n=d;break;default:t=d,r=f,n=o}return new u(t,r,n,this.a)},toHSL:function(){return this.toRGB().toHSL()},toBytes:function(){return this.toRGB().toBytes()}}),c=s.extend({init:function(e,t,r,n){this.h=e,this.s=t,this.l=r,this.a=n},toRGB:function(){var e,t,r,n,a,o=this.h,i=this.s,s=this.l;return 0===i?e=t=r=s:(o/=360,i/=100,s/=100,n=.5>s?s*(1+i):s+i-s*i,a=2*s-n,e=f(a,n,o+1/3),t=f(a,n,o),r=f(a,n,o-1/3)),new u(e,t,r,this.a)},toHSV:function(){return this.toRGB().toHSV()},toBytes:function(){return this.toRGB().toBytes()}}),h.fromBytes=function(e,t,r,n){return new l(e,t,r,null!=n?n:1)},h.fromRGB=function(e,t,r,n){return new u(e,t,r,null!=n?n:1)},h.fromHSV=function(e,t,r,n){return new d(e,t,r,null!=n?n:1)},h.fromHSL=function(e,t,r,n){return new c(e,t,r,null!=n?n:1)},kendo.Color=h,kendo.parseColor=n}(window.kendo.jQuery,parseFloat,parseInt)},"function"==typeof define&&define.amd?define:function(e,t,r){(r||t)()});;!function(t,define){define("util/main.min",["kendo.core.min"],t)}(function(){return function(){function t(t){return typeof t!==F}function e(t,e){var i=n(e);return R.round(t*i)/i}function n(t){return t?R.pow(10,t):1}function i(t,e,n){return R.max(R.min(t,n),e)}function r(t){return t*D}function o(t){return t/D}function s(t){return"number"==typeof t&&!isNaN(t)}function a(e,n){return t(e)?e:n}function h(t){return t*t}function l(t){var e,n=[];for(e in t)n.push(e+t[e]);return n.sort().join("")}function c(t){var e,n=2166136261;for(e=0;t.length>e;++e)n+=(n<<1)+(n<<4)+(n<<7)+(n<<8)+(n<<24),n^=t.charCodeAt(e);return n>>>0}function u(t){return c(l(t))}function f(t){var e,n=t.length,i=M,r=L;for(e=0;n>e;e++)r=R.max(r,t[e]),i=R.min(i,t[e]);return{min:i,max:r}}function d(t){return f(t).min}function p(t){return f(t).max}function m(t){return v(t).min}function g(t){return v(t).max}function v(t){var e,n,i,r=M,o=L;for(e=0,n=t.length;n>e;e++)i=t[e],null!==i&&isFinite(i)&&(r=R.min(r,i),o=R.max(o,i));return{min:r===M?void 0:r,max:o===L?void 0:o}}function x(t){return t?t[t.length-1]:void 0}function y(t,e){return t.push.apply(t,e),t}function w(t){return z.template(t,{useWithBlock:!1,paramName:"d"})}function b(e,n){return t(n)&&null!==n?" "+e+"='"+n+"' ":""}function C(t){var e,n="";for(e=0;t.length>e;e++)n+=b(t[e][0],t[e][1]);return n}function _(e){var n,i,r="";for(n=0;e.length>n;n++)i=e[n][1],t(i)&&(r+=e[n][0]+":"+i+";");return""!==r?r:void 0}function T(t){return"string"!=typeof t&&(t+="px"),t}function k(t){var e,n,i=[];if(t)for(e=z.toHyphens(t).split("-"),n=0;e.length>n;n++)i.push("k-pos-"+e[n]);return i.join(" ")}function E(e){return""===e||null===e||"none"===e||"transparent"===e||!t(e)}function S(t){for(var e={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},n=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],i="";t>0;)n[0]>t?n.shift():(i+=e[n[0]],t-=n[0]);return i}function A(t){var e,n,i,r,o;for(t=t.toLowerCase(),e={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},n=0,i=0,r=0;t.length>r;++r){if(o=e[t.charAt(r)],!o)return null;n+=o,o>i&&(n-=2*i),i=o}return n}function N(t){var e=Object.create(null);return function(){var n,i="";for(n=arguments.length;--n>=0;)i+=":"+arguments[n];return i in e?e[i]:t.apply(this,arguments)}}function P(t){for(var e,n,i=[],r=0,o=t.length;o>r;)e=t.charCodeAt(r++),e>=55296&&56319>=e&&o>r?(n=t.charCodeAt(r++),56320==(64512&n)?i.push(((1023&e)<<10)+(1023&n)+65536):(i.push(e),r--)):i.push(e);return i}function O(t){return t.map(function(t){var e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e+=String.fromCharCode(t)}).join("")}var R=Math,z=window.kendo,B=z.deepExtend,D=R.PI/180,M=Number.MAX_VALUE,L=-Number.MAX_VALUE,F="undefined",I=Date.now;I||(I=function(){return(new Date).getTime()}),B(z,{util:{MAX_NUM:M,MIN_NUM:L,append:y,arrayLimits:f,arrayMin:d,arrayMax:p,defined:t,deg:o,hashKey:c,hashObject:u,isNumber:s,isTransparent:E,last:x,limitValue:i,now:I,objectKey:l,round:e,rad:r,renderAttr:b,renderAllAttr:C,renderPos:k,renderSize:T,renderStyle:_,renderTemplate:w,sparseArrayLimits:v,sparseArrayMin:m,sparseArrayMax:g,sqr:h,valueOrDefault:a,romanToArabic:A,arabicToRoman:S,memoize:N,ucs2encode:O,ucs2decode:P}}),z.drawing.util=z.util,z.dataviz.util=z.util}(),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("util/text-metrics.min",["kendo.core.min","util/main.min"],t)}(function(){!function(t){function e(){return{width:0,height:0,baseline:0}}function n(t,e,n){return u.current.measure(t,e,n)}function i(t,e){var n=[];if(t.length>0&&document.fonts){try{n=t.map(function(t){return document.fonts.load(t)})}catch(i){o.logToConsole(i)}Promise.all(n).then(e,e)}else e()}var r=document,o=window.kendo,s=o.Class,a=o.util,h=a.defined,l=s.extend({init:function(t){this._size=t,this._length=0,this._map={}},put:function(t,e){var n=this,i=n._map,r={key:t,value:e};i[t]=r,n._head?(n._tail.newer=r,r.older=n._tail,n._tail=r):n._head=n._tail=r,n._length>=n._size?(i[n._head.key]=null,n._head=n._head.newer,n._head.older=null):n._length++},get:function(t){var e=this,n=e._map[t];return n?(n===e._head&&n!==e._tail&&(e._head=n.newer,e._head.older=null),n!==e._tail&&(n.older&&(n.older.newer=n.newer,n.newer.older=n.older),n.older=e._tail,n.newer=null,e._tail.newer=n,e._tail=n),n.value):void 0}}),c=t("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: nowrap!important;' />")[0],u=s.extend({init:function(t){this._cache=new l(1e3),this._initOptions(t)},options:{baselineMarkerSize:1},measure:function(n,i,o){var s,l,u,f,d,p,m,g;if(!n)return e();if(s=a.objectKey(i),l=a.hashKey(n+s),u=this._cache.get(l),u)return u;f=e(),d=o?o:c,p=this._baselineMarker().cloneNode(!1);for(m in i)g=i[m],h(g)&&(d.style[m]=g);return t(d).text(n),d.appendChild(p),r.body.appendChild(d),(n+"").length&&(f.width=d.offsetWidth-this.options.baselineMarkerSize,f.height=d.offsetHeight,f.baseline=p.offsetTop+this.options.baselineMarkerSize),f.width>0&&f.height>0&&this._cache.put(l,f),d.parentNode.removeChild(d),f},_baselineMarker:function(){return t("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;' />")[0]}});u.current=new u,o.util.TextMetrics=u,o.util.LRUCache=l,o.util.loadFonts=i,o.util.measureText=n}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("util/base64.min",["util/main.min"],t)}(function(){return function(){function t(t){var n,i,r,s,a,h,l,c="",u=0;for(t=e(t);t.length>u;)n=t.charCodeAt(u++),i=t.charCodeAt(u++),r=t.charCodeAt(u++),s=n>>2,a=(3&n)<<4|i>>4,h=(15&i)<<2|r>>6,l=63&r,isNaN(i)?h=l=64:isNaN(r)&&(l=64),c=c+o.charAt(s)+o.charAt(a)+o.charAt(h)+o.charAt(l);return c}function e(t){var e,n,i="";for(e=0;t.length>e;e++)n=t.charCodeAt(e),128>n?i+=r(n):2048>n?(i+=r(192|n>>>6),i+=r(128|63&n)):65536>n&&(i+=r(224|n>>>12),i+=r(128|n>>>6&63),i+=r(128|63&n));return i}var n=window.kendo,i=n.deepExtend,r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i(n.util,{encodeBase64:t,encodeUTF8:e})}(),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("mixins/observers.min",["kendo.core.min"],t)}(function(){return function(t){var e=Math,n=window.kendo,i=n.deepExtend,r=t.inArray,o={observers:function(){return this._observers=this._observers||[]},addObserver:function(t){return this._observers?this._observers.push(t):this._observers=[t],this},removeObserver:function(t){var e=this.observers(),n=r(t,e);return-1!=n&&e.splice(n,1),this},trigger:function(t,e){var n,i,r=this._observers;if(r&&!this._suspended)for(i=0;r.length>i;i++)n=r[i],n[t]&&n[t](e);return this},optionsChange:function(t){this.trigger("optionsChange",t)},geometryChange:function(t){this.trigger("geometryChange",t)},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=e.max((this._suspended||0)-1,0),this},_observerField:function(t,e){this[t]&&this[t].removeObserver(this),this[t]=e,e.addObserver(this)}};i(n,{mixins:{ObserversMixin:o}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("drawing/geometry.min",["util/main.min","mixins/observers.min"],t)}(function(){return function(){function t(t){return null===t?null:t instanceof m?t:new m(t)}function e(t){return t&&x.isFunction(t.matrix)?t.matrix():t}function n(t,e,n,i){var r=0,o=0;return i&&(r=g.atan2(i.c*n,i.a*e),0!==i.b&&(o=g.atan2(i.d*n,i.b*e))),{x:r,y:o}}function i(t,e){for(;e>t;)t+=90;return t}function r(t,e){var n,i,r;for(n=0;e.length>n;n++)i=e[n],r=i.charAt(0).toUpperCase()+i.substring(1,i.length),t["set"+r]=o(i),t["get"+r]=s(i)}function o(t){return function(e){return this[t]!==e&&(this[t]=e,this.geometryChange()),this}}function s(t){return function(){return this[t]}}function a(t,e,n){t>e&&(e+=360);var i=g.abs(e-t);return n||(i=360-i),i}function h(t,e,n,i,r,o){var s=E((r-t)/n,3),a=E((o-e)/i,3);return E(k(g.atan2(a,s)))}function l(t,e,n,i,r,o,s,l){var c,u,f,d,p,m,x,y,w,b,C,_,T,k,E,S,A,N;if(e!==i)w=n-t,b=i-e,C=v(r,2),_=v(o,2),T=(_*w*(t+n)+C*b*(e+i))/(2*C*b),k=T-i,E=-(w*_)/(C*b),p=1/C+v(E,2)/_,m=2*(E*k/_-n/C),x=v(n,2)/C+v(k,2)/_-1,y=g.sqrt(v(m,2)-4*p*x),c=(-m-y)/(2*p),u=T+E*c,f=(-m+y)/(2*p),d=T+E*f;else{if(t===n)return!1;m=-2*i,x=v((n-t)*o/(2*r),2)+v(i,2)-v(o,2),y=g.sqrt(v(m,2)-4*x),c=f=(t+n)/2,u=(-m-y)/2,d=(-m+y)/2}return S=h(c,u,r,o,t,e),A=h(c,u,r,o,n,i),N=a(S,A,l),(s&&180>=N||!s&&N>180)&&(c=f,u=d,S=h(c,u,r,o,t,e),A=h(c,u,r,o,n,i)),{center:new P(c,u),startAngle:S,endAngle:A}}var c,u,f,d,p,m,g=Math,v=g.pow,x=window.kendo,y=x.Class,w=x.deepExtend,b=x.mixins.ObserversMixin,C=x.util,_=C.defined,T=C.rad,k=C.deg,E=C.round,S=g.PI/2,A=C.MIN_NUM,N=C.MAX_NUM,P=y.extend({init:function(t,e){this.x=t||0,this.y=e||0},equals:function(t){return t&&t.x===this.x&&t.y===this.y},clone:function(){return new P(this.x,this.y)},rotate:function(e,n){return this.transform(t().rotate(e,n))},translate:function(t,e){return this.x+=t,this.y+=e,this.geometryChange(),this},translateWith:function(t){return this.translate(t.x,t.y)},move:function(t,e){return this.x=this.y=0,this.translate(t,e)},scale:function(t,e){return _(e)||(e=t),this.x*=t,this.y*=e,this.geometryChange(),this},scaleCopy:function(t,e){return this.clone().scale(t,e)},transform:function(t){var n=e(t),i=this.x,r=this.y;return this.x=n.a*i+n.c*r+n.e,this.y=n.b*i+n.d*r+n.f,this.geometryChange(),this},transformCopy:function(t){var e=this.clone();return t&&e.transform(t),e},distanceTo:function(t){var e=this.x-t.x,n=this.y-t.y;return g.sqrt(e*e+n*n)},round:function(t){return this.x=E(this.x,t),this.y=E(this.y,t),this.geometryChange(),this},toArray:function(t){var e=_(t),n=e?E(this.x,t):this.x,i=e?E(this.y,t):this.y;return[n,i]}});r(P.fn,["x","y"]),w(P.fn,b),P.fn.toString=function(t,e){var n=this.x,i=this.y;return _(t)&&(n=E(n,t),i=E(i,t)),e=e||" ",n+e+i},P.create=function(t,e){return _(t)?t instanceof P?t:1===arguments.length&&2===t.length?new P(t[0],t[1]):new P(t,e):void 0},P.min=function(){var t,e,n=C.MAX_NUM,i=C.MAX_NUM;for(t=0;t<arguments.length;t++)e=arguments[t],n=g.min(e.x,n),i=g.min(e.y,i);return new P(n,i)},P.max=function(){var t,e,n=C.MIN_NUM,i=C.MIN_NUM;for(t=0;t<arguments.length;t++)e=arguments[t],n=g.max(e.x,n),i=g.max(e.y,i);return new P(n,i)},P.minPoint=function(){return new P(A,A)},P.maxPoint=function(){return new P(N,N)},P.ZERO=new P(0,0),c=y.extend({init:function(t,e){this.width=t||0,this.height=e||0},equals:function(t){return t&&t.width===this.width&&t.height===this.height},clone:function(){return new c(this.width,this.height)},toArray:function(t){var e=_(t),n=e?E(this.width,t):this.width,i=e?E(this.height,t):this.height;return[n,i]}}),r(c.fn,["width","height"]),w(c.fn,b),c.create=function(t,e){return _(t)?t instanceof c?t:1===arguments.length&&2===t.length?new c(t[0],t[1]):new c(t,e):void 0},c.ZERO=new c(0,0),u=y.extend({init:function(t,e){this.setOrigin(t||new P),this.setSize(e||new c)},clone:function(){return new u(this.origin.clone(),this.size.clone())},equals:function(t){return t&&t.origin.equals(this.origin)&&t.size.equals(this.size)},setOrigin:function(t){return this._observerField("origin",P.create(t)),this.geometryChange(),this},getOrigin:function(){return this.origin},setSize:function(t){return this._observerField("size",c.create(t)),this.geometryChange(),this},getSize:function(){return this.size},width:function(){return this.size.width},height:function(){return this.size.height},topLeft:function(){return this.origin.clone()},bottomRight:function(){return this.origin.clone().translate(this.width(),this.height())},topRight:function(){return this.origin.clone().translate(this.width(),0)},bottomLeft:function(){return this.origin.clone().translate(0,this.height())},center:function(){return this.origin.clone().translate(this.width()/2,this.height()/2)},bbox:function(t){var e=this.topLeft().transformCopy(t),n=this.topRight().transformCopy(t),i=this.bottomRight().transformCopy(t),r=this.bottomLeft().transformCopy(t);return u.fromPoints(e,n,i,r)},transformCopy:function(t){return u.fromPoints(this.topLeft().transform(t),this.bottomRight().transform(t))}}),w(u.fn,b),u.fromPoints=function(){var t=P.min.apply(this,arguments),e=P.max.apply(this,arguments),n=new c(e.x-t.x,e.y-t.y);return new u(t,n)},u.union=function(t,e){return u.fromPoints(P.min(t.topLeft(),e.topLeft()),P.max(t.bottomRight(),e.bottomRight()))},u.intersect=function(t,e){return t={left:t.topLeft().x,top:t.topLeft().y,right:t.bottomRight().x,bottom:t.bottomRight().y},e={left:e.topLeft().x,top:e.topLeft().y,right:e.bottomRight().x,bottom:e.bottomRight().y},e.right>=t.left&&t.right>=e.left&&e.bottom>=t.top&&t.bottom>=e.top?u.fromPoints(new P(g.max(t.left,e.left),g.max(t.top,e.top)),new P(g.min(t.right,e.right),g.min(t.bottom,e.bottom))):void 0},f=y.extend({init:function(t,e){this.setCenter(t||new P),this.setRadius(e||0)},setCenter:function(t){return this._observerField("center",P.create(t)),this.geometryChange(),this},getCenter:function(){return this.center},equals:function(t){return t&&t.center.equals(this.center)&&t.radius===this.radius},clone:function(){return new f(this.center.clone(),this.radius)},pointAt:function(t){return this._pointAt(T(t))},bbox:function(t){var e,i,r,o,s=P.maxPoint(),a=P.minPoint(),h=n(this.center,this.radius,this.radius,t);for(e=0;4>e;e++)i=this._pointAt(h.x+e*S).transformCopy(t),r=this._pointAt(h.y+e*S).transformCopy(t),o=new P(i.x,r.y),s=P.min(s,o),a=P.max(a,o);return u.fromPoints(s,a)},_pointAt:function(t){var e=this.center,n=this.radius;return new P(e.x-n*g.cos(t),e.y-n*g.sin(t))}}),r(f.fn,["radius"]),w(f.fn,b),d=y.extend({init:function(t,e){this.setCenter(t||new P),e=e||{},this.radiusX=e.radiusX,this.radiusY=e.radiusY||e.radiusX,this.startAngle=e.startAngle,this.endAngle=e.endAngle,this.anticlockwise=e.anticlockwise||!1},clone:function(){return new d(this.center,{radiusX:this.radiusX,radiusY:this.radiusY,startAngle:this.startAngle,endAngle:this.endAngle,anticlockwise:this.anticlockwise})},setCenter:function(t){return this._observerField("center",P.create(t)),this.geometryChange(),this},getCenter:function(){return this.center},MAX_INTERVAL:45,pointAt:function(t){var e=this.center,n=T(t);return new P(e.x+this.radiusX*g.cos(n),e.y+this.radiusY*g.sin(n))},curvePoints:function(){var t,e,n,i=this.startAngle,r=this.anticlockwise?-1:1,o=[this.pointAt(i)],s=i,a=this._arcInterval(),h=a.endAngle-a.startAngle,l=g.ceil(h/this.MAX_INTERVAL),c=h/l;for(t=1;l>=t;t++)e=s+r*c,n=this._intervalCurvePoints(s,e),o.push(n.cp1,n.cp2,n.p2),s=e;return o},bbox:function(t){for(var e,r,o=this,s=o._arcInterval(),a=s.startAngle,h=s.endAngle,l=n(this.center,this.radiusX,this.radiusY,t),c=k(l.x),f=k(l.y),d=o.pointAt(a).transformCopy(t),p=o.pointAt(h).transformCopy(t),m=P.min(d,p),g=P.max(d,p),v=i(c,a),x=i(f,a);h>v||h>x;)h>v&&(e=o.pointAt(v).transformCopy(t),v+=90),h>x&&(r=o.pointAt(x).transformCopy(t),x+=90),d=new P(e.x,r.y),m=P.min(m,d),g=P.max(g,d);return u.fromPoints(m,g)},_arcInterval:function(){var t,e=this.startAngle,n=this.endAngle,i=this.anticlockwise;return i&&(t=e,e=n,n=t),(e>n||i&&e===n)&&(n+=360),{startAngle:e,endAngle:n}},_intervalCurvePoints:function(t,e){var n=this,i=n.pointAt(t),r=n.pointAt(e),o=n._derivativeAt(t),s=n._derivativeAt(e),a=(T(e)-T(t))/3,h=new P(i.x+a*o.x,i.y+a*o.y),l=new P(r.x-a*s.x,r.y-a*s.y);return{p1:i,cp1:h,cp2:l,p2:r}},_derivativeAt:function(t){var e=this,n=T(t);return new P(-e.radiusX*g.sin(n),e.radiusY*g.cos(n))}}),r(d.fn,["radiusX","radiusY","startAngle","endAngle","anticlockwise"]),w(d.fn,b),d.fromPoints=function(t,e,n,i,r,o){var s=l(t.x,t.y,e.x,e.y,n,i,r,o);return new d(s.center,{startAngle:s.startAngle,endAngle:s.endAngle,radiusX:n,radiusY:i,anticlockwise:0===o})},p=y.extend({init:function(t,e,n,i,r,o){this.a=t||0,this.b=e||0,this.c=n||0,this.d=i||0,this.e=r||0,this.f=o||0},multiplyCopy:function(t){return new p(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)},invert:function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,o=this.f,s=t*i-e*n;return 0===s?null:new p(i/s,-e/s,-n/s,t/s,(n*o-i*r)/s,(e*r-t*o)/s)},clone:function(){return new p(this.a,this.b,this.c,this.d,this.e,this.f)},equals:function(t){return t?this.a===t.a&&this.b===t.b&&this.c===t.c&&this.d===t.d&&this.e===t.e&&this.f===t.f:!1},round:function(t){return this.a=E(this.a,t),this.b=E(this.b,t),this.c=E(this.c,t),this.d=E(this.d,t),this.e=E(this.e,t),this.f=E(this.f,t),this},toArray:function(t){var e,n=[this.a,this.b,this.c,this.d,this.e,this.f];if(_(t))for(e=0;n.length>e;e++)n[e]=E(n[e],t);return n}}),p.fn.toString=function(t,e){return this.toArray(t).join(e||",")},p.translate=function(t,e){return new p(1,0,0,1,t,e)},p.unit=function(){return new p(1,0,0,1,0,0)},p.rotate=function(t,e,n){var i=new p;return i.a=g.cos(T(t)),i.b=g.sin(T(t)),i.c=-i.b,i.d=i.a,i.e=e-e*i.a+n*i.b||0,i.f=n-n*i.a-e*i.b||0,i},p.scale=function(t,e){return new p(t,0,0,e,0,0)},p.IDENTITY=p.unit(),m=y.extend({init:function(t){this._matrix=t||p.unit()},clone:function(){return new m(this._matrix.clone())},equals:function(t){return t&&t._matrix.equals(this._matrix)},_optionsChange:function(){this.optionsChange({field:"transform",value:this})},translate:function(t,e){return this._matrix=this._matrix.multiplyCopy(p.translate(t,e)),this._optionsChange(),this},scale:function(t,e,n){return _(e)||(e=t),n&&(n=P.create(n),this._matrix=this._matrix.multiplyCopy(p.translate(n.x,n.y))),this._matrix=this._matrix.multiplyCopy(p.scale(t,e)),n&&(this._matrix=this._matrix.multiplyCopy(p.translate(-n.x,-n.y))),this._optionsChange(),this},rotate:function(t,e){return e=P.create(e)||P.ZERO,this._matrix=this._matrix.multiplyCopy(p.rotate(t,e.x,e.y)),this._optionsChange(),this},multiply:function(t){var n=e(t);return this._matrix=this._matrix.multiplyCopy(n),this._optionsChange(),this},matrix:function(t){return t?(this._matrix=t,this._optionsChange(),this):this._matrix}}),w(m.fn,b),w(x,{geometry:{Arc:d,Circle:f,Matrix:p,Point:P,Rect:u,Size:c,Transformation:m,transform:t,toMatrix:e}}),x.dataviz.geometry=x.geometry}(),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("drawing/core.min",["drawing/geometry.min"],t)}(function(){!function(t){var e,n,i,r=t.noop,o=Object.prototype.toString,s=window.kendo,a=s.Class,h=s.ui.Widget,l=s.deepExtend,c=s.util,u=c.defined,f=h.extend({init:function(t,e){this.options=l({},this.options,e),h.fn.init.call(this,t,this.options),this._click=this._handler("click"),this._mouseenter=this._handler("mouseenter"),this._mouseleave=this._handler("mouseleave"),this._visual=new s.drawing.Group,this.options.width&&this.element.css("width",this.options.width),this.options.height&&this.element.css("height",this.options.height)},options:{name:"Surface"},events:["click","mouseenter","mouseleave","resize"],draw:function(t){this._visual.children.push(t)},clear:function(){this._visual.children=[]},destroy:function(){this._visual=null,h.fn.destroy.call(this)},exportVisual:function(){return this._visual},getSize:function(){return{width:this.element.width(),height:this.element.height()}},setSize:function(t){this.element.css({width:t.width,height:t.height}),this._size=t,this._resize()},eventTarget:function(e){for(var n,i=t(e.touch?e.touch.initialTouch:e.target);!n&&i.length>0&&(n=i[0]._kendoNode,!i.is(this.element)&&0!==i.length);)i=i.parent();return n?n.srcElement:void 0},_resize:r,_handler:function(t){var e=this;return function(n){var i=e.eventTarget(n);i&&e.trigger(t,{element:i,originalEvent:n})}}});s.ui.plugin(f),f.create=function(t,e){return i.current.create(t,e)},e=a.extend({init:function(t){this.childNodes=[],this.parent=null,t&&(this.srcElement=t,this.observe())},destroy:function(){var t,e;for(this.srcElement&&this.srcElement.removeObserver(this),t=this.childNodes,e=0;t.length>e;e++)this.childNodes[e].destroy();this.parent=null},load:r,observe:function(){this.srcElement&&this.srcElement.addObserver(this)},append:function(t){this.childNodes.push(t),t.parent=this},insertAt:function(t,e){this.childNodes.splice(e,0,t),t.parent=this},remove:function(t,e){var n,i=t+e;for(n=t;i>n;n++)this.childNodes[n].removeSelf();this.childNodes.splice(t,e)},removeSelf:function(){this.clear(),this.destroy()},clear:function(){this.remove(0,this.childNodes.length)},invalidate:function(){this.parent&&this.parent.invalidate()},geometryChange:function(){this.invalidate()},optionsChange:function(){this.invalidate()},childrenChange:function(t){"add"===t.action?this.load(t.items,t.index):"remove"===t.action&&this.remove(t.index,t.items.length),this.invalidate()}}),n=a.extend({init:function(t,e){var n,i;this.prefix=e||"";for(n in t)i=t[n],i=this._wrap(i,n),this[n]=i},get:function(t){return s.getter(t,!0)(this)},set:function(t,e){var n,i=s.getter(t,!0)(this);i!==e&&(n=this._set(t,this._wrap(e,t)),n||this.optionsChange({field:this.prefix+t,value:e}))},_set:function(t,e){var i,r,o,a=t.indexOf(".")>=0;if(a)for(i=t.split("."),r="";i.length>1;){if(r+=i.shift(),o=s.getter(r,!0)(this),o||(o=new n({},r+"."),o.addObserver(this),this[r]=o),o instanceof n)return o.set(i.join("."),e),a;r+="."}return this._clear(t),s.setter(t)(this,e),a},_clear:function(t){var e=s.getter(t,!0)(this);e&&e.removeObserver&&e.removeObserver(this)},_wrap:function(t,e){var i=o.call(t);return null!==t&&u(t)&&"[object Object]"===i&&(t instanceof n||t instanceof a||(t=new n(t,this.prefix+e+".")),t.addObserver(this)),t}}),l(n.fn,s.mixins.ObserversMixin),i=function(){this._items=[]},i.prototype={register:function(t,e,n){var i=this._items,r=i[0],o={name:t,type:e,order:n};!r||r.order>n?i.unshift(o):i.push(o)},create:function(t,e){var n,i,r=this._items,o=r[0];if(e&&e.type)for(n=e.type.toLowerCase(),i=0;r.length>i;i++)if(r[i].name===n){o=r[i];break}return o?new o.type(t,e):void s.logToConsole("Warning: Unable to create Kendo UI Drawing Surface. Possible causes:\n- The browser does not support SVG, VML and Canvas. User agent: "+navigator.userAgent+"\n- The Kendo UI scripts are not fully loaded")}},i.current=new i,l(s,{drawing:{DASH_ARRAYS:{dot:[1.5,3.5],dash:[4,3.5],longdash:[8,3.5],dashdot:[3.5,3.5,1.5,3.5],longdashdot:[8,3.5,1.5,3.5],longdashdotdot:[8,3.5,1.5,3.5,1.5,3.5]},Color:s.Color,BaseNode:e,OptionsStore:n,Surface:f,SurfaceFactory:i}}),s.dataviz.drawing=s.drawing}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("drawing/mixins.min",["drawing/core.min"],t)}(function(){!function(){var t=window.kendo,e=t.deepExtend,n=t.util.defined,i="gradient",r={extend:function(t){t.fill=this.fill,t.stroke=this.stroke},fill:function(t,e){var r,o=this.options;return n(t)?(t&&t.nodeType!=i?(r={color:t},n(e)&&(r.opacity=e),o.set("fill",r)):o.set("fill",t),this):o.get("fill")},stroke:function(t,e,i){return n(t)?(this.options.set("stroke.color",t),n(e)&&this.options.set("stroke.width",e),n(i)&&this.options.set("stroke.opacity",i),this):this.options.get("stroke")}},o={extend:function(t,e){t.traverse=function(t){var n,i,r=this[e];for(n=0;r.length>n;n++)i=r[n],i.traverse?i.traverse(t):t(i);return this}}};e(t.drawing,{mixins:{Paintable:r,Traversable:o}})}()},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("drawing/shapes.min",["drawing/core.min","drawing/mixins.min","util/text-metrics.min","mixins/observers.min"],t)}(function(){!function(t){function e(t,e,n){var i,r,o,s;for(r=0;t.length>r;r++)o=t[r],o.visible()&&(s=e?o.bbox(n):o.rawBBox(),s&&(i=i?Y.Rect.union(i,s):s));return i}function n(t,e){var n,i,r,o;for(i=0;t.length>i;i++)r=t[i],r.visible()&&(o=r.clippedBBox(e),o&&(n=n?Y.Rect.union(n,o):o));return n}function i(t,e){t.origin.x-=e,t.origin.y-=e,t.size.width+=2*e,t.size.height+=2*e}function r(t,e){for(var n=0;e.length>n;n++)t[e[n]]=o(e[n])}function o(t){var e="_"+t;return function(t){return rt(t)?(this._observerField(e,t),this.geometryChange(),this):this[e]}}function s(t,e){for(var n=0;e.length>n;n++)t[e[n]]=a(e[n])}function a(t){var e="_"+t;return function(t){return rt(t)?(this._observerField(e,q.create(t)),this.geometryChange(),this):this[e]}}function h(t,e){for(var n=0;e.length>n;n++)t[e[n]]=l(e[n])}function l(t){return function(e){return rt(e)?(this.options.set(t,e),this):this.options.get(t)}}function c(){return"kdef"+mt++}function u(t,e,n){C(t,e,n,"x","width")}function f(t,e,n){C(t,e,n,"y","height")}function d(t){b(w(t),"x","y","width")}function p(t){b(w(t),"y","x","height")}function m(t,e){return v(t,e,"x","y","width")}function g(t,e){return v(t,e,"y","x","height")}function v(t,e,n,i,r){var o,s,a,h,l=[],c=y(t,e,r),u=e.origin.clone();for(h=0;c.length>h;h++)for(a=c[h],o=a[0],u[i]=o.bbox.origin[i],k(u,o.bbox,o.element),o.bbox.origin[n]=u[n],b(a,n,i,r),l.push([]),s=0;a.length>s;s++)l[h].push(a[s].element);return l}function x(t,e){var n,i,r=t.clippedBBox(),o=r.size,s=e.size;(o.width>s.width||o.height>s.height)&&(n=Z.min(s.width/o.width,s.height/o.height),i=t.transform()||Y.transform(),i.scale(n,n),t.transform(i))}function y(t,e,n){var i,r,o,s,a=e.size[n],h=0,l=[],c=[],u=function(){c.push({element:i,bbox:o})};for(s=0;t.length>s;s++)i=t[s],o=i.clippedBBox(),o&&(r=o.size[n],h+r>a?c.length?(l.push(c),c=[],u(),h=r):(u(),l.push(c),c=[],h=0):(u(),h+=r));return c.length&&l.push(c),l}function w(t){var e,n,i,r=[];for(i=0;t.length>i;i++)e=t[i],n=e.clippedBBox(),n&&r.push({element:e,bbox:n});return r}function b(t,e,n,i){var r,o,s,a,h;if(t.length>1)for(r=t[0].bbox,o=new q,h=1;t.length>h;h++)s=t[h].element,a=t[h].bbox,o[e]=r.origin[e]+r.size[i],o[n]=a.origin[n],k(o,a,s),a.origin[e]=o[e],r=a}function C(t,e,n,i,r){var o,s,a;for(n=n||"start",a=0;t.length>a;a++)o=t[a].clippedBBox(),o&&(s=o.origin.clone(),s[i]=_(o.size[r],e,n,i,r),k(s,o,t[a]))}function _(t,e,n,i,r){var o;return o=n==gt?e.origin[i]:n==vt?e.origin[i]+e.size[r]-t:e.origin[i]+(e.size[r]-t)/2}function T(t,e,n){var i=n.transform()||Y.transform(),r=i.matrix();r.e+=t,r.f+=e,i.matrix(r),n.transform(i)}function k(t,e,n){T(t.x-e.origin.x,t.y-e.origin.y,n)}var E,S,A,N,P,O,R,z,B,D,M,L,F,I,G,j,$,U=window.kendo,V=U.Class,X=U.deepExtend,Y=U.geometry,q=Y.Point,W=Y.Size,H=Y.Matrix,J=Y.toMatrix,Q=U.drawing,K=Q.OptionsStore,Z=Math,tt=Z.pow,et=U.util,nt=et.append,it=et.arrayLimits,rt=et.defined,ot=et.last,st=et.valueOrDefault,at=U.mixins.ObserversMixin,ht=t.inArray,lt=[].push,ct=[].pop,ut=[].splice,ft=[].shift,dt=[].slice,pt=[].unshift,mt=1,gt="start",vt="end",xt="horizontal",yt=V.extend({nodeType:"Element",init:function(t){this._initOptions(t)},_initOptions:function(t){var e,n;t=t||{},e=t.transform,n=t.clip,e&&(t.transform=Y.transform(e)),n&&!n.id&&(n.id=c()),this.options=new K(t),this.options.addObserver(this)},transform:function(t){return rt(t)?void this.options.set("transform",Y.transform(t)):this.options.get("transform")},parentTransform:function(){for(var t,e,n=this;n.parent;)n=n.parent,t=n.transform(),t&&(e=t.matrix().multiplyCopy(e||H.unit()));return e?Y.transform(e):void 0},currentTransform:function(t){var e,n,i=this.transform(),r=J(i);return rt(t)||(t=this.parentTransform()),e=J(t),n=r&&e?e.multiplyCopy(r):r||e,n?Y.transform(n):void 0},visible:function(t){return rt(t)?(this.options.set("visible",t),this):this.options.get("visible")!==!1},clip:function(t){var e=this.options;return rt(t)?(t&&!t.id&&(t.id=c()),e.set("clip",t),this):e.get("clip")},opacity:function(t){return rt(t)?(this.options.set("opacity",t),this):st(this.options.get("opacity"),1)},clippedBBox:function(t){var e,n=this._clippedBBox(t);return n?(e=this.clip(),e?Y.Rect.intersect(n,e.bbox(t)):n):void 0},_clippedBBox:function(t){return this.bbox(t)}});X(yt.fn,at),E=V.extend({init:function(t){t=t||[],this.length=0,this._splice(0,t.length,t)},elements:function(t){return t?(this._splice(0,this.length,t),this._change(),this):this.slice(0)},push:function(){var t=arguments,e=lt.apply(this,t);return this._add(t),e},slice:dt,pop:function(){var t=this.length,e=ct.apply(this);return t&&this._remove([e]),e},splice:function(t,e){var n=dt.call(arguments,2),i=this._splice(t,e,n);return this._change(),i},shift:function(){var t=this.length,e=ft.apply(this);return t&&this._remove([e]),e},unshift:function(){var t=arguments,e=pt.apply(this,t);return this._add(t),e},indexOf:function(t){var e,n,i=this;for(e=0,n=i.length;n>e;e++)if(i[e]===t)return e;return-1},_splice:function(t,e,n){var i=ut.apply(this,[t,e].concat(n));return this._clearObserver(i),this._setObserver(n),i},_add:function(t){this._setObserver(t),this._change()},_remove:function(t){this._clearObserver(t),this._change()},_setObserver:function(t){for(var e=0;t.length>e;e++)t[e].addObserver(this)},_clearObserver:function(t){for(var e=0;t.length>e;e++)t[e].removeObserver(this)},_change:function(){}}),X(E.fn,at),S=yt.extend({nodeType:"Group",init:function(t){yt.fn.init.call(this,t),this.children=[]},childrenChange:function(t,e,n){this.trigger("childrenChange",{action:t,items:e,index:n})},append:function(){return nt(this.children,arguments),this._reparent(arguments,this),this.childrenChange("add",arguments),this},insert:function(t,e){return this.children.splice(t,0,e),e.parent=this,this.childrenChange("add",[e],t),this},insertAt:function(t,e){return this.insert(e,t)},remove:function(t){var e=ht(t,this.children);return e>=0&&(this.children.splice(e,1),t.parent=null,this.childrenChange("remove",[t],e)),this},removeAt:function(t){if(t>=0&&this.children.length>t){var e=this.children[t];this.children.splice(t,1),e.parent=null,this.childrenChange("remove",[e],t)}return this},clear:function(){var t=this.children;return this.children=[],this._reparent(t,null),this.childrenChange("remove",t,0),this},bbox:function(t){return e(this.children,!0,this.currentTransform(t))},rawBBox:function(){return e(this.children,!1)},_clippedBBox:function(t){return n(this.children,this.currentTransform(t))},currentTransform:function(t){return yt.fn.currentTransform.call(this,t)||null},_reparent:function(t,e){var n,i,r;for(n=0;t.length>n;n++)i=t[n],r=i.parent,r&&r!=this&&r.remove&&r.remove(i),i.parent=e}}),Q.mixins.Traversable.extend(S.fn,"children"),A=yt.extend({nodeType:"Text",init:function(t,e,n){yt.fn.init.call(this,n),this.content(t),this.position(e||new Y.Point),this.options.font||(this.options.font="12px sans-serif"),rt(this.options.fill)||this.fill("#000")},content:function(t){return rt(t)?(this.options.set("content",t),this):this.options.get("content")},measure:function(){var t=et.measureText(this.content(),{font:this.options.get("font")});return t},rect:function(){var t=this.measure(),e=this.position().clone();return new Y.Rect(e,[t.width,t.height])},bbox:function(t){var e=J(this.currentTransform(t));return this.rect().bbox(e)},rawBBox:function(){return this.rect().bbox()}}),Q.mixins.Paintable.extend(A.fn),s(A.fn,["position"]),N=yt.extend({nodeType:"Circle",init:function(t,e){yt.fn.init.call(this,e),this.geometry(t||new Y.Circle),rt(this.options.stroke)||this.stroke("#000")},bbox:function(t){var e=J(this.currentTransform(t)),n=this._geometry.bbox(e),r=this.options.get("stroke.width");return r&&i(n,r/2),n},rawBBox:function(){return this._geometry.bbox()}}),Q.mixins.Paintable.extend(N.fn),r(N.fn,["geometry"]),P=yt.extend({nodeType:"Arc",init:function(t,e){yt.fn.init.call(this,e),this.geometry(t||new Y.Arc),rt(this.options.stroke)||this.stroke("#000")},bbox:function(t){var e=J(this.currentTransform(t)),n=this.geometry().bbox(e),r=this.options.get("stroke.width");return r&&i(n,r/2),n},rawBBox:function(){return this.geometry().bbox();
},toPath:function(){var t,e=new z,n=this.geometry().curvePoints();if(n.length>0)for(e.moveTo(n[0].x,n[0].y),t=1;n.length>t;t+=3)e.curveTo(n[t],n[t+1],n[t+2]);return e}}),Q.mixins.Paintable.extend(P.fn),r(P.fn,["geometry"]),O=E.extend({_change:function(){this.geometryChange()}}),R=V.extend({init:function(t,e,n){this.anchor(t||new q),this.controlIn(e),this.controlOut(n)},bboxTo:function(t,e){var n,i=this.anchor().transformCopy(e),r=t.anchor().transformCopy(e);return n=this.controlOut()&&t.controlIn()?this._curveBoundingBox(i,this.controlOut().transformCopy(e),t.controlIn().transformCopy(e),r):this._lineBoundingBox(i,r)},_lineBoundingBox:function(t,e){return Y.Rect.fromPoints(t,e)},_curveBoundingBox:function(t,e,n,i){var r=[t,e,n,i],o=this._curveExtremesFor(r,"x"),s=this._curveExtremesFor(r,"y"),a=it([o.min,o.max,t.x,i.x]),h=it([s.min,s.max,t.y,i.y]);return Y.Rect.fromPoints(new q(a.min,h.min),new q(a.max,h.max))},_curveExtremesFor:function(t,e){var n=this._curveExtremes(t[0][e],t[1][e],t[2][e],t[3][e]);return{min:this._calculateCurveAt(n.min,e,t),max:this._calculateCurveAt(n.max,e,t)}},_calculateCurveAt:function(t,e,n){var i=1-t;return tt(i,3)*n[0][e]+3*tt(i,2)*t*n[1][e]+3*tt(t,2)*i*n[2][e]+tt(t,3)*n[3][e]},_curveExtremes:function(t,e,n,i){var r,o,s=t-3*e+3*n-i,a=-2*(t-2*e+n),h=t-e,l=Z.sqrt(a*a-4*s*h),c=0,u=1;return 0===s?0!==a&&(c=u=-h/a):isNaN(l)||(c=(-a+l)/(2*s),u=(-a-l)/(2*s)),r=Z.max(Z.min(c,u),0),(0>r||r>1)&&(r=0),o=Z.min(Z.max(c,u),1),(o>1||0>o)&&(o=1),{min:r,max:o}}}),s(R.fn,["anchor","controlIn","controlOut"]),X(R.fn,at),z=yt.extend({nodeType:"Path",init:function(t){yt.fn.init.call(this,t),this.segments=new O,this.segments.addObserver(this),rt(this.options.stroke)||(this.stroke("#000"),rt(this.options.stroke.lineJoin)||this.options.set("stroke.lineJoin","miter"))},moveTo:function(t,e){return this.suspend(),this.segments.elements([]),this.resume(),this.lineTo(t,e),this},lineTo:function(t,e){var n=rt(e)?new q(t,e):t,i=new R(n);return this.segments.push(i),this},curveTo:function(t,e,n){var i,r;return this.segments.length>0&&(i=ot(this.segments),r=new R(n,e),this.suspend(),i.controlOut(t),this.resume(),this.segments.push(r)),this},arc:function(t,e,n,i,r){var o,s,a,h,l;return this.segments.length>0&&(o=ot(this.segments),s=o.anchor(),a=et.rad(t),h=new q(s.x-n*Z.cos(a),s.y-i*Z.sin(a)),l=new Y.Arc(h,{startAngle:t,endAngle:e,radiusX:n,radiusY:i,anticlockwise:r}),this._addArcSegments(l)),this},arcTo:function(t,e,n,i,r){var o,s,a;return this.segments.length>0&&(o=ot(this.segments),s=o.anchor(),a=Y.Arc.fromPoints(s,t,e,n,i,r),this._addArcSegments(a)),this},_addArcSegments:function(t){var e,n;for(this.suspend(),e=t.curvePoints(),n=1;e.length>n;n+=3)this.curveTo(e[n],e[n+1],e[n+2]);this.resume(),this.geometryChange()},close:function(){return this.options.closed=!0,this.geometryChange(),this},bbox:function(t){var e=J(this.currentTransform(t)),n=this._bbox(e),r=this.options.get("stroke.width");return r&&i(n,r/2),n},rawBBox:function(){return this._bbox()},_bbox:function(t){var e,n,i,r,o=this.segments,s=o.length;if(1===s)n=o[0].anchor().transformCopy(t),e=new Y.Rect(n,W.ZERO);else if(s>0)for(i=1;s>i;i++)r=o[i-1].bboxTo(o[i],t),e=e?Y.Rect.union(e,r):r;return e}}),Q.mixins.Paintable.extend(z.fn),z.fromRect=function(t,e){return new z(e).moveTo(t.topLeft()).lineTo(t.topRight()).lineTo(t.bottomRight()).lineTo(t.bottomLeft()).close()},z.fromPoints=function(t,e){var n,i,r;if(t){for(n=new z(e),i=0;t.length>i;i++)r=q.create(t[i]),r&&(0===i?n.moveTo(r):n.lineTo(r));return n}},z.fromArc=function(t,e){var n=new z(e),i=t.startAngle,r=t.pointAt(i);return n.moveTo(r.x,r.y),n.arc(i,t.endAngle,t.radiusX,t.radiusY,t.anticlockwise),n},B=yt.extend({nodeType:"MultiPath",init:function(t){yt.fn.init.call(this,t),this.paths=new O,this.paths.addObserver(this),rt(this.options.stroke)||this.stroke("#000")},moveTo:function(t,e){var n=new z;return n.moveTo(t,e),this.paths.push(n),this},lineTo:function(t,e){return this.paths.length>0&&ot(this.paths).lineTo(t,e),this},curveTo:function(t,e,n){return this.paths.length>0&&ot(this.paths).curveTo(t,e,n),this},arc:function(t,e,n,i,r){return this.paths.length>0&&ot(this.paths).arc(t,e,n,i,r),this},arcTo:function(t,e,n,i,r){return this.paths.length>0&&ot(this.paths).arcTo(t,e,n,i,r),this},close:function(){return this.paths.length>0&&ot(this.paths).close(),this},bbox:function(t){return e(this.paths,!0,this.currentTransform(t))},rawBBox:function(){return e(this.paths,!1)},_clippedBBox:function(t){return n(this.paths,this.currentTransform(t))}}),Q.mixins.Paintable.extend(B.fn),D=yt.extend({nodeType:"Image",init:function(t,e,n){yt.fn.init.call(this,n),this.src(t),this.rect(e||new Y.Rect)},src:function(t){return rt(t)?(this.options.set("src",t),this):this.options.get("src")},bbox:function(t){var e=J(this.currentTransform(t));return this._rect.bbox(e)},rawBBox:function(){return this._rect.bbox()}}),r(D.fn,["rect"]),M=V.extend({init:function(t,e,n){this.options=new K({offset:t,color:e,opacity:rt(n)?n:1}),this.options.addObserver(this)}}),h(M.fn,["offset","color","opacity"]),X(M.fn,at),M.create=function(t){if(rt(t)){var e;return e=t instanceof M?t:t.length>1?new M(t[0],t[1],t[2]):new M(t.offset,t.color,t.opacity)}},L=E.extend({_change:function(){this.optionsChange({field:"stops"})}}),F=V.extend({nodeType:"gradient",init:function(t){this.stops=new L(this._createStops(t.stops)),this.stops.addObserver(this),this._userSpace=t.userSpace,this.id=c()},userSpace:function(t){return rt(t)?(this._userSpace=t,this.optionsChange(),this):this._userSpace},_createStops:function(t){var e,n=[];for(t=t||[],e=0;t.length>e;e++)n.push(M.create(t[e]));return n},addStop:function(t,e,n){this.stops.push(new M(t,e,n))},removeStop:function(t){var e=this.stops.indexOf(t);e>=0&&this.stops.splice(e,1)}}),X(F.fn,at,{optionsChange:function(t){this.trigger("optionsChange",{field:"gradient"+(t?"."+t.field:""),value:this})},geometryChange:function(){this.optionsChange()}}),I=F.extend({init:function(t){t=t||{},F.fn.init.call(this,t),this.start(t.start||new q),this.end(t.end||new q(1,0))}}),s(I.fn,["start","end"]),G=F.extend({init:function(t){t=t||{},F.fn.init.call(this,t),this.center(t.center||new q),this._radius=rt(t.radius)?t.radius:1,this._fallbackFill=t.fallbackFill},radius:function(t){return rt(t)?(this._radius=t,this.geometryChange(),this):this._radius},fallbackFill:function(t){return rt(t)?(this._fallbackFill=t,this.optionsChange(),this):this._fallbackFill}}),s(G.fn,["center"]),j=yt.extend({nodeType:"Rect",init:function(t,e){yt.fn.init.call(this,e),this.geometry(t||new Y.Rect),rt(this.options.stroke)||this.stroke("#000")},bbox:function(t){var e=J(this.currentTransform(t)),n=this._geometry.bbox(e),r=this.options.get("stroke.width");return r&&i(n,r/2),n},rawBBox:function(){return this._geometry.bbox()}}),Q.mixins.Paintable.extend(j.fn),r(j.fn,["geometry"]),$=S.extend({init:function(t,e){S.fn.init.call(this,U.deepExtend({},this._defaults,e)),this._rect=t,this._fieldMap={}},_defaults:{alignContent:gt,justifyContent:gt,alignItems:gt,spacing:0,orientation:xt,lineSpacing:0,wrap:!0},rect:function(t){return t?(this._rect=t,this):this._rect},_initMap:function(){var t=this.options,e=this._fieldMap;t.orientation==xt?(e.sizeField="width",e.groupsSizeField="height",e.groupAxis="x",e.groupsAxis="y"):(e.sizeField="height",e.groupsSizeField="width",e.groupAxis="y",e.groupsAxis="x")},reflow:function(){var t,e,n,i,r,o,s,a,h,l,c,u,f,d,p,m,g,v,x,y,w,b,C,T,E,S;if(this._rect&&0!==this.children.length){for(this._initMap(),this.options.transform&&this.transform(null),t=this.options,e=this._fieldMap,n=this._rect,i=this._initGroups(),r=i.groups,o=i.groupsSize,s=e.sizeField,a=e.groupsSizeField,h=e.groupAxis,l=e.groupsAxis,c=_(o,n,t.alignContent,l,a),u=new q,f=new q,d=new Y.Size,y=0;r.length>y;y++){for(v=r[y],u[h]=p=_(v.size,n,t.justifyContent,h,s),u[l]=c,d[s]=v.size,d[a]=v.lineSize,x=new Y.Rect(u,d),w=0;v.bboxes.length>w;w++)g=v.elements[w],m=v.bboxes[w],f[h]=p,f[l]=_(m.size[a],x,t.alignItems,l,a),k(f,m,g),p+=m.size[s]+t.spacing;c+=v.lineSize+t.lineSpacing}!t.wrap&&v.size>n.size[s]&&(b=n.size[s]/x.size[s],C=x.topLeft().scale(b,b),T=x.size[a]*b,E=_(T,n,t.alignContent,l,a),S=Y.transform(),"x"===h?S.translate(n.origin.x-C.x,E-C.y):S.translate(E-C.x,n.origin.y-C.y),S.scale(b,b),this.transform(S))}},_initGroups:function(){var t,e,n,i=this.options,r=this.children,o=i.lineSpacing,s=this._fieldMap.sizeField,a=-o,h=[],l=this._newGroup(),c=function(){h.push(l),a+=l.lineSize+o};for(n=0;r.length>n;n++)e=r[n],t=r[n].clippedBBox(),e.visible()&&t&&(i.wrap&&l.size+t.size[s]+i.spacing>this._rect.size[s]?0===l.bboxes.length?(this._addToGroup(l,t,e),c(),l=this._newGroup()):(c(),l=this._newGroup(),this._addToGroup(l,t,e)):this._addToGroup(l,t,e));return l.bboxes.length&&c(),{groups:h,groupsSize:a}},_addToGroup:function(t,e,n){t.size+=e.size[this._fieldMap.sizeField]+this.options.spacing,t.lineSize=Math.max(e.size[this._fieldMap.groupsSizeField],t.lineSize),t.bboxes.push(e),t.elements.push(n)},_newGroup:function(){return{lineSize:0,size:-this.options.spacing,bboxes:[],elements:[]}}}),X(Q,{align:u,Arc:P,Circle:N,Element:yt,ElementsArray:E,fit:x,Gradient:F,GradientStop:M,Group:S,Image:D,Layout:$,LinearGradient:I,MultiPath:B,Path:z,RadialGradient:G,Rect:j,Segment:R,stack:d,Text:A,vAlign:f,vStack:p,vWrap:g,wrap:m})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("drawing/parser.min",["drawing/shapes.min"],t)}(function(){!function(t){function e(t){var e=[];return t.replace(m,function(t,n){e.push(parseFloat(n))}),e}function n(t,e,n){var i,r=e?0:1;for(i=0;t.length>i;i+=2)t.splice(i+r,0,n)}function i(t,e){return t&&e?e.scaleCopy(2).translate(-t.x,-t.y):void 0}function r(t,e,n){var i=1/3;return e=e.clone().scale(2/3),{controlOut:e.clone().translateWith(t.scaleCopy(i)),controlIn:e.translateWith(n.scaleCopy(i))}}var o=window.kendo,s=o.drawing,a=o.geometry,h=o.Class,l=a.Point,c=o.deepExtend,u=t.trim,f=o.util,d=f.last,p=/([a-df-z]{1})([^a-df-z]*)(z)?/gi,m=/[,\s]?([+\-]?(?:\d*\.\d+|\d+)(?:[eE][+\-]?\d+)?)/g,g="m",v="z",x=h.extend({parse:function(t,n){var i,r=new s.MultiPath(n),o=new l;return t.replace(p,function(t,n,s,a){var h=n.toLowerCase(),l=h===n,c=e(u(s));if(h===g&&(l?(o.x+=c[0],o.y+=c[1]):(o.x=c[0],o.y=c[1]),r.moveTo(o.x,o.y),c.length>2&&(h="l",c.splice(0,2))),y[h])y[h](r,{parameters:c,position:o,isRelative:l,previousCommand:i}),a&&a.toLowerCase()===v&&r.close();else if(h!==g)throw Error("Error while parsing SVG path. Unsupported command: "+h);i=h}),r}}),y={l:function(t,e){var n,i,r=e.parameters,o=e.position;for(n=0;r.length>n;n+=2)i=new l(r[n],r[n+1]),e.isRelative&&i.translateWith(o),t.lineTo(i.x,i.y),o.x=i.x,o.y=i.y},c:function(t,e){var n,i,r,o,s=e.parameters,a=e.position;for(o=0;s.length>o;o+=6)n=new l(s[o],s[o+1]),i=new l(s[o+2],s[o+3]),r=new l(s[o+4],s[o+5]),e.isRelative&&(i.translateWith(a),n.translateWith(a),r.translateWith(a)),t.curveTo(n,i,r),a.x=r.x,a.y=r.y},v:function(t,e){var i=e.isRelative?0:e.position.x;n(e.parameters,!0,i),this.l(t,e)},h:function(t,e){var i=e.isRelative?0:e.position.y;n(e.parameters,!1,i),this.l(t,e)},a:function(t,e){var n,i,r,o,s,a,h=e.parameters,c=e.position;for(n=0;h.length>n;n+=7)i=h[n],r=h[n+1],o=h[n+3],s=h[n+4],a=new l(h[n+5],h[n+6]),e.isRelative&&a.translateWith(c),t.arcTo(a,i,r,o,s),c.x=a.x,c.y=a.y},s:function(t,e){var n,r,o,s,a,h=e.parameters,c=e.position,u=e.previousCommand;for(("s"==u||"c"==u)&&(s=d(d(t.paths).segments).controlIn()),a=0;h.length>a;a+=4)o=new l(h[a],h[a+1]),r=new l(h[a+2],h[a+3]),e.isRelative&&(o.translateWith(c),r.translateWith(c)),n=s?i(s,c):c.clone(),s=o,t.curveTo(n,o,r),c.x=r.x,c.y=r.y},q:function(t,e){var n,i,o,s,a=e.parameters,h=e.position;for(s=0;a.length>s;s+=4)o=new l(a[s],a[s+1]),i=new l(a[s+2],a[s+3]),e.isRelative&&(o.translateWith(h),i.translateWith(h)),n=r(h,o,i),t.curveTo(n.controlOut,n.controlIn,i),h.x=i.x,h.y=i.y},t:function(t,e){var n,o,s,a,h,c=e.parameters,u=e.position,f=e.previousCommand;for(("q"==f||"t"==f)&&(a=d(d(t.paths).segments),o=a.controlIn().clone().translateWith(u.scaleCopy(-1/3)).scale(1.5)),h=0;c.length>h;h+=2)s=new l(c[h],c[h+1]),e.isRelative&&s.translateWith(u),o=o?i(o,u):u.clone(),n=r(u,o,s),t.curveTo(n.controlOut,n.controlIn,s),u.x=s.x,u.y=s.y}};x.current=new x,s.Path.parse=function(t,e){return x.current.parse(t,e)},c(s,{PathParser:x})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("drawing/svg.min",["drawing/shapes.min","util/main.min"],t)}(function(){!function(t){function e(t){var e,n,i,r;try{e=t.getScreenCTM?t.getScreenCTM():null}catch(o){}e&&(n=-e.e%1,i=-e.f%1,r=t.style,(0!==n||0!==i)&&(r.left=n+"px",r.top=i+"px"))}function n(){var t=document.getElementsByTagName("base")[0],e="",n=document.location.href,i=n.indexOf("#");return t&&!c.support.browser.msie&&(-1!==i&&(n=n.substring(0,i)),e=n),e}function i(t){return"url("+n()+"#"+t+")"}function r(t){var e,n,i,r=new B,o=t.clippedBBox();return o&&(e=o.getOrigin(),n=new d.Group,n.transform(f.transform().translate(-e.x,-e.y)),n.children.push(t),t=n),r.load([t]),i="<?xml version='1.0' ?><svg xmlns='"+N+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>"+r.render()+"</svg>",r.destroy(),i}function o(e,n){var i=r(e);return n&&n.raw||(i="data:image/svg+xml;base64,"+m.encodeBase64(i)),t.Deferred().resolve(i).promise()}function s(t,e){return"clip"==t||"fill"==t&&(!e||e.nodeType==T)}function a(t){if(!t||!t.indexOf||t.indexOf("&")<0)return t;var e=a._element;return e.innerHTML=t,e.textContent||e.innerText}var h,l=document,c=window.kendo,u=c.deepExtend,f=c.geometry,d=c.drawing,p=d.BaseNode,m=c.util,g=m.defined,v=m.isTransparent,x=m.renderAttr,y=m.renderAllAttr,w=m.renderTemplate,b=t.inArray,C="butt",_=d.DASH_ARRAYS,T="gradient",k="none",E=".kendo",S="solid",A=" ",N="http://www.w3.org/2000/svg",P="transform",O="undefined",R=d.Surface.extend({init:function(t,n){d.Surface.fn.init.call(this,t,n),this._root=new B(this.options),J(this.element[0],this._template(this)),this._rootElement=this.element[0].firstElementChild,e(this._rootElement),this._root.attachTo(this._rootElement),this.element.on("click"+E,this._click),this.element.on("mouseover"+E,this._mouseenter),this.element.on("mouseout"+E,this._mouseleave),this.resize()},type:"svg",destroy:function(){this._root&&(this._root.destroy(),this._root=null,this._rootElement=null,this.element.off(E)),d.Surface.fn.destroy.call(this)},translate:function(t){var e=c.format("{0} {1} {2} {3}",Math.round(t.x),Math.round(t.y),this._size.width,this._size.height);this._offset=t,this._rootElement.setAttribute("viewBox",e)},draw:function(t){d.Surface.fn.draw.call(this,t),this._root.load([t])},clear:function(){d.Surface.fn.clear.call(this),this._root.clear()},svg:function(){return"<?xml version='1.0' ?>"+this._template(this)},exportVisual:function(){var t,e=this._visual,n=this._offset;return n&&(t=new d.Group,t.children.push(e),t.transform(f.transform().translate(-n.x,-n.y)),e=t),e},_resize:function(){this._offset&&this.translate(this._offset)},_template:w("<svg style='width: 100%; height: 100%; overflow: hidden;' xmlns='"+N+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>#= d._root.render() #</svg>")}),z=p.extend({init:function(t){p.fn.init.call(this,t),this.definitions={}},destroy:function(){this.element&&(this.element._kendoNode=null,this.element=null),this.clearDefinitions(),p.fn.destroy.call(this)},load:function(t,e){var n,i,r,o,s=this,a=s.element;for(o=0;t.length>o;o++)i=t[o],r=i.children,n=new H[i.nodeType](i),g(e)?s.insertAt(n,e):s.append(n),n.createDefinitions(),r&&r.length>0&&n.load(r),a&&n.attachTo(a,e)},root:function(){for(var t=this;t.parent;)t=t.parent;return t},attachTo:function(t,e){var n,i=l.createElement("div");J(i,"<svg xmlns='"+N+"' version='1.1'>"+this.render()+"</svg>"),n=i.firstChild.firstChild,n&&(g(e)?t.insertBefore(n,t.childNodes[e]||null):t.appendChild(n),this.setElement(n))},setElement:function(t){var e,n,i=this.childNodes;for(this.element&&(this.element._kendoNode=null),this.element=t,this.element._kendoNode=this,n=0;i.length>n;n++)e=t.childNodes[n],i[n].setElement(e)},clear:function(){var t,e;for(this.clearDefinitions(),this.element&&(this.element.innerHTML=""),t=this.childNodes,e=0;t.length>e;e++)t[e].destroy();this.childNodes=[]},removeSelf:function(){if(this.element){var t=this.element.parentNode;t&&t.removeChild(this.element),this.element=null}p.fn.removeSelf.call(this)},template:w("#= d.renderChildren() #"),render:function(){return this.template(this)},renderChildren:function(){var t,e=this.childNodes,n="";for(t=0;e.length>t;t++)n+=e[t].render();return n},optionsChange:function(t){var e=t.field,n=t.value;"visible"===e?this.css("display",n?"":k):h[e]&&s(e,n)?this.updateDefinition(e,n):"opacity"===e&&this.attr("opacity",n),p.fn.optionsChange.call(this,t)},attr:function(t,e){this.element&&this.element.setAttribute(t,e)},allAttr:function(t){for(var e=0;t.length>e;e++)this.attr(t[e][0],t[e][1])},css:function(t,e){this.element&&(this.element.style[t]=e)},allCss:function(t){for(var e=0;t.length>e;e++)this.css(t[e][0],t[e][1])},removeAttr:function(t){this.element&&this.element.removeAttribute(t)},mapTransform:function(t){var e=[];return t&&e.push([P,"matrix("+t.matrix().toString(6)+")"]),e},renderTransform:function(){return y(this.mapTransform(this.srcElement.transform()))},transformChange:function(t){t?this.allAttr(this.mapTransform(t)):this.removeAttr(P)},mapStyle:function(){var t=this.srcElement.options,e=[["cursor",t.cursor]];return t.visible===!1&&e.push(["display",k]),e},renderStyle:function(){return x("style",m.renderStyle(this.mapStyle(!0)))},renderOpacity:function(){return x("opacity",this.srcElement.options.opacity)},createDefinitions:function(){var t,e,n,i,r=this.srcElement,o=this.definitions;if(r){n=r.options;for(e in h)t=n.get(e),t&&s(e,t)&&(o[e]=t,i=!0);i&&this.definitionChange({action:"add",definitions:o})}},definitionChange:function(t){this.parent&&this.parent.definitionChange(t)},updateDefinition:function(t,e){var n=this.definitions,r=n[t],o=h[t],s={};r&&(s[t]=r,this.definitionChange({action:"remove",definitions:s}),delete n[t]),e?(s[t]=e,this.definitionChange({action:"add",definitions:s}),n[t]=e,this.attr(o,i(e.id))):r&&this.removeAttr(o)},clearDefinitions:function(){var t,e=this.definitions;for(t in e){this.definitionChange({action:"remove",definitions:e}),this.definitions={};break}},renderDefinitions:function(){return y(this.mapDefinitions())},mapDefinitions:function(){var t,e=this.definitions,n=[];for(t in e)n.push([h[t],i(e[t].id)]);return n}}),B=z.extend({init:function(t){z.fn.init.call(this),this.options=t,this.defs=new D},attachTo:function(t){this.element=t,this.defs.attachTo(t.firstElementChild)},clear:function(){p.fn.clear.call(this)},template:w("#=d.defs.render()##= d.renderChildren() #"),definitionChange:function(t){this.defs.definitionChange(t)}}),D=z.extend({init:function(){z.fn.init.call(this),this.definitionMap={}},attachTo:function(t){this.element=t},template:w("<defs>#= d.renderChildren()#</defs>"),definitionChange:function(t){var e=t.definitions,n=t.action;"add"==n?this.addDefinitions(e):"remove"==n&&this.removeDefinitions(e)},createDefinition:function(t,e){var n;return"clip"==t?n=M:"fill"==t&&(e instanceof d.LinearGradient?n=Y:e instanceof d.RadialGradient&&(n=q)),new n(e)},addDefinitions:function(t){for(var e in t)this.addDefinition(e,t[e])},addDefinition:function(t,e){var n,i=this.definitionMap,r=e.id,o=this.element,s=i[r];s?s.count++:(n=this.createDefinition(t,e),i[r]={element:n,count:1},this.append(n),o&&n.attachTo(this.element))},removeDefinitions:function(t){for(var e in t)this.removeDefinition(t[e])},removeDefinition:function(t){var e=this.definitionMap,n=t.id,i=e[n];i&&(i.count--,0===i.count&&(this.remove(b(i.element,this.childNodes),1),delete e[n]))}}),M=z.extend({init:function(t){z.fn.init.call(this),this.srcElement=t,this.id=t.id,this.load([t])},template:w("<clipPath id='#=d.id#'>#= d.renderChildren()#</clipPath>")}),L=z.extend({template:w("<g#= d.renderTransform() + d.renderStyle() + d.renderOpacity() + d.renderDefinitions()#>#= d.renderChildren() #</g>"),optionsChange:function(t){t.field==P&&this.transformChange(t.value),z.fn.optionsChange.call(this,t)}}),F=z.extend({geometryChange:function(){this.attr("d",this.renderData()),this.invalidate()},optionsChange:function(t){switch(t.field){case"fill":t.value?this.allAttr(this.mapFill(t.value)):this.removeAttr("fill");break;case"fill.color":this.allAttr(this.mapFill({color:t.value}));break;case"stroke":t.value?this.allAttr(this.mapStroke(t.value)):this.removeAttr("stroke");break;case P:this.transformChange(t.value);break;default:var e=this.attributeMap[t.field];e&&this.attr(e,t.value)}z.fn.optionsChange.call(this,t)},attributeMap:{"fill.opacity":"fill-opacity","stroke.color":"stroke","stroke.width":"stroke-width","stroke.opacity":"stroke-opacity"},content:function(){this.element&&(this.element.textContent=this.srcElement.content())},renderData:function(){return this.printPath(this.srcElement)},printPath:function(t){var e,n,i,r,o,s=t.segments,a=s.length;if(a>0){for(e=[],o=1;a>o;o++)i=this.segmentType(s[o-1],s[o]),i!==r&&(r=i,e.push(i)),e.push("L"===i?this.printPoints(s[o].anchor()):this.printPoints(s[o-1].controlOut(),s[o].controlIn(),s[o].anchor()));return n="M"+this.printPoints(s[0].anchor())+A+e.join(A),t.options.closed&&(n+="Z"),n}},printPoints:function(){var t,e=arguments,n=e.length,i=[];for(t=0;n>t;t++)i.push(e[t].toString(3));return i.join(A)},segmentType:function(t,e){return t.controlOut()&&e.controlIn()?"C":"L"},mapStroke:function(t){var e=[];return t&&!v(t.color)?(e.push(["stroke",t.color]),e.push(["stroke-width",t.width]),e.push(["stroke-linecap",this.renderLinecap(t)]),e.push(["stroke-linejoin",t.lineJoin]),g(t.opacity)&&e.push(["stroke-opacity",t.opacity]),g(t.dashType)&&e.push(["stroke-dasharray",this.renderDashType(t)])):e.push(["stroke",k]),e},renderStroke:function(){return y(this.mapStroke(this.srcElement.options.stroke))},renderDashType:function(t){var e,n,i,r=t.width||1,o=t.dashType;if(o&&o!=S){for(e=_[o.toLowerCase()],n=[],i=0;e.length>i;i++)n.push(e[i]*r);return n.join(" ")}},renderLinecap:function(t){var e=t.dashType,n=t.lineCap;return e&&e!=S?C:n},mapFill:function(t){var e=[];return t&&t.nodeType==T||(t&&!v(t.color)?(e.push(["fill",t.color]),g(t.opacity)&&e.push(["fill-opacity",t.opacity])):e.push(["fill",k])),e},renderFill:function(){return y(this.mapFill(this.srcElement.options.fill))},template:w("<path #= d.renderStyle() # #= d.renderOpacity() # #= kendo.util.renderAttr('d', d.renderData()) # #= d.renderStroke() # #= d.renderFill() # #= d.renderDefinitions() # #= d.renderTransform() #></path>")}),I=F.extend({renderData:function(){return this.printPath(this.srcElement.toPath())}}),G=F.extend({renderData:function(){var t,e,n=this.srcElement.paths;if(n.length>0){for(t=[],e=0;n.length>e;e++)t.push(this.printPath(n[e]));return t.join(" ")}}}),j=F.extend({geometryChange:function(){var t=this.center();this.attr("cx",t.x),this.attr("cy",t.y),this.attr("r",this.radius()),this.invalidate()},center:function(){return this.srcElement.geometry().center},radius:function(){return this.srcElement.geometry().radius},template:w("<circle #= d.renderStyle() # #= d.renderOpacity() # cx='#= d.center().x #' cy='#= d.center().y #' r='#= d.radius() #' #= d.renderStroke() # #= d.renderFill() # #= d.renderDefinitions() # #= d.renderTransform() # ></circle>")}),$=F.extend({geometryChange:function(){var t=this.pos();this.attr("x",t.x),this.attr("y",t.y),this.invalidate()},optionsChange:function(t){"font"===t.field?(this.attr("style",m.renderStyle(this.mapStyle())),this.geometryChange()):"content"===t.field&&F.fn.content.call(this,this.srcElement.content()),F.fn.optionsChange.call(this,t)},mapStyle:function(t){var e=F.fn.mapStyle.call(this,t),n=this.srcElement.options.font;return t&&(n=c.htmlEncode(n)),e.push(["font",n]),e},pos:function(){var t=this.srcElement.position(),e=this.srcElement.measure();return t.clone().setY(t.y+e.baseline)},renderContent:function(){var t=this.srcElement.content();return t=a(t),t=c.htmlEncode(t)},template:w("<text #= d.renderStyle() # #= d.renderOpacity() # x='#= this.pos().x #' y='#= this.pos().y #' #= d.renderStroke() # #= d.renderTransform() # #= d.renderDefinitions() # #= d.renderFill() #>#= d.renderContent() #</text>")}),U=F.extend({geometryChange:function(){this.allAttr(this.mapPosition()),this.invalidate()},optionsChange:function(t){"src"===t.field&&this.allAttr(this.mapSource()),F.fn.optionsChange.call(this,t)},mapPosition:function(){var t=this.srcElement.rect(),e=t.topLeft();return[["x",e.x],["y",e.y],["width",t.width()+"px"],["height",t.height()+"px"]]},renderPosition:function(){return y(this.mapPosition())},mapSource:function(t){var e=this.srcElement.src();return t&&(e=c.htmlEncode(e)),[["xlink:href",e]]},renderSource:function(){return y(this.mapSource(!0))},template:w("<image preserveAspectRatio='none' #= d.renderStyle() # #= d.renderTransform()# #= d.renderOpacity() # #= d.renderPosition() # #= d.renderSource() # #= d.renderDefinitions()#></image>")}),V=z.extend({template:w("<stop #=d.renderOffset()# #=d.renderStyle()# />"),renderOffset:function(){return x("offset",this.srcElement.offset())},mapStyle:function(){var t=this.srcElement;return[["stop-color",t.color()],["stop-opacity",t.opacity()]]},optionsChange:function(t){"offset"==t.field?this.attr(t.field,t.value):("color"==t.field||"opacity"==t.field)&&this.css("stop-"+t.field,t.value)}}),X=z.extend({init:function(t){z.fn.init.call(this,t),this.id=t.id,this.loadStops()},loadStops:function(){var t,e,n=this.srcElement,i=n.stops,r=this.element;for(e=0;i.length>e;e++)t=new V(i[e]),this.append(t),r&&t.attachTo(r)},optionsChange:function(t){"gradient.stops"==t.field?(p.fn.clear.call(this),this.loadStops()):t.field==T&&this.allAttr(this.mapCoordinates())},renderCoordinates:function(){return y(this.mapCoordinates())},mapSpace:function(){return["gradientUnits",this.srcElement.userSpace()?"userSpaceOnUse":"objectBoundingBox"]}}),Y=X.extend({template:w("<linearGradient id='#=d.id#' #=d.renderCoordinates()#>#= d.renderChildren()#</linearGradient>"),mapCoordinates:function(){var t=this.srcElement,e=t.start(),n=t.end(),i=[["x1",e.x],["y1",e.y],["x2",n.x],["y2",n.y],this.mapSpace()];return i}}),q=X.extend({template:w("<radialGradient id='#=d.id#' #=d.renderCoordinates()#>#= d.renderChildren()#</radialGradient>"),mapCoordinates:function(){var t=this.srcElement,e=t.center(),n=t.radius(),i=[["cx",e.x],["cy",e.y],["r",n],this.mapSpace()];return i}}),W=F.extend({geometryChange:function(){var t=this.srcElement.geometry();this.attr("x",t.origin.x),this.attr("y",t.origin.y),this.attr("width",t.size.width),this.attr("height",t.size.height),this.invalidate()},size:function(){return this.srcElement.geometry().size},origin:function(){return this.srcElement.geometry().origin},template:w("<rect #= d.renderStyle() # #= d.renderOpacity() # x='#= d.origin().x #' y='#= d.origin().y #' width='#= d.size().width #' height='#= d.size().height #'#= d.renderStroke() # #= d.renderFill() # #= d.renderDefinitions() # #= d.renderTransform() # />")}),H={Group:L,Text:$,Path:F,MultiPath:G,Circle:j,Arc:I,Image:U,Rect:W},J=function(t,e){t.innerHTML=e};!function(){var t="<svg xmlns='"+N+"'></svg>",e=l.createElement("div"),n=typeof DOMParser!=O;e.innerHTML=t,n&&e.firstChild.namespaceURI!=N&&(J=function(t,e){var n=new DOMParser,i=n.parseFromString(e,"text/xml"),r=l.adoptNode(i.documentElement);t.innerHTML="",t.appendChild(r)})}(),a._element=document.createElement("span"),h={clip:"clip-path",fill:"fill"},c.support.svg=function(){return l.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}(),c.support.svg&&d.SurfaceFactory.current.register("svg",R,10),u(d,{exportSVG:o,svg:{ArcNode:I,CircleNode:j,ClipNode:M,DefinitionNode:D,GradientStopNode:V,GroupNode:L,ImageNode:U,LinearGradientNode:Y,MultiPathNode:G,Node:z,PathNode:F,RadialGradientNode:q,RectNode:W,RootNode:B,Surface:R,TextNode:$,_exportGroup:r}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("drawing/canvas.min",["drawing/shapes.min","kendo.color.min"],t)}(function(){!function(t){function e(e,n){var i,r,o,s,a,h,l={width:"800px",height:"600px",cors:"Anonymous"},c=e.clippedBBox();return c&&(i=c.getOrigin(),r=new b.Group,r.transform(w.transform().translate(-i.x,-i.y)),r.children.push(e),e=r,o=c.getSize(),l.width=o.width+"px",l.height=o.height+"px"),n=p(l,n),s=t("<div />").css({display:"none",width:n.width,height:n.height}).appendTo(document.body),a=new S(s,n),a.draw(e),h=a.image(),h.always(function(){a.destroy(),s.remove()}),h}function n(t,e){var n,i,r;for(r=0;e.length>r;r++)i=e[r],n=d.parseColor(i.color()),n.a*=i.opacity(),t.addColorStop(i.offset(),n.toCssRgba())}var i,r,o,s,a,h,l,c,u,f=document,d=window.kendo,p=d.deepExtend,m=d.util,g=m.defined,v=m.isTransparent,x=m.renderTemplate,y=m.valueOrDefault,w=d.geometry,b=d.drawing,C=b.BaseNode,_="butt",T=b.DASH_ARRAYS,k=1e3/60,E="solid",S=b.Surface.extend({init:function(e,n){b.Surface.fn.init.call(this,e,n),this.element[0].innerHTML=this._template(this);var r=this.element[0].firstElementChild;r.width=t(e).width(),r.height=t(e).height(),this._rootElement=r,this._root=new i(r)},destroy:function(){b.Surface.fn.destroy.call(this),this._root&&(this._root.destroy(),this._root=null)},type:"canvas",draw:function(t){b.Surface.fn.draw.call(this,t),this._root.load([t],void 0,this.options.cors)},clear:function(){b.Surface.fn.clear.call(this),this._root.clear()},image:function(){var e,n=this._root,i=this._rootElement,r=[];return n.traverse(function(t){t.loading&&r.push(t.loading)}),e=t.Deferred(),t.when.apply(t,r).done(function(){n._invalidate();try{var t=i.toDataURL();e.resolve(t)}catch(r){e.reject(r)}}).fail(function(t){e.reject(t)}),e.promise()},_resize:function(){this._rootElement.width=this._size.width,this._rootElement.height=this._size.height,this._root.invalidate()},_template:x("<canvas style='width: 100%; height: 100%;'></canvas>")}),A=C.extend({init:function(t){C.fn.init.call(this,t),t&&this.initClip()},initClip:function(){var t=this.srcElement.clip();t&&(this.clip=t,t.addObserver(this))},clear:function(){this.srcElement&&this.srcElement.removeObserver(this),this.clearClip(),C.fn.clear.call(this)},clearClip:function(){this.clip&&(this.clip.removeObserver(this),delete this.clip)},setClip:function(t){this.clip&&(t.beginPath(),r.fn.renderPoints(t,this.clip),t.clip())},optionsChange:function(t){"clip"==t.field&&(this.clearClip(),this.initClip()),C.fn.optionsChange.call(this,t)},setTransform:function(t){if(this.srcElement){var e=this.srcElement.transform();e&&t.transform.apply(t,e.matrix().toArray(6))}},loadElements:function(t,e,n){var i,r,o,s,a=this;for(s=0;t.length>s;s++)r=t[s],o=r.children,i=new u[r.nodeType](r,n),o&&o.length>0&&i.load(o,e,n),g(e)?a.insertAt(i,e):a.append(i)},load:function(t,e,n){this.loadElements(t,e,n),this.invalidate()},setOpacity:function(t){if(this.srcElement){var e=this.srcElement.opacity();g(e)&&this.globalAlpha(t,e)}},globalAlpha:function(t,e){e&&t.globalAlpha&&(e*=t.globalAlpha),t.globalAlpha=e},visible:function(){var t=this.srcElement;return!t||t&&t.options.visible!==!1}}),N=A.extend({renderTo:function(t){var e,n,i;if(this.visible()){for(t.save(),this.setTransform(t),this.setClip(t),this.setOpacity(t),e=this.childNodes,n=0;e.length>n;n++)i=e[n],i.visible()&&i.renderTo(t);t.restore()}}});b.mixins.Traversable.extend(N.fn,"childNodes"),i=N.extend({init:function(e){N.fn.init.call(this),this.canvas=e,this.ctx=e.getContext("2d");var n=t.proxy(this._invalidate,this);this.invalidate=d.throttle(function(){d.animationFrame(n)},k)},destroy:function(){N.fn.destroy.call(this),this.canvas=null,this.ctx=null},load:function(t,e,n){this.loadElements(t,e,n),this._invalidate()},_invalidate:function(){this.ctx&&(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderTo(this.ctx))}}),b.mixins.Traversable.extend(i.fn,"childNodes"),
r=A.extend({renderTo:function(t){t.save(),this.setTransform(t),this.setClip(t),this.setOpacity(t),t.beginPath(),this.renderPoints(t,this.srcElement),this.setLineDash(t),this.setLineCap(t),this.setLineJoin(t),this.setFill(t),this.setStroke(t),t.restore()},setFill:function(t){var e=this.srcElement.options.fill,n=!1;return e&&("gradient"==e.nodeType?(this.setGradientFill(t,e),n=!0):v(e.color)||(t.fillStyle=e.color,t.save(),this.globalAlpha(t,e.opacity),t.fill(),t.restore(),n=!0)),n},setGradientFill:function(t,e){var i,r,o,s,a=this.srcElement.rawBBox();e instanceof b.LinearGradient?(r=e.start(),o=e.end(),i=t.createLinearGradient(r.x,r.y,o.x,o.y)):e instanceof b.RadialGradient&&(s=e.center(),i=t.createRadialGradient(s.x,s.y,0,s.x,s.y,e.radius())),n(i,e.stops),t.save(),e.userSpace()||t.transform(a.width(),0,0,a.height(),a.origin.x,a.origin.y),t.fillStyle=i,t.fill(),t.restore()},setStroke:function(t){var e=this.srcElement.options.stroke;return e&&!v(e.color)&&e.width>0?(t.strokeStyle=e.color,t.lineWidth=y(e.width,1),t.save(),this.globalAlpha(t,e.opacity),t.stroke(),t.restore(),!0):void 0},dashType:function(){var t=this.srcElement.options.stroke;return t&&t.dashType?t.dashType.toLowerCase():void 0},setLineDash:function(t){var e,n=this.dashType();n&&n!=E&&(e=T[n],t.setLineDash?t.setLineDash(e):(t.mozDash=e,t.webkitLineDash=e))},setLineCap:function(t){var e=this.dashType(),n=this.srcElement.options.stroke;e&&e!==E?t.lineCap=_:n&&n.lineCap&&(t.lineCap=n.lineCap)},setLineJoin:function(t){var e=this.srcElement.options.stroke;e&&e.lineJoin&&(t.lineJoin=e.lineJoin)},renderPoints:function(t,e){var n,i,r,o,s,a,h=e.segments;if(0!==h.length){for(n=h[0],i=n.anchor(),t.moveTo(i.x,i.y),r=1;h.length>r;r++)n=h[r],i=n.anchor(),o=h[r-1],s=o.controlOut(),a=n.controlIn(),s&&a?t.bezierCurveTo(s.x,s.y,a.x,a.y,i.x,i.y):t.lineTo(i.x,i.y);e.options.closed&&t.closePath()}}}),o=r.extend({renderPoints:function(t){var e,n=this.srcElement.paths;for(e=0;n.length>e;e++)r.fn.renderPoints(t,n[e])}}),s=r.extend({renderPoints:function(t){var e=this.srcElement.geometry(),n=e.center,i=e.radius;t.arc(n.x,n.y,i,0,2*Math.PI)}}),a=r.extend({renderPoints:function(t){var e=this.srcElement.toPath();r.fn.renderPoints.call(this,t,e)}}),h=r.extend({renderTo:function(t){var e=this.srcElement,n=e.position(),i=e.measure();t.save(),this.setTransform(t),this.setClip(t),this.setOpacity(t),t.beginPath(),t.font=e.options.font,this.setFill(t)&&t.fillText(e.content(),n.x,n.y+i.baseline),this.setStroke(t)&&(this.setLineDash(t),t.strokeText(e.content(),n.x,n.y+i.baseline)),t.restore()}}),l=r.extend({init:function(e,n){r.fn.init.call(this,e),this.onLoad=t.proxy(this.onLoad,this),this.onError=t.proxy(this.onError,this),this.loading=t.Deferred();var i=this.img=new Image;n&&!/^data:/i.test(e.src())&&(i.crossOrigin=n),i.src=e.src(),i.complete?this.onLoad():(i.onload=this.onLoad,i.onerror=this.onError)},renderTo:function(t){"resolved"===this.loading.state()&&(t.save(),this.setTransform(t),this.setClip(t),this.drawImage(t),t.restore())},optionsChange:function(e){"src"===e.field?(this.loading=t.Deferred(),this.img.src=this.srcElement.src()):r.fn.optionsChange.call(this,e)},onLoad:function(){this.loading.resolve(),this.invalidate()},onError:function(){this.loading.reject(Error("Unable to load image '"+this.img.src+"'. Check for connectivity and verify CORS headers."))},drawImage:function(t){var e=this.srcElement.rect(),n=e.topLeft();t.drawImage(this.img,n.x,n.y,e.width(),e.height())}}),c=r.extend({renderPoints:function(t){var e=this.srcElement.geometry(),n=e.origin,i=e.size;t.rect(n.x,n.y,i.width,i.height)}}),u={Group:N,Text:h,Path:r,MultiPath:o,Circle:s,Arc:a,Image:l,Rect:c},d.support.canvas=function(){return!!f.createElement("canvas").getContext}(),d.support.canvas&&b.SurfaceFactory.current.register("canvas",S,20),p(d.drawing,{exportImage:e,canvas:{ArcNode:a,CircleNode:s,GroupNode:N,ImageNode:l,MultiPathNode:o,Node:A,PathNode:r,RectNode:c,RootNode:i,Surface:S,TextNode:h}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("drawing/vml.min",["drawing/shapes.min","kendo.color.min"],t)}(function(){!function(t){function e(){if(u.namespaces&&!u.namespaces.kvml){u.namespaces.add("kvml","urn:schemas-microsoft-com:vml");var t=u.styleSheets.length>30?u.styleSheets[0]:u.createStyleSheet();t.addRule(".kvml","behavior:url(#default#VML)")}}function n(t){var e=u.createElement("kvml:"+t);return e.className="kvml",e}function i(t){var e,n=t.length,i=[];for(e=0;n>e;e++)i.push(t[e].scaleCopy(R).toString(0,","));return i.join(" ")}function r(t,e){var n,r,s,a,h,l=t.segments,c=l.length;if(c>0){for(n=[],h=1;c>h;h++)s=o(l[h-1],l[h]),s!==a&&(a=s,n.push(s)),n.push("l"===s?i([l[h].anchor()]):i([l[h-1].controlOut(),l[h].controlIn(),l[h].anchor()]));return r="m "+i([l[0].anchor()])+" "+n.join(" "),t.options.closed&&(r+=" x"),e!==!0&&(r+=" e"),r}}function o(t,e){return t.controlOut()&&e.controlIn()?"c":"l"}function s(t){return 0===t.indexOf("fill")||0===t.indexOf(B)}function a(t,e,n){var i,r=n*N(e.opacity(),1);return i=t?h(t,e.color(),r):h(e.color(),"#fff",1-r)}function h(t,e,n){var i=new _(t),r=new _(e),o=l(i.r,r.r,n),s=l(i.g,r.g,n),a=l(i.b,r.b,n);return new _(o,s,a).toHex()}function l(t,e,n){return f.round(n*e+(1-n)*t)}var c,u=document,f=Math,d=f.atan2,p=f.ceil,m=f.sqrt,g=window.kendo,v=g.deepExtend,x=t.noop,y=g.drawing,w=y.BaseNode,b=g.geometry,C=b.toMatrix,_=g.Color,T=g.util,k=T.isTransparent,E=T.defined,S=T.deg,A=T.round,N=T.valueOrDefault,P="none",O=".kendo",R=100,z=R*R,B="gradient",D=4,M=y.Surface.extend({init:function(t,n){y.Surface.fn.init.call(this,t,n),e(),this.element.empty(),this._root=new F,this._root.attachTo(this.element[0]),this.element.on("click"+O,this._click),this.element.on("mouseover"+O,this._mouseenter),this.element.on("mouseout"+O,this._mouseleave)},type:"vml",destroy:function(){this._root&&(this._root.destroy(),this._root=null,this.element.off(O)),y.Surface.fn.destroy.call(this)},draw:function(t){y.Surface.fn.draw.call(this,t),this._root.load([t],void 0,null)},clear:function(){y.Surface.fn.clear.call(this),this._root.clear()}}),L=w.extend({init:function(t){w.fn.init.call(this,t),this.createElement(),this.attachReference()},observe:x,destroy:function(){this.element&&(this.element._kendoNode=null,this.element=null),w.fn.destroy.call(this)},clear:function(){var t,e;for(this.element&&(this.element.innerHTML=""),t=this.childNodes,e=0;t.length>e;e++)t[e].destroy();this.childNodes=[]},removeSelf:function(){this.element&&(this.element.parentNode.removeChild(this.element),this.element=null),w.fn.removeSelf.call(this)},createElement:function(){this.element=u.createElement("div")},attachReference:function(){this.element._kendoNode=this},load:function(t,e,n,i){var r,o,s,a,h,l;for(i=N(i,1),this.srcElement&&(i*=N(this.srcElement.options.opacity,1)),r=0;t.length>r;r++)o=t[r],s=o.children,a=o.currentTransform(n),h=i*N(o.options.opacity,1),l=new ht[o.nodeType](o,a,h),s&&s.length>0&&l.load(s,e,a,i),E(e)?this.insertAt(l,e):this.append(l),l.attachTo(this.element,e)},attachTo:function(t,e){E(e)?t.insertBefore(this.element,t.children[e]||null):t.appendChild(this.element)},optionsChange:function(t){"visible"==t.field&&this.css("display",t.value!==!1?"":P)},setStyle:function(){this.allCss(this.mapStyle())},mapStyle:function(){var t=[];return this.srcElement&&this.srcElement.options.visible===!1&&t.push(["display",P]),t},mapOpacityTo:function(t,e){var n=N(this.opacity,1);n*=N(e,1),t.push(["opacity",n])},attr:function(t,e){this.element&&(this.element[t]=e)},allAttr:function(t){for(var e=0;t.length>e;e++)this.attr(t[e][0],t[e][1])},css:function(t,e){this.element&&(this.element.style[t]=e)},allCss:function(t){for(var e=0;t.length>e;e++)this.css(t[e][0],t[e][1])}}),F=L.extend({createElement:function(){L.fn.createElement.call(this),this.allCss([["width","100%"],["height","100%"],["position","relative"],["visibility","visible"]])},attachReference:x}),I=g.Class.extend({init:function(t,e){this.srcElement=t,this.observer=e,t.addObserver(this)},geometryChange:function(){this.observer.optionsChange({field:"clip",value:this.srcElement})},clear:function(){this.srcElement.removeObserver(this)}}),G=L.extend({init:function(t){L.fn.init.call(this,t),t&&this.initClip()},observe:function(){w.fn.observe.call(this)},mapStyle:function(){var t=L.fn.mapStyle.call(this);return this.srcElement&&this.srcElement.clip()&&t.push(["clip",this.clipRect()]),t},optionsChange:function(t){"clip"==t.field&&(this.clearClip(),this.initClip(),this.setClip()),L.fn.optionsChange.call(this,t)},clear:function(){this.clearClip(),L.fn.clear.call(this)},initClip:function(){this.srcElement.clip()&&(this.clip=new I(this.srcElement.clip(),this),this.clip.observer=this)},clearClip:function(){this.clip&&(this.clip.clear(),this.clip=null,this.css("clip",this.clipRect()))},setClip:function(){this.clip&&this.css("clip",this.clipRect())},clipRect:function(){var t,e,n,i=c,r=this.srcElement.clip();return r&&(t=this.clipBBox(r),e=t.topLeft(),n=t.bottomRight(),i=g.format("rect({0}px {1}px {2}px {3}px)",e.y,n.x,n.y,e.x)),i},clipBBox:function(t){var e=this.srcElement.rawBBox().topLeft(),n=t.rawBBox();return n.origin.translate(-e.x,-e.y),n}}),j=G.extend({createElement:function(){L.fn.createElement.call(this),this.setStyle()},attachTo:function(t,e){this.css("display",P),L.fn.attachTo.call(this,t,e),this.srcElement.options.visible!==!1&&this.css("display","")},_attachTo:function(t){var e=document.createDocumentFragment();e.appendChild(this.element),t.appendChild(e)},mapStyle:function(){var t=G.fn.mapStyle.call(this);return t.push(["position","absolute"]),t.push(["white-space","nowrap"]),t},optionsChange:function(t){"transform"===t.field&&this.refreshTransform(),"opacity"===t.field&&this.refreshOpacity(),G.fn.optionsChange.call(this,t)},refreshTransform:function(t){var e,n=this.srcElement.currentTransform(t),i=this.childNodes,r=i.length;for(this.setClip(),e=0;r>e;e++)i[e].refreshTransform(n)},currentOpacity:function(){var t=N(this.srcElement.options.opacity,1);return this.parent&&this.parent.currentOpacity&&(t*=this.parent.currentOpacity()),t},refreshOpacity:function(){var t,e=this.childNodes,n=e.length,i=this.currentOpacity();for(t=0;n>t;t++)e[t].refreshOpacity(i)},initClip:function(){if(G.fn.initClip.call(this),this.clip){var t=this.clip.srcElement.bbox(this.srcElement.currentTransform());t&&(this.css("width",t.width()+t.origin.x),this.css("height",t.height()+t.origin.y))}},clipBBox:function(t){return t.bbox(this.srcElement.currentTransform())},clearClip:function(){G.fn.clearClip.call(this)}}),$=L.extend({init:function(t,e){this.opacity=e,L.fn.init.call(this,t)},createElement:function(){this.element=n("stroke"),this.setOpacity()},optionsChange:function(t){0===t.field.indexOf("stroke")&&this.setStroke()},refreshOpacity:function(t){this.opacity=t,this.setStroke()},setStroke:function(){this.allAttr(this.mapStroke())},setOpacity:function(){this.setStroke()},mapStroke:function(){var t,e=this.srcElement.options.stroke,n=[];return e&&!k(e.color)&&0!==e.width?(n.push(["on","true"]),n.push(["color",e.color]),n.push(["weight",(e.width||1)+"px"]),this.mapOpacityTo(n,e.opacity),E(e.dashType)&&n.push(["dashstyle",e.dashType]),E(e.lineJoin)&&n.push(["joinstyle",e.lineJoin]),E(e.lineCap)&&(t=e.lineCap.toLowerCase(),"butt"===t&&(t="butt"===t?"flat":t),n.push(["endcap",t]))):n.push(["on","false"]),n}}),U=L.extend({init:function(t,e,n){this.opacity=n,L.fn.init.call(this,t)},createElement:function(){this.element=n("fill"),this.setFill()},optionsChange:function(t){s(t.field)&&this.setFill()},refreshOpacity:function(t){this.opacity=t,this.setOpacity()},setFill:function(){this.allAttr(this.mapFill())},setOpacity:function(){this.setFill()},attr:function(t,e){var n,i=this.element;if(i){for(n=t.split(".");n.length>1;)i=i[n.shift()];i[n[0]]=e}},mapFill:function(){var t=this.srcElement.fill(),e=[["on","false"]];return t&&(t.nodeType==B?e=this.mapGradient(t):k(t.color)||(e=this.mapFillColor(t))),e},mapFillColor:function(t){var e=[["on","true"],["color",t.color]];return this.mapOpacityTo(e,t.opacity),e},mapGradient:function(t){var e,n=this.srcElement.options,i=n.fallbackFill||t.fallbackFill&&t.fallbackFill();return e=t instanceof y.LinearGradient?this.mapLinearGradient(t):t instanceof y.RadialGradient&&t.supportVML?this.mapRadialGradient(t):i?this.mapFillColor(i):[["on","false"]]},mapLinearGradient:function(t){var e=t.start(),n=t.end(),i=T.deg(d(n.y-e.y,n.x-e.x)),r=[["on","true"],["type",B],["focus",0],["method","none"],["angle",270-i]];return this.addColors(r),r},mapRadialGradient:function(t){var e=this.srcElement.rawBBox(),n=t.center(),i=(n.x-e.origin.x)/e.width(),r=(n.y-e.origin.y)/e.height(),o=[["on","true"],["type","gradienttitle"],["focus","100%"],["focusposition",i+" "+r],["method","none"]];return this.addColors(o),o},addColors:function(t){var e,n,i=this.srcElement.options,r=N(this.opacity,1),o=[],s=i.fill.stops,h=i.baseColor,l=this.element.colors?"colors.value":"colors",c=a(h,s[0],r),u=a(h,s[s.length-1],r);for(n=0;s.length>n;n++)e=s[n],o.push(f.round(100*e.offset())+"% "+a(h,e,r));t.push([l,o.join(",")],["color",c],["color2",u])}}),V=L.extend({init:function(t,e){this.transform=e,L.fn.init.call(this,t)},createElement:function(){this.element=n("skew"),this.setTransform()},optionsChange:function(t){"transform"===t.field&&this.refresh(this.srcElement.currentTransform())},refresh:function(t){this.transform=t,this.setTransform()},transformOrigin:function(){return"-0.5,-0.5"},setTransform:function(){this.allAttr(this.mapTransform())},mapTransform:function(){var t=this.transform,e=[],n=C(t);return n?(n.round(D),e.push(["on","true"],["matrix",[n.a,n.c,n.b,n.d,0,0].join(",")],["offset",n.e+"px,"+n.f+"px"],["origin",this.transformOrigin()])):e.push(["on","false"]),e}}),X=G.extend({init:function(t,e,n){this.fill=this.createFillNode(t,e,n),this.stroke=new $(t,n),this.transform=this.createTransformNode(t,e),G.fn.init.call(this,t)},attachTo:function(t,e){this.fill.attachTo(this.element),this.stroke.attachTo(this.element),this.transform.attachTo(this.element),L.fn.attachTo.call(this,t,e)},createFillNode:function(t,e,n){return new U(t,e,n)},createTransformNode:function(t,e){return new V(t,e)},createElement:function(){this.element=n("shape"),this.setCoordsize(),this.setStyle()},optionsChange:function(t){s(t.field)?this.fill.optionsChange(t):0===t.field.indexOf("stroke")?this.stroke.optionsChange(t):"transform"===t.field?this.transform.optionsChange(t):"opacity"===t.field&&(this.fill.setOpacity(),this.stroke.setOpacity()),G.fn.optionsChange.call(this,t)},refreshTransform:function(t){this.transform.refresh(this.srcElement.currentTransform(t))},refreshOpacity:function(t){t*=N(this.srcElement.options.opacity,1),this.fill.refreshOpacity(t),this.stroke.refreshOpacity(t)},mapStyle:function(t,e){var n,i=G.fn.mapStyle.call(this);return t&&e||(t=e=R),i.push(["position","absolute"],["width",t+"px"],["height",e+"px"]),n=this.srcElement.options.cursor,n&&i.push(["cursor",n]),i},setCoordsize:function(){this.allAttr([["coordorigin","0 0"],["coordsize",z+" "+z]])}}),Y=L.extend({createElement:function(){this.element=n("path"),this.setPathData()},geometryChange:function(){this.setPathData()},setPathData:function(){this.attr("v",this.renderData())},renderData:function(){return r(this.srcElement)}}),q=X.extend({init:function(t,e,n){this.pathData=this.createDataNode(t),X.fn.init.call(this,t,e,n)},attachTo:function(t,e){this.pathData.attachTo(this.element),X.fn.attachTo.call(this,t,e)},createDataNode:function(t){return new Y(t)},geometryChange:function(){this.pathData.geometryChange(),X.fn.geometryChange.call(this)}}),W=Y.extend({renderData:function(){var t,e,n,i=this.srcElement.paths;if(i.length>0){for(t=[],e=0;i.length>e;e++)n=i.length-1>e,t.push(r(i[e],n));return t.join(" ")}}}),H=q.extend({createDataNode:function(t){return new W(t)}}),J=V.extend({transformOrigin:function(){var t=this.srcElement.geometry().bbox(),e=t.center(),n=-p(e.x)/p(t.width()),i=-p(e.y)/p(t.height());return n+","+i}}),Q=X.extend({createElement:function(){this.element=n("oval"),this.setStyle()},createTransformNode:function(t,e){return new J(t,e)},geometryChange:function(){X.fn.geometryChange.call(this),this.setStyle(),this.refreshTransform()},mapStyle:function(){var t=this.srcElement.geometry(),e=t.radius,n=t.center,i=p(2*e),r=X.fn.mapStyle.call(this,i,i);return r.push(["left",p(n.x-e)+"px"],["top",p(n.y-e)+"px"]),r}}),K=Y.extend({renderData:function(){return r(this.srcElement.toPath())}}),Z=q.extend({createDataNode:function(t){return new K(t)}}),tt=Y.extend({createElement:function(){Y.fn.createElement.call(this),this.attr("textpathok",!0)},renderData:function(){var t=this.srcElement.rect(),e=t.center();return"m "+i([new b.Point(t.topLeft().x,e.y)])+" l "+i([new b.Point(t.bottomRight().x,e.y)])}}),et=L.extend({createElement:function(){this.element=n("textpath"),this.attr("on",!0),this.attr("fitpath",!1),this.setStyle(),this.setString()},optionsChange:function(t){"content"===t.field?this.setString():this.setStyle(),L.fn.optionsChange.call(this,t)},mapStyle:function(){return[["font",this.srcElement.options.font]]},setString:function(){this.attr("string",this.srcElement.content())}}),nt=q.extend({init:function(t,e,n){this.path=new et(t),q.fn.init.call(this,t,e,n)},createDataNode:function(t){return new tt(t)},attachTo:function(t,e){this.path.attachTo(this.element),q.fn.attachTo.call(this,t,e)},optionsChange:function(t){("font"===t.field||"content"===t.field)&&(this.path.optionsChange(t),this.pathData.geometryChange(t)),q.fn.optionsChange.call(this,t)}}),it=Y.extend({renderData:function(){var t=this.srcElement.rect(),e=(new y.Path).moveTo(t.topLeft()).lineTo(t.topRight()).lineTo(t.bottomRight()).lineTo(t.bottomLeft()).close();return r(e)}}),rt=V.extend({init:function(t,e,n){this.opacity=n,V.fn.init.call(this,t,e)},createElement:function(){this.element=n("fill"),this.attr("type","frame"),this.attr("rotate",!0),this.setOpacity(),this.setSrc(),this.setTransform()},optionsChange:function(t){"src"===t.field&&this.setSrc(),V.fn.optionsChange.call(this,t)},geometryChange:function(){this.refresh()},refreshOpacity:function(t){this.opacity=t,this.setOpacity()},setOpacity:function(){var t=[];this.mapOpacityTo(t,this.srcElement.options.opacity),this.allAttr(t)},setSrc:function(){this.attr("src",this.srcElement.src())},mapTransform:function(){var t,e,n,i,r,o,s,a,h=this.srcElement,l=h.rawBBox(),c=l.center(),u=R/2,f=R,p=l.width()/f,g=l.height()/f,v=0,x=this.transform;return x?(n=C(x),i=m(n.a*n.a+n.b*n.b),r=m(n.c*n.c+n.d*n.d),p*=i,g*=r,o=S(d(n.b,n.d)),s=S(d(-n.c,n.a)),v=(o+s)/2,0!==v?(a=h.bbox().center(),t=(a.x-u)/f,e=(a.y-u)/f):(t=(c.x*i+n.e-u)/f,e=(c.y*r+n.f-u)/f)):(t=(c.x-u)/f,e=(c.y-u)/f),p=A(p,D),g=A(g,D),t=A(t,D),e=A(e,D),v=A(v,D),[["size",p+","+g],["position",t+","+e],["angle",v]]}}),ot=q.extend({createFillNode:function(t,e,n){return new rt(t,e,n)},createDataNode:function(t){return new it(t)},optionsChange:function(t){("src"===t.field||"transform"===t.field)&&this.fill.optionsChange(t),q.fn.optionsChange.call(this,t)},geometryChange:function(){this.fill.geometryChange(),q.fn.geometryChange.call(this)},refreshTransform:function(t){q.fn.refreshTransform.call(this,t),this.fill.refresh(this.srcElement.currentTransform(t))}}),st=Y.extend({renderData:function(){var t=this.srcElement.geometry(),e=["m",i([t.topLeft()]),"l",i([t.topRight(),t.bottomRight(),t.bottomLeft()]),"x e"];return e.join(" ")}}),at=q.extend({createDataNode:function(t){return new st(t)}}),ht={Group:j,Text:nt,Path:q,MultiPath:H,Circle:Q,Arc:Z,Image:ot,Rect:at};g.support.vml=function(){var t=g.support.browser;return t.msie&&9>t.version}(),c="inherit",g.support.browser.msie&&8>g.support.browser.version&&(c="rect(auto auto auto auto)"),g.support.vml&&y.SurfaceFactory.current.register("vml",M,30),v(y,{vml:{ArcDataNode:K,ArcNode:Z,CircleTransformNode:J,CircleNode:Q,FillNode:U,GroupNode:j,ImageNode:ot,ImageFillNode:rt,ImagePathDataNode:it,MultiPathDataNode:W,MultiPathNode:H,Node:L,PathDataNode:Y,PathNode:q,RectDataNode:st,RectNode:at,RootNode:F,StrokeNode:$,Surface:M,TextNode:nt,TextPathNode:et,TextPathDataNode:tt,TransformNode:V}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("drawing/html.min",["kendo.color.min","drawing/shapes.min","util/main.min","util/text-metrics.min"],t)}(function(){!function(t,e,n){"use strict";function i(n,i){function o(e){var n=new at.Group,r=e.getBoundingClientRect();return R(n,[1,0,0,1,-r.left,-r.top]),pt._clipbox=!1,pt._matrix=ht.Matrix.unit(),pt._stackingContext={element:e,group:n},pt._avoidLinks=i.avoidLinks===!0?"a":i.avoidLinks,t(e).addClass("k-pdf-export"),et(e,n),t(e).removeClass("k-pdf-export"),n}function s(e){return null!=e?("string"==typeof e&&(e=kendo.template(e.replace(/^\s+|\s+$/g,""))),"function"==typeof e?function(n){var i=e(n);return i?("string"==typeof i&&(i=i.replace(/^\s+|\s+$/g,"")),t(i)[0]):void 0}:function(){return t(e).clone()[0]}):void 0}function a(e){var n,i,r,o,s=e.cloneNode(!1);if(1==e.nodeType){n=t(e),i=t(s),o=n.data();for(r in o)i.data(r,o[r]);if(/^canvas$/i.test(e.tagName))s.getContext("2d").drawImage(e,0,0);else if(/^input$/i.test(e.tagName))e.removeAttribute("name");else for(r=e.firstChild;r;r=r.nextSibling)s.appendChild(a(r))}return s}function h(n,i,r,o,h,l,c){function u(){function t(){f(T,function(){n({pages:T,container:E})})}var e,i;("-"!=r||h)&&p(k),e=v(),k.parentNode.insertBefore(e,k),e.appendChild(k),C?(i=T.length,T.forEach(function(e,n){var r=C({element:e,pageNum:n+1,totalPages:T.length});r&&(e.appendChild(r),d(r,function(){0===--i&&t()}))})):t()}function p(n){var i,o,s,a,l=w(n),c=e(b(l,"padding-bottom")),u=e(b(l,"border-bottom-width")),f=S;for(S+=c+u,i=!0,o=n.firstChild;o;o=o.nextSibling)if(1==o.nodeType){if(i=!1,s=t(o),s.is(r)){g(o);continue}if(!h){p(o);continue}if(!/^(?:static|relative)$/.test(b(w(o),"position")))continue;a=x(o),1==a?g(o):a&&(s.data("kendoChart")||/^(?:img|tr|iframe|svg|object|canvas|input|textarea|select|video|h[1-6])/i.test(o.tagName))?g(o):p(o)}else 3==o.nodeType&&h&&(y(o,i),i=!1);S=f}function m(t){var e=t.parentNode,n=e.firstChild;if(t===n)return!0;if(t===e.children[0]){if(7==n.nodeType||8==n.nodeType)return!0;if(3==n.nodeType)return!/\S/.test(n.data)}return!1}function g(e){var n,i,r;return 1==e.nodeType&&e!==k&&m(e)?g(e.parentNode):(n=t(e).closest("table").find("colgroup"),i=v(),r=_.createRange(),r.setStartBefore(k),r.setEndBefore(e),i.appendChild(r.extractContents()),k.parentNode.insertBefore(i,k),void(n[0]&&n.clone().prependTo(t(e).closest("table"))))}function v(){var e=_.createElement("KENDO-PDF-PAGE");return t(e).css({display:"block",boxSizing:"content-box",width:o||"auto",padding:l.top+"px "+l.right+"px "+l.bottom+"px "+l.left+"px",position:"relative",height:h||"auto",overflow:h||o?"hidden":"visible",clear:"both"}),c&&c.pageClassName&&(e.className=c.pageClassName),T.push(e),e}function x(t){var e,n,i=t.getBoundingClientRect();return 0===i.width||0===i.height?0:(e=k.getBoundingClientRect().top,n=h-S,i.height>n?3:i.top-e>n?1:i.bottom-e>n?2:0)}function y(t,e){var n,i,r,o,s;/\S/.test(t.data)&&(n=t.data.length,i=_.createRange(),i.selectNodeContents(t),r=x(i),r&&(o=t,1==r?g(e?t.parentNode:t):(!function a(e,n,r){return i.setEnd(t,n),e==n||n==r?n:x(i)?a(e,e+n>>1,n):a(n,n+r>>1,r)}(0,n>>1,n),!/\S/.test(""+i)&&e?g(t.parentNode):(o=t.splitText(i.endOffset),s=v(),i.setStartBefore(k),s.appendChild(i.extractContents()),k.parentNode.insertBefore(s,k))),y(o)))}var C=s(c.template),_=i.ownerDocument,T=[],k=a(i),E=_.createElement("KENDO-PDF-DOCUMENT"),S=0;t(k).find("tfoot").each(function(){this.parentNode.appendChild(this)}),t(k).find("ol").each(function(){t(this).children().each(function(t){this.setAttribute("kendo-split-index",t)})}),t(E).css({display:"block",position:"absolute",boxSizing:"content-box",left:"-10000px",top:"-10000px"}),o&&(t(E).css({width:o,paddingLeft:l.left,paddingRight:l.right}),t(k).css({overflow:"hidden"})),E.appendChild(k),i.parentNode.insertBefore(E,i),c.beforePageBreak?setTimeout(function(){c.beforePageBreak(E,u)},15):setTimeout(u,15)}i||(i={});var l=t.Deferred();if(n=t(n)[0],!n)return l.reject("No element to export");if("function"!=typeof window.getComputedStyle)throw Error("window.getComputedStyle is missing.  You are using an unsupported browser, or running in IE8 compatibility mode.  Drawing HTML is supported in Chrome, Firefox, Safari and IE9+.");return kendo.pdf&&kendo.pdf.defineFont(r(n.ownerDocument)),d(n,function(){var t,e=i&&i.forcePageBreak,r=i&&i.paperSize&&"auto"!=i.paperSize,s=r&&kendo.pdf.getPaperOptions(function(t,e){return t in i?i[t]:e}),a=r&&s.paperSize[0],c=r&&s.paperSize[1],u=i.margin&&s.margin;e||c?(u||(u={left:0,top:0,right:0,bottom:0}),t=new at.Group({pdf:{multiPage:!0,paperSize:r?s.paperSize:"auto"}}),h(function(e){if(i.progress){var n=!1,r=0;!function s(){e.pages.length>r?(t.append(o(e.pages[r])),i.progress({pageNum:++r,totalPages:e.pages.length,cancel:function(){n=!0}}),n?e.container.parentNode.removeChild(e.container):setTimeout(s)):(e.container.parentNode.removeChild(e.container),l.resolve(t))}()}else e.pages.forEach(function(e){t.append(o(e))}),e.container.parentNode.removeChild(e.container),l.resolve(t)},n,e,a?a-u.left-u.right:null,c?c-u.top-u.bottom:null,u,i)):l.resolve(o(n))}),l.promise()}function r(t){function e(t){if(t){var e=null;try{e=t.cssRules}catch(n){}e&&i(t,e)}}function n(t){var e,n=b(t.style,"src");return n?ot(n).reduce(function(t,e){var n=st(e);return n&&t.push(n),t},[]):(e=st(t.cssText),e?[e]:[])}function i(t,i){var o,s,a,h,l,c,u;for(o=0;i.length>o;++o)switch(s=i[o],s.type){case 3:e(s.styleSheet);break;case 5:a=s.style,h=ot(b(a,"font-family")),l=/^([56789]00|bold)$/i.test(b(a,"font-weight")),c="italic"==b(a,"font-style"),u=n(s),u.length>0&&r(t,h,l,c,u[0])}}function r(t,e,n,i,r){/^data:/i.test(r)||/^[^\/:]+:\/\//.test(r)||/^\//.test(r)||(r=(t.href+"").replace(/[^\/]*$/,"")+r),e.forEach(function(t){t=t.replace(/^(['"]?)(.*?)\1$/,"$2"),n&&(t+="|bold"),i&&(t+="|italic"),o[t]=r})}var o,s;for(null==t&&(t=document),o={},s=0;t.styleSheets.length>s;++s)e(t.styleSheets[s]);return o}function o(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function s(t){return t="_counter_"+t,pt[t]}function a(t){var e=[],n=pt;for(t="_counter_"+t;n;)o(n,t)&&e.push(n[t]),n=Object.getPrototypeOf(n);return e.reverse()}function h(t,e){var n=pt;for(t="_counter_"+t;n&&!o(n,t);)n=Object.getPrototypeOf(n);n||(n=pt._root),n[t]=(n[t]||0)+(null==e?1:e)}function l(t,e){t="_counter_"+t,pt[t]=null==e?0:e}function c(t,n,i){var r,o,s;for(r=0;t.length>r;)o=t[r++],s=e(t[r]),isNaN(s)?n(o,i):(n(o,s),++r)}function u(t,e){var n=kendo.parseColor(t);return n&&(n=n.toRGB(),e?n=n.toCssRgba():0===n.a&&(n=null)),n}function f(t,e){function n(){--i<=0&&e()}var i=0;t.forEach(function(t){var e,r,o=t.querySelectorAll("img");for(e=0;o.length>e;++e)r=o[e],r.complete||(i++,r.onload=r.onerror=n)}),i||n()}function d(t,e){function n(t){dt[t]||(dt[t]=!0,o.push(t))}function i(){--r<=0&&e()}var r,o=[];!function s(t){/^img$/i.test(t.tagName)&&n(t.src),rt(b(w(t),"background-image")).forEach(function(t){"url"==t.type&&n(t.url)}),t.children&&lt.call(t.children).forEach(s)}(t),r=o.length,0===r&&i(),o.forEach(function(t){var e=dt[t]=new Image;/^data:/i.test(t)||(e.crossOrigin="Anonymous"),e.src=t,e.complete?i():(e.onload=i,e.onerror=function(){dt[t]=null,i()})})}function p(t){var e,i="";do e=t%26,i=String.fromCharCode(97+e)+i,t=n.floor(t/26);while(t>0);return i}function m(t,e,n){var i,r;pt=Object.create(pt),pt[t.tagName.toLowerCase()]={element:t,style:e},i=b(e,"text-decoration"),i&&"none"!=i&&(r=b(e,"color"),i.split(/\s+/g).forEach(function(t){pt[t]||(pt[t]=r)})),y(e)&&(pt._stackingContext={element:t,group:n})}function g(){pt=Object.getPrototypeOf(pt)}function v(t){if(null!=pt._clipbox){var e=t.bbox(pt._matrix);pt._clipbox=pt._clipbox?ht.Rect.intersect(pt._clipbox,e):e}}function x(){var t=pt._clipbox;return null==t?!0:t?0===t.width()||0===t.height():void 0}function y(t){function e(e){return b(t,e)}return"none"!=e("transform")||"static"!=e("position")&&"auto"!=e("z-index")||e("opacity")<1?!0:void 0}function w(t,e){return window.getComputedStyle(t,e||null)}function b(t,e){return t.getPropertyValue(e)||ct.webkit&&t.getPropertyValue("-webkit-"+e)||ct.mozilla&&t.getPropertyValue("-moz-"+e)||ct.opera&&t.getPropertyValue("-o-"+e)||ct.msie&&t.getPropertyValue("-ms-"+e)}function C(t,e,n,i){t.setProperty(e,n,i),ct.webkit?t.setProperty("-webkit-"+e,n,i):ct.mozilla?t.setProperty("-moz-"+e,n,i):ct.opera?t.setProperty("-o-"+e,n,i):ct.msie&&(t.setProperty("-ms-"+e,n,i),e="ms"+e.replace(/(^|-)([a-z])/g,function(t,e,n){return e+n.toUpperCase()}),t[e]=n)}function _(t){var e,n,i,r;if((ct.msie||ct.chrome)&&(e=t.getClientRects(),i=0,3>=e.length)){for(r=0;e.length>r;++r)1>=e[r].width?i++:n=e[r];if(i==e.length-1)return n}return t.getBoundingClientRect()}function T(t,n){return n="border-"+n,{width:e(b(t,n+"-width")),style:b(t,n+"-style"),color:u(b(t,n+"-color"),!0)}}function k(t,e){var n=t.style.cssText,i=e();return t.style.cssText=n,i}function E(t,n){var i=b(t,"border-"+n+"-radius").split(/\s+/g).map(e);return 1==i.length&&i.push(i[0]),D({x:i[0],y:i[1]})}function S(t){var e=t.getBoundingClientRect();return e=A(e,"border-*-width",t),e=A(e,"padding-*",t)}function A(t,n,i){var r,o,s,a,h;return"string"==typeof n?(r=w(i),o=e(b(r,n.replace("*","top"))),s=e(b(r,n.replace("*","right"))),a=e(b(r,n.replace("*","bottom"))),h=e(b(r,n.replace("*","left")))):"number"==typeof n&&(o=s=a=h=n),{top:t.top+o,right:t.right-s,bottom:t.bottom-a,left:t.left+h,width:t.right-t.left-s-h,height:t.bottom-t.top-a-o}}function N(t){var n,i,r=b(t,"transform");return"none"==r?null:(n=/^\s*matrix\(\s*(.*?)\s*\)\s*$/.exec(r),n?(i=b(t,"transform-origin"),n=n[1].split(/\s*,\s*/g).map(e),i=i.split(/\s+/g).map(e),{matrix:n,origin:i}):void 0)}function P(t){return 180*t/n.PI%360}function O(t){var i=e(t);return/grad$/.test(t)?n.PI*i/200:/rad$/.test(t)?i:/turn$/.test(t)?n.PI*i*2:/deg$/.test(t)?n.PI*i/180:void 0}function R(t,e){return e=new ht.Matrix(e[0],e[1],e[2],e[3],e[4],e[5]),t.transform(e),e}function z(t,e){t.clip(e)}function B(t,e,n,i){for(var r=new ht.Arc([e,n],i).curvePoints(),o=1;r.length>o;)t.curveTo(r[o++],r[o++],r[o++])}function D(t){return(0>=t.x||0>=t.y)&&(t.x=t.y=0),t}function M(t,e,i,r,o){var s=n.max(0,e.x),a=n.max(0,e.y),h=n.max(0,i.x),l=n.max(0,i.y),c=n.max(0,r.x),u=n.max(0,r.y),f=n.max(0,o.x),d=n.max(0,o.y),p=n.min(t.width/(s+h),t.height/(l+u),t.width/(c+f),t.height/(d+a));return 1>p&&(s*=p,a*=p,h*=p,l*=p,c*=p,u*=p,f*=p,d*=p),{tl:{x:s,y:a},tr:{x:h,y:l},br:{x:c,y:u},bl:{x:f,y:d}}}function L(t,n,i){var r,o,s,a,h,l,c,u,f=w(t),d=E(f,"top-left"),p=E(f,"top-right"),m=E(f,"bottom-left"),g=E(f,"bottom-right");return("padding"==i||"content"==i)&&(r=T(f,"top"),o=T(f,"right"),s=T(f,"bottom"),a=T(f,"left"),d.x-=a.width,d.y-=r.width,p.x-=o.width,p.y-=r.width,g.x-=o.width,g.y-=s.width,m.x-=a.width,m.y-=s.width,"content"==i&&(h=e(b(f,"padding-top")),l=e(b(f,"padding-right")),c=e(b(f,"padding-bottom")),u=e(b(f,"padding-left")),d.x-=u,d.y-=h,p.x-=l,p.y-=h,g.x-=l,g.y-=c,m.x-=u,m.y-=c)),"number"==typeof i&&(d.x-=i,d.y-=i,p.x-=i,p.y-=i,g.x-=i,g.y-=i,m.x-=i,m.y-=i),F(n,d,p,g,m)}function F(t,e,n,i,r){var o=M(t,e,n,i,r),s=o.tl,a=o.tr,h=o.br,l=o.bl,c=new at.Path({fill:null,stroke:null});return c.moveTo(t.left,t.top+s.y),s.x&&B(c,t.left+s.x,t.top+s.y,{startAngle:-180,endAngle:-90,radiusX:s.x,radiusY:s.y}),c.lineTo(t.right-a.x,t.top),a.x&&B(c,t.right-a.x,t.top+a.y,{startAngle:-90,endAngle:0,radiusX:a.x,radiusY:a.y}),c.lineTo(t.right,t.bottom-h.y),h.x&&B(c,t.right-h.x,t.bottom-h.y,{startAngle:0,endAngle:90,radiusX:h.x,radiusY:h.y}),c.lineTo(t.left+l.x,t.bottom),l.x&&B(c,t.left+l.x,t.bottom-l.y,{startAngle:90,endAngle:180,radiusX:l.x,radiusY:l.y}),c.close()}function I(t,n){var i=e(t)+"";switch(n){case"decimal-leading-zero":return 2>i.length&&(i="0"+i),i;case"lower-roman":return ut(t).toLowerCase();case"upper-roman":return ut(t).toUpperCase();case"lower-latin":case"lower-alpha":
return p(t-1);case"upper-latin":case"upper-alpha":return p(t-1).toUpperCase();default:return i}}function G(t,e){function n(t,e,n){return n?(n=n.replace(/^\s*(["'])(.*)\1\s*$/,"$2"),a(t).map(function(t){return I(t,e)}).join(n)):I(s(t)||0,e)}var i,r=ot(e,/^\s+/),o=[];return r.forEach(function(e){var r;(i=/^\s*(["'])(.*)\1\s*$/.exec(e))?o.push(i[2].replace(/\\([0-9a-f]{4})/gi,function(t,e){return String.fromCharCode(parseInt(e,16))})):(i=/^\s*counter\((.*?)\)\s*$/.exec(e))?(r=ot(i[1]),o.push(n(r[0],r[1]))):(i=/^\s*counters\((.*?)\)\s*$/.exec(e))?(r=ot(i[1]),o.push(n(r[0],r[2],r[1]))):o.push((i=/^\s*attr\((.*?)\)\s*$/.exec(e))?t.getAttribute(i[1])||"":e)}),o.join("")}function j(t){var e,n;if(t.cssText)return t.cssText;for(e=[],n=0;t.length>n;++n)e.push(t[n]+": "+b(t,t[n]));return e.join(";\n")}function $(t,e){function n(e,n){var r,o=w(t,e);o.content&&"normal"!=o.content&&"none"!=o.content&&"0px"!=o.width&&(r=t.ownerDocument.createElement(ft),r.style.cssText=j(o),r.textContent=G(t,o.content),t.insertBefore(r,n),i.push(r))}var i,r;return t.tagName==ft?void U(t,e):(i=[],n(":before",t.firstChild),n(":after",null),r=t.className,t.className+=" kendo-pdf-hide-pseudo-elements",U(t,e),t.className=r,void i.forEach(function(e){t.removeChild(e)}))}function U(i,r){function o(t){var e,n,r,o,s,a;if(/^td$/i.test(i.tagName)&&(e=pt.table,e&&"collapse"==b(e.style,"border-collapse"))){if(n=T(e.style,"left").width,r=T(e.style,"top").width,0===n&&0===r)return t;if(o=e.element.getBoundingClientRect(),s=e.element.rows[0].cells[0],a=s.getBoundingClientRect(),a.top==o.top||a.left==o.left)return lt.call(t).map(function(t){return{left:t.left+n,top:t.top+r,right:t.right+n,bottom:t.bottom+r,height:t.height,width:t.width}})}return t}function s(t,e,i,o,s,a,h,l){function c(e,r,o){var s=n.PI/2*e/(e+i),a={x:r.x-e,y:r.y-i},h=new at.Path({fill:{color:t},stroke:null}).moveTo(0,0);R(h,o),B(h,0,r.y,{startAngle:-90,endAngle:-P(s),radiusX:r.x,radiusY:r.y}),a.x>0&&a.y>0?(h.lineTo(a.x*n.cos(s),r.y-a.y*n.sin(s)),B(h,0,r.y,{startAngle:-P(s),endAngle:-90,radiusX:a.x,radiusY:a.y,anticlockwise:!0})):a.x>0?h.lineTo(a.x,i).lineTo(0,i):h.lineTo(a.x,i).lineTo(a.x,0),f.append(h.close())}if(!(0>=i)){var u,f=new at.Group;R(f,l),r.append(f),D(a),D(h),u=new at.Path({fill:{color:t},stroke:null}),f.append(u),u.moveTo(a.x?n.max(a.x,o):0,0).lineTo(e-(h.x?n.max(h.x,s):0),0).lineTo(e-n.max(h.x,s),i).lineTo(n.max(a.x,o),i).close(),a.x&&c(o,a,[-1,0,0,1,a.x,0]),h.x&&c(s,h,[1,0,0,1,e-h.x,0])}}function a(e){var n,o,s=new at.Group;for(z(s,F(e,U,Y,H,q)),r.append(s),"A"==i.tagName&&i.href&&!/^#?$/.test(t(i).attr("href"))&&(pt._avoidLinks&&t(i).is(pt._avoidLinks)||(s._pdfLink={url:i.href,top:e.top,right:e.right,bottom:e.bottom,left:e.left})),Q&&(n=new at.Path({fill:{color:Q.toCssRgba()},stroke:null}),n.moveTo(e.left,e.top).lineTo(e.right,e.top).lineTo(e.right,e.bottom).lineTo(e.left,e.bottom).close(),s.append(n)),o=f.length;--o>=0;)h(s,e,f[o],d[o%d.length],m[o%m.length],g[o%g.length],x[o%x.length])}function h(t,n,r,o,s,a,h){function l(t,n,r,l,c){function u(){for(;g.origin.x>n.left;)g.origin.x-=r}function f(){for(;g.origin.y>n.top;)g.origin.y-=l}function d(){for(;n.right>g.origin.x;)c(t,g.clone()),g.origin.x+=r}var p,m,g,v,x=r/l,y=n;if("content-box"==a?(y=A(y,"border-*-width",i),y=A(y,"padding-*",i)):"padding-box"==a&&(y=A(y,"border-*-width",i)),/^\s*auto(\s+auto)?\s*$/.test(h)||(p=h.split(/\s+/g),r=/%$/.test(p[0])?y.width*e(p[0])/100:e(p[0]),l=1==p.length||"auto"==p[1]?r/x:/%$/.test(p[1])?y.height*e(p[1])/100:e(p[1])),m=(s+"").split(/\s+/),1==m.length&&(m[1]="50%"),m[0]=/%$/.test(m[0])?e(m[0])/100*(y.width-r):e(m[0]),m[1]=/%$/.test(m[1])?e(m[1])/100*(y.height-l):e(m[1]),g=new ht.Rect([y.left+m[0],y.top+m[1]],[r,l]),"no-repeat"==o)c(t,g);else if("repeat-x"==o)u(),d();else if("repeat-y"==o)for(f();n.bottom>g.origin.y;)c(t,g.clone()),g.origin.y+=l;else if("repeat"==o)for(u(),f(),v=g.origin.clone();n.bottom>g.origin.y;)g.origin.x=v.x,d(),g.origin.y+=l}if(r&&"none"!=r)if("url"==r.type){if(/^url\(\"data:image\/svg/i.test(r.url))return;var c=dt[r.url];c&&c.width>0&&c.height>0&&l(t,n,c.width,c.height,function(t,e){t.append(new at.Image(r.url,e))})}else{if("linear"!=r.type)return;l(t,n,n.width,n.height,V(r))}}function l(){function t(t){k(i,function(){i.style.position="relative";var e=i.ownerDocument.createElement(ft);e.style.position="absolute",e.style.boxSizing="border-box","outside"==n?(e.style.width="6em",e.style.left="-6.8em",e.style.textAlign="right"):e.style.left="0px",t(e),i.insertBefore(e,i.firstChild),et(e,r),i.removeChild(e)})}function e(t){var e,n=i.parentNode.children,r=i.getAttribute("kendo-split-index");if(null!=r)return t(0|r,n.length);for(e=0;n.length>e;++e)if(n[e]===i)return t(e,n.length)}var n,o=b(O,"list-style-type");if("none"!=o)switch(n=b(O,"list-style-position"),o){case"circle":case"disc":case"square":t(function(t){t.style.fontSize="60%",t.style.lineHeight="200%",t.style.paddingRight="0.5em",t.style.fontFamily="DejaVu Serif",t.innerHTML={disc:"●",circle:"◯",square:"■"}[o]});break;case"decimal":case"decimal-leading-zero":t(function(t){e(function(e){++e,"decimal-leading-zero"==o&&2>(e+"").length&&(e="0"+e),t.innerHTML=e+"."})});break;case"lower-roman":case"upper-roman":t(function(t){e(function(e){e=ut(e+1),"upper-roman"==o&&(e=e.toUpperCase()),t.innerHTML=e+"."})});break;case"lower-latin":case"lower-alpha":case"upper-latin":case"upper-alpha":t(function(t){e(function(e){e=p(e),/^upper/i.test(o)&&(e=e.toUpperCase()),t.innerHTML=e+"."})})}}function c(t,e,n){function o(t){return{x:t.y,y:t.x}}var h,l,c,u,f,d,p,m;if(0!==t.width&&0!==t.height&&(a(t),h=$.width>0&&(e&&"ltr"==J||n&&"rtl"==J),l=G.width>0&&(n&&"ltr"==J||e&&"rtl"==J),0!==I.width||0!==$.width||0!==G.width||0!==j.width)){if(I.color==G.color&&I.color==j.color&&I.color==$.color&&I.width==G.width&&I.width==j.width&&I.width==$.width&&h&&l)return t=A(t,I.width/2),c=L(i,t,I.width/2),c.options.stroke={color:I.color,width:I.width},void r.append(c);if(0===U.x&&0===Y.x&&0===H.x&&0===q.x&&2>I.width&&2>$.width&&2>G.width&&2>j.width)return I.width>0&&r.append(new at.Path({stroke:{width:I.width,color:I.color}}).moveTo(t.left,t.top+I.width/2).lineTo(t.right,t.top+I.width/2)),j.width>0&&r.append(new at.Path({stroke:{width:j.width,color:j.color}}).moveTo(t.left,t.bottom-j.width/2).lineTo(t.right,t.bottom-j.width/2)),h&&r.append(new at.Path({stroke:{width:$.width,color:$.color}}).moveTo(t.left+$.width/2,t.top).lineTo(t.left+$.width/2,t.bottom)),void(l&&r.append(new at.Path({stroke:{width:G.width,color:G.color}}).moveTo(t.right-G.width/2,t.top).lineTo(t.right-G.width/2,t.bottom)));u=M(t,U,Y,H,q),f=u.tl,d=u.tr,p=u.br,m=u.bl,s(I.color,t.width,I.width,$.width,G.width,f,d,[1,0,0,1,t.left,t.top]),s(j.color,t.width,j.width,G.width,$.width,p,m,[-1,0,0,-1,t.right,t.bottom]),s($.color,t.height,$.width,j.width,I.width,o(m),o(f),[0,-1,1,0,t.left,t.bottom]),s(G.color,t.height,G.width,I.width,j.width,o(d),o(p),[0,1,-1,0,t.right,t.top])}}var f,d,m,g,x,y,C,_,S,N,O=w(i),I=T(O,"top"),G=T(O,"right"),j=T(O,"bottom"),$=T(O,"left"),U=E(O,"top-left"),Y=E(O,"top-right"),q=E(O,"bottom-left"),H=E(O,"bottom-right"),J=b(O,"direction"),Q=b(O,"background-color");if(Q=u(Q),f=rt(b(O,"background-image")),d=ot(b(O,"background-repeat")),m=ot(b(O,"background-position")),g=ot(b(O,"background-origin")),x=ot(b(O,"background-size")),ct.msie&&10>ct.version&&(m=ot(i.currentStyle.backgroundPosition)),y=A(i.getBoundingClientRect(),"border-*-width",i),function(){var t,n,i,o,s,a,h,l=b(O,"clip"),c=/^\s*rect\((.*)\)\s*$/.exec(l);c&&(t=c[1].split(/[ ,]+/g),n="auto"==t[0]?y.top:e(t[0])+y.top,i="auto"==t[1]?y.right:e(t[1])+y.left,o="auto"==t[2]?y.bottom:e(t[2])+y.top,s="auto"==t[3]?y.left:e(t[3])+y.left,a=new at.Group,h=(new at.Path).moveTo(s,n).lineTo(i,n).lineTo(i,o).lineTo(s,o).close(),z(a,h),r.append(a),r=a,v(h))}(),N=b(O,"display"),"table-row"==N)for(C=[],_=0,S=i.children;S.length>_;++_)C.push(S[_].getBoundingClientRect());else C=i.getClientRects(),1==C.length&&(C=[i.getBoundingClientRect()]);for(C=o(C),_=0;C.length>_;++_)c(C[_],0===_,_==C.length-1);return C.length>0&&"list-item"==N&&l(C[0]),function(){function t(){var t=L(i,y,"padding"),e=new at.Group;z(e,t),r.append(e),r=e,v(t)}W(i)?t():/^(hidden|auto|scroll)/.test(b(O,"overflow"))?t():/^(hidden|auto|scroll)/.test(b(O,"overflow-x"))?t():/^(hidden|auto|scroll)/.test(b(O,"overflow-y"))&&t()}(),X(i,r)||K(i,r),r}function V(t){return function(i,r){var o,s,a,h,l,c,u,f,d,p,m,g,v,x=r.width(),y=r.height();switch(t.type){case"linear":switch(o=null!=t.angle?t.angle:n.PI,t.to){case"top":o=0;break;case"left":o=-n.PI/2;break;case"bottom":o=n.PI;break;case"right":o=n.PI/2;break;case"top left":case"left top":o=-n.atan2(y,x);break;case"top right":case"right top":o=n.atan2(y,x);break;case"bottom left":case"left bottom":o=n.PI+n.atan2(y,x);break;case"bottom right":case"right bottom":o=n.PI-n.atan2(y,x)}t.reverse&&(o-=n.PI),o%=2*n.PI,0>o&&(o+=2*n.PI),s=n.abs(x*n.sin(o))+n.abs(y*n.cos(o)),a=n.atan(x*n.tan(o)/y),h=n.sin(a),l=n.cos(a),c=n.abs(h)+n.abs(l),u=c/2*h,f=c/2*l,o>n.PI/2&&3*n.PI/2>=o&&(u=-u,f=-f),d=[],p=0,m=t.stops.map(function(n,i){var r,o=n.percent;return o?o=e(o)/100:n.length?o=e(n.length)/s:0===i?o=0:i==t.stops.length-1&&(o=1),r={color:n.color.toCssRgba(),offset:o},null!=o?(p=o,d.forEach(function(t,e){var n=t.stop;n.offset=t.left+(p-t.left)*(e+1)/(d.length+1)}),d=[]):d.push({left:p,stop:r}),r}),g=[.5-u,.5+f],v=[.5+u,.5-f],i.append(at.Path.fromRect(r).stroke(null).fill(new at.LinearGradient({start:g,end:v,stops:m,userSpace:!1})));break;case"radial":window.console&&window.console.log&&window.console.log("Radial gradients are not yet supported in HTML renderer")}}}function X(e,n){var i,r,o,s;return e.getAttribute(kendo.attr("role"))&&(i=kendo.widgetInstance(t(e)),i&&(i.exportDOMVisual||i.exportVisual))?(r=i.exportDOMVisual?i.exportDOMVisual():i.exportVisual())?(o=new at.Group,o.children.push(r),s=e.getBoundingClientRect(),o.transform(ht.transform().translate(s.left,s.top)),n.append(o),!0):!1:void 0}function Y(t,e,n){var i=S(t),r=new ht.Rect([i.left,i.top],[i.width,i.height]),o=new at.Image(e,r);z(o,L(t,i,"content")),n.append(o)}function q(t,n){var i=w(t),r=w(n),o=e(b(i,"z-index")),s=e(b(r,"z-index")),a=b(i,"position"),h=b(r,"position");return isNaN(o)&&isNaN(s)?/static|absolute/.test(a)&&/static|absolute/.test(h)?0:"static"==a?-1:"static"==h?1:0:isNaN(o)?0===s?0:s>0?-1:1:isNaN(s)?0===o?0:o>0?1:-1:e(o)-e(s)}function W(t){return/^(?:textarea|select|input)$/i.test(t.tagName)}function H(t){return t.selectedOptions&&t.selectedOptions.length>0?t.selectedOptions[0]:t.options[t.selectedIndex]}function J(t,e){var i=w(t),r=b(i,"color"),o=t.getBoundingClientRect();"checkbox"==t.type?(e.append(at.Path.fromRect(new ht.Rect([o.left+1,o.top+1],[o.width-2,o.height-2])).stroke(r,1)),t.checked&&e.append((new at.Path).stroke(r,1.2).moveTo(o.left+.22*o.width,o.top+.55*o.height).lineTo(o.left+.45*o.width,o.top+.75*o.height).lineTo(o.left+.78*o.width,o.top+.22*o.width))):(e.append(new at.Circle(new ht.Circle([(o.left+o.right)/2,(o.top+o.bottom)/2],n.min(o.width-2,o.height-2)/2)).stroke(r,1)),t.checked&&e.append(new at.Circle(new ht.Circle([(o.left+o.right)/2,(o.top+o.bottom)/2],n.min(o.width-8,o.height-8)/2)).fill(r).stroke(null)))}function Q(t,e){var n,i,r,o,s,a=t.tagName.toLowerCase();if("input"==a&&("checkbox"==t.type||"radio"==t.type))return J(t,e);if(n=t.parentNode,i=t.ownerDocument,r=i.createElement(ft),r.style.cssText=j(w(t)),"input"==a&&(r.style.whiteSpace="pre"),("select"==a||"textarea"==a)&&(r.style.overflow="auto"),"select"==a)if(t.multiple)for(s=0;t.options.length>s;++s)o=i.createElement(ft),o.style.cssText=j(w(t.options[s])),o.style.display="block",o.textContent=t.options[s].textContent,r.appendChild(o);else o=H(t),o&&(r.textContent=o.textContent);else r.textContent=t.value;n.insertBefore(r,t),r.scrollLeft=t.scrollLeft,r.scrollTop=t.scrollTop,K(r,e),n.removeChild(r)}function K(t,e){var n,i,r,o,s,a,h,l,c;switch(pt._stackingContext.element===t&&(pt._stackingContext.group=e),t.tagName.toLowerCase()){case"img":Y(t,t.src,e);break;case"canvas":try{Y(t,t.toDataURL("image/png"),e)}catch(u){}break;case"textarea":case"input":case"select":Q(t,e);break;default:for(n=[],i=[],r=[],o=[],s=t.firstChild;s;s=s.nextSibling)switch(s.nodeType){case 3:/\S/.test(s.data)&&Z(t,s,e);break;case 1:a=w(s),h=b(a,"display"),l=b(a,"float"),c=b(a,"position"),"static"!=c?o.push(s):"inline"!=h?"none"!=l?i.push(s):n.push(s):r.push(s)}n.sort(q).forEach(function(t){et(t,e)}),i.sort(q).forEach(function(t){et(t,e)}),r.sort(q).forEach(function(t){et(t,e)}),o.sort(q).forEach(function(t){et(t,e)})}}function Z(t,i,r){function o(){var t,e,r,o,a,h,f,d=c,p=l.substr(c).search(/\S/);if(c+=p,0>p||c>=u)return!0;if(g.setStart(i,c),g.setEnd(i,c+1),t=_(g),e=!1,y&&(p=l.substr(c).search(/\s/),p>=0&&(g.setEnd(i,c+p),r=g.getBoundingClientRect(),r.bottom==t.bottom&&(t=r,e=!0,c+=p))),!e){if(p=function m(e,n,r){g.setEnd(i,n);var o=_(g);return o.bottom!=t.bottom&&n>e?m(e,e+n>>1,n):o.right!=t.right?(t=o,r>n?m(n,n+r>>1,r):n):n}(c,n.min(u,c+E),u),p==c)return!0;if(c=p,p=(""+g).search(/\s+$/),0===p)return;p>0&&(g.setEnd(i,g.startOffset+p),t=g.getBoundingClientRect())}if(ct.msie&&(t=g.getClientRects()[0]),o=""+g,/^(?:pre|pre-wrap)$/i.test(C)){if(/\t/.test(o)){for(a=0,p=d;g.startOffset>p;++p)h=l.charCodeAt(p),9==h?a+=8-a%8:10==h||13==h?a=0:a++;for(;(p=o.search("	"))>=0;)f="        ".substr(0,8-(a+p)%8),o=o.substr(0,p)+f+o.substr(p+1)}}else o=o.replace(/\s+/g," ");s(o,t)}function s(t,e){var n,i,o;ct.msie&&!isNaN(d)&&(n=kendo.util.measureText(t,{font:p}),i=(e.top+e.bottom-n.height)/2,e={top:i,right:e.right,bottom:i+n.height,left:e.left,height:n.height,width:e.right-e.left}),o=new it(t,new ht.Rect([e.left,e.top],[e.width,e.height]),{font:p,fill:{color:m}}),r.append(o),a(e)}function a(t){function e(e,n){var i,o;e&&(i=f/12,o=new at.Path({stroke:{width:i,color:e}}),n-=i,o.moveTo(t.left,n).lineTo(t.right,n),r.append(o))}e(pt.underline,t.bottom),e(pt["line-through"],t.bottom-t.height/2.7),e(pt.overline,t.top)}var h,l,c,u,f,d,p,m,g,v,y,C,T,k,E;if(!x()&&(h=w(t),!(e(b(h,"text-indent"))<-500)&&(l=i.data,c=0,u=l.search(/\S\s*$/)+1,u&&(f=b(h,"font-size"),d=b(h,"line-height"),p=[b(h,"font-style"),b(h,"font-variant"),b(h,"font-weight"),f,b(h,"font-family")].join(" "),f=e(f),d=e(d),0!==f)))){for(m=b(h,"color"),g=t.ownerDocument.createRange(),v=b(h,"text-align"),y="justify"==v,C=b(h,"white-space"),ct.msie&&(T=h.textOverflow,"ellipsis"==T&&(k=t.style.textOverflow,t.style.textOverflow="clip")),E=t.getBoundingClientRect().width/f*5,0===E&&(E=500);!o(););ct.msie&&"ellipsis"==T&&(t.style.textOverflow=k)}}function tt(t,n,i){var r,o,s,a,h,l;for("auto"!=i?(r=pt._stackingContext.group,i=e(i)):(r=n,i=0),o=r.children,s=0;o.length>s&&!(null!=o[s]._dom_zIndex&&o[s]._dom_zIndex>i);++s);return a=new at.Group,r.insertAt(a,s),a._dom_zIndex=i,r!==n&&pt._clipbox&&(h=pt._matrix.invert(),l=pt._clipbox.transformCopy(h),z(a,at.Path.fromRect(l))),a}function et(t,n){var i,r,o,s,a,u,f,d=w(t),p=b(d,"counter-reset");p&&c(ot(p,/^\s+/),l,0),i=b(d,"counter-increment"),i&&c(ot(i,/^\s+/),h,1),/^(style|script|link|meta|iframe|svg|col|colgroup)$/i.test(t.tagName)||null!=pt._clipbox&&(r=e(b(d,"opacity")),o=b(d,"visibility"),s=b(d,"display"),0!==r&&"hidden"!=o&&"none"!=s&&(a=N(d),f=b(d,"z-index"),(a||1>r)&&"auto"==f&&(f=0),u=tt(t,n,f),1>r&&u.opacity(r*u.opacity()),m(t,d,u),a?k(t,function(){var e,n,i,r;C(t.style,"transform","none","important"),C(t.style,"transition","none","important"),"static"==b(d,"position")&&C(t.style,"position","relative","important"),e=t.getBoundingClientRect(),n=e.left+a.origin[0],i=e.top+a.origin[1],r=[1,0,0,1,-n,-i],r=nt(r,a.matrix),r=nt(r,[1,0,0,1,n,i]),r=R(u,r),pt._matrix=pt._matrix.multiplyCopy(r),$(t,u)}):$(t,u),g()))}function nt(t,e){var n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],h=e[0],l=e[1],c=e[2],u=e[3],f=e[4],d=e[5];return[n*h+i*c,n*l+i*u,r*h+o*c,r*l+o*u,s*h+a*c+f,s*l+a*u+d]}var it,rt,ot,st,at=kendo.drawing,ht=kendo.geometry,lt=Array.prototype.slice,ct=kendo.support.browser,ut=kendo.util.arabicToRoman,ft="KENDO-PSEUDO-ELEMENT",dt={},pt={};pt._root=pt,it=at.Text.extend({nodeType:"Text",init:function(t,e,n){at.Text.fn.init.call(this,t,e.getOrigin(),n),this._pdfRect=e},rect:function(){return this._pdfRect},rawBBox:function(){return this._pdfRect}}),at.drawDOM=i,i.getFontFaces=r,rt=function(){function t(t){function p(){var e=a.exec(t);e&&(t=t.substr(e[1].length))}function m(e){p();var n=e.exec(t);return n?(t=t.substr(n[1].length),n[1]):void 0}function g(){var e,r,o=kendo.parseColor(t,!0);return o?(t=t.substr(o.match[0].length),o=o.toRGB(),(e=m(i))||(r=m(n)),{color:o,length:e,percent:r}):void 0}function v(e){var i,o,a,u,f,d,p=[],v=!1;if(m(h)){for(i=m(s),i?(i=O(i),m(c)):(o=m(r),"to"==o?o=m(r):o&&/^-/.test(e)&&(v=!0),a=m(r),m(c)),/-moz-/.test(e)&&null==i&&null==o&&(u=m(n),f=m(n),v=!0,"0%"==u?o="left":"100%"==u&&(o="right"),"0%"==f?a="top":"100%"==f&&(a="bottom"),m(c));t&&!m(l)&&(d=g());)p.push(d),m(c);return{type:"linear",angle:i,to:o&&a?o+" "+a:o?o:a?a:null,stops:p,reverse:v}}}function x(){if(m(h)){var t=m(f);return t=t.replace(/^['"]+|["']+$/g,""),m(l),{type:"url",url:t}}}var y,w=t;return o(d,w)?d[w]:((y=m(e))?y=v(y):(y=m(u))&&(y=x()),d[w]=y||{type:"none"})}var e=/^((-webkit-|-moz-|-o-|-ms-)?linear-gradient\s*)\(/,n=/^([-0-9.]+%)/,i=/^([-0-9.]+px)/,r=/^(left|right|top|bottom|to|center)\W/,s=/^([-0-9.]+(deg|grad|rad|turn))/,a=/^(\s+)/,h=/^(\()/,l=/^(\))/,c=/^(,)/,u=/^(url)\(/,f=/^(.*?)\)/,d={},p={};return function(e){return o(p,e)?p[e]:p[e]=ot(e).map(t)}}(),ot=function(){var t={};return function(e,n){function i(t){return f=t.exec(e.substr(l))}function r(t){return t.replace(/^\s+|\s+$/g,"")}var s,a,h,l,c,u,f;if(n||(n=/^\s*,\s*/),s=e+n,o(t,s))return t[s];for(a=[],h=0,l=0,c=0,u=!1;e.length>l;)!u&&i(/^[\(\[\{]/)?(c++,l++):!u&&i(/^[\)\]\}]/)?(c--,l++):!u&&i(/^[\"\']/)?(u=f[0],l++):"'"==u&&i(/^\\\'/)?l+=2:'"'==u&&i(/^\\\"/)?l+=2:"'"==u&&i(/^\'/)?(u=!1,l++):'"'==u&&i(/^\"/)?(u=!1,l++):i(n)?(!u&&!c&&l>h&&(a.push(r(e.substring(h,l))),h=l+f[0].length),l+=f[0].length):l++;return l>h&&a.push(r(e.substring(h,l))),t[s]=a}}(),st=function(){var t={};return function(e){var n,i=t[e];return i||((n=/url\((['"]?)([^'")]*?)\1\)\s+format\((['"]?)truetype\3\)/.exec(e))?i=t[e]=n[2]:(n=/url\((['"]?)([^'")]*?\.ttf)\1\)/.exec(e))&&(i=t[e]=n[2])),i}}()}(window.kendo.jQuery,parseFloat,Math)},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("drawing/animation.min",["drawing/geometry.min","drawing/core.min"],t)}(function(){!function(t){var e=t.noop,n=window.kendo,i=n.Class,r=n.util,o=n.animationFrame,s=n.deepExtend,a=i.extend({init:function(t,e){var n=this;n.options=s({},n.options,e),n.element=t},options:{duration:500,easing:"swing"},setup:e,step:e,play:function(){var e=this,n=e.options,i=t.easing[n.easing],s=n.duration,a=n.delay||0,h=r.now()+a,l=h+s;0===s?(e.step(1),e.abort()):setTimeout(function(){var t=function(){var n,a,c,u;e._stopped||(n=r.now(),a=r.limitValue(n-h,0,s),c=a/s,u=i(c,a,0,1,s),e.step(u),l>n?o(t):e.abort())};t()},a)},abort:function(){this._stopped=!0},destroy:function(){this.abort()}}),h=function(){this._items=[]};h.prototype={register:function(t,e){this._items.push({name:t,type:e})},create:function(t,e){var n,i,r,o=this._items;if(e&&e.type)for(i=e.type.toLowerCase(),r=0;o.length>r;r++)if(o[r].name.toLowerCase()===i){n=o[r];break}return n?new n.type(t,e):void 0}},h.current=new h,a.create=function(t,e,n){return h.current.create(t,e,n)},s(n.drawing,{Animation:a,AnimationFactory:h})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("kendo.drawing.min",["kendo.color.min","util/main.min","util/text-metrics.min","util/base64.min","mixins/observers.min","drawing/geometry.min","drawing/core.min","drawing/mixins.min","drawing/shapes.min","drawing/parser.min","drawing/svg.min","drawing/canvas.min","drawing/vml.min","drawing/html.min","drawing/animation.min"],t)}(function(){},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()});;!function(t,define){define("util/main.min",["kendo.core.min"],t)}(function(){return function(){function t(t){return typeof t!==G}function e(t,e){var r=n(e);return O.round(t*r)/r}function n(t){return t?O.pow(10,t):1}function r(t,e,n){return O.max(O.min(t,n),e)}function i(t){return t*N}function o(t){return t/N}function a(t){return"number"==typeof t&&!isNaN(t)}function s(e,n){return t(e)?e:n}function h(t){return t*t}function u(t){var e,n=[];for(e in t)n.push(e+t[e]);return n.sort().join("")}function c(t){var e,n=2166136261;for(e=0;t.length>e;++e)n+=(n<<1)+(n<<4)+(n<<7)+(n<<8)+(n<<24),n^=t.charCodeAt(e);return n>>>0}function f(t){return c(u(t))}function d(t){var e,n=t.length,r=E,i=P;for(e=0;n>e;e++)i=O.max(i,t[e]),r=O.min(r,t[e]);return{min:r,max:i}}function l(t){return d(t).min}function p(t){return d(t).max}function g(t){return S(t).min}function m(t){return S(t).max}function S(t){var e,n,r,i=E,o=P;for(e=0,n=t.length;n>e;e++)r=t[e],null!==r&&isFinite(r)&&(i=O.min(i,r),o=O.max(o,r));return{min:i===E?void 0:i,max:o===P?void 0:o}}function w(t){return t?t[t.length-1]:void 0}function y(t,e){return t.push.apply(t,e),t}function v(t){return I.template(t,{useWithBlock:!1,paramName:"d"})}function x(e,n){return t(n)&&null!==n?" "+e+"='"+n+"' ":""}function _(t){var e,n="";for(e=0;t.length>e;e++)n+=x(t[e][0],t[e][1]);return n}function b(e){var n,r,i="";for(n=0;e.length>n;n++)r=e[n][1],t(r)&&(i+=e[n][0]+":"+r+";");return""!==i?i:void 0}function C(t){return"string"!=typeof t&&(t+="px"),t}function T(t){var e,n,r=[];if(t)for(e=I.toHyphens(t).split("-"),n=0;e.length>n;n++)r.push("k-pos-"+e[n]);return r.join(" ")}function D(e){return""===e||null===e||"none"===e||"transparent"===e||!t(e)}function k(t){for(var e={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},n=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],r="";t>0;)n[0]>t?n.shift():(r+=e[n[0]],t-=n[0]);return r}function F(t){var e,n,r,i,o;for(t=t.toLowerCase(),e={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},n=0,r=0,i=0;t.length>i;++i){if(o=e[t.charAt(i)],!o)return null;n+=o,o>r&&(n-=2*r),r=o}return n}function A(t){var e=Object.create(null);return function(){var n,r="";for(n=arguments.length;--n>=0;)r+=":"+arguments[n];return r in e?e[r]:t.apply(this,arguments)}}function L(t){for(var e,n,r=[],i=0,o=t.length;o>i;)e=t.charCodeAt(i++),e>=55296&&56319>=e&&o>i?(n=t.charCodeAt(i++),56320==(64512&n)?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--)):r.push(e);return r}function M(t){return t.map(function(t){var e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e+=String.fromCharCode(t)}).join("")}var O=Math,I=window.kendo,R=I.deepExtend,N=O.PI/180,E=Number.MAX_VALUE,P=-Number.MAX_VALUE,G="undefined",B=Date.now;B||(B=function(){return(new Date).getTime()}),R(I,{util:{MAX_NUM:E,MIN_NUM:P,append:y,arrayLimits:d,arrayMin:l,arrayMax:p,defined:t,deg:o,hashKey:c,hashObject:f,isNumber:a,isTransparent:D,last:w,limitValue:r,now:B,objectKey:u,round:e,rad:i,renderAttr:x,renderAllAttr:_,renderPos:T,renderSize:C,renderStyle:b,renderTemplate:v,sparseArrayLimits:S,sparseArrayMin:g,sparseArrayMax:m,sqr:h,valueOrDefault:s,romanToArabic:F,arabicToRoman:k,memoize:A,ucs2encode:M,ucs2decode:L}}),I.drawing.util=I.util,I.dataviz.util=I.util}(),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("pdf/core.min",["kendo.core.min","util/main.min"],t)}(function(){!function(t,e,n){"use strict";function r(){function t(){var e,i,o;for(e=0;e<arguments.length;++e){if(i=arguments[e],i===n)throw Error("Cannot output undefined to PDF");if(i instanceof x)i.beforeRender(t),i.render(t);else if(z(i))g(i,t);else if(p(i))m(i,t);else if("number"==typeof i){if(isNaN(i))throw Error("Cannot output NaN to PDF");o=i.toFixed(7),o.indexOf(".")>=0&&(o=o.replace(/\.?0+$/,"")),"-0"==o&&(o="0"),r.writeString(o)}else/string|boolean/.test(typeof i)?r.writeString(i+""):"function"==typeof i.get?r.write(i.get()):"object"==typeof i&&(i?t(new W(i)):r.writeString("null"))}}var e=0,r=I();return t.writeData=function(t){r.write(t)},t.withIndent=function(n){++e,n(t),--e},t.indent=function(){t(rt,f("",2*e,"  ")),t.apply(null,arguments)},t.offset=function(){return r.offset()},t.toString=function(){throw Error("FIX CALLER")},t.get=function(){return r.get()},t.stream=function(){return r},t}function i(t,e){var n=t.beforeRender,r=t.render;t.beforeRender=function(){},t.render=function(t){t(e," 0 R")},t.renderFull=function(i){t._offset=i.offset(),i(e," 0 obj "),n.call(t,i),r.call(t,i),i(" endobj")}}function o(t){var e,n,r;if("function"!=typeof t&&(e=t,t=function(t,n){return t in e?e[t]:n}),n=t("paperSize",at.a4),!n)return{};if("string"==typeof n&&(n=at[n.toLowerCase()],null==n))throw Error("Unknown paper size");return n[0]=v(n[0]),n[1]=v(n[1]),t("landscape",!1)&&(n=[Math.max(n[0],n[1]),Math.min(n[0],n[1])]),r=t("margin"),r&&("string"==typeof r||"number"==typeof r?(r=v(r,0),r={left:r,top:r,right:r,bottom:r}):r={left:v(r.left,0),top:v(r.top,0),right:v(r.right,0),bottom:v(r.bottom,0)},t("addMargin")&&(n[0]+=r.left+r.right,n[1]+=r.top+r.bottom)),{paperSize:n,margin:r}}function a(t){function e(e,n){return t&&null!=t[e]?t[e]:n}var n,a,s=this,h=r(),u=0,c=[];s.getOption=e,s.attach=function(t){return c.indexOf(t)<0&&(i(t,++u),c.push(t)),t},s.pages=[],s.FONTS={},s.IMAGES={},s.GRAD_COL_FUNCTIONS={},s.GRAD_OPC_FUNCTIONS={},s.GRAD_COL={},s.GRAD_OPC={},n=s.attach(new Z),a=s.attach(new V),n.setPages(a),s.addPage=function(t){var e,n,i,h=o(function(e,n){return t&&null!=t[e]?t[e]:n}),u=h.paperSize,c=h.margin,f=u[0],d=u[1];return c&&(f-=c.left+c.right,d-=c.top+c.bottom),e=new K(r(),null,!0),n={Contents:s.attach(e),Parent:a,MediaBox:[0,0,u[0],u[1]]},i=new J(s,n),i._content=e,a.addPage(s.attach(i)),i.transform(1,0,0,-1,0,u[1]),c&&(i.translate(c.left,c.top),i.rect(0,0,f,d),i.clip()),s.pages.push(i),i},s.render=function(){var t,r;for(h("%PDF-1.4",rt,"%ÂÁÚÏÎ",rt,rt),t=0;c.length>t;++t)c[t].renderFull(h),h(rt,rt);for(r=h.offset(),h("xref",rt,0," ",c.length+1,rt),h("0000000000 65535 f ",rt),t=0;c.length>t;++t)h(d(c[t]._offset,10)," 00000 n ",rt);return h(rt),h("trailer",rt),h(new W({Size:c.length+1,Root:n,Info:new W({Producer:new j(e("producer","Kendo UI PDF Generator v."+et.version)),Title:new j(e("title","")),Author:new j(e("author","")),Subject:new j(e("subject","")),Keywords:new j(e("keywords","")),Creator:new j(e("creator","Kendo UI PDF Generator v."+et.version)),CreationDate:e("date",new Date)})}),rt,rt),h("startxref",rt,r,rt),h("%%EOF",rt),h.stream().offset(0)}}function s(e,n){function r(){t.console&&(t.console.error?t.console.error("Cannot load URL: %s",e):t.console.log("Cannot load URL: %s",e)),n(null)}var i=new XMLHttpRequest;i.open("GET",e,!0),nt&&(i.responseType="arraybuffer"),i.onload=function(){200==i.status||304==i.status?n(nt?new Uint8Array(i.response):new VBArray(i.responseBody).toArray()):r()},i.onerror=r,i.send(null)}function h(t,e){var n=st[t];n?e(n):s(t,function(n){if(null==n)throw Error("Cannot load font from "+t);var r=new et.pdf.TTFFont(n);st[t]=r,e(r)})}function u(t,e){function r(t){u.src=t,u.complete&&!et.support.browser.msie?o():(u.onload=o,u.onerror=i)}function i(){e(ht[t]="TAINTED")}function o(){var r,o,h,c,f,d,l,p,g,m,S,w;if(s&&/^image\/jpe?g$/i.test(s.type))return r=new FileReader,r.onload=function(){u=new C(u.width,u.height,I(new Uint8Array(this.result))),URL.revokeObjectURL(a),e(ht[t]=u)},r.readAsArrayBuffer(s),n;o=document.createElement("canvas"),o.width=u.width,o.height=u.height,h=o.getContext("2d"),h.drawImage(u,0,0);try{c=h.getImageData(0,0,u.width,u.height)}catch(y){return i()}finally{a&&URL.revokeObjectURL(a)}for(f=!1,d=I(),l=I(),p=c.data,g=0;p.length>g;)d.writeByte(p[g++]),d.writeByte(p[g++]),d.writeByte(p[g++]),m=p[g++],255>m&&(f=!0),l.writeByte(m);f?u=new T(u.width,u.height,d,l):(S=o.toDataURL("image/jpeg"),S=S.substr(S.indexOf(";base64,")+8),w=I(),w.writeBase64(S),w.offset(0),u=new C(u.width,u.height,w)),e(ht[t]=u)}var a,s,h,u=ht[t];u?e(u):(u=new Image,/^data:/i.test(t)||(u.crossOrigin="Anonymous"),nt&&!/^data:/i.test(t)?(h=new XMLHttpRequest,h.onload=function(){s=h.response,a=URL.createObjectURL(s),r(a)},h.onerror=i,h.open("GET",t,!0),h.responseType="blob",h.send()):r(t))}function c(t){return function(e,n){var r=e.length,i=r;if(0===r)return n();for(;i-- >0;)t(e[i],function(){0===--r&&n()})}}function f(t,e,n){for(;e>t.length;)t=n+t;return t}function d(t,e){return f(t+"",e,"0")}function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function p(t){return t instanceof Date}function g(t,e){e("["),t.length>0&&e.withIndent(function(){for(var n=0;t.length>n;++n)n>0&&n%8===0?e.indent(t[n]):e(" ",t[n])}),e(" ]")}function m(t,e){e("(D:",d(t.getUTCFullYear(),4),d(t.getUTCMonth()+1,2),d(t.getUTCDate(),2),d(t.getUTCHours(),2),d(t.getUTCMinutes(),2),d(t.getUTCSeconds(),2),"Z)")}function S(t){return t*(72/25.4)}function w(t){return S(10*t)}function y(t){return 72*t}function v(t,n){var r,i;if("number"==typeof t)return t;if("string"==typeof t&&(r=/^\s*([0-9.]+)\s*(mm|cm|in|pt)\s*$/.exec(t),r&&(i=e(r[1]),!isNaN(i))))return"pt"==r[2]?i:{mm:S,cm:w,"in":y}[r[2]](i);if(null!=n)return n;throw Error("Can't parse unit: "+t)}function x(){}function _(t,e,n){n||(n=x),t.prototype=new n;for(var r in e)l(e,r)&&(t.prototype[r]=e[r]);return t}function b(t){return l(X,t)?X[t]:X[t]=new H(t)}function C(t,e,n){this.asStream=function(){var r=new K(n,{Type:b("XObject"),Subtype:b("Image"),Width:t,Height:e,BitsPerComponent:8,ColorSpace:b("DeviceRGB"),Filter:b("DCTDecode")});return r._resourceName=b("I"+ ++it),r}}function T(t,e,n,r){this.asStream=function(i){var o=new K(r,{Type:b("XObject"),Subtype:b("Image"),Width:t,Height:e,BitsPerComponent:8,ColorSpace:b("DeviceGray")},!0),a=new K(n,{Type:b("XObject"),Subtype:b("Image"),Width:t,Height:e,BitsPerComponent:8,ColorSpace:b("DeviceRGB"),SMask:i.attach(o)},!0);return a._resourceName=b("I"+ ++it),a}}function D(t){return t.map(function(t){return z(t)?D(t):"number"==typeof t?(Math.round(1e3*t)/1e3).toFixed(3):t}).join(" ")}function k(t,e,n,r,i,o,a){var s=D([e,n,r,i,o,a]),h=t.GRAD_COL_FUNCTIONS[s];return h||(h=t.GRAD_COL_FUNCTIONS[s]=t.attach(new W({FunctionType:2,Domain:[0,1],Range:[0,1,0,1,0,1],N:1,C0:[e,n,r],C1:[i,o,a]}))),h}function F(t,e,n){var r=D([e,n]),i=t.GRAD_OPC_FUNCTIONS[r];return i||(i=t.GRAD_OPC_FUNCTIONS[r]=t.attach(new W({FunctionType:2,Domain:[0,1],Range:[0,1],N:1,C0:[e],C1:[n]}))),i}function A(t,e){function n(t){return 1==t.length?t[0]:{FunctionType:3,Functions:t,Domain:[0,1],Bounds:f,Encode:d}}var r,i,o,a,s,h=!1,u=[],c=[],f=[],d=[];for(r=1;e.length>r;++r)i=e[r-1],o=e[r],a=i.color,s=o.color,c.push(k(t,a.r,a.g,a.b,s.r,s.g,s.b)),(1>a.a||1>s.a)&&(h=!0),f.push(o.offset),d.push(0,1);if(h)for(r=1;e.length>r;++r)i=e[r-1],o=e[r],a=i.color,s=o.color,u.push(F(t,a.a,s.a));return f.pop(),{hasAlpha:h,colors:n(c),opacities:h?n(u):null}}function L(t,e,n,r,i,o){var a,s,h;return o||(h=[e].concat(r),n.forEach(function(t){h.push(t.offset,t.color.r,t.color.g,t.color.b)}),s=D(h),a=t.GRAD_COL[s]),a||(a=new W({Type:b("Shading"),ShadingType:e?3:2,ColorSpace:b("DeviceRGB"),Coords:r,Domain:[0,1],Function:i,Extend:[!0,!0]}),t.attach(a),a._resourceName="S"+ ++it,s&&(t.GRAD_COL[s]=a)),a}function M(t,e,n,r,i,o){var a,s,h;return o||(h=[e].concat(r),n.forEach(function(t){h.push(t.offset,t.color.a)}),s=D(h),a=t.GRAD_OPC[s]),a||(a=new W({Type:b("ExtGState"),AIS:!1,CA:1,ca:1,SMask:{Type:b("Mask"),S:b("Luminosity"),G:t.attach(new K("/a0 gs /s0 sh",{Type:b("XObject"),Subtype:b("Form"),FormType:1,BBox:o?[o.left,o.top+o.height,o.left+o.width,o.top]:[0,1,1,0],Group:{Type:b("Group"),S:b("Transparency"),CS:b("DeviceGray"),I:!0},Resources:{ExtGState:{a0:{CA:1,ca:1}},Shading:{s0:{ColorSpace:b("DeviceGray"),Coords:r,Domain:[0,1],ShadingType:e?3:2,Function:i,Extend:[!0,!0]}}}}))}}),t.attach(a),a._resourceName="O"+ ++it,s&&(t.GRAD_OPC[s]=a)),a}function O(t,e,n){var r="radial"==e.type,i=A(t,e.stops),o=r?[e.start.x,e.start.y,e.start.r,e.end.x,e.end.y,e.end.r]:[e.start.x,e.start.y,e.end.x,e.end.y],a=L(t,r,e.stops,o,i.colors,e.userSpace&&n),s=i.hasAlpha?M(t,r,e.stops,o,i.opacities,e.userSpace&&n):null;return{hasAlpha:i.hasAlpha,shading:a,opacity:s}}function I(e){function n(){return D>=k}function r(){return k>D?e[D++]:0}function i(t){x(D),e[D++]=255&t,D>k&&(k=D)}function o(){return r()<<8|r()}function a(t){i(t>>8),i(t)}function s(){var t=o();return t>=32768?t-65536:t}function h(t){a(0>t?t+65536:t)}function u(){return 65536*o()+o()}function c(t){a(t>>>16&65535),a(65535&t)}function f(){var t=u();return t>=2147483648?t-4294967296:t}function d(t){c(0>t?t+4294967296:t)}function l(){return u()/65536}function p(t){c(Math.round(65536*t))}function g(){return f()/65536}function m(t){d(Math.round(65536*t))}function S(t){return v(t,r)}function w(t){return String.fromCharCode.apply(String,S(t))}function y(t){for(var e=0;t.length>e;++e)i(t.charCodeAt(e))}function v(t,e){for(var n=Array(t),r=0;t>r;++r)n[r]=e();return n}var x,_,b,C,T,D=0,k=0;return null==e?e=nt?new Uint8Array(256):[]:k=e.length,x=nt?function(t){if(t>=e.length){var n=new Uint8Array(Math.max(t+256,2*e.length));n.set(e,0),e=n}}:function(){},_=nt?function(){return new Uint8Array(e.buffer,0,k)}:function(){return e},b=nt?function(t){if("string"==typeof t)return y(t);var n=t.length;x(D+n),e.set(t,D),D+=n,D>k&&(k=D)}:function(t){if("string"==typeof t)return y(t);for(var e=0;t.length>e;++e)i(t[e])},C=nt?function(t,n){if(e.buffer.slice)return new Uint8Array(e.buffer.slice(t,t+n));var r=new Uint8Array(n);return r.set(new Uint8Array(e.buffer,t,n)),r}:function(t,n){return e.slice(t,t+n)},T={eof:n,readByte:r,writeByte:i,readShort:o,writeShort:a,readLong:u,writeLong:c,readFixed:l,writeFixed:p,readShort_:s,writeShort_:h,readLong_:f,writeLong_:d,readFixed_:g,writeFixed_:m,read:S,write:b,readString:w,writeString:y,times:v,get:_,slice:C,offset:function(t){return null!=t?(D=t,T):D},skip:function(t){D+=t},toString:function(){throw Error("FIX CALLER.  BinaryStream is no longer convertible to string!")},length:function(){return k},saveExcursion:function(t){var e=D;try{return t()}finally{D=e}},writeBase64:function(e){t.atob?y(t.atob(e)):b(ot.decode(e))},base64:function(){return ot.encode(_())}}}function R(t){return t.replace(/^\s*(['"])(.*)\1\s*$/,"$2")}function N(t){var e,n=/^\s*((normal|italic)\s+)?((normal|small-caps)\s+)?((normal|bold|\d+)\s+)?(([0-9.]+)(px|pt))(\/(([0-9.]+)(px|pt)|normal))?\s+(.*?)\s*$/i,r=n.exec(t);return r?(e=r[8]?parseInt(r[8],10):12,{italic:r[2]&&"italic"==r[2].toLowerCase(),variant:r[4],bold:r[6]&&/bold|700/i.test(r[6]),fontSize:e,lineHeight:r[12]?"normal"==r[12]?e:parseInt(r[12],10):null,fontFamily:r[14].split(/\s*,\s*/g).map(R)}):{fontSize:12,fontFamily:"sans-serif"}}function E(t){function e(e){return t.bold&&(e+="|bold"),t.italic&&(e+="|italic"),e.toLowerCase()}var n,r,i,o=t.fontFamily;if(o instanceof Array)for(i=0;o.length>i&&(n=e(o[i]),!(r=tt[n]));++i);else r=tt[o.toLowerCase()];for(;"function"==typeof r;)r=r();return r||(r="Times-Roman"),r}function P(t,e){t=t.toLowerCase(),tt[t]=function(){return tt[e]},tt[t+"|bold"]=function(){return tt[e+"|bold"]},tt[t+"|italic"]=function(){return tt[e+"|italic"]},tt[t+"|bold|italic"]=function(){return tt[e+"|bold|italic"]}}function G(t,e){if(1==arguments.length)for(var n in t)l(t,n)&&G(n,t[n]);else switch(t=t.toLowerCase(),tt[t]=e,t){case"dejavu sans":tt["sans-serif"]=e;break;case"dejavu sans|bold":tt["sans-serif|bold"]=e;break;case"dejavu sans|italic":tt["sans-serif|italic"]=e;break;case"dejavu sans|bold|italic":tt["sans-serif|bold|italic"]=e;break;case"dejavu serif":tt.serif=e;break;case"dejavu serif|bold":tt["serif|bold"]=e;break;case"dejavu serif|italic":tt["serif|italic"]=e;break;case"dejavu serif|bold|italic":tt["serif|bold|italic"]=e;break;case"dejavu mono":tt.monospace=e;break;case"dejavu mono|bold":tt["monospace|bold"]=e;break;case"dejavu mono|italic":tt["monospace|italic"]=e;break;case"dejavu mono|bold|italic":tt["monospace|bold|italic"]=e}}function B(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],h=e[0],u=e[1],c=e[2],f=e[3],d=e[4],l=e[5];return[n*h+r*c,n*u+r*f,i*h+o*c,i*u+o*f,a*h+s*c+d,a*u+s*f+l]}function U(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]}var z,j,q,H,X,W,K,Z,V,Y,$,Q,J,tt,et=t.kendo,nt=!!t.Uint8Array,rt="\n",it=0,ot=function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{decode:function(e){for(var n,r,i,o,a,s,h,u=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),c=0,f=u.length,d=[];f>c;)n=t.indexOf(u.charAt(c++)),r=t.indexOf(u.charAt(c++)),i=t.indexOf(u.charAt(c++)),o=t.indexOf(u.charAt(c++)),a=n<<2|r>>>4,s=(15&r)<<4|i>>>2,h=(3&i)<<6|o,d.push(a),64!=i&&d.push(s),64!=o&&d.push(h);return d},encode:function(e){for(var n,r,i,o,a,s,h,u=0,c=e.length,f="";c>u;)n=e[u++],r=e[u++],i=e[u++],o=n>>>2,a=(3&n)<<4|r>>>4,s=(15&r)<<2|i>>>6,h=63&i,u-c==2?s=h=64:u-c==1&&(h=64),f+=t.charAt(o)+t.charAt(a)+t.charAt(s)+t.charAt(h);return f}}}(),at={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],executive:[521.86,756],folio:[612,936],legal:[612,1008],letter:[612,792],tabloid:[792,1224]},st={"Times-Roman":!0,"Times-Bold":!0,"Times-Italic":!0,"Times-BoldItalic":!0,Helvetica:!0,"Helvetica-Bold":!0,"Helvetica-Oblique":!0,"Helvetica-BoldOblique":!0,Courier:!0,"Courier-Bold":!0,"Courier-Oblique":!0,"Courier-BoldOblique":!0,Symbol:!0,ZapfDingbats:!0},ht={},ut=c(h),ct=c(u);a.prototype={loadFonts:ut,loadImages:ct,getFont:function(t){var e=this.FONTS[t];if(!e){if(e=st[t],!e)throw Error("Font "+t+" has not been loaded");e=this.attach(e===!0?new Y(t):new $(this,e)),this.FONTS[t]=e}return e},getImage:function(t){var e=this.IMAGES[t];if(!e){if(e=ht[t],!e)throw Error("Image "+t+" has not been loaded");if("TAINTED"===e)return null;e=this.IMAGES[t]=this.attach(e.asStream(this))}return e},getOpacityGS:function(t,n){var r,i,o,a=e(t).toFixed(3);return t=e(a),a+=n?"S":"F",r=this._opacityGSCache||(this._opacityGSCache={}),i=r[a],i||(o={Type:b("ExtGState")},n?o.CA=t:o.ca=t,i=this.attach(new W(o)),i._resourceName=b("GS"+ ++it),r[a]=i),i},dict:function(t){return new W(t)},name:function(t){return b(t)},stream:function(t,e){return new K(e,t)}},z=Array.isArray||function(t){return t instanceof Array},x.prototype.beforeRender=function(){},j=_(function(t){this.value=t},{render:function(t){var e,n="",r=this.escape();for(e=0;r.length>e;++e)n+=String.fromCharCode(255&r.charCodeAt(e));t("(",n,")")},escape:function(){return this.value.replace(/([\(\)\\])/g,"\\$1")},toString:function(){return this.value}}),q=_(function(t){this.value=t},{render:function(t){t("<");for(var e=0;this.value.length>e;++e)t(d(this.value.charCodeAt(e).toString(16),4));t(">")}},j),H=_(function(t){this.name=t},{render:function(t){t("/"+this.escape())},escape:function(){return this.name.replace(/[^\x21-\x7E]/g,function(t){return"#"+d(t.charCodeAt(0).toString(16),2)})},toString:function(){return this.name}}),X={},H.get=b,W=_(function(t){this.props=t},{render:function(t){var e=this.props,n=!0;t("<<"),t.withIndent(function(){for(var r in e)l(e,r)&&!/^_/.test(r)&&(n=!1,t.indent(b(r)," ",e[r]))}),n||t.indent(),t(">>")}}),K=_(function(t,e,n){if("string"==typeof t){var r=I();r.write(t),t=r}this.data=t,this.props=e||{},this.compress=n},{render:function(e){var n=this.data.get(),r=this.props;this.compress&&t.pako&&"function"==typeof t.pako.deflate&&(r.Filter?r.Filter instanceof Array||(r.Filter=[r.Filter]):r.Filter=[],r.Filter.unshift(b("FlateDecode")),n=t.pako.deflate(n)),r.Length=n.length,e(new W(r)," stream",rt),e.writeData(n),e(rt,"endstream")}}),Z=_(function(t){t=this.props=t||{},t.Type=b("Catalog")},{setPages:function(t){this.props.Pages=t}},W),V=_(function(){this.props={Type:b("Pages"),Kids:[],Count:0}},{addPage:function(t){this.props.Kids.push(t),this.props.Count++}},W),Y=_(function(t){this.props={Type:b("Font"),Subtype:b("Type1"),BaseFont:b(t)},this._resourceName=b("F"+ ++it)},{encodeText:function(t){return new j(t+"")}},W),$=_(function(t,e,n){var r,i;n=this.props=n||{},n.Type=b("Font"),n.Subtype=b("Type0"),n.Encoding=b("Identity-H"),this._pdf=t,this._font=e,this._sub=e.makeSubset(),this._resourceName=b("F"+ ++it),r=e.head,this.name=e.psName,i=this.scale=e.scale,this.bbox=[r.xMin*i,r.yMin*i,r.xMax*i,r.yMax*i],this.italicAngle=e.post.italicAngle,this.ascent=e.ascent*i,this.descent=e.descent*i,this.lineGap=e.lineGap*i,this.capHeight=e.os2.capHeight||this.ascent,this.xHeight=e.os2.xHeight||0,this.stemV=0,this.familyClass=(e.os2.familyClass||0)>>8,this.isSerif=this.familyClass>=1&&7>=this.familyClass,this.isScript=10==this.familyClass,this.flags=(e.post.isFixedPitch?1:0)|(this.isSerif?2:0)|(this.isScript?8:0)|(0!==this.italicAngle?64:0)|32},{encodeText:function(t){return new q(this._sub.encodeText(t+""))},getTextWidth:function(t,e){var n,r,i=0,o=this._font.cmap.codeMap;for(n=0;e.length>n;++n)r=o[e.charCodeAt(n)],i+=this._font.widthOfGlyph(r||0);return i*t/1e3},beforeRender:function(){var t,e,n,i,o=this,a=o._sub,s=a.render(),h=new K(I(s),{Length1:s.length},!0),u=o._pdf.attach(new W({Type:b("FontDescriptor"),FontName:b(o._sub.psName),FontBBox:o.bbox,Flags:o.flags,StemV:o.stemV,ItalicAngle:o.italicAngle,Ascent:o.ascent,Descent:o.descent,CapHeight:o.capHeight,XHeight:o.xHeight,FontFile2:o._pdf.attach(h)})),c=a.ncid2ogid,f=a.firstChar,d=a.lastChar,l=[];!function p(t,e){if(d>=t){var n=c[t];null==n?p(t+1):(e||l.push(t,e=[]),e.push(o._font.widthOfGlyph(n)),p(t+1,e))}}(f),t=new W({Type:b("Font"),Subtype:b("CIDFontType2"),BaseFont:b(o._sub.psName),CIDSystemInfo:new W({Registry:new j("Adobe"),Ordering:new j("Identity"),Supplement:0}),FontDescriptor:u,FirstChar:f,LastChar:d,DW:Math.round(o._font.widthOfGlyph(0)),W:l,CIDToGIDMap:o._pdf.attach(o._makeCidToGidMap())}),e=o.props,e.BaseFont=b(o._sub.psName),e.DescendantFonts=[o._pdf.attach(t)],n=new Q(f,d,a.subset),i=new K(r(),null,!0),i.data(n),e.ToUnicode=o._pdf.attach(i)},_makeCidToGidMap:function(){return new K(I(this._sub.cidToGidMap()),null,!0)}},W),Q=_(function(t,e,n){this.firstChar=t,this.lastChar=e,this.map=n},{render:function(t){t.indent("/CIDInit /ProcSet findresource begin"),t.indent("12 dict begin"),t.indent("begincmap"),t.indent("/CIDSystemInfo <<"),t.indent("  /Registry (Adobe)"),t.indent("  /Ordering (UCS)"),t.indent("  /Supplement 0"),t.indent(">> def"),t.indent("/CMapName /Adobe-Identity-UCS def"),t.indent("/CMapType 2 def"),t.indent("1 begincodespacerange"),t.indent("  <0000><ffff>"),t.indent("endcodespacerange");var e=this;t.indent(e.lastChar-e.firstChar+1," beginbfchar"),t.withIndent(function(){var n,r,i,o;for(n=e.firstChar;e.lastChar>=n;++n){for(r=e.map[n],i=et.util.ucs2encode([r]),t.indent("<",d(n.toString(16),4),">","<"),o=0;i.length>o;++o)t(d(i.charCodeAt(o).toString(16),4));t(">")}}),t.indent("endbfchar"),t.indent("endcmap"),t.indent("CMapName currentdict /CMap defineresource pop"),t.indent("end"),t.indent("end")}}),J=_(function(t,e){this._pdf=t,this._rcount=0,this._textMode=!1,this._fontResources={},this._gsResources={},this._xResources={},this._patResources={},this._shResources={},this._opacity=1,this._matrix=[1,0,0,1,0,0],this._annotations=[],this._font=null,this._fontSize=null,this._contextStack=[],e=this.props=e||{},e.Type=b("Page"),e.ProcSet=[b("PDF"),b("Text"),b("ImageB"),b("ImageC"),b("ImageI")],e.Resources=new W({Font:new W(this._fontResources),ExtGState:new W(this._gsResources),XObject:new W(this._xResources),Pattern:new W(this._patResources),Shading:new W(this._shResources)}),e.Annots=this._annotations},{_out:function(){this._content.data.apply(null,arguments)},transform:function(t,e,n,r,i,o){U(arguments)||(this._matrix=B(arguments,this._matrix),this._out(t," ",e," ",n," ",r," ",i," ",o," cm"),this._out(rt))},translate:function(t,e){this.transform(1,0,0,1,t,e)},scale:function(t,e){this.transform(t,0,0,e,0,0)},rotate:function(t){var e=Math.cos(t),n=Math.sin(t);this.transform(e,n,-n,e,0,0)},beginText:function(){this._textMode=!0,this._out("BT",rt)},endText:function(){this._textMode=!1,this._out("ET",rt)},_requireTextMode:function(){if(!this._textMode)throw Error("Text mode required; call page.beginText() first")},_requireFont:function(){if(!this._font)throw Error("No font selected; call page.setFont() first")},setFont:function(t,e){this._requireTextMode(),null==t?t=this._font:t instanceof $||(t=this._pdf.getFont(t)),null==e&&(e=this._fontSize),this._fontResources[t._resourceName]=t,this._font=t,this._fontSize=e,this._out(t._resourceName," ",e," Tf",rt)},setTextLeading:function(t){this._requireTextMode(),this._out(t," TL",rt)},setTextRenderingMode:function(t){this._requireTextMode(),this._out(t," Tr",rt)},showText:function(t,e){var n,r;this._requireFont(),t.length>1&&e&&this._font instanceof $&&(n=this._font.getTextWidth(this._fontSize,t),r=e/n*100,this._out(r," Tz ")),this._out(this._font.encodeText(t)," Tj",rt)},showTextNL:function(t){this._requireFont(),this._out(this._font.encodeText(t)," '",rt)},addLink:function(t,e){var n=this._toPage({x:e.left,y:e.bottom}),r=this._toPage({x:e.right,y:e.top});this._annotations.push(new W({Type:b("Annot"),Subtype:b("Link"),Rect:[n.x,n.y,r.x,r.y],Border:[0,0,0],A:new W({Type:b("Action"),S:b("URI"),URI:new j(t)})}))},setStrokeColor:function(t,e,n){this._out(t," ",e," ",n," RG",rt)},setOpacity:function(t){this.setFillOpacity(t),this.setStrokeOpacity(t),this._opacity*=t},setStrokeOpacity:function(t){if(1>t){var e=this._pdf.getOpacityGS(this._opacity*t,!0);this._gsResources[e._resourceName]=e,this._out(e._resourceName," gs",rt)}},setFillColor:function(t,e,n){this._out(t," ",e," ",n," rg",rt)},setFillOpacity:function(t){if(1>t){var e=this._pdf.getOpacityGS(this._opacity*t,!1);this._gsResources[e._resourceName]=e,this._out(e._resourceName," gs",rt)}},gradient:function(t,e){var n,r,i;this.save(),this.rect(e.left,e.top,e.width,e.height),this.clip(),t.userSpace||this.transform(e.width,0,0,e.height,e.left,e.top),n=O(this._pdf,t,e),r=n.shading._resourceName,this._shResources[r]=n.shading,n.hasAlpha&&(i=n.opacity._resourceName,this._gsResources[i]=n.opacity,this._out("/"+i+" gs ")),this._out("/"+r+" sh",rt),this.restore()},setDashPattern:function(t,e){this._out(t," ",e," d",rt)},setLineWidth:function(t){this._out(t," w",rt)},setLineCap:function(t){this._out(t," J",rt)},setLineJoin:function(t){this._out(t," j",rt)},setMitterLimit:function(t){this._out(t," M",rt)},save:function(){this._contextStack.push(this._context()),this._out("q",rt)},restore:function(){this._out("Q",rt),this._context(this._contextStack.pop())},moveTo:function(t,e){this._out(t," ",e," m",rt)},lineTo:function(t,e){this._out(t," ",e," l",rt)},bezier:function(t,e,n,r,i,o){this._out(t," ",e," ",n," ",r," ",i," ",o," c",rt)},bezier1:function(t,e,n,r){this._out(t," ",e," ",n," ",r," y",rt)},bezier2:function(t,e,n,r){this._out(t," ",e," ",n," ",r," v",rt)},close:function(){this._out("h",rt)},rect:function(t,e,n,r){this._out(t," ",e," ",n," ",r," re",rt)},ellipse:function(t,e,n,r){function i(e){return t+e}function o(t){return e+t}var a=.5522847498307936;this.moveTo(i(0),o(r)),this.bezier(i(n*a),o(r),i(n),o(r*a),i(n),o(0)),this.bezier(i(n),o(-r*a),i(n*a),o(-r),i(0),o(-r)),this.bezier(i(-n*a),o(-r),i(-n),o(-r*a),i(-n),o(0)),this.bezier(i(-n),o(r*a),i(-n*a),o(r),i(0),o(r))},circle:function(t,e,n){this.ellipse(t,e,n,n)},stroke:function(){this._out("S",rt)},nop:function(){this._out("n",rt)},clip:function(){this._out("W n",rt)},clipStroke:function(){this._out("W S",rt)},closeStroke:function(){this._out("s",rt)},fill:function(){this._out("f",rt)},fillStroke:function(){this._out("B",rt)},drawImage:function(t){var e=this._pdf.getImage(t);e&&(this._xResources[e._resourceName]=e,this._out(e._resourceName," Do",rt))},comment:function(t){var e=this;t.split(/\r?\n/g).forEach(function(t){e._out("% ",t,rt)})},_context:function(t){return null==t?{opacity:this._opacity,matrix:this._matrix}:(this._opacity=t.opacity,this._matrix=t.matrix,n)},_toPage:function(t){var e=this._matrix,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5];return{x:n*t.x+i*t.y+a,y:r*t.x+o*t.y+s}}},W),tt={serif:"Times-Roman","serif|bold":"Times-Bold","serif|italic":"Times-Italic","serif|bold|italic":"Times-BoldItalic","sans-serif":"Helvetica","sans-serif|bold":"Helvetica-Bold","sans-serif|italic":"Helvetica-Oblique","sans-serif|bold|italic":"Helvetica-BoldOblique",monospace:"Courier","monospace|bold":"Courier-Bold","monospace|italic":"Courier-Oblique","monospace|bold|italic":"Courier-BoldOblique",zapfdingbats:"ZapfDingbats","zapfdingbats|bold":"ZapfDingbats","zapfdingbats|italic":"ZapfDingbats","zapfdingbats|bold|italic":"ZapfDingbats"},P("Times New Roman","serif"),P("Courier New","monospace"),P("Arial","sans-serif"),P("Helvetica","sans-serif"),P("Verdana","sans-serif"),P("Tahoma","sans-serif"),P("Georgia","sans-serif"),P("Monaco","monospace"),P("Andale Mono","monospace"),et.pdf={Document:a,BinaryStream:I,defineFont:G,parseFontDef:N,getFontURL:E,loadFonts:ut,loadImages:ct,getPaperOptions:o,TEXT_RENDERING_MODE:{fill:0,stroke:1,fillAndStroke:2,invisible:3,fillAndClip:4,strokeAndClip:5,fillStrokeClip:6,clip:7}}}(window,parseFloat)},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("pdf/ttf.min",["pdf/core.min","util/main.min"],t)}(function(){!function(t){"use strict";function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function n(t){return Object.keys(t).sort(function(t,e){return t-e}).map(parseFloat)}function r(t){var e,n,r;for(this.raw=t,this.scalerType=t.readLong(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),e=this.tables={},n=0;this.tableCount>n;++n)r={tag:t.readString(4),checksum:t.readLong(),offset:t.readLong(),length:t.readLong()},e[r.tag]=r}function i(t){function n(t,e){this.definition=e,this.length=e.length,this.offset=e.offset,this.file=t,this.rawData=t.raw,this.parse(t.raw)}n.prototype.raw=function(){return this.rawData.slice(this.offset,this.length)};for(var r in t)e(t,r)&&(n[r]=n.prototype[r]=t[r]);return n}function o(){var t,e="",n=w+"";for(t=0;n.length>t;++t)e+=String.fromCharCode(n.charCodeAt(t)-48+65);return++w,e}function a(t){this.font=t,this.subset={},this.unicodes={},this.ogid2ngid={0:0},this.ngid2ogid={0:0},this.ncid2ogid={},this.next=this.firstChar=1,this.nextGid=1,this.psName=o()+"+"+this.font.psName}function s(t,e){var n,r,i,o=this,a=o.contents=v(t);if("ttcf"==a.readString(4)){if(!e)throw Error("Must specify a name for TTC files");for(a.readLong(),n=a.readLong(),r=0;n>r;++r)if(i=a.readLong(),a.saveExcursion(function(){a.offset(i),o.parse()}),o.psName==e)return;throw Error("Font "+e+" not found in collection")}a.offset(0),o.parse()}var h,u,c,f,d,l,p,g,m,S,w,y=t.kendo.pdf,v=y.BinaryStream;r.prototype={readTable:function(t,e){var n=this.tables[t];if(!n)throw Error("Table "+t+" not found in directory");return this[t]=n.table=new e(this,n)},render:function(t){var n,r,i,o,a,s,h,u,c=Object.keys(t).length,f=Math.pow(2,Math.floor(Math.log(c)/Math.LN2)),d=16*f,l=Math.floor(Math.log(f)/Math.LN2),p=16*c-d,g=v();g.writeLong(this.scalerType),g.writeShort(c),g.writeShort(d),g.writeShort(l),g.writeShort(p),n=16*c,r=g.offset()+n,i=null,o=v();for(a in t)if(e(t,a))for(s=t[a],g.writeString(a),g.writeLong(this.checksum(s)),g.writeLong(r),g.writeLong(s.length),o.write(s),"head"==a&&(i=r),r+=s.length;r%4;)o.writeByte(0),r++;return g.write(o.get()),h=this.checksum(g.get()),
u=2981146554-h,g.offset(i+8),g.writeLong(u),g.get()},checksum:function(t){t=v(t);for(var e=0;!t.eof();)e+=t.readLong();return 4294967295&e}},h=i({parse:function(t){t.offset(this.offset),this.version=t.readLong(),this.revision=t.readLong(),this.checkSumAdjustment=t.readLong(),this.magicNumber=t.readLong(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.read(8),this.modified=t.read(8),this.xMin=t.readShort_(),this.yMin=t.readShort_(),this.xMax=t.readShort_(),this.yMax=t.readShort_(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort_(),this.indexToLocFormat=t.readShort_(),this.glyphDataFormat=t.readShort_()},render:function(t){var e=v();return e.writeLong(this.version),e.writeLong(this.revision),e.writeLong(0),e.writeLong(this.magicNumber),e.writeShort(this.flags),e.writeShort(this.unitsPerEm),e.write(this.created),e.write(this.modified),e.writeShort_(this.xMin),e.writeShort_(this.yMin),e.writeShort_(this.xMax),e.writeShort_(this.yMax),e.writeShort(this.macStyle),e.writeShort(this.lowestRecPPEM),e.writeShort_(this.fontDirectionHint),e.writeShort_(t),e.writeShort_(this.glyphDataFormat),e.get()}}),u=i({parse:function(t){t.offset(this.offset);var e=this.file.head.indexToLocFormat;this.offsets=0===e?t.times(this.length/2,function(){return 2*t.readShort()}):t.times(this.length/4,t.readLong)},offsetOf:function(t){return this.offsets[t]},lengthOf:function(t){return this.offsets[t+1]-this.offsets[t]},render:function(t){var e,n=v(),r=t[t.length-1]>65535;for(e=0;t.length>e;++e)r?n.writeLong(t[e]):n.writeShort(t[e]/2);return{format:r?1:0,table:n.get()}}}),c=i({parse:function(t){t.offset(this.offset),this.version=t.readLong(),this.ascent=t.readShort_(),this.descent=t.readShort_(),this.lineGap=t.readShort_(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort_(),this.minRightSideBearing=t.readShort_(),this.xMaxExtent=t.readShort_(),this.caretSlopeRise=t.readShort_(),this.caretSlopeRun=t.readShort_(),this.caretOffset=t.readShort_(),t.skip(8),this.metricDataFormat=t.readShort_(),this.numOfLongHorMetrics=t.readShort()},render:function(t){var e=v();return e.writeLong(this.version),e.writeShort_(this.ascent),e.writeShort_(this.descent),e.writeShort_(this.lineGap),e.writeShort(this.advanceWidthMax),e.writeShort_(this.minLeftSideBearing),e.writeShort_(this.minRightSideBearing),e.writeShort_(this.xMaxExtent),e.writeShort_(this.caretSlopeRise),e.writeShort_(this.caretSlopeRun),e.writeShort_(this.caretOffset),e.write([0,0,0,0,0,0,0,0]),e.writeShort_(this.metricDataFormat),e.writeShort(t.length),e.get()}}),f=i({parse:function(t){t.offset(this.offset),this.version=t.readLong(),this.numGlyphs=t.readShort(),this.maxPoints=t.readShort(),this.maxContours=t.readShort(),this.maxComponentPoints=t.readShort(),this.maxComponentContours=t.readShort(),this.maxZones=t.readShort(),this.maxTwilightPoints=t.readShort(),this.maxStorage=t.readShort(),this.maxFunctionDefs=t.readShort(),this.maxInstructionDefs=t.readShort(),this.maxStackElements=t.readShort(),this.maxSizeOfInstructions=t.readShort(),this.maxComponentElements=t.readShort(),this.maxComponentDepth=t.readShort()},render:function(t){var e=v();return e.writeLong(this.version),e.writeShort(t.length),e.writeShort(this.maxPoints),e.writeShort(this.maxContours),e.writeShort(this.maxComponentPoints),e.writeShort(this.maxComponentContours),e.writeShort(this.maxZones),e.writeShort(this.maxTwilightPoints),e.writeShort(this.maxStorage),e.writeShort(this.maxFunctionDefs),e.writeShort(this.maxInstructionDefs),e.writeShort(this.maxStackElements),e.writeShort(this.maxSizeOfInstructions),e.writeShort(this.maxComponentElements),e.writeShort(this.maxComponentDepth),e.get()}}),d=i({parse:function(t){var e,n,r;t.offset(this.offset),e=this.file,n=e.hhea,this.metrics=t.times(n.numOfLongHorMetrics,function(){return{advance:t.readShort(),lsb:t.readShort_()}}),r=e.maxp.numGlyphs-e.hhea.numOfLongHorMetrics,this.leftSideBearings=t.times(r,t.readShort_)},forGlyph:function(t){var e=this.metrics,n=e.length;return n>t?e[t]:{advance:e[n-1].advance,lsb:this.leftSideBearings[t-n]}},render:function(t){var e,n,r=v();for(e=0;t.length>e;++e)n=this.forGlyph(t[e]),r.writeShort(n.advance),r.writeShort_(n.lsb);return r.get()}}),l=function(){function t(t){this.raw=t}function n(t){var e,n,i;for(this.raw=t,e=this.glyphIds=[],n=this.idOffsets=[];;){if(i=t.readShort(),n.push(t.offset()),e.push(t.readShort()),!(i&a))break;t.skip(i&r?4:2),i&h?t.skip(8):i&s?t.skip(4):i&o&&t.skip(2)}}var r,o,a,s,h;return t.prototype={compound:!1,render:function(){return this.raw.get()}},r=1,o=8,a=32,s=64,h=128,n.prototype={compound:!0,render:function(t){var e,n,r=v(this.raw.get());for(e=0;this.glyphIds.length>e;++e)n=this.glyphIds[e],r.offset(this.idOffsets[e]),r.writeShort(t[n]);return r.get()}},i({parse:function(){this.cache={}},glyphFor:function(r){var i,o,a,s,h,u,c,f,d,l,p,g=this.cache;return e(g,r)?g[r]:(i=this.file.loca,o=i.lengthOf(r),0===o?g[r]=null:(a=this.rawData,s=this.offset+i.offsetOf(r),h=v(a.slice(s,o)),u=h.readShort_(),c=h.readShort_(),f=h.readShort_(),d=h.readShort_(),l=h.readShort_(),p=g[r]=-1==u?new n(h):new t(h),p.numberOfContours=u,p.xMin=c,p.yMin=f,p.xMax=d,p.yMax=l,p))},render:function(t,e,n){var r,i,o,a=v(),s=[];for(r=0;e.length>r;++r)i=e[r],o=t[i],s.push(a.offset()),o&&a.write(o.render(n));return s.push(a.offset()),{table:a.get(),offsets:s}}})}(),p=function(){function t(t,e){this.text=t,this.length=t.length,this.platformID=e.platformID,this.platformSpecificID=e.platformSpecificID,this.languageID=e.languageID,this.nameID=e.nameID}return i({parse:function(e){var n,r,i,o,a,s,h;for(e.offset(this.offset),e.readShort(),n=e.readShort(),r=this.offset+e.readShort(),i=e.times(n,function(){return{platformID:e.readShort(),platformSpecificID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:e.readShort()+r}}),o=this.strings={},a=0;i.length>a;++a)s=i[a],e.offset(s.offset),h=e.readString(s.length),o[s.nameID]||(o[s.nameID]=[]),o[s.nameID].push(new t(h,s));this.postscriptEntry=o[6][0],this.postscriptName=this.postscriptEntry.text.replace(/[^\x20-\x7F]/g,"")},render:function(n){var r,i,o,a,s,h,u=this.strings,c=0;for(r in u)e(u,r)&&(c+=u[r].length);i=v(),o=v(),i.writeShort(0),i.writeShort(c),i.writeShort(6+12*c);for(r in u)if(e(u,r))for(a=6==r?[new t(n,this.postscriptEntry)]:u[r],s=0;a.length>s;++s)h=a[s],i.writeShort(h.platformID),i.writeShort(h.platformSpecificID),i.writeShort(h.languageID),i.writeShort(h.nameID),i.writeShort(h.length),i.writeShort(o.offset()),o.writeString(h.text);return i.write(o.get()),i.get()}})}(),g=function(){var t=".notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat".split(/\s+/g);return i({parse:function(t){var e,n;switch(t.offset(this.offset),this.format=t.readLong(),this.italicAngle=t.readFixed_(),this.underlinePosition=t.readShort_(),this.underlineThickness=t.readShort_(),this.isFixedPitch=t.readLong(),this.minMemType42=t.readLong(),this.maxMemType42=t.readLong(),this.minMemType1=t.readLong(),this.maxMemType1=t.readLong(),this.format){case 65536:case 196608:break;case 131072:for(e=t.readShort(),this.glyphNameIndex=t.times(e,t.readShort),this.names=[],n=this.offset+this.length;t.offset()<n;)this.names.push(t.readString(t.readByte()));break;case 151552:e=t.readShort(),this.offsets=t.read(e);break;case 262144:this.map=t.times(this.file.maxp.numGlyphs,t.readShort)}},glyphFor:function(e){switch(this.format){case 65536:return t[e]||".notdef";case 131072:var n=this.glyphNameIndex[e];return t.length>n?t[n]:this.names[n-t.length]||".notdef";case 151552:case 196608:return".notdef";case 262144:return this.map[e]||65535}},render:function(e){var n,r,i,o,a,s,h;if(196608==this.format)return this.raw();for(n=v(this.rawData.slice(this.offset,32)),n.writeLong(131072),n.offset(32),r=[],i=[],o=0;e.length>o;++o)a=e[o],s=this.glyphFor(a),h=t.indexOf(s),h>=0?r.push(h):(r.push(t.length+i.length),i.push(s));for(n.writeShort(e.length),o=0;r.length>o;++o)n.writeShort(r[o]);for(o=0;i.length>o;++o)n.writeByte(i[o].length),n.writeString(i[o]);return n.get()}})}(),m=function(){function e(e,n,r){var i=this;i.platformID=e.readShort(),i.platformSpecificID=e.readShort(),i.offset=n+e.readLong(),e.saveExcursion(function(){var n,o,a,s,h,u,c,f,d,l,p,g,m,S,w,y,v;switch(e.offset(i.offset),i.format=e.readShort()){case 0:for(i.length=e.readShort(),i.language=e.readShort(),o=0;256>o;++o)r[o]=e.readByte();break;case 4:for(i.length=e.readShort(),i.language=e.readShort(),a=e.readShort()/2,e.skip(6),s=e.times(a,e.readShort),e.skip(2),h=e.times(a,e.readShort),u=e.times(a,e.readShort_),c=e.times(a,e.readShort),f=(i.length+i.offset-e.offset())/2,d=e.times(f,e.readShort),o=0;a>o;++o)for(l=h[o],p=s[o],n=l;p>=n;++n)0===c[o]?g=n+u[o]:(m=c[o]/2-(a-o)+(n-l),g=d[m]||0,0!==g&&(g+=u[o])),r[n]=65535&g;break;case 6:for(i.length=e.readShort(),i.language=e.readShort(),n=e.readShort(),S=e.readShort();S-- >0;)r[n++]=e.readShort();break;case 12:for(e.readShort(),i.length=e.readLong(),i.language=e.readLong(),w=e.readLong();w-- >0;)for(n=e.readLong(),y=e.readLong(),v=e.readLong();y>=n;)r[n++]=v++;break;default:t.console&&t.console.error("Unhandled CMAP format: "+i.format)}})}function r(t,e){function r(n){return e[t[n]]}var i,o,a,s,h,u,c,f,d,l,p,g,m,S,w,y,x,_=n(t),b=[],C=[],T=null,D=null;for(i=0;_.length>i;++i)o=_[i],a=r(o),s=a-o,(null==T||s!==D)&&(T&&C.push(T),b.push(o),D=s),T=o;for(T&&C.push(T),C.push(65535),b.push(65535),h=b.length,u=2*h,c=2*Math.pow(2,Math.floor(Math.log(h)/Math.LN2)),f=Math.log(c/2)/Math.LN2,d=u-c,l=[],p=[],g=[],i=0;h>i;++i){if(m=b[i],S=C[i],65535==m){l.push(0),p.push(0);break}if(w=r(m),m-w>=32768)for(l.push(0),p.push(2*(g.length+h-i)),y=m;S>=y;++y)g.push(r(y));else l.push(w-m),p.push(0)}return x=v(),x.writeShort(3),x.writeShort(1),x.writeLong(12),x.writeShort(4),x.writeShort(16+8*h+2*g.length),x.writeShort(0),x.writeShort(u),x.writeShort(c),x.writeShort(f),x.writeShort(d),C.forEach(x.writeShort),x.writeShort(0),b.forEach(x.writeShort),l.forEach(x.writeShort_),p.forEach(x.writeShort),g.forEach(x.writeShort),x.get()}return i({parse:function(t){var n,r=this,i=r.offset;t.offset(i),r.codeMap={},r.version=t.readShort(),n=t.readShort(),r.tables=t.times(n,function(){return new e(t,i,r.codeMap)})},render:function(t,e){var n=v();return n.writeShort(0),n.writeShort(1),n.write(r(t,e)),n.get()}})}(),S=i({parse:function(t){t.offset(this.offset),this.version=t.readShort(),this.averageCharWidth=t.readShort_(),this.weightClass=t.readShort(),this.widthClass=t.readShort(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort_(),this.ySubscriptYSize=t.readShort_(),this.ySubscriptXOffset=t.readShort_(),this.ySubscriptYOffset=t.readShort_(),this.ySuperscriptXSize=t.readShort_(),this.ySuperscriptYSize=t.readShort_(),this.ySuperscriptXOffset=t.readShort_(),this.ySuperscriptYOffset=t.readShort_(),this.yStrikeoutSize=t.readShort_(),this.yStrikeoutPosition=t.readShort_(),this.familyClass=t.readShort_(),this.panose=t.times(10,t.readByte),this.charRange=t.times(4,t.readLong),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort_(),this.descent=t.readShort_(),this.lineGap=t.readShort_(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=t.times(2,t.readLong),this.version>1&&(this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()))},render:function(){return this.raw()}}),w=1e5,a.prototype={use:function(t){var e,n,r,i=this;return"string"==typeof t?kendo.util.ucs2decode(t).reduce(function(t,e){return t+String.fromCharCode(i.use(e))},""):(e=i.unicodes[t],e||(e=i.next++,i.subset[e]=t,i.unicodes[t]=e,n=i.font.cmap.codeMap[t],n&&(i.ncid2ogid[e]=n,null==i.ogid2ngid[n]&&(r=i.nextGid++,i.ogid2ngid[n]=r,i.ngid2ogid[r]=n))),e)},encodeText:function(t){return this.use(t)},glyphIds:function(){return n(this.ogid2ngid)},glyphsFor:function(t,e){var n,r,i;for(e||(e={}),n=0;t.length>n;++n)r=t[n],e[r]||(i=e[r]=this.font.glyf.glyphFor(r),i&&i.compound&&this.glyphsFor(i.glyphIds,e));return e},render:function(){var t,r,i,o,a,s,h,u,c=this.glyphsFor(this.glyphIds());for(t in c)e(c,t)&&(t=parseInt(t,10),null==this.ogid2ngid[t]&&(r=this.nextGid++,this.ogid2ngid[t]=r,this.ngid2ogid[r]=t));return i=n(this.ngid2ogid),o=i.map(function(t){return this.ngid2ogid[t]},this),a=this.font,s=a.glyf.render(c,o,this.ogid2ngid),h=a.loca.render(s.offsets),this.lastChar=this.next-1,u={cmap:m.render(this.ncid2ogid,this.ogid2ngid),glyf:s.table,loca:h.table,hmtx:a.hmtx.render(o),hhea:a.hhea.render(o),maxp:a.maxp.render(o),post:a.post.render(o),name:a.name.render(this.psName),head:a.head.render(h.format),"OS/2":a.os2.render()},this.font.directory.render(u)},cidToGidMap:function(){var t,e,n,r=v(),i=0;for(t=this.firstChar;this.next>t;++t){for(;t>i;)r.writeShort(0),i++;e=this.ncid2ogid[t],e?(n=this.ogid2ngid[e],r.writeShort(n)):r.writeShort(0),i++}return r.get()}},s.prototype={parse:function(){var t=this.directory=new r(this.contents);this.head=t.readTable("head",h),this.loca=t.readTable("loca",u),this.hhea=t.readTable("hhea",c),this.maxp=t.readTable("maxp",f),this.hmtx=t.readTable("hmtx",d),this.glyf=t.readTable("glyf",l),this.name=t.readTable("name",p),this.post=t.readTable("post",g),this.cmap=t.readTable("cmap",m),this.os2=t.readTable("OS/2",S),this.psName=this.name.postscriptName,this.ascent=this.os2.ascent||this.hhea.ascent,this.descent=this.os2.descent||this.hhea.descent,this.lineGap=this.os2.lineGap||this.hhea.lineGap,this.scale=1e3/this.head.unitsPerEm},widthOfGlyph:function(t){return this.hmtx.forGlyph(t).advance*this.scale},makeSubset:function(){return new a(this)}},y.TTFFont=s}(window)},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("util/text-metrics.min",["kendo.core.min","util/main.min"],t)}(function(){!function(t){function e(){return{width:0,height:0,baseline:0}}function n(t,e,n){return f.current.measure(t,e,n)}function r(t,e){var n=[];if(t.length>0&&document.fonts){try{n=t.map(function(t){return document.fonts.load(t)})}catch(r){o.logToConsole(r)}Promise.all(n).then(e,e)}else e()}var i=document,o=window.kendo,a=o.Class,s=o.util,h=s.defined,u=a.extend({init:function(t){this._size=t,this._length=0,this._map={}},put:function(t,e){var n=this,r=n._map,i={key:t,value:e};r[t]=i,n._head?(n._tail.newer=i,i.older=n._tail,n._tail=i):n._head=n._tail=i,n._length>=n._size?(r[n._head.key]=null,n._head=n._head.newer,n._head.older=null):n._length++},get:function(t){var e=this,n=e._map[t];return n?(n===e._head&&n!==e._tail&&(e._head=n.newer,e._head.older=null),n!==e._tail&&(n.older&&(n.older.newer=n.newer,n.newer.older=n.older),n.older=e._tail,n.newer=null,e._tail.newer=n,e._tail=n),n.value):void 0}}),c=t("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: nowrap!important;' />")[0],f=a.extend({init:function(t){this._cache=new u(1e3),this._initOptions(t)},options:{baselineMarkerSize:1},measure:function(n,r,o){var a,u,f,d,l,p,g,m;if(!n)return e();if(a=s.objectKey(r),u=s.hashKey(n+a),f=this._cache.get(u),f)return f;d=e(),l=o?o:c,p=this._baselineMarker().cloneNode(!1);for(g in r)m=r[g],h(m)&&(l.style[g]=m);return t(l).text(n),l.appendChild(p),i.body.appendChild(l),(n+"").length&&(d.width=l.offsetWidth-this.options.baselineMarkerSize,d.height=l.offsetHeight,d.baseline=p.offsetTop+this.options.baselineMarkerSize),d.width>0&&d.height>0&&this._cache.put(u,d),l.parentNode.removeChild(l),d},_baselineMarker:function(){return t("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;' />")[0]}});f.current=new f,o.util.TextMetrics=f,o.util.LRUCache=u,o.util.loadFonts=r,o.util.measureText=n}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("util/base64.min",["util/main.min"],t)}(function(){return function(){function t(t){var n,r,i,a,s,h,u,c="",f=0;for(t=e(t);t.length>f;)n=t.charCodeAt(f++),r=t.charCodeAt(f++),i=t.charCodeAt(f++),a=n>>2,s=(3&n)<<4|r>>4,h=(15&r)<<2|i>>6,u=63&i,isNaN(r)?h=u=64:isNaN(i)&&(u=64),c=c+o.charAt(a)+o.charAt(s)+o.charAt(h)+o.charAt(u);return c}function e(t){var e,n,r="";for(e=0;t.length>e;e++)n=t.charCodeAt(e),128>n?r+=i(n):2048>n?(r+=i(192|n>>>6),r+=i(128|63&n)):65536>n&&(r+=i(224|n>>>12),r+=i(128|n>>>6&63),r+=i(128|63&n));return r}var n=window.kendo,r=n.deepExtend,i=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r(n.util,{encodeBase64:t,encodeUTF8:e})}(),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("mixins/observers.min",["kendo.core.min"],t)}(function(){return function(t){var e=Math,n=window.kendo,r=n.deepExtend,i=t.inArray,o={observers:function(){return this._observers=this._observers||[]},addObserver:function(t){return this._observers?this._observers.push(t):this._observers=[t],this},removeObserver:function(t){var e=this.observers(),n=i(t,e);return-1!=n&&e.splice(n,1),this},trigger:function(t,e){var n,r,i=this._observers;if(i&&!this._suspended)for(r=0;i.length>r;r++)n=i[r],n[t]&&n[t](e);return this},optionsChange:function(t){this.trigger("optionsChange",t)},geometryChange:function(t){this.trigger("geometryChange",t)},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=e.max((this._suspended||0)-1,0),this},_observerField:function(t,e){this[t]&&this[t].removeObserver(this),this[t]=e,e.addObserver(this)}};r(n,{mixins:{ObserversMixin:o}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("pdf/drawing.min",["kendo.core.min","kendo.color.min","kendo.drawing.min","pdf/core.min"],t)}(function(){!function(t,e){"use strict";function n(e,n){function r(t,e,n){return n||(n=c),n.pdf&&null!=n.pdf[t]?n.pdf[t]:e}function i(){function i(t){var e,n,i,o,h,u=t.options,c=D(t),f=c.bbox;t=c.root,e=r("paperSize",r("paperSize","auto"),u),n=!1,"auto"==e&&(f?(i=f.getSize(),e=[i.width,i.height],n=!0,o=f.getOrigin(),c=new k.Group,c.transform(new F.Matrix(1,0,0,1,-o.x,-o.y)),c.append(t),t=c):e="A4"),h=a.addPage({paperSize:e,margin:r("margin",r("margin"),u),addMargin:n,landscape:r("landscape",r("landscape",!1),u)}),s(t,h,a)}if(!(--o>0)){var a=new t.pdf.Document({producer:r("producer"),title:r("title"),author:r("author"),subject:r("subject"),keywords:r("keywords"),creator:r("creator"),date:r("date")});f?e.children.forEach(i):i(e),n(a.render(),a)}}var o,h=[],u=[],c=e.options,f=r("multiPage");e.traverse(function(e){a({Image:function(t){u.indexOf(t.src())<0&&u.push(t.src())},Text:function(e){var n=t.pdf.parseFontDef(e.options.font),r=t.pdf.getFontURL(n);h.indexOf(r)<0&&h.push(r)}},e)}),o=2,t.pdf.loadFonts(h,i),t.pdf.loadImages(u,i)}function r(t,e){n(t,function(t){e("data:application/pdf;base64,"+t.base64())})}function i(t,e){n(t,function(t){e(new Blob([t.get()],{type:"application/pdf"}))})}function o(e,n,o,a){window.Blob&&!t.support.browser.safari?i(e,function(e){t.saveAs({dataURI:e,fileName:n}),a&&a(e)}):r(e,function(e){t.saveAs({dataURI:e,fileName:n,proxyURL:o}),a&&a(e)})}function a(t,e){var n=t[e.nodeType];return n?n.call.apply(n,arguments):e}function s(t,e,n){var r,i,o;t.options._pdfDebug&&e.comment("BEGIN: "+t.options._pdfDebug),r=t.transform(),i=t.opacity(),e.save(),null!=i&&1>i&&e.setOpacity(i),h(t,e,n),u(t,e,n),r&&(o=r.matrix(),e.transform(o.a,o.b,o.c,o.d,o.e,o.f)),c(t,e,n),a({Path:m,MultiPath:S,Circle:w,Arc:y,Text:v,Image:_,Group:x,Rect:b},t,e,n),e.restore(),t.options._pdfDebug&&e.comment("END: "+t.options._pdfDebug)}function h(t,e){var n,r,i,o,a,s,h=t.stroke&&t.stroke();if(h){if(n=h.color){if(n=T(n),null==n)return;e.setStrokeColor(n.r,n.g,n.b),1!=n.a&&e.setStrokeOpacity(n.a)}if(r=h.width,null!=r){if(0===r)return;e.setLineWidth(r)}i=h.dashType,i&&e.setDashPattern(L[i],0),o=h.lineCap,o&&e.setLineCap(M[o]),a=h.lineJoin,a&&e.setLineJoin(O[a]),s=h.opacity,null!=s&&e.setStrokeOpacity(s)}}function u(t,e){var n,r,i=t.fill&&t.fill();if(i&&!(i instanceof k.Gradient)){if(n=i.color){if(n=T(n),null==n)return;e.setFillColor(n.r,n.g,n.b),1!=n.a&&e.setFillOpacity(n.a)}r=i.opacity,null!=r&&e.setFillOpacity(r)}}function c(t,e,n){var r=t.clip();r&&(g(r,e,n),e.clip())}function f(t){return t&&(t instanceof k.Gradient||t.color&&!/^(none|transparent)$/i.test(t.color)&&(null==t.width||t.width>0)&&(null==t.opacity||t.opacity>0))}function d(t,e,n,r){var i,o,a,s,h,u,c,f=t.fill();return f instanceof k.Gradient?(r?e.clipStroke():e.clip(),i=f instanceof k.RadialGradient,i?(o={x:f.center().x,y:f.center().y,r:0},a={x:f.center().x,y:f.center().y,r:f.radius()}):(o={x:f.start().x,y:f.start().y},a={x:f.end().x,y:f.end().y}),s={type:i?"radial":"linear",start:o,end:a,userSpace:f.userSpace(),stops:f.stops.elements().map(function(t){var e,n=t.offset();return n=/%$/.test(n)?parseFloat(n)/100:parseFloat(n),e=T(t.color()),e.a*=t.opacity(),{offset:n,color:e}})},h=t.rawBBox(),u=h.topLeft(),c=h.getSize(),h={left:u.x,top:u.y,width:c.width,height:c.height},e.gradient(s,h),!0):void 0}function l(t,e,n){f(t.fill())&&f(t.stroke())?d(t,e,n,!0)||e.fillStroke():f(t.fill())?d(t,e,n,!1)||e.fill():f(t.stroke())?e.stroke():e.nop()}function p(t,e){var n,r,i,o=t.segments;if(4==o.length&&t.options.closed){for(n=[],r=0;o.length>r;++r){if(o[r].controlIn())return!1;n[r]=o[r].anchor()}if(i=n[0].y==n[1].y&&n[1].x==n[2].x&&n[2].y==n[3].y&&n[3].x==n[0].x||n[0].x==n[1].x&&n[1].y==n[2].y&&n[2].x==n[3].x&&n[3].y==n[0].y)return e.rect(n[0].x,n[0].y,n[2].x-n[0].x,n[2].y-n[0].y),!0}}function g(t,e,n){var r,i,o,a,s,h,u=t.segments;if(0!==u.length&&!p(t,e,n)){for(i=0;u.length>i;++i)o=u[i],a=o.anchor(),r?(s=r.controlOut(),h=o.controlIn(),s&&h?e.bezier(s.x,s.y,h.x,h.y,a.x,a.y):e.lineTo(a.x,a.y)):e.moveTo(a.x,a.y),r=o;t.options.closed&&e.close()}}function m(t,e,n){g(t,e,n),l(t,e,n)}function S(t,e,n){var r,i=t.paths;for(r=0;i.length>r;++r)g(i[r],e,n);l(t,e,n)}function w(t,e,n){var r=t.geometry();e.circle(r.center.x,r.center.y,r.radius),l(t,e,n)}function y(t,e,n){var r,i=t.geometry().curvePoints();for(e.moveTo(i[0].x,i[0].y),r=1;i.length>r;)e.bezier(i[r].x,i[r++].y,i[r].x,i[r++].y,i[r].x,i[r++].y);l(t,e,n)}function v(e,n){var r,i=t.pdf.parseFontDef(e.options.font),o=e._position;e.fill()&&e.stroke()?r=A.fillAndStroke:e.fill()?r=A.fill:e.stroke()&&(r=A.stroke),n.transform(1,0,0,-1,o.x,o.y+i.fontSize),n.beginText(),n.setFont(t.pdf.getFontURL(i),i.fontSize),n.setTextRenderingMode(r),n.showText(e.content(),e._pdfRect?e._pdfRect.width():null),n.endText()}function x(t,e,n){var r,i;for(t._pdfLink&&e.addLink(t._pdfLink.url,t._pdfLink),r=t.children,i=0;r.length>i;++i)s(r[i],e,n)}function _(t,e){var n,r,i,o=t.src();o&&(n=t.rect(),r=n.getOrigin(),i=n.getSize(),e.transform(i.width,0,0,-i.height,r.x,r.y+i.height),e.drawImage(o))}function b(t,e,n){var r=t.geometry();e.rect(r.origin.x,r.origin.y,r.size.width,r.size.height),l(t,e,n)}function C(t,n){var r,i=e.Deferred();for(r in n)t.options.set("pdf."+r,n[r]);return k.pdf.toDataURL(t,i.resolve),i.promise()}function T(e){var n=t.parseColor(e,!0);return n?n.toRGB():null}function D(t){function e(t){return h=!0,t}function n(t){return t.visible()&&t.opacity()>0&&(f(t.fill())||f(t.stroke()))}function r(t){var e,n,r=[];for(e=0;t.length>e;++e)n=s(t[e]),null!=n&&r.push(n);return r}function i(t,e){var n,r=u,i=c;t.transform()&&(c=c.multiplyCopy(t.transform().matrix())),n=t.clip(),n&&(n=n.bbox(),n&&(n=n.bbox(c),u=u?F.Rect.intersect(u,n):n));try{return e()}finally{u=r,c=i}}function o(t){if(null==u)return!1;var e=t.rawBBox().bbox(c);return u&&e&&(e=F.Rect.intersect(e,u)),e}function s(s){return i(s,function(){if(!(s instanceof k.Group||s instanceof k.MultiPath)){var i=o(s);if(!i)return e(null);d=d?F.Rect.union(d,i):i}return a({Path:function(t){return 0!==t.segments.length&&n(t)?t:e(null)},MultiPath:function(t){if(!n(t))return e(null);var i=new k.MultiPath(t.options);return i.paths=r(t.paths),0===i.paths.length?e(null):i},Circle:function(t){return n(t)?t:e(null)},Arc:function(t){return n(t)?t:e(null)},Text:function(t){return/\S/.test(t.content())&&n(t)?t:e(null)},Image:function(t){return t.visible()&&t.opacity()>0?t:e(null)},Group:function(n){var i=new k.Group(n.options);return i.children=r(n.children),i._pdfLink=n._pdfLink,n===t||0!==i.children.length||n._pdfLink?i:e(null)},Rect:function(t){return n(t)?t:e(null)}},s)})}var h,u=!1,c=F.Matrix.unit(),d=null;do h=!1,t=s(t);while(t&&h);return{root:t,bbox:d}}var k=t.drawing,F=t.geometry,A=t.pdf.TEXT_RENDERING_MODE,L={dash:[4],dashDot:[4,2,1,2],dot:[1,2],longDash:[8,2],longDashDot:[8,2,1,2],longDashDotDot:[8,2,1,2,1,2],solid:[]},M={butt:0,round:1,square:2},O={miter:0,round:1,bevel:2};t.deepExtend(k,{exportPDF:C,pdf:{toDataURL:r,toBlob:i,saveAs:o,toStream:n}})}(window.kendo,window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}),function(t,define){define("kendo.pdf.min",["kendo.core.min","pdf/core.min","pdf/ttf.min","pdf/drawing.min","kendo.drawing.min"],t)}(function(){return function(t,e){t.PDFMixin={extend:function(t){t.events.push("pdfExport"),t.options.pdf=this.options,t.saveAsPDF=this.saveAsPDF,t._drawPDF=this._drawPDF,t._drawPDFShadow=this._drawPDFShadow},options:{fileName:"Export.pdf",proxyURL:"",paperSize:"auto",allPages:!1,landscape:!1,margin:null,title:null,author:null,subject:null,keywords:null,creator:"Kendo UI PDF Generator v."+t.version,date:null},saveAsPDF:function(){var n,r=new e.Deferred,i=r.promise(),o={promise:i};if(!this.trigger("pdfExport",o))return n=this.options.pdf,n.multiPage=n.allPages,this._drawPDF(r).then(function(e){return t.drawing.exportPDF(e,n)}).done(function(e){t.saveAs({dataURI:e,fileName:n.fileName,proxyURL:n.proxyURL,forceProxy:n.forceProxy,proxyTarget:n.proxyTarget}),r.resolve()}).fail(function(t){r.reject(t)}),i},_drawPDF:function(n){var r=new e.Deferred;return t.drawing.drawDOM(this.wrapper).done(function(t){var e={page:t,pageNumber:1,progress:1,totalPages:1};n.notify(e),r.resolve(e.page)}).fail(function(t){r.reject(t)}),r},_drawPDFShadow:function(n,r){var i,o,a;return n=n||{},i=this.wrapper,o=e("<div class='k-pdf-export-shadow'>"),n.width&&o.css({width:n.width,overflow:"visible"}),i.before(o),o.append(n.content||i.clone(!0,!0)),a=e.Deferred(),setTimeout(function(){var e=t.drawing.drawDOM(o,r);e.always(function(){o.remove()}).then(function(){a.resolve.apply(a,arguments)}).fail(function(){a.reject.apply(a,arguments)}).progress(function(){a.progress.apply(a,arguments)})},15),a.promise()}}}(kendo,window.kendo.jQuery),kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()});;!function(e,define){define("kendo.progressbar.min",["kendo.core.min"],e)}(function(){return function(e,r){var s=window.kendo,t=s.ui,a=t.Widget,n="horizontal",o="vertical",p=0,i=100,u=0,l=5,d="k-progressbar",g="k-progressbar-reverse",c="k-progressbar-indeterminate",v="k-complete",_="k-state-selected",f="k-progress-status",h="k-state-selected",m="k-state-default",k="k-state-disabled",P={VALUE:"value",PERCENT:"percent",CHUNK:"chunk"},C="change",w="complete",y="boolean",S=Math,W=e.extend,b=e.proxy,A=100,x=400,U=3,N={progressStatus:"<span class='k-progress-status-wrap'><span class='k-progress-status'></span></span>"},V=a.extend({init:function(e,r){var s=this;a.fn.init.call(this,e,r),r=s.options,s._progressProperty=r.orientation===n?"width":"height",s._fields(),r.value=s._validateValue(r.value),s._validateType(r.type),s._wrapper(),s._progressAnimation(),r.value!==r.min&&r.value!==!1&&s._updateProgress()},setOptions:function(e){var r=this;a.fn.setOptions.call(r,e),e.hasOwnProperty("reverse")&&r.wrapper.toggleClass("k-progressbar-reverse",e.reverse),e.hasOwnProperty("enable")&&r.enable(e.enable),r._progressAnimation(),r._validateValue(),r._updateProgress()},events:[C,w],options:{name:"ProgressBar",orientation:n,reverse:!1,min:p,max:i,value:u,enable:!0,type:P.VALUE,chunkCount:l,showStatus:!0,animation:{}},_fields:function(){var r=this;r._isStarted=!1,r.progressWrapper=r.progressStatus=e()},_validateType:function(t){var a=!1;if(e.each(P,function(e,s){return s===t?(a=!0,!1):r}),!a)throw Error(s.format("Invalid ProgressBar type '{0}'",t))},_wrapper:function(){var e,r=this,s=r.wrapper=r.element,t=r.options,a=t.orientation;s.addClass("k-widget "+d),s.addClass(d+"-"+(a===n?n:o)),t.enable===!1&&s.addClass(k),t.reverse&&s.addClass(g),t.value===!1&&s.addClass(c),t.type===P.CHUNK?r._addChunkProgressWrapper():t.showStatus&&(r.progressStatus=r.wrapper.prepend(N.progressStatus).find("."+f),e=t.value!==!1?t.value:t.min,r.progressStatus.text(t.type===P.VALUE?e:r._calculatePercentage(e).toFixed()+"%"))},value:function(e){return this._value(e)},_value:function(e){var s,t=this,a=t.options;return e===r?a.value:(typeof e!==y?(e=t._roundValue(e),isNaN(e)||(s=t._validateValue(e),s!==a.value&&(t.wrapper.removeClass(c),a.value=s,t._isStarted=!0,t._updateProgress()))):e||(t.wrapper.addClass(c),a.value=!1),r)},_roundValue:function(e){e=parseFloat(e);var r=S.pow(10,U);return S.floor(e*r)/r},_validateValue:function(e){var r=this,s=r.options;if(e!==!1){if(s.min>=e||e===!0)return s.min;if(e>=s.max)return s.max}else if(e===!1)return!1;return isNaN(r._roundValue(e))?s.min:e},_updateProgress:function(){var e=this,r=e.options,s=e._calculatePercentage();r.type===P.CHUNK?(e._updateChunks(s),e._onProgressUpdateAlways(r.value)):e._updateProgressWrapper(s)},_updateChunks:function(e){var r,s=this,t=s.options,a=t.chunkCount,p=parseInt(A/a*100,10)/100,i=parseInt(100*e,10)/100,u=S.floor(i/p);r=s.wrapper.find(t.orientation===n&&!t.reverse||t.orientation===o&&t.reverse?"li.k-item:lt("+u+")":"li.k-item:gt(-"+(u+1)+")"),s.wrapper.find("."+h).removeClass(h).addClass(m),r.removeClass(m).addClass(h)},_updateProgressWrapper:function(e){var r=this,s=r.options,t=r.wrapper.find("."+_),a=r._isStarted?r._animation.duration:0,n={};0===t.length&&r._addRegularProgressWrapper(),n[r._progressProperty]=e+"%",r.progressWrapper.animate(n,{duration:a,start:b(r._onProgressAnimateStart,r),progress:b(r._onProgressAnimate,r),complete:b(r._onProgressAnimateComplete,r,s.value),always:b(r._onProgressUpdateAlways,r,s.value)})},_onProgressAnimateStart:function(){this.progressWrapper.show()},_onProgressAnimate:function(e){var r,s=this,t=s.options,a=parseFloat(e.elem.style[s._progressProperty],10);t.showStatus&&(r=1e4/parseFloat(s.progressWrapper[0].style[s._progressProperty]),s.progressWrapper.find(".k-progress-status-wrap").css(s._progressProperty,r+"%")),t.type!==P.CHUNK&&98>=a&&s.progressWrapper.removeClass(v)},_onProgressAnimateComplete:function(e){var r,s=this,t=s.options,a=parseFloat(s.progressWrapper[0].style[s._progressProperty]);t.type!==P.CHUNK&&a>98&&s.progressWrapper.addClass(v),t.showStatus&&(r=t.type===P.VALUE?e:t.type==P.PERCENT?s._calculatePercentage(e).toFixed()+"%":S.floor(s._calculatePercentage(e))+"%",s.progressStatus.text(r)),e===t.min&&s.progressWrapper.hide()},_onProgressUpdateAlways:function(e){var r=this,s=r.options;r._isStarted&&r.trigger(C,{value:e}),e===s.max&&r._isStarted&&r.trigger(w,{value:s.max})},enable:function(e){var s=this,t=s.options;t.enable=r===e?!0:e,s.wrapper.toggleClass(k,!t.enable)},destroy:function(){var e=this;a.fn.destroy.call(e)},_addChunkProgressWrapper:function(){var e,r=this,s=r.options,t=r.wrapper,a=A/s.chunkCount,n="";for(1>=s.chunkCount&&(s.chunkCount=1),n+="<ul class='k-reset'>",e=s.chunkCount-1;e>=0;e--)n+="<li class='k-item k-state-default'></li>";n+="</ul>",t.append(n).find(".k-item").css(r._progressProperty,a+"%").first().addClass("k-first").end().last().addClass("k-last"),r._normalizeChunkSize()},_normalizeChunkSize:function(){var e=this,r=e.options,s=e.wrapper.find(".k-item:last"),t=parseFloat(s[0].style[e._progressProperty]),a=A-r.chunkCount*t;a>0&&s.css(e._progressProperty,t+a+"%")},_addRegularProgressWrapper:function(){var r=this;r.progressWrapper=e("<div class='"+_+"'></div>").appendTo(r.wrapper),r.options.showStatus&&(r.progressWrapper.append(N.progressStatus),r.progressStatus=r.wrapper.find("."+f))},_calculateChunkSize:function(){var e=this,r=e.options.chunkCount,s=e.wrapper.find("ul.k-reset");return(parseInt(s.css(e._progressProperty),10)-(r-1))/r},_calculatePercentage:function(e){var s=this,t=s.options,a=e!==r?e:t.value,n=t.min,o=t.max;return s._onePercent=S.abs((o-n)/100),S.abs((a-n)/s._onePercent)},_progressAnimation:function(){var e=this,r=e.options,s=r.animation;e._animation=s===!1?{duration:0}:W({duration:x},r.animation)}});s.ui.plugin(V)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,r,s){(s||r)()});;!function(e,define){define("kendo.columnsorter.min",["kendo.core.min"],e)}(function(){return function(e,n){var r=window.kendo,t=r.ui,o=t.Widget,i="dir",a="asc",l="single",d="field",s="desc",c=".kendoColumnSorter",f=".k-link",u="aria-sort",k=e.proxy,m=o.extend({init:function(e,n){var r,t=this;o.fn.init.call(t,e,n),t._refreshHandler=k(t.refresh,t),t.dataSource=t.options.dataSource.bind("change",t._refreshHandler),r=t.element.find(f),r[0]||(r=t.element.wrapInner('<a class="k-link" href="#"/>').find(f)),t.link=r,t.element.on("click"+c,k(t._click,t))},options:{name:"ColumnSorter",mode:l,allowUnsort:!0,compare:null,filter:""},destroy:function(){var e=this;o.fn.destroy.call(e),e.element.off(c),e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=e.element=e.link=e.dataSource=null},refresh:function(){var n,t,o,l,c=this,f=c.dataSource.sort()||[],k=c.element,m=k.attr(r.attr(d));for(k.removeAttr(r.attr(i)),k.removeAttr(u),n=0,t=f.length;t>n;n++)o=f[n],m==o.field&&k.attr(r.attr(i),o.dir);l=k.attr(r.attr(i)),k.find(".k-i-arrow-n,.k-i-arrow-s").remove(),l===a?(e('<span class="k-icon k-i-arrow-n" />').appendTo(c.link),k.attr(u,"ascending")):l===s&&(e('<span class="k-icon k-i-arrow-s" />').appendTo(c.link),k.attr(u,"descending"))},_click:function(e){var t,o,c=this,f=c.element,u=f.attr(r.attr(d)),k=f.attr(r.attr(i)),m=c.options,p=null===c.options.compare?n:c.options.compare,h=c.dataSource.sort()||[];if(e.preventDefault(),!m.filter||f.is(m.filter)){if(k=k===a?s:k===s&&m.allowUnsort?n:a,m.mode===l)h=[{field:u,dir:k,compare:p}];else if("multiple"===m.mode){for(t=0,o=h.length;o>t;t++)if(h[t].field===u){h.splice(t,1);break}h.push({field:u,dir:k,compare:p})}this.dataSource.sort(h)}}});t.plugin(m)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,r){(r||n)()});;!function(e,define){define("util/main.min",["kendo.core.min"],e)}(function(){return function(){function e(e){return typeof e!==E}function t(e,t){var n=r(t);return z.round(e*n)/n}function r(e){return e?z.pow(10,e):1}function n(e,t,r){return z.max(z.min(e,r),t)}function o(e){return e*q}function l(e){return e/q}function a(e){return"number"==typeof e&&!isNaN(e)}function i(t,r){return e(t)?t:r}function s(e){return e*e}function d(e){var t,r=[];for(t in e)r.push(t+e[t]);return r.sort().join("")}function c(e){var t,r=2166136261;for(t=0;e.length>t;++t)r+=(r<<1)+(r<<4)+(r<<7)+(r<<8)+(r<<24),r^=e.charCodeAt(t);return r>>>0}function u(e){return c(d(e))}function h(e){var t,r=e.length,n=M,o=W;for(t=0;r>t;t++)o=z.max(o,e[t]),n=z.min(n,e[t]);return{min:n,max:o}}function p(e){return h(e).min}function f(e){return h(e).max}function g(e){return k(e).min}function m(e){return k(e).max}function k(e){var t,r,n,o=M,l=W;for(t=0,r=e.length;r>t;t++)n=e[t],null!==n&&isFinite(n)&&(o=z.min(o,n),l=z.max(l,n));return{min:o===M?void 0:o,max:l===W?void 0:l}}function b(e){return e?e[e.length-1]:void 0}function _(e,t){return e.push.apply(e,t),e}function v(e){return D.template(e,{useWithBlock:!1,paramName:"d"})}function w(t,r){return e(r)&&null!==r?" "+t+"='"+r+"' ":""}function C(e){var t,r="";for(t=0;e.length>t;t++)r+=w(e[t][0],e[t][1]);return r}function y(t){var r,n,o="";for(r=0;t.length>r;r++)n=t[r][1],e(n)&&(o+=t[r][0]+":"+n+";");return""!==o?o:void 0}function T(e){return"string"!=typeof e&&(e+="px"),e}function x(e){var t,r,n=[];if(e)for(t=D.toHyphens(e).split("-"),r=0;t.length>r;r++)n.push("k-pos-"+t[r]);return n.join(" ")}function S(t){return""===t||null===t||"none"===t||"transparent"===t||!e(t)}function H(e){for(var t={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},r=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],n="";e>0;)r[0]>e?r.shift():(n+=t[r[0]],e-=r[0]);return n}function R(e){var t,r,n,o,l;for(e=e.toLowerCase(),t={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},r=0,n=0,o=0;e.length>o;++o){if(l=t[e.charAt(o)],!l)return null;r+=l,l>n&&(r-=2*n),n=l}return r}function I(e){var t=Object.create(null);return function(){var r,n="";for(r=arguments.length;--r>=0;)n+=":"+arguments[r];return n in t?t[n]:e.apply(this,arguments)}}function A(e){for(var t,r,n=[],o=0,l=e.length;l>o;)t=e.charCodeAt(o++),t>=55296&&56319>=t&&l>o?(r=e.charCodeAt(o++),56320==(64512&r)?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--)):n.push(t);return n}function L(e){return e.map(function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)}).join("")}var z=Math,D=window.kendo,F=D.deepExtend,q=z.PI/180,M=Number.MAX_VALUE,W=-Number.MAX_VALUE,E="undefined",N=Date.now;N||(N=function(){return(new Date).getTime()}),F(D,{util:{MAX_NUM:M,MIN_NUM:W,append:_,arrayLimits:h,arrayMin:p,arrayMax:f,defined:e,deg:l,hashKey:c,hashObject:u,isNumber:a,isTransparent:S,last:b,limitValue:n,now:N,objectKey:d,round:t,rad:o,renderAttr:w,renderAllAttr:C,renderPos:x,renderSize:T,renderStyle:y,renderTemplate:v,sparseArrayLimits:k,sparseArrayMin:g,sparseArrayMax:m,sqr:s,valueOrDefault:i,romanToArabic:R,arabicToRoman:H,memoize:I,ucs2encode:L,ucs2decode:A}}),D.drawing.util=D.util,D.dataviz.util=D.util}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,r){(r||t)()}),function(e,define){define("util/text-metrics.min",["kendo.core.min","util/main.min"],e)}(function(){!function(e){function t(){return{width:0,height:0,baseline:0}}function r(e,t,r){return u.current.measure(e,t,r)}function n(e,t){var r=[];if(e.length>0&&document.fonts){try{r=e.map(function(e){return document.fonts.load(e)})}catch(n){l.logToConsole(n)}Promise.all(r).then(t,t)}else t()}var o=document,l=window.kendo,a=l.Class,i=l.util,s=i.defined,d=a.extend({init:function(e){this._size=e,this._length=0,this._map={}},put:function(e,t){var r=this,n=r._map,o={key:e,value:t};n[e]=o,r._head?(r._tail.newer=o,o.older=r._tail,r._tail=o):r._head=r._tail=o,r._length>=r._size?(n[r._head.key]=null,r._head=r._head.newer,r._head.older=null):r._length++},get:function(e){var t=this,r=t._map[e];return r?(r===t._head&&r!==t._tail&&(t._head=r.newer,t._head.older=null),r!==t._tail&&(r.older&&(r.older.newer=r.newer,r.newer.older=r.older),r.older=t._tail,r.newer=null,t._tail.newer=r,t._tail=r),r.value):void 0}}),c=e("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: nowrap!important;' />")[0],u=a.extend({init:function(e){this._cache=new d(1e3),this._initOptions(e)},options:{baselineMarkerSize:1},measure:function(r,n,l){var a,d,u,h,p,f,g,m;if(!r)return t();if(a=i.objectKey(n),d=i.hashKey(r+a),u=this._cache.get(d),u)return u;h=t(),p=l?l:c,f=this._baselineMarker().cloneNode(!1);for(g in n)m=n[g],s(m)&&(p.style[g]=m);return e(p).text(r),p.appendChild(f),o.body.appendChild(p),(r+"").length&&(h.width=p.offsetWidth-this.options.baselineMarkerSize,h.height=p.offsetHeight,h.baseline=f.offsetTop+this.options.baselineMarkerSize),h.width>0&&h.height>0&&this._cache.put(d,h),p.parentNode.removeChild(p),h},_baselineMarker:function(){return e("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;' />")[0]}});u.current=new u,l.util.TextMetrics=u,l.util.LRUCache=d,l.util.loadFonts=n,l.util.measureText=r}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,r){(r||t)()}),function(e,define){define("util/base64.min",["util/main.min"],e)}(function(){return function(){function e(e){var r,n,o,a,i,s,d,c="",u=0;for(e=t(e);e.length>u;)r=e.charCodeAt(u++),n=e.charCodeAt(u++),o=e.charCodeAt(u++),a=r>>2,i=(3&r)<<4|n>>4,s=(15&n)<<2|o>>6,d=63&o,isNaN(n)?s=d=64:isNaN(o)&&(d=64),c=c+l.charAt(a)+l.charAt(i)+l.charAt(s)+l.charAt(d);return c}function t(e){var t,r,n="";for(t=0;e.length>t;t++)r=e.charCodeAt(t),128>r?n+=o(r):2048>r?(n+=o(192|r>>>6),n+=o(128|63&r)):65536>r&&(n+=o(224|r>>>12),n+=o(128|r>>>6&63),n+=o(128|63&r));return n}var r=window.kendo,n=r.deepExtend,o=String.fromCharCode,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n(r.util,{encodeBase64:e,encodeUTF8:t})}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,r){(r||t)()}),function(e,define){define("mixins/observers.min",["kendo.core.min"],e)}(function(){return function(e){var t=Math,r=window.kendo,n=r.deepExtend,o=e.inArray,l={observers:function(){return this._observers=this._observers||[]},addObserver:function(e){return this._observers?this._observers.push(e):this._observers=[e],this},removeObserver:function(e){var t=this.observers(),r=o(e,t);return-1!=r&&t.splice(r,1),this},trigger:function(e,t){var r,n,o=this._observers;if(o&&!this._suspended)for(n=0;o.length>n;n++)r=o[n],r[e]&&r[e](t);return this},optionsChange:function(e){this.trigger("optionsChange",e)},geometryChange:function(e){this.trigger("geometryChange",e)},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=t.max((this._suspended||0)-1,0),this},_observerField:function(e,t){this[e]&&this[e].removeObserver(this),this[e]=t,t.addObserver(this)}};n(r,{mixins:{ObserversMixin:l}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,r){(r||t)()}),function(e,define){define("kendo.grid.min",["kendo.data.min","kendo.columnsorter.min","kendo.editable.min","kendo.window.min","kendo.filtermenu.min","kendo.columnmenu.min","kendo.groupable.min","kendo.pager.min","kendo.selectable.min","kendo.sortable.min","kendo.reorderable.min","kendo.resizable.min","kendo.mobile.actionsheet.min","kendo.mobile.pane.min","kendo.ooxml.min","kendo.excel.min","kendo.progressbar.min","kendo.pdf.min"],e)}(function(){return function(e,t){function r(e){return Array(e+1).join('<td class="k-group-cell">&nbsp;</td>')}function n(e){var t,r=" ";if(e){if(typeof e===dt)return e;for(t in e)r+=t+'="'+e[t]+'"'}return r}function o(t,r){e("th, th .k-grid-filter, th .k-link",t).add(document.body).css("cursor",r)}function l(t,r,n,o,l){var a,i=r;for(r=e(),l=l||1,a=0;l>a;a++)r=r.add(t.eq(i+a));"number"==typeof n?r[o?"insertBefore":"insertAfter"](t.eq(n)):r.appendTo(n)}function a(t,r,n){return e(t).add(r).find(n)}function i(e,t,r){var n,o,l,a;for(r=Ce(r)?r:[r],n=0,o=r.length;o>n;n++)l=r[n],be(l)&&l.click&&(a=l.name||l.text,t.on(lt+We,"a.k-grid-"+(a||"").replace(/\s/g,""),{commandName:a},xe(l.click,e)))}function s(e,t,r){return ve(e,function(e){var n,o;return e=typeof e===dt?{field:e}:e,(!p(e)||r)&&(e.attributes=j(e.attributes),e.footerAttributes=j(e.footerAttributes),e.headerAttributes=j(e.headerAttributes),n=!0),e.columns&&(e.columns=s(e.columns,t,n)),o=ue.guid(),e.headerAttributes=_e({id:o},e.headerAttributes),_e({encoded:t,hidden:n},e)})}function d(e,t){var r=[];return c(e,t,r),r[r.length-1]}function c(e,t,r){var n,o;for(r=r||[],n=0;t.length>n;n++){if(e===t[n])return!0;if(t[n].columns){if(o=r.length,r.push(t[n]),c(e,t[n].columns,r))return!0;r.splice(o,r.length-o)}}return!1}function u(e,t){var r=t?V:j;e.hidden=!t,e.attributes=r(e.attributes),e.footerAttributes=r(e.footerAttributes),e.headerAttributes=r(e.headerAttributes)}function h(){return"none"!==this.style.display}function p(e){return f([e]).length>0}function f(e){return we(e,function(e){var t=!e.hidden;return t&&e.columns&&(t=f(e.columns).length>0),t})}function g(t){return e(t).map(function(){return this.toArray()})}function m(e,t,r){var n=_(D(t)),o=_(F(t)),l=e.rowSpan;e.rowSpan=r?n>o?l-(n-o)||1:l+(o-n):n>o?l+(n-o):l-(o-n)||1}function k(t,r,n,o,l,a,i){var s,d,c=_(t),u=_([r]);c>u&&(s=Array(i+1).join('<th class="k-group-cell k-header" scope="col">&nbsp;</th>'),d=a.children(":not(.k-filter-row)"),e(Array(c-u+1).join("<tr>"+s+"</tr>")).insertAfter(d.last())),A(a,c-u),v(n,o,l,a)}function b(t,r,n){var o,l,a,i,s,d,c,u;for(n=n||0,a=r,r=E(r),i={},s=t.find(">tr:not(.k-filter-row)"),d=function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},c=0,u=r.length;u>c;c++)o=w(r[c],a),i[o.row]||(i[o.row]=s.eq(o.row).find(".k-header").filter(d)),l=i[o.row].eq(o.cell),l.attr(ue.attr("index"),n+c);return r.length}function _(e){var t,r,n=1,o=0;for(t=0;e.length>t;t++)e[t].columns&&(r=_(e[t].columns),r>o&&(o=r));return n+o}function v(t,r,n,o){var l,a,i=T(t[0],r),s=n.find(">tr:not(.k-filter-row):eq("+i.row+")>th.k-header"),d=e(),c=i.cell;for(l=0;t.length>l;l++)d=d.add(s.eq(c+l));for(o.find(">tr:not(.k-filter-row)").eq(i.row).append(d),a=[],l=0;t.length>l;l++)t[l].columns&&(a=a.concat(t[l].columns));a.length&&v(a,r,n,o)}function w(e,t,r,n){var o,l;for(r=r||0,n=n||{},n[r]=n[r]||0,l=0;t.length>l;l++){if(t[l]==e){o={cell:n[r],row:r};break}if(t[l].columns&&(o=w(e,t[l].columns,r+1,n)))break;n[r]++}return o}function C(e,t,r,n){var o,l=r.locked;do o=e[t],t+=n?1:-1;while(o&&t>-1&&e.length>t&&o!=r&&!o.columns&&o.locked==l);return o}function y(e,t,r,n){var o,l,a,i;return t.columns?(t=t.columns,t[n?0:t.length-1]):(o=d(t,e),l=o?o.columns:e,a=ye(t,l),0===a&&n?a++:a!=l.length-1||n?(a>0||0===a&&!n)&&(a+=n?-1:1):a--,i=ye(r,l),t=C(l,a,r,i>a),t&&t!=r&&t.columns?y(e,t,r,n):null)}function T(e,t,r,n){var o,l;for(r=r||0,n=n||{},n[r]=n[r]||0,l=0;t.length>l;l++){if(t[l]==e){o={cell:n[r],row:r};break}if(t[l].columns&&(o=T(e,t[l].columns,r+1,n)))break;t[l].hidden||n[r]++}return o}function x(e){var t=S(D(e));return t.concat(S(F(e)))}function S(e){var t,r=[],n=[];for(t=0;e.length>t;t++)r.push(e[t]),e[t].columns&&(n=n.concat(e[t].columns));return n.length&&(r=r.concat(S(n))),r}function H(e){var t,r,n=0;for(r=0;e.length>r;r++)t=e[r],t.columns?n+=H(t.columns):t.hidden&&n++;return n}function R(e){var t,r,n,o=0;for(r=0,n=e.length;n>r;r++)t=e[r].style.width,t&&-1==t.indexOf("%")&&(o+=parseInt(t,10));return o}function I(e,t){var r,n,o=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(n=0;o.length>n;n++)r=o[n].rowSpan,r>1&&(o[n].rowSpan=r-t||1)}function A(e,t){var r,n=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(r=0;n.length>r;r++)n[r].rowSpan+=t}function L(t){var r,n=t.find("tr:not(.k-filter-row)"),o=n.filter(function(){return!e(this).children().length}).remove().length,l=n.find("th:not(.k-group-cell,.k-hierarchy-cell)");for(r=0;l.length>r;r++)l[r].rowSpan>1&&(l[r].rowSpan-=o);return n.length-o}function z(e,t,r,n,o){var l,a,i,s=[];for(l=0,i=e.length;i>l;l++)a=r[n]||[],a.push(t.eq(o+l)),r[n]=a,e[l].columns&&(s=s.concat(e[l].columns));s.length&&z(s,t,r,n+1,o+e.length)}function D(e){return we(e,function(e){return e.locked})}function F(e){return we(e,function(e){return!e.locked})}function q(e){return we(e,function(e){return!e.locked&&p(e)})}function M(e){return we(e,function(e){return e.locked&&p(e)})}function W(e){var t,r=[];for(t=0;e.length>t;t++)e[t].hidden||(e[t].columns?r=r.concat(W(e[t].columns)):r.push(e[t]));return r}function E(e){var t,r=[];for(t=0;e.length>t;t++)e[t].columns?r=r.concat(E(e[t].columns)):r.push(e[t]);return r}function N(r){var n,o=r.find(">tr:not(.k-filter-row)"),l=function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},a=e();return o.length>1&&(a=o.find("th").filter(l).filter(function(){return this.rowSpan>1})),a=a.add(o.last().find("th").filter(l)),n=ue.attr("index"),a.sort(function(r,o){var l,a;return r=e(r),o=e(o),l=r.attr(n),a=o.attr(n),l===t&&(l=e(r).index()),a===t&&(a=e(o).index()),l=parseInt(l,10),a=parseInt(a,10),l>a?1:a>l?-1:0}),a}function B(t){var r,n,o,l,a,i,s,d=t.closest("table"),c=e().add(t),u=t.closest("tr"),h=d.find("tr:not(.k-filter-row)"),p=h.index(u);if(p>0){for(r=h.eq(p-1),n=r.find("th:not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return!e(this).attr("rowspan")}),o=0,l=u.find("th:not(.k-group-cell,.k-hierarchy-cell)").index(t),a=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return this.colSpan>1}),i=0;a.length>i;i++)o+=a[i].colSpan||1;for(l+=Math.max(o-1,0),o=0,i=0;n.length>i;i++)if(s=n.eq(i),o+=s.attr("colSpan")?s[0].colSpan:1,l>=i&&o>l){c=B(s).add(c);break}}return c}function P(t){var r,n,o,l,a,i,s,d=t.closest("thead"),c=e().add(t),u=t.closest("tr"),h=d.find("tr:not(.k-filter-row)"),p=h.index(u)+t[0].rowSpan,f=ue.attr("colspan");if(h.length-1>=p){for(r=u.next(),n=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)"),n=n.filter(function(){return!this.rowSpan||1===this.rowSpan}),l=0,o=0;n.length>o;o++)l+=parseInt(n.eq(o).attr(f),10)||1;for(a=r.find("th:not(.k-group-cell,.k-hierarchy-cell)"),i=parseInt(t.attr(f),10)||1,o=0;i>o;)r=a.eq(o+l),c=c.add(P(r)),s=parseInt(r.attr(f),10),s>1&&(i-=s-1),o++}return c}function O(t,r,n,o){var l,a=t;return o&&t.empty(),fe?t[0].innerHTML=n:(l=document.createElement("div"),l.innerHTML="<table><tbody>"+n+"</tbody></table>",t=l.firstChild.firstChild,r[0].replaceChild(t,a[0]),t=e(t)),t}function j(e){e=e||{};var t=e.style;return t?(t=t.replace(/((.*)?display)(.*)?:([^;]*)/i,"$1:none"),t===e.style&&(t=t.replace(/(.*)?/i,"display:none;$1"))):t="display:none",_e({},e,{style:t})}function V(e){e=e||{};var t=e.style;return t&&(e.style=t.replace(/(display\s*:\s*none\s*;?)*/gi,"")),e}function U(t,r,n,o){var l,a=t.find(">colgroup"),i=ve(r,function(e){return l=e.width,l&&0!==parseInt(l,10)?ue.format('<col style="width:{0}"/>',typeof l===dt?l:l+"px"):"<col />"});(n||a.find(".k-hierarchy-col").length)&&i.splice(0,0,'<col class="k-hierarchy-col" />'),a.length&&a.remove(),a=e(Array(o+1).join('<col class="k-group-col">')+i.join("")),a.is("colgroup")||(a=e("<colgroup/>").append(a)),t.prepend(a),wt.msie&&8==wt.version&&(t.css("display","inline-table"),window.setTimeout(function(){t.css("display","")},1))}function G(e,t){var r,n,o=0,l=e.find("th:not(.k-group-cell)");for(r=0,n=t.length;n>r;r++)t[r].locked&&(l.eq(r).insertBefore(l.eq(o)),l=e.find("th:not(.k-group-cell)"),o++)}function K(e){var t,r,n,o={};for(r=0,n=e.length;n>r;r++)t=e[r],o[t.value]=t.text;return o}function $(e,t,r,n){var o=r&&r.length&&be(r[0])&&"value"in r[0],l=o?K(r)[e]:e;return l=null!=l?l:"",t?ue.format(t,l):n===!1?l:ue.htmlEncode(l)}function Q(e,t,r){for(var n,o=0,l=e[o];l;){if(n=r?!0:"none"!==l.style.display,n&&!kt.test(l.className)&&--t<0){l.style.display=r?"":"none";break}l=e[++o]}}function X(t,r){for(var n,o,l=0,a=t.length;a>l;l+=1)o=t.eq(l),o.is(".k-grouping-row,.k-detail-row")?(n=o.children(":not(.k-group-cell):first,.k-detail-cell").last(),n.attr("colspan",parseInt(n.attr("colspan"),10)-1)):(o.hasClass("k-grid-edit-row")&&(n=o.children(".k-edit-container")[0])&&(n=e(n),n.attr("colspan",parseInt(n.attr("colspan"),10)-1),n.find("col").eq(r).remove(),o=n.find("tr:first")),Q(o[0].cells,r,!1))}function J(e){var t,r,n=[];for(r=0;e.length>r&&(t=e[r],"field"in t&&"value"in t&&"items"in t);r++)n.push(t),t.hasSubgroups&&(n=n.concat(J(t.items)));return n}function Y(e){var t,r,n=[];for(r=0;e.length>r&&(t=e[r],"field"in t&&"value"in t&&"items"in t);r++)t.hasSubgroups&&(n=n.concat(Y(t.items))),n.push(t.aggregates);return n}function Z(t,r){for(var n,o,l,a=0,i=t.length;i>a;a+=1)o=t.eq(a),o.is(".k-grouping-row,.k-detail-row")?(n=o.children(":not(.k-group-cell):first,.k-detail-cell").last(),n.attr("colspan",parseInt(n.attr("colspan"),10)+1)):(o.hasClass("k-grid-edit-row")&&(n=o.children(".k-edit-container")[0])&&(n=e(n),n.attr("colspan",parseInt(n.attr("colspan"),10)+1),U(n.find(">form>table"),f(l),!1,0),o=n.find("tr:first")),Q(o[0].cells,r,!0))}function ee(e,t,r){r=r||1;var n,o,l;for(o=0,l=e.length;l>o;o++)n=e.eq(o).children().last(),n.attr("colspan",parseInt(n.attr("colspan"),10)+r),n=t.eq(o).children().last(),n.attr("colspan",parseInt(n.attr("colspan"),10)-r)}function te(e){var t,r,n=0,o=e.find(">colgroup>col");for(t=0,r=o.length;r>t;t+=1)n+=parseInt(o[t].style.width,10);return n}function re(e,t){var r,n,o,l;e=e[0],t=t[0],e.rows.length!==t.rows.length&&(r=e.offsetHeight,n=t.offsetHeight,r>n?(o=t.rows[t.rows.length-1],bt.test(o.className)&&(o=t.rows[t.rows.length-2]),l=r-n):(o=e.rows[e.rows.length-1],bt.test(o.className)&&(o=e.rows[e.rows.length-2]),l=n-r),o.style.height=o.offsetHeight+l+"px")}function ne(e,t){var r,n=e.offsetHeight,o=t.offsetHeight;n>o?r=n+"px":o>n&&(r=o+"px"),r&&(e.style.height=t.style.height=r)}function oe(e,t){var r,n,o;if(typeof e===dt&&e===t)return e;if(be(e)&&e.name===t)return e;if(Ce(e))for(r=0,n=e.length;n>r;r++)if(o=e[r],typeof o===dt&&o===t||o.name===t)return o;return null}function le(t,r){var n,o,l=wt.msie||wt.edge;if(r===!0){if(t=e(t),n=t.parent().scrollTop(),o=t.parent().scrollLeft(),l)try{t[0].setActive()}catch(a){t[0].focus()}else t[0].focus();t.parent().scrollTop(n).scrollLeft(o)}else e(t).one("focusin",function(e){e.preventDefault()}).focus()}function ae(t){return e(t).is(":button,a,:input,a>.k-icon,textarea,span.k-select,span.k-icon,span.k-link,.k-input,.k-multiselect-wrap,.k-tool-icon")}function ie(r){var n=e(r.currentTarget),o=n.is("th"),l=this.table.add(this.lockedTable),a=this.thead.parent().add(e(">table",this.lockedHeader)),i=ae(r.target),s=n.closest("table")[0];if(!ue.support.touch)return i&&n.find(ue.roleSelector("filtercell")).length?(this._setCurrent(n),t):((s===l[0]||s===l[1]||s===a[0]||s===a[1])&&(e(r.target).is("a.k-i-collapse, a.k-i-expand")||(this.options.navigatable&&this._setCurrent(n),(o||!i)&&setTimeout(function(){yt&&e(ue._activeElement()).hasClass("k-widget")||ae(ue._activeElement())||le(s,!0)}),o&&r.preventDefault())),t)}function se(e){return e&&(e.hasClass("k-edit-cell")||e.parent().hasClass("k-grid-edit-row"))}function de(e,t,n){return'<tr role="row" class="k-grouping-row">'+r(t)+'<td colspan="'+e+'" aria-expanded="true"><p class="k-reset"><a class="k-icon k-i-collapse" href="#" tabindex="-1"></a>'+n+"</p></td></tr>"}function ce(e){return'<tr role="row" class="k-grouping-row"><td colspan="'+e+'" aria-expanded="true"><p class="k-reset">&nbsp;</p></td></tr>'}var ue=window.kendo,he=ue.ui,pe=ue.data.DataSource,fe=ue.support.tbodyInnerHtml,ge=ue._activeElement,me=he.Widget,ke=ue.keys,be=e.isPlainObject,_e=e.extend,ve=e.map,we=e.grep,Ce=e.isArray,ye=e.inArray,Te=Array.prototype.push,xe=e.proxy,Se=ue.isFunction,He=e.isEmptyObject,Re=Math,Ie="progress",Ae="error",Le=":not(.k-group-cell):not(.k-hierarchy-cell):visible",ze="tbody>tr:not(.k-grouping-row):not(.k-detail-row):not(.k-group-footer) > td:not(.k-group-cell):not(.k-hierarchy-cell)",De="tr:not(.k-footer-template):visible",Fe=":not(.k-group-cell):not(.k-hierarchy-cell):visible",qe=De+":first>"+Fe+":first",Me="th.k-header:not(.k-group-cell):not(.k-hierarchy-cell)",We=".kendoGrid",Ee="edit",Ne="save",Be="remove",Pe="detailInit",Oe="filterMenuInit",je="columnMenuInit",Ve="change",Ue="columnHide",Ge="columnShow",Ke="saveChanges",$e="dataBound",Qe="detailExpand",Xe="detailCollapse",Je="k-state-focused",Ye="k-state-selected",Ze="k-grid-norecords",et="columnResize",tt="columnReorder",rt="columnLock",nt="columnUnlock",ot="navigate",lt="click",at="height",it="tabIndex",st="function",dt="string",ct="Are you sure you want to delete this record?",ut="No records available.",ht="Delete",pt="Cancel",ft=/(\}|\#)/gi,gt=/#/gi,mt="[\\x20\\t\\r\\n\\f]",kt=RegExp("(^|"+mt+")(k-group-cell|k-hierarchy-cell)("+mt+"|$)"),bt=RegExp("(^|"+mt+")(k-filter-row)("+mt+"|$)"),_t='<a class="k-button k-button-icontext #=className#" #=attr# href="\\#"><span class="#=iconClass# #=imageClass#"></span>#=text#</a>',vt=!1,wt=ue.support.browser,Ct=wt.msie&&7==wt.version,yt=wt.msie&&8==wt.version,Tt=me.extend({init:function(e,t){var r=this;me.fn.init.call(r,e,t),r._refreshHandler=xe(r.refresh,r),r.setDataSource(t.dataSource),r.wrap()},setDataSource:function(e){var t=this;t.dataSource&&t.dataSource.unbind(Ve,t._refreshHandler),t.dataSource=e,t.dataSource.bind(Ve,t._refreshHandler)},options:{name:"VirtualScrollable",itemHeight:e.noop,prefetch:!0},destroy:function(){var e=this;me.fn.destroy.call(e),e.dataSource.unbind(Ve,e._refreshHandler),e.wrapper.add(e.verticalScrollbar).off(We),e.drag&&(e.drag.destroy(),e.drag=null),e.wrapper=e.element=e.verticalScrollbar=null,e._refreshHandler=null},wrap:function(){var t,r=this,n=ue.support.scrollbar()+1,o=r.element;o.css({width:"auto",overflow:"hidden"}).css(vt?"padding-left":"padding-right",n),r.content=o.children().first(),t=r.wrapper=r.content.wrap('<div class="k-virtual-scrollable-wrap"/>').parent().bind("DOMMouseScroll"+We+" mousewheel"+We,xe(r._wheelScroll,r)),ue.support.kineticScrollNeeded&&(r.drag=new ue.UserEvents(r.wrapper,{global:!0,start:function(e){e.sender.capture()},move:function(e){r.verticalScrollbar.scrollTop(r.verticalScrollbar.scrollTop()-e.y.delta),t.scrollLeft(t.scrollLeft()-e.x.delta),e.preventDefault()}})),r.verticalScrollbar=e('<div class="k-scrollbar k-scrollbar-vertical" />').css({width:n}).appendTo(o).bind("scroll"+We,xe(r._scroll,r))},_wheelScroll:function(t){if(!t.ctrlKey){var r=this.verticalScrollbar,n=r.scrollTop(),o=ue.wheelDeltaY(t);!o||o>0&&0===n||0>o&&n+r[0].clientHeight==r[0].scrollHeight||(t.preventDefault(),e(t.currentTarget).one("wheel"+We,!1),this.verticalScrollbar.scrollTop(n+-o))}},_scroll:function(e){var t=this,r=!t.options.prefetch,n=e.currentTarget.scrollTop,o=t.dataSource,l=t.itemHeight,a=o.skip()||0,i=t._rangeStart||a,s=t.element.innerHeight(),d=!!(t._scrollbarTop&&t._scrollbarTop>n),c=Re.max(Re.floor(n/l),0),u=Re.max(c+Re.floor(s/l),0);t._scrollTop=n-i*l,t._scrollbarTop=n,t._scrolling=r,t._fetch(c,u,d)||(t.wrapper[0].scrollTop=t._scrollTop),r&&(t._scrollingTimeout&&clearTimeout(t._scrollingTimeout),t._scrollingTimeout=setTimeout(function(){t._scrolling=!1,t._page(t._rangeStart,t.dataSource.take())},100))},itemIndex:function(e){var t=this._rangeStart||this.dataSource.skip()||0;return t+e},position:function(e){var t,r=this._rangeStart||this.dataSource.skip()||0,n=this.dataSource.pageSize();return t=e>r?e-r+1:r-e-1,t>n?n:t},scrollIntoView:function(e){var t=this.wrapper[0],r=t.clientHeight,n=this._scrollTop||t.scrollTop,o=e[0].offsetTop,l=e[0].offsetHeight;n>o?this.verticalScrollbar[0].scrollTop-=r/2:o+l>=n+r&&(this.verticalScrollbar[0].scrollTop+=r/2)},_fetch:function(t,r,n){var o=this,l=o.dataSource,a=o.itemHeight,i=l.take(),s=o._rangeStart||l.skip()||0,d=Re.floor(t/i)*i,c=!1,u=.33;return s>t?(c=!0,s=Re.max(0,r-i),o._scrollTop=(t-s)*a,o._page(s,i)):r>=s+i&&!n?(c=!0,s=t,o._scrollTop=a,o._page(s,i)):!o._fetching&&o.options.prefetch&&(d+i-i*u>t&&t>i&&l.prefetch(d-i,i,e.noop),r>d+i*u&&l.prefetch(d+i,i,e.noop)),c},fetching:function(){return this._fetching},_page:function(e,t){var r=this,n=!r.options.prefetch,o=r.dataSource;clearTimeout(r._timeout),r._fetching=!0,r._rangeStart=e,o.inRange(e,t)?o.range(e,t):(n||ue.ui.progress(r.wrapper.parent(),!0),r._timeout=setTimeout(function(){r._scrolling||(n&&ue.ui.progress(r.wrapper.parent(),!0),o.range(e,t))},100))},repaintScrollbar:function(){var e,t=this,r="",n=25e4,o=t.dataSource,l=ue.support.kineticScrollNeeded?0:ue.support.scrollbar(),a=t.wrapper[0],i=t.itemHeight=t.options.itemHeight()||0,s=a.scrollWidth>a.offsetWidth?l:0,d=o.total()*i+s;for(e=0;e<Re.floor(d/n);e++)r+='<div style="width:1px;height:'+n+'px"></div>';d%n&&(r+='<div style="width:1px;height:'+d%n+'px"></div>'),t.verticalScrollbar.html(r),a.scrollTop=t._scrollTop},refresh:function(){var e=this,t=e.dataSource,r=e._rangeStart;ue.ui.progress(e.wrapper.parent(),!1),clearTimeout(e._timeout),e.repaintScrollbar(),e.drag&&e.drag.cancel(),r&&!e._fetching&&(e._rangeStart=t.skip(),1===t.page()&&(e.verticalScrollbar[0].scrollTop=0)),e._fetching=!1}}),xt={create:{text:"Add new record",imageClass:"k-add",className:"k-grid-add",iconClass:"k-icon"},cancel:{text:"Cancel changes",imageClass:"k-cancel",className:"k-grid-cancel-changes",iconClass:"k-icon"},save:{text:"Save changes",imageClass:"k-update",className:"k-grid-save-changes",iconClass:"k-icon"},destroy:{text:"Delete",imageClass:"k-delete",className:"k-grid-delete",iconClass:"k-icon"},edit:{text:"Edit",imageClass:"k-edit",className:"k-grid-edit",iconClass:"k-icon"},update:{text:"Update",imageClass:"k-update",className:"k-primary k-grid-update",iconClass:"k-icon"},canceledit:{text:"Cancel",imageClass:"k-cancel",className:"k-grid-cancel",iconClass:"k-icon"},excel:{text:"Export to Excel",imageClass:"k-i-excel",className:"k-grid-excel",iconClass:"k-icon"},pdf:{text:"Export to PDF",imageClass:"k-i-pdf",className:"k-grid-pdf",iconClass:"k-icon"}},St=ue.ui.DataBoundWidget.extend({init:function(t,r,n){var o=this;r=Ce(r)?{dataSource:r}:r,me.fn.init.call(o,t,r),n&&(o._events=n),vt=ue.support.isRtl(t),o._element(),o._aria(),o._columns(o.options.columns),o._dataSource(),o._tbody(),o._pageable(),o._thead(),o._groupable(),o._toolbar(),o._setContentHeight(),o._templates(),o._navigatable(),o._selectable(),o._clipboard(),o._details(),o._editable(),o._attachCustomCommandsEvent(),o._minScreenSupport(),o.options.autoBind?o.dataSource.fetch():(o._group=o._groups()>0,o._footer()),o.lockedContent&&(o.wrapper.addClass("k-grid-lockedcolumns"),o._resizeHandler=function(){o.resize()},e(window).on("resize"+We,o._resizeHandler)),ue.notify(o)},events:[Ve,"dataBinding","cancel",$e,Qe,Xe,Pe,Oe,je,Ee,Ne,Be,Ke,et,tt,Ge,Ue,rt,nt,ot],setDataSource:function(e){var t=this,r=t.options.scrollable;t.options.dataSource=e,t._dataSource(),t._pageable(),t._thead(),r&&(r.virtual?t.content.find(">.k-virtual-scrollable-wrap").scrollLeft(0):t.content.scrollLeft(0)),t.options.groupable&&t._groupable(),t.virtualScrollable&&t.virtualScrollable.setDataSource(t.options.dataSource),t.options.navigatable&&t._navigatable(),t.options.selectable&&t._selectable(),t.options.autoBind&&e.fetch()},options:{name:"Grid",columns:[],toolbar:null,autoBind:!0,filterable:!1,scrollable:!0,sortable:!1,selectable:!1,allowCopy:!1,navigatable:!1,pageable:!1,editable:!1,groupable:!1,rowTemplate:"",altRowTemplate:"",noRecords:!1,dataSource:{},height:null,resizable:!1,reorderable:!1,columnMenu:!1,detailTemplate:null,columnResizeHandleWidth:3,mobile:"",messages:{editable:{cancelDelete:pt,confirmation:ct,confirmDelete:ht},commands:{create:xt.create.text,cancel:xt.cancel.text,save:xt.save.text,destroy:xt.destroy.text,edit:xt.edit.text,update:xt.update.text,canceledit:xt.canceledit.text,excel:xt.excel.text,pdf:xt.pdf.text},noRecords:ut}},destroy:function(){var t,r=this;r._angularItems("cleanup"),r._destroyColumnAttachments(),me.fn.destroy.call(r),this._navigatableTables=null,r._resizeHandler&&e(window).off("resize"+We,r._resizeHandler),r.pager&&r.pager.element&&r.pager.destroy(),r.pager=null,r.groupable&&r.groupable.element&&r.groupable.element.kendoGroupable("destroy"),r.groupable=null,r.options.reorderable&&r.wrapper.data("kendoReorderable").destroy(),r.selectable&&r.selectable.element&&(r.selectable.destroy(),r.clearArea(),r.copyHandler&&(r.wrapper.off("keydown",r.copyHandler),r.unbind(r.copyHandler)),r.updateClipBoardState&&(r.unbind(r.updateClipBoardState),r.updateClipBoardState=null),r.clearAreaHandler&&r.wrapper.off("keyup",r.clearAreaHandler)),r.selectable=null,r.resizable&&(r.resizable.destroy(),r._resizeUserEvents&&(r._resizeHandleDocumentClickHandler&&e(document).off("click",r._resizeHandleDocumentClickHandler),r._resizeUserEvents.destroy(),r._resizeUserEvents=null),r.resizable=null),r.virtualScrollable&&r.virtualScrollable.element&&r.virtualScrollable.destroy(),r.virtualScrollable=null,r._destroyEditable(),r.dataSource&&(r.dataSource.unbind(Ve,r._refreshHandler).unbind(Ie,r._progressHandler).unbind(Ae,r._errorHandler),r._refreshHandler=r._progressHandler=r._errorHandler=null),t=r.element.add(r.wrapper).add(r.table).add(r.thead).add(r.wrapper.find(">.k-grid-toolbar")),r.content&&(t=t.add(r.content).add(r.content.find(">.k-virtual-scrollable-wrap"))),r.lockedHeader&&r._removeLockedContainers(),r.pane&&r.pane.destroy(),r.minScreenResizeHandler&&e(window).off("resize",r.minScreenResizeHandler),r._draggableInstance&&r._draggableInstance.element&&r._draggableInstance.destroy(),r._draggableInstance=null,t.off(We),ue.destroy(r.wrapper),r.rowTemplate=r.altRowTemplate=r.lockedRowTemplate=r.lockedAltRowTemplate=r.detailTemplate=r.footerTemplate=r.groupFooterTemplate=r.lockedGroupFooterTemplate=r.noRecordsTemplate=null,r.scrollables=r.thead=r.tbody=r.element=r.table=r.content=r.footer=r.wrapper=r.lockedTable=r.lockedContent=r.lockedHeader=r.lockedFooter=r._groupableClickHandler=r._setContentWidthHandler=null},getOptions:function(){var r,n,o,l=this.options;return l.dataSource=null,r=_e(!0,{},this.options),r.columns=ue.deepExtend([],this.columns),n=this.dataSource,o=n.options.data&&n._data,n.options.data=null,r.dataSource=e.extend(!0,{},n.options),n.options.data=o,r.dataSource.data=o,r.dataSource.page=n.page(),r.dataSource.filter=n.filter(),r.dataSource.pageSize=n.pageSize(),r.dataSource.sort=n.sort(),r.dataSource.group=n.group(),r.dataSource.aggregate=n.aggregate(),r.dataSource.transport&&(r.dataSource.transport.dataSource=null),r.pageable&&r.pageable.pageSize&&(r.pageable.pageSize=n.pageSize()),r.$angular=t,r},setOptions:function(e){var t,r,n,o,l=this.getOptions();ue.deepExtend(l,e),e.dataSource||(l.dataSource=this.dataSource),t=this.wrapper,r=this._events,n=this.element,this.destroy(),this.options=null,this._isMobile&&(o=t.closest(ue.roleSelector("pane")).parent(),o.after(t),o.remove(),t.removeClass("k-grid-mobile")),t[0]!==n[0]&&(t.before(n),t.remove()),n.empty(),this.init(n,l,r),this._setEvents(l)},items:function(){return this.lockedContent?this._items(this.tbody).add(this._items(this.lockedTable.children("tbody"))):this._items(this.tbody)},_items:function(t){return t.children().filter(function(){var t=e(this);return!t.hasClass("k-grouping-row")&&!t.hasClass("k-detail-row")&&!t.hasClass("k-group-footer")})},dataItems:function(){var e,t,r,n=ue.ui.DataBoundWidget.fn.dataItems.call(this);if(this.lockedContent){for(e=n.length,t=Array(2*e),r=e;--r>=0;)t[r]=t[r+e]=n[r];n=t}return n},_destroyColumnAttachments:function(){var t=this;t.resizeHandle=null,
t.thead&&(this.angular("cleanup",function(){return{elements:t.thead.get()}}),t.thead.add(t.lockedHeader).find("th").each(function(){var t=e(this),r=t.data("kendoFilterMenu"),n=t.data("kendoColumnSorter"),o=t.data("kendoColumnMenu");r&&r.destroy(),n&&n.destroy(),o&&o.destroy()}))},_attachCustomCommandsEvent:function(){var e,t,r,n=this,o=E(n.columns||[]);for(t=0,r=o.length;r>t;t++)e=o[t].command,e&&i(n,n.wrapper,e)},_aria:function(){var e=this.element.attr("id")||"aria";e&&(this._cellId=e+"_active_cell")},_element:function(){var t=this,r=t.element;r.is("table")||(r=t.options.scrollable?t.element.find("> .k-grid-content > table"):t.element.children("table"),r.length||(r=e("<table />").appendTo(t.element))),Ct&&r.attr("cellspacing",0),t.table=r.attr("role",t._hasDetails()?"treegrid":"grid"),t._wrapper()},_createResizeHandle:function(t,r){var n,o,l,a,i,s,d,c=this,u=c.options.columnResizeHandleWidth,h=c.options.scrollable,p=c.resizeHandle,f=this._groups();if(p&&c.lockedContent&&p.data("th")[0]!==r[0]&&(p.off(We).remove(),p=null),p||(p=c.resizeHandle=e('<div class="k-resize-handle"><div class="k-resize-handle-inner"></div></div>'),t.append(p)),vt)n=r.position().left,h&&(a=r.closest(".k-grid-header-wrap, .k-grid-header-locked"),i=wt.msie?a.scrollLeft():0,s=wt.webkit?a[0].scrollWidth-a[0].offsetWidth-a.scrollLeft():0,d=wt.mozilla?a[0].scrollWidth-a[0].offsetWidth-(a[0].scrollWidth-a[0].offsetWidth-a.scrollLeft()):0,n-=s-d+i);else{for(n=r[0].offsetWidth,o=N(r.closest("thead")).filter(":visible"),l=0;o.length>l&&o[l]!=r[0];l++)n+=o[l].offsetWidth;f>0&&(n+=t.find(".k-group-cell:first").outerWidth()*f),c._hasDetails()&&(n+=t.find(".k-hierarchy-cell:first").outerWidth())}p.css({top:r.position().top,left:n-u,height:r.outerHeight(),width:3*u}).data("th",r).show(),p.off("dblclick"+We).on("dblclick"+We,function(){c._autoFitLeafColumn(r.data("index"))})},_positionColumnResizeHandle:function(){var t=this,r=t.options.columnResizeHandleWidth,n=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t.thead.add(n).on("mousemove"+We,"th",function(n){var l,a,i,s=e(this);s.hasClass("k-group-cell")||s.hasClass("k-hierarchy-cell")||(l=n.clientX,a=e(window).scrollLeft(),i=s.offset().left+(vt?0:this.offsetWidth),l+a>i-r&&i+r>l+a?t._createResizeHandle(s.closest("div"),s):t.resizeHandle?t.resizeHandle.hide():o(t.wrapper,""))})},_resizeHandleDocumentClick:function(t){e(t.target).closest(".k-column-active").length||(e(document).off(t),this._hideResizeHandle())},_hideResizeHandle:function(){this.resizeHandle&&(this.resizeHandle.data("th").removeClass("k-column-active"),this.lockedContent&&!this._isMobile?(this.resizeHandle.off(We).remove(),this.resizeHandle=null):this.resizeHandle.hide())},_positionColumnResizeHandleTouch:function(){var t=this,r=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t._resizeUserEvents=new ue.UserEvents(r.add(t.thead),{filter:"th:not(.k-group-cell):not(.k-hierarchy-cell)",threshold:10,hold:function(r){var n=e(r.target);r.preventDefault(),n.addClass("k-column-active"),t._createResizeHandle(n.closest("div"),n),t._resizeHandleDocumentClickHandler||(t._resizeHandleDocumentClickHandler=xe(t._resizeHandleDocumentClick,t)),e(document).on("click",t._resizeHandleDocumentClickHandler)}})},_resizable:function(){var t,r,n,l,a,i,s,d=this,c=d.options,u=this._isMobile,h=ue.support.mobileOS?0:ue.support.scrollbar();c.resizable&&(t=c.scrollable?d.wrapper.find(".k-grid-header-wrap:first"):d.wrapper,u?d._positionColumnResizeHandleTouch(t):d._positionColumnResizeHandle(t),d.resizable&&d.resizable.destroy(),d.resizable=new he.Resizable(t.add(d.lockedHeader),{handle:(c.scrollable?"":">")+".k-resize-handle",hint:function(t){return e('<div class="k-grid-resize-indicator" />').css({height:t.data("th").outerHeight()+d.tbody.attr("clientHeight")})},start:function(t){var h,p,f,g;s=e(t.currentTarget).data("th"),u&&d._hideResizeHandle(),h=s.closest("table"),p=e.inArray(s[0],N(s.closest("thead")).filter(":visible")),a=h.parent().hasClass("k-grid-header-locked"),f=a?d.lockedTable:d.table,g=d.footer||e(),d.footer&&d.lockedContent&&(g=d.footer.children(a?".k-grid-footer-locked":".k-grid-footer-wrap")),o(d.wrapper,"col-resize"),i=c.scrollable?h.find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")").add(f.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")")).add(g.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")")):f.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")"),r=t.x.location,n=s.outerWidth(),l=a?f.children("tbody").outerWidth():d.tbody.outerWidth(),wt.webkit&&d.wrapper.addClass("k-grid-column-resizing")},resize:function(t){var o,u,p,f,g,m,k=vt?-1:1,b=n+t.x.location*k-r*k;c.scrollable?(a&&d.lockedFooter?o=d.lockedFooter.children("table"):d.footer&&(o=d.footer.find(">.k-grid-footer-wrap>table")),o&&o[0]||(o=e()),u=s.closest("table"),p=a?d.lockedTable:d.table,f=!1,g=d.wrapper.width()-h,m=b,a&&l-n+m>g&&(m=n+(g-l-2*h),0>m&&(m=b),f=!0),m>10&&(i.css("width",m),l&&(m=f?g-2*h:l+t.x.location*k-r*k,p.add(u).add(o).css("width",m),a||(d._footerWidth=m)))):b>10&&i.css("width",b)},resizeend:function(){var e,t,r,l=s.outerWidth();o(d.wrapper,""),wt.webkit&&d.wrapper.removeClass("k-grid-column-resizing"),n!=l&&(t=d.lockedHeader?d.lockedHeader.find("thead:first tr:first").add(d.thead.find("tr:first")):s.parent(),r=s.attr(ue.attr("index")),r||(r=t.find("th:not(.k-group-cell):not(.k-hierarchy-cell)").index(s)),e=E(d.columns)[r],e.width=l,d.trigger(et,{column:e,oldWidth:n,newWidth:l}),d._applyLockedContainersWidth(),d._syncLockedContentHeight(),d._syncLockedHeaderHeight()),d._hideResizeHandle(),s=null}}))},_draggable:function(){var t=this;t.options.reorderable&&(t._draggableInstance&&t._draggableInstance.destroy(),t._draggableInstance=t.wrapper.kendoDraggable({group:ue.guid(),autoScroll:!0,filter:t.content?".k-grid-header:first "+Me:"table:first>.k-grid-header "+Me,drag:function(){t._hideResizeHandle()},hint:function(t){return e('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(t.attr(ue.attr("title"))||t.attr(ue.attr("field"))||t.text()).prepend('<span class="k-icon k-drag-status k-denied" />')}}).data("kendoDraggable"))},_reorderable:function(){var t,r=this;r.options.reorderable&&(r.wrapper.data("kendoReorderable")&&r.wrapper.data("kendoReorderable").destroy(),t=function(e,t,n){var o=e[t],l=e[n],a=d(o,r.columns);return e=a?a.columns:r.columns,ye(l,e)},r.wrapper.kendoReorderable({draggable:r._draggableInstance,dragOverContainers:function(e,n){var o=x(r.columns);return o[e].lockable!==!1&&t(o,e,n)>-1},inSameContainer:function(n){return e(n.source).parent()[0]===e(n.target).parent()[0]&&t(x(r.columns),n.sourceIndex,n.targetIndex)>-1},change:function(e){var n=x(r.columns),o=n[e.oldIndex],l=t(n,e.oldIndex,e.newIndex);r.trigger(tt,{newIndex:l,oldIndex:ye(o,n),column:o}),r.reorderColumn(l,o,"before"===e.position)}}))},_reorderHeader:function(e,t,r){var n,o,i,s,d=this,c=w(e[0],d.columns),u=w(t,d.columns),h=[];for(n=0;e.length>n;n++)e[n].columns&&(h=h.concat(e[n].columns));o=a(d.lockedHeader,d.thead,"tr:eq("+c.row+")>th.k-header:not(.k-group-cell,.k-hierarchy-cell)"),i=D(e).length,s=D([t]).length,h.length?(i>0&&0===s?k(e,t,h,d.columns,d.lockedHeader.find("thead"),d.thead,this._groups()):0===i&&s>0&&k(e,t,h,d.columns,d.thead,d.lockedHeader.find("thead"),this._groups()),(t.columns||c.cell-u.cell>1||u.cell-c.cell>1)&&(t=y(d.columns,t,e[0],r),t&&d._reorderHeader(h,t,r))):i!==s&&m(o[c.cell],d.columns,i),l(o,c.cell,u.cell,r,e.length)},_reorderContent:function(t,r,n){var o,i,s,d,c=this,u=e(),h=t[0],p=f(t),g=ye(h,E(c.columns)),m=ye(r,E(c.columns)),k=ye(h,W(c.columns)),b=ye(r,W(c.columns)),_=D(c.columns).length,v=!!r.locked,w=c.footer||c.wrapper.find(".k-grid-footer"),C=o=b;for(r.hidden&&(v?(b=c.lockedTable.find("colgroup"),C=c.lockedHeader.find("colgroup"),o=e(c.lockedFooter).find(">table>colgroup")):(b=c.tbody.prev(),C=c.thead.prev(),o=w.find(".k-grid-footer-wrap").find(">table>colgroup"))),c._hasFilterRow()&&l(c.wrapper.find(".k-filter-row th:not(.k-group-cell,.k-hierarchy-cell)"),g,m,n,t.length),l(a(c.lockedHeader,c.thead.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),k,C,n,p.length),c.options.scrollable&&l(a(c.lockedTable,c.tbody.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),k,b,n,p.length),w&&w.length&&(l(a(c.lockedFooter,w.find(".k-grid-footer-wrap"),">table>colgroup>col:not(.k-group-col,.k-hierarchy-col)"),k,o,n,p.length),l(w.find(".k-footer-template>td:not(.k-group-cell,.k-hierarchy-cell)"),g,m,n,t.length)),i=c.tbody.children(":not(.k-grouping-row,.k-detail-row)"),c.lockedTable&&(_>m?g>=_&&ee(c.lockedTable.find(">tbody>tr.k-grouping-row"),c.table.find(">tbody>tr.k-grouping-row"),t.length):_>g&&ee(c.table.find(">tbody>tr.k-grouping-row"),c.lockedTable.find(">tbody>tr.k-grouping-row"),t.length),u=c.lockedTable.find(">tbody>tr:not(.k-grouping-row,.k-detail-row)")),s=0,d=i.length;d>s;s+=1)l(a(u[s],i[s],">td:not(.k-group-cell,.k-hierarchy-cell)"),g,m,n,t.length)},_autoFitLeafColumn:function(e){this.autoFitColumn(E(this.columns)[e])},autoFitColumn:function(t){var r,n,o,l,a,i,s,d,c,u,f,g,m,k,b,_,v,w=this,C=w.options,y=w.columns,T=w.lockedHeader?N(w.lockedHeader.find(">table>thead")).filter(h).length:0,x="col:not(.k-group-col):not(.k-hierarchy-col)",H="td:visible:not(.k-group-cell):not(.k-hierarchy-cell)";if(t="number"==typeof t?y[t]:be(t)?we(S(y),function(e){return e===t})[0]:we(S(y),function(e){return e.field===t})[0],t&&p(t)){for(r=ye(t,E(y)),l=t.locked,o=l?w.lockedHeader.children("table"):w.thead.parent(),n=o.find("[data-index='"+r+"']"),i=l?w.lockedTable:w.table,s=w.footer||e(),w.footer&&w.lockedContent&&(s=w.footer.children(l?".k-grid-footer-locked":".k-grid-footer-wrap")),d=s.find("table").first(),w.lockedHeader&&!l&&(r-=T),c=0;y.length>c&&y[c]!==t;c++)y[c].hidden&&r--;if(a=C.scrollable?o.find(x).eq(r).add(i.children("colgroup").find(x).eq(r)).add(d.find("colgroup").find(x).eq(r)):i.children("colgroup").find(x).eq(r),u=o.add(i).add(d),f=n.outerWidth(),a.width(""),u.css("table-layout","fixed"),a.width("auto"),u.addClass("k-autofitting"),u.css("table-layout",""),g=Math.ceil(Math.max(n.outerWidth(),i.find("tr:not(.k-grouping-row)").eq(0).children(H).eq(r).outerWidth(),d.find("tr").eq(0).children(H).eq(r).outerWidth()))+1,a.width(g),t.width=g,C.scrollable){for(m=o.find("col"),b=0,_=0,v=m.length;v>_;_+=1){if(k=m[_].style.width,!k||-1!=k.indexOf("%")){b=0;break}b+=parseInt(k,10)}b&&u.each(function(){this.style.width=b+"px"})}wt.msie&&8==wt.version&&(u.css("display","inline-table"),setTimeout(function(){u.css("display","table")},1)),u.removeClass("k-autofitting"),w.trigger(et,{column:t,oldWidth:f,newWidth:g}),w._applyLockedContainersWidth(),w._syncLockedContentHeight(),w._syncLockedHeaderHeight()}},reorderColumn:function(e,r,n){var o,l,a=this,i=d(r,a.columns),s=i?i.columns:a.columns,c=ye(r,s),u=s[e],h=!!u.locked,p=D(a.columns).length;c!==e&&(r.locked||!h||1!=F(a.columns).length)&&(!r.locked||h||1!=p)&&(a._hideResizeHandle(),n===t&&(n=c>e),l=[r],a._reorderHeader(l,u,n),a.lockedHeader&&(L(a.thead),L(a.lockedHeader)),u.columns&&(u=E(u.columns),u=u[n?0:u.length-1]),r.columns&&(l=E(r.columns)),a._reorderContent(l,u,n),o=!!r.locked,o=o!=h,r.locked=h,s.splice(n?e:e+1,0,r),s.splice(e>c?c:c+1,1),a._templates(),a._updateColumnCellIndex(),a._updateTablesWidth(),a._applyLockedContainersWidth(),a._syncLockedHeaderHeight(),a._syncLockedContentHeight(),a._updateFirstColumnClass(),o&&(h?a.trigger(rt,{column:r}):a.trigger(nt,{column:r})))},_updateColumnCellIndex:function(){var e,t=0;this.lockedHeader&&(e=this.lockedHeader.find("thead"),t=b(e,D(this.columns))),b(this.thead,F(this.columns),t)},lockColumn:function(e){var t,r=this.columns;e="number"==typeof e?r[e]:we(r,function(t){return t.field===e})[0],!e||e.locked||e.hidden||(t=D(r).length-1,this.reorderColumn(t,e,!1))},unlockColumn:function(e){var t,r=this.columns;e="number"==typeof e?r[e]:we(r,function(t){return t.field===e})[0],e&&e.locked&&!e.hidden&&(t=D(r).length,this.reorderColumn(t,e,!0))},cellIndex:function(t){var r=0;return this.lockedTable&&!e.contains(this.lockedTable[0],t[0])&&(r=E(D(this.columns)).length),e(t).parent().children("td:not(.k-group-cell,.k-hierarchy-cell)").index(t)+r},_modelForContainer:function(t){t=e(t),t.is("tr")||"popup"===this._editMode()||(t=t.closest("tr"));var r=t.attr(ue.attr("uid"));return this.dataSource.getByUid(r)},_editable:function(){var t,r=this,n=r.selectable&&r.selectable.options.multiple,o=r.options.editable,l=function(){var t=ge(),n=r._editContainer;!n||e.contains(n[0],t)||n[0]===t||e(t).closest(".k-animation-container").length||r.editable.end()&&r.closeCell()};o&&(this.wrapper.addClass("k-editable"),t=r._editMode(),"incell"===t?o.update!==!1&&r.wrapper.on(lt+We,"tr:not(.k-grouping-row) > td",function(t){var o=e(this),l=r.lockedTable&&o.closest("table")[0]===r.lockedTable[0];o.hasClass("k-hierarchy-cell")||o.hasClass("k-detail-cell")||o.hasClass("k-group-cell")||o.hasClass("k-edit-cell")||o.has("a.k-grid-delete").length||o.has("button.k-grid-delete").length||o.closest("tbody")[0]!==r.tbody[0]&&!l||e(t.target).is(":input")||(r.editable?r.editable.end()&&(n&&e(ge()).blur(),r.closeCell(),r.editCell(o)):r.editCell(o))}).on("focusin"+We,function(){e.contains(this,ge())||(clearTimeout(r.timer),r.timer=null)}).on("focusout"+We,function(){r.timer=setTimeout(l,1)}):o.update!==!1&&r.wrapper.on(lt+We,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible a.k-grid-edit",function(t){t.preventDefault(),r.editRow(e(this).closest("tr"))}),o.destroy!==!1?r.wrapper.on(lt+We,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible .k-grid-delete",function(t){t.preventDefault(),t.stopPropagation(),r.removeRow(e(this).closest("tr"))}):r.wrapper.on(lt+We,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible button.k-grid-delete",function(e){e.stopPropagation(),r._confirmation()||e.preventDefault()}))},editCell:function(t){var r,n,o,l;t=e(t),r=this,n=E(r.columns)[r.cellIndex(t)],o=r._modelForContainer(t),r.closeCell(),!o||o.editable&&!o.editable(n.field)||n.command||!n.field||(r._attachModelChange(o),r._editContainer=t,r.editable=t.addClass("k-edit-cell").kendoEditable({fields:{field:n.field,format:n.format,editor:n.editor,values:n.values},model:o,target:r,change:function(e){r.trigger(Ne,{values:e.values,container:t,model:o})&&e.preventDefault()}}).data("kendoEditable"),l=t.parent().addClass("k-grid-edit-row"),r.lockedContent&&ne(l[0],r._relatedRow(l).addClass("k-grid-edit-row")[0]),r.trigger(Ee,{container:t,model:o}))},_adjustLockedHorizontalScrollBar:function(){var e=this.table,t=e.parent(),r=e[0].offsetWidth>t[0].clientWidth?ue.support.scrollbar():0;this.lockedContent.height(t.height()-r)},_syncLockedContentHeight:function(){this.lockedTable&&(this.touchScroller||this._adjustLockedHorizontalScrollBar(),this._adjustRowsHeight(this.table,this.lockedTable))},_syncLockedHeaderHeight:function(){var e,t;this.lockedHeader&&(e=this.lockedHeader.children("table"),t=this.thead.parent(),this._adjustRowsHeight(e,t),re(e,t))},_syncLockedFooterHeight:function(){this.lockedFooter&&this.footer&&this.footer.length&&this._adjustRowsHeight(this.lockedFooter.children("table"),this.footer.find(".k-grid-footer-wrap > table"))},_destroyEditable:function(){var e=this,t=function(){if(e.editable){var t=e.editView?e.editView.element:e._editContainer;t&&(t.off(lt+We,"a.k-grid-cancel",e._editCancelClickHandler),t.off(lt+We,"a.k-grid-update",e._editUpdateClickHandler)),e._detachModelChange(),e.editable.destroy(),e.editable=null,e._editContainer=null,e._destroyEditView()}};e.editable&&("popup"!==e._editMode()||e._isMobile?t():e._editContainer.data("kendoWindow").bind("deactivate",t).close()),e._actionSheet&&(e._actionSheet.destroy(),e._actionSheet=null)},_destroyEditView:function(){this.editView&&(this.editView.purge(),this.editView=null,this.pane.navigate(""))},_attachModelChange:function(e){var t=this;t._modelChangeHandler=function(e){t._modelChange({field:e.field,model:this})},e.bind("change",t._modelChangeHandler)},_detachModelChange:function(){var e=this,t=e._editContainer,r=e._modelForContainer(t);r&&r.unbind(Ve,e._modelChangeHandler)},closeCell:function(t){var r,n,o,l,a=this,i=a._editContainer;i&&(r=i.closest("tr").attr(ue.attr("uid")),l=a.dataSource.getByUid(r),t&&a.trigger("cancel",{container:i,model:l})||(i.removeClass("k-edit-cell"),n=E(a.columns)[a.cellIndex(i)],o=i.parent().removeClass("k-grid-edit-row"),a._destroyEditable(),a._displayCell(i,n,l),i.hasClass("k-dirty-cell")&&e('<span class="k-dirty"/>').prependTo(i),a.trigger("itemChange",{item:o,data:l,ns:he}),a.lockedContent&&ne(o.css("height","")[0],a._relatedRow(o).css("height","")[0])))},_displayCell:function(e,t,r){var n=this,o={storage:{},count:0},l=_e({},ue.Template,n.options.templateSettings),a=ue.template(n._cellTmpl(t,o),l);o.count>0&&(a=xe(a,o.storage)),e.empty().html(a(r)),n.angular("compile",function(){return{elements:e,data:[{dataItem:r}]}})},removeRow:function(e){this._confirmation(e)&&this._removeRow(e)},_removeRow:function(t){var r,n=this,o=n._editMode();"incell"!==o&&n.cancelRow(),t=e(t),n.lockedContent&&(t=t.add(n._relatedRow(t))),t=t.hide(),r=n._modelForContainer(t),r&&!n.trigger(Be,{row:t,model:r})?(n.dataSource.remove(r),("inline"===o||"popup"===o)&&n.dataSource.sync()):"incell"===o&&n._destroyEditable()},_editMode:function(){var e="incell",t=this.options.editable;return t!==!0&&(e="string"==typeof t?t:t.mode||e),e},editRow:function(r){var n,o,l,a=this;r instanceof ue.data.ObservableObject?n=r:(r=e(r),n=a._modelForContainer(r)),o=a._editMode(),a.cancelRow(),n&&(r=a.tbody.children("["+ue.attr("uid")+"="+n.uid+"]"),a._attachModelChange(n),"popup"===o?a._createPopupEditor(n):"inline"===o?a._createInlineEditor(r,n):"incell"===o&&e(r).children(Le).each(function(){var r=e(this),o=E(a.columns)[a.cellIndex(r)];return n=a._modelForContainer(r),n&&(!n.editable||n.editable(o.field))&&o.field?(a.editCell(r),!1):t}),l=a.editView?a.editView.element:a._editContainer,l&&(this._editCancelClickHandler||(this._editCancelClickHandler=xe(this._editCancelClick,this)),l.on(lt+We,"a.k-grid-cancel",this._editCancelClickHandler),this._editUpdateClickHandler||(this._editUpdateClickHandler=xe(this._editUpdateClick,this)),l.on(lt+We,"a.k-grid-update",this._editUpdateClickHandler)))},_editUpdateClick:function(e){e.preventDefault(),e.stopPropagation(),this.saveRow()},_editCancelClick:function(t){var r,n=this,o=n.options.navigatable,l=n.editable.options.model,a=n.editView?n.editView.element:n._editContainer;t.preventDefault(),t.stopPropagation(),n.trigger("cancel",{container:a,model:l})||(r=n.items().index(e(n.current()).parent()),n.cancelRow(),o&&(n._setCurrent(n.items().eq(r).children().filter(Fe).first()),le(n.table,!0)))},_createPopupEditor:function(r){var n,o,l,a,i,s,d,c,u,h,p,f=this,g="<div "+ue.attr("uid")+'="'+r.uid+'" class="k-popup-edit-form'+(f._isMobile?" k-mobile-list":"")+'"><div class="k-edit-form-container">',m=[],k=E(f.columns),b=f.options.editable,_=b.template,v=be(b)?b.window:{},w=_e({},ue.Template,f.options.templateSettings);if(v=v||{},_)for(typeof _===dt&&(_=window.unescape(_)),g+=ue.template(_,w)(r),l=0,a=k.length;a>l;l++)n=k[l],n.command&&(c=oe(n.command,"edit"),c&&(o=c));else for(l=0,a=k.length;a>l;l++)n=k[l],n.command?n.command&&(c=oe(n.command,"edit"),c&&(o=c)):(g+='<div class="k-edit-label"><label for="'+n.field+'">'+(n.title||n.field||"")+"</label></div>",r.editable&&!r.editable(n.field)||!n.field?(h={storage:{},count:0},i=ue.template(f._cellTmpl(n,h),w),h.count>0&&(i=xe(i,h.storage)),g+='<div class="k-edit-field">'+i(r)+"</div>"):(m.push({field:n.field,format:n.format,editor:n.editor,values:n.values}),g+="<div "+ue.attr("container-for")+'="'+n.field+'" class="k-edit-field"></div>'));o&&be(o)&&(o.text&&be(o.text)&&(s=o.text.update,d=o.text.cancel),o.attr&&(u=o.attr)),f._isMobile?(g+="</div></div>",f.editView=f.pane.append("<div data-"+ue.ns+'role="view" data-'+ue.ns+'use-native-scrolling="true" data-'+ue.ns+'init-widgets="false" class="k-grid-edit-form"><div data-'+ue.ns+'role="header" class="k-header">'+f._createButton({name:"update",text:s,attr:u})+(v.title||"Edit")+f._createButton({name:"canceledit",text:d,attr:u})+"</div>"+g+"</div>"),p=f._editContainer=f.editView.element.find(".k-popup-edit-form")):(g+='<div class="k-edit-buttons k-state-default">',g+=f._createButton({name:"update",text:s,attr:u})+f._createButton({name:"canceledit",text:d,attr:u}),g+="</div></div></div>",p=f._editContainer=e(g).appendTo(f.wrapper).eq(0).kendoWindow(_e({modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1,close:function(n){if(n.userTriggered){if(n.sender.element.focus(),f.trigger("cancel",{container:p,model:r}))return n.preventDefault(),t;var o=f.items().index(e(f.current()).parent());f.cancelRow(),f.options.navigatable&&(f._setCurrent(f.items().eq(o).children().filter(Fe).first()),le(f.table,!0))}}},v))),f.editable=f._editContainer.kendoEditable({fields:m,model:r,clearContainer:!1,target:f}).data("kendoEditable"),f._isMobile&&p.find("input[type=checkbox],input[type=radio]").parent(".k-edit-field").addClass("k-check").prev(".k-edit-label").addClass("k-check").click(function(){e(this).next().children("input").click()}),f._openPopUpEditor(),f.trigger(Ee,{container:p,model:r})},_openPopUpEditor:function(){this._isMobile?this.pane.navigate(this.editView,this._editAnimation):this._editContainer.data("kendoWindow").center().open()},_createInlineEditor:function(t,r){var n,o,l,a=this,i=[];a.lockedContent&&(t=t.add(a._relatedRow(t))),t.children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){if(o=e(this),n=E(a.columns)[a.cellIndex(o)],n.command||!n.field||r.editable&&!r.editable(n.field)){if(n.command&&(l=oe(n.command,"edit"))){o.empty();var t,s,d;be(l)&&(l.text&&be(l.text)&&(t=l.text.update,s=l.text.cancel),l.attr&&(d=l.attr)),e(a._createButton({name:"update",text:t,attr:d})+a._createButton({name:"canceledit",text:s,attr:d})).appendTo(o)}}else i.push({field:n.field,format:n.format,editor:n.editor,values:n.values}),o.attr(ue.attr("container-for"),n.field),o.empty()}),a._editContainer=t,a.editable=new ue.ui.Editable(t.addClass("k-grid-edit-row"),{target:a,fields:i,model:r,clearContainer:!1}),t.length>1&&(ne(t[0],t[1]),a._applyLockedContainersWidth()),a.trigger(Ee,{container:t,model:r})},cancelRow:function(e){var t,r=this,n=r._editContainer;if(n){if(t=r._modelForContainer(n),e&&r.trigger("cancel",{container:n,model:t}))return;r._destroyEditable(),r.dataSource.cancelChanges(t),r._displayRow("popup"!==r._editMode()?n:r.tbody.find("["+ue.attr("uid")+"="+t.uid+"]"))}},saveRow:function(){var e=this,t=e._editContainer,r=e._modelForContainer(t),n=e.editable;t&&n&&n.end()&&!e.trigger(Ne,{container:t,model:r})&&e.dataSource.sync()},_displayRow:function(t){var r,n,o,l,a,i=this,s=i._modelForContainer(t),d=t.hasClass("k-state-selected"),c=t.hasClass("k-alt");s&&(i.lockedContent&&(r=e((c?i.lockedAltRowTemplate:i.lockedRowTemplate)(s)),i._relatedRow(t.last()).replaceWith(r)),i.angular("cleanup",function(){return{elements:t.get()}}),n=e((c?i.altRowTemplate:i.rowTemplate)(s)),t.replaceWith(n),l=n,a=[{dataItem:s}],r&&r.length&&(l=n.add(r),a.push({dataItem:s})),i.angular("compile",function(){return{elements:l.get(),data:a}}),d&&i.options.selectable&&i.select(n.add(r)),r&&ne(n[0],r[0]),o=n.next(),o.hasClass("k-detail-row")&&o.is(":visible")&&n.find(".k-hierarchy-cell .k-icon").removeClass("k-plus").addClass("k-minus"))},_showMessage:function(t,r){var n,o,l,a=this;return a._isMobile?(n=ue.template('<ul><li class="km-actionsheet-title">#:title#</li><li><a href="\\#" class="k-button k-grid-delete">#:confirmDelete#</a></li></ul>'),o=e(n(t)).appendTo(a.view.element),l=a._actionSheet=new ue.mobile.ui.ActionSheet(o,{cancel:t.cancelDelete,cancelTemplate:'<li class="km-actionsheet-cancel"><a class="k-button" href="\\#">#:cancel#</a></li>',close:function(){this.destroy()},command:function(t){var n=e(t.currentTarget).parent();n.hasClass("km-actionsheet-cancel")||a._removeRow(r)},popup:a._actionSheetPopupOptions}),l.open(r),!1):window.confirm(t.title)},_confirmation:function(e){var t=this,r=t.options.editable,n=r===!0||typeof r===dt?t.options.messages.editable.confirmation:r.confirmation;return n!==!1&&null!=n?(typeof n===st&&(n=n(t._modelForContainer(e))),t._showMessage({confirmDelete:r.confirmDelete||t.options.messages.editable.confirmDelete,cancelDelete:r.cancelDelete||t.options.messages.editable.cancelDelete,title:n===!0?t.options.messages.editable.confirmation:n},e)):!0},cancelChanges:function(){this.dataSource.cancelChanges()},saveChanges:function(){var e=this;(e.editable&&e.editable.end()||!e.editable)&&!e.trigger(Ke)&&e.dataSource.sync()},addRow:function(){var e,t,r,n,o,l,a=this,i=a.dataSource,s=a._editMode(),d=a.options.editable.createAt||"",c=i.pageSize(),u=i.view()||[];(a.editable&&a.editable.end()||!a.editable)&&("incell"!=s&&a.cancelRow(),e=i.indexOf(u[0]),"bottom"==d.toLowerCase()&&(e+=u.length,c&&!i.options.serverPaging&&u.length>=c&&(e-=1)),0>e&&(e=i.page()>i.totalPages()?(i.page()-1)*c:0),t=i.insert(e,{}),r=t.uid,n=a.lockedContent?a.lockedTable:a.table,o=n.find("tr["+ue.attr("uid")+"="+r+"]"),l=o.children("td:not(.k-group-cell,.k-hierarchy-cell)").eq(a._firstEditableColumnIndex(o)),"inline"===s&&o.length?a.editRow(o):"popup"===s?a.editRow(t):l.length&&a.editCell(l),"bottom"==d.toLowerCase()&&a.lockedContent&&(a.lockedContent[0].scrollTop=a.content[0].scrollTop=a.table[0].offsetHeight))},_firstEditableColumnIndex:function(e){var t,r,n,o=this,l=E(o.columns),a=o._modelForContainer(e);for(r=0,n=l.length;n>r;r++)if(t=l[r],a&&(!a.editable||a.editable(t.field))&&!t.command&&t.field&&t.hidden!==!0)return r;return-1},_toolbar:function(){var t,r=this,n=r.wrapper,o=r.options.toolbar,l=r.options.editable;o&&(t=r.wrapper.find(".k-grid-toolbar"),t.length||(Se(o)||(o=typeof o===dt?o:r._toolbarTmpl(o).replace(gt,"\\#"),o=xe(ue.template(o),r)),t=e('<div class="k-header k-grid-toolbar" />').html(o({})).prependTo(n),r.angular("compile",function(){return{elements:t.get()}})),l&&l.create!==!1&&t.on(lt+We,".k-grid-add",function(e){e.preventDefault(),r.addRow()}).on(lt+We,".k-grid-cancel-changes",function(e){e.preventDefault(),r.cancelChanges()}).on(lt+We,".k-grid-save-changes",function(e){e.preventDefault(),r.saveChanges()}),t.on(lt+We,".k-grid-excel",function(e){e.preventDefault(),r.saveAsExcel()}),t.on(lt+We,".k-grid-pdf",function(e){e.preventDefault(),r.saveAsPDF()}))},_toolbarTmpl:function(e){var t,r,n=this,o="";if(Ce(e))for(t=0,r=e.length;r>t;t++)o+=n._createButton(e[t]);return o},_createButton:function(e){var r,o=e.template||_t,l=typeof e===dt?e:e.name||e.text,a=xt[l]?xt[l].className:"k-grid-"+(l||"").replace(/\s/g,""),i={className:a,text:l,imageClass:"",attr:"",iconClass:""},s=this.options.messages.commands;if(!(l||be(e)&&e.template))throw Error("Custom commands should have name specified");return be(e)?(e=_e(!0,{},e),e.className&&ye(i.className,e.className.split(" "))<0?e.className+=" "+i.className:e.className===t&&(e.className=i.className),"edit"===l&&be(e.text)&&(e=_e(!0,{},e),e.text=e.text.edit),e.attr&&(be(e.attr)&&(e.attr=n(e.attr)),typeof e.attr===dt&&(r=e.attr.match(/class="(.+?)"/),r&&ye(r[1],e.className.split(" "))<0&&(e.className+=" "+r[1]))),i=_e(!0,i,xt[l],{text:s[l]},e)):i=_e(!0,i,xt[l],{text:s[l]}),ue.template(o)(i)},_hasFooters:function(){return!!this.footerTemplate||!!this.groupFooterTemplate||this.footer&&this.footer.length>0||this.wrapper.find(".k-grid-footer").length>0},_groupable:function(){var t=this;t._groupableClickHandler?t.table.add(t.lockedTable).off(lt+We,t._groupableClickHandler):t._groupableClickHandler=function(r){var n=e(this),o=n.closest("tr");n.hasClass("k-i-collapse")?t.collapseGroup(o):t.expandGroup(o),r.preventDefault(),r.stopPropagation()},t._isLocked()?t.lockedTable.on(lt+We,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler):t.table.on(lt+We,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler),t._attachGroupable()},_attachGroupable:function(){var t=this,r=t.wrapper,n=t.options.groupable,o=Me+"["+ue.attr("field")+"]",l=t.content?".k-grid-header:first "+o:"table:first>.k-grid-header "+o;n&&n.enabled!==!1&&(r.has("div.k-grouping-header")[0]||e("<div>&nbsp;</div>").addClass("k-grouping-header").prependTo(r),t.groupable&&t.groupable.destroy(),t.groupable=new he.Groupable(r,_e({},n,{draggable:t._draggableInstance,groupContainer:">div.k-grouping-header",dataSource:t.dataSource,draggableElements:l,filter:l,allowDrag:t.options.reorderable})))},_continuousItems:function(t,r){var n,o,l,a,i,s,d,c;if(this.lockedContent){for(n=this,o=n.table.add(n.lockedTable),l=e(t,o[0]),a=e(t,o[1]),i=r?D(n.columns).length:1,s=r?n.columns.length-i:1,d=[],c=0;l.length>c;c+=i)Te.apply(d,l.slice(c,c+i)),Te.apply(d,a.splice(0,s));return d}},_selectable:function(){var r,n,o,l,a=this,i=[],s=a._isLocked(),d=a.options.selectable;d&&(a.selectable&&a.selectable.destroy(),d=ue.ui.Selectable.parseOptions(d),r=d.multiple,n=d.cell,a._hasDetails()&&(i[i.length]=".k-detail-row"),(a.options.groupable||a._hasFooters())&&(i[i.length]=".k-grouping-row,.k-group-footer"),i=i.join(","),""!==i&&(i=":not("+i+")"),o=a.table,s&&(o=o.add(a.lockedTable)),l=">"+(n?ze:"tbody>tr"+i),a.selectable=new ue.ui.Selectable(o,{filter:l,aria:!0,multiple:r,change:function(){a.trigger(Ve)},useAllItems:s&&r&&n,relatedTarget:function(t){var r,o,l,i;if(!n&&s){for(o=e(),l=0,i=t.length;i>l;l++)r=a._relatedRow(t[l]),ye(r[0],t)<0&&(o=o.add(r));return o}},continuousItems:function(){return a._continuousItems(l,n)}}),a.options.navigatable&&o.on("keydown"+We,function(l){var i=a.current(),d=l.target;if(l.keyCode===ke.SPACEBAR&&e.inArray(d,o)>-1&&!i.is(".k-edit-cell,.k-header")&&i.parent().is(":not(.k-grouping-row,.k-detail-row,.k-group-footer)")){if(l.preventDefault(),l.stopPropagation(),i=n?i:i.parent(),s&&!n&&(i=i.add(a._relatedRow(i))),r)if(l.ctrlKey){if(i.hasClass(Ye))return i.removeClass(Ye),a.trigger(Ve),t}else a.selectable.clear();else a.selectable.clear();a.selectable.value(i)}}))},_clipboard:function(){var e,t=this.options,r=t.selectable;r&&t.allowCopy&&(e=this,t.navigatable||e.table.add(e.lockedTable).attr("tabindex",0).on("mousedown"+We+" keydown"+We,".k-detail-cell",function(e){e.target!==e.currentTarget&&e.stopImmediatePropagation()}).on("mousedown"+We,De+">"+Fe,xe(ie,e)),e.copyHandler=xe(e.copySelection,e),e.updateClipBoardState=function(){e.areaClipBoard&&e.areaClipBoard.val(e.getTSV()).focus().select()},e.bind("change",e.updateClipBoardState),e.wrapper.on("keydown",e.copyHandler),e.clearAreaHandler=xe(e.clearArea,e),e.wrapper.on("keyup",e.clearAreaHandler))},copySelection:function(t){t instanceof jQuery.Event&&!t.ctrlKey&&!t.metaKey||e(t.target).is("input:visible,textarea:visible")||window.getSelection&&""+window.getSelection()||document.selection&&document.selection.createRange().text||(this.areaClipBoard||(this.areaClipBoard=e("<textarea />").css({position:"fixed",top:"50%",left:"50%",opacity:0,width:0,height:0}).appendTo(this.wrapper)),this.areaClipBoard.val(this.getTSV()).focus().select())},getTSV:function(){var t,r,n,o,l,a,i=this,s=i.select(),d="	",c=i.options.allowCopy,u=!0;return e.isPlainObject(c)&&c.delimeter&&(d=c.delimeter),t="",s.length&&(s.eq(0).is("tr")&&(s=s.find("td:not(.k-group-cell)")),u&&s.filter(":visible"),r=[],n=this.columns.length,o=i._isLocked()&&D(i.columns).length,l=!0,e.each(s,function(t,a){var s,d,c,h;a=e(a),s=a.closest("tr"),d=s.index(),c=a.index(),u&&(c-=a.prevAll(":hidden").length),o&&l&&(l=e.contains(i.lockedTable[0],a[0])),i._groups()&&l&&(c-=i._groups()),c=l?c:c+o,n>c&&(n=c),h=a.text(),r[d]||(r[d]=[]),r[d][c]=h}),a=r.length,r=e.each(r,function(e,t){t&&(r[e]=t.slice(n),a>e&&(a=e))}),e.each(r.slice(a),function(e,r){t+=r?r.join(d)+"\r\n":"\r\n"})),t},clearArea:function(t){var r;this.areaClipBoard&&t&&t.target===this.areaClipBoard[0]&&(r=this.options.navigatable?e(this.current()).closest("table"):this.table,
le(r,!0)),this.areaClipBoard&&(this.areaClipBoard.remove(),this.areaClipBoard=null)},_minScreenSupport:function(){var t=this.hideMinScreenCols();t&&(this.minScreenResizeHandler=xe(this.hideMinScreenCols,this),e(window).on("resize",this.minScreenResizeHandler))},hideMinScreenCols:function(){var e=this.columns,t=window.innerWidth>0?window.innerWidth:screen.width;return this._iterateMinScreenCols(e,t)},_iterateMinScreenCols:function(e,r){var n,o,l,a=!1;for(n=0;e.length>n;n++)o=e[n],l=o.minScreenWidth,l!==t&&null!==l&&(a=!0,l>r?this.hideColumn(o):this.showColumn(o)),!o.hidden&&o.columns&&(a=this._iterateMinScreenCols(o.columns,r)||a);return a},_relatedRow:function(t){var r,n,o=this.lockedTable;return t=e(t),o?(r=t.closest(this.table.add(this.lockedTable)),n=r.find(">tbody>tr").index(t),r=r[0]===this.table[0]?o:this.table,r.find(">tbody>tr").eq(n)):t},clearSelection:function(){var e=this;e.selectable.clear(),e.trigger(Ve)},select:function(e){var r=this,n=r.selectable;return e=r.table.add(r.lockedTable).find(e),e.length?(n.options.multiple||(n.clear(),e=e.first()),r._isLocked()&&(e=e.add(e.map(function(){return r._relatedRow(this)}))),n.value(e),t):n.value()},_updateCurrentAttr:function(t,r){var n,o=e(t).data("headerId");e(t).removeClass(Je).removeAttr("aria-describedby").closest("table").removeAttr("aria-activedescendant"),o?(o=o.replace(this._cellId,""),e(t).attr("id",o)):e(t).removeAttr("id"),r.data("headerId",r.attr("id")).attr("id",this._cellId).addClass(Je).closest("table").attr("aria-activedescendant",this._cellId),r.closest("tr").hasClass("k-grouping-row")||r.hasClass("k-header")?r.attr("aria-describedby",this._cellId):(n=this.columns[this.cellIndex(r)],n&&(o=n.headerAttributes.id),r.attr("aria-describedby",o+" "+this._cellId)),this._current=r},_scrollCurrent:function(){var t,r,n,o,l,a,i=this._current,s=this.options.scrollable;i&&s&&(t=i.parent(),r=t.closest("table").parent(),n=r.is(".k-grid-content-locked,.k-grid-header-locked"),o=r.is(".k-grid-content-locked,.k-grid-content,.k-virtual-scrollable-wrap"),l=e(this.content).find(">.k-virtual-scrollable-wrap").andSelf().last()[0],o&&(s.virtual?(a=Math.max(ye(t[0],this._items(t.parent())),0),this._rowVirtualIndex=this.virtualScrollable.itemIndex(a),this.virtualScrollable.scrollIntoView(t)):this._scrollTo(this._relatedRow(t)[0],l)),this.lockedContent&&(this.lockedContent[0].scrollTop=l.scrollTop),n||this._scrollTo(i[0],l))},current:function(e){return this._setCurrent(e,!0)},_setCurrent:function(t,r){var n=this._current;return t=e(t),t.length&&(n&&n[0]===t[0]||(this._updateCurrentAttr(n,t),this._scrollCurrent(),r||this.trigger(ot,{element:t}))),this._current},_removeCurrent:function(){this._current&&(this._current.removeClass(Je),this._current=null)},_scrollTo:function(t,r){var n,o=t.tagName.toLowerCase(),l="td"===o||"th"===o,a=t[l?"offsetLeft":"offsetTop"],i=t[l?"offsetWidth":"offsetHeight"],s=r[l?"scrollLeft":"scrollTop"],d=r[l?"clientWidth":"clientHeight"],c=a+i,u=0,h=0,p=0;vt&&l&&(n=e(t).closest("table")[0],wt.msie?h=n.offsetLeft:wt.mozilla&&(p=n.offsetLeft-ue.support.scrollbar())),s=Math.abs(s+h-p),u=s>a?a:c>s+d?d>=i?c-d:a:s,u=Math.abs(u+h)+p,r[l?"scrollLeft":"scrollTop"]=u},_navigatable:function(){var t,r,n,o=this;o.options.navigatable&&(t=o.table.add(o.lockedTable),r=o.thead.parent().add(e(">table",o.lockedHeader)),n=t,o.options.scrollable&&(n=n.add(r),r.attr(it,-1)),this._navigatableTables=n,n.off("mousedown"+We+" focus"+We+" focusout"+We+" keydown"+We),r.on("keydown"+We,xe(o._openHeaderMenu,o)).find("a.k-link").attr("tabIndex",-1),t.attr(it,Re.max(t.attr(it)||0,0)).on("mousedown"+We+" keydown"+We,".k-detail-cell",function(e){e.target!==e.currentTarget&&e.stopImmediatePropagation()}),n.on(ue.support.touch?"touchstart"+We:"mousedown"+We,De+">"+Fe,xe(ie,o)).on("focus"+We,xe(o._tableFocus,o)).on("focusout"+We,xe(o._tableBlur,o)).on("keydown"+We,xe(o._tableKeyDown,o)))},_openHeaderMenu:function(e){e.altKey&&e.keyCode==ke.DOWN&&(this.current().find(".k-grid-filter, .k-header-column-menu").click(),e.stopImmediatePropagation())},_setTabIndex:function(e){this._navigatableTables.attr(it,-1),e.attr(it,0)},_tableFocus:function(t){var r,n;ue.support.touch||(r=this.current(),n=e(t.currentTarget),r&&r.is(":visible")?r.addClass(Je):this._setCurrent(n.find(qe)),this._setTabIndex(n))},_tableBlur:function(){var e=this.current();e&&e.removeClass(Je)},_tableKeyDown:function(r){var n,o=this.current(),l=this.virtualScrollable&&this.virtualScrollable.fetching(),a=e(r.target),i=!r.isDefaultPrevented()&&!a.is(":button,a,:input,a>.k-icon");return l?(r.preventDefault(),t):(o=o?o:e(this.lockedTable).add(this.table).find(qe),o.length&&(n=!1,i&&r.keyCode==ke.UP&&(n=this._moveUp(o)),i&&r.keyCode==ke.DOWN&&(n=this._moveDown(o)),i&&r.keyCode==(vt?ke.LEFT:ke.RIGHT)&&(n=this._moveRight(o,r.altKey)),i&&r.keyCode==(vt?ke.RIGHT:ke.LEFT)&&(n=this._moveLeft(o,r.altKey)),i&&r.keyCode==ke.PAGEDOWN&&(n=this._handlePageDown()),i&&r.keyCode==ke.PAGEUP&&(n=this._handlePageUp()),(r.keyCode==ke.ENTER||r.keyCode==ke.F2)&&(n=this._handleEnterKey(o,r.currentTarget,a)),r.keyCode==ke.ESC&&(n=this._handleEscKey(o,r.currentTarget)),r.keyCode==ke.TAB&&(n=this._handleTabKey(o,r.currentTarget,r.shiftKey)),n&&(r.preventDefault(),r.stopPropagation())),t)},_moveLeft:function(e,t){var r,n,o=e.parent(),l=o.parent();return t?this.collapseRow(o):(n=l.find(De).index(o),r=this._prevHorizontalCell(l,e,n),r[0]||(l=this._horizontalContainer(l),r=this._prevHorizontalCell(l,e,n),r[0]!==e[0]&&le(l.parent(),!0)),this._setCurrent(r)),!0},_moveRight:function(e,t){var r,n,o=e.parent(),l=o.parent();return t?this.expandRow(o):(n=l.find(De).index(o),r=this._nextHorizontalCell(l,e,n),r[0]||(l=this._horizontalContainer(l,!0),r=this._nextHorizontalCell(l,e,n),r[0]!==e[0]&&le(l.parent(),!0)),this._setCurrent(r)),!0},_moveUp:function(e){var t=e.parent().parent(),r=this._prevVerticalCell(t,e);return r[0]||(t=this._verticalContainer(t,!0),r=this._prevVerticalCell(t,e),r[0]&&le(t.parent(),!0)),this._setCurrent(r),!0},_moveDown:function(e){var t=e.parent().parent(),r=this._nextVerticalCell(t,e);return r[0]||(t=this._verticalContainer(t),r=this._nextVerticalCell(t,e),r[0]&&le(t.parent(),!0)),this._setCurrent(r),!0},_handlePageDown:function(){return this.options.pageable?(this.dataSource.page(this.dataSource.page()+1),!0):!1},_handlePageUp:function(){return this.options.pageable?(this.dataSource.page(this.dataSource.page()-1),!0):!1},_handleTabKey:function(t,r,n){var o,l=this.options.editable&&"incell"==this._editMode();return!l||t.is("th")?!1:(o=e(ge()).closest(".k-edit-cell"),o[0]&&o[0]!==t[0]&&(t=o),o=this._tabNext(t,r,n),o.length?(this._handleEditing(t,o,o.closest("table")),!0):!1)},_handleEscKey:function(t,r){var n,o=ge(),l="incell"==this._editMode();return se(t)?(l?this.closeCell(!0):(n=e(t).parent().index(),o&&o.blur(),this.cancelRow(!0),n>=0&&this._setCurrent(this.items().eq(n).children(Fe).first())),wt.msie&&9>wt.version&&document.body.focus(),le(r,!0),!0):t.has(o).length?(le(r,!0),!0):!1},_toggleCurrent:function(e,t){var r=e.parent();return r.is(".k-grouping-row")?(r.find(".k-icon:first").click(),!0):!t&&r.is(".k-master-row")?(r.find(".k-icon:first").click(),!0):!1},_handleEnterKey:function(t,r,n){var o,l=this.options.editable,a=n.closest("[role=gridcell]");return n.is("table")||e.contains(t[0],n[0])||(t=a),t.is("th")?(t.find(".k-link").click(),!0):this._toggleCurrent(t,l)?!0:(o=t.find(":kendoFocusable:first"),o[0]&&!t.hasClass("k-edit-cell")&&t.hasClass("k-state-focused")?(o.focus(),!0):l&&!n.is(":button,.k-button,textarea")?(a[0]||(a=t),this._handleEditing(a,!1,r),!0):!1)},_nextHorizontalCell:function(e,t,r){var n,o,l,a=t.nextAll(Le);return a.length||(n=e.find(De),o=n.index(t.parent()),-1!=o)?a.first():t.hasClass("k-header")?(l=[],z([D(this.columns)[0]],P(n.eq(0).children().first()),l,0,0),l[r]?l[r][0]:t):t.parent().hasClass("k-filter-row")?n.last().children(Le).first():n.eq(r).children(Le).first()},_prevHorizontalCell:function(e,t,r){var n,o,l,a,i=t.prevAll(Le);return i.length||(n=e.find(De),o=n.index(t.parent()),-1!=o)?i.first():t.hasClass("k-header")?(l=[],a=D(this.columns),z([a[a.length-1]],P(n.eq(0).children().last()),l,0,0),l[r]?l[r][0]:t):t.parent().hasClass("k-filter-row")?n.last().children(Le).last():n.eq(r).children(Le).last()},_currentDataIndex:function(e,r){var n,o=r.attr("data-index");return o?(n=D(this.columns).length,n&&!e.closest("div").hasClass("k-grid-content-locked")[0]?o-n:o):t},_prevVerticalCell:function(t,r){var n,o=r.parent(),l=t.children(De),a=l.index(o),i=this._currentDataIndex(t,r);if(i||r.hasClass("k-header"))return n=B(r),n.eq(n.length-2);if(i=o.children(Le).index(r),o.hasClass("k-filter-row"))return N(t).eq(i);if(-1==a){if(o=t.find(".k-filter-row"),!o[0])return N(t).eq(i)}else o=0===a?e():l.eq(a-1);return n=o.children(Le),n.eq(n.length>i?i:0)},_nextVerticalCell:function(e,r){var n,o=r.parent(),l=e.children(De),a=l.index(o),i=this._currentDataIndex(e,r);return-1!=a&&i===t&&r.hasClass("k-header")?P(r).eq(1):(i=i?parseInt(i,10):o.children(Le).index(r),o=l.eq(-1==a?0:a+r[0].rowSpan),n=o.children(Le),n.eq(n.length>i?i:0))},_verticalContainer:function(e,t){var r=e.parent(),n=this._navigatableTables.length,o=Math.floor(n/2),l=ye(r[0],this._navigatableTables);return t&&(o*=-1),l+=o,(l>=0||n>l)&&(r=this._navigatableTables.eq(l)),r.find(t?"thead":"tbody")},_horizontalContainer:function(e,t){var r,n,o=this._navigatableTables.length;return 2>=o?e:(r=e.parent(),n=ye(r[0],this._navigatableTables),n+=t?1:-1,!t||2!=n&&n!=o?!t&&(1==n||0>n)?e:this._navigatableTables.eq(n).find("thead, tbody"):e)},_tabNext:function(e,t,r){var n=!0,o=r?e.prevAll(Le+":first"):e.nextAll(":visible:first");return o.length||(o=e.parent(),this.lockedTable&&(n=r&&t==this.lockedTable[0]||!r&&t==this.table[0],o=this._relatedRow(o)),n&&(o=o[r?"prevAll":"nextAll"]("tr:not(.k-grouping-row):not(.k-detail-row):visible:first")),o=o.children(Le+(r?":last":":first"))),o},_handleEditing:function(r,n,o){var l,a,i=this,s=e(ge()),d=i._editMode(),c=wt.msie,u=c&&9>wt.version,h=i._editContainer;if(o=e(o),a="incell"==d?r.hasClass("k-edit-cell"):r.parent().hasClass("k-grid-edit-row"),i.editable){if(e.contains(h[0],s[0])&&(wt.opera||u?s.blur().change().triggerHandler("blur"):(s.blur(),c&&s.blur())),!i.editable)return le(o),t;if(!i.editable.end())return i._setCurrent("incell"==d?h:h.children().filter(Le).first()),l=h.find(":kendoFocusable:first")[0],l&&l.focus(),t;"incell"==d?i.closeCell():(i.saveRow(),a=!0)}n&&i._setCurrent(n),u&&document.body.focus(),le(o,!0),(!a&&!n||n)&&("incell"==d?i.editCell(i.current()):i.editRow(i.current().parent()))},_wrapper:function(){var e=this,t=e.table,r=e.options.height,n=e.element;n.is("div")||(n=n.wrap("<div/>").parent()),e.wrapper=n.addClass("k-grid k-widget"),r&&(e.wrapper.css(at,r),t.css(at,"auto")),e._initMobile()},_initMobile:function(){var t,r=this.options,n=this;this._isMobile=r.mobile===!0&&ue.support.mobileOS||"phone"===r.mobile||"tablet"===r.mobile,this._isMobile&&(t=this.wrapper.addClass("k-grid-mobile").wrap("<div data-"+ue.ns+'stretch="true" data-'+ue.ns+'role="view" data-'+ue.ns+'init-widgets="false"></div>').parent(),this.pane=ue.mobile.ui.Pane.wrap(t),this.view=this.pane.view(),this._actionSheetPopupOptions=e(document.documentElement).hasClass("km-root")?{modal:!1}:{align:"bottom center",position:"bottom center",effect:"slideIn:up"},r.height&&this.pane.element.parent().css(at,r.height),this._editAnimation="slide",this.view.bind("show",function(){n._isLocked()&&(n._updateTablesWidth(),n._applyLockedContainersWidth(),n._syncLockedContentHeight(),n._syncLockedHeaderHeight(),n._syncLockedFooterHeight())}))},_tbody:function(){var t,r=this,n=r.table;t=n.find(">tbody"),t.length||(t=e("<tbody/>").appendTo(n)),r.tbody=t.attr("role","rowgroup")},_scrollable:function(){var t,r,n,o,l=this,a=l.options,i=a.scrollable,s=i!==!0&&i.virtual&&!l.virtualScrollable,d=!ue.support.kineticScrollNeeded||s?ue.support.scrollbar():0;i&&(t=l.wrapper.children(".k-grid-header"),t[0]||(t=e('<div class="k-grid-header" />').insertBefore(l.table)),t.css(vt?"padding-left":"padding-right",i.virtual?d+1:d),r=e('<table role="grid" />'),Ct&&r.attr("cellspacing",0),r.width(l.table[0].style.width),r.append(l.thead),t.empty().append(e('<div class="k-grid-header-wrap k-auto-scrollable" />').append(r)),l.content=l.table.parent(),l.content.is(".k-virtual-scrollable-wrap, .km-scroll-container")&&(l.content=l.content.parent()),l.content.is(".k-grid-content, .k-virtual-scrollable-wrap")||(l.content=l.table.wrap('<div class="k-grid-content k-auto-scrollable" />').parent()),s&&(l.virtualScrollable=new Tt(l.content,{dataSource:l.dataSource,itemHeight:function(){return l._averageRowHeight()}})),l.scrollables=t.children(".k-grid-header-wrap").add(l.content),n=l.wrapper.find(".k-grid-footer"),n.length&&(l.scrollables=l.scrollables.add(n.children(".k-grid-footer-wrap"))),i.virtual?l.content.find(">.k-virtual-scrollable-wrap").unbind("scroll"+We).bind("scroll"+We,function(){l.scrollables.scrollLeft(this.scrollLeft),l.lockedContent&&(l.lockedContent[0].scrollTop=this.scrollTop)}):(l.scrollables.unbind("scroll"+We).bind("scroll"+We,function(e){l.scrollables.not(e.currentTarget).scrollLeft(this.scrollLeft),l.lockedContent&&e.currentTarget==l.content[0]&&(l.lockedContent[0].scrollTop=this.scrollTop)}),o=l.content.data("kendoTouchScroller"),o&&o.destroy(),o=ue.touchScroller(l.content),o&&o.movable&&(l.touchScroller=o,o.movable.bind("change",function(e){l.scrollables.scrollLeft(-e.sender.x),l.lockedContent&&l.lockedContent.scrollTop(-e.sender.y)}),l.one($e,function(e){e.sender.wrapper.addClass("k-grid-backface")}))))},_renderNoRecordsContent:function(){var t,r=this;r.options.noRecords&&(t=r.table.parent().children("."+Ze),t.length&&t.remove(),r.dataSource&&r.dataSource.view().length||e(r.noRecordsTemplate({})).insertAfter(r.table))},_setContentWidth:function(t){var r,n=this,o="k-grid-content-expander",l='<div class="'+o+'"></div>',a=n.resizable;n.options.scrollable&&n.wrapper.is(":visible")&&(r=n.table.parent().children("."+o),n._setContentWidthHandler=xe(n._setContentWidth,n),n.dataSource&&n.dataSource.view().length?r[0]&&(r.remove(),a&&a.unbind("resize",n._setContentWidthHandler)):(r[0]||(r=e(l).appendTo(n.table.parent()),a&&a.bind("resize",n._setContentWidthHandler)),n.thead&&(r.width(n.thead.width()),t&&n.content.scrollLeft(t))),n._applyLockedContainersWidth(),n.lockedHeader&&0===n.table[0].clientWidth&&(n.table[0].style.width="1px"))},_applyLockedContainersWidth:function(){if(this.options.scrollable&&this.lockedHeader){var e,t=this.thead.parent(),r=t.parent(),n=this.wrapper[0].clientWidth,o=this._groups(),l=ue.support.scrollbar(),a=this.lockedHeader.find(">table>colgroup>col:not(.k-group-col, .k-hierarchy-col)"),i=t.find(">colgroup>col:not(.k-group-col, .k-hierarchy-col)"),s=R(a),d=R(i);o>0&&(s+=this.lockedHeader.find(".k-group-cell:first").outerWidth()*o),s>=n&&(s=n-3*l),this.lockedHeader.add(this.lockedContent).width(s),r[0].style.width=r.parent().width()-s-2+"px",t.add(this.table).width(d),this.virtualScrollable&&(n-=l),this.content[0].style.width=n-s-2+"px",this.lockedFooter&&this.lockedFooter.length&&(this.lockedFooter.width(s),e=this.footer.find(".k-grid-footer-wrap"),e[0].style.width=r[0].clientWidth+"px",e.children().first().width(d))}},_setContentHeight:function(){var e,t=this,r=t.options,n=t.wrapper.innerHeight(),o=t.wrapper.children(".k-grid-header"),l=ue.support.scrollbar();r.scrollable&&t.wrapper.is(":visible")&&(n-=o.outerHeight(),t.pager&&(n-=t.pager.element.outerHeight()),r.groupable&&(n-=t.wrapper.children(".k-grouping-header").outerHeight()),r.toolbar&&(n-=t.wrapper.children(".k-grid-toolbar").outerHeight()),t.footerTemplate&&(n-=t.wrapper.children(".k-grid-footer").outerHeight()),e=function(e){var t,r;return e[0].style.height?!0:(t=e.height(),e.height("auto"),r=e.height(),t!=r?(e.height(""),!0):(e.height(""),!1))},e(t.wrapper)&&(n>2*l?(t.lockedContent&&(l=t.table[0].offsetWidth>t.table.parent()[0].clientWidth?l:0,t.lockedContent.height(n-l)),t.content.height(n)):t.content.height(2*l+1)))},_averageRowHeight:function(){var e,t=this,r=t._items(t.tbody).length,n=t._rowHeight;return 0===r?n:(t._rowHeight||(t._rowHeight=n=t.table.outerHeight()/r,t._sum=n,t._measures=1),e=t.table.outerHeight()/r,n!==e&&(t._measures++,t._sum+=e,t._rowHeight=t._sum/t._measures),n)},_dataSource:function(){var e,r=this,n=r.options,o=n.dataSource;o=Ce(o)?{data:o}:o,be(o)&&(_e(o,{table:r.table,fields:r.columns}),e=n.pageable,be(e)&&e.pageSize!==t&&(o.pageSize=e.pageSize)),r.dataSource&&r._refreshHandler?r.dataSource.unbind(Ve,r._refreshHandler).unbind(Ie,r._progressHandler).unbind(Ae,r._errorHandler):(r._refreshHandler=xe(r.refresh,r),r._progressHandler=xe(r._requestStart,r),r._errorHandler=xe(r._error,r)),r.dataSource=pe.create(o).bind(Ve,r._refreshHandler).bind(Ie,r._progressHandler).bind(Ae,r._errorHandler)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_modelChange:function(t){var r,n,o,l,a,i,s,d,c,u,h=this,p=h.tbody,f=t.model,g=h.tbody.find("tr["+ue.attr("uid")+"="+f.uid+"]"),m=g.hasClass("k-alt"),k=h._items(p).index(g),b=h.lockedContent;if(b&&(r=h._relatedRow(g)),g.add(r).children(".k-edit-cell").length&&!h.options.rowTemplate)g.add(r).children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){n=e(this),o=E(h.columns)[h.cellIndex(n)],o.field===t.field&&(n.hasClass("k-edit-cell")?n.addClass("k-dirty-cell"):(h._displayCell(n,o,f),e('<span class="k-dirty"/>').prependTo(n)))});else if(!g.hasClass("k-grid-edit-row")){for(i=e().add(g),b&&(l=(m?h.lockedAltRowTemplate:h.lockedRowTemplate)(f),i=i.add(r),r.replaceWith(l)),h.angular("cleanup",function(){return{elements:i.get()}}),l=(m?h.altRowTemplate:h.rowTemplate)(f),g.replaceWith(l),l=h._items(p).eq(k),u=[{dataItem:f}],b&&(g=g.add(r),r=h._relatedRow(l)[0],ne(l[0],r),l=l.add(r),u.push({dataItem:f})),h.angular("compile",function(){return{elements:l.get(),data:u}}),a=h.options.selectable,a&&g.hasClass("k-state-selected")&&h.select(l),d=i.children(":not(.k-group-cell,.k-hierarchy-cell)"),s=l.children(":not(.k-group-cell,.k-hierarchy-cell)"),k=0,c=h.columns.length;c>k;k++)o=h.columns[k],n=s.eq(k),a&&d.eq(k).hasClass("k-state-selected")&&n.addClass("k-state-selected"),o.field===t.field&&e('<span class="k-dirty"/>').prependTo(n);h.trigger("itemChange",{item:l,data:f,ns:he})}},_pageable:function(){var t,r=this,n=r.options.pageable;n&&(t=r.wrapper.children("div.k-grid-pager"),t.length||(t=e('<div class="k-pager-wrap k-grid-pager"/>').appendTo(r.wrapper)),r.pager&&r.pager.destroy(),r.pager="object"==typeof n&&n instanceof ue.ui.Pager?n:new ue.ui.Pager(t,_e({},n,{dataSource:r.dataSource})))},_footer:function(){var t,r,n,o,l=this,a=l.dataSource.aggregates(),i="",s=l.footerTemplate,d=l.options,c=l.footer||l.wrapper.find(".k-grid-footer");s?(i=e(l._wrapFooter(s(a))),c.length?(r=i,l.angular("cleanup",function(){return{elements:c.get()}}),c.replaceWith(r),c=l.footer=r):c=l.footer=d.scrollable?d.pageable?i.insertBefore(l.wrapper.children("div.k-grid-pager")):i.appendTo(l.wrapper):i.insertBefore(l.tbody),l.angular("compile",function(){return{elements:c.find("td:not(.k-group-cell, .k-hierarchy-cell)").get(),data:ve(l.columns,function(e){return{column:e,aggregate:a[e.field]}})}})):c&&!l.footer&&(l.footer=c),c.length&&(d.scrollable&&(t=c.attr("tabindex",-1).children(".k-grid-footer-wrap"),l.scrollables=l.scrollables.filter(function(){return!e(this).is(".k-grid-footer-wrap")}).add(t)),l._footerWidth&&c.find("table").css("width",l._footerWidth),t&&(n=l.content.scrollLeft(),o=d.scrollable!==!0&&d.scrollable.virtual&&!l.virtualScrollable,o&&(n=l.wrapper.find(".k-virtual-scrollable-wrap").scrollLeft()),t.scrollLeft(n))),l.lockedContent&&(l._appendLockedColumnFooter(),l._applyLockedContainersWidth(),l._syncLockedFooterHeight())},_wrapFooter:function(t){var r=this,n="",o=ue.support.mobileOS?0:ue.support.scrollbar();return r.options.scrollable?(n=e('<div class="k-grid-footer"><div class="k-grid-footer-wrap"><table'+(Ct?' cellspacing="0"':"")+"><tbody>"+t+"</tbody></table></div></div>"),r._appendCols(n.find("table")),n.css(vt?"padding-left":"padding-right",o),n):'<tfoot class="k-grid-footer">'+t+"</tfoot>"},_columnMenu:function(){var e,r,n,o,l,a,i,s,d,c=this,u=E(c.columns),h=c.options,p=h.columnMenu,f=we(c.columns,function(e){return e.columns!==t}).length>0,g=this._isMobile,m=function(e){c.trigger(je,{field:e.field,container:e.container})},k=function(e){le(e.closest("table"),!0)},b=h.$angular;if(p)for("boolean"==typeof p&&(p={}),a=N(c.thead),i=0,s=a.length;s>i;i++)r=u[i],d=a.eq(i),r.command||!r.field&&!d.attr("data-"+ue.ns+"field")||(e=d.data("kendoColumnMenu"),e&&e.destroy(),o=r.sortable!==!1&&p.sortable!==!1&&h.sortable!==!1?_e({},h.sortable,{compare:(r.sortable||{}).compare}):!1,l=h.filterable&&r.filterable!==!1&&p.filterable!==!1?_e({pane:c.pane},h.filterable,r.filterable):!1,r.filterable&&r.filterable.dataSource&&(l.forceUnique=!1,l.checkSource=r.filterable.dataSource),l&&(l.format=r.format),n={dataSource:c.dataSource,values:r.values,columns:p.columns,sortable:o,filterable:l,messages:p.messages,owner:c,closeCallback:k,init:m,pane:c.pane,filter:g?":not(.k-column-active)":"",lockedColumns:!f&&r.lockable!==!1&&D(u).length>0},b&&(n.$angular=b),d.kendoColumnMenu(n))},_headerCells:function(){return this.thead.find("th").filter(function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")})},_filterable:function(){var e,t,r,n,o,l,a,i=this,s=E(i.columns),d=function(e){i.trigger(Oe,{field:e.field,container:e.container})},c=function(e){le(e.closest("table"),!0)},u=i.options.filterable;if(u&&typeof u.mode==dt&&-1==u.mode.indexOf("menu")&&(u=!1),u&&!i.options.columnMenu)for(t=N(i.thead),n=0,o=t.length;o>n;n++)r=t.eq(n),s[n].filterable===!1||s[n].command||!s[n].field&&!r.attr("data-"+ue.ns+"field")||(e=r.data("kendoFilterMenu"),e&&e.destroy(),e=r.data("kendoFilterMultiCheck"),e&&e.destroy(),l=s[n].filterable,a=_e({},u,l,{dataSource:i.dataSource,values:s[n].values,format:s[n].format,closeCallback:c,title:s[n].title||s[n].field,init:d,pane:i.pane}),l&&l.messages&&(a.messages=_e(!0,{},u.messages,l.messages)),l&&l.dataSource&&(a.forceUnique=!1,a.checkSource=l.dataSource),l&&l.multi?r.kendoFilterMultiCheck(a):r.kendoFilterMenu(a))},_filterRow:function(){var t,r,n,o,l,a,i,s,d,c,u,h,p,f,g=this;if(g._hasFilterRow())for(r=g.options.$angular,n=E(g.columns),o=g.options.filterable,l=g.thead.find(".k-filter-row"),this._updateHeader(this.dataSource.group().length),a=0;n.length>a;a++)if(s=n[a],d=g.options.filterable.operators,c=!1,u=e("<th/>"),h=s.field,s.hidden&&u.hide(),l.append(u),h&&s.filterable!==!1){if(p=s.filterable&&s.filterable.cell||{},i=g.options.dataSource,i instanceof pe&&(i=g.options.dataSource.options),f=_e(!0,{},o.messages),s.filterable&&_e(!0,f,s.filterable.messages),p.enabled===!1){u.html("&nbsp;");continue}p.dataSource&&(i=p.dataSource,c=!0),s.filterable&&s.filterable.operators&&(d=s.filterable.operators),t={column:s,dataSource:g.dataSource,suggestDataSource:i,customDataSource:c,field:h,messages:f,values:s.values,template:p.template,delay:p.delay,inputWidth:p.inputWidth,suggestionOperator:p.suggestionOperator,minLength:p.minLength,dataTextField:p.dataTextField,operator:p.operator,operators:d,showOperators:p.showOperators},r&&(t.$angular=r),e("<span/>").attr(ue.attr("field"),h).appendTo(u).kendoFilterCell(t)}else u.html("&nbsp;")},_sortable:function(){var e,t,r,n,o,l,a=this,i=E(a.columns),s=a.options.sortable;if(s){for(n=N(a.thead),o=0,l=n.length;l>o;o++)e=i[o],e.sortable!==!1&&!e.command&&e.field&&(r=n.eq(o),t=r.data("kendoColumnSorter"),t&&t.destroy(),r.attr("data-"+ue.ns+"field",e.field).kendoColumnSorter(_e({},s,e.sortable,{dataSource:a.dataSource,aria:!0,filter:":not(.k-column-active)"})));n=null}},_columns:function(t){var r,n,o,l=this,a=l.table,i=a.find("col"),d=l.options.dataSource;if(t=t.length?t:ve(a.find("th"),function(t,r){t=e(t);var n=t.attr(ue.attr("sortable")),o=t.attr(ue.attr("filterable")),l=t.attr(ue.attr("type")),a=t.attr(ue.attr("groupable")),s=t.attr(ue.attr("field")),d=t.attr(ue.attr("title")),c=t.attr(ue.attr("menu"));return s||(s=t.text().replace(/\s|[^A-z0-9]/g,"")),{field:s,type:l,title:d,sortable:"false"!==n,filterable:"false"!==o,groupable:"false"!==a,menu:c,template:t.attr(ue.attr("template")),width:i.eq(r).css("width")}}),r=!(l.table.find("tbody tr").length>0&&(!d||!d.transport)),l.options.scrollable){if(o=t,n=D(t),t=F(t),n.length>0&&0===t.length)throw Error("There should be at least one non locked column");G(l.element.find("tr:has(th):first"),o),t=n.concat(t)}l.columns=s(t,r)},_groups:function(){var e=this.dataSource.group();return e?e.length:0},_tmpl:function(e,t,o,l){var a,i,s,d,c=this,u=_e({},ue.Template,c.options.templateSettings),h=t.length,p={storage:{},count:0},f=c._hasDetails(),g=[],m=c._groups();if(!e){for(e="<tr",o&&g.push("k-alt"),f&&g.push("k-master-row"),g.length&&(e+=' class="'+g.join(" ")+'"'),h&&(e+=" "+ue.attr("uid")+'="#='+ue.expr("uid",u.paramName)+'#"'),e+=" role='row'>",m>0&&!l&&(e+=r(m)),f&&(e+='<td class="k-hierarchy-cell"><a class="k-icon k-plus" href="\\#" tabindex="-1"></a></td>'),a=0;h>a;a++)s=t[a],i=s.template,d=typeof i,e+="<td"+n(s.attributes)+" role='gridcell'>",e+=c._cellTmpl(s,p),e+="</td>";e+="</tr>"}return e=ue.template(e,u),p.count>0?xe(e,p.storage):e},_headerCellText:function(e){var t=this,r=_e({},ue.Template,t.options.templateSettings),n=e.headerTemplate,o=typeof n,l=e.title||e.field||"";return o===st?l=ue.template(n,r)({}):o===dt&&(l=n),l},_cellTmpl:function(e,t){var r,n,o=this,l=_e({},ue.Template,o.options.templateSettings),a=e.template,i=l.paramName,s=e.field,d="",c=e.format,u=typeof a,h=e.values;if(e.command){if(Ce(e.command)){for(r=0,n=e.command.length;n>r;r++)d+=o._createButton(e.command[r]);return d.replace(gt,"\\#")}return o._createButton(e.command).replace(gt,"\\#")}return u===st?(t.storage["tmpl"+t.count]=a,d+="#=this.tmpl"+t.count+"("+i+")#",t.count++):u===dt?d+=a:h&&h.length&&be(h[0])&&"value"in h[0]&&s?(d+="#var v ="+ue.stringify(K(h)).replace(gt,"\\#")+"#",d+="#var f = v[",l.useWithBlock||(d+=i+"."),d+=s+"]#",d+="${f != null ? f : ''}"):(d+=e.encoded?"#:":"#=",c&&(d+='kendo.format("'+c.replace(ft,"\\$1")+'",'),s?(s=ue.expr(s,i),d+=s+"==null?'':"+s):d+="''",c&&(d+=")"),d+="#"),d},_templates:function(){var t=this,r=t.options,n=t.dataSource,o=n.group(),l=t.footer||t.wrapper.find(".k-grid-footer"),a=n.aggregate(),i=E(t.columns),s=E(D(t.columns)),d=r.scrollable?E(F(t.columns)):i;if(r.scrollable&&s.length){if(r.rowTemplate||r.altRowTemplate)throw Error("Having both row template and locked columns is not supported");t.rowTemplate=t._tmpl(r.rowTemplate,d,!1,!0),t.altRowTemplate=t._tmpl(r.altRowTemplate||r.rowTemplate,d,!0,!0),t.lockedRowTemplate=t._tmpl(r.rowTemplate,s),t.lockedAltRowTemplate=t._tmpl(r.altRowTemplate||r.rowTemplate,s,!0)}else t.rowTemplate=t._tmpl(r.rowTemplate,d),t.altRowTemplate=t._tmpl(r.altRowTemplate||r.rowTemplate,d,!0);t._hasDetails()&&(t.detailTemplate=t._detailTmpl(r.detailTemplate||"")),(t._group&&!He(a)||!He(a)&&!l.length||we(i,function(e){return e.footerTemplate}).length)&&(t.footerTemplate=t._footerTmpl(i,a,"footerTemplate","k-footer-template")),o&&we(i,function(e){return e.groupFooterTemplate}).length&&(a=e.map(o,function(e){return e.aggregates}),t.groupFooterTemplate=t._footerTmpl(d,a,"groupFooterTemplate","k-group-footer",s.length),r.scrollable&&s.length&&(t.lockedGroupFooterTemplate=t._footerTmpl(s,a,"groupFooterTemplate","k-group-footer"))),t.options.noRecords&&(t.noRecordsTemplate=t._noRecordsTmpl())},_noRecordsTmpl:function(){var t,r,n,o='<div class="{0}">{1}</div>',l='<div class="k-grid-norecords-template"{1}>{0}</div>',a=this.options.scrollable&&!this.wrapper[0].style.height?' style="margin:0 auto;position:static;"':"",i={storage:{},count:0},s=e.extend({},ue.Template,this.options.templateSettings),d=s.paramName,c="";return t=this.options.noRecords.template?this.options.noRecords.template:ue.format(l,this.options.messages.noRecords,a),r=typeof t,"function"===r?(i.storage["tmpl"+i.count]=t,c+="#=this.tmpl"+i.count+"("+d+")#",i.count++):"string"===r&&(c+=t),n=ue.template(ue.format(o,Ze,c),s),i.count>0&&(n=e.proxy(n,i.storage)),n},_footerTmpl:function(e,t,o,l,a){var i,s,d,c,u,h=this,p=_e({},ue.Template,h.options.templateSettings),f=p.paramName,g="",m={},k=0,b={},_=h._groups(),v=h.dataSource._emptyAggregates(t);for(g+='<tr class="'+l+'">',_>0&&!a&&(g+=r(_)),h._hasDetails()&&(g+='<td class="k-hierarchy-cell">&nbsp;</td>'),i=0,s=e.length;s>i;i++)u=e[i],d=u[o],c=typeof d,g+="<td"+n(u.footerAttributes)+">",d?(c!==st&&(b=v[u.field]?_e({},p,{paramName:f+"['"+u.field+"']"}):{},d=ue.template(d,b)),m["tmpl"+k]=d,g+="#=this.tmpl"+k+"("+f+")#",k++):g+="&nbsp;",g+="</td>";return g+="</tr>",g=ue.template(g,p),k>0?xe(g,m):g},_detailTmpl:function(e){var t=this,n="",o=_e({},ue.Template,t.options.templateSettings),l=o.paramName,a={},i=0,s=t._groups(),d=f(E(t.columns)).length,c=typeof e;return n+='<tr class="k-detail-row">',s>0&&(n+=r(s)),n+='<td class="k-hierarchy-cell"></td><td class="k-detail-cell"'+(d?' colspan="'+d+'"':"")+">",c===st?(a["tmpl"+i]=e,n+="#=this.tmpl"+i+"("+l+")#",i++):n+=e,n+="</td></tr>",n=ue.template(n,o),i>0?xe(n,a):n},_hasDetails:function(){var e=this;return null!==e.options.detailTemplate||(e._events[Pe]||[]).length},_hasFilterRow:function(){var t=this.options.filterable,r=t&&typeof t.mode==dt&&-1!=t.mode.indexOf("row"),n=this.columns,o=e.grep(n,function(e){return e.filterable===!1});return n.length&&o.length==n.length&&(r=!1),r},_details:function(){var t=this;if(t.options.scrollable&&t._hasDetails()&&D(t.columns).length)throw Error("Having both detail template and locked columns is not supported");t.table.on(lt+We,".k-hierarchy-cell .k-plus, .k-hierarchy-cell .k-minus",function(r){var n,o,l=e(this),a=l.hasClass("k-plus"),i=l.closest("tr.k-master-row"),s=t.detailTemplate,d=t._hasDetails();return l.toggleClass("k-plus",!a).toggleClass("k-minus",a),n=i.next(),d&&!n.hasClass("k-detail-row")&&(o=t.dataItem(i),n=e(s(o)).addClass(i.hasClass("k-alt")?"k-alt":"").insertAfter(i),t.angular("compile",function(){return{elements:n.get(),data:[{dataItem:o}]}}),t.trigger(Pe,{masterRow:i,detailRow:n,data:o,detailCell:n.find(".k-detail-cell")})),t.trigger(a?Qe:Xe,{masterRow:i,detailRow:n}),n.toggle(a),t._current&&t._current.attr("aria-expanded",a),r.preventDefault(),!1})},dataItem:function(t){if(t=e(t)[0],!t)return null;var r,n,o=this.tbody.children(),l=/k-grouping-row|k-detail-row|k-group-footer/,a=t.sectionRowIndex;for(n=a,r=0;a>r;r++)l.test(o[r].className)&&n--;return this._data[n]},expandRow:function(t){e(t).find("> td .k-plus, > td .k-i-expand").click()},collapseRow:function(t){e(t).find("> td .k-minus, > td .k-i-collapse").click()},_createHeaderCells:function(e,r){var o,l,a,i,s,d,c=this,u="",h=E(c.columns);for(o=0,i=e.length;i>o;o++)l=e[o].column||e[o],a=c._headerCellText(l),s="",d=ye(l,h),l.command?(u+="<th scope='col'"+n(l.headerAttributes),r&&!e[o].colSpan&&(u+=" rowspan='"+r+"'"),d>-1&&(u+=ue.attr("index")+"='"+d+"'"),u+=">"+a+"</th>"):(l.field&&(s=ue.attr("field")+"='"+l.field+"' "),u+="<th scope='col' role='columnheader' "+s,r&&!e[o].colSpan&&(u+=" rowspan='"+r+"'"),e[o].colSpan>1&&(u+='colspan="'+(e[o].colSpan-H(l.columns))+'" ',u+=ue.attr("colspan")+"='"+e[o].colSpan+"'"),l.title&&(u+=ue.attr("title")+'="'+l.title.replace('"',"&quot;").replace(/'/g,"'")+'" '),l.groupable!==t&&(u+=ue.attr("groupable")+"='"+l.groupable+"' "),l.aggregates&&l.aggregates.length&&(u+=ue.attr("aggregates")+"='"+l.aggregates+"'"),d>-1&&(u+=ue.attr("index")+"='"+d+"'"),u+=n(l.headerAttributes),u+=">"+a+"</th>");return u},_appendLockedColumnContent:function(){var t,r,n,o,l,a=this.columns,i=this.table.find("colgroup"),s=i.find("col:not(.k-group-col,.k-hierarchy-col)"),d=e(),c=0,u=0;for(t=0,r=a.length;r>t;t++)if(a[t].locked)if(p(a[t])){for(o=1,a[t].columns&&(o=E(a[t].columns).length-H(a[t].columns)),o=o||1,l=0;o>l;l++)d=d.add(s.eq(t+u+l-c));u+=o-1}else c++;n=e('<div class="k-grid-content-locked"><table'+(Ct?' cellspacing="0"':"")+"><colgroup/><tbody></tbody></table></div>"),
i.detach(),n.find("colgroup").append(d),i.insertBefore(this.table.find("tbody")),this.lockedContent=n.insertBefore(this.content),this.lockedTable=n.children("table")},_appendLockedColumnFooter:function(){var t,r,n=this,o=n.footer,l=o.find(".k-footer-template>td"),a=o.find(".k-grid-footer-wrap>table>colgroup>col"),i=e('<div class="k-grid-footer-locked"><table><colgroup /><tbody><tr class="k-footer-template"></tr></tbody></table></div>'),s=n._groups(),d=e(),c=e();for(d=d.add(l.filter(".k-group-cell")),t=0,r=E(D(n.columns)).length;r>t;t++)d=d.add(l.eq(t+s));for(c=c.add(a.filter(".k-group-col")),t=0,r=f(E(M(n.columns))).length;r>t;t++)c=c.add(a.eq(t+s));d.appendTo(i.find("tr")),c.appendTo(i.find("colgroup")),n.lockedFooter=i.prependTo(o)},_appendLockedColumnHeader:function(t){var r,n,o,l,a,i,s,d,c,u,h,f=this,m=this.columns,k=[],b=0,_=e(),v=f._hasFilterRow(),w=0,C=e(),y=0,T=e(),x=f.thead.prev().find("col:not(.k-group-col,.k-hierarchy-col)"),S=f.thead.find("tr:first .k-header:not(.k-group-cell,.k-hierarchy-cell)"),R=f.thead.find(".k-filter-row").find("th:not(.k-group-cell,.k-hierarchy-cell)"),A=0;for(r=0,o=m.length;o>r;r++){if(m[r].locked){if(s=S.eq(r),y=E(m[r].columns||[]).length,p(m[r])){for(d=null,m[r].columns&&(d=y-H(m[r].columns)),d=d||1,c=0;d>c;c++)_=_.add(x.eq(r+A+c-b));A+=d-1}for(z([m[r]],P(s),k,0,0),y=y||1,u=0;y>u;u++)C=C.add(R.eq(w+u));w+=y}m[r].columns&&(b+=H(m[r].columns)),p(m[r])||b++}if(k.length){for(n='<div class="k-grid-header-locked" style="width:1px"><table'+(Ct?' cellspacing="0"':"")+"><colgroup/><thead>",n+=Array(k.length+1).join("<tr></tr>"),n+=(v?'<tr class="k-filter-row" />':"")+"</thead></table></div>",i=e(n),x=i.find("colgroup"),x.append(f.thead.prev().find("col.k-group-col").add(_)),l=i.find("thead tr:not(.k-filter-row)"),r=0,o=k.length;o>r;r++)T=g(k[r]),l.eq(r).append(f.thead.find("tr:eq("+r+") .k-group-cell").add(T));return h=L(this.thead),h>k.length&&I(i,h-k.length),a=i.find(".k-filter-row"),a.append(f.thead.find(".k-filter-row .k-group-cell").add(C)),this.lockedHeader=i.prependTo(t),this.thead.find(".k-group-cell").remove(),!0}return!1},_removeLockedContainers:function(){var e=this.lockedHeader.add(this.lockedContent).add(this.lockedFooter);ue.destroy(e),e.off(We).remove(),this.lockedHeader=this.lockedContent=this.lockedFooter=null,this.selectable=null},_thead:function(){var t,r,n,o,l,a,i,s=this,d=s.columns,c=s._hasDetails()&&d.length,u=s._hasFilterRow(),h="",p=s.table.find(">thead"),f=s.element.find("thead:first").length>0;if(p.length||(p=e("<thead/>").insertBefore(s.tbody)),s.lockedHeader&&s.thead?(r=s.thead.find("tr:has(th):not(.k-filter-row)").html(""),r.remove(),r=e(),s._removeLockedContainers()):r=s.element.find(f?"thead:first tr:has(th):not(.k-filter-row)":"tr:has(th):first"),!r.length&&(r=p.children().first(),!r.length)){for(n=[{rowSpan:1,cells:[],index:0}],s._prepareColumns(n,d),t=0;n.length>t;t++)h+="<tr>",c&&(h+='<th class="k-hierarchy-cell" scope="col">&nbsp;</th>'),h+=s._createHeaderCells(n[t].cells,n[t].rowSpan),h+="</tr>";r=e(h)}u&&(o=e("<tr/>"),o.addClass("k-filter-row"),(c||r.find(".k-hierarchy-cell").length)&&o.prepend('<th class="k-hierarchy-cell" scope="col">&nbsp;</th>'),l=(s.thead||p).find(".k-filter-row"),l.length&&(ue.destroy(l),l.remove()),p.append(o)),r.children().length?c&&!r.find(".k-hierarchy-cell")[0]&&r.prepend('<th class="k-hierarchy-cell" scope="col">&nbsp;</th>'):(h="",c&&(h+='<th class="k-hierarchy-cell" scope="col">&nbsp;</th>'),h+=s._createHeaderCells(d),r.html(h)),r.attr("role","row").find("th").addClass("k-header"),s.options.scrollable||p.addClass("k-grid-header"),r.find("script").remove().end().prependTo(p),s.thead&&s._destroyColumnAttachments(),this.angular("cleanup",function(){return{elements:p.find("th").get()}}),this.angular("compile",function(){return{elements:p.find("th").get(),data:ve(d,function(e){return{column:e}})}}),s.thead=p.attr("role","rowgroup"),s._sortable(),s._filterable(),s._filterRow(),s._scrollable(),s._updateCols(),s._columnMenu(),i=this.options.scrollable&&D(this.columns).length,i&&(a=s._appendLockedColumnHeader(s.thead.closest(".k-grid-header")),s._appendLockedColumnContent(),s.lockedContent.bind("DOMMouseScroll"+We+" mousewheel"+We,xe(s._wheelScroll,s))),s._updateColumnCellIndex(),s._updateFirstColumnClass(),s._resizable(),s._draggable(),s._reorderable(),s._updateHeader(s._groups()),i&&(a&&s._syncLockedHeaderHeight(),s._applyLockedContainersWidth()),s.groupable&&s._attachGroupable()},_retrieveFirstColumn:function(t,r){var n,o=e();if(r.length&&t[0]){for(n=t[0];n.columns&&n.columns.length;)n=n.columns[0],r=r.filter(":not(:first())");o=o.add(r)}return o},_updateFirstColumnClass:function(){var t,r,n=this,o=n.columns||[],l=n._hasDetails()&&o.length;l||n._groups()||(t=n.thead.find(">tr:not(.k-filter-row):not(:first)"),o=F(o),r=n._retrieveFirstColumn(o,t),n._isLocked()&&(t=n.lockedHeader.find("thead>tr:not(.k-filter-row):not(:first)"),o=D(n.columns),r=r.add(n._retrieveFirstColumn(o,t))),r.each(function(){var t=e(this).find("th");t.removeClass("k-first"),t.eq(0).addClass("k-first")}))},_prepareColumns:function(e,t,r,n){var o,l,a=n||e[e.length-1],i=e[a.index+1],s=0;for(o=0;t.length>o;o++)l={column:t[o],colSpan:0},a.cells.push(l),t[o].columns&&t[o].columns.length&&(i||(i={rowSpan:0,cells:[],index:e.length},e.push(i)),l.colSpan=t[o].columns.length,this._prepareColumns(e,t[o].columns,l,i),s+=l.colSpan-1,a.rowSpan=e.length-a.index);r&&(r.colSpan+=s)},_wheelScroll:function(t){var r,n,o;t.ctrlKey||(r=this.content,this.options.scrollable.virtual&&(r=this.virtualScrollable.verticalScrollbar),n=r.scrollTop(),o=ue.wheelDeltaY(t),o&&(t.preventDefault(),e(t.currentTarget).one("wheel"+We,!1),r.scrollTop(n+-o)))},_isLocked:function(){return null!=this.lockedHeader},_updateHeaderCols:function(){var e=this.thead.parent().add(this.table);this._isLocked()?U(e,W(q(this.columns)),this._hasDetails(),0):U(e,W(f(this.columns)),this._hasDetails(),0)},_updateCols:function(e){e=e||this.thead.parent().add(this.table),this._appendCols(e,this._isLocked())},_updateLockedCols:function(e){this._isLocked()&&(e=e||this.lockedHeader.find("table").add(this.lockedTable),U(e,W(M(this.columns)),this._hasDetails(),this._groups()))},_appendCols:function(e,t){t?U(e,W(q(this.columns)),this._hasDetails(),0):U(e,W(f(this.columns)),this._hasDetails(),this._groups())},_autoColumns:function(e){if(e&&e.toJSON){var t,r,n=this;e=e.toJSON(),r=!(n.table.find("tbody tr").length>0&&(!n.dataSource||!n.dataSource.transport));for(t in e)n.columns.push({field:t,encoded:r,headerAttributes:{id:ue.guid()}});n._thead(),n._templates()}},_rowsHtml:function(e,t){var r,n,o=this,l="",a=t.rowTemplate,i=t.altRowTemplate;for(r=0,n=e.length;n>r;r++)l+=r%2?i(e[r]):a(e[r]),o._data.push(e[r]);return l},_groupRowHtml:function(e,t,r,n,o,l){var a,i,s=this,d="",c=e.field,u=we(E(s.columns),function(e){return e.field==c})[0]||{},h=u.groupHeaderTemplate,p=(u.title||c)+": "+$(e.value,u.format,u.values,u.encoded),f=s._groupAggregatesDefaultObject||{},g=_e({},f,e.aggregates),m=_e({},{field:e.field,value:e.value,aggregates:g},e.aggregates[e.field]),k=o.groupFooterTemplate,b=e.items;if(h&&(p=typeof h===st?h(m):ue.template(h)(m)),d+=n(t,r,p),e.hasSubgroups)for(a=0,i=b.length;i>a;a++)d+=s._groupRowHtml(b[a],l?t:t-1,r+1,n,o,l);else d+=s._rowsHtml(b,o);return k&&(d+=k(g)),d},collapseGroup:function(t){var r,n,o,l,a,i,s,d,c,u;for(t=e(t),n=this.options.groupable,o=n.showFooter,l=o?0:1,i=e(),this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?i=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(i=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),r=t.find(".k-group-cell").length,t.find(".k-i-collapse").addClass("k-i-expand").removeClass("k-i-collapse"),t.find("td[aria-expanded='true']:first").attr("aria-expanded",!1),t=t.nextAll("tr"),u=[],s=0,d=t.length;d>s&&(c=t.eq(s),a=c.find(".k-group-cell").length,c.hasClass("k-grouping-row")?l++:c.hasClass("k-group-footer")&&l--,!(r>=a||c.hasClass("k-group-footer")&&0>l));s++)i.length&&u.push(i[s]),u.push(c[0]);e(u).hide()},expandGroup:function(t){t=e(t);var r,n,o,l,a,i=this,s=i.options.groupable.showFooter,d=e(),c=[],u=1;for(this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?d=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(d=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),r=t.find(".k-group-cell").length,t.find(".k-i-expand").addClass("k-i-collapse").removeClass("k-i-expand"),t.find("td[aria-expanded='false']:first").attr("aria-expanded",!0),t=t.nextAll("tr"),l=0,a=t.length;a>l&&(n=t.eq(l),o=n.find(".k-group-cell").length,!(r>=o));l++)o!=r+1||n.hasClass("k-detail-row")||(n.show(),d.eq(l).show(),n.hasClass("k-grouping-row")&&n.find(".k-icon").hasClass("k-i-collapse")&&i.expandGroup(n),n.hasClass("k-master-row")&&n.find(".k-icon").hasClass("k-minus")&&(n.next().show(),d.eq(l+1).show())),n.hasClass("k-grouping-row")&&(s&&c.push(n.is(":visible")),u++),n.hasClass("k-group-footer")&&(s&&n.toggle(c.pop()),1==u?(n.show(),d.eq(l).show()):u--)},_updateHeader:function(t){var r=this,n=r._isLocked()?r.lockedHeader.find("thead"):r.thead,o=n.find("tr.k-filter-row").find("th.k-group-cell").length,l=n.find("tr:first").find("th.k-group-cell").length,a=n.children("tr:not(:first)").filter(function(){return!e(this).children(":visible").length});t>l?(e(Array(t-l+1).join('<th class="k-group-cell k-header" scope="col">&nbsp;</th>')).prependTo(n.children("tr:not(.k-filter-row)")),r.element.is(":visible")&&a.find("th.k-group-cell").hide()):l>t&&n.find("tr").each(function(){e(this).find("th.k-group-cell").filter(":eq("+t+"),:gt("+t+")").remove()}),t>o&&e(Array(t-o+1).join('<th class="k-group-cell k-header" scope="col">&nbsp;</th>')).prependTo(n.find(".k-filter-row"))},_firstDataItem:function(e,t){return e&&t&&(e=e.hasSubgroups?this._firstDataItem(e.items[0],t):e.items[0]),e},_updateTablesWidth:function(){var t,r=this;r._isLocked()&&(t=e(">.k-grid-footer>.k-grid-footer-wrap>table",r.wrapper).add(r.thead.parent()).add(r.table),r._footerWidth=te(t.eq(0)),t.width(r._footerWidth),t=e(">.k-grid-footer>.k-grid-footer-locked>table",r.wrapper).add(r.lockedHeader.find(">table")).add(r.lockedTable),t.width(te(t.eq(0))))},hideColumn:function(r){var n,o,l,i,s,d,c,g,m,k,b=this,_=0,v=b.footer||b.wrapper.find(".k-grid-footer"),w=b.columns,C=b.lockedHeader?N(b.lockedHeader.find(">table>thead")).filter(h).length:0;if(r="number"==typeof r?w[r]:be(r)?we(S(w),function(e){return e===r})[0]:we(S(w),function(e){return e.field===r})[0],r&&p(r)){if(r.columns&&r.columns.length){for(d=T(r,w),u(r,!1),Q(a(e(">table>thead",b.lockedHeader),b.thead,">tr:eq("+d.row+")>th"),d.cell,!1),l=0;r.columns.length>l;l++)this.hideColumn(r.columns[l]);return b.trigger(Ue,{column:r}),t}if(m=ye(r,f(E(w))),u(r,!1),b._setParentsVisibility(r,!1),b._templates(),b._updateCols(),b._updateLockedCols(),k=b.thead,c=m,b.lockedHeader&&C>m?k=b.lockedHeader.find(">table>thead"):c-=C,n=N(k).filter(h).eq(c),n[0].style.display="none",Q(a(e(">table>thead",b.lockedHeader),b.thead,">tr.k-filter-row>th"),m,!1),v[0]&&(b._updateCols(v.find(">.k-grid-footer-wrap>table")),b._updateLockedCols(v.find(">.k-grid-footer-locked>table")),Q(v.find(".k-footer-template>td"),m,!1)),b.lockedTable&&C>m?X(b.lockedTable.find(">tbody>tr"),m):X(b.tbody.children(),m-C),b.lockedTable)b._updateTablesWidth(),b._applyLockedContainersWidth(),b._syncLockedContentHeight(),b._syncLockedHeaderHeight(),b._syncLockedFooterHeight();else{for(i=b.thead.prev().find("col"),l=0,g=i.length;g>l;l+=1){if(s=i[l].style.width,!s||-1!=s.indexOf("%")){_=0;break}_+=parseInt(s,10)}o=e(">.k-grid-header table:first,>.k-grid-footer table:first",b.wrapper).add(b.table),b._footerWidth=null,_&&(o.each(function(){this.style.width=_+"px"}),b._footerWidth=_),wt.msie&&8==wt.version&&(o.css("display","inline-table"),setTimeout(function(){o.css("display","table")},1))}b._updateFirstColumnClass(),b.trigger(Ue,{column:r})}},_setParentsVisibility:function(t,r){var n,o,l,i,s,d=this.columns,h=[],p=r?function(e){return f(e.columns).length&&e.hidden}:function(e){return!f(e.columns).length&&!e.hidden};if(c(t,d,h)&&h.length)for(n=h.length-1;n>=0;n--)o=h[n],l=w(o,d),i=a(e(">table>thead",this.lockedHeader),this.thead,">tr:eq("+l.row+")>th:not(.k-group-cell):not(.k-hierarchy-cell)").eq(l.cell),p(o)&&(u(o,r),i[0].style.display=r?"":"none"),i.filter("["+ue.attr("colspan")+"]").length&&(s=parseInt(i.attr(ue.attr("colspan")),10),i[0].colSpan=s-H(o.columns)||1)},showColumn:function(r){var n,o,l,i,s,d,c,h,f,g,m,k=this,b=k.columns,_=k.footer||k.wrapper.find(".k-grid-footer"),v=k.lockedHeader?N(k.lockedHeader.find(">table>thead")).length:0;if(r="number"==typeof r?b[r]:be(r)?we(S(b),function(e){return e===r})[0]:we(S(b),function(e){return e.field===r})[0],r&&!p(r)){if(r.columns&&r.columns.length){for(c=w(r,b),u(r,!0),Q(a(e(">table>thead",k.lockedHeader),k.thead,">tr:eq("+c.row+")>th"),c.cell,!0),n=0;r.columns.length>n;n++)this.showColumn(r.columns[n]);return k.trigger(Ge,{column:r}),t}if(g=ye(r,E(b)),u(r,!0),k._setParentsVisibility(r,!0),k._templates(),k._updateCols(),k._updateLockedCols(),m=k.thead,d=g,k.lockedHeader&&v>g?m=k.lockedHeader.find(">table>thead"):d-=v,l=N(m).eq(d),l[0].style.display="",Q(a(e(">table>thead",k.lockedHeader),k.thead,">tr.k-filter-row>th"),g,!0),_[0]&&(k._updateCols(_.find(">.k-grid-footer-wrap>table")),k._updateLockedCols(_.find(">.k-grid-footer-locked>table")),Q(_.find(".k-footer-template>td"),g,!0)),k.lockedTable&&v>g?Z(k.lockedTable.find(">tbody>tr"),g):Z(k.tbody.children(),g-v),k.lockedTable)k._updateTablesWidth(),k._applyLockedContainersWidth(),k._syncLockedContentHeight(),k._syncLockedHeaderHeight();else if(i=e(">.k-grid-header table:first,>.k-grid-footer table:first",k.wrapper).add(k.table),r.width){for(s=0,f=k.thead.prev().find("col"),n=0,o=f.length;o>n;n+=1){if(h=f[n].style.width,h.indexOf("%")>-1){s=0;break}s+=parseInt(h,10)}k._footerWidth=null,s&&(i.each(function(){this.style.width=s+"px"}),k._footerWidth=s)}else i.width("");k._updateFirstColumnClass(),k.trigger(Ge,{column:r})}},_progress:function(e){var t=this.element;this.lockedContent?t=this.wrapper:this.element.is("table")?t=this.element.parent():this.content&&this.content.length&&(t=this.content),ue.ui.progress(t,e)},_resize:function(e,t){this._syncLockedHeaderHeight(),this.content&&(this._setContentWidth(),this._setContentHeight()),this.virtualScrollable&&(t||this._rowHeight)&&(t&&(this._rowHeight=null),this.virtualScrollable.repaintScrollbar())},_isActiveInTable:function(){var t=ge();return this.table[0]===t||e.contains(this.table[0],t)||this._isLocked()&&(this.lockedTable[0]===t||e.contains(this.lockedTable[0],t))},refresh:function(t){var r,n=this,o=n.dataSource.view(),l=n.options.navigatable,a=e(n.current()),i=!1,s=(n.dataSource.group()||[]).length,d=n.content&&n.content.scrollLeft(),c=s+W(f(n.columns)).length;t&&"itemchange"===t.action&&n.editable||(t=t||{},n.trigger("dataBinding",{action:t.action||"rebind",index:t.index,items:t.items})||(n._angularItems("cleanup"),l&&(n._isActiveInTable()||n._editContainer&&n._editContainer.data("kendoWindow"))&&(i=a.is("th"),r=Math.max(n.cellIndex(a),0)),n._destroyEditable(),n._progress(!1),n._hideResizeHandle(),n._data=[],n.columns.length||(n._autoColumns(n._firstDataItem(o[0],s)),c=s+n.columns.length),n._group=s>0||n._group,n._group&&(n._templates(),n._updateCols(),n._updateLockedCols(),n._updateHeader(s),n._group=s>0),n._renderContent(o,c,s),n._renderLockedContent(o,c,s),n._footer(),n._renderNoRecordsContent(),n._setContentHeight(),n._setContentWidth(d),n.lockedTable&&(n.options.scrollable.virtual?n.content.find(">.k-virtual-scrollable-wrap").trigger("scroll"):n.touchScroller?n.touchScroller.movable.trigger("change"):(n.wrapper.one("scroll",function(e){e.stopPropagation()}),n.content.trigger("scroll"))),n._restoreCurrent(r,i),n.touchScroller&&n.touchScroller.contentResized(),n.selectable&&n.selectable.resetTouchEvents(),n._muteAngularRebind(function(){n._angularItems("compile")}),n.trigger($e)))},_restoreCurrent:function(r,n){var o,l,a;r===t||0>r||(this._removeCurrent(),n?this._setCurrent(this.thead.find("th:not(.k-group-cell)").eq(r)):(o=0,this._rowVirtualIndex?o=this.virtualScrollable.position(this._rowVirtualIndex):r=0,l=e(),this.lockedTable&&(l=this.lockedTable.find(">tbody>tr").eq(o)),l=l.add(this.tbody.children().eq(o)),a=l.find(">td:not(.k-group-cell):not(.k-hierarchy-cell)").eq(r),this._setCurrent(a)),this._current&&le(this._current.closest("table")[0],!0))},_angularItems:function(e){ue.ui.DataBoundWidget.fn._angularItems.call(this,e),"cleanup"===e&&this._cleanupDetailItems(),this._angularGroupItems(e),this._angularGroupFooterItems(e)},_cleanupDetailItems:function(){var e=this;e._hasDetails()&&(e.angular("cleanup",function(){return{elements:e.tbody.children(".k-detail-row")}}),e.tbody.find(".k-detail-cell").empty())},_angularGroupItems:function(t){var r=this,n=r.tbody;r.lockedContent&&(n=r.lockedTable.find("tbody")),r._group&&r.angular(t,function(){return{elements:n.children(".k-grouping-row"),data:e.map(J(r.dataSource.view()),function(e){return{dataItem:e}})}})},_angularGroupFooterItems:function(t){var r=this,n=r.tbody;r.lockedContent&&(n=r.element),r._group&&r.groupFooterTemplate&&r.angular(t,function(){return{elements:n.find(".k-group-footer"),data:e.map(Y(r.dataSource.view()),function(e){return{dataItem:e}})}})},_renderContent:function(e,t,r){var n,o,l=this,a="",i=null!=l.lockedContent,s={rowTemplate:l.rowTemplate,altRowTemplate:l.altRowTemplate,groupFooterTemplate:l.groupFooterTemplate};if(t=i?t-W(M(l.columns)).length:t,r>0)for(t=i?t-r:t,l.detailTemplate&&t++,l.groupFooterTemplate&&(l._groupAggregatesDefaultObject=l.dataSource.aggregates()),n=0,o=e.length;o>n;n++)a+=l._groupRowHtml(e[n],t,0,i?ce:de,s,i);else a+=l._rowsHtml(e,s);l.tbody=O(l.tbody,l.table,a,this.options.$angular)},_renderLockedContent:function(e,t,r){var n,o,l,a="",i={rowTemplate:this.lockedRowTemplate,altRowTemplate:this.lockedAltRowTemplate,groupFooterTemplate:this.lockedGroupFooterTemplate};if(this.lockedContent){if(l=this.lockedTable,r>0)for(t-=f(E(F(this.columns))).length,n=0,o=e.length;o>n;n++)a+=this._groupRowHtml(e[n],t,0,de,i);else a=this._rowsHtml(e,i);O(l.children("tbody"),l,a,this.options.$angular),this._syncLockedContentHeight()}},_adjustRowsHeight:function(e,t){var r,n,o,l,a=e[0].rows,i=a.length,s=t[0].rows,d=e.add(t),c=d.length,u=[];for(r=0;i>r&&s[r];r++)a[r].style.height&&(a[r].style.height=s[r].style.height=""),n=a[r].offsetHeight,o=s[r].offsetHeight,l=0,n>o?l=n:o>n&&(l=o),u.push(l);for(r=0;c>r;r++)d[r].style.display="none";for(r=0;i>r;r++)u[r]&&(a[r].style.height=s[r].style.height=u[r]+1+"px");for(r=0;c>r;r++)d[r].style.display=""}});ue.ExcelMixin&&ue.ExcelMixin.extend(St.prototype),ue.PDFMixin&&(ue.PDFMixin.extend(St.prototype),St.prototype._drawPDF=function(r){function n(){c&&a!==t?(d.unbind("change",o),d.one("change",function(){i.resolve(l)}),d.page(a)):i.resolve(l)}function o(){s._drawPDFShadow({width:s.wrapper.width()},{avoidLinks:s.options.pdf.avoidLinks}).done(function(e){var t=d.page(),o=c?d.totalPages():1,a={page:e,pageNumber:t,progress:t/o,totalPages:o};r.notify(a),l.append(a.page),o>t?d.page(t+1):n()}).fail(function(e){i.reject(e)})}var l,a,i=new e.Deferred,s=this,d=s.dataSource,c=s.options.pdf.allPages;return this._initPDFProgress(r),l=new ue.drawing.Group,a=d.page(),c?(d.bind("change",o),d.page(1)):o(),i.promise()},St.prototype._initPDFProgress=function(t){var r,n=e("<div class='k-loading-pdf-mask'><div class='k-loading-color'/></div>");n.prepend(this.wrapper.clone().css({position:"absolute",top:0,left:0})),this.wrapper.append(n),r=e("<div class='k-loading-pdf-progress'>").appendTo(n).kendoProgressBar({type:"chunk",chunkCount:10,min:0,max:1,value:0}).data("kendoProgressBar"),t.progress(function(e){r.value(e.progress)}).always(function(){ue.destroy(n),n.remove()})}),he.plugin(St),he.plugin(Tt)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,r){(r||t)()});;!function(e,define){define("kendo.panelbar.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(t){t=e(t),t.children(k).children(".k-icon").remove(),t.filter(":has(.k-panel),:has(.k-content)").children(".k-link:not(:has([class*=k-i-arrow]))").each(function(){var t=e(this),n=t.parent();t.append("<span class='k-icon "+(n.hasClass(S)?"k-i-arrow-n k-panelbar-collapse":"k-i-arrow-s k-panelbar-expand")+"'/>")})}function i(t){t=e(t),t.filter(".k-first:not(:first-child)").removeClass(w),t.filter(".k-last:not(:last-child)").removeClass(m),t.filter(":first-child").addClass(w),t.filter(":last-child").addClass(m)}var a=window.kendo,r=a.ui,s=a.keys,l=e.extend,o=e.each,d=a.template,c=r.Widget,u=/^(ul|a|div)$/i,p=".kendoPanelBar",f="img",h="href",m="k-last",g="k-link",k="."+g,v="error",_=".k-item",C=".k-group",x=C+":visible",b="k-image",w="k-first",y="expand",A="select",I="k-content",E="activate",U="collapse",D="mouseenter",T="mouseleave",G="contentLoad",S="k-state-active",O="> .k-panel",B="> .k-content",j="k-state-focused",N="k-state-disabled",R="k-state-selected",W="."+R,P="k-state-highlight",q=_+":not(.k-state-disabled)",H="> "+q+" > "+k+", .k-panel > "+q+" > "+k,L=_+".k-state-disabled > .k-link",M="> li > "+W+", .k-panel > li > "+W,$="k-state-default",F="aria-disabled",J="aria-expanded",Q="aria-hidden",V="aria-selected",z=":visible",K=":empty",X="single",Y={content:d("<div role='region' class='k-content'#= contentAttributes(data) #>#= content(item) #</div>"),group:d("<ul role='group' aria-hidden='true' class='#= groupCssClass(group) #'#= groupAttributes(group) #>#= renderItems(data) #</ul>"),itemWrapper:d("<#= tag(item) # class='#= textClass(item, group) #' #= contentUrl(item) ##= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) ##= arrow(data) #</#= tag(item) #>"),item:d("<li role='menuitem' #=aria(item)#class='#= wrapperCssClass(group, item) #'>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, panelBar: panelBar, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #</li>"),image:d("<img class='k-image' alt='' src='#= imageUrl #' />"),arrow:d("<span class='#= arrowClass(item) #'></span>"),sprite:d("<span class='k-sprite #= spriteCssClass #'></span>"),empty:d("")},Z={aria:function(e){var t="";return(e.items||e.content||e.contentUrl)&&(t+=J+"='"+(e.expanded?"true":"false")+"' "),e.enabled===!1&&(t+=F+"='true'"),t},wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" "+N:t.expanded===!0?" "+S:" k-state-default",0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),t.cssClass&&(n+=" "+t.cssClass),n},textClass:function(e,t){var n=g;return t.firstLevel&&(n+=" k-header"),n},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},arrowClass:function(e){var t="k-icon";return t+=e.expanded?" k-i-arrow-n k-panelbar-collapse":" k-i-arrow-s k-panelbar-expand"},text:function(e){return e.encoded===!1?e.text:a.htmlEncode(e.text)},tag:function(e){return e.url||e.contentUrl?"a":"span"},groupAttributes:function(e){return e.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group k-panel"},contentAttributes:function(e){return e.item.expanded!==!0?" style='display:none'":""},content:function(e){return e.content?e.content:e.contentUrl?"":"&nbsp;"},contentUrl:function(e){return e.contentUrl?'href="'+e.contentUrl+'"':""}},ee=c.extend({init:function(t,n){var i,r=this;c.fn.init.call(r,t,n),t=r.wrapper=r.element.addClass("k-widget k-reset k-header k-panelbar"),n=r.options,t[0].id&&(r._itemId=t[0].id+"_pb_active"),r._tabindex(),r._initData(n),r._updateClasses(),r._animations(n),t.on("click"+p,H,function(t){r._click(e(t.currentTarget))&&t.preventDefault()}).on(D+p+" "+T+p,H,r._toggleHover).on("click"+p,L,!1).on("keydown"+p,e.proxy(r._keydown,r)).on("focus"+p,function(){var e=r.select();r._current(e[0]?e:r._first())}).on("blur"+p,function(){r._current(null)}).attr("role","menu"),i=t.find("li."+S+" > ."+I),i[0]&&r.expand(i.parent(),!1),n.dataSource&&r._angularCompile(),a.notify(r)},events:[y,U,A,E,v,G],options:{name:"PanelBar",animation:{expand:{effects:"expand:vertical",duration:200},collapse:{duration:200}},expandMode:"multiple"},_angularCompile:function(){var e=this;e.angular("compile",function(){return{elements:e.element.children("li"),data:[{dataItem:e.options.$angular}]}})},_angularCleanup:function(){var e=this;e.angular("cleanup",function(){return{elements:e.element.children("li")}})},destroy:function(){c.fn.destroy.call(this),this.element.off(p),this._angularCleanup(),a.destroy(this.element)},_initData:function(e){var t=this;e.dataSource&&(t.element.empty(),t.append(e.dataSource,t.element))},setOptions:function(e){var t=this.options.animation;this._animations(e),e.animation=l(!0,t,e.animation),"dataSource"in e&&this._initData(e),c.fn.setOptions.call(this,e)},expand:function(n,i){var a=this,r={};return n=this.element.find(n),a._animating&&n.find("ul").is(":visible")?(a.one("complete",function(){setTimeout(function(){a.expand(n)})}),t):(a._animating=!0,i=i!==!1,n.each(function(t,s){s=e(s);var l=s.find(O).add(s.find(B));if(!s.hasClass(N)&&l.length>0){if(a.options.expandMode==X&&a._collapseAllExpanded(s))return a;n.find("."+P).removeClass(P),s.addClass(P),i||(r=a.options.animation,a.options.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}}),a._triggerEvent(y,s)||a._toggleItem(s,!1),i||(a.options.animation=r)}}),a)},collapse:function(t,n){var i=this,a={};return i._animating=!0,n=n!==!1,t=i.element.find(t),t.each(function(t,r){r=e(r);var s=r.find(O).add(r.find(B));!r.hasClass(N)&&s.is(z)&&(r.removeClass(P),n||(a=i.options.animation,i.options.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}}),i._triggerEvent(U,r)||i._toggleItem(r,!0),n||(i.options.animation=a))}),i},_toggleDisabled:function(e,t){e=this.element.find(e),e.toggleClass($,t).toggleClass(N,!t).attr(F,!t)},select:function(n){var i=this;return n===t?i.element.find(M).parent():(n=i.element.find(n),n.length?n.each(function(){var n=e(this),a=n.children(k);return n.hasClass(N)?i:(i._triggerEvent(A,n)||i._updateSelected(a),t)}):this._updateSelected(n),i)},clearSelection:function(){this.select(e())},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this},disable:function(e){return this._toggleDisabled(e,!1),this},append:function(e,t){t=this.element.find(t);var a=this._insert(e,t,t.length?t.find(O):null);return o(a.items,function(){a.group.append(this),i(this)}),n(t),i(a.group.find(".k-first, .k-last")),a.group.height("auto"),this},insertBefore:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return o(n.items,function(){t.before(this),i(this)}),i(t),n.group.height("auto"),this},insertAfter:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return o(n.items,function(){t.after(this),i(this)}),i(t),n.group.height("auto"),this},remove:function(e){e=this.element.find(e);var t=this,a=e.parentsUntil(t.element,_),r=e.parent("ul");return e.remove(),!r||r.hasClass("k-panelbar")||r.children(_).length||r.remove(),a.length&&(a=a.eq(0),n(a),i(a)),t},reload:function(t){var n=this;t=n.element.find(t),t.each(function(){var t=e(this);n._ajaxRequest(t,t.children("."+I),!t.is(z))})},_first:function(){return this.element.children(q).first()},_last:function(){var e=this.element.children(q).last(),t=e.children(x);return t[0]?t.children(q).last():e},_current:function(n){var i=this,a=i._focused,r=i._itemId;return n===t?a:(i.element.removeAttr("aria-activedescendant"),a&&a.length&&(a[0].id===r&&a.removeAttr("id"),a.children(k).removeClass(j)),e(n).length&&(r=n[0].id||r,n.attr("id",r).children(k).addClass(j),i.element.attr("aria-activedescendant",r)),i._focused=n,t)},_keydown:function(e){var t=this,n=e.keyCode,i=t._current();e.target==e.currentTarget&&(n==s.DOWN||n==s.RIGHT?(t._current(t._nextItem(i)),e.preventDefault()):n==s.UP||n==s.LEFT?(t._current(t._prevItem(i)),e.preventDefault()):n==s.ENTER||n==s.SPACEBAR?(t._click(i.children(k)),e.preventDefault()):n==s.HOME?(t._current(t._first()),e.preventDefault()):n==s.END&&(t._current(t._last()),e.preventDefault()))},_nextItem:function(e){if(!e)return this._first();var t=e.children(x),n=e.nextAll(":visible").first();return t[0]&&(n=t.children("."+w)),n[0]||(n=e.parent(x).parent(_).next()),n[0]||(n=this._first()),n.hasClass(N)&&(n=this._nextItem(n)),n},_prevItem:function(e){if(!e)return this._last();var t,n=e.prevAll(":visible").first();if(n[0])for(t=n;t[0];)t=t.children(x).children("."+m),t[0]&&(n=t);else n=e.parent(x).parent(_),n[0]||(n=this._last());return n.hasClass(N)&&(n=this._prevItem(n)),n},_insert:function(t,n,i){var r,s,o=this,d=e.isPlainObject(t),c=n&&n[0];return c||(i=o.element),s={firstLevel:i.hasClass("k-panelbar"),expanded:i.parent().hasClass(S),length:i.children().length},c&&!i.length&&(i=e(ee.renderGroup({group:s})).appendTo(n)),t instanceof a.Observable&&(t=t.toJSON()),d||e.isArray(t)?(r=e.map(d?[t]:t,function(t,n){return e("string"==typeof t?t:ee.renderItem({group:s,item:l(t,{index:n})}))}),c&&n.attr(J,!1)):(r="string"==typeof t&&"<"!=t.charAt(0)?o.element.find(t):e(t),o._updateItemsClasses(r)),{items:r,group:i}},_toggleHover:function(t){var n=e(t.currentTarget);n.parents("li."+N).length||n.toggleClass("k-state-hover",t.type==D)},_updateClasses:function(){var t,a,r=this;t=r.element.find("li > ul").not(function(){return e(this).parentsUntil(".k-panelbar","div").length}).addClass("k-group k-panel").attr("role","group"),t.parent().attr(J,!1).not("."+S).children("ul").attr(Q,!0).hide(),a=r.element.add(t).children(),r._updateItemsClasses(a),n(a),i(a)},_updateItemsClasses:function(e){for(var t=e.length,n=0;t>n;n++)this._updateItemClasses(e[n],n)},_updateItemClasses:function(t,n){var i,r,s=this._selected,l=this.options.contentUrls,o=l&&l[n],d=this.element[0];t=e(t).addClass("k-item").attr("role","menuitem"),a.support.browser.msie&&t.css("list-style-position","inside").css("list-style-position",""),t.children(f).addClass(b),r=t.children("a").addClass(g),r[0]&&(r.attr("href",o),r.children(f).addClass(b)),t.filter(":not([disabled]):not([class*=k-state])").addClass("k-state-default"),t.filter("li[disabled]").addClass("k-state-disabled").attr(F,!0).removeAttr("disabled"),t.children("div").addClass(I).attr("role","region").attr(Q,!0).hide().parent().attr(J,!1),r=t.children(W),r[0]&&(s&&s.removeAttr(V).children(W).removeClass(R),r.addClass(R),this._selected=t.attr(V,!0)),t.children(k)[0]||(i="<span class='"+g+"'/>",l&&l[n]&&t[0].parentNode==d&&(i='<a class="k-link k-header" href="'+l[n]+'"/>'),t.contents().filter(function(){return!(this.nodeName.match(u)||3==this.nodeType&&!e.trim(this.nodeValue))}).wrapAll(i)),t.parent(".k-panelbar")[0]&&t.children(k).addClass("k-header")},_click:function(e){var t,n,i,a,r,s,l,o=this,d=o.element;if(!e.parents("li."+N).length&&e.closest(".k-widget")[0]==d[0]){if(r=e.closest(k),s=r.closest(_),o._updateSelected(r),n=s.find(O).add(s.find(B)),i=r.attr(h),a=i&&("#"==i.charAt(i.length-1)||-1!=i.indexOf("#"+o.element[0].id+"-")),t=!(!a&&!n.length),n.data("animating"))return t;if(o._triggerEvent(A,s)&&(t=!0),t!==!1)return o.options.expandMode==X&&o._collapseAllExpanded(s)?t:(n.length&&(l=n.is(z),o._triggerEvent(l?U:y,s)||(t=o._toggleItem(s,l))),t)}},_toggleItem:function(e,n){var i,a,r=this,s=e.find(O),l=e.find(k),o=l.attr(h);return s.length?(this._toggleGroup(s,n),i=!0):(a=e.children("."+I),a.length&&(i=!0,a.is(K)&&o!==t?r._ajaxRequest(e,a,n):r._toggleGroup(a,n))),i},_toggleGroup:function(e,n){var i=this,a=i.options.animation,r=a.expand,s=l({},a.collapse),o=s&&"effects"in s;return e.is(z)!=n?(i._animating=!1,t):(e.parent().attr(J,!n).attr(Q,n).toggleClass(S,!n).find("> .k-link > .k-icon").toggleClass("k-i-arrow-n",!n).toggleClass("k-panelbar-collapse",!n).toggleClass("k-i-arrow-s",n).toggleClass("k-panelbar-expand",n),n?(r=l(o?s:l({reverse:!0},r),{hide:!0}),r.complete=function(){i._animationCallback()}):r=l({complete:function(e){i._triggerEvent(E,e.closest(_)),i._animationCallback()}},r),e.kendoStop(!0,!0).kendoAnimate(r),t)},_animationCallback:function(){var e=this;e.trigger("complete"),e._animating=!1},_collapseAllExpanded:function(t){var n,i=this,a=!1,r=t.find(O).add(t.find(B));return r.is(z)&&(a=!0),r.is(z)||0===r.length||(n=t.siblings(),n.find(O).add(n.find(B)).filter(function(){return e(this).is(z)}).each(function(t,n){n=e(n),a=i._triggerEvent(U,n.closest(_)),a||i._toggleGroup(n,!0)})),a},_ajaxRequest:function(t,n,i){var a=this,r=t.find(".k-panelbar-collapse, .k-panelbar-expand"),s=t.find(k),l=setTimeout(function(){r.addClass("k-loading")},100),o={},d=s.attr(h);e.ajax({type:"GET",cache:!1,url:d,dataType:"html",data:o,error:function(e,t){r.removeClass("k-loading"),a.trigger(v,{xhr:e,status:t})&&this.complete()},complete:function(){clearTimeout(l),r.removeClass("k-loading")},success:function(e){function r(){return{elements:n.get()}}try{a.angular("cleanup",r),n.html(e),a.angular("compile",r)}catch(s){var l=window.console;l&&l.error&&l.error(s.name+": "+s.message+" in "+d),this.error(this.xhr,"error")}a._toggleGroup(n,i),a.trigger(G,{item:t[0],contentElement:n[0]})}})},_triggerEvent:function(e,t){var n=this;return n.trigger(e,{item:t[0]})},_updateSelected:function(e){var t=this,n=t.element,i=e.parent(_),a=t._selected;a&&a.removeAttr(V),t._selected=i.attr(V,!0),n.find(M).removeClass(R),n.find("> ."+P+", .k-panel > ."+P).removeClass(P),e.addClass(R),e.parentsUntil(n,_).filter(":has(.k-header)").addClass(P),t._current(i[0]?i:null)},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}})}});l(ee,{renderItem:function(e){e=l({panelBar:{},group:{}},e);var t=Y.empty,n=e.item;return Y.item(l(e,{image:n.imageUrl?Y.image:t,sprite:n.spriteCssClass?Y.sprite:t,itemWrapper:Y.itemWrapper,renderContent:ee.renderContent,arrow:n.items||n.content||n.contentUrl?Y.arrow:t,subGroup:ee.renderGroup},Z))},renderGroup:function(e){return Y.group(l({renderItems:function(e){for(var t="",n=0,i=e.items,a=i?i.length:0,r=l({length:a},e.group);a>n;n++)t+=ee.renderItem(l(e,{group:r,item:l({index:n},i[n])}));return t}},e,Z))},renderContent:function(e){return Y.content(l(e,Z))}}),a.ui.plugin(ee)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});;!function(t,define){define("kendo.treeview.draganddrop.min",["kendo.data.min","kendo.draganddrop.min"],t)}(function(){return function(t,e){var i=window.kendo,o=i.ui,s=t.proxy,n=t.extend,r="visibility",a="k-state-hover",d="input,a,textarea,.k-multiselect-wrap,select,button,a.k-button>.k-icon,button.k-button>.k-icon,span.k-icon.k-i-expand,span.k-icon.k-i-collapse";o.HierarchicalDragAndDrop=i.Class.extend({init:function(e,r){this.element=e,this.hovered=e,this.options=n({dragstart:t.noop,drag:t.noop,drop:t.noop,dragend:t.noop},r),this._draggable=new o.Draggable(e,{ignore:d,filter:r.filter,autoScroll:r.autoScroll,cursorOffset:{left:10,top:i.support.mobileOS?-40/i.support.zoomLevel():10},hint:s(this._hint,this),dragstart:s(this.dragstart,this),dragcancel:s(this.dragcancel,this),drag:s(this.drag,this),dragend:s(this.dragend,this),$angular:r.$angular})},_hint:function(t){return"<div class='k-header k-drag-clue'><span class='k-icon k-drag-status' />"+this.options.hintText(t)+"</div>"},_removeTouchHover:function(){i.support.touch&&this.hovered&&(this.hovered.find("."+a).removeClass(a),this.hovered=!1)},_hintStatus:function(i){var o=this._draggable.hint.find(".k-drag-status")[0];return i?(o.className="k-icon k-drag-status "+i,e):t.trim(o.className.replace(/k-(icon|drag-status)/g,""))},dragstart:function(e){this.source=e.currentTarget.closest(this.options.itemSelector),this.options.dragstart(this.source)&&e.preventDefault(),this.dropHint=this.options.reorderable?t("<div class='k-drop-hint' />").css(r,"hidden").appendTo(this.element):t()},drag:function(e){var o,s,n,d,h,l,c,p,g,u,v,k=this.options,f=this.source,m=this.dropTarget=t(i.eventTarget(e)),H=m.closest(k.allowedContainers);H.length?f[0]==m[0]||k.contains(f[0],m[0])?v="k-denied":(v="k-insert-middle",g=k.itemFromTarget(m),o=g.item,o.length?(this._removeTouchHover(),s=o.outerHeight(),d=g.content,k.reorderable?(h=s/(d.length>0?4:2),n=i.getOffset(o).top,l=n+h>e.y.location,c=e.y.location>n+s-h,p=d.length&&!l&&!c):(p=!0,l=!1,c=!1),this.hovered=p?H:!1,this.dropHint.css(r,p?"hidden":"visible"),this._lastHover&&this._lastHover[0]!=d[0]&&this._lastHover.removeClass(a),this._lastHover=d.toggleClass(a,p),p?v="k-add":(u=o.position(),u.top+=l?0:s,this.dropHint.css(u)[l?"prependTo":"appendTo"](k.dropHintContainer(o)),l&&g.first&&(v="k-insert-top"),c&&g.last&&(v="k-insert-bottom"))):m[0]!=this.dropHint[0]&&(this._lastHover&&this._lastHover.removeClass(a),v=t.contains(this.element[0],H[0])?"k-denied":"k-add")):(v="k-denied",this._removeTouchHover()),this.options.drag({originalEvent:e.originalEvent,source:f,target:m,pageY:e.y.location,pageX:e.x.location,status:v.substring(2),setStatus:function(t){v=t}}),"k-denied"==v&&this._lastHover&&this._lastHover.removeClass(a),0!==v.indexOf("k-insert")&&this.dropHint.css(r,"hidden"),this._hintStatus(v)},dragcancel:function(){this.dropHint.remove()},dragend:function(t){var i,o,s,n="over",d=this.source,h=this.dropHint,l=this.dropTarget;return"visible"==h.css(r)?(n=this.options.dropPositionFrom(h),i=h.closest(this.options.itemSelector)):l&&(i=l.closest(this.options.itemSelector),i.length||(i=l.closest(this.options.allowedContainers))),o={originalEvent:t.originalEvent,source:d[0],destination:i[0],valid:"k-denied"!=this._hintStatus(),setValid:function(t){this.valid=t},dropTarget:l[0],position:n},s=this.options.drop(o),h.remove(),this._removeTouchHover(),this._lastHover&&this._lastHover.removeClass(a),!o.valid||s?(this._draggable.dropped=o.valid,e):(this._draggable.dropped=!0,this.options.dragend({originalEvent:t.originalEvent,source:d,destination:i,position:n}),e)},destroy:function(){this._lastHover=this.hovered=null,this._draggable.destroy()}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,i){(i||e)()});;!function(e,define){define("kendo.treeview.min",["kendo.data.min","kendo.treeview.draganddrop.min"],e)}(function(){return function(e,t){function n(e){return function(t){var n=t.children(".k-animation-container");return n.length||(n=t),n.children(e)}}function a(e){return p.template(e,{useWithBlock:!1})}function i(e){return e.find("> div .k-checkbox-wrapper [type=checkbox]")}function r(e){return function(t,n){n=n.closest(P);var a,i=n.parent();return i.parent().is("li")&&(a=i.parent()),this._dataSourceMove(t,i,a,function(t,a){return this._insert(t.data(),a,n.index()+e)})}}function s(t,n){for(var a;t&&"ul"!=t.nodeName.toLowerCase();)a=t,t=t.nextSibling,3==a.nodeType&&(a.nodeValue=e.trim(a.nodeValue)),u.test(a.className)?n.insertBefore(a,n.firstChild):n.appendChild(a)}function o(t){var n=t.children("div"),a=t.children("ul"),i=n.children(".k-icon"),r=t.children(":checkbox"),o=n.children(".k-in");t.hasClass("k-treeview")||(n.length||(n=e("<div />").prependTo(t)),!i.length&&a.length?i=e("<span class='k-icon' />").prependTo(n):a.length&&a.children().length||(i.remove(),a.remove()),r.length&&e("<span class='k-checkbox-wrapper' />").appendTo(n).append(r),o.length||(o=t.children("a").eq(0).addClass("k-in k-link"),o.length||(o=e("<span class='k-in' />")),o.appendTo(n),n.length&&s(n[0].nextSibling,o[0])))}var d,l,c,h,u,p=window.kendo,f=p.ui,g=p.data,m=e.extend,k=p.template,v=e.isArray,_=f.Widget,b=g.HierarchicalDataSource,x=e.proxy,C=p.keys,w=".kendoTreeView",y="select",S="check",I="navigate",N="expand",T="change",D="error",B="checked",A="indeterminate",E="collapse",H="dragstart",q="drag",O="drop",U="dragend",V="dataBound",L="click",F="undefined",R="k-state-hover",M="k-treeview",j=":visible",P=".k-item",G="string",W="aria-selected",Q="aria-disabled",X={text:"dataTextField",url:"dataUrlField",spriteCssClass:"dataSpriteCssClassField",imageUrl:"dataImageUrlField"},Y=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&typeof e.nodeName===G};l=n(".k-group"),c=n(".k-group,.k-content"),h=function(e){return e.children("div").children(".k-icon")},u=/k-sprite/,d=p.ui.DataBoundWidget.extend({init:function(e,t){var n,a=this,i=!1,r=t&&!!t.dataSource;v(t)&&(t={dataSource:t}),t&&typeof t.loadOnDemand==F&&v(t.dataSource)&&(t.loadOnDemand=!1),_.prototype.init.call(a,e,t),e=a.element,t=a.options,n=e.is("ul")&&e||e.hasClass(M)&&e.children("ul"),i=!r&&n.length,i&&(t.dataSource.list=n),a._animation(),a._accessors(),a._templates(),e.hasClass(M)?(a.wrapper=e,a.root=e.children("ul").eq(0)):(a._wrapper(),n&&(a.root=e,a._group(a.wrapper))),a._tabindex(),a.root.attr("role","tree"),a._dataSource(i),a._attachEvents(),a._dragging(),i?a._syncHtmlAndDataSource():t.autoBind&&(a._progress(!0),a.dataSource.fetch()),t.checkboxes&&t.checkboxes.checkChildren&&a.updateIndeterminate(),a.element[0].id&&(a._ariaId=p.format("{0}_tv_active",a.element[0].id)),p.notify(a)},_attachEvents:function(){var t=this,n=".k-in:not(.k-state-selected,.k-state-disabled)",a="mouseenter";t.wrapper.on(a+w,".k-in.k-state-selected",function(e){e.preventDefault()}).on(a+w,n,function(){e(this).addClass(R)}).on("mouseleave"+w,n,function(){e(this).removeClass(R)}).on(L+w,n,x(t._click,t)).on("dblclick"+w,".k-in:not(.k-state-disabled)",x(t._toggleButtonClick,t)).on(L+w,".k-plus,.k-minus",x(t._toggleButtonClick,t)).on("keydown"+w,x(t._keydown,t)).on("focus"+w,x(t._focus,t)).on("blur"+w,x(t._blur,t)).on("mousedown"+w,".k-in,.k-checkbox-wrapper :checkbox,.k-plus,.k-minus",x(t._mousedown,t)).on("change"+w,".k-checkbox-wrapper :checkbox",x(t._checkboxChange,t)).on("click"+w,".k-checkbox-wrapper :checkbox",x(t._checkboxClick,t)).on("click"+w,".k-request-retry",x(t._retryRequest,t)).on("click"+w,function(n){e(n.target).is(":kendoFocusable")||t.focus()})},_checkboxClick:function(t){var n=e(t.target);n.data(A)&&(n.data(A,!1).prop(A,!1).prop(B,!0),this._checkboxChange(t))},_syncHtmlAndDataSource:function(e,t){var n,a,r,s,o,d,l,c;for(e=e||this.root,t=t||this.dataSource,n=t.view(),a=p.attr("uid"),r=p.attr("expanded"),s=this.options.checkboxes,o=e.children("li"),d=0;o.length>d;d++)c=n[d],l=o.eq(d),l.attr("role","treeitem").attr(a,c.uid),c.expanded="true"===l.attr(r),s&&(c.checked=i(l).prop(B)),this._syncHtmlAndDataSource(l.children("ul"),c.children)},_animation:function(){var e=this.options,t=e.animation;t===!1?t={expand:{effects:{}},collapse:{hide:!0,effects:{}}}:t.collapse&&"effects"in t.collapse||(t.collapse=m({reverse:!0},t.expand)),m(t.collapse,{hide:!0}),e.animation=t},_dragging:function(){var t,n=this.options.dragAndDrop,a=this.dragging;n&&!a?(t=this,this.dragging=new f.HierarchicalDragAndDrop(this.element,{reorderable:!0,$angular:this.options.$angular,autoScroll:this.options.autoScroll,filter:"div:not(.k-state-disabled) .k-in",allowedContainers:".k-treeview",itemSelector:".k-treeview .k-item",hintText:x(this._hintText,this),contains:function(t,n){return e.contains(t,n)},dropHintContainer:function(e){return e},itemFromTarget:function(e){var t=e.closest(".k-top,.k-mid,.k-bot");return{item:t,content:e.closest(".k-in"),first:t.hasClass("k-top"),last:t.hasClass("k-bot")}},dropPositionFrom:function(e){return e.prevAll(".k-in").length>0?"after":"before"},dragstart:function(e){return t.trigger(H,{sourceNode:e[0]})},drag:function(e){t.trigger(q,{originalEvent:e.originalEvent,sourceNode:e.source[0],dropTarget:e.target[0],pageY:e.pageY,pageX:e.pageX,statusClass:e.status,setStatusClass:e.setStatus})},drop:function(e){return t.trigger(O,{originalEvent:e.originalEvent,sourceNode:e.source,destinationNode:e.destination,valid:e.valid,setValid:function(t){this.valid=t,e.setValid(t)},dropTarget:e.dropTarget,dropPosition:e.position})},dragend:function(e){function n(n){t.updateIndeterminate(),t.trigger(U,{originalEvent:e.originalEvent,sourceNode:n&&n[0],destinationNode:i[0],dropPosition:r})}var a=e.source,i=e.destination,r=e.position;"over"==r?t.append(a,i,n):("before"==r?a=t.insertBefore(a,i):"after"==r&&(a=t.insertAfter(a,i)),n(a))}})):!n&&a&&(a.destroy(),this.dragging=null)},_hintText:function(e){return this.templates.dragClue({item:this.dataItem(e),treeview:this.options})},_templates:function(){var e=this,t=e.options,n=x(e._fieldAccessor,e);t.template&&typeof t.template==G?t.template=k(t.template):t.template||(t.template=a("# var text = "+n("text")+"(data.item); ## if (typeof data.item.encoded != 'undefined' && data.item.encoded === false) {##= text ## } else { ##: text ## } #")),e._checkboxes(),e.templates={wrapperCssClass:function(e,t){var n="k-item",a=t.index;return e.firstLevel&&0===a&&(n+=" k-first"),a==e.length-1&&(n+=" k-last"),n},cssClass:function(e,t){var n="",a=t.index,i=e.length-1;return e.firstLevel&&0===a&&(n+="k-top "),n+=0===a&&a!=i?"k-top":a==i?"k-bot":"k-mid"},textClass:function(e,t){var n="k-in";return t&&(n+=" k-link"),e.enabled===!1&&(n+=" k-state-disabled"),e.selected===!0&&(n+=" k-state-selected"),n},toggleButtonClass:function(e){var t="k-icon";return t+=e.expanded!==!0?" k-plus":" k-minus",e.enabled===!1&&(t+="-disabled"),t},groupAttributes:function(e){var t="";return e.firstLevel||(t="role='group'"),t+(e.expanded!==!0?" style='display:none'":"")},groupCssClass:function(e){var t="k-group";return e.firstLevel&&(t+=" k-treeview-lines"),t},dragClue:a("#= data.treeview.template(data) #"),group:a("<ul class='#= data.r.groupCssClass(data.group) #'#= data.r.groupAttributes(data.group) #>#= data.renderItems(data) #</ul>"),itemContent:a("# var imageUrl = "+n("imageUrl")+"(data.item); ## var spriteCssClass = "+n("spriteCssClass")+"(data.item); ## if (imageUrl) { #<img class='k-image' alt='' src='#= imageUrl #'># } ## if (spriteCssClass) { #<span class='k-sprite #= spriteCssClass #' /># } ##= data.treeview.template(data) #"),itemElement:a("# var item = data.item, r = data.r; ## var url = "+n("url")+"(item); #<div class='#= r.cssClass(data.group, item) #'># if (item.hasChildren) { #<span class='#= r.toggleButtonClass(item) #' role='presentation' /># } ## if (data.treeview.checkboxes) { #<span class='k-checkbox-wrapper' role='presentation'>#= data.treeview.checkboxes.template(data) #</span># } ## var tag = url ? 'a' : 'span'; ## var textAttr = url ? ' href=\\'' + url + '\\'' : ''; #<#=tag# class='#= r.textClass(item, !!url) #'#= textAttr #>#= r.itemContent(data) #</#=tag#></div>"),item:a("# var item = data.item, r = data.r; #<li role='treeitem' class='#= r.wrapperCssClass(data.group, item) #' "+p.attr("uid")+"='#= item.uid #' aria-selected='#= item.selected ? \"true\" : \"false \" #' #=item.enabled === false ? \"aria-disabled='true'\" : ''## if (item.expanded) { #data-expanded='true' aria-expanded='true'# } #>#= r.itemElement(data) #</li>"),loading:a("<div class='k-icon k-loading' /> #: data.messages.loading #"),retry:a("#: data.messages.requestFailed # <button class='k-button k-request-retry'>#: data.messages.retry #</button>")}},items:function(){return this.element.find(".k-item > div:first-child")},setDataSource:function(t){var n=this.options;n.dataSource=t,this._dataSource(),n.checkboxes&&n.checkboxes.checkChildren&&this.dataSource.one("change",e.proxy(this.updateIndeterminate,this,null)),this.options.autoBind&&this.dataSource.fetch()},_bindDataSource:function(){this._refreshHandler=x(this.refresh,this),this._errorHandler=x(this._error,this),this.dataSource.bind(T,this._refreshHandler),this.dataSource.bind(D,this._errorHandler)},_unbindDataSource:function(){var e=this.dataSource;e&&(e.unbind(T,this._refreshHandler),e.unbind(D,this._errorHandler))},_dataSource:function(e){function t(e){for(var n=0;e.length>n;n++)e[n]._initChildren(),e[n].children.fetch(),t(e[n].children.view())}var n=this,a=n.options,i=a.dataSource;i=v(i)?{data:i}:i,n._unbindDataSource(),i.fields||(i.fields=[{field:"text"},{field:"url"},{field:"spriteCssClass"},{field:"imageUrl"}]),n.dataSource=i=b.create(i),e&&(i.fetch(),t(i.view())),n._bindDataSource()},events:[H,q,O,U,V,N,E,y,T,I,S],options:{name:"TreeView",dataSource:{},animation:{expand:{effects:"expand:vertical",duration:200},collapse:{duration:100}},messages:{loading:"Loading...",requestFailed:"Request failed.",retry:"Retry"},dragAndDrop:!1,checkboxes:!1,autoBind:!0,autoScroll:!1,loadOnDemand:!0,template:"",dataTextField:null},_accessors:function(){var e,t,n,a=this,i=a.options,r=a.element;for(e in X)t=i[X[e]],n=r.attr(p.attr(e+"-field")),!t&&n&&(t=n),t||(t=e),v(t)||(t=[t]),i[X[e]]=t},_fieldAccessor:function(t){var n=this.options[X[t]],a=n.length,i="(function(item) {";return 0===a?i+="return item['"+t+"'];":(i+="var levels = ["+e.map(n,function(e){return"function(d){ return "+p.expr(e)+"}"}).join(",")+"];",i+="return levels[Math.min(item.level(), "+a+"-1)](item)"),i+="})"},setOptions:function(e){_.fn.setOptions.call(this,e),this._animation(),this._dragging(),this._templates()},_trigger:function(e,t){return this.trigger(e,{node:t.closest(P)[0]})},_setChecked:function(t,n){if(t&&e.isFunction(t.view))for(var a=0,i=t.view();i.length>a;a++)i[a][B]=n,i[a].children&&this._setChecked(i[a].children,n)},_setIndeterminate:function(e){var t,n,a,r=l(e),s=!0;if(r.length&&(t=i(r.children()),n=t.length)){if(n>1){for(a=1;n>a;a++)if(t[a].checked!=t[a-1].checked||t[a].indeterminate||t[a-1].indeterminate){s=!1;break}}else s=!t[0].indeterminate;return i(e).data(A,!s).prop(A,!s).prop(B,s&&t[0].checked)}},updateIndeterminate:function(e){var t,n,a;if(e=e||this.wrapper,t=l(e).children(),t.length){for(n=0;t.length>n;n++)this.updateIndeterminate(t.eq(n));a=this._setIndeterminate(e),a&&a.prop(B)&&(this.dataItem(e).checked=!0)}},_bubbleIndeterminate:function(e){if(e.length){var t,n=this.parent(e);n.length&&(this._setIndeterminate(n),t=n.children("div").find(".k-checkbox-wrapper :checkbox"),t.prop(A)===!1?this.dataItem(n).set(B,t.prop(B)):delete this.dataItem(n).checked,this._bubbleIndeterminate(n))}},_checkboxChange:function(t){var n=e(t.target),a=n.prop(B),i=n.closest(P),r=this.dataItem(i);r.checked!=a&&(r.set(B,a),this._trigger(S,i))},_toggleButtonClick:function(t){this.toggle(e(t.target).closest(P))},_mousedown:function(t){var n=e(t.currentTarget).closest(P);this._clickTarget=n,this.current(n)},_focusable:function(e){return e&&e.length&&e.is(":visible")&&!e.find(".k-in:first").hasClass("k-state-disabled")},_focus:function(){var t=this.select(),n=this._clickTarget;p.support.touch||(n&&n.length&&(t=n),this._focusable(t)||(t=this.current()),this._focusable(t)||(t=this._nextVisible(e())),this.current(t))},focus:function(){var e,t=this.wrapper,n=t[0],a=[],i=[],r=document.documentElement;do n=n.parentNode,n.scrollHeight>n.clientHeight&&(a.push(n),i.push(n.scrollTop));while(n!=r);for(t.focus(),e=0;a.length>e;e++)a[e].scrollTop=i[e]},_blur:function(){this.current().find(".k-in:first").removeClass("k-state-focused")},_enabled:function(e){return!e.children("div").children(".k-in").hasClass("k-state-disabled")},parent:function(t){var n,a,i=/\bk-treeview\b/,r=/\bk-item\b/;typeof t==G&&(t=this.element.find(t)),Y(t)||(t=t[0]),a=r.test(t.className);do t=t.parentNode,r.test(t.className)&&(a?n=t:a=!0);while(!i.test(t.className)&&!n);return e(n)},_nextVisible:function(e){function t(e){for(;e.length&&!e.next().length;)e=a.parent(e);return e.next().length?e.next():e}var n,a=this,i=a._expanded(e);return e.length&&e.is(":visible")?i?(n=l(e).children().first(),n.length||(n=t(e))):n=t(e):n=a.root.children().eq(0),a._enabled(n)||(n=a._nextVisible(n)),n},_previousVisible:function(e){var t,n,a=this;if(!e.length||e.prev().length)for(n=e.length?e.prev():a.root.children().last();a._expanded(n)&&(t=l(n).children().last(),t.length);)n=t;else n=a.parent(e)||e;return a._enabled(n)||(n=a._previousVisible(n)),n},_keydown:function(n){var a,i=this,r=n.keyCode,s=i.current(),o=i._expanded(s),d=s.find(".k-checkbox-wrapper:first :checkbox"),l=p.support.isRtl(i.element);n.target==n.currentTarget&&(!l&&r==C.RIGHT||l&&r==C.LEFT?o?a=i._nextVisible(s):i.expand(s):!l&&r==C.LEFT||l&&r==C.RIGHT?o?i.collapse(s):(a=i.parent(s),i._enabled(a)||(a=t)):r==C.DOWN?a=i._nextVisible(s):r==C.UP?a=i._previousVisible(s):r==C.HOME?a=i._nextVisible(e()):r==C.END?a=i._previousVisible(e()):r==C.ENTER?s.find(".k-in:first").hasClass("k-state-selected")||i._trigger(y,s)||i.select(s):r==C.SPACEBAR&&d.length&&(d.prop(B,!d.prop(B)).data(A,!1).prop(A,!1),i._checkboxChange({target:d}),a=s),a&&(n.preventDefault(),s[0]!=a[0]&&(i._trigger(I,a),i.current(a))))},_click:function(t){var n,a=this,i=e(t.currentTarget),r=c(i.closest(P)),s=i.attr("href");n=s?"#"==s||s.indexOf("#"+this.element.id+"-")>=0:r.length&&!r.children().length,n&&t.preventDefault(),i.hasClass(".k-state-selected")||a._trigger(y,i)||a.select(i)},_wrapper:function(){var e,t,n=this,a=n.element,i="k-widget k-treeview";a.is("ul")?(e=a.wrap("<div />").parent(),t=a):(e=a,t=e.children("ul").eq(0)),n.wrapper=e.addClass(i),n.root=t},_group:function(e){var t=this,n=e.hasClass(M),a={firstLevel:n,expanded:n||t._expanded(e)},i=e.children("ul");i.addClass(t.templates.groupCssClass(a)).css("display",a.expanded?"":"none"),t._nodes(i,a)},_nodes:function(t,n){var a,i=this,r=t.children("li");n=m({length:r.length},n),r.each(function(t,r){r=e(r),a={index:t,expanded:i._expanded(r)},o(r),i._updateNodeClasses(r,n,a),i._group(r)})},_checkboxes:function(){var e,t=this.options,n=t.checkboxes;n&&(e="<input type='checkbox' tabindex='-1' #= (item.enabled === false) ? 'disabled' : '' # #= item.checked ? 'checked' : '' #",n.name&&(e+=" name='"+n.name+"'"),e+=" id='_#= item.uid #' class='k-checkbox' /><label for='_#= item.uid #' class='k-checkbox-label'></label>",n=m({template:e},t.checkboxes),typeof n.template==G&&(n.template=k(n.template)),t.checkboxes=n)},_updateNodeClasses:function(e,t,n){var a,i,r=e.children("div"),s=e.children("ul"),o=this.templates;e.hasClass("k-treeview")||(n=n||{},n.expanded=typeof n.expanded!=F?n.expanded:this._expanded(e),n.index=typeof n.index!=F?n.index:e.index(),n.enabled=typeof n.enabled!=F?n.enabled:!r.children(".k-in").hasClass("k-state-disabled"),t=t||{},t.firstLevel=typeof t.firstLevel!=F?t.firstLevel:e.parent().parent().hasClass(M),t.length=typeof t.length!=F?t.length:e.parent().children().length,e.removeClass("k-first k-last").addClass(o.wrapperCssClass(t,n)),r.removeClass("k-top k-mid k-bot").addClass(o.cssClass(t,n)),a=r.children(".k-in"),i=a[0]&&"a"==a[0].nodeName.toLowerCase(),a.removeClass("k-in k-link k-state-default k-state-disabled").addClass(o.textClass(n,i)),(s.length||"true"==e.attr("data-hasChildren"))&&(r.children(".k-icon").removeClass("k-plus k-minus k-plus-disabled k-minus-disabled").addClass(o.toggleButtonClass(n)),s.addClass("k-group")))},_processNodes:function(t,n){var a=this;a.element.find(t).each(function(t,i){n.call(a,t,e(i).closest(P))})},dataItem:function(t){var n=e(t).closest(P).attr(p.attr("uid")),a=this.dataSource;return a&&a.getByUid(n)},_insertNode:function(t,n,a,i,r){var s,d,c,h,u=this,p=l(a),f=p.children().length+1,g={firstLevel:a.hasClass(M),expanded:!r,length:f},m="",k=function(e,t){e.appendTo(t)};for(c=0;t.length>c;c++)h=t[c],h.index=n+c,m+=u._renderItem({group:g,item:h});if(d=e(m),d.length){for(u.angular("compile",function(){return{elements:d.get(),data:t.map(function(e){return{dataItem:e}})}}),p.length||(p=e(u._renderGroup({group:g})).appendTo(a)),i(d,p),a.hasClass("k-item")&&(o(a),u._updateNodeClasses(a)),u._updateNodeClasses(d.prev().first()),u._updateNodeClasses(d.next().last()),c=0;t.length>c;c++)h=t[c],h.hasChildren&&(s=h.children.data(),s.length&&u._insertNode(s,h.index,d.eq(c),k,!u._expanded(d.eq(c))));return d}},_updateNodes:function(t,n){function a(e,t){e.find(".k-checkbox-wrapper :checkbox").prop(B,t).data(A,!1).prop(A,!1)}var i,r,s,o,d,l,h,u=this,p={treeview:u.options,item:o},g="expanded"!=n&&"checked"!=n;if("selected"==n)o=t[0],r=u.findByUid(o.uid).find(".k-in:first").removeClass("k-state-hover").toggleClass("k-state-selected",o[n]).end(),o[n]&&u.current(r),r.attr(W,!!o[n]);else{for(h=e.map(t,function(e){return u.findByUid(e.uid).children("div")}),g&&u.angular("cleanup",function(){return{elements:h}}),i=0;t.length>i;i++)p.item=o=t[i],s=h[i],r=s.parent(),g&&s.children(".k-in").html(u.templates.itemContent(p)),n==B?(d=o[n],a(s,d),u.options.checkboxes.checkChildren&&(a(r.children(".k-group"),d),u._setChecked(o.children,d),u._bubbleIndeterminate(r))):"expanded"==n?u._toggle(r,o,o[n]):"enabled"==n&&(r.find(".k-checkbox-wrapper :checkbox").prop("disabled",!o[n]),l=!c(r).is(j),r.removeAttr(Q),o[n]||(o.selected&&o.set("selected",!1),o.expanded&&o.set("expanded",!1),l=!0,r.attr(W,!1).attr(Q,!0)),u._updateNodeClasses(r,{},{enabled:o[n],expanded:!l})),s.length&&this.trigger("itemChange",{item:s,data:o,ns:f});g&&u.angular("compile",function(){return{elements:h,data:e.map(t,function(e){return[{dataItem:e}]})}})}},_appendItems:function(e,t,n){var a=l(n),i=a.children(),r=!this._expanded(n);typeof e==F&&(e=i.length),this._insertNode(t,e,n,function(t,n){e>=i.length?t.appendTo(n):t.insertBefore(i.eq(e))},r),this._expanded(n)&&(this._updateNodeClasses(n),l(n).css("display","block"))},_refreshChildren:function(e,t,n){var a,i,r,s=this.options,d=s.loadOnDemand,c=s.checkboxes&&s.checkboxes.checkChildren;if(l(e).empty(),t.length)for(this._appendItems(n,t,e),i=l(e).children(),d&&c&&this._bubbleIndeterminate(i.last()),a=0;i.length>a;a++)r=i.eq(a),this.trigger("itemChange",{item:r.children("div"),data:this.dataItem(r),ns:f});else o(e)},_refreshRoot:function(t){var n,a,i,r=this._renderGroup({items:t,group:{firstLevel:!0,expanded:!0}});for(this.root.length?(this._angularItems("cleanup"),n=e(r),this.root.attr("class",n.attr("class")).html(n.html())):this.root=this.wrapper.html(r).children("ul"),this.root.attr("role","tree"),a=this.root.children(".k-item"),i=0;t.length>i;i++)this.trigger("itemChange",{item:a.eq(i),data:t[i],ns:f});this._angularItems("compile")},refresh:function(e){var n,a,i=e.node,r=e.action,s=e.items,o=this.wrapper,d=this.options,l=d.loadOnDemand,c=d.checkboxes&&d.checkboxes.checkChildren;if(e.field){if(!s[0]||!s[0].level)return;return this._updateNodes(s,e.field)}if(i&&(o=this.findByUid(i.uid),this._progress(o,!1)),c&&"remove"!=r){for(a=!1,n=0;s.length>n;n++)if("checked"in s[n]){a=!0;break}if(!a&&i&&i.checked)for(n=0;s.length>n;n++)s[n].checked=!0}if("add"==r?this._appendItems(e.index,s,o):"remove"==r?this._remove(this.findByUid(s[0].uid),!1):"itemchange"==r?this._updateNodes(s):"itemloaded"==r?this._refreshChildren(o,s,e.index):this._refreshRoot(s),"remove"!=r)for(n=0;s.length>n;n++)(!l||s[n].expanded)&&s[n].load();this.trigger(V,{node:i?o:t})},_error:function(e){var t=e.node&&this.findByUid(e.node.uid),n=this.templates.retry({messages:this.options.messages});t?(this._progress(t,!1),this._expanded(t,!1),h(t).addClass("k-i-refresh"),e.node.loaded(!1)):(this._progress(!1),this.element.html(n))},_retryRequest:function(e){e.preventDefault(),this.dataSource.fetch()},expand:function(e){this._processNodes(e,function(e,t){this.toggle(t,!0)})},collapse:function(e){this._processNodes(e,function(e,t){this.toggle(t,!1)})},enable:function(e,t){t=2==arguments.length?!!t:!0,this._processNodes(e,function(e,n){this.dataItem(n).set("enabled",t)})},current:function(n){var a=this,i=a._current,r=a.element,s=a._ariaId;return arguments.length>0&&n&&n.length?(i&&(i[0].id===s&&i.removeAttr("id"),i.find(".k-in:first").removeClass("k-state-focused")),i=a._current=e(n,r).closest(P),i.find(".k-in:first").addClass("k-state-focused"),s=i[0].id||s,s&&(a.wrapper.removeAttr("aria-activedescendant"),i.attr("id",s),a.wrapper.attr("aria-activedescendant",s)),t):(i||(i=a._nextVisible(e())),i)},select:function(n){var a=this,i=a.element;return arguments.length?(n=e(n,i).closest(P),i.find(".k-state-selected").each(function(){var t=a.dataItem(this);t?(t.set("selected",!1),delete t.selected):e(this).removeClass("k-state-selected")}),n.length&&(a.dataItem(n).set("selected",!0),a._clickTarget=n),a.trigger(T),t):i.find(".k-state-selected").closest(P)},_toggle:function(e,t,n){var a,i=this.options,r=c(e),s=n?"expand":"collapse";r.data("animating")||this._trigger(s,e)||(this._expanded(e,n),a=t&&t.loaded(),n&&!a?(i.loadOnDemand&&this._progress(e,!0),r.remove(),t.load()):(this._updateNodeClasses(e,{},{expanded:n}),n||r.css("height",r.height()).css("height"),r.kendoStop(!0,!0).kendoAnimate(m({reset:!0},i.animation[s],{complete:function(){n&&r.css("height","")}}))))},toggle:function(t,n){t=e(t),h(t).is(".k-minus,.k-plus,.k-minus-disabled,.k-plus-disabled")&&(1==arguments.length&&(n=!this._expanded(t)),this._expanded(t,n))},destroy:function(){var e=this;_.fn.destroy.call(e),e.wrapper.off(w),e._unbindDataSource(),e.dragging&&e.dragging.destroy(),p.destroy(e.element),e.root=e.wrapper=e.element=null},_expanded:function(e,n){var a=p.attr("expanded"),i=this.dataItem(e);return 1==arguments.length?"true"===e.attr(a)||i&&i.expanded:(c(e).data("animating")||(i&&(i.set("expanded",n),n=i.expanded),n?(e.attr(a,"true"),e.attr("aria-expanded","true")):(e.removeAttr(a),e.attr("aria-expanded","false"))),t)},_progress:function(e,t){var n=this.element,a=this.templates.loading({messages:this.options.messages});1==arguments.length?(t=e,t?n.html(a):n.empty()):h(e).toggleClass("k-loading",t).removeClass("k-i-refresh")},text:function(e,n){var a=this.dataItem(e),i=this.options[X.text],r=a.level(),s=i.length,o=i[Math.min(r,s-1)];return n?(a.set(o,n),t):a[o]},_objectOrSelf:function(t){return e(t).closest("[data-role=treeview]").data("kendoTreeView")||this},_dataSourceMove:function(t,n,a,i){var r,s=this._objectOrSelf(a||n),o=s.dataSource,d=e.Deferred().resolve().promise();return a&&a[0]!=s.element[0]&&(r=s.dataItem(a),r.loaded()||(s._progress(a,!0),d=r.load()),a!=this.root&&(o=r.children,o&&o instanceof b||(r._initChildren(),r.loaded(!0),o=r.children))),t=this._toObservableData(t),i.call(s,o,t,d)},_toObservableData:function(t){var n,a,i=t;return(t instanceof window.jQuery||Y(t))&&(n=this._objectOrSelf(t).dataSource,a=e(t).attr(p.attr("uid")),i=n.getByUid(a),i&&(i=n.remove(i))),i},_insert:function(e,t,n){t instanceof p.data.ObservableArray?t=t.toJSON():v(t)||(t=[t]);var a=e.parent();return a&&a._initChildren&&(a.hasChildren=!0,a._initChildren()),e.splice.apply(e,[n,0].concat(t)),this.findByUid(e[n].uid)},insertAfter:r(1),insertBefore:r(0),append:function(t,n,a){var i=this.root;return n&&(i=l(n)),this._dataSourceMove(t,i,n,function(t,i,r){function s(){n&&d._expanded(n,!0);var e=t.data(),a=Math.max(e.length,0);return d._insert(e,i,a)}var o,d=this;return r.then(function(){o=s(),(a=a||e.noop)(o)}),o||null})},_remove:function(t,n){var a,i,r,s=this;return t=e(t,s.element),this.angular("cleanup",function(){return{elements:t.get()}}),a=t.parent().parent(),i=t.prev(),r=t.next(),t[n?"detach":"remove"](),a.hasClass("k-item")&&(o(a),s._updateNodeClasses(a)),s._updateNodeClasses(i),s._updateNodeClasses(r),t},remove:function(e){var t=this.dataItem(e);t&&this.dataSource.remove(t)},detach:function(e){return this._remove(e,!0)},findByText:function(t){return e(this.element).find(".k-in").filter(function(n,a){return e(a).text()==t}).closest(P)},findByUid:function(t){var n,a,i=this.element.find(".k-item"),r=p.attr("uid");for(a=0;i.length>a;a++)if(i[a].getAttribute(r)==t){n=i[a];break}return e(n)},expandPath:function(n,a){function i(e,t,n){e&&!e.loaded()?e.set("expanded",!0):t.call(n)}var r,s,o;for(n=n.slice(0),r=this,s=this.dataSource,o=s.get(n[0]),a=a||e.noop;n.length>0&&o&&(o.expanded||o.loaded());)o.set("expanded",!0),n.shift(),o=s.get(n[0]);return n.length?(s.bind("change",function(e){var t,o=e.node&&e.node.id;o&&o===n[0]&&(n.shift(),n.length?(t=s.get(n[0]),i(t,a,r)):a.call(r))}),i(o,a,r),t):a.call(r)},_parentIds:function(e){for(var t=e&&e.parentNode(),n=[];t&&t.parentNode;)n.unshift(t.id),t=t.parentNode();return n},expandTo:function(e){e instanceof p.data.Node||(e=this.dataSource.get(e));var t=this._parentIds(e);this.expandPath(t)},_renderItem:function(e){return e.group||(e.group={}),e.treeview=this.options,e.r=this.templates,this.templates.item(e)},_renderGroup:function(e){var t=this;return e.renderItems=function(e){var n="",a=0,i=e.items,r=i?i.length:0,s=e.group;for(s.length=r;r>a;a++)e.group=s,e.item=i[a],e.item.index=a,n+=t._renderItem(e);return n},e.r=t.templates,t.templates.group(e)}}),f.plugin(d)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});;!function(t,define){define("util/main.min",["kendo.core.min"],t)}(function(){return function(){function t(t){return typeof t!==U}function i(t,i){var e=n(i);return C.round(t*e)/e}function n(t){return t?C.pow(10,t):1}function e(t,i,n){return C.max(C.min(t,n),i)}function o(t){return t*I}function r(t){return t/I}function a(t){return"number"==typeof t&&!isNaN(t)}function s(i,n){return t(i)?i:n}function l(t){return t*t}function u(t){var i,n=[];for(i in t)n.push(i+t[i]);return n.sort().join("")}function c(t){var i,n=2166136261;for(i=0;t.length>i;++i)n+=(n<<1)+(n<<4)+(n<<7)+(n<<8)+(n<<24),n^=t.charCodeAt(i);return n>>>0}function h(t){return c(u(t))}function p(t){var i,n=t.length,e=j,o=E;for(i=0;n>i;i++)o=C.max(o,t[i]),e=C.min(e,t[i]);return{min:e,max:o}}function f(t){return p(t).min}function d(t){return p(t).max}function x(t){return g(t).min}function m(t){return g(t).max}function g(t){var i,n,e,o=j,r=E;for(i=0,n=t.length;n>i;i++)e=t[i],null!==e&&isFinite(e)&&(o=C.min(o,e),r=C.max(r,e));return{min:o===j?void 0:o,max:r===E?void 0:r}}function v(t){return t?t[t.length-1]:void 0}function y(t,i){return t.push.apply(t,i),t}function b(t){return L.template(t,{useWithBlock:!1,paramName:"d"})}function w(i,n){return t(n)&&null!==n?" "+i+"='"+n+"' ":""}function T(t){var i,n="";for(i=0;t.length>i;i++)n+=w(t[i][0],t[i][1]);return n}function k(i){var n,e,o="";for(n=0;i.length>n;n++)e=i[n][1],t(e)&&(o+=i[n][0]+":"+e+";");return""!==o?o:void 0}function _(t){return"string"!=typeof t&&(t+="px"),t}function M(t){var i,n,e=[];if(t)for(i=L.toHyphens(t).split("-"),n=0;i.length>n;n++)e.push("k-pos-"+i[n]);return e.join(" ")}function S(i){return""===i||null===i||"none"===i||"transparent"===i||!t(i)}function A(t){for(var i={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},n=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],e="";t>0;)n[0]>t?n.shift():(e+=i[n[0]],t-=n[0]);return e}function P(t){var i,n,e,o,r;for(t=t.toLowerCase(),i={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},n=0,e=0,o=0;t.length>o;++o){if(r=i[t.charAt(o)],!r)return null;n+=r,r>e&&(n-=2*e),e=r}return n}function R(t){var i=Object.create(null);return function(){var n,e="";for(n=arguments.length;--n>=0;)e+=":"+arguments[n];return e in i?i[e]:t.apply(this,arguments)}}function V(t){for(var i,n,e=[],o=0,r=t.length;r>o;)i=t.charCodeAt(o++),i>=55296&&56319>=i&&r>o?(n=t.charCodeAt(o++),56320==(64512&n)?e.push(((1023&i)<<10)+(1023&n)+65536):(e.push(i),o--)):e.push(i);return e}function z(t){return t.map(function(t){var i="";return t>65535&&(t-=65536,i+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),i+=String.fromCharCode(t)}).join("")}var C=Math,L=window.kendo,B=L.deepExtend,I=C.PI/180,j=Number.MAX_VALUE,E=-Number.MAX_VALUE,U="undefined",O=Date.now;O||(O=function(){return(new Date).getTime()}),B(L,{util:{MAX_NUM:j,MIN_NUM:E,append:y,arrayLimits:p,arrayMin:f,arrayMax:d,defined:t,deg:r,hashKey:c,hashObject:h,isNumber:a,isTransparent:S,last:v,limitValue:e,now:O,objectKey:u,round:i,rad:o,renderAttr:w,renderAllAttr:T,renderPos:M,renderSize:_,renderStyle:k,renderTemplate:b,sparseArrayLimits:g,sparseArrayMin:x,sparseArrayMax:m,sqr:l,valueOrDefault:s,romanToArabic:P,arabicToRoman:A,memoize:R,ucs2encode:z,ucs2decode:V}}),L.drawing.util=L.util,L.dataviz.util=L.util}(),window.kendo},"function"==typeof define&&define.amd?define:function(t,i,n){(n||i)()}),function(t,define){define("util/text-metrics.min",["kendo.core.min","util/main.min"],t)}(function(){!function(t){function i(){return{width:0,height:0,baseline:0}}function n(t,i,n){return h.current.measure(t,i,n)}function e(t,i){var n=[];if(t.length>0&&document.fonts){try{n=t.map(function(t){return document.fonts.load(t)})}catch(e){r.logToConsole(e)}Promise.all(n).then(i,i)}else i()}var o=document,r=window.kendo,a=r.Class,s=r.util,l=s.defined,u=a.extend({init:function(t){this._size=t,this._length=0,this._map={}},put:function(t,i){var n=this,e=n._map,o={key:t,value:i};e[t]=o,n._head?(n._tail.newer=o,o.older=n._tail,n._tail=o):n._head=n._tail=o,n._length>=n._size?(e[n._head.key]=null,n._head=n._head.newer,n._head.older=null):n._length++},get:function(t){var i=this,n=i._map[t];return n?(n===i._head&&n!==i._tail&&(i._head=n.newer,i._head.older=null),n!==i._tail&&(n.older&&(n.older.newer=n.newer,n.newer.older=n.older),n.older=i._tail,n.newer=null,i._tail.newer=n,i._tail=n),n.value):void 0}}),c=t("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: nowrap!important;' />")[0],h=a.extend({init:function(t){this._cache=new u(1e3),this._initOptions(t)},options:{baselineMarkerSize:1},measure:function(n,e,r){var a,u,h,p,f,d,x,m;if(!n)return i();if(a=s.objectKey(e),u=s.hashKey(n+a),h=this._cache.get(u),h)return h;p=i(),f=r?r:c,d=this._baselineMarker().cloneNode(!1);for(x in e)m=e[x],l(m)&&(f.style[x]=m);return t(f).text(n),f.appendChild(d),o.body.appendChild(f),(n+"").length&&(p.width=f.offsetWidth-this.options.baselineMarkerSize,p.height=f.offsetHeight,p.baseline=d.offsetTop+this.options.baselineMarkerSize),p.width>0&&p.height>0&&this._cache.put(u,p),f.parentNode.removeChild(f),p},_baselineMarker:function(){return t("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;' />")[0]}});h.current=new h,r.util.TextMetrics=h,r.util.LRUCache=u,r.util.loadFonts=e,r.util.measureText=n}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(t,i,n){(n||i)()}),function(t,define){define("util/base64.min",["util/main.min"],t)}(function(){return function(){function t(t){var n,e,o,a,s,l,u,c="",h=0;for(t=i(t);t.length>h;)n=t.charCodeAt(h++),e=t.charCodeAt(h++),o=t.charCodeAt(h++),a=n>>2,s=(3&n)<<4|e>>4,l=(15&e)<<2|o>>6,u=63&o,isNaN(e)?l=u=64:isNaN(o)&&(u=64),c=c+r.charAt(a)+r.charAt(s)+r.charAt(l)+r.charAt(u);return c}function i(t){var i,n,e="";for(i=0;t.length>i;i++)n=t.charCodeAt(i),128>n?e+=o(n):2048>n?(e+=o(192|n>>>6),e+=o(128|63&n)):65536>n&&(e+=o(224|n>>>12),e+=o(128|n>>>6&63),e+=o(128|63&n));return e}var n=window.kendo,e=n.deepExtend,o=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e(n.util,{encodeBase64:t,encodeUTF8:i})}(),window.kendo},"function"==typeof define&&define.amd?define:function(t,i,n){(n||i)()}),function(t,define){define("mixins/observers.min",["kendo.core.min"],t)}(function(){return function(t){var i=Math,n=window.kendo,e=n.deepExtend,o=t.inArray,r={observers:function(){return this._observers=this._observers||[]},addObserver:function(t){return this._observers?this._observers.push(t):this._observers=[t],this},removeObserver:function(t){var i=this.observers(),n=o(t,i);return-1!=n&&i.splice(n,1),this},trigger:function(t,i){var n,e,o=this._observers;if(o&&!this._suspended)for(e=0;o.length>e;e++)n=o[e],n[t]&&n[t](i);return this},optionsChange:function(t){this.trigger("optionsChange",t)},geometryChange:function(t){this.trigger("geometryChange",t)},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=i.max((this._suspended||0)-1,0),this},_observerField:function(t,i){this[t]&&this[t].removeObserver(this),this[t]=i,i.addObserver(this)}};e(n,{mixins:{ObserversMixin:r}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,i,n){(n||i)()}),function(t,define){define("kendo.dataviz.core.min",["kendo.core.min","kendo.drawing.min"],t)}(function(){return function(t,i){function n(t,i){var n={top:0,right:0,bottom:0,left:0};return i=i||0,"number"==typeof t?n[jt]=n[It]=n[ut]=n[St]=t:(n[jt]=t[jt]||i,n[It]=t[It]||i,n[ut]=t[ut]||i,n[St]=t[St]||i),n}function e(t,i){var n=t.tickX,e=t.tickY,o=t.position,r=new J.Path({stroke:{width:i.width,color:i.color}});return t.vertical?r.moveTo(n,o).lineTo(n+i.size,o):r.moveTo(o,e).lineTo(o,e+i.size),w(r),r}function o(t,i){var n=t.lineStart,e=t.lineEnd,o=t.position,r=new J.Path({stroke:{width:i.width,color:i.color,dashType:i.dashType}});return t.vertical?r.moveTo(n,o).lineTo(e,o):r.moveTo(o,n).lineTo(o,e),w(r),r}function r(t,i){var n,e,o,r=h(i-t,vt-1);if(0===r){if(0===i)return.1;r=rt.abs(i)}return n=rt.pow(10,rt.floor(rt.log(r)/rt.log(10))),e=h(r/n,vt),o=1,o=1.904762>e?.2:4.761904>e?.5:9.523809>e?1:2,h(n*o,vt)}function a(t,i,n,e,o){var r=o*bt;return new Ft(n+(t-n)*rt.cos(r)+(i-e)*rt.sin(r),e-(t-n)*rt.sin(r)+(i-e)*rt.cos(r))}function s(i,n){if(i.x1==n.x1&&i.y1==n.y1&&i.x2==n.x2&&i.y2==n.y2)return n;var e=rt.min(i.x1,n.x1),o=rt.max(i.x1,n.x1),r=rt.min(i.x2,n.x2),a=rt.max(i.x2,n.x2),s=rt.min(i.y1,n.y1),l=rt.max(i.y1,n.y1),u=rt.min(i.y2,n.y2),c=rt.max(i.y2,n.y2),h=[];return h[0]=_(o,s,r,l),h[1]=_(e,l,o,u),h[2]=_(r,l,a,u),h[3]=_(o,u,r,c),i.x1==e&&i.y1==s||n.x1==e&&n.y1==s?(h[4]=_(e,s,o,l),h[5]=_(r,u,a,c)):(h[4]=_(r,s,a,l),h[5]=_(e,u,o,c)),t.grep(h,function(t){return t.height()>0&&t.width()>0})[0]}function l(t,i){return-1!=nt(t,i)}function u(t,i){return h(rt.ceil(t/i)*i,vt)}function c(t,i){return h(rt.floor(t/i)*i,vt)}function h(t,i){var n=rt.pow(10,i||0);return rt.round(t*n)/n}function p(t,i){return rt.log(t)/rt.log(i)}function f(t,i,n){var e=h(rt.abs(t%i),vt),o=i*(1-n);return 0===e||e>o}function d(t,i,n){return h(t+(i-t)*n,ht)}function x(t,i){return t-i}function m(t,i){return t.match(wt)?F.format.apply(this,arguments):F.toString(i,t)}function g(t,i){return 0>-t.x*i.y+t.y*i.x}function v(t,i){return t&&i?t.getTime()-i.getTime():-1}function y(t){var i=t.originalEvent,n=0;return i.wheelDelta&&(n=-i.wheelDelta/120,n=n>0?rt.ceil(n):rt.floor(n)),i.detail&&(n=h(i.detail/3)),n}function b(t){if(!t||!t.indexOf||t.indexOf("&")<0)return t;var i=b._element;return i.innerHTML=t,i.textContent||i.innerText}function w(t){var i,n;if(!F.support.vml)for(i=.5,t.options.stroke&&W(t.options.stroke.width)&&t.options.stroke.width%2===0&&(i=0),n=0;t.segments.length>n;n++)t.segments[n].anchor().round(0).translate(i,i);return t}function T(t){var i,n,e=t.stops,o=t.innerRadius/t.radius*100,r=e.length,a=[];for(i=0;r>i;i++)n=at({},e[i]),n.offset=(n.offset*(100-o)+o)/100,a.push(n);return a}function k(t){var i=t.origin,n=t.bottomRight();return new _(i.x,i.y,n.x,n.y)}var _,M,S,A,P,R,V,z,C,L,B,I,j,E,U,O,D,G,N,F=window.kendo,H=F.util,X=H.append,W=H.defined,q=H.last,K=H.valueOrDefault,Y=F.dataviz,Q=Y.geometry,J=Y.drawing,Z=J.util.measureText,$=F.Class,tt=F.template,it=t.noop,nt=t.inArray,et=t.isPlainObject,ot=t.trim,rt=Math,at=F.deepExtend,st="axisLabelClick",lt="#000",ut="bottom",ct="center",ht=3,pt="clip",ft="circle",dt="cross",xt="12px sans-serif",mt=400,gt=7,vt=10,yt=600,bt=rt.PI/180,wt=/\{\d+:?/,Tt="height",kt=1e5,_t=600,Mt="inside",St="left",At="linear",Pt=Number.MAX_VALUE,Rt=-Number.MAX_VALUE,Vt="none",zt="noteClick",Ct="noteHover",Lt="outside",Bt="radial",It="right",jt="top",Et="triangle",Ut="width",Ot="#fff",Dt="x",Gt="y",Nt=.2,Ft=function(t,n){var e=this;return e instanceof Ft?(e.x=t||0,e.y=n||0,i):new Ft(t,n)};Ft.fn=Ft.prototype={clone:function(){var t=this;return new Ft(t.x,t.y)},equals:function(t){return t&&t.x===this.x&&t.y===this.y},rotate:function(t,i){var n=this,e=i*bt,o=rt.cos(e),r=rt.sin(e),a=t.x,s=t.y,l=n.x,u=n.y;return n.x=h(a+(l-a)*o+(u-s)*r,ht),n.y=h(s+(u-s)*o-(l-a)*r,ht),n},multiply:function(t){var i=this;return i.x*=t,i.y*=t,i},distanceTo:function(t){var i=this.x-t.x,n=this.y-t.y;return rt.sqrt(i*i+n*n)}},Ft.onCircle=function(t,i,n){return i*=bt,new Ft(t.x-n*rt.cos(i),t.y-n*rt.sin(i))},_=function(t,n,e,o){var r=this;return r instanceof _?(r.x1=t||0,r.x2=e||0,r.y1=n||0,r.y2=o||0,i):new _(t,n,e,o)},_.fn=_.prototype={width:function(){return this.x2-this.x1},height:function(){return this.y2-this.y1},translate:function(t,i){var n=this;return n.x1+=t,n.x2+=t,n.y1+=i,n.y2+=i,n},move:function(t,i){var n=this,e=n.height(),o=n.width();return W(t)&&(n.x1=t,n.x2=n.x1+o),W(i)&&(n.y1=i,n.y2=n.y1+e),n},wrap:function(t){var i=this;return i.x1=rt.min(i.x1,t.x1),i.y1=rt.min(i.y1,t.y1),i.x2=rt.max(i.x2,t.x2),i.y2=rt.max(i.y2,t.y2),i},wrapPoint:function(t){return this.wrap(new _(t.x,t.y,t.x,t.y)),this},snapTo:function(t,i){var n=this;return i!=Dt&&i||(n.x1=t.x1,n.x2=t.x2),i!=Gt&&i||(n.y1=t.y1,n.y2=t.y2),n},alignTo:function(t,i){var n,e,o=this,r=o.height(),a=o.width(),s=i==jt||i==ut?Gt:Dt,l=s==Gt?r:a;return i===ct?(n=t.center(),e=o.center(),o.x1+=n.x-e.x,o.y1+=n.y-e.y):o[s+1]=i===jt||i===St?t[s+1]-l:t[s+2],o.x2=o.x1+a,o.y2=o.y1+r,o},shrink:function(t,i){var n=this;return n.x2-=t,n.y2-=i,n},expand:function(t,i){return this.shrink(-t,-i),this},pad:function(t){var i=this,e=n(t);return i.x1-=e.left,i.x2+=e.right,i.y1-=e.top,i.y2+=e.bottom,i},unpad:function(t){var i=this,e=n(t);return e.left=-e.left,e.top=-e.top,e.right=-e.right,e.bottom=-e.bottom,i.pad(e)},clone:function(){var t=this;return new _(t.x1,t.y1,t.x2,t.y2)},center:function(){var t=this;return new Ft(t.x1+t.width()/2,t.y1+t.height()/2)},containsPoint:function(t){var i=this;return t.x>=i.x1&&i.x2>=t.x&&t.y>=i.y1&&i.y2>=t.y},points:function(){var t=this;return[new Ft(t.x1,t.y1),new Ft(t.x2,t.y1),new Ft(t.x2,t.y2),new Ft(t.x1,t.y2)]},getHash:function(){var t=this;return[t.x1,t.y1,t.x2,t.y2].join(",")},overlaps:function(t){return!(this.y1>t.y2||t.y1>this.y2||this.x1>t.x2||t.x1>this.x2)},rotate:function(t){var i=this,n=i.width(),e=i.height(),o=i.center(),r=o.x,s=o.y,l=a(0,0,r,s,t),u=a(n,0,r,s,t),c=a(n,e,r,s,t),h=a(0,e,r,s,t);return n=rt.max(l.x,u.x,c.x,h.x)-rt.min(l.x,u.x,c.x,h.x),e=rt.max(l.y,u.y,c.y,h.y)-rt.min(l.y,u.y,c.y,h.y),i.x2=i.x1+n,i.y2=i.y1+e,i},toRect:function(){return new Q.Rect([this.x1,this.y1],[this.width(),this.height()])},hasSize:function(){return 0!==this.width()&&0!==this.height()},align:function(t,i,n){var e=this,o=i+1,r=i+2,a=i===Dt?Ut:Tt,s=e[a]();l(n,[St,jt])?(e[o]=t[o],e[r]=e[o]+s):l(n,[It,ut])?(e[r]=t[r],e[o]=e[r]-s):n==ct&&(e[o]=t[o]+(t[a]()-s)/2,e[r]=e[o]+s)}},M=$.extend({init:function(t,i,n,e,o){var r=this;r.c=t,r.ir=i,r.r=n,r.startAngle=e,r.angle=o},clone:function(){var t=this;return new M(t.c,t.ir,t.r,t.startAngle,t.angle)},middle:function(){return this.startAngle+this.angle/2},radius:function(t,i){var n=this;return i?n.ir=t:n.r=t,n},point:function(t,i){var n=this,e=t*bt,o=rt.cos(e),r=rt.sin(e),a=i?n.ir:n.r,s=h(n.c.x-o*a,ht),l=h(n.c.y-r*a,ht);return new Ft(s,l)},adjacentBox:function(t,i,n){var e=this.clone().expand(t),o=e.middle(),r=e.point(o),a=i/2,s=n/2,l=r.x-a,u=r.y-s,c=rt.sin(o*bt),h=rt.cos(o*bt);return rt.abs(c)<.9&&(l+=a*-h/rt.abs(h)),rt.abs(h)<.9&&(u+=s*-c/rt.abs(c)),new _(l,u,l+i,u+n)},containsPoint:function(t){var i=this,n=i.c,e=i.ir,o=i.r,r=i.startAngle,a=i.startAngle+i.angle,s=t.x-n.x,l=t.y-n.y,u=new Ft(s,l),c=i.point(r),p=new Ft(c.x-n.x,c.y-n.y),f=i.point(a),d=new Ft(f.x-n.x,f.y-n.y),x=h(s*s+l*l,ht);return(p.equals(u)||g(p,u))&&!g(d,u)&&x>=e*e&&o*o>=x},getBBox:function(){var t,i,n,e=this,o=new _(Pt,Pt,Rt,Rt),r=h(e.startAngle%360),a=h((r+e.angle)%360),s=e.ir,l=[0,90,180,270,r,a].sort(x),u=nt(r,l),c=nt(a,l);for(t=r==a?l:c>u?l.slice(u,c+1):[].concat(l.slice(0,c+1),l.slice(u,l.length)),i=0;t.length>i;i++)n=e.point(t[i]),o.wrapPoint(n),o.wrapPoint(n,s);return s||o.wrapPoint(e.c),o},expand:function(t){return this.r+=t,this}}),S=M.extend({init:function(t,i,n,e){M.fn.init.call(this,t,0,i,n,e)},expand:function(t){return M.fn.expand.call(this,t)},clone:function(){var t=this;return new S(t.c,t.r,t.startAngle,t.angle)},radius:function(t){return M.fn.radius.call(this,t)},point:function(t){return M.fn.point.call(this,t)}}),A=function(){},A.fn=A.prototype={createRing:function(t,i){var n,e=t.startAngle+180,o=t.angle+e,r=new Q.Point(t.c.x,t.c.y),a=rt.max(t.r,0),s=rt.max(t.ir,0),l=new Q.Arc(r,{startAngle:e,endAngle:o,radiusX:a,radiusY:a}),u=J.Path.fromArc(l,i).close();return s?(l.radiusX=l.radiusY=s,n=l.pointAt(o),u.lineTo(n.x,n.y),u.arc(o,e,s,s,!0)):u.lineTo(r.x,r.y),u}},A.current=new A,P=$.extend({init:function(t){var i=this;i.children=[],i.options=at({},i.options,t)},reflow:function(t){var i,n,e,o=this,r=o.children;for(n=0;r.length>n;n++)e=r[n],e.reflow(t),i=i?i.wrap(e.box):e.box.clone();o.box=i||t},destroy:function(){var t,i=this,n=i.children;for(this.animation&&this.animation.destroy(),t=0;n.length>t;t++)n[t].destroy()},getRoot:function(){var t=this.parent;return t?t.getRoot():null},getChart:function(){var t=this.getRoot();return t?t.chart:i},translateChildren:function(t,i){var n,e=this,o=e.children,r=o.length;for(n=0;r>n;n++)o[n].box.translate(t,i)},append:function(){X(this.children,arguments);for(var t=0;t<arguments.length;t++)arguments[t].parent=this},renderVisual:function(){this.options.visible!==!1&&(this.createVisual(),this.addVisual(),this.renderChildren(),this.createAnimation(),this.renderComplete())},addVisual:function(){this.visual&&(this.visual.chartElement=this,this.parent&&this.parent.appendVisual(this.visual))},renderChildren:function(){var t,i=this.children;for(t=0;i.length>t;t++)i[t].renderVisual()},createVisual:function(){this.visual=new Y.drawing.Group({zIndex:this.options.zIndex,visible:K(this.options.visible,!0)})},createAnimation:function(){this.visual&&(this.animation=J.Animation.create(this.visual,this.options.animation))},appendVisual:function(t){t.chartElement||(t.chartElement=this),t.options.noclip?this.clipRoot().visual.append(t):W(t.options.zIndex)?this.stackRoot().stackVisual(t):this.visual?this.visual.append(t):this.parent.appendVisual(t)},clipRoot:function(){return this.parent?this.parent.clipRoot():this},stackRoot:function(){return this.parent?this.parent.stackRoot():this},stackVisual:function(t){var i,n,e,o=t.options.zIndex||0,r=this.visual.children;for(i=0;r.length>i&&(n=r[i],e=K(n.options.zIndex,0),!(e>o));i++);this.visual.insertAt(t,i)},traverse:function(t){var i,n,e=this.children;for(i=0;e.length>i;i++)n=e[i],t(n),n.traverse&&n.traverse(t)},closest:function(t){for(var n=this,e=!1;n&&!e;)e=t(n),e||(n=n.parent);return e?n:i},renderComplete:t.noop,hasHighlight:function(){var t=(this.options||{}).highlight;return!(!this.createHighlight||t&&t.visible===!1)},toggleHighlight:function(i){var n,e=this,o=e._highlight,r=(e.options||{}).highlight,a=(r||{}).visual;if(!o){if(n={fill:{color:Ot,opacity:.2},stroke:{color:Ot,width:1,opacity:.2}},a){if(o=e._highlight=a(t.extend(e.highlightVisualArgs(),{createVisual:function(){return e.createHighlight(n)},sender:e.getChart(),series:e.series,dataItem:e.dataItem,category:e.category,value:e.value,percentage:e.percentage,runningTotal:e.runningTotal,total:e.total})),!o)return}else o=e._highlight=e.createHighlight(n);o.options.zIndex=e.options.zIndex,e.appendVisual(o)}o.visible(i)},createGradientOverlay:function(t,i,n){var e=new J.Path(at({stroke:{color:Vt},fill:this.createGradient(n),closed:t.options.closed},i));return e.segments.elements(t.segments.elements()),e},createGradient:function(t){return this.parent?this.parent.createGradient(t):i}}),R=P.extend({init:function(t){var i=this;i.gradients={},P.fn.init.call(i,t)},options:{width:yt,height:mt,background:Ot,border:{color:lt,width:0},margin:n(5),zIndex:-2},reflow:function(){var t,i=this,n=i.options,e=i.children,o=new _(0,0,n.width,n.height);for(i.box=o.unpad(n.margin),t=0;e.length>t;t++)e[t].reflow(o),o=s(o,e[t].box)||_()},createVisual:function(){this.visual=new J.Group,this.createBackground()},createBackground:function(){var t=this.options,i=t.border||{},n=this.box.clone().pad(t.margin).unpad(i.width),e=J.Path.fromRect(n.toRect(),{stroke:{color:i.width?i.color:"",width:i.width,dashType:i.dashType},fill:{color:t.background,opacity:t.opacity},zIndex:-10});this.visual.append(e)},getRoot:function(){return this},createGradient:function(t){var i,n,e=this.gradients,o=H.objectKey(t),r=Y.Gradients[t.gradient];return e[o]?i=e[o]:(n=at({},r,t),"linear"==r.type?i=new J.LinearGradient(n):(t.innerRadius&&(n.stops=T(n)),i=new J.RadialGradient(n),i.supportVML=r.supportVML!==!1),e[o]=i),i}}),V=P.extend({options:{align:St,vAlign:jt,margin:{},padding:{},border:{color:lt,width:0},background:"",shrinkToFit:!1,width:0,height:0,visible:!0},reflow:function(t){function i(){s.align(t,Dt,l.align),s.align(t,Gt,l.vAlign),s.paddingBox=e.clone().unpad(f).unpad(x)}var e,o,r,a,s=this,l=s.options,u=l.width,c=l.height,h=u&&c,p=l.shrinkToFit,f=n(l.margin),d=n(l.padding),x=l.border.width,m=s.children;for(o=t.clone(),h&&(o.x2=o.x1+u,o.y2=o.y1+c),p&&o.unpad(f).unpad(x).unpad(d),P.fn.reflow.call(s,o),e=h?s.box=_(0,0,u,c):s.box,p&&h?(i(),o=s.contentBox=s.paddingBox.clone().unpad(d)):(o=s.contentBox=e.clone(),e.pad(d).pad(x).pad(f),i()),s.translateChildren(e.x1-o.x1+f.left+x+d.left,e.y1-o.y1+f.top+x+d.top),r=0;m.length>r;r++)a=m[r],a.reflow(a.box)},align:function(t,i,n){this.box.align(t,i,n)},hasBox:function(){var t=this.options;return t.border.width||t.background},createVisual:function(){P.fn.createVisual.call(this);var t=this.options;t.visible&&this.hasBox()&&this.visual.append(J.Path.fromRect(this.paddingBox.toRect(),this.visualStyle()))},visualStyle:function(){var t=this,i=t.options,n=i.border||{};return{stroke:{width:n.width,color:n.color,opacity:K(n.opacity,i.opacity),dashType:n.dashType},fill:{color:i.background,opacity:i.opacity},cursor:i.cursor}}}),z=P.extend({init:function(t,i){var n=this;P.fn.init.call(n,i),n.content=t,n.reflow(_())},options:{font:xt,color:lt,align:St,vAlign:""},reflow:function(t){var i,n=this,e=n.options;i=e.size=Z(n.content,{font:e.font}),n.baseline=i.baseline,n.box=_(t.x1,t.y1,t.x1+i.width,t.y1+i.height)},createVisual:function(){var t=this.options;this.visual=new J.Text(this.content,this.box.toRect().topLeft(),{font:t.font,fill:{color:t.color,opacity:t.opacity},cursor:t.cursor})}}),C=P.extend({init:function(t){P.fn.init.call(this,t),this._initDirection()},_initDirection:function(){var t=this.options;t.vertical?(this.groupAxis=Dt,this.elementAxis=Gt,this.groupSizeField=Ut,this.elementSizeField=Tt,this.groupSpacing=t.spacing,this.elementSpacing=t.vSpacing):(this.groupAxis=Gt,this.elementAxis=Dt,this.groupSizeField=Tt,this.elementSizeField=Ut,this.groupSpacing=t.vSpacing,this.elementSpacing=t.spacing)},options:{vertical:!0,wrap:!0,vSpacing:0,spacing:0},reflow:function(t){this.box=t.clone(),this.reflowChildren()},reflowChildren:function(){var t,i,n,e,o,r,a,s,l,u,c=this,h=c.box,p=c.elementAxis,f=c.groupAxis,d=c.elementSizeField,x=c.groupSizeField,m=c.groupOptions(),g=m.groups,v=g.length,y=h[f+1]+c.alignStart(m.groupsSize,h[x]()),b=y;if(v){for(a=0;v>a;a++){for(n=g[a],e=n.groupElements,o=e.length,t=h[p+1],r=0;o>r;r++)s=e[r],u=c.elementSize(s),i=b+c.alignStart(u[x],n.groupSize),l=_(),l[f+1]=i,l[f+2]=i+u[x],l[p+1]=t,l[p+2]=t+u[d],s.reflow(l),t+=u[d]+c.elementSpacing;b+=n.groupSize+c.groupSpacing}h[f+1]=y,h[f+2]=y+m.groupsSize,h[p+2]=h[p+1]+m.maxGroupElementsSize}},alignStart:function(t,i){var n=0,e=this.options.align;return e==It||e==ut?n=i-t:e==ct&&(n=(i-t)/2),n},groupOptions:function(){var t,i,n=this,e=n.box,o=n.children,r=o.length,a=this.elementSizeField,s=this.groupSizeField,l=this.elementSpacing,u=this.groupSpacing,c=h(e[a]()),p=0,f=0,d=0,x=0,m=[],g=[],v=0;for(p=0;r>p;p++)i=o[p],i.box||i.reflow(e),t=this.elementSize(i),n.options.wrap&&h(d+l+t[a])>c&&(m.push({groupElements:g,groupSize:f,groupElementsSize:d}),v=rt.max(v,d),x+=u+f,f=0,d=0,g=[]),f=rt.max(f,t[s]),d>0&&(d+=l),d+=t[a],g.push(i);return m.push({groupElements:g,groupSize:f,groupElementsSize:d}),v=rt.max(v,d),x+=f,{groups:m,groupsSize:x,maxGroupElementsSize:v}},elementSize:function(t){return{width:t.box.width(),height:t.box.height()}},createVisual:it}),L=V.extend({ROWS_SPLIT_REGEX:/\n|\\n/m,init:function(t,i){var n=this;n.content=t,V.fn.init.call(n,i),n._initContainer(),n.reflow(_())},_initContainer:function(){var t,i,n=this,e=n.options,o=(n.content+"").split(n.ROWS_SPLIT_REGEX),r=new C({vertical:!0,align:e.align,wrap:!1}),a=at({},e,{opacity:1,animation:null});for(n.container=r,n.append(r),i=0;o.length>i;i++)t=new z(ot(o[i]),a),r.append(t)},reflow:function(t){var i,e,o,r=this.options,a=r.visual;this.container.options.align=r.align,a&&!this._boxReflow?(t.hasSize()||(this._boxReflow=!0,this.reflow(t),this._boxReflow=!1,t=this.box),this.visual=a(this.visualContext(t)),i=t,this.visual&&(i=k(this.visual.clippedBBox()||new Q.Rect),this.visual.options.zIndex=r.zIndex,this.visual.options.noclip=r.noclip),this.box=this.contentBox=this.paddingBox=i):(V.fn.reflow.call(this,t),r.rotation&&(e=n(r.margin),o=this.box.unpad(e),this.targetBox=t,this.normalBox=o.clone(),o=this.rotate(),o.translate(e.left-e.right,e.top-e.bottom),this.rotatedBox=o.clone(),o.pad(e)))},createVisual:function(){var t,i=this.options;i.visible&&(this.visual=new Y.drawing.Group({transform:this.rotationTransform(),zIndex:i.zIndex,noclip:i.noclip}),this.hasBox()&&(t=J.Path.fromRect(this.paddingBox.toRect(),this.visualStyle()),this.visual.append(t)))},renderVisual:function(){this.options.visual?(this.addVisual(),this.createAnimation()):V.fn.renderVisual.call(this)},visualOptions:function(){var t=this.options;return{background:t.background,border:t.border,color:t.color,font:t.font,margin:t.margin,padding:t.padding,visible:t.visible}},visualContext:function(t){var i=this;return{text:i.content,rect:t.toRect(),sender:this.getChart(),options:i.visualOptions(),createVisual:function(){return i._boxReflow=!0,i.reflow(t),i._boxReflow=!1,i.getDefaultVisual()}}},getDefaultVisual:function(){this.createVisual(),this.renderChildren();var t=this.visual;return delete this.visual,t},rotate:function(){var t=this.options;return this.box.rotate(t.rotation),this.align(this.targetBox,Dt,t.align),this.align(this.targetBox,Gt,t.vAlign),this.box},rotationTransform:function(){var t,i,n,e,o=this.options.rotation;return o?(t=this.normalBox.center(),i=t.x,n=t.y,e=this.rotatedBox.center(),Q.transform().translate(e.x-i,e.y-n).rotate(o,[i,n])):null}}),B=P.extend({init:function(t){var i=this;P.fn.init.call(i,t),t=i.options,i.append(new L(t.text,at({},t,{vAlign:t.position})))},options:{color:lt,position:jt,align:ct,margin:n(5),padding:n(5)},reflow:function(t){var i=this;P.fn.reflow.call(i,t),i.box.snapTo(t,Dt)}}),B.buildTitle=function(t,i,n){var e;return"string"==typeof t&&(t={text:t}),t=at({visible:!0},n,t),t&&t.visible&&t.text&&(e=new B(t),i.append(e)),e},I=L.extend({init:function(t,i,n,e,o){var r=this;r.text=i,r.value=t,r.index=n,r.dataItem=e,L.fn.init.call(r,i,o)},visualContext:function(t){var i=L.fn.visualContext.call(this,t);return i.value=this.value,i.dataItem=this.dataItem,i.format=this.options.format,i.culture=this.options.culture,i},click:function(i,n){var e=this;i.trigger(st,{element:t(n.target),value:e.value,text:e.text,index:e.index,dataItem:e.dataItem,axis:e.parent.options})},rotate:function(){var t,i;return this.options.alignRotation!=ct?(t=this.normalBox.toRect(),i=this.rotationTransform(),this.box=k(t.bbox(i.matrix()))):L.fn.rotate.call(this),this.box},rotationTransform:function(){var t,i,n,e,o,r,a,s,l,u,c,p,f,d,x,m,g,v,y=this.options,b=y.rotation;return b?y.alignRotation==ct?L.fn.rotationTransform.call(this):(t=Q.transform().rotate(b).matrix(),i=this.normalBox.toRect(),n=this.targetBox.toRect(),e=y.rotationOrigin||jt,o=e==jt||e==ut?Dt:Gt,r=e==jt||e==ut?Gt:Dt,a=e==jt||e==St?n.origin:n.bottomRight(),s=i.topLeft().transformCopy(t),l=i.topRight().transformCopy(t),u=i.bottomRight().transformCopy(t),c=i.bottomLeft().transformCopy(t),p=Q.Rect.fromPoints(s,l,u,c),f={},f[r]=n.origin[r]-p.origin[r],d=rt.abs(s[r]+f[r]-a[r]),x=rt.abs(l[r]+f[r]-a[r]),h(d,vt)===h(x,vt)?(m=s,g=l):d>x?(m=l,g=u):(m=s,g=c),v=m[o]+(g[o]-m[o])/2,f[o]=n.center()[o]-v,Q.transform().translate(f.x,f.y).rotate(b)):null}}),j=P.extend({init:function(t){var i=this;P.fn.init.call(i,t),i.options.visible||(i.options=at({},i.options,{labels:{visible:!1},line:{visible:!1},margin:0,majorTickSize:0,minorTickSize:0})),i.options.minorTicks=at({},{color:i.options.line.color,width:i.options.line.width,visible:i.options.minorTickType!=Vt},i.options.minorTicks,{size:i.options.minorTickSize,align:i.options.minorTickType}),i.options.majorTicks=at({},{color:i.options.line.color,width:i.options.line.width,visible:i.options.majorTickType!=Vt},i.options.majorTicks,{size:i.options.majorTickSize,align:i.options.majorTickType}),this.options._deferLabels||i.createLabels(),i.createTitle(),i.createNotes()},options:{labels:{visible:!0,rotation:0,mirror:!1,step:1,skip:0},line:{width:1,color:lt,visible:!0},title:{visible:!0,position:ct},majorTicks:{align:Lt,size:4,skip:0,step:1},minorTicks:{align:Lt,size:3,skip:0,step:1},axisCrossingValue:0,majorTickType:Lt,minorTickType:Vt,majorGridLines:{skip:0,step:1},minorGridLines:{visible:!1,width:1,color:lt,skip:0,step:1},margin:5,visible:!0,reverse:!1,justified:!0,notes:{label:{text:""}},_alignLines:!0,_deferLabels:!1},labelsRange:function(){return{min:this.options.labels.skip,max:this.labelsCount()}},createLabels:function(){var i,n,e,o,r=this,a=r.options,s=a.vertical?It:ct,l=at({},a.labels,{align:s,zIndex:a.zIndex}),u=rt.max(1,l.step);if(r.children=t.grep(r.children,function(t){return!(t instanceof I)}),r.labels=[],l.visible)for(i=r.labelsRange(),n=l.rotation,et(n)&&(l.alignRotation=n.align,l.rotation=n.angle),"auto"==l.rotation&&(l.rotation=0,a.autoRotateLabels=!0),o=i.min;i.max>o;o+=u)e=r.createAxisLabel(o,l),e&&(r.append(e),r.labels.push(e))},lineBox:function(){var t=this,i=t.options,n=t.box,e=i.vertical,o=i.labels.mirror,r=o?n.x1:n.x2,a=o?n.y2:n.y1,s=i.line.width||0;return e?_(r,n.y1,r,n.y2-s):_(n.x1,a,n.x2-s,a)},createTitle:function(){var t,i=this,n=i.options,e=at({rotation:n.vertical?-90:0,text:"",zIndex:1,visualSize:!0},n.title);e.visible&&e.text&&(t=new L(e.text,e),i.append(t),i.title=t)},createNotes:function(){var t,i,n,e=this,o=e.options,r=o.notes,a=r.data||[];for(e.notes=[],t=0;a.length>t;t++)i=at({},r,a[t]),i.value=e.parseNoteValue(i.value),n=new E(i.value,i.label.text,null,null,null,i),n.options.visible&&(W(n.options.position)?o.vertical&&!l(n.options.position,[St,It])?n.options.position=o.reverse?St:It:o.vertical||l(n.options.position,[jt,ut])||(n.options.position=o.reverse?ut:jt):n.options.position=o.vertical?o.reverse?St:It:o.reverse?ut:jt,e.append(n),e.notes.push(n))},parseNoteValue:function(t){return t},renderVisual:function(){P.fn.renderVisual.call(this),this.createPlotBands()},createVisual:function(){P.fn.createVisual.call(this),this.createBackground(),this.createLine()},gridLinesVisual:function(){var t=this._gridLines;return t||(t=this._gridLines=new J.Group({zIndex:-2}),this.appendVisual(this._gridLines)),t},createTicks:function(t){function i(i,n,o){var s,u=i.length;if(n.visible)for(s=n.skip;u>s;s+=n.step)W(o)&&s%o===0||(l.tickX=a?r.x2:r.x2-n.size,l.tickY=a?r.y1-n.size:r.y1,l.position=i[s],t.append(e(l,n)))}var n=this,o=n.options,r=n.lineBox(),a=o.labels.mirror,s=o.majorTicks.visible?o.majorUnit:0,l={vertical:o.vertical};i(n.getMajorTickPositions(),o.majorTicks),i(n.getMinorTickPositions(),o.minorTicks,s/o.minorUnit)},createLine:function(){var t,i,n=this,e=n.options,o=e.line,r=n.lineBox();o.width>0&&o.visible&&(t=new J.Path({stroke:{width:o.width,color:o.color,dashType:o.dashType}}),t.moveTo(r.x1,r.y1).lineTo(r.x2,r.y2),e._alignLines&&w(t),i=this._lineGroup=new J.Group,i.append(t),this.visual.append(i),this.createTicks(i))},getActualTickSize:function(){var t=this,i=t.options,n=0;return i.majorTicks.visible&&i.minorTicks.visible?n=rt.max(i.majorTicks.size,i.minorTicks.size):i.majorTicks.visible?n=i.majorTicks.size:i.minorTicks.visible&&(n=i.minorTicks.size),n},createBackground:function(){var t=this,i=t.options,n=i.background,e=t.box;n&&(t._backgroundPath=J.Path.fromRect(e.toRect(),{fill:{color:n},stroke:null}),this.visual.append(t._backgroundPath))},createPlotBands:function(){var i,n,e,o,r,a,s=this,l=s.options,u=l.plotBands||[],c=l.vertical,h=s.plotArea;0!==u.length&&(r=this._plotbandGroup=new J.Group({zIndex:-1}),a=t.grep(s.pane.axes,function(t){return t.options.vertical!==s.options.vertical})[0],t.each(u,function(t,l){var u,p;
e=K(l.from,Rt),o=K(l.to,Pt),c?(i=(a||h.axisX).lineBox(),n=s.getSlot(l.from,l.to,!0)):(i=s.getSlot(l.from,l.to,!0),n=(a||h.axisY).lineBox()),0!==i.width()&&0!==n.height()&&(u=new Q.Rect([i.x1,n.y1],[i.width(),n.height()]),p=J.Path.fromRect(u,{fill:{color:l.color,opacity:l.opacity},stroke:null}),r.append(p))}),s.appendVisual(r))},createGridLines:function(t){function i(t,i,e){var r,s=t.length;if(i.visible)for(r=i.skip;s>r;r+=i.step)n=h(t[r]),l(n,x)||r%e===0||a&&f===n||(d.position=n,m.append(o(d,i)),x.push(n))}var n,e=this,r=e.options,a=t.options.line.visible,s=r.majorGridLines,u=s.visible?r.majorUnit:0,c=r.vertical,p=t.lineBox(),f=p[c?"y1":"x1"],d={lineStart:p[c?"x1":"y1"],lineEnd:p[c?"x2":"y2"],vertical:c},x=[],m=this.gridLinesVisual();return i(e.getMajorTickPositions(),r.majorGridLines),i(e.getMinorTickPositions(),r.minorGridLines,u/r.minorUnit),m.children},reflow:function(t){var i,n,e=this,o=e.options,r=o.vertical,a=e.labels,s=a.length,l=e.title,u=r?Ut:Tt,c=l?l.box[u]():0,h=e.getActualTickSize()+o.margin+c,p=0,f=(this.getRoot()||{}).box||t,d=f[u]();for(n=0;s>n;n++)i=a[n].box[u](),d>=i+h&&(p=rt.max(p,i));e.box=r?_(t.x1,t.y1,t.x1+p+h,t.y2):_(t.x1,t.y1,t.x2,t.y1+p+h),e.arrangeTitle(),e.arrangeLabels(),e.arrangeNotes()},getLabelsTickPositions:function(){return this.getMajorTickPositions()},labelTickIndex:function(t){return t.index},arrangeLabels:function(){var t,i,n,e,o,r,a,s,l,u,c,h=this,p=h.options,f=h.labels,d=!p.justified,x=p.vertical,m=h.lineBox(),g=p.labels.mirror,v=h.getLabelsTickPositions(),y=h.getActualTickSize()+p.margin;for(n=0;f.length>n;n++)e=f[n],o=h.labelTickIndex(e),r=x?e.box.height():e.box.width(),a=v[o]-r/2,x?(d&&(s=v[o],l=v[o+1],u=s+(l-s)/2,a=u-r/2),c=m.x2,g?(c+=y,e.options.rotationOrigin=St):(c-=y+e.box.width(),e.options.rotationOrigin=It),t=e.box.move(c,a)):(d?(s=v[o],l=v[o+1]):(s=a,l=a+r),i=m.y1,g?(i-=y+e.box.height(),e.options.rotationOrigin=ut):(i+=y,e.options.rotationOrigin=jt),t=_(s,i,l,i+e.box.height())),e.reflow(t)},autoRotateLabels:function(){var t,i,n,e,o,r;if(this.options.autoRotateLabels&&!this.options.vertical){for(t=this.getMajorTickPositions(),i=this.labels,r=0;i.length>r;r++)if(o=t[r+1]-t[r],n=i[r].box,n.width()>o){if(n.height()>o){e=-90;break}e=-45}if(e){for(r=0;i.length>r;r++)i[r].options.rotation=e,i[r].reflow(_());return!0}}},arrangeTitle:function(){var t=this,i=t.options,n=i.labels.mirror,e=i.vertical,o=t.title;o&&(e?(o.options.align=n?It:St,o.options.vAlign=o.options.position):(o.options.align=o.options.position,o.options.vAlign=n?jt:ut),o.reflow(t.box))},arrangeNotes:function(){var t,i,n,e,o=this;for(t=0;o.notes.length>t;t++)i=o.notes[t],e=i.options.value,W(e)?(o.shouldRenderNote(e)?i.show():i.hide(),n=o.getSlot(e)):i.hide(),i.reflow(n||o.lineBox())},alignTo:function(t){var i=this,n=t.lineBox(),e=i.options.vertical,o=e?Gt:Dt;i.box.snapTo(n,o),e?i.box.shrink(0,i.lineBox().height()-n.height()):i.box.shrink(i.lineBox().width()-n.width(),0),i.box[o+1]-=i.lineBox()[o+1]-n[o+1],i.box[o+2]-=i.lineBox()[o+2]-n[o+2]},axisLabelText:function(t,i,n){var e,o=t;return n.template?(e=tt(n.template),o=e({value:t,dataItem:i,format:n.format,culture:n.culture})):n.format&&(o=n.format.match(wt)?F.format(n.format,t):F.toString(t,n.format,n.culture)),o},slot:function(t,n){var e=this.getSlot(t,n);return e?e.toRect():i},contentBox:function(){var t=this.box.clone(),i=this.labels;return i.length&&(i[0].options.visible&&t.wrap(i[0].box),q(i).options.visible&&t.wrap(q(i).box)),t},limitRange:function(t,i,n,e,o){var r,a=this.options;if(!(n>t&&0>o&&(!W(a.min)||n>=a.min)||i>e&&o>0&&(!W(a.max)||a.max>=e)))return n>i&&o>0||t>e&&0>o?{min:t,max:i}:(r=i-t,n>t?(t=H.limitValue(t,n,e),i=H.limitValue(t+r,n+r,e)):i>e&&(i=H.limitValue(i,n,e),t=H.limitValue(i-r,n,e-r)),{min:t,max:i})}}),E=V.extend({init:function(t,i,n,e,o,r){var a=this;V.fn.init.call(a,r),a.value=t,a.text=i,a.dataItem=n,a.category=e,a.series=o,a.render()},options:{icon:{visible:!0,type:ft},label:{position:Mt,visible:!0,align:ct,vAlign:ct},line:{visible:!0},visible:!0,position:jt,zIndex:2},hide:function(){this.options.visible=!1},show:function(){this.options.visible=!0},render:function(){var t,i,n,e,o=this,r=o.options,a=r.label,s=o.text,l=r.icon,u=l.size,c=_();r.visible&&(W(a)&&a.visible&&(a.template?(e=tt(a.template),s=e({dataItem:o.dataItem,category:o.category,value:o.value,text:s,series:o.series})):a.format&&(s=m(a.format,s)),o.label=new L(s,at({},a)),a.position!==Mt||W(u)||(l.type===ft?u=rt.max(o.label.box.width(),o.label.box.height()):(i=o.label.box.width(),n=o.label.box.height()),c.wrap(o.label.box))),l.width=i||u||gt,l.height=n||u||gt,t=new U(at({},l)),o.marker=t,o.append(t),o.label&&o.append(o.label),t.reflow(_()),o.wrapperBox=c.wrap(t.box))},reflow:function(t){var i,n,e,o=this,r=o.options,a=t.center(),s=o.wrapperBox,u=r.line.length,c=r.position,h=o.label,p=o.marker;r.visible&&(l(c,[St,It])?c===St?(e=s.alignTo(t,c).translate(-u,t.center().y-s.center().y),r.line.visible&&(i=[t.x1,a.y],o.linePoints=[i,[e.x2,a.y]],n=e.clone().wrapPoint(i))):(e=s.alignTo(t,c).translate(u,t.center().y-s.center().y),r.line.visible&&(i=[t.x2,a.y],o.linePoints=[i,[e.x1,a.y]],n=e.clone().wrapPoint(i))):c===ut?(e=s.alignTo(t,c).translate(t.center().x-s.center().x,u),r.line.visible&&(i=[a.x,t.y2],o.linePoints=[i,[a.x,e.y1]],n=e.clone().wrapPoint(i))):(e=s.alignTo(t,c).translate(t.center().x-s.center().x,-u),r.line.visible&&(i=[a.x,t.y1],o.linePoints=[i,[a.x,e.y2]],n=e.clone().wrapPoint(i))),p&&p.reflow(e),h&&(h.reflow(e),p&&(r.label.position===Lt&&h.box.alignTo(p.box,c),h.reflow(h.box))),o.contentBox=e,o.targetBox=t,o.box=n||e)},createVisual:function(){V.fn.createVisual.call(this),this.options.visible&&this.createLine()},renderVisual:function(){var t=this,i=t.options,n=i.visual;i.visible&&n?(t.visual=n({dataItem:t.dataItem,category:t.category,value:t.value,text:t.text,sender:t.getChart(),series:t.series,rect:t.targetBox.toRect(),options:{background:i.background,border:i.background,icon:i.icon,label:i.label,line:i.line,position:i.position,visible:i.visible},createVisual:function(){t.createVisual(),t.renderChildren();var i=t.visual;return delete t.visual,i}}),t.addVisual()):V.fn.renderVisual.call(t)},createLine:function(){var t,i=this.options.line;this.linePoints&&(t=J.Path.fromPoints(this.linePoints,{stroke:{color:i.color,width:i.width,dashType:i.dashType}}),w(t),this.visual.append(t))},click:function(t,i){var n=this.eventArgs(i);t.trigger(zt,n)||i.preventDefault()},hover:function(t,i){var n=this.eventArgs(i);t.trigger(Ct,n)||i.preventDefault()},leave:function(t){t._unsetActivePoint()},eventArgs:function(i){var n=this,e=n.options;return{element:t(i.target),text:W(e.label)?e.label.text:"",dataItem:n.dataItem,series:n.series,value:n.value,category:n.category,visual:n.visual}}}),U=V.extend({init:function(t,i){this.pointData=i,V.fn.init.call(this,t)},options:{type:ft,align:ct,vAlign:ct},getElement:function(){var t,i,n=this,e=n.options,o=e.type,r=e.rotation,a=n.paddingBox,s=a.center(),l=a.width()/2;if(e.visible&&n.hasBox())return i=n.visualStyle(),o===ft?t=new J.Circle(new Q.Circle([h(a.x1+l,ht),h(a.y1+a.height()/2,ht)],l),i):o===Et?t=J.Path.fromPoints([[a.x1+l,a.y1],[a.x1,a.y2],[a.x2,a.y2]],i).close():o===dt?(t=new J.MultiPath(i),t.moveTo(a.x1,a.y1).lineTo(a.x2,a.y2),t.moveTo(a.x1,a.y2).lineTo(a.x2,a.y1)):t=J.Path.fromRect(a.toRect(),i),r&&t.transform(Q.transform().rotate(-r,[s.x,s.y])),t.options.zIndex=this.options.zIndex,t},createElement:function(){var t,i=this,n=i.options.visual,e=i.pointData||{};return t=n?n({value:e.value,dataItem:e.dataItem,sender:i.getChart(),series:e.series,category:e.category,rect:i.paddingBox.toRect(),options:i.visualOptions(),createVisual:function(){return i.getElement()}}):i.getElement()},visualOptions:function(){var t=this.options;return{background:t.background,border:t.border,margin:t.margin,padding:t.padding,type:t.type,size:t.width,visible:t.visible}},createVisual:function(){this.visual=this.createElement()}}),O=j.extend({init:function(t,i,n){var e=this,o=e.initDefaults(t,i,n);j.fn.init.call(e,o)},startValue:function(){return 0},options:{type:"numeric",min:0,max:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:lt},labels:{format:"#.####################"},zIndex:1},initDefaults:function(t,i,n){var e,o=this,a=n.narrowRange,s=o.autoAxisMin(t,i,a),l=o.autoAxisMax(t,i,a),h=r(s,l),p={majorUnit:h};return n.roundToMajorUnit!==!1&&(0>s&&f(s,h,1/3)&&(s-=h),l>0&&f(l,h,1/3)&&(l+=h)),p.min=c(s,h),p.max=u(l,h),this.totalMin=W(n.min)?rt.min(p.min,n.min):p.min,this.totalMax=W(n.max)?rt.max(p.max,n.max):p.max,this.totalMajorUnit=h,n&&(e=W(n.min)||W(n.max),e&&n.min===n.max&&(n.min>0?n.min=0:n.max=1),n.majorUnit?(p.min=c(p.min,n.majorUnit),p.max=u(p.max,n.majorUnit)):e&&(n=at(p,n),p.majorUnit=r(n.min,n.max))),p.minorUnit=(n.majorUnit||p.majorUnit)/5,at(p,n)},range:function(){var t=this.options;return{min:t.min,max:t.max}},autoAxisMax:function(t,i,n){var e,o;if(!t&&!i)return 1;if(0>=t&&0>=i){if(i=t==i?0:i,o=rt.abs((i-t)/i),n===!1||!n&&o>Nt)return 0;e=rt.min(0,i-(t-i)/2)}else t=t==i?0:t,e=i;return e},autoAxisMin:function(t,i,n){var e,o;if(!t&&!i)return 0;if(t>=0&&i>=0){if(t=t==i?0:t,o=(i-t)/i,n===!1||!n&&o>Nt)return 0;e=rt.max(0,t-(i-t)/2)}else i=t==i?0:i,e=t;return e},getDivisions:function(t){if(0===t)return 1;var i=this.options,n=i.max-i.min;return rt.floor(h(n/t,ht))+1},getTickPositions:function(t,i){var n,e=this,o=e.options,r=o.vertical,a=o.reverse,s=e.lineBox(),l=r?s.height():s.width(),u=o.max-o.min,c=l/u,p=t*c,f=0,d=e.getDivisions(t),x=(r?-1:1)*(a?-1:1),m=1===x?1:2,g=s[(r?Gt:Dt)+m],v=[];for(i&&(f=i/t),n=0;d>n;n++)n%f!==0&&v.push(h(g,ht)),g+=p*x;return v},getMajorTickPositions:function(){var t=this;return t.getTickPositions(t.options.majorUnit)},getMinorTickPositions:function(){var t=this;return t.getTickPositions(t.options.minorUnit)},getSlot:function(t,i,n){var e,o,r=this,a=r.options,s=a.reverse,l=a.vertical,u=l?Gt:Dt,c=r.lineBox(),h=c[u+(s?2:1)],p=l?c.height():c.width(),f=s?-1:1,d=f*(p/(a.max-a.min)),x=new _(c.x1,c.y1,c.x1,c.y1);return W(t)||(t=i||0),W(i)||(i=t||0),n&&(t=rt.max(rt.min(t,a.max),a.min),i=rt.max(rt.min(i,a.max),a.min)),l?(e=a.max-rt.max(t,i),o=a.max-rt.min(t,i)):(e=rt.min(t,i)-a.min,o=rt.max(t,i)-a.min),x[u+1]=rt.max(rt.min(h+d*(s?o:e),kt),-kt),x[u+2]=rt.max(rt.min(h+d*(s?e:o),kt),-kt),x},getValue:function(t){var i,n=this,e=n.options,o=e.reverse,r=e.vertical,a=1*e.max,s=1*e.min,l=r?Gt:Dt,u=n.lineBox(),c=u[l+(o?2:1)],p=r?u.height():u.width(),f=o?-1:1,d=f*(t[l]-c),x=(a-s)/p,m=d*x;return 0>d||d>p?null:(i=r?a-m:s+m,h(i,vt))},translateRange:function(t){var i=this,n=i.options,e=i.lineBox(),o=n.vertical,r=n.reverse,a=o?e.height():e.width(),s=n.max-n.min,l=a/s,u=h(t/l,vt);return!o&&!r||o&&r||(u=-u),{min:n.min+u,max:n.max+u}},scaleRange:function(t){var i=this,n=i.options,e=-t*n.majorUnit;return{min:n.min-e,max:n.max+e}},labelsCount:function(){return this.getDivisions(this.options.majorUnit)},createAxisLabel:function(t,i){var n=this,e=n.options,o=h(e.min+t*e.majorUnit,vt),r=n.axisLabelText(o,null,i);return new I(o,r,t,null,i)},shouldRenderNote:function(t){var i=this.range();return t>=i.min&&i.max>=t},pan:function(t){var i=this.translateRange(t);return this.limitRange(i.min,i.max,this.totalMin,this.totalMax)},pointsRange:function(t,i){var n=this.getValue(t),e=this.getValue(i),o=rt.min(n,e),r=rt.max(n,e);return{min:o,max:r}},zoomRange:function(t){var n=this.scaleRange(t),e=this.totalMax,o=this.totalMin,r=H.limitValue(n.min,o,e),a=H.limitValue(n.max,o,e),s=this.options.max-this.options.min;return this.totalMajorUnit>s||a-r>=this.totalMajorUnit?{min:r,max:a}:i}}),D=j.extend({init:function(t,i,n){this.options=this._initOptions(t,i,n),j.fn.init.call(this,n)},startValue:function(){return this.options.min},options:{type:"log",majorUnit:10,minorUnit:1,axisCrossingValue:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:lt},zIndex:1},getSlot:function(t,n,e){var o,r,a=this,s=a.options,l=s.reverse,u=s.vertical,c=u?Gt:Dt,h=a.lineBox(),f=h[c+(l?2:1)],d=u?h.height():h.width(),x=l?-1:1,m=s.majorUnit,g=a.logMin,v=a.logMax,y=x*(d/(v-g)),b=new _(h.x1,h.y1,h.x1,h.y1);return W(t)||(t=n||1),W(n)||(n=t||1),0>=t||0>=n?i:(e&&(t=rt.max(rt.min(t,s.max),s.min),n=rt.max(rt.min(n,s.max),s.min)),t=p(t,m),n=p(n,m),u?(o=v-rt.max(t,n),r=v-rt.min(t,n)):(o=rt.min(t,n)-g,r=rt.max(t,n)-g),b[c+1]=f+y*(l?r:o),b[c+2]=f+y*(l?o:r),b)},getValue:function(t){var i,n=this,e=n.options,o=e.reverse,r=e.vertical,a=n.lineBox(),s=e.majorUnit,l=n.logMin,u=n.logMax,c=r===o?1:-1,p=1===c?1:2,f=r?a.height():a.width(),d=(u-l)/f,x=r?Gt:Dt,m=a[x+p],g=c*(t[x]-m),v=g*d;return 0>g||g>f?null:(i=l+v,h(rt.pow(s,i),vt))},range:function(){var t=this.options;return{min:t.min,max:t.max}},scaleRange:function(t){var i=this,n=i.options,e=n.majorUnit,o=-t;return{min:rt.pow(e,i.logMin-o),max:rt.pow(e,i.logMax+o)}},translateRange:function(t){var i=this,n=i.options,e=n.majorUnit,o=i.lineBox(),r=n.vertical,a=n.reverse,s=r?o.height():o.width(),l=s/(i.logMax-i.logMin),u=h(t/l,vt);return!r&&!a||r&&a||(u=-u),{min:rt.pow(e,i.logMin+u),max:rt.pow(e,i.logMax+u)}},labelsCount:function(){var t=this,i=rt.floor(t.logMax),n=rt.floor(i-t.logMin)+1;return n},getMajorTickPositions:function(){var t=this,i=[];return t.traverseMajorTicksPositions(function(t){i.push(t)},{step:1,skip:0}),i},createTicks:function(t){function i(i,n){c.tickX=s?a.x2:a.x2-n.size,c.tickY=s?a.y1-n.size:a.y1,c.position=i,t.append(e(c,n))}var n=this,o=[],r=n.options,a=n.lineBox(),s=r.labels.mirror,l=r.majorTicks,u=r.minorTicks,c={vertical:r.vertical};return l.visible&&n.traverseMajorTicksPositions(i,l),u.visible&&n.traverseMinorTicksPositions(i,u),o},createGridLines:function(t){function i(t,i){l(t,h)||(c.position=t,p.append(o(c,i)),h.push(t))}var n=this,e=n.options,r=e.majorGridLines,a=e.minorGridLines,s=e.vertical,u=t.lineBox(),c={lineStart:u[s?"x1":"y1"],lineEnd:u[s?"x2":"y2"],vertical:s},h=[],p=this.gridLinesVisual();return r.visible&&n.traverseMajorTicksPositions(i,r),a.visible&&n.traverseMinorTicksPositions(i,a),p.children},traverseMajorTicksPositions:function(t,i){var n,e,o=this,r=o._lineOptions(),a=r.lineStart,s=r.step,l=o.logMin,u=o.logMax;for(n=rt.ceil(l)+i.skip;u>=n;n+=i.step)e=h(a+s*(n-l),vt),t(e,i)},traverseMinorTicksPositions:function(t,i){var n,e,o,r,a,s=this,l=s.options,u=s._lineOptions(),c=u.lineStart,f=u.step,d=l.majorUnit,x=s.logMin,m=s.logMax,g=rt.floor(x),v=l.max,y=l.min,b=l.minorUnit;for(n=g;m>n;n++)for(r=s._minorIntervalOptions(n),a=i.skip;b>a&&(e=r.value+a*r.minorStep,!(e>v));a+=i.step)e>=y&&(o=h(c+f*(p(e,d)-x),vt),t(o,i))},createAxisLabel:function(t,i){var n=this,e=n.options,o=rt.ceil(n.logMin+t),r=Math.pow(e.majorUnit,o),a=n.axisLabelText(r,null,i);return new I(r,a,t,null,i)},shouldRenderNote:function(t){var i=this.range();return t>=i.min&&i.max>=t},_throwNegativeValuesError:function(){throw Error("Non positive values cannot be used for a logarithmic axis")},_initOptions:function(t,i,n){var e=this,o=at({},e.options,{min:t,max:i},n),r=o.min,a=o.max,s=o.majorUnit,l=this._autoMax(i,s),u=this._autoMin(t,i,o);return 0>=o.axisCrossingValue&&e._throwNegativeValuesError(),W(n.max)?0>=n.max&&e._throwNegativeValuesError():a=l,W(n.min)?0>=n.min&&e._throwNegativeValuesError():r=u,this.totalMin=W(n.min)?rt.min(u,n.min):u,this.totalMax=W(n.max)?rt.max(l,n.max):l,e.logMin=h(p(r,s),vt),e.logMax=h(p(a,s),vt),o.max=a,o.min=r,o.minorUnit=n.minorUnit||h(s-1,vt),o},_autoMin:function(t,i,n){var e=t,o=n.majorUnit;return 0>=t?e=1>=i?rt.pow(o,-2):1:n.narrowRange||(e=rt.pow(o,rt.floor(p(t,o)))),e},_autoMax:function(t,i){var n,e=h(p(t,i),vt)%1;return n=0>=t?i:0!==e&&(.3>e||e>.9)?rt.pow(i,p(t,i)+.2):rt.pow(i,rt.ceil(p(t,i)))},pan:function(t){var i=this.translateRange(t);return this.limitRange(i.min,i.max,this.totalMin,this.totalMax,-t)},pointsRange:function(t,i){var n=this.getValue(t),e=this.getValue(i),o=rt.min(n,e),r=rt.max(n,e);return{min:o,max:r}},zoomRange:function(t){var n=this.options,e=this.scaleRange(t),o=this.totalMax,r=this.totalMin,a=H.limitValue(e.min,r,o),s=H.limitValue(e.max,r,o),l=n.majorUnit,u=s>a&&n.min&&n.max&&h(p(n.max,l)-p(n.min,l),vt)<1,c=!(n.min===r&&n.max===o)&&h(p(s,l)-p(a,l),vt)>=1;return u||c?{min:a,max:s}:i},_minorIntervalOptions:function(t){var i=this.options.majorUnit,n=rt.pow(i,t),e=rt.pow(i,t+1),o=e-n,r=o/this.options.minorUnit;return{value:n,minorStep:r}},_lineOptions:function(){var t=this,i=t.options,n=i.reverse,e=i.vertical,o=e?Gt:Dt,r=t.lineBox(),a=e===n?1:-1,s=1===a?1:2,l=e?r.height():r.width(),u=a*(l/(t.logMax-t.logMin)),c=r[o+s];return{step:u,lineStart:c,lineBox:r}}}),Y.Gradients={glass:{type:At,rotation:0,stops:[{offset:0,color:Ot,opacity:0},{offset:.25,color:Ot,opacity:.3},{offset:1,color:Ot,opacity:0}]},sharpBevel:{type:Bt,stops:[{offset:0,color:Ot,opacity:.55},{offset:.65,color:Ot,opacity:0},{offset:.95,color:Ot,opacity:.25}]},roundedBevel:{type:Bt,stops:[{offset:.33,color:Ot,opacity:.06},{offset:.83,color:Ot,opacity:.2},{offset:.95,color:Ot,opacity:0}]},roundedGlass:{type:Bt,supportVML:!1,stops:[{offset:0,color:Ot,opacity:0},{offset:.5,color:Ot,opacity:.3},{offset:.99,color:Ot,opacity:0}]},sharpGlass:{type:Bt,supportVML:!1,stops:[{offset:0,color:Ot,opacity:.2},{offset:.15,color:Ot,opacity:.15},{offset:.17,color:Ot,opacity:.35},{offset:.85,color:Ot,opacity:.05},{offset:.87,color:Ot,opacity:.15},{offset:.99,color:Ot,opacity:0}]}},G={extend:function(t,i){if(!t.exportVisual)throw Error("Mixin target has no exportVisual method defined.");t.exportSVG=this.exportSVG,t.exportImage=this.exportImage,t.exportPDF=this.exportPDF,i||(t.svg=this.svg,t.imageDataURL=this.imageDataURL)},exportSVG:function(t){return J.exportSVG(this.exportVisual(),t)},exportImage:function(t){return J.exportImage(this.exportVisual(t),t)},exportPDF:function(t){return J.exportPDF(this.exportVisual(),t)},svg:function(){if(J.svg.Surface)return J.svg._exportGroup(this.exportVisual());throw Error("SVG Export failed. Unable to export instantiate kendo.drawing.svg.Surface")},imageDataURL:function(){var i,n,e;if(!F.support.canvas)return null;if(J.canvas.Surface)return i=t("<div />").css({display:"none",width:this.element.width(),height:this.element.height()}).appendTo(document.body),n=new J.canvas.Surface(i),n.draw(this.exportVisual()),e=n._rootElement.toDataURL(),n.destroy(),i.remove(),e;throw Error("Image Export failed. Unable to export instantiate kendo.drawing.canvas.Surface")}},N=function(t){this.closed=t},N.prototype=N.fn={WEIGHT:.333,EXTREMUM_ALLOWED_DEVIATION:.01,process:function(t){var i,n,e,o,r,a,s,l,u,c,h=this,p=h.closed,f=t.slice(0),d=f.length,x=[];if(d>2&&(h.removeDuplicates(0,f),d=f.length),2>d||2==d&&f[0].equals(f[1]))return x;for(i=f[0],n=f[1],e=f[2],x.push(new J.Segment(i));i.equals(f[d-1]);)p=!0,f.pop(),d--;if(2==d)return s=h.tangent(i,n,Dt,Gt),q(x).controlOut(h.firstControlPoint(s,i,n,Dt,Gt)),x.push(new J.Segment(n,h.secondControlPoint(s,i,n,Dt,Gt))),x;for(p?(i=f[d-1],n=f[0],e=f[1],o=h.controlPoints(i,n,e),r=o[1],a=o[0]):(s=h.tangent(i,n,Dt,Gt),r=h.firstControlPoint(s,i,n,Dt,Gt)),l=r,u=0;d-3>=u;u++)h.removeDuplicates(u,f),d=f.length,d>=u+3&&(i=f[u],n=f[u+1],e=f[u+2],o=h.controlPoints(i,n,e),q(x).controlOut(l),l=o[1],c=o[0],x.push(new J.Segment(n,c)));return p?(i=f[d-2],n=f[d-1],e=f[0],o=h.controlPoints(i,n,e),q(x).controlOut(l),x.push(new J.Segment(n,o[0])),q(x).controlOut(o[1]),x.push(new J.Segment(e,a))):(s=h.tangent(n,e,Dt,Gt),q(x).controlOut(l),x.push(new J.Segment(e,h.secondControlPoint(s,n,e,Dt,Gt)))),x},removeDuplicates:function(t,i){for(;i[t].equals(i[t+1])||i[t+1].equals(i[t+2]);)i.splice(t+1,1)},invertAxis:function(t,i,n){var e,o,r=this,a=!1;return t.x===i.x?a=!0:i.x===n.x?(n.y>i.y&&i.y>=t.y||i.y>n.y&&t.y>=i.y)&&(a=!0):(e=r.lineFunction(t,i),o=r.calculateFunction(e,n.x),i.y>=t.y&&o>=n.y||t.y>=i.y&&n.y>=o||(a=!0)),a},isLine:function(t,i,n){var e=this,o=e.lineFunction(t,i),r=e.calculateFunction(o,n.x);return t.x==i.x&&i.x==n.x||h(r,1)===h(n.y,1)},lineFunction:function(t,i){var n=(i.y-t.y)/(i.x-t.x),e=t.y-n*t.x;return[e,n]},controlPoints:function(t,i,n){var e,o,r,a,s,l,u=this,c=Dt,h=Gt,p=!1,f=!1,d=u.EXTREMUM_ALLOWED_DEVIATION;return u.isLine(t,i,n)?e=u.tangent(t,i,Dt,Gt):(o={x:u.isMonotonicByField(t,i,n,Dt),y:u.isMonotonicByField(t,i,n,Gt)},o.x&&o.y?(e=u.tangent(t,n,Dt,Gt),p=!0):(u.invertAxis(t,i,n)&&(c=Gt,h=Dt),o[c]?e=0:(s=t[h]>n[h]&&i[h]>=t[h]||n[h]>t[h]&&t[h]>=i[h]?u.sign((n[h]-t[h])*(i[c]-t[c])):-u.sign((n[c]-t[c])*(i[h]-t[h])),e=d*s,f=!0))),a=u.secondControlPoint(e,t,i,c,h),f&&(l=c,c=h,h=l),r=u.firstControlPoint(e,i,n,c,h),p&&(u.restrictControlPoint(t,i,a,e),u.restrictControlPoint(i,n,r,e)),[a,r]},sign:function(t){return 0>=t?-1:1},restrictControlPoint:function(t,i,n,e){i.y>t.y?n.y>i.y?(n.x=t.x+(i.y-t.y)/e,n.y=i.y):t.y>n.y&&(n.x=i.x-(i.y-t.y)/e,n.y=t.y):i.y>n.y?(n.x=t.x-(t.y-i.y)/e,n.y=i.y):n.y>t.y&&(n.x=i.x+(t.y-i.y)/e,n.y=t.y)},tangent:function(t,i,n,e){var o,r=i[n]-t[n],a=i[e]-t[e];return o=0===r?0:a/r},isMonotonicByField:function(t,i,n,e){return n[e]>i[e]&&i[e]>t[e]||i[e]>n[e]&&t[e]>i[e]},firstControlPoint:function(t,i,n,e,o){var r=this,a=i[e],s=n[e],l=(s-a)*r.WEIGHT;return r.point(a+l,i[o]+l*t,e,o)},secondControlPoint:function(t,i,n,e,o){var r=this,a=i[e],s=n[e],l=(s-a)*r.WEIGHT;return r.point(s-l,n[o]-l*t,e,o)},point:function(t,i,n,e){var o=new Q.Point;return o[n]=t,o[e]=i,o},calculateFunction:function(t,i){var n,e=0,o=t.length;for(n=0;o>n;n++)e+=Math.pow(i,n)*t[n];return e}},b._element=document.createElement("span"),at(F.dataviz,{AXIS_LABEL_CLICK:st,COORD_PRECISION:ht,DEFAULT_PRECISION:vt,DEFAULT_WIDTH:yt,DEFAULT_HEIGHT:mt,DEFAULT_FONT:xt,INITIAL_ANIMATION_DURATION:_t,NOTE_CLICK:zt,NOTE_HOVER:Ct,CLIP:pt,Axis:j,AxisLabel:I,Box2D:_,BoxElement:V,ChartElement:P,CurveProcessor:N,ExportMixin:G,FloatElement:C,LogarithmicAxis:D,Note:E,NumericAxis:O,Point2D:Ft,Ring:M,RootElement:R,Sector:S,ShapeBuilder:A,ShapeElement:U,Text:z,TextBox:L,Title:B,alignPathToPixel:w,autoFormat:m,autoMajorUnit:r,boxDiff:s,dateComparer:v,decodeEntities:b,getSpacing:n,inArray:l,interpolateValue:d,mwDelta:y,rectToBox:k,rotatePoint:a,round:h,ceil:u,floor:c})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,i,n){(n||i)()});;!function(o,define){define("util/main.min",["kendo.core.min"],o)}(function(){return function(){function o(o){return typeof o!==S}function e(o,e){var l=r(e);return M.round(o*l)/l}function r(o){return o?M.pow(10,o):1}function l(o,e,r){return M.max(M.min(o,r),e)}function c(o){return o*W}function a(o){return o/W}function t(o){return"number"==typeof o&&!isNaN(o)}function n(e,r){return o(e)?e:r}function i(o){return o*o}function f(o){var e,r=[];for(e in o)r.push(e+o[e]);return r.sort().join("")}function s(o){var e,r=2166136261;for(e=0;o.length>e;++e)r+=(r<<1)+(r<<4)+(r<<7)+(r<<8)+(r<<24),r^=o.charCodeAt(e);return r>>>0}function d(o){return s(f(o))}function b(o){var e,r=o.length,l=I,c=N;for(e=0;r>e;e++)c=M.max(c,o[e]),l=M.min(l,o[e]);return{min:l,max:c}}function u(o){return b(o).min}function h(o){return b(o).max}function k(o){return m(o).min}function g(o){return m(o).max}function m(o){var e,r,l,c=I,a=N;for(e=0,r=o.length;r>e;e++)l=o[e],null!==l&&isFinite(l)&&(c=M.min(c,l),a=M.max(a,l));return{min:c===I?void 0:c,max:a===N?void 0:a}}function p(o){return o?o[o.length-1]:void 0}function v(o,e){return o.push.apply(o,e),o}function w(o){return G.template(o,{useWithBlock:!1,paramName:"d"})}function C(e,r){return o(r)&&null!==r?" "+e+"='"+r+"' ":""}function y(o){var e,r="";for(e=0;o.length>e;e++)r+=C(o[e][0],o[e][1]);return r}function D(e){var r,l,c="";for(r=0;e.length>r;r++)l=e[r][1],o(l)&&(c+=e[r][0]+":"+l+";");return""!==c?c:void 0}function B(o){return"string"!=typeof o&&(o+="px"),o}function x(o){var e,r,l=[];if(o)for(e=G.toHyphens(o).split("-"),r=0;e.length>r;r++)l.push("k-pos-"+e[r]);return l.join(" ")}function _(e){return""===e||null===e||"none"===e||"transparent"===e||!o(e)}function A(o){for(var e={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},r=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],l="";o>0;)r[0]>o?r.shift():(l+=e[r[0]],o-=r[0]);return l}function L(o){var e,r,l,c,a;for(o=o.toLowerCase(),e={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},r=0,l=0,c=0;o.length>c;++c){if(a=e[o.charAt(c)],!a)return null;r+=a,a>l&&(r-=2*l),l=a}return r}function z(o){var e=Object.create(null);return function(){var r,l="";for(r=arguments.length;--r>=0;)l+=":"+arguments[r];return l in e?e[l]:o.apply(this,arguments)}}function T(o){for(var e,r,l=[],c=0,a=o.length;a>c;)e=o.charCodeAt(c++),e>=55296&&56319>=e&&a>c?(r=o.charCodeAt(c++),56320==(64512&r)?l.push(((1023&e)<<10)+(1023&r)+65536):(l.push(e),c--)):l.push(e);return l}function j(o){return o.map(function(o){var e="";return o>65535&&(o-=65536,e+=String.fromCharCode(o>>>10&1023|55296),o=56320|1023&o),e+=String.fromCharCode(o)}).join("")}var M=Math,G=window.kendo,P=G.deepExtend,W=M.PI/180,I=Number.MAX_VALUE,N=-Number.MAX_VALUE,S="undefined",O=Date.now;O||(O=function(){return(new Date).getTime()}),P(G,{util:{MAX_NUM:I,MIN_NUM:N,append:v,arrayLimits:b,arrayMin:u,arrayMax:h,defined:o,deg:a,hashKey:s,hashObject:d,isNumber:t,isTransparent:_,last:p,limitValue:l,now:O,objectKey:f,round:e,rad:c,renderAttr:C,renderAllAttr:y,renderPos:x,renderSize:B,renderStyle:D,renderTemplate:w,sparseArrayLimits:m,sparseArrayMin:k,sparseArrayMax:g,sqr:i,valueOrDefault:n,romanToArabic:L,arabicToRoman:A,memoize:z,ucs2encode:j,ucs2decode:T}}),G.drawing.util=G.util,G.dataviz.util=G.util}(),window.kendo},"function"==typeof define&&define.amd?define:function(o,e,r){(r||e)()}),function(o,define){define("util/text-metrics.min",["kendo.core.min","util/main.min"],o)}(function(){!function(o){function e(){return{width:0,height:0,baseline:0}}function r(o,e,r){return d.current.measure(o,e,r)}function l(o,e){var r=[];if(o.length>0&&document.fonts){try{r=o.map(function(o){return document.fonts.load(o)})}catch(l){a.logToConsole(l)}Promise.all(r).then(e,e)}else e()}var c=document,a=window.kendo,t=a.Class,n=a.util,i=n.defined,f=t.extend({init:function(o){this._size=o,this._length=0,this._map={}},put:function(o,e){var r=this,l=r._map,c={key:o,value:e};l[o]=c,r._head?(r._tail.newer=c,c.older=r._tail,r._tail=c):r._head=r._tail=c,r._length>=r._size?(l[r._head.key]=null,r._head=r._head.newer,r._head.older=null):r._length++},get:function(o){var e=this,r=e._map[o];return r?(r===e._head&&r!==e._tail&&(e._head=r.newer,e._head.older=null),r!==e._tail&&(r.older&&(r.older.newer=r.newer,r.newer.older=r.older),r.older=e._tail,r.newer=null,e._tail.newer=r,e._tail=r),r.value):void 0}}),s=o("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: nowrap!important;' />")[0],d=t.extend({init:function(o){this._cache=new f(1e3),this._initOptions(o)},options:{baselineMarkerSize:1},measure:function(r,l,a){var t,f,d,b,u,h,k,g;if(!r)return e();if(t=n.objectKey(l),f=n.hashKey(r+t),d=this._cache.get(f),d)return d;b=e(),u=a?a:s,h=this._baselineMarker().cloneNode(!1);for(k in l)g=l[k],i(g)&&(u.style[k]=g);return o(u).text(r),u.appendChild(h),c.body.appendChild(u),(r+"").length&&(b.width=u.offsetWidth-this.options.baselineMarkerSize,b.height=u.offsetHeight,b.baseline=h.offsetTop+this.options.baselineMarkerSize),b.width>0&&b.height>0&&this._cache.put(f,b),u.parentNode.removeChild(u),b},_baselineMarker:function(){return o("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;' />")[0]}});d.current=new d,a.util.TextMetrics=d,a.util.LRUCache=f,a.util.loadFonts=l,a.util.measureText=r}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(o,e,r){(r||e)()}),function(o,define){define("util/base64.min",["util/main.min"],o)}(function(){return function(){function o(o){var r,l,c,t,n,i,f,s="",d=0;for(o=e(o);o.length>d;)r=o.charCodeAt(d++),l=o.charCodeAt(d++),c=o.charCodeAt(d++),t=r>>2,n=(3&r)<<4|l>>4,i=(15&l)<<2|c>>6,f=63&c,isNaN(l)?i=f=64:isNaN(c)&&(f=64),s=s+a.charAt(t)+a.charAt(n)+a.charAt(i)+a.charAt(f);return s}function e(o){var e,r,l="";for(e=0;o.length>e;e++)r=o.charCodeAt(e),128>r?l+=c(r):2048>r?(l+=c(192|r>>>6),l+=c(128|63&r)):65536>r&&(l+=c(224|r>>>12),l+=c(128|r>>>6&63),l+=c(128|63&r));return l}var r=window.kendo,l=r.deepExtend,c=String.fromCharCode,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";l(r.util,{encodeBase64:o,encodeUTF8:e})}(),window.kendo},"function"==typeof define&&define.amd?define:function(o,e,r){(r||e)()}),function(o,define){define("mixins/observers.min",["kendo.core.min"],o)}(function(){return function(o){var e=Math,r=window.kendo,l=r.deepExtend,c=o.inArray,a={observers:function(){return this._observers=this._observers||[]},addObserver:function(o){return this._observers?this._observers.push(o):this._observers=[o],this},removeObserver:function(o){var e=this.observers(),r=c(o,e);return-1!=r&&e.splice(r,1),this},trigger:function(o,e){var r,l,c=this._observers;if(c&&!this._suspended)for(l=0;c.length>l;l++)r=c[l],r[o]&&r[o](e);return this},optionsChange:function(o){this.trigger("optionsChange",o)},geometryChange:function(o){this.trigger("geometryChange",o)},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=e.max((this._suspended||0)-1,0),this},_observerField:function(o,e){this[o]&&this[o].removeObserver(this),this[o]=e,e.addObserver(this)}};l(r,{mixins:{ObserversMixin:a}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(o,e,r){(r||e)()}),function(o,define){define("kendo.dataviz.themes.min",["kendo.dataviz.core.min"],o)}(function(){return function(o){function e(e,r){return o.map(e,function(o,e){return[[o,r[e]]]})}var r=window.kendo,l=r.dataviz.ui,c=r.deepExtend,a=1.5,t=.4,n="#000",i="Arial,Helvetica,sans-serif",f="11px "+i,s="12px "+i,d="16px "+i,b="#fff",u={title:{font:d},legend:{labels:{font:s}},seriesDefaults:{visible:!0,labels:{font:f},donut:{margin:1},line:{width:2},vericalLine:{width:2},scatterLine:{width:1},area:{opacity:.4,markers:{visible:!1,size:6},highlight:{markers:{border:{color:"#fff",opacity:1,width:1}}},line:{opacity:1,width:0}},verticalArea:{opacity:.4,markers:{visible:!1,size:6},line:{opacity:1,width:0}},radarLine:{width:2,markers:{visible:!1}},radarArea:{opacity:.5,markers:{visible:!1,size:6},line:{opacity:1,width:0}},candlestick:{line:{width:1,color:n},border:{width:1,_brightness:.8},gap:1,spacing:.3,downColor:b,highlight:{line:{width:2},border:{width:2,opacity:1}}},ohlc:{line:{width:1},gap:1,spacing:.3,highlight:{line:{width:3,opacity:1}}},bubble:{opacity:.6,border:{width:0},labels:{background:"transparent"}},bar:{gap:a,spacing:t},column:{gap:a,spacing:t},rangeColumn:{gap:a,spacing:t},rangeBar:{gap:a,spacing:t},waterfall:{gap:.5,spacing:t,line:{width:1,color:n}},horizontalWaterfall:{gap:.5,spacing:t,line:{width:1,color:n}},bullet:{gap:a,spacing:t,target:{color:"#ff0000"}},verticalBullet:{gap:a,spacing:t,target:{color:"#ff0000"}},boxPlot:{outliersField:"",meanField:"",whiskers:{width:1,color:n},mean:{width:1,color:n},median:{width:1,color:n},border:{width:1,_brightness:.8},gap:1,spacing:.3,downColor:b,highlight:{whiskers:{width:2},border:{width:2,opacity:1}}},funnel:{labels:{color:"",background:""}},notes:{icon:{border:{width:1}},label:{padding:3,font:s},line:{length:10,width:1},visible:!0}},categoryAxis:{majorGridLines:{visible:!0}},axisDefaults:{labels:{font:s},title:{font:d,margin:5},crosshair:{tooltip:{font:s}},notes:{icon:{size:7,border:{width:1}},label:{padding:3,font:s},line:{length:10,width:1},visible:!0}},tooltip:{font:s},navigator:{pane:{height:90,margin:{top:10}}}},h={scale:{labels:{font:s}}},k={shapeDefaults:{hover:{opacity:.2},stroke:{width:0}},editable:{resize:{handles:{width:7,height:7}}},selectable:{stroke:{width:1,dashType:"dot"}},connectionDefaults:{stroke:{width:2},selection:{handles:{width:8,height:8}},editable:{tools:["edit","delete"]}}},g=l.themes,m=l.registerTheme=function(o,e){var r,l={};l.chart=c({},u,e.chart),l.gauge=c({},h,e.gauge),l.diagram=c({},k,e.diagram),l.treeMap=c({},e.treeMap),r=l.chart.seriesDefaults,r.verticalLine=c({},r.line),r.verticalArea=c({},r.area),r.polarArea=c({},r.radarArea),r.polarLine=c({},r.radarLine),g[o]=l};m("black",{chart:{title:{color:b},legend:{labels:{color:b},inactiveItems:{labels:{color:"#919191"},markers:{color:"#919191"}}},seriesDefaults:{labels:{color:b},errorBars:{color:b},notes:{icon:{background:"#3b3b3b",border:{color:"#8e8e8e"}},label:{color:b},line:{color:"#8e8e8e"}},pie:{overlay:{gradient:"sharpBevel"}},donut:{overlay:{gradient:"sharpGlass"}},line:{markers:{background:"#3d3d3d"}},scatter:{markers:{background:"#3d3d3d"}},scatterLine:{markers:{background:"#3d3d3d"}},waterfall:{line:{color:"#8e8e8e"}},horizontalWaterfall:{line:{color:"#8e8e8e"}},candlestick:{downColor:"#555",line:{color:b},border:{_brightness:1.5,opacity:1},highlight:{border:{color:b,opacity:.2}}},ohlc:{line:{color:b}}},chartArea:{background:"#3d3d3d"},seriesColors:["#0081da","#3aafff","#99c900","#ffeb3d","#b20753","#ff4195"],axisDefaults:{line:{color:"#8e8e8e"},labels:{color:b},majorGridLines:{color:"#545454"},minorGridLines:{color:"#454545"},title:{color:b},crosshair:{color:"#8e8e8e"},notes:{icon:{background:"#3b3b3b",border:{color:"#8e8e8e"}},label:{color:b},line:{color:"#8e8e8e"}}}},gauge:{pointer:{color:"#0070e4"},scale:{rangePlaceholderColor:"#1d1d1d",labels:{color:b},minorTicks:{color:b},majorTicks:{color:b},line:{color:b}}},diagram:{shapeDefaults:{fill:{color:"#0066cc"},connectorDefaults:{fill:{color:b},stroke:{color:"#384049"},hover:{fill:{color:"#3d3d3d"},stroke:{color:"#efefef"}}},content:{color:b}},editable:{resize:{handles:{fill:{color:"#3d3d3d"},stroke:{color:b},hover:{fill:{color:b},stroke:{color:b}}}},rotate:{thumb:{stroke:{color:b},fill:{color:b}}}},selectable:{stroke:{color:b}},connectionDefaults:{stroke:{color:b},content:{color:b},selection:{handles:{fill:{color:"#3d3d3d"},stroke:{color:"#efefef"}}}}},treeMap:{colors:[["#0081da","#314b5c"],["#3aafff","#3c5464"],["#99c900","#4f5931"],["#ffeb3d","#64603d"],["#b20753","#543241"],["#ff4195","#643e4f"]]}}),m("blueopal",{chart:{title:{color:"#293135"},legend:{labels:{color:"#293135"},inactiveItems:{labels:{color:"#27A5BA"},markers:{color:"#27A5BA"}}},seriesDefaults:{labels:{color:n,background:b,opacity:.5},errorBars:{color:"#293135"},candlestick:{downColor:"#c4d0d5",line:{color:"#9aabb2"}},waterfall:{line:{color:"#9aabb2"}},horizontalWaterfall:{line:{color:"#9aabb2"}},notes:{icon:{background:"transparent",border:{color:"#9aabb2"}},label:{color:"#293135"},line:{color:"#9aabb2"}}},seriesColors:["#0069a5","#0098ee","#7bd2f6","#ffb800","#ff8517","#e34a00"],axisDefaults:{line:{color:"#9aabb2"},labels:{color:"#293135"},majorGridLines:{color:"#c4d0d5"},minorGridLines:{color:"#edf1f2"},title:{color:"#293135"},crosshair:{color:"#9aabb2"},notes:{icon:{background:"transparent",border:{color:"#9aabb2"}},label:{color:"#293135"},line:{color:"#9aabb2"}}}},gauge:{pointer:{color:"#005c83"},scale:{rangePlaceholderColor:"#daecf4",labels:{color:"#293135"},minorTicks:{color:"#293135"},majorTicks:{color:"#293135"},line:{color:"#293135"}}},diagram:{shapeDefaults:{fill:{color:"#7ec6e3"},connectorDefaults:{fill:{color:"#003f59"},stroke:{color:b},hover:{fill:{color:b},stroke:{color:"#003f59"}}},content:{color:"#293135"}},editable:{resize:{handles:{fill:{color:b},stroke:{color:"#003f59"},hover:{fill:{color:"#003f59"},stroke:{color:"#003f59"}}}},rotate:{thumb:{stroke:{color:"#003f59"},fill:{color:"#003f59"}}}},selectable:{stroke:{color:"#003f59"}},connectionDefaults:{stroke:{color:"#003f59"},content:{color:"#293135"},selection:{handles:{fill:{color:"#3d3d3d"},stroke:{color:"#efefef"}}}}},treeMap:{colors:[["#0069a5","#bad7e7"],["#0098ee","#b9e0f5"],["#7bd2f6","#ceeaf6"],["#ffb800","#e6e3c4"],["#ff8517","#e4d8c8"],["#e34a00","#ddccc2"]]}}),m("highcontrast",{chart:{title:{color:"#ffffff"},legend:{labels:{color:"#ffffff"},inactiveItems:{labels:{color:"#66465B"},markers:{color:"#66465B"}}},seriesDefaults:{labels:{color:"#ffffff"},errorBars:{color:"#ffffff"},notes:{icon:{background:"transparent",border:{color:"#ffffff"}},label:{color:"#ffffff"},line:{color:"#ffffff"}},pie:{overlay:{gradient:"sharpGlass"}},donut:{overlay:{gradient:"sharpGlass"}},line:{markers:{background:"#2c232b"}},scatter:{markers:{background:"#2c232b"}},scatterLine:{markers:{background:"#2c232b"}},area:{opacity:.5},waterfall:{line:{color:"#ffffff"}},horizontalWaterfall:{line:{color:"#ffffff"}},candlestick:{downColor:"#664e62",line:{color:"#ffffff"},border:{_brightness:1.5,opacity:1},highlight:{border:{color:"#ffffff",opacity:1}}},ohlc:{line:{color:"#ffffff"}}},chartArea:{background:"#2c232b"},seriesColors:["#a7008f","#ffb800","#3aafff","#99c900","#b20753","#ff4195"],axisDefaults:{line:{color:"#ffffff"},labels:{color:"#ffffff"},majorGridLines:{color:"#664e62"},minorGridLines:{color:"#4f394b"},title:{color:"#ffffff"},crosshair:{color:"#ffffff"},notes:{icon:{background:"transparent",border:{color:"#ffffff"}},label:{color:"#ffffff"},line:{color:"#ffffff"}}}},gauge:{pointer:{color:"#a7008f"},scale:{rangePlaceholderColor:"#2c232b",labels:{color:"#ffffff"},minorTicks:{color:"#2c232b"},majorTicks:{color:"#664e62"},line:{color:"#ffffff"}}},diagram:{shapeDefaults:{fill:{color:"#a7018f"},connectorDefaults:{fill:{color:b},stroke:{color:"#2c232b"},hover:{fill:{color:"#2c232b"},stroke:{color:b}}},content:{color:b}},editable:{resize:{handles:{fill:{color:"#2c232b"},stroke:{color:b},hover:{fill:{color:b},stroke:{color:b}}}},rotate:{thumb:{stroke:{color:b},fill:{color:b}}}},selectable:{stroke:{color:b}},connectionDefaults:{stroke:{color:b},content:{color:b},selection:{handles:{fill:{color:"#2c232b"},stroke:{color:b}}}}},treeMap:{colors:[["#a7008f","#451c3f"],["#ffb800","#564122"],["#3aafff","#2f3f55"],["#99c900","#424422"],["#b20753","#471d33"],["#ff4195","#562940"]]}}),m("default",{chart:{title:{color:"#8e8e8e"},legend:{labels:{color:"#232323"},inactiveItems:{labels:{color:"#919191"},markers:{color:"#919191"}}},seriesDefaults:{labels:{color:n,background:b,opacity:.5},errorBars:{color:"#232323"},candlestick:{downColor:"#dedede",line:{color:"#8d8d8d"}},waterfall:{line:{color:"#8e8e8e"}},horizontalWaterfall:{line:{color:"#8e8e8e"}},notes:{icon:{background:"transparent",border:{color:"#8e8e8e"}},label:{color:"#232323"},line:{color:"#8e8e8e"}}},seriesColors:["#ff6800","#a0a700","#ff8d00","#678900","#ffb53c","#396000"],axisDefaults:{line:{color:"#8e8e8e"},labels:{color:"#232323"},minorGridLines:{color:"#f0f0f0"},majorGridLines:{color:"#dfdfdf"},title:{color:"#232323"},crosshair:{color:"#8e8e8e"},notes:{icon:{background:"transparent",border:{color:"#8e8e8e"}},label:{color:"#232323"},line:{color:"#8e8e8e"}}}},gauge:{pointer:{color:"#ea7001"},scale:{rangePlaceholderColor:"#dedede",labels:{color:"#2e2e2e"},minorTicks:{color:"#2e2e2e"},majorTicks:{color:"#2e2e2e"},line:{color:"#2e2e2e"}}},diagram:{shapeDefaults:{fill:{color:"#e15613"},connectorDefaults:{fill:{color:"#282828"},stroke:{color:b},hover:{fill:{color:b},stroke:{color:"#282828"}}},content:{color:"#2e2e2e"}},editable:{resize:{handles:{fill:{color:b},stroke:{color:"#282828"},hover:{fill:{color:"#282828"},stroke:{color:"#282828"}}}},rotate:{thumb:{stroke:{color:"#282828"},fill:{color:"#282828"}}}},selectable:{stroke:{color:"#a7018f"}},connectionDefaults:{stroke:{color:"#282828"},content:{color:"#2e2e2e"},selection:{handles:{fill:{color:b},stroke:{color:"#282828"}}}}},treeMap:{colors:[["#ff6800","#edcfba"],["#a0a700","#dadcba"],["#ff8d00","#edd7ba"],["#678900","#cfd6ba"],["#ffb53c","#eddfc6"],["#396000","#c6ceba"]]}}),m("silver",{chart:{title:{color:"#4e5968"},legend:{labels:{color:"#4e5968"},inactiveItems:{labels:{color:"#B1BCC8"},markers:{color:"#B1BCC8"}}},seriesDefaults:{labels:{color:"#293135",background:"#eaeaec",opacity:.5},errorBars:{color:"#4e5968"},notes:{icon:{background:"transparent",border:{color:"#4e5968"}},label:{color:"#4e5968"},line:{color:"#4e5968"}},line:{markers:{background:"#eaeaec"}},scatter:{markers:{background:"#eaeaec"}},scatterLine:{markers:{background:"#eaeaec"}},pie:{connectors:{color:"#A6B1C0"}},donut:{connectors:{color:"#A6B1C0"}},waterfall:{line:{color:"#a6b1c0"}},horizontalWaterfall:{line:{color:"#a6b1c0"}},candlestick:{downColor:"#a6afbe"}},chartArea:{background:"#eaeaec"},seriesColors:["#007bc3","#76b800","#ffae00","#ef4c00","#a419b7","#430B62"],axisDefaults:{line:{color:"#a6b1c0"},labels:{color:"#4e5968"},majorGridLines:{color:"#dcdcdf"},minorGridLines:{color:"#eeeeef"},title:{color:"#4e5968"},crosshair:{color:"#a6b1c0"},notes:{icon:{background:"transparent",border:{color:"#4e5968"}},label:{color:"#4e5968"},line:{color:"#4e5968"}}}},gauge:{pointer:{color:"#0879c0"},scale:{rangePlaceholderColor:"#f3f3f4",labels:{color:"#515967"},minorTicks:{color:"#515967"},majorTicks:{color:"#515967"},line:{color:"#515967"}}},diagram:{shapeDefaults:{fill:{color:"#1c82c2"},connectorDefaults:{fill:{color:"#515967"},stroke:{color:b},hover:{fill:{color:b},stroke:{color:"#282828"}}},content:{color:"#515967"}},editable:{resize:{handles:{fill:{color:b},stroke:{color:"#515967"},hover:{fill:{color:"#515967"},stroke:{color:"#515967"}}}},rotate:{thumb:{stroke:{color:"#515967"},fill:{color:"#515967"}}}},selectable:{stroke:{color:"#515967"}},connectionDefaults:{stroke:{color:"#515967"},content:{color:"#515967"},selection:{handles:{fill:{color:b},stroke:{color:"#515967"}}}}},treeMap:{colors:[["#007bc3","#c2dbea"],["#76b800","#dae7c3"],["#ffae00","#f5e5c3"],["#ef4c00","#f2d2c3"],["#a419b7","#e3c7e8"],["#430b62","#d0c5d7"]]}}),m("metro",{chart:{title:{color:"#777777"},legend:{labels:{color:"#777777"},inactiveItems:{labels:{color:"#CBCBCB"},markers:{color:"#CBCBCB"}}},seriesDefaults:{labels:{color:n},errorBars:{color:"#777777"},notes:{icon:{background:"transparent",border:{color:"#777777"}},label:{color:"#777777"},line:{color:"#777777"}},candlestick:{downColor:"#c7c7c7",line:{color:"#787878"}},waterfall:{line:{color:"#c7c7c7"}},horizontalWaterfall:{line:{color:"#c7c7c7"}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:["#8ebc00","#309b46","#25a0da","#ff6900","#e61e26","#d8e404","#16aba9","#7e51a1","#313131","#ed1691"],axisDefaults:{line:{color:"#c7c7c7"},labels:{color:"#777777"},minorGridLines:{color:"#c7c7c7"},majorGridLines:{color:"#c7c7c7"},title:{color:"#777777"},crosshair:{color:"#c7c7c7"},notes:{icon:{background:"transparent",border:{color:"#777777"}},label:{color:"#777777"},line:{color:"#777777"}}}},gauge:{pointer:{color:"#8ebc00"},scale:{rangePlaceholderColor:"#e6e6e6",labels:{color:"#777"},minorTicks:{color:"#777"},majorTicks:{color:"#777"},line:{color:"#777"}}},diagram:{shapeDefaults:{fill:{color:"#8ebc00"},connectorDefaults:{fill:{color:n},stroke:{color:b},hover:{fill:{color:b},stroke:{color:n}}},content:{color:"#777"}},editable:{resize:{handles:{fill:{color:b},stroke:{color:"#787878"},hover:{fill:{color:"#787878"},stroke:{color:"#787878"}}}},rotate:{thumb:{stroke:{color:"#787878"},fill:{color:"#787878"}}}},selectable:{stroke:{color:"#515967"}},connectionDefaults:{stroke:{color:"#787878"},content:{color:"#777"},selection:{handles:{fill:{color:b},stroke:{color:"#787878"}}}}},treeMap:{colors:[["#8ebc00","#e8f2cc"],["#309b46","#d6ebda"],["#25a0da","#d3ecf8"],["#ff6900","#ffe1cc"],["#e61e26","#fad2d4"],["#d8e404","#f7facd"],["#16aba9","#d0eeee"],["#7e51a1","#e5dcec"],["#313131","#d6d6d6"],["#ed1691","#fbd0e9"]]}}),m("metroblack",{chart:{title:{color:"#ffffff"},legend:{labels:{color:"#ffffff"},inactiveItems:{labels:{color:"#797979"},markers:{color:"#797979"}}},seriesDefaults:{border:{_brightness:1},labels:{color:"#ffffff"},errorBars:{color:"#ffffff"},notes:{icon:{background:"transparent",border:{color:"#cecece"}},label:{color:"#ffffff"},line:{color:"#cecece"}},line:{markers:{background:"#0e0e0e"}},bubble:{opacity:.6},scatter:{markers:{background:"#0e0e0e"}},scatterLine:{markers:{background:"#0e0e0e"}},candlestick:{downColor:"#828282",line:{color:"#ffffff"}},waterfall:{line:{color:"#cecece"}},horizontalWaterfall:{line:{color:"#cecece"}},overlay:{gradient:"none"}},chartArea:{background:"#0e0e0e"},seriesColors:["#00aba9","#309b46","#8ebc00","#ff6900","#e61e26","#d8e404","#25a0da","#7e51a1","#313131","#ed1691"],axisDefaults:{line:{color:"#cecece"},labels:{color:"#ffffff"},minorGridLines:{color:"#2d2d2d"},majorGridLines:{color:"#333333"},title:{color:"#ffffff"},crosshair:{color:"#cecece"},notes:{icon:{background:"transparent",border:{color:"#cecece"}},label:{color:"#ffffff"},line:{color:"#cecece"}}}},gauge:{pointer:{color:"#00aba9"},scale:{rangePlaceholderColor:"#2d2d2d",labels:{color:"#ffffff"},minorTicks:{color:"#333333"},majorTicks:{color:"#cecece"},line:{color:"#cecece"}}},diagram:{shapeDefaults:{fill:{color:"#00aba9"},connectorDefaults:{fill:{color:b},stroke:{color:"#0e0e0e"},hover:{fill:{color:"#0e0e0e"},stroke:{color:b}}},content:{color:b}},editable:{resize:{handles:{fill:{color:"#0e0e0e"},stroke:{color:"#787878"},hover:{fill:{color:"#787878"},stroke:{color:"#787878"}}}},rotate:{thumb:{stroke:{color:b},fill:{color:b}}}},selectable:{stroke:{color:"#787878"}},connectionDefaults:{stroke:{color:b},content:{color:b},selection:{handles:{fill:{color:"#0e0e0e"},stroke:{color:b}}}}},treeMap:{colors:[["#00aba9","#0b2d2d"],["#309b46","#152a19"],["#8ebc00","#28310b"],["#ff6900","#3e200b"],["#e61e26","#391113"],["#d8e404","#36390c"],["#25a0da","#132b37"],["#7e51a1","#241b2b"],["#313131","#151515"],["#ed1691","#3b1028"]]}}),m("moonlight",{chart:{title:{color:"#ffffff"},legend:{labels:{color:"#ffffff"},inactiveItems:{labels:{color:"#A1A7AB"},markers:{color:"#A1A7AB"}}},seriesDefaults:{labels:{color:"#ffffff"},errorBars:{color:"#ffffff"},notes:{icon:{background:"transparent",border:{color:"#8c909e"}},label:{color:"#ffffff"},line:{color:"#8c909e"}},pie:{overlay:{gradient:"sharpBevel"}},donut:{overlay:{gradient:"sharpGlass"}},line:{markers:{background:"#212a33"}},bubble:{opacity:.6},scatter:{markers:{background:"#212a33"}},scatterLine:{markers:{background:"#212a33"}},area:{opacity:.3},candlestick:{downColor:"#757d87",line:{color:"#ea9d06"},border:{_brightness:1.5,opacity:1},highlight:{border:{color:b,opacity:.2}}},waterfall:{line:{color:"#8c909e"}},horizontalWaterfall:{line:{color:"#8c909e"}},ohlc:{line:{color:"#ea9d06"}}},chartArea:{background:"#212a33"},seriesColors:["#ffca08","#ff710f","#ed2e24","#ff9f03","#e13c02","#a00201"],axisDefaults:{line:{color:"#8c909e"},minorTicks:{color:"#8c909e"},majorTicks:{color:"#8c909e"},labels:{color:"#ffffff"},majorGridLines:{color:"#3e424d"},minorGridLines:{color:"#2f3640"},title:{color:"#ffffff"},crosshair:{color:"#8c909e"},notes:{icon:{background:"transparent",border:{color:"#8c909e"}},label:{color:"#ffffff"},line:{color:"#8c909e"}}}},gauge:{pointer:{color:"#f4af03"},scale:{rangePlaceholderColor:"#2f3640",labels:{color:b},minorTicks:{color:"#8c909e"},majorTicks:{color:"#8c909e"},line:{color:"#8c909e"}}},diagram:{shapeDefaults:{fill:{color:"#f3ae03"},connectorDefaults:{fill:{color:b},stroke:{color:"#414550"},hover:{fill:{color:"#414550"},stroke:{color:b}}},content:{color:b}},editable:{resize:{handles:{fill:{color:"#414550"},stroke:{color:b},hover:{fill:{color:b},stroke:{color:b}}}},rotate:{thumb:{stroke:{color:b},fill:{color:b}}}},selectable:{stroke:{color:b}},connectionDefaults:{stroke:{color:b},content:{color:b},selection:{handles:{fill:{color:"#414550"},stroke:{color:b}}}}},treeMap:{colors:[["#ffca08","#4e4b2b"],["#ff710f","#4e392d"],["#ed2e24","#4b2c31"],["#ff9f03","#4e422a"],["#e13c02","#482e2a"],["#a00201","#3b232a"]]}}),m("uniform",{chart:{title:{color:"#686868"},legend:{labels:{color:"#686868"},inactiveItems:{labels:{color:"#B6B6B6"},markers:{color:"#B6B6B6"}}},seriesDefaults:{labels:{color:"#686868"},errorBars:{color:"#686868"},notes:{icon:{background:"transparent",border:{color:"#9e9e9e"}},label:{color:"#686868"},line:{color:"#9e9e9e"}},pie:{overlay:{gradient:"sharpBevel"}},donut:{overlay:{gradient:"sharpGlass"}},line:{markers:{background:"#ffffff"}},bubble:{opacity:.6},scatter:{markers:{background:"#ffffff"}},scatterLine:{markers:{background:"#ffffff"}},area:{opacity:.3},candlestick:{downColor:"#cccccc",line:{color:"#cccccc"},border:{_brightness:1.5,opacity:1},highlight:{border:{color:"#cccccc",opacity:.2}}},waterfall:{line:{color:"#9e9e9e"}},horizontalWaterfall:{line:{color:"#9e9e9e"}},ohlc:{line:{color:"#cccccc"}}},chartArea:{background:"#ffffff"},seriesColors:["#527aa3","#6f91b3","#8ca7c2","#a8bdd1","#c5d3e0","#e2e9f0"],axisDefaults:{line:{color:"#9e9e9e"},minorTicks:{color:"#aaaaaa"},majorTicks:{color:"#888888"},labels:{color:"#686868"},majorGridLines:{color:"#dadada"},minorGridLines:{color:"#e7e7e7"},title:{color:"#686868"},crosshair:{color:"#9e9e9e"},notes:{icon:{background:"transparent",border:{color:"#9e9e9e"}},label:{color:"#686868"},line:{color:"#9e9e9e"}}}},gauge:{pointer:{color:"#527aa3"},scale:{rangePlaceholderColor:"#e7e7e7",labels:{color:"#686868"},minorTicks:{color:"#aaaaaa"},majorTicks:{color:"#888888"},line:{color:"#9e9e9e"}}},diagram:{shapeDefaults:{fill:{color:"#d1d1d1"},connectorDefaults:{fill:{color:"#686868"},stroke:{color:b},hover:{fill:{color:b},stroke:{color:"#686868"}}},content:{color:"#686868"}},editable:{resize:{handles:{fill:{color:b},stroke:{color:"#686868"},hover:{fill:{color:"#686868"},stroke:{color:"#686868"}}}},rotate:{thumb:{stroke:{color:"#686868"},fill:{color:"#686868"}}}},selectable:{stroke:{color:"#686868"}},connectionDefaults:{stroke:{color:"#686868"},content:{color:"#686868"},selection:{handles:{fill:{color:b},stroke:{color:"#686868"}}}}},treeMap:{colors:[["#527aa3","#d0d8e1"],["#6f91b3","#d6dde4"],["#8ca7c2","#dce1e7"],["#a8bdd1","#e2e6ea"],["#c5d3e0","#e7eaed"],["#e2e9f0","#edeff0"]]}}),m("bootstrap",{chart:{title:{color:"#333333"},legend:{labels:{color:"#333333"},inactiveItems:{labels:{color:"#999999"},markers:{color:"#9A9A9A"}}},seriesDefaults:{labels:{color:"#333333"},overlay:{gradient:"none"},errorBars:{color:"#343434"},notes:{icon:{background:"#000000",border:{color:"#000000"}},label:{color:"#333333"},line:{color:"#000000"}},pie:{overlay:{gradient:"none"}},donut:{overlay:{gradient:"none"}},line:{markers:{background:"#ffffff"}},bubble:{opacity:.6},scatter:{markers:{background:"#ffffff"}},scatterLine:{markers:{background:"#ffffff"}},area:{opacity:.8},candlestick:{downColor:"#d0d0d0",line:{color:"#333333"},border:{_brightness:1.5,opacity:1},highlight:{border:{color:"#b8b8b8",opacity:.2}}},waterfall:{line:{color:"#cccccc"}},horizontalWaterfall:{line:{color:"#cccccc"}},ohlc:{line:{color:"#333333"}}},chartArea:{background:"#ffffff"},seriesColors:["#428bca","#5bc0de","#5cb85c","#f2b661","#e67d4a","#da3b36"],axisDefaults:{line:{color:"#cccccc"},minorTicks:{color:"#ebebeb"},majorTicks:{color:"#cccccc"},labels:{color:"#333333"},majorGridLines:{color:"#cccccc"},minorGridLines:{color:"#ebebeb"},title:{color:"#333333"},crosshair:{color:"#000000"},notes:{icon:{background:"#000000",border:{color:"#000000"}},label:{color:"#ffffff"},line:{color:"#000000"}}}},gauge:{pointer:{color:"#428bca"},scale:{rangePlaceholderColor:"#cccccc",labels:{color:"#333333"},minorTicks:{color:"#ebebeb"},majorTicks:{color:"#cccccc"},line:{color:"#cccccc"}}},diagram:{shapeDefaults:{fill:{color:"#428bca"},connectorDefaults:{fill:{color:"#333333"},stroke:{color:b},hover:{fill:{color:b},stroke:{color:"#333333"}}},content:{color:"#333333"}},editable:{resize:{handles:{fill:{color:b},stroke:{color:"#333333"},hover:{fill:{color:"#333333"},stroke:{color:"#333333"}}}},rotate:{thumb:{stroke:{color:"#333333"},fill:{color:"#333333"}}}},selectable:{stroke:{color:"#333333"}},connectionDefaults:{stroke:{color:"#c4c4c4"},content:{color:"#333333"},selection:{handles:{fill:{color:b},stroke:{color:"#333333"}},stroke:{color:"#333333"}}}},treeMap:{colors:[["#428bca","#d1e0ec"],["#5bc0de","#d6eaf0"],["#5cb85c","#d6e9d6"],["#5cb85c","#f4e8d7"],["#e67d4a","#f2ddd3"],["#da3b36","#f0d0cf"]]}}),m("flat",{chart:{title:{color:"#4c5356"},legend:{labels:{color:"#4c5356"},inactiveItems:{labels:{color:"#CBCBCB"},markers:{color:"#CBCBCB"}}},seriesDefaults:{labels:{color:"#4c5356"},errorBars:{color:"#4c5356"},notes:{icon:{background:"transparent",border:{color:"#cdcdcd"}},label:{color:"#4c5356"},line:{color:"#cdcdcd"}},candlestick:{downColor:"#c7c7c7",line:{color:"#787878"}},area:{opacity:.9},waterfall:{line:{color:"#cdcdcd"}},horizontalWaterfall:{line:{color:"#cdcdcd"}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:["#10c4b2","#ff7663","#ffb74f","#a2df53","#1c9ec4","#ff63a5","#1cc47b"],axisDefaults:{line:{color:"#cdcdcd"},labels:{color:"#4c5356"},minorGridLines:{color:"#cdcdcd"},majorGridLines:{color:"#cdcdcd"},title:{color:"#4c5356"},crosshair:{color:"#cdcdcd"},notes:{icon:{background:"transparent",border:{color:"#cdcdcd"}},label:{color:"#4c5356"},line:{color:"#cdcdcd"}}}},gauge:{pointer:{color:"#10c4b2"},scale:{rangePlaceholderColor:"#cdcdcd",labels:{color:"#4c5356"},minorTicks:{color:"#4c5356"},majorTicks:{color:"#4c5356"},line:{color:"#4c5356"}}},diagram:{shapeDefaults:{fill:{color:"#10c4b2"},connectorDefaults:{fill:{color:"#363940"},stroke:{color:b},hover:{fill:{color:b},stroke:{color:"#363940"}}},content:{color:"#4c5356"}},editable:{resize:{handles:{fill:{color:b},stroke:{color:"#363940"},hover:{fill:{color:"#363940"},stroke:{color:"#363940"}}}},rotate:{thumb:{stroke:{color:"#363940"},fill:{color:"#363940"}}}},selectable:{stroke:{color:"#363940"}},connectionDefaults:{stroke:{color:"#cdcdcd"},content:{color:"#4c5356"},selection:{handles:{fill:{color:b},stroke:{color:"#363940"}},stroke:{color:"#363940"}}}},treeMap:{colors:[["#10c4b2","#cff3f0"],["#ff7663","#ffe4e0"],["#ffb74f","#fff1dc"],["#a2df53","#ecf9dd"],["#1c9ec4","#d2ecf3"],["#ff63a5","#ffe0ed"],["#1cc47b","#d2f3e5"]]}}),m("material",{chart:{title:{color:"#444444"},legend:{labels:{color:"#444444"},inactiveItems:{labels:{color:"#CBCBCB"},markers:{color:"#CBCBCB"}}},seriesDefaults:{labels:{
color:"#444444"},errorBars:{color:"#444444"},notes:{icon:{background:"transparent",border:{color:"#e5e5e5"}},label:{color:"#444444"},line:{color:"#e5e5e5"}},candlestick:{downColor:"#c7c7c7",line:{color:"#787878"}},area:{opacity:.9},waterfall:{line:{color:"#e5e5e5"}},horizontalWaterfall:{line:{color:"#e5e5e5"}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:["#3f51b5","#03a9f4","#4caf50","#f9ce1d","#ff9800","#ff5722"],axisDefaults:{line:{color:"#e5e5e5"},labels:{color:"#444444"},minorGridLines:{color:"#e5e5e5"},majorGridLines:{color:"#e5e5e5"},title:{color:"#444444"},crosshair:{color:"#7f7f7f"},notes:{icon:{background:"transparent",border:{color:"#e5e5e5"}},label:{color:"#444444"},line:{color:"#e5e5e5"}}}},gauge:{pointer:{color:"#3f51b5"},scale:{rangePlaceholderColor:"#e5e5e5",labels:{color:"#444444"},minorTicks:{color:"#444444"},majorTicks:{color:"#444444"},line:{color:"#444444"}}},diagram:{shapeDefaults:{fill:{color:"#3f51b5"},connectorDefaults:{fill:{color:"#7f7f7f"},stroke:{color:b},hover:{fill:{color:b},stroke:{color:"#7f7f7f"}}},content:{color:"#444444"}},editable:{resize:{handles:{fill:{color:b},stroke:{color:"#444444"},hover:{fill:{color:"#444444"},stroke:{color:"#444444"}}}},rotate:{thumb:{stroke:{color:"#444444"},fill:{color:"#444444"}}}},selectable:{stroke:{color:"#444444"}},connectionDefaults:{stroke:{color:"#7f7f7f"},content:{color:"#444444"},selection:{handles:{fill:{color:b},stroke:{color:"#444444"}},stroke:{color:"#444444"}}}},treeMap:{colors:[["#3f51b5","#cff3f0"],["#03a9f4","#e5f6fe"],["#4caf50","#edf7ed"],["#f9ce1d","#fefae8"],["#ff9800","#fff4e5"],["#ff5722","#ffeee8"]]}}),m("materialblack",{chart:{title:{color:"#fff"},legend:{labels:{color:"#fff"},inactiveItems:{labels:{color:"#CBCBCB"},markers:{color:"#CBCBCB"}}},seriesDefaults:{labels:{color:"#fff"},errorBars:{color:"#fff"},notes:{icon:{background:"transparent",border:{color:"#e5e5e5"}},label:{color:"#fff"},line:{color:"#e5e5e5"}},candlestick:{downColor:"#c7c7c7",line:{color:"#787878"}},area:{opacity:.9},waterfall:{line:{color:"#4d4d4d"}},horizontalWaterfall:{line:{color:"#4d4d4d"}},overlay:{gradient:"none"},border:{_brightness:1}},chartArea:{background:"#1c1c1c"},seriesColors:["#3f51b5","#03a9f4","#4caf50","#f9ce1d","#ff9800","#ff5722"],axisDefaults:{line:{color:"#4d4d4d"},labels:{color:"#fff"},minorGridLines:{color:"#4d4d4d"},majorGridLines:{color:"#4d4d4d"},title:{color:"#fff"},crosshair:{color:"#7f7f7f"},notes:{icon:{background:"transparent",border:{color:"#4d4d4d"}},label:{color:"#fff"},line:{color:"#4d4d4d"}}}},gauge:{pointer:{color:"#3f51b5"},scale:{rangePlaceholderColor:"#4d4d4d",labels:{color:"#fff"},minorTicks:{color:"#fff"},majorTicks:{color:"#fff"},line:{color:"#fff"}}},diagram:{shapeDefaults:{fill:{color:"#3f51b5"},connectorDefaults:{fill:{color:"#7f7f7f"},stroke:{color:b},hover:{fill:{color:b},stroke:{color:"#7f7f7f"}}},content:{color:"#fff"}},editable:{resize:{handles:{fill:{color:b},stroke:{color:"#fff"},hover:{fill:{color:"#fff"},stroke:{color:"#fff"}}}},rotate:{thumb:{stroke:{color:"#fff"},fill:{color:"#fff"}}}},selectable:{stroke:{color:"#fff"}},connectionDefaults:{stroke:{color:"#7f7f7f"},content:{color:"#fff"},selection:{handles:{fill:{color:b},stroke:{color:"#fff"}},stroke:{color:"#fff"}}}},treeMap:{colors:[["#3f51b5","#cff3f0"],["#03a9f4","#e5f6fe"],["#4caf50","#edf7ed"],["#f9ce1d","#fefae8"],["#ff9800","#fff4e5"],["#ff5722","#ffeee8"]]}}),function(){function o(){return{icon:{background:"#007cc0",border:{color:"#007cc0"}},label:{color:"#ffffff"},line:{color:a}}}var r="#333333",l="#7f7f7f",c="#bdbdbd",a="#c8c8c8",t="#dddddd",n=["#008fd3","#99d101","#f39b02","#f05662","#c03c53","#acacac"],i=["#cbe8f5","#eaf5cb","#fceacc","#fbdcdf","#f2d7dc","#eeeeee"],f=n[0],s=b;m("fiori",{chart:{title:{color:r},legend:{labels:{color:r},inactiveItems:{labels:{color:l},markers:{color:l}}},seriesDefaults:{labels:{color:r},errorBars:{color:r},notes:o(),candlestick:{downColor:a,line:{color:c}},area:{opacity:.8},waterfall:{line:{color:a}},horizontalWaterfall:{line:{color:a}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:n,axisDefaults:{line:{color:a},labels:{color:r},minorGridLines:{color:t},majorGridLines:{color:a},title:{color:r},crosshair:{color:l},notes:o()}},gauge:{pointer:{color:f},scale:{rangePlaceholderColor:a,labels:{color:r},minorTicks:{color:r},majorTicks:{color:r},line:{color:r}}},diagram:{shapeDefaults:{fill:{color:f},connectorDefaults:{fill:{color:r},stroke:{color:s},hover:{fill:{color:s},stroke:{color:r}}},content:{color:r}},editable:{resize:{handles:{fill:{color:s},stroke:{color:c},hover:{fill:{color:c},stroke:{color:c}}}},rotate:{thumb:{stroke:{color:c},fill:{color:c}}}},selectable:{stroke:{color:c}},connectionDefaults:{stroke:{color:c},content:{color:c},selection:{handles:{fill:{color:s},stroke:{color:c}},stroke:{color:c}}}},treeMap:{colors:e(n,i)}})}(),function(){function o(){return{icon:{background:"#00b0ff",border:{color:"#00b0ff"}},label:{color:"#ffffff"},line:{color:a}}}var r="#4e4e4e",l="#7f7f7f",c="#bdbdbd",a="#c8c8c8",t="#e5e5e5",n=["#0072c6","#5db2ff","#008a17","#82ba00","#ff8f32","#ac193d"],i=["#cbe2f3","#deeffe","#cbe7d0","#e5f0cb","#fee8d5","#eed0d7"],f=n[0],s=b;m("office365",{chart:{title:{color:r},legend:{labels:{color:r},inactiveItems:{labels:{color:l},markers:{color:l}}},seriesDefaults:{labels:{color:r},errorBars:{color:r},notes:o(),candlestick:{downColor:a,line:{color:c}},area:{opacity:.8},waterfall:{line:{color:a}},horizontalWaterfall:{line:{color:a}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:n,axisDefaults:{line:{color:a},labels:{color:r},minorGridLines:{color:t},majorGridLines:{color:a},title:{color:r},crosshair:{color:l},notes:o()}},gauge:{pointer:{color:f},scale:{rangePlaceholderColor:a,labels:{color:r},minorTicks:{color:r},majorTicks:{color:r},line:{color:r}}},diagram:{shapeDefaults:{fill:{color:f},connectorDefaults:{fill:{color:r},stroke:{color:s},hover:{fill:{color:s},stroke:{color:r}}},content:{color:r}},editable:{resize:{handles:{fill:{color:s},stroke:{color:c},hover:{fill:{color:c},stroke:{color:c}}}},rotate:{thumb:{stroke:{color:c},fill:{color:c}}}},selectable:{stroke:{color:c}},connectionDefaults:{stroke:{color:c},content:{color:c},selection:{handles:{fill:{color:s},stroke:{color:c}},stroke:{color:c}}}},treeMap:{colors:e(n,i)}})}(),function(){function o(){return{icon:{background:"#007cc0",border:{color:"#007cc0"}},label:{color:"#ffffff"},line:{color:a}}}var r="#32364c",l="#7f7f7f",c="#bdbdbd",a="#dfe0e1",t="#dfe0e1",n=["#ff4350","#ff9ea5","#00acc1","#80deea","#ffbf46","#ffd78c"],i=["#ffd9dc","#ffeced","#cceef3","#e6f8fb","#fff2da","#fff7e8"],f=n[0],s=b;m("nova",{chart:{title:{color:r},legend:{labels:{color:r},inactiveItems:{labels:{color:l},markers:{color:l}}},seriesDefaults:{labels:{color:r},errorBars:{color:r},notes:o(),candlestick:{downColor:a,line:{color:c}},area:{opacity:.8},waterfall:{line:{color:a}},horizontalWaterfall:{line:{color:a}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:n,axisDefaults:{line:{color:a},labels:{color:r},minorGridLines:{color:t},majorGridLines:{color:a},title:{color:r},crosshair:{color:r},notes:o()}},gauge:{pointer:{color:f},scale:{rangePlaceholderColor:a,labels:{color:r},minorTicks:{color:r},majorTicks:{color:r},line:{color:r}}},diagram:{shapeDefaults:{fill:{color:f},connectorDefaults:{fill:{color:r},stroke:{color:s},hover:{fill:{color:s},stroke:{color:r}}},content:{color:r}},editable:{resize:{handles:{fill:{color:s},stroke:{color:c},hover:{fill:{color:c},stroke:{color:c}}}},rotate:{thumb:{stroke:{color:c},fill:{color:c}}}},selectable:{stroke:{color:c}},connectionDefaults:{stroke:{color:c},content:{color:c},selection:{handles:{fill:{color:s},stroke:{color:c}},stroke:{color:c}}}},treeMap:{colors:e(n,i)}})}()}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(o,e,r){(r||e)()});;!function(e,define){define("util/main.min",["kendo.core.min"],e)}(function(){return function(){function e(e){return typeof e!==F}function t(e,t){var n=i(t);return B.round(e*n)/n}function i(e){return e?B.pow(10,e):1}function n(e,t,i){return B.max(B.min(e,i),t)}function o(e){return e*E}function r(e){return e/E}function a(e){return"number"==typeof e&&!isNaN(e)}function s(t,i){return e(t)?t:i}function l(e){return e*e}function c(e){var t,i=[];for(t in e)i.push(t+e[t]);return i.sort().join("")}function u(e){var t,i=2166136261;for(t=0;e.length>t;++t)i+=(i<<1)+(i<<4)+(i<<7)+(i<<8)+(i<<24),i^=e.charCodeAt(t);return i>>>0}function h(e){return u(c(e))}function p(e){var t,i=e.length,n=O,o=z;for(t=0;i>t;t++)o=B.max(o,e[t]),n=B.min(n,e[t]);return{min:n,max:o}}function d(e){return p(e).min}function f(e){return p(e).max}function g(e){return x(e).min}function m(e){return x(e).max}function x(e){var t,i,n,o=O,r=z;for(t=0,i=e.length;i>t;t++)n=e[t],null!==n&&isFinite(n)&&(o=B.min(o,n),r=B.max(r,n));return{min:o===O?void 0:o,max:r===z?void 0:r}}function v(e){return e?e[e.length-1]:void 0}function y(e,t){return e.push.apply(e,t),e}function b(e){return L.template(e,{useWithBlock:!1,paramName:"d"})}function w(t,i){return e(i)&&null!==i?" "+t+"='"+i+"' ":""}function _(e){var t,i="";for(t=0;e.length>t;t++)i+=w(e[t][0],e[t][1]);return i}function A(t){var i,n,o="";for(i=0;t.length>i;i++)n=t[i][1],e(n)&&(o+=t[i][0]+":"+n+";");return""!==o?o:void 0}function C(e){return"string"!=typeof e&&(e+="px"),e}function k(e){var t,i,n=[];if(e)for(t=L.toHyphens(e).split("-"),i=0;t.length>i;i++)n.push("k-pos-"+t[i]);return n.join(" ")}function S(t){return""===t||null===t||"none"===t||"transparent"===t||!e(t)}function P(e){for(var t={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},i=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],n="";e>0;)i[0]>e?i.shift():(n+=t[i[0]],e-=i[0]);return n}function T(e){var t,i,n,o,r;for(e=e.toLowerCase(),t={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},i=0,n=0,o=0;e.length>o;++o){if(r=t[e.charAt(o)],!r)return null;i+=r,r>n&&(i-=2*n),n=r}return i}function I(e){var t=Object.create(null);return function(){var i,n="";for(i=arguments.length;--i>=0;)n+=":"+arguments[i];return n in t?t[n]:e.apply(this,arguments)}}function R(e){for(var t,i,n=[],o=0,r=e.length;r>o;)t=e.charCodeAt(o++),t>=55296&&56319>=t&&r>o?(i=e.charCodeAt(o++),56320==(64512&i)?n.push(((1023&t)<<10)+(1023&i)+65536):(n.push(t),o--)):n.push(t);return n}function V(e){return e.map(function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)}).join("")}var B=Math,L=window.kendo,D=L.deepExtend,E=B.PI/180,O=Number.MAX_VALUE,z=-Number.MAX_VALUE,F="undefined",M=Date.now;M||(M=function(){return(new Date).getTime()}),D(L,{util:{MAX_NUM:O,MIN_NUM:z,append:y,arrayLimits:p,arrayMin:d,arrayMax:f,defined:e,deg:r,hashKey:u,hashObject:h,isNumber:a,isTransparent:S,last:v,limitValue:n,now:M,objectKey:c,round:t,rad:o,renderAttr:w,renderAllAttr:_,renderPos:k,renderSize:C,renderStyle:A,renderTemplate:b,sparseArrayLimits:x,sparseArrayMin:g,sparseArrayMax:m,sqr:l,valueOrDefault:s,romanToArabic:T,arabicToRoman:P,memoize:I,ucs2encode:V,ucs2decode:R}}),L.drawing.util=L.util,L.dataviz.util=L.util}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()}),function(e,define){define("util/text-metrics.min",["kendo.core.min","util/main.min"],e)}(function(){!function(e){function t(){return{width:0,height:0,baseline:0}}function i(e,t,i){return h.current.measure(e,t,i)}function n(e,t){var i=[];if(e.length>0&&document.fonts){try{i=e.map(function(e){return document.fonts.load(e)})}catch(n){r.logToConsole(n)}Promise.all(i).then(t,t)}else t()}var o=document,r=window.kendo,a=r.Class,s=r.util,l=s.defined,c=a.extend({init:function(e){this._size=e,this._length=0,this._map={}},put:function(e,t){var i=this,n=i._map,o={key:e,value:t};n[e]=o,i._head?(i._tail.newer=o,o.older=i._tail,i._tail=o):i._head=i._tail=o,i._length>=i._size?(n[i._head.key]=null,i._head=i._head.newer,i._head.older=null):i._length++},get:function(e){var t=this,i=t._map[e];return i?(i===t._head&&i!==t._tail&&(t._head=i.newer,t._head.older=null),i!==t._tail&&(i.older&&(i.older.newer=i.newer,i.newer.older=i.older),i.older=t._tail,i.newer=null,t._tail.newer=i,t._tail=i),i.value):void 0}}),u=e("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: nowrap!important;' />")[0],h=a.extend({init:function(e){this._cache=new c(1e3),this._initOptions(e)},options:{baselineMarkerSize:1},measure:function(i,n,r){var a,c,h,p,d,f,g,m;if(!i)return t();if(a=s.objectKey(n),c=s.hashKey(i+a),h=this._cache.get(c),h)return h;p=t(),d=r?r:u,f=this._baselineMarker().cloneNode(!1);for(g in n)m=n[g],l(m)&&(d.style[g]=m);return e(d).text(i),d.appendChild(f),o.body.appendChild(d),(i+"").length&&(p.width=d.offsetWidth-this.options.baselineMarkerSize,p.height=d.offsetHeight,p.baseline=f.offsetTop+this.options.baselineMarkerSize),p.width>0&&p.height>0&&this._cache.put(c,p),d.parentNode.removeChild(d),p},_baselineMarker:function(){return e("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;' />")[0]}});h.current=new h,r.util.TextMetrics=h,r.util.LRUCache=c,r.util.loadFonts=n,r.util.measureText=i}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()}),function(e,define){define("util/base64.min",["util/main.min"],e)}(function(){return function(){function e(e){var i,n,o,a,s,l,c,u="",h=0;for(e=t(e);e.length>h;)i=e.charCodeAt(h++),n=e.charCodeAt(h++),o=e.charCodeAt(h++),a=i>>2,s=(3&i)<<4|n>>4,l=(15&n)<<2|o>>6,c=63&o,isNaN(n)?l=c=64:isNaN(o)&&(c=64),u=u+r.charAt(a)+r.charAt(s)+r.charAt(l)+r.charAt(c);return u}function t(e){var t,i,n="";for(t=0;e.length>t;t++)i=e.charCodeAt(t),128>i?n+=o(i):2048>i?(n+=o(192|i>>>6),n+=o(128|63&i)):65536>i&&(n+=o(224|i>>>12),n+=o(128|i>>>6&63),n+=o(128|63&i));return n}var i=window.kendo,n=i.deepExtend,o=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n(i.util,{encodeBase64:e,encodeUTF8:t})}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()}),function(e,define){define("mixins/observers.min",["kendo.core.min"],e)}(function(){return function(e){var t=Math,i=window.kendo,n=i.deepExtend,o=e.inArray,r={observers:function(){return this._observers=this._observers||[]},addObserver:function(e){return this._observers?this._observers.push(e):this._observers=[e],this},removeObserver:function(e){var t=this.observers(),i=o(e,t);return-1!=i&&t.splice(i,1),this},trigger:function(e,t){var i,n,o=this._observers;if(o&&!this._suspended)for(n=0;o.length>n;n++)i=o[n],i[e]&&i[e](t);return this},optionsChange:function(e){this.trigger("optionsChange",e)},geometryChange:function(e){this.trigger("geometryChange",e)},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=t.max((this._suspended||0)-1,0),this},_observerField:function(e,t){this[e]&&this[e].removeObserver(this),this[e]=t,t.addObserver(this)}};n(i,{mixins:{ObserversMixin:r}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()}),function(e,define){define("kendo.dataviz.chart.min",["kendo.color.min","kendo.data.min","kendo.dataviz.core.min","kendo.dataviz.themes.min","kendo.drawing.min","kendo.userevents.min"],e)}(function(){return function(e,t){function i(){return this}function n(){this._defaults={}}function o(e,t,i,n){var o,r,a=(n.x-i.x)*(e.y-i.y)-(n.y-i.y)*(e.x-i.x),s=(n.y-i.y)*(t.x-e.x)-(n.x-i.x)*(t.y-e.y);return 0!==s&&(r=a/s,o=new ii(e.x+r*(t.x-e.x),e.y+r*(t.y-e.y))),o}function r(e,t){var i,n,o,r=e.series,s=r.length,l=e.seriesDefaults,c=Ut({},e.seriesDefaults),u=t?Ut({},t.seriesDefaults):{},h=Ut({},u);for(a(c),a(h),i=0;s>i;i++)n=r[i].type||e.seriesDefaults.type,o=Ut({data:[]},h,u[n],{tooltip:e.tooltip},c,l[n]),r[i]._defaults=o,r[i]=Ut({},o,r[i])}function a(e){delete e.bar,delete e.column,delete e.rangeColumn,delete e.line,delete e.verticalLine,delete e.pie,delete e.donut,delete e.area,delete e.verticalArea,delete e.scatter,delete e.scatterLine,delete e.bubble,delete e.candlestick,delete e.ohlc,delete e.boxPlot,delete e.bullet,delete e.verticalBullet,delete e.polarArea,delete e.polarLine,delete e.radarArea,delete e.radarLine,delete e.waterfall}function s(e){var t,i,n,o,r=e.series,a=e.seriesColors||[];for(t=0;r.length>t;t++)i=r[t],n=a[t%a.length],i.color=i.color||n,o=i._defaults,o&&(o.color=o.color||n)}function l(e){var t;Pt([Yi,$o,rr,ar],function(){t=this+"Axes",e[t]&&(e[this+"Axis"]=e[t],delete e[t])})}function c(t,i){var n=(i||{}).axisDefaults||{};Pt([Yi,$o,rr,ar],function(){var i=this+"Axis",o=[].concat(t[i]),r=t.axisDefaults||{};o=e.map(o,function(e){var t=(e||{}).color,o=Ut({},n,n[i],r,r[i],{line:{color:t},labels:{color:t},title:{color:t}},e);return delete o[i],o}),t[i]=o.length>1?o:o[0]})}function u(e){var t,i=e.length,n=0;for(t=0;i>t;t++)n=Vt.max(n,e[t].data.length);return n}function h(e){return e*e}function p(e,t){if(null===t)return t;var i=Ht(e,!0);return i(t)}function d(e,t){if(null===t)return t;var i="_date_"+e,n=t[i];return n||(n=f(Ht(e,!0)(t)),t[i]=n),n}function f(e){var t,i;if(e instanceof Date)t=e;else if(typeof e===Eo)t=Et.parseDate(e)||new Date(e);else if(e)if(Tt(e))for(t=[],i=0;e.length>i;i++)t.push(f(e[i]));else t=new Date(e);return t}function g(e){return Tt(e)?Rt(e,g):e?f(e).getTime():t}function m(e,t,i,n){var o,r=e;return e&&(e=f(e),o=e.getHours(),i===sr?(r=new Date(e.getFullYear()+t,0,1),Et.date.adjustDST(r,0)):i===Zn?(r=new Date(e.getFullYear(),e.getMonth()+t,1),Et.date.adjustDST(r,o)):i===nr?(r=m(x(e,n),7*t,sn),Et.date.adjustDST(r,o)):i===sn?(r=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Et.date.adjustDST(r,o)):i===Vn?r=_(new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours()),t*Mo):i===Kn?(r=_(e,t*Fo),r.getSeconds()>0&&r.setSeconds(0)):i===Co&&(r=_(e,t*zo)),r.getMilliseconds()>0&&r.setMilliseconds(0)),r}function x(e,t){var i=e.getDay(),n=0;if(!isNaN(i))for(t=t||0;i!==t;)0===i?i=6:i--,n++;return _(e,-n*Uo)}function v(e,t,i){return e=f(e),m(e,0,t,i)}function y(e,t,i){return e=f(e),e&&v(e,t,i).getTime()===e.getTime()?e:m(e,1,t,i)}function b(e,t){var i=e.getTime()-t,n=e.getTimezoneOffset()-t.getTimezoneOffset();return i-(n*i>0?n*Fo:0)}function w(e,t){var i=e.getTime()-t,n=e.getTimezoneOffset()-t.getTimezoneOffset();return i-n*Fo}function _(e,t){var i=e.getTimezoneOffset(),n=new Date(e.getTime()+t),o=n.getTimezoneOffset()-i;return new Date(n.getTime()+(t*o>0?o*Fo:0))}function A(e,t,i){var n;return n=i===sr?t.getFullYear()-e.getFullYear():i===Zn?12*A(e,t,sr)+t.getMonth()-e.getMonth():Vt.floor(i===sn?b(t,e)/Uo:b(t,e)/Go[i])}function C(e,t,i,n){var o,r=f(e),a=f(t);return o=i==Zn?r.getMonth()-a.getMonth()+12*(r.getFullYear()-a.getFullYear())+k(r,new Date(r.getFullYear(),r.getMonth()),sn)/new Date(r.getFullYear(),r.getMonth()+1,0).getDate():i===sr?r.getFullYear()-a.getFullYear()+C(r,new Date(r.getFullYear(),0),Zn,1)/12:k(r,a,i),o/n}function k(e,t,i){return b(e,t)/Go[i]}function S(e){return 1===e.length?e[0]:e}function P(e){var t,i,n,o=e.length;if(o>0)for(i=0;o>i;i++)n=e[i].contentBox(),t?t.wrap(n):t=n.clone();return t||Xt()}function T(e,t){return e&&t?e.toLowerCase()===t.toLowerCase():e===t}function I(e,t){return e&&t?g(e)===g(t):e===t}function R(e,t){null!==t&&e.push(t)}function V(e,t){for(var i,n,o=0,r=t.length-1;r>=o;)if(i=Vt.floor((o+r)/2),n=t[i],e>n)o=i+1;else{if(!(n>e)){for(;I(t[i-1],e);)i--;return i}r=i-1}return e>=t[i]?i:i-1}function B(e){return"number"==typeof e&&!isNaN(e)}function L(e){var t,i,n=e.length,o=0;for(t=0;n>t;t++)i=e[t],B(i)&&o++;return o}function D(e){return L(e)===e.length}function E(e){var t,i,n,o={};for(t=0;e.length>t;t++)i=e[t],n=i.options.name,n&&(o[n]=i.range());return o}function O(e,t,i,n){var o,r,a,s,l,c=!1;if(i=i||{},a=i.excluded=i.excluded||[],s=i.defaults=i.defaults||{},l=i.depth=i.depth||0,!(l>qn)){for(o in e)!di(o,i.excluded)&&e.hasOwnProperty(o)&&(r=e[o],Nt(r)?(c=!0,n||(e[o]=Si(r(t),s[o]))):typeof r===lo&&(n||(i.defaults=s[o]),i.depth++,c=O(r,t,i,n)||c,i.depth--));return c}}function z(e,i){var n,o,r,a=[],s=e.groupNameTemplate,l=i.length;if(0===l)return r=Ut({},e),r.visibleInLegend=!1,[r];for(yi(s)?(Et.logToConsole("'groupNameTemplate' is obsolete and will be removed in future versions. Specify the group name template as 'series.name'"),s&&(n=jt(s))):(n=jt(e.name||""),0===n._slotCount&&(n=jt(yi(e.name)?"#= group.value #: #= series.name #":"#= group.value #"))),o=0;l>o;o++)r=Ut({},e),Nt(r.color)||(r.color=t),r._groupIx=o,a.push(r),n&&(r.name=n({series:r,group:i[o]}));return a}function F(e,t){var i,n,o=[];for(t=[].concat(t),i=0;e.length>i;i++)n=e[i],di(n.type,t)&&o.push(n);return o}function M(t,i){if(t instanceof Date){for(var n=0,o=i.length;o>n;n++)if(I(i[n],t))return n;return-1}return e.inArray(t,i)}function U(e,t){t=t||hi;for(var i=1,n=e.length;n>i;i++)if(t(e[i],e[i-1])<0){e.sort(t);break}return e}function H(e,t){var i,n=U(e,t),o=n.length,r=o>0?[n[0]]:[];for(t=t||hi,i=1;o>i;i++)0!==t(n[i],bi(r))&&r.push(n[i]);return r}function N(e,t){var i=e.type,n=t instanceof Date;return!i&&n||T(i,an)}function j(e){var t,i,n,o,r=[],a=e.length;for(t=0;a>t;t++)for(i=e[t],o=i.length,n=0;o>n;n++)r[n]=r[n]||[],r[n].push(i[n]);return r}function G(e,t){if(e.indexOf(".")>-1)for(var i,n=e.split("."),o="";n.length>1;)o+=n.shift(),i=Et.getter(o)(t)||{},Et.setter(o)(t,i),o+="."}function q(e){var t,i,n,o=e.data,r=0;for(t=0;o.length>t;t++)i=ie.current.bindPoint(e,t),n=i.valueFields.value,typeof n===Eo&&(n=parseFloat(n)),B(n)&&i.fields.visible!==!1&&(r+=Vt.abs(n));return r}function Y(e){var t=e.overlay;return t&&t.gradient&&"none"!=t.gradient}function X(e){for(var t=0;e.length>t;t++)if(yi(e[t].zIndex))return!0}function W(){this._defaultPrevented=!0}function K(e,t){if(e)for(var i=0;e.length>i;i++)if(e[i].category===t)return[e[i]]}function Z(e){return yi(e)&&null!==e}function Q(e){var t,i,n={};for(i=0;e.length>i;i++)t=e[i],t.axis.options.name&&(n[t.axis.options.name]={min:t.range.min,max:t.range.max});return n}function $(e,t){var i=(t||"").toLowerCase(),n="none"==i&&!(e.ctrlKey||e.shiftKey||e.altKey)||e[i+"Key"];return n}function J(e,t){var i=[];ee(e,i),Et.util.loadFonts(i,t)}function ee(e,t,i){var n=5;i=i||{depth:0},!e||i.depth>n||!document.fonts||Object.keys(e).forEach(function(n){var o=e[n];"dataSource"!==n&&"$"!==n[0]&&o&&("font"===n?t.push(o):"object"==typeof o&&(i.depth++,ee(o,t,i),i.depth--))})}var te,ie,ne,oe,re,ae,se,le,ce,ue,he,pe,de,fe,ge,me,xe,ve,ye,be,we,_e,Ae,Ce,ke,Se,Pe,Te,Ie,Re,Ve,Be,Le,De,Ee,Oe,ze,Fe,Me,Ue,He,Ne,je,Ge,qe,Ye,Xe,We,Ke,Ze,Qe,$e,Je,et,tt,it,nt,ot,rt,at,st,lt,ct,ut,ht,pt,dt,ft,gt,mt,xt,vt,yt,bt,wt,_t,At,Ct,kt,St,Pt=e.each,Tt=e.isArray,It=e.isPlainObject,Rt=e.map,Vt=Math,Bt=e.noop,Lt=e.extend,Dt=e.proxy,Et=window.kendo,Ot=Et.Class,zt=Et.Observable,Ft=Et.data.DataSource,Mt=Et.ui.Widget,Ut=Et.deepExtend,Ht=Et.getter,Nt=Et.isFunction,jt=Et.template,Gt=Et.dataviz,qt=Gt.Axis,Yt=Gt.AxisLabel,Xt=Gt.Box2D,Wt=Gt.BoxElement,Kt=Gt.ChartElement,Zt=Et.drawing.Color,Qt=Gt.CurveProcessor,$t=Gt.FloatElement,Jt=Gt.Note,ei=Gt.LogarithmicAxis,ti=Gt.NumericAxis,ii=Gt.Point2D,ni=Gt.RootElement,oi=Gt.Ring,ri=Gt.ShapeElement,ai=Gt.ShapeBuilder,si=Gt.TextBox,li=Gt.Title,ci=Gt.alignPathToPixel,ui=Gt.autoFormat,hi=Gt.dateComparer,pi=Gt.getSpacing,di=Gt.inArray,fi=Gt.interpolateValue,gi=Gt.mwDelta,mi=Gt.round,xi=Et.util,vi=xi.append,yi=xi.defined,bi=xi.last,wi=xi.limitValue,_i=xi.sparseArrayLimits,Ai=xi.sparseArrayMin,Ci=xi.sparseArrayMax,ki=xi.renderTemplate,Si=xi.valueOrDefault,Pi=Gt.geometry,Ti=Gt.drawing,Ii=".kendoChart",Ri="above",Vi="area",Bi="auto",Li="fit",Di=Gt.AXIS_LABEL_CLICK,Ei="bar",Oi=6,zi=.8,Fi="below",Mi="#000",Ui="both",Hi="bottom",Ni="boxPlot",ji="bubble",Gi="bullet",qi="candlestick",Yi="category",Xi="center",Wi="change",Ki="circle",Zi="contextmenu"+Ii,Qi=Gt.CLIP,$i="color",Ji="column",en=Gt.COORD_PRECISION,tn="cross",nn="k-",on="custom",rn="dataBound",an="date",sn="days",ln=Gt.DEFAULT_FONT,cn=Gt.DEFAULT_HEIGHT,un=Gt.DEFAULT_PRECISION,hn=Gt.DEFAULT_WIDTH,pn=4,dn="donut",fn=50,gn="drag",mn="dragEnd",xn="dragStart",vn="errorLow",yn="errorHigh",bn="xErrorLow",wn="xErrorHigh",_n="yErrorLow",An="yErrorHigh",Cn="fadeIn",kn="first",Sn="from",Pn="funnel",Tn="glass",In="horizontal",Rn="horizontalWaterfall",Vn="hours",Bn=Gt.INITIAL_ANIMATION_DURATION,Ln="insideBase",Dn="insideEnd",En="interpolate",On="leave",zn="left",Fn="legendItemClick",Mn="legendItemHover",Un="line",Hn=8,Nn="linear",jn="log",Gn="max",qn=5,Yn=Number.MAX_VALUE,Xn="min",Wn=-Number.MAX_VALUE,Kn="minutes",Zn="months",Qn="mouseleave"+Ii,$n="mousemove.tracking",Jn="mouseover"+Ii,eo="mouseout"+Ii,to="mousemove"+Ii,io=20,no=150,oo="DOMMouseScroll"+Ii+" mousewheel"+Ii,ro=Gt.NOTE_CLICK,ao=Gt.NOTE_HOVER,so="noteText",lo="object",co="ohlc",uo="outsideEnd",ho="pie",po=70,fo="plotAreaClick",go="pointer",mo="rangeBar",xo="rangeColumn",vo="render",yo="right",bo="roundedBevel",wo="roundedGlass",_o="scatter",Ao="scatterLine",Co="seconds",ko="selectStart",So="select",Po="selectEnd",To="seriesClick",Io="seriesHover",Ro=.001,Vo="step",Bo="smooth",Lo="stderr",Do="stddev",Eo="string",Oo="summary",zo=1e3,Fo=60*zo,Mo=60*Fo,Uo=24*Mo,Ho=7*Uo,No=31*Uo,jo=365*Uo,Go={years:jo,months:No,weeks:Ho,days:Uo,hours:Mo,minutes:Fo,seconds:zo},qo="to",Yo="top",Xo=150,Wo=5,Ko=100,Zo=100,Qo="chart-tooltip-inverse",$o="value",Jo="verticalArea",er="verticalBullet",tr="verticalLine",ir="waterfall",nr="weeks",or="#fff",rr="x",ar="y",sr="years",lr="zero",cr=3,ur="zoomStart",hr="zoom",pr="zoomEnd",dr=[Co,Kn,Vn,sn,nr,Zn,sr],fr=[Ei,Ji,co,qi,Ni,Gi,xo,mo,ir,Rn],gr={seconds:"HH:mm:ss",minutes:"HH:mm",hours:"HH:mm",days:"M/d",weeks:"M/d",months:"MMM 'yy",years:"yyyy"},mr=Mt.extend({init:function(e,i){var n,o,r=this;Et.destroy(e),Mt.fn.init.call(r,e),r.element.addClass(nn+this.options.name.toLowerCase()).css("position","relative"),i&&(o=i.dataSource,i.dataSource=t),n=Ut({},r.options,i),r._originalOptions=Ut({},n),r._initTheme(n),r._initSurface(),r.bind(r.events,r.options),r.wrapper=r.element,i&&(i.dataSource=o),r._initDataSource(i),Et.notify(r,Gt.ui)},_initTheme:function(i){var n,o=this,r=Gt.ui.themes||{},a=i.theme,c=r[a]||r[a.toLowerCase()],u=a&&c?c.chart:{},h=[],p=i.series||[];for(n=0;p.length>n;n++)h.push(e.extend({},p[n]));i.series=h,l(i),o._applyDefaults(i,u),null===i.seriesColors&&(i.seriesColors=t),o.options=Ut({},u,i),s(o.options)},_initDataSource:function(e){var t=this,i=(e||{}).dataSource;t._dataChangeHandler=Dt(t._onDataChanged,t),t.dataSource=Ft.create(i).bind(Wi,t._dataChangeHandler),t._bindCategories(),i&&(t._hasDataSource=!0),J(e,function(){t._redraw(),t._attachEvents()}),i&&t.options.autoBind&&t.dataSource.fetch()},setDataSource:function(e){var t=this;t.dataSource.unbind(Wi,t._dataChangeHandler),t.dataSource=e=Ft.create(e),t._hasDataSource=!0,t._hasData=!1,e.bind(Wi,t._dataChangeHandler),t.options.autoBind&&e.fetch()},events:[rn,To,Io,Di,Fn,Mn,fo,xn,gn,mn,ur,hr,pr,ko,So,Po,ro,ao,vo],items:function(){return e()},options:{name:"Chart",renderAs:"",theme:"default",chartArea:{},legend:{visible:!0,labels:{}},categoryAxis:{},autoBind:!0,seriesDefaults:{type:Ji,data:[],highlight:{visible:!0},labels:{},negativeValues:{visible:!1}},series:[],seriesColors:null,tooltip:{visible:!1},transitions:!0,valueAxis:{},plotArea:{},title:{},xAxis:{},yAxis:{},panes:[{}],pannable:!1,zoomable:!1},refresh:function(){var e=this;e._applyDefaults(e.options),s(e.options),e._bindSeries(),e._bindCategories(),e.trigger(rn),e._redraw()},getSize:function(){return Et.dimensions(this.element)},_resize:function(){var e=this.options.transitions;this.options.transitions=!1,this._redraw(),this.options.transitions=e},redraw:function(e){var t,i,n=this;n._applyDefaults(n.options),s(n.options),e?(i=n._model._plotArea,t=i.findPane(e),i.redraw(t)):n._redraw()},getAxis:function(e){var t,i=this._plotArea.axes;for(t=0;i.length>t;t++)if(i[t].options.name===e)return new St(i[t])},toggleHighlight:function(e,t){var i,n,o,r,a=this._plotArea,s=this._highlight,l=(a.srcSeries||a.series||[])[0];if(It(t)?(i=t.series,n=t.category):i=n=t,o=l.type===dn?K(a.pointsBySeriesName(i),n):l.type===ho||l.type===Pn?K((a.charts[0]||{}).points,n):a.pointsBySeriesName(i))for(r=0;o.length>r;r++)s.togglePointHighlight(o[r],e)},_initSurface:function(){var e=this.surface,t=this._surfaceWrap(),i=this.options.chartArea;i.width&&t.css("width",i.width),i.height&&t.css("height",i.height),e&&e.options.type===this.options.renderAs?(this.surface.clear(),this.surface.resize()):(e&&e.destroy(),this.surface=Ti.Surface.create(t,{type:this.options.renderAs}))},_surfaceWrap:function(){return this.element},_redraw:function(){var e,t=this,i=t._getModel();t._destroyView(),t._model=i,t._plotArea=i._plotArea,i.renderVisual(),this.options.transitions!==!1&&i.traverse(function(e){e.animation&&e.animation.setup()}),t._initSurface(),t.surface.draw(i.visual),this.options.transitions!==!1&&i.traverse(function(e){e.animation&&e.animation.play()}),t._tooltip=t._createTooltip(),t._highlight=new ft(e),t._setupSelection(),t._createPannable(),t._createZoomSelection(),t._createMousewheelZoom(),t._hasDataSource&&!t._hasData&&t.options.autoBind||t.trigger(vo)},exportVisual:function(e){var t,i,n,o;return e&&(e.width||e.height)?(i=this.options.chartArea,n=this._originalOptions.chartArea,Ut(i,e),o=this._getModel(),i.width=n.width,i.height=n.height,o.renderVisual(),t=o.visual):t=this.surface.exportVisual(),t},_sharedTooltip:function(){var e=this,t=e.options;return e._plotArea instanceof st&&t.tooltip.shared},_createPannable:function(){var e=this.options;e.pannable!==!1&&(this._pannable=new _t(this._plotArea,e.pannable))},_createZoomSelection:function(){var e=this.options.zoomable,t=(e||{}).selection;e!==!1&&t!==!1&&(this._zoomSelection=new At(this,t))},_createMousewheelZoom:function(){var e=this.options.zoomable,t=(e||{}).mousewheel;e!==!1&&t!==!1&&(this._mousewheelZoom=new Ct(this,t))},_createTooltip:function(){var e,t=this,i=t.options,n=t.element;return e=t._sharedTooltip()?new xt(n,t._plotArea,i.tooltip):new mt(n,i.tooltip),e.bind(On,Dt(t._tooltipleave,t)),e},_tooltipleave:function(){var e=this,t=e._plotArea,i=e._highlight;t.hideCrosshairs(),i.hide()},_applyDefaults:function(e,t){c(e,t),r(e,t)},_getModel:function(){var e,t=this,i=t.options,n=new ni(t._modelOptions());return n.chart=t,li.buildTitle(i.title,n),e=n._plotArea=t._createPlotArea(),i.legend.visible&&n.append(new ae(e.options.legend)),n.append(e),n.reflow(),n},_modelOptions:function(){var e=this,t=e.options,i=e.element,n=Vt.floor(i.height()),o=Vt.floor(i.width());return e._size=null,Ut({width:o||hn,height:n||cn,transitions:t.transitions},t.chartArea)},_createPlotArea:function(e){var t=this,i=t.options;return te.current.create(e?[]:i.series,i)},_setupSelection:function(){var e,t,i,n,o,r,a=this,s=a._plotArea,l=s.axes,c=a._selections=[];for(a._selectStartHandler||(a._selectStartHandler=Dt(a._selectStart,a),a._selectHandler=Dt(a._select,a),a._selectEndHandler=Dt(a._selectEnd,a)),t=0;l.length>t;t++)i=l[t],r=i.options,i instanceof se&&r.select&&!r.vertical&&(n=0,o=r.categories.length-1,i instanceof le&&(n=r.categories[n],o=r.categories[o]),r.justified||(i instanceof le?o=m(o,1,r.baseUnit,r.weekStartDay):o++),e=new wt(a,i,Ut({min:n,max:o},r.select)),e.bind(ko,a._selectStartHandler),e.bind(So,a._selectHandler),e.bind(Po,a._selectEndHandler),c.push(e))},_selectStart:function(e){return this.trigger(ko,e)},_select:function(e){return this.trigger(So,e)},_selectEnd:function(e){return this.trigger(Po,e)},_attachEvents:function(){var e=this,t=e.element;t.on(Zi,Dt(e._click,e)),t.on(Jn,Dt(e._mouseover,e)),t.on(eo,Dt(e._mouseout,e)),t.on(oo,Dt(e._mousewheel,e)),t.on(Qn,Dt(e._mouseleave,e)),e._mousemove=Et.throttle(Dt(e._mousemove,e),io),e._shouldAttachMouseMove()&&t.on(to,e._mousemove),Et.UserEvents&&(e._userEvents=new Et.UserEvents(t,{global:!0,filter:":not(.k-selector)",multiTouch:!1,fastTap:!0,tap:Dt(e._tap,e),start:Dt(e._start,e),move:Dt(e._move,e),end:Dt(e._end,e)}))},_mouseout:function(e){var t=this,i=t._getChartElement(e);i&&i.leave&&i.leave(t,e)},_start:function(e){var t=this,i=t._events;yi(i[xn]||i[gn]||i[mn])&&t._startNavigation(e,xn),t._pannable&&t._pannable.start(e),t._zoomSelection&&t._zoomSelection.start(e)},_move:function(e){var t,i,n,o,r,a,s=this,l=s._navState,c=s._pannable,u={};if(c)e.preventDefault(),u=c.move(e),u&&!s.trigger(gn,{axisRanges:u,originalEvent:e})&&c.pan();else if(l){for(e.preventDefault(),t=l.axes,i=0;t.length>i;i++)n=t[i],o=n.options.name,o&&(r=n.options.vertical?e.y:e.x,a=r.startLocation-r.location,0!==a&&(u[n.options.name]=n.translateRange(a)));l.axisRanges=u,s.trigger(gn,{axisRanges:u,originalEvent:e})}s._zoomSelection&&s._zoomSelection.move(e)},_end:function(e){if(this._endNavigation(e,mn),this._zoomSelection){var t=this._zoomSelection.end(e);t&&!this.trigger(hr,{axisRanges:t,originalEvent:e})&&this._zoomSelection.zoom()}this._pannable&&this._pannable.end(e)},_mousewheel:function(e){var t,i,n,o,r,a,s=this,l=e.originalEvent,c=gi(e),u=s._navState,h={},p=s._mousewheelZoom;if(p)e.preventDefault(),h=p.updateRanges(c),h&&!s.trigger(hr,{delta:c,axisRanges:h,originalEvent:e})&&p.zoom();else if(u||(t=s._startNavigation(l,ur),t||(u=s._navState)),u){for(i=u.totalDelta||c,u.totalDelta=i+c,n=s._navState.axes,o=0;n.length>o;o++)r=n[o],a=r.options.name,a&&(h[a]=r.scaleRange(-i));s.trigger(hr,{delta:c,axisRanges:h,originalEvent:e}),s._mwTimeout&&clearTimeout(s._mwTimeout),s._mwTimeout=setTimeout(function(){s._endNavigation(e,pr)},no)}},_startNavigation:function(e,t){var i,n,o,r=this,a=r._eventCoordinates(e),s=r._model._plotArea,l=s.findPointPane(a),c=s.axes.slice(0),u=!1;if(l){for(i=0;c.length>i;i++)if(n=c[i],n.box.containsPoint(a)){u=!0;break}!u&&s.backgroundBox().containsPoint(a)&&(o=r.trigger(t,{axisRanges:E(c),originalEvent:e}),o?r._userEvents.cancel():(r._suppressHover=!0,r._unsetActivePoint(),r._navState={pane:l,axes:c}))}},_endNavigation:function(e,t){var i=this;i._navState&&(i.trigger(t,{axisRanges:i._navState.axisRanges,originalEvent:e}),i._suppressHover=!1,i._navState=null)},_getChartElement:function(e,i){var n,o=this.surface.eventTarget(e);if(o){for(;o&&!n;)n=o.chartElement,o=o.parent;return n?(n.aliasFor&&(n=n.aliasFor(e,this._eventCoordinates(e))),i&&(n=n.closest(i)),n):t}},_eventCoordinates:function(e){var t=this,i=yi((e.x||{}).client),n=i?e.x.client:e.clientX,o=i?e.y.client:e.clientY;return t._toModelCoordinates(n,o)},_toModelCoordinates:function(t,i){var n=this.element,o=n.offset(),r=parseInt(n.css("paddingLeft"),10),a=parseInt(n.css("paddingTop"),10),s=e(window);return new ii(t-o.left-r+s.scrollLeft(),i-o.top-a+s.scrollTop())},_tap:function(e){var t=this,i=t._getChartElement(e);t._activePoint===i?t._click(e):(t._startHover(e)||t._unsetActivePoint(),t._click(e))},_click:function(e){for(var t=this,i=t._getChartElement(e);i;)i.click&&i.click(t,e),i=i.parent},_startHover:function(e){var i,n=this,o=n._getChartElement(e),r=n._tooltip,a=n._highlight,s=n.options.tooltip;if(!n._suppressHover&&a&&!a.isHighlighted(o)&&!n._sharedTooltip())return i=n._getChartElement(e,function(e){return e.hover}),i&&!i.hover(n,e)?(n._activePoint=i,s=Ut({},s,i.options.tooltip),s.visible&&r.show(i),a.show(i),i.tooltipTracking):t},_mouseover:function(t){var i=this;i._startHover(t)&&e(document).on($n,Dt(i._mouseMoveTracking,i))},_mouseMoveTracking:function(t){var i,n,o=this,r=o.options,a=o._tooltip,s=o._highlight,l=o._eventCoordinates(t),c=o._activePoint;o._plotArea.box.containsPoint(l)?c&&c.tooltipTracking&&c.series&&c.parent.getNearestPoint&&(n=c.parent.getNearestPoint(l.x,l.y,c.seriesIx),n&&n!=c&&(n.hover(o,t),o._activePoint=n,i=Ut({},r.tooltip,c.options.tooltip),i.visible&&a.show(n),s.show(n))):(e(document).off($n),o._unsetActivePoint())},_mousemove:function(e){var t=this._eventCoordinates(e);this._trackCrosshairs(t),this._sharedTooltip()&&this._trackSharedTooltip(t,e)},_trackCrosshairs:function(e){var t,i,n=this._plotArea.crosshairs;for(t=0;n.length>t;t++)i=n[t],i.box.containsPoint(e)?i.showAt(e):i.hide()},_trackSharedTooltip:function(t,i){var n,o,r,a,s=this,l=s.options,c=s._plotArea,u=c.categoryAxis,h=s._tooltip,p=l.tooltip,d=s._highlight;c.box.containsPoint(t)&&(n=u.pointCategoryIndex(t),n!==s._tooltipCategoryIx&&(o=c.pointsByCategoryIndex(n),r=e.map(o,function(e){return e.eventArgs(i)}),a=r[0]||{},a.categoryPoints=r,o.length>0&&!this.trigger(Io,a)?(p.visible&&h.showAt(o,t),d.show(o)):h.hide(),s._tooltipCategoryIx=n))},_mouseleave:function(t){var i=this,n=i._plotArea,o=i._tooltip,r=i._highlight,a=t.relatedTarget;a&&e(a).closest(o.element).length||(i._mousemove.cancel(),n.hideCrosshairs(),r.hide(),setTimeout(Dt(o.hide,o),Zo),i._tooltipCategoryIx=null)},_unsetActivePoint:function(){var e=this,t=e._tooltip,i=e._highlight;e._activePoint=null,t&&t.hide(),i&&i.hide()},_onDataChanged:function(){var e,t,i=this,n=i.options,o=i._sourceSeries||n.series,r=o.length,a=i.dataSource.view(),l=(i.dataSource.group()||[]).length>0,c=[];for(e=0;r>e;e++)t=o[e],i._isBindable(t)&&l?vi(c,z(t,a)):c.push(t||[]);i._sourceSeries=o,n.series=c,s(i.options),i._bindSeries(),i._bindCategories(),i._hasData=!0,i._deferRedraw()},_deferRedraw:function(){var e=this;Et.support.vml?(e._clearRedrawTimeout(),e._redrawTimeout=setTimeout(function(){e.surface&&(e.trigger(rn),e._redraw())},0)):(e.trigger(rn),e._redraw())},_clearRedrawTimeout:function(){this._redrawTimeout&&(clearInterval(this._redrawTimeout),this._redrawTimeout=null)},_bindSeries:function(){var e,t,i,n,o=this,r=o.dataSource.view(),a=o.options.series,s=a.length;for(e=0;s>e;e++)t=a[e],o._isBindable(t)&&(i=t._groupIx,n=yi(i)?(r[i]||{}).items:r,t.autoBind!==!1&&(t.data=n))},_bindCategories:function(){var e,t,i=this,n=i.dataSource.view()||[],o=(i.dataSource.group()||[]).length>0,r=n,a=i.options,s=[].concat(a.categoryAxis);for(o&&n.length&&(r=n[0].items),e=0;s.length>e;e++)t=s[e],t.autoBind!==!1&&i._bindCategoryAxis(t,r,e)},_bindCategoryAxis:function(e,t,i){var n,o,r,a=(t||[]).length;if(e.field)for(e.categories=[],n=0;a>n;n++)r=t[n],o=p(e.field,r),0===n?(e.categories=[o],e.dataItems=[r]):(e.categories.push(o),e.dataItems.push(r));else this._bindCategoryAxisFromSeries(e,i)},_bindCategoryAxisFromSeries:function(e,t){var i,n,o,r,a,s,l,c,u,h,f,g=this,m=[],x=g.options.series,v=x.length,y={};for(n=0;v>n;n++)if(o=x[n],r=o.categoryAxis===e.name||!o.categoryAxis&&0===t,a=o.data,l=a.length,o.categoryField&&r&&l>0)for(f=N(e,p(o.categoryField,a[0])),h=f?d:p,s=0;l>s;s++)c=a[s],u=h(o.categoryField,c),(f||!y[u])&&(m.push([u,c]),f||(y[u]=!0));m.length>0&&(f&&(m=H(m,function(e,t){return hi(e[0],t[0])})),i=j(m),e.categories=i[0],e.dataItems=i[1])},_isBindable:function(e){var t,i,n=ie.current.valueFields(e),o=!0;for(i=0;n.length>i;i++)if(t=n[i],t===$o?t="field":t+="Field",!yi(e[t])){o=!1;break}return o},_legendItemClick:function(e,t){var i,n,o,r=this,a=r._plotArea,s=(a.srcSeries||a.series)[e],l=(r._sourceSeries||[])[e]||s;di(s.type,[ho,dn,Pn])?(o=l.data[t],n=yi(o.visible)?!o.visible:!1,o.visible=n):(n=!l.visible,l.visible=n,s.visible=n),r.options.transitions&&(r.options.transitions=!1,i=!0),r.redraw(),i&&(r.options.transitions=!0)},_legendItemHover:function(e,t){var i,n,o=this,r=o._plotArea,a=o._highlight,s=(r.srcSeries||r.series)[e];i=di(s.type,[ho,dn,Pn])?t:e,n=r.pointsBySeriesIndex(i),a.show(n)},_shouldAttachMouseMove:function(){var e=this;return e._plotArea.crosshairs.length||e._tooltip&&e._sharedTooltip()},setOptions:function(i){var n=this,o=i.dataSource;i.dataSource=t,n._originalOptions=Ut(n._originalOptions,i),n.options=Ut({},n._originalOptions),n._sourceSeries=null,
e(document).off(to),Mt.fn._setEvents.call(n,i),n._initTheme(n.options),o&&n.setDataSource(o),n._hasDataSource?n._onDataChanged():(n._bindCategories(),n.redraw()),n._shouldAttachMouseMove()&&n.element.on(to,n._mousemove)},destroy:function(){var t=this,i=t.dataSource;t.element.off(Ii),i&&i.unbind(Wi,t._dataChangeHandler),e(document).off($n),t._userEvents&&t._userEvents.destroy(),t._destroyView(),t.surface.destroy(),t.surface=null,t._clearRedrawTimeout(),Mt.fn.destroy.call(t)},_destroyView:function(){var e=this,t=e._model,i=e._selections;if(t&&(t.destroy(),e._model=null),i)for(;i.length>0;)i.shift().destroy();e._unsetActivePoint(),e._tooltip&&e._tooltip.destroy(),e._highlight&&e._highlight.destroy(),e._zoomSelection&&e._zoomSelection.destroy()}});Gt.ExportMixin.extend(mr.fn),Et.PDFMixin&&Et.PDFMixin.extend(mr.fn),te=Ot.extend({init:function(){this._registry=[]},register:function(e,t){this._registry.push({type:e,seriesTypes:t})},create:function(e,t){var i,n,o,r=this._registry,a=r[0];for(i=0;r.length>i;i++)if(n=r[i],o=F(e,n.seriesTypes),o.length>0){a=n;break}return new a.type(o,t)}}),te.current=new te,ie=Ot.extend({init:function(){this._valueFields={},this._otherFields={},this._nullValue={},this._undefinedValue={}},register:function(e,i,n){var o,r,a=this;for(i=i||[$o],o=0;e.length>o;o++)r=e[o],a._valueFields[r]=i,a._otherFields[r]=n,a._nullValue[r]=a._makeValue(i,null),a._undefinedValue[r]=a._makeValue(i,t)},canonicalFields:function(e){return this.valueFields(e).concat(this.otherFields(e))},valueFields:function(e){return this._valueFields[e.type]||[$o]},otherFields:function(e){return this._otherFields[e.type]||[$o]},bindPoint:function(e,t,i){var n,o,r,a,s,l=this,c=e.data,u=yi(i)?i:c[t],h={valueFields:{value:u}},p=l.valueFields(e),d=l._otherFields[e.type];return null===u?s=l._nullValue[e.type]:yi(u)?Tt(u)?(o=u.slice(p.length),s=l._bindFromArray(u,p),n=l._bindFromArray(o,d)):typeof u===lo&&(r=l.sourceFields(e,p),a=l.sourceFields(e,d),s=l._bindFromObject(u,p,r),n=l._bindFromObject(u,d,a)):s=l._undefinedValue[e.type],yi(s)&&(1===p.length?h.valueFields.value=s[p[0]]:h.valueFields=s),h.fields=n||{},h},_makeValue:function(e,t){var i,n,o={},r=e.length;for(i=0;r>i;i++)n=e[i],o[n]=t;return o},_bindFromArray:function(e,t){var i,n,o={};if(t)for(n=Vt.min(t.length,e.length),i=0;n>i;i++)o[t[i]]=e[i];return o},_bindFromObject:function(e,t,i){var n,o,r,a,s={};if(t)for(o=t.length,i=i||t,n=0;o>n;n++)r=t[n],a=i[n],s[r]=p(a,e);return s},sourceFields:function(e,t){var i,n,o,r,a;if(t)for(n=t.length,r=[],i=0;n>i;i++)o=t[i],a=o===$o?"field":o+"Field",r.push(e[a]||o);return r}}),ie.current=new ie,ne=Kt.extend({init:function(e,t){var i=this;Kt.fn.init.call(i,t),this.textBox=new si(e,i.options),i.append(this.textBox)},options:{position:uo,margin:pi(3),padding:pi(4),color:Mi,background:"",border:{width:1,color:""},aboveAxis:!0,vertical:!1,animation:{type:Cn,delay:Bn},zIndex:2},createVisual:function(){this.textBox.options.noclip=this.options.noclip},reflow:function(e){var t=this,i=t.options,n=i.vertical,o=i.aboveAxis,r=t.children[0],a=r.box,s=r.options.padding;r.options.align=n?Xi:zn,r.options.vAlign=n?Yo:Xi,i.position==Dn?n?(r.options.vAlign=Yo,!o&&a.height()<e.height()&&(r.options.vAlign=Hi)):r.options.align=o?yo:zn:i.position==Xi?(r.options.vAlign=Xi,r.options.align=Xi):i.position==Ln?n?r.options.vAlign=o?Hi:Yo:r.options.align=o?zn:yo:i.position==uo&&(n?e=o?new Xt(e.x1,e.y1-a.height(),e.x2,e.y1):new Xt(e.x1,e.y2,e.x2,e.y2+a.height()):(r.options.align=Xi,e=o?new Xt(e.x2,e.y1,e.x2+a.width(),e.y2):new Xt(e.x1-a.width(),e.y1,e.x1,e.y2))),i.rotation||(n?s.left=s.right=(e.width()-r.contentBox.width())/2:s.top=s.bottom=(e.height()-r.contentBox.height())/2),r.reflow(e)},alignToClipBox:function(e){var t,i=this,n=i.options.vertical,o=n?ar:rr,r=o+"1",a=o+"2",s=i.children[0],l=i.parent.box;(e[r]>l[r]||l[a]>e[a])&&(t=s.paddingBox.clone(),t[r]=Vt.max(l[r],e[r]),t[a]=Vt.min(l[a],e[a]),this.reflow(t))}}),oe=Wt.extend({init:function(e){var t=this;Wt.fn.init.call(t,e),t.createContainer(),t.createMarker(),t.createLabel()},createContainer:function(){var e=this;e.container=new $t({vertical:!1,wrap:!1,align:Xi}),e.append(e.container)},createMarker:function(){this.container.append(new ri(this.markerOptions()))},markerOptions:function(){var e=this.options,t=e.markerColor;return Ut({},e.markers,{background:t,border:{color:t}})},createLabel:function(){var e=this,t=e.options,i=Ut({},t.labels);e.container.append(new si(t.text,i))},renderComplete:function(){var e,t;Kt.fn.renderComplete.call(this),e=this.options.cursor||{},t=this._itemOverlay=Ti.Path.fromRect(this.container.box.toRect(),{fill:{color:or,opacity:0},stroke:null,cursor:e.style||e}),this.appendVisual(t)},click:function(e,t){var i=this.eventArgs(t);e.trigger(Fn,i)||(t.preventDefault(),e._legendItemClick(i.seriesIndex,i.pointIndex))},hover:function(e,t){var i=this.eventArgs(t);return e.trigger(Mn,i)||(t.preventDefault(),e._legendItemHover(i.seriesIndex,i.pointIndex)),!0},leave:function(e){e._unsetActivePoint()},eventArgs:function(t){var i=this.options;return{element:e(t.target),text:i.text,series:i.series,seriesIndex:i.series.index,pointIndex:i.pointIndex}},renderVisual:function(){var e=this,t=e.options,i=t.visual;i?(e.visual=i({active:t.active,series:t.series,pointIndex:t.pointIndex,options:{markers:e.markerOptions(),labels:t.labels},createVisual:function(){e.createVisual(),e.renderChildren(),e.renderComplete();var t=e.visual;return delete e.visual,t}}),this.addVisual()):Kt.fn.renderVisual.call(e)}}),re=Kt.extend({render:function(){var e,t,i=this.children,n=this.options,o=n.vertical;for(this.visual=new Ti.Layout(null,{spacing:o?0:n.spacing,lineSpacing:o?n.spacing:0,orientation:o?"vertical":"horizontal"}),t=0;i.length>t;t++)e=i[t],e.reflow(new Xt),e.renderVisual()},reflow:function(e){this.visual.rect(e.toRect()),this.visual.reflow();var t=this.visual.clippedBBox();this.box=t?Gt.rectToBox(t):new Xt},renderVisual:function(){this.addVisual()},createVisual:Bt}),ae=Kt.extend({init:function(e){var t=this;Kt.fn.init.call(t,e),di(t.options.position,[Yo,yo,Hi,zn,on])||(t.options.position=yo),t.createContainer(),t.createItems()},options:{position:yo,items:[],labels:{margin:{left:6}},offsetX:0,offsetY:0,margin:pi(5),padding:pi(5),border:{color:Mi,width:0},item:{cursor:go},spacing:6,background:"",zIndex:1,markers:{border:{width:1},width:7,height:7,type:"rect",align:zn,vAlign:Xi}},createContainer:function(){var e=this,t=e.options,i=t.align,n=t.position,o=n,r=Xi;n==on?o=zn:di(n,[Yo,Hi])?(o="start"==i?zn:"end"==i?yo:Xi,r=n):i&&("start"==i?r=Yo:"end"==i&&(r=Hi)),e.container=new Wt({margin:t.margin,padding:t.padding,background:t.background,border:t.border,vAlign:r,align:o,zIndex:t.zIndex,shrinkToFit:!0}),e.append(e.container)},createItems:function(){var e,t,i,n=this,o=n.options,r=o.items,a=r.length,s=n.isVertical();for(e=new re({vertical:s,spacing:o.spacing}),o.reverse&&(r=r.slice(0).reverse()),t=0;a>t;t++)i=r[t],e.append(new oe(Ut({},{markers:o.markers,labels:o.labels},o.item,i)));e.render(),n.container.append(e)},isVertical:function(){var e=this,t=e.options,i=t.orientation,n=t.position,o=n==on&&i!=In||(yi(i)?i!=In:di(n,[zn,yo]));return o},hasItems:function(){return this.container.children[0].children.length>0},reflow:function(e){var i=this,n=i.options;return e=e.clone(),i.hasItems()?(n.position===on?(i.containerCustomReflow(e),i.box=e):i.containerReflow(e),t):(i.box=e,t)},containerReflow:function(e){var t,i=this,n=i.options,o=n.position,r=o==Yo||o==Hi?rr:ar,a=e.clone(),s=i.container,l=n.width,c=n.height,u=i.isVertical(),h=e.clone();(o==zn||o==yo)&&(a.y1=h.y1=0),u&&c?(a.y2=a.y1+c,a.align(h,ar,s.options.vAlign)):!u&&l&&(a.x2=a.x1+l,a.align(h,rr,s.options.align)),s.reflow(a),a=s.box,t=a.clone(),(n.offsetX||n.offsetY)&&(a.translate(n.offsetX,n.offsetY),i.container.reflow(a)),t[r+1]=e[r+1],t[r+2]=e[r+2],i.box=t},containerCustomReflow:function(e){var t=this,i=t.options,n=i.offsetX,o=i.offsetY,r=t.container,a=i.width,s=i.height,l=t.isVertical(),c=e.clone();l&&s?c.y2=c.y1+s:!l&&a&&(c.x2=c.x1+a),r.reflow(c),c=r.box,r.reflow(Xt(n,o,n+c.width(),o+c.height()))},renderVisual:function(){this.hasItems()&&Kt.fn.renderVisual.call(this)}}),se=qt.extend({init:function(e){var t=this;e=e||{},this._initFields(),this._initCategories(e),qt.fn.init.call(t,e)},_initFields:function(){this._ticks={},this.outOfRangeMin=0,this.outOfRangeMax=0},_initCategories:function(e){var t,i,n=(e.categories||[]).slice(0),o=yi(e.min),r=yi(e.max);e.categories=n,(o||r)&&n.length&&(e.srcCategories=e.categories,t=o?Vt.floor(e.min):0,i=r?e.justified?Vt.floor(e.max)+1:Vt.ceil(e.max):n.length,e.categories=e.categories.slice(t,i))},options:{type:Yi,categories:[],vertical:!1,majorGridLines:{visible:!1,width:1,color:Mi},labels:{zIndex:1},justified:!1},rangeIndices:function(){var e,t=this.options,i=t.categories.length||1,n=B(t.min)?t.min%1:0;return e=B(t.max)&&t.max%1!==0&&t.max<this.totalRange().max?i-(1-t.max%1):i-(t.justified?1:0),{min:n,max:e}},totalRangeIndices:function(e){var t,i,n=this.options,o=B(n.min)?n.min:0;return t=B(n.max)?n.max:B(n.min)?o+n.categories.length:(n.srcCategories||n.categories).length-(n.justified?1:0)||1,e&&(i=this.totalRange(),o=wi(o,0,i.max),t=wi(t,0,i.max)),{min:o,max:t}},range:function(){var e=this.options;return{min:B(e.min)?e.min:0,max:B(e.max)?e.max:e.categories.length}},totalRange:function(){var e=this.options;return{min:0,max:Vt.max(this._seriesMax||0,(e.srcCategories||e.categories).length)-(e.justified?1:0)}},getScale:function(){var e=this.rangeIndices(),t=e.min,i=e.max,n=this.lineBox(),o=this.options.vertical?n.height():n.width(),r=o/(i-t||1);return r*(this.options.reverse?-1:1)},getTickPositions:function(e){for(var t=this,i=t.options,n=i.vertical,o=t.lineBox(),r=i.reverse,a=t.getScale(),s=t.rangeIndices(),l=s.min,c=s.max,u=l%1!==0?Vt.floor(l/1)+e:l,h=o[(n?ar:rr)+(r?2:1)],p=[];c>=u;)p.push(h+mi(a*(u-l),en)),u+=e;return p},getLabelsTickPositions:function(){var e=this.getMajorTickPositions().slice(0),t=this.rangeIndices(),i=this.getScale(),n=this.lineBox(),o=this.options,r=o.vertical?ar:rr,a=o.reverse?2:1,s=o.reverse?1:2;return t.min%1!==0&&e.unshift(n[r+a]-i*(t.min%1)),t.max%1!==0&&e.push(n[r+s]+i*(1-t.max%1)),e},labelTickIndex:function(e){var t=e.index,i=this.rangeIndices();return i.min>0&&(t-=Vt.floor(i.min)),t},arrangeLabels:function(){qt.fn.arrangeLabels.call(this),this.hideOutOfRangeLabels()},hideOutOfRangeLabels:function(){var e=this.box,t=this.labels,i=this.options.vertical?ar:rr,n=e[i+1],o=e[i+2],r=t[0],a=bi(t);t.length&&((r.box[i+1]>o||n>r.box[i+2])&&(r.options.visible=!1),(a.box[i+1]>o||n>a.box[i+2])&&(a.options.visible=!1))},getMajorTickPositions:function(){return this.getTicks().majorTicks},getMinorTickPositions:function(){return this.getTicks().minorTicks},getTicks:function(){var e,t=this,i=t._ticks,n=t.options,o=t.rangeIndices(),r=n.reverse,a=n.justified,s=t.lineBox();return e=s.getHash()+o.min+","+o.max+r+a,i._hash!==e&&(i._hash=e,i.majorTicks=t.getTickPositions(1),i.minorTicks=t.getTickPositions(.5)),i},getSlot:function(e,t,i){var n,o,r=this,a=r.options,s=a.reverse,l=a.justified,c=a.vertical?ar:rr,u=r.lineBox(),h=r.rangeIndices(),p=h.min,d=this.getScale(),f=u[c+(s?2:1)],g=u.clone(),m=!yi(t);return e=Si(e,0),t=Si(t,e),t=Vt.max(t-1,e),t=Vt.max(e,t),n=f+(e-p)*d,o=f+(t+1-p)*d,m&&l&&(o=n),i&&(n=wi(n,u[c+1],u[c+2]),o=wi(o,u[c+1],u[c+2])),g[c+1]=s?o:n,g[c+2]=s?n:o,g},pointCategoryIndex:function(e){var t,i,n,o=this,r=o.options,a=r.reverse,s=r.justified,l=r.vertical?ar:rr,c=o.lineBox(),u=o.rangeIndices(),h=a?u.max:u.min,p=this.getScale(),d=c[l+1],f=c[l+2],g=e[l];return d>g||g>f?null:(t=g-d,i=t/p,i=h+i,n=i%1,s?i=Vt.round(i):0===n&&i>0&&i--,Vt.floor(i))},getCategory:function(e){var t=this.pointCategoryIndex(e);return null===t?null:this.options.categories[t]},categoryIndex:function(e){var t=this.options,i=M(e,t.srcCategories||t.categories);return i-Vt.floor(t.min||0)},translateRange:function(e){var t=this,i=t.options,n=t.lineBox(),o=i.vertical?n.height():n.width(),r=i.categories.length,a=o/r,s=mi(e/a,un);return{min:s,max:r+s}},zoomRange:function(e){var i=this.totalRangeIndices(),n=this.totalRange(),o=n.max,r=n.min,a=wi(i.min+e,r,o),s=wi(i.max-e,r,o);return s-a>0?{min:a,max:s}:t},scaleRange:function(e){var t=this,i=t.options,n=i.categories.length,o=e*n;return{min:-o,max:n+o}},labelsCount:function(){var e=this.labelsRange();return e.max-e.min},labelsRange:function(){var e,t=this.options,i=t.labels,n=t.justified,o=this.totalRangeIndices(!0),r=o.min,a=o.max,s=Vt.floor(r);return n?(r=Vt.ceil(r),a=Vt.floor(a)):(r=Vt.floor(r),a=Vt.ceil(a)),e=r>i.skip?i.skip+i.step*Vt.ceil((r-i.skip)/i.step):i.skip,{min:e-s,max:(t.categories.length?a+(n?1:0):0)-s}},createAxisLabel:function(e,t){var i=this,n=i.options,o=n.dataItems?n.dataItems[e]:null,r=Si(n.categories[e],""),a=i.axisLabelText(r,o,t);return new Yt(r,a,e,o,t)},shouldRenderNote:function(e){var t=this.options.categories;return t.length&&t.length>e&&e>=0},pan:function(e){var t=this.totalRangeIndices(!0),i=this.getScale(),n=mi(e/i,un),o=this.totalRange(),r=t.min+n,a=t.max+n;return this.limitRange(r,a,0,o.max,n)},pointsRange:function(e,t){var i=this,n=i.options,o=n.reverse,r=n.vertical?ar:rr,a=i.lineBox(),s=i.totalRangeIndices(!0),l=this.getScale(),c=a[r+(o?2:1)],u=e[r]-c,h=t[r]-c,p=s.min+u/l,d=s.min+h/l;return{min:Vt.min(p,d),max:Vt.max(p,d)}}}),le=se.extend({init:function(e){var t,i,n=this;e=e||{},e=Ut({roundToBaseUnit:!0},e,{categories:f(e.categories),min:f(e.min),max:f(e.max)}),e.userSetBaseUnit=e.userSetBaseUnit||e.baseUnit,e.userSetBaseUnitStep=e.userSetBaseUnitStep||e.baseUnitStep,e.categories&&e.categories.length>0?(t=(e.baseUnit||"").toLowerCase(),i=t!==Li&&!di(t,dr),i&&(e.baseUnit=n.defaultBaseUnit(e)),(t===Li||e.baseUnitStep===Bi)&&n.autoBaseUnit(e),this._groupsStart=m(e.categories[0],0,e.baseUnit,e.weekStartDay),n.groupCategories(e)):e.baseUnit=e.baseUnit||sn,this._initFields(),qt.fn.init.call(n,e)},options:{type:an,labels:{dateFormats:gr},autoBaseUnitSteps:{seconds:[1,2,5,15,30],minutes:[1,2,5,15,30],hours:[1,2,3],days:[1,2,3],weeks:[1,2],months:[1,2,3,6],years:[1,2,3,5,10,25,50]},maxDateGroups:10},shouldRenderNote:function(e){var t=this,i=t.range(),n=t.options.categories||[];return hi(e,i.min)>=0&&hi(e,i.max)<=0&&n.length},parseNoteValue:function(e){return f(e)},translateRange:function(e){var t,i,n=this,o=n.options,r=o.baseUnit,a=o.weekStartDay,s=n.lineBox(),l=o.vertical?s.height():s.width(),c=n.range(),u=l/(c.max-c.min),h=mi(e/u,un);return c.min&&c.max&&(t=_(o.min||c.min,h),i=_(o.max||c.max,h),c={min:m(t,0,r,a),max:m(i,0,r,a)}),c},scaleRange:function(e){var t,i=this,n=Vt.abs(e),o=i.range(),r=o.min,a=o.max;if(o.min&&o.max){for(;n--;)o=b(r,a),t=Vt.round(.1*o),0>e?(r=_(r,t),a=_(a,-t)):(r=_(r,-t),a=_(a,t));o={min:r,max:a}}return o},defaultBaseUnit:function(e){var t,i,n,o,r,a=e.categories,s=yi(a)?a.length:0,l=Yn;for(t=0;s>t;t++)i=a[t],i&&o&&(n=w(i,o),n>0&&(l=Vt.min(l,n),r=l>=jo?sr:l>=No-3*Uo?Zn:l>=Ho?nr:l>=Uo?sn:l>=Mo?Vn:l>=Fo?Kn:Co)),o=i;return r||sn},_categoryRange:function(e){var t=e._range;return t||(t=e._range=_i(e)),t},totalRange:function(){return{min:0,max:this.options.categories.length}},rangeIndices:function(){var e=this.options,t=e.baseUnit,i=e.baseUnitStep||1,n=e.categories,o=this.categoriesRange(),r=f(e.min||o.min),a=f(e.max||o.max),s=0,l=0;return n.length&&(s=C(r,n[0],t,i),l=C(a,n[0],t,i),e.roundToBaseUnit&&(s=Vt.floor(s),l=e.justified?Vt.floor(l):Vt.ceil(l))),{min:s,max:l}},labelsRange:function(){var e=this.options,t=e.labels,i=this.rangeIndices(),n=Vt.floor(i.min),o=Vt.ceil(i.max);return{min:n+t.skip,max:e.categories.length?o+(e.justified?1:0):0}},categoriesRange:function(){var e=this.options,t=this._categoryRange(e.srcCategories||e.categories),i=f(t.max);return!e.justified&&I(i,this._roundToTotalStep(i,e,!1))&&(i=this._roundToTotalStep(i,e,!0,!0)),{min:f(t.min),max:i}},currentRange:function(){var e=this.options,t=e.roundToBaseUnit!==!1,i=this.categoriesRange(),n=e.min,o=e.max;return n||(n=t?this._roundToTotalStep(i.min,e,!1):i.min),o||(o=t?this._roundToTotalStep(i.max,e,!e.justified):i.max),{min:n,max:o}},datesRange:function(){var e=this._categoryRange(this.options.srcCategories||this.options.categories);return{min:f(e.min),max:f(e.max)}},pan:function(e){var i,n,o,r=this,a=r.options,s=a.baseUnit,l=r.lineBox(),c=a.vertical?l.height():l.width(),u=this.currentRange(),h=this.totalLimits(),p=u.min,d=u.max,m=c/(d-p),x=mi(e/m,un);return n=_(p,x),o=_(d,x),i=this.limitRange(g(n),g(o),g(h.min),g(h.max),x),i?(i.min=f(i.min),i.max=f(i.max),i.baseUnit=s,i.baseUnitStep=a.baseUnitStep||1,i.userSetBaseUnit=a.userSetBaseUnit,i.userSetBaseUnitStep=a.userSetBaseUnitStep,i):t},pointsRange:function(e,t){var i=se.fn.pointsRange.call(this,e,t),n=this.currentRange(),o=this.rangeIndices(),r=b(n.max,n.min)/(o.max-o.min),a=this.options,s=_(n.min,i.min*r),l=_(n.min,i.max*r);return{min:s,max:l,baseUnit:a.userSetBaseUnit,baseUnitStep:a.userSetBaseUnitStep}},zoomRange:function(e){var i,n,o,r,a,s,l,c,u,h=this.options,p=this.totalLimits(),d=this.currentRange(),g=h.baseUnit,x=h.baseUnitStep||1,v=h.weekStartDay,y=d.max,w=d.min,A=m(w,e*x,g,v),C=m(y,-e*x,g,v);if(h.userSetBaseUnit==Li)if(i=h.autoBaseUnitSteps,n=h.maxDateGroups,o=M(g,dr),a=b(C,A),s=bi(i[g])*n*Go[g],l=b(y,w),Go[g]>a&&g!==Co)g=dr[o-1],r=bi(i[g]),c=(l-(n-1)*r*Go[g])/2,A=_(w,c),C=_(y,-c);else if(a>s&&g!==sr){u=0;do{o++,g=dr[o],u=0,c=2*Go[g];do r=i[g][u],u++;while(i[g].length>u&&l>c*r)}while(g!==sr&&l>c*r);c=(c*r-l)/2,c>0&&(A=_(w,-c),C=_(y,c),A=_(A,wi(C,p.min,p.max)-C),C=_(C,wi(A,p.min,p.max)-A))}return A=f(wi(A,p.min,p.max)),C=f(wi(C,p.min,p.max)),b(C,A)>0?{min:A,max:C,baseUnit:h.userSetBaseUnit,baseUnitStep:h.userSetBaseUnitStep}:t},totalLimits:function(){var e=this.options,t=this.datesRange(),i=this._roundToTotalStep(f(t.min),e,!1),n=t.max;return e.justified||(n=this._roundToTotalStep(n,e,!0,I(n,this._roundToTotalStep(n,e,!1)))),{min:i,max:n}},range:function(e){e=e||this.options;var t=e.categories,i=e.baseUnit===Li,n=i?dr[0]:e.baseUnit,o=e.baseUnitStep||1,r={baseUnit:n,baseUnitStep:o,weekStartDay:e.weekStartDay},a=this._categoryRange(t),s=f(e.min||a.min),l=f(e.max||a.max);return{min:this._roundToTotalStep(s,r,!1),max:this._roundToTotalStep(l,r,!0,!0)}},autoBaseUnit:function(e){for(var t,i,n,o=this,r=this._categoryRange(e.categories),a=f(e.min||r.min),s=f(e.max||r.max),l=e.baseUnit===Li,c=0,u=l?dr[c++]:e.baseUnit,h=s-a,p=h/Go[u],d=p,g=e.maxDateGroups||o.options.maxDateGroups,m=Ut({},o.options.autoBaseUnitSteps,e.autoBaseUnitSteps);!i||p>=g;)if(t=t||m[u].slice(0),n=t.shift())i=n,p=d/i;else{if(u===bi(dr)){i=Vt.ceil(d/g);break}if(!l){p>g&&(i=Vt.ceil(d/g));break}u=dr[c++]||bi(dr),d=h/Go[u],t=null}e.baseUnitStep=i,e.baseUnit=u},_timeScale:function(){var e,t,i,n=this,o=n.range(),r=n.options,a=n.lineBox(),s=r.vertical,l=s?a.height():a.width();return r.justified&&r._collapse!==!1?(t=this._categoryRange(r.categories),i=g(t.max),e=f(i)-o.min):e=o.max-o.min,l/e},groupCategories:function(e){var t,i,n=this,o=e.categories,r=f(Ci(o)),a=e.baseUnit,s=e.baseUnitStep||1,l=n.range(e),c=l.max,u=[];for(t=l.min;c>t&&(u.push(t),i=m(t,s,a,e.weekStartDay),!(i>r)||e.max);t=i);e.srcCategories=o,e.categories=u},_roundToTotalStep:function(e,t,i,n){var o,r,a,s,l;return t=t||this.options,o=t.baseUnit,r=t.baseUnitStep||1,a=this._groupsStart,a?(s=C(e,a,o,r),l=i?Vt.ceil(s):Vt.floor(s),n&&l++,m(a,l*r,o,t.weekStartDay)):m(e,i?r:0,o,t.weekStartDay)},createAxisLabel:function(e,i){var n,o,r=this.options,a=r.dataItems?r.dataItems[e]:null,s=r.categories[e],l=r.baseUnit,c=!0,u=i.dateFormats[l];return r.justified?(n=v(s,l,r.weekStartDay),c=I(n,s)):r.roundToBaseUnit||(c=!I(this.range().max,s)),c&&(i.format=i.format||u,o=this.axisLabelText(s,a,i))?new Yt(s,o,e,a,i):t},categoryIndex:function(e){var t=this,i=t.options,n=i.categories,o=-1;return n.length&&(o=Vt.floor(C(f(e),n[0],i.baseUnit,i.baseUnitStep||1))),o},getSlot:function(e,t,i){var n=this;return typeof e===lo&&(e=n.categoryIndex(e)),typeof t===lo&&(t=n.categoryIndex(t)),se.fn.getSlot.call(n,e,t,i)}}),ce=qt.extend({init:function(e,t,i){var n=this;i=i||{},Ut(i,{min:f(i.min),max:f(i.max),axisCrossingValue:f(i.axisCrossingValues||i.axisCrossingValue)}),i=n.applyDefaults(f(e),f(t),i),qt.fn.init.call(n,i)},options:{type:an,majorGridLines:{visible:!0,width:1,color:Mi},labels:{dateFormats:gr}},applyDefaults:function(e,i,n){var o=this,r=n.min||e,a=n.max||i,s=n.baseUnit||(a&&r?o.timeUnits(w(a,r)):Vn),l=Go[s],c=v(g(r)-1,s)||f(a),u=y(g(a)+1,s),h=n.majorUnit?n.majorUnit:t,p=h||Gt.ceil(Gt.autoMajorUnit(c.getTime(),u.getTime()),l)/l,d=A(c,u,s),x=Gt.ceil(d,p),b=x-d,_=Vt.floor(b/2),C=b-_;return n.baseUnit||delete n.baseUnit,n.baseUnit=n.baseUnit||s,n.min=n.min||m(c,-_,s),n.max=n.max||m(u,C,s),n.minorUnit=n.minorUnit||p/5,n.majorUnit=p,this.totalMin=g(v(g(e)-1,s)),this.totalMax=g(y(g(i)+1,s)),n},range:function(){var e=this.options;return{min:e.min,max:e.max}},getDivisions:function(e){var t=this.options;return Vt.floor(A(t.min,t.max,t.baseUnit)/e+1)},getTickPositions:function(e){var t,i,n,o=this.options,r=o.vertical,a=o.reverse,s=this.lineBox(),l=(r?-1:1)*(a?-1:1),c=1===l?1:2,u=s[(r?ar:rr)+c],h=this.getDivisions(e),p=b(o.max,o.min),d=r?s.height():s.width(),f=d/p,g=[u];for(t=1;h>t;t++)i=m(o.min,t*o.majorUnit,o.baseUnit),n=u+b(i,o.min)*f*l,g.push(mi(n,en));return g},getMajorTickPositions:function(){var e=this;return e.getTickPositions(e.options.majorUnit)},getMinorTickPositions:function(){var e=this;return e.getTickPositions(e.options.minorUnit)},getSlot:function(e,t,i){return ti.fn.getSlot.call(this,f(e),f(t),i)},getValue:function(e){var t=ti.fn.getValue.call(this,e);return null!==t?f(t):null},labelsCount:function(){return this.getDivisions(this.options.majorUnit)},createAxisLabel:function(e,t){var i,n,o=this.options,r=e*o.majorUnit,a=o.min;return r>0&&(a=m(a,r,o.baseUnit)),i=t.dateFormats[o.baseUnit],t.format=t.format||i,n=this.axisLabelText(a,null,t),new Yt(a,n,e,null,t)},timeUnits:function(e){var t=Vn;return e>=jo?t=sr:e>=No?t=Zn:e>=Ho?t=nr:e>=Uo&&(t=sn),t},translateRange:function(e,t){var i=this,n=i.options,o=n.baseUnit,r=n.weekStartDay,a=i.lineBox(),s=n.vertical?a.height():a.width(),l=i.range(),c=s/b(l.max,l.min),u=mi(e/c,un),h=_(n.min,u),p=_(n.max,u);return t||(h=m(h,0,o,r),p=m(p,0,o,r)),{min:h,max:p}},scaleRange:function(e){for(var t,i,n=this,o=n.options,r=Vt.abs(e),a=o.min,s=o.max;r--;)t=b(a,s),i=Vt.round(.1*t),0>e?(a=_(a,i),s=_(s,-i)):(a=_(a,-i),s=_(s,i));return{min:a,max:s}},shouldRenderNote:function(e){var t=this.range();return hi(e,t.min)>=0&&hi(e,t.max)<=0},pan:function(e){var i=this.translateRange(e,!0),n=this.limitRange(g(i.min),g(i.max),this.totalMin,this.totalMax);return n?{min:f(n.min),max:f(n.max)}:t},pointsRange:function(e,t){var i=this.getValue(e),n=this.getValue(t),o=Vt.min(i,n),r=Vt.max(i,n);return{min:f(o),max:f(r)}},zoomRange:function(e){var t=this.scaleRange(e),i=f(wi(g(t.min),this.totalMin,this.totalMax)),n=f(wi(g(t.max),this.totalMin,this.totalMax));return{min:i,max:n}}}),ue=Kt.extend({options:{vertical:!1,gap:0,spacing:0},reflow:function(e){var t,i,n=this,o=n.options,r=o.vertical,a=r?ar:rr,s=n.children,l=o.gap,c=o.spacing,u=s.length,h=u+l+c*(u-1),p=(r?e.height():e.width())/h,d=e[a+1]+p*(l/2);for(i=0;u>i;i++)t=(s[i].box||e).clone(),t[a+1]=d,t[a+2]=d+p,s[i].reflow(t),u-1>i&&(d+=p*c),d+=p}}),he=Kt.extend({options:{vertical:!0},reflow:function(e){var t,i,n,o=this.options,r=o.vertical,a=r?rr:ar,s=this.children,l=this.box=new Xt,c=s.length;for(t=0;c>t;t++)i=s[t],i.visible!==!1&&(n=i.box.clone(),n.snapTo(e,a),0===t&&(l=this.box=n.clone()),i.reflow(n),l.wrap(n))}}),pe={click:function(e,t){return e.trigger(To,this.eventArgs(t))},hover:function(e,t){return e.trigger(Io,this.eventArgs(t))},eventArgs:function(t){return{value:this.value,percentage:this.percentage,category:this.category,series:this.series,dataItem:this.dataItem,runningTotal:this.runningTotal,total:this.total,element:e((t||{}).target),originalEvent:t,point:this}}},de={createNote:function(){var e=this,t=e.options.notes,i=e.noteText||t.label.text;t.visible!==!1&&yi(i)&&null!==i&&(e.note=new Jt(e.value,i,e.dataItem,e.category,e.series,e.options.notes),e.append(e.note))}},fe=Kt.extend({init:function(e,t){var i=this;Kt.fn.init.call(i),i.options=t,i.color=t.color||or,i.aboveAxis=Si(i.options.aboveAxis,!0),i.value=e},defaults:{border:{width:1},vertical:!0,overlay:{gradient:Tn},labels:{visible:!1,format:"{0}"},opacity:1,notes:{label:{}}},render:function(){this._rendered||(this._rendered=!0,this.createLabel(),this.createNote(),this.errorBar&&this.append(this.errorBar))},createLabel:function(){var e,t,i=this.options,n=i.labels;n.visible&&(n.template?(t=jt(n.template),e=t({dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total,series:this.series})):e=this.formatValue(n.format),this.label=new ne(e,Ut({vertical:i.vertical},i.labels)),this.append(this.label))},formatValue:function(e){return this.owner.formatPointValue(this,e)},reflow:function(e){var t,i,n;if(this.render(),t=this,i=t.label,t.box=e,i&&(i.options.aboveAxis=t.aboveAxis,i.reflow(e)),t.note&&t.note.reflow(e),t.errorBars)for(n=0;t.errorBars.length>n;n++)t.errorBars[n].reflow(e)},createVisual:function(){var e,t=this,i=t.box,n=t.options,o=n.visual;t.visible!==!1&&(Kt.fn.createVisual.call(t),o?(e=this.rectVisual=o({category:t.category,dataItem:t.dataItem,value:t.value,sender:t.getChart(),series:t.series,percentage:t.percentage,runningTotal:t.runningTotal,total:t.total,rect:i.toRect(),createVisual:function(){var e=new Ti.Group;return t.createRect(e),e},options:n}),e&&t.visual.append(e)):i.width()>0&&i.height()>0&&t.createRect(t.visual))},createRect:function(e){var i,n,o,r,a=this.options,s=a.border,l=yi(s.opacity)?s.opacity:a.opacity,c=this.box.toRect();c.size.width=Math.round(c.size.width),i=this.rectVisual=Ti.Path.fromRect(c,{fill:{color:this.color,opacity:a.opacity},stroke:{color:this.getBorderColor(),width:s.width,opacity:l,dashType:s.dashType}}),n=this.box.width(),o=this.box.height(),r=a.vertical?n:o,r>Oi&&(ci(i),(1>n||1>o)&&(i.options.stroke.lineJoin="round")),e.append(i),Y(a)&&e.append(this.createGradientOverlay(i,{baseColor:this.color},Ut({end:a.vertical?t:[0,1]},a.overlay)))},createHighlight:function(e){var t=Ti.Path.fromRect(this.box.toRect(),e);return ci(t)},highlightVisual:function(){return this.rectVisual},highlightVisualArgs:function(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}},getBorderColor:function(){var e=this,t=e.options,i=e.color,n=t.border,o=n.color,r=n._brightness||zi;return yi(o)||(o=new Zt(i).brightness(r).toHex()),o},tooltipAnchor:function(e,t){var i,n,o,r,a=this,s=a.options,l=a.box,c=s.vertical,u=a.aboveAxis,h=a.owner.pane.clipBox()||l;return c?(i=l.x2+Wo,n=u?Vt.max(l.y1,h.y1):Vt.min(l.y2,h.y2)-t):(o=Vt.max(l.x1,h.x1),r=Vt.min(l.x2,h.x2),s.isStacked?(i=u?r-e:o,n=l.y1-t-Wo):(i=u?r+Wo:o-e-Wo,n=l.y1)),new ii(i,n)},overlapsBox:function(e){return this.box.overlaps(e)}}),Ut(fe.fn,pe),Ut(fe.fn,de),ge=Ti.Animation.extend({options:{duration:Bn},setup:function(){var e,t,i=this.element,n=this.options,o=i.bbox();o?(this.origin=n.origin,e=n.vertical?ar:rr,t=this.fromScale=new Pi.Point(1,1),t[e]=Ro,i.transform(Pi.transform().scale(t.x,t.y))):this.abort()},step:function(e){var t=fi(this.fromScale.x,1,e),i=fi(this.fromScale.y,1,e);this.element.transform(Pi.transform().scale(t,i,this.origin))},abort:function(){Ti.Animation.fn.abort.call(this),this.element.transform(null)}}),Ti.AnimationFactory.current.register(Ei,ge),me=Ti.Animation.extend({options:{duration:200,easing:Nn},setup:function(){this.fadeTo=this.element.opacity(),this.element.opacity(0)},step:function(e){this.element.opacity(e*this.fadeTo)}}),Ti.AnimationFactory.current.register(Cn,me),xe=function(e,t,i){var n=this;n.initGlobalRanges(e,t,i)},xe.prototype=xe.fn={percentRegex:/percent(?:\w*)\((\d+)\)/,standardDeviationRegex:RegExp("^"+Do+"(?:\\((\\d+(?:\\.\\d+)?)\\))?$"),initGlobalRanges:function(e,t,i){var n,o,r,a,s,l=this,c=t.data,u=l.standardDeviationRegex.exec(e);u?(l.valueGetter=l.createValueGetter(t,i),n=l.getAverage(c),o=l.getStandardDeviation(c,n,!1),r=u[1]?parseFloat(u[1]):1,a={low:n.value-o*r,high:n.value+o*r},l.globalRange=function(){return a}):e.indexOf&&e.indexOf(Lo)>=0&&(l.valueGetter=l.createValueGetter(t,i),s=l.getStandardError(c,l.getAverage(c)),l.globalRange=function(e){return{low:e-s,high:e+s}})},createValueGetter:function(e,t){var i,n,o,r=e.data,a=ie.current,s=a.valueFields(e),l=yi(r[0])?r[0]:{};return Tt(l)?(i=t?M(t,s):0,o=Ht("["+i+"]")):B(l)?o=Ht():typeof l===lo&&(n=a.sourceFields(e,s),o=Ht(n[M(t,s)])),o},getErrorRange:function(e,t){var i,n,o,r,a=this;if(yi(t)){if(a.globalRange)return a.globalRange(e);if(Tt(t))i=e-t[0],n=e+t[1];else if(B(o=parseFloat(t)))i=e-o,n=e+o;else{if(!(o=a.percentRegex.exec(t)))throw Error("Invalid ErrorBar value: "+t);r=e*(parseFloat(o[1])/100),i=e-Vt.abs(r),n=e+Vt.abs(r)}return{low:i,high:n}}},getStandardError:function(e,t){return this.getStandardDeviation(e,t,!0)/Vt.sqrt(t.count)},getStandardDeviation:function(e,t,i){var n,o,r=0,a=e.length,s=i?t.count-1:t.count;for(o=0;a>o;o++)n=this.valueGetter(e[o]),B(n)&&(r+=Vt.pow(n-t.value,2));return Vt.sqrt(r/s)},getAverage:function(e){var t,i,n=0,o=0,r=e.length;for(i=0;r>i;i++)t=this.valueGetter(e[i]),B(t)&&(n+=t,o++);return{value:n/o,count:o}}},ve=Kt.extend({init:function(e,t){var i=this;Kt.fn.init.call(i,t),i.plotArea=e,i.categoryAxis=e.seriesCategoryAxis(t.series[0]),i.valueAxisRanges={},i.points=[],i.categoryPoints=[],i.seriesPoints=[],i.seriesOptions=[],i._evalSeries=[],i.render()},options:{series:[],invertAxes:!1,isStacked:!1,clip:!0},render:function(){var e=this;e.traverseDataPoints(Dt(e.addValue,e))},pointOptions:function(e,t){var i,n=this.seriesOptions[t];return n||(i=this.pointType().fn.defaults,this.seriesOptions[t]=n=Ut({},i,{vertical:!this.options.invertAxes},e)),n},plotValue:function(e){var t,i,n,o,r,a,s,l;if(!e)return 0;if(this.options.isStacked100&&B(e.value)){for(t=e.categoryIx,i=this.categoryPoints[t],n=0,o=[],r=0;i.length>r;r++)if(a=i[r]){if(s=e.series.stack,l=a.series.stack,s&&l&&s.group!==l.group)continue;B(a.value)&&(n+=Vt.abs(a.value),o.push(Vt.abs(a.value)))}if(n>0)return e.value/n}return e.value},plotRange:function(e,t){var i,n,o,r,a,s,l,c,u,h,p,d,f=e.categoryIx,g=this.categoryPoints[f];if(this.options.isStacked){for(t=t||0,i=this.plotValue(e),n=i>=0,o=t,r=!1,a=0;g.length>a&&(s=g[a],e!==s);a++){if(l=e.series.stack,c=s.series.stack,l&&c){if(typeof l===Eo&&l!==c)continue;if(l.group&&l.group!==c.group)continue}u=this.plotValue(s),(u>=0&&n||0>u&&!n)&&(o+=u,i+=u,r=!0,this.options.isStacked100&&(i=Vt.min(i,1)))}return r&&(o-=t),[o,i]}return h=e.series,p=this.seriesValueAxis(h),d=this.categoryAxisCrossingValue(p),[d,e.value||d]},stackLimits:function(e,t){var i,n,o,r,a,s=Yn,l=Wn;for(i=0;this.categoryPoints.length>i;i++)for(n=this.categoryPoints[i],o=0;n.length>o;o++)r=n[o],r&&(r.series.stack===t||r.series.axis===e)&&(a=this.plotRange(r,0)[1],yi(a)&&isFinite(a)&&(l=Vt.max(l,a),s=Vt.min(s,a)));return{min:s,max:l}},updateStackRange:function(){var e,t,i,n,o,r,a=this,s=a.options.series,l=a.options.isStacked,c={};if(l)for(t=0;s.length>t;t++)i=s[t],n=i.axis,o=n+i.stack,e=c[o],e||(e=a.stackLimits(n,i.stack),r=a.errorTotals,r&&(r.negative.length&&(e.min=Vt.min(e.min,Ai(r.negative))),r.positive.length&&(e.max=Vt.max(e.max,Ci(r.positive)))),e.min!==Yn||e.max!==Wn?c[o]=e:e=null),e&&(a.valueAxisRanges[n]=e)},addErrorBar:function(e,t,i){var n,o=this,r=e.value,a=e.series,s=e.seriesIx,l=e.options.errorBars,c=t.fields[vn],u=t.fields[yn];B(c)&&B(u)?n={low:c,high:u}:l&&yi(l.value)&&(o.seriesErrorRanges=o.seriesErrorRanges||[],o.seriesErrorRanges[s]=o.seriesErrorRanges[s]||new xe(l.value,a,$o),n=o.seriesErrorRanges[s].getErrorRange(r,l.value)),n&&(e.low=n.low,e.high=n.high,o.addPointErrorBar(e,i))},addPointErrorBar:function(e,t){var i,n,o,r=this,a=e.series,s=e.low,l=e.high,c=!r.options.invertAxes,u=e.options.errorBars;r.options.isStacked?(n=r.stackedErrorRange(e,t),s=n.low,l=n.high):(o={categoryIx:t,series:a},r.updateRange({value:s},o),r.updateRange({
value:l},o)),i=new Se(s,l,c,r,a,u),e.errorBars=[i],e.append(i)},stackedErrorRange:function(e,t){var i=this,n=i.plotRange(e,0)[1]-e.value,o=e.low+n,r=e.high+n;return i.errorTotals=i.errorTotals||{positive:[],negative:[]},0>o&&(i.errorTotals.negative[t]=Vt.min(i.errorTotals.negative[t]||0,o)),r>0&&(i.errorTotals.positive[t]=Vt.max(i.errorTotals.positive[t]||0,r)),{low:o,high:r}},addValue:function(t,i){var n,o,r=this,a=i.categoryIx,s=i.series,l=i.seriesIx,c=r.categoryPoints[a];c||(r.categoryPoints[a]=c=[]),n=r.seriesPoints[l],n||(r.seriesPoints[l]=n=[]),o=r.createPoint(t,i),o&&(e.extend(o,i),o.owner=r,o.dataItem=s.data[a],o.noteText=t.fields.noteText,r.addErrorBar(o,t,a)),r.points.push(o),n.push(o),c.push(o),r.updateRange(t.valueFields,i)},evalPointOptions:function(e,t,i,n,o,r){var a={defaults:o._defaults,excluded:["data","aggregate","_events","tooltip","template","visual","toggle","_outOfRangeMinPoint","_outOfRangeMaxPoint"]},s=this._evalSeries[r];return yi(s)||(this._evalSeries[r]=s=O(e,{},a,!0)),s&&(e=Ut({},e),O(e,{value:t,category:i,index:n,series:o,dataItem:o.data[n]},a)),e},updateRange:function(e,t){var i=this,n=t.series.axis,o=e.value,r=i.valueAxisRanges[n];isFinite(o)&&null!==o&&(r=i.valueAxisRanges[n]=r||{min:Yn,max:Wn},r.min=Vt.min(r.min,o),r.max=Vt.max(r.max,o))},seriesValueAxis:function(e){var t=this.plotArea,i=e.axis,n=i?t.namedValueAxes[i]:t.valueAxis;if(!n)throw Error("Unable to locate value axis with name "+i);return n},reflow:function(e){var t,i,n,o=this,r=0,a=o.categorySlots=[],s=o.points,l=o.categoryAxis;o.traverseDataPoints(function(e,c){var u,h,p,d,f=c.categoryIx,g=c.series;t=o.pointValue(e),i=o.seriesValueAxis(g),n=s[r++],u=a[f],u||(a[f]=u=o.categorySlot(l,f,i)),n&&(h=o.plotRange(n,i.startValue()),p=i.getSlot(h[0],h[1],!o.options.clip),p?(d=o.pointSlot(u,p),n.aboveAxis=o.aboveAxis(n,i),o.options.isStacked100&&(n.percentage=o.plotValue(n)),o.reflowPoint(n,d)):n.visible=!1)}),o.reflowCategories(a),o.box=e},aboveAxis:function(e,t){var i=this.categoryAxisCrossingValue(t),n=e.value;return t.options.reverse?i>n:n>=i},categoryAxisCrossingValue:function(e){var t=this.categoryAxis,i=e.options,n=[].concat(i.axisCrossingValues||i.axisCrossingValue);return n[t.axisIndex||0]||0},reflowPoint:function(e,t){e.reflow(t)},reflowCategories:function(){},pointSlot:function(e,t){var i=this,n=i.options,o=n.invertAxes,r=o?t:e,a=o?e:t;return new Xt(r.x1,a.y1,r.x2,a.y2)},categorySlot:function(e,t){return e.getSlot(t)},traverseDataPoints:function(e){var t,i,n,o,r,a=this,s=a.options,l=s.series,c=a.categoryAxis.options.categories||[],h=u(l),p=l.length;for(i=0;p>i;i++)this._outOfRangeCallback(l[i],"_outOfRangeMinPoint",i,e);for(t=0;h>t;t++)for(i=0;p>i;i++)r=l[i],o=c[t],n=this._bindPoint(r,i,t),e(n,{category:o,categoryIx:t,series:r,seriesIx:i});for(i=0;p>i;i++)this._outOfRangeCallback(l[i],"_outOfRangeMaxPoint",i,e)},_outOfRangeCallback:function(e,t,i,n){var o,r,a=e[t];a&&(o=a.categoryIx,r=this._bindPoint(e,i,o,a.item),n(r,{category:a.category,categoryIx:o,series:e,seriesIx:i}))},_bindPoint:function(e,t,i,n){var o,r;return this._bindCache||(this._bindCache=[]),o=this._bindCache[t],o||(o=this._bindCache[t]=[]),r=o[i],r||(r=o[i]=ie.current.bindPoint(e,i,n)),r},formatPointValue:function(e,t){return null===e.value?"":ui(t,e.value)},pointValue:function(e){return e.valueFields.value}}),ye=ve.extend({options:{animation:{type:Ei}},render:function(){var e=this;ve.fn.render.apply(e),e.updateStackRange()},pointType:function(){return fe},clusterType:function(){return ue},stackType:function(){return he},stackLimits:function(e,t){var i=ve.fn.stackLimits.call(this,e,t);return i},createPoint:function(e,t){var i,n,o,r,a=this,s=t.categoryIx,l=t.category,c=t.series,u=t.seriesIx,h=a.pointValue(e),p=a.options,d=a.children,f=a.options.isStacked,g=a.pointType(),m=a.clusterType(),x=this.pointOptions(c,u),v=x.labels;return f&&v.position==uo&&(v.position=Dn),x.isStacked=f,o=e.fields.color||c.color,0>h&&x.negativeColor&&(o=x.negativeColor),x=a.evalPointOptions(x,h,l,s,c,u),Et.isFunction(c.color)&&(o=x.color),i=new g(h,x),i.color=o,n=d[s],n||(n=new m({vertical:p.invertAxes,gap:p.gap,spacing:p.spacing}),a.append(n)),f?(r=a.getStackWrap(c,n),r.append(i)):n.append(i),i},getStackWrap:function(e,t){var i,n,o,r=e.stack,a=r?r.group||r:r,s=t.children;if(typeof a===Eo){for(n=0;s.length>n;n++)if(s[n]._stackGroup===a){i=s[n];break}}else i=s[0];return i||(o=this.stackType(),i=new o({vertical:!this.options.invertAxes}),i._stackGroup=a,t.append(i)),i},categorySlot:function(e,t,i){var n,o,r=this,a=r.options,s=e.getSlot(t),l=i.startValue();return a.isStacked&&(o=i.getSlot(l,l,!0),n=a.invertAxes?rr:ar,s[n+1]=s[n+2]=o[n+1]),s},reflowCategories:function(e){var t,i=this,n=i.children,o=n.length;for(t=0;o>t;t++)n[t].reflow(e[t])},createAnimation:function(){this._setAnimationOptions(),Kt.fn.createAnimation.call(this),X(this.options.series)&&this._setChildrenAnimation()},_setChildrenAnimation:function(){var e,t,i,n=this.points;for(i=0;n.length>i;i++)e=n[i],t=e.visual,t&&yi(t.options.zIndex)&&(e.options.animation=this.options.animation,e.createAnimation())},_setAnimationOptions:function(){var e,t,i=this.options,n=i.animation||{};this.options.isStacked?(t=this.seriesValueAxis(i.series[0]),e=t.getSlot(t.startValue())):e=this.categoryAxis.getSlot(0),n.origin=new Pi.Point(e.x1,e.y1),n.vertical=!i.invertAxes}}),be=fe.extend({defaults:{labels:{format:"{0} - {1}"},tooltip:{format:"{1}"}},createLabel:function(){var e=this.options.labels,t=Ut({},e,e.from),i=Ut({},e,e.to);t.visible&&(this.labelFrom=this._createLabel(t),this.append(this.labelFrom)),i.visible&&(this.labelTo=this._createLabel(i),this.append(this.labelTo))},_createLabel:function(e){var t,i;return e.template?(i=jt(e.template),t=i({dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total,series:this.series})):t=this.formatValue(e.format),new ne(t,Ut({vertical:this.options.vertical},e))},reflow:function(e){this.render();var t=this,i=t.labelFrom,n=t.labelTo;t.box=e,i&&(i.options.aboveAxis=t.value.from>t.value.to,i.reflow(e)),n&&(n.options.aboveAxis=t.value.to>t.value.from,n.reflow(e)),t.note&&t.note.reflow(e)}}),we=ye.extend({pointType:function(){return be},pointValue:function(e){return e.valueFields},formatPointValue:function(e,t){return null===e.value.from&&null===e.value.to?"":ui(t,e.value.from,e.value.to)},plotLimits:ve.fn.plotLimits,plotRange:function(e){return e?[e.value.from,e.value.to]:0},updateRange:function(e,t){var i=this,n=t.series.axis,o=e.from,r=e.to,a=i.valueAxisRanges[n];null!==e&&B(o)&&B(r)&&(a=i.valueAxisRanges[n]=a||{min:Yn,max:Wn},a.min=Vt.min(a.min,o),a.max=Vt.max(a.max,o),a.min=Vt.min(a.min,r),a.max=Vt.max(a.max,r))},aboveAxis:function(e){var t=e.value;return t.to>t.from}}),_e=ve.extend({init:function(e,t){var i=this;i.wrapData(t),ve.fn.init.call(i,e,t)},options:{animation:{type:Ei}},wrapData:function(e){var t,i,n,o=e.series;for(t=0;o.length>t;t++)n=o[t],i=n.data,i&&!Tt(i[0])&&typeof i[0]!=lo&&(n.data=[i])},reflowCategories:function(e){var t,i=this,n=i.children,o=n.length;for(t=0;o>t;t++)n[t].reflow(e[t])},plotRange:function(e){var t=e.series,i=this.seriesValueAxis(t),n=this.categoryAxisCrossingValue(i);return[n,e.value.current||n]},createPoint:function(e,t){var i,n,o=this,r=t.categoryIx,a=t.category,s=t.series,l=t.seriesIx,c=e.valueFields,u=o.options,h=o.children,p=Ut({vertical:!u.invertAxes,overlay:s.overlay,categoryIx:r,invertAxes:u.invertAxes},s),d=e.fields.color||s.color;return p=o.evalPointOptions(p,c,a,r,s,l),Et.isFunction(s.color)&&(d=p.color),i=new Ae(c,p),i.color=d,n=h[r],n||(n=new ue({vertical:u.invertAxes,gap:u.gap,spacing:u.spacing}),o.append(n)),n.append(i),i},updateRange:function(e,t){var i=this,n=t.series.axis,o=e.current,r=e.target,a=i.valueAxisRanges[n];yi(o)&&!isNaN(o)&&yi(r&&!isNaN(r))&&(a=i.valueAxisRanges[n]=a||{min:Yn,max:Wn},a.min=Vt.min.apply(Vt,[a.min,o,r]),a.max=Vt.max.apply(Vt,[a.max,o,r]))},formatPointValue:function(e,t){return ui(t,e.value.current,e.value.target)},pointValue:function(e){return e.valueFields.current},aboveAxis:function(e){var t=e.value.current;return t>0},createAnimation:function(){var e,t,i=this.points;for(this._setAnimationOptions(),t=0;i.length>t;t++)e=i[t],e.options.animation=this.options.animation,e.createAnimation()},_setAnimationOptions:ye.fn._setAnimationOptions}),Ae=Kt.extend({init:function(e,t){var i=this;Kt.fn.init.call(i,t),i.aboveAxis=i.options.aboveAxis,i.color=t.color||or,i.value=e},options:{border:{width:1},vertical:!1,opacity:1,target:{shape:"",border:{width:0,color:"green"},line:{width:2}},tooltip:{format:"Current: {0}</br>Target: {1}"}},render:function(){var e=this,t=e.options;e._rendered||(e._rendered=!0,yi(e.value.target)&&(e.target=new Ce({type:t.target.shape,background:t.target.color||e.color,opacity:t.opacity,zIndex:t.zIndex,border:t.target.border,vAlign:Yo,align:yo}),e.append(e.target)),e.createNote())},reflow:function(e){this.render();var t,i=this,n=i.options,o=i.owner,r=i.target,a=n.invertAxes,s=o.seriesValueAxis(i.options),l=o.categorySlot(o.categoryAxis,n.categoryIx,s),c=s.getSlot(i.value.target),u=a?c:l,h=a?l:c;r&&(t=new Xt(u.x1,h.y1,u.x2,h.y2),r.options.height=a?t.height():n.target.line.width,r.options.width=a?n.target.line.width:t.width(),r.reflow(t)),i.note&&i.note.reflow(e),i.box=e},createVisual:function(){var e,t;Kt.fn.createVisual.call(this),e=this.options,t=Ti.Path.fromRect(this.box.toRect(),{fill:{color:this.color,opacity:e.opacity},stroke:null}),e.border.width>0&&t.options.set("stroke",{color:e.border.color||this.color,width:e.border.width,dashType:e.border.dashType,opacity:Si(e.border.opacity,e.opacity)}),this.bodyVisual=t,ci(t),this.visual.append(t)},createAnimation:function(){this.bodyVisual&&(this.animation=Ti.Animation.create(this.bodyVisual,this.options.animation))},tooltipAnchor:function(e,t){var i,n,o,r,a=this,s=a.options,l=a.box,c=s.vertical,u=a.aboveAxis,h=a.owner.pane.clipBox()||l;return c?(i=l.x2+Wo,n=u?Vt.max(l.y1,h.y1):Vt.min(l.y2,h.y2)-t):(o=Vt.max(l.x1,h.x1),r=Vt.min(l.x2,h.x2),s.isStacked?(i=u?r-e:o,n=l.y1-t-Wo):(i=u?r+Wo:o-e-Wo,n=l.y1)),new ii(i,n)},createHighlight:function(e){return Ti.Path.fromRect(this.box.toRect(),e)},highlightVisual:function(){return this.bodyVisual},highlightVisualArgs:function(){return{rect:this.box.toRect(),visual:this.bodyVisual,options:this.options}},formatValue:function(e){var t=this;return t.owner.formatPointValue(t,e)}}),Ut(Ae.fn,pe),Ut(Ae.fn,de),Ce=ri.extend(),Ut(Ce.fn,pe),ke=Kt.extend({init:function(e,t,i,n,o,r){var a=this;a.low=e,a.high=t,a.isVertical=i,a.chart=n,a.series=o,Kt.fn.init.call(a,r)},options:{animation:{type:Cn,delay:Bn},endCaps:!0,line:{width:1},zIndex:1},getAxis:function(){},reflow:function(e){var t,i=this,n=i.options.endCaps,o=i.isVertical,r=i.getAxis(),a=r.getSlot(i.low,i.high),s=e.center(),l=i.getCapsWidth(e,o),c=o?s.x:s.y,u=c-l,h=c+l;o?(t=[ii(s.x,a.y1),ii(s.x,a.y2)],n&&t.push(ii(u,a.y1),ii(h,a.y1),ii(u,a.y2),ii(h,a.y2)),i.box=Xt(u,a.y1,h,a.y2)):(t=[ii(a.x1,s.y),ii(a.x2,s.y)],n&&t.push(ii(a.x1,u),ii(a.x1,h),ii(a.x2,u),ii(a.x2,h)),i.box=Xt(a.x1,u,a.x2,h)),i.linePoints=t},getCapsWidth:function(e,t){var i=t?e.width():e.height(),n=Vt.min(Vt.floor(i/2),pn)||pn;return n},createVisual:function(){var e=this,t=e.options,i=t.visual;i?e.visual=i({low:e.low,high:e.high,rect:e.box.toRect(),sender:e.getChart(),options:{endCaps:t.endCaps,color:t.color,line:t.line},createVisual:function(){e.createDefaultVisual();var t=e.visual;return delete e.visual,t}}):e.createDefaultVisual()},createDefaultVisual:function(){var e,t,i=this,n=i.options,o={stroke:{color:n.color,width:n.line.width,dashType:n.line.dashType}},r=i.linePoints;for(Kt.fn.createVisual.call(this),e=0;r.length>e;e+=2)t=new Ti.Path(o).moveTo(r[e].x,r[e].y).lineTo(r[e+1].x,r[e+1].y),this.visual.append(t)}}),Se=ke.extend({getAxis:function(){var e=this,t=e.chart,i=e.series,n=t.seriesValueAxis(i);return n}}),Pe=ke.extend({getAxis:function(){var e=this,t=e.chart,i=e.series,n=t.seriesAxes(i),o=e.isVertical?n.y:n.x;return o}}),Te=Kt.extend({init:function(e,t){var i=this;Kt.fn.init.call(i),i.value=e,i.options=t,i.aboveAxis=Si(i.options.aboveAxis,!0),i.tooltipTracking=!0},defaults:{vertical:!0,markers:{visible:!0,background:or,size:Hn,type:Ki,border:{width:2},opacity:1},labels:{visible:!1,position:Ri,margin:pi(3),padding:pi(4),animation:{type:Cn,delay:Bn}},notes:{label:{}},highlight:{markers:{border:{}}}},render:function(){var e,t=this,i=t.options,n=i.markers,o=i.labels,r=t.value;t._rendered||(t._rendered=!0,n.visible&&n.size&&(t.marker=t.createMarker(),t.append(t.marker)),o.visible&&(o.template?(e=jt(o.template),r=e({dataItem:t.dataItem,category:t.category,value:t.value,percentage:t.percentage,series:t.series})):o.format&&(r=t.formatValue(o.format)),t.label=new si(r,Ut({align:Xi,vAlign:Xi,margin:{left:5,right:5},zIndex:Si(o.zIndex,this.series.zIndex)},o)),t.append(t.label)),t.createNote(),t.errorBar&&t.append(t.errorBar))},markerBorder:function(){var e=this.options.markers,t=e.background,i=Ut({color:this.color},e.border);return yi(i.color)||(i.color=new Zt(t).brightness(zi).toHex()),i},createVisual:Bt,createMarker:function(){var e=this.options.markers,t=new ri({type:e.type,width:e.size,height:e.size,rotation:e.rotation,background:e.background,border:this.markerBorder(),opacity:e.opacity,zIndex:Si(e.zIndex,this.series.zIndex),animation:e.animation,visual:e.visual},{dataItem:this.dataItem,value:this.value,series:this.series,category:this.category});return t},markerBox:function(){return this.marker||(this.marker=this.createMarker(),this.marker.reflow(this._childBox)),this.marker.box},reflow:function(e){var t,i,n,o,r=this,a=r.options,s=a.vertical,l=r.aboveAxis;if(r.render(),r.box=e,t=e.clone(),s?l?t.y1-=t.height():t.y2+=t.height():l?t.x1+=t.width():t.x2-=t.width(),r._childBox=t,r.marker&&r.marker.reflow(t),r.reflowLabel(t),r.errorBars)for(n=0;r.errorBars.length>n;n++)r.errorBars[n].reflow(t);r.note&&(o=r.markerBox(),r.marker||(i=o.center(),o=Xt(i.x,i.y,i.x,i.y)),r.note.reflow(o))},reflowLabel:function(e){var t=this,i=t.options,n=t.label,o=i.labels.position;n&&(o=o===Ri?Yo:o,o=o===Fi?Hi:o,n.reflow(e),n.box.alignTo(t.markerBox(),o),n.reflow(n.box))},createHighlight:function(){var e=this.options.highlight,t=e.markers,i=this.markerBorder().color,n=this.options.markers,o=new ri({type:n.type,width:n.size,height:n.size,rotation:n.rotation,background:t.color||i,border:{color:t.border.color,width:t.border.width,opacity:Si(t.border.opacity,1)},opacity:Si(t.opacity,1)});return o.reflow(this._childBox),o.getElement()},highlightVisual:function(){return(this.marker||{}).visual},highlightVisualArgs:function(){var e,t,i,n,o,r=this.marker;return r?(t=r.paddingBox.toRect(),e=r.visual):(i=this.options.markers.size,n=i/2,o=this.box.center(),t=new Pi.Rect([o.x-n,o.y-n],[i,i])),{options:this.options,rect:t,visual:e}},tooltipAnchor:function(e,i){var n=this,o=n.markerBox(),r=n.aboveAxis,a=o.x2+Wo,s=r?o.y1-i:o.y2,l=n.owner.pane.clipBox(),c=!l||l.overlaps(o);return c?ii(a,s):t},formatValue:function(e){var t=this;return t.owner.formatPointValue(t,e)},overlapsBox:function(e){var t=this.markerBox();return t.overlaps(e)}}),Ut(Te.fn,pe),Ut(Te.fn,de),Ie=Te.extend({init:function(e,t){var i=this;Te.fn.init.call(i,e,t),i.category=e.category},defaults:{labels:{position:Xi},highlight:{opacity:1,border:{width:1,opacity:1}}},createHighlight:function(){var e=this.options.highlight,t=e.border,i=this.options.markers,n=this.box.center(),o=i.size/2-t.width/2,r=new Ti.Circle(new Pi.Circle([n.x,n.y],o),{stroke:{color:t.color||new Zt(i.background).brightness(zi).toHex(),width:t.width,opacity:t.opacity},fill:{color:i.background,opacity:e.opacity}});return r}}),Re=Kt.extend({init:function(e,t,i){var n=this;Kt.fn.init.call(n),n.linePoints=e,n.series=t,n.seriesIx=i},options:{closed:!1},points:function(e){var t,i,n=this,o=n.linePoints.concat(e||[]),r=[];for(t=0,i=o.length;i>t;t++)o[t].visible!==!1&&r.push(o[t]._childBox.toRect().center());return r},createVisual:function(){var e,t=this.options,i=this.series,n=i._defaults,o=i.color;Nt(o)&&n&&(o=n.color),e=Ti.Path.fromPoints(this.points(),{stroke:{color:o,width:i.width,opacity:i.opacity,dashType:i.dashType},zIndex:i.zIndex}),t.closed&&e.close(),this.visual=e},aliasFor:function(e,t){var i=this,n=i.seriesIx;return i.parent.getNearestPoint(t.x,t.y,n)}}),Ve={renderSegments:function(){var e,t,i,n,o,r,a,s,l=this,c=l.options,u=c.series,h=l.seriesPoints,p=h.length;for(this._segments=[],t=0;p>t;t++){for(e=u[t],i=l.sortPoints(h[t]),a=i.length,n=[],r=0;a>r;r++)o=i[r],o?n.push(o):l.seriesMissingValues(e)!==En&&(n.length>1&&(s=l.createSegment(n,e,t,s),this._addSegment(s)),n=[]);n.length>1&&(s=l.createSegment(n,e,t,s),this._addSegment(s))}this.children.unshift.apply(this.children,this._segments)},_addSegment:function(e){this._segments.push(e),e.parent=this},sortPoints:function(e){return e},seriesMissingValues:function(e){var t=e.missingValues,i=!t&&this.options.isStacked;return i?lr:t||En},getNearestPoint:function(e,t,i){var n,o,r,a,s,l=new ii(e,t),c=this.seriesPoints[i],u=Yn;for(o=0;c.length>o;o++)r=c[o],r&&yi(r.value)&&null!==r.value&&r.visible!==!1&&(a=r.box,s=a.center().distanceTo(l),u>s&&(n=r,u=s));return n}},Be={createAnimation:function(){var e,t,i=this.getRoot();i&&(i.options||{}).transitions!==!1&&(e=i.box,t=Ti.Path.fromRect(e.toRect()),this.visual.clip(t),this.animation=new De(t,{box:e}),X(this.options.series)&&this._setChildrenAnimation(t))},_setChildrenAnimation:function(e){var t,i,n=this.animationPoints();for(i=0;n.length>i;i++)t=n[i],t&&t.visual&&yi(t.visual.options.zIndex)&&t.visual.clip(e)}},Le=ve.extend({render:function(){var e=this;ve.fn.render.apply(e),e.updateStackRange(),e.renderSegments()},pointType:function(){return Te},createPoint:function(e,t){var i,n,o,r=this,a=t.categoryIx,s=t.category,l=t.series,c=t.seriesIx,u=e.valueFields.value,h=r.seriesMissingValues(l);if(!yi(u)||null===u){if(h!==lr)return null;u=0}return n=this.pointOptions(l,c),n=r.evalPointOptions(n,u,s,a,l,c),o=e.fields.color||l.color,Et.isFunction(l.color)&&(o=n.color),i=new Te(u,n),i.color=o,r.append(i),i},plotRange:function(e){var t,i,n,o,r=this.plotValue(e);if(this.options.isStacked)for(t=e.categoryIx,i=this.categoryPoints[t],n=0;i.length>n&&(o=i[n],e!==o);n++)r+=this.plotValue(o);return[r,r]},createSegment:function(e,t,i){var n,o=t.style;return new(n=o===Vo?Ee:o===Bo?Oe:Re)(e,t,i)},animationPoints:function(){var e,t=this.points,i=[];for(e=0;t.length>e;e++)i.push((t[e]||{}).marker);return i.concat(this._segments)}}),Ut(Le.fn,Ve,Be),De=Ti.Animation.extend({options:{duration:Bn},setup:function(){this._setEnd(this.options.box.x1)},step:function(e){var t=this.options.box;this._setEnd(fi(t.x1,t.x2,e))},_setEnd:function(e){var t=this.element,i=t.segments,n=i[1].anchor(),o=i[2].anchor();t.suspend(),n.setX(e),t.resume(),o.setX(e)}}),Ti.AnimationFactory.current.register(Qi,De),Ee=Re.extend({points:function(e){var t,i=this;return t=i.calculateStepPoints(i.linePoints),e&&e.length&&(t=t.concat(i.calculateStepPoints(e).reverse())),t},calculateStepPoints:function(e){var t,i,n,o,r,a=this,s=a.parent,l=s.plotArea,c=l.seriesCategoryAxis(a.series),u=s.seriesMissingValues(a.series)===En,h=e.length,p=c.options.reverse,d=c.options.vertical,f=p?2:1,g=p?1:2,m=[];for(n=1;h>n;n++)t=e[n-1],i=e[n],o=t.markerBox().center(),r=i.markerBox().center(),c.options.justified?(m.push(new Pi.Point(o.x,o.y)),m.push(d?new Pi.Point(o.x,r.y):new Pi.Point(r.x,o.y)),m.push(new Pi.Point(r.x,r.y))):d?(m.push(new Pi.Point(o.x,t.box[ar+f])),m.push(new Pi.Point(o.x,t.box[ar+g])),u&&m.push(new Pi.Point(o.x,i.box[ar+f])),m.push(new Pi.Point(r.x,i.box[ar+f])),m.push(new Pi.Point(r.x,i.box[ar+g]))):(m.push(new Pi.Point(t.box[rr+f],o.y)),m.push(new Pi.Point(t.box[rr+g],o.y)),u&&m.push(new Pi.Point(i.box[rr+f],o.y)),m.push(new Pi.Point(i.box[rr+f],r.y)),m.push(new Pi.Point(i.box[rr+g],r.y)));return m||[]}}),Oe=Re.extend({createVisual:function(){var e,t,i,n=this.series,o=n._defaults,r=n.color;Nt(r)&&o&&(r=o.color),e=new Qt(this.options.closed),t=e.process(this.points()),i=new Ti.Path({stroke:{color:r,width:n.width,opacity:n.opacity,dashType:n.dashType},zIndex:n.zIndex}),i.segments.push.apply(i.segments,t),this.visual=i}}),ze={points:function(){var e,t,i=this,n=i.parent,o=n.plotArea,r=n.options.invertAxes,a=n.seriesValueAxis(i.series),s=a.lineBox(),l=o.seriesCategoryAxis(i.series),c=l.lineBox(),u=r?c.x1:c.y1,h=i.stackPoints,p=i._linePoints(h),d=r?rr:ar;return u=wi(u,s[d+1],s[d+2]),!i.stackPoints&&p.length>1&&(e=p[0],t=bi(p),r?(p.unshift(new Pi.Point(u,e.y)),p.push(new Pi.Point(u,t.y))):(p.unshift(new Pi.Point(e.x,u)),p.push(new Pi.Point(t.x,u)))),p},createVisual:function(){var e=this.series,t=e._defaults,i=e.color;Nt(i)&&t&&(i=t.color),this.visual=new Ti.Group({zIndex:e.zIndex}),this.createArea(i),this.createLine(i)},createLine:function(e){var t,i=this.series,n=Ut({color:e,opacity:i.opacity},i.line);n.visible!==!1&&n.width>0&&(t=Ti.Path.fromPoints(this._linePoints(),{stroke:{color:n.color,width:n.width,opacity:n.opacity,dashType:n.dashType,lineCap:"butt"}}),this.visual.append(t))},createArea:function(e){var t=this.series,i=Ti.Path.fromPoints(this.points(),{fill:{color:e,opacity:t.opacity},stroke:null});this.visual.append(i)}},Fe=Re.extend({init:function(e,t,i,n){var o=this;o.stackPoints=t,Re.fn.init.call(o,e,i,n)},_linePoints:Re.fn.points}),Ut(Fe.fn,ze),Me=Le.extend({createSegment:function(e,t,i,n){var o,r,a,s=this,l=s.options,c=l.isStacked,u=(t.line||{}).style;return c&&i>0&&n&&(a=this.seriesMissingValues(t),o="gap"!=a?n.linePoints:this._gapStackPoints(e,i,u),u!==Vo&&(o=o.slice(0).reverse())),u===Bo?new Ue(e,n,c,t,i):new(r=u===Vo?He:Fe)(e,o,t,i)},reflow:function(e){var t,i,n,o;if(Le.fn.reflow.call(this,e),t=this._stackPoints)for(o=0;t.length>o;o++)i=t[o],n=this.categoryAxis.getSlot(i.categoryIx),i.reflow(n)},_gapStackPoints:function(e,t,i){var n,o,r,a,s=this.seriesPoints,l=e[0].categoryIx,c=l+e.length,u=[];for(this._stackPoints=this._stackPoints||[],a=l;c>a;a++){n=t;do n--,o=s[n][a];while(n>0&&!o);o?(i!==Vo&&a>l&&!s[n][a-1]&&u.push(this._previousSegmentPoint(a,a-1,n)),u.push(o),i!==Vo&&c>a+1&&!s[n][a+1]&&u.push(this._previousSegmentPoint(a,a+1,n))):(r=this._createGapStackPoint(a),this._stackPoints.push(r),u.push(r))}return u},_previousSegmentPoint:function(e,t,i){for(var n,o=this.seriesPoints;i>0&&!n;)i--,n=o[i][t];return n?n=o[i][e]:(n=this._createGapStackPoint(e),this._stackPoints.push(n)),n},_createGapStackPoint:function(e){var t=this.pointOptions({},0),i=new Te(0,t);return i.categoryIx=e,i.series={},i},seriesMissingValues:function(e){return e.missingValues||lr}}),Ue=Fe.extend({init:function(e,t,i,n,o){var r=this;r.prevSegment=t,r.isStacked=i,Re.fn.init.call(r,e,n,o)},strokeSegments:function(){var e,t,i=this._strokeSegments;return i||(e=new Qt(this.options.closed),t=Re.fn.points.call(this),i=this._strokeSegments=e.process(t)),i},createVisual:function(){var e=this.series,t=e._defaults,i=e.color;Nt(i)&&t&&(i=t.color),this.visual=new Ti.Group({zIndex:e.zIndex}),this.createFill({fill:{color:i,opacity:e.opacity},stroke:null}),this.createStroke({stroke:Ut({color:i,opacity:e.opacity,lineCap:"butt"},e.line)})},createFill:function(t){var i,n,o,r,a,s=this.strokeSegments(),l=s.slice(0),c=this.prevSegment;this.isStacked&&c&&(i=c.strokeSegments(),n=bi(i).anchor(),l.push(new Ti.Segment(n,n,bi(s).anchor())),o=e.map(i,function(e){return new Ti.Segment(e.anchor(),e.controlOut(),e.controlIn())}).reverse(),vi(l,o),r=l[0].anchor(),l.push(new Ti.Segment(r,r,bi(o).anchor()))),a=new Ti.Path(t),a.segments.push.apply(a.segments,l),this.closeFill(a),this.visual.append(a)},closeFill:function(e){var t=this,i=t.parent,n=t.prevSegment,o=i.plotArea,r=i.options.invertAxes,a=i.seriesValueAxis(t.series),s=a.lineBox(),l=o.seriesCategoryAxis(t.series),c=l.lineBox(),u=r?c.x1:c.y1,h=r?rr:ar,p=t.strokeSegments(),d=p[0].anchor(),f=bi(p).anchor();u=wi(u,s[h+1],s[h+2]),i.options.isStacked&&n||!(p.length>1)||(r?e.lineTo(u,f.y).lineTo(u,d.y):e.lineTo(f.x,u).lineTo(d.x,u))},createStroke:function(e){if(e.stroke.width>0){var t=new Ti.Path(e);t.segments.push.apply(t.segments,this.strokeSegments()),this.visual.append(t)}}}),He=Ee.extend({init:function(e,t,i,n){var o=this;o.stackPoints=t,Ee.fn.init.call(o,e,i,n)},_linePoints:Ee.fn.points}),Ut(He.fn,ze),Ne=Kt.extend({init:function(e,t){var i=this;Kt.fn.init.call(i,t),i.plotArea=e,i.xAxisRanges={},i.yAxisRanges={},i.points=[],i.seriesPoints=[],i.seriesOptions=[],i._evalSeries=[],i.render()},options:{series:[],tooltip:{format:"{0}, {1}"},labels:{format:"{0}, {1}"},clip:!0},render:function(){var e=this;e.traverseDataPoints(Dt(e.addValue,e))},addErrorBar:function(e,t,i){var n,o=this,r=e.value[t],a=t+"Value",s=t+"ErrorLow",l=t+"ErrorHigh",c=i.seriesIx,u=i.series,h=e.options.errorBars,p=i[s],d=i[l];B(r)&&(B(p)&&B(d)&&(n={low:p,high:d}),h&&yi(h[a])&&(o.seriesErrorRanges=o.seriesErrorRanges||{x:[],y:[]},o.seriesErrorRanges[t][c]=o.seriesErrorRanges[t][c]||new xe(h[a],u,t),n=o.seriesErrorRanges[t][c].getErrorRange(r,h[a])),n&&o.addPointErrorBar(n,e,t))},addPointErrorBar:function(e,t,i){var n,o=this,r=e.low,a=e.high,s=t.series,l=i===ar,c=t.options.errorBars,u={};t[i+"Low"]=r,t[i+"High"]=a,t.errorBars=t.errorBars||[],n=new Pe(r,a,l,o,s,c),t.errorBars.push(n),t.append(n),u[i]=r,o.updateRange(u,s),u[i]=a,o.updateRange(u,s)},addValue:function(e,t){var i,n=this,o=e.x,r=e.y,a=t.seriesIx,s=this.options.series[a],l=this.seriesMissingValues(s),c=n.seriesPoints[a];Z(o)&&Z(r)||(e=this.createMissingValue(e,l)),e&&(i=n.createPoint(e,t),i&&(Lt(i,t),n.addErrorBar(i,rr,t),n.addErrorBar(i,ar,t)),n.updateRange(e,t.series)),n.points.push(i),c.push(i)},seriesMissingValues:function(e){return e.missingValues},createMissingValue:Bt,updateRange:function(e,t){var i=this,n=e.x,o=e.y,r=t.xAxis,a=t.yAxis,s=i.xAxisRanges[r],l=i.yAxisRanges[a];Z(n)&&(s=i.xAxisRanges[r]=s||{min:Yn,max:Wn},typeof n===Eo&&(n=f(n)),s.min=Vt.min(s.min,n),s.max=Vt.max(s.max,n)),Z(o)&&(l=i.yAxisRanges[a]=l||{min:Yn,max:Wn},typeof o===Eo&&(o=f(o)),l.min=Vt.min(l.min,o),l.max=Vt.max(l.max,o))},evalPointOptions:function(e,t,i){var n=i.series,o=i.seriesIx,r={defaults:n._defaults,excluded:["data","tooltip","tempate","visual","toggle","_outOfRangeMinPoint","_outOfRangeMaxPoint"]},a=this._evalSeries[o];return yi(a)||(this._evalSeries[o]=a=O(e,{},r,!0)),a&&(e=Ut({},e),O(e,{value:t,series:n,dataItem:i.dataItem},r)),e},pointType:function(){return Te},pointOptions:function(e,t){var i,n=this.seriesOptions[t];return n||(i=this.pointType().fn.defaults,this.seriesOptions[t]=n=Ut({},i,{markers:{opacity:e.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},e)),n},createPoint:function(e,t){var i,n=this,o=t.series,r=this.pointOptions(o,t.seriesIx),a=t.color||o.color;return r=n.evalPointOptions(r,e,t),Et.isFunction(o.color)&&(a=r.color),i=new Te(e,r),i.color=a,n.append(i),i},seriesAxes:function(e){var t=this.plotArea,i=e.xAxis,n=i?t.namedXAxes[i]:t.axisX,o=e.yAxis,r=o?t.namedYAxes[o]:t.axisY;if(!n)throw Error("Unable to locate X axis with name "+i);if(!r)throw Error("Unable to locate Y axis with name "+o);return{x:n,y:r}},reflow:function(e){var t,i,n=this,o=n.points,r=0,a=!n.options.clip;n.traverseDataPoints(function(e,s){t=o[r++],i=n.seriesAxes(s.series);var l,c=i.x.getSlot(e.x,e.x,a),u=i.y.getSlot(e.y,e.y,a);t&&(c&&u?(l=n.pointSlot(c,u),t.reflow(l)):t.visible=!1)}),n.box=e},pointSlot:function(e,t){return new Xt(e.x1,t.y1,e.x2,t.y2)},traverseDataPoints:function(e){var t,i,n,o,r,a,s,l=this,c=l.options,u=c.series,h=l.seriesPoints;for(i=0;u.length>i;i++)for(n=u[i],o=h[i],o||(h[i]=[]),t=0;n.data.length>t;t++)r=this._bindPoint(n,i,t),a=r.valueFields,s=r.fields,e(a,Ut({pointIx:t,series:n,seriesIx:i,dataItem:n.data[t],owner:l},s))},_bindPoint:ve.fn._bindPoint,formatPointValue:function(e,t){var i=e.value;return ui(t,i.x,i.y)},animationPoints:function(){var e,t=this.points,i=[];for(e=0;t.length>e;e++)i.push((t[e]||{}).marker);return i}}),Ut(Ne.fn,Be),je=Ne.extend({render:function(){var e=this;Ne.fn.render.call(e),e.renderSegments()},createSegment:function(e,t,i){var n,o=t.style;return new(n=o===Bo?Oe:Re)(e,t,i)},animationPoints:function(){var e=Ne.fn.animationPoints.call(this);return e.concat(this._segments)},createMissingValue:function(e,t){if(t===lr){var i={x:e.x,y:e.y};return Z(i.x)||(i.x=0),Z(i.y)||(i.y=0),i}}}),Ut(je.fn,Ve),Ge=Ne.extend({init:function(e,t){this._maxSize=Wn,Ne.fn.init.call(this,e,t)},options:{tooltip:{format:"{3}"},labels:{format:"{3}"}},addValue:function(e,t){null!==e.size&&(e.size>0||0>e.size&&t.series.negativeValues.visible)?(this._maxSize=Vt.max(this._maxSize,Vt.abs(e.size)),Ne.fn.addValue.call(this,e,t)):(this.points.push(null),this.seriesPoints[t.seriesIx].push(null))},reflow:function(e){var t=this;t.updateBubblesSize(e),Ne.fn.reflow.call(t,e)},pointType:function(){return Ie},createPoint:function(e,t){var i,n,o=this,r=t.series,a=r.data.length,s=t.pointIx*(Bn/a),l={delay:s,duration:Bn-s,type:ji},c=t.color||r.color;return 0>e.size&&r.negativeValues.visible&&(c=Si(r.negativeValues.color,c)),n=Ut({labels:{animation:{delay:s,duration:Bn-s}}},this.pointOptions(r,t.seriesIx),{markers:{type:Ki,border:r.border,opacity:r.opacity,animation:l}}),n=o.evalPointOptions(n,e,t),Et.isFunction(r.color)&&(c=n.color),n.markers.background=c,i=new Ie(e,n),i.color=c,o.append(i),i},updateBubblesSize:function(e){var t,i,n,o,r,a,s,l,c,u,h,p,d,f,g,m,x,v=this,y=v.options,b=y.series,w=Vt.min(e.width(),e.height());for(t=0;b.length>t;t++)for(n=b[t],o=v.seriesPoints[t],r=n.minSize||Vt.max(.02*w,10),a=n.maxSize||.2*w,s=r/2,l=a/2,c=Vt.PI*s*s,u=Vt.PI*l*l,h=u-c,p=h/v._maxSize,i=0;o.length>i;i++)d=o[i],d&&(f=Vt.abs(d.value.size)*p,g=Vt.sqrt((c+f)/Vt.PI),m=Si(d.options.zIndex,0),x=m+(1-g/l),Ut(d.options,{zIndex:x,markers:{size:2*g,zIndex:x},labels:{zIndex:x+1}}))},formatPointValue:function(e,t){var i=e.value;return ui(t,i.x,i.y,i.size,e.category)},createAnimation:Bt,createVisual:Bt}),qe=Kt.extend({init:function(e,t){Kt.fn.init.call(this,t),this.value=e},options:{border:{_brightness:.8},line:{width:2},overlay:{gradient:Tn},tooltip:{format:"<table style='text-align: left;'><th colspan='2'>{4:d}</th><tr><td>Open:</td><td>{0:C}</td></tr><tr><td>High:</td><td>{1:C}</td></tr><tr><td>Low:</td><td>{2:C}</td></tr><tr><td>Close:</td><td>{3:C}</td></tr></table>"},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}}},reflow:function(e){var t,i,n,o=this,r=o.options,a=o.owner,s=o.value,l=a.seriesValueAxis(r),c=[];i=l.getSlot(s.open,s.close),n=l.getSlot(s.low,s.high),i.x1=n.x1=e.x1,i.x2=n.x2=e.x2,o.realBody=i,t=n.center().x,c.push([[t,n.y1],[t,i.y1]]),c.push([[t,i.y2],[t,n.y2]]),o.lines=c,o.box=n.clone().wrap(i),o._rendered||(o._rendered=!0,o.createNote()),o.reflowNote()},reflowNote:function(){var e=this;e.note&&e.note.reflow(e.box)},createVisual:function(){Kt.fn.createVisual.call(this),this._mainVisual=this.mainVisual(this.options),this.visual.append(this._mainVisual),this.createOverlay()},mainVisual:function(e){var t=new Ti.Group;return this.createBody(t,e),this.createLines(t,e),t},createBody:function(e,t){var i=Ti.Path.fromRect(this.realBody.toRect(),{fill:{color:this.color,opacity:t.opacity},stroke:null});t.border.width>0&&i.options.set("stroke",{color:this.getBorderColor(),width:t.border.width,dashType:t.border.dashType,opacity:Si(t.border.opacity,t.opacity)}),ci(i),e.append(i),Y(t)&&e.append(this.createGradientOverlay(i,{baseColor:this.color},Ut({},t.overlay)))},createLines:function(e,t){this.drawLines(e,t,this.lines,t.line)},drawLines:function(e,t,i,n){var o,r,a;if(i)for(o={stroke:{color:n.color||this.color,opacity:Si(n.opacity,t.opacity),width:n.width,dashType:n.dashType,lineCap:"butt"}},r=0;i.length>r;r++)a=Ti.Path.fromPoints(i[r],o),ci(a),e.append(a)},getBorderColor:function(){var e=this,t=e.options,i=t.border,n=i.color;return yi(n)||(n=new Zt(e.color).brightness(i._brightness).toHex()),n},createOverlay:function(){var e=Ti.Path.fromRect(this.box.toRect(),{fill:{color:or,opacity:0},stroke:null});this.visual.append(e);
},createHighlight:function(){var e,t=this.options.highlight,i=this.color;return this.color=t.color||this.color,e=this.mainVisual(Ut({},this.options,{line:{color:this.getBorderColor()}},t)),this.color=i,e},highlightVisual:function(){return this._mainVisual},highlightVisualArgs:function(){return{options:this.options,rect:this.box.toRect(),visual:this._mainVisual}},tooltipAnchor:function(){var e=this,t=e.box,i=e.owner.pane.clipBox()||t;return new ii(t.x2+Wo,Vt.max(t.y1,i.y1)+Wo)},formatValue:function(e){var t=this;return t.owner.formatPointValue(t,e)},overlapsBox:function(e){return this.box.overlaps(e)}}),Ut(qe.fn,pe),Ut(qe.fn,de),Ye=ve.extend({options:{},reflowCategories:function(e){var t,i=this,n=i.children,o=n.length;for(t=0;o>t;t++)n[t].reflow(e[t])},addValue:function(e,t){var i,n,o=this,r=t.categoryIx,a=t.category,s=t.series,l=t.seriesIx,c=o.options,u=e.valueFields,h=o.children,p=o.splitValue(u),d=D(p),f=o.categoryPoints[r],g=s.data[r];f||(o.categoryPoints[r]=f=[]),d&&(i=o.createPoint(e,t)),n=h[r],n||(n=new ue({vertical:c.invertAxes,gap:c.gap,spacing:c.spacing}),o.append(n)),i&&(o.updateRange(u,t),n.append(i),i.categoryIx=r,i.category=a,i.series=s,i.seriesIx=l,i.owner=o,i.dataItem=g,i.noteText=e.fields.noteText),o.points.push(i),f.push(i)},pointType:function(){return qe},createPoint:function(e,t){var i,n=this,o=t.categoryIx,r=t.category,a=t.series,s=t.seriesIx,l=e.valueFields,c=Ut({},a),u=n.pointType(),h=e.fields.color||a.color;return c=n.evalPointOptions(c,l,r,o,a,s),a.type==qi&&l.open>l.close&&(h=e.fields.downColor||a.downColor||a.color),Et.isFunction(a.color)&&(h=c.color),i=new u(l,c),i.color=h,i},splitValue:function(e){return[e.low,e.open,e.close,e.high]},updateRange:function(e,t){var i=this,n=t.series.axis,o=i.valueAxisRanges[n],r=i.splitValue(e);o=i.valueAxisRanges[n]=o||{min:Yn,max:Wn},o=i.valueAxisRanges[n]={min:Vt.min.apply(Vt,r.concat([o.min])),max:Vt.max.apply(Vt,r.concat([o.max]))}},formatPointValue:function(e,t){var i=e.value;return ui(t,i.open,i.high,i.low,i.close,e.category)},animationPoints:function(){return this.points}}),Ut(Ye.fn,Be),Xe=qe.extend({reflow:function(e){var t,i,n,o,r=this,a=r.options,s=r.owner,l=r.value,c=s.seriesValueAxis(a),u=[],h=[],p=[];o=c.getSlot(l.low,l.high),i=c.getSlot(l.open,l.open),n=c.getSlot(l.close,l.close),i.x1=n.x1=o.x1=e.x1,i.x2=n.x2=o.x2=e.x2,t=o.center().x,u.push([i.x1,i.y1]),u.push([t,i.y1]),h.push([t,n.y1]),h.push([n.x2,n.y1]),p.push([t,o.y1]),p.push([t,o.y2]),r.lines=[u,h,p],r.box=o.clone().wrap(i.clone().wrap(n)),r.reflowNote()},createBody:e.noop}),We=Ye.extend({pointType:function(){return Xe}}),Ke=Ye.extend({addValue:function(e,t){var i,n,o=this,r=t.categoryIx,a=t.category,s=t.series,l=t.seriesIx,c=o.options,u=o.children,h=e.valueFields,p=o.splitValue(h),d=D(p),f=o.categoryPoints[r],g=s.data[r];f||(o.categoryPoints[r]=f=[]),d&&(i=o.createPoint(e,t)),n=u[r],n||(n=new ue({vertical:c.invertAxes,gap:c.gap,spacing:c.spacing}),o.append(n)),i&&(o.updateRange(h,t),n.append(i),i.categoryIx=r,i.category=a,i.series=s,i.seriesIx=l,i.owner=o,i.dataItem=g),o.points.push(i),f.push(i)},pointType:function(){return Ze},splitValue:function(e){return[e.lower,e.q1,e.median,e.q3,e.upper]},updateRange:function(e,t){var i=this,n=t.series.axis,o=i.valueAxisRanges[n],r=i.splitValue(e).concat(i.filterOutliers(e.outliers));yi(e.mean)&&(r=r.concat(e.mean)),o=i.valueAxisRanges[n]=o||{min:Yn,max:Wn},o=i.valueAxisRanges[n]={min:Vt.min.apply(Vt,r.concat([o.min])),max:Vt.max.apply(Vt,r.concat([o.max]))}},formatPointValue:function(e,t){var i=e.value;return ui(t,i.lower,i.q1,i.median,i.q3,i.upper,i.mean,e.category)},filterOutliers:function(e){var t,i,n=(e||[]).length,o=[];for(t=0;n>t;t++)i=e[t],yi(i)&&R(o,i);return o}}),Ze=qe.extend({init:function(e,t){var i=this;Kt.fn.init.call(i,t),i.value=e,i.createNote()},options:{border:{_brightness:.8},line:{width:2},mean:{width:2,dashType:"dash"},overlay:{gradient:Tn},tooltip:{format:"<table style='text-align: left;'><th colspan='2'>{6:d}</th><tr><td>Lower:</td><td>{0:C}</td></tr><tr><td>Q1:</td><td>{1:C}</td></tr><tr><td>Median:</td><td>{2:C}</td></tr><tr><td>Mean:</td><td>{5:C}</td></tr><tr><td>Q3:</td><td>{3:C}</td></tr><tr><td>Upper:</td><td>{4:C}</td></tr></table>"},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}},outliers:{visible:!0,size:Hn,type:tn,background:or,border:{width:2,opacity:1},opacity:0},extremes:{visible:!0,size:Hn,type:Ki,background:or,border:{width:2,opacity:1},opacity:0}},reflow:function(e){var t,i,n,o,r,a=this,s=a.options,l=a.owner,c=a.value,u=l.seriesValueAxis(s);n=u.getSlot(c.q1,c.q3),a.boxSlot=n,i=u.getSlot(c.lower,c.upper),o=u.getSlot(c.median),n.x1=i.x1=e.x1,n.x2=i.x2=e.x2,a.realBody=n,c.mean&&(r=u.getSlot(c.mean),a.meanPoints=[[[e.x1,r.y1],[e.x2,r.y1]]]),t=i.center().x,a.whiskerPoints=[[[t-5,i.y1],[t+5,i.y1],[t,i.y1],[t,n.y1]],[[t-5,i.y2],[t+5,i.y2],[t,i.y2],[t,n.y2]]],a.medianPoints=[[[e.x1,o.y1],[e.x2,o.y1]]],a.box=i.clone().wrap(n),a.reflowNote()},renderOutliers:function(e){var t,i,n,o,r=this,a=e.markers||{},s=r.value,l=s.outliers||[],c=3*Vt.abs(s.q3-s.q1),u=[];for(o=0;l.length>o;o++)n=l[o],a=s.q3+c>n&&n>s.q1-c?e.outliers:e.extremes,t=Ut({},a.border),yi(t.color)||(t.color=yi(r.color)?r.color:new Zt(a.background).brightness(zi).toHex()),i=new ri({type:a.type,width:a.size,height:a.size,rotation:a.rotation,background:a.background,border:t,opacity:a.opacity}),i.value=n,u.push(i);return this.reflowOutliers(u),u},reflowOutliers:function(e){var t,i,n,o=this.owner.seriesValueAxis(this.options),r=this.box.center().x;for(t=0;e.length>t;t++)i=e[t].value,n=o.getSlot(i).move(r),this.box=this.box.wrap(n),e[t].reflow(n)},mainVisual:function(e){var t,i,n=qe.fn.mainVisual.call(this,e),o=this.renderOutliers(e);for(t=0;o.length>t;t++)i=o[t].getElement(),i&&n.append(i);return n},createLines:function(e,t){this.drawLines(e,t,this.whiskerPoints,t.line),this.drawLines(e,t,this.medianPoints,t.median),this.drawLines(e,t,this.meanPoints,t.mean)},getBorderColor:function(){return this.color?this.color:qe.getBorderColor.call(this)}}),Ut(Ze.fn,pe),Qe=Kt.extend({init:function(e,t,i){var n=this;n.value=e,n.sector=t,Kt.fn.init.call(n,i)},options:{color:or,overlay:{gradient:bo},border:{width:.5},labels:{visible:!1,distance:35,font:ln,margin:pi(.5),align:Ki,zIndex:1,position:uo},animation:{type:ho},highlight:{visible:!0,border:{width:1}},visible:!0},render:function(){var e,t=this,i=t.options,n=i.labels,o=t.value;t._rendered||t.visible===!1||(t._rendered=!0,n.template?(e=jt(n.template),o=e({dataItem:t.dataItem,category:t.category,value:t.value,series:t.series,percentage:t.percentage})):n.format&&(o=ui(n.format,o)),n.visible&&o&&(t.label=new si(o,Ut({},n,{align:Xi,vAlign:"",animation:{type:Cn,delay:t.animationDelay}})),t.append(t.label)))},reflow:function(e){var t=this;t.render(),t.box=e,t.reflowLabel()},reflowLabel:function(){var e,t,i,n,o=this,r=o.sector.clone(),a=o.options,s=o.label,l=a.labels,c=l.distance,u=r.middle();s&&(n=s.box.height(),i=s.box.width(),l.position==Xi?(r.r=Vt.abs((r.r-n)/2)+n,e=r.point(u),s.reflow(Xt(e.x,e.y-n/2,e.x,e.y))):l.position==Dn?(r.r=r.r-n/2,e=r.point(u),s.reflow(Xt(e.x,e.y-n/2,e.x,e.y))):(e=r.clone().expand(c).point(u),e.x>=r.c.x?(t=e.x+i,s.orientation=yo):(t=e.x-i,s.orientation=zn),s.reflow(Xt(t,e.y-n,e.x,e.y))))},createVisual:function(){var e,t,i=this,n=i.sector,o=i.options;Kt.fn.createVisual.call(this),i.value&&(o.visual?(e=(n.startAngle+180)%360,t=o.visual({category:i.category,dataItem:i.dataItem,value:i.value,series:i.series,percentage:i.percentage,center:new Pi.Point(n.c.x,n.c.y),radius:n.r,innerRadius:n.ir,startAngle:e,endAngle:e+n.angle,options:o,createVisual:function(){var e=new Ti.Group;return i.createSegmentVisual(e),e}}),t&&i.visual.append(t)):i.createSegmentVisual(i.visual))},createSegmentVisual:function(e){var t,i=this,n=i.sector,o=i.options,r=o.border||{},a=r.width>0?{stroke:{color:r.color,width:r.width,opacity:r.opacity,dashType:r.dashType}}:{},s=o.color,l={color:s,opacity:o.opacity};t=i.createSegment(n,Ut({fill:l,stroke:{opacity:o.opacity},zIndex:o.zIndex},a)),e.append(t),Y(o)&&e.append(this.createGradientOverlay(t,{baseColor:s,fallbackFill:l},Ut({center:[n.c.x,n.c.y],innerRadius:n.ir,radius:n.r,userSpace:!0},o.overlay)))},createSegment:function(e,t){return t.singleSegment?new Ti.Circle(new Pi.Circle(new Pi.Point(e.c.x,e.c.y),e.r),t):ai.current.createRing(e,t)},createAnimation:function(){var e=this.options,t=this.sector.c;Ut(e,{animation:{center:[t.x,t.y],delay:this.animationDelay}}),Kt.fn.createAnimation.call(this)},createHighlight:function(e){var t=this,i=t.options.highlight||{},n=i.border||{};return t.createSegment(t.sector,Ut({},e,{fill:{color:i.color,opacity:i.opacity},stroke:{opacity:n.opacity,width:n.width,color:n.color}}))},highlightVisual:function(){return this.visual.children[0]},highlightVisualArgs:function(){var e=this.sector;return{options:this.options,radius:e.r,innerRadius:e.ir,center:new Pi.Point(e.c.x,e.c.y),startAngle:e.startAngle,endAngle:e.angle+e.startAngle,visual:this.visual}},tooltipAnchor:function(e,t){var i=this,n=i.sector.adjacentBox(Wo,e,t);return new ii(n.x1,n.y1)},formatValue:function(e){var t=this;return t.owner.formatPointValue(t,e)}}),Ut(Qe.fn,pe),$e={createLegendItem:function(e,t,i){var n,o,r,a,s,l=this,c=l.options.legend||{},u=c.labels||{},h=c.inactiveItems||{},p=h.labels||{};i&&i.visibleInLegend!==!1&&(s=i.visible!==!1,n=i.category||"",o=s?u.template:p.template||u.template,o&&(n=jt(o)({text:n,series:i.series,dataItem:i.dataItem,percentage:i.percentage,value:e})),s?(a={},r=t.color):(a={color:p.color,font:p.font},r=(h.markers||{}).color),n&&l.legendItems.push({pointIndex:i.index,text:n,series:i.series,markerColor:r,labels:a}))}},Je=Kt.extend({init:function(e,t){var i=this;Kt.fn.init.call(i,t),i.plotArea=e,i.points=[],i.legendItems=[],i.render()},options:{startAngle:90,connectors:{width:1,color:"#939393",padding:4},inactiveItems:{markers:{},labels:{}}},render:function(){var e=this;e.traverseDataPoints(Dt(e.addValue,e))},traverseDataPoints:function(e){var t,i,n,o,r,a,s,l,c,u,h,p,d,f=this,g=f.options,m=f.plotArea.options.seriesColors||[],x=m.length,v=g.series,y=v.length,b=0;for(o=0;y>o;o++){for(t=v[o],a=t.data,h=q(t),s=360/h,p=yi(t.startAngle)?t.startAngle:g.startAngle,o!=y-1&&t.labels.position==uo&&(t.labels.position=Xi),d=0;a.length>d;d++)i=ie.current.bindPoint(t,d),l=i.valueFields.value,c=Vt.abs(l),n=i.fields,r=c*s,u=1!=a.length&&!!n.explode,Nt(t.color)||(t.color=n.color||m[d%x]),e(l,new oi(null,0,0,p,r),{owner:f,category:n.category||"",index:b,series:t,seriesIx:o,dataItem:a[d],percentage:0!==h?c/h:0,explode:u,visibleInLegend:n.visibleInLegend,visible:n.visible,zIndex:y-o,animationDelay:f.animationDelay(d,o,y)}),i.fields.visible!==!1&&(p+=r),b++;b=0}},evalSegmentOptions:function(e,t,i){var n=i.series;O(e,{value:t,series:n,dataItem:i.dataItem,category:i.category,percentage:i.percentage},{defaults:n._defaults,excluded:["data","template","visual","toggle"]})},addValue:function(e,t,i){var n,o=this,r=Ut({},i.series,{index:i.index});o.evalSegmentOptions(r,e,i),o.createLegendItem(e,r,i),i.visible!==!1&&(n=new Qe(e,t,r),Lt(n,i),o.append(n),o.points.push(n))},reflow:function(e){var t,i,n,o,r,a,s,l,c=this,u=c.options,h=e.clone(),p=5,d=Vt.min(h.width(),h.height()),f=d/2,g=d-.85*d,m=Si(u.padding,g),x=Xt(h.x1,h.y1,h.x1+d,h.y1+d),v=x.center(),y=c.seriesConfigs||[],b=h.center(),w=c.points,_=w.length,A=u.series.length,C=[],k=[];for(m=m>f-p?f-p:m,x.translate(b.x-v.x,b.y-v.y),a=f-m,l=ii(a+x.x1+m,a+x.y1+m),s=0;_>s;s++)o=w[s],r=o.sector,r.r=a,r.c=l,i=o.seriesIx,y.length&&(t=y[i],r.ir=t.ir,r.r=t.r),i==A-1&&o.explode&&(r.c=r.clone().radius(.15*r.r).point(r.middle())),o.reflow(x),n=o.label,n&&n.options.position===uo&&i==A-1&&(n.orientation===yo?k.push(n):C.push(n));C.length>0&&(C.sort(c.labelComparator(!0)),c.leftLabelsReflow(C)),k.length>0&&(k.sort(c.labelComparator(!1)),c.rightLabelsReflow(k)),c.box=x},leftLabelsReflow:function(e){var t=this,i=t.distanceBetweenLabels(e);t.distributeLabels(i,e)},rightLabelsReflow:function(e){var t=this,i=t.distanceBetweenLabels(e);t.distributeLabels(i,e)},distanceBetweenLabels:function(e){var t,i,n,o=this,r=o.points,a=r[r.length-1],s=a.sector,l=e[0].box,c=e.length-1,u=s.r+a.options.labels.distance,h=[];for(i=mi(l.y1-(s.c.y-u-l.height()-l.height()/2)),h.push(i),n=0;c>n;n++)l=e[n].box,t=e[n+1].box,i=mi(t.y1-l.y2),h.push(i);return i=mi(s.c.y+u-e[c].box.y2-e[c].box.height()/2),h.push(i),h},distributeLabels:function(e,t){var i,n,o,r,a=this,s=e.length;for(r=0;s>r;r++)for(n=o=r,i=-e[r];i>0&&(n>=0||s>o);)i=a._takeDistance(e,r,--n,i),i=a._takeDistance(e,r,++o,i);a.reflowLabels(e,t)},_takeDistance:function(e,t,i,n){if(e[i]>0){var o=Vt.min(e[i],n);n-=o,e[i]-=o,e[t]+=o}return n},reflowLabels:function(e,t){var i,n,o,r,a=this,s=a.points,l=s[s.length-1],c=l.sector,u=t.length,h=l.options.labels,p=h.distance,d=c.c.y-(c.r+p)-t[0].box.height();for(e[0]+=2,r=0;u>r;r++)i=t[r],d+=e[r],o=i.box,n=a.hAlignLabel(o.x2,c.clone().expand(p),d,d+o.height(),i.orientation==yo),i.orientation==yo?(h.align!==Ki&&(n=c.r+c.c.x+p),i.reflow(Xt(n+o.width(),d,n,d))):(h.align!==Ki&&(n=c.c.x-c.r-p),i.reflow(Xt(n-o.width(),d,n,d))),d+=o.height()},createVisual:function(){var e,t,i,n,r,a,s,l,c,u,h,p,d,f,g=this,m=g.options,x=m.connectors,v=g.points,y=v.length,b=4;for(Kt.fn.createVisual.call(this),this._connectorLines=[],s=0;y>s;s++)n=v[s],t=n.sector,i=t.middle(),a=n.label,r={seriesId:n.seriesIx},a&&(e=new Ti.Path({stroke:{color:x.color,width:x.width},animation:{type:Cn,delay:n.animationDelay}}),a.options.position===uo&&0!==n.value&&(l=a.box,c=t.c,u=t.point(i),h=ii(l.x1,l.center().y),u=t.clone().expand(x.padding).point(i),e.moveTo(u.x,u.y),a.orientation==yo?(d=ii(l.x1-x.padding,l.center().y),f=o(c,u,h,d),h=ii(d.x-b,d.y),f=f||h,f.x=Vt.min(f.x,h.x),g.pointInCircle(f,t.c,t.r+b)||t.c.x>f.x?(p=t.c.x+t.r+b,n.options.labels.align!==Ji?h.x>p?e.lineTo(p,u.y):e.lineTo(u.x+2*b,u.y):e.lineTo(p,u.y),e.lineTo(h.x,d.y)):(f.y=d.y,e.lineTo(f.x,f.y))):(d=ii(l.x2+x.padding,l.center().y),f=o(c,u,h,d),h=ii(d.x+b,d.y),f=f||h,f.x=Vt.max(f.x,h.x),g.pointInCircle(f,t.c,t.r+b)||f.x>t.c.x?(p=t.c.x-t.r-b,n.options.labels.align!==Ji?p>h.x?e.lineTo(p,u.y):e.lineTo(u.x-2*b,u.y):e.lineTo(p,u.y),e.lineTo(h.x,d.y)):(f.y=d.y,e.lineTo(f.x,f.y))),e.lineTo(d.x,d.y),this._connectorLines.push(e),this.visual.append(e)))},labelComparator:function(e){return e=e?-1:1,function(t,i){return t=(t.parent.sector.middle()+270)%360,i=(i.parent.sector.middle()+270)%360,(t-i)*e}},hAlignLabel:function(e,t,i,n,o){var r=t.c.x,a=t.c.y,s=t.r,l=Vt.min(Vt.abs(a-i),Vt.abs(a-n));return l>s?e:r+Vt.sqrt(s*s-l*l)*(o?1:-1)},pointInCircle:function(e,t,i){return h(t.x-e.x)+h(t.y-e.y)<h(i)},formatPointValue:function(e,t){return ui(t,e.value)},animationDelay:function(e){return e*po}}),Ut(Je.fn,$e),et=Qe.extend({options:{overlay:{gradient:wo},labels:{position:Xi},animation:{type:ho}},reflowLabel:function(){var e,t,i=this,n=i.sector.clone(),o=i.options,r=i.label,a=o.labels,s=n.middle();r&&(t=r.box.height(),a.position==Xi?(n.r-=(n.r-n.ir)/2,e=n.point(s),r.reflow(new Xt(e.x,e.y-t/2,e.x,e.y))):Qe.fn.reflowLabel.call(i))},createSegment:function(e,t){return ai.current.createRing(e,t)}}),Ut(et.fn,pe),tt=Je.extend({options:{startAngle:90,connectors:{width:1,color:"#939393",padding:4}},addValue:function(e,t,i){var n,o=this,r=Ut({},i.series,{index:i.index});o.evalSegmentOptions(r,e,i),o.createLegendItem(e,r,i),e&&i.visible!==!1&&(n=new et(e,t,r),Lt(n,i),o.append(n),o.points.push(n))},reflow:function(e){var t,i,n,o,r,a,s=this,l=s.options,c=e.clone(),u=5,h=Vt.min(c.width(),c.height()),p=h/2,d=h-.85*h,f=Si(l.padding,d),g=l.series,m=g.length,x=0,v=0,y=0,b=0;for(s.seriesConfigs=[],f=f>p-u?p-u:f,n=p-f,r=0;m>r;r++)t=g[r],0===r&&yi(t.holeSize)&&(i=t.holeSize,n-=t.holeSize),yi(t.size)?n-=t.size:x++,yi(t.margin)&&r!=m-1&&(n-=t.margin);for(yi(i)||(b=(p-f)/(m+.75),i=.75*b,n-=i),y=i,r=0;m>r;r++)t=g[r],o=Si(t.size,n/x),y+=v,a=y+o,s.seriesConfigs.push({ir:y,r:a}),v=t.margin||0,y=a;Je.fn.reflow.call(s,e)},animationDelay:function(e,t,i){return e*fn+Bn*(t+1)/(i+1)}}),it=ye.extend({render:function(){ye.fn.render.call(this),this.createSegments()},traverseDataPoints:function(e){var t,i,n,o,r,a,s,l,c,h,p=this.options.series,d=this.categoryAxis.options.categories||[],f=u(p),g=!this.options.invertAxes;for(t=0;p.length>t;t++)for(i=p[t],n=0,o=0,r=0;f>r;r++)a=ie.current.bindPoint(i,r),s=a.valueFields.value,l=a.fields.summary,c=n,l?"total"===l.toLowerCase()?(a.valueFields.value=n,c=0,h=n):(a.valueFields.value=o,h=c-o,o=0):B(s)&&(o+=s,n+=s,h=n),e(a,{category:d[r],categoryIx:r,series:i,seriesIx:t,total:n,runningTotal:o,from:c,to:h,isVertical:g})},updateRange:function(e,t){ye.fn.updateRange.call(this,{value:t.to},t)},aboveAxis:function(e){return e.value>=0},plotRange:function(e){return[e.from,e.to]},createSegments:function(){var e,t,i,n,o,r,a,s=this.options.series,l=this.seriesPoints,c=this.segments=[];for(e=0;s.length>e;e++)if(t=s[e],i=l[e])for(o=0;i.length>o;o++)r=i[o],r&&n&&(a=new nt(n,r,t),c.push(a),this.append(a)),n=r}}),nt=Kt.extend({init:function(e,t,i){var n=this;Kt.fn.init.call(n),n.from=e,n.to=t,n.series=i},options:{animation:{type:Cn,delay:Bn}},linePoints:function(){var e,t,i=[],n=this.from,o=n.box,r=this.to.box;return n.isVertical?(e=n.aboveAxis?o.y1:o.y2,i.push([o.x1,e],[r.x2,e])):(t=n.aboveAxis?o.x2:o.x1,i.push([t,o.y1],[t,r.y2])),i},createVisual:function(){var e,t;Kt.fn.createVisual.call(this),e=this.series.line||{},t=Ti.Path.fromPoints(this.linePoints(),{stroke:{color:e.color,width:e.width,opacity:e.opacity,dashType:e.dashType}}),ci(t),this.visual.append(t)}}),ot=Wt.extend({init:function(e){var t=this;Wt.fn.init.call(t,e),e=t.options,t.id=Et.guid(),t.createTitle(),t.content=new Kt,t.chartContainer=new rt({},t),t.append(t.content),t.axes=[],t.charts=[]},options:{zIndex:-1,shrinkToFit:!0,title:{align:zn},visible:!0},createTitle:function(){var e=this,t=e.options.title;typeof t===lo&&(t=Ut({},t,{align:t.position,position:Yo})),e.title=li.buildTitle(t,e,ot.fn.options.title)},appendAxis:function(e){var t=this;t.content.append(e),t.axes.push(e),e.pane=t},appendChart:function(e){var t=this;t.chartContainer.parent!==t.content&&t.content.append(t.chartContainer),t.charts.push(e),t.chartContainer.append(e),e.pane=t},empty:function(){var e,t=this,i=t.parent;if(i){for(e=0;t.axes.length>e;e++)i.removeAxis(t.axes[e]);for(e=0;t.charts.length>e;e++)i.removeChart(t.charts[e])}t.axes=[],t.charts=[],t.content.destroy(),t.content.children=[],t.chartContainer.children=[]},reflow:function(e){var t,i=this;bi(i.children)===i.content&&(t=i.children.pop()),Wt.fn.reflow.call(i,e),t&&i.children.push(t),i.title&&(i.contentBox.y1+=i.title.box.height())},visualStyle:function(){var e=Wt.fn.visualStyle.call(this);return e.zIndex=-10,e},renderComplete:function(){this.options.visible&&this.createGridLines()},stackRoot:i,clipRoot:i,createGridLines:function(){var e,t,i,n,o,r,a=this,s=a.axes,l=s.concat(a.parent.axes),c=[],u=[];for(t=0;s.length>t;t++)for(n=s[t],o=n.options.vertical,e=o?c:u,i=0;l.length>i;i++)0===e.length&&(r=l[i],o!==r.options.vertical&&vi(e,n.createGridLines(r)))},refresh:function(){this.visual.clear(),this.content.parent=null,this.content.createGradient=e.proxy(this.createGradient,this),this.content.renderVisual(),this.content.parent=this,this.title&&this.visual.append(this.title.visual),this.visual.append(this.content.visual),this.renderComplete()},clipBox:function(){return this.chartContainer.clipBox}}),rt=Kt.extend({init:function(e,t){var i=this;Kt.fn.init.call(i,e),i.pane=t},shouldClip:function(){var e,t=this,i=t.children,n=i.length;for(e=0;n>e;e++)if(i[e].options.clip===!0)return!0;return!1},_clipBox:function(){var e,t,i,n,o=this,r=o.pane,a=r.axes,s=a.length,l=r.box.clone();for(t=0;s>t;t++)n=a[t],e=n.options.vertical?ar:rr,i=n.lineBox(),l[e+1]=i[e+1],l[e+2]=i[e+2];return l},createVisual:function(){var e,t,i;this.visual=new Ti.Group({zIndex:0}),this.shouldClip()&&(e=this.clipBox=this._clipBox(),t=e.toRect(),i=Ti.Path.fromRect(t),this.visual.clip(i),this.unclipLabels())},stackRoot:i,unclipLabels:function(){var e,t,i,n,o,r=this,a=r.children,s=r.clipBox;for(i=0;a.length>i;i++)for(e=a[i].points||{},o=e.length,n=0;o>n;n++)t=e[n],t&&t.label&&t.label.options.visible&&t.overlapsBox(s)&&(t.label.alignToClipBox&&t.label.alignToClipBox(s),t.label.options.noclip=!0)},destroy:function(){Kt.fn.destroy.call(this),delete this.parent}}),at=Kt.extend({init:function(e,t){var i=this;Kt.fn.init.call(i,t),i.series=e,i.initSeries(),i.charts=[],i.options.legend.items=[],i.axes=[],i.crosshairs=[],i.createPanes(),i.render(),i.createCrosshairs()},options:{series:[],plotArea:{margin:{}},background:"",border:{color:Mi,width:0},legend:{inactiveItems:{labels:{color:"#919191"},markers:{color:"#919191"}}}},initSeries:function(){var e,t,i=this.series;for(e=0;i.length>e;e++)t=i[e],t.index=e},createPanes:function(){var e,t,i=this,n=[],o=i.options.panes||[],r=Vt.max(o.length,1);for(e=0;r>e;e++)t=new ot(o[e]),t.paneIndex=e,n.push(t),i.append(t);i.panes=n},createCrosshairs:function(e){var t,i,n,o,r,a=this;for(e=e||a.panes,t=0;e.length>t;t++)for(n=e[t],i=0;n.axes.length>i;i++)o=n.axes[i],o.options.crosshair&&o.options.crosshair.visible&&(r=new vt(o,o.options.crosshair),a.crosshairs.push(r),n.content.append(r))},removeCrosshairs:function(e){var t,i,n=this,o=n.crosshairs,r=e.axes;for(t=o.length-1;t>=0;t--)for(i=0;r.length>i;i++)if(o[t].axis===r[i]){o.splice(t,1);break}},hideCrosshairs:function(){var e,t=this.crosshairs;for(e=0;t.length>e;e++)t[e].hide()},findPane:function(e){var t,i,n=this,o=n.panes;for(t=0;o.length>t;t++)if(o[t].options.name===e){i=o[t];break}return i||o[0]},findPointPane:function(e){var t,i,n=this,o=n.panes;for(t=0;o.length>t;t++)if(o[t].box.containsPoint(e)){i=o[t];break}return i},appendAxis:function(e){var t=this,i=t.findPane(e.options.pane);i.appendAxis(e),t.axes.push(e),e.plotArea=t},removeAxis:function(e){var t,i,n=this,o=[];for(t=0;n.axes.length>t;t++)i=n.axes[t],e!==i?o.push(i):i.destroy();n.axes=o},appendChart:function(e,t){var i=this;i.charts.push(e),t?t.appendChart(e):i.append(e)},removeChart:function(e){var t,i,n=this,o=[];for(t=0;n.charts.length>t;t++)i=n.charts[t],i!==e?o.push(i):i.destroy();n.charts=o},addToLegend:function(e){var t,i,n,o,r,a,s,l,c,u=e.length,h=[],p=this.options.legend,d=p.labels||{},f=p.inactiveItems||{},g=f.labels||{};for(t=0;u>t;t++)i=e[t],l=i.visible!==!1,i.visibleInLegend!==!1&&(n=i.name||"",c=l?d.template:g.template||d.template,c&&(n=jt(c)({text:n,series:i})),o=i.color,s=i._defaults,Nt(o)&&s&&(o=s.color),l?(r={},a=o):(r={color:g.color,font:g.font},a=f.markers.color),n&&h.push({text:n,labels:r,markerColor:a,series:i,active:l}));vi(p.items,h)},groupAxes:function(e){var t,i,n,o,r=[],a=[];for(n=0;e.length>n;n++)for(t=e[n].axes,o=0;t.length>o;o++)i=t[o],i.options.vertical?a.push(i):r.push(i);return{x:r,y:a,any:r.concat(a)}},groupSeriesByPane:function(){var e,t,i,n=this,o=n.series,r={};for(e=0;o.length>e;e++)i=o[e],t=n.seriesPaneName(i),r[t]?r[t].push(i):r[t]=[i];return r},filterVisibleSeries:function(e){var t,i,n=[];for(t=0;e.length>t;t++)i=e[t],i.visible!==!1&&n.push(i);return n},reflow:function(e){var t=this,i=t.options.plotArea,n=t.panes,o=pi(i.margin);t.box=e.clone().unpad(o),t.reflowPanes(),t.reflowAxes(n),t.reflowCharts(n)},redraw:function(e){var t,i=this;for(e=[].concat(e),this.initSeries(),t=0;e.length>t;t++)i.removeCrosshairs(e[t]),e[t].empty();for(i.render(e),i.reflowAxes(i.panes),i.reflowCharts(e),i.createCrosshairs(e),t=0;e.length>t;t++)e[t].refresh()},axisCrossingValues:function(e,t){var i,n=e.options,o=[].concat(n.axisCrossingValues||n.axisCrossingValue),r=t.length-o.length,a=o[0]||0;for(i=0;r>i;i++)o.push(a);return o},alignAxisTo:function(e,t,i,n){var o=e.getSlot(i,i,!0),r=e.options.reverse?2:1,a=t.getSlot(n,n,!0),s=t.options.reverse?2:1,l=e.box.translate(a[rr+s]-o[rr+r],a[ar+s]-o[ar+r]);e.pane!==t.pane&&l.translate(0,e.pane.box.y1-t.pane.box.y1),e.reflow(l)},alignAxes:function(e,t){var i,n,o,r,a=this,s=e[0],l=t[0],c=a.axisCrossingValues(s,t),u=a.axisCrossingValues(l,e),h={},p={},d={},f={};for(r=0;t.length>r;r++)o=t[r],i=o.pane,n=i.id,a.alignAxisTo(o,s,u[r],c[r]),o.options._overlap||(mi(o.lineBox().x1)===mi(s.lineBox().x1)&&(h[n]&&o.reflow(o.box.alignTo(h[n].box,zn).translate(-o.options.margin,0)),h[n]=o),mi(o.lineBox().x2)===mi(s.lineBox().x2)&&(o._mirrored||(o.options.labels.mirror=!o.options.labels.mirror,o._mirrored=!0),a.alignAxisTo(o,s,u[r],c[r]),p[n]&&o.reflow(o.box.alignTo(p[n].box,yo).translate(o.options.margin,0)),p[n]=o),0!==r&&l.pane===o.pane&&(o.alignTo(l),o.reflow(o.box)));for(r=0;e.length>r;r++)o=e[r],i=o.pane,n=i.id,a.alignAxisTo(o,l,c[r],u[r]),o.options._overlap||(mi(o.lineBox().y1)===mi(l.lineBox().y1)&&(o._mirrored||(o.options.labels.mirror=!o.options.labels.mirror,o._mirrored=!0),a.alignAxisTo(o,l,c[r],u[r]),d[n]&&o.reflow(o.box.alignTo(d[n].box,Yo).translate(0,-o.options.margin)),d[n]=o),mi(o.lineBox().y2,en)===mi(l.lineBox().y2,en)&&(f[n]&&o.reflow(o.box.alignTo(f[n].box,Hi).translate(0,o.options.margin)),f[n]=o),0!==r&&(o.alignTo(s),o.reflow(o.box)))},shrinkAxisWidth:function(e){var t,i,n,o=this,r=o.groupAxes(e).any,a=P(r),s=0;for(t=0;e.length>t;t++)i=e[t],i.axes.length>0&&(s=Vt.max(s,a.width()-i.contentBox.width()));if(0!==s)for(t=0;r.length>t;t++)n=r[t],n.options.vertical||n.reflow(n.box.shrink(s,0))},shrinkAxisHeight:function(e){var t,i,n,o,r,a,s;for(t=0;e.length>t;t++)if(i=e[t],n=i.axes,o=Vt.max(0,P(n).height()-i.contentBox.height()),0!==o){for(r=0;n.length>r;r++)a=n[r],a.options.vertical&&a.reflow(a.box.shrink(0,o));s=!0}return s},fitAxes:function(e){var t,i,n,o,r,a,s,l,c=this,u=c.groupAxes(e).any,h=0;for(s=0;e.length>s;s++)if(r=e[s],t=r.axes,i=r.contentBox,t.length>0)for(n=P(t),h=Vt.max(h,i.x1-n.x1),o=Vt.max(i.y1-n.y1,i.y2-n.y2),l=0;t.length>l;l++)a=t[l],a.reflow(a.box.translate(0,o));for(s=0;u.length>s;s++)a=u[s],a.reflow(a.box.translate(h,0))},reflowAxes:function(e){var t,i=this,n=i.groupAxes(e);for(t=0;e.length>t;t++)i.reflowPaneAxes(e[t]);n.x.length>0&&n.y.length>0&&(i.alignAxes(n.x,n.y),i.shrinkAxisWidth(e),i.autoRotateAxisLabels(n),i.alignAxes(n.x,n.y),i.shrinkAxisWidth(e)&&i.alignAxes(n.x,n.y),i.shrinkAxisHeight(e),i.alignAxes(n.x,n.y),i.shrinkAxisHeight(e)&&i.alignAxes(n.x,n.y),i.fitAxes(e))},autoRotateAxisLabels:function(e){var t,i,n,o=this.axes,r=this.panes;for(i=0;o.length>i;i++)t=o[i],t.autoRotateLabels()&&(n=!0);if(n){for(i=0;r.length>i;i++)this.reflowPaneAxes(r[i]);e.x.length>0&&e.y.length>0&&(this.alignAxes(e.x,e.y),this.shrinkAxisWidth(r))}},reflowPaneAxes:function(e){var t,i=e.axes,n=i.length;if(n>0)for(t=0;n>t;t++)i[t].reflow(e.contentBox)},reflowCharts:function(e){var t,i,n=this,o=n.charts,r=o.length,a=n.box;for(i=0;r>i;i++)t=o[i].pane,(!t||di(t,e))&&o[i].reflow(a)},reflowPanes:function(){var e,t,i,n,o,r=this,a=r.box,s=r.panes,l=s.length,c=a.height(),u=l,h=0,p=a.y1;for(e=0;l>e;e++)t=s[e],n=t.options.height,t.options.width=a.width(),t.options.height?(n.indexOf&&n.indexOf("%")&&(o=parseInt(n,10)/100,t.options.height=o*a.height()),t.reflow(a.clone()),c-=t.options.height):h++;for(e=0;l>e;e++)t=s[e],t.options.height||(t.options.height=c/h);for(e=0;l>e;e++)t=s[e],i=a.clone().move(a.x1,p),t.reflow(i),u--,p+=t.options.height},backgroundBox:function(){var e,t,i,n,o,r,a=this,s=a.axes,l=s.length;for(i=0;l>i;i++)for(o=s[i],n=0;l>n;n++)r=s[n],o.options.vertical!==r.options.vertical&&(e=o.lineBox().clone().wrap(r.lineBox()),t=t?t.wrap(e):e);return t||a.box},createVisual:function(){var e,t,i,n,o,r;Kt.fn.createVisual.call(this),e=this.backgroundBox(),t=this.options.plotArea,i=t.border||{},n=t.background,o=t.opacity,xi.isTransparent(n)&&(n=or,o=0),r=this._bgVisual=Ti.Path.fromRect(e.toRect(),{fill:{color:n,opacity:o},stroke:{color:i.width?i.color:"",width:i.width,dashType:i.dashType},zIndex:-1}),this.appendVisual(r)},pointsByCategoryIndex:function(e){var t,i,n,o,r,a=this.charts,s=[];if(null!==e)for(t=0;a.length>t;t++)if(r=a[t],"_navigator"!==r.pane.options.name&&(n=a[t].categoryPoints[e],n&&n.length))for(i=0;n.length>i;i++)o=n[i],o&&yi(o.value)&&null!==o.value&&s.push(o);return s},pointsBySeriesIndex:function(e){var t,i,n,o,r,a=this.charts,s=[];for(n=0;a.length>n;n++)for(r=a[n],t=r.points,o=0;t.length>o;o++)i=t[o],i&&i.options.index===e&&s.push(i);return s},pointsBySeriesName:function(e){var t,i,n,o,r,a=this.charts,s=[];for(n=0;a.length>n;n++)for(r=a[n],t=r.points,o=0;t.length>o;o++)i=t[o],i&&i.series.name===e&&s.push(i);return s},paneByPoint:function(e){var t,i,n=this,o=n.panes;for(i=0;o.length>i;i++)if(t=o[i],t.box.containsPoint(e))return t}}),st=at.extend({init:function(e,t){var i,n,o=this;if(o.namedCategoryAxes={},o.namedValueAxes={},o.valueAxisRangeTracker=new lt,e.length>0)for(o.invertAxes=di(e[0].type,[Ei,Gi,tr,Jo,mo,Rn]),i=0;e.length>i;i++)if(n=e[i].stack,n&&"100%"===n.type){o.stack100=!0;break}at.fn.init.call(o,e,t)},options:{categoryAxis:{categories:[]},valueAxis:{}},render:function(e){var t=this;e=e||t.panes,t.createCategoryAxes(e),t.aggregateCategories(e),t.createCategoryAxesLabels(e),t.createCharts(e),t.createValueAxes(e)},removeAxis:function(e){var t=this,i=e.options.name;at.fn.removeAxis.call(t,e),e instanceof se?delete t.namedCategoryAxes[i]:(t.valueAxisRangeTracker.reset(i),delete t.namedValueAxes[i]),e===t.categoryAxis&&delete t.categoryAxis,e===t.valueAxis&&delete t.valueAxis},createCharts:function(e){var t,i,n,o,r,a,s=this.groupSeriesByPane();for(t=0;e.length>t;t++)if(i=e[t],n=s[i.options.name||"default"]||[],this.addToLegend(n),o=this.filterVisibleSeries(n))for(r=this.groupSeriesByCategoryAxis(o),a=0;r.length>a;a++)this.createChartGroup(r[a],i)},createChartGroup:function(e,t){this.createAreaChart(F(e,[Vi,Jo]),t),this.createBarChart(F(e,[Ji,Ei]),t),this.createRangeBarChart(F(e,[xo,mo]),t),this.createBulletChart(F(e,[Gi,er]),t),this.createCandlestickChart(F(e,qi),t),this.createBoxPlotChart(F(e,Ni),t),this.createOHLCChart(F(e,co),t),this.createWaterfallChart(F(e,[ir,Rn]),t),this.createLineChart(F(e,[Un,tr]),t)},aggregateCategories:function(e){var t,i,n,o,r,a=this,s=a.srcSeries||a.series,l=[];for(t=0;s.length>t;t++)i=s[t],n=a.seriesCategoryAxis(i),o=a.findPane(n.options.pane),r=T(n.options.type,an),(r||i.categoryField)&&di(o,e)?i=a.aggregateSeries(i,n):(B(n.options.min)||B(n.options.max))&&(i=a.filterSeries(i,n)),l.push(i);a.srcSeries=s,a.series=l},filterSeries:function(e,t){var i,n,o,r=t.totalRangeIndices(),a=t.options.justified,s=di(e.type,[Un,tr,Vi,Jo]);return r.min=B(t.options.min)?Vt.floor(r.min):0,r.max=B(t.options.max)?a?Vt.floor(r.max)+1:Vt.ceil(r.max):e.data.length,e=Ut({},e),s&&(n=r.min-1,o=t.options.srcCategories||[],n>=0&&e.data.length>n&&(i=n,e._outOfRangeMinPoint={item:e.data[i],category:o[i],categoryIx:-1}),e.data.length>r.max&&(i=r.max,e._outOfRangeMaxPoint={item:e.data[i],category:o[i],categoryIx:r.max-r.min})),t._seriesMax=Vt.max(t._seriesMax||0,e.data.length),e.data=(e.data||[]).slice(r.min,r.max),e},aggregateSeries:function(e,t){var i,o,r,a,s,l,c,u=t.options,h=T(t.options.type,an),f=u.categories,g=u.srcCategories||f,m=e.data,x=[],v=Ut({},e),y=Ut({},e),b=u.dataItems||[],w=p,_=xi.MIN_NUM,A=xi.MAX_NUM,C=di(e.type,[Un,tr,Vi,Jo]);for(v.data=a=[],h&&(w=d),i=0;m.length>i;i++)o=e.categoryField?w(e.categoryField,m[i]):g[i],yi(o)&&(r=t.categoryIndex(o),r>=0&&f.length>r?(x[r]=x[r]||[],x[r].push(i)):C&&(0>r?r==_?l.points.push(i):r>_&&(_=r,l={category:o,points:[i]}):r>=f.length&&(r==A?c.points.push(i):A>r&&(A=r,c={category:o,points:[i]}))));for(s=new kt(y,ie.current,n.current),i=0;f.length>i;i++)a[i]=s.aggregatePoints(x[i],f[i]),x[i]&&(b[i]=a[i]);return l&&a.length&&(v._outOfRangeMinPoint={item:s.aggregatePoints(l.points,l.category),categoryIx:_,category:l.category}),c&&a.length&&(v._outOfRangeMaxPoint={item:s.aggregatePoints(c.points,c.category),categoryIx:A,category:c.category}),t.options.dataItems=b,v},appendChart:function(e,t){for(var i=this,n=e.options.series,o=i.seriesCategoryAxis(n[0]),r=o.options.categories,a=Vt.max(0,u(n)-r.length);a--;)r.push("");i.valueAxisRangeTracker.update(e.valueAxisRanges),at.fn.appendChart.call(i,e,t)},seriesPaneName:function(t){
var i=this,n=i.options,o=t.axis,r=[].concat(n.valueAxis),a=e.grep(r,function(e){return e.name===o})[0],s=n.panes||[{}],l=(s[0]||{}).name||"default",c=(a||{}).pane||l;return c},seriesCategoryAxis:function(e){var t=this,i=e.categoryAxis,n=i?t.namedCategoryAxes[i]:t.categoryAxis;if(!n)throw Error("Unable to locate category axis with name "+i);return n},stackableChartOptions:function(e,t){var i,n=e.stack,o=n&&"100%"===n.type;return yi(t.options.clip)?i=t.options.clip:o&&(i=!1),{isStacked:n,isStacked100:o,clip:i}},groupSeriesByCategoryAxis:function(i){function n(t,n){return e.grep(i,function(e){return 0===n&&!e.categoryAxis||e.categoryAxis==t})}var o,r,a,s={},l=e.map(i,function(e){var i=e.categoryAxis||"$$default$$";return s.hasOwnProperty(i)?t:(s[i]=!0,i)}),c=[];for(o=0;l.length>o;o++)r=l[o],a=n(r,o),0!==a.length&&c.push(a);return c},createBarChart:function(e,t){if(0!==e.length){var i=this,n=e[0],o=new ye(i,Lt({series:e,invertAxes:i.invertAxes,gap:n.gap,spacing:n.spacing},i.stackableChartOptions(n,t)));i.appendChart(o,t)}},createRangeBarChart:function(e,t){if(0!==e.length){var i=this,n=e[0],o=new we(i,{series:e,invertAxes:i.invertAxes,gap:n.gap,spacing:n.spacing});i.appendChart(o,t)}},createBulletChart:function(e,t){if(0!==e.length){var i=this,n=e[0],o=new _e(i,{series:e,invertAxes:i.invertAxes,gap:n.gap,spacing:n.spacing,clip:t.options.clip});i.appendChart(o,t)}},createLineChart:function(e,t){if(0!==e.length){var i=this,n=e[0],o=new Le(i,Lt({invertAxes:i.invertAxes,series:e},i.stackableChartOptions(n,t)));i.appendChart(o,t)}},createAreaChart:function(e,t){if(0!==e.length){var i=this,n=e[0],o=new Me(i,Lt({invertAxes:i.invertAxes,series:e},i.stackableChartOptions(n,t)));i.appendChart(o,t)}},createOHLCChart:function(e,t){if(0!==e.length){var i=this,n=e[0],o=new We(i,{invertAxes:i.invertAxes,gap:n.gap,series:e,spacing:n.spacing,clip:t.options.clip});i.appendChart(o,t)}},createCandlestickChart:function(e,t){if(0!==e.length){var i=this,n=e[0],o=new Ye(i,{invertAxes:i.invertAxes,gap:n.gap,series:e,spacing:n.spacing,clip:t.options.clip});i.appendChart(o,t)}},createBoxPlotChart:function(e,t){if(0!==e.length){var i=this,n=e[0],o=new Ke(i,{invertAxes:i.invertAxes,gap:n.gap,series:e,spacing:n.spacing,clip:t.options.clip});i.appendChart(o,t)}},createWaterfallChart:function(e,t){if(0!==e.length){var i=this,n=e[0],o=new it(i,{series:e,invertAxes:i.invertAxes,gap:n.gap,spacing:n.spacing});i.appendChart(o,t)}},axisRequiresRounding:function(e,t){var i,n,o,r,a=this,s=F(a.series,fr);for(i=0;a.series.length>i;i++)o=a.series[i],(o.type===Un||o.type===Vi)&&(r=o.line,r&&r.style===Vo&&s.push(o));for(i=0;s.length>i;i++)if(n=s[i].categoryAxis||"",n===e||!n&&0===t)return!0},aggregatedAxis:function(e,t){var i,n,o=this,r=o.series;for(i=0;r.length>i;i++)if(n=r[i].categoryAxis||"",(n===e||!n&&0===t)&&r[i].categoryField)return!0},createCategoryAxesLabels:function(){var e,t=this.axes;for(e=0;t.length>e;e++)t[e]instanceof se&&t[e].createLabels()},createCategoryAxes:function(e){var t,i,n,o,r,a,s,l,c=this,u=c.invertAxes,h=[].concat(c.options.categoryAxis),p=[];for(t=0;h.length>t;t++)if(i=h[t],n=c.findPane(i.pane),di(n,e)){if(a=i.name,o=i.categories||[],r=i.type||"",i=Ut({vertical:u,axisCrossingValue:u?Yn:0,_deferLabels:!0},i),yi(i.justified)||(i.justified=c.isJustified()),c.axisRequiresRounding(a,t)&&(i.justified=!1),s=N(i,o[0])?new le(i):new se(i),a){if(c.namedCategoryAxes[a])throw Error("Category axis with name "+a+" is already defined");c.namedCategoryAxes[a]=s}s.axisIndex=t,p.push(s),c.appendAxis(s)}l=c.categoryAxis||p[0],c.categoryAxis=l,u?c.axisY=l:c.axisX=l},isJustified:function(){var e,t,i=this,n=i.series;for(e=0;n.length>e;e++)if(t=n[e],!di(t.type,[Vi,Jo]))return!1;return!0},createValueAxes:function(e){var t,i,n,o,r,a,s,l,c,u=this,h=u.valueAxisRangeTracker,p=h.query(),d=[].concat(u.options.valueAxis),f=u.invertAxes,g={vertical:!f},m=[];for(u.stack100&&(g.roundToMajorUnit=!1,g.labels={format:"P0"}),c=0;d.length>c;c++)if(t=d[c],i=u.findPane(t.pane),di(i,e)){if(l=t.name,s=T(t.type,jn)?{min:.1,max:1}:{min:0,max:1},r=h.query(l)||p||s,0===c&&r&&p&&(r.min=Vt.min(r.min,p.min),r.max=Vt.max(r.max,p.max)),a=T(t.type,jn)?ei:ti,n=new a(r.min,r.max,Ut({},g,t)),l){if(u.namedValueAxes[l])throw Error("Value axis with name "+l+" is already defined");u.namedValueAxes[l]=n}n.axisIndex=c,m.push(n),u.appendAxis(n)}o=u.valueAxis||m[0],u.valueAxis=o,f?u.axisX=o:u.axisY=o},click:function(t,i){var n,o,r,a=this,s=t._eventCoordinates(i),l=new ii(s.x,s.y),c=a.pointPane(l),u=[],h=[];if(c){for(n=c.axes,o=0;n.length>o;o++)r=n[o],r.getValue?R(h,r.getValue(l)):R(u,r.getCategory(l));0===u.length&&R(u,a.categoryAxis.getCategory(l)),u.length>0&&h.length>0&&t.trigger(fo,{element:e(i.target),originalEvent:i,category:S(u),value:S(h)})}},pointPane:function(e){var t,i,n=this,o=n.panes;for(i=0;o.length>i;i++)if(t=o[i],t.contentBox.containsPoint(e))return t},updateAxisOptions:function(e,t){var i=[].concat(e instanceof se?this.options.categoryAxis:this.options.valueAxis);Ut(i[e.axisIndex],t)}}),lt=Ot.extend({init:function(){var e=this;e.axisRanges={}},update:function(e){var t,i,n,o=this,r=o.axisRanges;for(n in e)t=r[n],i=e[n],r[n]=t=t||{min:Yn,max:Wn},t.min=Vt.min(t.min,i.min),t.max=Vt.max(t.max,i.max)},reset:function(e){this.axisRanges[e]=t},query:function(e){return this.axisRanges[e]}}),ct=at.extend({init:function(e,t){var i=this;i.namedXAxes={},i.namedYAxes={},i.xAxisRangeTracker=new lt,i.yAxisRangeTracker=new lt,at.fn.init.call(i,e,t)},options:{xAxis:{},yAxis:{}},render:function(e){var t,i,n,o,r=this,a=r.groupSeriesByPane();for(e=e||r.panes,t=0;e.length>t;t++)i=e[t],n=a[i.options.name||"default"]||[],r.addToLegend(n),o=r.filterVisibleSeries(n),o&&(r.createScatterChart(F(o,_o),i),r.createScatterLineChart(F(o,Ao),i),r.createBubbleChart(F(o,ji),i));r.createAxes(e)},appendChart:function(e,t){var i=this;i.xAxisRangeTracker.update(e.xAxisRanges),i.yAxisRangeTracker.update(e.yAxisRanges),at.fn.appendChart.call(i,e,t)},removeAxis:function(e){var t=this,i=e.options.name;at.fn.removeAxis.call(t,e),e.options.vertical?(t.yAxisRangeTracker.reset(i),delete t.namedYAxes[i]):(t.xAxisRangeTracker.reset(i),delete t.namedXAxes[i]),e===t.axisX&&delete t.axisX,e===t.axisY&&delete t.axisY},seriesPaneName:function(t){var i=this,n=i.options,o=t.xAxis,r=[].concat(n.xAxis),a=e.grep(r,function(e){return e.name===o})[0],s=t.yAxis,l=[].concat(n.yAxis),c=e.grep(l,function(e){return e.name===s})[0],u=n.panes||[{}],h=u[0].name||"default",p=(a||{}).pane||(c||{}).pane||h;return p},createScatterChart:function(e,t){var i=this;e.length>0&&i.appendChart(new Ne(i,{series:e,clip:t.options.clip}),t)},createScatterLineChart:function(e,t){var i=this;e.length>0&&i.appendChart(new je(i,{series:e,clip:t.options.clip}),t)},createBubbleChart:function(e,t){var i=this;e.length>0&&i.appendChart(new Ge(i,{series:e,clip:t.options.clip}),t)},createXYAxis:function(e,t,i){var n,o,r,a,s,l,c,u,h=this,p=e.name,d=t?h.namedYAxes:h.namedXAxes,f=t?h.yAxisRangeTracker:h.xAxisRangeTracker,g=Ut({},e,{vertical:t}),m=T(g.type,jn),x=f.query(),v=m?{min:.1,max:1}:{min:0,max:1},y=f.query(p)||x||v,b=h.series,w=[g.min,g.max];for(r=0;b.length>r;r++)if(a=b[r],s=a[t?"yAxis":"xAxis"],s==g.name||0===i&&!s){l=ie.current.bindPoint(a,0).valueFields,w.push(l[t?"y":"x"]);break}for(0===i&&x&&(y.min=Vt.min(y.min,x.min),y.max=Vt.max(y.max,x.max)),u=0;w.length>u;u++)if(w[u]instanceof Date){c=!0;break}if(o=T(g.type,an)||!g.type&&c?ce:m?ei:ti,n=new o(y.min,y.max,g),p){if(d[p])throw Error((t?"Y":"X")+" axis with name "+p+" is already defined");d[p]=n}return h.appendAxis(n),n},createAxes:function(e){var t,i=this,n=i.options,o=[].concat(n.xAxis),r=[],a=[].concat(n.yAxis),s=[];Pt(o,function(n){t=i.findPane(this.pane),di(t,e)&&r.push(i.createXYAxis(this,!1,n))}),Pt(a,function(n){t=i.findPane(this.pane),di(t,e)&&s.push(i.createXYAxis(this,!0,n))}),i.axisX=i.axisX||r[0],i.axisY=i.axisY||s[0]},click:function(t,i){var n,o,r,a,s=this,l=t._eventCoordinates(i),c=new ii(l.x,l.y),u=s.axes,h=u.length,p=[],d=[];for(n=0;h>n;n++)o=u[n],a=o.options.vertical?d:p,r=o.getValue(c),null!==r&&a.push(r);p.length>0&&d.length>0&&t.trigger(fo,{element:e(i.target),originalEvent:i,x:S(p),y:S(d)})},updateAxisOptions:function(e,t){var i=e.options.vertical,n=this.groupAxes(this.panes),o=M(e,i?n.y:n.x),r=[].concat(i?this.options.yAxis:this.options.xAxis)[o];Ut(r,t)}}),ut=at.extend({render:function(){var e=this,t=e.series;e.createPieChart(t)},createPieChart:function(e){var t=this,i=e[0],n=new Je(t,{series:e,padding:i.padding,startAngle:i.startAngle,connectors:i.connectors,legend:t.options.legend});t.appendChart(n)},appendChart:function(e,t){at.fn.appendChart.call(this,e,t),vi(this.options.legend.items,e.legendItems)}}),ht=ut.extend({render:function(){var e=this,t=e.series;e.createDonutChart(t)},createDonutChart:function(e){var t=this,i=e[0],n=new tt(t,{series:e,padding:i.padding,connectors:i.connectors,legend:t.options.legend});t.appendChart(n)}}),pt=Ti.Animation.extend({options:{easing:"easeOutElastic",duration:Bn},setup:function(){this.element.transform(Pi.transform().scale(Ro,Ro,this.options.center))},step:function(e){this.element.transform(Pi.transform().scale(e,e,this.options.center))}}),Ti.AnimationFactory.current.register(ho,pt),dt=Ti.Animation.extend({options:{easing:"easeOutElastic"},setup:function(){var e=this.center=this.element.bbox().center();this.element.transform(Pi.transform().scale(Ro,Ro,e))},step:function(e){this.element.transform(Pi.transform().scale(e,e,this.center))}}),Ti.AnimationFactory.current.register(ji,dt),ft=Ot.extend({init:function(){this._points=[]},destroy:function(){this._points=[]},show:function(e){var t,i;for(e=[].concat(e),this.hide(),t=0;e.length>t;t++)i=e[t],i&&i.toggleHighlight&&i.hasHighlight()&&(this.togglePointHighlight(i,!0),this._points.push(i))},togglePointHighlight:function(e,t){var i,n=(e.options.highlight||{}).toggle;n?(i={category:e.category,series:e.series,dataItem:e.dataItem,value:e.value,preventDefault:W,visual:e.highlightVisual(),show:t},n(i),i._defaultPrevented||e.toggleHighlight(t)):e.toggleHighlight(t)},hide:function(){for(var e=this._points;e.length;)this.togglePointHighlight(e.pop(),!1)},isHighlighted:function(e){var t,i,n=this._points;for(t=0;n.length>t;t++)if(i=n[t],e==i)return!0;return!1}}),gt=zt.extend({init:function(t,i){var n,o,r=this;zt.fn.init.call(r),r.options=Ut({},r.options,i),r.chartElement=t,r.template=gt.template,r.template||(r.template=gt.template=ki("<div class='"+nn+"tooltip "+nn+"chart-tooltip' style='display:none; position: absolute; font: #= d.font #;border: #= d.border.width #px solid;opacity: #= d.opacity #; filter: alpha(opacity=#= d.opacity * 100 #);'></div>")),n=pi(r.options.padding||{},"auto"),r.element=e(r.template(r.options)).css({"padding-top":n.top,"padding-right":n.right,"padding-bottom":n.bottom,"padding-left":n.left}),r.move=Dt(r.move,r),r._mouseleave=Dt(r._mouseleave,r),o=Et.format("[{0}='content'],[{0}='scroller']",Et.attr("role")),r._mobileScroller=t.closest(o).data("kendoMobileScroller")},destroy:function(){this._clearShowTimeout(),this.element&&(this.element.off(Qn).remove(),this.element=null)},options:{border:{width:1},opacity:1,animation:{duration:Xo}},move:function(){var e,t=this,i=t.options,n=t.element;t.anchor&&t.element&&(e=t._offset(),t.visible||n.css({top:e.top,left:e.left}),t.visible=!0,t._ensureElement(document.body),n.stop(!0,!0).show().animate({left:e.left,top:e.top},i.animation.duration))},_clearShowTimeout:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null)},_padding:function(){if(!this._chartPadding){var e=this.chartElement;this._chartPadding={top:parseInt(e.css("paddingTop"),10),left:parseInt(e.css("paddingLeft"),10)}}return this._chartPadding},_offset:function(){var t,i,n=this,o=n._measure(),r=n.anchor,a=n._padding(),s=n.chartElement.offset(),l=mi(r.y+a.top+s.top),c=mi(r.x+a.left+s.left),u=Et.support.zoomLevel(),h=e(window),p=window.pageYOffset||document.documentElement.scrollTop||0,d=window.pageXOffset||document.documentElement.scrollLeft||0,f=(this._mobileScroller||{}).movable;return f&&1!==f.scale?(t=Pi.transform().scale(f.scale,f.scale,[f.x,f.y]),i=new Pi.Point(c,l).transform(t),c=i.x,l=i.y):(l+=n._fit(l-p,o.height,h.outerHeight()/u),c+=n._fit(c-d,o.width,h.outerWidth()/u)),{top:l,left:c}},setStyle:function(e,t){var i,n,o=e.background,r=e.border.color;t&&(i=t.color||t.options.color,o=Si(o,i),r=Si(r,i)),yi(e.color)||(n=new Zt(o).percBrightness(),this.element.toggleClass(nn+Qo,n>180)),this.element.css({backgroundColor:o,borderColor:r,font:e.font,color:e.color,opacity:e.opacity,borderWidth:e.border.width})},show:function(){this._clearShowTimeout(),this.showTimeout=setTimeout(this.move,Ko)},hide:function(){var e=this;clearTimeout(e.showTimeout),e._hideElement(),e.visible&&(e.point=null,e.visible=!1,e.index=null)},_measure:function(){this._ensureElement();var e={width:this.element.outerWidth(),height:this.element.outerHeight()};return e},_ensureElement:function(){this.element&&this.element.appendTo(document.body).on(Qn,this._mouseleave)},_mouseleave:function(t){var i=t.relatedTarget,n=this.chartElement[0];i&&i!==n&&!e.contains(n,i)&&(this.trigger(On),this.hide())},_hideElement:function(){var e=this,t=this.element;t&&t.fadeOut({always:function(){e.visible||t.off(Qn).remove()}})},_pointContent:function(e){var t,i,n=this,o=Ut({},n.options,e.options.tooltip);return yi(e.value)&&(t=""+e.value),o.template?(i=jt(o.template),t=i({value:e.value,category:e.category,series:e.series,dataItem:e.dataItem,percentage:e.percentage,runningTotal:e.runningTotal,total:e.total,low:e.low,high:e.high,xLow:e.xLow,xHigh:e.xHigh,yLow:e.yLow,yHigh:e.yHigh})):o.format&&(t=e.formatValue(o.format)),t},_pointAnchor:function(e){var t=this._measure();return e.tooltipAnchor(t.width,t.height)},_fit:function(e,t,i){var n=0;return e+t>i&&(n=i-(e+t)),0>e&&(n=-e),n}}),mt=gt.extend({show:function(e){var t=this,i=Ut({},t.options,e.options.tooltip);e&&e.tooltipAnchor&&t.element&&(t.element.html(t._pointContent(e)),t.anchor=t._pointAnchor(e),t.anchor?(t.setStyle(i,e),gt.fn.show.call(t,e)):t.hide())}}),xt=gt.extend({init:function(e,t,i){var n=this;gt.fn.init.call(n,e,i),n.plotArea=t},options:{sharedTemplate:"<table><th colspan='2'>#= categoryText #</th># for(var i = 0; i < points.length; i++) { ## var point = points[i]; #<tr># if(point.series.name) { # <td> #= point.series.name #:</td># } #<td>#= content(point) #</td></tr># } #</table>",categoryFormat:"{0:d}"},showAt:function(t,i){var n,o=this,r=o.options,a=o.plotArea,s=a.categoryAxis,l=s.pointCategoryIndex(i),c=s.getCategory(i),u=s.getSlot(l);t=e.grep(t,function(e){var t=e.series.tooltip,i=t&&t.visible===!1;return!i}),t.length>0&&(n=o._content(t,c),o.element.html(n),o.anchor=o._slotAnchor(i,u),o.setStyle(r,t[0]),gt.fn.show.call(o))},_slotAnchor:function(e,t){var i,n=this,o=n.plotArea,r=o.categoryAxis,a=this._measure(),s=e.y-a.height/2;return i=r.options.vertical?ii(e.x,s):ii(t.center().x,s)},_content:function(e,t){var i,n,o=this;return i=Et.template(o.options.sharedTemplate),n=i({points:e,category:t,categoryText:ui(o.options.categoryFormat,t),content:o._pointContent})}}),vt=Kt.extend({init:function(e,t){Kt.fn.init.call(this,t),this.axis=e,this.stickyMode=e instanceof se},options:{color:Mi,width:1,zIndex:-1,tooltip:{visible:!1}},showAt:function(e){this.point=e,this.moveLine(),this.line.visible(!0);var t=this.options.tooltip;t.visible&&(this.tooltip||(this.tooltip=new yt(this,Ut({},t,{stickyMode:this.stickyMode}))),this.tooltip.showAt(e))},hide:function(){this.line.visible(!1),this.tooltip&&this.tooltip.hide()},moveLine:function(){var e,t,i,n=this,o=n.axis,r=o.options.vertical,a=n.getBox(),s=n.point,l=r?ar:rr;t=new Pi.Point(a.x1,a.y1),i=r?new Pi.Point(a.x2,a.y1):new Pi.Point(a.x1,a.y2),s&&(n.stickyMode?(e=o.getSlot(o.pointCategoryIndex(s)),t[l]=i[l]=e.center()[l]):t[l]=i[l]=s[l]),n.box=a,this.line.moveTo(t).lineTo(i)},getBox:function(){var e,t,i,n=this,o=n.axis,r=o.pane.axes,a=r.length,s=o.options.vertical,l=o.lineBox().clone(),c=s?rr:ar;for(i=0;a>i;i++)t=r[i],t.options.vertical!=s&&(e?e.wrap(t.lineBox()):e=t.lineBox().clone());return l[c+1]=e[c+1],l[c+2]=e[c+2],l},createVisual:function(){Kt.fn.createVisual.call(this);var e=this.options;this.line=new Ti.Path({stroke:{color:e.color,width:e.width,opacity:e.opacity,dashType:e.dashType},visible:!1}),this.moveLine(),this.visual.append(this.line)},destroy:function(){var e=this;e.tooltip&&e.tooltip.destroy(),Kt.fn.destroy.call(e)}}),yt=gt.extend({init:function(e,t){var i=this,n=e.axis.getRoot().chart.element;i.crosshair=e,gt.fn.init.call(i,n,Ut({},i.options,{background:e.axis.plotArea.options.seriesColors[0]},t)),i.setStyle(i.options)},options:{padding:10},showAt:function(e){var t=this,i=t.element;i&&(t.point=e,t.element.html(t.content(e)),t.anchor=t.getAnchor(),t.move())},move:function(){var e=this,t=e.element,i=e._offset();e._ensureElement(),t.css({top:i.top,left:i.left}).show()},content:function(e){var t,i,n,o=this,r=o.options,a=o.crosshair.axis,s=a.options;return i=t=a[r.stickyMode?"getCategory":"getValue"](e),r.template?(n=jt(r.template),t=n({value:i})):r.format?t=ui(r.format,i):s.type===an&&(t=ui(s.labels.dateFormats[s.baseUnit],i)),t},getAnchor:function(){var e,t=this,i=t.options,n=i.position,o=this.crosshair,r=!o.axis.options.vertical,a=o.line.bbox(),s=this._measure(),l=s.width/2,c=s.height/2,u=i.padding;return e=r?n===Hi?a.bottomLeft().translate(-l,u):a.topLeft().translate(-l,-s.height-u):n===zn?a.topLeft().translate(-s.width-u,-c):a.topRight().translate(u,-c)},hide:function(){this.element.hide(),this.point=null},destroy:function(){gt.fn.destroy.call(this),this.point=null}}),bt={min:function(e){var t,i,n=Yn,o=e.length;for(t=0;o>t;t++)i=e[t],B(i)&&(n=Vt.min(n,i));return n===Yn?e[0]:n},max:function(e){var t,i,n=Wn,o=e.length;for(t=0;o>t;t++)i=e[t],B(i)&&(n=Vt.max(n,i));return n===Wn?e[0]:n},sum:function(e){var t,i,n=e.length,o=0;for(t=0;n>t;t++)i=e[t],B(i)&&(o+=i);return o},sumOrNull:function(e){var t=null;return L(e)&&(t=bt.sum(e)),t},count:function(e){var t,i,n=e.length,o=0;for(t=0;n>t;t++)i=e[t],null!==i&&yi(i)&&o++;return o},avg:function(e){var t=e[0],i=L(e);return i>0&&(t=bt.sum(e)/i),t},first:function(e){var t,i,n=e.length;for(t=0;n>t;t++)if(i=e[t],null!==i&&yi(i))return i;return e[0]}},n.prototype={register:function(e,t){for(var i=0;e.length>i;i++)this._defaults[e[i]]=t},query:function(e){return this._defaults[e]}},n.current=new n,wt=zt.extend({init:function(t,i,n){var o,r,a=this,s=t.element,l=i.lineBox(),c=a.getValueAxis(i),u=c.lineBox(),h="."+nn;zt.fn.init.call(a),a.options=Ut({},a.options,n),n=a.options,a.chart=t,a.chartElement=s,a.categoryAxis=i,a._dateAxis=a.categoryAxis instanceof le,a.valueAxis=c,a._dateAxis&&Ut(n,{min:f(n.min),max:f(n.max),from:f(n.from),to:f(n.to)}),a.template=wt.template,a.template||(a.template=wt.template=ki("<div class='"+nn+"selector' style='width: #= d.width #px; height: #= d.height #px; top: #= d.offset.top #px; left: #= d.offset.left #px;'><div class='"+nn+"mask'></div><div class='"+nn+"mask'></div><div class='"+nn+"selection'><div class='"+nn+"selection-bg'></div><div class='"+nn+"handle "+nn+"leftHandle'><div></div></div><div class='"+nn+"handle "+nn+"rightHandle'><div></div></div></div></div>")),r={left:parseInt(s.css("paddingLeft"),10),right:parseInt(s.css("paddingTop"),10)},a.options=Ut({},{width:l.width(),height:u.height(),padding:r,offset:{left:u.x2+r.left,top:u.y1+r.right},from:n.min,to:n.max},n),a.options.visible&&(a.wrapper=o=e(a.template(a.options)).appendTo(s),a.selection=o.find(h+"selection"),a.leftMask=o.find(h+"mask").first(),a.rightMask=o.find(h+"mask").last(),a.leftHandle=o.find(h+"leftHandle"),a.rightHandle=o.find(h+"rightHandle"),a.options.selection={border:{left:parseFloat(a.selection.css("border-left-width"),10),right:parseFloat(a.selection.css("border-right-width"),10)}},a.leftHandle.css("top",(a.selection.height()-a.leftHandle.height())/2),a.rightHandle.css("top",(a.selection.height()-a.rightHandle.height())/2),a.set(a._index(n.from),a._index(n.to)),a.bind(a.events,a.options),a.wrapper[0].style.cssText=a.wrapper[0].style.cssText,a.wrapper.on(oo,Dt(a._mousewheel,a)),Et.UserEvents?a.userEvents=new Et.UserEvents(a.wrapper,{global:!0,stopPropagation:!0,multiTouch:!0,fastTap:!0,start:Dt(a._start,a),move:Dt(a._move,a),end:Dt(a._end,a),tap:Dt(a._tap,a),gesturestart:Dt(a._gesturechange,a),gesturechange:Dt(a._gesturechange,a)}):a.leftHandle.add(a.rightHandle).removeClass(nn+"handle"))},events:[ko,So,Po],options:{visible:!0,mousewheel:{zoom:Ui},min:Wn,max:Yn},destroy:function(){var e=this,t=e.userEvents;t&&t.destroy(),clearTimeout(e._mwTimeout),e._state=null,e.wrapper.remove()},_rangeEventArgs:function(e){var t=this;return{axis:t.categoryAxis.options,from:t._value(e.from),to:t._value(e.to)}},_start:function(t){var i,n=this,o=n.options,r=e(t.event.target);!n._state&&r&&(n.chart._unsetActivePoint(),n._state={moveTarget:r.parents(".k-handle").add(r).first(),startLocation:t.x?t.x.location:0,range:{from:n._index(o.from),to:n._index(o.to)}},i=n._rangeEventArgs({from:n._index(o.from),to:n._index(o.to)}),n.trigger(ko,i)&&(n.userEvents.cancel(),n._state=null))},_move:function(e){if(this._state){var t=this,i=t._state,n=t.options,o=t.categoryAxis.options.categories,r=t._index(n.from),a=t._index(n.to),s=t._index(n.min),l=t._index(n.max),c=i.startLocation-e.x.location,u=i.range,h={from:u.from,to:u.to},p=u.to-u.from,d=i.moveTarget,f=t.wrapper.width()/(o.length-1),g=Vt.round(c/f);d&&(e.preventDefault(),d.is(".k-selection, .k-selection-bg")?(u.from=Vt.min(Vt.max(s,r-g),l-p),u.to=Vt.min(u.from+p,l)):d.is(".k-leftHandle")?(u.from=Vt.min(Vt.max(s,r-g),l-1),u.to=Vt.max(u.from+1,u.to)):d.is(".k-rightHandle")&&(u.to=Vt.min(Vt.max(s+1,a-g),l),u.from=Vt.min(u.to-1,u.from)),(u.from!==h.from||u.to!==h.to)&&(t.move(u.from,u.to),t.trigger(So,t._rangeEventArgs(u))))}},_end:function(){var e=this,t=e._state.range;delete e._state,e.set(t.from,t.to),e.trigger(Po,e._rangeEventArgs(t))},_gesturechange:function(e){if(this._state){var t=this,i=t.chart,n=t._state,o=t.options,r=t.categoryAxis,a=n.range,s=i._toModelCoordinates(e.touches[0].x.location).x,l=i._toModelCoordinates(e.touches[1].x.location).x,c=Vt.min(s,l),u=Vt.max(s,l);e.preventDefault(),n.moveTarget=null,a.from=r.pointCategoryIndex(new Gt.Point2D(c))||o.min,a.to=r.pointCategoryIndex(new Gt.Point2D(u))||o.max,t.move(a.from,a.to)}},_tap:function(e){var t=this,i=t.options,n=t.chart._eventCoordinates(e),o=t.categoryAxis,r=o.pointCategoryIndex(new Gt.Point2D(n.x,o.box.y1)),a=t._index(i.from),s=t._index(i.to),l=t._index(i.min),c=t._index(i.max),u=s-a,h=a+u/2,p=Vt.round(h-r),d={},f=3===e.event.which;t._state||f||(e.preventDefault(),t.chart._unsetActivePoint(),o.options.justified||p--,d.from=Vt.min(Vt.max(l,a-p),c-u),d.to=Vt.min(d.from+u,c),t._start(e),t._state&&(t._state.range=d,t.trigger(So,t._rangeEventArgs(d)),t._end()))},_mousewheel:function(e){var t,i=this,n=i.options,o=gi(e);i._start({event:{target:i.selection}}),i._state&&(t=i._state.range,e.preventDefault(),e.stopPropagation(),Vt.abs(o)>1&&(o*=cr),n.mousewheel.reverse&&(o*=-1),i.expand(o)&&i.trigger(So,{axis:i.categoryAxis.options,delta:o,originalEvent:e,from:i._value(t.from),to:i._value(t.to)}),i._mwTimeout&&clearTimeout(i._mwTimeout),i._mwTimeout=setTimeout(function(){i._end()},no))},_index:function(e){var t=this,i=t.categoryAxis,n=i.options.categories,o=e;return e instanceof Date&&(o=V(e,n),!i.options.justified&&e>bi(n)&&(o+=1)),o},_value:function(e){var t=this,i=this.categoryAxis,n=i.options.categories,o=e;return t._dateAxis&&(o=e>n.length-1?t.options.max:n[e]),o},_slot:function(e){var t=this.categoryAxis,i=this._index(e);return t.getSlot(i,i,!0)},move:function(e,t){var i,n,o,r,a=this,s=a.options,l=s.offset,c=s.padding,u=s.selection.border;o=a._slot(e),i=mi(o.x1-l.left+c.left),a.leftMask.width(i),a.selection.css("left",i),o=a._slot(t),n=mi(s.width-(o.x1-l.left+c.left)),a.rightMask.width(n),r=s.width-n,r!=s.width&&(r+=u.right),a.rightMask.css("left",r),a.selection.width(Vt.max(s.width-(i+n)-u.right,0))},set:function(e,t){var i=this,n=i.options,o=i._index(n.min),r=i._index(n.max);e=wi(i._index(e),o,r),t=wi(i._index(t),e+1,r),n.visible&&i.move(e,t),n.from=i._value(e),n.to=i._value(t)},expand:function(e){var i=this,n=i.options,o=i._index(n.min),r=i._index(n.max),a=n.mousewheel.zoom,s=i._index(n.from),l=i._index(n.to),c={from:s,to:l},u=Ut({},c);return i._state&&(c=i._state.range),a!==yo&&(c.from=wi(wi(s-e,0,l-1),o,r)),a!==zn&&(c.to=wi(wi(l+e,c.from+1,r),o,r)),c.from!==u.from||c.to!==u.to?(i.set(c.from,c.to),!0):t},getValueAxis:function(e){var t,i,n=e.pane.axes,o=n.length;for(t=0;o>t;t++)if(i=n[t],i.options.vertical!==e.options.vertical)return i}}),_t=Ot.extend({init:function(e,t){this.plotArea=e,this.options=Ut({},this.options,t)},options:{key:"none",lock:"none"},start:function(e){this._active=$(e.event,this.options.key)},move:function(e){if(this._active){var t=this.axisRanges=this._panAxes(e,rr).concat(this._panAxes(e,ar));if(t.length)return this.axisRanges=t,Q(t)}},end:function(){this._active=!1},pan:function(){var e,t,i=this.plotArea,n=this.axisRanges;if(n.length){for(t=0;n.length>t;t++)e=n[t],i.updateAxisOptions(e.axis,e.range);i.redraw(i.panes)}},_panAxes:function(e,t){var i,n,o,r,a=this.plotArea,s=-e[t].delta,l=(this.options.lock||"").toLowerCase(),c=[];if(0!==s&&(l||"").toLowerCase()!=t)for(i=a.axes,r=0;i.length>r;r++)n=i[r],(t==rr&&!n.options.vertical||t==ar&&n.options.vertical)&&(o=n.pan(s),o&&(o.limitRange=!0,c.push({axis:n,range:o})));return c}}),At=Ot.extend({init:function(t,i){this.chart=t,this.options=Ut({},this.options,i),this._marquee=e("<div class='k-marquee'><div class='k-marquee-color'></div></div>")},options:{key:"shift",lock:"none"},start:function(e){var t,i,n,o,r;$(e.event,this.options.key)&&(t=this.chart,i=t._toModelCoordinates(e.x.client,e.y.client),n=this._zoomPane=t._plotArea.paneByPoint(i),n&&(o=n.clipBox().clone(),r=this._elementOffset(),o.translate(r.left,r.top),this._zoomPaneClipBox=o,this._marquee.appendTo(document.body).css({left:e.x.client+1,top:e.y.client+1,width:0,height:0})))},_elementOffset:function(){var e=this.chart.element,t=e.offset();return{left:parseInt(e.css("paddingTop"),10)+t.left,top:parseInt(e.css("paddingLeft"),10)+t.top}},move:function(e){var t,i=this._zoomPane;i&&(t=this._selectionPosition(e),this._marquee.css(t))},end:function(e){var i,n,o,r,a=this._zoomPane;return a?(i=this._elementOffset(),n=this._selectionPosition(e),n.left-=i.left,n.top-=i.top,o={x:n.left,y:n.top},r={x:n.left+n.width,y:n.top+n.height},this._updateAxisRanges(o,r),this._marquee.remove(),delete this._zoomPane,Q(this.axisRanges)):t},zoom:function(){var e,t,i,n=this.axisRanges;if(n&&n.length){for(e=this.chart._plotArea,i=0;n.length>i;i++)t=n[i],e.updateAxisOptions(t.axis,t.range);e.redraw(e.panes)}},destroy:function(){this._marquee.remove(),delete this._marquee},_updateAxisRanges:function(e,t){var i,n,o,r,a=(this.options.lock||"").toLowerCase(),s=[],l=this._zoomPane.axes;for(o=0;l.length>o;o++)i=l[o],n=i.options.vertical,a==rr&&!n||a===ar&&n||(r=i.pointsRange(e,t),s.push({axis:i,range:r}));this.axisRanges=s},_selectionPosition:function(e){var t=(this.options.lock||"").toLowerCase(),i=Vt.min(e.x.startLocation,e.x.location),n=Vt.min(e.y.startLocation,e.y.location),o=Vt.abs(e.x.initialDelta),r=Vt.abs(e.y.initialDelta),a=this._zoomPaneClipBox;return t==rr&&(i=a.x1,o=a.width()),t==ar&&(n=a.y1,r=a.height()),e.x.location>a.x2&&(o=a.x2-e.x.startLocation),a.x1>e.x.location&&(o=e.x.startLocation-a.x1),e.y.location>a.y2&&(r=a.y2-e.y.startLocation),a.y1>e.y.location&&(r=e.y.startLocation-a.y1),{left:Vt.max(i,a.x1),top:Vt.max(n,a.y1),width:o,height:r}}}),Ct=Ot.extend({init:function(e,t){this.chart=e,this.options=Ut({},this.options,t)},updateRanges:function(e){var t,i,n,o,r=(this.options.lock||"").toLowerCase(),a=[],s=this.chart._plotArea.axes;for(n=0;s.length>n;n++)t=s[n],i=t.options.vertical,r==rr&&!i||r===ar&&i||(o=t.zoomRange(-e),o&&a.push({axis:t,range:o}));return this.axisRanges=a,Q(a)},zoom:function(){var e,t,i,n=this.axisRanges;if(n&&n.length){for(e=this.chart._plotArea,i=0;n.length>i;i++)t=n[i],e.updateAxisOptions(t.axis,t.range);e.redraw(e.panes)}}}),kt=function(e,t,i){var n,o,r,a=this,s=t.canonicalFields(e),l=t.valueFields(e),c=t.sourceFields(e,s),u=a._seriesFields=[],h=i.query(e.type),p=e.aggregate||h;for(a._series=e,a._binder=t,n=0;s.length>n;n++){if(o=s[n],typeof p===lo)r=p[o];else{if(0!==n&&!di(o,l))break;r=p}r&&u.push({canonicalName:o,name:c[n],transform:Nt(r)?r:bt[r]})}},kt.prototype={aggregatePoints:function(e,t){var i,n,o,r,a,s=this,l=s._bindPoints(e||[]),c=s._series,u=s._seriesFields,h=l.dataItems[0],p={};for(!h||B(h)||Tt(h)||(a=function(){},a.prototype=h,p=new a),i=0;u.length>i;i++){if(n=u[i],o=s._bindField(l.values,n.canonicalName),r=n.transform(o,c,l.dataItems,t),!(null===r||typeof r!==lo||yi(r.length)||r instanceof Date)){p=r;break}yi(r)&&(G(n.name,p),Et.setter(n.name)(p,r))}return p},_bindPoints:function(e){var t,i,n=this,o=n._binder,r=n._series,a=[],s=[];for(t=0;e.length>t;t++)i=e[t],a.push(o.bindPoint(r,i)),s.push(r.data[i]);return{values:a,dataItems:s}},_bindField:function(e,t){var i,n,o,r,a=[],s=e.length;for(i=0;s>i;i++)n=e[i],r=n.valueFields,o=yi(r[t])?r[t]:n.fields[t],a.push(o);return a}},St=Ot.extend({init:function(e){this._axis=e},slot:function(e,t){return this._axis.slot(e,t)},range:function(){return this._axis.range()}}),Lt(e.easing,{easeOutElastic:function(e,t,i,n){var o=1.70158,r=0,a=n;return 0===e?i:1===e?i+n:(r||(r=.5),a<Vt.abs(n)?(a=n,o=r/4):o=r/(2*Vt.PI)*Vt.asin(n/a),a*Vt.pow(2,-10*e)*Vt.sin((1*e-o)*(1.1*Vt.PI)/r)+n+i)}}),Gt.ui.plugin(mr),te.current.register(st,[Ei,Ji,Un,tr,Vi,Jo,qi,co,Gi,er,Ni,xo,mo,ir,Rn]),te.current.register(ct,[_o,Ao,ji]),te.current.register(ut,[ho]),te.current.register(ht,[dn]),ie.current.register([Ei,Ji,Un,tr,Vi,Jo],[$o],[Yi,$i,so,vn,yn]),ie.current.register([xo,mo],[Sn,qo],[Yi,$i,so]),ie.current.register([ir,Rn],[$o],[Yi,$i,so,Oo]),n.current.register([Ei,Ji,Un,tr,Vi,Jo,ir,Rn],{value:Gn,color:kn,noteText:kn,errorLow:Xn,errorHigh:Gn}),n.current.register([xo,mo],{from:Xn,to:Gn,color:kn,noteText:kn}),ie.current.register([_o,Ao,ji],[rr,ar],[$i,so,bn,wn,_n,An]),ie.current.register([ji],[rr,ar,"size"],[$i,Yi,so]),ie.current.register([qi,co],["open","high","low","close"],[Yi,$i,"downColor",so]),n.current.register([qi,co],{open:Gn,high:Gn,low:Xn,close:Gn,color:kn,downColor:kn,noteText:kn}),ie.current.register([Ni],["lower","q1","median","q3","upper","mean","outliers"],[Yi,$i,so]),n.current.register([Ni],{lower:Gn,q1:Gn,median:Gn,q3:Gn,upper:Gn,mean:Gn,outliers:kn,color:kn,noteText:kn}),ie.current.register([Gi,er],["current","target"],[Yi,$i,"visibleInLegend",so]),n.current.register([Gi,er],{current:Gn,target:Gn,color:kn,noteText:kn}),ie.current.register([ho,dn],[$o],[Yi,$i,"explode","visibleInLegend","visible"]),Ut(Gt,{EQUALLY_SPACED_SERIES:fr,Aggregates:bt,AreaChart:Me,AreaSegment:Fe,AxisGroupRangeTracker:lt,Bar:fe,BarChart:ye,BarLabel:ne,BubbleChart:Ge,Bullet:Ae,BulletChart:_e,CandlestickChart:Ye,Candlestick:qe,CategoricalChart:ve,CategoricalErrorBar:Se,CategoricalPlotArea:st,CategoryAxis:se,ChartAxis:St,ChartContainer:rt,ClipAnimation:De,ClusterLayout:ue,Crosshair:vt,CrosshairTooltip:yt,DateCategoryAxis:le,DateValueAxis:ce,DefaultAggregates:n,DonutChart:tt,DonutPlotArea:ht,DonutSegment:et,ErrorBarBase:ke,ErrorRangeCalculator:xe,Highlight:ft,SharedTooltip:xt,Legend:ae,LegendItem:oe,LegendLayout:re,LineChart:Le,LinePoint:Te,LineSegment:Re,Pane:ot,PieAnimation:pt,PieChart:Je,PieChartMixin:$e,PiePlotArea:ut,PieSegment:Qe,PlotAreaBase:at,PlotAreaFactory:te,PointEventsMixin:pe,RangeBar:be,RangeBarChart:we,ScatterChart:Ne,ScatterErrorBar:Pe,ScatterLineChart:je,Selection:wt,SeriesAggregator:kt,SeriesBinder:ie,ShapeElement:ri,SplineSegment:Oe,SplineAreaSegment:Ue,StackWrap:he,Tooltip:mt,OHLCChart:We,OHLCPoint:Xe,WaterfallChart:it,WaterfallSegment:nt,XYPlotArea:ct,MousewheelZoom:Ct,addDuration:m,areNumbers:D,axisGroupBox:P,categoriesCount:u,ceilDate:y,countNumbers:L,duration:A,ensureTree:G,indexOf:M,isNumber:B,
floorDate:v,filterSeriesByType:F,hasValue:Z,lteDateIndex:V,evalOptions:O,seriesTotal:q,singleItemOrArray:S,sortDates:U,startOfWeek:x,transpose:j,toDate:f,toTime:g,uniqueDates:H})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()});;!function(e,define){define("util/main.min",["kendo.core.min"],e)}(function(){return function(){function e(e){return typeof e!==N}function n(e,n){var i=t(n);return T.round(e*i)/i}function t(e){return e?T.pow(10,e):1}function i(e,n,t){return T.max(T.min(e,t),n)}function r(e){return e*R}function o(e){return e/R}function a(e){return"number"==typeof e&&!isNaN(e)}function s(n,t){return e(n)?n:t}function l(e){return e*e}function u(e){var n,t=[];for(n in e)t.push(n+e[n]);return t.sort().join("")}function c(e){var n,t=2166136261;for(n=0;e.length>n;++n)t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24),t^=e.charCodeAt(n);return t>>>0}function h(e){return c(u(e))}function d(e){var n,t=e.length,i=U,r=O;for(n=0;t>n;n++)r=T.max(r,e[n]),i=T.min(i,e[n]);return{min:i,max:r}}function f(e){return d(e).min}function p(e){return d(e).max}function g(e){return x(e).min}function m(e){return x(e).max}function x(e){var n,t,i,r=U,o=O;for(n=0,t=e.length;t>n;n++)i=e[n],null!==i&&isFinite(i)&&(r=T.min(r,i),o=T.max(o,i));return{min:r===U?void 0:r,max:o===O?void 0:o}}function v(e){return e?e[e.length-1]:void 0}function A(e,n){return e.push.apply(e,n),e}function y(e){return B.template(e,{useWithBlock:!1,paramName:"d"})}function w(n,t){return e(t)&&null!==t?" "+n+"='"+t+"' ":""}function b(e){var n,t="";for(n=0;e.length>n;n++)t+=w(e[n][0],e[n][1]);return t}function C(n){var t,i,r="";for(t=0;n.length>t;t++)i=n[t][1],e(i)&&(r+=n[t][0]+":"+i+";");return""!==r?r:void 0}function L(e){return"string"!=typeof e&&(e+="px"),e}function k(e){var n,t,i=[];if(e)for(n=B.toHyphens(e).split("-"),t=0;n.length>t;t++)i.push("k-pos-"+n[t]);return i.join(" ")}function S(n){return""===n||null===n||"none"===n||"transparent"===n||!e(n)}function _(e){for(var n={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},t=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],i="";e>0;)t[0]>e?t.shift():(i+=n[t[0]],e-=t[0]);return i}function j(e){var n,t,i,r,o;for(e=e.toLowerCase(),n={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},t=0,i=0,r=0;e.length>r;++r){if(o=n[e.charAt(r)],!o)return null;t+=o,o>i&&(t-=2*i),i=o}return t}function G(e){var n=Object.create(null);return function(){var t,i="";for(t=arguments.length;--t>=0;)i+=":"+arguments[t];return i in n?n[i]:e.apply(this,arguments)}}function P(e){for(var n,t,i=[],r=0,o=e.length;o>r;)n=e.charCodeAt(r++),n>=55296&&56319>=n&&o>r?(t=e.charCodeAt(r++),56320==(64512&t)?i.push(((1023&n)<<10)+(1023&t)+65536):(i.push(n),r--)):i.push(n);return i}function M(e){return e.map(function(e){var n="";return e>65535&&(e-=65536,n+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),n+=String.fromCharCode(e)}).join("")}var T=Math,B=window.kendo,V=B.deepExtend,R=T.PI/180,U=Number.MAX_VALUE,O=-Number.MAX_VALUE,N="undefined",z=Date.now;z||(z=function(){return(new Date).getTime()}),V(B,{util:{MAX_NUM:U,MIN_NUM:O,append:A,arrayLimits:d,arrayMin:f,arrayMax:p,defined:e,deg:o,hashKey:c,hashObject:h,isNumber:a,isTransparent:S,last:v,limitValue:i,now:z,objectKey:u,round:n,rad:r,renderAttr:w,renderAllAttr:b,renderPos:k,renderSize:L,renderStyle:C,renderTemplate:y,sparseArrayLimits:x,sparseArrayMin:g,sparseArrayMax:m,sqr:l,valueOrDefault:s,romanToArabic:j,arabicToRoman:_,memoize:G,ucs2encode:M,ucs2decode:P}}),B.drawing.util=B.util,B.dataviz.util=B.util}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,t){(t||n)()}),function(e,define){define("util/text-metrics.min",["kendo.core.min","util/main.min"],e)}(function(){!function(e){function n(){return{width:0,height:0,baseline:0}}function t(e,n,t){return h.current.measure(e,n,t)}function i(e,n){var t=[];if(e.length>0&&document.fonts){try{t=e.map(function(e){return document.fonts.load(e)})}catch(i){o.logToConsole(i)}Promise.all(t).then(n,n)}else n()}var r=document,o=window.kendo,a=o.Class,s=o.util,l=s.defined,u=a.extend({init:function(e){this._size=e,this._length=0,this._map={}},put:function(e,n){var t=this,i=t._map,r={key:e,value:n};i[e]=r,t._head?(t._tail.newer=r,r.older=t._tail,t._tail=r):t._head=t._tail=r,t._length>=t._size?(i[t._head.key]=null,t._head=t._head.newer,t._head.older=null):t._length++},get:function(e){var n=this,t=n._map[e];return t?(t===n._head&&t!==n._tail&&(n._head=t.newer,n._head.older=null),t!==n._tail&&(t.older&&(t.older.newer=t.newer,t.newer.older=t.older),t.older=n._tail,t.newer=null,n._tail.newer=t,n._tail=t),t.value):void 0}}),c=e("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: nowrap!important;' />")[0],h=a.extend({init:function(e){this._cache=new u(1e3),this._initOptions(e)},options:{baselineMarkerSize:1},measure:function(t,i,o){var a,u,h,d,f,p,g,m;if(!t)return n();if(a=s.objectKey(i),u=s.hashKey(t+a),h=this._cache.get(u),h)return h;d=n(),f=o?o:c,p=this._baselineMarker().cloneNode(!1);for(g in i)m=i[g],l(m)&&(f.style[g]=m);return e(f).text(t),f.appendChild(p),r.body.appendChild(f),(t+"").length&&(d.width=f.offsetWidth-this.options.baselineMarkerSize,d.height=f.offsetHeight,d.baseline=p.offsetTop+this.options.baselineMarkerSize),d.width>0&&d.height>0&&this._cache.put(u,d),f.parentNode.removeChild(f),d},_baselineMarker:function(){return e("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;' />")[0]}});h.current=new h,o.util.TextMetrics=h,o.util.LRUCache=u,o.util.loadFonts=i,o.util.measureText=t}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,n,t){(t||n)()}),function(e,define){define("util/base64.min",["util/main.min"],e)}(function(){return function(){function e(e){var t,i,r,a,s,l,u,c="",h=0;for(e=n(e);e.length>h;)t=e.charCodeAt(h++),i=e.charCodeAt(h++),r=e.charCodeAt(h++),a=t>>2,s=(3&t)<<4|i>>4,l=(15&i)<<2|r>>6,u=63&r,isNaN(i)?l=u=64:isNaN(r)&&(u=64),c=c+o.charAt(a)+o.charAt(s)+o.charAt(l)+o.charAt(u);return c}function n(e){var n,t,i="";for(n=0;e.length>n;n++)t=e.charCodeAt(n),128>t?i+=r(t):2048>t?(i+=r(192|t>>>6),i+=r(128|63&t)):65536>t&&(i+=r(224|t>>>12),i+=r(128|t>>>6&63),i+=r(128|63&t));return i}var t=window.kendo,i=t.deepExtend,r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i(t.util,{encodeBase64:e,encodeUTF8:n})}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,t){(t||n)()}),function(e,define){define("mixins/observers.min",["kendo.core.min"],e)}(function(){return function(e){var n=Math,t=window.kendo,i=t.deepExtend,r=e.inArray,o={observers:function(){return this._observers=this._observers||[]},addObserver:function(e){return this._observers?this._observers.push(e):this._observers=[e],this},removeObserver:function(e){var n=this.observers(),t=r(e,n);return-1!=t&&n.splice(t,1),this},trigger:function(e,n){var t,i,r=this._observers;if(r&&!this._suspended)for(i=0;r.length>i;i++)t=r[i],t[e]&&t[e](n);return this},optionsChange:function(e){this.trigger("optionsChange",e)},geometryChange:function(e){this.trigger("geometryChange",e)},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=n.max((this._suspended||0)-1,0),this},_observerField:function(e,n){this[e]&&this[e].removeObserver(this),this[e]=n,n.addObserver(this)}};i(t,{mixins:{ObserversMixin:o}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,t){(t||n)()}),function(e,define){define("kendo.dataviz.chart.polar.min",["kendo.dataviz.chart.min","kendo.drawing.min"],e)}(function(){return function(e,n){function t(e,n){return e.value.x-n.value.x}function i(e,n){return 180-L.abs(L.abs(e-n)-180)}var r,o,a,s,l,u,c,h,d,f,p,g,m,x,v,A,y,w,b,C,L=Math,k=window.kendo,S=k.deepExtend,_=k.util,j=_.append,G=k.drawing,P=k.geometry,M=k.dataviz,T=M.AreaSegment,B=M.Axis,V=M.AxisGroupRangeTracker,R=M.BarChart,U=M.Box2D,O=M.CategoryAxis,N=M.CategoricalChart,z=M.CategoricalPlotArea,I=M.ChartElement,D=M.CurveProcessor,E=M.DonutSegment,F=M.LineChart,X=M.LineSegment,K=M.LogarithmicAxis,Y=M.NumericAxis,q=M.PlotAreaBase,Q=M.PlotAreaFactory,H=M.Point2D,W=M.Ring,J=M.ScatterChart,Z=M.ScatterLineChart,$=M.SeriesBinder,ee=M.ShapeBuilder,ne=M.SplineSegment,te=M.SplineAreaSegment,ie=M.getSpacing,re=M.filterSeriesByType,oe=_.limitValue,ae=M.round,se="arc",le="#000",ue=M.COORD_PRECISION,ce=.15,he=L.PI/180,de="gap",fe="interpolate",pe="log",ge="plotAreaClick",me="polarArea",xe="polarLine",ve="polarScatter",Ae="radarArea",ye="radarColumn",we="radarLine",be="smooth",Ce="x",Le="y",ke="zero",Se=[me,xe,ve],_e=[Ae,ye,we],je={createGridLines:function(e){var n,t,i=this,r=i.options,o=L.abs(i.box.center().y-e.lineBox().y1),a=!1,s=[];return r.majorGridLines.visible&&(n=i.majorGridLineAngles(e),a=!0,s=i.renderMajorGridLines(n,o,r.majorGridLines)),r.minorGridLines.visible&&(t=i.minorGridLineAngles(e,a),j(s,i.renderMinorGridLines(t,o,r.minorGridLines,e,a))),s},renderMajorGridLines:function(e,n,t){return this.renderGridLines(e,n,t)},renderMinorGridLines:function(e,n,t,i,r){var o=this.radiusCallback&&this.radiusCallback(n,i,r);return this.renderGridLines(e,n,t,o)},renderGridLines:function(e,n,t,i){var r,o,a={stroke:{width:t.width,color:t.color,dashType:t.dashType}},s=this.box.center(),l=new P.Circle([s.x,s.y],n),u=this.gridLinesVisual();for(r=0;e.length>r;r++)o=new G.Path(a),i&&(l.radius=i(e[r])),o.moveTo(l.center).lineTo(l.pointAt(e[r])),u.append(o);return u.children},gridLineAngles:function(t,i,r,o,a){var s=this,l=s.intervals(i,r,o,a),u=t.options,c=u.visible&&(u.line||{}).visible!==!1;return e.map(l,function(e){var t=s.intervalAngle(e);return c&&90===t?n:t})}},Ge=O.extend({options:{startAngle:90,labels:{margin:ie(10)},majorGridLines:{visible:!0},justified:!0},range:function(){return{min:0,max:this.options.categories.length}},reflow:function(e){this.box=e,this.reflowLabels()},lineBox:function(){return this.box},reflowLabels:function(){var e,n,t=this,i=t.options.labels,r=i.skip||0,o=i.step||1,a=new U,s=t.labels;for(n=0;s.length>n;n++)s[n].reflow(a),e=s[n].box,s[n].reflow(t.getSlot(r+n*o).adjacentBox(0,e.width(),e.height()))},intervals:function(e,n,t,i){var r,o=this,a=o.options,s=a.categories.length,l=0,u=s/e||1,c=360/u,h=[];for(n=n||0,t=t||1,r=n;u>r;r+=t)l=a.reverse?360-r*c:r*c,l=ae(l,ue)%360,i&&M.inArray(l,i)||h.push(l);return h},majorIntervals:function(){return this.intervals(1)},minorIntervals:function(){return this.intervals(.5)},intervalAngle:function(e){return(360+e+this.options.startAngle)%360},majorAngles:function(){return e.map(this.majorIntervals(),e.proxy(this.intervalAngle,this))},createLine:function(){return[]},majorGridLineAngles:function(e){var n=this.options.majorGridLines;return this.gridLineAngles(e,1,n.skip,n.step)},minorGridLineAngles:function(e,n){var t=this.options,i=t.minorGridLines,r=t.majorGridLines,o=n?this.intervals(1,r.skip,r.step):null;return this.gridLineAngles(e,.5,i.skip,i.step,o)},radiusCallback:function(e,t,i){var r,o,a,s;return t.options.type!==se?(r=360/(2*this.options.categories.length),o=L.cos(r*he)*e,a=this.majorAngles(),s=function(n){return!i&&M.inArray(n,a)?e:o}):n},createPlotBands:function(){var e,n,t,i,r,o,a,s=this,l=s.options,u=l.plotBands||[],c=this._plotbandGroup=new G.Group({zIndex:-1});for(e=0;u.length>e;e++)n=u[e],t=s.plotBandSlot(n),i=s.getSlot(n.from),r=n.from-L.floor(n.from),t.startAngle+=r*i.angle,o=L.ceil(n.to)-n.to,t.angle-=(o+r)*i.angle,a=ee.current.createRing(t,{fill:{color:n.color,opacity:n.opacity},stroke:{opacity:n.opacity}}),c.append(a);s.appendVisual(c)},plotBandSlot:function(e){return this.getSlot(e.from,e.to-1)},getSlot:function(e,n){var t,i,r,o=this,a=o.options,s=a.justified,l=o.box,u=o.majorAngles(),c=u.length,h=360/c;return a.reverse&&!s&&(e=(e+1)%c),e=oe(L.floor(e),0,c-1),i=u[e],s&&(i-=h/2,0>i&&(i+=360)),n=oe(L.ceil(n||e),e,c-1),t=n-e+1,r=h*t,new W(l.center(),0,l.height()/2,i,r)},slot:function(e,n){var t=this.getSlot(e,n),i=t.startAngle+180,r=i+t.angle;return new P.Arc([t.c.x,t.c.y],{startAngle:i,endAngle:r,radiusX:t.r,radiusY:t.r})},pointCategoryIndex:function(e){var n,t,i=this,r=null,o=i.options.categories.length;for(n=0;o>n;n++)if(t=i.getSlot(n),t.containsPoint(e)){r=n;break}return r}});S(Ge.fn,je),r={options:{majorGridLines:{visible:!0}},createPlotBands:function(){var e,n,t,i,r,o,a=this,s=a.options,l=s.plotBands||[],u=s.majorGridLines.type,c=a.plotArea.polarAxis,h=c.majorAngles(),d=c.box.center(),f=this._plotbandGroup=new G.Group({zIndex:-1});for(e=0;l.length>e;e++)n=l[e],t={fill:{color:n.color,opacity:n.opacity},stroke:{opacity:n.opacity}},i=a.getSlot(n.from,n.to,!0),r=new W(d,d.y-i.y2,d.y-i.y1,0,360),o=u===se?ee.current.createRing(r,t):G.Path.fromPoints(a.plotBandPoints(r,h),t).close(),f.append(o);a.appendVisual(f)},plotBandPoints:function(e,n){var t,i=[],r=[],o=[e.c.x,e.c.y],a=new P.Circle(o,e.ir),s=new P.Circle(o,e.r);for(t=0;n.length>t;t++)i.push(a.pointAt(n[t])),r.push(s.pointAt(n[t]));return i.reverse(),i.push(i[0]),r.push(r[0]),r.concat(i)},createGridLines:function(e){var n,t=this,i=t.options,r=t.radarMajorGridLinePositions(),o=e.majorAngles(),a=e.box.center(),s=[];return i.majorGridLines.visible&&(s=t.renderGridLines(a,r,o,i.majorGridLines)),i.minorGridLines.visible&&(n=t.radarMinorGridLinePositions(),j(s,t.renderGridLines(a,n,o,i.minorGridLines))),s},renderGridLines:function(e,n,t,i){var r,o,a,s,l,u={stroke:{width:i.width,color:i.color,dashType:i.dashType}},c=this.gridLinesVisual();for(o=0;n.length>o;o++)if(r=e.y-n[o],r>0)if(s=new P.Circle([e.x,e.y],r),i.type===se)c.append(new G.Circle(s,u));else{for(l=new G.Path(u),a=0;t.length>a;a++)l.lineTo(s.pointAt(t[a]));l.close(),c.append(l)}return c.children},getValue:function(e){var n,t,r,o,a,s,l,u=this,c=u.options,h=u.lineBox(),d=u.plotArea.polarAxis,f=d.majorAngles(),p=d.box.center(),g=e.distanceTo(p),m=g;return c.majorGridLines.type!==se&&f.length>1&&(n=e.x-p.x,t=e.y-p.y,r=(L.atan2(t,n)/he+540)%360,f.sort(function(e,n){return i(e,r)-i(n,r)}),o=i(f[0],f[1])/2,a=i(r,f[0]),s=90-o,l=180-a-s,m=g*(L.sin(l*he)/L.sin(s*he))),u.axisType().fn.getValue.call(u,new H(h.x1,h.y2-m))}},o=Y.extend({radarMajorGridLinePositions:function(){return this.getTickPositions(this.options.majorUnit)},radarMinorGridLinePositions:function(){var e=this,n=e.options,t=0;return n.majorGridLines.visible&&(t=n.majorUnit),e.getTickPositions(n.minorUnit,t)},axisType:function(){return Y}}),S(o.fn,r),a=K.extend({radarMajorGridLinePositions:function(){var e=this,n=[];return e.traverseMajorTicksPositions(function(e){n.push(e)},e.options.majorGridLines),n},radarMinorGridLinePositions:function(){var e=this,n=[];return e.traverseMinorTicksPositions(function(e){n.push(e)},e.options.minorGridLines),n},axisType:function(){return K}}),S(a.fn,r),s=B.extend({init:function(e){var n=this;B.fn.init.call(n,e),e=n.options,e.minorUnit=e.minorUnit||n.options.majorUnit/2},options:{type:"polar",startAngle:0,reverse:!1,majorUnit:60,min:0,max:360,labels:{margin:ie(10)},majorGridLines:{color:le,visible:!0,width:1},minorGridLines:{color:"#aaa"}},getDivisions:function(e){return Y.fn.getDivisions.call(this,e)-1},reflow:function(e){this.box=e,this.reflowLabels()},reflowLabels:function(){var e,n,t=this,i=t.options,r=i.labels,o=r.skip||0,a=r.step||1,s=new U,l=t.intervals(i.majorUnit,o,a),u=t.labels;for(n=0;u.length>n;n++)u[n].reflow(s),e=u[n].box,u[n].reflow(t.getSlot(l[n]).adjacentBox(0,e.width(),e.height()))},lineBox:function(){return this.box},intervals:function(e,n,t,i){var r,o,a=this,s=a.options,l=a.getDivisions(e),u=s.min,c=[];for(n=n||0,t=t||1,o=n;l>o;o+=t)r=(360+u+o*e)%360,i&&M.inArray(r,i)||c.push(r);return c},majorIntervals:function(){return this.intervals(this.options.majorUnit)},minorIntervals:function(){return this.intervals(this.options.minorUnit)},intervalAngle:function(e){return(540-e-this.options.startAngle)%360},majorAngles:Ge.fn.majorAngles,createLine:function(){return[]},majorGridLineAngles:function(e){var n=this.options.majorGridLines;return this.gridLineAngles(e,this.options.majorUnit,n.skip,n.step)},minorGridLineAngles:function(e,n){var t=this.options,i=t.minorGridLines,r=t.majorGridLines,o=n?this.intervals(t.majorUnit,r.skip,r.step):null;return this.gridLineAngles(e,this.options.minorUnit,i.skip,i.step,o)},createPlotBands:Ge.fn.createPlotBands,plotBandSlot:function(e){return this.getSlot(e.from,e.to)},getSlot:function(e,n){var t,i=this,r=i.options,o=r.startAngle,a=i.box;return e=oe(e,r.min,r.max),n=oe(n||e,e,r.max),r.reverse&&(e*=-1,n*=-1),e=(540-e-o)%360,n=(540-n-o)%360,e>n&&(t=e,e=n,n=t),new W(a.center(),0,a.height()/2,e,n-e)},slot:function(e,n){var t,i,r,o,a=this.options,s=360-a.startAngle,l=this.getSlot(e,n);return M.util.defined(n)||(n=e),r=L.min(e,n),o=L.max(e,n),a.reverse?(t=r,i=o):(t=360-o,i=360-r),t=(t+s)%360,i=(i+s)%360,new P.Arc([l.c.x,l.c.y],{startAngle:t,endAngle:i,radiusX:l.r,radiusY:l.r})},getValue:function(e){var n=this,t=n.options,i=n.box.center(),r=e.x-i.x,o=e.y-i.y,a=L.round(L.atan2(o,r)/he),s=t.startAngle;return t.reverse||(a*=-1,s*=-1),(a+s+360)%360},range:Y.fn.range,labelsCount:Y.fn.labelsCount,createAxisLabel:Y.fn.createAxisLabel}),S(s.fn,je),l=I.extend({options:{gap:1,spacing:0},reflow:function(e){var n,t,i=this,r=i.options,o=i.children,a=r.gap,s=r.spacing,l=o.length,u=l+a+s*(l-1),c=e.angle/u,h=e.startAngle+c*(a/2);for(t=0;l>t;t++)n=e.clone(),n.startAngle=h,n.angle=c,o[t].sector&&(n.r=o[t].sector.r),o[t].reflow(n),o[t].sector=n,h+=c+c*s}}),u=I.extend({reflow:function(e){var n,t,i=this,r=i.options.isReversed,o=i.children,a=o.length,s=r?a-1:0,l=r?-1:1;for(i.box=new U,t=s;t>=0&&a>t;t+=l)n=o[t].sector,n.startAngle=e.startAngle,n.angle=e.angle}}),c=E.extend({init:function(e,n){E.fn.init.call(this,e,null,n)},options:{overlay:{gradient:null},labels:{distance:10}}}),h=R.extend({pointType:function(){return c},clusterType:function(){return l},stackType:function(){return u},categorySlot:function(e,n){return e.getSlot(n)},pointSlot:function(e,n){var t=e.clone(),i=e.c.y;return t.r=i-n.y1,t.ir=i-n.y2,t},reflow:N.fn.reflow,reflowPoint:function(e,n){e.sector=n,e.reflow()},options:{clip:!1,animation:{type:"pie"}},createAnimation:function(){this.options.animation.center=this.box.toRect().center(),R.fn.createAnimation.call(this)}}),d=F.extend({options:{clip:!1},pointSlot:function(e,n){var t=e.c.y-n.y1,i=H.onCircle(e.c,e.middle(),t);return new U(i.x,i.y,i.x,i.y)},createSegment:function(e,n,t){var i,r,o=n.style;return r=o==be?ne:X,i=new r(e,n,t),e.length===n.data.length&&(i.options.closed=!0),i}}),f=T.extend({points:function(){return X.fn.points.call(this,this.stackPoints)}}),p=te.extend({closeFill:e.noop}),g=d.extend({createSegment:function(e,n,t,i){var r,o,a=this,s=a.options,l=s.isStacked,u=(n.line||{}).style;return u===be?(o=new p(e,i,l,n,t),o.options.closed=!0):(l&&t>0&&i&&(r=i.linePoints.slice(0).reverse()),e.push(e[0]),o=new f(e,r,n,t)),o},seriesMissingValues:function(e){return e.missingValues||ke}}),m=J.extend({pointSlot:function(e,n){var t=e.c.y-n.y1,i=H.onCircle(e.c,e.startAngle,t);return new U(i.x,i.y,i.x,i.y)},options:{clip:!1}}),x=Z.extend({pointSlot:m.fn.pointSlot,options:{clip:!1}}),v=T.extend({points:function(){var e=this,n=e.parent,t=n.plotArea,i=t.polarAxis,r=i.box.center(),o=e.stackPoints,a=X.fn.points.call(e,o);return a.unshift([r.x,r.y]),a.push([r.x,r.y]),a}}),A=te.extend({closeFill:function(e){var n=this._polarAxisCenter();e.lineTo(n.x,n.y)},_polarAxisCenter:function(){var e=this.parent,n=e.plotArea,t=n.polarAxis,i=t.box.center();return i},strokeSegments:function(){var e,n,t,i=this._strokeSegments;return i||(e=this._polarAxisCenter(),n=new D(!1),t=X.fn.points.call(this),t.push(e),i=this._strokeSegments=n.process(t),i.pop()),i}}),y=x.extend({createSegment:function(e,n,t){var i,r=(n.line||{}).style;return i=r==be?new A(e,null,!1,n,t):new v(e,[],n,t)},createMissingValue:function(e,n){var t;return M.hasValue(e.x)&&n!=fe&&(t={x:e.x,y:e.y},n==ke&&(t.y=0)),t},seriesMissingValues:function(e){return e.missingValues||ke},_hasMissingValuesGap:function(){var e,n=this.options.series;for(e=0;n.length>e;e++)if(this.seriesMissingValues(n[e])===de)return!0},sortPoints:function(e){var n,i,r;if(e.sort(t),this._hasMissingValuesGap())for(r=0;e.length>r;r++)i=e[r],i&&(n=i.value,M.hasValue(n.y)||this.seriesMissingValues(i.series)!==de||delete e[r]);return e}}),w=q.extend({init:function(e,n){var t=this;t.valueAxisRangeTracker=new V,q.fn.init.call(t,e,n)},render:function(){var e=this;e.addToLegend(e.series),e.createPolarAxis(),e.createCharts(),e.createValueAxis()},alignAxes:function(){var e=this.valueAxis,n=e.range(),t=e.options.reverse?n.max:n.min,i=e.getSlot(t),r=this.polarAxis.getSlot(0).c,o=e.box.translate(r.x-i.x1,r.y-i.y1);e.reflow(o)},createValueAxis:function(){var e,n,t,i,r=this,s=r.valueAxisRangeTracker,l=s.query(),u=r.valueAxisOptions({roundToMajorUnit:!1,zIndex:-1});u.type===pe?(t=a,i={min:.1,max:1}):(t=o,i={min:0,max:1}),e=s.query(name)||l||i,e&&l&&(e.min=L.min(e.min,l.min),e.max=L.max(e.max,l.max)),n=new t(e.min,e.max,u),r.valueAxis=n,r.appendAxis(n)},reflowAxes:function(){var e,n=this,t=n.options.plotArea,i=n.valueAxis,r=n.polarAxis,o=n.box,a=L.min(o.width(),o.height())*ce,s=ie(t.padding||{},a),l=o.clone().unpad(s),u=l.clone().shrink(0,l.height()/2);r.reflow(l),i.reflow(u),e=i.lineBox().height()-i.box.height(),i.reflow(i.box.unpad({top:e})),n.axisBox=l,n.alignAxes(l)},backgroundBox:function(){return this.box}}),b=w.extend({options:{categoryAxis:{categories:[]},valueAxis:{}},createPolarAxis:function(){var e,n=this;e=new Ge(n.options.categoryAxis),n.polarAxis=e,n.categoryAxis=e,n.appendAxis(e),n.aggregateCategories()},valueAxisOptions:function(e){var n=this;return n._hasBarCharts&&S(e,{majorGridLines:{type:se},minorGridLines:{type:se}}),n._isStacked100&&S(e,{roundToMajorUnit:!1,labels:{format:"P0"}}),S(e,n.options.valueAxis)},appendChart:z.fn.appendChart,aggregateSeries:z.fn.aggregateSeries,aggregateCategories:function(){z.fn.aggregateCategories.call(this,this.panes)},filterSeries:function(e){return e},createCharts:function(){var e=this,n=e.filterVisibleSeries(e.series),t=e.panes[0];e.createAreaChart(re(n,[Ae]),t),e.createLineChart(re(n,[we]),t),e.createBarChart(re(n,[ye]),t)},chartOptions:function(e){var n,t,i={series:e},r=e[0];return r&&(n=this.filterVisibleSeries(e),t=r.stack,i.isStacked=t&&n.length>1,i.isStacked100=t&&"100%"===t.type&&n.length>1,i.isStacked100&&(this._isStacked100=!0)),i},createAreaChart:function(e,n){if(0!==e.length){var t=new g(this,this.chartOptions(e));this.appendChart(t,n)}},createLineChart:function(e,n){if(0!==e.length){var t=new d(this,this.chartOptions(e));this.appendChart(t,n)}},createBarChart:function(e,n){var t,i,r;0!==e.length&&(t=e[0],i=this.chartOptions(e),i.gap=t.gap,i.spacing=t.spacing,r=new h(this,i),this.appendChart(r,n),this._hasBarCharts=!0)},seriesCategoryAxis:function(){return this.categoryAxis},click:function(n,t){var i,r,o=this,a=n._eventCoordinates(t),s=new H(a.x,a.y);i=o.categoryAxis.getCategory(s),r=o.valueAxis.getValue(s),null!==i&&null!==r&&n.trigger(ge,{element:e(t.target),category:i,value:r})},createCrosshairs:e.noop}),C=w.extend({options:{xAxis:{},yAxis:{}},createPolarAxis:function(){var e,n=this;e=new s(n.options.xAxis),n.polarAxis=e,n.axisX=e,n.appendAxis(e)},valueAxisOptions:function(e){var n=this;return S(e,{majorGridLines:{type:se},minorGridLines:{type:se}},n.options.yAxis)},createValueAxis:function(){var e=this;w.fn.createValueAxis.call(e),e.axisY=e.valueAxis},appendChart:function(e,n){var t=this;t.valueAxisRangeTracker.update(e.yAxisRanges),q.fn.appendChart.call(t,e,n)},createCharts:function(){var e=this,n=e.filterVisibleSeries(e.series),t=e.panes[0];e.createLineChart(re(n,[xe]),t),e.createScatterChart(re(n,[ve]),t),e.createAreaChart(re(n,[me]),t)},createLineChart:function(e,n){if(0!==e.length){var t=this,i=new x(t,{series:e});t.appendChart(i,n)}},createScatterChart:function(e,n){if(0!==e.length){var t=this,i=new m(t,{series:e});t.appendChart(i,n)}},createAreaChart:function(e,n){if(0!==e.length){var t=this,i=new y(t,{series:e});t.appendChart(i,n)}},click:function(n,t){var i,r,o=this,a=n._eventCoordinates(t),s=new H(a.x,a.y);i=o.axisX.getValue(s),r=o.axisY.getValue(s),null!==i&&null!==r&&n.trigger(ge,{element:e(t.target),x:i,y:r})},createCrosshairs:e.noop}),Q.current.register(C,Se),Q.current.register(b,_e),$.current.register(Se,[Ce,Le],["color"]),$.current.register(_e,["value"],["color"]),M.DefaultAggregates.current.register(_e,{value:"max",color:"first"}),S(M,{PolarAreaChart:y,PolarAxis:s,PolarLineChart:x,PolarPlotArea:C,RadarAreaChart:g,RadarBarChart:h,RadarCategoryAxis:Ge,RadarClusterLayout:l,RadarLineChart:d,RadarNumericAxis:o,RadarPlotArea:b,SplinePolarAreaSegment:A,SplineRadarAreaSegment:p,RadarStackLayout:u})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,t){(t||n)()});;!function(e,define){define("util/main.min",["kendo.core.min"],e)}(function(){return function(){function e(e){return typeof e!==H}function n(e,n){var i=t(n);return z.round(e*i)/i}function t(e){return e?z.pow(10,e):1}function i(e,n,t){return z.max(z.min(e,t),n)}function r(e){return e*T}function o(e){return e/T}function a(e){return"number"==typeof e&&!isNaN(e)}function s(n,t){return e(n)?n:t}function u(e){return e*e}function l(e){var n,t=[];for(n in e)t.push(n+e[n]);return t.sort().join("")}function c(e){var n,t=2166136261;for(n=0;e.length>n;++n)t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24),t^=e.charCodeAt(n);return t>>>0}function d(e){return c(l(e))}function h(e){var n,t=e.length,i=V,r=j;for(n=0;t>n;n++)r=z.max(r,e[n]),i=z.min(i,e[n]);return{min:i,max:r}}function f(e){return h(e).min}function p(e){return h(e).max}function g(e){return v(e).min}function m(e){return v(e).max}function v(e){var n,t,i,r=V,o=j;for(n=0,t=e.length;t>n;n++)i=e[n],null!==i&&isFinite(i)&&(r=z.min(r,i),o=z.max(o,i));return{min:r===V?void 0:r,max:o===j?void 0:o}}function w(e){return e?e[e.length-1]:void 0}function y(e,n){return e.push.apply(e,n),e}function x(e){return F.template(e,{useWithBlock:!1,paramName:"d"})}function b(n,t){return e(t)&&null!==t?" "+n+"='"+t+"' ":""}function _(e){var n,t="";for(n=0;e.length>n;n++)t+=b(e[n][0],e[n][1]);return t}function k(n){var t,i,r="";for(t=0;n.length>t;t++)i=n[t][1],e(i)&&(r+=n[t][0]+":"+i+";");return""!==r?r:void 0}function C(e){return"string"!=typeof e&&(e+="px"),e}function A(e){var n,t,i=[];if(e)for(n=F.toHyphens(e).split("-"),t=0;n.length>t;t++)i.push("k-pos-"+n[t]);return i.join(" ")}function P(n){return""===n||null===n||"none"===n||"transparent"===n||!e(n)}function M(e){for(var n={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},t=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],i="";e>0;)t[0]>e?t.shift():(i+=n[t[0]],e-=t[0]);return i}function S(e){var n,t,i,r,o;for(e=e.toLowerCase(),n={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},t=0,i=0,r=0;e.length>r;++r){if(o=n[e.charAt(r)],!o)return null;t+=o,o>i&&(t-=2*i),i=o}return t}function O(e){var n=Object.create(null);return function(){var t,i="";for(t=arguments.length;--t>=0;)i+=":"+arguments[t];return i in n?n[i]:e.apply(this,arguments)}}function I(e){for(var n,t,i=[],r=0,o=e.length;o>r;)n=e.charCodeAt(r++),n>=55296&&56319>=n&&o>r?(t=e.charCodeAt(r++),56320==(64512&t)?i.push(((1023&n)<<10)+(1023&t)+65536):(i.push(n),r--)):i.push(n);return i}function N(e){return e.map(function(e){var n="";return e>65535&&(e-=65536,n+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),n+=String.fromCharCode(e)}).join("")}var z=Math,F=window.kendo,L=F.deepExtend,T=z.PI/180,V=Number.MAX_VALUE,j=-Number.MAX_VALUE,H="undefined",E=Date.now;E||(E=function(){return(new Date).getTime()}),L(F,{util:{MAX_NUM:V,MIN_NUM:j,append:y,arrayLimits:h,arrayMin:f,arrayMax:p,defined:e,deg:o,hashKey:c,hashObject:d,isNumber:a,isTransparent:P,last:w,limitValue:i,now:E,objectKey:l,round:n,rad:r,renderAttr:b,renderAllAttr:_,renderPos:A,renderSize:C,renderStyle:k,renderTemplate:x,sparseArrayLimits:v,sparseArrayMin:g,sparseArrayMax:m,sqr:u,valueOrDefault:s,romanToArabic:S,arabicToRoman:M,memoize:O,ucs2encode:N,ucs2decode:I}}),F.drawing.util=F.util,F.dataviz.util=F.util}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,t){(t||n)()}),function(e,define){define("util/text-metrics.min",["kendo.core.min","util/main.min"],e)}(function(){!function(e){function n(){return{width:0,height:0,baseline:0}}function t(e,n,t){return d.current.measure(e,n,t)}function i(e,n){var t=[];if(e.length>0&&document.fonts){try{t=e.map(function(e){return document.fonts.load(e)})}catch(i){o.logToConsole(i)}Promise.all(t).then(n,n)}else n()}var r=document,o=window.kendo,a=o.Class,s=o.util,u=s.defined,l=a.extend({init:function(e){this._size=e,this._length=0,this._map={}},put:function(e,n){var t=this,i=t._map,r={key:e,value:n};i[e]=r,t._head?(t._tail.newer=r,r.older=t._tail,t._tail=r):t._head=t._tail=r,t._length>=t._size?(i[t._head.key]=null,t._head=t._head.newer,t._head.older=null):t._length++},get:function(e){var n=this,t=n._map[e];return t?(t===n._head&&t!==n._tail&&(n._head=t.newer,n._head.older=null),t!==n._tail&&(t.older&&(t.older.newer=t.newer,t.newer.older=t.older),t.older=n._tail,t.newer=null,n._tail.newer=t,n._tail=t),t.value):void 0}}),c=e("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: nowrap!important;' />")[0],d=a.extend({init:function(e){this._cache=new l(1e3),this._initOptions(e)},options:{baselineMarkerSize:1},measure:function(t,i,o){var a,l,d,h,f,p,g,m;if(!t)return n();if(a=s.objectKey(i),l=s.hashKey(t+a),d=this._cache.get(l),d)return d;h=n(),f=o?o:c,p=this._baselineMarker().cloneNode(!1);for(g in i)m=i[g],u(m)&&(f.style[g]=m);return e(f).text(t),f.appendChild(p),r.body.appendChild(f),(t+"").length&&(h.width=f.offsetWidth-this.options.baselineMarkerSize,h.height=f.offsetHeight,h.baseline=p.offsetTop+this.options.baselineMarkerSize),h.width>0&&h.height>0&&this._cache.put(l,h),f.parentNode.removeChild(f),h},_baselineMarker:function(){return e("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;' />")[0]}});d.current=new d,o.util.TextMetrics=d,o.util.LRUCache=l,o.util.loadFonts=i,o.util.measureText=t}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,n,t){(t||n)()}),function(e,define){define("util/base64.min",["util/main.min"],e)}(function(){return function(){function e(e){var t,i,r,a,s,u,l,c="",d=0;for(e=n(e);e.length>d;)t=e.charCodeAt(d++),i=e.charCodeAt(d++),r=e.charCodeAt(d++),a=t>>2,s=(3&t)<<4|i>>4,u=(15&i)<<2|r>>6,l=63&r,isNaN(i)?u=l=64:isNaN(r)&&(l=64),c=c+o.charAt(a)+o.charAt(s)+o.charAt(u)+o.charAt(l);return c}function n(e){var n,t,i="";for(n=0;e.length>n;n++)t=e.charCodeAt(n),128>t?i+=r(t):2048>t?(i+=r(192|t>>>6),i+=r(128|63&t)):65536>t&&(i+=r(224|t>>>12),i+=r(128|t>>>6&63),i+=r(128|63&t));return i}var t=window.kendo,i=t.deepExtend,r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i(t.util,{encodeBase64:e,encodeUTF8:n})}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,t){(t||n)()}),function(e,define){define("mixins/observers.min",["kendo.core.min"],e)}(function(){return function(e){var n=Math,t=window.kendo,i=t.deepExtend,r=e.inArray,o={observers:function(){return this._observers=this._observers||[]},addObserver:function(e){return this._observers?this._observers.push(e):this._observers=[e],this},removeObserver:function(e){var n=this.observers(),t=r(e,n);return-1!=t&&n.splice(t,1),this},trigger:function(e,n){var t,i,r=this._observers;if(r&&!this._suspended)for(i=0;r.length>i;i++)t=r[i],t[e]&&t[e](n);return this},optionsChange:function(e){this.trigger("optionsChange",e)},geometryChange:function(e){this.trigger("geometryChange",e)},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=n.max((this._suspended||0)-1,0),this},_observerField:function(e,n){this[e]&&this[e].removeObserver(this),this[e]=n,n.addObserver(this)}};i(t,{mixins:{ObserversMixin:o}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,t){(t||n)()}),function(e,define){define("kendo.dataviz.chart.funnel.min",["kendo.dataviz.chart.min","kendo.drawing.min"],e)}(function(){return function(e,n){var t,i=window.kendo,r=i.deepExtend,o=e.extend,a=i.isFunction,s=i.template,u=i.util,l=u.append,c=i.drawing,d=i.geometry,h=i.dataviz,f=i.drawing.Color,p=h.ChartElement,g=h.PieChartMixin,m=h.PlotAreaBase,v=h.PlotAreaFactory,w=h.Point2D,y=h.Box2D,x=h.SeriesBinder,b=h.TextBox,_=h.autoFormat,k=h.evalOptions,C=u.limitValue,A=h.seriesTotal,P="category",M="color",S="funnel",O="value",I="black",N="white",z=m.extend({render:function(){var e=this,n=e.series;e.createFunnelChart(n)},createFunnelChart:function(e){var n=this,t=e[0],i=new F(n,{series:e,legend:n.options.legend,neckRatio:t.neckRatio,dynamicHeight:t.dynamicHeight,dynamicSlope:t.dynamicSlope,segmentSpacing:t.segmentSpacing,highlight:t.highlight});n.appendChart(i)},appendChart:function(e,n){m.fn.appendChart.call(this,e,n),l(this.options.legend.items,e.legendItems)}}),F=p.extend({init:function(e,n){var t=this;p.fn.init.call(t,n),t.plotArea=e,t.points=[],t.labels=[],t.legendItems=[],t.render()},options:{neckRatio:.3,width:300,dynamicSlope:!1,dynamicHeight:!0,segmentSpacing:0,labels:{visible:!1,align:"center",position:"center"}},formatPointValue:function(e,n){return _(n,e.value)},render:function(){var e,t,i,o,s,u,l,c=this,d=c.options,h=c.plotArea.options.seriesColors||[],f=h.length,p=d.series[0],g=p.data;if(g)for(i=A(p),s=0;g.length>s;s++)e=x.current.bindPoint(p,s),o=e.valueFields.value,null!==o&&o!==n&&(t=e.fields,a(p.color)||(p.color=t.color||h[s%f]),t=r({index:s,owner:c,series:p,category:t.category,dataItem:g[s],percentage:Math.abs(o)/i,visibleInLegend:t.visibleInLegend,visible:t.visible},t),u=c.createSegment(o,t),l=c.createLabel(o,t),u&&l&&u.append(l))},evalSegmentOptions:function(e,n,t){var i=t.series;k(e,{value:n,series:i,dataItem:t.dataItem,index:t.index},{defaults:i._defaults,excluded:["data","toggle","visual"]})},createSegment:function(e,i){var a,s=this,u=r({},i.series);return s.evalSegmentOptions(u,e,i),s.createLegendItem(e,u,i),i.visible!==!1?(a=new t(e,u,i),o(a,i),s.append(a),s.points.push(a),a):n},createLabel:function(e,t){var i,o,a,u=this,l=t.series,c=t.dataItem,d=r({},u.options.labels,l.labels),h=e;return d.visible?(d.template?(o=s(d.template),h=o({dataItem:c,value:e,percentage:t.percentage,category:t.category,series:l})):d.format&&(h=_(d.format,h)),d.color||"center"!==d.align||(a=new f(l.color).percBrightness(),d.color=a>180?I:N),u.evalSegmentOptions(d,e,t),i=new b(h,r({vAlign:d.position},d)),u.labels.push(i),i):n},labelPadding:function(){var e,n,t,i,r=this.labels,o={left:0,right:0};for(i=0;r.length>i;i++)e=r[i],n=e.options.align,"center"!==n&&(t=r[i].box.width(),"left"===n?o.left=Math.max(o.left,t):o.right=Math.max(o.right,t));return o},reflow:function(n){var t,i,r,o,a,s,u,l,c,h,f,p,g=this,m=g.options,v=g.points,w=v.length,y=1>=m.neckRatio,x=n.clone().unpad(g.labelPadding()),b=x.width(),_=0,k=y?0:(b-b/m.neckRatio)/2,A=m.segmentSpacing,P=m.dynamicSlope,M=x.height()-A*(w-1),S=y?m.neckRatio*b:b;if(w){if(P)for(u=v[0],l=u,e.each(v,function(e,n){n.percentage>l.percentage&&(l=n)}),r=u.percentage/l.percentage*b,k=(b-r)/2,t=0;w>t;t++)a=v[t].percentage,c=v[t+1],h=c?c.percentage:a,o=v[t].points=[],i=m.dynamicHeight?M*a:M/w,s=a?(b-r*(h/a))/2:h?0:b/2,s=C(s,0,b),o.push(new d.Point(x.x1+k,x.y1+_)),o.push(new d.Point(x.x1+b-k,x.y1+_)),o.push(new d.Point(x.x1+b-s,x.y1+i+_)),o.push(new d.Point(x.x1+s,x.y1+i+_)),k=s,_+=i+A,r=C(b-2*s,0,b);else for(f=y?b:b-2*k,p=(f-S)/2,t=0;w>t;t++)o=v[t].points=[],a=v[t].percentage,s=m.dynamicHeight?p*a:p/w,i=m.dynamicHeight?M*a:M/w,o.push(new d.Point(x.x1+k,x.y1+_)),o.push(new d.Point(x.x1+b-k,x.y1+_)),o.push(new d.Point(x.x1+b-k-s,x.y1+i+_)),o.push(new d.Point(x.x1+k+s,x.y1+i+_)),k+=s,_+=i+A;for(t=0;w>t;t++)v[t].reflow(n)}}});r(F.fn,g),t=p.extend({init:function(e,n,t){var i=this;p.fn.init.call(i,n),i.value=e,i.options.index=t.index},options:{color:N,border:{width:1}},reflow:function(e){var n=this,t=n.points,i=n.children[0];n.box=new y(t[0].x,t[0].y,t[1].x,t[2].y),i&&i.reflow(new y(e.x1,t[0].y,e.x2,t[2].y))},createVisual:function(){var e,n=this,t=n.options;p.fn.createVisual.call(this),e=t.visual?t.visual({category:n.category,dataItem:n.dataItem,value:n.value,series:n.series,percentage:n.percentage,points:n.points,options:t,createVisual:function(){return n.createPath()}}):n.createPath(),e&&this.visual.append(e)},createPath:function(){var e=this.options,n=e.border,t=c.Path.fromPoints(this.points,{fill:{color:e.color,opacity:e.opacity},stroke:{color:n.color,opacity:n.opacity,width:n.width}}).close();return t},createHighlight:function(e){return c.Path.fromPoints(this.points,e)},highlightVisual:function(){return this.visual.children[0]},highlightVisualArgs:function(){var e=c.Path.fromPoints(this.points).close();return{options:this.options,path:e}},highlightOverlay:function(e,n){var t,i,r,a=this.options,s=a.highlight||{};if(s.visible!==!1)return t=s.border||{},i=o({},n,{fill:s.color,stroke:t.color,strokeOpacity:t.opacity,strokeWidth:t.width,fillOpacity:s.opacity}),r=e.createPolyline(this.points,!0,i)},tooltipAnchor:function(e){var n=this.box;return new w(n.center().x-e/2,n.y1)},formatValue:function(e){var n=this;return n.owner.formatPointValue(n,e)}}),r(t.fn,h.PointEventsMixin),v.current.register(z,[S]),x.current.register([S],[O],[P,M,"visibleInLegend","visible"]),r(h,{FunnelChart:F,FunnelSegment:t})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,t){(t||n)()});;!function(e,define){define("kendo.mobile.scrollview.min",["kendo.fx.min","kendo.data.min","kendo.draganddrop.min"],e)}(function(){return function(e,t){var n,i,s,a,o,h,r,g,c=window.kendo,p=c.mobile,l=p.ui,u=e.proxy,d=c.effects.Transition,f=c.ui.Pane,m=c.ui.PaneDimensions,v=l.DataBoundWidget,_=c.data.DataSource,P=c.data.Buffer,w=c.data.BatchBuffer,b=Math,y=b.abs,x=b.ceil,S=b.round,T=b.max,C=b.min,z=b.floor,E="change",O="changing",k="refresh",R="km-current-page",D="km-virtual-page",M="function",V="itemChange",W="cleanup",B=3,H=-1,I=0,U=1,A=-1,j=0,q=1,F=c.Class.extend({init:function(t){var n=this,i=e("<ol class='km-pages'/>");t.element.append(i),this._changeProxy=u(n,"_change"),this._refreshProxy=u(n,"_refresh"),t.bind(E,this._changeProxy),t.bind(k,this._refreshProxy),e.extend(n,{element:i,scrollView:t})},items:function(){return this.element.children()},_refresh:function(e){var t,n="";for(t=0;e.pageCount>t;t++)n+="<li/>";this.element.html(n),this.items().eq(e.page).addClass(R)},_change:function(e){this.items().removeClass(R).eq(e.page).addClass(R)},destroy:function(){this.scrollView.unbind(E,this._changeProxy),this.scrollView.unbind(k,this._refreshProxy),this.element.remove()}});c.mobile.ui.ScrollViewPager=F,n="transitionEnd",i="dragStart",s="dragEnd",a=c.Observable.extend({init:function(t,a){var o,h,r,g,p,l,u=this;c.Observable.fn.init.call(this),this.element=t,this.container=t.parent(),o=new c.ui.Movable(u.element),h=new d({axis:"x",movable:o,onEnd:function(){u.trigger(n)}}),r=new c.UserEvents(t,{fastTap:!0,start:function(e){2*y(e.x.velocity)>=y(e.y.velocity)?r.capture():r.cancel(),u.trigger(i,e),h.cancel()},allowSelection:!0,end:function(e){u.trigger(s,e)}}),g=new m({element:u.element,container:u.container}),p=g.x,p.bind(E,function(){u.trigger(E)}),l=new f({dimensions:g,userEvents:r,movable:o,elastic:!0}),e.extend(u,{duration:a&&a.duration||1,movable:o,transition:h,userEvents:r,dimensions:g,dimension:p,pane:l}),this.bind([n,i,s,E],a)},size:function(){return{width:this.dimensions.x.getSize(),height:this.dimensions.y.getSize()}},total:function(){return this.dimension.getTotal()},offset:function(){return-this.movable.x},updateDimension:function(){this.dimension.update(!0)},refresh:function(){this.dimensions.refresh()},moveTo:function(e){this.movable.moveAxis("x",-e)},transitionTo:function(e,t,n){n?this.moveTo(-e):this.transition.moveTo({location:e,duration:this.duration,ease:t})}}),c.mobile.ui.ScrollViewElasticPane=a,o=c.Observable.extend({init:function(e,t,n){var i=this;c.Observable.fn.init.call(this),i.element=e,i.pane=t,i._getPages(),this.page=0,this.pageSize=n.pageSize||1,this.contentHeight=n.contentHeight,this.enablePager=n.enablePager,this.pagerOverlay=n.pagerOverlay},scrollTo:function(e,t){this.page=e,this.pane.transitionTo(-e*this.pane.size().width,d.easeOutExpo,t)},paneMoved:function(e,t,n,i){var s,a,o=this,h=o.pane,r=h.size().width*o.pageSize,g=S,c=t?d.easeOutBack:d.easeOutExpo;e===A?g=x:e===q&&(g=z),a=g(h.offset()/r),s=T(o.minSnap,C(-a*r,o.maxSnap)),a!=o.page&&n&&n({currentPage:o.page,nextPage:a})&&(s=-o.page*h.size().width),h.transitionTo(s,c,i)},updatePage:function(){var e=this.pane,t=S(e.offset()/e.size().width);return t!=this.page?(this.page=t,!0):!1},forcePageUpdate:function(){return this.updatePage()},resizeTo:function(e){var t,n,i=this.pane,s=e.width;this.pageElements.width(s),"100%"===this.contentHeight&&(t=this.element.parent().height(),this.enablePager===!0&&(n=this.element.parent().find("ol.km-pages"),!this.pagerOverlay&&n.length&&(t-=n.outerHeight(!0))),this.element.css("height",t),this.pageElements.css("height",t)),i.updateDimension(),this._paged||(this.page=z(i.offset()/s)),this.scrollTo(this.page,!0),this.pageCount=x(i.total()/s),this.minSnap=-(this.pageCount-1)*s,this.maxSnap=0},_getPages:function(){this.pageElements=this.element.find(c.roleSelector("page")),this._paged=this.pageElements.length>0}}),c.mobile.ui.ScrollViewContent=o,h=c.Observable.extend({init:function(e,t,n){var i=this;c.Observable.fn.init.call(this),i.element=e,i.pane=t,i.options=n,i._templates(),i.page=n.page||0,i.pages=[],i._initPages(),i.resizeTo(i.pane.size()),i.pane.dimension.forceEnabled()},setDataSource:function(e){this.dataSource=_.create(e),this._buffer(),this._pendingPageRefresh=!1,this._pendingWidgetRefresh=!1},_viewShow:function(){var e=this;e._pendingWidgetRefresh&&(setTimeout(function(){e._resetPages()},0),e._pendingWidgetRefresh=!1)},_buffer:function(){var e=this.options.itemsPerPage;this.buffer&&this.buffer.destroy(),this.buffer=e>1?new w(this.dataSource,e):new P(this.dataSource,3*e),this._resizeProxy=u(this,"_onResize"),this._resetProxy=u(this,"_onReset"),this._endReachedProxy=u(this,"_onEndReached"),this.buffer.bind({resize:this._resizeProxy,reset:this._resetProxy,endreached:this._endReachedProxy})},_templates:function(){var e=this.options.template,t=this.options.emptyTemplate,n={},i={};typeof e===M&&(n.template=e,e="#=this.template(data)#"),this.template=u(c.template(e),n),typeof t===M&&(i.emptyTemplate=t,t="#=this.emptyTemplate(data)#"),this.emptyTemplate=u(c.template(t),i)},_initPages:function(){var e,t,n=this.pages,i=this.element;for(t=0;B>t;t++)e=new r(i),n.push(e);this.pane.updateDimension()},resizeTo:function(e){var t,n,i,s=this.pages,a=this.pane;for(t=0;s.length>t;t++)s[t].setWidth(e.width);"auto"===this.options.contentHeight?this.element.css("height",this.pages[1].element.height()):"100%"===this.options.contentHeight&&(n=this.element.parent().height(),this.options.enablePager===!0&&(i=this.element.parent().find("ol.km-pages"),!this.options.pagerOverlay&&i.length&&(n-=i.outerHeight(!0))),this.element.css("height",n),s[0].element.css("height",n),s[1].element.css("height",n),s[2].element.css("height",n)),a.updateDimension(),this._repositionPages(),this.width=e.width},scrollTo:function(e){var t,n=this.buffer;n.syncDataSource(),t=n.at(e),t&&(this._updatePagesContent(e),this.page=e)},paneMoved:function(e,t,n,i){var s,a=this,o=a.pane,h=o.size().width,r=o.offset(),g=Math.abs(r)>=h/3,p=t?c.effects.Transition.easeOutBack:c.effects.Transition.easeOutExpo,l=a.page+2>a.buffer.total(),u=0;e===q?0!==a.page&&(u=-1):e!==A||l?r>0&&g&&!l?u=1:0>r&&g&&0!==a.page&&(u=-1):u=1,s=a.page,u&&(s=u>0?s+1:s-1),n&&n({currentPage:a.page,nextPage:s})&&(u=0),0===u?a._cancelMove(p,i):-1===u?a._moveBackward(i):1===u&&a._moveForward(i)},updatePage:function(){var e=this.pages;return 0===this.pane.offset()?!1:(this.pane.offset()>0?(e.push(this.pages.shift()),this.page++,this.setPageContent(e[2],this.page+1)):(e.unshift(this.pages.pop()),this.page--,this.setPageContent(e[0],this.page-1)),this._repositionPages(),this._resetMovable(),!0)},forcePageUpdate:function(){var e=this.pane.offset(),t=3*this.pane.size().width/4;return y(e)>t?this.updatePage():!1},_resetMovable:function(){this.pane.moveTo(0)},_moveForward:function(e){this.pane.transitionTo(-this.width,c.effects.Transition.easeOutExpo,e)},_moveBackward:function(e){this.pane.transitionTo(this.width,c.effects.Transition.easeOutExpo,e)},_cancelMove:function(e,t){this.pane.transitionTo(0,e,t)},_resetPages:function(){this.page=this.options.page||0,this._updatePagesContent(this.page),this._repositionPages(),this.trigger("reset")},_onResize:function(){this.pageCount=x(this.dataSource.total()/this.options.itemsPerPage),this._pendingPageRefresh&&(this._updatePagesContent(this.page),this._pendingPageRefresh=!1),this.trigger("resize")},_onReset:function(){this.pageCount=x(this.dataSource.total()/this.options.itemsPerPage),this._resetPages()},_onEndReached:function(){this._pendingPageRefresh=!0},_repositionPages:function(){var e=this.pages;e[0].position(H),e[1].position(I),e[2].position(U)},_updatePagesContent:function(e){var t=this.pages,n=e||0;this.setPageContent(t[0],n-1),this.setPageContent(t[1],n),this.setPageContent(t[2],n+1)},setPageContent:function(t,n){var i=this.buffer,s=this.template,a=this.emptyTemplate,o=null;n>=0&&(o=i.at(n),e.isArray(o)&&!o.length&&(o=null)),this.trigger(W,{item:t.element}),t.content(null!==o?s(o):a({})),c.mobile.init(t.element),this.trigger(V,{item:t.element,data:o,ns:c.mobile.ui})}}),c.mobile.ui.VirtualScrollViewContent=h,r=c.Class.extend({init:function(t){this.element=e("<div class='"+D+"'></div>"),this.width=t.width(),this.element.width(this.width),t.append(this.element)},content:function(e){this.element.html(e)},position:function(e){this.element.css("transform","translate3d("+this.width*e+"px, 0, 0)")},setWidth:function(e){this.width=e,this.element.width(e)}}),c.mobile.ui.VirtualPage=r,g=v.extend({init:function(e,t){var n,i,s,r=this;v.fn.init.call(r,e,t),t=r.options,e=r.element,c.stripWhitespace(e[0]),e.wrapInner("<div/>").addClass("km-scrollview"),this.options.enablePager&&(this.pager=new F(this),this.options.pagerOverlay&&e.addClass("km-scrollview-overlay")),r.inner=e.children().first(),r.page=0,r.inner.css("height",t.contentHeight),r.pane=new a(r.inner,{duration:this.options.duration,transitionEnd:u(this,"_transitionEnd"),dragStart:u(this,"_dragStart"),dragEnd:u(this,"_dragEnd"),change:u(this,k)}),r.bind("resize",function(){r.pane.refresh()}),r.page=t.page,n=0===this.inner.children().length,i=n?new h(r.inner,r.pane,t):new o(r.inner,r.pane,t),i.page=r.page,i.bind("reset",function(){this._pendingPageRefresh=!1,r._syncWithContent(),r.trigger(k,{pageCount:i.pageCount,page:i.page})}),i.bind("resize",function(){r.trigger(k,{pageCount:i.pageCount,page:i.page})}),i.bind(V,function(e){r.trigger(V,e),r.angular("compile",function(){return{elements:e.item,data:[{dataItem:e.data}]}})}),i.bind(W,function(e){r.angular("cleanup",function(){return{elements:e.item}})}),r._content=i,r.setDataSource(t.dataSource),s=r.container(),s.nullObject?(r.viewInit(),r.viewShow()):s.bind("show",u(this,"viewShow")).bind("init",u(this,"viewInit"))},options:{name:"ScrollView",page:0,duration:400,velocityThreshold:.8,contentHeight:"auto",pageSize:1,itemsPerPage:1,bounceVelocityThreshold:1.6,enablePager:!0,pagerOverlay:!1,autoBind:!0,template:"",emptyTemplate:""},events:[O,E,k],destroy:function(){v.fn.destroy.call(this),c.destroy(this.element)},viewInit:function(){this.options.autoBind&&this._content.scrollTo(this._content.page,!0)},viewShow:function(){this.pane.refresh()},refresh:function(){var e=this._content;e.resizeTo(this.pane.size()),this.page=e.page,this.trigger(k,{pageCount:e.pageCount,page:e.page})},content:function(e){this.element.children().first().html(e),this._content._getPages(),this.pane.refresh()},value:function(e){var n=this.dataSource;return e?(this.scrollTo(n.indexOf(e),!0),t):n.at(this.page)},scrollTo:function(e,t){this._content.scrollTo(e,t),this._syncWithContent()},prev:function(){var e=this,n=e.page-1;e._content instanceof h?e._content.paneMoved(q,t,function(t){return e.trigger(O,t)}):n>-1&&e.scrollTo(n)},next:function(){var e=this,n=e.page+1;e._content instanceof h?e._content.paneMoved(A,t,function(t){return e.trigger(O,t)}):e._content.pageCount>n&&e.scrollTo(n)},setDataSource:function(e){if(this._content instanceof h){var t=!e;this.dataSource=_.create(e),this._content.setDataSource(this.dataSource),this.options.autoBind&&!t&&this.dataSource.fetch()}},items:function(){return this.element.find("."+D)},_syncWithContent:function(){var e,n,i=this._content.pages,s=this._content.buffer;this.page=this._content.page,e=s?s.at(this.page):t,e instanceof Array||(e=[e]),n=i?i[1].element:t,this.trigger(E,{page:this.page,element:n,data:e})},_dragStart:function(){this._content.forcePageUpdate()&&this._syncWithContent()},_dragEnd:function(e){var t=this,n=e.x.velocity,i=this.options.velocityThreshold,s=j,a=y(n)>this.options.bounceVelocityThreshold;n>i?s=q:-i>n&&(s=A),this._content.paneMoved(s,a,function(e){return t.trigger(O,e)})},_transitionEnd:function(){this._content.updatePage()&&this._syncWithContent()}}),l.plugin(g)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});;!function(e,define){define("kendo.touch.min",["kendo.core.min","kendo.userevents.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.ui.Widget,a=e.proxy,o=Math.abs,r=20,u=i.extend({init:function(e,t){function o(e){return function(t){u._triggerTouch(e,t)}}function r(e){return function(t){u.trigger(e,{touches:t.touches,distance:t.distance,center:t.center,event:t.event})}}var u=this;i.fn.init.call(u,e,t),t=u.options,e=u.element,u.wrapper=e,u.events=new n.UserEvents(e,{filter:t.filter,surface:t.surface,minHold:t.minHold,multiTouch:t.multiTouch,allowSelection:!0,fastTap:t.fastTap,press:o("touchstart"),hold:o("hold"),tap:a(u,"_tap"),gesturestart:r("gesturestart"),gesturechange:r("gesturechange"),gestureend:r("gestureend")}),t.enableSwipe?(u.events.bind("start",a(u,"_swipestart")),u.events.bind("move",a(u,"_swipemove"))):(u.events.bind("start",a(u,"_dragstart")),u.events.bind("move",o("drag")),u.events.bind("end",o("dragend"))),n.notify(u)},events:["touchstart","dragstart","drag","dragend","tap","doubletap","hold","swipe","gesturestart","gesturechange","gestureend"],options:{name:"Touch",surface:null,global:!1,fastTap:!1,multiTouch:!1,enableSwipe:!1,minXDelta:30,maxYDelta:20,maxDuration:1e3,minHold:800,doubleTapTimeout:800},cancel:function(){this.events.cancel()},_triggerTouch:function(e,t){this.trigger(e,{touch:t.touch,event:t.event})&&t.preventDefault()},_tap:function(e){var t=this,i=t.lastTap,a=e.touch;i&&t.options.doubleTapTimeout>a.endTime-i.endTime&&n.touchDelta(a,i).distance<r?(t._triggerTouch("doubletap",e),t.lastTap=null):(t._triggerTouch("tap",e),t.lastTap=a)},_dragstart:function(e){this._triggerTouch("dragstart",e)},_swipestart:function(e){2*o(e.x.velocity)>=o(e.y.velocity)&&e.sender.capture()},_swipemove:function(e){var t=this,n=t.options,i=e.touch,a=e.event.timeStamp-i.startTime,r=i.x.initialDelta>0?"right":"left";o(i.x.initialDelta)>=n.minXDelta&&o(i.y.initialDelta)<n.maxYDelta&&n.maxDuration>a&&(t.trigger("swipe",{direction:r,touch:e.touch}),i.cancel())}});n.ui.plugin(u)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});;!function(e,define){define("kendo.multiselect.min",["kendo.list.min","kendo.mobile.scroller.min"],e)}(function(){return function(e,t){function i(e,t){var i;if(null===e&&null!==t||null!==e&&null===t)return!1;if(i=e.length,i!==t.length)return!1;for(;i--;)if(e[i]!==t[i])return!1;return!0}var a=window.kendo,s=a.ui,n=s.List,l=a.keys,o=a._activeElement,r=a.data.ObservableArray,u=e.proxy,c="id",d="li",p="accept",h="filter",_="rebind",f="open",m="close",g="change",v="progress",w="select",T="aria-disabled",b="aria-readonly",k="k-state-focused",y="k-loading-hidden",V="k-state-hover",x="k-state-disabled",C="disabled",S="readonly",I=".kendoMultiSelect",D="click"+I,L="keydown"+I,F="mouseenter"+I,O="mouseleave"+I,B=F+" "+O,A=/"/g,E=e.isArray,H=["font-family","font-size","font-stretch","font-style","font-weight","letter-spacing","text-transform","line-height"],M=n.extend({init:function(t,i){var s,l,o=this;o.ns=I,n.fn.init.call(o,t,i),o._optionsMap={},o._customOptions={},o._wrapper(),o._tagList(),o._input(),o._textContainer(),o._loader(),o._tabindex(o.input),t=o.element.attr("multiple","multiple").hide(),i=o.options,i.placeholder||(i.placeholder=t.data("placeholder")),s=t.attr(c),s&&(o._tagID=s+"_tag_active",s+="_taglist",o.tagList.attr(c,s)),o._aria(s),o._dataSource(),o._ignoreCase(),o._popup(),o._tagTemplate(),o._initList(),o._reset(),o._enable(),o._placeholder(),i.autoBind?o.dataSource.fetch():i.value&&o._preselect(i.value),l=e(o.element).parents("fieldset").is(":disabled"),l&&o.enable(!1),a.notify(o)},options:{name:"MultiSelect",tagMode:"multiple",enabled:!0,autoBind:!0,autoClose:!0,highlightFirst:!0,dataTextField:"",dataValueField:"",filter:"startswith",ignoreCase:!0,minLength:0,delay:100,value:null,maxSelectedItems:null,placeholder:"",height:200,animation:{},virtual:!1,itemTemplate:"",tagTemplate:"",groupTemplate:"#:data#",fixedGroupTemplate:"#:data#"},events:[f,m,g,w,"filtering","dataBinding","dataBound"],setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.listView.setDataSource(this.dataSource),this.options.autoBind&&this.dataSource.fetch()},setOptions:function(e){var t=this._listOptions(e);n.fn.setOptions.call(this,e),this.listView.setOptions(t),this._accessors(),this._aria(this.tagList.attr(c)),this._tagTemplate()},currentTag:function(e){var i=this;return e===t?i._currentTag:(i._currentTag&&(i._currentTag.removeClass(k).removeAttr(c),i.input.removeAttr("aria-activedescendant")),e&&(e.addClass(k).attr(c,i._tagID),i.input.attr("aria-activedescendant",i._tagID)),i._currentTag=e,t)},dataItems:function(){return this.listView.selectedDataItems()},destroy:function(){var e=this,t=e.ns;clearTimeout(e._busy),clearTimeout(e._typingTimeout),e.wrapper.off(t),e.tagList.off(t),e.input.off(t),n.fn.destroy.call(e)},_activateItem:function(){n.fn._activateItem.call(this),this.currentTag(null)},_listOptions:function(t){var i=this,s=n.fn._listOptions.call(i,e.extend(t,{selectedItemChange:u(i._selectedItemChange,i),selectable:"multiple"})),l=this.options.itemTemplate||this.options.template,o=s.itemTemplate||l||s.template;return o||(o="#:"+a.expr(s.dataTextField,"data")+"#"),s.template=o,s},_setListValue:function(){n.fn._setListValue.call(this,this._initialValues.slice(0))},_listChange:function(e){this._state===_&&(this._state="",e.added=[]),this._selectValue(e.added,e.removed)},_selectedItemChange:function(e){var t,i,a=e.items;for(i=0;a.length>i;i++)t=a[i],this.tagList.children().eq(t.index).children("span:first").html(this.tagTextTemplate(t.item))},_wrapperMousedown:function(t){var i=this,s="input"!==t.target.nodeName.toLowerCase(),n=e(t.target),l=n.hasClass("k-select")||n.hasClass("k-icon");l&&(l=!n.closest(".k-select").children(".k-i-arrow-s").length),!s||l&&a.support.mobileOS||t.preventDefault(),l||(i.input[0]!==o()&&s&&i.input.focus(),0===i.options.minLength&&i.open())},_inputFocus:function(){this._placeholder(!1),this.wrapper.addClass(k)},_inputFocusout:function(){var e=this;clearTimeout(e._typingTimeout),e.wrapper.removeClass(k),e._placeholder(!e.listView.selectedDataItems()[0],!0),e.close(),e._state===h&&(e._state=p,e.listView.skipUpdate(!0)),e.element.blur()},_removeTag:function(e){var i,a=this,s=a._state,n=e.index(),l=a.listView,o=l.value()[n],r=a._customOptions[o];r!==t||s!==p&&s!==h||(r=a._optionsMap[o]),r!==t?(i=a.element[0].children[r],i.removeAttribute("selected"),i.selected=!1,l.removeAt(n),e.remove()):l.select(l.select()[n]),a.currentTag(null),a._change(),a._close()},_tagListClick:function(t){var i=e(t.currentTarget);i.children(".k-i-arrow-s").length||this._removeTag(i.closest(d))},_editable:function(t){var i=this,a=t.disable,s=t.readonly,n=i.wrapper.off(I),l=i.tagList.off(I),o=i.element.add(i.input.off(I));s||a?(a?n.addClass(x):n.removeClass(x),o.attr(C,a).attr(S,s).attr(T,a).attr(b,s)):(n.removeClass(x).on(B,i._toggleHover).on("mousedown"+I+" touchend"+I,u(i._wrapperMousedown,i)),i.input.on(L,u(i._keydown,i)).on("paste"+I,u(i._search,i)).on("focus"+I,u(i._inputFocus,i)).on("focusout"+I,u(i._inputFocusout,i)),o.removeAttr(C).removeAttr(S).attr(T,!1).attr(b,!1),l.on(F,d,function(){e(this).addClass(V)}).on(O,d,function(){e(this).removeClass(V)}).on(D,"li.k-button .k-select",u(i._tagListClick,i)))},_close:function(){var e=this;e.options.autoClose?e.close():e.popup.position()},_filterSource:function(e,t){t||(t=this._retrieveData),this._retrieveData=!1,n.fn._filterSource.call(this,e,t)},close:function(){this.popup.close()},open:function(){var e=this;e._request&&(e._retrieveData=!1),e._retrieveData||!e.listView.bound()||e._state===p?(e._open=!0,e._state=_,e.listView.skipUpdate(!0),e._filterSource()):e._allowSelection()&&(e.popup.open(),e._focusItem())},toggle:function(e){e=e!==t?e:!this.popup.visible(),this[e?f:m]()},refresh:function(){this.listView.refresh()},_angularItems:function(t){var i=this;i.angular(t,function(){return{elements:i.items(),data:e.map(i.dataSource.flatView(),function(e){return{dataItem:e}})}})},_listBound:function(){var e=this,i=e.dataSource.flatView(),a=e.listView.skip(),s=i.length;e._angularItems("compile"),e._render(i),e._resizePopup(),e._open&&(e._open=!1,e.toggle(s)),e.popup.position(),!e.options.highlightFirst||a!==t&&0!==a||e.listView.focusFirst(),e._touchScroller&&e._touchScroller.reset(),e._hideBusy(),e._makeUnselectable(),e.trigger("dataBound")},search:function(e){var t,i,a=this,s=a.options,n=s.ignoreCase,l=s.dataTextField,o=a.input.val();s.placeholder===o&&(o=""),clearTimeout(a._typingTimeout),e="string"==typeof e?e:o,i=e.length,(!i||i>=s.minLength)&&(a._state=h,a._open=!0,t={value:n?e.toLowerCase():e,field:l,operator:s.filter,ignoreCase:n},a._filterSource(t))},value:function(e){var i=this,a=i.listView,s=a.value().slice(),n=i.options.maxSelectedItems,l=a.bound()&&a.isFiltered();return e===t?s:(e=i._normalizeValues(e),null!==n&&e.length>n&&(e=e.slice(0,n)),l&&(a.bound(!1),i._filterSource()),a.value(e),i._old=e,l||i._fetchData(),t)},_preselect:function(t,i){var s=this;E(t)||t instanceof a.data.ObservableArray||(t=[t]),(e.isPlainObject(t[0])||t[0]instanceof a.data.ObservableObject||!s.options.dataValueField)&&(s.dataSource.data(t),s.value(i||s._initialValues),s._retrieveData=!0)},_setOption:function(e,t){var i=this.element[0].children[this._optionsMap[e]];i&&(t?i.setAttribute("selected","selected"):i.removeAttribute("selected"),i.selected=t)},_fetchData:function(){var e=this,t=!!e.dataSource.view().length,i=0===e.listView.value().length;i||e._request||(e._retrieveData||!e._fetch&&!t)&&(e._fetch=!0,e._retrieveData=!1,e.dataSource.read().done(function(){e._fetch=!1}))},_isBound:function(){return this.listView.bound()&&!this._retrieveData},_dataSource:function(){var e=this,t=e.element,i=e.options,s=i.dataSource||{};s=E(s)?{data:s}:s,s.select=t,s.fields=[{field:i.dataTextField},{field:i.dataValueField}],e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._progressHandler=u(e._showBusy,e),e._errorHandler=u(e._hideBusy,e)),e.dataSource=a.data.DataSource.create(s).bind(v,e._progressHandler).bind("error",e._errorHandler)},_reset:function(){var t=this,i=t.element,a=i.attr("form"),s=a?e("#"+a):i.closest("form");s[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initialValues),t._placeholder()})},t._form=s.on("reset",t._resetHandler))},_initValue:function(){var e=this.options.value||this.element.val();this._old=this._initialValues=this._normalizeValues(e)},_normalizeValues:function(t){var i=this;return null===t?t=[]:t&&e.isPlainObject(t)?t=[i._value(t)]:t&&e.isPlainObject(t[0])?t=e.map(t,function(e){return i._value(e)}):E(t)||t instanceof r||(t=[t]),t},_change:function(){var e=this,t=e.value();i(t,e._old)||(e._old=t.slice(),e.trigger(g),e.element.trigger(g))},_click:function(e){var i=e.item;return e.preventDefault(),this.trigger(w,{item:i})?(this._close(),t):(this._select(i),this._change(),this._close(),t)},_keydown:function(i){var s=this,n=i.keyCode,o=s._currentTag,r=s.listView.focus(),u=s.input.val(),c=a.support.isRtl(s.wrapper),d=s.popup.visible();if(n===l.DOWN){if(i.preventDefault(),!d)return s.open(),r||this.listView.focusFirst(),t;r?(this.listView.focusNext(),this.listView.focus()||this.listView.focusLast()):this.listView.focusFirst()}else if(n===l.UP)d&&(r&&this.listView.focusPrev(),this.listView.focus()||s.close()),i.preventDefault();else if(n===l.LEFT&&!c||n===l.RIGHT&&c)u||(o=o?o.prev():e(s.tagList[0].lastChild),o[0]&&s.currentTag(o));else if(n===l.RIGHT&&!c||n===l.LEFT&&c)!u&&o&&(o=o.next(),s.currentTag(o[0]?o:null));else if(n===l.ENTER&&d){if(r){if(s.trigger(w,{item:r}))return s._close(),t;s._select(r)}s._change(),s._close(),i.preventDefault()}else n===l.ESC?(d?i.preventDefault():s.currentTag(null),s.close()):n===l.HOME?d?this.listView.focusFirst():u||(o=s.tagList[0].firstChild,o&&s.currentTag(e(o))):n===l.END?d?this.listView.focusLast():u||(o=s.tagList[0].lastChild,o&&s.currentTag(e(o))):n!==l.DELETE&&n!==l.BACKSPACE||u?(clearTimeout(s._typingTimeout),setTimeout(function(){s._scale()}),s._search()):(n!==l.BACKSPACE||o||(o=e(s.tagList[0].lastChild)),o&&o[0]&&s._removeTag(o))},_hideBusy:function(){var e=this;clearTimeout(e._busy),e.input.attr("aria-busy",!1),e._loading.addClass(y),e._request=!1,e._busy=null},_showBusyHandler:function(){this.input.attr("aria-busy",!0),this._loading.removeClass(y)},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(u(e._showBusyHandler,e),100))},_placeholder:function(e,i){var s=this,n=s.input,l=o();e===t&&(e=!1,n[0]!==l&&(e=!s.listView.selectedDataItems()[0])),s._prev="",n.toggleClass("k-readonly",e).val(e?s.options.placeholder:""),n[0]!==l||i||a.caret(n[0],0,0),s._scale()},_scale:function(){var e,t=this,i=t.wrapper,a=i.width(),s=t._span.text(t.input.val());i.is(":visible")?e=s.width()+25:(s.appendTo(document.documentElement),a=e=s.width()+25,s.appendTo(i)),t.input.width(e>a?a:e)},_option:function(e,i,s){var n="<option";return e!==t&&(e+="",-1!==e.indexOf('"')&&(e=e.replace(A,"&quot;")),n+=' value="'+e+'"'),s&&(n+=" selected"),n+=">",i!==t&&(n+=a.htmlEncode(i)),n+="</option>"},_render:function(e){var t,i,a,s,n,l,o=this.listView.selectedDataItems(),r=this.listView.value(),u=e.length,c="";for(r.length!==o.length&&(o=this._buildSelectedItems(r)),n={},l={},s=0;u>s;s++)i=e[s],a=this._value(i),t=this._selectedItemIndex(a,o),-1!==t&&o.splice(t,1),l[a]=s,c+=this._option(a,this._text(i),-1!==t);if(o.length)for(s=0;o.length>s;s++)i=o[s],a=this._value(i),n[a]=u,l[a]=u,u+=1,c+=this._option(a,this._text(i),!0);this._customOptions=n,this._optionsMap=l,this.element.html(c)},_buildSelectedItems:function(e){var t,i,a=this.options.dataValueField,s=this.options.dataTextField,n=[];for(i=0;e.length>i;i++)t={},t[a]=e[i],t[s]=e[i],n.push(t);return n},_selectedItemIndex:function(e,t){for(var i=this._value,a=0;t.length>a;a++)if(e===i(t[a]))return a;return-1},_search:function(){var e=this;e._typingTimeout=setTimeout(function(){var t=e.input.val();e._prev!==t&&(e._prev=t,e.search(t))},e.options.delay)},_allowSelection:function(){var e=this.options.maxSelectedItems;return null===e||e>this.listView.value().length},_angularTagItems:function(t){var i=this;i.angular(t,function(){return{elements:i.tagList[0].children,data:e.map(i.dataItems(),function(e){return{dataItem:e}})}})},_selectValue:function(e,t){var i,a,s,n=this,l=n.value(),o=n.dataSource.total(),r=n.tagList,u=n._value;if(n._angularTagItems("cleanup"),"multiple"===n.options.tagMode){for(s=t.length-1;s>-1;s--)i=t[s],r[0].removeChild(r[0].children[i.position]),n._setOption(u(i.dataItem),!1);for(s=0;e.length>s;s++)a=e[s],r.append(n.tagTemplate(a.dataItem)),n._setOption(u(a.dataItem),!0)}else{for((!n._maxTotal||o>n._maxTotal)&&(n._maxTotal=o),r.html(""),l.length&&r.append(n.tagTemplate({values:l,dataItems:n.dataItems(),maxTotal:n._maxTotal,currentTotal:o})),s=t.length-1;s>-1;s--)n._setOption(u(t[s].dataItem),!1);for(s=0;e.length>s;s++)n._setOption(u(e[s].dataItem),!0)}n._angularTagItems("compile"),n._placeholder()},_select:function(e){var t=this;t._state===_&&(t._state=""),t._allowSelection()&&(this.listView.select(e),t._placeholder(),t._state===h&&(t._state=p,t.listView.skipUpdate(!0)))},_input:function(){var t=this,i=t.element[0].accessKey,a=t._innerWrapper.children("input.k-input");a[0]||(a=e('<input class="k-input" style="width: 25px" />').appendTo(t._innerWrapper)),t.element.removeAttr("accesskey"),t._focused=t.input=a.attr({accesskey:i,autocomplete:"off",role:"listbox","aria-expanded":!1})},_tagList:function(){var t=this,i=t._innerWrapper.children("ul");i[0]||(i=e('<ul role="listbox" unselectable="on" class="k-reset"/>').appendTo(t._innerWrapper)),t.tagList=i},_tagTemplate:function(){var e,t=this,i=t.options,s=i.tagTemplate,n=i.dataSource,l="multiple"===i.tagMode;t.element[0].length&&!n&&(i.dataTextField=i.dataTextField||"text",i.dataValueField=i.dataValueField||"value"),e=l?a.template("#:"+a.expr(i.dataTextField,"data")+"#",{useWithBlock:!1}):a.template("#:values.length# item(s) selected"),t.tagTextTemplate=s=s?a.template(s):e,t.tagTemplate=function(e){return'<li class="k-button" unselectable="on"><span unselectable="on">'+s(e)+'</span><span unselectable="on" class="k-select"><span unselectable="on" class="k-icon '+(l?"k-i-close":"k-i-arrow-s")+'">'+(l?"delete":"open")+"</span></span></li>"}},_loader:function(){this._loading=e('<span class="k-icon k-loading '+y+'"></span>').insertAfter(this.input)},_textContainer:function(){var t=a.getComputedStyles(this.input[0],H);t.position="absolute",t.visibility="hidden",t.top=-3333,t.left=-3333,this._span=e("<span/>").css(t).appendTo(this.wrapper)},_wrapper:function(){var t=this,i=t.element,a=i.parent("span.k-multiselect");a[0]||(a=i.wrap('<div class="k-widget k-multiselect k-header" unselectable="on" />').parent(),a[0].style.cssText=i[0].style.cssText,a[0].title=i[0].title,e('<div class="k-multiselect-wrap k-floatwrap" unselectable="on" />').insertBefore(i)),t.wrapper=a.addClass(i[0].className).css("display",""),t._innerWrapper=e(a[0].firstChild)}});s.plugin(M)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()});;!function(e,define){define("aspnetmvc/kendo.data.aspnetmvc.min",["kendo.data.min","kendo.combobox.min","kendo.multiselect.min","kendo.validator.min"],e)}(function(){!function(e,t){function n(t,n,r){var i,o={};return t.sort?(o[this.options.prefix+"sort"]=e.map(t.sort,function(e){return e.field+"-"+e.dir}).join("~"),delete t.sort):o[this.options.prefix+"sort"]="",t.page&&(o[this.options.prefix+"page"]=t.page,delete t.page),t.pageSize&&(o[this.options.prefix+"pageSize"]=t.pageSize,delete t.pageSize),t.group?(o[this.options.prefix+"group"]=e.map(t.group,function(e){return e.field+"-"+e.dir}).join("~"),delete t.group):o[this.options.prefix+"group"]="",t.aggregate&&(o[this.options.prefix+"aggregate"]=e.map(t.aggregate,function(e){return e.field+"-"+e.aggregate}).join("~"),delete t.aggregate),t.filter?(o[this.options.prefix+"filter"]=a(t.filter,r.encode),delete t.filter):(o[this.options.prefix+"filter"]="",delete t.filter),delete t.take,delete t.skip,i=new g(r),i.serialize(o,t,""),o}function a(n,i){return n.filters?e.map(n.filters,function(e){var t=e.filters&&e.filters.length>1,n=a(e,i);return n&&t&&(n="("+n+")"),n}).join("~"+n.logic+"~"):n.field?n.field+"~"+n.operator+"~"+r(n.value,i):t}function r(e,t){if("string"==typeof e){if(!(e.indexOf("Date(")>-1))return e=e.replace(l,"''"),t&&(e=encodeURIComponent(e)),"'"+e+"'";e=new Date(parseInt(e.replace(/^\/Date\((.*?)\)\/$/,"$1"),10))}return e&&e.getTime?"datetime'"+c.format("{0:yyyy-MM-ddTHH-mm-ss}",e)+"'":e}function i(e,n){return t!==e?e:n}function o(t){var n=t.HasSubgroups||t.hasSubgroups||!1,a=t.Items||t.items;return{value:i(t.Key,i(t.key,t.value)),field:t.Member||t.member||t.field,hasSubgroups:n,aggregates:d(t.Aggregates||t.aggregates),items:n?e.map(a,o):a}}function s(e){var t={};return t[e.AggregateMethodName.toLowerCase()]=e.Value,t}function d(e){var t,n,a,r={};for(t in e){r={},a=e[t];for(n in a)r[n.toLowerCase()]=a[n];e[t]=r}return e}function u(e){var t,n,a,r={};for(t=0,n=e.length;n>t;t++)a=e[t],r[a.Member]=f(!0,r[a.Member],s(a));return r}var c=window.kendo,l=/'/gi,f=e.extend,p=e.isArray,m=e.isPlainObject,v=".",g=function(e){e=e||{},this.culture=e.culture||c.culture(),this.stringifyDates=e.stringifyDates,this.decimalSeparator=this.culture.numberFormat[v]};g.prototype=g.fn={serialize:function(e,t,n){var a,r;for(r in t)a=n?n+"."+r:r,this.serializeField(e,t[r],t,r,a)},serializeField:function(e,n,a,r,i){p(n)?this.serializeArray(e,n,i):m(n)?this.serialize(e,n,i):e[i]===t&&(e[i]=a[r]=this.serializeValue(n))},serializeArray:function(e,t,n){var a,r,i,o,s;for(o=0,s=0;t.length>o;o++)a=t[o],r="["+s+"]",i=n+r,this.serializeField(e,a,t,r,i),s++},serializeValue:function(e){return e instanceof Date?e=this.stringifyDates?c.stringify(e).replace(/"/g,""):c.toString(e,"G",this.culture.name):"number"==typeof e&&(e=(""+e).replace(v,this.decimalSeparator)),e}},f(!0,c.data,{schemas:{"aspnetmvc-ajax":{groups:function(t){return e.map(this._dataAccessFunction(t),o)},aggregates:function(t){var n,a;if(t=t.d||t,n=t.AggregateResults||[],!e.isArray(n)){for(a in n)n[a]=u(n[a]);return n}return u(n)}}}}),f(!0,c.data,{transports:{"aspnetmvc-ajax":c.data.RemoteTransport.extend({init:function(e){var t=this,a=(e||{}).stringifyDates;c.data.RemoteTransport.fn.init.call(this,f(!0,{},this.options,e,{parameterMap:function(e,r){return n.call(t,e,r,{encode:!1,stringifyDates:a})}}))},read:function(e){var t=this.options.data,n=this.options.read.url;m(t)?(n&&(this.options.data=null),!t.Data.length&&n?c.data.RemoteTransport.fn.read.call(this,e):e.success(t)):c.data.RemoteTransport.fn.read.call(this,e)},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"},parameterMap:n,prefix:""}})}}),f(!0,c.data,{schemas:{webapi:c.data.schemas["aspnetmvc-ajax"]}}),f(!0,c.data,{transports:{webapi:c.data.RemoteTransport.extend({init:function(e){var t,a,r=this,i=(e||{}).stringifyDates;e.update&&(t="string"==typeof e.update?e.update:e.update.url,e.update=f(e.update,{url:function(n){return c.format(t,n[e.idField])}})),e.destroy&&(a="string"==typeof e.destroy?e.destroy:e.destroy.url,e.destroy=f(e.destroy,{url:function(t){return c.format(a,t[e.idField])}})),e.create&&"string"==typeof e.create&&(e.create={url:e.create}),c.data.RemoteTransport.fn.init.call(this,f(!0,{},this.options,e,{parameterMap:function(e,t){return n.call(r,e,t,{encode:!1,stringifyDates:i,culture:c.cultures["en-US"]})}}))},read:function(e){var t=this.options.data,n=this.options.read.url;m(t)?(n&&(this.options.data=null),!t.Data.length&&n?c.data.RemoteTransport.fn.read.call(this,e):e.success(t)):c.data.RemoteTransport.fn.read.call(this,e)},options:{read:{type:"GET"},update:{type:"PUT"},create:{type:"POST"},destroy:{type:"DELETE"},parameterMap:n,prefix:""}})}}),f(!0,c.data,{transports:{"aspnetmvc-server":c.data.RemoteTransport.extend({init:function(e){var t=this;c.data.RemoteTransport.fn.init.call(this,f(e,{parameterMap:function(e,a){return n.call(t,e,a,{encode:!0})}}))},read:function(t){var n,a,r=this.options.prefix,i=[r+"sort",r+"page",r+"pageSize",r+"group",r+"aggregate",r+"filter"],o=RegExp("("+i.join("|")+")=[^&]*&?","g");a=location.search.replace(o,"").replace("?",""),a.length&&!/&$/.test(a)&&(a+="&"),t=this.setup(t,"read"),n=t.url,n.indexOf("?")>=0?(a=a.replace(/(.*?=.*?)&/g,function(e){return n.indexOf(e.substr(0,e.indexOf("=")))>=0?"":e}),n+="&"+a):n+="?"+a,n+=e.map(t.data,function(e,t){return t+"="+e}).join("&"),location.href=n}})}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("aspnetmvc/kendo.combobox.aspnetmvc.min",["aspnetmvc/kendo.data.aspnetmvc.min"],e)}(function(){!function(e,t){var n=window.kendo,a=n.ui;a&&a.ComboBox&&(a.ComboBox.requestData=function(t){var n,a,r=e(t).data("kendoComboBox");if(r)return n=r.dataSource.filter(),a=r.input.val(),n&&n.filters.length||(a=""),{text:a}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("aspnetmvc/kendo.dropdownlist.aspnetmvc.min",["aspnetmvc/kendo.data.aspnetmvc.min"],e)}(function(){!function(e,t){var n=window.kendo,a=n.ui;a&&a.DropDownList&&(a.DropDownList.requestData=function(t){var n,a,r,i=e(t).data("kendoDropDownList");if(i)return n=i.dataSource.filter(),a=i.filterInput,r=a?a.val():"",n&&n.filters.length||(r=""),{text:r}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("aspnetmvc/kendo.multiselect.aspnetmvc.min",["aspnetmvc/kendo.combobox.aspnetmvc.min"],e)}(function(){!function(e,t){var n=window.kendo,a=n.ui;a&&a.MultiSelect&&(a.MultiSelect.requestData=function(t){var n,a=e(t).data("kendoMultiSelect");if(a)return n=a.input.val(),{text:n!==a.options.placeholder?n:""}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("aspnetmvc/kendo.imagebrowser.aspnetmvc.min",["aspnetmvc/kendo.multiselect.aspnetmvc.min"],e)}(function(){!function(e,t){var n=window.kendo,a=e.extend,r=e.isFunction;a(!0,n.data,{schemas:{"imagebrowser-aspnetmvc":{data:function(e){return e||[]},model:{id:"name",fields:{name:{field:"Name"},size:{field:"Size"},type:{field:"EntryType",parse:function(e){return 0==e?"f":"d"}}}}}}}),a(!0,n.data,{schemas:{"filebrowser-aspnetmvc":n.data.schemas["imagebrowser-aspnetmvc"]}}),a(!0,n.data,{transports:{"imagebrowser-aspnetmvc":n.data.RemoteTransport.extend({init:function(t){n.data.RemoteTransport.fn.init.call(this,e.extend(!0,{},this.options,t))},_call:function(t,a){a.data=e.extend({},a.data,{path:this.options.path()}),r(this.options[t])?this.options[t].call(this,a):n.data.RemoteTransport.fn[t].call(this,a)},read:function(e){this._call("read",e)},create:function(e){this._call("create",e)},destroy:function(e){this._call("destroy",e)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"},parameterMap:function(e,t){return"read"!=t&&(e.EntryType="f"===e.EntryType?0:1),e}}})}}),a(!0,n.data,{transports:{"filebrowser-aspnetmvc":n.data.transports["imagebrowser-aspnetmvc"]}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("aspnetmvc/kendo.validator.aspnetmvc.min",["aspnetmvc/kendo.imagebrowser.aspnetmvc.min"],e)}(function(){!function(e,t){function n(){var e,t={};for(e in p)t["mvc"+e]=s(e);return t}function a(){var e,t={};for(e in p)t["mvc"+e]=d(e);return t}function r(e,t){var n,a,r,i={},o=e.data(),s=t.length;for(r in o)a=r.toLowerCase(),n=a.indexOf(t),n>-1&&(a=a.substring(n+s,r.length),a&&(i[a]=o[r]));return i}function i(t){var n,a,r=t.Fields||[],i={};for(n=0,a=r.length;a>n;n++)e.extend(!0,i,o(r[n]));return i}function o(e){var t,n,a,r,i={},o={},s=e.FieldName,d=e.ValidationRules;for(a=0,r=d.length;r>a;a++)t=d[a].ValidationType,n=d[a].ValidationParameters,i[s+t]=c(s,t,n),o[s+t]=u(d[a].ErrorMessage);return{rules:i,messages:o}}function s(e){return function(t){return t.attr("data-val-"+e)}}function d(e){return function(t){return t.filter("[data-val-"+e+"]").length?p[e](t,r(t,e)):!0}}function u(e){return function(){return e}}function c(e,t,n){return function(a){return a.filter("[name="+e+"]").length?p[t](a,n):!0}}function l(e,t){return"string"==typeof t&&(t=RegExp("^(?:"+t+")$")),t.test(e)}var f=/("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,p={required:function(e){var t,n,a,r=e.val(),i=e.filter("[type=checkbox]");return i.length&&(t=i[0].name.replace(f,"\\$1"),n="input:hidden[name='"+t+"']",a=i.next(n),a.length||(a=i.next("label.k-checkbox-label").next(n)),r=a.length?a.val():"checked"===e.attr("checked")),!(""===r||!r)},number:function(e){return""===e.val()||null==e.val()||null!==kendo.parseFloat(e.val())},regex:function(e,t){return""!==e.val()?l(e.val(),t.pattern):!0},range:function(e,t){return""!==e.val()?this.min(e,t)&&this.max(e,t):!0},min:function(e,t){var n=parseFloat(t.min)||0,a=kendo.parseFloat(e.val());return a>=n},max:function(e,t){var n=parseFloat(t.max)||0,a=kendo.parseFloat(e.val());return n>=a},date:function(e){return""===e.val()||null!==kendo.parseDate(e.val())},length:function(t,n){if(""!==t.val()){var a=e.trim(t.val()).length;return(!n.min||a>=(n.min||0))&&(!n.max||(n.max||0)>=a)}return!0}};e.extend(!0,kendo.ui.validator,{rules:a(),messages:n(),messageLocators:{mvcLocator:{locate:function(e,t){return t=t.replace(f,"\\$1"),e.find(".field-validation-valid[data-valmsg-for='"+t+"'], .field-validation-error[data-valmsg-for='"+t+"']")},decorate:function(e,t){e.addClass("field-validation-error").attr("data-valmsg-for",t||"")}},mvcMetadataLocator:{locate:function(e,t){return t=t.replace(f,"\\$1"),e.find("#"+t+"_validationMessage.field-validation-valid")},decorate:function(e,t){e.addClass("field-validation-error").attr("id",t+"_validationMessage")}}},ruleResolvers:{mvcMetaDataResolver:{resolve:function(t){var n,a=window.mvcClientValidationMetadata||[];if(a.length)for(t=e(t),n=0;a.length>n;n++)if(a[n].FormId==t.attr("id"))return i(a[n]);return{}}}}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.aspnetmvc.min",["kendo.data.min","kendo.combobox.min","kendo.dropdownlist.min","kendo.multiselect.min","kendo.validator.min","aspnetmvc/kendo.data.aspnetmvc.min","aspnetmvc/kendo.combobox.aspnetmvc.min","aspnetmvc/kendo.dropdownlist.aspnetmvc.min","aspnetmvc/kendo.multiselect.aspnetmvc.min","aspnetmvc/kendo.imagebrowser.aspnetmvc.min","aspnetmvc/kendo.validator.aspnetmvc.min"],e)}(function(){},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});;;
(function($, undefined){
    var count = 0;

    window.kendoConsole = {
        log: function(message, isError, container) {
            var lastContainer = $(".console div:first", container),
                counter = lastContainer.find(".count").detach(),
                lastMessage = lastContainer.text(),
                count = 1 * (counter.text() || 1);

            lastContainer.append(counter);

            if (!lastContainer.length || message !== lastMessage) {
                $("<div" + (isError ? " class='error'" : "") + "/>")
                    .css({
                        marginTop: -24,
                        backgroundColor: isError ? "#ffbbbb" : "#bbddff"
                    })
                    .html(message)
                    .prependTo($(".console", container))
                    .animate({ marginTop: 0 }, 300)
                    .animate({ backgroundColor: isError ? "#ffdddd" : "#ffffff" }, 800);
            } else {
                count++;

                if (counter.length) {
                    counter.html(count);
                } else {
                    lastContainer.html(lastMessage)
                        .append("<span class='count'>" + count + "</span>");
                }
            }
        },

        error: function(message) {
            this.log(message, true);
        }
    };
})(jQuery);

/*
 * jQuery Color Animations
 * Copyright 2007 John Resig
 * Released under the MIT and GPL licenses.
 */

(function(jQuery) {

    // We override the animation for all of these color styles
    jQuery.each(["backgroundColor", "borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor", "color", "outlineColor"], function(i, attr) {
        jQuery.fx.step[attr] = function(fx) {
            if (!fx.state || typeof fx.end == typeof "") {
                fx.start = getColor(fx.elem, attr);
                fx.end = getRGB(fx.end);
            }

            fx.elem.style[attr] = ["rgb(", [
                Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0),
                Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0),
                Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0)
            ].join(","), ")"].join("");
        };
    });

    // Color Conversion functions from highlightFade
    // By Blair Mitchelmore
    // http://jquery.offput.ca/highlightFade/

    // Parse strings looking for color tuples [255,255,255]
    function getRGB(color) {
        var result;

        // Check if we're already dealing with an array of colors
        if (color && color.constructor == Array && color.length == 3) {
            return color;
        }

        // Look for rgb(num,num,num)
        result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color);
        if (result) {
            return [parseInt(result[1], 10), parseInt(result[2], 10), parseInt(result[3], 10)];
        }

        // Look for #a0b1c2
        result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color);
        if (result) {
            return [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)];
        }

        // Otherwise, we're most likely dealing with a named color
        return jQuery.trim(color).toLowerCase();
    }

    function getColor(elem, attr) {
        var color;

        do {
            color = jQuery.css(elem, attr);

            // Keep going until we find an element that has color, or we hit the body
            if (color && color != "transparent" || jQuery.nodeName(elem, "body")) {
                break;
            }

            attr = "backgroundColor";

            elem = elem.parentNode;
        } while (elem);

        return getRGB(color);
    }

    var href = window.location.href;
    if (href.indexOf("culture") > -1) {
        $("#culture").val(href.replace(/(.*)culture=([^&]*)/, "$2"));
    }

    function onlocalizationchange() {
        var value = $(this).val();
        var href = window.location.href;
        if (href.indexOf("culture") > -1) {
            href = href.replace(/culture=([^&]*)/, "culture=" + value);
        } else {
            href += href.indexOf("?") > -1 ? "&culture=" + value : "?culture=" + value;
        }
        window.location.href = href;
    }

    $("#culture").change(onlocalizationchange);
})(jQuery);
;
(function(){var b,d,c;b=jQuery;c=(function(){function b(){this.fadeDuration=500;this.fitImagesInViewport=true;this.resizeDuration=700;this.showImageNumberLabel=true;this.wrapAround=false}b.prototype.albumLabel=function(b,c){return"Image "+b+" of "+c};return b})();d=(function(){function c(b){this.options=b;this.album=[];this.currentImageIndex=void 0;this.init()}c.prototype.init=function(){this.enable();return this.build()};c.prototype.enable=function(){var c=this;return b('body').on('click','a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]',function(d){c.start(b(d.currentTarget));return false})};c.prototype.build=function(){var c=this;b("<div id='lightboxOverlay' class='lightboxOverlay'></div><div id='lightbox' class='lightbox'><div class='lb-outerContainer'><div class='lb-container'><img class='lb-image' src='' /><div class='lb-nav'><a class='lb-prev' href='' ></a><a class='lb-next' href='' ></a></div><div class='lb-loader'><a class='lb-cancel'></a></div></div></div><div class='lb-dataContainer'><div class='lb-data'><div class='lb-details'><span class='lb-caption'></span><span class='lb-number'></span></div><div class='lb-closeContainer'><a class='lb-close'></a></div></div></div></div>").appendTo(b('body'));this.$lightbox=b('#lightbox');this.$overlay=b('#lightboxOverlay');this.$outerContainer=this.$lightbox.find('.lb-outerContainer');this.$container=this.$lightbox.find('.lb-container');this.containerTopPadding=parseInt(this.$container.css('padding-top'),10);this.containerRightPadding=parseInt(this.$container.css('padding-right'),10);this.containerBottomPadding=parseInt(this.$container.css('padding-bottom'),10);this.containerLeftPadding=parseInt(this.$container.css('padding-left'),10);this.$overlay.hide().on('click',function(){c.end();return false});this.$lightbox.hide().on('click',function(d){if(b(d.target).attr('id')==='lightbox'){c.end()}return false});this.$outerContainer.on('click',function(d){if(b(d.target).attr('id')==='lightbox'){c.end()}return false});this.$lightbox.find('.lb-prev').on('click',function(){if(c.currentImageIndex===0){c.changeImage(c.album.length-1)}else{c.changeImage(c.currentImageIndex-1)}return false});this.$lightbox.find('.lb-next').on('click',function(){if(c.currentImageIndex===c.album.length-1){c.changeImage(0)}else{c.changeImage(c.currentImageIndex+1)}return false});return this.$lightbox.find('.lb-loader, .lb-close').on('click',function(){c.end();return false})};c.prototype.start=function(c){var f,e,j,d,g,n,o,k,l,m,p,h,i;b(window).on("resize",this.sizeOverlay);b('select, object, embed').css({visibility:"hidden"});this.$overlay.width(b(document).width()).height(b(document).height()).fadeIn(this.options.fadeDuration);this.album=[];g=0;j=c.attr('data-lightbox');if(j){h=b(c.prop("tagName")+'[data-lightbox="'+j+'"]');for(d=k=0,m=h.length;k<m;d=++k){e=h[d];this.album.push({link:b(e).attr('href'),title:b(e).attr('title')});if(b(e).attr('href')===c.attr('href')){g=d}}}else{if(c.attr('rel')==='lightbox'){this.album.push({link:c.attr('href'),title:c.attr('title')})}else{i=b(c.prop("tagName")+'[rel="'+c.attr('rel')+'"]');for(d=l=0,p=i.length;l<p;d=++l){e=i[d];this.album.push({link:b(e).attr('href'),title:b(e).attr('title')});if(b(e).attr('href')===c.attr('href')){g=d}}}}f=b(window);o=f.scrollTop()+f.height()/10;n=f.scrollLeft();this.$lightbox.css({top:o+'px',left:n+'px'}).fadeIn(this.options.fadeDuration);this.changeImage(g)};c.prototype.changeImage=function(f){var d,c,e=this;this.disableKeyboardNav();d=this.$lightbox.find('.lb-image');this.sizeOverlay();this.$overlay.fadeIn(this.options.fadeDuration);b('.lb-loader').fadeIn('slow');this.$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide();this.$outerContainer.addClass('animating');c=new Image();c.onload=function(){var m,g,h,i,j,k,l;d.attr('src',e.album[f].link);m=b(c);d.width(c.width);d.height(c.height);if(e.options.fitImagesInViewport){l=b(window).width();k=b(window).height();j=l-e.containerLeftPadding-e.containerRightPadding-20;i=k-e.containerTopPadding-e.containerBottomPadding-110;if((c.width>j)||(c.height>i)){if((c.width/j)>(c.height/i)){h=j;g=parseInt(c.height/(c.width/h),10);d.width(h);d.height(g)}else{g=i;h=parseInt(c.width/(c.height/g),10);d.width(h);d.height(g)}}}return e.sizeContainer(d.width(),d.height())};c.src=this.album[f].link;this.currentImageIndex=f};c.prototype.sizeOverlay=function(){return b('#lightboxOverlay').width(b(document).width()).height(b(document).height())};c.prototype.sizeContainer=function(f,g){var b,d,e,h,c=this;h=this.$outerContainer.outerWidth();e=this.$outerContainer.outerHeight();d=f+this.containerLeftPadding+this.containerRightPadding;b=g+this.containerTopPadding+this.containerBottomPadding;this.$outerContainer.animate({width:d,height:b},this.options.resizeDuration,'swing');setTimeout(function(){c.$lightbox.find('.lb-dataContainer').width(d);c.$lightbox.find('.lb-prevLink').height(b);c.$lightbox.find('.lb-nextLink').height(b);c.showImage()},this.options.resizeDuration)};c.prototype.showImage=function(){this.$lightbox.find('.lb-loader').hide();this.$lightbox.find('.lb-image').fadeIn('slow');this.updateNav();this.updateDetails();this.preloadNeighboringImages();this.enableKeyboardNav()};c.prototype.updateNav=function(){this.$lightbox.find('.lb-nav').show();if(this.album.length>1){if(this.options.wrapAround){this.$lightbox.find('.lb-prev, .lb-next').show()}else{if(this.currentImageIndex>0){this.$lightbox.find('.lb-prev').show()}if(this.currentImageIndex<this.album.length-1){this.$lightbox.find('.lb-next').show()}}}};c.prototype.updateDetails=function(){var b=this;if(typeof this.album[this.currentImageIndex].title!=='undefined'&&this.album[this.currentImageIndex].title!==""){this.$lightbox.find('.lb-caption').html(this.album[this.currentImageIndex].title).fadeIn('fast')}if(this.album.length>1&&this.options.showImageNumberLabel){this.$lightbox.find('.lb-number').text(this.options.albumLabel(this.currentImageIndex+1,this.album.length)).fadeIn('fast')}else{this.$lightbox.find('.lb-number').hide()}this.$outerContainer.removeClass('animating');this.$lightbox.find('.lb-dataContainer').fadeIn(this.resizeDuration,function(){return b.sizeOverlay()})};c.prototype.preloadNeighboringImages=function(){var c,b;if(this.album.length>this.currentImageIndex+1){c=new Image();c.src=this.album[this.currentImageIndex+1].link}if(this.currentImageIndex>0){b=new Image();b.src=this.album[this.currentImageIndex-1].link}};c.prototype.enableKeyboardNav=function(){b(document).on('keyup.keyboard',b.proxy(this.keyboardAction,this))};c.prototype.disableKeyboardNav=function(){b(document).off('.keyboard')};c.prototype.keyboardAction=function(g){var d,e,f,c,b;d=27;e=37;f=39;b=g.keyCode;c=String.fromCharCode(b).toLowerCase();if(b===d||c.match(/x|o|c/)){this.end()}else if(c==='p'||b===e){if(this.currentImageIndex!==0){this.changeImage(this.currentImageIndex-1)}}else if(c==='n'||b===f){if(this.currentImageIndex!==this.album.length-1){this.changeImage(this.currentImageIndex+1)}}};c.prototype.end=function(){this.disableKeyboardNav();b(window).off("resize",this.sizeOverlay);this.$lightbox.fadeOut(this.options.fadeDuration);this.$overlay.fadeOut(this.options.fadeDuration);return b('select, object, embed').css({visibility:"visible"})};return c})();b(function(){var e,b;b=new c();return e=new d(b)})}).call(this);;
/*!
 * Knockout JavaScript library v3.2.0
 * (c) Steven Sanderson - http://knockoutjs.com/
 * License: MIT (http://www.opensource.org/licenses/mit-license.php)
 */

(function() {(function(p){var s=this||(0,eval)("this"),v=s.document,L=s.navigator,w=s.jQuery,D=s.JSON;(function(p){"function"===typeof require&&"object"===typeof exports&&"object"===typeof module?p(module.exports||exports,require):"function"===typeof define&&define.amd?define(["exports","require"],p):p(s.ko={})})(function(M,N){function H(a,d){return null===a||typeof a in R?a===d:!1}function S(a,d){var c;return function(){c||(c=setTimeout(function(){c=p;a()},d))}}function T(a,d){var c;return function(){clearTimeout(c);
c=setTimeout(a,d)}}function I(b,d,c,e){a.d[b]={init:function(b,h,k,f,m){var l,q;a.s(function(){var f=a.a.c(h()),k=!c!==!f,z=!q;if(z||d||k!==l)z&&a.Y.la()&&(q=a.a.ia(a.f.childNodes(b),!0)),k?(z||a.f.T(b,a.a.ia(q)),a.Ca(e?e(m,f):m,b)):a.f.ja(b),l=k},null,{o:b});return{controlsDescendantBindings:!0}}};a.h.ha[b]=!1;a.f.Q[b]=!0}var a="undefined"!==typeof M?M:{};a.b=function(b,d){for(var c=b.split("."),e=a,g=0;g<c.length-1;g++)e=e[c[g]];e[c[c.length-1]]=d};a.A=function(a,d,c){a[d]=c};a.version="3.2.0";
a.b("version",a.version);a.a=function(){function b(a,b){for(var c in a)a.hasOwnProperty(c)&&b(c,a[c])}function d(a,b){if(b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function c(a,b){a.__proto__=b;return a}var e={__proto__:[]}instanceof Array,g={},h={};g[L&&/Firefox\/2/i.test(L.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];g.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");b(g,function(a,b){if(b.length)for(var c=
0,d=b.length;c<d;c++)h[b[c]]=a});var k={propertychange:!0},f=v&&function(){for(var a=3,b=v.createElement("div"),c=b.getElementsByTagName("i");b.innerHTML="\x3c!--[if gt IE "+ ++a+"]><i></i><![endif]--\x3e",c[0];);return 4<a?a:p}();return{vb:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],u:function(a,b){for(var c=0,d=a.length;c<d;c++)b(a[c],c)},m:function(a,b){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(a,b);for(var c=0,d=a.length;c<d;c++)if(a[c]===
b)return c;return-1},qb:function(a,b,c){for(var d=0,f=a.length;d<f;d++)if(b.call(c,a[d],d))return a[d];return null},ua:function(m,b){var c=a.a.m(m,b);0<c?m.splice(c,1):0===c&&m.shift()},rb:function(m){m=m||[];for(var b=[],c=0,d=m.length;c<d;c++)0>a.a.m(b,m[c])&&b.push(m[c]);return b},Da:function(a,b){a=a||[];for(var c=[],d=0,f=a.length;d<f;d++)c.push(b(a[d],d));return c},ta:function(a,b){a=a||[];for(var c=[],d=0,f=a.length;d<f;d++)b(a[d],d)&&c.push(a[d]);return c},ga:function(a,b){if(b instanceof
Array)a.push.apply(a,b);else for(var c=0,d=b.length;c<d;c++)a.push(b[c]);return a},ea:function(b,c,d){var f=a.a.m(a.a.Xa(b),c);0>f?d&&b.push(c):d||b.splice(f,1)},xa:e,extend:d,za:c,Aa:e?c:d,G:b,na:function(a,b){if(!a)return a;var c={},d;for(d in a)a.hasOwnProperty(d)&&(c[d]=b(a[d],d,a));return c},Ka:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},oc:function(b){b=a.a.S(b);for(var c=v.createElement("div"),d=0,f=b.length;d<f;d++)c.appendChild(a.R(b[d]));return c},ia:function(b,c){for(var d=
0,f=b.length,e=[];d<f;d++){var k=b[d].cloneNode(!0);e.push(c?a.R(k):k)}return e},T:function(b,c){a.a.Ka(b);if(c)for(var d=0,f=c.length;d<f;d++)b.appendChild(c[d])},Lb:function(b,c){var d=b.nodeType?[b]:b;if(0<d.length){for(var f=d[0],e=f.parentNode,k=0,g=c.length;k<g;k++)e.insertBefore(c[k],f);k=0;for(g=d.length;k<g;k++)a.removeNode(d[k])}},ka:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.shift();if(1<a.length){var c=a[0],d=a[a.length-1];for(a.length=
0;c!==d;)if(a.push(c),c=c.nextSibling,!c)return;a.push(d)}}return a},Nb:function(a,b){7>f?a.setAttribute("selected",b):a.selected=b},cb:function(a){return null===a||a===p?"":a.trim?a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},vc:function(a,b){a=a||"";return b.length>a.length?!1:a.substring(0,b.length)===b},cc:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(3===a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&
16);for(;a&&a!=b;)a=a.parentNode;return!!a},Ja:function(b){return a.a.cc(b,b.ownerDocument.documentElement)},ob:function(b){return!!a.a.qb(b,a.a.Ja)},t:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},n:function(b,c,d){var e=f&&k[c];if(!e&&w)w(b).bind(c,d);else if(e||"function"!=typeof b.addEventListener)if("undefined"!=typeof b.attachEvent){var g=function(a){d.call(b,a)},h="on"+c;b.attachEvent(h,g);a.a.w.da(b,function(){b.detachEvent(h,g)})}else throw Error("Browser doesn't support addEventListener or attachEvent");
else b.addEventListener(c,d,!1)},oa:function(b,c){if(!b||!b.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var d;"input"===a.a.t(b)&&b.type&&"click"==c.toLowerCase()?(d=b.type,d="checkbox"==d||"radio"==d):d=!1;if(w&&!d)w(b).trigger(c);else if("function"==typeof v.createEvent)if("function"==typeof b.dispatchEvent)d=v.createEvent(h[c]||"HTMLEvents"),d.initEvent(c,!0,!0,s,0,0,0,0,0,!1,!1,!1,!1,0,b),b.dispatchEvent(d);else throw Error("The supplied element doesn't support dispatchEvent");
else if(d&&b.click)b.click();else if("undefined"!=typeof b.fireEvent)b.fireEvent("on"+c);else throw Error("Browser doesn't support triggering events");},c:function(b){return a.C(b)?b():b},Xa:function(b){return a.C(b)?b.v():b},Ba:function(b,c,d){if(c){var f=/\S+/g,e=b.className.match(f)||[];a.a.u(c.match(f),function(b){a.a.ea(e,b,d)});b.className=e.join(" ")}},bb:function(b,c){var d=a.a.c(c);if(null===d||d===p)d="";var f=a.f.firstChild(b);!f||3!=f.nodeType||a.f.nextSibling(f)?a.f.T(b,[b.ownerDocument.createTextNode(d)]):
f.data=d;a.a.fc(b)},Mb:function(a,b){a.name=b;if(7>=f)try{a.mergeAttributes(v.createElement("<input name='"+a.name+"'/>"),!1)}catch(c){}},fc:function(a){9<=f&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},dc:function(a){if(f){var b=a.style.width;a.style.width=0;a.style.width=b}},sc:function(b,c){b=a.a.c(b);c=a.a.c(c);for(var d=[],f=b;f<=c;f++)d.push(f);return d},S:function(a){for(var b=[],c=0,d=a.length;c<d;c++)b.push(a[c]);return b},yc:6===f,zc:7===f,L:f,xb:function(b,c){for(var d=
a.a.S(b.getElementsByTagName("input")).concat(a.a.S(b.getElementsByTagName("textarea"))),f="string"==typeof c?function(a){return a.name===c}:function(a){return c.test(a.name)},e=[],k=d.length-1;0<=k;k--)f(d[k])&&e.push(d[k]);return e},pc:function(b){return"string"==typeof b&&(b=a.a.cb(b))?D&&D.parse?D.parse(b):(new Function("return "+b))():null},eb:function(b,c,d){if(!D||!D.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");
return D.stringify(a.a.c(b),c,d)},qc:function(c,d,f){f=f||{};var e=f.params||{},k=f.includeFields||this.vb,g=c;if("object"==typeof c&&"form"===a.a.t(c))for(var g=c.action,h=k.length-1;0<=h;h--)for(var r=a.a.xb(c,k[h]),E=r.length-1;0<=E;E--)e[r[E].name]=r[E].value;d=a.a.c(d);var y=v.createElement("form");y.style.display="none";y.action=g;y.method="post";for(var p in d)c=v.createElement("input"),c.type="hidden",c.name=p,c.value=a.a.eb(a.a.c(d[p])),y.appendChild(c);b(e,function(a,b){var c=v.createElement("input");
c.type="hidden";c.name=a;c.value=b;y.appendChild(c)});v.body.appendChild(y);f.submitter?f.submitter(y):y.submit();setTimeout(function(){y.parentNode.removeChild(y)},0)}}}();a.b("utils",a.a);a.b("utils.arrayForEach",a.a.u);a.b("utils.arrayFirst",a.a.qb);a.b("utils.arrayFilter",a.a.ta);a.b("utils.arrayGetDistinctValues",a.a.rb);a.b("utils.arrayIndexOf",a.a.m);a.b("utils.arrayMap",a.a.Da);a.b("utils.arrayPushAll",a.a.ga);a.b("utils.arrayRemoveItem",a.a.ua);a.b("utils.extend",a.a.extend);a.b("utils.fieldsIncludedWithJsonPost",
a.a.vb);a.b("utils.getFormFields",a.a.xb);a.b("utils.peekObservable",a.a.Xa);a.b("utils.postJson",a.a.qc);a.b("utils.parseJson",a.a.pc);a.b("utils.registerEventHandler",a.a.n);a.b("utils.stringifyJson",a.a.eb);a.b("utils.range",a.a.sc);a.b("utils.toggleDomNodeCssClass",a.a.Ba);a.b("utils.triggerEvent",a.a.oa);a.b("utils.unwrapObservable",a.a.c);a.b("utils.objectForEach",a.a.G);a.b("utils.addOrRemoveItem",a.a.ea);a.b("unwrap",a.a.c);Function.prototype.bind||(Function.prototype.bind=function(a){var d=
this,c=Array.prototype.slice.call(arguments);a=c.shift();return function(){return d.apply(a,c.concat(Array.prototype.slice.call(arguments)))}});a.a.e=new function(){function a(b,h){var k=b[c];if(!k||"null"===k||!e[k]){if(!h)return p;k=b[c]="ko"+d++;e[k]={}}return e[k]}var d=0,c="__ko__"+(new Date).getTime(),e={};return{get:function(c,d){var e=a(c,!1);return e===p?p:e[d]},set:function(c,d,e){if(e!==p||a(c,!1)!==p)a(c,!0)[d]=e},clear:function(a){var b=a[c];return b?(delete e[b],a[c]=null,!0):!1},F:function(){return d++ +
c}}};a.b("utils.domData",a.a.e);a.b("utils.domData.clear",a.a.e.clear);a.a.w=new function(){function b(b,d){var f=a.a.e.get(b,c);f===p&&d&&(f=[],a.a.e.set(b,c,f));return f}function d(c){var e=b(c,!1);if(e)for(var e=e.slice(0),f=0;f<e.length;f++)e[f](c);a.a.e.clear(c);a.a.w.cleanExternalData(c);if(g[c.nodeType])for(e=c.firstChild;c=e;)e=c.nextSibling,8===c.nodeType&&d(c)}var c=a.a.e.F(),e={1:!0,8:!0,9:!0},g={1:!0,9:!0};return{da:function(a,c){if("function"!=typeof c)throw Error("Callback must be a function");
b(a,!0).push(c)},Kb:function(d,e){var f=b(d,!1);f&&(a.a.ua(f,e),0==f.length&&a.a.e.set(d,c,p))},R:function(b){if(e[b.nodeType]&&(d(b),g[b.nodeType])){var c=[];a.a.ga(c,b.getElementsByTagName("*"));for(var f=0,m=c.length;f<m;f++)d(c[f])}return b},removeNode:function(b){a.R(b);b.parentNode&&b.parentNode.removeChild(b)},cleanExternalData:function(a){w&&"function"==typeof w.cleanData&&w.cleanData([a])}}};a.R=a.a.w.R;a.removeNode=a.a.w.removeNode;a.b("cleanNode",a.R);a.b("removeNode",a.removeNode);a.b("utils.domNodeDisposal",
a.a.w);a.b("utils.domNodeDisposal.addDisposeCallback",a.a.w.da);a.b("utils.domNodeDisposal.removeDisposeCallback",a.a.w.Kb);(function(){a.a.ba=function(b){var d;if(w)if(w.parseHTML)d=w.parseHTML(b)||[];else{if((d=w.clean([b]))&&d[0]){for(b=d[0];b.parentNode&&11!==b.parentNode.nodeType;)b=b.parentNode;b.parentNode&&b.parentNode.removeChild(b)}}else{var c=a.a.cb(b).toLowerCase();d=v.createElement("div");c=c.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","</table>"]||!c.indexOf("<tr")&&[2,"<table><tbody>",
"</tbody></table>"]||(!c.indexOf("<td")||!c.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""];b="ignored<div>"+c[1]+b+c[2]+"</div>";for("function"==typeof s.innerShiv?d.appendChild(s.innerShiv(b)):d.innerHTML=b;c[0]--;)d=d.lastChild;d=a.a.S(d.lastChild.childNodes)}return d};a.a.$a=function(b,d){a.a.Ka(b);d=a.a.c(d);if(null!==d&&d!==p)if("string"!=typeof d&&(d=d.toString()),w)w(b).html(d);else for(var c=a.a.ba(d),e=0;e<c.length;e++)b.appendChild(c[e])}})();a.b("utils.parseHtmlFragment",
a.a.ba);a.b("utils.setHtml",a.a.$a);a.D=function(){function b(c,d){if(c)if(8==c.nodeType){var g=a.D.Gb(c.nodeValue);null!=g&&d.push({bc:c,mc:g})}else if(1==c.nodeType)for(var g=0,h=c.childNodes,k=h.length;g<k;g++)b(h[g],d)}var d={};return{Ua:function(a){if("function"!=typeof a)throw Error("You can only pass a function to ko.memoization.memoize()");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);d[b]=a;return"\x3c!--[ko_memo:"+
b+"]--\x3e"},Rb:function(a,b){var g=d[a];if(g===p)throw Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized.");try{return g.apply(null,b||[]),!0}finally{delete d[a]}},Sb:function(c,d){var g=[];b(c,g);for(var h=0,k=g.length;h<k;h++){var f=g[h].bc,m=[f];d&&a.a.ga(m,d);a.D.Rb(g[h].mc,m);f.nodeValue="";f.parentNode&&f.parentNode.removeChild(f)}},Gb:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:null}}}();a.b("memoization",a.D);a.b("memoization.memoize",a.D.Ua);
a.b("memoization.unmemoize",a.D.Rb);a.b("memoization.parseMemoText",a.D.Gb);a.b("memoization.unmemoizeDomNodeAndDescendants",a.D.Sb);a.La={throttle:function(b,d){b.throttleEvaluation=d;var c=null;return a.j({read:b,write:function(a){clearTimeout(c);c=setTimeout(function(){b(a)},d)}})},rateLimit:function(a,d){var c,e,g;"number"==typeof d?c=d:(c=d.timeout,e=d.method);g="notifyWhenChangesStop"==e?T:S;a.Ta(function(a){return g(a,c)})},notify:function(a,d){a.equalityComparer="always"==d?null:H}};var R=
{undefined:1,"boolean":1,number:1,string:1};a.b("extenders",a.La);a.Pb=function(b,d,c){this.target=b;this.wa=d;this.ac=c;this.Cb=!1;a.A(this,"dispose",this.K)};a.Pb.prototype.K=function(){this.Cb=!0;this.ac()};a.P=function(){a.a.Aa(this,a.P.fn);this.M={}};var G="change",A={U:function(b,d,c){var e=this;c=c||G;var g=new a.Pb(e,d?b.bind(d):b,function(){a.a.ua(e.M[c],g);e.nb&&e.nb()});e.va&&e.va(c);e.M[c]||(e.M[c]=[]);e.M[c].push(g);return g},notifySubscribers:function(b,d){d=d||G;if(this.Ab(d))try{a.k.Ea();
for(var c=this.M[d].slice(0),e=0,g;g=c[e];++e)g.Cb||g.wa(b)}finally{a.k.end()}},Ta:function(b){var d=this,c=a.C(d),e,g,h;d.qa||(d.qa=d.notifySubscribers,d.notifySubscribers=function(a,b){b&&b!==G?"beforeChange"===b?d.kb(a):d.qa(a,b):d.lb(a)});var k=b(function(){c&&h===d&&(h=d());e=!1;d.Pa(g,h)&&d.qa(g=h)});d.lb=function(a){e=!0;h=a;k()};d.kb=function(a){e||(g=a,d.qa(a,"beforeChange"))}},Ab:function(a){return this.M[a]&&this.M[a].length},yb:function(){var b=0;a.a.G(this.M,function(a,c){b+=c.length});
return b},Pa:function(a,d){return!this.equalityComparer||!this.equalityComparer(a,d)},extend:function(b){var d=this;b&&a.a.G(b,function(b,e){var g=a.La[b];"function"==typeof g&&(d=g(d,e)||d)});return d}};a.A(A,"subscribe",A.U);a.A(A,"extend",A.extend);a.A(A,"getSubscriptionsCount",A.yb);a.a.xa&&a.a.za(A,Function.prototype);a.P.fn=A;a.Db=function(a){return null!=a&&"function"==typeof a.U&&"function"==typeof a.notifySubscribers};a.b("subscribable",a.P);a.b("isSubscribable",a.Db);a.Y=a.k=function(){function b(a){c.push(e);
e=a}function d(){e=c.pop()}var c=[],e,g=0;return{Ea:b,end:d,Jb:function(b){if(e){if(!a.Db(b))throw Error("Only subscribable things can act as dependencies");e.wa(b,b.Vb||(b.Vb=++g))}},B:function(a,c,f){try{return b(),a.apply(c,f||[])}finally{d()}},la:function(){if(e)return e.s.la()},ma:function(){if(e)return e.ma}}}();a.b("computedContext",a.Y);a.b("computedContext.getDependenciesCount",a.Y.la);a.b("computedContext.isInitial",a.Y.ma);a.b("computedContext.isSleeping",a.Y.Ac);a.p=function(b){function d(){if(0<
arguments.length)return d.Pa(c,arguments[0])&&(d.X(),c=arguments[0],d.W()),this;a.k.Jb(d);return c}var c=b;a.P.call(d);a.a.Aa(d,a.p.fn);d.v=function(){return c};d.W=function(){d.notifySubscribers(c)};d.X=function(){d.notifySubscribers(c,"beforeChange")};a.A(d,"peek",d.v);a.A(d,"valueHasMutated",d.W);a.A(d,"valueWillMutate",d.X);return d};a.p.fn={equalityComparer:H};var F=a.p.rc="__ko_proto__";a.p.fn[F]=a.p;a.a.xa&&a.a.za(a.p.fn,a.P.fn);a.Ma=function(b,d){return null===b||b===p||b[F]===p?!1:b[F]===
d?!0:a.Ma(b[F],d)};a.C=function(b){return a.Ma(b,a.p)};a.Ra=function(b){return"function"==typeof b&&b[F]===a.p||"function"==typeof b&&b[F]===a.j&&b.hc?!0:!1};a.b("observable",a.p);a.b("isObservable",a.C);a.b("isWriteableObservable",a.Ra);a.b("isWritableObservable",a.Ra);a.aa=function(b){b=b||[];if("object"!=typeof b||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");b=a.p(b);a.a.Aa(b,a.aa.fn);return b.extend({trackArrayChanges:!0})};
a.aa.fn={remove:function(b){for(var d=this.v(),c=[],e="function"!=typeof b||a.C(b)?function(a){return a===b}:b,g=0;g<d.length;g++){var h=d[g];e(h)&&(0===c.length&&this.X(),c.push(h),d.splice(g,1),g--)}c.length&&this.W();return c},removeAll:function(b){if(b===p){var d=this.v(),c=d.slice(0);this.X();d.splice(0,d.length);this.W();return c}return b?this.remove(function(c){return 0<=a.a.m(b,c)}):[]},destroy:function(b){var d=this.v(),c="function"!=typeof b||a.C(b)?function(a){return a===b}:b;this.X();
for(var e=d.length-1;0<=e;e--)c(d[e])&&(d[e]._destroy=!0);this.W()},destroyAll:function(b){return b===p?this.destroy(function(){return!0}):b?this.destroy(function(d){return 0<=a.a.m(b,d)}):[]},indexOf:function(b){var d=this();return a.a.m(d,b)},replace:function(a,d){var c=this.indexOf(a);0<=c&&(this.X(),this.v()[c]=d,this.W())}};a.a.u("pop push reverse shift sort splice unshift".split(" "),function(b){a.aa.fn[b]=function(){var a=this.v();this.X();this.sb(a,b,arguments);a=a[b].apply(a,arguments);this.W();
return a}});a.a.u(["slice"],function(b){a.aa.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.a.xa&&a.a.za(a.aa.fn,a.p.fn);a.b("observableArray",a.aa);var J="arrayChange";a.La.trackArrayChanges=function(b){function d(){if(!c){c=!0;var d=b.notifySubscribers;b.notifySubscribers=function(a,b){b&&b!==G||++g;return d.apply(this,arguments)};var f=[].concat(b.v()||[]);e=null;b.U(function(c){c=[].concat(c||[]);if(b.Ab(J)){var d;if(!e||1<g)e=a.a.Fa(f,c,{sparse:!0});d=e;d.length&&b.notifySubscribers(d,
J)}f=c;e=null;g=0})}}if(!b.sb){var c=!1,e=null,g=0,h=b.U;b.U=b.subscribe=function(a,b,c){c===J&&d();return h.apply(this,arguments)};b.sb=function(b,d,m){function l(a,b,c){return q[q.length]={status:a,value:b,index:c}}if(c&&!g){var q=[],h=b.length,t=m.length,z=0;switch(d){case "push":z=h;case "unshift":for(d=0;d<t;d++)l("added",m[d],z+d);break;case "pop":z=h-1;case "shift":h&&l("deleted",b[z],z);break;case "splice":d=Math.min(Math.max(0,0>m[0]?h+m[0]:m[0]),h);for(var h=1===t?h:Math.min(d+(m[1]||0),
h),t=d+t-2,z=Math.max(h,t),u=[],r=[],E=2;d<z;++d,++E)d<h&&r.push(l("deleted",b[d],d)),d<t&&u.push(l("added",m[E],d));a.a.wb(r,u);break;default:return}e=q}}}};a.s=a.j=function(b,d,c){function e(){a.a.G(v,function(a,b){b.K()});v={}}function g(){e();C=0;u=!0;n=!1}function h(){var a=f.throttleEvaluation;a&&0<=a?(clearTimeout(P),P=setTimeout(k,a)):f.ib?f.ib():k()}function k(b){if(t){if(E)throw Error("A 'pure' computed must not be called recursively");}else if(!u){if(w&&w()){if(!z){s();return}}else z=!1;
t=!0;if(y)try{var c={};a.k.Ea({wa:function(a,b){c[b]||(c[b]=1,++C)},s:f,ma:p});C=0;q=r.call(d)}finally{a.k.end(),t=!1}else try{var e=v,m=C;a.k.Ea({wa:function(a,b){u||(m&&e[b]?(v[b]=e[b],++C,delete e[b],--m):v[b]||(v[b]=a.U(h),++C))},s:f,ma:E?p:!C});v={};C=0;try{var l=d?r.call(d):r()}finally{a.k.end(),m&&a.a.G(e,function(a,b){b.K()}),n=!1}f.Pa(q,l)&&(f.notifySubscribers(q,"beforeChange"),q=l,!0!==b&&f.notifySubscribers(q))}finally{t=!1}C||s()}}function f(){if(0<arguments.length){if("function"===typeof O)O.apply(d,
arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}a.k.Jb(f);n&&k(!0);return q}function m(){n&&!C&&k(!0);return q}function l(){return n||0<C}var q,n=!0,t=!1,z=!1,u=!1,r=b,E=!1,y=!1;r&&"object"==typeof r?(c=r,r=c.read):(c=c||{},r||(r=c.read));if("function"!=typeof r)throw Error("Pass a function that returns the value of the ko.computed");var O=c.write,x=c.disposeWhenNodeIsRemoved||
c.o||null,B=c.disposeWhen||c.Ia,w=B,s=g,v={},C=0,P=null;d||(d=c.owner);a.P.call(f);a.a.Aa(f,a.j.fn);f.v=m;f.la=function(){return C};f.hc="function"===typeof c.write;f.K=function(){s()};f.Z=l;var A=f.Ta;f.Ta=function(a){A.call(f,a);f.ib=function(){f.kb(q);n=!0;f.lb(f)}};c.pure?(y=E=!0,f.va=function(){y&&(y=!1,k(!0))},f.nb=function(){f.yb()||(e(),y=n=!0)}):c.deferEvaluation&&(f.va=function(){m();delete f.va});a.A(f,"peek",f.v);a.A(f,"dispose",f.K);a.A(f,"isActive",f.Z);a.A(f,"getDependenciesCount",
f.la);x&&(z=!0,x.nodeType&&(w=function(){return!a.a.Ja(x)||B&&B()}));y||c.deferEvaluation||k();x&&l()&&x.nodeType&&(s=function(){a.a.w.Kb(x,s);g()},a.a.w.da(x,s));return f};a.jc=function(b){return a.Ma(b,a.j)};A=a.p.rc;a.j[A]=a.p;a.j.fn={equalityComparer:H};a.j.fn[A]=a.j;a.a.xa&&a.a.za(a.j.fn,a.P.fn);a.b("dependentObservable",a.j);a.b("computed",a.j);a.b("isComputed",a.jc);a.Ib=function(b,d){if("function"===typeof b)return a.s(b,d,{pure:!0});b=a.a.extend({},b);b.pure=!0;return a.s(b,d)};a.b("pureComputed",
a.Ib);(function(){function b(a,g,h){h=h||new c;a=g(a);if("object"!=typeof a||null===a||a===p||a instanceof Date||a instanceof String||a instanceof Number||a instanceof Boolean)return a;var k=a instanceof Array?[]:{};h.save(a,k);d(a,function(c){var d=g(a[c]);switch(typeof d){case "boolean":case "number":case "string":case "function":k[c]=d;break;case "object":case "undefined":var l=h.get(d);k[c]=l!==p?l:b(d,g,h)}});return k}function d(a,b){if(a instanceof Array){for(var c=0;c<a.length;c++)b(c);"function"==
typeof a.toJSON&&b("toJSON")}else for(c in a)b(c)}function c(){this.keys=[];this.hb=[]}a.Qb=function(c){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(c,function(b){for(var c=0;a.C(b)&&10>c;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.Qb(b);return a.a.eb(b,c,d)};c.prototype={save:function(b,c){var d=a.a.m(this.keys,b);0<=d?this.hb[d]=c:(this.keys.push(b),this.hb.push(c))},get:function(b){b=a.a.m(this.keys,b);return 0<=b?this.hb[b]:p}}})();
a.b("toJS",a.Qb);a.b("toJSON",a.toJSON);(function(){a.i={q:function(b){switch(a.a.t(b)){case "option":return!0===b.__ko__hasDomDataOptionValue__?a.a.e.get(b,a.d.options.Va):7>=a.a.L?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case "select":return 0<=b.selectedIndex?a.i.q(b.options[b.selectedIndex]):p;default:return b.value}},ca:function(b,d,c){switch(a.a.t(b)){case "option":switch(typeof d){case "string":a.a.e.set(b,a.d.options.Va,p);"__ko__hasDomDataOptionValue__"in
b&&delete b.__ko__hasDomDataOptionValue__;b.value=d;break;default:a.a.e.set(b,a.d.options.Va,d),b.__ko__hasDomDataOptionValue__=!0,b.value="number"===typeof d?d:""}break;case "select":if(""===d||null===d)d=p;for(var e=-1,g=0,h=b.options.length,k;g<h;++g)if(k=a.i.q(b.options[g]),k==d||""==k&&d===p){e=g;break}if(c||0<=e||d===p&&1<b.size)b.selectedIndex=e;break;default:if(null===d||d===p)d="";b.value=d}}}})();a.b("selectExtensions",a.i);a.b("selectExtensions.readValue",a.i.q);a.b("selectExtensions.writeValue",
a.i.ca);a.h=function(){function b(b){b=a.a.cb(b);123===b.charCodeAt(0)&&(b=b.slice(1,-1));var c=[],d=b.match(e),k,n,t=0;if(d){d.push(",");for(var z=0,u;u=d[z];++z){var r=u.charCodeAt(0);if(44===r){if(0>=t){k&&c.push(n?{key:k,value:n.join("")}:{unknown:k});k=n=t=0;continue}}else if(58===r){if(!n)continue}else if(47===r&&z&&1<u.length)(r=d[z-1].match(g))&&!h[r[0]]&&(b=b.substr(b.indexOf(u)+1),d=b.match(e),d.push(","),z=-1,u="/");else if(40===r||123===r||91===r)++t;else if(41===r||125===r||93===r)--t;
else if(!k&&!n){k=34===r||39===r?u.slice(1,-1):u;continue}n?n.push(u):n=[u]}}return c}var d=["true","false","null","undefined"],c=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,e=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),g=/[\])"'A-Za-z0-9_$]+$/,h={"in":1,"return":1,"typeof":1},k={};return{ha:[],V:k,Wa:b,ya:function(f,m){function e(b,m){var f;if(!z){var u=a.getBindingHandler(b);if(u&&u.preprocess&&
!(m=u.preprocess(m,b,e)))return;if(u=k[b])f=m,0<=a.a.m(d,f)?f=!1:(u=f.match(c),f=null===u?!1:u[1]?"Object("+u[1]+")"+u[2]:f),u=f;u&&h.push("'"+b+"':function(_z){"+f+"=_z}")}t&&(m="function(){return "+m+" }");g.push("'"+b+"':"+m)}m=m||{};var g=[],h=[],t=m.valueAccessors,z=m.bindingParams,u="string"===typeof f?b(f):f;a.a.u(u,function(a){e(a.key||a.unknown,a.value)});h.length&&e("_ko_property_writers","{"+h.join(",")+" }");return g.join(",")},lc:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==
b)return!0;return!1},pa:function(b,c,d,e,k){if(b&&a.C(b))!a.Ra(b)||k&&b.v()===e||b(e);else if((b=c.get("_ko_property_writers"))&&b[d])b[d](e)}}}();a.b("expressionRewriting",a.h);a.b("expressionRewriting.bindingRewriteValidators",a.h.ha);a.b("expressionRewriting.parseObjectLiteral",a.h.Wa);a.b("expressionRewriting.preProcessBindings",a.h.ya);a.b("expressionRewriting._twoWayBindings",a.h.V);a.b("jsonExpressionRewriting",a.h);a.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",a.h.ya);(function(){function b(a){return 8==
a.nodeType&&h.test(g?a.text:a.nodeValue)}function d(a){return 8==a.nodeType&&k.test(g?a.text:a.nodeValue)}function c(a,c){for(var f=a,e=1,k=[];f=f.nextSibling;){if(d(f)&&(e--,0===e))return k;k.push(f);b(f)&&e++}if(!c)throw Error("Cannot find closing comment tag to match: "+a.nodeValue);return null}function e(a,b){var d=c(a,b);return d?0<d.length?d[d.length-1].nextSibling:a.nextSibling:null}var g=v&&"\x3c!--test--\x3e"===v.createComment("test").text,h=g?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,
k=g?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,f={ul:!0,ol:!0};a.f={Q:{},childNodes:function(a){return b(a)?c(a):a.childNodes},ja:function(c){if(b(c)){c=a.f.childNodes(c);for(var d=0,f=c.length;d<f;d++)a.removeNode(c[d])}else a.a.Ka(c)},T:function(c,d){if(b(c)){a.f.ja(c);for(var f=c.nextSibling,e=0,k=d.length;e<k;e++)f.parentNode.insertBefore(d[e],f)}else a.a.T(c,d)},Hb:function(a,c){b(a)?a.parentNode.insertBefore(c,a.nextSibling):a.firstChild?a.insertBefore(c,a.firstChild):a.appendChild(c)},Bb:function(c,
d,f){f?b(c)?c.parentNode.insertBefore(d,f.nextSibling):f.nextSibling?c.insertBefore(d,f.nextSibling):c.appendChild(d):a.f.Hb(c,d)},firstChild:function(a){return b(a)?!a.nextSibling||d(a.nextSibling)?null:a.nextSibling:a.firstChild},nextSibling:function(a){b(a)&&(a=e(a));return a.nextSibling&&d(a.nextSibling)?null:a.nextSibling},gc:b,xc:function(a){return(a=(g?a.text:a.nodeValue).match(h))?a[1]:null},Fb:function(c){if(f[a.a.t(c)]){var k=c.firstChild;if(k){do if(1===k.nodeType){var g;g=k.firstChild;
var h=null;if(g){do if(h)h.push(g);else if(b(g)){var t=e(g,!0);t?g=t:h=[g]}else d(g)&&(h=[g]);while(g=g.nextSibling)}if(g=h)for(h=k.nextSibling,t=0;t<g.length;t++)h?c.insertBefore(g[t],h):c.appendChild(g[t])}while(k=k.nextSibling)}}}}})();a.b("virtualElements",a.f);a.b("virtualElements.allowedBindings",a.f.Q);a.b("virtualElements.emptyNode",a.f.ja);a.b("virtualElements.insertAfter",a.f.Bb);a.b("virtualElements.prepend",a.f.Hb);a.b("virtualElements.setDomNodeChildren",a.f.T);(function(){a.J=function(){this.Yb=
{}};a.a.extend(a.J.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=b.getAttribute("data-bind")||a.g.getComponentNameForNode(b);case 8:return a.f.gc(b);default:return!1}},getBindings:function(b,d){var c=this.getBindingsString(b,d),c=c?this.parseBindingsString(c,d,b):null;return a.g.mb(c,b,d,!1)},getBindingAccessors:function(b,d){var c=this.getBindingsString(b,d),c=c?this.parseBindingsString(c,d,b,{valueAccessors:!0}):null;return a.g.mb(c,b,d,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");
case 8:return a.f.xc(b);default:return null}},parseBindingsString:function(b,d,c,e){try{var g=this.Yb,h=b+(e&&e.valueAccessors||""),k;if(!(k=g[h])){var f,m="with($context){with($data||{}){return{"+a.h.ya(b,e)+"}}}";f=new Function("$context","$element",m);k=g[h]=f}return k(d,c)}catch(l){throw l.message="Unable to parse bindings.\nBindings value: "+b+"\nMessage: "+l.message,l;}}});a.J.instance=new a.J})();a.b("bindingProvider",a.J);(function(){function b(a){return function(){return a}}function d(a){return a()}
function c(b){return a.a.na(a.k.B(b),function(a,c){return function(){return b()[c]}})}function e(a,b){return c(this.getBindings.bind(this,a,b))}function g(b,c,d){var f,e=a.f.firstChild(c),k=a.J.instance,g=k.preprocessNode;if(g){for(;f=e;)e=a.f.nextSibling(f),g.call(k,f);e=a.f.firstChild(c)}for(;f=e;)e=a.f.nextSibling(f),h(b,f,d)}function h(b,c,d){var e=!0,k=1===c.nodeType;k&&a.f.Fb(c);if(k&&d||a.J.instance.nodeHasBindings(c))e=f(c,null,b,d).shouldBindDescendants;e&&!l[a.a.t(c)]&&g(b,c,!k)}function k(b){var c=
[],d={},f=[];a.a.G(b,function y(e){if(!d[e]){var k=a.getBindingHandler(e);k&&(k.after&&(f.push(e),a.a.u(k.after,function(c){if(b[c]){if(-1!==a.a.m(f,c))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+f.join(", "));y(c)}}),f.length--),c.push({key:e,zb:k}));d[e]=!0}});return c}function f(b,c,f,g){var m=a.a.e.get(b,q);if(!c){if(m)throw Error("You cannot apply bindings multiple times to the same element.");a.a.e.set(b,q,!0)}!m&&g&&a.Ob(b,f);var l;if(c&&"function"!==
typeof c)l=c;else{var h=a.J.instance,n=h.getBindingAccessors||e,s=a.j(function(){(l=c?c(f,b):n.call(h,b,f))&&f.I&&f.I();return l},null,{o:b});l&&s.Z()||(s=null)}var v;if(l){var w=s?function(a){return function(){return d(s()[a])}}:function(a){return l[a]},A=function(){return a.a.na(s?s():l,d)};A.get=function(a){return l[a]&&d(w(a))};A.has=function(a){return a in l};g=k(l);a.a.u(g,function(c){var d=c.zb.init,e=c.zb.update,k=c.key;if(8===b.nodeType&&!a.f.Q[k])throw Error("The binding '"+k+"' cannot be used with virtual elements");
try{"function"==typeof d&&a.k.B(function(){var a=d(b,w(k),A,f.$data,f);if(a&&a.controlsDescendantBindings){if(v!==p)throw Error("Multiple bindings ("+v+" and "+k+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");v=k}}),"function"==typeof e&&a.j(function(){e(b,w(k),A,f.$data,f)},null,{o:b})}catch(g){throw g.message='Unable to process binding "'+k+": "+l[k]+'"\nMessage: '+g.message,g;}})}return{shouldBindDescendants:v===p}}
function m(b){return b&&b instanceof a.N?b:new a.N(b)}a.d={};var l={script:!0};a.getBindingHandler=function(b){return a.d[b]};a.N=function(b,c,d,f){var e=this,k="function"==typeof b&&!a.C(b),g,m=a.j(function(){var g=k?b():b,l=a.a.c(g);c?(c.I&&c.I(),a.a.extend(e,c),m&&(e.I=m)):(e.$parents=[],e.$root=l,e.ko=a);e.$rawData=g;e.$data=l;d&&(e[d]=l);f&&f(e,c,l);return e.$data},null,{Ia:function(){return g&&!a.a.ob(g)},o:!0});m.Z()&&(e.I=m,m.equalityComparer=null,g=[],m.Tb=function(b){g.push(b);a.a.w.da(b,
function(b){a.a.ua(g,b);g.length||(m.K(),e.I=m=p)})})};a.N.prototype.createChildContext=function(b,c,d){return new a.N(b,this,c,function(a,b){a.$parentContext=b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)})};a.N.prototype.extend=function(b){return new a.N(this.I||this.$data,this,null,function(c,d){c.$rawData=d.$rawData;a.a.extend(c,"function"==typeof b?b():b)})};var q=a.a.e.F(),n=a.a.e.F();a.Ob=function(b,c){if(2==arguments.length)a.a.e.set(b,n,c),
c.I&&c.I.Tb(b);else return a.a.e.get(b,n)};a.ra=function(b,c,d){1===b.nodeType&&a.f.Fb(b);return f(b,c,m(d),!0)};a.Wb=function(d,f,e){e=m(e);return a.ra(d,"function"===typeof f?c(f.bind(null,e,d)):a.a.na(f,b),e)};a.Ca=function(a,b){1!==b.nodeType&&8!==b.nodeType||g(m(a),b,!0)};a.pb=function(a,b){!w&&s.jQuery&&(w=s.jQuery);if(b&&1!==b.nodeType&&8!==b.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");b=b||s.document.body;h(m(a),
b,!0)};a.Ha=function(b){switch(b.nodeType){case 1:case 8:var c=a.Ob(b);if(c)return c;if(b.parentNode)return a.Ha(b.parentNode)}return p};a.$b=function(b){return(b=a.Ha(b))?b.$data:p};a.b("bindingHandlers",a.d);a.b("applyBindings",a.pb);a.b("applyBindingsToDescendants",a.Ca);a.b("applyBindingAccessorsToNode",a.ra);a.b("applyBindingsToNode",a.Wb);a.b("contextFor",a.Ha);a.b("dataFor",a.$b)})();(function(b){function d(d,f){var e=g.hasOwnProperty(d)?g[d]:b,l;e||(e=g[d]=new a.P,c(d,function(a){h[d]=a;delete g[d];
l?e.notifySubscribers(a):setTimeout(function(){e.notifySubscribers(a)},0)}),l=!0);e.U(f)}function c(a,b){e("getConfig",[a],function(c){c?e("loadComponent",[a,c],function(a){b(a)}):b(null)})}function e(c,d,g,l){l||(l=a.g.loaders.slice(0));var h=l.shift();if(h){var n=h[c];if(n){var t=!1;if(n.apply(h,d.concat(function(a){t?g(null):null!==a?g(a):e(c,d,g,l)}))!==b&&(t=!0,!h.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.");
}else e(c,d,g,l)}else g(null)}var g={},h={};a.g={get:function(a,c){var e=h.hasOwnProperty(a)?h[a]:b;e?setTimeout(function(){c(e)},0):d(a,c)},tb:function(a){delete h[a]},jb:e};a.g.loaders=[];a.b("components",a.g);a.b("components.get",a.g.get);a.b("components.clearCachedDefinition",a.g.tb)})();(function(){function b(b,c,d,e){function k(){0===--u&&e(h)}var h={},u=2,r=d.template;d=d.viewModel;r?g(c,r,function(c){a.g.jb("loadTemplate",[b,c],function(a){h.template=a;k()})}):k();d?g(c,d,function(c){a.g.jb("loadViewModel",
[b,c],function(a){h[f]=a;k()})}):k()}function d(a,b,c){if("function"===typeof b)c(function(a){return new b(a)});else if("function"===typeof b[f])c(b[f]);else if("instance"in b){var e=b.instance;c(function(){return e})}else"viewModel"in b?d(a,b.viewModel,c):a("Unknown viewModel value: "+b)}function c(b){switch(a.a.t(b)){case "script":return a.a.ba(b.text);case "textarea":return a.a.ba(b.value);case "template":if(e(b.content))return a.a.ia(b.content.childNodes)}return a.a.ia(b.childNodes)}function e(a){return s.DocumentFragment?
a instanceof DocumentFragment:a&&11===a.nodeType}function g(a,b,c){"string"===typeof b.require?N||s.require?(N||s.require)([b.require],c):a("Uses require, but no AMD loader is present"):c(b)}function h(a){return function(b){throw Error("Component '"+a+"': "+b);}}var k={};a.g.tc=function(b,c){if(!c)throw Error("Invalid configuration for "+b);if(a.g.Qa(b))throw Error("Component "+b+" is already registered");k[b]=c};a.g.Qa=function(a){return a in k};a.g.wc=function(b){delete k[b];a.g.tb(b)};a.g.ub={getConfig:function(a,
b){b(k.hasOwnProperty(a)?k[a]:null)},loadComponent:function(a,c,d){var e=h(a);g(e,c,function(c){b(a,e,c,d)})},loadTemplate:function(b,d,f){b=h(b);if("string"===typeof d)f(a.a.ba(d));else if(d instanceof Array)f(d);else if(e(d))f(a.a.S(d.childNodes));else if(d.element)if(d=d.element,s.HTMLElement?d instanceof HTMLElement:d&&d.tagName&&1===d.nodeType)f(c(d));else if("string"===typeof d){var k=v.getElementById(d);k?f(c(k)):b("Cannot find element with ID "+d)}else b("Unknown element type: "+d);else b("Unknown template value: "+
d)},loadViewModel:function(a,b,c){d(h(a),b,c)}};var f="createViewModel";a.b("components.register",a.g.tc);a.b("components.isRegistered",a.g.Qa);a.b("components.unregister",a.g.wc);a.b("components.defaultLoader",a.g.ub);a.g.loaders.push(a.g.ub);a.g.Ub=k})();(function(){function b(b,e){var g=b.getAttribute("params");if(g){var g=d.parseBindingsString(g,e,b,{valueAccessors:!0,bindingParams:!0}),g=a.a.na(g,function(d){return a.s(d,null,{o:b})}),h=a.a.na(g,function(d){return d.Z()?a.s(function(){return a.a.c(d())},
null,{o:b}):d.v()});h.hasOwnProperty("$raw")||(h.$raw=g);return h}return{$raw:{}}}a.g.getComponentNameForNode=function(b){b=a.a.t(b);return a.g.Qa(b)&&b};a.g.mb=function(c,d,g,h){if(1===d.nodeType){var k=a.g.getComponentNameForNode(d);if(k){c=c||{};if(c.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var f={name:k,params:b(d,g)};c.component=h?function(){return f}:f}}return c};var d=new a.J;9>a.a.L&&(a.g.register=function(a){return function(b){v.createElement(b);
return a.apply(this,arguments)}}(a.g.register),v.createDocumentFragment=function(b){return function(){var d=b(),g=a.g.Ub,h;for(h in g)g.hasOwnProperty(h)&&d.createElement(h);return d}}(v.createDocumentFragment))})();(function(){var b=0;a.d.component={init:function(d,c,e,g,h){function k(){var a=f&&f.dispose;"function"===typeof a&&a.call(f);m=null}var f,m;a.a.w.da(d,k);a.s(function(){var e=a.a.c(c()),g,n;"string"===typeof e?g=e:(g=a.a.c(e.name),n=a.a.c(e.params));if(!g)throw Error("No component name specified");
var t=m=++b;a.g.get(g,function(b){if(m===t){k();if(!b)throw Error("Unknown component '"+g+"'");var c=b.template;if(!c)throw Error("Component '"+g+"' has no template");c=a.a.ia(c);a.f.T(d,c);var c=n,e=b.createViewModel;b=e?e.call(b,c,{element:d}):c;c=h.createChildContext(b);f=b;a.Ca(c,d)}})},null,{o:d});return{controlsDescendantBindings:!0}}};a.f.Q.component=!0})();var Q={"class":"className","for":"htmlFor"};a.d.attr={update:function(b,d){var c=a.a.c(d())||{};a.a.G(c,function(c,d){d=a.a.c(d);var h=
!1===d||null===d||d===p;h&&b.removeAttribute(c);8>=a.a.L&&c in Q?(c=Q[c],h?b.removeAttribute(c):b[c]=d):h||b.setAttribute(c,d.toString());"name"===c&&a.a.Mb(b,h?"":d.toString())})}};(function(){a.d.checked={after:["value","attr"],init:function(b,d,c){function e(){var e=b.checked,k=q?h():e;if(!a.Y.ma()&&(!f||e)){var g=a.k.B(d);m?l!==k?(e&&(a.a.ea(g,k,!0),a.a.ea(g,l,!1)),l=k):a.a.ea(g,k,e):a.h.pa(g,c,"checked",k,!0)}}function g(){var c=a.a.c(d());b.checked=m?0<=a.a.m(c,h()):k?c:h()===c}var h=a.Ib(function(){return c.has("checkedValue")?
a.a.c(c.get("checkedValue")):c.has("value")?a.a.c(c.get("value")):b.value}),k="checkbox"==b.type,f="radio"==b.type;if(k||f){var m=k&&a.a.c(d())instanceof Array,l=m?h():p,q=f||m;f&&!b.name&&a.d.uniqueName.init(b,function(){return!0});a.s(e,null,{o:b});a.a.n(b,"click",e);a.s(g,null,{o:b})}}};a.h.V.checked=!0;a.d.checkedValue={update:function(b,d){b.value=a.a.c(d())}}})();a.d.css={update:function(b,d){var c=a.a.c(d());"object"==typeof c?a.a.G(c,function(c,d){d=a.a.c(d);a.a.Ba(b,c,d)}):(c=String(c||""),
a.a.Ba(b,b.__ko__cssValue,!1),b.__ko__cssValue=c,a.a.Ba(b,c,!0))}};a.d.enable={update:function(b,d){var c=a.a.c(d());c&&b.disabled?b.removeAttribute("disabled"):c||b.disabled||(b.disabled=!0)}};a.d.disable={update:function(b,d){a.d.enable.update(b,function(){return!a.a.c(d())})}};a.d.event={init:function(b,d,c,e,g){var h=d()||{};a.a.G(h,function(k){"string"==typeof k&&a.a.n(b,k,function(b){var h,l=d()[k];if(l){try{var q=a.a.S(arguments);e=g.$data;q.unshift(e);h=l.apply(e,q)}finally{!0!==h&&(b.preventDefault?
b.preventDefault():b.returnValue=!1)}!1===c.get(k+"Bubble")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.d.foreach={Eb:function(b){return function(){var d=b(),c=a.a.Xa(d);if(!c||"number"==typeof c.length)return{foreach:d,templateEngine:a.O.Oa};a.a.c(d);return{foreach:c.data,as:c.as,includeDestroyed:c.includeDestroyed,afterAdd:c.afterAdd,beforeRemove:c.beforeRemove,afterRender:c.afterRender,beforeMove:c.beforeMove,afterMove:c.afterMove,templateEngine:a.O.Oa}}},init:function(b,
d){return a.d.template.init(b,a.d.foreach.Eb(d))},update:function(b,d,c,e,g){return a.d.template.update(b,a.d.foreach.Eb(d),c,e,g)}};a.h.ha.foreach=!1;a.f.Q.foreach=!0;a.d.hasfocus={init:function(b,d,c){function e(e){b.__ko_hasfocusUpdating=!0;var f=b.ownerDocument;if("activeElement"in f){var g;try{g=f.activeElement}catch(h){g=f.body}e=g===b}f=d();a.h.pa(f,c,"hasfocus",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var g=e.bind(null,!0),h=e.bind(null,!1);a.a.n(b,"focus",g);a.a.n(b,"focusin",
g);a.a.n(b,"blur",h);a.a.n(b,"focusout",h)},update:function(b,d){var c=!!a.a.c(d());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===c||(c?b.focus():b.blur(),a.k.B(a.a.oa,null,[b,c?"focusin":"focusout"]))}};a.h.V.hasfocus=!0;a.d.hasFocus=a.d.hasfocus;a.h.V.hasFocus=!0;a.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,d){a.a.$a(b,d())}};I("if");I("ifnot",!1,!0);I("with",!0,!1,function(a,d){return a.createChildContext(d)});var K={};a.d.options={init:function(b){if("select"!==
a.a.t(b))throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,d,c){function e(){return a.a.ta(b.options,function(a){return a.selected})}function g(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c}function h(c,d){if(q.length){var e=0<=a.a.m(q,a.i.q(d[0]));a.a.Nb(d[0],e);n&&!e&&a.k.B(a.a.oa,null,[b,"change"])}}var k=0!=b.length&&b.multiple?b.scrollTop:null,f=a.a.c(d()),m=c.get("optionsIncludeDestroyed");
d={};var l,q;q=b.multiple?a.a.Da(e(),a.i.q):0<=b.selectedIndex?[a.i.q(b.options[b.selectedIndex])]:[];f&&("undefined"==typeof f.length&&(f=[f]),l=a.a.ta(f,function(b){return m||b===p||null===b||!a.a.c(b._destroy)}),c.has("optionsCaption")&&(f=a.a.c(c.get("optionsCaption")),null!==f&&f!==p&&l.unshift(K)));var n=!1;d.beforeRemove=function(a){b.removeChild(a)};f=h;c.has("optionsAfterRender")&&(f=function(b,d){h(0,d);a.k.B(c.get("optionsAfterRender"),null,[d[0],b!==K?b:p])});a.a.Za(b,l,function(d,e,f){f.length&&
(q=f[0].selected?[a.i.q(f[0])]:[],n=!0);e=b.ownerDocument.createElement("option");d===K?(a.a.bb(e,c.get("optionsCaption")),a.i.ca(e,p)):(f=g(d,c.get("optionsValue"),d),a.i.ca(e,a.a.c(f)),d=g(d,c.get("optionsText"),f),a.a.bb(e,d));return[e]},d,f);a.k.B(function(){c.get("valueAllowUnset")&&c.has("value")?a.i.ca(b,a.a.c(c.get("value")),!0):(b.multiple?q.length&&e().length<q.length:q.length&&0<=b.selectedIndex?a.i.q(b.options[b.selectedIndex])!==q[0]:q.length||0<=b.selectedIndex)&&a.a.oa(b,"change")});
a.a.dc(b);k&&20<Math.abs(k-b.scrollTop)&&(b.scrollTop=k)}};a.d.options.Va=a.a.e.F();a.d.selectedOptions={after:["options","foreach"],init:function(b,d,c){a.a.n(b,"change",function(){var e=d(),g=[];a.a.u(b.getElementsByTagName("option"),function(b){b.selected&&g.push(a.i.q(b))});a.h.pa(e,c,"selectedOptions",g)})},update:function(b,d){if("select"!=a.a.t(b))throw Error("values binding applies only to SELECT elements");var c=a.a.c(d());c&&"number"==typeof c.length&&a.a.u(b.getElementsByTagName("option"),
function(b){var d=0<=a.a.m(c,a.i.q(b));a.a.Nb(b,d)})}};a.h.V.selectedOptions=!0;a.d.style={update:function(b,d){var c=a.a.c(d()||{});a.a.G(c,function(c,d){d=a.a.c(d);if(null===d||d===p||!1===d)d="";b.style[c]=d})}};a.d.submit={init:function(b,d,c,e,g){if("function"!=typeof d())throw Error("The value for a submit binding must be a function");a.a.n(b,"submit",function(a){var c,e=d();try{c=e.call(g.$data,b)}finally{!0!==c&&(a.preventDefault?a.preventDefault():a.returnValue=!1)}})}};a.d.text={init:function(){return{controlsDescendantBindings:!0}},
update:function(b,d){a.a.bb(b,d())}};a.f.Q.text=!0;(function(){if(s&&s.navigator)var b=function(a){if(a)return parseFloat(a[1])},d=s.opera&&s.opera.version&&parseInt(s.opera.version()),c=s.navigator.userAgent,e=b(c.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),g=b(c.match(/Firefox\/([^ ]*)/));if(10>a.a.L)var h=a.a.e.F(),k=a.a.e.F(),f=function(b){var c=this.activeElement;(c=c&&a.a.e.get(c,k))&&c(b)},m=function(b,c){var d=b.ownerDocument;a.a.e.get(d,h)||(a.a.e.set(d,h,!0),a.a.n(d,"selectionchange",
f));a.a.e.set(b,k,c)};a.d.textInput={init:function(b,c,f){function k(c,d){a.a.n(b,c,d)}function h(){var d=a.a.c(c());if(null===d||d===p)d="";v!==p&&d===v?setTimeout(h,4):b.value!==d&&(s=d,b.value=d)}function u(){y||(v=b.value,y=setTimeout(r,4))}function r(){clearTimeout(y);v=y=p;var d=b.value;s!==d&&(s=d,a.h.pa(c(),f,"textInput",d))}var s=b.value,y,v;10>a.a.L?(k("propertychange",function(a){"value"===a.propertyName&&r()}),8==a.a.L&&(k("keyup",r),k("keydown",r)),8<=a.a.L&&(m(b,r),k("dragend",u))):
(k("input",r),5>e&&"textarea"===a.a.t(b)?(k("keydown",u),k("paste",u),k("cut",u)):11>d?k("keydown",u):4>g&&(k("DOMAutoComplete",r),k("dragdrop",r),k("drop",r)));k("change",r);a.s(h,null,{o:b})}};a.h.V.textInput=!0;a.d.textinput={preprocess:function(a,b,c){c("textInput",a)}}})();a.d.uniqueName={init:function(b,d){if(d()){var c="ko_unique_"+ ++a.d.uniqueName.Zb;a.a.Mb(b,c)}}};a.d.uniqueName.Zb=0;a.d.value={after:["options","foreach"],init:function(b,d,c){if("input"!=b.tagName.toLowerCase()||"checkbox"!=
b.type&&"radio"!=b.type){var e=["change"],g=c.get("valueUpdate"),h=!1,k=null;g&&("string"==typeof g&&(g=[g]),a.a.ga(e,g),e=a.a.rb(e));var f=function(){k=null;h=!1;var e=d(),f=a.i.q(b);a.h.pa(e,c,"value",f)};!a.a.L||"input"!=b.tagName.toLowerCase()||"text"!=b.type||"off"==b.autocomplete||b.form&&"off"==b.form.autocomplete||-1!=a.a.m(e,"propertychange")||(a.a.n(b,"propertychange",function(){h=!0}),a.a.n(b,"focus",function(){h=!1}),a.a.n(b,"blur",function(){h&&f()}));a.a.u(e,function(c){var d=f;a.a.vc(c,
"after")&&(d=function(){k=a.i.q(b);setTimeout(f,0)},c=c.substring(5));a.a.n(b,c,d)});var m=function(){var e=a.a.c(d()),f=a.i.q(b);if(null!==k&&e===k)setTimeout(m,0);else if(e!==f)if("select"===a.a.t(b)){var g=c.get("valueAllowUnset"),f=function(){a.i.ca(b,e,g)};f();g||e===a.i.q(b)?setTimeout(f,0):a.k.B(a.a.oa,null,[b,"change"])}else a.i.ca(b,e)};a.s(m,null,{o:b})}else a.ra(b,{checkedValue:d})},update:function(){}};a.h.V.value=!0;a.d.visible={update:function(b,d){var c=a.a.c(d()),e="none"!=b.style.display;
c&&!e?b.style.display="":!c&&e&&(b.style.display="none")}};(function(b){a.d[b]={init:function(d,c,e,g,h){return a.d.event.init.call(this,d,function(){var a={};a[b]=c();return a},e,g,h)}}})("click");a.H=function(){};a.H.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");};a.H.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};a.H.prototype.makeTemplateSource=function(b,d){if("string"==typeof b){d=d||v;var c=
d.getElementById(b);if(!c)throw Error("Cannot find template with ID "+b);return new a.r.l(c)}if(1==b.nodeType||8==b.nodeType)return new a.r.fa(b);throw Error("Unknown template type: "+b);};a.H.prototype.renderTemplate=function(a,d,c,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,d,c)};a.H.prototype.isTemplateRewritten=function(a,d){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,d).data("isRewritten")};a.H.prototype.rewriteTemplate=function(a,d,c){a=this.makeTemplateSource(a,
c);d=d(a.text());a.text(d);a.data("isRewritten",!0)};a.b("templateEngine",a.H);a.fb=function(){function b(b,c,d,k){b=a.h.Wa(b);for(var f=a.h.ha,m=0;m<b.length;m++){var l=b[m].key;if(f.hasOwnProperty(l)){var q=f[l];if("function"===typeof q){if(l=q(b[m].value))throw Error(l);}else if(!q)throw Error("This template engine does not support the '"+l+"' binding within its templates");}}d="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+a.h.ya(b,{valueAccessors:!0})+" } })()},'"+d.toLowerCase()+
"')";return k.createJavaScriptEvaluatorBlock(d)+c}var d=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,c=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{ec:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.fb.nc(b,c)},d)},nc:function(a,g){return a.replace(d,function(a,c,d,e,l){return b(l,c,d,g)}).replace(c,function(a,c){return b(c,"\x3c!-- ko --\x3e","#comment",g)})},Xb:function(b,c){return a.D.Ua(function(d,
k){var f=d.nextSibling;f&&f.nodeName.toLowerCase()===c&&a.ra(f,b,k)})}}}();a.b("__tr_ambtns",a.fb.Xb);(function(){a.r={};a.r.l=function(a){this.l=a};a.r.l.prototype.text=function(){var b=a.a.t(this.l),b="script"===b?"text":"textarea"===b?"value":"innerHTML";if(0==arguments.length)return this.l[b];var d=arguments[0];"innerHTML"===b?a.a.$a(this.l,d):this.l[b]=d};var b=a.a.e.F()+"_";a.r.l.prototype.data=function(c){if(1===arguments.length)return a.a.e.get(this.l,b+c);a.a.e.set(this.l,b+c,arguments[1])};
var d=a.a.e.F();a.r.fa=function(a){this.l=a};a.r.fa.prototype=new a.r.l;a.r.fa.prototype.text=function(){if(0==arguments.length){var b=a.a.e.get(this.l,d)||{};b.gb===p&&b.Ga&&(b.gb=b.Ga.innerHTML);return b.gb}a.a.e.set(this.l,d,{gb:arguments[0]})};a.r.l.prototype.nodes=function(){if(0==arguments.length)return(a.a.e.get(this.l,d)||{}).Ga;a.a.e.set(this.l,d,{Ga:arguments[0]})};a.b("templateSources",a.r);a.b("templateSources.domElement",a.r.l);a.b("templateSources.anonymousTemplate",a.r.fa)})();(function(){function b(b,
c,d){var e;for(c=a.f.nextSibling(c);b&&(e=b)!==c;)b=a.f.nextSibling(e),d(e,b)}function d(c,d){if(c.length){var e=c[0],g=c[c.length-1],h=e.parentNode,n=a.J.instance,t=n.preprocessNode;if(t){b(e,g,function(a,b){var c=a.previousSibling,d=t.call(n,a);d&&(a===e&&(e=d[0]||b),a===g&&(g=d[d.length-1]||c))});c.length=0;if(!e)return;e===g?c.push(e):(c.push(e,g),a.a.ka(c,h))}b(e,g,function(b){1!==b.nodeType&&8!==b.nodeType||a.pb(d,b)});b(e,g,function(b){1!==b.nodeType&&8!==b.nodeType||a.D.Sb(b,[d])});a.a.ka(c,
h)}}function c(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,h,l,q){q=q||{};var n=b&&c(b),n=n&&n.ownerDocument,t=q.templateEngine||g;a.fb.ec(h,t,n);h=t.renderTemplate(h,l,q,n);if("number"!=typeof h.length||0<h.length&&"number"!=typeof h[0].nodeType)throw Error("Template engine must return an array of DOM nodes");n=!1;switch(e){case "replaceChildren":a.f.T(b,h);n=!0;break;case "replaceNode":a.a.Lb(b,h);n=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+
e);}n&&(d(h,l),q.afterRender&&a.k.B(q.afterRender,null,[h,l.$data]));return h}var g;a.ab=function(b){if(b!=p&&!(b instanceof a.H))throw Error("templateEngine must inherit from ko.templateEngine");g=b};a.Ya=function(b,d,h,l,q){h=h||{};if((h.templateEngine||g)==p)throw Error("Set a template engine before calling renderTemplate");q=q||"replaceChildren";if(l){var n=c(l);return a.j(function(){var g=d&&d instanceof a.N?d:new a.N(a.a.c(d)),p=a.C(b)?b():"function"===typeof b?b(g.$data,g):b,g=e(l,q,p,g,h);
"replaceNode"==q&&(l=g,n=c(l))},null,{Ia:function(){return!n||!a.a.Ja(n)},o:n&&"replaceNode"==q?n.parentNode:n})}return a.D.Ua(function(c){a.Ya(b,d,h,c,"replaceNode")})};a.uc=function(b,c,g,h,q){function n(a,b){d(b,s);g.afterRender&&g.afterRender(b,a)}function t(c,d){s=q.createChildContext(c,g.as,function(a){a.$index=d});var f=a.C(b)?b():"function"===typeof b?b(c,s):b;return e(null,"ignoreTargetNode",f,s,g)}var s;return a.j(function(){var b=a.a.c(c)||[];"undefined"==typeof b.length&&(b=[b]);b=a.a.ta(b,
function(b){return g.includeDestroyed||b===p||null===b||!a.a.c(b._destroy)});a.k.B(a.a.Za,null,[h,b,t,g,n])},null,{o:h})};var h=a.a.e.F();a.d.template={init:function(b,c){var d=a.a.c(c());"string"==typeof d||d.name?a.f.ja(b):(d=a.f.childNodes(b),d=a.a.oc(d),(new a.r.fa(b)).nodes(d));return{controlsDescendantBindings:!0}},update:function(b,c,d,e,g){var n=c(),t;c=a.a.c(n);d=!0;e=null;"string"==typeof c?c={}:(n=c.name,"if"in c&&(d=a.a.c(c["if"])),d&&"ifnot"in c&&(d=!a.a.c(c.ifnot)),t=a.a.c(c.data));
"foreach"in c?e=a.uc(n||b,d&&c.foreach||[],c,b,g):d?(g="data"in c?g.createChildContext(t,c.as):g,e=a.Ya(n||b,g,c,b)):a.f.ja(b);g=e;(t=a.a.e.get(b,h))&&"function"==typeof t.K&&t.K();a.a.e.set(b,h,g&&g.Z()?g:p)}};a.h.ha.template=function(b){b=a.h.Wa(b);return 1==b.length&&b[0].unknown||a.h.lc(b,"name")?null:"This template engine does not support anonymous templates nested within its templates"};a.f.Q.template=!0})();a.b("setTemplateEngine",a.ab);a.b("renderTemplate",a.Ya);a.a.wb=function(a,d,c){if(a.length&&
d.length){var e,g,h,k,f;for(e=g=0;(!c||e<c)&&(k=a[g]);++g){for(h=0;f=d[h];++h)if(k.value===f.value){k.moved=f.index;f.moved=k.index;d.splice(h,1);e=h=0;break}e+=h}}};a.a.Fa=function(){function b(b,c,e,g,h){var k=Math.min,f=Math.max,m=[],l,q=b.length,n,p=c.length,s=p-q||1,u=q+p+1,r,v,w;for(l=0;l<=q;l++)for(v=r,m.push(r=[]),w=k(p,l+s),n=f(0,l-1);n<=w;n++)r[n]=n?l?b[l-1]===c[n-1]?v[n-1]:k(v[n]||u,r[n-1]||u)+1:n+1:l+1;k=[];f=[];s=[];l=q;for(n=p;l||n;)p=m[l][n]-1,n&&p===m[l][n-1]?f.push(k[k.length]={status:e,
value:c[--n],index:n}):l&&p===m[l-1][n]?s.push(k[k.length]={status:g,value:b[--l],index:l}):(--n,--l,h.sparse||k.push({status:"retained",value:c[n]}));a.a.wb(f,s,10*q);return k.reverse()}return function(a,c,e){e="boolean"===typeof e?{dontLimitMoves:e}:e||{};a=a||[];c=c||[];return a.length<=c.length?b(a,c,"added","deleted",e):b(c,a,"deleted","added",e)}}();a.b("utils.compareArrays",a.a.Fa);(function(){function b(b,d,g,h,k){var f=[],m=a.j(function(){var l=d(g,k,a.a.ka(f,b))||[];0<f.length&&(a.a.Lb(f,
l),h&&a.k.B(h,null,[g,l,k]));f.length=0;a.a.ga(f,l)},null,{o:b,Ia:function(){return!a.a.ob(f)}});return{$:f,j:m.Z()?m:p}}var d=a.a.e.F();a.a.Za=function(c,e,g,h,k){function f(b,d){x=q[d];r!==d&&(A[b]=x);x.Na(r++);a.a.ka(x.$,c);s.push(x);w.push(x)}function m(b,c){if(b)for(var d=0,e=c.length;d<e;d++)c[d]&&a.a.u(c[d].$,function(a){b(a,d,c[d].sa)})}e=e||[];h=h||{};var l=a.a.e.get(c,d)===p,q=a.a.e.get(c,d)||[],n=a.a.Da(q,function(a){return a.sa}),t=a.a.Fa(n,e,h.dontLimitMoves),s=[],u=0,r=0,v=[],w=[];e=
[];for(var A=[],n=[],x,B=0,D,F;D=t[B];B++)switch(F=D.moved,D.status){case "deleted":F===p&&(x=q[u],x.j&&x.j.K(),v.push.apply(v,a.a.ka(x.$,c)),h.beforeRemove&&(e[B]=x,w.push(x)));u++;break;case "retained":f(B,u++);break;case "added":F!==p?f(B,F):(x={sa:D.value,Na:a.p(r++)},s.push(x),w.push(x),l||(n[B]=x))}m(h.beforeMove,A);a.a.u(v,h.beforeRemove?a.R:a.removeNode);for(var B=0,l=a.f.firstChild(c),G;x=w[B];B++){x.$||a.a.extend(x,b(c,g,x.sa,k,x.Na));for(u=0;t=x.$[u];l=t.nextSibling,G=t,u++)t!==l&&a.f.Bb(c,
t,G);!x.ic&&k&&(k(x.sa,x.$,x.Na),x.ic=!0)}m(h.beforeRemove,e);m(h.afterMove,A);m(h.afterAdd,n);a.a.e.set(c,d,s)}})();a.b("utils.setDomNodeChildrenFromArrayMapping",a.a.Za);a.O=function(){this.allowTemplateRewriting=!1};a.O.prototype=new a.H;a.O.prototype.renderTemplateSource=function(b){var d=(9>a.a.L?0:b.nodes)?b.nodes():null;if(d)return a.a.S(d.cloneNode(!0).childNodes);b=b.text();return a.a.ba(b)};a.O.Oa=new a.O;a.ab(a.O.Oa);a.b("nativeTemplateEngine",a.O);(function(){a.Sa=function(){var a=this.kc=
function(){if(!w||!w.tmpl)return 0;try{if(0<=w.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,e,g){g=g||{};if(2>a)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var h=b.data("precompiled");h||(h=b.text()||"",h=w.template(null,"{{ko_with $item.koBindingContext}}"+h+"{{/ko_with}}"),b.data("precompiled",h));b=[e.$data];e=w.extend({koBindingContext:e},g.templateOptions);e=w.tmpl(h,
b,e);e.appendTo(v.createElement("div"));w.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){v.write("<script type='text/html' id='"+a+"'>"+b+"\x3c/script>")};0<a&&(w.tmpl.tag.ko_code={open:"__.push($1 || '');"},w.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};a.Sa.prototype=new a.H;var b=new a.Sa;0<b.kc&&a.ab(b);a.b("jqueryTmplTemplateEngine",a.Sa)})()})})();})();
;
(function (i, s, o, g, r, a, m) {
    i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
        (i[r].q = i[r].q || []).push(arguments)
    }, i[r].l = 1 * new Date(); a = s.createElement(o),
    m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

// For Testing use this account 'UA-73515135-1'
// For LIVE use this account 'UA-11307308-4'

if(window.location.href.match("portal.euromonitor.com")) {
    ga('create', 'UA-11307308-4', 'auto');
} else {
    ga('create', 'UA-73515135-1', 'auto');
}

ga('send', 'pageview');


function GAtrackEvent_OnClick(sender) {

    var item = $(sender);
    var label = item.text();

    var category = item.attr("GACategory");
    var action = item.attr("GAAction");
    var labelAttr = item.attr("GALabel");

    if (labelAttr != undefined) {
        label = labelAttr;
    }

    GATrackEvent(category, action, label, "");
}

function GAtrackEvent_OnSelectedIndexChanged(sender, eventArgs) {

    var item = eventArgs.get_item();
    var label = item != null ? item.get_text() : sender.get_text();
    var value = item != null ? item.get_value() : sender.get_value();

    if (value == "" || value == undefined) {
        return;
    }

    var category = sender.get_attributes().getAttribute("GACategory");
    var action = sender.get_attributes().getAttribute("GAAction");
    var labelAttr = sender.get_attributes().getAttribute("GALabel");

    if (labelAttr != undefined) {
        label = labelAttr;
    }

    GATrackEvent(category, action, label, "");
}


function GAtrackEvent_OnTreeViewNodeClicked(sender, eventArgs) {
    var node = eventArgs.get_node();

    var label = node != null ? node.get_text() : '';

    var category = sender.get_attributes().getAttribute("GACategory");
    var action = sender.get_attributes().getAttribute("GAAction");
    var labelAttr = sender.get_attributes().getAttribute("GALabel");

    if (labelAttr != undefined) {
        label = labelAttr;
    }

    GATrackEvent(category, action, label, "");

}

/// category, The name you supply for the group of objects you want to track
/// action, A string that is uniquely paired with each category, and commonly used to define the type of user interaction for the web object
/// label, An optional string to provide additional dimensions to the event data
/// value, An integer that you can use to provide numerical data about the user event
///
/// ga(['send','event', 'Videos', 'Play', 'Gone With the Wind']);
///
function GATrackEvent(category, action, label, value) {

    var eventDetails = "Category='" + category + "'";
    eventDetails += "   Action='" + action + "'";
    eventDetails += "   Label='" + label + "'";

    if (category == undefined || category == "" || label == undefined || label == "" || action == undefined || action == "") {
        alert(eventDetails);
        return;
    }
    ga('send', 'event', category, action, label);
}

;
var instrumentationKey;
if (window.location.href.indexOf("local") !== -1)
    instrumentationKey = "0314ae25-2a7a-4924-8acb-eae52a61755c";
else if (window.location.href.indexOf("staging") !== -1)
    instrumentationKey = "df54e9a7-f2e0-4918-b426-4d2f96c7eb8f";
else
    instrumentationKey = "e89397d3-7857-4d47-acff-05ca26459590";
var appInsights = window.appInsights || function (config) {
    function i(config) { t[config] = function () { var i = arguments; t.queue.push(function () { t[config].apply(t, i) }) } } var t = { config: config }, u = document, e = window, o = "script", s = "AuthenticatedUserContext", h = "start", c = "stop", l = "Track", a = l + "Event", v = l + "Page", y = u.createElement(o), r, f; y.src = config.url || "https://az416426.vo.msecnd.net/scripts/a/ai.0.js"; u.getElementsByTagName(o)[0].parentNode.appendChild(y); try { t.cookie = u.cookie } catch (p) { } for (t.queue = [], t.version = "1.0", r = ["Event", "Exception", "Metric", "PageView", "Trace", "Dependency"]; r.length;) i("track" + r.pop()); return i("set" + s), i("clear" + s), i(h + a), i(c + a), i(h + v), i(c + v), i("flush"), config.disableExceptionTracking || (r = "onerror", i("_" + r), f = e[r], e[r] = function (config, i, u, e, o) { var s = f && f(config, i, u, e, o); return s !== !0 && t["_" + r](config, i, u, e, o), s }), t
}({
    instrumentationKey: instrumentationKey
});

window.appInsights = appInsights;
appInsights.trackPageView();;
/*
Copyright (c) Copyright (c) 2007, Carl S. Yestrau All rights reserved.
Code licensed under the BSD License: http://www.featureblend.com/license.txt
Version: 1.0.4
*/
var FlashDetect = new function () {
    var self = this;
    self.installed = false;
    self.html5Support = supportsMedia();
    self.raw = "";
    self.major = -1;
    self.minor = -1;
    self.revision = -1;
    self.revisionStr = "";
    var activeXDetectRules = [
        {
            "name": "ShockwaveFlash.ShockwaveFlash.7",
            "version": function (obj) {
                return getActiveXVersion(obj);
            }
        },
        {
            "name": "ShockwaveFlash.ShockwaveFlash.6",
            "version": function (obj) {
                var version = "6,0,21";
                try {
                    obj.AllowScriptAccess = "always";
                    version = getActiveXVersion(obj);
                }
                catch (err)
                { }
                return version;
            }
        },
        {
            "name": "ShockwaveFlash.ShockwaveFlash",
            "version": function (obj) {
                return getActiveXVersion(obj);
            }
        }];
    /**
    * Extract the ActiveX version of the plugin.
    * 
    * @param {Object} The flash ActiveX object.
    * @type String
    */
    var getActiveXVersion = function (activeXObj) {
        var version = -1;
        try {
            version = activeXObj.GetVariable("$version");
        }
        catch (err)
            { }
        return version;
    };
    /**
    * Try and retrieve an ActiveX object having a specified name.
    * 
    * @param {String} name The ActiveX object name lookup.
    * @return One of ActiveX object or a simple object having an attribute of activeXError with a value of true.
    * @type Object
    */
    var getActiveXObject = function (name) {
        var obj = -1;
        try {
            obj = new ActiveXObject(name);
        }
        catch (err) {
            obj = {
                activeXError: true
            };
        }
        return obj;
    };
    /**
    * Parse an ActiveX $version string into an object.
    * 
    * @param {String} str The ActiveX Object GetVariable($version) return value. 
    * @return An object having raw, major, minor, revision and revisionStr attributes.
    * @type Object
    */
    var parseActiveXVersion = function (str) {
        var versionArray = str.split(","); //replace with regex
        return {
            "raw": str,
            "major": parseInt(versionArray[0].split(" ")[1], 10),
            "minor": parseInt(versionArray[1], 10),
            "revision": parseInt(versionArray[2], 10),
            "revisionStr": versionArray[2]
        };
    };
    /**
    * Parse a standard enabledPlugin.description into an object.
    * 
    * @param {String} str The enabledPlugin.description value.
    * @return An object having raw, major, minor, revision and revisionStr attributes.
    * @type Object
    */
    var parseStandardVersion = function (str) {
        var descParts = str.split(/ +/);
        var majorMinor = descParts[2].split(/\./);
        var revisionStr = descParts[3];
        return {
            "raw": str,
            "major": parseInt(majorMinor[0], 10),
            "minor": parseInt(majorMinor[1], 10),
            "revisionStr": revisionStr,
            "revision": parseRevisionStrToInt(revisionStr)
        };
    };
    /**
    * Parse the plugin revision string into an integer.
    * 
    * @param {String} The revision in string format.
    * @type Number
    */
    var parseRevisionStrToInt = function (str) {
        return parseInt(str.replace(/[a-zA-Z]/g, ""), 10) || self.revision;
    };
    /**
    * Is the major version greater than or equal to a specified version.
    * 
    * @param {Number} version The minimum required major version.
    * @type Boolean
    */
    self.majorAtLeast = function (version) {
        return self.major >= version;
    };
    /**
    * Is the minor version greater than or equal to a specified version.
    * 
    * @param {Number} version The minimum required minor version.
    * @type Boolean
    */
    self.minorAtLeast = function (version) {
        return self.minor >= version;
    };
    /**
    * Is the revision version greater than or equal to a specified version.
    * 
    * @param {Number} version The minimum required revision version.
    * @type Boolean
    */
    self.revisionAtLeast = function (version) {
        return self.revision >= version;
    };
    /**
    * Is the version greater than or equal to a specified major, minor and revision.
    * 
    * @param {Number} major The minimum required major version.
    * @param {Number} (Optional) minor The minimum required minor version.
    * @param {Number} (Optional) revision The minimum required revision version.
    * @type Boolean
    */
    self.versionAtLeast = function (major) {
        var properties = [self.major, self.minor, self.revision];
        var len = Math.min(properties.length, arguments.length);
        for (i = 0; i < len; i++) {
            if (properties[i] >= arguments[i]) {
                if (i + 1 < len && properties[i] == arguments[i]) {
                    continue;
                }
                else {
                    return true;
                }
            }
            else {
                return false;
            }
        }
    };
    /**
    * Constructor, sets raw, major, minor, revisionStr, revision and installed public properties.
    */
    self.FlashDetect = function () {
        if (navigator.plugins && navigator.plugins.length > 0) {
            var type = 'application/x-shockwave-flash';
            var mimeTypes = navigator.mimeTypes;           
            if (mimeTypes && mimeTypes[type] && mimeTypes[type].enabledPlugin && mimeTypes[type].enabledPlugin.description) {
                var version = mimeTypes[type].enabledPlugin.description;
                var versionObj = parseStandardVersion(version);
                self.raw = versionObj.raw;
                self.major = versionObj.major;
                self.minor = versionObj.minor;
                self.revisionStr = versionObj.revisionStr;
                self.revision = versionObj.revision;
                self.installed = true;
            }
        }
        else if (navigator.appVersion.indexOf("Mac") == -1 && window.execScript) {
            var version = -1;
            for (var i = 0; i < activeXDetectRules.length && version == -1; i++) {
                var obj = getActiveXObject(activeXDetectRules[i].name);
                if (!obj.activeXError) {
                    self.installed = true;
                    version = activeXDetectRules[i].version(obj);
                    if (version != -1) {
                        var versionObj = parseActiveXVersion(version);
                        self.raw = versionObj.raw;
                        self.major = versionObj.major;
                        self.minor = versionObj.minor;
                        self.revision = versionObj.revision;
                        self.revisionStr = versionObj.revisionStr;
                    }
                }
            }
        }
    } ();

    // Check to see if the browser can render the file type using HTML5
    function supportsMedia() {
        var elem = document.createElement('video');
        if (typeof elem.canPlayType == 'function') {
            var playable = elem.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');
            if ((playable.toLowerCase() == 'maybe') || (playable.toLowerCase() == 'probably')) {
                return true;
            }
        }
        return false;
    };
};;
/*  
* ---------------TAKEN FROM---------------------------------------------  
* jQuery-Plugin - $.postForm - allows for simple post requests 
*
* Original code by Scott Jehl, scott@filamentgroup.com   as jquery.download
*code:  http://code.google.com/p/jquery-subtools/source/browse/trunk/subtools/js/jquery.download.js?r=31
* 
* --------------------------------------------------------------------  
*/ 

//url: the target url to submit to
//data: the querystring e.g param1=value3&param=value2 NB: the value will be posted as hidden fiels not querystring
//target (optional) : e.g "_self","_blank"
jQuery.postAsForm = function (url, data, target) {

    target = (typeof target != "undefined") ? target : '_self';
    //url and data options required
    if (url && data) {
        //data can be string of parameters or array/object
        data = typeof data == 'string' ? data : jQuery.param(data);
        //split params into form inputs
        var inputs = '';
        jQuery.each(data.split('&'), function () {
            var pair = this.split('=');
            inputs += '<input type="hidden" name="' + pair[0] + '" value="' + pair[1] + '" />';
        });
        
        //send request
        jQuery('<form action="' + url + '" method="post" target="' + target + '"  >' + inputs + '</form>')
            .appendTo('body').submit().remove();
    };
};;
/*
    json2.js
    2014-02-04

    Public Domain.

    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

    See http://www.JSON.org/js.html


    This code should be minified before deployment.
    See http://javascript.crockford.com/jsmin.html

    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
    NOT CONTROL.


    This file creates a global JSON object containing two methods: stringify
    and parse.

        JSON.stringify(value, replacer, space)
            value       any JavaScript value, usually an object or array.

            replacer    an optional parameter that determines how object
                        values are stringified for objects. It can be a
                        function or an array of strings.

            space       an optional parameter that specifies the indentation
                        of nested structures. If it is omitted, the text will
                        be packed without extra whitespace. If it is a number,
                        it will specify the number of spaces to indent at each
                        level. If it is a string (such as '\t' or '&nbsp;'),
                        it contains the characters used to indent at each level.

            This method produces a JSON text from a JavaScript value.

            When an object value is found, if the object contains a toJSON
            method, its toJSON method will be called and the result will be
            stringified. A toJSON method does not serialize: it returns the
            value represented by the name/value pair that should be serialized,
            or undefined if nothing should be serialized. The toJSON method
            will be passed the key associated with the value, and this will be
            bound to the value

            For example, this would serialize Dates as ISO strings.

                Date.prototype.toJSON = function (key) {
                    function f(n) {
                        // Format integers to have at least two digits.
                        return n < 10 ? '0' + n : n;
                    }

                    return this.getUTCFullYear()   + '-' +
                         f(this.getUTCMonth() + 1) + '-' +
                         f(this.getUTCDate())      + 'T' +
                         f(this.getUTCHours())     + ':' +
                         f(this.getUTCMinutes())   + ':' +
                         f(this.getUTCSeconds())   + 'Z';
                };

            You can provide an optional replacer method. It will be passed the
            key and value of each member, with this bound to the containing
            object. The value that is returned from your method will be
            serialized. If your method returns undefined, then the member will
            be excluded from the serialization.

            If the replacer parameter is an array of strings, then it will be
            used to select the members to be serialized. It filters the results
            such that only members with keys listed in the replacer array are
            stringified.

            Values that do not have JSON representations, such as undefined or
            functions, will not be serialized. Such values in objects will be
            dropped; in arrays they will be replaced with null. You can use
            a replacer function to replace those with JSON values.
            JSON.stringify(undefined) returns undefined.

            The optional space parameter produces a stringification of the
            value that is filled with line breaks and indentation to make it
            easier to read.

            If the space parameter is a non-empty string, then that string will
            be used for indentation. If the space parameter is a number, then
            the indentation will be that many spaces.

            Example:

            text = JSON.stringify(['e', {pluribus: 'unum'}]);
            // text is '["e",{"pluribus":"unum"}]'


            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'

            text = JSON.stringify([new Date()], function (key, value) {
                return this[key] instanceof Date ?
                    'Date(' + this[key] + ')' : value;
            });
            // text is '["Date(---current time---)"]'


        JSON.parse(text, reviver)
            This method parses a JSON text to produce an object or array.
            It can throw a SyntaxError exception.

            The optional reviver parameter is a function that can filter and
            transform the results. It receives each of the keys and values,
            and its return value is used instead of the original value.
            If it returns what it received, then the structure is not modified.
            If it returns undefined then the member is deleted.

            Example:

            // Parse the text. Values that look like ISO date strings will
            // be converted to Date objects.

            myData = JSON.parse(text, function (key, value) {
                var a;
                if (typeof value === 'string') {
                    a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
                    if (a) {
                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
                            +a[5], +a[6]));
                    }
                }
                return value;
            });

            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
                var d;
                if (typeof value === 'string' &&
                        value.slice(0, 5) === 'Date(' &&
                        value.slice(-1) === ')') {
                    d = new Date(value.slice(5, -1));
                    if (d) {
                        return d;
                    }
                }
                return value;
            });


    This is a reference implementation. You are free to copy, modify, or
    redistribute.
*/

/*jslint evil: true, regexp: true */

/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
    lastIndex, length, parse, prototype, push, replace, slice, stringify,
    test, toJSON, toString, valueOf
*/


// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.

if (typeof JSON !== 'object') {
    JSON = {};
}

(function () {
    'use strict';

    function f(n) {
        // Format integers to have at least two digits.
        return n < 10 ? '0' + n : n;
    }

    if (typeof Date.prototype.toJSON !== 'function') {

        Date.prototype.toJSON = function () {

            return isFinite(this.valueOf())
                ? this.getUTCFullYear()     + '-' +
                    f(this.getUTCMonth() + 1) + '-' +
                    f(this.getUTCDate())      + 'T' +
                    f(this.getUTCHours())     + ':' +
                    f(this.getUTCMinutes())   + ':' +
                    f(this.getUTCSeconds())   + 'Z'
                : null;
        };

        String.prototype.toJSON      =
            Number.prototype.toJSON  =
            Boolean.prototype.toJSON = function () {
                return this.valueOf();
            };
    }

    var cx,
        escapable,
        gap,
        indent,
        meta,
        rep;


    function quote(string) {

// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.

        escapable.lastIndex = 0;
        return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
            var c = meta[a];
            return typeof c === 'string'
                ? c
                : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
        }) + '"' : '"' + string + '"';
    }


    function str(key, holder) {

// Produce a string from holder[key].

        var i,          // The loop counter.
            k,          // The member key.
            v,          // The member value.
            length,
            mind = gap,
            partial,
            value = holder[key];

// If the value has a toJSON method, call it to obtain a replacement value.

        if (value && typeof value === 'object' &&
                typeof value.toJSON === 'function') {
            value = value.toJSON(key);
        }

// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.

        if (typeof rep === 'function') {
            value = rep.call(holder, key, value);
        }

// What happens next depends on the value's type.

        switch (typeof value) {
        case 'string':
            return quote(value);

        case 'number':

// JSON numbers must be finite. Encode non-finite numbers as null.

            return isFinite(value) ? String(value) : 'null';

        case 'boolean':
        case 'null':

// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.

            return String(value);

// If the type is 'object', we might be dealing with an object or an array or
// null.

        case 'object':

// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.

            if (!value) {
                return 'null';
            }

// Make an array to hold the partial results of stringifying this object value.

            gap += indent;
            partial = [];

// Is the value an array?

            if (Object.prototype.toString.apply(value) === '[object Array]') {

// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.

                length = value.length;
                for (i = 0; i < length; i += 1) {
                    partial[i] = str(i, value) || 'null';
                }

// Join all of the elements together, separated with commas, and wrap them in
// brackets.

                v = partial.length === 0
                    ? '[]'
                    : gap
                    ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
                    : '[' + partial.join(',') + ']';
                gap = mind;
                return v;
            }

// If the replacer is an array, use it to select the members to be stringified.

            if (rep && typeof rep === 'object') {
                length = rep.length;
                for (i = 0; i < length; i += 1) {
                    if (typeof rep[i] === 'string') {
                        k = rep[i];
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
                        }
                    }
                }
            } else {

// Otherwise, iterate through all of the keys in the object.

                for (k in value) {
                    if (Object.prototype.hasOwnProperty.call(value, k)) {
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
                        }
                    }
                }
            }

// Join all of the member texts together, separated with commas,
// and wrap them in braces.

            v = partial.length === 0
                ? '{}'
                : gap
                ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
                : '{' + partial.join(',') + '}';
            gap = mind;
            return v;
        }
    }

// If the JSON object does not yet have a stringify method, give it one.

    if (typeof JSON.stringify !== 'function') {
        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
        meta = {    // table of character substitutions
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '"' : '\\"',
            '\\': '\\\\'
        };
        JSON.stringify = function (value, replacer, space) {

// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.

            var i;
            gap = '';
            indent = '';

// If the space parameter is a number, make an indent string containing that
// many spaces.

            if (typeof space === 'number') {
                for (i = 0; i < space; i += 1) {
                    indent += ' ';
                }

// If the space parameter is a string, it will be used as the indent string.

            } else if (typeof space === 'string') {
                indent = space;
            }

// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.

            rep = replacer;
            if (replacer && typeof replacer !== 'function' &&
                    (typeof replacer !== 'object' ||
                    typeof replacer.length !== 'number')) {
                throw new Error('JSON.stringify');
            }

// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.

            return str('', {'': value});
        };
    }


// If the JSON object does not yet have a parse method, give it one.

    if (typeof JSON.parse !== 'function') {
        cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
        JSON.parse = function (text, reviver) {

// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.

            var j;

            function walk(holder, key) {

// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.

                var k, v, value = holder[key];
                if (value && typeof value === 'object') {
                    for (k in value) {
                        if (Object.prototype.hasOwnProperty.call(value, k)) {
                            v = walk(value, k);
                            if (v !== undefined) {
                                value[k] = v;
                            } else {
                                delete value[k];
                            }
                        }
                    }
                }
                return reviver.call(holder, key, value);
            }


// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.

            text = String(text);
            cx.lastIndex = 0;
            if (cx.test(text)) {
                text = text.replace(cx, function (a) {
                    return '\\u' +
                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
                });
            }

// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.

// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.

            if (/^[\],:{}\s]*$/
                    .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
                        .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
                        .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {

// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.

                j = eval('(' + text + ')');

// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.

                return typeof reviver === 'function'
                    ? walk({'': j}, '')
                    : j;
            }

// If the text is not JSON parseable, then a SyntaxError is thrown.

            throw new SyntaxError('JSON.parse');
        };
    }
}());
;
ko.bindingHandlers.slideVisible = {
    update: function (element, valueAccessor, allBindings) {
        // First get the latest data that we're bound to
        var value = valueAccessor();

        // Next, whether or not the supplied model property is observable, get its current value
        var valueUnwrapped = ko.unwrap(value);

        // Grab some more data from another binding property
        var duration = allBindings.get('slideDuration') || 400;  // 400ms is default duration unless specified
        var distance = allBindings.get('slideDistance') || '20%'; // 20% is default distance unless specified
        var direction = allBindings.get('slideDistance') || 'right'; // right is default direction unless specified

        // Now manipulate the DOM element
        if (valueUnwrapped == true)
            $(element).effect("slide", { direction: direction, distance: distance }, duration);
        else
            $(element).slideUp(duration);   // Make the element invisible
    }
};

ko.bindingHandlers.loadingWhen = {
    init: function (element) {
        var
            $element = $(element),
            currentPosition = $element.css("position"),
            $loader = $("<div>").addClass("browseLoader").hide();

        //add the loader
        $element.append($loader);

        //make sure that we can absolutely position the loader against the original element
        if (currentPosition == "auto" || currentPosition == "static")
            $element.css("position", "relative");

        //center the loader
        $loader.css({
            position: "absolute",
            top: "50%",
            left: "50%",
            "margin-left": -($loader.width() / 2) + "px",
            "margin-top": -($loader.height() / 2) + "px"
        });
    },
    update: function (element, valueAccessor) {
        var
        //unwrap the value of the flag using knockout utilities
        isLoading = ko.utils.unwrapObservable(valueAccessor()),

        //get a reference to the parent element
        $element = $(element),

        //get a reference to the loader
        $loader = $element.find("div.browseLoader"),

        //get a reference to every *other* element
        $childrenToHide = $element.children(":not(div.browseLoader)");

        //if we are currently loading...
        if (isLoading) {
            //...hide and disable the children...
            $childrenToHide.css("visibility", "hidden").attr("disabled", "disabled");
            //...and show the loader
            $loader.show();
        }
        else {
            //otherwise, fade out the loader
            $loader.fadeOut("fast");
            //and re-display and enable the children
            $childrenToHide.css("visibility", "visible").removeAttr("disabled");
        }
    }
};

ko.bindingHandlers.numeric = {
    init: function (element) {
        $(element).on("keydown", function(event) {
            // Allow: backspace, delete, tab, escape, and enter
            if (event.keyCode === 46 || event.keyCode === 8 || event.keyCode === 9 || event.keyCode === 27 || event.keyCode === 13 ||
                // Allow: Ctrl+A
                (event.keyCode === 65 && event.ctrlKey === true) ||
                // Allow: . ,
                (event.keyCode === 188 || event.keyCode === 190 || event.keyCode === 110 || event.keyCode === 189 || event.keyCode === 173 || event.keyCode === 109) ||
                // Allow: home, end, left, right
                (event.keyCode >= 35 && event.keyCode <= 39) ||
                // Allow: Ctrl+V
                (event.keyCode === 86 && event.ctrlKey === true)) {
                // let it happen, don't do anything
                return;
            }
            else {
                // Ensure that it is a number and stop the keypress
                if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) {
                    event.preventDefault();
                }
            }
            
        });
    }
};;
//     Underscore.js 1.8.2
//     http://underscorejs.org
//     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
//     Underscore may be freely distributed under the MIT license.

(function() {

  // Baseline setup
  // --------------

  // Establish the root object, `window` in the browser, or `exports` on the server.
  var root = this;

  // Save the previous value of the `_` variable.
  var previousUnderscore = root._;

  // Save bytes in the minified (but not gzipped) version:
  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;

  // Create quick reference variables for speed access to core prototypes.
  var
    push             = ArrayProto.push,
    slice            = ArrayProto.slice,
    toString         = ObjProto.toString,
    hasOwnProperty   = ObjProto.hasOwnProperty;

  // All **ECMAScript 5** native function implementations that we hope to use
  // are declared here.
  var
    nativeIsArray      = Array.isArray,
    nativeKeys         = Object.keys,
    nativeBind         = FuncProto.bind,
    nativeCreate       = Object.create;

  // Naked function reference for surrogate-prototype-swapping.
  var Ctor = function(){};

  // Create a safe reference to the Underscore object for use below.
  var _ = function(obj) {
    if (obj instanceof _) return obj;
    if (!(this instanceof _)) return new _(obj);
    this._wrapped = obj;
  };

  // Export the Underscore object for **Node.js**, with
  // backwards-compatibility for the old `require()` API. If we're in
  // the browser, add `_` as a global object.
  if (typeof exports !== 'undefined') {
    if (typeof module !== 'undefined' && module.exports) {
      exports = module.exports = _;
    }
    exports._ = _;
  } else {
    root._ = _;
  }

  // Current version.
  _.VERSION = '1.8.2';

  // Internal function that returns an efficient (for current engines) version
  // of the passed-in callback, to be repeatedly applied in other Underscore
  // functions.
  var optimizeCb = function(func, context, argCount) {
    if (context === void 0) return func;
    switch (argCount == null ? 3 : argCount) {
      case 1: return function(value) {
        return func.call(context, value);
      };
      case 2: return function(value, other) {
        return func.call(context, value, other);
      };
      case 3: return function(value, index, collection) {
        return func.call(context, value, index, collection);
      };
      case 4: return function(accumulator, value, index, collection) {
        return func.call(context, accumulator, value, index, collection);
      };
    }
    return function() {
      return func.apply(context, arguments);
    };
  };

  // A mostly-internal function to generate callbacks that can be applied
  // to each element in a collection, returning the desired result — either
  // identity, an arbitrary callback, a property matcher, or a property accessor.
  var cb = function(value, context, argCount) {
    if (value == null) return _.identity;
    if (_.isFunction(value)) return optimizeCb(value, context, argCount);
    if (_.isObject(value)) return _.matcher(value);
    return _.property(value);
  };
  _.iteratee = function(value, context) {
    return cb(value, context, Infinity);
  };

  // An internal function for creating assigner functions.
  var createAssigner = function(keysFunc, undefinedOnly) {
    return function(obj) {
      var length = arguments.length;
      if (length < 2 || obj == null) return obj;
      for (var index = 1; index < length; index++) {
        var source = arguments[index],
            keys = keysFunc(source),
            l = keys.length;
        for (var i = 0; i < l; i++) {
          var key = keys[i];
          if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];
        }
      }
      return obj;
    };
  };

  // An internal function for creating a new object that inherits from another.
  var baseCreate = function(prototype) {
    if (!_.isObject(prototype)) return {};
    if (nativeCreate) return nativeCreate(prototype);
    Ctor.prototype = prototype;
    var result = new Ctor;
    Ctor.prototype = null;
    return result;
  };

  // Helper for collection methods to determine whether a collection
  // should be iterated as an array or as an object
  // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
  var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
  var isArrayLike = function(collection) {
    var length = collection && collection.length;
    return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
  };

  // Collection Functions
  // --------------------

  // The cornerstone, an `each` implementation, aka `forEach`.
  // Handles raw objects in addition to array-likes. Treats all
  // sparse array-likes as if they were dense.
  _.each = _.forEach = function(obj, iteratee, context) {
    iteratee = optimizeCb(iteratee, context);
    var i, length;
    if (isArrayLike(obj)) {
      for (i = 0, length = obj.length; i < length; i++) {
        iteratee(obj[i], i, obj);
      }
    } else {
      var keys = _.keys(obj);
      for (i = 0, length = keys.length; i < length; i++) {
        iteratee(obj[keys[i]], keys[i], obj);
      }
    }
    return obj;
  };

  // Return the results of applying the iteratee to each element.
  _.map = _.collect = function(obj, iteratee, context) {
    iteratee = cb(iteratee, context);
    var keys = !isArrayLike(obj) && _.keys(obj),
        length = (keys || obj).length,
        results = Array(length);
    for (var index = 0; index < length; index++) {
      var currentKey = keys ? keys[index] : index;
      results[index] = iteratee(obj[currentKey], currentKey, obj);
    }
    return results;
  };

  // Create a reducing function iterating left or right.
  function createReduce(dir) {
    // Optimized iterator function as using arguments.length
    // in the main function will deoptimize the, see #1991.
    function iterator(obj, iteratee, memo, keys, index, length) {
      for (; index >= 0 && index < length; index += dir) {
        var currentKey = keys ? keys[index] : index;
        memo = iteratee(memo, obj[currentKey], currentKey, obj);
      }
      return memo;
    }

    return function(obj, iteratee, memo, context) {
      iteratee = optimizeCb(iteratee, context, 4);
      var keys = !isArrayLike(obj) && _.keys(obj),
          length = (keys || obj).length,
          index = dir > 0 ? 0 : length - 1;
      // Determine the initial value if none is provided.
      if (arguments.length < 3) {
        memo = obj[keys ? keys[index] : index];
        index += dir;
      }
      return iterator(obj, iteratee, memo, keys, index, length);
    };
  }

  // **Reduce** builds up a single result from a list of values, aka `inject`,
  // or `foldl`.
  _.reduce = _.foldl = _.inject = createReduce(1);

  // The right-associative version of reduce, also known as `foldr`.
  _.reduceRight = _.foldr = createReduce(-1);

  // Return the first value which passes a truth test. Aliased as `detect`.
  _.find = _.detect = function(obj, predicate, context) {
    var key;
    if (isArrayLike(obj)) {
      key = _.findIndex(obj, predicate, context);
    } else {
      key = _.findKey(obj, predicate, context);
    }
    if (key !== void 0 && key !== -1) return obj[key];
  };

  // Return all the elements that pass a truth test.
  // Aliased as `select`.
  _.filter = _.select = function(obj, predicate, context) {
    var results = [];
    predicate = cb(predicate, context);
    _.each(obj, function(value, index, list) {
      if (predicate(value, index, list)) results.push(value);
    });
    return results;
  };

  // Return all the elements for which a truth test fails.
  _.reject = function(obj, predicate, context) {
    return _.filter(obj, _.negate(cb(predicate)), context);
  };

  // Determine whether all of the elements match a truth test.
  // Aliased as `all`.
  _.every = _.all = function(obj, predicate, context) {
    predicate = cb(predicate, context);
    var keys = !isArrayLike(obj) && _.keys(obj),
        length = (keys || obj).length;
    for (var index = 0; index < length; index++) {
      var currentKey = keys ? keys[index] : index;
      if (!predicate(obj[currentKey], currentKey, obj)) return false;
    }
    return true;
  };

  // Determine if at least one element in the object matches a truth test.
  // Aliased as `any`.
  _.some = _.any = function(obj, predicate, context) {
    predicate = cb(predicate, context);
    var keys = !isArrayLike(obj) && _.keys(obj),
        length = (keys || obj).length;
    for (var index = 0; index < length; index++) {
      var currentKey = keys ? keys[index] : index;
      if (predicate(obj[currentKey], currentKey, obj)) return true;
    }
    return false;
  };

  // Determine if the array or object contains a given value (using `===`).
  // Aliased as `includes` and `include`.
  _.contains = _.includes = _.include = function(obj, target, fromIndex) {
    if (!isArrayLike(obj)) obj = _.values(obj);
    return _.indexOf(obj, target, typeof fromIndex == 'number' && fromIndex) >= 0;
  };

  // Invoke a method (with arguments) on every item in a collection.
  _.invoke = function(obj, method) {
    var args = slice.call(arguments, 2);
    var isFunc = _.isFunction(method);
    return _.map(obj, function(value) {
      var func = isFunc ? method : value[method];
      return func == null ? func : func.apply(value, args);
    });
  };

  // Convenience version of a common use case of `map`: fetching a property.
  _.pluck = function(obj, key) {
    return _.map(obj, _.property(key));
  };

  // Convenience version of a common use case of `filter`: selecting only objects
  // containing specific `key:value` pairs.
  _.where = function(obj, attrs) {
    return _.filter(obj, _.matcher(attrs));
  };

  // Convenience version of a common use case of `find`: getting the first object
  // containing specific `key:value` pairs.
  _.findWhere = function(obj, attrs) {
    return _.find(obj, _.matcher(attrs));
  };

  // Return the maximum element (or element-based computation).
  _.max = function(obj, iteratee, context) {
    var result = -Infinity, lastComputed = -Infinity,
        value, computed;
    if (iteratee == null && obj != null) {
      obj = isArrayLike(obj) ? obj : _.values(obj);
      for (var i = 0, length = obj.length; i < length; i++) {
        value = obj[i];
        if (value > result) {
          result = value;
        }
      }
    } else {
      iteratee = cb(iteratee, context);
      _.each(obj, function(value, index, list) {
        computed = iteratee(value, index, list);
        if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
          result = value;
          lastComputed = computed;
        }
      });
    }
    return result;
  };

  // Return the minimum element (or element-based computation).
  _.min = function(obj, iteratee, context) {
    var result = Infinity, lastComputed = Infinity,
        value, computed;
    if (iteratee == null && obj != null) {
      obj = isArrayLike(obj) ? obj : _.values(obj);
      for (var i = 0, length = obj.length; i < length; i++) {
        value = obj[i];
        if (value < result) {
          result = value;
        }
      }
    } else {
      iteratee = cb(iteratee, context);
      _.each(obj, function(value, index, list) {
        computed = iteratee(value, index, list);
        if (computed < lastComputed || computed === Infinity && result === Infinity) {
          result = value;
          lastComputed = computed;
        }
      });
    }
    return result;
  };

  // Shuffle a collection, using the modern version of the
  // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
  _.shuffle = function(obj) {
    var set = isArrayLike(obj) ? obj : _.values(obj);
    var length = set.length;
    var shuffled = Array(length);
    for (var index = 0, rand; index < length; index++) {
      rand = _.random(0, index);
      if (rand !== index) shuffled[index] = shuffled[rand];
      shuffled[rand] = set[index];
    }
    return shuffled;
  };

  // Sample **n** random values from a collection.
  // If **n** is not specified, returns a single random element.
  // The internal `guard` argument allows it to work with `map`.
  _.sample = function(obj, n, guard) {
    if (n == null || guard) {
      if (!isArrayLike(obj)) obj = _.values(obj);
      return obj[_.random(obj.length - 1)];
    }
    return _.shuffle(obj).slice(0, Math.max(0, n));
  };

  // Sort the object's values by a criterion produced by an iteratee.
  _.sortBy = function(obj, iteratee, context) {
    iteratee = cb(iteratee, context);
    return _.pluck(_.map(obj, function(value, index, list) {
      return {
        value: value,
        index: index,
        criteria: iteratee(value, index, list)
      };
    }).sort(function(left, right) {
      var a = left.criteria;
      var b = right.criteria;
      if (a !== b) {
        if (a > b || a === void 0) return 1;
        if (a < b || b === void 0) return -1;
      }
      return left.index - right.index;
    }), 'value');
  };

  // An internal function used for aggregate "group by" operations.
  var group = function(behavior) {
    return function(obj, iteratee, context) {
      var result = {};
      iteratee = cb(iteratee, context);
      _.each(obj, function(value, index) {
        var key = iteratee(value, index, obj);
        behavior(result, value, key);
      });
      return result;
    };
  };

  // Groups the object's values by a criterion. Pass either a string attribute
  // to group by, or a function that returns the criterion.
  _.groupBy = group(function(result, value, key) {
    if (_.has(result, key)) result[key].push(value); else result[key] = [value];
  });

  // Indexes the object's values by a criterion, similar to `groupBy`, but for
  // when you know that your index values will be unique.
  _.indexBy = group(function(result, value, key) {
    result[key] = value;
  });

  // Counts instances of an object that group by a certain criterion. Pass
  // either a string attribute to count by, or a function that returns the
  // criterion.
  _.countBy = group(function(result, value, key) {
    if (_.has(result, key)) result[key]++; else result[key] = 1;
  });

  // Safely create a real, live array from anything iterable.
  _.toArray = function(obj) {
    if (!obj) return [];
    if (_.isArray(obj)) return slice.call(obj);
    if (isArrayLike(obj)) return _.map(obj, _.identity);
    return _.values(obj);
  };

  // Return the number of elements in an object.
  _.size = function(obj) {
    if (obj == null) return 0;
    return isArrayLike(obj) ? obj.length : _.keys(obj).length;
  };

  // Split a collection into two arrays: one whose elements all satisfy the given
  // predicate, and one whose elements all do not satisfy the predicate.
  _.partition = function(obj, predicate, context) {
    predicate = cb(predicate, context);
    var pass = [], fail = [];
    _.each(obj, function(value, key, obj) {
      (predicate(value, key, obj) ? pass : fail).push(value);
    });
    return [pass, fail];
  };

  // Array Functions
  // ---------------

  // Get the first element of an array. Passing **n** will return the first N
  // values in the array. Aliased as `head` and `take`. The **guard** check
  // allows it to work with `_.map`.
  _.first = _.head = _.take = function(array, n, guard) {
    if (array == null) return void 0;
    if (n == null || guard) return array[0];
    return _.initial(array, array.length - n);
  };

  // Returns everything but the last entry of the array. Especially useful on
  // the arguments object. Passing **n** will return all the values in
  // the array, excluding the last N.
  _.initial = function(array, n, guard) {
    return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
  };

  // Get the last element of an array. Passing **n** will return the last N
  // values in the array.
  _.last = function(array, n, guard) {
    if (array == null) return void 0;
    if (n == null || guard) return array[array.length - 1];
    return _.rest(array, Math.max(0, array.length - n));
  };

  // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
  // Especially useful on the arguments object. Passing an **n** will return
  // the rest N values in the array.
  _.rest = _.tail = _.drop = function(array, n, guard) {
    return slice.call(array, n == null || guard ? 1 : n);
  };

  // Trim out all falsy values from an array.
  _.compact = function(array) {
    return _.filter(array, _.identity);
  };

  // Internal implementation of a recursive `flatten` function.
  var flatten = function(input, shallow, strict, startIndex) {
    var output = [], idx = 0;
    for (var i = startIndex || 0, length = input && input.length; i < length; i++) {
      var value = input[i];
      if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {
        //flatten current level of array or arguments object
        if (!shallow) value = flatten(value, shallow, strict);
        var j = 0, len = value.length;
        output.length += len;
        while (j < len) {
          output[idx++] = value[j++];
        }
      } else if (!strict) {
        output[idx++] = value;
      }
    }
    return output;
  };

  // Flatten out an array, either recursively (by default), or just one level.
  _.flatten = function(array, shallow) {
    return flatten(array, shallow, false);
  };

  // Return a version of the array that does not contain the specified value(s).
  _.without = function(array) {
    return _.difference(array, slice.call(arguments, 1));
  };

  // Produce a duplicate-free version of the array. If the array has already
  // been sorted, you have the option of using a faster algorithm.
  // Aliased as `unique`.
  _.uniq = _.unique = function(array, isSorted, iteratee, context) {
    if (array == null) return [];
    if (!_.isBoolean(isSorted)) {
      context = iteratee;
      iteratee = isSorted;
      isSorted = false;
    }
    if (iteratee != null) iteratee = cb(iteratee, context);
    var result = [];
    var seen = [];
    for (var i = 0, length = array.length; i < length; i++) {
      var value = array[i],
          computed = iteratee ? iteratee(value, i, array) : value;
      if (isSorted) {
        if (!i || seen !== computed) result.push(value);
        seen = computed;
      } else if (iteratee) {
        if (!_.contains(seen, computed)) {
          seen.push(computed);
          result.push(value);
        }
      } else if (!_.contains(result, value)) {
        result.push(value);
      }
    }
    return result;
  };

  // Produce an array that contains the union: each distinct element from all of
  // the passed-in arrays.
  _.union = function() {
    return _.uniq(flatten(arguments, true, true));
  };

  // Produce an array that contains every item shared between all the
  // passed-in arrays.
  _.intersection = function(array) {
    if (array == null) return [];
    var result = [];
    var argsLength = arguments.length;
    for (var i = 0, length = array.length; i < length; i++) {
      var item = array[i];
      if (_.contains(result, item)) continue;
      for (var j = 1; j < argsLength; j++) {
        if (!_.contains(arguments[j], item)) break;
      }
      if (j === argsLength) result.push(item);
    }
    return result;
  };

  // Take the difference between one array and a number of other arrays.
  // Only the elements present in just the first array will remain.
  _.difference = function(array) {
    var rest = flatten(arguments, true, true, 1);
    return _.filter(array, function(value){
      return !_.contains(rest, value);
    });
  };

  // Zip together multiple lists into a single array -- elements that share
  // an index go together.
  _.zip = function() {
    return _.unzip(arguments);
  };

  // Complement of _.zip. Unzip accepts an array of arrays and groups
  // each array's elements on shared indices
  _.unzip = function(array) {
    var length = array && _.max(array, 'length').length || 0;
    var result = Array(length);

    for (var index = 0; index < length; index++) {
      result[index] = _.pluck(array, index);
    }
    return result;
  };

  // Converts lists into objects. Pass either a single array of `[key, value]`
  // pairs, or two parallel arrays of the same length -- one of keys, and one of
  // the corresponding values.
  _.object = function(list, values) {
    var result = {};
    for (var i = 0, length = list && list.length; i < length; i++) {
      if (values) {
        result[list[i]] = values[i];
      } else {
        result[list[i][0]] = list[i][1];
      }
    }
    return result;
  };

  // Return the position of the first occurrence of an item in an array,
  // or -1 if the item is not included in the array.
  // If the array is large and already in sort order, pass `true`
  // for **isSorted** to use binary search.
  _.indexOf = function(array, item, isSorted) {
    var i = 0, length = array && array.length;
    if (typeof isSorted == 'number') {
      i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted;
    } else if (isSorted && length) {
      i = _.sortedIndex(array, item);
      return array[i] === item ? i : -1;
    }
    if (item !== item) {
      return _.findIndex(slice.call(array, i), _.isNaN);
    }
    for (; i < length; i++) if (array[i] === item) return i;
    return -1;
  };

  _.lastIndexOf = function(array, item, from) {
    var idx = array ? array.length : 0;
    if (typeof from == 'number') {
      idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1);
    }
    if (item !== item) {
      return _.findLastIndex(slice.call(array, 0, idx), _.isNaN);
    }
    while (--idx >= 0) if (array[idx] === item) return idx;
    return -1;
  };

  // Generator function to create the findIndex and findLastIndex functions
  function createIndexFinder(dir) {
    return function(array, predicate, context) {
      predicate = cb(predicate, context);
      var length = array != null && array.length;
      var index = dir > 0 ? 0 : length - 1;
      for (; index >= 0 && index < length; index += dir) {
        if (predicate(array[index], index, array)) return index;
      }
      return -1;
    };
  }

  // Returns the first index on an array-like that passes a predicate test
  _.findIndex = createIndexFinder(1);

  _.findLastIndex = createIndexFinder(-1);

  // Use a comparator function to figure out the smallest index at which
  // an object should be inserted so as to maintain order. Uses binary search.
  _.sortedIndex = function(array, obj, iteratee, context) {
    iteratee = cb(iteratee, context, 1);
    var value = iteratee(obj);
    var low = 0, high = array.length;
    while (low < high) {
      var mid = Math.floor((low + high) / 2);
      if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
    }
    return low;
  };

  // Generate an integer Array containing an arithmetic progression. A port of
  // the native Python `range()` function. See
  // [the Python documentation](http://docs.python.org/library/functions.html#range).
  _.range = function(start, stop, step) {
    if (arguments.length <= 1) {
      stop = start || 0;
      start = 0;
    }
    step = step || 1;

    var length = Math.max(Math.ceil((stop - start) / step), 0);
    var range = Array(length);

    for (var idx = 0; idx < length; idx++, start += step) {
      range[idx] = start;
    }

    return range;
  };

  // Function (ahem) Functions
  // ------------------

  // Determines whether to execute a function as a constructor
  // or a normal function with the provided arguments
  var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {
    if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
    var self = baseCreate(sourceFunc.prototype);
    var result = sourceFunc.apply(self, args);
    if (_.isObject(result)) return result;
    return self;
  };

  // Create a function bound to a given object (assigning `this`, and arguments,
  // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
  // available.
  _.bind = function(func, context) {
    if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
    if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
    var args = slice.call(arguments, 2);
    var bound = function() {
      return executeBound(func, bound, context, this, args.concat(slice.call(arguments)));
    };
    return bound;
  };

  // Partially apply a function by creating a version that has had some of its
  // arguments pre-filled, without changing its dynamic `this` context. _ acts
  // as a placeholder, allowing any combination of arguments to be pre-filled.
  _.partial = function(func) {
    var boundArgs = slice.call(arguments, 1);
    var bound = function() {
      var position = 0, length = boundArgs.length;
      var args = Array(length);
      for (var i = 0; i < length; i++) {
        args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];
      }
      while (position < arguments.length) args.push(arguments[position++]);
      return executeBound(func, bound, this, this, args);
    };
    return bound;
  };

  // Bind a number of an object's methods to that object. Remaining arguments
  // are the method names to be bound. Useful for ensuring that all callbacks
  // defined on an object belong to it.
  _.bindAll = function(obj) {
    var i, length = arguments.length, key;
    if (length <= 1) throw new Error('bindAll must be passed function names');
    for (i = 1; i < length; i++) {
      key = arguments[i];
      obj[key] = _.bind(obj[key], obj);
    }
    return obj;
  };

  // Memoize an expensive function by storing its results.
  _.memoize = function(func, hasher) {
    var memoize = function(key) {
      var cache = memoize.cache;
      var address = '' + (hasher ? hasher.apply(this, arguments) : key);
      if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
      return cache[address];
    };
    memoize.cache = {};
    return memoize;
  };

  // Delays a function for the given number of milliseconds, and then calls
  // it with the arguments supplied.
  _.delay = function(func, wait) {
    var args = slice.call(arguments, 2);
    return setTimeout(function(){
      return func.apply(null, args);
    }, wait);
  };

  // Defers a function, scheduling it to run after the current call stack has
  // cleared.
  _.defer = _.partial(_.delay, _, 1);

  // Returns a function, that, when invoked, will only be triggered at most once
  // during a given window of time. Normally, the throttled function will run
  // as much as it can, without ever going more than once per `wait` duration;
  // but if you'd like to disable the execution on the leading edge, pass
  // `{leading: false}`. To disable execution on the trailing edge, ditto.
  _.throttle = function(func, wait, options) {
    var context, args, result;
    var timeout = null;
    var previous = 0;
    if (!options) options = {};
    var later = function() {
      previous = options.leading === false ? 0 : _.now();
      timeout = null;
      result = func.apply(context, args);
      if (!timeout) context = args = null;
    };
    return function() {
      var now = _.now();
      if (!previous && options.leading === false) previous = now;
      var remaining = wait - (now - previous);
      context = this;
      args = arguments;
      if (remaining <= 0 || remaining > wait) {
        if (timeout) {
          clearTimeout(timeout);
          timeout = null;
        }
        previous = now;
        result = func.apply(context, args);
        if (!timeout) context = args = null;
      } else if (!timeout && options.trailing !== false) {
        timeout = setTimeout(later, remaining);
      }
      return result;
    };
  };

  // Returns a function, that, as long as it continues to be invoked, will not
  // be triggered. The function will be called after it stops being called for
  // N milliseconds. If `immediate` is passed, trigger the function on the
  // leading edge, instead of the trailing.
  _.debounce = function(func, wait, immediate) {
    var timeout, args, context, timestamp, result;

    var later = function() {
      var last = _.now() - timestamp;

      if (last < wait && last >= 0) {
        timeout = setTimeout(later, wait - last);
      } else {
        timeout = null;
        if (!immediate) {
          result = func.apply(context, args);
          if (!timeout) context = args = null;
        }
      }
    };

    return function() {
      context = this;
      args = arguments;
      timestamp = _.now();
      var callNow = immediate && !timeout;
      if (!timeout) timeout = setTimeout(later, wait);
      if (callNow) {
        result = func.apply(context, args);
        context = args = null;
      }

      return result;
    };
  };

  // Returns the first function passed as an argument to the second,
  // allowing you to adjust arguments, run code before and after, and
  // conditionally execute the original function.
  _.wrap = function(func, wrapper) {
    return _.partial(wrapper, func);
  };

  // Returns a negated version of the passed-in predicate.
  _.negate = function(predicate) {
    return function() {
      return !predicate.apply(this, arguments);
    };
  };

  // Returns a function that is the composition of a list of functions, each
  // consuming the return value of the function that follows.
  _.compose = function() {
    var args = arguments;
    var start = args.length - 1;
    return function() {
      var i = start;
      var result = args[start].apply(this, arguments);
      while (i--) result = args[i].call(this, result);
      return result;
    };
  };

  // Returns a function that will only be executed on and after the Nth call.
  _.after = function(times, func) {
    return function() {
      if (--times < 1) {
        return func.apply(this, arguments);
      }
    };
  };

  // Returns a function that will only be executed up to (but not including) the Nth call.
  _.before = function(times, func) {
    var memo;
    return function() {
      if (--times > 0) {
        memo = func.apply(this, arguments);
      }
      if (times <= 1) func = null;
      return memo;
    };
  };

  // Returns a function that will be executed at most one time, no matter how
  // often you call it. Useful for lazy initialization.
  _.once = _.partial(_.before, 2);

  // Object Functions
  // ----------------

  // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
  var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
  var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
                      'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];

  function collectNonEnumProps(obj, keys) {
    var nonEnumIdx = nonEnumerableProps.length;
    var constructor = obj.constructor;
    var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto;

    // Constructor is a special case.
    var prop = 'constructor';
    if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);

    while (nonEnumIdx--) {
      prop = nonEnumerableProps[nonEnumIdx];
      if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {
        keys.push(prop);
      }
    }
  }

  // Retrieve the names of an object's own properties.
  // Delegates to **ECMAScript 5**'s native `Object.keys`
  _.keys = function(obj) {
    if (!_.isObject(obj)) return [];
    if (nativeKeys) return nativeKeys(obj);
    var keys = [];
    for (var key in obj) if (_.has(obj, key)) keys.push(key);
    // Ahem, IE < 9.
    if (hasEnumBug) collectNonEnumProps(obj, keys);
    return keys;
  };

  // Retrieve all the property names of an object.
  _.allKeys = function(obj) {
    if (!_.isObject(obj)) return [];
    var keys = [];
    for (var key in obj) keys.push(key);
    // Ahem, IE < 9.
    if (hasEnumBug) collectNonEnumProps(obj, keys);
    return keys;
  };

  // Retrieve the values of an object's properties.
  _.values = function(obj) {
    var keys = _.keys(obj);
    var length = keys.length;
    var values = Array(length);
    for (var i = 0; i < length; i++) {
      values[i] = obj[keys[i]];
    }
    return values;
  };

  // Returns the results of applying the iteratee to each element of the object
  // In contrast to _.map it returns an object
  _.mapObject = function(obj, iteratee, context) {
    iteratee = cb(iteratee, context);
    var keys =  _.keys(obj),
          length = keys.length,
          results = {},
          currentKey;
      for (var index = 0; index < length; index++) {
        currentKey = keys[index];
        results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
      }
      return results;
  };

  // Convert an object into a list of `[key, value]` pairs.
  _.pairs = function(obj) {
    var keys = _.keys(obj);
    var length = keys.length;
    var pairs = Array(length);
    for (var i = 0; i < length; i++) {
      pairs[i] = [keys[i], obj[keys[i]]];
    }
    return pairs;
  };

  // Invert the keys and values of an object. The values must be serializable.
  _.invert = function(obj) {
    var result = {};
    var keys = _.keys(obj);
    for (var i = 0, length = keys.length; i < length; i++) {
      result[obj[keys[i]]] = keys[i];
    }
    return result;
  };

  // Return a sorted list of the function names available on the object.
  // Aliased as `methods`
  _.functions = _.methods = function(obj) {
    var names = [];
    for (var key in obj) {
      if (_.isFunction(obj[key])) names.push(key);
    }
    return names.sort();
  };

  // Extend a given object with all the properties in passed-in object(s).
  _.extend = createAssigner(_.allKeys);

  // Assigns a given object with all the own properties in the passed-in object(s)
  // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
  _.extendOwn = _.assign = createAssigner(_.keys);

  // Returns the first key on an object that passes a predicate test
  _.findKey = function(obj, predicate, context) {
    predicate = cb(predicate, context);
    var keys = _.keys(obj), key;
    for (var i = 0, length = keys.length; i < length; i++) {
      key = keys[i];
      if (predicate(obj[key], key, obj)) return key;
    }
  };

  // Return a copy of the object only containing the whitelisted properties.
  _.pick = function(object, oiteratee, context) {
    var result = {}, obj = object, iteratee, keys;
    if (obj == null) return result;
    if (_.isFunction(oiteratee)) {
      keys = _.allKeys(obj);
      iteratee = optimizeCb(oiteratee, context);
    } else {
      keys = flatten(arguments, false, false, 1);
      iteratee = function(value, key, obj) { return key in obj; };
      obj = Object(obj);
    }
    for (var i = 0, length = keys.length; i < length; i++) {
      var key = keys[i];
      var value = obj[key];
      if (iteratee(value, key, obj)) result[key] = value;
    }
    return result;
  };

   // Return a copy of the object without the blacklisted properties.
  _.omit = function(obj, iteratee, context) {
    if (_.isFunction(iteratee)) {
      iteratee = _.negate(iteratee);
    } else {
      var keys = _.map(flatten(arguments, false, false, 1), String);
      iteratee = function(value, key) {
        return !_.contains(keys, key);
      };
    }
    return _.pick(obj, iteratee, context);
  };

  // Fill in a given object with default properties.
  _.defaults = createAssigner(_.allKeys, true);

  // Create a (shallow-cloned) duplicate of an object.
  _.clone = function(obj) {
    if (!_.isObject(obj)) return obj;
    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
  };

  // Invokes interceptor with the obj, and then returns obj.
  // The primary purpose of this method is to "tap into" a method chain, in
  // order to perform operations on intermediate results within the chain.
  _.tap = function(obj, interceptor) {
    interceptor(obj);
    return obj;
  };

  // Returns whether an object has a given set of `key:value` pairs.
  _.isMatch = function(object, attrs) {
    var keys = _.keys(attrs), length = keys.length;
    if (object == null) return !length;
    var obj = Object(object);
    for (var i = 0; i < length; i++) {
      var key = keys[i];
      if (attrs[key] !== obj[key] || !(key in obj)) return false;
    }
    return true;
  };


  // Internal recursive comparison function for `isEqual`.
  var eq = function(a, b, aStack, bStack) {
    // Identical objects are equal. `0 === -0`, but they aren't identical.
    // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
    if (a === b) return a !== 0 || 1 / a === 1 / b;
    // A strict comparison is necessary because `null == undefined`.
    if (a == null || b == null) return a === b;
    // Unwrap any wrapped objects.
    if (a instanceof _) a = a._wrapped;
    if (b instanceof _) b = b._wrapped;
    // Compare `[[Class]]` names.
    var className = toString.call(a);
    if (className !== toString.call(b)) return false;
    switch (className) {
      // Strings, numbers, regular expressions, dates, and booleans are compared by value.
      case '[object RegExp]':
      // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
      case '[object String]':
        // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
        // equivalent to `new String("5")`.
        return '' + a === '' + b;
      case '[object Number]':
        // `NaN`s are equivalent, but non-reflexive.
        // Object(NaN) is equivalent to NaN
        if (+a !== +a) return +b !== +b;
        // An `egal` comparison is performed for other numeric values.
        return +a === 0 ? 1 / +a === 1 / b : +a === +b;
      case '[object Date]':
      case '[object Boolean]':
        // Coerce dates and booleans to numeric primitive values. Dates are compared by their
        // millisecond representations. Note that invalid dates with millisecond representations
        // of `NaN` are not equivalent.
        return +a === +b;
    }

    var areArrays = className === '[object Array]';
    if (!areArrays) {
      if (typeof a != 'object' || typeof b != 'object') return false;

      // Objects with different constructors are not equivalent, but `Object`s or `Array`s
      // from different frames are.
      var aCtor = a.constructor, bCtor = b.constructor;
      if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&
                               _.isFunction(bCtor) && bCtor instanceof bCtor)
                          && ('constructor' in a && 'constructor' in b)) {
        return false;
      }
    }
    // Assume equality for cyclic structures. The algorithm for detecting cyclic
    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
    
    // Initializing stack of traversed objects.
    // It's done here since we only need them for objects and arrays comparison.
    aStack = aStack || [];
    bStack = bStack || [];
    var length = aStack.length;
    while (length--) {
      // Linear search. Performance is inversely proportional to the number of
      // unique nested structures.
      if (aStack[length] === a) return bStack[length] === b;
    }

    // Add the first object to the stack of traversed objects.
    aStack.push(a);
    bStack.push(b);

    // Recursively compare objects and arrays.
    if (areArrays) {
      // Compare array lengths to determine if a deep comparison is necessary.
      length = a.length;
      if (length !== b.length) return false;
      // Deep compare the contents, ignoring non-numeric properties.
      while (length--) {
        if (!eq(a[length], b[length], aStack, bStack)) return false;
      }
    } else {
      // Deep compare objects.
      var keys = _.keys(a), key;
      length = keys.length;
      // Ensure that both objects contain the same number of properties before comparing deep equality.
      if (_.keys(b).length !== length) return false;
      while (length--) {
        // Deep compare each member
        key = keys[length];
        if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
      }
    }
    // Remove the first object from the stack of traversed objects.
    aStack.pop();
    bStack.pop();
    return true;
  };

  // Perform a deep comparison to check if two objects are equal.
  _.isEqual = function(a, b) {
    return eq(a, b);
  };

  // Is a given array, string, or object empty?
  // An "empty" object has no enumerable own-properties.
  _.isEmpty = function(obj) {
    if (obj == null) return true;
    if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;
    return _.keys(obj).length === 0;
  };

  // Is a given value a DOM element?
  _.isElement = function(obj) {
    return !!(obj && obj.nodeType === 1);
  };

  // Is a given value an array?
  // Delegates to ECMA5's native Array.isArray
  _.isArray = nativeIsArray || function(obj) {
    return toString.call(obj) === '[object Array]';
  };

  // Is a given variable an object?
  _.isObject = function(obj) {
    var type = typeof obj;
    return type === 'function' || type === 'object' && !!obj;
  };

  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.
  _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {
    _['is' + name] = function(obj) {
      return toString.call(obj) === '[object ' + name + ']';
    };
  });

  // Define a fallback version of the method in browsers (ahem, IE < 9), where
  // there isn't any inspectable "Arguments" type.
  if (!_.isArguments(arguments)) {
    _.isArguments = function(obj) {
      return _.has(obj, 'callee');
    };
  }

  // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,
  // IE 11 (#1621), and in Safari 8 (#1929).
  if (typeof /./ != 'function' && typeof Int8Array != 'object') {
    _.isFunction = function(obj) {
      return typeof obj == 'function' || false;
    };
  }

  // Is a given object a finite number?
  _.isFinite = function(obj) {
    return isFinite(obj) && !isNaN(parseFloat(obj));
  };

  // Is the given value `NaN`? (NaN is the only number which does not equal itself).
  _.isNaN = function(obj) {
    return _.isNumber(obj) && obj !== +obj;
  };

  // Is a given value a boolean?
  _.isBoolean = function(obj) {
    return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
  };

  // Is a given value equal to null?
  _.isNull = function(obj) {
    return obj === null;
  };

  // Is a given variable undefined?
  _.isUndefined = function(obj) {
    return obj === void 0;
  };

  // Shortcut function for checking if an object has a given property directly
  // on itself (in other words, not on a prototype).
  _.has = function(obj, key) {
    return obj != null && hasOwnProperty.call(obj, key);
  };

  // Utility Functions
  // -----------------

  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
  // previous owner. Returns a reference to the Underscore object.
  _.noConflict = function() {
    root._ = previousUnderscore;
    return this;
  };

  // Keep the identity function around for default iteratees.
  _.identity = function(value) {
    return value;
  };

  // Predicate-generating functions. Often useful outside of Underscore.
  _.constant = function(value) {
    return function() {
      return value;
    };
  };

  _.noop = function(){};

  _.property = function(key) {
    return function(obj) {
      return obj == null ? void 0 : obj[key];
    };
  };

  // Generates a function for a given object that returns a given property.
  _.propertyOf = function(obj) {
    return obj == null ? function(){} : function(key) {
      return obj[key];
    };
  };

  // Returns a predicate for checking whether an object has a given set of 
  // `key:value` pairs.
  _.matcher = _.matches = function(attrs) {
    attrs = _.extendOwn({}, attrs);
    return function(obj) {
      return _.isMatch(obj, attrs);
    };
  };

  // Run a function **n** times.
  _.times = function(n, iteratee, context) {
    var accum = Array(Math.max(0, n));
    iteratee = optimizeCb(iteratee, context, 1);
    for (var i = 0; i < n; i++) accum[i] = iteratee(i);
    return accum;
  };

  // Return a random integer between min and max (inclusive).
  _.random = function(min, max) {
    if (max == null) {
      max = min;
      min = 0;
    }
    return min + Math.floor(Math.random() * (max - min + 1));
  };

  // A (possibly faster) way to get the current timestamp as an integer.
  _.now = Date.now || function() {
    return new Date().getTime();
  };

   // List of HTML entities for escaping.
  var escapeMap = {
    '&': '&amp;',
    '<': '&lt;',
    '>': '&gt;',
    '"': '&quot;',
    "'": '&#x27;',
    '`': '&#x60;'
  };
  var unescapeMap = _.invert(escapeMap);

  // Functions for escaping and unescaping strings to/from HTML interpolation.
  var createEscaper = function(map) {
    var escaper = function(match) {
      return map[match];
    };
    // Regexes for identifying a key that needs to be escaped
    var source = '(?:' + _.keys(map).join('|') + ')';
    var testRegexp = RegExp(source);
    var replaceRegexp = RegExp(source, 'g');
    return function(string) {
      string = string == null ? '' : '' + string;
      return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
    };
  };
  _.escape = createEscaper(escapeMap);
  _.unescape = createEscaper(unescapeMap);

  // If the value of the named `property` is a function then invoke it with the
  // `object` as context; otherwise, return it.
  _.result = function(object, property, fallback) {
    var value = object == null ? void 0 : object[property];
    if (value === void 0) {
      value = fallback;
    }
    return _.isFunction(value) ? value.call(object) : value;
  };

  // Generate a unique integer id (unique within the entire client session).
  // Useful for temporary DOM ids.
  var idCounter = 0;
  _.uniqueId = function(prefix) {
    var id = ++idCounter + '';
    return prefix ? prefix + id : id;
  };

  // By default, Underscore uses ERB-style template delimiters, change the
  // following template settings to use alternative delimiters.
  _.templateSettings = {
    evaluate    : /<%([\s\S]+?)%>/g,
    interpolate : /<%=([\s\S]+?)%>/g,
    escape      : /<%-([\s\S]+?)%>/g
  };

  // When customizing `templateSettings`, if you don't want to define an
  // interpolation, evaluation or escaping regex, we need one that is
  // guaranteed not to match.
  var noMatch = /(.)^/;

  // Certain characters need to be escaped so that they can be put into a
  // string literal.
  var escapes = {
    "'":      "'",
    '\\':     '\\',
    '\r':     'r',
    '\n':     'n',
    '\u2028': 'u2028',
    '\u2029': 'u2029'
  };

  var escaper = /\\|'|\r|\n|\u2028|\u2029/g;

  var escapeChar = function(match) {
    return '\\' + escapes[match];
  };

  // JavaScript micro-templating, similar to John Resig's implementation.
  // Underscore templating handles arbitrary delimiters, preserves whitespace,
  // and correctly escapes quotes within interpolated code.
  // NB: `oldSettings` only exists for backwards compatibility.
  _.template = function(text, settings, oldSettings) {
    if (!settings && oldSettings) settings = oldSettings;
    settings = _.defaults({}, settings, _.templateSettings);

    // Combine delimiters into one regular expression via alternation.
    var matcher = RegExp([
      (settings.escape || noMatch).source,
      (settings.interpolate || noMatch).source,
      (settings.evaluate || noMatch).source
    ].join('|') + '|$', 'g');

    // Compile the template source, escaping string literals appropriately.
    var index = 0;
    var source = "__p+='";
    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
      source += text.slice(index, offset).replace(escaper, escapeChar);
      index = offset + match.length;

      if (escape) {
        source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
      } else if (interpolate) {
        source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
      } else if (evaluate) {
        source += "';\n" + evaluate + "\n__p+='";
      }

      // Adobe VMs need the match returned to produce the correct offest.
      return match;
    });
    source += "';\n";

    // If a variable is not specified, place data values in local scope.
    if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';

    source = "var __t,__p='',__j=Array.prototype.join," +
      "print=function(){__p+=__j.call(arguments,'');};\n" +
      source + 'return __p;\n';

    try {
      var render = new Function(settings.variable || 'obj', '_', source);
    } catch (e) {
      e.source = source;
      throw e;
    }

    var template = function(data) {
      return render.call(this, data, _);
    };

    // Provide the compiled source as a convenience for precompilation.
    var argument = settings.variable || 'obj';
    template.source = 'function(' + argument + '){\n' + source + '}';

    return template;
  };

  // Add a "chain" function. Start chaining a wrapped Underscore object.
  _.chain = function(obj) {
    var instance = _(obj);
    instance._chain = true;
    return instance;
  };

  // OOP
  // ---------------
  // If Underscore is called as a function, it returns a wrapped object that
  // can be used OO-style. This wrapper holds altered versions of all the
  // underscore functions. Wrapped objects may be chained.

  // Helper function to continue chaining intermediate results.
  var result = function(instance, obj) {
    return instance._chain ? _(obj).chain() : obj;
  };

  // Add your own custom functions to the Underscore object.
  _.mixin = function(obj) {
    _.each(_.functions(obj), function(name) {
      var func = _[name] = obj[name];
      _.prototype[name] = function() {
        var args = [this._wrapped];
        push.apply(args, arguments);
        return result(this, func.apply(_, args));
      };
    });
  };

  // Add all of the Underscore functions to the wrapper object.
  _.mixin(_);

  // Add all mutator Array functions to the wrapper.
  _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
    var method = ArrayProto[name];
    _.prototype[name] = function() {
      var obj = this._wrapped;
      method.apply(obj, arguments);
      if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
      return result(this, obj);
    };
  });

  // Add all accessor Array functions to the wrapper.
  _.each(['concat', 'join', 'slice'], function(name) {
    var method = ArrayProto[name];
    _.prototype[name] = function() {
      return result(this, method.apply(this._wrapped, arguments));
    };
  });

  // Extracts the result from a wrapped and chained object.
  _.prototype.value = function() {
    return this._wrapped;
  };

  // Provide unwrapping proxy for some methods used in engine operations
  // such as arithmetic and JSON stringification.
  _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
  
  _.prototype.toString = function() {
    return '' + this._wrapped;
  };

  // AMD registration happens at the end for compatibility with AMD loaders
  // that may not enforce next-turn semantics on modules. Even though general
  // practice for AMD registration is to be anonymous, underscore registers
  // as a named module because, like jQuery, it is a base library that is
  // popular enough to be bundled in a third party lib, but not be part of
  // an AMD load request. Those cases could generate an error when an
  // anonymous define() is called outside of a loader request.
  if (typeof define === 'function' && define.amd) {
    define('underscore', [], function() {
      return _;
    });
  }
}.call(this));
;
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();;

$(document).ready(function () {

    
    if ($('form#tabForm').exists()) {
        return;
    }

    var globalFormElement = document.createElement("form");
    globalFormElement.id = "tabForm";
    globalFormElement.style.display = "none";
    globalFormElement.method = "post";
    document.body.appendChild(globalFormElement);

    var globalForm = $('form#tabForm');


    globalForm.setFormHiddenField("SelectedContext");
    globalForm.setFormHiddenField("EntryPoint");
    globalForm.setFormHiddenField("AnalysisContext.AnalysisId");
    globalForm.setFormHiddenField("AnalysisContext.AnalysisTypeId");
    globalForm.setFormHiddenField("AnalysisContext.ItemTypeId");
    globalForm.setFormHiddenField("AnalysisContext.ElementId");
    globalForm.setFormHiddenField("AnalysisContext.ElementTypeId");
    globalForm.setFormHiddenField("AnalysisContext.IsPowerpoint");
    globalForm.setFormHiddenField("AnalysisContext.LanguageCode");
    globalForm.setFormHiddenField("AnalysisContext.LanguageMessage");
    globalForm.setFormHiddenField("AnalysisContext.TranslatedLanguageCode");
    globalForm.setFormHiddenField("AnalysisContext.HighlightString");


    globalForm.setFormHiddenField("ResultsListContext.SearchType");
    globalForm.setFormHiddenField("ResultsListContext.EntryPoint");
    globalForm.setFormHiddenField("ResultsListContext.CountryCodes");
    globalForm.setFormHiddenField("ResultsListContext.LatestResearchItemTypeIds");
    globalForm.setFormHiddenField("ResultsListContext.IdentifierTypeId");
    globalForm.setFormHiddenField("ResultsListContext.IdentifierValue");
    globalForm.setFormHiddenField("ResultsListContext.PageId");
    globalForm.setFormHiddenField("ResultsListContext.NumOfMonths");
    globalForm.setFormHiddenField("ResultsListContext.MaxCount");
    globalForm.setFormHiddenField("ResultsListContext.BrandIds");
    globalForm.setFormHiddenField("ResultsListContext.CompanyIds");
    globalForm.setFormHiddenField("ResultsListContext.ForeignMarketIds");
    globalForm.setFormHiddenField("ResultsListContext.SurveyIds");
    globalForm.setFormHiddenField("ResultsListContext.ClosureTypeIds");
    globalForm.setFormHiddenField("ResultsListContext.ProductIds");
    globalForm.setFormHiddenField("ResultsListContext.SearchString");
    globalForm.setFormHiddenField("ResultsListContext.SortType");
    globalForm.setFormHiddenField("ResultsListContext.CategoryFacets");
    globalForm.setFormHiddenField("ResultsListContext.SurveyTopicFacets");
    globalForm.setFormHiddenField("ResultsListContext.AnalysisFacets");
    globalForm.setFormHiddenField("ResultsListContext.DateFacets");
    globalForm.setFormHiddenField("ResultsListContext.GeographyFacets");
    globalForm.setFormHiddenField("ResultsListContext.StatisticsFacets");
    globalForm.setFormHiddenField("ResultsListContext.CurrentPageIndex");
    globalForm.setFormHiddenField("ResultsListContext.NutrientTypeIds");
    globalForm.setFormHiddenField("ResultsListContext.PackTypeIds");
    globalForm.setFormHiddenField("ResultsListContext.EthicalTypeIds");

    //Removed all the Stats Fields because it has been converted to use "SetFormHiddenField"


    
    globalForm.setFormHiddenField("ResearchSourceContext.CountryCodes");
    globalForm.setFormHiddenField("ResearchSourceContext.ProjectCode");
    globalForm.setFormHiddenField("ResearchSourceContext.AnalysisId");
    globalForm.setFormHiddenField("WorldRankingContext.ProductId");
    globalForm.setFormHiddenField("WorldRankingContext.CountryCode");
    globalForm.setFormHiddenField("WorldRankingContext.ConversionFactor");
    
    globalForm.setFormHiddenField("DefinitionContext.CountryCodes");
    globalForm.setFormHiddenField("DefinitionContext.ProductIds");
    globalForm.setFormHiddenField("DefinitionContext.DefinitionType");
    globalForm.setFormHiddenField("DefinitionContext.MeasureTypeId");
    globalForm.setFormHiddenField("DefinitionContext.ProjectCodes");
    globalForm.setFormHiddenField("DefinitionContext.ModifiedProjectCode");

    globalForm.setFormHiddenField("ModifySearchContext.EntryPoint");
    globalForm.setFormHiddenField("ModifySearchContext.SearchType");
    globalForm.setFormHiddenField("ModifySearchContext.SortType");
    globalForm.setFormHiddenField("ModifySearchContext.SelectedCategoryIds");
    globalForm.setFormHiddenField("ModifySearchContext.ExpandedCategoryIds");
    globalForm.setFormHiddenField("ModifySearchContext.CategoryFilterText");
    globalForm.setFormHiddenField("ModifySearchContext.SelectedCountryCodes");
    globalForm.setFormHiddenField("ModifySearchContext.ExpandedCountryCodes");
    globalForm.setFormHiddenField("ModifySearchContext.CountryFilterText");
    globalForm.setFormHiddenField("ModifySearchContext.SelectedPackagingIds");
    globalForm.setFormHiddenField("ModifySearchContext.ExpandedPackagingIds");
    globalForm.setFormHiddenField("ModifySearchContext.SelectedNutrientIds");
    globalForm.setFormHiddenField("ModifySearchContext.ExpandedNutrientIds");
    globalForm.setFormHiddenField("ModifySearchContext.SelectedClosureIds");
    globalForm.setFormHiddenField("ModifySearchContext.ExpandedClosureIds");
    globalForm.setFormHiddenField("ModifySearchContext.SelectedSurveyIds");
    globalForm.setFormHiddenField("ModifySearchContext.ExpandedSurveyIds");
    globalForm.setFormHiddenField("ModifySearchContext.SelectedCompanyIds");
    globalForm.setFormHiddenField("ModifySearchContext.ExpandedCompanyIds");
    globalForm.setFormHiddenField("ModifySearchContext.CompanyFilterText");
    globalForm.setFormHiddenField("ModifySearchContext.SelectedBrandIds");
    globalForm.setFormHiddenField("ModifySearchContext.ExpandedForeignMarketIds");
    globalForm.setFormHiddenField("ModifySearchContext.ExpandedBrandIds");
    globalForm.setFormHiddenField("ModifySearchContext.BrandFilterText");
    globalForm.setFormHiddenField("ModifySearchContext.SelectedForeignMarketIds");
});;
jQuery.fn.exists = function () { return this.length > 0; };

// Counter for ajax requests (except HtmlHelper requests OnDocumentReadyPostAsync/OnDocumentReadyGetAsync).
var ajaxRequestCounter = 0;

jQuery.fn.setFormHiddenField = function (fieldName, fieldValue) {

    var formElement = this;

    if (typeof fieldValue === "undefined") { fieldValue = ''; }

    if (formElement.exists()) {
        var testField = $("#tabForm :input[name='" + fieldName + "']");

        if (testField.exists()) {
            testField.val(fieldValue);
        } else {
            formElement.append('<input name="' + fieldName + '" type="hidden" value="' + fieldValue + '" />');

        }
    } else {
        kendoConsole.log("form does not exist. hidden " + fieldName + " was not added.");
    }
};


$(document).ready(function () {
    
    $(window).load(function () {
        hideLoading();
    });

    $(window).unload(function () {
        showLoading();
    });

    //Attach the Google Analytic event
    $('[GAAction]').bind('click', function (event) {
        GAtrackEvent_OnClick(this);
    });
});

function showLoading() {
    $('#MainContent').addClass('progress-indicator');
    $('#loader').show();
}

function trimCommasOrWhiteSpaces(value) {
    value = value.replace(/(^[,\s]+)|([,\s]+$)/g, '');
    return value;
}

function hideLoading() {

    if (ajaxRequestCounter == 0) {
        $('#MainContent').removeClass('progress-indicator');
        $('#loader').hide();
    }
}

function OnDatabound() {

    hideLoading();
}

// Increment counter for ajax requests (except HtmlHelper requests OnDocumentReadyPostAsync/OnDocumentReadyGetAsync).
// Show loading icon for ajax requests (except HtmlHelper requests OnDocumentReadyPostAsync/OnDocumentReadyGetAsync).
$(document).ajaxSend(function (evt, xhr, settings) {
    if (settings && settings.ignoreGlobalLoading) {
        return;
    }

    ajaxRequestCounter++;

    showLoading();
});

// Decrement counter for ajax requests on completion (except HtmlHelper requests OnDocumentReadyPostAsync/OnDocumentReadyGetAsync).
// Hide loading icon after all ajax requests have been completed (except HtmlHelper requests OnDocumentReadyPostAsync/OnDocumentReadyGetAsync).
$(document).ajaxComplete(function (evt, xhr, settings) {

    if (settings && settings.ignoreGlobalLoading) {
        return;
    }

    ajaxRequestCounter--;

    hideLoading();
});

function DisplaySystemNotification(msg) {

    var footerDiv = $("<div id='globalFooter' name='globalFooter' class='footerMessage'>");
    footerDiv.append("<span id='footerCloseButton' class='footerClose'></span>");
    footerDiv.append("<p>" + msg + "</p>");
    footerDiv.append("</div>");
    var footer = $("#globalFooter");
    if (footer.length > 0) {
        footer.remove();
    }

    $("body .em-fixed-footer").append(footerDiv);

    $("#footerCloseButton").click(function () {
        $("#footerCloseButton").parent().hide();
        $("#footerCloseButton").siblings().empty();

    });
}

function HideDisplayedMessage() {

    var footer = $(".footerMessage");
    if (footer.length > 0) {
        footer.remove();
    }
}

function DisplayFooterMessage(message) {
    $("#footerMessage").remove();
    var div = document.createElement("div");
    div.className = "footerMessage";
    div.id = "footerMessage";

    var p = document.createElement("p");
    p.innerHTML = message;

    var span = document.createElement("span");
    span.className = "footerClose";
    span.onclick = function () { $(this).parent().parent().hide(); };

    p.appendChild(span);
    div.appendChild(p);
    $("body .em-fixed-footer").append(div);
}

function EnableSubmitControl(submitFormBtn, controlName, enabled) {
    /// <summary>
    ///     Enable / disable a control
    /// </summary>
    /// <param name="controlName">Name of control to enable / disable</param>
    /// <param name="enabled">Whether control must be enabled</param>
    var control = $(controlName);
    if (control.exists()) {
        if (enabled) {
            control.removeAttr("disabled");
            control.removeClass("aspNetDisabled");
            control.click(function () {
                $(submitFormBtn).submit();
            });
        } else {
            control.attr("disabled", "disabled");
            control.addClass("aspNetDisabled");
            control.unbind('click');
        }
    }
}


function EnableClick(controlName, enabled) {
    /// <summary>
    ///     Enable / disable a control
    /// </summary>
    /// <param name="controlName">Name of control to enable / disable</param>
    /// <param name="enabled">Whether control must be enabled</param>
    var control = $(controlName);
    if (control.exists()) {
        if (enabled) {
            control.removeAttr("disabled");
            control.removeClass("aspNetDisabled");
            control.bind('click');
        } else {
            control.attr("disabled", "disabled");
            control.addClass("aspNetDisabled");
            control.unbind('click');
        }
    }
}

function ToggleLeftControl(ctrl) {
    if (ctrl.hasClass("closed")) {
        ctrl.removeClass("closed");
        ctrl.addClass("open");
        ctrl.siblings(".filterSubOptions").removeClass("hide");
        ctrl.siblings(".filterSubOptions").addClass("show");
    } else {
        ctrl.removeClass("open");
        ctrl.addClass("closed");
        ctrl.siblings(".filterSubOptions").removeClass("show");
        ctrl.siblings(".filterSubOptions").addClass("hide");
    }
}

function filterFacetsSlideToggle(ctrl) {
    ctrl.siblings(".filterSubOptions").slideToggle('fast');
    if (ctrl.hasClass("closed")) {
        ctrl.removeClass("closed");
        ctrl.addClass("open");
    } else {
        ctrl.removeClass("open");
        ctrl.addClass("closed");
    }
}

function CreateUniqueArray(originalArray) {
    var newArray = [],
        originalArrayLength = originalArray.length,
        found,
        x,
        y;

    for (x = 0; x < originalArrayLength; x++) {
        found = undefined;
        for (y = 0; y < newArray.length; y++) {
            if (originalArray[x] === newArray[y]) {
                found = true;
                break;
            }
        }

        if (!found) { newArray.push(originalArray[x]); }
    }
    return newArray;
}

function DisplayDropDownErrors(ctrl, wrapCtrl, err) {
    err = '<p class="error">' + err + '</p>';
    $(ctrl).append(err);
    $(wrapCtrl).removeClass("controlWrap fullControlWrap controlFormWrap");
    $(wrapCtrl).addClass("ErrorTile");
    $(ctrl).empty();
    $(ctrl).append(err);
}




function PostTabForm(url) {

    showLoading();

    $('input:text[value=""]', '#tabForm').remove();

    var tabForm = $("#tabForm");
    tabForm.prop("action", url);
    tabForm.submit();
}

function ClearTabForm() {
    $("#tabForm :input").each(function () {
        $(this).val(null);
    });
}

function ClearStatisticsContext(contextName) {
    $("#tabForm :input[name*='" + contextName + "']").each(function () {
        $(this).val(null);
    });
}

function ValidateTextIsEmpty(searchText, footerMessage) {
    if (searchText == null || searchText.length == 0 || searchText=="") {
        DisplayFooterMessage(footerMessage);
        return false;
    }
    return true;
}

function ValidateTextMinAndMaxLength(searchText, footerMessage) {
    if (searchText.length < 2 || searchText.length > 254) {
        DisplayFooterMessage(footerMessage);
        return false;
    }
    return true;
}

//Copy Values from Active to Alternate, So that we can Prevserve the changes for later use.
function CopyFromContextToAnother(from, to) {

    var tabForm = $("form#tabForm");

    $("#tabForm :input[name*='" + from + "']").each(function () {

        var activeContextField = $(this);
        var nameAttr = activeContextField.attr('name');
        var nameStartIndex = nameAttr.indexOf(".") + 1;
        var fieldName = to + "." + nameAttr.substring(nameStartIndex);

        tabForm.setFormHiddenField(fieldName, activeContextField.val());
    });
}

//Serialize an array of form elements or a set of
//key/values into a query string
jQuery.param = function (a, traditional) {
    var prefix,
        s = [],
        add = function (key, value) {
            // If value is a function, invoke it and return its value
            value = jQuery.isFunction(value) ? value() : (value == null ? "" : value);
            s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
        };

    // Set traditional to true for jQuery <= 1.3.2 behavior.
    if (traditional === undefined) {
        traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
    }

    // If an array was passed in, assume that it is an array of form elements.
    if (jQuery.isArray(a) || (a.jquery && !jQuery.isPlainObject(a))) {
        // Serialize the form elements
        jQuery.each(a, function () {
            add(this.name, this.value);
        });

    } else {
        // If traditional, encode the "old" way (the way 1.3.2 or older
        // did it), otherwise encode params recursively.
        for (prefix in a) {
            buildParams(prefix, a[prefix], traditional, add);
        }
    }

    // Return the resulting serialization
    return s.join("&");
};

//it uses the JSON library to convert only fields in a javascript object to form data
function toFromData(source)
{
    var jsonSelf = JSON.parse(JSON.stringify(source));
    return decodeURIComponent($.param(jsonSelf));
};

function buildParams(prefix, obj, traditional, add) {
    var name;
    var rbracketCustom = /\[\]$/;
    if (jQuery.isArray(obj)) {
        // Serialize array item.
        jQuery.each(obj, function (i, v) {
            if (traditional || rbracketCustom.test(prefix)) {
                // Treat each array item as a scalar.
                add(prefix, v);

            } else {
                // Item is non-scalar (array or object), encode its numeric index.
                buildParams(prefix + "[" + (typeof v === "object" ? i : "") + "]", v, traditional, add);
            }
        });

    } else if (!traditional && jQuery.type(obj) === "object") {
        // Serialize object item.
        for (name in obj) {
            buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
        }

    } else {
        // Serialize scalar item.
        add(prefix, obj);
    }
}

//Setting cookie for feedback beta bar for 30 days.
function setEmBetaBarCookie() {
    var emBetaBarCookie = $.cookie("EM-Betabar");
    //if coookie already set not updating cookie again. 
    if (emBetaBarCookie == null) {
        date = new Date();
        date.setTime(date.getTime() + (30 * 24 * 60 * 60 * 1000));
        var cookie = "EM-Betabar = false; expires=" + date.toUTCString() + "; path = /";
        document.cookie = cookie;
    }
}

// TODO : Remove once statistics redesign is completed
function HasStatsGrid(measureTypeId) {
    var hasStats = new $.Deferred();

    $.ajax({
        url: '/' + window.location.pathname.split('/')[1] + '/statistics/MeasureTypeStatus',
        type: 'POST',
        data: { measureTypeId: measureTypeId },
        success: function (data) {
            hasStats.resolve(data);
        }
    });

    return hasStats;
}

;
/// <reference path="../../typings/knockout.d.ts" />
/// <reference path="../../typings/jquery/jquery.d.ts" />
//declare var ko: any;
//declare var $: JQueryStatic;
//module Contexts {
var ResultsListContextViewModel = (function () {
    function ResultsListContextViewModel(initialData) {
        var self = this;
        if (initialData != null) {
            self.searchType = ko.observable(initialData.SearchType);
            self.sortType = ko.observable(initialData.SortType);
            self.searchString = ko.observable(initialData.SearchString);
            self.productIds = ko.observable(initialData.ProductIds);
            self.companyIds = ko.observable(initialData.CompanyIds);
            self.countryCodes = ko.observable(initialData.CountryCodes);
            self.brandIds = ko.observable(initialData.BrandIds);
            self.foreignMarketIds = ko.observable(initialData.ForeignMarketIds);
            self.closureTypeIds = ko.observable(initialData.ClosureTypeIds);
            self.packTypeIds = ko.observable(initialData.PackTypeIds);
            self.nutrientTypeIds = ko.observable(initialData.NutrientTypeIds);
            self.surveyIds = ko.observable(initialData.SurveyIds);
            self.ethicalTypeIds = ko.observable(initialData.EthicalTypeIds);
            self.packagingClass = ko.observable(initialData.PackagingClass);
            self.currentPageIndex = ko.observable(initialData.CurrentPageIndex);
            self.entryPoint = ko.observable(initialData.EntryPoint);
            self.identifierTypeId = ko.observable(initialData.IdentifierTypeId);
            self.identifierValue = ko.observable(initialData.IdentifierValue);
            self.latestResearchItemTypeIds = ko.observable(initialData.LatestResearchItemTypeIds);
            self.listPageHeader = ko.observable(initialData.ListPageHeader);
            self.listPageSubHeader = ko.observable(initialData.ListPageSubHeader);
            self.categoryFacets = ko.observable(initialData.CategoryFacets);
            self.geographyFacets = ko.observable(initialData.GeographyFacets);
            self.analysisFacets = ko.observable(initialData.AnalysisFacets);
            self.surveyTopicFacets = ko.observable(initialData.SurveyTopicFacets);
            self.dateFacets = ko.observable(initialData.DateFacets);
            self.currentPageIndex = ko.observable(initialData.CurrentPageIndex);
        }
    }
    ResultsListContextViewModel.prototype.defaultToResultsListContextViewModel = function () {
        var self = this;
        //Sort type is set to "relevance"
        this.sortType(4);
        this.productIds(null);
        this.countryCodes(null);
        this.companyIds(null);
        this.packTypeIds(null);
        this.closureTypeIds(null);
        this.nutrientTypeIds(null);
        this.brandIds(null);
        this.surveyIds(null);
        this.foreignMarketIds(null);
        this.ethicalTypeIds(null);
        this.categoryFacets(null);
        this.geographyFacets(null);
        this.analysisFacets(null);
        this.surveyTopicFacets(null);
        this.dateFacets(null);
    };
    return ResultsListContextViewModel;
}());
//# sourceMappingURL=ResultsListContextViewModel.js.map;
/// <reference path="../../typings/knockout.d.ts" />
// Viewmodel for My Research (Saved Search).
var ResearchContextViewModel = (function () {
    function ResearchContextViewModel(initialData) {
        if (initialData) {
            this.sortType = ko.observable(initialData.SortType);
            this.currentPageIndex = ko.observable(initialData.PageIndex);
            this.researchTotal = ko.observable(0);
            this.typeFacet = ko.observable(initialData.TypeFacet);
            this.dateFacet = ko.observable(initialData.DateFacet);
            this.sharedFacet = ko.observable(initialData.SharedFacet);
            this.fullNameFacet = ko.observable(initialData.FullNameFacet);
        }
    }
    return ResearchContextViewModel;
}());
//# sourceMappingURL=ResearchContextViewModel.js.map;
/// <reference path="../../typings/knockout.d.ts" />
/// <reference path="../../typings/jquery/jquery.d.ts" />
//declare var ko: any;
//declare var $: JQueryStatic;
//module Contexts {
var DataConversionContext = (function () {
    function DataConversionContext(initialData) {
        var self = this;
        if (initialData != null) {
            if (initialData.CurrencyExchange != null) {
                self.currencyExchange = ko.observable(new CurrencyExchange(initialData.CurrencyExchange.CurrencyCode, initialData.CurrencyExchange.ExchangeCode));
            }
            else {
                self.currencyExchange = ko.observable(new CurrencyExchange("", ""));
            }
            if (initialData.SizeConversion != null) {
                self.sizeConversion = ko.observable(new SizeConversion(initialData.SizeConversion.Denominator, initialData.SizeConversion.Numerator));
            }
            else {
                self.sizeConversion = ko.observable(new SizeConversion(0, 0));
            }
            self.conversionOption = ko.observable(initialData.ConversionOption);
            self.dataTypeDrtCode = ko.observable(initialData.DataTypeDrtCode);
            self.growthType = ko.observable(initialData.GrowthType);
            self.perCapitaId = ko.observable(initialData.PerCapitaId);
            self.unitMultiplier = ko.observable(initialData.UnitMultiplier);
            self.volumeConversionId = ko.observable(initialData.VolumeConversionId);
            self.isCurrencyConversionApplicable = ko.observable(initialData.IsCurrencyConversionApplicable);
            self.isTimeSeriesConversionApplicable = ko.observable(initialData.IsTimeSeriesConversionApplicable);
        }
        //ko.applyBindings(self);
    }
    return DataConversionContext;
}());
var SizeConversion = (function () {
    function SizeConversion(denominator, numerator) {
        var self = this;
        self.denominator = ko.observable(denominator);
        self.numerator = ko.observable(numerator);
    }
    return SizeConversion;
}());
var CurrencyExchange = (function () {
    function CurrencyExchange(currencyCode, exchangeCode) {
        var self = this;
        self.currencyCode = ko.observable(currencyCode);
        self.exchangeCode = ko.observable(exchangeCode);
    }
    return CurrencyExchange;
}());
var ConversionOption;
(function (ConversionOption) {
    ConversionOption[ConversionOption["NotSet"] = 0] = "NotSet";
    ConversionOption[ConversionOption["TimeSeries"] = 2] = "TimeSeries";
    ConversionOption[ConversionOption["UnitPrice"] = 3] = "UnitPrice";
    ConversionOption[ConversionOption["ExchangeRate"] = 4] = "ExchangeRate";
    ConversionOption[ConversionOption["CurrentConstant"] = 5] = "CurrentConstant";
    ConversionOption[ConversionOption["Volume"] = 6] = "Volume";
    ConversionOption[ConversionOption["UnitMultiplier"] = 7] = "UnitMultiplier";
    ConversionOption[ConversionOption["Growth"] = 8] = "Growth";
    ConversionOption[ConversionOption["PerCapita"] = 9] = "PerCapita";
    ConversionOption[ConversionOption["CompanyOrBrandShare"] = 11] = "CompanyOrBrandShare";
    ConversionOption[ConversionOption["UnitType"] = 12] = "UnitType";
    ConversionOption[ConversionOption["MeasureType"] = 13] = "MeasureType";
    ConversionOption[ConversionOption["Horeca"] = 15] = "Horeca";
    ConversionOption[ConversionOption["Pricing"] = 16] = "Pricing";
    ConversionOption[ConversionOption["VolumneLabel"] = 20] = "VolumneLabel";
    ConversionOption[ConversionOption["ExchangeDataType"] = 21] = "ExchangeDataType";
    ConversionOption[ConversionOption["SeasonalUnit"] = 22] = "SeasonalUnit";
})(ConversionOption || (ConversionOption = {}));
var GrowthType;
(function (GrowthType) {
    GrowthType[GrowthType["None"] = 0] = "None";
    GrowthType[GrowthType["Index"] = 1] = "Index";
    GrowthType[GrowthType["YearOnYear"] = 2] = "YearOnYear";
    GrowthType[GrowthType["Period"] = 3] = "Period";
    GrowthType[GrowthType["Period6"] = 4] = "Period6";
})(GrowthType || (GrowthType = {}));
var DataTypeDrtCode;
(function (DataTypeDrtCode) {
    DataTypeDrtCode[DataTypeDrtCode["NotSet"] = 0] = "NotSet";
    DataTypeDrtCode[DataTypeDrtCode["Volume"] = 1] = "Volume";
    DataTypeDrtCode[DataTypeDrtCode["CurrConstYearCurr"] = 2] = "CurrConstYearCurr";
    DataTypeDrtCode[DataTypeDrtCode["CurrCurr"] = 3] = "CurrCurr";
    DataTypeDrtCode[DataTypeDrtCode["ConstConstYear0"] = 4] = "ConstConstYear0";
    DataTypeDrtCode[DataTypeDrtCode["ConstConstYearCurr"] = 5] = "ConstConstYearCurr";
})(DataTypeDrtCode || (DataTypeDrtCode = {}));
var UnitMultiplier;
(function (UnitMultiplier) {
    UnitMultiplier[UnitMultiplier["None"] = 0] = "None";
    UnitMultiplier[UnitMultiplier["One"] = 1] = "One";
    UnitMultiplier[UnitMultiplier["Hundred"] = 100] = "Hundred";
    UnitMultiplier[UnitMultiplier["Thousand"] = 1000] = "Thousand";
    UnitMultiplier[UnitMultiplier["Million"] = 1000000] = "Million";
    UnitMultiplier[UnitMultiplier["Billion"] = 1000000000] = "Billion";
    UnitMultiplier[UnitMultiplier["Trillion"] = 1000000000000] = "Trillion";
})(UnitMultiplier || (UnitMultiplier = {}));
var UnitType;
(function (UnitType) {
    UnitType[UnitType["Percent"] = 0] = "Percent";
    UnitType[UnitType["Ranking"] = 1] = "Ranking";
    UnitType[UnitType["Actual"] = 2] = "Actual";
})(UnitType || (UnitType = {}));
//# sourceMappingURL=DataConversionContext.js.map;
/// <reference path="../../typings/knockout.d.ts" />
/// <reference path="../../typings/jquery/jquery.d.ts" />
//declare var ko: any;
//declare var $: JQueryStatic;
//module Contexts {
var StatisticsContext = (function () {
    function StatisticsContext(initialData) {
        var self = this;
        if (initialData != null) {
            self.subscriberId = ko.observable(initialData.SubscriberId);
            self.foreignMarketIds = ko.observable(initialData.ForeignMarketIds);
            self.measureNameIds = ko.observable(initialData.MeasureNameIds);
            self.pricingYears = ko.observable(initialData.PricingYears);
            self.seasonalAdjustmentTypeId = ko.observable(initialData.SeasonalAdjustmentTypeId);
            self.seasonUnitId = ko.observable(initialData.SeasonUnitId);
            self.contextType = ko.observable(initialData.ContextType);
            self.companyIds = ko.observable(initialData.CompanyIds);
            self.packTypeIds = ko.observable(initialData.PackTypeIds);
            self.nutrientTypeIds = ko.observable(initialData.NutrientTypeIds);
            self.ethicalTypeIds = ko.observable(initialData.EthicalTypeIds);
            self.brandIds = ko.observable(initialData.BrandIds);
            self.closureTypeIds = ko.observable(initialData.ClosureTypeIds);
            self.packagingClass = ko.observable(initialData.PackagingClass);
            self.countryCodes = ko.observable(initialData.CountryCodes);
            self.productIds = ko.observable(initialData.ProductIds);
            self.measureTypeId = ko.observable(initialData.MeasureTypeId);
            self.selectedRowIds = ko.observable(initialData.SelectedRowIds);
            self.pivotAxis = ko.observable(initialData.PivotAxis);
            self.projectCodes = ko.observable(initialData.ProjectCodes);
            self.rankOption = ko.observable(initialData.RankOption);
            self.timePeriod = ko.observable(initialData.TimePeriod);
            self.sumAllGroups = ko.observable(initialData.SumAllGroups);
            self.unitType = ko.observable(initialData.UnitType);
            self.groupLevelOrder = ko.observable(initialData.GroupLevelOrder);
            self.dataTypeIds = ko.observable(initialData.DataTypeIds);
            self.years = ko.observable(initialData.Years);
            self.recipeIds = ko.observable(initialData.RecipeIds);
            self.chartId = ko.observable(initialData.ChartId);
            self.brandOwnerType = ko.observable(initialData.BrandOwnerType);
            self.showAsPercentage = ko.observable(initialData.ShowAsPercentage);
            self.sorting = ko.observable(new Sorting(initialData.sorting.ColumnName, initialData.sorting.Direction));
            self.conversionContext = ko.observable(new DataConversionContext(initialData.conversionContext));
        }
        //ko.applyBindings(self);
    }
    return StatisticsContext;
}());
var Sorting = (function () {
    function Sorting(columnName, direction) {
        var self = this;
        self.columnName = ko.observable(columnName);
        self.direction = ko.observable(direction);
    }
    return Sorting;
}());
//# sourceMappingURL=StatisticsContext.js.map;
/// <reference path="../../typings/knockout.d.ts" />
/// <reference path="../../typings/jquery/jquery.d.ts" />
/// <reference path="../contexts/Statisticscontext.ts" />
/// <reference path="../contexts/DataConversionContext.ts" />
//declare var ko: any;
//declare var $: JQueryStatic;
var DataConversionModel = (function () {
    function DataConversionModel(statisticsContext) {
        this.statisticsContext = statisticsContext;
    }
    DataConversionModel.prototype.getConversionOptions = function (url) {
        var conversionOptions = {};
        $.ajax({
            url: url,
            type: "POST",
            dataType: "json",
            data: ko.toJSON(ko.toJS(this.statisticsContext)),
            contentType: "application/json",
            async: false,
            success: function (data) {
                conversionOptions = data;
            },
            error: function (jqXhr, textStatus, errorThrown) {
                console.log(errorThrown);
            }
        });
        return conversionOptions;
    };
    return DataConversionModel;
}());
//# sourceMappingURL=DataConversionModel.js.map;
var StatisticsEvolution;
(function (StatisticsEvolution) {
    var StatisticsModifyContext = (function () {
        function StatisticsModifyContext(statisticsEvolutionContext) {
            this.addedItems = [];
            this.removedItems = [];
            var self = this;
            self.resetModifiedContext = function () {
                self.productIds = statisticsEvolutionContext.productIds;
                self.countryCodes = statisticsEvolutionContext.countryCodes;
            };
            self.applyModifiedContext = function (startYear, endYear) {
                if (statisticsEvolutionContext.resultsListContext === null || statisticsEvolutionContext.resultsListContext.entryPoint().toString() !== Search.EntryPoint.KeywordSearch.toString()) {
                    var addedProductIds = self.getAddedItems(self.productIds, statisticsEvolutionContext.productIds);
                    var removedProductIds = self.getRemovedItems(self.productIds, statisticsEvolutionContext.productIds);
                    var addedCountryCodes = self.getAddedItems(self.countryCodes, statisticsEvolutionContext.countryCodes);
                    var removedCountryCodes = self.getRemovedItems(self.countryCodes, statisticsEvolutionContext.countryCodes);
                    statisticsEvolutionContext.statisticsTypeContext.updateStatisticsTypeContext(addedProductIds, removedProductIds, addedCountryCodes, removedCountryCodes);
                }
                statisticsEvolutionContext.productIds = self.productIds;
                statisticsEvolutionContext.countryCodes = self.countryCodes;
                statisticsEvolutionContext.coreDataTypeIds = self.coreDataTypeIds;
                statisticsEvolutionContext.ownerTypeId = self.ownerTypeId;
                statisticsEvolutionContext.measureTypeId = self.measureTypeId;
                self.applyModifiedYears(startYear, endYear);
            };
            self.applyModifiedYears = function (startYear, endYear) {
                var years = [];
                while (startYear <= endYear) {
                    years.push(startYear++);
                }
                statisticsEvolutionContext.years = years.join(',');
                return;
            };
            self.getAddedItems = function (newItems, oldItems) {
                var arraynewItems = newItems.split(',');
                var arrayOldItems = oldItems.split(',');
                var addedItems = _.difference(arraynewItems, arrayOldItems);
                return addedItems;
            };
            self.getRemovedItems = function (newItems, oldItems) {
                var arraynewItems = newItems.split(',');
                var arrayOldItems = oldItems.split(',');
                var addedItems = _.difference(arrayOldItems, arraynewItems);
                return addedItems;
            };
            self.productIds = statisticsEvolutionContext.productIds;
            self.countryCodes = statisticsEvolutionContext.countryCodes;
            self.coreDataTypeIds = statisticsEvolutionContext.coreDataTypeIds;
            self.ownerTypeId = statisticsEvolutionContext.ownerTypeId;
            self.measureTypeId = statisticsEvolutionContext.measureTypeId;
        }
        return StatisticsModifyContext;
    }());
    StatisticsEvolution.StatisticsModifyContext = StatisticsModifyContext;
})(StatisticsEvolution || (StatisticsEvolution = {}));
//# sourceMappingURL=StatisticsModifyContext.js.map;
var GridContext = (function () {
    function GridContext(initialData) {
        var self = this;
        if (initialData != null) {
            self.sortDescriptor = new SortDescriptor(initialData.SortDescriptor);
            self.filterDescriptors = initialData.FilterDescriptors;
            self.groupColumns = initialData.GroupColumns;
            return;
        }
        self.sortDescriptor = new SortDescriptor();
        self.filterDescriptors = [];
        self.groupColumns = [];
    }
    return GridContext;
}());
//# sourceMappingURL=GridContext.js.map;
var StatisticsEvolution;
(function (StatisticsEvolution) {
    (function (GrowthTypeEnum) {
        GrowthTypeEnum[GrowthTypeEnum["YearOnYear"] = 1] = "YearOnYear";
        GrowthTypeEnum[GrowthTypeEnum["Period"] = 2] = "Period";
        GrowthTypeEnum[GrowthTypeEnum["Index"] = 3] = "Index";
        GrowthTypeEnum[GrowthTypeEnum["None"] = 4] = "None";
    })(StatisticsEvolution.GrowthTypeEnum || (StatisticsEvolution.GrowthTypeEnum = {}));
    var GrowthTypeEnum = StatisticsEvolution.GrowthTypeEnum;
})(StatisticsEvolution || (StatisticsEvolution = {}));
//# sourceMappingURL=GrowthTypeEnum.js.map;
var StatisticsEvolutionContext = (function () {
    function StatisticsEvolutionContext(initialData) {
        var self = this;
        self.toFormDataString = function () {
            var jsonSelf = JSON.parse(ko.toJSON(self));
            return decodeURIComponent($.param(jsonSelf));
        };
        self.resetConvertData = function () {
            self.unitPriceId = null;
            self.unitTypeId = null;
            self.perCapitaId = null;
            self.growthType = StatisticsEvolution.GrowthTypeEnum.None;
            self.unitMultiplier = null;
            self.volumeConversionId = null;
            self.currencyConversionId = null;
        };
        self.resetYear = function () {
            self.years = null;
            self.timePeriod = null;
        };
        self.resetEntryPoint = function () {
            if (Search.EntryPoint.TopCategories === self.entryPoint
                || Search.EntryPoint.TopCountries === self.entryPoint
                || Search.EntryPoint.AllCities === self.entryPoint
                || Search.EntryPoint.TopCities === self.entryPoint)
                self.entryPoint = Search.EntryPoint.NotSet;
        };
        self.applyConversionToContext = function (conversionTypeId, conversionId, conversionOption, numerator, denominator) {
            self.conversionOption = conversionOption;
            switch (conversionTypeId) {
                case StatisticsEvolution.ConversionTypeEnum.CurrentConstant:
                    self.inflationAdjustmentCode = conversionId;
                    break;
                case StatisticsEvolution.ConversionTypeEnum.Currency:
                    self.currencyConversionId = conversionId;
                    break;
                case StatisticsEvolution.ConversionTypeEnum.Volume:
                    self.volumeConversionId = conversionId;
                    break;
                case StatisticsEvolution.ConversionTypeEnum.UnitMultiplier:
                    self.unitMultiplier = conversionId;
                    break;
                case StatisticsEvolution.ConversionTypeEnum.UnitPrice:
                    self.unitPriceId = conversionId;
                    self.numerator = numerator;
                    self.denominator = denominator;
                    break;
                case StatisticsEvolution.ConversionTypeEnum.Growth:
                    self.growthType = conversionId;
                    break;
                case StatisticsEvolution.ConversionTypeEnum.PerCapitahousehold:
                    self.perCapitaId = conversionId;
                    break;
                case StatisticsEvolution.ConversionTypeEnum.UnitType:
                    if (conversionId === UnitType.Percent || conversionId === UnitType.Ranking) {
                        self.currencyConversionId = null;
                        self.volumeConversionId = null;
                    }
                    self.unitTypeId = conversionId;
                    break;
            }
        };
        self.resetPageIndex = function () {
            self.pageIndex = 0;
        };
        self.updateTotalRows = function (totalRows) {
            self.totalRows = totalRows;
        };
        self.updateContext = function (measureTypeId, productIds, countrycodes, companyIds, brandIds, ownerTypeId) {
            self.measureTypeId = measureTypeId;
            self.productIds = productIds;
            self.countryCodes = countrycodes;
            self.companyIds = companyIds;
            self.brandIds = brandIds;
            self.ownerTypeId = ownerTypeId;
            //TODO: Need to move create seperate context
            self.coreDataTypeIds = null;
            self.statisticItemIds = null;
            self.resetConvertData();
            self.resetPageIndex();
        };
        if (initialData != null) {
            self.subscriberId = initialData.SubscriberId;
            self.measureTypeId = initialData.MeasureTypeId;
            self.projectCodes = initialData.ProjectCodes;
            self.productIds = initialData.ProductIds;
            self.countryCodes = initialData.CountryCodes;
            self.dataTypeIds = initialData.DataTypeIds;
            self.coreDataTypeIds = initialData.CoreDataTypeIds;
            self.years = initialData.Years;
            self.currencyConversionId = initialData.CurrencyConversionId;
            self.inflationAdjustmentCode = initialData.InflationAdjustmentCode;
            self.volumeConversionId = initialData.VolumeConversionId;
            self.growthType = initialData.GrowthType;
            self.unitMultiplier = initialData.UnitMultiplier;
            self.companyIds = initialData.CompanyIds;
            self.brandIds = initialData.BrandIds;
            self.unitPriceId = initialData.UnitPriceId;
            self.ownerTypeId = initialData.OwnerTypeId;
            self.unitTypeId = initialData.UnitTypeId;
            self.perCapitaId = initialData.PerCapitaId;
            self.minResearchYear = initialData.MinResearchYear;
            self.isBackToResultsListApplicable = initialData.IsBackToResultsListApplicable;
            self.entryPoint = initialData.EntryPoint;
            self.rankOption = initialData.RankOption;
            self.timePeriod = initialData.TimePeriod;
            self.statisticItemIds = initialData.StatisticItemIds;
            self.pageIndex = initialData.PageIndex;
            self.pageSize = initialData.PageSize;
            self.totalRows = initialData.TotalRows;
            self.isExcel = initialData.IsExcel;
            self.isPdf = initialData.IsPdf;
            self.conversionOption = initialData.ConversionOption;
            self.numerator = initialData.Numerator;
            self.denominator = initialData.Denominator;
            self.modifyContext = new StatisticsEvolution.StatisticsModifyContext(self);
            self.statisticsTypeContext = new StatisticsEvolution.StatisticsTypeContext(initialData.StatisticsTypeContext);
            self.gridContext = new GridContext(initialData.GridContext);
            if (initialData.ResultsListContext != null)
                self.resultsListContext = new ResultsListContextViewModel(initialData.ResultsListContext);
            else
                self.resultsListContext = null;
        }
    }
    return StatisticsEvolutionContext;
}());
//# sourceMappingURL=StatisticsEvolutionContext.js.map;
var StatisticsEvolution;
(function (StatisticsEvolution) {
    var StatisticsTypeContext = (function () {
        function StatisticsTypeContext(data) {
            var _this = this;
            var self = this;
            if (data != null) {
                this.productIds = data.ProductIds;
                this.countryCodes = data.CountryCodes;
                this.companyIds = data.CompanyIds;
                this.brandIds = data.BrandIds;
                this.searchString = data.SearchString;
            }
            self.updateStatisticsTypeContext = function (addedProductIds, removedProductIds, addedCountryCodes, removedCountryCode) {
                _this.productIds = _this.addRemoveItems(_this.productIds, addedProductIds, removedProductIds);
                _this.countryCodes = _this.addRemoveItems(_this.countryCodes, addedCountryCodes, removedCountryCode);
            };
        }
        StatisticsTypeContext.prototype.addRemoveItems = function (currentItems, addedItems, removedItems) {
            var arrayCurrentItems = currentItems.split(',');
            removedItems.forEach(function (value) {
                var index = arrayCurrentItems.indexOf(value);
                if (index !== -1) {
                    arrayCurrentItems.splice(index, 1);
                }
            });
            addedItems.forEach(function (value) {
                var index = arrayCurrentItems.indexOf(value);
                if (index === -1) {
                    arrayCurrentItems.push(value);
                }
            });
            return arrayCurrentItems.join(',');
        };
        return StatisticsTypeContext;
    }());
    StatisticsEvolution.StatisticsTypeContext = StatisticsTypeContext;
})(StatisticsEvolution || (StatisticsEvolution = {}));
//# sourceMappingURL=StatisticsTypeContext.js.map;
var StatisticsEvolution;
(function (StatisticsEvolution) {
    (function (ConversionTypeEnum) {
        ConversionTypeEnum[ConversionTypeEnum["CurrentConstant"] = 1] = "CurrentConstant";
        ConversionTypeEnum[ConversionTypeEnum["Currency"] = 2] = "Currency";
        ConversionTypeEnum[ConversionTypeEnum["Volume"] = 3] = "Volume";
        ConversionTypeEnum[ConversionTypeEnum["UnitMultiplier"] = 4] = "UnitMultiplier";
        ConversionTypeEnum[ConversionTypeEnum["PerCapitahousehold"] = 5] = "PerCapitahousehold";
        ConversionTypeEnum[ConversionTypeEnum["Growth"] = 6] = "Growth";
        ConversionTypeEnum[ConversionTypeEnum["UnitPrice"] = 7] = "UnitPrice";
        ConversionTypeEnum[ConversionTypeEnum["UnitType"] = 8] = "UnitType";
    })(StatisticsEvolution.ConversionTypeEnum || (StatisticsEvolution.ConversionTypeEnum = {}));
    var ConversionTypeEnum = StatisticsEvolution.ConversionTypeEnum;
})(StatisticsEvolution || (StatisticsEvolution = {}));
//# sourceMappingURL=ConversionTypeEnum.js.map;
var StatisticsEvolution;
(function (StatisticsEvolution) {
    (function (OutputPageEnum) {
        OutputPageEnum[OutputPageEnum["Web"] = 0] = "Web";
        OutputPageEnum[OutputPageEnum["Excel"] = 5] = "Excel";
        OutputPageEnum[OutputPageEnum["ExcelPivot"] = 8] = "ExcelPivot";
        OutputPageEnum[OutputPageEnum["PrinterFriendly"] = 15] = "PrinterFriendly";
        OutputPageEnum[OutputPageEnum["RSSFeed"] = 16] = "RSSFeed";
        OutputPageEnum[OutputPageEnum["PDF"] = 18] = "PDF";
        OutputPageEnum[OutputPageEnum["Word"] = 19] = "Word";
        OutputPageEnum[OutputPageEnum["PPT"] = 20] = "PPT";
        OutputPageEnum[OutputPageEnum["File"] = 21] = "File";
        OutputPageEnum[OutputPageEnum["Flash"] = 22] = "Flash";
        OutputPageEnum[OutputPageEnum["ExcelGrinder"] = 23] = "ExcelGrinder";
    })(StatisticsEvolution.OutputPageEnum || (StatisticsEvolution.OutputPageEnum = {}));
    var OutputPageEnum = StatisticsEvolution.OutputPageEnum;
})(StatisticsEvolution || (StatisticsEvolution = {}));
//# sourceMappingURL=OutputPageEnum.js.map;
var StatisticsEvolution;
(function (StatisticsEvolution) {
    var BaseStatisticsEvolution = (function () {
        function BaseStatisticsEvolution() {
        }
        BaseStatisticsEvolution.prototype.getBaseUrl = function (relativePath) {
            var path = '/' + window.location.pathname.split('/')[1] + relativePath;
            return path;
        };
        //TODO: To be removed once new stats is implemented for all measures
        BaseStatisticsEvolution.prototype.isNewGrid = function (measureTypeId) {
            if (StatisticsEvolution.WellKnownMeasureTypeEnum[measureTypeId] !== null
                && StatisticsEvolution.WellKnownMeasureTypeEnum[measureTypeId] !== undefined) {
                return true;
            }
            else {
                var hasStats = false;
                $.ajax({
                    url: this.getBaseUrl("/statistics/MeasureTypeStatus"),
                    type: "POST",
                    data: { measureTypeId: measureTypeId },
                    async: false
                }).done(function (data) {
                    hasStats = data;
                });
                return hasStats;
            }
        };
        return BaseStatisticsEvolution;
    }());
    StatisticsEvolution.BaseStatisticsEvolution = BaseStatisticsEvolution;
})(StatisticsEvolution || (StatisticsEvolution = {}));
//# sourceMappingURL=BaseStatisticsEvolution.js.map;
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var StatisticsEvolution;
(function (StatisticsEvolution) {
    var StatisticsContextSwitching = (function (_super) {
        __extends(StatisticsContextSwitching, _super);
        function StatisticsContextSwitching() {
            _super.apply(this, arguments);
        }
        StatisticsContextSwitching.prototype.onChangeStatsMeasure = function (measureTypeId, statisticsEvolutionContext) {
            var self = this;
            self.statisticsEvolutionContext = statisticsEvolutionContext;
            if (this.isNewGrid(measureTypeId)) {
                self.submitToNewStatistics();
            }
            else {
                self.submitToOldStatistics();
            }
        };
        StatisticsContextSwitching.prototype.onBackToOldStatistics = function (statisticsEvolutionContext) {
            var self = this;
            self.statisticsEvolutionContext = statisticsEvolutionContext;
            self.backToOldStatistics();
        };
        StatisticsContextSwitching.prototype.submitToNewStatistics = function () {
            var self = this;
            var successRedirectUrl = self.getBaseUrl("/StatisticsEvolution/index");
            $.postAsForm(successRedirectUrl, self.statisticsEvolutionContext.toFormDataString());
        };
        StatisticsContextSwitching.prototype.submitToOldStatistics = function () {
            var self = this;
            var tabForm = $('form#tabForm');
            if (this.statisticsEvolutionContext.resultsListContext != null) {
                tabForm.setFormHiddenField("EntryPoint", this.statisticsEvolutionContext.resultsListContext.entryPoint());
                tabForm.setFormHiddenField("ResultsListContext.SortType", this.statisticsEvolutionContext.resultsListContext.sortType());
                tabForm.setFormHiddenField("ResultsListContext.EntryPoint", this.statisticsEvolutionContext.resultsListContext.entryPoint());
                tabForm.setFormHiddenField("ResultsListContext.SearchString", this.statisticsEvolutionContext.resultsListContext.searchString());
                tabForm.setFormHiddenField("ResultsListContext.ProductIds", this.statisticsEvolutionContext.resultsListContext.productIds());
                tabForm.setFormHiddenField("ResultsListContext.CountryCodes", this.statisticsEvolutionContext.resultsListContext.countryCodes());
                tabForm.setFormHiddenField("ResultsListContext.CompanyIds", this.statisticsEvolutionContext.resultsListContext.companyIds());
                tabForm.setFormHiddenField("ResultsListContext.PackTypeIds", this.statisticsEvolutionContext.resultsListContext.packTypeIds());
                tabForm.setFormHiddenField("ResultsListContext.ClosureTypeIds", this.statisticsEvolutionContext.resultsListContext.closureTypeIds());
                tabForm.setFormHiddenField("ResultsListContext.NutrientTypeIds", this.statisticsEvolutionContext.resultsListContext.nutrientTypeIds());
                tabForm.setFormHiddenField("ResultsListContext.EthicalTypeIds", this.statisticsEvolutionContext.resultsListContext.ethicalTypeIds());
                tabForm.setFormHiddenField("ResultsListContext.BrandIds", this.statisticsEvolutionContext.resultsListContext.brandIds());
                tabForm.setFormHiddenField("ResultsListContext.SurveyIds", this.statisticsEvolutionContext.resultsListContext.surveyIds());
                tabForm.setFormHiddenField("ResultsListContext.ForeignMarketIds", this.statisticsEvolutionContext.resultsListContext.foreignMarketIds());
                tabForm.setFormHiddenField("ResultsListContext.SearchType", this.statisticsEvolutionContext.resultsListContext.searchType());
            }
            tabForm.setFormHiddenField("SelectedContext", '@ContextType.ResultsList');
            tabForm.setFormHiddenField("IsBetaFooterEnable", 'True');
            var postData = tabForm.serialize();
            postData += "&companyIds=" + this.statisticsEvolutionContext.companyIds;
            postData += "&productIds=" + this.statisticsEvolutionContext.productIds;
            postData += "&countryCodes=" + this.statisticsEvolutionContext.countryCodes;
            postData += "&brandIds=" + this.statisticsEvolutionContext.brandIds;
            postData += "&measureTypeId=" + this.statisticsEvolutionContext.measureTypeId;
            postData += "&statisticItemIds=" + this.statisticsEvolutionContext.statisticItemIds;
            if (this.statisticsEvolutionContext.resultsListContext != null) {
                postData += "&searchType=" + this.statisticsEvolutionContext.resultsListContext.searchType();
            }
            else {
                postData += "&searchType=" + Search.SearchType.NotSet;
            }
            var buildContextUrl = self.getBaseUrl("/statistics/buildstatisticscontextforresultslist");
            $.ajax({
                url: buildContextUrl,
                type: 'POST',
                data: postData,
                success: function (response) {
                    var successRedirectUrl = self.getBaseUrl("/statistics/tab");
                    var queryString = $.param($.toViewModel(response));
                    $.postAsForm(successRedirectUrl, decodeURIComponent(queryString));
                }
            });
        };
        StatisticsContextSwitching.prototype.backToOldStatistics = function () {
            var self = this;
            var postData = "&productIds=" + self.statisticsEvolutionContext.productIds;
            postData += "&measureTypeId=" + self.statisticsEvolutionContext.measureTypeId;
            postData += "&rankOption=" + self.statisticsEvolutionContext.rankOption;
            postData += "&timePeriod=" + self.statisticsEvolutionContext.timePeriod;
            postData += "&isBetaFooterEnable=" + true;
            switch (self.statisticsEvolutionContext.entryPoint) {
                case Search.EntryPoint.TopCountries:
                    var url = self.getBaseUrl("/statistics/RankCountries");
                    break;
                case Search.EntryPoint.TopCategories:
                    postData += "&countryCodes=" + self.statisticsEvolutionContext.countryCodes;
                    var url = self.getBaseUrl("/statistics/RankCategories");
                    break;
                case Search.EntryPoint.TopCities:
                    var url = self.getBaseUrl("/statistics/RankTopCities");
                    break;
                case Search.EntryPoint.AllCities:
                    var url = self.getBaseUrl("/statistics/RankAllCities");
                    break;
                default:
                    $.ajax({
                        url: self.getBaseUrl("/statistics/BuildTabContextFromStatisticsEvolutionContext"),
                        type: 'POST',
                        data: self.statisticsEvolutionContext.toFormDataString(),
                        success: function (response) {
                            var successRedirectUrl = self.getBaseUrl("/statistics/tab");
                            var queryString = $.param($.toViewModel(response));
                            $.postAsForm(successRedirectUrl, decodeURIComponent(queryString));
                        }
                    });
                    return;
            }
            $.postAsForm(url, postData);
        };
        return StatisticsContextSwitching;
    }(StatisticsEvolution.BaseStatisticsEvolution));
    StatisticsEvolution.StatisticsContextSwitching = StatisticsContextSwitching;
})(StatisticsEvolution || (StatisticsEvolution = {}));
//# sourceMappingURL=StatisticsContextSwitching.js.map;
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var StatisticsEvolution;
(function (StatisticsEvolution) {
    var StatisticsUsage = (function (_super) {
        __extends(StatisticsUsage, _super);
        function StatisticsUsage(title, statisticsEvolutionContext) {
            _super.call(this);
            var self = this;
            self.toFormDataString = function () {
                var jsonSelf = JSON.parse(ko.toJSON(self));
                return decodeURIComponent($.param(jsonSelf));
            };
            self.measureTypeId = statisticsEvolutionContext.measureTypeId;
            self.projectCodes = statisticsEvolutionContext.projectCodes;
            self.productIds = statisticsEvolutionContext.productIds;
            self.countryCodes = statisticsEvolutionContext.countryCodes;
            self.dataTypeIds = statisticsEvolutionContext.dataTypeIds;
            self.years = statisticsEvolutionContext.years;
            self.currencyConversionId = statisticsEvolutionContext.currencyConversionId;
            self.inflationAdjustmentCode = statisticsEvolutionContext.inflationAdjustmentCode;
            self.volumeConversionId = statisticsEvolutionContext.volumeConversionId;
            self.growthType = statisticsEvolutionContext.growthType;
            self.unitMultiplier = statisticsEvolutionContext.unitMultiplier;
            self.companyIds = statisticsEvolutionContext.companyIds;
            self.brandIds = statisticsEvolutionContext.brandIds;
            self.unitPriceId = statisticsEvolutionContext.unitPriceId;
            self.ownerTypeId = statisticsEvolutionContext.ownerTypeId;
            self.unitTypeId = statisticsEvolutionContext.unitTypeId;
            self.perCapitaId = statisticsEvolutionContext.perCapitaId;
            self.rankOption = statisticsEvolutionContext.rankOption;
            self.timePeriod = statisticsEvolutionContext.timePeriod;
            self.totalRows = statisticsEvolutionContext.totalRows;
            if (statisticsEvolutionContext.resultsListContext != null) {
                self.searchString = statisticsEvolutionContext.resultsListContext.searchString();
            }
            self.title = title;
        }
        StatisticsUsage.prototype.recordStatisticsUsage = function (outputPage) {
            var self = this;
            var successRedirectUrl = self.getBaseUrl("/StatisticsEvolution/RecordUsageAsync");
            var outputPage = outputPage;
            $.ajax({
                url: successRedirectUrl,
                type: 'POST',
                data: self.toFormDataString() + '&outputPage=' + outputPage,
            });
        };
        return StatisticsUsage;
    }(StatisticsEvolution.BaseStatisticsEvolution));
    StatisticsEvolution.StatisticsUsage = StatisticsUsage;
})(StatisticsEvolution || (StatisticsEvolution = {}));
//# sourceMappingURL=StatisticsUsage.js.map;
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var StatisticsEvolution;
(function (StatisticsEvolution) {
    var StatisticsEvolutionValidation = (function (_super) {
        __extends(StatisticsEvolutionValidation, _super);
        function StatisticsEvolutionValidation() {
            _super.apply(this, arguments);
        }
        StatisticsEvolutionValidation.prototype.checkMaxRowsValidationForChangeStats = function (measureTypeId, productIds, countryCodes, coredataTypeIds, ownerTypeId, companyIds, brandIds) {
            var self = this;
            var isRecordLessThanThreshold = false;
            if (self.isNewGrid(measureTypeId)) {
                $.ajax({
                    async: false,
                    url: self.getBaseUrl("/StatisticsEvolution/CheckMaxRowsValidationAsync"),
                    type: 'POST',
                    data: {
                        'MeasureTypeId': measureTypeId,
                        'ProductIds': productIds,
                        'CountryCodes': countryCodes,
                        'CompanyIds': companyIds,
                        'BrandIds': brandIds,
                        'OwnerTypeId': ownerTypeId,
                        'CoreDataTypeIds': coredataTypeIds
                    },
                    success: function (response) {
                        if (response === "") {
                            isRecordLessThanThreshold = true;
                        }
                        else {
                            isRecordLessThanThreshold = false;
                            DisplayFooterMessage(response);
                        }
                    }
                });
            }
            else {
                isRecordLessThanThreshold = true;
            }
            return isRecordLessThanThreshold;
        };
        return StatisticsEvolutionValidation;
    }(StatisticsEvolution.BaseStatisticsEvolution));
    StatisticsEvolution.StatisticsEvolutionValidation = StatisticsEvolutionValidation;
})(StatisticsEvolution || (StatisticsEvolution = {}));
//# sourceMappingURL=StatisticsEvolutionValidation.js.map;
var StatisticsEvolution;
(function (StatisticsEvolution) {
    (function (WellKnownMeasureTypeEnum) {
        WellKnownMeasureTypeEnum[WellKnownMeasureTypeEnum["MarketSizes"] = 124] = "MarketSizes";
        WellKnownMeasureTypeEnum[WellKnownMeasureTypeEnum["CompanyShares"] = 4] = "CompanyShares";
        WellKnownMeasureTypeEnum[WellKnownMeasureTypeEnum["BrandShares"] = 119] = "BrandShares";
    })(StatisticsEvolution.WellKnownMeasureTypeEnum || (StatisticsEvolution.WellKnownMeasureTypeEnum = {}));
    var WellKnownMeasureTypeEnum = StatisticsEvolution.WellKnownMeasureTypeEnum;
})(StatisticsEvolution || (StatisticsEvolution = {}));
//# sourceMappingURL=WellKnownMeasureTypeEnum.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
var Search;
(function (Search) {
    var Tree;
    (function (Tree) {
        var BaseTreeSearchViewModel = (function () {
            function BaseTreeSearchViewModel(initialData) {
                var self = this;
                self.selectedCategoryIds = ko.observableArray([]);
                self.selectedCountryCodes = ko.observableArray([]);
                self.selectedCompanyIds = ko.observableArray([]);
                self.selectedClosureIds = ko.observableArray([]);
                self.selectedPackagingIds = ko.observableArray([]);
                self.selectedEthicalTypeIds = ko.observableArray([]);
                self.selectedSurveyIds = ko.observableArray([]);
                self.selectedBrandIds = ko.observableArray([]);
                self.selectedNutrientIds = ko.observableArray([]);
                self.selectedForeignMarketIds = ko.observableArray([]);
                self.expandedCategoryIds = ko.observableArray([]);
                self.parentId = ko.observable("");
                self.hasFooterErrorMessage = ko.observable(false);
                self.summary = ko.observableArray([]);
                self.isSummaryLoading = ko.observable(false);
                self.isCategoryTabEnabled = ko.observable(true);
                self.isGeographyTabEnabled = ko.observable(true);
                self.isChildNodeFound = ko.observable(false);
                self.tabStyle = function (tab) {
                    return self.tabStyleInternal(tab);
                };
                self.tabNumberStyle = function (tab) {
                    return self.tabNumberStyleInternal(tab);
                };
                self.buttonStyle = function () {
                    return self.buttonStyleInternal();
                };
                self.checkBoxStyle = function () {
                    return self.checkBoxStyleInternal();
                };
                self.radioButtonStyle = function () {
                    return self.radioButtonStyleInternal();
                };
                self.buildTreeView = function (data) {
                    return self.buildTreeViewInternal(data);
                };
                self.mapObservablesFromHiddenField(initialData);
                self.mapObservablesToHiddenField();
                self.htmlBrowserDetectClass = $('html').attr("class");
            }
            // #region KO Methods Binding
            BaseTreeSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result;
                if (tab != self.activeSearch) {
                    result = "is-enabled";
                }
                else {
                    result = "is-active";
                }
                return result;
            };
            BaseTreeSearchViewModel.prototype.tabNumberStyleInternal = function (tab) {
                var self = this;
                var result = "em-tabs__status";
                if ((tab === Search.ActiveSearch.CategoriesAndTopics && self.selectedCategoryIds().length > 0) ||
                    (tab === Search.ActiveSearch.Geography && self.selectedCountryCodes().length > 0) ||
                    (tab === Search.ActiveSearch.Companies && self.selectedCompanyIds().length > 0) ||
                    (tab === Search.ActiveSearch.ClosureType && self.selectedClosureIds().length > 0) ||
                    (tab === Search.ActiveSearch.Packaging && self.selectedPackagingIds().length > 0) ||
                    (tab === Search.ActiveSearch.EthicalLabels && self.selectedEthicalTypeIds().length > 0) ||
                    (tab === Search.ActiveSearch.Survey && self.selectedSurveyIds().length > 0) ||
                    (tab === Search.ActiveSearch.Brands && self.selectedBrandIds().length > 0) ||
                    (tab === Search.ActiveSearch.Nutrition && self.selectedNutrientIds().length > 0) ||
                    (tab === Search.ActiveSearch.ForeignMarket && self.selectedForeignMarketIds().length > 0)) {
                    result += " is-ready";
                }
                else {
                    result += " is-pending";
                }
                return result;
            };
            BaseTreeSearchViewModel.prototype.buttonStyleInternal = function () {
                return "em-btn-1-submit--small em-layout--right";
            };
            BaseTreeSearchViewModel.prototype.checkBoxStyleInternal = function () {
                var self = this;
                if (self.htmlBrowserDetectClass.indexOf('k-ie8') > 0) {
                    return "";
                }
                return "is-not-ie8";
            };
            BaseTreeSearchViewModel.prototype.radioButtonStyleInternal = function () {
                var self = this;
                if (self.htmlBrowserDetectClass.indexOf('k-ie8') > 0) {
                    return "";
                }
                return "is-not-ie8";
            };
            BaseTreeSearchViewModel.prototype.buildTreeViewInternal = function (data) {
                var searchItems = [];
                var self = this;
                _.each(data, function (searchTreeItems) {
                    //Add categoryNode to the top of each category products list
                    var categoryNode = {
                        Id: searchTreeItems.SearchItem[0].ParentId,
                        Name: searchTreeItems.Group,
                        ParentId: 0,
                        IsEnabled: false,
                        HasChildren: true,
                        HasDefinition: false,
                        CanSelectSubCategories: false,
                        IsChildrenChecked: false,
                        IsExpanded: true,
                        Children: ko.observableArray([])
                    };
                    searchTreeItems.SearchItem.unshift(categoryNode);
                    //Add temporary parent and id for showing items in tree view
                    var initialId = 1;
                    _.each(searchTreeItems.SearchItem, function (product) {
                        _.each(searchTreeItems.SearchItem, function (anotherProduct) {
                            if (anotherProduct.ParentId === product.Id) {
                                anotherProduct.TempParent = initialId;
                            }
                        });
                        if (product.TempParent == null) {
                            product.TempParent = 0;
                        }
                        product.TempId = initialId++;
                        product.Children = ko.observableArray([]);
                    });
                    var root = {
                        Id: null,
                        Name: null,
                        ParentId: null,
                        IsEnabled: true,
                        HasChildren: false,
                        HasDefinition: false,
                        CanSelectSubCategories: false,
                        IsChildrenChecked: false,
                        IsExpanded: true,
                        Children: []
                    };
                    var nodeList = { 0: root };
                    //Add items to children of parents
                    for (var i = 0; i < searchTreeItems.SearchItem.length; i++) {
                        nodeList[searchTreeItems.SearchItem[i].TempId] = searchTreeItems.SearchItem[i];
                        nodeList[searchTreeItems.SearchItem[i].TempParent].Children.push(nodeList[searchTreeItems.SearchItem[i].TempId]);
                    }
                    var categoryItem = {
                        Group: searchTreeItems.Group,
                        SearchItem: nodeList[0].Children
                    };
                    searchItems.push(categoryItem);
                });
                return searchItems;
            };
            BaseTreeSearchViewModel.prototype.pushChildNodes = function (searchTreeItem, data, productId) {
                var _this = this;
                if (searchTreeItem === void 0) { searchTreeItem = null; }
                if (data === void 0) { data = null; }
                if (productId === void 0) { productId = null; }
                searchTreeItem.some(function (searchItem) {
                    if (searchItem.Id === productId) {
                        _this.isChildNodeFound(true);
                        if (searchItem.IsExpanded) {
                            searchItem.IsExpanded = false;
                        }
                        else {
                            searchItem.IsExpanded = true;
                            searchItem.Children = ko.observableArray();
                            _.each(data, function (child) {
                                _.each(child.SearchItem, function (childProduct) {
                                    searchItem.Children.push({
                                        "Id": childProduct.Id,
                                        "Name": childProduct.Name,
                                        "ParentId": childProduct.ParentId,
                                        "IsEnabled": childProduct.IsEnabled,
                                        "HasChildren": childProduct.HasChildren,
                                        "HasDefinition": childProduct.HasDefinition,
                                        "CanSelectSubCategories": childProduct.CanSelectSubCategories,
                                        "IsExpanded": childProduct.IsExpanded,
                                        "IsChildrenChecked": childProduct.IsChildrenChecked,
                                        "Children": ko.observableArray()
                                    });
                                });
                            });
                        }
                    }
                    else if (searchItem.HasChildren && searchItem.Children != null) {
                        _this.pushChildNodes(searchItem.Children(), data, productId);
                    }
                    //break the loop 
                    return _this.isChildNodeFound();
                });
            };
            BaseTreeSearchViewModel.prototype.mapObservablesFromHiddenField = function (initialData) {
                var self = this;
                if (initialData.SelectedCategoryIds != null) {
                    var underlyingSelectedCategoryIds = [];
                    _.each(initialData.SelectedCategoryIds.split(','), function (productId) {
                        underlyingSelectedCategoryIds.push(productId);
                    });
                    self.selectedCategoryIds.push.apply(self.selectedCategoryIds, underlyingSelectedCategoryIds);
                }
                if (initialData.SelectedCountryCodes != null) {
                    var underlyingSelectedCountryCodes = [];
                    _.each(initialData.SelectedCountryCodes.split(','), function (countryCode) {
                        underlyingSelectedCountryCodes.push(countryCode);
                    });
                    self.selectedCountryCodes.push.apply(self.selectedCountryCodes, underlyingSelectedCountryCodes);
                }
                if (initialData.SelectedCompanyIds != null) {
                    var underlyingSelectedCompanyIds = [];
                    _.each(initialData.SelectedCompanyIds.split(','), function (companyId) {
                        underlyingSelectedCompanyIds.push(companyId);
                    });
                    self.selectedCompanyIds.push.apply(self.selectedCompanyIds, underlyingSelectedCompanyIds);
                }
                if (initialData.SelectedBrandIds != null) {
                    var underlyingSelectedBrandIds = [];
                    _.each(initialData.SelectedBrandIds.split(','), function (brandId) {
                        underlyingSelectedBrandIds.push(brandId);
                    });
                    self.selectedBrandIds.push.apply(self.selectedBrandIds, underlyingSelectedBrandIds);
                }
                if (initialData.SelectedClosureIds != null) {
                    var underlyingSelectedClosureIds = [];
                    _.each(initialData.SelectedClosureIds.split(','), function (closureId) {
                        underlyingSelectedClosureIds.push(closureId);
                    });
                    self.selectedClosureIds.push.apply(self.selectedClosureIds, underlyingSelectedClosureIds);
                }
                if (initialData.SelectedPackagingIds != null) {
                    var underlyingSelectedPackagingIds = [];
                    _.each(initialData.SelectedPackagingIds.split(','), function (packagingId) {
                        underlyingSelectedPackagingIds.push(packagingId);
                    });
                    self.selectedPackagingIds.push.apply(self.selectedPackagingIds, underlyingSelectedPackagingIds);
                }
                if (initialData.SelectedEthicalTypeIds != null) {
                    var underlyingSelectedEthicalTypeIds = [];
                    _.each(initialData.SelectedEthicalTypeIds.split(','), function (ethicalTypeId) {
                        underlyingSelectedEthicalTypeIds.push(ethicalTypeId);
                    });
                    self.selectedEthicalTypeIds.push.apply(self.selectedEthicalTypeIds, underlyingSelectedEthicalTypeIds);
                }
                if (initialData.SelectedSurveyIds != null) {
                    var underlyingSelectedSurveyIds = [];
                    _.each(initialData.SelectedSurveyIds.split(','), function (surveyId) {
                        underlyingSelectedSurveyIds.push(surveyId);
                    });
                    self.selectedSurveyIds.push.apply(self.selectedSurveyIds, underlyingSelectedSurveyIds);
                }
                if (initialData.SelectedNutrientIds != null) {
                    var underlyingSelectedNutrientIds = [];
                    _.each(initialData.SelectedNutrientIds.split(','), function (nutrientId) {
                        underlyingSelectedNutrientIds.push(nutrientId);
                    });
                    self.selectedNutrientIds.push.apply(self.selectedNutrientIds, underlyingSelectedNutrientIds);
                }
                if (initialData.SelectedForeignMarketIds != null) {
                    var underlyingSelectedForeignMarketIds = [];
                    _.each(initialData.SelectedForeignMarketIds.split(','), function (foreignMarketId) {
                        underlyingSelectedForeignMarketIds.push(foreignMarketId);
                    });
                    self.selectedForeignMarketIds.push.apply(self.selectedForeignMarketIds, underlyingSelectedForeignMarketIds);
                }
                if (initialData.ExpandedCategoryIds != null) {
                    var underlyingExpandedCategoryIds = [];
                    _.each(initialData.ExpandedCategoryIds.split(','), function (expandedCategoryId) {
                        underlyingExpandedCategoryIds.push(expandedCategoryId);
                    });
                    self.expandedCategoryIds.push.apply(self.expandedCategoryIds, underlyingExpandedCategoryIds.reverse());
                    self.shouldExpand = ko.computed(function () {
                        return self.expandedCategoryIds().length > 0;
                    });
                }
                if (initialData.ParentId != null) {
                    self.parentId = ko.observable(initialData.ParentId);
                }
            };
            BaseTreeSearchViewModel.prototype.mapObservablesToHiddenField = function () {
                var self = this;
                self.categoryIds = ko.computed(function () {
                    return self.selectedCategoryIds().join(',');
                });
                self.countryCodes = ko.computed(function () {
                    return self.selectedCountryCodes().join(',');
                });
                self.companyIds = ko.computed(function () {
                    return self.selectedCompanyIds().join(',');
                });
                self.brandIds = ko.computed(function () {
                    return self.selectedBrandIds().join(',');
                });
                self.closureIds = ko.computed(function () {
                    return self.selectedClosureIds().join(',');
                });
                self.packagingIds = ko.computed(function () {
                    return self.selectedPackagingIds().join(',');
                });
                self.ethicalTypeIds = ko.computed(function () {
                    return self.selectedEthicalTypeIds().join(',');
                });
                self.surveyIds = ko.computed(function () {
                    return self.selectedSurveyIds().join(',');
                });
                self.nutrientIds = ko.computed(function () {
                    return self.selectedNutrientIds().join(',');
                });
                self.foreignMarketIds = ko.computed(function () {
                    return self.selectedForeignMarketIds().join(',');
                });
            };
            // #endregion 
            // #region  public methods
            BaseTreeSearchViewModel.prototype.displayFooterMessage = function (msg) {
                var self = this;
                var footerDiv = $("<div id='globalFooter' class='footerMessage'>");
                footerDiv.append("<span id='footerCloseButton' class='footerClose'></span>");
                footerDiv.append("<p>" + msg + "</p>");
                footerDiv.append("</div>");
                var footer = $("#globalFooter");
                if (footer.length > 0) {
                    footer.remove();
                }
                $("body .em-fixed-footer").append(footerDiv);
                $("#footerCloseButton").click(function () {
                    var footerMsgDiv = $("#globalFooter");
                    if (footerMsgDiv.length > 0) {
                        footerMsgDiv.remove();
                    }
                    self.hasFooterErrorMessage(false);
                });
                self.hasFooterErrorMessage(true);
            };
            BaseTreeSearchViewModel.prototype.clearFooterMessage = function () {
                var footerCloseButton = $("#footerCloseButton");
                if (footerCloseButton.length > 0) {
                    footerCloseButton.click();
                }
            };
            BaseTreeSearchViewModel.prototype.getSelectedIds = function () {
                var self = this;
                var selectedIds = null;
                switch (self.searchType) {
                    case Search.SearchType.Companies:
                        selectedIds = self.companyIds();
                        break;
                    case Search.SearchType.Closures:
                        selectedIds = self.closureIds();
                        break;
                    case Search.SearchType.Packaging:
                        selectedIds = self.packagingIds();
                        break;
                    case Search.SearchType.Survey:
                        selectedIds = self.surveyIds();
                        break;
                    case Search.SearchType.Brands:
                        selectedIds = self.brandIds();
                        break;
                    case Search.SearchType.Nutrition:
                        selectedIds = self.nutrientIds();
                        break;
                    case Search.SearchType.ForeignMarket:
                        selectedIds = self.foreignMarketIds();
                        break;
                    case Search.SearchType.EthicalLabels:
                        selectedIds = self.ethicalTypeIds();
                        break;
                }
                return selectedIds;
            };
            BaseTreeSearchViewModel.prototype.getBaseIndex = function (diviser) {
                return (Math.round(diviser) >= diviser) ? Math.round(diviser) : Math.round(diviser) + 1;
            };
            BaseTreeSearchViewModel.prototype.getBaseUrl = function (relativePath) {
                var path = "/" + window.location.pathname.split('/')[1] + relativePath;
                return path;
            };
            BaseTreeSearchViewModel.prototype.getBreadCrumbRootItemName = function () {
                return null;
            };
            return BaseTreeSearchViewModel;
        }());
        Tree.BaseTreeSearchViewModel = BaseTreeSearchViewModel;
    })(Tree = Search.Tree || (Search.Tree = {}));
})(Search || (Search = {}));
//# sourceMappingURL=BaseTreeSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Tree;
    (function (Tree) {
        var CategoryTreeSearchViewModel = (function (_super) {
            __extends(CategoryTreeSearchViewModel, _super);
            function CategoryTreeSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.checkedChildrenList = ko.observableArray([]);
                self.categories = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.CategoriesAndTopics;
                self.searchType = initialData.SearchType;
                self.entryPoint = Search.EntryPoint.TreeSearch;
                self.filterText = ko.observable(initialData.CategoryFilterText);
                self.showNoFilterResultsMessage = ko.observable(false);
                self.showClearButton = ko.observable(false);
                self.showDefinition = function (item, event) {
                    return self.showDefinitionInternal(item, event);
                };
                self.loadSubCategories = function (item) {
                    return self.loadCategories(item);
                };
                self.showNoCategoryMessage = ko.computed(function () {
                    return self.summary().length === 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
                self.applyCategoryFilter = function () {
                    return self.applyCategoryFilterInternal();
                };
                self.clearCategoryFilter = function () {
                    return self.clearCategoryFilterInternal();
                };
                self.highlightFilteredText = function (categoryName) {
                    return self.highlightFilteredTextInternal(categoryName);
                };
                self.selectSubCategories = function (item) {
                    self.selectSubCategoriesInternal(item);
                };
                self.categoryParentIds = ko.computed(function () {
                    return self.checkedChildrenList().join(',');
                });
            }
            CategoryTreeSearchViewModel.prototype.initialize = function () {
                var self = this;
                //Populate categories
                if (self.shouldExpand) {
                    self.loadCategories({ Id: self.parentId });
                }
                else {
                    self.loadCategories();
                }
                self.loadSummary();
                // Event Handler to Hide Definition on Document Click
                $(document).click(function () {
                    $("#DefinitionDiv").empty();
                    $("#DefinitionDiv").hide();
                });
                // Search Section
                $(document).on("click touchstart", "input[id^='product-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addProduct(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeProduct(itemToRemove);
                    }
                });
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeProduct(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedCategoryIds.removeAll();
                    self.summary.removeAll();
                    $(".em-drilldown__select-all").children("span").removeClass('is-checked');
                    $('input:checkbox').removeAttr('checked');
                });
                $(document).on("click touchstart", "#clearFilterButton", function () {
                    $("#categoryFilterTextbox").blur();
                });
            };
            CategoryTreeSearchViewModel.prototype.loadCategories = function (item) {
                var _this = this;
                if (item === void 0) { item = null; }
                var self = this;
                var productId = item == null ? null : item.Id;
                var scrollPosition = $(window).scrollTop();
                if ((self.filterText() && productId != null) || (item != null && item.IsExpanded === true)) {
                    item.IsExpanded = !item.IsExpanded;
                    var tempvar = self.categories();
                    self.categories([]);
                    self.categories(tempvar);
                    $(window).scrollTop(scrollPosition);
                    return;
                }
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/CategorySearchAsync"),
                    data: {
                        searchType: self.searchType,
                        filterText: self.filterText(),
                        selectedIds: self.getSelectedIds(),
                        productId: productId,
                        entryPoint: self.entryPoint
                    },
                    type: "POST"
                }).done(function (data) {
                    if (productId == null || self.filterText() != null) {
                        self.categories([]);
                        self.categories(self.buildTreeView(data));
                    }
                    else {
                        _.each(self.categories(), function (category) {
                            if (_this.isChildNodeFound() == false) {
                                _this.pushChildNodes(category.SearchItem, data, productId);
                            }
                        });
                        _this.isChildNodeFound(false);
                        var categoryData = self.categories().slice(0);
                        self.categories([]);
                        self.categories(categoryData);
                    }
                    self.showNoFilterResultsMessage(data.length == 0);
                }).then(function () {
                    $(window).scrollTop(scrollPosition);
                });
            };
            CategoryTreeSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedCategoryIds != null && self.selectedCategoryIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/CategorySummary"),
                        data: {
                            selectedIds: self.categoryIds,
                            searchType: self.searchType
                        },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        _.each(data, function (dataItem) {
                            underlyingSummary.push({ id: dataItem.id, name: dataItem.name });
                        });
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            CategoryTreeSearchViewModel.prototype.loadPredefinedCategories = function (predefinedCategoryIds) {
                var self = this;
                if (predefinedCategoryIds != null) {
                    self.isSummaryLoading(true);
                    // Push to Search Section
                    var underlyingSelectedCategoryIds = [];
                    _.each(predefinedCategoryIds.split(','), function (productId) {
                        underlyingSelectedCategoryIds.push(productId);
                    });
                    self.selectedCategoryIds.removeAll();
                    self.selectedCategoryIds.push.apply(self.selectedCategoryIds, underlyingSelectedCategoryIds);
                    // Push to Summary Section
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/CategorySummary"),
                        data: {
                            selectedIds: self.categoryIds,
                            searchType: self.searchType
                        },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.removeAll();
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            CategoryTreeSearchViewModel.prototype.checkChildren = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.checkedChildrenList(), function (item) { return item === itemToAdd; });
                if (itemAlreadySelected === null) {
                    self.checkedChildrenList.push(itemToAdd);
                }
                else {
                    self.checkedChildrenList.remove(itemToAdd);
                }
                return true;
            };
            CategoryTreeSearchViewModel.prototype.addProduct = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            CategoryTreeSearchViewModel.prototype.removeProduct = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedCategoryIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            CategoryTreeSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            // #region KO Methods Binding
            CategoryTreeSearchViewModel.prototype.showDefinitionInternal = function (item, event) {
                var self = this;
                var element = $(event.target);
                var container = $('.em-tree');
                var posLeft = element.parent().position().left;
                var posTop = element.parent().offset().top - container.offset().top;
                $.ajax({
                    url: self.getBaseUrl("/Search/Definition"),
                    type: "POST",
                    data: {
                        ProductId: item.Id
                    }
                }).done(function (data) {
                    $("#DefinitionDiv").show();
                    $("#DefinitionDiv").empty();
                    $("#DefinitionDiv").append("<a class='em-popup__close'></a>")
                        .append("<div>" + data + "</div>");
                    $("#DefinitionDiv").css({
                        top: posTop + 39 + 'px',
                        right: 0
                    });
                });
            };
            CategoryTreeSearchViewModel.prototype.applyCategoryFilterInternal = function () {
                var self = this;
                self.clearFooterMessage();
                var minFilterLength = 3;
                var maxFilterLength = 254;
                if (self.filterText() == null || self.filterText().length === 0) {
                    self.displayFooterMessage("Please enter keywords to search");
                    return;
                }
                if (self.filterText().length < minFilterLength
                    || self.filterText().length > maxFilterLength) {
                    self.displayFooterMessage("Please enter a minimum of " + minFilterLength +
                        " and a maximum of " + maxFilterLength + " characters for keyword Search");
                    return;
                }
                self.showClearButton(true);
                self.loadCategories();
            };
            CategoryTreeSearchViewModel.prototype.clearCategoryFilterInternal = function () {
                var self = this;
                self.filterText(null);
                self.showClearButton(false);
                self.loadCategories();
            };
            CategoryTreeSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.Geography:
                        if (self.selectedCategoryIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            CategoryTreeSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedCategoryIds().length == 0 || self.selectedCountryCodes().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            CategoryTreeSearchViewModel.prototype.highlightFilteredTextInternal = function (categoryName) {
                var self = this;
                if (self.filterText() != null) {
                    var filteredTextLowerCase = self.filterText().toLowerCase().trim();
                    var categoryNameLowerCase = categoryName.toLowerCase().trim();
                    var matchedStringLowerCase = categoryNameLowerCase.match(filteredTextLowerCase);
                    if (matchedStringLowerCase != null && matchedStringLowerCase.length >= 1) {
                        var indexOfMatchedString = categoryNameLowerCase.indexOf(matchedStringLowerCase.toString());
                        var matchedStringOrignalCase = categoryName.substr(indexOfMatchedString, matchedStringLowerCase.toString().length);
                        var regex = new RegExp(matchedStringOrignalCase.toString(), "g");
                        var formattedCategoryName = categoryName.replace(regex, '<strong>' + matchedStringOrignalCase.toString() + '</strong>');
                        return formattedCategoryName;
                    }
                }
                return categoryName;
            };
            CategoryTreeSearchViewModel.prototype.selectSubCategoriesInternal = function (categoryId) {
                var _this = this;
                var self = this;
                self.checkChildren(categoryId);
                var isSelectAllChecked = $("#selectSubCategories" + categoryId).is(':checked');
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/SubCategorySearchAsync"),
                    data: {
                        searchType: self.searchType,
                        productId: categoryId,
                        selectedIds: self.getSelectedIds(),
                        filterText: self.filterText()
                    },
                    type: "POST"
                }).done(function (data) {
                    var underlyingSummary = ko.observableArray(self.summary());
                    var underlyingSelectedCategoryIds = ko.observableArray(self.selectedCategoryIds());
                    if (isSelectAllChecked) {
                        _.each(data, function (dataItem) {
                            if (_.contains(_this.selectedCategoryIds(), dataItem.ProductId) == false) {
                                underlyingSelectedCategoryIds.push(dataItem.ProductId);
                            }
                            var itemAlreadySelected = ko.utils.arrayFirst(_this.summary(), function (item) { return item.id === dataItem.ProductId; });
                            if (itemAlreadySelected === null) {
                                underlyingSummary.push({ id: dataItem.ProductId, name: dataItem.ProductName });
                            }
                        });
                        self.isSummaryLoading(false);
                        $("#selectSubCategories" + categoryId).prop('checked', true); // For IE8 
                    }
                    else {
                        _.each(data, function (dataItem) {
                            underlyingSummary.remove(function (element) { return element.id == dataItem.ProductId; });
                            underlyingSelectedCategoryIds.remove(dataItem.ProductId);
                        });
                        $("#selectSubCategories" + categoryId).prop('checked', false); // For IE8 
                    }
                    self.selectedCategoryIds.valueHasMutated(); //syncing self.selectedCategoryIds and underlyingSelectedCategoryIds
                    self.summary.valueHasMutated();
                    self.scrollSummaryArea();
                });
            };
            return CategoryTreeSearchViewModel;
        }(Search.Tree.BaseTreeSearchViewModel));
        Tree.CategoryTreeSearchViewModel = CategoryTreeSearchViewModel;
    })(Tree = Search.Tree || (Search.Tree = {}));
})(Search || (Search = {}));
//# sourceMappingURL=CategoryTreeSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Tree;
    (function (Tree) {
        var GeographyTreeSearchViewModel = (function (_super) {
            __extends(GeographyTreeSearchViewModel, _super);
            function GeographyTreeSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.geographies = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.Geography;
                self.searchType = initialData.SearchType;
                self.showNoFilterResultsMessage = ko.observable(false);
                self.countryFilterText = ko.observable(initialData.CountryFilterText);
                self.showClearButton = ko.observable(false);
                self.entryPoint = Search.EntryPoint.TreeSearch;
                self.checkedChildrenList = ko.observableArray([]);
                self.isChildNodeFound = ko.observable(false);
                self.loadSubGeographies = function (item) {
                    return self.loadGeographies(item);
                };
                self.showNoGeographyMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
                self.applyGeographyFilter = function () {
                    return self.applyGeographyFilterInternal();
                };
                self.clearGeographyFilter = function () {
                    return self.clearGeographyFilterInternal();
                };
                self.highlightFilteredText = function (geographyName) {
                    return self.highlightFilteredTextInternal(geographyName);
                };
                self.geographyParentIds = ko.computed(function () {
                    return self.checkedChildrenList().join(',');
                });
                self.selectSubGeographies = function (item) {
                    self.selectSubGeographiesInternal(item);
                };
            }
            GeographyTreeSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadGeographies();
                self.loadSummary();
                // Event Handler to Hide Definition on Document Click
                $(document).click(function () {
                    $("#DefinitionDiv").empty();
                    $("#DefinitionDiv").hide();
                });
                $(document).on("click touchstart", "input[id^='geography-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addGeography(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeGeography(itemToRemove);
                    }
                });
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeGeography(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedCountryCodes.removeAll();
                    self.summary.removeAll();
                    $(".em-drilldown__select-all").children("span").removeClass('is-checked');
                    $('input:checkbox').removeAttr('checked');
                });
            };
            GeographyTreeSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedCountryCodes().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            GeographyTreeSearchViewModel.prototype.loadGeographies = function (item) {
                var _this = this;
                if (item === void 0) { item = null; }
                var self = this;
                var countryCode = item == null ? undefined : item.Id;
                var scrollPosition = $(window).scrollTop();
                if (self.countryFilterText() && countryCode != null || (item != null && item.IsExpanded === true)) {
                    item.IsExpanded = !item.IsExpanded;
                    var filteredGeography = self.geographies();
                    self.geographies([]);
                    self.geographies(filteredGeography);
                    $(window).scrollTop(scrollPosition);
                    return;
                }
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/GeographySearchAsync"),
                    data: {
                        searchType: self.searchType,
                        selectedProductIds: self.categoryIds(),
                        selectedIds: self.getSelectedIds(),
                        selectedCountryCodes: countryCode == '0' ? undefined : countryCode,
                        filterText: self.countryFilterText(),
                        entryPoint: self.entryPoint
                    },
                    type: "POST"
                }).done(function (data) {
                    if (countryCode == null || self.countryFilterText() != null) {
                        self.geographies([]);
                        self.geographies(self.buildTreeView(data));
                    }
                    else {
                        _.each(self.geographies(), function (geography) {
                            if (_this.isChildNodeFound() == false) {
                                _this.pushChildNodes(geography.SearchItem, data, countryCode);
                            }
                        });
                        _this.isChildNodeFound(false);
                        var geographyData = self.geographies().slice(0);
                        self.geographies([]);
                        self.geographies(geographyData);
                    }
                    self.showNoFilterResultsMessage(data.length == 0);
                }).then(function () {
                    $(window).scrollTop(scrollPosition);
                });
            };
            GeographyTreeSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedCountryCodes != null && self.selectedCountryCodes().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/GeographySummary"),
                        data: { selectedIds: self.countryCodes }
                    }).done(function (data) {
                        var underlyingSummary = [];
                        _.each(data, function (dataItem) {
                            underlyingSummary.push({ id: dataItem.id, name: dataItem.name });
                        });
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            GeographyTreeSearchViewModel.prototype.loadPredefinedGeographies = function (predefinedGeographyIds) {
                var self = this;
                if (predefinedGeographyIds != null) {
                    self.isSummaryLoading(true);
                    // Push to Search Section
                    var underlyingSelectedGeographyIds = [];
                    _.each(predefinedGeographyIds.split(','), function (productId) {
                        underlyingSelectedGeographyIds.push(productId);
                    });
                    self.selectedCountryCodes.removeAll();
                    self.selectedCountryCodes.push.apply(self.selectedCountryCodes, underlyingSelectedGeographyIds);
                    // Push to Summary Section
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/GeographySummary"),
                        data: {
                            selectedIds: self.countryCodes,
                            searchType: self.searchType
                        },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.removeAll();
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            GeographyTreeSearchViewModel.prototype.checkChildren = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.checkedChildrenList(), function (item) { return item == itemToAdd; });
                if (itemAlreadySelected == null) {
                    self.checkedChildrenList.push(itemToAdd);
                }
                else {
                    self.checkedChildrenList.remove(itemToAdd);
                }
                return true;
            };
            GeographyTreeSearchViewModel.prototype.addGeography = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(self.summary(), function (item) { return item.id == itemToAdd.id; });
                if (itemAlreadySelected == null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            GeographyTreeSearchViewModel.prototype.removeGeography = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(self.summary(), function (item) { return item.id == removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedCountryCodes.remove(itemToBeRemoved.id);
                }
                return true;
            };
            GeographyTreeSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            GeographyTreeSearchViewModel.prototype.applyGeographyFilterInternal = function () {
                var self = this;
                self.clearFooterMessage();
                var minFilterLength = 3;
                var maxFilterLength = 254;
                if (self.countryFilterText() == null || self.countryFilterText().length == 0) {
                    self.displayFooterMessage("Please enter keywords to search");
                    return;
                }
                if (self.countryFilterText().length < minFilterLength
                    || self.countryFilterText().length > maxFilterLength) {
                    self.displayFooterMessage("Please enter a minimum of " + minFilterLength +
                        " and a maximum of " + maxFilterLength + " characters for keyword Search");
                    return;
                }
                self.showClearButton(true);
                self.loadGeographies();
            };
            GeographyTreeSearchViewModel.prototype.clearGeographyFilterInternal = function () {
                var self = this;
                self.countryFilterText(null);
                self.showClearButton(false);
                self.loadGeographies();
            };
            GeographyTreeSearchViewModel.prototype.highlightFilteredTextInternal = function (geographyName) {
                var self = this;
                if (self.countryFilterText() != null) {
                    var filteredTextLowerCase = self.countryFilterText().toLowerCase().trim();
                    var geographyNameLowerCase = geographyName.toLowerCase().trim();
                    var matchedStringLowerCase = geographyNameLowerCase.match(filteredTextLowerCase);
                    if (matchedStringLowerCase != null && matchedStringLowerCase.length >= 1) {
                        var indexOfMatchedString = geographyNameLowerCase.indexOf(matchedStringLowerCase.toString());
                        var matchedStringOrignalCase = geographyName.substr(indexOfMatchedString, matchedStringLowerCase.toString().length);
                        var regex = new RegExp(matchedStringOrignalCase.toString(), "g");
                        var formattedGeographyname = geographyName.replace(regex, '<strong>' + matchedStringOrignalCase.toString() + '</strong>');
                        return formattedGeographyname;
                    }
                }
                return geographyName;
            };
            GeographyTreeSearchViewModel.prototype.contractTextBox = function () {
                $('#geographySearchDiv').removeClass('emi-category-search');
                $('#geographySearchDiv').addClass('emi-category-search emi-input-530');
            };
            GeographyTreeSearchViewModel.prototype.expandTextBox = function () {
                $('#geographySearchDiv').removeClass('emi-category-search emi-input-530');
                $('#geographySearchDiv').addClass('emi-category-search');
            };
            GeographyTreeSearchViewModel.prototype.selectSubGeographiesInternal = function (countryCode) {
                var _this = this;
                var self = this;
                var isSelectAllChecked = $("#selectSubGeographies" + countryCode).is(':checked');
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/SubGeographySearchAsync"),
                    data: {
                        searchType: self.searchType,
                        productIds: self.categoryIds(),
                        countryCode: countryCode,
                        selectedIds: self.getSelectedIds(),
                        filterText: self.countryFilterText()
                    },
                    type: "POST"
                }).done(function (data) {
                    var underlyingSummary = ko.observableArray(self.summary());
                    var underlyingSelectedCountryCodes = ko.observableArray(self.selectedCountryCodes());
                    if (isSelectAllChecked) {
                        _.each(data, function (dataItem) {
                            if (_.contains(_this.selectedCountryCodes(), dataItem.CountryCode) == false) {
                                underlyingSelectedCountryCodes.push(dataItem.CountryCode);
                            }
                            var itemAlreadySelected = ko.utils.arrayFirst(_this.summary(), function (item) { return item.id == dataItem.CountryCode; });
                            if (itemAlreadySelected == null) {
                                underlyingSummary.push({ id: dataItem.CountryCode, name: dataItem.CountryName });
                            }
                        });
                        self.isSummaryLoading(false);
                        $("#selectSubGeographies" + countryCode).prop('checked', true); // For IE8 
                    }
                    else {
                        _.each(data, function (dataItem) {
                            underlyingSummary.remove(function (element) { return element.id == dataItem.CountryCode; });
                            underlyingSelectedCountryCodes.remove(dataItem.CountryCode);
                        });
                        $("#selectSubGeographies" + countryCode).prop('checked', false); // For IE8 
                    }
                    self.selectedCountryCodes.valueHasMutated(); //syncing self.selectedCountryCodes and underlyingSelectedCountryCodes
                    self.summary.valueHasMutated();
                    self.scrollSummaryArea();
                });
            };
            return GeographyTreeSearchViewModel;
        }(Tree.BaseTreeSearchViewModel));
        Tree.GeographyTreeSearchViewModel = GeographyTreeSearchViewModel;
    })(Tree = Search.Tree || (Search.Tree = {}));
})(Search || (Search = {}));
//# sourceMappingURL=GeographyTreeSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Tree;
    (function (Tree) {
        var ClosureTreeSearchViewModel = (function (_super) {
            __extends(ClosureTreeSearchViewModel, _super);
            function ClosureTreeSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.closures = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.ClosureType;
                self.searchType = initialData.SearchType;
                self.entryPoint = initialData.EntryPoint;
                self.loadSubClosures = function (item) {
                    return self.loadClosures(item);
                };
                self.showNoClosuresMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
            }
            ClosureTreeSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadClosures();
                self.loadSummary();
                // Search Section
                $(document).on("click touchstart", "input[id^='closure-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addClosure(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeClosure(itemToRemove);
                    }
                });
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeClosure(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedClosureIds.removeAll();
                    self.summary.removeAll();
                });
            };
            ClosureTreeSearchViewModel.prototype.loadClosures = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                if (item != null && item.IsExpanded === true) {
                    item.IsExpanded = !item.IsExpanded;
                    var closureItems = self.closures();
                    self.closures([]);
                    self.closures(closureItems);
                    return;
                }
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/ClosureSearchAsync"),
                    data: {
                        entryPoint: self.entryPoint
                    },
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.closures([]);
                    self.closures(self.buildTreeView(data));
                });
            };
            ClosureTreeSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedClosureIds != null && self.selectedClosureIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/ClosureSummary"),
                        data: { selectedIds: self.closureIds },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            ClosureTreeSearchViewModel.prototype.addClosure = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            ClosureTreeSearchViewModel.prototype.removeClosure = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedClosureIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            ClosureTreeSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            ClosureTreeSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.CategoriesAndTopics:
                        if (self.selectedClosureIds().length == 0) {
                            self.isCategoryTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isCategoryTabEnabled(true);
                        }
                        break;
                    case Search.ActiveSearch.Geography:
                        if (self.selectedCategoryIds().length == 0 || self.selectedClosureIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            ClosureTreeSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedClosureIds().length == 0 || self.selectedCountryCodes().length == 0 || self.selectedCategoryIds().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            return ClosureTreeSearchViewModel;
        }(Tree.BaseTreeSearchViewModel));
        Tree.ClosureTreeSearchViewModel = ClosureTreeSearchViewModel;
    })(Tree = Search.Tree || (Search.Tree = {}));
})(Search || (Search = {}));
//# sourceMappingURL=ClosureTreeSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Tree;
    (function (Tree) {
        var SurveyTreeSearchViewModel = (function (_super) {
            __extends(SurveyTreeSearchViewModel, _super);
            function SurveyTreeSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.surveys = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.Survey;
                self.searchType = initialData.SearchType;
                self.entryPoint = initialData.EntryPoint;
                self.loadSubSurveys = function (item) {
                    return self.loadSurveys(item);
                };
                self.showNoSurveyMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
            }
            SurveyTreeSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadSurveys();
                self.loadSummary();
                // Search Section
                $(document).on("click touchstart", "input[id^='survey-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addSurvey(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeSurvey(itemToRemove);
                    }
                });
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeSurvey(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedSurveyIds.removeAll();
                    self.summary.removeAll();
                });
            };
            SurveyTreeSearchViewModel.prototype.loadSurveys = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                if ((item != null && item.IsExpanded === true)) {
                    item.IsExpanded = !item.IsExpanded;
                    var surveyItems = self.surveys();
                    self.surveys([]);
                    self.surveys(surveyItems);
                    return;
                }
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/SurveySearchAsync"),
                    data: {
                        entryPoint: self.entryPoint
                    },
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.surveys([]);
                    self.surveys(self.buildTreeView(data));
                });
            };
            SurveyTreeSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedSurveyIds != null && self.selectedSurveyIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/SurveySummary"),
                        data: { selectedIds: self.surveyIds },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            SurveyTreeSearchViewModel.prototype.addSurvey = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            SurveyTreeSearchViewModel.prototype.removeSurvey = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedSurveyIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            SurveyTreeSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            SurveyTreeSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.Geography:
                        if (self.selectedSurveyIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            SurveyTreeSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedSurveyIds().length == 0 || self.selectedCountryCodes().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            return SurveyTreeSearchViewModel;
        }(Tree.BaseTreeSearchViewModel));
        Tree.SurveyTreeSearchViewModel = SurveyTreeSearchViewModel;
    })(Tree = Search.Tree || (Search.Tree = {}));
})(Search || (Search = {}));
//# sourceMappingURL=SurveyTreeSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Tree;
    (function (Tree) {
        var NutritionTreeSearchViewModel = (function (_super) {
            __extends(NutritionTreeSearchViewModel, _super);
            function NutritionTreeSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.nutrients = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.Nutrition;
                self.entryPoint = initialData.EntryPoint;
                self.searchType = initialData.SearchType;
                self.showNoNutrientsMessage = ko.computed(function () {
                    return self.summary().length === 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
                self.loadSubNutrients = function (item) {
                    return self.loadNutrients(item);
                };
            }
            NutritionTreeSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadNutrients();
                self.loadSummary();
                // Search Section
                $(document).on("click touchstart", "input[id^='nutrient-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addNutrient(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeNutrient(itemToRemove);
                    }
                });
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeNutrient(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedNutrientIds.removeAll();
                    self.summary.removeAll();
                });
            };
            NutritionTreeSearchViewModel.prototype.loadNutrients = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                if (item != null) {
                    item.IsExpanded = !item.IsExpanded;
                    var copyNutrients = self.nutrients();
                    self.nutrients([]);
                    self.nutrients(copyNutrients);
                    return;
                }
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/NutrientTypeSearchAsync"),
                    data: {
                        entrypoint: self.entryPoint
                    },
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.nutrients([]);
                    self.nutrients(self.buildTreeView(data));
                });
            };
            NutritionTreeSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedNutrientIds != null && self.selectedNutrientIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/NutritionSummary"),
                        data: { selectedIds: self.nutrientIds }
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            NutritionTreeSearchViewModel.prototype.addNutrient = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            NutritionTreeSearchViewModel.prototype.removeNutrient = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedNutrientIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            NutritionTreeSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            NutritionTreeSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.CategoriesAndTopics:
                        if (self.selectedNutrientIds().length == 0) {
                            self.isCategoryTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isCategoryTabEnabled(true);
                        }
                        break;
                    case Search.ActiveSearch.Geography:
                        if (self.selectedNutrientIds().length == 0 || self.selectedCategoryIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            NutritionTreeSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedNutrientIds().length == 0 || self.selectedCountryCodes().length == 0 || self.selectedCategoryIds().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            return NutritionTreeSearchViewModel;
        }(Tree.BaseTreeSearchViewModel));
        Tree.NutritionTreeSearchViewModel = NutritionTreeSearchViewModel;
    })(Tree = Search.Tree || (Search.Tree = {}));
})(Search || (Search = {}));
//# sourceMappingURL=NutritionTreeSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Tree;
    (function (Tree) {
        var ForeignMarketTreeSearchViewModel = (function (_super) {
            __extends(ForeignMarketTreeSearchViewModel, _super);
            function ForeignMarketTreeSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.foreignMarkets = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.ForeignMarket;
                self.searchType = initialData.SearchType;
                self.entryPoint = initialData.EntryPoint;
                self.loadSubForeignMarkets = function (item) {
                    return self.loadForeignMarkets(item);
                };
                self.showNoForeignMarketMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
            }
            ForeignMarketTreeSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadForeignMarkets();
                self.loadSummary();
                // Search Section
                $(document).on("click touchstart", "input[id^='foreignMarket-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addForeignMarket(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeForeignMarket(itemToRemove);
                    }
                });
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeForeignMarket(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedForeignMarketIds.removeAll();
                    self.summary.removeAll();
                });
            };
            ForeignMarketTreeSearchViewModel.prototype.loadForeignMarkets = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                if ((item != null && item.IsExpanded === true)) {
                    item.IsExpanded = !item.IsExpanded;
                    var foreignMarketItems = self.foreignMarkets();
                    self.foreignMarkets([]);
                    self.foreignMarkets(foreignMarketItems);
                    return;
                }
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/ForeignMarketSearchAsync"),
                    data: {
                        entryPoint: self.entryPoint
                    },
                    type: "POST"
                }).done(function (data) {
                    self.foreignMarkets([]);
                    self.foreignMarkets(self.buildTreeView(data));
                });
            };
            ForeignMarketTreeSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedForeignMarketIds != null && self.selectedForeignMarketIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/ForeignMarketSummary"),
                        data: { selectedIds: self.foreignMarketIds },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            ForeignMarketTreeSearchViewModel.prototype.addForeignMarket = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            ForeignMarketTreeSearchViewModel.prototype.removeForeignMarket = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedForeignMarketIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            ForeignMarketTreeSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            ForeignMarketTreeSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.CategoriesAndTopics:
                        if (self.selectedForeignMarketIds().length == 0) {
                            self.isCategoryTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isCategoryTabEnabled(true);
                        }
                        break;
                    case Search.ActiveSearch.Geography:
                        if (self.selectedForeignMarketIds().length == 0 || self.selectedCategoryIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            ForeignMarketTreeSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedForeignMarketIds().length == 0 || self.selectedCountryCodes().length == 0 || self.selectedCategoryIds().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            return ForeignMarketTreeSearchViewModel;
        }(Tree.BaseTreeSearchViewModel));
        Tree.ForeignMarketTreeSearchViewModel = ForeignMarketTreeSearchViewModel;
    })(Tree = Search.Tree || (Search.Tree = {}));
})(Search || (Search = {}));
//# sourceMappingURL=ForeignMarketTreeSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Tree;
    (function (Tree) {
        var PackagingTreeSearchViewModel = (function (_super) {
            __extends(PackagingTreeSearchViewModel, _super);
            function PackagingTreeSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.packages = ko.observableArray([]);
                self.checkedChildrenList = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.Packaging;
                self.searchType = initialData.SearchType;
                self.entryPoint = initialData.EntryPoint;
                ;
                self.loadSubPackages = function (item) {
                    return self.loadPackages(item);
                };
                self.showNoPackagingMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
                self.selectSubPackTypes = function (item) {
                    self.selectSubPackTypesInternal(item);
                };
                self.packTypeParentIds = ko.computed(function () {
                    return self.checkedChildrenList().join(',');
                });
            }
            PackagingTreeSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadPackages();
                self.loadSummary();
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removePackaging(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedPackagingIds.removeAll();
                    self.summary.removeAll();
                    $(".em-drilldown__select-all").children("span").removeClass('is-checked');
                    $('input:checkbox').removeAttr('checked');
                });
                // Search Section
                $(document).on("click touchstart", "input[id^='packaging-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addPackaging(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removePackaging(itemToRemove);
                    }
                });
            };
            PackagingTreeSearchViewModel.prototype.checkChildren = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.checkedChildrenList(), function (item) { return item === itemToAdd; });
                if (itemAlreadySelected === null) {
                    self.checkedChildrenList.push(itemToAdd);
                }
                else {
                    self.checkedChildrenList.remove(itemToAdd);
                }
                return true;
            };
            PackagingTreeSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedPackagingIds != null && self.selectedPackagingIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/PackagingSummary"),
                        data: { selectedIds: self.packagingIds },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            PackagingTreeSearchViewModel.prototype.addPackaging = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            PackagingTreeSearchViewModel.prototype.removePackaging = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedPackagingIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            PackagingTreeSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            PackagingTreeSearchViewModel.prototype.loadPackages = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                var packTypeId = item == null || item.Id == "-1" ? undefined : item.Id;
                var scrollPosition = $(window).scrollTop();
                if (item != null && item.IsExpanded === true) {
                    item.IsExpanded = !item.IsExpanded;
                    var packageData = self.packages();
                    self.packages([]);
                    self.packages(packageData);
                    $(window).scrollTop(scrollPosition);
                    return;
                }
                $.ajax({
                    url: self.getBaseUrl("/Search/PackagingTypeSearchAsync"),
                    type: "POST",
                    data: {
                        entrypoint: self.entryPoint,
                        packTypeId: packTypeId
                    },
                    global: false
                }).done(function (data) {
                    if (packTypeId == null) {
                        self.packages([]);
                        self.packages(self.buildTreeView(data));
                    }
                    else {
                        _.each(self.packages(), function (packagetype) {
                            if (self.isChildNodeFound() == false) {
                                self.pushChildNodes(packagetype.SearchItem, data, packTypeId);
                            }
                        });
                        self.isChildNodeFound(false);
                        var packageData = self.packages().slice(0);
                        self.packages([]);
                        self.packages(packageData);
                    }
                }).then(function () {
                    $(window).scrollTop(scrollPosition);
                });
            };
            PackagingTreeSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.CategoriesAndTopics:
                        if (self.selectedPackagingIds().length == 0) {
                            self.isCategoryTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isCategoryTabEnabled(true);
                        }
                        break;
                    case Search.ActiveSearch.Geography:
                        if (self.selectedPackagingIds().length == 0 || self.selectedCategoryIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            PackagingTreeSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedPackagingIds().length == 0 || self.selectedCountryCodes().length == 0 || self.selectedCategoryIds().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            PackagingTreeSearchViewModel.prototype.selectSubPackTypesInternal = function (packTypeId) {
                var _this = this;
                var self = this;
                self.checkChildren(packTypeId);
                var isSelectSubCategory = $("#selectSubPackTypes" + packTypeId).is(':checked');
                $.ajax({
                    url: self.getBaseUrl("/Search/SubPackTypeSearchAsync"),
                    data: { packTypeId: packTypeId },
                    type: "POST",
                }).done(function (data) {
                    var underlyingSummary = ko.observableArray(self.summary());
                    var underlyingSelectedPackTypeIds = ko.observableArray(self.selectedPackagingIds());
                    if (isSelectSubCategory) {
                        _.each(data, function (dataItem) {
                            if (_.contains(_this.selectedPackagingIds(), dataItem.PackTypeID) == false) {
                                underlyingSelectedPackTypeIds.push(dataItem.PackTypeID);
                            }
                            var itemAlreadySelected = ko.utils.arrayFirst(_this.summary(), function (item) { return item.id === dataItem.PackTypeID; });
                            if (itemAlreadySelected === null) {
                                underlyingSummary.push({ id: dataItem.PackTypeID, name: dataItem.PackTypeName });
                            }
                        });
                        $("#selectSubPackTypes" + packTypeId).prop('checked', true); // For IE8 
                    }
                    else {
                        _.each(data, function (dataItem) {
                            underlyingSummary.remove(function (element) { return element.id == dataItem.PackTypeID; });
                            underlyingSelectedPackTypeIds.remove(dataItem.PackTypeID);
                        });
                        $("#selectSubPackTypes" + packTypeId).prop('checked', false); // For IE8 
                    }
                    self.selectedPackagingIds.valueHasMutated(); //syncing self.selectedPackagingIds and underlyingSelectedPackTypeIds
                    self.summary.valueHasMutated();
                    self.scrollSummaryArea();
                });
            };
            return PackagingTreeSearchViewModel;
        }(Search.Tree.BaseTreeSearchViewModel));
        Tree.PackagingTreeSearchViewModel = PackagingTreeSearchViewModel;
    })(Tree = Search.Tree || (Search.Tree = {}));
})(Search || (Search = {}));
//# sourceMappingURL=PackagingTreeSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Tree;
    (function (Tree) {
        var EthicalLabelsTreeSearchViewModel = (function (_super) {
            __extends(EthicalLabelsTreeSearchViewModel, _super);
            function EthicalLabelsTreeSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.ethicalLabels = ko.observableArray([]);
                self.checkedChildrenList = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.EthicalLabels;
                self.searchType = initialData.SearchType;
                self.entryPoint = initialData.EntryPoint;
                ;
                self.loadSubEthicalLabels = function (item) {
                    return self.loadEthicalLabels(item);
                };
                self.showNoEthicalLabelsMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
                self.selectSubEthicalLabels = function (item) {
                    self.selectSubEthicalLabelsInternal(item);
                };
                self.ethicalLabelParentIds = ko.computed(function () {
                    return self.checkedChildrenList().join(',');
                });
            }
            EthicalLabelsTreeSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadEthicalLabels();
                self.loadSummary();
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeEthicalLabel(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedEthicalTypeIds.removeAll();
                    self.summary.removeAll();
                    $(".em-drilldown__select-all").children("span").removeClass('is-checked');
                    $('input:checkbox').removeAttr('checked');
                });
                // Search Section
                $(document).on("click touchstart", "input[id^='ethicalLabel-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addEthicalLabel(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeEthicalLabel(itemToRemove);
                    }
                });
            };
            EthicalLabelsTreeSearchViewModel.prototype.checkChildren = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.checkedChildrenList(), function (item) { return item === itemToAdd; });
                if (itemAlreadySelected === null) {
                    self.checkedChildrenList.push(itemToAdd);
                }
                else {
                    self.checkedChildrenList.remove(itemToAdd);
                }
                return true;
            };
            EthicalLabelsTreeSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedEthicalTypeIds != null && self.selectedEthicalTypeIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/EthicalLabelSummary"),
                        data: { selectedIds: self.ethicalTypeIds }
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            EthicalLabelsTreeSearchViewModel.prototype.addEthicalLabel = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            EthicalLabelsTreeSearchViewModel.prototype.removeEthicalLabel = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedEthicalTypeIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            EthicalLabelsTreeSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            EthicalLabelsTreeSearchViewModel.prototype.loadEthicalLabels = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                var ethicalTypeId = item == null || item.Id == "-1" ? undefined : item.Id;
                var scrollPosition = $(window).scrollTop();
                if (item != null && item.IsExpanded === true) {
                    item.IsExpanded = !item.IsExpanded;
                    var ethicalLabelData = self.ethicalLabels();
                    self.ethicalLabels([]);
                    self.ethicalLabels(ethicalLabelData);
                    $(window).scrollTop(scrollPosition);
                    return;
                }
                $.ajax({
                    url: self.getBaseUrl("/Search/EthicalLabelsSearchAsync"),
                    type: "POST",
                    data: {
                        entrypoint: self.entryPoint,
                        ethicalTypeId: ethicalTypeId
                    },
                    global: false
                }).done(function (data) {
                    if (ethicalTypeId == null) {
                        self.ethicalLabels([]);
                        self.ethicalLabels(self.buildTreeView(data));
                    }
                    else {
                        _.each(self.ethicalLabels(), function (ethicalLabelType) {
                            if (self.isChildNodeFound() == false) {
                                self.pushChildNodes(ethicalLabelType.SearchItem, data, ethicalTypeId);
                            }
                        });
                        self.isChildNodeFound(false);
                        var ethicalLabelData = self.ethicalLabels().slice(0);
                        self.ethicalLabels([]);
                        self.ethicalLabels(ethicalLabelData);
                    }
                }).then(function () {
                    $(window).scrollTop(scrollPosition);
                });
            };
            EthicalLabelsTreeSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.CategoriesAndTopics:
                        if (self.selectedEthicalTypeIds().length == 0) {
                            self.isCategoryTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isCategoryTabEnabled(true);
                        }
                        break;
                    case Search.ActiveSearch.Geography:
                        if (self.selectedEthicalTypeIds().length == 0 || self.selectedCategoryIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            EthicalLabelsTreeSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedEthicalTypeIds().length == 0 || self.selectedCountryCodes().length == 0 || self.selectedCategoryIds().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            EthicalLabelsTreeSearchViewModel.prototype.selectSubEthicalLabelsInternal = function (ethicalTypeId) {
                var _this = this;
                var self = this;
                self.checkChildren(ethicalTypeId);
                var isSelectSubCategory = $("#selectSubEthicalLabels" + ethicalTypeId).is(':checked');
                $.ajax({
                    url: self.getBaseUrl("/Search/SubEthicalTypeSearchAsync"),
                    data: { ethicalTypeId: ethicalTypeId },
                    type: "POST"
                }).done(function (data) {
                    var underlyingSummary = ko.observableArray(self.summary());
                    var underlyingSelectedEthicalTypeIds = ko.observableArray(self.selectedEthicalTypeIds());
                    if (isSelectSubCategory) {
                        _.each(data, function (dataItem) {
                            if (_.contains(_this.selectedEthicalTypeIds(), dataItem.EthicalTypeId) == false) {
                                underlyingSelectedEthicalTypeIds.push(dataItem.EthicalTypeId);
                            }
                            var itemAlreadySelected = ko.utils.arrayFirst(_this.summary(), function (item) { return item.id === dataItem.EthicalTypeId; });
                            if (itemAlreadySelected === null) {
                                underlyingSummary.push({ id: dataItem.EthicalTypeId, name: dataItem.EthicalTypeName });
                            }
                        });
                        $("#selectSubEthicalLabels" + ethicalTypeId).prop('checked', true); // For IE8 
                    }
                    else {
                        _.each(data, function (dataItem) {
                            underlyingSummary.remove(function (element) { return element.id == dataItem.EthicalTypeId; });
                            underlyingSelectedEthicalTypeIds.remove(dataItem.EthicalTypeId);
                        });
                        $("#selectSubEthicalLabels" + ethicalTypeId).prop('checked', false); // For IE8 
                    }
                    self.selectedEthicalTypeIds.valueHasMutated(); //syncing self.selectedEthicalTypeIds and underlyingSelectedEthicalTypeIds
                    self.summary.valueHasMutated();
                    self.scrollSummaryArea();
                });
            };
            return EthicalLabelsTreeSearchViewModel;
        }(Search.Tree.BaseTreeSearchViewModel));
        Tree.EthicalLabelsTreeSearchViewModel = EthicalLabelsTreeSearchViewModel;
    })(Tree = Search.Tree || (Search.Tree = {}));
})(Search || (Search = {}));
//# sourceMappingURL=EthicalLabelsTreeSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
var Search;
(function (Search) {
    var Browse;
    (function (Browse) {
        var BaseBrowseSearchViewModel = (function () {
            function BaseBrowseSearchViewModel(initialData) {
                this.maxLengthForSmallerFilter = 60;
                var self = this;
                self.breadCrumbItems = ko.observableArray([]);
                self.breadCrumbContext = ko.observableArray([]);
                self.breadCrumbExpandedItem = ko.observable('');
                self.breadCrumbExpandedTitle = ko.observable('');
                self.selectedCategoryIds = ko.observableArray([]);
                self.selectedCountryCodes = ko.observableArray([]);
                self.selectedCompanyIds = ko.observableArray([]);
                self.selectedClosureIds = ko.observableArray([]);
                self.selectedPackagingIds = ko.observableArray([]);
                self.selectedSurveyIds = ko.observableArray([]);
                self.selectedBrandIds = ko.observableArray([]);
                self.selectedNutrientIds = ko.observableArray([]);
                self.selectedForeignMarketIds = ko.observableArray([]);
                self.selectedEthicalTypeIds = ko.observableArray([]);
                self.expandedCategoryIds = ko.observableArray([]);
                self.expandedEthicalTypeIds = ko.observableArray([]);
                self.parentId = ko.observable("");
                self.isLoading = ko.observable(false);
                self.isMenuLoading = ko.observable(false);
                self.hasFooterErrorMessage = ko.observable(false);
                self.canSelectAll = ko.observable(false);
                self.summary = ko.observableArray([]);
                self.isSummaryLoading = ko.observable(false);
                self.isCategoryTabEnabled = ko.observable(true);
                self.isGeographyTabEnabled = ko.observable(true);
                self.showBreadCrumbDropDown = ko.observable(false);
                self.renderFirstColumn = function (searchItems) {
                    return self.renderFirstColumnInternal(searchItems);
                };
                self.renderSecondColumn = function (searchItems) {
                    return self.renderSecondColumnInternal(searchItems);
                };
                self.renderThirdColumn = function (searchItems) {
                    return self.renderThirdColumnInternal(searchItems);
                };
                self.tabStyle = function (tab) {
                    return self.tabStyleInternal(tab);
                };
                self.tabNumberStyle = function (tab) {
                    return self.tabNumberStyleInternal(tab);
                };
                self.buttonStyle = function () {
                    return self.buttonStyleInternal();
                };
                self.filterStyle = function (name) {
                    return self.filterStyleInternal(name);
                };
                self.checkBoxStyle = function () {
                    return self.checkBoxStyleInternal();
                };
                self.radioButtonStyle = function () {
                    return self.radioButtonStyleInternal();
                };
                self.breadCrumbStyle = function (index) {
                    return self.breadCrumbStyleInternal(index);
                };
                self.breadCrumbDropDownStyle = function (index, id) {
                    return self.breadCrumbDropDownStyleInternal(index, id);
                };
                self.breadCrumbDropDownChildrenStyle = function (hasChildren, id) {
                    return self.breadCrumbDropDownChildrenStyleInternal(hasChildren, id);
                };
                self.initializeBreadCrumb();
                self.mapObservablesFromHiddenField(initialData);
                self.mapObservablesToHiddenField();
                self.htmlBrowserDetectClass = $('html').attr("class");
                // BreadCrumb Section
                $(document).mouseup(function (e) {
                    var container = $("#breadcrumbDropdown");
                    if (self.showBreadCrumbDropDown() == true) {
                        if (!container.is(e.target)
                            && container.has(e.target).length === 0
                            && !$(e.target).hasClass("is-open")) {
                            self.hideBreadCrumbDropDown();
                        }
                    }
                });
            }
            // #region KO Methods Binding
            BaseBrowseSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result;
                if (tab != self.activeSearch) {
                    result = "is-enabled";
                }
                else {
                    result = "is-active";
                }
                return result;
            };
            BaseBrowseSearchViewModel.prototype.tabNumberStyleInternal = function (tab) {
                var self = this;
                var result = "em-tabs__status";
                if ((tab == Search.ActiveSearch.CategoriesAndTopics && self.selectedCategoryIds().length > 0) ||
                    (tab == Search.ActiveSearch.Geography && self.selectedCountryCodes().length > 0) ||
                    (tab == Search.ActiveSearch.Companies && self.selectedCompanyIds().length > 0) ||
                    (tab == Search.ActiveSearch.ClosureType && self.selectedClosureIds().length > 0) ||
                    (tab == Search.ActiveSearch.Packaging && self.selectedPackagingIds().length > 0) ||
                    (tab == Search.ActiveSearch.Survey && self.selectedSurveyIds().length > 0) ||
                    (tab == Search.ActiveSearch.Brands && self.selectedBrandIds().length > 0) ||
                    (tab == Search.ActiveSearch.Nutrition && self.selectedNutrientIds().length > 0) ||
                    (tab == Search.ActiveSearch.ForeignMarket && self.selectedForeignMarketIds().length > 0) ||
                    (tab == Search.ActiveSearch.EthicalLabels && self.selectedEthicalTypeIds().length > 0)) {
                    result += " is-ready";
                }
                else {
                    result += " is-pending";
                }
                return result;
            };
            BaseBrowseSearchViewModel.prototype.buttonStyleInternal = function () {
                return "em-btn-1-submit--small em-layout--right";
            };
            BaseBrowseSearchViewModel.prototype.filterStyleInternal = function (name) {
                var self = this;
                var result = "em-drilldown";
                if (name.length > self.maxLengthForSmallerFilter) {
                    result += " em-drilldown--large";
                }
                return result;
            };
            BaseBrowseSearchViewModel.prototype.checkBoxStyleInternal = function () {
                var self = this;
                if (self.htmlBrowserDetectClass.indexOf('k-ie8') > 0) {
                    return "";
                }
                return "is-not-ie8";
            };
            BaseBrowseSearchViewModel.prototype.radioButtonStyleInternal = function () {
                var self = this;
                if (self.htmlBrowserDetectClass.indexOf('k-ie8') > 0) {
                    return "";
                }
                return "is-not-ie8";
            };
            BaseBrowseSearchViewModel.prototype.breadCrumbStyleInternal = function (index) {
                if (index === void 0) { index = null; }
                var self = this;
                if (index == self.breadCrumbItems().length - 1) {
                    return "is-inactive";
                }
                return "";
            };
            BaseBrowseSearchViewModel.prototype.breadCrumbDropDownStyleInternal = function (index, id) {
                if (index === void 0) { index = null; }
                if (id === void 0) { id = null; }
                var self = this;
                if (index == self.breadCrumbItems().length - 1) {
                    return "is-hidden";
                }
                if (id == self.breadCrumbExpandedItem()) {
                    return "is-open";
                }
                return "";
            };
            BaseBrowseSearchViewModel.prototype.breadCrumbDropDownChildrenStyleInternal = function (hasChildren, id) {
                var self = this;
                if (_.contains(_.pluck(self.breadCrumbItems(), 'Id'), id)) {
                    return "is-current";
                }
                if (hasChildren) {
                    return '';
                }
                return 'is-inactive';
            };
            BaseBrowseSearchViewModel.prototype.mapObservablesFromHiddenField = function (initialData) {
                var self = this;
                if (initialData.SelectedCategoryIds != null) {
                    var underlyingSelectedCategoryIds = [];
                    _.each(initialData.SelectedCategoryIds.split(','), function (productId) {
                        underlyingSelectedCategoryIds.push(productId);
                    });
                    self.selectedCategoryIds.push.apply(self.selectedCategoryIds, underlyingSelectedCategoryIds);
                }
                if (initialData.SelectedCountryCodes != null) {
                    var underlyingSelectedCountryCodes = [];
                    _.each(initialData.SelectedCountryCodes.split(','), function (countryCode) {
                        underlyingSelectedCountryCodes.push(countryCode);
                    });
                    self.selectedCountryCodes.push.apply(self.selectedCountryCodes, underlyingSelectedCountryCodes);
                }
                if (initialData.SelectedCompanyIds != null) {
                    var underlyingSelectedCompanyIds = [];
                    _.each(initialData.SelectedCompanyIds.split(','), function (companyId) {
                        underlyingSelectedCompanyIds.push(companyId);
                    });
                    self.selectedCompanyIds.push.apply(self.selectedCompanyIds, underlyingSelectedCompanyIds);
                }
                if (initialData.SelectedBrandIds != null) {
                    var underlyingSelectedBrandIds = [];
                    _.each(initialData.SelectedBrandIds.split(','), function (brandId) {
                        underlyingSelectedBrandIds.push(brandId);
                    });
                    self.selectedBrandIds.push.apply(self.selectedBrandIds, underlyingSelectedBrandIds);
                }
                if (initialData.SelectedClosureIds != null) {
                    var underlyingSelectedClosureIds = [];
                    _.each(initialData.SelectedClosureIds.split(','), function (closureId) {
                        underlyingSelectedClosureIds.push(closureId);
                    });
                    self.selectedClosureIds.push.apply(self.selectedClosureIds, underlyingSelectedClosureIds);
                }
                if (initialData.SelectedPackagingIds != null) {
                    var underlyingSelectedPackagingIds = [];
                    _.each(initialData.SelectedPackagingIds.split(','), function (packagingId) {
                        underlyingSelectedPackagingIds.push(packagingId);
                    });
                    self.selectedPackagingIds.push.apply(self.selectedPackagingIds, underlyingSelectedPackagingIds);
                }
                if (initialData.SelectedSurveyIds != null) {
                    var underlyingSelectedSurveyIds = [];
                    _.each(initialData.SelectedSurveyIds.split(','), function (surveyId) {
                        underlyingSelectedSurveyIds.push(surveyId);
                    });
                    self.selectedSurveyIds.push.apply(self.selectedSurveyIds, underlyingSelectedSurveyIds);
                }
                if (initialData.SelectedNutrientIds != null) {
                    var underlyingSelectedNutrientIds = [];
                    _.each(initialData.SelectedNutrientIds.split(','), function (nutrientId) {
                        underlyingSelectedNutrientIds.push(nutrientId);
                    });
                    self.selectedNutrientIds.push.apply(self.selectedNutrientIds, underlyingSelectedNutrientIds);
                }
                if (initialData.SelectedForeignMarketIds != null) {
                    var underlyingSelectedForeignMarketIds = [];
                    _.each(initialData.SelectedForeignMarketIds.split(','), function (foreignMarketId) {
                        underlyingSelectedForeignMarketIds.push(foreignMarketId);
                    });
                    self.selectedForeignMarketIds.push.apply(self.selectedForeignMarketIds, underlyingSelectedForeignMarketIds);
                }
                if (initialData.SelectedEthicalTypeIds != null) {
                    var underlyingSelectedEthicalTypeIds = [];
                    _.each(initialData.SelectedEthicalTypeIds.split(','), function (ethicalTypeIds) {
                        underlyingSelectedEthicalTypeIds.push(ethicalTypeIds);
                    });
                    self.selectedEthicalTypeIds.push.apply(self.selectedEthicalTypeIds, underlyingSelectedEthicalTypeIds);
                }
                if (initialData.ExpandedCategoryIds != null) {
                    var underlyingExpandedCategoryIds = [];
                    _.each(initialData.ExpandedCategoryIds.split(','), function (expandedCategoryId) {
                        underlyingExpandedCategoryIds.push(expandedCategoryId);
                    });
                    self.expandedCategoryIds.push.apply(self.expandedCategoryIds, underlyingExpandedCategoryIds.reverse());
                    self.shouldExpand = ko.computed(function () {
                        return self.expandedCategoryIds().length > 0 || self.expandedEthicalTypeIds().length > 0;
                    });
                }
                if (initialData.ExpandedEthicalTypeIds != null) {
                    var underlyingExpandedEthicalTypeIds = [];
                    _.each(initialData.ExpandedEthicalTypeIds.split(','), function (expandedCategoryId) {
                        underlyingExpandedEthicalTypeIds.push(expandedCategoryId);
                    });
                    self.expandedEthicalTypeIds.push.apply(self.expandedEthicalTypeIds, underlyingExpandedEthicalTypeIds.reverse());
                    self.shouldExpand = ko.computed(function () {
                        return self.expandedEthicalTypeIds().length > 0;
                    });
                }
                if (initialData.ParentId != null) {
                    self.parentId = ko.observable(initialData.ParentId);
                }
            };
            BaseBrowseSearchViewModel.prototype.mapObservablesToHiddenField = function () {
                var self = this;
                self.categoryIds = ko.computed(function () {
                    return self.selectedCategoryIds().join(',');
                });
                self.countryCodes = ko.computed(function () {
                    return self.selectedCountryCodes().join(',');
                });
                self.companyIds = ko.computed(function () {
                    return self.selectedCompanyIds().join(',');
                });
                self.brandIds = ko.computed(function () {
                    return self.selectedBrandIds().join(',');
                });
                self.closureIds = ko.computed(function () {
                    return self.selectedClosureIds().join(',');
                });
                self.packagingIds = ko.computed(function () {
                    return self.selectedPackagingIds().join(',');
                });
                self.surveyIds = ko.computed(function () {
                    return self.selectedSurveyIds().join(',');
                });
                self.nutrientIds = ko.computed(function () {
                    return self.selectedNutrientIds().join(',');
                });
                self.foreignMarketIds = ko.computed(function () {
                    return self.selectedForeignMarketIds().join(',');
                });
                self.ethicalTypeIds = ko.computed(function () {
                    return self.selectedEthicalTypeIds().join(',');
                });
            };
            // #endregion 
            // #region  public methods
            BaseBrowseSearchViewModel.prototype.addItemtoBreadCrumb = function (itemToAdd) {
                var self = this;
                if (self.breadCrumbItems().length == 0) {
                    return;
                }
                self.breadCrumbItems.push(itemToAdd);
                return;
            };
            BaseBrowseSearchViewModel.prototype.DisplayFooterMessage = function (msg) {
                var self = this;
                var footerDiv = $("<div id='globalFooter' class='footerMessage'>");
                footerDiv.append("<span id='footerCloseButton' class='footerClose'></span>");
                footerDiv.append("<p>" + msg + "</p>");
                footerDiv.append("</div>");
                var footer = $("#globalFooter");
                if (footer.length > 0) {
                    footer.remove();
                }
                $("body .em-fixed-footer").append(footerDiv);
                $("#footerCloseButton").click(function () {
                    var footerMsgDiv = $("#globalFooter");
                    if (footerMsgDiv.length > 0) {
                        footerMsgDiv.remove();
                    }
                    self.hasFooterErrorMessage(false);
                });
                self.hasFooterErrorMessage(true);
            };
            BaseBrowseSearchViewModel.prototype.clearFooterMessage = function () {
                var footerCloseButton = $("#footerCloseButton");
                if (footerCloseButton.length > 0) {
                    footerCloseButton.click();
                }
            };
            BaseBrowseSearchViewModel.prototype.getSelectedIds = function () {
                var self = this;
                var selectedIds = null;
                switch (self.searchType) {
                    case Search.SearchType.Companies:
                        selectedIds = self.companyIds();
                        break;
                    case Search.SearchType.Closures:
                        selectedIds = self.closureIds();
                        break;
                    case Search.SearchType.Packaging:
                        selectedIds = self.packagingIds();
                        break;
                    case Search.SearchType.Survey:
                        selectedIds = self.surveyIds();
                        break;
                    case Search.SearchType.Brands:
                        selectedIds = self.brandIds();
                        break;
                    case Search.SearchType.Nutrition:
                        selectedIds = self.nutrientIds();
                        break;
                    case Search.SearchType.ForeignMarket:
                        selectedIds = self.foreignMarketIds();
                        break;
                    case Search.SearchType.EthicalLabels:
                        selectedIds = self.ethicalTypeIds();
                        break;
                }
                return selectedIds;
            };
            BaseBrowseSearchViewModel.prototype.initializeBreadCrumb = function () {
                var self = this;
                self.breadCrumbItems([]);
                var rootItemName = self.getBreadCrumbRootItemName();
                if (rootItemName === null) {
                    return;
                }
                self.breadCrumbItems.push({
                    Id: null, Name: rootItemName, Enabled: false,
                    ParentId: null, HasChildren: true, HasDefinition: false
                });
            };
            BaseBrowseSearchViewModel.prototype.getBaseIndex = function (diviser) {
                return (Math.round(diviser) >= diviser) ? Math.round(diviser) : Math.round(diviser) + 1;
            };
            BaseBrowseSearchViewModel.prototype.getBaseUrl = function (relativePath) {
                var path = "/" + window.location.pathname.split('/')[1] + relativePath;
                return path;
            };
            BaseBrowseSearchViewModel.prototype.getBreadCrumbRootItemName = function () {
                return null;
            };
            BaseBrowseSearchViewModel.prototype.hideBreadCrumbDropDown = function () {
                var self = this;
                self.showBreadCrumbDropDown(false);
                self.breadCrumbExpandedItem('');
            };
            BaseBrowseSearchViewModel.prototype.positioningBreadCrumb = function (element) {
                var breadcrumb = $('.em-breadcrumb');
                var dropdown = $('.em-breadcrumb__dropdown');
                var offsetVertical = $(element).position().top + $(element).outerHeight();
                var offsetHorizontal = $(element).position().left;
                dropdown.css({ 'top': offsetVertical + 'px' });
                if ((breadcrumb.outerWidth() - offsetHorizontal) < dropdown.outerWidth()) {
                    //dropdown.css({ 'left': offsetHorizontal + 'px' });
                    //dropdown.css({ 'left': offsetHorizontal - dropdown.outerWidth() + $(element).outerWidth() + 'px' });
                    dropdown.css({ 'left': breadcrumb.outerWidth() - dropdown.outerWidth() + 'px' });
                }
                else {
                    dropdown.css({ 'left': offsetHorizontal + 'px' });
                }
            };
            // #endregion 
            // #region private Methods 
            BaseBrowseSearchViewModel.prototype.renderFirstColumnInternal = function (searchItems) {
                var diviser = 0, startIndex = 0, endIndex = 0;
                if (searchItems.length <= 2) {
                    return searchItems;
                }
                else if (searchItems.length <= 4) {
                    diviser = searchItems.length / 2;
                    endIndex = this.getBaseIndex(diviser);
                    return searchItems.slice(startIndex, endIndex);
                }
                else if (searchItems.length >= 5) {
                    diviser = searchItems.length / 3;
                    endIndex = this.getBaseIndex(diviser);
                    return searchItems.slice(startIndex, endIndex);
                }
                return [];
            };
            BaseBrowseSearchViewModel.prototype.renderSecondColumnInternal = function (searchItems) {
                var diviser = 0, startIndex = 0, endIndex = 0;
                if (searchItems.length > 2 && searchItems.length <= 4) {
                    diviser = searchItems.length / 2;
                    startIndex = this.getBaseIndex(diviser);
                    endIndex = startIndex + Math.round(diviser);
                    return searchItems.slice(startIndex, endIndex);
                }
                else if (searchItems.length >= 5) {
                    diviser = searchItems.length / 3;
                    startIndex = this.getBaseIndex(diviser);
                    endIndex = startIndex + Math.round(diviser);
                    return searchItems.slice(startIndex, endIndex);
                }
                return [];
            };
            BaseBrowseSearchViewModel.prototype.renderThirdColumnInternal = function (searchItems) {
                var diviser = 0, startIndex = 0, endIndex = 0;
                if (searchItems.length >= 5) {
                    diviser = searchItems.length / 3;
                    startIndex = this.getBaseIndex(diviser) + Math.round(diviser);
                    endIndex = searchItems.length;
                    return searchItems.slice(startIndex, endIndex);
                }
                return [];
            };
            return BaseBrowseSearchViewModel;
        }());
        Browse.BaseBrowseSearchViewModel = BaseBrowseSearchViewModel;
    })(Browse = Search.Browse || (Search.Browse = {}));
})(Search || (Search = {}));
//# sourceMappingURL=BaseBrowseSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Browse;
    (function (Browse) {
        var CategoryBrowseSearchViewModel = (function (_super) {
            __extends(CategoryBrowseSearchViewModel, _super);
            function CategoryBrowseSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.categories = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.CategoriesAndTopics;
                self.searchType = initialData.SearchType;
                self.entryPoint = Search.EntryPoint.RunSearch;
                self.filterText = ko.observable(initialData.CategoryFilterText);
                self.showNoFilterResultsMessage = ko.observable(false);
                self.showClearButton = ko.observable(false);
                self.showDefinition = function (item, event) {
                    return self.showDefinitionInternal(item, event);
                };
                self.loadSubCategories = function (item) {
                    self.addItemtoBreadCrumb(item);
                    return self.loadCategories(item);
                };
                self.selectAllProducts = function () {
                    return self.selectAllProductsInternal();
                };
                self.showNoCategoryMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
                self.applyCategoryFilter = function () {
                    return self.applyCategoryFilterInternal();
                };
                self.clearCategoryFilter = function () {
                    return self.clearCategoryFilterInternal();
                };
                self.highlightFilteredText = function (categoryName) {
                    return self.highlightFilteredTextInternal(categoryName);
                };
                self.loadBreadCrumbChildren = function (item) {
                    self.hideBreadCrumbDropDown();
                    var reduced = false;
                    do {
                        var lastItem = self.breadCrumbItems()[self.breadCrumbItems().length - 1];
                        if (item.Id == lastItem.Id) {
                            if (reduced) {
                                self.loadCategories(item);
                            }
                            return;
                        }
                        self.breadCrumbItems.pop();
                        reduced = true;
                    } while (true);
                };
                self.loadBreadCrumbContextChildren = function (item) {
                    if (item.HasChildren) {
                        self.hideBreadCrumbDropDown();
                        var reduced = false;
                        do {
                            var lastItem = self.breadCrumbItems()[self.breadCrumbItems().length - 1];
                            if (item.ParentId == lastItem.Id || lastItem.Id == null) {
                                if (reduced) {
                                    self.addItemtoBreadCrumb(item);
                                    self.loadCategories(item);
                                }
                                return;
                            }
                            self.breadCrumbItems.pop();
                            reduced = true;
                        } while (true);
                    }
                };
                self.loadBreadCrumbDropdownMenu = function (item, event) {
                    if (item.Id == self.breadCrumbExpandedItem()) {
                        self.hideBreadCrumbDropDown();
                        return;
                    }
                    self.breadCrumbExpandedItem(item.Id);
                    self.breadCrumbExpandedTitle(item.Name);
                    self.loadBreadCrumbContext(item);
                    self.positioningBreadCrumb(event.target);
                    self.showBreadCrumbDropDown(true);
                };
                self.selectSubCategories = function (item) {
                    self.selectSubCategoriesInternal(item);
                };
            }
            CategoryBrowseSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.initializeBreadCrumb();
                //Populate categories
                if (self.shouldExpand) {
                    self.addBreadcrumbItems();
                    self.loadCategories({ Id: self.parentId });
                }
                else {
                    self.loadCategories();
                }
                self.loadSummary();
                // Event Handler to Hide Definition on Document Click
                $(document).click(function () {
                    $("#DefinitionDiv").empty();
                    $("#DefinitionDiv").hide();
                });
                // Search Section
                $(document).on("click touchstart", "input[id^='product-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addProduct(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeProduct(itemToRemove);
                    }
                });
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeProduct(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedCategoryIds.removeAll();
                    self.summary.removeAll();
                    var selectAllCheckBox = document.getElementById("selectAllCheckBox");
                    selectAllCheckBox.checked = false;
                    $(".em-drilldown__select-all").children("span").removeClass('is-checked');
                    $('input:checkbox').removeAttr('checked');
                });
                $(document).on("click touchstart", "#clearFilterButton", function () {
                    $("#categoryFilterTextbox").blur();
                });
            };
            CategoryBrowseSearchViewModel.prototype.loadCategories = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                var productId = item == null ? null : item.Id;
                self.isLoading(true);
                self.canSelectAll(false);
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/CategorySearchAsync"),
                    data: {
                        searchType: self.searchType,
                        filterText: self.filterText(),
                        selectedIds: self.getSelectedIds(),
                        productId: productId,
                        entryPoint: self.entryPoint
                    },
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.categories(data);
                    self.breadCrumbContext([]);
                    self.isLoading(false);
                    self.showNoFilterResultsMessage(data.length == 0);
                });
            };
            CategoryBrowseSearchViewModel.prototype.loadBreadCrumbContext = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                var productId = item == null ? null : item.Id;
                self.isMenuLoading(true);
                self.canSelectAll(false);
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/CategorySearchAsync"),
                    data: {
                        searchType: self.searchType,
                        filterText: self.filterText(),
                        selectedIds: self.getSelectedIds(),
                        productId: productId,
                        entryPoint: self.entryPoint
                    },
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.breadCrumbContext(data);
                    self.isMenuLoading(false);
                    self.showNoFilterResultsMessage(data.length == 0);
                });
            };
            CategoryBrowseSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedCategoryIds != null && self.selectedCategoryIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/CategorySummary"),
                        data: {
                            selectedIds: self.categoryIds,
                            searchType: self.searchType
                        },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        _.each(data, function (dataItem) {
                            underlyingSummary.push({ id: dataItem.id, name: dataItem.name });
                        });
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            CategoryBrowseSearchViewModel.prototype.loadPredefinedCategories = function (predefinedCategoryIds) {
                var self = this;
                if (predefinedCategoryIds != null) {
                    self.isLoading(true);
                    self.isSummaryLoading(true);
                    // Push to Search Section
                    var underlyingSelectedCategoryIds = [];
                    _.each(predefinedCategoryIds.split(','), function (productId) {
                        underlyingSelectedCategoryIds.push(productId);
                    });
                    self.selectedCategoryIds.removeAll();
                    self.selectedCategoryIds.push.apply(self.selectedCategoryIds, underlyingSelectedCategoryIds);
                    // Push to Summary Section
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/CategorySummary"),
                        data: {
                            selectedIds: self.categoryIds,
                            searchType: self.searchType
                        },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.removeAll();
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isLoading(false);
                        self.isSummaryLoading(false);
                    });
                }
            };
            CategoryBrowseSearchViewModel.prototype.addProduct = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            CategoryBrowseSearchViewModel.prototype.removeProduct = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedCategoryIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            CategoryBrowseSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            // #region KO Methods Binding
            CategoryBrowseSearchViewModel.prototype.showDefinitionInternal = function (item, event) {
                var self = this;
                var element = $(event.target);
                var container = $('.em-drilldowns');
                var posLeft = element.parent().position().left;
                var posTop = element.parent().offset().top - container.offset().top;
                $.ajax({
                    url: self.getBaseUrl("/Search/Definition"),
                    type: "POST",
                    data: {
                        ProductId: item.Id
                    }
                }).done(function (data) {
                    $("#DefinitionDiv").show();
                    $("#DefinitionDiv").empty();
                    $("#DefinitionDiv").append("<a class='em-popup__close'></a>")
                        .append("<div>" + data + "</div>");
                    $("#DefinitionDiv").css({
                        left: posLeft + 'px',
                        top: posTop + 55 + 'px'
                    });
                });
            };
            CategoryBrowseSearchViewModel.prototype.selectAllProductsInternal = function () {
                var _this = this;
                var self = this;
                if (this.canSelectAll()) {
                    _.each(this.categories(), function (category) {
                        _.each(category.Products, function (product) {
                            if (product.IsEnabled == true) {
                                if (_.contains(_this.selectedCategoryIds(), product.Id) == false) {
                                    self.selectedCategoryIds.push(product.Id);
                                    self.addProduct({ id: product.Id, name: product.Name });
                                }
                            }
                        });
                    });
                }
                else {
                    _.each(this.categories(), function (category) {
                        _.each(category.Products, function (product) {
                            self.selectedCategoryIds.remove(product.Id);
                            self.removeProduct({ id: product.Id, name: product.Name });
                        });
                    });
                }
                return true;
            };
            CategoryBrowseSearchViewModel.prototype.applyCategoryFilterInternal = function () {
                var self = this;
                self.clearFooterMessage();
                var minFilterLength = 3;
                var maxFilterLength = 254;
                if (self.filterText() == null || self.filterText().length == 0) {
                    self.DisplayFooterMessage("Please enter keywords to search");
                    return;
                }
                if (self.filterText().length < minFilterLength
                    || self.filterText().length > maxFilterLength) {
                    self.DisplayFooterMessage("Please enter a minimum of " + minFilterLength +
                        " and a maximum of " + maxFilterLength + " characters for keyword Search");
                    return;
                }
                self.showClearButton(true);
                self.initializeBreadCrumb();
                self.loadCategories();
            };
            CategoryBrowseSearchViewModel.prototype.clearCategoryFilterInternal = function () {
                var self = this;
                self.filterText(null);
                self.showClearButton(false);
                self.loadCategories();
                self.initializeBreadCrumb();
            };
            CategoryBrowseSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.Geography:
                        if (self.selectedCategoryIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            CategoryBrowseSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedCategoryIds().length == 0 || self.selectedCountryCodes().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            CategoryBrowseSearchViewModel.prototype.getBreadCrumbRootItemName = function () {
                var self = this;
                if (self.filterText && self.filterText()) {
                    return "Filtered Results";
                }
                return self.searchType === Search.SearchType.Cities ? "Cities" : "Categories and Topics";
            };
            CategoryBrowseSearchViewModel.prototype.highlightFilteredTextInternal = function (categoryName) {
                var self = this;
                if (self.filterText() != null) {
                    var filteredTextLowerCase = self.filterText().toLowerCase().trim();
                    var categoryNameLowerCase = categoryName.toLowerCase().trim();
                    var matchedStringLowerCase = categoryNameLowerCase.match(filteredTextLowerCase);
                    if (matchedStringLowerCase != null && matchedStringLowerCase.length >= 1) {
                        var indexOfMatchedString = categoryNameLowerCase.indexOf(matchedStringLowerCase.toString());
                        var matchedStringOrignalCase = categoryName.substr(indexOfMatchedString, matchedStringLowerCase.toString().length);
                        var regex = new RegExp(matchedStringOrignalCase.toString(), "g");
                        var formattedCategoryName = categoryName.replace(regex, '<strong>' + matchedStringOrignalCase.toString() + '</strong>');
                        return formattedCategoryName;
                    }
                }
                return categoryName;
            };
            CategoryBrowseSearchViewModel.prototype.addBreadcrumbItems = function () {
                var self = this;
                $.ajax({
                    type: 'POST',
                    url: self.getBaseUrl("/Search/CategorySummary"),
                    data: {
                        selectedIds: self.expandedCategoryIds,
                        searchType: self.searchType
                    },
                }).done(function (data) {
                    var underlyingBreadCrumbItems = [];
                    for (var i = 0; i < data.length; i++) {
                        // Push to breadcrumb Section
                        underlyingBreadCrumbItems.push({ Id: data[i].id, Name: data[i].name });
                    }
                    self.breadCrumbItems.push.apply(self.breadCrumbItems, underlyingBreadCrumbItems);
                });
            };
            CategoryBrowseSearchViewModel.prototype.selectSubCategoriesInternal = function (categoryId) {
                var _this = this;
                var self = this;
                var isSelectAllChecked = $("#selectSubCategories" + categoryId).is(':checked');
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/SubCategorySearchAsync"),
                    data: {
                        searchType: self.searchType,
                        productId: categoryId,
                        selectedIds: self.getSelectedIds()
                    },
                    type: "POST",
                }).done(function (data) {
                    var underlyingSummary = ko.observableArray(self.summary());
                    var underlyingSelectedCategoryIds = ko.observableArray(self.selectedCategoryIds());
                    if (isSelectAllChecked) {
                        _.each(data, function (dataItem) {
                            if (_.contains(_this.selectedCategoryIds(), dataItem.ProductId) == false) {
                                underlyingSelectedCategoryIds.push(dataItem.ProductId);
                            }
                            var itemAlreadySelected = ko.utils.arrayFirst(_this.summary(), function (item) { return item.id === dataItem.ProductId; });
                            if (itemAlreadySelected === null) {
                                underlyingSummary.push({ id: dataItem.ProductId, name: dataItem.ProductName });
                            }
                        });
                        self.isSummaryLoading(false);
                        $("#selectSubCategories" + categoryId).prop('checked', true); // For IE8 
                    }
                    else {
                        _.each(data, function (dataItem) {
                            underlyingSummary.remove(function (element) { return element.id == dataItem.ProductId; });
                            underlyingSelectedCategoryIds.remove(dataItem.ProductId);
                        });
                        $("#selectSubCategories" + categoryId).prop('checked', false); // For IE8 
                    }
                    self.selectedCategoryIds.valueHasMutated(); //syncing self.selectedCategoryIds and underlyingSelectedCategoryIds
                    self.summary.valueHasMutated();
                    self.scrollSummaryArea();
                });
            };
            return CategoryBrowseSearchViewModel;
        }(Browse.BaseBrowseSearchViewModel));
        Browse.CategoryBrowseSearchViewModel = CategoryBrowseSearchViewModel;
    })(Browse = Search.Browse || (Search.Browse = {}));
})(Search || (Search = {}));
//# sourceMappingURL=CategoryBrowseSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Browse;
    (function (Browse) {
        var CompanyBrowseSearchViewModel = (function (_super) {
            __extends(CompanyBrowseSearchViewModel, _super);
            function CompanyBrowseSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.showClearButton = ko.observable(false);
                self.showCompanyRadioOptions = ko.observable(false);
                self.showNoResultsMessage = ko.observable(false);
                self.selectedBrandOwner = ko.observable(Search.BrandOwnerType.NBO.toString());
                self.companies = ko.observableArray([]);
                self.nationalBrandOwnersList = ko.observableArray([]);
                self.globalBrandOwnersList = ko.observableArray([]);
                self.companyFilterText = ko.observable("");
                self.activeSearch = Search.ActiveSearch.Companies;
                self.searchType = initialData.SearchType;
                self.showNoCompanyMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
                self.loadAllCompanies = function () {
                    return self.loadCompanies();
                };
                self.clearAllCompanies = function () {
                    return self.clearAllCompaniesInternal();
                };
            }
            CompanyBrowseSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadSummary();
                $(document).on("click touchstart", "input[id^='company-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addCompany(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeCompany(itemToRemove);
                    }
                });
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeCompany(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedCompanyIds.removeAll();
                    self.summary.removeAll();
                });
                $(document).on("click touchstart", "#ClearCompanySearchButton", function () {
                    $("#companySearchTextbox").blur();
                });
            };
            CompanyBrowseSearchViewModel.prototype.loadNationalBrandOwners = function () {
                var self = this;
                self.isLoading(true);
                self.companies([{ companies: self.nationalBrandOwnersList() }]);
                self.isLoading(false);
                return true;
            };
            CompanyBrowseSearchViewModel.prototype.loadGlobalBrandOwners = function () {
                var self = this;
                self.isLoading(true);
                self.companies([{ companies: self.globalBrandOwnersList() }]);
                self.isLoading(false);
                return true;
            };
            CompanyBrowseSearchViewModel.prototype.loadCompanies = function () {
                var self = this;
                self.clearFooterMessage();
                var minFilterLength = 2;
                var maxFilterLength = 254;
                if (self.companyFilterText().length == 0) {
                    self.DisplayFooterMessage("Please enter keywords to search");
                    return;
                }
                if (self.companyFilterText().length < minFilterLength
                    || self.companyFilterText().length > maxFilterLength) {
                    self.DisplayFooterMessage("Please enter a minimum of " + minFilterLength +
                        " and a maximum of " + maxFilterLength + " characters for keyword Search");
                    return;
                }
                self.selectedBrandOwner(Search.BrandOwnerType.NBO.toString());
                self.showCompanyRadioOptions(false);
                self.showNoResultsMessage(false);
                self.isLoading(true);
                self.showClearButton(true);
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/CompanySearchAsync"),
                    data: {
                        companyFilterText: self.companyFilterText()
                    },
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.nationalBrandOwnersList(data.NationalBrandOwnersList);
                    self.globalBrandOwnersList(data.GlobalBrandOwnersList);
                    if (data.GlobalBrandOwnersList.length <= 0 && data.NationalBrandOwnersList.length <= 0) {
                        self.showNoResultsMessage(true);
                        self.companies([]);
                    }
                    else {
                        if (data.GlobalBrandOwnersList.length > 0 && data.NationalBrandOwnersList.length > 0) {
                            self.showCompanyRadioOptions(true);
                        }
                        if (data.GlobalBrandOwnersList.length > 0) {
                            self.companies([{ companies: data.GlobalBrandOwnersList }]);
                        }
                        if (data.NationalBrandOwnersList.length > 0) {
                            self.companies([{ companies: data.NationalBrandOwnersList }]);
                        }
                    }
                    self.isLoading(false);
                });
            };
            CompanyBrowseSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedCompanyIds != null && self.selectedCompanyIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/CompanySummary"),
                        data: { selectedIds: self.companyIds },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            CompanyBrowseSearchViewModel.prototype.addCompany = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            CompanyBrowseSearchViewModel.prototype.removeCompany = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedCompanyIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            CompanyBrowseSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            CompanyBrowseSearchViewModel.prototype.clearAllCompaniesInternal = function () {
                var self = this;
                self.showCompanyRadioOptions(false);
                self.nationalBrandOwnersList([]);
                self.globalBrandOwnersList([]);
                self.companyFilterText("");
                self.companies([]);
                self.showClearButton(false);
                self.showNoResultsMessage(false);
            };
            CompanyBrowseSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.CategoriesAndTopics:
                        if (self.selectedCompanyIds().length == 0) {
                            self.isCategoryTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isCategoryTabEnabled(true);
                        }
                        break;
                    case Search.ActiveSearch.Geography:
                        if (self.selectedCompanyIds().length == 0 || self.selectedCategoryIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            CompanyBrowseSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedCompanyIds().length == 0 || self.selectedCountryCodes().length == 0 || self.selectedCategoryIds().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            CompanyBrowseSearchViewModel.prototype.getBreadCrumbRootItemName = function () {
                return "Companies";
            };
            return CompanyBrowseSearchViewModel;
        }(Browse.BaseBrowseSearchViewModel));
        Browse.CompanyBrowseSearchViewModel = CompanyBrowseSearchViewModel;
    })(Browse = Search.Browse || (Search.Browse = {}));
})(Search || (Search = {}));
//# sourceMappingURL=CompanyBrowseSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Browse;
    (function (Browse) {
        var GeographyBrowseSearchViewModel = (function (_super) {
            __extends(GeographyBrowseSearchViewModel, _super);
            function GeographyBrowseSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.geographies = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.Geography;
                self.searchType = initialData.SearchType;
                self.showNoFilterResultsMessage = ko.observable(false);
                self.countryFilterText = ko.observable(initialData.CountryFilterText);
                self.showClearButton = ko.observable(false);
                self.entryPoint = Search.EntryPoint.RunSearch;
                self.loadSubGeographies = function (item) {
                    self.addItemtoBreadCrumb(item);
                    return self.loadGeographies(item);
                };
                self.selectAllGeographies = function () {
                    return self.selectAllGeographiesInternal();
                };
                self.showNoGeographyMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
                self.applyGeographyFilter = function () {
                    return self.applyGeographyFilterInternal();
                };
                self.clearGeographyFilter = function () {
                    return self.clearGeographyFilterInternal();
                };
                self.highlightFilteredText = function (geographyName) {
                    return self.highlightFilteredTextInternal(geographyName);
                };
                self.loadBreadCrumbChildren = function (item) {
                    self.hideBreadCrumbDropDown();
                    var reduced = false;
                    do {
                        var lastItem = self.breadCrumbItems()[self.breadCrumbItems().length - 1];
                        if (item.Id == lastItem.Id) {
                            if (reduced) {
                                if (item.Id !== null) {
                                    self.loadGeographies(item);
                                }
                                else {
                                    self.loadGeographies();
                                }
                            }
                            return;
                        }
                        self.breadCrumbItems.pop();
                        reduced = true;
                    } while (true);
                };
                self.loadBreadCrumbContextChildren = function (item) {
                    if (item.HasChildren) {
                        self.hideBreadCrumbDropDown();
                        var reduced = false;
                        do {
                            var lastItem = self.breadCrumbItems()[self.breadCrumbItems().length - 1];
                            if (item.ParentId == lastItem.Id || lastItem.Id == null) {
                                if (reduced) {
                                    self.addItemtoBreadCrumb(item);
                                    if (item.Id !== null) {
                                        self.loadGeographies(item);
                                    }
                                    else {
                                        self.loadGeographies();
                                    }
                                }
                                return;
                            }
                            self.breadCrumbItems.pop();
                            reduced = true;
                        } while (true);
                    }
                };
                self.loadBreadCrumbDropdownMenu = function (item, event) {
                    if (item.Id == self.breadCrumbExpandedItem()) {
                        self.hideBreadCrumbDropDown();
                        return;
                    }
                    self.breadCrumbExpandedItem(item.Id);
                    self.breadCrumbExpandedTitle(item.Name);
                    if (item.Id !== null) {
                        self.loadBreadCrumbContext(item);
                    }
                    else {
                        self.loadBreadCrumbContext(null);
                    }
                    self.positioningBreadCrumb(event.target);
                    self.showBreadCrumbDropDown(true);
                };
                self.selectSubGeographies = function (item) {
                    self.selectSubGeographiesInternal(item);
                };
            }
            GeographyBrowseSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadGeographies();
                self.loadSummary();
                // Event Handler to Hide Definition on Document Click
                $(document).click(function () {
                    $("#DefinitionDiv").empty();
                    $("#DefinitionDiv").hide();
                });
                $(document).on("click touchstart", "input[id^='geography-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addGeography(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeGeography(itemToRemove);
                    }
                });
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeGeography(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedCountryCodes.removeAll();
                    self.summary.removeAll();
                    var selectAllCheckBox = document.getElementById("selectAllCheckBox");
                    selectAllCheckBox.checked = false;
                    $(".em-drilldown__select-all").children("span").removeClass('is-checked');
                    $('input:checkbox').removeAttr('checked');
                });
            };
            GeographyBrowseSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedCountryCodes().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            GeographyBrowseSearchViewModel.prototype.getBreadCrumbRootItemName = function () {
                var self = this;
                if (self.countryFilterText && self.countryFilterText()) {
                    return "Filtered Results";
                }
                return "Geographies";
            };
            GeographyBrowseSearchViewModel.prototype.loadGeographies = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                var countryCode = item == null ? undefined : item.Id;
                self.isLoading(true);
                self.canSelectAll(false);
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/GeographySearchAsync"),
                    data: {
                        searchType: self.searchType,
                        selectedProductIds: self.categoryIds(),
                        selectedIds: self.getSelectedIds(),
                        selectedCountryCodes: countryCode,
                        filterText: self.countryFilterText(),
                        entryPoint: self.entryPoint
                    },
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.geographies(data);
                    self.breadCrumbContext([]);
                    self.isLoading(false);
                    self.showNoFilterResultsMessage(data.Countries.length == 0);
                });
            };
            GeographyBrowseSearchViewModel.prototype.loadBreadCrumbContext = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                var countryCode = item == null ? undefined : item.Id;
                self.isMenuLoading(true);
                self.canSelectAll(false);
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/GeographySearchAsync"),
                    data: {
                        searchType: self.searchType,
                        selectedProductIds: self.categoryIds(),
                        selectedIds: self.getSelectedIds(),
                        selectedCountryCodes: countryCode,
                        filterText: self.countryFilterText(),
                        entryPoint: self.entryPoint
                    },
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.breadCrumbContext(data);
                    self.isMenuLoading(false);
                    self.showNoFilterResultsMessage(data.Countries.length == 0);
                });
            };
            GeographyBrowseSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedCountryCodes != null && self.selectedCountryCodes().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/GeographySummary"),
                        data: { selectedIds: self.countryCodes },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        _.each(data, function (dataItem) {
                            underlyingSummary.push({ id: dataItem.id, name: dataItem.name });
                        });
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            GeographyBrowseSearchViewModel.prototype.loadPredefinedGeographies = function (predefinedGeographyIds) {
                var self = this;
                if (predefinedGeographyIds != null) {
                    self.isLoading(true);
                    self.isSummaryLoading(true);
                    // Push to Search Section
                    var underlyingSelectedGeographyIds = [];
                    _.each(predefinedGeographyIds.split(','), function (productId) {
                        underlyingSelectedGeographyIds.push(productId);
                    });
                    self.selectedCountryCodes.removeAll();
                    self.selectedCountryCodes.push.apply(self.selectedCountryCodes, underlyingSelectedGeographyIds);
                    // Push to Summary Section
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/GeographySummary"),
                        data: {
                            selectedIds: self.countryCodes,
                            searchType: self.searchType
                        },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.removeAll();
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isLoading(false);
                        self.isSummaryLoading(false);
                    });
                }
            };
            GeographyBrowseSearchViewModel.prototype.addGeography = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(self.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            GeographyBrowseSearchViewModel.prototype.removeGeography = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(self.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedCountryCodes.remove(itemToBeRemoved.id);
                }
                return true;
            };
            GeographyBrowseSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            // #region KO Methods Binding
            GeographyBrowseSearchViewModel.prototype.selectAllGeographiesInternal = function () {
                var self = this;
                if (self.canSelectAll()) {
                    _.each(self.geographies(), function (geographies) {
                        _.each(geographies, function (country) {
                            if (country.IsEnabled == true) {
                                if (_.contains(self.selectedCountryCodes(), country.Id) == false) {
                                    self.selectedCountryCodes.push(country.Id);
                                    self.addGeography({ id: country.Id, name: country.Name });
                                }
                            }
                        });
                    });
                }
                else {
                    _.each(this.geographies(), function (geographies) {
                        _.each(geographies, function (country) {
                            self.selectedCountryCodes.remove(country.Id);
                            self.removeGeography({ id: country.Id, name: country.Name });
                        });
                    });
                }
                return true;
            };
            GeographyBrowseSearchViewModel.prototype.applyGeographyFilterInternal = function () {
                var self = this;
                self.clearFooterMessage();
                var minFilterLength = 3;
                var maxFilterLength = 254;
                if (self.countryFilterText() == null || self.countryFilterText().length == 0) {
                    self.DisplayFooterMessage("Please enter keywords to search");
                    return;
                }
                if (self.countryFilterText().length < minFilterLength
                    || self.countryFilterText().length > maxFilterLength) {
                    self.DisplayFooterMessage("Please enter a minimum of " + minFilterLength +
                        " and a maximum of " + maxFilterLength + " characters for keyword Search");
                    return;
                }
                self.showClearButton(true);
                self.initializeBreadCrumb();
                self.loadGeographies();
            };
            GeographyBrowseSearchViewModel.prototype.clearGeographyFilterInternal = function () {
                var self = this;
                self.countryFilterText(null);
                self.showClearButton(false);
                self.loadGeographies();
                self.initializeBreadCrumb();
            };
            GeographyBrowseSearchViewModel.prototype.highlightFilteredTextInternal = function (geographyName) {
                var self = this;
                if (self.countryFilterText() != null) {
                    var filteredTextLowerCase = self.countryFilterText().toLowerCase().trim();
                    var geographyNameLowerCase = geographyName.toLowerCase().trim();
                    var matchedStringLowerCase = geographyNameLowerCase.match(filteredTextLowerCase);
                    if (matchedStringLowerCase != null && matchedStringLowerCase.length >= 1) {
                        var indexOfMatchedString = geographyNameLowerCase.indexOf(matchedStringLowerCase.toString());
                        var matchedStringOrignalCase = geographyName.substr(indexOfMatchedString, matchedStringLowerCase.toString().length);
                        var regex = new RegExp(matchedStringOrignalCase.toString(), "g");
                        var formattedGeographyname = geographyName.replace(regex, '<strong>' + matchedStringOrignalCase.toString() + '</strong>');
                        return formattedGeographyname;
                    }
                }
                return geographyName;
            };
            GeographyBrowseSearchViewModel.prototype.contractTextBox = function () {
                $('#geographySearchDiv').removeClass('emi-category-search');
                $('#geographySearchDiv').addClass('emi-category-search emi-input-530');
            };
            GeographyBrowseSearchViewModel.prototype.expandTextBox = function () {
                $('#geographySearchDiv').removeClass('emi-category-search emi-input-530');
                $('#geographySearchDiv').addClass('emi-category-search');
            };
            GeographyBrowseSearchViewModel.prototype.selectSubGeographiesInternal = function (countryCode) {
                var _this = this;
                var self = this;
                var isSelectAllChecked = $("#selectSubGeographies" + countryCode).is(':checked');
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/SubGeographySearchAsync"),
                    data: {
                        searchType: self.searchType,
                        productIds: self.categoryIds(),
                        countryCode: countryCode,
                        selectedIds: self.getSelectedIds()
                    },
                    type: "POST",
                }).done(function (data) {
                    var underlyingSummary = ko.observableArray(self.summary());
                    var underlyingSelectedCountryCodes = ko.observableArray(self.selectedCountryCodes());
                    if (isSelectAllChecked) {
                        _.each(data, function (dataItem) {
                            if (_.contains(_this.selectedCountryCodes(), dataItem.CountryCode) == false) {
                                underlyingSelectedCountryCodes.push(dataItem.CountryCode);
                            }
                            var itemAlreadySelected = ko.utils.arrayFirst(_this.summary(), function (item) { return item.id === dataItem.CountryCode; });
                            if (itemAlreadySelected === null) {
                                underlyingSummary.push({ id: dataItem.CountryCode, name: dataItem.CountryName });
                            }
                        });
                        self.isSummaryLoading(false);
                        $("#selectSubGeographies" + countryCode).prop('checked', true); // For IE8 
                    }
                    else {
                        _.each(data, function (dataItem) {
                            underlyingSummary.remove(function (element) { return element.id == dataItem.CountryCode; });
                            underlyingSelectedCountryCodes.remove(dataItem.CountryCode);
                        });
                        $("#selectSubGeographies" + countryCode).prop('checked', false); // For IE8 
                    }
                    self.selectedCountryCodes.valueHasMutated(); //syncing self.selectedCountryCodes and underlyingSelectedCountryCodes
                    self.summary.valueHasMutated();
                    self.scrollSummaryArea();
                });
            };
            return GeographyBrowseSearchViewModel;
        }(Browse.BaseBrowseSearchViewModel));
        Browse.GeographyBrowseSearchViewModel = GeographyBrowseSearchViewModel;
    })(Browse = Search.Browse || (Search.Browse = {}));
})(Search || (Search = {}));
//# sourceMappingURL=GeographyBrowseSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Browse;
    (function (Browse) {
        var ClosureBrowseSearchViewModel = (function (_super) {
            __extends(ClosureBrowseSearchViewModel, _super);
            function ClosureBrowseSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.closures = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.ClosureType;
                self.searchType = initialData.SearchType;
                self.entryPoint = initialData.EntryPoint;
                self.selectAllClosures = function () {
                    return self.selectAllClosuresInternal();
                };
                self.showNoClosuresMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
            }
            ClosureBrowseSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadClosures();
                self.loadSummary();
                // Search Section
                $(document).on("click touchstart", "input[id^='closure-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addClosure(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeClosure(itemToRemove);
                    }
                });
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeClosure(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedClosureIds.removeAll();
                    self.summary.removeAll();
                    var selectAllCheckBox = document.getElementById("selectAllCheckBox");
                    selectAllCheckBox.checked = false;
                });
            };
            ClosureBrowseSearchViewModel.prototype.loadClosures = function () {
                var self = this;
                self.isLoading(true);
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/ClosureSearchAsync"),
                    data: {
                        entryPoint: self.entryPoint
                    },
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.closures(data);
                    self.isLoading(false);
                });
            };
            ClosureBrowseSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedClosureIds != null && self.selectedClosureIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/ClosureSummary"),
                        data: { selectedIds: self.closureIds },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            ClosureBrowseSearchViewModel.prototype.addClosure = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            ClosureBrowseSearchViewModel.prototype.removeClosure = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedClosureIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            ClosureBrowseSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            // #region KO Methods Binding
            ClosureBrowseSearchViewModel.prototype.selectAllClosuresInternal = function () {
                var self = this;
                if (self.canSelectAll()) {
                    _.each(self.closures(), function (closures) {
                        _.each(closures, function (closure) {
                            if (_.contains(self.selectedClosureIds(), closure.Id) == false) {
                                self.selectedClosureIds.push(closure.Id);
                                self.addClosure({ id: closure.Id, name: closure.Name });
                            }
                        });
                    });
                }
                else {
                    _.each(this.closures(), function (closures) {
                        _.each(closures, function (closure) {
                            self.selectedClosureIds.remove(closure.Id);
                            self.removeClosure({ id: closure.Id, name: closure.Name });
                        });
                    });
                }
                return true;
            };
            ClosureBrowseSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.CategoriesAndTopics:
                        if (self.selectedClosureIds().length == 0) {
                            self.isCategoryTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isCategoryTabEnabled(true);
                        }
                        break;
                    case Search.ActiveSearch.Geography:
                        if (self.selectedCategoryIds().length == 0 || self.selectedClosureIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
                // #endregion
            };
            ClosureBrowseSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedClosureIds().length == 0 || self.selectedCountryCodes().length == 0 || self.selectedCategoryIds().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            ClosureBrowseSearchViewModel.prototype.getBreadCrumbRootItemName = function () {
                return "Closures";
            };
            return ClosureBrowseSearchViewModel;
        }(Browse.BaseBrowseSearchViewModel));
        Browse.ClosureBrowseSearchViewModel = ClosureBrowseSearchViewModel;
    })(Browse = Search.Browse || (Search.Browse = {}));
})(Search || (Search = {}));
//# sourceMappingURL=ClosureBrowseSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Browse;
    (function (Browse) {
        var PackagingBrowseSearchViewModel = (function (_super) {
            __extends(PackagingBrowseSearchViewModel, _super);
            function PackagingBrowseSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.packages = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.Packaging;
                self.searchType = initialData.SearchType;
                self.entryPoint = initialData.EntryPoint;
                self.loadSubPackages = function (item) {
                    self.addItemtoBreadCrumb(item);
                    return self.loadPackages(item);
                };
                self.selectAllPackages = function () {
                    return self.selectAllPackagesInternal();
                };
                self.showNoPackagingMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
                self.loadBreadCrumbChildren = function (item) {
                    self.hideBreadCrumbDropDown();
                    var reduced = false;
                    do {
                        var lastItem = self.breadCrumbItems()[self.breadCrumbItems().length - 1];
                        if (item.Id == lastItem.Id) {
                            if (reduced) {
                                if (item.Id !== null) {
                                    self.loadPackages(item);
                                }
                                else {
                                    self.loadPackages();
                                }
                            }
                            return;
                        }
                        self.breadCrumbItems.pop();
                        reduced = true;
                    } while (true);
                };
                self.loadBreadCrumbContextChildren = function (item) {
                    if (item.HasChildren) {
                        self.hideBreadCrumbDropDown();
                        var reduced = false;
                        do {
                            var lastItem = self.breadCrumbItems()[self.breadCrumbItems().length - 1];
                            if (item.ParentId == lastItem.Id || lastItem.Id == null) {
                                if (reduced) {
                                    self.addItemtoBreadCrumb(item);
                                    if (item.Id !== null) {
                                        self.loadPackages(item);
                                    }
                                    else {
                                        self.loadPackages();
                                    }
                                }
                                return;
                            }
                            self.breadCrumbItems.pop();
                            reduced = true;
                        } while (true);
                    }
                };
                self.loadBreadCrumbDropdownMenu = function (item, event) {
                    if (item.Id == self.breadCrumbExpandedItem()) {
                        self.hideBreadCrumbDropDown();
                        return;
                    }
                    self.breadCrumbExpandedItem(item.Id);
                    self.breadCrumbExpandedTitle(item.Name);
                    if (item.Id !== null) {
                        self.loadBreadCrumbSubContext(item);
                    }
                    else {
                        self.loadBreadCrumbContext();
                    }
                    self.positioningBreadCrumb(event.target);
                    self.showBreadCrumbDropDown(true);
                };
                self.selectSubPackages = function (item) {
                    self.selectSubPackagesInternal(item);
                };
            }
            PackagingBrowseSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadPackages();
                self.loadSummary();
                // Search Section
                $(document).on("click touchstart", "input[id^='packaging-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addPackaging(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removePackaging(itemToRemove);
                    }
                });
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removePackaging(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedPackagingIds.removeAll();
                    self.summary.removeAll();
                    var selectAllCheckBox = document.getElementById("selectAllCheckBox");
                    selectAllCheckBox.checked = false;
                    $(".em-drilldown__select-all").children("span").removeClass('is-checked');
                    $('input:checkbox').removeAttr('checked');
                });
            };
            PackagingBrowseSearchViewModel.prototype.loadPackages = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                var packTypeId = item == null ? undefined : item.Id;
                self.isLoading(true);
                // Deselect selectAll checkbox while navigate
                self.canSelectAll(false);
                $.ajax({
                    url: self.getBaseUrl("/Search/PackagingTypeSearchAsync"),
                    type: "POST",
                    data: {
                        packTypeId: packTypeId,
                        entrypoint: self.entryPoint
                    },
                    global: false
                }).done(function (data) {
                    self.packages(data);
                    self.breadCrumbContext([]);
                    self.isLoading(false);
                });
            };
            PackagingBrowseSearchViewModel.prototype.loadBreadCrumbContext = function () {
                var self = this;
                self.isMenuLoading(true);
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/PackagingTypeSearchAsync"),
                    type: "POST",
                    data: { entrypoint: self.entryPoint },
                    global: false
                }).done(function (data) {
                    self.breadCrumbContext(data);
                    self.isMenuLoading(false);
                });
            };
            PackagingBrowseSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedPackagingIds != null && self.selectedPackagingIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/PackagingSummary"),
                        data: { selectedIds: self.packagingIds },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            PackagingBrowseSearchViewModel.prototype.addPackaging = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            PackagingBrowseSearchViewModel.prototype.removePackaging = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedPackagingIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            PackagingBrowseSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            PackagingBrowseSearchViewModel.prototype.loadBreadCrumbSubContext = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                self.isMenuLoading(true);
                // Deselect selectAll checkbox while navigate
                self.canSelectAll(false);
                $.ajax({
                    url: self.getBaseUrl("/Search/PackagingTypeSearchAsync"),
                    type: "POST",
                    data: {
                        packTypeId: item.Id,
                        entrypoint: self.entryPoint
                    },
                    global: false
                }).done(function (data) {
                    self.breadCrumbContext(data);
                    self.isMenuLoading(false);
                });
            };
            PackagingBrowseSearchViewModel.prototype.selectAllPackagesInternal = function () {
                var self = this;
                if (self.canSelectAll()) {
                    _.each(self.packages(), function (packages) {
                        _.each(packages, function (pack) {
                            if (_.contains(self.selectedPackagingIds(), pack.Id) == false) {
                                self.selectedPackagingIds.push(pack.Id);
                                self.addPackaging({ id: pack.Id, name: pack.Name });
                            }
                        });
                    });
                }
                else {
                    _.each(this.packages(), function (packages) {
                        _.each(packages, function (pack) {
                            self.selectedPackagingIds.remove(pack.Id);
                            self.removePackaging({ id: pack.Id, name: pack.Name });
                        });
                    });
                }
                return true;
            };
            PackagingBrowseSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.CategoriesAndTopics:
                        if (self.selectedPackagingIds().length == 0) {
                            self.isCategoryTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isCategoryTabEnabled(true);
                        }
                        break;
                    case Search.ActiveSearch.Geography:
                        if (self.selectedPackagingIds().length == 0 || self.selectedCategoryIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            PackagingBrowseSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedPackagingIds().length == 0 || self.selectedCountryCodes().length == 0 || self.selectedCategoryIds().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            PackagingBrowseSearchViewModel.prototype.getBreadCrumbRootItemName = function () {
                return "Packaging";
            };
            PackagingBrowseSearchViewModel.prototype.selectSubPackagesInternal = function (packageId) {
                var _this = this;
                var self = this;
                var isSelectSubCategory = $("#selectSubPackages" + packageId).is(':checked');
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/SubPackTypeSearchAsync"),
                    data: { packTypeId: packageId },
                    type: "POST",
                }).done(function (data) {
                    var underlyingSummary = ko.observableArray(self.summary());
                    var underlyingSelectedPackageIds = ko.observableArray(self.selectedPackagingIds());
                    if (isSelectSubCategory) {
                        _.each(data, function (dataItem) {
                            if (_.contains(_this.selectedPackagingIds(), dataItem.PackTypeID) == false) {
                                underlyingSelectedPackageIds.push(dataItem.PackTypeID);
                            }
                            var itemAlreadySelected = ko.utils.arrayFirst(_this.summary(), function (item) { return item.id === dataItem.PackTypeID; });
                            if (itemAlreadySelected === null) {
                                underlyingSummary.push({ id: dataItem.PackTypeID, name: dataItem.PackTypeName });
                            }
                        });
                        self.isSummaryLoading(false);
                        $("#selectSubPackages" + packageId).prop('checked', true); // For IE8 
                    }
                    else {
                        _.each(data, function (dataItem) {
                            underlyingSummary.remove(function (element) { return element.id == dataItem.PackTypeID; });
                            underlyingSelectedPackageIds.remove(dataItem.PackTypeID);
                        });
                        $("#selectSubPackages" + packageId).prop('checked', false); // For IE8 
                    }
                    self.selectedPackagingIds.valueHasMutated(); //syncing self.selectedPackagingIds and underlyingSelectedPackTypeIds
                    self.summary.valueHasMutated();
                    self.scrollSummaryArea();
                });
            };
            return PackagingBrowseSearchViewModel;
        }(Browse.BaseBrowseSearchViewModel));
        Browse.PackagingBrowseSearchViewModel = PackagingBrowseSearchViewModel;
    })(Browse = Search.Browse || (Search.Browse = {}));
})(Search || (Search = {}));
//# sourceMappingURL=PackagingBrowseSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Browse;
    (function (Browse) {
        var SurveyBrowseSearchViewModel = (function (_super) {
            __extends(SurveyBrowseSearchViewModel, _super);
            function SurveyBrowseSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.surveys = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.Survey;
                self.searchType = initialData.SearchType;
                self.entryPoint = initialData.EntryPoint;
                self.loadSubSurveys = function (item) {
                    self.addItemtoBreadCrumb(item);
                    return self.loadSurveys(item);
                };
                self.selectAllSurveys = function () {
                    return self.selectAllSurveysInternal();
                };
                self.showNoSurveyMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
            }
            SurveyBrowseSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadSurveys();
                self.loadSummary();
                // Search Section
                $(document).on("click touchstart", "input[id^='survey-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addSurvey(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeSurvey(itemToRemove);
                    }
                });
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeSurvey(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedSurveyIds.removeAll();
                    self.summary.removeAll();
                    var selectAllCheckBox = document.getElementById("selectAllCheckBox");
                    selectAllCheckBox.checked = false;
                });
            };
            SurveyBrowseSearchViewModel.prototype.getBreadCrumbRootItemName = function () {
                return "Lifestyles";
            };
            SurveyBrowseSearchViewModel.prototype.loadSurveys = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                self.isLoading(true);
                self.canSelectAll(false);
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/SurveySearchAsync"),
                    data: {
                        entryPoint: self.entryPoint
                    },
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.surveys(data);
                    self.isLoading(false);
                });
            };
            SurveyBrowseSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedSurveyIds != null && self.selectedSurveyIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/SurveySummary"),
                        data: { selectedIds: self.surveyIds },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            SurveyBrowseSearchViewModel.prototype.addSurvey = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            SurveyBrowseSearchViewModel.prototype.removeSurvey = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedSurveyIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            SurveyBrowseSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            SurveyBrowseSearchViewModel.prototype.selectAllSurveysInternal = function () {
                var _this = this;
                var self = this;
                if (this.canSelectAll()) {
                    _.each(this.surveys(), function (surveys) {
                        _.each(surveys.Surveys, function (survey) {
                            if (survey.IsEnabled == true) {
                                if (_.contains(_this.selectedSurveyIds(), survey.Id) == false) {
                                    self.selectedSurveyIds.push(survey.Id);
                                    self.addSurvey({ id: survey.Id, name: survey.Name });
                                }
                            }
                        });
                    });
                }
                else {
                    _.each(this.surveys(), function (surveys) {
                        _.each(surveys.Surveys, function (survey) {
                            self.selectedSurveyIds.remove(survey.Id);
                            self.removeSurvey({ id: survey.Id, name: survey.Name });
                        });
                    });
                }
                return true;
            };
            SurveyBrowseSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.Geography:
                        if (self.selectedSurveyIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            SurveyBrowseSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedSurveyIds().length == 0 || self.selectedCountryCodes().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            return SurveyBrowseSearchViewModel;
        }(Browse.BaseBrowseSearchViewModel));
        Browse.SurveyBrowseSearchViewModel = SurveyBrowseSearchViewModel;
    })(Browse = Search.Browse || (Search.Browse = {}));
})(Search || (Search = {}));
//# sourceMappingURL=SurveyBrowseSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Browse;
    (function (Browse) {
        var BrandBrowseSearchViewModel = (function (_super) {
            __extends(BrandBrowseSearchViewModel, _super);
            function BrandBrowseSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.showClearButton = ko.observable(false);
                self.showBrandRadioOptions = ko.observable(false);
                self.showNoResultsMessage = ko.observable(false);
                self.selectedBrandLevel = ko.observable(Search.BrandOwnerType.UBN.toString());
                self.brands = ko.observableArray([]);
                self.umbrellaBrandNamesList = ko.observableArray([]);
                self.globalBrandNamesList = ko.observableArray([]);
                self.brandFilterText = ko.observable("");
                self.activeSearch = Search.ActiveSearch.Brands;
                self.searchType = initialData.SearchType;
                self.showNoBrandMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
                self.loadAllBrands = function () {
                    return self.loadBrands();
                };
                self.clearAllBrands = function () {
                    return self.clearAllBrandsInternal();
                };
            }
            BrandBrowseSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadSummary();
                $(document).on("click touchstart", "input[id^='brand-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addBrand(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeBrand(itemToRemove);
                    }
                });
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeBrand(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedBrandIds.removeAll();
                    self.summary.removeAll();
                });
                $(document).on("click touchstart", "#ClearBrandSearchButton", function () {
                    $("#brandSearchTextbox").blur();
                });
            };
            BrandBrowseSearchViewModel.prototype.loadUmbrellaBrandNames = function () {
                var self = this;
                self.isLoading(true);
                self.brands([{ brands: self.umbrellaBrandNamesList() }]);
                self.isLoading(false);
                return true;
            };
            BrandBrowseSearchViewModel.prototype.loadGlobalBrandNames = function () {
                var self = this;
                self.isLoading(true);
                self.brands([{ brands: self.globalBrandNamesList() }]);
                self.isLoading(false);
                return true;
            };
            BrandBrowseSearchViewModel.prototype.loadBrands = function () {
                var self = this;
                self.clearFooterMessage();
                var minFilterLength = 2;
                var maxFilterLength = 254;
                if (self.brandFilterText().length == 0) {
                    self.DisplayFooterMessage("Please enter keywords to search");
                    return;
                }
                if (self.brandFilterText().length < minFilterLength
                    || self.brandFilterText().length > maxFilterLength) {
                    self.DisplayFooterMessage("Please enter a minimum of " + minFilterLength +
                        " and a maximum of " + maxFilterLength + " characters for keyword Search");
                    return;
                }
                self.selectedBrandLevel(Search.BrandOwnerType.UBN.toString());
                self.showBrandRadioOptions(false);
                self.showNoResultsMessage(false);
                self.isLoading(true);
                self.showClearButton(true);
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/BrandSearchAsync"),
                    data: {
                        brandFilterText: self.brandFilterText()
                    },
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.umbrellaBrandNamesList(data.UmbrellaBrandNameList);
                    self.globalBrandNamesList(data.GlobalBrandNameList);
                    if (data.GlobalBrandNameList.length <= 0 && data.UmbrellaBrandNameList.length <= 0) {
                        self.showNoResultsMessage(true);
                        self.brands([]);
                    }
                    else {
                        if (data.GlobalBrandNameList.length > 0 && data.UmbrellaBrandNameList.length > 0) {
                            self.showBrandRadioOptions(true);
                        }
                        if (data.GlobalBrandNameList.length > 0) {
                            self.brands([{ brands: data.GlobalBrandNameList }]);
                        }
                        if (data.UmbrellaBrandNameList.length > 0) {
                            self.brands([{ brands: data.UmbrellaBrandNameList }]);
                        }
                    }
                    self.isLoading(false);
                });
            };
            BrandBrowseSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedBrandIds != null && self.selectedBrandIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/BrandSummary"),
                        data: { selectedIds: self.brandIds },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            BrandBrowseSearchViewModel.prototype.addBrand = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            BrandBrowseSearchViewModel.prototype.removeBrand = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedBrandIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            BrandBrowseSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            BrandBrowseSearchViewModel.prototype.clearAllBrandsInternal = function () {
                var self = this;
                self.showBrandRadioOptions(false);
                self.umbrellaBrandNamesList([]);
                self.globalBrandNamesList([]);
                self.brandFilterText("");
                self.brands([]);
                self.showClearButton(false);
                self.showNoResultsMessage(false);
            };
            BrandBrowseSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.CategoriesAndTopics:
                        if (self.selectedBrandIds().length == 0) {
                            self.isCategoryTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isCategoryTabEnabled(true);
                        }
                        break;
                    case Search.ActiveSearch.Geography:
                        if (self.selectedBrandIds().length == 0 || self.selectedCategoryIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            BrandBrowseSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedBrandIds().length == 0 || self.selectedCountryCodes().length == 0 || self.selectedCategoryIds().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            BrandBrowseSearchViewModel.prototype.getBreadCrumbRootItemName = function () {
                return "Brands";
            };
            return BrandBrowseSearchViewModel;
        }(Browse.BaseBrowseSearchViewModel));
        Browse.BrandBrowseSearchViewModel = BrandBrowseSearchViewModel;
    })(Browse = Search.Browse || (Search.Browse = {}));
})(Search || (Search = {}));
//# sourceMappingURL=BrandBrowseSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Browse;
    (function (Browse) {
        var NutritionBrowseSearchViewModel = (function (_super) {
            __extends(NutritionBrowseSearchViewModel, _super);
            function NutritionBrowseSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.nutrients = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.Nutrition;
                self.entryPoint = initialData.EntryPoint;
                self.searchType = initialData.SearchType;
                self.selectAllNutrients = function () {
                    return self.selectAllNutrientsInternal();
                };
                self.showNoNutrientsMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
            }
            NutritionBrowseSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadNutrients();
                self.loadSummary();
                // Search Section
                $(document).on("click touchstart", "input[id^='nutrient-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addNutrient(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeNutrient(itemToRemove);
                    }
                });
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeNutrient(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedNutrientIds.removeAll();
                    self.summary.removeAll();
                });
            };
            NutritionBrowseSearchViewModel.prototype.loadNutrients = function () {
                var self = this;
                self.isLoading(true);
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/NutrientTypeSearchAsync"),
                    data: {
                        entrypoint: self.entryPoint
                    },
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.nutrients(data);
                    self.isLoading(false);
                });
            };
            NutritionBrowseSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedNutrientIds != null && self.selectedNutrientIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/NutritionSummary"),
                        data: { selectedIds: self.nutrientIds },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            NutritionBrowseSearchViewModel.prototype.addNutrient = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            NutritionBrowseSearchViewModel.prototype.removeNutrient = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedNutrientIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            NutritionBrowseSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            NutritionBrowseSearchViewModel.prototype.selectAllNutrientsInternal = function () {
                var self = this;
                if (self.canSelectAll()) {
                    _.each(self.nutrients(), function (nutrients) {
                        _.each(nutrients, function (nutrient) {
                            if (_.contains(self.selectedNutrientIds(), nutrient.Id) == false) {
                                self.selectedNutrientIds.push(nutrient.Id);
                                self.addNutrient({ id: nutrient.Id, name: nutrient.Name });
                            }
                        });
                    });
                }
                else {
                    _.each(this.nutrients(), function (nutrients) {
                        _.each(nutrients, function (nutrient) {
                            self.selectedNutrientIds.remove(nutrient.Id);
                            self.removeNutrient({ id: nutrient.Id, name: nutrient.Name });
                        });
                    });
                }
                return true;
            };
            NutritionBrowseSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.CategoriesAndTopics:
                        if (self.selectedNutrientIds().length == 0) {
                            self.isCategoryTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isCategoryTabEnabled(true);
                        }
                        break;
                    case Search.ActiveSearch.Geography:
                        if (self.selectedNutrientIds().length == 0 || self.selectedCategoryIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            NutritionBrowseSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedNutrientIds().length == 0 || self.selectedCountryCodes().length == 0 || self.selectedCategoryIds().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            NutritionBrowseSearchViewModel.prototype.getBreadCrumbRootItemName = function () {
                return "Nutrition";
            };
            return NutritionBrowseSearchViewModel;
        }(Browse.BaseBrowseSearchViewModel));
        Browse.NutritionBrowseSearchViewModel = NutritionBrowseSearchViewModel;
    })(Browse = Search.Browse || (Search.Browse = {}));
})(Search || (Search = {}));
//# sourceMappingURL=NutritionBrowseSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Browse;
    (function (Browse) {
        var ForeignMarketBrowseSearchViewModel = (function (_super) {
            __extends(ForeignMarketBrowseSearchViewModel, _super);
            function ForeignMarketBrowseSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.foreignMarkets = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.ForeignMarket;
                self.searchType = initialData.SearchType;
                self.entryPoint = initialData.EntryPoint;
                self.selectAllForeignMarket = function () {
                    return self.selectAllForeignMarketsInternal();
                };
                self.showNoForeignMarketMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
            }
            ForeignMarketBrowseSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.loadForeignMarkets();
                self.loadSummary();
                // Search Section
                $(document).on("click touchstart", "input[id^='foreignMarket-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addForeignMarket(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeForeignMarket(itemToRemove);
                    }
                });
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeForeignMarket(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedForeignMarketIds.removeAll();
                    self.summary.removeAll();
                    var selectAllCheckBox = document.getElementById("selectAllCheckBox");
                    selectAllCheckBox.checked = false;
                });
            };
            ForeignMarketBrowseSearchViewModel.prototype.loadForeignMarkets = function () {
                var self = this;
                self.isLoading(true);
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/ForeignMarketSearchAsync"),
                    data: {
                        entryPoint: self.entryPoint
                    },
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.foreignMarkets(data);
                    self.isLoading(false);
                });
            };
            ForeignMarketBrowseSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedForeignMarketIds != null && self.selectedForeignMarketIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/ForeignMarketSummary"),
                        data: { selectedIds: self.foreignMarketIds },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            ForeignMarketBrowseSearchViewModel.prototype.addForeignMarket = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            ForeignMarketBrowseSearchViewModel.prototype.removeForeignMarket = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedForeignMarketIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            ForeignMarketBrowseSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            ForeignMarketBrowseSearchViewModel.prototype.selectAllForeignMarketsInternal = function () {
                var self = this;
                var underlyingSelectedForeignMarketIds = [];
                var underlyingsummary = [];
                if (self.canSelectAll()) {
                    _.each(self.foreignMarkets(), function (foreignMarkets) {
                        _.each(foreignMarkets, function (foreignMarket) {
                            if (_.contains(self.selectedForeignMarketIds(), foreignMarket.Id) == false) {
                                underlyingSelectedForeignMarketIds.push(foreignMarket.Id);
                                underlyingsummary.push({ id: foreignMarket.Id, name: foreignMarket.Name });
                            }
                        });
                    });
                }
                else {
                    self.selectedForeignMarketIds.removeAll();
                    self.summary.removeAll();
                }
                self.selectedForeignMarketIds.push.apply(self.selectedForeignMarketIds, underlyingSelectedForeignMarketIds);
                self.summary.push.apply(self.summary, underlyingsummary);
                self.scrollSummaryArea();
                return true;
            };
            ForeignMarketBrowseSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.CategoriesAndTopics:
                        if (self.selectedForeignMarketIds().length == 0) {
                            self.isCategoryTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isCategoryTabEnabled(true);
                        }
                        break;
                    case Search.ActiveSearch.Geography:
                        if (self.selectedForeignMarketIds().length == 0 || self.selectedCategoryIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            ForeignMarketBrowseSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedForeignMarketIds().length == 0 || self.selectedCountryCodes().length == 0 || self.selectedCategoryIds().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            ForeignMarketBrowseSearchViewModel.prototype.getBreadCrumbRootItemName = function () {
                return "Foreign Markets";
            };
            return ForeignMarketBrowseSearchViewModel;
        }(Browse.BaseBrowseSearchViewModel));
        Browse.ForeignMarketBrowseSearchViewModel = ForeignMarketBrowseSearchViewModel;
    })(Browse = Search.Browse || (Search.Browse = {}));
})(Search || (Search = {}));
//# sourceMappingURL=ForeignMarketBrowseSearchViewModel.js.map;
/// <reference path="../../../typings/knockout.d.ts" />
/// <reference path="../../../typings/underscore.d.ts" />
/// <reference path="../../../typings/jquery/jquery.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Search;
(function (Search) {
    var Browse;
    (function (Browse) {
        var EthicalLabelsBrowseSearchViewModel = (function (_super) {
            __extends(EthicalLabelsBrowseSearchViewModel, _super);
            function EthicalLabelsBrowseSearchViewModel(initialData) {
                _super.call(this, initialData);
                var self = this;
                self.ethicalLabelsTypes = ko.observableArray([]);
                self.activeSearch = Search.ActiveSearch.EthicalLabels;
                self.searchType = initialData.SearchType;
                self.loadSubEthicalLabelType = function (item) {
                    self.addItemtoBreadCrumb(item);
                    return self.loadSubEthicalLabelTypeInternal(item);
                };
                self.selectAllEthicalLabelsType = function () {
                    return self.selectAllEthicalLabelsTypeInternal();
                };
                self.showNoEthicalLabelTypeMessage = ko.computed(function () {
                    return self.summary().length == 0;
                });
                self.showClearAll = ko.computed(function () {
                    return self.summary().length > 0;
                });
                self.loadBreadCrumbChildren = function (item) {
                    self.hideBreadCrumbDropDown();
                    var reduced = false;
                    do {
                        var lastItem = self.breadCrumbItems()[self.breadCrumbItems().length - 1];
                        if (item.Id == lastItem.Id) {
                            if (reduced) {
                                if (item.Id !== null) {
                                    self.loadSubEthicalLabelTypeInternal(item);
                                }
                                else {
                                    self.loadEthicalLabelTypes();
                                }
                            }
                            return;
                        }
                        self.breadCrumbItems.pop();
                        reduced = true;
                    } while (true);
                };
                self.loadBreadCrumbContextChildren = function (item) {
                    if (item.HasChildren) {
                        self.hideBreadCrumbDropDown();
                        var reduced = false;
                        do {
                            var lastItem = self.breadCrumbItems()[self.breadCrumbItems().length - 1];
                            if (item.ParentId == lastItem.Id || lastItem.Id == null) {
                                if (reduced) {
                                    self.addItemtoBreadCrumb(item);
                                    if (item.Id !== null) {
                                        self.loadSubEthicalLabelTypeInternal(item);
                                    }
                                    else {
                                        self.loadEthicalLabelTypes();
                                    }
                                }
                                return;
                            }
                            self.breadCrumbItems.pop();
                            reduced = true;
                        } while (true);
                    }
                };
                self.loadBreadCrumbDropdownMenu = function (item, event) {
                    if (item.Id == self.breadCrumbExpandedItem()) {
                        self.hideBreadCrumbDropDown();
                        return;
                    }
                    self.breadCrumbExpandedItem(item.Id);
                    self.breadCrumbExpandedTitle(item.Name);
                    if (item.Id !== null) {
                        self.loadBreadCrumbSubContext(item);
                    }
                    else {
                        self.loadBreadCrumbContext();
                    }
                    self.positioningBreadCrumb(event.target);
                    self.showBreadCrumbDropDown(true);
                };
                self.selectAllChildren = function (item) {
                    self.SelectAllChildrenInternal(item);
                };
            }
            EthicalLabelsBrowseSearchViewModel.prototype.initialize = function () {
                var self = this;
                self.initializeBreadCrumb();
                if (self.shouldExpand) {
                    self.addBreadcrumbItems();
                    self.loadSubEthicalLabelTypeInternal({ Id: self.parentId });
                }
                else {
                    self.loadEthicalLabelTypes();
                }
                self.loadSummary();
                // Search Section
                $(document).on("click touchstart", "input[id^='ethicalLabel-choice']", function () {
                    var id = $(this).val();
                    var text = $(this).next().next().text();
                    if (this.checked) {
                        var itemToAdd = { id: id, name: text };
                        self.addEthicalLabelType(itemToAdd);
                    }
                    else {
                        var itemToRemove = { id: id, name: text };
                        self.removeEthicalLabelType(itemToRemove);
                    }
                });
                // Summary Section
                $(document).on("click touchstart", "#removeItem", function () {
                    var itemToRemove = ko.dataFor(this);
                    var checkboxes = $(":input[value='" + itemToRemove.id + "']");
                    $(checkboxes).prop('checked', false).trigger("change");
                    self.removeEthicalLabelType(itemToRemove);
                });
                $(document).on("click touchstart", "#clearAll", function () {
                    self.selectedEthicalTypeIds.removeAll();
                    self.summary.removeAll();
                    $('input:checkbox').removeAttr('checked');
                });
            };
            EthicalLabelsBrowseSearchViewModel.prototype.tabStyleInternal = function (tab) {
                var self = this;
                var result = _super.prototype.tabStyleInternal.call(this, tab);
                switch (tab) {
                    case Search.ActiveSearch.CategoriesAndTopics:
                        if (self.selectedEthicalTypeIds().length == 0) {
                            self.isCategoryTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isCategoryTabEnabled(true);
                        }
                        break;
                    case Search.ActiveSearch.Geography:
                        if (self.selectedEthicalTypeIds().length == 0 || self.selectedCategoryIds().length == 0) {
                            self.isGeographyTabEnabled(false);
                            result = "is-disabled";
                        }
                        else {
                            self.isGeographyTabEnabled(true);
                        }
                        break;
                }
                return result;
            };
            EthicalLabelsBrowseSearchViewModel.prototype.buttonStyleInternal = function () {
                var self = this;
                var result = _super.prototype.buttonStyleInternal.call(this);
                var disabled = self.selectedEthicalTypeIds().length == 0 || self.selectedCountryCodes().length == 0 || self.selectedCategoryIds().length == 0;
                if (disabled) {
                    $("#btnSearch").attr('disabled', 'disabled');
                    result += " is-disabled";
                }
                else {
                    $("#btnSearch").removeAttr("disabled");
                }
                return result;
            };
            EthicalLabelsBrowseSearchViewModel.prototype.addBreadcrumbItems = function () {
                var self = this;
                $.ajax({
                    type: 'POST',
                    url: self.getBaseUrl("/Search/EthicalLabelSummary"),
                    data: {
                        selectedIds: self.expandedEthicalTypeIds,
                        searchType: self.searchType
                    },
                }).done(function (data) {
                    var underlyingBreadCrumbItems = [];
                    for (var i = 0; i < data.length; i++) {
                        // Push to breadcrumb Section
                        underlyingBreadCrumbItems.push({ Id: data[i].id, Name: data[i].name });
                    }
                    self.breadCrumbItems.push.apply(self.breadCrumbItems, underlyingBreadCrumbItems);
                });
            };
            EthicalLabelsBrowseSearchViewModel.prototype.selectAllEthicalLabelsTypeInternal = function () {
                var self = this;
                if (self.canSelectAll()) {
                    _.each(self.ethicalLabelsTypes(), function (ethicalLabelTypes) {
                        _.each(ethicalLabelTypes, function (ethicalLabelType) {
                            if (_.contains(self.selectedEthicalTypeIds(), ethicalLabelType.Id) == false) {
                                self.selectedEthicalTypeIds.push(ethicalLabelType.Id);
                                self.addEthicalLabelType({ id: ethicalLabelType.Id, name: ethicalLabelType.Name });
                            }
                        });
                    });
                }
                else {
                    _.each(this.ethicalLabelsTypes(), function (ethicalLabelTypes) {
                        _.each(ethicalLabelTypes, function (ethicalLabelType) {
                            self.selectedEthicalTypeIds.remove(ethicalLabelType.Id);
                            self.removeEthicalLabelType({ id: ethicalLabelType.Id, name: ethicalLabelType.Name });
                        });
                    });
                }
                return true;
            };
            EthicalLabelsBrowseSearchViewModel.prototype.addEthicalLabelType = function (itemToAdd) {
                var self = this;
                var itemAlreadySelected = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === itemToAdd.id; });
                if (itemAlreadySelected === null) {
                    self.summary.push(itemToAdd);
                }
                self.scrollSummaryArea();
                return true;
            };
            EthicalLabelsBrowseSearchViewModel.prototype.removeEthicalLabelType = function (removeItem) {
                var self = this;
                var itemToBeRemoved = ko.utils.arrayFirst(this.summary(), function (item) { return item.id === removeItem.id; });
                if (itemToBeRemoved !== null && itemToBeRemoved !== undefined) {
                    self.summary.remove(itemToBeRemoved);
                    self.selectedEthicalTypeIds.remove(itemToBeRemoved.id);
                }
                return true;
            };
            EthicalLabelsBrowseSearchViewModel.prototype.loadSummary = function () {
                var self = this;
                if (self.selectedEthicalTypeIds != null && self.selectedEthicalTypeIds().length > 0) {
                    self.isSummaryLoading(true);
                    $.ajax({
                        type: 'POST',
                        url: self.getBaseUrl("/Search/EthicalLabelSummary"),
                        data: { selectedIds: self.ethicalTypeIds },
                    }).done(function (data) {
                        var underlyingSummary = [];
                        for (var i = 0; i < data.length; i++) {
                            // Push to Summary Section
                            underlyingSummary.push({ id: data[i].id, name: data[i].name });
                        }
                        self.summary.push.apply(self.summary, underlyingSummary);
                        self.isSummaryLoading(false);
                    });
                }
            };
            EthicalLabelsBrowseSearchViewModel.prototype.scrollSummaryArea = function () {
                var div = document.getElementById("summaryArea");
                div.scrollTop = div.scrollHeight;
            };
            EthicalLabelsBrowseSearchViewModel.prototype.loadEthicalLabelTypes = function () {
                var self = this;
                self.isLoading(true);
                // Deselect selectAll checkbox while navigate
                self.canSelectAll(false);
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/EthicalLabelTypeSearchAsync"),
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.ethicalLabelsTypes(data);
                    self.breadCrumbContext([]);
                    self.isLoading(false);
                });
            };
            EthicalLabelsBrowseSearchViewModel.prototype.loadSubEthicalLabelTypeInternal = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                var itemId = item == null ? null : item.Id;
                self.isLoading(true);
                // Deselect selectAll checkbox while navigate
                self.canSelectAll(false);
                $.ajax({
                    url: self.getBaseUrl("/Search/EthicalLabelTypeSearchAsync"),
                    type: "POST",
                    data: {
                        ethicalTypeId: itemId
                    },
                    global: false
                }).done(function (data) {
                    self.ethicalLabelsTypes(data);
                    self.breadCrumbContext([]);
                    self.isLoading(false);
                });
            };
            EthicalLabelsBrowseSearchViewModel.prototype.loadBreadCrumbContext = function () {
                var self = this;
                self.isMenuLoading(true);
                $.ajax({
                    context: this,
                    url: self.getBaseUrl("/Search/EthicalLabelTypeSearchAsync"),
                    type: "POST",
                    global: false
                }).done(function (data) {
                    self.breadCrumbContext(data);
                    self.isMenuLoading(false);
                });
            };
            EthicalLabelsBrowseSearchViewModel.prototype.loadBreadCrumbSubContext = function (item) {
                if (item === void 0) { item = null; }
                var self = this;
                self.isMenuLoading(true);
                // Deselect selectAll checkbox while navigate
                self.canSelectAll(false);
                $.ajax({
                    url: self.getBaseUrl("/Search/EthicalLabelTypeSearchAsync"),
                    type: "POST",
                    data: {
                        ethicalTypeId: item.Id
                    },
                    global: false
                }).done(function (data) {
                    self.breadCrumbContext(data);
                    self.isMenuLoading(false);
                });
            };
            EthicalLabelsBrowseSearchViewModel.prototype.SelectAllChildrenInternal = function (ethicalTypeId) {
                var _this = this;
                var self = this;
                var isSelectAllChecked = $("#selectAllChildren" + ethicalTypeId).is(':checked');
                $.ajax({
                    url: self.getBaseUrl("/Search/SubEthicalTypeSearchAsync"),
                    data: {
                        ethicalTypeId: ethicalTypeId
                    },
                    type: "POST"
                }).done(function (data) {
                    var underlyingSummary = ko.observableArray(self.summary());
                    var underlyingSelectedEthicalTypeIds = ko.observableArray(self.selectedEthicalTypeIds());
                    if (isSelectAllChecked) {
                        _.each(data, function (dataItem) {
                            if (_.contains(_this.selectedEthicalTypeIds(), dataItem.EthicalTypeId) == false) {
                                underlyingSelectedEthicalTypeIds.push(dataItem.EthicalTypeId);
                            }
                            var itemAlreadySelected = ko.utils.arrayFirst(_this.summary(), function (item) { return item.id === dataItem.EthicalTypeId; });
                            if (itemAlreadySelected === null) {
                                underlyingSummary.push({ id: dataItem.EthicalTypeId, name: dataItem.EthicalTypeName });
                            }
                        });
                        self.isSummaryLoading(false);
                        $("#selectAllChildren" + ethicalTypeId).prop('checked', true); // For IE8 
                    }
                    else {
                        _.each(data, function (dataItem) {
                            underlyingSummary.remove(function (element) { return element.id == dataItem.EthicalTypeId; });
                            underlyingSelectedEthicalTypeIds.remove(dataItem.EthicalTypeId);
                        });
                        $("#selectAllChildren" + ethicalTypeId).prop('checked', false); // For IE8 
                    }
                    self.selectedEthicalTypeIds.valueHasMutated(); //syncing self.selectedEthicalTypeIds and underlyingSelectedEthicalTypeIds
                    self.summary.valueHasMutated();
                    self.scrollSummaryArea();
                });
            };
            EthicalLabelsBrowseSearchViewModel.prototype.getBreadCrumbRootItemName = function () {
                return "Ethical Labels";
            };
            return EthicalLabelsBrowseSearchViewModel;
        }(Browse.BaseBrowseSearchViewModel));
        Browse.EthicalLabelsBrowseSearchViewModel = EthicalLabelsBrowseSearchViewModel;
    })(Browse = Search.Browse || (Search.Browse = {}));
})(Search || (Search = {}));
//# sourceMappingURL=EthicalLabelsBrowseSearchViewModel.js.map;
/// <reference path="../../typings/knockout.d.ts" />
var BaseFilterViewModel = (function () {
    function BaseFilterViewModel() {
        var self = this;
        self.activeColumnName = ko.observable("");
        self.activeColumnDisplayName = ko.observable("");
        self.activeColumnValues = ko.observableArray([]);
        self.canFilterColumnVisible = ko.observable(false);
        self.toggleFilterColumn = function (columnName) {
            return self.toggleFilterColumnInternals(columnName);
        };
        self.disableClearAll = function (item) {
            return self.disableClearAllInternals(item);
        };
    }
    BaseFilterViewModel.prototype.toggleFilterColumnInternals = function (columnName) {
        var self = this;
        self.canFilterColumnVisible(!self.canFilterColumnVisible());
        if ($("a[data-columnname=" + columnName + "]>span").hasClass('is-open')) {
            $("a[data-columnname=" + columnName + "]>span").removeClass('is-open');
            self.canFilterColumnVisible(false);
        }
        else {
            $('a >span.em-grid-filter-icon').removeClass('is-open');
            $("a[data-columnname=" + columnName + "]>span").addClass('is-open');
            self.canFilterColumnVisible(true);
        }
    };
    BaseFilterViewModel.prototype.disableClearAllInternals = function (item) {
        var self = this;
        if (item === true) {
            self.enableClearButton(false);
            self.enableFilterButton(true);
            return true;
        }
        return false;
    };
    return BaseFilterViewModel;
}());
//# sourceMappingURL=BaseFilterViewModel.js.map;
/// <reference path="../../typings/knockout.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var StringFilterViewModel = (function (_super) {
    __extends(StringFilterViewModel, _super);
    function StringFilterViewModel() {
        _super.call(this);
        var self = this;
        self.selectFilterName = ko.observableArray([]);
        self.canProductSelectAll = ko.observable(false);
        self.canMeasureSelectAll = ko.observable(false);
        self.canCountrySelectAll = ko.observable(false);
        self.canDataTypeSelectAll = ko.observable(false);
        self.canUnitTypeSelectAll = ko.observable(false);
        self.canPerCapitaSelectAll = ko.observable(false);
        self.canCompanyNameSelectAll = ko.observable(false);
        self.canBrandNameSelectAll = ko.observable(false);
        self.canCurrencyConversionSelectAll = ko.observable(false);
        self.canCurrentConstantSelectAll = ko.observable(false);
        self.canPackSizeSelectAll = ko.observable(false);
        self.canPackTypeSelectAll = ko.observable(false);
        self.canOutletTypeSelectAll = ko.observable(false);
        self.canCategorizationTypeSelectAll = ko.observable(false);
        self.canPerSelectAll = ko.observable(false);
        self.enableClearButton = ko.observable(false);
        self.enableFilterButton = ko.observable(false);
        self.showStringFilterColumn = function (columnName, columnDisplayName, data) {
            return self.showStringFilterColumnInternals(columnName, columnDisplayName, data);
        };
        self.selectClearAllItems = function (item, data) {
            return self.clearSelectAllInternals(item, data);
        };
        self.selectFilterItems = function (item, data) {
            return self.selectAllFilterItemInternals(item, data);
        };
        self.selectCheckBoxItems = function (columnName, item, stringFilterName, data) {
            return self.selectCheckBoxItemInternals(columnName, item, stringFilterName, data);
        };
        self.showFilterButton = function (columnName, data) {
            return self.showfilterbuttonInternals(columnName, data);
        };
    }
    StringFilterViewModel.prototype.showStringFilterColumnInternals = function (columnName, columnDisplayName, data) {
        var self = this;
        var columnLink = $("a[data-columnname=" + columnName + "]");
        var columnHeaderWidth = columnLink.parent().outerWidth() - 30;
        $(".em-grid-filter-popup").css({
            left: columnLink.position().left - columnHeaderWidth + 'px'
        });
        $("[data-column='numericFilter']").hide();
        self.activeColumnDisplayName(columnDisplayName);
        self.activeColumnName(columnName);
        self.toggleFilterColumn(columnName);
        self.showFilterButton(columnName, data);
        switch (columnName) {
            case "CountryName":
                self.activeColumnValues(data.stringFiltersItems.CountryName.ColumnValues);
                break;
            case "ProductName":
                self.activeColumnValues(data.stringFiltersItems.ProductName.ColumnValues);
                break;
            case "MeasureName":
                self.activeColumnValues(data.stringFiltersItems.MeasureName.ColumnValues);
                break;
            case "DataType":
                self.activeColumnValues(data.stringFiltersItems.DataType.ColumnValues);
                break;
            case "Unit":
                self.activeColumnValues(data.stringFiltersItems.Unit.ColumnValues);
                break;
            case "PerCapita":
                self.activeColumnValues(data.stringFiltersItems.PerCapita.ColumnValues);
                break;
            case "CompanyName":
                self.activeColumnValues(data.stringFiltersItems.CompanyName.ColumnValues);
                break;
            case "BrandName":
                self.activeColumnValues(data.stringFiltersItems.BrandName.ColumnValues);
                break;
            case "CurrencyConversion":
                self.activeColumnValues(data.stringFiltersItems.CurrencyConversion.ColumnValues);
                break;
            case "CurrentConstant":
                self.activeColumnValues(data.stringFiltersItems.CurrentConstant.ColumnValues);
                break;
            case "PacksizeTotal":
                self.activeColumnValues(data.stringFiltersItems.PacksizeTotal.ColumnValues);
                break;
            case "Packtype":
                self.activeColumnValues(data.stringFiltersItems.Packtype.ColumnValues);
                break;
            case "OutletType":
                self.activeColumnValues(data.stringFiltersItems.OutletType.ColumnValues);
                break;
            case "Subsector":
                self.activeColumnValues(data.stringFiltersItems.Subsector.ColumnValues);
                break;
            case "Per":
                self.activeColumnValues(data.stringFiltersItems.Per.ColumnValues);
                break;
        }
        return true;
    };
    StringFilterViewModel.prototype.selectAllFilterItemInternals = function (columnName, data) {
        var self = this;
        self.enableClearButton(false);
        self.enableFilterButton(true);
        switch (columnName) {
            case "ProductName":
                {
                    if (!self.canProductSelectAll()) {
                        self.canProductSelectAll(true);
                        var productItems = _.difference(data.stringFiltersItems.ProductName.ColumnValues, self.selectFilterName());
                        self.selectFilterName.push.apply(self.selectFilterName, productItems);
                        break;
                    }
                    else {
                        self.selectFilterName.removeAll(data.stringFiltersItems.ProductName.ColumnValues);
                        self.canProductSelectAll(false);
                        self.enableFilterButton(false);
                        break;
                    }
                }
            case "MeasureName":
                {
                    if (!self.canMeasureSelectAll()) {
                        self.canMeasureSelectAll(true);
                        var measureItems = _.difference(data.stringFiltersItems.MeasureName.ColumnValues, self.selectFilterName());
                        self.selectFilterName.push.apply(self.selectFilterName, measureItems);
                        break;
                    }
                    else {
                        self.selectFilterName.removeAll(data.stringFiltersItems.MeasureName.ColumnValues);
                        self.canMeasureSelectAll(false);
                        self.enableFilterButton(false);
                        break;
                    }
                }
            case "CountryName": if (!self.canCountrySelectAll()) {
                self.canCountrySelectAll(true);
                var countryItems = _.difference(data.stringFiltersItems.CountryName.ColumnValues, self.selectFilterName());
                self.selectFilterName.push.apply(self.selectFilterName, countryItems);
                break;
            }
            else {
                self.selectFilterName.removeAll(data.stringFiltersItems.CountryName.ColumnValues);
                self.canCountrySelectAll(false);
                self.enableFilterButton(false);
                break;
            }
            case "DataType": if (!self.canDataTypeSelectAll()) {
                self.canDataTypeSelectAll(true);
                var dataItems = _.difference(data.stringFiltersItems.DataType.ColumnValues, self.selectFilterName());
                self.selectFilterName.push.apply(self.selectFilterName, dataItems);
                break;
            }
            else {
                self.selectFilterName.removeAll(data.stringFiltersItems.DataType.ColumnValues);
                self.canDataTypeSelectAll(false);
                self.enableFilterButton(false);
                break;
            }
            case "Unit": if (!self.canUnitTypeSelectAll()) {
                self.canUnitTypeSelectAll(true);
                var unitItems = _.difference(data.stringFiltersItems.Unit.ColumnValues, self.selectFilterName());
                self.selectFilterName.push.apply(self.selectFilterName, unitItems);
                break;
            }
            else {
                self.selectFilterName.removeAll(data.stringFiltersItems.Unit.ColumnValues);
                self.canUnitTypeSelectAll(false);
                self.enableFilterButton(false);
                break;
            }
            case "PerCapita": if (!self.canPerCapitaSelectAll()) {
                self.canPerCapitaSelectAll(true);
                var perCapitaItems = _.difference(data.stringFiltersItems.PerCapita.ColumnValues, self.selectFilterName());
                self.selectFilterName.push.apply(self.selectFilterName, perCapitaItems);
                break;
            }
            else {
                self.canPerCapitaSelectAll(false);
                self.selectFilterName.removeAll(data.stringFiltersItems.PerCapita.ColumnValues);
                self.enableFilterButton(false);
                break;
            }
            case "CompanyName": if (!self.canCompanyNameSelectAll()) {
                self.canCompanyNameSelectAll(true);
                var companynameItems = _.difference(data.stringFiltersItems.CompanyName.ColumnValues, self.selectFilterName());
                self.selectFilterName.push.apply(self.selectFilterName, companynameItems);
                break;
            }
            else {
                self.selectFilterName.removeAll(data.stringFiltersItems.CompanyName.ColumnValues);
                self.canCompanyNameSelectAll(false);
                self.enableFilterButton(false);
                break;
            }
            case "BrandName": if (!self.canBrandNameSelectAll()) {
                self.canBrandNameSelectAll(true);
                var brandNameItems = _.difference(data.stringFiltersItems.BrandName.ColumnValues, self.selectFilterName());
                self.selectFilterName.push.apply(self.selectFilterName, brandNameItems);
                break;
            }
            else {
                self.selectFilterName.removeAll(data.stringFiltersItems.BrandName.ColumnValues);
                self.canBrandNameSelectAll(false);
                self.enableFilterButton(false);
                break;
            }
            case "CurrencyConversion": if (!self.canCurrencyConversionSelectAll()) {
                self.canCurrencyConversionSelectAll(true);
                var currencyConversionItems = _.difference(data.stringFiltersItems.CurrencyConversion.ColumnValues, self.selectFilterName());
                self.selectFilterName.push.apply(self.selectFilterName, currencyConversionItems);
                break;
            }
            else {
                self.selectFilterName.removeAll(data.stringFiltersItems.CurrencyConversion.ColumnValues);
                self.canCurrencyConversionSelectAll(false);
                self.enableFilterButton(false);
                break;
            }
            case "CurrentConstant": if (!self.canCurrentConstantSelectAll()) {
                self.canCurrentConstantSelectAll(true);
                var currentConstantItems = _.difference(data.stringFiltersItems.CurrentConstant.ColumnValues, self.selectFilterName());
                self.selectFilterName.push.apply(self.selectFilterName, currentConstantItems);
                break;
            }
            else {
                self.selectFilterName.removeAll(data.stringFiltersItems.CurrentConstant.ColumnValues);
                self.canCurrentConstantSelectAll(false);
                self.enableFilterButton(false);
                break;
            }
            case "PacksizeTotal": if (!self.canPackSizeSelectAll()) {
                self.canPackSizeSelectAll(true);
                var packSizeItems = _.difference(data.stringFiltersItems.PacksizeTotal.ColumnValues, self.selectFilterName());
                self.selectFilterName.push.apply(self.selectFilterName, packSizeItems);
                break;
            }
            else {
                self.selectFilterName.removeAll(data.stringFiltersItems.PacksizeTotal.ColumnValues);
                self.canPackSizeSelectAll(false);
                self.enableFilterButton(false);
                break;
            }
            case "Packtype": if (!self.canPackTypeSelectAll()) {
                self.canPackTypeSelectAll(true);
                var packTypeItems = _.difference(data.stringFiltersItems.Packtype.ColumnValues, self.selectFilterName());
                self.selectFilterName.push.apply(self.selectFilterName, packTypeItems);
                break;
            }
            else {
                self.selectFilterName.removeAll(data.stringFiltersItems.Packtype.ColumnValues);
                self.canPackTypeSelectAll(false);
                self.enableFilterButton(false);
                break;
            }
            case "OutletType": if (!self.canOutletTypeSelectAll()) {
                self.canOutletTypeSelectAll(true);
                var outletTypeItems = _.difference(data.stringFiltersItems.OutletType.ColumnValues, self.selectFilterName());
                self.selectFilterName.push.apply(self.selectFilterName, outletTypeItems);
                break;
            }
            else {
                self.selectFilterName.removeAll(data.stringFiltersItems.OutletType.ColumnValues);
                self.canOutletTypeSelectAll(false);
                self.enableFilterButton(false);
                break;
            }
            case "Subsector": if (!self.canCategorizationTypeSelectAll()) {
                self.canCategorizationTypeSelectAll(true);
                var subSectorItems = _.difference(data.stringFiltersItems.Subsector.ColumnValues, self.selectFilterName());
                self.selectFilterName.push.apply(self.selectFilterName, subSectorItems);
                break;
            }
            else {
                self.selectFilterName.removeAll(data.stringFiltersItems.Subsector.ColumnValues);
                self.canCategorizationTypeSelectAll(false);
                self.enableFilterButton(false);
                break;
            }
            case "Per": if (!self.canPerSelectAll()) {
                self.canPerSelectAll(true);
                var perItems = _.difference(data.stringFiltersItems.Per.ColumnValues, self.selectFilterName());
                self.selectFilterName.push.apply(self.selectFilterName, perItems);
                break;
            }
            else {
                self.selectFilterName.removeAll(data.stringFiltersItems.Per.ColumnValues);
                self.canPerSelectAll(false);
                self.enableFilterButton(false);
                break;
            }
        }
        return true;
    };
    StringFilterViewModel.prototype.clearSelectAllInternals = function (columnName, data) {
        var self = this;
        self.enableClearButton(false);
        self.enableFilterButton(false);
        switch (columnName) {
            case "CountryName":
                self.selectFilterName.removeAll(data.stringFiltersItems.CountryName.ColumnValues);
                self.canCountrySelectAll(false);
                break;
            case "ProductName":
                self.selectFilterName.removeAll(data.stringFiltersItems.ProductName.ColumnValues);
                self.canProductSelectAll(false);
                break;
            case "MeasureName":
                self.selectFilterName.removeAll(data.stringFiltersItems.MeasureName.ColumnValues);
                self.canProductSelectAll(false);
                break;
            case "DataType":
                self.selectFilterName.removeAll(data.stringFiltersItems.DataType.ColumnValues);
                self.canDataTypeSelectAll(false);
                break;
            case "Unit":
                self.selectFilterName.removeAll(data.stringFiltersItems.Unit.ColumnValues);
                self.canUnitTypeSelectAll(false);
                break;
            case "PerCapita":
                self.selectFilterName.removeAll(data.stringFiltersItems.PerCapita.ColumnValues);
                self.canPerCapitaSelectAll(false);
                break;
            case "CompanyName":
                self.selectFilterName.removeAll(data.stringFiltersItems.CompanyName.ColumnValues);
                self.canCompanyNameSelectAll(false);
                break;
            case "BrandName":
                self.selectFilterName.removeAll(data.stringFiltersItems.BrandName.ColumnValues);
                self.canBrandNameSelectAll(false);
                break;
            case "CurrencyConversion":
                self.selectFilterName.removeAll(data.stringFiltersItems.CurrencyConversion.ColumnValues);
                self.canCurrencyConversionSelectAll(false);
                break;
            case "CurrentConstant":
                self.selectFilterName.removeAll(data.stringFiltersItems.CurrentConstant.ColumnValues);
                self.canCurrentConstantSelectAll(false);
                break;
            case "PacksizeTotal":
                self.selectFilterName.removeAll(data.stringFiltersItems.PacksizeTotal.ColumnValues);
                self.canPackSizeSelectAll(false);
                break;
            case "Packtype":
                self.selectFilterName.removeAll(data.stringFiltersItems.Packtype.ColumnValues);
                self.canPackTypeSelectAll(false);
                break;
            case "OutletType":
                self.selectFilterName.removeAll(data.stringFiltersItems.OutletType.ColumnValues);
                self.canOutletTypeSelectAll(false);
                break;
            case "Subsector":
                self.selectFilterName.removeAll(data.stringFiltersItems.Subsector.ColumnValues);
                self.canCategorizationTypeSelectAll(false);
                break;
            case "Per":
                self.selectFilterName.removeAll(data.stringFiltersItems.Per.ColumnValues);
                self.canPerSelectAll(false);
                break;
            default:
        }
        return true;
    };
    StringFilterViewModel.prototype.selectCheckBoxItemInternals = function (columnName, columnValue, stringFilterName, data) {
        var self = this;
        switch (columnName) {
            case "ProductName":
                self.canProductSelectAll(false);
                break;
            case "MeasureName":
                self.canMeasureSelectAll(false);
                break;
            case "CountryName":
                self.canCountrySelectAll(false);
                break;
            case "DataType":
                self.canDataTypeSelectAll(false);
                break;
            case "Unit":
                self.canUnitTypeSelectAll(false);
                break;
            case "PerCapita":
                self.canPerCapitaSelectAll(false);
                break;
            case "CompanyName":
                self.canCompanyNameSelectAll(false);
                break;
            case "BrandName":
                self.canBrandNameSelectAll(false);
                break;
            case "CurrencyConversion":
                self.canCurrencyConversionSelectAll(false);
                break;
            case "CurrentConstant":
                self.canCurrentConstantSelectAll(false);
                break;
            case "PacksizeTotal":
                self.canPackSizeSelectAll(false);
                break;
            case "Packtype":
                self.canPackTypeSelectAll(false);
                break;
            case "OutletType":
                self.canOutletTypeSelectAll(false);
                break;
            case "Subsector":
                self.canCategorizationTypeSelectAll(false);
                break;
            case "Per":
                self.canPerSelectAll(false);
                break;
        }
        for (var _i = 0, stringFilterName_1 = stringFilterName; _i < stringFilterName_1.length; _i++) {
            var item = stringFilterName_1[_i];
            for (var _a = 0, columnValue_1 = columnValue; _a < columnValue_1.length; _a++) {
                var inneritem = columnValue_1[_a];
                if (item === inneritem) {
                    self.enableClearButton(true);
                    self.enableFilterButton(true);
                    return true;
                }
            }
        }
        self.selectFilterName.remove(data);
        self.enableClearButton(false);
        self.enableFilterButton(false);
        return true;
    };
    StringFilterViewModel.prototype.showfilterbuttonInternals = function (columnName, data) {
        var self = this;
        self.enableFilterButton(false);
        self.enableClearButton(false);
        switch (columnName) {
            case "CountryName":
                if (self.canCountrySelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.CountryName.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "ProductName":
                if (self.canProductSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.ProductName.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "MeasureName":
                if (self.canMeasureSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.MeasureName.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "DataType":
                if (self.canDataTypeSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.DataType.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "Unit":
                if (self.canUnitTypeSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.Unit.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "PerCapita":
                if (self.canPerCapitaSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.PerCapita.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "CompanyName":
                if (self.canCompanyNameSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.CompanyName.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "BrandName":
                if (self.canBrandNameSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.BrandName.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "CurrencyConversion":
                if (self.canCurrencyConversionSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.CurrencyConversion.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "CurrentConstant":
                if (self.canCurrentConstantSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.CurrentConstant.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "PacksizeTotal":
                if (self.canPackSizeSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.PacksizeTotal.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "Packtype":
                if (self.canPackTypeSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.Packtype.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "OutletType":
                if (self.canOutletTypeSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.OutletType.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "Subsector":
                if (self.canCategorizationTypeSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.Subsector.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
            case "Per":
                if (self.canPerSelectAll()) {
                    self.enableClearButton(false);
                    self.enableFilterButton(true);
                    return true;
                }
                ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                    ko.utils.arrayForEach(data.stringFiltersItems.Per.ColumnValues, function (child) {
                        if (parent === child) {
                            self.enableFilterButton(true);
                            self.enableClearButton(true);
                            return;
                        }
                    });
                });
                break;
        }
        return true;
    };
    return StringFilterViewModel;
}(BaseFilterViewModel));
//# sourceMappingURL=StringFilterViewModel.js.map;
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var NumericFilterViewModel = (function (_super) {
    __extends(NumericFilterViewModel, _super);
    function NumericFilterViewModel() {
        _super.call(this);
        var self = this;
        self.showNumericfilterColumn = function (columnName, columnDisplayName, data) {
            return self.numericfilterItems(columnName, columnDisplayName, data);
        };
        self.numericClear = function (columnName, columnDisplayName, data) {
            return self.clearNumericItems(columnName, columnDisplayName, data);
        };
        self.addSelectedItem = function (data) {
            return self.selectedKey(data);
        };
        self.keyUp = function () {
            return self.keyUpInternals();
        };
        self.comparisonOperator = [
            { key: "Equal", value: "Is equal to" },
            { key: "NotEqual", value: "Is not equal to" },
            { key: "GreaterThanOrEqual", value: "Is greater than or equal to" },
            { key: "GreaterThan", value: "Is greater than" },
            { key: "LessThanOrEqual", value: "Is less than or equal to" },
            { key: "LessThan", value: "Is less than" }
        ];
        self.isNumericInputValid = function () {
            return self.isNumericInputValidInternal();
        };
        self.numericSelectedItem = ko.observableArray([]);
        self.numericvalue = ko.observable("");
        self.selectedcomparisonKey = ko.observable("");
        self.enableClearButton = ko.observable(false);
        self.enableFilterButton = ko.observable(false);
    }
    NumericFilterViewModel.prototype.numericfilterItems = function (columnName, columnDisplayName, data) {
        var self = this;
        self.numericvalue("");
        self.selectedcomparisonKey("");
        $("#SelectOption").html("Choose");
        $("[data-column='stringFilter']").hide();
        $(".slideToggle").removeClass("is-active");
        $(".em-pseudo-dropdown__content").css("display", "none");
        self.activeColumnName(columnName);
        self.activeColumnDisplayName(columnDisplayName);
        self.toggleFilterColumn(columnName);
        for (var _i = 0, _a = data.numericFilters.numericSelectedItem(); _i < _a.length; _i++) {
            var item = _a[_i];
            if (item.columnName === columnName) {
                self.numericvalue(item.numericValue);
                self.selectedcomparisonKey(item.selected);
                $("#SelectOption").html(item.selected.value);
            }
        }
        var columnLink = $("a[data-columnname=" + columnName + "]");
        var columnHeaderWidth = columnLink.parent().outerWidth() - 30;
        var position = columnLink.position();
        if (position.left <= $(window).width() - 200) {
            $(".em-grid-filter-popup").css({
                left: columnLink.position().left - columnHeaderWidth + 'px',
            });
        }
        else {
            $(".em-grid-filter-popup").css({
                left: columnLink.position().left - columnHeaderWidth - 132 + 'px',
            });
        }
    };
    NumericFilterViewModel.prototype.clearNumericItems = function (columnName, columnDisplayName, data) {
        var self = this;
        self.numericvalue("");
        self.selectedcomparisonKey("");
        $("#SelectOption").html("Choose");
        for (var _i = 0, _a = data.numericFilters.numericSelectedItem(); _i < _a.length; _i++) {
            var item = _a[_i];
            if (item.columnName === columnName) {
                item.columnName = "";
                item.numericValue = "";
                item.selected = "";
            }
        }
    };
    NumericFilterViewModel.prototype.selectedKey = function (data) {
        var self = this;
        self.selectedcomparisonKey(data);
        $('.em-pseudo-dropdown__content').css('display', 'none');
        $('.slideToggle').toggleClass('is-active');
        $("#SelectOption").html(data.value);
    };
    NumericFilterViewModel.prototype.keyUpInternals = function () {
        var self = this;
        if (self.numericvalue() !== "" && self.selectedcomparisonKey() !== "") {
            self.enableFilterButton(true);
        }
        self.enableFilterButton(false);
    };
    NumericFilterViewModel.prototype.isNumericInputValidInternal = function () {
        var self = this;
        var regexForIsNumeric = /^[0-9\.,'-\s]+$/g;
        var isNumeric = regexForIsNumeric.test(self.numericvalue());
        if (isNumeric && self.selectedcomparisonKey() !== "") {
            return true;
        }
        return false;
    };
    return NumericFilterViewModel;
}(BaseFilterViewModel));
//# sourceMappingURL=NumericFilterViewModel.js.map;
/// <reference path="../../typings/knockout.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var SprinkleFilterViewModel = (function (_super) {
    __extends(SprinkleFilterViewModel, _super);
    function SprinkleFilterViewModel() {
        _super.call(this);
        var self = this;
        self.selectFilterName = ko.observableArray([]);
        self.canSprinkleSelectAll = ko.observable(false);
        self.enableClearButton = ko.observable(false);
        self.enableFilterButton = ko.observable(false);
        self.showSprinkleFilterColumn = function (columnName, columnDisplayName, data) {
            return self.showSprinkleFilterColumnInternals(columnName, columnDisplayName, data);
        };
        self.selectClearAllItems = function (item, data) {
            return self.clearSelectAllInternals(item, data);
        };
        self.selectFilterItems = function (item, data) {
            return self.selectAllFilterItemInternals(item, data);
        };
        self.selectCheckBoxItems = function (columnName, item, sprinkleFilterName, data) {
            return self.selectCheckBoxItemInternals(columnName, item, sprinkleFilterName, data);
        };
        self.showFilterButton = function (columnName, data) {
            return self.showfilterbuttonInternals(columnName, data);
        };
    }
    SprinkleFilterViewModel.prototype.showSprinkleFilterColumnInternals = function (columnName, columnDisplayName, data) {
        var self = this;
        var columnLink = $("a[data-columnname=" + columnName + "]");
        var columnHeaderWidth = columnLink.parent().outerWidth() - 30;
        $(".em-grid-filter-popup").css({
            left: columnLink.position().left - columnHeaderWidth + 'px',
        });
        $("[data-column='numericFilter']").hide();
        self.activeColumnValues(data.sprinkleFiltersItem.MeasureTypeIDs.ColumnValues);
        self.activeColumnName(columnName);
        self.activeColumnDisplayName(columnDisplayName);
        self.toggleFilterColumn(columnName);
        self.showFilterButton(columnName, data);
        return true;
    };
    SprinkleFilterViewModel.prototype.selectAllFilterItemInternals = function (columnName, data) {
        var self = this;
        self.enableClearButton(false);
        self.enableFilterButton(true);
        var arrayMeasureTypeIDs = [];
        for (var _i = 0, _a = data.sprinkleFiltersItem.MeasureTypeIDs.ColumnValues; _i < _a.length; _i++) {
            var item = _a[_i];
            arrayMeasureTypeIDs.push(item.MeasureTypeId.toString());
        }
        if (!self.canSprinkleSelectAll()) {
            self.canSprinkleSelectAll(true);
            var sprinkleItems = _.difference(arrayMeasureTypeIDs, self.selectFilterName());
            self.selectFilterName.push.apply(self.selectFilterName, sprinkleItems);
        }
        else {
            self.selectFilterName.removeAll(arrayMeasureTypeIDs);
            self.canSprinkleSelectAll(false);
            self.enableFilterButton(false);
        }
        return true;
    };
    SprinkleFilterViewModel.prototype.clearSelectAllInternals = function (columnName, data) {
        var self = this;
        self.enableClearButton(false);
        self.enableFilterButton(false);
        var arrayMeasureTypeIDs = [];
        for (var _i = 0, _a = data.sprinkleFiltersItem.MeasureTypeIDs.ColumnValues; _i < _a.length; _i++) {
            var item = _a[_i];
            arrayMeasureTypeIDs.push(item.MeasureTypeId.toString());
        }
        self.selectFilterName.removeAll(arrayMeasureTypeIDs);
        self.canSprinkleSelectAll(false);
        return true;
    };
    SprinkleFilterViewModel.prototype.selectCheckBoxItemInternals = function (columnName, columnValue, spinkleFilterName, data) {
        var self = this;
        self.canSprinkleSelectAll(false);
        for (var _i = 0, spinkleFilterName_1 = spinkleFilterName; _i < spinkleFilterName_1.length; _i++) {
            var item = spinkleFilterName_1[_i];
            for (var _a = 0, columnValue_1 = columnValue; _a < columnValue_1.length; _a++) {
                var inneritem = columnValue_1[_a];
                if (item === inneritem.MeasureTypeId.toString()) {
                    self.enableClearButton(true);
                    self.enableFilterButton(true);
                    return true;
                }
            }
        }
        self.selectFilterName.remove(data);
        self.enableClearButton(false);
        self.enableFilterButton(false);
        return true;
    };
    SprinkleFilterViewModel.prototype.showfilterbuttonInternals = function (columnName, data) {
        var self = this;
        self.enableFilterButton(false);
        self.enableClearButton(false);
        var disableClearbutton = self.disableClearAll(self.canSprinkleSelectAll());
        if (!disableClearbutton) {
            var arrayMeasureTypeIDs = [];
            for (var _i = 0, _a = data.sprinkleFiltersItem.MeasureTypeIDs.ColumnValues; _i < _a.length; _i++) {
                var item = _a[_i];
                arrayMeasureTypeIDs.push(item.MeasureTypeId.toString());
            }
            ko.utils.arrayForEach(self.selectFilterName(), function (parent) {
                ko.utils.arrayForEach(arrayMeasureTypeIDs, function (child) {
                    if (parent === child) {
                        self.enableFilterButton(true);
                        self.enableClearButton(true);
                        return;
                    }
                });
            });
        }
        return true;
    };
    return SprinkleFilterViewModel;
}(BaseFilterViewModel));
//# sourceMappingURL=SprinkleFilterViewModel.js.map;
var SortDescriptor = (function () {
    function SortDescriptor(initialData) {
        if (initialData != null) {
            var self_1 = this;
            self_1.columnName = initialData.ColumnName;
            self_1.sortDirection = initialData.SortDirection;
        }
    }
    return SortDescriptor;
}());
//# sourceMappingURL=SortDescriptor.js.map;
var FilterDescriptor = (function () {
    function FilterDescriptor(initialData) {
        var self = this;
        if (initialData != null) {
            self.columnName = initialData.ColumnName;
            self.comparisonOperator = initialData.ComparisonOperator;
            self.value = initialData.Value;
        }
    }
    return FilterDescriptor;
}());
//# sourceMappingURL=FilterDescriptor.js.map;
/// <reference path="../../typings/knockout.d.ts" />
var FilterViewModel = (function () {
    function FilterViewModel(initialData) {
        var self = this;
        if (initialData != null) {
            self.stringFiltersItems = initialData.StringFilterViewModel;
            self.numericFilterItems = initialData.NumericFilterViewModel;
            self.sprinkleFiltersItem = initialData.SprinkleFilterViewModel;
            self.stringFilters = new StringFilterViewModel();
            self.numericFilters = new NumericFilterViewModel();
            self.sprinkleFilters = new SprinkleFilterViewModel();
            self.baseFilters = new BaseFilterViewModel();
        }
    }
    return FilterViewModel;
}());
//# sourceMappingURL=FilterViewModel.js.map;
var Search;
(function (Search) {
    (function (SearchType) {
        SearchType[SearchType["NotSet"] = 0] = "NotSet";
        SearchType[SearchType["CategoryAndTopic"] = 1] = "CategoryAndTopic";
        SearchType[SearchType["Keyword"] = 2] = "Keyword";
        SearchType[SearchType["Companies"] = 4] = "Companies";
        SearchType[SearchType["Brands"] = 5] = "Brands";
        SearchType[SearchType["Packaging"] = 6] = "Packaging";
        SearchType[SearchType["Closures"] = 7] = "Closures";
        SearchType[SearchType["ForeignMarket"] = 8] = "ForeignMarket";
        SearchType[SearchType["Survey"] = 9] = "Survey";
        SearchType[SearchType["Cities"] = 10] = "Cities";
        SearchType[SearchType["Nutrition"] = 13] = "Nutrition";
        SearchType[SearchType["EthicalLabels"] = 14] = "EthicalLabels";
    })(Search.SearchType || (Search.SearchType = {}));
    var SearchType = Search.SearchType;
})(Search || (Search = {}));
//# sourceMappingURL=SearchTypeEnum.js.map;
var Search;
(function (Search) {
    (function (ActiveSearch) {
        ActiveSearch[ActiveSearch["CategoriesAndTopics"] = 0] = "CategoriesAndTopics";
        ActiveSearch[ActiveSearch["Geography"] = 1] = "Geography";
        ActiveSearch[ActiveSearch["Companies"] = 2] = "Companies";
        ActiveSearch[ActiveSearch["ClosureType"] = 3] = "ClosureType";
        ActiveSearch[ActiveSearch["Packaging"] = 4] = "Packaging";
        ActiveSearch[ActiveSearch["Survey"] = 5] = "Survey";
        ActiveSearch[ActiveSearch["Cities"] = 6] = "Cities";
        ActiveSearch[ActiveSearch["Brands"] = 7] = "Brands";
        ActiveSearch[ActiveSearch["Nutrition"] = 8] = "Nutrition";
        ActiveSearch[ActiveSearch["ForeignMarket"] = 9] = "ForeignMarket";
        ActiveSearch[ActiveSearch["EthicalLabels"] = 10] = "EthicalLabels";
    })(Search.ActiveSearch || (Search.ActiveSearch = {}));
    var ActiveSearch = Search.ActiveSearch;
})(Search || (Search = {}));
//# sourceMappingURL=ActiveSearchEnum.js.map;
var Search;
(function (Search) {
    (function (EntryPoint) {
        EntryPoint[EntryPoint["NotSet"] = 0] = "NotSet";
        EntryPoint[EntryPoint["TreeSearch"] = 110] = "TreeSearch";
        EntryPoint[EntryPoint["RunSearch"] = 101] = "RunSearch";
        EntryPoint[EntryPoint["KeywordSearch"] = 11] = "KeywordSearch";
        EntryPoint[EntryPoint["TopCategories"] = 111] = "TopCategories";
        EntryPoint[EntryPoint["TopCountries"] = 112] = "TopCountries";
        EntryPoint[EntryPoint["TopCities"] = 113] = "TopCities";
        EntryPoint[EntryPoint["AllCities"] = 114] = "AllCities";
    })(Search.EntryPoint || (Search.EntryPoint = {}));
    var EntryPoint = Search.EntryPoint;
})(Search || (Search = {}));
//# sourceMappingURL=EntryPointEnum.js.map;
var Search;
(function (Search) {
    (function (BrandOwnerType) {
        BrandOwnerType[BrandOwnerType["GBO"] = 0] = "GBO";
        BrandOwnerType[BrandOwnerType["NBO"] = 1] = "NBO";
        BrandOwnerType[BrandOwnerType["GBN"] = 5] = "GBN";
        BrandOwnerType[BrandOwnerType["UBN"] = 11] = "UBN";
    })(Search.BrandOwnerType || (Search.BrandOwnerType = {}));
    var BrandOwnerType = Search.BrandOwnerType;
})(Search || (Search = {}));
//# sourceMappingURL=BrandOwnerType.js.map;
/// <reference path="../../typings/knockout.d.ts" />
/// <reference path="../../typings/underscore.d.ts" />
/// <reference path="../../typings/jquery/jquery.d.ts" />
/// <reference path="../../typings/kendo-ui/kendo-ui.d.ts" />
var ManageProfile;
(function (ManageProfile) {
    var AlertViewModel = (function () {
        function AlertViewModel(initialData) {
            var self = this;
            self.selectedCategoryIds = ko.observableArray([]);
            self.selectedCountryCodes = ko.observableArray([]);
            self.isLoading = ko.observable(false);
            self.renderFirstColumn = function (searchItems) {
                return self.renderFirstColumnInternal(searchItems);
            };
            self.renderSecondColumn = function (searchItems) {
                return self.renderSecondColumnInternal(searchItems);
            };
            self.renderThirdColumn = function (searchItems) {
                return self.renderThirdColumnInternal(searchItems);
            };
            self.checkBoxStyle = function () {
                return self.checkBoxStyleInternal();
            };
            self.selectAllLabelStyle = function () {
                return self.selectAllLabelStyleInternal();
            };
            self.htmlBrowserDetectClass = $('html').attr("class");
            self.categoriesAndGeographies = ko.observableArray([]);
            self.selectAll = function (alertType) {
                self.selectAllInternal(alertType);
            };
            self.clearAll = function () {
                self.clearEmailRssAlertsInternal();
            };
            self.selectTemplate = function (itemGroup) {
                return self.selectTemplateName(itemGroup);
            };
            self.mapObservablesToHiddenFieldInternal();
        }
        AlertViewModel.prototype.initialize = function () {
            var self = this;
            //Populate categories And Geographies
            self.loadCategoriesAndGeographies();
        };
        AlertViewModel.prototype.loadCategoriesAndGeographies = function (item) {
            if (item === void 0) { item = null; }
            var self = this;
            self.isLoading(true);
            $.ajax({
                context: this,
                url: self.getBaseUrl("/UserSection/AlertAsync"),
                type: "POST",
                global: false
            }).done(function (data) {
                var categoriesAndGeographies = [];
                $.each(data, function (j, obj) {
                    var categoryAndGeographyViewModel = new ManageProfile.CategoryAndGeographyViewModel(obj.ItemGroupName, obj.Products);
                    categoriesAndGeographies.push(categoryAndGeographyViewModel);
                });
                self.categoriesAndGeographies(categoriesAndGeographies);
                self.selectPreSelectedAlerts();
                self.isLoading(false);
            });
        };
        // #region KO Methods Binding
        AlertViewModel.prototype.selectAllInternal = function (alertType) {
            var _this = this;
            var self = this;
            _.each(this.categoriesAndGeographies(), function (groupList) {
                if (groupList.itemGroupName == alertType && groupList.isSelectAll() == true) {
                    _.each(groupList.products, function (item) {
                        if (groupList.itemGroupName != 'Geographies') {
                            if (_.contains(_this.selectedCategoryIds(), item.ItemId) == false) {
                                self.selectedCategoryIds.push(item.ItemId);
                            }
                        }
                        else {
                            if (_.contains(_this.selectedCountryCodes(), item.ItemId) == false) {
                                self.selectedCountryCodes.push(item.ItemId);
                            }
                        }
                    });
                }
                else if (groupList.itemGroupName == alertType && groupList.isSelectAll() == false) {
                    _.each(groupList.products, function (item) {
                        if (groupList.itemGroupName != 'Geographies') {
                            if (_.contains(_this.selectedCategoryIds(), item.ItemId) == true) {
                                self.selectedCategoryIds.remove(item.ItemId);
                            }
                        }
                        else {
                            if (_.contains(_this.selectedCountryCodes(), item.ItemId) == true) {
                                self.selectedCountryCodes.remove(item.ItemId);
                            }
                        }
                    });
                }
            });
        };
        //Clearing All the Selected Categories, geographies and Making Drop down - No Email. 
        AlertViewModel.prototype.clearEmailRssAlertsInternal = function () {
            var self = this;
            self.selectedCategoryIds.removeAll();
            self.selectedCountryCodes.removeAll();
            _.each(self.categoriesAndGeographies(), function (itemGroupName) {
                itemGroupName.isSelectAll(false);
            });
            var emailAlertFrequencyDropDownListBox = $("#emailAlertfrequency").data("kendoDropDownList");
            emailAlertFrequencyDropDownListBox.select(0);
            $("#EmailAlertFrequencyType").val("0");
        };
        AlertViewModel.prototype.selectPreSelectedAlerts = function () {
            var _this = this;
            var self = this;
            _.each(this.categoriesAndGeographies(), function (groupList) {
                _.each(groupList.products, function (item) {
                    if (item.IsSelected == true) {
                        if (groupList.itemGroupName != 'Geographies') {
                            if (_.contains(_this.selectedCategoryIds(), item.ItemId) == false) {
                                self.selectedCategoryIds.push(item.ItemId);
                            }
                        }
                        else if (_.contains(_this.selectedCountryCodes(), item.ItemId) == false) {
                            self.selectedCountryCodes.push(item.ItemId);
                        }
                    }
                });
            });
            return true;
        };
        AlertViewModel.prototype.mapObservablesToHiddenFieldInternal = function () {
            var self = this;
            self.categoryIds = ko.computed(function () {
                return self.selectedCategoryIds().join(',');
            });
            self.countryIds = ko.computed(function () {
                return self.selectedCountryCodes().join(',');
            });
            self.isCategorySelected = ko.computed(function () {
                return self.selectedCategoryIds().length > 0;
            });
            self.isCountrySelected = ko.computed(function () {
                return self.selectedCountryCodes().length > 0;
            });
        };
        // #endregion 
        // #region  public methods
        AlertViewModel.prototype.selectTemplateName = function (itemGroup) {
            if (itemGroup == 'Geographies')
                return "geographiesItemTemplate";
            return "categoriesItemTemplate";
        };
        AlertViewModel.prototype.checkBoxStyleInternal = function () {
            var self = this;
            if (self.htmlBrowserDetectClass.indexOf('k-ie8') > 0) {
                return "emi-checkbox-ie8";
            }
            return "emi-checkbox";
        };
        AlertViewModel.prototype.selectAllLabelStyleInternal = function () {
            var self = this;
            if (self.htmlBrowserDetectClass.indexOf('k-ie8') > 0) {
                return "emi-checkbox-label";
            }
            return "emi-checkbox-label select-all-label";
        };
        AlertViewModel.prototype.getBaseIndex = function (diviser) {
            return (Math.round(diviser) >= diviser) ? Math.round(diviser) : Math.round(diviser) + 1;
        };
        AlertViewModel.prototype.getBaseUrl = function (relativePath) {
            var path = "/" + window.location.pathname.split('/')[1] + relativePath;
            return path;
        };
        // #endregion 
        // #region private Methods 
        AlertViewModel.prototype.renderFirstColumnInternal = function (searchItems) {
            var diviser = 0, startIndex = 0, endIndex = 0;
            if (searchItems.length <= 2) {
                return searchItems;
            }
            else if (searchItems.length <= 4) {
                diviser = searchItems.length / 2;
                endIndex = this.getBaseIndex(diviser);
                return searchItems.slice(startIndex, endIndex);
            }
            else if (searchItems.length >= 5) {
                diviser = searchItems.length / 3;
                endIndex = this.getBaseIndex(diviser);
                return searchItems.slice(startIndex, endIndex);
            }
            return [];
        };
        AlertViewModel.prototype.renderSecondColumnInternal = function (searchItems) {
            var diviser = 0, startIndex = 0, endIndex = 0;
            if (searchItems.length > 2 && searchItems.length <= 4) {
                diviser = searchItems.length / 2;
                startIndex = this.getBaseIndex(diviser);
                endIndex = startIndex + Math.round(diviser);
                return searchItems.slice(startIndex, endIndex);
            }
            else if (searchItems.length >= 5) {
                diviser = searchItems.length / 3;
                startIndex = this.getBaseIndex(diviser);
                endIndex = startIndex + Math.round(diviser);
                return searchItems.slice(startIndex, endIndex);
            }
            return [];
        };
        AlertViewModel.prototype.renderThirdColumnInternal = function (searchItems) {
            var diviser = 0, startIndex = 0, endIndex = 0;
            if (searchItems.length >= 5) {
                diviser = searchItems.length / 3;
                startIndex = this.getBaseIndex(diviser) + Math.round(diviser);
                endIndex = searchItems.length;
                return searchItems.slice(startIndex, endIndex);
            }
            return [];
        };
        return AlertViewModel;
    }());
    ManageProfile.AlertViewModel = AlertViewModel;
})(ManageProfile || (ManageProfile = {}));
//# sourceMappingURL=AlertViewModel.js.map;
/// <reference path="../../typings/knockout.d.ts" />
/// <reference path="../../typings/underscore.d.ts" />
/// <reference path="../../typings/jquery/jquery.d.ts" />
var ManageProfile;
(function (ManageProfile) {
    var CategoryAndGeographyViewModel = (function () {
        function CategoryAndGeographyViewModel(itemGroupName, products) {
            this.isSelectAll = ko.observable(false);
            this.itemGroupName = itemGroupName;
            this.products = products;
        }
        return CategoryAndGeographyViewModel;
    }());
    ManageProfile.CategoryAndGeographyViewModel = CategoryAndGeographyViewModel;
})(ManageProfile || (ManageProfile = {}));
//# sourceMappingURL=CategoryAndGeographyViewModel.js.map;
/// <reference path="../../typings/knockout.d.ts" />
var StatisticsDataExportContext = (function () {
    function StatisticsDataExportContext(initialData) {
        var self = this;
        self.title = initialData.Title;
        self.description = initialData.Description;
        self.countryCodes = initialData.CountryCodes;
        self.categoryIds = initialData.CategoryIds;
        self.measureTypeId = initialData.MeasureTypeId;
        self.dataTypeIds = initialData.DataTypeIds;
        self.companyIds = initialData.CompanyIds;
        self.brandIds = initialData.BrandIds;
        self.ownerTypeIds = initialData.OwnerTypeIds;
        self.ownerTypeName = initialData.OwnerTypeName;
        self.projectCodes = initialData.ProjectCodes;
        self.displayTitle = initialData.DisplayTitle;
        self.resultsListContext = initialData.ResultsListContext;
        self.volumeIds = initialData.VolumeConversionIds;
        self.currentConstantIds = initialData.CurrentConstantIds;
        self.currentConstant = initialData.CurrentConstantIds;
        self.unitMultiplierIds = initialData.UnitMultiplierIds;
        self.growthIds = initialData.GrowthConversionIds;
        self.perCapitahouseholdIds = initialData.PerCapitaId;
        self.unitPriceIds = initialData.UnitPriceIds;
        self.timeSeriesIds = initialData.TimeSeriesIds;
        self.growth = initialData.Growth;
        self.growthYear = initialData.GrowthYear;
        self.exchangeRate = initialData.ExchangeRate;
        self.currencyConversionIds = initialData.CurrencyConversionIds;
    }
    return StatisticsDataExportContext;
}());
//# sourceMappingURL=StatisticsDataExportContext.js.map;
var DataExport;
(function (DataExport) {
    (function (MandatoryConversionsEnum) {
        MandatoryConversionsEnum[MandatoryConversionsEnum["Volume"] = "Volume"] = "Volume";
        MandatoryConversionsEnum[MandatoryConversionsEnum["CurrentConstant"] = "Current/Constant"] = "CurrentConstant";
        MandatoryConversionsEnum[MandatoryConversionsEnum["TimeSeries"] = 'Time Series'] = "TimeSeries";
    })(DataExport.MandatoryConversionsEnum || (DataExport.MandatoryConversionsEnum = {}));
    var MandatoryConversionsEnum = DataExport.MandatoryConversionsEnum;
})(DataExport || (DataExport = {}));
//# sourceMappingURL=MandatoryConversionsEnum.js.map;
var DataExport;
(function (DataExport) {
    (function (ActiveExportTab) {
        ActiveExportTab[ActiveExportTab["DataTypes"] = 0] = "DataTypes";
        ActiveExportTab[ActiveExportTab["ShareTypes"] = 1] = "ShareTypes";
        ActiveExportTab[ActiveExportTab["DataConversions"] = 2] = "DataConversions";
        ActiveExportTab[ActiveExportTab["FormatOptions"] = 3] = "FormatOptions";
        ActiveExportTab[ActiveExportTab["Complete"] = 4] = "Complete";
    })(DataExport.ActiveExportTab || (DataExport.ActiveExportTab = {}));
    var ActiveExportTab = DataExport.ActiveExportTab;
})(DataExport || (DataExport = {}));
//# sourceMappingURL=DataExportEnum.js.map;
/// <reference path="../../typings/knockout.d.ts" />
/// <reference path="../../typings/jquery/jquery.d.ts" />
var DataExportContext = (function () {
    function DataExportContext(tab) {
        var self = this;
        self.initialiseFeebackForm();
        self.activetab = tab;
        self.activateTab = function (tabID) {
            return self.activateTabInternal(tabID);
        };
        self.isShareTypeMeasure = function (measureId) {
            return self.isShareTypeMeasureInternal(measureId);
        };
        self.onBackButton = function (statisticsDataExportContext) {
            self.onBackButtonInternal(statisticsDataExportContext, self.activetab);
        };
        self.onExitButton = function (statisticsDataExportContext) {
            self.onExitButtonInternal(statisticsDataExportContext);
        };
    }
    DataExportContext.prototype.initialiseFeebackForm = function () {
        var self = this;
        self.showInterfaceBar = ko.observable(true);
        self.showInterfaceButton = ko.observable(false);
        self.showFeedbackPopUp = ko.observable(false);
        self.feedbackResponse = ko.observable("");
        self.feedbackRating = ko.observable("");
        self.feedbackDescription = ko.observable("");
        self.ratingValues = ko.observableArray([1, 2, 3, 4, 5]);
    };
    DataExportContext.prototype.showFeedbackForm = function () {
        var self = this;
        self.feedbackResponse("");
        self.feedbackRating("");
        self.feedbackDescription("");
        self.showFeedbackPopUp(true);
    };
    DataExportContext.prototype.applyChecked = function (checked) {
        var self = this;
        self.feedbackRating(checked);
    };
    DataExportContext.prototype.hideFooter = function () {
        $('.footerClose').click(function () {
            $('.footerMessage').hide();
        });
    };
    DataExportContext.prototype.validateFeedbackForm = function () {
        var self = this;
        $('.footerMessage').hide();
        if ((self.feedbackResponse().length < 1) && (self.feedbackRating().length < 1) && (self.feedbackDescription().length < 1)) {
            DisplayFooterMessage("Please provide us your feedback before you submit.");
            self.hideFooter();
            return;
        }
        $.ajax({
            url: self.getBaseUrl("/StatisticsDataExport/SubmitFeedback"),
            type: "POST",
            dataType: "json",
            data: {
                feedback: self.feedbackResponse() + "|" + self.feedbackRating() + "|" + self.feedbackDescription()
            },
            success: function (data) {
                DisplayFooterMessage(data);
                self.showFeedbackPopUp(false);
                self.hideFooter();
            },
            error: function () {
                DisplayFooterMessage("An error occurred submitting your feedback. Please try again or contact your Account Manager to submit feedback");
                self.hideFooter();
            }
        });
    };
    DataExportContext.prototype.activateTabInternal = function (tabID) {
        var self = this;
        if (tabID === self.activetab) {
            self.isActiveTabFound = true;
            return 'emi-dxt-tab__active';
        }
        return self.isActiveTabFound ? 'emi-dxt-tab__inactive' : 'emi-dxt-tab__visited';
    };
    DataExportContext.prototype.isShareTypeMeasureInternal = function (measureId) {
        return (measureId == StatisticsEvolution.WellKnownMeasureTypeEnum.BrandShares || measureId == StatisticsEvolution.WellKnownMeasureTypeEnum.CompanyShares);
    };
    DataExportContext.prototype.onBackButtonInternal = function (statisticsDataExportContext, activeTab) {
        var self = this;
        var postUrl = null;
        var postData = null;
        var stats = statisticsDataExportContext;
        postData = {
            CountryCodes: stats.countryCodes,
            CategoryIds: stats.categoryIds,
            MeasureTypeId: stats.measureTypeId,
            CompanyIds: stats.companyIds,
            BrandIds: stats.brandIds,
            OwnerTypeIds: stats.ownerTypeIds,
            DisplayTitle: stats.displayTitle,
            ProjectCodes: stats.projectCodes,
            VolumeConversionIds: stats.volumeIds,
            CurrentConstantIds: stats.currentConstantIds,
            OwnerTypeName: stats.ownerTypeName,
            ResultsListContext: stats.resultsListContext
        };
        switch (activeTab) {
            case DataExport.ActiveExportTab[DataExport.ActiveExportTab.ShareTypes]:
                postUrl = self.getBaseUrl("/ResultsList/Index");
                postData = stats.resultsListContext;
                break;
            case DataExport.ActiveExportTab[DataExport.ActiveExportTab.DataTypes]:
                if (self.isShareTypeMeasure(stats.measureTypeId)) {
                    postUrl = self.getBaseUrl("/StatisticsDataExport/ShareTypes");
                }
                else {
                    postUrl = self.getBaseUrl("/ResultsList/Index");
                    postData = stats.resultsListContext;
                }
                break;
            case DataExport.ActiveExportTab[DataExport.ActiveExportTab.DataConversions]:
                postData.DataTypeIds = stats.dataTypeIds;
                postUrl = self.getBaseUrl("/StatisticsDataExport/DataTypes");
                break;
            case DataExport.ActiveExportTab[DataExport.ActiveExportTab.FormatOptions]:
                postData.TimeSeriesIds = stats.timeSeriesIds;
                postData.UnitMultiplierIds = stats.unitMultiplierIds;
                postData.GrowthConversionIds = stats.growthIds;
                postData.PerCapitaId = stats.perCapitahouseholdIds;
                postData.CurrencyConversionIds = stats.currencyConversionIds;
                postData.UnitPriceIds = stats.unitPriceIds;
                postData.DataTypeIds = stats.dataTypeIds;
                postUrl = self.getBaseUrl("/StatisticsDataExport/ConvertData");
                break;
            case DataExport.ActiveExportTab[DataExport.ActiveExportTab.Complete]:
                postUrl = self.getBaseUrl("/StatisticsDataExport/FormatOptions");
                break;
        }
        var queryString = $.param($.toViewModel(postData));
        $.postAsForm(postUrl, decodeURIComponent(queryString));
    };
    DataExportContext.prototype.onExitButtonInternal = function (statisticsDataExportContext) {
        var self = this;
        var stats = statisticsDataExportContext;
        var postUrl = self.getBaseUrl("/ResultsList/Index");
        var queryString = $.param($.toViewModel(stats.resultsListContext));
        $.postAsForm(postUrl, decodeURIComponent(queryString));
    };
    DataExportContext.prototype.getBaseUrl = function (relativePath) {
        var path = "/" + window.location.pathname.split('/')[1] + relativePath;
        return path;
    };
    return DataExportContext;
}());
//# sourceMappingURL=DataExportContext.js.map;
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/// <reference path="../../typings/knockout.d.ts" />
var ShareTypeViewModel = (function (_super) {
    __extends(ShareTypeViewModel, _super);
    function ShareTypeViewModel(initialData) {
        _super.call(this, DataExport.ActiveExportTab[DataExport.ActiveExportTab.ShareTypes]);
        var self = this;
        self.ownerTypeIds = ko.observableArray([]);
        self.ownerTypeName = ko.observableArray([]);
        self.enableNextButton = ko.observable(false);
        self.isSelectAll = ko.observable(false);
        self.shareTypes = ko.observableArray(initialData);
        self.selectAllShareTypes = function () {
            return self.selectAllShareTypesInternal();
        };
        self.selectShareTypeByKey = function (isChecked, ownerTypeId, ownerTypeName) {
            return self.selectShareTypeByKeyInternal(isChecked, ownerTypeId, ownerTypeName);
        };
        for (var i = 0; i < initialData.length; i++) {
            var isSelected = initialData[i].IsSelected;
            initialData[i].IsSelected = ko.observable(isSelected);
            if (isSelected) {
                self.ownerTypeIds.push(initialData[i].OwnerTypeId);
                self.ownerTypeName.push(initialData[i].OwnerTypeName);
            }
        }
        if (initialData.length == self.ownerTypeIds().length) {
            self.isSelectAll(true);
        }
        self.EnableDisableNextButton();
    }
    ShareTypeViewModel.prototype.getShareTypes = function (key) {
        var self = this;
        var conversion = ko.utils.arrayFirst(self.shareTypes(), function (i) { return i.key == key; });
        return conversion;
    };
    ShareTypeViewModel.prototype.selectShareTypeByKeyInternal = function (isChecked, ownerTypeId, ownerTypeName) {
        var self = this;
        var shareTypeCount = self.shareTypes().length;
        if (isChecked) {
            self.ownerTypeIds.push(ownerTypeId);
            self.ownerTypeName.push(ownerTypeName);
            self.isSelectAll(self.ownerTypeIds().length == shareTypeCount);
        }
        else {
            self.isSelectAll(false);
            self.ownerTypeIds.remove(ownerTypeId);
            self.ownerTypeName.remove(ownerTypeName);
        }
        self.EnableDisableNextButton();
        return true;
    };
    ShareTypeViewModel.prototype.selectAllShareTypesInternal = function () {
        var self = this;
        self.ownerTypeIds([]);
        self.ownerTypeName([]);
        self.shareTypes().forEach(function (v, i) {
            (self.isSelectAll()) ? (self.ownerTypeIds.push(v.OwnerTypeId), self.ownerTypeName.push(v.OwnerTypeName), v.IsSelected(true)) : (self.ownerTypeIds.remove(v.OwnerTypeId), self.ownerTypeName.remove(v.OwnerTypeName), v.IsSelected(false));
        });
        self.EnableDisableNextButton();
        return true;
    };
    ShareTypeViewModel.prototype.EnableDisableNextButton = function () {
        var self = this;
        self.enableNextButton(self.ownerTypeIds().length > 0);
    };
    ShareTypeViewModel.prototype.ShareTypeSubmit = function (statisticsDataExportContext) {
        var self = this;
        var postUrl = self.getBaseUrl("/StatisticsDataExport/DataTypes");
        statisticsDataExportContext.ownerTypeIds = self.ownerTypeIds().toString();
        statisticsDataExportContext.ownerTypeName = self.ownerTypeName().toString();
        var jsonresult = JSON.parse(JSON.stringify(statisticsDataExportContext));
        var queryString = $.param($.toViewModel(jsonresult));
        $.postAsForm(postUrl, decodeURIComponent(queryString));
    };
    return ShareTypeViewModel;
}(DataExportContext));
//# sourceMappingURL=ShareTypeViewModel.js.map;
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/// <reference path="../../typings/knockout.d.ts" />
var DataTypeViewModel = (function (_super) {
    __extends(DataTypeViewModel, _super);
    function DataTypeViewModel(initialData) {
        _super.call(this, DataExport.ActiveExportTab[DataExport.ActiveExportTab.DataTypes]);
        var self = this;
        self.dataTypes = ko.observableArray(initialData);
        self.isSelectAll = ko.observable(false);
        self.dataTypeId = ko.observableArray([]);
        self.enableNextButton = ko.observable(true);
        self.selectAllDataTypes = function (data) {
            return self.selectDataTypesInternals(data);
        };
        self.selectCheckBox = function () {
            return self.selectCheckBoxInternals();
        };
        for (var i = 0; i < initialData.length; i++) {
            initialData[i].Selected = ko.observable(initialData[i].Selected);
        }
        self.selectCheckBoxInternals();
        if (initialData.length == self.dataTypeId().length) {
            self.isSelectAll(true);
        }
    }
    DataTypeViewModel.prototype.selectDataTypesInternals = function (data) {
        var _this = this;
        var self = this;
        self.dataTypeId([]);
        if (self.isSelectAll()) {
            data.dataTypes()
                .forEach(function (item) {
                item.Selected(true);
                _this.isSelectAll(true);
                _this.dataTypeId.push(item.DataTypeId);
            });
            self.enableNextButton(true);
        }
        else {
            data.dataTypes()
                .forEach(function (item) {
                item.Selected(false);
                _this.isSelectAll(false);
            });
            self.enableNextButton(false);
        }
        return true;
    };
    DataTypeViewModel.prototype.selectCheckBoxInternals = function () {
        var self = this;
        self.dataTypeId([]);
        self.enableNextButton(false);
        var dataTypeCount = self.dataTypes().length;
        for (var i = 0; i < dataTypeCount; i++) {
            if (self.dataTypes()[i].Selected() === true) {
                self.dataTypeId.push(self.dataTypes()[i].DataTypeId);
                self.enableNextButton(true);
            }
        }
        self.isSelectAll(self.dataTypeId().length === dataTypeCount);
        return true;
    };
    DataTypeViewModel.prototype.DataTypeSubmit = function (statisticsDataExportContext) {
        var self = this;
        var postUrl = self.getBaseUrl("/StatisticsDataExport/ConvertData");
        statisticsDataExportContext.dataTypeIds = self.dataTypeId().toString();
        var jsonresult = JSON.parse(JSON.stringify(statisticsDataExportContext));
        var queryString = $.param($.toViewModel(jsonresult));
        $.postAsForm(postUrl, decodeURIComponent(queryString));
    };
    return DataTypeViewModel;
}(DataExportContext));
//# sourceMappingURL=DataTypeViewModel.js.map;
/// <reference path="../../typings/knockout.d.ts" />
/// <reference path="../../typings/underscore.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var DataConversionsViewModel = (function (_super) {
    __extends(DataConversionsViewModel, _super);
    function DataConversionsViewModel(initialData) {
        _super.call(this, DataExport.ActiveExportTab[DataExport.ActiveExportTab.DataConversions]);
        var self = this;
        self.numberOfItems = 20;
        self.selectedConversion = ko.observable();
        self.cssClass = ko.observable('none');
        self.showMore = ko.observable(true);
        self.CurrencyIds = ko.observable(initialData.StatisticsDataExportContext.CurrencyConversionIds);
        self.unitPriceSelected = ko.observable(0);
        var persistedUnitPriceId = initialData.StatisticsDataExportContext.UnitPriceIds;
        self.unitPriceSelected((persistedUnitPriceId != null && persistedUnitPriceId != undefined && persistedUnitPriceId != '') ? persistedUnitPriceId : 0);
        self.additionalCurrency = ko.observable(false);
        self.growth = ko.observable(false);
        self.growthYear = ko.observable(false);
        self.selectedCurrencyType = ko.observable('');
        self.selectedExchangeRates = ko.observable('');
        self.localCurrency = ko.observable(false);
        self.localCurrencyID = ko.observable('');
        self.mandatoryConversions = ko.observableArray([]);
        self.conversions = ko.observableArray(self.mapDictionaryToArray(initialData.Conversions));
        self.timeSeries = ko.observable(ko.utils.arrayFirst(self.conversions(), function (i) { return i.key == "Time Series"; }));
        self.currency = ko.observable(ko.utils.arrayFirst(self.conversions(), function (i) { return i.key == "Currency"; }));
        self.growthConversion = ko.observable(ko.utils.arrayFirst(self.conversions(), function (i) { return i.key == "Growth"; }));
        self.currencyType = ko.observableArray([]);
        self.exchangeRates = ko.observableArray([]);
        if (self.currency() != null) {
            self.createCurrencyExchangeRate();
            var localCur = ko.utils.arrayFirst(self.currency().value(), function (item) { return item; });
            self.localCurrency = localCur.IsSelected;
            self.localCurrencyID(localCur.ConversionId);
        }
        self.selectAllConversion = function (key, isChecked) {
            return self.selectAllByKey(key, isChecked);
        };
        self.selectAdditionalCurrency = function (key, isChecked) {
            return self.selectAdditional(key, isChecked);
        };
        self.selectLocalCurrency = function (key, isChecked) {
            return self.selectLocal(key, isChecked);
        };
        self.selectedCurrencyType.subscribe(function (oldValue) {
            self.currency().selectedItems.remove(oldValue);
        }, null, 'beforeChange');
        self.selectedCurrencyType.subscribe(function (newValue) {
            self.selectCurrencyType(newValue);
        });
        self.selectedExchangeRates.subscribe(function (oldValue) {
            self.currency().selectedItems.remove(oldValue);
        }, null, 'beforeChange');
        self.selectedExchangeRates.subscribe(function (newValue) {
            self.selectExchangeRates(newValue);
        });
        self.enableNextButtonType = ko.observable(true);
        self.selectedConversion(ko.utils.arrayFirst(self.conversions(), function (item) { return item; }));
        self.decorateSelectedConversion = function (key) {
            return self.decorateSelectedConversionInternal(key);
        };
        if (self.currency() != null) {
            self.PersistCurrency(self.CurrencyIds());
        }
    }
    DataConversionsViewModel.prototype.PersistCurrency = function (currencyIds) {
        var self = this;
        if (currencyIds != '' && currencyIds != undefined && currencyIds != null) {
            var currency = self.currency();
            var localCurrency = currencyIds.split(',').filter(function (item) { return item == self.localCurrencyID(); });
            self.localCurrency(localCurrency.length > 0);
            var currencies = currencyIds.split(',').filter(function (item) { return item != self.localCurrencyID(); });
            if (currencies.length > 0) {
                self.additionalCurrency(true);
                var selectedAddCurrency = self.currency().value().filter(function (item) {
                    return item.ConversionId == parseInt(ko.utils.arrayFirst(currencies, function (i) { return i; }));
                });
                selectedAddCurrency = ko.utils.arrayFirst(selectedAddCurrency, function (i) { return i; });
                self.selectedCurrencyType(selectedAddCurrency.ConversionName.substring(0, selectedAddCurrency.ConversionName.indexOf('(')).trim());
                self.selectedExchangeRates(currencies.length == 1 ? selectedAddCurrency.ConversionName.substring(selectedAddCurrency.ConversionName.indexOf('(') + 1, selectedAddCurrency.ConversionName.indexOf(')')) : 'Both');
            }
            else
                self.additionalCurrency(false);
        }
    };
    DataConversionsViewModel.prototype.GetConversion = function (key) {
        var self = this;
        var conversion = ko.utils.arrayFirst(self.conversions(), function (i) { return i.key == key; });
        return conversion;
    };
    DataConversionsViewModel.prototype.IsAnyDataSelectedForMandatoryConversion = function () {
        var self = this;
        for (var conversionKey in DataExport.MandatoryConversionsEnum) {
            var conversion = self.GetConversion(conversionKey);
            if (conversion != null) {
                var conversionDataCopy = conversion.value();
                var isConversionSelected = conversionDataCopy.some(function (item) { return item.IsSelected(); });
                if (!isConversionSelected) {
                    self.mandatoryConversions.push(conversion.key);
                }
            }
        }
    };
    DataConversionsViewModel.prototype.isCurrencySelected = function () {
        var self = this;
        if (self.currency() != null) {
            if (!(self.localCurrency() || self.additionalCurrency())) {
                self.mandatoryConversions.push(self.currency().key);
            }
        }
    };
    DataConversionsViewModel.prototype.IsMandatoryConversionsSelected = function () {
        var self = this;
        self.mandatoryConversions([]);
        self.IsAnyDataSelectedForMandatoryConversion();
        self.isCurrencySelected();
        return self.mandatoryConversions().length == 0;
    };
    DataConversionsViewModel.prototype.loadConversion = function (key) {
        var self = this;
        self.selectedConversion(ko.utils.arrayFirst(self.conversions(), function (i) { return i.key == key; }));
    };
    DataConversionsViewModel.prototype.decorateSelectedConversionInternal = function (key) {
        var self = this;
        return key == self.selectedConversion().key ? 'emi-dxt-conversion__active-item' : 'emi-dxt-conversion__menu-item';
    };
    DataConversionsViewModel.prototype.mapDictionaryToArray = function (dictionary) {
        var result = [];
        for (var key in dictionary) {
            if (dictionary.hasOwnProperty(key)) {
                var valueArray = (dictionary[key]).map(function (item) { return { ConversionId: item.ConversionId, ConversionName: item.ConversionName, IsSelected: ko.observable(item.IsSelected) }; });
                var selectedItems = ko.utils.arrayFilter(valueArray, function (v) { return v.IsSelected() == true; }).map(function (item) { return item.ConversionName; });
                var selectedIds = ko.utils.arrayFilter(valueArray, function (v) { return v.IsSelected() == true; }).map(function (item) { return item.ConversionId; });
                result.push({
                    key: key, value: ko.observableArray(valueArray), isSelectAll: ko.observable(selectedItems.length === valueArray.length), selectedItems: ko.observableArray(selectedItems), selectedIds: ko.observableArray(selectedIds)
                });
            }
        }
        return result;
    };
    //Select Conversion for Radio button control
    DataConversionsViewModel.prototype.selectSingleConversionByKey = function (key, conversionName, conversionId) {
        var self = this;
        var conversionData = self.GetConversion(key);
        conversionData.selectedItems.removeAll();
        conversionData.selectedIds.removeAll();
        conversionData.selectedItems.push(conversionName);
        conversionData.selectedIds.push(conversionId);
        conversionData.value().forEach(function (v) { if (v.ConversionName !== conversionName)
            v.IsSelected(false); });
        return true;
    };
    //Select Conversion for Checkbox control
    DataConversionsViewModel.prototype.selectConversionByKey = function (key, isChecked, conversionName, conversionId) {
        var self = this;
        var conversionData = self.GetConversion(key);
        if (isChecked) {
            conversionData.selectedItems.push(conversionName);
            conversionData.selectedIds.push(conversionId);
        }
        else {
            conversionData.selectedItems.remove(conversionName);
            conversionData.selectedIds.remove(conversionId);
            conversionData.isSelectAll(isChecked);
        }
        conversionData.isSelectAll(conversionData.value().length === conversionData.selectedIds().length);
        return true;
    };
    DataConversionsViewModel.prototype.selectAllByKey = function (key, ischecked) {
        var self = this;
        var conversionData = self.GetConversion(key);
        var conversionDataCopy = conversionData.value();
        var selectedConversionIds = ko.utils.arrayMap(conversionDataCopy, function (item) { item.IsSelected(ischecked); return item.ConversionId; });
        conversionData.selectedIds([]);
        conversionData.isSelectAll(ischecked);
        conversionData.selectedIds(ischecked ? selectedConversionIds : []);
        return true;
    };
    DataConversionsViewModel.prototype.selectCurrencyType = function (newValue) {
        var self = this;
        self.currency().selectedItems.splice(1, 0, self.selectedCurrencyType());
    };
    DataConversionsViewModel.prototype.selectExchangeRates = function (newValue) {
        var self = this;
        self.currency().selectedItems.splice(2, 0, self.selectedExchangeRates());
    };
    DataConversionsViewModel.prototype.ToggleShowMoreOrLessInternal = function () {
        this.cssClass(this.showMore() ? 'inline-block' : 'none');
        this.showMore(!this.showMore());
    };
    DataConversionsViewModel.prototype.createCurrencyExchangeRate = function () {
        var self = this;
        var currency = [];
        var exchangeRates = [];
        self.currency().value().forEach(function (item) {
            currency.push(item.ConversionName.substring(0, item.ConversionName.indexOf('(')).trim());
            exchangeRates.push(item.ConversionName.substring(item.ConversionName.indexOf('(') + 1, item.ConversionName.indexOf(')')));
        });
        self.currencyType(ko.utils.arrayGetDistinctValues(currency).splice(1));
        self.exchangeRates(ko.utils.arrayGetDistinctValues(exchangeRates).splice(1));
        self.exchangeRates.push("Both");
    };
    DataConversionsViewModel.prototype.selectAdditional = function (key, ischecked) {
        var self = this;
        if (!self.additionalCurrency())
            self.selectedCurrencyType("USD");
        self.selectedExchangeRates("y-o-y ex rates");
        return true;
    };
    DataConversionsViewModel.prototype.selectLocal = function (key, ischecked) {
        var self = this;
        if (!ischecked) {
            self.currency().selectedItems.remove("Local currency");
        }
        else {
            self.currency().selectedItems.splice(0, 0, "Local currency");
        }
        return true;
    };
    DataConversionsViewModel.prototype.GetGrowthSelection = function () {
        var self = this;
        var items = self.growthConversion().selectedIds();
        if (items.length > 0) {
            items.forEach(function (v) {
                if (v == DataExport.GrowthConversionEnum.YearOnyear) {
                    self.growth(true);
                }
                if (v == DataExport.GrowthConversionEnum.PeriodGrowth) {
                    self.growthYear(true);
                }
            });
        }
    };
    DataConversionsViewModel.prototype.GetSelectedCurrencyIds = function () {
        var self = this;
        var consolidatedCurrencyIds = [];
        if (self.currency() != null) {
            if (self.localCurrency()) {
                consolidatedCurrencyIds.push(self.localCurrencyID());
            }
            if (self.additionalCurrency()) {
                if (self.selectedExchangeRates() === 'Both') {
                    var allCurrencyExchangeRates = self.currency().value().filter(function (item) {
                        return item.ConversionName.indexOf(self.selectedCurrencyType()) > -1;
                    }).map(function (item) { return item.ConversionId; });
                    ko.utils.arrayPushAll(consolidatedCurrencyIds, allCurrencyExchangeRates);
                }
                else {
                    var curr = self.selectedCurrencyType() + ' (' + self.selectedExchangeRates() + ')';
                    var additionalCurrencySelectedItem = ko.utils.arrayFirst(self.currency().value(), function (item) { return item.ConversionName === curr; });
                    consolidatedCurrencyIds.push(additionalCurrencySelectedItem.ConversionId);
                }
            }
        }
        return consolidatedCurrencyIds.toString();
    };
    DataConversionsViewModel.prototype.dataConversionSubmit = function (statisticsDataExport) {
        var self = this;
        ko.utils.arrayForEach(this.conversions(), function (item) {
            item.key = item.key.replace(/\//g, '');
            item.key = item.key.charAt(0).toLowerCase() + item.key.slice(1);
            statisticsDataExport[item.key.replace(" ", '') + "Ids"] = item.selectedIds().toString();
        });
        self.GetGrowthSelection();
        statisticsDataExport.exchangeRate = self.selectedExchangeRates();
        statisticsDataExport.growth = self.growth();
        statisticsDataExport.growthYear = self.growthYear();
        statisticsDataExport.currencyConversionIds = self.GetSelectedCurrencyIds();
        statisticsDataExport.unitPriceIds = self.unitPriceSelected();
        var jsonresult = JSON.parse(JSON.stringify(statisticsDataExport));
        jsonresult.PerCapitaId = statisticsDataExport.perCapitahouseholdIds;
        jsonresult.VolumeConversionIds = statisticsDataExport.volumeIds;
        jsonresult.GrowthConversionIds = statisticsDataExport.growthIds;
        var postUrl = this.getBaseUrl("/StatisticsDataExport/FormatOptions");
        var queryString = $.param($.toViewModel(jsonresult));
        $.postAsForm(postUrl, decodeURIComponent(queryString));
    };
    return DataConversionsViewModel;
}(DataExportContext));
//# sourceMappingURL=DataConversionsViewModel.js.map;
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/// <reference path="../../typings/knockout.d.ts" />
/// <reference path="../../typings/knockout.d.ts" />
var NoOfrows = 60000;
var FormatOptionViewModel = (function (_super) {
    __extends(FormatOptionViewModel, _super);
    function FormatOptionViewModel(initialData) {
        _super.call(this, DataExport.ActiveExportTab[DataExport.ActiveExportTab.FormatOptions]);
        var self = this;
        self.title = ko.observable('');
        self.description = ko.observable('');
        self.pivotedRowCount = initialData.PivotedRowCount;
        self.unPivotedRowCount = initialData.UnPivotedRowCount;
        self.selectedYears = initialData.SelectedYears;
        self.totalRows = ko.observable(initialData.UnPivotedRowCount);
        self.isChecked = ko.observable('Years in Columns');
        self.enableNextButton = ko.observable(NoOfrows > self.unPivotedRowCount);
        self.pivotView = ko.observable(false);
        self.unpivotView = ko.observable(false);
        self.downloadLink = ko.observable(false);
    }
    FormatOptionViewModel.prototype.CalculateRows = function (yearFormattingValues) {
        var self = this;
        (yearFormattingValues === 'YearInColumns') ? self.totalRows(self.unPivotedRowCount) : self.totalRows(self.pivotedRowCount);
        self.enableNextButton(self.totalRows() < NoOfrows);
    };
    FormatOptionViewModel.prototype.showSampleReport = function (viewId) {
        var self = this;
        if (viewId === 'unpivotView') {
            self.unpivotView(!self.unpivotView());
            self.pivotView(false);
        }
        else {
            self.pivotView(!self.pivotView());
            self.unpivotView(false);
        }
        self.downloadLink(self.unpivotView() || self.pivotView());
    };
    FormatOptionViewModel.prototype.downloadDummyExcel = function () {
        var self = this;
        var fileUrl = self.getBaseUrl("/StatisticsDataExport/CreateDummyExcel") + "?isPivotView=" + self.pivotView();
        $.fileDownload(fileUrl, {
            successCallback: function () {
            },
            failCallback: function () {
                DisplayFooterMessage("Error Occured");
            }
        });
    };
    FormatOptionViewModel.prototype.FormatOptionsSubmit = function (statisticsDataExportContext) {
        var self = this;
        var stats = statisticsDataExportContext;
        var postUrl = self.getBaseUrl("/StatisticsDataExport/ExportExcel");
        statisticsDataExportContext.title = encodeURIComponent(self.title());
        statisticsDataExportContext.description = encodeURIComponent(self.description());
        statisticsDataExportContext.currentConstant = (stats.currentConstantIds == null || stats.currentConstantIds == undefined) ? stats.currentConstant : stats.currentConstantIds;
        var postData = JSON.parse(JSON.stringify(statisticsDataExportContext));
        postData.PerCapitaId = statisticsDataExportContext.perCapitahouseholdIds;
        postData.VolumeConversionIds = statisticsDataExportContext.volumeIds;
        postData.PivotYears = self.isChecked();
        postData.TotalRows = self.totalRows();
        var queryString = $.param($.toViewModel(postData));
        $.postAsForm(postUrl, decodeURIComponent(queryString));
    };
    return FormatOptionViewModel;
}(DataExportContext));
//# sourceMappingURL=FormatOptionViewModel.js.map;
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var DataExportComplete = (function (_super) {
    __extends(DataExportComplete, _super);
    function DataExportComplete() {
        _super.call(this, DataExport.ActiveExportTab[DataExport.ActiveExportTab.Complete]);
    }
    return DataExportComplete;
}(DataExportContext));
//# sourceMappingURL=DataExportComplete.js.map;
var DataExport;
(function (DataExport) {
    (function (GrowthConversionEnum) {
        GrowthConversionEnum[GrowthConversionEnum["YearOnyear"] = 1] = "YearOnyear";
        GrowthConversionEnum[GrowthConversionEnum["PeriodGrowth"] = 2] = "PeriodGrowth";
    })(DataExport.GrowthConversionEnum || (DataExport.GrowthConversionEnum = {}));
    var GrowthConversionEnum = DataExport.GrowthConversionEnum;
})(DataExport || (DataExport = {}));
//# sourceMappingURL=GrowthConversionEnum.js.map;
